Skip to content

Commit 2ef5f97

Browse files
committed
more
1 parent 6b9671b commit 2ef5f97

File tree

5 files changed

+109
-2
lines changed

5 files changed

+109
-2
lines changed

DESCRIPTION

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
Package: stringi
2-
Version: 1.8.4.9002
3-
Date: 2025-02-02
2+
Version: 1.8.4.9003
3+
Date: 2025-02-03
44
Title: Fast and Portable Character String Processing Facilities
55
Description: A collection of character string/text/natural language
66
processing tools for pattern searching (e.g., with 'Java'-like regular

src/stri_callables.cpp

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
/* This file is part of the 'stringi' project.
2+
* Copyright (c) 2013-2025, Marek Gagolewski <https://www.gagolewski.com/>
3+
* All rights reserved.
4+
*
5+
* Redistribution and use in source and binary forms, with or without
6+
* modification, are permitted provided that the following conditions are met:
7+
*
8+
* 1. Redistributions of source code must retain the above copyright notice,
9+
* this list of conditions and the following disclaimer.
10+
*
11+
* 2. Redistributions in binary form must reproduce the above copyright notice,
12+
* this list of conditions and the following disclaimer in the documentation
13+
* and/or other materials provided with the distribution.
14+
*
15+
* 3. Neither the name of the copyright holder nor the names of its
16+
* contributors may be used to endorse or promote products derived from
17+
* this software without specific prior written permission.
18+
*
19+
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
20+
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING,
21+
* BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
22+
* FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
23+
* HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
24+
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
25+
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
26+
* OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
27+
* WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
28+
* OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
29+
* EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
30+
*/
31+
32+
#include "stri_stringi.h"
33+
#include "stri_callables.h"
34+
35+
36+
const extern R_CallMethodDef stri_callables[] =
37+
{
38+
{"stric_u_hasBinaryProperty", (DL_FUNC)(void (*) (void))(&stric_u_hasBinaryProperty), 0/*unused*/},
39+
{NULL, NULL, 0}
40+
};
41+
42+
43+
int stric_u_hasBinaryProperty(int c, int which)
44+
{
45+
return (int)u_hasBinaryProperty((UChar32)c, (UProperty)which);
46+
}

src/stri_callables.h

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
/* This file is part of the 'stringi' project.
2+
* Copyright (c) 2013-2025, Marek Gagolewski <https://www.gagolewski.com/>
3+
* All rights reserved.
4+
*
5+
* Redistribution and use in source and binary forms, with or without
6+
* modification, are permitted provided that the following conditions are met:
7+
*
8+
* 1. Redistributions of source code must retain the above copyright notice,
9+
* this list of conditions and the following disclaimer.
10+
*
11+
* 2. Redistributions in binary form must reproduce the above copyright notice,
12+
* this list of conditions and the following disclaimer in the documentation
13+
* and/or other materials provided with the distribution.
14+
*
15+
* 3. Neither the name of the copyright holder nor the names of its
16+
* contributors may be used to endorse or promote products derived from
17+
* this software without specific prior written permission.
18+
*
19+
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
20+
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING,
21+
* BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
22+
* FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
23+
* HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
24+
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
25+
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
26+
* OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
27+
* WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
28+
* OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
29+
* EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
30+
*/
31+
32+
#include "stri_stringi.h"
33+
#include <R_ext/Rdynload.h>
34+
35+
36+
37+
// the callables library is defined in stri_callables.cpp
38+
const extern R_CallMethodDef stri_callables[];
39+
40+
41+
/*
42+
Third-party packages can retrieve the following functions from
43+
stringi's shared library via a call to:
44+
45+
#include <R_ext/Rdynload.h>
46+
R_GetCCallable("stringi", "function_name");
47+
48+
If you would like to get access to any additional functions (e.g., from ICU),
49+
feel free to contact the maintainer of stringi.
50+
*/
51+
52+
53+
int stric_u_hasBinaryProperty(int c, int which);

src/stri_cpp.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
stri_brkiter.cpp \
2+
stri_callables.cpp \
23
stri_collator.cpp \
34
stri_common.cpp \
45
stri_compare.cpp \

src/stri_stringi.cpp

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@
3131

3232

3333
#include "stri_stringi.h"
34+
#include "stri_callables.h"
3435
#include <cstring>
3536
#include <cstdlib>
3637
#include <unicode/uclean.h>
@@ -321,6 +322,12 @@ extern "C" void R_init_stringi(DllInfo* dll)
321322
methods++;
322323
}
323324

325+
methods = stri_callables;
326+
while (methods->name) {
327+
R_RegisterCCallable("stringi", methods->name, methods->fun);
328+
methods++;
329+
}
330+
324331
if (!SUPPORT_UTF8) {
325332
/* Rconfig.h states that all R platforms support that */
326333
Rf_error("R does not support UTF-8 encoding.");

0 commit comments

Comments
 (0)