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

« back to all changes in this revision

Viewing changes to packages/extra/cdrom/cdromlin.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
uses
2
 
{$ifdef ver1_0}
3
 
  linux,
4
 
{$else}
5
2
  baseunix,
6
3
  unix,
7
 
{$endif}
8
4
  lincd;
9
5
 
10
6
Function ReadCDTOC(Device : String; Var CDTOC : Array of TTocEntry) : Integer;
15
11
  tocentry : tcdrom_tocentry;
16
12
 
17
13
begin
18
 
  drive:={$ifdef ver1_0}fdopen{$else}fpOpen{$endif}(Device, Open_RDONLY or Open_NONBLOCK);
 
14
  drive:=fpOpen(Device, Open_RDONLY or Open_NONBLOCK);
19
15
  if drive<0 then
20
16
    begin
21
17
    Result:=-1;
22
18
    Exit;
23
19
    end;
24
 
{$Ifdef ver1_0}
25
 
  if not ioctl(drive, CDROMREADTOCHDR, @tochdr) then
26
 
{$else}
27
20
  if fpioctl(drive, CDROMREADTOCHDR, @tochdr)<>0 then
28
 
{$endif}
29
21
    begin
30
22
    Result:=-1;
31
23
    Exit;
39
31
      begin
40
32
      tocentry.cdte_track := i;
41
33
      tocentry.cdte_format := CDROM_MSF;
42
 
      {$ifdef ver1_0}ioctl{$else}fpIOCtl{$endif}(drive, CDROMREADTOCENTRY, @tocentry);
 
34
      fpIOCtl(drive, CDROMREADTOCENTRY, @tocentry);
43
35
      // We should do some error checking here actually.
44
36
      With cdtoc[result] do
45
37
        begin
53
45
      end;
54
46
    tocentry.cdte_track := $AA;
55
47
    tocentry.cdte_format := CDROM_MSF;
56
 
    {$ifdef ver1_0}ioctl{$else}fpIOCtl{$endif}(drive, CDROMREADTOCENTRY, @tocentry);
 
48
    fpIOCtl(drive, CDROMREADTOCENTRY, @tocentry);
57
49
    With cdtoc[Result] do
58
50
      begin
59
51
      Min := tocentry.cdte_addr.msf.minute;
63
55
      inc(frame, sec*75);
64
56
      end;
65
57
    end;
66
 
  {$ifdef ver1_0}fdclose{$else}fpClose{$endif}(drive);
 
58
  fpClose(drive);
67
59
end;
68
60
 
69
61
{ ---------------------------------------------------------------------