~ubuntu-branches/ubuntu/dapper/fpc/dapper

« back to all changes in this revision

Viewing changes to rtl/darwin/unxfunc.inc

  • Committer: Bazaar Package Importer
  • Author(s): Carlos Laviola
  • Date: 2005-05-30 11:59:10 UTC
  • mfrom: (1.2.2 upstream)
  • Revision ID: james.westby@ubuntu.com-20050530115910-x5pbzm4qqta4i94h
Tags: 2.0.0-2
debian/fp-compiler.postinst.in: forgot to reapply the patch that
correctly creates the slave link to pc(1).  (Closes: #310907)

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
{
 
2
    $Id: unxfunc.inc,v 1.3 2005/03/25 22:53:39 jonas Exp $
 
3
    This file is part of the Free Component Library (FCL)
 
4
    Copyright (c) 1999-2000 by Peter Vreman
 
5
 
 
6
    Darwin temporary pclose/assignpipe implementation
 
7
 
 
8
    See the file COPYING.FPC, included in this distribution,
 
9
    for details about the copyright.
 
10
 
 
11
    This program is distributed in the hope that it will be useful,
 
12
    but WITHOUT ANY WARRANTY; without even the implied warranty of
 
13
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
 
14
 
 
15
 **********************************************************************}
 
16
 
 
17
 
 
18
 
 
19
Function PClose(Var F:file) : cint;
 
20
var
 
21
  pl : ^cint;
 
22
 
 
23
begin
 
24
  fpclose(filerec(F).Handle);
 
25
{ closed our side, Now wait for the other - this appears to be needed ?? }
 
26
  pl:=@(filerec(f).userdata[2]);
 
27
  pclose := WaitProcess(pl^);
 
28
end;
 
29
 
 
30
Function PClose(Var F:text) :cint;
 
31
var
 
32
  pl  : ^longint;
 
33
 
 
34
begin
 
35
  fpclose(Textrec(F).Handle);
 
36
{ closed our side, Now wait for the other - this appears to be needed ?? }
 
37
  pl:=@(textrec(f).userdata[2]);
 
38
  pclose:= WaitProcess(pl^);
 
39
end;
 
40
 
 
41
 
 
42
// can't have oldfpccall here, linux doesn't need it.
 
43
Function AssignPipe(var pipe_in,pipe_out:cint):cint; [public, alias : 'FPC_SYSC_ASSIGNPIPE'];
 
44
{
 
45
  Sets up a pair of file variables, which act as a pipe. The first one can
 
46
  be read from, the second one can be written to.
 
47
  If the operation was unsuccesful, linuxerror is set.
 
48
}
 
49
var
 
50
  ret  : longint;
 
51
  fdis : array[0..1] of cint;
 
52
begin
 
53
 fdis[0]:=pipe_in;
 
54
 fdis[1]:=pipe_out;
 
55
 ret:=pipe(fdis);
 
56
 pipe_in:=fdis[0];
 
57
 pipe_out:=fdis[1];
 
58
 AssignPipe:=ret;
 
59
end;
 
60
 
 
61
 
 
62
{
 
63
  $Log: unxfunc.inc,v $
 
64
  Revision 1.3  2005/03/25 22:53:39  jonas
 
65
    * fixed several warnings and notes about unused variables (mainly) or
 
66
      uninitialised use of variables/function results (a few)
 
67
 
 
68
  Revision 1.2  2005/02/14 17:13:22  peter
 
69
    * truncate log
 
70
 
 
71
  Revision 1.1  2005/02/13 21:47:56  peter
 
72
    * include file cleanup part 2
 
73
 
 
74
  Revision 1.1  2005/02/13 20:01:37  peter
 
75
    * include file cleanup
 
76
 
 
77
}