diff options
author | Werner Koch <wk@gnupg.org> | 2014-08-25 13:42:18 +0200 |
---|---|---|
committer | Werner Koch <wk@gnupg.org> | 2014-08-25 16:37:46 +0200 |
commit | 98781deb0b1787fd7eaabee27ef6a06d37195267 (patch) | |
tree | 3aa9bedfca98565e8f8ef434c5ec10173b2b4fab | |
parent | ce31fe792b5f8adf81710c1bf5986cd10636e16b (diff) | |
download | libgpg-error-98781deb0b1787fd7eaabee27ef6a06d37195267.tar.gz |
Remove GnuPG specific code.
* src/estream.c (es_write_sanitized_utf8_buffer): Remove.
-rw-r--r-- | src/estream.c | 48 |
1 files changed, 1 insertions, 47 deletions
diff --git a/src/estream.c b/src/estream.c index 0c54d0f..d34e669 100644 --- a/src/estream.c +++ b/src/estream.c @@ -96,14 +96,9 @@ # include <npth.h> #endif -/* This is for the special hack to use estream.c in GnuPG. */ -#ifdef GNUPG_MAJOR_VERSION -# include "../common/util.h" -#endif - #include "gpgrt-int.h" #include "estream-printf.h" - + #ifndef O_BINARY #define O_BINARY 0 @@ -4433,44 +4428,3 @@ _gpgrt_write_hexstring (estream_t _GPGRT__RESTRICT stream, #undef tohex } - - - -#ifdef GNUPG_MAJOR_VERSION -/* Special estream function to print an UTF8 string in the native - encoding. The interface is the same as es_write_sanitized, however - only one delimiter may be supported. - - THIS IS NOT A STANDARD ESTREAM FUNCTION AND ONLY USED BY GNUPG!. */ -int -es_write_sanitized_utf8_buffer (estream_t stream, - const void *buffer, size_t length, - const char *delimiters, size_t *bytes_written) -{ - const char *p = buffer; - size_t i; - - /* We can handle plain ascii simpler, so check for it first. */ - for (i=0; i < length; i++ ) - { - if ( (p[i] & 0x80) ) - break; - } - if (i < length) - { - int delim = delimiters? *delimiters : 0; - char *buf; - int ret; - - /*(utf8 conversion already does the control character quoting). */ - buf = utf8_to_native (p, length, delim); - if (bytes_written) - *bytes_written = strlen (buf); - ret = es_fputs (buf, stream); - xfree (buf); - return ret == EOF? ret : (int)i; - } - else - return es_write_sanitized (stream, p, length, delimiters, bytes_written); -} -#endif /*GNUPG_MAJOR_VERSION*/ |