aboutsummaryrefslogtreecommitdiffstats
path: root/common/stringhelp.h (unfollow)
Commit message (Collapse)AuthorFilesLines
2019-02-11common: New functions get_option_value and ascii_strupr.Werner Koch1-0/+1
* common/server-help.c (get_option_value): New. * common/stringhelp.c (ascii_strupr): New. -- Signed-off-by: Werner Koch <[email protected]> (cherry picked from commit e2f18023b3b3b7e55b35218f65e37448d1011172) This might come handy when we eventually backport other changes.
2017-07-17common: New function split_fields_colon.Werner Koch1-0/+4
* common/stringhelp.c (split_fields_colon): New. * common/t-stringhelp.c (test_split_fields_colon): New test. (main): Call that test. Signed-off-by: Werner Koch <[email protected]>
2017-04-12common: Simplify format_text.NIIBE Yutaka1-1/+1
* common/stringhelp.c (format_text): Don't allow IN_PLACE formatting. * common/stringhelp.h: Change the API with no IN_PLACE. * common/t-stringhelp.c (test_format_text): Follow the change. * g10/gpgcompose.c (show_help): Likewise. * g10/tofu.c (format_conflict_msg_part1, ask_about_binding) (show_statistics, show_warning): Likewise. Signed-off-by: NIIBE Yutaka <[email protected]>
2017-02-24Clarify text of LGPLv2+/GPLv2+ licensed files.Werner Koch1-2/+2
--
2016-11-05Change all http://www.gnu.org in license notices to https://Werner Koch1-1/+1
--
2016-08-11common: New function string_to_u64.Werner Koch1-0/+2
* common/stringhelp.c (string_to_u64): New. * dirmngr/http.c (longcounter_t): Remove. (struct cookie_s): Change content_length to uint64_t. (parse_response): Use string_to_u64. -- Meanwhile we allow some C99 features including stdint.h. Thus we can simplify things now. Signed-off-by: Werner Koch <[email protected]>
2016-08-10common: New function try_make_printable_string.Werner Koch1-3/+0
* common/stringhelp.c (sanitize_buffer): Remove. Move code to ... * common/miscellaneous.c (try_make_printable_string): new. (make_printable_string): Call try_make_printable_string. Signed-off-by: Werner Koch <[email protected]>
2016-06-11common: New function split_fields.Werner Koch1-0/+4
* common/stringhelp.c (split_fields): New. * common/t-stringhelp.c: Include assert.h. (test_split_fields): New. (main): Call test. Signed-off-by: Werner Koch <[email protected]>
2016-01-08common: New function compare_version_strings.Werner Koch1-0/+3
* common/stringhelp.c (parse_version_number): New. (parse_version_string): New. (compare_version_strings): New. * common/t-stringhelp.c (test_compare_version_strings): New. (main): Call test. Return ERRCOUNT instead of 0. -- The code for that function is based on code from libgcrypt. Similar code is in all GnuPG related libraries this function is a candidates for inclusion in libgpg-error. Signed-off-by: Werner Koch <[email protected]>
2015-11-26common: Fix off-by-one access in the new format_text.Werner Koch1-4/+2
* common/stringhelp.c (format_text): Use existsing fucntion to trim trailing spaces. Fix off-by-one access. Signed-off-by: Werner Koch <[email protected]>
2015-11-23gpg: Reflow long texts.Neal H. Walfield1-0/+5
* common/stringhelp.c (format_text): New function. * common/t-stringhelp.c (stresc): New function. (test_format_text): New function. Test format_text. * g10/tofu.c (get_trust): Use format_text to reflow long texts. (show_statistics): Likewise. -- Signed-off-by: Neal H. Walfield <[email protected]>
2015-11-23common: Extend utf8_charcount to include the string's length.Neal H. Walfield1-1/+1
* common/stringhelp.c (utf8_charcount): Take additional parameter, len. Process at most LEN bytes. -- Signed-off-by: Neal H. Walfield <[email protected]>
2015-07-26Replace GNUPG_GCC_A_ macros by GPGRT_ATTR_ macros.Werner Koch1-6/+6
* common/util.h: Provide replacement for GPGRT_ATTR_ macros when using libgpg-error < 1.20. * common/mischelp.h: Ditto. * common/types.h: Ditto. -- Given that libgpg-error is a dependency of all GnuPG related libraries it is better to define such macros at only one place instead of having similar macros at a lot of places. For now we need repalcement macros, though.
2015-06-22common: Add function strtokenize.Werner Koch1-0/+4
* common/stringhelp.c: Include assert.h. (strtokenize): New. * common/t-stringhelp.c (test_strtokenize): New. Signed-off-by: Werner Koch <[email protected]>
2015-04-24common: Remove JNLIB from boiler plate (jnlib merge).Werner Koch1-6/+6
* common/README.jnlib: Remove. -- This is the final part of merging jnlib into gnupg/common.
2015-03-23common: Add new helper function, strsplit.Neal H. Walfield1-1/+2
* common/stringhelp.h (strsplit): New declaration. * common/stringhelp.c (strsplit): New function. * common/t-stringhelp.c (test_strsplit): New function. (main): Call it here. -- Signed-off-by: Neal H. Walfield <[email protected]>
2015-02-26gpg: Lowercase mailbox for PKA lookups.Werner Koch1-0/+1
* common/stringhelp.c (ascii_strlwr): New. * common/mbox-util.c (mailbox_from_userid): Downcase result. -- Signed-off-by: Werner Koch <[email protected]>
2015-01-28gpg: Fix buffering problem in --list-config.Werner Koch1-10/+0
* g10/gpg.c (list_config): Replace print_sanitized_string2 by es_write_sanitized. * common/stringhelp.c (print_sanitized_buffer2): Remove. (print_sanitized_buffer, print_sanitized_utf8_buffer): Remove. (print_sanitized_utf8_buffer, print_sanitized_utf8_string): Remove. (print_sanitized_string): Remove. * sm/certdump.c (print_dn_part, print_dn_parts): Remove arg FP. (pretty_print_sexp, gpgsm_print_name2, gpgsm_print_name): Remove. -- Mixing stdio and estream is never a good idea. This fix also allows us to remove a lot of garbage. Reported-by: Jason A. Donenfeld <[email protected]> GnuPG-bug-id: 1822 Signed-off-by: Werner Koch <[email protected]>
2014-11-11Remove use of gnulib (part 2)Werner Koch1-0/+3
* configure.ac (strpbrk): Add to AC_CHECK_FUNCS. (gl_EARLY): Remove. * common/stringhelp.c (strpbrk) [!HAVE_STRPBRK]: New. * common/sysutils.c (gnupg_mkdtemp): New. Based on code from glibc-2.6. (gnupg_setenv): Rewrite. (gnupg_unsetenv): Rewrite. * g10/exec.c: Include sysutils.h and replace mkdtemp by gnupg_mkdtemp. * g13/be-encfs.c: Ditto. * g13/mount.c: Ditto. * tools/symcryptrun.c (confucius_mktmpdir): Ditto. Signed-off-by: Werner Koch <[email protected]>
2014-04-22common: Add functions make_absfilename and make_absfilename_try.Werner Koch1-0/+3
* common/stringhelp.c (do_make_filename): Add modes 2 and 3. (make_absfilename): New. (make_absfilename_try): New.
2014-02-26common: New function map_static_macro_string.Werner Koch1-0/+4
* common/mapstrings.c: New. * common/t-mapstrings.c: New. * common/t-support.h (DIM, DIMof): Define if not defined. * common/Makefile.am: Add new files.
2013-02-22common: Add func has_leading_keyword.Werner Koch1-0/+2
* common/stringhelp.c (has_leading_keyword): New.
2013-02-21common: Add func has_leading_keyword.Werner Koch1-0/+2
* common/stringhelp.c (has_leading_keyword): New.
2011-09-30Change JNLIB license to LGPLv3+ or GPLv2+.Werner Koch1-7/+18
This is to allow the use of this code with code under GPLv2(only).
2011-02-04Nuked almost all trailing white space.post-nuke-of-trailing-wsWerner Koch1-1/+1
We better do this once and for all instead of cluttering all future commits with diffs of trailing white spaces. In the majority of cases blank or single lines are affected and thus this change won't disturb a git blame too much. For future commits the pre-commit scripts checks that this won't happen again.
2010-03-10Merged jnlib into common.Werner Koch1-0/+0
2009-08-26Implement tilde expansion in the same was as 1.4.Werner Koch1-2/+2
2009-08-25New fucntions strconcat and xstrconcat.Werner Koch1-1/+10
2008-10-29Check that the socket is well and served by us.Werner Koch1-0/+1
2007-11-19Started to implement the audit log feature.Werner Koch1-1/+4
Pass PINENTRY_USER_DATA and XAUTHORITY to Pinentry. Improved support for the quality bar. Minor internal restructuring. Translation fixes.
2007-07-04Changed to GPLv3.Werner Koch1-4/+2
Removed intl/.
2007-06-19Made percent_escape more general.Werner Koch1-2/+3
Added regression tests support to jnlib. W32 changes.
2007-06-18jnlib/Marcus Brinkmann1-1/+4
2007-06-18 Marcus Brinkmann <[email protected]> * stringhelp.h (percent_escape): New prototype. * stringhelp.c (percent_escape): New function. agent/ 2007-06-18 Marcus Brinkmann <[email protected]> * gpg-agent.c (main): Percent escape pathname in --gpgconf-list output. g10/ 2007-06-18 Marcus Brinkmann <[email protected]> * gpg.c (gpgconf_list): Percent escape output of --gpgconf-list. scdaemon/ 2007-06-18 Marcus Brinkmann <[email protected]> * scdaemon.c (main): Percent escape output of --gpgconf-list. sm/ 2007-06-18 Marcus Brinkmann <[email protected]> * gpgsm.c (main): Percent escape output of --gpgconf-list.
2007-01-25jnlib/Werner Koch1-0/+3
* stringhelp.c (utf8_charcount): New. agent/ * genkey.c (check_passphrase_constraints): Use UTF-8 aware strlen.
2006-10-19FixesWerner Koch1-0/+4
2006-10-02Fix for bug 537Werner Koch1-18/+31
2006-06-20Updated FSF's address.Werner Koch1-1/+2
2006-05-23g10/ does build again.Werner Koch1-0/+6
2006-04-21Still merging 1.4.3 code backWerner Koch1-1/+1
2005-06-16gcc-4 defaults forced me to edit many many files to get rid of theWerner Koch1-5/+4
char * vs. unsigned char * warnings. The GNU coding standards used to say that these mismatches are okay and better than a bunch of casts. Obviously this has changed now.
2004-12-13VArious hacks to make it at least build under W32.Werner Koch1-0/+5
* stringhelp.c (w32_strerror) [W32]: New. * w32-pth.c, w32-pth.h: Added real code written by Timo Schulz. Not finished, though. * gpgconf-comp.c <ignore-ocsp-service-url>: Fixed typo.
2003-06-18Finished the bulk of changes for gnupg 1.9. This included switchingWerner Koch1-1/+7
to libgcrypt functions, using shared error codes from libgpg-error, replacing the old functions we used to have in ../util by those in ../jnlib and ../common, renaming the malloc functions and a couple of types. Note, that not all changes are listed below becuause they are too similar and done at far too many places. As of today the code builds using the current libgcrypt from CVS but it is very unlikely that it actually works.
2003-01-09Updated from NewPGWerner Koch1-0/+84
2002-06-29Removed files for CVS reorganizationDavid Shaw1-60/+0
2000-01-24Add files to new directory.Werner Koch1-0/+60
This is mainly stuff moved from ../util to here.