aboutsummaryrefslogtreecommitdiffstats
path: root/common/util.h
diff options
context:
space:
mode:
authorWerner Koch <[email protected]>2003-06-18 19:56:13 +0000
committerWerner Koch <[email protected]>2003-06-18 19:56:13 +0000
commited0d33f1d0ed6ff25a1febe551896b4331bcf8be (patch)
treed5c58ce41044d9e9903c3d7318ccb4e8f970a9c2 /common/util.h
parent* parse-packet.c (parse): Disallow old style partial length for (diff)
downloadgnupg-ed0d33f1d0ed6ff25a1febe551896b4331bcf8be.tar.gz
gnupg-ed0d33f1d0ed6ff25a1febe551896b4331bcf8be.zip
Finished the bulk of changes for gnupg 1.9. This included switching
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.
Diffstat (limited to 'common/util.h')
-rw-r--r--common/util.h27
1 files changed, 25 insertions, 2 deletions
diff --git a/common/util.h b/common/util.h
index c6d2ea7b8..045851481 100644
--- a/common/util.h
+++ b/common/util.h
@@ -35,6 +35,7 @@
#include "../jnlib/mischelp.h"
#include "../jnlib/strlist.h"
#include "../jnlib/dotlock.h"
+#include "../jnlib/utf8conv.h"
/* handy malloc macros - use only them */
#define xtrymalloc(a) gcry_malloc ((a))
@@ -44,12 +45,12 @@
#define xfree(a) gcry_free ((a))
#define xmalloc(a) gcry_xmalloc ((a))
+#define xmalloc_secure(a) gcry_xmalloc_secure ((a))
#define xcalloc(a,b) gcry_xcalloc ((a),(b))
+#define xcalloc_secure(a,b) gcry_xcalloc_secure ((a),(b))
#define xrealloc(a,b) gcry_xrealloc ((a),(b))
#define xstrdup(a) gcry_xstrdup ((a))
-#define seterr(a) (GNUPG_ ## a)
-
/*-- maperror.c --*/
int map_ksba_err (int err);
int map_gcry_err (int err);
@@ -61,6 +62,12 @@ int map_to_assuan_status (int rc);
time_t gnupg_get_time (void);
void gnupg_set_time (time_t newtime, int freeze);
int gnupg_faked_time_p (void);
+u32 make_timestamp (void);
+u32 scan_isodatestr (const char *string);
+u32 add_days_to_timestamp (u32 stamp, u16 days);
+const char *strtimevalue (u32 stamp);
+const char *strtimestamp (u32 stamp); /* GMT */
+const char *asctimestamp (u32 stamp); /* localized */
/*-- signal.c --*/
void gnupg_init_signals (int mode, void (*fast_cleanup)(void));
@@ -68,6 +75,22 @@ void gnupg_pause_on_sigusr (int which);
void gnupg_block_all_signals (void);
void gnupg_unblock_all_signals (void);
+/*-- yesno.c --*/
+int answer_is_yes (const char *s);
+int answer_is_yes_no_default (const char *s, int def_answer);
+int answer_is_yes_no_quit (const char *s);
+
+
+/*-- miscellaneous.c --*/
+const char *print_fname_stdout (const char *s);
+const char *print_fname_stdin (const char *s);
+void print_string (FILE *fp, const byte *p, size_t n, int delim);
+void print_utf8_string2 ( FILE *fp, const byte *p, size_t n, int delim);
+void print_utf8_string (FILE *fp, const byte *p, size_t n);
+char *make_printable_string (const byte *p, size_t n, int delim);
+
+int is_file_compressed (const char *s, int *ret_rc);
+
/*-- replacement functions from funcname.c --*/
#if !HAVE_VASPRINTF