diff options
Diffstat (limited to 'libguile/deprecated.c')
-rw-r--r-- | libguile/deprecated.c | 136 |
1 files changed, 136 insertions, 0 deletions
diff --git a/libguile/deprecated.c b/libguile/deprecated.c index 73720a5b8..8078b680d 100644 --- a/libguile/deprecated.c +++ b/libguile/deprecated.c @@ -28,6 +28,7 @@ #include "gsubr.h" #include "modules.h" #include "numbers.h" +#include "symbols.h" #include "threads.h" #include "variable.h" @@ -169,6 +170,141 @@ scm_c_weak_vector_set_x (SCM v, size_t k, SCM x) scm_weak_vector_set_x (v, scm_from_size_t (k), x); } + + + +static SCM object_properties_var; +static SCM set_object_properties_var; +static SCM object_property_var; +static SCM set_object_property_var; + +static void +init_object_properties_vars (void) +{ + object_properties_var = + scm_c_public_lookup ("ice-9 object-properties", "object-properties"); + set_object_properties_var = + scm_c_public_lookup ("ice-9 object-properties", "set-object-properties!"); + object_property_var = + scm_c_public_lookup ("ice-9 object-properties", "object-property"); + set_object_property_var = + scm_c_public_lookup ("ice-9 object-properties", "set-object-property!"); +} + +static void +init_object_properties (void) +{ + static scm_i_pthread_once_t once = SCM_I_PTHREAD_ONCE_INIT; + scm_c_issue_deprecation_warning + ("The object properties C interface is deprecated. Invoke the Scheme " + "procedures from (ice-9 object-properties) instead."); + scm_i_pthread_once (&once, init_object_properties_vars); +} + +SCM +scm_object_properties (SCM obj) +{ + init_object_properties (); + return scm_call_1 (scm_variable_ref (object_properties_var), obj); +} + + +SCM +scm_set_object_properties_x (SCM obj, SCM alist) +{ + init_object_properties (); + return scm_call_2 (scm_variable_ref (set_object_properties_var), obj, alist); +} + +SCM +scm_object_property (SCM obj, SCM key) +{ + init_object_properties (); + return scm_call_2 (scm_variable_ref (object_property_var), obj, key); +} + +SCM +scm_set_object_property_x (SCM obj, SCM key, SCM value) +{ + init_object_properties (); + return scm_call_3 (scm_variable_ref (set_object_property_var), obj, key, value); +} + + + + +SCM_GLOBAL_SYMBOL (scm_sym_filename, "filename"); +SCM_GLOBAL_SYMBOL (scm_sym_line, "line"); +SCM_GLOBAL_SYMBOL (scm_sym_column, "column"); + +static SCM source_properties_var; +static SCM set_source_properties_var; +static SCM source_property_var; +static SCM set_source_property_var; +static SCM cons_source_var; + +static void +init_source_properties_vars (void) +{ + source_properties_var = + scm_c_public_lookup ("ice-9 source-properties", "source-properties"); + set_source_properties_var = + scm_c_public_lookup ("ice-9 source-properties", "set-source-properties!"); + source_property_var = + scm_c_public_lookup ("ice-9 source-properties", "source-property"); + set_source_property_var = + scm_c_public_lookup ("ice-9 source-properties", "set-source-property!"); + cons_source_var = + scm_c_public_lookup ("ice-9 source-properties", "cons-source"); +} + +static void +init_source_properties (void) +{ + static scm_i_pthread_once_t once = SCM_I_PTHREAD_ONCE_INIT; + scm_c_issue_deprecation_warning + ("The source properties C interface is deprecated. Invoke the Scheme " + "procedures from (ice-9 source-properties) instead."); + scm_i_pthread_once (&once, init_source_properties_vars); +} + +SCM +scm_source_properties (SCM obj) +{ + init_source_properties (); + return scm_call_1 (scm_variable_ref (source_properties_var), obj); +} + + +SCM +scm_set_source_properties_x (SCM obj, SCM alist) +{ + init_source_properties (); + return scm_call_2 (scm_variable_ref (set_source_properties_var), obj, alist); +} + +SCM +scm_source_property (SCM obj, SCM key) +{ + init_source_properties (); + return scm_call_2 (scm_variable_ref (source_property_var), obj, key); +} + +SCM +scm_set_source_property_x (SCM obj, SCM key, SCM value) +{ + init_source_properties (); + return scm_call_3 (scm_variable_ref (set_source_property_var), obj, key, value); +} + +SCM +scm_cons_source (SCM orig, SCM x, SCM y) +{ + init_source_properties (); + return scm_call_3 (scm_variable_ref (cons_source_var), orig, x, y); +} + + void |