C*PGBAND  -- read cursor position, with anchor
C%int cpgband(int mode, int posn, float xref, float yref, float *x,\
C%            float *y, char *ch_scalar);
C+
      SUBROUTINE PGBAND_h (ISTAT, MODE, POSN, XREF, YREF, X, Y, CH)

      INTEGER MODE, POSN, ISTAT
      REAL XREF, YREF, X, Y
      CHARACTER*(*) CH

      Istat =  PGBAND (MODE, POSN, XREF, YREF, X, Y, CH)
      RETURN
      END
C*PGBEG -- begin PGPLOT, open output device
C%int cpgbeg(int unit, const char *file, int nxsub, int nysub);
C+
      INTEGER FUNCTION PGBEG_h (UNIT, FILE, L, NXSUB, NYSUB)
      INTEGER       UNIT
      CHARACTER*(*) FILE
      INTEGER       L, NXSUB, NYSUB

      WRITE (6,*) 'Welcome to the PGPLOT Ada95 Binding'
      PGBEG_h = PGBEG (UNIT, FILE(1:L), NXSUB, NYSUB)
      RETURN  
      END
C*PGBOX -- draw labeled frame around viewport
C%void cpgbox(const char *xopt, float xtick, int nxsub, \
C% const char *yopt, float ytick, int nysub);
C+
      SUBROUTINE PGBOX_h (XOPT, LX, XTICK, NXSUB, 
     #                    YOPT, LY, YTICK, NYSUB)
      CHARACTER*(*) XOPT, YOPT
      REAL XTICK, YTICK
      INTEGER LX, LY, NXSUB, NYSUB

      CALL  PGBOX (XOPT(1:LX), XTICK, NXSUB, 
     #             YOPT(1:LY), YTICK, NYSUB)
      END
C*PGCONL -- label contour map of a 2D data array 
C%void cpgconl(const float *a, int idim, int jdim, int i1, int i2, \
C% int j1, int j2, float c, const float *tr, const char *label, \
C% int intval, int minint);
C+
      SUBROUTINE PGCONL_h (A, IDIM, JDIM, I1, I2, J1, J2, C, TR,
     #                   LABEL, L, INTVAL, MININT)
      INTEGER IDIM, JDIM, I1, J1, I2, J2, INTVAL, L, MININT
      REAL A(IDIM,JDIM), C, TR(6)
      CHARACTER*(*) LABEL

      CALL PGCONL (A, IDIM, JDIM, I1, I2, J1, J2, C, TR,
     #             LABEL(1:L), INTVAL, MININT)
      END
C*PGLAB -- write labels for x-axis, y-axis, and top of plot
C%void cpglab(const char *xlbl, const char *ylbl, const char *toplbl);
C+
      SUBROUTINE PGLAB_h (XLBL, LX, YLBL, LY, TOPLBL, LT)
      CHARACTER*(*) XLBL, YLBL, TOPLBL
      INTEGER  LX, LY, LT

      CALL PGLAB (XLBL(1:LX), YLBL(1:LY), TOPLBL(1:LT))
      END
C*PGLEN -- find length of a string in a variety of units
C%void cpglen(int units, const char *string, float *xl, float *yl);
C+
      SUBROUTINE PGLEN_h (UNITS, STRING, L, XL, YL)
      REAL XL, YL
      INTEGER L, UNITS
      CHARACTER*(*) STRING

      CALL PGLEN (UNITS, STRING(1:L), XL, YL)
      END
C*PGMTXT -- write text at position relative to viewport
C%void cpgmtxt(const char *side, float disp, float coord, \
C% float fjust, const char *text);
C+
      SUBROUTINE PGMTXT_h (SIDE, LS, DISP, COORD, FJUST, TEXT, LT)
      CHARACTER*(*) SIDE, TEXT
      INTEGER       LS, LT
      REAL DISP, COORD, FJUST

      CALL PGMTXT (SIDE(1:LS), DISP, COORD, FJUST, TEXT(1:LT))
      END
C*PGOPEN -- open a graphics device
C%int cpgopen(const char *device);
C+
      INTEGER FUNCTION PGOPEN_h (DEVICE, LL)
      INTEGER  LL
      CHARACTER*(*) DEVICE

      WRITE (6,*) 'Welcome to the PGPLOT Ada95 Binding'
      PgOPEN_h = PGOPEN (DEVICE(1:LL))
      RETURN
      END
C*PGPTXT -- write text at arbitrary position and angle
C%void cpgptxt(float x, float y, float angle, float fjust, \
C% const char *text);
C+
      SUBROUTINE PGPTXT_h (X, Y, ANGLE, FJUST, TEXT, LT)
      REAL X, Y, ANGLE, FJUST
      CHARACTER*(*) TEXT
      INTEGER LT

      CALL  PGPTXT (X, Y, ANGLE, FJUST, TEXT(1:LT))
      RETURN
      END
C*PGWEDG -- annotate an image plot with a wedge
C%void cpgwedg(const char *side, float disp, float width, \
C% float fg, float bg, const char *label);
C+
      SUBROUTINE PGWEDG_h (SIDE, LS, DISP, WIDTH, FG, BG, LABEL, LL)
      CHARACTER *(*) SIDE,LABEL
      REAL DISP, WIDTH, FG, BG
      INTEGER LS, LL

      CALL  PGWEDG (SIDE(1:LS), DISP, WIDTH, FG, BG, LABEL(1:LL))
      RETURN
      END
