DataMuseum.dk

Presents historical artifacts from the history of:

DKUUG/EUUG Conference tapes

This is an automatic "excavation" of a thematic subset of
artifacts from Datamuseum.dk's BitArchive.

See our Wiki for more about DKUUG/EUUG Conference tapes

Excavated with: AutoArchaeologist - Free & Open Source Software.


top - metrics - download
Index: T l

⟦b160ea4ed⟧ TextFile

    Length: 1433 (0x599)
    Types: TextFile
    Names: »longest_signal_desc.c«

Derivation

└─⟦a05ed705a⟧ Bits:30007078 DKUUG GNU 2/12/89
    └─⟦ca1f037a2⟧ »./bash-1.04.tar.Z« 
        └─⟦46465a4db⟧ 
            └─⟦this⟧ »bash-1.04/longest_signal_desc.c« 

TextFile

/* The answer to this question is 24. */
#include <stdio.h>
#include <signal.h>

/* Copyright (C) 1987,1989 Free Software Foundation, Inc.

This file is part of GNU Bash, the Bourne Again SHell.

Bash is free software; you can redistribute it and/or modify it under
the terms of the GNU General Public License as published by the Free
Software Foundation; either version 1, or (at your option) any later
version.

Bash is distributed in the hope that it will be useful, but WITHOUT ANY
WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
for more details.

You should have received a copy of the GNU General Public License along
with Bash; see the file COPYING.  If not, write to the Free Software
Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */

main (argc, argv)
     int argc;
     char **argv;
{
  extern char *sys_siglist[];
  
  int longest, length = 0;
  int i;

  for (i = 0; i < NSIG; i++) {
    printf ("%s\n", sys_siglist[i]);
    if (strlen (sys_siglist[i]) > length) {
      longest = i;
      length = strlen (sys_siglist[i]);
    }
  }

  if (argc = 1) {
    printf ("The longest one is %d:\"%s\", which is %d chars in length.\n",
	    longest, sys_siglist[longest], length);
  } else {
    printf ("%d", length);
  }
}

/*
 * Local variables:
 * compile-command: "cc -o longest_signal_name longest_signal_name.c"
 * end:
 */