* threads-plugin.h: replace usage of struct timespect with
[bpt/guile.git] / libguile / feature.c
index e05a101..da54b9d 100644 (file)
@@ -1,4 +1,4 @@
-/*     Copyright (C) 1995, 1996, 1998, 1999, 2000 Free Software Foundation, Inc.
+/* Copyright (C) 1995,1996,1998,1999,2000,2001,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
  * whether to permit this exception to apply to your modifications.
  * If you do not wish that, delete this exception notice.  */
 
-/* Software engineering face-lift by Greg J. Badros, 11-Dec-1999,
-   gjb@cs.washington.edu, http://www.cs.washington.edu/homes/gjb */
 
 \f
+#if HAVE_CONFIG_H
+#  include <config.h>
+#endif
 
-#include <stdio.h>
-#include "libguile/_scm.h"
+#ifdef HAVE_STRING_H
+#include <string.h>
+#endif
 
+#include "libguile/_scm.h"
 #include "libguile/root.h"
-#include "libguile/smob.h"
 #include "libguile/strings.h"
-
 #include "libguile/validate.h"
+
 #include "libguile/feature.h"
 
-#ifdef HAVE_STRING_H
-#include <string.h>
-#endif
 \f
 
-static SCM *scm_loc_features;
+static SCM features_var;
+
 
 void
 scm_add_feature (const char *str)
 {
-  *scm_loc_features = scm_cons (SCM_CAR (scm_intern (str, strlen (str))),
-                               *scm_loc_features);
+  SCM old = SCM_VARIABLE_REF (features_var);
+  SCM new = scm_cons (scm_str2symbol (str), old);
+  SCM_VARIABLE_SET (features_var, new);
 }
 
-
 \f
 
 SCM_DEFINE (scm_program_arguments, "program-arguments", 0, 0, 0, 
-           (),
-"")
+           (),
+           "@deffnx {Scheme Procedure} command-line\n"
+           "Return the list of command line arguments passed to Guile, as a list of\n"
+           "strings.  The list includes the invoked program name, which is usually\n"
+           "@code{\"guile\"}, but excludes switches and parameters for command line\n"
+           "options like @code{-e} and @code{-l}.")
 #define FUNC_NAME s_scm_program_arguments
 {
   return scm_progargs;
@@ -100,10 +104,7 @@ scm_set_program_arguments (int argc, char **argv, char *first)
 void
 scm_init_feature()
 {
-  scm_loc_features = SCM_CDRLOC (scm_sysintern ("*features*", SCM_EOL));
-#ifdef SCM_RECKLESS
-  scm_add_feature("reckless");
-#endif
+  features_var = scm_c_define ("*features*", SCM_EOL);
 #ifndef _Windows
   scm_add_feature("system");
 #endif
@@ -119,11 +120,11 @@ scm_init_feature()
 #ifndef CHEAP_CONTINUATIONS
   scm_add_feature ("full-continuation");
 #endif
-#ifdef USE_THREADS
+#ifndef SCM_USE_NULL_THREADS
   scm_add_feature ("threads");
 #endif
   
-  scm_sysintern ("char-code-limit", SCM_MAKINUM (SCM_CHAR_CODE_LIMIT));
+  scm_c_define ("char-code-limit", SCM_MAKINUM (SCM_CHAR_CODE_LIMIT));
 
 #include "libguile/feature.x"
 }