~ubuntu-branches/ubuntu/lucid/fpc/lucid-proposed

« back to all changes in this revision

Viewing changes to fpcsrc/rtl/os2/sysfile.inc

  • Committer: Bazaar Package Importer
  • Author(s): Mazen Neifer, Torsten Werner, Mazen Neifer
  • Date: 2008-10-09 23:29:00 UTC
  • mfrom: (4.1.1 sid)
  • Revision ID: james.westby@ubuntu.com-20081009232900-553f61m37jkp6upv
Tags: 2.2.2-4
[ Torsten Werner ]
* Update ABI version in fpc-depends automatically.
* Remove empty directories from binary package fpc-source.

[ Mazen Neifer ]
* Removed leading path when calling update-alternatives to remove a Linitian
  error.
* Fixed clean target.
* Improved description of packages. (Closes: #498882)

Show diffs side-by-side

added added

removed removed

Lines of Context:
19
19
 
20
20
****************************************************************************}
21
21
 
22
 
procedure allowslash(p:Pchar);
23
 
{Allow slash as backslash.}
24
 
var i:longint;
25
 
begin
26
 
    for i:=0 to strlen(p) do
27
 
        if p[i]='/' then p[i]:='\';
28
 
end;
29
 
 
30
22
procedure do_close(h:thandle);
31
23
begin
32
24
{ Only three standard handles under real OS/2 }
41
33
 
42
34
procedure do_erase(p:Pchar);
43
35
begin
44
 
  allowslash(p);
 
36
  DoDirSeparators(p);
45
37
  inoutres:=DosDelete(p);
46
38
end;
47
39
 
48
40
procedure do_rename(p1,p2:Pchar);
49
41
begin
50
 
  allowslash(p1);
51
 
  allowslash(p2);
 
42
  DoDirSeparators(p1);
 
43
  DoDirSeparators(p2);
52
44
  inoutres:=DosMove(p1, p2);
53
45
end;
54
46
 
84
76
var
85
77
  PosActual: int64;
86
78
begin
87
 
  InOutRes := DosSetFilePtrL (Handle, 0, 1, PosActual);
 
79
  InOutRes := Sys_DosSetFilePtrL (Handle, 0, 1, PosActual);
88
80
  Do_FilePos := PosActual;
89
81
{$ifdef IODEBUG}
90
82
  writeln('do_filepos: handle=', Handle, ', actual_pos=', PosActual, ', InOutRes=', InOutRes);
95
87
var
96
88
  PosActual: int64;
97
89
begin
98
 
  InOutRes:=DosSetFilePtrL(Handle, Pos, 0 {ZeroBased}, PosActual);
 
90
  InOutRes:=Sys_DosSetFilePtrL(Handle, Pos, 0 {ZeroBased}, PosActual);
99
91
{$ifdef IODEBUG}
100
92
  writeln('do_seek: handle=', Handle, ', pos=', pos, ', actual_pos=', PosActual, ', InOutRes=', InOutRes);
101
93
{$endif}
105
97
var
106
98
  PosActual: int64;
107
99
begin
108
 
  InOutRes := DosSetFilePtrL (Handle, 0, 2 {EndBased}, PosActual);
 
100
  InOutRes := Sys_DosSetFilePtrL (Handle, 0, 2 {EndBased}, PosActual);
109
101
  Do_SeekEnd := PosActual;
110
102
{$ifdef IODEBUG}
111
103
  writeln('do_seekend: handle=', Handle, ', actual_pos=', PosActual, ', InOutRes=', InOutRes);
123
115
 
124
116
procedure Do_Truncate (Handle: THandle; Pos: int64);
125
117
begin
126
 
  InOutRes := DosSetFileSizeL (Handle, Pos);
 
118
  InOutRes := Sys_DosSetFileSizeL (Handle, Pos);
127
119
  Do_SeekEnd (Handle);
128
120
end;
129
121
 
162
154
  Action, Attrib, OpenFlags, FM: Cardinal;
163
155
begin
164
156
  // convert unix slashes to normal slashes
165
 
  allowslash(p);
 
157
  DoDirSeparators(p);
166
158
 
167
159
  // close first if opened
168
160
  if ((flags and $10000)=0) then
221
213
 
222
214
  Attrib:=32 {faArchive};
223
215
 
224
 
  InOutRes:=DosOpenL(p, FileRec(F).Handle, Action, 0, Attrib, OpenFlags, FM, nil);
 
216
  InOutRes:=Sys_DosOpenL(p, FileRec(F).Handle, Action, 0, Attrib, OpenFlags, FM, nil);
225
217
 
226
218
  // If too many open files try to set more file handles and open again
227
219
  if (InOutRes = 4) then
228
220
    if Increase_File_Handle_Count then
229
 
      InOutRes:=DosOpenL(p, FileRec(F).Handle, Action, 0, Attrib, OpenFlags, FM, nil);
 
221
      InOutRes:=Sys_DosOpenL(p, FileRec(F).Handle, Action, 0, Attrib, OpenFlags, FM, nil);
230
222
 
231
223
  If InOutRes<>0 then FileRec(F).Handle:=UnusedHandle;
232
224