Coder Social home page Coder Social logo

praveenmunagapati / chl Goto Github PK

View Code? Open in Web Editor NEW

This project forked from timmylindh/chl

0.0 2.0 0.0 5.15 MB

C Hypertext Library - A library for writing web applications in C

Home Page: http://libchl.ml/

License: GNU General Public License v3.0

C 97.44% Shell 0.34% Makefile 0.30% C++ 1.92%

chl's Introduction

CHL

C Hypertext Library - A library for writing web applications in C

#include <chl/chl.h>

int main() {
 chl_set_default_headers();
 chl_print_headers();
 
 printf("Hello world");
 
 return 0;
}

(Simple Hello World in CHL)

See examples
Tutorial, Setup, API, Contribute
FastCGI

Website

What is CHL?

CHL, 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:

  • FastCGI implementation
  • MySQL library
  • Parsing and fetching HTTP data, such as POST and GET.
  • Creating and deleting HTTP headers.
  • A dedicated API for creating and deleting cookies.
  • The ability to execute CHL functions within HTML files

and a lot more...

Why CHL?

What makes CHL uniqe is the support for executing functions inside HTML files, much like PHP using the syntax, though CHL uses the <{ }> syntax.

Example

<body>
 <{ import("header.vw"); }>
</body>

How does it work?

Web 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.

API

The Application Programming Interface is written with Github Wikis: API.

Setup

For a proper guide on how to install and configure CHL on your system, read the following document: https://github.com/it4e/CHL/wiki/Setup.

As 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.

Tutorial

To 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.

The 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.

Before you start reading this tutorial, make sure you have CHL installed and that everything is properly set up. Setting up CHL.

There are several ways you can contribute to CHL. Take a look at the issues page 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.

For a detailed guide on contribution to CHL, see contribute.

See examples, for a page with detailed examples of CHL in use.

chl's People

Contributors

it4e avatar imfalling avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.