; ; File: Aliases.a ; ; Contains: Assembly Interface for Alias Manager API ; ; Written by: Prashant Patel ; ; Copyright: © 1990 by Apple Computer, Inc., all rights reserved. ; ; Change History (most recent first): ; ; <14> 7/29/91 MH minor formatting change to match Interfaces data base output ; <13> 6/14/91 JL Checked in official MPW 3.2ƒ version. Adjusted comment for ; MatchAlias and newAlias to match shipping version. ; <12> 1/30/91 gbm sab, #38: Change the ‘already including this file’ variable to ; all uppercase ; <11> 8/6/90 PP zoneName in MinimalFullpathAlias is Str32 and not Str31. Remove ; CanonifyFile support. ; <10> 7/2/90 PP Add ResolveAliasFile. ; <9> 6/15/90 PP Remove SelectAlias. ; <6> 4/10/90 PP Add support for kARMnoUI bit in rules mask. ; <5> 4/5/90 PP Add kARMsearchRelFirst to MatchAlias rulesMask. Rename ; "callbackPtr" to "yourDataPtr". ; <4> 3/20/90 PP Add interfaces for minimal alias support. toFile is target. ; ; To Do: ; ; 1.5 prp 12/15/1989 Fix parameter variable names. ; 1.4 prp 10/02/1989 Added 'GetAliasInfo' routine. ; 1.3 prp 09/18/1989 SelectAlias, MatchAlias and UpdateAlias has API changes ; with additional parameters. ; 1.2 prp 09/06/1989 Added DisposeAlias back until DPMgr is in sync. ; 1.1 prp 09/06/1989 Changes from CodeReview. ; 1.0 prp 08/09/1989 Initial Creation. ;-------------------------------------------------------------------- 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