pdf-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [pdf-devel] Re: Modifications on pdf_token_read to get token boundar


From: Michael Gold
Subject: Re: [pdf-devel] Re: Modifications on pdf_token_read to get token boundaries
Date: Wed, 17 Jun 2009 08:44:25 -0400
User-agent: Mutt/1.5.19 (2009-01-05)

On Mon, Jun 15, 2009 at 22:29:32 +0200, address@hidden wrote:
> 
> A possible solution for this problem could be to change/expand the stm
> public api in the following way:
> 
> - Rename the current pdf_stm_seek/tell functions to
>   pdf_stm_bseek/btell. The 'b' is for 'backend'.
> 
> - Add a new function pdf_stm_tell that returns the number of octects
>   since the last bseek (or since the creation of the stream if no
>   bseek was made).
> 
> Since the operation in the streams is inherently sequential, that
> schema makes sense in my opinion.

I agree.

> The addition of a new function to the tokeniser returning the offset
> of the beginning of the last read token would then use this
> pdf_stm_tell function.
> 
> What do you think? If you agree I will implement it as part of my
> type4+tokeniser patch.

It looks good to me.

The easiest way to implement it in the token reader would probably be to
replace the "reader->state = X" statements with calls to a private
function (e.g. enter_state) that would also store the token's starting
position.  Then in flush_token, store this value when emitting a token.

-- Michael

Attachment: signature.asc
Description: Digital signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]