The aim of the initial reorganisation project is to move core and support routines into separate libraries with well-defined and enforced API boundaries.
This project began during the initial code fork in 2008 and was completed sometime in late 2009.
Before reorganisation, approximately 110,000 lines of code lived in and under src/, with approximately 28,000 lines in lib/ and include/.
After the first part of the reorganisation, approximately 81,000 lines of code are left in and under src/, with ~ 29,000 lines of code moved from src/ into the various top-level libaries.
The top level libraries are summarised as follows:
- libasyncio - threaded asynchronous disk IO routines
- libcb - reference counted callback data types
- libcore - various core data structures and types which were defined in src/ instead of lib/
- libhelper - IPC and helper process management
- libhttp - core HTTP data representation and parser functions
- libiapp - network IO events, timed events and scheduling core
- libmem - memory management - memory pools, strings, stringlist, intlist, buffer management
- libmime - legacy MIME header handling
- libsqdebug - debug logging
- libsqdns - internal/external DNS
- libsqident - ident protocol handling
- libsqinet - ipv4/ipv6 data types and support functions
- libsqname - IP to hostname and hostname to IP APIs; hostname and IP name caches
- libsqstore - core definitions of the disk and memory storage types
- libsqtlv - TLV library
- libstat - histogram statistics
- libstmem - store memory management
The top-level libraries are able to be compiled separately from the rest of the Squid/Lusca code in src/. This allows for future code reuse as well as the easier construction of unit tests.