Giter VIP home page Giter VIP logo

cstl's Introduction

facil.io 0.8.x for C - now with an integrated C STL

The Web microFramework and Server Toolbox library for C

POSIX C/C++ CI Windows C/C++ CI

The facil.io library is much more than a Web Application Framework and includes core tools and type templates that any C (and C++) project will find useful.

In addition to useful helpers, facil.io allows developers to use MACROS to generate code for different common types, such as Hash Maps, Arrays, Binary-Safe Strings, etc'.

In other words, some of the most common building blocks one would need in any C project are placed in this convenient header file library.

Installing

Simply copy the fio-stl.h file to your project's folder (using a single header file). Done.

Or... copy the fio-stl folder to your project's folder (using "fio-stl/include.h"). Done.

Include the file as many times as required and enjoy.

Running Tests

To test the STL locally you need to first fork the project or download the whole project source code. Then, from the project's root folder run:

make test/stl

The GNU make command will compile and run any file in the tests folder if it is explicitly listed. i.e.,

make tests/malloc      # speed test facil.io's memory allocator
make tests/json        # test JSON roundtrip with external JSON files
make tests/json_minify # JSON minification example
make tests/cpp         # Test template compilation in a C++ file (no run)... may fail on some compilers

It is possible to use the same makefile to compile source code and static library code. See the makefile for details.

On Windows you might want to skip the makefile (if you do not have make and gcc installed) and run:

cls && cl /Ox tests\stl.c /I. && stl.exe 

Quick Examples

There are a number of examples in the ./examples folder, including:

Examples for authoring network applications:

Examples using the C Server Toolbox Library (STL) Types:

Running the example code

Examples can be compiled and executed using:

make examples/<name>

For example, to compile and run the server example, use:

make examples/server

Contribution Notice

If you're submitting a PR, make sure to update the corresponding code slice (file) in the fio-stl folder, the makefile will re-produce the fio-stl.h file automatically.

Note that the master branch is currently as unstable as it gets. Commits may get squashed, the branch may be overwritten (force push), etc'. I will play nicer when the code stabilizes.

Also, contributions are subject to the terms and conditions set in the facil.io contribution guide.

Documentation

Documentation is available in the (auto-generated) fio-stl.md file.

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.