Return

Libraries and tools

Here's some miscellaneous programming libraries and tools that I felt like sharing.


Libraries

Strlz - A simple dynamic string for C. Makes interacting with strings in C much less annoying.

Tools

setcmd - A command line tool that moves/resizes the CMD window.

Arrays?

I considered releasing a lazy array library similar to strlz, but unfortunately there's no very good way to make one in C. I use several different ones in my own code depending on what I want out of it, and they all have their drawbacks. Strlz on the other hand is the same one I use for everything.

Also, one of the big problems with arrays is that you want to change the type of the data pointer for each array. So an int array uses an int pointer, and float array uses a float pointer, and so on, otherwise you do not get type checking. The only way to solve this is to require you to define a new array type every time you want to store something new into an array:

typedef struct {
	int barks;
	int woofs;
} Dog;

DEFINE_ARRLZ(Arrlz_Dog, Dog)

void main (void) {
	Arrlz_Dog dogs = new_arrlz(Dog);
	
	Dog doggo = {.barks=50, .woofs=10};
	tfarr_append(&dogs, 1, &doggo);
}

That's pretty much what I do in my code. It works but it doesn't make me happy enough to want to share it.