Skip to content

Update termios bindings#3254

Merged
lerno merged 4 commits into
c3lang:masterfrom
hovsater:termios-macos
May 26, 2026
Merged

Update termios bindings#3254
lerno merged 4 commits into
c3lang:masterfrom
hovsater:termios-macos

Conversation

@hovsater
Copy link
Copy Markdown
Contributor

@hovsater hovsater commented May 22, 2026

This includes several improvements to the existing termios bindings.

  • The dummy interface was removed as requested by @lerno.
  • The existing bindings were moved from lib/std/libc/os/posix.c3 into lib/std/libc/os/linux.c3 as they were Linux specific.
  • The type of the c_cc member in the Termios struct was adjusted for the Linux bindings as agreed upon with @ManuLinares.
  • New Darwin specific bindings were added.

@hovsater hovsater changed the title Add libc termios bindings for Darwin Update termios bindings May 25, 2026
@ManuLinares
Copy link
Copy Markdown
Member

I don't know about the alias Cc = char, maybe just make it a char directly instead

@hovsater
Copy link
Copy Markdown
Contributor Author

hovsater commented May 25, 2026

I don't know about the alias Cc = char, maybe just make it a char directly instead

I don't mind changing it. The reason for the alias is because that's what both Odin and Zig does (since termios exposes a cc_t type). On Linux, Cc is also used for multiple fields (c_cc[NCCS] and c_line).

hovsater added 4 commits May 26, 2026 19:47
c_cc is not an array of Cc members. The Cc enum are the index positions.
The value at a given index position is an arbitrary byte value.
@lerno lerno merged commit a9d79e3 into c3lang:master May 26, 2026
18 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants