home *** CD-ROM | disk | FTP | other *** search
/ Celestin Apprentice 7 / Apprentice-Release7.iso / Environments / Clean 1.2.4 / PowerMacInterface / files.icl < prev    next >
Encoding:
Modula Implementation  |  1996-03-01  |  5.5 KB  |  143 lines  |  [TEXT/3PRM]

  1. implementation module files;
  2.  
  3. import mac_types;
  4.  
  5. GetVInfo :: !{#Char} !Toolbox -> (!Int,!Int,!Toolbox);
  6. GetVInfo ioNamePtr t = code (ioNamePtr=R64O0D0SD1,t=U)(ioResult=D0,ioVRefNum=I64A0,t2=Z){
  7.     instruction 0x39400000    |    li    r10,0
  8.     instruction 0x9141000C    |    stw    r10,12(sp)
  9.     instruction 0x90810012    |    stw    r4,18(sp)
  10.     instruction 0xB1410016    |    sth    r10,22(sp)
  11.     instruction 0x3940FFFF    |    li    r10,-1
  12.     instruction 0xB141001C    |    sth    r10,28(sp)
  13.     call    .PBGetVInfoSync
  14.     instruction 0xAB210016    |    lha    r25,22(sp)
  15. };
  16.  
  17. GetCatInfo1 :: !Int !{#Char} !Toolbox -> (!Int,!Int,!Toolbox);
  18. GetCatInfo1 ioVRefNum ioNamePtr t = code (ioVRefNum=R108O0D0U,ioNamePtr=SD1,t=U)(ioResult=D0,ioDrParID=I108A0,t2=Z){
  19.     instruction 0x39400000    |    li    r10,0
  20.     instruction 0x9141000C    |    stw    r10,12(sp)
  21.     instruction 0x90810012    |    stw    r4,18(sp)
  22.     instruction 0xB3210016    |    sth    r25,22(sp)
  23.     instruction 0xB141001C    |    sth    r10,28(sp)
  24.     instruction 0x91410030    |    stw    r10,48(sp)
  25.     call    .PBGetCatInfoSync
  26.     instruction 0x83210064    |    lwz    r25,100(sp)
  27. };
  28.  
  29. GetCatInfo2 :: !Int !Int !{#Char} !Toolbox -> (!Int,!{#Char},!Int,!Toolbox);
  30. GetCatInfo2 ioVRefNum ioDrDirID s t = code (ioVRefNum=R108O0D0U,ioDrDirID=U,s=U,t=U)(ioResult=D0,ioDrParID=A0,ioNamePtr=I108A0,z=Z){
  31.     instruction 0x39400000    |    li    r10,0
  32.     instruction 0x9141000C    |    stw    r10,12(sp)
  33.     instruction 0x91570004    |    stw    r10,4(r23)
  34.     instruction 0x3AD70007    |    addi    r22,r23,7
  35.     instruction 0x92C10012    |    stw    r22,18(sp)
  36.     instruction 0xB3410016    |    sth    r26,22(sp)
  37.     instruction 0x3940FFFF    |    li    r10,-1
  38.     instruction 0xB141001C    |    sth    r10,28(sp)
  39.     instruction 0x93210030 |    stw    r25,48(sp)
  40.     call    .PBGetCatInfoSync
  41.     instruction 0x83210064    |    lwz    r25,100(sp)
  42. };
  43.  
  44. GetCatInfo3 :: !Int !Int !{#Char} !Toolbox -> (!Int,!Int,!Int,!Toolbox);
  45. GetCatInfo3 ioVRefNum ioDirID ioNamePtr t = code (ioVRefNum=R108O0D0U,ioDirID=U,ioNamePtr=SD1,t=U)(ioResult=D0,ioFlAttrib=A0,ioDrDirID=I108A0,t2=Z){
  46.     instruction 0x39400000    |    li    r10,0
  47.     instruction 0x9141000C    |    stw    r10,12(sp)
  48.     instruction 0x90810012    |    stw    r4,18(sp)
  49.     instruction 0xB3410016    |    sth    r26,22(sp)
  50.     instruction 0xB141001C    |    sth    r10,28(sp)
  51.     instruction 0x93210030    |    stw    r25,48(sp)
  52.     call    .PBGetCatInfoSync
  53.     instruction 0x8B41001E    |    lbz    r26,30(sp)
  54.     instruction 0x83210030    |    lwz    r25,48(sp)
  55. };
  56.  
  57. GetWDInfo :: !Int !Toolbox -> (!Int,!Int,!Int,!Toolbox);
  58. GetWDInfo ioVRefNum t = code (ioVRefNum=R52O0D0D1,t=U)(ioResult=D0,ioWDVRefNum=A0,ioWDDirId=I52A0,t2=Z){
  59.     instruction 0x39400000    |    li    r10,0
  60.     instruction 0x9141000C    |    stw    r10,12(sp)
  61.     instruction 0x91410012    |    stw    r10,18(sp)
  62.     instruction 0xB3210016    |    sth    r25,22(sp)
  63.     instruction 0xB141001A    |    sth    r10,26(sp)
  64.     call    .PBGetWDInfoSync
  65.     instruction 0xAB410016    |    lha    r26,22(sp)
  66.     instruction 0x83210030    |    lwz    r25,48(sp)
  67. };
  68.  
  69. HGetVol :: !Toolbox -> (!Int,!Int,!Int,!Toolbox);
  70. HGetVol t = code (t=R52O0D0U)(ioResult=D0,ioWDVRefNum=A0,ioWDDirId=I52A0,t2=Z){
  71.     instruction 0x39400000    |    li    r10,0
  72.     instruction 0x91410012    |    stw    r10,18(sp)
  73.     call    .PBHGetVolSync
  74.     instruction 0xAB410020    |    lha    r26,32(sp)
  75.     instruction 0x83210030    |    lwz    r25,48(sp)
  76. };
  77.  
  78. OpenWD :: !Int !Int !Toolbox -> Int;
  79. OpenWD ioVRefNum ioWDDirID t = code (ioVRefNum=R52O0D0U,ioWDDirID=U,t=U)(ioWDVRefNum=I52A0){
  80.     instruction 0x39400000    |    li    r10,0
  81.     instruction 0x9141000C    |    stw    r10,12(sp)
  82.     instruction 0x91410012    |    stw    r10,18(sp)
  83.     instruction 0xB3410016    |    sth    r26,22(sp)
  84.     instruction 0x9141001C    |    stw    r10,28(sp)
  85.     instruction 0x93210030    |    stw    r25,48(sp)
  86.     call    .PBOpenWDSync
  87.     instruction 0xAB010016    |    lha    r24,22(sp)
  88. };
  89.  
  90. GetFInfo :: !{#Char} !Toolbox -> (!Int,!Int,!Toolbox);
  91. GetFInfo ioNamePtr t = code (ioNamePtr=R80O0D0SD1,t=U)(ioResult=D0,ioDate_and_Time=I80A0,t2=Z){
  92.     instruction 0x39400000    |    li    r10,0
  93.     instruction 0x9141000C    |    stw    r10,12(sp)
  94.     instruction 0x90810012    |    stw    r4,18(sp)
  95.     instruction 0xB1410016    |    sth    r10,22(sp)
  96.     instruction 0xB141001A    |    sth    r10,26(sp)
  97.     instruction 0x91410030    |    stw    r10,48(sp)
  98.     instruction 0x3940FFFF    |    li    r10,-1
  99.     instruction 0xB141001C    |    sth    r10,28(sp)
  100.     call    .PBHGetFInfoSync
  101.     instruction 0x8321004C    |    lwz    r25,76(sp)
  102. };
  103.  
  104. SetFileTypeAndCreator :: !{#Char} !{#Char} !{#Char} !Toolbox -> (!Int,!Toolbox);
  105. SetFileTypeAndCreator type creator ioNamePtr t = code (type=R80U,creator=U,ioNamePtr=U,t=U)(ioResult=I80D0,t2=Z){
  106.     instruction 0x83B50008    |    lwz       r29,0x0008(r21)
  107.     instruction 0x83960008    |    lwz       r28,0x0008(r22)
  108.     instruction 0x39400000    |    li        r10,0
  109.     instruction 0x9141000C    |    stw       r10,0x000C(SP)
  110.     instruction 0x3B770007    |    addi      r27,r23,7
  111.     instruction 0x93610012    |    stw       r27,0x0012(SP)
  112.     instruction 0xB1410016    |    sth       r10,0x0016(SP)
  113.     instruction 0xB141001A    |    sth       r10,0x001A(SP)
  114.     instruction 0x91410030    |    stw       r10,0x0030(SP)
  115.     instruction 0x3940FFFF    |    li        r10,-1
  116.     instruction 0xB141001C    |    sth       r10,0x001C(SP)
  117.     instruction 0x7C230B78    |    mr        r3,SP
  118.     call    .PBHGetFInfoSync
  119.     instruction 0x7C630735    |    extsh.    r3,3
  120.     instruction 0x4082003C    |    bne       $+0x3C
  121.     instruction 0x93610012    |    stw       r27,0x0012(SP)
  122.     instruction 0x93A10020    |    stw       r29,0x0020(SP)
  123.     instruction 0x93810024    |    stw       r28,0x0024(SP)
  124.     instruction 0x39400000    |    li        r10,0
  125.     instruction 0x91410030    |    stw       r10,0x0030(SP)
  126.     instruction 0x7C230B78    |    mr        r3,SP
  127.     call    .PBHSetFInfoSync
  128. };
  129.  
  130. LaunchApplication :: !{#Char} !Int !Toolbox -> (!Int,!Toolbox);
  131. LaunchApplication file_name flags t
  132. = code (file_name=R20SD0,flags=D1,t=U)(result=I20D0,t2=Z){
  133.     instruction 0x90610000    |    stw        r3,0(sp)
  134.     instruction 0x39404C43    |    li        r10,'LC'
  135.     instruction 0x91410004    |    stw        r10,4(SP)
  136.     instruction 0x39400006    |    li        r10,6
  137.     instruction 0x91410008    |    stw        r10,8(SP)
  138.     instruction 0xB141000C    |    sth        r10,12(SP)
  139.     instruction 0x9081000E    |    stw        r4,14(SP)
  140.     instruction 0x7C230B78    |    mr        r3,SP    
  141.     call    .LaunchApplication
  142. }
  143.