mirror of
https://github.com/elliotnunn/supermario.git
synced 2025-02-27 23:29:06 +00:00
175 lines
5.4 KiB
Plaintext
175 lines
5.4 KiB
Plaintext
|
; Version: 1.4
|
||
|
; Created: Friday, October 20, 1989 at 9:11:52 PM
|
||
|
; File: Aliases.a
|
||
|
;
|
||
|
; Assembler Interface to the Macintosh Libraries
|
||
|
; Copyright Apple Computer, Inc. 1989-90
|
||
|
; All Rights Reserved
|
||
|
;
|
||
|
;--------------------------------------------------------------------
|
||
|
IF &TYPE('__IncludingAliases__') = 'UNDEFINED' THEN
|
||
|
__IncludingAliases__ SET 1
|
||
|
|
||
|
;*********************************************************************
|
||
|
;*************** Constants **************************
|
||
|
;*********************************************************************
|
||
|
|
||
|
rAliasType EQU 'alis' ;Aliases are stored as resources of this type
|
||
|
|
||
|
; define alias resolution action rules mask
|
||
|
kARMmountVol EQU $00000001 ; mount the volume automatically
|
||
|
kARMnoUI EQU $00000002 ; no user interface allowed during resolution
|
||
|
kARMmultVols EQU $00000008 ; search on multiple volumes
|
||
|
kARMsearch EQU $00000100 ; search quickly
|
||
|
kARMsearchMore EQU $00000200 ; search further
|
||
|
kARMsearchRelFirst EQU $00000400 ; search target on a relative path first
|
||
|
|
||
|
; define alias record information types
|
||
|
asiZoneName EQU -3 ; get zone name
|
||
|
asiServerName EQU -2 ; get server name
|
||
|
asiVolumeName EQU -1 ; get volume name
|
||
|
asiAliasName EQU 0 ; get aliased file/folder/volume name
|
||
|
asiParentName EQU 1 ; get parent folder name
|
||
|
|
||
|
|
||
|
;*********************************************************************
|
||
|
;*************** Data Structures **********************
|
||
|
;*********************************************************************
|
||
|
|
||
|
|
||
|
; define the alias record that will be the blackbox for the caller
|
||
|
AliasRecord RECORD 0
|
||
|
; following two fields for application use
|
||
|
userType DS.L 1 ; appl stored type
|
||
|
aliasSize DS.W 1 ; alias record size in bytes, for appl usage
|
||
|
; what follows is a variable length amount of data that is private
|
||
|
ENDR
|
||
|
|
||
|
;*********************************************************************
|
||
|
;*************** Public Interfaces **********************
|
||
|
;*********************************************************************
|
||
|
|
||
|
;{**** High Level Routines ****}
|
||
|
|
||
|
; create a new alias between fromFile-toFile and return alias
|
||
|
; record handle.
|
||
|
;pascal OSErr NewAlias ( const FSSpec *fromFile, //I
|
||
|
; const FSSpec *target,//I
|
||
|
; AliasHandle *alias) //O
|
||
|
;= {0x7002,0xA823};
|
||
|
|
||
|
MACRO
|
||
|
_NewAlias
|
||
|
MOVEQ #2,D0
|
||
|
DC.W $A823
|
||
|
ENDM
|
||
|
|
||
|
; create a minimal new alias for a target and return alias
|
||
|
; record handle
|
||
|
;pascal OSErr NewAliasMinimal (const FSSpec *target, /*I*/
|
||
|
; AliasHandle *alias) /*O*/
|
||
|
;= {0x7008,0xA823};
|
||
|
|
||
|
MACRO
|
||
|
_NewAliasMinimal
|
||
|
MOVEQ #8,D0
|
||
|
DC.W $A823
|
||
|
ENDM
|
||
|
|
||
|
; create a minimal new alias from a target fullpath (optional zone and server name)
|
||
|
; and return alias record handle ;
|
||
|
;pascal OSErr NewAliasMinimalFromFullpath (short fullpathLength, /*I*/
|
||
|
; const unsigned char *fullpath, /*I*/
|
||
|
; const Str32 zoneName, /*I*/
|
||
|
; const Str31 serverName, /*I*/
|
||
|
; AliasHandle *alias) /*O*/
|
||
|
;= {0x7009,0xA823};
|
||
|
|
||
|
MACRO
|
||
|
_NewAliasMinimalFromFullpath
|
||
|
MOVEQ #9,D0
|
||
|
DC.W $A823
|
||
|
ENDM
|
||
|
|
||
|
; given an alias handle and fromFile, resolve the alias, update the
|
||
|
; alias record and return aliased filename and wasChanged flag.
|
||
|
;pascal OSErr ResolveAlias(const FSSpec *fromFile, //I
|
||
|
; AliasHandle alias, //O
|
||
|
; FSSpec *target, //O
|
||
|
; Boolean *wasChanged) //O
|
||
|
;= {0x7003,0xA823};
|
||
|
|
||
|
MACRO
|
||
|
_ResolveAlias
|
||
|
MOVEQ #3,D0
|
||
|
DC.W $A823
|
||
|
ENDM
|
||
|
|
||
|
; given an alias handle and an index specifying requested alias information
|
||
|
; type, return the information from alias record as a string.
|
||
|
;pascal OSErr GetAliasInfo( AliasHandle alias, //I
|
||
|
; AliasInfoType index, //I
|
||
|
; Str63 theString) //O
|
||
|
;= {0x7007,0xA823};
|
||
|
|
||
|
MACRO
|
||
|
_GetAliasInfo
|
||
|
MOVEQ #7,D0
|
||
|
DC.W $A823
|
||
|
ENDM
|
||
|
|
||
|
|
||
|
; given a file spec, return target file spec if input file spec is an alias.
|
||
|
; It resolves the entire alias chain or one step of the chain. It returns
|
||
|
; info about whether the target is a folder or file; and whether the input
|
||
|
; file spec was an alias or not.
|
||
|
;pascal OSErr ResolveAliasFile(FSSpec *theSpec, /*I/O*/
|
||
|
; Boolean resolveAliasChains, /*I*/
|
||
|
; Boolean *targetIsFolder, /*O*/
|
||
|
; Boolean *wasAliased) /*O*/
|
||
|
;= {0x700C,0xA823};
|
||
|
|
||
|
MACRO
|
||
|
_ResolveAliasFile
|
||
|
MOVEQ #$0C,D0
|
||
|
DC.W $A823
|
||
|
ENDM
|
||
|
|
||
|
|
||
|
;{**** Low Level Routines ****}
|
||
|
|
||
|
; given an alias handle and fromFile, match the alias and return
|
||
|
; aliased filename(s) and needsUpdate flag.
|
||
|
;pascal OSErr MatchAlias(const FSSpec *fromFile, //I
|
||
|
; unsigned long rulesMask, //I
|
||
|
; const AliasHandle alias, //I
|
||
|
; short *aliasCount, //I/O
|
||
|
; FSSpecList aliasList, //O
|
||
|
; Boolean *needsUpdate, //O
|
||
|
; AliasFilterProcPtr aliasFilter, //I
|
||
|
; Ptr yourDataPtr) //I
|
||
|
;= {0x7005,0xA823};
|
||
|
|
||
|
MACRO
|
||
|
_MatchAlias
|
||
|
MOVEQ #5,D0
|
||
|
DC.W $A823
|
||
|
ENDM
|
||
|
|
||
|
; given a fromFile-toFile pair and an alias handle, update the
|
||
|
; alias record pointed to by alias handle to represent newToFile
|
||
|
; as the new alias.
|
||
|
;pascal OSErr UpdateAlias (const FSSpec *fromFile, //I
|
||
|
; const FSSpec *target, //I
|
||
|
; AliasHandle alias, //I/O
|
||
|
; Boolean *wasChanged) //O
|
||
|
;= {0x7006,0xA823};
|
||
|
|
||
|
MACRO
|
||
|
_UpdateAlias
|
||
|
MOVEQ #6,D0
|
||
|
DC.W $A823
|
||
|
ENDM
|
||
|
|
||
|
|
||
|
ENDIF ; ...already included
|