~ubuntu-branches/ubuntu/feisty/fpc/feisty

« back to all changes in this revision

Viewing changes to rtl/unix/dos.pp

  • Committer: Bazaar Package Importer
  • Author(s): Torsten Werner
  • Date: 2007-01-27 20:08:50 UTC
  • mfrom: (1.2.3 upstream)
  • Revision ID: james.westby@ubuntu.com-20070127200850-9mrptaqqjsx9nwa7
Tags: 2.0.4-5
* Fixed Build-Depends.
* Add myself to Uploaders in debian/control.
* Make sure that the sources are really patched before building them.
* Build unit 'libc' on powerpc too.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
{
2
 
    $Id: dos.pp,v 1.46 2005/03/15 16:53:52 peter Exp $
3
2
    This file is part of the Free Pascal run time library.
4
3
    Copyright (c) 1999-2000 by Michael Van Canneyt and Peter Vreman,
5
4
    members of the Free Pascal development team
15
14
Unit Dos;
16
15
Interface
17
16
 
 
17
uses baseunix;
 
18
 
18
19
Const
19
20
  FileNameLen = 255;
20
21
 
25
26
{$endif FPC_REQUIRES_PROPER_ALIGNMENT}
26
27
    Record
27
28
  {Fill : array[1..21] of byte;  Fill replaced with below}
 
29
    SearchPos  : TOff;        {directory position}
28
30
    SearchNum  : LongInt;     {to track which search this is}
29
 
    SearchPos  : LongInt;     {directory position}
30
31
    DirPtr     : Pointer;     {directory pointer for reading directory}
31
32
    SearchType : Byte;        {0=normal, 1=open will close, 2=only 1 file}
32
33
    SearchAttr : Byte;        {attribute we are searching for}
33
 
    Fill       : Array[1..07] of Byte; {future use}
 
34
    Fill       : Array[1..03] of Byte; {future use}
34
35
  {End of fill}
35
36
    Attr       : Byte;        {attribute of found file}
36
37
    Time       : LongInt;     {last modify date of found file}
50
51
Function  DTToUnixDate(DT: DateTime): LongInt;
51
52
 
52
53
{Disk}
53
 
Procedure AddDisk(const path:string);
 
54
Function AddDisk(const path:string) : byte;
54
55
 
55
56
Implementation
56
57
 
57
58
Uses
58
 
  Strings,Unix,BaseUnix,{$ifdef FPC_USE_LIBC}initc{$ELSE}Syscall{$ENDIF};
 
59
  UnixUtil, // tzSeconds
 
60
  Strings,
 
61
  Unix,
 
62
  {$ifdef FPC_USE_LIBC}initc{$ELSE}Syscall{$ENDIF};
59
63
 
60
64
{$DEFINE HAS_GETMSCOUNT}
61
65
 
380
384
var
381
385
  DriveStr : array[4..26] of pchar;
382
386
 
383
 
Procedure AddDisk(const path:string);
 
387
Function AddDisk(const path:string) : byte;
384
388
begin
385
389
  if not (DriveStr[Drives]=nil) then
386
390
   FreeMem(DriveStr[Drives],StrLen(DriveStr[Drives])+1);
388
392
  StrPCopy(DriveStr[Drives],path);
389
393
  inc(Drives);
390
394
  if Drives>26 then
391
 
   Drives:=4;
 
395
    Drives:=4;
 
396
  AddDisk:=Drives; 
392
397
end;
393
398
 
394
399
 
889
894
******************************************************************************}
890
895
 
891
896
End.
892
 
 
893
 
{
894
 
  $Log: dos.pp,v $
895
 
  Revision 1.46  2005/03/15 16:53:52  peter
896
 
    * return doserror=2 if path is empty in exec()
897
 
 
898
 
  Revision 1.45  2005/02/14 17:13:31  peter
899
 
    * truncate log
900
 
 
901
 
  Revision 1.44  2005/02/13 20:01:38  peter
902
 
    * include file cleanup
903
 
 
904
 
}