IPC-Signal-1.00/004075500005500000162000000000000661543415700137445ustar00roderickmis00000000000000IPC-Signal-1.00/Makefile.PL010044400005500000162000000007350633675237000157160ustar00roderickmis00000000000000# $Id: Makefile.PL,v 1.2 1997-05-15 23:22:49-04 roderick Exp $ # # Copyright (c) 1997 Roderick Schertler. All rights reserved. This # program is free software; you can redistribute it and/or modify it # under the same terms as Perl itself. use ExtUtils::MakeMaker; WriteMakefile( NAME => 'IPC::Signal', VERSION_FROM => 'Signal.pm', dist => { COMPRESS => 'gzip --best', DIST_CP => 'ln', PREOP => '$(MAKE) ci', SUFFIX => 'gz', }, ); IPC-Signal-1.00/Signal.pm010044400005500000162000000060760661543403600155170ustar00roderickmis00000000000000# $Id: Signal.pm,v 1.4 1998-10-27 16:16:13-05 roderick Exp $ # # Copyright (c) 1997 Roderick Schertler. All rights reserved. This # program is free software; you can redistribute it and/or modify it # under the same terms as Perl itself. package IPC::Signal; use 5.003_94; # __PACKAGE__ use strict; use vars qw($VERSION @ISA @EXPORT_OK $AUTOLOAD %Sig_num @Sig_name); require Exporter; $VERSION = '1.00'; @ISA = qw(Exporter); @EXPORT_OK = qw(sig_num sig_name sig_translate_setup %Sig_num @Sig_name); %Sig_num = (); @Sig_name = (); sub sig_num ($); sub sig_name ($); sub sig_translate_setup () { return if %Sig_num && @Sig_name; require Config; # In 5.005 the sig_num entries are comma separated and there's a # trailing 0. my $num = $Config::Config{'sig_num'}; if ($num =~ s/,//g) { $num =~ s/\s+0$//; } my @name = split ' ', $Config::Config{'sig_name'}; my @num = split ' ', $num; @name or die 'No signals defined'; @name == @num or die 'Signal name/number mismatch'; @Sig_num{@name} = @num; keys %Sig_num == @name or die 'Duplicate signal names present'; for (@name) { $Sig_name[$Sig_num{$_}] = $_ unless defined $Sig_name[$Sig_num{$_}]; } } # This autoload routine just is just for sig_num() and sig_name(). It # calls sig_translate_setup() and then snaps the real function definitions # into place. sub AUTOLOAD { if ($AUTOLOAD ne __PACKAGE__ . '::sig_num' && $AUTOLOAD ne __PACKAGE__ . '::sig_name') { require Carp; Carp::croak("Undefined subroutine &$AUTOLOAD called"); } sig_translate_setup; *sig_num = sub ($) { $Sig_num{$_[0]} }; *sig_name = sub ($) { $Sig_name[$_[0]] }; goto &$AUTOLOAD; } 1 __END__ =head1 NAME IPC::Signal - Utility functions dealing with signals =head1 SYNOPSIS $number = sig_num $name; $name = sig_name $number; sig_translate_setup; $number = $Sig_num{$name}; $name = $Sig_name[$number]; =head1 DESCRIPTION This module contains utility functions for dealing with signals. Nothing is exported by default. =over =item B I Returns the signal number of the signal whose name (sans C) is I, or undef if there is no such signal. This function is prototyped to take a single scalar argument. =item B I Returns the chopped signal name (like C) of signal number I, or undef if there is no such signal. This function is prototyped to take a single scalar argument. =item B If you want to use the @Sig_name and %Sig_num variables directly you must call B to initialize them. This isn't necessary if you only use the function interfaces sig_name() and sig_num(). This function is prototyped to take no arguments. =item B<%Sig_num> A hash with chopped signal name keys (like C) and integer signal number values. =item B<@Sig_name> An array mapping signal numbers to chopped signal names (like C). =back =head1 AUTHOR Roderick Schertler > =head1 SEE ALSO perl(1). =cut IPC-Signal-1.00/Changes010044400005500000162000000006240661543350000152230ustar00roderickmis00000000000000Revision history for Perl extension IPC::Signal. 1.00 Tue Oct 27 16:10:16 EST 1998 - Handle the change in $Config{sig_num} in 5.005. 0.02 Thu May 15 23:22:21 EDT 1997 - Rename from IPC::Signal::Translate. - Provide sig_name() and sig_num() via specialized &AUTOLOAD. 0.01 Wed May 14 22:36:18 EDT 1997 - Initial version. $Id: Changes,v 1.3 1998-10-27 16:12:32-05 roderick Exp $ IPC-Signal-1.00/t/004075500005500000162000000000000661543415700142075ustar00roderickmis00000000000000IPC-Signal-1.00/t/signal.t010055500005500000162000000015120633675237200156500ustar00roderickmis00000000000000#!perl -w use strict; # $Id: signal.t,v 1.2 1997-05-15 23:23:59-04 roderick Exp $ # # Copyright (c) 1997 Roderick Schertler. All rights reserved. This # program is free software; you can redistribute it and/or modify it # under the same terms as Perl itself. BEGIN { $| = 1; print "1..7\n"; } use IPC::Signal qw(/^/); sub ok { my ($n, $result, @info) = @_; if ($result) { print "ok $n\n"; } else { print "not ok $n\n"; print "# ", @info, "\n" if @info; } } ok 1, @Sig_name == 0, "name predefined: @Sig_name"; ok 2, keys %Sig_num == 0, 'num predefined'; ok 3, sig_num('HUP') == 1, sig_num 'HUP'; ok 4, sig_name(1) eq 'HUP', sig_name 1; ok 5, keys %Sig_num >= @Sig_name, keys(%Sig_num) . ' < ' . @Sig_name; ok 6, $Sig_num{HUP} == 1, $Sig_num{HUP}; ok 7, $Sig_name[1] eq 'HUP', $Sig_name[1]; IPC-Signal-1.00/MANIFEST.SKIP010044400005500000162000000001240633675237100156330ustar00roderickmis00000000000000# $Id: MANIFEST.SKIP,v 1.1 1997-05-14 22:48:48-04 roderick Exp $ ,v$ ~$ ^Makefile$ IPC-Signal-1.00/README010044400005500000162000000007710634132374700146220ustar00roderickmis00000000000000This distribution contains the IPC::Signal module. To build it run perl Makefile.PL make make test make install The documentation is embeded in the module, use perldoc Signal.pm to read it before installation. Roderick Schertler Copyright (c) 1997 Roderick Schertler. All rights reserved. This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself. $Id: README,v 1.3 1997-05-23 10:21:26-04 roderick Exp $ IPC-Signal-1.00/MANIFEST010044400005500000162000000002030633675237200150650ustar00roderickmis00000000000000 $Id: MANIFEST,v 1.2 1997-05-15 23:23:49-04 roderick Exp $ Changes MANIFEST MANIFEST.SKIP Makefile.PL README Signal.pm t/signal.t