The FSF has a new address.
[bpt/guile.git] / libguile / environments.h
index 1c7683b..2880238 100644 (file)
@@ -1,47 +1,25 @@
 /* classes: h_files */
 
-#ifndef ENVIRONMENTS_H
-#define ENVIRONMENTS_H
-/* Copyright (C) 1999, 2000 Free Software Foundation, Inc.
+#ifndef SCM_ENVIRONMENTS_H
+#define SCM_ENVIRONMENTS_H
+
+/* Copyright (C) 1999,2000 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 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 2.1 of the License, or (at your option) any later version.
  *
- * This program is distributed in the hope that it will be useful,
+ * 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 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., 59 Temple Place, Suite 330,
- * Boston, MA 02111-1307 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.
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
  *
- * 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.  */
+ * 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
+ */
+
 \f
 
 #include "libguile/__scm.h"
@@ -74,18 +52,18 @@ struct scm_environment_funcs {
   void (*unobserve) (SCM self, SCM token);
 
   SCM (*mark) (SCM self);
-  scm_sizet (*free) (SCM self);
+  void (*free) (SCM self);
   int (*print) (SCM self, SCM port, scm_print_state *pstate);
 };
 
 \f
 
 #define SCM_ENVIRONMENT_SUCCESS SCM_BOOL_T
-#define SCM_ENVIRONMENT_BINDING_IMMUTABLE SCM_MAKINUM (0)
-#define SCM_ENVIRONMENT_LOCATION_IMMUTABLE SCM_MAKINUM (1)
+#define SCM_ENVIRONMENT_BINDING_IMMUTABLE scm_from_int (0)
+#define SCM_ENVIRONMENT_LOCATION_IMMUTABLE scm_from_int (1)
 #define SCM_ENVIRONMENT_LOCATION_NO_CELL SCM_BOOL_F
 
-extern long scm_tc16_environment;
+SCM_API scm_t_bits scm_tc16_environment;
 
 #define SCM_ENVIRONMENT_P(x) \
   (!SCM_IMP (x) && SCM_CELL_TYPE (x) == scm_tc16_environment)
@@ -110,7 +88,7 @@ extern long scm_tc16_environment;
 #define SCM_ENVIRONMENT_UNOBSERVE(env, token) \
   ((*(SCM_ENVIRONMENT_FUNCS (env)->unobserve)) (env, token))
 
-extern long scm_tc16_observer;
+SCM_API scm_t_bits scm_tc16_observer;
 
 #define SCM_OBSERVER_P(x) \
   (!SCM_IMP (x) && (SCM_CELL_TYPE (x) == scm_tc16_observer))
@@ -121,85 +99,87 @@ extern long scm_tc16_observer;
 #define SCM_OBSERVER_PROC(x) \
   ((scm_environment_observer) SCM_CELL_WORD_3 (x))
 
-extern void scm_error_environment_unbound (const char *, SCM, SCM) SCM_NORETURN;
-extern void scm_error_environment_immutable_binding (const char *, SCM, SCM) SCM_NORETURN;
-extern void scm_error_environment_immutable_location (const char *, SCM, SCM) SCM_NORETURN;
-
-extern SCM scm_make_environment (void *type);
-extern SCM scm_environment_p (SCM env);
-extern SCM scm_environment_bound_p (SCM env, SCM sym);
-extern SCM scm_environment_ref (SCM env, SCM sym);
-extern SCM scm_c_environment_ref (SCM env, SCM sym);
-extern SCM scm_environment_fold (SCM env, SCM proc, SCM init);
-extern SCM scm_c_environment_fold (SCM env, scm_environment_folder proc, SCM data, SCM init);
-extern SCM scm_environment_define (SCM env, SCM sym, SCM val);
-extern SCM scm_environment_undefine (SCM env, SCM sym);
-extern SCM scm_environment_set_x (SCM env, SCM sym, SCM val);
-extern SCM scm_environment_cell (SCM env, SCM sym, SCM for_write);
-extern SCM scm_c_environment_cell (SCM env, SCM sym, int for_write);
-extern SCM scm_environment_observe (SCM env, SCM proc);
-extern SCM scm_environment_observe_weak (SCM env, SCM proc);
-extern SCM scm_c_environment_observe (SCM env, scm_environment_observer proc, SCM data, int weak_p);
-extern SCM scm_environment_unobserve (SCM token);
-
-extern void scm_environments_prehistory (void);
-extern void scm_init_environments (void);
+SCM_API SCM scm_system_environment;
+
+SCM_API void scm_error_environment_unbound (const char *, SCM, SCM) SCM_NORETURN;
+SCM_API void scm_error_environment_immutable_binding (const char *, SCM, SCM) SCM_NORETURN;
+SCM_API void scm_error_environment_immutable_location (const char *, SCM, SCM) SCM_NORETURN;
+
+SCM_API SCM scm_make_environment (void *type);
+SCM_API SCM scm_environment_p (SCM env);
+SCM_API SCM scm_environment_bound_p (SCM env, SCM sym);
+SCM_API SCM scm_environment_ref (SCM env, SCM sym);
+SCM_API SCM scm_c_environment_ref (SCM env, SCM sym);
+SCM_API SCM scm_environment_fold (SCM env, SCM proc, SCM init);
+SCM_API SCM scm_c_environment_fold (SCM env, scm_environment_folder proc, SCM data, SCM init);
+SCM_API SCM scm_environment_define (SCM env, SCM sym, SCM val);
+SCM_API SCM scm_environment_undefine (SCM env, SCM sym);
+SCM_API SCM scm_environment_set_x (SCM env, SCM sym, SCM val);
+SCM_API SCM scm_environment_cell (SCM env, SCM sym, SCM for_write);
+SCM_API SCM scm_c_environment_cell (SCM env, SCM sym, int for_write);
+SCM_API SCM scm_environment_observe (SCM env, SCM proc);
+SCM_API SCM scm_environment_observe_weak (SCM env, SCM proc);
+SCM_API SCM scm_c_environment_observe (SCM env, scm_environment_observer proc, SCM data, int weak_p);
+SCM_API SCM scm_environment_unobserve (SCM token);
+
+SCM_API void scm_environments_prehistory (void);
+SCM_API void scm_init_environments (void);
 
 \f
 
-extern void *scm_type_leaf_environment;
+SCM_API void *scm_type_leaf_environment;
 
 #define SCM_LEAF_ENVIRONMENT_P(env) \
   (SCM_ENVIRONMENT_P (env) \
    && SCM_ENVIRONMENT_FUNCS (env) == scm_type_leaf_environment)
 
-extern SCM scm_make_leaf_environment (void);
-extern SCM scm_leaf_environment_p (SCM env);
+SCM_API SCM scm_make_leaf_environment (void);
+SCM_API SCM scm_leaf_environment_p (SCM env);
 
 \f
 
-extern void *scm_type_eval_environment;
+SCM_API void *scm_type_eval_environment;
 
 #define SCM_EVAL_ENVIRONMENT_P(env) \
   (SCM_ENVIRONMENT_P (env) \
    && SCM_ENVIRONMENT_FUNCS (env) == scm_type_eval_environment)
 
-extern SCM scm_make_eval_environment (SCM local, SCM imported);
-extern SCM scm_eval_environment_p (SCM env);
-extern SCM scm_eval_environment_local (SCM env);
-extern SCM scm_eval_environment_set_local_x (SCM env, SCM local);
-extern SCM scm_eval_environment_imported (SCM env);
-extern SCM scm_eval_environment_set_imported_x (SCM env, SCM imported);
+SCM_API SCM scm_make_eval_environment (SCM local, SCM imported);
+SCM_API SCM scm_eval_environment_p (SCM env);
+SCM_API SCM scm_eval_environment_local (SCM env);
+SCM_API SCM scm_eval_environment_set_local_x (SCM env, SCM local);
+SCM_API SCM scm_eval_environment_imported (SCM env);
+SCM_API SCM scm_eval_environment_set_imported_x (SCM env, SCM imported);
 
 \f
 
-extern void *scm_type_import_environment;
+SCM_API void *scm_type_import_environment;
 
 #define SCM_IMPORT_ENVIRONMENT_P(env) \
-  (SCM_ENVIRONMENT_FUNCS (env) == scm_type_import_environment)
+  (SCM_ENVIRONMENT_P (env) \
+   && SCM_ENVIRONMENT_FUNCS (env) == scm_type_import_environment)
 
-extern SCM scm_make_import_environment (SCM imports, SCM conflict_proc);
-extern SCM scm_import_environment_p (SCM env);
-extern SCM scm_import_environment_imports (SCM env);
-extern SCM scm_import_environment_set_imports_x (SCM env, SCM imports);
+SCM_API SCM scm_make_import_environment (SCM imports, SCM conflict_proc);
+SCM_API SCM scm_import_environment_p (SCM env);
+SCM_API SCM scm_import_environment_imports (SCM env);
+SCM_API SCM scm_import_environment_set_imports_x (SCM env, SCM imports);
 
 \f
 
-extern void *scm_type_export_environment;
+SCM_API void *scm_type_export_environment;
 
 #define SCM_EXPORT_ENVIRONMENT_P(env) \
-  (SCM_ENVIRONMENT_FUNCS (env) == scm_type_export_environment)
-
-extern SCM scm_make_export_environment (SCM private, SCM signature);
-extern SCM scm_export_environment_p (SCM env);
-extern SCM scm_export_environment_private (SCM env);
-extern SCM scm_export_environment_set_private_x (SCM env, SCM private);
-extern SCM scm_export_environment_signature (SCM env);
-extern SCM scm_export_environment_set_signature_x (SCM env, SCM signature);
-
+  (SCM_ENVIRONMENT_P (env) \
+   && SCM_ENVIRONMENT_FUNCS (env) == scm_type_export_environment)
 
-#endif
+SCM_API SCM scm_make_export_environment (SCM private, SCM signature);
+SCM_API SCM scm_export_environment_p (SCM env);
+SCM_API SCM scm_export_environment_private (SCM env);
+SCM_API SCM scm_export_environment_set_private_x (SCM env, SCM private);
+SCM_API SCM scm_export_environment_signature (SCM env);
+SCM_API SCM scm_export_environment_set_signature_x (SCM env, SCM signature);
 
+#endif  /* SCM_ENVIRONMENTS_H */
 
 /*
   Local Variables: