I wrote some C libraries with two files (each with one .c file and one .h file). All of them are public domain. I don't know which ones are usable from C++, and I don't know if they are usable on platforms other than GNU/Linux on PC (since I have not tried). I expect that they will probably work on 32-bit systems as well as 64-bits (although, for most of them, I have only tried 64-bits). Most have no other dependencies, except as otherwise specified in the descriptions below.
hash.c - hash.h - Calculate cryptographic hashes, using the standard C stream interface (fwrite, etc). Some code comes from parts of SQLite (which is also public domain). Currently only a few algorithms are implemented (SHA-1, SHA-3, MD5), but more can be added in future.
scogem.c - scogem.h - Can parse URLs (many schemes are implemented), including converting relative URLs into absolute, username/password, default port numbers, and also percent-encoding (both encoding and decoding is possible). Can also parse MIME type and ULFI strings. (It cannot actually upload and download files; that is implemented in a separate file. Originally it was intended to put into this file too, but now it isn't.)
simpletls.c - simpletls.h - Exposes one function to create a socket and connect to a remote server with TLS. It can then be used like an ordinary socket. Client certificates are not implemented yet (although it is intended to be done in future; unfortunately I don't know how, at this time). Requires OpenSSL (although someone else might be able to write a program with the same interface that does not use OpenSSL).
smallxrm.c - smallxrm.h - Implementation of X resource manager. Can be used even without X window system. Also has a function xrm_init_quarks that X window system does not have, which can be used to assign constant numbers for each resource name for more efficiency (rather than having to use variables, like you do with X windows). Anonymous quarks are possible (like X windows); however, it lacks the possibility of non-string-type resources.
I wrote some C libraries with two files (each with one
.c
file and one.h
file). All of them are public domain. I don't know which ones are usable from C++, and I don't know if they are usable on platforms other than GNU/Linux on PC (since I have not tried). I expect that they will probably work on 32-bit systems as well as 64-bits (although, for most of them, I have only tried 64-bits). Most have no other dependencies, except as otherwise specified in the descriptions below.hash.c - hash.h - Calculate cryptographic hashes, using the standard C stream interface (
fwrite
, etc). Some code comes from parts of SQLite (which is also public domain). Currently only a few algorithms are implemented (SHA-1, SHA-3, MD5), but more can be added in future.scogem.c - scogem.h - Can parse URLs (many schemes are implemented), including converting relative URLs into absolute, username/password, default port numbers, and also percent-encoding (both encoding and decoding is possible). Can also parse MIME type and ULFI strings. (It cannot actually upload and download files; that is implemented in a separate file. Originally it was intended to put into this file too, but now it isn't.)
simpletls.c - simpletls.h - Exposes one function to create a socket and connect to a remote server with TLS. It can then be used like an ordinary socket. Client certificates are not implemented yet (although it is intended to be done in future; unfortunately I don't know how, at this time). Requires OpenSSL (although someone else might be able to write a program with the same interface that does not use OpenSSL).
smallxrm.c - smallxrm.h - Implementation of X resource manager. Can be used even without X window system. Also has a function
xrm_init_quarks
that X window system does not have, which can be used to assign constant numbers for each resource name for more efficiency (rather than having to use variables, like you do with X windows). Anonymous quarks are possible (like X windows); however, it lacks the possibility of non-string-type resources.