use the same arg names everyone else does and handle undef filename
Craig A. Berry [Sat, 27 May 2006 18:00:31 +0000 (18:00 +0000)]
p4raw-id: //depot/perl@28318

ext/DynaLoader/dl_vms.xs

index 1df7a40..e476663 100644 (file)
@@ -1,8 +1,8 @@
 /* dl_vms.xs
  * 
- * Platform:  OpenVMS, VAX or AXP
+ * Platform:  OpenVMS, VAX or AXP or IA64
  * Author:    Charles Bailey  bailey@newman.upenn.edu
- * Revised:   12-Dec-1994
+ * Revised:   See http://public.activestate.com/cgi-bin/perlbrowse
  *
  *                           Implementation Note
  *     This section is added as an aid to users and DynaLoader developers, in
@@ -247,8 +247,8 @@ dl_expandspec(filespec)
     }
 
 void
-dl_load_file(filespec, flags)
-    char *     filespec
+dl_load_file(filename, flags=0)
+    char *     filename
     int                flags
     PREINIT:
     dTHX;
@@ -269,10 +269,13 @@ dl_load_file(filespec, flags)
     void (*entry)();
     CODE:
 
-    DLDEBUG(1,PerlIO_printf(Perl_debug_log, "dl_load_file(%s,%x):\n", filespec,flags));
-    specdsc.dsc$a_pointer = tovmsspec(filespec,vmsspec);
+    DLDEBUG(1,PerlIO_printf(Perl_debug_log, "dl_load_file(%s,%x):\n", filename,flags));
+    specdsc.dsc$a_pointer = tovmsspec(filename,vmsspec);
     specdsc.dsc$w_length = strlen(specdsc.dsc$a_pointer);
-    DLDEBUG(2,PerlIO_printf(Perl_debug_log, "\tVMS-ified filespec is %s\n",
+    if (specdsc.dsc$w_length == 0) { /* undef in, empty out */
+        XSRETURN_EMPTY;
+    }
+    DLDEBUG(2,PerlIO_printf(Perl_debug_log, "\tVMS-ified filename is %s\n",
                       specdsc.dsc$a_pointer));
     Newx(dlptr,1,struct libref);
     dlptr->name.dsc$b_dtype = dlptr->defspec.dsc$b_dtype = DSC$K_DTYPE_T;
@@ -338,7 +341,7 @@ dl_find_symbol(librefptr,symname)
     void (*entry)();
     vmssts sts;
 
-    DLDEBUG(1,PerlIO_printf(Perl_debug_log, "dl_find_dymbol(%.*s,%.*s):\n",
+    DLDEBUG(1,PerlIO_printf(Perl_debug_log, "dl_find_symbol(%.*s,%.*s):\n",
                       thislib.name.dsc$w_length, thislib.name.dsc$a_pointer,
                       symdsc.dsc$w_length,symdsc.dsc$a_pointer));
     sts = my_find_image_symbol(&(thislib.name),&symdsc,