aboutsummaryrefslogtreecommitdiffstats
path: root/rope.c
diff options
context:
space:
mode:
authorBryan Newbold <bnewbold@robocracy.org>2017-02-20 00:05:26 -0800
committerBryan Newbold <bnewbold@robocracy.org>2017-02-20 00:05:26 -0800
commitdeda2c0fd8689349fea2a900199a76ff7ecb319e (patch)
treec9726d54a0806a9b0c75e6c82db8692aea0053cf /rope.c
parent3278b75942bdbe706f7a0fba87729bb1e935b68b (diff)
downloadscm-deda2c0fd8689349fea2a900199a76ff7ecb319e.tar.gz
scm-deda2c0fd8689349fea2a900199a76ff7ecb319e.zip
Import Upstream version 5d6upstream/5d6
Diffstat (limited to 'rope.c')
-rw-r--r--rope.c44
1 files changed, 29 insertions, 15 deletions
diff --git a/rope.c b/rope.c
index 671279a..af62c41 100644
--- a/rope.c
+++ b/rope.c
@@ -15,26 +15,26 @@
* the Free Software Foundation, 59 Temple Place, Suite 330, Boston, MA 02111, USA.
*
* As a special exception, the Free Software Foundation gives permission
- * for additional uses of the text contained in its release of GUILE.
+ * for additional uses of the text contained in its release of SCM.
*
- * The exception is that, if you link the GUILE library with other files
+ * The exception is that, if you link the SCM library with other files
* to produce an executable, this does not by itself cause the
* resulting executable to be covered by the GNU General Public License.
* Your use of that executable is in no way restricted on account of
- * linking the GUILE library code into it.
+ * linking the SCM library code into it.
*
* This exception does not however invalidate any other reasons why
* the executable file might be covered by the GNU General Public License.
*
* This exception applies only to the code released by the
- * Free Software Foundation under the name GUILE. If you copy
+ * Free Software Foundation under the name SCM. If you copy
* code from other Free Software Foundation releases into a copy of
- * GUILE, as the General Public License permits, the exception does
+ * SCM, as the General Public License permits, the exception does
* not apply to the code that you add in this way. To avoid misleading
* anyone as to the status of such modified files, you must delete
* this exception notice from them.
*
- * If you write modifications of your own for GUILE, it is your choice
+ * If you write modifications of your own for SCM, it is your choice
* whether to permit this exception to apply to your modifications.
* If you do not wish that, delete this exception notice.
*/
@@ -85,7 +85,7 @@ unsigned char num2uchar(num, pos, s_caller)
char *pos, *s_caller;
{
unsigned long res = INUM(num);
- ASSERT(INUMP(num) && (255L >= res),num,pos,s_caller);
+ ASSERT(INUMP(num) && (255L >= res), num, pos, s_caller);
return (unsigned char) res;
}
unsigned short num2ushort(num, pos, s_caller)
@@ -93,7 +93,7 @@ unsigned short num2ushort(num, pos, s_caller)
char *pos, *s_caller;
{
unsigned long res = INUM(num);
- ASSERT(INUMP(num) && (65535L >= res),num,pos,s_caller);
+ ASSERT(INUMP(num) && (65535L >= res), num, pos, s_caller);
return (unsigned short) res;
}
unsigned long num2ulong(num, pos, s_caller)
@@ -251,7 +251,7 @@ SCM scm_evstr(str)
{
SCM lsym;
NEWCELL(lsym);
- SETLENGTH(lsym, strlen(str)+0L, tc7_ssymbol);
+ SETLENGTH(lsym, strlen(str), tc7_ssymbol);
SETCHARS(lsym, str);
return scm_eval_string(lsym);
}
@@ -260,7 +260,7 @@ void scm_ldstr(str)
{
SCM lsym;
NEWCELL(lsym);
- SETLENGTH(lsym, strlen(str)+0L, tc7_ssymbol);
+ SETLENGTH(lsym, strlen(str), tc7_ssymbol);
SETCHARS(lsym, str);
scm_load_string(lsym);
}
@@ -269,7 +269,7 @@ int scm_ldfile(path)
{
SCM name = makfrom0str(path);
*loc_errobj = name;
- return BOOL_F==tryload(name);
+ return BOOL_F==tryload(name, UNDEFINED);
}
int scm_ldprog(path)
char *path;
@@ -381,15 +381,14 @@ unsigned long scm_base_addr(v, s_name)
}
#endif /* ARRAYS */
+extern sizet hplim_ind;
+extern CELLPTR *hplims;
+
/* scm_cell_p() returns !0 if the SCM argument `x' is cell-aligned and
points into a valid heap segment. This code is duplicated from
mark_locations() and obunhash() in "sys.c", which means that
changes to these routines must be coordinated. */
-#include "continue.h"
-extern sizet hplim_ind;
-extern CELLPTR *hplims;
-
int scm_cell_p(x)
SCM x;
{
@@ -413,6 +412,21 @@ int scm_cell_p(x)
return 0;
}
+long scm_protidx = 0;
+
+SCM scm_gc_protect(obj)
+ SCM obj;
+{
+ long len;
+ ASSERT(NIMP(scm_uprotects), MAKINUM(20), NALLOC, "protects");
+ if IMP(obj) return obj;
+ len = LENGTH(scm_uprotects);
+ if (scm_protidx >= len) resizuve(scm_uprotects, MAKINUM(len + (len>>2)));
+ VELTS(scm_uprotects)[scm_protidx++] = obj;
+ return obj;
+}
+
void init_rope()
{
+ scm_uprotects = make_vector(MAKINUM(20), UNDEFINED);
}