All Projects → assyrianic → Harbol

assyrianic / Harbol

Licence: Apache-2.0 license
Harbol is a collection of data structure and miscellaneous libraries, similar in nature to C++'s Boost, STL, and GNOME's GLib

Programming Languages

c
50402 projects - #5 most used programming language
C++
36643 projects - #6 most used programming language
Makefile
30231 projects
shell
77523 projects

Projects that are alternatives of or similar to Harbol

ctl
My variant of the C Template Library
Stars: ✭ 105 (+483.33%)
Mutual labels:  tree, queue, hashmap, hashtable
Mlib
Library of generic and type safe containers in pure C language (C99 or C11) for a wide collection of container (comparable to the C++ STL).
Stars: ✭ 321 (+1683.33%)
Mutual labels:  tree, queue, string, hashmap
Cracking The Coding Interview
Solutions for Cracking the Coding Interview - 6th Edition
Stars: ✭ 35 (+94.44%)
Mutual labels:  tree, queue, string
data-structure-project
自己实现集合框架系列整理总结
Stars: ✭ 29 (+61.11%)
Mutual labels:  tree, queue, hashmap
hatrack
Fast, multi-reader, multi-writer, lockless data structures for parallel programming
Stars: ✭ 55 (+205.56%)
Mutual labels:  queue, hashmap, hashtable
Algodeck
An Open-Source Collection of 200+ Algorithmic Flash Cards to Help you Preparing your Algorithm & Data Structure Interview 💯
Stars: ✭ 4,441 (+24572.22%)
Mutual labels:  tree, queue, hashtable
Sc
Common libraries and data structures for C.
Stars: ✭ 161 (+794.44%)
Mutual labels:  queue, vector, hashmap
AlgoDaily
just for fun
Stars: ✭ 118 (+555.56%)
Mutual labels:  tree, queue, hashtable
Algo Tree
Algo-Tree is a collection of Algorithms and data structures which are fundamentals to efficient code and good software design. Creating and designing excellent algorithms is required for being an exemplary programmer. It contains solutions in various languages such as C++, Python and Java.
Stars: ✭ 166 (+822.22%)
Mutual labels:  tree, queue, string
myleetcode
♨️ Detailed Java & Python solution of LeetCode.
Stars: ✭ 34 (+88.89%)
Mutual labels:  tree, queue, string
Containers
This library provides various containers. Each container has utility functions to manipulate the data it holds. This is an abstraction as to not have to manually manage and reallocate memory.
Stars: ✭ 125 (+594.44%)
Mutual labels:  tree, queue, vector
Data-Structure-Algorithm-Programs
This Repo consists of Data structures and Algorithms
Stars: ✭ 464 (+2477.78%)
Mutual labels:  tree, queue, string
Algorithms
CLRS study. Codes are written with golang.
Stars: ✭ 482 (+2577.78%)
Mutual labels:  tree, hashmap
Learningmasteringalgorithms C
Mastering Algorithms with C 《算法精解:C语言描述》源码及Xcode工程、Linux工程
Stars: ✭ 615 (+3316.67%)
Mutual labels:  tree, queue
Datastructure
常用数据结构及其算法的Java实现,包括但不仅限于链表、栈,队列,树,堆,图等经典数据结构及其他经典基础算法(如排序等)...
Stars: ✭ 419 (+2227.78%)
Mutual labels:  tree, queue
Geeksforgeeks Dsa 2
This repository contains all the assignments and practice questions solved during the Data Structures and Algorithms course in C++ taught by the Geeks For Geeks team.
Stars: ✭ 53 (+194.44%)
Mutual labels:  tree, queue
Data Structures
This repository contains some data structures implementation in C programming language. I wrote the tutorial posts about these data structures on my personal blog site in Bengali language. If you know Bengali then visit my site
Stars: ✭ 82 (+355.56%)
Mutual labels:  tree, queue
Data Structures With Go
Data Structures with Go Language
Stars: ✭ 121 (+572.22%)
Mutual labels:  tree, queue
Buckets Js
A complete, fully tested and documented data structure library written in pure JavaScript.
Stars: ✭ 1,128 (+6166.67%)
Mutual labels:  tree, queue
cpp-code-snippets
Some useful C++ code snippets
Stars: ✭ 35 (+94.44%)
Mutual labels:  string, vector

Harbol

Introduction

Harbol is a collection of data structures and miscellaneous libraries, similar in nature to C++'s Boost, STL, and GNOME's GLib; it is meant to be a smaller and more lightweight collection of data structures, code systems, and convenience software.

Features

  • Variant type - supports any type of values and their type IDs.
  • C++-style String type.
  • Dynamic/Static Array (can be used as either a dynamic array (aka vector) or as a static fat array.)
  • Ordered Hash Table.
  • Byte Buffer.
  • Tuple type - convertible to structs, can also be packed.
  • Memory Pool - accomodates any size.
  • Object Pool - like the memory pool but for fixed size data/objects.
  • N-ary Tree.
  • JSON-like Key-Value Configuration File Parser - allows retrieving data from keys through python-style pathing.
  • Plugin Manager - designed to be wrapped around to provide an easy-to-setup plugin API and plugin SDK.
  • Fixed Size floating-point types.
  • Double Ended Queue (Deque).
  • Lexing tools for C/Golang style numbers and strings.

Future

  • C compiler/interpreter

  • reg allocator -> https://github.com/bytecodealliance/regalloc2 You have to store instructions from all basic blocks in one continuous array ^ necessary for linear scan regalloc, cause you need index -> instruction mapping

  • HTML Generator

Usage

#include "harbol.h"

int main(const int argc, char *argv[])
{
	bool result = false;
	struct HarbolString str = harbol_string_make("my initial string!", &result);
	if( !result ) {
		printf("str failed to initialize\n");
		return 1;
	}
	harbol_string_add_cstr(&str, "and another string concatenated!");
	harbol_string_clear(&str);
	
	struct HarbolArray vec = harbol_array_make(ARRAY_DEFAULT_SIZE, &result);
	if( !result ) {
		printf("vec failed to initialize\n");
		return 1;
	}
	harbol_array_insert(&vec, &( float32_t ){2.f}, sizeof(float32_t));
	harbol_array_insert(&vec, &( float32_t ){3.f}, sizeof(float32_t));
	harbol_array_insert(&vec, &( float32_t ){4.f}, sizeof(float32_t));
	const float32_t f = *( const float32_t* )(harbol_vector_get(&vec, 1));
	harbol_array_clear(&vec);
	
	struct HarbolMap *ptrmap = harbol_map_new(8);
	if( ptrmap==NULL ) {
		printf("hash table failed to initialize\n");
		return 1;
	}
	harbol_map_insert(ptrmap, "style", sizeof "style", &( float64_t ){2.3553}, sizeof(float64_t));
	harbol_map_insert(ptrmap, "border", sizeof "border", &( float64_t ){12.995}, sizeof(float64_t));
	harbol_map_free(&ptrmap);
}

Contributing

To submit a patch, first file an issue and/or present a pull request.

Help

If you need help or have any question, make an issue on the github repository. Simply drop a message or your question and you'll be reached in no time!

Installation

Requirements

C99 compliant compiler and libc implementation with stdlib.h, stdio.h, and stddef.h.

Building

To build the library, simply run make harbol_static which will make the static library version of libharbol. for a shared library version, run make harbol_shared.

To clean up the .o files, run make clean.

To build a debug version of the library, run make debug.

Testing

For testing code changes or additions, simply run make test which will build test executables within each library folder. After that, run make run_test to execute ALL compiled tests for each library component.

Running make clean WILL delete the test executables and their result outputs.

Credits

  • Kevin Yonan - main developer of Harbol.

Contact

I can be contacted at [email protected]; No soliciting or spam.

License

This project is licensed under Apache License.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].