1
Fork 0
mirror of https://git.savannah.gnu.org/git/guile.git synced 2025-05-01 04:10:18 +02:00

deprecate struct-vtable-tag

* libguile/deprecated.c:
* libguile/deprecated.h:
* libguile/struct.c:
* libguile/struct.h:
* doc/ref/api-compound.texi: Deprecate struct-vtable-tag.
This commit is contained in:
Andy Wingo 2012-07-06 18:12:59 +02:00
parent 5d312f3c2c
commit d192791373
5 changed files with 27 additions and 26 deletions

View file

@ -1,7 +1,7 @@
@c -*-texinfo-*- @c -*-texinfo-*-
@c This is part of the GNU Guile Reference Manual. @c This is part of the GNU Guile Reference Manual.
@c Copyright (C) 1996, 1997, 2000, 2001, 2002, 2003, 2004, 2005, 2006, @c Copyright (C) 1996, 1997, 2000, 2001, 2002, 2003, 2004, 2005, 2006,
@c 2007, 2009, 2010, 2011 Free Software Foundation, Inc. @c 2007, 2009, 2010, 2011, 2012 Free Software Foundation, Inc.
@c See the file guile.texi for copying conditions. @c See the file guile.texi for copying conditions.
@node Compound Data Types @node Compound Data Types
@ -2372,7 +2372,7 @@ to be stored along side usual Scheme @code{SCM} values.
* Vtable Vtables:: * Vtable Vtables::
@end menu @end menu
@node Vtables, Structure Basics, Structures, Structures @node Vtables
@subsubsection Vtables @subsubsection Vtables
A vtable is a structure type, specifying its layout, and other A vtable is a structure type, specifying its layout, and other
@ -2460,7 +2460,7 @@ structure.
@end deffn @end deffn
@node Structure Basics, Vtable Contents, Vtables, Structures @node Structure Basics
@subsubsection Structure Basics @subsubsection Structure Basics
This section describes the basic procedures for working with This section describes the basic procedures for working with
@ -2542,7 +2542,7 @@ This can be used to examine the layout of an unknown structure, see
@end deffn @end deffn
@node Vtable Contents, Vtable Vtables, Structure Basics, Structures @node Vtable Contents
@subsubsection Vtable Contents @subsubsection Vtable Contents
A vtable is itself a structure, with particular fields that hold A vtable is itself a structure, with particular fields that hold
@ -2614,16 +2614,8 @@ from @var{vtable}.
@end example @end example
@end deffn @end deffn
@deffn {Scheme Procedure} struct-vtable-tag vtable
@deffnx {C Function} scm_struct_vtable_tag (vtable)
Return the tag of the given @var{vtable}.
@c
@c FIXME: what can be said about what this means?
@c
@end deffn
@node Vtable Vtables
@node Vtable Vtables, , Vtable Contents, Structures
@subsubsection Vtable Vtables @subsubsection Vtable Vtables
As noted above, a vtable is a structure and that structure is itself As noted above, a vtable is a structure and that structure is itself

View file

@ -2820,6 +2820,23 @@ SCM_DEFINE (scm_eval_closure_module,
#undef FUNC_NAME #undef FUNC_NAME
SCM_DEFINE (scm_struct_vtable_tag, "struct-vtable-tag", 1, 0, 0,
(SCM handle),
"Return the vtable tag of the structure @var{handle}.")
#define FUNC_NAME s_scm_struct_vtable_tag
{
SCM_VALIDATE_VTABLE (1, handle);
scm_c_issue_deprecation_warning
("struct-vtable-tag is deprecated. What were you doing with it anyway?");
return scm_from_unsigned_integer
(((scm_t_bits)SCM_STRUCT_DATA (handle)) >> 3);
}
#undef FUNC_NAME
void void

View file

@ -835,6 +835,10 @@ SCM_DEPRECATED SCM scm_eval_closure_module (SCM eval_closure);
SCM_DEPRECATED SCM scm_struct_vtable_tag (SCM handle);
void scm_i_init_deprecated (void); void scm_i_init_deprecated (void);
#endif #endif

View file

@ -917,17 +917,6 @@ SCM_DEFINE (scm_struct_vtable, "struct-vtable", 1, 0, 0,
#undef FUNC_NAME #undef FUNC_NAME
SCM_DEFINE (scm_struct_vtable_tag, "struct-vtable-tag", 1, 0, 0,
(SCM handle),
"Return the vtable tag of the structure @var{handle}.")
#define FUNC_NAME s_scm_struct_vtable_tag
{
SCM_VALIDATE_VTABLE (1, handle);
return scm_from_unsigned_integer
(((scm_t_bits)SCM_STRUCT_DATA (handle)) >> 3);
}
#undef FUNC_NAME
/* {Associating names and classes with vtables} /* {Associating names and classes with vtables}
* *
* The name of a vtable should probably be stored as a slot. This is * The name of a vtable should probably be stored as a slot. This is

View file

@ -3,7 +3,7 @@
#ifndef SCM_STRUCT_H #ifndef SCM_STRUCT_H
#define SCM_STRUCT_H #define SCM_STRUCT_H
/* Copyright (C) 1995,1997,1999,2000,2001, 2006, 2007, 2008, 2009, 2010, 2011 Free Software Foundation, Inc. /* Copyright (C) 1995,1997,1999,2000,2001, 2006, 2007, 2008, 2009, 2010, 2011, 2012 Free Software Foundation, Inc.
* *
* This library is free software; you can redistribute it and/or * This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public License * modify it under the terms of the GNU Lesser General Public License
@ -184,7 +184,6 @@ SCM_API SCM scm_make_vtable_vtable (SCM extra_fields, SCM tail_array_size, SCM i
SCM_API SCM scm_struct_ref (SCM handle, SCM pos); SCM_API SCM scm_struct_ref (SCM handle, SCM pos);
SCM_API SCM scm_struct_set_x (SCM handle, SCM pos, SCM val); SCM_API SCM scm_struct_set_x (SCM handle, SCM pos, SCM val);
SCM_API SCM scm_struct_vtable (SCM handle); SCM_API SCM scm_struct_vtable (SCM handle);
SCM_API SCM scm_struct_vtable_tag (SCM handle);
SCM_API SCM scm_struct_vtable_name (SCM vtable); SCM_API SCM scm_struct_vtable_name (SCM vtable);
SCM_API SCM scm_set_struct_vtable_name_x (SCM vtable, SCM name); SCM_API SCM scm_set_struct_vtable_name_x (SCM vtable, SCM name);
SCM_API void scm_print_struct (SCM exp, SCM port, scm_print_state *); SCM_API void scm_print_struct (SCM exp, SCM port, scm_print_state *);