Xlate 3.17 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 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57
/* 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 );


#define CNV_DATETIME 1
#define CNV_ATTRIBS  2

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

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
58 59 60 61 62
extern err_t Xlt_ExpandSearchEntryX2 ( BYTE *entry,
            char *DOS_pathname,
            char *name_out,
            DOS_ATTRIBS *pOutDA,
            RISCOS_ATTRIBS *pOutRA );
63 64 65 66 67 68 69 70 71 72 73 74


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

/* Translate from our error code to RISCOS error block */
extern _kernel_oserror *Xlt_Error ( err_t err );

/* Translate from RISCOS error block to our error code */
extern err_t Xlt_SetOSError ( _kernel_oserror *err );

Stewart Brodie's avatar
Stewart Brodie committed
75 76 77 78 79 80 81 82 83 84
#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);
85

Stewart Brodie's avatar
Stewart Brodie committed
86 87 88 89
/* Looks at the source filename for a rename operation and updates the
 * target filename to preserve any filetyping information
 */
extern err_t Xlt_CnvRenameX2 ( char *src, char *dst );
90

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