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

« back to all changes in this revision

Viewing changes to rtl/inc/file.inc

  • 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: file.inc,v 1.9 2005/02/14 17:13:22 peter Exp $
3
2
    This file is part of the Free Pascal Run time library.
4
3
    Copyright (c) 1999-2000 by the Free Pascal development team
5
4
 
124
123
End;
125
124
 
126
125
 
127
 
Procedure BlockWrite(Var f:File;Const Buf;Count:Longint;var Result:Longint);[IOCheck];
 
126
Procedure BlockWrite(Var f:File;Const Buf;Count:Int64;var Result:Int64);[IOCheck];
128
127
{
129
128
  Write Count records from Buf to file f, return written records in result
130
129
}
142
141
End;
143
142
 
144
143
 
 
144
Procedure BlockWrite(Var f:File;Const Buf;Count:Longint;var Result:Longint);[IOCheck];
 
145
{
 
146
  Write Count records from Buf to file f, return written records in result
 
147
}
 
148
var
 
149
  l : Int64;
 
150
Begin
 
151
  BlockWrite(f,Buf,Count,l);
 
152
  Result:=longint(l);
 
153
End;
 
154
 
 
155
 
145
156
Procedure BlockWrite(Var f:File;Const Buf;Count:Word;var Result:Word);[IOCheck];
146
157
{
147
158
  Write Count records from Buf to file f, return written records in Result
148
159
}
149
160
var
150
 
  l : longint;
 
161
  l : Int64;
151
162
Begin
152
163
  BlockWrite(f,Buf,Count,l);
153
164
  Result:=word(l);
154
165
End;
155
166
 
156
 
 
157
167
Procedure BlockWrite(Var f:File;Const Buf;Count:Cardinal;var Result:Cardinal);[IOCheck];
158
168
{
159
169
  Write Count records from Buf to file f, return written records in Result
160
170
}
161
171
var
162
 
  l : longint;
 
172
  l : Int64;
163
173
Begin
164
174
  BlockWrite(f,Buf,Count,l);
165
175
  Result:=l;
166
176
End;
167
177
 
168
 
 
169
178
Procedure BlockWrite(Var f:File;Const Buf;Count:Word;var Result:Integer);[IOCheck];
170
179
{
171
180
  Write Count records from Buf to file f, return written records in Result
172
181
}
173
182
var
174
 
  l : longint;
 
183
  l : Int64;
175
184
Begin
176
185
  BlockWrite(f,Buf,Count,l);
177
186
  Result:=integer(l);
178
187
End;
179
188
 
180
 
 
181
189
Procedure BlockWrite(Var f:File;Const Buf;Count:Longint);[IOCheck];
182
190
{
183
191
  Write Count records from Buf to file f, if none a Read and Count>0 then
184
192
  InOutRes is set
185
193
}
186
194
var
187
 
  Result : Longint;
 
195
  Result : Int64;
188
196
Begin
189
197
  BlockWrite(f,Buf,Count,Result);
190
198
  If (InOutRes=0) and (Result<Count) and (Count>0) Then
191
199
   InOutRes:=101;
192
200
End;
193
201
 
194
 
 
195
 
Procedure BlockRead(var f:File;var Buf;Count:Longint;var Result:Longint);[IOCheck];
 
202
Procedure BlockRead(var f:File;var Buf;Count:Int64;var Result:Int64);[IOCheck];
196
203
{
197
204
  Read Count records from file f ro Buf, return number of read records in
198
205
  Result
210
217
  end;
211
218
End;
212
219
 
 
220
Procedure BlockRead(var f:File;var Buf;Count:Longint;var Result:Longint);[IOCheck];
 
221
{
 
222
  Read Count records from file f ro Buf, return number of read records in
 
223
  Result
 
224
}
 
225
var
 
226
  l : int64;
 
227
Begin
 
228
  BlockRead(f,Buf,Count,l);
 
229
  Result:=longint(l);
 
230
End;
213
231
 
214
232
Procedure BlockRead(var f:File;var Buf;count:Word;var Result:Word);[IOCheck];
215
233
{
217
235
  Result
218
236
}
219
237
var
220
 
  l : longint;
 
238
  l : int64;
221
239
Begin
222
240
  BlockRead(f,Buf,Count,l);
223
241
  Result:=word(l);
224
242
End;
225
243
 
226
 
 
227
244
Procedure BlockRead(var f:File;var Buf;count:Cardinal;var Result:Cardinal);[IOCheck];
228
245
{
229
246
  Read Count records from file f to Buf, return number of read records in
230
247
  Result
231
248
}
232
249
var
233
 
  l : longint;
 
250
  l : int64;
234
251
Begin
235
252
  BlockRead(f,Buf,Count,l);
236
253
  Result:=l;
237
254
End;
238
255
 
239
 
 
240
256
Procedure BlockRead(var f:File;var Buf;count:Word;var Result:Integer);[IOCheck];
241
257
{
242
258
  Read Count records from file f to Buf, return number of read records in
243
259
  Result
244
260
}
245
261
var
246
 
  l : longint;
 
262
  l : int64;
247
263
Begin
248
264
  BlockRead(f,Buf,Count,l);
249
265
  Result:=integer(l);
250
266
End;
251
267
 
252
 
 
253
 
Procedure BlockRead(Var f:File;Var Buf;Count:Longint);[IOCheck];
 
268
Procedure BlockRead(Var f:File;Var Buf;Count:Int64);[IOCheck];
254
269
{
255
270
  Read Count records from file f to Buf, if none are read and Count>0 then
256
271
  InOutRes is set
257
272
}
258
273
var
259
 
  Result : Longint;
 
274
  Result : int64;
260
275
Begin
261
276
  BlockRead(f,Buf,Count,Result);
262
277
  If (InOutRes=0) and (Result<Count) and (Count>0) Then
264
279
End;
265
280
 
266
281
 
267
 
Function FilePos(var f:File):Longint;[IOCheck];
 
282
Function FilePos(var f:File):Int64;[IOCheck];
268
283
{
269
284
  Return current Position In file f in records
270
285
}
281
296
End;
282
297
 
283
298
 
284
 
Function FileSize(var f:File):Longint;[IOCheck];
 
299
Function FileSize(var f:File):Int64;[IOCheck];
285
300
{
286
301
  Return the size of file f in records
287
302
}
316
331
End;
317
332
 
318
333
 
319
 
Procedure Seek(var f:File;Pos:Longint);[IOCheck];
 
334
Procedure Seek(var f:File;Pos:Int64);[IOCheck];
320
335
{
321
336
  Goto record Pos in file f
322
337
}
330
345
  end;
331
346
End;
332
347
 
333
 
 
334
348
Procedure Truncate(Var f:File);[IOCheck];
335
349
{
336
350
  Truncate/Cut file f at the current record Position
410
424
  Rename(f,Pchar(@p));
411
425
End;
412
426
 
413
 
{
414
 
  $Log: file.inc,v $
415
 
  Revision 1.9  2005/02/14 17:13:22  peter
416
 
    * truncate log
417
 
 
418
 
}