home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / perl501m.zip / patches / patch.1h < prev    next >
Text File  |  1995-05-31  |  35KB  |  1,221 lines

  1. # This is my patch  patch.1h for perl5.001.  See description below.
  2. #    Andy Dougherty        doughera@lafcol.lafayette.edu
  3. #
  4.  
  5. # Please execute the following commands before applying this patch.
  6. # (You can feed this patch to 'sh' to do so.)
  7.  
  8. # This is now embedded in the appropriate .pm file.
  9. rm -f ext/DynaLoader/DynaLoader.doc
  10. exit
  11.  
  12. This is my patch  patch.1h  for perl5.001.
  13.  
  14. To apply, change to your perl directory, run the commands above, then
  15. apply with
  16.     patch -p1 -N  < thispatch.
  17.  
  18. After you apply this patch, you should apply patch.1i before
  19. reConfiguring and rebuilding.
  20.  
  21. This patch just includes updates to the ext/ subdirectory.
  22.  
  23. Here are the highlights:
  24.     Grand autoload patch.
  25.  
  26.     Embedded pods.
  27.  
  28.     DB_File and GDBM_File updates.
  29.  
  30. Patch and enjoy,
  31.     Andy Dougherty        doughera@lafcol.lafayette.edu
  32.     Dept. of Physics
  33.     Lafayette College    Easton, PA  18042
  34.  
  35.  
  36. Here's the file-by-file breakdown of what's included:
  37.  
  38. ext/DB_File/DB_File.pm
  39.     Updated to version 0.2
  40.  
  41.     Embedded pod.
  42.  
  43. ext/DB_File/DB_File.xs
  44.     Updated to version 0.2
  45.  
  46. ext/DynaLoader/DynaLoader.pm
  47.     Embedded pod.
  48.  
  49. ext/DynaLoader/README
  50.     Updated to refer to pod documentation in DynaLoader.pm.
  51.  
  52. ext/Fcntl/Fcntl.pm
  53.     Grand AutoLoader patch.
  54.  
  55.     Embedded pod.
  56.  
  57. ext/GDBM_File/GDBM_File.pm
  58.     Grand AutoLoader patch.
  59.  
  60.     Embedded pod.
  61.  
  62. ext/GDBM_File/GDBM_File.xs
  63.     Added gdbm_sync(), gdbm_exists(), and gdbm_setopt() functions.
  64.  
  65. ext/POSIX/POSIX.pm
  66.     Grand AutoLoader patch.
  67.  
  68.     Embedded pod.
  69.  
  70.     move tan() into the .xs file.  (It didn't exist before.)
  71.  
  72.     Change usage message for chmod to reflect reality.
  73.  
  74. ext/POSIX/POSIX.xs
  75.     move tan() into the .xs file.  (It didn't exist before.)
  76.  
  77. ext/SDBM_File/sdbm/sdbm.c
  78.     Fix type of free prototype.
  79.  
  80. ext/Socket/Socket.pm
  81.     Grand AutoLoader patch.
  82.  
  83.     Embedded pod.
  84.  
  85. Index: ext/DB_File/DB_File.pm
  86. *** perl5.001g/ext/DB_File/DB_File.pm    Sun Mar 12 00:04:59 1995
  87. --- perl5.001h/ext/DB_File/DB_File.pm    Thu May 25 11:43:43 1995
  88. ***************
  89. *** 1,8 ****
  90.   # DB_File.pm -- Perl 5 interface to Berkeley DB 
  91.   #
  92.   # written by Paul Marquess (pmarquess@bfsec.bt.co.uk)
  93. ! # last modified 23rd June 1994
  94. ! # version 0.1
  95.   
  96.   package DB_File::HASHINFO ;
  97.   use Carp;
  98. --- 1,343 ----
  99.   # DB_File.pm -- Perl 5 interface to Berkeley DB 
  100.   #
  101.   # written by Paul Marquess (pmarquess@bfsec.bt.co.uk)
  102. ! # last modified 19th May 1995
  103. ! # version 0.2
  104. ! =head1 NAME
  105. ! DB_File - Perl5 access to Berkeley DB
  106. ! =head1 SYNOPSIS
  107. !  use DB_File ;
  108. !   
  109. !  [$X =] tie %hash,  DB_File, $filename [, $flags, $mode, $DB_HASH] ;
  110. !  [$X =] tie %hash,  DB_File, $filename, $flags, $mode, $DB_BTREE ;
  111. !  [$X =] tie @array, DB_File, $filename, $flags, $mode, $DB_RECNO ;
  112. !    
  113. !  $status = $X->del($key [, $flags]) ;
  114. !  $status = $X->put($key, $value [, $flags]) ;
  115. !  $status = $X->get($key, $value [, $flags]) ;
  116. !  $status = $X->seq($key, $value [, $flags]) ;
  117. !  $status = $X->sync([$flags]) ;
  118. !  $status = $X->fd ;
  119. !     
  120. !  untie %hash ;
  121. !  untie @array ;
  122. ! =head1 DESCRIPTION
  123. ! B<DB_File> is a module which allows Perl programs to make use of 
  124. ! the facilities provided by Berkeley DB.  If you intend to use this
  125. ! module you should really have a copy of the Berkeley DB manual
  126. ! page at hand. The interface defined here
  127. ! mirrors the Berkeley DB interface closely.
  128. ! Berkeley DB is a C library which provides a consistent interface to a number of 
  129. ! database formats. 
  130. ! B<DB_File> provides an interface to all three of the database types currently
  131. ! supported by Berkeley DB.
  132. ! The file types are:
  133. ! =over 5
  134. ! =item DB_HASH
  135. ! This database type allows arbitrary key/data pairs to be stored in data files.
  136. ! This is equivalent to the functionality provided by 
  137. ! other hashing packages like DBM, NDBM, ODBM, GDBM, and SDBM.
  138. ! Remember though, the files created using DB_HASH are 
  139. ! not compatible with any of the other packages mentioned.
  140. ! A default hashing algorithm, which will be adequate for most applications, 
  141. ! is built into Berkeley DB.  
  142. ! If you do need to use your own hashing algorithm it is possible to write your
  143. ! own in Perl and have B<DB_File> use it instead.
  144. ! =item DB_BTREE
  145. ! The btree format allows arbitrary key/data pairs to be stored in a sorted, 
  146. ! balanced binary tree.
  147. ! As with the DB_HASH format, it is possible to provide a user defined Perl routine
  148. ! to perform the comparison of keys. By default, though, the keys are stored 
  149. ! in lexical order.
  150. ! =item DB_RECNO
  151. ! DB_RECNO allows both fixed-length and variable-length flat text files to be 
  152. ! manipulated using 
  153. ! the same key/value pair interface as in DB_HASH and DB_BTREE. 
  154. ! In this case the key will consist of a record (line) number. 
  155. ! =back
  156. ! =head2 How does DB_File interface to Berkeley DB?
  157. ! B<DB_File> allows access to Berkeley DB files using the tie() mechanism
  158. ! in Perl 5 (for full details, see L<perlfunc/tie()>).
  159. ! This facility allows B<DB_File> to access Berkeley DB files using
  160. ! either an associative array (for DB_HASH & DB_BTREE file types) or an
  161. ! ordinary array (for the DB_RECNO file type).
  162. ! In addition to the tie() interface, it is also possible to use most of the
  163. ! functions provided in the Berkeley DB API.
  164. ! =head2 Differences with Berkeley DB
  165. ! Berkeley DB uses the function dbopen() to open or create a 
  166. ! database. Below is the C prototype for dbopen().
  167. !       DB*
  168. !       dbopen (const char * file, int flags, int mode, 
  169. !               DBTYPE type, const void * openinfo)
  170. ! The parameter C<type> is an enumeration which specifies which of the 3
  171. ! interface methods (DB_HASH, DB_BTREE or DB_RECNO) is to be used.
  172. ! Depending on which of these is actually chosen, the final parameter,
  173. ! I<openinfo> points to a data structure which allows tailoring of the
  174. ! specific interface method.
  175. ! This interface is handled 
  176. ! slightly differently in B<DB_File>. Here is an equivalent call using
  177. ! B<DB_File>.
  178. !         tie %array, DB_File, $filename, $flags, $mode, $DB_HASH ;
  179. ! The C<filename>, C<flags> and C<mode> parameters are the direct equivalent 
  180. ! of their dbopen() counterparts. The final parameter $DB_HASH
  181. ! performs the function of both the C<type> and C<openinfo>
  182. ! parameters in dbopen().
  183. ! In the example above $DB_HASH is actually a reference to a hash object.
  184. ! B<DB_File> has three of these pre-defined references.
  185. ! Apart from $DB_HASH, there is also $DB_BTREE and $DB_RECNO.
  186. ! The keys allowed in each of these pre-defined references is limited to the names
  187. ! used in the equivalent C structure.
  188. ! So, for example, the $DB_HASH reference will only allow keys called C<bsize>,
  189. ! C<cachesize>, C<ffactor>, C<hash>, C<lorder> and C<nelem>. 
  190. ! To change one of these elements, just assign to it like this
  191. !     $DB_HASH{cachesize} = 10000 ;
  192. ! =head2 RECNO
  193. ! In order to make RECNO more compatible with Perl the array offset for all
  194. ! RECNO arrays begins at 0 rather than 1 as in Berkeley DB.
  195. ! =head2 In Memory Databases
  196. ! Berkeley DB allows the creation of in-memory databases by using NULL (that is, a 
  197. ! C<(char *)0 in C) in 
  198. ! place of the filename. 
  199. ! B<DB_File> uses C<undef> instead of NULL to provide this functionality.
  200. ! =head2 Using the Berkeley DB Interface Directly
  201. ! As well as accessing Berkeley DB using a tied hash or array, it is also
  202. ! possible to make direct use of most of the functions defined in the Berkeley DB
  203. ! documentation.
  204. ! To do this you need to remember the return value from the tie.
  205. !     $db = tie %hash, DB_File, "filename"
  206. ! Once you have done that, you can access the Berkeley DB API functions directly.
  207. !     $db->put($key, $value, R_NOOVERWRITE) ;
  208. ! All the functions defined in L<dbx(3X)> are available except
  209. ! for close() and dbopen() itself.  
  210. ! The B<DB_File> interface to these functions have been implemented to mirror
  211. ! the the way Berkeley DB works. In particular note that all the functions return
  212. ! only a status value. Whenever a Berkeley DB function returns data via one of
  213. ! its parameters, the B<DB_File> equivalent does exactly the same.
  214. ! All the constants defined in L<dbopen> are also available.
  215. ! Below is a list of the functions available.
  216. ! =over 5
  217. ! =item get
  218. ! Same as in C<recno> except that the flags parameter is optional. 
  219. ! Remember the value
  220. ! associated with the key you request is returned in the $value parameter.
  221. ! =item put
  222. ! As usual the flags parameter is optional. 
  223. ! If you use either the R_IAFTER or
  224. ! R_IBEFORE flags, the key parameter will have the record number of the inserted
  225. ! key/value pair set.
  226. ! =item del
  227. ! The flags parameter is optional.
  228. ! =item fd
  229. ! As in I<recno>.
  230. ! =item seq
  231. ! The flags parameter is optional.
  232. ! Both the key and value parameters will be set.
  233. ! =item sync
  234. ! The flags parameter is optional.
  235. ! =back
  236. ! =head1 EXAMPLES
  237. ! It is always a lot easier to understand something when you see a real example.
  238. ! So here are a few.
  239. ! =head2 Using HASH
  240. !     use DB_File ;
  241. !     use Fcntl ;
  242. !     
  243. !     tie %h,  DB_File, "hashed", O_RDWR|O_CREAT, 0640, $DB_HASH ;
  244. !     
  245. !     # Add a key/value pair to the file
  246. !     $h{"apple"} = "orange" ;
  247. !     
  248. !     # Check for existence of a key
  249. !     print "Exists\n" if $h{"banana"} ;
  250. !     
  251. !     # Delete 
  252. !     delete $h{"apple"} ;
  253. !     
  254. !     untie %h ;
  255. ! =head2 Using BTREE
  256. ! Here is sample of code which used BTREE. Just to make life more interesting
  257. ! the default comparision function will not be used. Instead a Perl sub, C<Compare()>,
  258. ! will be used to do a case insensitive comparison.
  259. !         use DB_File ;
  260. !         use Fcntl ;
  261. !      
  262. !     sub Compare
  263. !         {
  264. !         my ($key1, $key2) = @_ ;
  265. !     
  266. !         "\L$key1" cmp "\L$key2" ;
  267. !     }
  268. !     
  269. !         $DB_BTREE->{compare} = 'Compare' ;
  270. !      
  271. !         tie %h,  DB_File, "tree", O_RDWR|O_CREAT, 0640, $DB_BTREE ;
  272. !      
  273. !         # Add a key/value pair to the file
  274. !         $h{'Wall'} = 'Larry' ;
  275. !         $h{'Smith'} = 'John' ;
  276. !     $h{'mouse'} = 'mickey' ;
  277. !     $h{'duck'}   = 'donald' ;
  278. !      
  279. !         # Delete
  280. !         delete $h{"duck"} ;
  281. !      
  282. !     # Cycle through the keys printing them in order.
  283. !     # Note it is not necessary to sort the keys as
  284. !     # the btree will have kept them in order automatically.
  285. !     foreach (keys %h)
  286. !       { print "$_\n" }
  287. !     
  288. !         untie %h ;
  289. ! Here is the output from the code above.
  290. !     mouse
  291. !     Smith
  292. !     Wall
  293. ! =head2 Using RECNO
  294. !     use DB_File ;
  295. !     use Fcntl ;
  296. !     
  297. !     $DB_RECNO->{psize} = 3000 ;
  298. !     
  299. !     tie @h,  DB_File, "text", O_RDWR|O_CREAT, 0640, $DB_RECNO ;
  300. !     
  301. !     # Add a key/value pair to the file
  302. !     $h[0] = "orange" ;
  303. !     
  304. !     # Check for existence of a key
  305. !     print "Exists\n" if $h[1] ;
  306. !     
  307. !     untie @h ;
  308. ! =head1 CHANGES
  309. ! =head2 0.1
  310. ! First Release.
  311. ! =head2 0.2
  312. ! When B<DB_File> is opening a database file it no longer terminates the
  313. ! process if I<dbopen> returned an error. This allows file protection
  314. ! errors to be caught at run time. Thanks to Judith Grass
  315. ! <grass@cybercash.com> for spotting the bug.
  316. ! =head1 WARNINGS
  317. ! If you happen find any other functions defined in the source for this module 
  318. ! that have not been mentioned in this document -- beware. 
  319. ! I may drop them at a moments notice.
  320. ! If you cannot find any, then either you didn't look very hard or the moment has
  321. ! passed and I have dropped them.
  322. ! =head1 BUGS
  323. ! Some older versions of Berkeley DB had problems with fixed length records
  324. ! using the RECNO file format. The newest version at the time of writing 
  325. ! was 1.85 - this seems to have fixed the problems with RECNO.
  326. ! I am sure there are bugs in the code. If you do find any, or can suggest any
  327. ! enhancements, I would welcome your comments.
  328. ! =head1 AVAILABILITY
  329. ! Berkeley DB is available via the hold C<ftp.cs.berkeley.edu> in the
  330. ! directory C</ucb/4bsd/db.tar.gz>.  It is I<not> under the GPL.
  331. ! =head1 SEE ALSO
  332. ! L<perl(1)>, L<dbopen(3)>, L<hash(3)>, L<recno(3)>, L<btree(3)> 
  333. ! Berkeley DB is available from F<ftp.cs.berkeley.edu> in the directory F</ucb/4bsd>.
  334. ! =head1 AUTHOR
  335. ! The DB_File interface was written by 
  336. ! Paul Marquess <pmarquess@bfsec.bt.co.uk>.
  337. ! Questions about the DB system itself may be addressed to
  338. ! Keith Bostic  <bostic@cs.berkeley.edu>.
  339. ! =cut
  340.   
  341.   package DB_File::HASHINFO ;
  342.   use Carp;
  343. ***************
  344. *** 177,183 ****
  345.   
  346.   require TieHash;
  347.   require Exporter;
  348. ! require AutoLoader;
  349.   require DynaLoader;
  350.   @ISA = qw(TieHash Exporter DynaLoader);
  351.   @EXPORT = qw(
  352. --- 512,518 ----
  353.   
  354.   require TieHash;
  355.   require Exporter;
  356. ! use AutoLoader;
  357.   require DynaLoader;
  358.   @ISA = qw(TieHash Exporter DynaLoader);
  359.   @EXPORT = qw(
  360. Index: ext/DB_File/DB_File.xs
  361. *** perl5.001g/ext/DB_File/DB_File.xs    Thu Jan 19 19:06:37 1995
  362. --- perl5.001h/ext/DB_File/DB_File.xs    Tue May 23 14:57:56 1995
  363. ***************
  364. *** 3,13 ****
  365.    DB_File.xs -- Perl 5 interface to Berkeley DB 
  366.   
  367.    written by Paul Marquess (pmarquess@bfsec.bt.co.uk)
  368. !  last modified 23rd June 1994
  369. !  version 0.1
  370.   
  371.    All comments/suggestions/problems are welcome
  372.   
  373.   */
  374.   
  375.   #include "EXTERN.h"  
  376. --- 3,16 ----
  377.    DB_File.xs -- Perl 5 interface to Berkeley DB 
  378.   
  379.    written by Paul Marquess (pmarquess@bfsec.bt.co.uk)
  380. !  last modified 19th May 1995
  381. !  version 0.2
  382.   
  383.    All comments/suggestions/problems are welcome
  384.   
  385. +  Changes:
  386. +     0.1 - Initial Release
  387. +     0.2 - No longer bombs out if dbopen returns an error.
  388.   */
  389.   
  390.   #include "EXTERN.h"  
  391. ***************
  392. *** 414,427 ****
  393.   
  394.       RETVAL = dbopen(name, flags, mode, type, openinfo) ; 
  395.   
  396. -     if (RETVAL == 0)
  397. -         croak("DB_File::%s failed, reason: %s", string, Strerror(errno)) ;
  398.       /* kludge mode on: RETVAL->type for DB_RECNO is set to DB_BTREE
  399.                  so remember a DB_RECNO by saving the address
  400.                  of one of it's internal routines
  401.       */
  402. !     if (type == DB_RECNO)
  403.           DB_recno_close = RETVAL->close ;
  404.   
  405.   
  406. --- 417,427 ----
  407.   
  408.       RETVAL = dbopen(name, flags, mode, type, openinfo) ; 
  409.   
  410.       /* kludge mode on: RETVAL->type for DB_RECNO is set to DB_BTREE
  411.                  so remember a DB_RECNO by saving the address
  412.                  of one of it's internal routines
  413.       */
  414. !     if (RETVAL && type == DB_RECNO)
  415.           DB_recno_close = RETVAL->close ;
  416.   
  417.   
  418. Index: ext/DynaLoader/DynaLoader.pm
  419. *** perl5.001g/ext/DynaLoader/DynaLoader.pm    Sun Mar 12 00:05:13 1995
  420. --- perl5.001h/ext/DynaLoader/DynaLoader.pm    Thu May 25 11:45:15 1995
  421. ***************
  422. *** 1,5 ****
  423. --- 1,324 ----
  424.   package DynaLoader;
  425.   
  426. + =head1 NAME
  427. + DynaLoader - Dynamically load C libraries into Perl code
  428. + dl_error(), dl_findfile(), dl_expandspec(), dl_load_file(), dl_find_symbol(), dl_undef_symbols(), dl_install_xsub(), boostrap() - routines used by DynaLoader modules
  429. + =head1 SYNOPSIS
  430. +     require DynaLoader;
  431. +     push (@ISA, 'DynaLoader');
  432. + =head1 DESCRIPTION
  433. + This specification defines a standard generic interface to the dynamic
  434. + linking mechanisms available on many platforms.  Its primary purpose is
  435. + to implement automatic dynamic loading of Perl modules.
  436. + The DynaLoader is designed to be a very simple high-level
  437. + interface that is sufficiently general to cover the requirements
  438. + of SunOS, HP-UX, NeXT, Linux, VMS and other platforms.
  439. + It is also hoped that the interface will cover the needs of OS/2,
  440. + NT etc and allow pseudo-dynamic linking (using C<ld -A> at runtime).
  441. + This document serves as both a specification for anyone wishing to
  442. + implement the DynaLoader for a new platform and as a guide for
  443. + anyone wishing to use the DynaLoader directly in an application.
  444. + It must be stressed that the DynaLoader, by itself, is practically
  445. + useless for accessing non-Perl libraries because it provides almost no
  446. + Perl-to-C 'glue'.  There is, for example, no mechanism for calling a C
  447. + library function or supplying arguments.  It is anticipated that any
  448. + glue that may be developed in the future will be implemented in a
  449. + separate dynamically loaded module.
  450. + DynaLoader Interface Summary
  451. +   @dl_library_path
  452. +   @dl_resolve_using
  453. +   @dl_require_symbols
  454. +   $dl_debug
  455. +                                                   Implemented in:
  456. +   bootstrap($modulename)                               Perl
  457. +   @filepaths = dl_findfile(@names)                     Perl
  458. +   $libref  = dl_load_file($filename)                   C
  459. +   $symref  = dl_find_symbol($libref, $symbol)          C
  460. +   @symbols = dl_undef_symbols()                        C
  461. +   dl_install_xsub($name, $symref [, $filename])        C
  462. +   $message = dl_error                                  C
  463. + =over 4
  464. + =item @dl_library_path
  465. + The standard/default list of directories in which dl_findfile() will
  466. + search for libraries etc.  Directories are searched in order:
  467. + $dl_library_path[0], [1], ... etc
  468. + @dl_library_path is initialised to hold the list of 'normal' directories
  469. + (F</usr/lib>, etc) determined by B<Configure> (C<$Config{'libpth'}>).  This should
  470. + ensure portability across a wide range of platforms.
  471. + @dl_library_path should also be initialised with any other directories
  472. + that can be determined from the environment at runtime (such as
  473. + LD_LIBRARY_PATH for SunOS).
  474. + After initialisation @dl_library_path can be manipulated by an
  475. + application using push and unshift before calling dl_findfile().
  476. + Unshift can be used to add directories to the front of the search order
  477. + either to save search time or to override libraries with the same name
  478. + in the 'normal' directories.
  479. + The load function that dl_load_file() calls may require an absolute
  480. + pathname.  The dl_findfile() function and @dl_library_path can be
  481. + used to search for and return the absolute pathname for the
  482. + library/object that you wish to load.
  483. + =item @dl_resolve_using
  484. + A list of additional libraries or other shared objects which can be
  485. + used to resolve any undefined symbols that might be generated by a
  486. + later call to load_file().
  487. + This is only required on some platforms which do not handle dependent
  488. + libraries automatically.  For example the Socket Perl extension library
  489. + (F<auto/Socket/Socket.so>) contains references to many socket functions
  490. + which need to be resolved when it's loaded.  Most platforms will
  491. + automatically know where to find the 'dependent' library (e.g.,
  492. + F</usr/lib/libsocket.so>).  A few platforms need to to be told the location
  493. + of the dependent library explicitly.  Use @dl_resolve_using for this.
  494. + Example usage:
  495. +     @dl_resolve_using = dl_findfile('-lsocket');
  496. + =item @dl_require_symbols
  497. + A list of one or more symbol names that are in the library/object file
  498. + to be dynamically loaded.  This is only required on some platforms.
  499. + =item dl_error()
  500. + Syntax:
  501. +     $message = dl_error();
  502. + Error message text from the last failed DynaLoader function.  Note
  503. + that, similar to errno in unix, a successful function call does not
  504. + reset this message.
  505. + Implementations should detect the error as soon as it occurs in any of
  506. + the other functions and save the corresponding message for later
  507. + retrieval.  This will avoid problems on some platforms (such as SunOS)
  508. + where the error message is very temporary (e.g., dlerror()).
  509. + =item $dl_debug
  510. + Internal debugging messages are enabled when $dl_debug is set true.
  511. + Currently setting $dl_debug only affects the Perl side of the
  512. + DynaLoader.  These messages should help an application developer to
  513. + resolve any DynaLoader usage problems.
  514. + $dl_debug is set to C<$ENV{'PERL_DL_DEBUG'}> if defined.
  515. + For the DynaLoader developer/porter there is a similar debugging
  516. + variable added to the C code (see dlutils.c) and enabled if Perl was
  517. + built with the B<-DDEBUGGING> flag.  This can also be set via the
  518. + PERL_DL_DEBUG environment variable.  Set to 1 for minimal information or
  519. + higher for more.
  520. + =item dl_findfile()
  521. + Syntax:
  522. +     @filepaths = dl_findfile(@names)
  523. + Determine the full paths (including file suffix) of one or more
  524. + loadable files given their generic names and optionally one or more
  525. + directories.  Searches directories in @dl_library_path by default and
  526. + returns an empty list if no files were found.
  527. + Names can be specified in a variety of platform independent forms.  Any
  528. + names in the form B<-lname> are converted into F<libname.*>, where F<.*> is
  529. + an appropriate suffix for the platform.
  530. + If a name does not already have a suitable prefix and/or suffix then
  531. + the corresponding file will be searched for by trying combinations of
  532. + prefix and suffix appropriate to the platform: "$name.o", "lib$name.*"
  533. + and "$name".
  534. + If any directories are included in @names they are searched before
  535. + @dl_library_path.  Directories may be specified as B<-Ldir>.  Any other names
  536. + are treated as filenames to be searched for.
  537. + Using arguments of the form C<-Ldir> and C<-lname> is recommended.
  538. + Example: 
  539. +     @dl_resolve_using = dl_findfile(qw(-L/usr/5lib -lposix));
  540. + =item dl_expandspec()
  541. + Syntax:
  542. +     $filepath = dl_expandspec($spec)
  543. + Some unusual systems, such as VMS, require special filename handling in
  544. + order to deal with symbolic names for files (i.e., VMS's Logical Names).
  545. + To support these systems a dl_expandspec() function can be implemented
  546. + either in the F<dl_*.xs> file or code can be added to the autoloadable
  547. + dl_expandspec(0 function in F<DynaLoader.pm>).  See F<DynaLoader.pm> for more
  548. + information.
  549. + =item dl_load_file()
  550. + Syntax:
  551. +     $libref = dl_load_file($filename)
  552. + Dynamically load $filename, which must be the path to a shared object
  553. + or library.  An opaque 'library reference' is returned as a handle for
  554. + the loaded object.  Returns undef on error.
  555. + (On systems that provide a handle for the loaded object such as SunOS
  556. + and HPUX, $libref will be that handle.  On other systems $libref will
  557. + typically be $filename or a pointer to a buffer containing $filename.
  558. + The application should not examine or alter $libref in any way.)
  559. + This is function that does the real work.  It should use the current
  560. + values of @dl_require_symbols and @dl_resolve_using if required.
  561. +     SunOS: dlopen($filename)
  562. +     HP-UX: shl_load($filename)
  563. +     Linux: dld_create_reference(@dl_require_symbols); dld_link($filename)
  564. +     NeXT:  rld_load($filename, @dl_resolve_using)
  565. +     VMS:   lib$find_image_symbol($filename,$dl_require_symbols[0])
  566. + =item dl_find_symbol()
  567. + Syntax:
  568. +     $symref = dl_find_symbol($libref, $symbol)
  569. + Return the address of the symbol $symbol or C<undef> if not found.  If the
  570. + target system has separate functions to search for symbols of different
  571. + types then dl_find_symbol() should search for function symbols first and
  572. + then other types.
  573. + The exact manner in which the address is returned in $symref is not
  574. + currently defined.  The only initial requirement is that $symref can
  575. + be passed to, and understood by, dl_install_xsub().
  576. +     SunOS: dlsym($libref, $symbol)
  577. +     HP-UX: shl_findsym($libref, $symbol)
  578. +     Linux: dld_get_func($symbol) and/or dld_get_symbol($symbol)
  579. +     NeXT:  rld_lookup("_$symbol")
  580. +     VMS:   lib$find_image_symbol($libref,$symbol)
  581. + =item dl_undef_symbols()
  582. + Example
  583. +     @symbols = dl_undef_symbols()
  584. + Return a list of symbol names which remain undefined after load_file().
  585. + Returns C<()> if not known.  Don't worry if your platform does not provide
  586. + a mechanism for this.  Most do not need it and hence do not provide it.
  587. + =item dl_install_xsub()
  588. + Syntax:
  589. +     dl_install_xsub($perl_name, $symref [, $filename])
  590. + Create a new Perl external subroutine named $perl_name using $symref as
  591. + a pointer to the function which implements the routine.  This is simply
  592. + a direct call to newXSUB().  Returns a reference to the installed
  593. + function.
  594. + The $filename parameter is used by Perl to identify the source file for
  595. + the function if required by die(), caller() or the debugger.  If
  596. + $filename is not defined then "DynaLoader" will be used.
  597. + =item boostrap()
  598. + Syntax:
  599. + bootstrap($module)
  600. + This is the normal entry point for automatic dynamic loading in Perl.
  601. + It performs the following actions:
  602. + =over 8
  603. + =item *
  604. + locates an auto/$module directory by searching @INC
  605. + =item *
  606. + uses dl_findfile() to determine the filename to load
  607. + =item *
  608. + sets @dl_require_symbols to C<("boot_$module")>
  609. + =item *
  610. + executes an F<auto/$module/$module.bs> file if it exists
  611. + (typically used to add to @dl_resolve_using any files which
  612. + are required to load the module on the current platform)
  613. + =item *
  614. + calls dl_load_file() to load the file
  615. + =item *
  616. + calls dl_undef_symbols() and warns if any symbols are undefined
  617. + =item *
  618. + calls dl_find_symbol() for "boot_$module"
  619. + =item *
  620. + calls dl_install_xsub() to install it as "${module}::bootstrap"
  621. + =item *
  622. + calls &{"${module}::bootstrap"} to bootstrap the module
  623. + =back
  624. + =back
  625. + =head1 AUTHOR
  626. + This interface is based on the work and comments of (in no particular
  627. + order): Larry Wall, Robert Sanders, Dean Roehrich, Jeff Okamoto, Anno
  628. + Siegel, Thomas Neumann, Paul Marquess, Charles Bailey, and others.
  629. + Larry Wall designed the elegant inherited bootstrap mechanism and
  630. + implemented the first Perl 5 dynamic loader using it.
  631. + Tim Bunce, 11 August 1994.
  632. + =cut
  633.   #
  634.   #   And Gandalf said: 'Many folk like to know beforehand what is to
  635.   #   be set on the table; but those who have laboured to prepare the
  636. Index: ext/DynaLoader/README
  637. *** perl5.001g/ext/DynaLoader/README    Tue Feb 28 19:42:21 1995
  638. --- perl5.001h/ext/DynaLoader/README    Thu May 25 11:47:40 1995
  639. ***************
  640. *** 1,11 ****
  641.   Perl 5 DynaLoader
  642.   
  643. ! See DynaLoader.doc for detailed specification.
  644.   
  645.   This module is very similar to the other Perl 5 modules except that
  646.   Configure selects which dl_*.xs file to use.
  647.   
  648. ! After Configure has been run the Makefile.SH will generate a Makefile
  649.   which will run xsubpp on a specific dl_*.xs file and write the output
  650.   to DynaLoader.c
  651.   
  652. --- 1,11 ----
  653.   Perl 5 DynaLoader
  654.   
  655. ! See DynaLoader.pm for detailed specification.
  656.   
  657.   This module is very similar to the other Perl 5 modules except that
  658.   Configure selects which dl_*.xs file to use.
  659.   
  660. ! After Configure has been run the Makefile.PL will generate a Makefile
  661.   which will run xsubpp on a specific dl_*.xs file and write the output
  662.   to DynaLoader.c
  663.   
  664. ***************
  665. *** 42,52 ****
  666.   platforms take a look at dl_dld.xs. The dlutils.c file holds some
  667.   common definitions that are #included into the dl_*.xs files.
  668.   
  669. ! After the initial implementation of a new DynaLoader dl_*.xs file
  670. ! you may need to edit or create ext/MODULE/MODULE.bs files to reflect
  671. ! the needs of your platform and linking software.
  672.   
  673. ! Refer to DynaLoader.doc, lib/ExtUtils/MakeMaker.pm and any existing
  674.   ext/MODULE/MODULE.bs files for more information.
  675.   
  676.   Tim Bunce.
  677. --- 42,52 ----
  678.   platforms take a look at dl_dld.xs. The dlutils.c file holds some
  679.   common definitions that are #included into the dl_*.xs files.
  680.   
  681. ! After the initial implementation of a new DynaLoader dl_*.xs file you
  682. ! may need to edit or create ext/MODULE/MODULE.bs files (library bootstrap
  683. ! files) to reflect the needs of your platform and linking software.
  684.   
  685. ! Refer to DynaLoader.pm, lib/ExtUtils/MakeMaker.pm and any existing
  686.   ext/MODULE/MODULE.bs files for more information.
  687.   
  688.   Tim Bunce.
  689. Index: ext/Fcntl/Fcntl.pm
  690. *** perl5.001g/ext/Fcntl/Fcntl.pm    Sun Mar 12 00:05:07 1995
  691. --- perl5.001h/ext/Fcntl/Fcntl.pm    Thu May 25 11:48:11 1995
  692. ***************
  693. *** 1,7 ****
  694.   package Fcntl;
  695.   
  696.   require Exporter;
  697. ! require AutoLoader;
  698.   require DynaLoader;
  699.   @ISA = qw(Exporter DynaLoader);
  700.   # Items to export into callers namespace by default
  701. --- 1,30 ----
  702.   package Fcntl;
  703.   
  704. + =head1 NAME
  705. + Fcntl - load the C Fcntl.h defines
  706. + =head1 SYNOPSIS
  707. +     use Fcntl;
  708. + =head1 DESCRIPTION
  709. + This module is just a translation of the C F<fnctl.h> file.
  710. + Unlike the old mechanism of requiring a translated F<fnctl.ph>
  711. + file, this uses the B<h2xs> program (see the Perl source distribution)
  712. + and your native C compiler.  This means that it has a 
  713. + far more likely chance of getting the numbers right.
  714. + =head1 NOTE
  715. + Only C<#define> symbols get translated; you must still correctly
  716. + pack up your own arguments to pass as args for locking functions, etc.
  717. + =cut
  718.   require Exporter;
  719. ! use AutoLoader;
  720.   require DynaLoader;
  721.   @ISA = qw(Exporter DynaLoader);
  722.   # Items to export into callers namespace by default
  723. Index: ext/GDBM_File/GDBM_File.pm
  724. *** perl5.001g/ext/GDBM_File/GDBM_File.pm    Sun Mar 12 00:05:16 1995
  725. --- perl5.001h/ext/GDBM_File/GDBM_File.pm    Wed May 10 12:08:54 1995
  726. ***************
  727. *** 3,9 ****
  728.   require Carp;
  729.   require TieHash;
  730.   require Exporter;
  731. ! require AutoLoader;
  732.   require DynaLoader;
  733.   @ISA = qw(TieHash Exporter DynaLoader);
  734.   @EXPORT = qw(
  735. --- 3,9 ----
  736.   require Carp;
  737.   require TieHash;
  738.   require Exporter;
  739. ! use AutoLoader;
  740.   require DynaLoader;
  741.   @ISA = qw(TieHash Exporter DynaLoader);
  742.   @EXPORT = qw(
  743. Index: ext/GDBM_File/GDBM_File.xs
  744. *** perl5.001g/ext/GDBM_File/GDBM_File.xs    Sat Jan 14 23:54:20 1995
  745. --- perl5.001h/ext/GDBM_File/GDBM_File.xs    Tue May 23 13:55:25 1995
  746. ***************
  747. *** 216,218 ****
  748. --- 216,235 ----
  749.   gdbm_reorganize(db)
  750.       GDBM_File    db
  751.   
  752. + void
  753. + gdbm_sync(db)
  754. +     GDBM_File    db
  755. + int
  756. + gdbm_exists(db, key)
  757. +     GDBM_File    db
  758. +     datum        key
  759. + int
  760. + gdbm_setopt (db, optflag, optval, optlen)
  761. +     GDBM_File    db
  762. +     int        optflag
  763. +     int        &optval
  764. +     int        optlen
  765. Index: ext/POSIX/POSIX.pm
  766. *** perl5.001g/ext/POSIX/POSIX.pm    Sun Mar 12 00:05:09 1995
  767. --- perl5.001h/ext/POSIX/POSIX.pm    Thu May 25 11:49:05 1995
  768. ***************
  769. *** 1,8 ****
  770.   package POSIX;
  771.   
  772.   use Carp;
  773.   require Exporter;
  774. ! require AutoLoader;
  775.   require DynaLoader;
  776.   require Config;
  777.   @ISA = qw(Exporter DynaLoader);
  778. --- 1,64 ----
  779.   package POSIX;
  780.   
  781. + =head1 NAME
  782. + POSIX - Perl interface to IEEE 1003.1 namespace
  783. + =head1 SYNOPSIS
  784. +     use POSIX;
  785. +     use POSIX 'strftime';
  786. + =head1 DESCRIPTION
  787. + The POSIX module permits you to access all (or nearly all) the standard
  788. + POSIX 1003.1 identifiers.  Things which are C<#defines> in C, like EINTR
  789. + or O_NDELAY, are automatically exported into your namespace.  All
  790. + functions are only exported if you ask for them explicitly.  Most likely
  791. + people will prefer to use the fully-qualified function names.
  792. + To get a list of all the possible identifiers available to you--and
  793. + their semantics--you should pick up a 1003.1 spec, or look in the
  794. + F<POSIX.pm> module.
  795. + =head1 EXAMPLES
  796. +     printf "EINTR is %d\n", EINTR;
  797. +     POSIX::setsid(0);
  798. +     $fd = POSIX::open($path, O_CREAT|O_EXCL|O_WRONLY, 0644);
  799. +     # note: that's a filedescriptor, *NOT* a filehandle
  800. + =head1 NOTE
  801. + The POSIX module is probably the most complex Perl module supplied with
  802. + the standard distribution.  It incorporates autoloading, namespace games,
  803. + and dynamic loading of code that's in Perl, C, or both.  It's a great
  804. + source of wisdom.
  805. + =head1 CAVEATS 
  806. + A few functions are not implemented because they are C specific.  If you
  807. + attempt to call these, they will print a message telling you that they
  808. + aren't implemented, and suggest using the Perl equivalent should one
  809. + exist.  For example, trying to access the setjmp() call will elicit the
  810. + message "setjmp() is C-specific: use eval {} instead".
  811. + Furthermore, some evil vendors will claim 1003.1 compliance, but in fact
  812. + are not so: they will not pass the PCTS (POSIX Compliance Test Suites).
  813. + For example, one vendor may not define EDEADLK, or the semantics of the
  814. + errno values set by open(2) might not be quite right.  Perl does not
  815. + attempt to verify POSIX compliance.  That means you can currently
  816. + successfully say "use POSIX",  and then later in your program you find
  817. + that your vendor has been lax and there's no usable ICANON macro after
  818. + all.  This could be construed to be a bug.
  819. + =cut
  820.   use Carp;
  821.   require Exporter;
  822. ! use AutoLoader;
  823.   require DynaLoader;
  824.   require Config;
  825.   @ISA = qw(Exporter DynaLoader);
  826. ***************
  827. *** 60,66 ****
  828.           LC_TIME NULL localeconv setlocale)],
  829.   
  830.       math_h =>    [qw(HUGE_VAL acos asin atan ceil cosh fabs floor fmod
  831. !         frexp ldexp log10 modf pow sinh tanh)],
  832.   
  833.       pwd_h =>    [qw()],
  834.   
  835. --- 116,122 ----
  836.           LC_TIME NULL localeconv setlocale)],
  837.   
  838.       math_h =>    [qw(HUGE_VAL acos asin atan ceil cosh fabs floor fmod
  839. !         frexp ldexp log10 modf pow sinh tan tanh)],
  840.   
  841.       pwd_h =>    [qw()],
  842.   
  843. ***************
  844. *** 152,158 ****
  845.       closedir opendir readdir rewinddir
  846.       fcntl open
  847.       getgrgid getgrnam
  848. !     atan2 cos exp log sin sqrt tan
  849.       getpwnam getpwuid
  850.       kill
  851.       fileno getc printf rename sprintf
  852. --- 208,214 ----
  853.       closedir opendir readdir rewinddir
  854.       fcntl open
  855.       getgrgid getgrnam
  856. !     atan2 cos exp log sin sqrt
  857.       getpwnam getpwuid
  858.       kill
  859.       fileno getc printf rename sprintf
  860. ***************
  861. *** 416,426 ****
  862.       sqrt($_[0]);
  863.   }
  864.   
  865. - sub tan {
  866. -     usage "tan(x)" if @_ != 1;
  867. -     tan($_[0]);
  868. - }
  869.   sub getpwnam {
  870.       usage "getpwnam(name)" if @_ != 1;
  871.       getpwnam($_[0]);
  872. --- 472,477 ----
  873. ***************
  874. *** 808,814 ****
  875.   }
  876.   
  877.   sub chmod {
  878. !     usage "chmod(filename, mode)" if @_ != 2;
  879.       chmod($_[0], $_[1]);
  880.   }
  881.   
  882. --- 859,865 ----
  883.   }
  884.   
  885.   sub chmod {
  886. !     usage "chmod(mode, filename)" if @_ != 2;
  887.       chmod($_[0], $_[1]);
  888.   }
  889.   
  890. Index: ext/POSIX/POSIX.xs
  891. *** perl5.001g/ext/POSIX/POSIX.xs    Sun Mar 12 00:30:03 1995
  892. --- perl5.001h/ext/POSIX/POSIX.xs    Tue May 23 14:54:27 1995
  893. ***************
  894. *** 2727,2732 ****
  895. --- 2727,2736 ----
  896.       double        x
  897.   
  898.   double
  899. + tan(x)
  900. +     double        x
  901. + double
  902.   tanh(x)
  903.       double        x
  904.   
  905. Index: ext/SDBM_File/sdbm/sdbm.c
  906. Prereq:  1.16 
  907. *** perl5.001g/ext/SDBM_File/sdbm/sdbm.c    Tue Oct 18 12:31:23 1994
  908. --- perl5.001h/ext/SDBM_File/sdbm/sdbm.c    Tue May  2 15:54:25 1995
  909. ***************
  910. *** 37,43 ****
  911.   #endif
  912.   
  913.   extern Malloc_t malloc proto((MEM_SIZE));
  914. ! extern void free proto((void *));
  915.   extern Off_t lseek();
  916.   
  917.   /*
  918. --- 37,43 ----
  919.   #endif
  920.   
  921.   extern Malloc_t malloc proto((MEM_SIZE));
  922. ! extern Free_t free proto((void *));
  923.   extern Off_t lseek();
  924.   
  925.   /*
  926. Index: ext/Socket/Socket.pm
  927. *** perl5.001g/ext/Socket/Socket.pm    Sun Mar 12 00:05:19 1995
  928. --- perl5.001h/ext/Socket/Socket.pm    Thu May 25 11:49:37 1995
  929. ***************
  930. *** 1,8 ****
  931.   package Socket;
  932.   use Carp;
  933.   
  934.   require Exporter;
  935. ! require AutoLoader;
  936.   require DynaLoader;
  937.   @ISA = qw(Exporter DynaLoader);
  938.   @EXPORT = qw(
  939. --- 1,35 ----
  940.   package Socket;
  941. + =head1 NAME
  942. + Socket - load the C socket.h defines
  943. + =head1 SYNOPSIS
  944. +     use Socket;
  945. +     $proto = (getprotobyname('udp'))[2];         
  946. +     socket(Socket_Handle, PF_INET, SOCK_DGRAM, $proto); 
  947. + =head1 DESCRIPTION
  948. + This module is just a translation of the C F<socket.h> file.
  949. + Unlike the old mechanism of requiring a translated F<socket.ph>
  950. + file, this uses the B<h2xs> program (see the Perl source distribution)
  951. + and your native C compiler.  This means that it has a 
  952. + far more likely chance of getting the numbers right.
  953. + =head1 NOTE
  954. + Only C<#define> symbols get translated; you must still correctly
  955. + pack up your own arguments to pass to bind(), etc.
  956. + =cut
  957.   use Carp;
  958.   
  959.   require Exporter;
  960. ! use AutoLoader;
  961.   require DynaLoader;
  962.   @ISA = qw(Exporter DynaLoader);
  963.   @EXPORT = qw(
  964.  
  965. End of patch.
  966.