如何解析在C网址是什么? [英] How to parse a URL in C?
问题描述
我想知道如何解析URL到一个URL对象(某种)的C.
这样我就可以从查询字符串中提取键/ VAL对象。
Im wondering how to parse a url into an URL object(of some kind) in C. So that I would be able to extract key/val objects from a querystring.
已经看过:
<一href=\"http://stackoverflow.com/questions/726122/best-ways-of-parsing-a-url-using-c\">http://stackoverflow.com/questions/726122/best-ways-of-parsing-a-url-using-c
和其他几个资源,甚至谷歌code,但没有找到我的口味什么..
不,使用sscanf的,而正则表达式是不是一种选择。他说,除非我有写我自己的解析器。
And several other resources, even Google Code, but haven't found anything in my taste.. And no, using sscanf, and regex is not an alternative. Saying, unless I have to write my own parser..
将不胜感激就在那里我能找到这个任何提示或帮助!
Would be greatful for any tips or help on where I could find this!
推荐答案
看着wget的将是值得的。下载源,并期待在SRC / url.c url_parse功能。
Looking at wget would be worth it. Download the source and look at url_parse function in src/url.c.
希望这有助于。
这篇关于如何解析在C网址是什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!