From 53a953568ea594624b28f3a7be7d2c6f64e3264e Mon Sep 17 00:00:00 2001 From: Stefan Bellon Date: Fri, 21 Jun 2002 09:59:39 +0000 Subject: [PATCH] tidied up RISC OS specific stuff --- g10/ChangeLog | 7 +++++++ g10/g10.c | 12 +++--------- g10/gpgv.c | 11 +++-------- include/ChangeLog | 5 +++++ include/util.h | 6 ++++++ scripts/ChangeLog | 5 +++++ scripts/conf-riscos/Makefile | 8 ++++---- util/ChangeLog | 4 ++++ util/riscos.c | 7 +++++++ 9 files changed, 44 insertions(+), 21 deletions(-) diff --git a/g10/ChangeLog b/g10/ChangeLog index 0579504da..21c44df4e 100644 --- a/g10/ChangeLog +++ b/g10/ChangeLog @@ -1,3 +1,10 @@ +2002-06-21 Stefan Bellon + + * g10.c [__riscos__]: Moved RISC OS specific stuff to util/riscos.c + and include/util.h. + + * gpgv.c [__riscos__]: Likewise. + 2002-06-20 David Shaw * keydb.h, pkclist.c (select_algo_from_prefs): Allow passing a diff --git a/g10/g10.c b/g10/g10.c index 33aa164af..b8cae1b1c 100644 --- a/g10/g10.c +++ b/g10/g10.c @@ -28,10 +28,6 @@ #ifdef HAVE_DOSISH_SYSTEM #include /* for setmode() */ #endif -#ifdef __riscos__ -#include -#include -#endif /* __riscos__ */ #define INCLUDED_BY_MAIN_MODULE 1 #include "packet.h" @@ -600,8 +596,7 @@ static void add_notation_data( const char *string, int which ); static void add_policy_url( const char *string, int which ); #ifdef __riscos__ -/* This enables better dynamic memory management on RISC OS */ -const char *__dynamic_da_name = "GnuPG Heap"; +RISCOS_GLOBAL_STATICS("GnuPG Heap") #endif /* __riscos__ */ const char * @@ -872,10 +867,9 @@ main( int argc, char **argv ) #ifdef USE_SHM_COPROCESSING ulong requested_shm_size=0; #endif + #ifdef __riscos__ - /* set global RISC OS specific properties */ - __riscosify_control = __RISCOSIFY_NO_PROCESS; - __feature_imagefs_is_file = 1; + riscos_global_defaults(); opt.lock_once = 1; #endif /* __riscos__ */ diff --git a/g10/gpgv.c b/g10/gpgv.c index ac7b47887..362f5c528 100644 --- a/g10/gpgv.c +++ b/g10/gpgv.c @@ -28,10 +28,6 @@ #ifdef HAVE_DOSISH_SYSTEM #include /* for setmode() */ #endif -#ifdef __riscos__ -#include -#include -#endif /* __riscos__ */ #define INCLUDED_BY_MAIN_MODULE 1 #include "packet.h" @@ -83,8 +79,7 @@ static ARGPARSE_OPTS opts[] = { int g10_errors_seen = 0; #ifdef __riscos__ -/* This enables better dynamic memory management on RISC OS */ -const char *__dynamic_da_name = "GnuPG (gpgv) Heap"; +RISCOS_GLOBAL_STATICS("GnuPG (gpgv) Heap") #endif /* __riscos__ */ const char * @@ -144,9 +139,9 @@ main( int argc, char **argv ) STRLIST sl; STRLIST nrings=NULL; unsigned configlineno; + #ifdef __riscos__ - __riscosify_control = __RISCOSIFY_NO_PROCESS; - __feature_imagefs_is_file = 1; + riscos_global_defaults(); #endif /* __riscos__ */ log_set_name("gpgv"); diff --git a/include/ChangeLog b/include/ChangeLog index 81c7f9cf0..464e339c7 100644 --- a/include/ChangeLog +++ b/include/ChangeLog @@ -1,3 +1,8 @@ +2002-06-21 Stefan Bellon + + * util.h [__riscos__]: Further moving away of RISC OS specific + stuff from general code. + 2002-06-20 Stefan Bellon * util.h [__riscos__]: Added riscos_set_filetype(). diff --git a/include/util.h b/include/util.h index bfc77af91..1d0e4edd5 100644 --- a/include/util.h +++ b/include/util.h @@ -260,6 +260,12 @@ int vasprintf ( char **result, const char *format, va_list args); #ifdef __riscos__ /* needed for strcasecmp() */ #include +/* needed for filename munging */ +#include +/* needed for image file system feature */ +#include +void riscos_global_defaults(); +#define RISCOS_GLOBAL_STATICS(a) const char *__dynamic_da_name = (a); void riscos_set_filetype(const char *filename, const char *mimetype); pid_t riscos_getpid(void); int riscos_kill(pid_t pid, int sig); diff --git a/scripts/ChangeLog b/scripts/ChangeLog index 15304f363..4447ea143 100644 --- a/scripts/ChangeLog +++ b/scripts/ChangeLog @@ -1,3 +1,8 @@ +2002-06-21 Stefan Bellon + + * conf-riscos/Makefile: Changes due to moving around RISC OS + specific stuff in the code. + 2002-06-07 Stefan Bellon * conf-riscos/include/config.h [__riscos__]: Fixed macro bug. diff --git a/scripts/conf-riscos/Makefile b/scripts/conf-riscos/Makefile index da53979ed..3461fa196 100644 --- a/scripts/conf-riscos/Makefile +++ b/scripts/conf-riscos/Makefile @@ -181,7 +181,7 @@ GPGV_OBJS=g10.o.armor \ cipher.o.rsa \ mpi.mpi \ zlib.zlib -GPGKEYS_OBJS=keyserver.o.gpgkeys_ldap \ +GPGKEYS_OBJS=util.o.riscos \ util.o.strgutil \ util.o.memory \ util.o.logger \ @@ -220,8 +220,8 @@ tools.gpgsplit: tools.o.gpgsplit util.util intl.gettext zlib.zlib -squeeze tools.gpgsplit -copy tools.gpgsplit ADFS::A5.$.tmp.!GnuPG.gpgsplit ~CF~V -keyserver.gpgkeys_ldap: $(GPGKEYS_OBJS) $(LIBLDAP).libraries.libldap.libldap - $(LINK) $(LD_FLAGS) $(GPGKEYS_OBJS) $(LIBLDAP).libraries.libldap.libldap -o keyserver.gpgkeys_ldap +keyserver.gpgkeys_ldap: keyserver.o.gpgkeys_ldap $(GPGKEYS_OBJS) $(LIBLDAP).libraries.libldap.libldap + $(LINK) $(LD_FLAGS) keyserver.o.gpgkeys_ldap $(GPGKEYS_OBJS) $(LIBLDAP).libraries.libldap.libldap -o keyserver.gpgkeys_ldap -squeeze keyserver.gpgkeys_ldap -copy keyserver.gpgkeys_ldap ADFS::A5.$.tmp.!GnuPG.gpgkeys_ldap ~CF~V @@ -375,7 +375,7 @@ clean-g10: -ifthere g10.o.* then wipe g10.o.* ~CFR~V clean-keyserver: - -ifthere keyserver.gpgkeys_ldap then wipe keyserver.gpgkeys_ldap ~CFR~V + -ifthere keyserver.gpgkeys_* then wipe keyserver.gpgkeys_* ~CFR~V -ifthere keyserver.o.* then wipe keyserver.o.* ~CFR~V clean-tools: diff --git a/util/ChangeLog b/util/ChangeLog index d4652935c..c01b5e207 100644 --- a/util/ChangeLog +++ b/util/ChangeLog @@ -1,3 +1,7 @@ +2002-06-21 Stefan Bellon + + * riscos.c (riscos_global_defaults): New. + 2002-06-20 Stefan Bellon * riscos.c (riscos_set_filetype_by_number, riscos_set_filetype): diff --git a/util/riscos.c b/util/riscos.c index 41f645f33..e0844a205 100644 --- a/util/riscos.c +++ b/util/riscos.c @@ -95,6 +95,13 @@ riscos_set_filetype_by_number(const char *filename, int type) /* exported RISC OS functions */ +void +riscos_global_defaults() +{ + __riscosify_control = __RISCOSIFY_NO_PROCESS; + __feature_imagefs_is_file = 1; +} + void riscos_set_filetype(const char *filename, const char *mimetype) {