mirror of
https://git.savannah.gnu.org/git/guile.git
synced 2025-06-17 17:20:29 +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
|
@ -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),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue