mirror of
https://git.savannah.gnu.org/git/guile.git
synced 2025-07-02 23:50:47 +02:00
Move subr internals off to internal header file
* libguile/gsubr-internal.h: New file. * libguile/Makefile.am: Add to build. * libguile/gsubr.h: Remove internal-only definitions. * libguile/foreign.c: * libguile/goops.c: * libguile/gsubr.c: * libguile/jit.c: * libguile/programs.c: * libguile/vm.c: Include new header.
This commit is contained in:
parent
d6e59a1d3e
commit
c03071b380
9 changed files with 67 additions and 30 deletions
|
@ -527,6 +527,7 @@ noinst_HEADERS = custom-ports.h \
|
||||||
cache-internal.h \
|
cache-internal.h \
|
||||||
gc-inline.h \
|
gc-inline.h \
|
||||||
gc-internal.h \
|
gc-internal.h \
|
||||||
|
gsubr-internal.h \
|
||||||
posix-w32.h \
|
posix-w32.h \
|
||||||
private-options.h \
|
private-options.h \
|
||||||
programs.h \
|
programs.h \
|
||||||
|
|
|
@ -40,7 +40,7 @@
|
||||||
#include "eval.h"
|
#include "eval.h"
|
||||||
#include "extensions.h"
|
#include "extensions.h"
|
||||||
#include "finalizers.h"
|
#include "finalizers.h"
|
||||||
#include "gsubr.h"
|
#include "gsubr-internal.h"
|
||||||
#include "instructions.h"
|
#include "instructions.h"
|
||||||
#include "intrinsics.h"
|
#include "intrinsics.h"
|
||||||
#include "keywords.h"
|
#include "keywords.h"
|
||||||
|
|
|
@ -38,7 +38,7 @@
|
||||||
#include "eval.h"
|
#include "eval.h"
|
||||||
#include "extensions.h"
|
#include "extensions.h"
|
||||||
#include "foreign.h"
|
#include "foreign.h"
|
||||||
#include "gsubr.h"
|
#include "gsubr-internal.h"
|
||||||
#include "hashtab.h"
|
#include "hashtab.h"
|
||||||
#include "keywords.h"
|
#include "keywords.h"
|
||||||
#include "macros.h"
|
#include "macros.h"
|
||||||
|
|
60
libguile/gsubr-internal.h
Normal file
60
libguile/gsubr-internal.h
Normal file
|
@ -0,0 +1,60 @@
|
||||||
|
#ifndef SCM_GSUBR_INTERNAL_H
|
||||||
|
#define SCM_GSUBR_INTERNAL_H
|
||||||
|
|
||||||
|
/* Copyright 1995-1996,1998,2000-2001,2006,2008,2009-2011,2013,2015,2018,2025
|
||||||
|
Free Software Foundation, Inc.
|
||||||
|
|
||||||
|
This file is part of Guile.
|
||||||
|
|
||||||
|
Guile 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 3 of the License, or
|
||||||
|
(at your option) any later version.
|
||||||
|
|
||||||
|
Guile 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 Lesser General Public
|
||||||
|
License for more details.
|
||||||
|
|
||||||
|
You should have received a copy of the GNU Lesser General Public
|
||||||
|
License along with Guile. If not, see
|
||||||
|
<https://www.gnu.org/licenses/>. */
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
#include "libguile/gsubr.h"
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/* Max number of args to the C procedure backing a gsubr */
|
||||||
|
#define SCM_GSUBR_MAX 10
|
||||||
|
|
||||||
|
#define SCM_PRIMITIVE_P(x) (scm_is_primitive (x))
|
||||||
|
#define SCM_PRIMITIVE_GENERIC_P(x) (scm_is_primitive_generic (x))
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
struct scm_program;
|
||||||
|
struct scm_thread;
|
||||||
|
|
||||||
|
SCM_INTERNAL uint32_t *
|
||||||
|
scm_i_alloc_primitive_code_with_instrumentation (size_t uint32_count,
|
||||||
|
uint32_t **write_ptr);
|
||||||
|
SCM_INTERNAL int scm_i_primitive_code_p (const uint32_t *code);
|
||||||
|
SCM_INTERNAL uintptr_t scm_i_primitive_call_ip (struct scm_program *subr);
|
||||||
|
SCM_INTERNAL SCM scm_i_primitive_name (const uint32_t *code);
|
||||||
|
|
||||||
|
SCM_INTERNAL int scm_is_primitive (SCM x);
|
||||||
|
SCM_INTERNAL int scm_is_primitive_generic (SCM x);
|
||||||
|
|
||||||
|
SCM_INTERNAL scm_t_subr scm_subr_function_by_index (uint32_t subr_idx);
|
||||||
|
SCM_INTERNAL SCM* scm_subr_generic (SCM x);
|
||||||
|
SCM_INTERNAL void scm_set_subr_generic (SCM x, SCM g);
|
||||||
|
|
||||||
|
SCM_INTERNAL SCM scm_apply_subr (union scm_vm_stack_element *sp,
|
||||||
|
uint32_t subr_idx, ptrdiff_t nargs);
|
||||||
|
|
||||||
|
SCM_INTERNAL void scm_init_gsubr (void);
|
||||||
|
|
||||||
|
#endif /* SCM_GSUBR_INTERNAL_H */
|
|
@ -40,7 +40,7 @@
|
||||||
#include "symbols.h"
|
#include "symbols.h"
|
||||||
#include "threads.h"
|
#include "threads.h"
|
||||||
|
|
||||||
#include "gsubr.h"
|
#include "gsubr-internal.h"
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -31,37 +31,13 @@
|
||||||
/* Subrs
|
/* Subrs
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/* Max number of args to the C procedure backing a gsubr */
|
|
||||||
#define SCM_GSUBR_MAX 10
|
|
||||||
|
|
||||||
#define SCM_PRIMITIVE_P(x) (scm_is_primitive (x))
|
|
||||||
#define SCM_PRIMITIVE_GENERIC_P(x) (scm_is_primitive_generic (x))
|
|
||||||
|
|
||||||
#define SCM_SUBRF(x) scm_subr_function (x)
|
#define SCM_SUBRF(x) scm_subr_function (x)
|
||||||
#define SCM_SUBR_NAME(x) scm_subr_name (x)
|
#define SCM_SUBR_NAME(x) scm_subr_name (x)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
struct scm_program;
|
|
||||||
|
|
||||||
SCM_INTERNAL uint32_t *
|
|
||||||
scm_i_alloc_primitive_code_with_instrumentation (size_t uint32_count,
|
|
||||||
uint32_t **write_ptr);
|
|
||||||
SCM_INTERNAL int scm_i_primitive_code_p (const uint32_t *code);
|
|
||||||
SCM_INTERNAL uintptr_t scm_i_primitive_call_ip (struct scm_program *subr);
|
|
||||||
SCM_INTERNAL SCM scm_i_primitive_name (const uint32_t *code);
|
|
||||||
|
|
||||||
SCM_INTERNAL int scm_is_primitive (SCM x);
|
|
||||||
SCM_INTERNAL int scm_is_primitive_generic (SCM x);
|
|
||||||
|
|
||||||
SCM_API scm_t_subr scm_subr_function (SCM subr);
|
SCM_API scm_t_subr scm_subr_function (SCM subr);
|
||||||
SCM_INTERNAL scm_t_subr scm_subr_function_by_index (uint32_t subr_idx);
|
|
||||||
SCM_API SCM scm_subr_name (SCM subr);
|
SCM_API SCM scm_subr_name (SCM subr);
|
||||||
SCM_INTERNAL SCM* scm_subr_generic (SCM x);
|
|
||||||
SCM_INTERNAL void scm_set_subr_generic (SCM x, SCM g);
|
|
||||||
|
|
||||||
SCM_INTERNAL SCM scm_apply_subr (union scm_vm_stack_element *sp,
|
|
||||||
uint32_t subr_idx, ptrdiff_t nargs);
|
|
||||||
|
|
||||||
SCM_API SCM scm_c_make_gsubr (const char *name,
|
SCM_API SCM scm_c_make_gsubr (const char *name,
|
||||||
int req, int opt, int rst, scm_t_subr fcn);
|
int req, int opt, int rst, scm_t_subr fcn);
|
||||||
|
|
|
@ -29,7 +29,7 @@
|
||||||
#include <lightening.h>
|
#include <lightening.h>
|
||||||
|
|
||||||
#include "frames.h"
|
#include "frames.h"
|
||||||
#include "gsubr.h"
|
#include "gsubr-internal.h"
|
||||||
#include "gc-inline.h"
|
#include "gc-inline.h"
|
||||||
#include "instructions.h"
|
#include "instructions.h"
|
||||||
#include "intrinsics.h"
|
#include "intrinsics.h"
|
||||||
|
|
|
@ -27,7 +27,7 @@
|
||||||
#include "boolean.h"
|
#include "boolean.h"
|
||||||
#include "eval.h"
|
#include "eval.h"
|
||||||
#include "extensions.h"
|
#include "extensions.h"
|
||||||
#include "gsubr.h"
|
#include "gsubr-internal.h"
|
||||||
#include "instructions.h"
|
#include "instructions.h"
|
||||||
#include "modules.h"
|
#include "modules.h"
|
||||||
#include "numbers.h"
|
#include "numbers.h"
|
||||||
|
|
|
@ -48,7 +48,7 @@
|
||||||
#include "foreign.h"
|
#include "foreign.h"
|
||||||
#include "frames.h"
|
#include "frames.h"
|
||||||
#include "gc-inline.h"
|
#include "gc-inline.h"
|
||||||
#include "gsubr.h"
|
#include "gsubr-internal.h"
|
||||||
#include "hooks.h"
|
#include "hooks.h"
|
||||||
#include "instructions.h"
|
#include "instructions.h"
|
||||||
#include "intrinsics.h"
|
#include "intrinsics.h"
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue