[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Stratagus-CVS] stratagus/src include/ccl.h clone/ccl.c
From: |
Ingo Ruhnke |
Subject: |
[Stratagus-CVS] stratagus/src include/ccl.h clone/ccl.c |
Date: |
Mon, 14 Jul 2003 15:34:28 -0400 |
CVSROOT: /cvsroot/stratagus
Module name: stratagus
Branch:
Changes by: Ingo Ruhnke <address@hidden> 03/07/14 15:34:28
Modified files:
src/include : ccl.h
src/clone : ccl.c
Log message:
- added CclGcUnprotect
Patches:
Index: stratagus/src/clone/ccl.c
diff -u stratagus/src/clone/ccl.c:1.105 stratagus/src/clone/ccl.c:1.106
--- stratagus/src/clone/ccl.c:1.105 Fri Jul 11 10:35:29 2003
+++ stratagus/src/clone/ccl.c Mon Jul 14 15:34:28 2003
@@ -26,7 +26,7 @@
// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
// 02111-1307, USA.
//
-// $Id: ccl.c,v 1.105 2003/07/11 14:35:29 n0body Exp $
+// $Id: ccl.c,v 1.106 2003/07/14 19:34:28 grumbel Exp $
//@{
@@ -96,6 +96,34 @@
setvar(var,cons(obj,symbol_value(var,NIL)),NIL);
}
+/**
+** Remove a SCM object from garbage collectors protection list.
+**
+** @param obj Scheme object
+*/
+global void CclGcUnprotect(SCM obj)
+{
+ // Remove obj from the list *ccl-protect*
+ SCM sym;
+ SCM old_lst;
+ SCM new_lst;
+
+ sym = gh_symbol2scm("*ccl-protect*");
+ old_lst = symbol_value(sym, NIL);
+ new_lst = NIL;
+
+ while( !gh_null_p(old_lst) ) {
+ SCM el = gh_car(old_lst);
+
+ if (el != obj)
+ new_lst = cons(el, new_lst);
+
+ old_lst = gh_cdr(old_lst);
+ }
+
+ setvar(sym, new_lst, NIL);
+}
+
/*............................................................................
.. Config
............................................................................*/
@@ -865,7 +893,7 @@
}
fprintf(fd,";;; -----------------------------------------\n");
- fprintf(fd,";;; $Id: ccl.c,v 1.105 2003/07/11 14:35:29 n0body Exp $\n");
+ fprintf(fd,";;; $Id: ccl.c,v 1.106 2003/07/14 19:34:28 grumbel Exp $\n");
fprintf(fd,"(set-video-resolution! %d %d)\n", VideoWidth, VideoHeight);
@@ -889,7 +917,7 @@
}
fprintf(fd,";;; -----------------------------------------\n");
- fprintf(fd,";;; $Id: ccl.c,v 1.105 2003/07/11 14:35:29 n0body Exp $\n");
+ fprintf(fd,";;; $Id: ccl.c,v 1.106 2003/07/14 19:34:28 grumbel Exp $\n");
// Global options
if( OriginalFogOfWar ) {
@@ -998,7 +1026,7 @@
extern SCM oblistvar;
fprintf(file,"\n;;; -----------------------------------------\n");
- fprintf(file,";;; MODULE: CCL $Id: ccl.c,v 1.105 2003/07/11 14:35:29
n0body Exp $\n\n");
+ fprintf(file,";;; MODULE: CCL $Id: ccl.c,v 1.106 2003/07/14 19:34:28
grumbel Exp $\n\n");
for( list=oblistvar; CONSP(list); list=CDR(list) ) {
SCM sym;
Index: stratagus/src/include/ccl.h
diff -u stratagus/src/include/ccl.h:1.35 stratagus/src/include/ccl.h:1.36
--- stratagus/src/include/ccl.h:1.35 Fri Jul 11 10:35:30 2003
+++ stratagus/src/include/ccl.h Mon Jul 14 15:34:28 2003
@@ -26,7 +26,7 @@
// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
// 02111-1307, USA.
//
-// $Id: ccl.h,v 1.35 2003/07/11 14:35:30 n0body Exp $
+// $Id: ccl.h,v 1.36 2003/07/14 19:34:28 grumbel Exp $
#ifndef __CCL_H__
#define __CCL_H__
@@ -119,6 +119,7 @@
----------------------------------------------------------------------------*/
extern void CclGcProtect(SCM obj); /// Protect scm object for GC
+extern void CclGcUnprotect(SCM obj); /// Unprotect scm object for GC
extern void InitCcl(void); /// Initialise ccl
extern void LoadCcl(void); /// Load ccl config file
extern void SaveCcl(FILE* file); /// Save CCL module
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Stratagus-CVS] stratagus/src include/ccl.h clone/ccl.c,
Ingo Ruhnke <=