doc confusion in 1.4.5 about gcry_sexp_canon_len

Werner Koch wk at gnupg.org
Fri Jan 1 19:07:22 CET 2010


On Fri, 01 Jan 2010 11:19:49 +0100, Marco Maggi wrote:

> 1. What does "with implicit length values" means?

A canonical S-expression knows its own length, that is the buffer
encodes its own length.

> 2. Is it correct to  rephrase "If @var{length} is not 0, the
>    maximum length to scan  is given;" to "If @var{length} is
>    not 0, it must be the  maximum number of bytes to scan in
>    the buffer;"?

No.  This length is an upper limit; much ike the second arg in
snprintf.  You use this is you don't know the original of the
S-expression and thus it may not be correctly encoded.

> 3.  "@var{errcode} and  @var{erroff} may  both be  passed as
>    @code{NULL}."   and  if they  are  not,  what values  are
>    returned?

An error code (GPG_ERR_xxx) and the approximate byte offset from the
start of the buffer where the parser found the error.


Shalom-Salam,

   Werner

-- 
Die Gedanken sind frei.  Ausnahmen regelt ein Bundesgesetz.




More information about the Gcrypt-devel mailing list