/* sizmem.f -- translated by f2c (version of 3 February 1990  3:36:42).
   You must link the resulting object file with the libraries:
	-lF77 -lI77 -lm -lc   (in that order)
*/

#include "f2c.h"

/* Common Block Declarations */

struct {
    doublereal cpyknt;
    integer istack[1], lorg, icore, maxcor, maxuse, memavl, ldval, numblk, 
	    loctab, ltab, ifwa, nwoff, ntab, maxmem, memerr, nwd4, nwd8, 
	    nwd16;
} memmgr_;

#define memmgr_1 memmgr_

/* Table of constant values */

static integer c__7 = 7;

/*<       subroutine sizmem(ipntr,ksize) >*/
/* Subroutine */ int sizmem_(ipntr, ksize)
integer *ipntr, *ksize;
{
    extern /* Subroutine */ int errmem_();
    extern logical memptr_();

    /* Parameter adjustments */
    --ipntr;

    /* Function Body */
/*<       implicit double precision (a-h,o-z) >*/
/*<       dimension ipntr(1) >*/
/* spice version 2g.6  sccsid=memmgr 3/15/83 */
/*<       common /memmgr/ cpyknt,istack(1),lorg,icore,maxcor,maxuse,memavl, >*/
/*<      1   ldval,numblk,loctab,ltab,ifwa,nwoff,ntab,maxmem,memerr,nwd4, >*/
/*<      2   nwd8,nwd16 >*/
/*<       logical memptr >*/

/* ***  sizmem - determine size of existing block */


/* ...  check for valid pointer */
/*<       if (memptr(ipntr(1))) go to 10 >*/
    if (memptr_(&ipntr[1])) {
	goto L10;
    }
/*<       memerr=5 >*/
    memmgr_1.memerr = 5;
/*<       call errmem(7,memerr,ipntr(1)) >*/
    errmem_(&c__7, &memmgr_1.memerr, &ipntr[1]);
/*<    10 ksize=istack(ltab+3)/istack(ltab+5) >*/
L10:
    *ksize = memmgr_1.istack[memmgr_1.ltab + 2] / memmgr_1.istack[
	    memmgr_1.ltab + 4];
/*<       return >*/
    return 0;
/*<       end >*/
} /* sizmem_ */

