RE: any glue to sys$getrmi

[email protected] (Carl Friedberg)
Newsgroups perl.vmsperl
Message-ID <[email protected]>
Peter and Craig,

Thanks for the pointers.

Working my way through, I decided to try VMS_Process, and
found similar issues. I have attached the gnu unified diff
file (you probably already have these changes, or perhaps
there's more to it than I guessed).

VMS 8.3  Perl 5.8.8 on Alpha

Aside:

I found that unless I used the very latest version
of MMK from the process fileserv, I could not get
perl 5.10.0 to build (MMK V4.0, March 2008). MMS
version 3.8 eco02 had problems as well. I know Peter
asked about this a few months back.

Carl Friedberg
[email protected]
www.comets.com

> -----Original Message-----
> From: Peter Prymmer [mailto:[email protected]]
> Sent: Thursday, August 14, 2008 8:46 AM
> To: [email protected]
> Cc: Carl Friedberg; '[email protected]'
> Subject: Re: any glue to sys$getrmi
>
> [email protected] wrote on 08/13/2008 10:50:04 PM:
>
>
> > I would think VMS::Monitor would do the trick:
> >
> > http://search.cpan.org/~dsugal/VMS-Monitor-0_06/monitor/monitor.pm
> >
> > It uses the EXE$GETSPI interface, which was the undocumented
> > predecessor to SYS$GETRMI.  It should be a fairly
> mechanical operation
> > to convert the $GETSPI calls to $GETRMI if that's needed for some
> > reason, but whether the item codes are all still the same,
> whether all
> > item codes of interest are included, whether it works as is on OVMS
> > v8.3 and Itanium -- those are all unknowns here.  It might well run
> > out of the box with no modifications, or it might need some
> TLC to get
> > modern, but I can't think of any reason to reinvent the
> wheel or start
> > from scratch.
> >
> > I'm believe, as with all of Dan's modules, I'm
> "co-maintainer" of this
> > module, which means I can apply patches to the CPAN version if you
> > send them in.
>
> In order to compile with more recent versions of perl we found
> we had to update some of the xs macro variables used in
> the Monitor.xs file.
>
> Here is a gnu unified diff of the local changes we had to make
> (taken on VMS hence the lowercase file name):
>
> --- [.vms-monitor-0_06_orig]monitor.xs  Thu Aug 14 08:40:12 2008
> +++ [.vms-monitor-0_06]monitor.xs       Thu Aug 14 08:39:35 2008
> @@ -595,7 +595,7 @@
>    int EventFlag;
>
>    for (i = 0; MonitorInfoList[i].InfoName; i++) {
> -    if (strEQ(MonitorInfoList[i].InfoName, SvPV(infoname, na))) {
> +    if (strEQ(MonitorInfoList[i].InfoName, SvPV(infoname, PL_na))) {
>        break;
>      }
>    }
> @@ -603,7 +603,7 @@
>    /* Did we find a match? If not, complain and exit */
>    if (MonitorInfoList[i].InfoName == NULL) {
>      warn("Invalid monitor info item");
> -    ST(0) = &sv_undef;
> +    ST(0) = &PL_sv_undef;
>    } else {
>      /* allocate our item list */
>      ITMLST OneItem[2];
> @@ -938,12 +938,12 @@
>          free(ReturnStringBuffer);
>          break;
>        default:
> -        ST(0) = &sv_undef;
> +        ST(0) = &PL_sv_undef;
>          break;
>        }
>      } else {
>        SETERRNO(EVMSERR, status);
> -      ST(0) = &sv_undef;
> +      ST(0) = &PL_sv_undef;
>        /* free up the buffer if we were looking for a string */
>        if (MonitorInfoList[i].ReturnType == IS_STRING)
>          free(ReturnStringBuffer);
> End of Patch.
>
> I hope that helps.
>
> Peter Prymmer
>
> No virus found in this incoming message.
> Checked by AVG - http://www.avg.com
> Version: 8.0.138 / Virus Database: 270.6.2/1609 - Release
> Date: 8/13/2008 6:43 AM
>
PROCESS_XS.DIFF (application/octet-stream, 5.4 KB)
--- [.process_orig]process.xs	Wed Aug 20 17:02:17 2008
+++ [.process]process.xs	Tue Aug 19 08:34:10 2008
@@ -13,6 +13,8 @@
  * 1.01 25-Nov-1997 Dan Sugalski <[email protected]>
  *      Merged VMS::ProcInfo into VMS::Process
  *
+ * 1.02 18-Aug-2008 throwing some errors (fussier C compiler)
+ *
  */
 
 #ifdef __cplusplus
@@ -72,9 +74,9 @@
 #define bit_test(HVPointer, BitToCheck, HVEntryName, EncodedMask) \
 { \
     if ((EncodedMask) && (BitToCheck)) \
-    hv_store((HVPointer), (HVEntryName), strlen((HVEntryName)), &sv_yes, 0); \
+    hv_store((HVPointer), (HVEntryName), strlen((HVEntryName)), &PL_sv_yes, 0); \
     else \
-    hv_store((HVPointer), (HVEntryName), strlen((HVEntryName)), &sv_no, 0);}   
+    hv_store((HVPointer), (HVEntryName), strlen((HVEntryName)), &PL_sv_no, 0);}   
 
 struct ProcessID {
   char *ProcListName; /* Pointer to the item name */
@@ -593,22 +595,22 @@
 
       NameSV = *hv_fetch((HV *)RealSV, "NAME", 4, 0);
       ValueSV = *hv_fetch((HV *)RealSV, "VALUE", 5, 0);
-      ItemType = get_item_type(SvPV(NameSV, na));
-      ItemPScanVal = get_item_pscan_val(SvPV(NameSV, na));
+      ItemType = get_item_type(SvPV(NameSV, PL_na));
+      ItemPScanVal = get_item_pscan_val(SvPV(NameSV, PL_na));
       FlagsVal = 0; /* By default we have no flags */
       /* If we've got a comparison op, get its flags and see what we get */
       if (hv_exists_ent((HV *)RealSV, ComparisonConstSV, 0)) {
         ComparisonSV = *hv_fetch((HV *)RealSV, "COMPARISON", 10, 0);
-        FlagsVal = FlagsVal | get_comparison_bits(SvPV(ComparisonSV, na));
+        FlagsVal = FlagsVal | get_comparison_bits(SvPV(ComparisonSV, PL_na));
       }
       /* If we've got a modifier op, get its flags and see what we get */
       if (hv_exists_ent((HV *)RealSV, ModifierConstSV, 0)) {
         ModifierSV = *hv_fetch((HV *)RealSV, "MODIFIER", 8, 0);
-        FlagsVal = FlagsVal | get_modifier_bits(SvPV(ModifierSV, na));
+        FlagsVal = FlagsVal | get_modifier_bits(SvPV(ModifierSV, PL_na));
       }
       switch(ItemType) {
       case IS_STRING:
-        TempStringPointer = SvPV(ValueSV, na);
+        TempStringPointer = SvPV(ValueSV, PL_na);
         init_bufitemlist(&ProcScanItemList[i], strlen(TempStringPointer),
                          ItemPScanVal, TempStringPointer, FlagsVal);
         break;
@@ -617,7 +619,7 @@
                          FlagsVal);
         break;
       case IS_ENUM:
-        TempStringPointer = SvPV(ValueSV, na);
+        TempStringPointer = SvPV(ValueSV, PL_na);
         init_lititemlist(&ProcScanItemList[i], ItemPScanVal,
                          de_enum(ItemPScanVal, TempStringPointer),
                          FlagsVal);
@@ -657,7 +659,7 @@
     }
   } else {
     SETERRNO(EVMSERR, status);
-    ST(0) = &sv_undef;
+    ST(0) = &PL_sv_undef;
   }
 }
 
@@ -670,9 +672,9 @@
   status = sys$suspnd(&pid, NULL, NULL);
   if (status != SS$_NORMAL) {
     SETERRNO(EVMSERR, status);
-    ST(0) = &sv_no;
+    ST(0) = &PL_sv_no;
   } else {
-    ST(0) = &sv_yes;
+    ST(0) = &PL_sv_yes;
   }
 }
 
@@ -685,9 +687,9 @@
   status = sys$resume(&pid, NULL);
   if (status != SS$_NORMAL) {
     SETERRNO(EVMSERR, status);
-    ST(0) = &sv_no;
+    ST(0) = &PL_sv_no;
   } else {
-    ST(0) = &sv_yes;
+    ST(0) = &PL_sv_yes;
   }
 }
 
@@ -700,9 +702,9 @@
   status = sys$delprc(&pid, NULL);
   if (status != SS$_NORMAL) {
     SETERRNO(EVMSERR, status);
-    ST(0) = &sv_no;
+    ST(0) = &PL_sv_no;
   } else {
-    ST(0) = &sv_yes;
+    ST(0) = &PL_sv_yes;
   }
 }
 
@@ -717,9 +719,9 @@
   status = sys$setpri(&pid, NULL, newpriority, &OldPriority, NULL, NULL);
   if (status != SS$_NORMAL) {
     SETERRNO(EVMSERR, status);
-    ST(0) = &sv_no;
+    ST(0) = &PL_sv_no;
   } else {
-    ST(0) = &sv_yes;
+    ST(0) = &PL_sv_yes;
   }
 }
 
@@ -765,7 +767,7 @@
   char QuadWordString[65];
   
   for (i = 0; ProcInfoList[i].ProcInfoName; i++) {
-    if (strEQ(ProcInfoList[i].ProcInfoName, SvPV(infoname, na))) {
+    if (strEQ(ProcInfoList[i].ProcInfoName, SvPV(infoname, PL_na))) {
       break;
     }
   }
@@ -773,7 +775,7 @@
   /* Did we find a match? If not, complain and exit */
   if (ProcInfoList[i].ProcInfoName == NULL) {
     warn("Invalid proc info item");
-    ST(0) = &sv_undef;
+    ST(0) = &PL_sv_undef;
   } else {
     /* allocate our item list */
     ITMLST OneItem[2];
@@ -815,7 +817,7 @@
       break;
     default:
       warn("Unknown item return type");
-      ST(0) = &sv_undef;
+      ST(0) = &PL_sv_undef;
       return;
     }
     
@@ -854,14 +856,14 @@
         ST(0) =  sv_2mortal(newSViv(ReturnLongWordBuffer));
         break;
       default:
-        ST(0) = &sv_undef;
+        ST(0) = &PL_sv_undef;
         break;
       }
 
       
     } else {
       SETERRNO(EVMSERR, status);
-      ST(0) = &sv_undef;
+      ST(0) = &PL_sv_undef;
       /* free up the buffer if we were looking for a string */
       if (ProcInfoList[i].ReturnType == IS_STRING)
         free(ReturnStringBuffer);
@@ -975,7 +977,7 @@
      } else {
        /* I think we failed */
        SETERRNO(EVMSERR, status);
-       ST(0) = &sv_undef;
+       ST(0) = &PL_sv_undef;
      }
 
      /* Free up our allocated memory */
@@ -1096,6 +1098,6 @@
   if (AllPurposeHV) {
     ST(0) = (SV *)AllPurposeHV;
   } else {
-    ST(0) = &sv_undef;
+    ST(0) = &PL_sv_undef;
   }
 }
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.