Source files
Main code
The implementation of finit can be divided into two parts:
- The logic of calculating dependencies, starting and stopping units.
- The implementation of the units. Most of this is parsing the systemd-style service files (which is not as trivial as one might suspect), and also actually doing what needs to be done to start and stop the services.
| depend.[ch] | A dependency set. |
|---|---|
| exec.[ch] | Information about commands to be executed. |
| finit.c | Main source file. |
| finit.fidl | Description of the communication between telfinit and finit. It is used for autogenerating the IPC code with fidl-codegen. |
| log.[ch] | Logging to syslog, kmsg or the console. |
| notify.[ch] | The systemd notification protocol. |
| The main logic for finit. Calculate dependencies, start and stop units. | |
| service.[ch] | A systemd style service unit. |
| target.[ch] | A target unit. |
| telfinit.c | Telfinit is a tool for communicating with finit. |
| unit.[ch] | Common unit code. |
Utilities
These utility functions do not depend on anything specific to finit.
| arr.[ch] | Generic array. |
|---|---|
| dagif.[ch] | Generic implementation of a Directed Acyclic Graph. Used here for calculating start and stop order of services. |
| debug.h | Some macros for debugging. |
| fileline.[ch] | Read a text file (or a memory chunk) line by line without copy. |
| hashmap.[ch] | Generic hash map implementation. |
| heap.[ch] | Generic heap (sorted queue) implementation. |
| inifile.[ch] | Read an ini-style file without copy. |
| listif.[ch] | Generic double linked list implementation. |
| loop.[ch] | Main eventloop that handles file events, time and Unix signals. |
| loop-child.[ch] | Adding child exit events to the main loop. |
| Integrate auto-generated code for FIPC with the eventloop. | |
| sig.[ch] | Generic implementation of subscribable signals. In this case it happens to be used for Unix signals, but the two should otherwise not be confused. |
| str.[ch] | String type that avoids copying data then possible. |
| strutil.[ch] | A few string related utility functions. |
| timeutil.[ch] | A few time related utility functions. |
| tokenize.[ch] | A function for tokenizing a text string based several different sets of rules. |
| utf8.[ch] | A few UTF8 related utility functions. |

