1package Amiga::Exec; 2 3use 5.016000; 4use strict; 5use warnings; 6use Carp; 7 8use Exporter 'import'; 9 10# Items to export into callers namespace by default. Note: do not export 11# names by default without a very good reason. Use EXPORT_OK instead. 12# Do not simply export all your public functions/methods/constants. 13 14# This allows declaration use Amiga::Exec ':all'; 15# If you do not need this, moving things directly into @EXPORT or @EXPORT_OK 16# will save memory. 17our %EXPORT_TAGS = ( 'all' => [ qw( 18Wait 19) ] ); 20 21our @EXPORT_OK = ( @{ $EXPORT_TAGS{'all'} } ); 22 23our @EXPORT = qw( 24); 25 26our $VERSION = '0.04'; 27 28require XSLoader; 29XSLoader::load('Amiga::Exec', $VERSION); 30 31 32sub Wait 33{ 34 my %params = @_; 35 my $signalmask = 0; 36 my $timeout = 0; 37 38 if(exists $params{'SignalMask'}) 39 { 40 $signalmask = $params{'SignalMask'}; 41 } 42 if(exists $params{'TimeOut'}) 43 { 44 $timeout = $params{'TimeOut'}; 45 } 46 47 my $result = Amiga::Exec::_Wait($signalmask,$timeout); 48 return $result; 49} 50 51 52 53# Preloaded methods go here. 54 55# Autoload methods go after =cut, and are processed by the autosplit program. 56 571; 58__END__ 59# Below is stub documentation for your module. You'd better edit it! 60 61=head1 NAME 62 63Amiga::Exec - Perl extension for low level amiga support 64 65=head1 ABSTRACT 66 67This a perl class / module to enables you to use various low level Amiga features such as waiting on an Exec signal 68 69=head1 SYNOPSIS 70 71 # Wait for signla 72 73 use Amiga::Exec; 74 my $result = Amiga::ARexx->Wait('SignalMask' => $signalmask, 75 'TimeOut' => $timeoutinusecs); 76 77=head1 DESCRIPTION 78 79The interface to Exec in entirely encapsulated within the perl class, there 80is no need to access the low level methods directly and they are not exported by default. 81 82=head1 Amiga::ARexx METHODS 83 84=head2 Wait 85 86 $signals = Amiga::Exec->Wait('SignalMask' => $signalmask, 87 'TimeOut' => $timeoutinusecs ); 88 89Wait on a signal set with optional timeout. The result ($signals) should be checked to 90determine which signal was raised. It will be 0 for timeout. 91 92=head3 Signal 93 94The signal Exec signal mask 95 96=head3 TimeOut 97 98optional time out in microseconds. 99 100=head2 EXPORT 101 102None by default. 103 104=head2 Exportable constants 105 106None 107 108=head1 AUTHOR 109 110Andy Broad <andy@broad.ology.org.uk> 111 112=head1 COPYRIGHT AND LICENSE 113 114Copyright (C) 2013 by Andy Broad. 115 116 117=cut 118 119 120 121