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

Troy A. Griffitts sword-devel@crosswire.org
Thu, 06 Jun 2002 13:27:55 -0700

	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;

Hope this helps.

Still not exactly sure what you are attempting, but have you looked at 
our Entry Attributes mechanism?  Might, or might not help you with your 
goal.  See sword/examples/cmdline/lookup for an example.  Try it on 
something like: KJV with strongs, TR, or Thayer modules.


Victor Porton wrote:
> I need to record the offsets of tokens from the beginning of an entry text 
> (for in the future to retrieve the text fragments at these offsets). But there 
> is a problem.
> virtual bool SWBasicFilter::handleToken (char **buf, const char *token, 
> DualStringMap &userData);
> This method does not have an argument providing me with the offset of the 
> token from the beginning of the text :-(
> What to do?! It seems to be the need for a backward incompatible change of 
> this function to receive the offset :-~
> Any ideas?