pcs/freesp.c

39 lines
1.1 KiB
C
Raw Permalink Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

/* =====> FREESP.C */
/* TIPC Scheme '84 -- Freespace Utility
(C) Copyright 1984,1985 by Texas Instruments Incorporated.
All rights reserved.
Author: Terry Caudill
Date Written: 07 August 1985
Last Modification:
*/
#include "ctype.h"
#include "scheme.h"
/**********************************************************************/
/* TIPC Scheme '84 Free Space */
/* */
/* Purpose: This Routine will return the number of bytes of free */
/* user memory. */
/**********************************************************************/
long int freesp()
{
int space[NUMPAGES]; /* Free memory per page array */
int i; /* index var */
long int bytes_free; /* word to sum bytes available */
ENTER(freesp);
sum_space(space);
bytes_free = 0;
for (i = DEDPAGES; i < lastpage; i++)
if (ptype[i] == FREETYPE*2)
bytes_free = bytes_free + psize[i];
else
bytes_free = bytes_free + space[i];
return (bytes_free);
}