A collection of helper code for C projects.
This code should not be distributed by itself. It is designed to be integrated into a larger project which itself contains autoconf and automake scripts to drive the build process.
cc-common is designed to be included in projects as a git submodule.
To use cc-common, loosely do the following:
- Add cc-common as a git submodule
git submodule add git://github.com/alistairking/cc-common.git common
- See http://git-scm.com/book/en/Git-Tools-Submodules for more info about working with git submodules.
-
Update the AC_CONFIG_FILES macro in configure.ac to include:
common/Makefile
,common/libpatricia/Makefile
, andcommon/libcsv/Makefile
. For example:AC_CONFIG_FILES([Makefile lib/Makefile tools/Makefile common/Makefile common/libpatricia/Makefile common/libcsv/Makefile ])
-
In the main Makefile.am file for your library (usually /lib/Makefile.am), add
$(top_builddir)/common/libcccommon.la
to the LIBADD variable. For example:libsomething_la_LIBADD = $(top_builddir)/common/libcccommon.la
-
To include header files directly, you may need to add to the AM_CPPFLAGS variable in the appropriate Makefile.am. For example:
AM_CPPFLAGS = -I$(top_srcdir) \ -I$(top_srcdir)/common/ \ -I$(top_srcdir)/common/libpatricia \ -I$(top_srcdir)/common/libcsv
-
Run autoreconf and configure and you should be all set.
All code has been written by Alistair King alistair@caida.org and is released under a BSD license, except:
-
- Adapted from libcsv
- The original library can be obtained from http://libcsv.sourceforge.net
- Provided under the LGPL. See included copyright notice.
-
- Adapted from rb_tree implementation. See the included license file.
- Interval tree code authored by Vasco Asturiano and Copyright The Regents of the University of California and released under a BSD license.
-
- See the libjsmn website
- Released under an MIT license
-
- Adapted from the Net::Patricia perl module by Dave Plonka, see copyright notice.
-
- Provided under an MIT license. See license notice at the top of the respective files.
-
- Developed by WAND and released under a BSD license with permission from the author.
-
- timeval_subtract code from http://www.gnu.org/software/libc/manual/html_node/Elapsed-Time.html
- bytes_htons, bytes_htonl, gettimeofday_wrap, malloc_zero from scamper and re-released under a BSD license with permission from the author.