home *** CD-ROM | disk | FTP | other *** search
/ Celestin Apprentice 7 / Apprentice-Release7.iso / Environments / Clean 1.2.4 / MacInterface / standard_file.icl < prev    next >
Encoding:
Modula Implementation  |  1996-02-22  |  4.1 KB  |  102 lines  |  [TEXT/3PRM]

  1. implementation module standard_file;
  2.  
  3. import mac_types;
  4.  
  5. SFGetFile :: !(!Int,!Int) !{#Char} !Int !Int !{#Char} !Int !{#Char} !Toolbox -> (!Bool,!Bool,!Int,!Int,!Int,!{#Char},!Toolbox);
  6. SFGetFile hv prompt fileFilter numTypes typeList dlgHook string64 tb
  7. =    (good,copy,fType,vRefNum,version,fName,NewToolbox);
  8.     where{
  9.         (good,copy,fType,vRefNum,version,fName) = SFGetFile1 hv prompt fileFilter numTypes typeList dlgHook string64 tb};
  10.  
  11. SFGetFile1 :: !(!Int,!Int) !{#Char} !Int !Int !{#Char} !Int !{#Char} !Toolbox -> (!Bool,!Bool,!Int,!Int,!Int,!{#Char});
  12. SFGetFile1 (h,v) prompt fileFilter numTypes typeList dlgHook string64 t
  13. = code (h=D5,v=D4,prompt=A2,fileFilter=D3,numTypes=D2,typeList=A1,dlgHook=D1,
  14.     string64=A0,t=U)(good=D4,copy=D3,fType=D2,vRefNum=D1,version=D0,fName=A0)
  15. {
  16.     instruction 0x4FEF 0xFFB6    ||    lea        -74(sp),sp
  17.     instruction 0x3F05            ||    move    d5,-(sp)
  18.     instruction 0x3F04            ||    move    d4,-(sp)
  19.     instruction 0x486A 0x0007    ||    pea        7(a2)
  20.     instruction 0x2F03            ||    move.l    d3,-(sp)
  21.     instruction 0x3F02            ||    move    d2,-(sp)
  22.     instruction 0x4869 0x0008    ||    pea     8(a1)
  23.     instruction 0x2F01            ||    move.l    d1,-(sp)
  24.     instruction 0x2A08            ||    move.l    a0,d5
  25.     instruction 0x486F 0x0016    ||    pea        22(sp)
  26.     instruction 0x3F3C 0x0002    ||    move    #2,-(sp)
  27.     instruction 0xA9EA            ||    _Pack3
  28.     instruction 0x7801            ||    moveq    #1,d4
  29.     instruction 0xC817            ||    and.b    (sp),d4
  30.     instruction 0x4484            ||    neg.l    d4
  31.     instruction 0x7601            ||    moveq    #1,d3
  32.     instruction 0xC62F 0x0001    ||    and.b    1(sp),d3
  33.     instruction 0x4483            ||    neg.l    d3
  34.     instruction 0x548F            ||    addq.l    #2,sp
  35.     instruction 0x241F            ||    move.l    (sp)+,d2
  36.     instruction 0x321F            ||    move    (sp)+,d1
  37.     instruction 0x48C1            ||    ext.l    d1
  38.     instruction 0x301F            ||    move    (sp)+,d0
  39.     instruction 0x48C0            ||    ext.l    d0
  40.     instruction 0x224F            ||    move.l    sp,a1
  41.     instruction 0x2045            ||    move.l    d5,a0
  42.     instruction 0x2445            ||    move.l    d5,a2
  43.     instruction 0x42A8 0x0004    ||    clr.l    4(a0)
  44.     instruction 0x5E88            ||    addq.l    #7,a0
  45.     instruction 0x7A00            ||    moveq    #0,d5
  46.     instruction 0x1A19            ||    move.b    (a1)+,d5
  47.     instruction 0x10C5            ||    move.b    d5,(a0)+
  48.     instruction 0x6002            ||    bra.s    l4
  49.     instruction 0x10D9            || l3: move.b (a1)+,(a0)+
  50.     instruction 0x51CD 0xFFFC    || l4: dbra    d5,l3
  51.     instruction 0x4FEF 0x0040    ||    lea     64(sp),sp
  52.     instruction 0x204A            ||    move.l    a2,a0
  53. };
  54.  
  55. SFPutFile :: !(!Int,!Int) !{#Char} !{#Char} !Int !{#Char} !Toolbox -> (!Bool,!Bool,!Int,!Int,!Int,!{#Char},!Toolbox);
  56. SFPutFile hv prompt origName dlgHook string64 tb
  57. =    (good,copy,fType,vRefNum,version,fName,NewToolbox);
  58.     where{
  59.         (good,copy,fType,vRefNum,version,fName) = SFPutFile1 hv prompt origName dlgHook string64 tb};
  60.  
  61. SFPutFile1 :: !(!Int,!Int) !{#Char} !{#Char} !Int !{#Char} !Toolbox -> (!Bool,!Bool,!Int,!Int,!Int,!{#Char});
  62. SFPutFile1 (h,v) prompt origName dlgHook string64 t
  63. = code (h=D3,v=D2,prompt=A2,origName=A1,dlgHook=D1,string64=A0,t=U)
  64.     (good=D4,copy=D3,fType=D2,vRefNum=D1,version=D0,fName=A0)
  65. {
  66.     instruction 0x4FEF 0xFFB6    ||    lea        -74(sp),sp
  67.     instruction 0x3F03            ||    move    d3,-(sp)
  68.     instruction 0x3F02            ||    move    d2,-(sp)
  69.     instruction 0x486A 0x0007    ||    pea     7(a2)
  70.     instruction 0x4869 0x0007    ||    pea        7(a1)
  71.     instruction 0x2F01            ||    move.l    d1,-(sp)
  72.     instruction 0x2A08            ||    move.l    a0,d5
  73.     instruction 0x486F 0x0010    ||    pea     16(sp)
  74.     instruction 0x3F3C 0x0001    ||    move    #1,-(sp)
  75.     instruction 0xA9EA            ||    _Pack3
  76.     instruction 0x7801            ||    moveq    #1,d4
  77.     instruction 0xC817            ||    and.b    (sp),d4
  78.     instruction 0x4484            ||    neg.l    d4
  79.     instruction 0x7601            ||    moveq    #1,d3
  80.     instruction 0xC62F 0x0001    ||    and.b    1(sp),d3
  81.     instruction 0x4483            ||    neg.l    d3
  82.     instruction 0x548F            ||    addq.l    #2,sp
  83.     instruction 0x241F            ||    move.l    (sp)+,d2
  84.     instruction 0x321F            ||    move    (sp)+,d1
  85.     instruction 0x48C1            ||    ext.l    d1
  86.     instruction 0x301F            ||    move    (sp)+,d0
  87.     instruction 0x48C0            ||    ext.l    d0
  88.     instruction 0x224F            ||    move.l    sp,a1
  89.     instruction 0x2045            ||    move.l    d5,a0
  90.     instruction 0x2445            ||    move.l    d5,a2
  91.     instruction 0x42A8 0x0004    ||    clr.l    4(a0)
  92.     instruction 0x5E88            ||    addq.l    #7,a0
  93.     instruction 0x7A00            ||    moveq    #0,d5
  94.     instruction 0x1A19            ||    move.b    (a1)+,d5
  95.     instruction 0x10C5            ||    move.b    d5,(a0)+
  96.     instruction 0x6002            ||    bra.s    l4
  97.     instruction 0x10D9            || l3: move.b (a1)+,(a0)+
  98.     instruction 0x51CD 0xFFFC    || l4: dbra    d5,l3
  99.     instruction 0x4FEF 0x0040    ||    lea        64(sp),sp
  100.     instruction 0x204A            ||    move.l    a2,a0
  101. };
  102.