~ubuntu-branches/debian/lenny/fpc/lenny

« back to all changes in this revision

Viewing changes to fpcsrc/packages/base/libc/libio.inc

  • Committer: Bazaar Package Importer
  • Author(s): Mazen Neifer, Torsten Werner, Mazen Neifer
  • Date: 2008-05-17 17:12:11 UTC
  • mfrom: (3.1.9 intrepid)
  • Revision ID: james.westby@ubuntu.com-20080517171211-9qi33xhd9evfa0kg
Tags: 2.2.0-dfsg1-9
[ Torsten Werner ]
* Add Mazen Neifer to Uploaders field.

[ Mazen Neifer ]
* Moved FPC sources into a version dependent directory from /usr/share/fpcsrc
  to /usr/share/fpcsrc/${FPCVERSION}. This allow installing more than on FPC
  release.
* Fixed far call issue in compiler preventing building huge binearies.
  (closes: #477743)
* Updated building dependencies, recomennded and suggested packages.
* Moved fppkg to fp-utils as it is just a helper tool and is not required by
  compiler.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
{ ---------------------------------------------------------------------
 
2
    Macros from libio.h
 
3
  ---------------------------------------------------------------------}
 
4
 
 
5
Function _IO_getc_unlocked(_fp: P_IO_FILE): longint;
 
6
begin
 
7
  if _fp^._IO_read_ptr>=_fp^._IO_read_end then
 
8
    Result:=__uflow(_fp)
 
9
  else
 
10
    begin
 
11
    Result:=PByte(_fp^._IO_read_ptr)^;
 
12
    Inc(_fp^._IO_read_ptr);
 
13
    end;
 
14
end;
 
15
 
 
16
 
 
17
Function _IO_peekc_unlocked(_fp: P_IO_FILE): longint;
 
18
begin
 
19
  if (_fp^._IO_read_ptr>=_fp^._IO_read_end) and (__underflow(_fp) = __EOF) then
 
20
    Result:=__EOF
 
21
  else
 
22
    Result:=PByte(_fp^._IO_read_ptr)^;
 
23
end;
 
24
 
 
25
 
 
26
Function _IO_putc_unlocked(_ch: Char; _fp: P_IO_FILE): longint;
 
27
begin
 
28
  if _fp^._IO_write_ptr>=_fp^._IO_write_end then
 
29
    Result:=__overflow(_fp, Byte(_ch))
 
30
  else
 
31
    begin
 
32
    Result:=Byte(_ch);
 
33
    _fp^._IO_write_ptr^:=_ch;
 
34
    Inc(_fp^._IO_write_ptr);
 
35
    end;
 
36
end;
 
37
 
 
38
 
 
39
Function _IO_getwc_unlocked(_fp: P_IO_FILE): longint;
 
40
begin
 
41
  if Cardinal(_fp^._wide_data^._IO_read_ptr)>=Cardinal(_fp^._wide_data^._IO_read_end) then
 
42
    Result:=__wuflow(_fp)
 
43
  else
 
44
    begin
 
45
//!! MVC    Result:=_fp^._wide_data^._IO_read_ptr^;
 
46
    Inc(_fp^._wide_data^._IO_read_ptr);
 
47
    end;
 
48
end;
 
49
 
 
50
 
 
51
Function _IO_putwc_unlocked(_wch: wchar_t; _fp: P_IO_FILE): longint;
 
52
begin
 
53
{ //!! MVC
 
54
  if Cardinal(_fp^._wide_data^._IO_write_ptr)>=Cardinal(_fp^._wide_data^._IO_write_end) then
 
55
    Result:=__woverflow(_fp, _wch)
 
56
  else
 
57
    begin
 
58
    Result:=_wch;
 
59
    _fp^._wide_data^._IO_write_ptr^:=_wch;
 
60
    Inc(_fp^._wide_data^._IO_write_ptr);
 
61
    end;
 
62
}
 
63
end;
 
64
 
 
65
 
 
66
Function _IO_feof_unlocked(_fp: P_IO_FILE): longint;
 
67
begin
 
68
  Result:=Ord((_fp^._flags and _IO_EOF_SEEN)<>0);
 
69
end;
 
70
 
 
71
 
 
72
Function _IO_ferror_unlocked(_fp: P_IO_FILE): longint;
 
73
begin
 
74
  Result:=Ord((_fp^._flags and _IO_ERR_SEEN)<>0);
 
75
end;
 
76
 
 
77
 
 
78
Function _IO_PENDING_OUTPUT_COUNT(_fp: P_IO_FILE): longint;
 
79
begin
 
80
  Result:=(_fp^._IO_write_ptr)-(_fp^._IO_write_base);
 
81
end;
 
82
 
 
83