ada-url / ada

WHATWG-compliant and fast URL parser written in modern C++

Home Page:https://ada-url.com

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Use url_aggregator for C interface

lemire opened this issue · comments

One of the benefit of the new url-aggregator interface is that its conceptual simplicity allows us to expose a simple C interface.

Where should the C interface code be pushed?

It is a good question. We could bundle it here but if you want to work on it, I would start from a PR on top of the dev. branch where we are building url_aggregator.

One motivation to keep it with the C++ is that we could share the tests and benchmarks.

It is going to be much easier because C can grab a C string from the buffer (.c_str()) and then the url_component is just a struct of integer offsets. From there, a pure C code can provide segments of string matching the different components. Only one of then is trickier (origin) but this can be worked out easily enough.

The implementation is not going to be super challenging… but we need tests! Of course… one can just use our existing test framework.

This issue has been resolved.