summaryrefslogtreecommitdiff
path: root/doc
diff options
context:
space:
mode:
Diffstat (limited to 'doc')
-rw-r--r--doc/api.txt6
-rw-r--r--doc/changelog.txt11
-rwxr-xr-xdoc/generate15
-rw-r--r--doc/libHX_Documentation.lyx164
-rw-r--r--doc/libHX_Documentation.pdfbin507850 -> 522656 bytes
5 files changed, 62 insertions, 134 deletions
diff --git a/doc/api.txt b/doc/api.txt
index eb3b06b..4649515 100644
--- a/doc/api.txt
+++ b/doc/api.txt
@@ -15,6 +15,8 @@ F column: Function first seen in version, possibly with different API.
RMV MinVer FirstA Name
----------------------------------------------------------------------
+3.25 3.25 3.25 HX_split_fixed
+3.25 3.25 3.25 HX_split_inplace
3.22 3.22 3.22 HXQUOTE_SQLBQUOTE
3.21 3.21 3.21 xml_getnsprop
3.19 3.19 3.19 HXQUOTE_SQLSQUOTE
@@ -24,7 +26,6 @@ RMV MinVer FirstA Name
3.16 3.16 3.16 container_of
3.16 3.16 3.16 wxCDF
3.16 3.16 3.16 wxDSPAN
-3.15 3.15 3.15 FIELD_SIZEOF
3.15 3.15 3.15 HXQUOTE_URIENC
3.15 3.15 3.15 HX_strchr2
3.13 3.13 3.13 DEMOTE_TO_PTR
@@ -116,8 +117,6 @@ RMV MinVer FirstA Name
3.0 3.0 3.0 HXMAPT_RBTREE
3.0 3.0 3.0 HXMAP_DTRAV
3.0 3.0 3.0 HXMAP_NOREPLACE
-3.0 3.0 3.0 HX_diff_timespec
-3.0 3.0 3.0 HX_diff_timeval
3.0 3.0 3.0 HXhash_djb2
3.0 3.0 3.0 HXhash_jlookup3
3.0 3.0 3.0 HXhash_jlookup3s
@@ -145,7 +144,6 @@ RMV MinVer FirstA Name
2.6 2.6 2.6 wxfv8
2.6 2.6 2.6 wxtu8
2.6 2.6 2.6 xml_strcasecmp
-2.3 2.0 2.0 offsetof
2.3 1.25 1.25 HXmc_length
2.2 2.2 2.2 HXPROC_A0
2.2 2.2 2.2 HXPROC_EXECV
diff --git a/doc/changelog.txt b/doc/changelog.txt
index 9aff713..ffe75c1 100644
--- a/doc/changelog.txt
+++ b/doc/changelog.txt
@@ -1,4 +1,15 @@
+v3.25 (2020-05-14)
+==================
+Fixes:
+* string: fix out-of-bounds access when calling HX_strlcpy(x,y,0)
+Changes:
+* string: HX_split4 renamed to HX_split_inplace
+* string: HX_split5 renamed to HX_split_fixed
+* defs.h: removed partially implementation of FIELD_SIZEOF
+* defs.h: removed custom offsetof definition; you will need to include
+ <stddef.h> or <cstddef> now.
+
v3.24 (2018-10-17)
==================
diff --git a/doc/generate b/doc/generate
index ed3b8aa..3fd48cf 100755
--- a/doc/generate
+++ b/doc/generate
@@ -3,4 +3,17 @@
if [ -z "$srcdir" ]; then
srcdir=".";
fi;
-exec lyx -e pdf2 "$srcdir/libHX_Documentation.lyx";
+rm -f libHX_Documentation.pdf
+lyx -e pdf2 "$srcdir/libHX_Documentation.lyx" || :
+# lyx-2.3.2 does not work with texlive-babel-2017.135.3
+# """
+# Package babel Error: You haven't specified a language option.
+# ...ry to proceed from here, type x to quit.)
+#
+# You need to specify a language, either as a global option
+# or as an optional argument to the \usepackage command;
+# You shouldn't try to proceed form here, type x to quit.
+# """
+# babel you so stupid for breaking backward comapt.
+
+test -e libHX_Documentation.pdf
diff --git a/doc/libHX_Documentation.lyx b/doc/libHX_Documentation.lyx
index a28f1c6..9e2e9f5 100644
--- a/doc/libHX_Documentation.lyx
+++ b/doc/libHX_Documentation.lyx
@@ -91,7 +91,7 @@
\begin_body
\begin_layout Title
-libHX 3.24
+libHX 3.25
\begin_inset Newline newline
\end_inset
@@ -2620,26 +2620,6 @@ Locators
\end_layout
\begin_layout LyX-Code
-
-\series bold
-long
-\series default
- offsetof(type, member);
-\begin_inset Index idx
-status open
-
-\begin_layout Plain Layout
-
-\family typewriter
-offsetof
-\end_layout
-
-\end_inset
-
-
-\begin_inset Newline newline
-\end_inset
-
output_type
\series bold
*
@@ -2668,14 +2648,14 @@ containerof
\series bold
size_t
\series default
- FIELD_SIZEOF(struct_type, member);
+ HXsizeof_member(struct_type, member);
\begin_inset Index idx
status open
\begin_layout Plain Layout
\family typewriter
-FIELD_SIZEOF
+HXsizeof_member
\end_layout
\end_inset
@@ -2700,55 +2680,6 @@ HXtypeof_member
\end_layout
\begin_layout Standard
-In case
-\family typewriter
-offsetof
-\family default
- and
-\family typewriter
-containerof
-\family default
- have not already defined by inclusion of another header file, libHX's defs.h
- will define these accessors.
-
-\family typewriter
-offsetof
-\family default
- is defined in
-\family typewriter
-stddef.h
-\family default
- (for C) or
-\family typewriter
-cstddef
-\family default
- (C++), but inclusion of these is not necessary if you have included
-\family typewriter
-defs.h
-\family default
-.
-
-\family typewriter
-defs.h
-\family default
- will use GCC's
-\family typewriter
-__builtin_\SpecialChar softhyphen
-offsetof
-\family default
- if available, which does some extra sanity checks in C++ mode.
-\end_layout
-
-\begin_layout Standard
-
-\family typewriter
-offsetof
-\family default
- calculates the offset of the specified member in the type, which needs
- to be a struct or union.
-\end_layout
-
-\begin_layout Standard
\family typewriter
containerof
@@ -2831,30 +2762,14 @@ struct
\begin_layout Standard
\family typewriter
-FIELD_SIZEOF
-\family default
- (formerly
-\family typewriter
HXsizeof_member
\family default
-
-\begin_inset Index idx
-status open
-
-\begin_layout Plain Layout
-
-\family typewriter
-HXsizeof_member
-\end_layout
-
-\end_inset
-
-) and
+ and
\family typewriter
HXtypeof_member
\family default
- are convenient shortcuts to get the size or type of a named member in a
- given struct:
+ are shortcuts (mainly for the C language) to get the size or type of a
+ named member in a given struct:
\end_layout
\begin_layout LyX-Code
@@ -2869,6 +2784,18 @@ struct
foo, baz)];
\end_layout
+\begin_layout Standard
+In C++, one can simply use
+\family typewriter
+sizeof(foo::baz)
+\family default
+ and
+\family typewriter
+decltype(foo::baz)
+\family default
+.
+\end_layout
+
\begin_layout Subsection
Array size
\end_layout
@@ -12252,7 +12179,7 @@ HX_split
\series bold
char **
\series default
-HX_split4(
+HX_split_inplace(
\series bold
char *
\series default
@@ -12277,7 +12204,7 @@ status open
\family typewriter
\size normal
\color none
-HX_split4
+HX_split_inplace
\end_layout
\end_inset
@@ -12290,7 +12217,7 @@ HX_split4
\series bold
int
\series default
- HX_split5(
+ HX_split_fixed(
\series bold
char *
\series default
@@ -12306,7 +12233,7 @@ int
\series bold
char **
\series default
-stack);
+arr);
\begin_inset Index idx
status open
@@ -12315,7 +12242,7 @@ status open
\family typewriter
\size normal
\color none
-HX_split5
+HX_split_fixed
\end_layout
\end_inset
@@ -12456,7 +12383,7 @@ s
\begin_layout Description
\family typewriter
-HX_split4
+HX_split_inplace
\family default
Split the string
\family typewriter
@@ -12499,7 +12426,7 @@ HX_split
\begin_layout Description
\family typewriter
-HX_split5
+HX_split_fixed
\family default
Split the string
\family typewriter
@@ -12521,7 +12448,7 @@ delimiters
The array for the substring pointers must be provided by the user through
the
\family typewriter
-stack
+arr
\family default
argument.
@@ -13195,10 +13122,10 @@ Examples
\end_layout
\begin_layout Subsubsection
-Using HX_split5
+Using HX_split_fixed
\begin_inset CommandInset label
LatexCommand label
-name "subsec:string-ex-HX_split5"
+name "subsec:string-ex-HX_split_fixed"
\end_inset
@@ -13208,31 +13135,10 @@ name "subsec:string-ex-HX_split5"
\begin_layout Standard
\family typewriter
-HX_split5
-\family default
-, where the
-\begin_inset Quotes eld
-\end_inset
-
-5
-\begin_inset Quotes erd
-\end_inset
-
- should be interpreted (with a bit of imagination and the knowledge of leetspeak
-) as an
-\begin_inset Quotes eld
-\end_inset
-
-S
-\begin_inset Quotes erd
-\end_inset
-
- for stack, as
-\family typewriter
-HX_split5
+HX_split_fixed
\family default
- is often used only with on-stack variables and where the field count of
- interest is fixed, as the example for parsing
+ is often used just with scoped automatic-storage variables and where the
+ field count of interest is fixed, as the example for parsing
\family typewriter
/etc/passwd
\family default
@@ -13292,7 +13198,7 @@ while
\series bold
if
\series default
- (HX_split5(line, ":", ARRAY_SIZE(field), field) < 7) {
+ (HX_split_fixed(line, ":", ARRAY_SIZE(field), field) < 7) {
\begin_inset Newline newline
\end_inset
@@ -13324,14 +13230,14 @@ n", field[0]);
\end_layout
\begin_layout Subsubsection
-Using HX_split4
+Using HX_split_inplace
\end_layout
\begin_layout Standard
Where the number of fields is not previously known and/or estimatable, but
the string can be modified in place, one uses
\family typewriter
-HX_split4
+HX_split_inplace
\family default
as follows:
\end_layout
@@ -13377,7 +13283,7 @@ while
\series bold
char **
\series default
-field = HX_split4(line, ":", NULL, 0);
+field = HX_split_inplace(line, ":", NULL, 0);
\begin_inset Newline newline
\end_inset
diff --git a/doc/libHX_Documentation.pdf b/doc/libHX_Documentation.pdf
index 1e9db69..673a851 100644
--- a/doc/libHX_Documentation.pdf
+++ b/doc/libHX_Documentation.pdf
Binary files differ