aboutsummaryrefslogtreecommitdiffstats
path: root/bindings
diff options
context:
space:
mode:
authordanglassey <danglassey>2002-08-14 09:57:17 +0000
committerdanglassey <danglassey>2002-08-14 09:57:17 +0000
commitc9458897ebbb739d8db83c80e06512d8a612f743 (patch)
treef8c5381045887e34388cc6b26cfccc254bf766dc /bindings
downloadsword-sf-cvs-c9458897ebbb739d8db83c80e06512d8a612f743.tar.gz
*** empty log message ***
Diffstat (limited to 'bindings')
-rw-r--r--bindings/Makefile9
-rw-r--r--bindings/Makefile.am5
-rw-r--r--bindings/clx/Sword.pas211
-rw-r--r--bindings/clx/test1/MainFrm.pas116
-rw-r--r--bindings/clx/test1/MainFrm.xfm90
-rw-r--r--bindings/clx/test1/test1.conf36
-rw-r--r--bindings/clx/test1/test1.dpr14
-rw-r--r--bindings/clx/test1/test1.kof61
-rw-r--r--bindings/clx/test1/test1.resbin0 -> 32 bytes
-rw-r--r--bindings/clx/test1/test1g.bpg15
-rw-r--r--bindings/clx/test2/MainFrm.pas417
-rw-r--r--bindings/clx/test2/MainFrm.xfm753
-rw-r--r--bindings/clx/test2/test2.conf38
-rw-r--r--bindings/clx/test2/test2.dpr14
-rw-r--r--bindings/clx/test2/test2.kof61
-rw-r--r--bindings/clx/test2/test2.resbin0 -> 32 bytes
-rw-r--r--bindings/flatapi.cpp259
-rw-r--r--bindings/gsoap/Makefile12
-rw-r--r--bindings/gsoap/gsoapsword.cpp142
-rw-r--r--bindings/gsoap/gsoapsword.h65
-rw-r--r--bindings/gsoap/include/stdsoap.h493
-rwxr-xr-xbindings/gsoap/soapcppbin0 -> 534312 bytes
-rw-r--r--bindings/gsoap/testclient.cpp76
-rw-r--r--bindings/perl/Changes18
-rw-r--r--bindings/perl/Makefile.PL91
-rw-r--r--bindings/perl/README36
-rw-r--r--bindings/perl/Sword.pm1087
-rw-r--r--bindings/perl/Sword.xs254
-rw-r--r--bindings/perl/perlobject.map106
-rw-r--r--bindings/perl/test.pl163
-rw-r--r--bindings/perl/typemap3
-rw-r--r--bindings/swig/Makefile21
-rw-r--r--bindings/swig/Makefile.swig578
-rw-r--r--bindings/swig/listkey.i91
-rw-r--r--bindings/swig/localemgr.i22
-rw-r--r--bindings/swig/lzsscompress.i11
-rw-r--r--bindings/swig/rawcom.i13
-rw-r--r--bindings/swig/rawgenbook.i13
-rw-r--r--bindings/swig/rawld.i12
-rw-r--r--bindings/swig/rawld4.i12
-rw-r--r--bindings/swig/rawtext.i11
-rw-r--r--bindings/swig/swcom.i9
-rw-r--r--bindings/swig/swcompress.i16
-rw-r--r--bindings/swig/swconfig.i42
-rw-r--r--bindings/swig/swfiltermgr.i21
-rw-r--r--bindings/swig/swgenbook.i10
-rw-r--r--bindings/swig/swig-perl.doxygen177
-rw-r--r--bindings/swig/swkey.i69
-rw-r--r--bindings/swig/swld.i10
-rw-r--r--bindings/swig/swmgr.i41
-rw-r--r--bindings/swig/swmodule.i99
-rw-r--r--bindings/swig/sword.i50
-rw-r--r--bindings/swig/sword.pl101
-rw-r--r--bindings/swig/swposition.i14
-rw-r--r--bindings/swig/swtext.i10
-rw-r--r--bindings/swig/treekey.i47
-rw-r--r--bindings/swig/treekeyidx.i53
-rw-r--r--bindings/swig/versekey.i51
-rw-r--r--bindings/swig/zcom.i11
-rw-r--r--bindings/swig/zipcompress.i11
-rw-r--r--bindings/swig/zld.i12
-rw-r--r--bindings/swig/ztext.i12
62 files changed, 6295 insertions, 0 deletions
diff --git a/bindings/Makefile b/bindings/Makefile
new file mode 100644
index 0000000..2ea344d
--- /dev/null
+++ b/bindings/Makefile
@@ -0,0 +1,9 @@
+
+root := ..
+targets := ${root}/lib/libsword.a
+clean-targets := none
+include ${root}/Makefile.cfg
+
+cpp += flatapi.cpp
+
+include ${root}/Makefile.post
diff --git a/bindings/Makefile.am b/bindings/Makefile.am
new file mode 100644
index 0000000..86b8ab2
--- /dev/null
+++ b/bindings/Makefile.am
@@ -0,0 +1,5 @@
+
+bindingsdir = $(top_srcdir)/bindings
+libsword_la_SOURCES += $(bindingsdir)/flatapi.cpp
+
+
diff --git a/bindings/clx/Sword.pas b/bindings/clx/Sword.pas
new file mode 100644
index 0000000..239f932
--- /dev/null
+++ b/bindings/clx/Sword.pas
@@ -0,0 +1,211 @@
+unit Sword;
+
+interface
+ function SWMgr_getPrefixPath(h: integer): PChar; cdecl; external 'libsword.so';
+ function SWMgr_new: integer; cdecl; external 'libsword.so';
+ procedure SWMgr_delete(h: integer); cdecl; external 'libsword.so';
+ function SWMgr_getModulesIterator(h: integer) : integer; cdecl; external 'libsword.so';
+ function SWMgr_getModuleByName(h: integer; name: PChar) : integer; cdecl; external 'libsword.so';
+
+ procedure ModList_iterator_next(h: integer); cdecl; external 'libsword.so';
+ function ModList_iterator_val(h: integer) : integer; cdecl; external 'libsword.so';
+
+ function SWModule_getType(h: integer) : PChar; cdecl; external 'libsword.so';
+ function SWModule_getName(h: integer) : PChar; cdecl; external 'libsword.so';
+ function SWModule_getDescription(h: integer) : PChar; cdecl; external 'libsword.so';
+ function SWModule_getStripText(h: integer) : PChar; cdecl; external 'libsword.so';
+ function SWModule_getRenderText(h: integer) : PChar; cdecl; external 'libsword.so';
+ function SWModule_getKeyText(h: integer) : PChar; cdecl; external 'libsword.so';
+ procedure SWModule_setKeyText(h: integer; key: PChar); cdecl; external 'libsword.so';
+ procedure SWModule_begin(h: integer); cdecl; external 'libsword.so';
+ procedure SWModule_next(h: integer); cdecl; external 'libsword.so';
+ procedure SWModule_previous(h: integer); cdecl; external 'libsword.so';
+type
+
+ SWModule = class(TObject)
+ private
+ handle : integer;
+ public
+ constructor Create(handle : integer);
+ function getType : String;
+ function getName : String;
+ function getDescription : String;
+ function getStripText : String;
+ function getRenderText : WideString;
+ function getKeyText : String;
+ procedure setKeyText(keyText : String);
+ procedure modBegin;
+ procedure modNext;
+ procedure modPrevious;
+ end;
+
+
+ ModIterator = class(TObject)
+ private
+ handle : integer;
+ public
+ constructor Create(handle : integer);
+ procedure next;
+ function getValue : SWModule;
+ end;
+
+
+ SWMgr = class(TObject)
+ private
+ handle : integer;
+ public
+ constructor Create;
+ destructor Destroy; override;
+ function getPrefixPath : String;
+ function getModulesIterator : ModIterator;
+ function getModuleByName(name: String) : SWModule;
+ end;
+
+implementation
+
+constructor SWMgr.Create;
+var
+ yohan : integer;
+begin
+ yohan := SWMgr_new;
+ handle := yohan;
+end;
+
+
+destructor SWMgr.Destroy;
+begin
+ SWMgr_delete(handle);
+end;
+
+
+function SWMgr.getPrefixPath() : String;
+var
+ stuff : String;
+ pstuff : PChar;
+begin
+ pstuff := SWMgr_getPrefixPath(handle);
+ stuff := String(pstuff);
+ Result := stuff;
+end;
+
+
+function SWMgr.getModulesIterator : ModIterator;
+begin
+ Result := ModIterator.Create(SWMgr_getModulesIterator(handle));
+end;
+
+function SWMgr.getModuleByName(name: String) : SWModule;
+var
+ modHandle : Integer;
+
+begin
+ modHandle := SWMgr_getModuleByName(handle, PChar(name));
+ if (modHandle <> 0) then
+ Result := SWModule.Create(modHandle)
+ else Result := nil;
+end;
+
+
+
+
+{ ModIterator methods --------------------------------------------- }
+
+
+constructor ModIterator.Create(handle : integer);
+begin
+ Self.handle := handle;
+end;
+
+
+procedure ModIterator.next;
+begin
+ ModList_iterator_next(handle);
+end;
+
+
+function ModIterator.getValue : SWModule;
+var
+ modHandle : Integer;
+
+begin
+ modHandle := ModList_iterator_val(handle);
+ if (modHandle <> 0) then
+ Result := SWModule.Create(modHandle)
+ else Result := nil;
+end;
+
+
+
+
+
+{ SWModule methods --------------------------------------------- }
+
+
+constructor SWModule.Create(handle : integer);
+begin
+ Self.handle := handle;
+end;
+
+
+function SWModule.getType : String;
+begin
+ Result := String(SWModule_getType(handle));
+end;
+
+
+function SWModule.getName : String;
+begin
+ Result := String(SWModule_getName(handle));
+end;
+
+
+function SWModule.getDescription : String;
+begin
+ Result := String(SWModule_getDescription(handle));
+end;
+
+
+function SWModule.getStripText : String;
+begin
+ Result := String(SWModule_getStripText(handle));
+end;
+
+
+function SWModule.getRenderText : WideString;
+begin
+ Result := WideString(SWModule_getRenderText(handle));
+end;
+
+
+function SWModule.getKeyText : String;
+begin
+ Result := String(SWModule_getKeyText(handle));
+end;
+
+
+procedure SWModule.setKeyText(keyText: String);
+begin
+ SWModule_setKeyText(handle, PChar(keyText));
+end;
+
+
+procedure SWModule.modBegin;
+begin
+ SWModule_begin(handle);
+end;
+
+
+procedure SWModule.modNext;
+begin
+ SWModule_next(handle);
+end;
+
+
+procedure SWModule.modPrevious;
+begin
+ SWModule_previous(handle);
+end;
+
+end.
+
+
diff --git a/bindings/clx/test1/MainFrm.pas b/bindings/clx/test1/MainFrm.pas
new file mode 100644
index 0000000..2d28a7f
--- /dev/null
+++ b/bindings/clx/test1/MainFrm.pas
@@ -0,0 +1,116 @@
+unit MainFrm;
+
+interface
+
+uses
+ SysUtils, Types, Classes, Variants, QGraphics, QControls, QForms, QDialogs,
+ QStdCtrls, QComCtrls, QExtCtrls, Sword;
+
+type
+ TForm1 = class(TForm)
+ Panel1: TPanel;
+ Panel2: TPanel;
+ Panel3: TPanel;
+ TreeView1: TTreeView;
+ Button1: TButton;
+ Edit1: TEdit;
+ Label1: TLabel;
+ TextBrowser1: TTextBrowser;
+ procedure Edit1Change(Sender: TObject);
+ procedure TreeView1Change(Sender: TObject; Node: TTreeNode);
+ procedure Button1Click(Sender: TObject);
+ procedure FormCreate(Sender: TObject);
+ procedure FormShow(Sender: TObject);
+ private
+ procedure lookup();
+ public
+ { Public declarations }
+ end;
+
+var
+ Form1: TForm1;
+ mgr : SWMgr;
+
+implementation
+
+{$R *.xfm}
+
+procedure TForm1.Edit1Change(Sender: TObject);
+begin
+ lookup();
+end;
+
+procedure TForm1.lookup();
+var
+ module : SWModule;
+ node : TTreeNode;
+
+begin
+ node := TreeView1.Selected;
+ if (node <> nil) then
+ begin
+ module := mgr.getModuleByName(node.Text);
+ if (module <> nil) then
+ begin
+ module.setKeyText(Edit1.Text);
+
+ TextBrowser1.Text :=
+ '<HTML><BODY>' +
+ '<small><b>' + module.getKeyText() + '<b></small> ' +
+ module.getRenderText() +
+ '</BODY></HTML>';
+
+ Label1.Caption := ': ' + module.getKeyText();
+ end;
+ end;
+end;
+
+procedure TForm1.TreeView1Change(Sender: TObject; Node: TTreeNode);
+begin
+ lookup();
+end;
+
+procedure TForm1.Button1Click(Sender: TObject);
+begin
+ Application.Terminate;
+end;
+
+procedure TForm1.FormCreate(Sender: TObject);
+begin
+ mgr := SWMgr.Create;
+end;
+
+procedure TForm1.FormShow(Sender: TObject);
+var
+ root, node : TTreeNode;
+ module : SWModule;
+ modIt : ModIterator;
+ found : Boolean;
+
+begin
+// root := TreeView1.TopItem;
+// root := TreeView1.Items.AddChild(TreeView1.TopItem, 'Modules');
+
+ modIt := mgr.getModulesIterator;
+ module := modIt.getValue;
+ while (module <> nil) do
+ begin
+ node := TreeView1.Items.GetFirstNode;
+ found := false;
+ while ((node <> nil) AND (NOT found)) do
+ begin
+ if (node.Text = module.getType) then
+ found := true
+ else node := node.getNextSibling;
+ end;
+ if (node = nil) then
+ node := TreeView1.Items.AddChild(TreeView1.TopItem, module.GetType());
+
+ TreeView1.Items.AddChild(node, module.GetName());
+
+ modIt.Next;
+ module := modIt.getValue;
+ end;
+end;
+
+end.
diff --git a/bindings/clx/test1/MainFrm.xfm b/bindings/clx/test1/MainFrm.xfm
new file mode 100644
index 0000000..ce77f46
--- /dev/null
+++ b/bindings/clx/test1/MainFrm.xfm
@@ -0,0 +1,90 @@
+object Form1: TForm1
+ Left = 260
+ Top = 148
+ Width = 592
+ Height = 487
+ HorzScrollBar.Range = 185
+ VertScrollBar.Range = 41
+ Caption = 'Form1'
+ Color = clBackground
+ OnCreate = FormCreate
+ OnShow = FormShow
+ PixelsPerInch = 108
+ TextHeight = 20
+ TextWidth = 8
+ object Panel1: TPanel
+ Left = 0
+ Top = 41
+ Width = 185
+ Height = 446
+ Align = alLeft
+ Caption = 'Panel1'
+ TabOrder = 0
+ object TreeView1: TTreeView
+ Left = 1
+ Top = 1
+ Width = 183
+ Height = 444
+ Align = alClient
+ Columns = <>
+ TabOrder = 0
+ OnChange = TreeView1Change
+ end
+ end
+ object Panel2: TPanel
+ Left = 185
+ Top = 41
+ Width = 407
+ Height = 446
+ Align = alClient
+ Caption = 'Panel2'
+ TabOrder = 1
+ object TextBrowser1: TTextBrowser
+ Left = 1
+ Top = 1
+ Width = 405
+ Height = 444
+ Align = alClient
+ TabOrder = 0
+ TextFormat = tfText
+ end
+ end
+ object Panel3: TPanel
+ Left = 0
+ Top = 0
+ Width = 592
+ Height = 41
+ Align = alTop
+ TabOrder = 2
+ object Button1: TButton
+ Left = 509
+ Top = 8
+ Width = 75
+ Height = 25
+ Anchors = [akTop, akRight]
+ Caption = 'Exit'
+ TabOrder = 0
+ OnClick = Button1Click
+ end
+ object Edit1: TEdit
+ Left = 136
+ Top = 8
+ Width = 177
+ Height = 28
+ TabOrder = 1
+ OnChange = Edit1Change
+ end
+ object Label1: TLabel
+ Left = 328
+ Top = 12
+ Width = 1
+ Height = 20
+ Font.Color = clBlack
+ Font.Height = 17
+ Font.Name = 'Helvetica'
+ Font.Pitch = fpVariable
+ Font.Style = [fsBold]
+ ParentFont = False
+ end
+ end
+end
diff --git a/bindings/clx/test1/test1.conf b/bindings/clx/test1/test1.conf
new file mode 100644
index 0000000..b6fb6e7
--- /dev/null
+++ b/bindings/clx/test1/test1.conf
@@ -0,0 +1,36 @@
+-$A8
+-$B-
+-$C+
+-$D+
+-$E-
+-$F-
+-$G+
+-$H+
+-$I+
+-$J-
+-$K-
+-$L+
+-$M-
+-$N+
+-$O+
+-$P+
+-$Q-
+-$R-
+-$S-
+-$T-
+-$U-
+-$V+
+-$W-
+-$X+
+-$YD
+-$Z1
+-cg
+-H+
+-W+
+-M
+-$M16384,1048576
+-K$00400000
+-U"../"
+-O"../"
+-I"../"
+-R"../"
diff --git a/bindings/clx/test1/test1.dpr b/bindings/clx/test1/test1.dpr
new file mode 100644
index 0000000..7b18af9
--- /dev/null
+++ b/bindings/clx/test1/test1.dpr
@@ -0,0 +1,14 @@
+program test1;
+
+uses
+ QForms,
+ MainFrm in 'MainFrm.pas' {Form1},
+ Sword in '../Sword.pas';
+
+{$R *.res}
+
+begin
+ Application.Initialize;
+ Application.CreateForm(TForm1, Form1);
+ Application.Run;
+end.
diff --git a/bindings/clx/test1/test1.kof b/bindings/clx/test1/test1.kof
new file mode 100644
index 0000000..99b034e
--- /dev/null
+++ b/bindings/clx/test1/test1.kof
@@ -0,0 +1,61 @@
+[Compiler]
+A=8
+B=0
+C=1
+D=1
+E=0
+F=0
+G=1
+H=1
+I=1
+J=0
+K=0
+L=1
+M=0
+N=1
+O=1
+P=1
+Q=0
+R=0
+S=0
+T=0
+U=0
+V=1
+W=0
+X=1
+Y=1
+Z=1
+ShowHints=1
+ShowWarnings=1
+UnitAliases=
+
+[Linker]
+MapFile=0
+OutputObjs=0
+ConsoleApp=1
+DebugInfo=0
+RemoteSymbols=0
+MinStackSize=16384
+MaxStackSize=1048576
+ImageBase=4194304
+ExeDescription=
+DynamicLoader=/lib/ld-linux.so.2
+
+[Directories]
+OutputDir=
+UnitOutputDir=
+PackageDLLOutputDir=
+PackageDCPOutputDir=
+SearchPath=../
+Packages=baseclx:visualclx
+Conditionals=
+DebugSourceDirs=
+UsePackages=0
+
+[Parameters]
+RunParams=
+HostApplication=
+Launcher=/usr/X11R6/bin/xterm -T KylixDebuggerOutput -e bash -i -c %debuggee%
+UseLauncher=0
+DebugCWD=
+
diff --git a/bindings/clx/test1/test1.res b/bindings/clx/test1/test1.res
new file mode 100644
index 0000000..36f26e2
--- /dev/null
+++ b/bindings/clx/test1/test1.res
Binary files differ
diff --git a/bindings/clx/test1/test1g.bpg b/bindings/clx/test1/test1g.bpg
new file mode 100644
index 0000000..db19a61
--- /dev/null
+++ b/bindings/clx/test1/test1g.bpg
@@ -0,0 +1,15 @@
+#------------------------------------------------------------------------------
+VERSION = BWS.02.5
+#------------------------------------------------------------------------------
+MAKE = make -$(MAKEFLAGS) -f$**
+DCC =dcc $<
+#------------------------------------------------------------------------------
+PROJECTS = test1
+#------------------------------------------------------------------------------
+default: $(PROJECTS)
+#------------------------------------------------------------------------------
+
+test1: test1.dpr
+ $(DCC)
+
+
diff --git a/bindings/clx/test2/MainFrm.pas b/bindings/clx/test2/MainFrm.pas
new file mode 100644
index 0000000..dc13e5e
--- /dev/null
+++ b/bindings/clx/test2/MainFrm.pas
@@ -0,0 +1,417 @@
+unit MainFrm;
+
+interface
+
+uses
+ SysUtils, StrUtils, Types, Classes, Variants, QGraphics, QControls, QForms, QDialogs,
+ QStdCtrls, QComCtrls, QExtCtrls, Sword, QButtons, QImgList, QMenus,
+ QTypes;
+
+type
+ TForm1 = class(TForm)
+ Panel1: TPanel;
+ TreeView1: TTreeView;
+ ImageList1: TImageList;
+ Splitter1: TSplitter;
+ Panel3: TPanel;
+ Splitter2: TSplitter;
+ Panel4: TPanel;
+ TextBrowser2: TTextBrowser;
+ Panel5: TPanel;
+ ListView: TListView;
+ Splitter3: TSplitter;
+ Panel6: TPanel;
+ Edit2: TEdit;
+ StatusBar1: TStatusBar;
+ ColorDialog1: TColorDialog;
+ FontDialog1: TFontDialog;
+ Panel8: TPanel;
+ Splitter4: TSplitter;
+ Panel7: TPanel;
+ TextBrowser3: TTextBrowser;
+ Panel2: TPanel;
+ TextBrowser1: TTextBrowser;
+ ToolBar2: TToolBar;
+ Edit1: TEdit;
+ ComboBox1: TComboBox;
+ SpinEdit1: TSpinEdit;
+ SpinEdit2: TSpinEdit;
+ ToolButton4: TToolButton;
+ Label2: TLabel;
+ btnBTFollow: TToolButton;
+ btnCMFollow: TToolButton;
+ ImageList2: TImageList;
+ MainMenu1: TMainMenu;
+ File1: TMenuItem;
+ Exit1: TMenuItem;
+ Options1: TMenuItem;
+ Strongs1: TMenuItem;
+ MorphTags1: TMenuItem;
+ Footnotes1: TMenuItem;
+ ChangeTextFont1: TMenuItem;
+ CurrentVerseColor1: TMenuItem;
+ procedure Edit1Change(Sender: TObject);
+ procedure TreeView1Change(Sender: TObject; Node: TTreeNode);
+ procedure Button1Click(Sender: TObject);
+ procedure FormCreate(Sender: TObject);
+ procedure FormShow(Sender: TObject);
+ procedure ToolButton1Click(Sender: TObject);
+ procedure Edit2Change(Sender: TObject);
+ procedure ListViewItemClick(Sender: TObject; Button: TMouseButton;
+ Item: TListItem; const Pt: TPoint; ColIndex: Integer);
+ procedure SpinEdit2Changed(Sender: TObject; NewValue: Integer);
+ procedure SpinEdit1Changed(Sender: TObject; NewValue: Integer);
+ procedure ComboBox1Change(Sender: TObject);
+ procedure CurrentVerseColor1Click(Sender: TObject);
+ private
+ fontName: string;
+ fontSize: integer;
+ doOnChange: boolean;
+ procedure setBookCombo(ref: String);
+ procedure lookup();
+ procedure lookupLD();
+ function getChapter(key: String): integer;
+ function getVerse(key: String): integer;
+ procedure FillDictKeys(key: String);
+ public
+ { Public declarations }
+ curModBT: String;
+ curModCM: String;
+ curModLD: String;
+ end;
+
+var
+ Form1: TForm1;
+ mgr : SWMgr;
+
+implementation
+
+{$R *.xfm}
+
+procedure TForm1.Edit1Change(Sender: TObject);
+begin
+ if (doOnChange) then
+ lookup();
+end;
+
+procedure TForm1.setBookCombo(ref: string);
+var
+ pos: integer;
+ bookname: string;
+
+begin
+ pos := LastDelimiter(' ',ref);
+ bookname := LeftStr(ref,pos);
+ ComboBox1.Text := bookname;
+end;
+
+function TForm1.getChapter(key: String): integer;
+var
+ len: integer;
+ pos: integer;
+ j: integer;
+ tmpbuf: String;
+begin
+ //len := Length(key);
+ pos := LastDelimiter(':',key);
+ tmpbuf := '000';
+ j := 3;
+ for len := pos-1 downto 0 do
+ begin
+ if(key[len] <> ' ') then
+ begin
+ tmpbuf[j] := key[len];
+ j := j -1;
+ end
+ else break;
+ end;
+ Result := StrToInt(tmpbuf);
+end;
+
+
+function TForm1.getVerse(key: String): integer;
+var
+ len: integer;
+ pos: integer;
+ j: integer;
+ i: integer;
+ tmpbuf: String;
+begin
+ len := Length(key);
+ pos := LastDelimiter(':',key);
+ tmpbuf := ' ';
+ j := 1;
+ for i := pos+1 to len do
+ begin
+ if(key[i] <> '') then
+ begin
+ tmpbuf[j] := key[i];
+ j := j + 1;
+ end
+ else break;
+ end;
+ tmpbuf := TrimRight(tmpbuf);
+ Result := StrToInt(tmpbuf);
+end;
+
+
+procedure TForm1.lookup();
+var
+ module : SWModule;
+ chapter : integer;
+ buf : string;
+ currentVerse : string;
+ text : string;
+ key : string;
+ verse : integer;
+ j : integer;
+begin
+ module := mgr.getModuleByName(curModBT);
+ if (module <> nil) then
+ begin
+ module.setKeyText(Edit1.Text);
+ currentVerse := module.getKeyText;
+ chapter := getChapter(currentVerse);
+ verse := getVerse(currentVerse);
+
+ doOnChange := false;
+ setBookCombo(currentVerse);
+ SpinEdit1.Value := chapter;
+ SpinEdit2.Value := verse;
+ doOnChange := true;
+
+ buf := ' ';
+ key := module.getKeyText;
+ j := 1;
+ if(AnsiContainsText(key,':')) then
+ begin
+ while key[j] <> ':' do
+ begin
+ buf[j] := key[j];
+ j := j + 1;
+ end;
+ end;
+ buf := TrimRight(buf);
+ buf := buf + ':1';
+ module.setKeyText(buf);
+ text := '<html><body>';
+ while(chapter = getChapter(module.getKeyText)) do
+ begin
+ if(currentVerse = module.getKeyText) then
+ text := text + '<small><b><font color="blue">' +
+ module.getKeyText() +
+ '</font><b></small> ' +
+ '<A NAME="cv"><font face="' + fontName +
+ '" size="' + IntToStr(fontSize) +
+ '"color="forest green">' +
+ module.getRenderText() + '</font></a><br>'
+ else
+ text := text + '<small><b><font color="blue">' +
+ module.getKeyText() +
+ '</font><b></small> ' + '<font face="' +
+ fontName + '" size="' + IntToStr(fontSize) + '">' +
+ module.getRenderText() + '</font><br>';
+ //buf := IntToStr(chapter);
+ //Label1.Caption := IntToStr(chapter) + ':' + IntToStr(verse);
+ module.modNext;
+ end;
+ text := text + '</body></html>';
+ TextBrowser1.Text := text;
+ TextBrowser1.ScrollToAnchor('cv');
+ StatusBar1.SimpleText := currentVerse;
+ end;
+ //end;
+
+
+ if(btnCMFollow.Down) then
+ begin
+ module := mgr.getModuleByName(curModCM);
+ if (module <> nil) then
+ begin
+ module.setKeyText(Edit1.Text);
+ TextBrowser3.Text :=
+ '<HTML><BODY>' +
+ '<font color="blue"><small><b>[' +
+ module.getName + '] ' +
+ module.getKeyText() +
+ '<b></small></font> ' +
+ module.getRenderText() +
+ '</BODY></HTML>';
+
+ //Label1.Caption := ': ' + module.getKeyText();
+ end;
+ end;
+end;
+
+procedure TForm1.lookupLD();
+var
+ module : SWModule;
+begin
+ module := mgr.getModuleByName(curModLD);
+ if (module <> nil) then
+ begin
+ module.setKeyText(Edit2.Text);
+ TextBrowser2.Text :=
+ '<HTML><BODY>' +
+ '<font color="blue"><small><b>[' +
+ module.getName + '] ' + module.getKeyText() +
+ '<b></small></font> ' +
+ module.getRenderText() +
+ '</BODY></HTML>';
+ end;
+ FillDictKeys(module.getKeyText);
+
+
+end;
+
+procedure TForm1.TreeView1Change(Sender: TObject; Node: TTreeNode);
+var
+ module : SWModule;
+
+begin
+ module := mgr.getModuleByName(Node.Text);
+ if (module <> nil) then
+ begin
+ if(module.getType = 'Biblical Texts') then
+ begin
+ curModBT := Node.Text;
+ lookup();
+ end;
+
+ if(module.getType = 'Commentaries') then
+ begin
+ curModCM := Node.Text;
+ lookup();
+ end;
+
+ if(module.getType = 'Lexicons / Dictionaries') then
+ begin
+ curModLD := Node.Text;
+ lookupLD;
+ end;
+ end;
+end;
+
+procedure TForm1.Button1Click(Sender: TObject);
+begin
+ Application.Terminate;
+end;
+
+procedure TForm1.FormCreate(Sender: TObject);
+begin
+ mgr := SWMgr.Create;
+end;
+
+procedure TForm1.FormShow(Sender: TObject);
+var
+ node : TTreeNode;
+ module : SWModule;
+ modIt : ModIterator;
+ found : Boolean;
+
+begin
+ doOnChange := true;
+ fontName := '';
+ fontSize := 3; // html font size
+
+ modIt := mgr.getModulesIterator;
+ module := modIt.getValue;
+ while (module <> nil) do
+ begin
+ node := TreeView1.Items.GetFirstNode;
+ found := false;
+ while ((node <> nil) AND (NOT found)) do
+ begin
+ if (node.Text = module.getType) then
+ found := true
+ else node := node.getNextSibling;
+ end;
+ if (node = nil) then
+ node := TreeView1.Items.AddChild(TreeView1.TopItem, module.GetType());
+
+ TreeView1.Items.AddChild(node, module.GetName());
+
+ modIt.Next;
+ module := modIt.getValue;
+ end;
+end;
+
+procedure TForm1.ToolButton1Click(Sender: TObject);
+begin
+ FontDialog1.Execute;
+ fontName := FontDialog1.Font.Name;
+ fontSize := FontDialog1.Font.Size;
+ if (fontSize > 18) then fontSize := 7
+ else if (fontSize < 8) then fontSize := 1
+ else if (fontSize = 8) then fontSize := 1
+ else if (fontSize = 9) then fontSize := 1
+ else if (fontSize = 10) then fontSize := 2
+ else if (fontSize = 11) then fontSize := 3
+ else if (fontSize = 12) then fontSize := 3
+ else if (fontSize = 13) then fontSize := 4
+ else if (fontSize = 14) then fontSize := 5
+ else if (fontSize = 15) then fontSize := 5
+ else if (fontSize = 16) then fontSize := 6
+ else if (fontSize = 17) then fontSize := 6
+ else if (fontSize = 18) then fontSize := 7;
+
+ lookup;
+end;
+
+procedure TForm1.Edit2Change(Sender: TObject);
+begin
+ lookupLD();
+end;
+
+
+procedure TForm1.FillDictKeys(key: string);
+var
+ module : SWModule;
+ count : integer;
+ i : integer;
+ ListItem: TListItem;
+begin
+ module := mgr.getModuleByName(curModLD);
+ count := (ListView.Height div (ListView.Font.Height + 8));
+ ListView.Items.Clear;
+ for i := 0 to (count div 2) do
+ module.modNext; //-- get equal number of keys before and after our starting key(saveKey)
+ for i := 0 to count - 1 do
+ module.modPrevious;
+ for i := 0 to count do
+ begin
+ ListItem := ListView.Items.Add;
+ ListItem.Caption := module.getKeyText;
+ module.modNext;
+ end;
+ module.setKeyText(key);
+end;
+
+procedure TForm1.ListViewItemClick(Sender: TObject; Button: TMouseButton;
+ Item: TListItem; const Pt: TPoint; ColIndex: Integer);
+begin
+ Edit2.Text := Item.Caption;
+end;
+
+procedure TForm1.SpinEdit2Changed(Sender: TObject; NewValue: Integer);
+begin
+ Edit1.Text := ComboBox1.Text + ' ' + SpinEdit1.Text + ':' + SpinEdit2.Text;
+end;
+
+procedure TForm1.SpinEdit1Changed(Sender: TObject; NewValue: Integer);
+begin
+ Edit1.Text := ComboBox1.Text + ' ' + SpinEdit1.Text + ':1';
+end;
+
+procedure TForm1.ComboBox1Change(Sender: TObject);
+begin
+ Edit1.Text := ComboBox1.Text + ' ' + '1:1';
+end;
+
+procedure TForm1.CurrentVerseColor1Click(Sender: TObject);
+begin
+ ColorDialog1.Execute
+ //ColorDialog1.Color
+end;
+
+end.
diff --git a/bindings/clx/test2/MainFrm.xfm b/bindings/clx/test2/MainFrm.xfm
new file mode 100644
index 0000000..180fac1
--- /dev/null
+++ b/bindings/clx/test2/MainFrm.xfm
@@ -0,0 +1,753 @@
+object Form1: TForm1
+ Left = 331
+ Top = 273
+ Width = 608
+ Height = 407
+ HorzScrollBar.Range = 118
+ VertScrollBar.Range = 19
+ ActiveControl = TreeView1
+ Caption = 'KylixSWORD'
+ Color = clBackground
+ Menu = MainMenu1
+ OnCreate = FormCreate
+ OnShow = FormShow
+ PixelsPerInch = 108
+ TextHeight = 15
+ TextWidth = 7
+ object Splitter1: TSplitter
+ Left = 113
+ Top = 0
+ Width = 5
+ Height = 363
+ Beveled = True
+ end
+ object Panel1: TPanel
+ Left = 0
+ Top = 0
+ Width = 113
+ Height = 363
+ Align = alLeft
+ Caption = 'Panel1'
+ TabOrder = 0
+ object TreeView1: TTreeView
+ Left = 1
+ Top = 1
+ Width = 111
+ Height = 361
+ Align = alClient
+ Color = clLight
+ Columns = <>
+ TabOrder = 0
+ OnChange = TreeView1Change
+ end
+ end
+ object Panel3: TPanel
+ Left = 118
+ Top = 0
+ Width = 490
+ Height = 363
+ Align = alClient
+ Caption = 'Panel3'
+ TabOrder = 1
+ object Splitter2: TSplitter
+ Left = 1
+ Top = 231
+ Width = 488
+ Height = 5
+ Cursor = crVSplit
+ Align = alBottom
+ end
+ object Panel4: TPanel
+ Left = 1
+ Top = 236
+ Width = 488
+ Height = 126
+ Align = alBottom
+ TabOrder = 0
+ object Splitter3: TSplitter
+ Left = 283
+ Top = 1
+ Width = 5
+ Height = 124
+ Align = alRight
+ end
+ object TextBrowser2: TTextBrowser
+ Left = 1
+ Top = 1
+ Width = 282
+ Height = 124
+ Align = alClient
+ TabOrder = 0
+ end
+ object Panel5: TPanel
+ Left = 288
+ Top = 1
+ Width = 199
+ Height = 124
+ Align = alRight
+ TabOrder = 1
+ object ListView: TListView
+ Left = 1
+ Top = 25
+ Width = 197
+ Height = 98
+ Align = alClient
+ Columns = <>
+ TabOrder = 0
+ OnItemClick = ListViewItemClick
+ end
+ object Panel6: TPanel
+ Left = 1
+ Top = 1
+ Width = 197
+ Height = 24
+ Align = alTop
+ Caption = 'Panel6'
+ TabOrder = 1
+ object Edit2: TEdit
+ Left = 2
+ Top = 1
+ Width = 193
+ Height = 22
+ AutoSize = False
+ Font.CharSet = fcsUnicode
+ Font.Color = clBlack
+ Font.Height = 13
+ Font.Name = 'arial unicode ms'
+ Font.Pitch = fpVariable
+ Font.Style = []
+ ParentFont = False
+ TabOrder = 0
+ Text = 'GRACE'
+ OnChange = Edit2Change
+ end
+ end
+ end
+ end
+ object Panel8: TPanel
+ Left = 1
+ Top = 28
+ Width = 488
+ Height = 203
+ Align = alClient
+ Caption = 'Panel8'
+ TabOrder = 1
+ object Splitter4: TSplitter
+ Left = 249
+ Top = 1
+ Width = 5
+ Height = 201
+ Align = alRight
+ end
+ object Panel7: TPanel
+ Left = 254
+ Top = 1
+ Width = 233
+ Height = 201
+ Align = alRight
+ Caption = 'Panel7'
+ TabOrder = 0
+ object TextBrowser3: TTextBrowser
+ Left = 1
+ Top = 1
+ Width = 231
+ Height = 199
+ Align = alClient
+ TabOrder = 0
+ end
+ end
+ object Panel2: TPanel
+ Left = 1
+ Top = 1
+ Width = 248
+ Height = 201
+ Align = alClient
+ Caption = 'Panel2'
+ TabOrder = 1
+ object TextBrowser1: TTextBrowser
+ Left = 1
+ Top = 1
+ Width = 246
+ Height = 199
+ Align = alClient
+ TabOrder = 0
+ end
+ end
+ end
+ object ToolBar2: TToolBar
+ Left = 1
+ Top = 1
+ Width = 488
+ Height = 27
+ ButtonHeight = 23
+ Caption = 'ToolBar2'
+ Images = ImageList2
+ TabOrder = 2
+ object Edit1: TEdit
+ Left = 51
+ Top = 4
+ Width = 166
+ Height = 23
+ AutoSize = False
+ Font.CharSet = fcsUnicode
+ Font.Color = clBlack
+ Font.Height = 13
+ Font.Name = 'arial unicode ms'
+ Font.Pitch = fpVariable
+ Font.Style = []
+ ParentFont = False
+ TabOrder = 0
+ Text = 'Genesis 1:1'
+ OnChange = Edit1Change
+ end
+ object ComboBox1: TComboBox
+ Left = 225
+ Top = 4
+ Width = 120
+ Height = 23
+ ItemHeight = 17
+ Items.Strings = (
+ 'Genesis'
+ 'Exodus'
+ 'Leviticus'
+ 'Numbers'
+ 'Deuteronomy'
+ 'Joshua'
+ 'Judges'
+ 'Ruth'
+ 'I Samuel'
+ 'II Samuel'
+ 'I Kings'
+ 'II Kings'
+ 'I Chronicles'
+ 'II Chronicles'
+ 'Ezra'
+ 'Nehemiah'
+ 'Esther'
+ 'Job'
+ 'Psalms'
+ 'Proverbs'
+ 'Ecclesiastes'
+ 'Song of Solomon'
+ 'Isaiah'
+ 'Jeremiah'
+ 'Lamentations'
+ 'Ezekiel'
+ 'Daniel'
+ 'Hosea'
+ 'Joel'
+ 'Amos'
+ 'Obadiah'
+ 'Jonah'
+ 'Micah'
+ 'Nahum'
+ 'Habakkuk'
+ 'Zephaniah'
+ 'Haggai'
+ 'Zechariah'
+ 'Malachi'
+ 'Matthew'
+ 'Mark'
+ 'Luke'
+ 'John'
+ 'Acts'
+ 'Romans'
+ 'I Corinthians'
+ 'II Corinthians'
+ 'Galatians'
+ 'Ephesians'
+ 'Philippians'
+ 'Colossians'
+ 'I Thessalonians'
+ 'II Thessalonians'
+ 'I Timothy'
+ 'II Timothy'
+ 'Titus'
+ 'Philemon'
+ 'Hebrews'
+ 'James'
+ 'I Peter'
+ 'II Peter'
+ 'I John'
+ 'II John'
+ 'III John'
+ 'Jude'
+ 'Revelation of John')
+ ItemIndex = 0
+ TabOrder = 1
+ Text = 'Genesis'
+ OnChange = ComboBox1Change
+ end
+ object SpinEdit1: TSpinEdit
+ Left = 345
+ Top = 4
+ Width = 45
+ Height = 23
+ Align = alCustom
+ TabOrder = 2
+ OnChanged = SpinEdit1Changed
+ end
+ object SpinEdit2: TSpinEdit
+ Left = 390
+ Top = 4
+ Width = 45
+ Height = 23
+ Align = alCustom
+ TabOrder = 3
+ OnChanged = SpinEdit2Changed
+ end
+ object ToolButton4: TToolButton
+ Left = 217
+ Top = 4
+ Width = 8
+ Height = 23
+ Style = tbsSeparator
+ Caption = 'ToolButton4'
+ end
+ object Label2: TLabel
+ Left = 1
+ Top = 4
+ Width = 50
+ Height = 20
+ Align = alLeft
+ Alignment = taCenter
+ AutoSize = False
+ Caption = 'KJV'
+ Layout = tlCenter
+ end
+ object btnBTFollow: TToolButton
+ Tag = 2
+ Left = 435
+ Top = 4
+ Height = 23
+ Style = tbsCheck
+ Caption = 'btnBTFollow'
+ Down = True
+ ImageIndex = 1
+ end
+ object btnCMFollow: TToolButton
+ Tag = 2
+ Left = 458
+ Top = 4
+ Height = 23
+ Style = tbsCheck
+ Caption = 'CM'
+ Down = True
+ ImageIndex = 0
+ end
+ end
+ end
+ object StatusBar1: TStatusBar
+ Left = 0
+ Top = 363
+ Width = 608
+ Height = 19
+ Panels = <>
+ SimplePanel = True
+ SimpleText = 'Genesis 1:1'
+ end
+ object ImageList1: TImageList
+ Height = 24
+ Width = 24
+ Left = 472
+ Top = 72
+ Bitmap = {
+ 494D474C01000100180000001800000004000000424D361B0000000000003600
+ 00002800000030000000300000000100180000000000001B0000120B0000120B
+ 00000000000000000000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
+ FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
+ FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
+ FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
+ FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
+ FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
+ FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
+ FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
+ FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
+ FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
+ FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
+ FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
+ FFFFFFFFFFFFFF89B7DB88B6DB6E97B91E2C38FFFFFFFFFFFFFFFFFFFFFFFFFF
+ FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
+ FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
+ FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
+ FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF97BFDF88B6DB77A2C5
+ 54779510181FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
+ FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
+ FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF5445495445495445495445492B1918
+ FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
+ FFFFFFFFFFFFFF9CC2E188B6DB88B6DB6C95B74C6B863F586E0E161CFFFFFFFF
+ FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
+ FFFFFFFFFFFFFFFFFF4F3D3F737482432B2A3516103516103516106158607A7E
+ 8FA2BBD8A2BBD8A2BBD87E8597281A1A11090AFFFFFFFFFFFFFFFFFFFFFFFFFF
+ FFFFFFFFFFFFFFFF000000000000000000FFFFFFFFFFFF698EABB0CEE785B3D7
+ 8DB9DC7FACD05779924F6F8716232DFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
+ FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF35161097AAC4A2BBD895
+ A7C092A3BB92A3BB92A3BB9BB1CCA2BBD8A2BBD8A2BBD8A2BBD890A0B772798A
+ 09070BFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF000000FFFF
+ FFFFFFFFFFFFFF2D4A53B6D2E9A3C7E291BCDAB7D3E584B1D66D95B548667F43
+ 565CFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
+ FFFFFFFFFFFF351610A2BBD8A2BBD8A2BBD8A2BBD8A2BBD8A2BBD8A2BBD8A2BB
+ D8A2BBD8A2BBD8A2BBD87E85975A5259110A0BFFFFFFFFFFFFFFFFFFFFFFFFFF
+ FFFFFFFFFFFFFFFFFFFFFF000000FFFFFFFFFFFFFFFFFF9595959EC0DCCADDEE
+ BAD4E988B6DBB5D0E76A8FAD83AFD245627B1F241FFFFFFFFFFFFFFFFFFFFFFF
+ FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF6A6772A2BBD8A2
+ BBD8A2BBD8A2BBD8A2BBD8A2BBD8A2BBD8A2BBD8A2BBD8A2BBD87678864E3E41
+ 160B0BFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF0000
+ 00000000000000FFFFFF7F97ABB7D3E8ACCCE6B3D0E7729DBD88B5DA5C809E0C
+ 101225271FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
+ FFFFFFFFFFFFFFFFFFFFFFFF737482A2BBD8A2BBD8A2BBD8A2BBD8A2BBD8A2BB
+ D8A2BBD8A2BBD8A2BBD890A0B7838C9F515460040509FFFFFFFFFFFFFFFFFFFF
+ FFFFFFFFFFFFFFFFFFFFFFFFFFFF000000FFFFFF0000000000005C748787A7C0
+ BBD3E877A1C389AFCF678EAF495252536E81FFFFFFFFFFFFFFFFFFFFFFFFFFFF
+ FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF737482A2
+ BBD8A2BBD8A2BBD8A2BBD8A2BBD8A2BBD8A2BBD8A2BBD8A2BBD88793A7737482
+ 73748221232AFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF0000000000
+ 00000000000000000000FFFFFF9FB6C7AFCDE5688FAE7FA0B65D73843850631D
+ 211FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
+ FFFFFFFFFFFFFFFFFFFFFFFF737482A2BBD8A2BBD8A2BBD8A2BBD899AEC88CA1
+ BA8BA1BA8BA1BA8BA1BA8BA1BA8BA1BA8BA1BA28303AFFFFFFFFFFFFFFFFFFFF
+ FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF608198
+ 607C8E8CB8DC48657D5050503C3C3C324A5BFFFFFFFFFFFFFFFFFFFFFFFFFFFF
+ FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF737482A2
+ BBD8A2BBD8A2BBD8A2BBD8645D660C0709000307000307000307000307000307
+ 000307000307FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
+ FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF5E5E5E8EABC16C95B54B5C5B4242420F
+ 0F0FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
+ FFFFFFFFFFFFFFFFFF33354495A7C0A2BBD8A2BBD8A2BBD8A2BBD8645D66FFFF
+ FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
+ FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
+ FFFFFF5656568DB4D45C809AFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
+ FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF33394AA2BBD8A2
+ BBD8A2BBD8A2BBD8A2BBD8A2BBD8202332FFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
+ FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF0000000000
+ 00000000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF56565688B1D148627600
+ 0000000000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
+ FFFFFFFFFFFFFFFFFF33394AA2BBD8A2BBD8A2BBD8A2BBD8A2BBD8A2BBD82023
+ 32FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
+ FFFFFFFFFFFFFFFFFFFFFFFFFFFF000000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
+ FFFFFFFFFFFFFFFFFF7F9DB3678DAD2A2A2AFFFFFFFFFFFFFFFFFFFFFFFFFFFF
+ FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF33394AA2BBD8A2
+ BBD8A2BBD8A2BBD8A2BBD8A2BBD8202332FFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
+ FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF0000
+ 00FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF6788A348
+ 6783FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
+ FFFFFFFFFFFFFFFFFF33394AA2BBD8A2BBD8A2BBD8A2BBD8A2BBD8A2BBD82023
+ 32FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
+ FFFFFFFFFFFFFFFFFFFFFFFFFFFF000000000000000000000000FFFFFFFFFFFF
+ FFFFFFFFFFFFFFFFFFFFFFFF2D2F1B678AA42E2E2E000000000000FFFFFFFFFF
+ FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF33394AA2BBD8A2
+ BBD8A2BBD8FFFFFFA2BBD8A2BBD8202332FFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
+ FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF0000
+ 00000000FFFFFF000000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF42
+ 4242000000FFFFFF000000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
+ FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
+ FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
+ FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF000000FFFFFFFFFFFF000000FFFFFF
+ FFFFFFFFFFFFFFFFFFFFFFFFFFFFFF000000000000FFFFFFFFFFFF000000FFFF
+ FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
+ FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
+ FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF0000
+ 00000000000000000000000000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF00
+ 0000000000000000000000000000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
+ FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
+ FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
+ FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
+ FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
+ FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
+ FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
+ FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
+ FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
+ FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
+ FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
+ FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
+ FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
+ FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
+ FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
+ FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
+ FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
+ FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
+ FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
+ FFFFFFFFFFFFFFFFFFFFFFFFFFFFFF4E12E54E12E5FFFFFFFFFFFFFFFFFFFFFF
+ FFFFFFFFFFFFFFFFFFFF4E12E54E12E5FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
+ FFFFFFFFFFFFFFFFFFFFFFFFFFFF4E12E54E12E5FFFFFFFFFFFFFFFFFFFFFFFF
+ FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF4E12E54E12
+ E5FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF4E12E54E
+ 12E5FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF4E12E5
+ 4E12E5FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF4E12E54E12
+ E5FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
+ FFFFFFFFFFFFFFFFFFFFFFFFFFFF4E12E54E12E5FFFFFFFFFFFFFFFFFFFFFFFF
+ FFFFFFFFFFFFFFFFFF4E12E54E12E5FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
+ FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF4E12E54E12E5FFFFFFFFFFFFFFFFFFFF
+ FFFFFFFFFFFFFFFF4E12E54E12E5FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
+ FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
+ FF4E12E54E12E5FFFFFFFFFFFFFFFFFFFFFFFFFFFFFF4E12E54E12E5FFFFFFFF
+ FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
+ FFFFFF4E12E54E12E5FFFFFFFFFFFFFFFFFFFFFFFF4E12E54E12E5FFFFFFFFFF
+ FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
+ FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF4E12E54E12E5FFFFFFFFFFFF
+ FFFFFF4E12E54E12E5FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
+ FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF4E12E54E12E5FFFFFFFF
+ FFFFFFFFFF4E12E5FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
+ FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
+ FFFFFFFFFFFFFF4E12E5FFFFFFFFFFFF4E12E54E12E5FFFFFFFFFFFFFFFFFFFF
+ FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
+ FFFFFFFFFFFFFFFFFF4E12E54E12E5FFFFFF4E12E54E12E5FFFFFFFFFFFFE014
+ 1BFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFE0141BFFFFFFFFFFFFE0141BE0141BFF
+ FFFFFFFFFFE0141BFFFFFFFFFFFFE0141BFFFFFFFFFFFF4E12E5FFFFFF4E12E5
+ 4E12E5FFFFFFE0141BE0141BE0141BE0141BFFFFFFFFFFFFFFFFFFFFFFFFE014
+ 1BFFFFFFFFFFFFFFFFFFE0141BFFFFFFFFFFFFFFFFFFE0141BFFFFFF4E12E54E
+ 12E54E12E54E12E5FFFFFFFFFFFFE0141BFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
+ E0141BFFFFFFE0141BFFFFFFFFFFFFE0141BFFFFFFE0141BFFFFFFFFFFFFE014
+ 1BFFFFFFFFFFFF4E12E5FFFFFF4E12E5FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
+ FFFFE0141BFFFFFFFFFFFFFFFFFFE0141BFFFFFFFFFFFFFFFFFFE0141BFFFFFF
+ FFFFFFFFFFFFE0141BFFFFFFFFFFFF4E12E54E12E54E12E5FFFFFFFFFFFFE014
+ 1BFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFE0141BFFFFFFE0141BFFFFFFFFFFFFE0
+ 141BFFFFFFE0141BFFFFFFFFFFFFE0141BFFFFFFFFFFFF4E12E54E12E54E12E5
+ FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFE0141BFFFFFFFFFFFFFFFFFFE014
+ 1BFFFFFFFFFFFFFFFFFFE0141BFFFFFFFFFFFFFFFFFFE0141BFFFFFFFFFFFF4E
+ 12E54E12E54E12E5FFFFFFFFFFFFE0141BFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
+ E0141BFFFFFFE0141BFFFFFFFFFFFFE0141BFFFFFFE0141BFFFFFFFFFFFFE014
+ 1BFFFFFFFFFFFF4E12E54E12E54E12E5FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
+ FFFFE0141BFFFFFFFFFFFFFFFFFFE0141BFFFFFFFFFFFFFFFFFFE0141BFFFFFF
+ FFFFFFFFFFFFE0141BFFFFFFFFFFFF4E12E54E12E54E12E5FFFFFFFFFFFFE014
+ 1BFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFE0141BFFFFFFE0141BFFFFFFFFFFFFE0
+ 141BFFFFFFE0141BFFFFFFFFFFFFE0141BFFFFFFFFFFFF4E12E54E12E54E12E5
+ FFFFFFFFFFFFFFFFFFE0141BE0141BE0141BE0141BFFFFFFFFFFFFFFFFFFE014
+ 1BFFFFFFFFFFFFFFFFFFE0141BE0141BE0141BE0141BFFFFFFFFFFFFFFFFFF4E
+ 12E54E12E54E12E5FFFFFFFFFFFFE0141BFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
+ E0141BFFFFFFE0141BFFFFFFFFFFFFE0141BFFFFFFE0141BE0141BE0141BFFFF
+ FFFFFFFFFFFFFF4E12E54E12E54E12E5FFFFFFFFFFFFE0141BFFFFFFFFFFFFFF
+ FFFFFFFFFFFFFFFFFFFFFFFFFFFFE0141BFFFFFFFFFFFFFFFFFFE0141BFFFFFF
+ FFFFFFFFFFFFE0141BFFFFFFFFFFFF4E12E54E12E54E12E5FFFFFFFFFFFFE014
+ 1BFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFE0141BFFFFFFE0141BFFFFFFFFFFFFE0
+ 141BFFFFFFE0141BFFFFFFFFFFFFE0141BFFFFFFFFFFFF4E12E54E12E54E12E5
+ FFFFFFFFFFFFE0141BFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFE014
+ 1BFFFFFFFFFFFFFFFFFFE0141BFFFFFFFFFFFFFFFFFFE0141BFFFFFFFFFFFF4E
+ 12E54E12E54E12E5FFFFFFFFFFFFE0141BFFFFFFFFFFFFE0141BFFFFFFFFFFFF
+ E0141BFFFFFFE0141BFFFFFFFFFFFFE0141BFFFFFFE0141BFFFFFFFFFFFFE014
+ 1BFFFFFFFFFFFF4E12E5FFFFFF4E12E5FFFFFFFFFFFFE0141BFFFFFFFFFFFFFF
+ FFFFFFFFFFFFFFFFFFFFFFFFFFFFE0141BFFFFFFFFFFFFFFFFFFE0141BFFFFFF
+ FFFFFFFFFFFFE0141BFFFFFFFFFFFF4E12E54E12E54E12E5FFFFFFFFFFFFE014
+ 1BFFFFFFE0141BFFFFFFE0141BFFFFFFE0141BFFFFFFE0141BFFFFFFFFFFFFE0
+ 141BFFFFFFE0141BFFFFFFFFFFFFE0141BFFFFFFFFFFFF4E12E5FFFFFF4E12E5
+ 4E12E5FFFFFFFFFFFFE0141BE0141BE0141BE0141BFFFFFFE0141BE0141BE014
+ 1BE0141BE0141BFFFFFFE0141BE0141BE0141BE0141BFFFFFFFFFFFF4E12E54E
+ 12E54E12E54E12E5FFFFFFFFFFFFE0141BE0141BFFFFFFFFFFFFFFFFFFE0141B
+ E0141BFFFFFFFFFFFFE0141BE0141BFFFFFFFFFFFFE0141BE0141BE0141BFFFF
+ FFFFFFFFFFFFFF4E12E5FFFFFFFFFFFF4E12E54E12E5FFFFFFFFFFFFFFFFFFFF
+ FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
+ FFFFFFFFFFFFFFFFFF4E12E54E12E5FFFFFF4E12E54E12E5FFFFFFFFFFFFFFFF
+ FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
+ FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF4E12E5FFFFFFFFFFFF
+ FFFFFF4E12E54E12E5FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
+ FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF4E12E54E12E5FFFFFFFF
+ FFFFFFFFFF4E12E5FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
+ FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
+ FFFFFFFFFFFFFF4E12E5FFFFFFFFFFFFFFFFFFFFFFFF4E12E54E12E5FFFFFFFF
+ FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
+ FFFFFF4E12E54E12E5FFFFFFFFFFFFFFFFFFFFFFFF4E12E54E12E5FFFFFFFFFF
+ FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
+ FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF4E12E54E12E5FFFFFFFFFFFF
+ FFFFFFFFFFFFFFFFFF4E12E54E12E5FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
+ FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF4E12E54E12E5FFFFFFFFFFFFFFFFFFFF
+ FFFFFFFFFFFFFFFF4E12E54E12E5FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
+ FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
+ FF4E12E54E12E5FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF4E12E54E
+ 12E5FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF4E12E5
+ 4E12E5FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF4E12E54E12
+ E5FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
+ FFFFFFFFFFFFFFFFFFFFFFFFFFFF4E12E54E12E5FFFFFFFFFFFFFFFFFFFFFFFF
+ FFFFFFFFFFFFFFFFFFFFFFFFFFFFFF4E12E54E12E5FFFFFFFFFFFFFFFFFFFFFF
+ FFFFFFFFFFFFFFFFFFFF4E12E54E12E5FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
+ FFFFFFFFFFFFFFFFFFFFFFFFFFFF4E12E54E12E5FFFFFFFFFFFFFFFFFFFFFFFF
+ FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF4E12E54E12
+ E5FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
+ FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
+ FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
+ FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
+ FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
+ FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
+ FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
+ FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
+ FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
+ FFFFFFFFFFFFFFFFFFFF424DBE010000000000003E0000002800000030000000
+ 30000000010001000000000080010000120B0000120B00000200000002000000
+ FFFFFF0000000000000000000000FF00000000000000FF00000000000000D010
+ 0000000000000000000000000000FF00000000000000FF00000000000000FF00
+ 000000000000FF00000000000000FF00000000000000FF00000000000000FF00
+ 000000000000FF00000000000000FF00000000000000FF00000000000000FF00
+ 000000000000FF00000000000000FF00000000000000FF00000000000000FF00
+ 000000000000FF00000000000000FF00000000000000FF00000000000000FF00
+ 000000000000FF00000000000000FF00000000000000FF00000000000000FF00
+ 000000000000FF00000000000000000000000000000000000000000000000000
+ 0000000000000000000000000000FF00000000000000FF00000000000000FF00
+ 000000000000FF00000000000000FF00000000000000FF00000000000000FF00
+ 000000000000FF00000000000000FF00000000000000FF00000000000000FF00
+ 000000000000FF00000000000000000000000000000000000000000000000000
+ 0000000000000000}
+ end
+ object ColorDialog1: TColorDialog
+ Color = clTeal
+ Left = 440
+ Top = 72
+ end
+ object FontDialog1: TFontDialog
+ Font.CharSet = fcsUnicode
+ Font.Color = clBlack
+ Font.Height = 15
+ Font.Name = 'arial unicode ms'
+ Font.Pitch = fpVariable
+ Font.Style = []
+ Left = 408
+ Top = 72
+ end
+ object ImageList2: TImageList
+ Left = 504
+ Top = 72
+ Bitmap = {
+ 494D474C01000100100000001000000003000000424D360C0000000000003600
+ 00002800000020000000200000000100180000000000000C0000120B0000120B
+ 00000000000000000000FFFFFFFFFFFF00000000000000000000000000000000
+ 0000000000000000000000000000000000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
+ FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
+ FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF00000000008000FFFF00FFFF00FFFF00
+ FFFF00FFFF00FFFF00FFFF00FFFF000000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
+ FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
+ FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF00000000008000008000FFFF00FFFF00
+ FFFF00FFFF00FFFF00FFFF00FFFF000000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
+ FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
+ FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF00000000008000008000008000FFFF00
+ FFFF00FFFF00FFFF00FFFF00FFFF000000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
+ FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
+ FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF00000000008000008000008000000000
+ FFFF00FFFF00FFFF00FFFF00FFFF000000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
+ FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
+ FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF00000000008000008000008000000000
+ FFFF00FFFF00FFFF00FFFF00FFFF000000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
+ FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
+ FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF00000000008000008000008000000000
+ FFFF00FFFF00FFFF00FFFF00FFFF000000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
+ FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
+ FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF00000000008000008000008000000000
+ FFFF00FFFF00FFFF00FFFF00FFFF000000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
+ FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
+ FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF00000000008000008000008000000000
+ FFFF00FFFF00FFFF00FFFF00FFFF000000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
+ FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
+ FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF00000000008000008000008000000000
+ FFFF00FFFF00FFFF00FFFF00FFFF000000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
+ FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
+ FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF00000000008000008000008000FFFF00
+ 000000FFFF00FFFF00FFFF00FFFF000000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
+ FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
+ FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF00000000008000008000008000000000
+ FFFF00FFFF00FFFF00FFFF00FFFF000000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
+ FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
+ FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF00000000008000008000008000000000
+ FFFF00FFFF00FFFF00FFFF00FFFF000000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
+ FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
+ FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF000000000080FFFF0000008000000000
+ FFFF00FFFF00FFFF00FFFF00FFFF000000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
+ FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
+ FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF000000000080FFFF00FFFF0000000000
+ FFFF00FFFF00FFFF00FFFF00FFFF000000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
+ FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
+ FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF00000000000000000000000000000000
+ 0000000000000000000000000000000000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
+ FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
+ FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
+ FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
+ FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
+ FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF00000000000000
+ 0000000000000000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
+ FFFFFFFFFFFFFFFFFF000000000000000000000000000000FFFFFFFFFFFFFFFF
+ FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF000000000000BFBFBFBFBFBF7F
+ 7F7F7F7F7F7F7F7F000000000000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
+ FFFFFF000000000000BFBFBFBFBFBF7F7F7F7F7F7F7F7F7F000000000000FFFF
+ FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF000000BFBFBFBFBFBF7F7F7F00000000
+ 00000000007F7F7F7F7F7F7F7F7F000000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
+ 000000BFBFBFBFBFBF7F7F7F0000000000000000007F7F7F7F7F7F7F7F7F0000
+ 00FFFFFFFFFFFFFFFFFFFFFFFF000000BFBFBFBFBFBF000000FFFFFF0000FFFF
+ FFFF0000FFFFFFFF0000007F7F7F7F7F7F000000FFFFFFFFFFFFFFFFFF000000
+ BFBFBFBFBFBF000000FFFFFF00FF00FFFFFF00FF00FFFFFF0000007F7F7F7F7F
+ 7F000000FFFFFFFFFFFFFFFFFF000000BFBFBF000000FFFFFF00000000000000
+ 0000000000000000FFFFFF0000007F7F7F000000FFFFFFFFFFFFFFFFFF000000
+ BFBFBF000000FFFFFF000000000000000000000000000000FFFFFF0000007F7F
+ 7F000000FFFFFFFFFFFF000000BFBFBF7F7F7FFFFFFF0000000000000000FF00
+ 0080000080000000000000FFFFFF7F7F7F7F7F7F000000FFFFFF000000BFBFBF
+ 7F7F7FFFFFFF00000000000000FF00008000008000000000000000FFFFFF7F7F
+ 7F7F7F7F000000FFFFFF000000BFBFBF0000000000FF0000000000FF00008000
+ 00FF0000800000800000000000FF0000007F7F7F000000FFFFFF000000BFBFBF
+ 00000000FF0000000000FF0000800000FF0000800000800000000000FF000000
+ 007F7F7F000000FFFFFF000000FFFFFF000000FFFFFF0000000000FF0000FF00
+ 00FF0000FF000080000000FFFFFF0000007F7F7F000000FFFFFF000000FFFFFF
+ 000000FFFFFF00000000FF0000FF0000FF0000FF00008000000000FFFFFF0000
+ 007F7F7F000000FFFFFF000000FFFFFF0000000000FF000000FFFFFF0000FF00
+ 00FF0000800000FF0000000000FF000000BFBFBF000000FFFFFF000000FFFFFF
+ 00000000FF00000000FFFFFF00FF0000FF0000800000FF0000000000FF000000
+ 00BFBFBF000000FFFFFF000000FFFFFF7F7F7FFFFFFF000000000000FFFFFFFF
+ FFFF0000FF000000000000FFFFFF7F7F7FBFBFBF000000FFFFFF000000FFFFFF
+ 7F7F7FFFFFFF000000000000FFFFFFFFFFFF00FF00000000000000FFFFFF7F7F
+ 7FBFBFBF000000FFFFFFFFFFFF000000BFBFBF000000FFFFFF00000000000000
+ 0000000000000000FFFFFF000000BFBFBF000000FFFFFFFFFFFFFFFFFF000000
+ BFBFBF000000FFFFFF000000000000000000000000000000FFFFFF000000BFBF
+ BF000000FFFFFFFFFFFFFFFFFF000000FFFFFFBFBFBF000000FFFFFF0000FFFF
+ FFFF0000FFFFFFFF000000BFBFBFBFBFBF000000FFFFFFFFFFFFFFFFFF000000
+ FFFFFFBFBFBF000000FFFFFF00FF00FFFFFF00FF00FFFFFF000000BFBFBFBFBF
+ BF000000FFFFFFFFFFFFFFFFFFFFFFFF000000FFFFFFBFBFBF7F7F7F00000000
+ 00000000007F7F7FBFBFBFBFBFBF000000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
+ 000000FFFFFFBFBFBF7F7F7F0000000000000000007F7F7FBFBFBFBFBFBF0000
+ 00FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF000000000000FFFFFFFFFFFFFF
+ FFFFBFBFBFBFBFBF000000000000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
+ FFFFFF000000000000FFFFFFFFFFFFFFFFFFBFBFBFBFBFBF000000000000FFFF
+ FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF00000000000000
+ 0000000000000000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
+ FFFFFFFFFFFFFFFFFF000000000000000000000000000000FFFFFFFFFFFFFFFF
+ FFFFFFFFFFFFFFFFFFFF424DBE000000000000003E0000002800000020000000
+ 20000000010001000000000080000000120B0000120B00000200000002000000
+ FFFFFF00000000000000FFFD0000DFBF0000FFF700007D7A0000A75D0000DBFF
+ 0000FFFD0000D7A700007ADB0000BFFB0000BF9F0000FAF500004DBD0000FFBF
+ 0000F57B0000AFAD000000000000000000000000000000000000000000000000
+ 0000000000000000000000000000000000000000000000000000000000000000
+ 0000000000000000}
+ end
+ object MainMenu1: TMainMenu
+ Images = ImageList1
+ Left = 536
+ Top = 72
+ object File1: TMenuItem
+ Caption = 'File'
+ object Exit1: TMenuItem
+ Caption = 'Exit'
+ OnClick = Button1Click
+ end
+ end
+ object Options1: TMenuItem
+ Caption = 'Options'
+ object Strongs1: TMenuItem
+ Caption = 'Strongs Numbers'
+ Enabled = False
+ ImageIndex = 0
+ end
+ object MorphTags1: TMenuItem
+ Caption = 'Morph Tags'
+ Enabled = False
+ ImageIndex = 1
+ end
+ object Footnotes1: TMenuItem
+ Caption = 'Footnotes'
+ Enabled = False
+ ImageIndex = 2
+ end
+ object ChangeTextFont1: TMenuItem
+ Caption = 'Change Text Font'
+ ImageIndex = 3
+ OnClick = ToolButton1Click
+ end
+ object CurrentVerseColor1: TMenuItem
+ Caption = 'Current Verse Color'
+ OnClick = CurrentVerseColor1Click
+ end
+ end
+ end
+end
diff --git a/bindings/clx/test2/test2.conf b/bindings/clx/test2/test2.conf
new file mode 100644
index 0000000..6b9045c
--- /dev/null
+++ b/bindings/clx/test2/test2.conf
@@ -0,0 +1,38 @@
+-$A8
+-$B-
+-$C+
+-$D+
+-$E-
+-$F-
+-$G+
+-$H+
+-$I+
+-$J-
+-$K-
+-$L+
+-$M-
+-$N+
+-$O-
+-$P+
+-$Q+
+-$R+
+-$S-
+-$T-
+-$U-
+-$V+
+-$W-
+-$X+
+-$YD
+-$Z1
+-cg
+-vn
+-vr
+-H+
+-W+
+-M
+-$M16384,1048576
+-K$00400000
+-U"/home/tbiggs/kylix2/lib/debug:../"
+-O"/home/tbiggs/kylix2/lib/debug:../"
+-I"/home/tbiggs/kylix2/lib/debug:../"
+-R"/home/tbiggs/kylix2/lib/debug:../"
diff --git a/bindings/clx/test2/test2.dpr b/bindings/clx/test2/test2.dpr
new file mode 100644
index 0000000..ec160ef
--- /dev/null
+++ b/bindings/clx/test2/test2.dpr
@@ -0,0 +1,14 @@
+program test2;
+
+uses
+ QForms,
+ MainFrm in 'MainFrm.pas' {Form1},
+ Sword in '../Sword.pas';
+
+{$R *.res}
+
+begin
+ Application.Initialize;
+ Application.CreateForm(TForm1, Form1);
+ Application.Run;
+end.
diff --git a/bindings/clx/test2/test2.kof b/bindings/clx/test2/test2.kof
new file mode 100644
index 0000000..b5fdd24
--- /dev/null
+++ b/bindings/clx/test2/test2.kof
@@ -0,0 +1,61 @@
+[Compiler]
+A=8
+B=0
+C=1
+D=1
+E=0
+F=0
+G=1
+H=1
+I=1
+J=0
+K=0
+L=1
+M=0
+N=1
+O=0
+P=1
+Q=1
+R=1
+S=0
+T=0
+U=0
+V=1
+W=0
+X=1
+Y=1
+Z=1
+ShowHints=1
+ShowWarnings=1
+UnitAliases=
+
+[Linker]
+MapFile=0
+OutputObjs=0
+ConsoleApp=1
+DebugInfo=1
+RemoteSymbols=1
+MinStackSize=16384
+MaxStackSize=1048576
+ImageBase=4194304
+ExeDescription=
+DynamicLoader=/lib/ld-linux.so.2
+
+[Directories]
+OutputDir=
+UnitOutputDir=
+PackageDLLOutputDir=
+PackageDCPOutputDir=
+SearchPath=/home/tbiggs/kylix2/lib/debug:../
+Packages=baseclx:visualclx
+Conditionals=
+DebugSourceDirs=
+UsePackages=0
+
+[Parameters]
+RunParams=
+HostApplication=
+Launcher=/usr/X11R6/bin/xterm -T KylixDebuggerOutput -e bash -i -c %debuggee%
+UseLauncher=0
+DebugCWD=
+
diff --git a/bindings/clx/test2/test2.res b/bindings/clx/test2/test2.res
new file mode 100644
index 0000000..36f26e2
--- /dev/null
+++ b/bindings/clx/test2/test2.res
Binary files differ
diff --git a/bindings/flatapi.cpp b/bindings/flatapi.cpp
new file mode 100644
index 0000000..9208c13
--- /dev/null
+++ b/bindings/flatapi.cpp
@@ -0,0 +1,259 @@
+/******************************************************************************
+ * swordapi.cpp - This file contains an api usable by non-C++ windows
+ * environments
+ */
+
+#include <string.h>
+#include <stdio.h>
+
+#include <rawtext.h>
+#include <rawcom.h>
+#include <rawld.h>
+#include <strkey.h>
+#include <listkey.h>
+#include <versekey.h>
+#include <swmgr.h>
+#include <markupfiltmgr.h>
+
+#include "flatapi.h"
+
+
+//-----------------------------------------------------------------
+// SWMgr methods
+//
+extern "C" SWHANDLE SWMgr_new() {
+ return (SWHANDLE) new SWMgr(new MarkupFilterMgr());
+}
+
+
+// SWConfig *, SWConfig *, bool, SWFilterMgr *
+SWHANDLE SWMgr_newEx(SWHANDLE hiconfig, SWHANDLE hisysconfig, char autoload, SWHANDLE hfilterMgr) {
+ SWConfig *iconfig = (SWConfig *)hiconfig;
+ SWConfig *isysconfig = (SWConfig *)hisysconfig;
+ SWFilterMgr *filterMgr = (SWFilterMgr *)hfilterMgr;
+
+ return (SWHANDLE) new SWMgr(iconfig, isysconfig, autoload, filterMgr);
+}
+
+
+void SWMgr_delete(SWHANDLE hmgr) {
+ SWMgr *mgr = (SWMgr *)hmgr;
+ if (mgr)
+ delete mgr;
+}
+
+
+SWHANDLE SWMgr_getConfig(SWHANDLE hmgr) {
+ SWMgr *mgr = (SWMgr *)hmgr;
+ return (mgr) ? (SWHANDLE)mgr->config : 0;
+}
+
+
+SWHANDLE SWMgr_getModulesIterator(SWHANDLE hmgr) {
+ static ModItType it;
+
+ SWMgr *mgr = (SWMgr *)hmgr;
+ if (mgr) {
+ it.it = mgr->Modules.begin();
+ it.end = mgr->Modules.end();
+ }
+ return (SWHANDLE)&it;
+}
+
+
+SWHANDLE SWMgr_getModuleByName(SWHANDLE hmgr, const char *name) {
+ SWMgr *mgr = (SWMgr *)hmgr;
+ return (mgr) ? (SWHANDLE) mgr->Modules[name] : 0;
+}
+
+
+const char *SWMgr_getPrefixPath(SWHANDLE hmgr) {
+ SWMgr *mgr = (SWMgr *)hmgr;
+ return (mgr) ? mgr->prefixPath : 0;
+}
+
+
+const char *SWMgr_getConfigPath(SWHANDLE hmgr) {
+ SWMgr *mgr = (SWMgr *)hmgr;
+ return (mgr) ? mgr->configPath : 0;
+}
+
+
+void SWMgr_setGlobalOption(SWHANDLE hmgr, const char *option, const char *value) {
+ SWMgr *mgr = (SWMgr *)hmgr;
+ if (mgr)
+ mgr->setGlobalOption(option, value);
+}
+
+
+const char *SWMgr_getGlobalOption(SWHANDLE hmgr, const char *option) {
+ SWMgr *mgr = (SWMgr *)hmgr;
+ return (mgr) ? (const char *)mgr->getGlobalOption(option) : 0;
+}
+
+
+const char *SWMgr_getGlobalOptionTip(SWHANDLE hmgr, const char *option) {
+ SWMgr *mgr = (SWMgr *)hmgr;
+ return (mgr) ? (const char *)mgr->getGlobalOptionTip(option) : 0;
+}
+
+
+// ret: forward_iterator
+SWHANDLE SWMgr_getGlobalOptionsIterator(SWHANDLE hmgr) {
+ SWMgr *mgr = (SWMgr *)hmgr;
+ static OptionsList::iterator it;
+
+ if (mgr)
+ it = mgr->getGlobalOptions().begin();
+ return (SWHANDLE)&it;
+}
+
+
+// ret: forward_iterator
+SWHANDLE SWMgr_getGlobalOptionValuesIterator(SWHANDLE hmgr, const char *option) {
+ SWMgr *mgr = (SWMgr *)hmgr;
+ static OptionsList::iterator it;
+
+ if (mgr)
+ it = mgr->getGlobalOptionValues(option).begin();
+ return (SWHANDLE)&it;
+}
+
+
+void SWMgr_setCipherKey(SWHANDLE hmgr, const char *modName, const char *key) {
+ SWMgr *mgr = (SWMgr *)hmgr;
+ if (mgr)
+ mgr->setCipherKey(modName, key);
+}
+
+
+//-----------------------------------------------------------------
+// SWModule methods
+
+// static void nullPercent (char percent, void *userData);
+void SWModule_terminateSearch(SWHANDLE hmodule) {
+ SWModule *module = (SWModule *)hmodule;
+ if (module)
+ module->terminateSearch = true;
+}
+
+// SWModule (const const char *imodname = 0, const const char *imoddesc = 0, SWDisplay * idisp = 0, const char *imodtype = 0, SWTextEncoding encoding = ENC_UNKNOWN, SWTextDirection dir = DIRECTION_LTR, SWTextMarkup markup = FMT_UNKNOWN, const char* modlang = 0);
+// virtual ~ SWModule ();
+
+ /** Gets and clears error status
+ *
+ * @return error status
+ */
+char SWModule_error(SWHANDLE hmodule) {
+ SWModule *module = (SWModule *)hmodule;
+ return (module) ? module->Error() : 0;
+}
+
+
+int SWModule_getEntrySize(SWHANDLE hmodule) {
+ SWModule *module = (SWModule *)hmodule;
+ return (module) ? module->getEntrySize() : 0;
+}
+
+
+void SWModule_setKeyText(SWHANDLE hmodule, const char *key) {
+ SWModule *module = (SWModule *)hmodule;
+ if (module)
+ module->Key(key);
+}
+
+// virtual char SetKey (const SWKey &ikey);
+// virtual SWKey & Key () const {
+
+const char *SWModule_getKeyText(SWHANDLE hmodule) {
+ SWModule *module = (SWModule *)hmodule;
+ return (const char *)((module) ? module->KeyText() : 0);
+}
+
+
+// virtual char Display ();
+// virtual SWDisplay *Disp (SWDisplay * idisp = 0);
+
+const char *SWModule_getName(SWHANDLE hmodule) {
+ SWModule *module = (SWModule *)hmodule;
+ return (const char *)((module) ? module->Name() : 0);
+}
+
+
+const char *SWModule_getDescription(SWHANDLE hmodule) {
+ SWModule *module = (SWModule *)hmodule;
+ return (const char *)((module) ? module->Description() : 0);
+}
+
+
+const char *SWModule_getType(SWHANDLE hmodule) {
+ SWModule *module = (SWModule *)hmodule;
+ return (const char *)((module) ? module->Type() : 0);
+}
+
+
+void SWModule_previous(SWHANDLE hmodule) {
+ SWModule *module = (SWModule *)hmodule;
+ if (module)
+ (*module)--;
+}
+
+
+void SWModule_next(SWHANDLE hmodule) {
+ SWModule *module = (SWModule *)hmodule;
+ if (module)
+ (*module)++;
+}
+
+
+void SWModule_begin(SWHANDLE hmodule) {
+ SWModule *module = (SWModule *)hmodule;
+ if (module)
+ (*module) = TOP;
+}
+
+
+const char *SWModule_getStripText(SWHANDLE hmodule) {
+ SWModule *module = (SWModule *)hmodule;
+ return (const char *)((module) ? module->StripText() : 0);
+}
+
+
+const char *SWModule_getRenderText(SWHANDLE hmodule) {
+ SWModule *module = (SWModule *)hmodule;
+ return (const char *)((module) ? module->RenderText() : 0);
+}
+
+
+
+//-----------------------------------------------------------------
+// stringlist_iterator methods
+
+void stringlist_iterator_next(SWHANDLE hsli) {
+ OptionsList::iterator *sli = (OptionsList::iterator *)hsli;
+ (*sli)++;
+}
+
+
+const char *stringlist_iterator_val(SWHANDLE hsli) {
+ OptionsList::iterator *sli = (OptionsList::iterator *)hsli;
+ return (const char *)(*sli)->c_str();
+}
+
+
+
+//-----------------------------------------------------------------
+// modmap methods
+
+void ModList_iterator_next(SWHANDLE hmmi) {
+ ModItType *it = (ModItType *)hmmi;
+ if (it->it != it->end)
+ it->it++;
+}
+
+
+SWHANDLE ModList_iterator_val(SWHANDLE hmmi) {
+ ModItType *it = (ModItType *)hmmi;
+ return (it->it != it->end) ? (SWHANDLE)it->it->second : 0;
+}
+
diff --git a/bindings/gsoap/Makefile b/bindings/gsoap/Makefile
new file mode 100644
index 0000000..639634a
--- /dev/null
+++ b/bindings/gsoap/Makefile
@@ -0,0 +1,12 @@
+all: gsoapsword testclient
+
+gsoapsword: gsoapsword.h gsoapsword.cpp stdsoap.o
+ ./soapcpp gsoapsword.h
+ g++ -g -ggdb -I/usr/include/sword -I./include -o gsoapsword gsoapsword.cpp yoyo.cpp stdsoap.o soapC.cpp soapServer.cpp -lsword -lz
+
+testclient: gsoapsword.h testclient.cpp stdsoap.o
+ ./soapcpp gsoapsword.h
+ g++ -I./include -o testclient testclient.cpp stdsoap.o soapC.cpp soapClient.cpp
+
+clean:
+ rm gsoapsword testclient soapC.cpp soapServer.cpp soapClient.cpp soapH.h soapStub.h sword.xsd sword.nsmap sword.wsdl
diff --git a/bindings/gsoap/gsoapsword.cpp b/bindings/gsoap/gsoapsword.cpp
new file mode 100644
index 0000000..57eff23
--- /dev/null
+++ b/bindings/gsoap/gsoapsword.cpp
@@ -0,0 +1,142 @@
+#include "soapH.h"
+#include <flatapi.h>
+#include <swmgr.h>
+#include <markupfiltmgr.h>
+
+
+SWMgr *mgr;
+
+int sword__ModList_iterator_next(xsd__int hmmi, xsd__int &noop) {
+ ModList_iterator_next(hmmi);
+ return SOAP_OK;
+}
+
+int sword__ModList_iterator_val(xsd__int hmmi, xsd__int &hmodule) {
+ hmodule = ModList_iterator_val(hmmi);
+ return SOAP_OK;
+}
+
+int sword__SWMgr_new(xsd__int &retVal) {
+ retVal = SWMgr_new();
+ return SOAP_OK;
+}
+
+int sword__SWMgr_delete(xsd__int hmgr, xsd__int &noop) {
+ SWMgr_delete(hmgr);
+ return SOAP_OK;
+}
+
+int sword__SWMgr_getModulesIterator(xsd__int hmgr, xsd__int &hmodIterator) {
+ hmodIterator = SWMgr_getModulesIterator(hmgr);
+ return SOAP_OK;
+}
+
+int sword__SWMgr_getModuleByName(xsd__int hmgr, xsd__string name, xsd__int &hmodule) {
+ hmodule = SWMgr_getModuleByName(hmodule, name);
+ return SOAP_OK;
+}
+
+
+
+int sword__SWModule_getName(xsd__int hmodule, xsd__string &name) {
+ name = (char *)SWModule_getName(hmodule);
+ return SOAP_OK;
+}
+
+int sword__SWModule_getDescription(xsd__int hmodule, xsd__string &description) {
+ description = (char *)SWModule_getDescription(hmodule);
+ return SOAP_OK;
+}
+
+
+int sword__Quick_getModuleRawEntry(xsd__string modName, xsd__string modKey, xsd__string &modText) {
+ SWModule *mod = mgr->Modules[modName];
+ if (mod) {
+ mod->SetKey(modKey);
+ modText = mod->getRawEntry();
+ }
+ return SOAP_OK;
+}
+
+
+int sword__Quick_setModuleRawEntry(xsd__string modName, xsd__string modKey, xsd__string modText, xsd__int &noop) {
+ SWModule *mod = mgr->Modules[modName];
+ if (mod) {
+ mod->SetKey(modKey);
+ (*mod) << modText;
+ }
+ return SOAP_OK;
+}
+
+
+int sword__Quick_getModuleRenderText(xsd__string modName, xsd__string modKey, xsd__string &modText) {
+ SWModule *mod = mgr->Modules[modName];
+ if (mod) {
+ mod->SetKey(modKey);
+ modText = (char *)mod->RenderText();
+ }
+ return SOAP_OK;
+}
+
+
+int sword__Quick_getJScriptAttribArray(xsd__string modName, xsd__string modKey, xsd__string &arrayText) {
+ SWModule *mod = mgr->Modules[modName];
+ if (mod) {
+ mod->SetKey(modKey);
+ AttributeTypeList::iterator i1;
+ AttributeList::iterator i2;
+ AttributeValue::iterator i3;
+ int l1, l2, l3;
+ char lbuf1[20], lbuf2[20], lbuf3[20];
+ static string retVal = "";
+ retVal = "var entryAttribs = new Array();\n";
+ string l1keys = "entryAttribs[0] = new Array(";
+ for (l1=0,i1 = target->getEntryAttributes().begin(); i1 != target->getEntryAttributes().end(); i1++,l1++) {
+ sprintf(lbuf1, "%d", l1+1);
+ retVal += "entryAttribs["+lbuf1+"] = new Array();\n";
+ string l2keys = "entryAttribs["+lbuf1+"][0] = new Array(";
+ cout << "[ " << i1->first << " ]\n";
+ for (l2=0,i2 = i1->second.begin(); i2 != i1->second.end(); i2++,l2++) {
+ sprintf(lbuf2, "%d", l2+1);
+ retVal += "entryAttribs["+lbuf1+"]["+lbuf2+"][0] = new Array();\n";
+ string l3keys = "entryAttribs["+lbuf1+"]["+lbuf2+"][0] = new Array(";
+ cout << "\t[ " << i2->first << " ]\n";
+ for (l3=0,i3 = i2->second.begin(); i3 != i2->second.end(); i3++,l3++) {
+ cout << "\t\t" << i3->first << " = " << i3->second << "\n";
+ }
+ }
+ }
+ }
+ return SOAP_OK;
+}
+
+
+
+
+main() {
+
+
+ int m, s;
+ mgr = new SWMgr(new MarkupFilterMgr());
+ m = soap_bind("localhost", 18083, 100);
+ if (m < 0) {
+ soap_print_fault(stderr);
+ exit(-1);
+ }
+ fprintf(stderr, "Socket connection successful: master socket = %d\n", m);
+ for (int i = 1; ; i++) {
+ s = soap_accept();
+ if (s < 0) {
+ soap_print_fault(stderr);
+ exit(-1);
+ }
+ fprintf(stderr, "%d: accepted connection from IP = %d.%d.%d.%d socket = %d", i, (soap_ip<<24)&0xFF, (soap_ip<<16)&0xFF, (soap_ip<<8)&0xFF, soap_ip&0xFF, s);
+ soap_serve(); // process RPC skeletons
+ fprintf(stderr, "request served\n");
+ soap_end(); // clean up everything and close socket
+ }
+ delete mgr;
+}
+
+#include "sword.nsmap"
+
diff --git a/bindings/gsoap/gsoapsword.h b/bindings/gsoap/gsoapsword.h
new file mode 100644
index 0000000..1a712a5
--- /dev/null
+++ b/bindings/gsoap/gsoapsword.h
@@ -0,0 +1,65 @@
+#ifndef GSOAPAPI_H
+#define GSOAPAPI_H
+
+typedef long xsd__int;
+typedef char * xsd__string;
+
+//-----------------------------------------------------------------
+// stringlist_iterator methods
+
+//int sword__stringlist_iterator_next(xsd__int hsli char **);
+//int sword__stringlist_iterator_val(xsd__int hsli, char **);
+
+
+//-----------------------------------------------------------------
+// modmap methods
+//
+int sword__ModList_iterator_next(xsd__int hmmi, xsd__int &noop);
+int sword__ModList_iterator_val(xsd__int hmmi, xsd__int &hmodule);
+
+
+//-----------------------------------------------------------------
+// SWMgr methods
+//
+int sword__SWMgr_new(xsd__int &retVal);
+// SWConfig *, SWConfig *, bool, SWFilterMgr *
+//xsd__int sword__SWMgr_newEx(xsd__int hiconfig, xsd__int hisysconfig, char autoload, xsd__int hfilterMgr);
+int sword__SWMgr_delete(xsd__int hmgr, xsd__int &noop);
+//xsd__int sword__SWMgr_getConfig(xsd__int hmgr);
+int sword__SWMgr_getModulesIterator(xsd__int hmgr, xsd__int &hmodIterator);
+int sword__SWMgr_getModuleByName(xsd__int hmgr, xsd__string name, xsd__int &hmodule);
+//char * sword__SWMgr_getPrefixPath(xsd__int hmgr);
+//char * sword__SWMgr_getConfigPath(xsd__int hmgr);
+//void sword__SWMgr_setGlobalOption(xsd__int hmgr, char *option, char *value);
+//char * sword__SWMgr_getGlobalOption(xsd__int hmgr, char *option);
+//char * sword__SWMgr_getGlobalOptionTip(xsd__int hmgr, char *option);
+// ret: forward_iterator
+//xsd__int sword__SWMgr_getGlobalOptionsIterator(xsd__int hmgr);
+// ret: forward_iterator
+//xsd__int sword__SWMgr_getGlobalOptionValuesIterator(xsd__int hmgr, char *option);
+//void sword__SWMgr_setCipherKey(xsd__int hmgr, char *modName, char *key);
+
+
+//-----------------------------------------------------------------
+// SWModule methods
+
+//void sword__SWModule_terminateSearch(xsd__int hmodule);
+//char sword__SWModule_error(xsd__int hmodule);
+//int sword__SWModule_getEntrySize(xsd__int hmodule);
+//void sword__SWModule_setKeyText(xsd__int hmodule, char *key);
+//char *sword__SWModule_getKeyText(xsd__int hmodule);
+int sword__SWModule_getName(xsd__int hmodule, xsd__string &name);
+int sword__SWModule_getDescription(xsd__int hmodule, xsd__string &description);
+//char *sword__SWModule_getType(xsd__int hmodule);
+//void sword__SWModule_previous(xsd__int hmodule);
+//void sword__SWModule_next(xsd__int hmodule);
+//void sword__SWModule_begin(xsd__int hmodule);
+//char *sword__SWModule_getStripText(xsd__int hmodule);
+//char *sword__SWModule_getRenderText(xsd__int hmodule);
+
+
+int sword__Quick_getModuleRawEntry(xsd__string modName, xsd__string modKey, xsd__string &modText);
+int sword__Quick_setModuleRawEntry(xsd__string modName, xsd__string modKey, xsd__string modText, xsd__int &noop);
+int sword__Quick_getModuleRenderText(xsd__string modName, xsd__string modKey, xsd__string &modText);
+int sword__Quick_getJScriptAttribArray(xsd__string modName, xsd__string modKey, xsd__string &arrayText);
+#endif
diff --git a/bindings/gsoap/include/stdsoap.h b/bindings/gsoap/include/stdsoap.h
new file mode 100644
index 0000000..462483a
--- /dev/null
+++ b/bindings/gsoap/include/stdsoap.h
@@ -0,0 +1,493 @@
+/* stdsoap.h
+
+ Copyright (C) 2001 Robert A. van Engelen, Florida State University.
+ All rights reserved.
+*/
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <errno.h>
+#include <string.h>
+#include <ctype.h>
+#include <limits.h>
+#include <sys/types.h>
+#ifndef WIN32
+#include <netinet/tcp.h> /* for TCP_NODELAY */
+#include <arpa/inet.h>
+#endif
+
+#ifdef WITH_OPENSSL
+#include <openssl/ssl.h>
+#include <openssl/err.h>
+#ifndef ALLOW_OLD_VERSIONS
+#if (OPENSSL_VERSION_NUMBER < 0x00905100L)
+#error "Must use OpenSSL 0.9.6 or later"
+#endif
+#endif
+#endif
+
+#include <math.h> /* for isnan(): remove if NAN and INF support is not required */
+#include <time.h> /* for time_t (xsd:dateTime) support, remove if not required */
+
+#ifndef _MATH_H
+#define isnan(_) (0)
+#else
+extern struct soap_double_nan { int n1, n2; } soap_double_nan;
+#endif
+
+#ifndef STDSOAP
+#define STDSOAP
+
+#ifndef WIN32
+#define LONG64 long long
+#define ULONG64 unsigned long long
+#endif
+
+/* #define DEBUG */ /* Uncomment to debug sending (in file SENT.log) receiving (in file RECV.log) and messages (in file TEST.log) */
+
+#define SOAP_BUFLEN 8192 /* buffer length for socket packets */
+#define SOAP_MAXLEN 256 /* maximum length of buffer to hold XML number representations */
+#define SOAP_PTRHASH 1024 /* size of pointer analysis hash table (must be power of 2) */
+#define SOAP_IDHASH 16 /* size of hash table for element id's */
+#define SOAP_BLKLEN 256 /* size of blocks to collect long strings */
+#define SOAP_TAGLEN 256 /* maximum length of XML tag/element names + 1 */
+
+typedef long wchar; /* for compatibility */
+
+#ifndef FLT_NAN
+#ifdef _MATH_H
+#define FLT_NAN (*(float*)&soap_double_nan)
+#else
+#define FLT_NAN (0.0)
+#endif
+#endif
+#ifndef FLT_PINFTY
+#ifdef HUGE_VAL
+#define FLT_PINFTY (float)HUGE_VAL
+#else
+#ifdef FLT_MAX
+#define FLT_PINFTY FLT_MAX
+#else
+#ifdef FLOAT_MAX
+#define FLT_PINFTY FLOAT_MAX
+#else
+#define FLT_PINFTY (3.40282347e+38)
+#endif
+#endif
+#endif
+#endif
+#ifndef FLT_NINFTY
+#define FLT_NINFTY (-FLT_PINFTY)
+#endif
+
+#ifndef DBL_NAN
+#ifdef _MATH_H
+#define DBL_NAN (*(double*)&soap_double_nan)
+#else
+#define DBL_NAN (0.0)
+#endif
+#endif
+#ifndef DBL_PINFTY
+#ifdef HUGE_VAL
+#define DBL_PINFTY (double)HUGE_VAL
+#else
+#ifdef DBL_MAX
+#define DBL_PINFTY DBL_MAX
+#else
+#ifdef DOUBLE_MAX
+#define DBL_PINFTY DOUBLE_MAX
+#else
+#define DBL_PINFTY (1.7976931348623157e+308)
+#endif
+#endif
+#endif
+#endif
+#ifndef DBL_NINFTY
+#define DBL_NINFTY (-DBL_PINFTY)
+#endif
+
+extern int (*soap_fpost)(const char*, const char*, const char*, const char*, size_t);
+extern int (*soap_fresponse)(int, size_t);
+extern int (*soap_fparse)();
+extern int (*soap_fopen)(const char*, const char*, int);
+extern int (*soap_fclose)();
+extern int (*soap_fsend)(const char*, size_t);
+extern size_t (*soap_frecv)(char*, size_t);
+extern int (*soap_fignore)(const char*);
+
+extern const char *soap_float_format; /* points to user-definable format string */
+extern const char *soap_double_format; /* points to user-definable format string */
+
+extern const char *soap_http_version; /* default = "1.0" */
+extern const char *soap_encodingStyle; /* default = NULL which means that SOAP encoding is used for marshalling */
+extern const char *soap_defaultNamespace; /* default = NULL which means that no default namespace is used */
+extern int soap_disable_href; /* when !=0, disables hrefs so objects are duplicated on the output */
+extern int soap_enable_embedding; /* when !=0, enable hrefs within embedded elements */
+extern int soap_enable_null; /* when !=0, always sends null elements */
+extern int soap_enable_utf_string; /* when !=0, assume strings are UTF8/16 encoded and just emit them */
+extern int soap_disable_request_count; /* when !=0, do not include HTTP Content-Length in request */
+extern int soap_disable_response_count; /* when !=0, do not include HTTP Content-Length in service response (normally calculated by the Web server in case CGI is used so disabling saves time) */
+extern int soap_enable_array_overflow; /* when !=0, allows ignoring remaining elements that do not fit in a fixed-size array */
+extern int soap_keep_alive; /* when !=0, set SO_KEEPALIVE socket and do not close sockets, unless new host/port is accessed */
+
+extern const char *soap_proxy_host;
+extern int soap_proxy_port;
+
+#ifdef WITH_OPENSSL
+extern SSL_CTX *soap_ssl_ctx;
+extern BIO *soap_bio;
+extern SSL *soap_ssl;
+extern int soap_require_server_auth;
+extern const char *soap_keyfile;
+extern const char *soap_password;
+extern const char *soap_dhfile;
+extern const char *soap_cafile;
+#endif
+
+#ifdef WIN32
+#include <io.h>
+#include <winsock.h>
+#else
+#include <sys/socket.h>
+#include <netdb.h>
+#include <netinet/in.h>
+#include <unistd.h>
+#define closesocket(n) close(n)
+#endif
+
+int soap_serve();
+
+extern void soap_serializeheader();
+extern void soap_putheader();
+extern int soap_getheader();
+extern void soap_serializefault();
+extern void soap_putfault();
+extern int soap_getfault();
+extern void soap_putindependent();
+extern int soap_getindependent();
+
+int soap_bind(const char *hostname, int port, int backlog);
+int soap_accept();
+int soap_ssl_accept();
+
+struct Namespace {const char *id, *ns, *in;};
+extern struct Namespace namespaces[];
+
+static FILE * fdebug;
+
+struct soap_entry
+{ int id;
+ void *entry;
+ int type;
+ short marked1;
+ short marked2;
+ struct soap_entry *next;
+};
+
+extern char soap_tag[SOAP_TAGLEN]; /* used by soap_element_begin_in */
+extern char soap_id[SOAP_TAGLEN]; /* set by soap_element_begin_in */
+extern char soap_href[SOAP_TAGLEN]; /* set by soap_element_begin_in */
+extern char soap_type[SOAP_TAGLEN];
+extern char soap_arrayType[SOAP_TAGLEN];
+extern char soap_arraySize[SOAP_TAGLEN];
+extern char soap_xmlns_name[SOAP_TAGLEN];
+extern char soap_xmlns_value[SOAP_TAGLEN];
+extern char soap_offset[SOAP_TAGLEN]; /* ditto */
+extern int soap_position; /* ditto */
+extern int soap_positions[32]; /* ditto */
+extern int soap_null; /* ditto */
+extern int soap_counting;
+extern int soap_level;
+extern int soap_is_in_header;
+
+/* Defining the std soap error codes */
+
+#define SOAP_OK 0
+#define SOAP_CLI_FAULT 1
+#define SOAP_SVR_FAULT 2
+#define SOAP_TAG_MISMATCH 3
+#define SOAP_TYPE_MISMATCH 4
+#define SOAP_SYNTAX_ERROR 5
+#define SOAP_NO_TAG 6
+#define SOAP_IOB 7
+#define SOAP_MUSTUNDERSTAND 8
+#define SOAP_NAMESPACE 9
+#define SOAP_OBJ_MISMATCH 10
+#define SOAP_FATAL_ERROR 11
+#define SOAP_FAULT 12
+#define SOAP_NO_METHOD 13
+#define SOAP_EOM 14
+#define SOAP_NULL 15
+#define SOAP_MULTI_ID 16
+#define SOAP_MISSING_ID 17
+#define SOAP_HREF 18
+#define SOAP_TCP_ERROR 19
+#define SOAP_HTTP_ERROR 20
+#define SOAP_SSL_ERROR 21
+#define SOAP_EOF EOF
+
+extern int soap_error ;
+
+/* DEBUG macros */
+
+#ifdef DEBUG
+#define DBGLOG(DBGFILE, DBGCMD) \
+{\
+ fdebug = fopen(#DBGFILE".log", "a");\
+ DBGCMD;\
+ fclose(fdebug);\
+}
+#else
+#define DBGLOG(DBGFILE, DBGCMD)
+#endif
+
+struct soap_class
+{ void *ptr;
+ int type;
+ int size;
+ struct soap_class *next;
+};
+
+extern struct soap_class *soap_class_chain;
+
+struct soap_stack
+{ struct soap_stack *next;
+ char *id;
+ int i;
+ int level;
+};
+
+/* Hash table (temporarily replaced by array indexing) */
+
+extern struct soap_entry *soap_ptr[SOAP_PTRHASH];
+
+/*int sock;*/
+extern int soap_socket;
+extern int soap_recvfd;
+extern int soap_sendfd;
+extern int soap_buffering;
+extern unsigned long soap_ip; /* IP address of connecting party after soap_accept() */
+
+/* send routine */
+int soap_send(const char *buf);
+
+int soap_send_hex(int);
+int soap_send_base64(const unsigned char *, size_t);
+
+int soap_gethex();
+unsigned char *soap_getbase64(int *, int);
+
+extern int errmode ;
+
+int soap_pointer_lookup(const void *p, int t,struct soap_entry **np1);
+int soap_array_pointer_lookup(const void *p, int n, int t, struct soap_entry **np1);
+int soap_pointer_lookup_id(void *p, int t,struct soap_entry **np1);
+int soap_pointer_enter(const void *p, int t,struct soap_entry **np1);
+int soap_array_pointer_enter(const void *p, int t, struct soap_entry **np1);
+void soap_pointer_dump();
+void soap_begin_count();
+void soap_begin_send();
+int soap_end_send();
+
+void soap_embedded(const void *p, int t);
+int soap_reference(const void *p, int t);
+int soap_array_reference(const void *p, int n, int t);
+int soap_embedded_id(int id, const void *p, int t);
+int soap_is_embedded(struct soap_entry *);
+int soap_is_single(struct soap_entry *);
+int soap_is_multi(struct soap_entry *);
+void soap_set_embedded(struct soap_entry *);
+
+int soap_begin_recv();
+int soap_end_recv();
+int soap_getline(char *, int);
+
+void soap_send_namespaces();
+
+#ifdef WIN32
+#define atoll atoi
+#else
+extern void itoa(int, char*);
+#endif
+
+/* The hash table to hold IDs needs entries of the form: */
+struct soap_hash_entry
+{ int type;
+ size_t size;
+ void *link;
+ void *copy;
+ void *ptr;
+ int level;
+ struct soap_hash_entry *next;
+ char s[4];
+};
+
+extern struct soap_hash_entry *soap_hash[SOAP_IDHASH];
+
+extern int soap_alloced ; /* keep this info so we know that object must be init'ed */
+extern void *soap_malloc_chain ;
+
+void * soap_malloc(size_t n);
+void soap_dealloc(void *p);
+
+int soap_lookup_type(const char *id);
+
+void * soap_id_lookup(const char *id, void **p, int t, size_t n, int k);
+
+void * soap_id_forward(const char *id, void *p, int t, size_t n);
+
+void * soap_id_enter(const char *id, void *p, int t, size_t n, int k);
+void * soap_class_id_enter(const char *id, void *p, int t, const char *type);
+
+extern int soap_size(const int *, int);
+extern int soap_getoffsets(const char *, const int *, int *, int);
+extern int soap_getsize(const char *, const char *, int *);
+extern int soap_getsizes(const char *, int *, int);
+extern int soap_getposition(const char *, int *);
+extern char * soap_putsize(const char *, int);
+extern char * soap_putsizesoffsets(const char *, const int *, const int *, int);
+extern char * soap_putsizes(const char *, const int *, int);
+extern char * soap_putoffset(int);
+extern char * soap_putoffsets(const int *, int);
+extern char * soap_putposition();
+
+extern int soap_peeked ;
+extern int soap_body;
+
+/* Support routines (library) */
+int soap_ignore_element();
+
+int soap_closesock();
+
+void soap_init();
+void soap_begin();
+
+int soap_match_tag(const char*, const char *);
+
+int soap_match_array(const char*);
+
+void soap_end();
+void soap_free();
+void soap_destroy();
+
+void soap_element_begin_out(const char *tag, int id, const char *type);
+void soap_array_begin_out(const char *tag, int id, const char *type, const char *offset);
+
+void soap_element_end_out(const char *tag);
+
+void soap_element_ref(const char *tag, int id, int href);
+
+void soap_element_null(const char *tag, int id, const char *type);
+
+int soap_element_begin_in(const char *tag);
+
+int soap_element_end_in(const char *tag);
+
+int soap_peek_element();
+void soap_revert();
+
+int soap_ignore_element();
+
+void soap_convert_string_out(const char *s);
+
+int soap_match_namespace(const char*, const char*, int, int);
+
+void soap_pop_namespace();
+int soap_push_namespace(const char *,const char *);
+
+extern int soap_block_size;
+extern int soap_new_block();
+extern void *soap_push_block(size_t);
+extern void soap_pop_block();
+extern void soap_store_block(char *);
+
+void *soap_instantiate(int t, const char *);
+void soap_delete(void *, int, int);
+
+void soap_outint(const char *tag, int id, const int *p, const char *, int);
+int * soap_inint(const char *tag, int *p, const char *, int);
+
+void soap_outbyte(const char *tag, int id, const char *p, const char *, int);
+char * soap_inbyte(const char *tag, char *p, const char *, int);
+
+void soap_outlong(const char *tag, int id, const long *p, const char *, int);
+long * soap_inlong(const char *tag, long *p, const char *, int);
+
+void soap_outLONG64(const char *tag, int id, const LONG64 *p, const char *, int);
+LONG64 * soap_inLONG64(const char *tag, LONG64 *p, const char *, int);
+
+void soap_outshort(const char *tag, int id, const short *p, const char *, int);
+short * soap_inshort(const char *tag, short *p, const char *, int);
+
+void soap_outfloat(const char *tag, int id, const float *p, const char *, int);
+float * soap_infloat(const char *tag, float *p, const char *, int);
+
+void soap_outdouble(const char *tag, int id, const double *p, const char *, int);
+double * soap_indouble(const char *tag, double *p, const char *, int);
+
+void soap_outunsignedByte(const char *tag, int id, const unsigned char *p, const char *, int);
+unsigned char * soap_inunsignedByte(const char *tag, unsigned char *p, const char *, int);
+
+void soap_outunsignedShort(const char *tag, int id, const unsigned short *p, const char *, int);
+unsigned short * soap_inunsignedShort(const char *tag, unsigned short *p, const char *, int);
+
+void soap_outunsignedInt(const char *tag, int id, const unsigned int *p, const char *, int);
+unsigned int * soap_inunsignedInt(const char *tag, unsigned int *p, const char *, int);
+
+void soap_outunsignedLong(const char *tag, int id, const unsigned long *p, const char *, int);
+unsigned long * soap_inunsignedLong(const char *tag, unsigned long *p, const char *, int);
+
+void soap_outunsignedLONG64(const char *tag, int id, const ULONG64 *p, const char *, int);
+ULONG64 * soap_inunsignedLONG64(const char *tag, ULONG64 *p, const char *, int);
+
+void soap_outstring(const char *tag, int id, char *const*p, const char *, int);
+char ** soap_instring(const char *tag, char **p, const char *, int);
+
+void soap_outwstring(const char *tag, int id, wchar_t *const*p, const char *, int);
+wchar_t **soap_inwstring(const char *tag, wchar_t **p, const char *, int);
+
+void soap_outliteral(const char *tag, char *const*p);
+char **soap_inliteral(const char *tag, char **p);
+
+void soap_outwliteral(const char *tag, wchar_t *const*p);
+wchar_t **soap_inwliteral(const char *tag, wchar_t **p);
+
+#ifdef _TIME_H
+void soap_outdateTime(const char *tag, int id, const time_t *p, const char *, int);
+time_t *soap_indateTime(const char *tag, time_t *p, const char *, int);
+#endif
+
+char *soap_value();
+
+wchar soap_skip();
+
+/* 1. generate the prototypes and encode all types (base types are defined above) */
+
+void soap_envelope_begin_out();
+void soap_envelope_end_out();
+
+int soap_envelope_begin_in();
+int soap_envelope_end_in();
+
+void soap_body_begin_out();
+void soap_body_end_out();
+
+int soap_body_begin_in();
+int soap_body_end_in();
+
+int soap_recv_header();
+
+int soap_connect(const char *URL, const char *action);
+
+int soap_response();
+
+/* Methods dealing with the fault struct*/
+
+int soap_send_fault();
+
+int soap_recv_fault();
+
+extern void soap_print_fault(FILE*);
+extern void soap_print_fault_location(FILE*);
+
+#endif
diff --git a/bindings/gsoap/soapcpp b/bindings/gsoap/soapcpp
new file mode 100755
index 0000000..462b1b5
--- /dev/null
+++ b/bindings/gsoap/soapcpp
Binary files differ
diff --git a/bindings/gsoap/testclient.cpp b/bindings/gsoap/testclient.cpp
new file mode 100644
index 0000000..b0d4d94
--- /dev/null
+++ b/bindings/gsoap/testclient.cpp
@@ -0,0 +1,76 @@
+#include "soapH.h"
+#include <iostream.h>
+
+char server[] = "http://localhost:18083";
+
+int main(int argc, char **argv) {
+ xsd__int mgr;
+ xsd__int noop;
+
+ if (soap_call_sword__SWMgr_new(server, NULL, mgr)) {
+ soap_print_fault(stderr);
+ soap_print_fault_location(stderr);
+ exit(-1);
+ }
+
+ xsd__int modIt;
+ if (soap_call_sword__SWMgr_getModulesIterator(server, NULL, mgr, modIt)) {
+ soap_print_fault(stderr);
+ soap_print_fault_location(stderr);
+ exit(-1);
+ }
+
+ xsd__int module;
+ do {
+ if (soap_call_sword__ModList_iterator_val(server, NULL, modIt, module)) {
+ soap_print_fault(stderr);
+ soap_print_fault_location(stderr);
+ exit(-1);
+ }
+
+
+ if (module) {
+ char *name;
+ char *desc;
+ if (soap_call_sword__SWModule_getName(server, NULL, module, name)) {
+ soap_print_fault(stderr);
+ soap_print_fault_location(stderr);
+ exit(-1);
+ }
+ if (soap_call_sword__SWModule_getDescription(server, NULL, module, desc)) {
+ soap_print_fault(stderr);
+ soap_print_fault_location(stderr);
+ exit(-1);
+ }
+
+ cout << "[" << name << "] " << desc << endl;
+
+ if (soap_call_sword__ModList_iterator_next(server, NULL, modIt, noop)) {
+ soap_print_fault(stderr);
+ soap_print_fault_location(stderr);
+ exit(-1);
+ }
+ }
+
+
+ } while (module);
+
+ if (soap_call_sword__SWMgr_delete(server, NULL, mgr, noop)) {
+ soap_print_fault(stderr);
+ soap_print_fault_location(stderr);
+ exit(-1);
+ }
+ char *text;
+ if (soap_call_sword__Quick_getModuleRenderText(server, NULL, "KJV", "jas1:19", text)) {
+ soap_print_fault(stderr);
+ soap_print_fault_location(stderr);
+ exit(-1);
+ }
+ cout << text << endl;
+
+ printf("success: %d\n", mgr);
+ soap_free();
+ return 0;
+}
+
+#include "sword.nsmap"
diff --git a/bindings/perl/Changes b/bindings/perl/Changes
new file mode 100644
index 0000000..e21158d
--- /dev/null
+++ b/bindings/perl/Changes
@@ -0,0 +1,18 @@
+Revision history for Perl extension Sword.
+
+0.01 Mon Jul 16 12:08:07 2001
+ - original version; created by h2xs 1.21 with options
+ -A -n Sword
+ - Basic verse movement w/next and prev
+
+0.02 Thu Jul 20 2001
+ - Added search, go to verse movement
+
+0.3 Sat Jul 21 2001
+ - Added verse list, verse range support
+ - Added (untested) locale support
+ - Made documentation
+ - Fixed bugs
+
+0.31 Sun Jun 09 2002 Joachim Ansorg <jansorg@gmx.de>
+ -Fixed some compilation problems
diff --git a/bindings/perl/Makefile.PL b/bindings/perl/Makefile.PL
new file mode 100644
index 0000000..4255b5a
--- /dev/null
+++ b/bindings/perl/Makefile.PL
@@ -0,0 +1,91 @@
+use ExtUtils::MakeMaker;
+
+my $sword_lib_path;
+my $sword_lib_path_raw;
+my $sword_include_path;
+
+sub find_inc {
+ my ($inc_dir) = @_;
+ if(-f "$inc_dir/swmgr.h") {
+ print "$inc_dir.\n";
+ $sword_include_path = "-I$inc_dir ";
+ return 1;
+ } else {
+ if($inc_dir !~ /sword$/) {
+ return find_inc("$inc_dir/sword");
+ }
+ return;
+ }
+}
+
+sub find_lib {
+ my ($lib_dir) = @_;
+ if(-f "$lib_dir/libsword.a") {
+ print "$lib_dir.\n";
+ $sword_lib_path = "-L$lib_dir ";
+ $sword_lib_path_raw = "$lib_dir";
+ return 1;
+ } else {
+ return;
+ }
+}
+
+sub search_lib_path {
+ print "Searching for Sword library ... ";
+ foreach my $lib_dir (@_) {
+ if(find_lib($lib_dir)) {
+ return 1;
+ }
+ }
+ print join(" ", @_), "\n";
+ die "Sword not found! Set SWORD_LIB_PATH to the directory where your libsword.a is.
+You can download Sword from http://www.crosswire.org.
+";
+}
+
+sub search_inc_path {
+ print "Searching for Sword headers ... ";
+ foreach my $inc_dir (@_) {
+ if(find_inc($inc_dir)) {
+ return 1;
+ }
+ }
+ print join(" ", @_), "\n";
+ die "Sword headers not found! Set SWORD_INCLUDE_PATH to the directory where your Sword include files are.\n";
+}
+
+sub one_dir_up {
+ my ($dir) = @_;
+ $dir =~ s!/[^/]+/*$!!g;
+ return $dir ? $dir : "/";
+}
+
+search_lib_path($ENV{SWORD_LIB_PATH}, $ENV{SWORD_PATH}, one_dir_up($ENV{SWORD_PATH}) . "/lib", "/lib", "/usr/lib", "/usr/local/lib", split(":", $ENV{LD_LIBRARY_PATH}));
+
+search_inc_path(one_dir_up($sword_lib_path_raw) . "/include", $ENV{SWORD_INCLUDE_PATH}, $ENV{SWORD_PATH}, one_dir_up($ENV{SWORD_PATH}) . "/include", "/usr/include", "/usr/local/include");
+if(! $sword_include_path ) {
+}
+
+
+$CC = 'g++';
+
+# See lib/ExtUtils/MakeMaker.pm for details of how to influence
+# the contents of the Makefile that is written.
+WriteMakefile(
+ 'NAME' => 'Sword',
+ 'VERSION_FROM' => 'Sword.pm', # finds $VERSION
+ 'PREREQ_PM' => {}, # e.g., Module::Name => 1.1
+ ($] >= 5.005 ? ## Add these new keywords supported since 5.005
+ (ABSTRACT_FROM => 'Sword.pm', # retrieve abstract from module
+ AUTHOR => 'John Keiser <jkeiser@iname.com>') : ()),
+ 'LIBS' => ["$sword_lib_path-lsword -lz"], # e.g., '-lm'
+ 'DEFINE' => '', # e.g., '-DHAVE_SOMETHING'
+ 'CC' => $CC,
+ 'LD' => '$(CC)',
+ # Insert -I. if you add *.h files later:
+ 'INC' => "$sword_include_path", # e.g., '-I/usr/include/other'
+ # Un-comment this if you add C files to link with later:
+ # 'OBJECT' => '$(O_FILES)', # link all the C files too
+ 'XSOPT' => '-C++',
+ 'TYPEMAPS' => ['perlobject.map' ],
+);
diff --git a/bindings/perl/README b/bindings/perl/README
new file mode 100644
index 0000000..a03d9cb
--- /dev/null
+++ b/bindings/perl/README
@@ -0,0 +1,36 @@
+Sword version 0.31
+==================
+
+The README is used to introduce the module and provide instructions on
+how to install the module, any machine dependencies it may have (for
+example C compilers and installed libraries) and any other information
+that should be provided before the module is installed.
+
+A README file is required for CPAN modules since CPAN extracts the
+README file from a module distribution so that people browsing the
+archive can use it get an idea of the modules uses. It is usually a
+good idea to provide version information here so that people can
+decide whether fixes for the module are worth downloading.
+
+INSTALL
+-------
+
+tar xzvf Sword-0.01.tar.gz
+cd Sword-0.01
+perl Makefile.PL
+make
+make install
+
+If you have trouble with the first step, it's because the Makefile can't find Sword.  Set the lib path in your LD_LIBRARY_PATH or set the SWORD_LIB_PATH environment variable to the path to libsword.a.
+
+
+HELP
+---
+"man Sword" or "perldoc Sword" after install for examples that will help you.
+
+
+COPYRIGHT AND LICENCE
+
+This program is licensed under the GPL.
+
+Copyright (C) 2001 John Keiser
diff --git a/bindings/perl/Sword.pm b/bindings/perl/Sword.pm
new file mode 100644
index 0000000..04aa2fe
--- /dev/null
+++ b/bindings/perl/Sword.pm
@@ -0,0 +1,1087 @@
+package Sword;
+
+use 5.006;
+use strict;
+use warnings;
+
+require Exporter;
+require DynaLoader;
+
+our @ISA = qw(Exporter DynaLoader);
+
+# Items to export into callers namespace by default. Note: do not export
+# names by default without a very good reason. Use EXPORT_OK instead.
+# Do not simply export all your public functions/methods/constants.
+
+# This allows declaration use Sword ':all';
+# If you do not need this, moving things directly into @EXPORT or @EXPORT_OK
+# will save memory.
+our %EXPORT_TAGS = ( 'all' => [ qw(
+ get_modules
+ get_verse
+) ] );
+
+our @EXPORT_OK = ( @{ $EXPORT_TAGS{'all'} } );
+
+our @EXPORT = qw(
+
+);
+our $VERSION = '0.31';
+
+bootstrap Sword $VERSION;
+
+# Preloaded methods go here.
+sub get_verse {
+ my ($verse, $mod) = @_;
+ if(!$mod) {
+ $mod = (get_modules())[0];
+ }
+
+ my $vi = new Sword::VerseIterator $mod;
+ if(!$vi->go_to_verse($verse)) {
+ return;
+ } else {
+ return $vi->get_verse();
+ }
+}
+
+my %base_modules;
+
+sub get_module {
+ my ($mod) = @_;
+ $base_modules{$mod} = new Sword::Module($mod) if !$base_modules{$mod};
+ return $base_modules{$mod}
+}
+
+1;
+
+
+package Sword::VerseIterator;
+
+sub set_book {
+ my $this = shift;
+
+ my ($book) = @_;
+ $this->go_to_verse($book . " 1:1");
+}
+
+1;
+
+
+package Sword::Module;
+
+sub new {
+ my $class = shift;
+ $class = ref($class) || $class;
+ my $this = {};
+ bless $this, $class;
+
+ my ($module_name) = @_;
+ $this->{MOD_NAME} = $module_name;
+ $this->{VI} = new Sword::VerseIterator($module_name);
+
+ return $this;
+}
+
+sub _initialize_book_list {
+ my $this = shift;
+ if(! $this->{BOOKS} ) {
+ $this->{BOOKS} = {};
+ $this->{BOOK_ARRAY} = [];
+ foreach my $book ($this->{VI}->_get_books) {
+ $book->{real_book_num} = @{$this->{BOOK_ARRAY}};
+ $this->{BOOKS}{$book->{name}} = $book;
+ push @{$this->{BOOK_ARRAY}}, $book->{name};
+ }
+ }
+}
+
+sub get_books {
+ my $this = shift;
+ $this->_initialize_book_list();
+
+ return @{$this->{BOOK_ARRAY}};
+}
+
+sub get_num_chapters {
+ my $this = shift;
+ $this->_initialize_book_list();
+
+ my ($book) = @_;
+ $book = $this->_canonicalize_book($book);
+ return $this->{BOOKS}{$book}{num_chapters};
+}
+
+sub get_num_verses_list {
+ my $this = shift;
+ $this->_initialize_book_list();
+
+ my ($book) = @_;
+ $book = $this->_canonicalize_book($book);
+ return @{$this->{BOOKS}{$book}{chapter_maxes}};
+}
+
+sub get_testament {
+ my $this = shift;
+ $this->_initialize_book_list();
+
+ my ($book) = @_;
+ $book = $this->_canonicalize_book($book);
+ return $this->{BOOKS}{$book}{testament_num} ? "NT" : "OT";
+}
+
+sub get_book_num {
+ my $this = shift;
+ $this->_initialize_book_list();
+
+ my ($book) = @_;
+ $book = $this->_canonicalize_book($book);
+ return $this->{BOOKS}{$book}{book_num};
+}
+
+sub get_iterator {
+ my $this = shift;
+ $this->_initialize_book_list();
+
+ my ($verse) = @_;
+ my $retval = new Sword::VerseIterator($this->{MOD_NAME});
+ $retval->go_to_verse($verse) if $verse;
+ return $retval;
+}
+
+sub get_verse {
+ my $this = shift;
+ $this->_initialize_book_list();
+
+ my ($verse) = @_;
+ $this->{VI}->go_to_verse($verse);
+ return $this->{VI}->get_verse;
+}
+
+sub search {
+ my $this = shift;
+
+ my ($term) = @_;
+ return $this->{VI}->_search($term);
+}
+
+sub search_verses {
+ my $this = shift;
+
+ my ($term) = @_;
+ return $this->{VI}->_search_verses($term);
+}
+
+sub get_name {
+ my $this = shift;
+
+ return $this->{VI}->_get_module_name();
+}
+
+sub get_description {
+ my $this = shift;
+
+ return $this->{VI}->_get_module_desc();
+}
+
+sub get_type {
+ my $this = shift;
+
+ return $this->{VI}->_get_module_type();
+}
+
+sub _canonicalize_book {
+ my $this = shift;
+ my ($book) = @_;
+ $this->_initialize_book_list();
+ return $book if $this->{BOOKS}{$book};
+ $this->{VI}->set_book($book);
+ return $this->{VI}->get_book();
+}
+
+
+# Verse stuff
+
+sub verse_greater {
+ my $this = shift;
+
+ my ($verse1, $verse2) = @_;
+ # Problem w/ sword comparing NT and OT?
+ #return $this->{VI}->_verse_greater($verse1, $verse2);
+
+ return -1 if ! $this->{VI}->go_to_verse($verse1);
+ my $chap1 = $this->{VI}->get_chapter_num();
+ my $verse_num1 = $this->{VI}->get_verse_num();
+ my $book_struct_1 = $this->{BOOKS}{$this->{VI}->get_book()};
+
+ return -1 if ! $this->{VI}->go_to_verse($verse2);
+ my $chap2 = $this->{VI}->get_chapter_num();
+ my $verse_num2 = $this->{VI}->get_verse_num();
+ my $book_struct_2 = $this->{BOOKS}{$this->{VI}->get_book()};
+
+ return 1 if $book_struct_1->{real_book_num} > $book_struct_2->{real_book_num};
+ return 0 if $book_struct_1->{real_book_num} < $book_struct_2->{real_book_num};
+ return 1 if $chap1 > $chap2;
+ return 0 if $chap1 < $chap2;
+ return 1 if $verse_num1 > $verse_num2;
+ return 0 if $verse_num1 < $verse_num2;
+ return 0;
+}
+
+# This method assumes that the lists are sorted.
+sub union_verse_list {
+ my $this = shift;
+
+ my ($list1, $list2) = @_;
+ my @retval;
+
+ my $i1 = 0;
+ my $i2 = 0;
+ my $val;
+ while($i1 < @{$list1} || $i2 < @{$list2}) {
+ if($i1 < @{$list1}) {
+ if($i2 < @{$list2} && $this->verse_greater($list1->[$i1], $list2->[$i2])) {
+ $val = $list2->[$i2];
+ } else {
+ $val = $list1->[$i1];
+ }
+ } else {
+ $val = $list2->[$i2];
+ }
+
+ push @retval, $val;
+
+ # Move past duplicates
+ while($i1 < @{$list1} && $list1->[$i1] eq $val) {
+ $i1++;
+ }
+ while($i2 < @{$list2} && $list2->[$i2] eq $val) {
+ $i2++;
+ }
+ }
+
+ return @retval;
+}
+
+
+# This method assumes that the lists are sorted.
+sub intersect_verse_list {
+ my $this = shift;
+
+ my ($list1, $list2) = @_;
+ my @retval;
+
+ my $i1 = 0;
+ my $i2 = 0;
+ my $val;
+ while($i1 < @{$list1} && $i2 < @{$list2}) {
+ if($list1->[$i1] eq $list2->[$i2]) {
+ $val = $list1->[$i1];
+ push @retval, $list1->[$i1];
+ } elsif($this->verse_greater($list1->[$i1], $list2->[$i2])) {
+ $val = $list2->[$i2];
+ } else {
+ $val = $list1->[$i1];
+ }
+
+ # Move past duplicates
+ while($i1 < @{$list1} && $list1->[$i1] eq $val) {
+ $i1++;
+ }
+ while($i2 < @{$list2} && $list2->[$i2] eq $val) {
+ $i2++;
+ }
+ }
+
+ return @retval;
+}
+
+# XXX this is somewhat inefficient right now (though not as bad as intersect)
+sub union_verse_range {
+ my $this = shift;
+ my ($list1, $list2) = @_;
+
+ my @full_list = (@{$list1}, @{$list2});
+ @full_list = $this->sort_verse_range(@full_list);
+ return $this->condense_verse_range(@full_list);
+}
+
+# XXX this is inefficient as heck right now
+sub intersect_verse_range {
+ my $this = shift;
+ my ($list1, $list2) = @_;
+
+ my @vlist1 = $this->expand_verse_range(@{$list1});
+ my @vlist2 = $this->expand_verse_range(@{$list2});
+
+ my @retval = $this->intersect_verse_list(\@vlist1, \@vlist2);
+
+ return $this->condense_verse_range(@retval);
+}
+
+sub _parse_verse_ref {
+ my $this = shift;
+
+ my ($verse_ref, $interpret_as_chapter) = @_;
+
+ return ("", -1, -1) if(!$verse_ref);
+
+ if (! ($verse_ref =~ /^\s*(.*[A-Za-z])?\s*(\d*\s*:?\s*\d*)\s*$/)) {
+ die " >> No book, chapter or verse found ($verse_ref).\n";
+ }
+
+ my $book = $1 ? $this->_canonicalize_book($1) : "";
+ my $num_ref = $2;
+ $num_ref =~ s/\s*//g;
+ return ($book, -1, -1) if ! $num_ref;
+ print " >> Bad numeric reference ($num_ref).\n" if ! ($num_ref =~ /^(\d+):?(\d*)$/);
+ return ($book, -1, $1) if ! $book && ! $2 && ! $interpret_as_chapter;
+ return ($book, $1, -1) if ! $2;
+ return ($book, $1, $2);
+}
+
+sub parse_verse_range {
+ my $this = shift;
+
+ my ($verse_list, $include_zeroes, $split_books, $default_book) = @_;
+
+ my @retval;
+
+ #
+ # The default book to use if the person decides to specify just
+ # chapters and verses. If the person specifies a book in the
+ # query string, that is the book that will be used thereafter.
+ #
+ my $prev_book = $default_book ? $default_book : "Genesis";
+ #
+ # Note that you can't specify a verse without first having specified
+ # a chapter (at some point), so this value won't be used.
+ #
+ my $prev_chapter = $include_zeroes ? 0 : 1;
+
+ foreach my $outer_part (split(/;/, $verse_list)) {
+ my $interpret_as_chapter = 1;
+ foreach my $part (split(/,/, $outer_part)) {
+ die "Too many dashes or nothing in front of the dash: $part" if !($part =~ /^([^-]+)-?([^-]*)$/);
+
+ #
+ # Get first verse part
+ #
+ my ($book1, $chap1, $verse1) = $this->_parse_verse_ref($1, $interpret_as_chapter);
+
+ # Save the specified book/chapter/verse.
+ my ($orig_book2, $orig_chap2, $orig_verse2) = ($book1, $chap1, $verse1);
+ # Start interpreting raw numbers as chapters if book was specified.
+ $interpret_as_chapter = 1 if $book1;
+ # Start interpreting raw numbers as verses if verse was specified.
+ $interpret_as_chapter = 0 if $verse1 != -1;
+
+ #
+ # Figure out the implied parts from the parts given
+ #
+ # book: chapter 1, verse 1
+ # book+chapter: verse 1
+ # book+verse: impossible
+ # book+chapter+verse: nothing
+ # chapter: prev. book, verse 1
+ # chapter+verse: prev. book
+ # verse: prev. book, prev. chapter
+ # nothing: impossible
+ #
+ # TRANSLATION:
+ # BOOK: prev. book
+ # CHAPTER: chapter 1 if book specified, prev. chapter if no book specified
+ # VERSE: verse 1
+ #
+ $chap1 = ($include_zeroes ? 0 : 1) if $book1 && $chap1 == -1;
+ $book1 = $prev_book if !$book1;
+ $chap1 = $prev_chapter if $chap1 == -1;
+ $verse1 = ($include_zeroes ? 0 : 1) if $verse1 == -1;
+
+ #
+ # Verify chapter/verse is in range
+ #
+ if($chap1 > $this->{BOOKS}{$book1}{num_chapters}) {
+ die "$book1 $chap1:$verse1 invalid: $chap1 is not a chapter in $book1 (valid chapters are 1-" . $this->{BOOKS}{$book1}{num_chapters} . ")";
+ }
+ if($verse1 > @{$this->{BOOKS}{$book1}{chapter_maxes}}[$chap1 - 1]) {
+ die "$book1 $chap1:$verse1 invalid: $verse1 is not a verse in $book1 $chap1 (valid chapters are 1-" . @{$this->{BOOKS}{$book1}{chapter_maxes}}[$chap1 - 1] . ")";
+ }
+
+
+ #
+ # Get second verse part
+ #
+ my ($book2, $chap2, $verse2) = $this->_parse_verse_ref($2, $interpret_as_chapter);
+
+ #
+ # Copy any elements specified from the first one into the second.
+ # "Genesis" = "Genesis-Genesis"
+ # "4:9" = "4:9-4:9"
+ # "5:1-12" = "5:1-5:12"
+ # "Exodus 4:8-Leviticus" = "Exodus 4:8-Leviticus"
+ #
+ if(!$book2) {
+ $book2 = $orig_book2;
+ if($chap2 == -1) {
+ $chap2 = $orig_chap2;
+ if($verse2 == -1) {
+ $verse2 = $orig_verse2;
+ }
+ }
+ }
+
+ #
+ # Figure out the implied parts from the parts given
+ #
+ # book: last chapter, last verse
+ # book+chapter: last verse
+ # book+verse: impossible
+ # book+chapter+verse: nothing
+ # chapter: same book, last verse
+ # chapter+verse: same book
+ # verse: same book, same chapter
+ # nothing: impossible (elements would be copied from first part)
+ #
+ # TRANSLATION:
+ # BOOK: same book
+ # CHAPTER: last chapter if book specified, same chapter if no book specified
+ # VERSE: last verse
+ #
+ $chap2 = $chap1 if !$book2 && $chap2 == -1;
+ $book2 = $book1 if !$book2;
+ $chap2 = $this->{BOOKS}{$book2}{num_chapters} if $chap2 == -1;
+ $verse2 = @{$this->{BOOKS}{$book2}{chapter_maxes}}[$chap2 - 1] if $verse2 == -1;
+
+ #
+ # Verify chapter/verse is in range
+ #
+ if($chap2 > $this->{BOOKS}{$book2}{num_chapters}) {
+ die "$book2 $chap2:$verse2 invalid: $chap2 is not a chapter in $book2 (valid chapters are 1-" . $this->{BOOKS}{$book2}{num_chapters} . ")";
+ }
+ if($verse2 > @{$this->{BOOKS}{$book2}{chapter_maxes}}[$chap2 - 1]) {
+ die "$book2 $chap2:$verse2 invalid: $verse2 is not a verse in $book2 $chap2 (valid chapters are 1-" . @{$this->{BOOKS}{$book2}{chapter_maxes}}[$chap2 - 1] . ")";
+ }
+
+ #print " > $book1 $chap1:$verse1 - $book2 $chap2:$verse2\n";
+
+ # Save previous book/chapter
+ $prev_book = $book2;
+ $prev_chapter = $chap2;
+
+ if ($this->verse_greater("$book1 $chap1:$verse1", "$book2 $chap2:$verse2")) {
+ die "Range $book1 $chap1:$verse1 - $book2 $chap2:$verse2 invalid: second verse must be the same or higher than the first verse.";
+ }
+
+ if(! $split_books || $book1 eq $book2) {
+ push @retval, [ "$book1 $chap1:$verse1", "$book2 $chap2:$verse2" ];
+ } else {
+ # First book
+ my $last_chapter = $this->{BOOKS}{$book1}{num_chapters};
+ push @retval, [ "$book1 $chap1:$verse1", "$book1 $last_chapter:" . @{$this->{BOOKS}{$book1}{chapter_maxes}}[$last_chapter - 1] ];
+
+ # Middle books
+ for(my $i=$this->{BOOKS}{$book1}{real_book_num}+1; $i<$this->{BOOKS}{$book2}{real_book_num}; $i++) {
+ my $middle_book = $this->{BOOK_ARRAY}[$i];
+ my $last_chapter = $this->{BOOKS}{$middle_book}{num_chapters};
+ push @retval, [
+ "$middle_book " . ($include_zeroes ? "0:0" : "1:1"),
+ "$middle_book $last_chapter:" . @{$this->{BOOKS}{$middle_book}{chapter_maxes}}[$last_chapter - 1]
+ ];
+ }
+
+ # Last book
+ push @retval, [ "$book2 " . ($include_zeroes ? "0:0" : "1:1"), "$book2 $chap2:$verse2" ];
+ }
+ }
+ }
+
+ return @retval;
+};
+
+sub next_verse {
+ my $this = shift;
+
+ my ($verse) = @_;
+ $this->{VI}->go_to_verse($verse);
+ $this->{VI}->next;
+ return $this->{VI}->get_key;
+}
+
+sub prev_verse {
+ my $this = shift;
+
+ my ($verse) = @_;
+ $this->{VI}->go_to_verse($verse);
+ $this->{VI}->prev;
+ return $this->{VI}->get_key;
+}
+
+sub parse_verse {
+ my $this = shift;
+
+ my ($verse) = @_;
+
+ $verse =~ /^(.*[A-Za-z])\s*(\d+)\s*:\s*(\d+)\s*$/;
+ return ($this->_canonicalize_book($1), $2, $3);
+}
+
+sub sort_verse_list {
+ my $this = shift;
+
+ my @verse_list = @_;
+ return sort { ($a eq $b) ? 0 : ($this->verse_greater($a, $b) ? 1 : -1) } @verse_list;
+}
+
+sub _compare_range {
+ my $this = shift;
+
+ my ($a, $b) = @_;
+ if($a->[0] eq $b->[0]) {
+ if($a->[1] eq $b->[1]) {
+ return 0;
+ } else {
+ return ($this->verse_greater($a->[1], $b->[1]) ? 1 : -1);
+ }
+ } else {
+ return ($this->verse_greater($a->[0], $b->[0]) ? 1 : -1);
+ }
+}
+
+sub sort_verse_range {
+ my $this = shift;
+
+ my @verse_range = @_;
+ return sort { $this->_compare_range($a, $b) } @verse_range;
+}
+
+sub _as_verse_range {
+ # THIS IS NOT AN OBJECT METHOD
+ return ref($_[0]) ? @{$_[0]} : ($_[0], $_[0]);
+}
+
+# This function will normalize an existing verse range or create a new one from a verse list.
+# This function assumes verses are in order (by lower part of range).
+# XXX This does not merge stuff with zeroes very well, I suspect.
+sub condense_verse_range {
+ my $this = shift;
+ my @verse_range = @_;
+ my @retval;
+
+ for(my $i=0;$i<@verse_range;$i++) {
+ my ($new_low, $new_high) = _as_verse_range($verse_range[$i]);
+ my $i2;
+ for($i2=$i+1; $i2<@verse_range; $i2++) {
+ my ($vr2_low, $vr2_high) = _as_verse_range($verse_range[$i2]);
+
+ # Check if it's 1 above the current verse and not in the same book
+ my $next_verse = $this->next_verse($new_high);
+ if($next_verse eq $vr2_low) {
+ my ($high_book) = $this->parse_verse($new_high);
+ my ($vr2_low_book) = $this->parse_verse($vr2_low);
+ last if $high_book ne $vr2_low_book;
+ } elsif($this->verse_greater($vr2_low, $new_high)) {
+ last;
+ }
+
+ $new_high = $vr2_high if $this->verse_greater($vr2_high, $new_high);
+ }
+ push @retval, [ $new_low, $new_high ];
+ $i = $i2 - 1;
+ }
+
+ return @retval;
+}
+
+sub expand_verse_range {
+ my $this = shift;
+ my @verse_range = @_;
+ my @retval;
+
+ foreach my $vr (@verse_range) {
+ my ($vr_low, $vr_high) = _as_verse_range($vr);
+ die "Verse not found in range $vr_low-$vr_high\n" if ! $this->{VI}->go_to_verse($vr_low);
+ do {
+ push @retval, $this->{VI}->get_key;
+ } while($this->{VI}->get_key ne $vr_high && $this->{VI}->next);
+ }
+
+ return @retval;
+}
+
+sub make_verse_range_str {
+ my $this = shift;
+ my @verse_range = @_;
+ my $retval;
+
+ my $prev_book = "";
+ my $prev_chapter = -1;
+ foreach my $vr (@verse_range) {
+ my ($vr_low, $vr_high) = _as_verse_range($vr);
+ my ($book_low, $chapter_low, $verse_low) = $this->parse_verse($vr_low);
+ my ($book_high, $chapter_high, $verse_high) = $this->parse_verse($vr_high);
+ if($book_low ne $prev_book || $book_high ne $book_low) {
+ # New book. Put semicolon and such.
+ $retval .= "; " if $prev_book;
+ $retval .= "$book_low $chapter_low:$verse_low";
+ } elsif($chapter_low != $prev_chapter || $chapter_high != $chapter_low) {
+ # Same book. New chapter.
+ $retval .= ", $chapter_low:$verse_low"
+ } else {
+ $retval .= ",$verse_low";
+ }
+
+ if($book_high ne $book_low) {
+ $retval .= "-$book_high $chapter_high:$verse_high";
+ } elsif($chapter_high != $chapter_low) {
+ $retval .= "-$chapter_high:$verse_high";
+ } elsif($verse_high != $verse_low) {
+ $retval .= "-$verse_high";
+ }
+
+ $prev_book = $book_high;
+ $prev_chapter = $chapter_high;
+ }
+ return $retval;
+}
+
+1;
+
+__END__
+# Below is stub documentation for your module. You better edit it!
+
+=head1 NAME
+
+Sword - Perl extension to grab Bible verses from Sword (http://www.crosswire.org/sword).
+
+=head1 SYNOPSIS
+
+ use Sword;
+ my $mod = new Sword::Module("KJV");
+ my $vi = $mod->get_iterator();
+ do {
+ print $vi->get_key(), " : ", $vi->get_verse(), "\n";
+ } while($vi->next());
+
+
+=head1 DESCRIPTION
+
+=head2 Summary
+
+ There are three basic ways of navigating the Bible with Sword:
+
+ 1. go directly to verses by name and then step through the Bible up and
+ down
+
+ This prints out everything from I John 2:3 to the end of the Bible:
+
+ use Sword;
+ my $mod = new Sword::Module("KJV");
+ my $vi = $mod->get_iterator("I John 2:3");
+ do {
+ print $vi->get_key(), " : ", $vi->get_verse(), "\n";
+ } while($vi->next());
+ # $vi->prev() would go to the beginning of the Bible backwards
+
+
+ 2. Browse by book, chapter and verse
+
+ This prints out the first verse of every book in the Bible:
+
+ use Sword;
+ my $mod = new Sword::Module("KJV");
+ my $vi = $mod->get_iterator();
+ foreach my $book ($mod->get_books()) {
+ $vi->set_book($book);
+ $vi->set_chapter_num(1);
+ $vi->set_verse_num(1);
+ print $vi->get_key(), " : ", $vi->get_verse(), "\n";
+ # You can use get_book, get_chapter_num
+ }
+
+
+ 3. Search for verses
+
+ And of course you can search!  This gets everything in the KJV with the
+ word "sword" in it:
+
+ use Sword;
+ my $mod = new Sword::Module("KJV");
+ foreach my $result ($mod->search("sword")) {
+ print "$result->[0] : $result->[1]\n";
+ }
+
+ This package has several other lesser-known but useful capabilities, as well,
+ including the ability to merge separate verse lists and work with ranges of
+ verses.
+
+
+=head2 PACKAGE Sword
+
+This package contains the generic routines not specific to any module.
+
+=item get_modules([$type])
+
+ my @modules = Sword::get_modules;
+
+Get an array of module names by type. Type is Biblical Texts by default. ALL not supported yet.
+
+=item get_module($module_name)
+
+ my $mod = Sword::get_module("KJV");
+
+Get an actual Sword::Module object using the given module name.
+
+=item get_locales
+
+ my @locales = Sword::get_locales;
+
+Get an array of available locale names
+
+=item set_locale
+
+ Sword::set_locale($locale);
+
+Sets the default locale for book names and verses and such. Subsequent Modules and VerseIterators will be affected.
+
+=item get_verse($verse, [$module_name])
+
+ print Sword::get_verse("Genesis 1:4"), "\n";
+
+Gets a verse from a module, by key. Module name defaults to the first Biblical Text module.
+
+
+=head2 CLASS Sword::Module
+
+ my $mod = Sword::get_module("KJV");
+ my $mod = new Sword::Module("KJV");
+
+Sword::Module represents a sword module, which is really a single text (like KJV or NIV). It is best to use
+Sword::get_module() to get this.
+
+=item new($module_name)
+
+ my $mod = new Sword::Module("KJV");
+
+Get a module object with the specified name HEY.
+
+
+=item get_verse($verse)
+
+ print $mod->get_verse("John 3:16"), "\n";
+
+Get the specifed verse.
+
+=item get_iterator([$verse])
+
+ my $vi = $mod->get_iterator("Malachi 4:6");
+ $vi->next;
+ print "The verse after Malachi 4:6 is ", $vi->get_key, "\n";
+
+Get a Sword::VerseIterator (see appropriate documentation. Assumes Genesis 1:1 if none specified.
+
+=item search($term)
+
+ foreach my $result ($mod->search("hope")) { print "$result->[0] : $result->[1]\n"; }
+
+Search for the specified terms using Sword, and return an array of results. Each result is a reference
+to a 2-element array containing the verse # and the actual verse.
+
+=item search_verses($term)
+
+ foreach my $result ($mod->search_verses("hope")) { print "$result : ", $mod->get_verse($result), "\n"; }
+
+Search for the specified terms using Sword, and return a simple array containing the verse #'s only.
+
+=item verse_greater($verse1, $verse2)
+
+ print "James 1:19 is ", $mod->verse_greater("James 1:19", "Hebrews 11:12") ? "after" : "before", " Hebrews 11:12\n";
+
+Find out whether verse 1 is greater than verse 2.
+Returns -1 on error, 0 for false and 1 for true.
+
+=item next_verse($verse)
+
+ print "The verse after James 1:19 is ", $mod->next_verse("James 1:19"), "\n";
+
+Get the verse after the given verse. This goes past book boundaries.
+
+=item prev_verse($verse)
+
+ print "The verse before James 1:19 is ", $mod->prev_verse("James 1:19"), "\n";
+
+Get the verse before the given verse. This goes past book boundaries.
+
+=item parse_verse($verse)
+
+ my @parsed = $mod->parse_verse("Revelation 4:5"); print "Revelation 4:5 parses to $parsed[0] $parsed[1]:$parsed[2]\n";
+
+Parse the given verse, canonicalizing the book (turning Revelation into "Revelation of John", for example).
+This returns three pieces, the book, the chapter and the verse. It returns 3 undefined values if it fails.
+
+
+=item get_books
+
+ print "Books in the Bible: ", join(", ", $mod->get_books()), "\n";
+
+Get an array of the books in this module. (Currently biblical modules that do not use some books are not supported.
+
+=item get_num_chapters($book)
+
+ for(my $i=0;$i<$mod->get_num_chapters("Genesis");$i++) { print $mod->get_verse("Genesis " . $i+1 . ":1" }
+
+Get the number of chapters in a book.
+
+=item get_num_verses_list($book)
+
+ my @verses_list = $mod->get_num_verses_list("Malachi"); print "Genesis 4 has $verses_list[3] chapters.\n";
+
+Get an array containing the number of verses in each chapter in a book.
+
+=item get_testament($book)
+
+ print "Testament of Malachi is ", $mod->get_testament("Malachi"), "\n";
+
+Returns the testament of a book (NT or OT for New Testament or Old Testament)
+
+=item get_book_num($book)
+
+ print "Malachi is the ", ($mod->get_book_num("Malachi")+1), "th book in the Old Testament.\n";
+
+Get the number of the specified book in its testament (Genesis = 0, Matthew = 0)
+
+
+=item get_name
+
+ print "Module Name: ", $mod->get_name, "\n";
+
+Get the name of the module (e.g. KJV).
+
+=item get_description
+
+ print "Module Description: ", $mod->get_description, "\n";
+
+Get the description of the module.
+
+=item get_type
+
+ print "Module Type: ", $mod->get_type, "\n";
+
+Get the type of the module (e.g. Biblical Texts).
+
+
+=item sort_verse_list(@verse_list)
+
+ my @sorted_list = $mod->sort_verse_list("Acts 1:2", "John 2:3", "Malachi 1:5");
+
+Sort a verse list (an array of verse names like "Acts 1:2") according to book/chapter/verse.
+
+=item union_verse_list($verse_list1, $verse_list2)
+
+ my @list1 = $mod->search_verses("trumpet");
+ my @list2 = $mod->search_verses("horn");
+ my @new_verse_list = $mod->union_verse_list(\@list1, \@list2);
+
+Take two arrays of verse names ("James 1:19", etc.) and merges them together, removing duplicates.
+(Tip: union a list with an empty list to just remove duplicates.)
+
+This assumes the two lists are sorted.
+
+=item intersect_verse_list($verse_list1, $verse_list2)
+
+ my @list1 = $mod->search_verses("hope");
+ my @list2 = $mod->search_verses("love");
+ my @new_verse_list = $mod->intersect_verse_list(\@list1, \@list2);
+
+Take two arrays of verse names ("James 1:19", etc.), takes all the verses in common, and puts them
+into a new list, removing duplicates.
+
+This assumes the two lists are sorted.
+
+=item parse_verse_range($verse_range_str, [$include_zeroes, $split_books, $default_book])
+
+ my @verse_ranges = $mod->parse_verse_range("James 1:19-24;Genesis 1-3;Exodus 4:2-4,6;Haggai");
+
+Parse a list of verses and turn it into a verse range structure, which is a list of lists, each
+containing 2 elements, the lower and then the upper bound, like so (this is the result of the
+above example):
+
+ ( [ "James 1:19", "James 1:24" ],
+ [ "Genesis 1:1", "Genesis 3:24" ],
+ [ "Exodus 4:2", "Exodus 4:4" ],
+ [ "Exodus 4:6", "Exodus 4:6" ],
+ [ "Haggai 1:1", "Haggai 2:23 ] )
+
+The $include_zeroes parameter specifies whether the default chapter/verse should be 1 or 0
+when it is unspecified. It will be 1 if include_zeroes is false or unspecified, or 0 if it
+is true.
+
+The $split_books parameter specifies what happens when the user specifies multiple books
+(e.g. "Genesis 20:12-Exodus 2:2"). Normally the system just creates one range entry
+( "Genesis 20:12", "Exodus 2:2" ). With this turned on the system creates a range entry
+for each book ("Genesis 20:12", "Genesis 50:26" and "Exodus 1:1", "Exodus 2:2"). This
+works even across multiple books (i.e. "Genesis-Revelation").
+
+=item condense_verse_range(@verse_range_or_list)
+
+ my @condensed_range = $mod->condense_verse_range($mod->parse_verse_range("Acts 8:1; Acts 8:2-5; Genesis 2:3-4,2-5"));
+ my @condensed_range = $mod->condense_verse_range("Acts 1:1", "Acts 1:2", "Acts 1:3", "James 1:19");
+
+Condense an existing range down to its minimum range (put overlapping or adjacent verses together).
+
+This assumes the verse range or list is sorted.
+
+=item sort_verse_range(@verse_range)
+
+ my @sorted_verse_range = $mod->sort_verse_range($mod->parse_verse_range("Acts 8:2-4,1; Acts 9; Genesis 2"));
+
+Sort a verse range (see parse_verse_range for structure) according to low end of
+range (low to high) and then size of range (from smallest to largest). This does not
+remove duplicates.
+
+=item union_verse_range($verse_range1, $verse_range2)
+
+ my @range1 = $mod->parse_verse_range("John 1:2-12,2:1-4,3:6-7,9-10");
+ my @range2 = $mod->parse_verse_range("John 1:1-2,2:2,4-6,3:5-8");
+ my @new_verse_range = $mod->union_verse_range(\@range1, \@range2);
+
+Take two verse range lists (see parse_verse_range for structure) and merges them together,
+removing duplicates. (Tip: union a range with an empty list to simply remove duplicates.)
+
+This assumes the two ranges are sorted.
+
+=item intersect_verse_range($verse_list1, $verse_list2)
+
+ my @range1 = $mod->parse_verse_range("John 1:2-12,2:1-4,3:6-7,9-10");
+ my @range2 = $mod->parse_verse_range("John 1:1-2,2:2,4-6,3:5-8");
+ my @new_verse_range = $mod->intersect_verse_range(\@range1, \@range2);
+
+Take two verse range lists (see parse_verse_range for structure), takes all the verses in common,
+and puts them into a new range set, removing duplicates.
+
+This assumes the two ranges are sorted.
+=item expand_verse_range(@verse_range)
+
+ my @verse_list = $mod->expand_verse_range($mod->parse_verse_range("Acts 8:2-4,1; Acts 9"));
+
+Take a verse range (see parse_verse_range for structure) and turn it into a simple list of verses.
+
+=item make_verse_range_str(@verse_range)
+
+ my @verse_list = $mod->make_verse_range_str($mod->parse_verse_range("James 1:19-24;Genesis 1-3;Exodus 4:2-4,6;Haggai"));
+
+Take a verse range (see parse_verse_range for structure) or verse list and turn it into a human-readable
+string suitable to pass into parse_verse_range.
+
+
+=head2 CLASS Sword::VerseIterator
+
+ my $vi = $mod->get_iterator("Genesis 1:1");
+ my $vi = new Sword::VerseIterator("KJV");
+
+VerseIterator provides functions for moving up and down through the Bible more efficiently than get_verse, next_verse and prev_verse in Sword::Module. It is best to get this using Sword::Module->get_iterator($verse).
+
+=item new($module_name)
+
+ my $vi = new Sword::VerseIterator("KJV");
+
+Create a new VerseIterator on the specified module.
+
+
+=item get_verse
+
+ print "Current verse (", $vi->get_key(), ") is ", $vi->get_verse(), "\n";
+
+Get the current verse text (meaning the actual Bible text at that verse).
+
+=item get_key
+
+ print "Current verse (", $vi->get_key(), ") is ", $vi->get_verse(), "\n";
+
+Get the current verse key (e.g. "Malachi 5:5")
+
+=item go_to_verse($verse)
+
+ die "Could not go to Malachi 5:5" if !$vi->go_to_verse("Malachi 5:5");
+
+Go to the specified verse (e.g. "Malachi 5:5").
+Returns 0 on success, nonzero on on failure.
+
+=item next([$how_far])
+
+ die "Could not go to the next verse after " . $vi->get_key if !$vi->next;
+
+Advance the iterator forward through the Bible. how_far (default 1) tells how many verses to go.
+Returns 0 on success, nonzero on on failure.
+
+=item prev([$how_far])
+
+ die "Could not go to the verse before " . $vi->get_key if !$vi->prev;
+
+Advance the iterator backward through the Bible. how_far (default 1) tells how many verses to go.
+Returns 0 on success, nonzero on on failure.
+
+
+=item get_book
+
+ print "Current verse is ", $vi->get_book, " ", $vi->get_chapter_num, ":", $vi->get_verse_num, ".\n";
+
+Get the current book (canonical--i.e. Revelation of John even if you specified Revelation in
+go_to_verse or set_book).
+
+=item get_chapter_num
+
+ print "Current verse is ", $vi->get_book, " ", $vi->get_chapter_num, ":", $vi->get_verse_num, ".\n";
+
+Get the current chapter #.
+
+=item get_verse_num
+
+ print "Current verse is ", $vi->get_book, " ", $vi->get_chapter_num, ":", $vi->get_verse_num, ".\n";
+
+Get the current verse # within the chapter.
+
+=item set_book
+
+ $vi->set_book("Genesis");
+ $vi->set_chapter_num(4);
+ $vi->set_verse_num(5);
+ print $vi->get_key, " : ", $vi->get_verse, "\n";
+
+Set the book the iterator is on. This resets chapter and verse to 1.
+
+=item set_chapter_num
+
+ $vi->set_book("Genesis");
+ $vi->set_chapter_num(4);
+ $vi->set_verse_num(5);
+ print $vi->get_key, " : ", $vi->get_verse, "\n";
+
+Set the chapter in the current book. This resets verse to 1.
+
+=item set_verse_num
+
+ $vi->set_book("Genesis");
+ $vi->set_chapter_num(4);
+ $vi->set_verse_num(5);
+ print $vi->get_key, " : ", $vi->get_verse, "\n";
+
+Set the verse in the current chapter.
+
+
+=item get_module_name
+
+ print "The module we're using is ", $vi->get_module_name, "\n";
+
+Get the name of the module this VerseIterator is going through.
+
+
+=head1 AUTHOR
+
+John Keiser, jkeiser@iname.com
+
+=head1 SEE ALSO
+
+L<perl>.
+
+=cut
diff --git a/bindings/perl/Sword.xs b/bindings/perl/Sword.xs
new file mode 100644
index 0000000..e78c3aa
--- /dev/null
+++ b/bindings/perl/Sword.xs
@@ -0,0 +1,254 @@
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+#include "EXTERN.h"
+#include "perl.h"
+#include "XSUB.h"
+#ifdef __cplusplus
+}
+#endif
+
+#undef list
+
+#include <iostream.h>
+#include <swmgr.h>
+#include <swmodule.h>
+#include <versekey.h>
+#include <localemgr.h>
+
+SWMgr manager;
+
+class VerseIterator {
+public:
+ SWModule * module;
+ VerseKey key;
+ VerseIterator(char * module_name);
+ ~VerseIterator();
+
+ // Iterator info
+ const char * get_module_name() { return module->Name(); }
+
+ // Verse info
+ const char * get_verse() { module->SetKey(key); return (const char*)*module; }
+ const char * get_key() { return key; }
+
+ // Iteration
+ int next(int how_far);
+ int prev(int how_far);
+
+ // Go to verse
+ int go_to_verse(char * verse);
+
+ // Book / Chapter / Verse traversal
+ const char * get_book() { return key.books[key.Testament() - 1][key.Book() - 1].name; }
+ int get_chapter_num() { return key.Chapter(); }
+ int get_verse_num() { return key.Verse(); }
+
+ void set_chapter_num(int chapter_num) { key.Chapter(chapter_num); }
+ void set_verse_num(int verse_num) { key.Verse(verse_num); }
+
+ // Stuff that should go into some sort of Module class
+ char * _get_module_name() { return module->Name(); }
+ char * _get_module_desc() { return module->Description(); }
+ char * _get_module_type() { return module->Type(); }
+ int _verse_greater(char * verse1, char * verse2);
+};
+
+VerseIterator::VerseIterator(char * module_name) {
+ module = manager.Modules[module_name];
+ key = module->Key();
+ key.setLocale(LocaleMgr::systemLocaleMgr.getDefaultLocaleName());
+
+ key = key.LowerBound();
+}
+
+VerseIterator::~VerseIterator() {
+}
+
+int VerseIterator::next(int how_far) {
+ if(key == key.UpperBound()) {
+ return 0;
+ }
+ module->SetKey(key);
+ (*module) += how_far;
+ key = module->Key();
+ return 1;
+}
+
+int VerseIterator::prev(int how_far) {
+ if(key == key.LowerBound()) {
+ return 0;
+ }
+ module->SetKey(key);
+ (*module) -= how_far;
+ key = module->Key();
+ return 1;
+}
+
+int VerseIterator::go_to_verse(char * verse) {
+ int retval = module->SetKey(verse);
+ key = module->Key();
+ return ! retval;
+}
+
+int VerseIterator::_verse_greater(char * verse1, char * verse2) {
+ if(module->SetKey(verse1)) {
+ return -1;
+ }
+ SWKey key1 = module->Key();
+ if(module->SetKey(verse2)) {
+ return -1;
+ }
+ SWKey key2 = module->Key();
+ return key1 > key2;
+}
+
+MODULE = Sword PACKAGE = Sword
+
+void
+get_modules(char * textType = "Biblical Texts")
+PPCODE:
+ ModMap::iterator modIterator;
+ for (modIterator = manager.Modules.begin(); modIterator != manager.Modules.end(); modIterator++) {
+ SWModule *module = (*modIterator).second;
+ if(!strcmp(module->Type(),textType)) {
+ string s = (*modIterator).first;
+ XPUSHs(sv_2mortal(newSVpv(s.c_str(), s.length())));
+ }
+ }
+
+void
+get_locales()
+PPCODE:
+ LocaleMgr lm = LocaleMgr::systemLocaleMgr;
+ list<string> loclist = lm.getAvailableLocales();
+ list<string>::iterator li = loclist.begin();
+ for (;li != loclist.end(); li++) {
+ XPUSHs(sv_2mortal(newSVpv(li->c_str(), li->length())));
+ }
+
+void
+set_locale(char * locale)
+CODE:
+ LocaleMgr::systemLocaleMgr.setDefaultLocaleName(locale);
+
+
+MODULE = Sword PACKAGE = Sword::VerseIterator
+
+VerseIterator *
+VerseIterator::new(char * module_name)
+
+void
+VerseIterator::DESTROY()
+
+const char *
+VerseIterator::get_module_name()
+
+const char *
+VerseIterator::get_verse()
+
+const char *
+VerseIterator::get_key()
+
+
+int
+VerseIterator::next(int how_far = 1)
+
+int
+VerseIterator::prev(int how_far = 1)
+
+
+int
+VerseIterator::go_to_verse(char * verse)
+
+
+const char *
+VerseIterator::get_book()
+
+int
+VerseIterator::get_chapter_num()
+
+int
+VerseIterator::get_verse_num()
+
+void
+VerseIterator::set_chapter_num(int chapter_num)
+
+void
+VerseIterator::set_verse_num(int verse_num)
+
+
+void
+VerseIterator::_get_books()
+PPCODE:
+
+ for(int testament_num=0;testament_num<2;testament_num++) {
+ for(int book_num=0;book_num<THIS->key.BMAX[testament_num];book_num++) {
+ int num_chapters = THIS->key.books[testament_num][book_num].chapmax;
+ HV * book_info = newHV();
+ hv_store(book_info, "name", 4, newSVpv(THIS->key.books[testament_num][book_num].name, 0), 0);
+ hv_store(book_info, "num_chapters", 12, newSVnv(num_chapters), 0);
+ hv_store(book_info, "testament_num", 13, newSVnv(testament_num), 0);
+ hv_store(book_info, "book_num", 8, newSVnv(book_num), 0);
+ AV * chapter_maxes = newAV();
+ for(int i=0;i<num_chapters;i++) {
+ av_push(chapter_maxes, newSVnv(THIS->key.books[testament_num][book_num].versemax[i]));
+ }
+ hv_store(book_info, "chapter_maxes", 13, newRV_noinc((SV *)chapter_maxes), 0);
+ XPUSHs(newRV_noinc((SV *)book_info));
+ }
+ }
+
+void
+VerseIterator::_search(char * searchStr)
+PPCODE:
+ ListKey &searchResults = THIS->module->Search(searchStr);
+
+ searchResults.Persist(true);
+
+ for(int i=0;i<searchResults.Count();i++) {
+ SWKey * key = searchResults.GetElement(i);
+ AV * search_result = newAV();
+ av_push(search_result, newSVpv(*key, 0));
+ THIS->module->SetKey(key);
+ av_push(search_result, newSVpv(*THIS->module, 0));
+ XPUSHs(newRV_noinc((SV *)search_result));
+ }
+
+void
+VerseIterator::_search_verses(char * searchStr)
+PPCODE:
+ ListKey &searchResults = THIS->module->Search(searchStr);
+
+ searchResults.Persist(true);
+
+ for(int i=0;i<searchResults.Count();i++) {
+ SWKey * key = searchResults.GetElement(i);
+ XPUSHs(newSVpv(*key, 0));
+ }
+
+void
+VerseIterator::_parse_verse_list(char * verseList)
+PPCODE:
+ ListKey searchResults = THIS->key.ParseVerseList(verseList, "Genesis 1:1", false);
+
+ searchResults.Persist(true);
+
+ for(int i=0;i<searchResults.Count();i++) {
+ SWKey * key = searchResults.GetElement(i);
+ XPUSHs(newSVpv(*key, 0));
+ }
+
+char *
+VerseIterator::_get_module_name()
+
+char *
+VerseIterator::_get_module_desc()
+
+char *
+VerseIterator::_get_module_type()
+
+int
+VerseIterator::_verse_greater(char * verse1, char * verse2)
+
diff --git a/bindings/perl/perlobject.map b/bindings/perl/perlobject.map
new file mode 100644
index 0000000..4795c47
--- /dev/null
+++ b/bindings/perl/perlobject.map
@@ -0,0 +1,106 @@
+# "perlobject.map" Dean Roehrich, version 19960302
+#
+# TYPEMAPs
+#
+# HV * -> unblessed Perl HV object.
+# AV * -> unblessed Perl AV object.
+#
+# INPUT/OUTPUT maps
+#
+# O_* -> opaque blessed objects
+# T_* -> opaque blessed or unblessed objects
+#
+# O_OBJECT -> link an opaque C or C++ object to a blessed Perl object.
+# T_OBJECT -> link an opaque C or C++ object to an unblessed Perl object.
+# O_HvRV -> a blessed Perl HV object.
+# T_HvRV -> an unblessed Perl HV object.
+# O_AvRV -> a blessed Perl AV object.
+# T_AvRV -> an unblessed Perl AV object.
+
+TYPEMAP
+
+HV * T_HvRV
+AV * T_AvRV
+
+
+######################################################################
+OUTPUT
+
+# The Perl object is blessed into 'CLASS', which should be a
+# char* having the name of the package for the blessing.
+O_OBJECT
+ sv_setref_pv( $arg, CLASS, (void*)$var );
+
+T_OBJECT
+ sv_setref_pv( $arg, Nullch, (void*)$var );
+
+# Cannot use sv_setref_pv() because that will destroy
+# the HV-ness of the object. Remember that newRV() will increment
+# the refcount.
+O_HvRV
+ $arg = sv_bless( newRV((SV*)$var), gv_stashpv(CLASS,1) );
+
+T_HvRV
+ $arg = newRV((SV*)$var);
+
+# Cannot use sv_setref_pv() because that will destroy
+# the AV-ness of the object. Remember that newRV() will increment
+# the refcount.
+O_AvRV
+ $arg = sv_bless( newRV((SV*)$var), gv_stashpv(CLASS,1) );
+
+T_AvRV
+ $arg = newRV((SV*)$var);
+
+
+######################################################################
+INPUT
+
+O_OBJECT
+ if( sv_isobject($arg) && (SvTYPE(SvRV($arg)) == SVt_PVMG) )
+ $var = ($type)SvIV((SV*)SvRV( $arg ));
+ else{
+ warn( \"${Package}::$func_name() -- $var is not a blessed SV reference\" );
+ XSRETURN_UNDEF;
+ }
+
+T_OBJECT
+ if( SvROK($arg) )
+ $var = ($type)SvIV((SV*)SvRV( $arg ));
+ else{
+ warn( \"${Package}::$func_name() -- $var is not an SV reference\" );
+ XSRETURN_UNDEF;
+ }
+
+O_HvRV
+ if( sv_isobject($arg) && (SvTYPE(SvRV($arg)) == SVt_PVHV) )
+ $var = (HV*)SvRV( $arg );
+ else {
+ warn( \"${Package}::$func_name() -- $var is not a blessed HV reference\" );
+ XSRETURN_UNDEF;
+ }
+
+T_HvRV
+ if( SvROK($arg) && (SvTYPE(SvRV($arg)) == SVt_PVHV) )
+ $var = (HV*)SvRV( $arg );
+ else {
+ warn( \"${Package}::$func_name() -- $var is not an HV reference\" );
+ XSRETURN_UNDEF;
+ }
+
+O_AvRV
+ if( sv_isobject($arg) && (SvTYPE(SvRV($arg)) == SVt_PVAV) )
+ $var = (AV*)SvRV( $arg );
+ else {
+ warn( \"${Package}::$func_name() -- $var is not a blessed AV reference\" );
+ XSRETURN_UNDEF;
+ }
+
+T_AvRV
+ if( SvROK($arg) && (SvTYPE(SvRV($arg)) == SVt_PVAV) )
+ $var = (AV*)SvRV( $arg );
+ else {
+ warn( \"${Package}::$func_name() -- $var is not an AV reference\" );
+ XSRETURN_UNDEF;
+ }
+
diff --git a/bindings/perl/test.pl b/bindings/perl/test.pl
new file mode 100644
index 0000000..0a76142
--- /dev/null
+++ b/bindings/perl/test.pl
@@ -0,0 +1,163 @@
+# Before `make install' is performed this script should be runnable with
+# `make test'. After `make install' it should work as `perl test.pl'
+
+#########################
+
+# change 'tests => 1' to 'tests => last_test_to_print';
+
+use Test;
+BEGIN { plan tests => 1 };
+use Sword;
+use Devel::Peek;
+ok(1); # If we made it this far, we're ok.
+#########################
+
+# Insert your test code below, the Test module is use()ed here so read
+# its man page ( perldoc Test ) for help writing this test script.
+
+my $test_name;
+my $old_test_name = -1;
+my $sub_test_num;
+sub print_if {
+ if($test_name ne $old_test_name) {
+ $old_test_name = $test_name;
+ $sub_test_num = 1;
+ } else {
+ $sub_test_num++;
+ }
+ print "not " if ! $_[0];
+ print "ok $test_name-$sub_test_num\n";
+}
+
+$test_name = "list";
+my @modules = Sword::get_modules;
+print_if (@modules > 0);
+$test_name = "get_verse";
+# Check get_verse
+print_if Sword::get_verse("James 1:19", $module_name) =~ /slow/i;
+$test_name = "init";
+my $module_name = $modules[0];
+my $b = new Sword::VerseIterator($module_name);
+# Make sure it initialized
+print_if $b;
+# Make sure it's initially Genesis 1:1
+print_if $b->get_key eq "Genesis 1:1" && $b->get_verse =~ /beginning/i;
+$test_name = "iter";
+# Test prev/next
+print_if $b->next(2) && $b->prev && $b->next(2);
+print_if $b->get_key eq "Genesis 1:4" && $b->get_verse =~ /darkness/i;
+# Test prev going back before beginning
+print_if $b->prev(4);
+print_if $b->get_key eq "Genesis 1:1" && $b->get_verse =~ /beginning/i;
+# Test failing prev
+print_if ! $b->prev;
+# Test go to verse
+print_if $b->go_to_verse("Revelation 4:11") && $b->get_key eq "Revelation of John 4:11";
+
+$test_name = "iter-thread";
+my $c = new Sword::VerseIterator($module_name);
+# Test multiple keys at once
+print_if $c && $c->get_key eq "Genesis 1:1" && $c->get_verse =~ /beginning/i;
+print_if $b->get_key eq "Revelation of John 4:11" && $b->get_verse =~ /worthy/i;
+
+$test_name = "iter-parts";
+# Test book/chapter/verse get
+print_if $b->get_key eq $b->get_book() . " " . $b->get_chapter_num . ":" . $b->get_verse_num;
+print_if $c->get_key eq $c->get_book() . " " . $c->get_chapter_num . ":" . $c->get_verse_num;
+# Test book/chapter/verse set
+$b->set_chapter_num(8);
+$b->set_verse_num(6);
+print_if $b->get_key eq "Revelation of John 8:6";
+$b->set_book("Genesis");
+$b->set_chapter_num(1);
+$b->set_verse_num(4);
+print_if $b->get_key eq "Genesis 1:4" && $b->get_verse =~ /darkness/i;
+$b->set_book("Revelation of John");
+$b->set_chapter_num(4);
+$b->set_verse_num(11);
+print_if $b->get_key eq "Revelation of John 4:11" && $b->get_verse =~ /worthy/i;
+
+$test_name = "module";
+my $module = Sword::get_module($module_name);
+# Test module attributes
+print_if $module->get_name eq $module_name;
+print_if $module->get_description;
+print_if $module->get_type eq "Biblical Texts";
+# Test get iterator
+my $d = $module->get_iterator();
+print_if $d->get_key eq "Genesis 1:1" && $d->get_verse =~ /beginning/i;
+my $e = $module->get_iterator("James 1:19");
+print_if $e->get_key eq "James 1:19" && $e->get_verse =~ /slow/i;
+# Test get_verse
+print_if $module->get_verse("Genesis 1:4") =~ /darkness/i;
+# Test verse module stuff
+my $retval = $module->verse_greater("James 3:4", "Malachi 4:5");
+print_if $retval != -1 && $retval;
+$retval = $module->verse_greater("Genesis 8:10", "Malachi 4:5");
+print_if $retval != -1 && ! $retval;
+$retval = $module->verse_greater("Genesis 12:1", "Genesis 12:1");
+print_if $retval != -1 && ! $retval;
+print_if $module->next_verse("Malachi 4:6") eq "Matthew 1:1";
+print_if $module->prev_verse("Matthew 1:1") eq "Malachi 4:6";
+print_if join(" ... ", $module->parse_verse("Revelation of John 21:12")) eq "Revelation of John ... 21 ... 12";
+
+$test_name = "books";
+my @books = $module->get_books;
+# Test get books list
+print_if @books == 66;
+print_if $books[0] eq "Genesis" && $books[27] eq "Hosea" && $books[65] eq "Revelation of John";
+# Test if # chapters is working
+print_if $module->get_num_chapters("Hosea") == 14;
+# Test testament stuff
+print_if $module->get_testament("Hosea") eq "OT" && $module->get_testament("Mark") eq "NT";
+# Test max verses
+my @verses_list = $module->get_num_verses_list("I Kings");
+print $verses_list[4] == 34;
+
+$test_name = "search";
+# Test search
+my $found = 0;
+foreach my $result ($module->search("pure")) {
+ $found = 1 if $result->[0] eq "I John 3:3";
+}
+print_if $found;
+$found = 0;
+foreach my $result ($module->search_verses("pure")) {
+ $found = 1 if $result eq "I John 3:3";
+}
+print_if $found;
+
+
+$test_name = "range";
+my $output_str;
+my $verse_range_str = "1:5;Judges 8:12-15,17,9:2-3;18;John 4-5:4,Revelation 5;Joshua 4-5;Exodus-Leviticus";
+print_if $module->make_verse_range_str($module->parse_verse_range($verse_range_str)) eq "Genesis 1:5; Judges 8:12-15,17, 9:2-3, 18:1-31; John 4:1-5:4; Revelation of John 5:1-14; Joshua 4:1-5:15; Exodus 1:1-Leviticus 27:34";
+print_if $module->make_verse_range_str($module->parse_verse_range($verse_range_str, 0, 0, "Romans")) eq "Romans 1:5; Judges 8:12-15,17, 9:2-3, 18:1-31; John 4:1-5:4; Revelation of John 5:1-14; Joshua 4:1-5:15; Exodus 1:1-Leviticus 27:34";
+print_if $module->make_verse_range_str($module->parse_verse_range($verse_range_str, 1)) eq "Genesis 1:5; Judges 8:12-15,17, 9:2-3, 18:0-31; John 4:0-5:4; Revelation of John 5:0-14; Joshua 4:0-5:15; Exodus 0:0-Leviticus 27:34";
+print_if $module->make_verse_range_str($module->parse_verse_range("Luke 9:27-Acts 2:3", 0, 1)) eq "Luke 9:27-24:53; John 1:1-21:25; Acts 1:1-2:3";
+
+my @verse_range = $module->parse_verse_range("Acts 21:8,4-6,40-22:1;Acts 28:31-Romans 1:1;Malachi 2:2");
+my @verse_list = $module->expand_verse_range(@verse_range);
+print_if $module->make_verse_range_str(@verse_list) eq "Acts 21:8,4,5,6,40, 22:1, 28:31; Romans 1:1; Malachi 2:2";
+@verse_list = $module->sort_verse_list(@verse_list);
+print_if $module->make_verse_range_str(@verse_list) eq "Malachi 2:2; Acts 21:4,5,6,8,40, 22:1, 28:31; Romans 1:1";
+
+my @sorted_verse_range = $module->sort_verse_range(@verse_range);
+print_if $module->make_verse_range_str(@sorted_verse_range) eq "Malachi 2:2; Acts 21:4-6,8, 21:40-22:1; Acts 28:31-Romans 1:1";
+
+my @difficult_verse_range = $module->parse_verse_range("Acts 4:5-8,4-9,4,28:31-Romans 1:6;Acts 28:30-Romans 1:4;Acts 4:4-12,13-15");
+my @made_verse_range = $module->condense_verse_range($module->sort_verse_range(@difficult_verse_range));
+print_if $module->make_verse_range_str(@made_verse_range) eq "Acts 4:4-15; Acts 28:30-Romans 1:6";
+my @made_verse_list = $module->condense_verse_range($module->sort_verse_list($module->expand_verse_range(@difficult_verse_range)));
+print_if $module->make_verse_range_str(@made_verse_list) eq "Acts 4:4-15, 28:30-31; Romans 1:1-6";
+
+my @verse_list1 = ("John 1:2", "John 3:4", "John 4:5", "John 4:5");
+my @verse_list2 = ("John 1:2", "John 3:4", "John 3:4", "John 7:8");
+print_if $module->make_verse_range_str($module->union_verse_list(\@verse_list1, \@verse_list2)) eq "John 1:2, 3:4, 4:5, 7:8";
+print_if $module->make_verse_range_str($module->intersect_verse_list(\@verse_list1, \@verse_list2)) eq "John 1:2, 3:4";
+
+my @verse_range1 = $module->parse_verse_range("John 1:2-12,2:1-4,3:6-7,9-10");
+my @verse_range2 = $module->parse_verse_range("John 1:1-2,2:2,4-6,3:5-8");
+print_if $module->make_verse_range_str($module->union_verse_range(\@verse_range1, \@verse_range2)) eq "John 1:1-12, 2:1-6, 3:5-10";
+print_if $module->make_verse_range_str($module->intersect_verse_range(\@verse_range1, \@verse_range2)) eq "John 1:2, 2:2,4, 3:6-7";
+
diff --git a/bindings/perl/typemap b/bindings/perl/typemap
new file mode 100644
index 0000000..1a1fe01
--- /dev/null
+++ b/bindings/perl/typemap
@@ -0,0 +1,3 @@
+TYPEMAP
+VerseIterator * O_OBJECT
+const char * T_PV
diff --git a/bindings/swig/Makefile b/bindings/swig/Makefile
new file mode 100644
index 0000000..a1dca13
--- /dev/null
+++ b/bindings/swig/Makefile
@@ -0,0 +1,21 @@
+TOP = $(PWD)
+SWIG = swig
+SWIGOPT = -Wall -proxy
+CXXSRCS =
+TARGET = sword
+INTERFACE = sword.i
+LIBS = -lm -lz -lsword
+INCLUDE = -I$(TOP)/../../include/
+
+all::
+ $(MAKE) -f $(TOP)/Makefile.swig CXXSRCS='$(CXXSRCS)' SWIG='$(SWIG)' \
+ TARGET='$(TARGET)' SWIGOPT='$(SWIGOPT)' INTERFACE='$(INTERFACE)' LIBS='$(LIBS)' INCLUDE='$(INCLUDE)' perl5_cpp
+
+static::
+ $(MAKE) -f $(TOP)/Makefile.swig CXXSRCS='$(CXXSRCS)' SWIG='$(SWIG)' \
+ TARGET='myperl' INTERFACE='$(INTERFACE)' INCLUDE='$INCLUDE' perl5_cpp_static
+
+clean::
+ rm -f *_wrap* *.o *~ *.so myperl *.pyc .~* core
+
+check: all
diff --git a/bindings/swig/Makefile.swig b/bindings/swig/Makefile.swig
new file mode 100644
index 0000000..736488c
--- /dev/null
+++ b/bindings/swig/Makefile.swig
@@ -0,0 +1,578 @@
+# Generated automatically from Makefile.in by configure.
+# ------------------------------------------------------------
+# SWIG Examples Makefile
+#
+# This file is used by the examples to build modules. Assuming
+# you ran configure, this file will probably work. However,
+# it's not perfect so you might need to do some hand tweaking.
+#
+# Other notes:
+#
+# 1. Take a look at the prefixes below. Since SWIG works with
+# multiple target languages, you may need to find out where
+# certain packages have been installed. Set the prefixes
+# accordingly.
+#
+# 2. To use this makefile, simply set SRCS, INTERFACE, INCLUDE, LIBS,
+# TARGET, and do a
+# $(MAKE) -f Makefile.template.in SRCS='$(SRCS)' \
+# INCLUDE='$(INCLUDE) LIBS='$(LIBS)' INTERFACE='$(INTERFACE)' \
+# TARGET='$(TARGET)' method
+#
+# 'method' describes what is being built.
+#---------------------------------------------------------------
+
+TARGET =
+CC = gcc
+CXX = c++
+CFLAGS =
+prefix = /usr/local
+exec_prefix= ${prefix}
+SRCS =
+INCLUDE =
+LIBS =
+INTERFACE =
+SWIGOPT =
+SWIG = swig
+RUNTIMEDIR = $(exec_prefix)/lib
+
+LIBM = -lieee -lm
+LIBC =
+LIBCRYPT = -lcrypt
+SYSLIBS = $(LIBM) $(LIBC) $(LIBCRYPT)
+
+libtool_comp = $(TOP)/../Tools/libtool --mode compile
+libtool_link = $(TOP)/../Tools/libtool --mode link
+
+# X11 options
+
+XLIB = -L/usr/X11R6/lib -lX11
+XINCLUDE = -I/usr/X11R6/include
+
+IWRAP = $(INTERFACE:.i=_wrap.i)
+ISRCS = $(IWRAP:.i=.c)
+ICXXSRCS = $(IWRAP:.i=.cxx)
+IOBJS = $(IWRAP:.i=.o)
+
+##################################################################
+# Dynamic loading for C++
+# If you are going to be building dynamic loadable modules in C++,
+# you may need to edit this line appropriately.
+#
+# This line works for g++, but I'm not sure what it might be
+# for other C++ compilers
+##################################################################
+
+CPP_DLLIBS = #-L/usr/local/lib/gcc-lib/sparc-sun-solaris2.5.1/2.7.2 \
+ -L/usr/local/lib -lg++ -lstdc++ -lgcc
+
+# Solaris workshop 5.0
+# CPP_DLLIBS = -L/opt/SUNWspro/lib -lCrun
+
+# Symbols used for using shared libraries
+SO= .so
+LDSHARED= gcc -shared
+CCSHARED= -fpic
+CXXSHARED= gcc -shared
+
+# This is used for building shared libraries with a number of C++
+# compilers. If it doesn't work, comment it out.
+CXXSHARED= c++ -shared
+
+OBJS = $(SRCS:.c=.o) $(CXXSRCS:.cxx=.o)
+
+##################################################################
+##### Tcl/Tk ######
+##################################################################
+
+# Set these to your local copy of Tcl/Tk.
+
+TCL_INCLUDE =
+TCL_LIB =
+TCL_OPTS = -ldl
+TK_OPTS = -ltk -ltcl -ldl
+
+# Extra Tcl specific dynamic linking options
+TCL_DLNK =
+
+# -----------------------------------------------------------
+# Build a new version of the tclsh shell
+# -----------------------------------------------------------
+
+
+tclsh: $(SRCS)
+ $(SWIG) -tcl8 $(SWIGOPT) $(TCL_SWIGOPTS) -ltclsh.i $(INTERFACE)
+ $(CC) $(CFLAGS) $(SRCS) $(ISRCS) $(INCLUDE) $(TCL_INCLUDE) \
+ $(TCL_LIB) $(TCL_OPTS) $(LIBS) $(SYSLIBS) -o $(TARGET)
+
+tclsh_cpp: $(SRCS)
+ $(SWIG) -tcl8 -c++ $(SWIGOPT) $(TCL_SWIGOPTS) -ltclsh.i $(INTERFACE)
+ $(CXX) $(CFLAGS) $(SRCS) $(CXXSRCS) $(ICXXSRCS) $(INCLUDE) $(TCL_INCLUDE) \
+ $(TCL_LIB) $(TCL_OPTS) $(LIBS) $(SYSLIBS) -o $(TARGET)
+
+# -----------------------------------------------------------
+# Build a new copy of wish
+# -----------------------------------------------------------
+
+wish: $(SRCS)
+ $(SWIG) -tcl8 $(SWIGOPT) $(TCL_SWIGOPTS) -lwish.i $(INTERFACE)
+ $(CC) $(CFLAGS) $(SRCS) $(ISRCS) $(INCLUDE) $(TCL_INCLUDE) \
+ $(XINCLUDE) $(TCL_LIB) $(TK_OPTS) $(XLIB) $(LIBS) $(SYSLIBS) -o $(TARGET)
+
+
+wish_cpp: $(SRCS)
+ $(SWIG) -tcl8 -c++ $(SWIGOPT) $(TCL_SWIGOPTS) -lwish.i $(INTERFACE)
+ $(CXX) $(CFLAGS) $(SRCS) $(CXXSRCS) $(ICXXSRCS) $(INCLUDE) $(TCL_INCLUDE) \
+ $(XINCLUDE) $(TCL_LIB) $(TK_OPTS) $(XLIB) $(LIBS) $(SYSLIBS) -o $(TARGET)
+
+# -----------------------------------------------------------
+# Build a Tcl dynamic loadable module (you might need to tweak this)
+# -----------------------------------------------------------
+
+tcl: $(SRCS)
+ $(SWIG) -tcl8 $(SWIGOPT) $(TCL_SWIGOPTS) $(INTERFACE)
+ $(CC) -c $(CCSHARED) $(CFLAGS) $(SRCS) $(ISRCS) $(INCLUDE) $(TCL_INCLUDE)
+ $(LDSHARED) $(OBJS) $(IOBJS) $(TCL_DLNK) $(LIBS) -o $(TARGET)$(SO)
+
+# -----------------------------------------------------------
+# Build a Tcl7.5 dynamic loadable module for C++
+# -----------------------------------------------------------
+
+tcl_cpp: $(SRCS)
+ $(SWIG) -tcl8 -c++ $(SWIGOPT) $(TCL_SWIGOPTS) $(INTERFACE)
+ $(CXX) -c $(CCSHARED) $(CFLAGS) $(SRCS) $(CXXSRCS) $(ICXXSRCS) $(INCLUDE) $(TCL_INCLUDE)
+ $(CXXSHARED) $(OBJS) $(IOBJS) $(TCL_DLNK) $(LIBS) $(CPP_DLLIBS) -o $(TARGET)$(SO)
+
+# -----------------------------------------------------------
+# Build a Tcl7.5 dynamic loadable module, linked against SWIG runtime lib
+# -----------------------------------------------------------
+
+TCL_RUNTIME=-L$(RUNTIMEDIR) -lswigtcl8
+
+tcl_multi: $(SRCS)
+ $(SWIG) -c -tcl8 $(SWIGOPT) $(TCL_SWIGOPTS) $(INTERFACE)
+ $(CC) -c $(CCSHARED) $(CFLAGS) $(SRCS) $(ISRCS) $(INCLUDE) $(TCL_INCLUDE)
+ $(LDSHARED) $(OBJS) $(IOBJS) $(TCL_RUNTIME) $(TCL_DLNK) $(LIBS) -o $(TARGET)$(SO)
+
+tcl_multi_cpp: $(SRCS)
+ $(SWIG) -c -tcl8 -c++ $(SWIGOPT) $(TCL_SWIGOPTS) $(INTERFACE)
+ $(CXX) -c $(CCSHARED) $(CFLAGS) $(SRCS) $(CXXSRCS) $(ICXXSRCS) $(INCLUDE) $(TCL_INCLUDE)
+ $(CXXSHARED) $(OBJS) $(IOBJS) $(TCL_RUNTIME) $(TCL_DLNK) $(LIBS) $(CPP_DLLIBS) -o $(TARGET)$(SO)
+
+##################################################################
+##### PERL 5 ######
+##################################################################
+
+# You need to set this variable to the Perl5 directory containing the
+# files "perl.h", "EXTERN.h" and "XSUB.h". With Perl5.003, it's
+# usually something like /usr/local/lib/perl5/arch-osname/5.003/CORE.
+
+PERL5_INCLUDE= /usr/lib/perl5/5.6.1/i586-linux/CORE
+
+# Extra Perl specific dynamic linking options
+PERL5_DLNK =
+
+# ----------------------------------------------------------------
+# Build a Perl5 dynamically loadable module (C)
+# ----------------------------------------------------------------
+
+perl5: $(SRCS)
+ $(SWIG) -perl5 $(SWIGOPT) $(INTERFACE)
+ $(CC) -c -Dbool=char $(CCSHARED) $(CFLAGS) -DSWIG $(SRCS) $(ISRCS) $(INCLUDE) -I$(PERL5_INCLUDE)
+ $(LDSHARED) $(OBJS) $(IOBJS) $(PERL5_DLNK) $(LIBS) -o $(TARGET)$(SO)
+
+# ----------------------------------------------------------------
+# Build a Perl5 dynamically loadable module (C++)
+# ----------------------------------------------------------------
+
+perl5_cpp: $(SRCS)
+ $(SWIG) -perl5 -c++ $(SWIGOPT) $(INTERFACE)
+ $(CXX) -c $(CCSHARED) $(CFLAGS) -DSWIG -Dexplicit= $(SRCS) $(CXXSRCS) $(ICXXSRCS) $(INCLUDE) -I$(PERL5_INCLUDE)
+ $(CXXSHARED) $(OBJS) $(IOBJS) $(PERL5_DLNK) $(LIBS) $(CPP_DLLIBS) -o $(TARGET)$(SO)
+
+# ----------------------------------------------------------------
+# Build a Perl5 dynamically loadable module, linked against SWIG runtime lib
+# ----------------------------------------------------------------
+
+PERL5_RUNTIME=-L$(RUNTIMEDIR) -lswigpl
+
+perl5_multi: $(SRCS)
+ $(SWIG) -c -perl5 $(SWIGOPT) $(INTERFACE)
+ $(CC) -c -DSWIG -Dbool=char $(CCSHARED) $(CFLAGS) $(SRCS) $(ISRCS) $(INCLUDE) -I$(PERL5_INCLUDE)
+ $(LDSHARED) $(OBJS) $(IOBJS) $(PERL5_RUNTIME) $(PERL5_DLNK) $(LIBS) -o $(TARGET)$(SO)
+
+perl5_multi_cpp: $(SRCS)
+ $(SWIG) -c -perl5 -c++ $(SWIGOPT) $(INTERFACE)
+ $(CXX) -c $(CCSHARED) $(CFLAGS) -DSWIG -Dexplicit= $(SRCS) $(CXXSRCS) $(ICXXSRCS) $(INCLUDE) -I$(PERL5_INCLUDE)
+ $(CXXSHARED) $(OBJS) $(IOBJS) $(PERL5_RUNTIME) $(PERL5_DLNK) $(LIBS) $(CPP_DLLIBS) -o $(TARGET)$(SO)
+
+# ----------------------------------------------------------------
+# Build a module from existing XS C source code. (ie. from xsubpp).
+# ----------------------------------------------------------------
+perl5_xs: $(SRCS)
+ $(CC) -c $(CCSHARED) $(CFLAGS) $(SRCS) $(INCLUDE) -I$(PERL5_INCLUDE)
+ $(LDSHARED) $(OBJS) $(LIBS) -o $(TARGET)$(SO)
+
+# ----------------------------------------------------------------
+# Build a statically linked Perl5 executable
+# ----------------------------------------------------------------
+
+PERL5_LIB = -L$(PERL5_INCLUDE) -lperl.so -ldl $(SYSLIBS)
+
+perl5_static: $(SRCS)
+ $(SWIG) -perl5 -static -lperlmain.i $(SWIGOPT) $(INTERFACE)
+ $(CC) $(CFLAGS) -Dbool=char $(SRCS) $(ISRCS) $(INCLUDE) -I$(PERL5_INCLUDE) $(PERL5_LIB) $(LIBS) -o $(TARGET)
+
+perl5_static_cpp: $(SRCS)
+ $(SWIG) -perl5 -c++ -static -lperlmain.i $(SWIGOPT) $(INTERFACE)
+ $(CXX) $(CFLAGS) -Dexplicit= $(SRCS) $(CXXSRCS) $(ICXXSRCS) $(INCLUDE) -I$(PERL5_INCLUDE) $(PERL5_LIB) $(LIBS) -o $(TARGET)
+
+
+##################################################################
+##### PYTHON ######
+##################################################################
+
+# Make sure these locate your Python installation
+PYTHON_INCLUDE= -DHAVE_CONFIG_H
+PYTHON_LIB =
+
+# Extra Python specific dynamic linking options
+PYTHON_DLNK =
+
+# ----------------------------------------------------------------
+# Build a C dynamically loadable module
+# ----------------------------------------------------------------
+
+python: $(SRCS)
+ $(SWIG) -python $(SWIGOPT) $(INTERFACE)
+ $(CC) -c $(CCSHARED) $(CFLAGS) $(ISRCS) $(SRCS) $(INCLUDE) $(PYTHON_INCLUDE)
+ $(LDSHARED) $(OBJS) $(IOBJS) $(PYTHON_DLNK) $(LIBS) -o $(TARGET)module$(SO)
+
+# -----------------------------------------------------------------
+# Build a C++ dynamically loadable module
+# -----------------------------------------------------------------
+
+python_cpp: $(SRCS)
+ $(SWIG) -c++ -python $(SWIGOPT) $(INTERFACE)
+ $(CXX) -c $(CCSHARED) $(CFLAGS) $(ICXXSRCS) $(SRCS) $(CXXSRCS) $(INCLUDE) $(PYTHON_INCLUDE)
+ $(CXXSHARED) $(OBJS) $(IOBJS) $(PYTHON_DLNK) $(LIBS) $(CPP_DLLIBS) -o $(TARGET)module$(SO)
+
+# -----------------------------------------------------------------
+# Build a dynamically loadable module, linked against SWIG Runtime lib
+# -----------------------------------------------------------------
+
+PYTHON_RUNTIME=-L$(RUNTIMEDIR) -lswigpy
+
+python_multi: $(SRCS)
+ $(SWIG) -c -python $(SWIGOPT) $(INTERFACE)
+ $(CC) -c $(CCSHARED) $(CFLAGS) $(ISRCS) $(SRCS) $(INCLUDE) $(PYTHON_INCLUDE)
+ $(LDSHARED) $(OBJS) $(IOBJS) $(PYTHON_RUNTIME) $(PYTHON_DLNK) $(LIBS) -o $(TARGET)module$(SO)
+
+python_multi_cpp: $(SRCS)
+ $(SWIG) -c -c++ -python $(SWIGOPT) $(INTERFACE)
+ $(CXX) -c $(CCSHARED) $(CFLAGS) $(ICXXSRCS) $(SRCS) $(CXXSRCS) $(INCLUDE) $(PYTHON_INCLUDE)
+ $(CXXSHARED) $(OBJS) $(IOBJS) $(PYTHON_RUNTIME) $(PYTHON_DLNK) $(LIBS) $(CPP_DLLIBS) -o $(TARGET)module$(SO)
+
+
+# -----------------------------------------------------------------
+# Build statically linked Python interpreter
+#
+# These should only be used in conjunction with the %include embed.i
+# library file
+# -----------------------------------------------------------------
+
+#TKINTER = -L/usr/X11R6.3/lib -L/usr/local/compat/lib -ltk4.0 -ltcl7.4 -lX11
+TKINTER =
+PYTHON_LIBOPTS = -lpython2.2 -ldl $(TKINTER) $(SYSLIBS)
+
+python_static: $(SRCS)
+ $(SWIG) -python -lembed.i $(SWIGOPT) $(INTERFACE)
+ $(CC) $(CFLAGS) -Xlinker -export-dynamic $(ISRCS) $(SRCS) $(INCLUDE) \
+ $(PYTHON_INCLUDE) $(LIBS) -L$(PYTHON_LIB) $(PYTHON_LIBOPTS) -o $(TARGET)
+
+python_static_cpp: $(SRCS)
+ $(SWIG) -c++ -python -lembed.i $(SWIGOPT) $(INTERFACE)
+ $(CXX) $(CFLAGS) $(ICXXSRCS) $(SRCS) $(CXXSRCS) $(INCLUDE) \
+ $(PYTHON_INCLUDE) $(LIBS) -L$(PYTHON_LIB) $(PYTHON_LIBOPTS) -o $(TARGET)
+
+# -----------------------------------------------------------------
+# Cleaning the python examples
+# -----------------------------------------------------------------
+
+python_clean:
+ rm -f *_wrap* *.o *~ *$(SO) mypython *.pyc .~* core
+
+##################################################################
+##### GUILE ######
+##################################################################
+
+# Make sure these locate your Guile installation
+GUILE_INCLUDE =
+GUILE_LIB =
+
+# ----------------------------------------------------------------
+# Build a C dynamically loadable module
+# ----------------------------------------------------------------
+
+guile: $(SRCS)
+ $(SWIG) -guile -Linkage ltdlmod $(SWIGOPT) $(INTERFACE)
+ $(CC) -c $(CCSHARED) $(CFLAGS) $(INCLUDE) $(GUILE_INCLUDE) $(ISRCS) $(SRCS)
+ $(LDSHARED) $(OBJS) $(IOBJS) $(LIBS) -o lib$(TARGET)$(SO)
+
+# -----------------------------------------------------------------
+# Build a C++ dynamically loadable module
+# -----------------------------------------------------------------
+
+guile_cpp: $(SRCS)
+ $(SWIG) -c++ -guile -Linkage ltdlmod $(SWIGOPT) $(INTERFACE)
+ $(CXX) -c $(CCSHARED) $(CFLAGS) $(INCLUDE) $(GUILE_INCLUDE) $(ICXXSRCS) $(SRCS) $(CXXSRCS)
+ $(CXXSHARED) $(OBJS) $(IOBJS) $(LIBS) $(CPP_DLLIBS) -o lib$(TARGET)$(SO)
+
+# -----------------------------------------------------------------
+# Build a dynamically loadable module with passive linkage
+# -----------------------------------------------------------------
+
+guile_passive: $(SRCS)
+ $(SWIG) -guile -Linkage passive $(SWIGOPT) $(INTERFACE)
+ $(CC) -c $(CCSHARED) $(CFLAGS) $(INCLUDE) $(GUILE_INCLUDE) $(ISRCS) $(SRCS)
+ $(LDSHARED) $(OBJS) $(IOBJS) $(LIBS) -o lib$(TARGET)$(SO)
+
+guile_passive_cpp: $(SRCS)
+ $(SWIG) -c++ -guile -Linkage passive $(SWIGOPT) $(INTERFACE)
+ $(CXX) -c $(CCSHARED) $(CFLAGS) $(INCLUDE) $(GUILE_INCLUDE) $(ICXXSRCS) $(SRCS) $(CXXSRCS)
+ $(CXXSHARED) $(OBJS) $(IOBJS) $(LIBS) $(CPP_DLLIBS) -o lib$(TARGET)$(SO)
+
+# -----------------------------------------------------------------
+# Build a dynamically loadable module with passive linkage,
+# linked against SWIG runtime lib
+# -----------------------------------------------------------------
+
+GUILE_RUNTIME=-L$(RUNTIMEDIR) -lswigguile
+
+guile_passive_multi: $(SRCS)
+ $(SWIG) -c -guile -Linkage passive $(SWIGOPT) $(INTERFACE)
+ $(CC) -c $(CCSHARED) $(CFLAGS) $(INCLUDE) $(GUILE_INCLUDE) $(ISRCS) $(SRCS)
+ $(LDSHARED) $(OBJS) $(IOBJS) $(GUILE_RUNTIME) $(LIBS) -o lib$(TARGET)$(SO)
+
+guile_passive_multi_cpp: $(SRCS)
+ $(SWIG) -c -c++ -guile -Linkage passive $(SWIGOPT) $(INTERFACE)
+ $(CXX) -c $(CCSHARED) $(CFLAGS) $(INCLUDE) $(GUILE_INCLUDE) $(ICXXSRCS) $(SRCS) $(CXXSRCS)
+ $(CXXSHARED) $(OBJS) $(IOBJS) $(GUILE_RUNTIME) $(LIBS) $(CPP_DLLIBS) -o lib$(TARGET)$(SO)
+
+# -----------------------------------------------------------------
+# Build statically linked Guile interpreter
+# -----------------------------------------------------------------
+
+GUILE_LIBOPTS = -ldl $(SYSLIBS)
+
+guile_static: $(SRCS)
+ $(SWIG) -guile -lguilemain.i -Linkage ltdlmod $(SWIGOPT) $(INTERFACE)
+ $(CC) $(CFLAGS) $(ISRCS) $(SRCS) $(INCLUDE) \
+ -DSWIGINIT="SCM scm_init_$(TARGET)_module(void); scm_init_$(TARGET)_module();" \
+ $(GUILE_INCLUDE) $(LIBS) -L$(GUILE_LIB) $(GUILE_LIBOPTS) -o $(TARGET)-guile
+
+guile_static_cpp: $(SRCS)
+ $(SWIG) -c++ -guile -lguilemain.i -Linkage ltdlmod $(SWIGOPT) $(INTERFACE)
+ $(CXX) $(CFLAGS) $(ICXXSRCS) $(SRCS) $(CXXSRCS) $(INCLUDE) \
+ -DSWIGINIT="SCM scm_init_$(TARGET)_module(void); scm_init_$(TARGET)_module();" \
+ $(GUILE_INCLUDE) $(LIBS) -L$(GUILE_LIB) $(GUILE_LIBOPTS) -o $(TARGET)-guile
+
+guile_simple: $(SRCS)
+ $(SWIG) -guile -lguilemain.i -Linkage simple $(SWIGOPT) $(INTERFACE)
+ $(CC) $(CFLAGS) $(ISRCS) $(SRCS) $(INCLUDE) \
+ $(GUILE_INCLUDE) $(LIBS) -L$(GUILE_LIB) $(GUILE_LIBOPTS) -o $(TARGET)-guile
+
+guile_simple_cpp: $(SRCS)
+ $(SWIG) -c++ -guile -lguilemain.i -Linkage simple $(SWIGOPT) $(INTERFACE)
+ $(CXX) $(CFLAGS) $(ICXXSRCS) $(SRCS) $(CXXSRCS) $(INCLUDE) \
+ $(GUILE_INCLUDE) $(LIBS) -L$(GUILE_LIB) $(GUILE_LIBOPTS) -o $(TARGET)-guile
+
+##################################################################
+##### JAVA ######
+##################################################################
+
+# You need to set this variable to the java directories containing the
+# files "jni.h" and "md.h"
+# usually something like /usr/java/include and /usr/java/include/<arch-osname>.
+JAVA_INCLUDE=
+
+# Extra Java specific dynamic linking options
+JAVA_DLNK =
+JAVALIBPREFIX = lib
+
+# ----------------------------------------------------------------
+# Build a java dynamically loadable module (C)
+# ----------------------------------------------------------------
+
+java: $(SRCS)
+ $(SWIG) -java $(SWIGOPT) $(INTERFACE)
+ $(CC) -c $(CCSHARED) $(CFLAGS) $(SRCS) $(ISRCS) $(INCLUDE) $(JAVA_INCLUDE)
+ $(LDSHARED) $(OBJS) $(IOBJS) $(JAVA_DLNK) $(LIBS) -o $(JAVALIBPREFIX)$(TARGET)$(SO)
+
+# ----------------------------------------------------------------
+# Build a java dynamically loadable module (C++)
+# ----------------------------------------------------------------
+
+java_cpp: $(SRCS)
+ $(SWIG) -java -c++ $(SWIGOPT) $(INTERFACE)
+ $(CXX) -c $(CCSHARED) $(CFLAGS) $(SRCS) $(CXXSRCS) $(ICXXSRCS) $(INCLUDE) $(JAVA_INCLUDE)
+ $(CXXSHARED) $(OBJS) $(IOBJS) $(JAVA_DLNK) $(LIBS) $(CPP_DLLIBS) -o $(JAVALIBPREFIX)$(TARGET)$(SO)
+
+# ----------------------------------------------------------------
+# Build a java dynamically loadable module
+# ----------------------------------------------------------------
+
+java_multi: $(SRCS)
+ $(SWIG) -java $(SWIGOPT) $(INTERFACE)
+ $(CC) -c $(CCSHARED) $(CFLAGS) $(SRCS) $(ISRCS) $(INCLUDE) $(JAVA_INCLUDE)
+ $(LDSHARED) $(OBJS) $(IOBJS) $(JAVA_DLNK) $(LIBS) -o $(JAVALIBPREFIX)$(TARGET)$(SO)
+
+java_multi_cpp: $(SRCS)
+ $(SWIG) -java -c++ $(SWIGOPT) $(INTERFACE)
+ $(CXX) -c $(CCSHARED) $(CFLAGS) $(SRCS) $(CXXSRCS) $(ICXXSRCS) $(INCLUDE) $(JAVA_INCLUDE)
+ $(CXXSHARED) $(OBJS) $(IOBJS) $(JAVA_DLNK) $(LIBS) $(CPP_DLLIBS) -o $(JAVALIBPREFIX)$(TARGET)$(SO)
+
+# -----------------------------------------------------------------
+# Cleaning the java examples
+# -----------------------------------------------------------------
+
+java_clean:
+ mv main.java main.java.tmp
+ rm -f *_wrap* *.o core *~ *$(SO) *.class *.java
+ mv main.java.tmp main.java
+
+##################################################################
+##### MZSCHEME ######
+##################################################################
+
+MZC = test -n "" &&
+
+# ----------------------------------------------------------------
+# Build a C/C++ dynamically loadable module
+# ----------------------------------------------------------------
+
+mzscheme: $(SRCS)
+ $(SWIG) -mzscheme $(SWIGOPT) $(INTERFACE)
+ $(MZC) ++ccf "$(INCLUDE)" --cc $(ISRCS) $(SRCS)
+ $(MZC) --ld $(TARGET)$(SO) $(OBJS) $(IOBJS)
+
+mzscheme_cpp: $(SRCS)
+ $(SWIG) -mzscheme -c++ $(SWIGOPT) $(INTERFACE)
+ $(MZC) ++ccf "$(INCLUDE)" --cc $(ICXXSRCS) $(SRCS) $(CXXSRCS)
+ $(MZC) --ld $(TARGET)$(SO) $(OBJS) $(IOBJS) $(CPP_DLLIBS)
+
+# ----------------------------------------------------------------
+# Build a dynamically loadable module, linked against SWIG runtime
+# ----------------------------------------------------------------
+
+MZSCHEME_RUNTIME=-L$(RUNTIMEDIR) -lswigmz
+
+mzscheme_multi: $(SRCS)
+ $(SWIG) -c -mzscheme $(SWIGOPT) $(INTERFACE)
+ $(MZC) ++ccf "$(INCLUDE)" --cc $(ISRCS) $(SRCS)
+ $(MZC) --ld $(TARGET)$(SO) $(OBJS) $(IOBJS) $(MZSCHEME_RUNTIME)
+
+mzscheme_multi_cpp: $(SRCS)
+ $(SWIG) -c -mzscheme -c++ $(SWIGOPT) $(INTERFACE)
+ $(MZC) ++ccf "$(INCLUDE)" --cc $(ICXXSRCS) $(SRCS) $(CXXSRCS)
+ $(MZC) --ld $(TARGET)$(SO) $(OBJS) $(IOBJS) $(MZSCHEME_RUNTIME) $(CPP_DLLIBS)
+
+##################################################################
+##### RUBY ######
+##################################################################
+
+# Make sure these locate your Ruby installation
+RUBY_CFLAGS= -DHAVE_CONFIG_H
+RUBY_INCLUDE= -I/usr/local/lib/ruby/1.4/arch
+RUBY_LIB = /usr/local/lib/ruby/1.4/arch
+RUBY_DLNK =
+
+# ----------------------------------------------------------------
+# Build a C dynamically loadable module
+# ----------------------------------------------------------------
+
+ruby: $(SRCS)
+ $(SWIG) -ruby $(SWIGOPT) $(INTERFACE)
+ $(CC) -c $(CCSHARED) $(CFLAGS) $(RUBY_CFLAGS) $(ISRCS) $(SRCS) $(INCLUDE) $(RUBY_INCLUDE)
+ $(LDSHARED) $(OBJS) $(IOBJS) $(RUBY_DLNK) $(LIBS) -o $(TARGET)$(SO)
+
+# -----------------------------------------------------------------
+# Build a C++ dynamically loadable module
+# -----------------------------------------------------------------
+
+ruby_cpp: $(SRCS)
+ $(SWIG) -c++ -ruby $(SWIGOPT) $(INTERFACE)
+ $(CXX) -c $(CCSHARED) $(CFLAGS) $(RUBY_CFLAGS) $(ICXXSRCS) $(SRCS) $(CXXSRCS) $(INCLUDE) $(RUBY_INCLUDE)
+ $(CXXSHARED) $(OBJS) $(IOBJS) $(RUBY_DLNK) $(LIBS) $(CPP_DLLIBS) -o $(TARGET)$(SO)
+
+# -----------------------------------------------------------------
+# Build a dynamically loadable module, linked against SWIG runtime lib
+# -----------------------------------------------------------------
+
+RUBY_RUNTIME=-L$(RUNTIMEDIR) -lswigrb
+
+ruby_multi: $(SRCS)
+ $(SWIG) -c -ruby $(SWIGOPT) $(INTERFACE)
+ $(CC) -c $(CCSHARED) $(CFLAGS) $(RUBY_CFLAGS) $(ISRCS) $(SRCS) $(INCLUDE) $(RUBY_INCLUDE)
+ $(LDSHARED) $(OBJS) $(IOBJS) $(RUBY_RUNTIME) $(RUBY_DLNK) $(LIBS) -o $(TARGET)$(SO)
+
+ruby_multi_cpp: $(SRCS)
+ $(SWIG) -c -c++ -ruby $(SWIGOPT) $(INTERFACE)
+ $(CXX) -c $(CCSHARED) $(CFLAGS) $(RUBY_CFLAGS) $(ICXXSRCS) $(SRCS) $(CXXSRCS) $(INCLUDE) $(RUBY_INCLUDE)
+ $(CXXSHARED) $(OBJS) $(IOBJS) $(RUBY_RUNTIME) $(RUBY_DLNK) $(LIBS) $(CPP_DLLIBS) -o $(TARGET)$(SO)
+
+# -----------------------------------------------------------------
+# Build statically linked Ruby interpreter
+#
+# These should only be used in conjunction with the %include embed.i
+# library file
+# -----------------------------------------------------------------
+
+RUBY_LIBOPTS = -lruby -lm -ldl $(SYSLIBS)
+
+ruby_static: $(SRCS)
+ $(SWIG) -ruby -lembed.i $(SWIGOPT) $(INTERFACE)
+ $(CC) $(CFLAGS) $(RUBY_CFLAGS) -Xlinker -export-dynamic $(ISRCS) $(SRCS) $(INCLUDE) \
+ $(RUBY_INCLUDE) $(LIBS) -L$(RUBY_LIB) $(RUBY_LIBOPTS) -o $(TARGET)
+
+ruby_cpp_static: $(SRCS)
+ $(SWIG) -c++ -ruby -lembed.i $(SWIGOPT) $(INTERFACE)
+ $(CXX) $(CFLAGS) $(RUBY_CFLAGS) $(ICXXSRCS) $(SRCS) $(CXXSRCS) $(INCLUDE) \
+ $(RUBY_INCLUDE) $(LIBS) -L$(RUBY_LIB) $(RUBY_LIBOPTS) -o $(TARGET)
+
+
+# -------------------------------------------------------------------
+# Build a PHP4 dynamically loadable module (C)
+# -------------------------------------------------------------------
+
+PHP4_INCLUDE =
+
+php4: $(SRCS)
+ $(SWIG) -php4 $(SWIGOPT) $(INTERFACE)
+ $(CC) -c $(CCSHARED) $(CFLAGS) $(SRCS) $(ISRCS) $(INCLUDE) $(PHP4_INCLUDE)
+ $(LDSHARED) $(OBJS) $(IOBJS) $(LIBS) -o $(TARGET)$(SO)
+
+# --------------------------------------------------------------------
+# Build a PHP4 dynamically loadable module (C++)
+# --------------------------------------------------------------------
+
+php4_cpp: $(SRCS)
+ $(SWIG) -php4 -c++ $(SWIGOPT) $(INTERFACE)
+ $(CXX) -c $(CCSHARED) $(CFLAGS) $(SRCS) $(CXXSRCS) $(ICXXSRCS) $(INCLUDE) $(PHP4_INCLUDE)
+ $(CXXSHARED) $(OBJS) $(IOBJS) $(LIBS) $(CPP_DLLIBS) -o $(TARGET)$(SO)
+
+# ---------------------------------------------------------------------
+# Build a dynamically loadable module, linked against SWIG Runtime lib
+# ---------------------------------------------------------------------
+
+PHP4_RUNTIME=-L$(RUNTIMEDIR) -lswigphp4
+
+php4_multi: $(SRCS)
+ $(SWIG) -c -php4 $(SWIGOPT) $(INTERFACE)
+ $(CC) -c $(CCSHARED) $(CFLAGS) $(ISRCS) $(SRCS) $(INCLUDE) $(PHP4_INCLUDE)
+ $(LDSHARED) $(OBJS) $(IOBJS) $(PHP4_RUNTIME) $(PHP4_DLNK) $(LIBS) -o $(TARGET)module$(SO)
+
+php4_multi_cpp: $(SRCS)
+ $(SWIG) -c -c++ -php4 $(SWIGOPT) $(INTERFACE)
+ $(CXX) -c $(CCSHARED) $(CFLAGS) $(ICXXSRCS) $(SRCS) $(CXXSRCS) $(INCLUDE) $(PHP4_INCLUDE)
+ $(CXXSHARED) $(OBJS) $(IOBJS) $(PHP4_RUNTIME) $(PHP4_DLNK) $(LIBS) $(CPP_DLLIBS) -o $(TARGET)module$(SO)
diff --git a/bindings/swig/listkey.i b/bindings/swig/listkey.i
new file mode 100644
index 0000000..945621f
--- /dev/null
+++ b/bindings/swig/listkey.i
@@ -0,0 +1,91 @@
+%{
+#include "listkey.h"
+%}
+
+class ListKey : public SWKey {
+public:
+ /** initializes instance of ListKey
+ *
+ * @param ikey text key
+ */
+ ListKey (const char *ikey = 0);
+ ListKey (ListKey const &k);
+
+ /** Cleans up instance of ListKey
+ */
+ virtual ~ ListKey ();
+
+ virtual SWKey *clone () const;
+
+ /** Clears out elements of list
+ */
+ virtual void ClearList ();
+
+ /** Returns number of elements in list
+ * @return number of elements in list
+ */
+ virtual int Count ();
+
+ /** Removes current element from list
+ */
+ virtual void Remove ();
+
+ /** Sets key to element number
+ *
+ * @param ielement element number to set to
+ * @return error status
+ */
+ //virtual char SetToElement (int ielement, SW_POSITION = TOP);
+%extend {
+ virtual char SetToElement(int element) {
+ self->SetToElement(element, TOP);
+ };
+}
+
+ /** Gets a key element number
+ *
+ * @param pos element number to get (or default current)
+ * @return Key or null on error
+ */
+ virtual SWKey* GetElement (int pos = -1);
+
+ /** Adds an element to the list
+ * @param ikey the element to add
+ */
+ //ListKey & operator << (const SWKey &ikey);
+ virtual void add(const SWKey &ikey);
+
+ /** Equates this ListKey to another ListKey object
+ *
+ * @param ikey other ListKey object
+ */
+ virtual void copyFrom(const ListKey & ikey);
+ //virtual void copyFrom(const SWKey & ikey) { SWKey::copyFrom(ikey); }
+
+ /** Positions this key
+ *
+ * @param p position
+ * @return *this
+ */
+ virtual void setPosition(SW_POSITION);
+
+ /** Decrements a number of elements
+ */
+ virtual void decrement(int step);
+
+ /** Increments a number of elements
+ */
+ virtual void increment(int step);
+
+ virtual char Traversable ();
+ virtual long Index () const;
+
+ /**
+ * Returns the index for the new one given as as parameter.
+ * The first parameter is the new index.
+ */
+ virtual long Index (long index);
+
+ //SWKEY_OPERATORS
+ //ListKey & operator =(const ListKey &key) { copyFrom(key); return *this; }
+};
diff --git a/bindings/swig/localemgr.i b/bindings/swig/localemgr.i
new file mode 100644
index 0000000..2b38350
--- /dev/null
+++ b/bindings/swig/localemgr.i
@@ -0,0 +1,22 @@
+%{
+#include <localemgr.h>
+%}
+
+typedef map < string, SWLocale *, less < string > >LocaleMap;
+
+class LocaleMgr {
+public:
+ LocaleMgr (const char *iConfigPath = 0);
+ virtual ~LocaleMgr ();
+ virtual SWLocale *getLocale (const char *name);
+ virtual list < string > getAvailableLocales ();
+ //virtual const char *translate (const char *name, const char *text);
+ virtual const char *getDefaultLocaleName();
+ virtual void setDefaultLocaleName (const char *name);
+
+%extend {
+ static LocaleMgr* const systemLocaleMgr() {
+ return &(LocaleMgr::systemLocaleMgr);
+ };
+}
+};
diff --git a/bindings/swig/lzsscompress.i b/bindings/swig/lzsscompress.i
new file mode 100644
index 0000000..5b6373c
--- /dev/null
+++ b/bindings/swig/lzsscompress.i
@@ -0,0 +1,11 @@
+%{
+ #include <lzsscomprs.h>
+%}
+
+class LZSSCompress : public SWCompress {
+public:
+ LZSSCompress ();
+ virtual ~ LZSSCompress ();
+ virtual void Encode (void);
+ virtual void Decode (void);
+}; \ No newline at end of file
diff --git a/bindings/swig/rawcom.i b/bindings/swig/rawcom.i
new file mode 100644
index 0000000..d158c86
--- /dev/null
+++ b/bindings/swig/rawcom.i
@@ -0,0 +1,13 @@
+%{
+ #include "rawcom.h"
+%}
+
+class RawCom : public SWCom {
+ RawCom (const char *ipath, const char *iname = 0, const char *idesc = 0,
+ SWDisplay * idisp = 0, SWTextEncoding encoding = ENC_UNKNOWN, SWTextDirection dir = DIRECTION_LTR, SWTextMarkup markup = FMT_UNKNOWN,
+ const char* ilang = 0);
+ virtual ~ RawCom ();
+
+ static char createModule (const char *path);
+};
+
diff --git a/bindings/swig/rawgenbook.i b/bindings/swig/rawgenbook.i
new file mode 100644
index 0000000..fa51e40
--- /dev/null
+++ b/bindings/swig/rawgenbook.i
@@ -0,0 +1,13 @@
+%{
+ #include "rawgenbook.h"
+%}
+
+class RawGenBook : public SWGenBook {
+public:
+ RawGenBook (const char *ipath, const char *iname = 0, const char *idesc = 0, SWDisplay * idisp = 0, SWTextEncoding encoding = ENC_UNKNOWN, SWTextDirection dir = DIRECTION_LTR, SWTextMarkup markup = FMT_UNKNOWN, const char* ilang = 0);
+ virtual ~ RawGenBook ();
+
+ static char createModule (const char *ipath);
+};
+
+
diff --git a/bindings/swig/rawld.i b/bindings/swig/rawld.i
new file mode 100644
index 0000000..86c2066
--- /dev/null
+++ b/bindings/swig/rawld.i
@@ -0,0 +1,12 @@
+%{
+ #include "rawld.h"
+%}
+
+class RawLD : public SWLD {
+public:
+ RawLD (const char *ipath, const char *iname = 0, const char *idesc = 0, SWDisplay * idisp = 0, SWTextEncoding encoding = ENC_UNKNOWN, SWTextDirection dir = DIRECTION_LTR, SWTextMarkup markup = FMT_UNKNOWN, const char* ilang = 0);
+ virtual ~RawLD ();
+
+ static char createModule (const char *path);
+};
+
diff --git a/bindings/swig/rawld4.i b/bindings/swig/rawld4.i
new file mode 100644
index 0000000..c09568e
--- /dev/null
+++ b/bindings/swig/rawld4.i
@@ -0,0 +1,12 @@
+%{
+ #include "rawld4.h"
+%}
+
+class RawLD4 : public SWLD {
+public:
+ RawLD4(const char *ipath, const char *iname = 0, const char *idesc = 0, SWDisplay * idisp = 0, SWTextEncoding encoding = ENC_UNKNOWN, SWTextDirection dir = DIRECTION_LTR, SWTextMarkup markup = FMT_UNKNOWN, const char* ilang = 0);
+ virtual ~RawLD4();
+
+ static char createModule (const char *path);
+};
+
diff --git a/bindings/swig/rawtext.i b/bindings/swig/rawtext.i
new file mode 100644
index 0000000..099af8d
--- /dev/null
+++ b/bindings/swig/rawtext.i
@@ -0,0 +1,11 @@
+%{
+ #include "rawtext.h"
+%}
+
+class RawText : public SWText {
+public:
+ RawText (const char *ipath, const char *iname = 0, const char *idesc = 0, SWDisplay * idisp = 0, SWTextEncoding encoding = ENC_UNKNOWN, SWTextDirection dir = DIRECTION_LTR, SWTextMarkup markup = FMT_UNKNOWN, const char* ilang = 0);
+
+ static char createModule (const char *path) { return RawVerse::createModule (path); }
+};
+
diff --git a/bindings/swig/swcom.i b/bindings/swig/swcom.i
new file mode 100644
index 0000000..6305209
--- /dev/null
+++ b/bindings/swig/swcom.i
@@ -0,0 +1,9 @@
+%{
+ #include "swcom.h"
+%}
+
+class SWCom : public SWModule {
+ SWCom(const char *imodname = 0, const char *imoddesc = 0, SWDisplay * idisp = 0, SWTextEncoding enc = ENC_UNKNOWN, SWTextDirection dir = DIRECTION_LTR, SWTextMarkup mark = FMT_UNKNOWN, const char* ilang = 0);
+ virtual ~SWCom();
+};
+
diff --git a/bindings/swig/swcompress.i b/bindings/swig/swcompress.i
new file mode 100644
index 0000000..79ccd7f
--- /dev/null
+++ b/bindings/swig/swcompress.i
@@ -0,0 +1,16 @@
+%{
+ #include <swcomprs.h>
+%}
+
+class SWCompress {
+public:
+ SWCompress();
+ virtual ~SWCompress();
+
+ virtual char *Buf (const char *buf = 0, unsigned long *len = 0);
+ virtual char *zBuf (unsigned long *len, char *buf = 0);
+ virtual unsigned long GetChars (char *buf, unsigned long len);
+ virtual unsigned long SendChars (char *buf, unsigned long len);
+ virtual void Encode (void);
+ virtual void Decode (void);
+};
diff --git a/bindings/swig/swconfig.i b/bindings/swig/swconfig.i
new file mode 100644
index 0000000..a934ffc
--- /dev/null
+++ b/bindings/swig/swconfig.i
@@ -0,0 +1,42 @@
+%{
+ #include <stdio.h>
+ #include <string>
+ #include <map>
+ #include <defs.h>
+ #include <multimapwdef.h>
+
+ #include "swconfig.h"
+%}
+
+%include "stl.i"
+%include "std_vector.i"
+%include "std_string.i"
+%include "typemaps.i"
+
+
+typedef multimapwithdefault < string, string, less < string > > ConfigEntMap;
+typedef map < string, ConfigEntMap, less < string > > SectionMap;
+
+class SWConfig {
+public:
+ //member data
+ string filename;
+ SectionMap Sections;
+
+ //member functions
+ SWConfig(const char *ifilename);
+ virtual ~ SWConfig();
+
+ virtual void Load();
+ virtual void Save();
+
+%extend {
+ void set(const char* group, const char* entry, const char* value) {
+ self->Sections[group][entry] = value;
+ };
+ const char* get(const char* group, const char* entry) {
+ return self->Sections[group][entry].c_str();
+ };
+}
+
+};
diff --git a/bindings/swig/swfiltermgr.i b/bindings/swig/swfiltermgr.i
new file mode 100644
index 0000000..6ec3d76
--- /dev/null
+++ b/bindings/swig/swfiltermgr.i
@@ -0,0 +1,21 @@
+%{
+#include <swfiltermgr.h>
+%}
+
+class SWFilterMgr {
+ SWFilterMgr ();
+ virtual ~SWFilterMgr ();
+
+ virtual void setParentMgr(SWMgr *parentMgr);
+ virtual SWMgr *getParentMgr();
+ virtual void AddGlobalOptions (SWModule * module, ConfigEntMap & section,
+ ConfigEntMap::iterator start,
+ ConfigEntMap::iterator end);
+ virtual void AddLocalOptions (SWModule * module, ConfigEntMap & section,
+ ConfigEntMap::iterator start,
+ ConfigEntMap::iterator end);
+ virtual void AddEncodingFilters (SWModule * module, ConfigEntMap & section);
+ virtual void AddRenderFilters (SWModule * module, ConfigEntMap & section);
+ virtual void AddStripFilters (SWModule * module, ConfigEntMap & section);
+ virtual void AddRawFilters (SWModule * module, ConfigEntMap & section);
+}; \ No newline at end of file
diff --git a/bindings/swig/swgenbook.i b/bindings/swig/swgenbook.i
new file mode 100644
index 0000000..fdf1b81
--- /dev/null
+++ b/bindings/swig/swgenbook.i
@@ -0,0 +1,10 @@
+%{
+ #include "swgenbook.h"
+%}
+
+class SWGenBook : public SWModule {
+protected:
+ SWGenBook(const char *imodname = 0, const char *imoddesc = 0, SWDisplay * idisp = 0, SWTextEncoding encoding = ENC_UNKNOWN, SWTextDirection dir = DIRECTION_LTR, SWTextMarkup markup = FMT_UNKNOWN, const char* ilang = 0);
+ virtual ~SWGenBook();
+};
+
diff --git a/bindings/swig/swig-perl.doxygen b/bindings/swig/swig-perl.doxygen
new file mode 100644
index 0000000..2c2b650
--- /dev/null
+++ b/bindings/swig/swig-perl.doxygen
@@ -0,0 +1,177 @@
+# Doxyfile 0.1
+
+#---------------------------------------------------------------------------
+# General configuration options
+#---------------------------------------------------------------------------
+PROJECT_NAME = SWIG-Perl
+PROJECT_NUMBER = 0.1
+OUTPUT_DIRECTORY = .
+OUTPUT_LANGUAGE = English
+EXTRACT_ALL = YES
+EXTRACT_PRIVATE = NO
+EXTRACT_STATIC = YES
+EXTRACT_LOCAL_CLASSES = YES
+HIDE_UNDOC_MEMBERS = NO
+HIDE_UNDOC_CLASSES = NO
+BRIEF_MEMBER_DESC = YES
+REPEAT_BRIEF = YES
+ALWAYS_DETAILED_SEC = NO
+INLINE_INHERITED_MEMB = NO
+FULL_PATH_NAMES = NO
+STRIP_FROM_PATH =
+INTERNAL_DOCS = NO
+STRIP_CODE_COMMENTS = YES
+CASE_SENSE_NAMES = YES
+SHORT_NAMES = NO
+HIDE_SCOPE_NAMES = NO
+VERBATIM_HEADERS = YES
+SHOW_INCLUDE_FILES = YES
+JAVADOC_AUTOBRIEF = NO
+INHERIT_DOCS = YES
+INLINE_INFO = YES
+SORT_MEMBER_DOCS = YES
+DISTRIBUTE_GROUP_DOC = NO
+TAB_SIZE = 8
+GENERATE_TODOLIST = YES
+GENERATE_TESTLIST = YES
+GENERATE_BUGLIST = YES
+ALIASES =
+ENABLED_SECTIONS =
+MAX_INITIALIZER_LINES = 30
+OPTIMIZE_OUTPUT_FOR_C = NO
+SHOW_USED_FILES = YES
+#---------------------------------------------------------------------------
+# configuration options related to warning and progress messages
+#---------------------------------------------------------------------------
+QUIET = NO
+WARNINGS = YES
+WARN_IF_UNDOCUMENTED = YES
+WARN_FORMAT = "$file:$line: $text"
+WARN_LOGFILE =
+#---------------------------------------------------------------------------
+# configuration options related to the input files
+#---------------------------------------------------------------------------
+INPUT =
+FILE_PATTERNS = *.i
+RECURSIVE = NO
+EXCLUDE =
+EXCLUDE_PATTERNS =
+EXAMPLE_PATH =
+EXAMPLE_PATTERNS =
+EXAMPLE_RECURSIVE = NO
+IMAGE_PATH =
+INPUT_FILTER =
+FILTER_SOURCE_FILES = NO
+#---------------------------------------------------------------------------
+# configuration options related to source browsing
+#---------------------------------------------------------------------------
+SOURCE_BROWSER = NO
+INLINE_SOURCES = NO
+REFERENCED_BY_RELATION = YES
+REFERENCES_RELATION = YES
+#---------------------------------------------------------------------------
+# configuration options related to the alphabetical class index
+#---------------------------------------------------------------------------
+ALPHABETICAL_INDEX = YES
+COLS_IN_ALPHA_INDEX = 5
+IGNORE_PREFIX =
+#---------------------------------------------------------------------------
+# configuration options related to the HTML output
+#---------------------------------------------------------------------------
+GENERATE_HTML = YES
+HTML_OUTPUT = api-documentation
+HTML_HEADER =
+HTML_FOOTER =
+HTML_STYLESHEET =
+HTML_ALIGN_MEMBERS = YES
+GENERATE_HTMLHELP = NO
+GENERATE_CHI = NO
+BINARY_TOC = NO
+TOC_EXPAND = NO
+DISABLE_INDEX = NO
+ENUM_VALUES_PER_LINE = 4
+GENERATE_TREEVIEW = NO
+TREEVIEW_WIDTH = 250
+#---------------------------------------------------------------------------
+# configuration options related to the LaTeX output
+#---------------------------------------------------------------------------
+GENERATE_LATEX = NO
+LATEX_OUTPUT = latex
+COMPACT_LATEX = NO
+PAPER_TYPE = a4wide
+EXTRA_PACKAGES =
+LATEX_HEADER =
+PDF_HYPERLINKS = NO
+USE_PDFLATEX = NO
+LATEX_BATCHMODE = NO
+#---------------------------------------------------------------------------
+# configuration options related to the RTF output
+#---------------------------------------------------------------------------
+GENERATE_RTF = NO
+RTF_OUTPUT = rtf
+COMPACT_RTF = NO
+RTF_HYPERLINKS = NO
+RTF_STYLESHEET_FILE =
+RTF_EXTENSIONS_FILE =
+#---------------------------------------------------------------------------
+# configuration options related to the man page output
+#---------------------------------------------------------------------------
+GENERATE_MAN = NO
+MAN_OUTPUT = man
+MAN_EXTENSION = .3
+MAN_LINKS = NO
+#---------------------------------------------------------------------------
+# configuration options related to the XML output
+#---------------------------------------------------------------------------
+GENERATE_XML = NO
+#---------------------------------------------------------------------------
+# configuration options for the AutoGen Definitions output
+#---------------------------------------------------------------------------
+GENERATE_AUTOGEN_DEF = NO
+#---------------------------------------------------------------------------
+# Configuration options related to the preprocessor
+#---------------------------------------------------------------------------
+ENABLE_PREPROCESSING = YES
+MACRO_EXPANSION = NO
+EXPAND_ONLY_PREDEF = NO
+SEARCH_INCLUDES = YES
+INCLUDE_PATH =
+INCLUDE_FILE_PATTERNS =
+PREDEFINED =
+EXPAND_AS_DEFINED =
+SKIP_FUNCTION_MACROS = YES
+#---------------------------------------------------------------------------
+# Configuration::addtions related to external references
+#---------------------------------------------------------------------------
+TAGFILES =
+GENERATE_TAGFILE =
+ALLEXTERNALS = NO
+PERL_PATH = /usr/bin/perl
+#---------------------------------------------------------------------------
+# Configuration options related to the dot tool
+#---------------------------------------------------------------------------
+CLASS_DIAGRAMS = YES
+HAVE_DOT = NO
+CLASS_GRAPH = YES
+COLLABORATION_GRAPH = YES
+TEMPLATE_RELATIONS = YES
+HIDE_UNDOC_RELATIONS = YES
+INCLUDE_GRAPH = YES
+INCLUDED_BY_GRAPH = YES
+GRAPHICAL_HIERARCHY = YES
+DOT_PATH =
+DOTFILE_DIRS =
+MAX_DOT_GRAPH_WIDTH = 1024
+MAX_DOT_GRAPH_HEIGHT = 1024
+GENERATE_LEGEND = YES
+DOT_CLEANUP = YES
+#---------------------------------------------------------------------------
+# Configuration::addtions related to the search engine
+#---------------------------------------------------------------------------
+SEARCHENGINE = NO
+CGI_NAME = search.cgi
+CGI_URL =
+DOC_URL =
+DOC_ABSPATH =
+BIN_ABSPATH = /usr/local/bin/
+EXT_DOC_PATHS =
diff --git a/bindings/swig/swkey.i b/bindings/swig/swkey.i
new file mode 100644
index 0000000..1d12ce4
--- /dev/null
+++ b/bindings/swig/swkey.i
@@ -0,0 +1,69 @@
+%{
+ #include "swkey.h"
+%}
+
+class SW_POSITION {
+public:
+ SW_POSITION(char ipos);
+};
+
+#define POS_TOP ((char)1)
+#define POS_BOTTOM ((char)2)
+
+#define TOP SW_POSITION(POS_TOP)
+#define BOTTOM SW_POSITION(POS_BOTTOM)
+
+
+/**
+* The SWKey class for the SWIG-Perl interface.
+*/
+class SWKey {
+public:
+ SWKey(const char *ikey = 0);
+ //SWKey(SWKey const &k);
+ virtual SWKey *clone () const;
+
+ char Persist() const;
+
+%extend {
+
+ void setPersist(signed char persists) {
+ self->Persist(persists);
+ };
+
+}
+ virtual char Error ();
+
+ virtual void setText(const char *ikey);
+ virtual const char *getText() const;
+ virtual const char *getShortText() const;
+
+ virtual int compare (const SWKey & ikey);
+ virtual bool equals(const SWKey &ikey);
+ //virtual void setPosition(SW_POSITION);
+
+ virtual void decrement(int steps = 1);
+ virtual void increment(int steps = 1);
+ virtual char Traversable ();
+
+ virtual long Index() const;
+ //virtual long Index(long iindex);
+
+%extend {
+
+ /**
+ * Goes to the next key. Only useful for VerseKeys at the moment.
+ */
+ void next() {
+ (*self)++;
+ };
+ void prev() {
+ (*self)++;
+ };
+ void setKey(const SWKey* key) {
+ self->copyFrom(*key);
+ };
+
+}
+
+};
diff --git a/bindings/swig/swld.i b/bindings/swig/swld.i
new file mode 100644
index 0000000..698e147
--- /dev/null
+++ b/bindings/swig/swld.i
@@ -0,0 +1,10 @@
+%{
+ #include "swld.h"
+%}
+
+class SWLD : public SWModule {
+public:
+ SWLD (const char *imodname = 0, const char *imoddesc = 0, SWDisplay * idisp = 0, SWTextEncoding encoding = ENC_UNKNOWN, SWTextDirection dir = DIRECTION_LTR, SWTextMarkup markup = FMT_UNKNOWN, const char* ilang = 0);
+ virtual ~ SWLD ();
+};
+
diff --git a/bindings/swig/swmgr.i b/bindings/swig/swmgr.i
new file mode 100644
index 0000000..a50c8fe
--- /dev/null
+++ b/bindings/swig/swmgr.i
@@ -0,0 +1,41 @@
+%{
+#include <swmgr.h>
+%}
+
+typedef map < string, SWModule *, less < string > > ModMap;
+typedef list < string > OptionsList;
+typedef map < string, SWFilter * > FilterMap;
+
+class SWMgr {
+public:
+//member data
+ static bool debug;
+ static const char *globalConfPath;
+ static void findConfig (char *configType, char **prefixPath, char **configPath);
+
+ SWConfig *config;
+ SWConfig *sysconfig;
+ ModMap Modules;
+ char *prefixPath;
+ char *configPath;
+
+//member functions
+ SWMgr (SWConfig* iconfig = 0, SWConfig* isysconfig = 0, bool autoload = true, SWFilterMgr* filterMgr = 0);
+// SWMgr (SWFilterMgr *filterMgr);
+// SWMgr (const char *iConfigPath, bool autoload = true, SWFilterMgr *filterMgr = 0);
+ virtual ~SWMgr();
+
+ virtual signed char Load ();
+ virtual void setGlobalOption (const char *option, const char *value);
+ virtual const char *getGlobalOption (const char *option);
+ virtual const char *getGlobalOptionTip (const char *option);
+ virtual OptionsList getGlobalOptions ();
+ virtual OptionsList getGlobalOptionValues (const char *option);
+ virtual signed char setCipherKey (const char *modName, const char *key);
+
+%extend {
+ SWModule* module(const char* modulename) {
+ return self->Modules[modulename];
+ };
+}
+};
diff --git a/bindings/swig/swmodule.i b/bindings/swig/swmodule.i
new file mode 100644
index 0000000..f65fd1b
--- /dev/null
+++ b/bindings/swig/swmodule.i
@@ -0,0 +1,99 @@
+%{
+ #include "swmodule.h"
+%}
+
+class SWModule {
+public:
+ bool terminateSearch;
+
+ SWModule (const char *imodname = 0, const char *imoddesc = 0, SWDisplay * idisp = 0, char *imodtype = 0, SWTextEncoding encoding = ENC_UNKNOWN, SWTextDirection dir = DIRECTION_LTR, SWTextMarkup markup = FMT_UNKNOWN, const char* modlang = 0);
+ virtual char Error();
+ virtual const bool isUnicode() const;
+ virtual const ConfigEntMap& getConfig() const;
+ virtual const char *getConfigEntry(const char *key) const;
+
+ virtual char SetKey (const SWKey *ikey);
+ virtual SWKey& Key() const;
+ virtual SWKey *CreateKey ();
+ virtual const char* KeyText(const char *imodtype = 0);
+ virtual char Display();
+
+//Search functions
+ static void nullPercent (char percent, void *userData);
+ virtual ListKey & Search (const char *istr, int searchType = 0, int flags = 0, SWKey * scope = 0, bool * justCheckIfSupported = 0, void (*percent) (char, void *) = &nullPercent, void *percentUserData = 0);
+ virtual signed char createSearchFramework();
+ virtual bool hasSearchFramework();
+ virtual bool isSearchOptimallySupported (const char *istr, int searchType, int flags, SWKey * scope);
+
+//navigation functions
+%extend {
+ const bool next() {
+ (*self)++;
+ return !self->Error();
+ };
+ const bool prev() {
+ (*self)--;
+ return !self->Error();
+ };
+ const bool inc(const int howFar) {
+ (*self)+=howFar;
+ return !self->Error();
+ };
+ const bool dec(const int howFar) {
+ (*self)-=howFar;
+ return !self->Error();
+ };
+ void setPosition(SW_POSITION pos) {
+ (*self) = pos;
+ };
+ void top() {
+ (*self) = TOP;
+ };
+ void bottom() {
+ (*self) = BOTTOM;
+ };
+}
+
+//data functions
+%extend {
+ const char* text() {
+ return (const char*)*self;
+ };
+ const char* StripText() {
+ return self->StripText();
+ };
+}
+
+ virtual char *getRawEntry();
+
+ virtual void setSkipConsecutiveLinks(bool val);
+ virtual bool getSkipConsecutiveLinks();
+ virtual AttributeTypeList &getEntryAttributes() const;
+ virtual void processEntryAttributes(bool val) const;
+ virtual bool isProcessEntryAttributes() const;
+
+//module info functions
+ virtual char* Name (const char *imodname = 0);
+ virtual char* Description (const char *imoddesc = 0);
+ virtual char* Type (const char *imodtype = 0);
+ virtual char Direction(signed char newdir = -1);
+ virtual char Encoding(signed char enc = -1);
+ virtual char Markup(signed char enc = -1);
+ virtual char* Lang (const char *imodlang = 0);
+
+//write interface
+ virtual bool isWritable ();
+ static signed char createModule (const char *);
+ virtual SWModule& setentry (const char *inbuf, long len);
+ virtual void deleteEntry ();
+
+%extend {
+ void write(const char* text) {
+ (*self)<<text;
+ };
+
+ void writeLink(const SWKey* key) {
+ (*self)<<key;
+ };
+}
+};
diff --git a/bindings/swig/sword.i b/bindings/swig/sword.i
new file mode 100644
index 0000000..1ae1f8a
--- /dev/null
+++ b/bindings/swig/sword.i
@@ -0,0 +1,50 @@
+/** @mainpage
+* This is the API documentation of the SWIG interface to Sword!<BR>
+* The interface contains the most useful classes of Sword to read, navigate and create/write modules. The SWIG intreface is interesting
+* for all who want to write Perl/PHP/Phyton/Ruby/TCL/Java code using the Sword library.<BR>
+* My aim is to support all who do so much work for the Sword project (Troy, Chris and all the others) and to make their work more easy with the SWIG interface.
+* The interface tries to use the function names of the Sword C++ API, but since operators are not (yet) supported in SWIG there are some additions to the functions, the operators can't be used.<BR>
+* Here are the basic classes you should know of:
+* @ref SWMgr, SWModule, SWKey, VerseKey and SWConfig.
+*/
+
+%module sword
+%{
+#undef bool
+#undef assert
+#undef LOCAL
+#undef list
+%}
+
+%include "swconfig.i"
+%include "swmgr.i"
+%include "swmodule.i"
+
+%include "swkey.i"
+%include "versekey.i"
+%include "listkey.i"
+%include "treekey.i"
+%include "treekeyidx.i"
+
+%include "localemgr.i"
+%include "swfiltermgr.i"
+
+%include "swtext.i"
+%include "rawtext.i"
+%include "ztext.i"
+
+%include "swcom.i"
+%include "rawcom.i"
+%include "zcom.i"
+
+%include "swgenbook.i"
+%include "rawgenbook.i"
+
+%include "swld.i"
+%include "rawld.i"
+%include "rawld4.i"
+%include "zld.i"
+
+%include "swcompress.i"
+%include "lzsscompress.i"
+%include "zipcompress.i"
diff --git a/bindings/swig/sword.pl b/bindings/swig/sword.pl
new file mode 100644
index 0000000..969424d
--- /dev/null
+++ b/bindings/swig/sword.pl
@@ -0,0 +1,101 @@
+#!/usr/bin/perl
+
+use sword;
+
+print "Version (should be 1.0): " , $sword::VERSION , "\n";
+
+print "Create SWConfig object!\n";
+$config = new sword::SWConfig("test.conf");
+
+print "Load\n";
+$config->Load();
+
+print "Set value ... ";
+print $config->set("Group", "Entry", "Value");
+print " finished \n";
+
+print "Get value ... ";
+print $config->get("Group", "Entry");
+print " finished \n";
+
+$config->Save();
+
+#testing SWMgr
+$localemgr = sword::LocaleMgr::systemLocaleMgr();
+$localemgr->setDefaultLocaleName("de");
+
+$mgr = new sword::SWMgr();
+$module = $mgr->module("GerLut1545-temp");
+print "Printing WEB Module information: \n";
+print "Name:\t", $module->Name(),"\nDescription:\t", $module->Description(), "\nLang:\t", $module->Lang(), "\n";
+
+$key = new sword::VerseKey("Matthew 3:16");
+$key->setPersist(1);
+$module->SetKey($key);
+
+for ($i = 0; $i < 15; $i++) {
+ print "(", $module->KeyText() ,")\t", $module->StripText(), "\n";
+ $key->next();
+}
+$key->increment(103);
+print "(", $module->KeyText() ,")\t", $module->StripText(), "\n";
+
+#testing write interface
+$key->setText("John 3:16");
+#$module->SetKey($key);
+$module->write("This is a test entry! This tests the write abilities of the Sword Perl classes");
+print "(", $module->KeyText() ,")\t", $module->StripText(), "\n";
+
+print "Seraching for God: ";
+$list = $module->Search("Gott");
+print $list->Count(), " entries found!\n";
+#for ( $i = 0; $i < $list->Count(); $i++) {
+# print "(", $i, ")\t", $list->GetElement()->getText(), "\n";
+# $list->next();
+#}
+
+print "Creating new module! Writing search result...";
+#sword::RawText::createModule("/usr/share/sword/modules/texts/ztext/testmodule/");
+#$newmod = new sword::RawText("/usr/share/sword/modules/texts/ztext/testmodule/");
+
+#$key->setText("Genesis 1:1");
+$newkey = $key->clone();
+#$newmod->SetKey($newkey);
+#
+#for ($i = 0; $i < $list->Count(); $i++, $list->next()) {
+# $key->setText($list->GetElement()->getText());
+# $newkey->setText($list->GetElement()->getText());
+#
+# $newmod->write( $module->StripText() );
+#}
+
+print "Now create the LD module\n";
+
+ mkdir("ldmod");
+sword::zText::createModule("ldmod/",4);
+
+print "first step}\n";
+
+$newmod = new sword::zText("ldmod/");
+
+print "Created module;\n";
+
+$newkey = $newmod->CreateKey();
+$newkey->setPersist(1);
+$newkey->setText(" ");
+$module->SetKey($newkey);
+
+print "Loop! \n";
+
+for ($i = 0; $i < $list->Count(); $i++) {
+ print $list->GetElement()->getText() . "\n";
+
+ $key->setText($list->GetElement()->getText());
+ $newkey->setText($list->GetElement()->getText());
+
+ $newmod->SetKey($newkey);
+
+ $newmod->write( $module->StripText() );
+ $list->next();
+}
+
diff --git a/bindings/swig/swposition.i b/bindings/swig/swposition.i
new file mode 100644
index 0000000..4f1c35a
--- /dev/null
+++ b/bindings/swig/swposition.i
@@ -0,0 +1,14 @@
+%{
+ #include "swkey.h"
+%}
+
+class SW_POSITION {
+public:
+ SW_POSITION(char ipos);
+};
+
+%define POS_TOP ((char)1)
+%define POS_BOTTOM ((char)2)
+
+%define TOP SW_POSITION(POS_TOP)
+%define BOTTOM SW_POSITION(POS_BOTTOM)
diff --git a/bindings/swig/swtext.i b/bindings/swig/swtext.i
new file mode 100644
index 0000000..a5cb031
--- /dev/null
+++ b/bindings/swig/swtext.i
@@ -0,0 +1,10 @@
+%{
+ #include "swtext.h"
+%}
+
+class SWText : public SWModule {
+public:
+ SWText (const char *imodname = 0, const char *imoddesc = 0, SWDisplay * idisp = 0, SWTextEncoding encoding = ENC_UNKNOWN, SWTextDirection dir = DIRECTION_LTR, SWTextMarkup markup = FMT_UNKNOWN, const char* ilang = 0);
+ virtual ~ SWText ();
+};
+
diff --git a/bindings/swig/treekey.i b/bindings/swig/treekey.i
new file mode 100644
index 0000000..77fc2d7
--- /dev/null
+++ b/bindings/swig/treekey.i
@@ -0,0 +1,47 @@
+%{
+#include "treekey.h"
+%}
+
+class TreeKey : public SWKey {
+protected:
+ TreeKey();
+ ~TreeKey();
+
+public:
+
+ virtual const char *getLocalName() = 0;
+ virtual const char *setLocalName(const char *) = 0;
+
+ virtual const char *getUserData(int *size = 0) = 0;
+ virtual void setUserData(const char *userData, int size = 0) = 0;
+
+ virtual const char *getFullName() const = 0;
+
+ virtual void root() = 0;
+ virtual bool parent() = 0;
+
+ virtual bool firstChild() = 0;
+ virtual bool nextSibling() = 0;
+ virtual bool previousSibling() = 0;
+
+ virtual bool hasChildren() = 0;
+
+ virtual void append() = 0;
+ virtual void appendChild() = 0;
+ virtual void insertBefore() = 0;
+
+ virtual void remove() = 0;
+
+ virtual void setOffset(unsigned long offset) = 0;
+ virtual unsigned long getOffset() const = 0;
+
+ //virtual void setText(const char *ikey) = 0;
+ virtual void setPosition(SW_POSITION p) = 0;
+ //virtual const char *getText() const = 0;
+ //virtual int compare(const SWKey &ikey) = 0;
+ //virtual void decrement(int steps = 1) = 0;
+ //virtual void increment(int steps = 1) = 0;
+ virtual char Traversable ();
+ virtual long Index () const;
+ //virtual long Index (long iindex);
+}; \ No newline at end of file
diff --git a/bindings/swig/treekeyidx.i b/bindings/swig/treekeyidx.i
new file mode 100644
index 0000000..bf06217
--- /dev/null
+++ b/bindings/swig/treekeyidx.i
@@ -0,0 +1,53 @@
+%{
+#include "treekeyidx.h"
+%}
+
+class TreeKeyIdx : public TreeKey {
+ TreeKeyIdx(const TreeKeyIdx &ikey);
+ TreeKeyIdx (const char *idxPath, int fileMode = -1);
+ ~TreeKeyIdx ();
+
+// virtual const char *getLocalName();
+// virtual const char *setLocalName(const char *);
+
+// virtual const char *getUserData(int *size = 0);
+// virtual void setUserData(const char *userData, int size = 0);
+
+// virtual const char *getFullName() const;
+
+// virtual void root();
+// virtual bool parent();
+
+// virtual bool firstChild();
+// virtual bool nextSibling();
+// virtual bool previousSibling();
+
+// virtual bool hasChildren();
+
+// virtual void append();
+// virtual void appendChild();
+// virtual void insertBefore();
+
+// virtual void remove();
+ virtual void save();
+
+ virtual void copyFrom(const TreeKeyIdx &ikey);
+// virtual void copyFrom(const SWKey & ikey);
+
+// virtual SWKey &operator = (const TreeKeyIdx &ikey) { copyFrom(ikey); return *this; }
+// void setOffset(unsigned long offset);
+// unsigned long getOffset() const;
+
+// SWKEY_OPERATORS
+
+// virtual void setText(const char *ikey);
+// virtual void setPosition(SW_POSITION p);
+// virtual const char *getText() const;
+ virtual int _compare (const TreeKeyIdx & ikey);
+// virtual int compare(const SWKey &ikey);
+// virtual void decrement(int steps = 1);
+// virtual void increment(int steps = 1);
+// virtual char Traversable () { return 1; }
+
+ static signed char create(const char *path);
+}; \ No newline at end of file
diff --git a/bindings/swig/versekey.i b/bindings/swig/versekey.i
new file mode 100644
index 0000000..f50f908
--- /dev/null
+++ b/bindings/swig/versekey.i
@@ -0,0 +1,51 @@
+%{
+ #include "versekey.h"
+%}
+
+class VerseKey : public SWKey {
+public:
+ VerseKey(const char *ikey = 0);
+ //VerseKey(const SWKey * ikey);
+ //VerseKey(const char *min, const char *max);
+ //VerseKey(const VerseKey &k);
+ virtual ~VerseKey();
+
+ virtual SWKey *clone() const;
+
+//bound management
+// VerseKey & LowerBound(const char *lb);
+// VerseKey & UpperBound(const char *ub);
+ VerseKey & LowerBound() const;
+ VerseKey & UpperBound() const;
+ void ClearBounds();
+
+//data functions
+ virtual void decrement(int step);
+ virtual void increment(int step);
+ virtual char Traversable() { return 1; }
+
+ virtual const char *getBookName() const;
+ virtual const char *getBookAbbrev() const;
+
+ virtual char Testament() const;
+ virtual char Book() const;
+ virtual int Chapter() const;
+ virtual int Verse() const;
+
+ //virtual char Testament(char itestament);
+// virtual char Book(char ibook);
+// virtual int Chapter(int ichapter);
+// virtual int Verse(int iverse);
+
+ virtual void Normalize(char autocheck = 0);
+ virtual char AutoNormalize(char iautonorm = MAXPOS (char));
+
+ virtual char Headings(char iheadings = MAXPOS (char));
+ virtual const char *getOSISRef() const;
+
+ virtual int compare(const SWKey & ikey);
+ virtual int _compare(const VerseKey & ikey);
+
+ virtual void setLocale(const char *name);
+ virtual const char *getLocale() const;
+};
diff --git a/bindings/swig/zcom.i b/bindings/swig/zcom.i
new file mode 100644
index 0000000..767bf01
--- /dev/null
+++ b/bindings/swig/zcom.i
@@ -0,0 +1,11 @@
+%{
+ #include "zcom.h"
+%}
+
+class zCom : public SWCom {
+ zCom (const char *ipath, const char *iname = 0, const char *idesc = 0, int blockType = CHAPTERBLOCKS, SWCompress * icomp = 0, SWDisplay * idisp = 0, SWTextEncoding encoding = ENC_UNKNOWN, SWTextDirection dir = DIRECTION_LTR, SWTextMarkup markup = FMT_UNKNOWN, const char* ilang = 0);
+ virtual ~ zCom ();
+
+ static char createModule (const char *path, int blockBound);
+};
+
diff --git a/bindings/swig/zipcompress.i b/bindings/swig/zipcompress.i
new file mode 100644
index 0000000..45441bf
--- /dev/null
+++ b/bindings/swig/zipcompress.i
@@ -0,0 +1,11 @@
+%{
+ #include <zipcomprs.h>
+%}
+
+class ZipCompress : public SWCompress {
+public:
+ ZipCompress();
+ virtual ~ZipCompress ();
+ virtual void Encode (void);
+ virtual void Decode (void);
+};
diff --git a/bindings/swig/zld.i b/bindings/swig/zld.i
new file mode 100644
index 0000000..375457d
--- /dev/null
+++ b/bindings/swig/zld.i
@@ -0,0 +1,12 @@
+%{
+ #include "zld.h"
+%}
+
+class zLD : public SWLD {
+public:
+ zLD(const char *ipath, const char *iname = 0, const char *idesc = 0, long blockCount = 200, SWCompress *icomp = 0, SWDisplay * idisp = 0, SWTextEncoding encoding = ENC_UNKNOWN, SWTextDirection dir = DIRECTION_LTR, SWTextMarkup markup = FMT_UNKNOWN, const char* ilang = 0);
+ virtual ~zLD();
+
+ static char createModule (const char *path);
+};
+
diff --git a/bindings/swig/ztext.i b/bindings/swig/ztext.i
new file mode 100644
index 0000000..893f411
--- /dev/null
+++ b/bindings/swig/ztext.i
@@ -0,0 +1,12 @@
+%{
+ #include "ztext.h"
+%}
+
+class zText : public SWText {
+public:
+ zText(const char *ipath, const char *iname = 0, const char *idesc = 0, int blockType = CHAPTERBLOCKS, SWCompress * icomp = 0, SWDisplay * idisp = 0, SWTextEncoding encoding = ENC_UNKNOWN, SWTextDirection dir = DIRECTION_LTR, SWTextMarkup markup = FMT_UNKNOWN, const char* ilang = 0);
+ virtual ~zText ();
+
+ static char createModule (const char *path, int blockBound);
+};
+