home *** CD-ROM | disk | FTP | other *** search
/ RISCWORLD 7 / RISCWORLD_VOL7.iso / Software / Issue4 / SDL / gcc346 / !gcc / include / unixlib / bits / h / sockaddr < prev    next >
Encoding:
Text File  |  2006-09-17  |  2.4 KB  |  74 lines

  1. /****************************************************************************
  2.  *
  3.  * $Source: /usr/local/cvsroot/gccsdk/unixlib/source/clib/bits/sockaddr.h,v $
  4.  * $Date: 2002/12/22 18:22:28 $
  5.  * $Revision: 1.1 $
  6.  * $State: Exp $
  7.  * $Author: admin $
  8.  *
  9.  ***************************************************************************/
  10.  
  11. /*
  12.  * File taken from glibc 2.2.5.
  13.  * Following changes were made:
  14.  *  - Added #define test on __UNIXLIB_COMPAT_INET4 (equivalent to
  15.  *    COMPAT_INET4 in Acorn's TCPIPLibs).
  16.  */
  17.  
  18. /* Definition of `struct sockaddr_*' common members.  4.4 BSD version.
  19.    Copyright (C) 1995, 1996, 1997, 1998, 2001 Free Software Foundation, Inc.
  20.    This file is part of the GNU C Library.
  21.  
  22.    The GNU C Library is free software; you can redistribute it and/or
  23.    modify it under the terms of the GNU Lesser General Public
  24.    License as published by the Free Software Foundation; either
  25.    version 2.1 of the License, or (at your option) any later version.
  26.  
  27.    The GNU C Library is distributed in the hope that it will be useful,
  28.    but WITHOUT ANY WARRANTY; without even the implied warranty of
  29.    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
  30.    Lesser General Public License for more details.
  31.  
  32.    You should have received a copy of the GNU Lesser General Public
  33.    License along with the GNU C Library; if not, write to the Free
  34.    Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
  35.    02111-1307 USA.  */
  36.  
  37. /*
  38.  * Never include this file directly; use <sys/socket.h> instead.
  39.  */
  40.  
  41. #ifndef __BITS_SOCKADDR_H
  42. #define __BITS_SOCKADDR_H    1
  43.  
  44.  
  45. /* POSIX.1g specifies this type name for the `sa_family' member.  */
  46. #if __UNIXLIB_COMPAT_INET4
  47. typedef unsigned short sa_family_t;
  48. #else
  49. typedef unsigned char sa_family_t;
  50. #endif
  51.  
  52. /* This macro is used to declare the initial common members
  53.    of the data types used for socket addresses, `struct sockaddr',
  54.    `struct sockaddr_in', `struct sockaddr_un', etc.  */
  55.  
  56. #if __UNIXLIB_COMPAT_INET4
  57. #define    __SOCKADDR_COMMON(sa_prefix)    \
  58.   sa_family_t sa_prefix##family
  59.  
  60. #define __SOCKADDR_COMMON_SIZE    (sizeof (sa_family_t))
  61.  
  62. #define _HAVE_SA_LEN    0    /* We don't have the sa_len field.  */
  63. #else
  64. #define    __SOCKADDR_COMMON(sa_prefix)    \
  65.   unsigned char sa_prefix##len;        \
  66.   sa_family_t sa_prefix##family
  67.  
  68. #define __SOCKADDR_COMMON_SIZE    (2 * sizeof (unsigned char))
  69.  
  70. #define _HAVE_SA_LEN    1    /* We have the sa_len field.  */
  71. #endif
  72.  
  73. #endif    /* bits/sockaddr.h */
  74.