Icod.TermInfo.Compiler 1.6.1

There is a newer version of this package available.
See the version list below for details.
dotnet add package Icod.TermInfo.Compiler --version 1.6.1
                    
NuGet\Install-Package Icod.TermInfo.Compiler -Version 1.6.1
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Icod.TermInfo.Compiler" Version="1.6.1" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Icod.TermInfo.Compiler" Version="1.6.1" />
                    
Directory.Packages.props
<PackageReference Include="Icod.TermInfo.Compiler" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add Icod.TermInfo.Compiler --version 1.6.1
                    
#r "nuget: Icod.TermInfo.Compiler, 1.6.1"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package Icod.TermInfo.Compiler@1.6.1
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=Icod.TermInfo.Compiler&version=1.6.1
                    
Install as a Cake Addin
#tool nuget:?package=Icod.TermInfo.Compiler&version=1.6.1
                    
Install as a Cake Tool

Icod.TermInfo.Compiler

Icod.TermInfo.Compiler is the optional managed compiled-terminfo writing and database-layout layer for Icod.TermInfo.

C01 establishes the package and pure writer contract. C02 completes standard capability emission, C03 adds the supported ncurses extended section, and C04 adds deterministic automatic and explicit 0432 / 01036 format selection. C05 composes the 1.1 Source parser/resolver with that writer. C06 adds controlled publication into an explicit conventional terminfo directory root. C07 closes the implementation program with round-trip, determinism, and pinned ncurses/tic differential validation.

Install

For the 1.6.1 release:

dotnet add package Icod.TermInfo.Compiler --version 1.6.1

The package targets net8.0, net9.0, and net10.0 and depends on the matching Icod.TermInfo and Icod.TermInfo.Source packages. Version 1.6.1 preserves the frozen 1.2 Compiler public API and semantics; the coordinated patch corrects release-verifier NuGet-cache isolation only. The dependency remains one-way; neither Source nor Runtime depends on Compiler, and Compiler does not acquire a Termcap dependency.

C06 adds CompiledTermInfoDatabaseWriter. It never discovers a system database or installs globally: callers must supply the output root explicitly. It can publish a successful C05 compilation result or compile resolved TerminalDescription values before publication. The writer publishes canonical names and aliases in lowercase hexadecimal first-byte directories compatible with DirectoryTerminalDescriptionProvider. Existing files are rejected by default; replacement requires an explicit CompiledTermInfoDatabaseWriterOptions opt-in.

C07 adds no new public production API. Its validation suite reuses the checked-in T29 corpus generated with pinned ncurses tic, compares Compiler output and the reference binaries at the semantic TerminalDescription level, verifies byte-for-byte determinism across extended-capability insertion order and culture, and exercises temporary database output through the existing directory provider. Normal CI remains independent of a host ncurses installation.

Source compilation

C05 compiles a complete .ti source document without duplicating Source semantics:

using Icod.TermInfo.Compiler;

const string source =
	"""
	example-child|Example child,
		cols#132,
		use=example-base,

	example-base|Example base,
		am,
		lines#40,
	""";

TermInfoSourceCompilationResult result = TermInfoSourceCompiler.Compile(
	source,
	"example.ti"
);

foreach ( CompiledTermInfoSourceEntry entry in result.Entries ) {
	byte[] compiled = entry.Data;
	// Store or load this independently as appropriate for the caller.
}

Entries are returned in source-document order. use= dependencies may appear before or after their parents because resolution is delegated to the existing Source resolver. Parser and resolver diagnostics are returned as the original TermInfoSourceDiagnostic objects, preserving source names, lines, columns, offsets, and spans.

Source cancellation remains source-only state. After inheritance resolution it materializes as effective absence in TerminalDescription; C05 does not invent compiled cancellation tombstones.

CompiledTermInfoWriterOptions can be supplied to Compile to retain the C04 automatic/Legacy/Wide and extended-section policies. If a resolved description cannot be represented by the requested writer policy, the established C04 InvalidOperationException contract is preserved.

Automatic format selection

The original writer operation now selects the narrowest representation which can encode the description exactly:

using Icod.TermInfo;
using Icod.TermInfo.Compiler;

TerminalDescription description = new TerminalDescriptionBuilder( "example" )
	.SetDescription( "Example terminal" )
	.SetNumber( NumericCapability.Colors, 16_777_216 )
	.SetExtendedBoolean( "AX" )
	.SetExtendedNumber( "RGB", 16_777_216 )
	.Build();

byte[] compiled = CompiledTermInfoWriter.Write(
	description
);

When every present standard and extended numeric value is in 0..32767, the writer emits legacy 0432. A representable value greater than 32767 selects wide 01036, where both standard and extended numeric tables use signed 32-bit little-endian values. Negative present values remain unrepresentable because they collide with compiled absent/canceled sentinel semantics.

Explicit format policy

Use CompiledTermInfoWriterOptions when the output representation is part of the caller's contract:

byte[] wide = CompiledTermInfoWriter.Write(
	description,
	new CompiledTermInfoWriterOptions(
		CompiledTermInfoFormat.Wide
	)
);

CompiledTermInfoFormat.Legacy emits 0432 exactly or fails if any numeric requires the wide form. CompiledTermInfoFormat.Wide emits 01036 exactly even when legacy would suffice. Automatic prefers legacy and upgrades only when required.

The options also expose IncludeExtendedCapabilities. Setting it to false is a representation constraint, not a request to discard data: a description containing extended capabilities fails rather than being silently truncated.

All identity, capability-name, and capability-string data retain the strict reversible Latin-1 and NUL-termination rules established by C01-C03. Standard and extended string/name offsets remain signed 16-bit fields, section counts and sizes remain checked, and total-entry arithmetic is checked before allocation.

Invalid arguments use normal argument exceptions. A valid TerminalDescription which cannot be represented by the requested policy throws InvalidOperationException. C04 freezes that distinction for the low-level writer surface.

CompiledTermInfoWriter remains pure: it does not inspect environment variables, access terminfo directories, invoke native tic/ncurses, or write database layouts.

Product Compatible and additional computed target framework versions.
.NET net8.0 is compatible.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed.  net9.0 is compatible.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  net10.0 is compatible.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
1.8.0 0 9/2/2026
1.7.0 31 9/1/2026
1.6.1 57 9/1/2026
1.6.0 83 8/31/2026
1.5.0 75 8/30/2026
1.4.1 78 8/29/2026
1.4.0 72 8/29/2026
1.3.0 83 8/28/2026
1.2.0 78 8/27/2026
1.2.0-Alpha-7 73 8/27/2026
1.2.0-Alpha-6 79 8/27/2026

Version 1.6.1 is a coordinated patch release correcting release-verifier NuGet-cache isolation that could rebuild repository Compiler sources under a package-smoke cache; the frozen 1.2 Compiler API, writer/database semantics, dependency graph, and 1.0.0.0 assembly identity are unchanged.