Filetype setting patch

Nick Burrett nick at dsvr.net
Fri Aug 16 08:11:45 PDT 2002


Peter Naulls wrote:

> Index: unixlib/source/common/riscosify.c
> ===================================================================
> RCS file: /usr/local/cvsroot/gccsdk/unixlib/source/common/riscosify.c,v
> retrieving revision 1.2.2.2
> diff -u -r1.2.2.2 riscosify.c
> --- unixlib/source/common/riscosify.c   4 Sep 2001 16:32:04 -0000       1.2.2.2
> +++ unixlib/source/common/riscosify.c   7 Aug 2002 21:52:30 -0000
> @@ -932,6 +932,25 @@
>           next = *++in0;
>         }
>  
> +      /* Use MimeMap to find a filetype to match the filename
> +         extension.  e.g.  file.html -> 0xfaf */
> +      if ((flags & __RISCOSIFY_FILETYPE_SET) &&
> +          filetype != NULL && last_dot != NULL)
> +        {
> +           _kernel_swi_regs regs;
> +
> +          regs.r[0] = MMM_TYPE_DOT_EXTN; /* Input extension */
> +          regs.r[1] = (int)last_dot;
> +          regs.r[2] = MMM_TYPE_RISCOS; /* Output filetype */
> +
> +          if (_kernel_swi(MimeMap_Translate, &regs, &regs)) {
> +            /* Default to text if there's an error */
> +            *filetype = 0xFFF;
> +          } else {
> +            *filetype = regs.r[3];
> +          }
> +        }
> +
>        /* Check if we have "blabla,xyz" as filename where `xyz' is a
>           valid 12 bit hex number.  Only perform the check if
>           __RISCOSIFY_FILETYPE_EXT is set and xyz != 0xfff.  However

This patch is missing definitions of MMM_TYPE_DOT_EXTN and MMM_TYPE_RISCOS.

Regards,


Nick


-- 
Nick Burrett
Development Manager, Designer Servers Ltd.   http://www.dsvr.co.uk




More information about the gcc mailing list