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