[Pkg-ofed-commits] r217 - libsdp/branches/upstream/current/src

gmpc-guest at alioth.debian.org gmpc-guest at alioth.debian.org
Sun Mar 15 09:30:43 UTC 2009


Author: gmpc-guest
Date: 2009-03-15 09:30:43 +0000 (Sun, 15 Mar 2009)
New Revision: 217

Modified:
   libsdp/branches/upstream/current/src/Makefile.am
   libsdp/branches/upstream/current/src/Makefile.in
   libsdp/branches/upstream/current/src/config_parser.c
   libsdp/branches/upstream/current/src/config_parser.h
   libsdp/branches/upstream/current/src/config_parser.y
   libsdp/branches/upstream/current/src/config_scanner.c
   libsdp/branches/upstream/current/src/config_scanner.l
   libsdp/branches/upstream/current/src/log.c
   libsdp/branches/upstream/current/src/port.c
Log:
Upstream source has been magled; commit pristene versions


Modified: libsdp/branches/upstream/current/src/Makefile.am
===================================================================
--- libsdp/branches/upstream/current/src/Makefile.am	2009-03-14 14:26:29 UTC (rev 216)
+++ libsdp/branches/upstream/current/src/Makefile.am	2009-03-15 09:30:43 UTC (rev 217)
@@ -13,12 +13,12 @@
 EXTRA_DIST = libsdp.h sdp_inet.h config_parser.h
 
 config_parser.c: @MAINTAINER_MODE_TRUE@ $(srcdir)/config_parser.y
-	$(YACC) -y -d $(srcdir)/config_parser.y
+	$(YACC) -y -plibsdp_yy -d $(srcdir)/config_parser.y
 	mv y.tab.c config_parser.c
 	mv y.tab.h config_parser.h
 	cp -f config_parser.c config_parser.h $(srcdir)/
 
 config_scanner.c: @MAINTAINER_MODE_TRUE@ $(srcdir)/config_scanner.l
-	$(LEX) $(srcdir)/config_scanner.l 
-	mv lex.yy.c config_scanner.c
+	$(LEX) -Plibsdp_yy $(srcdir)/config_scanner.l 
+	mv lex.libsdp_yy.c config_scanner.c
 	cp -f config_scanner.c $(srcdir)/config_scanner.c

Modified: libsdp/branches/upstream/current/src/Makefile.in
===================================================================
--- libsdp/branches/upstream/current/src/Makefile.in	2009-03-14 14:26:29 UTC (rev 216)
+++ libsdp/branches/upstream/current/src/Makefile.in	2009-03-15 09:30:43 UTC (rev 217)
@@ -473,14 +473,14 @@
 
 
 config_parser.c: @MAINTAINER_MODE_TRUE@ $(srcdir)/config_parser.y
-	$(YACC) -y -d $(srcdir)/config_parser.y
+	$(YACC) -y -plibsdp_yy -d $(srcdir)/config_parser.y
 	mv y.tab.c config_parser.c
 	mv y.tab.h config_parser.h
 	cp -f config_parser.c config_parser.h $(srcdir)/
 
 config_scanner.c: @MAINTAINER_MODE_TRUE@ $(srcdir)/config_scanner.l
-	$(LEX) $(srcdir)/config_scanner.l 
-	mv lex.yy.c config_scanner.c
+	$(LEX) -Plibsdp_yy $(srcdir)/config_scanner.l 
+	mv lex.libsdp_yy.c config_scanner.c
 	cp -f config_scanner.c $(srcdir)/config_scanner.c
 # Tell versions [3.59,3.63) of GNU make to not export all variables.
 # Otherwise a system limit (for SysV at least) may be exceeded.

Modified: libsdp/branches/upstream/current/src/config_parser.c
===================================================================
--- libsdp/branches/upstream/current/src/config_parser.c	2009-03-14 14:26:29 UTC (rev 216)
+++ libsdp/branches/upstream/current/src/config_parser.c	2009-03-15 09:30:43 UTC (rev 217)
@@ -1,8 +1,10 @@
-/* A Bison parser, made by GNU Bison 1.875c.  */
+/* A Bison parser, made by GNU Bison 2.3.  */
 
-/* Skeleton parser for Yacc-like parsing with Bison,
-   Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003 Free Software Foundation, Inc.
+/* Skeleton implementation for Bison's Yacc-like parsers in C
 
+   Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004, 2005, 2006
+   Free Software Foundation, Inc.
+
    This program is free software; you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
    the Free Software Foundation; either version 2, or (at your option)
@@ -15,17 +17,25 @@
 
    You should have received a copy of the GNU General Public License
    along with this program; if not, write to the Free Software
-   Foundation, Inc., 59 Temple Place - Suite 330,
-   Boston, MA 02111-1307, USA.  */
+   Foundation, Inc., 51 Franklin Street, Fifth Floor,
+   Boston, MA 02110-1301, USA.  */
 
-/* As a special exception, when this file is copied by Bison into a
-   Bison output file, you may use that output file without restriction.
-   This special exception was added by the Free Software Foundation
-   in version 1.24 of Bison.  */
+/* As a special exception, you may create a larger work that contains
+   part or all of the Bison parser skeleton and distribute that work
+   under terms of your choice, so long as that work isn't itself a
+   parser generator using the skeleton or a modified version thereof
+   as a parser skeleton.  Alternatively, if you modify or redistribute
+   the parser skeleton itself, you may (at your option) remove this
+   special exception, which will cause the skeleton and the resulting
+   Bison output files to be licensed under the GNU General Public
+   License without this special exception.
 
-/* Written by Richard Stallman by simplifying the original so called
-   ``semantic'' parser.  */
+   This special exception was added by the Free Software Foundation in
+   version 2.2 of Bison.  */
 
+/* C LALR(1) parser skeleton written by Richard Stallman, by
+   simplifying the original so-called "semantic" parser.  */
+
 /* All symbols defined below should begin with yy or YY, to avoid
    infringing on user name space.  This should be done even for local
    variables, as they might otherwise be expanded by user macros.
@@ -36,6 +46,9 @@
 /* Identify Bison output.  */
 #define YYBISON 1
 
+/* Bison version.  */
+#define YYBISON_VERSION "2.3"
+
 /* Skeleton name.  */
 #define YYSKELETON_NAME "yacc.c"
 
@@ -45,6 +58,14 @@
 /* Using locations.  */
 #define YYLSP_NEEDED 0
 
+/* Substitute the variable and function names.  */
+#define yyparse libsdp_yyparse
+#define yylex   libsdp_yylex
+#define yyerror libsdp_yyerror
+#define yylval  libsdp_yylval
+#define yychar  libsdp_yychar
+#define yydebug libsdp_yydebug
+#define yynerrs libsdp_yynerrs
 
 
 /* Tokens.  */
@@ -70,6 +91,7 @@
      LINE = 272
    };
 #endif
+/* Tokens.  */
 #define USE 258
 #define CLIENT 259
 #define SERVER 260
@@ -90,50 +112,9 @@
 
 
 /* Copy the first part of user declarations.  */
-#line 39 "/home/eitan/SW/SVN/gen2_libsdp/libsdp/src/config_parser.y"
+#line 39 "./config_parser.y"
 
 
-#define	yymaxdepth libsdp_maxdepth
-#define	yyparse	libsdp_parse
-#define	yylex	libsdp_lex
-#define	yyerror	libsdp_error
-#define	yylval	libsdp_lval
-#define	yychar	libsdp_char
-#define	yydebug	libsdp_debug
-#define	yypact	libsdp_pact
-#define	yyr1	libsdp_r1
-#define	yyr2	libsdp_r2
-#define	yydef	libsdp_def
-#define	yychk	libsdp_chk
-#define	yypgo	libsdp_pgo
-#define	yyact	libsdp_act
-#define	yyexca	libsdp_exca
-#define  yyerrflag libsdp_errflag
-#define  yynerrs	libsdp_nerrs
-#define	yyps	libsdp_ps
-#define	yypv	libsdp_pv
-#define	yys	libsdp_s
-#define	yy_yys	libsdp_yys
-#define	yystate	libsdp_state
-#define	yytmp	libsdp_tmp
-#define	yyv	libsdp_v
-#define	yy_yyv	libsdp_yyv
-#define	yyval	libsdp_val
-#define	yylloc	libsdp_lloc
-#define yyreds	libsdp_reds
-#define yytoks	libsdp_toks
-#define yylhs	libsdp_yylhs
-#define yylen	libsdp_yylen
-#define yydefred libsdp_yydefred
-#define yydgoto	libsdp_yydgoto
-#define yysindex libsdp_yysindex
-#define yyrindex libsdp_yyrindex
-#define yygindex libsdp_yygindex
-#define yytable	 libsdp_yytable
-#define yycheck	 libsdp_yycheck
-#define yyname   libsdp_yyname
-#define yyrule   libsdp_yyrule
-
 /* header section */
 #include <stdlib.h>
 #include <stdio.h>
@@ -272,14 +253,21 @@
 # define YYERROR_VERBOSE 1
 #endif
 
-#if ! defined (YYSTYPE) && ! defined (YYSTYPE_IS_DECLARED)
-#line 208 "/home/eitan/SW/SVN/gen2_libsdp/libsdp/src/config_parser.y"
-typedef union YYSTYPE {
+/* Enabling the token table.  */
+#ifndef YYTOKEN_TABLE
+# define YYTOKEN_TABLE 0
+#endif
+
+#if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED
+typedef union YYSTYPE
+#line 167 "./config_parser.y"
+{
   int        ival;
   char      *sval;
-} YYSTYPE;
-/* Line 191 of yacc.c.  */
-#line 283 "y.tab.c"
+}
+/* Line 193 of yacc.c.  */
+#line 270 "y.tab.c"
+	YYSTYPE;
 # define yystype YYSTYPE /* obsolescent; will be withdrawn */
 # define YYSTYPE_IS_DECLARED 1
 # define YYSTYPE_IS_TRIVIAL 1
@@ -288,61 +276,176 @@
 
 
 /* Copy the second part of user declarations.  */
-#line 233 "/home/eitan/SW/SVN/gen2_libsdp/libsdp/src/config_parser.y"
+#line 192 "./config_parser.y"
 
   long __sdp_config_line_num;
 
 
-/* Line 214 of yacc.c.  */
-#line 298 "y.tab.c"
+/* Line 216 of yacc.c.  */
+#line 286 "y.tab.c"
 
-#if ! defined (yyoverflow) || YYERROR_VERBOSE
+#ifdef short
+# undef short
+#endif
 
-# ifndef YYFREE
-#  define YYFREE free
+#ifdef YYTYPE_UINT8
+typedef YYTYPE_UINT8 yytype_uint8;
+#else
+typedef unsigned char yytype_uint8;
+#endif
+
+#ifdef YYTYPE_INT8
+typedef YYTYPE_INT8 yytype_int8;
+#elif (defined __STDC__ || defined __C99__FUNC__ \
+     || defined __cplusplus || defined _MSC_VER)
+typedef signed char yytype_int8;
+#else
+typedef short int yytype_int8;
+#endif
+
+#ifdef YYTYPE_UINT16
+typedef YYTYPE_UINT16 yytype_uint16;
+#else
+typedef unsigned short int yytype_uint16;
+#endif
+
+#ifdef YYTYPE_INT16
+typedef YYTYPE_INT16 yytype_int16;
+#else
+typedef short int yytype_int16;
+#endif
+
+#ifndef YYSIZE_T
+# ifdef __SIZE_TYPE__
+#  define YYSIZE_T __SIZE_TYPE__
+# elif defined size_t
+#  define YYSIZE_T size_t
+# elif ! defined YYSIZE_T && (defined __STDC__ || defined __C99__FUNC__ \
+     || defined __cplusplus || defined _MSC_VER)
+#  include <stddef.h> /* INFRINGES ON USER NAME SPACE */
+#  define YYSIZE_T size_t
+# else
+#  define YYSIZE_T unsigned int
 # endif
-# ifndef YYMALLOC
-#  define YYMALLOC malloc
+#endif
+
+#define YYSIZE_MAXIMUM ((YYSIZE_T) -1)
+
+#ifndef YY_
+# if YYENABLE_NLS
+#  if ENABLE_NLS
+#   include <libintl.h> /* INFRINGES ON USER NAME SPACE */
+#   define YY_(msgid) dgettext ("bison-runtime", msgid)
+#  endif
 # endif
+# ifndef YY_
+#  define YY_(msgid) msgid
+# endif
+#endif
 
+/* Suppress unused-variable warnings by "using" E.  */
+#if ! defined lint || defined __GNUC__
+# define YYUSE(e) ((void) (e))
+#else
+# define YYUSE(e) /* empty */
+#endif
+
+/* Identity function, used to suppress warnings about constant conditions.  */
+#ifndef lint
+# define YYID(n) (n)
+#else
+#if (defined __STDC__ || defined __C99__FUNC__ \
+     || defined __cplusplus || defined _MSC_VER)
+static int
+YYID (int i)
+#else
+static int
+YYID (i)
+    int i;
+#endif
+{
+  return i;
+}
+#endif
+
+#if ! defined yyoverflow || YYERROR_VERBOSE
+
 /* The parser invokes alloca or malloc; define the necessary symbols.  */
 
 # ifdef YYSTACK_USE_ALLOCA
 #  if YYSTACK_USE_ALLOCA
-#   define YYSTACK_ALLOC alloca
-#  endif
-# else
-#  if defined (alloca) || defined (_ALLOCA_H)
-#   define YYSTACK_ALLOC alloca
-#  else
 #   ifdef __GNUC__
 #    define YYSTACK_ALLOC __builtin_alloca
+#   elif defined __BUILTIN_VA_ARG_INCR
+#    include <alloca.h> /* INFRINGES ON USER NAME SPACE */
+#   elif defined _AIX
+#    define YYSTACK_ALLOC __alloca
+#   elif defined _MSC_VER
+#    include <malloc.h> /* INFRINGES ON USER NAME SPACE */
+#    define alloca _alloca
+#   else
+#    define YYSTACK_ALLOC alloca
+#    if ! defined _ALLOCA_H && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \
+     || defined __cplusplus || defined _MSC_VER)
+#     include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
+#     ifndef _STDLIB_H
+#      define _STDLIB_H 1
+#     endif
+#    endif
 #   endif
 #  endif
 # endif
 
 # ifdef YYSTACK_ALLOC
-   /* Pacify GCC's `empty if-body' warning. */
-#  define YYSTACK_FREE(Ptr) do { /* empty */; } while (0)
+   /* Pacify GCC's `empty if-body' warning.  */
+#  define YYSTACK_FREE(Ptr) do { /* empty */; } while (YYID (0))
+#  ifndef YYSTACK_ALLOC_MAXIMUM
+    /* The OS might guarantee only one guard page at the bottom of the stack,
+       and a page size can be as small as 4096 bytes.  So we cannot safely
+       invoke alloca (N) if N exceeds 4096.  Use a slightly smaller number
+       to allow for a few compiler-allocated temporary stack slots.  */
+#   define YYSTACK_ALLOC_MAXIMUM 4032 /* reasonable circa 2006 */
+#  endif
 # else
-#  if defined (__STDC__) || defined (__cplusplus)
+#  define YYSTACK_ALLOC YYMALLOC
+#  define YYSTACK_FREE YYFREE
+#  ifndef YYSTACK_ALLOC_MAXIMUM
+#   define YYSTACK_ALLOC_MAXIMUM YYSIZE_MAXIMUM
+#  endif
+#  if (defined __cplusplus && ! defined _STDLIB_H \
+       && ! ((defined YYMALLOC || defined malloc) \
+	     && (defined YYFREE || defined free)))
 #   include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
-#   define YYSIZE_T size_t
+#   ifndef _STDLIB_H
+#    define _STDLIB_H 1
+#   endif
 #  endif
-#  define YYSTACK_ALLOC YYMALLOC
-#  define YYSTACK_FREE YYFREE
+#  ifndef YYMALLOC
+#   define YYMALLOC malloc
+#   if ! defined malloc && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \
+     || defined __cplusplus || defined _MSC_VER)
+void *malloc (YYSIZE_T); /* INFRINGES ON USER NAME SPACE */
+#   endif
+#  endif
+#  ifndef YYFREE
+#   define YYFREE free
+#   if ! defined free && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \
+     || defined __cplusplus || defined _MSC_VER)
+void free (void *); /* INFRINGES ON USER NAME SPACE */
+#   endif
+#  endif
 # endif
-#endif /* ! defined (yyoverflow) || YYERROR_VERBOSE */
+#endif /* ! defined yyoverflow || YYERROR_VERBOSE */
 
 
-#if (! defined (yyoverflow) \
-     && (! defined (__cplusplus) \
-	 || (defined (YYSTYPE_IS_TRIVIAL) && YYSTYPE_IS_TRIVIAL)))
+#if (! defined yyoverflow \
+     && (! defined __cplusplus \
+	 || (defined YYSTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL)))
 
 /* A type that is properly aligned for any stack member.  */
 union yyalloc
 {
-  short yyss;
+  yytype_int16 yyss;
   YYSTYPE yyvs;
   };
 
@@ -352,24 +455,24 @@
 /* The size of an array large to enough to hold all stacks, each with
    N elements.  */
 # define YYSTACK_BYTES(N) \
-     ((N) * (sizeof (short) + sizeof (YYSTYPE))				\
+     ((N) * (sizeof (yytype_int16) + sizeof (YYSTYPE)) \
       + YYSTACK_GAP_MAXIMUM)
 
 /* Copy COUNT objects from FROM to TO.  The source and destination do
    not overlap.  */
 # ifndef YYCOPY
-#  if defined (__GNUC__) && 1 < __GNUC__
+#  if defined __GNUC__ && 1 < __GNUC__
 #   define YYCOPY(To, From, Count) \
       __builtin_memcpy (To, From, (Count) * sizeof (*(From)))
 #  else
 #   define YYCOPY(To, From, Count)		\
       do					\
 	{					\
-	  register YYSIZE_T yyi;		\
+	  YYSIZE_T yyi;				\
 	  for (yyi = 0; yyi < (Count); yyi++)	\
 	    (To)[yyi] = (From)[yyi];		\
 	}					\
-      while (0)
+      while (YYID (0))
 #  endif
 # endif
 
@@ -387,39 +490,33 @@
 	yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \
 	yyptr += yynewbytes / sizeof (*yyptr);				\
       }									\
-    while (0)
+    while (YYID (0))
 
 #endif
 
-#if defined (__STDC__) || defined (__cplusplus)
-   typedef signed char yysigned_char;
-#else
-   typedef short yysigned_char;
-#endif
-
-/* YYFINAL -- State number of the termination state. */
+/* YYFINAL -- State number of the termination state.  */
 #define YYFINAL  7
 /* YYLAST -- Last index in YYTABLE.  */
 #define YYLAST   36
 
-/* YYNTOKENS -- Number of terminals. */
+/* YYNTOKENS -- Number of terminals.  */
 #define YYNTOKENS  23
-/* YYNNTS -- Number of nonterminals. */
+/* YYNNTS -- Number of nonterminals.  */
 #define YYNNTS  17
-/* YYNRULES -- Number of rules. */
+/* YYNRULES -- Number of rules.  */
 #define YYNRULES  33
-/* YYNRULES -- Number of states. */
+/* YYNRULES -- Number of states.  */
 #define YYNSTATES  53
 
 /* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX.  */
 #define YYUNDEFTOK  2
 #define YYMAXUTOK   272
 
-#define YYTRANSLATE(YYX) 						\
+#define YYTRANSLATE(YYX)						\
   ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK)
 
 /* YYTRANSLATE[YYLEX] -- Bison symbol number corresponding to YYLEX.  */
-static const unsigned char yytranslate[] =
+static const yytype_uint8 yytranslate[] =
 {
        0,     2,     2,     2,     2,     2,     2,     2,     2,     2,
        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
@@ -454,7 +551,7 @@
 #if YYDEBUG
 /* YYPRHS[YYN] -- Index of the first RHS symbol of rule number YYN in
    YYRHS.  */
-static const unsigned char yyprhs[] =
+static const yytype_uint8 yyprhs[] =
 {
        0,     0,     3,     5,     8,     9,    11,    14,    15,    18,
       20,    22,    26,    27,    30,    33,    36,    39,    43,    46,
@@ -462,8 +559,8 @@
       77,    85,    87,    91
 };
 
-/* YYRHS -- A `-1'-separated list of the rules' RHS. */
-static const yysigned_char yyrhs[] =
+/* YYRHS -- A `-1'-separated list of the rules' RHS.  */
+static const yytype_int8 yyrhs[] =
 {
       26,     0,    -1,    17,    -1,    24,    17,    -1,    -1,    24,
       -1,    25,    27,    -1,    -1,    27,    28,    -1,    29,    -1,
@@ -478,18 +575,18 @@
 };
 
 /* YYRLINE[YYN] -- source line where rule number YYN was defined.  */
-static const unsigned short yyrline[] =
+static const yytype_uint16 yyrline[] =
 {
-       0,   239,   239,   240,   242,   243,   246,   249,   250,   254,
-     255,   259,   262,   263,   264,   268,   269,   270,   274,   278,
-     282,   283,   284,   288,   289,   293,   294,   298,   299,   300,
-     304,   308,   309,   310
+       0,   198,   198,   199,   201,   202,   205,   208,   209,   213,
+     214,   218,   221,   222,   223,   227,   228,   229,   233,   237,
+     241,   242,   243,   247,   248,   252,   253,   257,   258,   259,
+     263,   267,   268,   269
 };
 #endif
 
-#if YYDEBUG || YYERROR_VERBOSE
-/* YYTNME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM.
-   First, the terminals, then, starting at YYNTOKENS, nonterminals. */
+#if YYDEBUG || YYERROR_VERBOSE || YYTOKEN_TABLE
+/* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM.
+   First, the terminals, then, starting at YYNTOKENS, nonterminals.  */
 static const char *const yytname[] =
 {
   "$end", "error", "$undefined", "\"use\"", "\"client or connect\"",
@@ -506,7 +603,7 @@
 # ifdef YYPRINT
 /* YYTOKNUM[YYLEX-NUM] -- Internal token number corresponding to
    token YYLEX-NUM.  */
-static const unsigned short yytoknum[] =
+static const yytype_uint16 yytoknum[] =
 {
        0,   256,   257,   258,   259,   260,   261,   262,   263,   264,
      265,   266,   267,   268,   269,   270,   271,   272,    58,    42,
@@ -515,7 +612,7 @@
 # endif
 
 /* YYR1[YYN] -- Symbol number of symbol that rule YYN derives.  */
-static const unsigned char yyr1[] =
+static const yytype_uint8 yyr1[] =
 {
        0,    23,    24,    24,    25,    25,    26,    27,    27,    28,
       28,    29,    30,    30,    30,    31,    31,    31,    32,    33,
@@ -524,7 +621,7 @@
 };
 
 /* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN.  */
-static const unsigned char yyr2[] =
+static const yytype_uint8 yyr2[] =
 {
        0,     2,     1,     2,     0,     1,     2,     0,     2,     1,
        1,     3,     0,     2,     2,     2,     2,     3,     2,     8,
@@ -535,7 +632,7 @@
 /* YYDEFACT[STATE-NAME] -- Default rule to reduce with in state
    STATE-NUM when YYTABLE doesn't specify something else to do.  Zero
    means the default is an error.  */
-static const unsigned char yydefact[] =
+static const yytype_uint8 yydefact[] =
 {
        4,     2,     5,     7,     0,     3,     6,     1,     0,    12,
        8,     9,    10,    20,    21,    22,     0,     0,    24,    23,
@@ -545,8 +642,8 @@
       32,     0,    30
 };
 
-/* YYDEFGOTO[NTERM-NUM]. */
-static const yysigned_char yydefgoto[] =
+/* YYDEFGOTO[NTERM-NUM].  */
+static const yytype_int8 yydefgoto[] =
 {
       -1,     2,     3,     4,     6,    10,    11,    17,    24,    25,
       12,    16,    20,    28,    35,    36,    44
@@ -555,7 +652,7 @@
 /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing
    STATE-NUM.  */
 #define YYPACT_NINF -18
-static const yysigned_char yypact[] =
+static const yytype_int8 yypact[] =
 {
      -13,   -18,     4,   -18,    22,   -18,     0,   -18,     9,   -18,
      -18,   -18,   -18,   -18,   -18,   -18,     2,    -3,   -18,   -18,
@@ -566,7 +663,7 @@
 };
 
 /* YYPGOTO[NTERM-NUM].  */
-static const yysigned_char yypgoto[] =
+static const yytype_int8 yypgoto[] =
 {
      -18,   -17,   -18,   -18,   -18,   -18,   -18,   -18,   -18,   -18,
      -18,   -18,   -18,   -18,   -18,   -18,   -18
@@ -577,7 +674,7 @@
    number is the opposite.  If zero, do what YYDEFACT says.
    If YYTABLE_NINF, syntax error.  */
 #define YYTABLE_NINF -1
-static const unsigned char yytable[] =
+static const yytype_uint8 yytable[] =
 {
       23,    33,    42,     8,     1,    26,    18,    19,    21,    27,
        9,    34,    43,    22,     1,    13,    14,    15,    29,    30,
@@ -585,7 +682,7 @@
       49,    40,    50,    46,    52,    47,    51
 };
 
-static const unsigned char yycheck[] =
+static const yytype_uint8 yycheck[] =
 {
       17,     9,     9,     3,    17,    15,     4,     5,    11,    19,
       10,    19,    19,    16,    17,     6,     7,     8,    12,    13,
@@ -595,7 +692,7 @@
 
 /* YYSTOS[STATE-NUM] -- The (internal number of the) accessing
    symbol of state STATE-NUM.  */
-static const unsigned char yystos[] =
+static const yytype_uint8 yystos[] =
 {
        0,    17,    24,    25,    26,    17,    27,     0,     3,    10,
       28,    29,    33,     6,     7,     8,    34,    30,     4,     5,
@@ -605,22 +702,6 @@
        9,    21,     9
 };
 
-#if ! defined (YYSIZE_T) && defined (__SIZE_TYPE__)
-# define YYSIZE_T __SIZE_TYPE__
-#endif
-#if ! defined (YYSIZE_T) && defined (size_t)
-# define YYSIZE_T size_t
-#endif
-#if ! defined (YYSIZE_T)
-# if defined (__STDC__) || defined (__cplusplus)
-#  include <stddef.h> /* INFRINGES ON USER NAME SPACE */
-#  define YYSIZE_T size_t
-# endif
-#endif
-#if ! defined (YYSIZE_T)
-# define YYSIZE_T unsigned int
-#endif
-
 #define yyerrok		(yyerrstatus = 0)
 #define yyclearin	(yychar = YYEMPTY)
 #define YYEMPTY		(-2)
@@ -646,30 +727,63 @@
       yychar = (Token);						\
       yylval = (Value);						\
       yytoken = YYTRANSLATE (yychar);				\
-      YYPOPSTACK;						\
+      YYPOPSTACK (1);						\
       goto yybackup;						\
     }								\
   else								\
-    { 								\
-      yyerror ("syntax error: cannot back up");\
+    {								\
+      yyerror (YY_("syntax error: cannot back up")); \
       YYERROR;							\
     }								\
-while (0)
+while (YYID (0))
 
+
 #define YYTERROR	1
 #define YYERRCODE	256
 
-/* YYLLOC_DEFAULT -- Compute the default location (before the actions
-   are run).  */
 
+/* YYLLOC_DEFAULT -- Set CURRENT to span from RHS[1] to RHS[N].
+   If N is 0, then set CURRENT to the empty location which ends
+   the previous symbol: RHS[0] (always defined).  */
+
+#define YYRHSLOC(Rhs, K) ((Rhs)[K])
 #ifndef YYLLOC_DEFAULT
-# define YYLLOC_DEFAULT(Current, Rhs, N)		\
-   ((Current).first_line   = (Rhs)[1].first_line,	\
-    (Current).first_column = (Rhs)[1].first_column,	\
-    (Current).last_line    = (Rhs)[N].last_line,	\
-    (Current).last_column  = (Rhs)[N].last_column)
+# define YYLLOC_DEFAULT(Current, Rhs, N)				\
+    do									\
+      if (YYID (N))                                                    \
+	{								\
+	  (Current).first_line   = YYRHSLOC (Rhs, 1).first_line;	\
+	  (Current).first_column = YYRHSLOC (Rhs, 1).first_column;	\
+	  (Current).last_line    = YYRHSLOC (Rhs, N).last_line;		\
+	  (Current).last_column  = YYRHSLOC (Rhs, N).last_column;	\
+	}								\
+      else								\
+	{								\
+	  (Current).first_line   = (Current).last_line   =		\
+	    YYRHSLOC (Rhs, 0).last_line;				\
+	  (Current).first_column = (Current).last_column =		\
+	    YYRHSLOC (Rhs, 0).last_column;				\
+	}								\
+    while (YYID (0))
 #endif
 
+
+/* YY_LOCATION_PRINT -- Print the location on the stream.
+   This macro was not mandated originally: define only if we know
+   we won't break user code: when these are the locations we know.  */
+
+#ifndef YY_LOCATION_PRINT
+# if YYLTYPE_IS_TRIVIAL
+#  define YY_LOCATION_PRINT(File, Loc)			\
+     fprintf (File, "%d.%d-%d.%d",			\
+	      (Loc).first_line, (Loc).first_column,	\
+	      (Loc).last_line,  (Loc).last_column)
+# else
+#  define YY_LOCATION_PRINT(File, Loc) ((void) 0)
+# endif
+#endif
+
+
 /* YYLEX -- calling `yylex' with the right arguments.  */
 
 #ifdef YYLEX_PARAM
@@ -690,42 +804,96 @@
 do {						\
   if (yydebug)					\
     YYFPRINTF Args;				\
-} while (0)
+} while (YYID (0))
 
-# define YYDSYMPRINT(Args)			\
-do {						\
-  if (yydebug)					\
-    yysymprint Args;				\
-} while (0)
+# define YY_SYMBOL_PRINT(Title, Type, Value, Location)			  \
+do {									  \
+  if (yydebug)								  \
+    {									  \
+      YYFPRINTF (stderr, "%s ", Title);					  \
+      yy_symbol_print (stderr,						  \
+		  Type, Value); \
+      YYFPRINTF (stderr, "\n");						  \
+    }									  \
+} while (YYID (0))
 
-# define YYDSYMPRINTF(Title, Token, Value, Location)		\
-do {								\
-  if (yydebug)							\
-    {								\
-      YYFPRINTF (stderr, "%s ", Title);				\
-      yysymprint (stderr, 					\
-                  Token, Value);	\
-      YYFPRINTF (stderr, "\n");					\
-    }								\
-} while (0)
 
+/*--------------------------------.
+| Print this symbol on YYOUTPUT.  |
+`--------------------------------*/
+
+/*ARGSUSED*/
+#if (defined __STDC__ || defined __C99__FUNC__ \
+     || defined __cplusplus || defined _MSC_VER)
+static void
+yy_symbol_value_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep)
+#else
+static void
+yy_symbol_value_print (yyoutput, yytype, yyvaluep)
+    FILE *yyoutput;
+    int yytype;
+    YYSTYPE const * const yyvaluep;
+#endif
+{
+  if (!yyvaluep)
+    return;
+# ifdef YYPRINT
+  if (yytype < YYNTOKENS)
+    YYPRINT (yyoutput, yytoknum[yytype], *yyvaluep);
+# else
+  YYUSE (yyoutput);
+# endif
+  switch (yytype)
+    {
+      default:
+	break;
+    }
+}
+
+
+/*--------------------------------.
+| Print this symbol on YYOUTPUT.  |
+`--------------------------------*/
+
+#if (defined __STDC__ || defined __C99__FUNC__ \
+     || defined __cplusplus || defined _MSC_VER)
+static void
+yy_symbol_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep)
+#else
+static void
+yy_symbol_print (yyoutput, yytype, yyvaluep)
+    FILE *yyoutput;
+    int yytype;
+    YYSTYPE const * const yyvaluep;
+#endif
+{
+  if (yytype < YYNTOKENS)
+    YYFPRINTF (yyoutput, "token %s (", yytname[yytype]);
+  else
+    YYFPRINTF (yyoutput, "nterm %s (", yytname[yytype]);
+
+  yy_symbol_value_print (yyoutput, yytype, yyvaluep);
+  YYFPRINTF (yyoutput, ")");
+}
+
 /*------------------------------------------------------------------.
 | yy_stack_print -- Print the state stack from its BOTTOM up to its |
 | TOP (included).                                                   |
 `------------------------------------------------------------------*/
 
-#if defined (__STDC__) || defined (__cplusplus)
+#if (defined __STDC__ || defined __C99__FUNC__ \
+     || defined __cplusplus || defined _MSC_VER)
 static void
-yy_stack_print (short *bottom, short *top)
+yy_stack_print (yytype_int16 *bottom, yytype_int16 *top)
 #else
 static void
 yy_stack_print (bottom, top)
-    short *bottom;
-    short *top;
+    yytype_int16 *bottom;
+    yytype_int16 *top;
 #endif
 {
   YYFPRINTF (stderr, "Stack now");
-  for (/* Nothing. */; bottom <= top; ++bottom)
+  for (; bottom <= top; ++bottom)
     YYFPRINTF (stderr, " %d", *bottom);
   YYFPRINTF (stderr, "\n");
 }
@@ -734,45 +902,52 @@
 do {								\
   if (yydebug)							\
     yy_stack_print ((Bottom), (Top));				\
-} while (0)
+} while (YYID (0))
 
 
 /*------------------------------------------------.
 | Report that the YYRULE is going to be reduced.  |
 `------------------------------------------------*/
 
-#if defined (__STDC__) || defined (__cplusplus)
+#if (defined __STDC__ || defined __C99__FUNC__ \
+     || defined __cplusplus || defined _MSC_VER)
 static void
-yy_reduce_print (int yyrule)
+yy_reduce_print (YYSTYPE *yyvsp, int yyrule)
 #else
 static void
-yy_reduce_print (yyrule)
+yy_reduce_print (yyvsp, yyrule)
+    YYSTYPE *yyvsp;
     int yyrule;
 #endif
 {
+  int yynrhs = yyr2[yyrule];
   int yyi;
-  unsigned int yylno = yyrline[yyrule];
-  YYFPRINTF (stderr, "Reducing stack by rule %d (line %u), ",
-             yyrule - 1, yylno);
-  /* Print the symbols being reduced, and their result.  */
-  for (yyi = yyprhs[yyrule]; 0 <= yyrhs[yyi]; yyi++)
-    YYFPRINTF (stderr, "%s ", yytname [yyrhs[yyi]]);
-  YYFPRINTF (stderr, "-> %s\n", yytname [yyr1[yyrule]]);
+  unsigned long int yylno = yyrline[yyrule];
+  YYFPRINTF (stderr, "Reducing stack by rule %d (line %lu):\n",
+	     yyrule - 1, yylno);
+  /* The symbols being reduced.  */
+  for (yyi = 0; yyi < yynrhs; yyi++)
+    {
+      fprintf (stderr, "   $%d = ", yyi + 1);
+      yy_symbol_print (stderr, yyrhs[yyprhs[yyrule] + yyi],
+		       &(yyvsp[(yyi + 1) - (yynrhs)])
+		       		       );
+      fprintf (stderr, "\n");
+    }
 }
 
 # define YY_REDUCE_PRINT(Rule)		\
 do {					\
   if (yydebug)				\
-    yy_reduce_print (Rule);		\
-} while (0)
+    yy_reduce_print (yyvsp, Rule); \
+} while (YYID (0))
 
 /* Nonzero means print parse trace.  It is left uninitialized so that
    multiple parsers can coexist.  */
 int yydebug;
 #else /* !YYDEBUG */
 # define YYDPRINTF(Args)
-# define YYDSYMPRINT(Args)
-# define YYDSYMPRINTF(Title, Token, Value, Location)
+# define YY_SYMBOL_PRINT(Title, Type, Value, Location)
 # define YY_STACK_PRINT(Bottom, Top)
 # define YY_REDUCE_PRINT(Rule)
 #endif /* !YYDEBUG */
@@ -787,13 +962,9 @@
    if the built-in stack extension method is used).
 
    Do not make this value too large; the results are undefined if
-   SIZE_MAX < YYSTACK_BYTES (YYMAXDEPTH)
+   YYSTACK_ALLOC_MAXIMUM < YYSTACK_BYTES (YYMAXDEPTH)
    evaluated with infinite-precision integer arithmetic.  */
 
-#if defined (YYMAXDEPTH) && YYMAXDEPTH == 0
-# undef YYMAXDEPTH
-#endif
-
 #ifndef YYMAXDEPTH
 # define YYMAXDEPTH 10000
 #endif
@@ -803,45 +974,47 @@
 #if YYERROR_VERBOSE
 
 # ifndef yystrlen
-#  if defined (__GLIBC__) && defined (_STRING_H)
+#  if defined __GLIBC__ && defined _STRING_H
 #   define yystrlen strlen
 #  else
 /* Return the length of YYSTR.  */
+#if (defined __STDC__ || defined __C99__FUNC__ \
+     || defined __cplusplus || defined _MSC_VER)
 static YYSIZE_T
-#   if defined (__STDC__) || defined (__cplusplus)
 yystrlen (const char *yystr)
-#   else
+#else
+static YYSIZE_T
 yystrlen (yystr)
-     const char *yystr;
-#   endif
+    const char *yystr;
+#endif
 {
-  register const char *yys = yystr;
-
-  while (*yys++ != '\0')
+  YYSIZE_T yylen;
+  for (yylen = 0; yystr[yylen]; yylen++)
     continue;
-
-  return yys - yystr - 1;
+  return yylen;
 }
 #  endif
 # endif
 
 # ifndef yystpcpy
-#  if defined (__GLIBC__) && defined (_STRING_H) && defined (_GNU_SOURCE)
+#  if defined __GLIBC__ && defined _STRING_H && defined _GNU_SOURCE
 #   define yystpcpy stpcpy
 #  else
 /* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in
    YYDEST.  */
+#if (defined __STDC__ || defined __C99__FUNC__ \
+     || defined __cplusplus || defined _MSC_VER)
 static char *
-#   if defined (__STDC__) || defined (__cplusplus)
 yystpcpy (char *yydest, const char *yysrc)
-#   else
+#else
+static char *
 yystpcpy (yydest, yysrc)
-     char *yydest;
-     const char *yysrc;
-#   endif
+    char *yydest;
+    const char *yysrc;
+#endif
 {
-  register char *yyd = yydest;
-  register const char *yys = yysrc;
+  char *yyd = yydest;
+  const char *yys = yysrc;
 
   while ((*yyd++ = *yys++) != '\0')
     continue;
@@ -851,70 +1024,192 @@
 #  endif
 # endif
 
-#endif /* !YYERROR_VERBOSE */
+# ifndef yytnamerr
+/* Copy to YYRES the contents of YYSTR after stripping away unnecessary
+   quotes and backslashes, so that it's suitable for yyerror.  The
+   heuristic is that double-quoting is unnecessary unless the string
+   contains an apostrophe, a comma, or backslash (other than
+   backslash-backslash).  YYSTR is taken from yytname.  If YYRES is
+   null, do not copy; instead, return the length of what the result
+   would have been.  */
+static YYSIZE_T
+yytnamerr (char *yyres, const char *yystr)
+{
+  if (*yystr == '"')
+    {
+      YYSIZE_T yyn = 0;
+      char const *yyp = yystr;
 
-
+      for (;;)
+	switch (*++yyp)
+	  {
+	  case '\'':
+	  case ',':
+	    goto do_not_strip_quotes;
 
-#if YYDEBUG
-/*--------------------------------.
-| Print this symbol on YYOUTPUT.  |
-`--------------------------------*/
+	  case '\\':
+	    if (*++yyp != '\\')
+	      goto do_not_strip_quotes;
+	    /* Fall through.  */
+	  default:
+	    if (yyres)
+	      yyres[yyn] = *yyp;
+	    yyn++;
+	    break;
 
-#if defined (__STDC__) || defined (__cplusplus)
-static void
-yysymprint (FILE *yyoutput, int yytype, YYSTYPE *yyvaluep)
-#else
-static void
-yysymprint (yyoutput, yytype, yyvaluep)
-    FILE *yyoutput;
-    int yytype;
-    YYSTYPE *yyvaluep;
-#endif
+	  case '"':
+	    if (yyres)
+	      yyres[yyn] = '\0';
+	    return yyn;
+	  }
+    do_not_strip_quotes: ;
+    }
+
+  if (! yyres)
+    return yystrlen (yystr);
+
+  return yystpcpy (yyres, yystr) - yyres;
+}
+# endif
+
+/* Copy into YYRESULT an error message about the unexpected token
+   YYCHAR while in state YYSTATE.  Return the number of bytes copied,
+   including the terminating null byte.  If YYRESULT is null, do not
+   copy anything; just return the number of bytes that would be
+   copied.  As a special case, return 0 if an ordinary "syntax error"
+   message will do.  Return YYSIZE_MAXIMUM if overflow occurs during
+   size calculation.  */
+static YYSIZE_T
+yysyntax_error (char *yyresult, int yystate, int yychar)
 {
-  /* Pacify ``unused variable'' warnings.  */
-  (void) yyvaluep;
+  int yyn = yypact[yystate];
 
-  if (yytype < YYNTOKENS)
+  if (! (YYPACT_NINF < yyn && yyn <= YYLAST))
+    return 0;
+  else
     {
-      YYFPRINTF (yyoutput, "token %s (", yytname[yytype]);
-# ifdef YYPRINT
-      YYPRINT (yyoutput, yytoknum[yytype], *yyvaluep);
+      int yytype = YYTRANSLATE (yychar);
+      YYSIZE_T yysize0 = yytnamerr (0, yytname[yytype]);
+      YYSIZE_T yysize = yysize0;
+      YYSIZE_T yysize1;
+      int yysize_overflow = 0;
+      enum { YYERROR_VERBOSE_ARGS_MAXIMUM = 5 };
+      char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM];
+      int yyx;
+
+# if 0
+      /* This is so xgettext sees the translatable formats that are
+	 constructed on the fly.  */
+      YY_("syntax error, unexpected %s");
+      YY_("syntax error, unexpected %s, expecting %s");
+      YY_("syntax error, unexpected %s, expecting %s or %s");
+      YY_("syntax error, unexpected %s, expecting %s or %s or %s");
+      YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s");
 # endif
-    }
-  else
-    YYFPRINTF (yyoutput, "nterm %s (", yytname[yytype]);
+      char *yyfmt;
+      char const *yyf;
+      static char const yyunexpected[] = "syntax error, unexpected %s";
+      static char const yyexpecting[] = ", expecting %s";
+      static char const yyor[] = " or %s";
+      char yyformat[sizeof yyunexpected
+		    + sizeof yyexpecting - 1
+		    + ((YYERROR_VERBOSE_ARGS_MAXIMUM - 2)
+		       * (sizeof yyor - 1))];
+      char const *yyprefix = yyexpecting;
 
-  switch (yytype)
-    {
-      default:
-        break;
+      /* Start YYX at -YYN if negative to avoid negative indexes in
+	 YYCHECK.  */
+      int yyxbegin = yyn < 0 ? -yyn : 0;
+
+      /* Stay within bounds of both yycheck and yytname.  */
+      int yychecklim = YYLAST - yyn + 1;
+      int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS;
+      int yycount = 1;
+
+      yyarg[0] = yytname[yytype];
+      yyfmt = yystpcpy (yyformat, yyunexpected);
+
+      for (yyx = yyxbegin; yyx < yyxend; ++yyx)
+	if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR)
+	  {
+	    if (yycount == YYERROR_VERBOSE_ARGS_MAXIMUM)
+	      {
+		yycount = 1;
+		yysize = yysize0;
+		yyformat[sizeof yyunexpected - 1] = '\0';
+		break;
+	      }
+	    yyarg[yycount++] = yytname[yyx];
+	    yysize1 = yysize + yytnamerr (0, yytname[yyx]);
+	    yysize_overflow |= (yysize1 < yysize);
+	    yysize = yysize1;
+	    yyfmt = yystpcpy (yyfmt, yyprefix);
+	    yyprefix = yyor;
+	  }
+
+      yyf = YY_(yyformat);
+      yysize1 = yysize + yystrlen (yyf);
+      yysize_overflow |= (yysize1 < yysize);
+      yysize = yysize1;
+
+      if (yysize_overflow)
+	return YYSIZE_MAXIMUM;
+
+      if (yyresult)
+	{
+	  /* Avoid sprintf, as that infringes on the user's name space.
+	     Don't have undefined behavior even if the translation
+	     produced a string with the wrong number of "%s"s.  */
+	  char *yyp = yyresult;
+	  int yyi = 0;
+	  while ((*yyp = *yyf) != '\0')
+	    {
+	      if (*yyp == '%' && yyf[1] == 's' && yyi < yycount)
+		{
+		  yyp += yytnamerr (yyp, yyarg[yyi++]);
+		  yyf += 2;
+		}
+	      else
+		{
+		  yyp++;
+		  yyf++;
+		}
+	    }
+	}
+      return yysize;
     }
-  YYFPRINTF (yyoutput, ")");
 }
+#endif /* YYERROR_VERBOSE */
+
 
-#endif /* ! YYDEBUG */
 /*-----------------------------------------------.
 | Release the memory associated to this symbol.  |
 `-----------------------------------------------*/
 
-#if defined (__STDC__) || defined (__cplusplus)
+/*ARGSUSED*/
+#if (defined __STDC__ || defined __C99__FUNC__ \
+     || defined __cplusplus || defined _MSC_VER)
 static void
-yydestruct (int yytype, YYSTYPE *yyvaluep)
+yydestruct (const char *yymsg, int yytype, YYSTYPE *yyvaluep)
 #else
 static void
-yydestruct (yytype, yyvaluep)
+yydestruct (yymsg, yytype, yyvaluep)
+    const char *yymsg;
     int yytype;
     YYSTYPE *yyvaluep;
 #endif
 {
-  /* Pacify ``unused variable'' warnings.  */
-  (void) yyvaluep;
+  YYUSE (yyvaluep);
 
+  if (!yymsg)
+    yymsg = "Deleting";
+  YY_SYMBOL_PRINT (yymsg, yytype, yyvaluep, yylocationp);
+
   switch (yytype)
     {
 
       default:
-        break;
+	break;
     }
 }
 
@@ -922,13 +1217,13 @@
 /* Prevent warnings from -Wmissing-prototypes.  */
 
 #ifdef YYPARSE_PARAM
-# if defined (__STDC__) || defined (__cplusplus)
+#if defined __STDC__ || defined __cplusplus
 int yyparse (void *YYPARSE_PARAM);
-# else
+#else
 int yyparse ();
-# endif
+#endif
 #else /* ! YYPARSE_PARAM */
-#if defined (__STDC__) || defined (__cplusplus)
+#if defined __STDC__ || defined __cplusplus
 int yyparse (void);
 #else
 int yyparse ();
@@ -937,10 +1232,10 @@
 
 
 
-/* The lookahead symbol.  */
+/* The look-ahead symbol.  */
 int yychar;
 
-/* The semantic value of the lookahead symbol.  */
+/* The semantic value of the look-ahead symbol.  */
 YYSTYPE yylval;
 
 /* Number of syntax errors so far.  */
@@ -953,14 +1248,18 @@
 `----------*/
 
 #ifdef YYPARSE_PARAM
-# if defined (__STDC__) || defined (__cplusplus)
-int yyparse (void *YYPARSE_PARAM)
-# else
-int yyparse (YYPARSE_PARAM)
-  void *YYPARSE_PARAM;
-# endif
+#if (defined __STDC__ || defined __C99__FUNC__ \
+     || defined __cplusplus || defined _MSC_VER)
+int
+yyparse (void *YYPARSE_PARAM)
+#else
+int
+yyparse (YYPARSE_PARAM)
+    void *YYPARSE_PARAM;
+#endif
 #else /* ! YYPARSE_PARAM */
-#if defined (__STDC__) || defined (__cplusplus)
+#if (defined __STDC__ || defined __C99__FUNC__ \
+     || defined __cplusplus || defined _MSC_VER)
 int
 yyparse (void)
 #else
@@ -971,13 +1270,19 @@
 #endif
 {
   
-  register int yystate;
-  register int yyn;
+  int yystate;
+  int yyn;
   int yyresult;
   /* Number of tokens to shift before error messages enabled.  */
   int yyerrstatus;
-  /* Lookahead token as an internal (translated) token number.  */
+  /* Look-ahead token as an internal (translated) token number.  */
   int yytoken = 0;
+#if YYERROR_VERBOSE
+  /* Buffer for error messages, and its allocated size.  */
+  char yymsgbuf[128];
+  char *yymsg = yymsgbuf;
+  YYSIZE_T yymsg_alloc = sizeof yymsgbuf;
+#endif
 
   /* Three stacks and their tools:
      `yyss': related to states,
@@ -988,18 +1293,18 @@
      to reallocate them elsewhere.  */
 
   /* The state stack.  */
-  short	yyssa[YYINITDEPTH];
-  short *yyss = yyssa;
-  register short *yyssp;
+  yytype_int16 yyssa[YYINITDEPTH];
+  yytype_int16 *yyss = yyssa;
+  yytype_int16 *yyssp;
 
   /* The semantic value stack.  */
   YYSTYPE yyvsa[YYINITDEPTH];
   YYSTYPE *yyvs = yyvsa;
-  register YYSTYPE *yyvsp;
+  YYSTYPE *yyvsp;
 
 
 
-#define YYPOPSTACK   (yyvsp--, yyssp--)
+#define YYPOPSTACK(N)   (yyvsp -= (N), yyssp -= (N))
 
   YYSIZE_T yystacksize = YYINITDEPTH;
 
@@ -1008,9 +1313,9 @@
   YYSTYPE yyval;
 
 
-  /* When reducing, the number of symbols on the RHS of the reduced
-     rule.  */
-  int yylen;
+  /* The number of symbols on the RHS of the reduced rule.
+     Keep to zero when no symbol should be popped.  */
+  int yylen = 0;
 
   YYDPRINTF ((stderr, "Starting parse\n"));
 
@@ -1034,8 +1339,7 @@
 `------------------------------------------------------------*/
  yynewstate:
   /* In all cases, when you get here, the value and location stacks
-     have just been pushed. so pushing a state here evens the stacks.
-     */
+     have just been pushed.  So pushing a state here evens the stacks.  */
   yyssp++;
 
  yysetstate:
@@ -1048,18 +1352,18 @@
 
 #ifdef yyoverflow
       {
-	/* Give user a chance to reallocate the stack. Use copies of
+	/* Give user a chance to reallocate the stack.  Use copies of
 	   these so that the &'s don't force the real ones into
 	   memory.  */
 	YYSTYPE *yyvs1 = yyvs;
-	short *yyss1 = yyss;
+	yytype_int16 *yyss1 = yyss;
 
 
 	/* Each stack pointer address is followed by the size of the
 	   data in use in that stack, in bytes.  This used to be a
 	   conditional around just the two extra args, but that might
 	   be undefined if yyoverflow is a macro.  */
-	yyoverflow ("parser stack overflow",
+	yyoverflow (YY_("memory exhausted"),
 		    &yyss1, yysize * sizeof (*yyssp),
 		    &yyvs1, yysize * sizeof (*yyvsp),
 
@@ -1070,21 +1374,21 @@
       }
 #else /* no yyoverflow */
 # ifndef YYSTACK_RELOCATE
-      goto yyoverflowlab;
+      goto yyexhaustedlab;
 # else
       /* Extend the stack our own way.  */
       if (YYMAXDEPTH <= yystacksize)
-	goto yyoverflowlab;
+	goto yyexhaustedlab;
       yystacksize *= 2;
       if (YYMAXDEPTH < yystacksize)
 	yystacksize = YYMAXDEPTH;
 
       {
-	short *yyss1 = yyss;
+	yytype_int16 *yyss1 = yyss;
 	union yyalloc *yyptr =
 	  (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize));
 	if (! yyptr)
-	  goto yyoverflowlab;
+	  goto yyexhaustedlab;
 	YYSTACK_RELOCATE (yyss);
 	YYSTACK_RELOCATE (yyvs);
 
@@ -1115,19 +1419,17 @@
 `-----------*/
 yybackup:
 
-/* Do appropriate processing given the current state.  */
-/* Read a lookahead token if we need one and don't already have one.  */
-/* yyresume: */
+  /* Do appropriate processing given the current state.  Read a
+     look-ahead token if we need one and don't already have one.  */
 
-  /* First try to decide what to do without reference to lookahead token.  */
-
+  /* First try to decide what to do without reference to look-ahead token.  */
   yyn = yypact[yystate];
   if (yyn == YYPACT_NINF)
     goto yydefault;
 
-  /* Not known => get a lookahead token if don't already have one.  */
+  /* Not known => get a look-ahead token if don't already have one.  */
 
-  /* YYCHAR is either YYEMPTY or YYEOF or a valid lookahead symbol.  */
+  /* YYCHAR is either YYEMPTY or YYEOF or a valid look-ahead symbol.  */
   if (yychar == YYEMPTY)
     {
       YYDPRINTF ((stderr, "Reading a token: "));
@@ -1142,7 +1444,7 @@
   else
     {
       yytoken = YYTRANSLATE (yychar);
-      YYDSYMPRINTF ("Next token is", yytoken, &yylval, &yylloc);
+      YY_SYMBOL_PRINT ("Next token is", yytoken, &yylval, &yylloc);
     }
 
   /* If the proper action on seeing token YYTOKEN is to reduce or to
@@ -1162,22 +1464,21 @@
   if (yyn == YYFINAL)
     YYACCEPT;
 
-  /* Shift the lookahead token.  */
-  YYDPRINTF ((stderr, "Shifting token %s, ", yytname[yytoken]));
+  /* Count tokens shifted since error; after three, turn off error
+     status.  */
+  if (yyerrstatus)
+    yyerrstatus--;
 
-  /* Discard the token being shifted unless it is eof.  */
+  /* Shift the look-ahead token.  */
+  YY_SYMBOL_PRINT ("Shifting", yytoken, &yylval, &yylloc);
+
+  /* Discard the shifted token unless it is eof.  */
   if (yychar != YYEOF)
     yychar = YYEMPTY;
 
+  yystate = yyn;
   *++yyvsp = yylval;
 
-
-  /* Count tokens shifted since error; after three, turn off error
-     status.  */
-  if (yyerrstatus)
-    yyerrstatus--;
-
-  yystate = yyn;
   goto yynewstate;
 
 
@@ -1213,110 +1514,109 @@
   switch (yyn)
     {
         case 15:
-#line 268 "/home/eitan/SW/SVN/gen2_libsdp/libsdp/src/config_parser.y"
+#line 227 "./config_parser.y"
     { __sdp_log_set_log_stderr(); }
     break;
 
   case 16:
-#line 269 "/home/eitan/SW/SVN/gen2_libsdp/libsdp/src/config_parser.y"
+#line 228 "./config_parser.y"
     { __sdp_log_set_log_syslog(); }
     break;
 
   case 17:
-#line 270 "/home/eitan/SW/SVN/gen2_libsdp/libsdp/src/config_parser.y"
-    { __sdp_log_set_log_file(yyvsp[0].sval); free(yyvsp[0].sval); }
+#line 229 "./config_parser.y"
+    { __sdp_log_set_log_file((yyvsp[(3) - (3)].sval)); }
     break;
 
   case 18:
-#line 274 "/home/eitan/SW/SVN/gen2_libsdp/libsdp/src/config_parser.y"
-    { __sdp_log_set_min_level(yyvsp[0].ival); }
+#line 233 "./config_parser.y"
+    { __sdp_log_set_min_level((yyvsp[(2) - (2)].ival)); }
     break;
 
   case 19:
-#line 278 "/home/eitan/SW/SVN/gen2_libsdp/libsdp/src/config_parser.y"
+#line 237 "./config_parser.y"
     { __sdp_add_rule(); }
     break;
 
   case 20:
-#line 282 "/home/eitan/SW/SVN/gen2_libsdp/libsdp/src/config_parser.y"
+#line 241 "./config_parser.y"
     { __sdp_rule.target_family = USE_TCP; }
     break;
 
   case 21:
-#line 283 "/home/eitan/SW/SVN/gen2_libsdp/libsdp/src/config_parser.y"
+#line 242 "./config_parser.y"
     { __sdp_rule.target_family = USE_SDP; }
     break;
 
   case 22:
-#line 284 "/home/eitan/SW/SVN/gen2_libsdp/libsdp/src/config_parser.y"
+#line 243 "./config_parser.y"
     { __sdp_rule.target_family = USE_BOTH; }
     break;
 
   case 23:
-#line 288 "/home/eitan/SW/SVN/gen2_libsdp/libsdp/src/config_parser.y"
+#line 247 "./config_parser.y"
     { current_role = 1; }
     break;
 
   case 24:
-#line 289 "/home/eitan/SW/SVN/gen2_libsdp/libsdp/src/config_parser.y"
+#line 248 "./config_parser.y"
     { current_role = 2; }
     break;
 
   case 25:
-#line 293 "/home/eitan/SW/SVN/gen2_libsdp/libsdp/src/config_parser.y"
-    { __sdp_set_prog_name_expr(yyvsp[0].sval); free(yyvsp[0].sval); }
+#line 252 "./config_parser.y"
+    { __sdp_set_prog_name_expr((yyvsp[(1) - (1)].sval)); }
     break;
 
   case 26:
-#line 294 "/home/eitan/SW/SVN/gen2_libsdp/libsdp/src/config_parser.y"
+#line 253 "./config_parser.y"
     { __sdp_set_prog_name_expr("*"); }
     break;
 
   case 27:
-#line 298 "/home/eitan/SW/SVN/gen2_libsdp/libsdp/src/config_parser.y"
+#line 257 "./config_parser.y"
     { __sdp_rule.match_by_addr = 1; __sdp_rule.prefixlen = 32; }
     break;
 
   case 28:
-#line 299 "/home/eitan/SW/SVN/gen2_libsdp/libsdp/src/config_parser.y"
-    { __sdp_rule.match_by_addr = 1; __sdp_rule.prefixlen = yyvsp[0].ival; }
+#line 258 "./config_parser.y"
+    { __sdp_rule.match_by_addr = 1; __sdp_rule.prefixlen = (yyvsp[(3) - (3)].ival); }
     break;
 
   case 29:
-#line 300 "/home/eitan/SW/SVN/gen2_libsdp/libsdp/src/config_parser.y"
+#line 259 "./config_parser.y"
     { __sdp_rule.match_by_addr = 0; __sdp_rule.prefixlen = 32; }
     break;
 
   case 30:
-#line 304 "/home/eitan/SW/SVN/gen2_libsdp/libsdp/src/config_parser.y"
-    { __sdp_set_ipv4_addr(yyvsp[-6].ival,yyvsp[-4].ival,yyvsp[-2].ival,yyvsp[0].ival); }
+#line 263 "./config_parser.y"
+    { __sdp_set_ipv4_addr((yyvsp[(1) - (7)].ival),(yyvsp[(3) - (7)].ival),(yyvsp[(5) - (7)].ival),(yyvsp[(7) - (7)].ival)); }
     break;
 
   case 31:
-#line 308 "/home/eitan/SW/SVN/gen2_libsdp/libsdp/src/config_parser.y"
-    { __sdp_rule.match_by_port = 1; __sdp_rule.sport= yyvsp[0].ival; __sdp_rule.eport= yyvsp[0].ival; }
+#line 267 "./config_parser.y"
+    { __sdp_rule.match_by_port = 1; __sdp_rule.sport= (yyvsp[(1) - (1)].ival); __sdp_rule.eport= (yyvsp[(1) - (1)].ival); }
     break;
 
   case 32:
-#line 309 "/home/eitan/SW/SVN/gen2_libsdp/libsdp/src/config_parser.y"
-    { __sdp_rule.match_by_port = 1; __sdp_rule.sport= yyvsp[-2].ival; __sdp_rule.eport= yyvsp[0].ival; }
+#line 268 "./config_parser.y"
+    { __sdp_rule.match_by_port = 1; __sdp_rule.sport= (yyvsp[(1) - (3)].ival); __sdp_rule.eport= (yyvsp[(3) - (3)].ival); }
     break;
 
   case 33:
-#line 310 "/home/eitan/SW/SVN/gen2_libsdp/libsdp/src/config_parser.y"
+#line 269 "./config_parser.y"
     { __sdp_rule.match_by_port = 0; __sdp_rule.sport= 0 ; __sdp_rule.eport= 0; }
     break;
 
 
+/* Line 1267 of yacc.c.  */
+#line 1614 "y.tab.c"
+      default: break;
     }
+  YY_SYMBOL_PRINT ("-> $$ =", yyr1[yyn], &yyval, &yyloc);
 
-/* Line 1000 of yacc.c.  */
-#line 1315 "y.tab.c"
-
-  yyvsp -= yylen;
-  yyssp -= yylen;
-
-
+  YYPOPSTACK (yylen);
+  yylen = 0;
   YY_STACK_PRINT (yyss, yyssp);
 
   *++yyvsp = yyval;
@@ -1345,99 +1645,65 @@
   if (!yyerrstatus)
     {
       ++yynerrs;
-#if YYERROR_VERBOSE
-      yyn = yypact[yystate];
-
-      if (YYPACT_NINF < yyn && yyn < YYLAST)
-	{
-	  YYSIZE_T yysize = 0;
-	  int yytype = YYTRANSLATE (yychar);
-	  const char* yyprefix;
-	  char *yymsg;
-	  int yyx;
-
-	  /* Start YYX at -YYN if negative to avoid negative indexes in
-	     YYCHECK.  */
-	  int yyxbegin = yyn < 0 ? -yyn : 0;
-
-	  /* Stay within bounds of both yycheck and yytname.  */
-	  int yychecklim = YYLAST - yyn;
-	  int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS;
-	  int yycount = 0;
-
-	  yyprefix = ", expecting ";
-	  for (yyx = yyxbegin; yyx < yyxend; ++yyx)
-	    if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR)
+#if ! YYERROR_VERBOSE
+      yyerror (YY_("syntax error"));
+#else
+      {
+	YYSIZE_T yysize = yysyntax_error (0, yystate, yychar);
+	if (yymsg_alloc < yysize && yymsg_alloc < YYSTACK_ALLOC_MAXIMUM)
+	  {
+	    YYSIZE_T yyalloc = 2 * yysize;
+	    if (! (yysize <= yyalloc && yyalloc <= YYSTACK_ALLOC_MAXIMUM))
+	      yyalloc = YYSTACK_ALLOC_MAXIMUM;
+	    if (yymsg != yymsgbuf)
+	      YYSTACK_FREE (yymsg);
+	    yymsg = (char *) YYSTACK_ALLOC (yyalloc);
+	    if (yymsg)
+	      yymsg_alloc = yyalloc;
+	    else
 	      {
-		yysize += yystrlen (yyprefix) + yystrlen (yytname [yyx]);
-		yycount += 1;
-		if (yycount == 5)
-		  {
-		    yysize = 0;
-		    break;
-		  }
+		yymsg = yymsgbuf;
+		yymsg_alloc = sizeof yymsgbuf;
 	      }
-	  yysize += (sizeof ("syntax error, unexpected ")
-		     + yystrlen (yytname[yytype]));
-	  yymsg = (char *) YYSTACK_ALLOC (yysize);
-	  if (yymsg != 0)
-	    {
-	      char *yyp = yystpcpy (yymsg, "syntax error, unexpected ");
-	      yyp = yystpcpy (yyp, yytname[yytype]);
+	  }
 
-	      if (yycount < 5)
-		{
-		  yyprefix = ", expecting ";
-		  for (yyx = yyxbegin; yyx < yyxend; ++yyx)
-		    if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR)
-		      {
-			yyp = yystpcpy (yyp, yyprefix);
-			yyp = yystpcpy (yyp, yytname[yyx]);
-			yyprefix = " or ";
-		      }
-		}
-	      yyerror (yymsg);
-	      YYSTACK_FREE (yymsg);
-	    }
-	  else
-	    yyerror ("syntax error; also virtual memory exhausted");
-	}
-      else
-#endif /* YYERROR_VERBOSE */
-	yyerror ("syntax error");
+	if (0 < yysize && yysize <= yymsg_alloc)
+	  {
+	    (void) yysyntax_error (yymsg, yystate, yychar);
+	    yyerror (yymsg);
+	  }
+	else
+	  {
+	    yyerror (YY_("syntax error"));
+	    if (yysize != 0)
+	      goto yyexhaustedlab;
+	  }
+      }
+#endif
     }
 
 
 
   if (yyerrstatus == 3)
     {
-      /* If just tried and failed to reuse lookahead token after an
+      /* If just tried and failed to reuse look-ahead token after an
 	 error, discard it.  */
 
       if (yychar <= YYEOF)
-        {
-          /* If at end of input, pop the error token,
-	     then the rest of the stack, then return failure.  */
+	{
+	  /* Return failure if at end of input.  */
 	  if (yychar == YYEOF)
-	     for (;;)
-	       {
-		 YYPOPSTACK;
-		 if (yyssp == yyss)
-		   YYABORT;
-		 YYDSYMPRINTF ("Error: popping", yystos[*yyssp], yyvsp, yylsp);
-		 yydestruct (yystos[*yyssp], yyvsp);
-	       }
-        }
+	    YYABORT;
+	}
       else
 	{
-	  YYDSYMPRINTF ("Error: discarding", yytoken, &yylval, &yylloc);
-	  yydestruct (yytoken, &yylval);
+	  yydestruct ("Error: discarding",
+		      yytoken, &yylval);
 	  yychar = YYEMPTY;
-
 	}
     }
 
-  /* Else will try to reuse lookahead token after shifting the error
+  /* Else will try to reuse look-ahead token after shifting the error
      token.  */
   goto yyerrlab1;
 
@@ -1447,15 +1713,17 @@
 `---------------------------------------------------*/
 yyerrorlab:
 
-#ifdef __GNUC__
-  /* Pacify GCC when the user code never invokes YYERROR and the label
-     yyerrorlab therefore never appears in user code.  */
-  if (0)
+  /* Pacify compilers like GCC when the user code never invokes
+     YYERROR and the label yyerrorlab therefore never appears in user
+     code.  */
+  if (/*CONSTCOND*/ 0)
      goto yyerrorlab;
-#endif
 
-  yyvsp -= yylen;
-  yyssp -= yylen;
+  /* Do not reclaim the symbols of the rule which action triggered
+     this YYERROR.  */
+  YYPOPSTACK (yylen);
+  yylen = 0;
+  YY_STACK_PRINT (yyss, yyssp);
   yystate = *yyssp;
   goto yyerrlab1;
 
@@ -1484,9 +1752,10 @@
       if (yyssp == yyss)
 	YYABORT;
 
-      YYDSYMPRINTF ("Error: popping", yystos[*yyssp], yyvsp, yylsp);
-      yydestruct (yystos[yystate], yyvsp);
-      YYPOPSTACK;
+
+      yydestruct ("Error: popping",
+		  yystos[yystate], yyvsp);
+      YYPOPSTACK (1);
       yystate = *yyssp;
       YY_STACK_PRINT (yyss, yyssp);
     }
@@ -1494,11 +1763,12 @@
   if (yyn == YYFINAL)
     YYACCEPT;
 
-  YYDPRINTF ((stderr, "Shifting error token, "));
-
   *++yyvsp = yylval;
 
 
+  /* Shift the error token.  */
+  YY_SYMBOL_PRINT ("Shifting", yystos[yyn], yyvsp, yylsp);
+
   yystate = yyn;
   goto yynewstate;
 
@@ -1518,25 +1788,43 @@
   goto yyreturn;
 
 #ifndef yyoverflow
-/*----------------------------------------------.
-| yyoverflowlab -- parser overflow comes here.  |
-`----------------------------------------------*/
-yyoverflowlab:
-  yyerror ("parser stack overflow");
+/*-------------------------------------------------.
+| yyexhaustedlab -- memory exhaustion comes here.  |
+`-------------------------------------------------*/
+yyexhaustedlab:
+  yyerror (YY_("memory exhausted"));
   yyresult = 2;
   /* Fall through.  */
 #endif
 
 yyreturn:
+  if (yychar != YYEOF && yychar != YYEMPTY)
+     yydestruct ("Cleanup: discarding lookahead",
+		 yytoken, &yylval);
+  /* Do not reclaim the symbols of the rule which action triggered
+     this YYABORT or YYACCEPT.  */
+  YYPOPSTACK (yylen);
+  YY_STACK_PRINT (yyss, yyssp);
+  while (yyssp != yyss)
+    {
+      yydestruct ("Cleanup: popping",
+		  yystos[*yyssp], yyvsp);
+      YYPOPSTACK (1);
+    }
 #ifndef yyoverflow
   if (yyss != yyssa)
     YYSTACK_FREE (yyss);
 #endif
-  return yyresult;
+#if YYERROR_VERBOSE
+  if (yymsg != yymsgbuf)
+    YYSTACK_FREE (yymsg);
+#endif
+  /* Make sure YYID is used.  */
+  return YYID (yyresult);
 }
 
 
-#line 313 "/home/eitan/SW/SVN/gen2_libsdp/libsdp/src/config_parser.y"
+#line 272 "./config_parser.y"
 
 
 int yyerror(char *msg)
@@ -1574,7 +1862,7 @@
 
 /* parse apollo route dump file */
 int __sdp_parse_config (const char *fileName) {
-  extern FILE * yyin;
+  extern FILE * libsdp_yyin;
    
   /* open the file */
   if (access(fileName, R_OK)) {
@@ -1583,8 +1871,8 @@
 	 return(1);
   }
 
-  yyin = fopen(fileName,"r");
-  if (!yyin) {
+  libsdp_yyin = fopen(fileName,"r");
+  if (!libsdp_yyin) {
 	 printf("libsdp Error: Fail to open File:%s\n", fileName);
 	 return(1);
   }
@@ -1594,7 +1882,7 @@
   /* parse it */
   yyparse();
 
-  fclose(yyin);
+  fclose(libsdp_yyin);
   return(parse_err);
 }
 

Modified: libsdp/branches/upstream/current/src/config_parser.h
===================================================================
--- libsdp/branches/upstream/current/src/config_parser.h	2009-03-14 14:26:29 UTC (rev 216)
+++ libsdp/branches/upstream/current/src/config_parser.h	2009-03-15 09:30:43 UTC (rev 217)
@@ -1,8 +1,10 @@
-/* A Bison parser, made by GNU Bison 1.875c.  */
+/* A Bison parser, made by GNU Bison 2.3.  */
 
-/* Skeleton parser for Yacc-like parsing with Bison,
-   Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003 Free Software Foundation, Inc.
+/* Skeleton interface for Bison's Yacc-like parsers in C
 
+   Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004, 2005, 2006
+   Free Software Foundation, Inc.
+
    This program is free software; you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
    the Free Software Foundation; either version 2, or (at your option)
@@ -15,14 +17,22 @@
 
    You should have received a copy of the GNU General Public License
    along with this program; if not, write to the Free Software
-   Foundation, Inc., 59 Temple Place - Suite 330,
-   Boston, MA 02111-1307, USA.  */
+   Foundation, Inc., 51 Franklin Street, Fifth Floor,
+   Boston, MA 02110-1301, USA.  */
 
-/* As a special exception, when this file is copied by Bison into a
-   Bison output file, you may use that output file without restriction.
-   This special exception was added by the Free Software Foundation
-   in version 1.24 of Bison.  */
+/* As a special exception, you may create a larger work that contains
+   part or all of the Bison parser skeleton and distribute that work
+   under terms of your choice, so long as that work isn't itself a
+   parser generator using the skeleton or a modified version thereof
+   as a parser skeleton.  Alternatively, if you modify or redistribute
+   the parser skeleton itself, you may (at your option) remove this
+   special exception, which will cause the skeleton and the resulting
+   Bison output files to be licensed under the GNU General Public
+   License without this special exception.
 
+   This special exception was added by the Free Software Foundation in
+   version 2.2 of Bison.  */
+
 /* Tokens.  */
 #ifndef YYTOKENTYPE
 # define YYTOKENTYPE
@@ -46,6 +56,7 @@
      LINE = 272
    };
 #endif
+/* Tokens.  */
 #define USE 258
 #define CLIENT 259
 #define SERVER 260
@@ -65,20 +76,20 @@
 
 
 
-#if ! defined (YYSTYPE) && ! defined (YYSTYPE_IS_DECLARED)
-#line 208 "/home/eitan/SW/SVN/gen2_libsdp/libsdp/src/config_parser.y"
-typedef union YYSTYPE {
+#if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED
+typedef union YYSTYPE
+#line 167 "./config_parser.y"
+{
   int        ival;
   char      *sval;
-} YYSTYPE;
-/* Line 1275 of yacc.c.  */
-#line 76 "y.tab.h"
+}
+/* Line 1529 of yacc.c.  */
+#line 88 "y.tab.h"
+	YYSTYPE;
 # define yystype YYSTYPE /* obsolescent; will be withdrawn */
 # define YYSTYPE_IS_DECLARED 1
 # define YYSTYPE_IS_TRIVIAL 1
 #endif
 
-extern YYSTYPE yylval;
+extern YYSTYPE libsdp_yylval;
 
-
-

Modified: libsdp/branches/upstream/current/src/config_parser.y
===================================================================
--- libsdp/branches/upstream/current/src/config_parser.y	2009-03-14 14:26:29 UTC (rev 216)
+++ libsdp/branches/upstream/current/src/config_parser.y	2009-03-15 09:30:43 UTC (rev 217)
@@ -38,47 +38,6 @@
 */
 %{
 
-#define	yymaxdepth libsdp_maxdepth
-#define	yyparse	libsdp_parse
-#define	yylex	libsdp_lex
-#define	yyerror	libsdp_error
-#define	yylval	libsdp_lval
-#define	yychar	libsdp_char
-#define	yydebug	libsdp_debug
-#define	yypact	libsdp_pact
-#define	yyr1	libsdp_r1
-#define	yyr2	libsdp_r2
-#define	yydef	libsdp_def
-#define	yychk	libsdp_chk
-#define	yypgo	libsdp_pgo
-#define	yyact	libsdp_act
-#define	yyexca	libsdp_exca
-#define  yyerrflag libsdp_errflag
-#define  yynerrs	libsdp_nerrs
-#define	yyps	libsdp_ps
-#define	yypv	libsdp_pv
-#define	yys	libsdp_s
-#define	yy_yys	libsdp_yys
-#define	yystate	libsdp_state
-#define	yytmp	libsdp_tmp
-#define	yyv	libsdp_v
-#define	yy_yyv	libsdp_yyv
-#define	yyval	libsdp_val
-#define	yylloc	libsdp_lloc
-#define yyreds	libsdp_reds
-#define yytoks	libsdp_toks
-#define yylhs	libsdp_yylhs
-#define yylen	libsdp_yylen
-#define yydefred libsdp_yydefred
-#define yydgoto	libsdp_yydgoto
-#define yysindex libsdp_yysindex
-#define yyrindex libsdp_yyrindex
-#define yygindex libsdp_yygindex
-#define yytable	 libsdp_yytable
-#define yycheck	 libsdp_yycheck
-#define yyname   libsdp_yyname
-#define yyrule   libsdp_yyrule
-
 /* header section */
 #include <stdlib.h>
 #include <stdio.h>
@@ -347,7 +306,7 @@
 
 /* parse apollo route dump file */
 int __sdp_parse_config (const char *fileName) {
-  extern FILE * yyin;
+  extern FILE * libsdp_yyin;
    
   /* open the file */
   if (access(fileName, R_OK)) {
@@ -356,8 +315,8 @@
 	 return(1);
   }
 
-  yyin = fopen(fileName,"r");
-  if (!yyin) {
+  libsdp_yyin = fopen(fileName,"r");
+  if (!libsdp_yyin) {
 	 printf("libsdp Error: Fail to open File:%s\n", fileName);
 	 return(1);
   }
@@ -367,7 +326,7 @@
   /* parse it */
   yyparse();
 
-  fclose(yyin);
+  fclose(libsdp_yyin);
   return(parse_err);
 }
 

Modified: libsdp/branches/upstream/current/src/config_scanner.c
===================================================================
--- libsdp/branches/upstream/current/src/config_scanner.c	2009-03-14 14:26:29 UTC (rev 216)
+++ libsdp/branches/upstream/current/src/config_scanner.c	2009-03-15 09:30:43 UTC (rev 217)
@@ -1,5 +1,23 @@
-/* A lexical scanner generated by flex */
+#define yy_create_buffer libsdp_yy_create_buffer
+#define yy_delete_buffer libsdp_yy_delete_buffer
+#define yy_scan_buffer libsdp_yy_scan_buffer
+#define yy_scan_string libsdp_yy_scan_string
+#define yy_scan_bytes libsdp_yy_scan_bytes
+#define yy_flex_debug libsdp_yy_flex_debug
+#define yy_init_buffer libsdp_yy_init_buffer
+#define yy_flush_buffer libsdp_yy_flush_buffer
+#define yy_load_buffer_state libsdp_yy_load_buffer_state
+#define yy_switch_to_buffer libsdp_yy_switch_to_buffer
+#define yyin libsdp_yyin
+#define yyleng libsdp_yyleng
+#define yylex libsdp_yylex
+#define yyout libsdp_yyout
+#define yyrestart libsdp_yyrestart
+#define yytext libsdp_yytext
+#define yywrap libsdp_yywrap
 
+/* A lexical scanner generated by flex*/
+
 /* Scanner skeleton version:
  * $Header: /home/daffy/u0/vern/flex/RCS/flex.skl,v 2.91 96/09/10 16:58:48 vern Exp $
  */
@@ -9,6 +27,7 @@
 #define YY_FLEX_MINOR_VERSION 5
 
 #include <stdio.h>
+#include <unistd.h>
 
 
 /* cfront 1.2 defines "c_plusplus" instead of "__cplusplus" */
@@ -22,7 +41,6 @@
 #ifdef __cplusplus
 
 #include <stdlib.h>
-#include <unistd.h>
 
 /* Use prototypes in function declarations. */
 #define YY_USE_PROTOS
@@ -134,6 +152,15 @@
 
 #define unput(c) yyunput( c, yytext_ptr )
 
+/* Some routines like yy_flex_realloc() are emitted as static but are
+   not called by all lexers. This generates warnings in some compilers,
+   notably GCC. Arrange to suppress these. */
+#ifdef __GNUC__
+#define YY_MAY_BE_UNUSED __attribute__((unused))
+#else
+#define YY_MAY_BE_UNUSED
+#endif
+
 /* The following is because we cannot portably get our hands on size_t
  * (without autoconf's help, which isn't available because we want
  * flex-generated scanners to compile on their own).
@@ -240,7 +267,7 @@
 YY_BUFFER_STATE yy_scan_bytes YY_PROTO(( yyconst char *bytes, int len ));
 
 static void *yy_flex_alloc YY_PROTO(( yy_size_t ));
-static void *yy_flex_realloc YY_PROTO(( void *, yy_size_t ));
+static void *yy_flex_realloc YY_PROTO(( void *, yy_size_t )) YY_MAY_BE_UNUSED;
 static void yy_flex_free YY_PROTO(( void * ));
 
 #define yy_new_buffer yy_create_buffer
@@ -464,7 +491,7 @@
 #define YY_MORE_ADJ 0
 #define YY_RESTORE_YY_MORE_OFFSET
 char *yytext;
-#line 1 "/home/eitan/SW/SVN/gen2_libsdp/libsdp/src/config_scanner.l"
+#line 1 "./config_scanner.l"
 #define INITIAL 0
 /*
  * Copyright (c) 2006 Mellanox Technologies Ltd. All rights reserved.
@@ -499,58 +526,27 @@
  *
  * $Id: ibnl_scanner.ll,v 1.4 2005/02/23 21:08:37 eitan Exp $
  */
-#line 36 "/home/eitan/SW/SVN/gen2_libsdp/libsdp/src/config_scanner.l"
+#line 36 "./config_scanner.l"
 
 /* #define DEBUG 1 */
 
-#define	yymaxdepth libsdp_maxdepth
-#define	yyparse	libsdp_parse
-#define	yylex	libsdp_lex
-#define	yyerror	libsdp_error
-#define	yylval	libsdp_lval
-#define	yychar	libsdp_char
-#define	yydebug	libsdp_debug
-#define	yypact	libsdp_pact
-#define	yyr1	libsdp_r1
-#define	yyr2	libsdp_r2
-#define	yydef	libsdp_def
-#define	yychk	libsdp_chk
-#define	yypgo	libsdp_pgo
-#define	yyact	libsdp_act
-#define	yyexca	libsdp_exca
-#define  yyerrflag libsdp_errflag
-#define  yynerrs	libsdp_nerrs
-#define	yyps	libsdp_ps
-#define	yypv	libsdp_pv
-#define	yys	libsdp_s
-#define	yy_yys	libsdp_yys
-#define	yystate	libsdp_state
-#define	yytmp	libsdp_tmp
-#define	yyv	libsdp_v
-#define	yy_yyv	libsdp_yyv
-#define	yyval	libsdp_val
-#define	yylloc	libsdp_lloc
-#define yyreds	libsdp_reds
-#define yytoks	libsdp_toks
-#define yylhs	libsdp_yylhs
-#define yylen	libsdp_yylen
-#define yydefred libsdp_yydefred
-#define yydgoto	libsdp_yydgoto
-#define yysindex libsdp_yysindex
-#define yyrindex libsdp_yyrindex
-#define yygindex libsdp_yygindex
-#define yytable	 libsdp_yytable
-#define yycheck	 libsdp_yycheck
-#define yyname   libsdp_yyname
-#define yyrule   libsdp_yyrule
+#define yyparse libsdp_yyparse
+#define yylex   libsdp_yylex
+#define yyerror libsdp_yyerror
+#define yylval  libsdp_yylval
+#define yychar  libsdp_yychar
+#define yydebug libsdp_yydebug
+#define yynerrs libsdp_yynerrs
 
+#define yywrap  libsdp_yywrap
+
 #include <string.h>
 #include <stdio.h>
 #include "config_parser.h"
 extern long __sdp_config_line_num;
 #define CANNAME 1
 
-#line 554 "lex.yy.c"
+#line 550 "lex.libsdp_yy.c"
 
 /* Macros after this point can all be overridden by user definitions in
  * section 1.
@@ -701,13 +697,13 @@
 YY_DECL
 	{
 	register yy_state_type yy_current_state;
-	register char *yy_cp, *yy_bp;
+	register char *yy_cp = NULL, *yy_bp = NULL;
 	register int yy_act;
 
-#line 86 "/home/eitan/SW/SVN/gen2_libsdp/libsdp/src/config_scanner.l"
+#line 55 "./config_scanner.l"
 
 
-#line 711 "lex.yy.c"
+#line 707 "lex.libsdp_yy.c"
 
 	if ( yy_init )
 		{
@@ -793,12 +789,12 @@
 
 case 1:
 YY_RULE_SETUP
-#line 88 "/home/eitan/SW/SVN/gen2_libsdp/libsdp/src/config_scanner.l"
+#line 57 "./config_scanner.l"
 {}
 	YY_BREAK
 case 2:
 YY_RULE_SETUP
-#line 90 "/home/eitan/SW/SVN/gen2_libsdp/libsdp/src/config_scanner.l"
+#line 59 "./config_scanner.l"
 { 
   yylval.ival = atoi(yytext);
 #ifdef DEBUG
@@ -809,7 +805,7 @@
 	YY_BREAK
 case 3:
 YY_RULE_SETUP
-#line 98 "/home/eitan/SW/SVN/gen2_libsdp/libsdp/src/config_scanner.l"
+#line 67 "./config_scanner.l"
 {
   yylval.ival = LOG;
 #ifdef DEBUG
@@ -820,7 +816,7 @@
 	YY_BREAK
 case 4:
 YY_RULE_SETUP
-#line 106 "/home/eitan/SW/SVN/gen2_libsdp/libsdp/src/config_scanner.l"
+#line 75 "./config_scanner.l"
 {
   yylval.ival = DEST;
 #ifdef DEBUG
@@ -831,7 +827,7 @@
 	YY_BREAK
 case 5:
 YY_RULE_SETUP
-#line 114 "/home/eitan/SW/SVN/gen2_libsdp/libsdp/src/config_scanner.l"
+#line 83 "./config_scanner.l"
 {
   yylval.ival = LEVEL;
 #ifdef DEBUG
@@ -842,7 +838,7 @@
 	YY_BREAK
 case 6:
 YY_RULE_SETUP
-#line 122 "/home/eitan/SW/SVN/gen2_libsdp/libsdp/src/config_scanner.l"
+#line 91 "./config_scanner.l"
 {
   yylval.ival = STDERR;
 #ifdef DEBUG
@@ -853,7 +849,7 @@
 	YY_BREAK
 case 7:
 YY_RULE_SETUP
-#line 130 "/home/eitan/SW/SVN/gen2_libsdp/libsdp/src/config_scanner.l"
+#line 99 "./config_scanner.l"
 {
   yylval.ival = SYSLOG;
 #ifdef DEBUG
@@ -864,7 +860,7 @@
 	YY_BREAK
 case 8:
 YY_RULE_SETUP
-#line 138 "/home/eitan/SW/SVN/gen2_libsdp/libsdp/src/config_scanner.l"
+#line 107 "./config_scanner.l"
 {
   yylval.ival = FILENAME;
 #ifdef DEBUG
@@ -876,7 +872,7 @@
 	YY_BREAK
 case 9:
 YY_RULE_SETUP
-#line 147 "/home/eitan/SW/SVN/gen2_libsdp/libsdp/src/config_scanner.l"
+#line 116 "./config_scanner.l"
 {
   yylval.ival = USE;
 #ifdef DEBUG
@@ -887,7 +883,7 @@
 	YY_BREAK
 case 10:
 YY_RULE_SETUP
-#line 155 "/home/eitan/SW/SVN/gen2_libsdp/libsdp/src/config_scanner.l"
+#line 124 "./config_scanner.l"
 {
   yylval.ival = TCP;
 #ifdef DEBUG
@@ -898,7 +894,7 @@
 	YY_BREAK
 case 11:
 YY_RULE_SETUP
-#line 163 "/home/eitan/SW/SVN/gen2_libsdp/libsdp/src/config_scanner.l"
+#line 132 "./config_scanner.l"
 {
   yylval.ival = SDP;
 #ifdef DEBUG
@@ -909,7 +905,7 @@
 	YY_BREAK
 case 12:
 YY_RULE_SETUP
-#line 171 "/home/eitan/SW/SVN/gen2_libsdp/libsdp/src/config_scanner.l"
+#line 140 "./config_scanner.l"
 {
   yylval.ival = BOTH;
 #ifdef DEBUG
@@ -920,7 +916,7 @@
 	YY_BREAK
 case 13:
 YY_RULE_SETUP
-#line 179 "/home/eitan/SW/SVN/gen2_libsdp/libsdp/src/config_scanner.l"
+#line 148 "./config_scanner.l"
 {
   yylval.ival = CLIENT;
 #ifdef DEBUG
@@ -932,7 +928,7 @@
 	YY_BREAK
 case 14:
 YY_RULE_SETUP
-#line 188 "/home/eitan/SW/SVN/gen2_libsdp/libsdp/src/config_scanner.l"
+#line 157 "./config_scanner.l"
 {
   yylval.ival = SERVER;
 #ifdef DEBUG
@@ -944,7 +940,7 @@
 	YY_BREAK
 case 15:
 YY_RULE_SETUP
-#line 197 "/home/eitan/SW/SVN/gen2_libsdp/libsdp/src/config_scanner.l"
+#line 166 "./config_scanner.l"
 {
 	 yylval.sval = (char *)malloc(strlen(yytext) + 1);
     strcpy(yylval.sval, yytext);
@@ -957,7 +953,7 @@
 	YY_BREAK
 case 16:
 YY_RULE_SETUP
-#line 207 "/home/eitan/SW/SVN/gen2_libsdp/libsdp/src/config_scanner.l"
+#line 176 "./config_scanner.l"
 {
   __sdp_config_line_num++;
 #ifdef DEBUG
@@ -969,19 +965,19 @@
 	YY_BREAK
 case 17:
 YY_RULE_SETUP
-#line 216 "/home/eitan/SW/SVN/gen2_libsdp/libsdp/src/config_scanner.l"
+#line 185 "./config_scanner.l"
 {
   __sdp_config_line_num++;
 }
 	YY_BREAK
 case 18:
 YY_RULE_SETUP
-#line 220 "/home/eitan/SW/SVN/gen2_libsdp/libsdp/src/config_scanner.l"
+#line 189 "./config_scanner.l"
 {}
 	YY_BREAK
 case 19:
 YY_RULE_SETUP
-#line 222 "/home/eitan/SW/SVN/gen2_libsdp/libsdp/src/config_scanner.l"
+#line 191 "./config_scanner.l"
 {
 #ifdef DEBUG
   printf("CHAR:%c\n",yytext[0]);
@@ -991,10 +987,10 @@
 	YY_BREAK
 case 20:
 YY_RULE_SETUP
-#line 229 "/home/eitan/SW/SVN/gen2_libsdp/libsdp/src/config_scanner.l"
+#line 198 "./config_scanner.l"
 ECHO;
 	YY_BREAK
-#line 998 "lex.yy.c"
+#line 994 "lex.libsdp_yy.c"
 case YY_STATE_EOF(INITIAL):
 case YY_STATE_EOF(CANNAME):
 	yyterminate();
@@ -1378,6 +1374,7 @@
 #endif	/* ifndef YY_NO_UNPUT */
 
 
+#ifndef YY_NO_INPUT
 #ifdef __cplusplus
 static int yyinput()
 #else
@@ -1450,8 +1447,8 @@
 
 	return c;
 	}
+#endif /* YY_NO_INPUT */
 
-
 #ifdef YY_USE_PROTOS
 void yyrestart( FILE *input_file )
 #else
@@ -1561,11 +1558,6 @@
 	}
 
 
-#ifndef YY_ALWAYS_INTERACTIVE
-#ifndef YY_NEVER_INTERACTIVE
-extern int isatty YY_PROTO(( int ));
-#endif
-#endif
 
 #ifdef YY_USE_PROTOS
 void yy_init_buffer( YY_BUFFER_STATE b, FILE *file )
@@ -1883,7 +1875,7 @@
 	return 0;
 	}
 #endif
-#line 229 "/home/eitan/SW/SVN/gen2_libsdp/libsdp/src/config_scanner.l"
+#line 198 "./config_scanner.l"
 
 
 int yywrap ()

Modified: libsdp/branches/upstream/current/src/config_scanner.l
===================================================================
--- libsdp/branches/upstream/current/src/config_scanner.l	2009-03-14 14:26:29 UTC (rev 216)
+++ libsdp/branches/upstream/current/src/config_scanner.l	2009-03-15 09:30:43 UTC (rev 217)
@@ -36,47 +36,16 @@
 
 /* #define DEBUG 1 */
 
-#define	yymaxdepth libsdp_maxdepth
-#define	yyparse	libsdp_parse
-#define	yylex	libsdp_lex
-#define	yyerror	libsdp_error
-#define	yylval	libsdp_lval
-#define	yychar	libsdp_char
-#define	yydebug	libsdp_debug
-#define	yypact	libsdp_pact
-#define	yyr1	libsdp_r1
-#define	yyr2	libsdp_r2
-#define	yydef	libsdp_def
-#define	yychk	libsdp_chk
-#define	yypgo	libsdp_pgo
-#define	yyact	libsdp_act
-#define	yyexca	libsdp_exca
-#define  yyerrflag libsdp_errflag
-#define  yynerrs	libsdp_nerrs
-#define	yyps	libsdp_ps
-#define	yypv	libsdp_pv
-#define	yys	libsdp_s
-#define	yy_yys	libsdp_yys
-#define	yystate	libsdp_state
-#define	yytmp	libsdp_tmp
-#define	yyv	libsdp_v
-#define	yy_yyv	libsdp_yyv
-#define	yyval	libsdp_val
-#define	yylloc	libsdp_lloc
-#define yyreds	libsdp_reds
-#define yytoks	libsdp_toks
-#define yylhs	libsdp_yylhs
-#define yylen	libsdp_yylen
-#define yydefred libsdp_yydefred
-#define yydgoto	libsdp_yydgoto
-#define yysindex libsdp_yysindex
-#define yyrindex libsdp_yyrindex
-#define yygindex libsdp_yygindex
-#define yytable	 libsdp_yytable
-#define yycheck	 libsdp_yycheck
-#define yyname   libsdp_yyname
-#define yyrule   libsdp_yyrule
+#define yyparse libsdp_yyparse
+#define yylex   libsdp_yylex
+#define yyerror libsdp_yyerror
+#define yylval  libsdp_yylval
+#define yychar  libsdp_yychar
+#define yydebug libsdp_yydebug
+#define yynerrs libsdp_yynerrs
 
+#define yywrap  libsdp_yywrap
+
 #include <string.h>
 #include <stdio.h>
 #include "config_parser.h"

Modified: libsdp/branches/upstream/current/src/log.c
===================================================================
--- libsdp/branches/upstream/current/src/log.c	2009-03-14 14:26:29 UTC (rev 216)
+++ libsdp/branches/upstream/current/src/log.c	2009-03-15 09:30:43 UTC (rev 217)
@@ -38,6 +38,7 @@
 #include <string.h>
 #include <syslog.h>
 #include <time.h>
+#include <limits.h>
 
 /*
  * SDP specific includes

Modified: libsdp/branches/upstream/current/src/port.c
===================================================================
--- libsdp/branches/upstream/current/src/port.c	2009-03-14 14:26:29 UTC (rev 216)
+++ libsdp/branches/upstream/current/src/port.c	2009-03-15 09:30:43 UTC (rev 217)
@@ -729,15 +729,10 @@
 	int ret = 0;
 
 	void *arg;
-	void *shadow_arg;
 	va_list ap;
-	va_list shadow_ap;
 
 	va_start( ap, cmd );
-	va_copy( shadow_ap, ap );
 	arg = va_arg( ap, void * );
-	shadow_arg = va_arg( shadow_ap, void * );
-
 	va_end( ap );
 
 
@@ -745,26 +740,24 @@
 
 	if ( NULL == _socket_funcs.fcntl ) {
 		__sdp_log( 9, "Error fcntl: no implementation for fcntl found\n" );
-		va_end( shadow_ap );
 		return -1;
 	}
 
 	shadow_fd = get_shadow_fd_by_fd( fd );
 
-	__sdp_log( 2, "FCNTL: <%s:%d:%d> command <%d> argument <%d>\n",
-				  program_invocation_short_name, fd, shadow_fd, cmd, 0 );
+	__sdp_log( 2, "FCNTL: <%s:%d:%d> command <%d> argument <%p>\n",
+				  program_invocation_short_name, fd, shadow_fd, cmd, arg );
 
 	ret = _socket_funcs.fcntl( fd, cmd, arg );
 	if ( ( ret >= 0 ) && ( -1 != shadow_fd ) ) {
-		sret = _socket_funcs.fcntl( shadow_fd, cmd, shadow_arg );
+		sret = _socket_funcs.fcntl( shadow_fd, cmd, arg );
 		if ( sret < 0 ) {
 			__sdp_log( 9, "Error fcntl:"
-						  " <%d> calling fcntl(%d, %d, %x) for SDP socket. Closing it.\n",
-						  shadow_fd, cmd, 0, errno );
+						  " <%d> calling fcntl(%d, %d, %p) for SDP socket. Closing it.\n",
+						  shadow_fd, cmd, arg, errno );
 			cleanup_shadow( fd );
 		}
 	}
-	va_end( shadow_ap );
 
 	__sdp_log( 2, "FCNTL: <%s:%d:%d> result <%d:%d>\n",
 				  program_invocation_short_name, fd, shadow_fd, ret, sret );
@@ -1340,7 +1333,7 @@
 		if ( ret < 0 ) {
 			/* Temporary sockets already closed by check_legal_bind or 
 			 * find_free_port */
-			errno = EINVAL;
+			errno = EADDRINUSE;
 			goto done;
 		}
 
@@ -1430,34 +1423,10 @@
 				  program_invocation_short_name, fd, shadow_fd,
 				  serv_sin->sin_family, buf, ntohs( serv_sin->sin_port ) );
 
-	fopts = _socket_funcs.fcntl(fd, F_GETFL);
-	__sdp_log( 1, "CONNECT: fd <%d> opts are <0x%x>\n",
-		   fd, fopts);
 
 	/* obtain the target address family */
 	target_family = __sdp_match_connect( serv_addr, addrlen );
 
-	if ( ( fopts & O_NONBLOCK ) &&
-	     ( target_family == USE_BOTH ) &&
-	     ( shadow_fd != -1 )) {
-		static int print_once = 1;
-
-		if ( print_once ) {
-			print_once = 0;
-			__sdp_log( 9, "CONNECT: libsdp does not support async connect in BOTH, moving to SDP only\n");
-		}
-
-		target_family = USE_SDP;
-		dup_ret = replace_fd_with_its_shadow( fd );
-		if ( dup_ret < 0 ) {
-			__sdp_log( 9, "Error connect: "
-				   "failed to dup2 shadow into orig fd:%d\n", fd );
-			ret = dup_ret;
-			goto done;
-		}
-		shadow_fd = -1;
-	}
-
 	/* if we do not have a shadow - just do the work */
 	if ( shadow_fd == -1 ) {
 		if ( get_is_sdp_socket( fd ) ) {
@@ -1505,6 +1474,15 @@
 #endif
 
 			__sdp_log( 1, "CONNECT: connecting SDP fd:%d\n", shadow_fd );
+
+			/* make the socket blocking on shadow SDP */
+			fopts = _socket_funcs.fcntl(shadow_fd, F_GETFL);
+			if ( ( target_family == USE_BOTH ) && ( fopts & O_NONBLOCK ) ) {
+				__sdp_log( 1, "CONNECT: shadow_fd <%d> will be blocking during connect\n",
+				           shadow_fd);
+				_socket_funcs.fcntl(shadow_fd, F_SETFL, fopts & (~O_NONBLOCK));
+			}
+
 			ret = _socket_funcs.connect( shadow_fd,
 												  ( struct sockaddr * )&sdp_addr,
 												  sizeof sdp_addr );
@@ -1516,6 +1494,9 @@
 				__sdp_log( 7, "CONNECT: connected SDP fd:%d to:%s port %d\n",
 							  fd, buf, ntohs( serv_sin->sin_port ) );
 			}
+
+			/* restore socket options */
+			_socket_funcs.fcntl(shadow_fd, F_SETFL, fopts);
 		}
 
 		/* if target is SDP or we succeeded we need to dup SDP fd into TCP fd */
@@ -1544,7 +1525,7 @@
 			__sdp_log( 7, "CONNECT: connected TCP fd:%d to:%s port %d\n",
 						  fd, buf, ntohs( serv_sin->sin_port ) );
 
-		if ( ( target_family == USE_TCP ) || ( ret >= 0 ) ) {
+		if ( ( target_family == USE_TCP ) || ( ret >= 0 ) || (errno == EINPROGRESS) ) {
 			if ( cleanup_shadow( fd ) < 0 )
 				__sdp_log( 9, "Error connect: failed to cleanup shadow for fd:%d\n",
 					   fd );




More information about the Pkg-ofed-commits mailing list