AC_DEFINE(DISABLED_THREADSAFE, 1, \
Set to explicitly specify we don't want to use thread-safe functions)
else
+ dnl check for number of arguments to gethostbyname_r. it might take
+ dnl either 3, 5, or 6 arguments.
+ AC_CHECK_FUNCS(gethostbyname_r,[
+ AC_MSG_CHECKING(if gethostbyname_r takes 3 arguments)
+ AC_TRY_RUN([
+#include <string.h>
+#include <sys/types.h>
+#include <netdb.h>
-dnl check for a few thread-safe functions
-
- AC_CHECK_FUNCS( gethostbyname_r \
- gethostbyaddr_r \
- localtime_r \
- inet_ntoa_r
- )
-
- if test "$ac_cv_func_gethostbyname_r" = "yes"; then
-
- dnl **********************************************************************
- dnl Time to make a check for gethostbyname_r
- dnl If it exists, it may use one of three different interfaces
- dnl **********************************************************************
-
- AC_MSG_CHECKING(for gethostbyname_r)
- if test -z "$ac_cv_gethostbyname_args"; then
- AC_TRY_COMPILE(
- [
+int
+main () {
+struct hostent h;
+struct hostent_data hdata;
+char *name = "localhost";
+int rc;
+memset(&h, 0, sizeof(struct hostent));
+memset(&hdata, 0, sizeof(struct hostent_data));
+rc = gethostbyname_r(name, &h, &hdata);
+exit (rc != 0 ? 1 : 0); }],[
+ AC_MSG_RESULT(yes)
+ AC_DEFINE(HAVE_GETHOSTBYNAME_R_3)
+ ac_cv_gethostbyname_args=3],[
+ AC_MSG_RESULT(no)
+ AC_MSG_CHECKING(if gethostbyname_r with -D_REENTRANT takes 3 arguments)
+ AC_TRY_RUN([
+#define _REENTRANT
+
+#include <string.h>
#include <sys/types.h>
-#include <netdb.h>],
- [
+#include <netdb.h>
+
+int
+main () {
struct hostent h;
struct hostent_data hdata;
-char *name;
-int rc;
-rc = gethostbyname_r(name, &h, &hdata);],
- ac_cv_gethostbyname_args=3)
- fi
- if test -z "$ac_cv_gethostbyname_args"; then
- AC_TRY_COMPILE(
- [
+char *name = "localhost";
+int rc;
+memset(&h, 0, sizeof(struct hostent));
+memset(&hdata, 0, sizeof(struct hostent_data));
+rc = gethostbyname_r(name, &h, &hdata);
+exit (rc != 0 ? 1 : 0); }],[
+ AC_MSG_RESULT(yes)
+ AC_DEFINE(HAVE_GETHOSTBYNAME_R_3)
+ AC_DEFINE(NEED_REENTRANT)
+ ac_cv_gethostbyname_args=3],[
+ AC_MSG_RESULT(no)
+ AC_MSG_CHECKING(if gethostbyname_r takes 5 arguments)
+ AC_TRY_RUN([
#include <sys/types.h>
-#include <netdb.h>],
- [
+#include <netdb.h>
+
+int
+main () {
struct hostent *hp;
struct hostent h;
-char *name;
-char buffer[10];
-int h_errno;
-hp = gethostbyname_r(name, &h, buffer, 10, &h_errno);],
- ac_cv_gethostbyname_args=5)
- fi
- if test -z "$ac_cv_gethostbyname_args"; then
- AC_TRY_COMPILE(
- [
+char *name = "localhost";
+char buffer[8192];
+int h_errno;
+hp = gethostbyname_r(name, &h, buffer, 8192, &h_errno);
+exit (hp == NULL ? 1 : 0); }],[
+ AC_MSG_RESULT(yes)
+ AC_DEFINE(HAVE_GETHOSTBYNAME_R_5)
+ ac_cv_gethostbyname_args=5],[
+ AC_MSG_RESULT(no)
+ AC_MSG_CHECKING(if gethostbyname_r takes 6 arguments)
+ AC_TRY_RUN([
#include <sys/types.h>
-#include <netdb.h>],
- [
+#include <netdb.h>
+
+int
+main () {
struct hostent h;
struct hostent *hp;
-char *name;
+char *name = "localhost";
char buf[10];
int rc;
int h_errno;
-
rc = gethostbyname_r(name, &h, buf, 10, &hp, &h_errno);
- ],
- ac_cv_gethostbyname_args=6)
- fi
- if test -z "$ac_cv_gethostbyname_args"; then
- AC_MSG_RESULT(no)
- have_missing_r_funcs="$have_missing_r_funcs gethostbyname_r"
- else
- if test "$ac_cv_gethostbyname_args" = 3; then
- AC_DEFINE(HAVE_GETHOSTBYNAME_R_3)
- elif test "$ac_cv_gethostbyname_args" = 5; then
- AC_DEFINE(HAVE_GETHOSTBYNAME_R_5)
- elif test "$ac_cv_gethostbyname_args" = 6; then
- AC_DEFINE(HAVE_GETHOSTBYNAME_R_6)
- fi
- AC_MSG_RESULT([yes, and it takes $ac_cv_gethostbyname_args arguments])
- fi
-
-dnl **********************************************************************
-dnl Time to make a check for gethostbyaddr_r
-dnl If it exists, it may use one of three different interfaces
-dnl **********************************************************************
- AC_MSG_CHECKING(for gethostbyaddr_r)
- if test -z "$ac_cv_gethostbyaddr_args"; then
- AC_TRY_COMPILE(
- [
+exit (rc != 0 ? 1 : 0); }],[
+ AC_MSG_RESULT(yes)
+ AC_DEFINE(HAVE_GETHOSTBYNAME_R_6)
+ ac_cv_gethostbyname_args=6],[
+ AC_MSG_RESULT(no)
+ have_missing_r_funcs="$have_missing_r_funcs gethostbyname_r"])])])])])
+
+ dnl check for number of arguments to gethostbyaddr_r. it might take
+ dnl either 5, 7, or 8 arguments.
+ AC_CHECK_FUNCS(gethostbyaddr_r,[
+ AC_MSG_CHECKING(if gethostbyaddr_r takes 5 arguments)
+ AC_TRY_COMPILE([
#include <sys/types.h>
-#include <netdb.h>],
- [
- char * address;
- int length;
- int type;
- struct hostent h;
- struct hostent_data hdata;
- int rc;
- rc = gethostbyaddr_r(address, length, type, &h, &hdata);
- ],
- ac_cv_gethostbyaddr_args=5)
-
- fi
- if test -z "$ac_cv_gethostbyaddr_args"; then
- AC_TRY_COMPILE(
- [
+#include <netdb.h>],[
+char * address;
+int length;
+int type;
+struct hostent h;
+struct hostent_data hdata;
+int rc;
+rc = gethostbyaddr_r(address, length, type, &h, &hdata);],[
+ AC_MSG_RESULT(yes)
+ AC_DEFINE(HAVE_GETHOSTBYADDR_R_5)
+ ac_cv_gethostbyaddr_args=5],[
+ AC_MSG_RESULT(no)
+ AC_MSG_CHECKING(if gethostbyaddr_r with -D_REENTRANT takes 5 arguments)
+ AC_TRY_COMPILE([
+#define _REENTRANT
#include <sys/types.h>
-#include <netdb.h>],
- [
- char * address;
- int length;
- int type;
- struct hostent h;
- char buffer[10];
- int buflen;
- int h_errnop;
- struct hostent * hp;
-
- hp = gethostbyaddr_r(address, length, type, &h,
- buffer, buflen, &h_errnop);
- ],
- ac_cv_gethostbyaddr_args=7)
- fi
-
- if test -z "$ac_cv_gethostbyaddr_args"; then
- AC_TRY_COMPILE(
- [
+#include <netdb.h>],[
+char * address;
+int length;
+int type;
+struct hostent h;
+struct hostent_data hdata;
+int rc;
+rc = gethostbyaddr_r(address, length, type, &h, &hdata);],[
+ AC_MSG_RESULT(yes)
+ AC_DEFINE(HAVE_GETHOSTBYADDR_R_5)
+ AC_DEFINE(NEED_REENTRANT)
+ ac_cv_gethostbyaddr_args=5],[
+ AC_MSG_RESULT(no)
+ AC_MSG_CHECKING(if gethostbyaddr_r takes 7 arguments)
+ AC_TRY_COMPILE([
#include <sys/types.h>
-#include <netdb.h>],
- [
- char * address;
- int length;
- int type;
- struct hostent h;
- char buffer[10];
- int buflen;
- int h_errnop;
- struct hostent * hp;
- int rc;
-
- rc = gethostbyaddr_r(address, length, type, &h,
- buffer, buflen, &hp, &h_errnop);
- ],
- ac_cv_gethostbyaddr_args=8)
- fi
- if test -z "$ac_cv_gethostbyaddr_args"; then
- AC_MSG_RESULT(no)
- have_missing_r_funcs="$have_missing_r_funcs gethostbyaddr_r"
- else
- if test "$ac_cv_gethostbyaddr_args" = 5; then
- AC_DEFINE(HAVE_GETHOSTBYADDR_R_5)
- elif test "$ac_cv_gethostbyaddr_args" = 7; then
- AC_DEFINE(HAVE_GETHOSTBYADDR_R_7)
- elif test "$ac_cv_gethostbyaddr_args" = 8; then
- AC_DEFINE(HAVE_GETHOSTBYADDR_R_8)
- fi
- AC_MSG_RESULT([yes, and it takes $ac_cv_gethostbyaddr_args arguments])
- fi
-
- fi
+#include <netdb.h>],[
+char * address;
+int length;
+int type;
+struct hostent h;
+char buffer[10];
+int buflen;
+int h_errnop;
+struct hostent * hp;
+
+hp = gethostbyaddr_r(address, length, type, &h,
+ buffer, buflen, &h_errnop);],[
+ AC_MSG_RESULT(yes)
+ AC_DEFINE(HAVE_GETHOSTBYADDR_R_7)
+ ac_cv_gethostbyaddr_args=7],[
+ AC_MSG_RESULT(no)
+ AC_MSG_CHECKING(if gethostbyaddr_r takes 8 arguments)
+ AC_TRY_COMPILE([
+#include <sys/types.h>
+#include <netdb.h>],[
+char * address;
+int length;
+int type;
+struct hostent h;
+char buffer[10];
+int buflen;
+int h_errnop;
+struct hostent * hp;
+int rc;
+rc = gethostbyaddr_r(address, length, type, &h,
+ buffer, buflen, &hp, &h_errnop);],[
+ AC_MSG_RESULT(yes)
+ AC_DEFINE(HAVE_GETHOSTBYADDR_R_8)
+ ac_cv_gethostbyaddr_args=8],[
+ AC_MSG_RESULT(no)
+ have_missing_r_funcs="$have_missing_r_funcs gethostbyaddr_r"])])])])])
+
+ dnl determine if function definition for inet_ntoa_r exists.
+ AC_CHECK_FUNCS(inet_ntoa_r,[
+ AC_MSG_CHECKING(whether inet_ntoa_r is declared)
+ AC_EGREP_CPP(inet_ntoa_r,[
+#include <arpa/inet.h>],[
+ AC_DEFINE(HAVE_INET_NTOA_R_DECL)
+ AC_MSG_RESULT(yes)],[
+ AC_MSG_RESULT(no)
+ AC_MSG_CHECKING(whether inet_ntoa_r with -D_REENTRANT is declared)
+ AC_EGREP_CPP(inet_ntoa_r,[
+#define _REENTRANT
+#include <arpa/inet.h>],[
+ AC_DEFINE(HAVE_INET_NTOA_R_DECL)
+ AC_DEFINE(NEED_REENTRANT)
+ AC_MSG_RESULT(yes)],
+ AC_MSG_RESULT(no))])])
+
+ dnl check for a few thread-safe functions
+ AC_CHECK_FUNCS(localtime_r,[
+ AC_MSG_CHECKING(whether localtime_r is declared)
+ AC_EGREP_CPP(localtime_r,[
+#include <time.h>],[
+ AC_MSG_RESULT(yes)],[
+ AC_MSG_RESULT(no)
+ AC_MSG_CHECKING(whether localtime_r with -D_REENTRANT is declared)
+ AC_EGREP_CPP(localtime_r,[
+#define _REENTRANT
+#include <time.h>],[
+ AC_DEFINE(NEED_REENTRANT)
+ AC_MSG_RESULT(yes)],
+ AC_MSG_RESULT(no))])])
fi
-
dnl **********************************************************************
dnl Back to "normal" configuring
dnl **********************************************************************
arpa/inet.h \
net/if.h \
netinet/in.h \
+ netinet/if_ether.h \
netdb.h \
sys/select.h \
sys/socket.h \
** This code is in the public domain and has no copyright.
*/
-#define _REENTRANT /* Necessary to use in Solaris, since the silly guys at Sun
- made the localtime_r() prototype dependent on it (or
- _POSIX_C_SOURCE or _POSIX_PTHREAD_SEMANTICS). */
-
#ifdef HAVE_CONFIG_H
# include "config.h"
# ifdef HAVE_ALLOCA_H
# include <alloca.h>
# endif
+
+# ifdef NEED_REENTRANT
+# define _REENTRANT /* Necessary to use in Solaris, since the silly guys at
+ Sun made the localtime_r() prototype dependent on it
+ (or _POSIX_C_SOURCE or _POSIX_PTHREAD_SEMANTICS) */
+# endif
+
# ifdef HAVE_TIME_H
# include <time.h>
# endif
static int yyRelYear;
-#line 202 "getdate.y"
+#line 205 "getdate.y"
typedef union {
int Number;
enum _MERIDIAN Meridian;
#if YYDEBUG != 0
static const short yyrline[] = { 0,
- 218, 219, 222, 225, 228, 231, 234, 237, 240, 246,
- 252, 261, 267, 279, 282, 285, 291, 295, 299, 305,
- 309, 327, 333, 339, 343, 348, 352, 359, 367, 370,
- 373, 376, 379, 382, 385, 388, 391, 394, 397, 400,
- 403, 406, 409, 412, 415, 418, 421, 426, 459, 463
+ 221, 222, 225, 228, 231, 234, 237, 240, 243, 249,
+ 255, 264, 270, 282, 285, 288, 294, 298, 302, 308,
+ 312, 330, 336, 342, 346, 351, 355, 362, 370, 373,
+ 376, 379, 382, 385, 388, 391, 394, 397, 400, 403,
+ 406, 409, 412, 415, 418, 421, 424, 429, 462, 466
};
#endif
56
};
/* -*-C-*- Note some compilers choke on comments on `#line' lines. */
-#line 3 "/usr/local/share/bison.simple"
+#line 3 "/opt/TWWfsw/bison/share/bison.simple"
/* This file comes from bison-1.28. */
/* Skeleton output parser for bison,
#endif
#endif
\f
-#line 217 "/usr/local/share/bison.simple"
+#line 217 "/opt/TWWfsw/bison/share/bison.simple"
/* The user can define YYPARSE_PARAM as the name of an argument to be passed
into yyparse. The argument should have type void *.
switch (yyn) {
case 3:
-#line 222 "getdate.y"
+#line 225 "getdate.y"
{
yyHaveTime++;
;
break;}
case 4:
-#line 225 "getdate.y"
+#line 228 "getdate.y"
{
yyHaveZone++;
;
break;}
case 5:
-#line 228 "getdate.y"
+#line 231 "getdate.y"
{
yyHaveDate++;
;
break;}
case 6:
-#line 231 "getdate.y"
+#line 234 "getdate.y"
{
yyHaveDay++;
;
break;}
case 7:
-#line 234 "getdate.y"
+#line 237 "getdate.y"
{
yyHaveRel++;
;
break;}
case 9:
-#line 240 "getdate.y"
+#line 243 "getdate.y"
{
yyHour = yyvsp[-1].Number;
yyMinutes = 0;
;
break;}
case 10:
-#line 246 "getdate.y"
+#line 249 "getdate.y"
{
yyHour = yyvsp[-3].Number;
yyMinutes = yyvsp[-1].Number;
;
break;}
case 11:
-#line 252 "getdate.y"
+#line 255 "getdate.y"
{
yyHour = yyvsp[-3].Number;
yyMinutes = yyvsp[-1].Number;
;
break;}
case 12:
-#line 261 "getdate.y"
+#line 264 "getdate.y"
{
yyHour = yyvsp[-5].Number;
yyMinutes = yyvsp[-3].Number;
;
break;}
case 13:
-#line 267 "getdate.y"
+#line 270 "getdate.y"
{
yyHour = yyvsp[-5].Number;
yyMinutes = yyvsp[-3].Number;
;
break;}
case 14:
-#line 279 "getdate.y"
+#line 282 "getdate.y"
{
yyTimezone = yyvsp[0].Number;
;
break;}
case 15:
-#line 282 "getdate.y"
+#line 285 "getdate.y"
{
yyTimezone = yyvsp[0].Number - 60;
;
break;}
case 16:
-#line 286 "getdate.y"
+#line 289 "getdate.y"
{
yyTimezone = yyvsp[-1].Number - 60;
;
break;}
case 17:
-#line 291 "getdate.y"
+#line 294 "getdate.y"
{
yyDayOrdinal = 1;
yyDayNumber = yyvsp[0].Number;
;
break;}
case 18:
-#line 295 "getdate.y"
+#line 298 "getdate.y"
{
yyDayOrdinal = 1;
yyDayNumber = yyvsp[-1].Number;
;
break;}
case 19:
-#line 299 "getdate.y"
+#line 302 "getdate.y"
{
yyDayOrdinal = yyvsp[-1].Number;
yyDayNumber = yyvsp[0].Number;
;
break;}
case 20:
-#line 305 "getdate.y"
+#line 308 "getdate.y"
{
yyMonth = yyvsp[-2].Number;
yyDay = yyvsp[0].Number;
;
break;}
case 21:
-#line 309 "getdate.y"
+#line 312 "getdate.y"
{
/* Interpret as YYYY/MM/DD if $1 >= 1000, otherwise as MM/DD/YY.
The goal in recognizing YYYY/MM/DD is solely to support legacy
;
break;}
case 22:
-#line 327 "getdate.y"
+#line 330 "getdate.y"
{
/* ISO 8601 format. yyyy-mm-dd. */
yyYear = yyvsp[-2].Number;
;
break;}
case 23:
-#line 333 "getdate.y"
+#line 336 "getdate.y"
{
/* e.g. 17-JUN-1992. */
yyDay = yyvsp[-2].Number;
;
break;}
case 24:
-#line 339 "getdate.y"
+#line 342 "getdate.y"
{
yyMonth = yyvsp[-1].Number;
yyDay = yyvsp[0].Number;
;
break;}
case 25:
-#line 343 "getdate.y"
+#line 346 "getdate.y"
{
yyMonth = yyvsp[-3].Number;
yyDay = yyvsp[-2].Number;
;
break;}
case 26:
-#line 348 "getdate.y"
+#line 351 "getdate.y"
{
yyMonth = yyvsp[0].Number;
yyDay = yyvsp[-1].Number;
;
break;}
case 27:
-#line 352 "getdate.y"
+#line 355 "getdate.y"
{
yyMonth = yyvsp[-1].Number;
yyDay = yyvsp[-2].Number;
;
break;}
case 28:
-#line 359 "getdate.y"
+#line 362 "getdate.y"
{
yyRelSeconds = -yyRelSeconds;
yyRelMinutes = -yyRelMinutes;
;
break;}
case 30:
-#line 370 "getdate.y"
+#line 373 "getdate.y"
{
yyRelYear += yyvsp[-1].Number * yyvsp[0].Number;
;
break;}
case 31:
-#line 373 "getdate.y"
+#line 376 "getdate.y"
{
yyRelYear += yyvsp[-1].Number * yyvsp[0].Number;
;
break;}
case 32:
-#line 376 "getdate.y"
+#line 379 "getdate.y"
{
yyRelYear += yyvsp[0].Number;
;
break;}
case 33:
-#line 379 "getdate.y"
+#line 382 "getdate.y"
{
yyRelMonth += yyvsp[-1].Number * yyvsp[0].Number;
;
break;}
case 34:
-#line 382 "getdate.y"
+#line 385 "getdate.y"
{
yyRelMonth += yyvsp[-1].Number * yyvsp[0].Number;
;
break;}
case 35:
-#line 385 "getdate.y"
+#line 388 "getdate.y"
{
yyRelMonth += yyvsp[0].Number;
;
break;}
case 36:
-#line 388 "getdate.y"
+#line 391 "getdate.y"
{
yyRelDay += yyvsp[-1].Number * yyvsp[0].Number;
;
break;}
case 37:
-#line 391 "getdate.y"
+#line 394 "getdate.y"
{
yyRelDay += yyvsp[-1].Number * yyvsp[0].Number;
;
break;}
case 38:
-#line 394 "getdate.y"
+#line 397 "getdate.y"
{
yyRelDay += yyvsp[0].Number;
;
break;}
case 39:
-#line 397 "getdate.y"
+#line 400 "getdate.y"
{
yyRelHour += yyvsp[-1].Number * yyvsp[0].Number;
;
break;}
case 40:
-#line 400 "getdate.y"
+#line 403 "getdate.y"
{
yyRelHour += yyvsp[-1].Number * yyvsp[0].Number;
;
break;}
case 41:
-#line 403 "getdate.y"
+#line 406 "getdate.y"
{
yyRelHour += yyvsp[0].Number;
;
break;}
case 42:
-#line 406 "getdate.y"
+#line 409 "getdate.y"
{
yyRelMinutes += yyvsp[-1].Number * yyvsp[0].Number;
;
break;}
case 43:
-#line 409 "getdate.y"
+#line 412 "getdate.y"
{
yyRelMinutes += yyvsp[-1].Number * yyvsp[0].Number;
;
break;}
case 44:
-#line 412 "getdate.y"
+#line 415 "getdate.y"
{
yyRelMinutes += yyvsp[0].Number;
;
break;}
case 45:
-#line 415 "getdate.y"
+#line 418 "getdate.y"
{
yyRelSeconds += yyvsp[-1].Number * yyvsp[0].Number;
;
break;}
case 46:
-#line 418 "getdate.y"
+#line 421 "getdate.y"
{
yyRelSeconds += yyvsp[-1].Number * yyvsp[0].Number;
;
break;}
case 47:
-#line 421 "getdate.y"
+#line 424 "getdate.y"
{
yyRelSeconds += yyvsp[0].Number;
;
break;}
case 48:
-#line 427 "getdate.y"
+#line 430 "getdate.y"
{
if (yyHaveTime && yyHaveDate && !yyHaveRel)
yyYear = yyvsp[0].Number;
;
break;}
case 49:
-#line 460 "getdate.y"
+#line 463 "getdate.y"
{
yyval.Meridian = MER24;
;
break;}
case 50:
-#line 464 "getdate.y"
+#line 467 "getdate.y"
{
yyval.Meridian = yyvsp[0].Meridian;
;
break;}
}
/* the action file gets copied in in place of this dollarsign */
-#line 543 "/usr/local/share/bison.simple"
+#line 543 "/opt/TWWfsw/bison/share/bison.simple"
\f
yyvsp -= yylen;
yyssp -= yylen;
}
return 1;
}
-#line 469 "getdate.y"
+#line 472 "getdate.y"
/* Include this file down here because bison inserts code above which