Skip to content

Commit dce4082

Browse files
committed
Merge branch 'devel'
2 parents 6b07f02 + be4f9e7 commit dce4082

File tree

278 files changed

+2142
-607
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

278 files changed

+2142
-607
lines changed

CMakeLists.txt

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
#
66

77
cmake_minimum_required(VERSION 3.12)
8-
project(bfdev VERSION 1.0.5 LANGUAGES C)
8+
project(bfdev VERSION 1.0.6 LANGUAGES C)
99

1010
include(GNUInstallDirs)
1111
include(CheckIncludeFiles)
@@ -47,7 +47,7 @@ string(APPEND BFDEV_RELEASE
4747
)
4848

4949
option(BFDEV_DEVEL "Enable development mode" OFF)
50-
option(BFDEV_STRICT "Enable strict compilation" ON)
50+
option(BFDEV_STRICT "Enable strict compilation" OFF)
5151
option(BFDEV_EXAMPLES "Build examples" OFF)
5252
option(BFDEV_TESTSUITE "Build testsuite" OFF)
5353

@@ -66,6 +66,7 @@ option(BFDEV_DEBUG_MEMALLOC "Dynamic debug memalloc" ON)
6666
option(BFDEV_CRC_EXTEND "CRC loop unfolding optimize" ON)
6767

6868
if(BFDEV_DEVEL)
69+
set(BFDEV_STRICT ON)
6970
set(BFDEV_EXAMPLES ON)
7071
set(BFDEV_TESTSUITE ON)
7172
set(BFDEV_ASAN ON)
@@ -141,6 +142,7 @@ if(${CMAKE_PROJECT_NAME} STREQUAL "bfdev")
141142
${PROJECT_SOURCE_DIR}/README.md
142143
${PROJECT_SOURCE_DIR}/AUTHORS
143144
${PROJECT_SOURCE_DIR}/COPYING
145+
${PROJECT_SOURCE_DIR}/COPYING.LIB
144146
DESTINATION ${CMAKE_INSTALL_DOCDIR}
145147
)
146148

COPYING

Lines changed: 14 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
1-
GNU GENERAL PUBLIC LICENSE
2-
Version 2, June 1991
1+
GNU GENERAL PUBLIC LICENSE
2+
Version 2, June 1991
33

4-
Copyright (C) 1989, 1991 Free Software Foundation, Inc.
5-
51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
4+
Copyright (C) 1989, 1991 Free Software Foundation, Inc.,
5+
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
66
Everyone is permitted to copy and distribute verbatim copies
77
of this license document, but changing it is not allowed.
88

9-
Preamble
9+
Preamble
1010

1111
The licenses for most software are designed to take away your
1212
freedom to share and change it. By contrast, the GNU General Public
@@ -15,7 +15,7 @@ software--to make sure the software is free for all its users. This
1515
General Public License applies to most of the Free Software
1616
Foundation's software and to any other program whose authors commit to
1717
using it. (Some other Free Software Foundation software is covered by
18-
the GNU Library General Public License instead.) You can apply it to
18+
the GNU Lesser General Public License instead.) You can apply it to
1919
your programs, too.
2020

2121
When we speak of free software, we are referring to freedom, not
@@ -56,7 +56,7 @@ patent must be licensed for everyone's free use or not licensed at all.
5656
The precise terms and conditions for copying, distribution and
5757
modification follow.
5858

59-
GNU GENERAL PUBLIC LICENSE
59+
GNU GENERAL PUBLIC LICENSE
6060
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
6161

6262
0. This License applies to any program or other work which contains
@@ -255,7 +255,7 @@ make exceptions for this. Our decision will be guided by the two goals
255255
of preserving the free status of all derivatives of our free software and
256256
of promoting the sharing and reuse of software generally.
257257

258-
NO WARRANTY
258+
NO WARRANTY
259259

260260
11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
261261
FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
@@ -277,9 +277,9 @@ YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
277277
PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
278278
POSSIBILITY OF SUCH DAMAGES.
279279

280-
END OF TERMS AND CONDITIONS
280+
END OF TERMS AND CONDITIONS
281281

282-
How to Apply These Terms to Your New Programs
282+
How to Apply These Terms to Your New Programs
283283

284284
If you develop a new program, and you want it to be of the greatest
285285
possible use to the public, the best way to achieve this is to make it
@@ -303,10 +303,9 @@ the "copyright" line and a pointer to where the full notice is found.
303303
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
304304
GNU General Public License for more details.
305305

306-
You should have received a copy of the GNU General Public License
307-
along with this program; if not, write to the Free Software
308-
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
309-
306+
You should have received a copy of the GNU General Public License along
307+
with this program; if not, write to the Free Software Foundation, Inc.,
308+
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
310309

311310
Also add information on how to contact you by electronic and paper mail.
312311

@@ -336,5 +335,5 @@ necessary. Here is a sample; alter the names:
336335
This General Public License does not permit incorporating your program into
337336
proprietary programs. If your program is a subroutine library, you may
338337
consider it more useful to permit linking proprietary applications with the
339-
library. If this is what you want to do, use the GNU Library General
338+
library. If this is what you want to do, use the GNU Lesser General
340339
Public License instead of this License.

COPYING.LIB

Lines changed: 165 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,165 @@
1+
GNU LESSER GENERAL PUBLIC LICENSE
2+
Version 3, 29 June 2007
3+
4+
Copyright (C) 2007 Free Software Foundation, Inc. <https://fsf.org/>
5+
Everyone is permitted to copy and distribute verbatim copies
6+
of this license document, but changing it is not allowed.
7+
8+
9+
This version of the GNU Lesser General Public License incorporates
10+
the terms and conditions of version 3 of the GNU General Public
11+
License, supplemented by the additional permissions listed below.
12+
13+
0. Additional Definitions.
14+
15+
As used herein, "this License" refers to version 3 of the GNU Lesser
16+
General Public License, and the "GNU GPL" refers to version 3 of the GNU
17+
General Public License.
18+
19+
"The Library" refers to a covered work governed by this License,
20+
other than an Application or a Combined Work as defined below.
21+
22+
An "Application" is any work that makes use of an interface provided
23+
by the Library, but which is not otherwise based on the Library.
24+
Defining a subclass of a class defined by the Library is deemed a mode
25+
of using an interface provided by the Library.
26+
27+
A "Combined Work" is a work produced by combining or linking an
28+
Application with the Library. The particular version of the Library
29+
with which the Combined Work was made is also called the "Linked
30+
Version".
31+
32+
The "Minimal Corresponding Source" for a Combined Work means the
33+
Corresponding Source for the Combined Work, excluding any source code
34+
for portions of the Combined Work that, considered in isolation, are
35+
based on the Application, and not on the Linked Version.
36+
37+
The "Corresponding Application Code" for a Combined Work means the
38+
object code and/or source code for the Application, including any data
39+
and utility programs needed for reproducing the Combined Work from the
40+
Application, but excluding the System Libraries of the Combined Work.
41+
42+
1. Exception to Section 3 of the GNU GPL.
43+
44+
You may convey a covered work under sections 3 and 4 of this License
45+
without being bound by section 3 of the GNU GPL.
46+
47+
2. Conveying Modified Versions.
48+
49+
If you modify a copy of the Library, and, in your modifications, a
50+
facility refers to a function or data to be supplied by an Application
51+
that uses the facility (other than as an argument passed when the
52+
facility is invoked), then you may convey a copy of the modified
53+
version:
54+
55+
a) under this License, provided that you make a good faith effort to
56+
ensure that, in the event an Application does not supply the
57+
function or data, the facility still operates, and performs
58+
whatever part of its purpose remains meaningful, or
59+
60+
b) under the GNU GPL, with none of the additional permissions of
61+
this License applicable to that copy.
62+
63+
3. Object Code Incorporating Material from Library Header Files.
64+
65+
The object code form of an Application may incorporate material from
66+
a header file that is part of the Library. You may convey such object
67+
code under terms of your choice, provided that, if the incorporated
68+
material is not limited to numerical parameters, data structure
69+
layouts and accessors, or small macros, inline functions and templates
70+
(ten or fewer lines in length), you do both of the following:
71+
72+
a) Give prominent notice with each copy of the object code that the
73+
Library is used in it and that the Library and its use are
74+
covered by this License.
75+
76+
b) Accompany the object code with a copy of the GNU GPL and this license
77+
document.
78+
79+
4. Combined Works.
80+
81+
You may convey a Combined Work under terms of your choice that,
82+
taken together, effectively do not restrict modification of the
83+
portions of the Library contained in the Combined Work and reverse
84+
engineering for debugging such modifications, if you also do each of
85+
the following:
86+
87+
a) Give prominent notice with each copy of the Combined Work that
88+
the Library is used in it and that the Library and its use are
89+
covered by this License.
90+
91+
b) Accompany the Combined Work with a copy of the GNU GPL and this license
92+
document.
93+
94+
c) For a Combined Work that displays copyright notices during
95+
execution, include the copyright notice for the Library among
96+
these notices, as well as a reference directing the user to the
97+
copies of the GNU GPL and this license document.
98+
99+
d) Do one of the following:
100+
101+
0) Convey the Minimal Corresponding Source under the terms of this
102+
License, and the Corresponding Application Code in a form
103+
suitable for, and under terms that permit, the user to
104+
recombine or relink the Application with a modified version of
105+
the Linked Version to produce a modified Combined Work, in the
106+
manner specified by section 6 of the GNU GPL for conveying
107+
Corresponding Source.
108+
109+
1) Use a suitable shared library mechanism for linking with the
110+
Library. A suitable mechanism is one that (a) uses at run time
111+
a copy of the Library already present on the user's computer
112+
system, and (b) will operate properly with a modified version
113+
of the Library that is interface-compatible with the Linked
114+
Version.
115+
116+
e) Provide Installation Information, but only if you would otherwise
117+
be required to provide such information under section 6 of the
118+
GNU GPL, and only to the extent that such information is
119+
necessary to install and execute a modified version of the
120+
Combined Work produced by recombining or relinking the
121+
Application with a modified version of the Linked Version. (If
122+
you use option 4d0, the Installation Information must accompany
123+
the Minimal Corresponding Source and Corresponding Application
124+
Code. If you use option 4d1, you must provide the Installation
125+
Information in the manner specified by section 6 of the GNU GPL
126+
for conveying Corresponding Source.)
127+
128+
5. Combined Libraries.
129+
130+
You may place library facilities that are a work based on the
131+
Library side by side in a single library together with other library
132+
facilities that are not Applications and are not covered by this
133+
License, and convey such a combined library under terms of your
134+
choice, if you do both of the following:
135+
136+
a) Accompany the combined library with a copy of the same work based
137+
on the Library, uncombined with any other library facilities,
138+
conveyed under the terms of this License.
139+
140+
b) Give prominent notice with the combined library that part of it
141+
is a work based on the Library, and explaining where to find the
142+
accompanying uncombined form of the same work.
143+
144+
6. Revised Versions of the GNU Lesser General Public License.
145+
146+
The Free Software Foundation may publish revised and/or new versions
147+
of the GNU Lesser General Public License from time to time. Such new
148+
versions will be similar in spirit to the present version, but may
149+
differ in detail to address new problems or concerns.
150+
151+
Each version is given a distinguishing version number. If the
152+
Library as you received it specifies that a certain numbered version
153+
of the GNU Lesser General Public License "or any later version"
154+
applies to it, you have the option of following the terms and
155+
conditions either of that published version or of any later version
156+
published by the Free Software Foundation. If the Library as you
157+
received it does not specify a version number of the GNU Lesser
158+
General Public License, you may choose any version of the GNU Lesser
159+
General Public License ever published by the Free Software Foundation.
160+
161+
If the Library as you received it specifies that a proxy can decide
162+
whether future versions of the GNU Lesser General Public License shall
163+
apply, that proxy's public statement of acceptance of any version is
164+
permanent authorization for you to choose that version for the
165+
Library.

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -90,8 +90,8 @@ Quickly start, API manual, see [Bfdev Documentation Tutorial](https://openbfdev.
9090
9191
## License
9292

93-
This is free software: you can redistribute it and/or modify it under the terms of the latest GNU General Public License as published by the Free Software Foundation.
93+
This is free software: you can redistribute it and/or modify it under the terms of the latest GNU Lesser General Public License as published by the Free Software Foundation.
9494

95-
This program 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 General Public License for more details.
95+
This program 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.
9696

97-
You should have received a copy of the GNU General Public License along with this program. If not, see http://www.gnu.org/licenses/.
97+
You should have received a copy of the GNU Lesser General Public License along with this program. If not, see http://www.gnu.org/licenses/.

arch/generic/include/bfdev/asm/bitops.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* SPDX-License-Identifier: GPL-2.0-or-later */
1+
/* SPDX-License-Identifier: LGPL-3.0-or-later */
22
/*
33
* Copyright(c) 2024 John Sanpe <[email protected]>
44
*/
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
/* SPDX-License-Identifier: LGPL-3.0-or-later */
2+
/*
3+
* Copyright(c) 2024 John Sanpe <[email protected]>
4+
*/
5+
6+
#ifndef _BFDEV_ASM_DWORD_H_
7+
#define _BFDEV_ASM_DWORD_H_
8+
9+
#include <bfdev/config.h>
10+
#include <bfdev/asm/bitsperlong.h>
11+
12+
BFDEV_BEGIN_DECLS
13+
14+
#if BFDEV_BITS_PER_LONG == 32
15+
# define __BFDEV_ASM_HAVE_DWORD 1
16+
#else /* BFDEV_BITS_PER_LONG == 64 */
17+
# define __BFDEV_ASM_HAVE_DWORD __SIZEOF_INT128__
18+
#endif
19+
20+
#ifndef BFDEV_ASM_HAVE_DWORD
21+
# define BFDEV_ASM_HAVE_DWORD __BFDEV_ASM_HAVE_DWORD
22+
#endif
23+
24+
BFDEV_END_DECLS
25+
26+
#ifdef BFDEV_ASM_HAVE_DWORD
27+
# include <bfdev/asm-generic/dword-compiler.h>
28+
#endif
29+
30+
#include <bfdev/asm-generic/dword.h>
31+
32+
#endif /* _BFDEV_ASM_DWORD_H_ */

examples/CMakeLists.txt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ add_subdirectory(crc)
1919
add_subdirectory(crypto)
2020
add_subdirectory(fifo)
2121
add_subdirectory(fsm)
22+
add_subdirectory(glob)
2223
add_subdirectory(guards)
2324
add_subdirectory(hashmap)
2425
add_subdirectory(hashtbl)
@@ -29,12 +30,14 @@ add_subdirectory(levenshtein)
2930
add_subdirectory(list)
3031
add_subdirectory(log)
3132
add_subdirectory(log2)
33+
add_subdirectory(math)
3234
add_subdirectory(matrix)
3335
add_subdirectory(mpi)
3436
add_subdirectory(notifier)
3537
add_subdirectory(once)
3638
add_subdirectory(prandom)
3739
add_subdirectory(radix)
40+
add_subdirectory(ratelimit)
3841
add_subdirectory(rbtree)
3942
add_subdirectory(respool)
4043
add_subdirectory(ringbuf)
@@ -43,3 +46,4 @@ add_subdirectory(skiplist)
4346
add_subdirectory(slist)
4447
add_subdirectory(sort)
4548
add_subdirectory(textsearch)
49+
add_subdirectory(tokenbucket)

examples/bloom/simple.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ main(int argc, const char *argv[])
6363
}
6464

6565
bfdev_bloom_flush(bloom);
66-
bfdev_bloom_destory(bloom);
66+
bfdev_bloom_destroy(bloom);
6767

6868
return 0;
6969
}

0 commit comments

Comments
 (0)