Code review for new library

Martin VanWinkle martin.vanwinkle at
Fri Apr 30 21:22:16 UTC 2021


Here are the templates that I use for autotools style projects.  Man and
info pages are under doc, pkgconfig stuff is under lib.  Nothing has been
reviewed by somebody who has more experience than me, so I'm not sure if
I'm doing anything wrong.  For example, I'm pretty sure I should be using
the TESTS thing that autotools has, instead of always compiling the program
to test the library.

Instructions for building debian packages are in ExtraMakefile.  I don't
have spec file generation done (yet).

The templates can be filled out by this project:

By specifying the project Template dir and control file like this
--project-template-dir ...
--project-control-file ...
(They're in src/templates)
(Or, you can edit the templates by hand, or I can generate them for you)

It's been a long time since I've done anything serious with C, but I'll
definitely give your code a read through.


On Sun, Apr 25, 2021, 19:08 Joe Nelson <joe at> wrote:

> Hey all, can I get a code review on my new project?
> Backstory: I was working on some parser examples, and for one of the
> programs I needed an associative map. I got mad that there wasn't a
> library for this that worked to my liking. So I took a detour to make
> (yet another) C collection library, but one that's easy to build and
> avoids tricky macro magic or "invasive" data structure changes.
> I haven't added any documentation yet, but thought I'd check how people
> like the interface first. I tried to get inspiration from these
> libraries, and find commonality:
> * C++ STL
> * Ada 2012 containers
> * Smalltalk collection protocols
> * .NET
> * java.util
> Also consulted the Standard ML basis library, the Haskell 2010 language
> report, and Common Lisp HyperSpec. However those functional libraries
> didn't really apply.
> So far I've implemented vector (dynamic array), list (doubly linked),
> and hashmap.
> Ways you can help:
> * Is the current interface missing functions that you'd find useful?
>   Going to add a iterator for the hashmap, for one thing...
> * Are the names meaningful to you? Feel free to bikeshed.
> * See any bugs? Or even have a hunch of things I should test?
> * Can we simplify the Makefile in a totally portable way? It's very
>   repetitive.
> * The algorithms aren't fancy, but do you see obvious improvements?
>   For instance, my mergesort is recursive and could theoretically
>   hit stack limitations. Things along those lines.
> * Does the project build on your system?
> * Should the function names have a common prefix?
> My plan is to rewrite the tests more methodically, using code coverage
> to guide me in coming up with scenarios. Then write a man page for each
> function. Then have it compile a .a and .so library. Finally add
> versioning and pkg-config information, and package it up for a bunch of
> OSes.
> Thanks for your help!
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <>

More information about the Friends mailing list