[LIBC] Modfied Version of sscanf

Arnaud Lacombe lacombar at gmail.com
Mon May 2 15:57:23 UTC 2011


Hi,

On Mon, May 2, 2011 at 8:13 AM, Martin Möller
<moeller.akt at googlemail.com> wrote:
> Hello,
>
> Thanks for all the replies.
> We have so far discovered the following suggetions for the parsing Problem:
> Using:
>    o a tokenizer/parser is too much overhead for such a simple task
>    o strchr, memchr is too low-level and not elegant enough
>    o strtok would not even parse (tokenize) this simple example
>    o a regexp library: How would you solve the problem with a regexp lib ?
>
> Criteria:
>    o Receive the value of <resource>
>    o Check the Environment: Is <resource> really sourrounded by 'GET ' and
>      'HTTP/1.1' ?!
>
There is plenty of library out there dealing with parsing the code you
pointed out. Do you really need to re-invent the wheel ?

 - Arnaud

> I need a function which accepts BNF-style rules.
> E.g.:
>    char resource [512];
>
>    ret = bnfparse (request, "GET %s HTTP/1.1", resource);
>
> Ret would be $(NUMBER OF FORMAT SPECIFIERS, successfully handled) +env.
> Env would be 1 if the Environment passes, and 0 is not.
>
> Any comments ?
> Best regards,
> Martin
>
>
> _______________________________________________
> freebsd-hackers at freebsd.org mailing list
> http://lists.freebsd.org/mailman/listinfo/freebsd-hackers
> To unsubscribe, send any mail to "freebsd-hackers-unsubscribe at freebsd.org"
>


More information about the freebsd-hackers mailing list