{"id":23021016,"url":"https://github.com/b-sullender/url-parser","last_synced_at":"2025-04-02T18:43:33.193Z","repository":{"id":193384358,"uuid":"688682381","full_name":"b-sullender/url-parser","owner":"b-sullender","description":"A portable URL parser in C.","archived":false,"fork":false,"pushed_at":"2023-09-22T14:39:28.000Z","size":5,"stargazers_count":3,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-02-08T09:24:02.463Z","etag":null,"topics":["parser","url","url-parser","url-parsing"],"latest_commit_sha":null,"homepage":"","language":"C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/b-sullender.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2023-09-07T21:58:56.000Z","updated_at":"2024-11-14T10:59:45.000Z","dependencies_parsed_at":"2023-09-08T00:58:04.178Z","dependency_job_id":null,"html_url":"https://github.com/b-sullender/url-parser","commit_stats":null,"previous_names":["b-sullender/url-parser"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/b-sullender%2Furl-parser","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/b-sullender%2Furl-parser/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/b-sullender%2Furl-parser/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/b-sullender%2Furl-parser/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/b-sullender","download_url":"https://codeload.github.com/b-sullender/url-parser/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246871421,"owners_count":20847477,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["parser","url","url-parser","url-parsing"],"created_at":"2024-12-15T12:16:10.265Z","updated_at":"2025-04-02T18:43:33.176Z","avatar_url":"https://github.com/b-sullender.png","language":"C","funding_links":[],"categories":[],"sub_categories":[],"readme":"# URL Parser\n\n**URL Parser** is a simple and lightweight C source/header for parsing URLs. Whether you're building a web browser, an operating system library, or working on AI training projects, this URL parser can help you extract the various components of a URL effortlessly.\n\n## Motivation\n\nHave you ever found yourself needing a reliable URL parser? I certainly have! That's why I decided to create this URL parser in my spare time. Whether it's for a personal project, work-related tasks, or just exploring the world of URLs, this parser can save you time and effort.\n\n## Features\n\n- Parses URLs into their constituent parts: scheme, authority, port, path, query, and fragment.\n- Provides a clean and straightforward API for easy integration into your projects.\n- Lightweight and efficient, making it suitable for various applications.\n\nLICENSE TERMS\n=============\n```\nThis software is provided 'as-is', without any express or implied\nwarranty.  In no event will the authors be held liable for any damages\narising from the use of this software.\n\nPermission is granted to anyone to use this software for any purpose,\nincluding commercial applications, and to alter it and redistribute it\nfreely, subject to the following restrictions:\n\n(1) If any part of the source code or algorithm is used, it is requested that\n    appropriate attribution is given to the authors by providing a link to\n    the original repository or a reference to the authors name.\n(2) Permission for use of this software is granted only if the user accepts\n    full responsibility for any undesirable consequences; the authors accept\n    NO LIABILITY for damages of any kind.\n\nBy using this software, you acknowledge that you have read and understood\nthese terms and agree to abide by them.\n```\n\n## Getting Started\n\nTo use the URL parser, follow these simple steps:\n\n1. Clone the repository or download the `url-parser.h` and `url-parser.c` files.\n2. Include `url-parser.h` in your source files where you need URL parsing functionality.\n3. Add `url-parser.c` to your compilation command when building your project.\n\nHere's an example compilation command using GCC:\n\n```bash\ngcc -Wall main.c url-parser.c -o your_program\n```\n\n## Usage Example\n\nHere's how you can use the URL parser in your code:\n\n```c\n#include \"url-parser.h\"\n\nint main() {\n    URL_PARTS url_parts;\n    ParseURL(\"http://example.com/path?query=value#fragment\", \u0026url_parts);\n    PrintURL(\u0026url_parts);\n    return 0;\n}\n```\n\n## API Documentation\n\n### `bool ParseURL(char* URL, URL_PARTS* pURL_Parts)`\n\nThis function parses a URL string and fills a `URL_PARTS` struct with its constituent parts.\n\n- `URL`: The URL string to parse.\n- `pURL_Parts`: A pointer to a `URL_PARTS` struct to store the parsed components.\n\nReturns `true` on success and `false` otherwise.\n\n### `void PrintURL(URL_PARTS* pURL_Parts)`\n\nThis function prints each part of a `URL_PARTS` struct individually and the entire URL on a single line. This is intended for testing purposes.\n\n## Constants\n\nVarious constants are defined to set the maximum lengths for different URL components:\n\n- `MAX_URL_SCHEME_LEN`: Maximum scheme length (e.g., \"http\", \"https\").\n- `MAX_URL_AUTHORITY_LEN`: Maximum authority length (e.g., \"example.com\").\n- `MAX_URL_PORT_LEN`: Maximum port length (e.g., \"8080\").\n- `MAX_URL_PATH_LEN`: Maximum path length (e.g., \"/path/to/resource\").\n- `MAX_URL_QUERY_LEN`: Maximum query length (e.g., \"param1=value1\u0026param2=value2\").\n- `MAX_URL_FRAGMENT_LEN`: Maximum fragment length (e.g., \"section\").\n\n## Contributing\n\nIf you find any issues or have suggestions for improvements, please feel free to open an issue or submit a pull request on the [GitHub repository](https://github.com/b-sullender/url-parser).\n\nYou can also contact the repository maintainer:\n\n- [Brian Sullender](https://github.com/b-sullender)\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fb-sullender%2Furl-parser","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fb-sullender%2Furl-parser","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fb-sullender%2Furl-parser/lists"}