public inbox for linux-man@vger.kernel.org
 help / color / mirror / Atom feed
From: "G. Branden Robinson" <g.branden.robinson@gmail.com>
To: Alejandro Colomar <alx.manpages@gmail.com>
Cc: groff <groff@gnu.org>, Helge Kreutzmann <debian@helgefjell.de>,
	mario.blaettermann@gmail.com, linux-man@vger.kernel.org
Subject: C string function history (was: Italics in SS)
Date: Tue, 13 Dec 2022 15:32:36 -0600	[thread overview]
Message-ID: <20221213213236.x5kmzbj3pfb2sbu2@illithid> (raw)
In-Reply-To: <1257a2f5-7d2b-66e8-fa66-9c041604995b@gmail.com>

[-- Attachment #1: Type: text/plain, Size: 3476 bytes --]

Hi Alex,

At 2022-12-13T21:35:59+0100, Alejandro Colomar wrote:
> > 5.  Not all is joy and roses.  When you do things like embed font
> >      selection escape sequences in a heading, internally groff creates
> >      data structures called "nodes" that are not straightforwardly
> >      encodable in the device control escape sequences that are used to
> >      embed "PDFMark" data in the formatted document.  In the past this
> >      has led to what I nominate as groff's most horribly inscrutable
> >      diagnostic message.
> 
> Does it truncate expectations to have single-volume Linux man-pages if
> I use \f?

Not at all.  You can even use it in (sub)section headings.  The nodes,
unrepresentable as characters, will be silently discarded, leaving you
with ISO Basic Latin characters in your PDF bookmarks.

> I'll pick the merry; I did enough radical stuff recently, and need to
> balance the karma.  ;).
> 
> BTW, I'm reconsidering again releasing.  The rewritten strcpy(3) page
> is sooo necessary!  Shipping it in Bookworm would be a nice dream.
> After some discussion with Martin Sebor, I think I need to rewrite
> strlen(3) too, covering strnlen(3) in the same page.

It's worth having a quick look at just how _small_ the original string.h
header file was.  It was born in the twilight between 7th Edition Unix
(1979) and 8th Edition Research Unix (1985); because the latter took so
long to eventuate, it seems that these functions forked almost as soon
as they were born, into USG and BSD flavors.

/*	@(#)string.h	1.1	*/
extern char
	*strcpy(),
	*strncpy(),
	*strcat(),
	*strncat(),
	*strchr(),
	*strrchr(),
	*strpbrk(),
	*strtok();
extern long
	strtol();

https://minnie.tuhs.org/cgi-bin/utree.pl?file=pdp11v/usr/include/string.h

By 8th Edition Research Unix, it had grown strcmp(), strncmp(),
strlen(), strspn(), and strcspn(), but dropped strtol().  I wonder if
there is a story there.

https://minnie.tuhs.org/cgi-bin/utree.pl?file=V8/usr/include/string.h

Here's strings.h (note the plural) from 4.2BSD (1983).

/*      string.h        4.1     83/05/26        */

/*
 * External function definitions
 * for routines described in string(3).
 */
char    *strcat();
char    *strncat();
int     strcmp();
int     strncmp();
char    *strcpy();
char    *strncpy();
int     strlen();
char    *index();
char    *rindex();

https://minnie.tuhs.org/cgi-bin/utree.pl?file=4.2BSD/usr/include/strings.h

> I'll invite Doug to have some review.  I'm curious about his opinion.
> He probably has some insight of the design of some of those functions
> that we don't.

According to an email of Doug's, Nils-Peter Nelson was the "originator"
of the initial batch of public C string-handling functions.

https://minnie.tuhs.org/pipermail/tuhs/2020-January/020235.html

To my surprise, I've never been able to turn up any interviews with him
as a Bell Labs veteran, inviting him to reminisce about his role in the
creation of some of the most widely used functions in all of
programming.

Given the pain that has attached to use of them over the years, and the
steadily growing amount of literature documenting just how dangerous
they can be to use, perhaps he refuses interview requests for fear of
the encounter turning into a Struggle Session.  😈

Maybe he had enough of C, and if so, I can't blame him.  What I did find
seems to be Lisp-related.

Regards,
Branden

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

      reply	other threads:[~2022-12-13 21:32 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-12-04  9:07 Issue in man page namespaces.7 Helge Kreutzmann
2022-12-04 12:34 ` Italics in SS (was: Issue in man page namespaces.7) Alejandro Colomar
2022-12-13 17:35   ` G. Branden Robinson
2022-12-13 20:35     ` Alejandro Colomar
2022-12-13 21:32       ` G. Branden Robinson [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20221213213236.x5kmzbj3pfb2sbu2@illithid \
    --to=g.branden.robinson@gmail.com \
    --cc=alx.manpages@gmail.com \
    --cc=debian@helgefjell.de \
    --cc=groff@gnu.org \
    --cc=linux-man@vger.kernel.org \
    --cc=mario.blaettermann@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox