aboutsummaryrefslogtreecommitdiffstats
path: root/include/util.h
diff options
context:
space:
mode:
authorWerner Koch <[email protected]>1999-12-08 21:03:03 +0000
committerWerner Koch <[email protected]>1999-12-08 21:03:03 +0000
commit4555c0be941cef55486b7a1644d9b70f4ea50c77 (patch)
tree1a10627bf31163f9aef5040724c53f75e8daf3e6 /include/util.h
parentSee ChangeLog: Fri Nov 19 17:15:20 CET 1999 Werner Koch (diff)
downloadgnupg-4555c0be941cef55486b7a1644d9b70f4ea50c77.tar.gz
gnupg-4555c0be941cef55486b7a1644d9b70f4ea50c77.zip
See ChangeLog: Wed Dec 8 21:58:32 CET 1999 Werner Koch
Diffstat (limited to 'include/util.h')
-rw-r--r--include/util.h74
1 files changed, 5 insertions, 69 deletions
diff --git a/include/util.h b/include/util.h
index cf656f625..190bff6ff 100644
--- a/include/util.h
+++ b/include/util.h
@@ -24,42 +24,13 @@
#error This header should not be used internally by libgcrypt
#endif
+#include <stdio.h>
#include "types.h"
#include "errors.h"
-#include "types.h"
-#include "mpi.h"
-
-
-typedef struct {
- int *argc; /* pointer to argc (value subject to change) */
- char ***argv; /* pointer to argv (value subject to change) */
- unsigned flags; /* Global flags (DO NOT CHANGE) */
- int err; /* print error about last option */
- /* 1 = warning, 2 = abort */
- int r_opt; /* return option */
- int r_type; /* type of return value (0 = no argument found)*/
- union {
- int ret_int;
- long ret_long;
- ulong ret_ulong;
- char *ret_str;
- } r; /* Return values */
- struct {
- int idx;
- int inarg;
- int stopped;
- const char *last;
- void *aliases;
- const void *cur_alias;
- } internal; /* DO NOT CHANGE */
-} ARGPARSE_ARGS;
-
-typedef struct {
- int short_opt;
- const char *long_opt;
- unsigned flags;
- const char *description; /* optional option description */
-} ARGPARSE_OPTS;
+#include "../util/mischelp.h"
+#include "../util/stringhelp.h"
+#include "../util/argparse.h"
+
/*-- logger.c --*/
void log_set_logfile( const char *name, int fd );
@@ -119,14 +90,6 @@ void g10_log_hexdump( const char *text, const char *buf, size_t len );
/*-- errors.c --*/
const char * g10_errstr( int no );
-/*-- argparse.c --*/
-int arg_parse( ARGPARSE_ARGS *arg, ARGPARSE_OPTS *opts);
-int optfile_parse( FILE *fp, const char *filename, unsigned *lineno,
- ARGPARSE_ARGS *arg, ARGPARSE_OPTS *opts);
-void usage( int level );
-const char *strusage( int level );
-void set_strusage( const char *(*f)( int ) );
-
/*-- dotlock.c --*/
struct dotlock_handle;
@@ -168,11 +131,6 @@ STRLIST append_to_strlist( STRLIST *list, const char *string );
STRLIST append_to_strlist2( STRLIST *list, const char *string, int is_utf8 );
STRLIST strlist_prev( STRLIST head, STRLIST node );
STRLIST strlist_last( STRLIST node );
-const char *memistr( const char *buf, size_t buflen, const char *sub );
-char *mem2str( char *, const void *, size_t);
-char *trim_spaces( char *string );
-unsigned trim_trailing_chars( byte *line, unsigned len, const char *trimchars);
-unsigned trim_trailing_ws( byte *line, unsigned len );
int string_count_chr( const char *string, int c );
int set_native_charset( const char *newset );
const char* get_native_charset(void);
@@ -180,24 +138,6 @@ char *native_to_utf8( const char *string );
char *utf8_to_native( const char *string, size_t length );
int check_utf8_string( const char *string );
-#ifndef HAVE_MEMICMP
-int memicmp( const char *a, const char *b, size_t n );
-#endif
-#ifndef HAVE_STPCPY
-char *stpcpy(char *a,const char *b);
-#endif
-#ifndef HAVE_STRLWR
-char *strlwr(char *a);
-#endif
-#ifndef HAVE_STRTOUL
- #define strtoul(a,b,c) ((unsigned long)strtol((a),(b),(c)))
-#endif
-#ifndef HAVE_MEMMOVE
- #define memmove(d, s, n) bcopy((s), (d), (n))
-#endif
-#ifndef HAVE_STRICMP
- #define stricmp(a,b) strcasecmp( (a), (b) )
-#endif
/**** other missing stuff ****/
#ifndef HAVE_ATEXIT /* For SunOS */
@@ -209,10 +149,6 @@ char *strlwr(char *a);
#endif
/******** some macros ************/
-#ifndef STR
- #define STR(v) #v
-#endif
-#define STR2(v) STR(v)
#define DIM(v) (sizeof(v)/sizeof((v)[0]))
#define DIMof(type,member) DIM(((type *)0)->member)