diff options
author | Joseph Hunkeler <jhunkeler@gmail.com> | 2015-07-08 20:46:52 -0400 |
---|---|---|
committer | Joseph Hunkeler <jhunkeler@gmail.com> | 2015-07-08 20:46:52 -0400 |
commit | fa080de7afc95aa1c19a6e6fc0e0708ced2eadc4 (patch) | |
tree | bdda434976bc09c864f2e4fa6f16ba1952b1e555 /sys/symtab/stsqueeze.x | |
download | iraf-linux-fa080de7afc95aa1c19a6e6fc0e0708ced2eadc4.tar.gz |
Initial commit
Diffstat (limited to 'sys/symtab/stsqueeze.x')
-rw-r--r-- | sys/symtab/stsqueeze.x | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/sys/symtab/stsqueeze.x b/sys/symtab/stsqueeze.x new file mode 100644 index 00000000..47f7b227 --- /dev/null +++ b/sys/symtab/stsqueeze.x @@ -0,0 +1,25 @@ +# Copyright(c) 1986 Association of Universities for Research in Astronomy Inc. + +include "symtab.h" + +# STSQUEEZE -- Return any unused storage in a symbol table. This is useful +# when it is known that no more symbols will be entered in a table, or before +# saving a symbol table in a save file. + +procedure stsqueeze (stp) + +pointer stp # symtab descriptor + +begin + if (ST_STABLEN(stp) > ST_STABOP(stp)) { + ST_STABLEN(stp) = ST_STABOP(stp) + ST_STABINC(stp) = min (MAX_INCREMENT, ST_STABLEN(stp)) + call realloc (ST_STABP(stp), ST_STABLEN(stp), TY_STRUCT) + } + + if (ST_SBUFLEN(stp) > ST_SBUFOP(stp)) { + ST_SBUFLEN(stp) = ST_SBUFOP(stp) + ST_SBUFINC(stp) = min (MAX_INCREMENT, ST_SBUFLEN(stp)) + call realloc (ST_SBUFP(stp), ST_SBUFLEN(stp), TY_CHAR) + } +end |