Skip to content
This repository has been archived by the owner on Jul 14, 2024. It is now read-only.
/ exc Public archive

Extended C Libraries. Stuff that should be included in libC but for some reason isn't

License

Notifications You must be signed in to change notification settings

alsamitech/exc

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

23 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

EXC: A small library that brings features to C that it should have had in the first place.


EXMem contains basic C String and memory functions, that should be included in the standard library anyway
Functions:
  atokl: Compound String Tokenizer
  starts_with: Checks if a the first argument starts with the second argument's contents.
  read_file: returns the contetns of a file as a char*, also gives back the length of the string, so no need to waste CPU cycles on using strlen, and you're not screwed when you read a binary file.
  get_line: Allocates a string of the exact size of one line, and reads the line character by character.
  ptvec: Gets the length of a null-terminated pointer vector (see https://www.als.fyi/documentation/articles/null_term_arrays.html for more information about null-terminated vectors)
Definitions:
  ARR_FOREACH: makes a for-each loop for an arr_t
  ifrange: an if statement that executes the code within it if var is at least <least> and at most, <most>
  dotimes: Executes what's within the loop x times with y index vaiable
  s_foreach: makes a for-each loop for every character in a string, minus the null termination character at the end of the string.

EXArr:
EXArr contains basic array structures and functions.
Contetns of the arr_t struct:
struct _ArrS{
  void* arr;
  long unsigned int len;
}

Definitions:
  arr_getbylast: gets the last element in an arr_t, minus the offset (for a CString, use 1 as the offset to get the last non-null char)

Compile:
  You don't even need make to compile exc! It simply takes two commands to compile manually, or you can just use "sh build" to build the library.

Created By Sami Alameddine

About

Extended C Libraries. Stuff that should be included in libC but for some reason isn't

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published