Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Cruft eradication
authormquinson <mquinson@48e7efb5-ca39-0410-a469-dd3cf9ba447f>
Tue, 29 Jun 2004 04:06:31 +0000 (04:06 +0000)
committermquinson <mquinson@48e7efb5-ca39-0410-a469-dd3cf9ba447f>
Tue, 29 Jun 2004 04:06:31 +0000 (04:06 +0000)
git-svn-id: svn+ssh://scm.gforge.inria.fr/svn/simgrid/simgrid/trunk@142 48e7efb5-ca39-0410-a469-dd3cf9ba447f

50 files changed:
src/nws_portability/.cvsignore [deleted file]
src/nws_portability/Copyright [deleted file]
src/nws_portability/Forecast/Makefile [deleted file]
src/nws_portability/Forecast/exp_smooth.c [deleted file]
src/nws_portability/Forecast/fbuff.c [deleted file]
src/nws_portability/Forecast/forc.c [deleted file]
src/nws_portability/Forecast/forecast_api.c [deleted file]
src/nws_portability/Forecast/forecasters.c [deleted file]
src/nws_portability/Forecast/last_value.c [deleted file]
src/nws_portability/Forecast/median.c [deleted file]
src/nws_portability/Forecast/mse_forc.c [deleted file]
src/nws_portability/Forecast/predictor.c [deleted file]
src/nws_portability/Forecast/run_mean.c [deleted file]
src/nws_portability/Include/.cvsignore [deleted file]
src/nws_portability/Include/Makefile [deleted file]
src/nws_portability/Include/config_portability.h.in [deleted file]
src/nws_portability/Include/diagnostic.h [deleted file]
src/nws_portability/Include/dnsutil.h [deleted file]
src/nws_portability/Include/exp_smooth.h [deleted file]
src/nws_portability/Include/fbuff.h [deleted file]
src/nws_portability/Include/forc.h [deleted file]
src/nws_portability/Include/forecast_api.h [deleted file]
src/nws_portability/Include/forecasters.h [deleted file]
src/nws_portability/Include/formatutil.h [deleted file]
src/nws_portability/Include/last_value.h [deleted file]
src/nws_portability/Include/median.h [deleted file]
src/nws_portability/Include/messages.h [deleted file]
src/nws_portability/Include/mse_forc.h [deleted file]
src/nws_portability/Include/osutil.h [deleted file]
src/nws_portability/Include/predictor.h [deleted file]
src/nws_portability/Include/protocol.h [deleted file]
src/nws_portability/Include/run_mean.h [deleted file]
src/nws_portability/Include/strutil.h [deleted file]
src/nws_portability/Include/timeouts.h [deleted file]
src/nws_portability/Makedefs.in [deleted file]
src/nws_portability/Makefile [deleted file]
src/nws_portability/README [deleted file]
src/nws_portability/config.guess [deleted file]
src/nws_portability/config.sub [deleted file]
src/nws_portability/configure [deleted file]
src/nws_portability/configure.in [deleted file]
src/nws_portability/diagnostic.c [deleted file]
src/nws_portability/dnsutil.c [deleted file]
src/nws_portability/formatutil.c [deleted file]
src/nws_portability/install-sh [deleted file]
src/nws_portability/messages.c [deleted file]
src/nws_portability/osutil.c [deleted file]
src/nws_portability/protocol.c [deleted file]
src/nws_portability/strutil.c [deleted file]
src/nws_portability/timeouts.c [deleted file]

diff --git a/src/nws_portability/.cvsignore b/src/nws_portability/.cvsignore
deleted file mode 100644 (file)
index dc4ea0b..0000000
+++ /dev/null
@@ -1 +0,0 @@
-Makedefs build-* config.log config.status
diff --git a/src/nws_portability/Copyright b/src/nws_portability/Copyright
deleted file mode 100644 (file)
index ba08528..0000000
+++ /dev/null
@@ -1,28 +0,0 @@
-Copyright (c) 2002, The Regents of the University of California
-All rights reserved.
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-Redistributions of source code must retain the above copyright notice, this
-list of conditions and the following disclaimer.
-
-Redistributions in binary form must reproduce the above copyright notice,
-this list of conditions and the following disclaimer in the documentation
-and/or other materials provided with the distribution.
-Neither the names of the University of California, nor the names of its
-contributors may be used to endorse or promote products derived from this
-software without specific prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
-LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
-CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
-SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
-INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
-CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
-ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
-POSSIBILITY OF SUCH DAMAGE.
-
diff --git a/src/nws_portability/Forecast/Makefile b/src/nws_portability/Forecast/Makefile
deleted file mode 100644 (file)
index a69fbae..0000000
+++ /dev/null
@@ -1,42 +0,0 @@
-#
-# Makefile for Forecaster
-
-# include common variables
-include ../Makedefs
-
-# these are the targets
-LIBRARY = $(buildlibdir)/libNwsForecast.a
-
-# objects we are creating here
-OBJS   =       $(buildobjdir)/exp_smooth.o \
-               $(buildobjdir)/fbuff.o \
-               $(buildobjdir)/forc.o \
-               $(buildobjdir)/forecast_api.o \
-               $(buildobjdir)/last_value.o \
-               $(buildobjdir)/median.o \
-               $(buildobjdir)/mse_forc.o \
-               $(buildobjdir)/run_mean.o
-
-.PHONY: all clean dist
-
-all: $(LIBRARY) 
-
-clean:
-       @$(RM) -f $(OBJS) 
-
-dist:
-       @$(INSTALL) -d $(DIST_ROOT)/Forecast
-       @$(CP) Makefile *.c $(DIST_ROOT)/Forecast
-
-$(LIBRARY): $(OBJS)
-       $(AR) $(ARFLAGS) $@ $(OBJS)
-       $(RANLIB) $@
-
-#pure:
-#      $(MAKE) LD="$(PURIFY) $(LD)"
-
-
-# Compilation rules for C.
-$(buildobjdir)/%.o : %.c ../Include/config_portability.h ../Include/%.h ../Include/forc.h
-       $(CC) $(INCLUDES) $(CFLAGS) -g -c $< -o $@
-
diff --git a/src/nws_portability/Forecast/exp_smooth.c b/src/nws_portability/Forecast/exp_smooth.c
deleted file mode 100644 (file)
index 0615f63..0000000
+++ /dev/null
@@ -1,104 +0,0 @@
-/* $Id$ */
-
-#include <unistd.h>
-#include <stdlib.h>
-#include <stdio.h>
-#include <math.h>
-#include <string.h>
-#include <strings.h>
-
-#include "fbuff.h"
-#include "exp_smooth.h"
-
-struct exp_smooth_state
-{
-       fbuff series;                   /* the series so far */
-       fbuff time_stamps;              /* the time stamps */
-       double last_pred;
-       double gain;
-};
-
-/*
- * init local state.  can save a copy of the pointer to the
- * series and time stamps, if desired
- */
-char *
-InitExpSmooth(fbuff series, fbuff time_stamps, char *params)
-{
-       struct exp_smooth_state *state;
-       double gain;
-       char *p_str;
-       
-       state = (struct exp_smooth_state *)
-               malloc(sizeof(struct exp_smooth_state));
-       
-       if(state == NULL)
-       {
-               return(NULL);
-       }
-       
-       if(params == NULL)
-       {
-               free(state);
-               return(NULL);
-       }
-       
-       p_str = params;
-       gain = strtod(p_str,&p_str);
-       
-       /*
-        * all functions take a series and time_stamps
-        */
-       state->series = series;
-       state->time_stamps = time_stamps;
-       state->last_pred = 0.0;
-       state->gain = gain;
-       
-       return((char *)state);
-}
-
-void
-FreeExpSmooth(char *state)
-{
-       free(state);
-       return;
-}
-
-void
-UpdateExpSmooth(char *state,
-               double ts,
-               double value)
-{
-       double pred;
-       struct exp_smooth_state *s = (struct exp_smooth_state *)state;
-
-       pred = s->last_pred + s->gain * (value - s->last_pred);
-       
-       /*
-        * if there is only one value, last pred is the first valeu in the
-        * series
-        */
-       if(F_COUNT(s->series) <= 1)
-       {
-               s->last_pred = F_VAL(s->series,F_FIRST(s->series));
-       }
-       else
-       {
-               s->last_pred = pred;
-       }
-
-       return;
-}
-
-int
-ForcExpSmooth(char *state, double *v)
-{
-       struct exp_smooth_state *s = (struct exp_smooth_state *)state;
-       
-       *v = s->last_pred;
-
-       return(1);
-
-}
-
-
diff --git a/src/nws_portability/Forecast/fbuff.c b/src/nws_portability/Forecast/fbuff.c
deleted file mode 100644 (file)
index d5de930..0000000
+++ /dev/null
@@ -1,72 +0,0 @@
-/* $Id$ */
-
-#include <unistd.h>
-#include <stdlib.h>
-#include <stdio.h>
-#include <math.h>
-
-#include "fbuff.h"
-
-fbuff
-InitFBuff(int size)
-{
-       fbuff lb;
-
-       lb = (fbuff)malloc(FBUFF_SIZE);
-
-       if(lb == NULL)
-       {
-               fprintf(stderr,"InitFBuff: couldn't get space for fbuff\n");
-               fflush(stderr);
-               return(NULL);
-       }
-
-       /*
-        * count from bottom to top
-        *
-        * head is the next available space
-        * tail is the last valid data item
-        */
-       lb->size = size;
-       lb->head = size - 1;
-       lb->tail = 0;
-
-       lb->vals = (double *)malloc(size*sizeof(double));
-       if(lb->vals == NULL)
-       {
-               fprintf(stderr,"InitFBuff: couldn't get space for vals\n");
-               fflush(stderr);
-               free(lb);
-               return(NULL);
-       }
-
-       return(lb);
-
-}
-
-void
-FreeFBuff(fbuff fb)
-{
-       free(fb->vals);
-       free(fb);
-       
-       return;
-}
-
-void
-UpdateFBuff(fbuff fb, double val)
-{
-       F_HEAD(fb) = val;
-       fb->head = MODMINUS(fb->head,1,fb->size);
-       
-       /*
-        * if we have moved the head over the tail, bump the tail around too
-        */
-       if(fb->head == fb->tail)
-       {
-               fb->tail = MODMINUS(fb->tail,1,fb->size);
-       }
-       
-       return;
-}
-
diff --git a/src/nws_portability/Forecast/forc.c b/src/nws_portability/Forecast/forc.c
deleted file mode 100644 (file)
index e59e6ba..0000000
+++ /dev/null
@@ -1,1152 +0,0 @@
-#include <unistd.h>
-#include <stdlib.h>
-#include <stdio.h>
-#include <math.h>
-#include <string.h>
-#include <strings.h>
-
-
-
-/*
- * individual forecaster packages
- */
-#include "forecasters.h"
-
-#include "mse_forc.h"
-#include "forc.h"
-
-#define FORECASTER(name,init,params,freer,update,forecaster)   \
-{                                                              \
-       frb = InitForcB(series,                                 \
-                       time_stamps,                            \
-                       (name),                                 \
-                       (init),                                 \
-                       (params),                               \
-                       (freer),                                \
-                       (update),                               \
-                       (forecaster));                          \
-                                                               \
-       if(frb == NULL)                                         \
-       {                                                       \
-               free(l_forcl);                                  \
-               free(forcs);                                    \
-               free(derived_forcs);                            \
-               FreeFBuff(series);                              \
-               FreeFBuff(time_stamps);                         \
-               return(NULL);                                   \
-       }                                                       \
-                                                               \
-       frb->series = series;                                   \
-       frb->time_stamps = time_stamps;                         \
-       forcs[l_forcl->count] = frb;                            \
-       l_forcl->count = l_forcl->count + 1;                    \
-}
-
-
-#define DERIVED_FORC(name,init,params,freer,update,forecaster)         \
-{                                                              \
-       frb = InitForcB(series,                                 \
-                 time_stamps,                                  \
-                 (name),                                       \
-                 (init),                                       \
-                 (params),                                     \
-                 (freer),                                      \
-                 (update),                                     \
-                 (forecaster));                                \
-                                                               \
-       if(frb == NULL)                                         \
-       {                                                       \
-               free((char *)forcs);                                    \
-               free((char *)derived_forcs);                            \
-               FreeFBuff(series);                              \
-               FreeFBuff(time_stamps);                         \
-               for(i=0; i < l_forcl->count; i++)               \
-               {                                               \
-                       FreeForcB(l_forcl->forcs[i]);           \
-               }                                               \
-               free((char *)l_forcl);                                  \
-               return(NULL);                                   \
-       }                                                       \
-       frb->series = series;                                   \
-       frb->time_stamps = time_stamps;                         \
-       derived_forcs[l_forcl->derived_count] = frb;            \
-       l_forcl->derived_count = l_forcl->derived_count + 1;    \
-}
-
-forcb
-InitForcB(fbuff series,
-         fbuff time_stamps,
-         const char *name,
-         char *(*init)(),
-         const char *params,
-         void (*freer)(),
-         void (*update)(),
-         int (*forecast)())
-{
-       forcb frb;
-       
-       frb = (forcb)malloc(FORCB_SIZE);
-       
-       
-       if(frb == NULL)
-       {
-               return(NULL);
-       }
-       
-       /*
-        * get fbuff space for the cumulative error series -- needed
-        * for windowed MSE and MAE predictions
-        */
-       frb->se_series = InitFBuff(MAX_MSE_WIN);
-
-       if(frb->se_series == NULL)
-       {
-               free(frb);
-               return(NULL);
-       }
-       
-       frb->ae_series = InitFBuff(MAX_MSE_WIN);
-
-       if(frb->se_series == NULL)
-       {
-               FreeFBuff(frb->se_series);
-               free(frb);
-               return(NULL);
-       }
-       /*
-        * could be NULL because of derived forecasters
-        */
-       if(init != NULL)
-       {
-               frb->state = (*init)(series,time_stamps,params);
-               if(frb == NULL)
-               {
-                       FreeFBuff(frb->se_series);
-                       FreeFBuff(frb->ae_series);
-                       free(frb);
-                       fprintf(stderr,"InitForcB: init failed for %s\n",
-                                       name);
-                       fflush(stderr);
-                       return(NULL);
-               }
-       }
-       else
-       {
-               frb->state = NULL;
-       }
-       
-       frb->update = update;
-       frb->forecast = forecast;
-       frb->free = freer;
-       
-
-       frb->se = 0.0;
-       frb->ae = 0.0;
-       frb->count = 0.0;
-       strncpy(frb->name,name,sizeof(frb->name));
-       
-       /*
-        * point forcb at the series and time stamp buffers
-        */
-       frb->series = series;
-       frb->time_stamps = time_stamps;
-
-       frb->best_f = 0.0;
-       frb->best_i = 0;
-       frb->best_err = 0.0;
-
-       
-       return(frb);
-}
-
-void
-FreeForcB(forcb frb)
-{
-       if(frb->state != NULL)
-       {
-               frb->free(frb->state);
-       }
-
-       /*
-        * defensive programming
-        */
-       if(frb->se_series != NULL)
-       {
-               FreeFBuff(frb->se_series);
-       }
-       if(frb->ae_series != NULL)
-       {
-               FreeFBuff(frb->ae_series);
-       }
-       free(frb);
-       
-       return;
-}
-
-void
-FreeForcl(char *i_forcl)
-{
-       int i;
-       forcl l_forcl;
-       
-       l_forcl = (forcl)i_forcl;
-
-       /*
-        * shared by all forcbs
-        */
-       FreeFBuff(l_forcl->forcs[0]->series);
-       FreeFBuff(l_forcl->forcs[0]->time_stamps);
-       
-       for(i=0; i < l_forcl->count; i++)
-       {
-               FreeForcB(l_forcl->forcs[i]);
-       }
-       for(i=0; i < l_forcl->derived_count; i++)
-       {
-               FreeForcB(l_forcl->derived_forcs[i]);
-       }
-
-       /*
-        * the state is the l_forcl itself -- clear it to free works
-        * properly
-        */
-       l_forcl->total_mse->state = NULL;
-       l_forcl->total_mae->state = NULL;
-       FreeForcB(l_forcl->total_mse);
-       FreeForcB(l_forcl->total_mae);
-       
-       free(l_forcl->derived_forcs);
-       free(l_forcl->forcs);
-       free(l_forcl);
-       
-       return;
-}
-       
-/*
- * initializes a single fbuff for the data series and another for the
- * time stamps. 
- * 
- * initializes an array of forcb structs, one per forecaster
- * 
- * points each forcb to the series and time stamps
- */
-char *
-InitForcl(int max_forc_count, int buff_size)
-{
-       forcb frb;
-       forcb *forcs;
-       forcb *derived_forcs;
-       forcl l_forcl;
-       fbuff series;
-       fbuff time_stamps;
-       int i;
-       char derived_params[255];
-       
-       /*
-        * first, get space for series and time stamps
-        */
-       series = InitFBuff(buff_size);
-       if(series == NULL)
-       {
-               fprintf(stderr,"InitForcs: couldn't get fbuff for series\n");
-               fflush(stderr);
-               return(NULL);
-       }
-       
-       time_stamps = InitFBuff(buff_size);
-       if(time_stamps == NULL)
-       {
-               fprintf(stderr,
-                       "InitForcs: couldn't get fbuff for time stamps\n");
-               fflush(stderr);
-               FreeFBuff(series);
-               return(NULL);
-       }
-       
-       /*
-        * now, get forcl list space
-        */
-       l_forcl = (forcl)(malloc(FORCL_SIZE));
-       if(l_forcl == NULL)
-       {
-               fprintf(stderr,"InitForcs: couldn't malloc %d forcl\n",
-                               max_forc_count);
-               fflush(stderr);
-               FreeFBuff(series);
-               FreeFBuff(time_stamps);
-               return(NULL);
-       }
-       
-       memset((char *)l_forcl,0,FORCL_SIZE);
-       l_forcl->derived_count = 0;
-   
-       /*
-        * get space for individual forecasters
-        */
-       forcs = (forcb *)(malloc(max_forc_count*sizeof(forcb)));
-       
-       if(forcs == NULL)
-       {
-               fprintf(stderr,"InitForcl: couldn't malloc %d forcb pointers\n",
-                               max_forc_count);
-               fflush(stderr);
-               free(l_forcl);
-               FreeFBuff(series);
-               FreeFBuff(time_stamps);
-               return(NULL);
-       }
-
-       /*
-        * get space for derived forecasters
-        */
-       derived_forcs = (forcb *)(malloc(max_forc_count*sizeof(forcb)));
-       
-       if(derived_forcs == NULL)
-       {
-               fprintf(stderr,"InitForcl: couldn't malloc %d derived forcb pointers\n",
-                               max_forc_count);
-               fflush(stderr);
-               free(l_forcl);
-               FreeFBuff(series);
-               FreeFBuff(time_stamps);
-               free(forcs);
-               return(NULL);
-       }
-       
-       l_forcl->forcs = forcs;
-       l_forcl->derived_forcs = derived_forcs;
-       
-       /*
-        * include the primary forecasters
-        */
-#include "forecasters.c"
-
-
-       /*
-        * now do derived forecaster types
-        */
-       
-       /*
-        * for min MSE, we set the window size to 0.  The first
-        * argument is the address of the forc list structure we are building
-        * 
-        * thread safe?  I think not.
-        */
-       sprintf(derived_params,
-               "%p %d",
-               (void *)l_forcl,
-               0);
-       DERIVED_FORC("Minimum MSE",
-                    InitWinMSE,
-                    derived_params,
-                    FreeWinMSE,
-                    NULL,
-                    LocalWinMSEForecast);
-
-       /*
-        * for min MAE, we set the window size to 0.  The first
-        * argument is the address of the forc list structure we are building
-        * 
-        * thread safe?  I think not.
-        */
-       sprintf(derived_params,
-               "%p %d",
-               (void *)l_forcl,
-               0);
-
-       DERIVED_FORC("Minimum MAE",
-                    InitWinMAE,
-                    derived_params,
-                    FreeWinMAE,
-                    NULL,
-                    LocalWinMAEForecast);
-
-       /*
-        * for min windowed MSE, we set the window size to 1.  The first
-        * argument is the address of the forc list structure we are building
-        * 
-        * thread safe?  I think not.
-        */
-       sprintf(derived_params,
-               "%p %d",
-               (void *)l_forcl,
-               1);
-       DERIVED_FORC("Minimum Window 1 MSE",
-                    InitWinMSE,
-                    derived_params,
-                    FreeWinMSE,
-                    NULL,
-                    LocalWinMSEForecast);
-       /*
-        * for min windowed MSE, we set the window size to 5.  The first
-        * argument is the address of the forc list structure we are building
-        * 
-        * thread safe?  I think not.
-        */
-       sprintf(derived_params,
-               "%p %d",
-               (void *)l_forcl,
-               5);
-       DERIVED_FORC("Minimum Window 5 MSE",
-                    InitWinMSE,
-                    derived_params,
-                    FreeWinMSE,
-                    NULL,
-                    LocalWinMSEForecast);
-
-       /*
-        * for min windowed MSE, we set the window size to 10.  The first
-        * argument is the address of the forc list structure we are building
-        * 
-        * thread safe?  I think not.
-        */
-       sprintf(derived_params,
-               "%p %d",
-               (void *)l_forcl,
-               10);
-       DERIVED_FORC("Minimum Window 10 MSE",
-                    InitWinMSE,
-                    derived_params,
-                    FreeWinMSE,
-                    NULL,
-                    LocalWinMSEForecast);
-
-       /*
-        * for min windowed MSE, we set the window size to 20.  The first
-        * argument is the address of the forc list structure we are building
-        * 
-        * thread safe?  I think not.
-        */
-       sprintf(derived_params,
-               "%p %d",
-               (void *)l_forcl,
-               20);
-       DERIVED_FORC("Minimum Window 20 MSE",
-                    InitWinMSE,
-                    derived_params,
-                    FreeWinMSE,
-                    NULL,
-                    LocalWinMSEForecast);
-       /*
-        * for min windowed MSE, we set the window size to 30.  The first
-        * argument is the address of the forc list structure we are building
-        * 
-        * thread safe?  I think not.
-        */
-       sprintf(derived_params,
-               "%p %d",
-               (void *)l_forcl,
-               30);
-       DERIVED_FORC("Minimum Window 30 MSE",
-                    InitWinMSE,
-                    derived_params,
-                    FreeWinMSE,
-                    NULL,
-                    LocalWinMSEForecast);
-       /*
-        * for min windowed MSE, we set the window size to 50.  The first
-        * argument is the address of the forc list structure we are building
-        * 
-        * thread safe?  I think not.
-        */
-       sprintf(derived_params,
-               "%p %d",
-               (void *)l_forcl,
-               50);
-       DERIVED_FORC("Minimum Window 50 MSE",
-                    InitWinMSE,
-                    derived_params,
-                    FreeWinMSE,
-                    NULL,
-                    LocalWinMSEForecast);
-       /*
-        * for min windowed MSE, we set the window size to 100.  The first
-        * argument is the address of the forc list structure we are building
-        * 
-        * thread safe?  I think not.
-        */
-       sprintf(derived_params,
-               "%p %d",
-               (void *)l_forcl,
-               100);
-       DERIVED_FORC("Minimum Window 100 MSE",
-                    InitWinMSE,
-                    derived_params,
-                    FreeWinMSE,
-                    NULL,
-                    LocalWinMSEForecast);
-
-       /*
-        * for win min MAE, with window size to 1.  The first
-        * argument is the address of the forc list structure we are building
-        * 
-        * thread safe?  I think not.
-        */
-       sprintf(derived_params,
-               "%p %d",
-               (void *)l_forcl,
-               1);
-
-       DERIVED_FORC("Minimum Window 1 MAE",
-                    InitWinMAE,
-                    derived_params,
-                    FreeWinMAE,
-                    NULL,
-                    LocalWinMAEForecast);
-       /*
-        * for win min MAE, with window size to 5.  The first
-        * argument is the address of the forc list structure we are building
-        * 
-        * thread safe?  I think not.
-        */
-       sprintf(derived_params,
-               "%p %d",
-               (void *)l_forcl,
-               5);
-
-       DERIVED_FORC("Minimum Window 5 MAE",
-                    InitWinMAE,
-                    derived_params,
-                    FreeWinMAE,
-                    NULL,
-                    LocalWinMAEForecast);
-       /*
-        * for win min MAE, with window size to 10.  The first
-        * argument is the address of the forc list structure we are building
-        * 
-        * thread safe?  I think not.
-        */
-       sprintf(derived_params,
-               "%p %d",
-               (void *)l_forcl,
-               10);
-
-       DERIVED_FORC("Minimum Window 10 MAE",
-                    InitWinMAE,
-                    derived_params,
-                    FreeWinMAE,
-                    NULL,
-                    LocalWinMAEForecast);
-       /*
-        * for win min MAE, with window size to 20.  The first
-        * argument is the address of the forc list structure we are building
-        * 
-        * thread safe?  I think not.
-        */
-       sprintf(derived_params,
-               "%p %d",
-               (void *)l_forcl,
-               20);
-
-       DERIVED_FORC("Minimum Window 20 MAE",
-                    InitWinMAE,
-                    derived_params,
-                    FreeWinMAE,
-                    NULL,
-                    LocalWinMAEForecast);
-       /*
-        * for win min MAE, with window size to 30.  The first
-        * argument is the address of the forc list structure we are building
-        * 
-        * thread safe?  I think not.
-        */
-       sprintf(derived_params,
-               "%p %d",
-               (void *)l_forcl,
-               30);
-
-       DERIVED_FORC("Minimum Window 30 MAE",
-                    InitWinMAE,
-                    derived_params,
-                    FreeWinMAE,
-                    NULL,
-                    LocalWinMAEForecast);
-       /*
-        * for win min MAE, with window size to 50.  The first
-        * argument is the address of the forc list structure we are building
-        * 
-        * thread safe?  I think not.
-        */
-       sprintf(derived_params,
-               "%p %d",
-               (void *)l_forcl,
-               50);
-
-       DERIVED_FORC("Minimum Window 50 MAE",
-                    InitWinMAE,
-                    derived_params,
-                    FreeWinMAE,
-                    NULL,
-                    LocalWinMAEForecast);
-       /*
-        * for win min MAE, with window size to 100.  The first
-        * argument is the address of the forc list structure we are building
-        * 
-        * thread safe?  I think not.
-        */
-       sprintf(derived_params,
-               "%p %d",
-               (void *)l_forcl,
-               100);
-
-       DERIVED_FORC("Minimum Window 100 MAE",
-                    InitWinMAE,
-                    derived_params,
-                    FreeWinMAE,
-                    NULL,
-                    LocalWinMAEForecast);
-       /*
-        * end of derived forecaster init
-        */
-       
-       /*
-        * now init a total MSE forcb for the
-        * list
-        */
-       
-       frb = InitForcB(series,
-                       time_stamps,
-                       "Total MSE",
-                       NULL,           /* no init */
-                       NULL,           /* no params */
-                       NULL,           /* no free */
-                       NULL,           /* no update */
-                       TotalMSEForecast);      /* MSE forecast */
-       if(frb == NULL)
-       {
-               free(forcs);
-               free(derived_forcs);
-               FreeFBuff(series);
-               FreeFBuff(time_stamps);
-               for(i=0; i < l_forcl->count; i++)
-               {
-                       FreeForcB(l_forcl->forcs[i]);
-               }
-               for(i=0; i < l_forcl->derived_count; i++)
-               {
-                       FreeForcB(l_forcl->derived_forcs[i]);
-               }
-               free(l_forcl->derived_forcs);
-               free(l_forcl);
-               return(NULL);
-       }
-       frb->series = series;
-       frb->time_stamps = time_stamps;
-       frb->ae = 0.0;
-       frb->se = 0.0;
-       frb->count = 0.0;
-       /*
-        * total forecasters take forcl as state
-        */
-       frb->state = (char *)l_forcl;
-       l_forcl->total_mse = frb;
-
-       /*
-        * now init a total MAE forcb for the
-        * list
-        */
-       
-       frb = InitForcB(series,
-                       time_stamps,
-                       "Total MAE",
-                       NULL,           /* no init */
-                       NULL,           /* no params */
-                       NULL,           /* no free */
-                       NULL,           /* no update */
-                       TotalMAEForecast);      /* MSE forecast */
-       if(frb == NULL)
-       {
-               free(forcs);
-               free(derived_forcs);
-               FreeFBuff(series);
-               FreeFBuff(time_stamps);
-               for(i=0; i < l_forcl->count; i++)
-               {
-                       FreeForcB(l_forcl->forcs[i]);
-               }
-               for(i=0; i < l_forcl->derived_count; i++)
-               {
-                       FreeForcB(l_forcl->derived_forcs[i]);
-               }
-               free(l_forcl->derived_forcs);
-               free(l_forcl);
-               return(NULL);
-       }
-       frb->series = series;
-       frb->time_stamps = time_stamps;
-       frb->ae = 0.0;
-       frb->se = 0.0;
-       frb->count = 0.0;
-       /*
-        * total forecasters take forcl as state
-        */
-       frb->state = (char *)l_forcl;
-       l_forcl->total_mae = frb;
-       
-       
-
-       return((char *)l_forcl);
-       
-}
-
-void
-UpdateForecasts(char *i_forcl, double ts, double value)
-{
-       int i;
-       double err;
-       double forecast;
-       int ferr;
-       forcl l_forcl;
-       int forc_okay;
-       double best_sq_f;
-       double best_f;
-       int best_i;
-       int best_sq_i;
-       double best_sq_err;
-       double best_err;
-       
-       l_forcl = (forcl)i_forcl;
-       
-       forc_okay = 0;
-       
-       /*
-        * get mse forecast for this value and update error
-        */
-       ferr = (l_forcl->total_mse)->forecast((l_forcl->total_mse)->state,
-                             &forecast);
-       if(ferr == 1)
-       {
-               forc_okay = 1;
-               err = forecast - value;
-               if(err < 0.0)
-               {
-                       err = err * -1.0;
-               }
-               l_forcl->total_mse->ae += err;
-               l_forcl->total_mse->se += err*err;
-               l_forcl->total_mse->count += 1.0;
-               
-               /*
-                * write out the cumulative total in the
-                * series buffer so that we may do windowed
-                * mse and mae things
-                */
-               UpdateFBuff(l_forcl->total_mse->se_series,
-                          l_forcl->total_mse->se); 
-               UpdateFBuff(l_forcl->total_mse->ae_series,
-                          l_forcl->total_mse->ae); 
-       }
-       /*
-        * get mae forecast for this value and update error
-        */
-       ferr = (l_forcl->total_mae)->forecast((l_forcl->total_mae)->state,
-                             &forecast);
-       if(ferr == 1)
-       {
-               err = forecast - value;
-               if(err < 0.0)
-               {
-                       err = err * -1.0;
-               }
-               l_forcl->total_mae->ae += err;
-               l_forcl->total_mae->se += err*err;
-               l_forcl->total_mae->count += 1.0;
-               
-               /*
-                * write out the cumulative total in the
-                * series buffer so that we may do windowed
-                * mse and mae things
-                */
-               UpdateFBuff(l_forcl->total_mae->se_series,
-                          l_forcl->total_mae->se); 
-               UpdateFBuff(l_forcl->total_mae->ae_series,
-                          l_forcl->total_mae->ae); 
-       }
-
-       if(forc_okay == 1)
-       {
-               /*
-                * update derived forecast error values
-                */
-               for(i=0; i < l_forcl->derived_count; i++)
-               {
-                       /*
-                        * get forecast for this value and update error
-                        */
-                       ferr = 
-       (l_forcl->derived_forcs[i])->forecast((l_forcl->derived_forcs[i])->state,
-                                             &forecast);
-                       if(ferr == 0)
-                       {
-                               continue;
-                       }
-                       forc_okay = 1;
-                       err = forecast - value;
-                       if(err < 0.0)
-                       {
-                               err = err * -1.0;
-                       }
-                       l_forcl->derived_forcs[i]->ae += err;
-                       l_forcl->derived_forcs[i]->se += err*err;
-                       l_forcl->derived_forcs[i]->count += 1.0;
-                       
-                       /*
-                        * write out the cumulative total in the
-                        * series buffer so that we may do windowed
-                        * mse and mae things
-                        */
-                       UpdateFBuff(l_forcl->derived_forcs[i]->se_series,
-                                  l_forcl->derived_forcs[i]->se); 
-                       UpdateFBuff(l_forcl->derived_forcs[i]->ae_series,
-                                  l_forcl->derived_forcs[i]->ae); 
-               }
-       }
-       /*
-        * first, update the error values
-        */
-       best_sq_err = DBIG_VAL;
-       best_err = DBIG_VAL;
-       best_sq_f = 0.0;
-       best_f = 0.0;
-       best_sq_i = 0;
-       best_i = 0;
-       for(i=0; i < l_forcl->count; i++)
-       {
-               /*
-                * get forecast for this value and update error
-                */
-               ferr = 
-       (l_forcl->forcs[i])->forecast((l_forcl->forcs[i])->state,&forecast);
-               if(ferr == 0)
-               {
-                       continue;
-               }
-               
-               err = forecast - value;
-               if(err < 0.0)
-               {
-                       err = err * -1.0;
-               }
-               l_forcl->forcs[i]->ae += err;
-               l_forcl->forcs[i]->se += err*err;
-               l_forcl->forcs[i]->count += 1.0;
-
-               /*
-                * find the forecast that actually has the min error
-                */
-               if((err*err) < best_sq_err)
-               {
-                       best_sq_err = err*err;
-                       best_sq_i = i;
-                       best_sq_f = forecast;
-               }
-               if(err < best_err)
-               {
-                       best_err = err;
-                       best_i = i;
-                       best_f = forecast;
-               }
-               /*
-                * write out the cumulative total in the
-                * series buffer so that we may do windowed
-                * mse and mae things
-                */
-               UpdateFBuff(l_forcl->forcs[i]->se_series,
-                          l_forcl->forcs[i]->se); 
-               UpdateFBuff(l_forcl->forcs[i]->ae_series,
-                          l_forcl->forcs[i]->ae); 
-       }
-
-       /*
-        * record the forecast that actually won
-        */
-       if(best_sq_err != DBIG_VAL)
-       {
-               l_forcl->total_mse->best_f = best_sq_f;
-               l_forcl->total_mse->best_i = best_sq_i;
-               l_forcl->total_mse->best_err += best_sq_err;
-
-               l_forcl->total_mae->best_f = best_f;
-               l_forcl->total_mae->best_i = best_i;
-               l_forcl->total_mae->best_err += best_err;
-       }
-       
-       /*
-        * now update the series and time_stamps fbuffs.  all forcs point
-        * the same series and time_stamp fbuffs
-        */ 
-       
-       if(l_forcl->count >= 1)
-       {
-               UpdateFBuff(l_forcl->forcs[0]->series, value);
-               UpdateFBuff(l_forcl->forcs[0]->time_stamps, ts);
-       }
-       
-       for(i=0; i < l_forcl->count; i++)
-       {
-               /*
-                * now update forecast state for the individual forecasters
-                * 
-                * note that the forecasters need not record the series and
-                * time_stamp points, hence the ts and value parameters
-                */
-               (l_forcl->forcs[i])->update((l_forcl->forcs[i])->state,
-                                  ts,
-                                  value);
-       }
-       
-       return;
-}
-
-int
-ForcRange(char *i_forcl, double *low, double *high, int *low_i, int *high_i)
-{
-       forcl l_forcl;
-       int i;
-       double min = DBIG_VAL;
-       double max = -1.0 * DBIG_VAL;
-       double f;
-       int err;
-       
-       l_forcl = (forcl)i_forcl;
-       
-       /*
-        * simple forecasters
-        */
-       for(i=0; i < l_forcl->count; i++)
-       {
-               err = l_forcl->forcs[i]->forecast(l_forcl->forcs[i]->state,
-                                                 &f);
-               if(err == 0)
-                       continue;
-               
-               if(f < min)
-               {
-                       min = f;
-                       *low_i = i;
-               }
-               
-               if(f > max)
-               {
-                       max = f;
-                       *high_i = i;
-               }
-       }
-       
-       if((min == DBIG_VAL) || (max == (-1.0*DBIG_VAL)))
-       {
-               return(0);
-       }
-                       
-       *low = min;
-       *high = max;
-       
-       return(1);
-       
-}
-
-void
-PrintForecastSummary(char *i_forcl)
-{
-       forcl l_forcl;
-       int i;
-       
-       l_forcl = (forcl)i_forcl;
-       
-       /*
-        * simple forecasters
-        */
-       for(i=0; i < l_forcl->count; i++)
-       {
-               fprintf(stdout,"MSE: %3.4f\tMAE: %3.4f\t%s\n",
-                       l_forcl->forcs[i]->se/l_forcl->forcs[i]->count,
-                       l_forcl->forcs[i]->ae/l_forcl->forcs[i]->count,
-                       l_forcl->forcs[i]->name);
-       }
-       
-       /*
-        * secondary forecasters
-        */
-       for(i=0; i < l_forcl->derived_count; i++)
-       {
-               fprintf(stdout,"MSE: %3.4f\tMAE: %3.4f\t%s\n",
-               l_forcl->derived_forcs[i]->se/l_forcl->derived_forcs[i]->count,
-               l_forcl->derived_forcs[i]->ae/l_forcl->derived_forcs[i]->count,
-               l_forcl->derived_forcs[i]->name);
-       }
-       
-       /*
-        * totals
-        */
-       fprintf(stdout,"MSE: %3.4f\tMAE: %3.4f\tTotal MSE\n",
-                       l_forcl->total_mse->se / l_forcl->total_mse->count,
-                       l_forcl->total_mse->ae / l_forcl->total_mse->count);
-       fprintf(stdout,"MSE: %3.4f\tMAE: %3.4f\tTotal MAE\n",
-                       l_forcl->total_mae->se / l_forcl->total_mae->count,
-                       l_forcl->total_mae->ae / l_forcl->total_mae->count);
-       fprintf(stdout,"MSE: %3.4f\tMAE: %3.4f\tOptimum\n",
-                       l_forcl->total_mse->best_err/l_forcl->total_mse->count,
-                       l_forcl->total_mae->best_err/l_forcl->total_mse->count);
-
-       return;
-}
-
-void
-PrintLifetimeForecastSummary(char *state)
-{
-       forclife flife;
-       
-       flife = (forclife)state;
-       
-       PrintForecastSummary(flife->forc_list);
-       
-       return;
-}
-
-/*
- * routine put in to support FORECASTAPI_MethodName which doesn't
- * take a state record
- */
-void
-GetForcNames(char *state, char *methodNames[], int max_size, int *out_size)
-{
-       forcl s;
-       int i;
-       
-       s = (forcl)state;
-       
-       for(i=0; i < max_size; i++)
-       {
-               if(i >= s->count)
-                       break;
-               
-               methodNames[i] = s->forcs[i]->name;
-       }
-       
-       *out_size = i;
-       
-       return;
-}
-
-char *
-InitForcLife(int max_forc_count, int buff_size, double lifetime)
-{
-       char *l_forcl;
-       forclife flife;
-       
-       /*
-        * get a forc list for the series
-        */
-       l_forcl = InitForcl(max_forc_count, buff_size);
-       if(l_forcl == NULL)
-       {
-               fprintf(stderr,"InitForcLife: no space for forc list\n");
-               fflush(stderr);
-               return(NULL);
-       }
-       
-       /*
-        * now, get space for the lifetime forecasting structure
-        */
-       flife = (forclife)malloc(FORCLIFE_SIZE);
-       if(flife == NULL)
-       {
-               FreeForcl(l_forcl);
-               fprintf(stderr,"InitForcLife: no space for forclife struct\n");
-               fflush(stderr);
-               return(NULL);
-       }
-       
-       
-       flife->lifetime = lifetime;
-       flife->epoch_end = 0.0;
-       flife->total = 0.0;
-       flife->count = 0.0;
-       flife->forc_list = l_forcl;
-       
-       return((char *)flife);
-}
-
-void
-FreeForcLife(char *state)
-{
-       forclife flife;
-       
-       flife = (forclife)state;
-       
-       FreeForcl(flife->forc_list);
-       free(flife);
-       
-       return;
-}
-
-void
-UpdateForcLife(char *state, double ts, double value)
-{
-       forclife flife;
-       double avg;
-       
-       flife = (forclife)state;
-       
-       /*
-        * if we are initializing
-        */
-       if(flife->epoch_end == 0.0)
-       {
-               flife->epoch_end = ts + flife->lifetime;
-       }
-       
-       if(ts < flife->epoch_end)
-       {
-               flife->total += value;
-               flife->count += 1.0;
-       }
-       else
-       {
-               if(flife->count == 0.0)
-                       flife->count = 1.0;
-
-               avg = flife->total / flife->count;
-               UpdateForecasts((char *)flife->forc_list,
-                                 flife->epoch_end,
-                                 avg);
-               flife->total = 0.0;
-               flife->count = 0.0;
-               flife->epoch_end = ts+flife->lifetime;
-       }
-
-       return;
-}
-
-double
-LifetimeValue(char *state)
-{
-       forclife flife;
-       forcl l_forcl;
-       double value;
-       
-       flife = (forclife)state;
-       l_forcl = (forcl)flife->forc_list;
-       
-       value = 
-          F_VAL(l_forcl->forcs[0]->series,F_FIRST(l_forcl->forcs[0]->series));
-       
-       return(value);
-}
-
-double
-LifetimeTimestamp(char *state)
-{
-       forclife flife;
-       forcl l_forcl;
-       double ts;
-       
-       flife = (forclife)state;
-       l_forcl = (forcl)flife->forc_list;
-       
-       ts = 
-          F_VAL(l_forcl->forcs[0]->time_stamps,
-                          F_FIRST(l_forcl->forcs[0]->time_stamps));
-       
-       return(ts);
-}
diff --git a/src/nws_portability/Forecast/forecast_api.c b/src/nws_portability/Forecast/forecast_api.c
deleted file mode 100644 (file)
index 6cd7d38..0000000
+++ /dev/null
@@ -1,113 +0,0 @@
-/* $Id$ */
-
-#include <stdlib.h>        /* free() malloc() */
-#include <string.h>        /* strdup() */
-#include "forc.h"         /* forecaster functions */
-#include "diagnostic.h"    /* FAIL() */
-#include "forecast_api.h"
-
-
-struct FORECASTAPI_ForecastStateStruct {
-  char *Forecaster_state;
-};
-
-
-void
-FORECASTAPI_FreeForecastState(FORECASTAPI_ForecastState **state) {
-  FreeForcl((*state)->Forecaster_state);
-  free(*state);
-  *state = NULL;
-}
-
-const char *
-FORECASTAPI_MethodName(unsigned int methodIndex) {
-
-  int i;
-  static int methodCount = 0;
-  static char *methodNames[MAX_FORC];
-  char *stateForNames;
-
-  if(methodCount == 0) {
-    stateForNames = InitForcl(MAX_FORC, MAX_DATA_ENTRIES);
-    GetForcNames(stateForNames, methodNames, MAX_FORC, &methodCount);
-    /*
-    ** GetForNames() gives us pointers which will be freed by FreeForcl(), so
-    ** we have to strdup() them.
-    */
-    for(i = 0; i < methodCount; i++) {
-      methodNames[i] = strdup(methodNames[i]);
-    }
-    FreeForcl(stateForNames);
-  }
-
-  return((methodIndex < methodCount) ? methodNames[methodIndex] : NULL);
-
-}
-  
-
-FORECASTAPI_ForecastState *
-FORECASTAPI_NewForecastState(void) {
-  FORECASTAPI_ForecastState *returnValue;
-  /*
-   * init the forecaster state
-   */
-  returnValue = 
-    (FORECASTAPI_ForecastState *)malloc(sizeof(FORECASTAPI_ForecastState)); 
-  if(returnValue == NULL)
-    FAIL("NewForecastState: out of memory\n");
-  
-  returnValue->Forecaster_state = InitForcl(MAX_FORC,MAX_DATA_ENTRIES);
-  if(returnValue->Forecaster_state == NULL) {
-    free(returnValue);
-    FAIL("NewForecastState: out of memory\n");
-  }
-  return returnValue;
-}
-
-
-void
-FORECASTAPI_UpdateForecastState(FORECASTAPI_ForecastState *state,
-                                const FORECASTAPI_Measurement *measurements,
-                                size_t howManyMeasurements,
-                                FORECASTAPI_ForecastCollection *forecasts,
-                                size_t howManyForecasts) {
-       int i;
-
-       /* sanity check */
-       if (state == NULL) {
-               return;
-       }
-
-       /* check if we want forecast */
-       if (forecasts == NULL) {
-               howManyForecasts = 0;
-       }
-
-       for(i = howManyMeasurements - 1; i >= 0; i--) {
-               UpdateForecasts(state->Forecaster_state, (double)measurements[i].timeStamp, (double)measurements[i].measurement);
-               if(i < howManyForecasts) {
-                       FORECASTAPI_ComputeForecast(state, &forecasts[i]);
-                       forecasts[i].measurement = measurements[i];
-               }
-       }
-}
-
-int
-FORECASTAPI_ComputeForecast(        FORECASTAPI_ForecastState *state,
-                               FORECASTAPI_ForecastCollection *forecast) {
-
-       /* sanity check */
-       if (state == NULL || forecast == NULL) {
-               return 1;
-       }
-
-       forecast->forecasts[FORECASTAPI_MAE_FORECAST].forecast = MAEForecast(state->Forecaster_state);
-       forecast->forecasts[FORECASTAPI_MAE_FORECAST].error = MAEError(state->Forecaster_state);
-       forecast->forecasts[FORECASTAPI_MAE_FORECAST].methodUsed = MAEMethod(state->Forecaster_state);
-       forecast->forecasts[FORECASTAPI_MSE_FORECAST].forecast = MSEForecast(state->Forecaster_state);
-       forecast->forecasts[FORECASTAPI_MSE_FORECAST].error = MSEError(state->Forecaster_state);
-       forecast->forecasts[FORECASTAPI_MSE_FORECAST].methodUsed = MSEMethod(state->Forecaster_state);
-
-       return 0;
-}
-
diff --git a/src/nws_portability/Forecast/forecasters.c b/src/nws_portability/Forecast/forecasters.c
deleted file mode 100644 (file)
index e981642..0000000
+++ /dev/null
@@ -1,239 +0,0 @@
-/* $Id$ */
-
-/*
- * Forecaster Configuration File
- * 
- * FORECASTER(name,init,params,free,update,forecaster)
- *     name -- a print string to be associated with the forecaster
- *     init -- initialization function
- *     params -- string to be passed to init as initial parameters
- *     free -- free routine to be called to release forecaster spec. state
- *     update -- update routine for forecaster
- *     forecaster -- forecaster routine
- *     
- *     To add a forecaster to the system, both a FORECASTER specifier and
- *     an include file need to be specified.  forecasters.h contains include
- *     files for each forecasting package.
- *     
- *     Each forecaster consists of a (char *)init() routine, a (void)free()
- *     routine, a (void)update() routine, and an (int)forecaster()
- *     routine.
- *     
- *     char * Init(fbuff series,
- *                 fbuff time_stamps,
- *                 char *params)
- *                 
- *             series -- a pointer to the actual data series 
- *             time_stamps -- a pointer to the time stamp series
- *             params -- string passed as initial parameters
- *             
- *             returns a local state record that will be passed to
- *                     all subsequent calls
- *                     
- *     void Free(char *state)
- *     
- *             state -- local state to be deallocated when forecaster]
- *                      is shut down
- *                      
- *     void Update(char *state,
- *                 double ts,
- *                 doubel value)
- *                 
- *             state -- local forecaster state
- *             ts -- time stamp for new value to be added
- *             value -- value to be added to the forecaster state
- *             
- *     int Forecaster(char *state,
- *                    double *forecast)
- *                    
- *             state -- local forecaster state
- *             forecast -- out parameter through which forecast is passed
- *             
- *             returns a 1 if forecast can be made and a 0 if the
- *                     foreacster fails for some reason
- *                     
- * a header file for each package shoould include external definitions
- * for each routine
- */
-
-/*
- * last value predictor
- */
-FORECASTER("Last Value", 
-           InitLastValue, 
-           NULL, 
-           FreeLastValue, 
-           UpdateLastValue, 
-           ForcLastValue);
-
-/*
- * running tabulation of the mean
- */
-FORECASTER("Running Mean", 
-           InitRunMean, 
-           NULL, 
-           FreeRunMean, 
-           UpdateRunMean, 
-           ForcRunMean);
-
-/*
- * exp smooth predictor with 0.05 gain
- */
-FORECASTER("5% Exp Smooth",
-          InitExpSmooth,
-          "0.05",
-          FreeExpSmooth,
-          UpdateExpSmooth,
-          ForcExpSmooth);
-
-/*
- * exp smooth predictor with 0.10 gain
- */
-FORECASTER("10% Exp Smooth",
-          InitExpSmooth,
-          "0.10",
-          FreeExpSmooth,
-          UpdateExpSmooth,
-          ForcExpSmooth);
-
-/*
- * exp smooth predictor with 0.15 gain
- */
-FORECASTER("15% Exp Smooth",
-          InitExpSmooth,
-          "0.15",
-          FreeExpSmooth,
-          UpdateExpSmooth,
-          ForcExpSmooth);
-
-/*
- * exp smooth predictor with 0.20 gain
- */
-FORECASTER("20% Exp Smooth",
-          InitExpSmooth,
-          "0.20",
-          FreeExpSmooth,
-          UpdateExpSmooth,
-          ForcExpSmooth);
-
-/*
- * exp smooth predictor with 0.30 gain
- */
-FORECASTER("30% Exp Smooth",
-          InitExpSmooth,
-          "0.30",
-          FreeExpSmooth,
-          UpdateExpSmooth,
-          ForcExpSmooth);
-
-/*
- * exp smooth predictor with 0.40 gain
- */
-FORECASTER("40% Exp Smooth",
-          InitExpSmooth,
-          "0.40",
-          FreeExpSmooth,
-          UpdateExpSmooth,
-          ForcExpSmooth);
-
-/*
- * exp smooth predictor with 0.50 gain
- */
-FORECASTER("50% Exp Smooth",
-          InitExpSmooth,
-          "0.50",
-          FreeExpSmooth,
-          UpdateExpSmooth,
-          ForcExpSmooth);
-
-/*
- * exp smooth predictor with 0.75 gain
- */
-FORECASTER("75% Exp Smooth",
-          InitExpSmooth,
-          "0.75",
-          FreeExpSmooth,
-          UpdateExpSmooth,
-          ForcExpSmooth);
-
-/*
- * median predictor with window = 31
- */
-FORECASTER("Median Window 31",
-          InitMedian,
-          "31.0",
-          FreeMedian,
-          UpdateMedian,
-          ForcMedian);
-
-/*
- * median predictor with window = 5
- */
-FORECASTER("Median Window 5",
-          InitMedian,
-          "5.0",
-          FreeMedian,
-          UpdateMedian,
-          ForcMedian);
-
-/*
- * sliding window with window = 31 -- Trim Median with alpha = 0.0
- */
-FORECASTER("Sliding Median Window 31",
-          InitTrimMedian,
-          "31.0 0.0",
-          FreeTrimMedian,
-          UpdateTrimMedian,
-          ForcTrimMedian);
-
-/*
- * sliding window with window = 5 -- Trim Median with alpha = 0.0
- */
-FORECASTER("Sliding Median Window 5",
-          InitTrimMedian,
-          "5.0 0.0",
-          FreeTrimMedian,
-          UpdateTrimMedian,
-          ForcTrimMedian);
-
-/*
- * trimmed median with window = 31, alpha = 0.30
- */
-FORECASTER("30% Trimmed Median Window 31",
-          InitTrimMedian,
-          "31.0 0.30",
-          FreeTrimMedian,
-          UpdateTrimMedian,
-          ForcTrimMedian);
-
-/*
- * trimmed median with window = 51, alpha = 0.30
- */
-FORECASTER("30% Trimmed Median Window 51",
-          InitTrimMedian,
-          "51.0 0.30",
-          FreeTrimMedian,
-          UpdateTrimMedian,
-          ForcTrimMedian);
-
-/*
- * adaptive median with win=10, min_win=5, max_win=21, and a adjustment
- * value of 1
- */
-FORECASTER("Adaptive Median Window 5-21",
-          InitAdMedian,
-          "10.0 5.0 21.0 1.0",
-          FreeAdMedian,
-          UpdateAdMedian,
-          ForcAdMedian);
-
-/*
- * adaptive median with win=30, min_win=21, max_win=51, and a adjustment
- * value of 5
- */
-FORECASTER("Adaptive Median Window 21-51",
-          InitAdMedian,
-          "30.0 21.0 51.0 5.0",
-          FreeAdMedian,
-          UpdateAdMedian,
-          ForcAdMedian);
diff --git a/src/nws_portability/Forecast/last_value.c b/src/nws_portability/Forecast/last_value.c
deleted file mode 100644 (file)
index 590c114..0000000
+++ /dev/null
@@ -1,83 +0,0 @@
-/* $Id$ */
-
-#include <unistd.h>
-#include <stdlib.h>
-#include <stdio.h>
-#include <math.h>
-#include <string.h>
-#include <strings.h>
-
-#include "fbuff.h"
-#include "last_value.h"
-
-struct last_value_state
-{
-       fbuff series;                   /* the series so far */
-       fbuff time_stamps;              /* the time stamps */
-       double value;
-};
-
-/*
- * init local state.  can save a copy of the pointer to the
- * series and time stamps, if desired
- */
-char *
-InitLastValue(fbuff series, fbuff time_stamps, char *params)
-{
-       struct last_value_state *state;
-       
-       state = (struct last_value_state *)
-               malloc(sizeof(struct last_value_state));
-       
-       if(state == NULL)
-       {
-               return(NULL);
-       }
-       
-       /*
-        * all functions take a forcb
-        */
-       state->series = series;
-       state->time_stamps = time_stamps;
-       
-       return((char *)state);
-}
-
-void
-FreeLastValue(char *state)
-{
-       free(state);
-       return;
-}
-
-void
-UpdateLastValue(char *state,
-               double ts,
-               double value)
-{
-       /*
-        * no op -- will just grab it from series
-        */
-       return;
-}
-
-int
-ForcLastValue(char *state, double *v)
-{
-       double val;
-       struct last_value_state *s = (struct last_value_state *)state;
-       
-       if(!IS_EMPTY(s->series))
-       {
-               val = F_VAL(s->series,F_FIRST(s->series));
-               *v = val;
-               return(1);
-       }
-       else
-       {
-               *v = 0.0;
-               return(0);
-       }
-}
-
-
diff --git a/src/nws_portability/Forecast/median.c b/src/nws_portability/Forecast/median.c
deleted file mode 100644 (file)
index 88c881b..0000000
+++ /dev/null
@@ -1,978 +0,0 @@
-/* $Id$ */
-
-#include <unistd.h>
-#include <stdlib.h>
-#include <sys/types.h>
-#include <sys/times.h>
-#include <math.h>
-#include <stdio.h>
-#include <string.h>
-
-
-#include "fbuff.h"
-#include "median.h"
-
-
-/*
- * to do --
- * 
- * init M_ts to BIG_TS
- * 
- * handle the case where data is filling the window
- * 
- * find the biggest window
- */
-
-#define SMALL_TS (-1)
-#define BIG_TS (99999999999999999.99)
-
-
-
-/*
- * state record for median and trimmed median
- */
-struct median_state
-{
-       fbuff series;
-       fbuff time_stamps;
-       double M_array[MAX_MED_SIZE];
-       double M_ts[MAX_MED_SIZE];
-       int artificial_time;
-       int M_count;
-       int M_size;
-       double trim;
-};
-
-/*
- * state record for adjusted median and adjusted mean
- */
-struct ad_median_state
-{
-       fbuff series;
-       fbuff time_stamps;
-       double M_array[MAX_MED_SIZE];
-       double M_ts[MAX_MED_SIZE];
-       int M_count;
-       int artificial_time;
-       int last_win;
-       int win;
-       int min;
-       int max;
-       int offset;
-};
-
-void
-MSort(double *M_value, double *M_ts, double value, double ts, int size)
-{
-       int i;
-       int prev;
-       int curr;
-       int next;
-       int l_index = 0;
-       double temp;
-       double min_ts = BIG_TS;
-       
-       /*
-        * list is sorted from smallest to biggest -- find the
-        * oldest time stamp
-        */
-       for(i=0; i < size; i++)
-       {
-               if(M_ts[i] < min_ts)
-               {
-                       l_index = i;
-                       min_ts = M_ts[i];
-               }
-       }
-       
-       /*
-        * overwrite the slot with the new value and
-        * timestamp
-        */
-       M_value[l_index] = value;
-       M_ts[l_index] = ts;
-       
-       /*
-        * bump the value into the right place in the list
-        */
-
-       prev = l_index - 1;
-       if(prev < 0)
-               prev = 0;
-       curr = l_index;
-       next = l_index + 1;
-       if(next > (size - 1))
-               next = size - 1;
-       /*
-        * while the value is not in the right spot
-        */
-       while(!((M_value[curr] >= M_value[prev]) &&
-               (M_value[curr] <= M_value[next])))
-       {
-               /*
-                * if it is too big, shift up
-                */
-               if(M_value[curr] < M_value[prev])
-               {
-                       temp = M_value[prev];
-                       M_value[prev] = M_value[curr];
-                       M_value[curr] = temp;
-
-                       temp = M_ts[prev];
-                       M_ts[prev] = M_ts[curr];
-                       M_ts[curr] = temp;
-                       
-                       curr = curr - 1;
-               }
-               else /* shift down */
-               {
-                       temp = M_value[next];
-                       M_value[next] = M_value[curr];
-                       M_value[curr] = temp;
-
-                       temp = M_ts[next];
-                       M_ts[next] = M_ts[curr];
-                       M_ts[curr] = temp;
-                       
-                       curr = curr + 1;
-               }
-               
-               prev = curr - 1;
-               if(prev < 0)
-                       prev = 0;
-               
-               next = curr + 1;
-               if(next > (size - 1))
-                       next = size - 1;
-       }
-       
-       /*
-        * new list should be sorted
-        */
-       
-       return;
-}
-
-
-/*
- * these next two routines can do windowed medians for different
- * window sizes.  We put them in for the Adjusted versions but
- * all medians should use them
- */
-double
-FindMedian(double *sorted_list, 
-          double *sorted_ts, 
-          int list_size,
-          double now, 
-          int win_size)
-{
-       int i;
-       int count;
-       int temp;
-       double val;
-       int last_i;
-       
-       last_i = 0;
-       
-       if(win_size == 1)
-       {
-               return(sorted_list[0]);
-       }
-       
-       /*
-        * sweep through sorted list counting only those that are
-        * within a win_size of now.  stop when we have win_size/2
-        */
-       count = 0;
-       for(i=0; i < list_size; i++)
-       {
-               if(sorted_ts[i] > (now - win_size))
-               {
-                       count++;
-                       /*
-                        * need to remember this one for the even case
-                        */
-                       if(count == (win_size / 2))
-                       {
-                               last_i = i;
-                       }
-               }
-
-               if(count == ((win_size / 2) + 1))
-                       break;
-       }
-       
-       /*
-        * i should now be the index of middle element -- almost
-        */
-       temp = win_size / 2;
-       /*
-        * if even
-        */
-       if(win_size == (temp * 2))
-       {
-               val = (sorted_list[last_i] + sorted_list[i]) / 2.0;
-       }
-       else
-       {
-               val = sorted_list[i];
-       }
-       
-       return(val);
-}
-
-double
-FindTrimMedian(double *sorted_list, 
-          double *sorted_ts, 
-          double now, 
-          int win_size,
-          double alpha)
-{
-       int i;
-       double val;
-       int T;
-       double vcount;
-       
-       if(win_size == 1)
-       {
-               return(sorted_list[0]);
-       }
-       
-       /*
-        * sweep through sorted list counting only those that are
-        * within a win_size of now.  stop when we have win_size/2
-        */
-       T = alpha * win_size;
-       val = 0.0;
-       vcount = 0.0;
-       for(i=0; i < win_size ; i++)
-       {
-               if((sorted_ts[i] > (now - win_size + T)) &&
-                  (sorted_ts[i] < (now - T)))
-               {
-                       val += sorted_list[i];
-                       vcount++;
-               }
-       }
-       
-       if(vcount > 0.0)
-       {
-               val = val / vcount;
-       }
-       else
-       {
-               val = 0.0;
-       }
-
-       return(val);
-}
-
-
-char *
-InitMedian(fbuff series, fbuff time_stamps, char *params)
-{
-       struct median_state *state;
-       char *p_str;
-       double M_size;
-       int i;
-       
-       state = (struct median_state *)malloc(sizeof(struct median_state));
-       
-       if(state == NULL)
-       {
-               return(NULL);
-       }
-       
-       memset((void *)state,0,sizeof(struct median_state));
-       
-       state->trim = 0;
-       if(params != NULL)
-       {
-               /*
-                * first parameter is siaze of median window
-                */
-               p_str = params;
-               M_size = (int)strtod(p_str,&p_str);
-               state->M_size = M_size;
-       }
-       else
-       {
-               state->M_size = MAX_MED_SIZE;
-       }
-       
-       /*
-        * init M_ts to all SMALL_TS so that MSort will build sorted
-        * list correctly
-        */
-       for(i=0; i < MAX_MED_SIZE; i++)
-       {
-               state->M_ts[i] = SMALL_TS;
-       }
-       state->artificial_time = 0;
-       state->series = series;
-       state->time_stamps = time_stamps;
-       state->M_count = 0;
-       
-       return((char *)state);
-}
-
-void
-FreeMedian(char *state)
-{
-       free(state);
-       return;
-}
-
-void
-UpdateMedian(char *state,
-            double ts,
-            double value)
-{
-       struct median_state *s = (struct median_state *)state;
-       int curr_size;
-       
-
-       curr_size = F_COUNT(s->series);
-
-       if(curr_size > s->M_size)
-       {
-               s->M_count = curr_size = s->M_size;
-       }
-       else
-       {
-               s->M_count = curr_size;
-       }
-
-       /*
-        * update the sorted list
-        */
-       
-       /*
-        * increment the artificial time stamp
-        */
-       s->artificial_time = s->artificial_time + 1;
-
-       /*
-        * use artificial time stamp instead of real one to
-        * keep things in terms of entries instead of seconds
-        */
-       MSort(s->M_array,s->M_ts,value,s->artificial_time,curr_size);
-       
-       return;
-}
-
-
-int
-ForcMedian(char *state, double *forecast)
-{
-       struct median_state *s = (struct median_state *)state;
-       int l_index;
-       double val;
-       
-       if(s->M_count < 1)
-       {
-               return(0);
-       }
-
-       l_index = s->M_count/2;
-
-       /*
-        * if even
-        */
-       if(s->M_count == (2 * l_index))
-       {
-               val = (s->M_array[l_index-1] + s->M_array[l_index]) / 2.0;
-       }
-       else
-       {
-               val = s->M_array[l_index];
-       }
-       
-       *forecast = val;
-       return(1);
-}
-
-char *InitTrimMedian(fbuff series, fbuff time_stamps, char *params)
-{
-       struct median_state *state;
-       char *p_str;
-       double M_size;
-       double alpha;
-       int i;
-       
-       state = (struct median_state *)malloc(sizeof(struct median_state));
-       
-       if(state == NULL)
-       {
-               return(NULL);
-       }
-
-       memset((void *)state,0,sizeof(struct median_state));
-       
-       state->trim = 0;
-       if(params != NULL)
-       {
-               /*
-                * first parameter is size of median window
-                */
-               p_str = params;
-               M_size = (int)strtod(p_str,&p_str);
-               state->M_size = M_size;
-               
-               /*
-                * second parameter is the alpha trim value
-                */
-               alpha = strtod(p_str, &p_str);
-               state->trim = alpha;
-       }
-       else
-       {
-               state->M_size = MAX_MED_SIZE;
-               state->trim = 0.0;
-       }
-       
-       /*
-        * init M_ts to all SMALL_TS so that MSort will build sorted
-        * list correctly
-        */
-       for(i=0; i < MAX_MED_SIZE; i++)
-       {
-               state->M_ts[i] = SMALL_TS;
-       }
-       state->artificial_time = 0;
-       state->series = series;
-       state->time_stamps = time_stamps;
-       state->M_count = 0;
-       
-       return((char *)state);
-}
-
-void
-FreeTrimMedian(char *state)
-{
-       FreeMedian(state);
-       return;
-}
-
-void
-UpdateTrimMedian(char *state, double ts, double value)
-{
-       UpdateMedian(state,ts,value);
-       return;
-}
-
-
-
-/*
- * page 264 in DSP book
- */
-int
-ForcTrimMedian(char *state, double *forecast)
-{
-       struct median_state *s = (struct median_state *)state;
-       double val;
-       int l_index;
-       int T;
-       
-       if(s->M_count < 1)
-       {
-               return(0);
-       }
-
-
-       T = (int)(s->trim * s->M_count);
-
-       val = 0.0;
-       for(l_index = T; l_index < (s->M_count - T); l_index++)
-       {
-               val += s->M_array[l_index];
-       }
-
-       val = val / (double)(s->M_count - 2*T);
-
-
-       *forecast = val;
-       
-       return(1);
-}
-
-
-
-char *InitAdMedian(fbuff series, fbuff time_stamps, char *params)
-{
-       struct ad_median_state *state;
-       char *p_str;
-       double win;
-       double min_win;
-       double max_win;
-       double offset;
-       int i;
-       
-       state = (struct ad_median_state *)
-               malloc(sizeof(struct ad_median_state));
-       
-       if(state == NULL)
-       {
-               return(NULL);
-       }
-
-       memset((void *)state,0,sizeof(struct median_state));
-       
-       
-       if(params != NULL)
-       {
-               /*
-                * first parameter is initial target size of median window
-                */
-               p_str = params;
-               win = (int)strtod(p_str,&p_str);
-               state->win = win;
-               
-               /*
-                * defaults
-                */
-               min_win = win;
-               max_win = win;
-               offset = 1;
-               
-               /*
-                * second parameter is the min window value
-                */
-               min_win = strtod(p_str, &p_str);
-
-               /*
-                * third parameter is the max window value
-                */
-               max_win = strtod(p_str, &p_str);
-
-               /*
-                * fourth parameter is the offset value to use
-                * when calculating alternative window sizes
-                */
-               offset = strtod(p_str, &p_str);
-               state->offset = (int)offset;
-               
-               /*
-                * sanity checking
-                */
-               if(win == 1)
-                       state->offset = 0;
-               
-               if((win - state->offset) < 0)
-                       state->offset = 1;
-                       
-               if(min_win > (win - state->offset))
-                       min_win = win - state->offset;
-               
-               if(max_win < (win + state->offset))
-                       max_win = win + state->offset;
-
-               state->min = (int)min_win;
-               state->max = (int)max_win;
-       }
-       else
-       {
-               state->min = state->max = state->win = MAX_MED_SIZE;
-               state->offset = 1;
-       }
-       
-       /*
-        * init M_ts to all SMALL_TS so that MSort will build sorted
-        * list correctly
-        */
-       for(i=0; i < MAX_MED_SIZE; i++)
-       {
-               state->M_ts[i] = SMALL_TS;
-       }
-       state->artificial_time = 0;
-       state->series = series;
-       state->time_stamps = time_stamps;
-       state->M_count = 0;
-       state->artificial_time = 1;
-       
-       return((char *)state);
-}
-
-void
-FreeAdMedian(char *state)
-{
-               free(state);
-               return;
-}
-
-void
-UpdateAdMedian(char *state, double ts, double value) 
-{
-       struct ad_median_state *s = (struct ad_median_state *)state;
-       int curr_size;
-       int win;
-       double less_val;
-       double eq_val;
-       double more_val;
-       double less_err;
-       double eq_err;
-       double more_err;
-       int lo_offset;
-       int hi_offset;
-       
-
-       curr_size = F_COUNT(s->series);
-
-       /*
-        * M_size is the current window size, and M_count is the
-        * current amount of data in the median buffer
-        */
-       
-       if(curr_size > s->max)
-       {
-               s->M_count = curr_size = s->max;
-       }
-       else
-       {
-               s->M_count = curr_size;
-       }
-
-       /*
-        * update the sorted list
-        */
-       
-       /*
-        * increment the artificial time stamp
-        */
-       s->artificial_time = s->artificial_time + 1;
-
-       /*
-        * use artificial time stamp instead of real one to
-        * keep things in terms of entries instead of seconds
-        */
-       MSort(s->M_array,s->M_ts,value,s->artificial_time,curr_size);
-       
-       
-       /*
-        * calculate the window based on how much data there is
-        */
-       if(curr_size > s->win)
-       {
-               win = s->win;
-       }
-       else
-       {
-               win = curr_size;
-       }
-       /*
-        * find the median using the current
-        * window size
-        */
-       eq_val = FindMedian(s->M_array,
-                           s->M_ts,
-                           s->M_count,
-                           s->artificial_time,
-                           win);
-       
-       /*
-        * we want to wait until there is enough data before we start
-        * to adapt.  We don't start to adjust s->win until there is
-        * enough data to get out to the max window size
-        */
-       if(curr_size < s->max)
-       {
-               return;
-       }
-       
-       if((win - s->offset) < 0)
-       {
-               lo_offset = win - 1;
-       }
-       else
-       {
-               lo_offset = s->offset;
-       }
-       
-       if((win + s->offset) > s->M_count)
-       {
-               hi_offset = s->M_count - win - 1;
-       }
-       else
-       {
-               hi_offset = s->offset;
-       }
-       
-       /*
-        * find the median for a smaller window -- offset
-        * controls how much smaller or bigger the window should be
-        * that we consider
-        */
-       less_val = FindMedian(s->M_array,
-                             s->M_ts,
-                             s->M_count,
-                             s->artificial_time,
-                             lo_offset);
-
-       /*
-        * find the median for a bigger window -- offset
-        * controls how much smaller or bigger the window should be
-        * that we consider
-        */
-       more_val = FindMedian(s->M_array,
-                             s->M_ts,
-                             s->M_count,
-                             s->artificial_time,
-                             hi_offset);
-       
-       /*
-        * now, calculate the errors
-        */
-       less_err = (value - less_val) * (value - less_val);
-       more_err = (value - more_val) * (value - more_val);
-       eq_err = (value - eq_val) * (value - eq_val);
-       
-       /*
-        * adapt the window according to the direction giving us the
-        * smallest error
-        */
-       if(less_err < eq_err)
-       {
-               if(less_err < more_err)
-               {
-                       win = win - 1;
-               }
-               else if(more_err < eq_err)
-               {
-                       win = win + 1;
-               }
-       }
-       else if(more_err < eq_err)
-       {
-               if(more_err < less_err)
-               {
-                       win = win + 1;
-               }
-               else if(less_err < eq_err)
-               {
-                       win = win - 1;
-               }
-       }
-
-       s->win = win;
-
-       return;
-}      
-       
-
-int
-ForcAdMedian(char *state, double *forecast)
-{
-       struct ad_median_state *s = (struct ad_median_state *)state;
-       double forc;
-       
-       if(s->M_count == 0)
-       {
-               return(0);
-       }
-       
-       if(s->M_count < s->max)
-       {
-               forc = FindMedian(s->M_array,
-                                 s->M_ts,
-                                 s->M_count,
-                                 s->artificial_time,
-                                 s->M_count);
-       }
-       else
-       {
-               forc = FindMedian(s->M_array,
-                                 s->M_ts,
-                                 s->M_count,
-                                 s->artificial_time,
-                                 s->win);
-               
-       }
-       
-       *forecast = forc;
-       
-       return(1);
-}
-
-       
-       
-
-
-       
-
-
-
-#ifdef NOTYET
-
-AdjustedMedian(tp,pred,min,max)
-struct thruput_pred *tp;
-int pred;
-int min;
-int max;
-{
-       double err1;
-       double err2;
-       double err3;
-       double val1;
-       double val2;
-       double val3;
-       int win;
-       struct value_el *data = tp->data;
-       int prev = MODMINUS(tp->head,1,HISTORYSIZE);
-       int head = tp->head;
-       double value = tp->data[head].value;
-       double predictor = PRED(pred,data[prev]);
-       int out_win;
-       double out_val;
-
-       win = MedWIN(pred,data[prev]);
-       if(MODMINUS(head,tp->tail,HISTORYSIZE) < 3)
-       {
-               PRED(pred,data[head]) = value;
-               MedWIN(pred,data[head]) = win;
-               return(0.0);
-       }
-       if(win < 2)
-               win = 2;
-       val1 = Median(tp,win-1);
-       val2 = Median(tp,win+1);
-       val3 = Median(tp,win);
-
-       err1 = (value - val1) * (value - val1);
-       err2 = (value - val2) * (value - val2);
-       err3 = (value - val3) * (value - val3);
-
-       if(err1 < err2)
-       {
-               if(err1 < err3)
-               {
-                       out_win = win - 1;
-                       out_val = val1;
-               }
-               else
-               {
-                       out_win = win;
-                       out_val = val3;
-               }
-       }
-       else if(err2 < err1)
-       {
-               if(err2 < err3)
-               {
-                       out_win = win + 1;
-                       out_val = val2;
-               }
-               else
-               {
-                       out_win = win;
-                       out_val = val3;
-               }
-       }
-       else
-       {
-               out_win = win;
-               out_val = val3;
-       }
-
-       if(out_win < min)
-       {
-               out_win = min;
-               out_val = Median(tp,min);
-       }
-
-       if(out_win > max)
-       {
-               out_win = max;
-               out_val = Median(tp,max);
-       }
-
-       MedWIN(pred,data[head]) = out_win;
-       PRED(pred,data[head]) = out_val;
-}
-
-AdjustedMean(tp,pred,min,max)
-struct thruput_pred *tp;
-int pred;
-int min;
-int max;
-{
-       double err1;
-       double err2;
-       double err3;
-       double val1;
-       double val2;
-       double val3;
-       int win;
-       struct value_el *data = tp->data;
-       int prev = MODMINUS(tp->head,1,HISTORYSIZE);
-       int head = tp->head;
-       double value = tp->data[head].value;
-       double predictor = PRED(pred,data[prev]);
-       int out_win;
-       double out_val;
-
-       win = MeanWIN(pred,data[prev]);
-       if(MODMINUS(head,tp->tail,HISTORYSIZE) < 3)
-       {
-               PRED(pred,data[head]) = value;
-               MeanWIN(pred,data[head]) = WIN_INIT;
-               return(0.0);
-       }
-       if(win < 2)
-               win = 2;
-       val1 = TrimmedMedian(tp,win-1,0.0);
-       val2 = TrimmedMedian(tp,win+1,0.0);
-       val3 = TrimmedMedian(tp,win,0.0);
-
-       err1 = (value - val1) * (value - val1);
-       err2 = (value - val2) * (value - val2);
-       err3 = (value - val3) * (value - val3);
-
-       if(err1 < err2)
-       {
-               if(err1 < err3)
-               {
-                       out_win = win - 1;
-                       out_val = val1;
-               }
-               else
-               {
-                       out_win = win;
-                       out_val = val3;
-               }
-       }
-       else if(err2 < err1)
-       {
-               if(err2 < err3)
-               {
-                       out_win = win + 1;
-                       out_val = val2;
-               }
-               else
-               {
-                       out_win = win;
-                       out_val = val3;
-               }
-       }
-       else
-       {
-               out_win = win;
-               out_val = val3;
-       }
-
-       if(out_win < min)
-       {
-               out_win = min;
-               out_val = TrimmedMedian(tp,min,0.0);
-       }
-
-       if(out_win > max)
-       {
-               out_win = max;
-               out_val = TrimmedMedian(tp,max,0.0);
-       }
-
-       MeanWIN(pred,data[head]) = out_win;
-       PRED(pred,data[head]) = out_val;
-}
-
-#endif
diff --git a/src/nws_portability/Forecast/mse_forc.c b/src/nws_portability/Forecast/mse_forc.c
deleted file mode 100644 (file)
index efefead..0000000
+++ /dev/null
@@ -1,658 +0,0 @@
-#include <unistd.h>
-
-#include <stdlib.h>
-#include <stdio.h>
-#include <math.h>
-#include <string.h>
-#include <strings.h>
-
-
-
-#include "forc.h"
-
-struct mse_state
-{
-       forcl forc_list;
-       int win;
-       int method;
-       int last_index;         /* optimization */
-       double last_forecast;   /* optimization */
-};
-
-
-/*
- * forward refs for derived forecaster types
- */
-int TotalMSEForecast(char *state, double *forecast);
-int LocalMAEForecast(char *state, double *forecast);
-
-int DerivedMethod(char *state);
-
-/*
- * the MSE forecast chooses the best forecast from the derived
- * forecasters, one of which is the total MSE forecast
- */
-double
-MSEForecast(char *i_forcl) 
-{
-       int i;
-       int min_i;
-       double min_se;
-       double sq_err;
-       double forecast;
-       forcl l_forcl;
-       int ferr;
-       fbuff series;
-       
-       l_forcl = (forcl)i_forcl;
-       
-       /*
-        * first, check to see if there is any data -- the forecaster
-        * routines may be called with an empty series
-        */
-       if(F_COUNT(l_forcl->forcs[0]->series) == 0)
-       {
-               forecast = FORE_ERROR_VAL;
-               return(forecast);
-       }
-
-
-
-       min_se = DBIG_VAL;
-       min_i = 0;
-
-       /*
-        * find the forecaster that has the lowest current
-        * mean square error
-        */
-       for(i=0; i < l_forcl->derived_count; i++)
-       {
-               series = l_forcl->derived_forcs[i]->se_series;
-               if(F_COUNT(series) > 0)
-               {
-                       sq_err = 
-                       F_VAL(series,F_FIRST(series)) / F_COUNT(series);
-               }
-               else
-               {
-                       sq_err = DBIG_VAL;
-               }
-
-               if(sq_err < min_se)
-               {
-                       min_i = i;
-                       min_se = sq_err;
-               }
-       }
-
-       /*
-        * report the best
-        */
-       ferr = 
-(l_forcl->derived_forcs[min_i])->forecast((l_forcl->derived_forcs[min_i])->state,
-                                 &forecast);
-       
-       /*
-        * if an error has occurred, print and error and report
-        * FORE_ERROR_VAL
-        */
-       if(ferr == 0)
-       {
-               /*
-                * since we know there is at least one data item,
-                * return the last on error
-                */
-               forecast = F_VAL(l_forcl->forcs[0]->series,
-                               F_FIRST(l_forcl->forcs[0]->series));
-               return(forecast);
-       }
-       
-       /*
-        * update the method that was used
-        */
-       l_forcl->total_mse_method = 
-               DerivedMethod(l_forcl->derived_forcs[min_i]->state);
-
-       return(forecast);
-}
-
-double
-MSEError(char *state)
-{
-       forcl s;
-       double val;
-       
-       s = (forcl)state;
-       
-       if(s->total_mse->count > 0.0)
-       {
-               val = s->total_mse->se / s->total_mse->count;
-       }
-       else
-       {
-               val = 0.0;
-       }
-       
-       return(val);
-}
-
-int
-MSEMethod(char *state)
-{
-       forcl s;
-       
-       s = (forcl)state;
-       
-       return(s->total_mse_method);
-}
-
-/*
- * for forecaster interface
- */
-int
-TotalMSEForecast(char *state, double *forecast)
-{
-       *forecast = MSEForecast(state);
-       
-       if(*forecast == FORE_ERROR_VAL)
-       {
-               return(0);
-       }
-       else
-       {
-               return(1);
-       }
-}
-
-double
-MAEForecast(char *i_forcl)
-{
-       int i;
-       int min_i;
-       double min_ae;
-       double err;
-       double forecast;
-       forcl l_forcl;
-       int ferr;
-       fbuff series;
-       
-       l_forcl = (forcl)i_forcl;
-
-       min_ae = DBIG_VAL;
-       min_i = 0;
-
-       /*
-        * find the forecaster that has the lowest current
-        * mean absolute error
-        */
-       for(i=0; i < l_forcl->derived_count; i++)
-       {
-               series = l_forcl->derived_forcs[i]->ae_series;
-               if(F_COUNT(series) > 0)
-               {
-                       err = 
-                       F_VAL(series,F_FIRST(series)) / F_COUNT(series);
-               }
-               else
-               {
-                       err = DBIG_VAL;
-               }
-
-               if(err < min_ae)
-               {
-                       min_i = i;
-                       min_ae = err;
-               }
-       }
-
-       /*
-        * report the best
-        */
-       ferr = 
-(l_forcl->derived_forcs[min_i])->forecast((l_forcl->derived_forcs[min_i])->state,
-                                 &forecast);
-       
-       /*
-        * if an error has occurred, print and error and report
-        * FORE_ERROR_VAL
-        */
-       if(ferr == 0)
-       {
-               forecast = F_VAL(l_forcl->forcs[0]->series, 
-                               F_FIRST(l_forcl->forcs[0]->series));
-       }
-
-       /*
-        * update the method that was used
-        */
-       l_forcl->total_mae_method = 
-               DerivedMethod(l_forcl->derived_forcs[min_i]->state);
-       return(forecast);
-}
-
-double
-MAEError(char *state)
-{
-       forcl s;
-       double val;
-       
-       s = (forcl)state;
-       
-       if(s->total_mae->count > 0.0)
-       {
-               val = s->total_mae->ae / s->total_mae->count;
-       }
-       else
-       {
-               val = 0.0;
-       }
-       
-       return(val);
-}
-
-int
-MAEMethod(char *state)
-{
-       forcl s;
-       
-       s = (forcl)state;
-       
-       return(s->total_mae_method);
-}
-
-int
-TotalMAEForecast(char *state, double *forecast)
-{
-       *forecast = MAEForecast(state);
-       
-       if(*forecast == FORE_ERROR_VAL)
-       {
-               return(0);
-       }
-       else
-       {
-               return(1);
-       }
-}
-
-char *
-InitWinMSE(fbuff series, fbuff time_stamps, char *params)
-{
-       struct mse_state *state;
-       int pcount;
-       forcl l_forcl;
-       int win;
-       
-       state = (struct mse_state *)malloc(sizeof(struct mse_state));
-       
-       if(state == NULL)
-       {
-               return(NULL);
-       }
-       
-       /*
-        * first parameter is the address of the forcl and the
-        * second is the window size
-        */
-       pcount = sscanf(params,"%p %d",
-                       &l_forcl,
-                       &win);
-       
-       if(pcount != 2)
-       {
-               free(state);
-               return(NULL);
-       }
-       
-       state->forc_list = l_forcl;
-       state->win = win;
-       
-       return((char *)state);
-}
-
-void
-FreeWinMSE(char *state)
-{
-       free(state);
-}
-
-char *
-InitWinMAE(fbuff series, fbuff time_stamps, char *params)
-{
-       return(InitWinMSE(series,time_stamps,params));
-}
-
-void
-FreeWinMAE(char *state)
-{
-       FreeWinMSE(state);
-}
-
-int
-LocalWinMSEForecast(char *state, double *out_f)
-{
-       struct mse_state *s;
-       int i;
-       int win;
-       int min_i;
-       double min_se;
-       double sq_err;
-       double forecast;
-       forcl l_forcl;
-       int ferr;
-       double temp_err;
-       int windex;
-       fbuff series;
-       
-       s = (struct mse_state *)state;
-       
-       l_forcl = s->forc_list;
-       win = s->win;
-
-
-       min_se = DBIG_VAL;
-       min_i = 0;
-       
-
-       /*
-        * find the forecaster that has the lowest current
-        * mean square error --
-        * 
-        * if the win size > 0, look only over the window
-        * using the cumulative series.  Otherwise, use the total
-        * cumulative value
-        */
-       for(i=0; i < l_forcl->count; i++)
-       {
-               if((l_forcl->forcs[i])->count > 0.0)
-               {
-                       series =
-                       (l_forcl->forcs[i])->se_series;
-                       
-                       /*
-                        * make sure we only window as much
-                        * as there is
-                        */
-                       if(win > (F_COUNT(series) - 1))
-                               win = F_COUNT(series) - 1;
-
-                       if(win == 0)
-                       {
-                               /*
-                                * get the first value which is
-                                * the current cumulative total
-                                */
-                               temp_err =
-                               F_VAL(series, F_FIRST(series));
-                               sq_err = temp_err / 
-                                       (l_forcl->forcs[i])->count;
-                       }
-                       else
-                       {
-                               /*
-                                * get the index of the end of the
-                                * window
-                                */
-                               windex = MODPLUS(F_FIRST(series),
-                                                win,
-                                                F_SIZE(series));
-                               /*
-                                * the difference is the cumulative
-                                * total over the window size
-                                */
-                               temp_err = F_VAL(series, F_FIRST(series)) -
-                                      F_VAL(series,windex);
-                               sq_err = temp_err / win;
-                       }
-               }
-               else
-               {
-                       sq_err = DBIG_VAL;
-               }
-
-               if(sq_err < min_se)
-               {
-                       min_i = i;
-                       min_se = sq_err;
-               }
-       }
-
-       /*
-        * report the best
-        */
-       ferr = 
-(l_forcl->forcs[min_i])->forecast((l_forcl->forcs[min_i])->state,&forecast);
-       
-       /*
-        * if an error has occurred, print and error and report
-        * FORE_ERROR_VAL
-        */
-       if(ferr == 0)
-       {
-               forecast = F_VAL(l_forcl->forcs[0]->series, 
-                               F_FIRST(l_forcl->forcs[0]->series));
-
-               return(0);
-       }
-
-       /*
-        * update the method that was used
-        */
-       s->method = min_i;
-       *out_f = forecast;
-       
-       return(1);
-}
-
-int
-LocalWinMAEForecast(char *state, double *out_f)
-{
-       struct mse_state *s;
-       int i;
-       int win;
-       int min_i;
-       double min_ae;
-       double err;
-       double forecast;
-       forcl l_forcl;
-       int ferr;
-       double temp_err;
-       int windex;
-       fbuff series;
-       
-       s = (struct mse_state *)state;
-       
-       l_forcl = s->forc_list;
-       win = s->win;
-
-
-       min_ae = DBIG_VAL;
-       min_i = 0;
-
-       /*
-        * find the forecaster that has the lowest current
-        * mean square error --
-        * 
-        * if the win size > 0, look only over the window
-        * using the cumulative series.  Otherwise, use the total
-        * cumulative value
-        */
-       for(i=0; i < l_forcl->count; i++)
-       {
-               if((l_forcl->forcs[i])->count > 0.0)
-               {
-                       series =
-                       (l_forcl->forcs[i])->ae_series;
-                       
-                       /*
-                        * make sure we only window as much
-                        * as there is
-                        */
-                       if(win > (F_COUNT(series) - 1))
-                               win = F_COUNT(series) - 1;
-
-                       if(win == 0)
-                       {
-                               /*
-                                * get the first value which is
-                                * the current cumulative total
-                                */
-                               temp_err =
-                               F_VAL(series, F_FIRST(series));
-                               err = temp_err / 
-                                       (l_forcl->forcs[i])->count;
-                       }
-                       else
-                       {
-                               /*
-                                * get the index of the end of the
-                                * window
-                                */
-                               windex = MODPLUS(F_FIRST(series),
-                                                win,
-                                                F_SIZE(series));
-                               /*
-                                * the difference is the cumulative
-                                * total over the window size
-                                */
-                               temp_err =
-                                       F_VAL(series, F_FIRST(series)) - 
-                                       F_VAL(series,windex);
-                               err = temp_err / win;
-                       }
-               }
-               else
-               {
-                       err = DBIG_VAL;
-               }
-
-               if(err < min_ae)
-               {
-                       min_i = i;
-                       min_ae = err;
-               }
-       }
-
-       /*
-        * report the best
-        */
-       ferr = 
-(l_forcl->forcs[min_i])->forecast((l_forcl->forcs[min_i])->state,&forecast);
-       
-       /*
-        * if an error has occurred, print and error and report
-        * FORE_ERROR_VAL
-        */
-       if(ferr == 0)
-       {
-               forecast = F_VAL(l_forcl->forcs[0]->series, 
-                               F_FIRST(l_forcl->forcs[0]->series));
-
-               *out_f = forecast;
-               return(0);
-       }
-
-       /*
-        * update the method that was used
-        */
-       s->method = min_i;
-       *out_f = forecast;
-       
-       return(1);
-}
-
-int
-DerivedMethod(char *state)
-{
-       struct mse_state *s;
-       
-       s = (struct mse_state *)state;
-       
-       return(s->method);
-}
-
-/*
- * lifetime versions
- */
-double
-MSELifetimeForecast(char *state)
-{
-       forclife flife;
-       forcl l_forcl;
-       
-       flife = (forclife)state;
-       l_forcl = (forcl)flife->forc_list;
-       if(F_COUNT(l_forcl->forcs[0]->series) == 0)
-       {
-               if(flife->count == 0.0)
-                       return(0.0);
-               return(flife->total / flife->count);
-       }
-       return(MSEForecast((char *)flife->forc_list));
-}
-
-double
-MSELifetimeError(char *state)
-{
-       forclife flife;
-       flife = (forclife)state;
-       return(MSEError((char *)flife->forc_list));
-}
-
-int
-MSELifetimeMethod(char *state)
-{
-       forclife flife;
-       flife = (forclife)state;
-       return(MSEMethod((char *)flife->forc_list));
-}
-
-double
-MSELifetimeEpoch(char *state)
-{
-       forclife flife;
-       flife = (forclife)state;
-       return(flife->epoch_end);
-}
-
-double
-MAELifetimeForecast(char *state)
-{
-       forclife flife;
-       forcl l_forcl;
-       
-       flife = (forclife)state;
-       l_forcl = (forcl)flife->forc_list;
-
-       if(F_COUNT(l_forcl->forcs[0]->series) == 0)
-       {
-               if(flife->count == 0.0)
-                       return(0.0);
-               return(flife->total / flife->count);
-       }
-       return(MAEForecast((char *)flife->forc_list));
-}
-
-double
-MAELifetimeError(char *state)
-{
-       forclife flife;
-       flife = (forclife)state;
-       return(MAEError((char *)flife->forc_list));
-}
-
-int
-MAELifetimeMethod(char *state)
-{
-       forclife flife;
-       flife = (forclife)state;
-       return(MAEMethod((char *)flife->forc_list));
-}
-
-double
-MAELifetimeEpoch(char *state)
-{
-       forclife flife;
-       flife = (forclife)state;
-       return(flife->epoch_end);
-}
diff --git a/src/nws_portability/Forecast/predictor.c b/src/nws_portability/Forecast/predictor.c
deleted file mode 100644 (file)
index 1299c08..0000000
+++ /dev/null
@@ -1,607 +0,0 @@
-/* $Id$ */
-
-#include "config_portability.h"
-#include <stdio.h>      /* fprintf() fflush() */
-#include "strutil.h"    /* SAFESTRCPY() */
-#include "predictor.h"
-
-/* These should be in a header file, median.h */
-extern double Median();
-extern double TrimmedMedian();
-extern void AdjustedMean();
-extern void AdjustedMedian();
-extern char *DefineHistogram();
-extern char *DefineHistogramPred();
-extern void PrintHistogram();
-extern void ModalDev();
-
-/* not yet
-char *Histogram;
-char *MeanPred;
-char *MedianPred;
-char *MiddlePred;
-int Histodim;
-int Histostates;
-double Histomax;
-double Histomin;
-*/
-
-double Onedev_mse;
-double Onedev_mpe;
-double Onedev_modal;
-double Twodev_mse;
-double Twodev_mpe;
-double Twodev_modal;
-double Devcounts;
-
-double Lifetime_mse[LIFETIMES];
-double Lifetime_mpe[LIFETIMES];
-int Lifetime_count = 0;
-extern int Median_sorted;
-
-const char *Names[PREDS];
-#define NAME(i) (Names[i])
-
-void
-PrintPredData(tp,where)
-struct thruput_pred *tp;
-int where;
-{
-       struct value_el *data = tp->data;
-       int prev = MODMINUS(where,1,HISTORYSIZE);
-       int i;
-
-       fprintf(stdout,"%d %3.4f ",(int)data[where].time, data[where].value);
-
-       for(i=0; i < PREDS; i++)
-       {
-               fprintf(stdout,"| %3.4f %3.4f %3.4f ",PRED(i,data[prev]),
-                       TPMSE(tp,i)/TPCOUNT(tp,i),
-                       TPMAE(tp,i)/TPCOUNT(tp,i));
-       }
-       fprintf(stdout,"| %d %d | ",MedWIN(6,data[prev]),MeanWIN(7,data[prev]));
-       for(i=STATIC_PREDS; i < SECOND_ORDER_PREDS; i++)
-       {
-               fprintf(stdout,"%d ",TPPREDNUM(tp,i));
-       }
-       fprintf(stdout,"| ");
-       for(i=SECOND_ORDER_PREDS; i < PREDS; i++)
-       {
-               fprintf(stdout,"%d ",TPPREDNUM(tp,i));
-       }
-       fprintf(stdout,"\n");
-       fflush(stdout);
-
-       return;
-}
-
-
-void
-ThruputPrediction(tp)
-struct thruput_pred *tp;
-{
-        int tail = tp->tail;
-        int head = tp->head;
-        int i;
-        int prev;
-        double error;
-        double sq_error;
-        struct value_el *data = tp->data;
-        double value;
-        double run_mean = tp->run_mean;
-        double total = tp->total;
-        double tot_sum;
-        double min_run_p_error = MAXDOUBLE;
-        int min_run_p_i = 0;
-        double min_run_sq_error = MAXDOUBLE;
-        int min_run_sq_i = 0;
-        double prev_pred;
-        double absolute_error;
-        int last_error;
-        double min_win_sq_error = MAXDOUBLE;
-        double min_win_p_error = MAXDOUBLE;
-        int min_win_sq_i = 0;
-        int min_win_p_i = 0;
-        double min_tot_sq_error = MAXDOUBLE;
-        double min_tot_p_error = MAXDOUBLE;
-        int min_tot_sq_i = 0;
-        int min_tot_p_i = 0;
-        double win_error;
-        int error_window;
-        int datasize;
-
-        datasize = MODMINUS(head,tail,HISTORYSIZE) - 1;
-        if(ERR_WIN > datasize)
-               error_window = datasize;
-        else
-               error_window = ERR_WIN;
-
-        last_error = MODMINUS(head,error_window,HISTORYSIZE);
-
-
-
-       value = data[head].value;
-       prev = MODMINUS(head,1,HISTORYSIZE);
-#ifdef GROT
-       /*
-        * was the value within one deviation of the total prediction?
-        */
-       avg_err = TPMAE(tp,TOT_MSE_PRED)/TPCOUNT(tp,TOT_MSE_PRED);
-       if((value > (PRED(TOT_MSE_PRED,data[prev])-avg_err)) &&
-          (value < (PRED(TOT_MSE_PRED,data[prev])+avg_err)))
-       {
-               Onedev_mse++;
-       }
-       if((value > (PRED(TOT_MSE_PRED,data[prev])-2*avg_err)) &&
-          (value < (PRED(TOT_MSE_PRED,data[prev])+2*avg_err)))
-       {
-               Twodev_mse++;
-       }
-
-       avg_err = TPMAE(tp,TOT_MAE_PRED)/TPCOUNT(tp,TOT_MAE_PRED);
-       if((value > (PRED(TOT_MAE_PRED,data[prev])-avg_err)) &&
-          (value < (PRED(TOT_MAE_PRED,data[prev])+avg_err)))
-       {
-               Onedev_mpe++;
-       }
-       if((value > (PRED(TOT_MAE_PRED,data[prev])-2*avg_err)) &&
-          (value < (PRED(TOT_MAE_PRED,data[prev])+2*avg_err)))
-       {
-               Twodev_mpe++;
-       }
-
-       ModalDev(Histogram,MedianPred,1.0,&hi,&lo);
-       if((value > lo) && (value < hi))
-               Onedev_modal++;
-       ModalDev(Histogram,MedianPred,2.0,&hi,&lo);
-       if((value > lo) && (value < hi))
-               Twodev_modal++;
-
-       Devcounts++;
-#endif
-
-       /*
-        * calculate the error our last prediction made
-        * now that we have the actual value
-        */
-       for(i=0; i < PREDS; i++)
-       {
-
-               error = data[head].value - PRED(i,data[prev]);
-               if(TPCOUNT(tp,i) < MIN_DATA_HISTORY)
-                       error = 0.0;
-               sq_error = error * error;
-
-               SQERR(i,data[head]) = SQERR(i,data[prev])+sq_error;
-               TPMSE(tp,i) += sq_error;
-               if(error < 0.0)
-                       error = -1.0 * error;
-               absolute_error = error;
-               ERR(i,data[head]) = ERR(i,data[prev])+absolute_error;
-               TPMAE(tp,i) += absolute_error;
-               TPCOUNT(tp,i) += 1.0;
-
-       }
-
-#ifdef GROT
-       /*
-        * now calculate MSE values over different lifetimes
-        */
-       if(datasize > LIFETIMES)
-       {
-               curr = prev;
-               for(i=0; i < LIFETIMES; i++)
-               {
-                       error = data[head].value - 
-                               PRED(TOT_MSE_PRED,data[curr]);
-                       Lifetime_mse[i] += (error * error); 
-                       error = data[head].value - 
-                               PRED(TOT_MAE_PRED,data[curr]);
-                       if(error < 0.0)
-                               error = -1.0 * error;
-                       Lifetime_mpe[i] += (error / data[head].value);
-                       curr = MODMINUS(curr,1,HISTORYSIZE);
-               }
-               Lifetime_count++;
-       }
-#endif
-
-
-
-
-
-       /*
-        * use the current running mean
-        */
-       NAME(0) = "Last value";
-       PRED(0,data[head]) = value;
-
-
-       /*
-        * use the current value as a prediction of the next value
-        */
-       tot_sum = run_mean * total;
-       tot_sum += data[head].value;
-       total++;
-       run_mean = tot_sum/total;
-       tp->run_mean = run_mean;
-       tp->total = total;
-       NAME(1) = "Running Mean";
-       PRED(1,data[head]) = run_mean;
-
-       /*
-        * use the Van Jacobson method
-        */
-       prev_pred = PRED(2,data[prev]);
-       NAME(2) = "Van Jacobson";
-       PRED(2,data[head]) = prev_pred + GAIN*(value - prev_pred);
-
-       /*
-        * tell the median routines that the array is no longer valid
-        */
-       Median_sorted = 0;
-       NAME(3) = "Median";
-       PRED(3,data[head]) = Median(tp,MED_N);
-       NAME(4) = "Trimmed Median";
-       PRED(4,data[head]) = TrimmedMedian(tp,MED_N,MED_ALPHA);
-
-       /*
-        * Now use TrimmedMean to give a sliding window mean
-        */
-       NAME(5) = "Sliding Window Mean";
-       PRED(5,data[head]) = TrimmedMedian(tp,MED_N,0.0);
-       NAME(6) = "Adjusted Median";
-       AdjustedMedian(tp,6,WIN_MIN,WIN_MAX);
-       NAME(7) = "Adjusted Mean";
-       AdjustedMean(tp,7,WIN_MIN,WIN_MAX);
-
-       for(i=0; i < STATIC_PREDS; i++)
-       {
-               if((TPMSE(tp,i)/TPCOUNT(tp,i)) < min_run_sq_error)
-               {
-                       min_run_sq_error = TPMSE(tp,i)/TPCOUNT(tp,i);
-                       min_run_sq_i = i;
-               }
-
-               if((TPMAE(tp,i)/TPCOUNT(tp,i)) < min_run_p_error)
-               {
-                       min_run_p_error = TPMAE(tp,i)/TPCOUNT(tp,i);
-                       min_run_p_i = i;
-               }
-
-               win_error = 
-                       (SQERR(i,data[head]) - SQERR(i,data[last_error])) /
-                               (double)error_window;
-               if(win_error < min_win_sq_error)
-               {
-                       min_win_sq_error = win_error;
-                       min_win_sq_i = i;
-               }
-
-               win_error = 
-                       (ERR(i,data[head]) - ERR(i,data[last_error])) /
-                               (double)error_window;
-               if(win_error < min_win_p_error)
-               {
-                       min_win_p_error = win_error;
-                       min_win_p_i = i;
-               }
-
-       }
-
-
-       NAME(MSE_PRED) = "Min MSE Pred";
-       PRED(MSE_PRED,data[head]) = PRED(min_run_sq_i,data[head]);
-       TPPREDNUM(tp,MSE_PRED) = min_run_sq_i;
-       NAME(MAE_PRED) = "Min MAE Pred";
-       PRED(MAE_PRED,data[head]) = PRED(min_run_p_i,data[head]);
-       TPPREDNUM(tp,MAE_PRED) = min_run_p_i;
-       NAME(WIN_MSE_PRED) = "Win MSE Pred";
-       PRED(WIN_MSE_PRED,data[head]) = PRED(min_win_sq_i,data[head]);
-       TPPREDNUM(tp,WIN_MSE_PRED) = min_win_sq_i;
-       NAME(WIN_MAE_PRED) = "Win MAE Pred";
-       PRED(WIN_MAE_PRED,data[head]) = PRED(min_win_p_i,data[head]);
-       TPPREDNUM(tp,WIN_MAE_PRED) = min_win_p_i;
-
-       for(i=STATIC_PREDS; i < SECOND_ORDER_PREDS; i++)
-       {
-               if((TPMSE(tp,i)/TPCOUNT(tp,i)) < min_tot_sq_error)
-               {
-                       min_tot_sq_error = TPMSE(tp,i)/TPCOUNT(tp,i);
-                       min_tot_sq_i = TPPREDNUM(tp,i);
-               }
-               if((TPMAE(tp,i)/TPCOUNT(tp,i)) < min_tot_p_error)
-               {
-                       min_tot_p_error = TPMAE(tp,i)/TPCOUNT(tp,i);
-                       min_tot_p_i = TPPREDNUM(tp,i);
-               }
-       }
-       NAME(TOT_MSE_PRED) = "Total MSE Pred";
-       PRED(TOT_MSE_PRED,data[head]) = PRED(min_tot_sq_i,data[head]);
-       TPPREDNUM(tp,TOT_MSE_PRED) = min_tot_sq_i;
-       NAME(TOT_MAE_PRED) = "Total MAE Pred";
-       PRED(TOT_MAE_PRED,data[head]) = PRED(min_tot_p_i,data[head]);
-       TPPREDNUM(tp,TOT_MAE_PRED) = min_tot_p_i;
-
-#ifdef PRINTPRED
-       ModalDev(Histogram,MedianPred,2.0,&hi,&lo);
-       fprintf(stdout,"%d %10.5f\n",data[head].time,
-               PRED(TOT_MAE_PRED,data[prev]));
-       
-       fflush(stdout);
-#endif
-
-       return;
-
-}
-
-void
-InitThruputPrediction(struct thruput_pred *tp)
-{
-       int i;
-
-       tp->head = 0;
-       tp->tail = 0;
-
-/* ** NOT yet as we don't quite know what min and max values to use
-
-       Histogram = DefineHistogram(MODES,
-                       DIM,
-                       Histomin,
-                       Histomax);
-       MeanPred = DefineHistogramPred(Histogram);
-       MedianPred = DefineHistogramPred(Histogram);
-       MiddlePred = DefineHistogramPred(Histogram);
-*/
-
-
-        tp->mean = 0.0;
-        tp->run_mean = 0.0;
-        tp->total = 0.0;
-       memset(tp->data,0,sizeof(tp->data));
-
-       for(i=0; i < PREDS; i++)
-       {
-               TPMSE(tp,i) = 0.0;
-               TPCOUNT(tp,i) = 0.0;
-       }
-
-       return;
-}
-
-/* not sure if exptime is right, I just wanted to avoid namespace collisions */
-void
-UpdateThruputPrediction(struct thruput_pred *tp,float value, time_t exptime)
-{
-
-       int head = tp->head;
-       int tail = tp->tail;
-       struct value_el *data = tp->data;
-       int i;
-        int data_size = MODMINUS(head,tail,HISTORYSIZE);
-
-       tp->data[tp->head].time = exptime;
-       tp->data[tp->head].value = value;
-
-       /*
-        * a negative tail value says that we haven't filled the
-        * pipe yet.  See if this does it.
-        */
-       if(data_size > MIN_DATA_HISTORY)
-       {
-               ThruputPrediction(tp);
-
-       }
-       else
-       {
-               for(i=0; i < PREDS; i++)
-               {
-                       PRED(i,data[head]) = tp->data[head].value;
-                       TPMSE(tp,i) = 0.0;
-                       TPMAE(tp,i) = 0.0;
-                       ERR(i,data[head]) = 0.0;
-                       SQERR(i,data[head]) = 0.0;
-                       MedWIN(i,data[head]) = WIN_INIT;
-                       MeanWIN(i,data[head]) = WIN_INIT;
-               }
-               TPPREDNUM(tp,TOT_MSE_PRED) = 0;
-               TPPREDNUM(tp,TOT_MAE_PRED) = 0;
-       }
-
-
-
-       tp->head = MODPLUS(head,1,HISTORYSIZE);
-
-       /*
-        * if we have incremented head forward to that it is sitting on
-        * top of tail, then we need to bump tail.  The entire buffer is
-        * being used to fill the window.
-        */
-       if(tp->head == tp->tail)
-               tp->tail = MODPLUS(tp->tail,1,HISTORYSIZE);
-
-       return;
-}
-
-#ifdef STANDALONE
-
-#define PRED_ARGS "f:d:s:l:h:"
-
-#include "format.h"
-
-CalculateThruputPredictors(fname,tp)
-char *fname;
-struct thruput_pred *tp;
-{
-       FILE *fd;
-       char line_buf[255];
-       char *cp;
-       time_t ltime;
-       float value;
-       int i;
-
-
-       fd = fopen(fname,"r");
-
-       if(fd == NULL)
-       {
-               fprintf(stderr,
-                       "CalculateThruputPredictors: unable to open file %s\n",
-                               fname);
-               fflush(stderr);
-               exit(1);
-       }
-
-       while(fgets(line_buf,255,fd))
-       {
-               cp = line_buf;
-
-               while(isspace(*cp))
-                       cp++;
-
-               for(i=1; i < TSFIELD; i++)
-               {
-                       while(!isspace(*cp))
-                               cp++;
-
-                       while(isspace(*cp))
-                               cp++;
-               }
-
-               ltime = atoi(cp);
-
-               cp = line_buf;
-
-               for(i=1; i < VALFIELD; i++)
-               {
-                       while(!isspace(*cp))
-                               cp++;
-
-                       while(isspace(*cp))
-                               cp++;
-               }
-
-               value = atof(cp);
-
-               if(value != 0.0)
-                       UpdateThruputPrediction(tp,value,ltime);
-
-       }
-
-       fclose(fd);
-}
-
-
-struct thruput_pred Tp;
-
-main(argc,argv)
-int argc;
-char *argv[];
-{
-
-       FILE *fd;
-       int i;
-       int j;
-       double temp_mse;
-       double temp_mpe;
-       char fname[255];
-       char c;
-
-
-       if(argc < 2)
-       {
-               fprintf(stderr,"usage: testpred filename\n");
-               fflush(stderr);
-               exit(1);
-       }
-
-       fname[0] = 0;
-       Histodim = DIM;
-       Histostates = STATES;
-       Histomax = HMAX;
-       Histomin = HMIN;
-
-       while((c = getopt(argc,argv,PRED_ARGS)) != EOF)
-       {
-               switch(c)
-               {
-                       case 'f':
-                               SAFESTRCPY(fname,optarg);
-                               break;
-                       case 'd':
-                               Histodim = atoi(optarg);
-                               break;
-                       case 's':
-                               Histostates = atoi(optarg);
-                               break;
-                       case 'l':
-                               Histomin = atof(optarg);
-                               break;
-                       case 'h':
-                               Histomax = atof(optarg);
-                               break;
-               }
-       }
-
-       if(fname[0] == 0)
-       {
-               fprintf(stderr,"usage: predictor -f fname [-d,s,l,h]\n");
-               fflush(stderr);
-               exit(1);
-       }
-
-       InitThruputPrediction(&Tp);
-                               
-#if !defined(PRINTPRED)
-       fprintf(stdout,"Calculating throughput predictors...");
-       fflush(stdout);
-#endif
-
-       CalculateThruputPredictors(fname,&Tp);
-
-       fprintf(stdout,"done.\n");
-       fflush(stdout);
-
-       for(i=0; i < PREDS; i++)
-       {
-
-               fprintf(stdout,"Predictor %d, MSE: %3.4f MAE: %3.4f, %s\n",
-                       i,TPMSE(&Tp,i)/TPCOUNT(&Tp,i),
-                               TPMAE(&Tp,i)/TPCOUNT(&Tp,i),
-                               NAME(i));
-       }
-
-       fprintf(stdout,"MSE within 1 dev: %3.2f, 2 dev: %3.2f\n",
-                       Onedev_mse/Devcounts,Twodev_mse/Devcounts);
-       fprintf(stdout,"MAE within 1 dev: %3.2f, 2 dev: %3.2f\n",
-                       Onedev_mpe/Devcounts,Twodev_mpe/Devcounts);
-       fprintf(stdout,"Modal within 1 dev: %3.2f, 2 dev: %3.2f\n",
-                       Onedev_modal/Devcounts,Twodev_modal/Devcounts);
-
-
-#ifdef GROT
-       fprintf(stdout,"\nlook ahead  MSE  MAE\n");
-       for(i=0; i < LIFETIMES; i++)
-       {
-               temp_mse = 0.0;
-               temp_mpe = 0.0;
-               for(j=0; j <= i; j++)
-               {
-                       temp_mse += (Lifetime_mse[j]/(double)Lifetime_count);
-                       temp_mpe += (Lifetime_mpe[j]/(double)Lifetime_count);
-               }
-               fprintf(stdout,"%d %f %f\n",i,
-                               temp_mse/(double)j,
-                               temp_mpe/(double)j);
-       }
-#endif
-
-       fprintf(stdout,"Histogram\n");
-       PrintHistogram(Histogram);
-       fprintf(stdout,"\n");
-
-       exit(0);
-
-       
-}
-#endif
diff --git a/src/nws_portability/Forecast/run_mean.c b/src/nws_portability/Forecast/run_mean.c
deleted file mode 100644 (file)
index a089124..0000000
+++ /dev/null
@@ -1,89 +0,0 @@
-/* $Id$ */
-
-#include <unistd.h>
-#include <stdlib.h>
-#include <stdio.h>
-#include <math.h>
-#include <string.h>
-#include <strings.h>
-
-#include "fbuff.h"
-#include "run_mean.h"
-
-struct run_mean_state
-{
-       fbuff series;                   /* the series so far */
-       fbuff time_stamps;              /* the time stamps */
-       double total;
-       double count;
-};
-
-/*
- * init local state.  can save a copy of the pointer to the
- * series and time stamps, if desired
- */
-char *
-InitRunMean(fbuff series, fbuff time_stamps, char *params)
-{
-       struct run_mean_state *state;
-       
-       state = (struct run_mean_state *)
-               malloc(sizeof(struct run_mean_state));
-       
-       if(state == NULL)
-       {
-               return(NULL);
-       }
-       
-       /*
-        * all functions take a forcb
-        */
-       state->series = series;
-       state->time_stamps = time_stamps;
-       state->total = 0.0;
-       state->count = 0.0;
-       
-       return((char *)state);
-}
-
-void
-FreeRunMean(char *state)
-{
-       free(state);
-       return;
-}
-
-void
-UpdateRunMean(char *state,
-               double ts,
-               double value)
-{
-       struct run_mean_state *s;
-       
-       s = (struct run_mean_state *)state;
-       
-       s->total += value;
-       s->count += 1.0;
-       return;
-}
-
-int
-ForcRunMean(char *state, double *v)
-{
-       double val;
-       struct run_mean_state *s = (struct run_mean_state *)state;
-       
-       if(s->count != 0.0)
-       {
-               val = s->total / s->count;
-               *v = val;
-               return(1);
-       }
-       else
-       {
-               *v = 0.0;
-               return(0);
-       }
-}
-
-
diff --git a/src/nws_portability/Include/.cvsignore b/src/nws_portability/Include/.cvsignore
deleted file mode 100644 (file)
index 8426c89..0000000
+++ /dev/null
@@ -1 +0,0 @@
-config_portability.h
diff --git a/src/nws_portability/Include/Makefile b/src/nws_portability/Include/Makefile
deleted file mode 100755 (executable)
index c018647..0000000
+++ /dev/null
@@ -1,37 +0,0 @@
-#
-# Makefile for Include
-#
-# $Id$
-#
-
-# include common variables
-include ../Makedefs
-
-# headers to be installed 
-HEADERS =      diagnostic.h \
-               dnsutil.h \
-               formatutil.h \
-               messages.h \
-               osutil.h \
-               protocol.h \
-               config_portability.h \
-               strutil.h \
-               fbuff.h \
-               timeouts.h \
-               forecast_api.h
-
-.PHONY: all clean dist install
-
-all: 
-       @$(CP) $(HEADERS) $(buildincdir)
-
-clean:
-
-dist:
-       @$(INSTALL) -d $(DIST_ROOT)/Include
-       @$(CP) Makefile *.h.in *.h $(DIST_ROOT)/Include
-
-install:
-       @echo "Installing header files..."
-       @$(CP) $(HEADERS) $(incdir)
-
diff --git a/src/nws_portability/Include/config_portability.h.in b/src/nws_portability/Include/config_portability.h.in
deleted file mode 100644 (file)
index 7bf83a3..0000000
+++ /dev/null
@@ -1,164 +0,0 @@
-/* $Id$ */
-
-#ifndef CONFIG_PORTABILITY_H
-#define CONFIG_PORTABILITY_H
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#ifndef NULL
-#  define NULL 0
-#endif
-
-/* Have standard C headers. */
-#undef STDC_HEADERS
-
-/* Preserve 2.0 interface with this definition */
-#undef NWS_API_COMPAT
-
-/* Define to `int' if <sys/types.h> doesn't define.  */
-#undef pid_t
-
-/* Define if you have the alarm function.  */
-#undef HAVE_ALARM
-
-/* Define if you have inet_ntoa */
-#undef HAVE_INET_ATON
-
-/* Define if you have inet_ntoa */
-#undef HAVE_INET_NTOA
-
-/* Define if you have gettimeofday */
-#undef HAVE_GETTIMEOFDAY
-
-/* Define if you have gethostname. Some OSes doesn't have the definition
- * in the include: define it here to avoid warning message. */
-#undef HAVE_GETHOSTNAME
-#ifdef HAVE_GETHOSTNAME
-int
-gethostname();  
-#endif
-
-/* Define if you have uname */
-#undef HAVE_UNAME
-
-/* Define if you have gethostbyname */
-#undef HAVE_GETHOSTBYNAME
-
-/* Define if you have gethostbyaddr */
-#undef HAVE_GETHOSTBYADDR
-
-/* Define if you have gethostbyaddr */
-#undef HAVE_GETHOSTBYADDR_R
-
-/* Define if you have the getrusage function.  */
-#undef HAVE_GETRUSAGE
-
-/* Define if you have the sqrt function.  */
-#undef HAVE_SQRT
-
-/* Define if we are going to use SIGALRM for our purposes */
-#undef USE_ALARM_SIGNAL
-
-/* Define if you have the sighold function.  */
-#undef HAVE_SIGHOLD
-
-/* Define if you have the sigrelse function.  */
-#undef HAVE_SIGRELSE
-
-/* Define if you have the siginterrupt function.  */
-#undef HAVE_SIGINTERRUPT
-
-/* Define if you have the statvfs function.  */
-#undef HAVE_STATVFS
-
-/* Define if you have the sys/vfs.h header.  */
-#undef HAVE_SYS_VFS_H
-
-/* Define if you have the math.h header.  */
-#undef HAVE_MATH_H
-
-/* Define if you have the inttypes.h header.  */
-#undef HAVE_INTTYPES_H
-
-/* Define if you have the declaration of uint32_t.  */
-#undef HAVE_UINT32_T
-/* I would love to use UINT32_T but not with autoconf 2.13 */
-/*#ifdef HAVE_UINT32_T
-* #    ifdef HAVE_INTTYPES_H
-* #            include <inttypes.h>
-* #    endif
-* typedef uint32_t IPAddress;
-* #else
-* typedef unsigned long IPAddress;
-* #endif */
-/* kludge to be sure we have uint32_t */
-#ifdef HAVE_INTTYPES_H
-#      include <inttypes.h>
-#endif
-#ifndef uint32_t
-#undef uint32_t
-#endif
-/* end kludge*/
-
-/* Define if you have the sysconf function.  */
-#undef HAVE_SYSCONF
-
-/* Define if you have the strnlen function.  */
-#undef HAVE_STRNLEN
-
-/* Define if you have the fileno function.  */
-#undef HAVE_FILENO
-
-/* Define to the type pointed to by the third parameter of getpeername(). */
-#undef SOCKLEN_T
-
-/* Define to the (char *) version of the NWS sources. */
-#undef VERSION
-
-/* Define as the path to the `uptime' program. */
-#undef UPTIME_PATH
-
-/* Define as the path to the `vmstat' program. */
-#undef VMSTAT_PATH
-
-/* in some realloc()s, realloc(ptr, 0) != free(ptr) */
-#undef REALLOC_NOT_POSIX
-
-/* do we have the pthread header? (and hopefully pthread support) */
-#undef HAVE_PTHREAD_H
-#ifdef HAVE_PTHREAD_H
-#define _REENTRANT
-#endif
-
-#undef PS
-
-#undef AWK
-
-#undef WITH_NETLOGGER
-
-#undef WITH_LDAP
-
-
-#define MALLOC(size) malloc ((size)==0?1:(size))
-
-#define FREE(ptr) \
-        if (ptr != NULL) { \
-               free(ptr); \
-               ptr = NULL; \
-       }
-
-
-#ifdef REALLOC_NOT_POSIX
-#define REALLOC(ptr,size) (((size > 0)?((ptr == NULL)?malloc(size):\
-       realloc(ptr,size)):((ptr == NULL)?NULL:(free(ptr),NULL))))
-#else
-#define REALLOC(ptr,size) realloc(ptr,size)
-#endif
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* CONFIG_PORTABILITY_H */
diff --git a/src/nws_portability/Include/diagnostic.h b/src/nws_portability/Include/diagnostic.h
deleted file mode 100644 (file)
index d910eb9..0000000
+++ /dev/null
@@ -1,223 +0,0 @@
-/* $Id$ */
-
-
-#ifndef DIAGNOSTIC_H
-#define DIAGNOSTIC_H
-
-
-/*
- * This module manages the production of diagnostic messages.
- */
-
-
-#include <stdio.h> /* FILE */
-
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-
-/*
-** Different types of diagnostics.
-*/
-typedef enum {DIAGLOG, DIAGINFO, DIAGWARN, DIAGERROR, DIAGFATAL, DIAGDEBUG} DiagLevels;
-
-
-#define DIAGSUPPRESS 0
-
-/* 
- * Maximum size for the message and for filenames
- */
-#define MAX_MESSAGE_LENGTH 512
-#define MAX_FILENAME_LENGTH 512
-
-/*
-** Directs #level#-level diagnostic messages to the file #whereTo#.  Messages
-** for any level may be supressed by passing DIAGSUPPRESS as the second
-** parameter to this routine.  By default, all messages are suppressed.
-*/
-void
-DirectDiagnostics(DiagLevels level,
-                  FILE *whereTo);
-
-
-/*
-** Returns the file to which #level#-level diagnostics are being directed.  May
-** be used to save off the direction for a change/restore, or for writing out
-** non-message-based information.
-*/
-FILE *
-DiagnosticsDirection(DiagLevels level);
-
-
-/*
-** Produces the #level#-level diagnostic message #message#, which is used as
-** the format string in a call to fprintf().  #sourcefilename# and
-** #sourcelinenumber# are appended to the message.  Additional fprintf()
-** arguments may be passed after #message#.
-*/
-void
-PositionedDiagnostic(DiagLevels level,
-                     const char *fileName, 
-                     int line,
-                     const char *message,
-                     ...);
-
-
-/*
-** Produces the #level#-level diagnostic message #message#, which is used as
-** the format string in a call to fprintf().  Additional fprintf()
-** arguments may be passed after #message#.
-*/
-void
-Diagnostic(DiagLevels level,
-           const char *message,
-           ...);
-
-
-/*
-** These macros are provided for the usual case where DIAGFATAL messages are
-** emitted just before aborting the program and DIAGERROR messages just before
-** returning a failure value from a function.  The ERROR, WARN, INFO, and LOG
-** macros are just a handy shorthand.  Unfortunately, the varargs concept
-** doesn't extend to macros, which means separate macros have to be defined for
-** various parameter counts.  The peculiar use of do ... while here prevents
-** compilation problems in cases such as:
-** if (foo < bar) FAIL("ick!"); else something();
-** The embedded if (1) satisfies the picky compilers that complain about
-** execution not reaching the loop test otherwise.
-*/
-#define ABORT(message) \
-  do { \
-    PositionedDiagnostic(DIAGFATAL,__FILE__, __LINE__,message); \
-    if (1) exit(1); \
-  } while (0)
-#define ABORT1(message,a) \
-  do { \
-    PositionedDiagnostic(DIAGFATAL,__FILE__,__LINE__,message,a); \
-    if (1) exit(1); \
-  } while (0)
-#define ABORT2(message,a,b) \
-  do { \
-    PositionedDiagnostic(DIAGFATAL,__FILE__,__LINE__,message,a,b); \
-    if (1) exit(1); \
-  } while (0)
-#define ABORT3(message,a,b,c) \
-  do { \
-    PositionedDiagnostic(DIAGFATAL,__FILE__,__LINE__,message,a,b,c); \
-    if (1) exit(1); \
-  } while (0)
-#define ABORT4(message,a,b,c,d) \
-  do { \
-    PositionedDiagnostic(DIAGFATAL,__FILE__,__LINE__,message,a,b,c,d); \
-    if (1) exit(1); \
-  } while (0)
-#define ABORT5(message,a,b,c,d,e) \
-  do { \
-    PositionedDiagnostic(DIAGFATAL,__FILE__,__LINE__,message,a,b,c,d,e); \
-    if (1) exit(1); \
-  } while (0)
-
-#define FAIL(message) \
-  do { \
-    PositionedDiagnostic(DIAGERROR,__FILE__,__LINE__,message); \
-    if (1) return(0); \
-  } while (0)
-#define FAIL1(message,a) \
-  do { \
-    PositionedDiagnostic(DIAGERROR,__FILE__,__LINE__,message,a); \
-    if (1) return(0); \
-  } while (0)
-#define FAIL2(message,a,b) \
-  do { \
-    PositionedDiagnostic(DIAGERROR,__FILE__,__LINE__,message,a,b); \
-    if (1) return(0); \
-  } while (0)
-#define FAIL3(message,a,b,c) \
-  do { \
-    PositionedDiagnostic(DIAGERROR,__FILE__,__LINE__,message,a,b,c); \
-    if (1) return(0); \
-  } while (0)
-#define FAIL4(message,a,b,c,d) \
-  do { \
-    PositionedDiagnostic(DIAGERROR,__FILE__,__LINE__,message,a,b,c,d); \
-    if (1) return(0); \
-  } while (0)
-#define FAIL5(message,a,b,c,d,e) \
-  do {PositionedDiagnostic(DIAGERROR,__FILE__,__LINE__,message,a,b,c,d,e); \
-    if (1) return(0); \
-  } while (0)
-
-#define ERROR(message) \
-  PositionedDiagnostic(DIAGERROR,__FILE__,__LINE__,message)
-#define ERROR1(message,a) \
-  PositionedDiagnostic(DIAGERROR,__FILE__,__LINE__,message,a)
-#define ERROR2(message,a,b) \
-  PositionedDiagnostic(DIAGERROR,__FILE__,__LINE__,message,a,b)
-#define ERROR3(message,a,b,c) \
-  PositionedDiagnostic(DIAGERROR,__FILE__,__LINE__,message,a,b,c)
-#define ERROR4(message,a,b,c,d) \
-  PositionedDiagnostic(DIAGERROR,__FILE__,__LINE__,message,a,b,c,d)
-#define ERROR5(message,a,b,c,d,e) \
-  PositionedDiagnostic(DIAGERROR,__FILE__,__LINE__,message,a,b,c,d,e)
-
-#define WARN(message) \
-  PositionedDiagnostic(DIAGWARN,__FILE__,__LINE__,message)
-#define WARN1(message,a) \
-  PositionedDiagnostic(DIAGWARN,__FILE__,__LINE__,message,a)
-#define WARN2(message,a,b) \
-  PositionedDiagnostic(DIAGWARN,__FILE__,__LINE__,message,a,b)
-#define WARN3(message,a,b,c) \
-  PositionedDiagnostic(DIAGWARN,__FILE__,__LINE__,message,a,b,c)
-#define WARN4(message,a,b,c,d) \
-  PositionedDiagnostic(DIAGWARN,__FILE__,__LINE__,message,a,b,c,d)
-#define WARN5(message,a,b,c,d,e) \
-  PositionedDiagnostic(DIAGWARN,__FILE__,__LINE__,message,a,b,c,d,e)
-
-#define INFO(message) \
-  PositionedDiagnostic(DIAGINFO,__FILE__,__LINE__,message)
-#define INFO1(message,a) \
-  PositionedDiagnostic(DIAGINFO,__FILE__,__LINE__,message,a)
-#define INFO2(message,a,b) \
-  PositionedDiagnostic(DIAGINFO,__FILE__,__LINE__,message,a,b)
-#define INFO3(message,a,b,c) \
-  PositionedDiagnostic(DIAGINFO,__FILE__,__LINE__,message,a,b,c)
-#define INFO4(message,a,b,c,d) \
-  PositionedDiagnostic(DIAGINFO,__FILE__,__LINE__,message,a,b,c,d)
-#define INFO5(message,a,b,c,d,e) \
-  PositionedDiagnostic(DIAGINFO,__FILE__,__LINE__,message,a,b,c,d,e)
-
-#define LOG(message) \
-  PositionedDiagnostic(DIAGLOG,__FILE__,__LINE__,message)
-#define LOG1(message,a) \
-  PositionedDiagnostic(DIAGLOG,__FILE__,__LINE__,message,a)
-#define LOG2(message,a,b) \
-  PositionedDiagnostic(DIAGLOG,__FILE__,__LINE__,message,a,b)
-#define LOG3(message,a,b,c) \
-  PositionedDiagnostic(DIAGLOG,__FILE__,__LINE__,message,a,b,c)
-#define LOG4(message,a,b,c,d) \
-  PositionedDiagnostic(DIAGLOG,__FILE__,__LINE__,message,a,b,c,d)
-#define LOG5(message,a,b,c,d,e) \
-  PositionedDiagnostic(DIAGLOG,__FILE__,__LINE__,message,a,b,c,d,e)
-
-/* /usr/include/macros.h defines a DEBUG macro, so we use DDEBUG instead. */
-#define DDEBUG(message) \
-  PositionedDiagnostic(DIAGDEBUG,__FILE__,__LINE__,message)
-#define DDEBUG1(message,a) \
-  PositionedDiagnostic(DIAGDEBUG,__FILE__,__LINE__,message,a)
-#define DDEBUG2(message,a,b) \
-  PositionedDiagnostic(DIAGDEBUG,__FILE__,__LINE__,message,a,b)
-#define DDEBUG3(message,a,b,c) \
-  PositionedDiagnostic(DIAGDEBUG,__FILE__,__LINE__,message,a,b,c)
-#define DDEBUG4(message,a,b,c,d) \
-  PositionedDiagnostic(DIAGDEBUG,__FILE__,__LINE__,message,a,b,c,d)
-#define DDEBUG5(message,a,b,c,d,e) \
-  PositionedDiagnostic(DIAGDEBUG,__FILE__,__LINE__,message,a,b,c,d,e)
-
-#ifdef __cplusplus
-}
-#endif
-
-
-#endif
diff --git a/src/nws_portability/Include/dnsutil.h b/src/nws_portability/Include/dnsutil.h
deleted file mode 100644 (file)
index 5db9e70..0000000
+++ /dev/null
@@ -1,112 +0,0 @@
-/* $Id$ */
-
-
-#ifndef DNSUTIL_H
-#define DNSUTIL_H
-
-#include "config_portability.h"
-
-/**
- * This package defines some utilities for determining and converting DNS
- * machine names and IP addresses.
- */
-
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-
-#define MAX_IP_IMAGE 15
-/* Maximum text length of an IP address, i.e. strlen("255.255.255.255") */
-
-
-/*
- * Common typedefs for all portability 
- */
-typedef uint32_t IPAddress;
-typedef int Socket;
-#define NO_SOCKET ((Socket)-1)
-
-/**
- * returns the address of the host connected to #sd#. Returns 0 on error.
- */
-IPAddress
-Peer(Socket sd);
-
-
-/**
- * Returns the DNS name of the host connected to #sd#, or descriptive text if
- * #sd# is not an inter-host connection: returns NULL in case of error
- * The value returned needs to be freed.
- */
-char *
-PeerName_r(Socket sd);
-
-/*
- * returns the port number on the other side of socket sd. -1 is returned
- * if pipes or unknown
- */
-unsigned short
-PeerNamePort(Socket sd);
-
-
-/**
- * Converts #addr# into a printable string and returns the result.  You
- * are responsible to free the returned string: can return NULL (out of
- * memory condition).
- */
-char *
-IPAddressImage_r(IPAddress addr);
-
-
-/**
- * Converts #addr# to a fully-qualified machine name and returns the result.
- * You are responsible to free the returned string: can return NULL 
- * (out of memory or error).
- */
-char *
-IPAddressMachine_r(IPAddress addr);
-
-/*
- * Converts #machineOrAddress#, which may be either a DNS name or an IP address
- * image, into a list of addresses.  Copies the list into the #atMost#-long
- * array #addressList#.  Returns the number of addresses copied, or zero on
- * error.  #atMost# may be zero, in which case the function simply returns one
- * or zero depending on whether or not #machineOrAddress# is a valid machine
- * name or IP address image.
- */
-int
-IPAddressValues(const char *machineOrAddress,
-                IPAddress *addressList,
-                unsigned int atMost);
-#define IPAddressValue(machineOrAddress,address) \
-        IPAddressValues(machineOrAddress,address,1)
-#define IsValidIP(machineOrAddress) IPAddressValues(machineOrAddress,NULL,0)
-
-
-/**
- * Returns the fully-qualified name of the host machine, or NULL if the name
- * cannot be determined.  Always returns the same value, so multiple calls
- * cause no problems.
- */
-const char *
-MyMachineName(void);
-
-
-/* DEPRECATED! These functions are going to go away: they are not thread
- * safe. */ 
-const char *
-IPAddressImage(IPAddress addr);
-const char *
-IPAddressMachine(IPAddress addr);
-const char *
-PeerName(Socket sd);
-
-
-#ifdef __cplusplus
-}
-#endif
-
-
-#endif
diff --git a/src/nws_portability/Include/exp_smooth.h b/src/nws_portability/Include/exp_smooth.h
deleted file mode 100644 (file)
index eccb961..0000000
+++ /dev/null
@@ -1,20 +0,0 @@
-/* $Id$ */
-
-#if !defined(EXP_SMOOTH_H)
-#define EXP_SMOOTH_H
-
-#include "fbuff.h"
-
-extern char *InitExpSmooth(fbuff series,
-                          fbuff time_stamps,
-                          char *params);
-
-extern void FreeExpSmooth(char *state);
-
-extern void UpdateExpSmooth(char *state,
-                           double ts,
-                           double value);
-
-extern int ForcExpSmooth(char *state, double *v);
-#endif
-
diff --git a/src/nws_portability/Include/fbuff.h b/src/nws_portability/Include/fbuff.h
deleted file mode 100644 (file)
index 2dd9181..0000000
+++ /dev/null
@@ -1,35 +0,0 @@
-/* $Id$ */
-
-#if !defined(FBUFF_H)
-#define FBUFF_H
-
-#define MODMINUS(a,b,m) ((a) - (b) + (((a) >= (b)) ? 0 : ((b) <= (m)) ? (m) : ((m) * (1 + (int)(b) / (int)(m)))))
-#define MODPLUS(a,b,m)  ((a) + (b) - ((((m) - (b)) > (a)) ? 0 : ((b) <= (m)) ? (m) : ((m) * (1 + (int)(b) / (int)(m)))))
-
-struct fbuff_stc
-{
-       int head;
-       int tail;
-       int size;
-       double *vals;
-};
-
-typedef struct fbuff_stc *fbuff;
-
-#define FBUFF_SIZE (sizeof(struct fbuff_stc))
-
-#define F_HEAD(fb) ((fb)->vals[(fb)->head])
-#define F_SIZE(fb) ((fb)->size)
-#define F_FIRST(fb) MODPLUS(((fb)->head),1,(fb)->size)
-#define F_LAST(fb) ((fb)->head)
-#define F_VAL(fb,i) ((fb)->vals[(i)])
-#define F_COUNT(fb) (MODMINUS((fb)->tail,(fb)->head,(fb)->size) - 1)
-#define F_TAIL(fb) ((fb)->tail)
-
-#define IS_EMPTY(fb) ((F_COUNT(fb) == 0) ? 1 : 0) 
-
-extern fbuff InitFBuff(int size);
-extern void FreeFBuff(fbuff fb);
-extern void UpdateFBuff(fbuff fb, double val);
-
-#endif
diff --git a/src/nws_portability/Include/forc.h b/src/nws_portability/Include/forc.h
deleted file mode 100644 (file)
index a1e9c30..0000000
+++ /dev/null
@@ -1,193 +0,0 @@
-#if !defined(FORC_H)
-
-#define FORC_H
-
-/*
- * forcb structure contains generic forecasting fields.  The individual
- * forecastres can see the current time series and time_stamps as well
- * as any other local state that wish to preserve.
- */
-
-#include "fbuff.h"
-#include "mse_forc.h"
-
-struct forcb_stc
-{
-       fbuff series;                   /* data series */
-       fbuff time_stamps;              /* time stamp series */
-       fbuff se_series;                /* cumulative sq. err. series */
-       fbuff ae_series;                /* cumulative ab err series */
-       double best_f;                  /* best forecast */
-       int best_i;                     /* best forecast number */
-       double best_err;                /* cum best err */
-       char *state;
-       double se;
-       double ae;
-       double count;
-       void (*update)();
-       int (*forecast)();
-       void (*free)();
-       char name[255];
-};
-
-typedef struct forcb_stc *forcb;
-
-#define FORCB_SIZE (sizeof(struct forcb_stc))
-
-
-/*
- * list of forcb structs -- used as a cookie through the interface
- */
-struct fork_list_stc
-{
-       forcb *forcs;
-       int count;
-       forcb *derived_forcs;
-       int derived_count;
-       forcb total_mse;
-       int total_mse_method;
-       forcb total_mae;
-       int total_mae_method;
-};
-
-#define FORCL_SIZE (sizeof(struct fork_list_stc))
-
-typedef struct fork_list_stc *forcl;
-
-struct forc_life_stc
-{
-       char *forc_list;
-       double lifetime;
-       double epoch_end;
-       double total;
-       double count;
-};
-#define FORCLIFE_SIZE (sizeof(struct forc_life_stc))
-
-typedef struct forc_life_stc *forclife;
-
-
-/*
- * initializes forecasting structure with as many as #max_forc_count#
- * forecasters and a circular buffer with #buff_size# values and
- * time_stamp entries.  Returns a cookie to be passed subsequently
- */
-char *
-InitForcl(int max_forc_count, int buff_size);
-
-/*
- * lifetime version 
- */
-char *
-InitForcLife(int max_forc_count, int buff_size, double lifetime);
-
-/*
- * frees forecaster state associated with cookie #i_forcl#
- */
-void
-FreeForcl(char *cookie);
-
-/*
- * lifetime version
- */
-void
-FreeForcLife(char *state);
-
-
-/*
- * updates forecaster state associated with #cookie# using #value#
- * and #time_stamp#.  Neither #value# nore #time_stamp# are checked
- * for validity
- */
-void
-UpdateForecasts(char *cookie, double time_stamp, double value);
-
-/*
- * lifetime version
- */
-void
-UpdateForcLife(char *state, double ts, double value);
-
-/*
- * returns value and lifetime from series (may be averages)
- */
-double
-LifetimeValue(char *state);
-
-double
-LifetimeTimestamp(char *state);
-
-
-
-/*
- * generates MSE nd MAE forecasts value for data associated with #cookie#
- */
-double MSEForecast(char *cookie);
-double MSEOptForecast(char *cookie);
-double MSEError(char *cookie);
-int MSEMethod(char *cookie);
-int MSEOptMethod(char *cookie);
-double MAEForecast(char *cookie);
-double MAEOptForecast(char *cookie);
-double MAEError(char *cookie);
-int MAEMethod(char *cookie);
-int MAEOptMethod(char *cookie);
-
-/*
- * same API for versions that take a lifetime and forecast the average
- */
-double MSELifetimeForecast(char *cookie);
-double MSELifetimeError(char *cookie);
-int MSELifetimeMethod(char *cookie);
-double MSELifetimeEpoch(char *cookie);
-double MAELifetimeForecast(char *cookie);
-double MAELifetimeError(char *cookie);
-int MAELifetimeMethod(char *cookie);
-double MAELifetimeEpoch(char *cookie);
-
-/*
- * prints the low and high forecasts and their forecast numbers
- */
-int
-ForcRange(char *cookie, double *low, double *high, int *low_i, int *high_i);
-
-/*
- * prints a summary of forecaster state
- */
-void PrintForecastSummary(char *state);
-void PrintLifetimeForecastSummary(char *state);
-
-/*
- * routine put in to support FORECASTAPI_MethodName which doesn't
- * take a state record
- */
-void GetForcNames(char *state, 
-                 char *methodNames[], 
-                 int max_size, 
-                 int *out_size);
-
-/*
- * generic interface requiring no size parameterization -- could waste
- * space
- */
-
-/*
- * maximum number of forecasters
- */
-#define MAX_FORC (35)
-
-/*
- * default size of circular buffer
- */
-#define MAX_DATA_ENTRIES (100)
-
-#define INITFORECASTER() (InitForcl(MAX_FORC,MAX_DATA_ENTRIES))
-#define FREEFORECASTER(cookie) (FreeForcl(cookie))
-#define UPDATEFORECASTER(cookie,ts,v) (UpdateForecasts((cookie),(ts),(v)))
-#define FORECAST(cookie) (MSEForecast((cookie)))
-
-#define DBIG_VAL (999999999999999999999999999.99)
-#define FORE_ERROR_VAL (DBIG_VAL)
-
-
-#endif
diff --git a/src/nws_portability/Include/forecast_api.h b/src/nws_portability/Include/forecast_api.h
deleted file mode 100644 (file)
index b1f6d17..0000000
+++ /dev/null
@@ -1,143 +0,0 @@
-/* $Id$ */
-
-#ifndef FORECAST_API_H
-#define FORECAST_API_H
-
-
-#include <sys/types.h>  /* size_t */
-
-
-/*
- * This file defines the API for the Network Weather Service forecast-
- * generation library.  The functions defined here allow programs to compute
- * forecasts from time-stamp/value pairs. The logic of operation is: 
- *     - create a new ForecasterState
- *     - Update the state with values you observe
- *     - get a forecast back
- *
- * NOTE: In order to avoid name collisions, all names defined here begin with
- * FORECASTAPI_.  To avoid having to use this prefix, #define
- * FORECASTAPI_SHORTNAMES before #include'ing this file.
- */
-
-
-/*
- * A description of a measurement.  The time the measurement was taken
- * (represented as a number of seconds since midnight, 1/1/1970 GMT) and the
- * observed value.
- */
-typedef struct {
-  double timeStamp;
-  double measurement;
-} FORECASTAPI_Measurement;
-
-
-/*
- * A description of a forecast.  The forecast value itself, an estimate of the
- * precision of the forecast, and an index for the method used to generate it.
- */
-typedef struct {
-  double forecast;
-  double error;
-  unsigned int methodUsed;
-} FORECASTAPI_Forecast;
-
-
-/**
- * A description of a collection of forecasts, each one based on minimizing a
- * different measurement of the error (MAE == MEAN_ABSOLUTE_ERROR, MSE ==
- * MEAN_SQUARE_ERROR).  The actual measurement taken at the same time is
- * included for convenience when available.
- */
-#define FORECASTAPI_FORECAST_TYPE_COUNT 2
-#define FORECASTAPI_MAE_FORECAST 0
-#define FORECASTAPI_MSE_FORECAST 1
-typedef struct {
-       FORECASTAPI_Measurement measurement;
-       FORECASTAPI_Forecast forecasts[FORECASTAPI_FORECAST_TYPE_COUNT];
-} FORECASTAPI_ForecastCollection;
-
-
-/**
- * A description of a forecasting state.  Client code should obtain these
- * structures via NewForecastState(), update them with new values via
- * UpdateForecastState(), then delete them via FreeForecastState().
- */
-struct FORECASTAPI_ForecastStateStruct;
-typedef struct FORECASTAPI_ForecastStateStruct FORECASTAPI_ForecastState;
-
-
-/**
- * Frees the memory occupied by the forecasting state pointed to by #state#
- * and sets #state# to NULL.
- */
-void
-FORECASTAPI_FreeForecastState(FORECASTAPI_ForecastState **state);
-
-
-/**
- * Returns the name of the #methodIndex#th forecasting method used by the
- * forecasting library, or NULL if #methodIndex# is out of range.
- */
-const char *
-FORECASTAPI_MethodName(unsigned int methodIndex);
-
-
-/**
- * Allocates and returns a new forecasting state, or NULL if memory is
- * exhausted.  The caller should eventually call FreeForecastingState() to
- * free the memory.
- */
-FORECASTAPI_ForecastState *
-FORECASTAPI_NewForecastState(void);
-
-
-/**
- * Incorporates the #howManyMeasurements#-long series #measurements# into the
- * forecasting state #state#.  If #forecasts# is non-NULL, it points to a
- * #howManyForecasts#-long array into which the function should store
- * forecasts generated during the course of the update  If #howManyForecasts#
- * is less than #howManyMeasurements#, the forecasts derived from the later
- * measurements (which appear at the beginning of #measurements#) are stored.
- */
-void
-FORECASTAPI_UpdateForecastState(FORECASTAPI_ForecastState *state,
-                                const FORECASTAPI_Measurement *measurements,
-                                size_t howManyMeasurements,
-                                FORECASTAPI_ForecastCollection *forecasts,
-                                size_t howManyForecasts);
-#define FORECASTAPI_UpdateForecast(state, measurements, howMany) \
-       FORECASTAPI_UpdateForecastState(state, measurements, howMany, NULL, 0)
-
-/**
- * Return a set of forecast base on the current state of the forecaster.
- * #forecast# need to have space for at least one ForecastCollection.
- *
- * Return 1 in case of error, 0 otherwise.
- *
- * Warning: The measurement insite the Collection is not meaningful.
- */
-int
-FORECASTAPI_ComputeForecast(   FORECASTAPI_ForecastState *state,
-                               FORECASTAPI_ForecastCollection *forecast);
-
-#ifdef FORECASTAPI_SHORTNAMES
-
-#define Measurement FORECASTAPI_Measurement
-#define Forecast FORECASTAPI_Forecast
-#define FORECAST_TYPE_COUNT FORECASTAPI_FORECAST_TYPE_COUNT
-#define MAE_FORECAST FORECASTAPI_MAE_FORECAST
-#define MSE_FORECAST FORECASTAPI_MSE_FORECAST
-#define ForecastCollection FORECASTAPI_ForecastCollection
-#define ForecastStateStruct FORECASTAPI_ForecastStateStruct
-#define ForecastState FORECASTAPI_ForecastState
-#define FreeForecastState FORECASTAPI_FreeForecastState
-#define MethodName FORECASTAPI_MethodName
-#define NewForecastState FORECASTAPI_NewForecastState
-#define UpdateForecastState FORECASTAPI_UpdateForecastState
-#define UpdateForecast FORECASTAPI_UpdateForecast
-#define ComputeForecast FORECASTAPI_ComputeForecast
-
-#endif
-
-#endif
diff --git a/src/nws_portability/Include/forecasters.h b/src/nws_portability/Include/forecasters.h
deleted file mode 100644 (file)
index 9858f06..0000000
+++ /dev/null
@@ -1,6 +0,0 @@
-/* $Id$ */
-
-#include "last_value.h"
-#include "exp_smooth.h"
-#include "median.h"
-#include "run_mean.h"
diff --git a/src/nws_portability/Include/formatutil.h b/src/nws_portability/Include/formatutil.h
deleted file mode 100644 (file)
index e18c225..0000000
+++ /dev/null
@@ -1,164 +0,0 @@
-/* $Id$ */
-
-
-#ifndef FORMATUTIL_H
-#define FORMATUTIL_H
-
-
-/*
-** This package provides utilities for translating between host and network
-** data formats.  It may be thought of as an extention of the Unix {hn}to{nh}*
-** functions or as a lightweight version of XDR.  It handles big-to-little
-** endian translations, integer size discrepencies, and conversions to/from
-** IEEE floating point format.  It does *not* presently handle either non-two's
-** complement integer formats or mixed-endian (e.g., little endian bytes, big
-** endian words) ordering.  These are so rare and generally archaic that
-** handling them seems not worth the added code.  Note: compiling the body of
-** this package with NORMAL_FP_FORMAT defined will yield a tiny performance
-** improvement and a small savings in code size by eliminating the IEEE
-** conversion code.
-*/
-
-
-#include <stddef.h>    /* offsetof() */
-#include <sys/types.h> /* size_t */
-
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-
-/*
-** Supported data types.  "Network format" characters are one byte and longs
-** four bytes; otherwise, the formats are those used by Java: two byte shorts,
-** four byte ints and floats, eight byte doubles; two's compliment integer and
-** IEEE 754 floating point; most-significant bytes first.
-*/
-typedef enum
-  {CHAR_TYPE, DOUBLE_TYPE, FLOAT_TYPE, INT_TYPE, LONG_TYPE, SHORT_TYPE,
-   UNSIGNED_INT_TYPE, UNSIGNED_LONG_TYPE, UNSIGNED_SHORT_TYPE, STRUCT_TYPE}
-  DataTypes;
-#define SIMPLE_TYPE_COUNT 9
-typedef enum {HOST_FORMAT, NETWORK_FORMAT} FormatTypes;
-
-
-/*
-** A description of a collection of #type# data.  #repetitions# is used only
-** for arrays; it contains the number of elements.  #offset# is used only for
-** struct members in host format; it contains the offset of the member from the
-** beginning of the struct, taking into account internal padding added by the
-** compiler for alignment purposes.  #members#, #length#, and #tailPadding# are
-** used only for STRUCT_TYPE data; the #length#-long array #members# describes
-** the members of the nested struct, and #tailPadding# indicates how many
-** padding bytes the compiler adds to the end of the structure.
-*/
-typedef struct DataDescriptorStruct {
-  DataTypes type;
-  size_t repetitions;
-  size_t offset;
-  struct DataDescriptorStruct *members;
-  size_t length;
-  size_t tailPadding;
-} DataDescriptor;
-#ifndef NULL
-#define NULL 0
-#endif
-#define SIMPLE_DATA(type,repetitions) {type, repetitions, 0, NULL, 0, 0}
-#define SIMPLE_MEMBER(type,repetitions,offset) \
-  {type, repetitions, offset, NULL, 0, 0}
-#define PAD_BYTES(structType,lastMember,memberType,repetitions) \
-  sizeof(structType) - offsetof(structType, lastMember) - \
-  sizeof(memberType) * repetitions
-
-
-/*
-** Translates the data pointed to by #source# between host and network formats
-** and stores the result in #destination#.  The contents of #source# are
-** described by the #length#-long array #description#, and #sourceFormat#
-** indicates whether we're translating from host format to network format or
-** vice versa.  The caller must insure that the memory pointed to by
-** #destination# is of sufficient size to contain the translated data.
-*/
-void
-ConvertData(void *destination,
-            const void *source,
-            const DataDescriptor *description,
-            size_t length,
-            FormatTypes sourceFormat);
-
-
-/*
-** Returns the number of bytes required to hold the objects indicated by the
-** data described by the #length#-long array #description#.  #hostFormat#
-** indicates whether the host or network format size is desired.
-*/
-size_t
-DataSize(const DataDescriptor *description,
-         size_t length,
-         FormatTypes format);
-
-
-/*
-** Returns 1 or 0 depending on whether or not the host format for #whatType#
-** differs from the network format.
-*/
-int
-DifferentFormat(DataTypes whatType);
-
-
-/*
-** Returns 1 or 0 depending on whether or not the host architecture stores
-** data in little-endian (least significant byte first) order.
-*/
-int
-DifferentOrder(void);
-
-
-/*
-** Returns 1 or 0 depending on whether or not the host data size for #whatType#
-** differs from the network data size.
-*/
-int
-DifferentSize(DataTypes whatType);
-
-
-/*
-** These two functions are a convenience that allows callers to work with
-** homogenous blocks of data without setting up a DataDescriptor.  They perform
-** the same function as the more general function on a block of #repetitions#
-** occurrences of #whatType# data.
-*/
-void
-HomogenousConvertData(void *destination,
-                      const void *source,
-                      DataTypes whatType,
-                      size_t repetitions,
-                      FormatTypes sourceFormat);
-size_t
-HomogenousDataSize(DataTypes whatType,
-                   size_t repetitions,
-                   FormatTypes format);
-
-
-/*
-** Copies #repetitions# data items of type #whatType# from #source# to
-** #destination#, reversing the bytes of each item (i.e., translates between
-** network and host byte order).  #format# indicates whether the data to be
-** reversed is in network or host format.  This is an internal package function
-** which is included in the interface for convenience.
-*/
-void
-ReverseData(void *destination,
-            const void *source,
-            DataTypes whatType,
-            int repetitions,
-            FormatTypes format);
-
-
-#ifdef __cplusplus
-}
-#endif
-
-
-#endif
diff --git a/src/nws_portability/Include/last_value.h b/src/nws_portability/Include/last_value.h
deleted file mode 100644 (file)
index 530738c..0000000
+++ /dev/null
@@ -1,13 +0,0 @@
-/* $Id$ */
-
-#if !defined(LAST_VAL_H)
-#define LAST_VAL_H
-
-#include "fbuff.h"
-
-char *InitLastValue(fbuff series, fbuff time_stamps, char *params);
-void FreeLastValue(char *state);
-void UpdateLastValue(char *state, double ts, double value); 
-int ForcLastValue(char *state, double *v);
-#endif
-
diff --git a/src/nws_portability/Include/median.h b/src/nws_portability/Include/median.h
deleted file mode 100644 (file)
index 433078d..0000000
+++ /dev/null
@@ -1,26 +0,0 @@
-/* $Id$ */
-
-#ifndef MEDIAN_H
-#define MEDIAN_H
-
-#define MAX_MED_SIZE 100
-
-#include "fbuff.h"
-
-char *InitMedian(fbuff series, fbuff time_stamps, char *params);
-void FreeMedian(char *state);
-void UpdateMedian(char *state, double ts, double value);
-int ForcMedian(char *state, double *forecast);
-
-char *InitTrimMedian(fbuff series, fbuff time_stamps, char *params);
-void FreeTrimMedian(char *state);
-void UpdateTrimMedian(char *state, double ts, double value);
-int ForcTrimMedian(char *state, double *forecast);
-
-char *InitAdMedian(fbuff series, fbuff time_stamps, char *params);
-void FreeAdMedian(char *state);
-void UpdateAdMedian(char *state, double ts, double value);
-int ForcAdMedian(char *state, double *forecast);
-
-#endif
-
diff --git a/src/nws_portability/Include/messages.h b/src/nws_portability/Include/messages.h
deleted file mode 100644 (file)
index ffe3858..0000000
+++ /dev/null
@@ -1,196 +0,0 @@
-/* $Id$ */
-
-#ifndef MESSAGES_H
-#define MESSAGES_H
-
-/*
- * This package defines NWS functions for sending messages between hosts.
- */
-
-#include <sys/types.h>  /* size_t */
-#include "formatutil.h" /* DataDescriptor */
-#include "protocol.h"   /* Socket */
-#ifdef WITH_LDAP
-#include <ldap.h>
-#endif
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/**
- * This is the four-byte NWS version number.  The first two bytes are
- * major and minor release numbers; the meaning of the other two bytes is
- * undefined.
- */
-#define NWS_VERSION 0x02030000
-
-
-typedef unsigned int MessageType;
-
-/** 
- * this is the message header: it contains the NWS version (if I don't
- * forget to update) so that we can try to be backward compatible, the
- * message type and the data size. Upwn recepit of a message this is
- * what is passed to the listener along with the open socket.
- */
-typedef struct {
-       unsigned int version;
-       MessageType message;
-       size_t dataSize;
-} MessageHeader;
-
-
-typedef void (*ListenFunction)(Socket *, MessageHeader);
-typedef int (*LdapListenFunction)(Socket *);
-
-
-/**
- * Waits up to #timeOut# seconds to see if a message comes in; if so,
- * calls the registered listener for that message (see
- * RegisterListener()).
- */
-void
-ListenForMessages(double timeOut);
-
-
-/**
- * Indicates a desire that the function #listener# be called whenever a
- * #message# message comes in.  #image# is a printable message name; it's
- * used to log the arrival of the message.
- */
-void
-RegisterListener(MessageType message,
-                 const char *image,
-                 ListenFunction listener);
-
-
-#ifdef WITH_LDAP
-/*
-** Indicates a desire that the function #listener# be called whenever an
-** LDAP message comes in.  Only one LDAP listener may be active at a time.
-*/
-void
-RegisterLdapListener(LdapListenFunction listener);
-
-
-/*
-** Sends an unsolicited notification of disconnection on *sd, then shut down
-** the socket.  See the LDAP RFC for details on this message.
-*/
-void
-SendLdapDisconnect (Socket *sd,
-                    ber_int_t resultCode);
-#endif
-
-
-/**
- * Receives on #sd#, into #data#, the data described by the #howMany#-long
- * array of descriptors #description#.  Returns 1 if successful within
- * #timeOut# seconds, else 0.
- * If #timeOut# is negative adaptive timeouts will be used, if it's 0 no
- * timeouts will be used.
- */
-int
-RecvData(Socket sd,
-         void *data,
-         const DataDescriptor *description,
-         size_t howMany,
-         double timeOut);
-
-
-/**
- * Waits for a #message# message to come in over #sd#.  If successful within
- * #timeOut# seconds, returns 1 and copies the size of the accompanying data
- * into #dataSize#; otherwise, returns 0.
- * If #timeOut# is negative adaptive timeouts will be used, if it's 0 no
- * timeouts will be used.
- */
-int
-RecvMessage(Socket sd,
-            MessageType message,
-            size_t *dataSize,
-            double timeOut);
-
-
-/**
- * Waits for a #message# message to come in over #sd#.  If successful within
- * #timeOut# seconds, returns 1 and copies the accompanying data into #data1#
- * and #data2#, which are described by the #howMany1# and #howMany3#-long
- * arrays of descriptors #description1# and #description2#, respectively;
- * otherwise, returns 0.
- * If #timeOut# is negative adaptive timeouts will be used, if it's 0 no
- * timeouts will be used.
- */
-int
-RecvMessageAndDatas(Socket sd,
-                    MessageType message,
-                    void *data1,
-                    const DataDescriptor *description1,
-                    size_t howMany1,
-                    void *data2,
-                    const DataDescriptor *description2,
-                    size_t howMany2,
-                    double timeOut);
-#define RecvMessageAndData(sd,message,data,description,howMany,timeOut) \
-  RecvMessageAndDatas(sd,message,data,description,howMany,NULL,NULL,0,timeOut)
-
-/**
- * Sends #data#, described by the #howMany#-long array of descriptors
- * #description#.  Returns 1 if successful in #timeOut# seconds, else 0.  This
- * fuction allows callers to extend the data that accompanies messages beyond
- * the two items provided for by SendMessageAndDatas().  Note, however, that
- * since the data sent via a call to this function is not packaged with a
- * message, the receiver will not be able to determine the data size directly.
- * The caller must assure that the data size is known to the recipient, either
- * because its length is predetermined, or because its length was enclosed in a
- * previously-transmitted message.
- * If #timeOut# is negative adaptive timeouts will be used, if it's 0 no
- * timeouts will be used.
- */
-int
-SendData(Socket sd,
-         const void *data,
-         const DataDescriptor *description,
-         size_t howMany,
-         double timeOut);
-
-
-/**
- * Sends a message of type #message# on #sd# followed by #data1# and #data2#,
- * which are described, respectively, by the #howMany1#-long and the
- * #howMany2#-long arrays of descriptors #description1# and #description2#.
- * Each data parameter may be NULL, in which case its description is ignored.
- * Returns 1 if successful within #timeOut# seconds, else 0.
- * If #timeOut# is negative adaptive timeouts will be used, if it's 0 no
- * timeouts will be used.
- */
-int
-SendMessageAndDatas(Socket sd,
-                    MessageType message,
-                    const void *data1,
-                    const DataDescriptor *description1,
-                    size_t howMany1,
-                    const void *data2,
-                    const DataDescriptor *description2,
-                    size_t howMany2,
-                    double timeOut);
-#define SendMessage(sd,message,timeOut) \
-   SendMessageAndDatas(sd,message,NULL,NULL,0,NULL,NULL,0,timeOut)
-#define SendMessageAndData(sd,message,data,descriptor,howMany,timeOut) \
-   SendMessageAndDatas(sd,message,data,descriptor,howMany,NULL,NULL,0,timeOut)
-
-/**
- * reads the NWS header associated with in incoming message and returns
- * the message type #message# as an integer.  returns -1 if the read fails
- * If #timeOut# is negative adaptive timeouts will be used, if it's 0 no
- * timeouts will be used.
- */
-int RecvMsgType(Socket sd, double timeout);
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* MESSAGES_H */
diff --git a/src/nws_portability/Include/mse_forc.h b/src/nws_portability/Include/mse_forc.h
deleted file mode 100644 (file)
index 4e9e368..0000000
+++ /dev/null
@@ -1,20 +0,0 @@
-#ifndef MSE_FORC_H
-
-#define MSE_FORC_H
-
-#define MAX_MSE_WIN (100)
-
-/*
- * API for forc.c
- */
-int TotalMSEForecast(char *state, double *forecast);
-int TotalMAEForecast(char *state, double *forecast);
-
-char *InitWinMSE(fbuff series, fbuff time_stamps, char *params);
-char *InitWinMAE(fbuff series, fbuff time_stamps, char *params);
-void FreeWinMSE(char *state);
-void FreeWinMAE(char *state);
-int LocalWinMSEForecast(char *state, double *forecast);
-int LocalWinMAEForecast(char *state, double *forecast);
-
-#endif
diff --git a/src/nws_portability/Include/osutil.h b/src/nws_portability/Include/osutil.h
deleted file mode 100644 (file)
index 9ef63b3..0000000
+++ /dev/null
@@ -1,132 +0,0 @@
-/* $Id$ */
-
-
-#ifndef OSUTIL_H
-#define OSUTIL_H
-
-
-/*
-** This package defines functions for working with operating system facilities.
-*/
-
-
-#include <sys/types.h>  /* mode_t size_t */
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/*
-** Returns a best-guess estimate of the number of CPUs on the system.
-*/
-int
-CPUCount(void);
-
-
-/*
-** Returns the current time in number of seconds since midnight 1/1/1970, GMT.
-*/
-double
-CurrentTime(void);
-
-
-/*
-** Returns the environment value for the variable #name#.  This value is
-** determined in one of three ways: if an environment variable of that name is
-** set, its value is used; otherwise, if a file named #rcName# in one of the
-** colon-delimited set of directories #rcDirs# contains a line of the form
-** #name#=value, then that value is used; otherwise #defaultValue# is used.
-** For convenience, a directory of "~" in #rcDirs# is expanded to the contents
-** of the HOME environment variable.
-*/
-const char *
-GetEnvironmentValue(const char *name,
-                    const char *rcDirs,
-                    const char *rcName,
-                    const char *defaultValue);
-
-
-/*
-** Attempts to determine the login id of the user running the binary.  Returns
-** 1 and copies the name into the #length#-long array name if successful, else
-** returns 0.
-*/
-int
-GetUserName(char *name,
-            size_t length);
-
-
-/*
- * Wrapper around the system signal() for the SIGALRM signal.
- * new_hanlder is the handler to be installed and old_handler (if not
- * NULL) will contain the handler to be substituted.  
- * Return 1 upon * success and 0 otherwise.
- *
- */
-typedef void(* handler)(int sig);
-int
-SignalAlarm(   handler new_handler,
-               handler *old_handler);
-
-/*
-** Prevents the O/S from raising the signal #sig# until a subsequent call to
-** ReleaseSignal() is made.
-*/
-void
-HoldSignal(int sig);
-
-
-/*
-** Creates the directory specified by #path# with mode #mode#.  If
-** #makeEntirePath# is non-zero, any missing subpaths in #path# will also be
-** created.  Returns 1 if successful, else 0.
-*/
-int
-MakeDirectory(const char *path,
-              mode_t mode,
-              int makeEntirePath);
-
-
-/*
-** Returns the number of microseconds that have elapsed since midnight, local
-** time.
-*/
-long int
-MicroTime(void);
-
-
-/*
-** Allows the O/S to raise the signal #sig#.
-*/
-void
-ReleaseSignal(int sig);
-
-
-/*
-** Starts a timer that will raise a SIGALRM in #numberOfSecs# seconds.
-*/
-void
-SetRealTimer(unsigned int numberOfSecs);
-#define RESETREALTIMER SetRealTimer(0)
-
-/**
- * Locks are handled in a peculiar way: #lock# is a void * passed in by
- * the module. If #lock# is NULL, GetNWSLock() will assign to it a mutex
- * and then it will lock it. It's up to the module to keep track of the
- * different locks.
- * Returns 1 if succesfull 0 otherwise.
- */
-int
-GetNWSLock(void **lock);
-
-/**
- * release the NWS general lock. Returns 1 if succesful, 0 otherwise.
- */
-int
-ReleaseNWSLock(void **lock);
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif
diff --git a/src/nws_portability/Include/predictor.h b/src/nws_portability/Include/predictor.h
deleted file mode 100644 (file)
index bdd4b3c..0000000
+++ /dev/null
@@ -1,128 +0,0 @@
-/* $Id$ */
-
-#include <sys/types.h>  /* time_t */
-
-/* linux defines this in /usr/include/values.h as 1.79769313486231570e+308 */
-#ifndef MAXDOUBLE
-#define MAXDOUBLE (999999999999.0)
-#endif
-/* #define HISTORYSIZE 200*/
-/* reduce memory footprint */
-#define HISTORYSIZE 100
-#define MAX_MED_N HISTORYSIZE
-#define MIN_DATA_HISTORY 10
-
-#define PREDS 14
-#define STATIC_PREDS (PREDS - 6)
-#define SECOND_ORDER_PREDS (PREDS - 2)
-#define MSE_PRED (STATIC_PREDS)
-#define MAE_PRED (STATIC_PREDS+1)
-#define WIN_MSE_PRED (STATIC_PREDS+2)
-#define WIN_MAE_PRED (STATIC_PREDS+3)
-#define TOT_MSE_PRED (SECOND_ORDER_PREDS)
-#define TOT_MAE_PRED (SECOND_ORDER_PREDS+1)
-
-#define DYNPRED TOT_MSE_PRED
-
-#define LIFETIMES 120
-
-#define MED_N 21
-#define MED_ALPHA (0.1)
-
-#define ERR_WIN 10
-
-#define STATES 2
-#define DIM 2
-#define HMAX 10.0
-#define HMIN 0.0
-
-/*
- * for adaptive window predictors
- */
-#define WIN_MIN 5
-#define WIN_MAX 50
-#define WIN_INIT 25
-
-/*
- * for AR predictor
- */
-#define AR_N 50
-#define AR_P 20
-
-struct pred_el
-{
-       float pred;
-       double error;
-       double sq_error;
-       int medwin;
-       int meanwin;
-};
-
-struct value_el
-{
-       time_t time;
-       float value;
-       struct pred_el preds[PREDS];
-};
-
-struct thruput_pred
-{
-       int head;
-       int tail;
-       struct value_el data[HISTORYSIZE];
-
-       double mean;
-       double run_mean;
-       double total;
-
-       double mses[PREDS];
-       double mpes[PREDS];
-       double counts[PREDS];
-       int pred_nums[PREDS-STATIC_PREDS];
-};
-
-#define MODPLUS(a,b,m) (((a) + (b)) % (m))
-#define MODMINUS(a,b,m) (((a) - (b) + (m)) % (m))
-
-#define PRED(n,v) ((v).preds[(n)].pred)
-#define ERR(n,v) ((v).preds[(n)].error)
-#define SQERR(n,v) ((v).preds[(n)].sq_error)
-#define MedWIN(n,v) ((v).preds[(n)].medwin)
-#define MeanWIN(n,v) ((v).preds[(n)].meanwin)
-
-#define TPPREDNUM(tp,n) ((tp)->pred_nums[(n)-STATIC_PREDS])
-#define TPMSE(tp,n) ((tp)->mses[(n)])
-#define TPMAE(tp,n) ((tp)->mpes[(n)])
-#define TPCOUNT(tp,n) ((tp)->counts[(n)])
-
-#define CURRVAL(tp) ((tp).data[MODMINUS((tp).head,1,HISTORYSIZE)].value)
-#define CURRTIME(tp) ((tp).data[MODMINUS((tp).head,1,HISTORYSIZE)].time)
-#define CURRPRED(tp) \
-       PRED(TOT_MSE_PRED,(tp).data[MODMINUS((tp).head,1,HISTORYSIZE)])
-#define CURRMSEPRED(tp) \
-       PRED(TOT_MSE_PRED,(tp).data[MODMINUS((tp).head,1,HISTORYSIZE)])
-#define CURRMAEPRED(tp) \
-       PRED(TOT_MAE_PRED,(tp).data[MODMINUS((tp).head,1,HISTORYSIZE)])
-#define CURRMSE(tp) \
-        (TPCOUNT(&(tp),TOT_MSE_PRED) != 0.0 ?\
-       (TPMSE(&(tp),TOT_MSE_PRED)/TPCOUNT(&(tp),TOT_MSE_PRED)) : 0.0)
-#define CURRMAE(tp) \
-        (TPCOUNT(&(tp),TOT_MAE_PRED) != 0.0 ?\
-       (TPMAE(&(tp),TOT_MAE_PRED)/TPCOUNT(&(tp),TOT_MAE_PRED)) : 0.0)
-#define CURRMSEPREDNUM(tp) TPPREDNUM(&(tp),TOT_MSE_PRED)
-#define CURRMAEPREDNUM(tp) TPPREDNUM(&(tp),TOT_MAE_PRED)
-
-
-void
-InitThruputPrediction(struct thruput_pred *tp);
-
-
-void
-UpdateThruputPrediction(struct thruput_pred *tp,
-                        float value,
-                        time_t update_time);
-
-#define GAIN (0.05)
-#define LN_GAIN (0.9)
-
-#define EL(a,i,j,n) ((a)[(i)*(n)+(j)])
diff --git a/src/nws_portability/Include/protocol.h b/src/nws_portability/Include/protocol.h
deleted file mode 100644 (file)
index 3aa1d69..0000000
+++ /dev/null
@@ -1,210 +0,0 @@
-/* $Id$ */
-
-
-#ifndef PROTOCOL_H
-#define PROTOCOL_H
-
-
-/*
- * This module defines functions useful in establishing and maintaining
- * connections to other processes on local or remote hosts.  The name is an
- * anachronism.
- */
-
-
-#include <sys/types.h>    /* pid_t */
-#include "dnsutil.h"      /* IPAddress */
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/* A definition for socket call-back functions (see NotifyOnDisconnection()). */
-typedef void (*SocketFunction)(Socket);
-
-
-/*
- * Attempts to establish a connection to the server listening to #addr#:#port#.
- * If successful within #timeOut# seconds, returns 1 and sets #sock# to the
- * socket bound to the connection, else returns 0. A #timeOut# of 0 will
- * disable timeouts while a negative value will use adaptive timeouts.
- */
-int
-CallAddr(IPAddress addr, 
-         short port, 
-         Socket *sock,
-         double timeOut);
-
-
-/*
- * Closes connections opened via calls to this module's functions.  Each
- * parameter is a boolean value indicated whether that type of connection
- * should be included in those closed.
- */
-void
-CloseConnections(int closeEars,
-                 int closePipes,
-                 int closeSockets);
-#define CloseAllConnections() CloseConnections(1, 1, 1)
-
-
-/*
- * Tests all connections opened via calls to this module's functions and
- * closes any that are no longer connected.  Returns the number of connections
- * closed.
- */
-int
-CloseDisconnections(void);
-
-
-/**
- * Tears down #sock#.  If #waitForPeer# is non-zero, the function waits this
- * many seconds for the host on the other end to close the connection and fails
- * if no such close is detected.  If this parameter is zero, the function
- * closes #sock# immediately.  Returns 1 and sets #sock# to NO_SOCKET if
- * successful, else returns 0.
- */
-int
-CloseSocket(Socket *sock,
-            int waitForPeer);
-#define DROP_SOCKET(sock) CloseSocket(sock, 0)
-
-
-/**
- * Removed all records of #sock# from our FD_SETs
- */
-void
-ClearSocket(Socket sock);
-
-/*
-** Spawns a new process, a duplicate of the running one.  Returns 1 if
-** successful, 0 otherwise.  Returns in #pid# a 0 to the child process and the
-** process id of the child to the parent.  Both processes are given a pair of
-** connections in the Socket parameters that can be used to communicate between
-** the parent and child.  The parent process should send information to the
-** child via #parentToChild# and receive information via #childToParent#; the
-** child reads from the former and writes to the latter.  The parameters may be
-** NULL indicating that communication is unidirectional (one parameter NULL),
-** or that no communication will take place (both NULL).
-*/
-int
-CreateLocalChild(pid_t *pid,
-                 Socket *parentToChild,
-                 Socket *childToParent);
-
-
-/*
-** Attempts to bind to any port between #startingPort# and #endingPort#,
-** inclusive.  If successful, returns 1 and sets #ear# to the bound socket and
-** #earPort# to the port to which it is bound, else returns 0.
-*/
-int
-EstablishAnEar(unsigned short startingPort,
-               unsigned short endingPort,
-               Socket *ear,
-               unsigned short *earPort);
-
-
-/**
- * Checks all connections established via calls to this module for
- * incoming messages.  If one is detected within #timeOut# seconds,
- * returns 1, sets #sd# to the socket containing the message, and sets
- * #ldap# to the type of message (0 if NWS, 1 if LDAP).  If no message
- * detected, returns 0. 
- * 
- * NOTE: you have to use SocketIsAvailable to notify IncomingRequest that
- * the socket is again available (once the socket is been returned from
- * IncomingRequest) */
-int 
-IncomingRequest(double timeOut,
-                Socket *sd,
-                int *ldap);
-
-
-/**
- * When a socket is returned by IncomingRequest, that socket won't be
- * listen till this function is called.
- * Return 0 upon failure.
- */
-int
-SocketIsAvailable(Socket sd);
-
-/**
- * Tell NWS that a specific socket is still in use and IncomingRequest
- * shouldn't listen to it.
- */
-int
-SocketInUse(Socket sd);
-
-/*
-** Returns 1 or 0 depending on whether or not #sd# is connected to another
-** process.
-*/
-int
-IsOkay(Socket sd);
-
-/**
- * returns 1 or 0 depending on wheter the socket is a pipe or not 
- */
-int
-IsPipe(Socket sd);
-
-
-/*
-** Registers a function that should be called whenever a socket is disconnected,
-** either directly via a call to CloseSocket(), or indirectly because the peer
-** termintes the connection.  The function is passed the closed socket after it
-** has been closed.
-*/
-void
-NotifyOnDisconnection(SocketFunction notifyFn);
-
-
-/*
-** Pass socket #sock# along to child #child# -- call after a successful call
-** to CreateLocalChild().  The parent process will no longer listen for
-** activity on #sock#.  Closing the socket will be put off until after the
-** child dies, just in case the parent and child share descriptors.
-*/
-int
-PassSocket(Socket *sock,
-           pid_t child);
-
-
-/**
- * Receives #byteSize# bytes from connection #sd# and stores them in the
- * memory referenced by #bytes#.  The caller must assure that #bytes# is at
- * least #byteSize# bytes long.  Returns 1 if successful within #timeOut#
- * seconds, else 0.  If #timeOut# is zero, timeout are disabled alltogether.
- */
-int
-RecvBytes(Socket sd,
-          void *byte,
-          size_t byteSize,
-          double timeOut);
-
-/*
- * Sends #bytesSize# bytes from the memory pointed to by #bytes# on connection
- * #sd#.  Returns 1 if successful within #timeOut# seconds, else 0.
- * If #timeOut# is zero, timeout are disabled alltogether..
- */
-int
-SendBytes(Socket sd,
-          const void *bytes,
-          size_t byteSize,
-          double timeOut);
-
-
-/*
-** A signal handler for dealing with signals (specifically SIGPIPE) that
-** indicate a bad socket.
-*/
-void
-SocketFailure(int sig);
-
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif
diff --git a/src/nws_portability/Include/run_mean.h b/src/nws_portability/Include/run_mean.h
deleted file mode 100644 (file)
index 7fc9e1d..0000000
+++ /dev/null
@@ -1,13 +0,0 @@
-/* $Id$ */
-
-#if !defined(RUN_MEAN_H)
-#define RUN_MEAN_H
-
-#include "fbuff.h"
-
-char *InitRunMean(fbuff series, fbuff time_stamps, char *params);
-void FreeRunMean(char *state);
-void UpdateRunMean(char *state, double ts, double value); 
-int ForcRunMean(char *state, double *v);
-#endif
-
diff --git a/src/nws_portability/Include/strutil.h b/src/nws_portability/Include/strutil.h
deleted file mode 100644 (file)
index 06a7e55..0000000
+++ /dev/null
@@ -1,94 +0,0 @@
-/* $Id$ */
-
-
-#ifndef STRUTIL_H
-#define STRUTIL_H
-
-
-/*
-** This module defines some useful routines for maniputing strings.
-*/
-
-#include <string.h>     /* strlen() strncpy() */
-#include <sys/types.h>  /* size_t */
-
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-
-/*
-** Replaces the characters in #string# with their lower- or upper-case
-** equivalents.  #toWhatCase# specifies whether the result to be ENTIRELY
-** UPPER, entirely lower, iNITIAL lOWER, or Initial Upper.
-*/
-typedef enum {ALL_LOWER, ALL_UPPER, INITIAL_LOWER, INITIAL_UPPER} CaseTypes;
-void
-strcase(char *string,
-        CaseTypes toWhatCase);
-
-
-/*
-** Returns 1 or 0 depending on whether or not the first #len# characters of
-** #string# matches #pattern#, which may contain wildcard characters (*).
-*/
-int
-strnmatch(const char *string,
-          const char *pattern,
-          size_t len);
-#define strmatch(string,pattern) strnmatch(string, pattern, strlen(string))
-
-
-/*
-** Copies a "token" -- a series of characters deliminated by one of the chars
-** in #delim# -- from #source# to the #len#-long string #dest#.  Terminates
-** #dest# with a null character.  Returns the position within #source# of the
-** character after the token in #end#.  Skips any leading delimiters in
-** #source#.  Returns 0 if the end of source is reached without finding any
-** non-delimiter characters, 1 otherwise.
-*/
-int
-strntok(char *dest,
-        const char *source,
-        int len,
-        const char *delim,
-        const char **end);
-#define GETTOK(dest,source,delim,end) strntok(dest,source,sizeof(dest),delim,end)
-#define GETWORD(dest,source,end) GETTOK(dest,source," \t\n",end)
-
-
-/*
- * Define strnlen in case there is no such a function in the library
- * (sometimes there is not the definition in the include so we define it
- * anyway).
- */
-size_t
-strnlen(const char *s, size_t maxlen);
-
-/*
-** Calls strncpy() passing #dest#, #src#, and #len#, then places a terminating
-** character in the last (len - 1) byte of #dest#.
-*/
-#define zstrncpy(dest,src,len) \
-  do {strncpy(dest, src, len); dest[len - 1] = '\0'; if (1) break;} while (0)
-#define SAFESTRCPY(dest,src) zstrncpy(dest, src, sizeof(dest))
-
-
-/*
-** Catenates the #count#-long set of source strings into #dest#.  Copies at
-** most #len# characters, including the null terminator.
-*/
-int
-vstrncpy(char *dest,
-         size_t len,
-         int count,
-         ...);
-
-
-#ifdef __cplusplus
-}
-#endif
-
-
-#endif
diff --git a/src/nws_portability/Include/timeouts.h b/src/nws_portability/Include/timeouts.h
deleted file mode 100644 (file)
index 3783647..0000000
+++ /dev/null
@@ -1,59 +0,0 @@
-/* $Id$ */
-
-#ifndef TIMEOUTS_H
-#define TIMEOUTS_H
-
-/*
- * This modules defines functions used to keep track of adaptive
- * timeouts. You can use these functions to (for example) keep track of
- * how long you should wait to receive a packet from a remote host.
- */
-
-#include "dnsutil.h"
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/**
- * We reserve timeouts for receive and send packets, connection time and
- * we leave space for 3 user definable timeouts.
- */
-typedef enum {RECV, SEND, CONN, USER1, USER2, USER3} timeoutTypes;
-#define TIMEOUT_TYPES_NUMBER 6
-
-/**
- * Sets the bounds on a specific class of timeouts. 
- */
-void
-SetDefaultTimeout(timeoutTypes type, double min, double max);
-
-/**
- * get the current defaults timeouts
- */
-void
-GetDefaultTimeout(timeoutTypes type, double *min, double *max);
-
-
-/**
- * Returns the current timeouts value for the specific class given the
- * IPAddress and the #size# of the data to be sent/received. If #size# is
- * <= 0 it will be ignored.
- */
-double
-GetTimeOut(timeoutTypes type, IPAddress addr, long size);
-
-/**
- * Reports how long it took to perform the action (say send or receive a
- * packet) last time and if it timed out and how many bytes were
- * sent/received (if applicable).
- */
-void
-SetTimeOut(timeoutTypes type, IPAddress addr, double duration, long size,  int timedOut);
-
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* TIMEOUTS_H */
diff --git a/src/nws_portability/Makedefs.in b/src/nws_portability/Makedefs.in
deleted file mode 100644 (file)
index cef5f61..0000000
+++ /dev/null
@@ -1,45 +0,0 @@
-#
-# autoconf variables for the Portability library
-#
-# $Id$
-
-# System we configured for 
-configured     = @host@
-
-# Distribution variables
-TOP            = @TOP@/../../
-DIST_NAME      = portability.tar
-DIST_ROOT      = $(TOP)/gras-0.0.040205/src/nws_portability
-
-# System-dependent values determined by the configuration script.
-AR             = @AR@
-ARFLAGS                = @ARFLAGS@
-CC             = @CC@
-CFLAGS         = @CFLAGS@
-INCLUDES       = @INCLUDES@
-LDFLAGS                = @LDFLAGS@
-PROFILE                = @PROFILE@
-RANLIB         = @RANLIB@
-INSTALL                = @TOP@/install-sh -c
-RM             = @RM@
-CP             = @CP@
-TAR            = @TAR@
-CTAGS          = @CTAGS@
-#VERSION               = @VERSION@
-
-# where we put the objects, libraries, binaries (for the build process) etc ...
-builddir       = @NWS_TOP@/build-${configured}
-buildbindir    = $(builddir)/bin
-buildlibdir    = $(builddir)/lib
-buildincdir    = $(builddir)/include
-buildobjdir    = $(builddir)/obj
-# ... and for the install process 
-prefix         = @prefix@
-exec_prefix    = @exec_prefix@
-bindir         = @bindir@
-libdir         = @libdir@
-incdir         = @includedir@
-mandir         = @mandir@
-
-# which directories we are going to compile
-SUBDIRS                = Include Forecast
diff --git a/src/nws_portability/Makefile b/src/nws_portability/Makefile
deleted file mode 100755 (executable)
index 8153d85..0000000
+++ /dev/null
@@ -1,92 +0,0 @@
-#
-# Makefile for the Portability library
-#
-# $Id$
-
-include Makedefs
-
-# extra files to be put into the distribution
-DIST_FILES     =       Makedefs.in \
-                       Makefile \
-                       config.guess \
-                       config.sub \
-                       install-sh \
-                       configure 
-
-# these are the targets
-LIBRARY =      $(buildlibdir)/libNwsPortability.a
-
-# what we are going to put in the library
-OBJS =                 $(buildobjdir)/diagnostic.o \
-               $(buildobjdir)/dnsutil.o \
-               $(buildobjdir)/formatutil.o \
-               $(buildobjdir)/osutil.o \
-               $(buildobjdir)/messages.o \
-               $(buildobjdir)/strutil.o \
-               $(buildobjdir)/timeouts.o \
-               $(buildobjdir)/protocol.o
-
-
-.PHONY: clean confclean distclean precondition dist all common
-
-all: precondition common $(OBJS)
-       $(AR) $(ARFLAGS) $(LIBRARY) $(OBJS)
-       $(RANLIB) $(LIBRARY)
-
-common: 
-       @for subdir in $(SUBDIRS); do \
-               (cd $$subdir && $(MAKE) all) || exit $$? ; done
-
-clean:
-       @for subdir in $(SUBDIRS); do \
-               (cd $$subdir && $(MAKE) clean) || exit $$? ; done
-       @$(RM) -f $(OBJS)
-
-confclean:
-       @echo "Removing configurations files ..."
-       @$(RM) -f Makedefs Include/config_portability.h config.status config.log config.cache
-       
-distclean: confclean
-       @echo "Removing build directories ..."
-       @$(RM) -rf $(builddir) $(DIST_NAME)
-
-distdir:
-       $(INSTALL) -d $(DIST_ROOT)
-       for subdir in $(SUBDIRS); do \
-               (cd $$subdir && $(MAKE) dist) || exit $$? ; done
-       $(CP)  $(DIST_FILES) $(DIST_ROOT)
-       $(CP) *.c $(DIST_ROOT)
-
-.PHONY: install
-install: all 
-       @$(INSTALL) -d $(prefix)
-       @$(INSTALL) -d $(exec_prefix)
-       @$(INSTALL) -d $(bindir)
-       @$(INSTALL) -d $(libdir)
-       @$(INSTALL) -d $(incdir)
-       @$(CP) $(buildbindir)/* $(bindir)
-       @$(CP) $(buildlibdir)/* $(libdir)
-       @$(CP) $(buildincdir)/* $(incdir)
-
-tags:
-       $(CTAGS) -R 
-
-precondition: 
-       @if test `./config.guess` != "$(configured)"; then \
-               echo "Portability was configured for $(configured): run make confclean and reconfigure for the `./config.guess`!";\
-               exit 1; fi
-       @$(INSTALL) -d $(buildobjdir)
-       @$(INSTALL) -d $(buildlibdir)
-       @$(INSTALL) -d $(buildincdir)
-       @$(INSTALL) -d $(buildbindir)
-
-Makedefs: Makedefs.in config.status
-       ./config.status
-
-config.status: configure
-       ./configure
-
-$(buildobjdir)/%.o : %.c Include/%.h Include/config_portability.h
-       $(CC) $(INCLUDES) $(CFLAGS) -g -c $< -o $@
-       
-
diff --git a/src/nws_portability/README b/src/nws_portability/README
deleted file mode 100755 (executable)
index 7aac2ff..0000000
+++ /dev/null
@@ -1,40 +0,0 @@
-$Id$
-
-Portability
------------
-
-Portability is a library used by the Network Weather System (NWS). It
-aims to be portable and to mask sockets, threads and other low level,
-system dependent calls. It can be used independetly from the NWS, but
-documentation is quite scarse: the header files will be your best
-friends. 
-
-Compiling and installing
-------------------------
-
-To compile Portability run
-       ./configure 
-       make all
-and you will find a library libNwsPortability.a and the needed file in
-the ./build-<your-architecture>/{lib,include}. You can install them with
-       make install
-
-You can configure where to install library and includes using --prefix
-etc ... (./configure --help for the options).
-
-You can configure Portability to be used with threads (--enable-threads)
-and to disable sigalarm (--disable-sigalarm).
-
-
-
-Adaptive Timeouts
------------------
-
-Some of Portability's functions take a timeout as argument. Portability
-provides a way to use adaptive timeouts: look at timeouts.h for the
-interface. In short you can use GetTimeOut to get a timeout estimate that
-is more accurate the more information you give Portability through
-SetTimeOut. If you call the Send{MessageAnd}Data with a timeout of -1
-you'll get the adaptive timeouts without having to tinker with Get/Set
-TimeOut.
-
diff --git a/src/nws_portability/config.guess b/src/nws_portability/config.guess
deleted file mode 100755 (executable)
index ed2e03b..0000000
+++ /dev/null
@@ -1,1321 +0,0 @@
-#! /bin/sh
-# Attempt to guess a canonical system name.
-#   Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
-#   2000, 2001, 2002 Free Software Foundation, Inc.
-
-timestamp='2002-03-20'
-
-# This file 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 of the License, or
-# (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful, but
-# WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-# General Public License for more details.
-#
-# 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.
-#
-# As a special exception to the GNU General Public License, if you
-# distribute this file as part of a program that contains a
-# configuration script generated by Autoconf, you may include it under
-# the same distribution terms that you use for the rest of that program.
-
-# Originally written by Per Bothner <per@bothner.com>.
-# Please send patches to <config-patches@gnu.org>.  Submit a context
-# diff and a properly formatted ChangeLog entry.
-#
-# This script attempts to guess a canonical system name similar to
-# config.sub.  If it succeeds, it prints the system name on stdout, and
-# exits with 0.  Otherwise, it exits with 1.
-#
-# The plan is that this can be called by configure scripts if you
-# don't specify an explicit build system type.
-
-me=`echo "$0" | sed -e 's,.*/,,'`
-
-usage="\
-Usage: $0 [OPTION]
-
-Output the configuration name of the system \`$me' is run on.
-
-Operation modes:
-  -h, --help         print this help, then exit
-  -t, --time-stamp   print date of last modification, then exit
-  -v, --version      print version number, then exit
-
-Report bugs and patches to <config-patches@gnu.org>."
-
-version="\
-GNU config.guess ($timestamp)
-
-Originally written by Per Bothner.
-Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001
-Free Software Foundation, Inc.
-
-This is free software; see the source for copying conditions.  There is NO
-warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
-
-help="
-Try \`$me --help' for more information."
-
-# Parse command line
-while test $# -gt 0 ; do
-  case $1 in
-    --time-stamp | --time* | -t )
-       echo "$timestamp" ; exit 0 ;;
-    --version | -v )
-       echo "$version" ; exit 0 ;;
-    --help | --h* | -h )
-       echo "$usage"; exit 0 ;;
-    -- )     # Stop option processing
-       shift; break ;;
-    - )        # Use stdin as input.
-       break ;;
-    -* )
-       echo "$me: invalid option $1$help" >&2
-       exit 1 ;;
-    * )
-       break ;;
-  esac
-done
-
-if test $# != 0; then
-  echo "$me: too many arguments$help" >&2
-  exit 1
-fi
-
-
-dummy=dummy-$$
-trap 'rm -f $dummy.c $dummy.o $dummy.rel $dummy; exit 1' 1 2 15
-
-# CC_FOR_BUILD -- compiler used by this script.
-# Historically, `CC_FOR_BUILD' used to be named `HOST_CC'. We still
-# use `HOST_CC' if defined, but it is deprecated.
-
-set_cc_for_build='case $CC_FOR_BUILD,$HOST_CC,$CC in
- ,,)    echo "int dummy(){}" > $dummy.c ;
-       for c in cc gcc c89 c99 ; do
-         ($c $dummy.c -c -o $dummy.o) >/dev/null 2>&1 ;
-         if test $? = 0 ; then
-            CC_FOR_BUILD="$c"; break ;
-         fi ;
-       done ;
-       rm -f $dummy.c $dummy.o $dummy.rel ;
-       if test x"$CC_FOR_BUILD" = x ; then
-         CC_FOR_BUILD=no_compiler_found ;
-       fi
-       ;;
- ,,*)   CC_FOR_BUILD=$CC ;;
- ,*,*)  CC_FOR_BUILD=$HOST_CC ;;
-esac'
-
-# This is needed to find uname on a Pyramid OSx when run in the BSD universe.
-# (ghazi@noc.rutgers.edu 1994-08-24)
-if (test -f /.attbin/uname) >/dev/null 2>&1 ; then
-       PATH=$PATH:/.attbin ; export PATH
-fi
-
-UNAME_MACHINE=`(uname -m) 2>/dev/null` || UNAME_MACHINE=unknown
-UNAME_RELEASE=`(uname -r) 2>/dev/null` || UNAME_RELEASE=unknown
-UNAME_SYSTEM=`(uname -s) 2>/dev/null`  || UNAME_SYSTEM=unknown
-UNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown
-
-# Note: order is significant - the case branches are not exclusive.
-
-case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
-    *:NetBSD:*:*)
-       # NetBSD (nbsd) targets should (where applicable) match one or
-       # more of the tupples: *-*-netbsdelf*, *-*-netbsdaout*,
-       # *-*-netbsdecoff* and *-*-netbsd*.  For targets that recently
-       # switched to ELF, *-*-netbsd* would select the old
-       # object file format.  This provides both forward
-       # compatibility and a consistent mechanism for selecting the
-       # object file format.
-       #
-       # Note: NetBSD doesn't particularly care about the vendor
-       # portion of the name.  We always set it to "unknown".
-       sysctl="sysctl -n hw.machine_arch"
-       UNAME_MACHINE_ARCH=`(/sbin/$sysctl 2>/dev/null || \
-           /usr/sbin/$sysctl 2>/dev/null || echo unknown)`
-       case "${UNAME_MACHINE_ARCH}" in
-           arm*) machine=arm-unknown ;;
-           sh3el) machine=shl-unknown ;;
-           sh3eb) machine=sh-unknown ;;
-           *) machine=${UNAME_MACHINE_ARCH}-unknown ;;
-       esac
-       # The Operating System including object format, if it has switched
-       # to ELF recently, or will in the future.
-       case "${UNAME_MACHINE_ARCH}" in
-           arm*|i386|m68k|ns32k|sh3*|sparc|vax)
-               eval $set_cc_for_build
-               if echo __ELF__ | $CC_FOR_BUILD -E - 2>/dev/null \
-                       | grep __ELF__ >/dev/null
-               then
-                   # Once all utilities can be ECOFF (netbsdecoff) or a.out (netbsdaout).
-                   # Return netbsd for either.  FIX?
-                   os=netbsd
-               else
-                   os=netbsdelf
-               fi
-               ;;
-           *)
-               os=netbsd
-               ;;
-       esac
-       # The OS release
-       release=`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'`
-       # Since CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM:
-       # contains redundant information, the shorter form:
-       # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used.
-       echo "${machine}-${os}${release}"
-       exit 0 ;;
-    amiga:OpenBSD:*:*)
-       echo m68k-unknown-openbsd${UNAME_RELEASE}
-       exit 0 ;;
-    arc:OpenBSD:*:*)
-       echo mipsel-unknown-openbsd${UNAME_RELEASE}
-       exit 0 ;;
-    hp300:OpenBSD:*:*)
-       echo m68k-unknown-openbsd${UNAME_RELEASE}
-       exit 0 ;;
-    mac68k:OpenBSD:*:*)
-       echo m68k-unknown-openbsd${UNAME_RELEASE}
-       exit 0 ;;
-    macppc:OpenBSD:*:*)
-       echo powerpc-unknown-openbsd${UNAME_RELEASE}
-       exit 0 ;;
-    mvme68k:OpenBSD:*:*)
-       echo m68k-unknown-openbsd${UNAME_RELEASE}
-       exit 0 ;;
-    mvme88k:OpenBSD:*:*)
-       echo m88k-unknown-openbsd${UNAME_RELEASE}
-       exit 0 ;;
-    mvmeppc:OpenBSD:*:*)
-       echo powerpc-unknown-openbsd${UNAME_RELEASE}
-       exit 0 ;;
-    pmax:OpenBSD:*:*)
-       echo mipsel-unknown-openbsd${UNAME_RELEASE}
-       exit 0 ;;
-    sgi:OpenBSD:*:*)
-       echo mipseb-unknown-openbsd${UNAME_RELEASE}
-       exit 0 ;;
-    sun3:OpenBSD:*:*)
-       echo m68k-unknown-openbsd${UNAME_RELEASE}
-       exit 0 ;;
-    wgrisc:OpenBSD:*:*)
-       echo mipsel-unknown-openbsd${UNAME_RELEASE}
-       exit 0 ;;
-    *:OpenBSD:*:*)
-       echo ${UNAME_MACHINE}-unknown-openbsd${UNAME_RELEASE}
-       exit 0 ;;
-    alpha:OSF1:*:*)
-       if test $UNAME_RELEASE = "V4.0"; then
-               UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $3}'`
-       fi
-       # A Vn.n version is a released version.
-       # A Tn.n version is a released field test version.
-       # A Xn.n version is an unreleased experimental baselevel.
-       # 1.2 uses "1.2" for uname -r.
-       cat <<EOF >$dummy.s
-       .data
-\$Lformat:
-       .byte 37,100,45,37,120,10,0     # "%d-%x\n"
-
-       .text
-       .globl main
-       .align 4
-       .ent main
-main:
-       .frame \$30,16,\$26,0
-       ldgp \$29,0(\$27)
-       .prologue 1
-       .long 0x47e03d80 # implver \$0
-       lda \$2,-1
-       .long 0x47e20c21 # amask \$2,\$1
-       lda \$16,\$Lformat
-       mov \$0,\$17
-       not \$1,\$18
-       jsr \$26,printf
-       ldgp \$29,0(\$26)
-       mov 0,\$16
-       jsr \$26,exit
-       .end main
-EOF
-       eval $set_cc_for_build
-       $CC_FOR_BUILD $dummy.s -o $dummy 2>/dev/null
-       if test "$?" = 0 ; then
-               case `./$dummy` in
-                       0-0)
-                               UNAME_MACHINE="alpha"
-                               ;;
-                       1-0)
-                               UNAME_MACHINE="alphaev5"
-                               ;;
-                       1-1)
-                               UNAME_MACHINE="alphaev56"
-                               ;;
-                       1-101)
-                               UNAME_MACHINE="alphapca56"
-                               ;;
-                       2-303)
-                               UNAME_MACHINE="alphaev6"
-                               ;;
-                       2-307)
-                               UNAME_MACHINE="alphaev67"
-                               ;;
-                       2-1307)
-                               UNAME_MACHINE="alphaev68"
-                               ;;
-               esac
-       fi
-       rm -f $dummy.s $dummy
-       echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[VTX]//' | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'`
-       exit 0 ;;
-    Alpha\ *:Windows_NT*:*)
-       # How do we know it's Interix rather than the generic POSIX subsystem?
-       # Should we change UNAME_MACHINE based on the output of uname instead
-       # of the specific Alpha model?
-       echo alpha-pc-interix
-       exit 0 ;;
-    21064:Windows_NT:50:3)
-       echo alpha-dec-winnt3.5
-       exit 0 ;;
-    Amiga*:UNIX_System_V:4.0:*)
-       echo m68k-unknown-sysv4
-       exit 0;;
-    *:[Aa]miga[Oo][Ss]:*:*)
-       echo ${UNAME_MACHINE}-unknown-amigaos
-       exit 0 ;;
-    *:[Mm]orph[Oo][Ss]:*:*)
-       echo ${UNAME_MACHINE}-unknown-morphos
-       exit 0 ;;
-    *:OS/390:*:*)
-       echo i370-ibm-openedition
-       exit 0 ;;
-    arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*)
-       echo arm-acorn-riscix${UNAME_RELEASE}
-       exit 0;;
-    SR2?01:HI-UX/MPP:*:* | SR8000:HI-UX/MPP:*:*)
-       echo hppa1.1-hitachi-hiuxmpp
-       exit 0;;
-    Pyramid*:OSx*:*:* | MIS*:OSx*:*:* | MIS*:SMP_DC-OSx*:*:*)
-       # akee@wpdis03.wpafb.af.mil (Earle F. Ake) contributed MIS and NILE.
-       if test "`(/bin/universe) 2>/dev/null`" = att ; then
-               echo pyramid-pyramid-sysv3
-       else
-               echo pyramid-pyramid-bsd
-       fi
-       exit 0 ;;
-    NILE*:*:*:dcosx)
-       echo pyramid-pyramid-svr4
-       exit 0 ;;
-    sun4H:SunOS:5.*:*)
-       echo sparc-hal-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
-       exit 0 ;;
-    sun4*:SunOS:5.*:* | tadpole*:SunOS:5.*:*)
-       echo sparc-sun-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
-       exit 0 ;;
-    i86pc:SunOS:5.*:*)
-       echo i386-pc-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
-       exit 0 ;;
-    sun4*:SunOS:6*:*)
-       # According to config.sub, this is the proper way to canonicalize
-       # SunOS6.  Hard to guess exactly what SunOS6 will be like, but
-       # it's likely to be more like Solaris than SunOS4.
-       echo sparc-sun-solaris3`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
-       exit 0 ;;
-    sun4*:SunOS:*:*)
-       case "`/usr/bin/arch -k`" in
-           Series*|S4*)
-               UNAME_RELEASE=`uname -v`
-               ;;
-       esac
-       # Japanese Language versions have a version number like `4.1.3-JL'.
-       echo sparc-sun-sunos`echo ${UNAME_RELEASE}|sed -e 's/-/_/'`
-       exit 0 ;;
-    sun3*:SunOS:*:*)
-       echo m68k-sun-sunos${UNAME_RELEASE}
-       exit 0 ;;
-    sun*:*:4.2BSD:*)
-       UNAME_RELEASE=`(sed 1q /etc/motd | awk '{print substr($5,1,3)}') 2>/dev/null`
-       test "x${UNAME_RELEASE}" = "x" && UNAME_RELEASE=3
-       case "`/bin/arch`" in
-           sun3)
-               echo m68k-sun-sunos${UNAME_RELEASE}
-               ;;
-           sun4)
-               echo sparc-sun-sunos${UNAME_RELEASE}
-               ;;
-       esac
-       exit 0 ;;
-    aushp:SunOS:*:*)
-       echo sparc-auspex-sunos${UNAME_RELEASE}
-       exit 0 ;;
-    # The situation for MiNT is a little confusing.  The machine name
-    # can be virtually everything (everything which is not
-    # "atarist" or "atariste" at least should have a processor
-    # > m68000).  The system name ranges from "MiNT" over "FreeMiNT"
-    # to the lowercase version "mint" (or "freemint").  Finally
-    # the system name "TOS" denotes a system which is actually not
-    # MiNT.  But MiNT is downward compatible to TOS, so this should
-    # be no problem.
-    atarist[e]:*MiNT:*:* | atarist[e]:*mint:*:* | atarist[e]:*TOS:*:*)
-        echo m68k-atari-mint${UNAME_RELEASE}
-       exit 0 ;;
-    atari*:*MiNT:*:* | atari*:*mint:*:* | atarist[e]:*TOS:*:*)
-       echo m68k-atari-mint${UNAME_RELEASE}
-        exit 0 ;;
-    *falcon*:*MiNT:*:* | *falcon*:*mint:*:* | *falcon*:*TOS:*:*)
-        echo m68k-atari-mint${UNAME_RELEASE}
-       exit 0 ;;
-    milan*:*MiNT:*:* | milan*:*mint:*:* | *milan*:*TOS:*:*)
-        echo m68k-milan-mint${UNAME_RELEASE}
-        exit 0 ;;
-    hades*:*MiNT:*:* | hades*:*mint:*:* | *hades*:*TOS:*:*)
-        echo m68k-hades-mint${UNAME_RELEASE}
-        exit 0 ;;
-    *:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*)
-        echo m68k-unknown-mint${UNAME_RELEASE}
-        exit 0 ;;
-    powerpc:machten:*:*)
-       echo powerpc-apple-machten${UNAME_RELEASE}
-       exit 0 ;;
-    RISC*:Mach:*:*)
-       echo mips-dec-mach_bsd4.3
-       exit 0 ;;
-    RISC*:ULTRIX:*:*)
-       echo mips-dec-ultrix${UNAME_RELEASE}
-       exit 0 ;;
-    VAX*:ULTRIX*:*:*)
-       echo vax-dec-ultrix${UNAME_RELEASE}
-       exit 0 ;;
-    2020:CLIX:*:* | 2430:CLIX:*:*)
-       echo clipper-intergraph-clix${UNAME_RELEASE}
-       exit 0 ;;
-    mips:*:*:UMIPS | mips:*:*:RISCos)
-       eval $set_cc_for_build
-       sed 's/^        //' << EOF >$dummy.c
-#ifdef __cplusplus
-#include <stdio.h>  /* for printf() prototype */
-       int main (int argc, char *argv[]) {
-#else
-       int main (argc, argv) int argc; char *argv[]; {
-#endif
-       #if defined (host_mips) && defined (MIPSEB)
-       #if defined (SYSTYPE_SYSV)
-         printf ("mips-mips-riscos%ssysv\n", argv[1]); exit (0);
-       #endif
-       #if defined (SYSTYPE_SVR4)
-         printf ("mips-mips-riscos%ssvr4\n", argv[1]); exit (0);
-       #endif
-       #if defined (SYSTYPE_BSD43) || defined(SYSTYPE_BSD)
-         printf ("mips-mips-riscos%sbsd\n", argv[1]); exit (0);
-       #endif
-       #endif
-         exit (-1);
-       }
-EOF
-       $CC_FOR_BUILD $dummy.c -o $dummy \
-         && ./$dummy `echo "${UNAME_RELEASE}" | sed -n 's/\([0-9]*\).*/\1/p'` \
-         && rm -f $dummy.c $dummy && exit 0
-       rm -f $dummy.c $dummy
-       echo mips-mips-riscos${UNAME_RELEASE}
-       exit 0 ;;
-    Motorola:PowerMAX_OS:*:*)
-       echo powerpc-motorola-powermax
-       exit 0 ;;
-    Night_Hawk:Power_UNIX:*:*)
-       echo powerpc-harris-powerunix
-       exit 0 ;;
-    m88k:CX/UX:7*:*)
-       echo m88k-harris-cxux7
-       exit 0 ;;
-    m88k:*:4*:R4*)
-       echo m88k-motorola-sysv4
-       exit 0 ;;
-    m88k:*:3*:R3*)
-       echo m88k-motorola-sysv3
-       exit 0 ;;
-    AViiON:dgux:*:*)
-        # DG/UX returns AViiON for all architectures
-        UNAME_PROCESSOR=`/usr/bin/uname -p`
-       if [ $UNAME_PROCESSOR = mc88100 ] || [ $UNAME_PROCESSOR = mc88110 ]
-       then
-           if [ ${TARGET_BINARY_INTERFACE}x = m88kdguxelfx ] || \
-              [ ${TARGET_BINARY_INTERFACE}x = x ]
-           then
-               echo m88k-dg-dgux${UNAME_RELEASE}
-           else
-               echo m88k-dg-dguxbcs${UNAME_RELEASE}
-           fi
-       else
-           echo i586-dg-dgux${UNAME_RELEASE}
-       fi
-       exit 0 ;;
-    M88*:DolphinOS:*:*)        # DolphinOS (SVR3)
-       echo m88k-dolphin-sysv3
-       exit 0 ;;
-    M88*:*:R3*:*)
-       # Delta 88k system running SVR3
-       echo m88k-motorola-sysv3
-       exit 0 ;;
-    XD88*:*:*:*) # Tektronix XD88 system running UTekV (SVR3)
-       echo m88k-tektronix-sysv3
-       exit 0 ;;
-    Tek43[0-9][0-9]:UTek:*:*) # Tektronix 4300 system running UTek (BSD)
-       echo m68k-tektronix-bsd
-       exit 0 ;;
-    *:IRIX*:*:*)
-       echo mips-sgi-irix`echo ${UNAME_RELEASE}|sed -e 's/-/_/g'`
-       exit 0 ;;
-    ????????:AIX?:[12].1:2)   # AIX 2.2.1 or AIX 2.1.1 is RT/PC AIX.
-       echo romp-ibm-aix      # uname -m gives an 8 hex-code CPU id
-       exit 0 ;;              # Note that: echo "'`uname -s`'" gives 'AIX '
-    i*86:AIX:*:*)
-       echo i386-ibm-aix
-       exit 0 ;;
-    ia64:AIX:*:*)
-       if [ -x /usr/bin/oslevel ] ; then
-               IBM_REV=`/usr/bin/oslevel`
-       else
-               IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE}
-       fi
-       echo ${UNAME_MACHINE}-ibm-aix${IBM_REV}
-       exit 0 ;;
-    *:AIX:2:3)
-       if grep bos325 /usr/include/stdio.h >/dev/null 2>&1; then
-               eval $set_cc_for_build
-               sed 's/^                //' << EOF >$dummy.c
-               #include <sys/systemcfg.h>
-
-               main()
-                       {
-                       if (!__power_pc())
-                               exit(1);
-                       puts("powerpc-ibm-aix3.2.5");
-                       exit(0);
-                       }
-EOF
-               $CC_FOR_BUILD $dummy.c -o $dummy && ./$dummy && rm -f $dummy.c $dummy && exit 0
-               rm -f $dummy.c $dummy
-               echo rs6000-ibm-aix3.2.5
-       elif grep bos324 /usr/include/stdio.h >/dev/null 2>&1; then
-               echo rs6000-ibm-aix3.2.4
-       else
-               echo rs6000-ibm-aix3.2
-       fi
-       exit 0 ;;
-    *:AIX:*:[45])
-       IBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | sed 1q | awk '{ print $1 }'`
-       if /usr/sbin/lsattr -El ${IBM_CPU_ID} | grep ' POWER' >/dev/null 2>&1; then
-               IBM_ARCH=rs6000
-       else
-               IBM_ARCH=powerpc
-       fi
-       if [ -x /usr/bin/oslevel ] ; then
-               IBM_REV=`/usr/bin/oslevel`
-       else
-               IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE}
-       fi
-       echo ${IBM_ARCH}-ibm-aix${IBM_REV}
-       exit 0 ;;
-    *:AIX:*:*)
-       echo rs6000-ibm-aix
-       exit 0 ;;
-    ibmrt:4.4BSD:*|romp-ibm:BSD:*)
-       echo romp-ibm-bsd4.4
-       exit 0 ;;
-    ibmrt:*BSD:*|romp-ibm:BSD:*)            # covers RT/PC BSD and
-       echo romp-ibm-bsd${UNAME_RELEASE}   # 4.3 with uname added to
-       exit 0 ;;                           # report: romp-ibm BSD 4.3
-    *:BOSX:*:*)
-       echo rs6000-bull-bosx
-       exit 0 ;;
-    DPX/2?00:B.O.S.:*:*)
-       echo m68k-bull-sysv3
-       exit 0 ;;
-    9000/[34]??:4.3bsd:1.*:*)
-       echo m68k-hp-bsd
-       exit 0 ;;
-    hp300:4.4BSD:*:* | 9000/[34]??:4.3bsd:2.*:*)
-       echo m68k-hp-bsd4.4
-       exit 0 ;;
-    9000/[34678]??:HP-UX:*:*)
-       HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'`
-       case "${UNAME_MACHINE}" in
-           9000/31? )            HP_ARCH=m68000 ;;
-           9000/[34]?? )         HP_ARCH=m68k ;;
-           9000/[678][0-9][0-9])
-               if [ -x /usr/bin/getconf ]; then
-                   sc_cpu_version=`/usr/bin/getconf SC_CPU_VERSION 2>/dev/null`
-                    sc_kernel_bits=`/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null`
-                    case "${sc_cpu_version}" in
-                      523) HP_ARCH="hppa1.0" ;; # CPU_PA_RISC1_0
-                      528) HP_ARCH="hppa1.1" ;; # CPU_PA_RISC1_1
-                      532)                      # CPU_PA_RISC2_0
-                        case "${sc_kernel_bits}" in
-                          32) HP_ARCH="hppa2.0n" ;;
-                          64) HP_ARCH="hppa2.0w" ;;
-                         '') HP_ARCH="hppa2.0" ;;   # HP-UX 10.20
-                        esac ;;
-                    esac
-               fi
-               if [ "${HP_ARCH}" = "" ]; then
-                   eval $set_cc_for_build
-                   sed 's/^              //' << EOF >$dummy.c
-
-              #define _HPUX_SOURCE
-              #include <stdlib.h>
-              #include <unistd.h>
-
-              int main ()
-              {
-              #if defined(_SC_KERNEL_BITS)
-                  long bits = sysconf(_SC_KERNEL_BITS);
-              #endif
-                  long cpu  = sysconf (_SC_CPU_VERSION);
-
-                  switch (cpu)
-               {
-               case CPU_PA_RISC1_0: puts ("hppa1.0"); break;
-               case CPU_PA_RISC1_1: puts ("hppa1.1"); break;
-               case CPU_PA_RISC2_0:
-              #if defined(_SC_KERNEL_BITS)
-                   switch (bits)
-                       {
-                       case 64: puts ("hppa2.0w"); break;
-                       case 32: puts ("hppa2.0n"); break;
-                       default: puts ("hppa2.0"); break;
-                       } break;
-              #else  /* !defined(_SC_KERNEL_BITS) */
-                   puts ("hppa2.0"); break;
-              #endif
-               default: puts ("hppa1.0"); break;
-               }
-                  exit (0);
-              }
-EOF
-                   (CCOPTS= $CC_FOR_BUILD $dummy.c -o $dummy 2>/dev/null) && HP_ARCH=`./$dummy`
-                   if test -z "$HP_ARCH"; then HP_ARCH=hppa; fi
-                   rm -f $dummy.c $dummy
-               fi ;;
-       esac
-       echo ${HP_ARCH}-hp-hpux${HPUX_REV}
-       exit 0 ;;
-    ia64:HP-UX:*:*)
-       HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'`
-       echo ia64-hp-hpux${HPUX_REV}
-       exit 0 ;;
-    3050*:HI-UX:*:*)
-       eval $set_cc_for_build
-       sed 's/^        //' << EOF >$dummy.c
-       #include <unistd.h>
-       int
-       main ()
-       {
-         long cpu = sysconf (_SC_CPU_VERSION);
-         /* The order matters, because CPU_IS_HP_MC68K erroneously returns
-            true for CPU_PA_RISC1_0.  CPU_IS_PA_RISC returns correct
-            results, however.  */
-         if (CPU_IS_PA_RISC (cpu))
-           {
-             switch (cpu)
-               {
-                 case CPU_PA_RISC1_0: puts ("hppa1.0-hitachi-hiuxwe2"); break;
-                 case CPU_PA_RISC1_1: puts ("hppa1.1-hitachi-hiuxwe2"); break;
-                 case CPU_PA_RISC2_0: puts ("hppa2.0-hitachi-hiuxwe2"); break;
-                 default: puts ("hppa-hitachi-hiuxwe2"); break;
-               }
-           }
-         else if (CPU_IS_HP_MC68K (cpu))
-           puts ("m68k-hitachi-hiuxwe2");
-         else puts ("unknown-hitachi-hiuxwe2");
-         exit (0);
-       }
-EOF
-       $CC_FOR_BUILD $dummy.c -o $dummy && ./$dummy && rm -f $dummy.c $dummy && exit 0
-       rm -f $dummy.c $dummy
-       echo unknown-hitachi-hiuxwe2
-       exit 0 ;;
-    9000/7??:4.3bsd:*:* | 9000/8?[79]:4.3bsd:*:* )
-       echo hppa1.1-hp-bsd
-       exit 0 ;;
-    9000/8??:4.3bsd:*:*)
-       echo hppa1.0-hp-bsd
-       exit 0 ;;
-    *9??*:MPE/iX:*:* | *3000*:MPE/iX:*:*)
-       echo hppa1.0-hp-mpeix
-       exit 0 ;;
-    hp7??:OSF1:*:* | hp8?[79]:OSF1:*:* )
-       echo hppa1.1-hp-osf
-       exit 0 ;;
-    hp8??:OSF1:*:*)
-       echo hppa1.0-hp-osf
-       exit 0 ;;
-    i*86:OSF1:*:*)
-       if [ -x /usr/sbin/sysversion ] ; then
-           echo ${UNAME_MACHINE}-unknown-osf1mk
-       else
-           echo ${UNAME_MACHINE}-unknown-osf1
-       fi
-       exit 0 ;;
-    parisc*:Lites*:*:*)
-       echo hppa1.1-hp-lites
-       exit 0 ;;
-    C1*:ConvexOS:*:* | convex:ConvexOS:C1*:*)
-       echo c1-convex-bsd
-        exit 0 ;;
-    C2*:ConvexOS:*:* | convex:ConvexOS:C2*:*)
-       if getsysinfo -f scalar_acc
-       then echo c32-convex-bsd
-       else echo c2-convex-bsd
-       fi
-        exit 0 ;;
-    C34*:ConvexOS:*:* | convex:ConvexOS:C34*:*)
-       echo c34-convex-bsd
-        exit 0 ;;
-    C38*:ConvexOS:*:* | convex:ConvexOS:C38*:*)
-       echo c38-convex-bsd
-        exit 0 ;;
-    C4*:ConvexOS:*:* | convex:ConvexOS:C4*:*)
-       echo c4-convex-bsd
-        exit 0 ;;
-    CRAY*Y-MP:*:*:*)
-       echo ymp-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
-       exit 0 ;;
-    CRAY*[A-Z]90:*:*:*)
-       echo ${UNAME_MACHINE}-cray-unicos${UNAME_RELEASE} \
-       | sed -e 's/CRAY.*\([A-Z]90\)/\1/' \
-             -e y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/ \
-             -e 's/\.[^.]*$/.X/'
-       exit 0 ;;
-    CRAY*TS:*:*:*)
-       echo t90-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
-       exit 0 ;;
-    CRAY*T3D:*:*:*)
-       echo alpha-cray-unicosmk${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
-       exit 0 ;;
-    CRAY*T3E:*:*:*)
-       echo alphaev5-cray-unicosmk${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
-       exit 0 ;;
-    CRAY*SV1:*:*:*)
-       echo sv1-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
-       exit 0 ;;
-    F30[01]:UNIX_System_V:*:* | F700:UNIX_System_V:*:*)
-       FUJITSU_PROC=`uname -m | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'`
-        FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'`
-        FUJITSU_REL=`echo ${UNAME_RELEASE} | sed -e 's/ /_/'`
-        echo "${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}"
-        exit 0 ;;
-    i*86:BSD/386:*:* | i*86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*)
-       echo ${UNAME_MACHINE}-pc-bsdi${UNAME_RELEASE}
-       exit 0 ;;
-    sparc*:BSD/OS:*:*)
-       echo sparc-unknown-bsdi${UNAME_RELEASE}
-       exit 0 ;;
-    *:BSD/OS:*:*)
-       echo ${UNAME_MACHINE}-unknown-bsdi${UNAME_RELEASE}
-       exit 0 ;;
-    *:FreeBSD:*:*)
-       echo ${UNAME_MACHINE}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`
-       exit 0 ;;
-    i*:CYGWIN*:*)
-       echo ${UNAME_MACHINE}-pc-cygwin
-       exit 0 ;;
-    i*:MINGW*:*)
-       echo ${UNAME_MACHINE}-pc-mingw32
-       exit 0 ;;
-    i*:PW*:*)
-       echo ${UNAME_MACHINE}-pc-pw32
-       exit 0 ;;
-    x86:Interix*:3*)
-       echo i386-pc-interix3
-       exit 0 ;;
-    i*:Windows_NT*:* | Pentium*:Windows_NT*:*)
-       # How do we know it's Interix rather than the generic POSIX subsystem?
-       # It also conflicts with pre-2.0 versions of AT&T UWIN. Should we
-       # UNAME_MACHINE based on the output of uname instead of i386?
-       echo i386-pc-interix
-       exit 0 ;;
-    i*:UWIN*:*)
-       echo ${UNAME_MACHINE}-pc-uwin
-       exit 0 ;;
-    p*:CYGWIN*:*)
-       echo powerpcle-unknown-cygwin
-       exit 0 ;;
-    prep*:SunOS:5.*:*)
-       echo powerpcle-unknown-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
-       exit 0 ;;
-    *:GNU:*:*)
-       echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-gnu`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'`
-       exit 0 ;;
-    i*86:Minix:*:*)
-       echo ${UNAME_MACHINE}-pc-minix
-       exit 0 ;;
-    arm*:Linux:*:*)
-       echo ${UNAME_MACHINE}-unknown-linux-gnu
-       exit 0 ;;
-    ia64:Linux:*:*)
-       echo ${UNAME_MACHINE}-unknown-linux-gnu
-       exit 0 ;;
-    m68*:Linux:*:*)
-       echo ${UNAME_MACHINE}-unknown-linux-gnu
-       exit 0 ;;
-    mips:Linux:*:*)
-       eval $set_cc_for_build
-       sed 's/^        //' << EOF >$dummy.c
-       #undef CPU
-       #undef mips
-       #undef mipsel
-       #if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL)
-       CPU=mipsel
-       #else
-       #if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB)
-       CPU=mips
-       #else
-       CPU=
-       #endif
-       #endif
-EOF
-       eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep ^CPU=`
-       rm -f $dummy.c
-       test x"${CPU}" != x && echo "${CPU}-pc-linux-gnu" && exit 0
-       ;;
-    ppc:Linux:*:*)
-       echo powerpc-unknown-linux-gnu
-       exit 0 ;;
-    ppc64:Linux:*:*)
-       echo powerpc64-unknown-linux-gnu
-       exit 0 ;;
-    alpha:Linux:*:*)
-       case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in
-         EV5)   UNAME_MACHINE=alphaev5 ;;
-         EV56)  UNAME_MACHINE=alphaev56 ;;
-         PCA56) UNAME_MACHINE=alphapca56 ;;
-         PCA57) UNAME_MACHINE=alphapca56 ;;
-         EV6)   UNAME_MACHINE=alphaev6 ;;
-         EV67)  UNAME_MACHINE=alphaev67 ;;
-         EV68*) UNAME_MACHINE=alphaev68 ;;
-        esac
-       objdump --private-headers /bin/sh | grep ld.so.1 >/dev/null
-       if test "$?" = 0 ; then LIBC="libc1" ; else LIBC="" ; fi
-       echo ${UNAME_MACHINE}-unknown-linux-gnu${LIBC}
-       exit 0 ;;
-    parisc:Linux:*:* | hppa:Linux:*:*)
-       # Look for CPU level
-       case `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in
-         PA7*) echo hppa1.1-unknown-linux-gnu ;;
-         PA8*) echo hppa2.0-unknown-linux-gnu ;;
-         *)    echo hppa-unknown-linux-gnu ;;
-       esac
-       exit 0 ;;
-    parisc64:Linux:*:* | hppa64:Linux:*:*)
-       echo hppa64-unknown-linux-gnu
-       exit 0 ;;
-    s390:Linux:*:* | s390x:Linux:*:*)
-       echo ${UNAME_MACHINE}-ibm-linux
-       exit 0 ;;
-    sh*:Linux:*:*)
-       echo ${UNAME_MACHINE}-unknown-linux-gnu
-       exit 0 ;;
-    sparc:Linux:*:* | sparc64:Linux:*:*)
-       echo ${UNAME_MACHINE}-unknown-linux-gnu
-       exit 0 ;;
-    x86_64:Linux:*:*)
-       echo x86_64-unknown-linux-gnu
-       exit 0 ;;
-    i*86:Linux:*:*)
-       # The BFD linker knows what the default object file format is, so
-       # first see if it will tell us. cd to the root directory to prevent
-       # problems with other programs or directories called `ld' in the path.
-       # Set LC_ALL=C to ensure ld outputs messages in English.
-       ld_supported_targets=`cd /; LC_ALL=C ld --help 2>&1 \
-                        | sed -ne '/supported targets:/!d
-                                   s/[         ][      ]*/ /g
-                                   s/.*supported targets: *//
-                                   s/ .*//
-                                   p'`
-        case "$ld_supported_targets" in
-         elf32-i386)
-               TENTATIVE="${UNAME_MACHINE}-pc-linux-gnu"
-               ;;
-         a.out-i386-linux)
-               echo "${UNAME_MACHINE}-pc-linux-gnuaout"
-               exit 0 ;;               
-         coff-i386)
-               echo "${UNAME_MACHINE}-pc-linux-gnucoff"
-               exit 0 ;;
-         "")
-               # Either a pre-BFD a.out linker (linux-gnuoldld) or
-               # one that does not give us useful --help.
-               echo "${UNAME_MACHINE}-pc-linux-gnuoldld"
-               exit 0 ;;
-       esac
-       # Determine whether the default compiler is a.out or elf
-       eval $set_cc_for_build
-       sed 's/^        //' << EOF >$dummy.c
-       #include <features.h>
-       #ifdef __ELF__
-       # ifdef __GLIBC__
-       #  if __GLIBC__ >= 2
-       LIBC=gnu
-       #  else
-       LIBC=gnulibc1
-       #  endif
-       # else
-       LIBC=gnulibc1
-       # endif
-       #else
-       #ifdef __INTEL_COMPILER
-       LIBC=gnu
-       #else
-       LIBC=gnuaout
-       #endif
-       #endif
-EOF
-       eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep ^LIBC=`
-       rm -f $dummy.c
-       test x"${LIBC}" != x && echo "${UNAME_MACHINE}-pc-linux-${LIBC}" && exit 0
-       test x"${TENTATIVE}" != x && echo "${TENTATIVE}" && exit 0
-       ;;
-    i*86:DYNIX/ptx:4*:*)
-       # ptx 4.0 does uname -s correctly, with DYNIX/ptx in there.
-       # earlier versions are messed up and put the nodename in both
-       # sysname and nodename.
-       echo i386-sequent-sysv4
-       exit 0 ;;
-    i*86:UNIX_SV:4.2MP:2.*)
-        # Unixware is an offshoot of SVR4, but it has its own version
-        # number series starting with 2...
-        # I am not positive that other SVR4 systems won't match this,
-       # I just have to hope.  -- rms.
-        # Use sysv4.2uw... so that sysv4* matches it.
-       echo ${UNAME_MACHINE}-pc-sysv4.2uw${UNAME_VERSION}
-       exit 0 ;;
-    i*86:*:4.*:* | i*86:SYSTEM_V:4.*:*)
-       UNAME_REL=`echo ${UNAME_RELEASE} | sed 's/\/MP$//'`
-       if grep Novell /usr/include/link.h >/dev/null 2>/dev/null; then
-               echo ${UNAME_MACHINE}-univel-sysv${UNAME_REL}
-       else
-               echo ${UNAME_MACHINE}-pc-sysv${UNAME_REL}
-       fi
-       exit 0 ;;
-    i*86:*:5:[78]*)
-       case `/bin/uname -X | grep "^Machine"` in
-           *486*)           UNAME_MACHINE=i486 ;;
-           *Pentium)        UNAME_MACHINE=i586 ;;
-           *Pent*|*Celeron) UNAME_MACHINE=i686 ;;
-       esac
-       echo ${UNAME_MACHINE}-unknown-sysv${UNAME_RELEASE}${UNAME_SYSTEM}${UNAME_VERSION}
-       exit 0 ;;
-    i*86:*:3.2:*)
-       if test -f /usr/options/cb.name; then
-               UNAME_REL=`sed -n 's/.*Version //p' </usr/options/cb.name`
-               echo ${UNAME_MACHINE}-pc-isc$UNAME_REL
-       elif /bin/uname -X 2>/dev/null >/dev/null ; then
-               UNAME_REL=`(/bin/uname -X|egrep Release|sed -e 's/.*= //')`
-               (/bin/uname -X|egrep i80486 >/dev/null) && UNAME_MACHINE=i486
-               (/bin/uname -X|egrep '^Machine.*Pentium' >/dev/null) \
-                       && UNAME_MACHINE=i586
-               (/bin/uname -X|egrep '^Machine.*Pent ?II' >/dev/null) \
-                       && UNAME_MACHINE=i686
-               (/bin/uname -X|egrep '^Machine.*Pentium Pro' >/dev/null) \
-                       && UNAME_MACHINE=i686
-               echo ${UNAME_MACHINE}-pc-sco$UNAME_REL
-       else
-               echo ${UNAME_MACHINE}-pc-sysv32
-       fi
-       exit 0 ;;
-    i*86:*DOS:*:*)
-       echo ${UNAME_MACHINE}-pc-msdosdjgpp
-       exit 0 ;;
-    pc:*:*:*)
-       # Left here for compatibility:
-        # uname -m prints for DJGPP always 'pc', but it prints nothing about
-        # the processor, so we play safe by assuming i386.
-       echo i386-pc-msdosdjgpp
-        exit 0 ;;
-    Intel:Mach:3*:*)
-       echo i386-pc-mach3
-       exit 0 ;;
-    paragon:*:*:*)
-       echo i860-intel-osf1
-       exit 0 ;;
-    i860:*:4.*:*) # i860-SVR4
-       if grep Stardent /usr/include/sys/uadmin.h >/dev/null 2>&1 ; then
-         echo i860-stardent-sysv${UNAME_RELEASE} # Stardent Vistra i860-SVR4
-       else # Add other i860-SVR4 vendors below as they are discovered.
-         echo i860-unknown-sysv${UNAME_RELEASE}  # Unknown i860-SVR4
-       fi
-       exit 0 ;;
-    mini*:CTIX:SYS*5:*)
-       # "miniframe"
-       echo m68010-convergent-sysv
-       exit 0 ;;
-    M68*:*:R3V[567]*:*)
-       test -r /sysV68 && echo 'm68k-motorola-sysv' && exit 0 ;;
-    3[34]??:*:4.0:3.0 | 3[34]??A:*:4.0:3.0 | 3[34]??,*:*:4.0:3.0 | 3[34]??/*:*:4.0:3.0 | 4850:*:4.0:3.0 | SKA40:*:4.0:3.0)
-       OS_REL=''
-       test -r /etc/.relid \
-       && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid`
-       /bin/uname -p 2>/dev/null | grep 86 >/dev/null \
-         && echo i486-ncr-sysv4.3${OS_REL} && exit 0
-       /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \
-         && echo i586-ncr-sysv4.3${OS_REL} && exit 0 ;;
-    3[34]??:*:4.0:* | 3[34]??,*:*:4.0:*)
-        /bin/uname -p 2>/dev/null | grep 86 >/dev/null \
-          && echo i486-ncr-sysv4 && exit 0 ;;
-    m68*:LynxOS:2.*:* | m68*:LynxOS:3.0*:*)
-       echo m68k-unknown-lynxos${UNAME_RELEASE}
-       exit 0 ;;
-    mc68030:UNIX_System_V:4.*:*)
-       echo m68k-atari-sysv4
-       exit 0 ;;
-    i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.0*:*)
-       echo i386-unknown-lynxos${UNAME_RELEASE}
-       exit 0 ;;
-    TSUNAMI:LynxOS:2.*:*)
-       echo sparc-unknown-lynxos${UNAME_RELEASE}
-       exit 0 ;;
-    rs6000:LynxOS:2.*:*)
-       echo rs6000-unknown-lynxos${UNAME_RELEASE}
-       exit 0 ;;
-    PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:* | PowerPC:LynxOS:4.0*:*)
-       echo powerpc-unknown-lynxos${UNAME_RELEASE}
-       exit 0 ;;
-    SM[BE]S:UNIX_SV:*:*)
-       echo mips-dde-sysv${UNAME_RELEASE}
-       exit 0 ;;
-    RM*:ReliantUNIX-*:*:*)
-       echo mips-sni-sysv4
-       exit 0 ;;
-    RM*:SINIX-*:*:*)
-       echo mips-sni-sysv4
-       exit 0 ;;
-    *:SINIX-*:*:*)
-       if uname -p 2>/dev/null >/dev/null ; then
-               UNAME_MACHINE=`(uname -p) 2>/dev/null`
-               echo ${UNAME_MACHINE}-sni-sysv4
-       else
-               echo ns32k-sni-sysv
-       fi
-       exit 0 ;;
-    PENTIUM:*:4.0*:*) # Unisys `ClearPath HMP IX 4000' SVR4/MP effort
-                      # says <Richard.M.Bartel@ccMail.Census.GOV>
-        echo i586-unisys-sysv4
-        exit 0 ;;
-    *:UNIX_System_V:4*:FTX*)
-       # From Gerald Hewes <hewes@openmarket.com>.
-       # How about differentiating between stratus architectures? -djm
-       echo hppa1.1-stratus-sysv4
-       exit 0 ;;
-    *:*:*:FTX*)
-       # From seanf@swdc.stratus.com.
-       echo i860-stratus-sysv4
-       exit 0 ;;
-    *:VOS:*:*)
-       # From Paul.Green@stratus.com.
-       echo hppa1.1-stratus-vos
-       exit 0 ;;
-    mc68*:A/UX:*:*)
-       echo m68k-apple-aux${UNAME_RELEASE}
-       exit 0 ;;
-    news*:NEWS-OS:6*:*)
-       echo mips-sony-newsos6
-       exit 0 ;;
-    R[34]000:*System_V*:*:* | R4000:UNIX_SYSV:*:* | R*000:UNIX_SV:*:*)
-       if [ -d /usr/nec ]; then
-               echo mips-nec-sysv${UNAME_RELEASE}
-       else
-               echo mips-unknown-sysv${UNAME_RELEASE}
-       fi
-        exit 0 ;;
-    BeBox:BeOS:*:*)    # BeOS running on hardware made by Be, PPC only.
-       echo powerpc-be-beos
-       exit 0 ;;
-    BeMac:BeOS:*:*)    # BeOS running on Mac or Mac clone, PPC only.
-       echo powerpc-apple-beos
-       exit 0 ;;
-    BePC:BeOS:*:*)     # BeOS running on Intel PC compatible.
-       echo i586-pc-beos
-       exit 0 ;;
-    SX-4:SUPER-UX:*:*)
-       echo sx4-nec-superux${UNAME_RELEASE}
-       exit 0 ;;
-    SX-5:SUPER-UX:*:*)
-       echo sx5-nec-superux${UNAME_RELEASE}
-       exit 0 ;;
-    Power*:Rhapsody:*:*)
-       echo powerpc-apple-rhapsody${UNAME_RELEASE}
-       exit 0 ;;
-    *:Rhapsody:*:*)
-       echo ${UNAME_MACHINE}-apple-rhapsody${UNAME_RELEASE}
-       exit 0 ;;
-    *:Darwin:*:*)
-       echo `uname -p`-apple-darwin${UNAME_RELEASE}
-       exit 0 ;;
-    *:procnto*:*:* | *:QNX:[0123456789]*:*)
-       UNAME_PROCESSOR=`uname -p`
-       if test "$UNAME_PROCESSOR" = "x86"; then
-               UNAME_PROCESSOR=i386
-               UNAME_MACHINE=pc
-       fi
-       echo ${UNAME_PROCESSOR}-${UNAME_MACHINE}-nto-qnx${UNAME_RELEASE}
-       exit 0 ;;
-    *:QNX:*:4*)
-       echo i386-pc-qnx
-       exit 0 ;;
-    NSR-[GKLNPTVW]:NONSTOP_KERNEL:*:*)
-       echo nsr-tandem-nsk${UNAME_RELEASE}
-       exit 0 ;;
-    *:NonStop-UX:*:*)
-       echo mips-compaq-nonstopux
-       exit 0 ;;
-    BS2000:POSIX*:*:*)
-       echo bs2000-siemens-sysv
-       exit 0 ;;
-    DS/*:UNIX_System_V:*:*)
-       echo ${UNAME_MACHINE}-${UNAME_SYSTEM}-${UNAME_RELEASE}
-       exit 0 ;;
-    *:Plan9:*:*)
-       # "uname -m" is not consistent, so use $cputype instead. 386
-       # is converted to i386 for consistency with other x86
-       # operating systems.
-       if test "$cputype" = "386"; then
-           UNAME_MACHINE=i386
-       else
-           UNAME_MACHINE="$cputype"
-       fi
-       echo ${UNAME_MACHINE}-unknown-plan9
-       exit 0 ;;
-    i*86:OS/2:*:*)
-       # If we were able to find `uname', then EMX Unix compatibility
-       # is probably installed.
-       echo ${UNAME_MACHINE}-pc-os2-emx
-       exit 0 ;;
-    *:TOPS-10:*:*)
-       echo pdp10-unknown-tops10
-       exit 0 ;;
-    *:TENEX:*:*)
-       echo pdp10-unknown-tenex
-       exit 0 ;;
-    KS10:TOPS-20:*:* | KL10:TOPS-20:*:* | TYPE4:TOPS-20:*:*)
-       echo pdp10-dec-tops20
-       exit 0 ;;
-    XKL-1:TOPS-20:*:* | TYPE5:TOPS-20:*:*)
-       echo pdp10-xkl-tops20
-       exit 0 ;;
-    *:TOPS-20:*:*)
-       echo pdp10-unknown-tops20
-       exit 0 ;;
-    *:ITS:*:*)
-       echo pdp10-unknown-its
-       exit 0 ;;
-    i*86:XTS-300:*:STOP)
-       echo ${UNAME_MACHINE}-unknown-stop
-       exit 0 ;;
-    i*86:atheos:*:*)
-       echo ${UNAME_MACHINE}-unknown-atheos
-       exit 0 ;;
-esac
-
-#echo '(No uname command or uname output not recognized.)' 1>&2
-#echo "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" 1>&2
-
-eval $set_cc_for_build
-cat >$dummy.c <<EOF
-#ifdef _SEQUENT_
-# include <sys/types.h>
-# include <sys/utsname.h>
-#endif
-main ()
-{
-#if defined (sony)
-#if defined (MIPSEB)
-  /* BFD wants "bsd" instead of "newsos".  Perhaps BFD should be changed,
-     I don't know....  */
-  printf ("mips-sony-bsd\n"); exit (0);
-#else
-#include <sys/param.h>
-  printf ("m68k-sony-newsos%s\n",
-#ifdef NEWSOS4
-          "4"
-#else
-         ""
-#endif
-         ); exit (0);
-#endif
-#endif
-
-#if defined (__arm) && defined (__acorn) && defined (__unix)
-  printf ("arm-acorn-riscix"); exit (0);
-#endif
-
-#if defined (hp300) && !defined (hpux)
-  printf ("m68k-hp-bsd\n"); exit (0);
-#endif
-
-#if defined (NeXT)
-#if !defined (__ARCHITECTURE__)
-#define __ARCHITECTURE__ "m68k"
-#endif
-  int version;
-  version=`(hostinfo | sed -n 's/.*NeXT Mach \([0-9]*\).*/\1/p') 2>/dev/null`;
-  if (version < 4)
-    printf ("%s-next-nextstep%d\n", __ARCHITECTURE__, version);
-  else
-    printf ("%s-next-openstep%d\n", __ARCHITECTURE__, version);
-  exit (0);
-#endif
-
-#if defined (MULTIMAX) || defined (n16)
-#if defined (UMAXV)
-  printf ("ns32k-encore-sysv\n"); exit (0);
-#else
-#if defined (CMU)
-  printf ("ns32k-encore-mach\n"); exit (0);
-#else
-  printf ("ns32k-encore-bsd\n"); exit (0);
-#endif
-#endif
-#endif
-
-#if defined (__386BSD__)
-  printf ("i386-pc-bsd\n"); exit (0);
-#endif
-
-#if defined (sequent)
-#if defined (i386)
-  printf ("i386-sequent-dynix\n"); exit (0);
-#endif
-#if defined (ns32000)
-  printf ("ns32k-sequent-dynix\n"); exit (0);
-#endif
-#endif
-
-#if defined (_SEQUENT_)
-    struct utsname un;
-
-    uname(&un);
-
-    if (strncmp(un.version, "V2", 2) == 0) {
-       printf ("i386-sequent-ptx2\n"); exit (0);
-    }
-    if (strncmp(un.version, "V1", 2) == 0) { /* XXX is V1 correct? */
-       printf ("i386-sequent-ptx1\n"); exit (0);
-    }
-    printf ("i386-sequent-ptx\n"); exit (0);
-
-#endif
-
-#if defined (vax)
-# if !defined (ultrix)
-#  include <sys/param.h>
-#  if defined (BSD)
-#   if BSD == 43
-      printf ("vax-dec-bsd4.3\n"); exit (0);
-#   else
-#    if BSD == 199006
-      printf ("vax-dec-bsd4.3reno\n"); exit (0);
-#    else
-      printf ("vax-dec-bsd\n"); exit (0);
-#    endif
-#   endif
-#  else
-    printf ("vax-dec-bsd\n"); exit (0);
-#  endif
-# else
-    printf ("vax-dec-ultrix\n"); exit (0);
-# endif
-#endif
-
-#if defined (alliant) && defined (i860)
-  printf ("i860-alliant-bsd\n"); exit (0);
-#endif
-
-  exit (1);
-}
-EOF
-
-$CC_FOR_BUILD $dummy.c -o $dummy 2>/dev/null && ./$dummy && rm -f $dummy.c $dummy && exit 0
-rm -f $dummy.c $dummy
-
-# Apollos put the system type in the environment.
-
-test -d /usr/apollo && { echo ${ISP}-apollo-${SYSTYPE}; exit 0; }
-
-# Convex versions that predate uname can use getsysinfo(1)
-
-if [ -x /usr/convex/getsysinfo ]
-then
-    case `getsysinfo -f cpu_type` in
-    c1*)
-       echo c1-convex-bsd
-       exit 0 ;;
-    c2*)
-       if getsysinfo -f scalar_acc
-       then echo c32-convex-bsd
-       else echo c2-convex-bsd
-       fi
-       exit 0 ;;
-    c34*)
-       echo c34-convex-bsd
-       exit 0 ;;
-    c38*)
-       echo c38-convex-bsd
-       exit 0 ;;
-    c4*)
-       echo c4-convex-bsd
-       exit 0 ;;
-    esac
-fi
-
-cat >&2 <<EOF
-$0: unable to guess system type
-
-This script, last modified $timestamp, has failed to recognize
-the operating system you are using. It is advised that you
-download the most up to date version of the config scripts from
-
-    ftp://ftp.gnu.org/pub/gnu/config/
-
-If the version you run ($0) is already up to date, please
-send the following data and any information you think might be
-pertinent to <config-patches@gnu.org> in order to provide the needed
-information to handle your system.
-
-config.guess timestamp = $timestamp
-
-uname -m = `(uname -m) 2>/dev/null || echo unknown`
-uname -r = `(uname -r) 2>/dev/null || echo unknown`
-uname -s = `(uname -s) 2>/dev/null || echo unknown`
-uname -v = `(uname -v) 2>/dev/null || echo unknown`
-
-/usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null`
-/bin/uname -X     = `(/bin/uname -X) 2>/dev/null`
-
-hostinfo               = `(hostinfo) 2>/dev/null`
-/bin/universe          = `(/bin/universe) 2>/dev/null`
-/usr/bin/arch -k       = `(/usr/bin/arch -k) 2>/dev/null`
-/bin/arch              = `(/bin/arch) 2>/dev/null`
-/usr/bin/oslevel       = `(/usr/bin/oslevel) 2>/dev/null`
-/usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null`
-
-UNAME_MACHINE = ${UNAME_MACHINE}
-UNAME_RELEASE = ${UNAME_RELEASE}
-UNAME_SYSTEM  = ${UNAME_SYSTEM}
-UNAME_VERSION = ${UNAME_VERSION}
-EOF
-
-exit 1
-
-# Local variables:
-# eval: (add-hook 'write-file-hooks 'time-stamp)
-# time-stamp-start: "timestamp='"
-# time-stamp-format: "%:y-%02m-%02d"
-# time-stamp-end: "'"
-# End:
diff --git a/src/nws_portability/config.sub b/src/nws_portability/config.sub
deleted file mode 100644 (file)
index f365797..0000000
+++ /dev/null
@@ -1,1443 +0,0 @@
-#! /bin/sh
-# Configuration validation subroutine script.
-#   Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
-#   2000, 2001, 2002 Free Software Foundation, Inc.
-
-timestamp='2002-03-07'
-
-# This file is (in principle) common to ALL GNU software.
-# The presence of a machine in this file suggests that SOME GNU software
-# can handle that machine.  It does not imply ALL GNU software can.
-#
-# This file 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 of the License, or
-# (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-# GNU General Public License for more details.
-#
-# 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.
-
-# As a special exception to the GNU General Public License, if you
-# distribute this file as part of a program that contains a
-# configuration script generated by Autoconf, you may include it under
-# the same distribution terms that you use for the rest of that program.
-
-# Please send patches to <config-patches@gnu.org>.  Submit a context
-# diff and a properly formatted ChangeLog entry.
-#
-# Configuration subroutine to validate and canonicalize a configuration type.
-# Supply the specified configuration type as an argument.
-# If it is invalid, we print an error message on stderr and exit with code 1.
-# Otherwise, we print the canonical config type on stdout and succeed.
-
-# This file is supposed to be the same for all GNU packages
-# and recognize all the CPU types, system types and aliases
-# that are meaningful with *any* GNU software.
-# Each package is responsible for reporting which valid configurations
-# it does not support.  The user should be able to distinguish
-# a failure to support a valid configuration from a meaningless
-# configuration.
-
-# The goal of this file is to map all the various variations of a given
-# machine specification into a single specification in the form:
-#      CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM
-# or in some cases, the newer four-part form:
-#      CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM
-# It is wrong to echo any other type of specification.
-
-me=`echo "$0" | sed -e 's,.*/,,'`
-
-usage="\
-Usage: $0 [OPTION] CPU-MFR-OPSYS
-       $0 [OPTION] ALIAS
-
-Canonicalize a configuration name.
-
-Operation modes:
-  -h, --help         print this help, then exit
-  -t, --time-stamp   print date of last modification, then exit
-  -v, --version      print version number, then exit
-
-Report bugs and patches to <config-patches@gnu.org>."
-
-version="\
-GNU config.sub ($timestamp)
-
-Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001
-Free Software Foundation, Inc.
-
-This is free software; see the source for copying conditions.  There is NO
-warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
-
-help="
-Try \`$me --help' for more information."
-
-# Parse command line
-while test $# -gt 0 ; do
-  case $1 in
-    --time-stamp | --time* | -t )
-       echo "$timestamp" ; exit 0 ;;
-    --version | -v )
-       echo "$version" ; exit 0 ;;
-    --help | --h* | -h )
-       echo "$usage"; exit 0 ;;
-    -- )     # Stop option processing
-       shift; break ;;
-    - )        # Use stdin as input.
-       break ;;
-    -* )
-       echo "$me: invalid option $1$help"
-       exit 1 ;;
-
-    *local*)
-       # First pass through any local machine types.
-       echo $1
-       exit 0;;
-
-    * )
-       break ;;
-  esac
-done
-
-case $# in
- 0) echo "$me: missing argument$help" >&2
-    exit 1;;
- 1) ;;
- *) echo "$me: too many arguments$help" >&2
-    exit 1;;
-esac
-
-# Separate what the user gave into CPU-COMPANY and OS or KERNEL-OS (if any).
-# Here we must recognize all the valid KERNEL-OS combinations.
-maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'`
-case $maybe_os in
-  nto-qnx* | linux-gnu* | storm-chaos* | os2-emx* | windows32-* | rtmk-nova*)
-    os=-$maybe_os
-    basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'`
-    ;;
-  *)
-    basic_machine=`echo $1 | sed 's/-[^-]*$//'`
-    if [ $basic_machine != $1 ]
-    then os=`echo $1 | sed 's/.*-/-/'`
-    else os=; fi
-    ;;
-esac
-
-### Let's recognize common machines as not being operating systems so
-### that things like config.sub decstation-3100 work.  We also
-### recognize some manufacturers as not being operating systems, so we
-### can provide default operating systems below.
-case $os in
-       -sun*os*)
-               # Prevent following clause from handling this invalid input.
-               ;;
-       -dec* | -mips* | -sequent* | -encore* | -pc532* | -sgi* | -sony* | \
-       -att* | -7300* | -3300* | -delta* | -motorola* | -sun[234]* | \
-       -unicom* | -ibm* | -next | -hp | -isi* | -apollo | -altos* | \
-       -convergent* | -ncr* | -news | -32* | -3600* | -3100* | -hitachi* |\
-       -c[123]* | -convex* | -sun | -crds | -omron* | -dg | -ultra | -tti* | \
-       -harris | -dolphin | -highlevel | -gould | -cbm | -ns | -masscomp | \
-       -apple | -axis)
-               os=
-               basic_machine=$1
-               ;;
-       -sim | -cisco | -oki | -wec | -winbond)
-               os=
-               basic_machine=$1
-               ;;
-       -scout)
-               ;;
-       -wrs)
-               os=-vxworks
-               basic_machine=$1
-               ;;
-       -chorusos*)
-               os=-chorusos
-               basic_machine=$1
-               ;;
-       -chorusrdb)
-               os=-chorusrdb
-               basic_machine=$1
-               ;;
-       -hiux*)
-               os=-hiuxwe2
-               ;;
-       -sco5)
-               os=-sco3.2v5
-               basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
-               ;;
-       -sco4)
-               os=-sco3.2v4
-               basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
-               ;;
-       -sco3.2.[4-9]*)
-               os=`echo $os | sed -e 's/sco3.2./sco3.2v/'`
-               basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
-               ;;
-       -sco3.2v[4-9]*)
-               # Don't forget version if it is 3.2v4 or newer.
-               basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
-               ;;
-       -sco*)
-               os=-sco3.2v2
-               basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
-               ;;
-       -udk*)
-               basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
-               ;;
-       -isc)
-               os=-isc2.2
-               basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
-               ;;
-       -clix*)
-               basic_machine=clipper-intergraph
-               ;;
-       -isc*)
-               basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
-               ;;
-       -lynx*)
-               os=-lynxos
-               ;;
-       -ptx*)
-               basic_machine=`echo $1 | sed -e 's/86-.*/86-sequent/'`
-               ;;
-       -windowsnt*)
-               os=`echo $os | sed -e 's/windowsnt/winnt/'`
-               ;;
-       -psos*)
-               os=-psos
-               ;;
-       -mint | -mint[0-9]*)
-               basic_machine=m68k-atari
-               os=-mint
-               ;;
-esac
-
-# Decode aliases for certain CPU-COMPANY combinations.
-case $basic_machine in
-       # Recognize the basic CPU types without company name.
-       # Some are omitted here because they have special meanings below.
-       1750a | 580 \
-       | a29k \
-       | alpha | alphaev[4-8] | alphaev56 | alphaev6[78] | alphapca5[67] \
-       | alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] | alpha64pca5[67] \
-       | arc | arm | arm[bl]e | arme[lb] | armv[2345] | armv[345][lb] | avr \
-       | c4x | clipper \
-       | d10v | d30v | dsp16xx \
-       | fr30 \
-       | h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \
-       | i370 | i860 | i960 | ia64 \
-       | m32r | m68000 | m68k | m88k | mcore \
-       | mips | mips16 | mips64 | mips64el | mips64orion | mips64orionel \
-       | mips64vr4100 | mips64vr4100el | mips64vr4300 \
-       | mips64vr4300el | mips64vr5000 | mips64vr5000el \
-       | mipsbe | mipseb | mipsel | mipsle | mipstx39 | mipstx39el \
-       | mipsisa32 | mipsisa64 \
-       | mn10200 | mn10300 \
-       | ns16k | ns32k \
-       | openrisc | or32 \
-       | pdp10 | pdp11 | pj | pjl \
-       | powerpc | powerpc64 | powerpc64le | powerpcle | ppcbe \
-       | pyramid \
-       | sh | sh[34] | sh[34]eb | shbe | shle | sh64 \
-       | sparc | sparc64 | sparc86x | sparclet | sparclite | sparcv9 | sparcv9b \
-       | strongarm \
-       | tahoe | thumb | tic80 | tron \
-       | v850 | v850e \
-       | we32k \
-       | x86 | xscale | xstormy16 | xtensa \
-       | z8k)
-               basic_machine=$basic_machine-unknown
-               ;;
-       m6811 | m68hc11 | m6812 | m68hc12)
-               # Motorola 68HC11/12.
-               basic_machine=$basic_machine-unknown
-               os=-none
-               ;;
-       m88110 | m680[12346]0 | m683?2 | m68360 | m5200 | v70 | w65 | z8k)
-               ;;
-
-       # We use `pc' rather than `unknown'
-       # because (1) that's what they normally are, and
-       # (2) the word "unknown" tends to confuse beginning users.
-       i*86 | x86_64)
-         basic_machine=$basic_machine-pc
-         ;;
-       # Object if more than one company name word.
-       *-*-*)
-               echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2
-               exit 1
-               ;;
-       # Recognize the basic CPU types with company name.
-       580-* \
-       | a29k-* \
-       | alpha-* | alphaev[4-8]-* | alphaev56-* | alphaev6[78]-* \
-       | alpha64-* | alpha64ev[4-8]-* | alpha64ev56-* | alpha64ev6[78]-* \
-       | alphapca5[67]-* | alpha64pca5[67]-* | arc-* \
-       | arm-*  | armbe-* | armle-* | armv*-* \
-       | avr-* \
-       | bs2000-* \
-       | c[123]* | c30-* | [cjt]90-* | c54x-* \
-       | clipper-* | cydra-* \
-       | d10v-* | d30v-* \
-       | elxsi-* \
-       | f30[01]-* | f700-* | fr30-* | fx80-* \
-       | h8300-* | h8500-* \
-       | hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \
-       | i*86-* | i860-* | i960-* | ia64-* \
-       | m32r-* \
-       | m68000-* | m680[012346]0-* | m68360-* | m683?2-* | m68k-* \
-       | m88110-* | m88k-* | mcore-* \
-       | mips-* | mips16-* | mips64-* | mips64el-* | mips64orion-* \
-       | mips64orionel-* | mips64vr4100-* | mips64vr4100el-* \
-       | mips64vr4300-* | mips64vr4300el-* | mipsbe-* | mipseb-* \
-       | mipsle-* | mipsel-* | mipstx39-* | mipstx39el-* \
-       | none-* | np1-* | ns16k-* | ns32k-* \
-       | orion-* \
-       | pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \
-       | powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* | ppcbe-* \
-       | pyramid-* \
-       | romp-* | rs6000-* \
-       | sh-* | sh[34]-* | sh[34]eb-* | shbe-* | shle-* | sh64-* \
-       | sparc-* | sparc64-* | sparc86x-* | sparclet-* | sparclite-* \
-       | sparcv9-* | sparcv9b-* | strongarm-* | sv1-* | sx?-* \
-       | tahoe-* | thumb-* | tic30-* | tic54x-* | tic80-* | tron-* \
-       | v850-* | v850e-* | vax-* \
-       | we32k-* \
-       | x86-* | x86_64-* | xps100-* | xscale-* | xstormy16-* \
-       | xtensa-* \
-       | ymp-* \
-       | z8k-*)
-               ;;
-       # Recognize the various machine names and aliases which stand
-       # for a CPU type and a company and sometimes even an OS.
-       386bsd)
-               basic_machine=i386-unknown
-               os=-bsd
-               ;;
-       3b1 | 7300 | 7300-att | att-7300 | pc7300 | safari | unixpc)
-               basic_machine=m68000-att
-               ;;
-       3b*)
-               basic_machine=we32k-att
-               ;;
-       a29khif)
-               basic_machine=a29k-amd
-               os=-udi
-               ;;
-       adobe68k)
-               basic_machine=m68010-adobe
-               os=-scout
-               ;;
-       alliant | fx80)
-               basic_machine=fx80-alliant
-               ;;
-       altos | altos3068)
-               basic_machine=m68k-altos
-               ;;
-       am29k)
-               basic_machine=a29k-none
-               os=-bsd
-               ;;
-       amdahl)
-               basic_machine=580-amdahl
-               os=-sysv
-               ;;
-       amiga | amiga-*)
-               basic_machine=m68k-unknown
-               ;;
-       amigaos | amigados)
-               basic_machine=m68k-unknown
-               os=-amigaos
-               ;;
-       amigaunix | amix)
-               basic_machine=m68k-unknown
-               os=-sysv4
-               ;;
-       apollo68)
-               basic_machine=m68k-apollo
-               os=-sysv
-               ;;
-       apollo68bsd)
-               basic_machine=m68k-apollo
-               os=-bsd
-               ;;
-       aux)
-               basic_machine=m68k-apple
-               os=-aux
-               ;;
-       balance)
-               basic_machine=ns32k-sequent
-               os=-dynix
-               ;;
-       c90)
-               basic_machine=c90-cray
-               os=-unicos
-               ;;
-       convex-c1)
-               basic_machine=c1-convex
-               os=-bsd
-               ;;
-       convex-c2)
-               basic_machine=c2-convex
-               os=-bsd
-               ;;
-       convex-c32)
-               basic_machine=c32-convex
-               os=-bsd
-               ;;
-       convex-c34)
-               basic_machine=c34-convex
-               os=-bsd
-               ;;
-       convex-c38)
-               basic_machine=c38-convex
-               os=-bsd
-               ;;
-       cray | j90)
-               basic_machine=j90-cray
-               os=-unicos
-               ;;
-       crds | unos)
-               basic_machine=m68k-crds
-               ;;
-       cris | cris-* | etrax*)
-               basic_machine=cris-axis
-               ;;
-       da30 | da30-*)
-               basic_machine=m68k-da30
-               ;;
-       decstation | decstation-3100 | pmax | pmax-* | pmin | dec3100 | decstatn)
-               basic_machine=mips-dec
-               ;;
-       decsystem10* | dec10*)
-               basic_machine=pdp10-dec
-               os=-tops10
-               ;;
-       decsystem20* | dec20*)
-               basic_machine=pdp10-dec
-               os=-tops20
-               ;;
-       delta | 3300 | motorola-3300 | motorola-delta \
-             | 3300-motorola | delta-motorola)
-               basic_machine=m68k-motorola
-               ;;
-       delta88)
-               basic_machine=m88k-motorola
-               os=-sysv3
-               ;;
-       dpx20 | dpx20-*)
-               basic_machine=rs6000-bull
-               os=-bosx
-               ;;
-       dpx2* | dpx2*-bull)
-               basic_machine=m68k-bull
-               os=-sysv3
-               ;;
-       ebmon29k)
-               basic_machine=a29k-amd
-               os=-ebmon
-               ;;
-       elxsi)
-               basic_machine=elxsi-elxsi
-               os=-bsd
-               ;;
-       encore | umax | mmax)
-               basic_machine=ns32k-encore
-               ;;
-       es1800 | OSE68k | ose68k | ose | OSE)
-               basic_machine=m68k-ericsson
-               os=-ose
-               ;;
-       fx2800)
-               basic_machine=i860-alliant
-               ;;
-       genix)
-               basic_machine=ns32k-ns
-               ;;
-       gmicro)
-               basic_machine=tron-gmicro
-               os=-sysv
-               ;;
-       go32)
-               basic_machine=i386-pc
-               os=-go32
-               ;;
-       h3050r* | hiux*)
-               basic_machine=hppa1.1-hitachi
-               os=-hiuxwe2
-               ;;
-       h8300hms)
-               basic_machine=h8300-hitachi
-               os=-hms
-               ;;
-       h8300xray)
-               basic_machine=h8300-hitachi
-               os=-xray
-               ;;
-       h8500hms)
-               basic_machine=h8500-hitachi
-               os=-hms
-               ;;
-       harris)
-               basic_machine=m88k-harris
-               os=-sysv3
-               ;;
-       hp300-*)
-               basic_machine=m68k-hp
-               ;;
-       hp300bsd)
-               basic_machine=m68k-hp
-               os=-bsd
-               ;;
-       hp300hpux)
-               basic_machine=m68k-hp
-               os=-hpux
-               ;;
-       hp3k9[0-9][0-9] | hp9[0-9][0-9])
-               basic_machine=hppa1.0-hp
-               ;;
-       hp9k2[0-9][0-9] | hp9k31[0-9])
-               basic_machine=m68000-hp
-               ;;
-       hp9k3[2-9][0-9])
-               basic_machine=m68k-hp
-               ;;
-       hp9k6[0-9][0-9] | hp6[0-9][0-9])
-               basic_machine=hppa1.0-hp
-               ;;
-       hp9k7[0-79][0-9] | hp7[0-79][0-9])
-               basic_machine=hppa1.1-hp
-               ;;
-       hp9k78[0-9] | hp78[0-9])
-               # FIXME: really hppa2.0-hp
-               basic_machine=hppa1.1-hp
-               ;;
-       hp9k8[67]1 | hp8[67]1 | hp9k80[24] | hp80[24] | hp9k8[78]9 | hp8[78]9 | hp9k893 | hp893)
-               # FIXME: really hppa2.0-hp
-               basic_machine=hppa1.1-hp
-               ;;
-       hp9k8[0-9][13679] | hp8[0-9][13679])
-               basic_machine=hppa1.1-hp
-               ;;
-       hp9k8[0-9][0-9] | hp8[0-9][0-9])
-               basic_machine=hppa1.0-hp
-               ;;
-       hppa-next)
-               os=-nextstep3
-               ;;
-       hppaosf)
-               basic_machine=hppa1.1-hp
-               os=-osf
-               ;;
-       hppro)
-               basic_machine=hppa1.1-hp
-               os=-proelf
-               ;;
-       i370-ibm* | ibm*)
-               basic_machine=i370-ibm
-               ;;
-# I'm not sure what "Sysv32" means.  Should this be sysv3.2?
-       i*86v32)
-               basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
-               os=-sysv32
-               ;;
-       i*86v4*)
-               basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
-               os=-sysv4
-               ;;
-       i*86v)
-               basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
-               os=-sysv
-               ;;
-       i*86sol2)
-               basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
-               os=-solaris2
-               ;;
-       i386mach)
-               basic_machine=i386-mach
-               os=-mach
-               ;;
-       i386-vsta | vsta)
-               basic_machine=i386-unknown
-               os=-vsta
-               ;;
-       iris | iris4d)
-               basic_machine=mips-sgi
-               case $os in
-                   -irix*)
-                       ;;
-                   *)
-                       os=-irix4
-                       ;;
-               esac
-               ;;
-       isi68 | isi)
-               basic_machine=m68k-isi
-               os=-sysv
-               ;;
-       m88k-omron*)
-               basic_machine=m88k-omron
-               ;;
-       magnum | m3230)
-               basic_machine=mips-mips
-               os=-sysv
-               ;;
-       merlin)
-               basic_machine=ns32k-utek
-               os=-sysv
-               ;;
-       mingw32)
-               basic_machine=i386-pc
-               os=-mingw32
-               ;;
-       miniframe)
-               basic_machine=m68000-convergent
-               ;;
-       *mint | -mint[0-9]* | *MiNT | *MiNT[0-9]*)
-               basic_machine=m68k-atari
-               os=-mint
-               ;;
-       mips3*-*)
-               basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`
-               ;;
-       mips3*)
-               basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`-unknown
-               ;;
-       mmix*)
-               basic_machine=mmix-knuth
-               os=-mmixware
-               ;;
-       monitor)
-               basic_machine=m68k-rom68k
-               os=-coff
-               ;;
-       morphos)
-               basic_machine=powerpc-unknown
-               os=-morphos
-               ;;
-       msdos)
-               basic_machine=i386-pc
-               os=-msdos
-               ;;
-       mvs)
-               basic_machine=i370-ibm
-               os=-mvs
-               ;;
-       ncr3000)
-               basic_machine=i486-ncr
-               os=-sysv4
-               ;;
-       netbsd386)
-               basic_machine=i386-unknown
-               os=-netbsd
-               ;;
-       netwinder)
-               basic_machine=armv4l-rebel
-               os=-linux
-               ;;
-       news | news700 | news800 | news900)
-               basic_machine=m68k-sony
-               os=-newsos
-               ;;
-       news1000)
-               basic_machine=m68030-sony
-               os=-newsos
-               ;;
-       news-3600 | risc-news)
-               basic_machine=mips-sony
-               os=-newsos
-               ;;
-       necv70)
-               basic_machine=v70-nec
-               os=-sysv
-               ;;
-       next | m*-next )
-               basic_machine=m68k-next
-               case $os in
-                   -nextstep* )
-                       ;;
-                   -ns2*)
-                     os=-nextstep2
-                       ;;
-                   *)
-                     os=-nextstep3
-                       ;;
-               esac
-               ;;
-       nh3000)
-               basic_machine=m68k-harris
-               os=-cxux
-               ;;
-       nh[45]000)
-               basic_machine=m88k-harris
-               os=-cxux
-               ;;
-       nindy960)
-               basic_machine=i960-intel
-               os=-nindy
-               ;;
-       mon960)
-               basic_machine=i960-intel
-               os=-mon960
-               ;;
-       nonstopux)
-               basic_machine=mips-compaq
-               os=-nonstopux
-               ;;
-       np1)
-               basic_machine=np1-gould
-               ;;
-       nsr-tandem)
-               basic_machine=nsr-tandem
-               ;;
-       op50n-* | op60c-*)
-               basic_machine=hppa1.1-oki
-               os=-proelf
-               ;;
-       or32 | or32-*)
-               basic_machine=or32-unknown
-               os=-coff
-               ;;
-       OSE68000 | ose68000)
-               basic_machine=m68000-ericsson
-               os=-ose
-               ;;
-       os68k)
-               basic_machine=m68k-none
-               os=-os68k
-               ;;
-       pa-hitachi)
-               basic_machine=hppa1.1-hitachi
-               os=-hiuxwe2
-               ;;
-       paragon)
-               basic_machine=i860-intel
-               os=-osf
-               ;;
-       pbd)
-               basic_machine=sparc-tti
-               ;;
-       pbb)
-               basic_machine=m68k-tti
-               ;;
-        pc532 | pc532-*)
-               basic_machine=ns32k-pc532
-               ;;
-       pentium | p5 | k5 | k6 | nexgen | viac3)
-               basic_machine=i586-pc
-               ;;
-       pentiumpro | p6 | 6x86 | athlon)
-               basic_machine=i686-pc
-               ;;
-       pentiumii | pentium2)
-               basic_machine=i686-pc
-               ;;
-       pentium-* | p5-* | k5-* | k6-* | nexgen-* | viac3-*)
-               basic_machine=i586-`echo $basic_machine | sed 's/^[^-]*-//'`
-               ;;
-       pentiumpro-* | p6-* | 6x86-* | athlon-*)
-               basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'`
-               ;;
-       pentiumii-* | pentium2-*)
-               basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'`
-               ;;
-       pn)
-               basic_machine=pn-gould
-               ;;
-       power)  basic_machine=power-ibm
-               ;;
-       ppc)    basic_machine=powerpc-unknown
-               ;;
-       ppc-*)  basic_machine=powerpc-`echo $basic_machine | sed 's/^[^-]*-//'`
-               ;;
-       ppcle | powerpclittle | ppc-le | powerpc-little)
-               basic_machine=powerpcle-unknown
-               ;;
-       ppcle-* | powerpclittle-*)
-               basic_machine=powerpcle-`echo $basic_machine | sed 's/^[^-]*-//'`
-               ;;
-       ppc64)  basic_machine=powerpc64-unknown
-               ;;
-       ppc64-*) basic_machine=powerpc64-`echo $basic_machine | sed 's/^[^-]*-//'`
-               ;;
-       ppc64le | powerpc64little | ppc64-le | powerpc64-little)
-               basic_machine=powerpc64le-unknown
-               ;;
-       ppc64le-* | powerpc64little-*)
-               basic_machine=powerpc64le-`echo $basic_machine | sed 's/^[^-]*-//'`
-               ;;
-       ps2)
-               basic_machine=i386-ibm
-               ;;
-       pw32)
-               basic_machine=i586-unknown
-               os=-pw32
-               ;;
-       rom68k)
-               basic_machine=m68k-rom68k
-               os=-coff
-               ;;
-       rm[46]00)
-               basic_machine=mips-siemens
-               ;;
-       rtpc | rtpc-*)
-               basic_machine=romp-ibm
-               ;;
-       s390 | s390-*)
-               basic_machine=s390-ibm
-               ;;
-       s390x | s390x-*)
-               basic_machine=s390x-ibm
-               ;;
-       sa29200)
-               basic_machine=a29k-amd
-               os=-udi
-               ;;
-       sequent)
-               basic_machine=i386-sequent
-               ;;
-       sh)
-               basic_machine=sh-hitachi
-               os=-hms
-               ;;
-       sparclite-wrs | simso-wrs)
-               basic_machine=sparclite-wrs
-               os=-vxworks
-               ;;
-       sps7)
-               basic_machine=m68k-bull
-               os=-sysv2
-               ;;
-       spur)
-               basic_machine=spur-unknown
-               ;;
-       st2000)
-               basic_machine=m68k-tandem
-               ;;
-       stratus)
-               basic_machine=i860-stratus
-               os=-sysv4
-               ;;
-       sun2)
-               basic_machine=m68000-sun
-               ;;
-       sun2os3)
-               basic_machine=m68000-sun
-               os=-sunos3
-               ;;
-       sun2os4)
-               basic_machine=m68000-sun
-               os=-sunos4
-               ;;
-       sun3os3)
-               basic_machine=m68k-sun
-               os=-sunos3
-               ;;
-       sun3os4)
-               basic_machine=m68k-sun
-               os=-sunos4
-               ;;
-       sun4os3)
-               basic_machine=sparc-sun
-               os=-sunos3
-               ;;
-       sun4os4)
-               basic_machine=sparc-sun
-               os=-sunos4
-               ;;
-       sun4sol2)
-               basic_machine=sparc-sun
-               os=-solaris2
-               ;;
-       sun3 | sun3-*)
-               basic_machine=m68k-sun
-               ;;
-       sun4)
-               basic_machine=sparc-sun
-               ;;
-       sun386 | sun386i | roadrunner)
-               basic_machine=i386-sun
-               ;;
-        sv1)
-               basic_machine=sv1-cray
-               os=-unicos
-               ;;
-       symmetry)
-               basic_machine=i386-sequent
-               os=-dynix
-               ;;
-       t3d)
-               basic_machine=alpha-cray
-               os=-unicos
-               ;;
-       t3e)
-               basic_machine=alphaev5-cray
-               os=-unicos
-               ;;
-       t90)
-               basic_machine=t90-cray
-               os=-unicos
-               ;;
-       tic54x | c54x*)
-               basic_machine=tic54x-unknown
-               os=-coff
-               ;;
-       tx39)
-               basic_machine=mipstx39-unknown
-               ;;
-       tx39el)
-               basic_machine=mipstx39el-unknown
-               ;;
-       toad1)
-               basic_machine=pdp10-xkl
-               os=-tops20
-               ;;
-       tower | tower-32)
-               basic_machine=m68k-ncr
-               ;;
-       udi29k)
-               basic_machine=a29k-amd
-               os=-udi
-               ;;
-       ultra3)
-               basic_machine=a29k-nyu
-               os=-sym1
-               ;;
-       v810 | necv810)
-               basic_machine=v810-nec
-               os=-none
-               ;;
-       vaxv)
-               basic_machine=vax-dec
-               os=-sysv
-               ;;
-       vms)
-               basic_machine=vax-dec
-               os=-vms
-               ;;
-       vpp*|vx|vx-*)
-               basic_machine=f301-fujitsu
-               ;;
-       vxworks960)
-               basic_machine=i960-wrs
-               os=-vxworks
-               ;;
-       vxworks68)
-               basic_machine=m68k-wrs
-               os=-vxworks
-               ;;
-       vxworks29k)
-               basic_machine=a29k-wrs
-               os=-vxworks
-               ;;
-       w65*)
-               basic_machine=w65-wdc
-               os=-none
-               ;;
-       w89k-*)
-               basic_machine=hppa1.1-winbond
-               os=-proelf
-               ;;
-       windows32)
-               basic_machine=i386-pc
-               os=-windows32-msvcrt
-               ;;
-        xps | xps100)
-               basic_machine=xps100-honeywell
-               ;;
-       ymp)
-               basic_machine=ymp-cray
-               os=-unicos
-               ;;
-       z8k-*-coff)
-               basic_machine=z8k-unknown
-               os=-sim
-               ;;
-       none)
-               basic_machine=none-none
-               os=-none
-               ;;
-
-# Here we handle the default manufacturer of certain CPU types.  It is in
-# some cases the only manufacturer, in others, it is the most popular.
-       w89k)
-               basic_machine=hppa1.1-winbond
-               ;;
-       op50n)
-               basic_machine=hppa1.1-oki
-               ;;
-       op60c)
-               basic_machine=hppa1.1-oki
-               ;;
-       romp)
-               basic_machine=romp-ibm
-               ;;
-       rs6000)
-               basic_machine=rs6000-ibm
-               ;;
-       vax)
-               basic_machine=vax-dec
-               ;;
-       pdp10)
-               # there are many clones, so DEC is not a safe bet
-               basic_machine=pdp10-unknown
-               ;;
-       pdp11)
-               basic_machine=pdp11-dec
-               ;;
-       we32k)
-               basic_machine=we32k-att
-               ;;
-       sh3 | sh4 | sh3eb | sh4eb)
-               basic_machine=sh-unknown
-               ;;
-       sh64)
-               basic_machine=sh64-unknown
-               ;;
-       sparc | sparcv9 | sparcv9b)
-               basic_machine=sparc-sun
-               ;;
-        cydra)
-               basic_machine=cydra-cydrome
-               ;;
-       orion)
-               basic_machine=orion-highlevel
-               ;;
-       orion105)
-               basic_machine=clipper-highlevel
-               ;;
-       mac | mpw | mac-mpw)
-               basic_machine=m68k-apple
-               ;;
-       pmac | pmac-mpw)
-               basic_machine=powerpc-apple
-               ;;
-       c4x*)
-               basic_machine=c4x-none
-               os=-coff
-               ;;
-       *-unknown)
-               # Make sure to match an already-canonicalized machine name.
-               ;;
-       *)
-               echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2
-               exit 1
-               ;;
-esac
-
-# Here we canonicalize certain aliases for manufacturers.
-case $basic_machine in
-       *-digital*)
-               basic_machine=`echo $basic_machine | sed 's/digital.*/dec/'`
-               ;;
-       *-commodore*)
-               basic_machine=`echo $basic_machine | sed 's/commodore.*/cbm/'`
-               ;;
-       *)
-               ;;
-esac
-
-# Decode manufacturer-specific aliases for certain operating systems.
-
-if [ x"$os" != x"" ]
-then
-case $os in
-        # First match some system type aliases
-        # that might get confused with valid system types.
-       # -solaris* is a basic system type, with this one exception.
-       -solaris1 | -solaris1.*)
-               os=`echo $os | sed -e 's|solaris1|sunos4|'`
-               ;;
-       -solaris)
-               os=-solaris2
-               ;;
-       -svr4*)
-               os=-sysv4
-               ;;
-       -unixware*)
-               os=-sysv4.2uw
-               ;;
-       -gnu/linux*)
-               os=`echo $os | sed -e 's|gnu/linux|linux-gnu|'`
-               ;;
-       # First accept the basic system types.
-       # The portable systems comes first.
-       # Each alternative MUST END IN A *, to match a version number.
-       # -sysv* is not here because it comes later, after sysvr4.
-       -gnu* | -bsd* | -mach* | -minix* | -genix* | -ultrix* | -irix* \
-             | -*vms* | -sco* | -esix* | -isc* | -aix* | -sunos | -sunos[34]*\
-             | -hpux* | -unos* | -osf* | -luna* | -dgux* | -solaris* | -sym* \
-             | -amigaos* | -amigados* | -msdos* | -newsos* | -unicos* | -aof* \
-             | -aos* \
-             | -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \
-             | -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \
-             | -hiux* | -386bsd* | -netbsd* | -openbsd* | -freebsd* | -riscix* \
-             | -lynxos* | -bosx* | -nextstep* | -cxux* | -aout* | -elf* | -oabi* \
-             | -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \
-             | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \
-             | -chorusos* | -chorusrdb* \
-             | -cygwin* | -pe* | -psos* | -moss* | -proelf* | -rtems* \
-             | -mingw32* | -linux-gnu* | -uxpv* | -beos* | -mpeix* | -udk* \
-             | -interix* | -uwin* | -rhapsody* | -darwin* | -opened* \
-             | -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \
-             | -storm-chaos* | -tops10* | -tenex* | -tops20* | -its* \
-             | -os2* | -vos* | -palmos* | -uclinux* | -nucleus* \
-             | -morphos* | -superux* | -rtmk* | -rtmk-nova*)
-       # Remember, each alternative MUST END IN *, to match a version number.
-               ;;
-       -qnx*)
-               case $basic_machine in
-                   x86-* | i*86-*)
-                       ;;
-                   *)
-                       os=-nto$os
-                       ;;
-               esac
-               ;;
-       -nto*)
-               os=-nto-qnx
-               ;;
-       -sim | -es1800* | -hms* | -xray | -os68k* | -none* | -v88r* \
-             | -windows* | -osx | -abug | -netware* | -os9* | -beos* \
-             | -macos* | -mpw* | -magic* | -mmixware* | -mon960* | -lnews*)
-               ;;
-       -mac*)
-               os=`echo $os | sed -e 's|mac|macos|'`
-               ;;
-       -linux*)
-               os=`echo $os | sed -e 's|linux|linux-gnu|'`
-               ;;
-       -sunos5*)
-               os=`echo $os | sed -e 's|sunos5|solaris2|'`
-               ;;
-       -sunos6*)
-               os=`echo $os | sed -e 's|sunos6|solaris3|'`
-               ;;
-       -opened*)
-               os=-openedition
-               ;;
-       -wince*)
-               os=-wince
-               ;;
-       -osfrose*)
-               os=-osfrose
-               ;;
-       -osf*)
-               os=-osf
-               ;;
-       -utek*)
-               os=-bsd
-               ;;
-       -dynix*)
-               os=-bsd
-               ;;
-       -acis*)
-               os=-aos
-               ;;
-       -atheos*)
-               os=-atheos
-               ;;
-       -386bsd)
-               os=-bsd
-               ;;
-       -ctix* | -uts*)
-               os=-sysv
-               ;;
-       -nova*)
-               os=-rtmk-nova
-               ;;
-       -ns2 )
-               os=-nextstep2
-               ;;
-       -nsk*)
-               os=-nsk
-               ;;
-       # Preserve the version number of sinix5.
-       -sinix5.*)
-               os=`echo $os | sed -e 's|sinix|sysv|'`
-               ;;
-       -sinix*)
-               os=-sysv4
-               ;;
-       -triton*)
-               os=-sysv3
-               ;;
-       -oss*)
-               os=-sysv3
-               ;;
-       -svr4)
-               os=-sysv4
-               ;;
-       -svr3)
-               os=-sysv3
-               ;;
-       -sysvr4)
-               os=-sysv4
-               ;;
-       # This must come after -sysvr4.
-       -sysv*)
-               ;;
-       -ose*)
-               os=-ose
-               ;;
-       -es1800*)
-               os=-ose
-               ;;
-       -xenix)
-               os=-xenix
-               ;;
-        -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*)
-               os=-mint
-               ;;
-       -none)
-               ;;
-       *)
-               # Get rid of the `-' at the beginning of $os.
-               os=`echo $os | sed 's/[^-]*-//'`
-               echo Invalid configuration \`$1\': system \`$os\' not recognized 1>&2
-               exit 1
-               ;;
-esac
-else
-
-# Here we handle the default operating systems that come with various machines.
-# The value should be what the vendor currently ships out the door with their
-# machine or put another way, the most popular os provided with the machine.
-
-# Note that if you're going to try to match "-MANUFACTURER" here (say,
-# "-sun"), then you have to tell the case statement up towards the top
-# that MANUFACTURER isn't an operating system.  Otherwise, code above
-# will signal an error saying that MANUFACTURER isn't an operating
-# system, and we'll never get to this point.
-
-case $basic_machine in
-       *-acorn)
-               os=-riscix1.2
-               ;;
-       arm*-rebel)
-               os=-linux
-               ;;
-       arm*-semi)
-               os=-aout
-               ;;
-       # This must come before the *-dec entry.
-       pdp10-*)
-               os=-tops20
-               ;;
-        pdp11-*)
-               os=-none
-               ;;
-       *-dec | vax-*)
-               os=-ultrix4.2
-               ;;
-       m68*-apollo)
-               os=-domain
-               ;;
-       i386-sun)
-               os=-sunos4.0.2
-               ;;
-       m68000-sun)
-               os=-sunos3
-               # This also exists in the configure program, but was not the
-               # default.
-               # os=-sunos4
-               ;;
-       m68*-cisco)
-               os=-aout
-               ;;
-       mips*-cisco)
-               os=-elf
-               ;;
-       mips*-*)
-               os=-elf
-               ;;
-       or32-*)
-               os=-coff
-               ;;
-       *-tti)  # must be before sparc entry or we get the wrong os.
-               os=-sysv3
-               ;;
-       sparc-* | *-sun)
-               os=-sunos4.1.1
-               ;;
-       *-be)
-               os=-beos
-               ;;
-       *-ibm)
-               os=-aix
-               ;;
-       *-wec)
-               os=-proelf
-               ;;
-       *-winbond)
-               os=-proelf
-               ;;
-       *-oki)
-               os=-proelf
-               ;;
-       *-hp)
-               os=-hpux
-               ;;
-       *-hitachi)
-               os=-hiux
-               ;;
-       i860-* | *-att | *-ncr | *-altos | *-motorola | *-convergent)
-               os=-sysv
-               ;;
-       *-cbm)
-               os=-amigaos
-               ;;
-       *-dg)
-               os=-dgux
-               ;;
-       *-dolphin)
-               os=-sysv3
-               ;;
-       m68k-ccur)
-               os=-rtu
-               ;;
-       m88k-omron*)
-               os=-luna
-               ;;
-       *-next )
-               os=-nextstep
-               ;;
-       *-sequent)
-               os=-ptx
-               ;;
-       *-crds)
-               os=-unos
-               ;;
-       *-ns)
-               os=-genix
-               ;;
-       i370-*)
-               os=-mvs
-               ;;
-       *-next)
-               os=-nextstep3
-               ;;
-        *-gould)
-               os=-sysv
-               ;;
-        *-highlevel)
-               os=-bsd
-               ;;
-       *-encore)
-               os=-bsd
-               ;;
-        *-sgi)
-               os=-irix
-               ;;
-        *-siemens)
-               os=-sysv4
-               ;;
-       *-masscomp)
-               os=-rtu
-               ;;
-       f30[01]-fujitsu | f700-fujitsu)
-               os=-uxpv
-               ;;
-       *-rom68k)
-               os=-coff
-               ;;
-       *-*bug)
-               os=-coff
-               ;;
-       *-apple)
-               os=-macos
-               ;;
-       *-atari*)
-               os=-mint
-               ;;
-       *)
-               os=-none
-               ;;
-esac
-fi
-
-# Here we handle the case where we know the os, and the CPU type, but not the
-# manufacturer.  We pick the logical manufacturer.
-vendor=unknown
-case $basic_machine in
-       *-unknown)
-               case $os in
-                       -riscix*)
-                               vendor=acorn
-                               ;;
-                       -sunos*)
-                               vendor=sun
-                               ;;
-                       -aix*)
-                               vendor=ibm
-                               ;;
-                       -beos*)
-                               vendor=be
-                               ;;
-                       -hpux*)
-                               vendor=hp
-                               ;;
-                       -mpeix*)
-                               vendor=hp
-                               ;;
-                       -hiux*)
-                               vendor=hitachi
-                               ;;
-                       -unos*)
-                               vendor=crds
-                               ;;
-                       -dgux*)
-                               vendor=dg
-                               ;;
-                       -luna*)
-                               vendor=omron
-                               ;;
-                       -genix*)
-                               vendor=ns
-                               ;;
-                       -mvs* | -opened*)
-                               vendor=ibm
-                               ;;
-                       -ptx*)
-                               vendor=sequent
-                               ;;
-                       -vxsim* | -vxworks*)
-                               vendor=wrs
-                               ;;
-                       -aux*)
-                               vendor=apple
-                               ;;
-                       -hms*)
-                               vendor=hitachi
-                               ;;
-                       -mpw* | -macos*)
-                               vendor=apple
-                               ;;
-                       -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*)
-                               vendor=atari
-                               ;;
-                       -vos*)
-                               vendor=stratus
-                               ;;
-               esac
-               basic_machine=`echo $basic_machine | sed "s/unknown/$vendor/"`
-               ;;
-esac
-
-echo $basic_machine$os
-exit 0
-
-# Local variables:
-# eval: (add-hook 'write-file-hooks 'time-stamp)
-# time-stamp-start: "timestamp='"
-# time-stamp-format: "%:y-%02m-%02d"
-# time-stamp-end: "'"
-# End:
diff --git a/src/nws_portability/configure b/src/nws_portability/configure
deleted file mode 100755 (executable)
index 1ac4ddf..0000000
+++ /dev/null
@@ -1,2684 +0,0 @@
-#! /bin/sh
-
-# Guess values for system-dependent variables and create Makefiles.
-# Generated automatically using autoconf version 2.13 
-# Copyright (C) 1992, 93, 94, 95, 96 Free Software Foundation, Inc.
-#
-# This configure script is free software; the Free Software Foundation
-# gives unlimited permission to copy, distribute and modify it.
-
-# Defaults:
-ac_help=
-ac_default_prefix=/usr/local
-# Any additions from configure.in:
-ac_help="$ac_help
-  --enable-debug         include debugging info when compiling"
-ac_help="$ac_help
-  --enable-threads        test for threads support"
-ac_help="$ac_help
-  --disable-sigalarm        don't use SIGALRM"
-
-# Initialize some variables set by options.
-# The variables have the same names as the options, with
-# dashes changed to underlines.
-build=NONE
-cache_file=./config.cache
-exec_prefix=NONE
-host=NONE
-no_create=
-nonopt=NONE
-no_recursion=
-prefix=NONE
-program_prefix=NONE
-program_suffix=NONE
-program_transform_name=s,x,x,
-silent=
-site=
-srcdir=
-target=NONE
-verbose=
-x_includes=NONE
-x_libraries=NONE
-bindir='${exec_prefix}/bin'
-sbindir='${exec_prefix}/sbin'
-libexecdir='${exec_prefix}/libexec'
-datadir='${prefix}/share'
-sysconfdir='${prefix}/etc'
-sharedstatedir='${prefix}/com'
-localstatedir='${prefix}/var'
-libdir='${exec_prefix}/lib'
-includedir='${prefix}/include'
-oldincludedir='/usr/include'
-infodir='${prefix}/info'
-mandir='${prefix}/man'
-
-# Initialize some other variables.
-subdirs=
-MFLAGS= MAKEFLAGS=
-SHELL=${CONFIG_SHELL-/bin/sh}
-# Maximum number of lines to put in a shell here document.
-ac_max_here_lines=12
-
-ac_prev=
-for ac_option
-do
-
-  # If the previous option needs an argument, assign it.
-  if test -n "$ac_prev"; then
-    eval "$ac_prev=\$ac_option"
-    ac_prev=
-    continue
-  fi
-
-  case "$ac_option" in
-  -*=*) ac_optarg=`echo "$ac_option" | sed 's/[-_a-zA-Z0-9]*=//'` ;;
-  *) ac_optarg= ;;
-  esac
-
-  # Accept the important Cygnus configure options, so we can diagnose typos.
-
-  case "$ac_option" in
-
-  -bindir | --bindir | --bindi | --bind | --bin | --bi)
-    ac_prev=bindir ;;
-  -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*)
-    bindir="$ac_optarg" ;;
-
-  -build | --build | --buil | --bui | --bu)
-    ac_prev=build ;;
-  -build=* | --build=* | --buil=* | --bui=* | --bu=*)
-    build="$ac_optarg" ;;
-
-  -cache-file | --cache-file | --cache-fil | --cache-fi \
-  | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c)
-    ac_prev=cache_file ;;
-  -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \
-  | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*)
-    cache_file="$ac_optarg" ;;
-
-  -datadir | --datadir | --datadi | --datad | --data | --dat | --da)
-    ac_prev=datadir ;;
-  -datadir=* | --datadir=* | --datadi=* | --datad=* | --data=* | --dat=* \
-  | --da=*)
-    datadir="$ac_optarg" ;;
-
-  -disable-* | --disable-*)
-    ac_feature=`echo $ac_option|sed -e 's/-*disable-//'`
-    # Reject names that are not valid shell variable names.
-    if test -n "`echo $ac_feature| sed 's/[-a-zA-Z0-9_]//g'`"; then
-      { echo "configure: error: $ac_feature: invalid feature name" 1>&2; exit 1; }
-    fi
-    ac_feature=`echo $ac_feature| sed 's/-/_/g'`
-    eval "enable_${ac_feature}=no" ;;
-
-  -enable-* | --enable-*)
-    ac_feature=`echo $ac_option|sed -e 's/-*enable-//' -e 's/=.*//'`
-    # Reject names that are not valid shell variable names.
-    if test -n "`echo $ac_feature| sed 's/[-_a-zA-Z0-9]//g'`"; then
-      { echo "configure: error: $ac_feature: invalid feature name" 1>&2; exit 1; }
-    fi
-    ac_feature=`echo $ac_feature| sed 's/-/_/g'`
-    case "$ac_option" in
-      *=*) ;;
-      *) ac_optarg=yes ;;
-    esac
-    eval "enable_${ac_feature}='$ac_optarg'" ;;
-
-  -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \
-  | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \
-  | --exec | --exe | --ex)
-    ac_prev=exec_prefix ;;
-  -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \
-  | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \
-  | --exec=* | --exe=* | --ex=*)
-    exec_prefix="$ac_optarg" ;;
-
-  -gas | --gas | --ga | --g)
-    # Obsolete; use --with-gas.
-    with_gas=yes ;;
-
-  -help | --help | --hel | --he)
-    # Omit some internal or obsolete options to make the list less imposing.
-    # This message is too long to be a string in the A/UX 3.1 sh.
-    cat << EOF
-Usage: configure [options] [host]
-Options: [defaults in brackets after descriptions]
-Configuration:
-  --cache-file=FILE       cache test results in FILE
-  --help                  print this message
-  --no-create             do not create output files
-  --quiet, --silent       do not print \`checking...' messages
-  --version               print the version of autoconf that created configure
-Directory and file names:
-  --prefix=PREFIX         install architecture-independent files in PREFIX
-                          [$ac_default_prefix]
-  --exec-prefix=EPREFIX   install architecture-dependent files in EPREFIX
-                          [same as prefix]
-  --bindir=DIR            user executables in DIR [EPREFIX/bin]
-  --sbindir=DIR           system admin executables in DIR [EPREFIX/sbin]
-  --libexecdir=DIR        program executables in DIR [EPREFIX/libexec]
-  --datadir=DIR           read-only architecture-independent data in DIR
-                          [PREFIX/share]
-  --sysconfdir=DIR        read-only single-machine data&nbs