1
0
mirror of git://git.gnupg.org/gnupg.git synced 2025-02-21 19:48:05 +01:00

image file system feature and filetype for RISC OS

This commit is contained in:
Stefan Bellon 2002-06-20 15:43:19 +00:00
parent a4d654c548
commit 4dcd984b28
8 changed files with 64 additions and 0 deletions

View File

@ -1,3 +1,12 @@
2002-06-20 Stefan Bellon <sbellon@sbellon.de>
* g10.c [__riscos__]: Added image file system feature.
* gpgv.c [__riscos__]: Added image file system feature.
* photoid.c (show_photos) [__riscos__]: Set RISC OS filetype of
photo id according to MIME type.
2002-06-19 David Shaw <dshaw@jabberwocky.com>
* hkp.c (parse_hkp_index): Don't leak memory when failing out of a

View File

@ -30,6 +30,7 @@
#endif
#ifdef __riscos__
#include <unixlib/local.h>
#include <unixlib/features.h>
#endif /* __riscos__ */
#define INCLUDED_BY_MAIN_MODULE 1
@ -875,6 +876,7 @@ main( int argc, char **argv )
#ifdef __riscos__
/* set global RISC OS specific properties */
__riscosify_control = __RISCOSIFY_NO_PROCESS;
__feature_imagefs_is_file = 1;
opt.lock_once = 1;
#endif /* __riscos__ */

View File

@ -30,6 +30,7 @@
#endif
#ifdef __riscos__
#include <unixlib/local.h>
#include <unixlib/features.h>
#endif /* __riscos__ */
#define INCLUDED_BY_MAIN_MODULE 1
@ -145,6 +146,7 @@ main( int argc, char **argv )
unsigned configlineno;
#ifdef __riscos__
__riscosify_control = __RISCOSIFY_NO_PROCESS;
__feature_imagefs_is_file = 1;
#endif /* __riscos__ */
log_set_name("gpgv");

View File

@ -273,6 +273,11 @@ void show_photos(const struct user_attribute *attrs,
goto fail;
}
#ifdef __riscos__
riscos_set_filetype(spawn->tempfile_in,
image_type_to_string(args.imagetype,2));
#endif
m_free(name);
fwrite(&attrs[i].data[offset],attrs[i].len-offset,1,spawn->tochild);

View File

@ -1,3 +1,7 @@
2002-06-20 Stefan Bellon <sbellon@sbellon.de>
* util.h [__riscos__]: Added riscos_set_filetype().
2002-06-14 David Shaw <dshaw@jabberwocky.com>
* util.h: Add pop_strlist() from strgutil.c.

View File

@ -260,6 +260,7 @@ int vasprintf ( char **result, const char *format, va_list args);
#ifdef __riscos__
/* needed for strcasecmp() */
#include <strings.h>
void riscos_set_filetype(const char *filename, const char *mimetype);
pid_t riscos_getpid(void);
int riscos_kill(pid_t pid, int sig);
int riscos_access(const char *path, int amode);

View File

@ -1,3 +1,8 @@
2002-06-20 Stefan Bellon <sbellon@sbellon.de>
* riscos.c (riscos_set_filetype_by_number, riscos_set_filetype):
New. Set RISC OS filetype according to MIME type.
2002-06-14 David Shaw <dshaw@jabberwocky.com>
* strgutil.c (pop_strlist): New function to pop the head off of a

View File

@ -38,6 +38,14 @@
#include <unixlib/unix.h>
#undef __UNIXLIB_INTERNALS
/* RISC OS specific defines that are not yet in UnixLib */
#define MimeMap_Translate 0x50B00
#define MMM_TYPE_RISCOS 0
#define MMM_TYPE_RISCOS_STRING 1
#define MMM_TYPE_MIME 2
#define MMM_TYPE_DOT_EXTN 3
/* RISC OS file open descriptor control list */
struct fds_item {
@ -71,9 +79,37 @@ is_read_only(const char *filename)
return 0;
}
static void
riscos_set_filetype_by_number(const char *filename, int type)
{
_kernel_swi_regs r;
r.r[0] = 18;
r.r[1] = (int) filename;
r.r[2] = type;
if (_kernel_swi(OS_File, &r, &r))
log_fatal("Can't set filetype for file %s!\n"
"Is the file on a read-only file system?\n", filename);
}
/* exported RISC OS functions */
void
riscos_set_filetype(const char *filename, const char *mimetype)
{
_kernel_swi_regs r;
r.r[0] = MMM_TYPE_MIME;
r.r[1] = (int) mimetype;
r.r[2] = MMM_TYPE_RISCOS;
if (_kernel_swi(MimeMap_Translate, &r, &r))
log_fatal("Can't translate MIME type %s!\n", mimetype);
riscos_set_filetype_by_number(filename, r.r[3]);
}
pid_t
riscos_getpid(void)
{