MKSTR(1)
β¨ MKSTR π β creating an error message file by massaging C source π
okay bestie, so we're doing mkstr from the General Commands Manual section (1) and honestly? she's a little vintage icon. buckle up π¦
πΈ SYNOPSIS πΈ
mkstr [-] mesgfile prefix file ...
π DESCRIPTION π
so the mkstr utility literally creates a file full of error messages, all extracted from C source, and then restructures that same C source so it can use the error message file it just made. iconique behavior β¨
the intent of mkstr was to reduce the size of large programs and reduce swapping β and yes bestie, go read the βBUGSβ section below, it's giving foreshadowing π
the mkstr utility processes each of the specified files, placing a restructured version of the input in a file whose name consists of the specified prefix and the original name. a typical usage of mkstr is
mkstr pistrings xx *.c
this command causes all the error messages from the C source files in the current directory to be placed in the file pistrings and restructured copies of the sources to be placed in files whose names are prefixed with βxxβ. like, it ate and left no crumbs π₯
π Options π
-β error messages are placed at the end of the specified message file, for recompiling part of a largemkstredprogram. (yes, only one option. she's lowkey minimal π)
the mkstr utility finds error messages in the source by searching for the string βerror("β in the input stream. every single time it occurs, the C string starting at the β"β is stored in the message file followed by a null character and a new-line character π the new source is restructured with lseek(2) pointers into the error message file for retrieval. it's giving scavenger hunt but make it pointers π§
char efilname = "/usr/lib/pi_strings";
int efil = -1;
error(a1, a2, a3, a4)
{
char buf[256];
if (efil < 0) {
efil = open(efilname, 0);
if (efil < 0)
err(1, "%s", efilname);
}
if (lseek(efil, (off_t)a1, SEEK_SET) < 0 ||
read(efil, buf, 256) <= 0)
err(1, "%s", efilname);
printf(buf, a2, a3, a4);
}
π«Ά SEE ALSO π«Ά
gencat(1), xstr(1), lseek(2) πΈ
π HISTORY π
the mkstr utility first appeared in 1BSD. a true elder emoji π
β AUTHORS β
Bill Joy and Chuck Haley, 1977. absolute main characters, no cap π
π BUGS π
okay so this is the part where we get real π«Ά the mkstr utility was intended for the limited architecture of the PDP 11 family. very few programs actually use it. the memory savings are negligible in modern computers. so likeβ¦ she served her purpose, but she is not the moment anymore π
ngl bestie, this one is a museum piece β cute, historic, and not saving you any RAM in 2024 π
and that's the whole page, periodt β¨ this beauty comes to you from Debian, dated June 6, 2015, and she's filed under MKSTR(1) π¦π
π¦ where this page comes from
- freebsd 15.1: base 15.1
- Copyright (c) 1980, 1990, 1993 The Regents of the University of California. All rights reserved
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms