aboutsummaryrefslogtreecommitdiffstats
path: root/assuan/assuan-util.c
diff options
context:
space:
mode:
authorMarcus Brinkmann <[email protected]>2006-09-19 14:01:54 +0000
committerMarcus Brinkmann <[email protected]>2006-09-19 14:01:54 +0000
commit9e09d93de83fe1160689acb36b082c02ccb52716 (patch)
tree807126be9dd89fe2850ad748de978de0c5d3b340 /assuan/assuan-util.c
parent2006-07-29 Marcus Brinkmann <[email protected]> (diff)
downloadgpgme-9e09d93de83fe1160689acb36b082c02ccb52716.tar.gz
gpgme-9e09d93de83fe1160689acb36b082c02ccb52716.zip
assuan/
Update to current version. 2006-09-19 Marcus Brinkmann <[email protected]> * configure.ac: Turn stpcpy into a replacement function. Check for unistd.h and add setenv as replacement function. gpgme/ 2006-09-19 Marcus Brinkmann <[email protected]> * setenv.c: New file.
Diffstat (limited to 'assuan/assuan-util.c')
-rw-r--r--assuan/assuan-util.c110
1 files changed, 2 insertions, 108 deletions
diff --git a/assuan/assuan-util.c b/assuan/assuan-util.c
index 2c2f744d..3e627fc5 100644
--- a/assuan/assuan-util.c
+++ b/assuan/assuan-util.c
@@ -15,7 +15,8 @@
*
* You should have received a copy of the GNU Lesser General Public
* License along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
+ * USA.
*/
#include <config.h>
@@ -106,19 +107,6 @@ assuan_get_pointer (assuan_context_t ctx)
void
-assuan_set_log_stream (assuan_context_t ctx, FILE *fp)
-{
- if (ctx)
- {
- if (ctx->log_fp)
- fflush (ctx->log_fp);
- ctx->log_fp = fp;
- _assuan_set_default_log_stream (fp);
- }
-}
-
-
-void
assuan_begin_confidential (assuan_context_t ctx)
{
if (ctx)
@@ -166,97 +154,3 @@ assuan_get_flag (assuan_context_t ctx, assuan_flag_t flag)
}
-/* Dump a possibly binary string (used for debugging). Distinguish
- ascii text from binary and print it accordingly. */
-void
-_assuan_log_print_buffer (FILE *fp, const void *buffer, size_t length)
-{
- const unsigned char *s;
- int n;
-
- for (n=length,s=buffer; n; n--, s++)
- if ((!isascii (*s) || iscntrl (*s) || !isprint (*s)) && !(*s >= 0x80))
- break;
-
- s = buffer;
- if (!n && *s != '[')
- fwrite (buffer, length, 1, fp);
- else
- {
-#ifdef HAVE_FLOCKFILE
- flockfile (fp);
-#endif
- putc_unlocked ('[', fp);
- for (n=0; n < length; n++, s++)
- fprintf (fp, " %02x", *s);
- putc_unlocked (' ', fp);
- putc_unlocked (']', fp);
-#ifdef HAVE_FUNLOCKFILE
- funlockfile (fp);
-#endif
- }
-}
-
-/* Log a user supplied string. Escapes non-printable before
- printing. */
-void
-_assuan_log_sanitized_string (const char *string)
-{
- const unsigned char *s = (const unsigned char *) string;
- FILE *fp = assuan_get_assuan_log_stream ();
-
- if (! *s)
- return;
-
-#ifdef HAVE_FLOCKFILE
- flockfile (fp);
-#endif
-
- for (; *s; s++)
- {
- int c = 0;
-
- switch (*s)
- {
- case '\r':
- c = 'r';
- break;
-
- case '\n':
- c = 'n';
- break;
-
- case '\f':
- c = 'f';
- break;
-
- case '\v':
- c = 'v';
- break;
-
- case '\b':
- c = 'b';
- break;
-
- default:
- if ((isascii (*s) && isprint (*s)) || (*s >= 0x80))
- putc_unlocked (*s, fp);
- else
- {
- putc_unlocked ('\\', fp);
- fprintf (fp, "x%02x", *s);
- }
- }
-
- if (c)
- {
- putc_unlocked ('\\', fp);
- putc_unlocked (c, fp);
- }
- }
-
-#ifdef HAVE_FUNLOCKFILE
- funlockfile (fp);
-#endif
-}
-