[sword-devel] ztext file format...

Troy A. Griffitts scribe at crosswire.org
Wed May 19 00:20:05 MST 2010


Dear Wade,

I understand your frustration and desire to get something working.

I can't stress enough that making bindings to the existing engine is the
way forward for .net developers.  We have multiple storage formats
besides our ztext driver.   And the ztext driver itself can store data
in differing sized blocks and even with different compression
algorithms.  We have a number of markup formats supported in the engine
as well.

The SWORD engine API is actually really simple.

SWMgr library;
SWModule *book = library.getModule("KJV");
book->setKey("jn.3.16");
cout << book->RenderText();

Writing bindings to expose this basic functionality is really a
straightforward task and should take much less time than writing the
code to read one storage format in a certain configuration to obtain
some type of raw markup, that might change tomorrow.

Things get unwieldy when a binding tries to expose every method of every
class in exactly the same way as the C++ code is written.  Providing
SWMgr::getModule, SWModule::setKey, and SWModule::RenderText is fairly
basic.

For a good list of which methods will probably eventually need to be
exposed for a developer to use the API is a full-featured way, have a
look at our CORBA IDL file.  This IDL is described the user interface
exposed for our Java->CORBA->C++ binding used by our web tools.  This
same IDL is also used as the model for our Android bindings.

http://crosswire.org/svn/sword/trunk/bindings/corba/swordorb.idl

Hope this explains the reasoning a little better and gives you some
ideas how to proceed.  Please don't burn out trying to get things
working.  Feel free to ask questions.  Not sure how many C# engineers
are here, but we'd be happy to help with the SWORD side of things.

Troy






On 05/18/2010 09:57 PM, Wade Balzer wrote:
> The only bindings I have found were dated Feb 2006 for C#, and they were not
> maintained.  When I have used those bindings, I would get intermittent GPF
> Errors trying to use them in a .Net project.  I think it had to do with
> garbage collection, and followed the recommendations that were documented. 
> Still would get the intermittent errors.  
>
> I tried without success to rebuild the swig bindings with the latest core
> hoping it would be more stable.  Stayed up several nights trying before I
> resolved to go another direction for the time being.
>
> If someone could rebuild the Swig bindings for a C# project based on all the
> newest or latest fixes in the core, that would be awesome, but it is a lot
> of work to get it to compile.  I personally could not get it to compile in
> SWIG, and I didn't see a lot of interest in maintaining .Net bindings or a
> .Net port of any kind.
>
> Thus... my next option was to build my own reader in C# from scratch, and
> follow the basic class structure, but there was no documentation on the
> ztext format used.
>
> Hoping someone could enlighten me on the structure to save me the time to
> figure it out myself.  
>
> Right now, I am pretty bent on writing a .Net port in C# as there is with
> the Java port, because I know it will be stable, and easier to maintain.
> Not only that, but there are a ton of .Net developers that can do nothing
> with what you have, and therefore, they don't.
>
> I can understand not having public documentation of the module format, as it
> is unnecessary by using the library.  But a library that doesn't work in
> .Net is a much bigger problem, because I can't read the modules.
>
> Basically, I am saying, that I am willing to write a port in .Net if I am
> able to get the assistance I need to do so.  Otherwise, I am likely to get
> frustrated and burned out before I can get it done.
>
> Thanks so much,
>
> Wade
>
>
> -----Original Message-----
> From: Troy A. Griffitts [mailto:scribe at crosswire.org] 
> Sent: Tuesday, May 18, 2010 6:37 PM
> To: SWORD Developers' Collaboration Forum
> Subject: Re: [sword-devel] ztext file format...
>
> On 05/18/2010 01:41 PM, Matthew Talbert wrote:
>   
>>>> I have looked, but I cannot seem to find any information regarding the
>>>> structure of the ztext file format.
>>>>       
>>>>         
>>> The module format is essentially undocumented (other than via the source
>>> code) and we have little intention to change that. The format is subject
>>> to occasional smaller or larger changes.
>>>
>>> The general recommendation is that creators of frontends use the library
>>> as it is and build upon that. I am sure there are C# bindings somewhere
>>> available.
>>>     
>>>       
>> The C# bindings haven't worked for ages, and they are difficult to
>>     
> maintain.
>   
>>   
>>     
> Nonetheless, Peter is right.  The recommendation should be to either
> update and maintain the C# bindings, or else write a new set of bindings
> if they are not satisfactory.  Our policy is to not advertise our file
> formats as they are prone to grow whenever we feel like it.  Our focal
> point of stability for developers is our API.  We strive hard not to
> break existing code, and do so on purpose only when absolutely
> necessary.  This is not true for our module format (which includes
> compression, encoding, indexing, and markup).
>
> Having said this, Wade, I'm excited you want to provide C# access to
> developers!  Have you had a look yet at the current state of our C#
> bindings.  It has been some time since anyone has mentioned them around
> here.  It would be great to hear your assessment.
>
> Troy
>
>
>
> Troy
>
> _______________________________________________
> sword-devel mailing list: sword-devel at crosswire.org
> http://www.crosswire.org/mailman/listinfo/sword-devel
> Instructions to unsubscribe/change your settings at above page
>
>
> _______________________________________________
> sword-devel mailing list: sword-devel at crosswire.org
> http://www.crosswire.org/mailman/listinfo/sword-devel
> Instructions to unsubscribe/change your settings at above page
>   




More information about the sword-devel mailing list