This list is to consolidate information on basic CSV related utilities and libraries. If you know of other interesting CSV resources, code or have some tips and tricks for making the most of the CSV format, please share them.

Some useful CSV libraries:

https://github.com/rgamble/csvutils
https://github.com/rgamble/libcsv

https://github.com/wlbr/csvfix
https://github.com/dbro/csvquote

Pager with CSV support:
https://github.com/okbob/pspg

SQLLite can work with CSV.
https://www.sqlite.org/csv.html

I've accessed CSV using PERL and DBI.
https://github.com/perl5-dbi/DBD-CSV

ODBC:
The Microsoft Text ODBC Driver is standard on Windows. So it's free even if it's not Free.
https://support.microsoft.com/en-us/topic/creating-an-odbc-data-source-with-the-microsoft-text-driver-74367d5b-8a17-6310-ce15-a1c47858964a
Hopefully there are drivers for UnixODBC or iODBC. However, I couldn't find any links with a quick search.

I used a wonderful jquery plugin in one of the sites I created. It took a CSV file as input and created a HTML table that could be viewed and sorted. I was also able to add stripes (different colors to alternate rows) using CSS. For accessibility, I gave the direct link to the CSV file in the noscript tag. So, if someone did not want to run JavaScript, they could see the contents in the file rather than on screen in a web browser. Here's the jquery plugin I used:
https://web.archive.org/web/20090227064509/http://plugins.jquery.com/project/csv2table
Code for the project is available here as well:
https://github.com/toshirot/csv2table
While I have other lists that cover a variety topics, wanted one that just had useful lightweight C programs, utilities and libraries. So, I'll be repeating some links here. However, I hope to add some new projects as well. I'd also be interested in hearing suggestions that fit the criteria of lightweight, cross-platform C projects. If you're aware of any I've left off this list, please let me know.

bard
Ebook reader with text-to-speech support using SDL and flite. I have some patches for this program to improve portability and support using SDL2.
https://github.com/festvox/bard

BearSSL
Rather secure implementation of the SSL/TLS protocol. Can be used with curl.
https://bearssl.org/

cal
Command line calendar.
http://unicorn.us.com/cal.html

cDetect
C based alternative to GNU configure/autoconf. More info at IngwiePhoenix's cDetect project ( https://github.com/IngwiePhoenix/cDetect ). Plus, I've forked the project and use it with many of my builds from source code. I've added support for cross-compiling and many, many other features. Contact me if you'd like a copy.
http://cdetect.sourceforge.net/

csvutils
CSV command utilities. Uses libcsv.
https://github.com/rgamble/csvutils

curl
Command line data transfer tool.
https://curl.se/

diction and style
Analyze documents for readability and other metrics. Find grammatical issues.
https://www.gnu.org/software/diction/

diff
diff implementation for sbase. Check the follow-up mailing list threads for further patches.
https://lists.suckless.org/dev/1601/28247.html

diffh
Works with diff and creates an easy to read display of differences between files.
https://sourceforge.net/projects/diffh/

dr_libs
Single file header audio decoding libraries.
https://github.com/mackron/dr_libs

easylzma
Public domain compression and extraction library for lzma.
https://github.com/lloyd/easylzma/tree/master

fcurl
Library to simplify working with curl.
https://github.com/curl/fcurl

BSD gettext
Older BSD gettext/libintl implementation. I have a fork of this one as well. Also, check out the BSD Citrus Project.
https://www.mmnt.net/db/0/18/ftp.khstu.ru/pub/unix/distfiles

gifsicle
GIF animator utility.
http://www.lcdf.org/gifsicle/

grafx2
Graphics editor.
http://grafx2.chez.com/

BSD gzip
BSD version of the gzip compression/decompression program. There are various forks to port this to operating systems other than BSD. I have a portable fork as well.
https://github.com/NetBSD/src/tree/trunk/usr.bin/gzip

less
Less is more than more, pager program.
https://www.greenwoodsoftware.com/less/

libcsv
ANSI C library to read and write CSV files.
https://github.com/rgamble/libcsv

libgrapheme
C99 Unicode library including encoding, decoding and line-break functionality.
https://libs.suckless.org/libgrapheme/

liblzw
Library for LZW (.Z) compression/decompression.
http://freestdf.sourceforge.net/liblzw.php

libtomcrypt
Public Domain cryptography library.
https://github.com/libtom/libtomcrypt

libutf
C89 UTF-8 library which includes an API compatible with Plan 9's libutf plus a number of improvements.
https://github.com/cls/libutf

lxsplit
Command line file split/join tool.
http://lxsplit.sourceforge.net/

man
C program to view standard man pages. Now part of Elks (elkscmd/sys_utils).
https://github.com/jbruchon/elks/blob/1b6110b73fbb123021a5a29b05d8fa9caef33235/elkscmd/sys_utils/man.c
https://github.com/rofl0r/hardcore-utils/blob/master/man.c

mandoc
BSD version of man page utilities. Uses their manpage format. Includes tools to convert to manpage format used by most man tools.
http://mandoc.bsd.lv/
https://embedeo.org/ws/doc/man_windows/

minicpio
Mini cpio compression and decompression routines.
https://github.com/rayae/minicpio

minizip library
A zip library for zlib. Useful when working with files in zip format. Code is in the contrib section of zlib.
http://zlib.net/

nanosvg
Lightweight SVG library.
https://github.com/memononen/nanosvg

ncurses hexedit
Curses based hex editor.
http://www.rogoyski.com/adam/programs/hexedit/

nemini
Lightweight SDL2 based Gemini client.
https://github.com/neonmoe/nemini

BSD patch
BSD fork of the patch program. I have a fork of this as well with some portability additions to better handle carriage return/line feed issues.
https://github.com/openbsd/src/tree/master/usr.bin/patch

pdfconcat
Concatenates PDF files.
https://github.com/pts/pdfconcat

pdftxt
Convert PDF to text. Helpful for searching PDFs with grep.
https://litcave.rudi.ir/

pdlzip
Compression/decompression for lzma format compatible with the lzip data compressor.
https://www.nongnu.org/lzip/pdlzip.html

picaxo
Graphics viewer.
http://gigi.nullneuron.net/comp/picaxo/

pkgconf
Drop in replacement for pkg-config with no circular dependencies.
https://github.com/pkgconf/pkgconf

pspg
Postgres pager provides a console based pager for PostgreSQL, MySQL, CSV and other formats. Uses ncurses (or pdcurses).
https://github.com/okbob/pspg

sbase
Efficient implementations of core base utilities.
https://core.suckless.org/sbase/

shot
Command line screenshot program.
https://github.com/rr-/shot/

sox
Sound exchange utility. Converts sound formats. Plays audio files.
http://sox.sourceforge.net/

stb
Public Domain single file header libraries. Includes stb_truetype.h, a lightweight alternative to the freetype library, which can parse, decode and rasterize characters from truetype fonts.
https://github.com/nothings/stb

TinyLZMA
Minimal LZMA compressor and decompressor.
https://github.com/WangXuan95/TinyLZMA

unarr
Decompression library for rar and other formats. Part of sumatrapdf project.
https://github.com/sumatrapdfreader/sumatrapdf/tree/master/ext/unarr
Standalone version of unarr.
https://github.com/selmf/unarr

x509cert
Generate x509 certificate requests. Works with BearSSL.
https://github.com/michaelforney/x509cert
I've been looking into three different choices for a SSL/TLS library: LibreSSL, MbedTLS and BearSSL. I'd investigated SSL libraries and switched to LibreSSL in 2017: https://lmemsm.dreamwidth.org/7048.html With some Linux distributions dropping LibreSSL as their library of choice and reports of compatability issues with various applications, I felt it was a good time to reevaluate that decision.

Parts of LibreSSL are under multiple licenses including BSD style licenses.  However, there are some clauses in at least one license that are controversial when combined with GNU public licenses.  MbedTLS is available under a dual license of either Apache 2.0 or GPL 2.0.  The GNU GPL 2.0 option makes it more compatible with some GNU public licenses.  BearSSL is released under a MIT license which is typically the least problematic license of the three when it comes to using it in projects with other licenses.  Plus, BearSSL is very secure.  Many of the security issues reported for various SSL/TLS libraries typically just aren't a problem with BearSSL. The major drawback is that many applications and utilities expect an OpenSSL compatible library.  LibreSSL has typically been able to fill that role very easily.  However, as the designs between OpenSSL and LibreSSL diverge, it's going to be harder to find applications that support both without requiring more and more patching.

The curl project is notable because it offers several choices for backends. There are at least 14 to date:
https://daniel.haxx.se/blog/2019/12/11/BearSSL-is-curls-14th-tls-backend/
Plus, many other programs use libcurl.  There's also an easy interface for adding libcurl functionality to a program should a C/C++ programmer want libcurl functionality:
https://github.com/curl/fcurl  
So, some of the issues with finding a SSL library that is supported can be overcome by using programs that instead support curl as a backend.  As an example, Netrider's wkccc web library works with libcurl. So does vorbistools.

Many SSL libraries also provide a cryptographic library.  However, some projects only supply cryptographic support.  Of the various cryptographic libraries, I've been using LibTomCrypt https://github.com/libtom/LibTomCrypt which is public domain.  Interestingly enough, NaCl is also in the public domain.  Might be worth investigating if there is any functionality in it that is not yet available in LibTomCrypt. I've written my own checksum utilities including md5sum, sha256sum, sha512sum and a base64 program.  I used LibTomCrypt as the backend for these utilities to provide the hash functionality. There are several implementations of hash functions available in the public domain or with a variety of licenses. There was no reason to reinvent the wheel yet again and create a new hash implementation. Plus, LibTomCrypt has a nice API that will let you easily switch between hash functions if you want to write your own all-in-one checksum utilities similar to a BusyBox or ToyBox implementation. Even libraries like musl borrowed from some of the public domain code from libraries such as LibTomCrypt instead of creating something completely from scratch.

I'd like to minimize the number of SSL and cryptographic libraries on my system without losing too much functionality.  I'd rather not have to pick and choose building some programs with one SSL library and some with another just because of licensing issues.  So, the trick will be finding enough useful programs that will work with whichever SSL library I end up with.

There's a library for working with Keepass compatible files called libkpass which is used by the program ckpass.  It has GNU GPLv3 licensing and currently uses nettle.  I'm trying to see if LibTomCrypt or one of the other SSL crypto libraries will work as alternative to nettle. Using nettle and GnuTLS is another option for SSL/TLS support. However, I'd prefer to avoid that option if possible or it will bring GPL license considerations into every application, not just those that already use the GPL license.

My main issue is making sure curl will build because it is such a useful program and library. The dependencies I currently have for building curl currently include c-ares, libssh2 and nghttp2. Curl uses a SSL/TLS library of some kind, but, as mentioned, there are several choices available.

libssh2 requires a cryptographic library.  It has support for the cryptographic libraries that are part of the LibreSSL and MbedTLS projects.  However, there's no direct support for BearSSL.  I'm looking into how difficult it would be to add LibTomCrypt as a backend since I'm already using it with other utilities.

nghttp2 may need a SSL library as well.  It has options to use OpenSSL (or LibreSSL) and it needs c-ares (another curl dependency).

I didn't notice any SSL or cryptographic requirements with c-ares, but I've been having other issues with it. One platform I build programs on is Windows and I prefer to keep the programs backward compatible with older versions of Windows so they can be built with a compiler from the original MinGW project and so that they will run on systems like ReactOS. Every time I build a new version of c-ares, I'm finding it less and less compatible with older versions of Windows. The latest version of c-ares requires at least a Windows Vista system and I'm still attempting to be backward compatible with Windows XP systems. A couple of alternatives, patch around the functionality that's not available on older systems or switch to using a POSIX compatible layer underneath like Cygwin does. That latter approach would avoid the constantly changing Win32 API completely. I have been checking into creating a POSIX compatible socket library and did a lot of work on it at one point. However, some libraries and programs would still require a lot of patching to switch Windows builds to using it over the Win32 API because they assume if it's a Windows platform it must use the Win32 API.

I rebuilt curl last year without too many issues. However, trying to update to the most recent libraries and programs needed to build curl has become a mess of dependencies and backward compatibility issues without a clear resolution in sight. So, it's basically a work in progress.

Building curl successfully is one piece of the decision making process when choosing a SSL library but there are other factors. Not all programs use libcurl for SSL support. Some use a SSL library directly and will need to lose SSL capabilities or be modified to use another library or libcurl if their dependency needs can't be met. Tools from SSL libraries are often needed to set up certificates on a system. Cryptographic libraries may be needed for signing shared messages or files and for checking security of signed information.

Michael Forney has done a lot of work adding compatibility with BearSSL to software used in Oasis Linux.  His list of BearSSL compatible programs is here:
https://github.com/oasislinux/oasis/issues/14
He's also written libtls on top of BearSSL to help with some of the compatibility issues. I have not attempted porting libtls to non-POSIX platforms, but it doesn't look like a quick option.

Michael Forney has written a tool to help generate X509 certificates and certificate requests:
https://github.com/michaelforney/x509cert
This functionality is something that OpenSSL and LibreSSL already provide.  There may be code available to provide this type of functionality for MbedTLS, but I haven't found it yet.  The x509cert program does port to non-Posix platforms like Windows with a little patching.  LibTomCrypt added some X509 support, so it might be interesting to see if a tool could be created that worked with that library.

SSL libraries are used most often with browser programs. As mentioned, netrider uses curl, so that won't be as big of an issue. The other browsers I like to build from source are lynx, D+ (a more portable fork of Dillo) and possibly links. The lynx browser is a text based browser. I find it very useful when checking the accessibility of web sites. If it looks okay in lynx, odds are, it will be okay in most browsers and accessible to some screen readers. It is useful to have some basic graphical support in browsers without requiring the latest browser engine implementation with all the newest HTML, CSS and scripting features. Links is very similar to lynx but adds some basic graphics capabilities. There's a fork that uses SDL as a backend, so graphics could be viewable in framebuffer mode outside of X and Wayland on Linux systems. D+ and Dillo are lightweight GUI based browsers that use FLTK. FLTK is one of the lighter GUI frameworks still available and actively developed. I like to use diffh in conjunction with the diff utility. The output of diffh is HTML. Unfortunately, I've yet to find a text browser that renders the output well (even when the content is all text). D+ offers a lightweight solution without requiring a high-powered browser on the system. Dillo is more updated and better supported, but the project has never been open to cross-platform portability. So, D+ which works in a variety of environments including FreeDOS seems like a better choice for my purposes.

There are issues when using certain types of licenses together in a project. The LibreSSL and original OpenSSL licenses are not compatible with GNU Public Licenses due to conflicting restrictions in one of the license clauses. There are BSD style licenses with clauses ranging from 0 to 4 or more. BSD style licenses with 4 or more clauses typically become an issue with compatibility if you want to work with projects that use the GPL. There are issues with some versions of Apache licenses combined with some versions of GNU licenses. The Apache 2 license now used by OpenSSL fixed a lot of that but there are still conflicts between the GNU GPLv2 license and the Apache 2 license. I tend to prefer less strict licenses so I often opt for GNU GPLv2 applications over GPLv3 applications. The Linux kernel remains GNU GPLv2 as well. So, any decision on SSL libraries not only needs to take into account which libraries are easiest to build projects with but also which libraries are legally compatible when used.

The lynx license is GPLv2.  It will probably never be updated to GPLv3 or later because many of the original contributors can't be contacted to get approval for the license change. I don't see any linking exceptions for lynx in the current documentation.  The Apache 2 license that OpenSSL uses may be an issue with GNU GPLv2 programs like lynx.  However, lynx shows that support has been added for OpenSSL, LibreSSL and gnutls in some of the comments. I assume, since the code includes mention of these libraries, the developer(s) are okay with use of OpenSSL or LibreSSL being linked to the lynx code. Links, on the other hand, uses GPLv2 or later, so doesn't run into some of the issues of programs that only support GPLv2.

Dillo, which is currently licensed GPLv3, had a linking exception for OpenSSL at one point.  I thought it had added LibreSSL as an exception as well, but current versions no longer have any license exception clause and no longer mention OpenSSL as an exception.  This is probably due to the fact that they assume use of a later version of OpenSSL with the newer Apache 2 license. That license is compatible with GPLv3. D+ had support for OpenSSL and experimental support for cyassl (now available as WolfSSL).  There was an exception for OpenSSL but not for LibreSSL.  Unfortunately, there's no way to contact the author and find out if an exception can be added for LibreSSL. The program could be built without SSL support. It's really not necessary just to view the output of diffh. It would be interesting to see what it would take to add BearSSL support though since there is no issue between licenses.

That covers some of the browsers options. There are other programs and libraries I typically use or need as dependencies when building applications that require SSL/TLS and/or cryptographic support. With many of the cases, it might not be intuitive to consider they'd even need it. Yet, many do require it. In some situations, you can avoid the issue and just leave the needed functionality out. In others, the libraries or programs are designed not to build without the dependency.

LibArchive has an optional dependency of a cryptographic library and offers support for OpenSSL/LibreSSL and Nettle. LibArchive and LibreSSL are both BSD projects created to replace other popular projects. So, it would be natural to assume that LibArchive would function well with LibreSSL. Support for using LibreSSL is probably going to be better than OpenSSL in this one particular case.

PostgreSQL requires OpenSSL. I've built it with LibreSSL and, so far, compatibility with that seems fine. I did not see options for other SSL/TLS libraries. Some other Linux distributions may provide patches that offer other options.

Vorbistools uses the curl library.  Opusfile requires OpenSSL (or LibreSSL).  It won't build without the dependency. There are two libraries that opusfile creates, libopusfile and libopusurl.  The libopusurl library needs the OpenSSL dependency.  Luckily, many programs only link with libopusfile which doesn't list OpenSSL as a dependency.

Fossil is one of the simpler version control systems to build from source code. It optionally uses OpenSSL (or LibreSSL) if SSL support is desired.

The picaxo program is a lightweight SDL based graphics viewer. It can also display graphics at a URL location. It uses sockets directly and doesn't appear to support SSL/TLS options.  The sdl_net library also appears to use sockets directly.

I haven't looked into email clients recently, but this is another area where a SSL/TLS library will be an important factor. My preference is to use Sylpheed for email, but the builds are older and I've been having trouble with certificates of late. I'd prefer to use a different GUI library if I'm going to build my email client from scratch. Building with a fork of GTK+ that offers a ncurses backend might also be an interesting option.

There are several email options using the lighter FLTK GUI framework. flmail and hermail are both FLTK based options. I believe hermail is no longer available from Sourceforge. I still have the source somewhere. flmail is part of the NanoLinux distribution at Sourceforge. PostOffice is an old FLTK email client. I was able to get it to build from source with later versions of FLTK after some patching. The user interface works to some extent, but the mail code probably needs extensive updating. It does have a nice interface with 3 panes comparable to email clients such as Sylpheed. It would be nice to use a project like this as a front end to a more modern command line only email client.

One text based email option I like is alpine. There are several forks of it including realpine, so I'd need to look into which is the most useful to start with. Originally, alpine licensing was an issue. That was one reason the GNU based nano project was created to replace pico. The latest alpine version at https://repo.or.cz/alpine.git has an Apache 2 license. It also lists openssl and libressl in its directory tree so OpenSSL and LibreSSL appear to be the valid options for SSL/TLS support.

If there are other lightweight, cross-platform portable email client suggestions, I'd be very interesting in hearing about them.

Cryptographic libraries are also used with many signing programs to make sure messages and files are authentic. Some of the smaller Linux distributions I've looked at are adding features to sign their archives and ensure they're legitimate. I recently checked into lightweight software options that can be used for this purpose in place of programs like GnuPG. I ran across several solutions. Most used Ed25519. Many BSD systems use signify. There are various ports of signify to Linux. They typically need some kind of BSD compatibility library. I ran across asignify which uses TweetNaCl and was inspired by signify. I also found minisign which uses libsodium and is maintained by the libsodium developer. The lightest option I've found to date is usign. It includes the cryptographic code. It's lightweight enough that I was able to port it to non-POSIX platforms without much issue. Since LibTomCrypt or some of the SSL libraries offer cryptographic support for Ed25519, another good option might be to write something specifically using one of them as a backend. That would cut down the number of cryptographic algorithm implementations on the system that would need to be supported and maintained. If anyone else is investigating this sort of thing, I'd appreciate hearing how you plan to approach the issue of signing information and/or packages.

The other place tools from a cryptographic library are needed is with certificates. I've covered certificate requests, but certificates need to be installed for programs like curl, a web browser or email client in order to work properly. I'm not familiar with how most Linux Distributions create their certificates packages, but Linux From Scratch gives an interesting glimpse on one way to do so with their make-ca program:
https://www.linuxfromscratch.org/blfs/view/svn/postlfs/make-ca.html
I did contact one distribution that was using BearSSL and asked how certificates were handled. In that case, the bundle from the curl web site was used. I do like the LFS method of creating a certificate package including a certificate bundle. One nice thing is that I can easily add some custom certificates if I need them behind a firewall. I currently use a simplified version of the make-ca process to create my own certificate package for the systems I build programs on. The make-ca script calls the openssl program. Some of the utility calls in the make-ca script are just doing base64 encoding. So, any base64 program with equivalent functionality could be used in place of calling openssl. However, there are other cases where specific openssl functionality is called. I've yet to find replacements for that or other ways to simplify the make-ca process to avoid it. So, for now, the process requires OpenSSL or LibreSSL in order to work. I would be very interested to hear how other distributions (besides LFS) create their certificate packages and what tools they use to do so.

I had hoped the process to switch completely to BearSSL would be a simple one especially since curl added support for it. However, reviewing the programs I like to work with, there are several that would require patching, losing SSL/TLS support or just wouldn't work with the switch. It does appear to be the most secure option at this point. LibreSSL works with all the libraries and programs I currently build, but there may be licensing issues in some cases. Also, support for LibreSSL may or may not be available in future updates of the software. Continuing to use LibreSSL requires less work at present, but may not be the best decision moving forward. MbedTLS is an interesting option. The dual license covers the situation of using it with GPL and non-GPL programs. It's used by ReactOS, so it currently has decent support for older versions of Windows. Other than curl and some of its dependencies, there aren't a lot of programs out there designed to use it though. There aren't a lot of tools to use with it either such as for dealing with certificates. I'm still investigating the various alternatives and their pros and cons. I'd really prefer to not have to work with multiple SSL/TLS libraries on my system. The choice may just come down to what will allow the most applications to build successfully.

It has recently come to my attention that MbedTLS 2.17 and greater will no longer be available under a GNU GPL license. This causes license conflicts with GNU GPLv2 licensed software. This change pretty much rules out using MbedTLS as a useful option for me at this point.

I'd be very interested to hear from others who build their programs from source or who work with small operating system distributions or packaging of libraries and programs as to what their choices are in this area. Possibly if enough small projects banded together, good support for a less popular library could be created. If anyone's interested in that or knows of projects that are interested, please pass that information on to me. I believe in the principle of security through obscurity. So, going off the beaten path and using a less well-known SSL library may have a very good overall benefit.

FLOSS Finds

Nov. 1st, 2021 11:44 am
This is a list of some of the interesting FLOSS related C/C++ libraries and programs I've been finding more recently that may not fit under other categories in my software lists. As usual, I prefer cross-platform options that work on a variety of platforms.

Cross-platform screenshot program and library:
https://github.com/rr-/shot/

I've run across some interesting games that I've never bothered to try to build or had to build without the sound because they use a non-Free audio library. FLESSD replaces that option with a compatible API.
https://github.com/darealshinji/flessd

I typically avoid GTK+ libraries. I even removed references to any GTK+ libraries in my forked version of sdcv. However, this looks like an interesting alternative if you're stuck with a program that requires functionality from glib:
https://github.com/iglunix/glibr

Know of some other useful libraries or programs that might aid in building or porting software? Have other FLOSS suggestions? Please let me know about them.
Machine learning and deep learning have become very popular. Unfortunately for C/C++ developers, most of the tools for these fields are written in other languages even though many of the core libraries are still written in C/C++. This list tries to track what FLOSS libraries and resources are available in the field that C/C++ developers can work with.

The list is by no means comprehensive and really doesn't offer that many options. So, if you have other suggestions for machine learning C/C++ source code, please let me know.

One thing desperately needed by some projects is a decent FLOSS speech-to-text recognizer. Some suggestions are included below but other options, especially compact ones that will work with mobile devices as well as standard desktop computers would be very useful. I've also included a list of FLOSS text-to-speech programs.


C resources:

https://pjreddie.com/darknet/
Darknet is an open source neural network framework written in C and CUDA.

https://github.com/yui0/catseye
Neural network library.

https://github.com/liuliu/ccv
http://libccv.org
C-based/Cached/Core Computer Vision Library

https://github.com/alrevuelta/cONNXr
A onnx runtime written in pure C99 with zero dependencies focused on embedded devices.

https://github.com/100/Cranium
Portable, header-only, artificial neural network library written in C99.

https://github.com/jeffheaton/encog-c
Encog machine learning framework port to C/C++ for experimentation with CUDA.

http://leenissen.dk/fann/wp/
FANN, Fast Artificial Neural Network Library, is a free open source neural network library which implements multilayer artificial neural networks in C with support for both fully connected and sparsely connected networks.

https://github.com/codeplea/genann
Genann is a minimal, well-tested library for training and using feed-forward artificial neural networks (ANN) in C.

https://github.com/attractivechaos/kann
KANN is a standalone and lightweight library in C for constructing and training small to medium artificial neural networks such as multi-layer perceptrons, convolutional neural networks and recurrent neural networks (including LSTM and GRU).

https://github.com/jppbsi/LibDEEP
LibDEEP is a deep learning library developed in C language for the development of AI techniques.

https://github.com/karpathy/llama2.c
Inference Llama 2 in one file of pure C.

https://github.com/fomichev/llm.c
Large language model in C. GPT-2 inference implementation in pure C.

https://github.com/GHamrouni/LocusCode
LocusCode allows you to perform similarity search on web scale datasets using C.

https://github.com/siavashserver/neonrvm
neonrvm is an Open Source machine learning library written in C for performing regression tasks using RVM technique.

https://github.com/GHamrouni/Recommender
A C library for product recommendations/suggestions using collaborative filtering (CF).

https://github.com/xiph/rnnoise
Recurrent neural network for audio noise reduction and suppression written in C.

https://github.com/LuisWohlers/simpleCnet
SimpleCNet is a simple single-header header-only library for neural networks written in C (C89). Training is accomplished using backpropagation.

https://github.com/symisc/sod
An Embedded Computer Vision & Machine Learning Library that is CPU Optimized & IoT Capable.

https://github.com/glouw/tinn
Tinn (Tiny Neural Network) is a 200 line dependency free neural network library written in C99.

https://github.com/Imetomi/TinY-ANN
TinY ANN is a simple library to create neural networks in C for smaller data science projects.

https://www.vlfeat.org/
The VLFeat open source library implements popular computer vision algorithms specializing in image understanding and local features extraction and matching. Algorithms include Fisher Vector, VLAD, SIFT, MSER, k-means, hierarchical k-means, agglomerative information bottleneck, SLIC superpixels, quick shift superpixels, large scale SVM training and many others. It is written in C for efficiency and compatibility with interfaces in MATLAB for ease of use.

https://igraph.org/c/
Igraph is a C library for creating, manipulating and analysing graphs. It is intended to be as powerful and fast as possible to enable working with large graphs.

http://htk.eng.cam.ac.uk/
Hidden Markov Model Toolkit (HTK) is a portable toolkit for building and manipulating hidden Markov models. HTK is primarily used for speech recognition research although it has been used for numerous other applications including research into speech synthesis, character recognition and DNA sequencing. HTK is in use at hundreds of sites worldwide.
HTK consists of a set of library modules and tools available in C source form. Source available but license is not listed at OSI.


C++ resources:

https://opencv.org/
OpenCV is a C++ library of programming functions mainly aimed at real-time computer vision.

https://aogmaneo.handmade.network/
AOgmaNeo is a machine learning system in C++.

https://github.com/iVishalr/cDNN
cDNN is a deep Learning Library written in C which provides functions that can be used to create artificial neural networks (ANN).

https://github.com/dmlc/cxxnet
CXXNET is a fast, concise, distributed deep learning framework in C++.

https://code.google.com/archive/p/cuda-convnet/
High-performance C++/CUDA implementation of convolutional neural networks.

https://github.com/jolibrain/deepdetect
DeepDetect is a machine learning API and server written in C++11.

http://dlib.net/
Dlib is a modern C++ toolkit containing machine learning algorithms and tools for creating complex software in C++ to solve real world problems.

http://eblearn.sourceforge.net/
Eblearn is an object-oriented C++ library that implements various machine learning models.

https://github.com/FidoProject/Fido
Fido is an lightweight, highly modular C++ machine learning library for embedded electronics and robotics.

https://github.com/nickgillian/grt
The Gesture Recognition Toolkit (GRT) is a cross-platform, Open Source, C++ machine learning library designed for real-time gesture recognition.

https://github.com/tboox/hnr
hnr is an off-line handwritten numeral recognition system written in C++.

https://github.com/mosdeo/LKYDeepNN
Low dependency (using C++11 and STL only), portable, header-only, deep neural networks for embedded systems.

https://github.com/ggerganov/llama.cpp
Port of Facebook's LLaMA model in C/C++.

https://www.mlpack.org/
MLpack is a fast, flexible machine learning library written in C++ that aims to provide extensible implementations of cutting-edge machine learning algorithms.

https://github.com/CMU-Perceptual-Computing-Lab/openpose
OpenPose is real-time multi-person keypoint C++ detection library for body, face, hands and foot estimation.

http://image.diku.dk/shark/sphinx_pages/build/html/index.html
SHARK is a fast, modular, feature-rich open-source C++ machine learning library.

https://github.com/Tyill/skynet
Skynet is a neural network library written from scratch in C++ using only STL and OpenBLAS for calculation.

https://github.com/tensor-compiler/taco
Tensor algebra compiler in C++.

https://github.com/LanguageMachines/timbl/
TiMBL implements several memory-based learning algorithms using C++.

https://github.com/tiny-dnn/tiny-dnn
Header only, dependency-free deep learning framework in C++14.

https://github.com/aksnzhy/xlearn
xLearn is a high performance, easy-to-use, and scalable machine learning package written in C++ that contains linear model (LR), factorization machines (FM), and field-aware factorization machines (FFM), all of which can be used to solve large-scale machine learning problems.

https://github.com/google/XNNPACK
XNNPACK is a highly optimized library of floating-point neural network inference operators written in C/C++ for ARM, WebAssembly, and x86 platforms. It provides low-level performance primitives for accelerating high-level machine learning frameworks


Tensorflow related:

https://github.com/tensorflow/tensorflow
An Open Source Machine Learning Framework in C++ for everyone.

https://github.com/google/mediapipe
MediaPipe is the simplest way for researchers and developers to build world-class ML solutions and applications for mobile, desktop/cloud, web and IoT devices.MediaPipe on the Web is an effort to run the same ML solutions built for mobile and desktop also in web browsers. C++

https://github.com/terryky/tflite_gles_app
GPU accelerated deep learning inference applications using TensorflowLite GPUDelegate/TensorRT and C.

https://github.com/uTensor/uTensor
TinyML AI inference library for C++11.


Open Source Speech-to-Text resources:

https://github.com/cmusphinx/pocketsphinx
PocketSphinx is one of Carnegie Mellon University's open source large vocabulary, speaker-independent continuous speech recognition engines written mainly in C.
https://github.com/cmusphinx/sphinxbase
Basic libraries shared by the CMU Sphinx trainer and all the Sphinx decoders (Sphinx-II, Sphinx-III, and PocketSphinx) written in C.
https://sourceforge.net/projects/cmusphinx/files/sphinx2/
CMU Sphinx 2 is a speaker-independent large vocabulary continuous speech recognizer written in C and released under BSD style license.

https://github.com/kaldi-asr/kaldi
Kaldi is a toolkit for speech recognition, intended for use by speech recognition researchers and professionals written in C++.

https://github.com/julius-speech/julius
Open Source large vocabulary continuous speech recognition engine written in C.

https://github.com/arthurv/srec
Fork of Android's speech recognition engine in C. From Android 4.1 aka Jelly Bean.

https://github.com/mozilla/DeepSpeech/tree/master/native_client
DeepSpeech from Mozilla (uses tensorflow). Written in C++.

https://github.com/nyumaya/nyumaya_audio_recognition_lib
C/C++ audio recognition library using tensorflow.

https://github.com/ggerganov/whisper.cpp
OpenAI's Whisper model in C/C++.


Open Source Text-to-Speech resources:

http://www.festvox.org/flite/index.html
CMU Flite (festival-lite) is a small, fast run-time open source text to speech synthesis engine developed at CMU and primarily designed for small embedded machines and/or large servers. Flite is designed as an alternative text to speech synthesis engine to Festival for voices built using the FestVox suite of voice building tools. C only, very portable source. (See also Festival.)

http://espeak.sourceforge.net/
eSpeak is a compact Open Source speech synthesizer for English and other languages written in C.

https://github.com/espeak-ng/espeak-ng
eSpeak NG is a compact Open Source speech synthesizer that supports more than hundred languages and accents. It is written in C.

https://github.com/MycroftAI/mimic
Mycroft's TTS engine, based on CMU's Flite (Festival Lite) in C.

https://github.com/robotology/speech
Speech synthesis and speech recognition programs including PicoTTS.

https://github.com/gmn/nanotts
NanoTTS is a command line speech synthesizer that improves on pico2wave, part of SVOX PicoTTS.

https://github.com/syoyo/tacotron-tts-cpp
Tacotron text to speech in C++ (synthesize only). Uses tensorflow.
Below is a list of code that is in the public domain or available under CC0 or unlicense or 0BSD terms.

The MinGW win32 API headers and mingw runtime library were originally released to the public domain. Although the mingw.org project prefers to differentiate itself from mingw64, the developers have followed the mingw64 project's example and licensed later versions of the w32api and mingwrt. I contacted the mingw.org project to ask if they would consider dual licensing using their current license and CC0, but they refused. It was at that point that I left the MinGW project. Needing to distribute license information with every program I build with my C/C++ compilers did not seem like a worthwhile trade-off. The last public domain version of w32api is w32api-3.17-2-mingw32-src.tar.lzma. The last version of mingwrt with some public domain code is mingwrt-3.20-2-mingw32-src.tar.lzma.

I am currently maintaining a version of w32api based on the last public domain version available. I have added some patches that never made it in to either mingw or mingw64. While it's not fully up-to-date with all the changes in the latest versions of Windows, it does support enough compatibility to be able to build several Open Source libraries on Windows. I also intend to keep backward compatibility with older versions of Windows for as long as can. I hope to replace the mingwrt library with something far more portable that includes support for some POSIX and C11 features. I already have bits and pieces coded from scratch including C11 and POSIX threading libraries. One of the purposes of this list is to find public domain source that might be useful to add to a C runtime library.

If you have recommendations for public domain/Unlicense/CC0 C/C++ functions, libraries and programs that I have missed, please let me know. Also feel free to contact me about my work maintaining the public domain version of w32api or my project to replace the mingwrt. You can contact me via the CppDesign mailing list or e-mail me: http://www.distasis.com/connect.htm

Public domain C runtime libraries:
PDCLib
http://pdclib.e43.eu/
Original Public Domain C library
https://sourceforge.net/projects/pdclib/
https://sourceforge.net/projects/pdos/
Another fork of PDCLib
https://github.com/DevSolar/pdclib
libc11
https://github.com/dryc/libc11
Eltanin-OS simia
https://github.com/eltanin-os/simia

dlmalloc - Doug Lea's memory allocator
http://gee.cs.oswego.edu/

SQLite database - includes sprintf code
https://www.sqlite.org/index.html

LibTom projects - cryptography and math libraries
https://github.com/libtom

strftime
https://github.com/arnoldrobbins/strftime

tz
https://github.com/eggert/tz

whereami
https://github.com/gpakosz/whereami

minlib - regexp and other small libraries
https://github.com/ccxvii/minilibs

tiny-regex-c
https://github.com/kokke/tiny-regex-c

tiny-regex
https://github.com/matp/tiny-regex

getline
https://github.com/ChristopherWilks/megadepth/blob/master/getline.c

getline
https://github.com/arnavyc/getdelim

getline
https://github.com/digilus/getline

getline
https://github.com/ivanrad/getline

getopt
https://github.com/skeeto/getopt

parg
https://github.com/jibsen/parg

sdbm (ndbm clone), basic regex, glob, also links to prolog and yacc
http://www.cse.yorku.ca/~oz/

Base64 encode/decode:

base64
https://www.fourmilab.ch/webtools/base64/

Race64
https://github.com/skeeto/race64

Compression:

miniz - zlib compression
https://code.google.com/archive/p/miniz/

zip - portable zip library based on miniz
https://github.com/kuba--/zip

liblzw - Compression/decompression library for LZW files with API comparable to zlib and libbzip2. LZW is used by UNIX compress/decompress programs which work with files with a .Z extension. I use this library with BSD gzip.
https://github.com/vapier/liblzw

ncompress - LZW compression/decompression tools
https://github.com/vapier/ncompress

unzoo - zoo unarchiver
http://freshmeat.sourceforge.net/projects/unzoo/

stdarc - compressors/decompressors collection
https://github.com/r-lyeh/stdarc.c

mousetar
https://pkgs.org/download/mousetar

dxTarRead - non-compressing archive file reader
https://github.com/DeXP/dxTarRead

Cryptography:

NaCl - crypto library
https://nacl.cr.yp.to/

TweetNaCl - crypto library
http://tweetnacl.cr.yp.to/software.html

Monocypher - crypto library
https://monocypher.org/

Kripto
https://github.com/rofl0r/kripto

WjCryptLib
https://github.com/WaterJuice/WjCryptLib

Crypto++ - Individual files are public domain
https://www.cryptopp.com/

tiny-AES-c
https://github.com/kokke/tiny-AES-c

retter
https://github.com/MaciejCzyzewski/retter

blasha1
https://github.com/FRex/blasha1

Random Number Generators:

pseudo random number generator and other files
https://github.com/Marc-B-Reynolds/Stand-alone-junk/tree/master/src/SFH
http://marc-b-reynolds.github.io/shf/2016/04/19/prns.html

UTF-8:

utf8 string functions
https://github.com/sheredom/utf8.h

Console:

pd_readline
https://github.com/mooseman/pd_readline

INI reader
https://github.com/seb-jones/simple-ini-reader

terminfo parser
https://github.com/agauniyal/termdb

library for drawing colors on terminals
https://github.com/agauniyal/rang

snore
https://github.com/FRex/snore

GUIs:

Nuklear - immediate mode GUI
https://github.com/Immediate-Mode-UI/Nuklear
https://github.com/vurtun/nuklear

D-Flat - graphics libbrary published in Dr. Dobb's Journal
https://github.com/mooseman/D-Flat

Turbo Vision
http://tvision.sourceforge.net/

wtk - cross-platform immediate mode GUI library
https://github.com/origamicomet/wtk

Vogle - graphics library
https://github.com/mooseman/Vogle

Math libraries:

FGMP - public domain implementation of a subset of the GNU gmp library with the same API
https://github.com/dad98253/fgmp

C++ Big Integer Library
https://mattmccutchen.net/bigint/

tiny-bignum-c
https://github.com/kokke/tiny-bignum-c

triglib
https://github.com/richgel999/triglib

meow_fft
https://github.com/JodiTheTigger/meow_fft

FFT library
https://github.com/wareya/fft

Communications:

irc library
https://github.com/domsson/libtwirc

irc client
https://git.janouch.name/p/uirc3/

nanoircd IRC server
https://github.com/joric/nanoircd

youtube-dl
http://ytdl-org.github.io/youtube-dl/about.html

streams federated communications server
https://codeberg.org/streams/streams

Programs and utilities:

pdksh
https://directory.fsf.org/wiki/Pdksh

es - extensible shell
http://wryun.github.io/es-shell/

byacc - Berkeley Yacc
https://invisible-island.net/byacc/byacc.html

miniAWK
https://github.com/mooseman/miniAWK

pdcore - public domain core utilities
https://github.com/mooseman/pdcore

pdutils - public domain utilities
https://github.com/mooseman/pdutils

unidiff - unified diff conversion
https://github.com/AceHusky12/unidiff

make
https://github.com/mumu3w/MINIX1x_OLD/tree/master/minix1.3_tc2_tasm/commands/make

touch utility
http://roy.orz.hm/svn/filedetails.php?repname=rtoss&path=%2Ftouch%2Ftouch.c

md5sum utility plus other CC0 utilities at the site:
http://myc01.free.fr/md5sum/

ripgrep - recursively searches directories for a regex pattern
https://github.com/BurntSushi/ripgrep/

pstree
https://github.com/janmojzis/pstree

xd - hex dump tool
https://www.ttgurney.com/xd.c

sc - spreadsheet calculator
http://www.ibiblio.org/pub/Linux/apps/financial/spreadsheet/!INDEX.html

scientific calculator
https://github.com/MostafaMahmoudAbdelrahman/scientific-calculator

cron and crontab
https://github.com/somnisoft/cron

tinyssh - ssh server
https://github.com/janmojzis/tinyssh

curvevpn
https://github.com/janmojzis/curvevpn

smtp-client
https://github.com/somnisoft/smtp-client

POP3 + SMTP server
https://github.com/skeeto/minimail

Epoch - Linux init system
https://universe2.us/epoch.html

sunrise and sunset
https://github.com/troglobit/sun

perpetual calendar
https://github.com/randruc/PerpetualCalendar

Virtual Machine
https://github.com/wasmite/wasabi

Hedley - compiler compatibility project
https://nemequ.github.io/hedley/

subc - compiler for a subset of the C language
http://www.t3x.org/subc/

BDS C - 8080/Z80 C Compiler
https://www.bdsoft.com/resources/bdsc.html

microprofile - profiler
https://github.com/jonasmr/microprofile

mpkg - package manager
http://charon.persephoneslair.org/~andrea/software/mpkg/

Games:

nbsdgames
https://github.com/untakenstupidnick/nbsdgames

Connect Four
https://github.com/skeeto/connect4

tile-solver
https://github.com/skeeto/tile-solver

flappy bird
https://github.com/skeeto/flappy

anarch
https://gitlab.com/drummyfish/anarch

kiki
https://sourceforge.net/projects/kiki/

Diamond Trust
http://hcsoftware.hg.sourceforge.net/hgweb/hcsoftware/DiamondTrust/

Behacked - bejeweled clone
https://github.com/Pentachoron-Labs/Behacked

Personal assistant:

Oracle - siri/alexa/google-assistant like chatbot
https://github.com/TheShoutingParrot/Oracle

Various projects
https://github.com/mooseman
https://github.com/mooseman/mooseman_stuff

Small and single file libraries:

image, sound, sprintf, Truetype font and other code
https://github.com/nothings/stb

public domain single file libraries
https://github.com/mackron/dr_libs

cute headers
https://github.com/RandyGaul/cute_headers

foundation library
https://github.com/mjansson/foundation_lib

single file public domain libraries
https://github.com/gingerBill/gb

single file public domain libraries
https://github.com/haunticaachris/htc

single file public domain libraries
https://github.com/mattiasgustavsson/libs

single file libraries in the public domain
https://github.com/to-miz/tm

stb inspired libraries
https://github.com/AfroDave/kj

single header libraries
https://github.com/Cyphre117/header-libraries

single header library for CLI
https://github.com/ronen25/libcmdf

tiny bits and useful snippets
https://github.com/r-lyeh/tinybits

public domain single file libraries
https://github.com/kieselsteini/sts

CLM_LIBS - useful code and macros
https://github.com/CarlosLunaMota/CLM_LIBS

vlib - single file header libraries for C
https://github.com/vktec/vlib

ZPL - your (almost) C99 Powerkit
https://github.com/zpl-c/zpl

FYS
https://github.com/germinolegrand/fys

portable public domain code snippets
https://github.com/nemequ/portable-snippets

code snippets and header-only files
https://github.com/DanielGibson/Snippets/

json parser
https://github.com/sheredom/json.h

Database:

tinycdb
http://www.corpit.ru/mjt/tinycdb.html

Lexical analysis:

re2c
https://re2c.org/

Data structures:

avl tree
https://github.com/etherealvisage/avl

avl tree
https://github.com/ebiggers/avl_tree

nbds - Non-blocking data structures
https://code.google.com/archive/p/nbds/

sack
https://github.com/FRex/sack

Editor:

kakoune - code editor
https://github.com/mawww/kakoune

Audio:

libmodplug
https://github.com/Konstanty/libmodplug

miniaudio
https://github.com/dr-soft/miniaudio

tonic
https://github.com/TonicAudio/Tonic

mp3_id3_tags
https://github.com/Arcxm/mp3_id3_tags

rsynth - text-to-speech system
http://www.speech.cs.cmu.edu/comp.speech/Section5/Synth/rsynth.html

voclib - vocoder
https://github.com/blastbay/voclib

Graphics:

gif-h
https://github.com/charlietangora/gif-h

gifdec
https://github.com/lecram/gifdec

gifenc
https://github.com/lecram/gifenc

gif-load
https://github.com/hidefromkgb/gif_load

GIF Writer
https://www.jonolick.com/home/gif-writer

jpeg-compressor
https://github.com/richgel999/jpeg-compressor

TinyJPEG
https://github.com/serge-rgb/TinyJPEG/

picojpeg
https://github.com/richgel999/picojpeg

analyzepng
https://github.com/FRex/analyzepng

topng
https://github.com/FRex/topng

binarypic
https://github.com/FRex/binarypic

libplum
https://github.com/aaaaaa123456789/libplum

miniexr
https://github.com/aras-p/miniexr

MPEG video writer
https://www.jonolick.com/home/mpeg-video-writer

gameswf
http://tulrich.com/textweb.pl?path=geekstuff/gameswf.txt

PDFGen
https://github.com/AndreRenaud/PDFGen

libqrgen
https://github.com/aaaaaa123456789/libqrgen

public domain single file libraries for games
https://github.com/pennie-quinn/paq

Game engines:

AVA - game engine
https://github.com/r-lyeh/AVA

L - game engine
https://github.com/Lyatus/L

Phyxed 2D - 2D physics engine with fixed point math
https://github.com/Srekel/phyxed-2d

easytab - tablet library
https://github.com/ApoorvaJ/EasyTab

Graphics and math:

HandmadeMath - math library for games and graphics
https://github.com/HandmadeMath/Handmade-Math

small3dlib - fast, small, efficient, portable, public domain 3D software rasterizer
https://gitlab.com/drummyfish/small3dlib

raycastlib - fast, small, efficient, portable, public domain ray casting library
https://gitlab.com/drummyfish/raycastlib

pt_math - scalar math
https://github.com/pmttavara/pt_math

linmath.h - lean linear math library for graphics
https://github.com/datenwolf/linmath.h

single file C/C++ libraries - raytracer, etc.
https://github.com/rmitton/rjm

graphics code
http://fileadmin.cs.lth.se/cs/Personal/Tomas_Akenine-Moller/code/

Immediate2D Drawing Framework
https://github.com/npiegdon/immediate2d

TIGR - Tiny Graphics Library
https://github.com/xahon/tigr

Debug Draw - immediate mode drawing API
https://github.com/glampert/debug-draw

lightmapper
https://github.com/ands/lightmapper#lightmapper

seamoptimizer
https://github.com/ands/seamoptimizer

tinygizmo
https://github.com/ddiakopoulos/tinygizmo

image resampler
https://github.com/richgel999/imageresampler

vector and matrix library
https://github.com/jobtalle/ccVector

vector math library
https://github.com/sgorsten/linalg

sts - vertex cache optimization
https://github.com/Sigkill79/sts

cro lib - mipmap generator
https://github.com/thebeast33/cro_lib

GUI apps for OSX in C
https://github.com/hidefromkgb/mac_load

Lightweight TUI display manager for Linux and BSD
https://gitlab.com/TilCreator/ly

OS:

TempleOS is an original operating system written in a variant of C called HolyC
https://github.com/cia-foundation/TempleOS

Tforth is a very tiny toy OS written for the IBM PC in 8086 assembly language inspired by the FORTH programming language
https://www.ttgurney.com/tforth.asm
Programmers that use other languages tend to think C and C++ don't have a lot of library or module support to help develop applications. While these languages don't have a lot of built-in support for a wide variety of functionality and they don't have an official way to add packages, modules, libraries or other forms of additional code, they still have a wide selection of third party code and libraries you can use to help perform tasks faster.

I personally prefer that C has a minimal library and you don't have to memorize a lot of functionality to get it running. I also like the fact that C/C++ lets you choose options for yourself instead of forcing you to use them. For instance, someone may want to use garbage collection and not deal with memory management. If so, there are libraries out there that can do it for you. However, when I want to write something that runs fast, I'd prefer to do my own memory management. Also, most of those higher level languages that programmers are so enthusiastic about because they have libraries to make tasks easier are usually written in C/C++. Some of the high performance libraries these languages use or the functionality that needs to access operating system related functions (like file management) typically use C/C++ code underneath. For instance, higher level languages that support Internet access are probably using a C library such as curl behind the scenes.

Not having an official version of some functionality that's part of a standard library can make it hard to figure out how best to add that functionality to a project. While there are tons of libraries available for C, not having a language specific way to easily add them as packages can make it confusing as to what use. There is an interesting development in C/C++ programming that's attempting to fill the gap. Several developers are coming up with lightweight and, in some cases, single file or single header libraries with lenient licensing that can easily be added to a project. I'll mention some of those options. If there are others you find useful, please let me know about them so they can be added to the list.

There is a lightweight package manager for C/C++ called clib that makes it easier to find and incorporate lightweight libraries in your projects. It includes a list of available packages:
https://github.com/clibs/clib/wiki/Packages

CCAN is another collection of C snippets similar to the CPAN collection:
http://ccodearchive.net/list.html

Snippets has been around a long time. It has short snippets of code that give examples on how to do things in C/C++. It's a useful resource.
https://github.com/vonj/snippets.org

Libraries that use Unlicense, CC0, BSD 0 clause (or other similar licenses) or code that is in the public domain is very easy to incorporate into projects. You don't have to worry about whether you've given proper credit in your program or provided the proper license information along with your own application. The Unlicense site has a nice list of source code you can use by itself or incorporate in your own projects. Some of the code listed is written for C/C++. There are also some interesting C/C++ projects at github in the public-domain projects.
http://unlicense.org/
https://github.com/public-domain?tab=repositories

Projects from Plan 9 and suckless.org are known for their efficiency and minimalism. You can check out some of that code at:
http://git.suckless.org/

micro-bunzip code is available from:
http://www.landley.net/code/

What follows is a list of single file and lightweight libraries:
https://github.com/nothings/stb
https://github.com/nothings/single_file_libs
https://github.com/yui0/slibs
https://github.com/mackron/dr_libs
https://github.com/RandyGaul/cute_headers
https://github.com/mattiasgustavsson/libs
https://github.com/pennie-quinn/paq
https://github.com/gingerBill/gb
https://github.com/to-miz/tm
https://github.com/r-lyeh/tinybits
https://github.com/tylov/C99Containers
https://github.com/nemequ/portable-snippets
https://github.com/floooh/sokol
https://github.com/hidefromkgb/mac_load
https://github.com/lvandeve/lodepng
https://github.com/rgamble/libcsv
https://github.com/rgamble/csvutils
https://github.com/arnoldrobbins/strftime
https://github.com/curl/fcurl

Know of some others worth trying? Please tell me about them:
https://groups.yahoo.com/groups/CppDesign/
I only recently checked the OpenSSL site and found out that they've changed their license from 4 clause BSD to an Apache style license. Many sites mention a license conflict between BSD 4 clause licenses and GNU GPL licenses. Several programs I use try to avoid the issue by adding a waiver to their license to allow linking with OpenSSL. Some examples are Dillo and D+. The issue can also be avoided in many cases by using software with a license other than the GNU GPL. So, the new switch to an Apache style license solves the license conflict issue in many cases (although it may cause new license conflict issues).

There's a useful reference on license information at the curl site:
https://curl.haxx.se/legal/licmix.html

There was an interesting thread about the GPL/BSD 4 clause license conflict on the lynx development list. Various SSL library options such as OpenSSL, gnutls and nss were discussed. It was mentioned that parts of the gnutls library (the compatibility layer) was licensed under GPLv3 which is incompatible with GPLv2 only ( https://www.gnu.org/licenses/gpl-faq.html#AllCompatibility ). The thread concluded with a recommendation to use the nss library to avoid license conflicts. It also mentioned that contacting everyone who worked on the project to re-license lynx would be too difficult. I guess there was some accommodation made after the thread because the latest version of lynx includes a COPYHEADER file that includes permission to use libraries such as OpenSSL and gnutls.

With the license change to OpenSSL, I hoped that the various license issues one might run across when building and distributing software that need SSL support had been solved. I've been using OpenSSL for a long time and it's always been highly portable and worked on a variety of platforms. However, when I downloaded the latest version of OpenSSL, I found that was no longer the case. With the various OpenSSL security issues in the news, work has been done to update the library and make it more secure. It appears, in this particular case, the security enhancements have come at the cost of portability. I used to be able to build OpenSSL using the ActiveState version of Perl. Now, OpenSSL is designed to only allow use of ActiveState or Windows native Perl builds using the Visual C++ compiler. If I continue to use the mingw compiler, I need a msys or cygwin based version of Perl. I'd previously built OpenSSL for DOS with no issues. Looking through some of the code, I'm afraid to even give it a try with the latest version of OpenSSL. OpenSSL is also much more dependent on Perl than it used to be. If I'm building a C library, it would be nice if it was only dependent on C code to build instead of requiring an interpreted language that's rather complicated to build.

I found it was time to either redesign my build of Perl (since a native Perl could no longer be used with MinGW to build OpenSSL) or to look for a new SSL library alternative. I'll share some of the results in my search for SSL library alternatives.

The major SSL options are OpenSSL, gnutls (with GNU GPL license) and nss (from Mozilla with Mozilla Public License). There are OpenSSL compatibility layers for gnutls (GPLv3 license) and nss ( Nss_compat_ossl originally from Fedora and no longer supported ). From some of the articles I read online, OpenSSL and nss were mentioned as more secure than gnutls. I also read that gnutls was a popular option on certain Linux systems such as Debian.

However, these aren't the only SSL libraries. There are several other options for embedded systems and other specialty uses. It's actually hard to track the options since the names of some of them keep changing. Typically, a program needs to offer support specifically for one or more of these library options because there usually isn't a compatibility layer to use that SSL library in place of a more common SSL library. Curl is a great example of a program that supports multiple SSL library options. D+ included support for cyassl. However, cyassl is now known as wolfssl. axtls looked like an interesting possibility because of its BSD license. It supposedly builds on Windows, but I didn't have any luck with it. Of all the various lightweight and/or embedded options, the only one I was able to get to build out of the box on Windows was mbedtls (formerly polarssl). mbedtls is available under a GPL license. Rather than try to track all the options and library name changes, I'll refer to the Wikipedia list:
https://en.wikipedia.org/wiki/Comparison_of_TLS_implementations

After the recent security issues with OpenSSL, there were also forks of OpenSSL. These include LibreSSL (a fork by the OpenBSD developers) and BoringSSL (by Google). I tried building BoringSSL, but it required an interpreter (similar to OpenSSL), so why not stick with OpenSSL instead of switching to BoringSSL. I also tried building some of the various SSL options with cmake and had no luck at all.

I'd tried building LibreSSL in the past with no luck either. The fork was originally just designed for BSD systems and support for other platforms was added later. There are even some posts on the Internet about how early versions of LibreSSL include issues that made it insecure on Linux and other non-BSD systems. Once support was added for other platforms, I ran into an issue with what platforms were supported. The developers only supported the MinGW64 project on Windows. I use a version of MinGW based on an earlier version of the original MinGW which has a more lenient license. I've been adapting the mingwrt and w32api libraries, but they're based on the original public domain licensed versions of the libraries. So, when I previously tried to build LibreSSL, it wasn't compatible with my MinGW compiler. However, after the various changes to OpenSSL, I decided to give LibreSSL another try. Was pleasantly surprised this time when it only required minor patching with my particular version of MinGW in order to get it to build. It also uses the standard GNU autotools style configure/make/make install rather than requiring Perl just to configure and build it. If anyone's interested in the patches, feel free to contact me about getting a copy.

At this point, I'm considering switching to the LibreSSL fork. Several Linux distributions that use musl as their main C library are using LibreSSL as their SSL library of choice. They included patches to get various libraries and programs to build with LibreSSL instead of OpenSSL. There are also some patches at the LibreSSL site.

However, there are still some issues with switching. Many of the programs that included a waiver for OpenSSL, do not provide a similar waiver for LibreSSL. I certainly be interested in hearing how others are handling this particular issue. It would be nice if LibreSSL users could contact some of these projects and ask about a waiver for LibreSSL as well as OpenSSL. Some of the projects that come to mind are D+, Dillo, lynx, opusfile. Curl, libarchive and libssh2 can also use LibreSSL instead of OpenSSL, but there aren't any issues with license conflicts unless one adds a GNU GPL licensed library or a similar incompatible license to the mix.

I'd be interested to hear what others use as their SSL library of choice when building cross-platform applications and why they chose that particular library. You can find further discussion of this topic on the CPPDesign mailing list ( http://www.distasis.com/connect.htm ).
This post includes a list of resources for building applications and libraries for Windows using MinGW or similar projects.


Just wanted to note some of the native Windows porting projects I've worked on before I list some of the other projects out there. I've compiled the X server code and built a X server on Windows (similar to the Xming X server but with all my own patches). I'm looking into porting msh to Windows and other platforms (including patches for better handling of internationalization/UTF-8 character codes). I'm working on porting various core utilities based on Minix, BSD and custom implementations. I have patches and build scripts for several Open Source libraries and programs. See http://www.distasis.com/cpp/lmbld.htm for further details and a link to some of the scripts and patches. I work with regex and fnmatch libraries based on MIT licensed code from musl. musl uses regex code from the BSD licensed tre library. I also work with a BSD gettext implementation based on code put together for PostgreSQL. The libiconv and iconv implementations I use are written from scratch using custom UTF-8/internationalization code. I also have my own custom implementations of libmman, libdl and pthreads as well as other libraries I use to help with porting applications.


Places to download builds of various Open Source software and libraries for Windows and MinGW:

http://gnuwin32.sourceforge.net/
Many of the GNU libraries and programs patched and recompiled for MinGW.

http://devpaks.org/
Devpaks repository Libraries for the Dev-C++ compiler which uses MinGW. Could also be used without Dev-C++. Files should be standard tar.bz2 files renamed with .devpak extension.

http://download.opensuse.org/repositories/windows:/mingw:/win32/openSUSE_Factory/noarch/
OpenSuse Windows Packages has windows packages cross-compiled using MinGW on OpenSuse and the OpenSuse Build System (OBS).

https://sourceforge.net/projects/ezwinports/
ezwinports has ports of Unix and GNU software to MS-Windows.

https://sourceforge.net/projects/mingwrep/
MinGW packages repository

https://sourceforge.net/projects/takeoffgw/
TakeoffGW - Cygwin style package manager and native Windows packages built with the OpenSUSE Build Service.


Patches and build scripts to build Open Source software for Windows:

https://github.com/Alexpux/mingw-builds
https://github.com/mxe/mxe


MSYS and Cygwin alternatives:

http://midipix.org/
Alternative to MinGW and Cygwin and build scripts for various Open Source tools:

https://github.com/bmatzelle/gow/wiki
GNU on Windows - lightweight alternative to Cygwin. Native Win32 programs.

Busybox port for Windows:
https://github.com/pclouds/busybox-w32
Lightweight versions of core utilities.

Busybox-w32 fork:
https://frippery.org/busybox/

http://unxutils.sourceforge.net/
UnxUtils - Native Win32 ports of core utilities.

https://github.com/rubenvb/UnixToolsForWindows
Unix Tools for Windows - Native Windows implementations emulating core utilities written in C++.

http://sourceforge.net/projects/win-bash/
Native Win32 port of an older version of bash.

https://steve.fi/Software/bash/
GNU Bash for Windows

https://sourceforge.net/projects/zsh-nt/?source=directory
WinZsh - Z shell for Windows

http://www.straightrunning.com/XmingNotes/
Xming X Server - Windows native X server


Open Source libraries patched for Windows:

http://waterlan.home.xs4all.nl/libintl.html
Relocatable libintl for MinGW.

https://github.com/dlfcn-win32/dlfcn-win32
POSIX dynamic runtime library loading (libdl) compatibility routines.

https://code.google.com/archive/p/mman-win32/
POSIX mmap functionality.

http://synesis.com.au/software/unixem.html
Various POSIX functions implemented for Windows.

https://github.com/rprichard/winpty
Winpty - provides and interface similar to a Unix pty-master for communicating with Windows console programs.


Pthreads and C/C++ 11 threads compatibility patches and implementations:

https://sourceware.org/pthreads-win32/
pthreads-win32 - Red Hat's POSIX thread library for Win32.

http://jmhartsoftware.com/Pthreads_Emulation.html
Simplified Pthread Emulation with Macros - Minimal pthread emulation.

https://tinycthread.github.io/
TinyCThread - C11 threads implementation

https://github.com/jtsiomb/c11threads
c11threads - GNU compatibility headers for C11 thread support

April 2025

S M T W T F S
  12345
6789101112
13141516171819
20212223242526
27282930   

Syndicate

RSS Atom

Most Popular Tags

Style Credit

Expand Cut Tags

No cut tags
Page generated May. 23rd, 2025 09:00 am
Powered by Dreamwidth Studios