/Users/fujiik/rpm/BUILD/cernlib-2006/2006/tmp
diff -uNr src.ORIG/config/MacOSX.cf src/config/MacOSX.cf
--- src.ORIG/config/MacOSX.cf	2022-03-27 15:11:11.000000000 +0900
+++ src/config/MacOSX.cf	2022-05-19 20:47:59.000000000 +0900
@@ -138,6 +138,9 @@
                                 -fno-automatic \
                                 -fallow-argument-mismatch \
                                 -fallow-invalid-boz \
+                                -fno-align-commons \
+                                -finit-local-zero \
+                                -std=legacy \
                                 -flat_namespace -undefined warning
 #define CernlibSystem           -DCERNLIB_LINUX -DCERNLIB_UNIX -DCERNLIB_LNX \
       				-DCERNLIB_QMLXIA64 -DCERNLIB_QMGLIBC \
diff -uNr src.ORIG/graflib/hplot/hplotf77/hplfr3.F src/graflib/hplot/hplotf77/hplfr3.F
--- src.ORIG/graflib/hplot/hplotf77/hplfr3.F	2000-06-06 22:35:28.000000000 +0900
+++ src/graflib/hplot/hplotf77/hplfr3.F	2022-05-19 20:47:59.000000000 +0900
@@ -158,3 +158,32 @@
 *
    10 CALL IGSET('LWID',RLWID)
       END
+#if 1
+      SUBROUTINE HPLFR3V (CHOPT,rpar)
+*     SUBROUTINE HPLFR3 (X1I,X2I,Y1I,Y2I,Z1I,Z2I,THETA,PHI,CHOPT)
+      CHARACTER*(*) CHOPT
+      real rpar(8)
+
+      x1i   = rpar(1)
+      x2i   = rpar(2)
+      y1i   = rpar(3)
+      y2i   = rpar(4)
+      z1i   = rpar(5)
+      z2i   = rpar(6)
+      theta = rpar(7)
+      phi   = rpar(8)
+
+      call HPLFR3 (X1I,X2I,Y1I,Y2I,Z1I,Z2I,THETA,PHI,CHOPT)
+
+      rpar(1) = x1i  
+      rpar(2) = x2i  
+      rpar(3) = y1i  
+      rpar(4) = y2i  
+      rpar(5) = z1i  
+      rpar(6) = z2i  
+      rpar(7) = theta
+      rpar(8) = phi  
+
+      return
+      end
+#endif
diff -uNr src.ORIG/packlib/hbook/chbook/halloc.c src/packlib/hbook/chbook/halloc.c
--- src.ORIG/packlib/hbook/chbook/halloc.c	1997-09-02 22:08:57.000000000 +0900
+++ src/packlib/hbook/chbook/halloc.c	2022-05-19 20:47:59.000000000 +0900
@@ -640,10 +640,17 @@
 #endif
 #if (!defined(CERNLIB_VAX))&&(!defined(CERNLIB_CRAY))
 #ifndef CERNLIB_MSSTDCALL
+#if 0
 void MY_STDCALL hballo1(int *id, char *path1, int *lp, char *var1, int *lv,
              char *block1, int *lb, int *type,
 	     int *size, int *ifirst, int *nelem, long *buf, int *nuse)
 #else
+void MY_STDCALL hballo1(int *id, char *path1, int *lp, char *var1, int *lv,
+             char *block1, int *lb, int *type,
+	     int *size, int *ifirst, int *nelem, long *buf, int *nuse,
+	     int len_path1, int len_var1, int len_block1)
+#endif
+#else
 void MY_STDCALL hballo1(int *id, char *path1, int len_path1, int *lp, 
                                  char *var1,  int len_var1,  int *lv,
                                  char *block1,int len_block1, 
@@ -652,10 +659,22 @@
 #endif
 {
 #endif
+#if 1
    char            path[128], var[36], block[16];
+#else
+   char            path[256], var[72], block[32];
+#endif
    unsigned long   tmp;
    NtupleBuffer   *ntbuf;
  
+#if 0
+   fprintf(stderr, "hballo1: lenp=%d\n",*lp);
+   //fprintf(stderr, "       : path1=%s\n",path1);
+   fprintf(stderr, "       : lenv=%d\n",*lv);
+   //fprintf(stderr, "       : var1=%s\n",var1);
+   fprintf(stderr, "       : lenb=%d\n",*lb);
+   //fprintf(stderr, "       : block1=%s\n",block1);
+#endif
    strncpy(path,  path1,  *lp);  path[*lp]  = '\0';
    strncpy(var,   var1,   *lv);  var[*lv]   = '\0';
    strncpy(block, block1, *lb);  block[*lb] = '\0';
diff -uNr src.ORIG/packlib/hbook/code/hbook1.F src/packlib/hbook/code/hbook1.F
--- src.ORIG/packlib/hbook/code/hbook1.F	1996-01-17 02:07:32.000000000 +0900
+++ src/packlib/hbook/code/hbook1.F	2022-05-19 20:47:59.000000000 +0900
@@ -172,3 +172,20 @@
 *
   99  RETURN
       END
+#if 1
+      SUBROUTINE HBOOK1V(CHTITL,ipar,rpar)
+*     SUBROUTINE HBOOK1(IDD,CHTITL,NNNX,XXX0,XXX1,VALMAX)
+      CHARACTER*(*) CHTITL
+      integer       ipar(2)
+      real          rpar(3)
+
+      idd    = ipar(1)
+      nnnx   = ipar(2)
+      xxx0   = rpar(1)
+      xxx1   = rpar(2)
+      valmax = rpar(3)
+      call HBOOK1(IDD,CHTITL,NNNX,XXX0,XXX1,VALMAX)
+
+      return
+      end
+#endif
diff -uNr src.ORIG/packlib/hbook/code/hbook2.F src/packlib/hbook/code/hbook2.F
--- src.ORIG/packlib/hbook/code/hbook2.F	1996-01-17 02:07:32.000000000 +0900
+++ src/packlib/hbook/code/hbook2.F	2022-05-19 20:47:59.000000000 +0900
@@ -196,3 +196,25 @@
 *
    20 RETURN
       END
+#if 1
+      SUBROUTINE HBOOK2V(CHTITL,ipar,rpar)
+*     SUBROUTINE HBOOK2(IDD,CHTITL,NNX,XX0,XX1,NNY,YY0,YY1,VALMAX)
+      CHARACTER*(*) CHTITL
+      integer       ipar(3)
+      real          rpar(5)
+
+      idd = ipar(1)
+      nnx = ipar(2)
+      nny = ipar(3)
+
+      xx0 = rpar(1)
+      xx1 = rpar(2)
+      yy0 = rpar(3)
+      yy1 = rpar(4)
+      valmax = rpar(5)
+
+      call HBOOK2(IDD,CHTITL,NNX,XX0,XX1,NNY,YY0,YY1,VALMAX)
+
+      return
+      end
+#endif
diff -uNr src.ORIG/packlib/hbook/code/hbprof.F src/packlib/hbook/code/hbprof.F
--- src.ORIG/packlib/hbook/code/hbprof.F	1998-10-05 23:38:54.000000000 +0900
+++ src/packlib/hbook/code/hbprof.F	2022-05-19 20:47:59.000000000 +0900
@@ -194,3 +194,22 @@
 *
   99  RETURN
       END
+#if 1
+      SUBROUTINE HBPROFV(CHTITL,CHOPT,ipar,rpar)
+*     SUBROUTINE HBPROF(IDD,CHTITL,NX,XX0,XX1,YMIN,YMAX,CHOPT)
+      CHARACTER*(*) CHTITL,CHOPT
+      integer       ipar(2)
+      real          rpar(4)
+
+      idd  = ipar(1)
+      nx   = ipar(2)
+      xx0  = rpar(1)
+      xx1  = rpar(2)
+      ymin = rpar(1)
+      ymax = rpar(2)
+
+      call HBPROF(IDD,CHTITL,NX,XX0,XX1,YMIN,YMAX,CHOPT)
+
+      return
+      end
+#endif
diff -uNr src.ORIG/packlib/hbook/code/hlabel.F src/packlib/hbook/code/hlabel.F
--- src.ORIG/packlib/hbook/code/hlabel.F	2001-10-10 17:12:07.000000000 +0900
+++ src/packlib/hbook/code/hlabel.F	2022-05-19 20:47:59.000000000 +0900
@@ -647,3 +647,19 @@
 C -- catch the old value ( should be modified by hfcx )
       IQ(LCONT + KNOENT) = IKNOENT
   999 END
+#if 1
+      SUBROUTINE HLABELV(CHLAB,CHOPT,IPAR)
+*     SUBROUTINE HLABEL(IDD,NLABEL,CHLAB,CHOPT)
+      INTEGER IDD,NLABEL
+      CHARACTER*(*) CHOPT
+      CHARACTER*(*) CHLAB(*)
+      integer ipar(2)
+      idd    = ipar(1)
+      nlabel = ipar(2)
+      call HLABEL(IDD,NLABEL,CHLAB,CHOPT)
+      ipar(1) = idd   
+      ipar(2) = nlabel
+
+      return
+      end
+#endif
diff -uNr src.ORIG/packlib/hbook/hntup/hballoc.F src/packlib/hbook/hntup/hballoc.F
--- src.ORIG/packlib/hbook/hntup/hballoc.F	2022-03-27 15:11:11.000000000 +0900
+++ src/packlib/hbook/hntup/hballoc.F	2022-05-19 20:47:59.000000000 +0900
@@ -64,9 +64,50 @@
       INTEGER        IDN, ITYPE, ISIZE, NELEM, NUSE, IFIRST, IBASE(1)
       INTEGER*8      IBUF(1), IOFF
 *
+#if 1
       LC = LENOCC(CHDIR)
       LV = LENOCC(VAR)
       LB = LENOCC(BLOCK)
+#else
+#if 0
+      LC = LENOCC(CHDIR)
+      LV = LENOCC2(VAR,32)
+      LB = LENOCC2(BLOCK,8)
+#if 0
+      print *, 'hballoc64: lc=', lc
+      print *, '         : lv=', lv
+      print *, '         : lb=', lb
+      flush 5
+#endif
+#else
+      print *, 'hballoc64: len(chdir)=', len(chdir)
+      print *, '         : len(var)  =', len(var)
+      print *, '         : len(block)=', len(block)
+      print '(a,z8)', '          : locf(block)=0x', locf(block)
+      flush 5
+#if 0
+      if (len(chdir) .gt. 0) print *, '         : chdir=', chdir
+      flush 5
+      if (len(var)   .gt. 0) print *, '         : var  =', var
+      flush 5
+      if (len(block) .gt. 0) print *, '         : block=', block
+      flush 5
+#endif
+      LC = LENOCC(CHDIR)
+      print *, '         : lc=', lc
+      flush 5
+      LV = LENOCC(VAR)
+      print *, '         : lv=', lv
+      flush 5
+#if 1
+      LB = LENOCC(BLOCK)
+#else
+      LB = LENOCC2(BLOCK,8)
+#endif
+      print *, '         : lb=', lb
+      flush 5
+#endif
+#endif
 *
       CALL HBALLO1(IDN, CHDIR, LC, VAR, LV, BLOCK, LB, ITYPE, ISIZE,
      +             IFIRST, NELEM, IBUF, NUSE)
@@ -78,3 +119,57 @@
       ENDIF
 *
       END
+#if 1
+      function lenocc2(fstr, maxlen)
+      character*(*) fstr
+      integer*4 maxlen
+
+      integer*4 l
+      l      = 0
+#if 0
+         print *, 'fstr is'
+#endif
+      do i=1,maxlen
+#if 0
+         print *, fstr(i:i)
+#endif
+         if (fstr(i:i) .eq. char(0)) go to 999
+         if (fstr(i:i) .eq. ' ') go to 999
+         l = l + 1
+      end do
+999   lenocc2 = l
+      return
+      end
+#endif
+#if 1
+*      SUBROUTINE HBALLOC64(IDN,CHDIR,VAR,BLOCK,ITYPE,ISIZE,IFIRST,NELEM,
+*     +                     IBASE,IOFF,NUSE)
+*
+      SUBROUTINE HBALLOC64V(CHDIR,VAR,BLOCK,IPAR,IBASE,IOFF)
+      CHARACTER*(*)  CHDIR, VAR, BLOCK
+      INTEGER        IDN, ITYPE, ISIZE, NELEM, NUSE, IFIRST, IBASE(1)
+      INTEGER*8      IBUF(1), IOFF
+      integer        ipar(6)
+
+      idn    = ipar(1)
+      itype  = ipar(2)
+      isize  = ipar(3)
+      ifirst = ipar(4)
+      nelem  = ipar(5)
+      nuse   = ipar(6)
+
+#if 0
+      print *, '     ...  hballoc64v: going to call hballoc64'
+#endif
+      call hballoc64(idn,chdir,var,block,itype,isize,ifirst,nelem,
+     .      ibase,ioff,nuse)
+      ipar(1) = idn
+      ipar(2) = itype
+      ipar(3) = isize
+      ipar(4) = ifirst
+      ipar(5) = nelem
+      ipar(6) = nuse
+
+      return
+      end
+#endif
diff -uNr src.ORIG/packlib/hbook/hntup/hgntbf.F src/packlib/hbook/hntup/hgntbf.F
--- src.ORIG/packlib/hbook/hntup/hgntbf.F	2022-03-27 15:11:11.000000000 +0900
+++ src/packlib/hbook/hntup/hgntbf.F	2022-05-19 20:47:59.000000000 +0900
@@ -36,3 +36,23 @@
       CALL HGNT1(IDN, '*', VAR, IOFFST, NVAR1, IDNEVT, IERROR)
 *
       END
+#if 1
+      SUBROUTINE HGNTBF64V(IDN,VAR,IOFFST,IPAR)
+*     SUBROUTINE HGNTBF64(IDN,VAR,IOFFST,NVAR,IDNEVT,IERROR)
+      CHARACTER*(*) VAR(*)
+      INTEGER*8     IOFFST(*)
+      integer       ipar(3)
+
+      nvar   = ipar(1)
+      idnevt = ipar(2)
+      ierror = ipar(3)
+
+      call HGNTBF64(IDN,VAR,IOFFST,NVAR,IDNEVT,IERROR)
+
+      ipar(1) = nvar  
+      ipar(2) = idnevt
+      ipar(3) = ierror
+
+      return
+      end
+#endif
diff -uNr src.ORIG/packlib/hbook/hntup/hntget.F src/packlib/hbook/hntup/hntget.F
--- src.ORIG/packlib/hbook/hntup/hntget.F	1996-01-17 02:07:58.000000000 +0900
+++ src/packlib/hbook/hntup/hntget.F	2022-05-19 20:47:59.000000000 +0900
@@ -110,3 +110,25 @@
       IER = 2
 *
       END
+#if 1
+      subroutine hntgetv(tvar,ipar)
+*     SUBROUTINE HNTGET(ID1, TVAR, INDX, ITYPE, ISIZE, IELEM, IER)
+      CHARACTER*(*) TVAR
+      integer       ipar(6)
+      id1   = ipar(1)
+      indx  = ipar(2)
+      itype = ipar(3)
+      isize = ipar(4)
+      ielem = ipar(5)
+      ier   = ipar(6)
+      call hntget(id1,tvar,indx,itype,isize,ielem,ier)
+      ipar(1) = id1  
+      ipar(2) = indx 
+      ipar(3) = itype
+      ipar(4) = isize
+      ipar(5) = ielem
+      ipar(6) = ier  
+
+      return
+      end
+#endif
diff -uNr src.ORIG/packlib/hbook/hntup/hntgeti.F src/packlib/hbook/hntup/hntgeti.F
--- src.ORIG/packlib/hbook/hntup/hntgeti.F	1996-01-17 02:07:59.000000000 +0900
+++ src/packlib/hbook/hntup/hntgeti.F	2022-05-19 20:47:59.000000000 +0900
@@ -73,16 +73,41 @@
 *-- statements in the routine produced by HUWFUN and the actual COMMON blocks
 *-- in which the variables are returned
 *
+#if 0
+      print *, 'hntgeti: id1=',id1,' icom=', icom, ' indx=',indx
+*      print *, '       : tvar=', (tvar(i:i),i=1,len(tvar))
+      print '(a,z8)', '        : locf(tvar)=0x', locf(tvar)
+      print *, '       : len(tvar)=',len(tvar),' itype=',itype
+      print *, '       : ielem=',ielem
+      flush 5
+#endif
       DO 10 I = 1, NDIM
 *
          CALL HNTVAR(ID, I, VAR, BLOCK, NSUB, ITYPE, ISIZE, IELEM)
          CALL CLTOU(VAR)
+#if 0
+         print *, 'hntgeti:',i,' var =',var,' block=',block,
+     &            ' itype=',itype
+*         print *, 'hntgeti: ndim=',ndim,' id  =',id,  ' icom  =',icom
+*         print *, '       : icom=',icom,' indx=',indx,' indcr4=',indcr4
+*         print *, '       :[',i,']  var =',var,  ' block=',block
+*         print *, '       :        itype=',itype,' isize=',isize
+         flush 5
+#endif
 *
          IF (ITYPE .NE. 5) THEN
             IF (ISIZE .EQ. 4) THEN
                IF (ICOM .NE. 4) GOTO 10
                IF (INDX .EQ. INDCR4) THEN
+#if 0
+                  print *, '   var=', var, ' indcr4=', indcr4
+                  flush 5
+#endif
                   TVAR = VAR
+#if 0
+                  print *, '   tvar=', tvar, 'isize=',isize
+                  flush 5
+#endif
                   RETURN
                ELSE
                   INDCR4 = INDCR4 + IELEM
@@ -90,7 +115,15 @@
             ELSEIF (ISIZE .EQ. 8) THEN
                IF (ICOM .NE. 8) GOTO 10
                IF (INDX .EQ. INDCR8) THEN
+#if 0
+                  print *, '   var=', var, ' indcr8=', indcr8
+                  flush 5
+#endif
                   TVAR = VAR
+#if 0
+                  print *, '   tvar=', tvar, ' isize=',isize
+                  flush 5
+#endif
                   RETURN
                ELSE
                   INDCR8 = INDCR8 + IELEM
@@ -99,7 +132,15 @@
          ELSE
             IF (ICOM .NE. 32) GOTO 10
             IF (INDX .EQ. INDC32) THEN
-               TVAR =VAR
+#if 0
+               print *, '   var=', var, ' indc32=', indc32
+               flush 5
+#endif
+               TVAR = VAR
+#if 0
+               print *, '   tvar=', tvar, ' isize=',isize
+               flush 5
+#endif
                RETURN
             ELSE
                INDC32 = INDC32 + IELEM
@@ -111,3 +152,40 @@
       IER = 2
 *
       END
+#if 1
+      SUBROUTINE HNTGETIV(TVAR,IPARM)
+*      SUBROUTINE HNTGETI(ID1,ICOM,INDX,TVAR,ITYPE,ISIZE,IELEM,IER)
+      CHARACTER*(*) TVAR
+      integer       iparm(7)
+      integer       id1, icom, indx, itype, isize, ielem, ier
+
+      id1   = iparm(1)
+      icom  = iparm(2)
+      indx  = iparm(3)
+      itype = iparm(4)
+      isize = iparm(5)
+      ielem = iparm(6)
+      ier   = iparm(7)
+#if 0
+      print *, 'hntgetiv: (b4)  tvar=', tvar
+      print *, '        : (b4)  len(tvar)=', len(tvar)
+      flush 5
+#endif
+      call hntgeti(id1,icom,indx,tvar,itype,isize,ielem,ier)
+      lvar = lenocc(tvar)
+#if 0
+      print *, '        : (aft) tvar=',tvar,' id1=',id1,' icom=',icom
+      print *, '        : (aft) lvar=',lvar
+      flush 5
+#endif
+      iparm(1) = id1   
+      iparm(2) = icom  
+      iparm(3) = indx  
+      iparm(4) = itype 
+      iparm(5) = isize 
+      iparm(6) = ielem 
+      iparm(7) = ier   
+
+      return
+      end
+#endif
diff -uNr src.ORIG/packlib/hbook/hntup/hntvar.F src/packlib/hbook/hntup/hntvar.F
--- src.ORIG/packlib/hbook/hntup/hntvar.F	1996-01-17 02:07:58.000000000 +0900
+++ src/packlib/hbook/hntup/hntvar.F	2022-05-19 20:47:59.000000000 +0900
@@ -112,3 +112,25 @@
       ENDIF
 *
       END
+#if 1
+      SUBROUTINE HNTVARV(CHTAG,BLOCK,IPAR)
+*      SUBROUTINE HNTVAR(ID1,IVAR,CHTAG,BLOCK,NSUB,ITYPE,ISIZE,IELEM)
+      CHARACTER*(*)  CHTAG, BLOCK
+      integer        ipar(6)
+      id1   = ipar(1)
+      ivar  = ipar(2)
+      nsub  = ipar(3)
+      itype = ipar(4)
+      isize = ipar(5)
+      ielem = ipar(6)
+      call HNTVAR(ID1,IVAR,CHTAG,BLOCK,NSUB,ITYPE,ISIZE,IELEM)
+      ipar(1) = id1  
+      ipar(2) = ivar 
+      ipar(3) = nsub 
+      ipar(4) = itype
+      ipar(5) = isize
+      ipar(6) = ielem
+
+      return
+      end
+#endif
diff -uNr src.ORIG/packlib/hbook/hntup/hvxist.F src/packlib/hbook/hntup/hvxist.F
--- src.ORIG/packlib/hbook/hntup/hvxist.F	1996-01-17 02:07:59.000000000 +0900
+++ src/packlib/hbook/hntup/hvxist.F	2022-05-19 20:47:59.000000000 +0900
@@ -34,12 +34,44 @@
 *
       VAR   = TVAR
       CALL CLTOU(VAR)
+#if 1
       LVAR  = LENOCC(VAR)
+#else
+      LVAR  = LENOCC2(VAR,32)
+      LCIV  = LENOCC2(CIVAR,32)
+      LBLO  = LENOCC2(BLOCK,8)
+# if 0
+      print *, '      : lvar =', lvar
+      print *, '      : lciv =', lciv
+      print *, '      : lblo =', lblo
+      print *, '      : lcid =', lcid
+      flush 5
+# endif
+#endif
+#if 0
+      print *, 'tvxist:'
+      print *, '      : itype =', itype
+      print *, '      : isize =', isize
+      print *, '      : ielem =', ielem
+      print *, '      : lvar  =', lvar
+      flush 5
+#endif
       LBLOK = LQ(LCID-1)
       LCHAR = LQ(LCID-2)
       LINT  = LQ(LCID-3)
       LREAL = LQ(LCID-4)
 *
+#if 0
+      print *, 'hvxist: block=', block
+*     print *, '      : civar=', civar
+      print *, '      : var  =', var
+      print *, '      : lvar =', lvar
+      print *, '      : lblok =', lblok
+      print *, '      : lchar =', lchar
+      print *, '      : lint  =', lint
+      print *, '      : lreal =', lreal
+      flush 5
+#endif
       BLOCK = ' '
       CIVAR = ' '
       ITYPE = 0
@@ -91,3 +123,27 @@
       LNAME = LQ(LBLOK-1)
 *
       END
+#if 1
+      SUBROUTINE HVXISTV(TVAR, BLOCK, CIVAR, IPAR)
+*     SUBROUTINE HVXIST(TVAR, BLOCK, CIVAR, ITYPE, ISIZE, IELEM)
+      CHARACTER*(*) TVAR, BLOCK, CIVAR
+      integer       itype, isize, ielem 
+      integer       ipar(3)
+
+      itype = ipar(1)
+      isize = ipar(2)
+      ielem = ipar(3)
+      call hvxist(tvar,block,civar,itype,isize,ielem)
+      ipar(1) = itype
+      ipar(2) = isize
+      ipar(3) = ielem
+#if 0
+      print *, 'tvxist:'
+      print *, ' (aft): itype =', itype
+      print *, '      : isize =', isize
+      print *, '      : ielem =', ielem
+      flush 5
+#endif
+      return
+      end
+#endif
diff -uNr src.ORIG/packlib/kernlib/kerngen/ccgen/lenocc2.c src/packlib/kernlib/kerngen/ccgen/lenocc2.c
--- src.ORIG/packlib/kernlib/kerngen/ccgen/lenocc2.c	2022-05-19 20:47:59.000000000 +0900
+++ src/packlib/kernlib/kerngen/ccgen/lenocc2.c	2022-05-19 20:47:59.000000000 +0900
@@ -0,0 +1,14 @@
+#include <stdlib.h>
+#include <stdio.h>
+#include <string.h>
+
+int lenocc_(char *chline, int len)
+{
+   int n = sizeof(chline);
+   int jj = n;
+   for (; jj>0; jj--) {
+      if (chline[jj-1] != '\0' && chline[jj-1] != ' ') break;         
+   }
+   if (jj == n) jj = n - 1;
+   return jj;
+}
diff -uNr src.ORIG/pawlib/paw/code/paplot.F src/pawlib/paw/code/paplot.F
--- src.ORIG/pawlib/paw/code/paplot.F	1996-03-01 20:38:42.000000000 +0900
+++ src/pawlib/paw/code/paplot.F	2022-05-19 20:47:59.000000000 +0900
@@ -104,3 +104,21 @@
          ENDIF
 *
       END
+#if 1
+      SUBROUTINE PAPLOTV(CHOPT,CHCASE,IPAR)
+*      SUBROUTINE PAPLOT(ID,CHOPT,CHCASE,NUM,ICRANG,ICX1,ICX2,ICY1,ICY2)
+      CHARACTER*(*) CHOPT,CHCASE
+      integer ipar(7)
+
+      id     = ipar(1)
+      num    = ipar(2)
+      icrang = ipar(3)
+      icx1   = ipar(4)
+      icx2   = ipar(5)
+      icy1   = ipar(6)
+      icy2   = ipar(7)
+      call PAPLOT(ID,CHOPT,CHCASE,NUM,ICRANG,ICX1,ICX2,ICY1,ICY2)
+
+      return
+      end
+#endif
diff -uNr src.ORIG/pawlib/paw/code/paspi2.F src/pawlib/paw/code/paspi2.F
--- src.ORIG/pawlib/paw/code/paspi2.F	1996-08-21 22:58:20.000000000 +0900
+++ src/pawlib/paw/code/paspi2.F	2022-05-19 20:47:59.000000000 +0900
@@ -366,3 +366,56 @@
       CALL IGARC (0.0, 0.0, 0.5, 0.5, 0.0, 0.0)
 *
       END
+#if 1
+      subroutine paspiv(cnames,ipar,rpar)
+*     SUBROUTINE PASPI (ICHEVT, NVARS, CNAMES, RZONE, IVART, IZONE, 
+*    +                   CURRENT, LOW, HIGH, AVG, SPIDER_TYPE)
+*
+      parameter (mvars = 1000)
+      CHARACTER*(*) CNAMES
+      integer ipar(*)
+      real    rpar(*)
+*
+      INTEGER ICHEVT
+      INTEGER NVARS
+      INTEGER IVART(MVARS)
+      INTEGER IZONE
+      INTEGER SPIDER_TYPE
+*
+      REAL RZONE
+*
+      REAL CURRENT(MVARS)
+      REAL LOW(MVARS)
+      REAL HIGH(MVARS)
+      REAL AVG(MVARS)
+
+      ichevt      = ipar(1)
+      nvars       = ipar(2)
+      izone       = ipar(3)
+      spider_type = ipar(4)
+      rzone       = rpar(1)
+      do i = 1, nvars
+        ivart  (i) = ipar(i+4)
+        current(i) = rpar(i+1)
+        low    (i) = rpar(i+1*nvars+1)
+        high   (i) = rpar(i+2*nvars+1)
+        avg    (i) = rpar(i+3*nvars+1)
+      end do
+      call PASPI (ICHEVT, NVARS, CNAMES, RZONE, IVART, IZONE, 
+     +                   CURRENT, LOW, HIGH, AVG, SPIDER_TYPE)
+      ipar(1) = ichevt     
+      ipar(2) = nvars      
+      ipar(3) = izone      
+      ipar(4) = spider_type
+      ipar(5) = rzone      
+      do i = 1, nvars
+        ipar(i+4)         = ivart  (i)
+        rpar(i+1)         = current(i)
+        rpar(i+1*nvars+1) = low    (i)
+        rpar(i+2*nvars+1) = high   (i)
+        rpar(i+3*nvars+1) = avg    (i)
+      end do
+
+      return
+      end
+#endif
diff -uNr src.ORIG/pawlib/paw/ntuple/npantup.c src/pawlib/paw/ntuple/npantup.c
--- src.ORIG/pawlib/paw/ntuple/npantup.c	2004-01-12 18:49:31.000000000 +0900
+++ src/pawlib/paw/ntuple/npantup.c	2022-05-19 20:47:59.000000000 +0900
@@ -271,6 +271,24 @@
 #include	"qpflags.h"
 #include	"svec.h"
 
+#if 1
+PROTOCCALLSFSUB3(HNTVARV,hntvarv,STRING,STRING,INTV)
+#define HNTVARV(A1,A2,IPAR) \
+	CCALLSFSUB3(HNTVARV,hntvarv,STRING,STRING,INTV,A1,A2,IPAR)
+PROTOCCALLSFSUB3(HBOOK1V,hbook1v,STRING,INTV,FLOATV)
+#define HBOOK1V(A1,IPAR,RPAR) \
+	CCALLSFSUB3(HBOOK1V,hbook1v,STRING,INTV,FLOATV,A1,IPAR,RPAR)
+PROTOCCALLSFSUB4(HBPROFV,hbprofv,STRING,STRING,INTV,FLOATV)
+#define HBPROFV(A1,A2,IPAR,RPAR) \
+	CCALLSFSUB4(HBPROFV,hbprofv,STRING,STRING,INTV,FLOATV,A1,A2,IPAR,RPAR)
+PROTOCCALLSFSUB3(PAPLOTV,paplotv,STRING,STRING,INTV)
+#define PAPLOTV(A1,A2,IPAR) \
+	CCALLSFSUB3(PAPLOTV,paplotv,STRING,STRING,INTV,A1,A2,IPAR)
+PROTOCCALLSFSUB2(HPLFR3V,hplfr3v,STRING,FLOATV)
+#define HPLFR3V(A1,RPAR) \
+	CCALLSFSUB2(HPLFR3V,hplfr3v,STRING,FLOATV,A1,RPAR)
+#endif
+
 extern void PiafNoEvt ( bool );
 extern void PackLabels( SMap, int *, String, int * );
 extern void UnpackLabels( SMap, String, int );
@@ -681,7 +699,28 @@
 
 			tag[0] = '\0';
 			block[0] = '\0';
+#if 0
 			HNTVAR( id, i, tag, block, nsub, ityp, isize, ielem );
+#else
+			int ipar[6];
+			ipar[0] = id;
+			ipar[1] = i;
+			ipar[2] = nsub;
+			ipar[3] = ityp;
+			ipar[4] = isize;
+			ipar[5] = ielem;
+#if 1
+			HNTVARV(tag, block, ipar);
+#else
+			hntvarv_(tag, block, ipar, sizeof(tag), sizeof(block));
+#endif
+			id    = ipar[0];
+			i     = ipar[1];
+			nsub  = ipar[2];
+			ityp  = ipar[3];
+			isize = ipar[4];
+			ielem = ipar[5];
+#endif
 			p = str_new( tag );
 			svec_add( all_tags, p );
 			HashInt_add( tab, p, i-1 );
@@ -1071,8 +1110,19 @@
 				h_hbook1_labels( idh, qe->expr_str[0],
 					label_list );
 			} else {
+#if 0
 				HBOOK1( idh, qe->expr_str[0],
 					nbin, low, up, 0. );
+#else
+				int ipar[2];
+				ipar[0] = idh;
+				ipar[1] = nbin;
+				float rpar[3];
+				rpar[0] = low;
+				rpar[1] = up;
+				rpar[2] = 0.;
+				HBOOK1V(qe->expr_str[0],ipar,rpar);
+#endif
 			}
 		}
 
@@ -1098,7 +1148,19 @@
 		char *		opt_string;
 
 		opt_string = qp_plot_opt_gen( opt, TRUE );
+#if 0
 		PAPLOT( idh, opt_string, "", 0, 0, 0, 0, 0, 0 );
+#else
+		int ipar[7];
+		ipar[0] = idh;
+		ipar[1] = 0;
+		ipar[2] = 0;
+		ipar[3] = 0;
+		ipar[4] = 0;
+		ipar[5] = 0;
+		ipar[6] = 0;
+		PAPLOTV(opt_string, "", ipar );
+#endif
 		PAUTIT( " " );
 
 		str_del( opt_string );
@@ -1343,7 +1405,19 @@
 		char *		opt_string;
 
 		opt_string = qp_plot_opt_gen( opt, TRUE );
+#if 0
 		PAPLOT( idh, opt_string, "", 0, 0, 0, 0, 0, 0 );
+#else
+		int ipar[7];
+		ipar[0] = idh;
+		ipar[1] = 0;
+		ipar[2] = 0;
+		ipar[3] = 0;
+		ipar[4] = 0;
+		ipar[5] = 0;
+		ipar[6] = 0;
+		PAPLOTV(opt_string, "", ipar );
+#endif
 		PAUTIT( " " );
 
 		str_del( opt_string );
@@ -1482,9 +1556,21 @@
 				optstr = " ";
 			}
 
+#if 0
 			HBPROF( idh, title, nbin[1],
 				low[1], up[1],
 				low[0], up[0], optstr );
+#else
+			int ipar[2];
+			ipar[0] = idh;
+			ipar[2] = nbin[1];
+			float rpar[4];
+			rpar[0] = low[1];
+			rpar[1] = up [1];
+			rpar[2] = low[0];
+			rpar[3] = up [0];
+			HBPROFV( title, optstr, ipar, rpar);
+#endif
 			
 		}
 
@@ -1513,7 +1599,19 @@
 		char *		opt_string;
 
 		opt_string = qp_plot_opt_gen( opt, TRUE );
+#if 0
 		PAPLOT( idh, opt_string, "", 0, 0, 0, 0, 0, 0 );
+#else
+		int ipar[7];
+		ipar[0] = idh;
+		ipar[1] = 0;
+		ipar[2] = 0;
+		ipar[3] = 0;
+		ipar[4] = 0;
+		ipar[5] = 0;
+		ipar[6] = 0;
+		PAPLOTV(opt_string, "", ipar );
+#endif
 		PAUTIT( " " );
 
 		str_del( opt_string );
@@ -1766,7 +1864,19 @@
 			HPLOPT( "NSTA", 1 );
 		}
 
+#if 0
                 PAPLOT( idh, opt_string, " ", 0, 0, 0, 0, 0, 0 );
+#else
+		int ipar[7];
+		ipar[0] = idh;
+		ipar[1] = 0;
+		ipar[2] = 0;
+		ipar[3] = 0;
+		ipar[4] = 0;
+		ipar[5] = 0;
+		ipar[6] = 0;
+		PAPLOTV(opt_string, "", ipar );
+#endif
 		if ( HCPIAF.slavpf ) {
 			char buf[80];
 			int istat;
@@ -1876,8 +1986,21 @@
 	    Theta = 0.;
 	    Phi   = 0.;
 	    GETTP( Theta, Phi );
+#if 0
 	    HPLFR3( low[2], up[2], low[1], up[1], low[0], up[0],
 		    Theta, Phi, "ABW" );
+#else
+	    float rpar[8];
+	    rpar[0] = low[2];
+	    rpar[1] = up [2];
+	    rpar[2] = low[1];
+	    rpar[3] = up [1];
+	    rpar[4] = low[0];
+	    rpar[5] = up [0];
+	    rpar[6] = Theta;
+	    rpar[7] = Phi;
+	    HPLFR3V("ABW",rpar);
+#endif
 	    
 	  }
 	  qpcmd_free( cmd );
@@ -1900,8 +2023,21 @@
 		qp_execute( qe, ifirst, nevent, cmd, errp );
 
 		if (!opt->S) {
+#if 0
 		  HPLFR3( low[2], up[2], low[1], up[1], low[0], up[0],
 			Theta, Phi, "F" );
+#else
+	          float rpar[8];
+	          rpar[0] = low[2];
+	          rpar[1] = up [2];
+	          rpar[2] = low[1];
+	          rpar[3] = up [1];
+	          rpar[4] = low[0];
+	          rpar[5] = up [0];
+	          rpar[6] = Theta;
+	          rpar[7] = Phi;
+	          HPLFR3V("F",rpar);
+#endif
 		}
 
 		qpcmd_free( cmd );
@@ -1988,8 +2124,21 @@
 		Theta = 0.;
 		Phi   = 0.;
 		GETTP( Theta, Phi );
+#if 0
 		HPLFR3( low[2], up[2], low[1], up[1], low[0], up[0],
 			Theta, Phi, "ABW" );
+#else
+	        float rpar[8];
+	        rpar[0] = low[2];
+	        rpar[1] = up [2];
+	        rpar[2] = low[1];
+	        rpar[3] = up [1];
+	        rpar[4] = low[0];
+	        rpar[5] = up [0];
+	        rpar[6] = Theta;
+	        rpar[7] = Phi;
+	        HPLFR3V("ABW",rpar);
+#endif
 		PAUTIT( title );
 	}
 
@@ -2004,8 +2153,21 @@
                 IGPID(1,"ntuple",qe->id," ");
 
 		qp_execute( qe, ifirst, nevent, cmd, errp );
+#if 0
 		HPLFR3( low[2], up[2], low[1], up[1], low[0], up[0],
 			Theta, Phi, "FG" );
+#else
+	        float rpar[8];
+	        rpar[0] = low[2];
+	        rpar[1] = up [2];
+	        rpar[2] = low[1];
+	        rpar[3] = up [1];
+	        rpar[4] = low[0];
+	        rpar[5] = up [0];
+	        rpar[6] = Theta;
+	        rpar[7] = Phi;
+	        HPLFR3V("FG",rpar);
+#endif
 
 		qpcmd_free( cmd );
 	}
@@ -2096,8 +2258,21 @@
 	      Theta = 0.;
 	      Phi   = 0.;
 	      GETTP( Theta, Phi );
+#if 0
 	      HPLFR3( low[2], up[2], low[1], up[1], low[0], up[0],
 		      Theta, Phi, "ABW" );
+#else
+	      float rpar[8];
+	      rpar[0] = low[2];
+	      rpar[1] = up [2];
+	      rpar[2] = low[1];
+	      rpar[3] = up [1];
+	      rpar[4] = low[0];
+	      rpar[5] = up [0];
+	      rpar[6] = Theta;
+	      rpar[7] = Phi;
+	      HPLFR3V("ABW",rpar);
+#endif
 	    }
 	    else {
 		qpcmd_getminmax( cmd, 3, &min, &max );
@@ -2124,8 +2299,21 @@
 	    qp_execute( qe, ifirst, nevent, cmd2, errp );
 	    
 	    if(!opt->S) {
+#if 0
 	      HPLFR3( low[2], up[2], low[1], up[1], low[0], up[0],
 		    Theta, Phi, "F" );
+#else
+	      float rpar[8];
+	      rpar[0] = low[2];
+	      rpar[1] = up [2];
+	      rpar[2] = low[1];
+	      rpar[3] = up [1];
+	      rpar[4] = low[0];
+	      rpar[5] = up [0];
+	      rpar[6] = Theta;
+	      rpar[7] = Phi;
+	      HPLFR3V("F",rpar);
+#endif
 	    }
 	    
 	    qpcmd_free( cmd2 );
diff -uNr src.ORIG/pawlib/paw/ntuple/qp_exec_evt.c src/pawlib/paw/ntuple/qp_exec_evt.c
--- src.ORIG/pawlib/paw/ntuple/qp_exec_evt.c	1999-07-06 00:43:33.000000000 +0900
+++ src/pawlib/paw/ntuple/qp_exec_evt.c	2022-05-19 20:47:59.000000000 +0900
@@ -36,6 +36,13 @@
 #include        "qp_exec_global.h"
 #include	"qp_exe_stack.h"	/* PRE_INCLUDE */
 
+#if 1
+//      PASPI(ichevt, nvars, cnames, rzone, ivart, izone, current, low, high, avg, spider_type)
+PROTOCCALLSFSUB3(PASPIV,paspiv,STRING,INTV,FLOATV)
+#define PASPIV(A1,IPAR,RPAR) \
+	CCALLSFSUB3(PASPIV,paspiv,STRING,INTV,FLOATV,A1,IPAR,RPAR)
+#endif
+
 /* extern functions */
 extern void qp_exec_seg( Segment, long, long, int *);
 
@@ -1130,9 +1137,71 @@
 			p->cur_line += 1;
 
 			if (p->use_average)
+#if 0
 			  PASPI(-(int)ievt, nexpr, p->expr_str, p->rzone, p->t_code, p->cur_line, fval, p->min, p->max, p->avg, p->spider_type);
+#else
+			{
+//                        PROTOCCALLSFSUB11(PASPI,paspi,INT,INT,STRING,FLOAT,INTV,INT,FLOATV,FLOATV,FLOATV,FLOATV,INT)
+			  int ipar[1000];
+			  ipar[0] = -(int)ievt;
+			  ipar[1] = nexpr;
+			  ipar[2] = p->cur_line;
+			  ipar[3] = p->spider_type;
+			  float rpar[1000];
+			  rpar[0] = p->rzone;
+			  for (int i=0; i<nexpr; i++) {
+				  ipar[i+4]         = p->t_code[i];
+				  rpar[i+1]         = fval[i];
+				  rpar[i+1*nexpr+1] = p->min[i];
+				  rpar[i+2*nexpr+1] = p->max[i];
+				  rpar[i+3*nexpr+1] = p->avg[i];
+			  }
+			  PASPIV(p->expr_str, ipar, rpar);
+			  p->cur_line    = ipar[2];
+			  p->spider_type = ipar[3];
+			  p->rzone = rpar[0];
+			  for (int i=0; i<nexpr; i++) {
+				  p->t_code[i] = ipar[i+4];
+				  fval[i]      = rpar[i+1];
+				  p->min[i]    = rpar[i+1*nexpr+1];
+				  p->max[i]    = rpar[i+2*nexpr+1];
+				  p->avg[i]    = rpar[i+3*nexpr+1];
+			  }
+			}
+#endif
 			else
+#if 0
 			  PASPI((int)ievt, nexpr, p->expr_str, p->rzone, p->t_code, p->cur_line, fval, p->min, p->max, p->avg, p->spider_type);
+#else
+			{
+//                        PROTOCCALLSFSUB11(PASPI,paspi,INT,INT,STRING,FLOAT,INTV,INT,FLOATV,FLOATV,FLOATV,FLOATV,INT)
+			  int ipar[1000];
+			  ipar[0] = (int)ievt;
+			  ipar[1] = nexpr;
+			  ipar[2] = p->cur_line;
+			  ipar[3] = p->spider_type;
+			  float rpar[1000];
+			  rpar[0] = p->rzone;
+			  for (int i=0; i<nexpr; i++) {
+				  ipar[i+4]         = p->t_code[i];
+				  rpar[i+1]         = fval[i];
+				  rpar[i+1*nexpr+1] = p->min[i];
+				  rpar[i+2*nexpr+1] = p->max[i];
+				  rpar[i+3*nexpr+1] = p->avg[i];
+			  }
+			  PASPIV(p->expr_str, ipar, rpar);
+			  p->cur_line    = ipar[2];
+			  p->spider_type = ipar[3];
+			  p->rzone = rpar[0];
+			  for (int i=0; i<nexpr; i++) {
+				  p->t_code[i] = ipar[i+4];
+				  fval[i]      = rpar[i+1];
+				  p->min[i]    = rpar[i+1*nexpr+1];
+				  p->max[i]    = rpar[i+2*nexpr+1];
+				  p->avg[i]    = rpar[i+3*nexpr+1];
+			  }
+			}
+#endif
    
 			if (p->cur_line >= p->max_line)  {
 			  p->cur_line = 0;
diff -uNr src.ORIG/pawlib/paw/ntuple/qp_execute.c src/pawlib/paw/ntuple/qp_execute.c
--- src.ORIG/pawlib/paw/ntuple/qp_execute.c	2022-03-27 15:11:11.000000000 +0900
+++ src/pawlib/paw/ntuple/qp_execute.c	2022-05-19 20:47:59.000000000 +0900
@@ -190,6 +190,24 @@
 # define HBALLOC HBALLOC64
 # define HGNTBF HGNTBF64
 #endif
+#if 1
+PROTOCCALLSFSUB6(HBALLOC64V,hballoc64v,STRING,STRING,STRING,INTV,INTV,PLONG)
+#define HBALLOC64V(A1,A2,A3,IPAR,IBASE,IOFF) \
+	CCALLSFSUB6(HBALLOC64V,hballoc64v,STRING,STRING,STRING,INTV,INTV,PLONG,A1,A2,A3,IPAR,IBASE,IOFF)
+PROTOCCALLSFSUB2(HNTGETV,hntgetv,STRING,INTV)
+#define HNTGETV(A1,IPAR) \
+	CCALLSFSUB2(HNTGETV,hntgetv,STRING,INTV,A1,IPAR)
+PROTOCCALLSFSUB3(HLABELV,hlabelv,STRING,STRING,INTV)
+#define HLABELV(A1,A2,IPAR) \
+	CCALLSFSUB3(HLABELV,hlabelv,STRING,STRING,INTV,A1,A2,IPAR)
+#if 0
+PROTOCCALLSFSUB4(HGNTBF64V,hgntbf64v,INT,ZTRINGV,LONGV,INTV)
+#define hgntbf64v_ELEMS_2          ZTRINGV_ARGS(4)
+#define hgntbf64v_ELEMLEN_2        ZTRINGV_NUM(32)
+#define HGNTBF64V(ID,VAR,IOFFS,IPAR) \
+	CCALLSFSUB4(HGNTBF64V,hgntbf64v,INT,ZTRINGV,LONGV,INTV,ID,VAR,IOFFS,IPAR)
+#endif
+#endif
 
 /* extern functions */
 extern void qp_exec_evt( QueryExe *, long, long, QPCmd *, int *);
@@ -199,6 +217,9 @@
 long		*offsetlist;
 int		*indexlist;
 
+#if 0
+extern void hgntbf64v_(int* , tName[],long[], int[]);
+#endif
 
 int		nt_load_cnt;
 bool		nt_load_from_disk;
@@ -244,8 +265,13 @@
 static void
 qp_exec_init(
 	QueryExe *	qe,
+#if 0
 	long		start_evt,
 	long		nevt,
+#else
+	int		start_evt,
+	int		nevt,
+#endif
 	QPCmd *		cmd,
 	int *		errp
 ) {
@@ -339,7 +365,28 @@
 			name = str_toupper( v->name );
 			block = str_toupper( v->block );
 
+#if 0
 			HNTGET( qe->id, name, indx, itype, isize, ielem, ierr );
+#else
+			int ipar[6];
+			ipar[0] = qe->id;
+			ipar[1] = indx;
+			ipar[2] = itype;
+			ipar[3] = isize;
+			ipar[4] = ielem;
+			ipar[5] = ierr;
+#if 1
+			HNTGETV(name, ipar);
+#else
+			hntgetv_(name, ipar, sizeof(name));
+#endif
+			qe->id = ipar[0];
+			indx   = ipar[1];
+			itype  = ipar[2];
+			isize  = ipar[3];
+			ielem  = ipar[4];
+			ierr   = ipar[5];
+#endif
 			if ( ierr != 0 ) {
 				sf_report( "qp_exec_init: HNTGET %s failed\n",
 				v->name );
@@ -369,8 +416,47 @@
 				break;
 			}
 
+#if 0
+			fprintf(stderr,"qp_exec_init 1: sizeof(path) =%d &path =%lx\n",sizeof(path),(void *)&path[0]);
+			fprintf(stderr,"              : sizeof(name) =%d &name =%lx\n",sizeof(name),(void *)name);
+			fprintf(stderr,"        (b4)  : sizeof(block)=%d &block=%lx\n",sizeof(block),(void *)block);
+#endif
+#if 0
 			HBALLOC( id, path, name, block, itype, isize, start_evt,
 				nevt*ielem, ibase, ioff, nuse );
+#else
+			int nelem = nevt*ielem;
+# if 0
+			hballoc64_( &id, path, name, block, &itype, &isize, &start_evt,
+				&nelem, ibase, &ioff, &nuse, sizeof(path), sizeof(name), sizeof(block) );
+# else
+			int iparm[6];
+			iparm[0] = id;
+			iparm[1] = itype;
+			iparm[2] = isize;
+			iparm[3] = start_evt;
+			iparm[4] = nelem;
+			iparm[5] = nuse;
+#if 1
+#if 0
+			fprintf(stderr,"             : goting to call hballoc64v\n");
+#endif
+			HBALLOC64V(path, name, block, iparm, ibase, ioff);
+#else
+			hballoc64v_( path, name, block, iparm, ibase, &ioff,
+				         sizeof(path), sizeof(name), sizeof(block) );
+#endif
+			id        = iparm[0];
+			itype     = iparm[1];
+			isize     = iparm[2];
+			start_evt = iparm[3];
+			nelem     = iparm[4];
+			nuse      = iparm[5];
+# endif
+#endif
+#if 0
+			fprintf(stderr,"       (aft)  : sizeof(block)=%d &block=%lx\n",sizeof(block),(void *)block);
+#endif
 
 			if ( qp_flags_get( "cache" ) != 0 ) {
 			  printf( "@@@ %s/%d %s:%s(%d) [%d..%d] -> ioff=%d nuse=%d\n",
@@ -500,8 +586,54 @@
 			indx = h_rwn_getIndex( qe->id, v->name );
 			qp_assert( indx >= 0 );
 
+#if 0
+			fprintf(stderr,"qp_exec_init 2: sizeof(path)=%d &path=%lx\n",sizeof(path),(void *)&path[0]);
+#endif
+#if 0
 			HBALLOC( id, path, name, "RWN", 1, 4, start_evt,
 				nevt, ibase, ioff, nuse );
+#else
+			char *rwnb = "RWN ";
+#if 0
+			fprintf(stderr,"              : sizeof(name) =%d &name =%lx\n",sizeof(name),(void *)name);
+			fprintf(stderr,"        (b4)  : sizeof(block)=%d &block=%lx\n",sizeof(rwnb),(void *)rwnb);
+#endif	
+#if 0
+			HBALLOC( id, path, name, rwnb, 1, 4, start_evt,
+				nevt, ibase, ioff, nuse );
+#else
+			int one = 1;
+			int four = 4;
+# if 0
+			hballoc64_(&id, path, name, rwnb, &one, &four, &start_evt,
+				&nevt, ibase, &ioff, &nuse, sizeof(path), sizeof(name), sizeof(rwnb) );
+# else
+			int ipara[6];
+			ipara[0] = id;
+			ipara[1] = one;
+			ipara[2] = four;
+			ipara[3] = start_evt;
+			ipara[4] = nevt;
+			ipara[5] = nuse;
+#if 1
+#if 0
+			fprintf(stderr,"             : goting to call hballoc64v\n");
+#endif
+			HBALLOC64V(path, name, "RWN ", ipara, ibase, ioff);
+#else
+			hballoc64v_(path, name, rwnb, ipara, ibase, &ioff,
+				         sizeof(path), sizeof(name), sizeof(rwnb) );
+#endif
+			id        = ipara[0];
+			start_evt = ipara[3];
+			nevt      = ipara[4];
+			nuse      = ipara[5];
+# endif
+#endif
+#if 0
+			fprintf(stderr,"       (aft)  : sizeof(block)=%d &block=%lx\n",sizeof(rwnb),(void *)rwnb);
+#endif
+#endif
 
 if ( qp_flags_get( "cache" ) != 0 ) {
 printf( "@@@ %s/%d %s:%s(%d) [%d..%d] -> ioff=%d nuse=%d\n",
@@ -1050,7 +1182,24 @@
 		name = str_toupper( namelist[i] );
 
 		/* a side-effect of HNTGET is setting the address of 'name' */
+#if 0
 		HNTGET( id, name, indx, itype, isize, ielem, ierr );
+#else
+		int ipar[6];
+		ipar[0] = id;
+		ipar[1] = indx;
+		ipar[2] = itype;
+		ipar[3] = isize;
+		ipar[4] = ielem;
+		ipar[5] = ierr;
+		HNTGETV(name, ipar);
+		id     = ipar[0];
+		indx   = ipar[1];
+		itype  = ipar[2];
+		isize  = ipar[3];
+		ielem  = ipar[4];
+		ierr   = ipar[5];
+#endif
 
 		if ( ierr != 0 ) {
 			sf_report( "reinit_cwn: Variable %s not found in %s\n",
@@ -2162,6 +2311,9 @@
 	QPCmd *		cmd,
 	int *		errp
 ) {
+#if 0
+	fprintf(stderr,"           : start of qp_exec_end\n");
+#endif
 	int		i;
 
 
@@ -2338,15 +2490,34 @@
 		}
 		free( (void *) cmd->u.hfill1.x );
 		free( (void *) cmd->u.hfill1.w );
+#if 0
+		fprintf(stderr,"qp_exec_end: after HF1N call\n");
+		fprintf(stderr,"           : qe->expr_type[0] = %d D_STR=%d\n", qe->expr_type[0], D_STR);
+#endif
 		if ( qe->expr_type[0] == D_STR ) {
+#if 0
 		        HLABEL( cmd->u.hfill1.idh, 0, " ", "SAX" );
+#else
+			int ipar[2];
+			ipar[0] = cmd->u.hfill1.idh;
+			ipar[1] = 0;
+		        HLABELV(" ", "SAX",ipar);
+#endif
 		}
 		break;
 
 	case CMD_HFILL2:
 		if ( qe->expr_type[0] == D_STR ) {
+#if 0
 		        HLABEL( cmd->u.hfill1.idh, 0, " ", "SAX" );
 		        HLABEL( cmd->u.hfill1.idh, 0, " ", "SAY" );
+#else
+			int ipar[2];
+			ipar[0] = cmd->u.hfill1.idh;
+			ipar[1] = 0;
+		        HLABELV(" ", "SAX", ipar);
+		        HLABELV(" ", "SAY", ipar);
+#endif
 		}
 		break;
 
@@ -2516,6 +2687,9 @@
 	free( (void *) namelist );
 	free( (void *) offsetlist );
 	free( (void *) indexlist );
+#if 0
+	fprintf(stderr,"           : end of qp_exec_end\n");
+#endif
 }
 
 
@@ -2564,11 +2738,26 @@
 				if ( nt_load_from_disk ) {
 					if ( is_cwn ) {
 						if ( new_file ) {
+#if 1
 							HGNTBF( qe->id,
 								namelist,
 								offsetlist,
 								nt_load_cnt,
 								ievtlcl, ierr );
+#else
+							int ipar[3];
+							ipar[0] = nt_load_cnt;
+							ipar[1] = ievtlcl;
+							ipar[2] = ierr;
+#if 0
+							HGNTBF64V(qe->id, namelist, offsetlist, ipar);
+#else
+							hgntbf64v_(&(qe->id), namelist, offsetlist, ipar);
+#endif
+							nt_load_cnt = ipar[0];
+							ievtlcl     = ipar[1];
+							ierr        = ipar[2];
+#endif
 							new_file = FALSE;
 						} else {
 							HGNTF( qe->id,
diff -uNr src.ORIG/pawlib/paw/ntuple/qp_hbook_if.c src/pawlib/paw/ntuple/qp_hbook_if.c
--- src.ORIG/pawlib/paw/ntuple/qp_hbook_if.c	2022-03-27 15:11:11.000000000 +0900
+++ src/pawlib/paw/ntuple/qp_hbook_if.c	2022-05-19 20:47:59.000000000 +0900
@@ -130,6 +130,14 @@
 #include	"qp_report.h"
 #include	"qp_command.h"	/* for MAX_MAP_STRINGS */
 #include	"qpflags.h"
+#if 1
+PROTOCCALLSFSUB3(HBOOK1V,hbook1v,STRING,INTV,FLOATV)
+#define HBOOK1V(A1,IPAR,RPAR) \
+	CCALLSFSUB3(HBOOK1V,hbook1v,STRING,INTV,FLOATV,A1,IPAR,RPAR)
+PROTOCCALLSFSUB3(HBOOK2V,hbook2v,STRING,INTV,FLOATV)
+#define HBOOK2V(A1,IPAR,RPAR) \
+	CCALLSFSUB3(HBOOK2V,hbook2v,STRING,INTV,FLOATV,A1,IPAR,RPAR)
+#endif
 
 
 #define	CF_TRUE		C2FLOGICAL(1)
@@ -273,6 +281,9 @@
 		QUEST.iquest[0] = -1;
 		return R_SYNTAX_ERROR;
 	}
+#if 0
+	fprintf(stderr,"h_load_nt: lcid=%d\n",HCBOOK.lcid);
+#endif
 	HDCOFL();
 
 	if ( HCBITS.i4 == 0 ) {
@@ -415,6 +426,9 @@
 	if ( HCBOOK.lcid == 0 ) {
 		return R_NAME_UNDEF;
 	}
+#if 0
+	fprintf(stderr,"h_load_histo: lcid=%d\n",HCBOOK.lcid);
+#endif
 
 	HDCOFL();
 
@@ -620,7 +634,18 @@
 	}
 
 	n = smap_entries(label_list);
+#if 0
 	HBOOK1( idh, title, n, 1., (float) (n+1), 0. );
+#else
+	int ipar[2];
+	ipar[0] = idh;
+	ipar[1] = n;
+	float rpar[3];
+	rpar[0] = 1.;
+	rpar[1] = n+1;
+	rpar[2] = 0.;
+	HBOOK1V(title,ipar,rpar);
+#endif
 
 	for ( i=0 ; i < n ; i++ ) {
 		strncpy( clab[i], smap_get( label_list, i ), MAX_LABEL_LEN);
@@ -660,10 +685,24 @@
 		max[1] = nbin[1] + 1.;
 	}
 
+#if 0
 	HBOOK2( idh, title,
 		nbin[1], min[1], max[1],
 		nbin[0], min[0], max[0],
 		0. );
+#else
+	int ipar[3];
+	ipar[0] = idh;
+	ipar[1] = nbin[1];
+	ipar[2] = nbin[0];
+	float rpar[5];
+	rpar[0] = min[1];
+	rpar[1] = max[1];
+	rpar[2] = min[0];
+	rpar[3] = max[0];
+	rpar[4] = 0.;
+	HBOOK2V(title, ipar, rpar);
+#endif
 
 	if ( labely_list != 0 ) {
 		for ( i=0 ; i < nbin[0] ; i++ ) {
diff -uNr src.ORIG/pawlib/paw/ntuple/qp_name.c src/pawlib/paw/ntuple/qp_name.c
--- src.ORIG/pawlib/paw/ntuple/qp_name.c	1999-07-06 00:43:35.000000000 +0900
+++ src/pawlib/paw/ntuple/qp_name.c	2022-05-19 21:28:07.000000000 +0900
@@ -73,6 +73,17 @@
 #include	"qp_report.h"
 #include	"qpflags.h"
 #include	"svec.h"
+#if 1
+//	HVXISTV(name, block, civar, iparm);
+PROTOCCALLSFSUB4(HVXISTV,hvxistv,STRING,STRING,STRING,INTV)
+#define HVXISTV(A1,A2,A3,IPAR) \
+	CCALLSFSUB4(HVXISTV,hvxistv,STRING,STRING,STRING,INTV,A1,A2,A3,IPAR)
+//	HNTGETIV(var,iparm);
+PROTOCCALLSFSUB2(HNTGETIV,hntgetiv,STRING,INTV)
+#define HNTGETIV(A1,IPAR) \
+	CCALLSFSUB2(HNTGETIV,hntgetiv,STRING,INTV,A1,IPAR)
+	int lenocc_(char *, int);
+#endif
 
 
 bool		db_name = FALSE;		/* control debug printing */
@@ -130,7 +141,11 @@
 {
 	Signature *s;
 	Dimension *dim;
+#if 1
 	char	block[MAX_BLOCK_LEN+1], civar[MAX_NAME_LEN+1];
+#else
+	static char	block[MAX_BLOCK_LEN+1], civar[MAX_NAME_LEN+1];
+#endif
 	int	itype, isize, ielem;
 	int	nvdim, ivdim[MAX_DIMENSION], ilow, iup, ierr;
 	int	i, r;
@@ -143,8 +158,38 @@
 	}
 
 	block[0] = '\0'; civar[0] = '\0';
+#if 1
+	itype = 0;
+	isize = 0;
+	ielem = 0;
+	//fprintf(stderr,"name_ntup: sizeof(block)=%d sizeof(civar)=%d\n", sizeof(block), sizeof(civar));
+	//fprintf(stderr,"         : curr_ntup=%d name=%s block=%s civar=%s itype=%d isize=%d ielem=%d\n", curr_ntup, name, block, civar, itype, isize, ielem);
+#endif
+#if 0
 	HVXIST( name, block, civar, itype, isize, ielem);
-
+#else
+# if 0
+	hvxist_( name, block, civar, &itype, &isize, &ielem, sizeof(name), sizeof(block), sizeof(civar));
+# else
+	int iparm[3];
+	iparm[0] = itype;
+	iparm[1] = isize;
+	iparm[2] = ielem;
+	//fprintf(stderr,"         : going to call hvxistv\n");
+#if 1
+	HVXISTV(name, block, civar, iparm);
+#else
+	hvxistv_( name, block, civar, iparm, sizeof(name), sizeof(block), sizeof(civar));
+#endif
+	itype = iparm[0];
+	isize = iparm[1];
+	ielem = iparm[2];
+# endif
+#endif
+#if 0
+	fprintf(stderr,"    (aft): name=%s block=%s civar=%s itype=%d isize=%d ielem=%d\n", name, block, civar, itype, isize, ielem);
+#endif
+ 
 	if ( ielem != 0 ) {
 		HNTDIM( name, nvdim, ivdim, MAX_DIMENSION );
 
@@ -593,6 +638,12 @@
 	int		ioffs, nel, idx, ierr, isize, next;
 	char		var[MAX_NAME_LEN+1], *p;
 
+#if 1
+	//fprintf(stderr,"comis_scan_subs: entered\n");
+	dummy1 = 0;
+	dummy2 = 0;
+	dummy3 = 0;
+#endif
 	new_ntuple = HNTNEW( id );
 	if ( new_ntuple ) {
 		cp_start = clist_new;
@@ -614,10 +665,60 @@
 				while ( *r == R_NOERR && nel > 0 ) {
 					if ( new_ntuple ) {
 						idx = 1 + ioffs / isize;
+#if 0
 						var[0] = '\0';
+#else
+# if 0
+# else
+						for (int kk=0; kk<MAX_NAME_LEN; kk++) var[kk] = ' ';
+						var[MAX_NAME_LEN] = '\0';
+# endif
+#endif
+#if 0
+						fprintf(stderr,"comis_scan_subs: going to call HNTGETI\n");
+						fprintf(stderr,"               : sizeof(var)=%d\n",sizeof(var));
+						fprintf(stderr,"               : &var[0]=0x%lx\n",(void *)&var[0]);
+#endif
+#if 0
 						HNTGETI(id,4*isize,idx,var,
 							dummy1,dummy2,dummy3,
 							ierr);
+#else
+# if 0
+						int isize4 = 4*isize;
+						hntgeti_(&id,&isize4,&idx,var,
+							&dummy1,&dummy2,&dummy3,
+							&ierr,sizeof(var));
+# else
+						int iparm[7];
+                                        	iparm[0] = id;
+                                        	iparm[1] = 4*isize;
+                                        	iparm[2] = idx;
+						iparm[3] = dummy1;
+						iparm[4] = dummy2;
+						iparm[5] = dummy3;
+						iparm[6] = ierr;
+                                        	//fprintf(stderr,"comis_scan_subs: going to call hntgetiv\n");
+#  if 1
+						HNTGETIV(var,iparm);
+#  else
+						hntgetiv_(var,iparm,sizeof(var));
+#  endif
+						int lvar = lenocc_(var, MAX_NAME_LEN);
+						var[lvar] = '\0';
+                                        	id     = iparm[0];
+                                        	isize  = iparm[1]/4;
+                                        	idx    = iparm[2];
+                                        	dummy1 = iparm[3];
+                                        	dummy2 = iparm[4];
+                                        	dummy3 = iparm[5];
+						ierr   = iparm[6];
+						//fprintf(stderr,"comis_scan_subs: aft calling hntgetiv\n");
+						//fprintf(stderr,"               : var=%s id=%d isize=%d ierr=%d\n",var,id,isize,ierr);
+						//fprintf(stderr,"               : &var[0]=0x%lx\n",(void *)&var[0]);
+						//fprintf(stderr,"               : strlen(var)=%d\n",strlen(var));
+# endif
+#endif
 						if ( ierr == 0 ) {
 							list_add( id, var );
 							nel -= (dummy2/4) * dummy3;
@@ -1040,6 +1141,9 @@
 	int		i, nsigs;
 	STIndex		idx;
 	SVec		found;
+#if 0
+	fprintf(stderr,"name_resolve: name=%s &r=0x%lx r=%d\n",name,r,*r);
+#endif
 
 	db_name = qp_flags_get( "name" );
 
/Users/fujiik/rpm/BUILD/cernlib-2006/2006/tmp
diff -uNr src.ORIG/graflib/dzdoc/dzdraw/dzdzeb.F src/graflib/dzdoc/dzdraw/dzdzeb.F
--- src.ORIG/graflib/dzdoc/dzdraw/dzdzeb.F	1996-03-05 01:13:00.000000000 +0900
+++ src/graflib/dzdoc/dzdraw/dzdzeb.F	2022-05-20 22:21:33.000000000 +0900
@@ -364,3 +364,11 @@
 999   CONTINUE
       END
 *********************************************************************
+#if 1
+      subroutine  dzdzebv(stv)
+*     SUBROUTINE  DZDZEB(BRNAME,BRCLAS,BRPATH,OBNAME,OBCLAS,STEXT,LTEXT)
+      character*256 stv(7)
+      call dzdzeb(stv(1),stv(2),stv(3),stv(4),stv(5),stv(6),stv(7))
+      return
+      end
+#endif
diff -uNr src.ORIG/packlib/kuip/code_kuip/kbrow.c src/packlib/kuip/code_kuip/kbrow.c
--- src.ORIG/packlib/kuip/code_kuip/kbrow.c	1996-03-09 00:32:52.000000000 +0900
+++ src/packlib/kuip/code_kuip/kbrow.c	2022-05-21 06:14:58.000000000 +0900
@@ -32,6 +32,11 @@
 static BrVariable* find_variable( BrObject*, const char* );
 static void  free_variables( BrVariable* );
 
+#if 1
+void pbhistv_(char(*)[256]);
+void dzdzebv_(char(*)[256]);
+#endif
+
 
 /*
  * add to the list of browsable classes
@@ -366,10 +371,39 @@
         if( long_text == NULL )
           long_text = " ";
         llong_text = strlen( long_text );
+#if 0
         F77_CALL_C7(bract->call_F,brobj_name,lbrobj_name,
                     brcls_name,lbrcls_name,path,lpath,
                     kmobj_name,lkmobj_name,kmcls_name,lkmcls_name,
                     short_text,lshort_text,long_text,llong_text);
+#else
+        char strv[7][256];
+        memset(&strv[0][0],' ', 7*256);
+        strncpy(&strv[0][0],brobj_name,lbrobj_name);
+        strncpy(&strv[1][0],brcls_name,lbrcls_name);
+        strncpy(&strv[2][0],path,lpath);
+        strncpy(&strv[3][0],kmobj_name,lkmobj_name);
+        strncpy(&strv[4][0],kmcls_name,lkmcls_name);
+        strncpy(&strv[5][0],short_text,lshort_text);
+        strncpy(&strv[6][0],long_text,llong_text);
+        //fprintf(stderr,"brcls_name=%s\n",brcls_name);
+        if (!strncmp(brcls_name,"HBOOK",5) || !strncmp(brcls_name,"PAWC",4)) 
+          pbhistv_(strv);
+        else if (!strncmp(brcls_name,"Zebra",5)) 
+          dzdzebv_(strv);
+        else
+          (*bract->call_F)(&strv[0][0],&strv[1][0],&strv[2][0],
+                                   &strv[3][0],&strv[4][0],&strv[5][0],&strv[6][0]);
+# if 0
+        //strncpy(brobj_name,&strv[0][0],lbrobj_name);
+        strncpy(brcls_name,&strv[1][0],lbrcls_name);
+        strncpy(path      ,&strv[2][0],lpath);
+        //strncpy(kmobj_name,&strv[3][0],lkmobj_name);
+        //strncpy(kmcls_name,&strv[4][0],lkmcls_name);
+        strncpy(short_text,&strv[5][0],lshort_text);
+        strncpy(long_text ,&strv[6][0],llong_text);
+# endif
+#endif
       }
       else if( bract->call_C != NULL ) {
         clientdata.brobj = brobj_name;
@@ -676,14 +710,49 @@
         memset( kmobj_name, ' ', lkmobj_name );
       memset( short_text, ' ', lshort_text );
       memset( long_text, ' ', llong_text );
+#if 0
       F77_CALL_C7(brobj->class->scan_km_F,
                   brobj_name,lbrobj_name,brcls_name,lbrcls_name,path,lpath,
                   kmobj_name,lkmobj_name,kmcls_name,lkmcls_name,
                   short_text,lshort_text,long_text,llong_text);
+#else
+      char strv[7][256];
+      memset(&strv[0][0],' ', 7*256);
+      strncpy(&strv[0][0],brobj_name,lbrobj_name);
+      strncpy(&strv[1][0],brcls_name,lbrcls_name);
+      strncpy(&strv[2][0],path,lpath);
+      strncpy(&strv[3][0],kmobj_name,lkmobj_name);
+      strncpy(&strv[4][0],kmcls_name,lkmcls_name);
+      strncpy(&strv[5][0],short_text,lshort_text);
+      strncpy(&strv[6][0],long_text,llong_text);
+
+      //fprintf(stderr,"brcls_name=%s\n",brcls_name);
+      if (!strncmp(brcls_name,"HBOOK",5) || !strncmp(brcls_name,"PAWC",4)) 
+        pbhistv_(strv);
+      else if (!strncmp(brcls_name,"Zebra",5)) 
+        dzdzebv_(strv);
+      else
+        (*brobj->class->scan_km_F)(&strv[0][0],&strv[1][0],&strv[2][0],
+                                 &strv[3][0],&strv[4][0],&strv[5][0],&strv[6][0]);
+
+      //strncpy(brobj_name,&strv[0][0],lbrobj_name);
+      //strncpy(brcls_name,&strv[1][0],lbrcls_name);
+      //strncpy(path      ,&strv[2][0],lpath);
+      strncpy(kmobj_name,&strv[3][0],lkmobj_name);
+      strncpy(kmcls_name,&strv[4][0],lkmcls_name);
+      strncpy(short_text,&strv[5][0],lshort_text);
+      strncpy(long_text ,&strv[6][0],llong_text);
+#endif
       oname = fstr0trim( kmobj_name, lkmobj_name );
       cname = fstr0trim( kmcls_name, lkmcls_name );
       stext = fstr0trim( short_text, lshort_text );
       ltext = fstr0dup( long_text, llong_text );
+#if 0
+      fprintf(stderr,"oname=%s\n",oname);
+      fprintf(stderr,"cname=%s\n",cname);
+      fprintf(stderr,"stext=%s\n",stext);
+      fprintf(stderr,"ltext=%s\n",ltext);
+#endif
     }
     else {
       char **obj_desc = (*brobj->class->scan_km_C)( brobj_name, brcls_name,
diff -uNr src.ORIG/pawlib/paw/cmotif/ntuple.c src/pawlib/paw/cmotif/ntuple.c
--- src.ORIG/pawlib/paw/cmotif/ntuple.c	1996-04-26 21:32:44.000000000 +0900
+++ src/pawlib/paw/cmotif/ntuple.c	2022-05-21 10:31:27.000000000 +0900
@@ -257,8 +257,26 @@
 
    title = XtCalloc(MAX_STRING, 1);
    ntup  = 0;   /* do not fill the Ntuple variable list */
+#if 0
    Mhlattr(ntuple.dir, strlen(ntuple.dir), &ntuple.id, title, MAX_STRING,
          &nvars, &xmin, &xmax, &nevt, &ymin, &ymax, &bits, &ntup);
+#else
+   int ipar[5];
+   ipar[0] = ntuple.id;
+   ipar[1] = nvars;
+   ipar[2] = nevt;
+   ipar[3] = bits;
+   ipar[4] = ntup;
+   float rpar[4];
+   rpar[0] = xmin;
+   rpar[1] = xmax;
+   rpar[2] = ymin;
+   rpar[3] = ymax;
+   
+   mhlattrv_(ntuple.dir,title,ipar,rpar,strlen(ntuple.dir),MAX_STRING);
+
+   nevt  = ipar[2];
+#endif
 
    if (nevt < 0)
       clear_ntuple_panel();
@@ -337,8 +355,24 @@
    /* Mhlattr will fill in the varNtList */
    title = XtCalloc(MAX_STRING, 1);
    ntup = ~0;   /* .TRUE., fill the Ntuple variable list */
+#if 0
    Mhlattr(ntuple.dir, strlen(ntuple.dir), &ntuple.id, title, MAX_STRING,
            &nvars, &xmin, &xmax, &nevt, &ymin, &ymax, &bits, &ntup);
+#else
+   int ipar[5];
+   ipar[0] = ntuple.id;
+   ipar[1] = nvars;
+   ipar[2] = nevt;
+   ipar[3] = bits;
+   ipar[4] = ntup;
+   float rpar[4];
+   rpar[0] = xmin;
+   rpar[1] = xmax;
+   rpar[2] = ymin;
+   rpar[3] = ymax;
+   
+   mhlattrv_(ntuple.dir,title,ipar,rpar,strlen(ntuple.dir),MAX_STRING);
+#endif
 
    XtFree(title);
 }
@@ -633,8 +667,34 @@
    /* check if not the same Ntuple */
    title = XtCalloc(MAX_STRING, 1);
    ntup  = 0;   /* do not fill the Ntuple variable list */
+#if 0
    Mhlattr(ntuple.dir, strlen(ntuple.dir), &ntuple.id, title, MAX_STRING,
          &nvars, &xmin, &xmax, &nevt, &ymin, &ymax, &bits, &ntup);
+#else
+   int ipar[5];
+   ipar[0] = ntuple.id;
+   ipar[1] = nvars;
+   ipar[2] = nevt;
+   ipar[3] = bits;
+   ipar[4] = ntup;
+   float rpar[4];
+   rpar[0] = xmin;
+   rpar[1] = xmax;
+   rpar[2] = ymin;
+   rpar[3] = ymax;
+   
+   mhlattrv_(ntuple.dir,title,ipar,rpar,strlen(ntuple.dir),MAX_STRING);
+
+   nvars = ipar[1];
+   nevt  = ipar[2];
+   bits  = ipar[3];
+   ntup  = ipar[4];
+
+   xmin  = rpar[0];
+   xmax  = rpar[1];
+   ymin  = rpar[2];
+   ymax  = rpar[3];
+#endif
 
    if (ntuple.id == old_id && !strcmp(ntuple.dir, old_dir) &&
        ntuple.ncols == nvars && ntuple.nrows == nevt) {
@@ -663,8 +723,33 @@
    ... end NO! ... */
 
    ntup = ~0;   /* .TRUE., fill the Ntuple variable list */
+#if 0
    Mhlattr(ntuple.dir, strlen(ntuple.dir), &ntuple.id, title, MAX_STRING,
            &nvars, &xmin, &xmax, &nevt, &ymin, &ymax, &bits, &ntup);
+#else
+   ipar[0] = ntuple.id;
+   ipar[1] = nvars;
+   ipar[2] = nevt;
+   ipar[3] = bits;
+   ipar[4] = ntup;
+
+   rpar[0] = xmin;
+   rpar[1] = xmax;
+   rpar[2] = ymin;
+   rpar[3] = ymax;
+   
+   mhlattrv_(ntuple.dir,title,ipar,rpar,strlen(ntuple.dir),MAX_STRING);
+
+   nvars = ipar[1];
+   nevt  = ipar[2];
+   bits  = ipar[3];
+   ntup  = ipar[4];
+
+   xmin  = rpar[0];
+   xmax  = rpar[1];
+   ymin  = rpar[2];
+   ymax  = rpar[3];
+#endif
    for (ltit = MAX_STRING; ltit > 0 && title[ltit-1] == ' '; )
      ltit--;
 
diff -uNr src.ORIG/pawlib/paw/fmotif/mhlattr.F src/pawlib/paw/fmotif/mhlattr.F
--- src.ORIG/pawlib/paw/fmotif/mhlattr.F	1996-09-11 23:59:48.000000000 +0900
+++ src/pawlib/paw/fmotif/mhlattr.F	2022-05-21 10:39:16.000000000 +0900
@@ -97,3 +97,40 @@
       RETURN
 *
       END
+#if 1
+      subroutine mhlattrv(chpath,title,ipar,rpar)
+*     SUBROUTINE MHLATTR(CHPATH,IOBJ,TITLE,NX,XMIN,XMAX,
+*    +                                     NY,YMIN,YMAX,ISW,NTUP)
+      CHARACTER*(*) CHPATH, TITLE
+      LOGICAL       NTUP
+      integer       ipar(5)
+      real          rpar(4)
+
+      iobj = ipar(1)
+      nx   = ipar(2)
+      ny   = ipar(3)
+      isw  = ipar(4)
+      ntup = ipar(5)
+
+      xmin = rpar(1)
+      xmax = rpar(2)
+      ymin = rpar(3)
+      ymax = rpar(4)
+
+      call mhlattr(chpath,iobj,title,nx,xmin,xmax,
+     +                               ny,ymin,ymax,isw,ntup)
+
+      ipar(1) = iobj
+      ipar(2) = nx  
+      ipar(3) = ny  
+      ipar(4) = isw 
+      ipar(5) = ntup
+                    
+      rpar(1) = xmin
+      rpar(2) = xmax
+      rpar(3) = ymin
+      rpar(4) = ymax
+
+      return
+      end
+#endif
diff -uNr src.ORIG/pawlib/paw/fmotif/pbhist.F src/pawlib/paw/fmotif/pbhist.F
--- src.ORIG/pawlib/paw/fmotif/pbhist.F	1996-03-01 20:39:05.000000000 +0900
+++ src/pawlib/paw/fmotif/pbhist.F	2022-05-20 22:04:56.000000000 +0900
@@ -84,3 +84,16 @@
       ENDIF
  999  CALL HCDIR(CHPATH,' ')
       END
+#if 1
+      subroutine pbhistv(stv)
+*     SUBROUTINE PBHIST(BRNAME,BRCLAS,BRPATH,OBNAME,OBCLAS,STEXT,LTEXT)
+*     CHARACTER*(*) BRNAME,BRCLAS,BRPATH,OBNAME,OBCLAS,STEXT,LTEXT
+*
+*            Browser interface to return next histogram
+*
+*     CHARACTER UPPATH*128,CHPATH*128,CHTITL*80,CHTYPE*1,CHPICT*32
+      character*256  stv(7) 
+      call pbhist(stv(1),stv(2),stv(3),stv(4),stv(5),stv(6),stv(7))
+      return
+      end
+#endif
