Changeset 58ff82d in ada-examples


Ignore:
Timestamp:
Jul 8, 2008, 3:33:39 PM (11 years ago)
Author:
Joel Sherrill <joel.sherrill@…>
Branches:
ada-examples-4-10-branch, ada-examples-4-9-branch, master
Children:
68645f0
Parents:
f28fb20
Message:

2008-07-08 Joel Sherrill <joel.sherrill@…>

  • gen-soccon.c, gsocket.h, init.c: Update.
Location:
gen-soconn
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • gen-soconn/ChangeLog

    rf28fb20 r58ff82d  
     12008-07-08      Joel Sherrill <joel.sherrill@oarcorp.com>
     2
     3        * gen-soccon.c, gsocket.h, init.c: Update.
     4
    152008-02-06      Joel Sherrill <joel.sherrill@oarcorp.com>
    26
  • gen-soconn/gen-soccon.c

    rf28fb20 r58ff82d  
    55 *                           G E N - S O C C O N                            *
    66 *                                                                          *
    7  *          Copyright (C) 2004-2007, Free Software Foundation, Inc.         *
     7 *          Copyright (C) 2004-2008, Free Software Foundation, Inc.         *
    88 *                                                                          *
    99 * GNAT is free software;  you can  redistribute it  and/or modify it under *
     
    5252#include "gsocket.h"
    5353
     54typedef enum { NUM, TXT } kind_t;
     55
    5456struct line {
    5557  char *text;
    5658  char *value;
    5759  char *comment;
     60  kind_t kind;
    5861  struct line *next;
    5962};
     
    6164struct line *first = NULL, *last = NULL;
    6265
    63 #define TXT(_text) add_line(_text, NULL, NULL);
     66#define TXT(_text) add_line(_text, NULL, NULL, TXT);
    6467/* Plain text */
    6568
     
    7073#define itoax(n) f_itoa ("16#%08x#", (n))
    7174
    72 #define CND(name,comment) add_line(#name, itoad (name), comment);
     75#define CND(name,comment) add_line(#name, itoad (name), comment, NUM);
    7376/* Constant (decimal) */
    7477
    75 #define CNX(name,comment) add_line(#name, itoax (name), comment);
     78#define CNX(name,comment) add_line(#name, itoax (name), comment, NUM);
    7679/* Constant (hexadecimal) */
    7780
    78 #define CN_(name,comment) add_line(#name, name, comment);
     81#define CN_(name,comment) add_line(#name, name, comment, TXT);
    7982/* Constant (generic) */
    8083
     
    8891/* int to string */
    8992
    90 void add_line (char *, char*, char*);
     93void add_line (char *, char*, char*, kind_t);
    9194
    9295#ifdef __MINGW32__
     
    105108TXT("--                                 S p e c                                  --")
    106109TXT("--                                                                          --")
    107 TXT("--          Copyright (C) 2000-2007, Free Software Foundation, Inc.         --")
     110TXT("--          Copyright (C) 2000-2008, Free Software Foundation, Inc.         --")
    108111TXT("--                                                                          --")
    109112TXT("-- GNAT is free software;  you can  redistribute it  and/or modify it under --")
     
    138141TXT("--  make changes to gen-soccon.c and re-run it on each target.")
    139142_NL
     143TXT("with Interfaces.C;")
    140144TXT("package GNAT.Sockets.Constants is")
    141145_NL
     
    146150
    147151#ifndef AF_INET
    148 #define AF_INET -1
     152# define AF_INET -1
    149153#endif
    150154CND(AF_INET, "IPv4 address family")
    151155
    152156#ifndef AF_INET6
    153 #define AF_INET6 -1
     157# define AF_INET6 -1
     158#else
     159#ifndef __rtems__
     160# define HAVE_AF_INET6 1
     161#endif
    154162#endif
    155163CND(AF_INET6, "IPv6 address family")
     
    268276#define ELOOP -1
    269277#endif
    270 CND(ELOOP, "Too many symbolic lynks")
     278CND(ELOOP, "Too many symbolic links")
    271279
    272280#ifndef EMFILE
     
    573581#endif
    574582CND(IP_DROP_MEMBERSHIP, "Leave a multicast group")
     583
     584#ifndef IP_PKTINFO
     585#define IP_PKTINFO -1
     586#endif
     587CND(IP_PKTINFO, "Get datagram info")
    575588
    576589_NL
     
    600613CND(SIZEOF_tv_usec, "tv_usec")
    601614}
    602 
     615_NL
     616TXT("   --  Sizes of protocol specific address types (for sockaddr.sa_len)")
     617_NL
     618#define SIZEOF_sockaddr_in (sizeof (struct sockaddr_in))
     619CND(SIZEOF_sockaddr_in, "struct sockaddr_in")
     620#ifdef HAVE_AF_INET6
     621# define SIZEOF_sockaddr_in6 (sizeof (struct sockaddr_in6))
     622#else
     623# define SIZEOF_sockaddr_in6 0
     624#endif
     625CND(SIZEOF_sockaddr_in6, "struct sockaddr_in6")
     626_NL
     627TXT("   --  Size of file descriptor sets")
     628_NL
     629#define SIZEOF_fd_set (sizeof (fd_set))
     630CND(SIZEOF_fd_set, "fd_set");
     631_NL
     632TXT("   --  Fields of struct hostent")
     633_NL
     634#ifdef __MINGW32__
     635# define h_addrtype_t "short"
     636# define h_length_t   "short"
     637#else
     638# define h_addrtype_t "int"
     639# define h_length_t   "int"
     640#endif
     641TXT("   subtype H_Addrtype_T is Interfaces.C." h_addrtype_t ";")
     642TXT("   subtype H_Length_T   is Interfaces.C." h_length_t ";")
    603643_NL
    604644TXT("   ----------------------------------------")
     
    608648
    609649CND(Need_Netdb_Buffer, "Need buffer for Netdb ops")
     650CND(Has_Sockaddr_Len,  "Sockaddr has sa_len field")
     651_NL
     652TXT("   Thread_Blocking_IO : constant Boolean := True;")
     653TXT("   --  Set False for contexts where socket i/o are process blocking")
    610654
    611655#ifdef __vxworks
     
    635679CND(WSASYSNOTREADY,     "System not ready")
    636680CND(WSAVERNOTSUPPORTED, "Version not supported")
    637 CND(WSANOTINITIALISED,  "Winsock not intialized")
     681CND(WSANOTINITIALISED,  "Winsock not initialized")
    638682CND(WSAEDISCON,         "Disconnected")
    639 
    640 #endif
    641 
    642 _NL
    643 TXT("   ----------------------")
    644 TXT("   -- Additional flags --")
    645 TXT("   ----------------------")
    646 _NL
    647 TXT("   Thread_Blocking_IO : constant Boolean := True;")
    648 TXT("   --  Set False for contexts where socket i/o are process blocking")
     683#endif
    649684
    650685_NL
     
    668703    if (p->value != NULL) {
    669704      UPD_MAX(text);
    670       UPD_MAX(value);
     705      if (p->kind == NUM)
     706        UPD_MAX(value);
    671707    }
    672708  }
     
    696732
    697733void
    698 add_line (char *_text, char *_value, char *_comment) {
     734add_line (char *_text, char *_value, char *_comment, kind_t _kind) {
    699735  struct line *l = (struct line *) malloc (sizeof (struct line));
    700736
    701   l->text = _text;
    702   l->value = _value;
     737  l->text    = _text;
     738  l->value   = _value;
    703739  l->comment = _comment;
    704   l->next = NULL;
     740  l->kind    = _kind;
     741  l->next    = NULL;
     742
    705743  if (last == NULL)
    706744    first = last = l;
  • gen-soconn/gsocket.h

    rf28fb20 r58ff82d  
    77 *                              C Header File                               *
    88 *                                                                          *
    9  *         Copyright (C) 2004-2006, Free Software Foundation, Inc.          *
     9 *         Copyright (C) 2004-2008, Free Software Foundation, Inc.          *
    1010 *                                                                          *
    1111 * GNAT is free software;  you can  redistribute it  and/or modify it under *
     
    176176#if defined (_AIX) || defined (__FreeBSD__) || defined (__hpux__) || defined (__osf__) || defined (_WIN32) || defined (__APPLE__)
    177177# define HAVE_THREAD_SAFE_GETxxxBYyyy 1
    178 #elif defined (sgi) || defined (linux) || (defined (sun) && defined (__SVR4) && !defined (__vxworks))
     178#elif defined (sgi) || defined (linux) || defined (__GLIBC__) || (defined (sun) && defined (__SVR4) && !defined (__vxworks))
    179179# define HAVE_GETxxxBYyyy_R 1
    180180#endif
     
    185185# define Need_Netdb_Buffer 0
    186186#endif
     187
     188#if defined (__FreeBSD__) || defined (__vxworks) || defined (__rtems__)
     189# define Has_Sockaddr_Len 1
     190#else
     191# define Has_Sockaddr_Len 0
     192#endif
  • gen-soconn/init.c

    rf28fb20 r58ff82d  
    1818/* configuration information */
    1919
     20/* NOTICE: the clock driver is explicitly disabled */
     21#define CONFIGURE_APPLICATION_DOES_NOT_NEED_CLOCK_DRIVER
     22
    2023#define CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER
    2124
Note: See TracChangeset for help on using the changeset viewer.