stdc 1.0.8
stdc: ^1.0.8 copied to clipboard
A minimal-abstraction Standard C Library implementation for Dart. Designed for C programmers to seamlessly use familiar functions like stdc.printf or stdc.sin.
1.0.8 May 9th 2026 #
- Wide Character and Localization Support: Completed text handling capabilities by implementing C95/C99 wide character features and system localization stubs (
<locale.h>,<wchar.h>,<wctype.h>). <locale.h>Addition: Provided theLconvclass (mapping tostruct lconv) populated with standard "C" locale defaults. Addedsetlocaleandlocaleconvfunctions, along with localization category macros (LC_ALL,LC_CTYPE, etc.).<wchar.h>Addition: Introducedwchar_tandwint_tdefinitions mapping to Dartint(Runes), adhering to a strict C-like memory representation for wide strings (List<wchar_t>). Implemented wide string manipulation functions (wcslen,wcscpy,wcscmp,wcscat,wcschr,wcsstr).<wctype.h>Addition: Added wide character classification and mapping functions (iswalpha,iswdigit,towlower,towupper, etc.) natively supporting standard integer-based code unit evaluation.- Documentation & Linting Polish: Added missing API documentation comments across public symbols (including
complexandinttypesextensions) to ensure comprehensive documentation coverage. Intentionally silencedcamel_case_typeswarnings for C-style type definitions (likewchar_tandwint_t) to maintain authentic C naming conventions while preserving pub.dev score.
1.0.7 May 8th 2026 #
- Complex Mathematics, Extended Integers, and Unicode Support: Expanded the library's domain to cover C99 and C11 specialized headers (
<complex.h>,<inttypes.h>,<uchar.h>). <complex.h>Addition: Providedcomplex,double complex, andfloat complextype definitions. Implemented core complex arithmetic and transcendental functions (cabs,cacos,casin,catan,ccos,csin,ctan,cexp,clog,cpow,csqrt) via a zero-overhead architecture.<inttypes.h>Addition: Introduced extended integer utilities, directly building upon<stdint.h>. Addedimaxabs,imaxdiv,strtoimax, andstrtoumaxfunctions for working with maximum-width integer types seamlessly.<uchar.h>Addition: Provided C11 Unicode type definitions (char16_t,char32_t) and implemented standard conversion functions (mbrtoc16,c16rtomb,mbrtoc32,c32rtomb), mapping directly to Dart's highly optimized UTF-16 strings and runes.
1.0.6 May 7th 2026 #
- Standard Type Definitions & Constraints Expansion: Added standard C integer bounds, boolean utilities, and pointer type definitions (
<stdint.h>,<stdbool.h>,<stddef.h>). <stdint.h>Addition: Providedextension typestrict definitions for native C-like integers (Int8,Uint32, etc.) matching standard C widths without sacrificing zero-overhead performance. Also provided fasttypedefalias options (int8_t,uint32_t).<stdbool.h>Addition: Implemented<stdbool.h>equivalents. Introduced quality-of-lifeboolextension utilities (e.g.,Toggle(),ToInt()). Note: All non-standard derived utility methods begin with an Uppercase letter to cleanly distinguish them from standard APIs.<stddef.h>Addition: Providedsize_tandptrdiff_taliases, alongsidestdc.NULLmapping to Dart'snull.- Web/Wasm Compatibility: Refactored
<stdio.h>to decouple it fromdart:io. Implemented conditional imports (src/io_stub.dartandsrc/io_native.dart) to ensure the entirestdcpackage compiles and runs flawlessly on Web and Wasm targets, automatically falling back toprint()for console output on the web.
1.0.5 May 6th 2026 #
- Essential Systems Boundaries & Diagnostics: Expanded
stdcwith core limit definitions, floating-point characteristics, and system diagnostics headers. <limits.h>Addition: Provided constants for standard C integer limits (INT_MAX,UINT_MAX,CHAR_BIT, etc.), mapped to traditional C 32-bit bounds forintand 64-bit forlong long.<float.h>Addition: Provided standard C floating-point characteristics (FLT_MAX,DBL_MAX,FLT_EPSILON, etc.).<assert.h>Addition: Implemented runtime assertions. Due toassertbeing a reserved keyword in Dart, the function is implemented asstdc.assert_()orstdc.cassert(), but documented as the C-equivalentassert.<errno.h>Addition: Added global error state tracking (stdc.errno) and standard error macros (EDOM,ERANGE, etc.) to support C-style error reporting.
1.0.4 #
- Massive Systems-Level Feature Expansion: Added support for three core C standard headers simultaneously (
<stdlib.h>,<stdio.h>,<time.h>), significantly expanding the library's utility for C programmers seeking a zero-abstraction environment in Dart. <stdlib.h>Addition: Implemented essential standard library utilities mapping directly to native-equivalent concepts:- String conversions:
atoi,atol,atof. - Pseudo-random number generation:
rand,srand. - Integer arithmetic:
abs,labs,llabs. - Searching and sorting:
qsort,bsearch(designed to use pure Dart's optimized algorithms while exposing the familiar C signatures with comparators).
- String conversions:
<stdio.h>Addition: Brought raw, authentic C-style I/O to Dart using directdart:iohooks where appropriate:- Formatted I/O: Added a lightweight, zero-dependency
sprintfandprintfimplementation that mimics C's format specifiers (%d,%s,%f,%x, etc.) without bloating the library. - Character and String Output:
puts,putchar. - Standard Input:
getchar,gets.
- Formatted I/O: Added a lightweight, zero-dependency
<time.h>Addition: Implemented low-level time tracking utilities mapping to system ticks and epochs:- Core timing:
time,clock. - Utility functions:
difftime,ctime.
- Core timing:
1.0.3 #
<string.h>Addition: Implemented standard C string manipulation functions (strlen,strcmp,strcpy,strcat,strstr, etc.). Mutating functions likestrcpyandstrcathave been adapted to return a new string, adhering to Dart's immutableStringnature while maintaining familiar C naming conventions.
1.0.2 #
<ctype.h>Addition: Implemented standard character classification and conversion functions (isalpha,isdigit,toupper,tolower, etc.). Designed to acceptStringinputs for ergonomic use in Dart while maintaining native performance.
1.0.1 #
- Version Reset: Reset versioning to
0.1.0to properly track early development of the library before a stable1.0.0release. - Initial Architecture Setup: Implemented the core
Stdcextension architecture, allowing a unifiedstdcnamespace across different headers. <math.h>Implemented: Added comprehensive support for C standard math functions (sin,cos,sqrt,pow,ceil,floor,abs,fabs, etc.) mapped to Dart's highly optimizeddart:math.- Examples & Tests: Created
example/stdc_example.dartandtest/stdc_test.dart. - Documentation: Added comprehensive API dartdoc comments to all functions, classes, and constants.
1.0.0 #
- Initial placeholder version from Dart template creation.