I have recently reworked the browsers url to path conversions to come
from teh file operations table and to use nsurl instead of strings for
urls. From this I have eliminated a great deal of duplicated,
problematic, conversion code.
There are two generic helpers available by including utils/file.h
nserror netsurf_nsurl_to_path(struct nsurl *url, char **path_out);
nserror netsurf_path_to_nsurl(const char *path, struct nsurl **url);
I have converted all uses of conversion to these functions but please,
please can frontend maintainers check my work. As ChrisY demonstarted
recently, even if the core change is correct and tested on one
platform it can mess up elsewhere.
This rework now means that almost all the netsurf internal API now
uses our nsurl url functions (missing is launch_url() set_url() and
save_url() which I intend to fix soon)
For many file related url handling this has greatly reduced the number
of string to url to string conversions and made our scheme handling
much more robust.
It is my hope that frontend maintainers are happy with this move, if
not can they explain their objections clearly and propose an
alternative solution.
I also intend to extend the nsurl component API slightly to allow
retrieval of escaped path elements, my eventual thought here is to be
able to remove the old string based URL API (see utils/url.h)
--
Regards Vincent
http://www.kyllikki.org/
No comments:
Post a Comment