<feed xmlns='http://www.w3.org/2005/Atom'>
<title>libgpg-error/src/stringutils.c, branch gniib/t8065</title>
<subtitle>Error codes used by GnuPG et al.</subtitle>
<id>http://git.bktus.com/gpgfrontend/libgpg-error/atom?h=gniib%2Ft8065</id>
<link rel='self' href='http://git.bktus.com/gpgfrontend/libgpg-error/atom?h=gniib%2Ft8065'/>
<link rel='alternate' type='text/html' href='http://git.bktus.com/gpgfrontend/libgpg-error/'/>
<updated>2025-12-09T11:12:30Z</updated>
<entry>
<title>argparse: gpgrt_fconcat to get the SYSCONFDIR.</title>
<updated>2025-12-09T11:12:30Z</updated>
<author>
<name>Werner Koch</name>
<email>wk@gnupg.org</email>
</author>
<published>2025-12-09T11:06:35Z</published>
<link rel='alternate' type='text/html' href='http://git.bktus.com/gpgfrontend/libgpg-error/commit/?id=6fe7cf710254d78ada27fbf63747ab0e97bc6979'/>
<id>urn:sha1:6fe7cf710254d78ada27fbf63747ab0e97bc6979</id>
<content type='text'>
* src/stringutils.c (_gpgrt_fconcat): New internal function.
* src/argparse.c (_gpgrt_argparser): Use it.
--

This fixes the conf files default also for Windows.

Updates-commmit: a9fc729253eec88f56d810bd2a8edd327267c5b4
GnuPG-bug-id: 7894
</content>
</entry>
<entry>
<title>New function gpgrt_fconcat.</title>
<updated>2025-12-09T10:46:22Z</updated>
<author>
<name>Werner Koch</name>
<email>wk@gnupg.org</email>
</author>
<published>2025-12-09T10:46:22Z</published>
<link rel='alternate' type='text/html' href='http://git.bktus.com/gpgfrontend/libgpg-error/commit/?id=34dba88757fedb61d1ea63616a3e03837ccf50ab'/>
<id>urn:sha1:34dba88757fedb61d1ea63616a3e03837ccf50ab</id>
<content type='text'>
* src/w32-utils.c: New.
* src/init.c (_gpg_err_init, DllMain): Call new init function.
* src/visibility.c (gpgrt_fconcat): New.
* src/gpg-error.h.in (gpgrt_fconcat): New prototype.
(GPGRT_FCONCAT_ABS): New.
(GPGRT_FCONCAT_TILDE): New.
(GPGRT_FCONCAT_SYSCONF): New.
* src/gpg-error.def.in (gpgrt_fconcat): New.
* src/gpg-error.vers: (gpgrt_fconcat): New.
* src/stringutils.c (_gpgrt_vfnameconcat): Repalce want-abs but a new
flags arg.  Change to support GPGRT_FCONCAT_SYSCONF.  Fix tilde
expansion under Windows to use CISDL_PROFILE instead of $HOME.  Adjust
all callers.

* src/gpg-error.c (main): New command "fconcat".
--

This function allows to get the sysconfig directory in a portable way.
On Windows this is CISDL_COMMON_APPDATA\GNU\etc.  On Unix this is the
directory specified at the configure run.

This patch also changes the behaviour of tilde expansion in Windows
which was not well defined.  It does now use CISDL_PROFILE instead of
the HOME envvar which is uncommon under Windows.  Note that under
Windows "~user/foo" is still not defined.  Tilde expansion is not done
when GPGRT_FCONCAT_SYSCONF is used.

GnuPG-bug-id: 7894
</content>
</entry>
<entry>
<title>New public API gpgrt_strlist_*</title>
<updated>2025-04-01T08:26:30Z</updated>
<author>
<name>Werner Koch</name>
<email>wk@gnupg.org</email>
</author>
<published>2025-04-01T08:26:30Z</published>
<link rel='alternate' type='text/html' href='http://git.bktus.com/gpgfrontend/libgpg-error/commit/?id=47097806f13d93daffb73b4221f3f18a99f66b2b'/>
<id>urn:sha1:47097806f13d93daffb73b4221f3f18a99f66b2b</id>
<content type='text'>
* src/strlist.c: Rename all functions to have a _gpgrt_strlist prefix.
(append_to_strlist2, strlist_length): Remove.
(_gpgrt_strlist_free): rtake care of the wipe flag.
(_gpgrt_strlist_add): Add a flags arg to use it for prepend and
append.  Return an error on failure.
(_gpgrt_strlist_tokenize): Ditto.
(_gpgrt_strlist_copy): Chnage to return an error on failure.
(_gpgrt_strlist_pop): Ditto.
* src/Makefile.am (libgpg_error_la_SOURCES): Add strlist.c.
* src/argparse.c (trim_spaces): Move to ...
* src/stringutils.c (_gpgrt_trim_spaces): here and rename.
* src/visibility.c: Add wrappers for all exported functions.
* src/visibility.h: MArk exported functions as visisble.
* src/gpg-error.def.in: Export new functions
* src/gpg-error.vers: Ditto.
* src/gpg-error.h.in (GPGRT_STRLIST_APPEND): New.
(GPGRT_STRLIST_WIPE): New.
(gpgrt_strlist_free): New.
(gpgrt_strlist_add): New.
(gpgrt_strlist_tokenize): New.
(gpgrt_strlist_copy): New.
(gpgrt_strlist_rev): New.
(gpgrt_strlist_prev): New.
(gpgrt_strlist_last): New.
(gpgrt_strlist_pop): New.
(gpgrt_strlist_find): New.
(gpgrt_strlist_count): New inline function.
--

This is a modified set of function as used by gpg for ages. These are
quite useful functions and will be needed internally for some other
planned features.  The idea is to make their counterparts in gnupg
wrapper around those new functions.

After we have moved the secure memory stuff from Libgcrypt to here we
can also implement a GPGRT_STRLICT_SECMEM flag to allow allocating
strings here ion secure memory.  For now we only have the WIPE flag
which wipes the memory on free.
</content>
</entry>
<entry>
<title>core: Minor clean up.</title>
<updated>2021-08-05T02:39:53Z</updated>
<author>
<name>NIIBE Yutaka</name>
<email>gniibe@fsij.org</email>
</author>
<published>2021-08-05T02:39:53Z</published>
<link rel='alternate' type='text/html' href='http://git.bktus.com/gpgfrontend/libgpg-error/commit/?id=b82b0d7a8d8f69aec928a2c604c1260b34a08449'/>
<id>urn:sha1:b82b0d7a8d8f69aec928a2c604c1260b34a08449</id>
<content type='text'>
* src/stringutils.c: Remove inclusion of pwd.h.

Signed-off-by: NIIBE Yutaka &lt;gniibe@fsij.org&gt;
</content>
</entry>
<entry>
<title>w32: Support utf8 also for getcwd.</title>
<updated>2020-10-09T13:36:51Z</updated>
<author>
<name>Werner Koch</name>
<email>wk@gnupg.org</email>
</author>
<published>2020-10-09T13:36:51Z</published>
<link rel='alternate' type='text/html' href='http://git.bktus.com/gpgfrontend/libgpg-error/commit/?id=dbedf190969de1a796560cfa15fb4ea986bc79dc'/>
<id>urn:sha1:dbedf190969de1a796560cfa15fb4ea986bc79dc</id>
<content type='text'>
* src/sysutils.c (_gpgrt_getcwd) [W32]: Implement utf-8 support.
* src/w32-gettext.c (wchar_to_native): Factor some code out to ..
(wchar_to_cp): new.
(_gpgrt_wchar_to_utf8): New.
* tests/t-stringutils.c: Include windows.h.
(utf8_to_wchar): New.
(wchar_to_utf8): New.
(mygetcwd): Use wchar version for Windows.
(main): New option --pwd.
</content>
</entry>
<entry>
<title>core: Add gpgrt_fnameconcat and gpgrt_absfnameconcat.</title>
<updated>2020-02-18T07:56:33Z</updated>
<author>
<name>Werner Koch</name>
<email>wk@gnupg.org</email>
</author>
<published>2020-02-18T07:53:30Z</published>
<link rel='alternate' type='text/html' href='http://git.bktus.com/gpgfrontend/libgpg-error/commit/?id=5742b8eaf3fa9cda3dfb6b3ad0fea7485fff1a12'/>
<id>urn:sha1:5742b8eaf3fa9cda3dfb6b3ad0fea7485fff1a12</id>
<content type='text'>
* src/gpg-error.h.in (gpgrt_fnameconcat): New.
(gpgrt_absfnameconcat): New.
* src/visibility.c (gpgrt_fnameconcat, gpgrt_absfnameconcat): New.
* src/stringutils.c: New file.
(_gpgrt_vfnameconcat): New.
(_gpgrt_fnameconcat, _gpgrt_absfnameconcat): New.
* src/gpg-error.def.in: Add new functions.
* src/gpg-error.vers: Ditto.
* src/sysutils.c: Include pwd.h.
(_gpgrt_getpwdir): New.
* configure.ac: Test for pwd.h, getpwnam, getpwuid, and their _r
variants.
* src/Makefile.am (libgpg_error_la_SOURCES): Add new file.

* tests/t-stringutils.c: New.
* tests/t-common.h (xmalloc, xstrdup, xfree): New.
(die): Kludge to avoid compiler warnings.
--

The new functions are based on the code of make_filename from GnuPG.
They have been written by me ages ago with only minor modifications by
David Shaw.  I re-license them from LGPL-3.0+ OR GPL-2.0+ to
LGPL-2.1-or-later.

Signed-off-by: Werner Koch &lt;wk@gnupg.org&gt;
</content>
</entry>
</feed>
