Sinopsis de C
Sinopsis de C
"Puce" #c89
What's the bare minimum #C89 needed to connect to the console in any OS and, in Windows (inc. XP), Linux & MacOS, enable raw mode? Asking for a friend.
Maybe there's a bare-bones framework out there for "give my app a terminal window and make the OS go away" that doesn't involve installing gigabytes of compiler suites and libraries :|
I recently wrote a sizeable, though still weekend-scaled, project in old-school C, an interactive disassembler and markup tool, to facilitate a bit of m68k reversing for a synth project.
I'd forgotten how *nice* it is to write green-field C. I wouldn't want this codebase to get any larger, but realloc-doubling buffers and do-it-yourself methods just scream at you to keep it small and focused.
#c89 #retrocomputing
Β»Tocaia is a simple and portable Gopher Client built with C89 and POSIX in mind. It offers a TUI interface to explore Gopherspace, with support for menus, text files, searches, and back/forward navigation.Β«
It's interesting comparing Usenet of 1993 to Hacker News of today. Some questions are perennial, it seems:
"But what use is malloc(0)?" followed by a discussion of people rolling their own Pascal-like strings.
"Why unique?" followed by a discussion of making sets and maps.
"It's not a valid pointer." leading to the usual pantomime rejoinder.
I haven't seen anyone ask what the old implementations that returned NULL did to errno, though.
Back in 1993, #AIX was the example that people gave of a C library where malloc(0) returned NULL.
https://groups.google.com/g/comp.unix.aix/c/lstmVEcmD2Q/m/wRsWt_Tnw1UJ
Most of the C libraries that I touched back then either just handed off to the operating system's API for suballocation, which did not treat zero specially, or had their own suballocation functions, which did not treat zero specially.
The Giant Bat used Bite, dealing 6 damage to you.
You got knocked unconscious, but managed to get back up.
---
π¦ Giant Bat
β€οΈβ€οΈβ€οΈππ€π€π€π€π€π€ 9/23
π‘οΈ 13 βοΈ
β1/4
β¨ 50
You were hit by the Giant Bat's Bite attack, you took 8 damage.
---
π¦ Giant Bat
β€οΈβ€οΈβ€οΈππ€π€π€π€π€π€ 9/23
π‘οΈ 13 βοΈ
β1/4
β¨ 50
You successfully hit the Giant Bat with your Greatsword for 14 damage.
---
π¦ Giant Bat
β€οΈβ€οΈβ€οΈππ€π€π€π€π€π€ 9/23
π‘οΈ 13 βοΈ
β1/4
β¨ 50
You confronted the Giant Bat!
---
π¦ Giant Bat
β€οΈβ€οΈβ€οΈβ€οΈβ€οΈβ€οΈβ€οΈβ€οΈβ€οΈβ€οΈ 23/23
π‘οΈ 13 βοΈ
β1/4
β¨ 50
You embarked on a journey of adventure.
---
In the distance you see a π¦ Giant Bat
β€οΈ 4-40 βοΈ β1/4 β¨ 50
You purchased the Greatsword and left the shop.
---
You are safe in a small village, what would you like to do?
You walked to a local shop.
---
Stepping into a quaint shop, you're greeted by Snork, the shopkeeper, who eagerly offers to assist you in your quests.
π
βοΈ Halberd [1d10+2, +4] π‘οΈ None [13]
You slept long through the night, regaining 6 hitpoints and 1 hitdice.
---
The walls of a town provide a sense of security, what would you like to do?
You traveled to a nearby town.
---
You are safe in a town, what would you like to do?
You successfully ran away!
---
You encounter a π¦ Giant Owl
β€οΈ 6-33 βοΈ β1/4 β¨ 50
You were hit by the Merfolk's Spear attack, you took 6 damage.
You successfully hit the Merfolk with your Halberd for 3 damage.
---
π§ββοΈ Merfolk
β€οΈβ€οΈβ€οΈβ€οΈβ€οΈβ€οΈβ€οΈππ€π€ 11/14
π‘οΈ 11 π
β1/8
β¨ 25