zuiderkwast / url-parser

URL parser extracted from NodeJS http-parser

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

URL Parser

This URL parser was extracted from http-parser, which is no longer actively maitained. It was previouly used by NodeJS.

It is a simplistic zero-copy URL parser designed for performance. It does not make any syscalls nor allocations. It can be interrupted at anytime. It has no dependencies.

Usage

/* Initialize all http_parser_url members to 0 */
void http_parser_url_init(struct http_parser_url *u);

/* Parse a URL; return nonzero on failure */
int http_parser_parse_url(const char *buf, size_t buflen,
                          int is_connect,
                          struct http_parser_url *u);

See url_parser.h for details.

There is a demo program included. Build it with make url_parser. Run the tests with make test.

About

URL parser extracted from NodeJS http-parser

License:MIT License


Languages

Language:C 93.1%Language:Makefile 6.9%