home *** CD-ROM | disk | FTP | other *** search
/ c't freeware shareware 1997 / CT_SW_97.ISO / mac / Software / entwickl / win95 / pw32i306.exe / lib / Win32 / ipc.pm < prev    next >
Text File  |  1996-11-29  |  2KB  |  67 lines

  1. package Win32::IPC;
  2.  
  3. =head1 NAME
  4.  
  5. Win32::IPC - Support module for Semaphores, Mutexes,Process
  6. and ChangeNotify Synchronization
  7.  
  8. =head1 SYNOPSIS
  9.  
  10.     use Win32::Process;
  11.     #Create objects.
  12.     
  13.     Win32::Process::WaitForMultipleObjects(@ListOfObjects,$WaitAll,$Timeout);
  14.  
  15. =head1 DESCRIPTION
  16.  
  17. This module is loaded by any of the IPC supporting modules. (listed above).
  18. It supplies the WaitForMultipleObjects call to those objects.
  19.  
  20. =cut
  21.  
  22. require Exporter;
  23. require DynaLoader;
  24. require AutoLoader;
  25.  
  26. @ISA = qw(Exporter DynaLoader);
  27. # Items to export into callers namespace by default. Note: do not export
  28. # names by default without a very good reason. Use EXPORT_OK instead.
  29. # Do not simply export all your public functions/methods/constants.
  30. @EXPORT = qw(
  31.     INFINITE
  32.     WaitForMultipleObjects
  33. );
  34.  
  35. sub AUTOLOAD {
  36.     # This AUTOLOAD is used to 'autoload' constants from the constant()
  37.     # XS function.  If a constant is not found then control is passed
  38.     # to the AUTOLOAD in AutoLoader.
  39.  
  40.     my($constname);
  41.     ($constname = $AUTOLOAD) =~ s/.*:://;
  42.     #reset $! to zero to reset any current errors.
  43.     $!=0;
  44.     my $val = constant($constname, @_ ? $_[0] : 0);
  45.     if ($! != 0) {
  46.     if ($! =~ /Invalid/) {
  47.         $AutoLoader::AUTOLOAD = $AUTOLOAD;
  48.         goto &AutoLoader::AUTOLOAD;
  49.     }
  50.     else {
  51.         ($pack,$file,$line) = caller;
  52.         die "Your vendor has not defined Win32::IPC macro $constname, used at $file line $line.";
  53.     }
  54.     }
  55.     eval "sub $AUTOLOAD { $val }";
  56.     goto &$AUTOLOAD;
  57. }
  58.  
  59. bootstrap Win32::IPC;
  60.  
  61. # Preloaded methods go here.
  62.  
  63. # Autoload methods go after __END__, and are processed by the autosplit program.
  64.  
  65. 1;
  66. __END__
  67.