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

« back to all changes in this revision

Viewing changes to rtl/unix/sockets.pp

  • 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
 
    $Id: sockets.pp,v 1.9 2004/03/16 18:03:37 marco Exp $
3
 
    This file is part of the Free Pascal run time library.
4
 
    Copyright (c) 1999-2000 by the Free Pascal development team
5
 
 
6
 
    See the file COPYING.FPC, included in this distribution,
7
 
    for details about the copyright.
8
 
 
9
 
    This program is distributed in the hope that it will be useful,
10
 
    but WITHOUT ANY WARRANTY; without even the implied warranty of
11
 
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
12
 
 
13
 
 **********************************************************************}
14
 
unit Sockets;
15
 
Interface
16
 
 
17
 
{$ifdef Unix}
18
 
Uses UnixType;
19
 
{$endif}
20
 
 
21
 
{$macro on}
22
 
{$DEFINE FPC_NEW_SOCKETS_UNIT}
23
 
{$ifdef FPC_USE_LIBC}
24
 
{   define maybelibc:=cdecl;external;}    // in future. Have to wrap now
25
 
{$endif}                                  // because of !@$!@#% socketerror
26
 
 
27
 
{$define maybelibc:=}
28
 
 
29
 
{$i unxsockh.inc}
30
 
{$i socketsh.inc}
31
 
 
32
 
type
33
 
  TUnixSockAddr = packed Record
34
 
                 {$ifdef SOCK_HAS_SINLEN}
35
 
                    sa_len     : cuchar;
36
 
                 {$endif}
37
 
                  family       : sa_family_t;
38
 
                  path:array[0..107] of char;    //104 total for freebsd.
39
 
                  end;                           
40
 
 
41
 
 
42
 
{ unix socket specific functions }
43
 
Procedure Str2UnixSockAddr(const addr:string;var t:TUnixSockAddr;var len:longint);
44
 
Function Bind(Sock:longint;const addr:string):boolean;
45
 
Function Connect(Sock:longint;const addr:string;var SockIn,SockOut:text):Boolean;
46
 
Function Connect(Sock:longint;const addr:string;var SockIn,SockOut:file):Boolean;
47
 
Function Accept(Sock:longint;var addr:string;var SockIn,SockOut:text):Boolean;
48
 
Function Accept(Sock:longint;var addr:string;var SockIn,SockOut:File):Boolean;
49
 
 
50
 
//function  fpaccept      (s:cint; addrx : psockaddr; addrlen : psocklen):cint; maybelibc
51
 
//function  fpbind      (s:cint; addrx : psockaddr; addrlen : tsocklen):cint;  maybelibc
52
 
//function  fpconnect     (s:cint; name  : psockaddr; namelen : tsocklen):cint;  maybelibc
53
 
 
54
 
Implementation
55
 
 
56
 
Uses BaseUnix,{$ifndef FPC_USE_LIBC}SysCall{$else}initc{$endif};
57
 
 
58
 
{ Include filerec and textrec structures }
59
 
{$i filerec.inc}
60
 
{$i textrec.inc}
61
 
{******************************************************************************
62
 
                          Kernel Socket Callings
63
 
******************************************************************************}
64
 
 
65
 
{$ifndef FPC_USE_LIBC}
66
 
{$i unixsock.inc} 
67
 
{$else}
68
 
{$i stdsock.inc}
69
 
{$endif}
70
 
{$i sockovl.inc}
71
 
{$i sockets.inc}
72
 
 
73
 
end.
74
 
 
75
 
{
76
 
  $Log: sockets.pp,v $
77
 
  Revision 1.9  2004/03/16 18:03:37  marco
78
 
   * first changes sockets units
79
 
 
80
 
  Revision 1.8  2003/11/25 15:13:28  marco
81
 
   * somebody added fields to socketsh.inc that were already under ifdef bsd
82
 
 
83
 
  Revision 1.7  2003/09/14 20:15:01  marco
84
 
   * Unix reform stage two. Remove all calls from Unix that exist in Baseunix.
85
 
 
86
 
  Revision 1.6  2002/09/07 16:01:27  peter
87
 
    * old logs removed and tabs fixed
88
 
 
89
 
}