The ECMA-48 standard can be found here: https://www.ecma-international.org/publications/standards/Ecma-048.htm
The CL-ECMA-48 library was created to serve my needs when writing an interactive program that creates a more complex terminal interface. In order to clean the source of the aforementioned program a tad, I decided to split the functionality into a library. While I used a small fraction of these control functions, the library implements all 162 that the ECMA-48 standard specifies, as this was the most sensible option. The library also optimizes the control functions emitted to the most compact representation, in contrast to the preceding handwritten functions which were much less discerning.
The ECMA-48 standard specifies control functions belonging to the C0, C1, Fs, and control sequence sets. The C0 control functions are simply a single character; the C1 and Fs control functions are the escape character followed by a single character; and the control sequences are the C1 control function named Control Sequence Introducer, any parameters, and then a sequence of one or more characters. While the standard further distinguishes control sequences by parameter purpose, the library doesn't. There are required, optional, and variadic parameters. In designing the interface, required parameters are those with no defualt value; optional parameters have a default value; and variadic parameters may or may not have a default value. Default values may be passed as NIL, whereas required parameters must be UNSIGNED-BYTEs. Every function accepts a stream argument as the last argument, which defaults to *STANDARD-OUTPUT*. Variadic parameters are achieved by passing in a list of the parameters and this is not checked, but all elements should be an UNSIGNED-BYTE and NIL only if a default value is specified. If a parameter with a default value is given its default value, it won't be emitted by the function, as an optimization.
When defining a control function, use DEFINE-CONTROL-FUNCTION, which accepts a symbol or list of two symbols (the acronym and name), a type designation (one of C0, C1, Fs, or a modified lambda-list), the identity (a character, character code, or sequence of characters), and an optional documentation string. The modified lambda-list is identical to a normal lambda-list, except for that &REST may have a default argument using the same syntax as &OPTIONAL and that these two lambda-list keywords are the only two allowed and are not allowed to be used together. The DEFINE-CONTROL-FUNCTION delegates to more specific macros in its implementation and will also assign :EXPANSION and :ACRONYM keys to the plist of the symbol or symbols used to name the function.
The programmer is expected to reference the ECMA-48 standard when using this library. This library relies on the underlying implementation using ASCII, as low character codes are used and characters are expected to have the corresponding codes. Rather than complicate the library, it is expected that, say, using a Gray stream performing translation would be more appropriate and simpler for this purpose for those implementations which don't use this. Alternatively, future work may involve making this library more portable, primarily by more use of character codes and checking and whatnot. In the common case of a program that is standard, sans the use of ASCII as the underlying character encoding, there should be no additional issues.
This library does not yet document the generated control functions, an unnecessary semicolon is emitted for the TABULATION-CENTERED-ON-CHARACTER control sequence even when the default value is used for the second parameter, identity sequences must contain characters and not character codes, and optional parameter optimization currently generates inefficient code. Correcting these flaws and any other found are the only expected changes to be made.
Here is the source, the ASDF system definition, and the documentation.