aboutsummaryrefslogtreecommitdiff
path: root/sys/symtab/stsqueeze.x
diff options
context:
space:
mode:
authorJoseph Hunkeler <jhunkeler@gmail.com>2015-07-08 20:46:52 -0400
committerJoseph Hunkeler <jhunkeler@gmail.com>2015-07-08 20:46:52 -0400
commitfa080de7afc95aa1c19a6e6fc0e0708ced2eadc4 (patch)
treebdda434976bc09c864f2e4fa6f16ba1952b1e555 /sys/symtab/stsqueeze.x
downloadiraf-linux-fa080de7afc95aa1c19a6e6fc0e0708ced2eadc4.tar.gz
Initial commit
Diffstat (limited to 'sys/symtab/stsqueeze.x')
-rw-r--r--sys/symtab/stsqueeze.x25
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