[sword-devel] I hardly sticked with a simple programming thing :-~

Victor Porton sword-devel@crosswire.org
Fri, 07 Jun 2002 03:19:51 +0600

Hi Troy,

> 	Added resultBuffer to SWBasicFilter for you.  This is the start of the 
> buffer into which **buf is pointing.  From this, you can obtain long 
> offset = *buf - resultBuffer;

Thanks, but

1. I just updated from the CVS and haven't found any resultBuffer. May be the CVS is located on several servers and transferring from one server to an other is with a delay, isn't it?

2. As I understood it is not what I asked about: I am about the offset from the beginning of the source text, not from the beginning of the destination text. Did we understood each other correctly?

3. I invented an other way to do this: I am going to create a filter which will just pass through anything without changes and by the way analize the text. It will store offsets from the beginning of the _destinantion_ (the copy) text. It will be probably much slow, but in any case as it is very experimental it will be some day rewritten (probably with Sword 2 or Sword 3...), so efficiency isn't very important.

My overall philosophy of programming is that we should not play with high optimizing the code by the price of not very natural API as in a future it most probably will cause problems including lost of efficiency. So I think this processText() in Sword 2.0 should not attempt to tricky process the text in-place as it does now.

Well, already probably much too much about one function :-)
Victor Porton (porton@narod.ru)