Xlate 3.06 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33
/* Copyright 1998 Acorn Computers Ltd
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
/*
*  Lan Manager client
*
*  Xlate.H --  DOS to RISCOS name & attrib mapping header
*
*  Versions
*  08-03-94 INH Original
*
*/

/* Some general functions */
extern int stricmp ( const char *s1, const char *s2 );
extern void strcpyn ( char *d, const char *s, int n );
extern void strcpyn_upper ( char *d, const char *s, int n );
extern void strcpyn_lower ( char *d, const char *s, int n );

extern void Xlt_Jumble ( char *str );
extern void Xlt_Unjumble ( char *str );

Ben Avison's avatar
Ben Avison committed
34 35 36
#define CNV_DEFAULT_TYPE        FileType_Text
#define CNV_DATETIME            1
#define CNV_ATTRIBS             2
37 38 39 40 41 42 43 44 45 46 47 48 49 50 51

extern void Xlt_CnvDOStoRO ( DOS_ATTRIBS *pInAttr,
                             RISCOS_ATTRIBS *pOutAttr, int flags );

extern void Xlt_CnvROtoDOS ( RISCOS_ATTRIBS *pInAttr,
                             DOS_ATTRIBS *pOutAttr, int flags );


extern char *Xlt_GetRISCOSLeafName ( char *name );
extern void Xlt_NameDOStoRO ( char *riscos_dst, char *dos_src );

/* Name mode */
#define NM_PRESERVED 0
#define NM_LOWERCASE 1
#define NM_FIRSTCAPS 2
52 53
#define NM_MODE      (NM_LOWERCASE | NM_FIRSTCAPS)
#define NM_HIDDEN    4
Ben Avison's avatar
Ben Avison committed
54

55 56 57 58 59 60

extern err_t Xlt_ExpandSearchEntry ( BYTE *entry,
            char *DOS_pathname,
            char *name_out,
            DOS_ATTRIBS *pOutDA,
            RISCOS_ATTRIBS *pOutRA );
Stewart Brodie's avatar
Stewart Brodie committed
61 62 63 64 65
extern err_t Xlt_ExpandSearchEntryX2 ( BYTE *entry,
            char *DOS_pathname,
            char *name_out,
            DOS_ATTRIBS *pOutDA,
            RISCOS_ATTRIBS *pOutRA );
66 67 68 69 70 71


extern err_t Xlt_SetDefaultDrv ( char *path );
extern err_t Xlt_ConvertPath ( char *RO_name_in,
                               char *DOS_name_out );

Stewart Brodie's avatar
Stewart Brodie committed
72 73 74 75 76 77 78 79 80 81
#ifdef LONGNAMES
/* Looks at the specified path/leaf name and determines if it has
 * a ,xxx type specifier on the end of it.  If it does, it returns
 * the address of the comma in the terminator parameter, and updates
 * the RISCOS_ATTRIBS.loadaddr field to contain the type of the file.
 * The source string is not modified (but cannot be const without
 * requiring a cast to store the address of the terminator)
 */
extern err_t Xlt_SplitLeafnameX2 ( char *leafname, RISCOS_ATTRIBS *pRA,
  char **terminator);
82

83 84
/* Trims the optional ",ttt" extension from 'name'
 * and returns the updated string
Stewart Brodie's avatar
Stewart Brodie committed
85
 */
86
extern err_t Xlt_RemoveROType ( char *name );
87

Stewart Brodie's avatar
Stewart Brodie committed
88
/* Alters the filename specified so that it co-incides with the
89
 * type encoded in the given "load/exec addr" parameter,
Stewart Brodie's avatar
Stewart Brodie committed
90 91
 * Returns 1 if it changed the filetype, 0 otherwise
 */
92
extern int Xlt_AddROType ( char *leafname, uint loadaddr, uint execaddr );
Stewart Brodie's avatar
Stewart Brodie committed
93
#endif