Skip to content

Instantly share code, notes, and snippets.

@fowlmouth
Created August 31, 2012 21:38
Show Gist options
  • Save fowlmouth/3559478 to your computer and use it in GitHub Desktop.
Save fowlmouth/3559478 to your computer and use it in GitHub Desktop.
#
# STFL - The Structured Terminal Forms Language/Library
# Copyright (C) 2006, 2007 Clifford Wolf <[email protected]>
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
# version 3 of the License, or (at your option) any later version.
#
# This library is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# Lesser General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public
# License along with this library; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
# MA 02110-1301 USA
#
# stfl.h: The STFL C header file
#
#var stfl_api_allow_null_pointers*{.importc: "stfl_api_allow_null_pointers",
# dynlib: Lib.}: cint
const Lib = "libstfl.so.0.22"
type
Pform* = ptr Tform
Tform*{.pure, final.} = object
Pipool* = ptr Tipool
Tipool*{.pure, final.} = object
proc stfl_create*(text: WideCString): Pform {.
cdecl, importc: "stfl_create", dynlib: Lib.}
proc stfl_free*(f: Pform){.
cdecl, importc: "stfl_free", dynlib: Lib.}
proc stfl_run*(f: Pform; timeout: cint): WideCString{.
cdecl, importc: "stfl_run", dynlib: Lib.}
proc stfl_reset*(){.
cdecl, importc: "stfl_reset", dynlib: Lib.}
proc stfl_get*(f: Pform; name: WideCString): WideCString{.
cdecl, importc: "stfl_get", dynlib: Lib.}
proc stfl_set*(f: Pform; name: WideCString; value: WideCString){.
cdecl, importc: "stfl_set", dynlib: Lib.}
proc stfl_get_focus*(f: Pform): WideCString{.
cdecl, importc: "stfl_get_focus", dynlib: Lib.}
proc stfl_set_focus*(f: Pform; name: WideCString){.
cdecl, importc: "stfl_set_focus", dynlib: Lib.}
proc stfl_quote*(text: WideCString): WideCString{.
cdecl, importc: "stfl_quote", dynlib: Lib.}
proc stfl_dump*(f: Pform; name: WideCString; prefix: WideCString; focus: cint): WideCString{.
cdecl, importc: "stfl_dump", dynlib: Lib.}
proc stfl_modify*(f: Pform; name: WideCString; mode: WideCString; text: WideCString){.
cdecl, importc: "stfl_modify", dynlib: Lib.}
proc stfl_lookup*(f: Pform; path: WideCString; newname: WideCString): WideCString{.
cdecl, importc: "stfl_lookup", dynlib: Lib.}
proc stfl_error*(): WideCString{.
cdecl, importc: "stfl_error", dynlib: Lib.}
proc stfl_error_action*(mode: WideCString){.
cdecl, importc: "stfl_error_action", dynlib: Lib.}
proc stfl_ipool_create*(code: cstring): Pipool {.
cdecl, importc: "stfl_ipool_create", dynlib: Lib.}
proc stfl_ipool_add*(pool: Pipool; data: pointer): pointer{.
cdecl, importc: "stfl_ipool_add", dynlib: Lib.}
proc stfl_ipool_towc*(pool: Pipool; buf: cstring): WideCString{.
cdecl, importc: "stfl_ipool_towc", dynlib: Lib.}
proc stfl_ipool_fromwc*(pool: Pipool; buf: WideCString): cstring{.
cdecl, importc: "stfl_ipool_fromwc", dynlib: Lib.}
proc stfl_ipool_flush*(pool: Pipool){.
cdecl, importc: "stfl_ipool_flush", dynlib: Lib.}
proc stfl_ipool_destroy*(pool: Pipool){.
cdecl, importc: "stfl_ipool_destroy", dynlib: Lib.}
when isMainModule:
var ip = stfl_ipool_create
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment