mirror of
https://git.savannah.gnu.org/git/guile.git
synced 2025-04-30 03:40:34 +02:00
Remove private-gc.h
* libguile/simpos.c (scm_getenv_int): Move here, from gc.c. * libguile/private-gc.h: Remove, unused. * libguile/simpos.h: Move scm_getenv_int declaration here. * libguile/vm.c: * libguile/gc.c: Adapt scm_getenv_int users. * libguile/gc-malloc.c: * libguile/load.c: * libguile/script.c: Remove private-gc includes from non-users of scm_getenv_int. * libguile/Makefile.am: Adapt.
This commit is contained in:
parent
35164d84e0
commit
87fc4596e5
9 changed files with 22 additions and 60 deletions
|
@ -469,7 +469,7 @@ noinst_HEADERS = conv-integer.i.c conv-uinteger.i.c \
|
|||
srfi-14.i.c \
|
||||
quicksort.i.c \
|
||||
win32-uname.h \
|
||||
private-gc.h private-options.h ports-internal.h
|
||||
private-options.h ports-internal.h
|
||||
|
||||
# vm instructions
|
||||
noinst_HEADERS += vm-engine.c
|
||||
|
|
|
@ -52,8 +52,6 @@ extern unsigned long * __libc_ia64_register_backing_store_base;
|
|||
#include "libguile/deprecation.h"
|
||||
#include "libguile/gc.h"
|
||||
|
||||
#include "libguile/private-gc.h"
|
||||
|
||||
#ifdef GUILE_DEBUG_MALLOC
|
||||
#include "libguile/debug-malloc.h"
|
||||
#endif
|
||||
|
|
|
@ -46,12 +46,12 @@ extern unsigned long * __libc_ia64_register_backing_store_base;
|
|||
#include "libguile/async.h"
|
||||
#include "libguile/ports.h"
|
||||
#include "libguile/root.h"
|
||||
#include "libguile/simpos.h"
|
||||
#include "libguile/strings.h"
|
||||
#include "libguile/vectors.h"
|
||||
#include "libguile/hashtab.h"
|
||||
#include "libguile/tags.h"
|
||||
|
||||
#include "libguile/private-gc.h"
|
||||
#include "libguile/validate.h"
|
||||
#include "libguile/deprecation.h"
|
||||
#include "libguile/gc.h"
|
||||
|
@ -568,25 +568,6 @@ scm_gc_unregister_roots (SCM *b, unsigned long n)
|
|||
|
||||
|
||||
|
||||
/*
|
||||
MOVE THIS FUNCTION. IT DOES NOT HAVE ANYTHING TODO WITH GC.
|
||||
*/
|
||||
|
||||
/* Get an integer from an environment variable. */
|
||||
int
|
||||
scm_getenv_int (const char *var, int def)
|
||||
{
|
||||
char *end = 0;
|
||||
char *val = getenv (var);
|
||||
long res = def;
|
||||
if (!val)
|
||||
return def;
|
||||
res = strtol (val, &end, 10);
|
||||
if (end == val)
|
||||
return def;
|
||||
return res;
|
||||
}
|
||||
|
||||
void
|
||||
scm_storage_prehistory ()
|
||||
{
|
||||
|
|
|
@ -28,7 +28,6 @@
|
|||
#include <stdio.h>
|
||||
|
||||
#include "libguile/_scm.h"
|
||||
#include "libguile/private-gc.h" /* scm_getenv_int */
|
||||
#include "libguile/libpath.h"
|
||||
#include "libguile/fports.h"
|
||||
#include "libguile/read.h"
|
||||
|
|
|
@ -1,30 +0,0 @@
|
|||
/*
|
||||
* private-gc.h - private declarations for garbage collection.
|
||||
*
|
||||
* Copyright (C) 2002, 03, 04, 05, 06, 07, 08, 09, 11, 13 Free Software Foundation, Inc.
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public License
|
||||
* as published by the Free Software Foundation; either version 3 of
|
||||
* the License, or (at your option) any later version.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful, but
|
||||
* WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this library; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
|
||||
* 02110-1301 USA
|
||||
*/
|
||||
|
||||
#ifndef SCM_PRIVATE_GC
|
||||
#define SCM_PRIVATE_GC
|
||||
|
||||
#include "_scm.h"
|
||||
|
||||
|
||||
SCM_INTERNAL int scm_getenv_int (const char *var, int def);
|
||||
|
||||
#endif
|
|
@ -1,4 +1,4 @@
|
|||
/* Copyright (C) 1994-1998, 2000-2011 Free Software Foundation, Inc.
|
||||
/* Copyright (C) 1994-1998, 2000-2011, 2013 Free Software Foundation, Inc.
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public License
|
||||
* as published by the Free Software Foundation; either version 3 of
|
||||
|
@ -33,7 +33,6 @@
|
|||
#include "libguile/eval.h"
|
||||
#include "libguile/feature.h"
|
||||
#include "libguile/load.h"
|
||||
#include "libguile/private-gc.h" /* scm_getenv_int */
|
||||
#include "libguile/read.h"
|
||||
#include "libguile/script.h"
|
||||
#include "libguile/strings.h"
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/* Copyright (C) 1995, 1996, 1997, 1998, 2000, 2001, 2003, 2004, 2009,
|
||||
* 2010, 2012 Free Software Foundation, Inc.
|
||||
* 2010, 2012, 2013 Free Software Foundation, Inc.
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public License
|
||||
|
@ -190,6 +190,21 @@ SCM_DEFINE (scm_getenv, "getenv", 1, 0, 0,
|
|||
}
|
||||
#undef FUNC_NAME
|
||||
|
||||
/* Get an integer from an environment variable. */
|
||||
int
|
||||
scm_getenv_int (const char *var, int def)
|
||||
{
|
||||
char *end = 0;
|
||||
char *val = getenv (var);
|
||||
long res = def;
|
||||
if (!val)
|
||||
return def;
|
||||
res = strtol (val, &end, 10);
|
||||
if (end == val)
|
||||
return def;
|
||||
return res;
|
||||
}
|
||||
|
||||
/* simple exit, without unwinding the scheme stack or flushing ports. */
|
||||
SCM_DEFINE (scm_primitive_exit, "primitive-exit", 0, 1, 0,
|
||||
(SCM status),
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
#ifndef SCM_SIMPOS_H
|
||||
#define SCM_SIMPOS_H
|
||||
|
||||
/* Copyright (C) 1995,1996,1997,1998,2000, 2006, 2008 Free Software Foundation, Inc.
|
||||
/* Copyright (C) 1995,1996,1997,1998,2000, 2006, 2008, 2013 Free Software Foundation, Inc.
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public License
|
||||
|
@ -32,6 +32,7 @@ SCM_API SCM scm_system_star (SCM cmds);
|
|||
SCM_API SCM scm_getenv (SCM nam);
|
||||
SCM_API SCM scm_primitive_exit (SCM status);
|
||||
SCM_API SCM scm_primitive__exit (SCM status);
|
||||
SCM_INTERNAL int scm_getenv_int (const char *var, int def);
|
||||
SCM_INTERNAL void scm_init_simpos (void);
|
||||
|
||||
#endif /* SCM_SIMPOS_H */
|
||||
|
|
|
@ -42,11 +42,10 @@
|
|||
#include "instructions.h"
|
||||
#include "loader.h"
|
||||
#include "programs.h"
|
||||
#include "simpos.h"
|
||||
#include "vm.h"
|
||||
#include "vm-builtins.h"
|
||||
|
||||
#include "private-gc.h" /* scm_getenv_int */
|
||||
|
||||
static int vm_default_engine = SCM_VM_REGULAR_ENGINE;
|
||||
|
||||
/* Unfortunately we can't snarf these: snarfed things are only loaded up from
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue