Project libMidnightCode (Once Written, Twice Linked)
Subroutine Collective :: To provide a single base resource of subroutines that will facilitate faster development time and greater application quality across the common core components of all Midnight Code projects.
Project output should include a collective of C (ANSI/C99) libraries and the supporting (usage) documentation.
Despite the massive amount of source code that has been developed to support various Midnight Code projects over the years, many programs share a small group of common functions. These functions include; displaying logos, displaying copyright and license information, displaying status information, executing processes, taking command-line switches and reading configuration files.
Unfortunately, these common functions have not shared common code.
When projects start as insignificant and have a small part to play in a larger process, liberties are often taken in the development process to ensure that only the necessary time is spent attempting to achieve an application objective. However, as programs are deemed useful, they are extended in functionality and capacity, as their function in that process becomes significant. It is in this growth environment that poor code can become a substantial operational risk. It is also this type of environment that will see one piece of functionality implemented and re-implemented in slightly different ways in similar applications, over time - often with initial or early implementations being left without the improvements of later incarnations.
This growth creep is the cause of varying degrees of quality within key functions across the Midnight Code project range.
This project will ensure that all future programs utilising common functions will be implemented from a known-good source base. It will also ensure that problems identified and corrected for one project will be reflected in all, via recompilation against an updated libmidnightcode.
The current function set offered by libmidnightcode, includes;
Base64 Encoder/Decoder Library
Bootp/DHCP (Client) Library
Camera (Frame/Video) Library
Casting Protocol Library
Filter (Network) Library
Global Position System Library
Init (System Initialiser) Library
Interface (Network) Library
Internet Protocol (IP) Library
Logical Volume Management Library
Process Execution Library
Random Number (PRNG) Library
Resolver (DNS) Library
Routing (Network) Library
Servo IO Library
Socket (Network) Library
Switch (Command Line) Library
System Log (Client) Library
Terminal (Console) Library
Trivial File Transfer Library
Web Interface Library
As at August 2006, the socket library is complete and working well. The release of libMidnightCode version 1.1 includes performance metrics of 10.93Mbytes/sec for type RAW sockets, and 4.23Mbytes/sec for type MIDNIGHTCODE sockets. The socket library is one of the big-three - and it will allow both Tyd negotiation for Project CHAOS and HTML interface connectivity for Projects Saturn and Pluto.
As at October 2006, the init library is complete. A proof of concept platform (10 Mbyte Linux distribution, 2.6 kernel based) has been used to boot Project Saturn hardware, from a USB key, to a running multi-user state. The latest version (1.2) of libMidnightCode compiles natively to a shared library, allowing the libMidnightCode applications to be separated into their own archive.
As at March 2007, the webint (web interface) library framework is in place, but its not yet usable as an interactive administration interface. This version also sees improvements in the socket library, and the addition of Video4Linux UVC camera support. Tested against the Logitec Sphere (Orbit) 2006, the camera library supports pan and tilt motor control; integration has been specifically designed to support the new ATS project.
As at June 2007, the Casting protocol has been implemented, allowing for the future creation of a very simple, yet significantly more robust, Tyd replacement for CHAOS - dreamt of since the socket library code of August 2006. This release (libMidnightCode version 1.4) also includes a new Servo motor control library and GPS library (for gpsd interaction), amongst a number of minor tweaks such as a child socket finder, safe list iteration, etc ad nausea.
As at July 2007, the Bootp/DHCP protocol has been implemented, facilitating integrated interface address discovery. This removes the last dependency for the boot prompt options for CHAOS - thus the reference platform no longer has help for these options. A Syslog client library has also been added to allow for integrated system logging. A lot of debugging has gone in to finding an issue with some HP equipment. This should now be resolved - there were global variables in the library that were assigned static values which were not being shared by the application that was using the library - thus there was a pseudo-random dependency on system memory being zeroed. With the advent of an integrated DHCP client, the first of the Logic Grenades can finally be created. The reference platform now runs kernel 2.6.22.
It is not intended that libmidnightcode is to be of significant use to developers beyond midnightcode.org, it is only published here as a singular reference for other Midnight Code projects.
The following code (source, binaries, patches, etc) have been developed or mirrored for this project;
This project was initiated on Saturday, the 1st of January 2005. Its last recorded activity stamp is Thursday, the 12th of July 2007.