(unofficial) Guile 1.4.1.106 available

2005-07-30 Thread Thien-Thi Nguyen
release notes:

  a little elisp slinging this time around, plus the usual stuff.  w/
  this release, all distributed modules are finally documented in one
  way or another (there is always room for improvement).  if you
  discover a module and it's not in the module index, that's a bug!

  thi

NEWS excerpt:

  * bugfixes
  ** typo in "guile-tools c2x" (1.4.1.103 regression :-/)
  ** "guile-tools gxsed" handles `s//' and sed-syntax parens
  * potentially backward-incompatible changes
  ** boot-9 proc removed: load-emacs-interface
  ** var set by libguile renamed: `%%use-emacs-interface' (double-% prefix)
  * new documentation for existing code/interfaces
  ** boot-9 macro: collect
  ** libguile proc: builtin-variable
  ** module: (ice-9 emacs) -- new chapter: REPL Under Emacs
  * new installed emacs lisp: inf-guile.el inf-guile-synch-voeb.el

cvs tag:

  v-1-4-1-106-brindare

tarball, doc pointer, anoncvs instructions, and other files in dir:

  http://www.glug.org/people/ttn/software/guile/


___
Guile-user mailing list
Guile-user@gnu.org
http://lists.gnu.org/mailman/listinfo/guile-user


Re: setting env variable from Guile

2005-07-30 Thread Mike Gran
There are four things that should work, but, that I haven't tried out
yet.

You could call "dynamic-link" with the explicit pathname plus filename
to your library.

If your app is a pure guile script, you could write a wrapper shell
script that exports the environment variable you need and then calls
the guile script.

If you have a C main(), you could call lt_dladdsearchdir(const char *)
from C before dlopening your library.

You could wrap the function lt_dladdsearchdir as a Guile function and
call it from your script.

-- 
Mike

--- Aurelien Chanudet <[EMAIL PROTECTED]> wrote:

> Thank you guys for the tip.
> 
> Unfortunately, the environnement variable set in this way doesn't
> appear to be visible from the shell guile was launched from. As a
> result, the environnement variable does not appear to be visible to
> the dynamic link editor.
> 
> On 7/29/05, José Roberto B. de A. Monteiro
> <[EMAIL PROTECTED]> wrote:
> > On Thu, Jul 28, 2005 at 05:55:59PM +0200, Aurelien Chanudet wrote:
> > > Hi all,
> > >
> > > I have a dynamic library located in a non standard
> > > place I'd like to load within guile using
> > > "dynamic-link". The dynamic link editor can be told
> > > where to look for the library using an environment
> > > variable. Is there a way to set up the environnement
> > > variable directly _from_ Guile using for instance the
> > > "system" primitive ?
> > 
> > Have you ever tried to use Guile primitive function setenv ?
> > 
> > (setenv name value)
> > 
> > 
> >
> 
> 
> ___
> Guile-user mailing list
> Guile-user@gnu.org
> http://lists.gnu.org/mailman/listinfo/guile-user
> 





Start your day with Yahoo! - make it your home page 
http://www.yahoo.com/r/hs 
 


___
Guile-user mailing list
Guile-user@gnu.org
http://lists.gnu.org/mailman/listinfo/guile-user


Re: setting env variable from Guile

2005-07-30 Thread Thien-Thi Nguyen
   From: Mike Gran <[EMAIL PROTECTED]>
   Date: Sat, 30 Jul 2005 06:47:57 -0700 (PDT)

   You could wrap the function lt_dladdsearchdir as
   a Guile function and call it from your script.

fyi, this is the approach taken in Guile 1.4.x,
as implemented in libguile/lt.c, below.  works fine.


thi


_
/* lt.c */

/*  Copyright (C) 2002 Free Software Foundation, Inc.
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 2, or (at your option)
 * any later version.
 *
 * This program 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 General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this software; see the file COPYING.  If not, write to
 * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
 * Boston, MA 02110-1301, USA.
 *
 * As a special exception, the Free Software Foundation gives permission
 * for additional uses of the text contained in its release of GUILE.
 *
 * The exception is that, if you link the GUILE 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.
 *
 * 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
 * code from other Free Software Foundation releases into a copy of
 * GUILE, 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
 * whether to permit this exception to apply to your modifications.
 * If you do not wish that, delete this exception notice.  */

/* This is wrapper code for libltdl.  It should be possible to generate
   it completely at some point.  */


#include 
#include "libguile/_scm.h"
#include "libguile/eq.h"
#include "libguile/list.h"

#include "libguile/validate.h"
#include "libguile/strings.h"
#include "libguile/lt.h"

#include "libltdl/ltdl.h"

static SCM
add_search_dir_x (char *dir)
{
  if (0 == lt_dladdsearchdir (dir))
return SCM_UNSPECIFIED;
  scm_misc_error (NULL, (char *) lt_dlerror (), SCM_EOL);
}

static SCM
set_search_path_x (char *path)
{
  return ((0 == lt_dlsetsearchpath (path))
  ? SCM_BOOL_T
  : SCM_BOOL_F);
}

static SCM
get_search_path (void)
{
  return scm_makfrom0str_opt (lt_dlgetsearchpath ());
}

/* This is an experimental interface so we use a named command approach
   and use a "double %" prefix.  */

SCM_GLOBAL_SYMBOL (scm_sym_add_search_dir_x, "add-search-dir!");
SCM_GLOBAL_SYMBOL (scm_sym_set_search_path_x, "set-search-path!");
SCM_GLOBAL_SYMBOL (scm_sym_get_search_path, "get-search-path");

SCM_DEFINE (scm_percent_percent_ltdl, "%%ltdl", 1, 0, 1,
(SCM command, SCM args),
"Dispatch @var{command} given @var{args}, where\n"
"@var{command} is one of @code{add-search-dir!},\n"
"@code{set-search-path!}, or @code{get-search-path}\n"
"(a symbol).  This interface is highly experimental.\n")
#define FUNC_NAME s_scm_percent_percent_ltdl
{
  SCM_VALIDATE_SYMBOL (1, command);

  /* add-search-dir! */
  if (SCM_EQ_P (command, scm_sym_add_search_dir_x))
return add_search_dir_x (SCM_ROCHARS (SCM_CAR (args)));

  /* set-search-path! */
  if (SCM_EQ_P (command, scm_sym_set_search_path_x))
return set_search_path_x (SCM_ROCHARS (SCM_CAR (args)));

  /* get-search-path */
  if (SCM_EQ_P (command, scm_sym_get_search_path))
return get_search_path ();

  /* badness */
  scm_misc_error (NULL, "bad command", SCM_EOL);
}
#undef FUNC_NAME


void
scm_init_lt ()
{
#include "libguile/lt.x"
}

/* lt.c ends here */


___
Guile-user mailing list
Guile-user@gnu.org
http://lists.gnu.org/mailman/listinfo/guile-user