Giter VIP home page Giter VIP logo

c_utils's Introduction

C utils

Some utilities in C that i want to have in a single, no dependency, header file.

Files:

  • list.h - proper array-lists (cpp vectors)
  • hashmap.h - hash maps (python dictionary)
  • bstr.h - better strings

Description:

It's not a stb-like library, you don't have to #define X_IMPLEMENTATION, just include the file.

Not sure if this is a good way to do it, but some of the libs use macros to generate all of the functions and structs. This is done because i have no idea how to do all of it with just macros in c. For example, when you include list.h, you have to call the macro INIT_LIST(name, type), where the name is the prefix the functions will have, and the type is the type the list stores (eg. INIT_LIST(IntList, int) will make the functions IntList_make, IntList_add, IntList_insert...), and also because of the limitations, some functions (in this case the quicksort implementation) are behind another macro, so to generate those you have to also use INIT_LIST_SORT(name, type), but to generate all of the functions for types that support sorting (builtins basically) there is the macro INIT_LIST_ALL(name, type).

c_utils's People

Contributors

eugen-str avatar

Watchers

 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.