Skip to content

Commit 903832a

Browse files
author
luke
committed
Move R_ext/Callbacks.h to src/include. Factor out R_ObjectTable type
declarations into a new header R_ext/ObjectTable.h. To ease the transition add back a R_ext/Callbacks.h thata just included R_ext/ObjectTable.h. git-svn-id: https://svn.r-project.org/R/trunk@89101 00db46b3-68df-0310-9c12-caf00c1e9a41
1 parent e97bfa5 commit 903832a

File tree

7 files changed

+12
-51
lines changed

7 files changed

+12
-51
lines changed

doc/NEWS.Rd

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -255,7 +255,12 @@
255255

256256
\item The non-API header files \file{R_ext/Callbacks.h} and
257257
\file{R_ext/PrtUtil.h} are no longer copied to the installed
258-
includes directory.
258+
includes directory. The \code{R_ObjectTable} type definitions
259+
formally in \file{R_ext/Callbacks.h} are now available in the new
260+
header file \file{R_ext/ObjectTable.h}. This new header file
261+
should be used in packages instead of \file{R_ext/Callbacks.h}. To
262+
ease the transition a stub file \file{R_ext/Callbacks.h} has been
263+
added that just includes \file{R_ext/ObjectTable.h}.
259264
}
260265
}
261266

Lines changed: 1 addition & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/*
22
* R : A Computer Language for Statistical Data Analysis
3-
* Copyright (C) 2001-2020 The R Core Team.
3+
* Copyright (C) 2001-2025 The R Core Team.
44
*
55
* This header file is free software; you can redistribute it and/or modify
66
* it under the terms of the GNU Lesser General Public License as published by
@@ -68,50 +68,6 @@ Rboolean Rf_removeTaskCallbackByName(const char *name);
6868
SEXP R_removeTaskCallback(SEXP which);
6969
R_ToplevelCallbackEl* Rf_addTaskCallback(R_ToplevelCallback cb, void *data, void (*finalizer)(void *), const char *name, int *pos);
7070

71-
72-
73-
/*
74-
The following definitions are for callbacks to R functions and
75-
methods related to user-level tables. This was implemented in a
76-
separate package formerly available from Omegahat and these
77-
declarations allow the package to interface to the internal R code.
78-
79-
See https://developer.r-project.org/RObjectTables.pdf.
80-
*/
81-
82-
typedef struct _R_ObjectTable R_ObjectTable;
83-
84-
/* Do we actually need the exists() since it is never called but R
85-
uses get to see if the symbol is bound to anything? */
86-
typedef Rboolean (*Rdb_exists)(const char * const name, Rboolean *canCache, R_ObjectTable *);
87-
typedef SEXP (*Rdb_get)(const char * const name, Rboolean *canCache, R_ObjectTable *);
88-
typedef int (*Rdb_remove)(const char * const name, R_ObjectTable *);
89-
typedef SEXP (*Rdb_assign)(const char * const name, SEXP value, R_ObjectTable *);
90-
typedef SEXP (*Rdb_objects)(R_ObjectTable *);
91-
typedef Rboolean (*Rdb_canCache)(const char * const name, R_ObjectTable *);
92-
93-
typedef void (*Rdb_onDetach)(R_ObjectTable *);
94-
typedef void (*Rdb_onAttach)(R_ObjectTable *);
95-
96-
struct _R_ObjectTable{
97-
int type;
98-
char **cachedNames;
99-
Rboolean active;
100-
101-
Rdb_exists exists;
102-
Rdb_get get;
103-
Rdb_remove remove;
104-
Rdb_assign assign;
105-
Rdb_objects objects;
106-
Rdb_canCache canCache;
107-
108-
Rdb_onDetach onDetach;
109-
Rdb_onAttach onAttach;
110-
111-
void *privateData;
112-
};
113-
114-
11571
#ifdef __cplusplus
11672
}
11773
#endif

src/include/Makefile.win

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ R_EXT_HEADERS = \
2323
Lapack.h Linpack.h MathThreads.h Memory.h \
2424
Parse.h Print.h RS.h Rallocators.h Random.h \
2525
Rdynload.h Riconv.h RStartup.h Utils.h libextern.h \
26-
stats_package.h stats_stubs.h Visibility.h
26+
stats_package.h stats_stubs.h Visibility.h ObjectTable.h
2727

2828
all: fixh config.h trioremap.h
2929
@echo 'installing C headers'

src/include/R_ext/Makefile.in

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ R_EXT_HEADERS = \
2222
Lapack.h Linpack.h MathThreads.h Memory.h QuartzDevice.h \
2323
Parse.h Print.h RS.h Rallocators.h Random.h \
2424
Rdynload.h Riconv.h RStartup.h Utils.h eventloop.h libextern.h \
25-
stats_package.h stats_stubs.h Visibility.h
25+
stats_package.h stats_stubs.h Visibility.h ObjectTable.h
2626

2727
DISTFILES = Makefile.in $(R_EXT_HEADERS)
2828
TIMESTAMPS = $(R_EXT_HEADERS:.h=.ts)

src/main/envir.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@
9494
#define R_USE_SIGNALS 1
9595
#include <Defn.h>
9696
#include <Internal.h>
97-
#include <R_ext/Callbacks.h>
97+
#include <R_ext/ObjectTable.h>
9898

9999
#define FAST_BASE_CACHE_LOOKUP /* Define to enable fast lookups of symbols */
100100
/* in global cache from base environment */

src/main/main.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1622,7 +1622,7 @@ attribute_hidden SEXP do_quit(SEXP call, SEXP op, SEXP args, SEXP rho)
16221622
}
16231623

16241624

1625-
#include <R_ext/Callbacks.h>
1625+
#include <Callbacks.h>
16261626

16271627
static R_ToplevelCallbackEl *Rf_ToplevelTaskHandlers = NULL;
16281628

src/main/registration.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@
5555
a C++ compiler because the linkage changes as the declarations
5656
are (currently) within extern "C" blocks.
5757
*/
58-
#include <R_ext/Callbacks.h>
58+
#include <Callbacks.h>
5959
#include <Rdynpriv.h>
6060

6161
#include "basedecl.h"

0 commit comments

Comments
 (0)