home *** CD-ROM | disk | FTP | other *** search
/ Liren Large Software Subsidy 7 / 07.iso / c / c221 / 5.ddi / MWHC.005 / W3 < prev    next >
Encoding:
Text File  |  1992-12-09  |  1.9 KB  |  72 lines

  1. -- An exact copy of this module appears in both the Pascal and C libraries.
  2. {*********************************************************************
  3. (C) Copyright 1983-92 MetaWare Incorporated;  Santa Cruz, CA 95060.
  4. *********************************************************************}
  5.  
  6. Export(System,MSDOS,Fileh_type);
  7. pragma include('STATUS.pf');
  8. pragma include('SYSTEM.pf');
  9. pragma include('MSDOS.pf');
  10. pragma fragmented_implementation(System);
  11. pragma fragmented_implementation(MSDOS);
  12. with System,Status;
  13.  
  14. program Implement_DOS_interface;
  15. pragma Alias(Implement_DOS_interface,Implement.RTE || 'DOS_interface2');
  16.  
  17. with Registers;
  18. with Loopholes:[Address,Adr,Retype,&];
  19.  
  20. procedure Stringproc(Mkdir,C_Mkdir) (Stringparm(Name));
  21.    begin
  22.    DOS_name(Name,57);
  23.    end;
  24.  
  25. procedure Stringproc(Chdir,C_Chdir) (Stringparm(Name));
  26.    begin
  27.    DOS_Name(Name,59);
  28.    end;
  29.  
  30. procedure Stringproc(Chmod,C_Chmod) (Stringparm(Name); Mode: File_mode);
  31.    begin
  32.    CX.R := Retype(Mode,Byte);
  33.    Ax.L := 1;
  34.    DOS_name(Name,67);
  35.    end;
  36.  
  37. function Stringproc(Filemode,C_filemode) (Stringparm(Name)): File_mode;
  38.    begin
  39.    Ax.L := 0;
  40.    DOS_name(Name,67);
  41.    return(Retype(Cx.L,File_mode));
  42.    end;
  43.  
  44. procedure Stringproc(Find_first,C_Find_first) (Stringparm(Path); var S: Find_buffer; Attr: File_mode);
  45.    begin
  46.    Set_DMA(Adr(S));
  47.    CX.R := Retype(Attr,Byte);
  48.    DOS_name(Path,78);
  49.    end;
  50.  
  51. procedure Stringproc(Rmdir,C_Rmdir) (Stringparm(Name));
  52.    begin
  53.    DOS_name(Name,58);
  54.    end;
  55.  
  56. procedure Stringproc(Rename,C_Rename) (Stringparm(Old); Stringparm(New));
  57. #if PPLIB
  58.    var S: Strcopy;
  59. #endif
  60.    begin { Rename Old to New. }
  61. #if HCLIB
  62.    Load_ptr(ES,DI,New);
  63. #else
  64.    S := New; S[Length(New)+1] := Chr(0);
  65.    Load_ptr(ES,DI,Adr(S));
  66. #endif
  67.    DOS_name(Old,86);
  68.    end;
  69.  
  70. -- (C) Copyright 1983,84,85 MetaWare Incorporated;  Santa Cruz, CA 95060.
  71.  
  72.