1
0
Fork 0
mirror of git://git.gnupg.org/gnupg.git synced 2025-07-02 22:46:30 +02:00

RISC OS changes due to dynload removal

This commit is contained in:
Stefan Bellon 2002-08-03 18:35:16 +00:00
parent 85aa3e18c2
commit 582f0d5d98
12 changed files with 66 additions and 67 deletions

View file

@ -1,3 +1,11 @@
2002-08-03 Stefan Bellon <sbellon@sbellon.de>
* idea-stub.c (idea_get_info): RISC OS' Norcroft C needs a cast.
* random.c (getfnc_gather_random): Added RISC OS support.
* rndriscos.c: Removed dynload code.
2002-08-03 Werner Koch <wk@gnupg.org>
* rndegd.c (do_read): Handle case when read returns 0 to avoid

View file

@ -148,6 +148,13 @@ load_module (const char *name)
return NULL;
}
#ifdef __riscos__
typedef
const char *(*INFO_CAST)(int, size_t*, size_t*, size_t*,
int (**)( void *, byte *, unsigned),
void (**)( void *, byte *, byte *),
void (**)( void *, byte *, byte *));
#endif /* __riscos__ */
const char *
idea_get_info( int algo, size_t *keylen,
@ -170,7 +177,11 @@ idea_get_info( int algo, size_t *keylen,
initialized = 1;
for (i=0; (rstr = dynload_enum_module_names (i)); i++)
{
#ifndef __riscos__
info_fnc = load_module (rstr);
#else /* __riscos__ */
info_fnc = (INFO_CAST) load_module (rstr);
#endif /* __riscos__ */
if (info_fnc)
break;
}

View file

@ -140,6 +140,9 @@ getfnc_gather_random (void))(void (*)(const void*, size_t, int), int,
#endif
#ifdef USE_RNDW32
return rndw32_gather_random;
#endif
#ifdef USE_RNDRISCOS
return rndriscos_gather_random;
#endif
return NULL;
}

View file

@ -19,6 +19,9 @@
*/
#include <config.h>
#ifdef USE_RNDRISCOS
#include <stdio.h>
#include <stdlib.h>
#include <errno.h>
@ -26,11 +29,9 @@
#include <kernel.h>
#include <swis.h>
#include "util.h"
#include "dynload.h"
#include "algorithms.h"
static int init_device(void);
static int gather_random(void (*add)(const void*, size_t, int), int requester,
size_t length, int level);
#define CryptRandom_Byte 0x51980
@ -67,9 +68,9 @@ init_device(void)
/****************
*/
static int
gather_random(void (*add)(const void*, size_t, int), int requester,
size_t length, int level)
int
rndriscos_gather_random(void (*add)(const void*, size_t, int), int requester,
size_t length, int level)
{
static int initialized = 0;
int n;
@ -97,51 +98,4 @@ gather_random(void (*add)(const void*, size_t, int), int requester,
return 0; /* success */
}
#ifndef IS_MODULE
static
#endif
const char * const gnupgext_version = "RNDRISCOS ($Revision$)";
static struct {
int class;
int version;
int (*func)(void);
} func_table[] = {
{ 40, 1, (int (*)(void))gather_random },
};
#ifndef IS_MODULE
static
#endif
void *
gnupgext_enum_func( int what, int *sequence, int *class, int *vers )
{
void *ret;
int i = *sequence;
do {
if ( i >= DIM(func_table) || i < 0 ) {
return NULL;
}
*class = func_table[i].class;
*vers = func_table[i].version;
ret = (void*) func_table[i].func;
i++;
} while ( what && what != *class );
*sequence = i;
return ret;
}
#ifndef IS_MODULE
void
rndriscos_constructor(void)
{
register_internal_cipher_extension( gnupgext_version,
gnupgext_enum_func );
}
#endif
#endif /*USE_RNDRISCOS */