Source
...
Target
Commits (2)
......@@ -35,6 +35,10 @@ HDRS =
CMHGAUTOHDR = ${TARGET}
ASMHDRS = ${TARGET}
ASMCHDRS = ${TARGET}
ROMCDEFINES = -DROM
ifeq ("${CMDHELP}","None")
CMHGDEFINES += -DNO_INTERNATIONAL_HELP
endif
include CModule
......
No preview for this file type
/* (0.17)
/* (0.19)
*
* This file is automatically maintained by srccommit, do not edit manually.
* Last processed by srccommit version: 1.1.
*
*/
#define Module_MajorVersion_CMHG 0.17
#define Module_MajorVersion_CMHG 0.19
#define Module_MinorVersion_CMHG
#define Module_Date_CMHG 22 May 2014
#define Module_Date_CMHG 15 Apr 2016
#define Module_MajorVersion "0.17"
#define Module_Version 17
#define Module_MajorVersion "0.19"
#define Module_Version 19
#define Module_MinorVersion ""
#define Module_Date "22 May 2014"
#define Module_Date "15 Apr 2016"
#define Module_ApplicationDate "22-May-14"
#define Module_ApplicationDate "15-Apr-16"
#define Module_ComponentName "MimeMap"
#define Module_ComponentPath "bsd/RiscOS/Sources/Networking/MimeMap"
#define Module_FullVersion "0.17"
#define Module_HelpVersion "0.17 (22 May 2014)"
#define Module_LibraryVersionInfo "0:17"
#define Module_FullVersion "0.19"
#define Module_HelpVersion "0.19 (15 Apr 2016)"
#define Module_LibraryVersionInfo "0:19"
......@@ -33,6 +33,7 @@
#include <ctype.h>
#include "swis.h"
#include "Global/Services.h"
#include "Interface/MimeMap.h"
#include "Interface/HighFSI.h"
......@@ -601,10 +602,20 @@ _kernel_oserror *mime_init(const char *cmd_tail, int podule_base, void *pw)
list_head = list_end = NULL;
last_load = last_exec = 0;
#ifndef ROM
err = _swix(ResourceFS_RegisterFiles, _IN(0), Resources());
if (err != NULL)
{
return err;
}
#endif
err = _swix(MessageTrans_OpenFile, _INR(0,2),
msgs_struct, Module_MessagesFile, 0);
if (err != NULL)
{
#ifndef ROM
_swix(ResourceFS_DeregisterFiles, _IN(0), Resources());
#endif
return err;
}
......@@ -623,6 +634,9 @@ _kernel_oserror *mime_final(int fatal, int podule, void *pw)
mime_free_list_head();
_swix(MessageTrans_CloseFile, _IN(0), msgs_struct);
#ifndef ROM
_swix(ResourceFS_DeregisterFiles, _IN(0), Resources());
#endif
UNUSED(pw);
UNUSED(fatal);
......@@ -683,16 +697,15 @@ _kernel_oserror *mime_cli_handler(const char *arg_string, int argc, int cmd_no,
entry = mime_lookup_by_ftname(strtok(copy, " \t\r\n"), MAPPING_HAS_NO_CHECKS);
}
}
}
if (entry != NULL)
{
/* Got a match for the type deduced */
if (entry != NULL)
{
mime_print_mimeentry_t(entry);
}
else
{
return intl_error(ERR_LOOKUP_FAILED);
}
mime_print_mimeentry_t(entry);
}
else
{
return intl_error(ERR_LOOKUP_FAILED);
}
}
break;
......@@ -721,3 +734,19 @@ _kernel_oserror *mime_swi_handler(int swi_offset, _kernel_swi_regs *r, void *pw)
return NULL;
}
void mime_service(int service_number, _kernel_swi_regs *r, void *pw)
{
switch (service_number)
{
#ifndef ROM
case Service_ResourceFSStarting:
/* Reregister the messages */
(*(void (*)(void *, void *, void *, void *))r->r[2])(Resources(), 0, 0, (void *)r->r[3]);
break;
#endif
}
UNUSED(r);
UNUSED(pw);
}
......@@ -26,6 +26,7 @@
* POSSIBILITY OF SUCH DAMAGE.
*/
#include "VersionNum"
#include "Global/Services.h"
title-string: Module_ComponentName
......@@ -39,6 +40,8 @@ initialisation-code: mime_init
finalisation-code: mime_final
service-call-handler: mime_service Service_ResourceFSStarting
swi-chunk-base-number: 0x50B00
swi-handler-code: mime_swi_handler
......@@ -46,6 +49,21 @@ swi-handler-code: mime_swi_handler
swi-decoding-table: MimeMap,
Translate
#ifdef NO_INTERNATIONAL_HELP
command-keyword-table: mime_cli_handler
MimeMap(min-args:0, max-args:1,
add-syntax:,
help-text: "*MimeMap returns information on the file type specified.\n",
invalid-syntax: "Syntax: *MimeMap [&xxx | .ext | mime/type | Filetype]"),
ReadMimeMap(min-args:0, max-args:0,
add-syntax:,
help-text: "*ReadMimeMap rereads the MIME mappings file.\n",
invalid-syntax: "Syntax: *ReadMimeMap")
#else
command-keyword-table: mime_cli_handler
MimeMap(min-args:0, max-args:1,
international:,
......@@ -56,3 +74,5 @@ command-keyword-table: mime_cli_handler
international:,
help-text: "HRM",
invalid-syntax: "SRM")
#endif
......@@ -35,6 +35,8 @@
#define MAX_LINE 256
#define MAX_EXTS 16 /* More than MAX_EXTS extensions for one type needs a new line */
void *Resources(void); /* From ResGen */
typedef enum
{
MAPPING_HAS_NO_CHECKS = 0,
......