{"id":33050994,"url":"https://github.com/timmylindh/CHL","last_synced_at":"2025-11-18T20:02:30.891Z","repository":{"id":34781391,"uuid":"38764455","full_name":"timmylindh/CHL","owner":"timmylindh","description":"C Hypertext Library - A library for writing web applications in C","archived":false,"fork":false,"pushed_at":"2022-03-18T17:09:35.000Z","size":5287,"stargazers_count":269,"open_issues_count":2,"forks_count":10,"subscribers_count":16,"default_branch":"master","last_synced_at":"2024-07-22T09:26:35.759Z","etag":null,"topics":["development-tools","html","http","library","webapps","website"],"latest_commit_sha":null,"homepage":"","language":"C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"lgpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/timmylindh.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2015-07-08T15:59:37.000Z","updated_at":"2024-05-15T22:17:02.000Z","dependencies_parsed_at":"2022-09-15T07:02:23.983Z","dependency_job_id":null,"html_url":"https://github.com/timmylindh/CHL","commit_stats":null,"previous_names":["it4e/chl"],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/timmylindh/CHL","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/timmylindh%2FCHL","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/timmylindh%2FCHL/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/timmylindh%2FCHL/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/timmylindh%2FCHL/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/timmylindh","download_url":"https://codeload.github.com/timmylindh/CHL/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/timmylindh%2FCHL/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":285129556,"owners_count":27119601,"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","status":"online","status_checked_at":"2025-11-18T02:00:05.759Z","response_time":61,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["development-tools","html","http","library","webapps","website"],"created_at":"2025-11-14T03:00:23.120Z","updated_at":"2025-11-18T20:02:30.879Z","avatar_url":"https://github.com/timmylindh.png","language":"C","funding_links":[],"categories":["网络和互联网"],"sub_categories":["高级书籍"],"readme":"# CHL\nC Hypertext Library - A library for writing web applications in C\n\n```c\n#include \u003cchl/chl.h\u003e\n\nint main() {\n chl_set_default_headers();\n chl_print_headers();\n \n printf(\"Hello world\");\n \n return 0;\n}\n```\n (*Simple Hello World in CHL*)\n\n[See examples](https://github.com/it4e/CHL/wiki/Examples)\u003cbr /\u003e\n[Tutorial](https://github.com/it4e/CHL/wiki/Tutorial), \n[Setup](https://github.com/it4e/CHL/wiki/Setup), \n[API](https://github.com/it4e/CHL/wiki), \n[Contribute](https://github.com/it4e/CHL/wiki/Contribute)\u003cbr /\u003e\n[FastCGI](https://github.com/it4e/CHL/wiki/FastCGI)\n\n## What is CHL?\n\nCHL, short for *C Hypertext Library*, is a library used to write web applications of all sorts in the C programming language. CHL provides you with a lot of useful features:\n\n\u003e \n  - *FastCGI implementation*\n  - *MySQL library*\n  - *Parsing and fetching HTTP data, such as POST and GET.*\n  - *Creating and deleting HTTP headers.*\n  - *A dedicated API for creating and deleting cookies.*\n  - *The ability to execute CHL functions within HTML files*\n\nand a lot more...\n\n## Why CHL?\n\nWhat makes CHL uniqe is the support for executing functions inside HTML files, much like PHP using the *\u003c?php ?\u003e* syntax, though *CHL* uses the *\u003c{ }\u003e* syntax.\n\n\u003e Example\n\n```html\n\u003cbody\u003e\n \u003c{ import(\"header.vw\"); }\u003e\n\u003c/body\u003e\n```\n\n## How does it work?\n\nWeb applications written in C must somehow be executed by the Web server since C is a compiled language. To make this possible CHL is based on CGI (Common Gateway Interface), which in short means that the server executes your program and passes it data through environment variables. CHL does all the parsing and handling of CGI in the background, and provides you with some easy to use functions instead. CHL also provides an interface for FastCGI.\n\n## API\n\nThe *Application Programming Interface* is written with *Github Wikis*: [API](https://github.com/it4e/CHL/wiki).\n\n## Setup\n\nFor a proper guide on how to install and configure CHL on your system, read the following document: https://github.com/it4e/CHL/wiki/Setup.\n\nAs of now, CHL is only officially available on Linux, but I am planning to port it to other operating systems as well if the interest is big enough. Otherwise you could of course make a port of it yourself, see [contribute](https://github.com/it4e/CHL/wiki/Contribute).\n\n## Tutorial\n\nTo read an in depth tutorial on the structure of *CHL web applications*, and a walk through on how to get started and how to use the *CHL API* properly see https://github.com/it4e/CHL/wiki/Tutorial.\n\nThe tutorial is divided into various sections. The first section is a quick introduction to let you know what *CHL* is all about and what it can do for you. We will then dig deeper and deeper into the CHL API.\n\nBefore you start reading this tutorial, make sure you have CHL installed and that everything is properly set up. [Setting up CHL](https://github.com/it4e/CHL/wiki/Setup).\n\n\n## \u003ca name=\"contribute\"\u003eContribute\u003c/a\u003e\n\nThere are several ways you can contribute to CHL. Take a look at the [*issues page*](https://github.com/it4e/CHL/issues) for an overview of what you can contribute to. If you have any ideas of your own for new features to implement, feel free to contribute with a pull request.\n\nFor a detailed guide on contribution to CHL, see [contribute](https://github.com/it4e/CHL/wiki/Contribute).\n\n## \u003ca name=\"examples\"\u003eExamples\u003c/a\u003e\n\nSee [examples](https://github.com/it4e/CHL/wiki/Examples), for a page with detailed examples of CHL in use.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftimmylindh%2FCHL","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftimmylindh%2FCHL","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftimmylindh%2FCHL/lists"}