COMPILE_ET(1)

πŸ“¦
version 2.1-1.47.4 Β· 3 versions
  • 2.1-1.47.4 Β· alpine 3.22, alpine 3.23, alpine 3.24, arch rolling, centos-stream 10, centos-stream 9, debian bookworm, debian trixie, fedora 43, fedora 44, nixpkgs unstable, opensuse-leap 16.0, ubuntu jammy, ubuntu noble, ubuntu questing, ubuntu resolute, ubuntu stonking (latest)
  • 14.5 Β· freebsd 14.5
  • 15.1 Β· freebsd 15.1
, in alpine 3.22, alpine 3.23, alpine 3.24, arch rolling, centos-stream 10, centos-stream 9, debian bookworm, debian trixie, fedora 43, fedora 44, nixpkgs unstable, opensuse-leap 16.0, ubuntu jammy, ubuntu noble, ubuntu questing, ubuntu resolute, ubuntu stonking

πŸ’– COMPILE_ET πŸ’–

okay bestie, gather round, because today we're talking about compile_et β€” the error table compiler from the General Commands Manual, and honestly? she's a whole vibe. πŸŽ€


✨ NAME ✨

compile_et β€” the error table compiler, no cap πŸ’…


🌸 SYNOPSIS 🌸

compile_et file

πŸ¦‹ DESCRIPTION πŸ¦‹

So here's the tea, bestie: compile_et takes a table that lists error-code names plus the messages that go with them, and turns it into a C source file that you can use with the com_err(3) library. it's giving compiler, it's giving translator, it's giving main character energy fr fr. ✨

your source file name must end with a suffix of .et. no exceptions, she's picky like that. πŸ’…

the file is made of a declaration that supplies the name of the error-code table β€” and that name can be up to four characters long, okay, short and iconic:

error_table name

then after that declaration come up to 256 entries, each one looking exactly like this:

error_code name, " string "

and then finally, to wrap it all up, a lil:

end

to indicate the end of the table. periodt. 🫢

the name of the table gets used to construct the name of a subroutine, initialize_XXXX_error_table, and you literally have to call it in order for the com_err library to even recognize the error table. so don't skip that step bestie, i'm begging 😭

the various error codes you define get assigned sequentially increasing numbers, starting with a large number computed as a hash function of the name of the table. and because of that, for compatibility's sake, it's suggested that new codes be added only to the end of an existing table, and that no codes be removed from tables. don't be messy with it πŸ™ˆ

the names you define in the table get placed into a C header file with preprocessor directives defining them as integer constants of up to 32 bits in magnitude. slay.

a C source file is also generated, and it should be compiled and linked with the object files that reference these error codes. it contains the text of the messages and the initialization subroutine. both C files get their names derived from that of the original source file, with the .et suffix replaced by .c and .h. cute, consistent, obsessed. πŸ’–

oh and one more thing β€” a # in the source file is treated as a comment character, and all remaining text to the end of the source line gets ignored. so go off with your lil notes, she won't read them. 🌸


πŸ’€ BUGS πŸ’€

okay so ngl, this part is a lil tragic. 😭 since the original compile_et uses a very simple parser based on yacc(1), and this current version of compile_et uses an awk/sed combination of scripts, its error recovery leaves much to be desired. like, it's trying its best and we love her for it, but yeah. πŸ’€


🌈 SEE ALSO 🌈

  • com_err (3).

also, Ken Raeburn, "A Common Error Description Library for UNIX". iconic author behavior, we stan. πŸ‘‘


and that's the whole page bestie!! this lil gem came to you from SIPB, dated 30 Mar 1998 β€” yes she's vintage, yes she still serves. now go compile those error tables, you absolute legend. πŸ¦‹βœ¨πŸ’œ

πŸ“¦ where this page comes from