Sinopsis de C

PeerTube
"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 :|

#programming

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.ยซ

https://github.com/manipuladordedados/tocaia

#c89 #gopher #retronetworking #dfue

GitHub - manipuladordedados/tocaia: Portable TUI Gopher client written in C89 for POSIX systems.

Portable TUI Gopher client written in C89 for POSIX systems. - manipuladordedados/tocaia

GitHub

@cks @whitequark

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.

#CLanguage #StandardC #C89 #POSIX1 #malloc #SVID

@cks @whitequark

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.

#CLanguage #StandardC #C89 #POSIX1 #malloc #SVID

malloc(0) fails on AIX and nowhere else I could find ...

You managed to hit the Giant Bat for 7 damage with your Greatsword.
You were hit by the Giant Bat's Bite attack, you took 5 damage.
You got knocked unconscious and ultimately succumbed to your injuries.
---
๐Ÿชฆ Here lies Max, the Gnome Barbarian

โค๏ธ 14 โญ 1 ๐Ÿช™ 12
โš”๏ธ Greatsword [2d6+2, +4] ๐Ÿ›ก๏ธ None [13]
Str 14 Dex 12 Con 14 Int 13 Wis 8 Cha 11
โ˜ ๏ธ 0

โš’๏ธ๐Ÿงš๐Ÿงโ€โ™‚๏ธ๐Ÿ˜๏ธ๐Ÿฆโ˜ ๏ธ
๐Ÿ—บ๏ธ 89 ๐Ÿ•› 12:01 ๐Ÿ‘ค 280
#dndend

#c89

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

#c89

๐Ÿน Ranged, improvised [1d4+1]
0%
โš”๏ธ Melee, two-handed [2d6+2] โฌ‡๏ธ
50%
๐Ÿ‘Š Melee, unarmed [1+2] โฌ‡๏ธ
12.5%
๐Ÿƒ Run!
37.5%
Poll ended at .

You were hit by the Giant Bat's Bite attack, you took 8 damage.
---
๐Ÿฆ Giant Bat
โค๏ธโค๏ธโค๏ธ๐Ÿ’”๐Ÿ–ค๐Ÿ–ค๐Ÿ–ค๐Ÿ–ค๐Ÿ–ค๐Ÿ–ค 9/23
๐Ÿ›ก๏ธ 13 โ˜๏ธ
โ•1/4
โœจ 50

#c89

๐Ÿน Ranged, improvised [1d4+1]
0%
โš”๏ธ Melee, two-handed [2d6+2] โฌ‡๏ธ
85.7%
๐Ÿ‘Š Melee, unarmed [1+2] โฌ‡๏ธ
0%
๐Ÿƒ Run!
14.3%
Poll ended at .