diff -Nru libdap-3.11.1/AlarmHandler.h libdap-3.12.0/AlarmHandler.h --- libdap-3.11.1/AlarmHandler.h 2011-04-29 13:19:43.000000000 +0000 +++ libdap-3.12.0/AlarmHandler.h 2013-10-17 21:27:40.000000000 +0000 @@ -19,7 +19,7 @@ // // You should have received a copy of the GNU Lesser General Public // License along with this library; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA // // You can contact OPeNDAP, Inc. at PO Box 112, Saunderstown, RI. 02874-0112. @@ -32,8 +32,6 @@ #include "EventHandler.h" -#define FILE_METHODS 1 - namespace libdap { @@ -47,40 +45,27 @@ class AlarmHandler : public EventHandler { private: -#if FILE_METHODS FILE *d_file; // Sink for the Error object. -#endif ostream &d_stream; string d_version; // Ensure that d_stream gets initialized... - AlarmHandler() : -#if FILE_METHODS - d_file( 0 ), -#endif - d_stream( cout ) + AlarmHandler() : d_file( 0 ), d_stream( cout ) {} public: -#if FILE_METHODS AlarmHandler(FILE *s) : d_file(s), d_stream( cout ) {} -#endif + /** Store information to be used by the handler. @param out Write to this stream. */ - AlarmHandler(ostream &out) : -#if FILE_METHODS - d_file(0), -#endif - d_stream( out ) + AlarmHandler(ostream &out) : d_file(0), d_stream( out ) {} virtual ~AlarmHandler() { -#if FILE_METHODS if( d_file ) fclose( d_file ) ; -#endif } /** Handle an alarm signal. When one of our servers gets an alarm, that @@ -89,8 +74,7 @@ has been reached. Because this is a signal handler, it should call only reentrant - system services, functions, et cetera. Generally that eliminates - stdio functions but I'm using them anyway. This handler never returns + system services, functions, et cetera. This handler never returns to the code that was running when the alarm signal was raised. @param signum We know it is SIGALRM; here as a check @@ -98,8 +82,9 @@ virtual void handle_signal(int signum) { if (signum != SIGALRM) - fprintf(stderr, "SIGALRM handler caught another signal!\n"); - exit(1); + throw Error("SIGALRM handler caught another signal!"); + + throw Error("Timeout"); } }; diff -Nru libdap-3.11.1/Ancillary.cc libdap-3.12.0/Ancillary.cc --- libdap-3.11.1/Ancillary.cc 2011-04-29 13:19:43.000000000 +0000 +++ libdap-3.12.0/Ancillary.cc 2013-10-17 21:27:40.000000000 +0000 @@ -1,6 +1,9 @@ // Ancillary.cc #include "config.h" + +//#define DODS_DEBUG + #include "Ancillary.h" #include "debug.h" @@ -197,12 +200,17 @@ { string name = find_ancillary_file( pathname, "das", dir, file ) ; + DBG(cerr << "In Ancillary::read_ancillary_dds: name:" << name << endl); + FILE *in = fopen( name.c_str(), "r" ) ; if( in ) { das.parse( in ) ; + (void)fclose( in ) ; +#if 0 int res = fclose( in ) ; if( res ) DBG(cerr << "Ancillary::read_ancillary_das - Failed to close file " << (void *)in << endl) ; +#endif } } @@ -214,12 +222,17 @@ { string name = find_ancillary_file( pathname, "dds", dir, file ) ; + DBG(cerr << "In Ancillary::read_ancillary_dds: name:" << name << endl); + FILE *in = fopen( name.c_str(), "r" ) ; if( in ) { dds.parse( in ) ; + (void)fclose( in ) ; +#if 0 int res = fclose( in ) ; if( res ) DBG(cerr << "Ancillary::read_ancillary_das - Failed to close file " << (void *)in << endl) ; +#endif } } diff -Nru libdap-3.11.1/Ancillary.h libdap-3.12.0/Ancillary.h --- libdap-3.11.1/Ancillary.h 2011-04-29 13:19:43.000000000 +0000 +++ libdap-3.12.0/Ancillary.h 2013-10-17 21:27:40.000000000 +0000 @@ -21,7 +21,7 @@ // // You should have received a copy of the GNU Lesser General Public // License along with this library; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA // // You can contact OPeNDAP, Inc. at PO Box 112, Saunderstown, RI. 02874-0112. diff -Nru libdap-3.11.1/Array.cc libdap-3.12.0/Array.cc --- libdap-3.11.1/Array.cc 2011-04-29 13:19:43.000000000 +0000 +++ libdap-3.12.0/Array.cc 2013-10-17 21:27:40.000000000 +0000 @@ -19,7 +19,7 @@ // // You should have received a copy of the GNU Lesser General Public // License along with this library; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA // // You can contact OPeNDAP, Inc. at PO Box 112, Saunderstown, RI. 02874-0112. @@ -36,15 +36,16 @@ #include "config.h" +#include +#include +#include + #include "Array.h" #include "util.h" #include "debug.h" #include "InternalErr.h" #include "escaping.h" -#include -#include - using namespace std; namespace libdap { @@ -61,12 +62,11 @@ // in which case that means they want the whole thing. Array projection // should probably work this way too, but it doesn't. 9/21/2001 jhrg -/** @deprecated Calling this method should never be necessary. It is called - whenever the size of the Array is changed. +/** @deprecated Calling this method should never be necessary. It is used + internally called whenever the size of the Array is changed, e.g., by a + constraint. - Changes the size property of the array. If the array - exists, it is augmented by a factor of size. This does - not change the actual size of the array. + Changes the length property of the array. */ void Array::update_length(int) @@ -94,12 +94,12 @@ @param n A string containing the name of the variable to be created. @param v A pointer to a variable of the type to be included - in the Array. + in the Array. May be null and set later using add_var() or add_var_nocopy() @brief Array constructor */ Array::Array(const string &n, BaseType *v) : Vector(n, 0, dods_array_c) { - add_var(v); // Vector::add_var() stores null is v is null + add_var(v); // Vector::add_var() stores null if v is null } /** Build an array on the server-side with a name, a dataset name from which @@ -162,11 +162,16 @@ v's name is null, then assume that the array \e is named and don't overwrite it with v's null name. + @note It is possible for the BaseType pointer to be null when this + method is called, a behavior that differs considerably from that of + the other 'add_var()' methods. + @note This version checks to see if \e v is an array. If so, it calls Vector::add_var() using the template variable of \e v and then appends the dimensions of \e v to this array. This somewhat obscure behavior simplifies 'translating' Sequences to arrays when the actual variable being translated is not a regular Sequence but an array of Sequences. + This is of very debatable usefulness, but it's here all the same. @param v The template variable for the array @param p The Part parameter defaults to nil and is ignored by this method. @@ -175,9 +180,42 @@ void Array::add_var(BaseType *v, Part) { +#if 0 + if (v && v->is_dap4_only_type()) + throw InternalErr(__FILE__, __LINE__, "Attempt to add a DAP4 type to a DAP2 Array."); +#endif + // If 'v' is an Array, add the template instance to this object and + // then copy the dimension information. Odd semantics; I wonder if this + //is ever used. jhrg 6/13/12 + if (v && v->type() == dods_array_c) { + Array *a = static_cast(v); + Vector::add_var(a->var()); + + Dim_iter i = a->dim_begin(); + Dim_iter i_end = a->dim_end(); + while (i != i_end) { + append_dim(a->dimension_size(i), a->dimension_name(i)); + ++i; + } + } + else { + Vector::add_var(v); + } +} + +void +Array::add_var_nocopy(BaseType *v, Part) +{ +#if 0 + if (v && v->is_dap4_only_type()) + throw InternalErr(__FILE__, __LINE__, "Attempt to add a DAP4 type to a DAP2 Array."); +#endif + // If 'v' is an Array, add the template instance to this object and + // then copy the dimension information. Odd semantics; I wonder if this + //is ever used. jhrg 6/13/12 if (v && v->type() == dods_array_c) { Array &a = dynamic_cast(*v); - Vector::add_var(a.var()); + Vector::add_var_nocopy(a.var()); Dim_iter i = a.dim_begin(); Dim_iter i_end = a.dim_end(); while (i != i_end) { @@ -186,7 +224,7 @@ } } else { - Vector::add_var(v); + Vector::add_var_nocopy(v); } } @@ -247,6 +285,14 @@ update_length(size); // the number is ignored... } +/** Remove all the dimensions currently set for the Array. This also + * removes all constraint information. + */ +void +Array::clear_all_dims() +{ + _shape.clear(); +} /** Resets the dimension constraint information so that the entire array is selected. @@ -314,6 +360,11 @@ { dimension &d = *i ; + // if stop is -1, set it to the array's max element index + // jhrg 12/20/12 + if (stop == -1) + stop = d.size - 1; + // Check for bad constraints. // Jose Garcia // Usually invalid data for a constraint is the user's mistake @@ -361,12 +412,17 @@ unsigned int Array::dimensions(bool /*constrained*/) { +#if 0 + // TODO This could be _shape.end() - _shape.begin() unsigned int dim = 0; for (Dim_citer i = _shape.begin(); i != _shape.end(); i++) { dim++; } return dim; +#endif + + return _shape.end() - _shape.begin(); } /** Return the size of the array dimension referred to by i. @@ -498,7 +554,30 @@ return (*i).name; } -#if FILE_METHODS +/** + * @brief Returns the width of the data, in bytes. + * @param constrained if true, return the size of the array in bytes taking into + * account the current constraints on various dimensions. False by default. + * @return The number of bytes needed to store the array values. + */ +unsigned int Array::width(bool constrained) +{ + + if (constrained) { + // This preserves the original method's semantics when we ask for the + // size of the constrained array but no constraint has been applied. + // In this case, length will be -1. Wrong, I know... + return length() * var()->width(constrained); + } + else { + int length = 1; + for (Dim_iter i = _shape.begin(); i != _shape.end(); i++) { + length *= dimension_size(i, false); + } + return length * var()->width(false); + } +} + /** Prints a declaration for the Array. This is what appears in a DDS. If the Array is constrained, the declaration will reflect the size of the Array once the constraint is applied. @@ -520,30 +599,10 @@ Array::print_decl(FILE *out, string space, bool print_semi, bool constraint_info, bool constrained) { - if (constrained && !send_p()) - return; - - // print it, but w/o semicolon - var()->print_decl(out, space, false, constraint_info, constrained); - - for (Dim_citer i = _shape.begin(); i != _shape.end(); i++) { - fprintf(out, "[") ; - if ((*i).name != "") { - fprintf(out, "%s = ", id2www((*i).name).c_str()) ; - } - if (constrained) { - fprintf(out, "%d]", (*i).c_size) ; - } - else { - fprintf(out, "%d]", (*i).size) ; - } - } - - if (print_semi) { - fprintf(out, ";\n") ; - } + ostringstream oss; + print_decl(oss, space, print_semi, constraint_info, constrained); + fwrite(oss.str().data(), sizeof(char), oss.str().length(), out); } -#endif /** Prints a declaration for the Array. This is what appears in a DDS. If the Array is constrained, the declaration will reflect @@ -589,126 +648,138 @@ out << ";\n" ; } } -#if FILE_METHODS + +/** + * @deprecated + */ void Array::print_xml(FILE *out, string space, bool constrained) { - print_xml_core(out, space, constrained, "Array"); + XMLWriter xml(space); + print_xml_writer_core(xml, constrained, "Array"); + fwrite(xml.get_doc(), sizeof(char), xml.get_doc_size(), out); } -#endif + +/** + * @deprecated + */ void Array::print_xml(ostream &out, string space, bool constrained) { - print_xml_core(out, space, constrained, "Array"); + XMLWriter xml(space); + print_xml_writer_core(xml, constrained, "Array"); + out << xml.get_doc(); } -#if FILE_METHODS + +/** + * @deprecated + */ void Array::print_as_map_xml(FILE *out, string space, bool constrained) { - print_xml_core(out, space, constrained, "Map"); + XMLWriter xml(space); + print_xml_writer_core(xml, constrained, "Map"); + fwrite(xml.get_doc(), sizeof(char), xml.get_doc_size(), out); } -#endif + +/** + * @deprecated + */ void Array::print_as_map_xml(ostream &out, string space, bool constrained) { - print_xml_core(out, space, constrained, "Map"); + XMLWriter xml(space); + print_xml_writer_core(xml, constrained, "Map"); + out << xml.get_doc(); } -#if FILE_METHODS -class PrintArrayDim : public unary_function -{ - FILE *d_out; - string d_space; - bool d_constrained; -public: - PrintArrayDim(FILE *o, string s, bool c) - : d_out(o), d_space(s), d_constrained(c) - {} - - void operator()(Array::dimension &d) - { - int size = d_constrained ? d.c_size : d.size; - if (d.name.empty()) - fprintf(d_out, "%s\n", d_space.c_str(), - size); - else - fprintf(d_out, "%s\n", - d_space.c_str(), id2xml(d.name).c_str(), size); - } -}; +/** + * @deprecated + */ void Array::print_xml_core(FILE *out, string space, bool constrained, string tag) { - if (constrained && !send_p()) - return; - - fprintf(out, "%s<%s", space.c_str(), tag.c_str()); - if (!name().empty()) - fprintf(out, " name=\"%s\"", id2xml(name()).c_str()); - fprintf(out , ">\n"); - - get_attr_table().print_xml(out, space + " ", constrained); + XMLWriter xml(space); + print_xml_writer_core(xml, constrained, tag); + fwrite(xml.get_doc(), sizeof(char), xml.get_doc_size(), out); +} - BaseType *btp = var(); - string tmp_name = btp->name(); - btp->set_name(""); - btp->print_xml(out, space + " ", constrained); - btp->set_name(tmp_name); +/** + * @deprecated + */ +void +Array::print_xml_core(ostream &out, string space, bool constrained, string tag) +{ + XMLWriter xml(space); + print_xml_writer_core(xml, constrained, tag); + out << xml.get_doc(); +} - for_each(dim_begin(), dim_end(), - PrintArrayDim(out, space + " ", constrained)); +void +Array::print_xml_writer(XMLWriter &xml, bool constrained) +{ + print_xml_writer_core(xml, constrained, "Array"); +} - fprintf(out, "%s\n", space.c_str(), tag.c_str()); +void +Array::print_as_map_xml_writer(XMLWriter &xml, bool constrained) +{ + print_xml_writer_core(xml, constrained, "Map"); } -#endif -class PrintArrayDimStrm : public unary_function +class PrintArrayDimXMLWriter : public unary_function { - ostream &d_out; - string d_space; + XMLWriter &xml; bool d_constrained; public: - PrintArrayDimStrm(ostream &o, string s, bool c) - : d_out(o), d_space(s), d_constrained(c) - {} + PrintArrayDimXMLWriter(XMLWriter &xml, bool c) : xml(xml), d_constrained(c) {} void operator()(Array::dimension &d) { - int size = d_constrained ? d.c_size : d.size; - if (d.name.empty()) - d_out << d_space << "\n" ; - else - d_out << d_space << "\n" ; + if (xmlTextWriterStartElement(xml.get_writer(), (const xmlChar*)"dimension") < 0) + throw InternalErr(__FILE__, __LINE__, "Could not write dimension element"); + + if (!d.name.empty()) + if (xmlTextWriterWriteAttribute(xml.get_writer(), (const xmlChar*) "name", (const xmlChar*)d.name.c_str()) < 0) + throw InternalErr(__FILE__, __LINE__, "Could not write attribute for name"); + + ostringstream size; + size << (d_constrained ? d.c_size : d.size); + if (xmlTextWriterWriteAttribute(xml.get_writer(), (const xmlChar*) "size", (const xmlChar*)size.str().c_str()) < 0) + throw InternalErr(__FILE__, __LINE__, "Could not write attribute for name"); + + if (xmlTextWriterEndElement(xml.get_writer()) < 0) + throw InternalErr(__FILE__, __LINE__, "Could not end dimension element"); } }; void -Array::print_xml_core(ostream &out, string space, bool constrained, string tag) +Array::print_xml_writer_core(XMLWriter &xml, bool constrained, string tag) { if (constrained && !send_p()) return; - out << space << "<" << tag ; + if (xmlTextWriterStartElement(xml.get_writer(), (const xmlChar*)tag.c_str()) < 0) + throw InternalErr(__FILE__, __LINE__, "Could not write " + tag + " element"); + if (!name().empty()) - out << " name=\"" << id2xml(name()) << "\"" ; - out << ">\n" ; + if (xmlTextWriterWriteAttribute(xml.get_writer(), (const xmlChar*) "name", (const xmlChar*)name().c_str()) < 0) + throw InternalErr(__FILE__, __LINE__, "Could not write attribute for name"); - get_attr_table().print_xml(out, space + " ", constrained); + get_attr_table().print_xml_writer(xml); BaseType *btp = var(); string tmp_name = btp->name(); btp->set_name(""); - btp->print_xml(out, space + " ", constrained); + btp->print_xml_writer(xml, constrained); btp->set_name(tmp_name); - for_each(dim_begin(), dim_end(), - PrintArrayDimStrm(out, space + " ", constrained)); + for_each(dim_begin(), dim_end(), PrintArrayDimXMLWriter(xml, constrained)); - out << space << "\n" ; + if (xmlTextWriterEndElement(xml.get_writer()) < 0) + throw InternalErr(__FILE__, __LINE__, "Could not end " + tag + " element"); } -#if FILE_METHODS /** Prints the values in ASCII of the entire (constrained) array. This method Attempts to make an aesthetically pleasing display. However, it is primarily intended for debugging purposes. @@ -724,36 +795,12 @@ Array::print_array(FILE *out, unsigned int index, unsigned int dims, unsigned int shape[]) { - if (dims == 1) { - fprintf(out, "{") ; - for (unsigned i = 0; i < shape[0] - 1; ++i) { - var(index++)->print_val(out, "", false); - fprintf(out, ", ") ; - } - var(index++)->print_val(out, "", false); - fprintf(out, "}") ; + ostringstream oss; + unsigned int i = print_array(oss, index, dims, shape); + fwrite(oss.str().data(), sizeof(char), oss.str().length(), out); - return index; - } - else { - fprintf(out, "{") ; - // Fixed an off-by-one error in the following loop. Since the array - // length is shape[dims-1]-1 *and* since we want one less dimension - // than that, the correct limit on this loop is shape[dims-2]-1. From - // Todd Karakasian. - // The saga continues; the loop test should be `i < shape[0]-1'. jhrg - // 9/12/96. - for (unsigned i = 0; i < shape[0] - 1; ++i) { - index = print_array(out, index, dims - 1, shape + 1); - fprintf(out, ",") ; // Removed the extra `}'. Also from Todd - } - index = print_array(out, index, dims - 1, shape + 1); - fprintf(out, "}") ; - - return index; - } + return i; } -#endif /** Prints the values in ASCII of the entire (constrained) array. This method Attempts to make an anesthetically pleasing display. However, it is @@ -800,35 +847,13 @@ } } -#if FILE_METHODS void Array::print_val(FILE *out, string space, bool print_decl_p) { - // print the declaration if print decl is true. - // for each dimension, - // for each element, - // print the array given its shape, number of dimensions. - // Add the `;' - - if (print_decl_p) { - print_decl(out, space, false, false, false); - fprintf(out, " = ") ; - } - - unsigned int *shape = new unsigned int[_shape.size()]; - unsigned int index = 0; - for (Dim_iter i = _shape.begin(); i != _shape.end() && index < _shape.size(); i++) - shape[index++] = dimension_size(i, true); - - print_array(out, 0, _shape.size(), shape); - - delete [] shape; shape = 0; - - if (print_decl_p) { - fprintf(out, ";\n") ; - } + ostringstream oss; + print_val(oss, space, print_decl_p); + fwrite(oss.str().data(), sizeof(char), oss.str().length(), out); } -#endif void Array::print_val(ostream &out, string space, bool print_decl_p) diff -Nru libdap-3.11.1/Array.h libdap-3.12.0/Array.h --- libdap-3.11.1/Array.h 2011-04-29 13:19:43.000000000 +0000 +++ libdap-3.12.0/Array.h 2013-10-17 21:27:40.000000000 +0000 @@ -19,7 +19,7 @@ // // You should have received a copy of the GNU Lesser General Public // License along with this library; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA // // You can contact OPeNDAP, Inc. at PO Box 112, Saunderstown, RI. 02874-0112. @@ -48,7 +48,9 @@ #include "Vector.h" #endif -#define FILE_METHODS 1 +#ifndef XMLWRITER_H_ +#include "XMLWriter.h" +#endif namespace libdap { @@ -129,10 +131,9 @@ protected: void _duplicate(const Array &a); -#if FILE_METHODS unsigned int print_array(FILE *out, unsigned int index, unsigned int dims, unsigned int shape[]); -#endif + unsigned int print_array(ostream &out, unsigned int index, unsigned int dims, unsigned int shape[]); @@ -160,9 +161,11 @@ virtual BaseType *ptr_duplicate(); void add_var(BaseType *v, Part p = nil); + void add_var_nocopy(BaseType *v, Part p = nil); void append_dim(int size, string name = ""); void prepend_dim(int size, const string& name = ""); + void clear_all_dims(); virtual void add_constraint(Dim_iter i, int start, int stride, int stop); virtual void reset_constraint(); @@ -170,6 +173,7 @@ virtual void clear_constraint(); virtual void update_length(int size); + virtual unsigned int width(bool constrained = false); Dim_iter dim_begin() ; Dim_iter dim_end() ; @@ -190,9 +194,11 @@ virtual void print_xml(ostream &out, string space = " ", bool constrained = false); -#if FILE_METHODS + virtual void print_xml_writer(XMLWriter &xml, bool constrained = false); + virtual void print_xml_writer_core(XMLWriter &out, bool constrained, string tag); + virtual void print_as_map_xml_writer(XMLWriter &xml, bool constrained); + virtual void print_xml_core(FILE *out, string space, bool constrained, string tag); -#endif virtual void print_xml_core(ostream &out, string space, bool constrained, string tag); // not used (?) @@ -202,7 +208,6 @@ virtual void print_val(ostream &out, string space = "", bool print_decl_p = true); -#if FILE_METHODS virtual void print_xml(FILE *out, string space = " ", bool constrained = false); virtual void print_as_map_xml(FILE *out, string space = " ", @@ -213,7 +218,6 @@ bool print_semi = true, bool constraint_info = false, bool constrained = false); -#endif virtual bool check_semantics(string &msg, bool all = false); diff -Nru libdap-3.11.1/ArrayGeoConstraint.cc libdap-3.12.0/ArrayGeoConstraint.cc --- libdap-3.11.1/ArrayGeoConstraint.cc 2011-04-29 13:19:43.000000000 +0000 +++ libdap-3.12.0/ArrayGeoConstraint.cc 1970-01-01 00:00:00.000000000 +0000 @@ -1,212 +0,0 @@ - -// -*- mode: c++; c-basic-offset:4 -*- - -// This file is part of libdap, A C++ implementation of the OPeNDAP Data -// Access Protocol. - -// Copyright (c) 2002,2003 OPeNDAP, Inc. -// Author: James Gallagher -// -// This library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Lesser General Public -// License as published by the Free Software Foundation; either -// version 2.1 of the License, or (at your option) any later version. -// -// This library 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 -// Lesser General Public License for more details. -// -// You should have received a copy of the GNU Lesser General Public -// License along with this library; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -// -// You can contact OPeNDAP, Inc. at PO Box 112, Saunderstown, RI. 02874-0112. - -// The Grid Selection Expression Clause class. - - -#include "config.h" - -static char id[] not_used = - { "$Id: ArrayGeoConstraint.cc 21922 2010-01-07 18:23:57Z jimg $" - }; - -#include -#include -#include - -//#define DODS_DEBUG - -#include "debug.h" -#include "dods-datatypes.h" -#include "ArrayGeoConstraint.h" -#include "Float64.h" - -#include "Error.h" -#include "InternalErr.h" -#include "ce_functions.h" - -using namespace std; - -namespace libdap { - -/** Private initialization code. */ -void ArrayGeoConstraint::m_init() -{ - if (d_array->dimensions() < 2 || d_array->dimensions() > 3) - throw Error("The geoarray() function works only with Arrays of two or three dimensions."); - - build_lat_lon_maps(); -} - -// In the other methods the ds_name parameter defaults to "" but that's not -// possible here. Remove ds_name -ArrayGeoConstraint::ArrayGeoConstraint(Array *array, double top, double left, - double bottom, double right) - : GeoConstraint(), d_array(array), - d_extent(top, left, bottom, right), d_projection("plat-carre", "wgs84") - -{ - m_init(); -} - -ArrayGeoConstraint::ArrayGeoConstraint(Array *array, - double top, double left, double bottom, double right, - const string &projection, const string &datum) - : GeoConstraint(), d_array(array), - d_extent(top, left, bottom, right), d_projection(projection, datum) - -{ - m_init(); -} - -/** Build the longitude and latitude maps for this Array. This either builds - the maps using the extent, projection and datum given or reads the maps - from the data source somehow. - - The d_lon and d_lon_length (and matching lat) fields are modified. - - @note Rules used to find Maps:
  • None, currently the extent must - be given.
  • -
- - @return True if the maps are built, otherwise False */ -bool ArrayGeoConstraint::build_lat_lon_maps() -{ - // Find the longitude dimension: Assume it is the rightmost - set_longitude_rightmost(true); - set_lon_dim(d_array->dim_begin() + (d_array->dimensions() - 1)); - - int number_elements_longitude = d_array->dimension_size(get_lon_dim()); - double *lon_map = new double[number_elements_longitude]; - for (int i = 0; i < number_elements_longitude; ++i) { - lon_map[i] = ((d_extent.d_right - d_extent.d_left) / (number_elements_longitude - 1)) * i + d_extent.d_left; - } - set_lon(lon_map); - set_lon_length(number_elements_longitude); - - // Find the latitude dimension: Assume it is the next-rightmost - set_lat_dim(d_array->dim_begin() + (d_array->dimensions() - 2)); - - int number_elements_latitude = d_array->dimension_size(get_lat_dim()); - double *lat_map = new double[number_elements_latitude]; - for (int i = 0; i < number_elements_latitude; ++i) { - lat_map[i] = ((d_extent.d_bottom - d_extent.d_top) / (number_elements_latitude - 1)) * i + d_extent.d_top; - } - set_lat(lat_map); - set_lat_length(number_elements_latitude); - - return get_lat() && get_lon(); -} - -/** Are the latitude and longitude dimensions ordered so that this class can - properly constrain the data? - - @note This version always returns true because geoarray() assumes the - dimensions are ordered properly. - - @return Always returns True. */ -bool -ArrayGeoConstraint::lat_lon_dimensions_ok() -{ - return true; -} - -/** Once the bounding box is set, apply the constraint. If the data can be sent - using Vector::serialize(), do so. If they cannot, read and organize the - data so that Vector::serialize() will be able to send the data when asked - to. - - How can it be that Vector::serialize() would not be able to read the data? - If the longitude extent of the bounding box for the constraint wraps around - the edge of the data/array, then two reads are required to get the data. - This method performs those reads (using the constraints and the read() - method so that the data server's type-specific and optimized code will be - used to read actual data values) and then loads the combined result - back into the object, marking it as having been read. Vector::serialize() - will then see the object is loaded with data values, skip the regular read - call and send all the data in the buffer. */ -void ArrayGeoConstraint::apply_constraint_to_data() -{ - if (!is_bounding_box_set()) - throw InternalErr( - "The Latitude and Longitude constraints must be set before calling\n\ - apply_constraint_to_data()."); - - if (get_latitude_sense() == inverted) { - int tmp = get_latitude_index_top(); - set_latitude_index_top(get_latitude_index_bottom()); - set_latitude_index_bottom(tmp); - } - - // It's easy to flip the Latitude values; if the bottom index value - // is before/above the top index, return an error explaining that. - if (get_latitude_index_top() > get_latitude_index_bottom()) - throw Error("The upper and lower latitude indexes appear to be reversed. Please provide\nthe latitude bounding box numbers giving the northern-most latitude first."); - - d_array->add_constraint(get_lat_dim(), - get_latitude_index_top(), 1, - get_latitude_index_bottom()); - - // Does the longitude constraint cross the edge of the longitude vector? - // If so, reorder the data (array). - if (get_longitude_index_left() > get_longitude_index_right()) { - reorder_data_longitude_axis(*d_array, get_lon_dim()); - - // Now the data are all in local storage - - // alter the indexes; the left index has now been moved to 0, and the right - // index is now at lon_vector_length-left+right. - set_longitude_index_right(get_lon_length() - get_longitude_index_left() - + get_longitude_index_right()); - set_longitude_index_left(0); - } - // If the constraint used the -180/179 (neg_pos) notation, transform - // the longitude map s it uses the -180/179 notation. Note that at this - // point, d_longitude always uses the pos notation because of the earlier - // conditional transformation. - - // Apply constraint; stride is always one - d_array->add_constraint(get_lon_dim(), - get_longitude_index_left(), 1, - get_longitude_index_right()); - - // Load the array if it has been read, which will be the case if - // reorder_data_longitude_axis() has been called. - if (get_array_data()) { - - int size = d_array->val2buf(get_array_data()); - - if (size != get_array_data_size()) - throw InternalErr - ("Expected data size not copied to the Grid's buffer."); - d_array->set_read_p(true); - } - else { - d_array->read(); - } -} - -} // namespace libdap - diff -Nru libdap-3.11.1/ArrayGeoConstraint.h libdap-3.12.0/ArrayGeoConstraint.h --- libdap-3.11.1/ArrayGeoConstraint.h 2011-04-29 13:19:43.000000000 +0000 +++ libdap-3.12.0/ArrayGeoConstraint.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,140 +0,0 @@ - -// -*- mode: c++; c-basic-offset:4 -*- - -// This file is part of libdap, A C++ implementation of the OPeNDAP Data -// Access Protocol. - -// Copyright (c) 2006 OPeNDAP, Inc. -// Author: James Gallagher -// -// This library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Lesser General Public -// License as published by the Free Software Foundation; either -// version 2.1 of the License, or (at your option) any later version. -// -// This library 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 -// Lesser General Public License for more details. -// -// You should have received a copy of the GNU Lesser General Public -// License along with this library; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -// -// You can contact OPeNDAP, Inc. at PO Box 112, Saunderstown, RI. 02874-0112. - -#ifndef _array_geo_constraint_h -#define _array_geo_constraint_h 1 - -#include -#include -#include - -#ifndef _geo_constraint_h -#include "GeoConstraint.h" -#endif - -#ifndef _util_h -#include "util.h" -#endif - -namespace libdap -{ - -extern bool unit_or_name_match(set < string > units, set < string > names, - const string & var_units, - const string & var_name); - -/** Geographical constraint applied to an Array. - - @note This class assumes that the Longitude dimension varies fastest, as - does the COARDS conventions. - - @author James Gallagher */ - -class ArrayGeoConstraint : public GeoConstraint -{ - -private: - struct Extent - { - double d_left; - double d_top; - double d_right; - double d_bottom; - - Extent() : d_left(0.0), d_top(0.0), d_right(0.0), d_bottom(0.0) - {} - Extent(double t, double l, double b, double r) - : d_left(l), d_top(t), d_right(r), d_bottom(b) - {} - }; - - struct Projection - { - string d_name; - string d_datum; - - Projection() - {} - Projection(const string &n, const string &d) - : d_name(n), d_datum(d) - { - downcase(d_name); - if (d_name != "plat-carre") - throw Error( - "geoarray(): Only the Plat-Carre projection is supported by this version of\n\ - geoarray()."); - downcase(d_datum); - if (d_datum != "wgs84") - throw Error( - "geoarray(): Only the wgs84 datum is supported by this version of geoarray()."); - } - }; - - Array *d_array; - - Extent d_extent; - Projection d_projection; - - bool build_lat_lon_maps(); - bool lat_lon_dimensions_ok(); - - void m_init(); - - friend class ArrayGeoConstraintTest; // Unit tests - -public: - /** @name Constructors */ - //@{ - ArrayGeoConstraint(Array *) - : GeoConstraint(), d_array(0) - { - // See ce_finctions.cc:function_geoarray() to put this message in - // context. - throw Error( - "Bummer. The five-argument version of geoarray() is not currently implemented."); - } - - ArrayGeoConstraint(Array *array, - double left, double top, double right, double bottom); - - ArrayGeoConstraint(Array *array, - double left, double top, double right, double bottom, - const string &projection, const string &datum); - //@} - - virtual ~ArrayGeoConstraint() - {} - - virtual void apply_constraint_to_data(); - - virtual Array *get_constrained_array() const - { - return d_array; - } -}; - -} // namespace libdap - -#endif // _array_geo_constraint_h diff -Nru libdap-3.11.1/AttrTable.cc libdap-3.12.0/AttrTable.cc --- libdap-3.11.1/AttrTable.cc 2011-04-29 13:19:43.000000000 +0000 +++ libdap-3.12.0/AttrTable.cc 2013-10-17 21:27:40.000000000 +0000 @@ -18,7 +18,7 @@ // // You should have received a copy of the GNU Lesser General Public // License along with this library; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA // // You can contact OPeNDAP, Inc. at PO Box 112, Saunderstown, RI. 02874-0112. @@ -32,12 +32,13 @@ #include "config.h" -// #define DODS_DEBUG +//#define DODS_DEBUG static char rcsid[]not_used = - "$Id: AttrTable.cc 24370 2011-03-28 16:21:32Z jimg $"; +"$Id: AttrTable.cc 27197 2013-10-01 21:29:54Z jimg $"; #include +#include #include "AttrTable.h" @@ -46,6 +47,10 @@ #include "debug.h" +// Should the www2id and id2www functions be used to encode attribute names? +// Probably not... jhrg 11/16/11 +#define WWW_ENCODING 0 + using std::cerr; using std::string; using std::endl; @@ -53,36 +58,70 @@ namespace libdap { +/** Remove %20 space encoding */ +static string remove_space_encoding(const string &s) +{ + string::size_type pos = s.find("%20"); + if (pos != string::npos) { + string n = s; + do { + n.replace(pos, 3, " "); + pos = n.find("%20"); + } while (pos != string::npos); + return n; + } + else { + return s; + } +} + +/** Add %20 space encoding. */ +static string add_space_encoding(const string &s) +{ + string::size_type pos = s.find(" "); + if (pos != string::npos) { + string n = s; + do { + n.replace(pos, 1, "%20"); + pos = n.find(" "); + } while (pos != string::npos); + return n; + } + else { + return s; + } +} + /** Convert an AttrType to it's string representation. @param at The Attribute Type. @return The type's string representation */ string AttrType_to_String(const AttrType at) { switch (at) { - case Attr_container: - return "Container"; - case Attr_byte: - return "Byte"; - case Attr_int16: - return "Int16"; - case Attr_uint16: - return "UInt16"; - case Attr_int32: - return "Int32"; - case Attr_uint32: - return "UInt32"; - case Attr_float32: - return "Float32"; - case Attr_float64: - return "Float64"; - case Attr_string: - return "String"; - case Attr_url: - return "Url"; - case Attr_other_xml: - return "OtherXML"; - default: - return ""; + case Attr_container: + return "Container"; + case Attr_byte: + return "Byte"; + case Attr_int16: + return "Int16"; + case Attr_uint16: + return "UInt16"; + case Attr_int32: + return "Int32"; + case Attr_uint32: + return "UInt32"; + case Attr_float32: + return "Float32"; + case Attr_float64: + return "Float64"; + case Attr_string: + return "String"; + case Attr_url: + return "Url"; + case Attr_other_xml: + return "OtherXML"; + default: + return ""; } } @@ -139,8 +178,8 @@ // If the entry being added was a container, // set its parent to this to maintain invariant. if (e->type == Attr_container) { - assert(e->attributes); - e->attributes->d_parent = this; + assert(e->attributes); + e->attributes->d_parent = this; } } } @@ -148,17 +187,13 @@ /** @name Instance management functions */ //@{ -AttrTable::AttrTable() - : DapObj() - , d_name("") - , d_parent(0) - , attr_map() - , d_is_global_attribute(true) +AttrTable::AttrTable() : + DapObj(), d_name(""), d_parent(0), attr_map(), d_is_global_attribute(true) { } -AttrTable::AttrTable(const AttrTable &rhs) -: DapObj() +AttrTable::AttrTable(const AttrTable &rhs) : + DapObj() { clone(rhs); } @@ -176,7 +211,8 @@ AttrTable::~AttrTable() { DBG(cerr << "Entering ~AttrTable (" << this << ")" << endl); - delete_attr_table();DBG(cerr << "Exiting ~AttrTable" << endl); + delete_attr_table(); + DBG(cerr << "Exiting ~AttrTable" << endl); } AttrTable & @@ -196,28 +232,65 @@ @return The number of entries. @brief Get the number of entries in this attribute table. */ -unsigned int -AttrTable::get_size() const +unsigned int AttrTable::get_size() const { return attr_map.size(); } /** @brief Get the name of this attribute table. @return A string containing the name. */ -string -AttrTable::get_name() const +string AttrTable::get_name() const { return d_name; } /** @brief Set the name of this attribute table. @param n The new name of the attribute table. */ -void -AttrTable::set_name(const string &n) +void AttrTable::set_name(const string &n) { +#if WWW_ENCODING d_name = www2id(n); +#else + d_name = remove_space_encoding(n); +#endif } +#if 0 +// This was taken from das.y and could be used here to make the 'dods_errors' +// attribute container like the parser used to. Then again, maybe this feature +// was just BS. jhrg (ticket 1469) +static void add_bad_attribute(AttrTable *attr, const string &type, const string &name, const string &value, + const string &msg) { + // First, if this bad value is already in a *_dods_errors container, + // then just add it. This can happen when the server side processes a DAS + // and then hands it off to a client which does the same. + // Make a new container. Call it _errors. If that container + // already exists, use it. + // Add the attribute. + // Add the error string to an attribute in the container called + // `get_name().find("_dods_errors") != string::npos) { + attr->append_attr(name, type, value); + } + else { + // I think _dods_errors should be _dap_error. jhrg 11/16/11 + string error_cont_name = attr->get_name() + "_dods_errors"; + AttrTable *error_cont = attr->get_attr_table(error_cont_name); + if (!error_cont) + error_cont = attr->append_container(error_cont_name); + + error_cont->append_attr(name, type, value); + +#ifndef ATTR_STRING_QUOTE_FIX + error_cont->append_attr(name + "_dap_explanation", "String", "\"" + msg + "\""); +#else + error_cont->append_attr(name + "_dap_explanation", "String", msg); +#endif + } +} +#endif + /** If the given name already refers to an attribute, and the attribute has a value, the given value is appended to the attribute vector. Calling this function repeatedly is the way to append to an attribute vector. @@ -234,27 +307,27 @@ @return Returns the length of the added attribute value. @param name The name of the attribute to add or modify. @param type The type of the attribute to add or modify. - @param attribute The value to add to the attribute table. */ -unsigned int -AttrTable::append_attr(const string &name, const string &type, - const string &attribute) + @param value The value to add to the attribute table. */ +unsigned int AttrTable::append_attr(const string &name, const string &type, const string &value) { DBG(cerr << "Entering AttrTable::append_attr" << endl); +#if WWW_ENCODING string lname = www2id(name); +#else + string lname = remove_space_encoding(name); +#endif Attr_iter iter = simple_find(lname); // If the types don't match OR this attribute is a container, calling // this mfunc is an error! if (iter != attr_map.end() && ((*iter)->type != String_to_AttrType(type))) - throw Error(string("An attribute called `") + name - + string("' already exists but is of a different type")); + throw Error(string("An attribute called `") + name + string("' already exists but is of a different type")); if (iter != attr_map.end() && (get_type(iter) == "Container")) - throw Error(string("An attribute called `") + name - + string("' already exists but is a container.")); + throw Error(string("An attribute called `") + name + string("' already exists but is a container.")); if (iter != attr_map.end()) { // Must be a new attribute value; add it. - (*iter)->attr->push_back(attribute); + (*iter)->attr->push_back(value); return (*iter)->attr->size(); } else { // Must be a completely new attribute; add it @@ -263,8 +336,8 @@ e->name = lname; e->is_alias = false; e->type = String_to_AttrType(type); // Record type using standard names. - e->attr = new vector; - e->attr->push_back(attribute); + e->attr = new vector ; + e->attr->push_back(value); attr_map.push_back(e); @@ -290,28 +363,27 @@ @param type The type of the attribute to add or modify. @param values A vector of values. Note: The vector is COPIED, not stored. */ -unsigned int -AttrTable::append_attr(const string &name, const string &type, - vector *values) +unsigned int AttrTable::append_attr(const string &name, const string &type, vector *values) { DBG(cerr << "Entering AttrTable::append_attr(..., vector)" << endl); +#if WWW_ENCODING string lname = www2id(name); - +#else + string lname = remove_space_encoding(name); +#endif Attr_iter iter = simple_find(lname); // If the types don't match OR this attribute is a container, calling // this mfunc is an error! if (iter != attr_map.end() && ((*iter)->type != String_to_AttrType(type))) - throw Error(string("An attribute called `") + name - + string("' already exists but is of a different type")); + throw Error(string("An attribute called `") + name + string("' already exists but is of a different type")); if (iter != attr_map.end() && (get_type(iter) == "Container")) - throw Error(string("An attribute called `") + name - + string("' already exists but is a container.")); + throw Error(string("An attribute called `") + name + string("' already exists but is a container.")); if (iter != attr_map.end()) { // Must be new attribute values; add. vector::iterator i = values->begin(); while (i != values->end()) - (*iter)->attr->push_back(*i++); + (*iter)->attr->push_back(*i++); return (*iter)->attr->size(); } @@ -321,7 +393,7 @@ e->name = lname; e->is_alias = false; e->type = String_to_AttrType(type); // Record type using standard names. - e->attr = new vector(*values); + e->attr = new vector (*values); attr_map.push_back(e); @@ -345,11 +417,11 @@ AttrTable *ret = NULL; try { ret = append_container(new_at, name); - } - catch (Error &e) { + } catch (Error &e) { // an error occurred, attribute with that name already exists - delete new_at; new_at = 0; - throw ; + delete new_at; + new_at = 0; + throw; } return ret; } @@ -371,11 +443,15 @@ AttrTable * AttrTable::append_container(AttrTable *at, const string &name) { +#if WWW_ENCODING string lname = www2id(name); +#else + string lname = remove_space_encoding(name); +#endif if (simple_find(name) != attr_end()) - throw Error(string("There already exists a container called `") - + name + string("' in this attribute table.")); + throw Error( + string("There already exists a container called `") + name + string("' in this attribute table. (1)")); DBG(cerr << "Setting appended attribute container name to: " << lname << endl); at->set_name(lname); @@ -407,8 +483,7 @@ @param iter The iterator which will reference the attribute found. Can be used to access \c target from within \c at. References dim_end() within \c at if the attribute or container does not exist. */ -void -AttrTable::find(const string &target, AttrTable **at, Attr_iter *iter) +void AttrTable::find(const string &target, AttrTable **at, Attr_iter *iter) { string::size_type dotpos = target.rfind('.'); if (dotpos != string::npos) { @@ -442,7 +517,6 @@ AttrTable * AttrTable::recurrsive_find(const string &target, Attr_iter *location) { - //*location = attr_begin(); Attr_iter i = attr_begin(); while (i != attr_end()) { if (target == (*i)->name) { @@ -452,7 +526,7 @@ else if ((*i)->type == Attr_container) { AttrTable *at = (*i)->attributes->recurrsive_find(target, location); if (at) - return at; + return at; } ++i; @@ -469,8 +543,7 @@ @param target The name of the attribute. @return An Attr_iter which references \c target. */ -AttrTable::Attr_iter -AttrTable::simple_find(const string &target) +AttrTable::Attr_iter AttrTable::simple_find(const string &target) { Attr_iter i; for (i = attr_map.begin(); i != attr_map.end(); ++i) { @@ -515,7 +588,7 @@ AttrTable::simple_find_container(const string &target) { if (get_name() == target) - return this; + return this; for (Attr_iter i = attr_map.begin(); i != attr_map.end(); ++i) { if (is_container(i) && target == (*i)->name) { @@ -542,17 +615,15 @@ } /** @brief Get the type name of an attribute within this attribute table. */ -string -AttrTable::get_type(const string &name) +string AttrTable::get_type(const string &name) { Attr_iter p = simple_find(name); - return (p != attr_map.end()) ? get_type(p) : (string)""; + return (p != attr_map.end()) ? get_type(p) : (string) ""; } /** @brief Get the type of an attribute. @return The AttrType value describing the attribute. */ -AttrType -AttrTable::get_attr_type(const string &name) +AttrType AttrTable::get_attr_type(const string &name) { Attr_iter p = simple_find(name); return (p != attr_map.end()) ? get_attr_type(p) : Attr_unknown; @@ -565,8 +636,7 @@ attribute value). @brief Get the number of attributes in this container. */ -unsigned int -AttrTable::get_attr_num(const string &name) +unsigned int AttrTable::get_attr_num(const string &name) { Attr_iter iter = simple_find(name); return (iter != attr_map.end()) ? get_attr_num(iter) : 0; @@ -607,27 +677,31 @@ non-negative, the i-th entry in the vector is deleted, and the array is repacked. If i equals -1 (the default), the entire attribute is deleted. */ -void -AttrTable::del_attr(const string &name, int i) +void AttrTable::del_attr(const string &name, int i) { +#if WWW_ENCODING string lname = www2id(name); +#else + string lname = remove_space_encoding(name); +#endif Attr_iter iter = simple_find(lname); if (iter != attr_map.end()) { if (i == -1) { // Delete the whole attribute entry *e = *iter; attr_map.erase(iter); - delete e; e = 0; + delete e; + e = 0; } else { // Delete one element from attribute array // Don't try to delete elements from the vector of values if the // map is a container! if ((*iter)->type == Attr_container) - return; + return; vector *sxp = (*iter)->attr; - assert(i >= 0 && i < (int)sxp->size()); + assert(i >= 0 && i < (int) sxp->size()); sxp->erase(sxp->begin() + i); // rm the element } } @@ -639,8 +713,7 @@ //@{ /** Get an iterator to the first entry in this attribute table. @return Attr_iter; references the end of the array if empty list. */ -AttrTable::Attr_iter -AttrTable::attr_begin() +AttrTable::Attr_iter AttrTable::attr_begin() { return attr_map.begin(); } @@ -648,8 +721,7 @@ /** Get an iterator to the end attribute table. Does not point to the last attribute in the table @return Attr_iter */ -AttrTable::Attr_iter -AttrTable::attr_end() +AttrTable::Attr_iter AttrTable::attr_end() { return attr_map.end(); } @@ -662,15 +734,13 @@ @param i The index @return The corresponding Attr_iter @see get_attr_num, get_size */ -AttrTable::Attr_iter -AttrTable::get_attr_iter(int i) +AttrTable::Attr_iter AttrTable::get_attr_iter(int i) { return attr_map.begin() + i; } /** Returns the name of the attribute referenced by \e iter. */ -string -AttrTable::get_name(Attr_iter iter) +string AttrTable::get_name(Attr_iter iter) { assert(iter != attr_map.end()); @@ -678,8 +748,7 @@ } /** Returns true if the attribute referenced by \e i is a container. */ -bool -AttrTable::is_container(Attr_iter i) +bool AttrTable::is_container(Attr_iter i) { return (*i)->type == Attr_container; } @@ -697,18 +766,17 @@ } /** Delete the iterator. Since AttrTable stores pointers to AttrTable - objects, the caller should be sure to delete the AttrTable itself. - The caller will gain control of the AttrTable* located at - get_attr_table(iter) prior to this call. + objects, the caller should be sure to delete the AttrTable itself. + The caller will gain control of the AttrTable* located at + get_attr_table(iter) prior to this call. @note calling this method invalidates the iterator \e iter. @param iter points to the entry to be deleted. @return The Attr_iter for the element following \e iter */ -AttrTable::Attr_iter -AttrTable::del_attr_table(Attr_iter iter) +AttrTable::Attr_iter AttrTable::del_attr_table(Attr_iter iter) { if ((*iter)->type != Attr_container) - return ++iter; + return ++iter; // the caller intends to delete/reuse the contained AttrTable, // so zero it out so it doesn't get deleted before we delete the entry @@ -716,7 +784,7 @@ struct entry* e = *iter; // container no longer has a parent. if (e->attributes) { - e->attributes->d_parent = 0; + e->attributes->d_parent = 0; } e->attributes = 0; delete e; @@ -727,8 +795,7 @@ /** Get the type name of an attribute referenced by \e iter. @param iter Reference to the Attribute. @return A string with the name of this attribute datatype. */ -string -AttrTable::get_type(Attr_iter iter) +string AttrTable::get_type(Attr_iter iter) { assert(iter != attr_map.end()); return AttrType_to_String((*iter)->type); @@ -737,8 +804,7 @@ /** Get the type of the attribute referenced by \e iter. @param iter @return The datatype of this attribute in an instance of AttrType. */ -AttrType -AttrTable::get_attr_type(Attr_iter iter) +AttrType AttrTable::get_attr_type(Attr_iter iter) { return (*iter)->type; } @@ -750,13 +816,10 @@ vector attribute value). @param iter Reference to an attribute @return The number of elements in the attribute. */ -unsigned int -AttrTable::get_attr_num(Attr_iter iter) +unsigned int AttrTable::get_attr_num(Attr_iter iter) { assert(iter != attr_map.end()); - return ((*iter)->type == Attr_container) - ? (*iter)->attributes->get_size() - : (*iter)->attr->size(); + return ((*iter)->type == Attr_container) ? (*iter)->attributes->get_size() : (*iter)->attr->size(); } /** Returns the value of an attribute. If the attribute has a vector @@ -775,34 +838,17 @@ @return If the indicated attribute is a container, this function returns the string ``None''. If using a name to refer to the attribute and the named attribute does not exist, return the empty string. */ -string -AttrTable::get_attr(Attr_iter iter, unsigned int i) +string AttrTable::get_attr(Attr_iter iter, unsigned int i) { assert(iter != attr_map.end()); -#if 1 - return (*iter)->type == Attr_container ? (string)"None" : (*(*iter)->attr)[i]; -#else - if ((*iter)->type == Attr_container) { - return "None"; - } - else { - cerr << "(*iter)->attr: " << (*iter)->attr << endl; - cerr << "(*iter)->name: " << (*iter)->name << endl; - cerr << "(*iter)->type: " << (*iter)->type << endl; - //cerr << "get_attr: return value: [" << i << "]: " << (*(*iter)->attr)[i]<< endl; - if ((*iter)->name == "SIS_ID") - return "SIS_ID_value"; - else - return (*(*iter)->attr)[i]; - } -#endif + + return (*iter)->type == Attr_container ? (string) "None" : (*(*iter)->attr)[i]; } -string -AttrTable::get_attr(const string &name, unsigned int i) +string AttrTable::get_attr(const string &name, unsigned int i) { Attr_iter p = simple_find(name); - return (p != attr_map.end()) ? get_attr(p, i) : (string)""; + return (p != attr_map.end()) ? get_attr(p, i) : (string) ""; } /** Returns a pointer to the vector of values associated with the @@ -823,24 +869,22 @@ return (*iter)->type != Attr_container ? (*iter)->attr : 0; } -bool -AttrTable::is_global_attribute(Attr_iter iter) +bool AttrTable::is_global_attribute(Attr_iter iter) { assert(iter != attr_map.end()); if ((*iter)->type == Attr_container) - return (*iter)->attributes->is_global_attribute(); + return (*iter)->attributes->is_global_attribute(); else - return (*iter)->is_global; + return (*iter)->is_global; } -void -AttrTable::set_is_global_attribute(Attr_iter iter, bool ga) +void AttrTable::set_is_global_attribute(Attr_iter iter, bool ga) { assert(iter != attr_map.end()); if ((*iter)->type == Attr_container) - (*iter)->attributes->set_is_global_attribute(ga); + (*iter)->attributes->set_is_global_attribute(ga); else - (*iter)->is_global = ga; + (*iter)->is_global = ga; } //@} Accessors that use an iterator @@ -851,14 +895,16 @@ @param src The existing attribute container to alias. @exception Error if an attribute, container or alias called name already exists in this attribute table. */ -void -AttrTable::add_container_alias(const string &name, AttrTable *src) +void AttrTable::add_container_alias(const string &name, AttrTable *src) { +#if WWW_ENCODING string lname = www2id(name); +#else + string lname = remove_space_encoding(name); +#endif if (simple_find(lname) != attr_end()) - throw Error(string("There already exists a container called `") - + name + string("in this attribute table.")); + throw Error(string("There already exists a container called `") + name + string("in this attribute table. (2)")); entry *e = new entry; e->name = lname; @@ -883,12 +929,19 @@ @exception Error if the attribute table already contains an attribute, container or alias called name or if an attribute called source does not exist. */ -void -AttrTable::add_value_alias(AttrTable *das, const string &name, - const string &source) +void AttrTable::add_value_alias(AttrTable *das, const string &name, const string &source) { +#if WWW_ENCODING string lname = www2id(name); +#else + string lname = remove_space_encoding(name); +#endif + +#if WWW_ENCODING string lsource = www2id(source); +#else + string lsource = remove_space_encoding(source); +#endif // find the container that holds source and its (sources's) iterator // within that container. Search at the uppermost level of the attribute @@ -904,18 +957,18 @@ if (!at || (iter == at->attr_end()) || !*iter) { find(lsource, &at, &iter); if (!at || (iter == at->attr_end()) || !*iter) - throw Error(string("Could not find the attribute `") - + source + string("' in the attribute object.")); + throw Error(string("Could not find the attribute `") + source + string("' in the attribute object.")); } // If we've got a value to alias and it's being added at the top level of // the DAS, that's an error. if (at && !at->is_container(iter) && this == das) - throw Error(string("A value cannot be aliased to the top level of the DAS;\nOnly containers may be present at that level of the DAS.")); + throw Error( + string( + "A value cannot be aliased to the top level of the DAS;\nOnly containers may be present at that level of the DAS.")); if (simple_find(lname) != attr_end()) - throw Error(string("There already exists a container called `") - + name + string("in this attribute table.")); + throw Error(string("There already exists a container called `") + name + string("in this attribute table. (3)")); entry *e = new entry; e->name = lname; @@ -923,9 +976,9 @@ e->aliased_to = lsource; e->type = get_attr_type(iter); if (at && e->type == Attr_container) - e->attributes = at->get_attr_table(iter); + e->attributes = at->get_attr_table(iter); else - e->attr = (*iter)->attr; + e->attr = (*iter)->attr; attr_map.push_back(e); } @@ -949,8 +1002,7 @@ @param name The name of the already-existing attribute to which the alias will refer. @param at An attribute table in which to insert the alias. */ -bool -AttrTable::attr_alias(const string &alias, AttrTable *at, const string &name) +bool AttrTable::attr_alias(const string &alias, AttrTable *at, const string &name) { add_value_alias(at, alias, name); return true; @@ -963,8 +1015,7 @@ @param alias The alias to insert into the attribute table. @param name The name of the already-existing attribute to which the alias will refer. */ -bool -AttrTable::attr_alias(const string &alias, const string &name) +bool AttrTable::attr_alias(const string &alias, const string &name) { return attr_alias(alias, this, name); } @@ -972,11 +1023,11 @@ /** Erase the entire attribute table. This returns an AttrTable to the empty state that's the same as the object generated by the null constructor. @brief Erase the attribute table. */ -void -AttrTable::erase() +void AttrTable::erase() { for (Attr_iter i = attr_map.begin(); i != attr_map.end(); ++i) { - delete *i; *i = 0; + delete *i; + *i = 0; } attr_map.erase(attr_map.begin(), attr_map.end()); @@ -997,15 +1048,15 @@ // those quotes were added by the handlers as a hack to get the output // formatting correct for the DAS. jhrg 7/30/08 -static void -write_string_attribute_for_das(ostream &out, const string &value, const string &term) +static void write_string_attribute_for_das(ostream &out, const string &value, const string &term) { if (is_quoted(value)) - out << value << term; + out << value << term; else - out << double_quote << value << double_quote << term; + out << double_quote << value << double_quote << term; } +#if 0 static void write_string_attribute_for_das(FILE *out, const string &value, const string &term) { @@ -1014,18 +1065,19 @@ else fprintf(out, "\"%s\"%s", value.c_str(), term.c_str()); } +#endif // Special treatment for XML: Make sure to escape double quotes when XML is // printed in a DAS. -static void -write_xml_attribute_for_das(ostream &out, const string &value, const string &term) +static void write_xml_attribute_for_das(ostream &out, const string &value, const string &term) { if (is_quoted(value)) - out << escape_double_quotes(value) << term; + out << escape_double_quotes(value) << term; else - out << double_quote << escape_double_quotes(value) << double_quote << term; + out << double_quote << escape_double_quotes(value) << double_quote << term; } +#if 0 static void write_xml_attribute_for_das(FILE *out, const string &value, const string &term) { @@ -1034,26 +1086,35 @@ else fprintf(out, "\"%s\"%s", escape_double_quotes(value).c_str(), term.c_str()); } +#endif /** A simple printer that does nothing fancy with aliases. Protected. */ -void -AttrTable::simple_print(FILE *out, string pad, Attr_iter i, - bool dereference) +void AttrTable::simple_print(FILE *out, string pad, Attr_iter i, bool dereference) { + ostringstream oss; + simple_print(oss, pad, i, dereference); + fwrite(oss.str().data(), 1, oss.str().length(), out); + +#if 0 switch ((*i)->type) { case Attr_container: +#if WWW_ENCODING fprintf(out, "%s%s {\n", pad.c_str(), id2www(get_name(i)).c_str()); - +#else + fprintf(out, "%s%s {\n", pad.c_str(), get_name(i).c_str()); +#endif (*i)->attributes->print(out, pad + " ", dereference); fprintf(out, "%s}\n", pad.c_str()); break; case Attr_string: { - fprintf(out, "%s%s %s ", pad.c_str(), get_type(i).c_str(), - id2www(get_name(i)).c_str()); - +#if WWW_ENCODING + fprintf(out, "%s%s %s ", pad.c_str(), get_type(i).c_str(), id2www(get_name(i)).c_str()); +#else + fprintf(out, "%s%s %s ", pad.c_str(), get_type(i).c_str(), get_name(i).c_str()); +#endif vector *sxp = (*i)->attr; vector::iterator last = sxp->end() - 1; for (vector::iterator i = sxp->begin(); i != last; ++i) { @@ -1064,9 +1125,11 @@ break; case Attr_other_xml: { - fprintf(out, "%s%s %s ", pad.c_str(), get_type(i).c_str(), - id2www(get_name(i)).c_str()); - +#if WWW_ENCODING + fprintf(out, "%s%s %s ", pad.c_str(), get_type(i).c_str(), id2www(get_name(i)).c_str()); +#else + fprintf(out, "%s%s %s ", pad.c_str(), get_type(i).c_str(), get_name(i).c_str()); +#endif vector *sxp = (*i)->attr; vector::iterator last = sxp->end() - 1; for (vector::iterator i = sxp->begin(); i != last; ++i) { @@ -1077,8 +1140,11 @@ break; default: { - fprintf(out, "%s%s %s ", pad.c_str(), get_type(i).c_str(), - id2www(get_name(i)).c_str()); +#if WWW_ENCODING + fprintf(out, "%s%s %s ", pad.c_str(), get_type(i).c_str(), id2www(get_name(i)).c_str()); +#else + fprintf(out, "%s%s %s ", pad.c_str(), get_type(i).c_str(), get_name(i).c_str()); +#endif vector *sxp = (*i)->attr; vector::iterator last = sxp->end() - 1; @@ -1089,57 +1155,67 @@ } break; } +#endif } /** A simple printer that does nothing fancy with aliases. Protected. */ -void -AttrTable::simple_print(ostream &out, string pad, Attr_iter i, - bool dereference) +void AttrTable::simple_print(ostream &out, string pad, Attr_iter i, bool dereference) { switch ((*i)->type) { - case Attr_container: + case Attr_container: +#if WWW_ENCODING out << pad << id2www(get_name(i)) << " {\n"; - +#else + out << pad << add_space_encoding(get_name(i)) << " {\n"; +#endif (*i)->attributes->print(out, pad + " ", dereference); - out << pad << "}\n"; break; - case Attr_string: { - out << pad << get_type(i) << " " << id2www(get_name(i)) << " "; - - vector *sxp = (*i)->attr; - vector::iterator last = sxp->end() - 1; - for (vector::iterator i = sxp->begin(); i != last; ++i) { - write_string_attribute_for_das(out, *i, ", "); - } - write_string_attribute_for_das(out, *last, ";\n"); + case Attr_string: { +#if WWW_ENCODING + out << pad << get_type(i) << " " << id2www(get_name(i)) << " "; +#else + out << pad << get_type(i) << " " << add_space_encoding(get_name(i)) << " "; +#endif + vector *sxp = (*i)->attr; + vector::iterator last = sxp->end() - 1; + for (vector::iterator i = sxp->begin(); i != last; ++i) { + write_string_attribute_for_das(out, *i, ", "); } + write_string_attribute_for_das(out, *last, ";\n"); + } break; - case Attr_other_xml: { - out << pad << get_type(i) << " " << id2www(get_name(i)) << " "; - - vector *sxp = (*i)->attr; - vector::iterator last = sxp->end() - 1; - for (vector::iterator i = sxp->begin(); i != last; ++i) { - write_xml_attribute_for_das(out, *i, ", "); - } - write_xml_attribute_for_das(out, *last, ";\n"); + case Attr_other_xml: { +#if WWW_ENCODING + out << pad << get_type(i) << " " << id2www(get_name(i)) << " "; +#else + out << pad << get_type(i) << " " << add_space_encoding(get_name(i)) << " "; +#endif + vector *sxp = (*i)->attr; + vector::iterator last = sxp->end() - 1; + for (vector::iterator i = sxp->begin(); i != last; ++i) { + write_xml_attribute_for_das(out, *i, ", "); } + write_xml_attribute_for_das(out, *last, ";\n"); + } break; - default: { - out << pad << get_type(i) << " " << id2www(get_name(i)) << " "; - - vector *sxp = (*i)->attr; - vector::iterator last = sxp->end() - 1; - for (vector::iterator i = sxp->begin(); i != last; ++i) { - out << *i <<", "; - } - out << *last << ";\n"; + default: { +#if WWW_ENCODING + out << pad << get_type(i) << " " << id2www(get_name(i)) << " "; +#else + out << pad << get_type(i) << " " << add_space_encoding(get_name(i)) << " "; +#endif + vector *sxp = (*i)->attr; + vector::iterator last = sxp->end() - 1; + for (vector::iterator i = sxp->begin(); i != last; ++i) { + out << *i << ", "; } + out << *last << ";\n"; + } break; } } @@ -1154,25 +1230,36 @@ default this is a string of four spaces @param dereference If true, follow aliases. Default is false. */ -void -AttrTable::print(FILE *out, string pad, bool dereference) +void AttrTable::print(FILE *out, string pad, bool dereference) { + ostringstream oss; + print(oss, pad, dereference); + fwrite(oss.str().data(), 1, oss.str().length(), out); + +#if 0 for (Attr_iter i = attr_map.begin(); i != attr_map.end(); ++i) { if ((*i)->is_alias) { if (dereference) { simple_print(out, pad, i, dereference); } else { +#if WWW_ENCODING fprintf(out, "%sAlias %s %s;\n", pad.c_str(), id2www(get_name(i)).c_str(), id2www((*i)->aliased_to).c_str()); +#else + fprintf(out, "%sAlias %s %s;\n", + pad.c_str(), add_space_encoding(get_name(i)).c_str(), add_space_encoding((*i)->aliased_to).c_str()); + +#endif } } else { simple_print(out, pad, i, dereference); } } +#endif } /** Prints an ASCII representation of the attribute table to the @@ -1185,8 +1272,7 @@ default this is a string of four spaces @param dereference If true, follow aliases. Default is false. */ -void -AttrTable::print(ostream &out, string pad, bool dereference) +void AttrTable::print(ostream &out, string pad, bool dereference) { for (Attr_iter i = attr_map.begin(); i != attr_map.end(); ++i) { if ((*i)->is_alias) { @@ -1194,8 +1280,13 @@ simple_print(out, pad, i, dereference); } else { +#if WWW_ENCODING out << pad << "Alias " << id2www(get_name(i)) << " " << id2www((*i)->aliased_to) << ";\n"; +#else + out << pad << "Alias " << add_space_encoding(get_name(i)) << " " + << add_space_encoding((*i)->aliased_to) << ";\n"; +#endif } } else { @@ -1207,10 +1298,21 @@ /** Print the attribute table in XML. @param out Destination @param pad Indent lines of text/xml this much. Default is four spaces. - @param constrained Not used */ -void -AttrTable::print_xml(FILE *out, string pad, bool /*constrained*/) -{ + @param constrained Not used + @deprecated */ +void AttrTable::print_xml(FILE *out, string pad, bool /*constrained*/) +{ + XMLWriter xml(pad); + print_xml_writer(xml); + fwrite(xml.get_doc(), sizeof(char), xml.get_doc_size(), out); + +#if OLD_XML_MOETHODS + ostringstream oss; + print_xml(oss, pad); + fwrite(oss.str().data(), 1, oss.str().length(), out); +#endif + +#if 0 // Why this works: AttrTable is really a hacked class that used to // implement a single-level set of attributes. Containers // were added several years later by dropping in the 'entry' structure. @@ -1245,27 +1347,31 @@ // cannot be an vector of XML things as can be with the other types. if (get_attr_type(i) == Attr_other_xml) { if (get_attr_num(i) != 1) - throw Error("OtherXML attributes cannot be vector-valued."); + throw Error("OtherXML attributes cannot be vector-valued."); fprintf(out, "%s%s\n", value_pad.c_str(), get_attr(i, 0).c_str()); } else { for (unsigned j = 0; j < get_attr_num(i); ++j) { fprintf(out, "%s%s\n", value_pad.c_str(), - id2xml(get_attr(i, j)).c_str()); + id2xml(get_attr(i, j)).c_str()); } } fprintf(out, "%s\n", pad.c_str()); } } +#endif } -/** Print the attribute table in XML. - @param out Destination stream - @param pad Indent lines of text/xml this much. Default is four spaces. - @param constrained Not used */ -void -AttrTable::print_xml(ostream &out, string pad, bool /*constrained*/) +/** + * @deprecated + */ +void AttrTable::print_xml(ostream &out, string pad, bool /*constrained*/) { + XMLWriter xml(pad); + print_xml_writer(xml); + out << xml.get_doc(); + +#if 0 for (Attr_iter i = attr_begin(); i != attr_end(); ++i) { if ((*i)->is_alias) { out << pad << "\n"; } } +#endif +} + +/** Print the attribute table in XML. + @param out Destination stream + @param pad Indent lines of text/xml this much. Default is four spaces. + @param constrained Not used */ +void AttrTable::print_xml_writer(XMLWriter &xml) +{ + for (Attr_iter i = attr_begin(); i != attr_end(); ++i) { + if ((*i)->is_alias) { + if (xmlTextWriterStartElement(xml.get_writer(), (const xmlChar*) "Alias") < 0) + throw InternalErr(__FILE__, __LINE__, "Could not write Alias element"); + if (xmlTextWriterWriteAttribute(xml.get_writer(), (const xmlChar*) "name", + (const xmlChar*) get_name(i).c_str()) < 0) + throw InternalErr(__FILE__, __LINE__, "Could not write attribute for name"); + if (xmlTextWriterWriteAttribute(xml.get_writer(), (const xmlChar*) "Attribute", + (const xmlChar*) (*i)->aliased_to.c_str()) < 0) + throw InternalErr(__FILE__, __LINE__, "Could not write attribute for name"); + if (xmlTextWriterEndElement(xml.get_writer()) < 0) + throw InternalErr(__FILE__, __LINE__, "Could not end Alias element"); + } + else if (is_container(i)) { + if (xmlTextWriterStartElement(xml.get_writer(), (const xmlChar*) "Attribute") < 0) + throw InternalErr(__FILE__, __LINE__, "Could not write Attribute element"); + if (xmlTextWriterWriteAttribute(xml.get_writer(), (const xmlChar*) "name", + (const xmlChar*) get_name(i).c_str()) < 0) + throw InternalErr(__FILE__, __LINE__, "Could not write attribute for name"); + if (xmlTextWriterWriteAttribute(xml.get_writer(), (const xmlChar*) "type", + (const xmlChar*) get_type(i).c_str()) < 0) + throw InternalErr(__FILE__, __LINE__, "Could not write attribute for name"); + + get_attr_table(i)->print_xml_writer(xml); + + if (xmlTextWriterEndElement(xml.get_writer()) < 0) + throw InternalErr(__FILE__, __LINE__, "Could not end Attribute element"); + } + else { + if (xmlTextWriterStartElement(xml.get_writer(), (const xmlChar*) "Attribute") < 0) + throw InternalErr(__FILE__, __LINE__, "Could not write Attribute element"); + if (xmlTextWriterWriteAttribute(xml.get_writer(), (const xmlChar*) "name", + (const xmlChar*) get_name(i).c_str()) < 0) + throw InternalErr(__FILE__, __LINE__, "Could not write attribute for name"); + if (xmlTextWriterWriteAttribute(xml.get_writer(), (const xmlChar*) "type", + (const xmlChar*) get_type(i).c_str()) < 0) + throw InternalErr(__FILE__, __LINE__, "Could not write attribute for name"); + + if (get_attr_type(i) == Attr_other_xml) { + if (get_attr_num(i) != 1) + throw Error("OtherXML attributes cannot be vector-valued."); + // Replaced xmltextWriterWriteString with xmlTextWriterWriteRaw to keep the + // libxml2 code from escaping the xml (which was breaking all of the inferencing + // code. jhrg + if (xmlTextWriterWriteRaw(xml.get_writer(), (const xmlChar*) get_attr(i, 0).c_str()) < 0) + throw InternalErr(__FILE__, __LINE__, "Could not write OtherXML value"); + } + else { + for (unsigned j = 0; j < get_attr_num(i); ++j) { + if (xmlTextWriterStartElement(xml.get_writer(), (const xmlChar*) "value") < 0) + throw InternalErr(__FILE__, __LINE__, "Could not write value element"); + + if (xmlTextWriterWriteString(xml.get_writer(), (const xmlChar*) get_attr(i, j).c_str()) < 0) + throw InternalErr(__FILE__, __LINE__, "Could not write attribute value"); + + if (xmlTextWriterEndElement(xml.get_writer()) < 0) + throw InternalErr(__FILE__, __LINE__, "Could not end value element"); + } + } + if (xmlTextWriterEndElement(xml.get_writer()) < 0) + throw InternalErr(__FILE__, __LINE__, "Could not end Attribute element"); + } + } } /** @brief dumps information about this object @@ -1308,11 +1486,9 @@ * @param strm C++ i/o stream to dump the information to * @return void */ -void -AttrTable::dump(ostream &strm) const +void AttrTable::dump(ostream &strm) const { - strm << DapIndent::LMarg << "AttrTable::dump - (" - << (void *)this << ")" << endl; + strm << DapIndent::LMarg << "AttrTable::dump - (" << (void *) this << ")" << endl; DapIndent::Indent(); strm << DapIndent::LMarg << "table name: " << d_name << endl; if (attr_map.size()) { @@ -1324,22 +1500,16 @@ entry *e = (*i); string type = AttrType_to_String(e->type); if (e->is_alias) { - strm << DapIndent::LMarg << "alias: " << e->name - << " aliased to: " << e->aliased_to - << endl; + strm << DapIndent::LMarg << "alias: " << e->name << " aliased to: " << e->aliased_to << endl; } else if (e->type == Attr_container) { - strm << DapIndent::LMarg << "attr: " << e->name - << " of type " << type - << endl; + strm << DapIndent::LMarg << "attr: " << e->name << " of type " << type << endl; DapIndent::Indent(); e->attributes->dump(strm); DapIndent::UnIndent(); } else { - strm << DapIndent::LMarg << "attr: " << e->name - << " of type " << type - << endl; + strm << DapIndent::LMarg << "attr: " << e->name << " of type " << type << endl; DapIndent::Indent(); strm << DapIndent::LMarg; vector::const_iterator iter = e->attr->begin(); @@ -1357,8 +1527,7 @@ strm << DapIndent::LMarg << "attributes: empty" << endl; } if (d_parent) { - strm << DapIndent::LMarg << "parent table:" - << d_name << ":" << (void *)d_parent << endl; + strm << DapIndent::LMarg << "parent table:" << d_name << ":" << (void *) d_parent << endl; } else { strm << DapIndent::LMarg << "parent table: none" << d_name << endl; diff -Nru libdap-3.11.1/AttrTable.h libdap-3.12.0/AttrTable.h --- libdap-3.11.1/AttrTable.h 2011-04-29 13:19:43.000000000 +0000 +++ libdap-3.12.0/AttrTable.h 2013-10-17 21:27:40.000000000 +0000 @@ -19,7 +19,7 @@ // // You should have received a copy of the GNU Lesser General Public // License along with this library; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA // // You can contact OPeNDAP, Inc. at PO Box 112, Saunderstown, RI. 02874-0112. @@ -50,6 +50,10 @@ #include "DapObj.h" #endif +#ifndef XMLWRITER_H_ +#include "XMLWriter.h" +#endif + namespace libdap { @@ -338,6 +342,8 @@ virtual void print_xml(ostream &out, string pad = " ", bool constrained = false); + void print_xml_writer(XMLWriter &xml); + virtual void dump(ostream &strm) const ; }; diff -Nru libdap-3.11.1/BaseType.cc libdap-3.12.0/BaseType.cc --- libdap-3.11.1/BaseType.cc 2011-04-29 13:19:43.000000000 +0000 +++ libdap-3.12.0/BaseType.cc 2013-10-17 21:27:40.000000000 +0000 @@ -19,7 +19,7 @@ // // You should have received a copy of the GNU Lesser General Public // License along with this library; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA // // You can contact OPeNDAP, Inc. at PO Box 112, Saunderstown, RI. 02874-0112. @@ -77,21 +77,27 @@ @brief Perform a deep copy. @param bt The source object. */ void -BaseType::_duplicate(const BaseType &bt) +BaseType::m_duplicate(const BaseType &bt) { - DBG(cerr << "BaseType::_duplicate: " << bt._name << " send_p: " - << bt._send_p << endl); - _name = bt._name; - _type = bt._type; - _dataset = bt._dataset; - _read_p = bt._read_p; // added, reza - _send_p = bt._send_p; // added, reza + DBG2(cerr << "BaseType::_duplicate: " << bt.d_name << " send_p: " + << bt.d_is_send << endl); + d_name = bt.d_name; + d_type = bt.d_type; + d_dataset = bt.d_dataset; + d_is_read = bt.d_is_read; // added, reza + d_is_send = bt.d_is_send; // added, reza d_in_selection = bt.d_in_selection; - _synthesized_p = bt._synthesized_p; // 5/11/2001 jhrg + d_is_synthesized = bt.d_is_synthesized; // 5/11/2001 jhrg d_parent = bt.d_parent; // copy pointers 6/4/2001 jhrg d_attr = bt.d_attr; // Deep copy. + +#if DAP4 + // FIXME How to copy? these are pointers + d_dims = bt.d_dims; + d_maps = bt.d_maps; +#endif } // Public mfuncs @@ -103,13 +109,50 @@ directly. @brief The BaseType constructor. + + @param n A string containing the name of the new variable. + @param t The type of the variable. + @param is_dap4 True if this is a DAP4 variable. Default is False + @see Type */ +BaseType::BaseType(const string &n, const Type &t, bool is_dap4) + : d_name(n), d_type(t), d_dataset(""), d_is_read(false), d_is_send(false), + d_in_selection(false), d_is_synthesized(false), d_parent(0), + d_is_dap4(is_dap4) +{} + +/** The BaseType constructor needs a name, a dataset, and a type. + The BaseType class exists to provide data to + type classes that inherit from it. The constructors of those + classes call the BaseType constructor; it is never called + directly. + + @brief The BaseType constructor. + @param n A string containing the name of the new variable. + @param d A string containing the dataset name. + @param t The type of the variable. Default is False + @param is_dap4 True if this is a DAP4 variable. + @see Type */ +BaseType::BaseType(const string &n, const string &d, const Type &t, bool is_dap4) + : d_name(n), d_type(t), d_dataset(d), d_is_read(false), d_is_send(false), + d_in_selection(false), d_is_synthesized(false), d_parent(0), + d_is_dap4(is_dap4) +{} +#if 0 +/** The BaseType constructor needs a name and a type. + The BaseType class exists to provide data to + type classes that inherit from it. The constructors of those + classes call the BaseType constructor; it is never called + directly. + + @brief The BaseType constructor. @param n A string containing the name of the new variable. @param t The type of the variable. data in this variable to a client DODS process. @see Type */ -BaseType::BaseType(const string &n, const Type &t) - : _name(n), _type(t), _dataset(""), _read_p(false), _send_p(false), - d_in_selection(false), _synthesized_p(false), d_parent(0) +BaseType::BaseType(const string &n, const Type &t, bool is_dap4) + : d_name(n), d_type(t), d_dataset(""), d_is_read(false), d_is_send(false), + d_in_selection(false), d_is_synthesized(false), d_parent(0), + d_is_dap4(is_dap4) {} /** The BaseType constructor needs a name, a dataset, and a type. @@ -125,21 +168,22 @@ @param t The type of the variable. data in this variable to a client DODS process. @see Type */ -BaseType::BaseType(const string &n, const string &d, const Type &t) - : _name(n), _type(t), _dataset(d), _read_p(false), _send_p(false), - d_in_selection(false), _synthesized_p(false), d_parent(0) +BaseType::BaseType(const string &n, const string &d, const Type &t, bool is_dap4) + : d_name(n), d_type(t), d_dataset(d), d_is_read(false), d_is_send(false), + d_in_selection(false), d_is_synthesized(false), d_parent(0), + d_is_dap4(is_dap4) {} - +#endif /** @brief The BaseType copy constructor. */ BaseType::BaseType(const BaseType ©_from) : DapObj() { - _duplicate(copy_from); + m_duplicate(copy_from); } BaseType::~BaseType() { - DBG(cerr << "Entering ~BaseType (" << this << ")" << endl); - DBG(cerr << "Exiting ~BaseType" << endl); + DBG2(cerr << "Entering ~BaseType (" << this << ")" << endl); + DBG2(cerr << "Exiting ~BaseType" << endl); } BaseType & @@ -148,7 +192,7 @@ if (this == &rhs) return *this; - _duplicate(rhs); + m_duplicate(rhs); return *this; } @@ -162,12 +206,12 @@ { ostringstream oss; oss << "BaseType (" << this << "):" << endl - << " _name: " << _name << endl + << " _name: " << d_name << endl << " _type: " << type_name() << endl - << " _dataset: " << _dataset << endl - << " _read_p: " << _read_p << endl - << " _send_p: " << _send_p << endl - << " _synthesized_p: " << _synthesized_p << endl + << " _dataset: " << d_dataset << endl + << " _read_p: " << d_is_read << endl + << " _send_p: " << d_is_send << endl + << " _synthesized_p: " << d_is_synthesized << endl << " d_parent: " << d_parent << endl << " d_attr: " << hex << &d_attr << dec << endl; @@ -189,12 +233,12 @@ << (void *)this << ")" << endl ; DapIndent::Indent() ; - strm << DapIndent::LMarg << "name: " << _name << endl ; + strm << DapIndent::LMarg << "name: " << d_name << endl ; strm << DapIndent::LMarg << "type: " << type_name() << endl ; - strm << DapIndent::LMarg << "dataset: " << _dataset << endl ; - strm << DapIndent::LMarg << "read_p: " << _read_p << endl ; - strm << DapIndent::LMarg << "send_p: " << _send_p << endl ; - strm << DapIndent::LMarg << "synthesized_p: " << _synthesized_p << endl ; + strm << DapIndent::LMarg << "dataset: " << d_dataset << endl ; + strm << DapIndent::LMarg << "read_p: " << d_is_read << endl ; + strm << DapIndent::LMarg << "send_p: " << d_is_send << endl ; + strm << DapIndent::LMarg << "synthesized_p: " << d_is_synthesized << endl ; strm << DapIndent::LMarg << "parent: " << (void *)d_parent << endl ; strm << DapIndent::LMarg << "attributes: " << endl ; DapIndent::Indent() ; @@ -209,7 +253,7 @@ string BaseType::name() const { - return _name; + return d_name; } /** @brief Sets the name of the class instance. */ @@ -217,7 +261,7 @@ BaseType::set_name(const string &n) { string name = n; - _name = www2id(name); // www2id writes into its param. + d_name = www2id(name); // www2id writes into its param. } /** @brief Returns the name of the dataset used to create this instance @@ -230,28 +274,30 @@ string BaseType::dataset() const { - return _dataset; + return d_dataset; } /** @brief Returns the type of the class instance. */ Type BaseType::type() const { - return _type; + return d_type; } /** @brief Sets the type of the class instance. */ void BaseType::set_type(const Type &t) { - _type = t; + d_type = t; } /** @brief Returns the type of the class instance as a string. */ string BaseType::type_name() const { - switch (_type) { + return libdap::type_name(d_type); +#if 0 + switch (d_type) { case dods_null_c: return string("Null"); case dods_byte_c: @@ -280,10 +326,27 @@ return string("Sequence"); case dods_grid_c: return string("Grid"); + + case dods_int8_c: + return string("Int8"); + case dods_uint8_c: + return string("UInt8"); + case dods_int64_c: + return string("Int64"); + case dods_uint64_c: + return string("UInt64"); + case dods_url4_c: + return string("URL"); + case dods_group_c: + return string("Group"); + case dods_enum_c: + return string("Enum"); + default: cerr << "BaseType::type_name: Undefined type" << endl; return string(""); } +#endif } /** @brief Returns true if the instance is a numeric, string or URL @@ -294,27 +357,42 @@ bool BaseType::is_simple_type() { + return libdap::is_simple_type(type()); +#if 0 switch (type()) { case dods_null_c: case dods_byte_c: + + case dods_int8_c: + case dods_uint8_c: + case dods_int16_c: case dods_uint16_c: case dods_int32_c: case dods_uint32_c: + + case dods_int64_c: + case dods_uint64_c: + case dods_float32_c: case dods_float64_c: case dods_str_c: case dods_url_c: + + case dods_url4_c: + case dods_enum_c: return true; case dods_array_c: case dods_structure_c: case dods_sequence_c: case dods_grid_c: + case dods_group_c: return false; } return false; +#endif } /** @brief Returns true if the instance is a vector (i.e., array) type @@ -323,17 +401,30 @@ bool BaseType::is_vector_type() { + return libdap::is_vector_type(type()); +#if 0 switch (type()) { case dods_null_c: case dods_byte_c: + + case dods_int8_c: + case dods_uint8_c: + case dods_int16_c: case dods_uint16_c: case dods_int32_c: case dods_uint32_c: + + case dods_int64_c: + case dods_uint64_c: + case dods_float32_c: case dods_float64_c: case dods_str_c: case dods_url_c: + + case dods_url4_c: + case dods_enum_c: return false; case dods_array_c: @@ -342,10 +433,12 @@ case dods_structure_c: case dods_sequence_c: case dods_grid_c: + case dods_group_c: return false; } return false; +#endif } /** @brief Returns true if the instance is a constructor (i.e., Structure, @@ -355,29 +448,71 @@ bool BaseType::is_constructor_type() { + return libdap::is_constructor_type(type()); +#if 0 switch (type()) { case dods_null_c: case dods_byte_c: + + case dods_int8_c: + case dods_uint8_c: + case dods_int16_c: case dods_uint16_c: case dods_int32_c: case dods_uint32_c: + + case dods_int64_c: + case dods_uint64_c: + case dods_float32_c: case dods_float64_c: case dods_str_c: case dods_url_c: + + case dods_url4_c: + case dods_enum_c: + case dods_array_c: return false; case dods_structure_c: case dods_sequence_c: case dods_grid_c: + case dods_group_c: return true; } return false; +#endif +} + +#if 0 +/** + * Return true if this variable's type is allowed only for DAP4. + * + * @note the default implementation returns false; the new DAP4 + * implementations must overload this method. + */ +bool +BaseType::is_dap4_only_type() +{ + return false; } +/** + * Return true if this variable's type is allowed only for DAP2. + * + * @note the default implementation returns false; the old DAP2 + * implementations must overload this method. + */ +bool +BaseType::is_dap2_only_type() +{ + return false; +} +#endif + /** Return a count of the total number of variables in this variable. This is used to count the number of variables held by a constructor variable - for simple type and vector variables it always @@ -415,7 +550,7 @@ bool BaseType::synthesized_p() { - return _synthesized_p; + return d_is_synthesized; } /** Set the synthesized flag. Before setting this flag be sure to set the @@ -426,10 +561,10 @@ void BaseType::set_synthesized_p(bool state) { - _synthesized_p = state; + d_is_synthesized = state; } -// Return the state of _read_p (true if the value of the variable has been +// Return the state of d_is_read (true if the value of the variable has been // read (and is in memory) false otherwise). /** Returns true if the value(s) for this variable have been read from the @@ -443,7 +578,7 @@ bool BaseType::read_p() { - return _read_p; + return d_is_read; } /** Sets the value of the read_p property. This indicates that the @@ -482,10 +617,10 @@ void BaseType::set_read_p(bool state) { - if (! _synthesized_p) { - DBG(cerr << "Changing read_p state of " << name() << " to " + if (! d_is_synthesized) { + DBG2(cerr << "Changing read_p state of " << name() << " to " << state << endl); - _read_p = state; + d_is_read = state; } } @@ -502,23 +637,23 @@ bool BaseType::send_p() { - return _send_p; + return d_is_send; } /** Sets the value of the send_p flag. This function is meant to be called from within the constraint evaluator of other code which determines that this variable should be returned to the - client. Data are ready to be sent when both the _send_p - and _read_p flags are set to TRUE. + client. Data are ready to be sent when both the d_is_send + and d_is_read flags are set to TRUE. @param state The logical state to set the send_p flag. */ void BaseType::set_send_p(bool state) { - DBG(cerr << "Calling BaseType::set_send_p() for: " << this->name() + DBG2(cerr << "Calling BaseType::set_send_p() for: " << this->name() << endl); - _send_p = state; + d_is_send = state; } @@ -567,32 +702,27 @@ * @param at_container Transfer attributes from this container. * @return void */ -void -BaseType::transfer_attributes(AttrTable *at_container) -{ - AttrTable *at = at_container->get_attr_table(name()); +void BaseType::transfer_attributes(AttrTable *at_container) { + AttrTable *at = at_container->get_attr_table(name()); - DBG(cerr << "In BaseType::transfer_attributes; processing " << name() << endl); + DBG(cerr << "In BaseType::transfer_attributes; processing " << name() << endl); - if (at) { - at->set_is_global_attribute(false); - DBG(cerr << "Processing AttrTable: " << at->get_name() << endl); + if (at) { + at->set_is_global_attribute(false); + DBG(cerr << "Processing AttrTable: " << at->get_name() << endl); + + AttrTable::Attr_iter at_p = at->attr_begin(); + while (at_p != at->attr_end()) { + DBG(cerr << "About to append " << "attr name, type:" << at->get_name(at_p) << ", " << at->get_type(at_p) << endl); + + if (at->get_attr_type(at_p) == Attr_container) + get_attr_table().append_container(new AttrTable(*at->get_attr_table(at_p)), at->get_name(at_p)); + else + get_attr_table().append_attr(at->get_name(at_p), at->get_type(at_p), at->get_attr_vector(at_p)); - AttrTable::Attr_iter at_p = at->attr_begin(); - while (at_p != at->attr_end()) { - DBG(cerr << "About to append " << endl); - DBG(cerr << "attr name,type:" << at->get_name(at_p) << ", " << at->get_type(at_p) << endl); - - if (at->get_attr_type(at_p) == Attr_container) - get_attr_table().append_container(new AttrTable(*at->get_attr_table(at_p)), - at->get_name(at_p)); - else - get_attr_table().append_attr(at->get_name(at_p), - at->get_type(at_p), at->get_attr_vector(at_p)); - - at_p++; + at_p++; + } } - } } /** Does this variable appear in either the selection part or as a function @@ -628,17 +758,20 @@ } // Protected method. -/** Set the parent property for this variable. Only instances of - Constructor or Vector should call this method. +/** Set the parent property for this variable. - @param parent Pointer to the Constructor of Vector parent variable. + @note Added ability to set parent to null. 10/19/12 jhrg + + @param parent Pointer to the Constructor of Vector parent variable or null + if the variable has no parent (if it is at the top-level of a DAP2/3 DDS). @exception InternalErr thrown if called with anything other than a - Constructor or Vector. */ + Constructor, Vector or Null. */ void BaseType::set_parent(BaseType *parent) { if (!dynamic_cast(parent) - && !dynamic_cast(parent)) + && !dynamic_cast(parent) + && parent != 0) throw InternalErr("Call to set_parent with incorrect variable type."); d_parent = parent; @@ -698,7 +831,7 @@ type you must either use the var() method to get a pointer to the actual instance added to \c *this or you must first add all of bt's children to it before adding it to \c *this. The implementations should use - _duplicate() to perform a deep copy of \e bt. + m_duplicate() to perform a deep copy of \e bt. @brief Add a variable. @@ -789,24 +922,23 @@ bool BaseType::read() { - if (_read_p) + if (d_is_read) return false; - throw InternalErr("Unimplemented BaseType::read() method called."); + throw InternalErr("Unimplemented BaseType::read() method called for the variable named: " + name()); } void BaseType::intern_data(ConstraintEvaluator &, DDS &dds) { dds.timeout_on(); - DBG(cerr << "BaseType::intern_data: " << name() << endl); + DBG2(cerr << "BaseType::intern_data: " << name() << endl); if (!read_p()) read(); // read() throws Error and InternalErr dds.timeout_off(); } -#if FILE_METHODS /** Write the variable's declaration in a C-style syntax. This function is used to create textual representation of the Data Descriptor Structure (DDS). See The DODS User Manual for @@ -853,25 +985,10 @@ BaseType::print_decl(FILE *out, string space, bool print_semi, bool constraint_info, bool constrained) { - // if printing the constrained declaration, exit if this variable was not - // selected. - if (constrained && !send_p()) - return; - - fprintf(out, "%s%s %s", space.c_str(), type_name().c_str(), - id2www(_name).c_str()) ; - - if (constraint_info) { - if (send_p()) - fprintf(out, ": Send True") ; - else - fprintf(out, ": Send False") ; - } - - if (print_semi) - fprintf(out, ";\n") ; + ostringstream oss; + print_decl(oss, space, print_semi, constraint_info, constrained); + fwrite(oss.str().data(), sizeof(char), oss.str().length(), out); } -#endif /** Write the variable's declaration in a C-style syntax. This function is used to create textual representation of the Data @@ -924,7 +1041,7 @@ if (constrained && !send_p()) return; - out << space << type_name() << " " << id2www(_name) ; + out << space << type_name() << " " << id2www(d_name) ; if (constraint_info) { if (send_p()) @@ -937,34 +1054,35 @@ out << ";\n" ; } -#if FILE_METHODS /** Write the XML representation of this variable. This method is used to build the DDX XML response. @param out Destination. @param space Use this to indent child declarations. Default is "". @param constrained If true, only print this if it's part part of the - current projection. Default is False. */ + current projection. Default is False. + @deprecated */ void BaseType::print_xml(FILE *out, string space, bool constrained) { - if (constrained && !send_p()) - return; + XMLWriter xml(space); + print_xml_writer(xml, constrained); + fwrite(xml.get_doc(), sizeof(char), xml.get_doc_size(), out); +} - fprintf(out, "%s<%s", space.c_str(), type_name().c_str()); - if (!_name.empty()) - fprintf(out, " name=\"%s\"", id2xml(_name).c_str()); - - if (get_attr_table().get_size() > 0) { - fprintf(out, ">\n"); // close the variable's tag - get_attr_table().print_xml(out, space + " ", constrained); - // After attributes, print closing tag - fprintf(out, "%s\n", space.c_str(), type_name().c_str()); - } - else { - fprintf(out, "/>\n"); // no attributes; just close tag. - } +/** Write the XML representation of this variable. This method is used to + build the DDX XML response. + @param out Destination output stream + @param space Use this to indent child declarations. Default is "". + @param constrained If true, only print this if it's part part of the + current projection. Default is False. + @deprecated */ +void +BaseType::print_xml(ostream &out, string space, bool constrained) +{ + XMLWriter xml(space); + print_xml_writer(xml, constrained); + out << xml.get_doc(); } -#endif /** Write the XML representation of this variable. This method is used to build the DDX XML response. @@ -973,24 +1091,23 @@ @param constrained If true, only print this if it's part part of the current projection. Default is False. */ void -BaseType::print_xml(ostream &out, string space, bool constrained) +BaseType::print_xml_writer(XMLWriter &xml, bool constrained) { if (constrained && !send_p()) return; - out << space << "<" << type_name() ; - if (!_name.empty()) - out << " name=\"" << id2xml(_name) << "\"" ; - - if (get_attr_table().get_size() > 0) { - out << ">\n" ; - get_attr_table().print_xml(out, space + " ", constrained); - // After attributes, print closing tag - out << space << "\n" ; - } - else { - out << "/>\n" ; - } + if (xmlTextWriterStartElement(xml.get_writer(), (const xmlChar*)type_name().c_str()) < 0) + throw InternalErr(__FILE__, __LINE__, "Could not write " + type_name() + " element"); + + if (!d_name.empty()) + if (xmlTextWriterWriteAttribute(xml.get_writer(), (const xmlChar*) "name", (const xmlChar*)d_name.c_str()) < 0) + throw InternalErr(__FILE__, __LINE__, "Could not write attribute for name"); + + if (get_attr_table().get_size() > 0) + get_attr_table().print_xml_writer(xml); + + if (xmlTextWriterEndElement(xml.get_writer()) < 0) + throw InternalErr(__FILE__, __LINE__, "Could not end " + type_name() + " element"); } // Compares the object's current state with the semantics of a particular @@ -1035,7 +1152,7 @@ bool BaseType::check_semantics(string &msg, bool) { - bool sem = (_type != dods_null_c && _name.length()); + bool sem = (d_type != dods_null_c && d_name.length()); if (!sem) msg = "Every variable must have both a name and a type\n"; @@ -1087,4 +1204,23 @@ throw InternalErr(__FILE__, __LINE__, "Unimplemented operator."); } +// FIXME update this comment if the removal of width() works +/** This version of width simply returns the same thing as width() for simple + types and Arrays. For Constructors, it needs to be specialized. This is + partly due to an inconsistency in the way Vector::width() is implemented. + That method uses the constrained size of the array (while the Constructor + versions do not take the constraint into account). + + @param constrained If true, return the size after applying a constraint. + @return The number of bytes used by the variable. + */ +unsigned int +BaseType::width(bool /* constrained */) +{ + throw InternalErr(__FILE__, __LINE__, "not implemented"); +#if 0 + return width(constrained); +#endif +} + } // namespace libdap diff -Nru libdap-3.11.1/BaseType.h libdap-3.12.0/BaseType.h --- libdap-3.11.1/BaseType.h 2011-04-29 13:19:43.000000000 +0000 +++ libdap-3.12.0/BaseType.h 2013-10-17 21:27:40.000000000 +0000 @@ -21,7 +21,7 @@ // // You should have received a copy of the GNU Lesser General Public // License along with this library; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA // // You can contact OPeNDAP, Inc. at PO Box 112, Saunderstown, RI. 02874-0112. @@ -48,26 +48,21 @@ #include #include -#ifndef _attrtable_h -#include "AttrTable.h" +// These are instantiated only for DAP4 variables +#if DAP4 +#include "D4Dimensions.h" +#include "D4Maps.h" #endif -#ifndef _internalerr_h +#include "AttrTable.h" + #include "InternalErr.h" -#endif -#ifndef __DODS_DATATYPES_ #include "dods-datatypes.h" -#endif -#ifndef A_DapObj_h #include "DapObj.h" -#endif -#include "Marshaller.h" -#include "UnMarshaller.h" - -#define FILE_METHODS 1 +#include "XMLWriter.h" using namespace std; @@ -76,6 +71,8 @@ class DDS; class ConstraintEvaluator; +class Marshaller; +class UnMarshaller; /** Part names the parts of multi-section constructor types. For example, the Grid class has an array and @@ -102,7 +99,7 @@ }; /** Type identifies the data type stored in a particular type - class. All the DODS Data Access Protocol (DAP) types inherit from + class. All the DODS Data Access Protocol (DAP) types inherit from the BaseType class. \code @@ -120,7 +117,16 @@ dods_array_c, dods_structure_c, dods_sequence_c, - dods_grid_c + dods_grid_c, + + dods_int8_c, + dods_uint8_c, + dods_int64_c, + dods_uint64_c, + dods_url4_c + dods_enum_c, + dods_group_c + }; \endcode @@ -142,7 +148,20 @@ dods_array_c, dods_structure_c, dods_sequence_c, - dods_grid_c + dods_grid_c, + + // Added for DAP4 + dods_int8_c, + dods_uint8_c, + + dods_int64_c, + dods_uint64_c, + + dods_url4_c, + + dods_enum_c, + dods_group_c + }; /** This defines the basic data type features for the DODS data access @@ -175,29 +194,19 @@ the constraints to be returned. These cautions are outlined where they occur. - @todo We really need a better way to get values out of these types, esp. - the Float32, Int16, ..., types. In \e most cases we know the type, so a - type specific method (one that requires a downcast to use) is OK. For - example, Byte might have a method dods_byte Byte::value(). Sure - you have to downcast from BaseType to Byte in order to use it, but you - have to figure out you have a Byte to use Byte::buf2val() anyway, so - what's the big deal? Having a method that returns the \e value would - simplify code that reads from data sets to extract meta data (like - lat/lon corner points, et c.). - @brief The basic data type for the DODS DAP types. */ class BaseType : public DapObj { private: - string _name; // name of the instance - Type _type; // instance's type - string _dataset; // name of the dataset used to create this BaseType + string d_name; // name of the instance + Type d_type; // instance's type + string d_dataset; // name of the dataset used to create this BaseType - bool _read_p; // true if the value has been read - bool _send_p; // Is the variable in the projection? + bool d_is_read; // true if the value has been read + bool d_is_send; // Is the variable in the projection? bool d_in_selection; // Is the variable in the selection? - bool _synthesized_p; // true if the variable is synthesized + bool d_is_synthesized; // true if the variable is synthesized // d_parent points to the Constructor or Vector which holds a particular // variable. It is null for simple variables. The Vector and Constructor @@ -207,15 +216,30 @@ // Attributes for this variable. Added 05/20/03 jhrg AttrTable d_attr; + bool d_is_dap4; // True if this is a DAP4 variable, false ... DAP2 + + // These are non-empty only for DAP4 variables. Added 9/27/12 jhrg + + // FIXME Remove this. This header cannot have compile-time variation +#if DAP4 + D4Dimensions d_dims; // If non-empty, this BaseType is an DAP4 Array + D4Maps d_maps; // if non-empty, this BaseType is a DAP4 'Grid' +#endif + protected: - void _duplicate(const BaseType &bt); + void m_duplicate(const BaseType &bt); public: typedef stack btp_stack; - BaseType(const string &n, const Type &t); - BaseType(const string &n, const string &d, const Type &t); - + // These ctors assume is_dap4 is false + BaseType(const string &n, const Type &t, bool is_dap4 = false); + BaseType(const string &n, const string &d, const Type &t, bool is_dap4 = false); +#if 0 + // These provide a way to set is_dap4 + BaseType(const string &n, const Type &t, bool is_dap4); + BaseType(const string &n, const string &d, const Type &t, bool is_dap4); +#endif BaseType(const BaseType ©_from); virtual ~BaseType(); @@ -225,6 +249,9 @@ BaseType &operator=(const BaseType &rhs); + bool is_dap4() { return d_is_dap4; } + void set_is_dap4(const bool v) { d_is_dap4 = v;} + /** Clone this instance. Allocate a new instance and copy \c *this into it. This method must perform a deep copy. @@ -246,6 +273,11 @@ virtual bool is_vector_type(); virtual bool is_constructor_type(); +#if 0 + // Not yet, if ever. Allow 'sloppy' changeover in the handlers + virtual bool is_dap4_only_type(); + virtual bool is_dap2_only_type(); +#endif virtual bool synthesized_p(); virtual void set_synthesized_p(bool state); @@ -302,8 +334,7 @@ no name is given, the function returns the first (only) variable. For example, an Array has only one variable, while a Structure can have many. */ - virtual BaseType *var(const string &name = "", bool exact_match = true, - btp_stack *s = 0); + virtual BaseType *var(const string &name = "", bool exact_match = true, btp_stack *s = 0); virtual BaseType *var(const string &name, btp_stack &s); virtual void add_var(BaseType *bt, Part part = nil); @@ -313,7 +344,7 @@ virtual bool check_semantics(string &msg, bool all = false); virtual bool ops(BaseType *b, int op); -#if FILE_METHODS + virtual void print_decl(FILE *out, string space = " ", bool print_semi = true, bool constraint_info = false, @@ -321,7 +352,7 @@ virtual void print_xml(FILE *out, string space = " ", bool constrained = false); -#endif + virtual void print_decl(ostream &out, string space = " ", bool print_semi = true, bool constraint_info = false, @@ -330,13 +361,15 @@ virtual void print_xml(ostream &out, string space = " ", bool constrained = false); + virtual void print_xml_writer(XMLWriter &xml, bool constrained = false); + /** @name Abstract Methods */ //@{ - +#if 0 /** Return the number of bytes that are required to hold the instance's value. In the case of simple types such as Int32, this is the size of one Int32 (four bytes). For a String or - Url type, width() returns the number of bytes needed + Url type, width(bool constrained = false) returns the number of bytes needed for a String * variable, not the bytes needed for all the characters, since that value cannot be determined from type information alone. For Structure, and other constructor @@ -344,7 +377,9 @@ pointers to the C++ objects. @brief Returns the size of the class instance data. */ - virtual unsigned int width() = 0; + virtual unsigned int width(bool constrained = false) = 0; +#endif + virtual unsigned int width(bool constrained = false); /** Reads the class data into the memory referenced by val. The caller should either allocate enough storage to val @@ -469,7 +504,6 @@ @see DDS */ virtual bool deserialize(UnMarshaller &um, DDS *dds, bool reuse = false) = 0; -#if FILE_METHODS /** Prints the value of the variable, with its declaration. This function is primarily intended for debugging DODS applications. However, it can be overloaded and used to do @@ -487,7 +521,6 @@ virtual void print_val(FILE *out, string space = "", bool print_decl_p = true) = 0; -#endif /** Prints the value of the variable, with its declaration. This function is primarily intended for debugging DODS diff -Nru libdap-3.11.1/BaseTypeFactory.cc libdap-3.12.0/BaseTypeFactory.cc --- libdap-3.11.1/BaseTypeFactory.cc 2011-04-29 13:19:43.000000000 +0000 +++ libdap-3.12.0/BaseTypeFactory.cc 2013-10-17 21:27:40.000000000 +0000 @@ -19,7 +19,7 @@ // // You should have received a copy of the GNU Lesser General Public // License along with this library; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA // // You can contact OPeNDAP, Inc. at PO Box 112, Saunderstown, RI. 02874-0112. @@ -45,6 +45,42 @@ namespace libdap { +BaseType * +BaseTypeFactory::NewVariable(Type type, const string &name) const +{ + switch (type) { + case dods_byte_c: + return NewByte(name); + case dods_int16_c: + return NewInt16(name); + case dods_uint16_c: + return NewUInt16(name); + case dods_int32_c: + return NewInt32(name); + case dods_uint32_c: + return NewUInt32(name); + case dods_float32_c: + return NewFloat32(name); + case dods_float64_c: + return NewFloat64(name); + + case dods_str_c: + return NewStr(name); + case dods_url_c: + return NewUrl(name); + + case dods_array_c: + return NewArray(name); + case dods_structure_c: + return NewStructure(name); + case dods_sequence_c: + return NewSequence(name); + case dods_grid_c: + return NewGrid(name); + default: + throw InternalErr(__FILE__, __LINE__, "Unknow type"); + } +} Byte * BaseTypeFactory::NewByte(const string &n) const { diff -Nru libdap-3.11.1/BaseTypeFactory.h libdap-3.12.0/BaseTypeFactory.h --- libdap-3.11.1/BaseTypeFactory.h 2011-04-29 13:19:43.000000000 +0000 +++ libdap-3.12.0/BaseTypeFactory.h 2013-10-17 21:27:40.000000000 +0000 @@ -19,7 +19,7 @@ // // You should have received a copy of the GNU Lesser General Public // License along with this library; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA // // You can contact OPeNDAP, Inc. at PO Box 112, Saunderstown, RI. 02874-0112. @@ -82,6 +82,8 @@ virtual ~BaseTypeFactory() {} + virtual BaseType *NewVariable(Type type, const string &name = "") const; + virtual Byte *NewByte(const string &n = "") const; virtual Int16 *NewInt16(const string &n = "") const; virtual UInt16 *NewUInt16(const string &n = "") const; diff -Nru libdap-3.11.1/Byte.cc libdap-3.12.0/Byte.cc --- libdap-3.11.1/Byte.cc 2011-04-29 13:19:43.000000000 +0000 +++ libdap-3.12.0/Byte.cc 2013-10-17 21:27:40.000000000 +0000 @@ -19,7 +19,7 @@ // // You should have received a copy of the GNU Lesser General Public // License along with this library; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA // // You can contact OPeNDAP, Inc. at PO Box 112, Saunderstown, RI. 02874-0112. @@ -36,26 +36,25 @@ #include "config.h" -static char rcsid[] not_used = - { "$Id: Byte.cc 21699 2009-11-05 00:06:01Z jimg $" - }; +#include -#include "Byte.h" +#include "Byte.h" // synonymous with UInt8 and Char +#include "Int8.h" #include "Int16.h" #include "UInt16.h" #include "Int32.h" #include "UInt32.h" +#include "Int64.h" +#include "UInt64.h" #include "Float32.h" #include "Float64.h" #include "Str.h" #include "Url.h" -#include "Array.h" -#include "Structure.h" -#include "Sequence.h" -#include "Grid.h" #include "DDS.h" #include "Operators.h" +#include "Marshaller.h" +#include "UnMarshaller.h" #include "util.h" #include "parser.h" @@ -94,7 +93,7 @@ Byte::Byte(const Byte & copy_from): BaseType(copy_from) { - _buf = copy_from._buf; + d_buf = copy_from.d_buf; } BaseType *Byte::ptr_duplicate() @@ -109,12 +108,12 @@ dynamic_cast < BaseType & >(*this) = rhs; - _buf = rhs._buf; + d_buf = rhs.d_buf; return *this; } -unsigned int Byte::width() +unsigned int Byte::width(bool) { return sizeof(dods_byte); } @@ -144,7 +143,7 @@ dds.timeout_off(); - m.put_byte( _buf ) ; + m.put_byte( d_buf ) ; return true; } @@ -154,7 +153,7 @@ */ bool Byte::deserialize(UnMarshaller &um, DDS *, bool) { - um.get_byte( _buf ) ; + um.get_byte( d_buf ) ; return false; } @@ -173,7 +172,7 @@ if (!val) throw InternalErr("the incoming pointer does not contain any data."); - _buf = *(dods_byte *) val; + d_buf = *(dods_byte *) val; return width(); } @@ -188,7 +187,7 @@ if (!*val) *val = new dods_byte; - *(dods_byte *) * val = _buf; + *(dods_byte *) * val = d_buf; return width(); } @@ -199,7 +198,7 @@ with the Passive* subclasses written by HAO. */ bool Byte::set_value(dods_byte value) { - _buf = value; + d_buf = value; set_read_p(true); return true; @@ -209,29 +208,24 @@ @return The value. */ dods_byte Byte::value() const { - return _buf; + return d_buf; } -#if FILE_METHODS void Byte::print_val(FILE * out, string space, bool print_decl_p) { - if (print_decl_p) { - print_decl(out, space, false); - fprintf(out, " = %d;\n", (int) _buf); - } - else - fprintf(out, "%d", (int) _buf); + ostringstream oss; + print_val(oss, space, print_decl_p); + fwrite(oss.str().data(), sizeof(char), oss.str().length(), out); } -#endif void Byte::print_val(ostream &out, string space, bool print_decl_p) { if (print_decl_p) { print_decl(out, space, false); - out << " = " << (int)_buf << ";\n" ; + out << " = " << (int) d_buf << ";\n"; } else - out << (int)_buf ; + out << (int) d_buf; } bool Byte::ops(BaseType * b, int op) @@ -257,31 +251,28 @@ } switch (b->type()) { - case dods_byte_c: - return rops < dods_byte, dods_byte, Cmp < dods_byte, dods_byte > > - (_buf, dynamic_cast < Byte * >(b)->_buf, op); - case dods_int16_c: - return rops < dods_byte, dods_int16, USCmp < dods_byte, - dods_int16 > > (_buf, dynamic_cast < Int16 * >(b)->_buf, op); - case dods_uint16_c: - return rops < dods_byte, dods_uint16, Cmp < dods_byte, - dods_uint16 > > (_buf, dynamic_cast < UInt16 * >(b)->_buf, op); - case dods_int32_c: - return rops < dods_byte, dods_int32, USCmp < dods_byte, - dods_int32 > > (_buf, dynamic_cast < Int32 * >(b)->_buf, op); - case dods_uint32_c: - return rops < dods_byte, dods_uint32, Cmp < dods_byte, - dods_uint32 > > (_buf, dynamic_cast < UInt32 * >(b)->_buf, op); - case dods_float32_c: - return rops < dods_byte, dods_float32, Cmp < dods_byte, - dods_float32 > > (_buf, dynamic_cast < Float32 * >(b)->_buf, - op); - case dods_float64_c: - return rops < dods_byte, dods_float64, Cmp < dods_byte, - dods_float64 > > (_buf, dynamic_cast < Float64 * >(b)->_buf, - op); - default: - return false; + case dods_int8_c: + return USCmp(op, d_buf, static_cast(b)->value()); + case dods_byte_c: + return Cmp(op, d_buf, static_cast(b)->value()); + case dods_int16_c: + return USCmp(op, d_buf, static_cast(b)->value()); + case dods_uint16_c: + return Cmp(op, d_buf, static_cast(b)->value()); + case dods_int32_c: + return USCmp(op, d_buf, static_cast(b)->value()); + case dods_uint32_c: + return Cmp(op, d_buf, static_cast(b)->value()); + case dods_int64_c: + return USCmp(op, d_buf, static_cast(b)->value()); + case dods_uint64_c: + return Cmp(op, d_buf, static_cast(b)->value()); + case dods_float32_c: + return USCmp(op, d_buf, static_cast(b)->value()); + case dods_float64_c: + return USCmp(op, d_buf, static_cast(b)->value()); + default: + return false; } } @@ -299,7 +290,7 @@ << (void *) this << ")" << endl; DapIndent::Indent(); BaseType::dump(strm); - strm << DapIndent::LMarg << "value: " << _buf << endl; + strm << DapIndent::LMarg << "value: " << d_buf << endl; DapIndent::UnIndent(); } diff -Nru libdap-3.11.1/Byte.h libdap-3.12.0/Byte.h --- libdap-3.11.1/Byte.h 2011-04-29 13:19:43.000000000 +0000 +++ libdap-3.12.0/Byte.h 2013-10-17 21:27:40.000000000 +0000 @@ -19,7 +19,7 @@ // // You should have received a copy of the GNU Lesser General Public // License along with this library; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA // // You can contact OPeNDAP, Inc. at PO Box 112, Saunderstown, RI. 02874-0112. @@ -49,8 +49,6 @@ #include "ConstraintEvaluator.h" #endif -#define FILE_METHODS 1 - namespace libdap { @@ -62,20 +60,8 @@ */ class Byte: public BaseType { - /** This class allows Int16, ..., Float64 access to _buf to - simplify and speed up the relational operators. - - NB: According to Stroustrup it does not matter where (public, private - or protected) friend classes are declared. */ - friend class Int16; - friend class UInt16; - friend class Int32; - friend class UInt32; - friend class Float32; - friend class Float64; - protected: - dods_byte _buf; + dods_byte d_buf; public: Byte(const string &n); @@ -88,12 +74,11 @@ Byte &operator=(const Byte &rhs); - virtual unsigned int width(); + virtual unsigned int width(bool constrained = false); virtual BaseType *ptr_duplicate(); - bool serialize(ConstraintEvaluator &eval, DDS &dds, - Marshaller &m, bool ce_eval); + bool serialize(ConstraintEvaluator &eval, DDS &dds, Marshaller &m, bool ce_eval); bool deserialize(UnMarshaller &um, DDS *, bool); virtual unsigned int val2buf(void *val, bool reuse = false); @@ -101,12 +86,9 @@ virtual bool set_value(const dods_byte value); virtual dods_byte value() const; -#if FILE_METHODS - virtual void print_val(FILE *out, string space = "", - bool print_decl_p = true); -#endif - virtual void print_val(ostream &out, string space = "", - bool print_decl_p = true); + + virtual void print_val(FILE *out, string space = "", bool print_decl_p = true); + virtual void print_val(ostream &out, string space = "", bool print_decl_p = true); virtual bool ops(BaseType *b, int op); diff -Nru libdap-3.11.1/COPYING libdap-3.12.0/COPYING --- libdap-3.11.1/COPYING 2011-04-29 13:19:42.000000000 +0000 +++ libdap-3.12.0/COPYING 2013-10-17 21:27:40.000000000 +0000 @@ -2,7 +2,11 @@ Version 2.1, February 1999 Copyright (C) 1991, 1999 Free Software Foundation, Inc. - 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + Free Software Foundation + 51 Franklin Street, Suite 500 + Boston, MA 02110-1335 + USA + Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. diff -Nru libdap-3.11.1/ChangeLog libdap-3.12.0/ChangeLog --- libdap-3.11.1/ChangeLog 2011-04-29 13:19:43.000000000 +0000 +++ libdap-3.12.0/ChangeLog 2013-10-17 21:27:40.000000000 +0000 @@ -1,3 +1,1166 @@ +2013-08-28 James Gallagher + + Build/Audit fixes. + + M libdap/XDRFileUnMarshaller.cc + M libdap/XDRFileUnMarshaller.h + M bes/dispatch/unit-tests/keysT.cc + M bes/functions/Makefile.am + +2013-08-27 James Gallagher + + Backed out an errant call to fclose() + +2013-08-27 James Gallagher + + Removed errant call to fclose() in XDRFileUnMarshaller. This + caused a segfault on Linux. + +2013-08-27 James Gallagher + + audit fixes + + M libdap/Makefile.am + M bes/dispatch/unit-tests/BESCache3Test.cc + M bes/functions/tests/functionsTest.at + M bes/functions/tests/bescmd/bind_name_4.dods.bescmd.baseline + M bes/functions/tests/bescmd/bind_name_2.dods.bescmd.baseline + +2013-08-27 James Gallagher + + Source release info + + M configure.ac + M ChangeLog + M INSTALL + M README + M NEWS + +2013-08-27 James Gallagher + + Audit fixes. + + M RValue.cc + M HTTPCacheTable.cc + M Array.cc + M DDXParserSAX2.cc + M Makefile.am + M HTTPCache.cc + M XDRStreamUnMarshaller.cc + M Structure.cc + M Sequence.cc + M XDRFileUnMarshaller.cc + M XDRFileUnMarshaller.h + M mime_util.cc + M util.cc + M util_mit.cc + +2013-08-27 James Gallagher + + Changed the required bison version number to 2.4 and removed a bogus include + from das.yy that breaks bison 2.4. + + M das.yy + M Error.yy + M dds.yy + M ce_expr.yy + +2013-08-27 James Gallagher + + Removed bad character from the Makefile.am + + M Makefile.am + +2013-08-27 James Gallagher + + Added the newly hacked grammar files - these along with updated versions + of DAS.cc, DDS.cc, ConstraintEvaluator.cc and Error.cc and Makefile.am + were copied over from the dap4 branch. A kind of cheap merge operation... + + A das.yy + A Error.yy + A dds.yy + A ce_expr.yy + +;; Local Variables: +;; coding: utf-8 +;; End: +2013-08-27 James Gallagher + + Audit fixes. + + M RValue.cc + M HTTPCacheTable.cc + M Array.cc + M DDXParserSAX2.cc + M Makefile.am + M HTTPCache.cc + M XDRStreamUnMarshaller.cc + M Structure.cc + M Sequence.cc + M XDRFileUnMarshaller.cc + M XDRFileUnMarshaller.h + M mime_util.cc + M util.cc + M util_mit.cc + +2013-08-27 James Gallagher + + Changed the required bison version number to 2.4 and removed a + bogus include from das.yy that breaks bison 2.4. + + M das.yy + M Error.yy + M dds.yy + M ce_expr.yy + +2013-08-27 James Gallagher + + Removed bad character from the Makefile.am + + M Makefile.am + +2013-08-27 James Gallagher + + Added the newly hacked grammar files - these along with updated + versions of DAS.cc, DDS.cc, ConstraintEvaluator.cc and Error.cc + and Makefile.am were copied over from the dap4 branch. A kind of + cheap merge operation... + + A das.yy + A Error.yy + A dds.yy + A ce_expr.yy + +2013-08-26 James Gallagher + + Chnages so that a newer bison can be used. + + M Error.lex + M Error.cc + M ce_parser.h + M ConstraintEvaluator.cc + M DDS.cc + M Makefile.am + M dds.lex + M Vector.cc + M das.lex + M Vector.h + M DAS.cc + M ce_expr.lex + +2013-07-23 James Gallagher + + Removed the openssl/evp.h header because it winds up including + des_old.h on OSX 10.5 and that has a conflict with set_key() in + BESKeys.h. Also, the code no longer uses the evp.h header... + + M XDRStreamMarshaller.h + +2013-07-23 James Gallagher + + Memory leaks fixed in the DAP4 Stream Marshaller classes - but + these are in code in the trunk. will check in all the same and + make corresponding changes to the code on the dap4 branch (which + uses the filename prefix 'D4' instead of 'DAP4'). + +2013-07-23 James Gallagher + + Modified ConstraintEvaluator so that it always frees the + scanner/parser string buffer when an exception is thrown. I made + this change while working on a problem that turned out to be in + the scanner (state was not reset when an error was found) but even + though this change is not the fix for that - see ce_expr.lex - it + seems like a good idea. + +2013-07-23 James Gallagher + + Fixed the rpm build - libtest-types.a was missiing from the spec file. + +2013-07-10 James Gallagher + + Fixed a bug where a CE with mismatched quotes left the CE parser + in the state, making subsequent requests fail. The fix was + in the scanner to reset the parser (technically the scanner's) + state to INITIAL when an error was detected. I also added code to + catch the Error object thrown by the scanner and delete the parse + buffer, although that might be overkill. + +2013-07-10 James Gallagher + + Merged changes from the miic_6.2013 branch. These changes support the + new #() special forms that enable big arrays to be use in CEs. + + _M . + M Error.lex + M ConstraintEvaluator.cc + M Array.cc + M tests/expr-test.cc + A + tests/ResponseBuilder.cc + A + tests/ResponseBuilder.h + M tests/Makefile.am + M DDXParserSAX2.cc + M Makefile.am + M ce_expr.y + M Error.y + M dds.lex + MM mime_util.h + M XDRStreamUnMarshaller.cc + M RValue.h + M BaseTypeFactory.h + M das.lex + MM mime_util.cc + M das.y + M BaseTypeFactory.cc + M util.cc + D unit-tests/server-testsuite/geturl.0 + D unit-tests/server-testsuite/config + _M unit-tests/ancT.cc + M unit-tests/DDXParserTest.cc + D unit-tests/response_cache + M unit-tests/Makefile.am + M dds.y + M Array.h + M ce_expr.lex + +2013-07-09 James Gallagher + + Trunk fixes for the functions module in the libdap andbes spec + files. Also a repair to XDRStreamMarshaller.cc + +2013-06-06 Nathan Potter + + libdap: new value() methods so that the correct thinmgs are + accessed and returned. + +2013-06-06 Nathan Potter + + libdap: Added new 'value' function to Vector that allows you use + an subset_index array to retrieve non contiguous values in a + single operation + +2013-06-05 James Gallagher + + Added libdap-* to svn-ignore + +2013-05-21 James Gallagher + + Fixes for linux + + M unit-tests/ResponseBuilderTest.cc + M unit-tests/ResponseCacheTest.cc + +2013-05-21 James Gallagher + + added valgrind suppressions for stuff in libxml2 + +2013-05-20 James Gallagher + + Moved four set_mime_*() methods from ResponseBuilder to mime_util. + +2013-05-20 James Gallagher + + Modified DDXParser so that it includes an intern_stream() method + that takes a cpp istream. Added tests. Also modified + ResponseBuilder so that it frees the AlarmHandler allocated when + establish_timeout() is called. + +2013-05-20 James Gallagher + + Fixed memory leaks in the DDXParserSax2 code. Other minor edits. + +2013-05-20 James Gallagher + + Test fixes + +2013-05-20 James Gallagher + + added + +2013-05-17 James Gallagher + + Added these baseline files for ResponseBuilderTest + +2013-05-17 James Gallagher + + Fixes for ResponseCache - I added tests and have tested most + modes. Not tested: how it works with server functions. There are + also fixes/modifications for ResponseBuilder that ResponseCache + uses. Added a note to ServerFunctionsList that it stores weak + pointers. I worked on the ResponseBuilderTests but never got the + test for server functions to work completely; the test examines + the response document and checks that the metadata part is correct + but not the (trivial) data part. + +2013-05-17 James Gallagher + + Added get_next_mime_header() for an istream (the existing version + took a FILE*) and moved some of the MIME header methods from + ResponseBuilder here. + +2013-05-15 Nathan Potter + + libdap: Moving trunk/libdap/unit-tests/ce-functions-testsuite to + trunk/bes/functions/unit-tests because that's where the functions + are that need the contents of that directory. + +2013-05-14 James Gallagher + + ResponseCache mostly working... + +2013-05-14 James Gallagher + + We now install the library and *Test headers. + +2013-05-14 Nathan Potter + + libdap: Repaired problems with conditional build in ServerFcuntionsList + +2013-05-14 James Gallagher + + Added HAVE_STDLIB_H and HAVE_ATEXIT to DAPCache3.cc. + +2013-05-10 Nathan Potter + + libdap: Instrumentation in Regex. Fixed baseline for + ResponseBuilderTest::invoke_server_side_function_test + +2013-05-10 Nathan Potter + +2013-05-10 Nathan Potter + +2013-05-10 Nathan Potter + +2013-05-10 Nathan Potter + +2013-05-10 Nathan Potter + + libdap: Added life cycle control to DAPCache3 singleton. + +2013-05-10 Nathan Potter + + libdap: Added life cycle control to DAPCache3 singleton. + +2013-05-10 James Gallagher + + (potential) fix for the ResponseBuilder cache bug + +2013-05-10 Nathan Potter + + libdap: Updated ResponseBuilderTest to run a server side function. + +2013-05-10 James Gallagher + + Removed (commented) #define DODS_DEBUG from ServerFunctionsList. + +2013-05-10 Nathan Potter + + libdap: Added instrumentation (enabled in this check in) to + ServerFunctionsList in an effort to understand the seg fault + problem that seems to be associated with server side function + calls. + +2013-05-10 Nathan Potter + + libdap: Added instrumentation (enabled in this check in) to + ServerFunctionsList in an effort to understand the seg fault + problem that seems to be associated with server side function + calls. + +2013-05-10 Nathan Potter + + libdap: Added instrumentation (enabled in this check in) to + ServerFunctionsList in an effort to understand the seg fault + problem that seems to be associated with server side function + calls. + +2013-05-09 Nathan Potter + + libdap: Checking in repaired ServerFunctionsList + +2013-05-06 James Gallagher + + Removed old code + +2013-05-06 James Gallagher + + DAPCache3 is now in the libdap namespace. The cache-specific + methods of ResponseBuilder have been factored out to + ResponseCache; RB still makes explicit calls to the cache code, + however. The ResponseCache class was added. + +2013-05-03 James Gallagher + + Added correct copyright headers for the ServerFunctions classes. + +2013-05-03 Nathan Potter + + libdap: Attempting to fix memory leaks in ServerFucntionsList - adding unit tests for same. + +2013-05-02 James Gallagher + + Removed old code in util + +2013-05-02 James Gallagher + + Removed old code from ResponseBuilder + +2013-05-01 Nathan Potter + + libdap: Change type signature for setter methods in ServerFunction + so that they accept const parameters + +2013-05-01 Nathan Potter + + libdap: Change type signature for setter methods in ServerFunction + so that they accept const parameters + +2013-04-27 James Gallagher + + Wrapped the two DAP4-only includes in #if DAP4. Those headers are not + installed in a regular build and the includes break clients that + included the file. + + M BaseType.h + +2013-04-03 James Gallagher + + distcheck works on linux now... + + A + D4ParserSax2.cc + M Makefile.am + D D4ParserSAX2.cc + +2013-04-03 James Gallagher + +2013-04-02 James Gallagher + + Added climit include to fix 'UINT/INT_MAX missing' on Linux. + + M util.cc + +2013-04-01 James Gallagher + + Added unit tests for D4Dimensions and D4EnumDefs. Removed old code from the AttrTable tests. + +2013-04-01 James Gallagher + + Added D4EnumDefs + +2013-03-26 Nathan Potter + +2013-03-25 Nathan Potter + + libdap: Disabling cruft code from earlier ugrid work. + +2013-02-25 Nathan Potter + + libdap: Comments + +2013-02-12 Nathan Potter + + libdap: comments + +2013-02-08 Nathan Potter + + libdap: Updated ServerFunction API + +2013-02-07 Nathan Potter + + libdap: Added methods to ServerFunctionsList to allow inspection of the list contents. + +2013-02-06 Nathan Potter + + libdap: Moved AbstractFunction class to ServerFunction class + +2013-02-06 Nathan Potter + + libdap: Added the use of AbstractFunction class. + +2013-02-05 Nathan Potter + + team sync + +2013-02-05 Nathan Potter + + team sync + +2013-02-04 Nathan Potter + +2013-02-04 Nathan Potter + +2013-02-04 Nathan Potter + + libdap: Adding AbstractServerSideFunction + +2013-01-31 James Gallagher + + Fixes for bes distcheck + + M ServerFunctionsList.cc + M ServerFunctionsList.h + M ConstraintEvaluator.h + +2013-01-30 James Gallagher + + Distcheck now works; removed more old server function code. + + _M . + M configure.ac + M main_page.doxygen + M ConstraintEvaluator.cc + _M tests + M Makefile.am + D swath2grid + D ugridFunctions + M NEWS + M ConstraintEvaluator.h + M unit-tests/HTTPCacheTest.cc + M doxy.conf + +2013-01-30 James Gallagher + + Added stuff to svn:ignore + +2013-01-30 Nathan Potter + + libdap: Updating configre.ac for automake-1.13 + +2013-01-29 James Gallagher + + Changed the way functions are registered so that CE does not have to copy all the functions into every instance of the CE class. Now CE uses functions directly from a list in libdap. + +2013-01-29 James Gallagher + + Changed the way functions are registered so that CE does not have to copy all the functions into every instance of the CE class. Now CE uses functions directly from a list in libdap. + +2013-01-29 James Gallagher + + Fixed checkin - I checked in some code with debugging on + +2013-01-29 James Gallagher + + Removing 'basic' server functions. + + _M . + M Keywords2.cc + M ConstraintEvaluator.cc + M tests/TestArray.cc + M tests/EXPRTest.at + M Makefile.am + M swath2grid/reproj_functions.cc + M HTTPCache.cc + M util.h + M expr.h + M util.cc + M unit-tests/HTTPCacheTest.cc + D unit-tests/ArrayGeoConstraintTest.cc + RM + unit-tests/ancT.cc + M unit-tests/ddsT.cc + M unit-tests/ResponseBuilderTest.cc + D unit-tests/CEFunctionsTest.cc + D unit-tests/GridGeoConstraintTest.cc + M unit-tests/Makefile.am + M unit-tests/Keywords2Test.cc + +2013-01-29 James Gallagher + + Added stuff to svn:ignore + +2013-01-29 James Gallagher + + Added stuff to svn:ignore + +2013-01-29 James Gallagher + + Added stuff to svn:ignore + +2013-01-25 Patrick West + + Removing dependency on DAP4 code for DAP3 responses + M ResponseBuilder.h + M ResponseBuilder.cc + M Int64.h + +2013-01-25 Patrick West + + Need autoconf 2.61, not 2.62 + M configure.ac + +2013-01-18 James Gallagher + + Merge of the code from hyrax 1.8 release (version 3.11.7) + + _M . + A + gridfields_functions.h + M configure.ac + M Connect.h + M ChangeLog + A + gridfields_functions.cc + M ResponseBuilder.h + M main_page.doxygen + A + DAPCache3.cc + A + DAPCache3.h + _M OSX_Resources + M ConstraintEvaluator.cc + M DDS.cc + M HTTPCacheTable.cc + M Array.cc + _M tests + M tests/TestGrid.cc + M tests/expr-test.cc + M tests/TestStructure.cc + M INSTALL + M DDXParserSAX2.cc + M libdap.spec + M ResponseBuilder.cc + M README + M BaseType.cc + M DDS.h + _M win32/gl + M Makefile.am + AM + swath2grid + M DataDDS.cc + M ce_expr.y + M util.h + AM + ugridFunctions + M XDRStreamUnMarshaller.cc + M NEWS + A + doxy.conf.in + M Vector.cc + A + main_page.doxygen.in + _M gl + M ce_functions.cc + M expr.h + MM mime_util.cc + M GridGeoConstraint.cc + M Vector.h + M util.cc + M Grid.cc + M Connect.cc + _M unit-tests + MM unit-tests/MIMEUtilTest.cc + M unit-tests/ResponseBuilderTest.cc + M Clause.cc + M Array.h + M doxy.conf + M ce_expr.lex + +2012-11-07 James Gallagher + + Changed svn ignore properties + +2012-11-07 James Gallagher + + Changed svn ignore properties + +2012-11-07 James Gallagher + + Changes for libdap 3.11.7 so that when the CE Function cache + directory is not present, caching is off. Before the code was just + crashing when a function was used. I also refactored + ResponseBuilder (where the fix is) so that it's got less + redundancy. + +2012-11-02 James Gallagher + + Release 3.11.6 + + M configure.ac + M ChangeLog + M main_page.doxygen + M tests/package.m4 + M INSTALL + M libdap.spec + M README + M NEWS + M doxy.conf + +2012-11-02 James Gallagher + + Fixes for a resource leak in the server function cache code. + + M ResponseBuilder.cc + +2012-10-31 James Gallagher + + fixed an error in the include of DDXParserSAX2.h - OSX file system + case issues + +2012-10-24 James Gallagher + + Changed svn ignore properties + +2012-10-24 James Gallagher + + Changes so that users - handlers primarily - of libdap don't have to + change their link libraries even though ResponseBuilder has the new + caching code. The first version used Connect, this version uses hacked + copies of (tiny) parts of Connect. This keeps the handlers from needing + libdapclient, libcurl and libuuid to link. + + M ResponseBuilder.h + M ResponseBuilder.cc + M Makefile.am + M mime_util.cc + +2012-10-24 James Gallagher + + Fixes both from a code review and to move Connect into libdap proper + so that clients will link correctly (now that Connect is used both by + clients and servers. + + M HTTPCacheTable.cc + M ResponseBuilder.cc + M Makefile.am + M util.cc + M Connect.cc + +2012-10-24 James Gallagher + + Changed svn ignore properties + +2012-10-24 James Gallagher + + Added DAPCache3. + +2012-10-24 James Gallagher + +2012-10-24 James Gallagher + + Changed svn ignore properties + +2012-10-23 James Gallagher + + These changes support server functions in DAP2 using the F-TDS/GDS 'in + path' syntax. They aslo add support for retrieving the DDS and DAS from + URLs with functions (both the F-TDS/GDS syntax and ours) and cache the + results of function calls. + + M Connect.h + M ResponseBuilder.h + M ConstraintEvaluator.cc + M DDS.cc + M tests/TestGrid.cc + M tests/expr-test.cc + M tests/TestStructure.cc + M DDXParserSAX2.cc + M ResponseBuilder.cc + M BaseType.cc + M DDS.h + M Makefile.am + M ce_expr.y + M XDRStreamUnMarshaller.cc + M Vector.cc + M ce_functions.cc + M mime_util.cc + M GridGeoConstraint.cc + M Connect.cc + M unit-tests/ResponseBuilderTest.cc + M Clause.cc + +2012-09-28 James Gallagher + + Changed to using named branches for the server release. + + A https://scm.opendap.org/svn/branch/libdap/hyrax-1.8-release + +2012-07-26 James Gallagher + + Memory leak in XDRStreamMarshaller fixed. + +2012-07-26 James Gallagher + + Found and fixed an error in the add_var_nocopy() method for DDS. I + also added add_var_nocopy() methods to Vector and Array and noted + that when a BaseType is passed to Array's ctor the add_var() + method is used, thus making a copy. If the 'nocopy' behavior is + desired, then pass null to the ctor and call add_var_nocopy() 'by + hand.' I also changed two instances of dynamic_cast so that + static_cast is used instead. These changes are backward compatible + to the previous version of the library. Bumped the version up to + 3.12.0 + +2012-07-26 James Gallagher + + Memory leak in XDRStreamMarshaller fixed. + +2012-07-26 James Gallagher + + Found and fixed an error in the add_var_nocopy() method for DDS. I + also added add_var_nocopy() methods to Vector and Array and noted + that when a BaseType is passed to Array's ctor the add_var() + method is used, thus making a copy. If the 'nocopy' behavior is + desired, then pass null to the ctor and call add_var_nocopy() 'by + hand.' I also changed two instances of dynamic_cast so that + static_cast is used instead. These changes are backward compatible + to the previous version of the library. Bumped the version up to + 3.12.0 + +2012-06-27 James Gallagher + + Removed errant instrumentation in serialize() + +2012-06-22 James Gallagher + + Added some debugging output for/because of work on the GDAL handler. + +2012-06-05 James Gallagher + + Fixed an error in the MIMEUtilTest code. The test failed when the + time zone was to the east of the prime meridian. See ticket 1907. + +2012-05-31 James Gallagher + + doxygen updates plus added an example function for the MIIC folks to + ce_functions.cc. + + M configure.ac + M main_page.doxygen + M ConstraintEvaluator.cc + A doxy.conf.in + A main_page.doxygen.in + M ce_functions.cc + M doxy.conf + +2012-05-11 Nathan Potter + + libdap: updating version number + +2012-04-24 James Gallagher + + Fixed lack of loop index init in setup(). + +2012-04-17 James Gallagher + + Updated NEWS + + M NEWS + +2012-04-12 James Gallagher + + Result of merging changes from the trunk. This code was then merged to + the trunk and tagged. + + _M . + M configure.ac + M ChangeLog + _M OSX_Resources/Info.plist.proto + M HTTPCacheTable.cc + _M tests/old_tests/grid-func-testsuite + _M tests/old_tests/server-testsuite + M tests/TestArray.cc + M tests/package.m4 + M ResponseBuilder.cc + M Makefile.am + _M mime_util.h + M Structure.cc + M Vector.cc + _M mime_util.cc + M XDRStreamMarshaller.h + M XDRStreamMarshaller.cc + M Grid.cc + _M unit-tests/MIMEUtilTest.cc + _M unit-tests/fdiostreamTest.cc + M unit-tests/Makefile.am + M unit-tests/MarshallerTest.cc + M HTTPConnect.h + _M fdiostream.h + +2012-04-11 James Gallagher + + Removed the 'override' file feature - it was never used and its implementaion + was a problem. + + M HTTPCacheTable.cc + M mime_util.h + M mime_util.cc + M XDRStreamMarshaller.cc + +2012-02-16 James Gallagher + + Added unistd .h to ResponseBuilder.cc + +2012-02-07 James Gallagher + + Version 3.11.3 + +2012-02-07 James Gallagher + + Removed the static curl libs from dap-config. + +;; Local Variables: +;; coding: utf-8 +;; End: + +2012-02-07 James Gallagher + + Removed the static curl libs from dap-config. + +2012-01-17 James Gallagher + + News was updated. + + M NEWS + +2012-01-10 James Gallagher + + Update for Hyrax 1.8 release. + + M ChangeLog + M tests/package.m4 + M INSTALL + M README + M NEWS + +2012-01-04 James Gallagher + + version number bump in NEWS + +2011-12-30 James Gallagher + + Bumped up the versions in libdap to 3.11.2. Not sure if this will + be the version number we use for the release. + +2011-12-30 James Gallagher + + Fixed the rpm build; included the man page stuff. + + M libdap.spec + +2011-12-30 James Gallagher + + Added HTTPCacheMacros.h + +2011-12-29 James Gallagher + + Fixes for distcheck given the new man pages + + M Makefile.am + +2011-12-29 James Gallagher + + Added man pages for getdap and dap-config + + M Makefile.am + A getdap.man1 + A dap-config.man1 + +2011-12-29 James Gallagher + + Removed calls to exit(). Fixed the FSF address. Half of ticket 1868. + +2011-12-19 James Gallagher + + comment fixes + +2011-11-30 James Gallagher + + Formatting, Spelling and an error message's text fixed. + +2011-11-30 James Gallagher + + Fix for Fedora builds; the extra newlines in these baseline files are + likely breaking the tests + + M tests/expr-testsuite/test.6b.base + M tests/expr-testsuite/test.5e.base + +2011-11-23 Patrick West + + With HTTPConnect including CURL headers, added CURL_CFLAGS to the + --cflags option M dap-config.in + +2011-11-23 Patrick West + + CURL_CFLAGS was not being used when compiling tests. Added. + M unit-tests/Makefile.am + +2011-11-23 Patrick West + + curl includes were not being included properly. Works if in common + place, but not if in custom location. M tests/Makefile.am + +2011-11-23 Patrick West + + curl/types.h is deprecated and no longer needed + M HTTPConnect.h + +2011-11-16 James Gallagher + + AttrTable was using id2www() to escape spaces and other characters + in attribute names. This was done probably because of the + spaces (spaces in the attribute names break the DAP2 DAS object + parser), but no matter. It was breaking DAS and DDX objects + because names with '%' characters in them were mangled. I replaced + id2www and www2id with new functions that encode/decode only + spaces. I have not fiddled with the find functions; it's fine to + use names with spaces in them with the API, but the printed + representation of the DAS will show those spaces as %20. + Similarly, when the printed representation is parsed, those %20 + escape codes are replaced with real spaces. This means that the + names in the binary objects and XML representation are correct. + +2011-11-15 James Gallagher + + Fix for ticket 1841 - the xml attribute 'base' in the Dataset root + element should have been preceeded by the namespace 'xml'. It is now. + +2011-11-13 James Gallagher + + Fixed, I hope, the problem with the xmlTextWriter code in version + 2.6 of libxml. I think what was happening was really tripping over + an odd feature of the xmlTextWriter API where the TextWriter + object has to be freed before the pointer it has been writing to + can be used. Actually, I suspect that freeing the object calls the + buffer flush function, so calling that would probably work, too. I + opted for the call sequence in the only example I can dig up... + +2011-11-13 James Gallagher + + Fix for ticket 1837. The code libxml2 was escaping attributes with + with OtherXML, turning them into useless goo. I switched from the + ...WriteString to ...WriteRaw function for this type of attribute + and order was restored. + +2011-10-31 Patrick West + + The code was printing a blank line when certain conditions existed. + Removed that code. + M DDS.cc + +2011-10-26 James Gallagher + + Updates for the new DDX tests... nearly done + +2011-10-24 Patrick West + + Forgot a quote + M dap-config.in + +2011-10-24 Patrick West + + Added xml2 includes to cflags + M dap-config.in + +2011-10-24 James Gallagher + + some poking around regarding the DDX/XML bug (1829). Doesn't look + like it's in libdap. Some cleanup, though. + +2011-10-24 James Gallagher + + Fixed the distcheck target. + + M unit-tests/dasT.cc + M unit-tests/AISMergeTest.cc + M unit-tests/MIMEUtilTest.cc + M unit-tests/ddsT.cc + M unit-tests/ByteTest.cc + M unit-tests/Makefile.am + +2011-10-24 Nathan Potter + + libdap: Fixed problems with libxml dependencies. + +2011-10-21 James Gallagher + + Added testFle.h in unit-tests + +2011-10-21 James Gallagher + + Added libparsers_la_CPPFLAGS so that -I for libxml2 will be used + when building the grammar files (really only needed for the DAS + stuff?). Also fixed minor warning in HTTPCache where a File* could + be used uninitialized. + + M Makefile.am + M HTTPCache.cc + +2011-10-21 James Gallagher + + I added a new method to DDS that can insert a variable anywhere in + the DDS. I also added 'nocopy' versions of the new insert_var() + method and the older ad_var() method. Once the ncml handler + stabilizes, we can start using those methods to boost performance. + Lastly, I forgot to add the new XMLWriter class on the last + commit, + +2011-10-12 James Gallagher + + I added a new method to BaseType, DDS and DAS: print_xml_writer() + that takes a XMLWriter object and uses libxml2's xml writer API to + build the DDX response. This should fix all of our woes WRT xml + encoding. The new method is called by the DDS::print_xml method + although it could be used in place of that method since it has the + same parameters. I added tests and, in the course of that, + modified the way some of the tests are done (using files instead + of string variables for the regexs). I also tried adding some + globbing functions to the util.cc file but those proved less than + totally useful - I've left them there all the same. + +2011-09-23 James Gallagher + + Fix for the unit test of get_request_size(). For this function, + different compilers return different values for sizeof(string) so + I made the unit test an OR of two values. Fixed here on the branch + and on the trunk. + + M unit-tests/DDSTest.cc + +2011-09-21 James Gallagher + + Hyrax 1.8 + + A http://scm.opendap.org/svn/branch/libdap/3.11.2 + +2011-09-13 James Gallagher + + Refactor - no change to the ABI. + +2011-08-24 James Gallagher + + Merge of Hyrax 1.7.1 + + _M . + _M OSX_Resources/Info.plist.proto + M DAS.h + M DDS.cc + _M tests/old_tests/grid-func-testsuite + _M tests/old_tests/server-testsuite + M tests/expr-testsuite/test.6b.base + M DDS.h + M BaseType.cc + M Constructor.h + M AttrTable.cc + _M mime_util.h + _M mime_util.cc + M Constructor.cc + M unit-tests/cache-testsuite/Makefile.am + _M unit-tests/MIMEUtilTest.cc + _M unit-tests/fdiostreamTest.cc + _M fdiostream.h + +2011-07-15 James Gallagher + + Fixed an issues with the response too big error message - the sizes were returned in Bytes, but the units were listed as KB. Now the values are in KB (truncated, but good enough). + +2011-06-30 Patrick West + + Merge hyrax 1.7 branch to trunk + +2011-06-09 James Gallagher + + Added support for the first version of response size limits - does not do much for Sequences. + +2011-05-30 James Gallagher + + Added get/set_response_limit() and get_request_size() (first version) to libdap:DDS. + +2011-05-10 James Gallagher + + Added --with-curl and --with-xml2 to configure. + 2011-04-25 James Gallagher Removed doc rpm - this breaks when the build hosts lacks dot or @@ -7440,10 +8603,10 @@ 2001-07-27 James Gallagher * New escaping semantics. The DAP library now supports escaping - names. Servers (and clients) no longer need to escaping characters + names. Servers (and clients) no longer need to escape characters themselves. The functions used to escape characters have been changed, too. The old functions escaped chars that could not be - included in a DAP URL. The new function only escape chars that + included in a DAP URL. The new functions only escape chars that cannot be present in a URI as defined by RFC 2396 (``Uniform Resource Identifiers (URI): Generic Syntax''). The DAP's scanners and parsers have been expanded so that many more characters are @@ -8449,5 +9612,5 @@ Note that without Expect the GUI used for the transmission progress indicator and error reporting is not available. -$Id: ChangeLog 24505 2011-04-26 00:16:05Z jimg $ +$Id: ChangeLog 27104 2013-09-17 23:43:37Z jimg $ diff -Nru libdap-3.11.1/Clause.cc libdap-3.12.0/Clause.cc --- libdap-3.11.1/Clause.cc 2011-04-29 13:19:43.000000000 +0000 +++ libdap-3.12.0/Clause.cc 2013-10-17 21:27:40.000000000 +0000 @@ -19,7 +19,7 @@ // // You should have received a copy of the GNU Lesser General Public // License along with this library; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA // // You can contact OPeNDAP, Inc. at PO Box 112, Saunderstown, RI. 02874-0112. @@ -220,6 +220,18 @@ argv = 0; if (*value) { + // FIXME This comment is likely wrong... 10/19/12 + // This call to set_send_p was removed because new logic used + // in ResponseBuilder will handle it. See send_data(), ... + // When the second part of the CE is parsed, if it is null, + // then all the variables in the DDS that holds the function + // result variables will be sent. If there's a projection in + // that second CE, it will denote what is to be sent. Setting + // set_send_p(true) here had the affect of overriding that + // second CE. Note, however, that the code in send_data() clears + // all of the send_p properties for variables in the DDS, so + // removing the call here is just removing something that will + // actually have no affect. jhrg 10/19/12 (*value)->set_send_p(true); (*value)->set_read_p(true); return true; diff -Nru libdap-3.11.1/Clause.h libdap-3.12.0/Clause.h --- libdap-3.11.1/Clause.h 2011-04-29 13:19:43.000000000 +0000 +++ libdap-3.12.0/Clause.h 2013-10-17 21:27:40.000000000 +0000 @@ -19,7 +19,7 @@ // // You should have received a copy of the GNU Lesser General Public // License along with this library; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA // // You can contact OPeNDAP, Inc. at PO Box 112, Saunderstown, RI. 02874-0112. diff -Nru libdap-3.11.1/Connect.cc libdap-3.12.0/Connect.cc --- libdap-3.11.1/Connect.cc 2011-04-29 13:19:43.000000000 +0000 +++ libdap-3.12.0/Connect.cc 2013-10-17 21:27:40.000000000 +0000 @@ -1,4 +1,3 @@ - // -*- mode: c++; c-basic-offset:4 -*- // This file is part of libdap, A C++ implementation of the OPeNDAP Data @@ -21,7 +20,7 @@ // // You should have received a copy of the GNU Lesser General Public // License along with this library; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA // // You can contact OPeNDAP, Inc. at PO Box 112, Saunderstown, RI. 02874-0112. @@ -33,15 +32,10 @@ // dan Dan Holloway // reza Reza Nekovei - #include "config.h" //#define DODS_DEBUG -#define FILE_METHODS 1 - -static char rcsid[] not_used = - { "$Id: Connect.cc 24370 2011-03-28 16:21:32Z jimg $" - }; +#define FILE_UN_MARSHALLER 1 #include #include @@ -51,9 +45,9 @@ #include "DataDDS.h" #include "Connect.h" #include "escaping.h" -#include "RCReader.h" +//#include "RCReader.h" #include "DDXParserSAX2.h" -#if FILE_METHODS +#if FILE_UN_MARSHALLER #include "XDRFileUnMarshaller.h" #else #include "fdiostream.h" @@ -70,14 +64,96 @@ namespace libdap { /** This private method process data from both local and remote sources. It + exists to eliminate duplication of code. */ +void Connect::process_data(DataDDS &data, Response *rs) +{ + DBG(cerr << "Entering Connect::process_data" << endl); + + data.set_version(rs->get_version()); + data.set_protocol(rs->get_protocol()); + + DBG(cerr << "Entering process_data: d_stream = " << rs << endl); + switch (rs->get_type()) { + case dods_error: { + Error e; + if (!e.parse(rs->get_stream())) + throw InternalErr(__FILE__, __LINE__, "Could not parse the Error object returned by the server!"); + throw e; + } + + case web_error: + // Web errors (those reported in the return document's MIME header) + // are processed by the WWW library. + throw InternalErr(__FILE__, __LINE__, + "An error was reported by the remote httpd; this should have been processed by HTTPConnect.."); + + case dap4_data_ddx: { + // Parse the DDX; throw an exception on error. + DDXParser ddx_parser(data.get_factory()); + + // Read the MPM boundary and then read the subsequent headers + string boundary = read_multipart_boundary(rs->get_stream()); + DBG(cerr << "MPM Boundary: " << boundary << endl); + read_multipart_headers(rs->get_stream(), "text/xml", dap4_ddx); + + // Parse the DDX, reading up to and including the next boundary. + // Return the CID for the matching data part + string data_cid; + ddx_parser.intern_stream(rs->get_stream(), &data, data_cid, boundary); + + // Munge the CID into something we can work with + data_cid = cid_to_header_value(data_cid); + DBG(cerr << "Data CID: " << data_cid << endl); + + // Read the data part's MPM part headers (boundary was read by + // DDXParse::intern) + read_multipart_headers(rs->get_stream(), "application/octet-stream", dap4_data, data_cid); + + // Now read the data +#if FILE_UN_MARSHALLER + XDRFileUnMarshaller um(rs->get_stream()); +#else + fpistream in ( rs->get_stream() ); + XDRStreamUnMarshaller um( in ); +#endif + for (DDS::Vars_iter i = data.var_begin(); i != data.var_end(); i++) { + (*i)->deserialize(um, &data); + } + return; + } + + case dods_data: + default: { + // Parse the DDS; throw an exception on error. + data.parse(rs->get_stream()); +#if FILE_UN_MARSHALLER + XDRFileUnMarshaller um(rs->get_stream()); +#else + fpistream in ( rs->get_stream() ); + XDRStreamUnMarshaller um( in ); +#endif + // Load the DDS with data. + for (DDS::Vars_iter i = data.var_begin(); i != data.var_end(); i++) { + (*i)->deserialize(um, &data); + } + return; + } + } +} + +/** This private method process data from both local and remote sources. It exists to eliminate duplication of code. */ void -Connect::process_data(DataDDS &data, Response *rs) +Connect::process_data(DDS &data, Response *rs) { DBG(cerr << "Entering Connect::process_data" << endl); +#if 0 data.set_version(rs->get_version()); data.set_protocol(rs->get_protocol()); +#endif + // TODO is this the correct info? + data.set_dap_version(rs->get_protocol()); DBG(cerr << "Entering process_data: d_stream = " << rs << endl); switch (rs->get_type()) { @@ -96,38 +172,38 @@ case dap4_data_ddx: { // Parse the DDX; throw an exception on error. - DDXParser ddx_parser(data.get_factory()); + DDXParser ddx_parser(data.get_factory()); - // Read the MPM boundary and then read the subsequent headers - string boundary = read_multipart_boundary(rs->get_stream()); - DBG(cerr << "MPM Boundary: " << boundary << endl); - read_multipart_headers(rs->get_stream(), "text/xml", dap4_ddx); - - // Parse the DDX, reading up to and including the next boundary. - // Return the CID for the matching data part - string data_cid; - ddx_parser.intern_stream(rs->get_stream(), &data, data_cid, boundary); - - // Munge the CID into something we can work with - data_cid = cid_to_header_value(data_cid); - DBG(cerr << "Data CID: " << data_cid << endl); - - // Read the data part's MPM part headers (boundary was read by - // DDXParse::intern) - read_multipart_headers(rs->get_stream(), - "application/octet-stream", dap4_data, data_cid); - - // Now read the data -#if FILE_METHODS - XDRFileUnMarshaller um( rs->get_stream() ) ; + // Read the MPM boundary and then read the subsequent headers + string boundary = read_multipart_boundary(rs->get_stream()); + DBG(cerr << "MPM Boundary: " << boundary << endl); + read_multipart_headers(rs->get_stream(), "text/xml", dap4_ddx); + + // Parse the DDX, reading up to and including the next boundary. + // Return the CID for the matching data part + string data_cid; + ddx_parser.intern_stream(rs->get_stream(), &data, data_cid, boundary); + + // Munge the CID into something we can work with + data_cid = cid_to_header_value(data_cid); + DBG(cerr << "Data CID: " << data_cid << endl); + + // Read the data part's MPM part headers (boundary was read by + // DDXParse::intern) + read_multipart_headers(rs->get_stream(), + "application/octet-stream", dap4_data, data_cid); + + // Now read the data +#if FILE_UN_MARSHALLER + XDRFileUnMarshaller um( rs->get_stream() ) ; #else - fpistream in ( rs->get_stream() ); - XDRStreamUnMarshaller um( in ) ; + fpistream in ( rs->get_stream() ); + XDRStreamUnMarshaller um( in ) ; #endif #if 0 - try { + try { #endif - for (DDS::Vars_iter i = data.var_begin(); i != data.var_end(); + for (DDS::Vars_iter i = data.var_begin(); i != data.var_end(); i++) { (*i)->deserialize(um, &data); } @@ -144,11 +220,11 @@ default: { // Parse the DDS; throw an exception on error. data.parse(rs->get_stream()); -#if FILE_METHODS +#if FILE_UN_MARSHALLER XDRFileUnMarshaller um( rs->get_stream() ) ; #else - fpistream in ( rs->get_stream() ); - XDRStreamUnMarshaller um( in ) ; + fpistream in ( rs->get_stream() ); + XDRStreamUnMarshaller um( in ) ; #endif // Load the DDS with data. #if 0 @@ -183,15 +259,14 @@ /** Use when you cannot use libcurl. - @note This method tests for MIME headers with lines terminated by CRLF - (\r\n) and Newlines (\n). In either case, the line terminators are removed - before each header is processed. - - @param data_source Read from this stream. - @param rs Value/Result parameter. Dump version and type information here. - */ -void -Connect::parse_mime(Response *rs) + @note This method tests for MIME headers with lines terminated by CRLF + (\r\n) and Newlines (\n). In either case, the line terminators are removed + before each header is processed. + + @param data_source Read from this stream. + @param rs Value/Result parameter. Dump version and type information here. + */ +void Connect::parse_mime(Response *rs) { rs->set_version("dods/0.0"); // initial value; for backward compatibility. rs->set_protocol("2.0"); @@ -199,8 +274,8 @@ FILE *data_source = rs->get_stream(); string mime = get_next_mime_header(data_source); while (!mime.empty()) { - string header, value; - parse_mime_header(mime, header, value); + string header, value; + parse_mime_header(mime, header, value); // Note that this is an ordered list if (header == "content-description:") { @@ -208,8 +283,7 @@ rs->set_type(get_description_type(value)); } // Use the value of xdods-server only if no other value has been read - else if (header == "xdods-server:" - && rs->get_version() == "dods/0.0") { + else if (header == "xdods-server:" && rs->get_version() == "dods/0.0") { DBG(cout << header << ": " << value << endl); rs->set_version(value); } @@ -235,15 +309,14 @@ // public mfuncs /** The Connect constructor requires a name, which is the URL to - which the connection is to be made. + which the connection is to be made. - @param n The URL for the virtual connection. - @param uname Use this username for authentication. Null by default. - @param password Password to use for authentication. Null by default. - @brief Create an instance of Connect. */ -Connect::Connect(const string &n, string uname, string password) -throw(Error, InternalErr) - : d_http(0), d_version("unknown"), d_protocol("2.0") + @param n The URL for the virtual connection. + @param uname Use this username for authentication. Null by default. + @param password Password to use for authentication. Null by default. + @brief Create an instance of Connect. */ +Connect::Connect(const string &n, string uname, string password) throw (Error, InternalErr) : + d_http(0), d_version("unknown"), d_protocol("2.0") { string name = prune_spaces(n); @@ -282,7 +355,7 @@ d_http = 0; _URL = ""; - _local = true; // local in this case means non-DAP + _local = true; // local in this case means non-DAP } set_credentials(uname, password); @@ -293,20 +366,20 @@ DBG2(cerr << "Entering the Connect dtor" << endl); if (d_http) - delete d_http; d_http = 0; + delete d_http; + d_http = 0; DBG2(cerr << "Leaving the Connect dtor" << endl); } /** Get version information from the server. This is a new method which will - ease the transition to DAP 4. + ease the transition to DAP 4. - @note Use request_protocol() to get the DAP protocol version. + @note Use request_protocol() to get the DAP protocol version. - @return The DAP version string. - @see request_protocol() */ -string -Connect::request_version() + @return The DAP version string. + @see request_protocol() */ +string Connect::request_version() { string version_url = _URL + ".ver"; if (_proj.length() + _sel.length()) @@ -317,31 +390,32 @@ rs = d_http->fetch_url(version_url); } catch (Error &e) { - delete rs; rs = 0; - throw ; + delete rs; + rs = 0; + throw; } d_version = rs->get_version(); d_protocol = rs->get_protocol(); - delete rs; rs = 0; + delete rs; + rs = 0; return d_version; } /** Get protocol version information from the server. This is a new method - which will ease the transition to DAP 4. Note that this method returns - the version of the DAP protocol implemented by the server. The - request_version() method returns the \e server's version number, not - the DAP protocol version. - - @note This method actually asks the server for the protocol version - use - get_protocol() to get the protocol information from the most recent - response (e.g., from the last DDX response returned by the server). - - @return The DAP protocol version string. */ -string -Connect::request_protocol() + which will ease the transition to DAP 4. Note that this method returns + the version of the DAP protocol implemented by the server. The + request_version() method returns the \e server's version number, not + the DAP protocol version. + + @note This method actually asks the server for the protocol version - use + get_protocol() to get the protocol information from the most recent + response (e.g., from the last DDX response returned by the server). + + @return The DAP protocol version string. */ +string Connect::request_protocol() { string version_url = _URL + ".ver"; if (_proj.length() + _sel.length()) @@ -352,27 +426,28 @@ rs = d_http->fetch_url(version_url); } catch (Error &e) { - delete rs; rs = 0; - throw ; + delete rs; + rs = 0; + throw; } d_version = rs->get_version(); d_protocol = rs->get_protocol(); - delete rs; rs = 0; + delete rs; + rs = 0; return d_protocol; } /** Reads the DAS corresponding to the dataset in the Connect - object's URL. Although DAP does not support using CEs with DAS - requests, if present in the Connect object's instance, they will be - escaped and passed as the query string of the request. - - @brief Get the DAS from a server. - @param das Result. */ -void -Connect::request_das(DAS &das) + object's URL. Although DAP does not support using CEs with DAS + requests, if present in the Connect object's instance, they will be + escaped and passed as the query string of the request. + + @brief Get the DAS from a server. + @param das Result. */ +void Connect::request_das(DAS &das) { string das_url = _URL + ".das"; if (_proj.length() + _sel.length()) @@ -383,122 +458,128 @@ rs = d_http->fetch_url(das_url); } catch (Error &e) { - delete rs; rs = 0; - throw ; + delete rs; + rs = 0; + throw; } d_version = rs->get_version(); d_protocol = rs->get_protocol(); switch (rs->get_type()) { - case dods_error: { + case dods_error: { Error e; if (!e.parse(rs->get_stream())) { - delete rs; rs = 0; - throw InternalErr(__FILE__, __LINE__, - "Could not parse error returned from server."); + delete rs; + rs = 0; + throw InternalErr(__FILE__, __LINE__, "Could not parse error returned from server."); } - delete rs; rs = 0; + delete rs; + rs = 0; throw e; } - case web_error: - // We should never get here; a web error should be picked up read_url - // (called by fetch_url) and result in a thrown Error object. - break; - - case dods_das: - default: - // DAS::parse throws an exception on error. - try { - das.parse(rs->get_stream()); // read and parse the das from a file - } - catch (Error &e) { - delete rs; rs = 0; - throw ; - } + case web_error: + // We should never get here; a web error should be picked up read_url + // (called by fetch_url) and result in a thrown Error object. + break; + + case dods_das: + default: + // DAS::parse throws an exception on error. + try { + das.parse(rs->get_stream()); // read and parse the das from a file + } + catch (Error &e) { + delete rs; + rs = 0; + throw; + } - break; + break; } - delete rs; rs = 0; + delete rs; + rs = 0; } /** Reads the DAS corresponding to the dataset in the Connect - object's URL. Although DAP does not support using CEs with DAS - requests, if present in the Connect object's instance, they will be - escaped and passed as the query string of the request. - - Different from request_das method in that this method uses the URL as - given without attaching .das or projections or selections. - - @brief Get the DAS from a server. - @param das Result. */ -void -Connect::request_das_url(DAS &das) + object's URL. Although DAP does not support using CEs with DAS + requests, if present in the Connect object's instance, they will be + escaped and passed as the query string of the request. + + Different from request_das method in that this method uses the URL as + given without attaching .das or projections or selections. + + @brief Get the DAS from a server. + @param das Result. */ +void Connect::request_das_url(DAS &das) { - string use_url = _URL + "?" + _proj + _sel ; + string use_url = _URL + "?" + _proj + _sel; Response *rs = 0; try { rs = d_http->fetch_url(use_url); } catch (Error &e) { - delete rs; rs = 0; - throw ; + delete rs; + rs = 0; + throw; } d_version = rs->get_version(); d_protocol = rs->get_protocol(); switch (rs->get_type()) { - case dods_error: { + case dods_error: { Error e; if (!e.parse(rs->get_stream())) { - delete rs; rs = 0; - throw InternalErr(__FILE__, __LINE__, - "Could not parse error returned from server."); + delete rs; + rs = 0; + throw InternalErr(__FILE__, __LINE__, "Could not parse error returned from server."); } - delete rs; rs = 0; + delete rs; + rs = 0; throw e; } - case web_error: - // We should never get here; a web error should be picked up read_url - // (called by fetch_url) and result in a thrown Error object. - break; - - case dods_das: - default: - // DAS::parse throws an exception on error. - try { - das.parse(rs->get_stream()); // read and parse the das from a file - } - catch (Error &e) { - delete rs; rs = 0; - throw ; - } + case web_error: + // We should never get here; a web error should be picked up read_url + // (called by fetch_url) and result in a thrown Error object. + break; + + case dods_das: + default: + // DAS::parse throws an exception on error. + try { + das.parse(rs->get_stream()); // read and parse the das from a file + } + catch (Error &e) { + delete rs; + rs = 0; + throw; + } - break; + break; } - delete rs; rs = 0; + delete rs; + rs = 0; } /** Reads the DDS corresponding to the dataset in the Connect object's URL. - If present in the Connect object's instance, a CE will be escaped, - combined with \c expr and passed as the query string of the request. + If present in the Connect object's instance, a CE will be escaped, + combined with \c expr and passed as the query string of the request. - @note If you need the DDS to hold specializations of the type classes, - be sure to include the factory class which will instantiate those - specializations in the DDS. Either pass a pointer to the factory to - DDS constructor or use the DDS::set_factory() method after the - object is built. - - @brief Get the DDS from a server. - @param dds Result. - @param expr Send this constraint expression to the server. */ -void -Connect::request_dds(DDS &dds, string expr) + @note If you need the DDS to hold specializations of the type classes, + be sure to include the factory class which will instantiate those + specializations in the DDS. Either pass a pointer to the factory to + DDS constructor or use the DDS::set_factory() method after the + object is built. + + @brief Get the DDS from a server. + @param dds Result. + @param expr Send this constraint expression to the server. */ +void Connect::request_dds(DDS &dds, string expr) { string proj, sel; string::size_type dotpos = expr.find('&'); @@ -511,132 +592,137 @@ sel = ""; } - string dds_url = _URL + ".dds" + "?" - + id2www_ce(_proj + proj + _sel + sel); + string dds_url = _URL + ".dds" + "?" + id2www_ce(_proj + proj + _sel + sel); Response *rs = 0; try { rs = d_http->fetch_url(dds_url); } catch (Error &e) { - delete rs; rs = 0; - throw ; + delete rs; + rs = 0; + throw; } d_version = rs->get_version(); d_protocol = rs->get_protocol(); switch (rs->get_type()) { - case dods_error: { + case dods_error: { Error e; if (!e.parse(rs->get_stream())) { - delete rs; rs = 0; - throw InternalErr(__FILE__, __LINE__, - "Could not parse error returned from server."); + delete rs; + rs = 0; + throw InternalErr(__FILE__, __LINE__, "Could not parse error returned from server."); } - delete rs; rs = 0; + delete rs; + rs = 0; throw e; } - case web_error: - // We should never get here; a web error should be picked up read_url - // (called by fetch_url) and result in a thrown Error object. - break; - - case dods_dds: - default: - // DDS::prase throws an exception on error. - try { - dds.parse(rs->get_stream()); // read and parse the dds from a file - } - catch (Error &e) { - delete rs; rs = 0; - throw ; - } - break; + case web_error: + // We should never get here; a web error should be picked up read_url + // (called by fetch_url) and result in a thrown Error object. + break; + + case dods_dds: + default: + // DDS::prase throws an exception on error. + try { + dds.parse(rs->get_stream()); // read and parse the dds from a file + } + catch (Error &e) { + delete rs; + rs = 0; + throw; + } + break; } - delete rs; rs = 0; + delete rs; + rs = 0; } /** Reads the DDS corresponding to the dataset in the Connect object's URL. - If present in the Connect object's instance, a CE will be escaped, - combined with \c expr and passed as the query string of the request. + If present in the Connect object's instance, a CE will be escaped, + combined with \c expr and passed as the query string of the request. - Different from request_dds method above in that this method assumes - URL is complete and does not add anything to the command, such as .dds - or projections or selections. - - @note If you need the DDS to hold specializations of the type classes, - be sure to include the factory class which will instantiate those - specializations in the DDS. Either pass a pointer to the factory to - DDS constructor or use the DDS::set_factory() method after the - object is built. - - @brief Get the DDS from a server. - @param dds Result. */ -void -Connect::request_dds_url(DDS &dds) + Different from request_dds method above in that this method assumes + URL is complete and does not add anything to the command, such as .dds + or projections or selections. + + @note If you need the DDS to hold specializations of the type classes, + be sure to include the factory class which will instantiate those + specializations in the DDS. Either pass a pointer to the factory to + DDS constructor or use the DDS::set_factory() method after the + object is built. + + @brief Get the DDS from a server. + @param dds Result. */ +void Connect::request_dds_url(DDS &dds) { - string use_url = _URL + "?" + _proj + _sel ; + string use_url = _URL + "?" + _proj + _sel; Response *rs = 0; try { rs = d_http->fetch_url(use_url); } catch (Error &e) { - delete rs; rs = 0; - throw ; + delete rs; + rs = 0; + throw; } d_version = rs->get_version(); d_protocol = rs->get_protocol(); switch (rs->get_type()) { - case dods_error: { + case dods_error: { Error e; if (!e.parse(rs->get_stream())) { - delete rs; rs = 0; - throw InternalErr(__FILE__, __LINE__, - "Could not parse error returned from server."); + delete rs; + rs = 0; + throw InternalErr(__FILE__, __LINE__, "Could not parse error returned from server."); } - delete rs; rs = 0; + delete rs; + rs = 0; throw e; } - case web_error: - // We should never get here; a web error should be picked up read_url - // (called by fetch_url) and result in a thrown Error object. - break; - - case dods_dds: - default: - // DDS::prase throws an exception on error. - try { - dds.parse(rs->get_stream()); // read and parse the dds from a file - } - catch (Error &e) { - delete rs; rs = 0; - throw ; - } - break; + case web_error: + // We should never get here; a web error should be picked up read_url + // (called by fetch_url) and result in a thrown Error object. + break; + + case dods_dds: + default: + // DDS::prase throws an exception on error. + try { + dds.parse(rs->get_stream()); // read and parse the dds from a file + } + catch (Error &e) { + delete rs; + rs = 0; + throw; + } + break; } - delete rs; rs = 0; + delete rs; + rs = 0; } /** Reads the DDX corresponding to the dataset in the Connect object's URL. - If present in the Connect object's instance, a CE will be escaped, - combined with \c expr and passed as the query string of the request. + If present in the Connect object's instance, a CE will be escaped, + combined with \c expr and passed as the query string of the request. - @note A DDX is represented as XML on the wire but in memory libdap uses a - DDS object with variables that hold their own attributes (the DDS itself holds - the global attributes). - - @brief Get the DDX from a server. - @param dds Result. - @param expr Send this constraint expression to the server. */ -void -Connect::request_ddx(DDS &dds, string expr) + @note A DDX is represented as XML on the wire but in memory libdap uses a + DDS object with variables that hold their own attributes (the DDS itself holds + the global attributes). + + @brief Get the DDX from a server. + @param dds Result. + @param expr Send this constraint expression to the server. */ +void Connect::request_ddx(DDS &dds, string expr) { string proj, sel; string::size_type dotpos = expr.find('&'); @@ -649,143 +735,156 @@ sel = ""; } - string ddx_url = _URL + ".ddx" + "?" - + id2www_ce(_proj + proj + _sel + sel); + string ddx_url = _URL + ".ddx" + "?" + id2www_ce(_proj + proj + _sel + sel); Response *rs = 0; try { rs = d_http->fetch_url(ddx_url); } catch (Error &e) { - delete rs; rs = 0; - throw ; + delete rs; + rs = 0; + throw; } d_version = rs->get_version(); d_protocol = rs->get_protocol(); switch (rs->get_type()) { - case dods_error: { + case dods_error: { Error e; if (!e.parse(rs->get_stream())) { - delete rs; rs = 0; - throw InternalErr(__FILE__, __LINE__, - "Could not parse error returned from server."); + delete rs; + rs = 0; + throw InternalErr(__FILE__, __LINE__, "Could not parse error returned from server."); } - delete rs; rs = 0; + delete rs; + rs = 0; throw e; } - case web_error: - // We should never get here; a web error should be picked up read_url - // (called by fetch_url) and result in a thrown Error object. - break; + case web_error: + // We should never get here; a web error should be picked up read_url + // (called by fetch_url) and result in a thrown Error object. + break; - case dap4_ddx: - case dods_ddx: - try { - string blob; + case dap4_ddx: + case dods_ddx: + try { + string blob; - DDXParser ddxp(dds.get_factory()); - ddxp.intern_stream(rs->get_stream(), &dds, blob); - } - catch (Error &e) { - delete rs; rs = 0; - throw ; - } - break; + DDXParser ddxp(dds.get_factory()); + ddxp.intern_stream(rs->get_stream(), &dds, blob); + } + catch (Error &e) { + delete rs; + rs = 0; + throw; + } + break; - default: - delete rs; rs = 0; - throw Error("The site did not return a valid response (it lacked the\n\ + default: + delete rs; + rs = 0; + throw Error( + "The site did not return a valid response (it lacked the\n\ expected content description header value of 'dap4-ddx' and\n\ -instead returned '" + long_to_string(rs->get_type()) + "').\n\ +instead returned '" + + long_to_string(rs->get_type()) + + "').\n\ This may indicate that the server at the site is not correctly\n\ configured, or that the URL has changed."); } - delete rs; rs = 0; + delete rs; + rs = 0; } /** @brief The 'url' version of request_ddx - @see Connect::request_ddx. */ -void -Connect::request_ddx_url(DDS &dds) + @see Connect::request_ddx. */ +void Connect::request_ddx_url(DDS &dds) { - string use_url = _URL + "?" + _proj + _sel ; + string use_url = _URL + "?" + _proj + _sel; Response *rs = 0; try { rs = d_http->fetch_url(use_url); } catch (Error &e) { - delete rs; rs = 0; - throw ; + delete rs; + rs = 0; + throw; } d_version = rs->get_version(); d_protocol = rs->get_protocol(); switch (rs->get_type()) { - case dods_error: { + case dods_error: { Error e; if (!e.parse(rs->get_stream())) { - delete rs; rs = 0; - throw InternalErr(__FILE__, __LINE__, - "Could not parse error returned from server."); + delete rs; + rs = 0; + throw InternalErr(__FILE__, __LINE__, "Could not parse error returned from server."); } - delete rs; rs = 0; + delete rs; + rs = 0; throw e; } - case web_error: - // We should never get here; a web error should be picked up read_url - // (called by fetch_url) and result in a thrown Error object. - break; + case web_error: + // We should never get here; a web error should be picked up read_url + // (called by fetch_url) and result in a thrown Error object. + break; - case dap4_ddx: - case dods_ddx: - try { - string blob; + case dap4_ddx: + case dods_ddx: + try { + string blob; - DDXParser ddxp(dds.get_factory()); - ddxp.intern_stream(rs->get_stream(), &dds, blob); - } - catch (Error &e) { - delete rs; rs = 0; - throw ; - } - break; + DDXParser ddxp(dds.get_factory()); + ddxp.intern_stream(rs->get_stream(), &dds, blob); + } + catch (Error &e) { + delete rs; + rs = 0; + throw; + } + break; - default: - delete rs; rs = 0; - throw Error("The site did not return a valid response (it lacked the\n\ + default: + delete rs; + rs = 0; + throw Error( + "The site did not return a valid response (it lacked the\n\ expected content description header value of 'dap4-ddx' and\n\ -instead returned '" + long_to_string(rs->get_type()) + "').\n\ +instead returned '" + + long_to_string(rs->get_type()) + + "').\n\ This may indicate that the server at the site is not correctly\n\ configured, or that the URL has changed."); } - delete rs; rs = 0; + delete rs; + rs = 0; } /** Reads the DataDDS object corresponding to the dataset in the Connect - object's URL. If present in the Connect object's instance, a CE will be - escaped, combined with \c expr and passed as the query string of the - request. The result is a DataDDS which contains the data values bound to - variables. - - @note If you need the DataDDS to hold specializations of the type classes, - be sure to include the factory class which will instantiate those - specializations in the DataDDS. Either pass a pointer to the factory to - DataDDS constructor or use the DDS::set_factory() method after the - object is built. - - @brief Get the DAS from a server. - @param data Result. - @param expr Send this constraint expression to the server. */ -void -Connect::request_data(DataDDS &data, string expr) + object's URL. If present in the Connect object's instance, a CE will be + escaped, combined with \c expr and passed as the query string of the + request. The result is a DataDDS which contains the data values bound to + variables. + + @note If you need the DataDDS to hold specializations of the type classes, + be sure to include the factory class which will instantiate those + specializations in the DataDDS. Either pass a pointer to the factory to + DataDDS constructor or use the DDS::set_factory() method after the + object is built. + + @brief Get the DAS from a server. + @param data Result. + @param expr Send this constraint expression to the server. */ +void Connect::request_data(DataDDS &data, string expr) { string proj, sel; string::size_type dotpos = expr.find('&'); @@ -798,8 +897,7 @@ sel = ""; } - string data_url = _URL + ".dods?" - + id2www_ce(_proj + proj + _sel + sel); + string data_url = _URL + ".dods?" + id2www_ce(_proj + proj + _sel + sel); Response *rs = 0; // We need to catch Error exceptions to ensure calling close_output. @@ -810,35 +908,36 @@ d_protocol = rs->get_protocol(); process_data(data, rs); - delete rs; rs = 0; + delete rs; + rs = 0; } catch (Error &e) { - delete rs; rs = 0; - throw ; + delete rs; + rs = 0; + throw; } } /** Reads the DataDDS object corresponding to the dataset in the Connect - object's URL. If present in the Connect object's instance, a CE will be - escaped, combined with \c expr and passed as the query string of the - request. The result is a DataDDS which contains the data values bound to - variables. - - Different from request_data in that this method uses the syntax of the - new OPeNDAP server commands using dispatch - - @note If you need the DataDDS to hold specializations of the type classes, - be sure to include the factory class which will instantiate those - specializations in the DataDDS. Either pass a pointer to the factory to - DataDDS constructor or use the DDS::set_factory() method after the - object is built. - - @brief Get the DAS from a server. - @param data Result. */ -void -Connect::request_data_url(DataDDS &data) + object's URL. If present in the Connect object's instance, a CE will be + escaped, combined with \c expr and passed as the query string of the + request. The result is a DataDDS which contains the data values bound to + variables. + + Different from request_data in that this method uses the syntax of the + new OPeNDAP server commands using dispatch + + @note If you need the DataDDS to hold specializations of the type classes, + be sure to include the factory class which will instantiate those + specializations in the DataDDS. Either pass a pointer to the factory to + DataDDS constructor or use the DDS::set_factory() method after the + object is built. + + @brief Get the DAS from a server. + @param data Result. */ +void Connect::request_data_url(DataDDS &data) { - string use_url = _URL + "?" + _proj + _sel ; + string use_url = _URL + "?" + _proj + _sel; Response *rs = 0; // We need to catch Error exceptions to ensure calling close_output. try { @@ -848,16 +947,17 @@ d_protocol = rs->get_protocol(); process_data(data, rs); - delete rs; rs = 0; + delete rs; + rs = 0; } catch (Error &e) { - delete rs; rs = 0; - throw ; + delete rs; + rs = 0; + throw; } } -void -Connect::request_data_ddx(DataDDS &data, string expr) +void Connect::request_data_ddx(DataDDS &data, string expr) { string proj, sel; string::size_type dotpos = expr.find('&'); @@ -870,8 +970,7 @@ sel = ""; } - string data_url = _URL + ".dap?" - + id2www_ce(_proj + proj + _sel + sel); + string data_url = _URL + ".dap?" + id2www_ce(_proj + proj + _sel + sel); Response *rs = 0; // We need to catch Error exceptions to ensure calling close_output. @@ -882,18 +981,19 @@ d_protocol = rs->get_protocol(); process_data(data, rs); - delete rs; rs = 0; + delete rs; + rs = 0; } catch (Error &e) { - delete rs; rs = 0; - throw ; + delete rs; + rs = 0; + throw; } } -void -Connect::request_data_ddx_url(DataDDS &data) +void Connect::request_data_ddx_url(DataDDS &data) { - string use_url = _URL + "?" + _proj + _sel ; + string use_url = _URL + "?" + _proj + _sel; Response *rs = 0; // We need to catch Error exceptions to ensure calling close_output. try { @@ -903,29 +1003,41 @@ d_protocol = rs->get_protocol(); process_data(data, rs); - delete rs; rs = 0; + delete rs; + rs = 0; } catch (Error &e) { - delete rs; rs = 0; - throw ; + delete rs; + rs = 0; + throw; } } /** @brief Read data which is preceded by MIME headers. - This method works for both data dds and data ddx responses. + This method works for both data dds and data ddx responses. + + @note If you need the DataDDS to hold specializations of the type classes, + be sure to include the factory class which will instantiate those + specializations in the DataDDS. Either pass a pointer to the factory to + DataDDS constructor or use the DDS::set_factory() method after the + object is built. + + @see read_data_no_mime() + @param data Result. + @param rs Read from this Response object. */ + +void Connect::read_data(DataDDS &data, Response *rs) +{ + if (!rs) + throw InternalErr(__FILE__, __LINE__, "Response object is null."); - @note If you need the DataDDS to hold specializations of the type classes, - be sure to include the factory class which will instantiate those - specializations in the DataDDS. Either pass a pointer to the factory to - DataDDS constructor or use the DDS::set_factory() method after the - object is built. - - @see read_data_no_mime() - @param data Result. - @param rs Read from this Response object. */ + // Read from data_source and parse the MIME headers specific to DAP2/4. + parse_mime(rs); + read_data_no_mime(data, rs); +} void -Connect::read_data(DataDDS &data, Response *rs) +Connect::read_data(DDS &data, Response *rs) { if (!rs) throw InternalErr(__FILE__, __LINE__, "Response object is null."); @@ -941,13 +1053,12 @@ // Assumptions: // #1 The current file position is past any MIME headers (if they were present). // #2 We must reset the FILE* position to the start of the DDS or DDX headers -static void -divine_type_information(Response *rs) +static void divine_type_information(Response *rs) { // Consume whitespace char c = getc(rs->get_stream()); while (isspace(c)) { - c = getc(rs->get_stream()); + c = getc(rs->get_stream()); } // The heuristic here is that a DataDDX is a multipart MIME document and @@ -956,51 +1067,72 @@ // with a DDS (;Dataset {' ...). I take into account that our parsers have // accepted both 'Dataset' and 'dataset' for a long time. switch (c) { - case '-': - rs->set_type(dap4_data_ddx); - break; - case 'D': - case 'd': - rs->set_type(dods_data); - break; - default: - throw InternalErr(__FILE__, __LINE__, "Could not determine type of response object in stream."); + case '-': + rs->set_type(dap4_data_ddx); + break; + case 'D': + case 'd': + rs->set_type(dods_data); + break; + default: + throw InternalErr(__FILE__, __LINE__, "Could not determine type of response object in stream."); } ungetc(c, rs->get_stream()); } /** @brief Read data from a file which does not have response MIME headers. - This method is a companion to read_data(). While read_data() assumes that - the response has MIME headers, this method does not. If you call this - with a Response that does contain headers, it will throw an Error (and - the message is likely to be inscrutable). - - @note This method will use the 'type' information in the Response object - to choose between processing the response as a data dds or data ddx. If - there is no type information, it will attempt to figure it out. + This method is a companion to read_data(). While read_data() assumes that + the response has MIME headers, this method does not. If you call this + with a Response that does contain headers, it will throw an Error (and + the message is likely to be inscrutable). + + @note This method will use the 'type' information in the Response object + to choose between processing the response as a data dds or data ddx. If + there is no type information, it will attempt to figure it out. + + @param data Result. + @param rs Read from this Response object. */ +void Connect::read_data_no_mime(DataDDS &data, Response *rs) +{ + if (rs->get_type() == unknown_type) + divine_type_information(rs); - @param data Result. - @param rs Read from this Response object. */ -void -Connect::read_data_no_mime(DataDDS &data, Response *rs) + switch (rs->get_type()) { + case dods_data: + d_version = rs->get_version(); + d_protocol = rs->get_protocol(); + process_data(data, rs); + break; + case dap4_data_ddx: + process_data(data, rs); + d_version = rs->get_version(); + d_protocol = data.get_protocol(); + break; + default: + throw InternalErr(__FILE__, __LINE__, "Should have been a DataDDS or DataDDX."); + } +} +void Connect::read_data_no_mime(DDS &data, Response *rs) { if (rs->get_type() == unknown_type) - divine_type_information(rs); + divine_type_information(rs); switch (rs->get_type()) { case dods_data: - d_version = rs->get_version(); - d_protocol = rs->get_protocol(); - process_data(data, rs); - break; + d_version = rs->get_version(); + d_protocol = rs->get_protocol(); + process_data(data, rs); + break; case dap4_data_ddx: - process_data(data, rs); - d_version = rs->get_version(); - d_protocol = data.get_protocol(); - break; + process_data(data, rs); + d_version = rs->get_version(); + // TODO should check to see if this hack is a correct replacement + // for get_protocol from DataDDS + d_protocol = data.get_dap_version(); + break; default: - throw InternalErr(__FILE__, __LINE__, "Should have been a DataDDS or DataDDX."); + throw InternalErr(__FILE__, __LINE__, "Should have been a DataDDS or DataDDX."); } } @@ -1011,27 +1143,25 @@ } /** Return the Connect object's URL in a string. The URL was set by - the class constructor, and may not be reset. If you want to - open another URL, you must create another Connect object. There - is a Connections class created to handle the management of - multiple Connect objects. - - @brief Get the object's URL. - @see Connections - @return A string containing the URL of the data to which the - Connect object refers. If the object refers to local data, - the function returns the null string. - @param ce If TRUE, the returned URL will include any constraint - expression enclosed with the Connect object's URL (including the - ?). If FALSE, any constraint expression will be removed from - the URL. The default is TRUE. -*/ -string -Connect::URL(bool ce) + the class constructor, and may not be reset. If you want to + open another URL, you must create another Connect object. There + is a Connections class created to handle the management of + multiple Connect objects. + + @brief Get the object's URL. + @see Connections + @return A string containing the URL of the data to which the + Connect object refers. If the object refers to local data, + the function returns the null string. + @param ce If TRUE, the returned URL will include any constraint + expression enclosed with the Connect object's URL (including the + ?). If FALSE, any constraint expression will be removed from + the URL. The default is TRUE. + */ +string Connect::URL(bool ce) { if (_local) - throw InternalErr(__FILE__, __LINE__, - "URL(): This call is only valid for a DAP data source."); + throw InternalErr(__FILE__, __LINE__, "URL(): This call is only valid for a DAP data source."); if (ce) return _URL + "?" + _proj + _sel; @@ -1040,73 +1170,66 @@ } /** Return the constraint expression (CE) part of the Connect URL. Note - that this CE is supplied as part of the URL passed to the - Connect's constructor. It is not the CE passed to the - request_data() function. - - @brief Get the Connect's constraint expression. - @return A string containing the constraint expression (if any) - submitted to the Connect object's constructor. */ -string -Connect::CE() + that this CE is supplied as part of the URL passed to the + Connect's constructor. It is not the CE passed to the + request_data() function. + + @brief Get the Connect's constraint expression. + @return A string containing the constraint expression (if any) + submitted to the Connect object's constructor. */ +string Connect::CE() { if (_local) - throw InternalErr(__FILE__, __LINE__, - "CE(): This call is only valid for a DAP data source."); + throw InternalErr(__FILE__, __LINE__, "CE(): This call is only valid for a DAP data source."); return _proj + _sel; } /** @brief Set the credentials for responding to challenges while dereferencing - URLs. - @param u The username. - @param p The password. - @see extract_auth_info() */ -void -Connect::set_credentials(string u, string p) + URLs. + @param u The username. + @param p The password. + @see extract_auth_info() */ +void Connect::set_credentials(string u, string p) { if (d_http) d_http->set_credentials(u, p); } /** Set the \e accept deflate property. - @param deflate True if the client can accept compressed responses, False - otherwise. */ -void -Connect::set_accept_deflate(bool deflate) + @param deflate True if the client can accept compressed responses, False + otherwise. */ +void Connect::set_accept_deflate(bool deflate) { if (d_http) d_http->set_accept_deflate(deflate); } /** Set the \e XDAP-Accept property/header. This is used to send to a server - the (highest) DAP protocol version number that this client understands. + the (highest) DAP protocol version number that this client understands. - @param major The client dap protocol major version - @param minor The client dap protocol minor version */ -void -Connect::set_xdap_protocol(int major, int minor) + @param major The client dap protocol major version + @param minor The client dap protocol minor version */ +void Connect::set_xdap_protocol(int major, int minor) { if (d_http) d_http->set_xdap_protocol(major, minor); } /** Disable any further use of the client-side cache. In a future version - of this software, this should be handled so that the www library is - not initialized with the cache running by default. */ -void -Connect::set_cache_enabled(bool cache) + of this software, this should be handled so that the www library is + not initialized with the cache running by default. */ +void Connect::set_cache_enabled(bool cache) { if (d_http) d_http->set_cache_enabled(cache); } -bool -Connect::is_cache_enabled() +bool Connect::is_cache_enabled() { bool status; DBG(cerr << "Entering is_cache_enabled (" << hex << d_http << dec - << ")... "); + << ")... "); if (d_http) status = d_http->is_cache_enabled(); else diff -Nru libdap-3.11.1/Connect.h libdap-3.12.0/Connect.h --- libdap-3.11.1/Connect.h 2011-04-29 13:19:42.000000000 +0000 +++ libdap-3.12.0/Connect.h 2013-10-17 21:27:40.000000000 +0000 @@ -21,7 +21,7 @@ // // You should have received a copy of the GNU Lesser General Public // License along with this library; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA // // You can contact OPeNDAP, Inc. at PO Box 112, Saunderstown, RI. 02874-0112. @@ -140,6 +140,8 @@ string d_protocol; // DAP protocol from the server void process_data(DataDDS &data, Response *rs); + void process_data(DDS &data, Response *rs); + // Use when you cannot use libwww/libcurl. Reads HTTP response. void parse_mime(Response *rs); @@ -219,6 +221,8 @@ virtual void read_data(DataDDS &data, Response *rs); virtual void read_data_no_mime(DataDDS &data, Response *rs); + virtual void read_data(DDS &data, Response *rs); + virtual void read_data_no_mime(DDS &data, Response *rs); }; } // namespace libdap diff -Nru libdap-3.11.1/ConstraintEvaluator.cc libdap-3.12.0/ConstraintEvaluator.cc --- libdap-3.11.1/ConstraintEvaluator.cc 2011-04-29 13:19:43.000000000 +0000 +++ libdap-3.12.0/ConstraintEvaluator.cc 2013-10-17 21:27:40.000000000 +0000 @@ -18,94 +18,100 @@ // // You should have received a copy of the GNU Lesser General Public // License along with this library; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA // // You can contact OPeNDAP, Inc. at PO Box 112, Saunderstown, RI. 02874-0112. #include "config.h" -static char rcsid[] not_used = - {"$Id: ConstraintEvaluator.cc 24370 2011-03-28 16:21:32Z jimg $" - }; +//#define DODS_DEBUG +#include "ServerFunctionsList.h" #include "ConstraintEvaluator.h" -#include "ce_functions.h" -#include "parser.h" #include "ce_parser.h" #include "debug.h" +#include "parser.h" +#include "expr.h" +//#include "ce_expr.tab.hh" struct yy_buffer_state; -yy_buffer_state *ce_expr_scan_string(const char *str); -int ce_exprparse(void *arg); + +int ce_exprparse(libdap::ce_parser_arg *arg); // Glue routines declared in expr.lex void ce_expr_switch_to_buffer(void *new_buffer); void ce_expr_delete_buffer(void * buffer); void *ce_expr_string(const char *yy_str); +extern int ce_exprdebug; + namespace libdap { ConstraintEvaluator::ConstraintEvaluator() { - register_functions(*this); + // Functions are now held in BES modules. jhrg 1/30/13 + + // modules load functions to this list; this class searches the list + // instead of having it's own copy. This is very similar to the BES' + // various List classes, but this one is part of libdap and not the + // BES. The List class is a singleton, so each function module can + // register it's functions to the list object. + d_functions_list = ServerFunctionsList::TheList(); } ConstraintEvaluator::~ConstraintEvaluator() { // delete all the constants created by the parser for CE evaluation for (Constants_iter j = constants.begin(); j != constants.end(); j++) { - BaseType *btp = *j ; - delete btp ; btp = 0; + BaseType *btp = *j; + delete btp; + btp = 0; } for (Clause_iter k = expr.begin(); k != expr.end(); k++) { - Clause *cp = *k ; - delete cp ; cp = 0; + Clause *cp = *k; + delete cp; + cp = 0; } } /** Returns the first clause in a parsed constraint expression. */ -ConstraintEvaluator::Clause_iter -ConstraintEvaluator::clause_begin() +ConstraintEvaluator::Clause_iter ConstraintEvaluator::clause_begin() { - return expr.begin() ; + return expr.begin(); } /** Returns a reference to the end of the list of clauses in a parsed - constraint expression. It does not reference the last clause */ -ConstraintEvaluator::Clause_iter -ConstraintEvaluator::clause_end() + constraint expression. It does not reference the last clause */ +ConstraintEvaluator::Clause_iter ConstraintEvaluator::clause_end() { - return expr.end() ; + return expr.end(); } /** Returns the value of the indicated clause of a constraint - expression. */ -bool -ConstraintEvaluator::clause_value(Clause_iter &iter, DDS &dds/*, const string &***/) + expression. */ +bool ConstraintEvaluator::clause_value(Clause_iter &iter, DDS &dds/*, const string &***/) { if (expr.empty()) - throw InternalErr(__FILE__, __LINE__, - "There are no CE clauses for *this* DDS object."); + throw InternalErr(__FILE__, __LINE__, "There are no CE clauses for *this* DDS object."); return (*iter)->value(dds); } /** @brief Add a clause to a constraint expression. - This function adds an operator clause to the constraint - expression. + This function adds an operator clause to the constraint + expression. - @param op An integer indicating the operator in use. These - values are generated by \c bison. - @param arg1 A pointer to the argument on the left side of the - operator. - @param arg2 A pointer to a list of the arguments on the right - side of the operator. -*/ -void -ConstraintEvaluator::append_clause(int op, rvalue *arg1, rvalue_list *arg2) + @param op An integer indicating the operator in use. These + values are generated by \c bison. + @param arg1 A pointer to the argument on the left side of the + operator. + @param arg2 A pointer to a list of the arguments on the right + side of the operator. + */ +void ConstraintEvaluator::append_clause(int op, rvalue *arg1, rvalue_list *arg2) { Clause *clause = new Clause(op, arg1, arg2); @@ -114,15 +120,14 @@ /** @brief Add a clause to a constraint expression. - This function adds a boolean function clause to the constraint - expression. + This function adds a boolean function clause to the constraint + expression. - @param func A pointer to a boolean function from the list of - supported functions. - @param args A list of arguments to that function. -*/ -void -ConstraintEvaluator::append_clause(bool_func func, rvalue_list *args) + @param func A pointer to a boolean function from the list of + supported functions. + @param args A list of arguments to that function. + */ +void ConstraintEvaluator::append_clause(bool_func func, rvalue_list *args) { Clause *clause = new Clause(func, args); @@ -131,15 +136,14 @@ /** @brief Add a clause to a constraint expression. - This function adds a real-valued (BaseType) function clause to - the constraint expression. + This function adds a real-valued (BaseType) function clause to + the constraint expression. - @param func A pointer to a BaseType function from the list of - supported functions. - @param args A list of arguments to that function. -*/ -void -ConstraintEvaluator::append_clause(btp_func func, rvalue_list *args) + @param func A pointer to a BaseType function from the list of + supported functions. + @param args A list of arguments to that function. + */ +void ConstraintEvaluator::append_clause(btp_func func, rvalue_list *args) { Clause *clause = new Clause(func, args); @@ -147,26 +151,29 @@ } /** The Constraint Evaluator maintains a list of BaseType pointers for all the - constants that the constraint expression parser generates. These objects - are deleted by the Constraint Evaluator destructor. Note that there are no - list accessors; these constants are never accessed from the list. The list - is simply a convenient way to make sure the constants are disposed of - properly. + constants that the constraint expression parser generates. These objects + are deleted by the Constraint Evaluator destructor. Note that there are no + list accessors; these constants are never accessed from the list. The list + is simply a convenient way to make sure the constants are disposed of + properly. */ -void -ConstraintEvaluator::append_constant(BaseType *btp) +void ConstraintEvaluator::append_constant(BaseType *btp) { constants.push_back(btp); } -class func_name_is -{ +// This code was removed when I switched from CE having it's own internal +// list of functions to using an external list. +#if 0 +class func_name_is { private: const string d_name; public: - func_name_is(const string &name): d_name(name) - {} + func_name_is(const string &name) : + d_name(name) + { + } bool operator()(const ConstraintEvaluator::function f) { return f.name == d_name; @@ -174,27 +181,26 @@ }; /** The Constraint Evaluator carries with it a list of external functions it - can use while evaluate a constraint expression. If a constraint contains - any of these functions, the entries in the list allow the parser to evaluate - it. The functions are of three types: those that return boolean values, - those that return real (also called BaseType) values, and those that - are applied during evaluation of the projection for side effect - - @note The add_function() methods will replace a function of the same name, - so it is possible to overwrite functions in specific handlers if the - handler need special behavior to implement one of the standard functions. + can use while evaluate a constraint expression. If a constraint contains + any of these functions, the entries in the list allow the parser to evaluate + it. The functions are of three types: those that return boolean values, + those that return real (also called BaseType) values, and those that + are applied during evaluation of the projection for side effect + + @note The add_function() methods will replace a function of the same name, + so it is possible to overwrite functions in specific handlers if the + handler need special behavior to implement one of the standard functions. - @see ce_functions for the standard functions + @see ce_functions for the standard functions - These methods are used to manipulate this list of known - external functions. + These methods are used to manipulate this list of known + external functions. - @name External Function Accessors -*/ + @name External Function Accessors + */ //@{ /** @brief Add a boolean function to the list. */ -void -ConstraintEvaluator::add_function(const string &name, bool_func f) +void ConstraintEvaluator::add_function(const string &name, bool_func f) { functions.remove_if(func_name_is(name)); function func(name, f); @@ -202,8 +208,7 @@ } /** @brief Add a BaseType function to the list. */ -void -ConstraintEvaluator::add_function(const string &name, btp_func f) +void ConstraintEvaluator::add_function(const string &name, btp_func f) { functions.remove_if(func_name_is(name)); function func(name, f); @@ -211,18 +216,19 @@ } /** @brief Add a projection function to the list. */ -void -ConstraintEvaluator::add_function(const string &name, proj_func f) +void ConstraintEvaluator::add_function(const string &name, proj_func f) { functions.remove_if(func_name_is(name)); function func(name, f); functions.push_back(func); } +#endif /** @brief Find a Boolean function with a given name in the function list. */ -bool -ConstraintEvaluator::find_function(const string &name, bool_func *f) const +bool ConstraintEvaluator::find_function(const string &name, bool_func *f) const { + return d_functions_list->find_function(name, f); +#if 0 if (functions.empty()) return false; @@ -233,12 +239,14 @@ } return false; +#endif } /** @brief Find a BaseType function with a given name in the function list. */ -bool -ConstraintEvaluator::find_function(const string &name, btp_func *f) const +bool ConstraintEvaluator::find_function(const string &name, btp_func *f) const { + return d_functions_list->find_function(name, f); +#if 0 if (functions.empty()) return false; @@ -249,12 +257,14 @@ } return false; +#endif } /** @brief Find a projection function with a given name in the function list. */ -bool -ConstraintEvaluator::find_function(const string &name, proj_func *f) const +bool ConstraintEvaluator::find_function(const string &name, proj_func *f) const { + return d_functions_list->find_function(name, f); +#if 0 if (functions.empty()) return false; @@ -264,34 +274,37 @@ } return false; +#endif } //@} /** @brief Does the current constraint expression return a BaseType - pointer? - This method does not evaluate the clause, it provides information to the - evaluator regarding _how_ to evaluate the clause. - @return True if the clause is a function that returns a BaseType* and - false otherwise */ -bool -ConstraintEvaluator::functional_expression() + pointer? + This method does not evaluate the clause, it provides information to the + evaluator regarding _how_ to evaluate the clause. + @return True if the clause is a function that returns a BaseType* and + false otherwise + @deprecated + */ +bool ConstraintEvaluator::functional_expression() { if (expr.empty()) return false; - Clause *cp = expr[0] ; + Clause *cp = expr[0]; return cp->value_clause(); } -/** @brief Evaluate a function-valued constraint expression. */ +/** @brief Evaluate a function-valued constraint expression. + * @deprecated + * */ BaseType * ConstraintEvaluator::eval_function(DDS &dds, const string &) { if (expr.size() != 1) - throw InternalErr(__FILE__, __LINE__, - "The length of the list of CE clauses is not 1."); + throw InternalErr(__FILE__, __LINE__, "The length of the list of CE clauses is not 1."); - Clause *cp = expr[0] ; + Clause *cp = expr[0]; BaseType *result; if (cp->value(dds, &result)) return result; @@ -299,101 +312,108 @@ return NULL; } -/** @brief Does the current constraint expression return a DDS pointer? +/** @brief Does the current constraint expression contain function clauses - This method does not evaluate the clauses, it provides information to the - evaluator regarding _how_ to evaluate the clause. + This method does not evaluate the clauses, it provides information to the + evaluator regarding _how_ to evaluate the clause. - @note Added for libdap 3.11 + @note Added for libdap 3.11 - @return True if the clause is a function that returns a DDS* and - false otherwise */ + @return True if the current constraint contains function clauses, + otherwise returns False */ bool ConstraintEvaluator::function_clauses() { if (expr.empty()) - return false; + return false; for (unsigned int i = 0; i < expr.size(); ++i) { - Clause *cp = expr[i]; - if (!cp->value_clause()) - return false; + Clause *cp = expr[i]; + if (!cp->value_clause()) + return false; } return true; } /** @brief Evaluate a function-valued constraint expression that contains - several function calls. + several function calls. - This method can be called for any function-valued constraint expression. - Unlike eval_function(), it will package the return value in a new DDS - object. The server should free this object once it has been serialized - and sent. - - @note While there is another type of function that can appear in a CE (a - 'projection function') those are evaluated by the ce parser - they are used - to insert new variables into the DDS as a side effect of CE evaluation. - That kind of function can never appear here; these are all functions that - return BaseType pointers. + This method can be called for any function-valued constraint expression. + Unlike eval_function(), it will package the return value in a new DDS + object. The server should free this object once it has been serialized + and sent. + + @note While there is another type of function that can appear in a CE (a + 'projection function') those are evaluated by the ce parser - they are used + to insert new variables into the DDS as a side effect of CE evaluation. + That kind of function can never appear here; these are all functions that + return BaseType pointers. - @note Added for libdap 3.11 */ + @note Added for libdap 3.11 */ DDS * ConstraintEvaluator::eval_function_clauses(DDS &dds) { if (expr.empty()) - throw InternalErr(__FILE__, __LINE__, "The constraint expression is empty."); + throw InternalErr(__FILE__, __LINE__, "The constraint expression is empty."); DDS *fdds = new DDS(dds.get_factory(), "function_result_" + dds.get_dataset_name()); for (unsigned int i = 0; i < expr.size(); ++i) { - Clause *cp = expr[i]; - BaseType *result; - if (cp->value(dds, &result)) { - result->set_send_p(true); - fdds->add_var(result); - } - else { - delete fdds; - throw Error("A function was called but failed to return a value."); - } + Clause *cp = expr[i]; + BaseType *result; + if (cp->value(dds, &result)) { + // This is correct: The function must allocate the memory for the result + // variable. 11/30/12 jhrg + fdds->add_var_nocopy(result); + } + else { + delete fdds; + throw Error("A function was called but failed to return a value."); + } } return fdds; } /** @brief Evaluate a function-valued constraint expression that contains - several function calls. Takes and returns a DataDDS. + several function calls. Takes and returns a DataDDS. + + @todo Change this so that the new variables are inserted into the + original DDS object - this will allow constraints that mix simple + projections with function calls. The function is responsible for + setting the new variable's read_p property and this 'evaluator' + sets the send_p property. The original variables would have to be + removed from the original DDS for this to work or the names of + the new variables would have to not clash with the original variables' + names. - @see ConstraintEvaluator::eval_function_clauses(DataDDS &dds) - @note Added for libdap 3.11 */ + @see ConstraintEvaluator::eval_function_clauses(DataDDS &dds) + @note Added for libdap 3.11 */ DataDDS * ConstraintEvaluator::eval_function_clauses(DataDDS &dds) { if (expr.empty()) - throw InternalErr(__FILE__, __LINE__, "The constraint expression is empty."); + throw InternalErr(__FILE__, __LINE__, "The constraint expression is empty."); - DataDDS *fdds = new DataDDS(dds.get_factory(), - "function_result_" + dds.get_dataset_name(), - dds.get_version(), dds.get_protocol()); + DataDDS *fdds = new DataDDS(dds.get_factory(), "function_result_" + dds.get_dataset_name(), dds.get_version(), + dds.get_protocol()); for (unsigned int i = 0; i < expr.size(); ++i) { - Clause *cp = expr[i]; - BaseType *result; - if (cp->value(dds, &result)) { - result->set_send_p(true); - fdds->add_var(result); - } - else { - delete fdds; - throw Error("A function was called but failed to return a value."); - } + Clause *cp = expr[i]; + BaseType *result; + if (cp->value(dds, &result)) { + fdds->add_var_nocopy(result); + } + else { + delete fdds; + throw Error("A function was called but failed to return a value."); + } } return fdds; } /** @brief Does the current constraint expression return a boolean value? */ -bool -ConstraintEvaluator::boolean_expression() +bool ConstraintEvaluator::boolean_expression() { if (expr.empty()) return false; @@ -406,16 +426,14 @@ return boolean; } - /** @brief Evaluate a boolean-valued constraint expression. - This is main method for the evaluator ans is called by the - BaseType::serialize() methods. + This is main method for the evaluator ans is called by the + BaseType::serialize() methods. - @param dds Use these variables when evaluating the expressions. - @param dataset This string is passed to the read() methods. - @return True if the expression is true, false otherwise. */ -bool -ConstraintEvaluator::eval_selection(DDS &dds, const string &) + @param dds Use these variables when evaluating the expressions. + @param dataset This string is passed to the read() methods. + @return True if the expression is true, false otherwise. */ +bool ConstraintEvaluator::eval_selection(DDS &dds, const string &) { if (expr.empty()) { DBG(cerr << "No selection recorded" << endl); @@ -432,8 +450,7 @@ for (Clause_iter i = expr.begin(); i != expr.end() && result; i++) { // A selection expression *must* contain only boolean clauses! if (!((*i)->boolean_clause())) - throw InternalErr(__FILE__, __LINE__, - "A selection expression must contain only boolean clauses."); + throw InternalErr(__FILE__, __LINE__, "A selection expression must contain only boolean clauses."); result = result && (*i)->value(dds); } @@ -442,26 +459,35 @@ /** @brief Parse the constraint expression given the current DDS. - Evaluate the constraint expression; return the value of the expression. - As a side effect, mark the DDS so that BaseType's mfuncs can be used to - correctly read the variable's value and send it to the client. - - @param constraint A string containing the constraint expression. - @param dds The DDS that provides the environment within which the - constraint is evaluated. - @exception Throws Error if the constraint does not parse. */ -void -ConstraintEvaluator::parse_constraint(const string &constraint, DDS &dds) + Evaluate the constraint expression; return the value of the expression. + As a side effect, mark the DDS so that BaseType's mfuncs can be used to + correctly read the variable's value and send it to the client. + + @param constraint A string containing the constraint expression. + @param dds The DDS that provides the environment within which the + constraint is evaluated. + @exception Throws Error if the constraint does not parse. */ +void ConstraintEvaluator::parse_constraint(const string &constraint, DDS &dds) { void *buffer = ce_expr_string(constraint.c_str()); + + // Toggle this to debug the parser. A last resort... + ce_exprdebug = false; + ce_expr_switch_to_buffer(buffer); ce_parser_arg arg(this, &dds); // For all errors, exprparse will throw Error. - ce_exprparse((void *)&arg); - - ce_expr_delete_buffer(buffer); + try { + ce_exprparse(&arg); + ce_expr_delete_buffer(buffer); + } + catch (...) { + // Make sure to remove the buffer when there's an error + ce_expr_delete_buffer(buffer); + throw; + } } } // namespace libdap diff -Nru libdap-3.11.1/ConstraintEvaluator.h libdap-3.12.0/ConstraintEvaluator.h --- libdap-3.11.1/ConstraintEvaluator.h 2011-04-29 13:19:43.000000000 +0000 +++ libdap-3.12.0/ConstraintEvaluator.h 2013-10-17 21:27:40.000000000 +0000 @@ -18,7 +18,7 @@ // // You should have received a copy of the GNU Lesser General Public // License along with this library; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA // // You can contact OPeNDAP, Inc. at PO Box 112, Saunderstown, RI. 02874-0112. @@ -42,10 +42,13 @@ namespace libdap { +class ServerFunctionsList; + /** @brief Evaluate a constraint expression */ class ConstraintEvaluator { private: +#if 0 // This struct is used to hold all the known `user defined' functions // (including those that are `built-in'). struct function @@ -67,12 +70,15 @@ function(): name(""), bt_func(0), p_func(0) {} }; - +#endif vector expr; // List of CE Clauses vector constants;// List of temporary objects - +#if 0 list functions; // Known external functions +#endif + ServerFunctionsList *d_functions_list; // Know external functions from + // modules // The default versions of these methods will break this class. Because // Clause does not support deep copies, that class will need to be modified @@ -92,17 +98,19 @@ typedef std::vector::const_iterator Constants_citer ; typedef std::vector::iterator Constants_iter ; - +#if 0 typedef std::list::const_iterator Functions_citer ; typedef std::list::iterator Functions_iter ; +#endif ConstraintEvaluator(); - virtual ~ConstraintEvaluator(); + virtual ~ConstraintEvaluator(); +#if 0 void add_function(const string &name, bool_func f); void add_function(const string &name, btp_func f); void add_function(const string &name, proj_func f); - +#endif bool find_function(const string &name, bool_func *f) const; bool find_function(const string &name, btp_func *f) const; bool find_function(const string &name, proj_func *f) const; diff -Nru libdap-3.11.1/Constructor.cc libdap-3.12.0/Constructor.cc --- libdap-3.11.1/Constructor.cc 2011-04-29 13:19:43.000000000 +0000 +++ libdap-3.12.0/Constructor.cc 2013-10-17 21:27:40.000000000 +0000 @@ -19,7 +19,7 @@ // // You should have received a copy of the GNU Lesser General Public // License along with this library; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA // // You can contact OPeNDAP, Inc. at PO Box 112, Saunderstown, RI. 02874-0112. @@ -33,6 +33,7 @@ #include "config.h" #include +#include #include #include @@ -43,6 +44,7 @@ #include "debug.h" #include "escaping.h" +#include "util.h" #include "Error.h" #include "InternalErr.h" @@ -54,13 +56,21 @@ // Private member functions void -Constructor::_duplicate(const Constructor &) -{} +Constructor::m_duplicate(const Constructor &c) +{ + Constructor &cs = const_cast(c); + + for (Vars_iter i = cs.d_vars.begin(); i != cs.d_vars.end(); i++) { + BaseType *btp = (*i)->ptr_duplicate(); + btp->set_parent(this); + d_vars.push_back(btp); + } +} // Public member functions -Constructor::Constructor(const string &n, const Type &t) - : BaseType(n, t) +Constructor::Constructor(const string &n, const Type &t, bool is_dap4) + : BaseType(n, t, is_dap4) {} /** Server-side constructor that takes the name of the variable to be @@ -73,11 +83,11 @@ * variable is being created * @param t type of data being stored */ -Constructor::Constructor(const string &n, const string &d, const Type &t) - : BaseType(n, d, t) +Constructor::Constructor(const string &n, const string &d, const Type &t, bool is_dap4) + : BaseType(n, d, t, is_dap4) {} -Constructor::Constructor(const Constructor &rhs) : BaseType(rhs), _vars(0) +Constructor::Constructor(const Constructor &rhs) : BaseType(rhs), d_vars(0) {} Constructor::~Constructor() @@ -91,202 +101,175 @@ dynamic_cast(*this) = rhs; // run BaseType= - _duplicate(rhs); + m_duplicate(rhs); return *this; } -/** Returns an iterator referencing the first structure element. */ -Constructor::Vars_iter -Constructor::var_begin() +int +Constructor::element_count(bool leaves) { - return _vars.begin() ; + if (!leaves) + return d_vars.size(); + else { + int i = 0; + for (Vars_iter j = d_vars.begin(); j != d_vars.end(); j++) { + i += (*j)->element_count(leaves); + } + return i; + } } -/** @brief Look for the parent of an HDF4 dimension attribute - - If this attribute container's name ends in the '_dim_?' suffix, look - for the variable to which it's attributes should be bound: For an array, - they should be held in a sub-table of the array; for a Structure or - Sequence, I don't think the HDF4 handler ever makes these (since those - types don't have 'dimension' in hdf-land); and for a Grid, the attributes - belong with the map variables. +void +Constructor::set_send_p(bool state) +{ + for (Vars_iter i = d_vars.begin(); i != d_vars.end(); i++) { + (*i)->set_send_p(state); + } - @note This method does check that the \e source really is an hdf4 dimension - attribute. + BaseType::set_send_p(state); +} - @param source The attribute container, an AttrTable::entry instance. - @return the BaseType to which these attributes belong or null if none - was found. */ -BaseType * -Constructor::find_hdf4_dimension_attribute_home(AttrTable::entry *source) +void +Constructor::set_read_p(bool state) { - BaseType *btp; - string::size_type i = source->name.find("_dim_"); - if (i != string::npos && (btp = var(source->name.substr(0, i)))) { - if (btp->is_vector_type()) { - return btp; - } - else if (btp->type() == dods_grid_c) { - // For a Grid, the hdf4 handler uses _dim_n for the n-th Map - // i+5 points to the character holding 'n' - int n = atoi(source->name.substr(i + 5).c_str()); - DBG(cerr << "Found a Grid (" << btp->name() << ") and " - << source->name.substr(i) << ", extracted n: " << n << endl); - return *(dynamic_cast(*btp).map_begin() + n); - } + for (Vars_iter i = d_vars.begin(); i != d_vars.end(); i++) { + (*i)->set_read_p(state); } - return 0; + BaseType::set_read_p(state); } #if 0 -/** Given an attribute container from a table, find or make a destination - for its contents in the current constructor variable. */ -AttrTable * -Constructor::find_matching_container(AttrTable::entry *source, - BaseType **dest_variable) -{ - // The attribute entry 'source' must be a container - if (source->type != Attr_container) - throw InternalErr(__FILE__, __LINE__, "Constructor::find_matching_container"); - - // Use the name of the attribute container 'source' to figure out where - // to put its contents. - BaseType *btp; - if ((btp = var(source->name))) { - // ... matches a variable name? Use var's table - *dest_variable = btp; - return &btp->get_attr_table(); - } - // As more special-case attribute containers come to light, add clauses - // here. - else if ((btp = find_hdf4_dimension_attribute_home(source))) { - // ... hdf4 dimension attribute? Make a sub table and use that. - // btp can only be an Array or a Grid Map (which is an array) - if (btp->get_parent()->type() == dods_grid_c) { - DBG(cerr << "Found a Grid" << endl); - *dest_variable = btp; - return &btp->get_attr_table(); - } - else { // must be a plain Array - string::size_type i = source->name.find("_dim_"); - string ext = source->name.substr(i + 1); - *dest_variable = btp; - return btp->get_attr_table().append_container(ext); - } - } - else { - // ... otherwise assume it's a global attribute. - AttrTable *at = get_attr_table().find_container(source->name); - if (!at) { - at = new AttrTable(); // Make a new global table if needed - get_attr_table().append_container(at, source->name); - } +// TODO Recode to use width(bool). Bur see comments in BaseType.h +unsigned int +Constructor::width() +{ + unsigned int sz = 0; - *dest_variable = 0; - return at; + for (Vars_iter i = d_vars.begin(); i != d_vars.end(); i++) { + sz += (*i)->width(); } + + return sz; } #endif -#if 0 -/** Given an Attribute entry, scavenge attributes from it and load them into - this object and the variables it contains. Assume that the caller has - determined the table holds attributes pertinent to only this variable. - - @note This method is technically \e unnecessary because a server (or - client) can easily add attributes directly using the DDS::get_attr_table - or BaseType::get_attr_table methods and then poke values in using any - of the methods AttrTable provides. This method exists to ease the - transition to DDS objects which contain attribute information for the - existing servers (Since they all make DAS objects separately from the - DDS). They could be modified to use the same AttrTable methods but - operate on the AttrTable instances in a DDS/BaseType instead of those in - a DAS. - - @param entry Get attribute information from this Attribute table. Note - that even though the type of the argument is an AttrTable::entry, the - entry \e must be an attribute container.*/ -void -Constructor::transfer_attributes(AttrTable::entry * entry) -{ - DBG(cerr << "Constructor::transfer_attributes, variable: " << name() << - endl); - DBG(cerr << "Working on the '" << entry-> - name << "' container." << endl); - if (entry->type != Attr_container) - throw InternalErr(__FILE__, __LINE__, - "Constructor::transfer_attributes"); - - AttrTable *source = entry->attributes; - BaseType *dest_variable = 0; - AttrTable *dest = find_matching_container(entry, &dest_variable); - - // foreach source attribute in the das_i container - AttrTable::Attr_iter source_p = source->attr_begin(); - while (source_p != source->attr_end()) { - DBG(cerr << "Working on the '" << (*source_p)-> - name << "' attribute" << endl); - - if ((*source_p)->type == Attr_container) { - if (dest_variable && dest_variable->is_constructor_type()) { - dynamic_cast (*dest_variable).transfer_attributes(*source_p); - } - else { - dest->append_container(new AttrTable(*(*source_p)->attributes), - (*source_p)->name); - } +/** This version of width simply returns the same thing as width() for simple + types and Arrays. For Structure it returns the total size if constrained + is false, or the size of the elements in the current projection if true. + + @param constrained If true, return the size after applying a constraint. + @return The number of bytes used by the variable. + */ +unsigned int +Constructor::width(bool constrained) +{ + unsigned int sz = 0; + + for (Vars_iter i = d_vars.begin(); i != d_vars.end(); i++) { + if (constrained) { + if ((*i)->send_p()) + sz += (*i)->width(constrained); } else { - dest->append_attr(source->get_name(source_p), - source->get_type(source_p), - source->get_attr_vector(source_p)); + sz += (*i)->width(constrained); } + } + + return sz; +} + +BaseType * +Constructor::var(const string &name, bool exact_match, btp_stack *s) +{ + string n = www2id(name); + + if (exact_match) + return m_exact_match(n, s); + else + return m_leaf_match(n, s); +} + +/** @deprecated See comment in BaseType */ +BaseType * +Constructor::var(const string &n, btp_stack &s) +{ + string name = www2id(n); + + BaseType *btp = m_exact_match(name, &s); + if (btp) + return btp; + + return m_leaf_match(name, &s); +} - ++source_p; +// Protected method +BaseType * +Constructor::m_leaf_match(const string &name, btp_stack *s) +{ + for (Vars_iter i = d_vars.begin(); i != d_vars.end(); i++) { + if ((*i)->name() == name) { + if (s) { + DBG(cerr << "Pushing " << this->name() << endl); + s->push(static_cast(this)); + } + return *i; + } + if ((*i)->is_constructor_type()) { + BaseType *btp = (*i)->var(name, false, s); + if (btp) { + if (s) { + DBG(cerr << "Pushing " << this->name() << endl); + s->push(static_cast(this)); + } + return btp; + } + } } + + return 0; } -#endif -/** Given an Attribute table, scavenge attributes from it and load them into - this object and the variables it contains. +// Protected method +BaseType * +Constructor::m_exact_match(const string &name, btp_stack *s) +{ + // Look for name at the top level first. + for (Vars_iter i = d_vars.begin(); i != d_vars.end(); i++) { + if ((*i)->name() == name) { + if (s) + s->push(static_cast(this)); + + return *i; + } + } - This implementation differs from the version in BaseType in that each of - the children of the Constructor are passed an attribute container if one - is found that matches the name of this Constructor variable. - - @param at_container Search for attributes in this container. - */ -void Constructor::transfer_attributes(AttrTable *at_container) -{ - AttrTable *at = at_container->get_attr_table(name()); - - if (at) { - at->set_is_global_attribute(false); - - Vars_iter var = var_begin(); - while (var != var_end()) { - (*var)->transfer_attributes(at); - var++; - } - - // Trick: If an attribute that's within the container 'at' still has its - // is_global_attribute property set, then it's not really a global attr - // but instead an attribute that belongs to this Constructor. - AttrTable::Attr_iter at_p = at->attr_begin(); - while (at_p != at->attr_end()) { - if (at->is_global_attribute(at_p)) { - if (at->get_attr_type(at_p) == Attr_container) - get_attr_table().append_container(new AttrTable( - *at->get_attr_table(at_p)), at->get_name(at_p)); - else - get_attr_table().append_attr(at->get_name(at_p), - at->get_type(at_p), at->get_attr_vector(at_p)); - } - at_p++; - } + // If it was not found using the simple search, look for a dot and + // search the hierarchy. + string::size_type dot_pos = name.find("."); // zero-based index of `.' + if (dot_pos != string::npos) { + string aggregate = name.substr(0, dot_pos); + string field = name.substr(dot_pos + 1); + + BaseType *agg_ptr = var(aggregate); + if (agg_ptr) { + if (s) + s->push(static_cast(this)); + return agg_ptr->var(field, true, s); // recurse + } + else + return 0; // qualified names must be *fully* qualified } + + return 0; +} + +/** Returns an iterator referencing the first structure element. */ +Constructor::Vars_iter +Constructor::var_begin() +{ + return d_vars.begin() ; } /** Returns an iterator referencing the end of the list of structure @@ -294,14 +277,14 @@ Constructor::Vars_iter Constructor::var_end() { - return _vars.end() ; + return d_vars.end() ; } /** Return a reverse iterator that references the last element. */ Constructor::Vars_riter Constructor::var_rbegin() { - return _vars.rbegin(); + return d_vars.rbegin(); } /** Return a reverse iterator that references a point 'before' the first @@ -309,7 +292,7 @@ Constructor::Vars_riter Constructor::var_rend() { - return _vars.rend(); + return d_vars.rend(); } /** Return the iterator for the \e ith variable. @@ -318,7 +301,7 @@ Constructor::Vars_iter Constructor::get_vars_iter(int i) { - return _vars.begin() + i; + return d_vars.begin() + i; } /** Return the BaseType pointer for the \e ith variable. @@ -327,36 +310,162 @@ BaseType * Constructor::get_var_index(int i) { - return *(_vars.begin() + i); + return *(d_vars.begin() + i); } -#if FILE_METHODS +/** Adds an element to a Constructor. + + @param bt A pointer to the variable to add to this Constructor. + @param part Not used by this class, defaults to nil */ void -Constructor::print_decl(FILE *out, string space, bool print_semi, - bool constraint_info, bool constrained) +Constructor::add_var(BaseType *bt, Part) { - if (constrained && !send_p()) - return; + // Jose Garcia + // Passing and invalid pointer to an object is a developer's error. + if (!bt) + throw InternalErr(__FILE__, __LINE__, "The BaseType parameter cannot be null."); +#if 0 + if (bt->is_dap4_only_type()) + throw InternalErr(__FILE__, __LINE__, "Attempt to add a DAP4 type to a DAP2 Structure."); +#endif + // Jose Garcia + // Now we add a copy of bt so the external user is able to destroy bt as + // he/she wishes. The policy is: "If it is allocated outside, it is + // deallocated outside, if it is allocated inside, it is deallocated + // inside" + BaseType *btp = bt->ptr_duplicate(); + btp->set_parent(this); + d_vars.push_back(btp); +} + +/** Adds an element to a Constructor. - fprintf(out, "%s%s {\n", space.c_str(), type_name().c_str()) ; - for (Vars_citer i = _vars.begin(); i != _vars.end(); i++) { - (*i)->print_decl(out, space + " ", true, - constraint_info, constrained); + @param bt A pointer to thee variable to add to this Constructor. + @param part Not used by this class, defaults to nil */ +void +Constructor::add_var_nocopy(BaseType *bt, Part) +{ + if (!bt) + throw InternalErr(__FILE__, __LINE__, "The BaseType parameter cannot be null."); +#if 0 + if (bt->is_dap4_only_type()) + throw InternalErr(__FILE__, __LINE__, "Attempt to add a DAP4 type to a DAP2 Structure."); +#endif + bt->set_parent(this); + d_vars.push_back(bt); +} + +/** Remove an element from a Constructor. + + @param n name of the variable to remove */ +void +Constructor::del_var(const string &n) +{ + for (Vars_iter i = d_vars.begin(); i != d_vars.end(); i++) { + if ((*i)->name() == n) { + BaseType *bt = *i ; + d_vars.erase(i) ; + delete bt ; bt = 0; + return; + } } - fprintf(out, "%s} %s", space.c_str(), id2www(name()).c_str()) ; +} - if (constraint_info) { // Used by test drivers only. - if (send_p()) - cout << ": Send True"; - else - cout << ": Send False"; +void +Constructor::del_var(Vars_iter i) +{ + if (*i != 0) { + BaseType *bt = *i; + d_vars.erase(i); + delete bt; } +} - if (print_semi) - fprintf(out, ";\n") ; +/** @brief simple implementation of read that iterates through vars + * and calls read on them + * + * @return returns false to signify all has been read + */ +bool Constructor::read() +{ + if (!read_p()) { + for (Vars_iter i = d_vars.begin(); i != d_vars.end(); i++) { + (*i)->read(); + } + set_read_p(true); + } + + return false; +} + +void +Constructor::intern_data(ConstraintEvaluator & eval, DDS & dds) +{ + DBG(cerr << "Structure::intern_data: " << name() << endl); + if (!read_p()) + read(); // read() throws Error and InternalErr + + for (Vars_iter i = d_vars.begin(); i != d_vars.end(); i++) { + if ((*i)->send_p()) { + (*i)->intern_data(eval, dds); + } + } } + +bool +Constructor::serialize(ConstraintEvaluator &eval, DDS &dds, Marshaller &m, bool ce_eval) +{ + dds.timeout_on(); + + if (!read_p()) + read(); // read() throws Error and InternalErr + +#if EVAL + if (ce_eval && !eval.eval_selection(dds, dataset())) + return true; #endif + dds.timeout_off(); + + for (Vars_iter i = d_vars.begin(); i != d_vars.end(); i++) { + if ((*i)->send_p()) { +#ifdef CHECKSUMS + XDRStreamMarshaller *sm = dynamic_cast(&m); + if (sm && sm->checksums() && (*i)->type() != dods_structure_c && (*i)->type() != dods_grid_c) + sm->reset_checksum(); + + (*i)->serialize(eval, dds, m, false); + + if (sm && sm->checksums() && (*i)->type() != dods_structure_c && (*i)->type() != dods_grid_c) + sm->get_checksum(); +#else + (*i)->serialize(eval, dds, m, false); +#endif + } + } + + return true; +} + +bool +Constructor::deserialize(UnMarshaller &um, DDS *dds, bool reuse) +{ + for (Vars_iter i = d_vars.begin(); i != d_vars.end(); i++) { + (*i)->deserialize(um, dds, reuse); + } + + return false; +} + +void +Constructor::print_decl(FILE *out, string space, bool print_semi, + bool constraint_info, bool constrained) +{ + ostringstream oss; + print_decl(oss, space, print_semi, constraint_info, constrained); + fwrite(oss.str().data(), sizeof(char), oss.str().length(), out); +} + void Constructor::print_decl(ostream &out, string space, bool print_semi, bool constraint_info, bool constrained) @@ -365,9 +474,8 @@ return; out << space << type_name() << " {\n" ; - for (Vars_citer i = _vars.begin(); i != _vars.end(); i++) { - (*i)->print_decl(out, space + " ", true, - constraint_info, constrained); + for (Vars_citer i = d_vars.begin(); i != d_vars.end(); i++) { + (*i)->print_decl(out, space + " ", true, constraint_info, constrained); } out << space << "} " << id2www(name()) ; @@ -379,97 +487,115 @@ } if (print_semi) - out << ";\n" ; + out << ";\n" ; } -#if FILE_METHODS -class PrintField : public unary_function +void +Constructor::print_val(FILE *out, string space, bool print_decl_p) { - FILE *d_out; - string d_space; - bool d_constrained; -public: - PrintField(FILE *o, string s, bool c) - : d_out(o), d_space(s), d_constrained(c) - {} - - void operator()(BaseType *btp) - { - btp->print_xml(d_out, d_space, d_constrained); - } -}; + ostringstream oss; + print_val(oss, space, print_decl_p); + fwrite(oss.str().data(), sizeof(char), oss.str().length(), out); +} void -Constructor::print_xml(FILE *out, string space, bool constrained) +Constructor::print_val(ostream &out, string space, bool print_decl_p) { - if (constrained && !send_p()) - return; - - bool has_attributes = false; // *** fix me - bool has_variables = (var_begin() != var_end()); + if (print_decl_p) { + print_decl(out, space, false); + out << " = " ; + } - fprintf(out, "%s<%s", space.c_str(), type_name().c_str()); - if (!name().empty()) - fprintf(out, " name=\"%s\"", id2xml(name()).c_str()); + out << "{ " ; + for (Vars_citer i = d_vars.begin(); i != d_vars.end(); + i++, (void)(i != d_vars.end() && out << ", ")) { + (*i)->print_val(out, "", false); + } - if (has_attributes || has_variables) { - fprintf(out, ">\n"); + out << " }" ; - get_attr_table().print_xml(out, space + " ", constrained); + if (print_decl_p) + out << ";\n" ; +} - for_each(var_begin(), var_end(), - PrintField(out, space + " ", constrained)); +/** + * @deprecated + */ +void +Constructor::print_xml(FILE *out, string space, bool constrained) +{ + XMLWriter xml(space); + print_xml_writer(xml, constrained); + fwrite(xml.get_doc(), sizeof(char), xml.get_doc_size(), out); +} - fprintf(out, "%s\n", space.c_str(), type_name().c_str()); - } - else { - fprintf(out, "/>\n"); - } +/** + * @deprecated + */ +void +Constructor::print_xml(ostream &out, string space, bool constrained) +{ + XMLWriter xml(space); + print_xml_writer(xml, constrained); + out << xml.get_doc(); } -#endif -class PrintFieldStrm : public unary_function +class PrintFieldXMLWriter : public unary_function { - ostream &d_out; - string d_space; + XMLWriter &d_xml; bool d_constrained; public: - PrintFieldStrm(ostream &o, string s, bool c) - : d_out(o), d_space(s), d_constrained(c) + PrintFieldXMLWriter(XMLWriter &x, bool c) + : d_xml(x), d_constrained(c) {} void operator()(BaseType *btp) { - btp->print_xml(d_out, d_space, d_constrained); + btp->print_xml_writer(d_xml, d_constrained); } }; void -Constructor::print_xml(ostream &out, string space, bool constrained) +Constructor::print_xml_writer(XMLWriter &xml, bool constrained) { if (constrained && !send_p()) return; - bool has_attributes = false; // *** fix me - bool has_variables = (var_begin() != var_end()); + if (xmlTextWriterStartElement(xml.get_writer(), (const xmlChar*)type_name().c_str()) < 0) + throw InternalErr(__FILE__, __LINE__, "Could not write " + type_name() + " element"); - out << space << "<" << type_name() ; if (!name().empty()) - out << " name=\"" << id2xml(name()) << "\"" ; + if (xmlTextWriterWriteAttribute(xml.get_writer(), (const xmlChar*) "name", (const xmlChar*)name().c_str()) < 0) + throw InternalErr(__FILE__, __LINE__, "Could not write attribute for name"); - if (has_attributes || has_variables) { - out << ">\n" ; + bool has_attributes = get_attr_table().get_size() > 0; + bool has_variables = (var_begin() != var_end()); + if (has_attributes) + get_attr_table().print_xml_writer(xml); + if (has_variables) + for_each(var_begin(), var_end(), PrintFieldXMLWriter(xml, constrained)); - get_attr_table().print_xml(out, space + " ", constrained); + if (xmlTextWriterEndElement(xml.get_writer()) < 0) + throw InternalErr(__FILE__, __LINE__, "Could not end " + type_name() + " element"); +} - for_each(var_begin(), var_end(), - PrintFieldStrm(out, space + " ", constrained)); +bool +Constructor::check_semantics(string &msg, bool all) +{ + if (!BaseType::check_semantics(msg)) + return false; - out << space << "\n" ; - } - else { - out << "/>\n" ; - } + if (!unique_names(d_vars, name(), type_name(), msg)) + return false; + + if (all) + for (Vars_iter i = d_vars.begin(); i != d_vars.end(); i++) { + if (!(*i)->check_semantics(msg, true)) { + return false; + } + } + + return true; } /** True if the instance can be flattened and printed as a single table @@ -490,6 +616,21 @@ return false; } +/** Set the \e in_selection property for this variable and all of its + children. + + @brief Set the \e in_selection property. + @param state Set the property value to \e state. */ +void +Constructor::set_in_selection(bool state) +{ + for (Vars_iter i = d_vars.begin(); i != d_vars.end(); i++) { + (*i)->set_in_selection(state); + } + + BaseType::set_in_selection(state); +} + /** @brief dumps information about this object * * Displays the pointer value of this instance and information about this @@ -507,8 +648,8 @@ BaseType::dump(strm) ; strm << DapIndent::LMarg << "vars: " << endl ; DapIndent::Indent() ; - Vars_citer i = _vars.begin() ; - Vars_citer ie = _vars.end() ; + Vars_citer i = d_vars.begin() ; + Vars_citer ie = d_vars.end() ; for (; i != ie; i++) { (*i)->dump(strm) ; } diff -Nru libdap-3.11.1/Constructor.h libdap-3.12.0/Constructor.h --- libdap-3.11.1/Constructor.h 2011-04-29 13:19:43.000000000 +0000 +++ libdap-3.12.0/Constructor.h 2013-10-17 21:27:40.000000000 +0000 @@ -19,7 +19,7 @@ // // You should have received a copy of the GNU Lesser General Public // License along with this library; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA // // You can contact OPeNDAP, Inc. at PO Box 112, Saunderstown, RI. 02874-0112. @@ -28,11 +28,7 @@ #include -#ifndef _basetype_h #include "BaseType.h" -#endif - -#define FILE_METHODS 1 namespace libdap { @@ -42,20 +38,19 @@ { private: Constructor(); // No default ctor. - BaseType *find_hdf4_dimension_attribute_home(AttrTable::entry *source); protected: - std::vector _vars; + std::vector d_vars; - void _duplicate(const Constructor &s); -#if 0 - virtual AttrTable *find_matching_container(AttrTable::entry *source, - BaseType **dest_variable); -#endif - Constructor(const string &n, const Type &t); - Constructor(const string &n, const string &d, const Type &t); + void m_duplicate(const Constructor &s); + BaseType *m_leaf_match(const string &name, btp_stack *s = 0); + BaseType *m_exact_match(const string &name, btp_stack *s = 0); + + Constructor(const string &n, const Type &t, bool is_dap4 = false); + Constructor(const string &n, const string &d, const Type &t, bool is_dap4 = false); Constructor(const Constructor ©_from); + public: typedef std::vector::const_iterator Vars_citer ; typedef std::vector::iterator Vars_iter ; @@ -64,10 +59,23 @@ virtual ~Constructor(); Constructor &operator=(const Constructor &rhs); + + //virtual void transfer_attributes(AttrTable *at_container); + + virtual int element_count(bool leaves = false); + + virtual void set_send_p(bool state); + virtual void set_read_p(bool state); + + /// @deprecated + virtual unsigned int width(bool constrained = false); #if 0 - virtual void transfer_attributes(AttrTable::entry *entry); + virtual unsigned int width(bool constrained); #endif - virtual void transfer_attributes(AttrTable *at_container); + /// btp_stack no longer needed; use back pointers (BaseType::get_parent()) + virtual BaseType *var(const string &name, bool exact_match = true, btp_stack *s = 0); + /// @deprecated + virtual BaseType *var(const string &n, btp_stack &s); Vars_iter var_begin(); Vars_iter var_end(); @@ -76,7 +84,27 @@ Vars_iter get_vars_iter(int i); BaseType *get_var_index(int i); + virtual void add_var(BaseType *bt, Part part = nil); + virtual void add_var_nocopy(BaseType *bt, Part part = nil); + + virtual void del_var(const string &name); + virtual void del_var(Vars_iter i); + + virtual bool read(); + virtual void intern_data(ConstraintEvaluator &eval, DDS &dds); + virtual bool serialize(ConstraintEvaluator &eval, DDS &dds, Marshaller &m, bool ce_eval = true); + virtual bool deserialize(UnMarshaller &um, DDS *dds, bool reuse = false); + + // Do not store values in memory as for C; users work with the C++ objects + virtual unsigned int val2buf(void *, bool) { + throw InternalErr(__FILE__, __LINE__, "Never use this method; see the programmer's guide documentation."); + } + virtual unsigned int buf2val(void **) { + throw InternalErr(__FILE__, __LINE__, "Never use this method; see the programmer's guide documentation."); + } + virtual bool is_linear(); + virtual void set_in_selection(bool state); virtual void print_decl(ostream &out, string space = " ", bool print_semi = true, @@ -86,14 +114,21 @@ virtual void print_xml(ostream &out, string space = " ", bool constrained = false); -#if FILE_METHODS + virtual void print_xml_writer(XMLWriter &xml, bool constrained = false); + virtual void print_decl(FILE *out, string space = " ", bool print_semi = true, bool constraint_info = false, bool constrained = false); virtual void print_xml(FILE *out, string space = " ", bool constrained = false); -#endif + + virtual void print_val(FILE *out, string space = "", + bool print_decl_p = true); + virtual void print_val(ostream &out, string space = "", + bool print_decl_p = true); + + virtual bool check_semantics(string &msg, bool all = false); virtual void dump(ostream &strm) const ; }; diff -Nru libdap-3.11.1/D4BaseTypeFactory.cc libdap-3.12.0/D4BaseTypeFactory.cc --- libdap-3.11.1/D4BaseTypeFactory.cc 1970-01-01 00:00:00.000000000 +0000 +++ libdap-3.12.0/D4BaseTypeFactory.cc 2013-10-17 21:27:40.000000000 +0000 @@ -0,0 +1,179 @@ + +// -*- mode: c++; c-basic-offset:4 -*- + +// This file is part of libdap, A C++ implementation of the OPeNDAP Data +// Access Protocol. + +// Copyright (c) 2005 OPeNDAP, Inc. +// Author: James Gallagher +// +// This library is free software; you can redistribute it and/or +// modify it under the terms of the GNU Lesser General Public +// License as published by the Free Software Foundation; either +// version 2.1 of the License, or (at your option) any later version. +// +// This library 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 +// Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, write to the Free Software +// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA +// +// You can contact OPeNDAP, Inc. at PO Box 112, Saunderstown, RI. 02874-0112. + + +#include + +#include "BaseType.h" + +#include "Byte.h" +#include "Int8.h" +#include "Int16.h" +#include "UInt16.h" +#include "Int32.h" +#include "UInt32.h" +#include "Int64.h" +#include "UInt64.h" + +#include "Float32.h" +#include "Float64.h" + +#include "Str.h" +#include "Url.h" + +#include "Array.h" +#include "Structure.h" +#include "Sequence.h" +#include "Grid.h" + +#include "D4Group.h" + +#include "D4BaseTypeFactory.h" +#include "debug.h" + +namespace libdap { + +Byte * +D4BaseTypeFactory::NewByte(const string &n) const +{ + return new Byte(n); +} + +Byte * +D4BaseTypeFactory::NewUInt8(const string &n) const +{ + Byte *b = new Byte(n); + b->set_type(dods_uint8_c); + return b; +} + +Int8 * +D4BaseTypeFactory::NewInt8(const string &n) const +{ + return new Int8(n); +} + +Int16 * +D4BaseTypeFactory::NewInt16(const string &n) const +{ + return new Int16(n); +} + +UInt16 * +D4BaseTypeFactory::NewUInt16(const string &n) const +{ + return new UInt16(n); +} + +Int32 * +D4BaseTypeFactory::NewInt32(const string &n) const +{ + DBG(cerr << "Inside DAP4BaseTypeFactory::NewInt32" << endl); + return new Int32(n); +} + +UInt32 * +D4BaseTypeFactory::NewUInt32(const string &n) const +{ + return new UInt32(n); +} + +Int64 * +D4BaseTypeFactory::NewInt64(const string &n) const +{ + DBG(cerr << "Inside DAP4BaseTypeFactory::NewInt64" << endl); + return new Int64(n); +} + +UInt64 * +D4BaseTypeFactory::NewUInt64(const string &n) const +{ + return new UInt64(n); +} + +Float32 * +D4BaseTypeFactory::NewFloat32(const string &n) const +{ + return new Float32(n); +} + +Float64 * +D4BaseTypeFactory::NewFloat64(const string &n) const +{ + return new Float64(n); +} + +Str * +D4BaseTypeFactory::NewStr(const string &n) const +{ + return new Str(n); +} + +Url * +D4BaseTypeFactory::NewUrl(const string &n) const +{ + return new Url(n); +} + +Url * +D4BaseTypeFactory::NewURL(const string &n) const +{ + Url *u = new Url(n); + u->set_type(dods_url4_c); + return u; +} + +Array * +D4BaseTypeFactory::NewArray(const string &n , BaseType *v) const +{ + return new Array(n, v); +} + +Structure * +D4BaseTypeFactory::NewStructure(const string &n) const +{ + return new Structure(n); +} + +D4Group * +D4BaseTypeFactory::NewGroup(const string &n) const +{ + return new D4Group(n); +} + +Sequence * +D4BaseTypeFactory::NewSequence(const string &n) const +{ + DBG(cerr << "Inside DAP4BaseTypeFactory::NewSequence" << endl); + return new Sequence(n); +} + +Grid * +D4BaseTypeFactory::NewGrid(const string &n) const +{ + return new Grid(n); +} + +} // namespace libdap diff -Nru libdap-3.11.1/D4BaseTypeFactory.h libdap-3.12.0/D4BaseTypeFactory.h --- libdap-3.11.1/D4BaseTypeFactory.h 1970-01-01 00:00:00.000000000 +0000 +++ libdap-3.12.0/D4BaseTypeFactory.h 2013-10-17 21:27:40.000000000 +0000 @@ -0,0 +1,110 @@ + +// -*- mode: c++; c-basic-offset:4 -*- + +// This file is part of libdap, A C++ implementation of the OPeNDAP Data +// Access Protocol. + +// Copyright (c) 2012 OPeNDAP, Inc. +// Author: James Gallagher +// +// This library is free software; you can redistribute it and/or +// modify it under the terms of the GNU Lesser General Public +// License as published by the Free Software Foundation; either +// version 2.1 of the License, or (at your option) any later version. +// +// This library 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 +// Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, write to the Free Software +// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA +// +// You can contact OPeNDAP, Inc. at PO Box 112, Saunderstown, RI. 02874-0112. + +#ifndef dap4_base_type_factory_h +#define dap4_base_type_factory_h + +#include + +#include "BaseTypeFactory.h" + +// Class declarations; Make sure to include the corresponding headers in the +// implementation file. + +namespace libdap +{ + +class Byte; +class Int8; +class Int16; +class UInt16; +class Int32; +class UInt32; +class Int64; +class UInt64; + +class Float32; +class Float64; + +class Str; +class Url; + +class Array; +class Structure; +class Sequence; +class Grid; + +class D4Group; + +class BaseType; + +/** + * Return instances of objects that are to be stored in a DDS for a + * DAP4 dataset. + * + */ +class D4BaseTypeFactory: public BaseTypeFactory +{ +public: + D4BaseTypeFactory() + {} + virtual ~D4BaseTypeFactory() + {} + + virtual Byte *NewByte(const string &n = "") const; + virtual Int8 *NewInt8(const string &n = "") const; + virtual Byte *NewUInt8(const string &n = "") const; + virtual Int16 *NewInt16(const string &n = "") const; + virtual UInt16 *NewUInt16(const string &n = "") const; + virtual Int32 *NewInt32(const string &n = "") const; + virtual UInt32 *NewUInt32(const string &n = "") const; + + virtual Int64 *NewInt64(const string &n = "") const; + virtual UInt64 *NewUInt64(const string &n = "") const; + + virtual Float32 *NewFloat32(const string &n = "") const; + virtual Float64 *NewFloat64(const string &n = "") const; + + virtual Str *NewStr(const string &n = "") const; + virtual Url *NewUrl(const string &n = "") const; + virtual Url *NewURL(const string &n = "") const; + + // FIXME Define these +#if 0 + virtual Opaque *NewOpaque(const string &n = "") const; + virtual Enumeration *NewEnumeration(const string &n = "") const; +#endif + virtual Structure *NewStructure(const string &n = "") const; + virtual Sequence *NewSequence(const string &n = "") const; +#if 1 + virtual D4Group *NewGroup(const string &n = "") const; +#endif + virtual Array *NewArray(const string &n = "", BaseType *v = 0) const; + virtual Grid *NewGrid(const string &n = "") const; +}; + +} // namespace libdap + +#endif // dap4_base_type_factory_h diff -Nru libdap-3.11.1/D4Dimensions.cc libdap-3.12.0/D4Dimensions.cc --- libdap-3.11.1/D4Dimensions.cc 1970-01-01 00:00:00.000000000 +0000 +++ libdap-3.12.0/D4Dimensions.cc 2013-10-17 21:27:40.000000000 +0000 @@ -0,0 +1,23 @@ +/* + * D4Dimensions.cc + * + * Created on: Sep 26, 2012 + * Author: jimg + */ + +#include "D4Dimensions.h" + +namespace libdap { + +D4Dimensions::D4Dimensions() +{ + // TODO Auto-generated constructor stub + +} + +D4Dimensions::~D4Dimensions() +{ + // TODO Auto-generated destructor stub +} + +} /* namespace libdap */ diff -Nru libdap-3.11.1/D4Dimensions.h libdap-3.12.0/D4Dimensions.h --- libdap-3.11.1/D4Dimensions.h 1970-01-01 00:00:00.000000000 +0000 +++ libdap-3.12.0/D4Dimensions.h 2013-10-17 21:27:40.000000000 +0000 @@ -0,0 +1,64 @@ +/* + * D4Dimensions.h + * + * Created on: Sep 26, 2012 + * Author: jimg + */ + +#ifndef D4DIMENSIONS_H_ +#define D4DIMENSIONS_H_ + +#include +#include + +using namespace std; + +namespace libdap { + +/** + * This class holds information about dimensions. This can be used to store + * actual dimension information in an instance of BaseType and it can be + * used to store the definition of a dimension in an instance of Group. + * + * + * @todo What about storing constraint information too? Maybe we do need + * two classes - one for defs and one for 'refs' + */ +class D4Dimensions { + struct dimension { + string name; + unsigned long size; + + dimension(const string &n, const unsigned long s) : + name(n), size(s) {} + }; + + vector d_dims; + +public: + D4Dimensions(); + virtual ~D4Dimensions(); + + typedef vector::iterator D4DimensionsIter; + + void add_dim(const string &name, const unsigned long size) { + d_dims.push_back(dimension(name, size)); + } + void add_dim(const string &name) { + d_dims.push_back(dimension(name, 0)); + } + void add_dim(const unsigned long size) { + d_dims.push_back(dimension("", size)); + } + + string get_dim_name(int i) { return d_dims.at(i).name; } + unsigned long get_dim_size(int i) { return d_dims.at(i).size; } + + D4DimensionsIter maps_begin() { return d_dims.begin(); } + D4DimensionsIter maps_end() { return d_dims.end(); } + string get_dim_name(D4DimensionsIter i) { return (*i).name; } + unsigned long get_dim_size(D4DimensionsIter i) { return (*i).size; } +}; + +} /* namespace libdap */ +#endif /* D4DIMENSIONS_H_ */ diff -Nru libdap-3.11.1/D4EnumDef.cc libdap-3.12.0/D4EnumDef.cc --- libdap-3.11.1/D4EnumDef.cc 1970-01-01 00:00:00.000000000 +0000 +++ libdap-3.12.0/D4EnumDef.cc 2013-10-17 21:27:40.000000000 +0000 @@ -0,0 +1,79 @@ +/* + * D4EnumDef.cc + * + * Created on: Oct 9, 2012 + * Author: jimg + */ + +#include "D4EnumDef.h" + +#include + +#include "util.h" + +namespace libdap { + +#if 0 +string D4EnumDef::type_name() { + switch (d_type) { + case dods_int8_c: + return string("Int8"); + case dods_uint8_c: + return string("UInt8"); + case dods_byte_c: + return string("Byte"); + case dods_int16_c: + return string("Int16"); + case dods_uint16_c: + return string("UInt16"); + case dods_int32_c: + return string("Int32"); + case dods_uint32_c: + return string("UInt32"); + case dods_int64_c: + return string("Int64"); + case dods_uint64_c: + return string("UInt64"); + + default: + throw InternalErr(__FILE__, __LINE__, "Invalid enumeration basetype."); + } +} +#endif + +void D4EnumDef::print_enum_const(XMLWriter *xml, const enum_val ev) +{ + if (xmlTextWriterStartElement(xml->get_writer(), (const xmlChar*)"EnumConst") < 0) + throw InternalErr(__FILE__, __LINE__, "Could not write EnumConst element"); + + if (xmlTextWriterWriteAttribute(xml->get_writer(), (const xmlChar*) "name", (const xmlChar*)ev.d_item.c_str()) < 0) + throw InternalErr(__FILE__, __LINE__, "Could not write attribute for name"); + + ostringstream oss; + oss << ev.d_val; + if (xmlTextWriterWriteAttribute(xml->get_writer(), (const xmlChar*) "value", (const xmlChar*)oss.str().c_str()) < 0) + throw InternalErr(__FILE__, __LINE__, "Could not write attribute for value"); + + if (xmlTextWriterEndElement(xml->get_writer()) < 0) + throw InternalErr(__FILE__, __LINE__, "Could not end EnumConst element"); + +} + +void D4EnumDef::print_xml_writer(XMLWriter &xml) +{ + if (xmlTextWriterStartElement(xml.get_writer(), (const xmlChar*)"Enumeration") < 0) + throw InternalErr(__FILE__, __LINE__, "Could not write Enumeration element"); + + if (xmlTextWriterWriteAttribute(xml.get_writer(), (const xmlChar*) "name", (const xmlChar*)d_name.c_str()) < 0) + throw InternalErr(__FILE__, __LINE__, "Could not write attribute for name"); + + if (xmlTextWriterWriteAttribute(xml.get_writer(), (const xmlChar*) "basetype", (const xmlChar*)type_name(d_type).c_str()) < 0) + throw InternalErr(__FILE__, __LINE__, "Could not write attribute for name"); + + for_each(d_values.begin(), d_values.end(), bind1st(ptr_fun(print_enum_const), &xml)); + + if (xmlTextWriterEndElement(xml.get_writer()) < 0) + throw InternalErr(__FILE__, __LINE__, "Could not end Enumeration element"); +} + +} /* namespace libdap */ diff -Nru libdap-3.11.1/D4EnumDef.h libdap-3.12.0/D4EnumDef.h --- libdap-3.11.1/D4EnumDef.h 1970-01-01 00:00:00.000000000 +0000 +++ libdap-3.12.0/D4EnumDef.h 2013-10-17 21:27:40.000000000 +0000 @@ -0,0 +1,85 @@ +/* + * D4EnumDef.h + * + * Created on: Oct 9, 2012 + * Author: jimg + */ + +#ifndef D4ENUMDEF_H_ +#define D4ENUMDEF_H_ + +#include +#include +#include +#include + +#include "BaseType.h" + +using namespace std; + +namespace libdap { + +class D4EnumDef { + string d_name; /// The name of the enum definition + Type d_type; /// Enums are always integer types + + struct enum_val { + string d_item; + // cast to unsigned based on d_type. + long long d_val; + + enum_val(const string &item, unsigned long val) : + d_item(item), d_val(val) + { + } + }; + + vector d_values; + typedef vector::iterator enumValIter; + +public: + D4EnumDef() {} + D4EnumDef(const string &name, Type type) : d_name(name), d_type(type) {} + + virtual ~D4EnumDef() {} + + string get_name() const { return d_name; } + void set_name(const string &name) { d_name = name; } + + Type get_type() const { return d_type; } + void set_type(Type t) { d_type = t; } + + void add_value(const string &item, unsigned long val) { + d_values.push_back(enum_val(item, val)); + } + + enumValIter begin_vals() { return d_values.begin(); } + enumValIter end_vals() { return d_values.end(); } + long long get_value(enumValIter i) { return i->d_val; } + string get_item(enumValIter i ) { return i->d_item; } + + static bool is_item(const enum_val e, const string item) { + return e.d_item == item; + } + + // Written to use for_each() as an exercise... Cannot use reference + // types in is_item(...) + long long get_value(const string &item) { + // lookup name and return d_val; + enumValIter i = find_if(d_values.begin(), d_values.end(), + bind2nd(ptr_fun(libdap::D4EnumDef::is_item), item)); + return i->d_val; + } + +private: +#if 0 + string type_name(); +#endif + static void print_enum_const(XMLWriter *xml, const enum_val ev); + +public: + void print_xml_writer(XMLWriter &xml); +}; + +} /* namespace libdap */ +#endif /* D4ENUMDEF_H_ */ diff -Nru libdap-3.11.1/D4Group.cc libdap-3.12.0/D4Group.cc --- libdap-3.11.1/D4Group.cc 1970-01-01 00:00:00.000000000 +0000 +++ libdap-3.12.0/D4Group.cc 2013-10-17 21:27:40.000000000 +0000 @@ -0,0 +1,130 @@ +/* + * D4Group.cc + * + * Created on: Sep 27, 2012 + * Author: jimg + */ + +#include "D4Group.h" + +#include "BaseType.h" + +namespace libdap { + +/** The D4Group constructor requires only the name of the variable + to be created. The name may be omitted, which will create a + nameless variable. This may be adequate for some applications. + + @param n A string containing the name of the variable. +*/ +D4Group::D4Group(const string &n) : Constructor(n, dods_group_c, /*is_dap4*/true) +{} + +/** The D4Group server-side constructor requires the name of the variable + to be created and the dataset name from which this variable is being + created. Used on server-side handlers. + + @param n A string containing the name of the variable. + @param d A string containing the name of the dataset. +*/ +D4Group::D4Group(const string &n, const string &d) + : Constructor(n, d, dods_group_c, /*is_dap4*/true) +{} + +/** The D4Group copy constructor. */ +D4Group::D4Group(const D4Group &rhs) : Constructor(rhs) +{ + m_duplicate(rhs); +} + +static void enum_del(D4EnumDef *ed) +{ + delete ed; +} + +D4Group::~D4Group() +{ + for_each(d_enums.begin(), d_enums.end(), enum_del); +} + +BaseType * +D4Group::ptr_duplicate() +{ + return new D4Group(*this); +} + +D4Group & +D4Group::operator=(const D4Group &rhs) +{ + if (this == &rhs) + return *this; + + dynamic_cast(*this) = rhs; // run Constructor= + + m_duplicate(rhs); + + return *this; +} + +void +D4Group::add_enumeration_nocopy(D4EnumDef *enum_def) +{ + d_enums.push_back(enum_def); +} + +class PrintVariable : public unary_function +{ + XMLWriter &d_xml; + bool d_constrained; +public: + PrintVariable(XMLWriter &x, bool c) : d_xml(x), d_constrained(c) {} + + void operator()(BaseType *btp) + { + btp->print_xml_writer(d_xml, d_constrained); + } +}; + +class PrintEnum : public unary_function +{ + XMLWriter &d_xml; + +public: + PrintEnum(XMLWriter &x) : d_xml(x){} + + void operator()(D4EnumDef *e) + { + e->print_xml_writer(d_xml); + } +}; + +void +D4Group::print_xml_writer(XMLWriter &xml, bool constrained) +{ + if (constrained && !send_p()) + return; + + if (xmlTextWriterStartElement(xml.get_writer(), (const xmlChar*)type_name().c_str()) < 0) + throw InternalErr(__FILE__, __LINE__, "Could not write " + type_name() + " element"); + + if (!name().empty()) + if (xmlTextWriterWriteAttribute(xml.get_writer(), (const xmlChar*) "name", (const xmlChar*)name().c_str()) < 0) + throw InternalErr(__FILE__, __LINE__, "Could not write attribute for name"); + + // If the Group has Enumeration definitions + if (d_enums.size() > 0) + for_each(d_enums.begin(), d_enums.end(), PrintEnum(xml)); + + // If it has attributes + if (get_attr_table().get_size() > 0) + get_attr_table().print_xml_writer(xml); + + // If it has variables + if (var_begin() != var_end()) + for_each(var_begin(), var_end(), PrintVariable(xml, constrained)); + + if (xmlTextWriterEndElement(xml.get_writer()) < 0) + throw InternalErr(__FILE__, __LINE__, "Could not end " + type_name() + " element"); +} + +} /* namespace libdap */ diff -Nru libdap-3.11.1/D4Group.h libdap-3.12.0/D4Group.h --- libdap-3.11.1/D4Group.h 1970-01-01 00:00:00.000000000 +0000 +++ libdap-3.12.0/D4Group.h 2013-10-17 21:27:40.000000000 +0000 @@ -0,0 +1,45 @@ +/* + * D4Group.h + * + * Created on: Sep 27, 2012 + * Author: jimg + */ + +#ifndef D4GROUP_H_ +#define D4GROUP_H_ + +#include "Constructor.h" +#include "D4Dimensions.h" +#include "D4EnumDef.h" + +namespace libdap { + +class D4Group :public Constructor { +private: + // I use the same object to define the dimensions (here) and to + // include them in the individual variables (in BaseType.h) + D4Dimensions d_dims; + + // The Group object is a container for both variables and enumeration + // definitions. + vector d_enums; + + // TODO Must define m_duplicate so that d_enums are copied. + // Must be a deep copy +public: + D4Group(const string &n); + D4Group(const string &n, const string &d); + + D4Group(const D4Group &rhs); + virtual ~D4Group(); + + D4Group &operator=(const D4Group &rhs); + virtual BaseType *ptr_duplicate(); + + void print_xml_writer(XMLWriter &xml, bool constrained); + + void add_enumeration_nocopy(D4EnumDef *enum_def); +}; + +} /* namespace libdap */ +#endif /* D4GROUP_H_ */ diff -Nru libdap-3.11.1/D4Maps.cc libdap-3.12.0/D4Maps.cc --- libdap-3.11.1/D4Maps.cc 1970-01-01 00:00:00.000000000 +0000 +++ libdap-3.12.0/D4Maps.cc 2013-10-17 21:27:40.000000000 +0000 @@ -0,0 +1,23 @@ +/* + * D4Maps.cc + * + * Created on: Sep 26, 2012 + * Author: jimg + */ + +#include "D4Maps.h" + +namespace libdap { + +D4Maps::D4Maps() +{ + // TODO Auto-generated constructor stub + +} + +D4Maps::~D4Maps() +{ + // TODO Auto-generated destructor stub +} + +} /* namespace libdap */ diff -Nru libdap-3.11.1/D4Maps.h libdap-3.12.0/D4Maps.h --- libdap-3.11.1/D4Maps.h 1970-01-01 00:00:00.000000000 +0000 +++ libdap-3.12.0/D4Maps.h 2013-10-17 21:27:40.000000000 +0000 @@ -0,0 +1,43 @@ +/* + * D4Maps.h + * + * Created on: Sep 26, 2012 + * Author: jimg + */ + +#ifndef D4MAPS_H_ +#define D4MAPS_H_ + +#include +#include + +using namespace std; + +namespace libdap { + +/** + * Maps in DAP4 are simply the names of Dimensions. When a dimensioned + * variable (i.e., an array) also has 'maps' that array is a 'grid' in the + * sense that the 'maps' define the domain of a sampled function. + * + * @todo Is this class needed? + */ +class D4Maps { +private: + vector d_names; + +public: + D4Maps(); + virtual ~D4Maps(); + + typedef vector::iterator D4MapsIter; + + void add_map(const string &map) { d_names.push_back(map); } + string get_map(int i) { return d_names.at(i); } + + D4MapsIter maps_begin() { return d_names.begin(); } + D4MapsIter maps_end() { return d_names.end(); } +}; + +} /* namespace libdap */ +#endif /* D4MAPS_H_ */ diff -Nru libdap-3.11.1/D4ParseError.h libdap-3.12.0/D4ParseError.h --- libdap-3.11.1/D4ParseError.h 1970-01-01 00:00:00.000000000 +0000 +++ libdap-3.12.0/D4ParseError.h 2013-10-17 21:27:40.000000000 +0000 @@ -0,0 +1,49 @@ + +// -*- mode: c++; c-basic-offset:4 -*- + +// This file is part of libdap, A C++ implementation of the OPeNDAP Data +// Access Protocol. + +// Copyright (c) 2012 OPeNDAP, Inc. +// Author: James Gallagher +// +// This library is free software; you can redistribute it and/or +// modify it under the terms of the GNU Lesser General Public +// License as published by the Free Software Foundation; either +// version 2.1 of the License, or (at your option) any later version. +// +// This library 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 +// Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, write to the Free Software +// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA +// +// You can contact OPeNDAP, Inc. at PO Box 112, Saunderstown, RI. 02874-0112. + +#ifndef d4_parse_error_h +#define d4_parse_error_h + +#ifndef _error_h +#include "Error.h" +#endif + +namespace libdap +{ + +/** Thrown when the DDX response cannot be parsed.. */ +class D4ParseError : public Error +{ +public: + D4ParseError() : Error("The DDX response document parse failed.") + {} + D4ParseError(const string &msg) : + Error(string("The DDX response document parse failed: ") + msg) + {} +}; + +} // namespace libdap + +#endif // d4_parse_error_h diff -Nru libdap-3.11.1/D4ParserSax2.cc libdap-3.12.0/D4ParserSax2.cc --- libdap-3.11.1/D4ParserSax2.cc 1970-01-01 00:00:00.000000000 +0000 +++ libdap-3.12.0/D4ParserSax2.cc 2013-10-17 21:27:40.000000000 +0000 @@ -0,0 +1,1197 @@ +// -*- mode: c++; c-basic-offset:4 -*- + +// This file is part of libdap, A C++ implementation of the OPeNDAP Data +// Access Protocol. + +// Copyright (c) 2012 OPeNDAP, Inc. +// Author: James Gallagher +// +// This library is free software; you can redistribute it and/or +// modify it under the terms of the GNU Lesser General Public +// License as published by the Free Software Foundation; either +// version 2.1 of the License, or (at your option) any later version. +// +// This library 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 +// Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, write to the Free Software +// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA +// +// You can contact OPeNDAP, Inc. at PO Box 112, Saunderstown, RI. 02874-0112. + +#include "config.h" + +#define DODS_DEBUG 1 +#define DODS_DEBUG2 1 + +#include +#include + +#include +#include + +#include "BaseType.h" +#include "Byte.h" +#include "Int8.h" +#include "Int16.h" +#include "UInt16.h" +#include "Int32.h" +#include "UInt32.h" +#include "Int64.h" +#include "UInt64.h" + +#include "Float32.h" +#include "Float64.h" + +#include "Str.h" +#include "Url.h" + +#include "Constructor.h" + +#include "D4Group.h" + +#include "Array.h" +#include "Structure.h" +#include "Sequence.h" +#include "Grid.h" + +#include "D4ParserSax2.h" + +#include "util.h" +// #include "mime_util.h" +#include "debug.h" + +namespace libdap { + +static const not_used char *states[] = { + "parser_start", + + // inside_group is the state just after parsing the start of a Group + // element. + "inside_group", + + "inside_attribute_container", + "inside_attribute", + "inside_attribute_value", + "inside_other_xml_attribute", + + "inside_enum_def", + "inside_enum_const", + + // This covers Byte, ..., Url, Opaque + "inside_simple_type", + + "inside_array", + "inside_dimension", + + "inside_grid", + "inside_map", + + "inside_structure", + "inside_sequence", + + "parser_unknown", + "parser_error" }; + +// Glue the BaseTypeFactory to the enum-based factory defined statically +// here. + +BaseType *D4ParserSax2::factory(Type t, const string & name) +{ + switch (t) { + case dods_byte_c: + return d_factory->NewByte(name); + case dods_uint8_c: + return d_factory->NewUInt8(name); + case dods_int8_c: + return d_factory->NewInt8(name); + case dods_int16_c: + return d_factory->NewInt16(name); + case dods_uint16_c: + return d_factory->NewUInt16(name); + case dods_int32_c: + return d_factory->NewInt32(name); + case dods_uint32_c: + return d_factory->NewUInt32(name); + case dods_int64_c: + return d_factory->NewInt64(name); + case dods_uint64_c: + return d_factory->NewUInt64(name); + case dods_float32_c: + return d_factory->NewFloat32(name); + case dods_float64_c: + return d_factory->NewFloat64(name); + case dods_str_c: + return d_factory->NewStr(name); + case dods_url_c: + return d_factory->NewUrl(name); + case dods_url4_c: + return d_factory->NewURL(name); + case dods_array_c: + return d_factory->NewArray(name); + case dods_structure_c: + return d_factory->NewStructure(name); + case dods_sequence_c: + return d_factory->NewSequence(name); + case dods_grid_c: + return d_factory->NewGrid(name); + case dods_group_c: + return d_factory->NewGroup(name); + default: + return 0; + } +} + +static bool is_valid_enum_value(const Type &t, long long value) +{ + switch (t) { + case dods_int8_c: + return (value >= DODS_SCHAR_MIN && value <= DODS_SCHAR_MAX); + case dods_byte_c: + case dods_uint8_c: + return (value >= 0 && static_cast(value) <= DODS_UCHAR_MAX); + case dods_int16_c: + return (value >= DODS_SHRT_MIN && value <= DODS_SHRT_MAX); + case dods_uint16_c: + return (value >= 0 && static_cast(value) <= DODS_USHRT_MAX); + case dods_int32_c: + return (value >= DODS_INT_MIN && value <= DODS_INT_MAX); + case dods_uint32_c: + return (value >= 0 && static_cast(value) <= DODS_UINT_MAX); + case dods_int64_c: + return (value >= DODS_LLONG_MIN && value <= DODS_LLONG_MAX); + case dods_uint64_c: + return (value >= 0 && static_cast(value) <= DODS_ULLONG_MAX); + default: + return false; + } +} + +static bool is_not(const char *name, const char *tag) +{ + return strcmp(name, tag) != 0; +} + +void D4ParserSax2::set_state(D4ParserSax2::ParseState state) +{ + s.push(state); +} + +D4ParserSax2::ParseState D4ParserSax2::get_state() const +{ + return s.top(); +} + +void D4ParserSax2::pop_state() +{ + s.pop(); +} + +/** Dump XML attributes to local store so they can be easily manipulated. + Attribute names are always folded to lower case. + @param attributes The XML attribute array + @param nb_attributes Teh number of attributes */ +void D4ParserSax2::transfer_xml_attrs(const xmlChar **attributes, int nb_attributes) +{ + if (!xml_attrs.empty()) + xml_attrs.clear(); // erase old attributes + + unsigned int index = 0; + for (int i = 0; i < nb_attributes; ++i, index += 5) { + // Make a value using the attribute name and the prefix, namespace URI + // and the value. The prefix might be null. + xml_attrs.insert(map::value_type(string((const char *) attributes[index]), + XMLAttribute(attributes + index + 1))); + + DBG(cerr << "Attribute '" << (const char *)attributes[index] << "': " + << xml_attrs[(const char *)attributes[index]].value << endl); + } +} + +void D4ParserSax2::transfer_xml_ns(const xmlChar **namespaces, int nb_namespaces) +{ + for (int i = 0; i < nb_namespaces; ++i) { + // make a value with the prefix and namespace URI. The prefix might be + // null. + namespace_table.insert( + map::value_type(namespaces[i * 2] != 0 ? (const char *) namespaces[i * 2] : "", + (const char *) namespaces[i * 2 + 1])); + } +} + +/** Is an attribute present? Attribute names are always lower case. + @note To use this method, first call transfer_xml_attrs. + @param attr The XML attribute + @return True if the XML attribute was present in the last tag */ +bool D4ParserSax2::check_required_attribute(const string & attr) +{ + map::iterator i = xml_attrs.find(attr); + if (i == xml_attrs.end()) + ddx_fatal_error(this, "Required attribute '%s' not found.", attr.c_str()); + return true; +} + +/** Is an attribute present? Attribute names are always lower case. + @note To use this method, first call transfer_xml_attrs. + @param attr The XML attribute + @return True if the XML attribute was present in the last/current tag, + false otherwise. */ +bool D4ParserSax2::check_attribute(const string & attr) +{ + return (xml_attrs.find(attr) != xml_attrs.end()); +} + +/** Given that an \c Attribute tag has just been read, determine whether the + element is a container or a simple type, set the state and, for a simple + type record the type and name for use when \c value elements are found. + + @note Modified to discriminate between OtherXML and the older DAP2.0 + attribute types (container, Byte, ...). + + @param attrs The array of XML attribute values */ +void D4ParserSax2::process_attribute_helper(const xmlChar **attrs, int nb_attributes) +{ + // These methods set the state to parser_error if a problem is found. + transfer_xml_attrs(attrs, nb_attributes); + + bool error = !(check_required_attribute(string("name")) && check_required_attribute(string("type"))); + if (error) + return; + + if (xml_attrs["type"].value == "Container") { + set_state(inside_attribute_container); + + AttrTable *child; + AttrTable *parent = at_stack.top(); + + child = parent->append_container(xml_attrs["name"].value); + at_stack.push(child); // save. + DBG2(cerr << "Pushing at" << endl); + } + else if (xml_attrs["type"].value == "OtherXML") { + set_state(inside_other_xml_attribute); + + dods_attr_name = xml_attrs["name"].value; + dods_attr_type = xml_attrs["type"].value; + } + else { + set_state(inside_attribute); + + dods_attr_name = xml_attrs["name"].value; + dods_attr_type = xml_attrs["type"].value; + } +} + +/** Given that an \c Enumeration tag has just been read... + + + @param attrs The array of XML attribute values */ +void D4ParserSax2::process_enum_def_helper(const xmlChar **attrs, int nb_attributes) +{ + // These methods set the state to parser_error if a problem is found. + transfer_xml_attrs(attrs, nb_attributes); + + bool error = !(check_required_attribute(string("name")) + && check_required_attribute(string("basetype"))); + if (error) + return; + + Type t = get_type(xml_attrs["basetype"].value.c_str()); + if (!is_integer_type(t)) { + ddx_fatal_error(this, "Error: The Enumeration '%s' must have an integer type, instead the type '%s' was used.", + xml_attrs["name"].value.c_str(), xml_attrs["basetype"].value.c_str()); + // So that the parse can continue, make the type UInt64 + t = dods_uint64_c; + } + + d_enum_def = new D4EnumDef(xml_attrs["name"].value, t); + + set_state(inside_enum_def); +} + +/** Given that an \c Enumeration tag has just been read... + + + @param attrs The array of XML attribute values */ +void D4ParserSax2::process_enum_const_helper(const xmlChar **attrs, int nb_attributes) +{ + // These methods set the state to parser_error if a problem is found. + transfer_xml_attrs(attrs, nb_attributes); + + bool error = !(check_required_attribute(string("name")) + && check_required_attribute(string("value"))); + if (error) + return; + + istringstream iss(xml_attrs["value"].value); + long long value = 0; + iss >> skipws >> value; + if (iss.fail() || iss.bad()) { + ddx_fatal_error(this, "Error: Expected an integer value for an Enumeration constant, got '%s' instead.", + xml_attrs["value"].value.c_str()); + } + else if (!is_valid_enum_value(d_enum_def->get_type(), value)) + ddx_fatal_error(this, "Error: In an Enumeration constant, the value '%s' cannot fit in a variable of type '%s'.", + xml_attrs["value"].value.c_str(), type_name(d_enum_def->get_type()).c_str()); + + else { + d_enum_def->add_value(xml_attrs["name"].value, value); + } + + set_state(inside_enum_const); +} + +/** Given that a \c dimension tag has just been read, add that information to + the array on the top of the BaseType stack. + @param attrs The XML attributes included in the \c dimension tag */ +void D4ParserSax2::process_dimension(const xmlChar **attrs, int nb_attributes) +{ + transfer_xml_attrs(attrs, nb_attributes); + if (check_required_attribute(string("size"))) { + set_state(inside_dimension); + Array *ap = dynamic_cast(bt_stack.top()); + if (!ap) { + ddx_fatal_error(this, "Parse error: Expected an array variable."); + return; + } + + ap->append_dim(atoi(xml_attrs["size"].value.c_str()), xml_attrs["name"].value); + } +} + +/** Check to see if the current tag is either an \c Attribute or an \c Alias + start tag. This method is a glorified macro... + + @param name The start tag name + @param attrs The tag's XML attributes + @return True if the tag was an \c Attribute or \c Alias tag */ +inline bool D4ParserSax2::process_attribute(const char *name, const xmlChar **attrs, int nb_attributes) +{ + if (strcmp(name, "Attribute") == 0) { + process_attribute_helper(attrs, nb_attributes); + // next state: inside_attribtue or inside_attribute_container + return true; + } + + return false; +} + +/** Check to see if the current tag is an \c Enumeration start tag. + + @param name The start tag name + @param attrs The tag's XML attributes + @return True if the tag was an \c Enumeration */ +inline bool D4ParserSax2::process_enum_def(const char *name, const xmlChar **attrs, int nb_attributes) +{ + if (strcmp(name, "Enumeration") == 0) { + process_enum_def_helper(attrs, nb_attributes); + // next state: inside_enum_def + return true; + } + + return false; +} + +inline bool D4ParserSax2::process_enum_const(const char *name, const xmlChar **attrs, int nb_attributes) +{ + if (strcmp(name, "EnumConst") == 0) { + process_enum_const_helper(attrs, nb_attributes); + // next state: inside_enum_const + return true; + } + + return false; +} + +/** Check to see if the current element is the start of a variable declaration. + If so, process it. A glorified macro... + @param name The start element name + @param attrs The element's XML attributes + @return True if the element was a variable */ +inline bool D4ParserSax2::process_variable(const char *name, const xmlChar **attrs, int nb_attributes) +{ + Type t = get_type(name); + if (is_simple_type(t)) { + process_variable_helper(t, inside_simple_type, attrs, nb_attributes); + return true; + } + else if (strcmp(name, "Structure") == 0) { + process_variable_helper(dods_structure_c, inside_structure, attrs, nb_attributes); + return true; + } + else if (strcmp(name, "Sequence") == 0) { + process_variable_helper(dods_sequence_c, inside_sequence, attrs, nb_attributes); + return true; + } + + return false; +} + +/** Given that a tag which opens a variable declaration has just been read, + create the variable. Once created, push the variable onto the stack of + variables, push that variable's attribute table onto the attribute table + stack and update the state of the parser. + @param t The type of variable to create. + @param s The next state of the parser (e.g., inside_simple_type, ...) + @param attrs the attributes read with the tag */ +void D4ParserSax2::process_variable_helper(Type t, ParseState s, const xmlChar **attrs, int nb_attributes) +{ + transfer_xml_attrs(attrs, nb_attributes); + + set_state(s); + + // TODO Arrays in DAP2 were not required to have names. DAP4 is going to + // need a different parsing logic, but we'll come to that... + if (check_required_attribute("name")) { // throws on error/false + BaseType *btp = factory(t, xml_attrs["name"].value); + if (!btp) + ddx_fatal_error(this, "Internal parser error; could not instantiate the variable '%s'.", + xml_attrs["name"].value.c_str()); + + // Once we make the new variable, we not only load it on to the + // BaseType stack, we also load its AttrTable on the AttrTable stack. + // The attribute processing software always operates on the AttrTable + // at the top of the AttrTable stack (at_stack). + bt_stack.push(btp); + at_stack.push(&btp->get_attr_table()); + } +} + +void D4ParserSax2::finish_variable(const char *tag, Type t, const char *expected) +{ + if (strcmp(tag, expected) != 0) { + D4ParserSax2::ddx_fatal_error(this, "Expected an end tag for a %s; found '%s' instead.", expected, tag); + return; + } + + pop_state(); + + BaseType *btp = bt_stack.top(); + + bt_stack.pop(); + at_stack.pop(); + + if (btp->type() != t) { + D4ParserSax2::ddx_fatal_error(this, "Internal error: Expected a %s variable.", expected); + return; + } + // Once libxml2 validates, this can go away. 05/30/03 jhrg + if (t == dods_array_c && dynamic_cast(btp)->dimensions() == 0) { + D4ParserSax2::ddx_fatal_error(this, "No dimension element included in the Array '%s'.", btp->name().c_str()); + return; + } + + BaseType *parent = bt_stack.top(); + + if (!(parent->is_vector_type() || parent->is_constructor_type())) { + D4ParserSax2::ddx_fatal_error(this, "Tried to add the array variable '%s' to a non-constructor type (%s %s).", + tag, bt_stack.top()->type_name().c_str(), bt_stack.top()->name().c_str()); + return; + } + + parent->add_var(btp); +} + +/** @name SAX Parser Callbacks + + These methods are declared static in the class header. This gives them C + linkage which allows them to be used as callbacks by the SAX parser + engine. */ +//@{ +/** Initialize the SAX parser state object. This object is passed to each + callback as a void pointer. The initial state is parser_start. + + @param p The SAX parser */ +void D4ParserSax2::ddx_start_document(void * p) +{ + D4ParserSax2 *parser = static_cast(p); + parser->error_msg = ""; + parser->char_data = ""; + + parser->set_state(parser_start); + + DBG2(cerr << "Parser state: " << states[parser->get_state()] << endl); +} + +/** Clean up after finishing a parse. + @param p The SAX parser */ +void D4ParserSax2::ddx_end_document(void * p) +{ + D4ParserSax2 *parser = static_cast(p); + + DBG2(cerr << "Ending state == " << states[parser->get_state()] << endl); + + if (parser->get_state() != parser_start) + D4ParserSax2::ddx_fatal_error(parser, "The document contained unbalanced tags."); + + // If we've found any sort of error, don't make the DMR; intern() will + // take care of the error. + if (parser->get_state() == parser_error) + return; + + // TODO Decide to remove the outer Group or leave it in place and + // modify print_xml_writer() so that the DMR is correct. + + parser->dds->add_var_nocopy(parser->bt_stack.top()); + parser->bt_stack.pop(); +} + +void D4ParserSax2::ddx_start_element(void *p, const xmlChar *l, const xmlChar *prefix, const xmlChar *URI, + int nb_namespaces, const xmlChar **namespaces, int nb_attributes, int /*nb_defaulted*/, + const xmlChar **attributes) +{ + D4ParserSax2 *parser = static_cast(p); + const char *localname = (const char *) l; + + DBG2(cerr << "start element: " << localname << ", state: " << states[parser->get_state()] << endl); + + switch (parser->get_state()) { + case parser_start: + if (strcmp(localname, "Group") == 0) { + + parser->set_state(inside_group); + + parser->root_ns = URI ? (const char *) URI : ""; + parser->transfer_xml_attrs(attributes, nb_attributes); + + // Set values in/for the DDS + if (parser->check_required_attribute(string("name"))) + parser->dds->set_dataset_name(parser->xml_attrs["name"].value); + + if (parser->check_attribute("dapVersion")) + parser->dds->set_dap_version(parser->xml_attrs["dapVersion"].value); + + // FIXME no way to record DMR version information +#if 0 + if (parser->check_attribute("dmrVersion")) + parser->dds->set_dap_version(parser->xml_attrs["dmrVersion"].value); +#endif + if (parser->check_attribute("base")) + parser->dds->set_request_xml_base(parser->xml_attrs["base"].value); + + if (!parser->root_ns.empty()) + parser->dds->set_namespace(parser->root_ns); + + // Set name of the Group; push on stack + BaseType *btp = parser->factory(dods_group_c, "root"); + parser->bt_stack.push(btp); + parser->at_stack.push(&btp->get_attr_table()); + } + else + D4ParserSax2::ddx_fatal_error(parser, + "Expected DMR to start with a Group element; found '%s' instead.", localname); + break; + + // The state 'inside_group' means we have just parsed the start + // of a Group element, but none of the child elements + case inside_group: + // TODO Add Dimension and Group + if (parser->process_attribute(localname, attributes, nb_attributes)) + break; + else if (parser->process_variable(localname, attributes, nb_attributes)) + break; + else if (parser->process_enum_def(localname, attributes, nb_attributes)) + break; + else + D4ParserSax2::ddx_fatal_error(parser, + "Expected an Attribute, or variable element; found '%s' instead.", localname); + break; + + case inside_attribute_container: + if (parser->process_attribute(localname, attributes, nb_attributes)) + break; + else + D4ParserSax2::ddx_fatal_error(parser, "Expected an Attribute or Alias element; found '%s' instead.", + localname); + break; + + case inside_attribute: + if (parser->process_attribute(localname, attributes, nb_attributes)) + break; + else if (strcmp(localname, "value") == 0) + parser->set_state(inside_attribute_value); + else + ddx_fatal_error(parser, "Expected an 'Attribute', 'Alias' or 'value' element; found '%s' instead.", + localname); + break; + + case inside_attribute_value: + // FIXME + break; + + case inside_other_xml_attribute: + DBGN(cerr << endl << "\t inside_other_xml_attribute: " << localname << endl); + + parser->other_xml_depth++; + + // Accumulate the elements here + + parser->other_xml.append("<"); + if (prefix) { + parser->other_xml.append((const char *) prefix); + parser->other_xml.append(":"); + } + parser->other_xml.append(localname); + + if (nb_namespaces != 0) { + parser->transfer_xml_ns(namespaces, nb_namespaces); + + for (map::iterator i = parser->namespace_table.begin(); + i != parser->namespace_table.end(); ++i) { + parser->other_xml.append(" xmlns"); + if (!i->first.empty()) { + parser->other_xml.append(":"); + parser->other_xml.append(i->first); + } + parser->other_xml.append("=\""); + parser->other_xml.append(i->second); + parser->other_xml.append("\""); + } + } + + if (nb_attributes != 0) { + parser->transfer_xml_attrs(attributes, nb_attributes); + for (XMLAttrMap::iterator i = parser->xml_attr_begin(); i != parser->xml_attr_end(); ++i) { + parser->other_xml.append(" "); + if (!i->second.prefix.empty()) { + parser->other_xml.append(i->second.prefix); + parser->other_xml.append(":"); + } + parser->other_xml.append(i->first); + parser->other_xml.append("=\""); + parser->other_xml.append(i->second.value); + parser->other_xml.append("\""); + } + } + + parser->other_xml.append(">"); + break; + + case inside_enum_def: + // process an EnumConst element + if (parser->process_enum_const(localname, attributes, nb_attributes)) + break; + else + ddx_fatal_error(parser, "Expected an 'EnumConst' element; found '%s' instead.", localname); + break; + + case inside_enum_const: + // Nothing to do; this element has no content + break; + + case inside_simple_type: + if (parser->process_attribute(localname, attributes, nb_attributes)) + break; + else + ddx_fatal_error(parser, "Expected an 'Attribute' or 'Alias' element; found '%s' instead.", localname); + break; + + case inside_array: + if (parser->process_attribute(localname, attributes, nb_attributes)) + break; + else if (is_not(localname, "Array") && parser->process_variable(localname, attributes, nb_attributes)) + break; + else if (strcmp(localname, "dimension") == 0) { + parser->process_dimension(attributes, nb_attributes); + // next state: inside_dimension + } + else + ddx_fatal_error(parser, "Expected an 'Attribute' or 'Alias' element; found '%s' instead.", localname); + break; + + case inside_dimension: + ddx_fatal_error(parser, + "Internal parser error; unexpected state, inside dimension while processing element '%s'.", + localname); + break; + + case inside_structure: + if (parser->process_attribute(localname, attributes, nb_attributes)) + break; + else if (parser->process_variable(localname, attributes, nb_attributes)) + break; + else + D4ParserSax2::ddx_fatal_error(parser, + "Expected an Attribute, Alias or variable element; found '%s' instead.", localname); + break; + + case inside_sequence: + if (parser->process_attribute(localname, attributes, nb_attributes)) + break; + else if (parser->process_variable(localname, attributes, nb_attributes)) + break; + else + D4ParserSax2::ddx_fatal_error(parser, + "Expected an Attribute, Alias or variable element; found '%s' instead.", localname); + break; + + case inside_grid: + if (parser->process_attribute(localname, attributes, nb_attributes)) + break; + else if (strcmp(localname, "Array") == 0) + parser->process_variable_helper(dods_array_c, inside_array, attributes, nb_attributes); + else if (strcmp(localname, "Map") == 0) + parser->process_variable_helper(dods_array_c, inside_map, attributes, nb_attributes); + else + D4ParserSax2::ddx_fatal_error(parser, + "Expected an Attribute, Alias or variable element; found '%s' instead.", localname); + break; + + case inside_map: + if (parser->process_attribute(localname, attributes, nb_attributes)) + break; + else if (is_not(localname, "Array") && is_not(localname, "Sequence") && is_not(localname, "Grid") + && parser->process_variable(localname, attributes, nb_attributes)) + break; + else if (strcmp(localname, "dimension") == 0) { + parser->process_dimension(attributes, nb_attributes); + // next state: inside_dimension + } + else + ddx_fatal_error(parser, + "Expected an 'Attribute', 'Alias', variable or 'dimension' element; found '%s' instead.", + localname); + break; + + case parser_unknown: + // *** Never used? If so remove/error + parser->set_state(parser_unknown); + break; + + case parser_error: + break; + } + + DBGN(cerr << " ... " << states[parser->get_state()] << endl); +} + +void D4ParserSax2::ddx_end_element(void *p, const xmlChar *l, const xmlChar *prefix, const xmlChar *URI) +{ + D4ParserSax2 *parser = static_cast(p); + const char *localname = (const char *) l; + + DBG2(cerr << "End element " << localname << " (state " + << states[parser->get_state()] << ")" << endl); + + switch (parser->get_state()) { + case parser_start: + ddx_fatal_error(parser, + "Internal parser error; unexpected state, inside start state while processing element '%s'.", + localname); + break; + + case inside_group: + if (strcmp(localname, "Group") == 0) + parser->pop_state(); + else + D4ParserSax2::ddx_fatal_error(parser, "Expected an end Group tag; found '%s' instead.", localname); + break; + + case inside_attribute_container: + if (strcmp(localname, "Attribute") == 0) { + parser->pop_state(); + parser->at_stack.pop(); // pop when leaving a container. + } + else + D4ParserSax2::ddx_fatal_error(parser, "Expected an end Attribute tag; found '%s' instead.", localname); + break; + + case inside_attribute: + if (strcmp(localname, "Attribute") == 0) + parser->pop_state(); + else + D4ParserSax2::ddx_fatal_error(parser, "Expected an end Attribute tag; found '%s' instead.", localname); + break; + + case inside_attribute_value: + if (strcmp(localname, "value") == 0) { + parser->pop_state(); + AttrTable *atp = parser->at_stack.top(); + atp->append_attr(parser->dods_attr_name, parser->dods_attr_type, parser->char_data); + parser->char_data = ""; // Null this after use. + } + else + D4ParserSax2::ddx_fatal_error(parser, "Expected an end value tag; found '%s' instead.", localname); + + break; + + case inside_other_xml_attribute: { + if (strcmp(localname, "Attribute") == 0 && parser->root_ns == (const char *) URI) { + + DBGN(cerr << endl << "\t Popping the 'inside_other_xml_attribute' state" + << endl); + + parser->pop_state(); + + AttrTable *atp = parser->at_stack.top(); + atp->append_attr(parser->dods_attr_name, parser->dods_attr_type, parser->other_xml); + + parser->other_xml = ""; // Null this after use. + } + else { + DBGN(cerr << endl << "\t inside_other_xml_attribute: " << localname + << ", depth: " << parser->other_xml_depth << endl); + if (parser->other_xml_depth == 0) + D4ParserSax2::ddx_fatal_error(parser, + "Expected an OtherXML attribute to end! Instead I found '%s'", localname); + parser->other_xml_depth--; + + parser->other_xml.append("other_xml.append((const char *) prefix); + parser->other_xml.append(":"); + } + parser->other_xml.append(localname); + parser->other_xml.append(">"); + } + break; + } + + case inside_enum_def: + if (strcmp(localname, "Enumeration") == 0) { + BaseType *btp = parser->bt_stack.top(); + if (!btp || btp->type() != dods_group_c) + D4ParserSax2::ddx_fatal_error(parser, "Expected a Group to be the current item, while finishing up an %s.", localname); + else { + D4Group *g = static_cast(btp); + g->add_enumeration_nocopy(parser->d_enum_def); + parser->pop_state(); + } + } + else { + D4ParserSax2::ddx_fatal_error(parser, "Expected an end Enumeration tag; found '%s' instead.", localname); + } + break; + + case inside_enum_const: + if (strcmp(localname, "EnumConst") == 0) + parser->pop_state(); + else + D4ParserSax2::ddx_fatal_error(parser, "Expected an end EnumConst tag; found '%s' instead.", localname); + break; + + case inside_simple_type: + if (is_simple_type(get_type(localname))) { + parser->pop_state(); + BaseType *btp = parser->bt_stack.top(); + parser->bt_stack.pop(); + parser->at_stack.pop(); + + BaseType *parent = parser->bt_stack.top(); + + // NB: This works because we seed the stack with a dummy + // structure instance at the start of the parse. When the + // parse is complete the variables in that structure will + // be transferred to the DDS. Or maybe someday we will really + // use a Structure instance in DDS... + if (parent->is_vector_type() || parent->is_constructor_type()) + parent->add_var(btp); + else + D4ParserSax2::ddx_fatal_error(parser, + "Tried to add the simple-type variable '%s' to a non-constructor type (%s %s).", localname, + parser->bt_stack.top()->type_name().c_str(), parser->bt_stack.top()->name().c_str()); + } + else + D4ParserSax2::ddx_fatal_error(parser, "Expected an end tag for a simple type; found '%s' instead.", + localname); + break; + + case inside_array: + parser->finish_variable(localname, dods_array_c, "Array"); + break; + + case inside_dimension: + if (strcmp(localname, "dimension") == 0) + parser->pop_state(); + else + D4ParserSax2::ddx_fatal_error(parser, "Expected an end dimension tag; found '%s' instead.", localname); + break; + + case inside_structure: + parser->finish_variable(localname, dods_structure_c, "Structure"); + break; + + case inside_sequence: + parser->finish_variable(localname, dods_sequence_c, "Sequence"); + break; + + case inside_grid: + parser->finish_variable(localname, dods_grid_c, "Grid"); + break; + + case inside_map: + parser->finish_variable(localname, dods_array_c, "Map"); + break; + + case parser_unknown: + parser->pop_state(); + break; + + case parser_error: + break; + } + + DBGN(cerr << " ... " << states[parser->get_state()] << endl); +} + +/** Process/accumulate character data. This may be called more than once for + one logical clump of data. Only save character data when processing + 'value' elements; throw away all other characters. */ +void D4ParserSax2::ddx_get_characters(void * p, const xmlChar * ch, int len) +{ + D4ParserSax2 *parser = static_cast(p); + + switch (parser->get_state()) { + case inside_attribute_value: + parser->char_data.append((const char *) (ch), len); + DBG2(cerr << "Characters: '" << parser->char_data << "'" << endl); + break; + + case inside_other_xml_attribute: + parser->other_xml.append((const char *) (ch), len); + DBG2(cerr << "Other XML Characters: '" << parser->other_xml << "'" << endl); + break; + + default: + break; + } +} + +/** Read whitespace that's not really important for content. This is used + only for the OtherXML attribute type to preserve formating of the XML. + Doing so makes the attribute value far easier to read. + */ +void D4ParserSax2::ddx_ignoreable_whitespace(void *p, const xmlChar *ch, int len) +{ + D4ParserSax2 *parser = static_cast(p); + + switch (parser->get_state()) { + case inside_other_xml_attribute: + parser->other_xml.append((const char *) (ch), len); + break; + + default: + break; + } +} + +/** Get characters in a cdata block. DAP does not use CData, but XML in an + OtherXML attribute (the value of that DAP attribute) might use it. This + callback also allows CData when the parser is in the 'parser_unknown' + state since some future DAP element might use it. + */ +void D4ParserSax2::ddx_get_cdata(void *p, const xmlChar *value, int len) +{ + D4ParserSax2 *parser = static_cast(p); + + switch (parser->get_state()) { + case inside_other_xml_attribute: + parser->other_xml.append((const char *) (value), len); + break; + + case parser_unknown: + break; + + default: + D4ParserSax2::ddx_fatal_error(parser, "Found a CData block but none are allowed by DAP."); + + break; + } +} + +/** Handle the standard XML entities. + + @param parser The SAX parser + @param name The XML entity. */ +xmlEntityPtr D4ParserSax2::ddx_get_entity(void *, const xmlChar * name) +{ + return xmlGetPredefinedEntity(name); +} + +/** Process an XML fatal error. Note that SAX provides for warnings, errors + and fatal errors. This code treats them all as fatal errors since there's + typically no way to tell a user about the error since there's often no + user interface for this software. + + @note This static function does not throw an exception or otherwise + alter flow of control except for altering the parser state. + + @param p The SAX parser + @param msg A printf-style format string. */ +void D4ParserSax2::ddx_fatal_error(void * p, const char *msg, ...) +{ + va_list args; + D4ParserSax2 *parser = static_cast(p); + + parser->set_state(parser_error); + + va_start(args, msg); + char str[1024]; + vsnprintf(str, 1024, msg, args); + va_end(args); + + int line = xmlSAX2GetLineNumber(parser->ctxt); + + parser->error_msg += "At line " + long_to_string(line) + ": "; + parser->error_msg += string(str) + string("\n"); +} + +//@} + +void D4ParserSax2::cleanup_parse(xmlParserCtxtPtr & context) const +{ + if (!context->wellFormed) { + context->sax = NULL; + xmlFreeParserCtxt(context); + throw D4ParseError(string("\nThe DDX is not a well formed XML document.\n") + error_msg); + } + + if (!context->valid) { + context->sax = NULL; + xmlFreeParserCtxt(context); + throw D4ParseError(string("\nThe DDX is not a valid document.\n") + error_msg); + } + + if (get_state() == parser_error) { + context->sax = NULL; + xmlFreeParserCtxt(context); + throw D4ParseError(string("\nError parsing DMR response.\n") + error_msg); + } + + context->sax = NULL; + xmlFreeParserCtxt(context); +} + +/** + * @brief Read the DDX from a stream instead of a file. + * + * This method reads and parses the DDX from a stream. When/if it encounters + * the element is records the value of the CID attribute and returns + * it using the cid value-result parameter. When the boundary marker is + * found, the parser will read that and return (if it is found before the + * DDX is completely parsed). + * + * @param f The input stream + * @param dest_dds Value-result parameter. Pass a DDS in and the inforamtion + * in the DDX will be added to it. + * @param cid Value-result parameter. When/if read, the value of the + * element's @cid attribute will be returned here. + * @param boundary Value of the M-MIME boundary separator; default is "" + * @see DDXParserDAP4::intern(). */ +void D4ParserSax2::intern(istream &f, DDS *dest_dds) +{ + // Code example from libxml2 docs re: read from a stream. + + if (!f.good()) + throw InternalErr(__FILE__, __LINE__, "Input stream not open or read error"); + + const int size = 1024; + char chars[size]; + + f.getline(chars, size); + int res = f.gcount(); + if (res > 0) { + + DBG(cerr << "line: (" << res << "): " << chars << endl); + xmlParserCtxtPtr context = xmlCreatePushParserCtxt(NULL, NULL, chars, res - 1, "stream"); + + ctxt = context; // need ctxt for error messages + dds = dest_dds; // dump values here + d_factory = dynamic_cast(dds->get_factory()); + if (!d_factory) + throw InternalErr(__FILE__, __LINE__, "Invalid factory class"); + + xmlSAXHandler ddx_sax_parser; + memset(&ddx_sax_parser, 0, sizeof(xmlSAXHandler)); + + ddx_sax_parser.getEntity = &D4ParserSax2::ddx_get_entity; + ddx_sax_parser.startDocument = &D4ParserSax2::ddx_start_document; + ddx_sax_parser.endDocument = &D4ParserSax2::ddx_end_document; + ddx_sax_parser.characters = &D4ParserSax2::ddx_get_characters; + ddx_sax_parser.ignorableWhitespace = &D4ParserSax2::ddx_ignoreable_whitespace; + ddx_sax_parser.cdataBlock = &D4ParserSax2::ddx_get_cdata; + ddx_sax_parser.warning = &D4ParserSax2::ddx_fatal_error; + ddx_sax_parser.error = &D4ParserSax2::ddx_fatal_error; + ddx_sax_parser.fatalError = &D4ParserSax2::ddx_fatal_error; + ddx_sax_parser.initialized = XML_SAX2_MAGIC; + ddx_sax_parser.startElementNs = &D4ParserSax2::ddx_start_element; + ddx_sax_parser.endElementNs = &D4ParserSax2::ddx_end_element; + + context->sax = &ddx_sax_parser; + context->userData = this; + context->validate = true; + + f.getline(chars, size); + while ((f.gcount() > 0)) { + DBG(cerr << "line: (" << f.gcount() << "): " << chars << endl); + xmlParseChunk(ctxt, chars, f.gcount() - 1, 0); + f.getline(chars, size); + } + // This call ends the parse: The fourth argument of xmlParseChunk is + // the bool 'terminate.' + xmlParseChunk(ctxt, chars, 0, 1); + + cleanup_parse(context); + } +} + +/** Parse a DDX document stored in a file. The XML in the document is parsed + and a binary DDX is built. This implementation stores the result in a DDS + object where each instance of BaseType can hold an AttrTable object. + + @param document Read the DDX from this file. + @param dest_dds Value/result parameter; dumps the information to this DDS + instance. + @param cid Value/result parameter; puts the href which references the \c + CID. + @exception D4ParseError Thrown if the XML document could not be + read or parsed. */ +void D4ParserSax2::intern(const string &document, DDS *dest_dds) +{ + istringstream iss(document); + intern(iss, dest_dds); +#if 0 + // Create the context pointer explicitly so that we can store a pointer + // to it in the DDXParserDAP4 instance. This provides a way to generate our + // own error messages *with* line numbers. The messages are pretty + // meaningless otherwise. This means that we use an interface from the + // 'parser internals' header, and not the 'parser' header. However, this + // interface is also used in one of the documented examples, so it's + // probably pretty stable. 06/02/03 jhrg + xmlParserCtxtPtr context = xmlCreateFileParserCtxt(document.c_str()); + if (!context) + throw D4ParseError(string("Could not initialize the parser with the file: '") + document + string("'.")); + + dds = dest_dds; // dump values here + ctxt = context; // need ctxt for error messages + + xmlSAXHandler ddx_sax_parser; + memset(&ddx_sax_parser, 0, sizeof(xmlSAXHandler)); + + ddx_sax_parser.getEntity = &D4ParserSax2::ddx_get_entity; + ddx_sax_parser.startDocument = &D4ParserSax2::ddx_start_document; + ddx_sax_parser.endDocument = &D4ParserSax2::ddx_end_document; + ddx_sax_parser.characters = &D4ParserSax2::ddx_get_characters; + ddx_sax_parser.ignorableWhitespace = &D4ParserSax2::ddx_ignoreable_whitespace; + ddx_sax_parser.cdataBlock = &D4ParserSax2::ddx_get_cdata; + ddx_sax_parser.warning = &D4ParserSax2::ddx_fatal_error; + ddx_sax_parser.error = &D4ParserSax2::ddx_fatal_error; + ddx_sax_parser.fatalError = &D4ParserSax2::ddx_fatal_error; + ddx_sax_parser.initialized = XML_SAX2_MAGIC; + ddx_sax_parser.startElementNs = &D4ParserSax2::ddx_start_element; + ddx_sax_parser.endElementNs = &D4ParserSax2::ddx_end_element; + + context->sax = &ddx_sax_parser; + context->userData = this; + context->validate = false; + + xmlParseDocument(context); + + cleanup_parse(context); +#endif +} + +} // namespace libdap diff -Nru libdap-3.11.1/D4ParserSax2.h libdap-3.12.0/D4ParserSax2.h --- libdap-3.11.1/D4ParserSax2.h 1970-01-01 00:00:00.000000000 +0000 +++ libdap-3.12.0/D4ParserSax2.h 2013-10-17 21:27:40.000000000 +0000 @@ -0,0 +1,261 @@ + +// -*- mode: c++; c-basic-offset:4 -*- + +// This file is part of libdap, A C++ implementation of the OPeNDAP Data +// Access Protocol. + +// Copyright (c) 2012 OPeNDAP, Inc. +// Author: James Gallagher +// +// This library is free software; you can redistribute it and/or +// modify it under the terms of the GNU Lesser General Public +// License as published by the Free Software Foundation; either +// version 2.1 of the License, or (at your option) any later version. +// +// This library 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 +// Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, write to the Free Software +// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA +// +// You can contact OPeNDAP, Inc. at PO Box 112, Saunderstown, RI. 02874-0112. + +#ifndef d4_parser_sax2_h +#define d4_parser_sax2_h + +#include +#include +#include +#include + +#include + +#include "DDS.h" +#include "BaseType.h" +//#include "D4EnumDef.h" +#include "D4BaseTypeFactory.h" + +#include "D4ParseError.h" + +namespace libdap +{ + +/** Parse the XML text which encodes the network/persistent representation of + the DMR object. In the current implementation, the DMR is held by an + instance of the class DDS which in turn holds variables which include + attributes. + + This parser for the DMR document uses the SAX interface of libxml2. + Static methods are used as callbacks for the SAX parser. These static + methods are public because making them private complicates compilation. + They should not be called by anything other than the intern method. + They do not throw exceptions because exceptions from within callbacks are + not reliable or portable. To signal errors, the methods record + information in the D4ParserSax2 object. Once the error handler is called, + construction of an DMR object ends even though the SAX parser still + calls the various callback functions. The parser treats warnings, + errors and fatal_errors the same way; when any are found parsing + stops. The intern method throws an D4ParseError exception if an + error was found. + + Note that this class uses the C++-supplied default definitions for the + default and copy constructors as well as the destructor and assignment + operator. + + @see DDS */ +class D4ParserSax2 +{ +private: + /** States used by DDXParserDAP4State. These are the states of the SAX parser + state-machine. */ + enum ParseState { + parser_start, + + // inside_group is the state just after parsing the start of a Group + // element. + inside_group, + + // @TODO Parse attributes once the variables are working. + inside_attribute_container, + inside_attribute, + inside_attribute_value, + inside_other_xml_attribute, + + inside_enum_def, + inside_enum_const, + + // This covers Byte, ..., Url, Opaque + inside_simple_type, + + inside_array, + inside_dimension, + + inside_grid, + inside_map, + + inside_structure, + inside_sequence, + + parser_unknown, + parser_error + }; + + D4BaseTypeFactory *d_factory; + + // These stacks hold the state of the parse as it progresses. + stack s; // Current parse state + stack bt_stack; // current variable(s)/groups(s) + stack at_stack; // current attribute table + +#if 0 + // If an enumeration being defined, hold it here until its complete + D4EnumDef *d_enum_def; +#endif + + // Accumulate stuff inside an 'OtherXML' DAP attribute here + string other_xml; + + // When we're parsing unknown XML, how deeply is it nested? This is used + // for the OtherXML DAP attributes. + unsigned int other_xml_depth; + unsigned int unknown_depth; + + // These are used for processing errors. + string error_msg; // Error message(s), if any. + xmlParserCtxtPtr ctxt; // used for error message line numbers + + // The results of the parse operation are stored in these fields. + DDS *dds; // dump DMR here + + // These hold temporary values read during the parse. + string dods_attr_name; // DAP4 attributes, not XML attributes + string dods_attr_type; // ... not XML ... + string char_data; // char data in value elements; null after use + string root_ns; // What is the namespace of the root node (Group) + + class XMLAttribute { + public: + string prefix; + string nsURI; + string value; + + void clone(const XMLAttribute &src) { + prefix = src.prefix; + nsURI = src.nsURI; + value = src.value; + } + + XMLAttribute() : prefix(""), nsURI(""), value("") {} + XMLAttribute(const string &p, const string &ns, const string &v) + : prefix(p), nsURI(ns), value(v) {} + // 'attributes' as passed from libxml2 is a five element array but this + // ctor gets the back four elements. + XMLAttribute(const xmlChar **attributes/*[4]*/) { + prefix = attributes[0] != 0 ? (const char *)attributes[0]: ""; + nsURI = attributes[1] != 0 ? (const char *)attributes[1]: ""; + value = string((const char *)attributes[2], (const char *)attributes[3]); + } + XMLAttribute(const XMLAttribute &rhs) { + clone(rhs); + } + XMLAttribute &operator=(const XMLAttribute &rhs) { + if (this == &rhs) + return *this; + clone(rhs); + return *this; + } + }; + + typedef map XMLAttrMap; + XMLAttrMap xml_attrs; // dump XML attributes here + + XMLAttrMap::iterator xml_attr_begin() { + return xml_attrs.begin(); + } + + XMLAttrMap::iterator xml_attr_end() { + return xml_attrs.end(); + } + + map namespace_table; + + // These are kind of silly... + void set_state(D4ParserSax2::ParseState state); + D4ParserSax2::ParseState get_state() const; + void pop_state(); + + // Glue for the BaseTypeFactory class. + BaseType *factory(Type t, const string &name); + + // Common cleanup code for intern() and intern_stream() + void cleanup_parse(xmlParserCtxtPtr &context) const; + + /** @name Parser Actions + + These methods are the 'actions' carried out by the start_element and + end_element callbacks. Most of what takes place in those has been + factored out to this set of functions. */ + //@{ + void transfer_xml_attrs(const xmlChar **attrs, int nb_attributes); + void transfer_xml_ns(const xmlChar **namespaces, int nb_namespaces); + bool check_required_attribute(const string &attr); + bool check_attribute(const string & attr); + + void process_attribute_helper(const xmlChar **attrs, int nb_attrs); + + void process_variable_helper(Type t, ParseState s, const xmlChar **attrs, int nb_attributes); + + void process_enum_const_helper(const xmlChar **attrs, int nb_attributes); + void process_enum_def_helper(const xmlChar **attrs, int nb_attributes); + + void process_dimension(const xmlChar **attrs, int nb_attrs); + + bool process_attribute(const char *name, const xmlChar **attrs, int nb_attributes); + bool process_variable(const char *name, const xmlChar **attrs, int nb_attributes); + + bool process_enum_def(const char *name, const xmlChar **attrs, int nb_attributes); + bool process_enum_const(const char *name, const xmlChar **attrs, int nb_attributes); + + void finish_variable(const char *tag, Type t, const char *expected); + //@} + + friend class D4ParserSax2Test; + +public: + // Read the factory class used to build BaseTypes from the DDS passed + // into the intern() method. + D4ParserSax2() : d_factory(0), + other_xml(""), other_xml_depth(0), unknown_depth(0), + error_msg(""), ctxt(0), dds(0), + dods_attr_name(""), dods_attr_type(""), + char_data(""), root_ns("") + {} + + void intern(const string &document, DDS *dest_dds); + void intern(istream &in, DDS *dest_dds); + + static void ddx_start_document(void *parser); + static void ddx_end_document(void *parser); + + static void ddx_start_element(void *parser, + const xmlChar *localname, const xmlChar *prefix, const xmlChar *URI, + int nb_namespaces, const xmlChar **namespaces, int nb_attributes, + int nb_defaulted, const xmlChar **attributes); + static void ddx_end_element(void *parser, const xmlChar *localname, + const xmlChar *prefix, const xmlChar *URI); + + static void ddx_get_characters(void *parser, const xmlChar *ch, int len); + static void ddx_ignoreable_whitespace(void *parser, + const xmlChar * ch, int len); + static void ddx_get_cdata(void *parser, const xmlChar *value, int len); + + static xmlEntityPtr ddx_get_entity(void *parser, const xmlChar *name); + static void ddx_fatal_error(void *parser, const char *msg, ...); +}; + +} // namespace libdap + +#endif // d4_parser_sax2_h diff -Nru libdap-3.11.1/DAP4StreamMarshaller.cc libdap-3.12.0/DAP4StreamMarshaller.cc --- libdap-3.11.1/DAP4StreamMarshaller.cc 1970-01-01 00:00:00.000000000 +0000 +++ libdap-3.12.0/DAP4StreamMarshaller.cc 2013-10-17 21:27:40.000000000 +0000 @@ -0,0 +1,547 @@ +// DAP4StreamMarshaller.cc + +// -*- mode: c++; c-basic-offset:4 -*- + +// This file is part of libdap, A C++ implementation of the OPeNDAP Data +// Access Protocol. + +// Copyright (c) 2012 OPeNDAP, Inc. +// Author: James Gallagher +// +// This library is free software; you can redistribute it and/or +// modify it under the terms of the GNU Lesser General Public +// License as published by the Free Software Foundation; either +// version 2.1 of the License, or (at your option) any later version. +// +// This library 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 +// Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, write to the Free Software +// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA +// +// You can contact OPeNDAP, Inc. at PO Box 112, Saunderstown, RI. 02874-0112. +// +// Portions of this code are from Google's great protocol buffers library and +// are copyrighted as follows: + +// Protocol Buffers - Google's data interchange format +// Copyright 2008 Google Inc. All rights reserved. +// http://code.google.com/p/protobuf/ + + +#include "DAP4StreamMarshaller.h" + +#include // for the Google protobuf code +#include + +#include +#include +#include + +using namespace std; + +//#define DODS_DEBUG 1 + +#include "dods-datatypes.h" +#include "util.h" +#include "debug.h" + +namespace libdap { + +static inline bool is_host_big_endian() +{ +#ifdef COMPUTE_ENDIAN_AT_RUNTIME + + dods_int16 i = 0x0100; + char *c = reinterpret_cast(&i); + return *c; + +#else + +#ifdef WORDS_BIGENDIAN + return true; +#else + return false; +#endif + +#endif +} + + +// From the Google protobuf library +inline uint8_t* WriteVarint64ToArrayInline(uint64_t value, uint8_t* target) { + // Splitting into 32-bit pieces gives better performance on 32-bit + // processors. + uint32_t part0 = static_cast(value ); + uint32_t part1 = static_cast(value >> 28); + uint32_t part2 = static_cast(value >> 56); + + int size; + + // Here we can't really optimize for small numbers, since the value is + // split into three parts. Checking for numbers < 128, for instance, + // would require three comparisons, since you'd have to make sure part1 + // and part2 are zero. However, if the caller is using 64-bit integers, + // it is likely that they expect the numbers to often be very large, so + // we probably don't want to optimize for small numbers anyway. Thus, + // we end up with a hard coded binary search tree... + if (part2 == 0) { + if (part1 == 0) { + if (part0 < (1 << 14)) { + if (part0 < (1 << 7)) { + size = 1; goto size1; + } else { + size = 2; goto size2; + } + } else { + if (part0 < (1 << 21)) { + size = 3; goto size3; + } else { + size = 4; goto size4; + } + } + } else { + if (part1 < (1 << 14)) { + if (part1 < (1 << 7)) { + size = 5; goto size5; + } else { + size = 6; goto size6; + } + } else { + if (part1 < (1 << 21)) { + size = 7; goto size7; + } else { + size = 8; goto size8; + } + } + } + } else { + if (part2 < (1 << 7)) { + size = 9; goto size9; + } else { + size = 10; goto size10; + } + } + + // GOOGLE_LOG(FATAL) << "Can't get here."; + + size10: target[9] = static_cast((part2 >> 7) | 0x80); + size9 : target[8] = static_cast((part2 ) | 0x80); + size8 : target[7] = static_cast((part1 >> 21) | 0x80); + size7 : target[6] = static_cast((part1 >> 14) | 0x80); + size6 : target[5] = static_cast((part1 >> 7) | 0x80); + size5 : target[4] = static_cast((part1 ) | 0x80); + size4 : target[3] = static_cast((part0 >> 21) | 0x80); + size3 : target[2] = static_cast((part0 >> 14) | 0x80); + size2 : target[1] = static_cast((part0 >> 7) | 0x80); + size1 : target[0] = static_cast((part0 ) | 0x80); + + target[size-1] &= 0x7F; + return target + size; +} + +/** Build an instance of DAP4StreamMarshaller. Bind the C++ stream out to this + * instance. If the checksum parameter is true, initialize a checksum buffer + * and enable the use of the reset_checksum() and get_checksum() methods. + * + * @param out Write to this stream object. + * @param write_data If true, write data values. True by default + */ +DAP4StreamMarshaller::DAP4StreamMarshaller(ostream &out, bool write_data) : + d_out(out), d_ctx(0), d_write_data(write_data), d_checksum_ctx_valid(false) +{ + // XDR is used if the call std::numeric_limits::is_iec559() + // returns false indicating that the compiler is not using IEEE 754. + // If it is, we just write out the bytes. Why malloc()? Because + // xdr_destroy is going to call free() for us. + d_ieee754_buf = (char*)malloc(sizeof(dods_float64)); + if (!d_ieee754_buf) + throw InternalErr(__FILE__, __LINE__, "Could not create DAP4StreamMarshaller"); + xdrmem_create(&d_scalar_sink, d_ieee754_buf, sizeof(dods_float64), XDR_ENCODE); + + // This will cause exceptions to be thrown on i/o errors. The exception + // will be ostream::failure + out.exceptions(ostream::failbit | ostream::badbit); + + d_ctx = EVP_MD_CTX_create(); +} + +DAP4StreamMarshaller::~DAP4StreamMarshaller() +{ + // Free the buffer this contains. The xdr_destroy() macro does not + // free the XDR struct (which is fine since we did not dynamically + // allocate it). + xdr_destroy (&d_scalar_sink); + + EVP_MD_CTX_destroy(d_ctx); +} + +/** + * Return the is the host big- or little-endian? + * + * @return 'big' or ' little'. + */ + +string +DAP4StreamMarshaller::get_endian() const +{ + return (is_host_big_endian()) ? "big": "little"; +} + +/** Initialize the checksum buffer. This resets the checksum calculation. + * @exception InternalErr if called when the object was created without + * checksum support. + */ +void DAP4StreamMarshaller::reset_checksum() +{ + if (EVP_DigestInit_ex(d_ctx, EVP_md5(), 0) == 0) + throw Error("Failed to initialize checksum object."); + + d_checksum_ctx_valid = true; +} + +/** + * Private method to compute the checksum. + */ +void DAP4StreamMarshaller::m_compute_checksum() +{ + if (d_checksum_ctx_valid) { + // '...Final()' 'erases' the context so the next call without a reset + // returns a bogus value. + d_checksum_ctx_valid = false; + + // For MD5, the array md holds the 16 digits of the hash as values. + // The loop below turns that into a nice 32-digit hex number; see + // put_checksum() for a version that writes the 128-bit value without + // that conversion. + unsigned int md_len; + int status = EVP_DigestFinal_ex(d_ctx, &d_md[0], &md_len); + if (status == 0 || md_len != c_md5_length) + throw Error("Error computing the checksum (checksum computation)."); + } +} + +/** Get the current checksum. It is not possible to continue computing the + * checksum once this has been called. + * @exception InternalErr if called when the object was created without + * checksum support or if called when the checksum has already been returned. + */ +string DAP4StreamMarshaller::get_checksum() +{ + if (d_checksum_ctx_valid) { + m_compute_checksum(); + } + + ostringstream oss; + oss.setf(ios::hex, ios::basefield); + for (unsigned int i = 0; i < c_md5_length; ++i) { + oss << setfill('0') << setw(2) << (unsigned int) d_md[i]; + } + + return oss.str(); +} + +void DAP4StreamMarshaller::put_checksum() +{ + if (d_checksum_ctx_valid) { + m_compute_checksum(); + } + + d_out.write(reinterpret_cast(&d_md[0]), c_md5_length); +} + +void DAP4StreamMarshaller::checksum_update(const void *data, unsigned long len) +{ + if (!d_checksum_ctx_valid) + throw InternalErr(__FILE__, __LINE__, "Invalid checksum context (checksum update)."); + + if (EVP_DigestUpdate(d_ctx, data, len) == 0) { + d_checksum_ctx_valid = false; + throw Error("Error computing the checksum (checksum update)."); + } +} + +void DAP4StreamMarshaller::put_byte(dods_byte val) +{ + checksum_update(&val, sizeof(dods_byte)); + + if (d_write_data) { + DBG( std::cerr << "put_byte: " << val << std::endl ); + + d_out.write(reinterpret_cast(&val), sizeof(dods_byte)); + } +} + +void DAP4StreamMarshaller::put_int8(dods_int8 val) +{ + checksum_update(&val, sizeof(dods_int8)); + + if (d_write_data) { + DBG( std::cerr << "put_int8: " << val << std::endl ); + + d_out.write(reinterpret_cast(&val), sizeof(dods_int8)); + } +} + +void DAP4StreamMarshaller::put_int16(dods_int16 val) +{ + checksum_update(&val, sizeof(dods_int16)); + + if (d_write_data) + d_out.write(reinterpret_cast(&val), sizeof(dods_int16)); +} + +void DAP4StreamMarshaller::put_int32(dods_int32 val) +{ + checksum_update(&val, sizeof(dods_int32)); + + if (d_write_data) + d_out.write(reinterpret_cast(&val), sizeof(dods_int32)); +} + +void DAP4StreamMarshaller::put_int64(dods_int64 val) +{ + checksum_update(&val, sizeof(dods_int64)); + + if (d_write_data) + d_out.write(reinterpret_cast(&val), sizeof(dods_int64)); +} + +void DAP4StreamMarshaller::put_float32(dods_float32 val) +{ + checksum_update(&val, sizeof(dods_float32)); + + if (d_write_data) { + if (std::numeric_limits::is_iec559 ) { + DBG2(cerr << "Native rep is ieee754." << endl); + d_out.write(reinterpret_cast(&val), sizeof(dods_float32)); + } + else { + if (!xdr_setpos(&d_scalar_sink, 0)) + throw InternalErr(__FILE__, __LINE__, "Error serializing a Float32 variable"); + + if (!xdr_float(&d_scalar_sink, &val)) + throw InternalErr(__FILE__, __LINE__, "Error serializing a Float32 variable"); + + if (xdr_getpos(&d_scalar_sink) != sizeof(dods_float32)) + throw InternalErr(__FILE__, __LINE__, "Error serializing a Float32 variable"); + + // If this is a little-endian host, twiddle the bytes + static bool twiddle_bytes = !is_host_big_endian(); + if (twiddle_bytes) { + dods_int32 *i = reinterpret_cast(&d_ieee754_buf); + *i = bswap_32(*i); + } + + d_out.write(d_ieee754_buf, sizeof(dods_float32)); + } + } +} + +void DAP4StreamMarshaller::put_float64(dods_float64 val) +{ + checksum_update(&val, sizeof(dods_float64)); + + if (d_write_data) { + if (std::numeric_limits::is_iec559) + d_out.write(reinterpret_cast(&val), sizeof(dods_float64)); + else { + if (!xdr_setpos(&d_scalar_sink, 0)) + throw InternalErr(__FILE__, __LINE__, "Error serializing a Float64 variable"); + + if (!xdr_double(&d_scalar_sink, &val)) + throw InternalErr(__FILE__, __LINE__, "Error serializing a Float64 variable"); + + if (xdr_getpos(&d_scalar_sink) != sizeof(dods_float64)) + throw InternalErr(__FILE__, __LINE__, "Error serializing a Float64 variable"); + + // If this is a little-endian host, twiddle the bytes + static bool twiddle_bytes = !is_host_big_endian(); + if (twiddle_bytes) { + dods_int64 *i = reinterpret_cast(&d_ieee754_buf); + *i = bswap_64(*i); + } + + d_out.write(d_ieee754_buf, sizeof(dods_float64)); + } + } +} + +void DAP4StreamMarshaller::put_uint16(dods_uint16 val) +{ + checksum_update(&val, sizeof(dods_uint16)); + + if (d_write_data) + d_out.write(reinterpret_cast(&val), sizeof(dods_uint16)); +} + +void DAP4StreamMarshaller::put_uint32(dods_uint32 val) +{ + checksum_update(&val, sizeof(dods_uint32)); + + if (d_write_data) + d_out.write(reinterpret_cast(&val), sizeof(dods_uint32)); +} + +void DAP4StreamMarshaller::put_uint64(dods_uint64 val) +{ + checksum_update(&val, sizeof(dods_uint64)); + + if (d_write_data) + d_out.write(reinterpret_cast(&val), sizeof(dods_uint64)); +} + + +void DAP4StreamMarshaller::put_str(const string &val) +{ + checksum_update(val.c_str(), val.length()); + + if (d_write_data) { + put_length_prefix(val.length()); + d_out.write(val.data(), val.length()); + } +} + +void DAP4StreamMarshaller::put_url(const string &val) +{ + put_str(val); +} + +void DAP4StreamMarshaller::put_opaque(char *val, unsigned int len) +{ + checksum_update(val, len); + + if (d_write_data) { + put_length_prefix(len); + d_out.write(val, len); + } +} + +void DAP4StreamMarshaller::put_length_prefix(dods_uint64 val) +{ + if (d_write_data) { + DBG2(cerr << "val: " << val << endl); + + vector target(sizeof(dods_uint64) + 1, 0); + uint8_t* to_send = WriteVarint64ToArrayInline(val, &target[0]); + d_out.write(reinterpret_cast(&target[0]), to_send - &target[0]); + + DBG2(cerr << "varint: " << hex << *(uint64_t*)&target[0] << dec << endl); + } +} + +void DAP4StreamMarshaller::put_vector(char *val, unsigned int num) +{ + checksum_update(val, num); + + d_out.write(val, num); +} + +/** + * Write a vector of values prefixed by the number of elements. This is a + * special version for vectors of bytes and it calls put_opaque() + * + * @note This function writes the number of elements in the vector which, + * in this case, is equal to the number of bytes + * + * @param val Pointer to the data to write + * @param num The number of elements to write + */ +void DAP4StreamMarshaller::put_varying_vector(char *val, unsigned int num) +{ + put_opaque(val, num); +} + +/** + * @todo recode this so that it does not copy data to a new buffer but + * serializes directly to the stream (element by element) and compare the + * run times. + */ +void DAP4StreamMarshaller::m_serialize_reals(char *val, unsigned int num, int width, Type type) +{ + dods_uint64 size = num * width; + // This is a leak!!! xdr_destroy does not free 'buf'. + //char *buf = (char*)malloc(size); + vector buf(size); + XDR xdr; + xdrmem_create(&xdr, &buf[0], size, XDR_ENCODE); + try { + if(!xdr_array(&xdr, &val, (unsigned int *)&num, size, width, XDRUtils::xdr_coder(type))) + throw InternalErr(__FILE__, __LINE__, "Error serializing a Float64 array"); + + if (xdr_getpos(&xdr) != size) + throw InternalErr(__FILE__, __LINE__, "Error serializing a Float64 array"); + + // If this is a little-endian host, twiddle the bytes + static bool twiddle_bytes = !is_host_big_endian(); + if (twiddle_bytes) { + if (width == 4) { + dods_float32 *lbuf = reinterpret_cast(&buf[0]); + while (num--) { + dods_int32 *i = reinterpret_cast(lbuf++); + *i = bswap_32(*i); + } + } + else { // width == 8 + dods_float64 *lbuf = reinterpret_cast(&buf[0]); + while (num--) { + dods_int64 *i = reinterpret_cast(lbuf++); + *i = bswap_64(*i); + } + } + } + + d_out.write(&buf[0], size); + } + catch (...) { + xdr_destroy(&xdr); + throw; + } + xdr_destroy(&xdr); +} + +void DAP4StreamMarshaller::put_vector(char *val, unsigned int num, int width, Type type) +{ + checksum_update(val, num * width); + + if (d_write_data) { + if (type == dods_float32_c && !std::numeric_limits::is_iec559) { + // If not using IEEE 754, use XDR to get it that way. + m_serialize_reals(val, num, 4, type); + } + else if (type == dods_float64_c && !std::numeric_limits::is_iec559) { + m_serialize_reals(val, num, 8, type); + } + else { + d_out.write(val, num * width); + } + } +} + +/** + * Write a vector of values prefixed by the number of elements. + * + * @note This function writes the number of elements in the vector, not the + * number of bytes. + * + * @param val Pointer to the data to write + * @param num The number of elements to write + * @param width The number of bytes in each element + * @param type The DAP type code (used only for float32 and float64 values). + */ +void DAP4StreamMarshaller::put_varying_vector(char *val, unsigned int num, int width, Type type) +{ + put_length_prefix(num); + put_vector(val, num, width, type); +} + +void DAP4StreamMarshaller::dump(ostream &strm) const +{ + strm << DapIndent::LMarg << "DAP4StreamMarshaller::dump - (" << (void *) this << ")" << endl; +} + +} // namespace libdap + diff -Nru libdap-3.11.1/DAP4StreamMarshaller.h libdap-3.12.0/DAP4StreamMarshaller.h --- libdap-3.11.1/DAP4StreamMarshaller.h 1970-01-01 00:00:00.000000000 +0000 +++ libdap-3.12.0/DAP4StreamMarshaller.h 2013-10-17 21:27:40.000000000 +0000 @@ -0,0 +1,154 @@ +// DAP4StreamMarshaller.h + +// -*- mode: c++; c-basic-offset:4 -*- + +// This file is part of libdap, A C++ implementation of the OPeNDAP Data +// Access Protocol. + +// Copyright (c) 2002,2003,2012 OPeNDAP, Inc. +// Author: Patrick West , +// James Gallagher +// +// This library is free software; you can redistribute it and/or +// modify it under the terms of the GNU Lesser General Public +// License as published by the Free Software Foundation; either +// version 2.1 of the License, or (at your option) any later version. +// +// This library 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 +// Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, write to the Free Software +// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA +// +// You can contact OPeNDAP, Inc. at PO Box 112, Saunderstown, RI. 02874-0112. + +#ifndef I_DAP4StreamMarshaller_h +#define I_DAP4StreamMarshaller_h 1 + +#include + +#include + +using std::ostream; +using std::cout; + +#include "Marshaller.h" +#include "XDRUtils.h" + +namespace libdap { + +class Vector; + +/** @brief Marshaller that knows how to marshal/serialize dap data objects + * to a C++ iostream using DAP4's receiver-makes-right scheme. This code + * adds checksums to the stream and uses the xdr library to encode real + * values if the underlying representation is not IEEE 754. It also supports + * computing the checksum only. + * + * @note This class uses the Marshaller interface; it could be rewritten + * to use far fewer methods since all of the put_*() methods take different + * types. + * + * @todo Add to configure a test for Apple's Common Crypto (man CC_MD5_Init) + * and use that if present. ...drop in replacement for SSL MD5 functions. Why + * Apple did this is a mystery. + */ +class DAP4StreamMarshaller: public Marshaller { +public: + const static unsigned int c_md5_length = 16; + +private: + XDR d_scalar_sink; + char * d_ieee754_buf; // used to serialize a float or double + + ostream & d_out; + + EVP_MD_CTX * d_ctx; // jhrg 4/24/12 + bool d_write_data; // jhrg 1/27/12 + bool d_checksum_ctx_valid; + unsigned char d_md[c_md5_length]; + + // These are private so they won't ever get used. + + DAP4StreamMarshaller() : d_out(cout) { + throw InternalErr( __FILE__, __LINE__, "not implemented." ) ; + } + DAP4StreamMarshaller(const DAP4StreamMarshaller &) : Marshaller(), d_out(cout) { + throw InternalErr( __FILE__, __LINE__, "not implemented." ) ; + } + DAP4StreamMarshaller & operator=(const DAP4StreamMarshaller &) { + throw InternalErr( __FILE__, __LINE__, "not implemented." ) ; + } + + void m_serialize_reals(char *val, unsigned int num, int width, Type type); + void m_compute_checksum(); + +public: + DAP4StreamMarshaller(ostream &out, bool write_data = true); + virtual ~DAP4StreamMarshaller(); + + // Added here + virtual bool checksums() const { + return d_ctx != 0; + } + virtual string get_endian() const; + virtual void reset_checksum(); + virtual string get_checksum(); + virtual void checksum_update(const void *data, unsigned long len); + void put_checksum(); + + virtual void put_byte(dods_byte val); + virtual void put_int8(dods_int8 val); + + virtual void put_int16(dods_int16 val); + virtual void put_int32(dods_int32 val); + // Added + virtual void put_int64(dods_int64 val); + + virtual void put_float32(dods_float32 val); + virtual void put_float64(dods_float64 val); + + virtual void put_uint16(dods_uint16 val); + virtual void put_uint32(dods_uint32 val); + // Added + virtual void put_uint64(dods_uint64 val); + + virtual void put_str(const string &val); + virtual void put_url(const string &val); + + virtual void put_opaque(char *val, unsigned int len); + + // Never use put_int() to send length information in DAP4, use + // put_length_prefix() instead. + virtual void put_int(int) { + throw InternalErr(__FILE__, __LINE__, "Not Implemented; use put_length_prefix."); + } + + // Added; This method does not add its argument to the checksum; + // put_uint64() does. + //virtual void put_length_prefix( dods_uint32 val ) ; + virtual void put_length_prefix(dods_uint64 val); + + virtual void put_vector(char *val, unsigned int num); + virtual void put_vector(char *val, unsigned int num, int width, Type type); + + virtual void put_varying_vector(char *val, unsigned int num); + virtual void put_varying_vector(char *val, unsigned int num, int width, Type type); + + virtual void put_vector(char *, int , Vector &) { + throw InternalErr(__FILE__, __LINE__, "Not Implemented; use put_length_prefix."); + } + virtual void put_vector(char *, int , int , Vector &) { + throw InternalErr(__FILE__, __LINE__, "Not Implemented; use put_length_prefix."); + } + + + virtual void dump(ostream &strm) const; +}; + +} // namespace libdap + +#endif // I_DAP4StreamMarshaller_h diff -Nru libdap-3.11.1/DAP4StreamUnMarshaller.cc libdap-3.12.0/DAP4StreamUnMarshaller.cc --- libdap-3.11.1/DAP4StreamUnMarshaller.cc 1970-01-01 00:00:00.000000000 +0000 +++ libdap-3.12.0/DAP4StreamUnMarshaller.cc 2013-10-17 21:27:40.000000000 +0000 @@ -0,0 +1,412 @@ +// DAP4StreamUnMarshaller.cc + +// -*- mode: c++; c-basic-offset:4 -*- + +// This file is part of libdap, A C++ implementation of the OPeNDAP Data +// Access Protocol. + +// Copyright (c) 2012 OPeNDAP, Inc. +// Author: James Gallagher +// +// This library is free software; you can redistribute it and/or +// modify it under the terms of the GNU Lesser General Public +// License as published by the Free Software Foundation; either +// version 2.1 of the License, or (at your option) any later version. +// +// This library 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 +// Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, write to the Free Software +// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA +// +// You can contact OPeNDAP, Inc. at PO Box 112, Saunderstown, RI. 02874-0112. + +#include "config.h" +#include "DAP4StreamUnMarshaller.h" + +#include + +#include +#include + +#include +#include + +//#define DODS_DEBUG2 1 +//#define DODS_DEBUG 1 + +#include "util.h" +#include "XDRUtils.h" +#include "InternalErr.h" +#include "debug.h" + +namespace libdap { + +static inline bool is_host_big_endian() +{ +#ifdef COMPUTE_ENDIAN_AT_RUNTIME + + dods_int16 i = 0x0100; + char *c = reinterpret_cast(&i); + return *c; + +#else + +#ifdef WORDS_BIGENDIAN + return true; +#else + return false; +#endif + +#endif +} + +DAP4StreamUnMarshaller::DAP4StreamUnMarshaller(istream &in, bool is_stream_big_endian) + : d_in( in ), d_buf(0) +{ +#if 0 + // XDR is used to handle transforming non-ieee754 reals, nothing else. + if (!d_buf) + // Leaked??? See the XDRStream code + d_buf = (char *) malloc(sizeof(dods_float64)); + if (!d_buf) + throw Error("Failed to allocate memory for data serialization."); +#endif + + xdrmem_create(&d_source, &d_buf, sizeof(dods_float64), XDR_DECODE); + + // This will cause exceptions to be thrown on i/o errors. The exception + // will be ostream::failure + d_in.exceptions(istream::failbit | istream::badbit); + + DBG(cerr << "Host is big endian: " << is_host_big_endian() << endl); + + if ((is_host_big_endian() && is_stream_big_endian) + || (!is_host_big_endian() && !is_stream_big_endian)) + d_twiddle_bytes = false; + else + d_twiddle_bytes = true; +} + +DAP4StreamUnMarshaller::~DAP4StreamUnMarshaller( ) +{ +} + +DAP4StreamUnMarshaller::checksum DAP4StreamUnMarshaller::get_checksum() +{ + checksum c; + d_in.read(reinterpret_cast(&c), c_md5_length); + + return c; +} + +string DAP4StreamUnMarshaller::get_checksum(DAP4StreamUnMarshaller::checksum c) +{ + unsigned char *md = reinterpret_cast(&c); + + ostringstream oss; + oss.setf(ios::hex, ios::basefield); + for (unsigned int i = 0; i < c_md5_length; ++i) { + oss << setfill('0') << setw(2) << (unsigned int)md[i]; + } + + return oss.str(); +} + +void +DAP4StreamUnMarshaller::get_byte( dods_byte &val ) +{ + d_in.read(reinterpret_cast(&val), sizeof(dods_byte)); +} + +void +DAP4StreamUnMarshaller::get_int8( dods_int8 &val ) +{ + d_in.read(reinterpret_cast(&val), sizeof(dods_int8)); +} + +void +DAP4StreamUnMarshaller::get_int16( dods_int16 &val ) +{ + d_in.read(reinterpret_cast(&val), sizeof(dods_int16)); + if (d_twiddle_bytes) + val = bswap_16(val); +} + +void +DAP4StreamUnMarshaller::get_int32( dods_int32 &val ) +{ + d_in.read(reinterpret_cast(&val), sizeof(dods_int32)); + if (d_twiddle_bytes) + val = bswap_32(val); +} + +void +DAP4StreamUnMarshaller::get_int64( dods_int64 &val ) +{ + d_in.read(reinterpret_cast(&val), sizeof(dods_int64)); + if (d_twiddle_bytes) + val = bswap_64(val); +} + +void +DAP4StreamUnMarshaller::get_float32( dods_float32 &val ) +{ + if (std::numeric_limits::is_iec559) { + d_in.read(reinterpret_cast(&val), sizeof(dods_float32)); + if (d_twiddle_bytes) { + dods_int32 *i = reinterpret_cast(&val); + *i = bswap_32(*i); + } + + } + else { + xdr_setpos( &d_source, 0); + d_in.read(d_buf, sizeof(dods_float32)); + + if (!xdr_float(&d_source, &val)) + throw Error("Network I/O Error. Could not read float 64 data."); + } +} + +void +DAP4StreamUnMarshaller::get_float64( dods_float64 &val ) +{ + if (std::numeric_limits::is_iec559) { + d_in.read(reinterpret_cast(&val), sizeof(dods_float64)); + if (d_twiddle_bytes) { + dods_int64 *i = reinterpret_cast(&val); + *i = bswap_32(*i); + } + } + else { + xdr_setpos( &d_source, 0); + d_in.read(d_buf, sizeof(dods_float64)); + + if (!xdr_double(&d_source, &val)) + throw Error("Network I/O Error. Could not read float 64 data."); + } +} + +void +DAP4StreamUnMarshaller::get_uint16( dods_uint16 &val ) +{ + d_in.read(reinterpret_cast(&val), sizeof(dods_uint16)); + if (d_twiddle_bytes) + val = bswap_16(val); +} + +void +DAP4StreamUnMarshaller::get_uint32( dods_uint32 &val ) +{ + d_in.read(reinterpret_cast(&val), sizeof(dods_uint32)); + if (d_twiddle_bytes) + val = bswap_32(val); +} + +void +DAP4StreamUnMarshaller::get_uint64( dods_uint64 &val ) +{ + d_in.read(reinterpret_cast(&val), sizeof(dods_uint64)); + if (d_twiddle_bytes) + val = bswap_64(val); +} + +/** + * Read a varint (128-bit varying integer). Not the most optimized version + * possible. It would be better if the values were in memory and we could + * operate on them without a separate read for each byte. + */ +dods_uint64 DAP4StreamUnMarshaller::get_length_prefix() +{ + uint8_t b; + int count = 0; + dods_uint64 result = 0; + do { + d_in.read(reinterpret_cast(&b), 1); + + uint64_t v = (b & 0x7f) << 7 * count; + result += v; // is v needed? Does it matter? + count++; + + } while (b & 0x80); + + return result; +} + + +void +DAP4StreamUnMarshaller::get_str( string &val ) +{ + dods_int64 len = get_length_prefix(); + vector raw(len+1); + d_in.read(&raw[0], len); + + val.reserve(len); + val.assign(&raw[0], len); +} + +void +DAP4StreamUnMarshaller::get_url( string &val ) +{ + get_str( val ) ; +} + +/** + * Get opaque data when the size of the data to read is known. + * + * @param val Pointer to 'len' bytes; store the data here. + * @param len Number of bytes referenced adn expected + * @exception Error if the number of bytes indicated in the stream does not + * match 'len' + */ +void +DAP4StreamUnMarshaller::get_opaque( char *val, unsigned int len ) +{ + dods_int64 rlen = get_length_prefix(); + if (len != rlen) + throw Error("Expected opaque data of " + long_to_string(len) + + " bytes, but got " + long_to_string(rlen) + " instead."); + + d_in.read(val, len); +} + +/** + * Get opaque data when the size of the data to be read is not known in + * advance. + * + * @param val Value-result parameter for the data; caller must delete. + * @param len value-result parameter for the length of the data + */ +void +DAP4StreamUnMarshaller::get_opaque( char **val, unsigned int &len ) +{ + len = get_length_prefix(); + + *val = new char[len]; + d_in.read(*val, len); +} + +void +DAP4StreamUnMarshaller::get_vector( char *val, unsigned int num ) +{ + d_in.read(val, num); +} + +/** + * @todo recode this so that it does not copy data to a new buffer but + * serializes directly to the stream (element by element) and compare the + * run times. + */ +void DAP4StreamUnMarshaller::m_deserialize_reals(char *val, unsigned int num, int width, Type type) +{ + dods_uint64 size = num * width; + //char *buf = (char*)malloc(size); This was leaked; xdr_destroy() does not free it. + vector buf(size); + XDR xdr; + xdrmem_create(&xdr, &buf[0], size, XDR_DECODE); + try { + xdr_setpos(&d_source, 0); + d_in.read(&buf[0], size); + + if(!xdr_array(&xdr, &val, (unsigned int *)&num, size, width, XDRUtils::xdr_coder(type))) + throw InternalErr(__FILE__, __LINE__, "Error deserializing a Float64 array"); + + if (xdr_getpos(&xdr) != size) + throw InternalErr(__FILE__, __LINE__, "Error deserializing a Float64 array"); + } + catch (...) { + xdr_destroy(&xdr); + throw; + } + xdr_destroy(&xdr); +} + +void DAP4StreamUnMarshaller::m_twidle_vector_elements(char *vals, unsigned int num, int width) +{ + switch (width) { + case 2: { + dods_int16 *local = reinterpret_cast(vals); + while (num--) { + *local = bswap_16(*local); + local++; + } + break; + } + case 4: { + dods_int32 *local = reinterpret_cast(vals);; + while (num--) { + *local = bswap_32(*local); + local++; + } + break; + } + case 8: { + dods_int64 *local = reinterpret_cast(vals);; + while (num--) { + *local = bswap_64(*local); + local++; + } + break; + } + default: + throw InternalErr(__FILE__, __LINE__, "Unrecognized word size."); + } +} + +void +DAP4StreamUnMarshaller::get_vector( char *val, unsigned int num, int width, Type type ) +{ + if (type == dods_float32_c && !std::numeric_limits::is_iec559) { + // If not using IEEE 754, use XDR to get it that way. + m_deserialize_reals(val, num, 4, type); + } + else if (type == dods_float64_c && !std::numeric_limits::is_iec559) { + m_deserialize_reals(val, num, 8, type); + } + else { + d_in.read(val, num * width); + if (d_twiddle_bytes) + m_twidle_vector_elements(val, num, width); + } +} + +void +DAP4StreamUnMarshaller::get_varying_vector( char **val, unsigned int &num ) +{ + get_opaque(val, num); +} + +void +DAP4StreamUnMarshaller::get_varying_vector( char **val, unsigned int &num, int width, Type type ) +{ + num = get_length_prefix(); + + int size = num * width; + *val = new char[size]; + + if (type == dods_float32_c && !std::numeric_limits::is_iec559) { + m_deserialize_reals(*val, num, 4, type); + } + else if (type == dods_float64_c && !std::numeric_limits::is_iec559) { + m_deserialize_reals(*val, num, 8, type); + } + else { + d_in.read(*val, size); + if (d_twiddle_bytes) + m_twidle_vector_elements(*val, num, width); + } +} + +void +DAP4StreamUnMarshaller::dump(ostream &strm) const +{ + strm << DapIndent::LMarg << "DAP4StreamUnMarshaller::dump - (" + << (void *)this << ")" << endl ; +} + +} // namespace libdap + diff -Nru libdap-3.11.1/DAP4StreamUnMarshaller.h libdap-3.12.0/DAP4StreamUnMarshaller.h --- libdap-3.11.1/DAP4StreamUnMarshaller.h 1970-01-01 00:00:00.000000000 +0000 +++ libdap-3.12.0/DAP4StreamUnMarshaller.h 2013-10-17 21:27:40.000000000 +0000 @@ -0,0 +1,144 @@ +// DAP4StreamUnMarshaller.h + +// -*- mode: c++; c-basic-offset:4 -*- + +// This file is part of libdap, A C++ implementation of the OPeNDAP Data +// Access Protocol. + +// Copyright (c) 2012 OPeNDAP, Inc. +// Author: James Gallagher +// +// This library is free software; you can redistribute it and/or +// modify it under the terms of the GNU Lesser General Public +// License as published by the Free Software Foundation; either +// version 2.1 of the License, or (at your option) any later version. +// +// This library 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 +// Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, write to the Free Software +// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA +// +// You can contact OPeNDAP, Inc. at PO Box 112, Saunderstown, RI. 02874-0112. + +#ifndef I_DAP4StreamUnMarshaller_h +#define I_DAP4StreamUnMarshaller_h 1 + +#include + +using std::istream ; +using std::cin ; + +#include "UnMarshaller.h" +#include "BaseType.h" +#include "XDRUtils.h" + +namespace libdap +{ + +class Vector; + +/** @brief Read data from the stream made by DAP4StreamMarshaller. + */ +class DAP4StreamUnMarshaller: public UnMarshaller { +public: + const static unsigned int c_md5_length = 16; + +private: + istream &d_in; + bool d_twiddle_bytes; + + // These are used for reals that need to be converted from IEEE 754 + XDR d_source; + dods_float64 d_buf; + + DAP4StreamUnMarshaller(); +#if 0 + : d_in(cin) { + throw InternalErr( __FILE__, __LINE__, "not implemented." ) ; + } +#endif + DAP4StreamUnMarshaller(const DAP4StreamUnMarshaller &); +#if 0 + : UnMarshaller(), d_in(cin) { + throw InternalErr( __FILE__, __LINE__, "not implemented." ) ; + } +#endif + + DAP4StreamUnMarshaller & operator=(const DAP4StreamUnMarshaller &); +#if 0 + { + throw InternalErr( __FILE__, __LINE__, "not implemented." ) ; + } +#endif + + void m_deserialize_reals(char *val, unsigned int num, int width, Type type); + void m_twidle_vector_elements(char *vals, unsigned int num, int width); + +public: + struct checksum { + unsigned char md[c_md5_length]; + }; + + DAP4StreamUnMarshaller(istream &in, bool is_stream_bigendian); + virtual ~DAP4StreamUnMarshaller(); + + checksum get_checksum(); + string get_checksum(checksum c); + + virtual void get_byte(dods_byte &val); + virtual void get_int8(dods_int8 &val); + + virtual void get_int16(dods_int16 &val); + virtual void get_int32(dods_int32 &val); + + virtual void get_int64(dods_int64 &val); + + virtual void get_float32(dods_float32 &val); + virtual void get_float64(dods_float64 &val); + + virtual void get_uint16(dods_uint16 &val); + virtual void get_uint32(dods_uint32 &val); + + virtual void get_uint64(dods_uint64 &val); + + virtual void get_str(string &val); + virtual void get_url(string &val); + + virtual void get_opaque(char *val, unsigned int len); + virtual void get_opaque(char **val, unsigned int &len); + + virtual void get_int(int &) { + throw InternalErr(__FILE__, __LINE__, "Not implemented for DAP4"); + } + + virtual dods_uint64 get_length_prefix(); + + // Note that DAP4 assumes clients know the size of arrays when they + // read the data; it's the 'varying' get methods that read & return the + // number of elements. These methods are here to appease the UnMarshaller + // 'interface' code + virtual void get_vector(char **, unsigned int &, Vector &) { + throw InternalErr(__FILE__, __LINE__, "Not implemented for DAP4"); + } + + virtual void get_vector(char **, unsigned int &, int, Vector & ) { + throw InternalErr(__FILE__, __LINE__, "Not implemented for DAP4"); + } + + virtual void get_vector(char *val, unsigned int num); + virtual void get_vector(char *val, unsigned int num, int width, Type type); + + virtual void get_varying_vector(char **val, unsigned int &num); + virtual void get_varying_vector(char **val, unsigned int &num, int width, Type type); + + virtual void dump(ostream &strm) const; +}; + +} // namespace libdap + +#endif // I_DAP4StreamUnMarshaller_h + diff -Nru libdap-3.11.1/DAS.cc libdap-3.12.0/DAS.cc --- libdap-3.11.1/DAS.cc 2011-04-29 13:19:43.000000000 +0000 +++ libdap-3.12.0/DAS.cc 2013-10-17 21:27:40.000000000 +0000 @@ -19,7 +19,7 @@ // // You should have received a copy of the GNU Lesser General Public // License along with this library; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA // // You can contact OPeNDAP, Inc. at PO Box 112, Saunderstown, RI. 02874-0112. @@ -36,11 +36,6 @@ #include "config.h" -static char rcsid[] not_used = - {"$Id: DAS.cc 24281 2011-03-09 00:22:31Z jimg $" - }; - - #include #ifdef HAVE_UNISTD_H @@ -70,8 +65,9 @@ extern void das_delete_buffer(void * buffer); extern void *das_buffer(FILE *fp); -extern void dasrestart(FILE *yyin); -extern int dasparse(void *arg); // defined in das.tab.c +//extern void dasrestart(FILE *yyin); +//extern int dasparse(void *arg); // defined in das.tab.c +extern int dasparse(libdap::parser_arg *arg); // defined in das.tab.c namespace libdap { @@ -109,24 +105,20 @@ * * @param cn container name */ -void -DAS::container_name( const string &cn ) +void DAS::container_name(const string &cn) { // We want to find a top level attribute table with the given name. So // set d_container to null first so that we aren't searching some // previous container - if( cn != _container_name ) - { - d_container = 0 ; - if( !cn.empty() ) - { - d_container = get_table( cn ) ; - if( !d_container ) - { - d_container = add_table( cn, new AttrTable ) ; - } - } - _container_name = cn; + if (cn != _container_name) { + d_container = 0; + if (!cn.empty()) { + d_container = get_table(cn); + if (!d_container) { + d_container = add_table(cn, new AttrTable); + } + } + _container_name = cn; } } @@ -147,66 +139,55 @@ * attribute tables for the current container. If not set then return the * number of current attribute tables in the outermost attribute table. */ -unsigned int -DAS::get_size() const +unsigned int DAS::get_size() const { - if( d_container ) - { - return d_container->get_size() ; + if (d_container) { + return d_container->get_size(); } - return d_attrs.get_size() ; + return d_attrs.get_size(); } /** @brief erase all attributes in this DAS */ -void -DAS::erase() +void DAS::erase() { - if( d_container ) - { - d_container->erase() ; + if (d_container) { + d_container->erase(); } - else - { - d_attrs.erase() ; + else { + d_attrs.erase(); } } /** @brief Returns a reference to the attribute table for the first variable. */ -AttrTable::Attr_iter -DAS::var_begin() +AttrTable::Attr_iter DAS::var_begin() { - if( d_container ) - { - return d_container->attr_begin() ; + if (d_container) { + return d_container->attr_begin(); } - return d_attrs.attr_begin() ; + return d_attrs.attr_begin(); } /** Returns a reference to the end of the attribute table. Does not * point to an attribute table. */ -AttrTable::Attr_iter -DAS::var_end() +AttrTable::Attr_iter DAS::var_end() { - if( d_container ) - { - return d_container->attr_end() ; + if (d_container) { + return d_container->attr_end(); } - return d_attrs.attr_end() ; + return d_attrs.attr_end(); } /** @brief Returns the name of the referenced variable attribute table. */ -string -DAS::get_name(AttrTable::Attr_iter &i) +string DAS::get_name(AttrTable::Attr_iter &i) { - if( d_container ) - { - return d_container->get_name( i ) ; + if (d_container) { + return d_container->get_name(i); } - return d_attrs.get_name( i ) ; + return d_attrs.get_name(i); } /** @brief Returns the referenced variable attribute table. @@ -214,23 +195,21 @@ AttrTable * DAS::get_table(AttrTable::Attr_iter &i) { - if( d_container ) - { - return d_container->get_attr_table( i ) ; + if (d_container) { + return d_container->get_attr_table(i); } - return d_attrs.get_attr_table( i ) ; + return d_attrs.get_attr_table(i); } /** @brief Returns the variable attribute table with the given name. */ AttrTable * -DAS::get_table( const string &name ) +DAS::get_table(const string &name) { - if( d_container ) - { - return d_container->get_attr_table( name ) ; + if (d_container) { + return d_container->get_attr_table(name); } - return d_attrs.get_attr_table( name ) ; + return d_attrs.get_attr_table(name); } //@} @@ -246,10 +225,9 @@ AttrTable * DAS::add_table( const string &name, AttrTable *at ) { - if( d_container ) - { - at->set_is_global_attribute( false ) ; - return d_container->append_container( at, name ) ; + if (d_container) { + at->set_is_global_attribute(false); + return d_container->append_container(at, name); } return d_attrs.append_container( at, name ) ; } @@ -335,7 +313,8 @@ parser_arg arg(this); - bool status = dasparse((void *) & arg) == 0; + //bool status = dasparse((void *) & arg) == 0; + bool status = dasparse(&arg) == 0; das_delete_buffer(buffer); diff -Nru libdap-3.11.1/DAS.h libdap-3.12.0/DAS.h --- libdap-3.11.1/DAS.h 2011-04-29 13:19:43.000000000 +0000 +++ libdap-3.12.0/DAS.h 2013-10-17 21:27:40.000000000 +0000 @@ -19,7 +19,7 @@ // // You should have received a copy of the GNU Lesser General Public // License along with this library; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA // // You can contact OPeNDAP, Inc. at PO Box 112, Saunderstown, RI. 02874-0112. @@ -42,8 +42,6 @@ #include #include -//#include "Pix.h" - #ifndef _attrtable_h #include "AttrTable.h" #endif @@ -127,12 +125,8 @@ string _container_name ; AttrTable d_attrs ; -protected: - //AttrTable *das_find(string name); - public: DAS(); - //DAS(AttrTable *attr_table, string name); virtual ~DAS(); @@ -146,11 +140,11 @@ * the top most dataset container attribute tables, if we have multiple * datasets being used to construct this DAS */ - virtual AttrTable *get_top_level_attributes() - { - if( d_container ) return d_container ; - return &d_attrs ; - } + virtual AttrTable *get_top_level_attributes() { + if (d_container) + return d_container; + return &d_attrs; + } virtual void erase() ; diff -Nru libdap-3.11.1/DDS.cc libdap-3.12.0/DDS.cc --- libdap-3.11.1/DDS.cc 2011-04-29 13:19:43.000000000 +0000 +++ libdap-3.12.0/DDS.cc 2013-10-17 21:27:40.000000000 +0000 @@ -18,7 +18,7 @@ // // You should have received a copy of the GNU Lesser General Public // License along with this library; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA // // You can contact OPeNDAP, Inc. at PO Box 112, Saunderstown, RI. 02874-0112. @@ -33,11 +33,8 @@ #include "config.h" -static char rcsid[] not_used = - {"$Id: DDS.cc 24370 2011-03-28 16:21:32Z jimg $" - }; - #include +#include #include #ifdef WIN32 @@ -85,20 +82,26 @@ #include "escaping.h" +const string c_xml_xsi = "http://www.w3.org/2001/XMLSchema-instance"; +const string c_xml_namespace = "http://www.w3.org/XML/1998/namespace"; + +const string grddl_transformation_dap32 = "http://xml.opendap.org/transforms/ddxToRdfTriples.xsl"; + const string c_default_dap20_schema_location = "http://xml.opendap.org/dap/dap2.xsd"; const string c_default_dap32_schema_location = "http://xml.opendap.org/dap/dap3.2.xsd"; +const string c_default_dap40_schema_location = "http://xml.opendap.org/dap/dap4.0.xsd"; const string c_dap20_namespace = "http://xml.opendap.org/ns/DAP2"; const string c_dap32_namespace = "http://xml.opendap.org/ns/DAP/3.2#"; +const string c_dap40_namespace = "http://xml.opendap.org/ns/DAP/4.0#"; -const string grddl_transformation_dap32 = "http://xml.opendap.org/transforms/ddxToRdfTriples.xsl"; - -const string c_xml_namespace = "http://www.w3.org/XML/1998/namespace"; +const string c_dap_20_n_sl = c_dap20_namespace + " " + c_default_dap20_schema_location; +const string c_dap_32_n_sl = c_dap32_namespace + " " + c_default_dap32_schema_location; +const string c_dap_40_n_sl = c_dap40_namespace + " " + c_default_dap40_schema_location; using namespace std; -void ddsrestart(FILE *yyin); // Defined in dds.tab.c -int ddsparse(void *arg); +int ddsparse(libdap::parser_arg *arg); // Glue for the DDS parser defined in dds.lex void dds_switch_to_buffer(void *new_buffer); @@ -111,18 +114,48 @@ DDS::duplicate(const DDS &dds) { DBG(cerr << "Entering DDS::duplicate... " < vars; // Variables at the top level + + int d_timeout; // alarm time in seconds. If greater than + // zero, raise the alarm signal if more than + // d_timeout seconds are spent reading data. + Keywords d_keywords; // Holds keywords parsed from the CE + + long d_max_response_size; // In bytes +#endif d_factory = dds.d_factory; + + d_name = dds.d_name; + d_filename = dds.d_filename; + d_container_name = dds.d_container_name; d_container = dds.d_container; + d_dap_major = dds.d_dap_major; d_dap_minor = dds.d_dap_minor; - d_keywords = dds.d_keywords; // value copy; Keywords contains no pointers + d_dap_version = dds.d_dap_version; // String version of the protocol + d_request_xml_base = dds.d_request_xml_base; + d_namespace = dds.d_namespace; + + d_attr = dds.d_attr; DDS &dds_tmp = const_cast(dds); @@ -130,26 +163,64 @@ for (Vars_iter i = dds_tmp.var_begin(); i != dds_tmp.var_end(); i++) { add_var(*i); // add_var() dups the BaseType. } + + d_timeout = dds.d_timeout; + + d_keywords = dds.d_keywords; // value copy; Keywords contains no pointers + + d_max_response_size = dds.d_max_response_size; } -/** Make a DDS which uses the given BaseTypeFactory to create variables. - @param n The name of the dataset. Can also be set using the - set_dataset_name() method. - @param factory BaseTypeFactory which instantiates Byte, ..., Grid. The - caller is responsible for freeing the object \e after deleting this DDS. - Can also be set using set_factory(). Never delete until just before - deleting the DDS itself unless you intend to replace the factory with a - new instance. - @param n The name of the data set. Can also be set using - set_dataset_name(). */ -DDS::DDS(BaseTypeFactory *factory, const string &n) - - : d_factory(factory), name(n), d_container(0), - d_dap_major(2), d_dap_minor(0), - d_request_xml_base(""), d_timeout(0), d_keywords() -{ - DBG(cerr << "Building a DDS with client major/minor: " - << d_dap_major << "." << d_dap_minor << endl); +//FIXME says 3.2 when it's 2.0 +/** + * Make a DDS which uses the given BaseTypeFactory to create variables. + * + * @note The default DAP version is 3.2 - this is really DAP2 with a handful + * of enhancements that our WCS software relies on. + * + * @param factory The BaseTypeFactory to use when creating instances of + * DAP variables. The caller must ensure the factory's lifetime is at least + * that of the DDS instance. + * @param name The name of the DDS - usually derived from the name of the + * pathname or table name of the dataset. + */ +DDS::DDS(BaseTypeFactory *factory, const string &name) + : d_factory(factory), d_name(name), d_container_name(""), d_container(0), + d_request_xml_base(""), + d_timeout(0), d_keywords(), d_max_response_size(0) +{ + DBG(cerr << "Building a DDS for the default version (3.2)" << endl); + + // This method sets a number of values, including those returned by + // get_protocol_major(), ..., get_namespace(). + set_dap_version("2.0"); +} + +/** + * Make a DDS with the DAP protocol set to a specific value. This method + * provides an easy way to build DDS objects for use in a server or client + * that will process DAP4, for example. It's roughly equivalent to calling + * set_dap_version() after making an instance using + * DDS::DDS(BaseTypeFactory *, const string &). + * + * @param factory The BaseTypeFactory to use when creating instances of + * DAP variables. The caller must ensure the factory's lifetime is at least + * that of the DDS instance. + * @param name The name of the DDS - usually derived from the name of the + * pathname or table name of the dataset. + * @param version The DAP version to support. This sets the DAP version, as + * well as a number of other dependent constants. + */ +DDS::DDS(BaseTypeFactory *factory, const string &name, const string &version) + : d_factory(factory), d_name(name), d_container_name(""), d_container(0), + d_request_xml_base(""), + d_timeout(0), d_keywords(), d_max_response_size(0) +{ + DBG(cerr << "Building a DDS for version: " << version << endl); + + // This method sets a number of values, including those returned by + // get_protocol_major(), ..., get_namespace(). + set_dap_version(version); } /** The DDS copy constructor. */ @@ -195,68 +266,73 @@ * * @param das Transfer (copy) attributes from this DAS object. */ -void -DDS::transfer_attributes(DAS *das) -{ - // If there is a container set in the DDS then get the container from - // the DAS. If they are not the same container, then throw an exception - // (should be working on the same container). If the container does not - // exist in the DAS, then throw an exception - if( d_container ) { - if( das->container_name() != d_container_name ) - throw InternalErr(__FILE__, __LINE__, "Error transferring attributes: working on a container in dds, but not das" ) ; - } - - // Give each variable a chance to claim its attributes. - AttrTable *top_level = das->get_top_level_attributes() ; - - Vars_iter var = var_begin(); - while (var != var_end()) { - (*var)->transfer_attributes(top_level); - var++; - } - - // Now we transfer all of the attributes still marked as global to the - // global container in the DDS. - - AttrTable::Attr_iter at_cont_p = top_level->attr_begin(); - while (at_cont_p != top_level->attr_end()) { - // In truth, all of the top level attributes should be containers, but - // this test handles the abnormal case where somehow someone makes a - // top level attribute that is not a container by silently dropping it. - if ((*at_cont_p)->type == Attr_container - && (*at_cont_p)->attributes->is_global_attribute()) { - DBG(cerr << (*at_cont_p)->name << " is a global attribute." << endl); - // copy the source container so that the DAS passed in can be - // deleted after calling htis method. - AttrTable *at = new AttrTable(*(*at_cont_p)->attributes); - d_attr.append_container(at, at->get_name()); +void DDS::transfer_attributes(DAS *das) { + // If there is a container set in the DDS then get the container from + // the DAS. If they are not the same container, then throw an exception + // (should be working on the same container). If the container does not + // exist in the DAS, then throw an exception + if (d_container) { + if (das->container_name() != d_container_name) + throw InternalErr(__FILE__, __LINE__, + "Error transferring attributes: working on a container in dds, but not das"); } - at_cont_p++; - } + // Give each variable a chance to claim its attributes. + AttrTable *top_level = das->get_top_level_attributes(); + + Vars_iter var = var_begin(); + while (var != var_end()) { + try { + DBG(cerr << "Processing the attributes for: " << (*var)->d_name() << " a " << (*var)->type_name() << endl); + (*var)->transfer_attributes(top_level); + var++; + } catch (Error &e) { + DBG(cerr << "Got this exception: " << e.get_error_message() << endl); + var++; + throw e; + } + } + + // Now we transfer all of the attributes still marked as global to the + // global container in the DDS. + + AttrTable::Attr_iter at_cont_p = top_level->attr_begin(); + while (at_cont_p != top_level->attr_end()) { + // In truth, all of the top level attributes should be containers, but + // this test handles the abnormal case where somehow someone makes a + // top level attribute that is not a container by silently dropping it. + if ((*at_cont_p)->type == Attr_container && (*at_cont_p)->attributes->is_global_attribute()) { + DBG(cerr << (*at_cont_p)->d_name << " is a global attribute." << endl); + // copy the source container so that the DAS passed in can be + // deleted after calling this method. + AttrTable *at = new AttrTable(*(*at_cont_p)->attributes); + d_attr.append_container(at, at->get_name()); + } + + at_cont_p++; + } } -/** Get and set the dataset's name. This is the name of the dataset - itself, and is not to be confused with the name of the file or +/** Get and set the dataset's d_name. This is the d_name of the dataset + itself, and is not to be confused with the d_name of the file or disk on which it is stored. - @name Dataset Name Accessors */ + @d_name Dataset Name Accessors */ //@{ -/** Returns the dataset's name. */ +/** Returns the dataset's d_name. */ string DDS::get_dataset_name() const { - return name; + return d_name; } -/** Sets the dataset name. */ +/** Sets the dataset d_name. */ void DDS::set_dataset_name(const string &n) { - name = n; + d_name = n; } //@} @@ -269,14 +345,14 @@ } /** Get and set the dataset's filename. This is the physical - location on a disk where the dataset exists. The dataset name + location on a disk where the dataset exists. The dataset d_name is simply a title. - @name File Name Accessor + @d_name File Name Accessor @see Dataset Name Accessors */ //@{ -/** Gets the dataset file name. */ +/** Gets the dataset file d_name. */ string DDS::filename() { @@ -291,6 +367,9 @@ } //@} +/** + * @deprecated + */ void DDS::set_dap_major(int p) { @@ -307,6 +386,9 @@ } } +/** + * @deprecated + */ void DDS::set_dap_minor(int p) { @@ -319,83 +401,95 @@ } } -/** Given the dap protocol version either from a MIME header or from within - the DDX Dataset element, parse that string and set the DDS fields. - - @param version_string The version string from the MIME (request) or XML - document. +/** + * Given the DAP protocol version, parse that string and set the DDS fields. + * + * @param v The version string. */ void -DDS::set_dap_version(const string &version_string) +DDS::set_dap_version(const string &v /* = "2.0" */) { - istringstream iss(version_string); + istringstream iss(v); int major = -1, minor = -1; char dot; if (!iss.eof() && !iss.fail()) - iss >> major; + iss >> major; if (!iss.eof() && !iss.fail()) - iss >> dot; + iss >> dot; if (!iss.eof() && !iss.fail()) - iss >> minor; + iss >> minor; - DBG(cerr << "Major: " << major << ", dot: " << dot <<", Minor: " << minor << endl); -#if 0 - if (major == -1 || minor == -1) - throw Error("Could not parse the client dap (XDAP-Accept header) value"); -#endif + if (major == -1 || minor == -1 or dot != '.') + throw InternalErr(__FILE__, __LINE__, "Could not parse dap version. Value given: " + v); - d_dap_version = version_string; + d_dap_version = v; - set_dap_major(major == -1 ? 2 : major); - set_dap_minor(minor == -1 ? 0 : minor); + d_dap_major = major; + d_dap_minor = minor; + + // Now set the related XML constants. These might be overwritten if + // the DDS instance is being built from a document parse, but if it's + // being constructed by a server the code to generate the XML document + // needs these values to match the DAP version information. + switch (d_dap_major) { + case 2: + d_namespace = c_dap20_namespace; + break; + case 3: + d_namespace = c_dap32_namespace; + break; + case 4: + d_namespace = c_dap40_namespace; + break; + default: + throw InternalErr(__FILE__, __LINE__, "Unknown DAP version."); + } } -/** Given the dap protocol version, parse that string and set the DDS fields. - This version of th method takes a double - a value that would be passed - to a server-side function. This provides a way to set the protocol using - stuff in the URL. - - @param d The protocol version requested by the client, as a double. +/** Old way to set the DAP version. + * + * @note Don't use this - two interfaces to set the version number is overkill + * + * @param d The protocol version requested by the client, as a double. + * @deprecated */ void DDS::set_dap_version(double d) { - int major = d; + int major = floor(d); int minor = (d-major)*10; DBG(cerr << "Major: " << major << ", Minor: " << minor << endl); ostringstream oss; oss << major << "." << minor; - d_dap_version = oss.str(); - set_dap_major(major); - set_dap_minor(minor); + set_dap_version(oss.str()); } /** Get and set the current container. If there are multiple files being used to build this DDS, using a container will set a virtual structure for the current container. - @name Container Name Accessor + @d_name Container Name Accessor @see Dataset Name Accessors */ //@{ -/** Gets the dataset file name. */ +/** Gets the dataset file d_name. */ string DDS::container_name() { return d_container_name; } -/** Set the current container name and get or create a structure for that - * name. */ +/** Set the current container d_name and get or create a structure for that + * d_name. */ void DDS::container_name(const string &cn) { // we want to search the DDS for the top level structure with the given - // name. Set the container to null so that we don't search some previous + // d_name. Set the container to null so that we don't search some previous // container. d_container = 0 ; if( !cn.empty() ) @@ -427,42 +521,92 @@ //@} +/** Get the size of a response. This method looks at the variables in the DDS + * a computes the number of bytes in the response. + * + * @note This version of the method does a poor job with Sequences. A better + * implementation would look at row-constraint-based limitations and use them + * for size computations. If a row-constraint is missing, return an error. + * + * @param constrained Should the size of the whole DDS be used or should the + * current constraint be taken into account? + */ +int +DDS::get_request_size(bool constrained) +{ + int w = 0; + for (Vars_iter i = vars.begin(); i != vars.end(); i++) { + if (constrained) { + if ((*i)->send_p()) + w += (*i)->width(constrained); + } + else { + w += (*i)->width(constrained); + } + } + + return w; +} + /** @brief Adds a copy of the variable to the DDS. Using the ptr_duplicate() method, perform a deep copy on the variable \e bt and adds the result to this DDS. @note The copy will not copy data values. @param bt Source variable. */ -void -DDS::add_var(BaseType *bt) -{ +void DDS::add_var(BaseType *bt) { if (!bt) - throw InternalErr(__FILE__, __LINE__, - "Trying to add a BaseType object with a NULL pointer."); - + throw InternalErr(__FILE__, __LINE__, "Trying to add a BaseType object with a NULL pointer."); +#if 0 + if (bt->is_dap4_only_type()) + throw InternalErr(__FILE__, __LINE__, "Attempt to add a DAP4 type to a DAP2 DDS."); +#endif DBG2(cerr << "In DDS::add_var(), bt's address is: " << bt << endl); BaseType *btp = bt->ptr_duplicate(); DBG2(cerr << "In DDS::add_var(), btp's address is: " << btp << endl); - if( d_container ) - { + if (d_container) { // Mem leak fix [mjohnson nov 2009] // Structure::add_var() creates ANOTHER copy. - d_container->add_var( bt ) ; - // So we need to delete btp or else it leaks - delete btp; btp = 0; + d_container->add_var(bt); + // So we need to delete btp or else it leaks + delete btp; + btp = 0; } - else - { - vars.push_back(btp); + else { + vars.push_back(btp); + } +} + +/** @brief Adds the variable to the DDS. + @param bt Source variable. */ +void +DDS::add_var_nocopy(BaseType *bt) +{ + if (!bt) + throw InternalErr(__FILE__, __LINE__, "Trying to add a BaseType object with a NULL pointer."); +#if 0 + //FIXME There's no longer a DAP2 and DAP4 DDS + if (bt->is_dap4_only_type()) + throw InternalErr(__FILE__, __LINE__, "Attempt to add a DAP4 type to a DAP2 DDS."); +#endif + + DBG2(cerr << "In DDS::add_var(), bt's address is: " << bt << endl); + + if (d_container) { + d_container->add_var_nocopy(bt); + } + else { + vars.push_back(bt); } } + /** Remove the named variable from the DDS. This method is not smart about looking up names. The variable must exist at the top level of the DDS and - must match \e exactly the name given. + must match \e exactly the d_name given. @note Invalidates any iterators that reference the contents of the DDS. - @param n The name of the variable to remove. */ + @param n The d_name of the variable to remove. */ void DDS::del_var(const string &n) { @@ -524,11 +668,11 @@ { return var(n, &s); } -/** @brief Find the variable with the given name. +/** @brief Find the variable with the given d_name. - Returns a pointer to the named variable. If the name contains one or + Returns a pointer to the named variable. If the d_name contains one or more field separators then the function looks for a variable whose - name matches exactly. If the name contains no field separators then + name matches exactly. If the d_name contains no field separators then the function looks first in the top level and then in all subsequent levels and returns the first occurrence found. In general, this function searches constructor types in the order in which they appear @@ -564,17 +708,17 @@ for (Vars_iter i = vars.begin(); i != vars.end(); i++) { BaseType *btp = *i; - DBG(cerr << "DDS::leaf_match: Looking for " << n << " in: " << btp->name() << endl); - // Look for the name in the dataset's top-level + DBG(cerr << "DDS::leaf_match: Looking for " << n << " in: " << btp->d_name() << endl); + // Look for the d_name in the dataset's top-level if (btp->name() == n) { - DBG(cerr << "Found " << n << " in: " << btp->name() << endl); + DBG(cerr << "Found " << n << " in: " << btp->d_name() << endl); return btp; } if (btp->is_constructor_type()) { BaseType *found = btp->var(n, false, s); if (found) { - DBG(cerr << "Found " << n << " in: " << btp->name() << endl); + DBG(cerr << "Found " << n << " in: " << btp->d_name() << endl); return found; } } @@ -583,7 +727,7 @@ s->push(btp); BaseType *found = btp->var()->var(n, false, s); if (found) { - DBG(cerr << "Found " << n << " in: " << btp->var()->name() << endl); + DBG(cerr << "Found " << n << " in: " << btp->var()->d_name() << endl); return found; } } @@ -598,10 +742,10 @@ { for (Vars_iter i = vars.begin(); i != vars.end(); i++) { BaseType *btp = *i; - DBG2(cerr << "Looking for " << name << " in: " << btp << endl); - // Look for the name in the current ctor type or the top level + DBG2(cerr << "Looking for " << d_name << " in: " << btp << endl); + // Look for the d_name in the current ctor type or the top level if (btp->name() == name) { - DBG2(cerr << "Found " << name << " in: " << btp << endl); + DBG2(cerr << "Found " << d_name << " in: " << btp << endl); return btp; } } @@ -668,6 +812,37 @@ return *(vars.begin() + i); } +/** Insert a copy of the BaseType before the position given. + * @param i The iterator that marks the position + * @param ptr The BaseType object to copy and insert + */ +void +DDS::insert_var(Vars_iter i, BaseType *ptr) +{ +#if 0 + if (ptr->is_dap4_only_type()) + throw InternalErr(__FILE__, __LINE__, "Attempt to add a DAP4 type to a DAP2 DDS."); +#endif + vars.insert(i, ptr->ptr_duplicate()); +} + +/** Insert the BaseType before the position given. + * @note Does not copy the BaseType object - that caller must not + * free the inserted object's pointer. This object will, however, + * delete the pointer when it is deleted. + * @param i The iterator that marks the position + * @param ptr The BaseType object to insert + */ +void +DDS::insert_var_nocopy(Vars_iter i, BaseType *ptr) +{ +#if 0 + if (ptr->is_dap4_only_type()) + throw InternalErr(__FILE__, __LINE__, "Attempt to add a DAP4 type to a DAP2 DDS."); +#endif + vars.insert(i, ptr); +} + /** @brief Returns the number of variables in the DDS. */ int DDS::num_var() @@ -717,7 +892,7 @@ } } -/** @brief Parse a DDS from a file with the given name. */ +/** @brief Parse a DDS from a file with the given d_name. */ void DDS::parse(string fname) { @@ -780,7 +955,7 @@ parser_arg arg(this); - bool status = ddsparse((void *) & arg) == 0; + bool status = ddsparse(&arg) == 0; dds_delete_buffer(buffer); @@ -794,46 +969,52 @@ } } -#if FILE_METHODS /** @brief Print the entire DDS to the specified file. */ void DDS::print(FILE *out) { -#if 0 ostringstream oss; print(oss); + fwrite(oss.str().data(), sizeof(char), oss.str().length(), out); +} - fwrite(oss.str().c_str(), oss.str().length(), 1, out); -#else - fprintf(out, "Dataset {\n") ; +/** @brief Print the entire DDS to the specified ostream. */ +void +DDS::print(ostream &out) +{ + out << "Dataset {\n" ; for (Vars_citer i = vars.begin(); i != vars.end(); i++) { (*i)->print_decl(out) ; } - fprintf(out, "} %s;\n", id2www(name).c_str()) ; + out << "} " << id2www(d_name) << ";\n" ; return ; -#endif } -#endif -/** @brief Print the entire DDS to the specified ostream. */ +/** + * Print the DAP2 DAS object using attribute information recorded + * this DDS object. + * + * @note Uses default indenting of four spaces and does not follow + * (now deprecated) attribute aliases. + * + * @param out Write the DAS here. + */ void -DDS::print(ostream &out) +DDS::print_das(ostream &out) { - out << "Dataset {\n" ; + out << "Attributes {\n" ; + d_attr.print(out, " "); for (Vars_citer i = vars.begin(); i != vars.end(); i++) { - (*i)->print_decl(out) ; + (*i)->get_attr_table().print(out, " "); } - out << "} " << id2www(name) << ";\n" ; - - return ; + out << "}\n" ; } -#if FILE_METHODS /** @brief Print a constrained DDS to the specified file. Print those parts (variables) of the DDS structure to OS that @@ -847,20 +1028,10 @@ void DDS::print_constrained(FILE *out) { - fprintf(out, "Dataset {\n") ; - - for (Vars_citer i = vars.begin(); i != vars.end(); i++) { - // for each variable, indent with four spaces, print a trailing - // semicolon, do not print debugging information, print only - // variables in the current projection. - (*i)->print_decl(out, " ", true, false, true) ; - } - - fprintf(out, "} %s;\n", id2www(name).c_str()) ; - - return; + ostringstream oss; + print_constrained(oss); + fwrite(oss.str().data(), sizeof(char), oss.str().length(), out); } -#endif /** @brief Print a constrained DDS to the specified ostream. @@ -884,26 +1055,11 @@ (*i)->print_decl(out, " ", true, false, true) ; } - out << "} " << id2www(name) << ";\n" ; + out << "} " << id2www(d_name) << ";\n" ; return; } -#if FILE_METHODS -class VariablePrintXML : public unary_function -{ - FILE *d_out; - bool d_constrained; -public: - VariablePrintXML(FILE *out, bool constrained) - : d_out(out), d_constrained(constrained) - {} - void operator()(BaseType *bt) - { - bt->print_xml(d_out, " ", d_constrained); - } -}; - /** Print an XML representation of this DDS. This method is used to generate the part of the DDX response. The \c Dataset tag is \e not written by this code. The caller of this method must handle writing that and @@ -913,144 +1069,268 @@ @param constrained True if the output should be limited to just those variables that are in the projection of the current constraint expression. - @param blob The dataBLOB href. */ + @param blob The dataBLOB href. + @deprecated */ void DDS::print_xml(FILE *out, bool constrained, const string &blob) { - fprintf(out, "\n"); + ostringstream oss; + print_xml_writer(oss, constrained, blob); + fwrite(oss.str().data(), 1, oss.str().length(), out); +} - fprintf(out, " +{ + XMLWriter &d_xml; + bool d_constrained; +public: + VariablePrintXMLWriter(XMLWriter &xml, bool constrained) + : d_xml(xml), d_constrained(constrained) + {} + void operator()(BaseType *bt) + { + bt->print_xml_writer(d_xml, d_constrained); + } +}; - // Are we responding to a 3.2 or 2.0 client? We will have to improve on - // this at some point... jhrg - if (get_dap_major() == 3 && get_dap_minor() == 2) { - fprintf(out, "xmlns=\"%s\"\n", c_dap32_namespace.c_str()); +/** + * Print the DDX. This code uses the libxml2 'TextWriter' interface; something + * that seems to be a good compromise between doing it by hand (although more + * verbose it is also more reliable) and DOM. + * + * @note This code handles several different versions of DAP in a fairly + * crude way. I've broken it up into three different responses: DAP2, DAP3.2 + * and DAP4. + * + * @param out Write the XML to this output sink + * @param constrained True if the only variables to print are those in the + * current projection. If true, this will also suppress printing attributes. + * @param blob This is an href (DAP2) or a cid (DAP3.4 and 4). The href + * points to the binary data; the cid is the M-MIME separator for the binary + * data. + */ +void +DDS::print_xml_writer(ostream &out, bool constrained, const string &blob) +{ + XMLWriter xml(" "); - fprintf(out, "xsi:schemaLocation=\"%s %s\">\n\n", - c_dap32_namespace.c_str(), c_default_dap32_schema_location.c_str()); - } - else { - fprintf(out, "xmlns=\"%s\"\n", c_dap20_namespace.c_str()); - fprintf(out, "xsi:schemaLocation=\"%s %s\">\n\n", - c_dap20_namespace.c_str(), c_default_dap20_schema_location.c_str()); - } + // Stamp and repeat for these sections; trying to economize is makes it + // even more confusing + if (get_dap_major() >= 4) { + if (xmlTextWriterStartElement(xml.get_writer(), (const xmlChar*) "Group") < 0) + throw InternalErr(__FILE__, __LINE__, "Could not write Group element"); + if (xmlTextWriterWriteAttribute(xml.get_writer(), (const xmlChar*) "name", (const xmlChar*)d_name.c_str()) < 0) + throw InternalErr(__FILE__, __LINE__, "Could not write attribute for name"); + if (xmlTextWriterWriteAttribute(xml.get_writer(), (const xmlChar*) "dapVersion", (const xmlChar*)get_dap_version().c_str()) < 0) + throw InternalErr(__FILE__, __LINE__, "Could not write attribute for dapVersion"); - d_attr.print_xml(out, " ", constrained); + if (!get_request_xml_base().empty()) { + if (xmlTextWriterWriteAttribute(xml.get_writer(), (const xmlChar*) "xmlns:xml", (const xmlChar*)c_xml_namespace.c_str()) < 0) + throw InternalErr(__FILE__, __LINE__, "Could not write attribute for xmlns:xml"); - fprintf(out, "\n"); + if (xmlTextWriterWriteAttribute(xml.get_writer(), (const xmlChar*) "xml:base", (const xmlChar*)get_request_xml_base().c_str()) < 0) + throw InternalErr(__FILE__, __LINE__, "Could not write attribute for xml:base"); + } + if (!get_namespace().empty()) { + if (xmlTextWriterWriteAttribute(xml.get_writer(), (const xmlChar*) "xmlns", (const xmlChar*)get_namespace().c_str()) < 0) + throw InternalErr(__FILE__, __LINE__, "Could not write attribute for xmlns"); + } + } + else if (get_dap_major() == 3 && get_dap_minor() >= 2) { + if (xmlTextWriterStartElement(xml.get_writer(), (const xmlChar*) "Dataset") < 0) + throw InternalErr(__FILE__, __LINE__, "Could not write Dataset element"); + if (xmlTextWriterWriteAttribute(xml.get_writer(), (const xmlChar*) "name", (const xmlChar*)d_name.c_str()) < 0) + throw InternalErr(__FILE__, __LINE__, "Could not write attribute for name"); + if (xmlTextWriterWriteAttribute(xml.get_writer(), (const xmlChar*) "xmlns:xsi", (const xmlChar*)"http://www.w3.org/2001/XMLSchema-instance") < 0) + throw InternalErr(__FILE__, __LINE__, "Could not write attribute for xmlns:xsi"); + + if (xmlTextWriterWriteAttribute(xml.get_writer(), (const xmlChar*) "xsi:schemaLocation", (const xmlChar*)c_dap_32_n_sl.c_str()) < 0) + throw InternalErr(__FILE__, __LINE__, "Could not write attribute for xmlns:schemaLocation"); + + if (xmlTextWriterWriteAttribute(xml.get_writer(), (const xmlChar*) "xmlns:grddl", (const xmlChar*)"http://www.w3.org/2003/g/data-view#") < 0) + throw InternalErr(__FILE__, __LINE__, "Could not write attribute for xmlns:grddl"); + + if (xmlTextWriterWriteAttribute(xml.get_writer(), (const xmlChar*) "grddl:transformation", (const xmlChar*)grddl_transformation_dap32.c_str()) < 0) + throw InternalErr(__FILE__, __LINE__, "Could not write attribute for xmlns:transformation"); + + if (xmlTextWriterWriteAttribute(xml.get_writer(), (const xmlChar*) "xmlns", (const xmlChar*)c_dap32_namespace.c_str()) < 0) + throw InternalErr(__FILE__, __LINE__, "Could not write attribute for xmlns"); + if (xmlTextWriterWriteAttribute(xml.get_writer(), (const xmlChar*) "xmlns:dap", (const xmlChar*)c_dap32_namespace.c_str()) < 0) + throw InternalErr(__FILE__, __LINE__, "Could not write attribute for xmlns:dap"); - for_each(var_begin(), var_end(), VariablePrintXML(out, constrained)); + if (xmlTextWriterWriteAttribute(xml.get_writer(), (const xmlChar*) "dapVersion", (const xmlChar*)"3.2") < 0) + throw InternalErr(__FILE__, __LINE__, "Could not write attribute for dapVersion"); - fprintf(out, "\n"); + if (!get_request_xml_base().empty()) { + if (xmlTextWriterWriteAttribute(xml.get_writer(), (const xmlChar*) "xmlns:xml", (const xmlChar*)c_xml_namespace.c_str()) < 0) + throw InternalErr(__FILE__, __LINE__, "Could not write attribute for xmlns:xml"); - // Only print this for the 2.0, 3.0 and 3.1 versions - which are essentially - // the same. jhrg - if (get_dap_major() == 2 && get_dap_minor() == 0) { - fprintf(out, " \n"); + if (xmlTextWriterWriteAttribute(xml.get_writer(), (const xmlChar*) "xml:base", (const xmlChar*)get_request_xml_base().c_str()) < 0) + throw InternalErr(__FILE__, __LINE__, "Could not write attribute for xml:base"); + } } - else if (!blob.empty() - && (get_dap_major() == 3 && get_dap_minor() >= 2) - || get_dap_major() >= 4) { - fprintf(out, " \n", blob.c_str()); + else { // dap2 + if (xmlTextWriterStartElement(xml.get_writer(), (const xmlChar*) "Dataset") < 0) + throw InternalErr(__FILE__, __LINE__, "Could not write Dataset element"); + if (xmlTextWriterWriteAttribute(xml.get_writer(), (const xmlChar*) "name", (const xmlChar*)d_name.c_str()) < 0) + throw InternalErr(__FILE__, __LINE__, "Could not write attribute for d_name"); + if (xmlTextWriterWriteAttribute(xml.get_writer(), (const xmlChar*) "xmlns:xsi", (const xmlChar*)"http://www.w3.org/2001/XMLSchema-instance") < 0) + throw InternalErr(__FILE__, __LINE__, "Could not write attribute for xmlns:xsi"); + + if (xmlTextWriterWriteAttribute(xml.get_writer(), (const xmlChar*) "xmlns", (const xmlChar*)c_dap20_namespace.c_str()) < 0) + throw InternalErr(__FILE__, __LINE__, "Could not write attribute for xmlns"); + + if (xmlTextWriterWriteAttribute(xml.get_writer(), (const xmlChar*) "xsi:schemaLocation", (const xmlChar*)c_dap_20_n_sl.c_str()) < 0) + throw InternalErr(__FILE__, __LINE__, "Could not write attribute for xmlns:schemaLocation"); } + // Print the global attributes + d_attr.print_xml_writer(xml); - fprintf(out, "\n"); -} -#endif + // Print each variable + for_each(var_begin(), var_end(), VariablePrintXMLWriter(xml, constrained)); -class VariablePrintXMLStrm : public unary_function -{ - ostream &d_out; - bool d_constrained; -public: - VariablePrintXMLStrm(ostream &out, bool constrained) - : d_out(out), d_constrained(constrained) - {} - void operator()(BaseType *bt) - { - bt->print_xml(d_out, " ", d_constrained); + // For DAP 3.2 and greater, use the new syntax and value. The 'blob' is + // the CID of the MIME part that holds the data. For DAP2 (which includes + // 3.0 and 3.1), the blob is an href. For DAP4, only write the CID if it's + // given. + if (get_dap_major() >= 4) { + if (!blob.empty()) { + if (xmlTextWriterStartElement(xml.get_writer(), (const xmlChar*) "blob") < 0) + throw InternalErr(__FILE__, __LINE__, "Could not write blob element"); + string cid = "cid:" + blob; + if (xmlTextWriterWriteAttribute(xml.get_writer(), (const xmlChar*) "href", (const xmlChar*) cid.c_str()) < 0) + throw InternalErr(__FILE__, __LINE__, "Could not write attribute for d_name"); + if (xmlTextWriterEndElement(xml.get_writer()) < 0) + throw InternalErr(__FILE__, __LINE__, "Could not end blob element"); + } + } + else if (get_dap_major() == 3 && get_dap_minor() >= 2) { + if (xmlTextWriterStartElement(xml.get_writer(), (const xmlChar*) "blob") < 0) + throw InternalErr(__FILE__, __LINE__, "Could not write blob element"); + string cid = "cid:" + blob; + if (xmlTextWriterWriteAttribute(xml.get_writer(), (const xmlChar*) "href", (const xmlChar*) cid.c_str()) < 0) + throw InternalErr(__FILE__, __LINE__, "Could not write attribute for d_name"); + if (xmlTextWriterEndElement(xml.get_writer()) < 0) + throw InternalErr(__FILE__, __LINE__, "Could not end blob element"); + } + else { // dap2 + if (xmlTextWriterStartElement(xml.get_writer(), (const xmlChar*) "dataBLOB") < 0) + throw InternalErr(__FILE__, __LINE__, "Could not write dataBLOB element"); + if (xmlTextWriterWriteAttribute(xml.get_writer(), (const xmlChar*) "href", (const xmlChar*) "") < 0) + throw InternalErr(__FILE__, __LINE__, "Could not write attribute for d_name"); + if (xmlTextWriterEndElement(xml.get_writer()) < 0) + throw InternalErr(__FILE__, __LINE__, "Could not end dataBLOB element"); } -}; -/** Print an XML representation of this DDS. This method is used to generate - the part of the DDX response. The \c Dataset tag is \e not written by - this code. The caller of this method must handle writing that and - including the \c dataBLOB tag. + if (xmlTextWriterEndElement(xml.get_writer()) < 0) + throw InternalErr(__FILE__, __LINE__, "Could not end Dataset element"); - @param out Destination ostream. - @param constrained True if the output should be limited to just those - variables that are in the projection of the current constraint - expression. - @param blob The dataBLOB href. */ + out << xml.get_doc();// << ends;// << endl; +} + +/** + * Print the DAP4 DMR object. + * This method prints the DMR. If the dap version is not >= 4.0, it's an + * error to call this method. + * + * @note Calling methods that print the DDS or DDX when get_dap_major() + * returns a value >= 4 is undefined. Use this method to get the DAP4 + * metadata response. + * + * @param out Write the XML to this stream + * @param constrained Should the DMR be subject to a constraint? + */ void -DDS::print_xml(ostream &out, bool constrained, const string &blob) +DDS::print_dmr(ostream &out, bool constrained) { - out << "\n" ; + if (get_dap_major() < 4) + throw InternalErr(__FILE__, __LINE__, "Tried to print a DMR with DAP major version less than 4"); - out << "\n"; - } - else { - out << "xmlns=\"" << c_dap20_namespace << "\"\n" ; - out << "xsi:schemaLocation=\"" << c_dap20_namespace - << " " << c_default_dap20_schema_location << "\">\n\n" ; - } + if (xmlTextWriterWriteAttribute(xml.get_writer(), (const xmlChar*) "dmrVersion", (const xmlChar*) get_dmr_version().c_str()) < 0) + throw InternalErr(__FILE__, __LINE__, "Could not write attribute for dapVersion"); - d_attr.print_xml(out, " ", constrained); + if (!get_request_xml_base().empty()) { + if (xmlTextWriterWriteAttribute(xml.get_writer(), (const xmlChar*) "xml:base", + (const xmlChar*) get_request_xml_base().c_str()) < 0) + throw InternalErr(__FILE__, __LINE__, "Could not write attribute for xml:base"); + } - out << "\n" ; + if (xmlTextWriterWriteAttribute(xml.get_writer(), (const xmlChar*) "name", (const xmlChar*) d_name.c_str()) < 0) + throw InternalErr(__FILE__, __LINE__, "Could not write attribute for name"); - for_each(var_begin(), var_end(), VariablePrintXMLStrm(out, constrained)); + // Print the global attributes + d_attr.print_xml_writer(xml); - out << "\n" ; + // Print each variable + for_each(var_begin(), var_end(), VariablePrintXMLWriter(xml, constrained)); - // Only print this for the 2.0, 3.0 and 3.1 versions - which are essentially - // the same. +#if 0 // For DAP 3.2 and greater, use the new syntax and value. The 'blob' is - // actually the CID of the MIME part that holds the data. - if (get_dap_major() == 2 && get_dap_minor() == 0) { - out << " \n" ; - } - else if (!blob.empty() - && (get_dap_major() == 3 && get_dap_minor() >= 2) - || get_dap_major() >= 4) { - out << " \n"; + // the CID of the MIME part that holds the data. For DAP2 (which includes + // 3.0 and 3.1), the blob is an href. For DAP4, only write the CID if it's + // given. + if (get_dap_major() >= 4) { + if (!blob.empty()) { + if (xmlTextWriterStartElement(xml.get_writer(), (const xmlChar*) "blob") < 0) + throw InternalErr(__FILE__, __LINE__, "Could not write blob element"); + string cid = "cid:" + blob; + if (xmlTextWriterWriteAttribute(xml.get_writer(), (const xmlChar*) "href", (const xmlChar*) cid.c_str()) < 0) + throw InternalErr(__FILE__, __LINE__, "Could not write attribute for d_name"); + if (xmlTextWriterEndElement(xml.get_writer()) < 0) + throw InternalErr(__FILE__, __LINE__, "Could not end blob element"); + } } +#endif - out << "\n" ; + if (xmlTextWriterEndElement(xml.get_writer()) < 0) + throw InternalErr(__FILE__, __LINE__, "Could not end the top-level Group element"); + + out << xml.get_doc(); } // Used by DDS::send() when returning data from a function call. @@ -1071,14 +1351,14 @@ bool DDS::check_semantics(bool all) { - // The dataset must have a name - if (name == "") { - cerr << "A dataset must have a name" << endl; + // The dataset must have a d_name + if (d_name == "") { + cerr << "A dataset must have a d_name" << endl; return false; } string msg; - if (!unique_names(vars, name, "Dataset", msg)) + if (!unique_names(vars, d_name, "Dataset", msg)) return false; if (all) @@ -1117,6 +1397,7 @@ bool DDS::mark(const string &n, bool state) { + // TODO use auto_ptr BaseType::btp_stack *s = new BaseType::btp_stack; DBG2(cerr << "DDS::mark: Looking for " << n << endl); @@ -1129,7 +1410,7 @@ } variable->set_send_p(state); - DBG2(cerr << "DDS::mark: Set variable " << variable->name() + DBG2(cerr << "DDS::mark: Set variable " << variable->d_name() << " (a " << variable->type_name() << ")" << endl); // Now check the btp_stack and run BaseType::set_send_p for every @@ -1139,12 +1420,14 @@ while (!s->empty()) { s->top()->BaseType::set_send_p(state); - DBG2(cerr << "DDS::mark: Set variable " << s->top()->name() + DBG2(cerr << "DDS::mark: Set variable " << s->top()->d_name() << " (a " << s->top()->type_name() << ")" << endl); + // FIXME get_parent() hosed? +#if 1 string parent_name = (s->top()->get_parent()) ? s->top()->get_parent()->name(): "none"; string parent_type = (s->top()->get_parent()) ? s->top()->get_parent()->type_name(): "none"; DBG2(cerr << "DDS::mark: Parent variable " << parent_name << " (a " << parent_type << ")" << endl); - +#endif s->pop(); } @@ -1178,7 +1461,7 @@ strm << DapIndent::LMarg << "DDS::dump - (" << (void *)this << ")" << endl ; DapIndent::Indent() ; - strm << DapIndent::LMarg << "name: " << name << endl ; + strm << DapIndent::LMarg << "d_name: " << d_name << endl ; strm << DapIndent::LMarg << "filename: " << d_filename << endl ; strm << DapIndent::LMarg << "protocol major: " << d_dap_major << endl; strm << DapIndent::LMarg << "protocol minor: " << d_dap_minor << endl; diff -Nru libdap-3.11.1/DDS.h libdap-3.12.0/DDS.h --- libdap-3.11.1/DDS.h 2011-04-29 13:19:43.000000000 +0000 +++ libdap-3.12.0/DDS.h 2013-10-17 21:27:40.000000000 +0000 @@ -18,7 +18,7 @@ // // You should have received a copy of the GNU Lesser General Public // License along with this library; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA // // You can contact OPeNDAP, Inc. at PO Box 112, Saunderstown, RI. 02874-0112. @@ -66,9 +66,11 @@ #include "Keywords2.h" #endif -using std::cout; +#ifndef XMLWRITER_H_ +#include "XMLWriter.h" +#endif -#define FILE_METHODS 1 +using std::cout; namespace libdap { @@ -180,27 +182,30 @@ private: BaseTypeFactory *d_factory; - string name; // The dataset name - string d_filename; // File name (or other OS identifier) for - string d_container_name; // name of container structure - Structure *d_container; // current container for container name - // dataset or part of dataset. - - int d_dap_major; // The protocol major version number - int d_dap_minor; // ... and minor version number - string d_dap_version; // String version of the protocol + string d_name; // The dataset d_name + string d_filename; // File d_name (or other OS identifier) for + string d_container_name; // d_name of container structure + Structure *d_container; // current container for container d_name + // dataset or part of dataset. + + int d_dap_major; // The protocol major version number + int d_dap_minor; // ... and minor version number + string d_dap_version; // String version of the protocol string d_request_xml_base; + string d_namespace; AttrTable d_attr; // Global attributes. vector vars; // Variables at the top level - BaseType *find_hdf4_dimension_attribute_home(AttrTable::entry *source); - int d_timeout; // alarm time in seconds. If greater than // zero, raise the alarm signal if more than // d_timeout seconds are spent reading data. - Keywords d_keywords; // Holds keywords parsed from the CE + Keywords d_keywords; // Holds keywords parsed from the CE + + long d_max_response_size; // In bytes... + + friend class DDSTest; @@ -214,7 +219,8 @@ typedef std::vector::iterator Vars_iter ; typedef std::vector::reverse_iterator Vars_riter ; - DDS(BaseTypeFactory *factory, const string &n = ""); + DDS(BaseTypeFactory *factory, const string &name = ""); + DDS(BaseTypeFactory *factory, const string &name, const string &version); DDS(const DDS &dds); virtual ~DDS(); @@ -258,16 +264,17 @@ /// Get the DAP minor version as sent by the client int get_dap_minor() const { return d_dap_minor; } - /// Set the DAP major version (typically using info from the client) + void set_dap_version(const string &version_string = "2.0"); + string get_dap_version() const { return d_dap_version; } + string get_dmr_version() const { return "1.0"; } + + /// @deprecated void set_dap_major(int p); - /// Set the DAP minor version (typically using info from the client) + /// @deprecated void set_dap_minor(int p); - - void set_dap_version(const string &version_string); + /// @deprecated void set_dap_version(double d); - string get_dap_version() const { return d_dap_version; } - Keywords &get_keywords() { return d_keywords; } /// Get the URL that will return this DDS/DDX/DataThing @@ -276,11 +283,29 @@ /// @see get_request_xml_base void set_request_xml_base(const string &xb) { d_request_xml_base = xb; } + /// Get the namespace associated with the DDS - likely set only by DDX responses + string get_namespace() const { return d_namespace; } + + /// Set the namespace for this DDS/DDX object/response + void set_namespace(const string &ns) { d_namespace = ns; } + + /// Get the maximum response size, in KB. Zero indicates no limit. + long get_response_limit() { return d_max_response_size; } + + /** Set the maximum response size. Zero is the default value. The size + is given in kilobytes. + @param size The maximum size of the response in kilobytes. */ + void set_response_limit(long size) { d_max_response_size = size * 1024; } + + /// Get the estimated response size. + int get_request_size(bool constrained); + string container_name() ; void container_name( const string &cn ) ; Structure *container() ; void add_var(BaseType *bt); + void add_var_nocopy(BaseType *bt); /// Removes a variable from the DDS. void del_var(const string &n); @@ -301,6 +326,9 @@ Vars_iter get_vars_iter(int i); /// Get a variable BaseType *get_var_index(int i); + /// Insert a variable before the referenced element + void insert_var(Vars_iter i, BaseType *ptr); + void insert_var_nocopy(Vars_iter i, BaseType *ptr); /// Removes a variable from the DDS. void del_var(Vars_iter i); /// Removes a range of variables from the DDS. @@ -311,18 +339,29 @@ void set_timeout(int t); int get_timeout(); + // These parse the DAP2 curly-brace document and make a C++ object. void parse(string fname); void parse(int fd); void parse(FILE *in = stdin); -#if FILE_METHODS + + // These print the Binary object in either the curly-brace or XML reps void print(FILE *out); void print_constrained(FILE *out); void print_xml(FILE *out, bool constrained, const string &blob = ""); -#endif + + // Same as above, but using C++ i/o streams void print(ostream &out); void print_constrained(ostream &out); void print_xml(ostream &out, bool constrained, const string &blob = ""); + // Print the XML using libxml2; the other print_xml methods use this impl. + void print_xml_writer(ostream &out, bool constrained, const string &blob = ""); + + // Print the DAP4 DMR 'object' + void print_dmr(ostream &out, bool constrained); + + void print_das(ostream &out); + void mark_all(bool state); bool mark(const string &name, bool state); bool check_semantics(bool all = false); diff -Nru libdap-3.11.1/DDXExceptions.h libdap-3.12.0/DDXExceptions.h --- libdap-3.11.1/DDXExceptions.h 2011-04-29 13:19:43.000000000 +0000 +++ libdap-3.12.0/DDXExceptions.h 2013-10-17 21:27:40.000000000 +0000 @@ -19,7 +19,7 @@ // // You should have received a copy of the GNU Lesser General Public // License along with this library; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA // // You can contact OPeNDAP, Inc. at PO Box 112, Saunderstown, RI. 02874-0112. diff -Nru libdap-3.11.1/DDXParserSAX2.cc libdap-3.12.0/DDXParserSAX2.cc --- libdap-3.11.1/DDXParserSAX2.cc 2011-04-29 13:19:43.000000000 +0000 +++ libdap-3.12.0/DDXParserSAX2.cc 2013-10-17 21:27:40.000000000 +0000 @@ -19,7 +19,7 @@ // // You should have received a copy of the GNU Lesser General Public // License along with this library; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA // // You can contact OPeNDAP, Inc. at PO Box 112, Saunderstown, RI. 02874-0112. @@ -54,7 +54,8 @@ namespace libdap { -static const not_used char *states[] = +#if defined(DODS_DEBUG) || defined(DODS_DEUG2) +static const char *states[] = { "start", @@ -83,7 +84,7 @@ "unknown", "error" }; - +#endif // Glue the BaseTypeFactory to the enum-based factory defined statically // here. @@ -147,6 +148,7 @@ } } +#if 0 /** Get the Type enumeration value which matches the given name. */ static Type get_type(const char *name) { @@ -191,7 +193,10 @@ return dods_null_c; } +#endif +#if 0 +// Not used. jhrg 1/17/13 static Type is_simple_type(const char *name) { Type t = get_type(name); @@ -210,6 +215,7 @@ return dods_null_c; } } +#endif static bool is_not(const char *name, const char *tag) { @@ -437,8 +443,9 @@ inline bool DDXParser::is_variable(const char *name, const xmlChar **attrs, int nb_attributes) { - Type t; - if ((t = is_simple_type(name)) != dods_null_c) { + Type t = get_type(name); + //if ((t = is_simple_type(name)) != dods_null_c) { + if (is_simple_type(t)) { process_variable(t, inside_simple_type, attrs, nb_attributes); return true; } @@ -486,10 +493,11 @@ } // Once libxml2 validates, this can go away. 05/30/03 jhrg if (t == dods_array_c - && dynamic_cast < Array * >(btp)->dimensions() == 0) { + && static_cast(btp)->dimensions() == 0) { DDXParser::ddx_fatal_error(this, "No dimension element included in the Array '%s'.", btp->name().c_str()); + delete btp; return; } @@ -501,10 +509,12 @@ tag, bt_stack.top()->type_name().c_str(), bt_stack.top()->name().c_str()); + delete btp; return; } parent->add_var(btp); + delete btp; } /** @name SAX Parser Callbacks @@ -546,25 +556,28 @@ endl); if (parser->get_state() != parser_start) - DDXParser::ddx_fatal_error(parser, - "The document contained unbalanced tags."); + DDXParser::ddx_fatal_error(parser, "The document contained unbalanced tags."); // If we've found any sort of error, don't make the DDX; intern() will // take care of the error. - if (parser->get_state() == parser_error) + if (parser->get_state() == parser_error) { + delete parser->bt_stack.top(); return; + } // Pop the temporary Structure off the stack and transfer its variables // to the DDS. Constructor *cp = dynamic_cast < Constructor * >(parser->bt_stack.top()); if (!cp) { ddx_fatal_error(parser, "Parse error: Expected a Structure, Sequence or Grid variable."); + delete cp; return; } - - for (Constructor::Vars_iter i = cp->var_begin(); i != cp->var_end(); - ++i) + + for (Constructor::Vars_iter i = cp->var_begin(); i != cp->var_end(); ++i) { + (*i)->set_parent(0); // top-level vars have no parents parser->dds->add_var(*i); + } parser->bt_stack.pop(); delete cp; @@ -898,8 +911,9 @@ parser->pop_state(); break; - case inside_simple_type: - if (is_simple_type(localname) != dods_null_c) { + case inside_simple_type: { + Type t = get_type(localname); + if (is_simple_type(t)) { parser->pop_state(); BaseType *btp = parser->bt_stack.top(); parser->bt_stack.pop(); @@ -907,8 +921,10 @@ BaseType *parent = parser->bt_stack.top(); - if (parent->is_vector_type() || parent->is_constructor_type()) + if (parent->is_vector_type() || parent->is_constructor_type()) { parent->add_var(btp); + delete btp; + } else DDXParser::ddx_fatal_error(parser, "Tried to add the simple-type variable '%s' to a non-constructor type (%s %s).", @@ -923,6 +939,7 @@ "Expected an end tag for a simple type; found '%s' instead.", localname); break; + } case inside_array: parser->finish_variable(localname, dods_array_c, "Array"); @@ -1106,13 +1123,82 @@ xmlFreeParserCtxt(context); } +/** Read a DDX from a C++ input stream and populate a DDS object. + * + * @param in + * @param dds + * @param cid + * @param boundary + */ +void DDXParser::intern_stream(istream &in, DDS *dest_dds, string &cid, const string &boundary) +{ + // Code example from libxml2 docs re: read from a stream. + if (!in || in.eof()) + throw InternalErr(__FILE__, __LINE__, "Input stream not open or read error"); + + const int size = 1024; + char chars[size + 1]; + + // int res = fread(chars, 1, 4, in); + in.readsome(chars, 4); + int res = in.gcount(); + if (res > 0) { + chars[4]='\0'; + xmlParserCtxtPtr context = xmlCreatePushParserCtxt(NULL, NULL, chars, res, "stream"); + + ctxt = context; // need ctxt for error messages + dds = dest_dds; // dump values here + blob_href = &cid; // cid goes here + + xmlSAXHandler ddx_sax_parser; + memset( &ddx_sax_parser, 0, sizeof(xmlSAXHandler) ); + + ddx_sax_parser.getEntity = &DDXParser::ddx_get_entity; + ddx_sax_parser.startDocument = &DDXParser::ddx_start_document; + ddx_sax_parser.endDocument = &DDXParser::ddx_end_document; + ddx_sax_parser.characters = &DDXParser::ddx_get_characters; + ddx_sax_parser.ignorableWhitespace = &DDXParser::ddx_ignoreable_whitespace; + ddx_sax_parser.cdataBlock = &DDXParser::ddx_get_cdata; + ddx_sax_parser.warning = &DDXParser::ddx_fatal_error; + ddx_sax_parser.error = &DDXParser::ddx_fatal_error; + ddx_sax_parser.fatalError = &DDXParser::ddx_fatal_error; + ddx_sax_parser.initialized = XML_SAX2_MAGIC; + ddx_sax_parser.startElementNs = &DDXParser::ddx_sax2_start_element; + ddx_sax_parser.endElementNs = &DDXParser::ddx_sax2_end_element; + + context->sax = &ddx_sax_parser; + context->userData = this; + context->validate = true; + + in.getline(chars, size); // chars has size+1 elements + res = in.gcount(); + chars[res-1] = '\n'; // libxml needs the newline; w/o it the parse will fail + chars[res] = '\0'; + while (res > 0 && !is_boundary(chars, boundary)) { + DBG(cerr << "line (" << res << "): " << chars << endl); + xmlParseChunk(ctxt, chars, res, 0); + + in.getline(chars, size); // chars has size+1 elements + res = in.gcount(); + if (res > 0) { + chars[res-1] = '\n'; + chars[res] = '\0'; + } + } + + // This call ends the parse: The fourth argument of xmlParseChunk is + // the bool 'terminate.' + xmlParseChunk(ctxt, chars, 0, 1); + + cleanup_parse(context); + } +} + /** @brief Read the DDX from a stream instead of a file. @see DDXParser::intern(). */ -void DDXParser::intern_stream(FILE *in, DDS *dest_dds, string &cid, - const string &boundary) +void DDXParser::intern_stream(FILE *in, DDS *dest_dds, string &cid, const string &boundary) { // Code example from libxml2 docs re: read from a stream. - if (!in || feof(in) || ferror(in)) throw InternalErr(__FILE__, __LINE__, "Input stream not open or read error"); @@ -1122,6 +1208,7 @@ int res = fread(chars, 1, 4, in); if (res > 0) { + chars[4]='\0'; xmlParserCtxtPtr context = xmlCreatePushParserCtxt(NULL, NULL, chars, res, "stream"); @@ -1151,8 +1238,9 @@ while ((fgets(chars, size, in) > 0) && !is_boundary(chars, boundary)) { - chars[size-1] = '\0'; - DBG(cerr << "line: " << chars << endl); + //chars[size-1] = '\0'; + DBG(cerr << "line (" << strlen(chars) << "): " << chars << endl); + xmlParseChunk(ctxt, chars, strlen(chars), 0); } // This call ends the parse: The fourth argument of xmlParseChunk is diff -Nru libdap-3.11.1/DDXParserSAX2.h libdap-3.12.0/DDXParserSAX2.h --- libdap-3.11.1/DDXParserSAX2.h 2011-04-29 13:19:43.000000000 +0000 +++ libdap-3.12.0/DDXParserSAX2.h 2013-10-17 21:27:40.000000000 +0000 @@ -19,7 +19,7 @@ // // You should have received a copy of the GNU Lesser General Public // License along with this library; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA // // You can contact OPeNDAP, Inc. at PO Box 112, Saunderstown, RI. 02874-0112. @@ -240,8 +240,8 @@ {} void intern(const string &document, DDS *dest_dds, string &cid); - void intern_stream(FILE *in, DDS *dds, string &cid, - const string &boundary = ""); + void intern_stream(FILE *in, DDS *dds, string &cid, const string &boundary = ""); + void intern_stream(istream &in, DDS *dds, string &cid, const string &boundary = ""); static void ddx_start_document(void *parser); static void ddx_end_document(void *parser); diff -Nru libdap-3.11.1/DODSFilter.cc libdap-3.12.0/DODSFilter.cc --- libdap-3.11.1/DODSFilter.cc 2011-04-29 13:19:42.000000000 +0000 +++ libdap-3.12.0/DODSFilter.cc 2013-10-17 21:27:40.000000000 +0000 @@ -19,7 +19,7 @@ // // You should have received a copy of the GNU Lesser General Public // License along with this library; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA // // You can contact OPeNDAP, Inc. at PO Box 112, Saunderstown, RI. 02874-0112. @@ -36,10 +36,6 @@ #include "config.h" -static char rcsid[] not_used = - {"$Id: DODSFilter.cc 24281 2011-03-09 00:22:31Z jimg $" - }; - #include #ifndef WIN32 @@ -52,6 +48,7 @@ #endif #include +#include #include #include #include @@ -69,9 +66,6 @@ #include "util.h" #include "escaping.h" #include "DODSFilter.h" -#if FILE_METHODS -#include "XDRFileMarshaller.h" -#endif #include "XDRStreamMarshaller.h" #include "InternalErr.h" @@ -83,8 +77,6 @@ #define CRLF "\r\n" // Change here, expr-test.cc and DODSFilter.cc -//#undef FILE_METHODS - using namespace std; namespace libdap { @@ -286,8 +278,14 @@ d_if_modified_since = static_cast(strtol(getopt.optarg, NULL, 10)); break; - case 'h': print_usage(); exit(1); - default: print_usage(); // Throws Error + case 'h': print_usage(); + break; + // exit(1); + // Removed 12/29/2011; exit should + // not be called by a library. NB: + // print_usage() throws Error. + default: print_usage(); // Throws Error + break; } } @@ -609,7 +607,6 @@ return d_timeout; } -#if FILE_METHODS /** Use values of this instance to establish a timeout alarm for the server. If the timeout value is zero, do nothing. @@ -633,9 +630,7 @@ } #endif } -#endif -// FIXME void DODSFilter::establish_timeout(ostream &stream) const { @@ -666,7 +661,7 @@ // Write a message to the WWW server error log file. ErrMsgT(usage.c_str()); - throw Error(unknown_error, emessage); + throw Error(emessage); } /** This function formats and sends to stdout version @@ -680,7 +675,6 @@ do_version(d_cgi_ver, get_dataset_version()); } -#if FILE_METHODS /** This function formats and prints an ASCII representation of a DAS on stdout. This has the effect of sending the DAS object back to the client program. @@ -696,20 +690,10 @@ DODSFilter::send_das(FILE *out, DAS &das, const string &anc_location, bool with_mime_headers) const { - time_t das_lmt = get_das_last_modified_time(anc_location); - if (is_conditional() - && das_lmt <= get_request_if_modified_since() - && with_mime_headers) { - set_mime_not_modified(out); - } - else { - if (with_mime_headers) - set_mime_text(out, dods_das, d_cgi_ver, x_plain, das_lmt); - das.print(out); - } - fflush(out) ; + ostringstream oss; + send_das(oss, das, anc_location, with_mime_headers); + fwrite(oss.str().data(), sizeof(char), oss.str().length(), out); } -#endif /** This function formats and prints an ASCII representation of a DAS on stdout. This has the effect of sending the DAS object @@ -747,7 +731,6 @@ send_das(cout, das, anc_location, with_mime_headers); } -#if FILE_METHODS /** This function formats and prints an ASCII representation of a DDS on stdout. When called by a CGI program, this has the effect of sending a DDS object back to the client @@ -770,31 +753,10 @@ const string &anc_location, bool with_mime_headers) const { - // If constrained, parse the constraint. Throws Error or InternalErr. - if (constrained) - eval.parse_constraint(d_ce, dds); - - if (eval.functional_expression()) - throw Error("Function calls can only be used with data requests. To see the structure of the underlying data source, reissue the URL without the function."); - - time_t dds_lmt = get_dds_last_modified_time(anc_location); - if (is_conditional() - && dds_lmt <= get_request_if_modified_since() - && with_mime_headers) { - set_mime_not_modified(out); - } - else { - if (with_mime_headers) - set_mime_text(out, dods_dds, d_cgi_ver, x_plain, dds_lmt); - if (constrained) - dds.print_constrained(out); - else - dds.print(out); - } - - fflush(out) ; + ostringstream oss; + send_dds(oss, dds, eval, constrained, anc_location, with_mime_headers); + fwrite(oss.str().data(), sizeof(char), oss.str().length(), out); } -#endif /** This function formats and prints an ASCII representation of a DDS on stdout. When called by a CGI program, this has the @@ -851,31 +813,16 @@ send_dds(cout, dds, eval, constrained, anc_location, with_mime_headers); } -#if FILE_METHODS // 'lmt' unused. Should it be used to supply a LMT or removed from the // method? jhrg 8/9/05 void DODSFilter::functional_constraint(BaseType &var, DDS &dds, ConstraintEvaluator &eval, FILE *out) const { - fprintf(out, "Dataset {\n"); - var.print_decl(out, " ", true, false, true); - fprintf(out, "} function_value;\n"); - fprintf(out, "Data:\n"); - - fflush(out); - - XDRFileMarshaller m( out ) ; - - try { - // In the following call to serialize, suppress CE evaluation. - var.serialize(eval, dds, m, false); - } - catch (Error &e) { - throw; - } + ostringstream oss; + functional_constraint(var, dds, eval, oss); + fwrite(oss.str().data(), sizeof(char), oss.str().length(), out); } -#endif // 'lmt' unused. Should it be used to supply a LMT or removed from the // method? jhrg 8/9/05 @@ -902,32 +849,14 @@ } } -#if FILE_METHODS void DODSFilter::dataset_constraint(DDS & dds, ConstraintEvaluator & eval, FILE * out, bool ce_eval) const { - // send constrained DDS - dds.print_constrained(out); - fprintf(out, "Data:\n"); - fflush(out); - - // Grab a stream that encodes using XDR. - XDRFileMarshaller m( out ) ; - - try { - // Send all variables in the current projection (send_p()) - for (DDS::Vars_iter i = dds.var_begin(); i != dds.var_end(); i++) - if ((*i)->send_p()) { - DBG(cerr << "Sending " << (*i)->name() << endl); - (*i)->serialize(eval, dds, m, ce_eval); - } - } - catch (Error & e) { - throw; - } + ostringstream oss; + dataset_constraint(dds, eval, oss, ce_eval); + fwrite(oss.str().data(), sizeof(char), oss.str().length(), out); } -#endif void DODSFilter::dataset_constraint(DDS & dds, ConstraintEvaluator & eval, @@ -974,7 +903,7 @@ string cid = string(&uuid[0]) + "@" + string(&domain[0]); // Send constrained DDX with a data blob reference - dds.print_xml(out, true, cid); + dds.print_xml_writer(out, true, cid); // Write the MPM headers for the data part of the response. set_mime_data_boundary(out, boundary, cid, dap4_data, binary); @@ -995,7 +924,6 @@ } } -#if FILE_METHODS /** Send the data in the DDS object back to the client program. The data is encoded using a Marshaller, and enclosed in a MIME document which is all sent to \c data_stream. If this is being called from a CGI, \c data_stream is @@ -1017,77 +945,10 @@ FILE * data_stream, const string & anc_location, bool with_mime_headers) const { - // If this is a conditional request and the server should send a 304 - // response, do that and exit. Otherwise, continue on and send the full - // response. - time_t data_lmt = get_data_last_modified_time(anc_location); - if (is_conditional() - && data_lmt <= get_request_if_modified_since() - && with_mime_headers) { - set_mime_not_modified(data_stream); - return; - } - // Set up the alarm. - establish_timeout(data_stream); - dds.set_timeout(d_timeout); - - eval.parse_constraint(d_ce, dds); // Throws Error if the ce doesn't - // parse. - - dds.tag_nested_sequences(); // Tag Sequences as Parent or Leaf node. - - // Start sending the response... - - // Handle *functional* constraint expressions specially -#if 0 - if (eval.functional_expression()) { - // Get the result and then start sending the headers. This provides a - // way to send errors back to the client w/o colliding with the - // normal response headers. There's some duplication of code with this - // and the else-clause. - BaseType *var = eval.eval_function(dds, d_dataset); - if (!var) - throw Error(unknown_error, "Error calling the CE function."); - -#if COMPRESSION_FOR_SERVER3 - if (with_mime_headers) - set_mime_binary(data_stream, dods_data, d_cgi_ver, - (compress) ? deflate : x_plain, data_lmt); - fflush(data_stream); - - int childpid; - if (compress) - data_stream = compressor(data_stream, childpid); -#endif - if (with_mime_headers) - set_mime_binary(data_stream, dods_data, d_cgi_ver, x_plain, data_lmt); - - fflush(data_stream); - - functional_constraint(*var, dds, eval, data_stream); - delete var; - var = 0; - } -#endif - if (eval.function_clauses()) { - DDS *fdds = eval.eval_function_clauses(dds); - - if (with_mime_headers) - set_mime_binary(data_stream, dods_data, d_cgi_ver, x_plain, data_lmt); - - dataset_constraint(*fdds, eval, data_stream, false); - delete fdds; - } - else { - if (with_mime_headers) - set_mime_binary(data_stream, dods_data, d_cgi_ver, x_plain, data_lmt); - - dataset_constraint(dds, eval, data_stream); - } - - fflush(data_stream); + ostringstream oss; + send_data(dds, eval, oss, anc_location, with_mime_headers); + fwrite(oss.str().data(), sizeof(char), oss.str().length(), data_stream); } -#endif /** Send the data in the DDS object back to the client program. The data is encoded using a Marshaller, and enclosed in a MIME document which is all sent @@ -1170,7 +1031,6 @@ data_stream << flush ; } -#if FILE_METHODS /** Send the DDX response. The DDX never contains data, instead it holds a reference to a Blob response which is used to get the data values. The DDS and DAS objects are built using code that already exists in the @@ -1185,30 +1045,10 @@ DODSFilter::send_ddx(DDS &dds, ConstraintEvaluator &eval, FILE *out, bool with_mime_headers) const { - // If constrained, parse the constraint. Throws Error or InternalErr. - if (!d_ce.empty()) - eval.parse_constraint(d_ce, dds); - - if (eval.functional_expression()) - throw Error("Function calls can only be used with data requests. To see the structure of the underlying data source, reissue the URL without the function."); - - time_t dds_lmt = get_dds_last_modified_time(d_anc_dir); - - // If this is a conditional request and the server should send a 304 - // response, do that and exit. Otherwise, continue on and send the full - // response. - if (is_conditional() && dds_lmt <= get_request_if_modified_since() - && with_mime_headers) { - set_mime_not_modified(out); - return; - } - else { - if (with_mime_headers) - set_mime_text(out, dap4_ddx, d_cgi_ver, x_plain, dds_lmt); - dds.print_xml(out, !d_ce.empty(), ""); - } + ostringstream oss; + send_ddx(dds, eval, oss, with_mime_headers); + fwrite(oss.str().data(), sizeof(char), oss.str().length(), out); } -#endif /** Send the DDX response. The DDX never contains data, instead it holds a reference to a Blob response which is used to get the data values. The @@ -1244,7 +1084,7 @@ else { if (with_mime_headers) set_mime_text(out, dap4_ddx, d_cgi_ver, x_plain, dds_lmt); - dds.print_xml(out, !d_ce.empty(), ""); + dds.print_xml_writer(out, !d_ce.empty(), ""); } } diff -Nru libdap-3.11.1/DODSFilter.h libdap-3.12.0/DODSFilter.h --- libdap-3.11.1/DODSFilter.h 2011-04-29 13:19:43.000000000 +0000 +++ libdap-3.12.0/DODSFilter.h 2013-10-17 21:27:40.000000000 +0000 @@ -19,7 +19,7 @@ // // You should have received a copy of the GNU Lesser General Public // License along with this library; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA // // You can contact OPeNDAP, Inc. at PO Box 112, Saunderstown, RI. 02874-0112. @@ -46,8 +46,6 @@ #include "ConstraintEvaluator.h" #endif -#define FILE_METHODS 1 - namespace libdap { @@ -214,7 +212,6 @@ const string &anc_location = "", bool with_mime_headers = true) const; -#if FILE_METHODS virtual void establish_timeout(FILE *stream) const; virtual void send_das(FILE *out, DAS &das, const string &anc_location = "", bool with_mime_headers = true) const; @@ -234,7 +231,6 @@ bool with_mime_headers = true) const; virtual void send_ddx(DDS &dds, ConstraintEvaluator &eval, FILE *out, bool with_mime_headers = true) const; -#endif }; } // namespace libdap diff -Nru libdap-3.11.1/DapIndent.cc libdap-3.12.0/DapIndent.cc --- libdap-3.11.1/DapIndent.cc 2011-04-29 13:19:43.000000000 +0000 +++ libdap-3.12.0/DapIndent.cc 2013-10-17 21:27:40.000000000 +0000 @@ -20,7 +20,7 @@ // // You should have received a copy of the GNU Lesser General Public // License along with this library; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA // // You can contact OPeNDAP, Inc. at PO Box 112, Saunderstown, RI. 02874-0112. diff -Nru libdap-3.11.1/DapIndent.h libdap-3.12.0/DapIndent.h --- libdap-3.11.1/DapIndent.h 2011-04-29 13:19:43.000000000 +0000 +++ libdap-3.12.0/DapIndent.h 2013-10-17 21:27:40.000000000 +0000 @@ -20,7 +20,7 @@ // // You should have received a copy of the GNU Lesser General Public // License along with this library; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA // // You can contact OPeNDAP, Inc. at PO Box 112, Saunderstown, RI. 02874-0112. diff -Nru libdap-3.11.1/DapObj.h libdap-3.12.0/DapObj.h --- libdap-3.11.1/DapObj.h 2011-04-29 13:19:43.000000000 +0000 +++ libdap-3.12.0/DapObj.h 2013-10-17 21:27:40.000000000 +0000 @@ -20,7 +20,7 @@ // // You should have received a copy of the GNU Lesser General Public // License along with this library; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA // // You can contact OPeNDAP, Inc. at PO Box 112, Saunderstown, RI. 02874-0112. diff -Nru libdap-3.11.1/DataDDS.cc libdap-3.12.0/DataDDS.cc --- libdap-3.11.1/DataDDS.cc 2011-04-29 13:19:43.000000000 +0000 +++ libdap-3.12.0/DataDDS.cc 2013-10-17 21:27:40.000000000 +0000 @@ -19,7 +19,7 @@ // // You should have received a copy of the GNU Lesser General Public // License along with this library; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA // // You can contact OPeNDAP, Inc. at PO Box 112, Saunderstown, RI. 02874-0112. @@ -34,11 +34,6 @@ #include "config.h" -static char rcsid[] not_used = - {"$Id: DataDDS.cc 17856 2008-02-02 21:25:59Z pwest $" - }; - - #include #include #include @@ -149,11 +144,11 @@ // public /** @brief Make an instance of DataDDS - A DataDDS instance is a DDS with aditional information about the version + A DataDDS instance is a DDS with additional information about the version of the server from which the data came. @param factory Use this BaseTypeFactory to instantiate the variables. Caller must free; can also be set using the set_factory() method. Never - delete until just before deleting the DDS istelf unless you intend to + delete until just before deleting the DDS itself unless you intend to replace the factory with a new instance. @param n The name of the dataset. Can also be set using the set_dataset_name() method. diff -Nru libdap-3.11.1/DataDDS.h libdap-3.12.0/DataDDS.h --- libdap-3.11.1/DataDDS.h 2011-04-29 13:19:43.000000000 +0000 +++ libdap-3.12.0/DataDDS.h 2013-10-17 21:27:40.000000000 +0000 @@ -19,7 +19,7 @@ // // You should have received a copy of the GNU Lesser General Public // License along with this library; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA // // You can contact OPeNDAP, Inc. at PO Box 112, Saunderstown, RI. 02874-0112. diff -Nru libdap-3.11.1/EncodingType.h libdap-3.12.0/EncodingType.h --- libdap-3.11.1/EncodingType.h 2011-04-29 13:19:43.000000000 +0000 +++ libdap-3.12.0/EncodingType.h 2013-10-17 21:27:40.000000000 +0000 @@ -19,7 +19,7 @@ // // You should have received a copy of the GNU Lesser General Public // License along with this library; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA // // You can contact OPeNDAP, Inc. at PO Box 112, Saunderstown, RI. 02874-0112. diff -Nru libdap-3.11.1/Error.cc libdap-3.12.0/Error.cc --- libdap-3.11.1/Error.cc 2011-04-29 13:19:43.000000000 +0000 +++ libdap-3.12.0/Error.cc 2013-10-17 21:27:40.000000000 +0000 @@ -19,7 +19,7 @@ // // You should have received a copy of the GNU Lesser General Public // License along with this library; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA // // You can contact OPeNDAP, Inc. at PO Box 112, Saunderstown, RI. 02874-0112. @@ -35,7 +35,7 @@ #include "config.h" static char rcsid[] not_used = - {"$Id: Error.cc 18940 2008-06-25 19:22:37Z jimg $" + {"$Id: Error.cc 27197 2013-10-01 21:29:54Z jimg $" }; #include @@ -53,8 +53,8 @@ extern void Error_delete_buffer(void * buffer); extern void *Error_buffer(FILE *fp); -extern void Errorrestart(FILE *yyin); // defined in Error.tab.c -extern int Errorparse(void *arg); +//extern void Errorrestart(FILE *yyin); // defined in Error.tab.c +extern int Errorparse(libdap::parser_arg *arg); namespace libdap { @@ -168,7 +168,7 @@ bool status; try { - status = Errorparse((void *) & arg) == 0; + status = Errorparse(&arg) == 0; Error_delete_buffer(buffer); } catch (Error &e) { diff -Nru libdap-3.11.1/Error.h libdap-3.12.0/Error.h --- libdap-3.11.1/Error.h 2011-04-29 13:19:43.000000000 +0000 +++ libdap-3.12.0/Error.h 2013-10-17 21:27:40.000000000 +0000 @@ -19,7 +19,7 @@ // // You should have received a copy of the GNU Lesser General Public // License along with this library; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA // // You can contact OPeNDAP, Inc. at PO Box 112, Saunderstown, RI. 02874-0112. diff -Nru libdap-3.11.1/Error.lex libdap-3.12.0/Error.lex --- libdap-3.11.1/Error.lex 2011-04-29 13:19:42.000000000 +0000 +++ libdap-3.12.0/Error.lex 2013-10-17 21:27:40.000000000 +0000 @@ -41,19 +41,30 @@ #include "config_dap.h" -static char rcsid[] not_used = {"$Id: Error.lex 18315 2008-03-03 20:14:44Z jimg $"}; +static char rcsid[] not_used = {"$Id: Error.lex 27157 2013-09-28 21:22:52Z jimg $"}; #include #include +#include + +#include + +#include "parser.h" +#include "Error.tab.hh" + +using namespace libdap; #ifndef YY_PROTO #define YY_PROTO(proto) proto #endif -#define YY_NO_UNPUT +//#define YY_NO_UNPUT #define YY_DECL int Errorlex YY_PROTO(( void )) -#include "Error.tab.hh" +#define YY_FATAL_ERROR(msg) {\ + throw(Error(string("Error scanning the error response: ") + string(msg))); \ + yy_fatal_error(msg); /* see das.lex */ \ +} int error_line_num = 1; static int start_line; /* used in quote and comment error handlers */ @@ -64,6 +75,9 @@ %} %option noyywrap +%option nounput +%option noinput +%option 8bit %option prefix="Error" %option outfile="lex.Error.cc" %x quote @@ -114,7 +128,7 @@ } <> { char msg[256]; - sprintf(msg, + snprintf(msg, 255, "Unterminated quote (starts on line %d)\n", start_line); YY_FATAL_ERROR(msg); diff -Nru libdap-3.11.1/Error.tab.cc libdap-3.12.0/Error.tab.cc --- libdap-3.11.1/Error.tab.cc 2011-05-06 17:50:25.000000000 +0000 +++ libdap-3.12.0/Error.tab.cc 2013-10-17 21:27:40.000000000 +0000 @@ -1,24 +1,23 @@ -/* A Bison parser, made by GNU Bison 2.3. */ -/* Skeleton implementation for Bison's Yacc-like parsers in C +/* A Bison parser, made by GNU Bison 2.4.1. */ - Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004, 2005, 2006 +/* Skeleton implementation for Bison's Yacc-like parsers in C + + Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc. - - This program is free software; you can redistribute it and/or modify + + This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2, or (at your option) - any later version. - + the Free Software Foundation, either version 3 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., 51 Franklin Street, Fifth Floor, - Boston, MA 02110-1301, USA. */ + along with this program. If not, see . */ /* As a special exception, you may create a larger work that contains part or all of the Bison parser skeleton and distribute that work @@ -29,7 +28,7 @@ special exception, which will cause the skeleton and the resulting Bison output files to be licensed under the GNU General Public License without this special exception. - + This special exception was added by the Free Software Foundation in version 2.2 of Bison. */ @@ -47,7 +46,7 @@ #define YYBISON 1 /* Bison version. */ -#define YYBISON_VERSION "2.3" +#define YYBISON_VERSION "2.4.1" /* Skeleton name. */ #define YYSKELETON_NAME "yacc.c" @@ -55,50 +54,57 @@ /* Pure parsers. */ #define YYPURE 0 +/* Push parsers. */ +#define YYPUSH 0 + +/* Pull parsers. */ +#define YYPULL 1 + /* Using locations. */ #define YYLSP_NEEDED 0 /* Substitute the variable and function names. */ -#define yyparse Errorparse -#define yylex Errorlex -#define yyerror Errorerror -#define yylval Errorlval -#define yychar Errorchar -#define yydebug Errordebug -#define yynerrs Errornerrs +#define yyparse Errorparse +#define yylex Errorlex +#define yyerror Errorerror +#define yylval Errorlval +#define yychar Errorchar +#define yydebug Errordebug +#define yynerrs Errornerrs -/* Tokens. */ -#ifndef YYTOKENTYPE -# define YYTOKENTYPE - /* Put the tokens into the symbol table, so that GDB and other debuggers - know about them. */ - enum yytokentype { - SCAN_INT = 258, - SCAN_STR = 259, - SCAN_ERROR = 260, - SCAN_CODE = 261, - SCAN_MSG = 262 - }; +/* Copy the first part of user declarations. */ + + +/* Line 189 of yacc.c */ +#line 81 "Error.tab.cc" + +/* Enabling traces. */ +#ifndef YYDEBUG +# define YYDEBUG 1 #endif -/* Tokens. */ -#define SCAN_INT 258 -#define SCAN_STR 259 -#define SCAN_ERROR 260 -#define SCAN_CODE 261 -#define SCAN_MSG 262 +/* Enabling verbose error messages. */ +#ifdef YYERROR_VERBOSE +# undef YYERROR_VERBOSE +# define YYERROR_VERBOSE 1 +#else +# define YYERROR_VERBOSE 0 +#endif +/* Enabling the token table. */ +#ifndef YYTOKEN_TABLE +# define YYTOKEN_TABLE 0 +#endif +/* "%code requires" blocks. */ -/* Copy the first part of user declarations. */ -#line 32 "Error.y" +/* Line 209 of yacc.c */ +#line 32 "Error.yy" #include "config_dap.h" -static char rcsid[] not_used = {"$Id: Error.y 18315 2008-03-03 20:14:44Z jimg $"}; - #include #include "Error.h" @@ -118,37 +124,39 @@ #define ERROR_OBJ(arg) ((Error *)((parser_arg *)(arg))->_object) #define STATUS(arg) ((parser_arg *)(arg))->_status -#define YYPARSE_PARAM arg +//#define YYPARSE_PARAM arg extern int error_line_num; // defined in Error.lex -int Errorlex(); // the scanner -void Errorerror(char *s); // gotta love automatically generated names... -/* Enabling traces. */ -#ifndef YYDEBUG -# define YYDEBUG 0 -#endif +/* Line 209 of yacc.c */ +#line 136 "Error.tab.cc" -/* Enabling verbose error messages. */ -#ifdef YYERROR_VERBOSE -# undef YYERROR_VERBOSE -# define YYERROR_VERBOSE 1 -#else -# define YYERROR_VERBOSE 0 +/* Tokens. */ +#ifndef YYTOKENTYPE +# define YYTOKENTYPE + /* Put the tokens into the symbol table, so that GDB and other debuggers + know about them. */ + enum yytokentype { + SCAN_INT = 258, + SCAN_STR = 259, + SCAN_ERROR = 260, + SCAN_CODE = 261, + SCAN_MSG = 262 + }; #endif -/* Enabling the token table. */ -#ifndef YYTOKEN_TABLE -# define YYTOKEN_TABLE 0 -#endif + #if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED typedef union YYSTYPE -#line 66 "Error.y" { + +/* Line 214 of yacc.c */ +#line 75 "Error.yy" + #ifdef __SUNPRO_CC int boolean; #else @@ -156,22 +164,37 @@ #endif int integer; char *string; -} -/* Line 187 of yacc.c. */ -#line 162 "Error.tab.cc" - YYSTYPE; + + + +/* Line 214 of yacc.c */ +#line 172 "Error.tab.cc" +} YYSTYPE; +# define YYSTYPE_IS_TRIVIAL 1 # define yystype YYSTYPE /* obsolescent; will be withdrawn */ # define YYSTYPE_IS_DECLARED 1 -# define YYSTYPE_IS_TRIVIAL 1 #endif - /* Copy the second part of user declarations. */ -/* Line 216 of yacc.c. */ -#line 175 "Error.tab.cc" +/* Line 264 of yacc.c */ +#line 184 "Error.tab.cc" +/* Unqualified %code blocks. */ + +/* Line 265 of yacc.c */ +#line 61 "Error.yy" + + +int Errorlex(); // the scanner +void Errorerror(parser_arg *arg, const string &s); // gotta love automatically generated names... + + + + +/* Line 265 of yacc.c */ +#line 198 "Error.tab.cc" #ifdef short # undef short @@ -246,14 +269,14 @@ #if (defined __STDC__ || defined __C99__FUNC__ \ || defined __cplusplus || defined _MSC_VER) static int -YYID (int i) +YYID (int yyi) #else static int -YYID (i) - int i; +YYID (yyi) + int yyi; #endif { - return i; + return yyi; } #endif @@ -334,9 +357,9 @@ /* A type that is properly aligned for any stack member. */ union yyalloc { - yytype_int16 yyss; - YYSTYPE yyvs; - }; + yytype_int16 yyss_alloc; + YYSTYPE yyvs_alloc; +}; /* The size of the maximum gap between one aligned stack and the next. */ # define YYSTACK_GAP_MAXIMUM (sizeof (union yyalloc) - 1) @@ -370,12 +393,12 @@ elements in the stack, and YYPTR gives the new location of the stack. Advance YYPTR to a properly aligned location for the next stack. */ -# define YYSTACK_RELOCATE(Stack) \ +# define YYSTACK_RELOCATE(Stack_alloc, Stack) \ do \ { \ YYSIZE_T yynewbytes; \ - YYCOPY (&yyptr->Stack, Stack, yysize); \ - Stack = &yyptr->Stack; \ + YYCOPY (&yyptr->Stack_alloc, Stack, yysize); \ + Stack = &yyptr->Stack_alloc; \ yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \ yyptr += yynewbytes / sizeof (*yyptr); \ } \ @@ -455,7 +478,7 @@ /* YYRLINE[YYN] -- source line where rule number YYN was defined. */ static const yytype_uint8 yyrline[] = { - 0, 94, 94, 97, 100, 101, 104, 112, 111 + 0, 103, 103, 106, 109, 110, 113, 121, 120 }; #endif @@ -466,7 +489,7 @@ { "$end", "error", "$undefined", "SCAN_INT", "SCAN_STR", "SCAN_ERROR", "SCAN_CODE", "SCAN_MSG", "'{'", "'}'", "';'", "'='", "$accept", - "error_object", "contents", "description", "code", "message", "@1", 0 + "error_object", "contents", "description", "code", "message", "$@1", 0 }; #endif @@ -577,7 +600,7 @@ } \ else \ { \ - yyerror (YY_("syntax error: cannot back up")); \ + yyerror (arg, YY_("syntax error: cannot back up")); \ YYERROR; \ } \ while (YYID (0)) @@ -657,7 +680,7 @@ { \ YYFPRINTF (stderr, "%s ", Title); \ yy_symbol_print (stderr, \ - Type, Value); \ + Type, Value, arg); \ YYFPRINTF (stderr, "\n"); \ } \ } while (YYID (0)) @@ -671,17 +694,19 @@ #if (defined __STDC__ || defined __C99__FUNC__ \ || defined __cplusplus || defined _MSC_VER) static void -yy_symbol_value_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep) +yy_symbol_value_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep, parser_arg *arg) #else static void -yy_symbol_value_print (yyoutput, yytype, yyvaluep) +yy_symbol_value_print (yyoutput, yytype, yyvaluep, arg) FILE *yyoutput; int yytype; YYSTYPE const * const yyvaluep; + parser_arg *arg; #endif { if (!yyvaluep) return; + YYUSE (arg); # ifdef YYPRINT if (yytype < YYNTOKENS) YYPRINT (yyoutput, yytoknum[yytype], *yyvaluep); @@ -703,13 +728,14 @@ #if (defined __STDC__ || defined __C99__FUNC__ \ || defined __cplusplus || defined _MSC_VER) static void -yy_symbol_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep) +yy_symbol_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep, parser_arg *arg) #else static void -yy_symbol_print (yyoutput, yytype, yyvaluep) +yy_symbol_print (yyoutput, yytype, yyvaluep, arg) FILE *yyoutput; int yytype; YYSTYPE const * const yyvaluep; + parser_arg *arg; #endif { if (yytype < YYNTOKENS) @@ -717,7 +743,7 @@ else YYFPRINTF (yyoutput, "nterm %s (", yytname[yytype]); - yy_symbol_value_print (yyoutput, yytype, yyvaluep); + yy_symbol_value_print (yyoutput, yytype, yyvaluep, arg); YYFPRINTF (yyoutput, ")"); } @@ -729,17 +755,20 @@ #if (defined __STDC__ || defined __C99__FUNC__ \ || defined __cplusplus || defined _MSC_VER) static void -yy_stack_print (yytype_int16 *bottom, yytype_int16 *top) +yy_stack_print (yytype_int16 *yybottom, yytype_int16 *yytop) #else static void -yy_stack_print (bottom, top) - yytype_int16 *bottom; - yytype_int16 *top; +yy_stack_print (yybottom, yytop) + yytype_int16 *yybottom; + yytype_int16 *yytop; #endif { YYFPRINTF (stderr, "Stack now"); - for (; bottom <= top; ++bottom) - YYFPRINTF (stderr, " %d", *bottom); + for (; yybottom <= yytop; yybottom++) + { + int yybot = *yybottom; + YYFPRINTF (stderr, " %d", yybot); + } YYFPRINTF (stderr, "\n"); } @@ -757,12 +786,13 @@ #if (defined __STDC__ || defined __C99__FUNC__ \ || defined __cplusplus || defined _MSC_VER) static void -yy_reduce_print (YYSTYPE *yyvsp, int yyrule) +yy_reduce_print (YYSTYPE *yyvsp, int yyrule, parser_arg *arg) #else static void -yy_reduce_print (yyvsp, yyrule) +yy_reduce_print (yyvsp, yyrule, arg) YYSTYPE *yyvsp; int yyrule; + parser_arg *arg; #endif { int yynrhs = yyr2[yyrule]; @@ -773,18 +803,18 @@ /* The symbols being reduced. */ for (yyi = 0; yyi < yynrhs; yyi++) { - fprintf (stderr, " $%d = ", yyi + 1); + YYFPRINTF (stderr, " $%d = ", yyi + 1); yy_symbol_print (stderr, yyrhs[yyprhs[yyrule] + yyi], &(yyvsp[(yyi + 1) - (yynrhs)]) - ); - fprintf (stderr, "\n"); + , arg); + YYFPRINTF (stderr, "\n"); } } # define YY_REDUCE_PRINT(Rule) \ do { \ if (yydebug) \ - yy_reduce_print (yyvsp, Rule); \ + yy_reduce_print (yyvsp, Rule, arg); \ } while (YYID (0)) /* Nonzero means print parse trace. It is left uninitialized so that @@ -1035,16 +1065,18 @@ #if (defined __STDC__ || defined __C99__FUNC__ \ || defined __cplusplus || defined _MSC_VER) static void -yydestruct (const char *yymsg, int yytype, YYSTYPE *yyvaluep) +yydestruct (const char *yymsg, int yytype, YYSTYPE *yyvaluep, parser_arg *arg) #else static void -yydestruct (yymsg, yytype, yyvaluep) +yydestruct (yymsg, yytype, yyvaluep, arg) const char *yymsg; int yytype; YYSTYPE *yyvaluep; + parser_arg *arg; #endif { YYUSE (yyvaluep); + YYUSE (arg); if (!yymsg) yymsg = "Deleting"; @@ -1057,10 +1089,8 @@ break; } } - /* Prevent warnings from -Wmissing-prototypes. */ - #ifdef YYPARSE_PARAM #if defined __STDC__ || defined __cplusplus int yyparse (void *YYPARSE_PARAM); @@ -1069,18 +1099,17 @@ #endif #else /* ! YYPARSE_PARAM */ #if defined __STDC__ || defined __cplusplus -int yyparse (void); +int yyparse (parser_arg *arg); #else int yyparse (); #endif #endif /* ! YYPARSE_PARAM */ - -/* The look-ahead symbol. */ +/* The lookahead symbol. */ int yychar; -/* The semantic value of the look-ahead symbol. */ +/* The semantic value of the lookahead symbol. */ YYSTYPE yylval; /* Number of syntax errors so far. */ @@ -1088,9 +1117,9 @@ -/*----------. -| yyparse. | -`----------*/ +/*-------------------------. +| yyparse or yypush_parse. | +`-------------------------*/ #ifdef YYPARSE_PARAM #if (defined __STDC__ || defined __C99__FUNC__ \ @@ -1106,74 +1135,76 @@ #if (defined __STDC__ || defined __C99__FUNC__ \ || defined __cplusplus || defined _MSC_VER) int -yyparse (void) +yyparse (parser_arg *arg) #else int -yyparse () - +yyparse (arg) + parser_arg *arg; #endif #endif { - - int yystate; - int yyn; - int yyresult; - /* Number of tokens to shift before error messages enabled. */ - int yyerrstatus; - /* Look-ahead token as an internal (translated) token number. */ - int yytoken = 0; -#if YYERROR_VERBOSE - /* Buffer for error messages, and its allocated size. */ - char yymsgbuf[128]; - char *yymsg = yymsgbuf; - YYSIZE_T yymsg_alloc = sizeof yymsgbuf; -#endif - /* Three stacks and their tools: - `yyss': related to states, - `yyvs': related to semantic values, - `yyls': related to locations. - - Refer to the stacks thru separate pointers, to allow yyoverflow - to reallocate them elsewhere. */ - - /* The state stack. */ - yytype_int16 yyssa[YYINITDEPTH]; - yytype_int16 *yyss = yyssa; - yytype_int16 *yyssp; - - /* The semantic value stack. */ - YYSTYPE yyvsa[YYINITDEPTH]; - YYSTYPE *yyvs = yyvsa; - YYSTYPE *yyvsp; + int yystate; + /* Number of tokens to shift before error messages enabled. */ + int yyerrstatus; + /* The stacks and their tools: + `yyss': related to states. + `yyvs': related to semantic values. -#define YYPOPSTACK(N) (yyvsp -= (N), yyssp -= (N)) + Refer to the stacks thru separate pointers, to allow yyoverflow + to reallocate them elsewhere. */ + + /* The state stack. */ + yytype_int16 yyssa[YYINITDEPTH]; + yytype_int16 *yyss; + yytype_int16 *yyssp; + + /* The semantic value stack. */ + YYSTYPE yyvsa[YYINITDEPTH]; + YYSTYPE *yyvs; + YYSTYPE *yyvsp; - YYSIZE_T yystacksize = YYINITDEPTH; + YYSIZE_T yystacksize; + int yyn; + int yyresult; + /* Lookahead token as an internal (translated) token number. */ + int yytoken; /* The variables used to return semantic value and location from the action routines. */ YYSTYPE yyval; +#if YYERROR_VERBOSE + /* Buffer for error messages, and its allocated size. */ + char yymsgbuf[128]; + char *yymsg = yymsgbuf; + YYSIZE_T yymsg_alloc = sizeof yymsgbuf; +#endif + +#define YYPOPSTACK(N) (yyvsp -= (N), yyssp -= (N)) /* The number of symbols on the RHS of the reduced rule. Keep to zero when no symbol should be popped. */ int yylen = 0; + yytoken = 0; + yyss = yyssa; + yyvs = yyvsa; + yystacksize = YYINITDEPTH; + YYDPRINTF ((stderr, "Starting parse\n")); yystate = 0; yyerrstatus = 0; yynerrs = 0; - yychar = YYEMPTY; /* Cause a token to be read. */ + yychar = YYEMPTY; /* Cause a token to be read. */ /* Initialize stack pointers. Waste one element of value and location stack so that they stay on the same level as the state stack. The wasted elements are never initialized. */ - yyssp = yyss; yyvsp = yyvs; @@ -1203,7 +1234,6 @@ YYSTYPE *yyvs1 = yyvs; yytype_int16 *yyss1 = yyss; - /* Each stack pointer address is followed by the size of the data in use in that stack, in bytes. This used to be a conditional around just the two extra args, but that might @@ -1211,7 +1241,6 @@ yyoverflow (YY_("memory exhausted"), &yyss1, yysize * sizeof (*yyssp), &yyvs1, yysize * sizeof (*yyvsp), - &yystacksize); yyss = yyss1; @@ -1234,9 +1263,8 @@ (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize)); if (! yyptr) goto yyexhaustedlab; - YYSTACK_RELOCATE (yyss); - YYSTACK_RELOCATE (yyvs); - + YYSTACK_RELOCATE (yyss_alloc, yyss); + YYSTACK_RELOCATE (yyvs_alloc, yyvs); # undef YYSTACK_RELOCATE if (yyss1 != yyssa) YYSTACK_FREE (yyss1); @@ -1247,7 +1275,6 @@ yyssp = yyss + yysize - 1; yyvsp = yyvs + yysize - 1; - YYDPRINTF ((stderr, "Stack size increased to %lu\n", (unsigned long int) yystacksize)); @@ -1257,6 +1284,9 @@ YYDPRINTF ((stderr, "Entering state %d\n", yystate)); + if (yystate == YYFINAL) + YYACCEPT; + goto yybackup; /*-----------. @@ -1265,16 +1295,16 @@ yybackup: /* Do appropriate processing given the current state. Read a - look-ahead token if we need one and don't already have one. */ + lookahead token if we need one and don't already have one. */ - /* First try to decide what to do without reference to look-ahead token. */ + /* First try to decide what to do without reference to lookahead token. */ yyn = yypact[yystate]; if (yyn == YYPACT_NINF) goto yydefault; - /* Not known => get a look-ahead token if don't already have one. */ + /* Not known => get a lookahead token if don't already have one. */ - /* YYCHAR is either YYEMPTY or YYEOF or a valid look-ahead symbol. */ + /* YYCHAR is either YYEMPTY or YYEOF or a valid lookahead symbol. */ if (yychar == YYEMPTY) { YYDPRINTF ((stderr, "Reading a token: ")); @@ -1306,20 +1336,16 @@ goto yyreduce; } - if (yyn == YYFINAL) - YYACCEPT; - /* Count tokens shifted since error; after three, turn off error status. */ if (yyerrstatus) yyerrstatus--; - /* Shift the look-ahead token. */ + /* Shift the lookahead token. */ YY_SYMBOL_PRINT ("Shifting", yytoken, &yylval, &yylloc); - /* Discard the shifted token unless it is eof. */ - if (yychar != YYEOF) - yychar = YYEMPTY; + /* Discard the shifted token. */ + yychar = YYEMPTY; yystate = yyn; *++yyvsp = yylval; @@ -1359,27 +1385,37 @@ switch (yyn) { case 2: -#line 94 "Error.y" + +/* Line 1455 of yacc.c */ +#line 103 "Error.yy" { (yyval.boolean) = (yyvsp[(3) - (5)].boolean); STATUS(arg) = (yyvsp[(3) - (5)].boolean); ;} break; case 3: -#line 97 "Error.y" + +/* Line 1455 of yacc.c */ +#line 106 "Error.yy" { (yyval.boolean) = (yyvsp[(1) - (1)].boolean); ;} break; case 4: -#line 100 "Error.y" + +/* Line 1455 of yacc.c */ +#line 109 "Error.yy" { (yyval.boolean) = (yyvsp[(1) - (2)].boolean) && (yyvsp[(2) - (2)].boolean); ;} break; case 5: -#line 101 "Error.y" + +/* Line 1455 of yacc.c */ +#line 110 "Error.yy" { (yyval.boolean) = (yyvsp[(1) - (1)].boolean); ;} break; case 6: -#line 105 "Error.y" + +/* Line 1455 of yacc.c */ +#line 114 "Error.yy" { ERROR_OBJ(arg)->set_error_code((ErrorCode)(yyvsp[(3) - (4)].integer)); (yyval.boolean) = true; @@ -1387,22 +1423,27 @@ break; case 7: -#line 112 "Error.y" + +/* Line 1455 of yacc.c */ +#line 121 "Error.yy" { ERROR_OBJ(arg)->set_error_message((yyvsp[(3) - (3)].string)); ;} break; case 8: -#line 116 "Error.y" + +/* Line 1455 of yacc.c */ +#line 125 "Error.yy" { (yyval.boolean) = true; ;} break; -/* Line 1267 of yacc.c. */ -#line 1406 "Error.tab.cc" + +/* Line 1455 of yacc.c */ +#line 1447 "Error.tab.cc" default: break; } YY_SYMBOL_PRINT ("-> $$ =", yyr1[yyn], &yyval, &yyloc); @@ -1413,7 +1454,6 @@ *++yyvsp = yyval; - /* Now `shift' the result of the reduction. Determine what state that goes to, based on the state we popped back to and the rule number reduced by. */ @@ -1438,7 +1478,7 @@ { ++yynerrs; #if ! YYERROR_VERBOSE - yyerror (YY_("syntax error")); + yyerror (arg, YY_("syntax error")); #else { YYSIZE_T yysize = yysyntax_error (0, yystate, yychar); @@ -1462,11 +1502,11 @@ if (0 < yysize && yysize <= yymsg_alloc) { (void) yysyntax_error (yymsg, yystate, yychar); - yyerror (yymsg); + yyerror (arg, yymsg); } else { - yyerror (YY_("syntax error")); + yyerror (arg, YY_("syntax error")); if (yysize != 0) goto yyexhaustedlab; } @@ -1478,7 +1518,7 @@ if (yyerrstatus == 3) { - /* If just tried and failed to reuse look-ahead token after an + /* If just tried and failed to reuse lookahead token after an error, discard it. */ if (yychar <= YYEOF) @@ -1490,12 +1530,12 @@ else { yydestruct ("Error: discarding", - yytoken, &yylval); + yytoken, &yylval, arg); yychar = YYEMPTY; } } - /* Else will try to reuse look-ahead token after shifting the error + /* Else will try to reuse lookahead token after shifting the error token. */ goto yyerrlab1; @@ -1546,15 +1586,12 @@ yydestruct ("Error: popping", - yystos[yystate], yyvsp); + yystos[yystate], yyvsp, arg); YYPOPSTACK (1); yystate = *yyssp; YY_STACK_PRINT (yyss, yyssp); } - if (yyn == YYFINAL) - YYACCEPT; - *++yyvsp = yylval; @@ -1579,20 +1616,20 @@ yyresult = 1; goto yyreturn; -#ifndef yyoverflow +#if !defined(yyoverflow) || YYERROR_VERBOSE /*-------------------------------------------------. | yyexhaustedlab -- memory exhaustion comes here. | `-------------------------------------------------*/ yyexhaustedlab: - yyerror (YY_("memory exhausted")); + yyerror (arg, YY_("memory exhausted")); yyresult = 2; /* Fall through. */ #endif yyreturn: - if (yychar != YYEOF && yychar != YYEMPTY) + if (yychar != YYEMPTY) yydestruct ("Cleanup: discarding lookahead", - yytoken, &yylval); + yytoken, &yylval, arg); /* Do not reclaim the symbols of the rule which action triggered this YYABORT or YYACCEPT. */ YYPOPSTACK (yylen); @@ -1600,7 +1637,7 @@ while (yyssp != yyss) { yydestruct ("Cleanup: popping", - yystos[*yyssp], yyvsp); + yystos[*yyssp], yyvsp, arg); YYPOPSTACK (1); } #ifndef yyoverflow @@ -1616,11 +1653,13 @@ } -#line 121 "Error.y" + +/* Line 1675 of yacc.c */ +#line 130 "Error.yy" void -Errorerror(char *s) +Errorerror(parser_arg *, const string &s) { string msg = s; msg += " line: "; diff -Nru libdap-3.11.1/Error.tab.hh libdap-3.12.0/Error.tab.hh --- libdap-3.11.1/Error.tab.hh 2011-05-06 17:50:25.000000000 +0000 +++ libdap-3.12.0/Error.tab.hh 2013-10-17 21:27:40.000000000 +0000 @@ -1,24 +1,23 @@ -/* A Bison parser, made by GNU Bison 2.3. */ -/* Skeleton interface for Bison's Yacc-like parsers in C +/* A Bison parser, made by GNU Bison 2.4.1. */ - Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004, 2005, 2006 +/* Skeleton interface for Bison's Yacc-like parsers in C + + Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc. - - This program is free software; you can redistribute it and/or modify + + This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2, or (at your option) - any later version. - + the Free Software Foundation, either version 3 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., 51 Franklin Street, Fifth Floor, - Boston, MA 02110-1301, USA. */ + along with this program. If not, see . */ /* As a special exception, you may create a larger work that contains part or all of the Bison parser skeleton and distribute that work @@ -29,10 +28,47 @@ special exception, which will cause the skeleton and the resulting Bison output files to be licensed under the GNU General Public License without this special exception. - + This special exception was added by the Free Software Foundation in version 2.2 of Bison. */ +/* "%code requires" blocks. */ + +/* Line 1676 of yacc.c */ +#line 32 "Error.yy" + + +#include "config_dap.h" + +#include + +#include "Error.h" + +#include "parser.h" +#include "debug.h" +#include "util.h" + +using namespace std; +using namespace libdap; + +// These macros are used to access the `arguments' passed to the parser. A +// pointer to an error object and a pointer to an integer status variable are +// passed in to the parser within a structure (which itself is passed as a +// pointer). Note that the ERROR macro explicitly casts OBJ to an ERROR *. + +#define ERROR_OBJ(arg) ((Error *)((parser_arg *)(arg))->_object) +#define STATUS(arg) ((parser_arg *)(arg))->_status + +//#define YYPARSE_PARAM arg + +extern int error_line_num; // defined in Error.lex + + + + +/* Line 1676 of yacc.c */ +#line 71 "Error.tab.hh" + /* Tokens. */ #ifndef YYTOKENTYPE # define YYTOKENTYPE @@ -46,20 +82,16 @@ SCAN_MSG = 262 }; #endif -/* Tokens. */ -#define SCAN_INT 258 -#define SCAN_STR 259 -#define SCAN_ERROR 260 -#define SCAN_CODE 261 -#define SCAN_MSG 262 - #if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED typedef union YYSTYPE -#line 66 "Error.y" { + +/* Line 1676 of yacc.c */ +#line 75 "Error.yy" + #ifdef __SUNPRO_CC int boolean; #else @@ -67,14 +99,17 @@ #endif int integer; char *string; -} -/* Line 1489 of yacc.c. */ -#line 73 "Error.tab.hh" - YYSTYPE; + + + +/* Line 1676 of yacc.c */ +#line 107 "Error.tab.hh" +} YYSTYPE; +# define YYSTYPE_IS_TRIVIAL 1 # define yystype YYSTYPE /* obsolescent; will be withdrawn */ # define YYSTYPE_IS_DECLARED 1 -# define YYSTYPE_IS_TRIVIAL 1 #endif extern YYSTYPE Errorlval; + diff -Nru libdap-3.11.1/Error.y libdap-3.12.0/Error.y --- libdap-3.11.1/Error.y 2011-04-29 13:19:43.000000000 +0000 +++ libdap-3.12.0/Error.y 1970-01-01 00:00:00.000000000 +0000 @@ -1,133 +0,0 @@ - -// -*- mode: c++; c-basic-offset:4 -*- - -// This file is part of libdap, A C++ implementation of the OPeNDAP Data -// Access Protocol. - -// Copyright (c) 2002,2003 OPeNDAP, Inc. -// Author: James Gallagher -// -// This library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Lesser General Public -// License as published by the Free Software Foundation; either -// version 2.1 of the License, or (at your option) any later version. -// -// This library 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 -// Lesser General Public License for more details. -// -// You should have received a copy of the GNU Lesser General Public -// License along with this library; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -// -// You can contact OPeNDAP, Inc. at PO Box 112, Saunderstown, RI. 02874-0112. - -// (c) COPYRIGHT URI/MIT 1997,1999 -// Please read the full copyright statement in the file COPYRIGHT_URI. -// -// Authors: -// jhrg,jimg James Gallagher - -%{ - -#include "config_dap.h" - -static char rcsid[] not_used = {"$Id: Error.y 18315 2008-03-03 20:14:44Z jimg $"}; - -#include - -#include "Error.h" - -#include "parser.h" -#include "debug.h" -#include "util.h" - -using namespace std; -using namespace libdap; - -// These macros are used to access the `arguments' passed to the parser. A -// pointer to an error object and a pointer to an integer status variable are -// passed in to the parser within a structure (which itself is passed as a -// pointer). Note that the ERROR macro explicitly casts OBJ to an ERROR *. - -#define ERROR_OBJ(arg) ((Error *)((parser_arg *)(arg))->_object) -#define STATUS(arg) ((parser_arg *)(arg))->_status - -#define YYPARSE_PARAM arg - -extern int error_line_num; // defined in Error.lex - -int Errorlex(); // the scanner -void Errorerror(char *s); // gotta love automatically generated names... - -%} - -%union { -#ifdef __SUNPRO_CC - int boolean; -#else - bool boolean; -#endif - int integer; - char *string; -} - -%token SCAN_INT -%token SCAN_STR - -%token SCAN_ERROR -%token SCAN_CODE -%token SCAN_MSG - -%type error_object contents description code message - -%% - -// The parser is called through a function named ERRORPARSE which takes a -// pointer to a structure and returns a boolean. The structure contains a -// pointer to an Error object which is empty and an integer which contains -// status information. In addition the parser_arg structure contains a -// pointer to an error object. However, the `error' member of parser_arg is -// not yet used here. - -error_object: SCAN_ERROR '{' contents '}' ';' { $$ = $3; STATUS(arg) = $3; } -; - -contents: description { $$ = $1; } -; - -description: code message { $$ = $1 && $2; } - | code { $$ = $1; } -; - -code: SCAN_CODE '=' SCAN_INT ';' - { - ERROR_OBJ(arg)->set_error_code((ErrorCode)$3); - $$ = true; - } -; - -message: SCAN_MSG '=' SCAN_STR - { - ERROR_OBJ(arg)->set_error_message($3); - } - ';' - { - $$ = true; - } -; - -%% - -void -Errorerror(char *s) -{ - string msg = s; - msg += " line: "; - append_long_to_string(error_line_num, 10, msg); - msg += "\n"; - - throw Error(unknown_error, msg); -} - diff -Nru libdap-3.11.1/Error.yy libdap-3.12.0/Error.yy --- libdap-3.11.1/Error.yy 1970-01-01 00:00:00.000000000 +0000 +++ libdap-3.12.0/Error.yy 2013-10-17 21:27:40.000000000 +0000 @@ -0,0 +1,142 @@ + +// -*- mode: c++; c-basic-offset:4 -*- + +// This file is part of libdap, A C++ implementation of the OPeNDAP Data +// Access Protocol. + +// Copyright (c) 2002,2003 OPeNDAP, Inc. +// Author: James Gallagher +// +// This library is free software; you can redistribute it and/or +// modify it under the terms of the GNU Lesser General Public +// License as published by the Free Software Foundation; either +// version 2.1 of the License, or (at your option) any later version. +// +// This library 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 +// Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// +// You can contact OPeNDAP, Inc. at PO Box 112, Saunderstown, RI. 02874-0112. + +// (c) COPYRIGHT URI/MIT 1997,1999 +// Please read the full copyright statement in the file COPYRIGHT_URI. +// +// Authors: +// jhrg,jimg James Gallagher + +%code requires { + +#include "config_dap.h" + +#include + +#include "Error.h" + +#include "parser.h" +#include "debug.h" +#include "util.h" + +using namespace std; +using namespace libdap; + +// These macros are used to access the `arguments' passed to the parser. A +// pointer to an error object and a pointer to an integer status variable are +// passed in to the parser within a structure (which itself is passed as a +// pointer). Note that the ERROR macro explicitly casts OBJ to an ERROR *. + +#define ERROR_OBJ(arg) ((Error *)((parser_arg *)(arg))->_object) +#define STATUS(arg) ((parser_arg *)(arg))->_status + +//#define YYPARSE_PARAM arg + +extern int error_line_num; // defined in Error.lex + +} + +%code { + +int Errorlex(); // the scanner +void Errorerror(parser_arg *arg, const string &s); // gotta love automatically generated names... + +} + +%require "2.4" +%parse-param {parser_arg *arg} +%name-prefix "Error" +%defines +%debug +%verbose + +%union { +#ifdef __SUNPRO_CC + int boolean; +#else + bool boolean; +#endif + int integer; + char *string; +} + +%token SCAN_INT +%token SCAN_STR + +%token SCAN_ERROR +%token SCAN_CODE +%token SCAN_MSG + +%type error_object contents description code message + +%% + +// The parser is called through a function named ERRORPARSE which takes a +// pointer to a structure and returns a boolean. The structure contains a +// pointer to an Error object which is empty and an integer which contains +// status information. In addition the parser_arg structure contains a +// pointer to an error object. However, the `error' member of parser_arg is +// not yet used here. + +error_object: SCAN_ERROR '{' contents '}' ';' { $$ = $3; STATUS(arg) = $3; } +; + +contents: description { $$ = $1; } +; + +description: code message { $$ = $1 && $2; } + | code { $$ = $1; } +; + +code: SCAN_CODE '=' SCAN_INT ';' + { + ERROR_OBJ(arg)->set_error_code((ErrorCode)$3); + $$ = true; + } +; + +message: SCAN_MSG '=' SCAN_STR + { + ERROR_OBJ(arg)->set_error_message($3); + } + ';' + { + $$ = true; + } +; + +%% + +void +Errorerror(parser_arg *, const string &s) +{ + string msg = s; + msg += " line: "; + append_long_to_string(error_line_num, 10, msg); + msg += "\n"; + + throw Error(unknown_error, msg); +} + diff -Nru libdap-3.11.1/EventHandler.h libdap-3.12.0/EventHandler.h --- libdap-3.11.1/EventHandler.h 2011-04-29 13:19:43.000000000 +0000 +++ libdap-3.12.0/EventHandler.h 2013-10-17 21:27:40.000000000 +0000 @@ -19,7 +19,7 @@ // // You should have received a copy of the GNU Lesser General Public // License along with this library; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA // // You can contact OPeNDAP, Inc. at PO Box 112, Saunderstown, RI. 02874-0112. diff -Nru libdap-3.11.1/Float32.cc libdap-3.12.0/Float32.cc --- libdap-3.11.1/Float32.cc 2011-04-29 13:19:43.000000000 +0000 +++ libdap-3.12.0/Float32.cc 2013-10-17 21:27:40.000000000 +0000 @@ -19,7 +19,7 @@ // // You should have received a copy of the GNU Lesser General Public // License along with this library; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA // // You can contact OPeNDAP, Inc. at PO Box 112, Saunderstown, RI. 02874-0112. @@ -33,28 +33,26 @@ // // 3/22/99 jhrg - -#include - #include "config.h" -static char rcsid[] not_used = - {"$Id: Float32.cc 21699 2009-11-05 00:06:01Z jimg $" - }; +#include +#include -#include "Byte.h" +#include "Byte.h" // synonymous with UInt8 and Char +#include "Int8.h" #include "Int16.h" #include "UInt16.h" #include "Int32.h" #include "UInt32.h" +#include "Int64.h" +#include "UInt64.h" #include "Float32.h" #include "Float64.h" #include "Str.h" #include "Url.h" -#include "Array.h" -#include "Structure.h" -#include "Sequence.h" -#include "Grid.h" + +#include "Marshaller.h" +#include "UnMarshaller.h" #include "DDS.h" #include "util.h" @@ -93,7 +91,7 @@ Float32::Float32(const Float32 ©_from) : BaseType(copy_from) { - _buf = copy_from._buf; + d_buf = copy_from.d_buf; } BaseType * @@ -110,13 +108,13 @@ dynamic_cast(*this) = rhs; - _buf = rhs._buf; + d_buf = rhs.d_buf; return *this; } unsigned int -Float32::width() +Float32::width(bool) { return sizeof(dods_float32); } @@ -137,7 +135,7 @@ dds.timeout_off(); - m.put_float32( _buf ) ; + m.put_float32( d_buf ) ; return true; } @@ -145,7 +143,7 @@ bool Float32::deserialize(UnMarshaller &um, DDS *, bool) { - um.get_float32( _buf ) ; + um.get_float32( d_buf ) ; return false; } @@ -162,7 +160,7 @@ throw InternalErr(__FILE__, __LINE__, "The incoming pointer does not contain any data."); - _buf = *(dods_float32 *)val; + d_buf = *(dods_float32 *)val; return width(); } @@ -178,7 +176,7 @@ if (!*val) *val = new dods_float32; - *(dods_float32 *)*val = _buf; + *(dods_float32 *)*val = d_buf; return width(); } @@ -186,7 +184,7 @@ bool Float32::set_value(dods_float32 f) { - _buf = f; + d_buf = f; set_read_p(true); return true; @@ -200,24 +198,16 @@ dods_float32 Float32::value() const { - return _buf; + return d_buf; } -#if FILE_METHODS void Float32::print_val(FILE *out, string space, bool print_decl_p) { - // FIX: need to set precision in the printing somehow. - // os.precision(DODS_FLT_DIG); - - if (print_decl_p) { - print_decl(out, space, false); - fprintf(out, " = %.6g;\n", _buf) ; - } - else - fprintf(out, "%.6g", _buf) ; + ostringstream oss; + print_val(oss, space, print_decl_p); + fwrite(oss.str().data(), sizeof(char), oss.str().length(), out); } -#endif void Float32::print_val(ostream &out, string space, bool print_decl_p) @@ -227,10 +217,10 @@ if (print_decl_p) { print_decl(out, space, false); - out << " = " << std::setprecision( 6 ) << _buf << ";\n" ; + out << " = " << std::setprecision( 6 ) << d_buf << ";\n" ; } else - out << std::setprecision( 6 ) << _buf ; + out << std::setprecision( 6 ) << d_buf ; } bool @@ -251,29 +241,28 @@ } switch (b->type()) { - case dods_byte_c: - return rops > - (_buf, dynamic_cast(b)->_buf, op); - case dods_int16_c: - return rops > - (_buf, dynamic_cast(b)->_buf, op); - case dods_uint16_c: - return rops > - (_buf, dynamic_cast(b)->_buf, op); - case dods_int32_c: - return rops > - (_buf, dynamic_cast(b)->_buf, op); - case dods_uint32_c: - return rops > - (_buf, dynamic_cast(b)->_buf, op); - case dods_float32_c: - return rops > - (_buf, dynamic_cast(b)->_buf, op); - case dods_float64_c: - return rops > - (_buf, dynamic_cast(b)->_buf, op); - default: - return false; + case dods_int8_c: + return Cmp(op, d_buf, static_cast(b)->value()); + case dods_byte_c: + return SUCmp(op, d_buf, static_cast(b)->value()); + case dods_int16_c: + return Cmp(op, d_buf, static_cast(b)->value()); + case dods_uint16_c: + return SUCmp(op, d_buf, static_cast(b)->value()); + case dods_int32_c: + return Cmp(op, d_buf, static_cast(b)->value()); + case dods_uint32_c: + return SUCmp(op, d_buf, static_cast(b)->value()); + case dods_int64_c: + return Cmp(op, d_buf, static_cast(b)->value()); + case dods_uint64_c: + return SUCmp(op, d_buf, static_cast(b)->value()); + case dods_float32_c: + return Cmp(op, d_buf, static_cast(b)->value()); + case dods_float64_c: + return Cmp(op, d_buf, static_cast(b)->value()); + default: + return false; } } @@ -292,7 +281,7 @@ << endl ; DapIndent::Indent() ; BaseType::dump(strm) ; - strm << DapIndent::LMarg << "value: " << _buf << endl ; + strm << DapIndent::LMarg << "value: " << d_buf << endl ; DapIndent::UnIndent() ; } diff -Nru libdap-3.11.1/Float32.h libdap-3.12.0/Float32.h --- libdap-3.11.1/Float32.h 2011-04-29 13:19:43.000000000 +0000 +++ libdap-3.12.0/Float32.h 2013-10-17 21:27:40.000000000 +0000 @@ -19,7 +19,7 @@ // // You should have received a copy of the GNU Lesser General Public // License along with this library; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA // // You can contact OPeNDAP, Inc. at PO Box 112, Saunderstown, RI. 02874-0112. @@ -49,8 +49,6 @@ #include "ConstraintEvaluator.h" #endif -#define FILE_METHODS 1 - namespace libdap { @@ -60,18 +58,8 @@ */ class Float32: public BaseType { - /** This class allows Byte, ..., Float64 access to _buf - to simplify and speed up the relational operators. */ - - friend class Byte; - friend class Int16; - friend class UInt16; - friend class Int32; - friend class UInt32; - friend class Float64; - protected: - dods_float32 _buf; + dods_float32 d_buf; public: Float32(const string &n); @@ -86,7 +74,7 @@ virtual BaseType *ptr_duplicate(); - virtual unsigned int width(); + virtual unsigned int width(bool constrained = false); virtual bool serialize(ConstraintEvaluator &eval, DDS &dds, Marshaller &m, bool ce_eval = true); @@ -97,10 +85,9 @@ virtual dods_float32 value() const; virtual bool set_value(dods_float32 f); -#if FILE_METHODS + virtual void print_val(FILE *out, string space = "", bool print_decl_p = true); -#endif virtual void print_val(ostream &out, string space = "", bool print_decl_p = true); diff -Nru libdap-3.11.1/Float64.cc libdap-3.12.0/Float64.cc --- libdap-3.11.1/Float64.cc 2011-04-29 13:19:43.000000000 +0000 +++ libdap-3.12.0/Float64.cc 2013-10-17 21:27:40.000000000 +0000 @@ -19,7 +19,7 @@ // // You should have received a copy of the GNU Lesser General Public // License along with this library; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA // // You can contact OPeNDAP, Inc. at PO Box 112, Saunderstown, RI. 02874-0112. @@ -33,31 +33,28 @@ // // jhrg 9/7/94 -#include - #include "config.h" -static char rcsid[] not_used = - {"$Id: Float64.cc 21699 2009-11-05 00:06:01Z jimg $" - }; - +#include #include -#include "Byte.h" +#include "Byte.h" // synonymous with UInt8 and Char +#include "Int8.h" #include "Int16.h" #include "UInt16.h" #include "Int32.h" #include "UInt32.h" +#include "Int64.h" +#include "UInt64.h" #include "Float32.h" #include "Float64.h" #include "Str.h" #include "Url.h" -#include "Array.h" -#include "Structure.h" -#include "Sequence.h" -#include "Grid.h" #include "DDS.h" +#include "Marshaller.h" +#include "UnMarshaller.h" + #include "util.h" #include "parser.h" #include "Operators.h" @@ -95,7 +92,7 @@ Float64::Float64(const Float64 ©_from) : BaseType(copy_from) { - _buf = copy_from._buf; + d_buf = copy_from.d_buf; } BaseType * @@ -112,13 +109,13 @@ dynamic_cast(*this) = rhs; - _buf = rhs._buf; + d_buf = rhs.d_buf; return *this; } unsigned int -Float64::width() +Float64::width(bool) { return sizeof(dods_float64); } @@ -139,7 +136,7 @@ dds.timeout_off(); - m.put_float64( _buf ) ; + m.put_float64( d_buf ) ; return true; } @@ -147,7 +144,7 @@ bool Float64::deserialize(UnMarshaller &um, DDS *, bool) { - um.get_float64( _buf ) ; + um.get_float64( d_buf ) ; return false; } @@ -163,7 +160,7 @@ throw InternalErr(__FILE__, __LINE__, "The incoming pointer does not contain any data."); - _buf = *(dods_float64 *)val; + d_buf = *(dods_float64 *)val; return width(); } @@ -179,7 +176,7 @@ if (!*val) *val = new dods_float64; - *(dods_float64 *)*val = _buf; + *(dods_float64 *)*val = d_buf; return width(); } @@ -192,33 +189,25 @@ dods_float64 Float64::value() const { - return _buf; + return d_buf; } bool Float64::set_value(dods_float64 val) { - _buf = val; + d_buf = val; set_read_p(true); return true; } -#if FILE_METHODS void Float64::print_val(FILE *out, string space, bool print_decl_p) { - // FIX: need to set precision in the printing somehow. - // os.precision(DODS_DBL_DIG); - - if (print_decl_p) { - print_decl(out, space, false); - fprintf(out, " = %.15g;\n", _buf) ; - } - else - fprintf(out, "%.15g", _buf) ; + ostringstream oss; + print_val(oss, space, print_decl_p); + fwrite(oss.str().data(), sizeof(char), oss.str().length(), out); } -#endif void Float64::print_val(ostream &out, string space, bool print_decl_p) @@ -228,10 +217,10 @@ if (print_decl_p) { print_decl(out, space, false); - out << " = " << std::setprecision( 15 ) << _buf << ";\n" ; + out << " = " << std::setprecision( 15 ) << d_buf << ";\n" ; } else - out << std::setprecision( 15 ) << _buf ; + out << std::setprecision( 15 ) << d_buf ; } bool @@ -258,29 +247,28 @@ } switch (b->type()) { - case dods_byte_c: - return rops > - (_buf, dynamic_cast(b)->_buf, op); - case dods_int16_c: - return rops > - (_buf, dynamic_cast(b)->_buf, op); - case dods_uint16_c: - return rops > - (_buf, dynamic_cast(b)->_buf, op); - case dods_int32_c: - return rops > - (_buf, dynamic_cast(b)->_buf, op); - case dods_uint32_c: - return rops > - (_buf, dynamic_cast(b)->_buf, op); - case dods_float32_c: - return rops > - (_buf, dynamic_cast(b)->_buf, op); - case dods_float64_c: - return rops > - (_buf, dynamic_cast(b)->_buf, op); - default: - return false; + case dods_int8_c: + return Cmp(op, d_buf, static_cast(b)->value()); + case dods_byte_c: + return SUCmp(op, d_buf, static_cast(b)->value()); + case dods_int16_c: + return Cmp(op, d_buf, static_cast(b)->value()); + case dods_uint16_c: + return SUCmp(op, d_buf, static_cast(b)->value()); + case dods_int32_c: + return Cmp(op, d_buf, static_cast(b)->value()); + case dods_uint32_c: + return SUCmp(op, d_buf, static_cast(b)->value()); + case dods_int64_c: + return Cmp(op, d_buf, static_cast(b)->value()); + case dods_uint64_c: + return SUCmp(op, d_buf, static_cast(b)->value()); + case dods_float32_c: + return Cmp(op, d_buf, static_cast(b)->value()); + case dods_float64_c: + return Cmp(op, d_buf, static_cast(b)->value()); + default: + return false; } } @@ -299,7 +287,7 @@ << (void *)this << ")" << endl ; DapIndent::Indent() ; BaseType::dump(strm) ; - strm << DapIndent::LMarg << "value: " << _buf << endl ; + strm << DapIndent::LMarg << "value: " << d_buf << endl ; DapIndent::UnIndent() ; } diff -Nru libdap-3.11.1/Float64.h libdap-3.12.0/Float64.h --- libdap-3.11.1/Float64.h 2011-04-29 13:19:43.000000000 +0000 +++ libdap-3.12.0/Float64.h 2013-10-17 21:27:40.000000000 +0000 @@ -19,7 +19,7 @@ // // You should have received a copy of the GNU Lesser General Public // License along with this library; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA // // You can contact OPeNDAP, Inc. at PO Box 112, Saunderstown, RI. 02874-0112. @@ -49,8 +49,6 @@ #include "ConstraintEvaluator.h" #endif -#define FILE_METHODS 1 - namespace libdap { @@ -61,20 +59,8 @@ class Float64: public BaseType { - /** This class allows Byte, ..., Float32 access to _buf to - simplify and speed up the relational operators. - - NB: According to Stroustrup it does not matter where (public, private - or protected) friend classes are declared. */ - friend class Byte; - friend class Int16; - friend class UInt16; - friend class Int32; - friend class UInt32; - friend class Float32; - protected: - dods_float64 _buf; + dods_float64 d_buf; public: Float64(const string &n); @@ -88,7 +74,7 @@ virtual BaseType *ptr_duplicate(); - virtual unsigned int width(); + virtual unsigned int width(bool constrained = false); virtual bool serialize(ConstraintEvaluator &eval, DDS &dds, Marshaller &m, bool ce_eval = true); @@ -99,10 +85,9 @@ virtual dods_float64 value() const; virtual bool set_value(dods_float64 val); -#if FILE_METHODS + virtual void print_val(FILE *out, string space = "", bool print_decl_p = true); -#endif virtual void print_val(ostream &out, string space = "", bool print_decl_p = true); diff -Nru libdap-3.11.1/GNU/GNURegex.cc libdap-3.12.0/GNU/GNURegex.cc --- libdap-3.11.1/GNU/GNURegex.cc 2011-04-29 13:19:30.000000000 +0000 +++ libdap-3.12.0/GNU/GNURegex.cc 2013-10-17 21:27:40.000000000 +0000 @@ -19,10 +19,13 @@ // // You should have received a copy of the GNU Lesser General Public // License along with this library; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA // // You can contact OPeNDAP, Inc. at PO Box 112, Saunderstown, RI. 02874-0112. + +//#define DODS_DEBUG + #include #ifndef WIN32 @@ -41,6 +44,8 @@ #include "GNURegex.h" #include "Error.h" #include "util.h" +#include "debug.h" + using namespace std; @@ -49,20 +54,33 @@ void Regex::init(const char *t) { + DBG( cerr << "Regex::init() - BEGIN" << endl); + + DBG( cerr << "Regex::init() - creating new regex..." << endl); d_preg = static_cast(new regex_t); + + DBG( cerr << "Regex::init() - Calling regcomp()..." << endl); int result = regcomp(static_cast(d_preg), t, REG_EXTENDED); if (result != 0) { + DBG( cerr << "Regex::init() - Call to regcomp FAILED" << endl); + DBG( cerr << "Regex::init() - Calling regerror()..." << endl); size_t msg_len = regerror(result, static_cast(d_preg), static_cast(NULL), static_cast(0)); + + DBG( cerr << "Regex::init() - Creating message" << endl); vector msg(msg_len+1); //char *msg = new char[msg_len+1]; + DBG( cerr << "Regex::init() - Calling regerror() again..." << endl); regerror(result, static_cast(d_preg), &msg[0], msg_len); + DBG( cerr << "Regex::init() - Throwing libdap::Error" << endl); throw Error(string("Regex error: ") + string(&msg[0])); //delete[] msg; //throw e; } + DBG( cerr << "Regex::init() - Call to regcomp() SUCCEEDED" << endl); + DBG( cerr << "Regex::init() - END" << endl); } Regex::~Regex() diff -Nru libdap-3.11.1/GNU/GNURegex.h libdap-3.12.0/GNU/GNURegex.h --- libdap-3.11.1/GNU/GNURegex.h 2011-04-29 13:19:30.000000000 +0000 +++ libdap-3.12.0/GNU/GNURegex.h 2013-10-17 21:27:40.000000000 +0000 @@ -19,7 +19,7 @@ // // You should have received a copy of the GNU Lesser General Public // License along with this library; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA // // You can contact OPeNDAP, Inc. at PO Box 112, Saunderstown, RI. 02874-0112. diff -Nru libdap-3.11.1/GNU/GetOpt.cc libdap-3.12.0/GNU/GetOpt.cc --- libdap-3.11.1/GNU/GetOpt.cc 2011-04-29 13:19:30.000000000 +0000 +++ libdap-3.12.0/GNU/GetOpt.cc 2013-10-17 21:27:40.000000000 +0000 @@ -13,10 +13,10 @@ PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this library; if not, write to the Free Software -Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +Foundation, 59 Temple Place - Fifth Floor, Boston, MA 02110-1301, USA. */ -#include +#include "config.h" /* AIX requires the alloca decl to be the first thing in the file. */ #ifdef __GNUC__ @@ -33,7 +33,7 @@ #include -#ifndef WIN32 +#ifdef HAVE_UNISTD_H #include #endif #include // Added these. 10/20/98 jhrg diff -Nru libdap-3.11.1/GNU/GetOpt.h libdap-3.12.0/GNU/GetOpt.h --- libdap-3.11.1/GNU/GetOpt.h 2011-04-29 13:19:30.000000000 +0000 +++ libdap-3.12.0/GNU/GetOpt.h 2013-10-17 21:27:40.000000000 +0000 @@ -12,7 +12,7 @@ PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this library; if not, write to the Free Software -Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +Foundation 51 Franklin Street, Suite 500, Boston, MA 02110-1335 USA. */ diff -Nru libdap-3.11.1/GSEClause.cc libdap-3.12.0/GSEClause.cc --- libdap-3.11.1/GSEClause.cc 2011-04-29 13:19:43.000000000 +0000 +++ libdap-3.12.0/GSEClause.cc 1970-01-01 00:00:00.000000000 +0000 @@ -1,351 +0,0 @@ - -// -*- mode: c++; c-basic-offset:4 -*- - -// This file is part of libdap, A C++ implementation of the OPeNDAP Data -// Access Protocol. - -// Copyright (c) 2002,2003 OPeNDAP, Inc. -// Author: James Gallagher -// -// This library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Lesser General Public -// License as published by the Free Software Foundation; either -// version 2.1 of the License, or (at your option) any later version. -// -// This library 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 -// Lesser General Public License for more details. -// -// You should have received a copy of the GNU Lesser General Public -// License along with this library; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -// -// You can contact OPeNDAP, Inc. at PO Box 112, Saunderstown, RI. 02874-0112. - -// (c) COPYRIGHT URI/MIT 1999 -// Please read the full copyright statement in the file COPYRIGHT_URI. -// -// Authors: -// jhrg,jimg James Gallagher - -// The Grid Selection Expression Clause class. - - -#include "config.h" - -static char id[] not_used = - {"$Id: GSEClause.cc 24370 2011-03-28 16:21:32Z jimg $" - }; - -#include -#include - -#include "dods-datatypes.h" -#include "Error.h" -#include "InternalErr.h" - -#include "debug.h" -#include "GSEClause.h" -#include "parser.h" -#include "gse.tab.hh" - -using namespace std; - -int gse_parse(void *arg); -void gse_restart(FILE *in); - -// Glue routines declared in gse.lex -void gse_switch_to_buffer(void *new_buffer); -void gse_delete_buffer(void * buffer); -void *gse_string(const char *yy_str); - -namespace libdap { - -// Private methods - -GSEClause::GSEClause() -{ - throw InternalErr(__FILE__, __LINE__, "default ctor called for GSEClause"); -} - -GSEClause::GSEClause(const GSEClause &) -{ - throw InternalErr(__FILE__, __LINE__, "copy ctor called for GSEClause"); -} - -GSEClause &GSEClause::operator=(GSEClause &) -{ - throw InternalErr(__FILE__, __LINE__, "assigment called for GSEClause"); -} - -// For the comparisions here, we should use an epsilon to catch issues -// with floating point values. jhrg 01/12/06 -template -static bool -compare(T elem, relop op, double value) -{ - switch (op) { - case dods_greater_op: - return elem > value; - case dods_greater_equal_op: - return elem >= value; - case dods_less_op: - return elem < value; - case dods_less_equal_op: - return elem <= value; - case dods_equal_op: - return elem == value; - case dods_not_equal_op: - return elem != value; - case dods_nop_op: - throw Error(malformed_expr, "Attempt to use NOP in Grid selection."); - default: - throw Error(malformed_expr, "Unknown relational operator in Grid selection."); - } -} - -// These values are used in error messages, hence the strings. -template -void -GSEClause::set_map_min_max_value(T min, T max) -{ - DBG(cerr << "Inside set map min max value " << min << ", " << max << endl); - std::ostringstream oss1; - oss1 << min; - d_map_min_value = oss1.str(); - - std::ostringstream oss2; - oss2 << max; - d_map_max_value = oss2.str(); -} - -// Read the map array, scan, set start and stop. -template -void -GSEClause::set_start_stop() -{ - T *vals = new T[d_map->length()]; - d_map->value(vals); - - // Set the map's max and min values for use in error messages (it's a lot - // easier to do here, now, than later... 9/20/2001 jhrg) - set_map_min_max_value(vals[d_start], vals[d_stop]); - - // Starting at the current start point in the map (initially index position - // zero), scan forward until the comparison is true. Set the new value - // of d_start to that location. Note that each clause applies to exactly - // one map. The 'i <= end' test keeps us from setting start _past_ the - // end ;-) - int i = d_start; - int end = d_stop; - while (i <= end && !compare(vals[i], d_op1, d_value1)) - i++; - - d_start = i; - - // Now scan backward from the end. We scan all the way to the actual start - // although it would probably work to stop at 'i >= d_start'. - i = end; - while (i >= 0 && !compare(vals[i], d_op1, d_value1)) - i--; - d_stop = i; - - // Every clause must have one operator but the second is optional since - // the more complex form of a clause is optional. That is, the above two - // loops took care of constraints like 'x < 7' but we need the following - // for ones like '3 < x < 7'. - if (d_op2 != dods_nop_op) { - int i = d_start; - int end = d_stop; - while (i <= end && !compare(vals[i], d_op2, d_value2)) - i++; - - d_start = i; - - i = end; - while (i >= 0 && !compare(vals[i], d_op2, d_value2)) - i--; - - d_stop = i; - } - - delete[] vals; -} - -void -GSEClause::compute_indices() -{ - switch (d_map->var()->type()) { - case dods_byte_c: - set_start_stop(); - break; - case dods_int16_c: - set_start_stop(); - break; - case dods_uint16_c: - set_start_stop(); - break; - case dods_int32_c: - set_start_stop(); - break; - case dods_uint32_c: - set_start_stop(); - break; - case dods_float32_c: - set_start_stop(); - break; - case dods_float64_c: - set_start_stop(); - break; - default: - throw Error(malformed_expr, - "Grid selection using non-numeric map vectors is not supported"); - } - -} - -// Public methods - -/** @brief Create an instance using discrete parameters. */ -GSEClause::GSEClause(Grid *grid, const string &map, const double value, - const relop op) - : d_map(0), - d_value1(value), d_value2(0), d_op1(op), d_op2(dods_nop_op), - d_map_min_value(""), d_map_max_value("") -{ - d_map = dynamic_cast(grid->var(map)); - if (!d_map) - throw Error(string("The map variable '") + map - + string("' does not exist in the grid '") - + grid->name() + string("'.")); - - DBG(cerr << d_map->toString()); - - // Initialize the start and stop indices. - Array::Dim_iter iter = d_map->dim_begin(); - d_start = d_map->dimension_start(iter); - d_stop = d_map->dimension_stop(iter); - - compute_indices(); -} - -/** @brief Create an instance using discrete parameters. */ -GSEClause::GSEClause(Grid *grid, const string &map, const double value1, - const relop op1, const double value2, const relop op2) - : d_map(0), - d_value1(value1), d_value2(value2), d_op1(op1), d_op2(op2), - d_map_min_value(""), d_map_max_value("") -{ - d_map = dynamic_cast(grid->var(map)); - if (!d_map) - throw Error(string("The map variable '") + map - + string("' does not exist in the grid '") - + grid->name() + string("'.")); - - DBG(cerr << d_map->toString()); - - // Initialize the start and stop indices. - Array::Dim_iter iter = d_map->dim_begin(); - d_start = d_map->dimension_start(iter); - d_stop = d_map->dimension_stop(iter); - - compute_indices(); -} - -/** Class invariant. - @return True if the object is valid, otherwise False. */ -bool -GSEClause::OK() const -{ - if (!d_map) - return false; - - // More ... - - return true; -} - -/** @brief Get a pointer to the map variable constrained by this clause. - @return The Array object. */ -Array * -GSEClause::get_map() const -{ - return d_map; -} - -/** @brief Set the pointer to the map vector contrained by this clause. - - Note that this method also sets the name of the map vector. - @return void */ -void -GSEClause::set_map(Array *map) -{ - d_map = map; -} - -/** @brief Get the name of the map variable constrained by this clause. - @return The Array object's name. */ -string -GSEClause::get_map_name() const -{ - return d_map->name(); -} - -/** @brief Get the starting index of the clause's map variable as - constrained by this clause. - @return The start index. */ -int -GSEClause::get_start() const -{ - return d_start; -} - -/** @brief Set the starting index. - @return void */ -void -GSEClause::set_start(int start) -{ - d_start = start; -} - -/** @brief Get the stopping index of the clause's map variable as - constrained by this clause. - @return The stop index. */ -int -GSEClause::get_stop() const -{ - DBG(cerr << "Returning stop index value of: " << d_stop << endl); - return d_stop; -} - -/** @brief Set the stopping index. - @return void */ -void -GSEClause::set_stop(int stop) -{ - d_stop = stop; -} - -/** @brief Get the minimum map vector value. - - Useful in messages back to users. - @return The minimum map vetor value. */ -string -GSEClause::get_map_min_value() const -{ - return d_map_min_value; -} - -/** @brief Get the maximum map vector value. - - Useful in messages back to users. - @return The maximum map vetor value. */ -string -GSEClause::get_map_max_value() const -{ - return d_map_max_value; -} - -} // namespace libdap - diff -Nru libdap-3.11.1/GSEClause.h libdap-3.12.0/GSEClause.h --- libdap-3.11.1/GSEClause.h 2011-04-29 13:19:43.000000000 +0000 +++ libdap-3.12.0/GSEClause.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,143 +0,0 @@ - -// -*- mode: c++; c-basic-offset:4 -*- - -// This file is part of libdap, A C++ implementation of the OPeNDAP Data -// Access Protocol. - -// Copyright (c) 2002,2003 OPeNDAP, Inc. -// Author: James Gallagher -// -// This library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Lesser General Public -// License as published by the Free Software Foundation; either -// version 2.1 of the License, or (at your option) any later version. -// -// This library 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 -// Lesser General Public License for more details. -// -// You should have received a copy of the GNU Lesser General Public -// License along with this library; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -// -// You can contact OPeNDAP, Inc. at PO Box 112, Saunderstown, RI. 02874-0112. - -// (c) COPYRIGHT URI/MIT 1999 -// Please read the full copyright statement in the file COPYRIGHT_URI. -// -// Authors: -// jhrg,jimg James Gallagher - -// The Grid Selection Expression Clause class. - -#ifndef _gseclause_h -#define _gseclause_h 1 - - -#include -#include - -#ifndef _basetype_h -#include "BaseType.h" -#endif - -#ifndef _array_h -#include "Array.h" -#endif - -#ifndef _grid_h -#include "Grid.h" -#endif - -namespace libdap -{ - -enum relop { - dods_nop_op, - dods_greater_op, - dods_greater_equal_op, - dods_less_op, - dods_less_equal_op, - dods_equal_op, - dods_not_equal_op -}; - -/** Holds the results of parsing one of the Grid Selection Expression - clauses. The Grid selection function takes a set of clauses as arguments - and must create one instance of this class for each of those clauses. The - GridSelectionExpr class holds N instances of this class. - - @author James Gallagher - @see GridSelectionExpr */ - -class GSEClause -{ -private: - Array *d_map; - // _value1, 2 and _op1, 2 hold the first and second operators and - // operands. For a clause like `var op value' only _op1 and _value1 have - // valid information. For a clause like `value op var op value' the - // second operator and operand are on _op2 and _value2. 1/19/99 jhrg - double d_value1, d_value2; - relop d_op1, d_op2; - int d_start; - int d_stop; - - string d_map_min_value, d_map_max_value; - - GSEClause(); // Hidden default constructor. - - GSEClause(const GSEClause ¶m); // Hide - GSEClause &operator=(GSEClause &rhs); // Hide - - template void set_start_stop(); - template void set_map_min_max_value(T min, T max); - - void compute_indices(); - -public: - /** @name Constructors */ - //@{ - GSEClause(Grid *grid, const string &map, const double value, - const relop op); - - GSEClause(Grid *grid, const string &map, const double value1, - const relop op1, const double value2, const relop op2); - //@} - - virtual ~GSEClause() { - delete d_map; d_map = 0; - } - - bool OK() const; - - /** @name Accessors */ - //@{ - Array *get_map() const; - - string get_map_name() const; - - int get_start() const; - - int get_stop() const; - - string get_map_min_value() const; - - string get_map_max_value() const; - //@} - - /** @name Mutators */ - //@{ - void set_map(Array *map); - - void set_start(int start); - - void set_stop(int stop); - //@} -}; - -} // namespace libdap - -#endif // _gseclause_h - diff -Nru libdap-3.11.1/GeoConstraint.cc libdap-3.12.0/GeoConstraint.cc --- libdap-3.11.1/GeoConstraint.cc 2011-04-29 13:19:43.000000000 +0000 +++ libdap-3.12.0/GeoConstraint.cc 1970-01-01 00:00:00.000000000 +0000 @@ -1,659 +0,0 @@ - -// -*- mode: c++; c-basic-offset:4 -*- - -// This file is part of libdap, A C++ implementation of the OPeNDAP Data -// Access Protocol. - -// Copyright (c) 2006 OPeNDAP, Inc. -// Author: James Gallagher -// -// This library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Lesser General Public -// License as published by the Free Software Foundation; either -// version 2.1 of the License, or (at your option) any later version. -// -// This library 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 -// Lesser General Public License for more details. -// -// You should have received a copy of the GNU Lesser General Public -// License along with this library; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -// -// You can contact OPeNDAP, Inc. at PO Box 112, Saunderstown, RI. 02874-0112. - -// The Grid Selection Expression Clause class. - - -#include "config.h" - -static char id[] not_used = - { "$Id: GeoConstraint.cc 24370 2011-03-28 16:21:32Z jimg $" - }; - -#include -#include -#include -#include -#include // for find_if - -//#define DODS_DEBUG -//#define DODS_DEBUG2 - -#include "debug.h" -#include "dods-datatypes.h" -#include "GeoConstraint.h" -#include "Float64.h" - -#include "Error.h" -#include "InternalErr.h" -#include "ce_functions.h" -#include "util.h" - -using namespace std; - -namespace libdap { - -/** This is used with find_if(). The GeoConstraint class holds a set of strings - which are prefixes for variable names. Using the regular find() locates - only the exact matches, using find_if() with this functor makes is easy - to treat those set objects as collections of prefixes. */ -class is_prefix -{ -private: - string s; -public: - is_prefix(const string & in): s(in) - {} - - bool operator()(const string & prefix) - { - return s.find(prefix) == 0; - } -}; - -/** Look in the containers which hold the units attributes and variable name - prefixes which are considered as identifying a vector as being a latitude - or longitude vector. - - @param units A container with a bunch of units attribute values. - @param names A container with a bunch of variable name prefixes. - @param var_units The value of the 'units' attribute for this variable. - @param var_name The name of the variable. - @return True if the units_value matches any of the accepted attributes - exactly or if the name_value starts with any of the accepted prefixes */ -bool -unit_or_name_match(set < string > units, set < string > names, - const string & var_units, const string & var_name) -{ - return (units.find(var_units) != units.end() - || find_if(names.begin(), names.end(), - is_prefix(var_name)) != names.end()); -} - -/** A private method that determines if the longitude part of the bounding - box uses 0/359 or -180/179 notation. This class only supports latitude - constraints which use 90/-90 notation, so there's no need to figure out - what sort of notation they use. - - @note This function assumes that if one of the two values is - negative, then the notation is or the -180/179 form, otherwise not. - If the user asks for 30 degrees to 50 degrees (or 50 to 30, - for that matter), there's no real way to tell which notation they are - using. - - @param left The left side of the bounding box, in degrees - @param right The right side of the bounding box - @return The notation (pos or neg_pos) */ -GeoConstraint::Notation -GeoConstraint::categorize_notation(const double left, - const double right) const -{ - return (left < 0 || right < 0) ? neg_pos : pos; -} - -/* A private method to translate the longitude constraint from -180/179 - notation to 0/359 notation. - - About the two notations: - 0 180 360 - |---------------------------|-------------------------| - 0 180,-180 0 - - so in the neg-pos notation (using the name I give it in this class) both - 180 and -180 are the same longitude. And in the pos notation 0 and 360 are - the same. - - @param left Value-result parameter; the left side of the bounding box - @parm right Value-result parameter; the right side of the bounding box */ -void -GeoConstraint::transform_constraint_to_pos_notation(double &left, - double &right) const -{ - if (left < 0) - left += 360 ; - - if (right < 0) - right += 360; -} - -/** Given that the Grid has a longitude map that uses the 'neg_pos' notation, - transform it to the 'pos' notation. This method modifies the d_lon array. - - @note: About the two notations: - 0 180 360 - |---------------------------|-------------------------| - 0 180,-180 0 -*/ -void GeoConstraint::transform_longitude_to_pos_notation() -{ - // Assume earlier logic is correct (since the test is expensive) - // for each value, add 180 - // Longitude could be represented using any of the numeric types - for (int i = 0; i < d_lon_length; ++i) - if (d_lon[i] < 0) - d_lon[i] += 360; -} - -/** Given that the Grid has a longitude map that uses the 'pos' notation, - transform it to the 'neg_pos' notation. This method modifies the - d_lon array. - - @note: About the two notations: - 0 180 360 - |---------------------------|-------------------------| - 0 180,-180 0 -*/ -void GeoConstraint::transform_longitude_to_neg_pos_notation() -{ - for (int i = 0; i < d_lon_length; ++i) - if (d_lon[i] > 180) - d_lon[i] -= 360; -} - -bool GeoConstraint::is_bounding_box_valid(const double left, const double top, - const double right, const double bottom) const -{ - if ((left < d_lon[0] && right < d_lon[0]) - || (left > d_lon[d_lon_length-1] && right > d_lon[d_lon_length-1])) - return false; - - if (d_latitude_sense == normal) { - // When sense is normal, the largest values are at the origin. - if ((top > d_lat[0] && bottom > d_lat[0]) - || (top < d_lat[d_lat_length-1] && bottom < d_lat[d_lat_length-1])) - return false; - } - else { - if ((top < d_lat[0] && bottom < d_lat[0]) - || (top > d_lat[d_lat_length-1] && bottom > d_lat[d_lat_length-1])) - return false; - } - - return true; -} - -/** Scan from the left to the right, and the right to the left, looking - for the left and right bounding box edges, respectively. - - @param left The left edge of the bounding box - @param right The right edge - @param longitude_index_left Value-result parameter that holds the index - in the grid's longitude map of the left bounding box edge. Uses a closed - interval for the test. - @param longitude_index_right Value-result parameter for the right edge - index. */ -void GeoConstraint::find_longitude_indeces(double left, double right, - int &longitude_index_left, int &longitude_index_right) const -{ - // Use all values 'modulo 360' to take into account the cases where the - // constraint and/or the longitude vector are given using values greater - // than 360 (i.e., when 380 is used to mean 20). - double t_left = fmod(left, 360.0); - double t_right = fmod(right, 360.0); - - // Find the place where 'longitude starts.' That is, what value of the - // index 'i' corresponds to the smallest value of d_lon. Why we do this: - // Some data sources use offset longitude axes so that the 'seam' is - // shifted to a place other than the date line. - int i = 0; - int lon_origin_index = 0; - double smallest_lon = fmod(d_lon[0], 360.0); - while (i < d_lon_length) { - double curent_lon_value = fmod(d_lon[i], 360.0); - if (smallest_lon > curent_lon_value) { - smallest_lon = curent_lon_value; - lon_origin_index = i; - } - ++i; - } - - DBG2(cerr << "lon_origin_index: " << lon_origin_index << endl); - - // Scan from the index of the smallest value looking for the place where - // the value is greater than or equal to the left most point of the bounding - // box. - i = lon_origin_index; - while (fmod(d_lon[i], 360.0) < t_left) { - ++i; - i = i % d_lon_length; - - // If we cycle completely through all the values/indices, throw - if (i == lon_origin_index) - throw Error("geogrid: Could not find an index for the longitude value '" + double_to_string(left) + "'"); - } - - if (fmod(d_lon[i], 360.0) == t_left) - longitude_index_left = i; - else - longitude_index_left = (i - 1) > 0 ? i - 1 : 0; - - DBG2(cerr << "longitude_index_left: " << longitude_index_left << endl); - - // Assume the vector is circular --> the largest value is next to the - // smallest. - int largest_lon_index = (lon_origin_index - 1 + d_lon_length) % d_lon_length; - i = largest_lon_index; - while (fmod(d_lon[i], 360.0) > t_right) { - // This is like modulus but for 'counting down' - i = (i == 0) ? d_lon_length - 1 : i - 1; - if (i == largest_lon_index) - throw Error("geogrid: Could not find an index for the longitude value '" + double_to_string(right) + "'"); - } - - if (fmod(d_lon[i], 360.0) == t_right) - longitude_index_right = i; - else - longitude_index_right = (i + 1) < d_lon_length - 1 ? i + 1 : d_lon_length - 1; - - DBG2(cerr << "longitude_index_right: " << longitude_index_right << endl); -} - -/** Scan from the top to the bottom, and the bottom to the top, looking - for the top and bottom bounding box edges, respectively. - - @param top The top edge of the bounding box - @param bottom The bottom edge - @param sense Does the array/grid store data with larger latitudes at - the starting indices or are the latitude 'upside down?' - @param latitude_index_top Value-result parameter that holds the index - in the grid's latitude map of the top bounding box edge. Uses a closed - interval for the test. - @param latitude_index_bottom Value-result parameter for the bottom edge - index. */ -void GeoConstraint::find_latitude_indeces(double top, double bottom, - LatitudeSense sense, - int &latitude_index_top, - int &latitude_index_bottom) const -{ - int i, j; - - if (sense == normal) { - i = 0; - while (i < d_lat_length - 1 && top < d_lat[i]) - ++i; - - j = d_lat_length - 1; - while (j > 0 && bottom > d_lat[j]) - --j; - - if (d_lat[i] == top) - latitude_index_top = i; - else - latitude_index_top = (i - 1) > 0 ? i - 1 : 0; - - if (d_lat[j] == bottom) - latitude_index_bottom = j; - else - latitude_index_bottom = - (j + 1) < d_lat_length - 1 ? j + 1 : d_lat_length - 1; - } - else { - i = d_lat_length - 1; - while (i > 0 && d_lat[i] > top) - --i; - - j = 0; - while (j < d_lat_length - 1 && d_lat[j] < bottom) - ++j; - - if (d_lat[i] == top) - latitude_index_top = i; - else - latitude_index_top = (i + 1) < d_lat_length - 1 ? i + 1 : d_lat_length - 1; - - if (d_lat[j] == bottom) - latitude_index_bottom = j; - else - latitude_index_bottom = (j - 1) > 0 ? j - 1 : 0; - } -} - -/** Take a look at the latitude vector values and record whether the world is - normal or upside down. - @return normal or inverted. */ -GeoConstraint::LatitudeSense GeoConstraint::categorize_latitude() const -{ - return d_lat[0] >= d_lat[d_lat_length - 1] ? normal : inverted; -} - -// Use 'index' as the pivot point. Move the points behind index to the front of -// the vector and those points in front of and at index to the rear. -static void -swap_vector_ends(char *dest, char *src, int len, int index, int elem_sz) -{ - memcpy(dest, src + index * elem_sz, (len - index) * elem_sz); - - memcpy(dest + (len - index) * elem_sz, src, index * elem_sz); -} - -template -static void transpose(std::vector > a, - std::vector > b, int width, int height) -{ - for (int i = 0; i < width; i++) { - for (int j = 0; j < height; j++) { - b[j][i] = a[i][j]; - } - } -} - -/** Given a vector of doubles, transpose the elements. Use this to flip the - * latitude vector for a Grid that stores the southern latitudes at the top - * instead of the bottom. - * - * @param src A pointer to the vector - * @param length The number of elements in the vector - */ -void GeoConstraint::transpose_vector(double *src, const int length) -{ - double *tmp = new double[length]; - - int i = 0, j = length-1; - while (i < length) - tmp[j--] = src[i++]; - - memcpy(src, tmp,length * sizeof(double)); - - delete[] tmp; -} - -static int -count_size_except_latitude_and_longitude(Array &a) -{ - if (a.dim_end() - a.dim_begin() <= 2) // < 2 is really an error... - return 1; - - int size = 1; - for (Array::Dim_iter i = a.dim_begin(); (i + 2) != a.dim_end(); ++i) - size *= a.dimension_size(i, true); - - return size; -} - -void GeoConstraint::flip_latitude_within_array(Array &a, int lat_length, - int lon_length) -{ - if (!d_array_data) { - a.read(); - d_array_data = static_cast(a.value()); - d_array_data_size = a.width(); // Bytes not elements - } - - int size = count_size_except_latitude_and_longitude(a); - // char *tmp_data = new char[d_array_data_size]; - vector tmp_data(d_array_data_size); - int array_elem_size = a.var()->width(); - int lat_lon_size = (d_array_data_size / size); - - DBG(cerr << "lat, lon_length: " << lat_length << ", " << lon_length << endl); - DBG(cerr << "size: " << size << endl); - DBG(cerr << "d_array_data_size: " << d_array_data_size << endl); - DBG(cerr << "array_elem_size: " << array_elem_size<< endl); - DBG(cerr << "lat_lon_size: " << lat_lon_size<< endl); - - for (int i = 0; i < size; ++i) { - int lat = 0; - int s_lat = lat_length - 1; - // lon_length is the element size; memcpy() needs the number of bytes - int lon_size = array_elem_size * lon_length; - int offset = i * lat_lon_size; - while (s_lat > -1) - memcpy(&tmp_data[0] + offset + (lat++ * lon_size), - d_array_data + offset + (s_lat-- * lon_size), - lon_size); - } - - memcpy(d_array_data, &tmp_data[0], d_array_data_size); - // delete [] tmp_data; -} - -/** Reorder the elements in the longitude map so that the longitude constraint no - longer crosses the edge of the map's storage. The d_lon field is - modified. - - @note The d_lon vector always has double values regardless of the type - of d_longitude. - - @param longitude_index_left The left edge of the bounding box. */ -void GeoConstraint::reorder_longitude_map(int longitude_index_left) -{ - double *tmp_lon = new double[d_lon_length]; - - swap_vector_ends((char *) tmp_lon, (char *) d_lon, d_lon_length, - longitude_index_left, sizeof(double)); - - memcpy(d_lon, tmp_lon, d_lon_length * sizeof(double)); - - delete[]tmp_lon; -} - -static int -count_dimensions_except_longitude(Array &a) -{ - int size = 1; - for (Array::Dim_iter i = a.dim_begin(); (i + 1) != a.dim_end(); ++i) - size *= a.dimension_size(i, true); - - return size; -} - -/** Reorder the data values relative to the longitude axis so that the - reordered longitude map (see GeoConstraint::reorder_longitude_map()) - and the data values match. - - @note This should be called with the Array that contains the d_lon_dim - Array::Dim_iter. - - @note This method must set the d_array_data and d_array_data_size - fields. If those are set, apply_constraint_to_data() will use those - values. - - @note First set all the other constraints, including the latitude and - then make this call. Other constraints, besides latitude, will be simple - range constraints. Latitude might require that values be flipped, but - that can be done _after_ the longitude reordering takes place. - - @todo Fix this code so that it works with latitude as the rightmost map */ -void GeoConstraint::reorder_data_longitude_axis(Array &a, Array::Dim_iter lon_dim) -{ - - if (!is_longitude_rightmost()) - throw Error("This grid does not have Longitude as its rightmost dimension, the geogrid()\ndoes not support constraints that wrap around the edges of this type of grid."); - - DBG(cerr << "Constraint for the left half: " << get_longitude_index_left() - << ", " << get_lon_length() - 1 << endl); - - // Build a constraint for the left part and get those values - a.add_constraint(lon_dim, get_longitude_index_left(), 1, - get_lon_length() - 1); - a.set_read_p(false); - a.read(); - DBG2(a.print_val(stderr)); - - // Save the left-hand data to local storage - int left_size = a.width(); // width() == length() * element size - char *left_data = (char*)a.value(); // value() allocates and copies - - // Build a constraint for the 'right' part, which goes from the left edge - // of the array to the right index and read those data. - // (Don't call a.clear_constraint() since that will clear the constraint on - // all the dimensions while add_constraint() will replace a constraint on - // the given dimension). - - DBG(cerr << "Constraint for the right half: " << 0 - << ", " << get_longitude_index_right() << endl); - - a.add_constraint(lon_dim, 0, 1, get_longitude_index_right()); - a.set_read_p(false); - a.read(); - DBG2(a.print_val(stderr)); - - char *right_data = (char*)a.value(); - int right_size = a.width(); - - // Make one big lump O'data - d_array_data_size = left_size + right_size; - d_array_data = new char[d_array_data_size]; - - // Assume COARDS conventions are being followed: lon varies fastest. - // These *_elements variables are actually elements * bytes/element since - // memcpy() uses bytes. - int elem_size = a.var()->width(); - int left_row_size = (get_lon_length() - get_longitude_index_left()) * elem_size; - int right_row_size = (get_longitude_index_right() + 1) * elem_size; - int total_bytes_per_row = left_row_size + right_row_size; - - DBG2(cerr << "elem_size: " << elem_size << "; left & right size: " - << left_row_size << ", " << right_row_size << endl); - - // This will work for any number of dimension so long as longitude is the - // right-most array dimension. - int rows_to_copy = count_dimensions_except_longitude(a); - for (int i = 0; i < rows_to_copy; ++i) { - DBG(cerr << "Copying " << i << "th row" << endl); - DBG(cerr << "left memcpy: " << *(float *)(left_data + (left_row_size * i)) << endl); - - memcpy(d_array_data + (total_bytes_per_row * i), - left_data + (left_row_size * i), - left_row_size); - - DBG(cerr << "right memcpy: " << *(float *)(right_data + (right_row_size * i)) << endl); - - memcpy(d_array_data + (total_bytes_per_row * i) + left_row_size, - right_data + (right_row_size * i), - right_row_size); - } - - delete[]left_data; - delete[]right_data; -} - -/** @brief Initialize GeoConstraint. - */ -GeoConstraint::GeoConstraint() - : d_array_data(0), d_array_data_size(0), - d_lat(0), d_lon(0), - d_bounding_box_set(false), - d_longitude_rightmost(false), - d_longitude_notation(unknown_notation), - d_latitude_sense(unknown_sense) -{ - // Build sets of attribute values for easy searching. Maybe overkill??? - d_coards_lat_units.insert("degrees_north"); - d_coards_lat_units.insert("degree_north"); - d_coards_lat_units.insert("degree_N"); - d_coards_lat_units.insert("degrees_N"); - - d_coards_lon_units.insert("degrees_east"); - d_coards_lon_units.insert("degree_east"); - d_coards_lon_units.insert("degrees_E"); - d_coards_lon_units.insert("degree_E"); - - d_lat_names.insert("COADSY"); - d_lat_names.insert("lat"); - d_lat_names.insert("Lat"); - d_lat_names.insert("LAT"); - - d_lon_names.insert("COADSX"); - d_lon_names.insert("lon"); - d_lon_names.insert("Lon"); - d_lon_names.insert("LON"); -} - -/** Set the bounding box for this constraint. After calling this method the - object has values for the indexes for the latitude and longitude extent - as well as the sense of the latitude (south pole at the top or bottom of - the Array or Grid). These are used by the apply_constraint_to_data() - method to actually constrain the data. - - @param left The left side of the bounding box. - @param right The right side - @param top The top - @param bottom The bottom */ -void GeoConstraint::set_bounding_box(double top, double left, - double bottom, double right) -{ - // Ensure this method is called only once. What about pthreads? - // The method Array::reset_constraint() might make this so it could be - // called more than once. jhrg 8/30/06 - if (d_bounding_box_set) - throw Error("It is not possible to register more than one geographical constraint on a variable."); - - // Record the 'sense' of the latitude for use here and later on. - d_latitude_sense = categorize_latitude(); -#if 0 - if (d_latitude_sense == inverted) - throw Error("geogrid() does not currently work with inverted data (data where the north pole is at a negative latitude value)."); -#endif - - // Categorize the notation used by the bounding box (0/359 or -180/179). - d_longitude_notation = categorize_notation(left, right); - - // If the notation uses -180/179, transform the request to 0/359 notation. - if (d_longitude_notation == neg_pos) - transform_constraint_to_pos_notation(left, right); - - // If the grid uses -180/179, transform it to 0/359 as well. This will make - // subsequent logic easier and adds only a few extra operations, even with - // large maps. - Notation longitude_notation = - categorize_notation(d_lon[0], d_lon[d_lon_length - 1]); - - if (longitude_notation == neg_pos) - transform_longitude_to_pos_notation(); - - if (!is_bounding_box_valid(left, top, right, bottom)) - throw Error("The bounding box does not intersect any data within this Grid or Array. The\ngeographical extent of these data are from latitude " - + double_to_string(d_lat[0]) + " to " - + double_to_string(d_lat[d_lat_length-1]) - + "\nand longitude " + double_to_string(d_lon[0]) - + " to " + double_to_string(d_lon[d_lon_length-1]) - + " while the bounding box provided was latitude " - + double_to_string(top) + " to " - + double_to_string(bottom) + "\nand longitude " - + double_to_string(left) + " to " - + double_to_string(right)); - - // This is simpler than the longitude case because there's no need to - // test for several notations, no need to accommodate them in the return, - // no modulo arithmetic for the axis and no need to account for a - // constraint with two disconnected parts to be joined. - find_latitude_indeces(top, bottom, d_latitude_sense, - d_latitude_index_top, d_latitude_index_bottom); - - - // Find the longitude map indexes that correspond to the bounding box. - find_longitude_indeces(left, right, d_longitude_index_left, - d_longitude_index_right); - - DBG(cerr << "Bounding box (tlbr): " << d_latitude_index_top << ", " - << d_longitude_index_left << ", " - << d_latitude_index_bottom << ", " - << d_longitude_index_right << endl); - - d_bounding_box_set = true; -} - -} // namespace libdap diff -Nru libdap-3.11.1/GeoConstraint.h libdap-3.12.0/GeoConstraint.h --- libdap-3.11.1/GeoConstraint.h 2011-04-29 13:19:43.000000000 +0000 +++ libdap-3.12.0/GeoConstraint.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,376 +0,0 @@ - -// -*- mode: c++; c-basic-offset:4 -*- - -// This file is part of libdap, A C++ implementation of the OPeNDAP Data -// Access Protocol. - -// Copyright (c) 2006 OPeNDAP, Inc. -// Author: James Gallagher -// -// This library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Lesser General Public -// License as published by the Free Software Foundation; either -// version 2.1 of the License, or (at your option) any later version. -// -// This library 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 -// Lesser General Public License for more details. -// -// You should have received a copy of the GNU Lesser General Public -// License along with this library; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -// -// You can contact OPeNDAP, Inc. at PO Box 112, Saunderstown, RI. 02874-0112. - -#ifndef _geo_constraint_h -#define _geo_constraint_h 1 - -#include -#include -#include - -#ifndef _basetype_h -#include "BaseType.h" -#endif - -#ifndef _array_h -#include "Array.h" -#endif - -#ifndef _grid_h -#include "Grid.h" -#endif - -namespace libdap -{ - -/** Encapsulate the logic needed to handle geographical constraints - when they are applied to DAP Grid (and some Array) variables. - - This class will apply a longitude/latitude bounding box to a Grid - that is a 'geo-referenced' Grid. That is, it follows the COARDS/CF - conventions. This may be relaxed... - - If the longitude range of the constraint crosses the boundary of - the data array so that the constraint creates two separate - rectangles, this class will arrange to return the result as a - single Grid. It will do this by rearranging the data before - control is passed onto the constraint evaluator and serialization - logic. Here's a diagram of how it works: - - Suppose a constraint for the longitude BB starts at the left edge - of L and goes to the right edge of R: - -
-       0.0       180.0       360.0 (longitude, in degrees)
-        +----------------------+
-        |xxxxxyyyyyyyyyyyyzzzzz|
-        -----+            +-----
-        |    |            |    |
-        | R  |            | L  |
-        |    |            |    |
-        -----+            +-----
-        |                      |
-        +----------------------+
-    
- - For example, suppose the client provides a bounding box that - starts at 200 degrees and ends at 80. This class will first copy - the Left part to new storage and then copy the right part, thus - 'stitching together' the two halves of the constraint. The result - looks like: - -
-     80.0  360.0/0.0  180.0  ~200.0 (longitude, in degrees)
-        +----------------------+
-        |zzzzzxxxxxxyyyyyyyyyyy|
-        -----++-----           |
-        |    ||    |           |
-        | L  || R  |           |
-        |    ||    |           |
-        -----++-----           |
-        |                      |
-        +----------------------+
-    
- - The changes are made in the Grid variable itself, so once this is - done the Grid should not be re-read by the CE or serialization - code. - - @author James Gallagher */ - -class GeoConstraint -{ -public: - /** The longitude extents of the constraint bounding box can be expressed - two ways: using a 0/359 notation and using a -180/179 notation. I call - the 0/359 notation 'pos' and the -180/179 notation 'neg_pos'. */ - enum Notation { - unknown_notation, - pos, - neg_pos - }; - - /** Most of the time, latitude starts at the top of an array with - positive values and ends up at the bottom with negative ones. - But sometimes... the world is upside down. */ - enum LatitudeSense { - unknown_sense, - normal, - inverted - }; - -private: - char *d_array_data; //< Holds the Grid's data values - int d_array_data_size; //< Total size (bytes) of the array data - - double *d_lat; //< Holds the latitude values - double *d_lon; //< Holds the longitude values - int d_lat_length; //< Elements (not bytes) in the latitude vector - int d_lon_length; //< ... longitude vector - - // These four are indexes of the constraint - int d_latitude_index_top; - int d_latitude_index_bottom; - int d_longitude_index_left; - int d_longitude_index_right; - - bool d_bounding_box_set; //< Has the bounding box been set? - bool d_longitude_rightmost; //< Is longitude the rightmost dimension? - - Notation d_longitude_notation; - LatitudeSense d_latitude_sense; - - Array::Dim_iter d_lon_dim; //< References the longitude dimension - Array::Dim_iter d_lat_dim; //< References the latitude dimension - - // Sets of string values used to find stuff in attributes - set d_coards_lat_units; - set d_coards_lon_units; - - set d_lat_names; - set d_lon_names; - - // Hide these three automatically provided methods - GeoConstraint(const GeoConstraint ¶m); - GeoConstraint &operator=(GeoConstraint &rhs); - -protected: - /** A protected method that searches for latitude and longitude - map vectors and sets six key internal fields. This method - returns false if either map cannot be found. - - The d_lon, d_lon_length and d_lon_dim (and matching lat) - fields must be set by this method. - - @return True if the maps are found, otherwise False */ - virtual bool build_lat_lon_maps() = 0; - - /** Are the latitude and longitude dimensions ordered so that this - class can properly constrain the data? This method throws - Error if lat and lon are not to two 'fastest-varying' (or - 'rightmost) dimensions. It sets the internal property \e - longitude_rightmost if that's true. - - @note Called by the constructor once build_lat_lon_maps() has returned. - - @return True if the lat/lon maps are the two rightmost maps, - false otherwise*/ - virtual bool lat_lon_dimensions_ok() = 0; - - Notation categorize_notation(const double left, const double right) const; - void transform_constraint_to_pos_notation(double &left, double &right) const; - virtual void transform_longitude_to_pos_notation(); - virtual void transform_longitude_to_neg_pos_notation(); - virtual bool is_bounding_box_valid(const double left, const double top, - const double right, const double bottom) const; - void find_longitude_indeces(double left, double right, - int &longitude_index_left, - int &longitude_index_right) const; - - virtual void transpose_vector(double *src, const int length); - virtual void reorder_longitude_map(int longitude_index_left); - - virtual LatitudeSense categorize_latitude() const; - void find_latitude_indeces(double top, double bottom, LatitudeSense sense, - int &latitude_index_top, - int &latitude_index_bottom) const; - - virtual void reorder_data_longitude_axis(Array &a, Array::Dim_iter lon_dim); - virtual void flip_latitude_within_array(Array &a, int lat_length, - int lon_length); - - friend class GridGeoConstraintTest; // Unit tests - -public: - /** @name Constructors */ - //@{ - GeoConstraint(); - //@} - - virtual ~GeoConstraint() - { - delete [] d_lat; d_lat = 0; - delete [] d_lon; d_lon = 0; - delete [] d_array_data; d_array_data = 0; - } - - /** @name Accessors/Mutators */ - //@{ - // These are set in reorder_data_longitude_axis() - char *get_array_data() const - { - return d_array_data; - } - int get_array_data_size() const - { - return d_array_data_size; - } - - double *get_lat() const - { - return d_lat; - } - double *get_lon() const - { - return d_lon; - } - void set_lat(double *lat) - { - d_lat = lat; - } - void set_lon(double *lon) - { - d_lon = lon; - } - - int get_lat_length() const - { - return d_lat_length; - } - int get_lon_length() const - { - return d_lon_length; - } - void set_lat_length(int len) - { - d_lat_length = len; - } - void set_lon_length(int len) - { - d_lon_length = len; - } - - Array::Dim_iter get_lon_dim() const - { - return d_lon_dim; - } - Array::Dim_iter get_lat_dim() const - { - return d_lat_dim; - } - void set_lon_dim(Array::Dim_iter lon) - { - d_lon_dim = lon; - } - void set_lat_dim(Array::Dim_iter lat) - { - d_lat_dim = lat; - } - - // These four are indexes of the constraint - int get_latitude_index_top() const - { - return d_latitude_index_top; - } - int get_latitude_index_bottom() const - { - return d_latitude_index_bottom; - } - void set_latitude_index_top(int top) - { - d_latitude_index_top = top; - } - void set_latitude_index_bottom(int bottom) - { - d_latitude_index_bottom = bottom; - } - - int get_longitude_index_left() const - { - return d_longitude_index_left; - } - int get_longitude_index_right() const - { - return d_longitude_index_right; - } - void set_longitude_index_left(int left) - { - d_longitude_index_left = left; - } - void set_longitude_index_right(int right) - { - d_longitude_index_right = right; - } - - bool is_bounding_box_set() const - { - return d_bounding_box_set; - } - bool is_longitude_rightmost() const - { - return d_longitude_rightmost; - } - void set_longitude_rightmost(bool state) - { - d_longitude_rightmost = state; - } - - Notation get_longitude_notation() const - { - return d_longitude_notation; - } - LatitudeSense get_latitude_sense() const - { - return d_latitude_sense; - } - void set_longitude_notation(Notation n) - { - d_longitude_notation = n; - } - void set_latitude_sense(LatitudeSense l) - { - d_latitude_sense = l; - } - - set get_coards_lat_units() const - { - return d_coards_lat_units; - } - set get_coards_lon_units() const - { - return d_coards_lon_units; - } - - set get_lat_names() const - { - return d_lat_names; - } - set get_lon_names() const - { - return d_lon_names; - } - //@} - - void set_bounding_box(double top, double left, double bottom, double right); - - /** @brief Once the bounding box is set use this method to apply - the constraint. */ - virtual void apply_constraint_to_data() = 0; -}; - -} // namespace libdap - -#endif // _geo_constraint_h - diff -Nru libdap-3.11.1/Grid.cc libdap-3.12.0/Grid.cc --- libdap-3.11.1/Grid.cc 2011-04-29 13:19:43.000000000 +0000 +++ libdap-3.12.0/Grid.cc 2013-10-17 21:27:40.000000000 +0000 @@ -19,7 +19,7 @@ // // You should have received a copy of the GNU Lesser General Public // License along with this library; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA // // You can contact OPeNDAP, Inc. at PO Box 112, Saunderstown, RI. 02874-0112. @@ -37,6 +37,7 @@ // #define DODS_DEBUG +#include #include #include @@ -46,7 +47,7 @@ #include "util.h" #include "InternalErr.h" #include "escaping.h" - +#include "XDRStreamMarshaller.h" #include "debug.h" using namespace std; @@ -54,22 +55,22 @@ namespace libdap { void -Grid::_duplicate(const Grid &s) +Grid::m_duplicate(const Grid &s) { - // Clear out any spurious vars in Constructor::_vars - _vars.clear(); // [mjohnson 10 Sep 2009] + // Clear out any spurious vars in Constructor::d_vars + d_vars.clear(); // [mjohnson 10 Sep 2009] - _array_var = s._array_var->ptr_duplicate(); - _array_var->set_parent(this); - _vars.push_back(_array_var); // so the Constructor::Vars_Iter sees it [mjohnson 10 Sep 2009] + d_array_var = s.d_array_var->ptr_duplicate(); + d_array_var->set_parent(this); + d_vars.push_back(d_array_var); // so the Constructor::Vars_Iter sees it [mjohnson 10 Sep 2009] Grid &cs = const_cast(s); - for (Map_iter i = cs._map_vars.begin(); i != cs._map_vars.end(); i++) { + for (Map_iter i = cs.d_map_vars.begin(); i != cs.d_map_vars.end(); i++) { BaseType *btp = (*i)->ptr_duplicate(); btp->set_parent(this); - _map_vars.push_back(btp); - _vars.push_back(btp); // push all map vectors as weak refs into super::_vars which won't delete them [mjohnson 10 Sep 2009] + d_map_vars.push_back(btp); + d_vars.push_back(btp); // push all map vectors as weak refs into super::d_vars which won't delete them [mjohnson 10 Sep 2009] } } @@ -83,7 +84,7 @@ @brief The Grid constructor. */ -Grid::Grid(const string &n) : Constructor(n, dods_grid_c), _array_var(0) +Grid::Grid(const string &n) : Constructor(n, dods_grid_c), d_array_var(0) {} /** The Grid server-side constructor requires the name of the variable @@ -98,20 +99,20 @@ @brief The Grid constructor. */ Grid::Grid(const string &n, const string &d) - : Constructor(n, d, dods_grid_c), _array_var(0) + : Constructor(n, d, dods_grid_c), d_array_var(0) {} /** @brief The Grid copy constructor. */ Grid::Grid(const Grid &rhs) : Constructor(rhs) { - _duplicate(rhs); + m_duplicate(rhs); } Grid::~Grid() { - delete _array_var; _array_var = 0; + delete d_array_var; d_array_var = 0; - for (Map_iter i = _map_vars.begin(); i != _map_vars.end(); i++) { + for (Map_iter i = d_map_vars.begin(); i != d_map_vars.end(); i++) { BaseType *btp = *i ; delete btp ; btp = 0; } @@ -129,35 +130,46 @@ if (this == &rhs) return *this; - delete _array_var; _array_var = 0; + delete d_array_var; d_array_var = 0; - for (Map_iter i = _map_vars.begin(); i != _map_vars.end(); i++) { + for (Map_iter i = d_map_vars.begin(); i != d_map_vars.end(); i++) { BaseType *btp = *i ; delete btp ; } - // this doesn't copy Constructor::_vars so... + // this doesn't copy Constructor::d_vars so... dynamic_cast(*this) = rhs; // we do it in here... - _duplicate(rhs); + m_duplicate(rhs); return *this; } +/** + * Grid can only be used for DAP2. + * @note This might change depending on just how complex DAP4Array becomes, + * for example. + */ +bool +Grid::is_dap2_only_type() +{ + return true; +} + int Grid::element_count(bool leaves) { if (!leaves) - return _map_vars.size() + 1; + return d_map_vars.size() + 1; else { int i = 0; - for (Map_iter j = _map_vars.begin(); j != _map_vars.end(); j++) { + for (Map_iter j = d_map_vars.begin(); j != d_map_vars.end(); j++) { j += (*j)->element_count(leaves); } if (!get_array()) - throw InternalErr(__FILE__, __LINE__, "No Grid arry!"); + throw InternalErr(__FILE__, __LINE__, "No Grid array!"); i += get_array()->element_count(leaves); return i; @@ -167,9 +179,9 @@ void Grid::set_send_p(bool state) { - _array_var->set_send_p(state); + d_array_var->set_send_p(state); - for (Map_iter i = _map_vars.begin(); i != _map_vars.end(); i++) { + for (Map_iter i = d_map_vars.begin(); i != d_map_vars.end(); i++) { (*i)->set_send_p(state); } @@ -179,9 +191,9 @@ void Grid::set_read_p(bool state) { - _array_var->set_read_p(state); + d_array_var->set_read_p(state); - for (Map_iter i = _map_vars.begin(); i != _map_vars.end(); i++) { + for (Map_iter i = d_map_vars.begin(); i != d_map_vars.end(); i++) { (*i)->set_read_p(state); } @@ -191,26 +203,59 @@ void Grid::set_in_selection(bool state) { - _array_var->set_in_selection(state); + d_array_var->set_in_selection(state); - for (Map_iter i = _map_vars.begin(); i != _map_vars.end(); i++) { + for (Map_iter i = d_map_vars.begin(); i != d_map_vars.end(); i++) { (*i)->set_in_selection(state); } BaseType::set_in_selection(state); } - +#if 0 unsigned int -Grid::width() +Grid::width(bool) { - unsigned int sz = _array_var->width(); + unsigned int sz = d_array_var->width(); - for (Map_iter i = _map_vars.begin(); i != _map_vars.end(); i++) { + for (Map_iter i = d_map_vars.begin(); i != d_map_vars.end(); i++) { sz += (*i)->width(); } return sz; } +#endif +/** This version of width simply returns the same thing as width() for simple + types and Arrays. For Structure it returns the total size if constrained + is false, or the size of the elements in the current projection if true. + + @param constrained If true, return the size after applying a constraint. + @return The number of bytes used by the variable. + */ +unsigned int +Grid::width(bool constrained) +{ + unsigned int sz = 0; + + if (constrained) { + if (d_array_var->send_p()) + sz = d_array_var->width(constrained); + } + else { + sz = d_array_var->width(constrained); + } + + for (Map_iter i = d_map_vars.begin(); i != d_map_vars.end(); i++) { + if (constrained) { + if ((*i)->send_p()) + sz += (*i)->width(constrained); + } + else { + sz += (*i)->width(constrained); + } + } + + return sz; +} void Grid::intern_data(ConstraintEvaluator &eval, DDS &dds) @@ -222,10 +267,10 @@ dds.timeout_off(); - if (_array_var->send_p()) - _array_var->intern_data(eval, dds); + if (d_array_var->send_p()) + d_array_var->intern_data(eval, dds); - for (Map_iter i = _map_vars.begin(); i != _map_vars.end(); i++) { + for (Map_iter i = d_map_vars.begin(); i != d_map_vars.end(); i++) { if ((*i)->send_p()) { (*i)->intern_data(eval, dds); } @@ -233,31 +278,59 @@ } bool -Grid::serialize(ConstraintEvaluator &eval, DDS &dds, - Marshaller &m, bool ce_eval) +Grid::serialize(ConstraintEvaluator &eval, DDS &dds, Marshaller &m, bool ce_eval) { + DBG(cerr << "In Grid::serialize()" << endl); + dds.timeout_on(); // Re ticket 560: Get an object from eval that describes how to sample // and rearrange the data, then perform those actions. Alternative: // implement this as a selection function. + DBG(cerr << "In Grid::serialize(), before read() - read_p() returned: " << read_p() << endl); if (!read_p()) read(); // read() throws Error and InternalErr -#if EVAL + DBG(cerr << "In Grid::serialize(), past read() - read_p() returned: " << read_p() << endl); + + #if EVAL if (ce_eval && !eval.eval_selection(dds, dataset())) return true; #endif dds.timeout_off(); - if (_array_var->send_p()) - _array_var->serialize(eval, dds, m, false); + if (d_array_var->send_p()) { +#ifdef CHECKSUMS + XDRStreamMarshaller *sm = dynamic_cast(&m); + if (sm && sm->checksums()) + sm->reset_checksum(); + + d_array_var->serialize(eval, dds, m, false); + + if (sm && sm->checksums()) + sm->get_checksum(); +#else + DBG(cerr << "About to call Array::serialize() in Grid::serialize" << endl); + d_array_var->serialize(eval, dds, m, false); +#endif + } - for (Map_iter i = _map_vars.begin(); i != _map_vars.end(); i++) { + for (Map_iter i = d_map_vars.begin(); i != d_map_vars.end(); i++) { if ((*i)->send_p()) { +#ifdef CHECKSUMS + XDRStreamMarshaller *sm = dynamic_cast(&m); + if (sm && sm->checksums()) + sm->reset_checksum(); + + (*i)->serialize(eval, dds, m, false); + + if (sm && sm->checksums()) + sm->get_checksum(); +#else (*i)->serialize(eval, dds, m, false); +#endif } } @@ -267,15 +340,16 @@ bool Grid::deserialize(UnMarshaller &um, DDS *dds, bool reuse) { - _array_var->deserialize(um, dds, reuse); + d_array_var->deserialize(um, dds, reuse); - for (Map_iter i = _map_vars.begin(); i != _map_vars.end(); i++) { + for (Map_iter i = d_map_vars.begin(); i != d_map_vars.end(); i++) { (*i)->deserialize(um, dds, reuse); } return false; } +#if 0 /** @brief Returns the size of the Grid type. Use the val2buf() @@ -297,6 +371,7 @@ { return sizeof(Grid); } +#endif BaseType * Grid::var(const string &n, btp_stack &s) @@ -313,13 +388,13 @@ { string name = www2id(n); - if (_array_var->name() == name) { + if (d_array_var->name() == name) { if (s) s->push(static_cast(this)); - return _array_var; + return d_array_var; } - for (Map_iter i = _map_vars.begin(); i != _map_vars.end(); i++) { + for (Map_iter i = d_map_vars.begin(); i != d_map_vars.end(); i++) { if ((*i)->name() == name) { if (s) s->push(static_cast(this)); @@ -345,12 +420,13 @@ void Grid::add_var(BaseType *bt, Part part) { - if (!bt) { - throw InternalErr(__FILE__, __LINE__, - "Passing NULL pointer as variable to be added."); - } - - if (part == array && _array_var) { + if (!bt) + throw InternalErr(__FILE__, __LINE__, "Passing NULL pointer as variable to be added."); +#if 0 + if (bt->is_dap4_only_type()) + throw InternalErr(__FILE__, __LINE__, "Attempt to add a DAP4 type to a DAP2 Grid."); +#endif + if (part == array && d_array_var) { // Avoid leaking memory... Function is add, not set, so it is an error to call again for the array part. throw InternalErr(__FILE__, __LINE__, "Error: Grid::add_var called with part==Array, but the array was already set!"); } @@ -377,12 +453,12 @@ case maps: { bt_clone = bt->ptr_duplicate(); bt_clone->set_parent(this); - _map_vars.push_back(bt_clone); + d_map_vars.push_back(bt_clone); } break; default: { - if (!_array_var) { + if (!d_array_var) { // Refactored to use new set_array ([mjohnson 11 nov 2009]) Array* p_arr = dynamic_cast(bt); // avoid obvious broken semantics @@ -397,7 +473,7 @@ else { bt_clone = bt->ptr_duplicate(); bt_clone->set_parent(this); - _map_vars.push_back(bt_clone); + d_map_vars.push_back(bt_clone); } } break; @@ -405,9 +481,86 @@ // if we get ehre without exception, add the cloned object to the superclass variable iterator // mjohnson 10 Sep 2009 - // Add it to the superclass _vars list so we can iterate on superclass vars + // Add it to the superclass d_vars list so we can iterate on superclass vars if (bt_clone) { - _vars.push_back(bt_clone); + d_vars.push_back(bt_clone); + } +} + +/** Add an array or map to the Grid. + + @note The original version of this method required that the \c part parameter + be present. However, this complicates using the class from a parser + (e.g., the schema-based XML parser). I have modified the method so that + if \c part is nil (the default), then the first variable added is the + array and subsequent variables are maps. This matches the behavior in the + Java DAP implementation. + + @note This version of the method does not the BaseType before adding it. + The caller must not free the BaseType object. + + @param bt Array or Map variable + @param part is this an array or a map. If not present, first \c bt is the + array and subsequent bts are maps. */ +void +Grid::add_var_nocopy(BaseType *bt, Part part) +{ + if (!bt) + throw InternalErr(__FILE__, __LINE__, "Passing NULL pointer as variable to be added."); +#if 0 + if (bt->is_dap4_only_type()) + throw InternalErr(__FILE__, __LINE__, "Attempt to add a DAP4 type to a DAP2 Grid."); +#endif + if (part == array && d_array_var) { + // Avoid leaking memory... Function is add, not set, so it is an error to call again for the array part. + throw InternalErr(__FILE__, __LINE__, "Error: Grid::add_var called with part==Array, but the array was already set!"); + } + + bt->set_parent(this); + + switch (part) { + + case array: { + // Refactored to use new set_array ([mjohnson 11 nov 2009]) + Array* p_arr = dynamic_cast(bt); + // avoid obvious broken semantics + if (!p_arr) { + throw InternalErr(__FILE__, __LINE__, + "Grid::add_var(): with Part==array: object is not an Array!"); + } + set_array(static_cast(bt)); + } + break; + + case maps: { + //bt->set_parent(this); + d_map_vars.push_back(bt); + } + break; + + default: { + if (!d_array_var) { + // Refactored to use new set_array ([mjohnson 11 nov 2009]) + Array* p_arr = dynamic_cast(bt); + // avoid obvious broken semantics + if (!p_arr) { + throw InternalErr(__FILE__, __LINE__, + "Grid::add_var(): with Part==array: object is not an Array!"); + } + set_array(static_cast(bt)); + } + else { + d_map_vars.push_back(bt); + } + } + break; + }// switch + + // if we get here without exception, add the cloned object to the superclass variable iterator + // mjohnson 10 Sep 2009 + // Add it to the superclass d_vars list so we can iterate on superclass vars + if (bt) { + d_vars.push_back(bt); } } @@ -428,14 +581,14 @@ "Grid::set_array(): Cannot set to null!"); } // Make sure not same memory, this would be evil. - if (p_new_arr == _array_var) { + if (p_new_arr == d_array_var) { return; } // clean out any old array - delete _array_var; _array_var = 0; + delete d_array_var; d_array_var = 0; // Set the new, with parent - _array_var = p_new_arr; - _array_var->set_parent(this); + d_array_var = p_new_arr; + d_array_var->set_parent(this); } /** @@ -467,18 +620,18 @@ Array* Grid::add_map(Array* p_new_map, bool add_as_copy) { - if (!p_new_map) { - throw InternalErr(__FILE__, __LINE__, - "Grid::add_map(): cannot have p_new_map null!"); - } - - if (add_as_copy) { + if (!p_new_map) + throw InternalErr(__FILE__, __LINE__, "Grid::add_map(): cannot have p_new_map null!"); +#if 0 + if (p_new_map->is_dap4_only_type()) + throw InternalErr(__FILE__, __LINE__, "Attempt to add a DAP4 type to a DAP2 Grid."); +#endif + if (add_as_copy) p_new_map = static_cast(p_new_map->ptr_duplicate()); - } p_new_map->set_parent(this); - _map_vars.push_back(p_new_map); - _vars.push_back(p_new_map); // allow superclass iter to work as well. + d_map_vars.push_back(p_new_map); + d_vars.push_back(p_new_map); // allow superclass iter to work as well. // return the one that got put into the Grid. return p_new_map; @@ -505,8 +658,8 @@ } p_new_map->set_parent(this); - _map_vars.insert(_map_vars.begin(), p_new_map); - _vars.insert(_vars.begin(), p_new_map); // allow superclass iter to work as well. + d_map_vars.insert(d_map_vars.begin(), p_new_map); + d_vars.insert(d_vars.begin(), p_new_map); // allow superclass iter to work as well. // return the one that got put into the Grid. return p_new_map; @@ -518,7 +671,7 @@ BaseType * Grid::array_var() { - return _array_var; + return d_array_var; } /** @brief Returns the Grid Array. @@ -527,7 +680,7 @@ Array * Grid::get_array() { - Array *a = dynamic_cast(_array_var); + Array *a = dynamic_cast(d_array_var); if (a) return a; else @@ -538,7 +691,7 @@ Grid::Map_iter Grid::map_begin() { - return _map_vars.begin() ; + return d_map_vars.begin() ; } /** Returns an iterator referencing the end of the list of Map vectors. @@ -546,14 +699,14 @@ Grid::Map_iter Grid::map_end() { - return _map_vars.end() ; + return d_map_vars.end() ; } /** @brief Returns an iterator referencing the first Map vector. */ Grid::Map_riter Grid::map_rbegin() { - return _map_vars.rbegin() ; + return d_map_vars.rbegin() ; } /** Returns an iterator referencing the end of the list of Map vectors. @@ -561,7 +714,7 @@ Grid::Map_riter Grid::map_rend() { - return _map_vars.rend() ; + return d_map_vars.rend() ; } /** Return the iterator for the \e ith map. @@ -570,7 +723,7 @@ Grid::Map_iter Grid::get_map_iter(int i) { - return _map_vars.begin() + i; + return d_map_vars.begin() + i; } /** Returns the number of components in the Grid object. This is @@ -594,16 +747,16 @@ int comp; if (constrained) { - comp = _array_var->send_p() ? 1 : 0; + comp = d_array_var->send_p() ? 1 : 0; - for (Map_iter i = _map_vars.begin(); i != _map_vars.end(); i++) { + for (Map_iter i = d_map_vars.begin(); i != d_map_vars.end(); i++) { if ((*i)->send_p()) { comp++; } } } else { - comp = 1 + _map_vars.size(); + comp = 1 + d_map_vars.size(); } return comp; @@ -670,7 +823,7 @@ // projected dimension in the Array component, there is a matching Map // vector, then the Grid is valid. bool valid = true; - Array *a = (Array *)_array_var; + Array *a = (Array *)d_array_var; // Don't bother checking if the Array component is not included. if (!a->send_p()) @@ -709,68 +862,19 @@ void Grid::clear_constraint() { - dynamic_cast(*_array_var).clear_constraint(); + dynamic_cast(*d_array_var).clear_constraint(); for (Map_iter m = map_begin(); m != map_end(); ++m) dynamic_cast(*(*m)).clear_constraint(); } -#if FILE_METHODS void Grid::print_decl(FILE *out, string space, bool print_semi, bool constraint_info, bool constrained) { - if (constrained && !send_p()) - return; - - // The problem with the above is that if two Grids are projected and each - // contain one variable, say a map, and it happens to have the same name - // in each Grid, then without the enclosing Structures, the returned dataset - // has two variables with the same name at the same lexical level. So I'm - // removing the code above. - if (constrained && !projection_yields_grid()) { - fprintf(out, "%sStructure {\n", space.c_str()) ; - - _array_var->print_decl(out, space + " ", true, constraint_info, - constrained); - - for (Map_citer i = _map_vars.begin(); i != _map_vars.end(); i++) { - (*i)->print_decl(out, space + " ", true, - constraint_info, constrained); - } - - fprintf(out, "%s} %s", space.c_str(), id2www(name()).c_str()) ; - } - else { - // The number of elements in the (projected) Grid must be such that - // we have a valid Grid object; send it as such. - fprintf(out, "%s%s {\n", space.c_str(), type_name().c_str()) ; - - fprintf(out, "%s Array:\n", space.c_str()) ; - _array_var->print_decl(out, space + " ", true, constraint_info, - constrained); - - fprintf(out, "%s Maps:\n", space.c_str()) ; - for (Map_citer i = _map_vars.begin(); i != _map_vars.end(); i++) { - (*i)->print_decl(out, space + " ", true, - constraint_info, constrained); - } - - fprintf(out, "%s} %s", space.c_str(), id2www(name()).c_str()) ; - } - - if (constraint_info) { - if (send_p()) - fprintf( out, ": Send True"); - else - fprintf( out, ": Send False"); - } - - if (print_semi) - fprintf(out, ";\n") ; - - return; + ostringstream oss; + print_decl(oss, space, print_semi, constraint_info, constrained); + fwrite(oss.str().data(), sizeof(char), oss.str().length(), out); } -#endif void Grid::print_decl(ostream &out, string space, bool print_semi, @@ -783,10 +887,10 @@ if (constrained && !projection_yields_grid()) { out << space << "Structure {\n" ; - _array_var->print_decl(out, space + " ", true, constraint_info, + d_array_var->print_decl(out, space + " ", true, constraint_info, constrained); - for (Map_citer i = _map_vars.begin(); i != _map_vars.end(); i++) { + for (Map_citer i = d_map_vars.begin(); i != d_map_vars.end(); i++) { (*i)->print_decl(out, space + " ", true, constraint_info, constrained); } @@ -799,11 +903,11 @@ out << space << type_name() << " {\n" ; out << space << " Array:\n" ; - _array_var->print_decl(out, space + " ", true, constraint_info, + d_array_var->print_decl(out, space + " ", true, constraint_info, constrained); out << space << " Maps:\n" ; - for (Map_citer i = _map_vars.begin(); i != _map_vars.end(); i++) { + for (Map_citer i = d_map_vars.begin(); i != d_map_vars.end(); i++) { (*i)->print_decl(out, space + " ", true, constraint_info, constrained); } @@ -824,79 +928,37 @@ return; } -#if FILE_METHODS -class PrintMapField : public unary_function -{ - FILE *d_out; - string d_space; - bool d_constrained; - string d_tag; -public: - PrintMapField(FILE *o, string s, bool c, const string &t = "Map") - : d_out(o), d_space(s), d_constrained(c), d_tag(t) - {} - - void operator()(BaseType *btp) - { - Array *a = dynamic_cast(btp); - if (!a) - throw InternalErr(__FILE__, __LINE__, "Expected an Array."); - a->print_xml_core(d_out, d_space, d_constrained, d_tag); - } -}; - +/** + * @deprecated + */ void Grid::print_xml(FILE *out, string space, bool constrained) { - if (constrained && !send_p()) - return; - - if (constrained && !projection_yields_grid()) { - fprintf(out, "%s\n"); - - get_attr_table().print_xml(out, space + " ", constrained); - - get_array()->print_xml(out, space + " ", constrained); - - for_each(map_begin(), map_end(), - PrintMapField(out, space + " ", constrained, "Array")); - - fprintf(out, "%s\n", space.c_str()); - } - else { - // The number of elements in the (projected) Grid must be such that - // we have a valid Grid object; send it as such. - fprintf(out, "%s\n"); - - get_attr_table().print_xml(out, space + " ", constrained); - - get_array()->print_xml(out, space + " ", constrained); - - for_each(map_begin(), map_end(), - PrintMapField(out, space + " ", constrained)); + XMLWriter xml(space); + print_xml_writer(xml, constrained); + fwrite(xml.get_doc(), sizeof(char), xml.get_doc_size(), out); +} - fprintf(out, "%s\n", space.c_str()); - } +/** + * @deprecated + */ +void +Grid::print_xml(ostream &out, string space, bool constrained) +{ + XMLWriter xml(space); + print_xml_writer(xml, constrained); + out << xml.get_doc(); } -#endif -class PrintMapFieldStrm : public unary_function + +class PrintGridFieldXMLWriter : public unary_function { - ostream &d_out; - string d_space; + XMLWriter &d_xml; bool d_constrained; string d_tag; public: - PrintMapFieldStrm(ostream &o, string s, bool c, const string &t = "Map") - : d_out(o), d_space(s), d_constrained(c), d_tag(t) + PrintGridFieldXMLWriter(XMLWriter &x, bool c, const string &t = "Map") + : d_xml(x), d_constrained(c), d_tag(t) {} void operator()(BaseType *btp) @@ -904,83 +966,63 @@ Array *a = dynamic_cast(btp); if (!a) throw InternalErr(__FILE__, __LINE__, "Expected an Array."); - a->print_xml_core(d_out, d_space, d_constrained, d_tag); + a->print_xml_writer_core(d_xml, d_constrained, d_tag); } }; void -Grid::print_xml(ostream &out, string space, bool constrained) +Grid::print_xml_writer(XMLWriter &xml, bool constrained) { if (constrained && !send_p()) return; if (constrained && !projection_yields_grid()) { - out << space << "\n" ; + if (!name().empty()) + if (xmlTextWriterWriteAttribute(xml.get_writer(), (const xmlChar*) "name", (const xmlChar*)name().c_str()) < 0) + throw InternalErr(__FILE__, __LINE__, "Could not write attribute for name"); - get_attr_table().print_xml(out, space + " ", constrained); + get_attr_table().print_xml_writer(xml); - get_array()->print_xml(out, space + " ", constrained); + get_array()->print_xml_writer(xml, constrained); for_each(map_begin(), map_end(), - PrintMapFieldStrm(out, space + " ", constrained, "Array")); + PrintGridFieldXMLWriter(xml, constrained, "Array")); - out << space << "\n" ; + if (xmlTextWriterEndElement(xml.get_writer()) < 0) + throw InternalErr(__FILE__, __LINE__, "Could not end Structure element"); } else { // The number of elements in the (projected) Grid must be such that // we have a valid Grid object; send it as such. - out << space << "\n" ; + if (!name().empty()) + if (xmlTextWriterWriteAttribute(xml.get_writer(), (const xmlChar*) "name", (const xmlChar*)name().c_str()) < 0) + throw InternalErr(__FILE__, __LINE__, "Could not write attribute for name"); - get_attr_table().print_xml(out, space + " ", constrained); + get_attr_table().print_xml_writer(xml); - get_array()->print_xml(out, space + " ", constrained); + get_array()->print_xml_writer(xml, constrained); for_each(map_begin(), map_end(), - PrintMapFieldStrm(out, space + " ", constrained)); + PrintGridFieldXMLWriter(xml, constrained, "Map")); - out << space << "\n" ; + if (xmlTextWriterEndElement(xml.get_writer()) < 0) + throw InternalErr(__FILE__, __LINE__, "Could not end Grid element"); } } -#if FILE_METHODS void Grid::print_val(FILE *out, string space, bool print_decl_p) { - if (print_decl_p) { - print_decl(out, space, false); - fprintf(out, " = ") ; - } - - // If we are printing a value on the client-side, projection_yields_grid - // should not be called since we don't *have* a projection without a - // contraint. I think that if we are here and send_p() is not true, then - // the value of this function should be ignored. 4/6/2000 jhrg - bool pyg = projection_yields_grid(); // hack 12/1/99 jhrg - if (pyg || !send_p()) - fprintf(out, "{ Array: ") ; - else - fprintf(out, "{") ; - _array_var->print_val(out, "", false); - if (pyg || !send_p()) - fprintf(out, " Maps: ") ; - for (Map_citer i = _map_vars.begin(); i != _map_vars.end(); - i++, (void)(i != _map_vars.end() && fprintf(out, ", "))) { - (*i)->print_val(out, "", false); - } - fprintf(out, " }") ; - - if (print_decl_p) - fprintf(out, ";\n") ; + ostringstream oss; + print_val(oss, space, print_decl_p); + fwrite(oss.str().data(), sizeof(char), oss.str().length(), out); } -#endif void Grid::print_val(ostream &out, string space, bool print_decl_p) @@ -999,11 +1041,11 @@ out << "{ Array: " ; else out << "{" ; - _array_var->print_val(out, "", false); + d_array_var->print_val(out, "", false); if (pyg || !send_p()) out << " Maps: " ; - for (Map_citer i = _map_vars.begin(); i != _map_vars.end(); - i++, (void)(i != _map_vars.end() && out << ", ")) { + for (Map_citer i = d_map_vars.begin(); i != d_map_vars.end(); + i++, (void)(i != d_map_vars.end() && out << ", ")) { (*i)->print_val(out, "", false); } out << " }" ; @@ -1026,18 +1068,18 @@ msg = ""; - if (!_array_var) { + if (!d_array_var) { msg += "Null grid base array in `" + name() + "'\n"; return false; } // Is it an array? - if (_array_var->type() != dods_array_c) { - msg += "Grid `" + name() + "'s' member `" + _array_var->name() + "' must be an array\n"; + if (d_array_var->type() != dods_array_c) { + msg += "Grid `" + name() + "'s' member `" + d_array_var->name() + "' must be an array\n"; return false; } - Array *av = (Array *)_array_var; // past test above, must be an array + Array *av = (Array *)d_array_var; // past test above, must be an array // Array must be of a simple_type. if (!av->var()->is_simple_type()) { @@ -1046,7 +1088,7 @@ } // enough maps? - if ((unsigned)_map_vars.size() != av->dimensions()) { + if ((unsigned)d_map_vars.size() != av->dimensions()) { msg += "The number of map variables for grid `" + this->name() + "' does not match the number of dimensions of `"; msg += av->name() + "'\n"; return false; @@ -1054,8 +1096,8 @@ const string array_var_name = av->name(); Array::Dim_iter asi = av->dim_begin() ; - for (Map_iter mvi = _map_vars.begin(); - mvi != _map_vars.end(); mvi++, asi++) { + for (Map_iter mvi = d_map_vars.begin(); + mvi != d_map_vars.end(); mvi++, asi++) { BaseType *mv = *mvi; @@ -1089,15 +1131,15 @@ int av_size = av->dimension_size(asi) ; if (mv_a_size != av_size) { msg += "Grid map variable `" + mv_a->name() + "'s' size does not match the size of array variable '"; - msg += _array_var->name() + "'s' cooresponding dimension\n"; + msg += d_array_var->name() + "'s' cooresponding dimension\n"; return false; } } if (all) { - if (!_array_var->check_semantics(msg, true)) + if (!d_array_var->check_semantics(msg, true)) return false; - for (Map_iter mvi = _map_vars.begin(); mvi != _map_vars.end(); mvi++) { + for (Map_iter mvi = d_map_vars.begin(); mvi != d_map_vars.end(); mvi++) { if (!(*mvi)->check_semantics(msg, true)) { return false; } @@ -1122,10 +1164,10 @@ << (void *)this << ")" << endl ; DapIndent::Indent() ; Constructor::dump(strm) ; - if (_array_var) { + if (d_array_var) { strm << DapIndent::LMarg << "array var: " << endl ; DapIndent::Indent() ; - _array_var->dump(strm) ; + d_array_var->dump(strm) ; DapIndent::UnIndent() ; } else { @@ -1133,8 +1175,8 @@ } strm << DapIndent::LMarg << "map var: " << endl ; DapIndent::Indent() ; - Map_citer i = _map_vars.begin() ; - Map_citer ie = _map_vars.end() ; + Map_citer i = d_map_vars.begin() ; + Map_citer ie = d_map_vars.end() ; for (; i != ie; i++) { (*i)->dump(strm) ; } diff -Nru libdap-3.11.1/Grid.h libdap-3.12.0/Grid.h --- libdap-3.11.1/Grid.h 2011-04-29 13:19:43.000000000 +0000 +++ libdap-3.12.0/Grid.h 2013-10-17 21:27:40.000000000 +0000 @@ -19,7 +19,7 @@ // // You should have received a copy of the GNU Lesser General Public // License along with this library; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA // // You can contact OPeNDAP, Inc. at PO Box 112, Saunderstown, RI. 02874-0112. @@ -60,8 +60,6 @@ #include "ConstraintEvaluator.h" #endif -#define FILE_METHODS 1 - namespace libdap { @@ -110,7 +108,7 @@ (get_array()), and a set of functions for cycling through the list of Map vectors. - @todo Move, in some sense, the _map_vars up to Constructor. Look at using + @todo Move, in some sense, the d_map_vars up to Constructor. Look at using Constructor's _var field for these. @todo Along the same lines as the previous item, consider removing the Part enum and adopting the convention that the first variable added is @@ -123,11 +121,11 @@ class Grid: public Constructor { private: - BaseType *_array_var; - std::vector _map_vars; + BaseType *d_array_var; + std::vector d_map_vars; protected: // subclasses need access [mjohnson 11 nov 2009] - void _duplicate(const Grid &s); + void m_duplicate(const Grid &s); public: @@ -144,18 +142,19 @@ Grid &operator=(const Grid &rhs); virtual BaseType *ptr_duplicate(); + virtual bool is_dap2_only_type(); + virtual int element_count(bool leaves = false); virtual void set_send_p(bool state); virtual void set_read_p(bool state); virtual void set_in_selection(bool state); - virtual BaseType *var(const string &n, bool exact = true, - btp_stack *s = 0); - + virtual BaseType *var(const string &n, bool exact = true, btp_stack *s = 0); virtual BaseType *var(const string &n, btp_stack &s); virtual void add_var(BaseType *bt, Part part); + virtual void add_var_nocopy(BaseType *bt, Part part); virtual void set_array(Array* p_new_arr); virtual Array* add_map(Array* p_new_map, bool add_copy); @@ -164,9 +163,10 @@ BaseType *array_var(); Array *get_array(); - - virtual unsigned int width(); - + virtual unsigned int width(bool constrained = false); +#if 0 + virtual unsigned int width(bool constrained); +#endif virtual int components(bool constrained = false); virtual bool projection_yields_grid(); @@ -174,13 +174,12 @@ virtual void clear_constraint(); virtual void intern_data(ConstraintEvaluator &eval, DDS &dds); - virtual bool serialize(ConstraintEvaluator &eval, DDS &dds, - Marshaller &m, bool ce_eval = true); + virtual bool serialize(ConstraintEvaluator &eval, DDS &dds, Marshaller &m, bool ce_eval = true); virtual bool deserialize(UnMarshaller &um, DDS *dds, bool reuse = false); - +#if 0 virtual unsigned int val2buf(void *buf, bool reuse = false); - virtual unsigned int buf2val(void **val); +#endif virtual void print_decl(ostream &out, string space = " ", bool print_semi = true, @@ -189,11 +188,11 @@ virtual void print_xml(ostream &out, string space = " ", bool constrained = false); + virtual void print_xml_writer(XMLWriter &xml, bool constrained = false); virtual void print_val(ostream &out, string space = "", bool print_decl_p = true); -#if FILE_METHODS virtual void print_decl(FILE *out, string space = " ", bool print_semi = true, bool constraint_info = false, @@ -202,7 +201,6 @@ bool constrained = false); virtual void print_val(FILE *out, string space = "", bool print_decl_p = true); -#endif virtual void transfer_attributes(AttrTable *at_container); diff -Nru libdap-3.11.1/GridGeoConstraint.cc libdap-3.12.0/GridGeoConstraint.cc --- libdap-3.11.1/GridGeoConstraint.cc 2011-04-29 13:19:43.000000000 +0000 +++ libdap-3.12.0/GridGeoConstraint.cc 1970-01-01 00:00:00.000000000 +0000 @@ -1,396 +0,0 @@ - -// -*- mode: c++; c-basic-offset:4 -*- - -// This file is part of libdap, A C++ implementation of the OPeNDAP Data -// Access Protocol. - -// Copyright (c) 2002,2003 OPeNDAP, Inc. -// Author: James Gallagher -// -// This library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Lesser General Public -// License as published by the Free Software Foundation; either -// version 2.1 of the License, or (at your option) any later version. -// -// This library 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 -// Lesser General Public License for more details. -// -// You should have received a copy of the GNU Lesser General Public -// License along with this library; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -// -// You can contact OPeNDAP, Inc. at PO Box 112, Saunderstown, RI. 02874-0112. - -// The Grid Selection Expression Clause class. - - -#include "config.h" - -static char id[] not_used = - { "$Id: GridGeoConstraint.cc 24281 2011-03-09 00:22:31Z jimg $" - }; - -#include - -#include -#include - -//#define DODS_DEBUG - -#include "debug.h" -#include "dods-datatypes.h" -#include "GridGeoConstraint.h" -#include "Float64.h" - -#include "Error.h" -#include "InternalErr.h" -#include "ce_functions.h" -#include "util.h" - -using namespace std; - -namespace libdap { - -/** @brief Initialize GeoConstraint with a Grid. - - @param grid Set the GeoConstraint to use this Grid variable. It is the - caller's responsibility to ensure that the value \e grid is a valid Grid - variable. - */ -GridGeoConstraint::GridGeoConstraint(Grid *grid) - : GeoConstraint(), d_grid(grid), d_latitude(0), d_longitude(0) -{ - if (d_grid->get_array()->dimensions() < 2 - || d_grid->get_array()->dimensions() > 3) - throw Error("The geogrid() function works only with Grids of two or three dimensions."); - - // Is this Grid a geo-referenced grid? Throw Error if not. - if (!build_lat_lon_maps()) - throw Error(string("The grid '") + d_grid->name() - + "' does not have identifiable latitude/longitude map vectors."); - - if (!lat_lon_dimensions_ok()) - throw Error("The geogrid() function will only work when the Grid's Longitude and Latitude\nmaps are the rightmost dimensions."); -} - -GridGeoConstraint::GridGeoConstraint(Grid *grid, Array *lat, Array *lon) - : GeoConstraint(), d_grid(grid), d_latitude(0), d_longitude(0) -{ - if (d_grid->get_array()->dimensions() < 2 - || d_grid->get_array()->dimensions() > 3) - throw Error("The geogrid() function works only with Grids of two or three dimensions."); - - // Is this Grid a geo-referenced grid? Throw Error if not. - if (!build_lat_lon_maps(lat, lon)) - throw Error(string("The grid '") + d_grid->name() - + "' does not have valid latitude/longitude map vectors."); - - - if (!lat_lon_dimensions_ok()) - throw Error("The geogrid() function will only work when the Grid's Longitude and Latitude\nmaps are the rightmost dimensions."); -} - -/** A private method called by the constructor that searches for latitude - and longitude map vectors. This method returns false if either map - cannot be found. It assumes that the d_grid and d_dds fields are set. - - The d_longitude, d_lon, d_lon_length and d_lon_grid_dim (and matching - lat) fields are modified. - - @note Rules used to find Maps:
    -
  • Latitude: If the Map has a units attribute of "degrees_north", - "degree_north", "degree_N", or "degrees_N"
  • -
  • Longitude: If the map has a units attribute of "degrees_east" - (eastward positive), "degree_east", "degree_E", or "degrees_E"
  • -
- - @return True if the maps are found, otherwise False */ -bool GridGeoConstraint::build_lat_lon_maps() -{ - Grid::Map_iter m = d_grid->map_begin(); - // Assume that a Grid is correct and thus has exactly as many maps as its - // array part has dimensions. Thus don't bother to test the Grid's array - // dimension iterator for '!= dim_end()'. - Array::Dim_iter d = d_grid->get_array()->dim_begin(); - // The fields d_latitude and d_longitude may be initialized to null or they - // may already contain pointers to the maps to use. In the latter case, - // skip the heuristics used in this code. However, given that all this - // method does is find the lat/lon maps, if they are given in the ctor, - // This method will likely not be called at all. - while (m != d_grid->map_end() && (!d_latitude || !d_longitude)) { - string units_value = (*m)->get_attr_table().get_attr("units"); - units_value = remove_quotes(units_value); - string map_name = (*m)->name(); - - // The 'units' attribute must match exactly; the name only needs to - // match a prefix. - if (!d_latitude - && unit_or_name_match(get_coards_lat_units(), get_lat_names(), - units_value, map_name)) { - - // Set both d_latitude (a pointer to the real map vector) and - // d_lat, a vector of the values represented as doubles. It's easier - // to work with d_lat, but it's d_latitude that needs to be set - // when constraining the grid. Also, record the grid variable's - // dimension iterator so that it's easier to set the Grid's Array - // (which also has to be constrained). - d_latitude = dynamic_cast < Array * >(*m); - if (!d_latitude) - throw InternalErr(__FILE__, __LINE__, "Expected an array."); - if (!d_latitude->read_p()) - d_latitude->read(); - - set_lat(extract_double_array(d_latitude)); // throws Error - set_lat_length(d_latitude->length()); - - set_lat_dim(d); - } - - if (!d_longitude // && !units_value.empty() - && unit_or_name_match(get_coards_lon_units(), get_lon_names(), - units_value, map_name)) { - - d_longitude = dynamic_cast < Array * >(*m); - if (!d_longitude) - throw InternalErr(__FILE__, __LINE__, "Expected an array."); - if (!d_longitude->read_p()) - d_longitude->read(); - - set_lon(extract_double_array(d_longitude)); - set_lon_length(d_longitude->length()); - - set_lon_dim(d); - - if (m + 1 == d_grid->map_end()) - set_longitude_rightmost(true); - } - - ++m; - ++d; - } - - return get_lat() && get_lon(); -} - -/** A private method called by the constructor that check to make sure the - two arrays passed to the constructor are valid latitude and longitude - maps. If so, a they are read in and the values are slurped up by this - object. Then the Grid's dimension iterator is used to record a reference - the the lat and lon dimension of the Grid itself. - - @return True if the maps are valid, otherwise False */ -bool GridGeoConstraint::build_lat_lon_maps(Array *lat, Array *lon) -{ - Grid::Map_iter m = d_grid->map_begin(); - - Array::Dim_iter d = d_grid->get_array()->dim_begin(); - - while (m != d_grid->map_end() && (!d_latitude || !d_longitude)) { - // Look for the Grid map that matches the variable passed as 'lat' - if (!d_latitude && *m == lat) { - - d_latitude = lat; - - if (!d_latitude->read_p()) - d_latitude->read(); - - set_lat(extract_double_array(d_latitude)); // throws Error - set_lat_length(d_latitude->length()); - - set_lat_dim(d); - } - - if (!d_longitude && *m == lon) { - - d_longitude = lon; - - if (!d_longitude->read_p()) - d_longitude->read(); - - set_lon(extract_double_array(d_longitude)); - set_lon_length(d_longitude->length()); - - set_lon_dim(d); - - if (m + 1 == d_grid->map_end()) - set_longitude_rightmost(true); - } - - ++m; - ++d; - } - - return get_lat() && get_lon(); -} - -/** Are the latitude and longitude dimensions ordered so that this class can - properly constrain the data? This method throws Error if lat and lon are - not to two 'fastest-varying' (or 'rightmost') dimensions. It also sets the - internal property \e longitude_rightmost if that's true. - - @note Called by the constructor once build_lat_lon_maps() has returned. - - @return True if the lat/lon maps are the two rightmost maps, - false otherwise; modifies the \e longitude_rightmost property as aside - effect. */ -bool -GridGeoConstraint::lat_lon_dimensions_ok() -{ - // get the last two map iterators - Grid::Map_riter rightmost = d_grid->map_rbegin(); - Grid::Map_riter next_rightmost = rightmost + 1; - - if (*rightmost == d_longitude && *next_rightmost == d_latitude) - set_longitude_rightmost(true); - else if (*rightmost == d_latitude && *next_rightmost == d_longitude) - set_longitude_rightmost(false); - else - return false; - - return true; -} - -/** Once the bounding box is set use this method to apply the constraint. This - modifies the data values in the Grid so that the software in - Vector::serialize() will work correctly. Vector::serialize() assumes that - the BaseType::read() method is called \e after the projection is applied to - the data. That is, the projection is applied, then data are read. but - geogrid() first reads all the data values and then computes the projection. - To make Vector::serialize() work, this method uses the projection - information recorded in the Grid by set_bounding_box() to arrange data so - that the information to be sent is all that is held by the Grid. Call this - after applying any 'Grid selection expressions' of the sort that can be - passed to the grid() function. - - @note Why do this here? The grid() function uses the standard logic in - Vector and elsewhere to read data that's to be sent. The problem is that - the data values need to be reordered using information only this object - has. If this were implemented as a 'selection function' (i.e., if the code - was run by ConstraintExpression::eval() then we might be able to better - optimize how data are read, but in this case we have read all the data - and may have already reorganized it. Set up the internal buffers so they - hold the correct values and mark the Grid's array and lat/lon maps as - read. */ -void GridGeoConstraint::apply_constraint_to_data() -{ - if (!is_bounding_box_set()) - throw InternalErr("The Latitude and Longitude constraints must be set before calling apply_constraint_to_data()."); - - Array::Dim_iter fd = d_latitude->dim_begin(); - - if (get_latitude_sense() == inverted) { - int tmp = get_latitude_index_top(); - set_latitude_index_top(get_latitude_index_bottom()); - set_latitude_index_bottom(tmp); - } - - // It's easy to flip the Latitude values; if the bottom index value - // is before/above the top index, return an error explaining that. - if (get_latitude_index_top() > get_latitude_index_bottom()) - throw Error("The upper and lower latitude indices appear to be reversed. Please provide the latitude bounding box numbers giving the northern-most latitude first."); - - // Constrain the lat vector and lat dim of the array - d_latitude->add_constraint(fd, get_latitude_index_top(), 1, - get_latitude_index_bottom()); - d_grid->get_array()->add_constraint(get_lat_dim(), - get_latitude_index_top(), 1, - get_latitude_index_bottom()); - - // Does the longitude constraint cross the edge of the longitude vector? - // If so, reorder the grid's data (array), longitude map vector and the - // local vector of longitude data used for computation. - if (get_longitude_index_left() > get_longitude_index_right()) { - reorder_longitude_map(get_longitude_index_left()); - - // If the longitude constraint is 'split', join the two parts, reload - // the data into the Grid's Array and make sure the Array is marked as - // already read. This should be true for the whole Grid, but if some - // future modification changes that, the array will be covered here. - // Note that the following method only reads the data out and stores - // it in this object after joining the two parts. The method - // apply_constraint_to_data() transfers the data back from the this - // object to the DAP Grid variable. - reorder_data_longitude_axis(*d_grid->get_array(), get_lon_dim()); - - // Now that the data are all in local storage alter the indices; the - // left index has now been moved to 0, and the right index is now - // at lon_vector_length-left+right. - set_longitude_index_right(get_lon_length() - get_longitude_index_left() - + get_longitude_index_right()); - set_longitude_index_left(0); - } - - // If the constraint used the -180/179 (neg_pos) notation, transform - // the longitude map so it uses the -180/179 notation. Note that at this - // point, d_longitude always uses the pos notation because of the earlier - // conditional transformation. - - // Do this _before_ applying the constraint since set_array_using_double() - // tests the array length using Vector::length() and that method returns - // the length _as constrained_. We want to move all of the longitude - // values from d_lon back into the map, not just the number that will be - // sent (although an optimization might do this, it's hard to imagine - // it would gain much). - if (get_longitude_notation() == neg_pos) { - transform_longitude_to_neg_pos_notation(); - } - - // Apply constraint; stride is always one and maps only have one dimension - fd = d_longitude->dim_begin(); - d_longitude->add_constraint(fd, get_longitude_index_left(), 1, - get_longitude_index_right()); - - d_grid->get_array()->add_constraint(get_lon_dim(), - get_longitude_index_left(), - 1, get_longitude_index_right()); - - // Transfer values from the local lat vector to the Grid's - // Here test the sense of the latitude vector and invert the vector if the - // sense is 'inverted' so that the top is always the northern-most value - if (get_latitude_sense() == inverted) { - DBG(cerr << "Inverted latitude sense" << endl); - transpose_vector(get_lat() + get_latitude_index_top(), - get_latitude_index_bottom() - get_latitude_index_top() + 1); - // Now read the Array data and flip the latitudes. - flip_latitude_within_array(*d_grid->get_array(), - get_latitude_index_bottom() - get_latitude_index_top() + 1, - get_longitude_index_right() - get_longitude_index_left() + 1); - } - - set_array_using_double(d_latitude, get_lat() + get_latitude_index_top(), - get_latitude_index_bottom() - get_latitude_index_top() + 1); - - set_array_using_double(d_longitude, get_lon() + get_longitude_index_left(), - get_longitude_index_right() - get_longitude_index_left() + 1); - - // Look for any non-lat/lon maps and make sure they are read correctly - Grid::Map_iter i = d_grid->map_begin(); - Grid::Map_iter end = d_grid->map_end(); - while (i != end) { - if (*i != d_latitude && *i != d_longitude) { - if ((*i)->send_p()) { - DBG(cerr << "reading grid map: " << (*i)->name() << endl); - //(*i)->set_read_p(false); - (*i)->read(); - } - } - ++i; - } - - // ... and then the Grid's array if it has been read. - if (get_array_data()) { - int size = d_grid->get_array()->val2buf(get_array_data()); - - if (size != get_array_data_size()) - throw InternalErr(__FILE__, __LINE__, "Expected data size not copied to the Grid's buffer."); - - d_grid->set_read_p(true); - } - else { - d_grid->get_array()->read(); - } -} - -} // namespace libdap diff -Nru libdap-3.11.1/GridGeoConstraint.h libdap-3.12.0/GridGeoConstraint.h --- libdap-3.11.1/GridGeoConstraint.h 2011-04-29 13:19:43.000000000 +0000 +++ libdap-3.12.0/GridGeoConstraint.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,86 +0,0 @@ - -// -*- mode: c++; c-basic-offset:4 -*- - -// This file is part of libdap, A C++ implementation of the OPeNDAP Data -// Access Protocol. - -// Copyright (c) 2006 OPeNDAP, Inc. -// Author: James Gallagher -// -// This library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Lesser General Public -// License as published by the Free Software Foundation; either -// version 2.1 of the License, or (at your option) any later version. -// -// This library 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 -// Lesser General Public License for more details. -// -// You should have received a copy of the GNU Lesser General Public -// License along with this library; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -// -// You can contact OPeNDAP, Inc. at PO Box 112, Saunderstown, RI. 02874-0112. - -#ifndef _grid_geo_constraint_h -#define _grid_geo_constraint_h 1 - -#include -#include -#include - -#ifndef _geo_constraint_h -#include "GeoConstraint.h" -#endif - -namespace libdap -{ - -// Defined in GeoConstraint; maybe move to util.cc/h? -extern bool unit_or_name_match(set < string > units, set < string > names, - const string & var_units, - const string & var_name); - -/** Geographical constraint applied to a grid. - @author James Gallagher */ - -class GridGeoConstraint : public GeoConstraint -{ - -private: - // Specific to a Grid - Grid *d_grid; //< Constrain this Grid - - Array *d_latitude; //< A pointer to the Grid's latitude map - Array *d_longitude; //< A pointer to the Grid's longitude map - - bool build_lat_lon_maps(); - bool build_lat_lon_maps(Array *lat, Array *lon); - - bool lat_lon_dimensions_ok(); - - friend class GridGeoConstraintTest; // Unit tests - -public: - /** @name Constructors */ - //@{ - GridGeoConstraint(Grid *grid); - GridGeoConstraint(Grid *grid, Array *lat, Array *lon); - //@} - - virtual ~GridGeoConstraint() - {} - - virtual void apply_constraint_to_data() ; - - virtual Grid *get_constrained_grid() const - { - return d_grid; - } -}; - -} // namespace libdap - -#endif // _grid_geo_constraint_h - diff -Nru libdap-3.11.1/HTTPCache.cc libdap-3.12.0/HTTPCache.cc --- libdap-3.11.1/HTTPCache.cc 2011-04-29 13:19:43.000000000 +0000 +++ libdap-3.12.0/HTTPCache.cc 2013-10-17 21:27:40.000000000 +0000 @@ -19,13 +19,13 @@ // // You should have received a copy of the GNU Lesser General Public // License along with this library; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA // // You can contact OPeNDAP, Inc. at PO Box 112, Saunderstown, RI. 02874-0112. #include "config.h" -// #define DODS_DEBUG +//#define DODS_DEBUG // #define DODS_DEBUG2 #undef USE_GETENV @@ -51,6 +51,7 @@ #include "HTTPCacheInterruptHandler.h" #include "HTTPCacheTable.h" #include "HTTPCache.h" +#include "HTTPCacheMacros.h" #include "util_mit.h" #include "debug.h" @@ -71,36 +72,6 @@ static pthread_mutex_t instance_mutex; static pthread_once_t once_block = PTHREAD_ONCE_INIT; -#ifdef WIN32 -#include -#include -#include -#define MKDIR(a,b) _mkdir((a)) -#define UMASK(a) _umask((a)) -#define REMOVE(a) remove((a)) -#define MKSTEMP(a) _open(_mktemp((a)),_O_CREAT,_S_IREAD|_S_IWRITE) -#define DIR_SEPARATOR_CHAR '\\' -#define DIR_SEPARATOR_STR "\\" -#else -#define MKDIR(a,b) mkdir((a), (b)) -#define UMASK(a) umask((a)) -#define REMOVE(a) remove((a)) -#define MKSTEMP(a) mkstemp((a)) -#define DIR_SEPARATOR_CHAR '/' -#define DIR_SEPARATOR_STR "/" -#endif - -#ifdef WIN32 -#define CACHE_LOCATION "\\tmp\\" -#define CACHE_ROOT "dods-cache\\" -#else -#define CACHE_LOCATION "/tmp/" -#define CACHE_ROOT "dods-cache/" -#endif -#define CACHE_INDEX ".index" -#define CACHE_LOCK ".lock" -#define CACHE_META ".meta" -//#define CACHE_EMPTY_ETAG "@cache@" #define NO_LM_EXPIRATION 24*3600 // 24 hours @@ -998,11 +969,15 @@ for (i = headers.begin(); i != headers.end(); ++i) { if (!is_hop_by_hop_header(*i)) { int s = fwrite((*i).c_str(), (*i).size(), 1, dest); - if (s != 1) + if (s != 1) { + fclose(dest); throw InternalErr(__FILE__, __LINE__, "could not write header: '" + (*i) + "' " + long_to_string(s)); + } s = fwrite("\n", 1, 1, dest); - if (s != 1) + if (s != 1) { + fclose(dest); throw InternalErr(__FILE__, __LINE__, "could not write header: " + long_to_string(s)); + } } } @@ -1487,7 +1462,7 @@ vector &headers, string &cacheName) { lock_cache_interface(); - FILE *body; + FILE *body = 0; HTTPCacheTable::CacheEntry *entry = 0; DBG(cerr << "Getting the cached response for " << url << endl); @@ -1515,7 +1490,8 @@ // Why make this unlock operation conditional on entry? if (entry) unlock_cache_interface(); - fclose(body); + if (body != 0) + fclose(body); throw; } @@ -1578,6 +1554,7 @@ lock_cache_interface(); try { + // fclose(body); This results in a seg fault on linux jhrg 8/27/13 d_http_cache_table->uncouple_entry_from_data(body); } catch (...) { diff -Nru libdap-3.11.1/HTTPCache.h libdap-3.12.0/HTTPCache.h --- libdap-3.11.1/HTTPCache.h 2011-04-29 13:19:43.000000000 +0000 +++ libdap-3.12.0/HTTPCache.h 2013-10-17 21:27:40.000000000 +0000 @@ -19,7 +19,7 @@ // // You should have received a copy of the GNU Lesser General Public // License along with this library; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA // // You can contact OPeNDAP, Inc. at PO Box 112, Saunderstown, RI. 02874-0112. diff -Nru libdap-3.11.1/HTTPCacheDisconnectedMode.h libdap-3.12.0/HTTPCacheDisconnectedMode.h --- libdap-3.11.1/HTTPCacheDisconnectedMode.h 2011-04-29 13:19:43.000000000 +0000 +++ libdap-3.12.0/HTTPCacheDisconnectedMode.h 2013-10-17 21:27:40.000000000 +0000 @@ -19,7 +19,7 @@ // // You should have received a copy of the GNU Lesser General Public // License along with this library; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA // // You can contact OPeNDAP, Inc. at PO Box 112, Saunderstown, RI. 02874-0112. diff -Nru libdap-3.11.1/HTTPCacheInterruptHandler.h libdap-3.12.0/HTTPCacheInterruptHandler.h --- libdap-3.11.1/HTTPCacheInterruptHandler.h 2011-04-29 13:19:43.000000000 +0000 +++ libdap-3.12.0/HTTPCacheInterruptHandler.h 2013-10-17 21:27:40.000000000 +0000 @@ -19,7 +19,7 @@ // // You should have received a copy of the GNU Lesser General Public // License along with this library; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA // // You can contact OPeNDAP, Inc. at PO Box 112, Saunderstown, RI. 02874-0112. diff -Nru libdap-3.11.1/HTTPCacheMacros.h libdap-3.12.0/HTTPCacheMacros.h --- libdap-3.11.1/HTTPCacheMacros.h 1970-01-01 00:00:00.000000000 +0000 +++ libdap-3.12.0/HTTPCacheMacros.h 2013-10-17 21:27:40.000000000 +0000 @@ -0,0 +1,71 @@ +/* + * HTTPCacheMacros.h + * + * Created on: Dec 28, 2011 + * Author: jimg + */ + +#ifndef HTTPCACHEMACROS_H_ +#define HTTPCACHEMACROS_H_ + +#ifdef WIN32 +#include +#include +#include +#define MKDIR(a,b) _mkdir((a)) +#define UMASK(a) _umask((a)) + +#if 0 +#define REMOVE(a) do { \ + int s = remove((a)); \ + if (s != 0) \ + throw InternalErr(__FILE__, __LINE__, "Cache error; could not remove file: " + long_to_string(s)); \ + } while(0) +#endif + +#define REMOVE_BOOL(a) remove((a)) +#define REMOVE(a) ((void)remove((a))) +#define MKSTEMP(a) _open(_mktemp((a)),_O_CREAT,_S_IREAD|_S_IWRITE) +#define DIR_SEPARATOR_CHAR '\\' +#define DIR_SEPARATOR_STR "\\" + +#else +#include +#define MKDIR(a,b) mkdir((a), (b)) +#define UMASK(a) umask((a)) + +#if 0 +// Replaced this with something that signals errors. jhrg 12/28/2011 +// A great idea, but it breaks things in ways that complicate +// testing. Push this change forward to H 1.9. jhrg 12/28/2011 +#define REMOVE(a) do { \ + errno = 0; \ + int s = remove((a)); \ + if (s != 0) \ + throw InternalErr(__FILE__, __LINE__, "Cache error; could not remove file: " + long_to_string(errno)); \ + } while(0) +#endif + +#define REMOVE_BOOL(a) remove((a)) +#define REMOVE(a) ((void)remove((a))) + +#define MKSTEMP(a) mkstemp((a)) +#define DIR_SEPARATOR_CHAR '/' +#define DIR_SEPARATOR_STR "/" +#endif + +#ifdef WIN32 +#define CACHE_LOCATION "\\tmp\\" +#define CACHE_ROOT "dods-cache\\" +#else +#define CACHE_LOCATION "/tmp/" +#define CACHE_ROOT "dods-cache/" +#endif + +#define CACHE_INDEX ".index" +#define CACHE_LOCK ".lock" +#define CACHE_META ".meta" +#define CACHE_EMPTY_ETAG "@cache@" + + +#endif /* HTTPCACHEMACROS_H_ */ diff -Nru libdap-3.11.1/HTTPCacheResponse.h libdap-3.12.0/HTTPCacheResponse.h --- libdap-3.11.1/HTTPCacheResponse.h 2011-04-29 13:19:43.000000000 +0000 +++ libdap-3.12.0/HTTPCacheResponse.h 2013-10-17 21:27:40.000000000 +0000 @@ -19,7 +19,7 @@ // // You should have received a copy of the GNU Lesser General Public // License along with this library; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA // // You can contact OPeNDAP, Inc. at PO Box 112, Saunderstown, RI. 02874-0112. diff -Nru libdap-3.11.1/HTTPCacheTable.cc libdap-3.12.0/HTTPCacheTable.cc --- libdap-3.11.1/HTTPCacheTable.cc 2011-04-29 13:19:43.000000000 +0000 +++ libdap-3.12.0/HTTPCacheTable.cc 2013-10-17 21:27:40.000000000 +0000 @@ -19,7 +19,7 @@ // // You should have received a copy of the GNU Lesser General Public // License along with this library; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA // // You can contact OPeNDAP, Inc. at PO Box 112, Saunderstown, RI. 02874-0112. @@ -50,6 +50,7 @@ #endif #include "HTTPCacheInterruptHandler.h" #include "HTTPCacheTable.h" +#include "HTTPCacheMacros.h" #include "util_mit.h" #include "debug.h" @@ -62,14 +63,13 @@ #define REMOVE(a) do { \ int s = remove((a)); \ if (s != 0) \ - throw InternalErr(__FILE__, __LINE__, "Coule not remove file: " + long_to_string(s)); \ + throw InternalErr(__FILE__, __LINE__, "Cache error; could not remove file: " + long_to_string(s)); \ } while(0); #define MKSTEMP(a) _open(_mktemp((a)),_O_CREAT,_S_IREAD|_S_IWRITE) #define DIR_SEPARATOR_CHAR '\\' #define DIR_SEPARATOR_STR "\\" #else #define MKDIR(a,b) mkdir((a), (b)) -#define REMOVE(a) remove((a)) #define MKSTEMP(a) mkstemp((a)) #define DIR_SEPARATOR_CHAR '/' #define DIR_SEPARATOR_STR "/" @@ -135,15 +135,15 @@ HTTPCacheTable::~HTTPCacheTable() { for (int i = 0; i < CACHE_TABLE_SIZE; ++i) { - HTTPCacheTable::CacheEntries *cp = get_cache_table()[i]; - if (cp) { - // delete each entry - for_each(cp->begin(), cp->end(), delete_cache_entry); - - // now delete the vector that held the entries - delete get_cache_table()[i]; - get_cache_table()[i] = 0; - } + HTTPCacheTable::CacheEntries *cp = get_cache_table()[i]; + if (cp) { + // delete each entry + for_each(cp->begin(), cp->end(), delete_cache_entry); + + // now delete the vector that held the entries + delete get_cache_table()[i]; + get_cache_table()[i] = 0; + } } delete[] d_cache_table; @@ -281,7 +281,7 @@ { d_new_entries = 0; - return (REMOVE(d_cache_index.c_str()) == 0); + return (REMOVE_BOOL(d_cache_index.c_str()) == 0); } /** Read the saved set of cached entries from disk. Consistency between the @@ -540,6 +540,8 @@ HTTPCacheTable::add_entry_to_cache_table(CacheEntry *entry) { int hash = entry->hash; + if (hash > CACHE_TABLE_SIZE-1 || hash < 0) + throw InternalErr(__FILE__, __LINE__, "Hash value too large!"); if (!d_cache_table[hash]) d_cache_table[hash] = new CacheEntries; diff -Nru libdap-3.11.1/HTTPCacheTable.h libdap-3.12.0/HTTPCacheTable.h --- libdap-3.11.1/HTTPCacheTable.h 2011-04-29 13:19:43.000000000 +0000 +++ libdap-3.12.0/HTTPCacheTable.h 2013-10-17 21:27:40.000000000 +0000 @@ -19,7 +19,7 @@ // // You should have received a copy of the GNU Lesser General Public // License along with this library; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA // // You can contact OPeNDAP, Inc. at PO Box 112, Saunderstown, RI. 02874-0112. diff -Nru libdap-3.11.1/HTTPConnect.cc libdap-3.12.0/HTTPConnect.cc --- libdap-3.11.1/HTTPConnect.cc 2011-04-29 13:19:43.000000000 +0000 +++ libdap-3.12.0/HTTPConnect.cc 2013-10-17 21:27:40.000000000 +0000 @@ -19,17 +19,13 @@ // // You should have received a copy of the GNU Lesser General Public // License along with this library; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA // // You can contact OPeNDAP, Inc. at PO Box 112, Saunderstown, RI. 02874-0112. #include "config.h" -static char rcsid[] not_used = - { "$Id: HTTPConnect.cc 24380 2011-03-28 21:47:15Z jimg $" - }; - #ifdef HAVE_UNISTD_H #include #endif @@ -49,7 +45,6 @@ #include #include -// #define DODS_DEBUG //#define DODS_DEBUG2 //#define HTTP_TRACE //#define DODS_DEBUG @@ -448,6 +443,9 @@ // value/result parameter to get the raw response header information . curl_easy_setopt(d_curl, CURLOPT_WRITEHEADER, resp_hdrs); + // This is the call that causes curl to go and get the remote resource and "write it down" + // utilizing the configuration state that has been previously conditioned by various perturbations + // of calls to curl_easy_setopt(). CURLcode res = curl_easy_perform(d_curl); // Free the header list and null the value in d_curl. @@ -525,8 +523,7 @@ // HTTPCache::instance returns a valid ptr or 0. if (d_rcr->get_use_cache()) - d_http_cache = HTTPCache::instance(d_rcr->get_dods_cache_root(), - true); + d_http_cache = HTTPCache::instance(d_rcr->get_dods_cache_root(),true); else d_http_cache = 0; @@ -887,7 +884,7 @@ try { status = read_url(url, stream, resp_hdrs); // Throws Error. if (status >= 400) { - delete resp_hdrs; + // delete resp_hdrs; resp_hdrs = 0; string msg = "Error while reading the URL: "; msg += url; msg += ".\nThe OPeNDAP server returned the following message:\n"; diff -Nru libdap-3.11.1/HTTPConnect.h libdap-3.12.0/HTTPConnect.h --- libdap-3.11.1/HTTPConnect.h 2011-04-29 13:19:43.000000000 +0000 +++ libdap-3.12.0/HTTPConnect.h 2013-10-17 21:27:40.000000000 +0000 @@ -19,7 +19,7 @@ // // You should have received a copy of the GNU Lesser General Public // License along with this library; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA // // You can contact OPeNDAP, Inc. at PO Box 112, Saunderstown, RI. 02874-0112. @@ -30,7 +30,8 @@ #include #include -#include +//No longer used in CURL - pwest April 09, 2012 +//#include #include #ifndef _rc_reader_h_ diff -Nru libdap-3.11.1/HTTPResponse.h libdap-3.12.0/HTTPResponse.h --- libdap-3.11.1/HTTPResponse.h 2011-04-29 13:19:42.000000000 +0000 +++ libdap-3.12.0/HTTPResponse.h 2013-10-17 21:27:40.000000000 +0000 @@ -19,7 +19,7 @@ // // You should have received a copy of the GNU Lesser General Public // License along with this library; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA // // You can contact OPeNDAP, Inc. at PO Box 112, Saunderstown, RI. 02874-0112. diff -Nru libdap-3.11.1/INSTALL libdap-3.12.0/INSTALL --- libdap-3.11.1/INSTALL 2011-04-29 13:19:43.000000000 +0000 +++ libdap-3.12.0/INSTALL 2013-10-17 21:27:40.000000000 +0000 @@ -1,7 +1,5 @@ - $Id: INSTALL 24504 2011-04-25 23:26:38Z jimg $ - -Updated for version 3.11.1 of the OPeNDAP DAP 3.4 library software. +Updated for version 3.12.0 of the OPeNDAP DAP 3.4 library software. Installing the DAP2/3.x library @@ -76,10 +74,8 @@ autoconf 2.63 and libtool 2.2.6. Earlier versions may work, but may cause problems, particularly with the 'distcheck' target for make. Given those requirements, use 'autoreconf --force --install - --verbose' and then build as described above. You also need bison - and flex as of version 3.7.9. If you don't have these tools, you - can try the copies of the generated files in the 'grammarfiles' - directory. + --verbose' and then build as described above. You also need bison 2.4 + and flex as of version 3.7.9. o The library uses libcurl and libxml2. You will need these libraries installed on your system to successfully run configure and build the diff -Nru libdap-3.11.1/Int16.cc libdap-3.12.0/Int16.cc --- libdap-3.11.1/Int16.cc 2011-04-29 13:19:42.000000000 +0000 +++ libdap-3.12.0/Int16.cc 2013-10-17 21:27:40.000000000 +0000 @@ -19,7 +19,7 @@ // // You should have received a copy of the GNU Lesser General Public // License along with this library; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA // // You can contact OPeNDAP, Inc. at PO Box 112, Saunderstown, RI. 02874-0112. @@ -36,23 +36,24 @@ #include "config.h" -static char rcsid[] not_used = - {"$Id: Int16.cc 21699 2009-11-05 00:06:01Z jimg $" - }; +#include -#include "Byte.h" +#include "Byte.h" // synonymous with UInt8 and Char +#include "Int8.h" #include "Int16.h" #include "UInt16.h" #include "Int32.h" #include "UInt32.h" +#include "Int64.h" +#include "UInt64.h" #include "Float32.h" #include "Float64.h" #include "Str.h" #include "Url.h" -#include "Array.h" -#include "Structure.h" -#include "Sequence.h" -#include "Grid.h" + + +#include "Marshaller.h" +#include "UnMarshaller.h" #include "DDS.h" #include "util.h" @@ -86,7 +87,7 @@ Int16::Int16(const Int16 ©_from) : BaseType(copy_from) { - _buf = copy_from._buf; + d_buf = copy_from.d_buf; } BaseType * @@ -103,13 +104,13 @@ dynamic_cast(*this) = rhs; - _buf = rhs._buf; + d_buf = rhs.d_buf; return *this; } unsigned int -Int16::width() +Int16::width(bool) { return sizeof(dods_int16); } @@ -130,7 +131,7 @@ dds.timeout_off(); - m.put_int16( _buf ) ; + m.put_int16( d_buf ) ; return true; } @@ -138,7 +139,7 @@ bool Int16::deserialize(UnMarshaller &um, DDS *, bool) { - um.get_int16( _buf ) ; + um.get_int16( d_buf ) ; return false; } @@ -154,7 +155,7 @@ throw InternalErr(__FILE__, __LINE__, "The incoming pointer does not contain any data."); - _buf = *(dods_int16 *)val; + d_buf = *(dods_int16 *)val; return width(); } @@ -170,7 +171,7 @@ if (!*val) *val = new dods_int16; - *(dods_int16 *)*val = _buf; + *(dods_int16 *)*val = d_buf; return width(); } @@ -178,40 +179,35 @@ dods_int16 Int16::value() const { - return _buf; + return d_buf; } bool Int16::set_value(dods_int16 i) { - _buf = i; + d_buf = i; set_read_p(true); return true; } -#if FILE_METHODS void Int16::print_val(FILE *out, string space, bool print_decl_p) { - if (print_decl_p) { - print_decl(out, space, false); - fprintf(out, " = %d;\n", _buf) ; - } - else - fprintf(out, "%d", _buf) ; + ostringstream oss; + print_val(oss, space, print_decl_p); + fwrite(oss.str().data(), sizeof(char), oss.str().length(), out); } -#endif void Int16::print_val(ostream &out, string space, bool print_decl_p) { if (print_decl_p) { print_decl(out, space, false); - out << " = " << _buf << ";\n" ; + out << " = " << d_buf << ";\n" ; } else - out << _buf ; + out << d_buf ; } bool @@ -239,29 +235,28 @@ } switch (b->type()) { - case dods_byte_c: - return rops > - (_buf, dynamic_cast(b)->_buf, op); - case dods_int16_c: - return rops > - (_buf, dynamic_cast(b)->_buf, op); - case dods_uint16_c: - return rops > - (_buf, dynamic_cast(b)->_buf, op); - case dods_int32_c: - return rops > - (_buf, dynamic_cast(b)->_buf, op); - case dods_uint32_c: - return rops > - (_buf, dynamic_cast(b)->_buf, op); - case dods_float32_c: - return rops > - (_buf, dynamic_cast(b)->_buf, op); - case dods_float64_c: - return rops > - (_buf, dynamic_cast(b)->_buf, op); - default: - return false; + case dods_int8_c: + return Cmp(op, d_buf, static_cast(b)->value()); + case dods_byte_c: + return SUCmp(op, d_buf, static_cast(b)->value()); + case dods_int16_c: + return Cmp(op, d_buf, static_cast(b)->value()); + case dods_uint16_c: + return SUCmp(op, d_buf, static_cast(b)->value()); + case dods_int32_c: + return Cmp(op, d_buf, static_cast(b)->value()); + case dods_uint32_c: + return SUCmp(op, d_buf, static_cast(b)->value()); + case dods_int64_c: + return Cmp(op, d_buf, static_cast(b)->value()); + case dods_uint64_c: + return SUCmp(op, d_buf, static_cast(b)->value()); + case dods_float32_c: + return Cmp(op, d_buf, static_cast(b)->value()); + case dods_float64_c: + return Cmp(op, d_buf, static_cast(b)->value()); + default: + return false; } } @@ -280,7 +275,7 @@ << (void *)this << ")" << endl ; DapIndent::Indent() ; BaseType::dump(strm) ; - strm << DapIndent::LMarg << "value: " << _buf << endl ; + strm << DapIndent::LMarg << "value: " << d_buf << endl ; DapIndent::UnIndent() ; } diff -Nru libdap-3.11.1/Int16.h libdap-3.12.0/Int16.h --- libdap-3.11.1/Int16.h 2011-04-29 13:19:43.000000000 +0000 +++ libdap-3.12.0/Int16.h 2013-10-17 21:27:40.000000000 +0000 @@ -19,7 +19,7 @@ // // You should have received a copy of the GNU Lesser General Public // License along with this library; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA // // You can contact OPeNDAP, Inc. at PO Box 112, Saunderstown, RI. 02874-0112. @@ -49,8 +49,6 @@ #include "ConstraintEvaluator.h" #endif -#define FILE_METHODS 1 - namespace libdap { @@ -58,20 +56,8 @@ class Int16: public BaseType { - /** This class allows Byte, ..., Float64 access to _buf to - simplify and speed up the relational operators. - - NB: According to Stroustrup it does not matter where (public, private - or protected) friend classes are declared. */ - friend class Byte; - friend class UInt16; - friend class Int32; - friend class UInt32; - friend class Float32; - friend class Float64; - protected: - dods_int16 _buf; + dods_int16 d_buf; public: Int16(const string &n); @@ -85,7 +71,7 @@ virtual BaseType *ptr_duplicate(); - virtual unsigned int width(); + virtual unsigned int width(bool constrained = false); virtual bool serialize(ConstraintEvaluator &eval, DDS &dds, Marshaller &m, bool ce_eval = true); @@ -96,10 +82,9 @@ virtual dods_int16 value() const; virtual bool set_value(dods_int16 val); -#if FILE_METHODS + virtual void print_val(FILE *out, string space = "", bool print_decl_p = true); -#endif virtual void print_val(ostream &out, string space = "", bool print_decl_p = true); diff -Nru libdap-3.11.1/Int32.cc libdap-3.12.0/Int32.cc --- libdap-3.11.1/Int32.cc 2011-04-29 13:19:43.000000000 +0000 +++ libdap-3.12.0/Int32.cc 2013-10-17 21:27:40.000000000 +0000 @@ -19,7 +19,7 @@ // // You should have received a copy of the GNU Lesser General Public // License along with this library; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA // // You can contact OPeNDAP, Inc. at PO Box 112, Saunderstown, RI. 02874-0112. @@ -36,25 +36,26 @@ #include "config.h" -static char rcsid[] not_used = - {"$Id: Int32.cc 21699 2009-11-05 00:06:01Z jimg $" - }; +#include -#include "Byte.h" +#include "Byte.h" // synonymous with UInt8 and Char +#include "Int8.h" #include "Int16.h" #include "UInt16.h" #include "Int32.h" #include "UInt32.h" +#include "Int64.h" +#include "UInt64.h" #include "Float32.h" #include "Float64.h" #include "Str.h" #include "Url.h" -#include "Array.h" -#include "Structure.h" -#include "Sequence.h" -#include "Grid.h" + #include "DDS.h" +#include "Marshaller.h" +#include "UnMarshaller.h" + #include "util.h" #include "parser.h" #include "Operators.h" @@ -92,7 +93,7 @@ Int32::Int32(const Int32 ©_from) : BaseType(copy_from) { - _buf = copy_from._buf; + d_buf = copy_from.d_buf; } BaseType * @@ -114,13 +115,13 @@ dynamic_cast(*this) = rhs; - _buf = rhs._buf; + d_buf = rhs.d_buf; return *this; } unsigned int -Int32::width() +Int32::width(bool) { return sizeof(dods_int32); } @@ -141,7 +142,7 @@ dds.timeout_off(); - m.put_int32( _buf ) ; + m.put_int32( d_buf ) ; return true; } @@ -149,7 +150,7 @@ bool Int32::deserialize(UnMarshaller &um, DDS *, bool) { - um.get_int32( _buf ) ; + um.get_int32( d_buf ) ; return false; } @@ -165,7 +166,7 @@ throw InternalErr(__FILE__, __LINE__, "The incoming pointer does not contain any data."); - _buf = *(dods_int32 *)val; + d_buf = *(dods_int32 *)val; return width(); } @@ -181,7 +182,7 @@ if (!*val) *val = new dods_int32; - *(dods_int32 *)*val = _buf; + *(dods_int32 *)*val = d_buf; return width(); } @@ -189,40 +190,35 @@ dods_int32 Int32::value() const { - return _buf; + return d_buf; } bool Int32::set_value(dods_int32 i) { - _buf = i; + d_buf = i; set_read_p(true); return true; } -#if FILE_METHODS void Int32::print_val(FILE *out, string space, bool print_decl_p) { - if (print_decl_p) { - print_decl(out, space, false); - fprintf(out, " = %d;\n", (int)_buf) ; - } - else - fprintf(out, "%d", (int)_buf) ; + ostringstream oss; + print_val(oss, space, print_decl_p); + fwrite(oss.str().data(), sizeof(char), oss.str().length(), out); } -#endif void Int32::print_val(ostream &out, string space, bool print_decl_p) { if (print_decl_p) { print_decl(out, space, false); - out << " = " << (int)_buf << ";\n" ; + out << " = " << (int)d_buf << ";\n" ; } else - out << (int)_buf ; + out << (int)d_buf ; } bool @@ -250,29 +246,28 @@ } switch (b->type()) { - case dods_byte_c: - return rops > - (_buf, dynamic_cast(b)->_buf, op); - case dods_int16_c: - return rops > - (_buf, dynamic_cast(b)->_buf, op); - case dods_uint16_c: - return rops > - (_buf, dynamic_cast(b)->_buf, op); - case dods_int32_c: - return rops > - (_buf, dynamic_cast(b)->_buf, op); - case dods_uint32_c: - return rops > - (_buf, dynamic_cast(b)->_buf, op); - case dods_float32_c: - return rops > - (_buf, dynamic_cast(b)->_buf, op); - case dods_float64_c: - return rops > - (_buf, dynamic_cast(b)->_buf, op); - default: - return false; + case dods_int8_c: + return Cmp(op, d_buf, static_cast(b)->value()); + case dods_byte_c: + return SUCmp(op, d_buf, static_cast(b)->value()); + case dods_int16_c: + return Cmp(op, d_buf, static_cast(b)->value()); + case dods_uint16_c: + return SUCmp(op, d_buf, static_cast(b)->value()); + case dods_int32_c: + return Cmp(op, d_buf, static_cast(b)->value()); + case dods_uint32_c: + return SUCmp(op, d_buf, static_cast(b)->value()); + case dods_int64_c: + return Cmp(op, d_buf, static_cast(b)->value()); + case dods_uint64_c: + return SUCmp(op, d_buf, static_cast(b)->value()); + case dods_float32_c: + return Cmp(op, d_buf, static_cast(b)->value()); + case dods_float64_c: + return Cmp(op, d_buf, static_cast(b)->value()); + default: + return false; } } @@ -291,7 +286,7 @@ << (void *)this << ")" << endl ; DapIndent::Indent() ; BaseType::dump(strm) ; - strm << DapIndent::LMarg << "value: " << _buf << endl ; + strm << DapIndent::LMarg << "value: " << d_buf << endl ; DapIndent::UnIndent() ; } diff -Nru libdap-3.11.1/Int32.h libdap-3.12.0/Int32.h --- libdap-3.11.1/Int32.h 2011-04-29 13:19:42.000000000 +0000 +++ libdap-3.12.0/Int32.h 2013-10-17 21:27:40.000000000 +0000 @@ -19,7 +19,7 @@ // // You should have received a copy of the GNU Lesser General Public // License along with this library; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA // // You can contact OPeNDAP, Inc. at PO Box 112, Saunderstown, RI. 02874-0112. @@ -45,15 +45,17 @@ #include "BaseType.h" #endif +#if 0 #ifndef constraint_evaluator_h #include "ConstraintEvaluator.h" #endif - -#define FILE_METHODS 1 +#endif namespace libdap { +class ConstraintEvaluator; + /** @brief Holds a 32-bit signed integer. @see BaseType @@ -61,20 +63,8 @@ class Int32: public BaseType { - /** This class allows Byte, ..., Float64 access to _buf to - simplify and speed up the relational operators. - - NB: According to Stroustrup it does not matter where (public, private - or protected) friend classes are declared. */ - friend class Byte; - friend class Int16; - friend class UInt16; - friend class UInt32; - friend class Float32; - friend class Float64; - protected: - dods_int32 _buf; + dods_int32 d_buf; public: Int32(const string &n); @@ -88,7 +78,7 @@ virtual BaseType *ptr_duplicate(); - virtual unsigned int width(); + virtual unsigned int width(bool constrained = false); virtual bool serialize(ConstraintEvaluator &eval, DDS &dds, Marshaller &m, bool ce_eval = true); @@ -99,10 +89,9 @@ virtual bool set_value(dods_int32 i); virtual dods_int32 value() const; -#if FILE_METHODS + virtual void print_val(FILE *out, string space = "", bool print_decl_p = true); -#endif virtual void print_val(ostream &out, string space = "", bool print_decl_p = true); diff -Nru libdap-3.11.1/Int64.cc libdap-3.12.0/Int64.cc --- libdap-3.11.1/Int64.cc 1970-01-01 00:00:00.000000000 +0000 +++ libdap-3.12.0/Int64.cc 2013-10-17 21:27:40.000000000 +0000 @@ -0,0 +1,257 @@ + +// -*- mode: c++; c-basic-offset:4 -*- + +// This file is part of libdap, A C++ implementation of the OPeNDAP Data +// Access Protocol. + +// Copyright (c) 2002,2003 OPeNDAP, Inc. +// Author: James Gallagher +// +// This library is free software; you can redistribute it and/or +// modify it under the terms of the GNU Lesser General Public +// License as published by the Free Software Foundation; either +// version 2.1 of the License, or (at your option) any later version. +// +// This library 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 +// Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, write to the Free Software +// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA +// +// You can contact OPeNDAP, Inc. at PO Box 112, Saunderstown, RI. 02874-0112. + +// (c) COPYRIGHT URI/MIT 1994-1999 +// Please read the full copyright statement in the file COPYRIGHT_URI. +// +// Authors: +// jhrg,jimg James Gallagher + +// Implementation for Int64. +// +// jhrg 9/7/94 + + +#include "config.h" + +#include +#include + +#include "Byte.h" // synonymous with UInt8 and Char +#include "Int8.h" +#include "Int16.h" +#include "UInt16.h" +#include "Int32.h" +#include "UInt32.h" +#include "Int64.h" +#include "UInt64.h" +#include "Float32.h" +#include "Float64.h" +#include "Str.h" +#include "Url.h" + +#if 0 +#include "Array.h" +#include "Structure.h" +#include "Sequence.h" +#include "Grid.h" +#endif + +#include "DAP4StreamMarshaller.h" +#include "DAP4StreamUnMarshaller.h" + +#include "DDS.h" +#include "util.h" +#include "parser.h" +#include "Operators.h" +#include "dods-limits.h" +#include "debug.h" +#include "InternalErr.h" + +using std::cerr; +using std::endl; + +namespace libdap { + +/** The Int64 constructor requires only the name of the variable + to be created. The name may be omitted, which will create a + nameless variable. This may be adequate for some applications. + + @param n A string containing the name of the variable to be + created. +*/ +Int64::Int64(const string &n) : BaseType(n, dods_int64_c) +{} + +/** The Int64 server-side constructor accepts the name of the variable and + the dataset name from which this instance is created. + + @param n A string containing the name of the variable to be created. + @param d A string containing the name of the dataset from which this + variable is created +*/ +Int64::Int64(const string &n, const string &d) : BaseType(n, d, dods_int64_c) +{} + +Int64::Int64(const Int64 ©_from) : BaseType(copy_from) +{ + d_buf = copy_from.d_buf; +} + +BaseType * +Int64::ptr_duplicate() +{ + return new Int64(*this); +} + +Int64::~Int64() +{ + DBG(cerr << "~Int64" << endl); +} + +Int64 & +Int64::operator=(const Int64 &rhs) +{ + if (this == &rhs) + return *this; + + dynamic_cast(*this) = rhs; + + d_buf = rhs.d_buf; + + return *this; +} + +unsigned int +Int64::width(bool) +{ + return sizeof(dods_int64); +} + +bool +Int64::serialize(ConstraintEvaluator &eval, DDS &dds, Marshaller &m, bool ce_eval) +{ + dds.timeout_on(); + + if (!read_p()) + read(); // read() throws Error and InternalErr + +#if EVAL + if (ce_eval && !eval.eval_selection(dds, dataset())) + return true; +#endif + + dds.timeout_off(); + + assert(typeid(m) == typeid(DAP4StreamMarshaller)); + + static_cast(&m)->put_int64( d_buf ) ; + + return true; +} + +bool +Int64::deserialize(UnMarshaller &um, DDS *, bool) +{ + assert(typeid(um) == typeid(DAP4StreamUnMarshaller)); + + static_cast(&um)->get_int64( d_buf ) ; + + return false; +} + +dods_int64 +Int64::value() const +{ + return d_buf; +} + +bool +Int64::set_value(dods_int64 i) +{ + d_buf = i; + set_read_p(true); + + return true; +} + +void +Int64::print_val(FILE *out, string space, bool print_decl_p) +{ + ostringstream oss; + print_val(oss, space, print_decl_p); + fwrite(oss.str().data(), sizeof(char), oss.str().length(), out); +} + +void Int64::print_val(ostream &out, string space, bool print_decl_p) +{ + if (print_decl_p) { + print_decl(out, space, false); + out << " = " << (dods_int64) d_buf << ";\n"; + } + else + out << (int) d_buf; +} + +bool +Int64::ops(BaseType *b, int op) +{ + // Get the arg's value. + if (!read_p() && !read()) + throw InternalErr(__FILE__, __LINE__, "This value not read!"); + + // Get the second arg's value. + if (!b->read_p() && !b->read()) + throw InternalErr(__FILE__, __LINE__, "This value not read!"); + + switch (b->type()) { + case dods_int8_c: + return Cmp(op, d_buf, static_cast(b)->value()); + case dods_byte_c: + return SUCmp(op, d_buf, static_cast(b)->value()); + case dods_int16_c: + return Cmp(op, d_buf, static_cast(b)->value()); + case dods_uint16_c: + return SUCmp(op, d_buf, static_cast(b)->value()); + case dods_int32_c: + return Cmp(op, d_buf, static_cast(b)->value()); + case dods_uint32_c: + return SUCmp(op, d_buf, static_cast(b)->value()); + case dods_int64_c: + return Cmp(op, d_buf, static_cast(b)->value()); + case dods_uint64_c: + return SUCmp(op, d_buf, static_cast(b)->value()); + case dods_float32_c: + return Cmp(op, d_buf, static_cast(b)->value()); + case dods_float64_c: + return Cmp(op, d_buf, static_cast(b)->value()); + default: + return false; + } + + return false; +} + +/** @brief dumps information about this object + * + * Displays the pointer value of this instance and information about this + * instance. + * + * @param strm C++ i/o stream to dump the information to + * @return void + */ +void +Int64::dump(ostream &strm) const +{ + strm << DapIndent::LMarg << "Int64::dump - (" + << (void *)this << ")" << endl ; + DapIndent::Indent() ; + BaseType::dump(strm) ; + strm << DapIndent::LMarg << "value: " << d_buf << endl ; + DapIndent::UnIndent() ; +} + +} // namespace libdap + diff -Nru libdap-3.11.1/Int64.h libdap-3.12.0/Int64.h --- libdap-3.11.1/Int64.h 1970-01-01 00:00:00.000000000 +0000 +++ libdap-3.12.0/Int64.h 2013-10-17 21:27:40.000000000 +0000 @@ -0,0 +1,90 @@ + +// -*- mode: c++; c-basic-offset:4 -*- + +// This file is part of libdap, A C++ implementation of the OPeNDAP Data +// Access Protocol. + +// Copyright (c) 2012 OPeNDAP, Inc. +// Author: James Gallagher +// +// This library is free software; you can redistribute it and/or +// modify it under the terms of the GNU Lesser General Public +// License as published by the Free Software Foundation; either +// version 2.1 of the License, or (at your option) any later version. +// +// This library 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 +// Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, write to the Free Software +// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA +// +// You can contact OPeNDAP, Inc. at PO Box 112, Saunderstown, RI. 02874-0112. + +#ifndef _int64_h +#define _int64_h 1 + +#ifndef _dods_datatypes_h +#include "dods-datatypes.h" +#endif + +#ifndef _basetype_h +#include "BaseType.h" +#endif + +namespace libdap +{ + +class ConstraintEvaluator; +class Marshaller; +class UnMarshaller; + +/** @brief Holds a64-bit signed integer. + + @see BaseType + */ + +class Int64: public BaseType +{ + unsigned int val2buf(void *, bool) { throw InternalErr(__FILE__, __LINE__, "Not implemented for Int64"); } + unsigned int buf2val(void **) { throw InternalErr(__FILE__, __LINE__, "Not implemented for Int64"); } + +protected: + dods_int64 d_buf; + +public: + Int64(const string &n); + Int64(const string &n, const string &d); + + Int64(const Int64 ©_from); + + Int64 &operator=(const Int64 &rhs); + + virtual ~Int64(); + + virtual BaseType *ptr_duplicate(); + + virtual unsigned int width(bool constrained = false); + + virtual bool serialize(ConstraintEvaluator &eval, DDS &dds, Marshaller &m, bool ce_eval = true); + virtual bool deserialize(UnMarshaller &um, DDS *dds, bool reuse = false); + + virtual bool set_value(dods_int64 i); + virtual dods_int64 value() const; + + virtual void print_val(FILE *out, string space = "", + bool print_decl_p = true); + virtual void print_val(ostream &out, string space = "", + bool print_decl_p = true); + + virtual bool ops(BaseType *b, int op); + + virtual void dump(ostream &strm) const ; +}; + +} // namespace libdap + +#endif // _int64_h + diff -Nru libdap-3.11.1/Int8.cc libdap-3.12.0/Int8.cc --- libdap-3.11.1/Int8.cc 1970-01-01 00:00:00.000000000 +0000 +++ libdap-3.12.0/Int8.cc 2013-10-17 21:27:40.000000000 +0000 @@ -0,0 +1,252 @@ + +// -*- mode: c++; c-basic-offset:4 -*- + +// This file is part of libdap, A C++ implementation of the OPeNDAP Data +// Access Protocol. + +// Copyright (c) 2012 OPeNDAP, Inc. +// Author: James Gallagher +// +// This library is free software; you can redistribute it and/or +// modify it under the terms of the GNU Lesser General Public +// License as published by the Free Software Foundation; either +// version 2.1 of the License, or (at your option) any later version. +// +// This library 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 +// Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, write to the Free Software +// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA +// +// You can contact OPeNDAP, Inc. at PO Box 112, Saunderstown, RI. 02874-0112. + +#include "config.h" + +#include +#include + +#include "Byte.h" // synonymous with UInt8 and Char +#include "Int8.h" +#include "Int16.h" +#include "UInt16.h" +#include "Int32.h" +#include "UInt32.h" +#include "Int64.h" +#include "UInt64.h" +#include "Float32.h" +#include "Float64.h" +#include "Str.h" +#include "Url.h" + +#include "DAP4StreamMarshaller.h" +#include "DAP4StreamUnMarshaller.h" + +#include "DDS.h" +#include "util.h" +#include "parser.h" +#include "Operators.h" +#include "dods-limits.h" +#include "debug.h" +#include "InternalErr.h" + +using std::cerr; +using std::endl; + +namespace libdap { + +/** The Int8 constructor accepts the name of the variable to be created. + + @param n A string containing the name of the variable to be created. +*/ +Int8::Int8(const string &n) : BaseType(n, dods_int8_c) +{} + +/** The Int8 server-side constructor accepts the name of the variable and + the dataset name from which this instance is created. + + @param n A string containing the name of the variable to be created. + @param d A string containing the name of the dataset from which this + variable is created +*/ +Int8::Int8(const string &n, const string &d) : BaseType(n, d, dods_int8_c) +{} + +Int8::Int8(const Int8 ©_from) : BaseType(copy_from) +{ + d_buf = copy_from.d_buf; +} + +BaseType * +Int8::ptr_duplicate() +{ + return new Int8(*this); +} + +Int8 & +Int8::operator=(const Int8 &rhs) +{ + if (this == &rhs) + return *this; + + static_cast(*this) = rhs; + + d_buf = rhs.d_buf; + + return *this; +} + +unsigned int +Int8::width(bool) +{ + return sizeof(dods_int8); +} + +bool +Int8::serialize(ConstraintEvaluator &eval, DDS &dds, Marshaller &m, bool ce_eval) +{ + dds.timeout_on(); + + if (!read_p()) + read(); // read() throws Error and InternalErr + +#if EVAL + if (ce_eval && !eval.eval_selection(dds, dataset())) + return true; +#endif + + dds.timeout_off(); + + assert(typeid(m)==typeid(DAP4StreamMarshaller)); + static_cast(m).put_int8( d_buf ) ; + + return true; +} + +bool +Int8::deserialize(UnMarshaller &um, DDS *, bool) +{ + assert(typeid(um)==typeid(DAP4StreamUnMarshaller)); + static_cast(um).get_int8( d_buf ) ; + + return false; +} + +dods_int8 +Int8::value() const +{ + return d_buf; +} + +bool +Int8::set_value(dods_int8 i) +{ + d_buf = i; + set_read_p(true); + + return true; +} + +void +Int8::print_val(FILE *out, string space, bool print_decl_p) +{ + ostringstream oss; + print_val(oss, space, print_decl_p); + fwrite(oss.str().data(), sizeof(char), oss.str().length(), out); +} + +void +Int8::print_val(ostream &out, string space, bool print_decl_p) +{ + if (print_decl_p) { + print_decl(out, space, false); + out << " = " << d_buf << ";\n" ; + } + else + out << d_buf ; +} + +bool +Int8::ops(BaseType *b, int op) +{ + // Get the arg's value. + if (!read_p() && !read()) + throw InternalErr(__FILE__, __LINE__, "This value not read!"); + + // Get the second arg's value. + if (!b->read_p() && !b->read()) + throw InternalErr(__FILE__, __LINE__, "This value not read!"); + + switch (b->type()) { + case dods_int8_c: + return Cmp(op, d_buf, static_cast(b)->value()); + case dods_byte_c: + return SUCmp(op, d_buf, static_cast(b)->value()); + case dods_int16_c: + return Cmp(op, d_buf, static_cast(b)->value()); + case dods_uint16_c: + return SUCmp(op, d_buf, static_cast(b)->value()); + case dods_int32_c: + return Cmp(op, d_buf, static_cast(b)->value()); + case dods_uint32_c: + return SUCmp(op, d_buf, static_cast(b)->value()); + case dods_int64_c: + return Cmp(op, d_buf, static_cast(b)->value()); + case dods_uint64_c: + return SUCmp(op, d_buf, static_cast(b)->value()); + case dods_float32_c: + return Cmp(op, d_buf, static_cast(b)->value()); + case dods_float64_c: + return Cmp(op, d_buf, static_cast(b)->value()); + default: + return false; + } +#if 0 + switch (b->type()) { + case dods_byte_c: + return rops >(d_buf, static_cast(b)->value()); + case dods_int16_c: + return rops >(d_buf, static_cast(b)->value()); + case dods_uint16_c: + return rops >(d_buf, static_cast(b)->value()); + case dods_int32_c: + return rops >(d_buf, static_cast(b)->value()); + case dods_uint32_c: + return rops >(d_buf, static_cast(b)->value()); + case dods_int64_c: + return rops >(d_buf, static_cast(b)->value()); + case dods_uint64_c: + return rops >(d_buf, static_cast(b)->value()); + case dods_float32_c: + return rops >(d_buf, static_cast(b)->value()); + case dods_float64_c: + return rops >(d_buf, static_cast(b)->value()); + default: + return false; + } +#endif +} + +/** @brief dumps information about this object + * + * Displays the pointer value of this instance and information about this + * instance. + * + * @param strm C++ i/o stream to dump the information to + * @return void + */ +void +Int8::dump(ostream &strm) const +{ + strm << DapIndent::LMarg << "Int8::dump - (" + << (void *)this << ")" << endl ; + DapIndent::Indent() ; + BaseType::dump(strm) ; + strm << DapIndent::LMarg << "value: " << d_buf << endl ; + DapIndent::UnIndent() ; +} + +} // namespace libdap + diff -Nru libdap-3.11.1/Int8.h libdap-3.12.0/Int8.h --- libdap-3.11.1/Int8.h 1970-01-01 00:00:00.000000000 +0000 +++ libdap-3.12.0/Int8.h 2013-10-17 21:27:40.000000000 +0000 @@ -0,0 +1,83 @@ + +// -*- mode: c++; c-basic-offset:4 -*- + +// This file is part of libdap, A C++ implementation of the OPeNDAP Data +// Access Protocol. + +// Copyright (c) 2012 OPeNDAP, Inc. +// Author: James Gallagher +// +// This library is free software; you can redistribute it and/or +// modify it under the terms of the GNU Lesser General Public +// License as published by the Free Software Foundation; either +// version 2.1 of the License, or (at your option) any later version. +// +// This library 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 +// Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, write to the Free Software +// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA +// +// You can contact OPeNDAP, Inc. at PO Box 112, Saunderstown, RI. 02874-0112. + +#ifndef _int8_h +#define _int8_h 1 + +#ifndef _dods_datatypes_h +#include "dods-datatypes.h" +#endif + +#ifndef _basetype_h +#include "BaseType.h" +#endif + +namespace libdap +{ + +/** @brief Holds a 16-bit signed integer value. */ + +class Int8: public BaseType +{ + virtual unsigned int val2buf(void *, bool) { throw InternalErr(__FILE__, __LINE__, "Not implemented for Int8"); } + virtual unsigned int buf2val(void **) { throw InternalErr(__FILE__, __LINE__, "Not implemented for Int8"); } + +protected: + dods_int8 d_buf; + +public: + Int8(const string &n); + Int8(const string &n, const string &d); + virtual ~Int8() + {} + + Int8(const Int8 ©_from); + + Int8 &operator=(const Int8 &rhs); + + virtual BaseType *ptr_duplicate(); + + virtual unsigned int width(bool constrained = false); + + virtual bool serialize(ConstraintEvaluator &eval, DDS &dds, Marshaller &m, bool ce_eval = true); + virtual bool deserialize(UnMarshaller &um, DDS *dds, bool reuse = false); + + virtual dods_int8 value() const; + virtual bool set_value(dods_int8 val); + + virtual void print_val(FILE *out, string space = "", + bool print_decl_p = true); + virtual void print_val(ostream &out, string space = "", + bool print_decl_p = true); + + virtual bool ops(BaseType *b, int op); + + virtual void dump(ostream &strm) const ; +}; + +} // namespace libdap + +#endif // _int16_h + diff -Nru libdap-3.11.1/InternalErr.cc libdap-3.12.0/InternalErr.cc --- libdap-3.11.1/InternalErr.cc 2011-04-29 13:19:43.000000000 +0000 +++ libdap-3.12.0/InternalErr.cc 2013-10-17 21:27:40.000000000 +0000 @@ -19,7 +19,7 @@ // // You should have received a copy of the GNU Lesser General Public // License along with this library; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA // // You can contact OPeNDAP, Inc. at PO Box 112, Saunderstown, RI. 02874-0112. @@ -35,7 +35,7 @@ #include "config.h" static char rcsid[] not_used = - {"$Id: InternalErr.cc 21699 2009-11-05 00:06:01Z jimg $" + {"$Id: InternalErr.cc 27197 2013-10-01 21:29:54Z jimg $" }; #include diff -Nru libdap-3.11.1/InternalErr.h libdap-3.12.0/InternalErr.h --- libdap-3.11.1/InternalErr.h 2011-04-29 13:19:43.000000000 +0000 +++ libdap-3.12.0/InternalErr.h 2013-10-17 21:27:40.000000000 +0000 @@ -19,7 +19,7 @@ // // You should have received a copy of the GNU Lesser General Public // License along with this library; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA // // You can contact OPeNDAP, Inc. at PO Box 112, Saunderstown, RI. 02874-0112. diff -Nru libdap-3.11.1/Keywords2.cc libdap-3.12.0/Keywords2.cc --- libdap-3.11.1/Keywords2.cc 2011-04-29 13:19:43.000000000 +0000 +++ libdap-3.12.0/Keywords2.cc 2013-10-17 21:27:40.000000000 +0000 @@ -18,13 +18,11 @@ // // You should have received a copy of the GNU Lesser General Public // License along with this library; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA // // You can contact OPeNDAP, Inc. at PO Box 112, Saunderstown, RI. 02874-0112. #include "config.h" -static char rcsid[] not_used = { "$Id: ResponseBuilder.cc 23477 2010-09-02 21:02:59Z jimg $" }; - #include #include @@ -58,7 +56,7 @@ { } -/** Static function to parse the curly-brace keyword notation. +/** Static function to parse the keyword notation. * @param kw the keyword clause ' ( )' * @param word (result) the word * @param value (result) the value @@ -76,7 +74,7 @@ string::size_type j = kw.find(')'); if (j == string::npos) return false; - ++i; // Move past the opening brace + ++i; // Move past the opening paren value = kw.substr(i, j-i); return (!word.empty() && !value.empty()); diff -Nru libdap-3.11.1/Keywords2.h libdap-3.12.0/Keywords2.h --- libdap-3.11.1/Keywords2.h 2011-04-29 13:19:43.000000000 +0000 +++ libdap-3.12.0/Keywords2.h 2013-10-17 21:27:40.000000000 +0000 @@ -18,7 +18,7 @@ // // You should have received a copy of the GNU Lesser General Public // License along with this library; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA // // You can contact OPeNDAP, Inc. at PO Box 112, Saunderstown, RI. 02874-0112. @@ -45,6 +45,9 @@ * * @note The keywords are used to specify the DAP version(s) that the client * can understand. + * + * @note Keywords are parsed and used by the BES in Hyrax - libdap never makes + * calls to these methods. */ class Keywords { public: diff -Nru libdap-3.11.1/Makefile.am libdap-3.12.0/Makefile.am --- libdap-3.11.1/Makefile.am 2011-04-29 13:19:43.000000000 +0000 +++ libdap-3.12.0/Makefile.am 2013-10-17 21:27:40.000000000 +0000 @@ -6,49 +6,71 @@ aclocaldir=$(datadir)/aclocal pkgconfigdir=$(libdir)/pkgconfig -# Arrange to build with the backward compatibility mode enabled. -AM_CPPFLAGS = -I$(top_srcdir)/gl -I$(top_srcdir)/GNU -# -I$(top_srcdir)/xstream +AM_CPPFLAGS = -I$(top_srcdir)/gl -I$(top_srcdir)/GNU $(XML2_CFLAGS) AM_CXXFLAGS = + if COMPILER_IS_GCC AM_CXXFLAGS += -Wall -W -Wcast-align endif -AM_YFLAGS = -d -v +# if USING_GRIDFIELDS +# AM_CPPFLAGS += $(GF_CFLAGS) +# GRIDFIELDS = ugridFunctions +# endif + +AM_YFLAGS = -d -v -t AM_LFLAGS = -8 # These are not used by automake but are often useful for certain types of # debugging. The best way to use these is to run configure as: # export CXXFLAGS='...'; ./configure --disable-shared +# or ./configure --enable-developer --disable-shared # the --disable-shared is not required, but it seems to help with debuggers. -CXXFLAGS_DEBUG = -g3 -O0 -fno-defer-pop -Wall -W -Wcast-align -Werror +CXXFLAGS_DEBUG = -g3 -O0 -Wall -W -Wcast-align +# -Werror There are some warnings in this code that are here to stay... TEST_COV_FLAGS = -ftest-coverage -fprofile-arcs +if BUILD_DEVELOPER +AM_CXXFLAGS += $(CXXFLAGS_DEBUG) +endif + SUBDIRS = gl . tests unit-tests -DIST_SUBDIRS = unit-tests gl tests +DIST_SUBDIRS = gl tests unit-tests noinst_LTLIBRARIES = libparsers.la + lib_LTLIBRARIES = libdap.la libdapclient.la libdapserver.la bin_SCRIPTS = dap-config dap-config-pkgconfig bin_PROGRAMS = getdap -# fdiostream_test -# sbin_PROGRAMS = deflate +BUILT_SOURCES = $(GRAM_SRC) dods-datatypes.h xdr-datatypes.h getdap.1 dap-config.1 + +man_MANS = getdap.1 dap-config.1 -BUILT_SOURCES = $(GRAM_SRC) dods-datatypes.h xdr-datatypes.h +%.1: %.man1 + groff -t -e -mandoc -Tascii $< | col -bx > $@ libparsers_la_SOURCES = $(GRAM_SRC) +libparsers_la_CPPFLAGS = $(AM_CPPFLAGS) +libparsers_la_LIBADD = $(XML2_LIBS) + +libdap_la_SOURCES = $(DAP_SRC) $(GNU_SRC) +if DAP4_DEFINED + libdap_la_SOURCES += $(DAP4_ONLY_SRC) +endif -libdap_la_SOURCES = $(DAP_SRC) $(GNU_SRC) libdap_la_LDFLAGS = -version-info $(LIBDAP_VERSION) -libdap_la_CPPFLAGS = $(AM_CPPFLAGS) $(XML2_CFLAGS) +libdap_la_CPPFLAGS = $(AM_CPPFLAGS) libdap_la_LIBADD = $(XML2_LIBS) $(PTHREAD_LIBS) gl/libgnu.la libparsers.la +if DAP4_DEFINED + libdap_la_LIBADD += -lcrypto +endif libdapclient_la_SOURCES = $(CLIENT_SRC) libdapclient_la_LDFLAGS = -version-info $(CLIENTLIB_VERSION) -libdapclient_la_CPPFLAGS = $(AM_CPPFLAGS) $(CURL_CFLAGS) $(XML2_CFLAGS) +libdapclient_la_CPPFLAGS = $(AM_CPPFLAGS) $(CURL_CFLAGS) libdapclient_la_LIBADD = $(CURL_LIBS) libdap.la $(PTHREAD_LIBS) libdapserver_la_SOURCES = $(SERVER_SRC) @@ -56,37 +78,38 @@ libdapserver_la_LIBADD = libdap.la $(UUID_LIBS) pkginclude_HEADERS = $(DAP_HDR) $(GNU_HDR) $(CLIENT_HDR) $(SERVER_HDR) +# TODO Until the compile-time issue with headers like BaseType.h depending on +# configure params is fixed, always install these headers. +if DAP4_DEFINED + pkginclude_HEADERS += $(DAP4_ONLY_HDR) +endif noinst_HEADERS = config_dap.h -# fdiostream_test_SOURCES = GNU/fdiostream_test.cc - getdap_SOURCES = getdap.cc getdap_LDADD = libdapclient.la libdap.la getdap_CPPFLAGS = $(AM_CPPFLAGS) $(CURL_CFLAGS) -LEX_YACC_EXTRA = das.lex das.y dds.lex dds.y ce_expr.lex ce_expr.y gse.lex \ - gse.y Error.lex Error.y +LEX_YACC_EXTRA = das.lex das.yy dds.lex dds.yy ce_expr.lex ce_expr.yy \ +Error.lex Error.yy -EXTRA_DIST = ChangeLog COPYING README.dodsrc COPYRIGHT_URI \ - COPYRIGHT_W3C GNU/README doxy.conf doxy_private.conf libdap.spec \ - VCPP dods-datatypes-static.h xdr-datatypes-static.h \ - dap-config-pkgconfig $(LEX_YACC_EXTRA) $(GRAM_SRC) OSX_Resources - -# README.AIS xstream/README +EXTRA_DIST = ChangeLog COPYING README.dodsrc COPYRIGHT_URI \ + COPYRIGHT_W3C GNU/README doxy.conf doxy_private.conf \ + libdap.spec VCPP dods-datatypes-static.h \ + xdr-datatypes-static.h dap-config-pkgconfig $(LEX_YACC_EXTRA) \ + $(GRAM_SRC) OSX_Resources getdap.man1 dap-config.man1 dist_aclocal_DATA = conf/libdap.m4 pkgconfig_DATA = libdap.pc libdapclient.pc libdapserver.pc -CLEANFILES = *.log *.output *.gcda *.gcno $(GRAM_SRC) dods-datatypes.h xdr-datatypes.h +CLEANFILES = *.log *.output *.gcda *.gcno $(GRAM_SRC) dods-datatypes.h \ + xdr-datatypes.h getdap.1 dap-config.1 # Not nearly as clean as it could be, but this removes .svn directories # in subdirs. dist-hook: rm -rf `find $(distdir) -name .svn` -# MAINTAINERCLEANFILES = $(GRAM_SRC) - # Copy the generated grammar files to the 'grammarfiles' directory. .PHONY: grammarfiles grammarfiles: $(GRAM_SRC) @@ -108,16 +131,15 @@ ########################################################################### # Fortify targets. -# dods-datatypes.h xdr-datatypes.h .PHONY: fortify fortify: $(BUILT_SOURCES) - (cd gl && sourceanalyzer -b @PACKAGE@-gl $(MAKE) ) - sourceanalyzer -b @PACKAGE@-parsers $(MAKE) libparsers.la - sourceanalyzer -b @PACKAGE@ $(MAKE) libdap.la libdapserver.la libdapclient.la + (cd gl && sourceanalyzer -b @PACKAGE@-gl $(MAKE) $(MFLAGS) ) + sourceanalyzer -b @PACKAGE@-parsers $(MAKE) $(MFLAGS) libparsers.la + sourceanalyzer -b @PACKAGE@ $(MAKE) $(MFLAGS) libdap.la libdapserver.la libdapclient.la sourceanalyzer -b @PACKAGE@ -scan -f @PACKAGE@-@PACKAGE_VERSION@.fpr # run fortify on only our code, not the gnulib code or the flex/bison code. -# This does skip testing some of the functions we wrote in the *.lex/*.y +# This does skip testing some of the functions we wrote in the *.lex/*.yy # files but should eliminate the false positives from flex and bison, too. .PHONY: fortify-lite fortify-lite: dods-datatypes.h xdr-datatypes.h @@ -126,8 +148,9 @@ sourceanalyzer -b @PACKAGE@ $(MAKE) libdap.la libdapserver.la libdapclient.la sourceanalyzer -b @PACKAGE@ -scan -f @PACKAGE@-@PACKAGE_VERSION@.fpr -grammar_objects = lex.das.o das.tab.o lex.dds.o dds.tab.o lex.ce_expr.o \ -ce_expr.tab.o lex.gse_.o gse.tab.o lex.Error.o Error.tab.o +# No longer used? jhrg 1/29/13 +#grammar_objects = lex.das.o das.tab.o lex.dds.o dds.tab.o lex.ce_expr.o \ +#ce_expr.tab.o lex.gse_.o gse.tab.o lex.Error.o Error.tab.o # Use this to clean the fortify project. .PHONY: fortifyclean @@ -152,8 +175,6 @@ # are there so that the values built into dap-config will match the mac # osx install dirs and not the temp directory used to build the packages -# PACKAGEMAKER=/Developer/Applications/Utilities/PackageMaker.app/Contents/MacOS/PackageMaker* - PACKAGEMAKER=/Developer/usr/bin/packagemaker PKG_CONF_FLAGS= @@ -168,7 +189,7 @@ pkg-main: pkg-build ./OSX_Resources/update_mac_package_contents.pl README cat ./OSX_Resources/Info.plist.proto | \ - sed -e "s^_PREFIX_^$(prefix)^g" \ + sed -e "s^_PREFIX_^/usr/local/servers/hyrax-1.8.8^g" \ -e "s^_FULL_VERSION_^@PACKAGE_VERSION@^g" \ -e "s^_MAJOR_VERSION_^@PACKAGE_MAJOR_VERSION@^g" \ -e "s^_MINOR_VERSION_^@PACKAGE_MINOR_VERSION@^g" \ @@ -178,6 +199,8 @@ --title "@PACKAGE@ @PACKAGE_VERSION@" --version @PACKAGE_VERSION@ \ --out @PACKAGE@-@PACKAGE_VERSION@.pkg --resources OSX_Resources +# sed -e "s^_PREFIX_^$(prefix)^g" + pkg-dmg: pkg-main -rm -rf @PACKAGE@-@PACKAGE_VERSION@ -rm -rf @PACKAGE@-@PACKAGE_VERSION@.dmg @@ -212,8 +235,7 @@ GRAM_SRC = lex.das.cc das.tab.cc das.tab.hh lex.dds.cc dds.tab.cc \ dds.tab.hh lex.ce_expr.cc ce_expr.tab.cc ce_expr.tab.hh \ - lex.Error.cc Error.tab.cc Error.tab.hh gse.tab.hh gse.tab.cc \ - lex.gse_.cc + lex.Error.cc Error.tab.cc Error.tab.hh DAP_SRC = AttrTable.cc DAS.cc DDS.cc DataDDS.cc DDXParserSAX2.cc \ BaseType.cc Byte.cc Int32.cc Float64.cc Str.cc Url.cc \ @@ -221,12 +243,18 @@ Int16.cc UInt16.cc Float32.cc Constructor.cc \ BaseTypeFactory.cc SignalHandler.cc Error.cc InternalErr.cc \ util.cc xdrutil_ppc.c parser-util.cc escaping.cc \ - ce_functions.cc GSEClause.cc GeoConstraint.cc \ - GridGeoConstraint.cc Clause.cc RValue.cc \ - ConstraintEvaluator.cc ArrayGeoConstraint.cc DapIndent.cc \ + Clause.cc RValue.cc \ + ConstraintEvaluator.cc DapIndent.cc \ Operators.h XDRUtils.cc XDRFileMarshaller.cc \ - XDRFileUnMarshaller.cc XDRStreamMarshaller.cc \ - XDRStreamUnMarshaller.cc mime_util.cc Keywords2.cc + XDRStreamMarshaller.cc XDRFileUnMarshaller.cc \ + XDRStreamUnMarshaller.cc mime_util.cc Keywords2.cc XMLWriter.cc \ + ServerFunctionsList.cc ServerFunction.cc + +# DAPCache3.cc + +DAP4_ONLY_SRC = DAP4StreamMarshaller.cc DAP4StreamUnMarshaller.cc Int64.cc \ + UInt64.cc Int8.cc D4ParserSax2.cc D4BaseTypeFactory.cc \ + D4Maps.cc D4Dimensions.cc D4EnumDef.cc D4Group.cc Operators.h: ce_expr.tab.hh @@ -236,7 +264,8 @@ CLIENT_SRC = RCReader.cc Connect.cc HTTPConnect.cc HTTPCache.cc \ util_mit.cc ResponseTooBigErr.cc HTTPCacheTable.cc -SERVER_SRC = DODSFilter.cc Ancillary.cc ResponseBuilder.cc +SERVER_SRC = DODSFilter.cc Ancillary.cc +# ResponseBuilder.cc ResponseCache.cc DAP_HDR = AttrTable.h DAS.h DDS.h DataDDS.h DDXParserSAX2.h \ DDXExceptions.h BaseType.h Byte.h Int32.h Float64.h Str.h \ @@ -244,13 +273,19 @@ Grid.h UInt32.h Int16.h UInt16.h Float32.h BaseTypeFactory.h \ ObjectType.h EncodingType.h SignalHandler.h Error.h \ InternalErr.h util.h escaping.h parser.h debug.h dods-limits.h \ - dods-datatypes.h GeoConstraint.h GridGeoConstraint.h \ - ArrayGeoConstraint.h ce_functions.h gse_parser.h GSEClause.h \ + dods-datatypes.h \ util_mit.h expr.h Clause.h RValue.h ConstraintEvaluator.h \ ce_parser.h DapIndent.h DapObj.h XDRFileMarshaller.h \ - Marshaller.h XDRFileUnMarshaller.h UnMarshaller.h \ + Marshaller.h UnMarshaller.h XDRFileUnMarshaller.h \ XDRStreamMarshaller.h XDRUtils.h xdr-datatypes.h mime_util.h \ - cgi_util.h XDRStreamUnMarshaller.h Keywords2.h + cgi_util.h XDRStreamUnMarshaller.h Keywords2.h XMLWriter.h \ + ServerFunctionsList.h ServerFunction.h + +# DAPCache.h + +DAP4_ONLY_HDR = DAP4StreamMarshaller.h DAP4StreamUnMarshaller.h Int64.h \ + UInt64.h Int8.h D4ParserSax2.h D4BaseTypeFactory.h D4ParseError.h \ + D4Maps.h D4Dimensions.h D4EnumDef.h D4Group.h if USE_C99_TYPES dods-datatypes.h: dods-datatypes-static.h @@ -266,10 +301,10 @@ HTTPCacheDisconnectedMode.h HTTPCacheInterruptHandler.h \ Response.h HTTPResponse.h HTTPCacheResponse.h PipeResponse.h \ StdinResponse.h SignalHandlerRegisteredErr.h \ - ResponseTooBigErr.h Resource.h HTTPCacheTable.h + ResponseTooBigErr.h Resource.h HTTPCacheTable.h HTTPCacheMacros.h -SERVER_HDR = DODSFilter.h AlarmHandler.h EventHandler.h Ancillary.h \ - ResponseBuilder.h +SERVER_HDR = DODSFilter.h AlarmHandler.h EventHandler.h Ancillary.h +# ResponseBuilder.h ResponseCache.h ############################################################################ # Special rules for the grammars. I tried to use the automake grammar support @@ -281,46 +316,31 @@ # Build the DAS scanner and parser lex.das.cc: das.lex das.tab.cc das.tab.hh - $(LEX) $(LFLAGS) $(AM_LFLAGS) $< + $(LEX) $(LFLAGS) $< -# The funny if statment accommodates older versions of bison that treats -# -o differently than the 2.x versions. jhrg 3/2/08 -das.tab.cc das.tab.hh: das.y DAS.h - $(YACC) $(YFLAGS) $(AM_YFLAGS) -p das -o das.tab.cc $< - if test -e das.tab.cc.h; then mv das.tab.cc.h das.tab.hh; fi +das.tab.cc das.tab.hh: das.yy DAS.h + $(YACC) $(YFLAGS) $< # DDS lex.dds.cc: dds.lex dds.tab.cc dds.tab.hh - $(LEX) $(LFLAGS) $(AM_LFLAGS) $< + $(LEX) $(LFLAGS) $< -dds.tab.cc dds.tab.hh: dds.y - $(YACC) $(YFLAGS) $(AM_YFLAGS) -p dds -o dds.tab.cc $< - if test -e dds.tab.cc.h; then mv dds.tab.cc.h dds.tab.hh; fi +dds.tab.cc dds.tab.hh: dds.yy + $(YACC) $(YFLAGS) $< # CE lex.ce_expr.cc: ce_expr.lex ce_expr.tab.cc ce_expr.tab.hh - $(LEX) $(LFLAGS) $(AM_LFLAGS) $< - -ce_expr.tab.cc ce_expr.tab.hh: ce_expr.y - $(YACC) $(YFLAGS) $(AM_YFLAGS) -p ce_expr -o ce_expr.tab.cc $< - if test -e ce_expr.tab.cc.h; then mv ce_expr.tab.cc.h ce_expr.tab.hh; fi - -# Build the grid selection sub_expression scanner and parser - -lex.gse_.cc: gse.lex gse.tab.cc gse.tab.hh - $(LEX) $(LFLAGS) $(AM_LFLAGS) $< + $(LEX) $(LFLAGS) $< -gse.tab.cc gse.tab.hh: gse.y - $(YACC) $(YFLAGS) $(AM_YFLAGS) -p gse_ -o gse.tab.cc $< - if test -e gse.tab.cc.h; then mv gse.tab.cc.h gse.tab.hh; fi +ce_expr.tab.cc ce_expr.tab.hh: ce_expr.yy + $(YACC) $(YFLAGS) $< # Errors lex.Error.cc: Error.lex Error.tab.cc Error.tab.hh - $(LEX) $(LFLAGS) $(AM_LFLAGS) $< + $(LEX) $(LFLAGS) $< -Error.tab.cc Error.tab.hh: Error.y - $(YACC) $(YFLAGS) $(AM_YFLAGS) -p Error -o Error.tab.cc $< - if test -e Error.tab.cc.h; then mv Error.tab.cc.h Error.tab.hh; fi +Error.tab.cc Error.tab.hh: Error.yy + $(YACC) $(YFLAGS) $< diff -Nru libdap-3.11.1/Makefile.in libdap-3.12.0/Makefile.in --- libdap-3.11.1/Makefile.in 2011-05-06 17:36:29.000000000 +0000 +++ libdap-3.12.0/Makefile.in 2013-10-17 21:27:40.000000000 +0000 @@ -1,9 +1,9 @@ -# Makefile.in generated by automake 1.11 from Makefile.am. +# Makefile.in generated by automake 1.12 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, -# 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, -# Inc. +# 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software +# Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. @@ -22,6 +22,23 @@ VPATH = @srcdir@ +am__make_dryrun = \ + { \ + am__dry=no; \ + case $$MAKEFLAGS in \ + *\\[\ \ ]*) \ + echo 'am--echo: ; @echo "AM" OK' | $(MAKE) -f - 2>/dev/null \ + | grep '^AM OK$$' >/dev/null || am__dry=yes;; \ + *) \ + for am__flg in $$MAKEFLAGS; do \ + case $$am__flg in \ + *=*|--*) ;; \ + *n*) am__dry=yes; break;; \ + esac; \ + done;; \ + esac; \ + test $$am__dry = yes; \ + } pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ @@ -40,22 +57,32 @@ build_triplet = @build@ host_triplet = @host@ @COMPILER_IS_GCC_TRUE@am__append_1 = -Wall -W -Wcast-align +@BUILD_DEVELOPER_TRUE@am__append_2 = $(CXXFLAGS_DEBUG) bin_PROGRAMS = getdap$(EXEEXT) +@DAP4_DEFINED_TRUE@am__append_3 = $(DAP4_ONLY_SRC) +@DAP4_DEFINED_TRUE@am__append_4 = -lcrypto +# TODO Until the compile-time issue with headers like BaseType.h depending on +# configure params is fixed, always install these headers. +@DAP4_DEFINED_TRUE@am__append_5 = $(DAP4_ONLY_HDR) subdir = . -DIST_COMMON = README $(am__configure_deps) $(dist_aclocal_DATA) \ - $(noinst_HEADERS) $(pkginclude_HEADERS) $(srcdir)/Makefile.am \ - $(srcdir)/Makefile.in $(srcdir)/config.h.in \ - $(srcdir)/dap-config.in $(srcdir)/dods-datatypes-config.h.in \ +DIST_COMMON = README $(am__configure_deps) \ + $(am__pkginclude_HEADERS_DIST) $(dist_aclocal_DATA) \ + $(noinst_HEADERS) $(srcdir)/Makefile.am $(srcdir)/Makefile.in \ + $(srcdir)/config.h.in $(srcdir)/dap-config.in \ + $(srcdir)/dods-datatypes-config.h.in $(srcdir)/doxy.conf.in \ $(srcdir)/libdap.pc.in $(srcdir)/libdapclient.pc.in \ - $(srcdir)/libdapserver.pc.in \ - $(srcdir)/xdr-datatypes-config.h.in $(top_srcdir)/configure \ - COPYING ChangeLog INSTALL NEWS conf/config.guess \ - conf/config.sub conf/depcomp conf/install-sh conf/ltmain.sh \ - conf/missing + $(srcdir)/libdapserver.pc.in $(srcdir)/main_page.doxygen.in \ + $(srcdir)/xdr-datatypes-config.h.in \ + $(top_srcdir)/conf/config.guess $(top_srcdir)/conf/config.sub \ + $(top_srcdir)/conf/depcomp $(top_srcdir)/conf/install-sh \ + $(top_srcdir)/conf/ltmain.sh $(top_srcdir)/conf/missing \ + $(top_srcdir)/configure COPYING ChangeLog INSTALL NEWS \ + conf/config.guess conf/config.sub conf/depcomp conf/install-sh \ + conf/ltmain.sh conf/missing ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/gl/m4/00gnulib.m4 \ $(top_srcdir)/gl/m4/alloca.m4 $(top_srcdir)/gl/m4/btowc.m4 \ - $(top_srcdir)/gl/m4/codeset.m4 \ + $(top_srcdir)/gl/m4/byteswap.m4 $(top_srcdir)/gl/m4/codeset.m4 \ $(top_srcdir)/gl/m4/configmake.m4 \ $(top_srcdir)/gl/m4/extensions.m4 \ $(top_srcdir)/gl/m4/fcntl-o.m4 $(top_srcdir)/gl/m4/glibc21.m4 \ @@ -68,22 +95,27 @@ $(top_srcdir)/gl/m4/locale-fr.m4 \ $(top_srcdir)/gl/m4/locale-ja.m4 \ $(top_srcdir)/gl/m4/locale-zh.m4 \ + $(top_srcdir)/gl/m4/locale_h.m4 \ + $(top_srcdir)/gl/m4/localeconv.m4 \ $(top_srcdir)/gl/m4/longlong.m4 $(top_srcdir)/gl/m4/malloc.m4 \ $(top_srcdir)/gl/m4/mbrtowc.m4 $(top_srcdir)/gl/m4/mbsinit.m4 \ - $(top_srcdir)/gl/m4/mbstate_t.m4 \ + $(top_srcdir)/gl/m4/mbstate_t.m4 $(top_srcdir)/gl/m4/mbtowc.m4 \ $(top_srcdir)/gl/m4/multiarch.m4 \ $(top_srcdir)/gl/m4/nl_langinfo.m4 \ - $(top_srcdir)/gl/m4/regex.m4 $(top_srcdir)/gl/m4/ssize_t.m4 \ - $(top_srcdir)/gl/m4/stdbool.m4 $(top_srcdir)/gl/m4/stddef_h.m4 \ - $(top_srcdir)/gl/m4/stdint.m4 $(top_srcdir)/gl/m4/stdlib_h.m4 \ + $(top_srcdir)/gl/m4/off_t.m4 $(top_srcdir)/gl/m4/regex.m4 \ + $(top_srcdir)/gl/m4/ssize_t.m4 $(top_srcdir)/gl/m4/stdbool.m4 \ + $(top_srcdir)/gl/m4/stddef_h.m4 $(top_srcdir)/gl/m4/stdint.m4 \ + $(top_srcdir)/gl/m4/stdlib_h.m4 $(top_srcdir)/gl/m4/strcase.m4 \ + $(top_srcdir)/gl/m4/strings_h.m4 \ + $(top_srcdir)/gl/m4/sys_types_h.m4 \ $(top_srcdir)/gl/m4/unistd_h.m4 \ $(top_srcdir)/gl/m4/warn-on-use.m4 \ $(top_srcdir)/gl/m4/wchar_h.m4 $(top_srcdir)/gl/m4/wchar_t.m4 \ $(top_srcdir)/gl/m4/wcrtomb.m4 $(top_srcdir)/gl/m4/wctype_h.m4 \ $(top_srcdir)/gl/m4/wint_t.m4 $(top_srcdir)/conf/acinclude.m4 \ - $(top_srcdir)/conf/check_zlib.m4 $(top_srcdir)/conf/cppunit.m4 \ - $(top_srcdir)/conf/libtool.m4 $(top_srcdir)/conf/ltoptions.m4 \ - $(top_srcdir)/conf/ltsugar.m4 $(top_srcdir)/conf/ltversion.m4 \ + $(top_srcdir)/conf/cppunit.m4 $(top_srcdir)/conf/libtool.m4 \ + $(top_srcdir)/conf/ltoptions.m4 $(top_srcdir)/conf/ltsugar.m4 \ + $(top_srcdir)/conf/ltversion.m4 \ $(top_srcdir)/conf/lt~obsolete.m4 $(top_srcdir)/conf/pkg.m4 \ $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ @@ -94,7 +126,7 @@ CONFIG_HEADER = config.h dods-datatypes-config.h \ xdr-datatypes-config.h CONFIG_CLEAN_FILES = libdap.pc libdapclient.pc libdapserver.pc \ - dap-config + main_page.doxygen doxy.conf dap-config CONFIG_CLEAN_VPATH_FILES = am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; am__vpath_adj = case $$p in \ @@ -117,13 +149,34 @@ am__base_list = \ sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' +am__uninstall_files_from_dir = { \ + test -z "$$files" \ + || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ + || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ + $(am__cd) "$$dir" && rm -f $$files; }; \ + } am__installdirs = "$(DESTDIR)$(libdir)" "$(DESTDIR)$(bindir)" \ - "$(DESTDIR)$(bindir)" "$(DESTDIR)$(aclocaldir)" \ - "$(DESTDIR)$(pkgconfigdir)" "$(DESTDIR)$(pkgincludedir)" + "$(DESTDIR)$(bindir)" "$(DESTDIR)$(man1dir)" \ + "$(DESTDIR)$(aclocaldir)" "$(DESTDIR)$(pkgconfigdir)" \ + "$(DESTDIR)$(pkgincludedir)" LTLIBRARIES = $(lib_LTLIBRARIES) $(noinst_LTLIBRARIES) am__DEPENDENCIES_1 = libdap_la_DEPENDENCIES = $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ - gl/libgnu.la libparsers.la + gl/libgnu.la libparsers.la $(am__DEPENDENCIES_1) +am__libdap_la_SOURCES_DIST = AttrTable.cc DAS.cc DDS.cc DataDDS.cc \ + DDXParserSAX2.cc BaseType.cc Byte.cc Int32.cc Float64.cc \ + Str.cc Url.cc Vector.cc Array.cc Structure.cc Sequence.cc \ + Grid.cc UInt32.cc Int16.cc UInt16.cc Float32.cc Constructor.cc \ + BaseTypeFactory.cc SignalHandler.cc Error.cc InternalErr.cc \ + util.cc xdrutil_ppc.c parser-util.cc escaping.cc Clause.cc \ + RValue.cc ConstraintEvaluator.cc DapIndent.cc Operators.h \ + XDRUtils.cc XDRFileMarshaller.cc XDRStreamMarshaller.cc \ + XDRFileUnMarshaller.cc XDRStreamUnMarshaller.cc mime_util.cc \ + Keywords2.cc XMLWriter.cc ServerFunctionsList.cc \ + ServerFunction.cc GNU/GetOpt.cc GNU/GNURegex.cc \ + DAP4StreamMarshaller.cc DAP4StreamUnMarshaller.cc Int64.cc \ + UInt64.cc Int8.cc D4ParserSax2.cc D4BaseTypeFactory.cc \ + D4Maps.cc D4Dimensions.cc D4EnumDef.cc D4Group.cc am__objects_1 = libdap_la-AttrTable.lo libdap_la-DAS.lo \ libdap_la-DDS.lo libdap_la-DataDDS.lo \ libdap_la-DDXParserSAX2.lo libdap_la-BaseType.lo \ @@ -136,46 +189,53 @@ libdap_la-SignalHandler.lo libdap_la-Error.lo \ libdap_la-InternalErr.lo libdap_la-util.lo \ libdap_la-xdrutil_ppc.lo libdap_la-parser-util.lo \ - libdap_la-escaping.lo libdap_la-ce_functions.lo \ - libdap_la-GSEClause.lo libdap_la-GeoConstraint.lo \ - libdap_la-GridGeoConstraint.lo libdap_la-Clause.lo \ - libdap_la-RValue.lo libdap_la-ConstraintEvaluator.lo \ - libdap_la-ArrayGeoConstraint.lo libdap_la-DapIndent.lo \ + libdap_la-escaping.lo libdap_la-Clause.lo libdap_la-RValue.lo \ + libdap_la-ConstraintEvaluator.lo libdap_la-DapIndent.lo \ libdap_la-XDRUtils.lo libdap_la-XDRFileMarshaller.lo \ - libdap_la-XDRFileUnMarshaller.lo \ libdap_la-XDRStreamMarshaller.lo \ + libdap_la-XDRFileUnMarshaller.lo \ libdap_la-XDRStreamUnMarshaller.lo libdap_la-mime_util.lo \ - libdap_la-Keywords2.lo + libdap_la-Keywords2.lo libdap_la-XMLWriter.lo \ + libdap_la-ServerFunctionsList.lo libdap_la-ServerFunction.lo am__objects_2 = libdap_la-GetOpt.lo libdap_la-GNURegex.lo -am_libdap_la_OBJECTS = $(am__objects_1) $(am__objects_2) +am__objects_3 = libdap_la-DAP4StreamMarshaller.lo \ + libdap_la-DAP4StreamUnMarshaller.lo libdap_la-Int64.lo \ + libdap_la-UInt64.lo libdap_la-Int8.lo \ + libdap_la-D4ParserSax2.lo libdap_la-D4BaseTypeFactory.lo \ + libdap_la-D4Maps.lo libdap_la-D4Dimensions.lo \ + libdap_la-D4EnumDef.lo libdap_la-D4Group.lo +@DAP4_DEFINED_TRUE@am__objects_4 = $(am__objects_3) +am_libdap_la_OBJECTS = $(am__objects_1) $(am__objects_2) \ + $(am__objects_4) libdap_la_OBJECTS = $(am_libdap_la_OBJECTS) libdap_la_LINK = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CXXLD) $(AM_CXXFLAGS) \ $(CXXFLAGS) $(libdap_la_LDFLAGS) $(LDFLAGS) -o $@ libdapclient_la_DEPENDENCIES = $(am__DEPENDENCIES_1) libdap.la \ $(am__DEPENDENCIES_1) -am__objects_3 = libdapclient_la-RCReader.lo libdapclient_la-Connect.lo \ +am__objects_5 = libdapclient_la-RCReader.lo libdapclient_la-Connect.lo \ libdapclient_la-HTTPConnect.lo libdapclient_la-HTTPCache.lo \ libdapclient_la-util_mit.lo \ libdapclient_la-ResponseTooBigErr.lo \ libdapclient_la-HTTPCacheTable.lo -am_libdapclient_la_OBJECTS = $(am__objects_3) +am_libdapclient_la_OBJECTS = $(am__objects_5) libdapclient_la_OBJECTS = $(am_libdapclient_la_OBJECTS) libdapclient_la_LINK = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CXXLD) $(AM_CXXFLAGS) \ $(CXXFLAGS) $(libdapclient_la_LDFLAGS) $(LDFLAGS) -o $@ libdapserver_la_DEPENDENCIES = libdap.la $(am__DEPENDENCIES_1) -am__objects_4 = DODSFilter.lo Ancillary.lo ResponseBuilder.lo -am_libdapserver_la_OBJECTS = $(am__objects_4) +am__objects_6 = DODSFilter.lo Ancillary.lo +am_libdapserver_la_OBJECTS = $(am__objects_6) libdapserver_la_OBJECTS = $(am_libdapserver_la_OBJECTS) libdapserver_la_LINK = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CXXLD) $(AM_CXXFLAGS) \ $(CXXFLAGS) $(libdapserver_la_LDFLAGS) $(LDFLAGS) -o $@ -libparsers_la_LIBADD = -am__objects_5 = lex.das.lo das.tab.lo lex.dds.lo dds.tab.lo \ - lex.ce_expr.lo ce_expr.tab.lo lex.Error.lo Error.tab.lo \ - gse.tab.lo lex.gse_.lo -am_libparsers_la_OBJECTS = $(am__objects_5) +libparsers_la_DEPENDENCIES = $(am__DEPENDENCIES_1) +am__objects_7 = libparsers_la-lex.das.lo libparsers_la-das.tab.lo \ + libparsers_la-lex.dds.lo libparsers_la-dds.tab.lo \ + libparsers_la-lex.ce_expr.lo libparsers_la-ce_expr.tab.lo \ + libparsers_la-lex.Error.lo libparsers_la-Error.tab.lo +am_libparsers_la_OBJECTS = $(am__objects_7) libparsers_la_OBJECTS = $(am_libparsers_la_OBJECTS) PROGRAMS = $(bin_PROGRAMS) am_getdap_OBJECTS = getdap-getdap.$(OBJEXT) @@ -207,9 +267,9 @@ SOURCES = $(libdap_la_SOURCES) $(libdapclient_la_SOURCES) \ $(libdapserver_la_SOURCES) $(libparsers_la_SOURCES) \ $(getdap_SOURCES) -DIST_SOURCES = $(libdap_la_SOURCES) $(libdapclient_la_SOURCES) \ - $(libdapserver_la_SOURCES) $(libparsers_la_SOURCES) \ - $(getdap_SOURCES) +DIST_SOURCES = $(am__libdap_la_SOURCES_DIST) \ + $(libdapclient_la_SOURCES) $(libdapserver_la_SOURCES) \ + $(libparsers_la_SOURCES) $(getdap_SOURCES) RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \ html-recursive info-recursive install-data-recursive \ install-dvi-recursive install-exec-recursive \ @@ -217,22 +277,56 @@ install-pdf-recursive install-ps-recursive install-recursive \ installcheck-recursive installdirs-recursive pdf-recursive \ ps-recursive uninstall-recursive +am__can_run_installinfo = \ + case $$AM_UPDATE_INFO_DIR in \ + n|no|NO) false;; \ + *) (install-info --version) >/dev/null 2>&1;; \ + esac +man1dir = $(mandir)/man1 +NROFF = nroff +MANS = $(man_MANS) DATA = $(dist_aclocal_DATA) $(pkgconfig_DATA) +am__pkginclude_HEADERS_DIST = AttrTable.h DAS.h DDS.h DataDDS.h \ + DDXParserSAX2.h DDXExceptions.h BaseType.h Byte.h Int32.h \ + Float64.h Str.h Url.h Vector.h Array.h Constructor.h \ + Structure.h Sequence.h Grid.h UInt32.h Int16.h UInt16.h \ + Float32.h BaseTypeFactory.h ObjectType.h EncodingType.h \ + SignalHandler.h Error.h InternalErr.h util.h escaping.h \ + parser.h debug.h dods-limits.h dods-datatypes.h util_mit.h \ + expr.h Clause.h RValue.h ConstraintEvaluator.h ce_parser.h \ + DapIndent.h DapObj.h XDRFileMarshaller.h Marshaller.h \ + UnMarshaller.h XDRFileUnMarshaller.h XDRStreamMarshaller.h \ + XDRUtils.h xdr-datatypes.h mime_util.h cgi_util.h \ + XDRStreamUnMarshaller.h Keywords2.h XMLWriter.h \ + ServerFunctionsList.h ServerFunction.h GNU/GetOpt.h \ + GNU/GNURegex.h RCReader.h Connect.h HTTPConnect.h HTTPCache.h \ + HTTPCacheDisconnectedMode.h HTTPCacheInterruptHandler.h \ + Response.h HTTPResponse.h HTTPCacheResponse.h PipeResponse.h \ + StdinResponse.h SignalHandlerRegisteredErr.h \ + ResponseTooBigErr.h Resource.h HTTPCacheTable.h \ + HTTPCacheMacros.h DODSFilter.h AlarmHandler.h EventHandler.h \ + Ancillary.h DAP4StreamMarshaller.h DAP4StreamUnMarshaller.h \ + Int64.h UInt64.h Int8.h D4ParserSax2.h D4BaseTypeFactory.h \ + D4ParseError.h D4Maps.h D4Dimensions.h D4EnumDef.h D4Group.h HEADERS = $(noinst_HEADERS) $(pkginclude_HEADERS) RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \ distclean-recursive maintainer-clean-recursive AM_RECURSIVE_TARGETS = $(RECURSIVE_TARGETS:-recursive=) \ $(RECURSIVE_CLEAN_TARGETS:-recursive=) tags TAGS ctags CTAGS \ - distdir dist dist-all distcheck + cscope distdir dist dist-all distcheck ETAGS = etags CTAGS = ctags +CSCOPE = cscope DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) distdir = $(PACKAGE)-$(VERSION) top_distdir = $(distdir) am__remove_distdir = \ - { test ! -d "$(distdir)" \ - || { find "$(distdir)" -type d ! -perm -200 -exec chmod u+w {} ';' \ - && rm -fr "$(distdir)"; }; } + if test -d "$(distdir)"; then \ + find "$(distdir)" -type d ! -perm -200 -exec chmod u+w {} ';' \ + && rm -rf "$(distdir)" \ + || { sleep 5 && rm -rf "$(distdir)"; }; \ + else :; fi +am__post_remove_distdir = $(am__remove_distdir) am__relativize = \ dir0=`pwd`; \ sed_first='s,^\([^/]*\)/.*$$,\1,'; \ @@ -260,7 +354,10 @@ reldir="$$dir2" DIST_ARCHIVES = $(distdir).tar.gz GZIP_ENV = --best +DIST_TARGETS = dist-gzip distuninstallcheck_listfiles = find . -type f -print +am__distuninstallcheck_listfiles = $(distuninstallcheck_listfiles) \ + | sed 's|^\./|$(prefix)/|' | grep -v '$(infodir)/dir$$' distcleancheck_listfiles = find . -type f -print pkglibexecdir = @pkglibexecdir@ ACLOCAL = @ACLOCAL@ @@ -269,6 +366,7 @@ AMTAR = @AMTAR@ APPLE_UNIVERSAL_BUILD = @APPLE_UNIVERSAL_BUILD@ AR = @AR@ +ARFLAGS = @ARFLAGS@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ @@ -278,6 +376,7 @@ BITSIZEOF_SIZE_T = @BITSIZEOF_SIZE_T@ BITSIZEOF_WCHAR_T = @BITSIZEOF_WCHAR_T@ BITSIZEOF_WINT_T = @BITSIZEOF_WINT_T@ +BYTESWAP_H = @BYTESWAP_H@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ @@ -304,6 +403,7 @@ DAP_PROTOCOL_VERSION = @DAP_PROTOCOL_VERSION@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ +DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ DVR = @DVR@ @@ -319,15 +419,20 @@ GNULIB_BTOWC = @GNULIB_BTOWC@ GNULIB_CALLOC_POSIX = @GNULIB_CALLOC_POSIX@ GNULIB_CANONICALIZE_FILE_NAME = @GNULIB_CANONICALIZE_FILE_NAME@ +GNULIB_CHDIR = @GNULIB_CHDIR@ GNULIB_CHOWN = @GNULIB_CHOWN@ GNULIB_CLOSE = @GNULIB_CLOSE@ +GNULIB_DUP = @GNULIB_DUP@ GNULIB_DUP2 = @GNULIB_DUP2@ GNULIB_DUP3 = @GNULIB_DUP3@ +GNULIB_DUPLOCALE = @GNULIB_DUPLOCALE@ GNULIB_ENVIRON = @GNULIB_ENVIRON@ GNULIB_EUIDACCESS = @GNULIB_EUIDACCESS@ GNULIB_FACCESSAT = @GNULIB_FACCESSAT@ GNULIB_FCHDIR = @GNULIB_FCHDIR@ GNULIB_FCHOWNAT = @GNULIB_FCHOWNAT@ +GNULIB_FDATASYNC = @GNULIB_FDATASYNC@ +GNULIB_FFS = @GNULIB_FFS@ GNULIB_FSYNC = @GNULIB_FSYNC@ GNULIB_FTRUNCATE = @GNULIB_FTRUNCATE@ GNULIB_GETCWD = @GNULIB_GETCWD@ @@ -342,9 +447,14 @@ GNULIB_GETSUBOPT = @GNULIB_GETSUBOPT@ GNULIB_GETUSERSHELL = @GNULIB_GETUSERSHELL@ GNULIB_GRANTPT = @GNULIB_GRANTPT@ +GNULIB_GROUP_MEMBER = @GNULIB_GROUP_MEMBER@ +GNULIB_ISATTY = @GNULIB_ISATTY@ +GNULIB_ISWBLANK = @GNULIB_ISWBLANK@ +GNULIB_ISWCTYPE = @GNULIB_ISWCTYPE@ GNULIB_LCHOWN = @GNULIB_LCHOWN@ GNULIB_LINK = @GNULIB_LINK@ GNULIB_LINKAT = @GNULIB_LINKAT@ +GNULIB_LOCALECONV = @GNULIB_LOCALECONV@ GNULIB_LSEEK = @GNULIB_LSEEK@ GNULIB_MALLOC_POSIX = @GNULIB_MALLOC_POSIX@ GNULIB_MBRLEN = @GNULIB_MBRLEN@ @@ -352,6 +462,7 @@ GNULIB_MBSINIT = @GNULIB_MBSINIT@ GNULIB_MBSNRTOWCS = @GNULIB_MBSNRTOWCS@ GNULIB_MBSRTOWCS = @GNULIB_MBSRTOWCS@ +GNULIB_MBTOWC = @GNULIB_MBTOWC@ GNULIB_MKDTEMP = @GNULIB_MKDTEMP@ GNULIB_MKOSTEMP = @GNULIB_MKOSTEMP@ GNULIB_MKOSTEMPS = @GNULIB_MKOSTEMPS@ @@ -360,11 +471,15 @@ GNULIB_NL_LANGINFO = @GNULIB_NL_LANGINFO@ GNULIB_PIPE = @GNULIB_PIPE@ GNULIB_PIPE2 = @GNULIB_PIPE2@ +GNULIB_POSIX_OPENPT = @GNULIB_POSIX_OPENPT@ GNULIB_PREAD = @GNULIB_PREAD@ GNULIB_PTSNAME = @GNULIB_PTSNAME@ +GNULIB_PTSNAME_R = @GNULIB_PTSNAME_R@ GNULIB_PUTENV = @GNULIB_PUTENV@ GNULIB_PWRITE = @GNULIB_PWRITE@ +GNULIB_RANDOM = @GNULIB_RANDOM@ GNULIB_RANDOM_R = @GNULIB_RANDOM_R@ +GNULIB_READ = @GNULIB_READ@ GNULIB_READLINK = @GNULIB_READLINK@ GNULIB_READLINKAT = @GNULIB_READLINKAT@ GNULIB_REALLOC_POSIX = @GNULIB_REALLOC_POSIX@ @@ -372,6 +487,8 @@ GNULIB_RMDIR = @GNULIB_RMDIR@ GNULIB_RPMATCH = @GNULIB_RPMATCH@ GNULIB_SETENV = @GNULIB_SETENV@ +GNULIB_SETHOSTNAME = @GNULIB_SETHOSTNAME@ +GNULIB_SETLOCALE = @GNULIB_SETLOCALE@ GNULIB_SLEEP = @GNULIB_SLEEP@ GNULIB_STRTOD = @GNULIB_STRTOD@ GNULIB_STRTOLL = @GNULIB_STRTOLL@ @@ -379,19 +496,51 @@ GNULIB_SYMLINK = @GNULIB_SYMLINK@ GNULIB_SYMLINKAT = @GNULIB_SYMLINKAT@ GNULIB_SYSTEM_POSIX = @GNULIB_SYSTEM_POSIX@ +GNULIB_TOWCTRANS = @GNULIB_TOWCTRANS@ GNULIB_TTYNAME_R = @GNULIB_TTYNAME_R@ -GNULIB_UNISTD_H_GETOPT = @GNULIB_UNISTD_H_GETOPT@ +GNULIB_UNISTD_H_NONBLOCKING = @GNULIB_UNISTD_H_NONBLOCKING@ GNULIB_UNISTD_H_SIGPIPE = @GNULIB_UNISTD_H_SIGPIPE@ GNULIB_UNLINK = @GNULIB_UNLINK@ GNULIB_UNLINKAT = @GNULIB_UNLINKAT@ GNULIB_UNLOCKPT = @GNULIB_UNLOCKPT@ GNULIB_UNSETENV = @GNULIB_UNSETENV@ GNULIB_USLEEP = @GNULIB_USLEEP@ +GNULIB_WCPCPY = @GNULIB_WCPCPY@ +GNULIB_WCPNCPY = @GNULIB_WCPNCPY@ GNULIB_WCRTOMB = @GNULIB_WCRTOMB@ +GNULIB_WCSCASECMP = @GNULIB_WCSCASECMP@ +GNULIB_WCSCAT = @GNULIB_WCSCAT@ +GNULIB_WCSCHR = @GNULIB_WCSCHR@ +GNULIB_WCSCMP = @GNULIB_WCSCMP@ +GNULIB_WCSCOLL = @GNULIB_WCSCOLL@ +GNULIB_WCSCPY = @GNULIB_WCSCPY@ +GNULIB_WCSCSPN = @GNULIB_WCSCSPN@ +GNULIB_WCSDUP = @GNULIB_WCSDUP@ +GNULIB_WCSLEN = @GNULIB_WCSLEN@ +GNULIB_WCSNCASECMP = @GNULIB_WCSNCASECMP@ +GNULIB_WCSNCAT = @GNULIB_WCSNCAT@ +GNULIB_WCSNCMP = @GNULIB_WCSNCMP@ +GNULIB_WCSNCPY = @GNULIB_WCSNCPY@ +GNULIB_WCSNLEN = @GNULIB_WCSNLEN@ GNULIB_WCSNRTOMBS = @GNULIB_WCSNRTOMBS@ +GNULIB_WCSPBRK = @GNULIB_WCSPBRK@ +GNULIB_WCSRCHR = @GNULIB_WCSRCHR@ GNULIB_WCSRTOMBS = @GNULIB_WCSRTOMBS@ +GNULIB_WCSSPN = @GNULIB_WCSSPN@ +GNULIB_WCSSTR = @GNULIB_WCSSTR@ +GNULIB_WCSTOK = @GNULIB_WCSTOK@ +GNULIB_WCSWIDTH = @GNULIB_WCSWIDTH@ +GNULIB_WCSXFRM = @GNULIB_WCSXFRM@ GNULIB_WCTOB = @GNULIB_WCTOB@ +GNULIB_WCTOMB = @GNULIB_WCTOMB@ +GNULIB_WCTRANS = @GNULIB_WCTRANS@ +GNULIB_WCTYPE = @GNULIB_WCTYPE@ GNULIB_WCWIDTH = @GNULIB_WCWIDTH@ +GNULIB_WMEMCHR = @GNULIB_WMEMCHR@ +GNULIB_WMEMCMP = @GNULIB_WMEMCMP@ +GNULIB_WMEMCPY = @GNULIB_WMEMCPY@ +GNULIB_WMEMMOVE = @GNULIB_WMEMMOVE@ +GNULIB_WMEMSET = @GNULIB_WMEMSET@ GNULIB_WRITE = @GNULIB_WRITE@ GNULIB__EXIT = @GNULIB__EXIT@ GREP = @GREP@ @@ -401,23 +550,29 @@ HAVE_CHOWN = @HAVE_CHOWN@ HAVE_DECL_ENVIRON = @HAVE_DECL_ENVIRON@ HAVE_DECL_FCHDIR = @HAVE_DECL_FCHDIR@ +HAVE_DECL_FDATASYNC = @HAVE_DECL_FDATASYNC@ HAVE_DECL_GETDOMAINNAME = @HAVE_DECL_GETDOMAINNAME@ HAVE_DECL_GETLOADAVG = @HAVE_DECL_GETLOADAVG@ HAVE_DECL_GETLOGIN_R = @HAVE_DECL_GETLOGIN_R@ HAVE_DECL_GETPAGESIZE = @HAVE_DECL_GETPAGESIZE@ HAVE_DECL_GETUSERSHELL = @HAVE_DECL_GETUSERSHELL@ HAVE_DECL_SETENV = @HAVE_DECL_SETENV@ +HAVE_DECL_SETHOSTNAME = @HAVE_DECL_SETHOSTNAME@ +HAVE_DECL_STRNCASECMP = @HAVE_DECL_STRNCASECMP@ HAVE_DECL_TTYNAME_R = @HAVE_DECL_TTYNAME_R@ HAVE_DECL_UNSETENV = @HAVE_DECL_UNSETENV@ HAVE_DECL_WCTOB = @HAVE_DECL_WCTOB@ HAVE_DECL_WCWIDTH = @HAVE_DECL_WCWIDTH@ HAVE_DUP2 = @HAVE_DUP2@ HAVE_DUP3 = @HAVE_DUP3@ +HAVE_DUPLOCALE = @HAVE_DUPLOCALE@ HAVE_EUIDACCESS = @HAVE_EUIDACCESS@ HAVE_FACCESSAT = @HAVE_FACCESSAT@ HAVE_FCHDIR = @HAVE_FCHDIR@ HAVE_FCHOWNAT = @HAVE_FCHOWNAT@ +HAVE_FDATASYNC = @HAVE_FDATASYNC@ HAVE_FEATURES_H = @HAVE_FEATURES_H@ +HAVE_FFS = @HAVE_FFS@ HAVE_FSYNC = @HAVE_FSYNC@ HAVE_FTRUNCATE = @HAVE_FTRUNCATE@ HAVE_GETDTABLESIZE = @HAVE_GETDTABLESIZE@ @@ -427,6 +582,7 @@ HAVE_GETPAGESIZE = @HAVE_GETPAGESIZE@ HAVE_GETSUBOPT = @HAVE_GETSUBOPT@ HAVE_GRANTPT = @HAVE_GRANTPT@ +HAVE_GROUP_MEMBER = @HAVE_GROUP_MEMBER@ HAVE_INTTYPES_H = @HAVE_INTTYPES_H@ HAVE_ISWBLANK = @HAVE_ISWBLANK@ HAVE_ISWCNTRL = @HAVE_ISWCNTRL@ @@ -453,9 +609,12 @@ HAVE_OS_H = @HAVE_OS_H@ HAVE_PIPE = @HAVE_PIPE@ HAVE_PIPE2 = @HAVE_PIPE2@ +HAVE_POSIX_OPENPT = @HAVE_POSIX_OPENPT@ HAVE_PREAD = @HAVE_PREAD@ HAVE_PTSNAME = @HAVE_PTSNAME@ +HAVE_PTSNAME_R = @HAVE_PTSNAME_R@ HAVE_PWRITE = @HAVE_PWRITE@ +HAVE_RANDOM = @HAVE_RANDOM@ HAVE_RANDOM_H = @HAVE_RANDOM_H@ HAVE_RANDOM_R = @HAVE_RANDOM_R@ HAVE_READLINK = @HAVE_READLINK@ @@ -463,11 +622,14 @@ HAVE_REALPATH = @HAVE_REALPATH@ HAVE_RPMATCH = @HAVE_RPMATCH@ HAVE_SETENV = @HAVE_SETENV@ +HAVE_SETHOSTNAME = @HAVE_SETHOSTNAME@ HAVE_SIGNED_SIG_ATOMIC_T = @HAVE_SIGNED_SIG_ATOMIC_T@ HAVE_SIGNED_WCHAR_T = @HAVE_SIGNED_WCHAR_T@ HAVE_SIGNED_WINT_T = @HAVE_SIGNED_WINT_T@ HAVE_SLEEP = @HAVE_SLEEP@ HAVE_STDINT_H = @HAVE_STDINT_H@ +HAVE_STRCASECMP = @HAVE_STRCASECMP@ +HAVE_STRINGS_H = @HAVE_STRINGS_H@ HAVE_STRTOD = @HAVE_STRTOD@ HAVE_STRTOLL = @HAVE_STRTOLL@ HAVE_STRTOULL = @HAVE_STRTOULL@ @@ -486,11 +648,42 @@ HAVE_USLEEP = @HAVE_USLEEP@ HAVE_WCHAR_H = @HAVE_WCHAR_H@ HAVE_WCHAR_T = @HAVE_WCHAR_T@ +HAVE_WCPCPY = @HAVE_WCPCPY@ +HAVE_WCPNCPY = @HAVE_WCPNCPY@ HAVE_WCRTOMB = @HAVE_WCRTOMB@ +HAVE_WCSCASECMP = @HAVE_WCSCASECMP@ +HAVE_WCSCAT = @HAVE_WCSCAT@ +HAVE_WCSCHR = @HAVE_WCSCHR@ +HAVE_WCSCMP = @HAVE_WCSCMP@ +HAVE_WCSCOLL = @HAVE_WCSCOLL@ +HAVE_WCSCPY = @HAVE_WCSCPY@ +HAVE_WCSCSPN = @HAVE_WCSCSPN@ +HAVE_WCSDUP = @HAVE_WCSDUP@ +HAVE_WCSLEN = @HAVE_WCSLEN@ +HAVE_WCSNCASECMP = @HAVE_WCSNCASECMP@ +HAVE_WCSNCAT = @HAVE_WCSNCAT@ +HAVE_WCSNCMP = @HAVE_WCSNCMP@ +HAVE_WCSNCPY = @HAVE_WCSNCPY@ +HAVE_WCSNLEN = @HAVE_WCSNLEN@ HAVE_WCSNRTOMBS = @HAVE_WCSNRTOMBS@ +HAVE_WCSPBRK = @HAVE_WCSPBRK@ +HAVE_WCSRCHR = @HAVE_WCSRCHR@ HAVE_WCSRTOMBS = @HAVE_WCSRTOMBS@ +HAVE_WCSSPN = @HAVE_WCSSPN@ +HAVE_WCSSTR = @HAVE_WCSSTR@ +HAVE_WCSTOK = @HAVE_WCSTOK@ +HAVE_WCSWIDTH = @HAVE_WCSWIDTH@ +HAVE_WCSXFRM = @HAVE_WCSXFRM@ +HAVE_WCTRANS_T = @HAVE_WCTRANS_T@ HAVE_WCTYPE_H = @HAVE_WCTYPE_H@ +HAVE_WCTYPE_T = @HAVE_WCTYPE_T@ HAVE_WINT_T = @HAVE_WINT_T@ +HAVE_WMEMCHR = @HAVE_WMEMCHR@ +HAVE_WMEMCMP = @HAVE_WMEMCMP@ +HAVE_WMEMCPY = @HAVE_WMEMCPY@ +HAVE_WMEMMOVE = @HAVE_WMEMMOVE@ +HAVE_WMEMSET = @HAVE_WMEMSET@ +HAVE_XLOCALE_H = @HAVE_XLOCALE_H@ HAVE__BOOL = @HAVE__BOOL@ HAVE__EXIT = @HAVE__EXIT@ INCLUDE_NEXT = @INCLUDE_NEXT@ @@ -520,18 +713,25 @@ LTLIBINTL = @LTLIBINTL@ LTLIBOBJS = @LTLIBOBJS@ MAKEINFO = @MAKEINFO@ +MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ NEXT_AS_FIRST_DIRECTIVE_LANGINFO_H = @NEXT_AS_FIRST_DIRECTIVE_LANGINFO_H@ +NEXT_AS_FIRST_DIRECTIVE_LOCALE_H = @NEXT_AS_FIRST_DIRECTIVE_LOCALE_H@ NEXT_AS_FIRST_DIRECTIVE_STDDEF_H = @NEXT_AS_FIRST_DIRECTIVE_STDDEF_H@ NEXT_AS_FIRST_DIRECTIVE_STDINT_H = @NEXT_AS_FIRST_DIRECTIVE_STDINT_H@ NEXT_AS_FIRST_DIRECTIVE_STDLIB_H = @NEXT_AS_FIRST_DIRECTIVE_STDLIB_H@ +NEXT_AS_FIRST_DIRECTIVE_STRINGS_H = @NEXT_AS_FIRST_DIRECTIVE_STRINGS_H@ +NEXT_AS_FIRST_DIRECTIVE_SYS_TYPES_H = @NEXT_AS_FIRST_DIRECTIVE_SYS_TYPES_H@ NEXT_AS_FIRST_DIRECTIVE_UNISTD_H = @NEXT_AS_FIRST_DIRECTIVE_UNISTD_H@ NEXT_AS_FIRST_DIRECTIVE_WCHAR_H = @NEXT_AS_FIRST_DIRECTIVE_WCHAR_H@ NEXT_AS_FIRST_DIRECTIVE_WCTYPE_H = @NEXT_AS_FIRST_DIRECTIVE_WCTYPE_H@ NEXT_LANGINFO_H = @NEXT_LANGINFO_H@ +NEXT_LOCALE_H = @NEXT_LOCALE_H@ NEXT_STDDEF_H = @NEXT_STDDEF_H@ NEXT_STDINT_H = @NEXT_STDINT_H@ NEXT_STDLIB_H = @NEXT_STDLIB_H@ +NEXT_STRINGS_H = @NEXT_STRINGS_H@ +NEXT_SYS_TYPES_H = @NEXT_SYS_TYPES_H@ NEXT_UNISTD_H = @NEXT_UNISTD_H@ NEXT_WCHAR_H = @NEXT_WCHAR_H@ NEXT_WCTYPE_H = @NEXT_WCTYPE_H@ @@ -565,17 +765,21 @@ REPLACE_CLOSE = @REPLACE_CLOSE@ REPLACE_DUP = @REPLACE_DUP@ REPLACE_DUP2 = @REPLACE_DUP2@ +REPLACE_DUPLOCALE = @REPLACE_DUPLOCALE@ REPLACE_FCHOWNAT = @REPLACE_FCHOWNAT@ +REPLACE_FTRUNCATE = @REPLACE_FTRUNCATE@ REPLACE_GETCWD = @REPLACE_GETCWD@ REPLACE_GETDOMAINNAME = @REPLACE_GETDOMAINNAME@ REPLACE_GETGROUPS = @REPLACE_GETGROUPS@ REPLACE_GETLOGIN_R = @REPLACE_GETLOGIN_R@ REPLACE_GETPAGESIZE = @REPLACE_GETPAGESIZE@ +REPLACE_ISATTY = @REPLACE_ISATTY@ REPLACE_ISWBLANK = @REPLACE_ISWBLANK@ REPLACE_ISWCNTRL = @REPLACE_ISWCNTRL@ REPLACE_LCHOWN = @REPLACE_LCHOWN@ REPLACE_LINK = @REPLACE_LINK@ REPLACE_LINKAT = @REPLACE_LINKAT@ +REPLACE_LOCALECONV = @REPLACE_LOCALECONV@ REPLACE_LSEEK = @REPLACE_LSEEK@ REPLACE_MALLOC = @REPLACE_MALLOC@ REPLACE_MBRLEN = @REPLACE_MBRLEN@ @@ -584,20 +788,27 @@ REPLACE_MBSNRTOWCS = @REPLACE_MBSNRTOWCS@ REPLACE_MBSRTOWCS = @REPLACE_MBSRTOWCS@ REPLACE_MBSTATE_T = @REPLACE_MBSTATE_T@ +REPLACE_MBTOWC = @REPLACE_MBTOWC@ REPLACE_MKSTEMP = @REPLACE_MKSTEMP@ REPLACE_NL_LANGINFO = @REPLACE_NL_LANGINFO@ REPLACE_NULL = @REPLACE_NULL@ REPLACE_PREAD = @REPLACE_PREAD@ +REPLACE_PTSNAME_R = @REPLACE_PTSNAME_R@ REPLACE_PUTENV = @REPLACE_PUTENV@ REPLACE_PWRITE = @REPLACE_PWRITE@ +REPLACE_RANDOM_R = @REPLACE_RANDOM_R@ +REPLACE_READ = @REPLACE_READ@ REPLACE_READLINK = @REPLACE_READLINK@ REPLACE_REALLOC = @REPLACE_REALLOC@ REPLACE_REALPATH = @REPLACE_REALPATH@ REPLACE_RMDIR = @REPLACE_RMDIR@ REPLACE_SETENV = @REPLACE_SETENV@ +REPLACE_SETLOCALE = @REPLACE_SETLOCALE@ REPLACE_SLEEP = @REPLACE_SLEEP@ REPLACE_STRTOD = @REPLACE_STRTOD@ +REPLACE_STRUCT_LCONV = @REPLACE_STRUCT_LCONV@ REPLACE_SYMLINK = @REPLACE_SYMLINK@ +REPLACE_TOWLOWER = @REPLACE_TOWLOWER@ REPLACE_TTYNAME_R = @REPLACE_TTYNAME_R@ REPLACE_UNLINK = @REPLACE_UNLINK@ REPLACE_UNLINKAT = @REPLACE_UNLINKAT@ @@ -606,7 +817,9 @@ REPLACE_WCRTOMB = @REPLACE_WCRTOMB@ REPLACE_WCSNRTOMBS = @REPLACE_WCSNRTOMBS@ REPLACE_WCSRTOMBS = @REPLACE_WCSRTOMBS@ +REPLACE_WCSWIDTH = @REPLACE_WCSWIDTH@ REPLACE_WCTOB = @REPLACE_WCTOB@ +REPLACE_WCTOMB = @REPLACE_WCTOMB@ REPLACE_WCWIDTH = @REPLACE_WCWIDTH@ REPLACE_WRITE = @REPLACE_WRITE@ SED = @SED@ @@ -627,18 +840,16 @@ UUID_LIBS = @UUID_LIBS@ VERSION = @VERSION@ WCHAR_T_SUFFIX = @WCHAR_T_SUFFIX@ +WINDOWS_64_BIT_OFF_T = @WINDOWS_64_BIT_OFF_T@ WINT_T_SUFFIX = @WINT_T_SUFFIX@ XML2_CFLAGS = @XML2_CFLAGS@ XML2_LIBS = @XML2_LIBS@ -XML2_STATIC_LIBS = @XML2_STATIC_LIBS@ YACC = @YACC@ -ZLIB_CFLAGS = @ZLIB_CFLAGS@ -ZLIB_LDFLAGS = @ZLIB_LDFLAGS@ -ZLIB_LIBS = @ZLIB_LIBS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ +ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ @@ -680,7 +891,6 @@ lispdir = @lispdir@ localedir = @localedir@ localstatedir = @localstatedir@ -lt_ECHO = @lt_ECHO@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ @@ -702,63 +912,65 @@ ACLOCAL_AMFLAGS = -I conf -I gl/m4 aclocaldir = $(datadir)/aclocal pkgconfigdir = $(libdir)/pkgconfig +AM_CPPFLAGS = -I$(top_srcdir)/gl -I$(top_srcdir)/GNU $(XML2_CFLAGS) +AM_CXXFLAGS = $(am__append_1) $(am__append_2) -# Arrange to build with the backward compatibility mode enabled. -AM_CPPFLAGS = -I$(top_srcdir)/gl -I$(top_srcdir)/GNU -# -I$(top_srcdir)/xstream -AM_CXXFLAGS = $(am__append_1) -AM_YFLAGS = -d -v +# if USING_GRIDFIELDS +# AM_CPPFLAGS += $(GF_CFLAGS) +# GRIDFIELDS = ugridFunctions +# endif +AM_YFLAGS = -d -v -t AM_LFLAGS = -8 # These are not used by automake but are often useful for certain types of # debugging. The best way to use these is to run configure as: # export CXXFLAGS='...'; ./configure --disable-shared +# or ./configure --enable-developer --disable-shared # the --disable-shared is not required, but it seems to help with debuggers. -CXXFLAGS_DEBUG = -g3 -O0 -fno-defer-pop -Wall -W -Wcast-align -Werror +CXXFLAGS_DEBUG = -g3 -O0 -Wall -W -Wcast-align +# -Werror There are some warnings in this code that are here to stay... TEST_COV_FLAGS = -ftest-coverage -fprofile-arcs SUBDIRS = gl . tests unit-tests -DIST_SUBDIRS = unit-tests gl tests +DIST_SUBDIRS = gl tests unit-tests noinst_LTLIBRARIES = libparsers.la lib_LTLIBRARIES = libdap.la libdapclient.la libdapserver.la bin_SCRIPTS = dap-config dap-config-pkgconfig -# fdiostream_test - -# sbin_PROGRAMS = deflate -BUILT_SOURCES = $(GRAM_SRC) dods-datatypes.h xdr-datatypes.h +BUILT_SOURCES = $(GRAM_SRC) dods-datatypes.h xdr-datatypes.h getdap.1 dap-config.1 +man_MANS = getdap.1 dap-config.1 libparsers_la_SOURCES = $(GRAM_SRC) -libdap_la_SOURCES = $(DAP_SRC) $(GNU_SRC) +libparsers_la_CPPFLAGS = $(AM_CPPFLAGS) +libparsers_la_LIBADD = $(XML2_LIBS) +libdap_la_SOURCES = $(DAP_SRC) $(GNU_SRC) $(am__append_3) libdap_la_LDFLAGS = -version-info $(LIBDAP_VERSION) -libdap_la_CPPFLAGS = $(AM_CPPFLAGS) $(XML2_CFLAGS) -libdap_la_LIBADD = $(XML2_LIBS) $(PTHREAD_LIBS) gl/libgnu.la libparsers.la +libdap_la_CPPFLAGS = $(AM_CPPFLAGS) +libdap_la_LIBADD = $(XML2_LIBS) $(PTHREAD_LIBS) gl/libgnu.la \ + libparsers.la $(am__append_4) libdapclient_la_SOURCES = $(CLIENT_SRC) libdapclient_la_LDFLAGS = -version-info $(CLIENTLIB_VERSION) -libdapclient_la_CPPFLAGS = $(AM_CPPFLAGS) $(CURL_CFLAGS) $(XML2_CFLAGS) +libdapclient_la_CPPFLAGS = $(AM_CPPFLAGS) $(CURL_CFLAGS) libdapclient_la_LIBADD = $(CURL_LIBS) libdap.la $(PTHREAD_LIBS) libdapserver_la_SOURCES = $(SERVER_SRC) libdapserver_la_LDFLAGS = -version-info $(SERVERLIB_VERSION) libdapserver_la_LIBADD = libdap.la $(UUID_LIBS) -pkginclude_HEADERS = $(DAP_HDR) $(GNU_HDR) $(CLIENT_HDR) $(SERVER_HDR) +pkginclude_HEADERS = $(DAP_HDR) $(GNU_HDR) $(CLIENT_HDR) $(SERVER_HDR) \ + $(am__append_5) noinst_HEADERS = config_dap.h - -# fdiostream_test_SOURCES = GNU/fdiostream_test.cc getdap_SOURCES = getdap.cc getdap_LDADD = libdapclient.la libdap.la getdap_CPPFLAGS = $(AM_CPPFLAGS) $(CURL_CFLAGS) -LEX_YACC_EXTRA = das.lex das.y dds.lex dds.y ce_expr.lex ce_expr.y gse.lex \ - gse.y Error.lex Error.y - -EXTRA_DIST = ChangeLog COPYING README.dodsrc COPYRIGHT_URI \ - COPYRIGHT_W3C GNU/README doxy.conf doxy_private.conf libdap.spec \ - VCPP dods-datatypes-static.h xdr-datatypes-static.h \ - dap-config-pkgconfig $(LEX_YACC_EXTRA) $(GRAM_SRC) OSX_Resources +LEX_YACC_EXTRA = das.lex das.yy dds.lex dds.yy ce_expr.lex ce_expr.yy \ +Error.lex Error.yy +EXTRA_DIST = ChangeLog COPYING README.dodsrc COPYRIGHT_URI \ + COPYRIGHT_W3C GNU/README doxy.conf doxy_private.conf \ + libdap.spec VCPP dods-datatypes-static.h \ + xdr-datatypes-static.h dap-config-pkgconfig $(LEX_YACC_EXTRA) \ + $(GRAM_SRC) OSX_Resources getdap.man1 dap-config.man1 -# README.AIS xstream/README dist_aclocal_DATA = conf/libdap.m4 pkgconfig_DATA = libdap.pc libdapclient.pc libdapserver.pc -CLEANFILES = *.log *.output *.gcda *.gcno $(GRAM_SRC) dods-datatypes.h xdr-datatypes.h -grammar_objects = lex.das.o das.tab.o lex.dds.o dds.tab.o lex.ce_expr.o \ -ce_expr.tab.o lex.gse_.o gse.tab.o lex.Error.o Error.tab.o +CLEANFILES = *.log *.output *.gcda *.gcno $(GRAM_SRC) dods-datatypes.h \ + xdr-datatypes.h getdap.1 dap-config.1 ########################################################################### @@ -766,8 +978,6 @@ # Build OS/X Packages. The strange operations with configure and make # are there so that the values built into dap-config will match the mac # osx install dirs and not the temp directory used to build the packages - -# PACKAGEMAKER=/Developer/Applications/Utilities/PackageMaker.app/Contents/MacOS/PackageMaker* PACKAGEMAKER = /Developer/usr/bin/packagemaker PKG_CONF_FLAGS = @@ -778,8 +988,7 @@ GNU_HDR = GNU/GetOpt.h GNU/GNURegex.h GRAM_SRC = lex.das.cc das.tab.cc das.tab.hh lex.dds.cc dds.tab.cc \ dds.tab.hh lex.ce_expr.cc ce_expr.tab.cc ce_expr.tab.hh \ - lex.Error.cc Error.tab.cc Error.tab.hh gse.tab.hh gse.tab.cc \ - lex.gse_.cc + lex.Error.cc Error.tab.cc Error.tab.hh DAP_SRC = AttrTable.cc DAS.cc DDS.cc DataDDS.cc DDXParserSAX2.cc \ BaseType.cc Byte.cc Int32.cc Float64.cc Str.cc Url.cc \ @@ -787,12 +996,18 @@ Int16.cc UInt16.cc Float32.cc Constructor.cc \ BaseTypeFactory.cc SignalHandler.cc Error.cc InternalErr.cc \ util.cc xdrutil_ppc.c parser-util.cc escaping.cc \ - ce_functions.cc GSEClause.cc GeoConstraint.cc \ - GridGeoConstraint.cc Clause.cc RValue.cc \ - ConstraintEvaluator.cc ArrayGeoConstraint.cc DapIndent.cc \ + Clause.cc RValue.cc \ + ConstraintEvaluator.cc DapIndent.cc \ Operators.h XDRUtils.cc XDRFileMarshaller.cc \ - XDRFileUnMarshaller.cc XDRStreamMarshaller.cc \ - XDRStreamUnMarshaller.cc mime_util.cc Keywords2.cc + XDRStreamMarshaller.cc XDRFileUnMarshaller.cc \ + XDRStreamUnMarshaller.cc mime_util.cc Keywords2.cc XMLWriter.cc \ + ServerFunctionsList.cc ServerFunction.cc + + +# DAPCache3.cc +DAP4_ONLY_SRC = DAP4StreamMarshaller.cc DAP4StreamUnMarshaller.cc Int64.cc \ + UInt64.cc Int8.cc D4ParserSax2.cc D4BaseTypeFactory.cc \ + D4Maps.cc D4Dimensions.cc D4EnumDef.cc D4Group.cc # Operators.h is included in with the source to prevent it from bing installed @@ -800,36 +1015,41 @@ CLIENT_SRC = RCReader.cc Connect.cc HTTPConnect.cc HTTPCache.cc \ util_mit.cc ResponseTooBigErr.cc HTTPCacheTable.cc -SERVER_SRC = DODSFilter.cc Ancillary.cc ResponseBuilder.cc +SERVER_SRC = DODSFilter.cc Ancillary.cc +# ResponseBuilder.cc ResponseCache.cc DAP_HDR = AttrTable.h DAS.h DDS.h DataDDS.h DDXParserSAX2.h \ DDXExceptions.h BaseType.h Byte.h Int32.h Float64.h Str.h \ Url.h Vector.h Array.h Constructor.h Structure.h Sequence.h \ Grid.h UInt32.h Int16.h UInt16.h Float32.h BaseTypeFactory.h \ ObjectType.h EncodingType.h SignalHandler.h Error.h \ InternalErr.h util.h escaping.h parser.h debug.h dods-limits.h \ - dods-datatypes.h GeoConstraint.h GridGeoConstraint.h \ - ArrayGeoConstraint.h ce_functions.h gse_parser.h GSEClause.h \ + dods-datatypes.h \ util_mit.h expr.h Clause.h RValue.h ConstraintEvaluator.h \ ce_parser.h DapIndent.h DapObj.h XDRFileMarshaller.h \ - Marshaller.h XDRFileUnMarshaller.h UnMarshaller.h \ + Marshaller.h UnMarshaller.h XDRFileUnMarshaller.h \ XDRStreamMarshaller.h XDRUtils.h xdr-datatypes.h mime_util.h \ - cgi_util.h XDRStreamUnMarshaller.h Keywords2.h + cgi_util.h XDRStreamUnMarshaller.h Keywords2.h XMLWriter.h \ + ServerFunctionsList.h ServerFunction.h + + +# DAPCache.h +DAP4_ONLY_HDR = DAP4StreamMarshaller.h DAP4StreamUnMarshaller.h Int64.h \ + UInt64.h Int8.h D4ParserSax2.h D4BaseTypeFactory.h D4ParseError.h \ + D4Maps.h D4Dimensions.h D4EnumDef.h D4Group.h CLIENT_HDR = RCReader.h Connect.h HTTPConnect.h HTTPCache.h \ HTTPCacheDisconnectedMode.h HTTPCacheInterruptHandler.h \ Response.h HTTPResponse.h HTTPCacheResponse.h PipeResponse.h \ StdinResponse.h SignalHandlerRegisteredErr.h \ - ResponseTooBigErr.h Resource.h HTTPCacheTable.h - -SERVER_HDR = DODSFilter.h AlarmHandler.h EventHandler.h Ancillary.h \ - ResponseBuilder.h + ResponseTooBigErr.h Resource.h HTTPCacheTable.h HTTPCacheMacros.h +SERVER_HDR = DODSFilter.h AlarmHandler.h EventHandler.h Ancillary.h all: $(BUILT_SOURCES) config.h dods-datatypes-config.h xdr-datatypes-config.h $(MAKE) $(AM_MAKEFLAGS) all-recursive .SUFFIXES: .SUFFIXES: .c .cc .lo .o .obj -am--refresh: +am--refresh: Makefile @: $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ @@ -865,10 +1085,8 @@ $(am__aclocal_m4_deps): config.h: stamp-h1 - @if test ! -f $@; then \ - rm -f stamp-h1; \ - $(MAKE) $(AM_MAKEFLAGS) stamp-h1; \ - else :; fi + @if test ! -f $@; then rm -f stamp-h1; else :; fi + @if test ! -f $@; then $(MAKE) $(AM_MAKEFLAGS) stamp-h1; else :; fi stamp-h1: $(srcdir)/config.h.in $(top_builddir)/config.status @rm -f stamp-h1 @@ -879,20 +1097,16 @@ touch $@ dods-datatypes-config.h: stamp-h2 - @if test ! -f $@; then \ - rm -f stamp-h2; \ - $(MAKE) $(AM_MAKEFLAGS) stamp-h2; \ - else :; fi + @if test ! -f $@; then rm -f stamp-h2; else :; fi + @if test ! -f $@; then $(MAKE) $(AM_MAKEFLAGS) stamp-h2; else :; fi stamp-h2: $(srcdir)/dods-datatypes-config.h.in $(top_builddir)/config.status @rm -f stamp-h2 cd $(top_builddir) && $(SHELL) ./config.status dods-datatypes-config.h xdr-datatypes-config.h: stamp-h3 - @if test ! -f $@; then \ - rm -f stamp-h3; \ - $(MAKE) $(AM_MAKEFLAGS) stamp-h3; \ - else :; fi + @if test ! -f $@; then rm -f stamp-h3; else :; fi + @if test ! -f $@; then $(MAKE) $(AM_MAKEFLAGS) stamp-h3; else :; fi stamp-h3: $(srcdir)/xdr-datatypes-config.h.in $(top_builddir)/config.status @rm -f stamp-h3 @@ -906,11 +1120,14 @@ cd $(top_builddir) && $(SHELL) ./config.status $@ libdapserver.pc: $(top_builddir)/config.status $(srcdir)/libdapserver.pc.in cd $(top_builddir) && $(SHELL) ./config.status $@ +main_page.doxygen: $(top_builddir)/config.status $(srcdir)/main_page.doxygen.in + cd $(top_builddir) && $(SHELL) ./config.status $@ +doxy.conf: $(top_builddir)/config.status $(srcdir)/doxy.conf.in + cd $(top_builddir) && $(SHELL) ./config.status $@ dap-config: $(top_builddir)/config.status $(srcdir)/dap-config.in cd $(top_builddir) && $(SHELL) ./config.status $@ install-libLTLIBRARIES: $(lib_LTLIBRARIES) @$(NORMAL_INSTALL) - test -z "$(libdir)" || $(MKDIR_P) "$(DESTDIR)$(libdir)" @list='$(lib_LTLIBRARIES)'; test -n "$(libdir)" || list=; \ list2=; for p in $$list; do \ if test -f $$p; then \ @@ -918,6 +1135,8 @@ else :; fi; \ done; \ test -z "$$list2" || { \ + echo " $(MKDIR_P) '$(DESTDIR)$(libdir)'"; \ + $(MKDIR_P) "$(DESTDIR)$(libdir)" || exit 1; \ echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 '$(DESTDIR)$(libdir)'"; \ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 "$(DESTDIR)$(libdir)"; \ } @@ -933,33 +1152,40 @@ clean-libLTLIBRARIES: -test -z "$(lib_LTLIBRARIES)" || rm -f $(lib_LTLIBRARIES) - @list='$(lib_LTLIBRARIES)'; for p in $$list; do \ - dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \ - test "$$dir" != "$$p" || dir=.; \ - echo "rm -f \"$${dir}/so_locations\""; \ - rm -f "$${dir}/so_locations"; \ - done + @list='$(lib_LTLIBRARIES)'; \ + locs=`for p in $$list; do echo $$p; done | \ + sed 's|^[^/]*$$|.|; s|/[^/]*$$||; s|$$|/so_locations|' | \ + sort -u`; \ + test -z "$$locs" || { \ + echo rm -f $${locs}; \ + rm -f $${locs}; \ + } clean-noinstLTLIBRARIES: -test -z "$(noinst_LTLIBRARIES)" || rm -f $(noinst_LTLIBRARIES) - @list='$(noinst_LTLIBRARIES)'; for p in $$list; do \ - dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \ - test "$$dir" != "$$p" || dir=.; \ - echo "rm -f \"$${dir}/so_locations\""; \ - rm -f "$${dir}/so_locations"; \ - done -libdap.la: $(libdap_la_OBJECTS) $(libdap_la_DEPENDENCIES) + @list='$(noinst_LTLIBRARIES)'; \ + locs=`for p in $$list; do echo $$p; done | \ + sed 's|^[^/]*$$|.|; s|/[^/]*$$||; s|$$|/so_locations|' | \ + sort -u`; \ + test -z "$$locs" || { \ + echo rm -f $${locs}; \ + rm -f $${locs}; \ + } +libdap.la: $(libdap_la_OBJECTS) $(libdap_la_DEPENDENCIES) $(EXTRA_libdap_la_DEPENDENCIES) $(libdap_la_LINK) -rpath $(libdir) $(libdap_la_OBJECTS) $(libdap_la_LIBADD) $(LIBS) -libdapclient.la: $(libdapclient_la_OBJECTS) $(libdapclient_la_DEPENDENCIES) +libdapclient.la: $(libdapclient_la_OBJECTS) $(libdapclient_la_DEPENDENCIES) $(EXTRA_libdapclient_la_DEPENDENCIES) $(libdapclient_la_LINK) -rpath $(libdir) $(libdapclient_la_OBJECTS) $(libdapclient_la_LIBADD) $(LIBS) -libdapserver.la: $(libdapserver_la_OBJECTS) $(libdapserver_la_DEPENDENCIES) +libdapserver.la: $(libdapserver_la_OBJECTS) $(libdapserver_la_DEPENDENCIES) $(EXTRA_libdapserver_la_DEPENDENCIES) $(libdapserver_la_LINK) -rpath $(libdir) $(libdapserver_la_OBJECTS) $(libdapserver_la_LIBADD) $(LIBS) -libparsers.la: $(libparsers_la_OBJECTS) $(libparsers_la_DEPENDENCIES) +libparsers.la: $(libparsers_la_OBJECTS) $(libparsers_la_DEPENDENCIES) $(EXTRA_libparsers_la_DEPENDENCIES) $(CXXLINK) $(libparsers_la_OBJECTS) $(libparsers_la_LIBADD) $(LIBS) install-binPROGRAMS: $(bin_PROGRAMS) @$(NORMAL_INSTALL) - test -z "$(bindir)" || $(MKDIR_P) "$(DESTDIR)$(bindir)" @list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \ + if test -n "$$list"; then \ + echo " $(MKDIR_P) '$(DESTDIR)$(bindir)'"; \ + $(MKDIR_P) "$(DESTDIR)$(bindir)" || exit 1; \ + fi; \ for p in $$list; do echo "$$p $$p"; done | \ sed 's/$(EXEEXT)$$//' | \ while read p p1; do if test -f $$p || test -f $$p1; \ @@ -999,13 +1225,16 @@ list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \ echo " rm -f" $$list; \ rm -f $$list -getdap$(EXEEXT): $(getdap_OBJECTS) $(getdap_DEPENDENCIES) +getdap$(EXEEXT): $(getdap_OBJECTS) $(getdap_DEPENDENCIES) $(EXTRA_getdap_DEPENDENCIES) @rm -f getdap$(EXEEXT) $(CXXLINK) $(getdap_OBJECTS) $(getdap_LDADD) $(LIBS) install-binSCRIPTS: $(bin_SCRIPTS) @$(NORMAL_INSTALL) - test -z "$(bindir)" || $(MKDIR_P) "$(DESTDIR)$(bindir)" @list='$(bin_SCRIPTS)'; test -n "$(bindir)" || list=; \ + if test -n "$$list"; then \ + echo " $(MKDIR_P) '$(DESTDIR)$(bindir)'"; \ + $(MKDIR_P) "$(DESTDIR)$(bindir)" || exit 1; \ + fi; \ for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ if test -f "$$d$$p"; then echo "$$d$$p"; echo "$$p"; else :; fi; \ @@ -1033,9 +1262,7 @@ @list='$(bin_SCRIPTS)'; test -n "$(bindir)" || exit 0; \ files=`for p in $$list; do echo "$$p"; done | \ sed -e 's,.*/,,;$(transform)'`; \ - test -n "$$list" || exit 0; \ - echo " ( cd '$(DESTDIR)$(bindir)' && rm -f" $$files ")"; \ - cd "$(DESTDIR)$(bindir)" && rm -f $$files + dir='$(DESTDIR)$(bindir)'; $(am__uninstall_files_from_dir) mostlyclean-compile: -rm -f *.$(OBJEXT) @@ -1045,20 +1272,8 @@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/Ancillary.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/DODSFilter.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/Error.tab.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ResponseBuilder.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ce_expr.tab.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/das.tab.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dds.tab.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/getdap-getdap.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gse.tab.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/lex.Error.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/lex.ce_expr.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/lex.das.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/lex.dds.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/lex.gse_.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libdap_la-Array.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libdap_la-ArrayGeoConstraint.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libdap_la-AttrTable.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libdap_la-BaseType.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libdap_la-BaseTypeFactory.Plo@am__quote@ @@ -1066,6 +1281,14 @@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libdap_la-Clause.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libdap_la-ConstraintEvaluator.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libdap_la-Constructor.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libdap_la-D4BaseTypeFactory.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libdap_la-D4Dimensions.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libdap_la-D4EnumDef.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libdap_la-D4Group.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libdap_la-D4Maps.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libdap_la-D4ParserSax2.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libdap_la-DAP4StreamMarshaller.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libdap_la-DAP4StreamUnMarshaller.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libdap_la-DAS.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libdap_la-DDS.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libdap_la-DDXParserSAX2.Plo@am__quote@ @@ -1075,22 +1298,24 @@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libdap_la-Float32.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libdap_la-Float64.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libdap_la-GNURegex.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libdap_la-GSEClause.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libdap_la-GeoConstraint.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libdap_la-GetOpt.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libdap_la-Grid.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libdap_la-GridGeoConstraint.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libdap_la-Int16.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libdap_la-Int32.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libdap_la-Int64.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libdap_la-Int8.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libdap_la-InternalErr.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libdap_la-Keywords2.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libdap_la-RValue.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libdap_la-Sequence.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libdap_la-ServerFunction.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libdap_la-ServerFunctionsList.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libdap_la-SignalHandler.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libdap_la-Str.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libdap_la-Structure.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libdap_la-UInt16.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libdap_la-UInt32.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libdap_la-UInt64.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libdap_la-Url.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libdap_la-Vector.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libdap_la-XDRFileMarshaller.Plo@am__quote@ @@ -1098,7 +1323,7 @@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libdap_la-XDRStreamMarshaller.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libdap_la-XDRStreamUnMarshaller.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libdap_la-XDRUtils.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libdap_la-ce_functions.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libdap_la-XMLWriter.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libdap_la-escaping.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libdap_la-mime_util.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libdap_la-parser-util.Plo@am__quote@ @@ -1111,6 +1336,14 @@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libdapclient_la-RCReader.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libdapclient_la-ResponseTooBigErr.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libdapclient_la-util_mit.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libparsers_la-Error.tab.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libparsers_la-ce_expr.tab.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libparsers_la-das.tab.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libparsers_la-dds.tab.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libparsers_la-lex.Error.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libparsers_la-lex.ce_expr.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libparsers_la-lex.das.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libparsers_la-lex.dds.Plo@am__quote@ .c.o: @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @@ -1357,34 +1590,6 @@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libdap_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libdap_la-escaping.lo `test -f 'escaping.cc' || echo '$(srcdir)/'`escaping.cc -libdap_la-ce_functions.lo: ce_functions.cc -@am__fastdepCXX_TRUE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libdap_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libdap_la-ce_functions.lo -MD -MP -MF $(DEPDIR)/libdap_la-ce_functions.Tpo -c -o libdap_la-ce_functions.lo `test -f 'ce_functions.cc' || echo '$(srcdir)/'`ce_functions.cc -@am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/libdap_la-ce_functions.Tpo $(DEPDIR)/libdap_la-ce_functions.Plo -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='ce_functions.cc' object='libdap_la-ce_functions.lo' libtool=yes @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libdap_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libdap_la-ce_functions.lo `test -f 'ce_functions.cc' || echo '$(srcdir)/'`ce_functions.cc - -libdap_la-GSEClause.lo: GSEClause.cc -@am__fastdepCXX_TRUE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libdap_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libdap_la-GSEClause.lo -MD -MP -MF $(DEPDIR)/libdap_la-GSEClause.Tpo -c -o libdap_la-GSEClause.lo `test -f 'GSEClause.cc' || echo '$(srcdir)/'`GSEClause.cc -@am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/libdap_la-GSEClause.Tpo $(DEPDIR)/libdap_la-GSEClause.Plo -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='GSEClause.cc' object='libdap_la-GSEClause.lo' libtool=yes @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libdap_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libdap_la-GSEClause.lo `test -f 'GSEClause.cc' || echo '$(srcdir)/'`GSEClause.cc - -libdap_la-GeoConstraint.lo: GeoConstraint.cc -@am__fastdepCXX_TRUE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libdap_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libdap_la-GeoConstraint.lo -MD -MP -MF $(DEPDIR)/libdap_la-GeoConstraint.Tpo -c -o libdap_la-GeoConstraint.lo `test -f 'GeoConstraint.cc' || echo '$(srcdir)/'`GeoConstraint.cc -@am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/libdap_la-GeoConstraint.Tpo $(DEPDIR)/libdap_la-GeoConstraint.Plo -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='GeoConstraint.cc' object='libdap_la-GeoConstraint.lo' libtool=yes @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libdap_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libdap_la-GeoConstraint.lo `test -f 'GeoConstraint.cc' || echo '$(srcdir)/'`GeoConstraint.cc - -libdap_la-GridGeoConstraint.lo: GridGeoConstraint.cc -@am__fastdepCXX_TRUE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libdap_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libdap_la-GridGeoConstraint.lo -MD -MP -MF $(DEPDIR)/libdap_la-GridGeoConstraint.Tpo -c -o libdap_la-GridGeoConstraint.lo `test -f 'GridGeoConstraint.cc' || echo '$(srcdir)/'`GridGeoConstraint.cc -@am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/libdap_la-GridGeoConstraint.Tpo $(DEPDIR)/libdap_la-GridGeoConstraint.Plo -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='GridGeoConstraint.cc' object='libdap_la-GridGeoConstraint.lo' libtool=yes @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libdap_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libdap_la-GridGeoConstraint.lo `test -f 'GridGeoConstraint.cc' || echo '$(srcdir)/'`GridGeoConstraint.cc - libdap_la-Clause.lo: Clause.cc @am__fastdepCXX_TRUE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libdap_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libdap_la-Clause.lo -MD -MP -MF $(DEPDIR)/libdap_la-Clause.Tpo -c -o libdap_la-Clause.lo `test -f 'Clause.cc' || echo '$(srcdir)/'`Clause.cc @am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/libdap_la-Clause.Tpo $(DEPDIR)/libdap_la-Clause.Plo @@ -1406,13 +1611,6 @@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libdap_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libdap_la-ConstraintEvaluator.lo `test -f 'ConstraintEvaluator.cc' || echo '$(srcdir)/'`ConstraintEvaluator.cc -libdap_la-ArrayGeoConstraint.lo: ArrayGeoConstraint.cc -@am__fastdepCXX_TRUE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libdap_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libdap_la-ArrayGeoConstraint.lo -MD -MP -MF $(DEPDIR)/libdap_la-ArrayGeoConstraint.Tpo -c -o libdap_la-ArrayGeoConstraint.lo `test -f 'ArrayGeoConstraint.cc' || echo '$(srcdir)/'`ArrayGeoConstraint.cc -@am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/libdap_la-ArrayGeoConstraint.Tpo $(DEPDIR)/libdap_la-ArrayGeoConstraint.Plo -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='ArrayGeoConstraint.cc' object='libdap_la-ArrayGeoConstraint.lo' libtool=yes @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libdap_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libdap_la-ArrayGeoConstraint.lo `test -f 'ArrayGeoConstraint.cc' || echo '$(srcdir)/'`ArrayGeoConstraint.cc - libdap_la-DapIndent.lo: DapIndent.cc @am__fastdepCXX_TRUE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libdap_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libdap_la-DapIndent.lo -MD -MP -MF $(DEPDIR)/libdap_la-DapIndent.Tpo -c -o libdap_la-DapIndent.lo `test -f 'DapIndent.cc' || echo '$(srcdir)/'`DapIndent.cc @am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/libdap_la-DapIndent.Tpo $(DEPDIR)/libdap_la-DapIndent.Plo @@ -1434,13 +1632,6 @@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libdap_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libdap_la-XDRFileMarshaller.lo `test -f 'XDRFileMarshaller.cc' || echo '$(srcdir)/'`XDRFileMarshaller.cc -libdap_la-XDRFileUnMarshaller.lo: XDRFileUnMarshaller.cc -@am__fastdepCXX_TRUE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libdap_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libdap_la-XDRFileUnMarshaller.lo -MD -MP -MF $(DEPDIR)/libdap_la-XDRFileUnMarshaller.Tpo -c -o libdap_la-XDRFileUnMarshaller.lo `test -f 'XDRFileUnMarshaller.cc' || echo '$(srcdir)/'`XDRFileUnMarshaller.cc -@am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/libdap_la-XDRFileUnMarshaller.Tpo $(DEPDIR)/libdap_la-XDRFileUnMarshaller.Plo -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='XDRFileUnMarshaller.cc' object='libdap_la-XDRFileUnMarshaller.lo' libtool=yes @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libdap_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libdap_la-XDRFileUnMarshaller.lo `test -f 'XDRFileUnMarshaller.cc' || echo '$(srcdir)/'`XDRFileUnMarshaller.cc - libdap_la-XDRStreamMarshaller.lo: XDRStreamMarshaller.cc @am__fastdepCXX_TRUE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libdap_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libdap_la-XDRStreamMarshaller.lo -MD -MP -MF $(DEPDIR)/libdap_la-XDRStreamMarshaller.Tpo -c -o libdap_la-XDRStreamMarshaller.lo `test -f 'XDRStreamMarshaller.cc' || echo '$(srcdir)/'`XDRStreamMarshaller.cc @am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/libdap_la-XDRStreamMarshaller.Tpo $(DEPDIR)/libdap_la-XDRStreamMarshaller.Plo @@ -1448,6 +1639,13 @@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libdap_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libdap_la-XDRStreamMarshaller.lo `test -f 'XDRStreamMarshaller.cc' || echo '$(srcdir)/'`XDRStreamMarshaller.cc +libdap_la-XDRFileUnMarshaller.lo: XDRFileUnMarshaller.cc +@am__fastdepCXX_TRUE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libdap_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libdap_la-XDRFileUnMarshaller.lo -MD -MP -MF $(DEPDIR)/libdap_la-XDRFileUnMarshaller.Tpo -c -o libdap_la-XDRFileUnMarshaller.lo `test -f 'XDRFileUnMarshaller.cc' || echo '$(srcdir)/'`XDRFileUnMarshaller.cc +@am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/libdap_la-XDRFileUnMarshaller.Tpo $(DEPDIR)/libdap_la-XDRFileUnMarshaller.Plo +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='XDRFileUnMarshaller.cc' object='libdap_la-XDRFileUnMarshaller.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libdap_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libdap_la-XDRFileUnMarshaller.lo `test -f 'XDRFileUnMarshaller.cc' || echo '$(srcdir)/'`XDRFileUnMarshaller.cc + libdap_la-XDRStreamUnMarshaller.lo: XDRStreamUnMarshaller.cc @am__fastdepCXX_TRUE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libdap_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libdap_la-XDRStreamUnMarshaller.lo -MD -MP -MF $(DEPDIR)/libdap_la-XDRStreamUnMarshaller.Tpo -c -o libdap_la-XDRStreamUnMarshaller.lo `test -f 'XDRStreamUnMarshaller.cc' || echo '$(srcdir)/'`XDRStreamUnMarshaller.cc @am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/libdap_la-XDRStreamUnMarshaller.Tpo $(DEPDIR)/libdap_la-XDRStreamUnMarshaller.Plo @@ -1469,6 +1667,27 @@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libdap_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libdap_la-Keywords2.lo `test -f 'Keywords2.cc' || echo '$(srcdir)/'`Keywords2.cc +libdap_la-XMLWriter.lo: XMLWriter.cc +@am__fastdepCXX_TRUE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libdap_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libdap_la-XMLWriter.lo -MD -MP -MF $(DEPDIR)/libdap_la-XMLWriter.Tpo -c -o libdap_la-XMLWriter.lo `test -f 'XMLWriter.cc' || echo '$(srcdir)/'`XMLWriter.cc +@am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/libdap_la-XMLWriter.Tpo $(DEPDIR)/libdap_la-XMLWriter.Plo +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='XMLWriter.cc' object='libdap_la-XMLWriter.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libdap_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libdap_la-XMLWriter.lo `test -f 'XMLWriter.cc' || echo '$(srcdir)/'`XMLWriter.cc + +libdap_la-ServerFunctionsList.lo: ServerFunctionsList.cc +@am__fastdepCXX_TRUE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libdap_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libdap_la-ServerFunctionsList.lo -MD -MP -MF $(DEPDIR)/libdap_la-ServerFunctionsList.Tpo -c -o libdap_la-ServerFunctionsList.lo `test -f 'ServerFunctionsList.cc' || echo '$(srcdir)/'`ServerFunctionsList.cc +@am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/libdap_la-ServerFunctionsList.Tpo $(DEPDIR)/libdap_la-ServerFunctionsList.Plo +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='ServerFunctionsList.cc' object='libdap_la-ServerFunctionsList.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libdap_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libdap_la-ServerFunctionsList.lo `test -f 'ServerFunctionsList.cc' || echo '$(srcdir)/'`ServerFunctionsList.cc + +libdap_la-ServerFunction.lo: ServerFunction.cc +@am__fastdepCXX_TRUE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libdap_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libdap_la-ServerFunction.lo -MD -MP -MF $(DEPDIR)/libdap_la-ServerFunction.Tpo -c -o libdap_la-ServerFunction.lo `test -f 'ServerFunction.cc' || echo '$(srcdir)/'`ServerFunction.cc +@am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/libdap_la-ServerFunction.Tpo $(DEPDIR)/libdap_la-ServerFunction.Plo +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='ServerFunction.cc' object='libdap_la-ServerFunction.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libdap_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libdap_la-ServerFunction.lo `test -f 'ServerFunction.cc' || echo '$(srcdir)/'`ServerFunction.cc + libdap_la-GetOpt.lo: GNU/GetOpt.cc @am__fastdepCXX_TRUE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libdap_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libdap_la-GetOpt.lo -MD -MP -MF $(DEPDIR)/libdap_la-GetOpt.Tpo -c -o libdap_la-GetOpt.lo `test -f 'GNU/GetOpt.cc' || echo '$(srcdir)/'`GNU/GetOpt.cc @am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/libdap_la-GetOpt.Tpo $(DEPDIR)/libdap_la-GetOpt.Plo @@ -1483,6 +1702,83 @@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libdap_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libdap_la-GNURegex.lo `test -f 'GNU/GNURegex.cc' || echo '$(srcdir)/'`GNU/GNURegex.cc +libdap_la-DAP4StreamMarshaller.lo: DAP4StreamMarshaller.cc +@am__fastdepCXX_TRUE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libdap_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libdap_la-DAP4StreamMarshaller.lo -MD -MP -MF $(DEPDIR)/libdap_la-DAP4StreamMarshaller.Tpo -c -o libdap_la-DAP4StreamMarshaller.lo `test -f 'DAP4StreamMarshaller.cc' || echo '$(srcdir)/'`DAP4StreamMarshaller.cc +@am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/libdap_la-DAP4StreamMarshaller.Tpo $(DEPDIR)/libdap_la-DAP4StreamMarshaller.Plo +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='DAP4StreamMarshaller.cc' object='libdap_la-DAP4StreamMarshaller.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libdap_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libdap_la-DAP4StreamMarshaller.lo `test -f 'DAP4StreamMarshaller.cc' || echo '$(srcdir)/'`DAP4StreamMarshaller.cc + +libdap_la-DAP4StreamUnMarshaller.lo: DAP4StreamUnMarshaller.cc +@am__fastdepCXX_TRUE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libdap_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libdap_la-DAP4StreamUnMarshaller.lo -MD -MP -MF $(DEPDIR)/libdap_la-DAP4StreamUnMarshaller.Tpo -c -o libdap_la-DAP4StreamUnMarshaller.lo `test -f 'DAP4StreamUnMarshaller.cc' || echo '$(srcdir)/'`DAP4StreamUnMarshaller.cc +@am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/libdap_la-DAP4StreamUnMarshaller.Tpo $(DEPDIR)/libdap_la-DAP4StreamUnMarshaller.Plo +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='DAP4StreamUnMarshaller.cc' object='libdap_la-DAP4StreamUnMarshaller.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libdap_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libdap_la-DAP4StreamUnMarshaller.lo `test -f 'DAP4StreamUnMarshaller.cc' || echo '$(srcdir)/'`DAP4StreamUnMarshaller.cc + +libdap_la-Int64.lo: Int64.cc +@am__fastdepCXX_TRUE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libdap_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libdap_la-Int64.lo -MD -MP -MF $(DEPDIR)/libdap_la-Int64.Tpo -c -o libdap_la-Int64.lo `test -f 'Int64.cc' || echo '$(srcdir)/'`Int64.cc +@am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/libdap_la-Int64.Tpo $(DEPDIR)/libdap_la-Int64.Plo +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='Int64.cc' object='libdap_la-Int64.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libdap_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libdap_la-Int64.lo `test -f 'Int64.cc' || echo '$(srcdir)/'`Int64.cc + +libdap_la-UInt64.lo: UInt64.cc +@am__fastdepCXX_TRUE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libdap_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libdap_la-UInt64.lo -MD -MP -MF $(DEPDIR)/libdap_la-UInt64.Tpo -c -o libdap_la-UInt64.lo `test -f 'UInt64.cc' || echo '$(srcdir)/'`UInt64.cc +@am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/libdap_la-UInt64.Tpo $(DEPDIR)/libdap_la-UInt64.Plo +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='UInt64.cc' object='libdap_la-UInt64.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libdap_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libdap_la-UInt64.lo `test -f 'UInt64.cc' || echo '$(srcdir)/'`UInt64.cc + +libdap_la-Int8.lo: Int8.cc +@am__fastdepCXX_TRUE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libdap_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libdap_la-Int8.lo -MD -MP -MF $(DEPDIR)/libdap_la-Int8.Tpo -c -o libdap_la-Int8.lo `test -f 'Int8.cc' || echo '$(srcdir)/'`Int8.cc +@am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/libdap_la-Int8.Tpo $(DEPDIR)/libdap_la-Int8.Plo +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='Int8.cc' object='libdap_la-Int8.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libdap_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libdap_la-Int8.lo `test -f 'Int8.cc' || echo '$(srcdir)/'`Int8.cc + +libdap_la-D4ParserSax2.lo: D4ParserSax2.cc +@am__fastdepCXX_TRUE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libdap_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libdap_la-D4ParserSax2.lo -MD -MP -MF $(DEPDIR)/libdap_la-D4ParserSax2.Tpo -c -o libdap_la-D4ParserSax2.lo `test -f 'D4ParserSax2.cc' || echo '$(srcdir)/'`D4ParserSax2.cc +@am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/libdap_la-D4ParserSax2.Tpo $(DEPDIR)/libdap_la-D4ParserSax2.Plo +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='D4ParserSax2.cc' object='libdap_la-D4ParserSax2.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libdap_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libdap_la-D4ParserSax2.lo `test -f 'D4ParserSax2.cc' || echo '$(srcdir)/'`D4ParserSax2.cc + +libdap_la-D4BaseTypeFactory.lo: D4BaseTypeFactory.cc +@am__fastdepCXX_TRUE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libdap_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libdap_la-D4BaseTypeFactory.lo -MD -MP -MF $(DEPDIR)/libdap_la-D4BaseTypeFactory.Tpo -c -o libdap_la-D4BaseTypeFactory.lo `test -f 'D4BaseTypeFactory.cc' || echo '$(srcdir)/'`D4BaseTypeFactory.cc +@am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/libdap_la-D4BaseTypeFactory.Tpo $(DEPDIR)/libdap_la-D4BaseTypeFactory.Plo +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='D4BaseTypeFactory.cc' object='libdap_la-D4BaseTypeFactory.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libdap_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libdap_la-D4BaseTypeFactory.lo `test -f 'D4BaseTypeFactory.cc' || echo '$(srcdir)/'`D4BaseTypeFactory.cc + +libdap_la-D4Maps.lo: D4Maps.cc +@am__fastdepCXX_TRUE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libdap_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libdap_la-D4Maps.lo -MD -MP -MF $(DEPDIR)/libdap_la-D4Maps.Tpo -c -o libdap_la-D4Maps.lo `test -f 'D4Maps.cc' || echo '$(srcdir)/'`D4Maps.cc +@am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/libdap_la-D4Maps.Tpo $(DEPDIR)/libdap_la-D4Maps.Plo +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='D4Maps.cc' object='libdap_la-D4Maps.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libdap_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libdap_la-D4Maps.lo `test -f 'D4Maps.cc' || echo '$(srcdir)/'`D4Maps.cc + +libdap_la-D4Dimensions.lo: D4Dimensions.cc +@am__fastdepCXX_TRUE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libdap_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libdap_la-D4Dimensions.lo -MD -MP -MF $(DEPDIR)/libdap_la-D4Dimensions.Tpo -c -o libdap_la-D4Dimensions.lo `test -f 'D4Dimensions.cc' || echo '$(srcdir)/'`D4Dimensions.cc +@am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/libdap_la-D4Dimensions.Tpo $(DEPDIR)/libdap_la-D4Dimensions.Plo +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='D4Dimensions.cc' object='libdap_la-D4Dimensions.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libdap_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libdap_la-D4Dimensions.lo `test -f 'D4Dimensions.cc' || echo '$(srcdir)/'`D4Dimensions.cc + +libdap_la-D4EnumDef.lo: D4EnumDef.cc +@am__fastdepCXX_TRUE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libdap_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libdap_la-D4EnumDef.lo -MD -MP -MF $(DEPDIR)/libdap_la-D4EnumDef.Tpo -c -o libdap_la-D4EnumDef.lo `test -f 'D4EnumDef.cc' || echo '$(srcdir)/'`D4EnumDef.cc +@am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/libdap_la-D4EnumDef.Tpo $(DEPDIR)/libdap_la-D4EnumDef.Plo +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='D4EnumDef.cc' object='libdap_la-D4EnumDef.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libdap_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libdap_la-D4EnumDef.lo `test -f 'D4EnumDef.cc' || echo '$(srcdir)/'`D4EnumDef.cc + +libdap_la-D4Group.lo: D4Group.cc +@am__fastdepCXX_TRUE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libdap_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libdap_la-D4Group.lo -MD -MP -MF $(DEPDIR)/libdap_la-D4Group.Tpo -c -o libdap_la-D4Group.lo `test -f 'D4Group.cc' || echo '$(srcdir)/'`D4Group.cc +@am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/libdap_la-D4Group.Tpo $(DEPDIR)/libdap_la-D4Group.Plo +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='D4Group.cc' object='libdap_la-D4Group.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libdap_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libdap_la-D4Group.lo `test -f 'D4Group.cc' || echo '$(srcdir)/'`D4Group.cc + libdapclient_la-RCReader.lo: RCReader.cc @am__fastdepCXX_TRUE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libdapclient_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libdapclient_la-RCReader.lo -MD -MP -MF $(DEPDIR)/libdapclient_la-RCReader.Tpo -c -o libdapclient_la-RCReader.lo `test -f 'RCReader.cc' || echo '$(srcdir)/'`RCReader.cc @am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/libdapclient_la-RCReader.Tpo $(DEPDIR)/libdapclient_la-RCReader.Plo @@ -1532,6 +1828,62 @@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libdapclient_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libdapclient_la-HTTPCacheTable.lo `test -f 'HTTPCacheTable.cc' || echo '$(srcdir)/'`HTTPCacheTable.cc +libparsers_la-lex.das.lo: lex.das.cc +@am__fastdepCXX_TRUE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libparsers_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libparsers_la-lex.das.lo -MD -MP -MF $(DEPDIR)/libparsers_la-lex.das.Tpo -c -o libparsers_la-lex.das.lo `test -f 'lex.das.cc' || echo '$(srcdir)/'`lex.das.cc +@am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/libparsers_la-lex.das.Tpo $(DEPDIR)/libparsers_la-lex.das.Plo +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='lex.das.cc' object='libparsers_la-lex.das.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libparsers_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libparsers_la-lex.das.lo `test -f 'lex.das.cc' || echo '$(srcdir)/'`lex.das.cc + +libparsers_la-das.tab.lo: das.tab.cc +@am__fastdepCXX_TRUE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libparsers_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libparsers_la-das.tab.lo -MD -MP -MF $(DEPDIR)/libparsers_la-das.tab.Tpo -c -o libparsers_la-das.tab.lo `test -f 'das.tab.cc' || echo '$(srcdir)/'`das.tab.cc +@am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/libparsers_la-das.tab.Tpo $(DEPDIR)/libparsers_la-das.tab.Plo +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='das.tab.cc' object='libparsers_la-das.tab.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libparsers_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libparsers_la-das.tab.lo `test -f 'das.tab.cc' || echo '$(srcdir)/'`das.tab.cc + +libparsers_la-lex.dds.lo: lex.dds.cc +@am__fastdepCXX_TRUE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libparsers_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libparsers_la-lex.dds.lo -MD -MP -MF $(DEPDIR)/libparsers_la-lex.dds.Tpo -c -o libparsers_la-lex.dds.lo `test -f 'lex.dds.cc' || echo '$(srcdir)/'`lex.dds.cc +@am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/libparsers_la-lex.dds.Tpo $(DEPDIR)/libparsers_la-lex.dds.Plo +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='lex.dds.cc' object='libparsers_la-lex.dds.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libparsers_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libparsers_la-lex.dds.lo `test -f 'lex.dds.cc' || echo '$(srcdir)/'`lex.dds.cc + +libparsers_la-dds.tab.lo: dds.tab.cc +@am__fastdepCXX_TRUE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libparsers_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libparsers_la-dds.tab.lo -MD -MP -MF $(DEPDIR)/libparsers_la-dds.tab.Tpo -c -o libparsers_la-dds.tab.lo `test -f 'dds.tab.cc' || echo '$(srcdir)/'`dds.tab.cc +@am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/libparsers_la-dds.tab.Tpo $(DEPDIR)/libparsers_la-dds.tab.Plo +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='dds.tab.cc' object='libparsers_la-dds.tab.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libparsers_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libparsers_la-dds.tab.lo `test -f 'dds.tab.cc' || echo '$(srcdir)/'`dds.tab.cc + +libparsers_la-lex.ce_expr.lo: lex.ce_expr.cc +@am__fastdepCXX_TRUE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libparsers_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libparsers_la-lex.ce_expr.lo -MD -MP -MF $(DEPDIR)/libparsers_la-lex.ce_expr.Tpo -c -o libparsers_la-lex.ce_expr.lo `test -f 'lex.ce_expr.cc' || echo '$(srcdir)/'`lex.ce_expr.cc +@am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/libparsers_la-lex.ce_expr.Tpo $(DEPDIR)/libparsers_la-lex.ce_expr.Plo +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='lex.ce_expr.cc' object='libparsers_la-lex.ce_expr.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libparsers_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libparsers_la-lex.ce_expr.lo `test -f 'lex.ce_expr.cc' || echo '$(srcdir)/'`lex.ce_expr.cc + +libparsers_la-ce_expr.tab.lo: ce_expr.tab.cc +@am__fastdepCXX_TRUE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libparsers_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libparsers_la-ce_expr.tab.lo -MD -MP -MF $(DEPDIR)/libparsers_la-ce_expr.tab.Tpo -c -o libparsers_la-ce_expr.tab.lo `test -f 'ce_expr.tab.cc' || echo '$(srcdir)/'`ce_expr.tab.cc +@am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/libparsers_la-ce_expr.tab.Tpo $(DEPDIR)/libparsers_la-ce_expr.tab.Plo +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='ce_expr.tab.cc' object='libparsers_la-ce_expr.tab.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libparsers_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libparsers_la-ce_expr.tab.lo `test -f 'ce_expr.tab.cc' || echo '$(srcdir)/'`ce_expr.tab.cc + +libparsers_la-lex.Error.lo: lex.Error.cc +@am__fastdepCXX_TRUE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libparsers_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libparsers_la-lex.Error.lo -MD -MP -MF $(DEPDIR)/libparsers_la-lex.Error.Tpo -c -o libparsers_la-lex.Error.lo `test -f 'lex.Error.cc' || echo '$(srcdir)/'`lex.Error.cc +@am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/libparsers_la-lex.Error.Tpo $(DEPDIR)/libparsers_la-lex.Error.Plo +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='lex.Error.cc' object='libparsers_la-lex.Error.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libparsers_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libparsers_la-lex.Error.lo `test -f 'lex.Error.cc' || echo '$(srcdir)/'`lex.Error.cc + +libparsers_la-Error.tab.lo: Error.tab.cc +@am__fastdepCXX_TRUE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libparsers_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libparsers_la-Error.tab.lo -MD -MP -MF $(DEPDIR)/libparsers_la-Error.tab.Tpo -c -o libparsers_la-Error.tab.lo `test -f 'Error.tab.cc' || echo '$(srcdir)/'`Error.tab.cc +@am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/libparsers_la-Error.tab.Tpo $(DEPDIR)/libparsers_la-Error.tab.Plo +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='Error.tab.cc' object='libparsers_la-Error.tab.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libparsers_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libparsers_la-Error.tab.lo `test -f 'Error.tab.cc' || echo '$(srcdir)/'`Error.tab.cc + getdap-getdap.o: getdap.cc @am__fastdepCXX_TRUE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(getdap_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT getdap-getdap.o -MD -MP -MF $(DEPDIR)/getdap-getdap.Tpo -c -o getdap-getdap.o `test -f 'getdap.cc' || echo '$(srcdir)/'`getdap.cc @am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/getdap-getdap.Tpo $(DEPDIR)/getdap-getdap.Po @@ -1554,10 +1906,56 @@ distclean-libtool: -rm -f libtool config.lt +install-man1: $(man_MANS) + @$(NORMAL_INSTALL) + @list1=''; \ + list2='$(man_MANS)'; \ + test -n "$(man1dir)" \ + && test -n "`echo $$list1$$list2`" \ + || exit 0; \ + echo " $(MKDIR_P) '$(DESTDIR)$(man1dir)'"; \ + $(MKDIR_P) "$(DESTDIR)$(man1dir)" || exit 1; \ + { for i in $$list1; do echo "$$i"; done; \ + if test -n "$$list2"; then \ + for i in $$list2; do echo "$$i"; done \ + | sed -n '/\.1[a-z]*$$/p'; \ + fi; \ + } | while read p; do \ + if test -f $$p; then d=; else d="$(srcdir)/"; fi; \ + echo "$$d$$p"; echo "$$p"; \ + done | \ + sed -e 'n;s,.*/,,;p;h;s,.*\.,,;s,^[^1][0-9a-z]*$$,1,;x' \ + -e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,' | \ + sed 'N;N;s,\n, ,g' | { \ + list=; while read file base inst; do \ + if test "$$base" = "$$inst"; then list="$$list $$file"; else \ + echo " $(INSTALL_DATA) '$$file' '$(DESTDIR)$(man1dir)/$$inst'"; \ + $(INSTALL_DATA) "$$file" "$(DESTDIR)$(man1dir)/$$inst" || exit $$?; \ + fi; \ + done; \ + for i in $$list; do echo "$$i"; done | $(am__base_list) | \ + while read files; do \ + test -z "$$files" || { \ + echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(man1dir)'"; \ + $(INSTALL_DATA) $$files "$(DESTDIR)$(man1dir)" || exit $$?; }; \ + done; } + +uninstall-man1: + @$(NORMAL_UNINSTALL) + @list=''; test -n "$(man1dir)" || exit 0; \ + files=`{ for i in $$list; do echo "$$i"; done; \ + l2='$(man_MANS)'; for i in $$l2; do echo "$$i"; done | \ + sed -n '/\.1[a-z]*$$/p'; \ + } | sed -e 's,.*/,,;h;s,.*\.,,;s,^[^1][0-9a-z]*$$,1,;x' \ + -e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,'`; \ + dir='$(DESTDIR)$(man1dir)'; $(am__uninstall_files_from_dir) install-dist_aclocalDATA: $(dist_aclocal_DATA) @$(NORMAL_INSTALL) - test -z "$(aclocaldir)" || $(MKDIR_P) "$(DESTDIR)$(aclocaldir)" @list='$(dist_aclocal_DATA)'; test -n "$(aclocaldir)" || list=; \ + if test -n "$$list"; then \ + echo " $(MKDIR_P) '$(DESTDIR)$(aclocaldir)'"; \ + $(MKDIR_P) "$(DESTDIR)$(aclocaldir)" || exit 1; \ + fi; \ for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ echo "$$d$$p"; \ @@ -1571,13 +1969,14 @@ @$(NORMAL_UNINSTALL) @list='$(dist_aclocal_DATA)'; test -n "$(aclocaldir)" || list=; \ files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ - test -n "$$files" || exit 0; \ - echo " ( cd '$(DESTDIR)$(aclocaldir)' && rm -f" $$files ")"; \ - cd "$(DESTDIR)$(aclocaldir)" && rm -f $$files + dir='$(DESTDIR)$(aclocaldir)'; $(am__uninstall_files_from_dir) install-pkgconfigDATA: $(pkgconfig_DATA) @$(NORMAL_INSTALL) - test -z "$(pkgconfigdir)" || $(MKDIR_P) "$(DESTDIR)$(pkgconfigdir)" @list='$(pkgconfig_DATA)'; test -n "$(pkgconfigdir)" || list=; \ + if test -n "$$list"; then \ + echo " $(MKDIR_P) '$(DESTDIR)$(pkgconfigdir)'"; \ + $(MKDIR_P) "$(DESTDIR)$(pkgconfigdir)" || exit 1; \ + fi; \ for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ echo "$$d$$p"; \ @@ -1591,13 +1990,14 @@ @$(NORMAL_UNINSTALL) @list='$(pkgconfig_DATA)'; test -n "$(pkgconfigdir)" || list=; \ files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ - test -n "$$files" || exit 0; \ - echo " ( cd '$(DESTDIR)$(pkgconfigdir)' && rm -f" $$files ")"; \ - cd "$(DESTDIR)$(pkgconfigdir)" && rm -f $$files + dir='$(DESTDIR)$(pkgconfigdir)'; $(am__uninstall_files_from_dir) install-pkgincludeHEADERS: $(pkginclude_HEADERS) @$(NORMAL_INSTALL) - test -z "$(pkgincludedir)" || $(MKDIR_P) "$(DESTDIR)$(pkgincludedir)" @list='$(pkginclude_HEADERS)'; test -n "$(pkgincludedir)" || list=; \ + if test -n "$$list"; then \ + echo " $(MKDIR_P) '$(DESTDIR)$(pkgincludedir)'"; \ + $(MKDIR_P) "$(DESTDIR)$(pkgincludedir)" || exit 1; \ + fi; \ for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ echo "$$d$$p"; \ @@ -1611,18 +2011,16 @@ @$(NORMAL_UNINSTALL) @list='$(pkginclude_HEADERS)'; test -n "$(pkgincludedir)" || list=; \ files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ - test -n "$$files" || exit 0; \ - echo " ( cd '$(DESTDIR)$(pkgincludedir)' && rm -f" $$files ")"; \ - cd "$(DESTDIR)$(pkgincludedir)" && rm -f $$files + dir='$(DESTDIR)$(pkgincludedir)'; $(am__uninstall_files_from_dir) # This directory's subdirectories are mostly independent; you can cd -# into them and run `make' without going through this Makefile. -# To change the values of `make' variables: instead of editing Makefiles, -# (1) if the variable is set in `config.status', edit `config.status' -# (which will cause the Makefiles to be regenerated when you run `make'); -# (2) otherwise, pass the desired values on the `make' command line. +# into them and run 'make' without going through this Makefile. +# To change the values of 'make' variables: instead of editing Makefiles, +# (1) if the variable is set in 'config.status', edit 'config.status' +# (which will cause the Makefiles to be regenerated when you run 'make'); +# (2) otherwise, pass the desired values on the 'make' command line. $(RECURSIVE_TARGETS): - @failcom='exit 1'; \ + @fail= failcom='exit 1'; \ for f in x $$MAKEFLAGS; do \ case $$f in \ *=* | --[!k]*);; \ @@ -1647,7 +2045,7 @@ fi; test -z "$$fail" $(RECURSIVE_CLEAN_TARGETS): - @failcom='exit 1'; \ + @fail= failcom='exit 1'; \ for f in x $$MAKEFLAGS; do \ case $$f in \ *=* | --[!k]*);; \ @@ -1684,6 +2082,10 @@ list='$(SUBDIRS)'; for subdir in $$list; do \ test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \ done +cscopelist-recursive: + list='$(SUBDIRS)'; for subdir in $$list; do \ + test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) cscopelist); \ + done ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ @@ -1747,8 +2149,32 @@ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" +cscope: cscope.files + test ! -s cscope.files \ + || $(CSCOPE) -b -q $(AM_CSCOPEFLAGS) $(CSCOPEFLAGS) -i cscope.files $(CSCOPE_ARGS) + +clean-cscope: + -rm -f cscope.files + +cscope.files: clean-cscope cscopelist-recursive cscopelist + +cscopelist: cscopelist-recursive $(HEADERS) $(SOURCES) $(LISP) + list='$(SOURCES) $(HEADERS) $(LISP)'; \ + case "$(srcdir)" in \ + [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ + *) sdir=$(subdir)/$(srcdir) ;; \ + esac; \ + for i in $$list; do \ + if test -f "$$i"; then \ + echo "$(subdir)/$$i"; \ + else \ + echo "$$sdir/$$i"; \ + fi; \ + done >> $(top_builddir)/cscope.files + distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags + -rm -f cscope.out cscope.in.out cscope.po.out cscope.files distdir: $(DISTFILES) @case `sed 15q $(srcdir)/NEWS` in \ @@ -1757,6 +2183,19 @@ echo "NEWS not updated; not releasing" 1>&2; \ exit 1;; \ esac + @list='$(MANS)'; if test -n "$$list"; then \ + list=`for p in $$list; do \ + if test -f $$p; then d=; else d="$(srcdir)/"; fi; \ + if test -f "$$d$$p"; then echo "$$d$$p"; else :; fi; done`; \ + if test -n "$$list" && \ + grep 'ab help2man is required to generate this page' $$list >/dev/null; then \ + echo "error: found man pages containing the 'missing help2man' replacement text:" >&2; \ + grep -l 'ab help2man is required to generate this page' $$list | sed 's/^/ /' >&2; \ + echo " to fix them, install help2man, remove and regenerate the man pages;" >&2; \ + echo " typically 'make maintainer-clean' will remove them" >&2; \ + exit 1; \ + else :; fi; \ + else :; fi $(am__remove_distdir) test -d "$(distdir)" || mkdir "$(distdir)" @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ @@ -1790,13 +2229,10 @@ done @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ - test -d "$(distdir)/$$subdir" \ - || $(MKDIR_P) "$(distdir)/$$subdir" \ - || exit 1; \ - fi; \ - done - @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ - if test "$$subdir" = .; then :; else \ + $(am__make_dryrun) \ + || test -d "$(distdir)/$$subdir" \ + || $(MKDIR_P) "$(distdir)/$$subdir" \ + || exit 1; \ dir1=$$subdir; dir2="$(distdir)/$$subdir"; \ $(am__relativize); \ new_distdir=$$reldir; \ @@ -1820,43 +2256,44 @@ top_distdir="$(top_distdir)" distdir="$(distdir)" \ dist-hook -test -n "$(am__skip_mode_fix)" \ - || find "$(distdir)" -type d ! -perm -777 -exec chmod a+rwx {} \; -o \ + || find "$(distdir)" -type d ! -perm -755 \ + -exec chmod u+rwx,go+rx {} \; -o \ ! -type d ! -perm -444 -links 1 -exec chmod a+r {} \; -o \ ! -type d ! -perm -400 -exec chmod a+r {} \; -o \ ! -type d ! -perm -444 -exec $(install_sh) -c -m a+r {} {} \; \ || chmod -R a+r "$(distdir)" dist-gzip: distdir tardir=$(distdir) && $(am__tar) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz - $(am__remove_distdir) + $(am__post_remove_distdir) dist-bzip2: distdir - tardir=$(distdir) && $(am__tar) | bzip2 -9 -c >$(distdir).tar.bz2 - $(am__remove_distdir) + tardir=$(distdir) && $(am__tar) | BZIP2=$${BZIP2--9} bzip2 -c >$(distdir).tar.bz2 + $(am__post_remove_distdir) -dist-lzma: distdir - tardir=$(distdir) && $(am__tar) | lzma -9 -c >$(distdir).tar.lzma - $(am__remove_distdir) +dist-lzip: distdir + tardir=$(distdir) && $(am__tar) | lzip -c $${LZIP_OPT--9} >$(distdir).tar.lz + $(am__post_remove_distdir) dist-xz: distdir - tardir=$(distdir) && $(am__tar) | xz -c >$(distdir).tar.xz - $(am__remove_distdir) + tardir=$(distdir) && $(am__tar) | XZ_OPT=$${XZ_OPT--e} xz -c >$(distdir).tar.xz + $(am__post_remove_distdir) dist-tarZ: distdir tardir=$(distdir) && $(am__tar) | compress -c >$(distdir).tar.Z - $(am__remove_distdir) + $(am__post_remove_distdir) dist-shar: distdir shar $(distdir) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).shar.gz - $(am__remove_distdir) + $(am__post_remove_distdir) dist-zip: distdir -rm -f $(distdir).zip zip -rq $(distdir).zip $(distdir) - $(am__remove_distdir) + $(am__post_remove_distdir) -dist dist-all: distdir - tardir=$(distdir) && $(am__tar) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz - $(am__remove_distdir) +dist dist-all: + $(MAKE) $(AM_MAKEFLAGS) $(DIST_TARGETS) am__post_remove_distdir='@:' + $(am__post_remove_distdir) # This target untars the dist file and tries a VPATH configuration. Then # it guarantees that the distribution is self-contained by making another @@ -1864,17 +2301,17 @@ distcheck: dist case '$(DIST_ARCHIVES)' in \ *.tar.gz*) \ - GZIP=$(GZIP_ENV) gunzip -c $(distdir).tar.gz | $(am__untar) ;;\ + GZIP=$(GZIP_ENV) gzip -dc $(distdir).tar.gz | $(am__untar) ;;\ *.tar.bz2*) \ - bunzip2 -c $(distdir).tar.bz2 | $(am__untar) ;;\ - *.tar.lzma*) \ - unlzma -c $(distdir).tar.lzma | $(am__untar) ;;\ + bzip2 -dc $(distdir).tar.bz2 | $(am__untar) ;;\ + *.tar.lz*) \ + lzip -dc $(distdir).tar.lz | $(am__untar) ;;\ *.tar.xz*) \ xz -dc $(distdir).tar.xz | $(am__untar) ;;\ *.tar.Z*) \ uncompress -c $(distdir).tar.Z | $(am__untar) ;;\ *.shar.gz*) \ - GZIP=$(GZIP_ENV) gunzip -c $(distdir).shar.gz | unshar ;;\ + GZIP=$(GZIP_ENV) gzip -dc $(distdir).shar.gz | unshar ;;\ *.zip*) \ unzip $(distdir).zip ;;\ esac @@ -1888,6 +2325,7 @@ && am__cwd=`pwd` \ && $(am__cd) $(distdir)/_build \ && ../configure --srcdir=.. --prefix="$$dc_install_base" \ + $(AM_DISTCHECK_CONFIGURE_FLAGS) \ $(DISTCHECK_CONFIGURE_FLAGS) \ && $(MAKE) $(AM_MAKEFLAGS) \ && $(MAKE) $(AM_MAKEFLAGS) dvi \ @@ -1911,13 +2349,21 @@ && $(MAKE) $(AM_MAKEFLAGS) distcleancheck \ && cd "$$am__cwd" \ || exit 1 - $(am__remove_distdir) + $(am__post_remove_distdir) @(echo "$(distdir) archives ready for distribution: "; \ list='$(DIST_ARCHIVES)'; for i in $$list; do echo $$i; done) | \ sed -e 1h -e 1s/./=/g -e 1p -e 1x -e '$$p' -e '$$x' distuninstallcheck: - @$(am__cd) '$(distuninstallcheck_dir)' \ - && test `$(distuninstallcheck_listfiles) | wc -l` -le 1 \ + @test -n '$(distuninstallcheck_dir)' || { \ + echo 'ERROR: trying to run $@ with an empty' \ + '$$(distuninstallcheck_dir)' >&2; \ + exit 1; \ + }; \ + $(am__cd) '$(distuninstallcheck_dir)' || { \ + echo 'ERROR: cannot chdir into $(distuninstallcheck_dir)' >&2; \ + exit 1; \ + }; \ + test `$(am__distuninstallcheck_listfiles) | wc -l` -eq 0 \ || { echo "ERROR: files left after uninstall:" ; \ if test -n "$(DESTDIR)"; then \ echo " (check DESTDIR support)"; \ @@ -1936,14 +2382,14 @@ check-am: all-am check: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) check-recursive -all-am: Makefile $(LTLIBRARIES) $(PROGRAMS) $(SCRIPTS) $(DATA) \ +all-am: Makefile $(LTLIBRARIES) $(PROGRAMS) $(SCRIPTS) $(MANS) $(DATA) \ $(HEADERS) config.h dods-datatypes-config.h \ xdr-datatypes-config.h install-binPROGRAMS: install-libLTLIBRARIES installdirs: installdirs-recursive installdirs-am: - for dir in "$(DESTDIR)$(libdir)" "$(DESTDIR)$(bindir)" "$(DESTDIR)$(bindir)" "$(DESTDIR)$(aclocaldir)" "$(DESTDIR)$(pkgconfigdir)" "$(DESTDIR)$(pkgincludedir)"; do \ + for dir in "$(DESTDIR)$(libdir)" "$(DESTDIR)$(bindir)" "$(DESTDIR)$(bindir)" "$(DESTDIR)$(man1dir)" "$(DESTDIR)$(aclocaldir)" "$(DESTDIR)$(pkgconfigdir)" "$(DESTDIR)$(pkgincludedir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done install: $(BUILT_SOURCES) @@ -1957,10 +2403,15 @@ installcheck: installcheck-recursive install-strip: - $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ - install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ - `test -z '$(STRIP)' || \ - echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install + if test -z '$(STRIP)'; then \ + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + install; \ + else \ + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ + fi mostlyclean-generic: clean-generic: @@ -1998,8 +2449,8 @@ info-am: -install-data-am: install-dist_aclocalDATA install-pkgconfigDATA \ - install-pkgincludeHEADERS +install-data-am: install-dist_aclocalDATA install-man \ + install-pkgconfigDATA install-pkgincludeHEADERS install-dvi: install-dvi-recursive @@ -2016,7 +2467,7 @@ install-info-am: -install-man: +install-man: install-man1 install-pdf: install-pdf-recursive @@ -2050,26 +2501,30 @@ uninstall-am: uninstall-binPROGRAMS uninstall-binSCRIPTS \ uninstall-dist_aclocalDATA uninstall-libLTLIBRARIES \ - uninstall-pkgconfigDATA uninstall-pkgincludeHEADERS + uninstall-man uninstall-pkgconfigDATA \ + uninstall-pkgincludeHEADERS + +uninstall-man: uninstall-man1 .MAKE: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) all check \ - ctags-recursive install install-am install-strip \ - tags-recursive + cscopelist-recursive ctags-recursive install install-am \ + install-strip tags-recursive .PHONY: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) CTAGS GTAGS \ all all-am am--refresh check check-am clean clean-binPROGRAMS \ - clean-generic clean-libLTLIBRARIES clean-libtool \ - clean-noinstLTLIBRARIES ctags ctags-recursive dist dist-all \ - dist-bzip2 dist-gzip dist-hook dist-lzma dist-shar dist-tarZ \ - dist-xz dist-zip distcheck distclean distclean-compile \ - distclean-generic distclean-hdr distclean-libtool \ - distclean-tags distcleancheck distdir distuninstallcheck dvi \ - dvi-am html html-am info info-am install install-am \ - install-binPROGRAMS install-binSCRIPTS install-data \ - install-data-am install-dist_aclocalDATA install-dvi \ - install-dvi-am install-exec install-exec-am install-html \ - install-html-am install-info install-info-am \ - install-libLTLIBRARIES install-man install-pdf install-pdf-am \ + clean-cscope clean-generic clean-libLTLIBRARIES clean-libtool \ + clean-noinstLTLIBRARIES cscope cscopelist cscopelist-recursive \ + ctags ctags-recursive dist dist-all dist-bzip2 dist-gzip \ + dist-hook dist-lzip dist-shar dist-tarZ dist-xz dist-zip \ + distcheck distclean distclean-compile distclean-generic \ + distclean-hdr distclean-libtool distclean-tags distcleancheck \ + distdir distuninstallcheck dvi dvi-am html html-am info \ + info-am install install-am install-binPROGRAMS \ + install-binSCRIPTS install-data install-data-am \ + install-dist_aclocalDATA install-dvi install-dvi-am \ + install-exec install-exec-am install-html install-html-am \ + install-info install-info-am install-libLTLIBRARIES \ + install-man install-man1 install-pdf install-pdf-am \ install-pkgconfigDATA install-pkgincludeHEADERS install-ps \ install-ps-am install-strip installcheck installcheck-am \ installdirs installdirs-am maintainer-clean \ @@ -2078,16 +2533,18 @@ tags tags-recursive uninstall uninstall-am \ uninstall-binPROGRAMS uninstall-binSCRIPTS \ uninstall-dist_aclocalDATA uninstall-libLTLIBRARIES \ - uninstall-pkgconfigDATA uninstall-pkgincludeHEADERS + uninstall-man uninstall-man1 uninstall-pkgconfigDATA \ + uninstall-pkgincludeHEADERS +%.1: %.man1 + groff -t -e -mandoc -Tascii $< | col -bx > $@ + # Not nearly as clean as it could be, but this removes .svn directories # in subdirs. dist-hook: rm -rf `find $(distdir) -name .svn` -# MAINTAINERCLEANFILES = $(GRAM_SRC) - # Copy the generated grammar files to the 'grammarfiles' directory. .PHONY: grammarfiles grammarfiles: $(GRAM_SRC) @@ -2109,16 +2566,15 @@ ########################################################################### # Fortify targets. -# dods-datatypes.h xdr-datatypes.h .PHONY: fortify fortify: $(BUILT_SOURCES) - (cd gl && sourceanalyzer -b @PACKAGE@-gl $(MAKE) ) - sourceanalyzer -b @PACKAGE@-parsers $(MAKE) libparsers.la - sourceanalyzer -b @PACKAGE@ $(MAKE) libdap.la libdapserver.la libdapclient.la + (cd gl && sourceanalyzer -b @PACKAGE@-gl $(MAKE) $(MFLAGS) ) + sourceanalyzer -b @PACKAGE@-parsers $(MAKE) $(MFLAGS) libparsers.la + sourceanalyzer -b @PACKAGE@ $(MAKE) $(MFLAGS) libdap.la libdapserver.la libdapclient.la sourceanalyzer -b @PACKAGE@ -scan -f @PACKAGE@-@PACKAGE_VERSION@.fpr # run fortify on only our code, not the gnulib code or the flex/bison code. -# This does skip testing some of the functions we wrote in the *.lex/*.y +# This does skip testing some of the functions we wrote in the *.lex/*.yy # files but should eliminate the false positives from flex and bison, too. .PHONY: fortify-lite fortify-lite: dods-datatypes.h xdr-datatypes.h @@ -2127,6 +2583,10 @@ sourceanalyzer -b @PACKAGE@ $(MAKE) libdap.la libdapserver.la libdapclient.la sourceanalyzer -b @PACKAGE@ -scan -f @PACKAGE@-@PACKAGE_VERSION@.fpr +# No longer used? jhrg 1/29/13 +#grammar_objects = lex.das.o das.tab.o lex.dds.o dds.tab.o lex.ce_expr.o \ +#ce_expr.tab.o lex.gse_.o gse.tab.o lex.Error.o Error.tab.o + # Use this to clean the fortify project. .PHONY: fortifyclean fortifyclean: @@ -2155,7 +2615,7 @@ pkg-main: pkg-build ./OSX_Resources/update_mac_package_contents.pl README cat ./OSX_Resources/Info.plist.proto | \ - sed -e "s^_PREFIX_^$(prefix)^g" \ + sed -e "s^_PREFIX_^/usr/local/servers/hyrax-1.8.8^g" \ -e "s^_FULL_VERSION_^@PACKAGE_VERSION@^g" \ -e "s^_MAJOR_VERSION_^@PACKAGE_MAJOR_VERSION@^g" \ -e "s^_MINOR_VERSION_^@PACKAGE_MINOR_VERSION@^g" \ @@ -2165,6 +2625,8 @@ --title "@PACKAGE@ @PACKAGE_VERSION@" --version @PACKAGE_VERSION@ \ --out @PACKAGE@-@PACKAGE_VERSION@.pkg --resources OSX_Resources +# sed -e "s^_PREFIX_^$(prefix)^g" + pkg-dmg: pkg-main -rm -rf @PACKAGE@-@PACKAGE_VERSION@ -rm -rf @PACKAGE@-@PACKAGE_VERSION@.dmg @@ -2197,6 +2659,7 @@ xdr-datatypes.h: xdr-datatypes-config.h cp -p $< xdr-datatypes.h +# ResponseBuilder.h ResponseCache.h ############################################################################ # Special rules for the grammars. I tried to use the automake grammar support @@ -2208,49 +2671,34 @@ # Build the DAS scanner and parser lex.das.cc: das.lex das.tab.cc das.tab.hh - $(LEX) $(LFLAGS) $(AM_LFLAGS) $< + $(LEX) $(LFLAGS) $< -# The funny if statment accommodates older versions of bison that treats -# -o differently than the 2.x versions. jhrg 3/2/08 -das.tab.cc das.tab.hh: das.y DAS.h - $(YACC) $(YFLAGS) $(AM_YFLAGS) -p das -o das.tab.cc $< - if test -e das.tab.cc.h; then mv das.tab.cc.h das.tab.hh; fi +das.tab.cc das.tab.hh: das.yy DAS.h + $(YACC) $(YFLAGS) $< # DDS lex.dds.cc: dds.lex dds.tab.cc dds.tab.hh - $(LEX) $(LFLAGS) $(AM_LFLAGS) $< + $(LEX) $(LFLAGS) $< -dds.tab.cc dds.tab.hh: dds.y - $(YACC) $(YFLAGS) $(AM_YFLAGS) -p dds -o dds.tab.cc $< - if test -e dds.tab.cc.h; then mv dds.tab.cc.h dds.tab.hh; fi +dds.tab.cc dds.tab.hh: dds.yy + $(YACC) $(YFLAGS) $< # CE lex.ce_expr.cc: ce_expr.lex ce_expr.tab.cc ce_expr.tab.hh - $(LEX) $(LFLAGS) $(AM_LFLAGS) $< - -ce_expr.tab.cc ce_expr.tab.hh: ce_expr.y - $(YACC) $(YFLAGS) $(AM_YFLAGS) -p ce_expr -o ce_expr.tab.cc $< - if test -e ce_expr.tab.cc.h; then mv ce_expr.tab.cc.h ce_expr.tab.hh; fi - -# Build the grid selection sub_expression scanner and parser - -lex.gse_.cc: gse.lex gse.tab.cc gse.tab.hh - $(LEX) $(LFLAGS) $(AM_LFLAGS) $< + $(LEX) $(LFLAGS) $< -gse.tab.cc gse.tab.hh: gse.y - $(YACC) $(YFLAGS) $(AM_YFLAGS) -p gse_ -o gse.tab.cc $< - if test -e gse.tab.cc.h; then mv gse.tab.cc.h gse.tab.hh; fi +ce_expr.tab.cc ce_expr.tab.hh: ce_expr.yy + $(YACC) $(YFLAGS) $< # Errors lex.Error.cc: Error.lex Error.tab.cc Error.tab.hh - $(LEX) $(LFLAGS) $(AM_LFLAGS) $< + $(LEX) $(LFLAGS) $< -Error.tab.cc Error.tab.hh: Error.y - $(YACC) $(YFLAGS) $(AM_YFLAGS) -p Error -o Error.tab.cc $< - if test -e Error.tab.cc.h; then mv Error.tab.cc.h Error.tab.hh; fi +Error.tab.cc Error.tab.hh: Error.yy + $(YACC) $(YFLAGS) $< # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. diff -Nru libdap-3.11.1/Marshaller.h libdap-3.12.0/Marshaller.h --- libdap-3.11.1/Marshaller.h 2011-04-29 13:19:43.000000000 +0000 +++ libdap-3.12.0/Marshaller.h 2013-10-17 21:27:40.000000000 +0000 @@ -20,7 +20,7 @@ // // You should have received a copy of the GNU Lesser General Public // License along with this library; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA // // You can contact OPeNDAP, Inc. at PO Box 112, Saunderstown, RI. 02874-0112. diff -Nru libdap-3.11.1/NEWS libdap-3.12.0/NEWS --- libdap-3.11.1/NEWS 2011-04-29 13:19:43.000000000 +0000 +++ libdap-3.12.0/NEWS 2013-10-17 21:27:40.000000000 +0000 @@ -1,6 +1,70 @@ -News for version 3.11.1 +News for version 3.12.0 + +Moved server functions out of libdap; they are now stored in a BES module. + +Added support for building large (constant) arrays to be used in +server functions. The arrays are defined using a new special form that +the ConstraintEvaluator class supports. The server side functions are +now in their own BES module (built as part of the BES for now) and +it's possible to name the constant arrays. Arrays of 1 million +elements can be made in a fraction of a second (although it will take +longer to send the constraint to the server). See the README file for +more details. + +News for version 3.11.7 + +Bug fix for the server function caching code. Now if the function +cache directory /tmp/dap_functions_cache exists, it will be used to +cache the results of applying server functions. If the directory does +not exist, then the function results won't be cached - a minor +performance penalty in most cases. + +The size of the cache is set to 20GB. The size and location of the +cache are fixed for this version of libdap but they will move into +the bes.conf file as parameters in a future version of the server. + +News for version 3.11.6 + +Changes to the way constraints are evaluated when they contain server +functions. Now DAS and DDS objects can be returned from requests that +include those constraints. The server function call results are +cached, so that sending the same function calls several times will not +evaluate those functions more than once. + +News for version 3.11.5 + +Fixed a memory leak in XDRStreamMarshaller and a bug in +DDS::add_var_nocopy(). -The new DAP3.3 Keywords are supported by the library. +News for version 3.11.4 + +Merged to trunk; tagged. + +News for version 3.11.3 + +Changed the return value for dap-config --libs so that it does not contain +the curl static libs. This causes problems whenlinking on CentOS 6 in some +cases. + +News for version 3.11.2 + +The new DAP3.3 Keywords are supported by the library. These are sort +of a hidden feature of DAP4 that might not be used. + +There are many bug fixes in this update; check the ChangeLog or Trac. +Two notable fixes: + +* The way attributes are encoded has changed subtly so that now only + spaces are escaped. This fixes a problem with our XML and RDF + responses. + +* The XML output (i.e., the DDX) is now built using an XML library, so + any encoding issues are its fault ;-) But, in a pragmatic sense, + this has greatly simplified the library and sets the stage for + further simplification of the methods that build responses. The + behavior of those methods has not changed. + +News for version 3.11.1 Merge of the Hyrax 3.6.2 fixes. diff -Nru libdap-3.11.1/OSX_Resources/Info.plist libdap-3.12.0/OSX_Resources/Info.plist --- libdap-3.11.1/OSX_Resources/Info.plist 2011-05-06 17:52:44.000000000 +0000 +++ libdap-3.12.0/OSX_Resources/Info.plist 1970-01-01 00:00:00.000000000 +0000 @@ -1,46 +0,0 @@ - - - - - CFBundleGetInfoString - 3.11.1, OPeNDAP libdap - CFBundleIdentifier - org.opendap.libdap - CFBundleShortVersionString - 3.11.1 - IFMajorVersion - 3 - IFMinorVersion - 11 - IFPkgFlagAllowBackRev - - IFPkgFlagAuthorizationAction - RootAuthorization - IFPkgFlagBackgroundAlignment - topleft - IFPkgFlagBackgroundScaling - none - IFPkgFlagDefaultLocation - /usr/local/opendap/servers/hyrax-1.7.0 - IFPkgFlagFollowLinks - - IFPkgFlagInstallFat - - IFPkgFlagInstalledSize - 10000 - IFPkgFlagIsRequired - - IFPkgFlagOverwritePermissions - - IFPkgFlagRelocatable - - IFPkgFlagRestartAction - NoRestart - IFPkgFlagRootVolumeOnly - - IFPkgFlagUpdateInstalledLanguages - - IFPkgFormatVersion - 0.10000000149011612 - - diff -Nru libdap-3.11.1/OSX_Resources/ReadMe.txt libdap-3.12.0/OSX_Resources/ReadMe.txt --- libdap-3.11.1/OSX_Resources/ReadMe.txt 2011-05-06 17:52:44.000000000 +0000 +++ libdap-3.12.0/OSX_Resources/ReadMe.txt 1970-01-01 00:00:00.000000000 +0000 @@ -1,237 +0,0 @@ -Updated for version 3.11.1 - -Bug fixes only. - -Updated for version 3.11.0 - -Now constraint expressions can have multiple function calls that return data. - -I've bumped up the DAP version from 3.3 to 3.4 to reflect this change. - -Updated for Version 3.10.2 - -BaseType::transfer_attributes() and related methods provide a way forhandlers to customize how attributes from a DAS object are merged intoa DDS. - -In the past we supported a kind of client-side system that could augmentthe attributes call the 'AIS' (Ancillary Information System). This hasbeen removed - our server now supports the NcML language to do much the samething but in a way that can be set on the server once for all users. It's alsoan emerging convention that's gaining wide support within the community. - -Updated for Version 3.10.0 - -DAP 3.3 is now supported; see http://docs.opendap.org/index.php/DAP3/4. - -This version of libdap contains many changes that are needed for bothDAP 4 and the NcML handler. This version of the library is requiredfor the Hyrax 1.6 handlers. - -The 'deflate' program is no longer part of this library package sincewe are no longer supporting the old data server system (based on WWW'sCGI specification). - -Updated for version 3.9.2 - -Now libdap supports DAP 3.2. You can read about the evolving DAP 3.x protocolat http://docs.opendap.org/index.php/DAP3/4. If your client sends theXDAP-Accept header with a value of 3.2 the DDX is different (it includesprotocol information and also an xmlbase element). - -Behavior change for the DAS: In the past the format handlers added doublequotes to the values of string attributes when they added those values to theAttrTable object. This meant that the value of the attribute in the C++object was actually not correct since it contained quotes not found in theoriginal attribute value. I modified libdap so that if an attribute value inthe C++ AttrTable object does not have quotes then those quotes are addedwhen the value is output in a DAS response (but not a DDX since there's noneed to quote the value in that response). This ensures that the text in theDAS wire representation will parse whether a handler has added quotes or not(paving the way for fixed handlers). At the same time I fixed all of ourhandlers so that they no longer add the erroneous quotes. This fixes aproblem with the DDX where the quotes were showing up as part of theattribute value. The change to libdap is such that a broken handler will notbe any more broken but a fixed handler will work for both DAS and DDXgeneration. - -If you have a handler and it's not adding quotes to the String attribute values - good, don't change that! If your handler does add quotes, pleasemodify it so the DDX will be correct. - -Our handler's old, broken, behavior can be resurrected by removing the ATTR_STRING_QUOTE FIX define in the appropriate files. - -Updated for version 3.8.2 (23 June 2008) - -HTTP Cache and win32 installer fixes (the latter are actually in the 3.8.1installer for winXP). API change: The functions used to merge ancillary datahave been moved to their own class (Ancillary). - -Updated for version 3.8.1 (10 June 2008) - -The syntax for PROXY_SERVER in the .dodsrc file was relaxed. See the .dodsrcfile for more information. - -Updated for Version 3.8.0 (29 February 2008) - -The libdap classes and code are now inside of the libdap namespace. In orderto access any of the classes, for example, you will need to do one of thefollowing. After including the libdap headers you can: - -1. add a using statement for the entire libdap namespace: - -using namespace libdap ; - -2. add a using statement for the classes that you will be using: - -using libdap::DAS ; - -3. inside your code scope the use of libdap classes. - -libdap::DAS *das = code_to_get_das() ; - -Added method to HTTPCache to return not only the FILE pointer of a cachedresponse but also the name of the file in the cache, to allow for this filename to be passed to data handlers in the BES to be read. - -See NEWS for more information about changes for this version and ChangeLogfor the gory details. - -Updated for Version 3.7.10 (28 November 2007) - -A bug fix release. See NEWS. - -Updated for Version 3.7.9 (13 November 2007) - -This release is a bug fix and refactoring release. Old classes which were nolonger used have been removed, the FILE* output methods are slated to bereplaced with ones which will use iostream and will support a chuckedtransfer 'Marshaller,' and the transfer_data() methods have been made aformal part of the library, implemented for all classes, fixed and renamed tointern_data(). Many bugs in the library were also fixed. - -Updated for version 3.7.8 (26 June 2007) - -The major fixes in this version are memory errors found and fixed in theRegex class and HTTP header processing software. This version also supportspkg-config on hosts that have that installed. - -See NEWS for more information about changes for this version and ChangeLogfor the gory details. - -Notes for version 3.7.7 (2 May 2007) - -The major fix here is to the source build. We've fixed the issue where sourcebuilds failed to make the dapserver and dapclient libraries. - -Notes for version 3.7.6 (12 March 2007) - -Two bug fixes, both minor. Problems in the linear_scale() constraintexpression function and a bad/missing #include in GNURegex.h were fixed. - -There was an error in the INSTALL file sent out in the previous release. Itsaid this library implemented DAP version 3.2, but in fact it implementsversion 3.1. The version 3.2 release will be along soon (RSN). - -Notes for version 3.7.5 (7 Feb 2007) - -This version includes many fixes from the first Server4 beta releaseplus fixes for the server-side functions. It also includes a smootherWin32 build. - -Notes for version 3.7.4 (2 Jan 2007) - -Release for the Server4 beta release. - -Notes for version 3.7.3 (24 Nov 2006) - -This version of libdap contains a beta release of the server-side functionsgeogrid(), geoarray(), linear_scale() and version(). These can be used toselect parts of Grids and Arrays using latitude and longitude values insteadof array position indexes. The linear_scale() function can be used to scalevariables (including those return by other function) using 'y = mx + b'. Theversion() function can be used to find out which versions of the functions areinstalled. - -EXAMPLES - -To get version information use the 'version()' function. Currently, version()can only be called when asking for data, and you must give the name of a datasource, although in the default version of version() the data source is notused. The version function takes one optional argument which may be the strings'help' or 'xml'. Use 'help' to get help on using the function; use 'xml' to getversion information encoded using XML instead of plain text: - -[jimg@zoe libdap]$ url=http://test.opendap.org/dap/data/nc/coads_climatology.nc -[jimg@zoe libdap]$ ./getdap -D "$url?version()" -The data: -String version = "Function set: version 1.0, grid 1.0, geogrid 1.0b2, - geoarray 0.9b1, linear_scale 1.0b1"; - -[jimg@zoe libdap]$ ./getdap -D "$url?version(help)" -The data: -String version = "Usage: version() returns plain text information about ... - -[jimg@zoe libdap]$ ./getdap -D "$url?version(xml)" -The data: -String version = " - - - - - - - "; - -The geogrid function can only be used with variables that are Grids: - -[jimg@zoe libdap]$ getdap -d "$url" -Dataset { - Float64 COADSX[COADSX = 180]; - Float64 COADSY[COADSY = 90]; - Float64 TIME[TIME = 12]; - Grid { - Array: - Float32 SST[TIME = 12][COADSY = 90][COADSX = 180]; - Maps: - Float64 TIME[TIME = 12]; - Float64 COADSY[COADSY = 90]; - Float64 COADSX[COADSX = 180]; - } SST; - Grid { - . - . - . - - -Pass the name of the Grid variable and the upper-left and lower-right corners of the lat/lon rectangle to geogrid. Optionally, pass one or more relationalexpressions to select parts of dimensions that are not lat/lon. - -Note: in libdap 3.7.3 calling geogrid with a constraint on each dimensionmay return incorrect values that indicate missing data even though data shouldhave been returned. - -[jimg@zoe libdap]$ getdap -D "$url?geogrid(SST,30,-60,20,-60,\"TIME=366\")" -The data: -Grid { - Array: - Float32 SST[TIME = 1][COADSY = 7][COADSX = 2]; - Maps: - Float64 TIME[TIME = 1]; - Float64 COADSY[COADSY = 7]; - Float64 COADSX[COADSX = 2]; -} SST = { Array: {{{24.4364, 25.0923},{23.7465, 24.4146},{19.843, 23.6033}, -{16.8464, 17.7756},{16.65, 16.818},{-1e+34, 15.3656},{18.7214, 13.1286}}} -Maps: {366}, {19, 21, 23, 25, 27, 29, 31}, {-61, -59} }; - - -The geoarray() function works like geogrid() except that it's used to selectfrom an Array variable and not a Grid. In addition to the four lat/lon valuesfor selection rectangle, the caller must supply the data's corner points. A subsequent release of libdap will include a version that reads the data extentfrom the data source when possible so caller's won't normally have to know thedata's extent ahead of time. - -The linear_scale() function take either one or three arguments. The first(only) argument is the name of a variable or the return from anotherfunction. This variable will be scaled using the 'y = mx + b' equation where'x' is the value(s) of the input variable and 'm' and 'b' are read from thedata source using the values of attributes name 'scale_factor' and'add_offset.' If these are not present, or to over ride their values, m and bcan be supplied using the second and third arguments. - -Note that there are still some problems with linear_scale() in this release. - -See NEWS and ChangeLog for information about other changes - -Notes for version 3.7.2 - -This version of libdap is required for the 9/15/06 alpha release of Server4.The library now contains software which enables Server4 to build the ASCIIdata response for all types of variables, including Sequence and nestedSequence variables. These features are additions to the API, so older codewill work just fine with the new library. See NEWS for more specific infoabout bug fixes. - -Notes for version 3.7.1 - -This is a bug fix release (mostly) made for users of the netcdf clientlibrary who need a fix for a problem dealing with attributes from the HDF4server. - -NOTES for version 3.7.0 - -This version includes new features and an implementation change. - -This version of libdap now returns the DAP protocol version number, 3.1, inan HTTP response header. Use this to determine which protocol version thelibrary implements. The inclusion of a protocol version number is the soleofficial new feature of DAP 3.1. Use Connect::get_protocol() to get theversion number. Clients can use this to determine the features supported by aserver. The Connect::get_version() method can still be used to get ourserver's implementation version. The distinction is that as more groupsprovide their own implementations of the DAP, the protocol version willprovide a way for clients to determine capabilities independently ofimplementation. - -The libdap library now contains an implementation of the DDX object/response,although this is an alpha implementation and it's actually been part of thelibrary for some time now. The implementation contained in this version ofthe library is close enough to the version we intend for DAP4 that developerscan start to use it. Most of the server handlers will return DDXs when asked. - -The DDX combines the information previously held by the DDS and DAS objects,making it much easier to associate attributes to variables. As the namesuggests, the DDX uses XML rather than curly-braces. You can drop the DDXinto your favorite XML parser and get a DOM tree; no need to use our parsers.However, libdap contains a nice SAX parser that will build the libdap objectsdirectly from the XML DDX object/response. Also included in libdap aremethods to build a DDX using a DDS and DAS, so there's an easy migration pathfor both servers and clients. - -Finally, the library contains two structural changes. First, the librarynamed 'libdap' now holds the DAP implementation while two new libraries,'libdapclient' and 'libdapserver', now hold the client and server helperclasses which are not strictly part of the DAP. Secondly, the DDS/DDX objectnow takes the constraint evaluator as a parameter. The classConstraintEvaluator holds our default evaluator, but it's now possible to useyour own evaluator . - -NOTES for version 3.6.1 - -Version 3.6.1 is bug fix release. - -NOTES for version 3.6.0 - -This version of the library may not work older source code. Many of the deprecated methods have been removed. - -Added are headers which send information about the version of the DAP protocolthat the library implements (in contrast to the implementation of the libraryitself). A new header named XOPeNDAP-Server is used to send information aboutthe implementation of servers. - -The libtool interface version has been incremented from 3 to 4 (these versionsdo no track the software's release version since several releases might present compatible binary interfaces). - -NOTES for version 3.5.3 - -This version of libdap++ cannot be used to build the 3.4.x and previousclients and/or servers. However, client and servers built using this code_will_ work with the older clients and servers. - -WHAT'S IN THIS DIRECTORY? - -This directory contains the OPeNDAP C++ implementation of the DataAccess Protocol version 2 (DAP2) with some extensions that will bepart of DAP3. Documentation for this software can be found on theOPeNDAP home page at http://www.opendap.org/. The NASA/ESE RFC whichdescribes DAP2, implemented by the library, can be found athttp://spg.gsfc.nasa.gov/rfc/004/. - -The DAP2 is used to provide a uniform way of accessing a variety ofdifferent types of data across the Internet. It was originally part ofthe DODS and then NVODS projects. The focus of those projects wasaccess to Earth-Science data, so much of the software developed usingthe DAP2 to date has centered on that discipline. However, the DAP2data model is very general (and similar to a modern structuredprogramming language) so it can be applied to a wide variety offields. - -The DAP2 is implemented as a set of C++ classes that can be used tobuild data servers and clients. The classes may be specialized tomimic the behavior of other data access APIs, such as netCDF. In thisway, programs originally meant to work with local data in thoseformats can be re-linked and equipped to work with data storedremotely in many different formats. The classes can also byspecialized to build standalone client programs. - -The DAP2 is contained in a single library: libdap++.a. Also includedin the library are classes and utility functions which simplifybuilding clients and servers. - -WHAT ELSE IS THERE? - -The file README.dodsrc describes the client-side behavior which can becontrolled using the .dodsrc file. This includes client-side caching,proxy servers, et c., and is described in a separate file so it's easyto include in your clients. - -The file README.AIS describes the prototype Ancillary InformationService (AIS) included in this version of the library. The AIS is(currently) a client-side capability which provides a way to augmentDAP attributes. This is a very useful feature because it can be usedto add missing metadata to a data source. The AIS is accessed by usingthe AISConnect class in place of Connect in your client. - -This directory also contains test programs for the DAP2, a samplespecialization of the classes, getdap (a useful command-line webclient created with DAP2) and dap-config (a utility script to simplifylinking with libdap.a). Also included as of version 3.5.2 islibdap.m4, an autoconf macro which developers can use along withautoconf to test for libdap. This macro will be installed in${prefix}/share/aclocal and can be by any package which uses autoconffor its builds. See the file for more information. - -We also have Java and C versions of the DAP2 library whichinter-operate with software which uses this library. In other words,client programs built with the Java DAP2 implementation cancommunicate with servers built with this (C++) implementation of theDAP2. The C DAP2 library, called the Ocapi, only implements theclient-side part of the protocol. Clients written using the Ocapi areinteroperable with both the Java and C++ DAP2 libraries. Note that theOcapi is in early beta and available only from CVS at this time (5 May2005). - -THREAD SAFETY - -We don't need to do this since the STL is also not thread safe. Usersof libdap have to be sure that multiple threads never makesimultaneous and/or overlapping calls to a single copy of libdap. Ifseveral threads are part of a program and each will make calls tolibdap, either those threads must synchronize their calls or arrangeto each use their own copy of libdap. Some aspects of the library''are'' thread-safe: the singleton classes are all protected as is theHTTP cache (which uses the local file system). - -INSTALLATION INSTRUCTIONS - -See the file INSTALL in this directory for information on building thelibrary and the geturl client. - -COPYRIGHT INFORMATION - -The OPeNDAP DAP library is copyrighted using the GNU Lesser GPL. Seethe file COPYING or contact the Free Software Foundation, Inc., at 59Temple Place, Suite 330, Boston, MA 02111-1307 USA. Older versions ofthe DAP were copyrighted by the University of Rhode Island andMassachusetts Institute of Technology; see the file COPYRIGHT_URI. Thefile deflate.c is also covered by COPYRIGHT_W3C. \ No newline at end of file diff -Nru libdap-3.11.1/ObjectType.h libdap-3.12.0/ObjectType.h --- libdap-3.11.1/ObjectType.h 2011-04-29 13:19:43.000000000 +0000 +++ libdap-3.12.0/ObjectType.h 2013-10-17 21:27:40.000000000 +0000 @@ -19,7 +19,7 @@ // // You should have received a copy of the GNU Lesser General Public // License along with this library; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA // // You can contact OPeNDAP, Inc. at PO Box 112, Saunderstown, RI. 02874-0112. diff -Nru libdap-3.11.1/Operators.h libdap-3.12.0/Operators.h --- libdap-3.11.1/Operators.h 2011-04-29 13:19:43.000000000 +0000 +++ libdap-3.12.0/Operators.h 2013-10-17 21:27:40.000000000 +0000 @@ -1,4 +1,3 @@ - // -*- mode: c++; c-basic-offset:4 -*- // This file is part of libdap, A C++ implementation of the OPeNDAP Data @@ -19,7 +18,7 @@ // // You should have received a copy of the GNU Lesser General Public // License along with this library; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA // // You can contact OPeNDAP, Inc. at PO Box 112, Saunderstown, RI. 02874-0112. @@ -36,238 +35,143 @@ #ifndef _operators_h #define _operators_h - #include "GNURegex.h" // GNU Regex class used for string =~ op. #include "parser.h" // for ID_MAX #include "ce_expr.tab.hh" using namespace std; -namespace libdap -{ - -inline unsigned -dods_max(int i1, int i2) -{ - return (unsigned)((i1 > i2) ? i1 : i2); -} +namespace libdap { /** Compare two numerical types, both of which are either signed or unsigned. - This class is one implementation of the comparison policy used by - rops. + This class is one implementation of the comparison policy used by + rops. - @see rops - @see USCmp - @see SUCmp */ -template class Cmp + @see rops + @see USCmp + @see SUCmp */ +template +bool Cmp(int op, T1 v1, T2 v2) { -public: - static bool eq(T1 v1, T2 v2) - { - return v1 == v2; - } - static bool ne(T1 v1, T2 v2) - { - return v1 != v2; - } - static bool gr(T1 v1, T2 v2) - { - return v1 > v2; - } - static bool ge(T1 v1, T2 v2) - { - return v1 >= v2; - } - static bool lt(T1 v1, T2 v2) - { - return v1 < v2; - } - static bool le(T1 v1, T2 v2) - { - return v1 <= v2; - } - static bool re(T1, T2) - { - cerr << "Illegal operation" << endl; - return false; + switch (op) { + case SCAN_EQUAL: + return v1 == v2; + case SCAN_NOT_EQUAL: + return v1 != v2; + case SCAN_GREATER: + return v1 > v2; + case SCAN_GREATER_EQL: + return v1 >= v2; + case SCAN_LESS: + return v1 < v2; + case SCAN_LESS_EQL: + return v1 <= v2; + case SCAN_REGEXP: + throw Error("Regular expressions are supported for strings only."); + default: + throw Error("Unrecognized operator."); } -}; +} + +template +static inline unsigned long long dap_floor_zero(T i) +{ + return (unsigned long long) ((i < 0) ? 0 : i); +} /** Compare two numerical types, the first one unsigned and the second - signed. If the signed argument is negative, zero is used in the - comparison. This class is one implementation of the comparison policy - used by rops. - - @see rops - @see SUCmp - @see Cmp */ -template class USCmp + signed. If the signed argument is negative, zero is used in the + comparison. This class is one implementation of the comparison policy + used by rops. + + @see rops + @see SUCmp + @see Cmp */ +template +bool USCmp(int op, UT1 v1, T2 v2) { -public: - static bool eq(UT1 v1, T2 v2) - { - return v1 == dods_max(0, v2); - } - static bool ne(UT1 v1, T2 v2) - { - return v1 != dods_max(0, v2); - } - static bool gr(UT1 v1, T2 v2) - { - return v1 > dods_max(0, v2); - } - static bool ge(UT1 v1, T2 v2) - { - return v1 >= dods_max(0, v2); - } - static bool lt(UT1 v1, T2 v2) - { - return v1 < dods_max(0, v2); - } - static bool le(UT1 v1, T2 v2) - { - return v1 <= dods_max(0, v2); - } - static bool re(UT1, T2) - { - cerr << "Illegal operation" << endl; - return false; + switch (op) { + case SCAN_EQUAL: + return v1 == dap_floor_zero(v2); + case SCAN_NOT_EQUAL: + return v1 != dap_floor_zero(v2); + case SCAN_GREATER: + return v1 > dap_floor_zero(v2); + case SCAN_GREATER_EQL: + return v1 >= dap_floor_zero(v2); + case SCAN_LESS: + return v1 < dap_floor_zero(v2); + case SCAN_LESS_EQL: + return v1 <= dap_floor_zero(v2); + case SCAN_REGEXP: + throw Error("Regular expressions are supported for strings only."); + default: + throw Error("Unrecognized operator."); } -}; +} /** Compare two numerical types, the first one signed and the second - unsigned. If the signed argument is negative, zero is used in the - comparison. This class is one implementation of the comparison policy - used by rops. This class is here to make writing the Byte::ops, ... - member functions simpler. It is not necessary since the functions could - twiddle the order of arguments to rops and use USCmp. Having - this class make Byte:ops, ... simpler to read and write. - - @see Byte::ops - @see USCmp - @see Cmp - @see ops */ -template class SUCmp + unsigned. If the signed argument is negative, zero is used in the + comparison. This class is one implementation of the comparison policy + used by rops. This class is here to make writing the Byte::ops, ... + member functions simpler. It is not necessary since the functions could + twidle the order of arguments to rops and use USCmp. Having + this class make Byte:ops, ... simpler to read and write. + + @see Byte::ops + @see USCmp + @see Cmp + @see ops */ +template +bool SUCmp(int op, T1 v1, UT2 v2) { -public: - static bool eq(T1 v1, UT2 v2) - { - return dods_max(0, v1) == v2; - } - static bool ne(T1 v1, UT2 v2) - { - return dods_max(0, v1) != v2; - } - static bool gr(T1 v1, UT2 v2) - { - return dods_max(0, v1) > v2; - } - static bool ge(T1 v1, UT2 v2) - { - return dods_max(0, v1) >= v2; - } - static bool lt(T1 v1, UT2 v2) - { - return dods_max(0, v1) < v2; - } - static bool le(T1 v1, UT2 v2) - { - return dods_max(0, v1) <= v2; - } - static bool re(T1, UT2) - { - cerr << "Illegal operation" << endl; - return false; + switch (op) { + case SCAN_EQUAL: + return dap_floor_zero(v1) == v2; + case SCAN_NOT_EQUAL: + return dap_floor_zero(v1) != v2; + case SCAN_GREATER: + return dap_floor_zero(v1) > v2; + case SCAN_GREATER_EQL: + return dap_floor_zero(v1) >= v2; + case SCAN_LESS: + return dap_floor_zero(v1) < v2; + case SCAN_LESS_EQL: + return dap_floor_zero(v1) <= v2; + case SCAN_REGEXP: + throw Error("Regular expressions are supported for strings only."); + default: + throw Error("Unrecognized operator."); } -}; +} /** Compare two string types. - This class is one implementation of the comparison policy used by - rops. - - @see rops */ -template class StrCmp -{ -public: - static bool eq(T1 v1, T2 v2) - { - return v1 == v2; - } - static bool ne(T1 v1, T2 v2) - { - return v1 != v2; - } - static bool gr(T1 v1, T2 v2) - { - return v1 > v2; - } - static bool ge(T1 v1, T2 v2) - { - return v1 >= v2; - } - static bool lt(T1 v1, T2 v2) - { - return v1 < v2; - } - static bool le(T1 v1, T2 v2) - { - return v1 <= v2; - } - static bool re(T1 v1, T2 v2) - { - Regex r(v2.c_str()); - return r.match(v1.c_str(), v1.length()) > 0; - } -}; - -/** This template function is used to compare two values of two instances of - the DAP2 simple types (Byte, ..., Str). The function does not take the - DAP2 objects as arguments; the caller must access the values of those - objects and pass them to this function. The reason for this is that all - the possible functions that could be generated from this template would - have to be explicitly listed as friend functions in each of the DAP2 - simple type classes. In the current implementation, only the simple type - classes must be friends - to see why, look at Byte::ops and note that it - accesses the _buf member of Int16, ..., Float64 and thus must be a - friend of those classes. - - NB: This would all be simpler if: 1) g++ supported template friend - functions (without explicit listing of all the template's arguments). 2) - we did not have unsigned types. - - T1 The type of a. - - T2 The type of b. - - C A class which implements the policy used for comparing a - and b. - - @param a The first argument. - @param b The second argument. - @param op The relational operator. - @see Byte::ops */ + This class is one implementation of the comparison policy used by + rops. -template -bool rops(T1 a, T2 b, int op) + @see rops */ +template +bool StrCmp(int op, T1 v1, T2 v2) { switch (op) { - case SCAN_EQUAL: - return C::eq(a, b); - case SCAN_NOT_EQUAL: - return C::ne(a, b); - case SCAN_GREATER: - return C::gr(a, b); - case SCAN_GREATER_EQL: - return C::ge(a, b); - case SCAN_LESS: - return C::lt(a, b); - case SCAN_LESS_EQL: - return C::le(a, b); - case SCAN_REGEXP: - return C::re(a, b); - default: - cerr << "Unknown operator" << endl; - return false; + case SCAN_EQUAL: + return v1 == v2; + case SCAN_NOT_EQUAL: + return v1 != v2; + case SCAN_GREATER: + return v1 > v2; + case SCAN_GREATER_EQL: + return v1 >= v2; + case SCAN_LESS: + return v1 < v2; + case SCAN_LESS_EQL: + return v1 <= v2; + case SCAN_REGEXP: { + Regex r(v2.c_str()); + return r.match(v1.c_str(), v1.length()) > 0; + } + default: + throw Error("Unrecognized operator."); } } diff -Nru libdap-3.11.1/PipeResponse.h libdap-3.12.0/PipeResponse.h --- libdap-3.11.1/PipeResponse.h 2011-04-29 13:19:43.000000000 +0000 +++ libdap-3.12.0/PipeResponse.h 2013-10-17 21:27:40.000000000 +0000 @@ -19,7 +19,7 @@ // // You should have received a copy of the GNU Lesser General Public // License along with this library; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA // // You can contact OPeNDAP, Inc. at PO Box 112, Saunderstown, RI. 02874-0112. diff -Nru libdap-3.11.1/RCReader.cc libdap-3.12.0/RCReader.cc --- libdap-3.11.1/RCReader.cc 2011-04-29 13:19:43.000000000 +0000 +++ libdap-3.12.0/RCReader.cc 2013-10-17 21:27:40.000000000 +0000 @@ -19,7 +19,7 @@ // // You should have received a copy of the GNU Lesser General Public // License along with this library; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA // // You can contact OPeNDAP, Inc. at PO Box 112, Saunderstown, RI. 02874-0112. diff -Nru libdap-3.11.1/RCReader.h libdap-3.12.0/RCReader.h --- libdap-3.11.1/RCReader.h 2011-04-29 13:19:43.000000000 +0000 +++ libdap-3.12.0/RCReader.h 2013-10-17 21:27:40.000000000 +0000 @@ -19,7 +19,7 @@ // // You should have received a copy of the GNU Lesser General Public // License along with this library; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA // // You can contact OPeNDAP, Inc. at PO Box 112, Saunderstown, RI. 02874-0112. diff -Nru libdap-3.11.1/README libdap-3.12.0/README --- libdap-3.11.1/README 2011-04-29 13:19:43.000000000 +0000 +++ libdap-3.12.0/README 2013-10-17 21:27:40.000000000 +0000 @@ -1,3 +1,41 @@ +Updated for version 3.12.0 + +The server functions have been moved out of libdap and into their own +BES module. Currently this modules is part of the BES, but that will change +in the future. This version of libdap supports building very large arrays +made up of constant value (e.g., to be used as masks in server functions +you write). + +For information on the way to make these functions, see: +http://docs.opendap.org/index.php/Expanded_arguments_for_Constraint_Expressions +Note that this version of libdap requries bison 2.4. This is a change so +the parsers can use C++ I/O streams and we can eventually drop the FILE* +interfaces. + +Updated for version 3.11.7 + +Minor tweak for the server function caching code: turn on or off the +cache by adding or removing the directory /tmp/dap_functions_cache. +If the directory is not present no caching of server function calls +is done. All the other behaviors are otherwise identical. + +Updated for version 3.11.6 + +There is a new cache for some kinds of response objects. It's size and +location are currently fixed to 20GB bytes and +"/tmp/dap_functions_cache/" but these will be made BES parameters in a +future release. + +Updated for version 3.11.5 + +A memory leak in XDRStreamMarshaller was fixed. + +A bug in DDS::add_var_nocopy() was fixed. + +Updated for version 3.11.2 + +Bug fixes and improvements in the implementations of some methods. + Updated for version 3.11.1 Bug fixes only. @@ -396,7 +434,7 @@ several threads are part of a program and each will make calls to libdap, either those threads must synchronize their calls or arrange to each use their own copy of libdap. Some aspects of the library -''are'' thread-safe: the singleton classes are all protected as is the +are thread-safe: the singleton classes are all protected as is the HTTP cache (which uses the local file system). INSTALLATION INSTRUCTIONS diff -Nru libdap-3.11.1/RValue.cc libdap-3.12.0/RValue.cc --- libdap-3.11.1/RValue.cc 2011-04-29 13:19:42.000000000 +0000 +++ libdap-3.12.0/RValue.cc 2013-10-17 21:27:40.000000000 +0000 @@ -19,7 +19,7 @@ // // You should have received a copy of the GNU Lesser General Public // License along with this library; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA // // You can contact OPeNDAP, Inc. at PO Box 112, Saunderstown, RI. 02874-0112. @@ -37,7 +37,7 @@ #include "config.h" static char rcsid[] not_used = - {"$Id: RValue.cc 24281 2011-03-09 00:22:31Z jimg $" + {"$Id: RValue.cc 27197 2013-10-01 21:29:54Z jimg $" }; #include @@ -109,15 +109,17 @@ for (rvalue::Args_iter i = args->begin(); i != args->end() && index < argc + 1; ++i) argv[index++] = (*i)->bvalue(dds); + + argv[index] = 0; // Add the null terminator. } if (index != argc) { delete[] argv; throw InternalErr(__FILE__, __LINE__, "index out of range."); } - +#if 0 argv[index] = 0; // Add the null terminator. - +#endif return argv; } diff -Nru libdap-3.11.1/RValue.h libdap-3.12.0/RValue.h --- libdap-3.11.1/RValue.h 2011-04-29 13:19:43.000000000 +0000 +++ libdap-3.12.0/RValue.h 2013-10-17 21:27:40.000000000 +0000 @@ -19,7 +19,7 @@ // // You should have received a copy of the GNU Lesser General Public // License along with this library; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA // // You can contact OPeNDAP, Inc. at PO Box 112, Saunderstown, RI. 02874-0112. @@ -68,6 +68,14 @@ typedef std::vector::const_iterator rvalue_list_citer ; typedef std::vector::iterator rvalue_list_iter ; +typedef std::vector *byte_arg_list; +typedef std::vector *int16_arg_list; +typedef std::vector *uint16_arg_list; +typedef std::vector *int32_arg_list; +typedef std::vector *uint32_arg_list; +typedef std::vector *float32_arg_list; +typedef std::vector *float64_arg_list; + rvalue_list *make_rvalue_list(rvalue *rv); rvalue_list *append_rvalue_list(rvalue_list *rvals, rvalue *rv); diff -Nru libdap-3.11.1/Resource.h libdap-3.12.0/Resource.h --- libdap-3.11.1/Resource.h 2011-04-29 13:19:43.000000000 +0000 +++ libdap-3.12.0/Resource.h 2013-10-17 21:27:40.000000000 +0000 @@ -19,7 +19,7 @@ // // You should have received a copy of the GNU Lesser General Public // License along with this library; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA // // You can contact OPeNDAP, Inc. at PO Box 112, Saunderstown, RI. 02874-0112. diff -Nru libdap-3.11.1/Response.h libdap-3.12.0/Response.h --- libdap-3.11.1/Response.h 2011-04-29 13:19:43.000000000 +0000 +++ libdap-3.12.0/Response.h 2013-10-17 21:27:40.000000000 +0000 @@ -19,7 +19,7 @@ // // You should have received a copy of the GNU Lesser General Public // License along with this library; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA // // You can contact OPeNDAP, Inc. at PO Box 112, Saunderstown, RI. 02874-0112. diff -Nru libdap-3.11.1/ResponseBuilder.cc libdap-3.12.0/ResponseBuilder.cc --- libdap-3.11.1/ResponseBuilder.cc 2011-04-29 13:19:43.000000000 +0000 +++ libdap-3.12.0/ResponseBuilder.cc 1970-01-01 00:00:00.000000000 +0000 @@ -1,723 +0,0 @@ -// -*- mode: c++; c-basic-offset:4 -*- - -// This file is part of libdap, A C++ implementation of the OPeNDAP Data -// Access Protocol. - -// Copyright (c) 2011 OPeNDAP, Inc. -// Author: James Gallagher -// -// This library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Lesser General Public -// License as published by the Free Software Foundation; either -// version 2.1 of the License, or (at your option) any later version. -// -// This library 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 -// Lesser General Public License for more details. -// -// You should have received a copy of the GNU Lesser General Public -// License along with this library; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -// -// You can contact OPeNDAP, Inc. at PO Box 112, Saunderstown, RI. 02874-0112. - -#include "config.h" - -static char rcsid[] not_used = { "$Id: ResponseBuilder.cc 23477 2010-09-02 21:02:59Z jimg $" }; - -#include - -#ifndef WIN32 -// #include // for getopt -#include -#else -#include -#include -#include -#endif - -#include -#include -#include -#include - -#include // used to build CID header value for data ddx - -#include "DAS.h" -#include "DDS.h" -#include "debug.h" -#include "mime_util.h" // for last_modified_time() and rfc_822_date() -#include "escaping.h" -#include "ResponseBuilder.h" -#include "XDRStreamMarshaller.h" - -#ifndef WIN32 -#include "SignalHandler.h" -#include "EventHandler.h" -#include "AlarmHandler.h" -#endif - -#define CRLF "\r\n" // Change here, expr-test.cc -using namespace std; - -namespace libdap { - -ResponseBuilder::~ResponseBuilder() -{ -} - -/** Called when initializing a ResponseBuilder that's not going to be passed a - command line arguments. */ -void ResponseBuilder::initialize() -{ - // Set default values. Don't use the C++ constructor initialization so - // that a subclass can have more control over this process. - d_dataset = ""; - d_ce = ""; - d_timeout = 0; - - d_default_protocol = DAP_PROTOCOL_VERSION; -#if 0 // Keyword support moved to Keywords class - // Load known_keywords - d_known_keywords.insert("dap2"); - d_known_keywords.insert("dap2.0"); - - d_known_keywords.insert("dap3.2"); - d_known_keywords.insert("dap3.3"); - - d_known_keywords.insert("dap4"); - d_known_keywords.insert("dap4.0"); -#endif -#ifdef WIN32 - // We want serving from win32 to behave in a manner - // similar to the UNIX way - no CR->NL terminated lines - // in files. Hence stdout goes to binary mode. - _setmode(_fileno(stdout), _O_BINARY); -#endif -} - -#if 0 -/** - * Add the keyword to the set of keywords that apply to this request. - * @param kw The keyword - */ -void ResponseBuilder::add_keyword(const string &kw) -{ - d_keywords.insert(kw); -} - -/** - * Lookup a keyword and return true if it has been set for this request, - * otherwise return false. - * @param kw Keyword - * @return true if the keyword is set. - */ -bool ResponseBuilder::is_keyword(const string &kw) const -{ - return d_keywords.count(kw) != 0; -} - -/** - * Get a list of the strings that make up the set of current keywords for - * this request. - * @return The list of keywords as a list of string objects. - */ -list ResponseBuilder::get_keywords() const -{ - list kws; - set::const_iterator i; - for (i = d_keywords.begin(); i != d_keywords.end(); ++i) - kws.push_front(*i); - return kws; -} - -/** - * Is the word one of the known keywords for this version of libdap? - * @param w - * @return true if the keyword is known - */ -bool ResponseBuilder::is_known_keyword(const string &w) const -{ - return d_known_keywords.count(w) != 0; -} -#endif - -/** Return the entire constraint expression in a string. This - includes both the projection and selection clauses, but not the - question mark. - - @brief Get the constraint expression. - @return A string object that contains the constraint expression. */ -string ResponseBuilder::get_ce() const -{ - return d_ce; -} - -void ResponseBuilder::set_ce(string _ce) -{ - d_ce = www2id(_ce, "%", "%20"); - -#if 0 - // Get the whole CE - string projection = www2id(_ce, "%", "%20"); - string selection = ""; - - // Separate the selection part (which follows/includes the first '&') - string::size_type amp = projection.find('&'); - if (amp != string::npos) { - selection = projection.substr(amp); - projection = projection.substr(0, amp); - } - - // Extract keywords; add to the ResponseBuilder keywords. For this, scan for - // a known set of keywords and assume that anything else is part of the - // projection and should be left alone. Keywords must come before variables - // The 'projection' string will look like: '' or 'dap4.0' or 'dap4.0,u,v' - while (!projection.empty()) { - string::size_type i = projection.find(','); - string next_word = projection.substr(0, i); - if (is_known_keyword(next_word)) { - add_keyword(next_word); - projection = projection.substr(i + 1); - } - else { - break; // exit on first non-keyword - } - } - - // The CE is whatever is left after removing the keywords - d_ce = projection + selection; -#endif -} - -/** The ``dataset name'' is the filename or other string that the - filter program will use to access the data. In some cases this - will indicate a disk file containing the data. In others, it - may represent a database query or some other exotic data - access method. - - @brief Get the dataset name. - @return A string object that contains the name of the dataset. */ -string ResponseBuilder::get_dataset_name() const -{ - return d_dataset; -} - -void ResponseBuilder::set_dataset_name(const string ds) -{ - d_dataset = www2id(ds, "%", "%20"); -} - -/** Set the server's timeout value. A value of zero (the default) means no - timeout. - - @param t Server timeout in seconds. Default is zero (no timeout). */ -void ResponseBuilder::set_timeout(int t) -{ - d_timeout = t; -} - -/** Get the server's timeout value. */ -int ResponseBuilder::get_timeout() const -{ - return d_timeout; -} - -/** Use values of this instance to establish a timeout alarm for the server. - If the timeout value is zero, do nothing. - - @todo When the alarm handler is called, two CRLF pairs are dumped to the - stream and then an Error object is sent. No attempt is made to write the - 'correct' MIME headers for an Error object. Instead, a savvy client will - know that when an exception is thrown during a deserialize operation, it - should scan ahead in the input stream for an Error object. Add this, or a - sensible variant once libdap++ supports reliable error delivery. Dumb - clients will never get the Error object... */ -void ResponseBuilder::establish_timeout(ostream &stream) const -{ -#ifndef WIN32 - if (d_timeout > 0) { - SignalHandler *sh = SignalHandler::instance(); - EventHandler *old_eh = sh->register_handler(SIGALRM, new AlarmHandler(stream)); - delete old_eh; - alarm(d_timeout); - } -#endif -} - -/** This function formats and prints an ASCII representation of a - DAS on stdout. This has the effect of sending the DAS object - back to the client program. - - @brief Transmit a DAS. - @param out The output stream to which the DAS is to be sent. - @param das The DAS object to be sent. - @param anc_location The directory in which the external DAS file resides. - @param with_mime_headers If true (the default) send MIME headers. - @return void - @see DAS */ -void ResponseBuilder::send_das(ostream &out, DAS &das, bool with_mime_headers) const -{ - if (with_mime_headers) - set_mime_text(out, dods_das, x_plain, last_modified_time(d_dataset), "2.0"); - das.print(out); - - out << flush; -} - -/** This function formats and prints an ASCII representation of a - DDS on stdout. When called by a CGI program, this has the - effect of sending a DDS object back to the client - program. Either an entire DDS or a constrained DDS may be sent. - - @brief Transmit a DDS. - @param out The output stream to which the DAS is to be sent. - @param dds The DDS to send back to a client. - @param eval A reference to the ConstraintEvaluator to use. - @param constrained If this argument is true, evaluate the - current constraint expression and send the `constrained DDS' - back to the client. - @param anc_location The directory in which the external DAS file resides. - @param with_mime_headers If true (the default) send MIME headers. - @return void - @see DDS */ -void ResponseBuilder::send_dds(ostream &out, DDS &dds, ConstraintEvaluator &eval, bool constrained, - bool with_mime_headers) const -{ - // If constrained, parse the constraint. Throws Error or InternalErr. - if (constrained) - eval.parse_constraint(d_ce, dds); - - if (eval.functional_expression()) - throw Error("Function calls can only be used with data requests. To see the structure of the underlying data source, reissue the URL without the function."); - - if (with_mime_headers) - set_mime_text(out, dods_dds, x_plain, last_modified_time(d_dataset), dds.get_dap_version()); - - if (constrained) - dds.print_constrained(out); - else - dds.print(out); - - out << flush; -} - -void ResponseBuilder::dataset_constraint(ostream &out, DDS & dds, ConstraintEvaluator & eval, bool ce_eval) const -{ - // send constrained DDS - dds.print_constrained(out); - out << "Data:\n"; - out << flush; - - // Grab a stream that encodes using XDR. - XDRStreamMarshaller m(out); - - try { - // Send all variables in the current projection (send_p()) - for (DDS::Vars_iter i = dds.var_begin(); i != dds.var_end(); i++) - if ((*i)->send_p()) { - DBG(cerr << "Sending " << (*i)->name() << endl); - (*i)->serialize(eval, dds, m, ce_eval); - } - } - catch (Error & e) { - throw; - } -} - -void ResponseBuilder::dataset_constraint_ddx( ostream &out, DDS & dds, ConstraintEvaluator & eval, - const string &boundary, const string &start, bool ce_eval) const -{ - // Write the MPM headers for the DDX (text/xml) part of the response - set_mime_ddx_boundary(out, boundary, start, dap4_ddx); - - // Make cid - uuid_t uu; - uuid_generate(uu); - char uuid[37]; - uuid_unparse(uu, &uuid[0]); - char domain[256]; - if (getdomainname(domain, 255) != 0 || strlen(domain) == 0) - strncpy(domain, "opendap.org", 255); - - string cid = string(&uuid[0]) + "@" + string(&domain[0]); - - // Send constrained DDX with a data blob reference - dds.print_xml(out, true, cid); - - // Write the MPM headers for the data part of the response. - set_mime_data_boundary(out, boundary, cid, dap4_data, binary); - - // Grab a stream that encodes using XDR. - XDRStreamMarshaller m(out); - - try { - // Send all variables in the current projection (send_p()) - for (DDS::Vars_iter i = dds.var_begin(); i != dds.var_end(); i++) - if ((*i)->send_p()) { - DBG(cerr << "Sending " << (*i)->name() << endl); - (*i)->serialize(eval, dds, m, ce_eval); - } - } - catch (Error & e) { - throw; - } -} - -/** Send the data in the DDS object back to the client program. The data is - encoded using a Marshaller, and enclosed in a MIME document which is all sent - to \c data_stream. If this is being called from a CGI, \c data_stream is - probably \c stdout and writing to it has the effect of sending the - response back to the client. - - @brief Transmit data. - @param dds A DDS object containing the data to be sent. - @param eval A reference to the ConstraintEvaluator to use. - @param data_stream Write the response to this stream. - @param anc_location A directory to search for ancillary files (in - addition to the CWD). This is used in a call to - get_data_last_modified_time(). - @param with_mime_headers If true, include the MIME headers in the response. - Defaults to true. - @return void */ -void ResponseBuilder::send_data(ostream & data_stream, DDS & dds, ConstraintEvaluator & eval, bool with_mime_headers) const -{ - // Set up the alarm. - establish_timeout(data_stream); - dds.set_timeout(d_timeout); - - eval.parse_constraint(d_ce, dds); // Throws Error if the ce doesn't - // parse. - - dds.tag_nested_sequences(); // Tag Sequences as Parent or Leaf node. - - // Start sending the response... - - // Handle *functional* constraint expressions specially - if (eval.function_clauses()) { - DDS *fdds = eval.eval_function_clauses(dds); - if (with_mime_headers) - set_mime_binary(data_stream, dods_data, x_plain, last_modified_time(d_dataset), dds.get_dap_version()); - - dataset_constraint(data_stream, *fdds, eval, false); - delete fdds; - } - else { - if (with_mime_headers) - set_mime_binary(data_stream, dods_data, x_plain, last_modified_time(d_dataset), dds.get_dap_version()); - - dataset_constraint(data_stream, dds, eval); - } - - data_stream << flush; -} - -/** Send the DDX response. The DDX never contains data, instead it holds a - reference to a Blob response which is used to get the data values. The - DDS and DAS objects are built using code that already exists in the - servers. - - @param dds The dataset's DDS \e with attributes in the variables. - @param eval A reference to the ConstraintEvaluator to use. - @param out Destination - @param with_mime_headers If true, include the MIME headers in the response. - Defaults to true. */ -void ResponseBuilder::send_ddx(ostream &out, DDS &dds, ConstraintEvaluator &eval, bool with_mime_headers) const -{ - // If constrained, parse the constraint. Throws Error or InternalErr. - if (!d_ce.empty()) - eval.parse_constraint(d_ce, dds); - - if (eval.functional_expression()) - throw Error( - "Function calls can only be used with data requests. To see the structure of the underlying data source, reissue the URL without the function."); - - if (with_mime_headers) - set_mime_text(out, dap4_ddx, x_plain, last_modified_time(d_dataset), dds.get_dap_version()); - dds.print_xml(out, !d_ce.empty(), ""); -} - -/** Send the data in the DDS object back to the client program. The data is - encoded using a Marshaller, and enclosed in a MIME document which is all sent - to \c data_stream. If this is being called from a CGI, \c data_stream is - probably \c stdout and writing to it has the effect of sending the - response back to the client. - - @brief Transmit data. - @param dds A DDS object containing the data to be sent. - @param eval A reference to the ConstraintEvaluator to use. - @param data_stream Write the response to this stream. - @param anc_location A directory to search for ancillary files (in - addition to the CWD). This is used in a call to - get_data_last_modified_time(). - @param with_mime_headers If true, include the MIME headers in the response. - Defaults to true. - @return void */ -void ResponseBuilder::send_data_ddx(ostream & data_stream, DDS & dds, ConstraintEvaluator & eval, const string &start, - const string &boundary, bool with_mime_headers) const -{ - // Set up the alarm. - establish_timeout(data_stream); - dds.set_timeout(d_timeout); - - eval.parse_constraint(d_ce, dds); // Throws Error if the ce doesn't - // parse. - - dds.tag_nested_sequences(); // Tag Sequences as Parent or Leaf node. - - // Start sending the response... - - // Handle *functional* constraint expressions specially - if (eval.function_clauses()) { - DDS *fdds = eval.eval_function_clauses(dds); - if (with_mime_headers) - set_mime_multipart(data_stream, boundary, start, dap4_data_ddx, x_plain, last_modified_time(d_dataset)); - data_stream << flush; - // TODO: Change this to dataset_constraint_ddx() - dataset_constraint(data_stream, *fdds, eval, false); - delete fdds; - } - else { - if (with_mime_headers) - set_mime_multipart(data_stream, boundary, start, dap4_data_ddx, x_plain, last_modified_time(d_dataset)); - data_stream << flush; - dataset_constraint_ddx(data_stream, dds, eval, boundary, start); - } - - data_stream << flush; - - if (with_mime_headers) - data_stream << CRLF << "--" << boundary << "--" << CRLF; -} - -static const char *descrip[] = { "unknown", "dods_das", "dods_dds", "dods_data", "dods_error", "web_error", "dap4-ddx", - "dap4-data", "dap4-error", "dap4-data-ddx", "dods_ddx" }; -static const char *encoding[] = { "unknown", "deflate", "x-plain", "gzip", "binary" }; - -/** Generate an HTTP 1.0 response header for a text document. This is used - when returning a serialized DAS or DDS object. - - @param strm Write the MIME header to this stream. - @param type The type of this this response. Defaults to - application/octet-stream. - @param ver The version string; denotes the libdap implementation - version. - @param enc How is this response encoded? Can be plain or deflate or the - x_... versions of those. Default is x_plain. - @param last_modified The time to use for the Last-Modified header value. - Default is zero which means use the current time. */ -void ResponseBuilder::set_mime_text(ostream &strm, ObjectType type, - EncodingType enc, const time_t last_modified, - const string &protocol) const -{ - strm << "HTTP/1.0 200 OK" << CRLF; - - strm << "XDODS-Server: " << DVR << CRLF; - strm << "XOPeNDAP-Server: " << DVR << CRLF; - - if (protocol == "") - strm << "XDAP: " << d_default_protocol << CRLF; - else - strm << "XDAP: " << protocol << CRLF; - - const time_t t = time(0); - strm << "Date: " << rfc822_date(t).c_str() << CRLF; - - strm << "Last-Modified: "; - if (last_modified > 0) - strm << rfc822_date(last_modified).c_str() << CRLF; - else - strm << rfc822_date(t).c_str() << CRLF; - - if (type == dap4_ddx) - strm << "Content-Type: text/xml" << CRLF; - else - strm << "Content-Type: text/plain" << CRLF; - - // Note that Content-Description is from RFC 2045 (MIME, pt 1), not 2616. - // jhrg 12/23/05 - strm << "Content-Description: " << descrip[type] << CRLF; - if (type == dods_error) // don't cache our error responses. - strm << "Cache-Control: no-cache" << CRLF; - // Don't write a Content-Encoding header for x-plain since that breaks - // Netscape on NT. jhrg 3/23/97 - if (enc != x_plain) - strm << "Content-Encoding: " << encoding[enc] << CRLF; - strm << CRLF; -} - -/** Generate an HTTP 1.0 response header for a html document. - - @param strm Write the MIME header to this stream. - @param type The type of this this response. - @param ver The version string; denotes the libdap implementation - version. - @param enc How is this response encoded? Can be plain or deflate or the - x_... versions of those. Default is x_plain. - @param last_modified The time to use for the Last-Modified header value. - Default is zero which means use the current time. */ -void ResponseBuilder::set_mime_html(ostream &strm, ObjectType type, - EncodingType enc, const time_t last_modified, - const string &protocol) const -{ - strm << "HTTP/1.0 200 OK" << CRLF; - - strm << "XDODS-Server: " << DVR << CRLF; - strm << "XOPeNDAP-Server: " << DVR << CRLF; - - if (protocol == "") - strm << "XDAP: " << d_default_protocol << CRLF; - else - strm << "XDAP: " << protocol << CRLF; - - const time_t t = time(0); - strm << "Date: " << rfc822_date(t).c_str() << CRLF; - - strm << "Last-Modified: "; - if (last_modified > 0) - strm << rfc822_date(last_modified).c_str() << CRLF; - else - strm << rfc822_date(t).c_str() << CRLF; - - strm << "Content-type: text/html" << CRLF; - // See note above about Content-Description header. jhrg 12/23/05 - strm << "Content-Description: " << descrip[type] << CRLF; - if (type == dods_error) // don't cache our error responses. - strm << "Cache-Control: no-cache" << CRLF; - // Don't write a Content-Encoding header for x-plain since that breaks - // Netscape on NT. jhrg 3/23/97 - if (enc != x_plain) - strm << "Content-Encoding: " << encoding[enc] << CRLF; - strm << CRLF; -} - -/** Write an HTTP 1.0 response header for our binary response document (i.e., - the DataDDS object). - - @param strm Write the MIME header to this stream. - @param type The type of this this response. Defaults to - application/octet-stream. - @param ver The version string; denotes the libdap implementation - version. - @param enc How is this response encoded? Can be plain or deflate or the - x_... versions of those. Default is x_plain. - @param last_modified The time to use for the Last-Modified header value. - Default is zero which means use the current time. - */ -void ResponseBuilder::set_mime_binary(ostream &strm, ObjectType type, - EncodingType enc, const time_t last_modified, - const string &protocol) const -{ - strm << "HTTP/1.0 200 OK" << CRLF; - - strm << "XDODS-Server: " << DVR << CRLF; - strm << "XOPeNDAP-Server: " << DVR << CRLF; - - if (protocol == "") - strm << "XDAP: " << d_default_protocol << CRLF; - else - strm << "XDAP: " << protocol << CRLF; - - const time_t t = time(0); - strm << "Date: " << rfc822_date(t).c_str() << CRLF; - - strm << "Last-Modified: "; - if (last_modified > 0) - strm << rfc822_date(last_modified).c_str() << CRLF; - else - strm << rfc822_date(t).c_str() << CRLF; - - strm << "Content-Type: application/octet-stream" << CRLF; - strm << "Content-Description: " << descrip[type] << CRLF; - if (enc != x_plain) - strm << "Content-Encoding: " << encoding[enc] << CRLF; - - strm << CRLF; -} - -void ResponseBuilder::set_mime_multipart(ostream &strm, const string &boundary, - const string &start, ObjectType type, EncodingType enc, - const time_t last_modified, const string &protocol) const -{ - strm << "HTTP/1.0 200 OK" << CRLF; - - strm << "XDODS-Server: " << DVR << CRLF; - strm << "XOPeNDAP-Server: " << DVR << CRLF; - - if (protocol == "") - strm << "XDAP: " << d_default_protocol << CRLF; - else - strm << "XDAP: " << protocol << CRLF; - - const time_t t = time(0); - strm << "Date: " << rfc822_date(t).c_str() << CRLF; - - strm << "Last-Modified: "; - if (last_modified > 0) - strm << rfc822_date(last_modified).c_str() << CRLF; - else - strm << rfc822_date(t).c_str() << CRLF; - - strm << "Content-Type: Multipart/Related; boundary=" << boundary << "; start=\"<" << start - << ">\"; type=\"Text/xml\"" << CRLF; - strm << "Content-Description: " << descrip[type] << CRLF; - if (enc != x_plain) - strm << "Content-Encoding: " << encoding[enc] << CRLF; - - strm << CRLF; -} - -void ResponseBuilder::set_mime_ddx_boundary(ostream &strm, const string &boundary, - const string &cid, ObjectType type, EncodingType enc) const -{ - strm << "--" << boundary << CRLF; - strm << "Content-Type: Text/xml; charset=iso-8859-1" << CRLF; - strm << "Content-Id: <" << cid << ">" << CRLF; - strm << "Content-Description: " << descrip[type] << CRLF; - if (enc != x_plain) - strm << "Content-Encoding: " << encoding[enc] << CRLF; - - strm << CRLF; -} - -void ResponseBuilder::set_mime_data_boundary(ostream &strm, const string &boundary, - const string &cid, ObjectType type, EncodingType enc) const -{ - strm << "--" << boundary << CRLF; - strm << "Content-Type: application/octet-stream" << CRLF; - strm << "Content-Id: <" << cid << ">" << CRLF; - strm << "Content-Description: " << descrip[type] << CRLF; - if (enc != x_plain) - strm << "Content-Encoding: " << encoding[enc] << CRLF; - - strm << CRLF; -} - -/** Generate an HTTP 1.0 response header for an Error object. - @param strm Write the MIME header to this stream. - @param code HTTP 1.0 response code. Should be 400, ... 500, ... - @param reason Reason string of the HTTP 1.0 response header. - @param version The version string; denotes the DAP spec and implementation - version. */ -void ResponseBuilder::set_mime_error(ostream &strm, int code, const string &reason, - const string &protocol) const -{ - strm << "HTTP/1.0 " << code << " " << reason.c_str() << CRLF; - - strm << "XDODS-Server: " << DVR << CRLF; - strm << "XOPeNDAP-Server: " << DVR << CRLF; - - if (protocol == "") - strm << "XDAP: " << d_default_protocol << CRLF; - else - strm << "XDAP: " << protocol << CRLF; - - const time_t t = time(0); - strm << "Date: " << rfc822_date(t).c_str() << CRLF; - strm << "Cache-Control: no-cache" << CRLF; - strm << CRLF; -} - -} // namespace libdap - diff -Nru libdap-3.11.1/ResponseBuilder.h libdap-3.12.0/ResponseBuilder.h --- libdap-3.11.1/ResponseBuilder.h 2011-04-29 13:19:43.000000000 +0000 +++ libdap-3.12.0/ResponseBuilder.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,166 +0,0 @@ - -// -*- mode: c++; c-basic-offset:4 -*- - -// This file is part of libdap, A C++ implementation of the OPeNDAP Data -// Access Protocol. - -// Copyright (c) 2011 OPeNDAP, Inc. -// Author: James Gallagher -// -// This library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Lesser General Public -// License as published by the Free Software Foundation; either -// version 2.1 of the License, or (at your option) any later version. -// -// This library 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 -// Lesser General Public License for more details. -// -// You should have received a copy of the GNU Lesser General Public -// License along with this library; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -// -// You can contact OPeNDAP, Inc. at PO Box 112, Saunderstown, RI. 02874-0112. - -#ifndef _response_builder_h -#define _response_builder_h - -#include -#include - -#ifndef _das_h -#include "DAS.h" -#endif - -#ifndef _dds_h -#include "DDS.h" -#endif - -#ifndef constraint_evaluator_h -#include "ConstraintEvaluator.h" -#endif - -#ifndef _object_type_h -#include "ObjectType.h" -#endif - -#ifndef _encodingtype_h -#include "EncodingType.h" -#endif - -namespace libdap -{ - -/** - - @brief Build responses for Hyrax server modules/handlers. - @author jhrg 1/28/2011 */ - -class ResponseBuilder -{ -public: - friend class ResponseBuilderTest; - -protected: - string d_dataset; /// Name of the dataset/database - string d_ce; /// Constraint expression - int d_timeout; /// Response timeout after N seconds - string d_default_protocol; /// Version string for the library's default protocol version - -#if 0 // Keyword support moved to Keywords class - set d_keywords; /// Holds all of the keywords passed in the CE - set d_known_keywords; /// Holds all of the keywords libdap understands. -#endif - void initialize(); - -public: - - /** Make an empty instance. Use the set_*() methods to load with needed - values. You must call at least set_dataset_name() or be requesting - version information. */ - ResponseBuilder() { - initialize(); - } - - virtual ~ResponseBuilder(); -#if 0 - virtual void add_keyword(const string &kw); - virtual bool is_keyword(const string &kw) const; - virtual list get_keywords() const; - // This method holds all of the keywords that this version of libdap groks - virtual bool is_known_keyword(const string &w) const; -#endif - - virtual string get_ce() const; - virtual void set_ce(string _ce); - - virtual string get_dataset_name() const; - virtual void set_dataset_name(const string _dataset); - - void set_timeout(int timeout = 0); - int get_timeout() const; - - virtual void establish_timeout(ostream &stream) const; - - virtual void send_das(ostream &out, DAS &das, - bool with_mime_headers = true) const; - virtual void send_dds(ostream &out, DDS &dds, ConstraintEvaluator &eval, - bool constrained = false, - bool with_mime_headers = true) const; - - virtual void dataset_constraint(ostream &out, DDS &dds, ConstraintEvaluator &eval, - bool ce_eval = true) const; - virtual void dataset_constraint_ddx(ostream &out, DDS & dds, ConstraintEvaluator & eval, - const string &boundary, const string &start, - bool ce_eval = true) const; - - virtual void send_data(ostream &data_stream, DDS &dds, ConstraintEvaluator &eval, - bool with_mime_headers = true) const; - - virtual void send_ddx(ostream &out, DDS &dds, ConstraintEvaluator &eval, - bool with_mime_headers = true) const; - - virtual void send_data_ddx(ostream &data_stream, DDS &dds, ConstraintEvaluator &eval, - const string &start, const string &boundary, - bool with_mime_headers = true) const; - - // These functions are used both by the methods above and by other code - - void set_mime_text(ostream &out, ObjectType type = unknown_type, - EncodingType enc = x_plain, - const time_t last_modified = 0, - const string &protocol = "") const; - - void set_mime_html(ostream &out, ObjectType type = unknown_type, - EncodingType enc = x_plain, - const time_t last_modified = 0, - const string &protocol = "") const; - - void set_mime_binary(ostream &out, ObjectType type = unknown_type, - EncodingType enc = x_plain, - const time_t last_modified = 0, - const string &protocol = "") const; - - void set_mime_multipart(ostream &out, const string &boundary, - const string &start, ObjectType type = unknown_type, - EncodingType enc = x_plain, - const time_t last_modified = 0, - const string &protocol = "") const; - - void set_mime_ddx_boundary(ostream &out, const string &boundary, - const string &start, ObjectType type = unknown_type, - EncodingType enc = x_plain) const; - - void set_mime_data_boundary(ostream &out, const string &boundary, - const string &cid, ObjectType type = unknown_type, - EncodingType enc = x_plain) const; - - void set_mime_error(ostream &out, int code = 404, - const string &reason = "Dataset not found", - const string &protocol = "") const; -}; - -} // namespace libdap - -#endif // _response_builder_h diff -Nru libdap-3.11.1/ResponseTooBigErr.cc libdap-3.12.0/ResponseTooBigErr.cc --- libdap-3.11.1/ResponseTooBigErr.cc 2011-04-29 13:19:42.000000000 +0000 +++ libdap-3.12.0/ResponseTooBigErr.cc 2013-10-17 21:27:40.000000000 +0000 @@ -19,7 +19,7 @@ // // You should have received a copy of the GNU Lesser General Public // License along with this library; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA // // You can contact OPeNDAP, Inc. at PO Box 112, Saunderstown, RI. 02874-0112. @@ -27,7 +27,7 @@ #include "config.h" static char rcsid[] not_used = - {"$Id: ResponseTooBigErr.cc 17856 2008-02-02 21:25:59Z pwest $" + {"$Id: ResponseTooBigErr.cc 27197 2013-10-01 21:29:54Z jimg $" }; #include diff -Nru libdap-3.11.1/ResponseTooBigErr.h libdap-3.12.0/ResponseTooBigErr.h --- libdap-3.11.1/ResponseTooBigErr.h 2011-04-29 13:19:42.000000000 +0000 +++ libdap-3.12.0/ResponseTooBigErr.h 2013-10-17 21:27:40.000000000 +0000 @@ -19,7 +19,7 @@ // // You should have received a copy of the GNU Lesser General Public // License along with this library; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA // // You can contact OPeNDAP, Inc. at PO Box 112, Saunderstown, RI. 02874-0112. diff -Nru libdap-3.11.1/Sequence.cc libdap-3.12.0/Sequence.cc --- libdap-3.11.1/Sequence.cc 2011-04-29 13:19:43.000000000 +0000 +++ libdap-3.12.0/Sequence.cc 2013-10-17 21:27:40.000000000 +0000 @@ -18,7 +18,7 @@ // // You should have received a copy of the GNU Lesser General Public // License along with this library; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA // // You can contact OPeNDAP, Inc. at PO Box 112, Saunderstown, RI. 02874-0112. @@ -56,6 +56,9 @@ #include "Sequence.h" #include "Grid.h" +#include "Marshaller.h" +#include "UnMarshaller.h" + #include "debug.h" #include "Error.h" #include "InternalErr.h" @@ -76,7 +79,7 @@ // Private member functions void -Sequence::_duplicate(const Sequence &s) +Sequence::m_duplicate(const Sequence &s) { d_row_number = s.d_row_number; d_starting_row_number = s.d_starting_row_number; @@ -187,7 +190,7 @@ /** @brief The Sequence copy constructor. */ Sequence::Sequence(const Sequence &rhs) : Constructor(rhs) { - _duplicate(rhs); + m_duplicate(rhs); } BaseType * @@ -216,7 +219,7 @@ Sequence::~Sequence() { DBG2(cerr << "Entering Sequence::~Sequence" << endl); - for (Vars_iter i = _vars.begin(); i != _vars.end(); i++) { + for (Vars_iter i = d_vars.begin(); i != d_vars.end(); i++) { BaseType *btp = *i ; delete btp ; btp = 0; } @@ -233,11 +236,20 @@ dynamic_cast(*this) = rhs; // run Constructor= - _duplicate(rhs); + m_duplicate(rhs); return *this; } +/** + * The Sequence class will be streamlined for DAP4. + */ +bool +Sequence::is_dap2_only_type() +{ + return true; +} + string Sequence::toString() { @@ -245,7 +257,7 @@ oss << BaseType::toString(); - for (Vars_iter i = _vars.begin(); i != _vars.end(); i++) { + for (Vars_iter i = d_vars.begin(); i != d_vars.end(); i++) { oss << (*i)->toString(); } @@ -254,26 +266,28 @@ return oss.str(); } +#if 0 int Sequence::element_count(bool leaves) { if (!leaves) - return _vars.size(); + return d_vars.size(); else { int i = 0; - for (Vars_iter iter = _vars.begin(); iter != _vars.end(); iter++) { + for (Vars_iter iter = d_vars.begin(); iter != d_vars.end(); iter++) { i += (*iter)->element_count(true); } return i; } } +#endif bool Sequence::is_linear() { bool linear = true; bool seq_found = false; - for (Vars_iter iter = _vars.begin(); linear && iter != _vars.end(); iter++) { + for (Vars_iter iter = d_vars.begin(); linear && iter != d_vars.end(); iter++) { if ((*iter)->type() == dods_sequence_c) { // A linear sequence cannot have more than one child seq. at any // one level. If we've already found a seq at this level, return @@ -283,10 +297,10 @@ break; } seq_found = true; - linear = dynamic_cast((*iter))->is_linear(); + linear = static_cast((*iter))->is_linear(); } else if ((*iter)->type() == dods_structure_c) { - linear = dynamic_cast((*iter))->is_linear(); + linear = static_cast((*iter))->is_linear(); } else { // A linear sequence cannot have Arrays, Lists or Grids. @@ -297,10 +311,11 @@ return linear; } +#if 0 void Sequence::set_send_p(bool state) { - for (Vars_iter i = _vars.begin(); i != _vars.end(); i++) { + for (Vars_iter i = d_vars.begin(); i != d_vars.end(); i++) { (*i)->set_send_p(state); } @@ -310,23 +325,25 @@ void Sequence::set_read_p(bool state) { - for (Vars_iter i = _vars.begin(); i != _vars.end(); i++) { + for (Vars_iter i = d_vars.begin(); i != d_vars.end(); i++) { (*i)->set_read_p(state); } BaseType::set_read_p(state); } - +#endif +#if 0 void Sequence::set_in_selection(bool state) { - for (Vars_iter i = _vars.begin(); i != _vars.end(); i++) { + for (Vars_iter i = d_vars.begin(); i != d_vars.end(); i++) { (*i)->set_in_selection(state); } BaseType::set_in_selection(state); } - +#endif +#if 0 /** @brief Adds a variable to the Sequence. Remember that if you wish to add a member to a nested @@ -342,14 +359,42 @@ if (!bt) throw InternalErr(__FILE__, __LINE__, "Cannot add variable: NULL pointer"); + if (bt->is_dap4_only_type()) + throw InternalErr(__FILE__, __LINE__, "Attempt to add a DAP4 type to a DAP2 Sequence."); + // Jose Garcia // We append a copy of bt so the owner of bt is free to deallocate BaseType *bt_copy = bt->ptr_duplicate(); bt_copy->set_parent(this); - _vars.push_back(bt_copy); + d_vars.push_back(bt_copy); } +/** @brief Adds a variable to the Sequence. + + @note Remember that if you wish to add a member to a nested + Sequence, you must use the add_var() of that + Sequence. This means that variable names need not be unique + among a set of nested Sequences. + @note This method does not copy the BaseType object; the caller + must not free the pointer. + + @param bt A pointer to the DAP2 type variable to add to this Sequence. + @param part defaults to nil */ +void +Sequence::add_var_nocopy(BaseType *bt, Part) +{ + if (!bt) + throw InternalErr(__FILE__, __LINE__, + "Cannot add variable: NULL pointer"); + if (bt->is_dap4_only_type()) + throw InternalErr(__FILE__, __LINE__, "Attempt to add a DAP4 type to a DAP2 Sequence."); + + bt->set_parent(this); + d_vars.push_back(bt); +} +#endif +#if 0 // Deprecated BaseType * Sequence::var(const string &n, btp_stack &s) @@ -373,11 +418,12 @@ else return m_leaf_match(n, s); } - +#endif +#if 0 BaseType * Sequence::m_leaf_match(const string &name, btp_stack *s) { - for (Vars_iter i = _vars.begin(); i != _vars.end(); i++) { + for (Vars_iter i = d_vars.begin(); i != d_vars.end(); i++) { if ((*i)->name() == name) { if (s) s->push(static_cast(this)); @@ -399,7 +445,7 @@ BaseType * Sequence::m_exact_match(const string &name, btp_stack *s) { - for (Vars_iter i = _vars.begin(); i != _vars.end(); i++) { + for (Vars_iter i = d_vars.begin(); i != d_vars.end(); i++) { if ((*i)->name() == name) { if (s) s->push(static_cast(this)); @@ -424,7 +470,7 @@ return 0; } - +#endif /** @brief Get a whole row from the sequence. @param row Get row number row from the sequence. @return A BaseTypeRow object (vector). Null if there's no such @@ -498,25 +544,52 @@ return (*bt_row_ptr)[i]; } +#if 0 unsigned int Sequence::width() { unsigned int sz = 0; - for (Vars_iter i = _vars.begin(); i != _vars.end(); i++) { + for (Vars_iter i = d_vars.begin(); i != d_vars.end(); i++) { sz += (*i)->width(); } return sz; } +/** This version of width simply returns the same thing as width() for simple + types and Arrays. For Sequence it returns the total row size if constrained + is false, or the size of the row elements in the current projection if true. + + @param constrained If true, return the size after applying a constraint. + @return The number of bytes used by the variable. + */ +unsigned int +Sequence::width(bool constrained) +{ + unsigned int sz = 0; + + for (Vars_iter i = d_vars.begin(); i != d_vars.end(); i++) { + if (constrained) { + if ((*i)->send_p()) + sz += (*i)->width(constrained); + } + else { + sz += (*i)->width(constrained); + } + } + + return sz; +} +#endif + // This version returns -1. Each API-specific subclass should define a more // reasonable version. jhrg 5/24/96 /** Returns the number of elements in a Sequence object. Note that this is not the number of items in a row, but the number of rows in the complete sequence object. To be meaningful, this - must be computed after constraint expresseion (CE) evaluation. + must be computed after constraint expression (CE) evaluation. The purpose of this function is to facilitate translations between Sequence objects and Array objects, particularly when the Sequence is too large to be transferred from the server to @@ -525,7 +598,7 @@ This function, to be useful, must be specialized for the API and data format in use. - @return The base implentation returns -1, indicating that the + @return The base implementation returns -1, indicating that the length is not known. Sub-classes specific to a particular API will have a more complete implementation. */ int @@ -716,7 +789,7 @@
  • CE evaluation happens only in a leaf sequence.
  • -
  • When no data statisfies a CE, the empty Sequence is signalled by a +
  • When no data satisfies a CE, the empty Sequence is signaled by a single EOS marker, regardless of the level of nesting of Sequences. That is, the EOS marker is sent for only the outer Sequence in the case of a completely empty response.
  • @@ -761,10 +834,10 @@ // write_start_of_instance(sink); // In this loop serialize will signal an error with an exception. - for (Vars_iter iter = _vars.begin(); iter != _vars.end(); iter++) { + for (Vars_iter iter = d_vars.begin(); iter != d_vars.end(); iter++) { // Only call serialize for child Sequences; the leaf sequence // will trigger the transmission of values for its parents (this - // sequence and maybe others) once it gets soem valid data to + // sequence and maybe others) once it gets some valid data to // send. // Note that if the leaf sequence has no variables in the current // projection, its serialize() method will never be called and that's @@ -784,7 +857,7 @@ d_row_number = -1; // Always write the EOS marker? 12/23/04 jhrg - // Yes. According to DAP2, a completely empty response is signalled by + // Yes. According to DAP2, a completely empty response is signaled by // a return value of only the EOS marker for the outermost sequence. if (d_top_most || d_wrote_soi) { DBG(cerr << "Writing End of Sequence marker" << endl); @@ -796,9 +869,9 @@ } // If we are here then we know that this is 'parent sequence' and that the -// leaf seq has found valid data to send. We also know that +// leaf sequence has found valid data to send. We also know that // serialize_parent_part_one has been called so data are in the instance's -// fields. This is wheree we send data. Whereas ..._part_one() contains a +// fields. This is where we send data. Whereas ..._part_one() contains a // loop to iterate over all of rows in a parent sequence, this does not. This // method assumes that the serialize_leaf() will call it each time it needs // to be called. @@ -813,7 +886,7 @@ BaseType *btp = get_parent(); if (btp && btp->type() == dods_sequence_c) - dynamic_cast(*btp).serialize_parent_part_two(dds, eval, m); + static_cast(*btp).serialize_parent_part_two(dds, eval, m); if (d_unsent_data) { DBG(cerr << "Writing Start of Instance marker" << endl); @@ -821,7 +894,7 @@ write_start_of_instance(m); // In this loop serialize will signal an error with an exception. - for (Vars_iter iter = _vars.begin(); iter != _vars.end(); iter++) { + for (Vars_iter iter = d_vars.begin(); iter != d_vars.end(); iter++) { // Send all the non-sequence variables DBG(cerr << "Sequence::serialize_parent_part_two(), serializing " << (*iter)->name() << endl); @@ -864,7 +937,7 @@ if (status && !is_end_of_rows(i)) { BaseType *btp = get_parent(); if (btp && btp->type() == dods_sequence_c) - dynamic_cast(*btp).serialize_parent_part_two(dds, + static_cast(*btp).serialize_parent_part_two(dds, eval, m); } @@ -877,7 +950,7 @@ write_start_of_instance(m); // In this loop serialize will signal an error with an exception. - for (Vars_iter iter = _vars.begin(); iter != _vars.end(); iter++) { + for (Vars_iter iter = d_vars.begin(); iter != d_vars.end(); iter++) { DBG(cerr << "Sequence::serialize_leaf(), serializing " << (*iter)->name() << endl); if ((*iter)->send_p()) { @@ -892,7 +965,7 @@ DBG(cerr << "Sequence::serialize_leaf::read_row() status: " << status << endl); } - // Only write the EOS marker if there's a matching Start Of Instnace + // Only write the EOS marker if there's a matching Start Of Instance // Marker in the stream. if (d_wrote_soi || d_top_most) { DBG(cerr << "Writing End of Sequence marker" << endl); @@ -922,7 +995,7 @@ Sequences which have a parent (directly or indirectly) variable that is a Sequence. - @param eval Use this contraint evaluator + @param eval Use this constraint evaluator @param dds This DDS holds the variables for the data source */ void Sequence::intern_data(ConstraintEvaluator &eval, DDS &dds) @@ -973,9 +1046,9 @@ // Grab the current size of the value stack. We do this because it is // possible that no nested sequences for this row happened to be - // selected because of a constract evaluation or the last row is not + // selected because of a constraint evaluation or the last row is not // selected because of a constraint evaluation. In either case, no - // nested sequence d_values are pused onto the stack, so there is + // nested sequence d_values are pushed onto the stack, so there is // nothing to pop at the end of this function. pcw 07/14/08 SequenceValues::size_type orig_stack_size = sequence_values_stack.size() ; @@ -988,7 +1061,7 @@ if ((*iter)->send_p()) { switch ((*iter)->type()) { case dods_sequence_c: - dynamic_cast(**iter).intern_data_private( + static_cast(**iter).intern_data_private( eval, dds, sequence_values_stack); break; @@ -1029,7 +1102,7 @@ BaseType *btp = get_parent(); if (btp && btp->type() == dods_sequence_c) { - dynamic_cast(*btp).intern_data_parent_part_two( + static_cast(*btp).intern_data_parent_part_two( dds, eval, sequence_values_stack); } @@ -1092,7 +1165,7 @@ // This call will read the values for the parent sequences and // then allocate a new instance for the leaf and push that onto // the stack. - dynamic_cast(*btp).intern_data_parent_part_two( + static_cast(*btp).intern_data_parent_part_two( dds, eval, sequence_values_stack); } @@ -1142,7 +1215,7 @@ @param um An UnMarshaller that knows how to deserialize data @param dds A DataDDS from which to read. @param reuse Passed to child objects when they are deserialized. Some - implementations of derialize() use this to determine if new storage should + implementations of deserialize() use this to determine if new storage should be allocated or existing storage reused. @exception Error if a sequence stream marker cannot be read. @exception InternalErr if the dds param is not a DataDDS. @@ -1179,7 +1252,7 @@ << name() << endl); BaseTypeRow *bt_row_ptr = new BaseTypeRow; // Read the instance's values, building up the row - for (Vars_iter iter = _vars.begin(); iter != _vars.end(); iter++) { + for (Vars_iter iter = d_vars.begin(); iter != d_vars.end(); iter++) { BaseType *bt_ptr = (*iter)->ptr_duplicate(); bt_ptr->deserialize(um, dds, reuse); DBG2(cerr << "Deserialized " << bt_ptr->name() << " (" @@ -1255,7 +1328,7 @@ If omitted, the stride defaults to 1. @param start The starting row number. The first row is row zero. - @param stop The eding row number. The 20th row is row 19. + @param stop The ending row number. The 20th row is row 19. @param stride The stride. A stride of two skips every other row. */ void Sequence::set_row_number_constraint(int start, int stop, int stride) @@ -1268,6 +1341,7 @@ d_ending_row_number = stop; } +#if 0 /** Never use this interface for Sequence! To add data to the members of a Sequence, use BaseTypeRow variables and operate on them individually. */ unsigned int @@ -1287,46 +1361,16 @@ throw InternalErr(__FILE__, __LINE__, "Use Sequence::var_value() or Sequence::row_value() in place of Sequence::buf2val()"); return sizeof(Sequence); } +#endif -#if FILE_METHODS void Sequence::print_one_row(FILE *out, int row, string space, bool print_row_num) { - if (print_row_num) - fprintf(out, "\n%s%d: ", space.c_str(), row) ; - - fprintf(out, "{ ") ; - - int elements = element_count() - 1; - int j; - BaseType *bt_ptr; - // Print first N-1 elements of the row. - for (j = 0; j < elements; ++j) { - bt_ptr = var_value(row, j); - if (bt_ptr) { // data - if (bt_ptr->type() == dods_sequence_c) - dynamic_cast(bt_ptr)->print_val_by_rows - (out, space + " ", false, print_row_num); - else - bt_ptr->print_val(out, space, false); - fprintf(out, ", ") ; - } - } - - // Print Nth element; end with a `}.' - bt_ptr = var_value(row, j); - if (bt_ptr) { // data - if (bt_ptr->type() == dods_sequence_c) - dynamic_cast(bt_ptr)->print_val_by_rows - (out, space + " ", false, print_row_num); - else - bt_ptr->print_val(out, space, false); - } - - fprintf(out, " }") ; + ostringstream oss; + print_one_row(oss, row, space, print_row_num); + fwrite(oss.str().data(), sizeof(char), oss.str().length(), out); } -#endif void Sequence::print_one_row(ostream &out, int row, string space, @@ -1351,7 +1395,7 @@ bt_ptr = var_value(row, j++); if (bt_ptr) { // data if (bt_ptr->type() == dods_sequence_c) - dynamic_cast(bt_ptr)->print_val_by_rows + static_cast(bt_ptr)->print_val_by_rows (out, space + " ", false, print_row_num); else bt_ptr->print_val(out, space, false); @@ -1364,7 +1408,7 @@ if (bt_ptr) { // data out << ", "; if (bt_ptr->type() == dods_sequence_c) - dynamic_cast(bt_ptr)->print_val_by_rows + static_cast(bt_ptr)->print_val_by_rows (out, space + " ", false, print_row_num); else bt_ptr->print_val(out, space, false); @@ -1374,32 +1418,14 @@ out << " }" ; } -#if FILE_METHODS void Sequence::print_val_by_rows(FILE *out, string space, bool print_decl_p, bool print_row_numbers) { - if (print_decl_p) { - print_decl(out, space, false); - fprintf(out, " = ") ; - } - - fprintf(out, "{ ") ; - - int rows = number_of_rows() - 1; - int i; - for (i = 0; i < rows; ++i) { - print_one_row(out, i, space, print_row_numbers); - fprintf(out, ", ") ; - } - print_one_row(out, i, space, print_row_numbers); - - fprintf(out, " }") ; - - if (print_decl_p) - fprintf(out, ";\n") ; + ostringstream oss; + print_val_by_rows(oss, space, print_decl_p, print_row_numbers); + fwrite(oss.str().data(), sizeof(char), oss.str().length(), out); } -#endif void Sequence::print_val_by_rows(ostream &out, string space, bool print_decl_p, @@ -1426,13 +1452,11 @@ out << ";\n" ; } -#if FILE_METHODS void Sequence::print_val(FILE *out, string space, bool print_decl_p) { print_val_by_rows(out, space, print_decl_p, false); } -#endif void Sequence::print_val(ostream &out, string space, bool print_decl_p) @@ -1440,18 +1464,18 @@ print_val_by_rows(out, space, print_decl_p, false); } - +#if 0 bool Sequence::check_semantics(string &msg, bool all) { if (!BaseType::check_semantics(msg)) return false; - if (!unique_names(_vars, name(), type_name(), msg)) + if (!unique_names(d_vars, name(), type_name(), msg)) return false; if (all) - for (Vars_iter i = _vars.begin(); i != _vars.end(); i++) { + for (Vars_iter i = d_vars.begin(); i != d_vars.end(); i++) { if (!(*i)->check_semantics(msg, true)) { return false; } @@ -1459,6 +1483,7 @@ return true; } +#endif void Sequence::set_leaf_p(bool state) @@ -1477,8 +1502,8 @@ In a nested Sequence, the Sequence which holds the leaf elements is special because it during the serialization of this Sequence's data that constraint Expressions must be evaluated. If CEs are evaluated at the upper levels, - then valid data may not be sent because it was effectlively hidden from the - serialization and evaluation code (see the documentatin for the serialize_leaf() + then valid data may not be sent because it was effectively hidden from the + serialization and evaluation code (see the documentation for the serialize_leaf() method). The notion of the leaf Sequence needs to be modified to mean the lowest level @@ -1505,7 +1530,7 @@ DBG2(cerr << "Processing sequence " << name() << endl); - for (Vars_iter iter = _vars.begin(); iter != _vars.end(); iter++) { + for (Vars_iter iter = d_vars.begin(); iter != d_vars.end(); iter++) { // About the test for send_p(): Only descend into a sequence if it has // fields that might be sent. Thus if, in a two-level sequence, nothing // in the lower level is to be sent, the upper level is marked as the @@ -1516,10 +1541,10 @@ throw Error("This implementation does not support more than one nested sequence at a level. Contact the server administrator."); has_child_sequence = true; - dynamic_cast(**iter).set_leaf_sequence(++lvl); + static_cast(**iter).set_leaf_sequence(++lvl); } else if ((*iter)->type() == dods_structure_c) { - dynamic_cast(**iter).set_leaf_sequence(lvl); + static_cast(**iter).set_leaf_sequence(lvl); } } diff -Nru libdap-3.11.1/Sequence.h libdap-3.12.0/Sequence.h --- libdap-3.11.1/Sequence.h 2011-04-29 13:19:42.000000000 +0000 +++ libdap-3.12.0/Sequence.h 2013-10-17 21:27:40.000000000 +0000 @@ -18,7 +18,7 @@ // // You should have received a copy of the GNU Lesser General Public // License along with this library; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA // // You can contact OPeNDAP, Inc. at PO Box 112, Saunderstown, RI. 02874-0112. @@ -57,10 +57,9 @@ #include "ConstraintEvaluator.h" #endif -// FIXME +#ifndef S_XDRUtils_h #include "XDRUtils.h" - -#define FILE_METHODS 1 +#endif namespace libdap { @@ -205,17 +204,16 @@ // In a hierarchy of sequences, is this the top most? bool d_top_most; - - void _duplicate(const Sequence &s); +#if 0 BaseType *m_leaf_match(const string &name, btp_stack *s = 0); BaseType *m_exact_match(const string &name, btp_stack *s = 0); - +#endif bool is_end_of_rows(int i); friend class SequenceTest; protected: - + void m_duplicate(const Sequence &s); typedef stack sequence_values_stack_t; virtual bool serialize_parent_part_one(DDS &dds, @@ -256,17 +254,24 @@ virtual BaseType *ptr_duplicate(); - virtual string toString(); + virtual bool is_dap2_only_type(); + virtual string toString(); +#if 0 virtual int element_count(bool leaves = false); - +#endif virtual bool is_linear(); - +#if 0 virtual void set_send_p(bool state); virtual void set_read_p(bool state); +#endif +#if 0 virtual void set_in_selection(bool state); - - virtual unsigned int width(); +#endif +#if 0 + virtual unsigned int width(bool constrained = false); + virtual unsigned int width(bool constrained); +#endif virtual int length(); @@ -276,8 +281,7 @@ ConstraintEvaluator &eval, bool ce_eval = true); virtual void intern_data(ConstraintEvaluator &eval, DDS &dds); - virtual bool serialize(ConstraintEvaluator &eval, DDS &dds, - Marshaller &m, bool ce_eval = true); + virtual bool serialize(ConstraintEvaluator &eval, DDS &dds, Marshaller &m, bool ce_eval = true); virtual bool deserialize(UnMarshaller &um, DDS *dds, bool reuse = false); /// Rest the row number counter @@ -303,24 +307,28 @@ d_unsent_data = usd; } +#if 0 // Move me! virtual unsigned int val2buf(void *val, bool reuse = false); virtual unsigned int buf2val(void **val); +#endif virtual void set_value(SequenceValues &values); virtual SequenceValues value(); - - virtual BaseType *var(const string &name, bool exact_match = true, - btp_stack *s = 0); +#if 0 + virtual BaseType *var(const string &name, bool exact_match = true,btp_stack *s = 0); virtual BaseType *var(const string &n, btp_stack &s); +#endif virtual BaseType *var_value(size_t row, const string &name); virtual BaseType *var_value(size_t row, size_t i); virtual BaseTypeRow *row_value(size_t row); - +#if 0 virtual void add_var(BaseType *, Part part = nil); + virtual void add_var_nocopy(BaseType *, Part part = nil); +#endif virtual void print_one_row(ostream &out, int row, string space, bool print_row_num = false); virtual void print_val_by_rows(ostream &out, string space = "", @@ -329,7 +337,6 @@ virtual void print_val(ostream &out, string space = "", bool print_decl_p = true); -#if FILE_METHODS virtual void print_one_row(FILE *out, int row, string space, bool print_row_num = false); virtual void print_val_by_rows(FILE *out, string space = "", @@ -337,10 +344,9 @@ bool print_row_numbers = true); virtual void print_val(FILE *out, string space = "", bool print_decl_p = true); -#endif - +#if 0 virtual bool check_semantics(string &msg, bool all = false); - +#endif virtual void set_leaf_p(bool state); virtual bool is_leaf_sequence(); diff -Nru libdap-3.11.1/ServerFunction.cc libdap-3.12.0/ServerFunction.cc --- libdap-3.11.1/ServerFunction.cc 1970-01-01 00:00:00.000000000 +0000 +++ libdap-3.12.0/ServerFunction.cc 2013-10-17 21:27:40.000000000 +0000 @@ -0,0 +1,88 @@ +// -*- mode: c++; c-basic-offset:4 -*- + +// This file is part of libdap, A C++ implementation of the OPeNDAP Data +// Access Protocol. + +// Copyright (c) 2013 OPeNDAP, Inc. +// Author: Nathan Potter +// +// This library is free software; you can redistribute it and/or +// modify it under the terms of the GNU Lesser General Public +// License as published by the Free Software Foundation; either +// version 2.1 of the License, or (at your option) any later version. +// +// This library 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 +// Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, write to the Free Software +// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA +// +// You can contact OPeNDAP, Inc. at PO Box 112, Saunderstown, RI. 02874-0112. + +/* + * AbstractFunction.cc + * + * Created on: Feb 2, 2013 + * Author: ndp + */ + +#include "ServerFunction.h" + +namespace libdap { + +ServerFunction::ServerFunction() { + setName("abstract_function"); + setDescriptionString("This function does nothing."); + setUsageString("You can't use this function"); + setRole("http://services.opendap.org/dap4/server-side-function/null"); + setDocUrl("http://docs.opendap.org/index.php/Server_Side_Processing_Functions"); + d_bool_func = 0; + d_btp_func = 0; + d_proj_func = 0; + +} + +ServerFunction::ServerFunction(string name, string version, string description, string usage, string doc_url, string role, bool_func f){ + setName(name); + setVersion(version); + setDescriptionString(description); + setUsageString(usage); + setRole(role); + setDocUrl(doc_url); + setFunction(f); +} + +ServerFunction::ServerFunction(string name, string version, string description, string usage, string doc_url, string role, btp_func f){ + setName(name); + setVersion(version); + setDescriptionString(description); + setUsageString(usage); + setRole(role); + setDocUrl(doc_url); + setFunction(f); + +} + +ServerFunction::ServerFunction(string name, string version, string description, string usage, string doc_url, string role, proj_func f){ + setName(name); + setVersion(version); + setDescriptionString(description); + setUsageString(usage); + setRole(role); + setDocUrl(doc_url); + setFunction(f); +} + + +ServerFunction::~ServerFunction() { + d_bool_func = 0; + d_btp_func = 0; + d_proj_func = 0; +} + + + +} /* namespace libdap */ diff -Nru libdap-3.11.1/ServerFunction.h libdap-3.12.0/ServerFunction.h --- libdap-3.11.1/ServerFunction.h 1970-01-01 00:00:00.000000000 +0000 +++ libdap-3.12.0/ServerFunction.h 2013-10-17 21:27:40.000000000 +0000 @@ -0,0 +1,136 @@ +// -*- mode: c++; c-basic-offset:4 -*- + +// This file is part of libdap, A C++ implementation of the OPeNDAP Data +// Access Protocol. + +// Copyright (c) 2013 OPeNDAP, Inc. +// Author: Nathan Potter +// +// This library is free software; you can redistribute it and/or +// modify it under the terms of the GNU Lesser General Public +// License as published by the Free Software Foundation; either +// version 2.1 of the License, or (at your option) any later version. +// +// This library 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 +// Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, write to the Free Software +// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA +// +// You can contact OPeNDAP, Inc. at PO Box 112, Saunderstown, RI. 02874-0112. + +/* + * AbstractFunction.h + * + * Created on: Feb 2, 2013 + * Author: ndp + */ + +#ifndef ABSTRACTFUNCTION_H_ +#define ABSTRACTFUNCTION_H_ + +#include +#include "expr.h" + +using std::endl; + +#include "BaseType.h" + +namespace libdap { + + +class ServerFunction { + +private: + string name; + string description; + string usage; + string doc_url; // @TODO 'doc_url' Should be a URL object. + string role; // @TODO 'role' Should be a URI object. + string version; + + libdap::bool_func d_bool_func; + libdap::btp_func d_btp_func; + libdap::proj_func d_proj_func; + +public: + ServerFunction(); + ServerFunction(string name, string version, string description, string usage, string doc_url, string role, bool_func f); + ServerFunction(string name, string version, string description, string usage, string doc_url, string role, btp_func f); + ServerFunction(string name, string version, string description, string usage, string doc_url, string role, proj_func f); + virtual ~ServerFunction(); + + + + string getName() { return name; } + void setName(const string &n){ name = n; } + + string getUsageString() { return usage; } + void setUsageString(const string &u){ usage = u; } + + string getDocUrl() { return doc_url; } + void setDocUrl(const string &url){ doc_url = url; } + + string getRole() { return role; } + void setRole(const string &r){ role = r; } + + string getDescriptionString(){ return description; } + void setDescriptionString(const string &desc){ description = desc; } + + string getVersion(){ return version; } + void setVersion(const string &ver){ version = ver; } + + /** + * If you are writing a function that can only operate on a particular kind of data, or one that relies on the presence + * of particular metadata, then you might orride this method in order to stop the server from + * advertising the function in conjunction with datasets to which it cannot be applied. + * + * @param dds A DDS object for the dataset about which we will ask the question: + * Can this function operate on all or some portion of the contents of this dataset? + * CAUTION: Any implementation of this should be careful not to read data (or read as little as possible) from the + * passed DDS. Reading data in this method may have negative effect on overall performance. Examining metadata and + * dataset structure should be the basis for determining the applicability of a function to the dataset. + * @return true If this function operate on all or some portion of the contents of this dataset, false otherwise. + */ + virtual bool canOperateOn(DDS &) { return true; } + + void setFunction(bool_func bf){ + d_bool_func = bf; + d_btp_func = 0; + d_proj_func = 0; + } + + void setFunction(btp_func btp){ + d_bool_func = 0; + d_btp_func = btp; + d_proj_func = 0; + } + + void setFunction(proj_func pf){ + d_bool_func = 0; + d_btp_func = 0; + d_proj_func = pf; + } + + string getTypeString(){ + if(d_bool_func) + return "boolean"; + if(d_btp_func) + return "basetype"; + if(d_proj_func) + return "projection"; + return "null"; + } + + + bool_func get_bool_func(){ return d_bool_func; } + btp_func get_btp_func() { return d_btp_func; } + proj_func get_proj_func(){ return d_proj_func; } + +}; + +} /* namespace libdap */ +#endif /* ABSTRACTFUNCTION_H_ */ diff -Nru libdap-3.11.1/ServerFunctionsList.cc libdap-3.12.0/ServerFunctionsList.cc --- libdap-3.11.1/ServerFunctionsList.cc 1970-01-01 00:00:00.000000000 +0000 +++ libdap-3.12.0/ServerFunctionsList.cc 2013-10-17 21:27:40.000000000 +0000 @@ -0,0 +1,457 @@ +// ServerFunctionsList.cc + +// This file is part of bes, A C++ back-end server implementation framework +// for the OPeNDAP Data Access Protocol. + +// Copyright (c) 2013 OPeNDAP, Inc. +// Author: James Gallagher +// +// This library is free software; you can redistribute it and/or +// modify it under the terms of the GNU Lesser General Public +// License as published by the Free Software Foundation; either +// version 2.1 of the License, or (at your option) any later version. +// +// This library 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 +// Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, write to the Free Software +// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA +// +// You can contact OPeNDAP, Inc. at PO Box 112, Saunderstown, RI. 02874-0112. + +#include "config.h" + +#ifdef HAVE_STDLIB_H +#include +#endif + +#include + +#include +#include + +//#define DODS_DEBUG + +#include +#include "debug.h" + +#include "ServerFunctionsList.h" + +using std::cerr; +using std::string; +using std::endl; +using namespace std; +using namespace libdap; + +namespace libdap { + +static pthread_once_t ServerFunctionsList_instance_control = PTHREAD_ONCE_INIT; + +ServerFunctionsList *ServerFunctionsList::d_instance = 0 ; + +/** + * private static that only gets called once in the life cycle of the process. + */ +void ServerFunctionsList::initialize_instance() { + if (d_instance == 0) { + DBG(cerr << "ServerFunctionsList::initialize_instance() - Creating singleton ServerFunctionList instance." << endl); + d_instance = new ServerFunctionsList; + #if HAVE_ATEXIT + atexit(delete_instance); + #endif + } +} + +/** + * Private static function can only be called by friends andf pThreads code. + */ +void ServerFunctionsList::delete_instance() { + DBG(cerr << "ServerFunctionsList::delete_instance() - Deleting singleton ServerFunctionList instance." << endl); + delete d_instance; + d_instance = 0; +} + +/** + * Private method insures that nobody can try to delete the singleton class. + */ + +ServerFunctionsList::~ServerFunctionsList() { + std::multimap::iterator fit; + for(fit=d_func_list.begin(); fit!=d_func_list.end() ; fit++){ + libdap::ServerFunction *func = fit->second; + DBG(cerr << "ServerFunctionsList::~ServerFunctionsList() - Deleting ServerFunction " << func->getName() << " from ServerFunctionsList." << endl); + delete func; + } + d_func_list.clear(); +} + +ServerFunctionsList * ServerFunctionsList::TheList() { + pthread_once(&ServerFunctionsList_instance_control, initialize_instance); + DBG(cerr << "ServerFunctionsList::TheList() - Returning singleton ServerFunctionList instance." << endl); + return d_instance; +} + +/** + * Adds the passed ServerFunction pointer to the list of ServerFunctions using + * the value of ServerFunction.getName() as the key in the list. + * + * @brief Adds the passed ServerFunction pointer to the list of ServerFunctions. + * @param *func A pointer to the ServerFunction object to add to the ServerFunctionList. + * The pointer is copied, not the object referenced; this class does not + * delete the pointer. + */ +void ServerFunctionsList::add_function(ServerFunction *func ) +{ + DBG(cerr << "ServerFunctionsList::add_function() - Adding ServerFunction " << func->getName() << endl); + d_func_list.insert(std::make_pair(func->getName(),func)); +} + +#if 0 + +bool +ServerFunctionsList::add_function( string name, btp_func func ) +{ + if (d_btp_func_list[name] == 0) { + d_btp_func_list[name] = func; + return true; + } + + return false; +} + + +bool +ServerFunctionsList::add_function( string name, bool_func func ) +{ + if (d_bool_func_list[name] == 0) { + d_bool_func_list[name] = func; + return true; + } + + return false; +} + +bool +ServerFunctionsList::add_function( string name, proj_func func ) +{ + if (d_proj_func_list[name] == 0) { + d_proj_func_list[name] = func; + return true; + } + + return false; +} +#endif + +#if 0 +void ServerFunctionsList::store_functions(ConstraintEvaluator &ce) +{ + if (d_btp_func_list.size() > 0) { + map::iterator i = d_btp_func_list.begin(); + map::iterator e = d_btp_func_list.end(); + while (i != e) { + ce.add_function((*i).first, (*i).second); + ++i; + } + } + + if (d_bool_func_list.size() > 0) { + map::iterator i = d_bool_func_list.begin(); + map::iterator e = d_bool_func_list.end(); + while (i != e) { + ce.add_function((*i).first, (*i).second); + ++i; + } + } + + if (d_proj_func_list.size() > 0) { + map::iterator i = d_proj_func_list.begin(); + map::iterator e = d_proj_func_list.end(); + while (i != e) { + ce.add_function((*i).first, (*i).second); + ++i; + } + } +} +#endif + +/** + * Returns the first boolean function in the list whose key value matches the passed string name. + * When a match is found the function returns true and sets returned value parameter *f to + * the boolean function held by the ServerFunction object extracted from the list. + * + * Method: + * Looks through the list of ServerFunctions and compares each function's key value (which + * would be the value of SurverFunction.getName()) with the value of the string parameter + * 'name'. When they match then the returned value parameter is set to the value returned + * by ServerFunction.get_btp_func(). If the ServerFunction _is not_ a instance of a boolean + * function then the return value will be 0 (null) and the search for matching function will continue. + * If the ServerFunction _is_ a boolean function then the returned value will be non-zero and + * the search will return true (it found the thing) and the returned value parameter *f will have + * it's value set to the boolean function. + * + * @brief Find a boolean function with a given name in the function list. + * @param name A string containing the name of the function to find. + * @param *f A returned value parameter through which a point to the desired function is returned. + * + */ +bool ServerFunctionsList::find_function(const std::string &name, bool_func *f) const +{ +#if 0 + if (d_bool_func_list.empty()) + return false; + + map::const_iterator i = d_bool_func_list.begin(); + while(i != d_bool_func_list.end()) { + if (name == (*i).first && (*f = (*i).second)) { + return true; + } + ++i; + } + + return false; +#endif + + if (d_func_list.empty()) + return false; + + std::pair ::const_iterator, std::multimap::const_iterator> ret; + ret = d_func_list.equal_range(name); + for (std::multimap::const_iterator it=ret.first; it!=ret.second; ++it) { + if (name == it->first && (*f = it->second->get_bool_func())){ + DBG(cerr << "ServerFunctionsList::find_function() - Found boolean function " << it->second->getName() << endl); + return true; + } + } + return false; + +} + + + +/** + * Returns the first BaseType function in the list whose key value matches the passed string name. + * When a match is found the function returns true and sets returned value parameter *f to + * the BaseType function held by the ServerFunction object extracted from the list. + * + * Method: + * Looks through the list of ServerFunctions and compares each function's key value (which + * would be the value of SurverFunction.getName()) with the value of the string parameter + * 'name'. When they match then the returned value parameter is set to the value returned + * by ServerFunction.get_btp_func(). If the ServerFunction _is not_ a instance of a BaseType + * function then the return value will be 0 (null) and the search for matching function will continue. + * If the ServerFunction _is_ a BaseType function then the returned value will be non-zero and + * the search will return true (it found the thing) and the returned value parameter *f will have + * it's value set to the BaseType function. + * + * @brief Find a BaseType function with a given name in the function list. + * @param name A string containing the name of the function to find. + * @param *f A returned value parameter through which a point to the desired function is returned. + * + */ +bool ServerFunctionsList::find_function(const string &name, btp_func *f) const +{ + +#if 0 + if (d_btp_func_list.empty()) + return false; + + map::const_iterator i = d_btp_func_list.begin(); + while(i != d_btp_func_list.end()) { + if (name == (*i).first && (*f = (*i).second)) { + return true; + } + ++i; + } + + return false; +#endif + + if (d_func_list.empty()) + return false; + DBG(cerr << "ServerFunctionsList::find_function() - Looking for ServerFunction '" << name << "'" << endl); + + std::pair ::const_iterator, std::multimap::const_iterator> ret; + ret = d_func_list.equal_range(name); + for (std::multimap::const_iterator it=ret.first; it!=ret.second; ++it) { + if (name == it->first && (*f = it->second->get_btp_func())){ + DBG(cerr << "ServerFunctionsList::find_function() - Found basetype function " << it->second->getName() << endl); + return true; + } + } + + return false; + + + +} + +/** + * Returns the first projection function in the list whose key value matches the passed string name. + * When a match is found the function returns true and sets returned value parameter *f to + * the projection function held by the ServerFunction object extracted from the list. + * + * Method: + * Looks through the list of ServerFunctions and looks at each function's key value (which + * would be the value of SurverFunction.getName() for each function). When a function has the same + * key name as the value of the string parameter 'name', then the returned value parameter is set + * the value returned by ServerFunction.get_proj_func(). If the ServerFunction _is not_ a projection + * function then the return value will be 0 (null) and the search for matching function will continue. + * If the ServerFunction _is_ a projection then the returned value will be non-zero and the search will + * return true (it found the thing) and the returned value parameter *f will have it's value set + * to the projection function. + * + * @brief Find a projection function with a given name in the function list. + * @param name A string containing the name of the function to find. + * @param *f A returned value parameter through which a point to the desired function is returned. + * + */ +bool ServerFunctionsList::find_function(const string &name, proj_func *f) const +{ + +#if 0 + if (d_proj_func_list.empty()) + return false; + + map::const_iterator i = d_proj_func_list.begin(); + while(i != d_proj_func_list.end()) { + if (name == (*i).first && (*f = (*i).second)) { + return true; + } + ++i; + } + + return false; +#endif + + if (d_func_list.empty()) + return false; + + std::pair ::const_iterator, std::multimap::const_iterator> ret; + ret = d_func_list.equal_range(name); + for (std::multimap::const_iterator it=ret.first; it!=ret.second; ++it) { + if (name == it->first && (*f = it->second->get_proj_func())){ + DBG(cerr << "ServerFunctionsList::find_function() - Found projection function " << it->second->getName() << endl); + return true; + } + } + return false; + +} + + + +/** @brief Returns an iterator pointing to the first key pair in the ServerFunctionList. */ +std::multimap::iterator ServerFunctionsList::begin() +{ + return d_func_list.begin(); +} + +/** @brief Returns an iterator pointing to the last key pair in the ServerFunctionList. */ +std::multimap::iterator ServerFunctionsList::end() +{ + return d_func_list.end(); +} + + +/** + * + * + * @brief Returns the ServerFunction pointed to by the passed iterator. + * + */ +libdap::ServerFunction *ServerFunctionsList::getFunction(std::multimap::iterator it) +{ + return (*it).second; +} + + + + + + +#if 0 +/** @brief dumps information about this object + * + * Displays the pointer value of this instance along with information about + * this catalog directory. + * + * @param strm C++ i/o stream to dump the information to + */ +void ServerFunctionsList::dump(ostream &strm) const +{ + strm << BESIndent::LMarg << "ServerFunctionsList::dump - (" << (void *) this << ")" << endl; + BESIndent::Indent(); + + if (d_btp_func_list.size() > 0) { + strm << BESIndent::LMarg << "registered btp functions:" << endl; + BESIndent::Indent(); + map::const_iterator i = d_btp_func_list.begin(); + map::const_iterator e = d_btp_func_list.end(); + while (i != e) { + strm << (*i).first << endl; + ++i; + } + BESIndent::UnIndent(); + } + else { + strm << BESIndent::LMarg << "registered btp functions: none" << endl; + } + + if (d_bool_func_list.size() > 0) { + strm << BESIndent::LMarg << "registered bool functions:" << endl; + BESIndent::Indent(); + map::const_iterator i = d_bool_func_list.begin(); + map::const_iterator e = d_bool_func_list.end(); + while (i != e) { + strm << (*i).first << endl; + ++i; + } + BESIndent::UnIndent(); + } + else { + strm << BESIndent::LMarg << "registered bool functions: none" << endl; + } + + if (d_proj_func_list.size() > 0) { + strm << BESIndent::LMarg << "registered projection functions:" << endl; + BESIndent::Indent(); + map::const_iterator i = d_proj_func_list.begin(); + map::const_iterator e = d_proj_func_list.end(); + while (i != e) { + strm << (*i).first << endl; + ++i; + } + BESIndent::UnIndent(); + } + else { + strm << BESIndent::LMarg << "registered projection functions: none" << endl; + } + + BESIndent::UnIndent(); +} + +ServerFunctionsList * +ServerFunctionsList::TheList() +{ + if (d_instance == 0) { + d_instance = new ServerFunctionsList; + } + return d_instance; +} + +#endif + +void ServerFunctionsList::getFunctionNames(vector *names){ + std::multimap::iterator fit; + for(fit=d_func_list.begin(); fit!=d_func_list.end() ; fit++){ + ServerFunction *func = fit->second; + names->push_back(func->getName()); + } +} + + +} diff -Nru libdap-3.11.1/ServerFunctionsList.h libdap-3.12.0/ServerFunctionsList.h --- libdap-3.11.1/ServerFunctionsList.h 1970-01-01 00:00:00.000000000 +0000 +++ libdap-3.12.0/ServerFunctionsList.h 2013-10-17 21:27:40.000000000 +0000 @@ -0,0 +1,83 @@ +// ServerFunctionsList.h + +// This file is part of bes, A C++ back-end server implementation framework +// for the OPeNDAP Data Access Protocol. + +// -*- mode: c++; c-basic-offset:4 -*- + +// This file is part of libdap, A C++ implementation of the OPeNDAP Data +// Access Protocol. + +// Copyright (c) 2013 OPeNDAP, Inc. +// Author: Nathan Potter +// +// This library is free software; you can redistribute it and/or +// modify it under the terms of the GNU Lesser General Public +// License as published by the Free Software Foundation; either +// version 2.1 of the License, or (at your option) any later version. +// +// This library 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 +// Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, write to the Free Software +// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA +// +// You can contact OPeNDAP, Inc. at PO Box 112, Saunderstown, RI. 02874-0112. + +#ifndef I_ServerFunctionsList_h +#define I_ServerFunctionsList_h 1 + +#include +#include +#include + +#include "ServerFunction.h" + + +namespace libdap { +class ServerFunctionsListUnitTest; +class ConstraintEvaluator; + +//#include "BESObj.h" + +class ServerFunctionsList { +private: + static ServerFunctionsList * d_instance; + std::multimap d_func_list; + + static void initialize_instance(); + static void delete_instance(); + + virtual ~ServerFunctionsList(); + + friend class libdap::ServerFunctionsListUnitTest; + +protected: + ServerFunctionsList() {} + +public: + static ServerFunctionsList * TheList(); + + + virtual void add_function(libdap::ServerFunction *func); + + virtual bool find_function(const std::string &name, libdap::bool_func *f) const; + virtual bool find_function(const std::string &name, libdap::btp_func *f) const; + virtual bool find_function(const std::string &name, libdap::proj_func *f) const; + + //virtual void dump(ostream &strm) const; + + std::multimap::iterator begin(); + std::multimap::iterator end(); + ServerFunction *getFunction(std::multimap::iterator it); + + virtual void getFunctionNames(vector *names); + +}; + +} + +#endif // I_ServerFunctionsList_h diff -Nru libdap-3.11.1/SignalHandler.cc libdap-3.12.0/SignalHandler.cc --- libdap-3.11.1/SignalHandler.cc 2011-04-29 13:19:42.000000000 +0000 +++ libdap-3.12.0/SignalHandler.cc 2013-10-17 21:27:40.000000000 +0000 @@ -19,7 +19,7 @@ // // You should have received a copy of the GNU Lesser General Public // License along with this library; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA // // You can contact OPeNDAP, Inc. at PO Box 112, Saunderstown, RI. 02874-0112. @@ -31,10 +31,6 @@ #include "config.h" -static char rcsid[] not_used = - { "$Id: SignalHandler.cc 22703 2010-05-11 18:10:01Z jimg $" - }; - #include #include @@ -86,7 +82,7 @@ } /** This private method is the adapter between the C-style interface of the - signal sub-system and C++'s method interface. This uses the lookup table + signal subsystem and C++'s method interface. This uses the lookup table to find an instance of EventHandler and calls that instance's handle_signal method. @@ -104,6 +100,7 @@ return; else if (old_handler == SIG_DFL) { switch (signum) { +#if 0 #ifndef WIN32 case SIGHUP: case SIGKILL: @@ -118,6 +115,11 @@ // register_handler() should never allow any fiddling with // signals other than those listed above. default: abort(); +#endif + // Calling _exit() or abort() is not a good thing for a library to be + // doing. This results in a warning from rpmlint + default: + throw Error("Signal handler operation on an unsupported signal."); } } else diff -Nru libdap-3.11.1/SignalHandler.h libdap-3.12.0/SignalHandler.h --- libdap-3.11.1/SignalHandler.h 2011-04-29 13:19:42.000000000 +0000 +++ libdap-3.12.0/SignalHandler.h 2013-10-17 21:27:40.000000000 +0000 @@ -19,7 +19,7 @@ // // You should have received a copy of the GNU Lesser General Public // License along with this library; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA // // You can contact OPeNDAP, Inc. at PO Box 112, Saunderstown, RI. 02874-0112. diff -Nru libdap-3.11.1/SignalHandlerRegisteredErr.h libdap-3.12.0/SignalHandlerRegisteredErr.h --- libdap-3.11.1/SignalHandlerRegisteredErr.h 2011-04-29 13:19:43.000000000 +0000 +++ libdap-3.12.0/SignalHandlerRegisteredErr.h 2013-10-17 21:27:40.000000000 +0000 @@ -19,7 +19,7 @@ // // You should have received a copy of the GNU Lesser General Public // License along with this library; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA // // You can contact OPeNDAP, Inc. at PO Box 112, Saunderstown, RI. 02874-0112. diff -Nru libdap-3.11.1/StdinResponse.h libdap-3.12.0/StdinResponse.h --- libdap-3.11.1/StdinResponse.h 2011-04-29 13:19:43.000000000 +0000 +++ libdap-3.12.0/StdinResponse.h 2013-10-17 21:27:40.000000000 +0000 @@ -19,7 +19,7 @@ // // You should have received a copy of the GNU Lesser General Public // License along with this library; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA // // You can contact OPeNDAP, Inc. at PO Box 112, Saunderstown, RI. 02874-0112. diff -Nru libdap-3.11.1/Str.cc libdap-3.12.0/Str.cc --- libdap-3.11.1/Str.cc 2011-04-29 13:19:43.000000000 +0000 +++ libdap-3.12.0/Str.cc 2013-10-17 21:27:40.000000000 +0000 @@ -19,7 +19,7 @@ // // You should have received a copy of the GNU Lesser General Public // License along with this library; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA // // You can contact OPeNDAP, Inc. at PO Box 112, Saunderstown, RI. 02874-0112. @@ -36,9 +36,7 @@ #include "config.h" -static char rcsid[] not_used = - {"$Id: Str.cc 21699 2009-11-05 00:06:01Z jimg $" - }; +#include #include "Byte.h" #include "Int16.h" @@ -54,6 +52,8 @@ #include "Sequence.h" #include "Grid.h" +#include "Marshaller.h" +#include "UnMarshaller.h" #include "DDS.h" #include "util.h" @@ -77,7 +77,7 @@ created. */ -Str::Str(const string &n) : BaseType(n, dods_str_c), _buf("") +Str::Str(const string &n) : BaseType(n, dods_str_c), d_buf("") {} /** The Str server-side constructor accepts the name of the variable and the @@ -88,12 +88,12 @@ variable is created */ Str::Str(const string &n, const string &d) - : BaseType(n, d, dods_str_c), _buf("") + : BaseType(n, d, dods_str_c), d_buf("") {} Str::Str(const Str ©_from) : BaseType(copy_from) { - _buf = copy_from._buf; + d_buf = copy_from.d_buf; } BaseType * @@ -111,7 +111,7 @@ // Call BaseType::operator=. dynamic_cast(*this) = rhs; - _buf = rhs._buf; + d_buf = rhs.d_buf; return *this; } @@ -119,11 +119,11 @@ unsigned int Str::length() { - return _buf.length(); + return d_buf.length(); } unsigned int -Str::width() +Str::width(bool) { return sizeof(string); } @@ -147,9 +147,9 @@ dds.timeout_off(); - m.put_str( _buf ) ; + m.put_str( d_buf ) ; - DBG(cerr << "Exiting: buf = " << _buf << endl); + DBG(cerr << "Exiting: buf = " << d_buf << endl); return true; } @@ -159,7 +159,7 @@ bool Str::deserialize(UnMarshaller &um, DDS *, bool) { - um.get_str( _buf ) ; + um.get_str( d_buf ) ; return false; } @@ -183,11 +183,11 @@ "No place to store a reference to the data."); // If *val is null, then the caller has not allocated storage for the // value; we must. If there is storage there, assume it is a string and - // assign _buf's value to that storage. + // assign d_buf's value to that storage. if (!*val) - *val = new string(_buf); + *val = new string(d_buf); else - *static_cast(*val) = _buf; + *static_cast(*val) = d_buf; return sizeof(string*); } @@ -211,7 +211,7 @@ if (!val) throw InternalErr(__FILE__, __LINE__, "NULL pointer."); - _buf = *static_cast(val); + d_buf = *static_cast(val); return sizeof(string*); } @@ -223,7 +223,7 @@ bool Str::set_value(const string &value) { - _buf = value; + d_buf = value; set_read_p(true); return true; @@ -234,31 +234,26 @@ string Str::value() const { - return _buf; + return d_buf; } -#if FILE_METHODS void Str::print_val(FILE *out, string space, bool print_decl_p) { - if (print_decl_p) { - print_decl(out, space, false); - fprintf(out, " = \"%s\";\n", escattr(_buf).c_str()) ; - } - else - fprintf(out, "\"%s\"", escattr(_buf).c_str()) ; + ostringstream oss; + print_val(oss, space, print_decl_p); + fwrite(oss.str().data(), sizeof(char), oss.str().length(), out); } -#endif void Str::print_val(ostream &out, string space, bool print_decl_p) { if (print_decl_p) { print_decl(out, space, false); - out << " = \"" << escattr(_buf) << "\";\n" ; + out << " = \"" << escattr(d_buf) << "\";\n" ; } else - out << "\"" << escattr(_buf) << "\"" ; + out << "\"" << escattr(d_buf) << "\"" ; } bool @@ -286,11 +281,9 @@ switch (b->type()) { case dods_str_c: - return rops > - (_buf, dynamic_cast(b)->_buf, op); + return StrCmp(op, d_buf, static_cast(b)->value()); case dods_url_c: - return rops > - (_buf, dynamic_cast(b)->_buf, op); + return StrCmp(op, d_buf, static_cast(b)->value()); default: return false; } @@ -311,7 +304,7 @@ << (void *)this << ")" << endl ; DapIndent::Indent() ; BaseType::dump(strm) ; - strm << DapIndent::LMarg << "value: " << _buf << endl ; + strm << DapIndent::LMarg << "value: " << d_buf << endl ; DapIndent::UnIndent() ; } diff -Nru libdap-3.11.1/Str.h libdap-3.12.0/Str.h --- libdap-3.11.1/Str.h 2011-04-29 13:19:42.000000000 +0000 +++ libdap-3.12.0/Str.h 2013-10-17 21:27:40.000000000 +0000 @@ -19,7 +19,7 @@ // // You should have received a copy of the GNU Lesser General Public // License along with this library; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA // // You can contact OPeNDAP, Inc. at PO Box 112, Saunderstown, RI. 02874-0112. @@ -41,8 +41,6 @@ #include "dods-limits.h" #include "BaseType.h" -#define FILE_METHODS 1 - namespace libdap { @@ -65,7 +63,7 @@ { protected: - string _buf; + string d_buf; public: Str(const string &n); @@ -80,7 +78,7 @@ virtual BaseType *ptr_duplicate(); - virtual unsigned int width(); + virtual unsigned int width(bool constrained = false); // Return the length of the stored string or zero if no string has been // stored in the instance's internal buffer. @@ -95,10 +93,9 @@ virtual bool set_value(const string &value); virtual string value() const; -#if FILE_METHODS + virtual void print_val(FILE *out, string space = "", bool print_decl_p = true); -#endif virtual void print_val(ostream &out, string space = "", bool print_decl_p = true); diff -Nru libdap-3.11.1/Structure.cc libdap-3.12.0/Structure.cc --- libdap-3.11.1/Structure.cc 2011-04-29 13:19:43.000000000 +0000 +++ libdap-3.12.0/Structure.cc 2013-10-17 21:27:40.000000000 +0000 @@ -19,7 +19,7 @@ // // You should have received a copy of the GNU Lesser General Public // License along with this library; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA // // You can contact OPeNDAP, Inc. at PO Box 112, Saunderstown, RI. 02874-0112. @@ -37,6 +37,8 @@ #include "config.h" +#include + #include "Byte.h" #include "Int16.h" #include "UInt16.h" @@ -51,6 +53,10 @@ #include "Sequence.h" #include "Grid.h" +#include "DDS.h" +#include "ConstraintEvaluator.h" + +#include "XDRStreamMarshaller.h" #include "util.h" #include "debug.h" #include "InternalErr.h" @@ -61,14 +67,21 @@ namespace libdap { +#if 0 +/** This method is protected so it's hidden from the whole world, but + * available to direct child classes. Because of that, we need a glue-routine + * here so children of Structure can specialize it. + */ void -Structure::_duplicate(const Structure &s) +Structure::m_duplicate(const Structure &s) { + Constructor::m_duplicate(s); +#if 0 Structure &cs = const_cast(s); DBG(cerr << "Copying structure: " << name() << endl); - for (Vars_iter i = cs._vars.begin(); i != cs._vars.end(); i++) { + for (Vars_iter i = cs.d_vars.begin(); i != cs.d_vars.end(); i++) { DBG(cerr << "Copying field: " << (*i)->name() << endl); // Jose Garcia // I think this assert here is part of a debugging @@ -77,9 +90,11 @@ // assert(*i); BaseType *btp = (*i)->ptr_duplicate(); btp->set_parent(this); - _vars.push_back(btp); + d_vars.push_back(btp); } +#endif } +#endif /** The Structure constructor requires only the name of the variable to be created. The name may be omitted, which will create a @@ -107,12 +122,12 @@ /** The Structure copy constructor. */ Structure::Structure(const Structure &rhs) : Constructor(rhs) { - _duplicate(rhs); + m_duplicate(rhs); } Structure::~Structure() { - for (Vars_iter i = _vars.begin(); i != _vars.end(); i++) { + for (Vars_iter i = d_vars.begin(); i != d_vars.end(); i++) { BaseType *btp = *i ; delete btp ; btp = 0; } @@ -132,32 +147,34 @@ dynamic_cast(*this) = rhs; // run Constructor= - _duplicate(rhs); + m_duplicate(rhs); return *this; } +#if 0 int Structure::element_count(bool leaves) { if (!leaves) - return _vars.size(); + return d_vars.size(); else { int i = 0; - for (Vars_iter j = _vars.begin(); j != _vars.end(); j++) { - j += (*j)->element_count(leaves); + for (Vars_iter j = d_vars.begin(); j != d_vars.end(); j++) { + i += (*j)->element_count(leaves); } return i; } } +#endif bool Structure::is_linear() { bool linear = true; - for (Vars_iter i = _vars.begin(); linear && i != _vars.end(); i++) { + for (Vars_iter i = d_vars.begin(); linear && i != d_vars.end(); i++) { if ((*i)->type() == dods_structure_c) - linear = linear && dynamic_cast((*i))->is_linear(); + linear = linear && static_cast((*i))->is_linear(); else linear = linear && (*i)->is_simple_type(); } @@ -165,10 +182,11 @@ return linear; } +#if 0 void Structure::set_send_p(bool state) { - for (Vars_iter i = _vars.begin(); i != _vars.end(); i++) { + for (Vars_iter i = d_vars.begin(); i != d_vars.end(); i++) { (*i)->set_send_p(state); } @@ -178,13 +196,14 @@ void Structure::set_read_p(bool state) { - for (Vars_iter i = _vars.begin(); i != _vars.end(); i++) { + for (Vars_iter i = d_vars.begin(); i != d_vars.end(); i++) { (*i)->set_read_p(state); } BaseType::set_read_p(state); } - +#endif +#if 0 /** Set the \e in_selection property for this variable and all of its children. @@ -193,25 +212,26 @@ void Structure::set_in_selection(bool state) { - for (Vars_iter i = _vars.begin(); i != _vars.end(); i++) { + for (Vars_iter i = d_vars.begin(); i != d_vars.end(); i++) { (*i)->set_in_selection(state); } BaseType::set_in_selection(state); } - +#endif /** @brief Traverse Structure, set Sequence leaf nodes. */ void Structure::set_leaf_sequence(int level) { for (Vars_iter i = var_begin(); i != var_end(); i++) { if ((*i)->type() == dods_sequence_c) - dynamic_cast(**i).set_leaf_sequence(++level); + static_cast(**i).set_leaf_sequence(++level); else if ((*i)->type() == dods_structure_c) - dynamic_cast(**i).set_leaf_sequence(level); + static_cast(**i).set_leaf_sequence(level); } } +#if 0 /** Adds an element to a Structure. @param bt A pointer to the DAP2 type variable to add to this Structure. @@ -222,8 +242,10 @@ // Jose Garcia // Passing and invalid pointer to an object is a developer's error. if (!bt) - throw InternalErr(__FILE__, __LINE__, - "The BaseType parameter cannot be null."); + throw InternalErr(__FILE__, __LINE__, "The BaseType parameter cannot be null."); + + if (bt->is_dap4_only_type()) + throw InternalErr(__FILE__, __LINE__, "Attempt to add a DAP4 type to a DAP2 Structure."); // Jose Garcia // Now we add a copy of bt so the external user is able to destroy bt as @@ -232,56 +254,102 @@ // inside" BaseType *btp = bt->ptr_duplicate(); btp->set_parent(this); - _vars.push_back(btp); + d_vars.push_back(btp); } +/** Adds an element to a Structure. + + @param bt A pointer to the DAP2 type variable to add to this Structure. + @param part Not used by this class, defaults to nil */ +void +Structure::add_var_nocopy(BaseType *bt, Part) +{ + if (!bt) + throw InternalErr(__FILE__, __LINE__, "The BaseType parameter cannot be null."); + + if (bt->is_dap4_only_type()) + throw InternalErr(__FILE__, __LINE__, "Attempt to add a DAP4 type to a DAP2 Structure."); + + bt->set_parent(this); + d_vars.push_back(bt); +} + + /** Removed an element from a Structure. @param n name of the variable to remove */ void Structure::del_var(const string &n) { - for (Vars_iter i = _vars.begin(); i != _vars.end(); i++) { + for (Vars_iter i = d_vars.begin(); i != d_vars.end(); i++) { if ((*i)->name() == n) { BaseType *bt = *i ; - _vars.erase(i) ; + d_vars.erase(i) ; delete bt ; bt = 0; return; } } } - -/** @brief simple implementation of reat that iterates through vars +#endif +#if 0 +/** @brief simple implementation of read that iterates through vars * and calls read on them * * @return returns false to signify all has been read */ -bool -Structure::read() +bool Structure::read() { - if( !read_p() ) - { - for (Vars_iter i = _vars.begin(); i != _vars.end(); i++) { - (*i)->read() ; - } - set_read_p(true) ; + if (!read_p()) { + for (Vars_iter i = d_vars.begin(); i != d_vars.end(); i++) { + (*i)->read(); + } + set_read_p(true); } - return false ; + return false; } - +#endif +#if 0 +// TODO Recode to use width(bool) unsigned int Structure::width() { unsigned int sz = 0; - for (Vars_iter i = _vars.begin(); i != _vars.end(); i++) { + for (Vars_iter i = d_vars.begin(); i != d_vars.end(); i++) { sz += (*i)->width(); } return sz; } +/** This version of width simply returns the same thing as width() for simple + types and Arrays. For Structure it returns the total size if constrained + is false, or the size of the elements in the current projection if true. + + @param constrained If true, return the size after applying a constraint. + @return The number of bytes used by the variable. + */ +unsigned int +Structure::width(bool constrained) +{ + unsigned int sz = 0; + + for (Vars_iter i = d_vars.begin(); i != d_vars.end(); i++) { + if (constrained) { + if ((*i)->send_p()) + sz += (*i)->width(constrained); + } + else { + sz += (*i)->width(constrained); + } + } + + return sz; +} +#endif + +#if 0 void Structure::intern_data(ConstraintEvaluator & eval, DDS & dds) { @@ -289,7 +357,7 @@ if (!read_p()) read(); // read() throws Error and InternalErr - for (Vars_iter i = _vars.begin(); i != _vars.end(); i++) { + for (Vars_iter i = d_vars.begin(); i != d_vars.end(); i++) { if ((*i)->send_p()) { (*i)->intern_data(eval, dds); } @@ -312,9 +380,20 @@ dds.timeout_off(); - for (Vars_iter i = _vars.begin(); i != _vars.end(); i++) { + for (Vars_iter i = d_vars.begin(); i != d_vars.end(); i++) { if ((*i)->send_p()) { +#ifdef CHECKSUMS + XDRStreamMarshaller *sm = dynamic_cast(&m); + if (sm && sm->checksums() && (*i)->type() != dods_structure_c && (*i)->type() != dods_grid_c) + sm->reset_checksum(); + + (*i)->serialize(eval, dds, m, false); + + if (sm && sm->checksums() && (*i)->type() != dods_structure_c && (*i)->type() != dods_grid_c) + sm->get_checksum(); +#else (*i)->serialize(eval, dds, m, false); +#endif } } @@ -324,13 +403,14 @@ bool Structure::deserialize(UnMarshaller &um, DDS *dds, bool reuse) { - for (Vars_iter i = _vars.begin(); i != _vars.end(); i++) { + for (Vars_iter i = d_vars.begin(); i != d_vars.end(); i++) { (*i)->deserialize(um, dds, reuse); } return false; } - +#endif +#if 0 /** @brief Never call this This method cannot be used to change values of a Structure since @@ -354,7 +434,9 @@ { return sizeof(Structure); } +#endif +#if 0 BaseType * Structure::var(const string &name, bool exact_match, btp_stack *s) { @@ -378,13 +460,14 @@ return m_leaf_match(name, &s); } - +#endif +#if 0 // Private method to find a variable using the shorthand name. This // should be moved to Constructor. BaseType * Structure::m_leaf_match(const string &name, btp_stack *s) { - for (Vars_iter i = _vars.begin(); i != _vars.end(); i++) { + for (Vars_iter i = d_vars.begin(); i != d_vars.end(); i++) { if ((*i)->name() == name) { if (s) { DBG(cerr << "Pushing " << this->name() << endl); @@ -408,23 +491,23 @@ } // Breadth-first search for NAME. If NAME contains one or more dots (.) +// TODO The btp_stack is not needed since there are 'back pointers' in +// BaseType. BaseType * Structure::m_exact_match(const string &name, btp_stack *s) { - for (Vars_iter i = _vars.begin(); i != _vars.end(); i++) { - DBG(cerr << "Looking at " << (*i)->name() << " in: " << *i - << endl); + // Look for name at the top level first. + for (Vars_iter i = d_vars.begin(); i != d_vars.end(); i++) { if ((*i)->name() == name) { - DBG(cerr << "Found " << (*i)->name() << " in: " - << *i << endl); - if (s) { - DBG(cerr << "Pushing " << this->name() << endl); + if (s) s->push(static_cast(this)); - } + return *i; } } + // If it was not found using the simple search, look for a dot and + // search the hierarchy. string::size_type dot_pos = name.find("."); // zero-based index of `.' if (dot_pos != string::npos) { string aggregate = name.substr(0, dot_pos); @@ -432,11 +515,9 @@ BaseType *agg_ptr = var(aggregate); if (agg_ptr) { - DBG(cerr << "Descending into " << agg_ptr->name() << endl); - if (s) { - DBG(cerr << "Pushing " << this->name() << endl); + if (s) s->push(static_cast(this)); - } + return agg_ptr->var(field, true, s); // recurse } else @@ -445,28 +526,17 @@ return 0; } - -#if FILE_METHODS +#endif +// TODO Can these be removed and the versions in Constructor used instead? +// Yes. +#if 0 void Structure::print_val(FILE *out, string space, bool print_decl_p) { - if (print_decl_p) { - print_decl(out, space, false); - fprintf(out, " = ") ; - } - - fprintf(out, "{ ") ; - for (Vars_citer i = _vars.begin(); i != _vars.end(); - i++, (void)(i != _vars.end() && fprintf(out, ", "))) { - (*i)->print_val(out, "", false); - } - - fprintf(out, " }") ; - - if (print_decl_p) - fprintf(out, ";\n") ; + ostringstream oss; + print_val(oss, space, print_decl_p); + fwrite(oss.str().data(), sizeof(char), oss.str().length(), out); } -#endif void Structure::print_val(ostream &out, string space, bool print_decl_p) @@ -477,8 +547,8 @@ } out << "{ " ; - for (Vars_citer i = _vars.begin(); i != _vars.end(); - i++, (void)(i != _vars.end() && out << ", ")) { + for (Vars_citer i = d_vars.begin(); i != d_vars.end(); + i++, (void)(i != d_vars.end() && out << ", ")) { (*i)->print_val(out, "", false); } @@ -487,7 +557,9 @@ if (print_decl_p) out << ";\n" ; } +#endif +#if 0 bool Structure::check_semantics(string &msg, bool all) { @@ -496,11 +568,11 @@ bool status = true; - if (!unique_names(_vars, name(), type_name(), msg)) + if (!unique_names(d_vars, name(), type_name(), msg)) return false; if (all) { - for (Vars_iter i = _vars.begin(); i != _vars.end(); i++) { + for (Vars_iter i = d_vars.begin(); i != d_vars.end(); i++) { //assert(*i); if (!(*i)->check_semantics(msg, true)) { status = false; @@ -512,6 +584,7 @@ exit: return status; } +#endif /** @brief dumps information about this object * diff -Nru libdap-3.11.1/Structure.h libdap-3.12.0/Structure.h --- libdap-3.11.1/Structure.h 2011-04-29 13:19:42.000000000 +0000 +++ libdap-3.12.0/Structure.h 2013-10-17 21:27:40.000000000 +0000 @@ -19,7 +19,7 @@ // // You should have received a copy of the GNU Lesser General Public // License along with this library; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA // // You can contact OPeNDAP, Inc. at PO Box 112, Saunderstown, RI. 02874-0112. @@ -44,27 +44,14 @@ #include -#ifndef _basetype_h -#include "BaseType.h" -#endif - -#ifndef _constructor_h #include "Constructor.h" -#endif - -#ifndef _dds_h -#include "DDS.h" -#endif - -#ifndef constraint_evaluator_h -#include "ConstraintEvaluator.h" -#endif - -#define FILE_METHODS 1 namespace libdap { +class DDS; +class ConstraintEvaluator; + /** This data type is used to hold a collection of related data types, in a manner roughly corresponding to a C structure. The member types can be simple or compound types, and can include other @@ -92,19 +79,21 @@ ``shoe_size'', then you can refer to Tom's shoe size as ``Tom.shoe_size''. - @todo Refactor with Sequence moving methods up into Constructor. - @brief Holds a structure (aggregate) type. */ class Structure: public Constructor { private: +#if 0 BaseType *m_leaf_match(const string &name, btp_stack *s = 0); BaseType *m_exact_match(const string &name, btp_stack *s = 0); +#endif protected: - void _duplicate(const Structure &s); +#if 0 + void m_duplicate(const Structure &s); +#endif public: Structure(const string &n); @@ -116,45 +105,59 @@ Structure &operator=(const Structure &rhs); virtual BaseType *ptr_duplicate(); +#if 0 virtual int element_count(bool leaves = false); +#endif virtual bool is_linear(); +#if 0 virtual void set_send_p(bool state); virtual void set_read_p(bool state); +#endif +#if 0 virtual void set_in_selection(bool state); +#endif virtual void set_leaf_sequence(int level = 1); - - virtual unsigned int width(); - +#if 0 + virtual unsigned int width(bool constrained = false); + virtual unsigned int width(bool constrained); +#endif +#if 0 virtual void intern_data(ConstraintEvaluator &eval, DDS &dds); virtual bool serialize(ConstraintEvaluator &eval, DDS &dds, Marshaller &m, bool ce_eval = true); virtual bool deserialize(UnMarshaller &um, DDS *dds, bool reuse = false); - +#endif +#if 0 // Do not store values in memory as for C; force users to work with the // C++ objects as defined by the DAP. virtual unsigned int val2buf(void *val, bool reuse = false); virtual unsigned int buf2val(void **val); +#endif - virtual BaseType *var(const string &name, bool exact_match = true, - btp_stack *s = 0); - +#if 0 + virtual BaseType *var(const string &name, bool exact_match = true, btp_stack *s = 0); virtual BaseType *var(const string &n, btp_stack &s); - +#endif +#if 0 virtual void add_var(BaseType *bt, Part part = nil); - virtual void del_var(const string &name); + virtual void add_var_nocopy(BaseType *bt, Part part = nil); + virtual void del_var(const string &name); +#endif +#if 0 virtual bool read() ; -#if FILE_METHODS +#endif +#if 0 virtual void print_val(FILE *out, string space = "", bool print_decl_p = true); -#endif virtual void print_val(ostream &out, string space = "", bool print_decl_p = true); - +#endif +#if 0 virtual bool check_semantics(string &msg, bool all = false); - +#endif virtual void dump(ostream &strm) const ; }; diff -Nru libdap-3.11.1/UInt16.cc libdap-3.12.0/UInt16.cc --- libdap-3.11.1/UInt16.cc 2011-04-29 13:19:43.000000000 +0000 +++ libdap-3.12.0/UInt16.cc 2013-10-17 21:27:40.000000000 +0000 @@ -19,7 +19,7 @@ // // You should have received a copy of the GNU Lesser General Public // License along with this library; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA // // You can contact OPeNDAP, Inc. at PO Box 112, Saunderstown, RI. 02874-0112. @@ -36,23 +36,23 @@ #include "config.h" -static char rcsid[] not_used = - {"$Id: UInt16.cc 21699 2009-11-05 00:06:01Z jimg $" - }; +#include -#include "Byte.h" +#include "Byte.h" // synonymous with UInt8 and Char +#include "Int8.h" #include "Int16.h" #include "UInt16.h" #include "Int32.h" #include "UInt32.h" +#include "Int64.h" +#include "UInt64.h" #include "Float32.h" #include "Float64.h" #include "Str.h" #include "Url.h" -#include "Array.h" -#include "Structure.h" -#include "Sequence.h" -#include "Grid.h" + +#include "Marshaller.h" +#include "UnMarshaller.h" #include "DDS.h" #include "util.h" @@ -88,7 +88,7 @@ UInt16::UInt16(const UInt16 ©_from) : BaseType(copy_from) { - _buf = copy_from._buf; + d_buf = copy_from.d_buf; } BaseType * @@ -105,13 +105,13 @@ dynamic_cast(*this) = rhs; - _buf = rhs._buf; + d_buf = rhs.d_buf; return *this; } unsigned int -UInt16::width() +UInt16::width(bool) { return sizeof(dods_uint16); } @@ -132,7 +132,7 @@ dds.timeout_off(); - m.put_uint16( _buf ) ; + m.put_uint16( d_buf ) ; return true; } @@ -140,7 +140,7 @@ bool UInt16::deserialize(UnMarshaller &um, DDS *, bool) { - um.get_uint16( _buf ) ; + um.get_uint16( d_buf ) ; return false; } @@ -156,7 +156,7 @@ throw InternalErr(__FILE__, __LINE__, "The incoming pointer does not contain any data."); - _buf = *(dods_uint16 *)val; + d_buf = *(dods_uint16 *)val; return width(); } @@ -172,7 +172,7 @@ if (!*val) *val = new dods_uint16; - *(dods_uint16 *)*val = _buf; + *(dods_uint16 *)*val = d_buf; return width(); } @@ -180,40 +180,35 @@ dods_uint16 UInt16::value() const { - return _buf; + return d_buf; } bool UInt16::set_value(dods_uint16 i) { - _buf = i; + d_buf = i; set_read_p(true); return true; } -#if FILE_METHODS void UInt16::print_val(FILE *out, string space, bool print_decl_p) { - if (print_decl_p) { - print_decl(out, space, false); - fprintf(out, " = %u;\n", (unsigned int)_buf) ; - } - else - fprintf(out, "%u", (unsigned int)_buf) ; + ostringstream oss; + print_val(oss, space, print_decl_p); + fwrite(oss.str().data(), sizeof(char), oss.str().length(), out); } -#endif void UInt16::print_val(ostream &out, string space, bool print_decl_p) { if (print_decl_p) { print_decl(out, space, false); - out << " = " << (unsigned int)_buf << ";\n" ; + out << " = " << (unsigned int)d_buf << ";\n" ; } else - out << (unsigned int)_buf ; + out << (unsigned int)d_buf ; } bool @@ -240,29 +235,28 @@ } switch (b->type()) { - case dods_byte_c: - return rops > - (_buf, dynamic_cast(b)->_buf, op); - case dods_int16_c: - return rops > - (_buf, dynamic_cast(b)->_buf, op); - case dods_uint16_c: - return rops > - (_buf, dynamic_cast(b)->_buf, op); - case dods_int32_c: - return rops > - (_buf, dynamic_cast(b)->_buf, op); - case dods_uint32_c: - return rops > - (_buf, dynamic_cast(b)->_buf, op); - case dods_float32_c: - return rops > - (_buf, dynamic_cast(b)->_buf, op); - case dods_float64_c: - return rops > - (_buf, dynamic_cast(b)->_buf, op); - default: - return false; + case dods_int8_c: + return USCmp(op, d_buf, static_cast(b)->value()); + case dods_byte_c: + return Cmp(op, d_buf, static_cast(b)->value()); + case dods_int16_c: + return USCmp(op, d_buf, static_cast(b)->value()); + case dods_uint16_c: + return Cmp(op, d_buf, static_cast(b)->value()); + case dods_int32_c: + return USCmp(op, d_buf, static_cast(b)->value()); + case dods_uint32_c: + return Cmp(op, d_buf, static_cast(b)->value()); + case dods_int64_c: + return USCmp(op, d_buf, static_cast(b)->value()); + case dods_uint64_c: + return Cmp(op, d_buf, static_cast(b)->value()); + case dods_float32_c: + return USCmp(op, d_buf, static_cast(b)->value()); + case dods_float64_c: + return USCmp(op, d_buf, static_cast(b)->value()); + default: + return false; } } @@ -281,7 +275,7 @@ << (void *)this << ")" << endl ; DapIndent::Indent() ; BaseType::dump(strm) ; - strm << DapIndent::LMarg << "value: " << _buf << endl ; + strm << DapIndent::LMarg << "value: " << d_buf << endl ; DapIndent::UnIndent() ; } diff -Nru libdap-3.11.1/UInt16.h libdap-3.12.0/UInt16.h --- libdap-3.11.1/UInt16.h 2011-04-29 13:19:43.000000000 +0000 +++ libdap-3.12.0/UInt16.h 2013-10-17 21:27:40.000000000 +0000 @@ -19,7 +19,7 @@ // // You should have received a copy of the GNU Lesser General Public // License along with this library; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA // // You can contact OPeNDAP, Inc. at PO Box 112, Saunderstown, RI. 02874-0112. @@ -49,8 +49,6 @@ #include "ConstraintEvaluator.h" #endif -#define FILE_METHODS 1 - namespace libdap { @@ -58,20 +56,8 @@ class UInt16: public BaseType { - /** This class allows Byte, ..., Float64 access to _buf to - simplify and speed up the relational operators. - - NB: According to Stroustrup it does not matter where (public, private - or protected) friend classes are declared. */ - friend class Byte; - friend class Int16; - friend class Int32; - friend class UInt32; - friend class Float32; - friend class Float64; - protected: - dods_uint16 _buf; + dods_uint16 d_buf; public: UInt16(const string &n); @@ -85,7 +71,7 @@ virtual BaseType *ptr_duplicate(); - virtual unsigned int width(); + virtual unsigned int width(bool constrained = false); virtual bool serialize(ConstraintEvaluator &eval, DDS &dds, Marshaller &m, bool ce_eval = true); @@ -96,10 +82,9 @@ virtual dods_uint16 value() const; virtual bool set_value(dods_uint16 val); -#if FILE_METHODS + virtual void print_val(FILE *out, string space = "", bool print_decl_p = true); -#endif virtual void print_val(ostream &out, string space = "", bool print_decl_p = true); diff -Nru libdap-3.11.1/UInt32.cc libdap-3.12.0/UInt32.cc --- libdap-3.11.1/UInt32.cc 2011-04-29 13:19:43.000000000 +0000 +++ libdap-3.12.0/UInt32.cc 2013-10-17 21:27:40.000000000 +0000 @@ -19,7 +19,7 @@ // // You should have received a copy of the GNU Lesser General Public // License along with this library; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA // // You can contact OPeNDAP, Inc. at PO Box 112, Saunderstown, RI. 02874-0112. @@ -36,23 +36,23 @@ #include "config.h" -static char rcsid[] not_used = - {"$Id: UInt32.cc 21699 2009-11-05 00:06:01Z jimg $" - }; +#include -#include "Byte.h" +#include "Byte.h" // synonymous with UInt8 and Char +#include "Int8.h" #include "Int16.h" #include "UInt16.h" #include "Int32.h" #include "UInt32.h" +#include "Int64.h" +#include "UInt64.h" #include "Float32.h" #include "Float64.h" #include "Str.h" #include "Url.h" -#include "Array.h" -#include "Structure.h" -#include "Sequence.h" -#include "Grid.h" + +#include "Marshaller.h" +#include "UnMarshaller.h" #include "DDS.h" #include "util.h" @@ -89,7 +89,7 @@ UInt32::UInt32(const UInt32 ©_from) : BaseType(copy_from) { - _buf = copy_from._buf; + d_buf = copy_from.d_buf; } BaseType * @@ -106,13 +106,13 @@ dynamic_cast(*this) = rhs; - _buf = rhs._buf; + d_buf = rhs.d_buf; return *this; } unsigned int -UInt32::width() +UInt32::width(bool) { return sizeof(dods_uint32); } @@ -133,7 +133,7 @@ dds.timeout_off(); - m.put_uint32( _buf ) ; + m.put_uint32( d_buf ) ; return true; } @@ -141,7 +141,7 @@ bool UInt32::deserialize(UnMarshaller &um, DDS *, bool) { - um.get_uint32( _buf ) ; + um.get_uint32( d_buf ) ; return false; } @@ -158,7 +158,7 @@ throw InternalErr(__FILE__, __LINE__, "The incoming pointer does not contain any data."); - _buf = *(dods_uint32 *)val; + d_buf = *(dods_uint32 *)val; return width(); } @@ -174,7 +174,7 @@ if (!*val) *val = new dods_uint32; - *(dods_uint32 *)*val = _buf; + *(dods_uint32 *)*val = d_buf; return width(); } @@ -182,40 +182,35 @@ dods_uint32 UInt32::value() const { - return _buf; + return d_buf; } bool UInt32::set_value(dods_uint32 i) { - _buf = i; + d_buf = i; set_read_p(true); return true; } -#if FILE_METHODS void UInt32::print_val(FILE *out, string space, bool print_decl_p) { - if (print_decl_p) { - print_decl(out, space, false); - fprintf(out, " = %u;\n", (unsigned int)_buf) ; - } - else - fprintf(out, "%u", (unsigned int)_buf) ; + ostringstream oss; + print_val(oss, space, print_decl_p); + fwrite(oss.str().data(), sizeof(char), oss.str().length(), out); } -#endif void UInt32::print_val(ostream &out, string space, bool print_decl_p) { if (print_decl_p) { print_decl(out, space, false); - out << " = " << (unsigned int)_buf << ";\n" ; + out << " = " << (unsigned int)d_buf << ";\n" ; } else - out << (unsigned int)_buf ; + out << (unsigned int)d_buf ; } bool @@ -242,29 +237,28 @@ } switch (b->type()) { - case dods_byte_c: - return rops > - (_buf, dynamic_cast(b)->_buf, op); - case dods_int16_c: - return rops > - (_buf, dynamic_cast(b)->_buf, op); - case dods_uint16_c: - return rops > - (_buf, dynamic_cast(b)->_buf, op); - case dods_int32_c: - return rops > - (_buf, dynamic_cast(b)->_buf, op); - case dods_uint32_c: - return rops > - (_buf, dynamic_cast(b)->_buf, op); - case dods_float32_c: - return rops > - (_buf, dynamic_cast(b)->_buf, op); - case dods_float64_c: - return rops > - (_buf, dynamic_cast(b)->_buf, op); - default: - return false; + case dods_int8_c: + return USCmp(op, d_buf, static_cast(b)->value()); + case dods_byte_c: + return Cmp(op, d_buf, static_cast(b)->value()); + case dods_int16_c: + return USCmp(op, d_buf, static_cast(b)->value()); + case dods_uint16_c: + return Cmp(op, d_buf, static_cast(b)->value()); + case dods_int32_c: + return USCmp(op, d_buf, static_cast(b)->value()); + case dods_uint32_c: + return Cmp(op, d_buf, static_cast(b)->value()); + case dods_int64_c: + return USCmp(op, d_buf, static_cast(b)->value()); + case dods_uint64_c: + return Cmp(op, d_buf, static_cast(b)->value()); + case dods_float32_c: + return USCmp(op, d_buf, static_cast(b)->value()); + case dods_float64_c: + return USCmp(op, d_buf, static_cast(b)->value()); + default: + return false; } } @@ -283,7 +277,7 @@ << (void *)this << ")" << endl ; DapIndent::Indent() ; BaseType::dump(strm) ; - strm << DapIndent::LMarg << "value: " << _buf << endl ; + strm << DapIndent::LMarg << "value: " << d_buf << endl ; DapIndent::UnIndent() ; } diff -Nru libdap-3.11.1/UInt32.h libdap-3.12.0/UInt32.h --- libdap-3.11.1/UInt32.h 2011-04-29 13:19:43.000000000 +0000 +++ libdap-3.12.0/UInt32.h 2013-10-17 21:27:40.000000000 +0000 @@ -19,7 +19,7 @@ // // You should have received a copy of the GNU Lesser General Public // License along with this library; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA // // You can contact OPeNDAP, Inc. at PO Box 112, Saunderstown, RI. 02874-0112. @@ -49,8 +49,6 @@ #include "ConstraintEvaluator.h" #endif -#define FILE_METHODS 1 - namespace libdap { @@ -60,20 +58,8 @@ class UInt32: public BaseType { - /** This class allows Byte, ..., Float64 access to _buf to - simplify and speed up the relational operators. - - NB: According to Stroustrup it does not matter where (public, private - or protected) friend classes are declared. */ - friend class Byte; - friend class Int16; - friend class UInt16; - friend class Int32; - friend class Float32; - friend class Float64; - protected: - dods_uint32 _buf; + dods_uint32 d_buf; public: UInt32(const string &n); @@ -87,7 +73,7 @@ virtual BaseType *ptr_duplicate() ; - virtual unsigned int width(); + virtual unsigned int width(bool constrained = false); virtual bool serialize(ConstraintEvaluator &eval, DDS &dds, Marshaller &m, bool ce_eval = true); @@ -98,10 +84,9 @@ virtual dods_uint32 value() const; virtual bool set_value(dods_uint32 val); -#if FILE_METHODS + virtual void print_val(FILE *out, string space = "", bool print_decl_p = true); -#endif virtual void print_val(ostream &out, string space = "", bool print_decl_p = true); diff -Nru libdap-3.11.1/UInt64.cc libdap-3.12.0/UInt64.cc --- libdap-3.11.1/UInt64.cc 1970-01-01 00:00:00.000000000 +0000 +++ libdap-3.12.0/UInt64.cc 2013-10-17 21:27:40.000000000 +0000 @@ -0,0 +1,230 @@ + +// -*- mode: c++; c-basic-offset:4 -*- + +// This file is part of libdap, A C++ implementation of the OPeNDAP Data +// Access Protocol. + +// Copyright (c) 2012 OPeNDAP, Inc. +// Author: James Gallagher +// +// This library is free software; you can redistribute it and/or +// modify it under the terms of the GNU Lesser General Public +// License as published by the Free Software Foundation; either +// version 2.1 of the License, or (at your option) any later version. +// +// This library 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 +// Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, write to the Free Software +// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA +// +// You can contact OPeNDAP, Inc. at PO Box 112, Saunderstown, RI. 02874-0112. + +#include "config.h" + +#include + +#include "Byte.h" // synonymous with UInt8 and Char +#include "Int8.h" +#include "Int16.h" +#include "UInt16.h" +#include "Int32.h" +#include "UInt32.h" +#include "Int64.h" +#include "UInt64.h" +#include "Float32.h" +#include "Float64.h" +#include "Str.h" +#include "Url.h" + +#include "DAP4StreamMarshaller.h" +#include "DAP4StreamUnMarshaller.h" + +#include "DDS.h" +#include "util.h" +#include "parser.h" +#include "Operators.h" +#include "dods-limits.h" +#include "debug.h" +#include "InternalErr.h" + +using std::cerr; +using std::endl; + +namespace libdap { + +/** The UInt64 constructor accepts the name of the variable to be created. + + @param n A string containing the name of the variable to be created. + variable is created +*/ +UInt64::UInt64(const string &n) + : BaseType(n, dods_uint64_c) +{} + +/** The UInt64 server-side constructor accepts the name of the variable and + the dataset name from which this instance is created. + + @param n A string containing the name of the variable to be created. + @param d A string containing the name of the dataset from which this + variable is created +*/ +UInt64::UInt64(const string &n, const string &d) + : BaseType(n, d, dods_uint64_c) +{} + +UInt64::UInt64(const UInt64 ©_from) : BaseType(copy_from) +{ + d_buf = copy_from.d_buf; +} + +BaseType * +UInt64::ptr_duplicate() +{ + return new UInt64(*this); +} + +UInt64 & +UInt64::operator=(const UInt64 &rhs) +{ + if (this == &rhs) + return *this; + + dynamic_cast(*this) = rhs; + + d_buf = rhs.d_buf; + + return *this; +} + +unsigned int +UInt64::width(bool) +{ + return sizeof(dods_uint64); +} + +bool +UInt64::serialize(ConstraintEvaluator &eval, DDS &dds, + Marshaller &m, bool ce_eval) +{ + dds.timeout_on(); + + if (!read_p()) + read(); // read() throws Error and InternalErr + +#if EVAL + if (ce_eval && !eval.eval_selection(dds, dataset())) + return true; +#endif + + dds.timeout_off(); + + static_cast(&m)->put_uint64( d_buf ) ; + + return true; +} + +bool +UInt64::deserialize(UnMarshaller &um, DDS *, bool) +{ + // TODO assert + static_cast(&um)->get_uint64( d_buf ) ; + + return false; +} + +dods_uint64 +UInt64::value() const +{ + return d_buf; +} + +bool +UInt64::set_value(dods_uint64 i) +{ + d_buf = i; + set_read_p(true); + + return true; +} + +void +UInt64::print_val(FILE *out, string space, bool print_decl_p) +{ + ostringstream oss; + print_val(oss, space, print_decl_p); + fwrite(oss.str().data(), sizeof(char), oss.str().length(), out); +} + +void +UInt64::print_val(ostream &out, string space, bool print_decl_p) +{ + if (print_decl_p) { + print_decl(out, space, false); + out << " = " << (unsigned int)d_buf << ";\n" ; + } + else + out << (unsigned int)d_buf ; +} + +bool +UInt64::ops(BaseType *b, int op) +{ + // Extract the Byte arg's value. + if (!read_p() && !read()) + throw InternalErr(__FILE__, __LINE__, "This value was not read!"); + + // Extract the second arg's value. + if (!b || !(b->read_p() || b->read())) + throw InternalErr(__FILE__, __LINE__, "This value was not read!"); + + switch (b->type()) { + case dods_int8_c: + return USCmp(op, d_buf, static_cast(b)->value()); + case dods_byte_c: + return Cmp(op, d_buf, static_cast(b)->value()); + case dods_int16_c: + return USCmp(op, d_buf, static_cast(b)->value()); + case dods_uint16_c: + return Cmp(op, d_buf, static_cast(b)->value()); + case dods_int32_c: + return USCmp(op, d_buf, static_cast(b)->value()); + case dods_uint32_c: + return Cmp(op, d_buf, static_cast(b)->value()); + case dods_int64_c: + return USCmp(op, d_buf, static_cast(b)->value()); + case dods_uint64_c: + return Cmp(op, d_buf, static_cast(b)->value()); + case dods_float32_c: + return USCmp(op, d_buf, static_cast(b)->value()); + case dods_float64_c: + return USCmp(op, d_buf, static_cast(b)->value()); + default: + return false; + } +} + +/** @brief dumps information about this object + * + * Displays the pointer value of this instance and information about this + * instance. + * + * @param strm C++ i/o stream to dump the information to + * @return void + */ +void +UInt64::dump(ostream &strm) const +{ + strm << DapIndent::LMarg << "UInt32::dump - (" + << (void *)this << ")" << endl ; + DapIndent::Indent() ; + BaseType::dump(strm) ; + strm << DapIndent::LMarg << "value: " << d_buf << endl ; + DapIndent::UnIndent() ; +} + +} // namespace libdap + diff -Nru libdap-3.11.1/UInt64.h libdap-3.12.0/UInt64.h --- libdap-3.11.1/UInt64.h 1970-01-01 00:00:00.000000000 +0000 +++ libdap-3.12.0/UInt64.h 2013-10-17 21:27:40.000000000 +0000 @@ -0,0 +1,91 @@ + +// -*- mode: c++; c-basic-offset:4 -*- + +// This file is part of libdap, A C++ implementation of the OPeNDAP Data +// Access Protocol. + +// Copyright (c) 2012 OPeNDAP, Inc. +// Author: James Gallagher +// +// This library is free software; you can redistribute it and/or +// modify it under the terms of the GNU Lesser General Public +// License as published by the Free Software Foundation; either +// version 2.1 of the License, or (at your option) any later version. +// +// This library 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 +// Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, write to the Free Software +// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA +// +// You can contact OPeNDAP, Inc. at PO Box 112, Saunderstown, RI. 02874-0112. + +#ifndef _uint64_h +#define _uint64_h 1 + + +#ifndef _dods_datatypes_h +#include "dods-datatypes.h" +#endif + +#ifndef _basetype_h +#include "BaseType.h" +#endif + +#ifndef constraint_evaluator_h +#include "ConstraintEvaluator.h" +#endif + +namespace libdap +{ + +/** @brief Holds a 64-bit unsigned integer. + + @see BaseType */ + +class UInt64: public BaseType +{ + virtual unsigned int val2buf(void *, bool) { throw InternalErr(__FILE__, __LINE__, "Not implemented for UInt64"); } + virtual unsigned int buf2val(void **) { throw InternalErr(__FILE__, __LINE__, "Not implemented for UInt64"); } + +protected: + dods_uint64 d_buf; + +public: + UInt64(const string &n); + UInt64(const string &n, const string &d); + virtual ~UInt64() + {} + + UInt64(const UInt64 ©_from); + + UInt64 &operator=(const UInt64 &rhs); + + virtual BaseType *ptr_duplicate() ; + + virtual unsigned int width(bool constrained = false); + + virtual bool serialize(ConstraintEvaluator &eval, DDS &dds, + Marshaller &m, bool ce_eval = true); + virtual bool deserialize(UnMarshaller &um, DDS *dds, bool reuse = false); + + virtual dods_uint64 value() const; + virtual bool set_value(dods_uint64 val); + + virtual void print_val(FILE *out, string space = "", + bool print_decl_p = true); + virtual void print_val(ostream &out, string space = "", + bool print_decl_p = true); + + virtual bool ops(BaseType *b, int op); + + virtual void dump(ostream &strm) const ; +}; + +} // namespace libdap + +#endif // _uint64_h + diff -Nru libdap-3.11.1/UnMarshaller.h libdap-3.12.0/UnMarshaller.h --- libdap-3.11.1/UnMarshaller.h 2011-04-29 13:19:43.000000000 +0000 +++ libdap-3.12.0/UnMarshaller.h 2013-10-17 21:27:40.000000000 +0000 @@ -20,7 +20,7 @@ // // You should have received a copy of the GNU Lesser General Public // License along with this library; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA // // You can contact OPeNDAP, Inc. at PO Box 112, Saunderstown, RI. 02874-0112. diff -Nru libdap-3.11.1/Url.cc libdap-3.12.0/Url.cc --- libdap-3.11.1/Url.cc 2011-04-29 13:19:43.000000000 +0000 +++ libdap-3.12.0/Url.cc 2013-10-17 21:27:40.000000000 +0000 @@ -19,7 +19,7 @@ // // You should have received a copy of the GNU Lesser General Public // License along with this library; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA // // You can contact OPeNDAP, Inc. at PO Box 112, Saunderstown, RI. 02874-0112. diff -Nru libdap-3.11.1/Url.h libdap-3.12.0/Url.h --- libdap-3.11.1/Url.h 2011-04-29 13:19:43.000000000 +0000 +++ libdap-3.12.0/Url.h 2013-10-17 21:27:40.000000000 +0000 @@ -19,7 +19,7 @@ // // You should have received a copy of the GNU Lesser General Public // License along with this library; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA // // You can contact OPeNDAP, Inc. at PO Box 112, Saunderstown, RI. 02874-0112. @@ -72,6 +72,8 @@ public: Url(const string &n); Url(const string &n, const string &d); + Url(const string &n, Type t); + Url(const string &n, const string &d, Type t); virtual ~Url() {} diff -Nru libdap-3.11.1/VCPP/sample/getdap.cc libdap-3.12.0/VCPP/sample/getdap.cc --- libdap-3.11.1/VCPP/sample/getdap.cc 2011-04-29 13:19:25.000000000 +0000 +++ libdap-3.12.0/VCPP/sample/getdap.cc 2013-10-17 21:27:40.000000000 +0000 @@ -19,7 +19,7 @@ // // You should have received a copy of the GNU Lesser General Public // License along with this library; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA // // You can contact OPeNDAP, Inc. at PO Box 112, Saunderstown, RI. 02874-0112. @@ -36,7 +36,7 @@ #define not_used static char rcsid[] not_used = - { "$Id: getdap.cc 15497 2007-01-07 11:05:13Z jimg $" }; + { "$Id: getdap.cc 27197 2013-10-01 21:29:54Z jimg $" }; #include #ifdef WIN32 @@ -54,7 +54,7 @@ using std::cerr; using std::endl; -const char *version = "$Revision: 15497 $"; +const char *version = "$Revision: 27197 $"; extern int dods_keep_temps; // defined in HTTPResponse.h diff -Nru libdap-3.11.1/Vector.cc libdap-3.12.0/Vector.cc --- libdap-3.11.1/Vector.cc 2011-04-29 13:19:43.000000000 +0000 +++ libdap-3.12.0/Vector.cc 2013-10-17 21:27:40.000000000 +0000 @@ -1,4 +1,3 @@ - // -*- mode: c++; c-basic-offset:4 -*- // This file is part of libdap, A C++ implementation of the OPeNDAP Data @@ -19,7 +18,7 @@ // // You should have received a copy of the GNU Lesser General Public // License along with this library; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA // // You can contact OPeNDAP, Inc. at PO Box 112, Saunderstown, RI. 02874-0112. @@ -38,20 +37,21 @@ #include -static char rcsid[] not_used = - { "$Id: Vector.cc 24281 2011-03-09 00:22:31Z jimg $" - }; - //#define DODS_DEBUG +#include +#include #include #include "Vector.h" +#include "Marshaller.h" +#include "UnMarshaller.h" + +#include "dods-datatypes.h" #include "escaping.h" #include "util.h" #include "debug.h" #include "InternalErr.h" -#include using std::cerr; using std::endl; @@ -60,7 +60,7 @@ void Vector::_duplicate(const Vector & v) { - _length = v._length; + d_length = v.d_length; // _var holds the type of the elements. That is, it holds a BaseType // which acts as a template for the type of each element. @@ -82,8 +82,8 @@ else { // Failure to set the size will make the [] operator barf on the LHS // of the assignment inside the loop. - _vec.resize(_length); - for (int i = 0; i < _length; ++i) { + _vec.resize(d_length); + for (int i = 0; i < d_length; ++i) { // There's no need to call set_parent() for each element; we // maintain the back pointer using the _var member. These // instances are used to hold _values_ only while the _var @@ -96,9 +96,9 @@ d_str = v.d_str; // copy numeric values if there are any. - _buf = 0; // init to null - if (v._buf) // only copy if data present - val2buf(v._buf); // store v's value in this's _BUF. + _buf = 0; // init to null + if (v._buf) // only copy if data present + val2buf(v._buf); // store v's value in this's _BUF. _capacity = v._capacity; } @@ -107,40 +107,39 @@ * @return whether the type of this Vector is a cardinal type * (ie stored in _buf) */ -bool -Vector::is_cardinal_type() const +bool Vector::m_is_cardinal_type() const { - // Not cardinal if no _var at all! - if (!_var) { - return false; - } + // Not cardinal if no _var at all! + if (!_var) { + return false; + } - switch (_var->type()) { - case dods_byte_c: - case dods_int16_c: - case dods_uint16_c: - case dods_int32_c: - case dods_uint32_c: - case dods_float32_c: - case dods_float64_c: { - return true; - break; - } - - // These must be handled differently. - case dods_str_c: - case dods_url_c: - case dods_array_c: - case dods_structure_c: - case dods_sequence_c: - case dods_grid_c: - return false; - break; - - default: - cerr << "Vector::var: Unrecognized type" << endl; - return false; - } // switch + switch (_var->type()) { + case dods_byte_c: + case dods_int16_c: + case dods_uint16_c: + case dods_int32_c: + case dods_uint32_c: + case dods_float32_c: + case dods_float64_c: { + return true; + break; + } + + // These must be handled differently. + case dods_str_c: + case dods_url_c: + case dods_array_c: + case dods_structure_c: + case dods_sequence_c: + case dods_grid_c: + return false; + break; + + default: + cerr << "Vector::var: Unrecognized type" << endl; + return false; + } // switch } /** @@ -151,93 +150,83 @@ * So don't use this if you want to keep the original _buf data around. * This also sets the valueCapacity(). * @param numEltsOfType the number of elements of the cardinal type in var() - that we want storage for. + that we want storage for. * @return the size of the buffer created. * @exception if the Vector's type is not cardinal type. */ -unsigned int -Vector::create_cardinal_data_buffer_for_type(unsigned int numEltsOfType) +unsigned int Vector::m_create_cardinal_data_buffer_for_type(unsigned int numEltsOfType) { - // Make sure we HAVE a _var, or we cannot continue. - if (!_var) { - throw InternalErr(__FILE__, __LINE__, - "create_cardinal_data_buffer_for_type: Logic error: _var is null!"); - } - - // Make sure we only do this for the correct data types. - if (!is_cardinal_type()) { - throw InternalErr(__FILE__, __LINE__, - "create_cardinal_data_buffer_for_type: incorrectly used on Vector whose type was not a cardinal (simple data types)."); - } - - delete_cardinal_data_buffer(); - - // Actually new up the array with enough bytes to hold numEltsOfType of the actual type. - unsigned int bytesPerElt = _var->width(); - unsigned int bytesNeeded = bytesPerElt * numEltsOfType; - _buf = new char[bytesNeeded]; - if (!_buf) { - ostringstream oss; - oss << "create_cardinal_data_buffer_for_type: new char[] failed to allocate " << - bytesNeeded << - " bytes! Out of memory or too large a buffer required!"; - throw InternalErr(__FILE__, __LINE__, oss.str()); - } - _capacity = numEltsOfType; - return bytesNeeded; + // Make sure we HAVE a _var, or we cannot continue. + if (!_var) { + throw InternalErr(__FILE__, __LINE__, "create_cardinal_data_buffer_for_type: Logic error: _var is null!"); + } + + // Make sure we only do this for the correct data types. + if (!m_is_cardinal_type()) { + throw InternalErr(__FILE__, __LINE__, "create_cardinal_data_buffer_for_type: incorrectly used on Vector whose type was not a cardinal (simple data types)."); + } + + m_delete_cardinal_data_buffer(); + + // Actually new up the array with enough bytes to hold numEltsOfType of the actual type. + unsigned int bytesPerElt = _var->width(); + unsigned int bytesNeeded = bytesPerElt * numEltsOfType; + _buf = new char[bytesNeeded]; + if (!_buf) { + ostringstream oss; + oss << "create_cardinal_data_buffer_for_type: new char[] failed to allocate " << bytesNeeded << " bytes! Out of memory or too large a buffer required!"; + throw InternalErr(__FILE__, __LINE__, oss.str()); + } + _capacity = numEltsOfType; + return bytesNeeded; } /** Delete _buf and zero it and _capacity out */ -void -Vector::delete_cardinal_data_buffer() +void Vector::m_delete_cardinal_data_buffer() { - if (_buf) { - delete[] _buf; - _buf = 0; - _capacity = 0; - } + if (_buf) { + delete[] _buf; + _buf = 0; + _capacity = 0; + } } /** Helper to reduce cut and paste in the virtual's. * */ -template -void -Vector::set_cardinal_values_internal(const CardType* fromArray, int numElts) -{ - if (numElts < 0) { - throw InternalErr(__FILE__, __LINE__, - "Logic error: Vector::set_cardinal_values_internal() called with negative numElts!"); - } - if (!fromArray) { - throw InternalErr(__FILE__, __LINE__, - "Logic error: Vector::set_cardinal_values_internal() called with null fromArray!"); - } - set_length(numElts); - create_cardinal_data_buffer_for_type(numElts); - memcpy(_buf, fromArray, numElts * sizeof(CardType) ); - set_read_p(true); +template +void Vector::set_cardinal_values_internal(const CardType* fromArray, int numElts) +{ + if (numElts < 0) { + throw InternalErr(__FILE__, __LINE__, "Logic error: Vector::set_cardinal_values_internal() called with negative numElts!"); + } + if (!fromArray) { + throw InternalErr(__FILE__, __LINE__, "Logic error: Vector::set_cardinal_values_internal() called with null fromArray!"); + } + set_length(numElts); + m_create_cardinal_data_buffer_for_type(numElts); + memcpy(_buf, fromArray, numElts * sizeof(CardType)); + set_read_p(true); } - /** The Vector constructor requires the name of the variable to be - created, and a pointer to an object of the type the Vector is to - hold. The name may be omitted, which will create a nameless - variable. The template object may not be omitted. - - @param n A string containing the name of the variable to be - created. - @param v A pointer to a variable of the type to be included - in the Vector. - @param t The type of the resulting Vector object, from the Type - enum list. There is no DAP2 Vector object, so all uses of this - method will be from the List or Array classes. This defaults to - dods_null_c. - - @see Type - @brief The Vector constructor. */ -Vector::Vector(const string & n, BaseType * v, const Type & t) - : BaseType(n, t), _length(-1), _var(0), _buf(0), _vec(0), _capacity(0) + created, and a pointer to an object of the type the Vector is to + hold. The name may be omitted, which will create a nameless + variable. The template object may not be omitted. + + @param n A string containing the name of the variable to be + created. + @param v A pointer to a variable of the type to be included + in the Vector. + @param t The type of the resulting Vector object, from the Type + enum list. There is no DAP2 Vector object, so all uses of this + method will be from the List or Array classes. This defaults to + dods_null_c. + + @see Type + @brief The Vector constructor. */ +Vector::Vector(const string & n, BaseType * v, const Type & t) : + BaseType(n, t), d_length(-1), _var(0), _buf(0), _vec(0), _capacity(0) { if (v) add_var(v); @@ -248,26 +237,26 @@ } /** The Vector server-side constructor requires the name of the variable - to be created, the dataset name from which this Vector is created, and - a pointer to an object of the type the Vector is to hold. The - name may be omitted, which will create a nameless variable. - The template object may not be omitted. - - @param n A string containing the name of the variable to be - created. - @param d A string containing the dataset name from which the variable is - being created. - @param v A pointer to a variable of the type to be included - in the Vector. - @param t The type of the resulting Vector object, from the Type - enum list. There is no DAP2 Vector object, so all uses of this - method will be from the List or Array classes. This defaults to - dods_null_c. - - @see Type - @brief The Vector constructor. */ -Vector::Vector(const string & n, const string &d, BaseType * v, const Type & t) - : BaseType(n, d, t), _length(-1), _var(0), _buf(0), _vec(0), _capacity(0) + to be created, the dataset name from which this Vector is created, and + a pointer to an object of the type the Vector is to hold. The + name may be omitted, which will create a nameless variable. + The template object may not be omitted. + + @param n A string containing the name of the variable to be + created. + @param d A string containing the dataset name from which the variable is + being created. + @param v A pointer to a variable of the type to be included + in the Vector. + @param t The type of the resulting Vector object, from the Type + enum list. There is no DAP2 Vector object, so all uses of this + method will be from the List or Array classes. This defaults to + dods_null_c. + + @see Type + @brief The Vector constructor. */ +Vector::Vector(const string & n, const string &d, BaseType * v, const Type & t) : + BaseType(n, d, t), d_length(-1), _var(0), _buf(0), _vec(0), _capacity(0) { if (v) add_var(v); @@ -278,11 +267,11 @@ } /** The Vector copy constructor. */ -Vector::Vector(const Vector & rhs): BaseType(rhs) +Vector::Vector(const Vector & rhs) : + BaseType(rhs) { DBG2(cerr << "Entering Vector const ctor for object: " << this << - endl); - DBG2(cerr << "RHS: " << &rhs << endl); + endl); DBG2(cerr << "RHS: " << &rhs << endl); _duplicate(rhs); } @@ -305,22 +294,30 @@ if (this == &rhs) return *this; - dynamic_cast < BaseType & >(*this) = rhs; + dynamic_cast (*this) = rhs; _duplicate(rhs); return *this; } -void -Vector::set_name(const std::string& name) +/** + * The Vector (and Array) classes are specific to DAP2. They do not support + * the semantics of DAP4 which allows varying dimensions. + */ +bool Vector::is_dap2_only_type() { - BaseType::set_name(name); - // We need to set the template variable name as well since - // this is what gets output in the dds! Otherwise, there's a mismatch. - if (_var) { - _var->set_name(name); - } + return true; +} + +void Vector::set_name(const std::string& name) +{ + BaseType::set_name(name); + // We need to set the template variable name as well since + // this is what gets output in the dds! Otherwise, there's a mismatch. + if (_var) { + _var->set_name(name); + } } int Vector::element_count(bool leaves) @@ -338,11 +335,11 @@ // is a scalar, but does matter when it is an aggregate. /** This function sets the send_p flag for both the Vector itself - and its element template. This does not matter much when the - Vector contains simple data types, but does become significant - when the Vector contains compound types. + and its element template. This does not matter much when the + Vector contains simple data types, but does become significant + when the Vector contains compound types. - @brief Indicates that the data is ready to send. */ + @brief Indicates that the data is ready to send. */ void Vector::set_send_p(bool state) { _var->set_send_p(state); @@ -350,41 +347,42 @@ } /** This function sets the read_p flag for both the Vector itself - and its element template. This does not matter much when the - Vector contains simple data types, but does become significant - when the Vector contains compound types. + and its element template. This does not matter much when the + Vector contains simple data types, but does become significant + when the Vector contains compound types. - @brief Indicates that the data is ready to send. */ + @brief Indicates that the data is ready to send. */ void Vector::set_read_p(bool state) { if (_var) { - _var->set_read_p(state); + _var->set_read_p(state); } BaseType::set_read_p(state); } /** Returns a copy of the template array element. If the Vector contains - simple data types, the template will contain the value of the last - vector element accessed with the Vector::var(int i) function, - if any. If no such access has been made, or if the Vector contains - compound data types, the value held by the template instance is - undefined. - - Note that the parameter exact_match is not used by this mfunc. - - @param n The name of the variable to find. - @param exact Unused. - @param s Pointer to a BaseType Pointer Stack. Use this stack to record - the path to the variable. By default this pointer is null, in which case - it is not used. - - @return A pointer to the BaseType if found, otherwise null. - @see Vector::var */ -BaseType *Vector::var(const string & n, bool exact, btp_stack * s) + simple data types, the template will contain the value of the last + vector element accessed with the Vector::var(int i) function, + if any. If no such access has been made, or if the Vector contains + compound data types, the value held by the template instance is + undefined. + + Note that the parameter exact_match is not used by this mfunc. + + @param n The name of the variable to find. + @param exact Unused. + @param s Pointer to a BaseType Pointer Stack. Use this stack to record + the path to the variable. By default this pointer is null, in which case + it is not used. + + @return A pointer to the BaseType if found, otherwise null. + @see Vector::var */ +BaseType *Vector::var(const string &n, bool exact, btp_stack *s) { string name = www2id(n); DBG(cerr << "Vector::var: Looking for " << n << endl); + // If this is a Vector of constructor types, look for 'name' recursively. // Make sure to check for the case where name is the default (the empty // string). 9/1/98 jhrg if (_var->is_constructor_type()) { @@ -401,20 +399,20 @@ } } else { - return _var; // I don't see why this isn't return 0 *** jhrg 10/9/08 + return _var; } } /** This version of var(...) searches for name and returns a - pointer to the BaseType object if found. It uses the same search - algorithm as above when exact_match is false. In addition to - returning a pointer to the variable, it pushes onto s a - BaseType pointer to each constructor type that ultimately contains - name. - - @param n Find the variable whose name is name. - @param s Record the path to name. - @return A pointer to the named variable. */ + pointer to the BaseType object if found. It uses the same search + algorithm as above when exact_match is false. In addition to + returning a pointer to the variable, it pushes onto s a + BaseType pointer to each constructor type that ultimately contains + name. + + @param n Find the variable whose name is name. + @param s Record the path to name. + @return A pointer to the named variable. */ BaseType *Vector::var(const string & n, btp_stack & s) { string name = www2id(n); @@ -437,31 +435,27 @@ // Returns: A BaseType pointer to the ith element of the Vector. /** Returns a pointer to the specified Vector element. The return - pointer will reference the element itself, so multiple calls to this - method should save each value before making the next call. + pointer will reference the element itself, so multiple calls to this + method should save each value before making the next call. - @todo Is this method thread safe? If 'apartment threading' is used, I - think so. But if the library is running in more than one thread, then - this is not thread safe. - - @param i The index of the desired Vector element. Zero - indicates the first element of the Vector. - @return A pointer to a BaseType class instance containing - the value of the indicated element. The BaseType pointer is locally - maintained and should not be deleted or referenced. Extract the value - right after the method returns. - @see BaseType::var */ + @param i The index of the desired Vector element. Zero + indicates the first element of the Vector. + @return A pointer to a BaseType class instance containing + the value of the indicated element. The BaseType pointer is locally + maintained and should not be deleted or referenced. Extract the value + right after the method returns. + @see BaseType::var */ BaseType *Vector::var(unsigned int i) { switch (_var->type()) { - case dods_byte_c: - case dods_int16_c: - case dods_uint16_c: - case dods_int32_c: - case dods_uint32_c: - case dods_float32_c: - case dods_float64_c: { + case dods_byte_c: + case dods_int16_c: + case dods_uint16_c: + case dods_int32_c: + case dods_uint32_c: + case dods_float32_c: + case dods_float64_c: { // Transfer the ith value to the BaseType *_var; There are more // efficient ways to get a whole array using buf2val() but this is // an OK way to get a single value or several non-contiguous values. @@ -471,21 +465,23 @@ break; } - case dods_str_c: - case dods_url_c: - _var->val2buf(&d_str[i]); - return _var; - break; + case dods_str_c: + case dods_url_c: + _var->val2buf(&d_str[i]); + return _var; + break; - case dods_array_c: - case dods_structure_c: - case dods_sequence_c: - case dods_grid_c: - return _vec[i]; - break; + case dods_array_c: + case dods_structure_c: + case dods_sequence_c: + case dods_grid_c: + return _vec[i]; + break; - default: - cerr << "Vector::var: Unrecognized type" << endl; + default: + throw Error ("Vector::var: Unrecognized type"); + //cerr << "Vector::var: Unrecognized type" << endl; + break; } return 0; @@ -500,30 +496,29 @@ // Returns: The number of bytes used to store the vector. /** Returns the number of bytes needed to hold the entire - array. This is equal to length() times the width of each - element. + array. This is equal to length() times the width of each + element. - @brief Returns the width of the data, in bytes. */ -unsigned int Vector::width() + @brief Returns the width of the data, in bytes. */ +unsigned int Vector::width(bool constrained) { // Jose Garcia if (!_var) { - throw InternalErr(__FILE__, __LINE__, - "Cannot get width since *this* object is not holding data."); + throw InternalErr(__FILE__, __LINE__, "Cannot get width since *this* object is not holding data."); } - return length() * _var->width(); + return length() * _var->width(constrained); } // Returns: the number of elements in the vector. /** Returns the number of elements in the vector. Note that some - child classes of Vector use the length of -1 as a flag value. + child classes of Vector use the length of -1 as a flag value. - @see Vector::append_dim */ + @see Vector::append_dim */ int Vector::length() const { - return _length; + return d_length; } // set the number of elements in the vector. @@ -531,117 +526,113 @@ // Returns: void /** Sets the length of the vector. This function does not allocate -any new space. */ + any new space. */ void Vector::set_length(int l) { - _length = l; + d_length = l; } // \e l is the number of elements the vector can hold (e.g., if l == 20, then // the vector can hold elements 0, .., 19). /** Resizes a Vector. If the input length is greater than the - current length of the Vector, new memory is allocated (the - Vector moved if necessary), and the new entries are appended to - the end of the array and padded with Null values. If the input - length is shorter, the tail values are discarded. */ + current length of the Vector, new memory is allocated (the + Vector moved if necessary), and the new entries are appended to + the end of the array and padded with Null values. If the input + length is shorter, the tail values are discarded. */ void Vector::vec_resize(int l) { - _vec.resize((l > 0) ? l : 0, 0); // Fill with NULLs + _vec.resize((l > 0) ? l : 0, 0); // Fill with NULLs _capacity = l; // capacity in terms of number of elements. } /** @brief read data into a variable for later use - Most uses of a variable are to either serialize its data to a stream of - some sort or to read values from some stream and intern those in the - variable for later use. These operations are perform by serialize() - and deserialize() which follow. This function performs essentially both - of these operations without actually using a stream device. The data are - read using the read() method(s) and loaded into the variables directly. - - This method is intended to be used by objects which transform DAP objects - like the DataDDS into an ASCII CSV representation. - - the data source. - @param eval A reference to a constraint evaluator - @param dds The complete DDS to which this variable belongs */ -void -Vector::intern_data(ConstraintEvaluator &eval, DDS &dds) + Most uses of a variable are to either serialize its data to a stream of + some sort or to read values from some stream and intern those in the + variable for later use. These operations are perform by serialize() + and deserialize() which follow. This function performs essentially both + of these operations without actually using a stream device. The data are + read using the read() method(s) and loaded into the variables directly. + + This method is intended to be used by objects which transform DAP objects + like the DataDDS into an ASCII CSV representation. + + the data source. + @param eval A reference to a constraint evaluator + @param dds The complete DDS to which this variable belongs */ +void Vector::intern_data(ConstraintEvaluator &eval, DDS &dds) { DBG(cerr << "Vector::intern_data: " << name() << endl); if (!read_p()) - read(); // read() throws Error and InternalErr + read(); // read() throws Error and InternalErr // length() is not capacity; it must be set explicitly in read(). int num = length(); switch (_var->type()) { - case dods_byte_c: - case dods_int16_c: - case dods_uint16_c: - case dods_int32_c: - case dods_uint32_c: - case dods_float32_c: - case dods_float64_c: - // For these cases, read() puts the data into _buf, which is what we - // need to do 'stuff' with the data. - break; - - case dods_str_c: - case dods_url_c: - // For these cases, read() will put the data into d_str[], which is - // what the transformation classes need. - break; - - case dods_array_c: - // I think this is an error since there can never be an Array of - // Array. - throw InternalErr(__FILE__, __LINE__, "Array of Array not supported."); - break; - - case dods_structure_c: - case dods_sequence_c: - case dods_grid_c: - DBG(cerr << "Vector::intern_data: found ctor" << endl); - // For these cases, we need to call read() for each of the 'num' - // elements in the '_vec[]' array of BaseType object pointers. - if (_vec.capacity() == 0) - throw InternalErr(__FILE__, __LINE__, - "The capacity of *this* vector is 0."); - - for (int i = 0; i < num; ++i) - _vec[i]->intern_data(eval, dds); - - break; - - default: - throw InternalErr(__FILE__, __LINE__, "Unknown datatype."); - break; + case dods_byte_c: + case dods_int16_c: + case dods_uint16_c: + case dods_int32_c: + case dods_uint32_c: + case dods_float32_c: + case dods_float64_c: + // For these cases, read() puts the data into _buf, which is what we + // need to do 'stuff' with the data. + break; + + case dods_str_c: + case dods_url_c: + // For these cases, read() will put the data into d_str[], which is + // what the transformation classes need. + break; + + case dods_array_c: + // I think this is an error since there can never be an Array of + // Array. + throw InternalErr(__FILE__, __LINE__, "Array of Array not supported."); + break; + + case dods_structure_c: + case dods_sequence_c: + case dods_grid_c: + DBG(cerr << "Vector::intern_data: found ctor" << endl); + // For these cases, we need to call read() for each of the 'num' + // elements in the '_vec[]' array of BaseType object pointers. + if (_vec.capacity() == 0) + throw InternalErr(__FILE__, __LINE__, "The capacity of *this* vector is 0."); + + for (int i = 0; i < num; ++i) + _vec[i]->intern_data(eval, dds); + + break; + + default: + throw InternalErr(__FILE__, __LINE__, "Unknown datatype."); + break; } } /** @brief Serialize a Vector. - This uses the Marshaler class to encode each element of a cardinal - array. For Arrays of Str and Url types, send the element count over - as a prefix to the data so that deserialize will know how many elements - to read. - - NB: Arrays of cardinal types must already be in BUF (in the local machine's - representation) before this call is made. -*/ + This uses the Marshaler class to encode each element of a cardinal + array. For Arrays of Str and Url types, send the element count over + as a prefix to the data so that deserialize will know how many elements + to read. + NB: Arrays of cardinal types must already be in BUF (in the local machine's + representation) before this call is made. + */ -bool Vector::serialize(ConstraintEvaluator & eval, DDS & dds, - Marshaller &m, bool ce_eval) +bool Vector::serialize(ConstraintEvaluator & eval, DDS & dds, Marshaller &m, bool ce_eval) { - int i = 0; + int i = 0;// TODO move closer to use dds.timeout_on(); if (!read_p()) - read(); // read() throws Error and InternalErr + read(); // read() throws Error and InternalErr #if EVAL if (ce_eval && !eval.eval_selection(dds, dataset())) @@ -654,51 +645,49 @@ int num = length(); switch (_var->type()) { - case dods_byte_c: - m.put_vector( _buf, num, *this ) ; - break ; - case dods_int16_c: - case dods_uint16_c: - case dods_int32_c: - case dods_uint32_c: - case dods_float32_c: - case dods_float64_c: - m.put_vector( _buf, num, _var->width(), *this ) ; - break; - - case dods_str_c: - case dods_url_c: - if (d_str.capacity() == 0) - throw InternalErr(__FILE__, __LINE__, - "The capacity of the string vector is 0"); - - m.put_int( num ) ; - - for (i = 0; i < num; ++i) - m.put_str( d_str[i] ) ; - - break; - - case dods_array_c: - case dods_structure_c: - case dods_sequence_c: - case dods_grid_c: - //Jose Garcia - // Not setting the capacity of _vec is an internal error. - if (_vec.capacity() == 0) - throw InternalErr(__FILE__, __LINE__, - "The capacity of *this* vector is 0."); - - m.put_int( num ) ; - - for (i = 0; i < num; ++i) - _vec[i]->serialize(eval, dds, m, false); - - break; - - default: - throw InternalErr(__FILE__, __LINE__, "Unknown datatype."); - break; + case dods_byte_c: + m.put_vector(_buf, num, *this); + break; + case dods_int16_c: + case dods_uint16_c: + case dods_int32_c: + case dods_uint32_c: + case dods_float32_c: + case dods_float64_c: + m.put_vector(_buf, num, _var->width(), *this); + break; + + case dods_str_c: + case dods_url_c: + if (d_str.capacity() == 0) + throw InternalErr(__FILE__, __LINE__, "The capacity of the string vector is 0"); + + m.put_int(num); + + for (i = 0; i < num; ++i) + m.put_str(d_str[i]); + + break; + + case dods_array_c: + case dods_structure_c: + case dods_sequence_c: + case dods_grid_c: + //Jose Garcia + // Not setting the capacity of _vec is an internal error. + if (_vec.capacity() == 0) + throw InternalErr(__FILE__, __LINE__, "The capacity of *this* vector is 0."); + + m.put_int(num); + + for (i = 0; i < num; ++i) + _vec[i]->serialize(eval, dds, m, false); + + break; + + default: + throw InternalErr(__FILE__, __LINE__, "Unknown datatype."); + break; } return true; @@ -727,124 +716,123 @@ unsigned i = 0; switch (_var->type()) { - case dods_byte_c: - case dods_int16_c: - case dods_uint16_c: - case dods_int32_c: - case dods_uint32_c: - case dods_float32_c: - case dods_float64_c: - if (_buf && !reuse) { - delete_cardinal_data_buffer(); - } - - um.get_int( (int &)num ) ; - - DBG(cerr << "Vector::deserialize: num = " << num << endl); - DBG(cerr << "Vector::deserialize: length = " << length() << endl); - - if (length() == -1) - set_length(num); - - if (num != (unsigned int) length()) - throw InternalErr(__FILE__, __LINE__, "The server sent declarations and data with mismatched sizes."); - - if (!_buf) { - // Make _buf be large enough for length() elements of _var->type() - create_cardinal_data_buffer_for_type(length()); - DBG(cerr << "Vector::deserialize: allocating " - << width() << " bytes for an array of " - << length() << " " << _var->type_name() << endl); - } - - if (_var->type() == dods_byte_c) - um.get_vector( (char **)&_buf, num, *this ) ; - else - um.get_vector( (char **)&_buf, num, _var->width(), *this ) ; - - DBG(cerr << "Vector::deserialize: read " << num << " elements\n"); - - break; - - case dods_str_c: - case dods_url_c: - um.get_int( (int &)num ) ; + case dods_byte_c: + case dods_int16_c: + case dods_uint16_c: + case dods_int32_c: + case dods_uint32_c: + case dods_float32_c: + case dods_float64_c: + if (_buf && !reuse) { + m_delete_cardinal_data_buffer(); + } - if (length() == -1) - set_length(num); + um.get_int((int &) num); - if (num != (unsigned int) length()) - throw InternalErr(__FILE__, __LINE__, - "The client sent declarations and data with mismatched sizes."); + DBG(cerr << "Vector::deserialize: num = " << num << endl); + DBG(cerr << "Vector::deserialize: length = " << length() << endl); - d_str.resize((num > 0) ? num : 0); // Fill with NULLs - _capacity = num; // capacity is number of strings we can fit. + if (length() == -1) + set_length(num); - for (i = 0; i < num; ++i) { - string str; - um.get_str( str ) ; - d_str[i] = str; + if (num != (unsigned int) length()) + throw InternalErr(__FILE__, __LINE__, "The server sent declarations and data with mismatched sizes."); + + if (!_buf) { + // Make _buf be large enough for length() elements of _var->type() + m_create_cardinal_data_buffer_for_type(length()); + DBG(cerr << "Vector::deserialize: allocating " + << width() << " bytes for an array of " + << length() << " " << _var->type_name() << endl); + } - } + if (_var->type() == dods_byte_c) + um.get_vector((char **) &_buf, num, *this); + else + um.get_vector((char **) &_buf, num, _var->width(), *this); - break; + DBG(cerr << "Vector::deserialize: read " << num << " elements\n"); - case dods_array_c: - case dods_structure_c: - case dods_sequence_c: - case dods_grid_c: - um.get_int( (int &)num ) ; + break; - if (length() == -1) - set_length(num); + case dods_str_c: + case dods_url_c: + um.get_int((int &) num); + + if (length() == -1) + set_length(num); + + if (num != (unsigned int) length()) + throw InternalErr(__FILE__, __LINE__, "The client sent declarations and data with mismatched sizes."); + + d_str.resize((num > 0) ? num : 0); // Fill with NULLs + _capacity = num; // capacity is number of strings we can fit. + + for (i = 0; i < num; ++i) { + string str; + um.get_str(str); + d_str[i] = str; - if (num != (unsigned int) length()) - throw InternalErr(__FILE__, __LINE__, "The client sent declarations and data with mismatched sizes."); + } - vec_resize(num); + break; - for (i = 0; i < num; ++i) { - _vec[i] = _var->ptr_duplicate(); - _vec[i]->deserialize(um, dds); - } + case dods_array_c: + case dods_structure_c: + case dods_sequence_c: + case dods_grid_c: + um.get_int((int &) num); + + if (length() == -1) + set_length(num); + + if (num != (unsigned int) length()) + throw InternalErr(__FILE__, __LINE__, "The client sent declarations and data with mismatched sizes."); + + vec_resize(num); + + for (i = 0; i < num; ++i) { + _vec[i] = _var->ptr_duplicate(); + _vec[i]->deserialize(um, dds); + } - break; + break; - default: - throw InternalErr(__FILE__, __LINE__, "Unknown type!"); - break; + default: + throw InternalErr(__FILE__, __LINE__, "Unknown type!"); + break; } return false; } /** Copies data into the class instance buffer. This function - assumes that the input \e val points to memory which - contains, in row major order, enough elements of the correct - type to fill the array. For an array of a cardinal type the - memory is simply copied in whole into the Vector buffer. - - If the variable has already been constrained, this method will load only - number of values/bytes specified by that constraint and will load them - into the 'front' of the object's internal buffer. This is where serialize() - expects to find the data. - - For a Vector of Str (OPeNDAP Strings), this assumes \e val points to an - array of C++ strings. - - This method should not be used for Structure, Sequence or Grid. - - @brief Reads data into the Vector buffer. - @exception InternalErr Thrown if called for Structure, Sequence or - Grid. - @return The number of bytes used by the array. - @param val A pointer to the input data. - @param reuse A boolean value, indicating whether the class - internal data storage can be reused or not. If this argument is - TRUE, the class buffer is assumed to be large enough to hold the - incoming data, and it is not reallocated. If FALSE, new - storage is allocated. If the internal buffer has not been - allocated at all, this argument has no effect. */ + assumes that the input \e val points to memory which + contains, in row major order, enough elements of the correct + type to fill the array. For an array of a cardinal type the + memory is simply copied in whole into the Vector buffer. + + If the variable has already been constrained, this method will load only + number of values/bytes specified by that constraint and will load them + into the 'front' of the object's internal buffer. This is where serialize() + expects to find the data. + + For a Vector of Str (OPeNDAP Strings), this assumes \e val points to an + array of C++ strings. + + This method should not be used for Structure, Sequence or Grid. + + @brief Reads data into the Vector buffer. + @exception InternalErr Thrown if called for Structure, Sequence or + Grid. + @return The number of bytes used by the array. + @param val A pointer to the input data. + @param reuse A boolean value, indicating whether the class + internal data storage can be reused or not. If this argument is + TRUE, the class buffer is assumed to be large enough to hold the + incoming data, and it is not reallocated. If FALSE, new + storage is allocated. If the internal buffer has not been + allocated at all, this argument has no effect. */ unsigned int Vector::val2buf(void *val, bool reuse) { // Jose Garcia @@ -857,81 +845,80 @@ // will be in libdap++, so it will be an internal error from the // surrogate library. if (!val) - throw InternalErr(__FILE__, __LINE__, - "The incoming pointer does not contain any data."); + throw InternalErr(__FILE__, __LINE__, "The incoming pointer does not contain any data."); switch (_var->type()) { - case dods_byte_c: - case dods_int16_c: - case dods_uint16_c: - case dods_int32_c: - case dods_uint32_c: - case dods_float32_c: - case dods_float64_c: { - // width() returns the size given the constraint - unsigned int array_wid = width(); + case dods_byte_c: + case dods_int16_c: + case dods_uint16_c: + case dods_int32_c: + case dods_uint32_c: + case dods_float32_c: + case dods_float64_c: { + // width(true) returns the size given the constraint + unsigned int array_wid = width(true); if (_buf && !reuse) { - delete_cardinal_data_buffer(); + m_delete_cardinal_data_buffer(); } - if (!_buf) { // First time or no reuse (free'd above) - create_cardinal_data_buffer_for_type(length()); + if (!_buf) { // First time or no reuse (free'd above) + m_create_cardinal_data_buffer_for_type(length()); } memcpy(_buf, val, array_wid); break; } - case dods_str_c: - case dods_url_c: { + case dods_str_c: + case dods_url_c: { // Assume val points to an array of C++ string objects. Copy // them into the vector field of this object. - d_str.resize(_length); - _capacity = _length; - for (int i = 0; i < _length; ++i) - d_str[i] = *(static_cast < string * >(val) + i); + d_str.resize(d_length); + _capacity = d_length; + for (int i = 0; i < d_length; ++i) + d_str[i] = *(static_cast (val) + i); break; } - default: - throw InternalErr(__FILE__, __LINE__, "Vector::val2buf: bad type"); + default: + throw InternalErr(__FILE__, __LINE__, "Vector::val2buf: bad type"); } - return width(); + return width(true); } /** Copies data from the Vector buffer. This function assumes that - val points to an array large enough to hold N instances of - the `C' representation of the \e numeric element type or C++ string - objects. Never call this method for constructor types Structure, - Sequence or Grid. - - When reading data out of a variable that has been constrained, this method - assumes the N values/bytes of constrained data start at the beginning - of the object's internal buffer. For example, do not load an entire - Vector's data using val2buf(), constrain and then use this method to - get the data. Unless your constraint starts with the [0]th element, the - result will not be the correct values. - - In the case of a Vector of Str objects, this method will return an array - of C++ std::string objects. - - @note It's best to define the pointer to reference the data as - 'char *data' and then call this method using '..->buf2val((void**)&data)'. - Then free the storage once you're done using 'delete[] data'. It's not - correct C++ to use 'delete[]' on a void pointer and the allocated memory - \e is an array of char, so 'delete[]' is needed. - - @return The number of bytes used to store the array. - @param val A pointer to a pointer to the memory into which the - class data will be copied. If the value pointed to is NULL, - memory will be allocated to hold the data, and the pointer value - modified accordingly. The calling program is responsible for - deallocating the memory indicated by this pointer. - @exception InternalErr Thrown if \e val is null. - @see Vector::set_vec */ + val points to an array large enough to hold N instances of + the `C' representation of the \e numeric element type or C++ string + objects. Never call this method for constructor types Structure, + Sequence or Grid. + + When reading data out of a variable that has been constrained, this method + assumes the N values/bytes of constrained data start at the beginning + of the object's internal buffer. For example, do not load an entire + Vector's data using val2buf(), constrain and then use this method to + get the data. Unless your constraint starts with the [0]th element, the + result will not be the correct values. + + In the case of a Vector of Str objects, this method will return an array + of C++ std::string objects. + + @note It's best to define the pointer to reference the data as + 'char *data' and then call this method using '..->buf2val((void**)&data)'. + Then free the storage once you're done using 'delete[] data'. It's not + correct C++ to use 'delete[]' on a void pointer and the allocated memory + \e is an array of char, so 'delete[]' is needed. + + @return The number of bytes used to store the array. + @param val A pointer to a pointer to the memory into which the + class data will be copied. If the value pointed to is NULL, + memory will be allocated to hold the data, and the pointer value + modified accordingly. The calling program is responsible for + deallocating the memory indicated by this pointer. + @exception InternalErr Thrown if \e val is null. + @see Vector::set_vec */ unsigned int Vector::buf2val(void **val) { // Jose Garcia @@ -939,86 +926,83 @@ if (!val) throw InternalErr(__FILE__, __LINE__, "NULL pointer."); - unsigned int wid = static_cast(width()); + unsigned int wid = static_cast (width(true /* constrained */)); // This is the width computed using length(). The // length() property is changed when a projection // constraint is applied. Thus this is the number of // bytes in the buffer given the current constraint. switch (_var->type()) { - case dods_byte_c: - case dods_int16_c: - case dods_uint16_c: - case dods_int32_c: - case dods_uint32_c: - case dods_float32_c: - case dods_float64_c: - if (!*val) { - *val = new char[wid]; - } - // avoid bus error if _buf is null and this is called improperly. - if (!_buf) { - throw InternalErr(__FILE__, __LINE__, "Vector::buf2val: Logic error: called when _buf was null!"); - } + case dods_byte_c: + case dods_int16_c: + case dods_uint16_c: + case dods_int32_c: + case dods_uint32_c: + case dods_float32_c: + case dods_float64_c: + if (!*val) { + *val = new char[wid]; + } + // avoid bus error if _buf is null and this is called improperly. + if (!_buf) { + throw InternalErr(__FILE__, __LINE__, "Vector::buf2val: Logic error: called when _buf was null!"); + } - (void) memcpy(*val, _buf, wid); + (void) memcpy(*val, _buf, wid); - break; + break; - case dods_str_c: - case dods_url_c: { + case dods_str_c: + case dods_url_c: { if (!*val) - *val = new string[_length]; + *val = new string[d_length]; - for (int i = 0; i < _length; ++i) - *(static_cast < string * >(*val) + i) = d_str[i]; + for (int i = 0; i < d_length; ++i) + *(static_cast (*val) + i) = d_str[i]; break; } - default: - throw InternalErr(__FILE__, __LINE__, "Vector::buf2val: bad type"); - return 0; + default: + throw InternalErr(__FILE__, __LINE__, "Vector::buf2val: bad type"); + return 0; } return wid; } /** Sets an element of the vector to a given value. If the type of - the input and the type of the Vector do not match, an error - condition is returned. + the input and the type of the Vector do not match, an error + condition is returned. - Use this function only with Vectors containing compound DAP2 - types. See buf2val() to access members of Vectors containing - simple types. - - @note This method copies \e val; the caller is responsible for deleting - instance passed as the actual parameter. - - @brief Sets element i to value val. - @return void - @exception InternalErr Thrown if \e i is out of range, \e val is null or - there was a type mismatch between the BaseType referenced by \e val and - the \e ith element of this Vector. - @param i The index of the element to be changed. - @param val A pointer to the value to be inserted into the - array. - @see Vector::buf2val */ + Use this function only with Vectors containing compound DAP2 + types. See buf2val() to access members of Vectors containing + simple types. + + @note This method copies \e val; the caller is responsible for deleting + instance passed as the actual parameter. + + @brief Sets element i to value val. + @return void + @exception InternalErr Thrown if \e i is out of range, \e val is null or + there was a type mismatch between the BaseType referenced by \e val and + the \e ith element of this Vector. + @param i The index of the element to be changed. + @param val A pointer to the value to be inserted into the + array. + @see Vector::buf2val */ void Vector::set_vec(unsigned int i, BaseType * val) { // Jose Garcia // This is a public method which allows users to set the elements // of *this* vector. Passing an invalid index, a NULL pointer or // mismatching the vector type are internal errors. - if (i >= static_cast < unsigned int >(_length)) - throw InternalErr(__FILE__, __LINE__, - "Invalid data: index too large."); + if (i >= static_cast (d_length)) + throw InternalErr(__FILE__, __LINE__, "Invalid data: index too large."); if (!val) - throw InternalErr(__FILE__, __LINE__, - "Invalid data: null pointer to BaseType object."); + throw InternalErr(__FILE__, __LINE__, "Invalid data: null pointer to BaseType object."); if (val->type() != _var->type()) - throw InternalErr(__FILE__, __LINE__, - "invalid data: type of incoming object does not match *this* vector type."); + throw InternalErr(__FILE__, __LINE__, "invalid data: type of incoming object does not match *this* vector type."); if (i >= _vec.capacity()) vec_resize(i + 10); @@ -1035,27 +1019,25 @@ * NOTE: this is not virtual, and only affects the data in Vector itself! * On exit: get_value_capacity() == 0 && !read_p() */ -void -Vector::clear_local_data() +void Vector::clear_local_data() { - if (_buf) { - delete[]_buf; - _buf = 0; - } - - for (unsigned int i = 0; i < _vec.size(); ++i) { - delete _vec[i]; - _vec[i] = 0; - } - - // Force memory to be reclaimed. - _vec.resize(0); - d_str.resize(0); + if (_buf) { + delete[] _buf; + _buf = 0; + } - _capacity = 0; - set_read_p(false); -} + for (unsigned int i = 0; i < _vec.size(); ++i) { + delete _vec[i]; + _vec[i] = 0; + } + // Force memory to be reclaimed. + _vec.resize(0); + d_str.resize(0); + + _capacity = 0; + set_read_p(false); +} /** * Return the capacity of the Vector in terms of number of @@ -1063,14 +1045,12 @@ * For example, this could be * the size of the _buf array in bytes / sizeof(T) for the cardinal * types T, or the capacity of the d_str vector if T is string or url type. -*/ -unsigned int -Vector::get_value_capacity() const + */ +unsigned int Vector::get_value_capacity() const { - return _capacity; + return _capacity; } - /** * Allocate enough memory for the Vector to contain * numElements data elements of the Vector's type. @@ -1080,52 +1060,49 @@ * to preallocate storage for. * @exception if the memory cannot be allocated */ -void -Vector::reserve_value_capacity(unsigned int numElements) +void Vector::reserve_value_capacity(unsigned int numElements) { - if (!_var) { - throw InternalErr(__FILE__, __LINE__, - "reserve_value_capacity: Logic error: _var is null!"); - } - switch (_var->type()) { - case dods_byte_c: - case dods_int16_c: - case dods_uint16_c: - case dods_int32_c: - case dods_uint32_c: - case dods_float32_c: - case dods_float64_c: { - // Make _buf be the right size and set _capacity - create_cardinal_data_buffer_for_type(numElements); - } - break; - - case dods_str_c: - case dods_url_c: { - // Make sure the d_str has enough room for all the strings. - // Technically not needed, but it will speed things up for large arrays. - d_str.reserve(numElements); - _capacity = numElements; - } - break; - - - case dods_array_c: - case dods_structure_c: - case dods_sequence_c: - case dods_grid_c: { - // not clear anyone will go this path, but best to be complete. - _vec.reserve(numElements); - _capacity = numElements; - } - break; - - default: { - throw InternalErr(__FILE__, __LINE__, "reserve_value_capacity: Unknown type!"); - } - break; + if (!_var) { + throw InternalErr(__FILE__, __LINE__, "reserve_value_capacity: Logic error: _var is null!"); + } + switch (_var->type()) { + case dods_byte_c: + case dods_int16_c: + case dods_uint16_c: + case dods_int32_c: + case dods_uint32_c: + case dods_float32_c: + case dods_float64_c: { + // Make _buf be the right size and set _capacity + m_create_cardinal_data_buffer_for_type(numElements); + } + break; - } // switch + case dods_str_c: + case dods_url_c: { + // Make sure the d_str has enough room for all the strings. + // Technically not needed, but it will speed things up for large arrays. + d_str.reserve(numElements); + _capacity = numElements; + } + break; + + case dods_array_c: + case dods_structure_c: + case dods_sequence_c: + case dods_grid_c: { + // not clear anyone will go this path, but best to be complete. + _vec.reserve(numElements); + _capacity = numElements; + } + break; + + default: { + throw InternalErr(__FILE__, __LINE__, "reserve_value_capacity: Unknown type!"); + } + break; + + } // switch } @@ -1134,11 +1111,10 @@ * of the Vector. * Same as reserveValueCapacity(length()) */ -void -Vector::reserve_value_capacity() +void Vector::reserve_value_capacity() { - // Use the current length of the vector as the reserve amount. - reserve_value_capacity(length()); + // Use the current length of the vector as the reserve amount. + reserve_value_capacity(length()); } /** @@ -1169,111 +1145,101 @@ * @return the number of elements added, such that: * startElement + the return value is the next "free" element. */ -unsigned int -Vector::set_value_slice_from_row_major_vector(const Vector& rowMajorDataC, unsigned int startElement) +unsigned int Vector::set_value_slice_from_row_major_vector(const Vector& rowMajorDataC, unsigned int startElement) { - static const string funcName = "set_value_slice_from_row_major_vector:"; + static const string funcName = "set_value_slice_from_row_major_vector:"; + + // semantically const from the caller's viewpoint, but some calls are not syntactic const. + Vector& rowMajorData = const_cast (rowMajorDataC); + + bool typesMatch = rowMajorData.var() && _var && (rowMajorData.var()->type() == _var->type()); + if (!typesMatch) { + throw InternalErr(__FILE__, __LINE__, funcName + "Logic error: types do not match so cannot be copied!"); + } - // semantically const from the caller's viewpoint, but some calls are not syntactic const. - Vector& rowMajorData = const_cast(rowMajorDataC); + // Make sure the data exists + if (!rowMajorData.read_p()) { + throw InternalErr(__FILE__, __LINE__, funcName + "Logic error: the Vector to copy data from has !read_p() and should have been read in!"); + } - bool typesMatch = rowMajorData.var() && _var && (rowMajorData.var()->type() == _var->type()); - if (!typesMatch) { - throw InternalErr(__FILE__, __LINE__, - funcName + "Logic error: types do not match so cannot be copied!"); - } - - // Make sure the data exists - if (!rowMajorData.read_p()) { - throw InternalErr(__FILE__, __LINE__, - funcName + "Logic error: the Vector to copy data from has !read_p() and should have been read in!"); - } - - // Check this otherwise the static_cast below will do the wrong thing. - if (rowMajorData.length() < 0) { - throw InternalErr(__FILE__, __LINE__, - funcName + "Logic error: the Vector to copy data from has length() < 0 and was probably not initialized!"); - } - - // The read-in capacity had better be at least the length (the amountt we will copy) or we'll memcpy into bad memory - // I imagine we could copy just the capacity rather than throw, but I really think this implies a problem to be addressed. - if (rowMajorData.get_value_capacity() < static_cast(rowMajorData.length())) { - throw InternalErr(__FILE__, __LINE__, - funcName + "Logic error: the Vector to copy from has a data capacity less than its length, can't copy!"); - } - - // Make sure there's enough room in this Vector to store all the elements requested. Again, - // better to throw than just copy what we can since it implies a logic error that needs to be solved. - if (_capacity < (startElement + rowMajorData.length())) { - throw InternalErr(__FILE__, __LINE__, - funcName + "Logic error: the capacity of this Vector cannot hold all the data in the from Vector!"); - } - - // OK, at this point we're pretty sure we can copy the data, but we have to do it differently depending on type. - switch (_var->type()) { - case dods_byte_c: - case dods_int16_c: - case dods_uint16_c: - case dods_int32_c: - case dods_uint32_c: - case dods_float32_c: - case dods_float64_c: { - if (!_buf) { - throw InternalErr(__FILE__, __LINE__, funcName + "Logic error: this->_buf was unexpectedly null!"); - } - if (!rowMajorData._buf) { - throw InternalErr(__FILE__, __LINE__, funcName + "Logic error: rowMajorData._buf was unexpectedly null!"); - } - // memcpy the data into this, taking care to do ptr arithmetic on bytes and not sizeof(element) - int varWidth = _var->width(); - char* pFromBuf = rowMajorData._buf; - int numBytesToCopy = rowMajorData.width(); - char* pIntoBuf = _buf + (startElement * varWidth); - memcpy(pIntoBuf, - pFromBuf, - numBytesToCopy ); - } - break; - - case dods_str_c: - case dods_url_c: { - // Strings need to be copied directly - for (unsigned int i = 0; i < static_cast(rowMajorData.length()); ++i) { - d_str[startElement + i] = rowMajorData.d_str[i]; - } - } - break; - - case dods_array_c: - case dods_structure_c: - case dods_sequence_c: - case dods_grid_c: { - // Not sure that this function will be used for these type of nested objects, so I will throw here. - // TODO impl and test this path if it's ever needed. - throw InternalErr(__FILE__, __LINE__, - funcName + "Unimplemented method for Vectors of type: dods_array_c, dods_structure_c, dods_sequence_c and dods_grid_c."); - } - break; - - default: { - throw InternalErr(__FILE__, __LINE__, funcName + ": Unknown type!"); - } - break; + // Check this otherwise the static_cast below will do the wrong thing. + if (rowMajorData.length() < 0) { + throw InternalErr(__FILE__, __LINE__, funcName + "Logic error: the Vector to copy data from has length() < 0 and was probably not initialized!"); + } - } // switch (_var->type()) + // The read-in capacity had better be at least the length (the amountt we will copy) or we'll memcpy into bad memory + // I imagine we could copy just the capacity rather than throw, but I really think this implies a problem to be addressed. + if (rowMajorData.get_value_capacity() < static_cast (rowMajorData.length())) { + throw InternalErr(__FILE__, __LINE__, funcName + "Logic error: the Vector to copy from has a data capacity less than its length, can't copy!"); + } - // This is how many elements we copied. - return (unsigned int)rowMajorData.length(); + // Make sure there's enough room in this Vector to store all the elements requested. Again, + // better to throw than just copy what we can since it implies a logic error that needs to be solved. + if (_capacity < (startElement + rowMajorData.length())) { + throw InternalErr(__FILE__, __LINE__, funcName + "Logic error: the capacity of this Vector cannot hold all the data in the from Vector!"); + } + + // OK, at this point we're pretty sure we can copy the data, but we have to do it differently depending on type. + switch (_var->type()) { + case dods_byte_c: + case dods_int16_c: + case dods_uint16_c: + case dods_int32_c: + case dods_uint32_c: + case dods_float32_c: + case dods_float64_c: { + if (!_buf) { + throw InternalErr(__FILE__, __LINE__, funcName + "Logic error: this->_buf was unexpectedly null!"); + } + if (!rowMajorData._buf) { + throw InternalErr(__FILE__, __LINE__, funcName + "Logic error: rowMajorData._buf was unexpectedly null!"); + } + // memcpy the data into this, taking care to do ptr arithmetic on bytes and not sizeof(element) + int varWidth = _var->width(); + char* pFromBuf = rowMajorData._buf; + int numBytesToCopy = rowMajorData.width(true); + char* pIntoBuf = _buf + (startElement * varWidth); + memcpy(pIntoBuf, pFromBuf, numBytesToCopy); + } + break; + + case dods_str_c: + case dods_url_c: { + // Strings need to be copied directly + for (unsigned int i = 0; i < static_cast (rowMajorData.length()); ++i) { + d_str[startElement + i] = rowMajorData.d_str[i]; + } + } + break; + + case dods_array_c: + case dods_structure_c: + case dods_sequence_c: + case dods_grid_c: { + // Not sure that this function will be used for these type of nested objects, so I will throw here. + // TODO impl and test this path if it's ever needed. + throw InternalErr(__FILE__, __LINE__, funcName + "Unimplemented method for Vectors of type: dods_array_c, dods_structure_c, dods_sequence_c and dods_grid_c."); + } + break; + + default: { + throw InternalErr(__FILE__, __LINE__, funcName + ": Unknown type!"); + } + break; + + } // switch (_var->type()) + + // This is how many elements we copied. + return (unsigned int) rowMajorData.length(); } //@{ /** @brief set the value of a byte array */ -bool -Vector::set_value(dods_byte *val, int sz) +bool Vector::set_value(dods_byte *val, int sz) { if (var()->type() == dods_byte_c && val) { - set_cardinal_values_internal(val, sz); - return true; + set_cardinal_values_internal (val, sz); + return true; } else { return false; @@ -1281,19 +1247,17 @@ } /** @brief set the value of a byte array */ -bool -Vector::set_value(vector &val, int sz) +bool Vector::set_value(vector &val, int sz) { return set_value(&val[0], sz); } /** @brief set the value of a int16 array */ -bool -Vector::set_value(dods_int16 *val, int sz) +bool Vector::set_value(dods_int16 *val, int sz) { if (var()->type() == dods_int16_c && val) { - set_cardinal_values_internal(val, sz); - return true; + set_cardinal_values_internal (val, sz); + return true; } else { return false; @@ -1301,19 +1265,17 @@ } /** @brief set the value of a int16 array */ -bool -Vector::set_value(vector &val, int sz) +bool Vector::set_value(vector &val, int sz) { return set_value(&val[0], sz); } /** @brief set the value of a int32 array */ -bool -Vector::set_value(dods_int32 *val, int sz) +bool Vector::set_value(dods_int32 *val, int sz) { if (var()->type() == dods_int32_c && val) { - set_cardinal_values_internal(val, sz); - return true; + set_cardinal_values_internal (val, sz); + return true; } else { return false; @@ -1321,19 +1283,17 @@ } /** @brief set the value of a int32 array */ -bool -Vector::set_value(vector &val, int sz) +bool Vector::set_value(vector &val, int sz) { return set_value(&val[0], sz); } /** @brief set the value of a uint16 array */ -bool -Vector::set_value(dods_uint16 *val, int sz) +bool Vector::set_value(dods_uint16 *val, int sz) { if (var()->type() == dods_uint16_c && val) { - set_cardinal_values_internal(val, sz); - return true; + set_cardinal_values_internal (val, sz); + return true; } else { return false; @@ -1341,18 +1301,16 @@ } /** @brief set the value of a uint16 array */ -bool -Vector::set_value(vector &val, int sz) +bool Vector::set_value(vector &val, int sz) { return set_value(&val[0], sz); } /** @brief set the value of a uint32 array */ -bool -Vector::set_value(dods_uint32 *val, int sz) +bool Vector::set_value(dods_uint32 *val, int sz) { if (var()->type() == dods_uint32_c && val) { - set_cardinal_values_internal(val, sz); + set_cardinal_values_internal (val, sz); return true; } else { @@ -1361,18 +1319,16 @@ } /** @brief set the value of a uint32 array */ -bool -Vector::set_value(vector &val, int sz) +bool Vector::set_value(vector &val, int sz) { return set_value(&val[0], sz); } /** @brief set the value of a float32 array */ -bool -Vector::set_value(dods_float32 *val, int sz) +bool Vector::set_value(dods_float32 *val, int sz) { if (var()->type() == dods_float32_c && val) { - set_cardinal_values_internal(val, sz); + set_cardinal_values_internal (val, sz); return true; } else { @@ -1381,43 +1337,39 @@ } /** @brief set the value of a float32 array */ -bool -Vector::set_value(vector &val, int sz) +bool Vector::set_value(vector &val, int sz) { return set_value(&val[0], sz); } /** @brief set the value of a float64 array */ -bool -Vector::set_value(dods_float64 *val, int sz) +bool Vector::set_value(dods_float64 *val, int sz) { if (var()->type() == dods_float64_c && val) { - set_cardinal_values_internal(val, sz); - return true; + set_cardinal_values_internal (val, sz); + return true; } else { - return false; + return false; } } /** @brief set the value of a float64 array */ -bool -Vector::set_value(vector &val, int sz) +bool Vector::set_value(vector &val, int sz) { return set_value(&val[0], sz); } /** @brief set the value of a string or url array */ -bool -Vector::set_value(string *val, int sz) +bool Vector::set_value(string *val, int sz) { if ((var()->type() == dods_str_c || var()->type() == dods_url_c) && val) { d_str.resize(sz); _capacity = sz; for (register int t = 0; t < sz; t++) { - d_str[t] = val[t] ; + d_str[t] = val[t]; } - set_length(sz) ; + set_length(sz); set_read_p(true); return true; } @@ -1427,16 +1379,15 @@ } /** @brief set the value of a string or url array */ -bool -Vector::set_value(vector &val, int sz) +bool Vector::set_value(vector &val, int sz) { if (var()->type() == dods_str_c || var()->type() == dods_url_c) { d_str.resize(sz); _capacity = sz; for (register int t = 0; t < sz; t++) { - d_str[t] = val[t] ; + d_str[t] = val[t]; } - set_length(sz) ; + set_length(sz); set_read_p(true); return true; } @@ -1447,13 +1398,175 @@ //@} //@{ + +/** @brief Get a copy of the data held by this variable using the passed subsetIndex vector to identify which values to return. + Read data from this variable's internal storage using the passed std::vector as an sub-setting index to the values to be returned. The + memory referenced by \c b must point to enough memory + to hold index.size() bytes. + + @param index A std::vector where each value in the vector is the location in the Vector's internal storage from which to read the returned value + @param b A pointer to the memory to hold the data; must be at least + length() * sizeof(dods_byte) in size.*/ +void Vector::value(vector *subsetIndex, dods_byte *b) const +{ + unsigned long currentIndex; + + for(unsigned long i=0; isize() ;++i){ + currentIndex = (*subsetIndex)[i] ; + if(currentIndex> (unsigned int)length()){ + stringstream s; + s << "Vector::value() - Subset index[" << i << "] = " << currentIndex << " references a value that is " << + "outside the bounds of the internal storage [ length()= " << length() << " ] name: '" << name() << "'. "; + throw Error(s.str()); + } + b[i] = reinterpret_cast(_buf )[currentIndex]; // I like this version - and it works! + } +} + + +/** @brief Get a copy of the data held by this variable using the passed subsetIndex vector to identify which values to return. **/ +void Vector::value(vector *subsetIndex, dods_uint16 *b) const +{ + unsigned long currentIndex; + + for(unsigned long i=0; isize() ;++i){ + currentIndex = (*subsetIndex)[i] ; + if(currentIndex> (unsigned int)length()){ + stringstream s; + s << "Vector::value() - Subset index[" << i << "] = " << currentIndex << " references a value that is " << + "outside the bounds of the internal storage [ length()= " << length() << " ] name: '" << name() << "'. "; + throw Error(s.str()); + } + b[i] = reinterpret_cast(_buf )[currentIndex]; // I like this version - and it works! + } +} + + +/** @brief Get a copy of the data held by this variable using the passed subsetIndex vector to identify which values to return. **/ +void Vector::value(vector *subsetIndex, dods_int16 *b) const +{ + unsigned long currentIndex; + + for(unsigned long i=0; isize() ;++i){ + currentIndex = (*subsetIndex)[i] ; + if(currentIndex> (unsigned int)length()){ + stringstream s; + s << "Vector::value() - Subset index[" << i << "] = " << currentIndex << " references a value that is " << + "outside the bounds of the internal storage [ length()= " << length() << " ] name: '" << name() << "'. "; + throw Error(s.str()); + } + b[i] = reinterpret_cast(_buf )[currentIndex]; // I like this version - and it works! + } +} + +/** @brief Get a copy of the data held by this variable using the passed subsetIndex vector to identify which values to return. **/ +void Vector::value(vector *subsetIndex, dods_uint32 *b) const +{ + unsigned long currentIndex; + + for(unsigned long i=0; isize() ;++i){ + currentIndex = (*subsetIndex)[i] ; + if(currentIndex> (unsigned int)length()){ + stringstream s; + s << "Vector::value() - Subset index[" << i << "] = " << currentIndex << " references a value that is " << + "outside the bounds of the internal storage [ length()= " << length() << " ] name: '" << name() << "'. "; + throw Error(s.str()); + } + b[i] = reinterpret_cast(_buf )[currentIndex]; // I like this version - and it works! + } +} + +/** @brief Get a copy of the data held by this variable using the passed subsetIndex vector to identify which values to return. **/ +void Vector::value(vector *subsetIndex, dods_int32 *b) const +{ + unsigned long currentIndex; + + for(unsigned long i=0; isize() ;++i){ + currentIndex = (*subsetIndex)[i] ; + if(currentIndex> (unsigned int)length()){ + stringstream s; + s << "Vector::value() - Subset index[" << i << "] = " << currentIndex << " references a value that is " << + "outside the bounds of the internal storage [ length()= " << length() << " ] name: '" << name() << "'. "; + throw Error(s.str()); + } + b[i] = reinterpret_cast(_buf )[currentIndex]; // I like this version - and it works! + } +} + +/** @brief Get a copy of the data held by this variable using the passed subsetIndex vector to identify which values to return. **/ +void Vector::value(vector *subsetIndex, dods_float32 *b) const +{ + unsigned long currentIndex; + + for(unsigned long i=0; isize() ;++i){ + currentIndex = (*subsetIndex)[i] ; + //cerr << "currentIndex: " << currentIndex << endl; + if(currentIndex> (unsigned int)length()){ + stringstream s; + s << "Vector::value() - Subset index[" << i << "] = " << currentIndex << " references a value that is " << + "outside the bounds of the internal storage [ length()= " << length() << " ] name: '" << name() << "'. "; + throw Error(s.str()); + } + // b[i] = *reinterpret_cast(_buf ) + currentIndex; // BROKEN + // b[i] = *(reinterpret_cast(_buf ) + currentIndex); // Works but I like other forms + // b[i] = ((dods_float32*)_buf )[currentIndex]; // Works but isn't as 'safe' + + b[i] = reinterpret_cast(_buf )[currentIndex]; // I like this version - and it works! + + //cerr << "b[" << i << "]=" << b[i] << endl; + } +} + +/** @brief Get a copy of the data held by this variable using the passed subsetIndex vector to identify which values to return. **/ +void Vector::value(vector *subsetIndex, dods_float64 *b) const +{ + unsigned long currentIndex; + + for(unsigned long i=0; isize() ;++i){ + currentIndex = (*subsetIndex)[i] ; + if(currentIndex> (unsigned int)length()){ + stringstream s; + s << "Vector::value() - Subset index[" << i << "] = " << currentIndex << " references a value that is " << + "outside the bounds of the internal storage [ length()= " << length() << " ] name: '" << name() << "'. "; + throw Error(s.str()); + } + b[i] = reinterpret_cast(_buf )[currentIndex]; // I like this version - and it works! + } +} + + +/** @brief Get a copy of the data held by this variable using the passed subsetIndex vector to identify which values to return. **/ +void Vector::value(vector *subsetIndex, vector &b) const +{ + unsigned long currentIndex; + + if (_var->type() == dods_str_c || _var->type() == dods_url_c){ + for(unsigned long i=0; isize() ;++i){ + currentIndex = (*subsetIndex)[i] ; + if(currentIndex > (unsigned int)length()){ + stringstream s; + s << "Vector::value() - Subset index[" << i << "] = " << currentIndex << " references a value that is " << + "outside the bounds of the internal storage [ length()= " << length() << " ] name: '" << name() << "'. "; + throw Error(s.str()); + } + b[i] = d_str[currentIndex]; + } + } +} + + + + + + + /** @brief Get a copy of the data held by this variable. - Read data from this variable's internal storage and load it into the - memory referenced by \c b. The argument \c b must point to enough memory - to hold length() Bytes. + Read data from this variable's internal storage and load it into the + memory referenced by \c b. The argument \c b must point to enough memory + to hold length() Bytes. - @param b A pointer to the memory to hold the data; must be at least - length() * sizeof(dods_byte) in size.*/ + @param b A pointer to the memory to hold the data; must be at least + length() * sizeof(dods_byte) in size.*/ void Vector::value(dods_byte *b) const { if (b && _var->type() == dods_byte_c) { @@ -1512,41 +1625,47 @@ /** @brief Get a copy of the data held by this variable. */ void Vector::value(vector &b) const { - if (_var->type() == dods_byte_c || _var->type() == dods_url_c) + if (_var->type() == dods_str_c || _var->type() == dods_url_c) b = d_str; } /** Allocated memory and copy data into the new buffer. Return the new - buffer's pointer. The caller must delete the storage. */ + buffer's pointer. The caller must delete the storage. */ void *Vector::value() { - void *buffer = new char[width()]; + void *buffer = new char[width(true)]; - memcpy(buffer, _buf, width()); + memcpy(buffer, _buf, width(true)); return buffer; } //@} /** @brief Add the BaseType pointer to this constructor type - instance. + instance. + + Propagate the name of the BaseType instance to this instance. This + ensures that variables at any given level of the DDS table have + unique names (i.e., that Arrays do not have their default name ""). If + v's name is null, then assume that the array \e is named and + don't overwrite it with v's null name. + + @note As is the case with Array, this method can be called with a null + BaseType pointer. - Propagate the name of the BaseType instance to this instance. This - ensures that variables at any given level of the DDS table have - unique names (i.e., that Arrays do not have their default name ""). If - v's name is null, then assume that the array \e is named and - don't overwrite it with v's null name. - - @param v The template variable for the array - @param p The Part parameter defaults to nil and is ignored by this method. -*/ + @param v The template variable for the array + @param p The Part parameter defaults to nil and is ignored by this method. + */ void Vector::add_var(BaseType * v, Part) { +#if 0 + if (v && v->is_dap4_only_type()) + throw InternalErr(__FILE__, __LINE__, "Attempt to add a DAP4 type to a DAP2 Vector."); +#endif // Delete the current template variable - if( _var ) - { - delete _var; - _var = 0 ; + if (_var) { + delete _var; + _var = 0; } // if 'v' is null, just set _var to null and exit. @@ -1570,10 +1689,77 @@ _var->set_parent(this); // Vector --> child DBG(cerr << "Vector::add_var: Added variable " << v << " (" - << v->name() << " " << v->type_name() << ")" << endl); + << v->name() << " " << v->type_name() << ")" << endl); + } +} + +void Vector::add_var_nocopy(BaseType * v, Part) +{ +#if 0 + if (v && v->is_dap4_only_type()) + throw InternalErr(__FILE__, __LINE__, "Attempt to add a DAP4 type to a DAP2 Vector."); +#endif + // Delete the current template variable + if (_var) { + delete _var; + _var = 0; + } + + // if 'v' is null, just set _var to null and exit. + if (!v) { + _var = 0; + } + else { + _var = v; + + // If 'v' has a name, use it as the name of the array. If it *is* + // empty, then make sure to copy the array's name to the template + // so that software which uses the template's name will still work. + if (!v->name().empty()) + set_name(v->name()); + else + _var->set_name(name()); + + _var->set_parent(this); // Vector --> child + + DBG(cerr << "Vector::add_var: Added variable " << v << " (" + << v->name() << " " << v->type_name() << ")" << endl); } } +#if 0 +// branch version +void Vector::add_var_nocopy(BaseType * v, Part) +{ + // Delete the current template variable + if (_var) { + delete _var; + _var = 0; + } + + // if 'v' is null, just set _var to null and exit. + if (!v) { + _var = 0; + } + else { + _var = v; + + // If 'v' has a name, use it as the name of the array. If it *is* + // empty, then make sure to copy the array's name to the template + // so that software which uses the template's name will still work. + if (!v->name().empty()) + set_name(v->name()); + else + _var->set_name(name()); + + _var->set_parent(this); // Vector --> child + + DBG(cerr << "Vector::add_var: Added variable " << v << " (" + << v->name() << " " << v->type_name() << ")" << endl); + } +} +#endif + bool Vector::check_semantics(string & msg, bool) { return BaseType::check_semantics(msg); @@ -1587,61 +1773,54 @@ * @param strm C++ i/o stream to dump the information to * @return void */ -void -Vector::dump(ostream &strm) const +void Vector::dump(ostream &strm) const { - strm << DapIndent::LMarg << "Vector::dump - (" - << (void *)this << ")" << endl ; - DapIndent::Indent() ; - BaseType::dump(strm) ; - strm << DapIndent::LMarg << "# elements in vector: " << _length << endl ; + strm << DapIndent::LMarg << "Vector::dump - (" << (void *) this << ")" << endl; + DapIndent::Indent(); + BaseType::dump(strm); + strm << DapIndent::LMarg << "# elements in vector: " << d_length << endl; if (_var) { - strm << DapIndent::LMarg << "base type:" << endl ; - DapIndent::Indent() ; - _var->dump(strm) ; - DapIndent::UnIndent() ; + strm << DapIndent::LMarg << "base type:" << endl; + DapIndent::Indent(); + _var->dump(strm); + DapIndent::UnIndent(); } else { - strm << DapIndent::LMarg << "base type: not set" << endl ; + strm << DapIndent::LMarg << "base type: not set" << endl; } - strm << DapIndent::LMarg << "vector contents:" << endl ; - DapIndent::Indent() ; + strm << DapIndent::LMarg << "vector contents:" << endl; + DapIndent::Indent(); for (unsigned i = 0; i < _vec.size(); ++i) { if (_vec[i]) - _vec[i]->dump(strm) ; + _vec[i]->dump(strm); else - strm << DapIndent::LMarg << "vec[" << i << "] is null" << endl ; + strm << DapIndent::LMarg << "vec[" << i << "] is null" << endl; } - DapIndent::UnIndent() ; - strm << DapIndent::LMarg << "strings:" << endl ; - DapIndent::Indent() ; + DapIndent::UnIndent(); + strm << DapIndent::LMarg << "strings:" << endl; + DapIndent::Indent(); for (unsigned i = 0; i < d_str.size(); i++) { - strm << DapIndent::LMarg << d_str[i] << endl ; + strm << DapIndent::LMarg << d_str[i] << endl; } - DapIndent::UnIndent() ; - if( _buf ) - { - switch( _var->type() ) - { - case dods_byte_c: - { - strm << DapIndent::LMarg << "_buf: " ; - strm.write( _buf, _length ) ; - strm << endl ; - } - break ; - default: - { - strm << DapIndent::LMarg << "_buf: " << (void *)_buf << endl ; - } - break ; - } + DapIndent::UnIndent(); + if (_buf) { + switch (_var->type()) { + case dods_byte_c: { + strm << DapIndent::LMarg << "_buf: "; + strm.write(_buf, d_length); + strm << endl; + } + break; + default: { + strm << DapIndent::LMarg << "_buf: " << (void *) _buf << endl; + } + break; + } } - else - { - strm << DapIndent::LMarg << "_buf: EMPTY" << endl ; + else { + strm << DapIndent::LMarg << "_buf: EMPTY" << endl; } - DapIndent::UnIndent() ; + DapIndent::UnIndent(); } } // namespace libdap diff -Nru libdap-3.11.1/Vector.h libdap-3.12.0/Vector.h --- libdap-3.11.1/Vector.h 2011-04-29 13:19:43.000000000 +0000 +++ libdap-3.12.0/Vector.h 2013-10-17 21:27:40.000000000 +0000 @@ -19,7 +19,7 @@ // // You should have received a copy of the GNU Lesser General Public // License along with this library; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA // // You can contact OPeNDAP, Inc. at PO Box 112, Saunderstown, RI. 02874-0112. @@ -78,7 +78,7 @@ class Vector: public BaseType { private: - int _length; // number of elements in the vector + int d_length; // number of elements in the vector BaseType *_var; // base type of the Vector // _buf was a pointer to void; delete[] complained. 6/4/2001 jhrg @@ -87,7 +87,7 @@ vector _vec; // array for other data // the number of elements we have allocated memory to store. - // This should be either the sizeof(buf)/width() for cardinal data + // This should be either the sizeof(buf)/width(bool constrained = false) for cardinal data // or the capacity of d_str for strings or capacity of _vec. unsigned int _capacity; @@ -95,9 +95,9 @@ // This function copies the private members of Vector. void _duplicate(const Vector &v); - bool is_cardinal_type() const; - unsigned int create_cardinal_data_buffer_for_type(unsigned int numEltsOfType); - void delete_cardinal_data_buffer(); + bool m_is_cardinal_type() const; + unsigned int m_create_cardinal_data_buffer_for_type(unsigned int numEltsOfType); + void m_delete_cardinal_data_buffer(); template void set_cardinal_values_internal(const CardType* fromArray, int numElts); @@ -111,6 +111,8 @@ Vector &operator=(const Vector &rhs); virtual BaseType *ptr_duplicate() = 0; + virtual bool is_dap2_only_type(); + virtual void set_name(const std::string& name); virtual int element_count(bool leaves); @@ -119,7 +121,7 @@ virtual void set_read_p(bool state); - virtual unsigned int width(); + virtual unsigned int width(bool constrained = false); virtual int length() const; @@ -172,6 +174,15 @@ virtual void value(dods_float64 *b) const; virtual void value(vector &b) const; + void value(vector *index, dods_byte *b) const; + void value(vector *index, dods_int16 *b) const; + void value(vector *index, dods_uint16 *b) const; + void value(vector *index, dods_int32 *b) const; + void value(vector *index, dods_uint32 *b) const; + void value(vector *index, dods_float32 *b) const; + void value(vector *index, dods_float64 *b) const; + void value(vector *index, vector &b) const; + virtual void *value(); virtual BaseType *var(const string &name = "", bool exact_match = true, @@ -180,6 +191,8 @@ virtual BaseType *var(unsigned int i); virtual void add_var(BaseType *v, Part p = nil); + virtual void add_var_nocopy(BaseType *v, Part p = nil); + virtual bool check_semantics(string &msg, bool all = false); virtual void dump(ostream &strm) const ; diff -Nru libdap-3.11.1/XDRFileMarshaller.cc libdap-3.12.0/XDRFileMarshaller.cc --- libdap-3.11.1/XDRFileMarshaller.cc 2011-04-29 13:19:43.000000000 +0000 +++ libdap-3.12.0/XDRFileMarshaller.cc 2013-10-17 21:27:40.000000000 +0000 @@ -20,7 +20,7 @@ // // You should have received a copy of the GNU Lesser General Public // License along with this library; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA // // You can contact OPeNDAP, Inc. at PO Box 112, Saunderstown, RI. 02874-0112. diff -Nru libdap-3.11.1/XDRFileMarshaller.h libdap-3.12.0/XDRFileMarshaller.h --- libdap-3.11.1/XDRFileMarshaller.h 2011-04-29 13:19:43.000000000 +0000 +++ libdap-3.12.0/XDRFileMarshaller.h 2013-10-17 21:27:40.000000000 +0000 @@ -20,7 +20,7 @@ // // You should have received a copy of the GNU Lesser General Public // License along with this library; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA // // You can contact OPeNDAP, Inc. at PO Box 112, Saunderstown, RI. 02874-0112. diff -Nru libdap-3.11.1/XDRFileUnMarshaller.cc libdap-3.12.0/XDRFileUnMarshaller.cc --- libdap-3.11.1/XDRFileUnMarshaller.cc 2011-04-29 13:19:43.000000000 +0000 +++ libdap-3.12.0/XDRFileUnMarshaller.cc 2013-10-17 21:27:40.000000000 +0000 @@ -20,7 +20,7 @@ // // You should have received a copy of the GNU Lesser General Public // License along with this library; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA // // You can contact OPeNDAP, Inc. at PO Box 112, Saunderstown, RI. 02874-0112. @@ -60,15 +60,13 @@ } XDRFileUnMarshaller::XDRFileUnMarshaller() - : UnMarshaller(), - _source( 0 ) + : UnMarshaller(), _source( 0 ) { throw InternalErr( __FILE__, __LINE__, "Default constructor not implemented." ) ; } XDRFileUnMarshaller::XDRFileUnMarshaller( const XDRFileUnMarshaller &um ) - : UnMarshaller( um ), - _source( 0 ) + : UnMarshaller( um ), _source( 0 ) { throw InternalErr( __FILE__, __LINE__, "Copy constructor not implemented." ) ; } @@ -83,6 +81,10 @@ XDRFileUnMarshaller::~XDRFileUnMarshaller( ) { + // Some static code analysis tools complain that delete_xdrstdio + // does not close the FILE* it holds, but that's not true with + // modern XDR libraries. Don't try to close that FILE*. jhrg 8/27/13 + delete_xdrstdio( _source ) ; } diff -Nru libdap-3.11.1/XDRFileUnMarshaller.h libdap-3.12.0/XDRFileUnMarshaller.h --- libdap-3.11.1/XDRFileUnMarshaller.h 2011-04-29 13:19:43.000000000 +0000 +++ libdap-3.12.0/XDRFileUnMarshaller.h 2013-10-17 21:27:40.000000000 +0000 @@ -20,7 +20,7 @@ // // You should have received a copy of the GNU Lesser General Public // License along with this library; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA // // You can contact OPeNDAP, Inc. at PO Box 112, Saunderstown, RI. 02874-0112. @@ -46,6 +46,7 @@ { private: XDR * _source ; + XDRFileUnMarshaller() ; XDRFileUnMarshaller( const XDRFileUnMarshaller &um ) ; XDRFileUnMarshaller & operator=( const XDRFileUnMarshaller & ) ; diff -Nru libdap-3.11.1/XDRStreamMarshaller.cc libdap-3.12.0/XDRStreamMarshaller.cc --- libdap-3.11.1/XDRStreamMarshaller.cc 2011-04-29 13:19:43.000000000 +0000 +++ libdap-3.12.0/XDRStreamMarshaller.cc 2013-10-17 21:27:40.000000000 +0000 @@ -20,7 +20,7 @@ // // You should have received a copy of the GNU Lesser General Public // License along with this library; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA // // You can contact OPeNDAP, Inc. at PO Box 112, Saunderstown, RI. 02874-0112. @@ -32,6 +32,12 @@ #include "XDRStreamMarshaller.h" +#include +#include +#include + +using namespace std; + //#define DODS_DEBUG 1 #include "Vector.h" @@ -40,361 +46,489 @@ namespace libdap { -char *XDRStreamMarshaller::_buf = 0 ; +char *XDRStreamMarshaller::d_buf = 0; #define XDR_DAP_BUFF_SIZE 256 -XDRStreamMarshaller::XDRStreamMarshaller( ostream &out ) - : _sink( 0 ), - _out( out ) -{ - if( !_buf ) - _buf = (char *)malloc( XDR_DAP_BUFF_SIZE ) ; - if ( !_buf ) +/** Build an instance of XDRStreamMarshaller. Bind the C++ stream out to this + * instance. If the checksum parameter is true, initialize a checksum buffer + * and enable the use of the reset_checksum() and get_checksum() methods. + * + * @param out Write to this stream object. + * @param checksum If true, compute checksums. False by default + * @param write_data If true, write data values. True by default + */ +XDRStreamMarshaller::XDRStreamMarshaller(ostream &out) : // , bool checksum, bool write_data) : + /*&d_sink(0),*/ d_out(out)//, _MD_CTX(0), _write_data(write_data), _checksum_ctx_valid(false) +{ + if (!d_buf) + d_buf = (char *) malloc(XDR_DAP_BUFF_SIZE); + if (!d_buf) throw Error("Failed to allocate memory for data serialization."); - _sink = new XDR ; - xdrmem_create( _sink, _buf, XDR_DAP_BUFF_SIZE, XDR_ENCODE ) ; + //&d_sink = new XDR; + xdrmem_create( &d_sink, d_buf, XDR_DAP_BUFF_SIZE, XDR_ENCODE); + +#if CHECKSUMS + if (checksum) { + _MD_CTX = EVP_MD_CTX_create(); + } +#endif } -XDRStreamMarshaller::XDRStreamMarshaller() - : Marshaller(), - _sink( 0 ), - _out( cout ) +XDRStreamMarshaller::XDRStreamMarshaller() : + Marshaller(), /*&d_sink(0),*/ d_out(cout) { - throw InternalErr( __FILE__, __LINE__, "Default constructor not implemented." ) ; + throw InternalErr(__FILE__, __LINE__, "Default constructor not implemented."); } -XDRStreamMarshaller::XDRStreamMarshaller( const XDRStreamMarshaller &m ) - : Marshaller( m ), - _sink( 0 ), - _out( cout ) +XDRStreamMarshaller::XDRStreamMarshaller(const XDRStreamMarshaller &m) : + Marshaller(m), /*&d_sink(0),*/ d_out(cout) { - throw InternalErr( __FILE__, __LINE__, "Copy constructor not implemented." ) ; + throw InternalErr(__FILE__, __LINE__, "Copy constructor not implemented."); } XDRStreamMarshaller & -XDRStreamMarshaller::operator=( const XDRStreamMarshaller & ) +XDRStreamMarshaller::operator=(const XDRStreamMarshaller &) { - throw InternalErr( __FILE__, __LINE__, "Copy operator not implemented." ) ; + throw InternalErr(__FILE__, __LINE__, "Copy operator not implemented."); - return *this ; + return *this; } -XDRStreamMarshaller::~XDRStreamMarshaller( ) +XDRStreamMarshaller::~XDRStreamMarshaller() { - if( _sink ) - delete_xdrstdio( _sink ) ; - _sink = 0 ; + xdr_destroy(&d_sink); //delete_xdrstdio(&d_sink); + //delete(&d_sink); + //&d_sink = 0; + +#if CHECKSUMS + if (_MD_CTX) + EVP_MD_CTX_destroy(_MD_CTX); +#endif } -void -XDRStreamMarshaller::put_byte( dods_byte val ) +#if 0 +/** Initialize the checksum buffer. This resets the checksum calculation. + * @exception InternalErr if called when the object was created without + * checksum support. + */ +void XDRStreamMarshaller::reset_checksum() +{ +#if CHECKSUMS + if (_MD_CTX == 0) + throw InternalErr( __FILE__, __LINE__, "reset_checksum() called by checksum is not enabled."); + + if (EVP_DigestInit_ex(_MD_CTX, EVP_sha1(), 0) == 0) + throw Error("Failed to initialize checksum object."); + + _checksum_ctx_valid = true; +#endif +} + +/** Get the current checksum. It is not possible to continue computing the + * checksum once this has been called. + * @exception InternalErr if called when the object was created without + * checksum support or if called when the checksum has already been returned. + */ +string XDRStreamMarshaller::get_checksum() +{ +#if CHECKSUMS + if (_MD_CTX == 0) + throw InternalErr(__FILE__, __LINE__, "checksum_init() called by checksum is not enabled."); + + if (_checksum_ctx_valid) { + // '...Final()' 'erases' the context so the next call without a reset + // returns a bogus value. + _checksum_ctx_valid = false; + + vector md(EVP_MAX_MD_SIZE); + unsigned int md_len; + if (EVP_DigestFinal_ex(_MD_CTX, &md[0], &md_len) == 0) + throw Error("Error computing the checksum (checksum computation)."); + + ostringstream oss; + oss.setf(ios::hex, ios::basefield); + for (unsigned int i = 0; i < md_len; ++i) { + oss << setfill('0') << setw(2) << (unsigned int) md[i]; + } + + _checksum = oss.str(); + } + + return _checksum; +#else + return ""; +#endif +} + +void XDRStreamMarshaller::checksum_update(const void *data, unsigned long len) +{ +#if CHECKSUMS + if (_MD_CTX == 0) + throw InternalErr( __FILE__, __LINE__, "checksum_init() called by checksum is not enabled."); + + if (!_checksum_ctx_valid) + throw InternalErr( __FILE__, __LINE__, "Invalid checksum context (checksum update)."); + + if (EVP_DigestUpdate(_MD_CTX, data, len) == 0) { + _checksum_ctx_valid = false; + throw Error("Error computing the checksum (checksum update)."); + } +#endif +} +#endif + +void XDRStreamMarshaller::put_byte(dods_byte val) { +#if CHECKSUM + if (_MD_CTX) + checksum_update(&val, sizeof(dods_byte)); +#endif +// if (_write_data) { DBG( std::cerr << "put_byte: " << val << std::endl ); - if( !xdr_setpos( _sink, 0 ) ) + + if (!xdr_setpos( &d_sink, 0 )) throw Error("Network I/O Error. Could not send byte data - unable to set stream position.\nThis may be due to a bug in DODS, on the server or a\nproblem with the network connection."); - if( !xdr_char( _sink, (char *)&val ) ) + if (!xdr_char(&d_sink, (char *) &val)) throw Error("Network I/O Error. Could not send byte data.\nThis may be due to a bug in DODS, on the server or a\nproblem with the network connection."); - unsigned int bytes_written = xdr_getpos( _sink ) ; - if( !bytes_written ) + unsigned int bytes_written = xdr_getpos( &d_sink ); + if (!bytes_written) throw Error("Network I/O Error. Could not send byte data - unable to get stream position.\nThis may be due to a bug in DODS, on the server or a\nproblem with the network connection."); - _out.write( _buf, bytes_written ) ; + d_out.write(d_buf, bytes_written); +// } } -void -XDRStreamMarshaller::put_int16( dods_int16 val ) +void XDRStreamMarshaller::put_int16(dods_int16 val) { - if( !xdr_setpos( _sink, 0 ) ) +#if 0 + if (_MD_CTX) + checksum_update(&val, sizeof(dods_int16)); +#endif +// if (_write_data) { + if (!xdr_setpos( &d_sink, 0 )) throw Error("Network I/O Error. Could not send int 16 data - unable to set stream position.\nThis may be due to a bug in DODS, on the server or a\nproblem with the network connection."); - if( !XDR_INT16( _sink, &val ) ) + if (!XDR_INT16(&d_sink, &val)) throw Error("Network I/O Error. Could not send int 16 data.\nThis may be due to a bug in libdap, on the server or a\nproblem with the network connection."); - unsigned int bytes_written = xdr_getpos( _sink ) ; - if( !bytes_written ) + unsigned int bytes_written = xdr_getpos( &d_sink ); + if (!bytes_written) throw Error("Network I/O Error. Could not send int 16 data - unable to get stream position.\nThis may be due to a bug in DODS, on the server or a\nproblem with the network connection."); - _out.write( _buf, bytes_written ) ; + d_out.write(d_buf, bytes_written); +// } } -void -XDRStreamMarshaller::put_int32( dods_int32 val ) +void XDRStreamMarshaller::put_int32(dods_int32 val) { - if( !xdr_setpos( _sink, 0 ) ) +#if 0 + if (_MD_CTX) + checksum_update(&val, sizeof(dods_int32)); +#endif +// if (_write_data) { + if (!xdr_setpos( &d_sink, 0 )) throw Error("Network I/O Error. Could not send int 32 data - unable to set stream position.\nThis may be due to a bug in DODS, on the server or a\nproblem with the network connection."); - if( !XDR_INT32( _sink, &val ) ) + if (!XDR_INT32(&d_sink, &val)) throw Error("Network I/O Error. Culd not read int 32 data.\nThis may be due to a bug in libdap, on the server or a\nproblem with the network connection."); - unsigned int bytes_written = xdr_getpos( _sink ) ; - if( !bytes_written ) + unsigned int bytes_written = xdr_getpos( &d_sink ); + if (!bytes_written) throw Error("Network I/O Error. Could not send int 32 data - unable to get stream position.\nThis may be due to a bug in DODS, on the server or a\nproblem with the network connection."); - _out.write( _buf, bytes_written ) ; + d_out.write(d_buf, bytes_written); +// } } -void -XDRStreamMarshaller::put_float32( dods_float32 val ) +void XDRStreamMarshaller::put_float32(dods_float32 val) { - if( !xdr_setpos( _sink, 0 ) ) +#if 0 + if (_MD_CTX) + checksum_update(&val, sizeof(dods_float32)); +#endif +// if (_write_data) { + if (!xdr_setpos( &d_sink, 0 )) throw Error("Network I/O Error. Could not send float 32 data - unable to set stream position.\nThis may be due to a bug in DODS, on the server or a\nproblem with the network connection."); - if( !xdr_float( _sink, &val ) ) + if (!xdr_float(&d_sink, &val)) throw Error("Network I/O Error. Could not send float 32 data.\nThis may be due to a bug in libdap, on the server or a\nproblem with the network connection."); - unsigned int bytes_written = xdr_getpos( _sink ) ; - if( !bytes_written ) + unsigned int bytes_written = xdr_getpos( &d_sink ); + if (!bytes_written) throw Error("Network I/O Error. Could not send float 32 data - unable to get stream position.\nThis may be due to a bug in DODS, on the server or a\nproblem with the network connection."); - _out.write( _buf, bytes_written ) ; + d_out.write(d_buf, bytes_written); +// } } -void -XDRStreamMarshaller::put_float64( dods_float64 val ) +void XDRStreamMarshaller::put_float64(dods_float64 val) { - if( !xdr_setpos( _sink, 0 ) ) +#if 0 + if (_MD_CTX) + checksum_update(&val, sizeof(dods_float64)); +#endif +// if (_write_data) { + if (!xdr_setpos( &d_sink, 0 )) throw Error("Network I/O Error. Could not send float 64 data - unable to set stream position.\nThis may be due to a bug in DODS, on the server or a\nproblem with the network connection."); - if( !xdr_double( _sink, &val ) ) + if (!xdr_double(&d_sink, &val)) throw Error("Network I/O Error. Could not send float 64 data.\nThis may be due to a bug in libdap, on the server or a\nproblem with the network connection."); - unsigned int bytes_written = xdr_getpos( _sink ) ; - if( !bytes_written ) + unsigned int bytes_written = xdr_getpos( &d_sink ); + if (!bytes_written) throw Error("Network I/O Error. Could not send float 64 data - unable to get stream position.\nThis may be due to a bug in DODS, on the server or a\nproblem with the network connection."); - _out.write( _buf, bytes_written ) ; + d_out.write(d_buf, bytes_written); +// } } -void -XDRStreamMarshaller::put_uint16( dods_uint16 val ) +void XDRStreamMarshaller::put_uint16(dods_uint16 val) { - if( !xdr_setpos( _sink, 0 ) ) +#if 0 + if (_MD_CTX) + checksum_update(&val, sizeof(dods_uint16)); +#endif +// if (_write_data) { + if (!xdr_setpos( &d_sink, 0 )) throw Error("Network I/O Error. Could not send uint 16 data - unable to set stream position.\nThis may be due to a bug in DODS, on the server or a\nproblem with the network connection."); - if( !XDR_UINT16( _sink, &val ) ) + if (!XDR_UINT16(&d_sink, &val)) throw Error("Network I/O Error. Could not send uint 16 data. This may be due to a\nbug in libdap or a problem with the network connection."); - unsigned int bytes_written = xdr_getpos( _sink ) ; - if( !bytes_written ) + unsigned int bytes_written = xdr_getpos( &d_sink ); + if (!bytes_written) throw Error("Network I/O Error. Could not send uint 16 data - unable to get stream position.\nThis may be due to a bug in DODS, on the server or a\nproblem with the network connection."); - _out.write( _buf, bytes_written ) ; + d_out.write(d_buf, bytes_written); +// } } -void -XDRStreamMarshaller::put_uint32( dods_uint32 val ) +void XDRStreamMarshaller::put_uint32(dods_uint32 val) { - if( !xdr_setpos( _sink, 0 ) ) +#if 0 + if (_MD_CTX) + checksum_update(&val, sizeof(dods_uint32)); +#endif +// if (_write_data) { + if (!xdr_setpos( &d_sink, 0 )) throw Error("Network I/O Error. Could not send uint 32 data - unable to set stream position.\nThis may be due to a bug in DODS, on the server or a\nproblem with the network connection."); - if( !XDR_UINT32( _sink, &val ) ) + if (!XDR_UINT32(&d_sink, &val)) throw Error("Network I/O Error. Could not send uint 32 data. This may be due to a\nbug in libdap or a problem with the network connection."); - unsigned int bytes_written = xdr_getpos( _sink ) ; - if( !bytes_written ) + unsigned int bytes_written = xdr_getpos( &d_sink ); + if (!bytes_written) throw Error("Network I/O Error. Could not send uint 32 data - unable to get stream position.\nThis may be due to a bug in DODS, on the server or a\nproblem with the network connection."); - _out.write( _buf, bytes_written ) ; + d_out.write(d_buf, bytes_written); +// } } -void -XDRStreamMarshaller::put_str( const string &val ) +void XDRStreamMarshaller::put_str(const string &val) { - int size = val.length() + 8 ; - char *str_buf = (char *)malloc( size ) ; +#if 0 + if (_MD_CTX) + checksum_update(val.c_str(), val.length()); +#endif + int size = val.length() + 8; +#if 0 + char *str_buf = (char *) malloc(size); - if ( !str_buf ) { - throw Error("Failed to allocate memory for string data serialization."); - } + if (!str_buf) { + throw Error("Failed to allocate memory for string data serialization."); + } +#endif - XDR *str_sink = new XDR ; - xdrmem_create( str_sink, str_buf, size, XDR_ENCODE ) ; + XDR str_sink; + vector str_buf(size); + //XDR *str_sink = new XDR; + try { + xdrmem_create(&str_sink, &str_buf[0], size, XDR_ENCODE); - if( !xdr_setpos( str_sink, 0 ) ) { - delete_xdrstdio( str_sink ) ; - free( str_buf ) ; - throw Error("Network I/O Error. Could not send string data - unable to set stream position.\nThis may be due to a bug in DODS, on the server or a\nproblem with the network connection."); - } + if (!xdr_setpos( &str_sink, 0 )) + throw Error( + "Network I/O Error. Could not send string data - unable to set stream position.\nThis may be due to a bug in DODS, on the server or a\nproblem with the network connection."); - const char *out_tmp = val.c_str() ; - if( !xdr_string( str_sink, (char **)&out_tmp, size ) ) { - delete_xdrstdio( str_sink ) ; - free( str_buf ) ; - throw Error("Network I/O Error. Could not send string data.\nThis may be due to a bug in libdap, on the server or a\nproblem with the network connection."); - } + const char *out_tmp = val.c_str(); + if (!xdr_string(&str_sink, (char **) &out_tmp, size)) + throw Error( + "Network I/O Error. Could not send string data.\nThis may be due to a bug in libdap, on the server or a\nproblem with the network connection."); - unsigned int bytes_written = xdr_getpos( str_sink ) ; - if( !bytes_written ) { - delete_xdrstdio( str_sink ) ; - free( str_buf ) ; - throw Error("Network I/O Error. Could not send string data - unable to get stream position.\nThis may be due to a bug in DODS, on the server or a\nproblem with the network connection."); - } + unsigned int bytes_written = xdr_getpos( &str_sink ); + if (!bytes_written) + throw Error( + "Network I/O Error. Could not send string data - unable to get stream position.\nThis may be due to a bug in DODS, on the server or a\nproblem with the network connection."); - _out.write( str_buf, bytes_written ) ; + d_out.write(&str_buf[0], bytes_written); - delete_xdrstdio( str_sink ) ; - free( str_buf ) ; + xdr_destroy(&str_sink); + } + catch (...) { + xdr_destroy(&str_sink); + throw; + } } -void -XDRStreamMarshaller::put_url( const string &val ) +void XDRStreamMarshaller::put_url(const string &val) { - put_str( val ) ; + put_str(val); } -void -XDRStreamMarshaller::put_opaque( char *val, unsigned int len ) +void XDRStreamMarshaller::put_opaque(char *val, unsigned int len) { - if( len > XDR_DAP_BUFF_SIZE ) +#if 0 + if (_MD_CTX) + checksum_update(&val, len); +#endif +// if (_write_data) { + if (len > XDR_DAP_BUFF_SIZE) throw Error("Network I/O Error. Could not send opaque data - length of opaque data larger than allowed"); - if( !xdr_setpos( _sink, 0 ) ) + if (!xdr_setpos( &d_sink, 0 )) throw Error("Network I/O Error. Could not send opaque data - unable to set stream position.\nThis may be due to a bug in DODS, on the server or a\nproblem with the network connection."); - if( !xdr_opaque( _sink, val, len ) ) + if (!xdr_opaque(&d_sink, val, len)) throw Error("Network I/O Error. Could not send opaque data.\nThis may be due to a bug in libdap, on the server or a\nproblem with the network connection."); - unsigned int bytes_written = xdr_getpos( _sink ) ; - if( !bytes_written ) + unsigned int bytes_written = xdr_getpos( &d_sink ); + if (!bytes_written) throw Error("Network I/O Error. Could not send opaque data - unable to get stream position.\nThis may be due to a bug in DODS, on the server or a\nproblem with the network connection."); - _out.write( _buf, bytes_written ) ; + d_out.write(d_buf, bytes_written); +// } } -void -XDRStreamMarshaller::put_int( int val ) +void XDRStreamMarshaller::put_int( int val ) { - if( !xdr_setpos( _sink, 0 ) ) +#if 0 + if (_MD_CTX) + checksum_update(&val, sizeof(int)); +#endif +// if (_write_data) { + if (!xdr_setpos( &d_sink, 0 )) throw Error("Network I/O Error. Could not send int data - unable to set stream position.\nThis may be due to a bug in DODS, on the server or a\nproblem with the network connection."); - if( !xdr_int( _sink, &val) ) - throw Error("Network I/O Error(1). Could not send int data.\nThis may be due to a bug in libdap or a\nproblem with the network connection."); + if (!xdr_int(&d_sink, &val)) + throw Error("Network I/O Error(1). Could not send int data.\nThis may be due to a bug in libdap or a\nproblem with the network connection."); - unsigned int bytes_written = xdr_getpos( _sink ) ; - if( !bytes_written ) + unsigned int bytes_written = xdr_getpos( &d_sink ); + if (!bytes_written) throw Error("Network I/O Error. Could not send int data - unable to get stream position.\nThis may be due to a bug in DODS, on the server or a\nproblem with the network connection."); - _out.write( _buf, bytes_written ) ; + d_out.write(d_buf, bytes_written); +// } } -void -XDRStreamMarshaller::put_vector( char *val, int num, Vector & ) +void XDRStreamMarshaller::put_vector(char *val, int num, Vector &) { - if (!val) - throw InternalErr(__FILE__, __LINE__, "Could not send byte vector data. Buffer pointer is not set."); - - // write the number of members of the array being written and then set the position to 0 - put_int( num ) ; - - // this is the word boundary for writing xdr bytes in a vector. - unsigned int add_to = 8 ; - - char *byte_buf = (char *)malloc( num + add_to ) ; - if ( !byte_buf ) { - throw Error("Failed to allocate memory for byte vector data serialization."); - } - - XDR *byte_sink = new XDR ; - xdrmem_create( byte_sink, byte_buf, num + add_to, XDR_ENCODE ) ; - - if( !xdr_setpos( byte_sink, 0 ) ) { - delete_xdrstdio( byte_sink ) ; - free(byte_buf); - throw Error("Network I/O Error. Could not send byte vector data - unable to set stream position.\nThis may be due to a bug in DODS, on the server or a\nproblem with the network connection."); - } - - if( !xdr_bytes( byte_sink, (char **)&val, (unsigned int *) &num, - num + add_to ) ) - { - delete_xdrstdio( byte_sink ) ; - free(byte_buf); - throw Error("Network I/O Error(2). Could not send byte vector data.\nThis may be due to a bug in libdap or a\nproblem with the network connection."); - } - - unsigned int bytes_written = xdr_getpos( byte_sink ) ; - if( !bytes_written ) { - delete_xdrstdio( byte_sink ) ; - free(byte_buf); - throw Error("Network I/O Error. Could not send byte vector data - unable to get stream position.\nThis may be due to a bug in DODS, on the server or a\nproblem with the network connection."); - } - - _out.write( byte_buf, bytes_written ) ; - - delete_xdrstdio( byte_sink ) ; - free( byte_buf ) ; + if (!val) throw InternalErr(__FILE__, __LINE__, "Could not send byte vector data. Buffer pointer is not set."); +#if 0 + if (_MD_CTX) + checksum_update(val, num); +#endif + put_int(num); + + // this is the word boundary for writing xdr bytes in a vector. + const unsigned int add_to = 8; +#if 0 + char *byte_buf = (char *) malloc(num + add_to); + if (!byte_buf) throw Error("Failed to allocate memory for byte vector data serialization."); +#endif + vector byte_buf(num + add_to); + XDR byte_sink; + try { + xdrmem_create(&byte_sink, &byte_buf[0], num + add_to, XDR_ENCODE); + if (!xdr_setpos( &byte_sink, 0 )) + throw Error( + "Network I/O Error. Could not send byte vector data - unable to set stream position.\nThis may be due to a bug in DODS, on the server or a\nproblem with the network connection."); + + if (!xdr_bytes(&byte_sink, (char **) &val, (unsigned int *) &num, num + add_to)) + throw Error( + "Network I/O Error(2). Could not send byte vector data.\nThis may be due to a bug in libdap or a\nproblem with the network connection."); + + unsigned int bytes_written = xdr_getpos( &byte_sink ); + if (!bytes_written) + throw Error( + "Network I/O Error. Could not send byte vector data - unable to get stream position.\nThis may be due to a bug in DODS, on the server or a\nproblem with the network connection."); + + d_out.write(&byte_buf[0], bytes_written); + + xdr_destroy(&byte_sink); + } + catch (...) { + xdr_destroy(&byte_sink); + throw; + } } void XDRStreamMarshaller::put_vector( char *val, int num, int width, Vector &vec ) { - if (!val) - throw InternalErr(__FILE__, __LINE__, - "Buffer pointer is not set."); - // write the number of array members being written, then set the position back to 0 - put_int( num ) ; - - int use_width = width ; - if( use_width < 4 ) - use_width = 4 ; - - // the size is the number of elements num times the width of each - // element, then add 4 bytes for the number of elements - int size = ( num * use_width ) + 4 ; - - // allocate enough memory for the elements - char *vec_buf = (char *)malloc( size ) ; - if ( !vec_buf ) { - free(vec_buf); - throw Error("Failed to allocate memory for vector data serialization."); - } - - XDR *vec_sink = new XDR ; - xdrmem_create( vec_sink, vec_buf, size, XDR_ENCODE ) ; - - // set the position of the sink to 0, we're starting at the beginning - if( !xdr_setpos( vec_sink, 0 ) ) { - delete_xdrstdio( vec_sink ) ; - free(vec_buf); - throw Error("Network I/O Error. Could not send vector data - unable to set stream position.\nThis may be due to a bug in DODS, on the server or a\nproblem with the network connection."); - } - - BaseType *var = vec.var() ; - - // write the array to the buffer - if( !xdr_array( vec_sink, (char **)&val, - (unsigned int *) & num, - size, width, - XDRUtils::xdr_coder( var->type() ) ) ) - { - delete_xdrstdio( vec_sink ) ; - free(vec_buf); - throw Error("Network I/O Error(2). Could not send vector data.\nThis may be due to a bug in libdap or a\nproblem with the network connection."); - } - - // how much was written to the buffer - unsigned int bytes_written = xdr_getpos( vec_sink ) ; - if( !bytes_written ) { - delete_xdrstdio( vec_sink ) ; - free(vec_buf); - throw Error("Network I/O Error. Could not send vector data - unable to get stream position.\nThis may be due to a bug in DODS, on the server or a\nproblem with the network connection."); - } + put_vector(val, num, width, vec.var()->type()); +} - // write that much out to the output stream - _out.write( vec_buf, bytes_written ) ; - delete_xdrstdio( vec_sink ) ; - free( vec_buf ) ; +void XDRStreamMarshaller::put_vector(char *val, unsigned int num, int width, Type type) +{ + if (!val) throw InternalErr(__FILE__, __LINE__, "Buffer pointer is not set."); +#if CHECKSUM + if (_MD_CTX) + checksum_update(val, num * width); +#endif + put_int(num); + + int use_width = width; + if (use_width < 4) use_width = 4; + + // the size is the number of elements num times the width of each + // element, then add 4 bytes for the number of elements + int size = (num * use_width) + 4; + + // allocate enough memory for the elements +#if 0 + char *vec_buf = (char *) malloc(size); + if (!vec_buf) + throw Error("Failed to allocate memory for vector data serialization."); +#endif + vector vec_buf(size); + XDR vec_sink; + try { + xdrmem_create(&vec_sink, &vec_buf[0], size, XDR_ENCODE); + + // set the position of the sink to 0, we're starting at the beginning + if (!xdr_setpos( &vec_sink, 0 )) + throw Error( + "Network I/O Error. Could not send vector data - unable to set stream position.\nThis may be due to a bug in DODS, on the server or a\nproblem with the network connection."); + + // write the array to the buffer + if (!xdr_array(&vec_sink, (char **) &val, (unsigned int *) &num, size, width, XDRUtils::xdr_coder(type))) + throw Error( + "Network I/O Error(2). Could not send vector data.\nThis may be due to a bug in libdap or a\nproblem with the network connection."); + + // how much was written to the buffer + unsigned int bytes_written = xdr_getpos( &vec_sink ); + if (!bytes_written) + throw Error( + "Network I/O Error. Could not send vector data - unable to get stream position.\nThis may be due to a bug in DODS, on the server or a\nproblem with the network connection."); + + // write that much out to the output stream + d_out.write(&vec_buf[0], bytes_written); + + xdr_destroy(&vec_sink); + } + catch (...) { + xdr_destroy(&vec_sink); + throw; + } } -void -XDRStreamMarshaller::dump(ostream &strm) const +void XDRStreamMarshaller::dump(ostream &strm) const { - strm << DapIndent::LMarg << "XDRStreamMarshaller::dump - (" - << (void *)this << ")" << endl ; + strm << DapIndent::LMarg << "XDRStreamMarshaller::dump - (" << (void *) this << ")" << endl; } } // namespace libdap diff -Nru libdap-3.11.1/XDRStreamMarshaller.h libdap-3.12.0/XDRStreamMarshaller.h --- libdap-3.11.1/XDRStreamMarshaller.h 2011-04-29 13:19:43.000000000 +0000 +++ libdap-3.12.0/XDRStreamMarshaller.h 2013-10-17 21:27:40.000000000 +0000 @@ -20,7 +20,7 @@ // // You should have received a copy of the GNU Lesser General Public // License along with this library; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA // // You can contact OPeNDAP, Inc. at PO Box 112, Saunderstown, RI. 02874-0112. @@ -35,55 +35,74 @@ #include +// #include + using std::ostream ; using std::cout ; #include "Marshaller.h" #include "XDRUtils.h" +#include "BaseType.h" namespace libdap { /** @brief marshaller that knows how to marshal/serialize dap data objects * to a C++ iostream using XDR + * + * @note This class can now compute checksums for data that will be marshalled. + * jhrg 1/18/2012 */ class XDRStreamMarshaller : public Marshaller { private: - static char * _buf ; - XDR * _sink ; - ostream & _out ; - + static char * d_buf ; + XDR d_sink ; + ostream & d_out ; +#if 0 + EVP_MD_CTX * _MD_CTX; // jhrg 4/24/12 + bool _write_data ; // jhrg 1/27/12 + bool _checksum_ctx_valid ; + string _checksum ; // jhrg 4/24/12 +#endif XDRStreamMarshaller() ; XDRStreamMarshaller( const XDRStreamMarshaller &m ) ; - XDRStreamMarshaller & operator=( const XDRStreamMarshaller & ) ; + XDRStreamMarshaller &operator=( const XDRStreamMarshaller & ) ; + public: - XDRStreamMarshaller( ostream &out ) ; + XDRStreamMarshaller( ostream &out) ; //, bool checksum = false, bool write_data = true) ; virtual ~XDRStreamMarshaller() ; - virtual void put_byte( dods_byte val ) ; +#if 0 + virtual bool checksums() { return _MD_CTX != 0; } + virtual void reset_checksum() ; + virtual string get_checksum() ; + virtual void checksum_update(const void *data, unsigned long len) ; +#endif + + virtual void put_byte( dods_byte val ) ; + + virtual void put_int16( dods_int16 val ) ; + virtual void put_int32( dods_int32 val ) ; - virtual void put_int16( dods_int16 val ) ; - virtual void put_int32( dods_int32 val ) ; + virtual void put_float32( dods_float32 val ) ; + virtual void put_float64( dods_float64 val ) ; - virtual void put_float32( dods_float32 val ) ; - virtual void put_float64( dods_float64 val ) ; + virtual void put_uint16( dods_uint16 val ) ; + virtual void put_uint32( dods_uint32 val ) ; - virtual void put_uint16( dods_uint16 val ) ; - virtual void put_uint32( dods_uint32 val ) ; + virtual void put_str( const string &val ) ; + virtual void put_url( const string &val ) ; - virtual void put_str( const string &val ) ; - virtual void put_url( const string &val ) ; + virtual void put_opaque( char *val, unsigned int len ) ; + virtual void put_int( int val ) ; - virtual void put_opaque( char *val, unsigned int len ) ; - virtual void put_int( int val ) ; + virtual void put_vector( char *val, int num, Vector &vec ) ; + virtual void put_vector( char *val, int num, int width, Vector &vec) ; - virtual void put_vector( char *val, int num, - Vector &vec ) ; - virtual void put_vector( char *val, int num, int width, - Vector &vec ) ; + virtual void put_vector(char *val, unsigned int num, int width, Type type); - virtual void dump(ostream &strm) const ; + virtual void dump(ostream &strm) const ; } ; } // namespace libdap diff -Nru libdap-3.11.1/XDRStreamUnMarshaller.cc libdap-3.12.0/XDRStreamUnMarshaller.cc --- libdap-3.11.1/XDRStreamUnMarshaller.cc 2011-04-29 13:19:43.000000000 +0000 +++ libdap-3.12.0/XDRStreamUnMarshaller.cc 2013-10-17 21:27:40.000000000 +0000 @@ -20,7 +20,7 @@ // // You should have received a copy of the GNU Lesser General Public // License along with this library; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA // // You can contact OPeNDAP, Inc. at PO Box 112, Saunderstown, RI. 02874-0112. @@ -36,11 +36,11 @@ #include #include -#define DODS_DEBUG2 1 -#define DODS_DEBUG 1 +//#define DODS_DEBUG2 1 +//#define DODS_DEBUG 1 #include "Str.h" -#include "Vector.h" +// #include "Vector.h" #include "Array.h" #include "util.h" #include "InternalErr.h" @@ -48,310 +48,292 @@ namespace libdap { -char *XDRStreamUnMarshaller::_buf = 0 ; +char *XDRStreamUnMarshaller::d_buf = 0; -XDRStreamUnMarshaller::XDRStreamUnMarshaller( istream &in ) - : _source( 0 ), _in( in ) +XDRStreamUnMarshaller::XDRStreamUnMarshaller(istream &in) : /*&d_source( 0 ),*/ + d_in(in) { - if (!_buf) - _buf = (char *) malloc(XDR_DAP_BUFF_SIZE); - if (!_buf) - throw Error("Failed to allocate memory for data serialization."); + if (!d_buf) + d_buf = (char *) malloc(XDR_DAP_BUFF_SIZE); + if (!d_buf) + throw Error("Failed to allocate memory for data serialization."); - _source = new XDR; - xdrmem_create(_source, _buf, XDR_DAP_BUFF_SIZE, XDR_DECODE); + //&d_source = new XDR; + xdrmem_create(&d_source, d_buf, XDR_DAP_BUFF_SIZE, XDR_DECODE); } -XDRStreamUnMarshaller::XDRStreamUnMarshaller() - : UnMarshaller(), _source( 0 ), _in( cin ) +XDRStreamUnMarshaller::XDRStreamUnMarshaller() : + UnMarshaller(), /*&d_source( 0 ),*/d_in(cin) { - throw InternalErr( __FILE__, __LINE__, "Default constructor not implemented." ) ; + throw InternalErr(__FILE__, __LINE__, "Default constructor not implemented."); } -XDRStreamUnMarshaller::XDRStreamUnMarshaller( const XDRStreamUnMarshaller &um ) - : UnMarshaller( um ), _source( 0 ), _in( cin ) +XDRStreamUnMarshaller::XDRStreamUnMarshaller(const XDRStreamUnMarshaller &um) : + UnMarshaller(um), /*&d_source( 0 ),*/d_in(cin) { - throw InternalErr( __FILE__, __LINE__, "Copy constructor not implemented." ) ; + throw InternalErr(__FILE__, __LINE__, "Copy constructor not implemented."); } XDRStreamUnMarshaller & -XDRStreamUnMarshaller::operator=( const XDRStreamUnMarshaller & ) +XDRStreamUnMarshaller::operator=(const XDRStreamUnMarshaller &) { - throw InternalErr( __FILE__, __LINE__, "Copy operator not implemented." ) ; + throw InternalErr(__FILE__, __LINE__, "Copy operator not implemented."); - return *this ; + return *this; } -XDRStreamUnMarshaller::~XDRStreamUnMarshaller( ) +XDRStreamUnMarshaller::~XDRStreamUnMarshaller() { - if ( _source ) - delete_xdrstdio( _source ) ; - _source = 0; + xdr_destroy( &d_source ); + //&d_source = 0; } -void -XDRStreamUnMarshaller::get_byte( dods_byte &val ) +void XDRStreamUnMarshaller::get_byte(dods_byte &val) { - if (xdr_setpos( _source, 0 ) < 0) - throw Error("Failed to reposition input stream"); - if (!(_in.read( _buf, 4 ))) { - if (_in.eof()) - throw Error("Premature EOF in input stream"); - else { - ostringstream ss("Error reading from input stream: "); - ss << _in.rdstate(); - throw Error(ss.str()); - } + if (xdr_setpos( &d_source, 0 ) < 0) + throw Error("Failed to reposition input stream"); + if (!(d_in.read(d_buf, 4))) { + if (d_in.eof()) + throw Error("Premature EOF in input stream"); + else { + ostringstream ss("Error reading from input stream: "); + ss << d_in.rdstate(); + throw Error(ss.str()); + } } - DBG2( std::cerr << "_in.gcount(): " << _in.gcount() << std::endl ); - DBG2( std::cerr << "_in.tellg(): " << _in.tellg() << std::endl ); - DBG2( std::cerr << "_buf[0]: " << hex << _buf[0] << "; _buf[1]: " << _buf[1] - << "; _buf[2]: " << _buf[2] << "; _buf[3]: " << _buf[3] - << dec << std::endl ); + DBG2( std::cerr << "_in.gcount(): " << d_in.gcount() << std::endl ); DBG2( std::cerr << "_in.tellg(): " << d_in.tellg() << std::endl ); DBG2( std::cerr << "_buf[0]: " << hex << d_buf[0] << "; _buf[1]: " << d_buf[1] + << "; _buf[2]: " << d_buf[2] << "; _buf[3]: " << d_buf[3] + << dec << std::endl ); - if( !xdr_char( _source, (char *)&val ) ) + if (!xdr_char(&d_source, (char *) &val)) throw Error("Network I/O Error. Could not read byte data."); DBG2(std::cerr << "get_byte: " << val << std::endl ); } -void -XDRStreamUnMarshaller::get_int16( dods_int16 &val ) +void XDRStreamUnMarshaller::get_int16(dods_int16 &val) { - xdr_setpos( _source, 0 ); - _in.read( _buf, 4 ); + xdr_setpos( &d_source, 0); + d_in.read(d_buf, 4); - if( !XDR_INT16( _source, &val ) ) + if (!XDR_INT16(&d_source, &val)) throw Error("Network I/O Error. Could not read int 16 data."); } -void -XDRStreamUnMarshaller::get_int32( dods_int32 &val ) +void XDRStreamUnMarshaller::get_int32(dods_int32 &val) { - xdr_setpos( _source, 0 ); - _in.read( _buf, 4 ); + xdr_setpos( &d_source, 0); + d_in.read(d_buf, 4); - if( !XDR_INT32( _source, &val ) ) + if (!XDR_INT32(&d_source, &val)) throw Error("Network I/O Error. Could not read int 32 data."); } -void -XDRStreamUnMarshaller::get_float32( dods_float32 &val ) +void XDRStreamUnMarshaller::get_float32(dods_float32 &val) { - xdr_setpos( _source, 0 ); - _in.read( _buf, 4 ); + xdr_setpos( &d_source, 0); + d_in.read(d_buf, 4); - if( !xdr_float( _source, &val ) ) + if (!xdr_float(&d_source, &val)) throw Error("Network I/O Error. Could not read float 32 data."); } -void -XDRStreamUnMarshaller::get_float64( dods_float64 &val ) +void XDRStreamUnMarshaller::get_float64(dods_float64 &val) { - xdr_setpos( _source, 0 ); - _in.read( _buf, 8 ); + xdr_setpos( &d_source, 0); + d_in.read(d_buf, 8); - if( !xdr_double( _source, &val ) ) + if (!xdr_double(&d_source, &val)) throw Error("Network I/O Error. Could not read float 64 data."); } -void -XDRStreamUnMarshaller::get_uint16( dods_uint16 &val ) +void XDRStreamUnMarshaller::get_uint16(dods_uint16 &val) { - xdr_setpos( _source, 0 ); - _in.read( _buf, 4 ); + xdr_setpos( &d_source, 0); + d_in.read(d_buf, 4); - if( !XDR_UINT16( _source, &val ) ) + if (!XDR_UINT16(&d_source, &val)) throw Error("Network I/O Error. Could not read uint 16 data."); } -void -XDRStreamUnMarshaller::get_uint32( dods_uint32 &val ) +void XDRStreamUnMarshaller::get_uint32(dods_uint32 &val) { - xdr_setpos( _source, 0 ); - _in.read( _buf, 4 ); + xdr_setpos( &d_source, 0); + d_in.read(d_buf, 4); - if( !XDR_UINT32( _source, &val ) ) + if (!XDR_UINT32(&d_source, &val)) throw Error("Network I/O Error. Could not read uint 32 data."); } -void -XDRStreamUnMarshaller::get_str( string &val ) +void XDRStreamUnMarshaller::get_str(string &val) { int i; - get_int( i ) ; + get_int(i); DBG(std::cerr << "i: " << i << std::endl); // Must round up string size to next 4 - i = ( ( i + 3 ) / 4 ) * 4; + i = ((i + 3) / 4) * 4; DBG(std::cerr << "i: " << i << std::endl); char *in_tmp = 0; //char *buf = 0; //XDR *source = 0; // Must address the case where the string is larger than the buffer - if ( i + 4 > XDR_DAP_BUFF_SIZE ) { - char *buf = (char *) malloc( i + 4 ); - if (!buf) - throw InternalErr(__FILE__, __LINE__, "Error allocating memory"); - XDR *source = new XDR; - xdrmem_create(source, buf, i + 4, XDR_DECODE); - memcpy( buf, _buf, 4 ); - - _in.read( buf + 4, i ); - - xdr_setpos( source, 0 ); - if( !xdr_string( source, &in_tmp, max_str_len ) ) { - delete_xdrstdio( source ); - throw Error("Network I/O Error. Could not read string data."); - } + if (i + 4 > XDR_DAP_BUFF_SIZE) { +#if 0 + char *buf = (char *) malloc(i + 4); + if (!buf) + throw InternalErr(__FILE__, __LINE__, "Error allocating memory"); +#endif + vector buf(i+4); + + XDR source;// = new XDR; + xdrmem_create(&source, &buf[0], i + 4, XDR_DECODE); + memcpy(&buf[0], d_buf, 4); + + d_in.read(&buf[0] + 4, i); + + xdr_setpos( &source, 0); + if (!xdr_string( &source, &in_tmp, max_str_len)) { + xdr_destroy( &source ); + throw Error("Network I/O Error. Could not read string data."); + } - delete_xdrstdio( source ); + xdr_destroy( &source ); } else { - _in.read( _buf + 4, i ); + d_in.read(d_buf + 4, i); - xdr_setpos( _source, 0 ); - if( !xdr_string( _source, &in_tmp, max_str_len ) ) - throw Error("Network I/O Error. Could not read string data."); + xdr_setpos( &d_source, 0); + if (!xdr_string(&d_source, &in_tmp, max_str_len)) + throw Error("Network I/O Error. Could not read string data."); } - val = in_tmp ; + val = in_tmp; - free( in_tmp ) ; + free(in_tmp); } -void -XDRStreamUnMarshaller::get_url( string &val ) +void XDRStreamUnMarshaller::get_url(string &val) { - get_str( val ) ; + get_str(val); } -void -XDRStreamUnMarshaller::get_opaque( char *val, unsigned int len ) +void XDRStreamUnMarshaller::get_opaque(char *val, unsigned int len) { - xdr_setpos( _source, 0 ); + xdr_setpos( &d_source, 0); // Round len up to the next multiple of 4. There is also the RNDUP() // macro in xdr.h, at least on OS/X. - len += len&3; - if ( static_cast(len) > XDR_DAP_BUFF_SIZE ) - throw Error("Network I/O Error. Length of opaque data larger than allowed"); + len += len & 3; + if (static_cast(len) > XDR_DAP_BUFF_SIZE) + throw Error("Network I/O Error. Length of opaque data larger than allowed"); - _in.read( _buf, len ); + d_in.read(d_buf, len); - xdr_opaque( _source, val, len ) ; + xdr_opaque(&d_source, val, len); } -void -XDRStreamUnMarshaller::get_int( int &val ) +void XDRStreamUnMarshaller::get_int(int &val) { - xdr_setpos( _source, 0 ); - _in.read( _buf, 4 ); + xdr_setpos( &d_source, 0); + d_in.read(d_buf, 4); - if( !xdr_int( _source, &val ) ) - throw Error("Network I/O Error(1)."); + if (!xdr_int(&d_source, &val)) + throw Error("Network I/O Error(1)."); DBG(std::cerr << "get_int: " << val << std::endl); } -void -XDRStreamUnMarshaller::get_vector( char **val, unsigned int &num, Vector & ) +void XDRStreamUnMarshaller::get_vector(char **val, unsigned int &num, Vector &) { int i; - get_int( i ) ; // This leaves the XDR encoded value in _buf; used later + get_int(i); // This leaves the XDR encoded value in d_buf; used later DBG(std::cerr << "i: " << i << std::endl); // Must round up string size to next 4 - i += i&3; + i += i & 3; DBG(std::cerr << "i: " << i << std::endl); //char *buf = 0; //XDR *source = 0; // Must address the case where the string is larger than the buffer - if ( i + 4 > XDR_DAP_BUFF_SIZE ) { - char *buf = (char *) malloc( i + 4 ); - if (!buf) - throw InternalErr(__FILE__, __LINE__, "Error allocating memory"); - XDR *source = new XDR; - xdrmem_create(source, buf, i + 4, XDR_DECODE); - memcpy( buf, _buf, 4 ); - - _in.read( buf + 4, i ); - DBG2(cerr << "bytes read: " << _in.gcount() << endl); - - xdr_setpos( source, 0 ); - if( !xdr_bytes( _source, val, &num, DODS_MAX_ARRAY) ) { - delete_xdrstdio( source ); - throw Error("Network I/O Error. Could not read byte array data."); - } + if (i + 4 > XDR_DAP_BUFF_SIZE) { + vector buf(i+4); + XDR source; + xdrmem_create(&source, &buf[0], i + 4, XDR_DECODE); + memcpy(&buf[0], d_buf, 4); + + d_in.read(&buf[0] + 4, i); + DBG2(cerr << "bytes read: " << d_in.gcount() << endl); + + xdr_setpos(&source, 0); + if (!xdr_bytes(&d_source, val, &num, DODS_MAX_ARRAY)) { + xdr_destroy(&source); + throw Error("Network I/O Error. Could not read byte array data."); + } - delete_xdrstdio( source ); + xdr_destroy( &source ); } else { - _in.read( _buf + 4, i ); - DBG2(cerr << "bytes read: " << _in.gcount() << endl); + d_in.read(d_buf + 4, i); + DBG2(cerr << "bytes read: " << d_in.gcount() << endl); - xdr_setpos( _source, 0 ); - if( !xdr_bytes( _source, val, &num, DODS_MAX_ARRAY) ) - throw Error("Network I/O Error. Could not read byte array data."); + xdr_setpos(&d_source, 0); + if (!xdr_bytes(&d_source, val, &num, DODS_MAX_ARRAY)) + throw Error("Network I/O Error. Could not read byte array data."); } } -void -XDRStreamUnMarshaller::get_vector( char **val, unsigned int &num, int width, Vector &vec ) +void XDRStreamUnMarshaller::get_vector(char **val, unsigned int &num, int width, Vector &vec) +{ + get_vector(val, num, width, vec.var()->type()); +} + +void XDRStreamUnMarshaller::get_vector(char **val, unsigned int &num, int width, Type type) { int i; - get_int( i ) ; // This leaves the XDR encoded value in _buf; used later + get_int(i); // This leaves the XDR encoded value in d_buf; used later DBG(std::cerr << "i: " << i << std::endl); - width += width&3; + width += width & 3; DBG(std::cerr << "width: " << width << std::endl); - //char *buf = 0; - //XDR *source = 0; int size = i * width; // + 4; // '+ 4' to hold the int already read - BaseType *var = vec.var(); // Must address the case where the string is larger than the buffer if (size > XDR_DAP_BUFF_SIZE) { - char *buf = (char *) malloc( size + 4 ); - if (!buf) - throw InternalErr(__FILE__, __LINE__, "Error allocating memory"); - XDR *source = new XDR; - xdrmem_create(source, buf, size + 4, XDR_DECODE); - DBG2(cerr << "size: " << size << endl); - memcpy(buf, _buf, 4); - - _in.read(buf + 4, size); // +4 for the int already read - DBG2(cerr << "bytes read: " << _in.gcount() << endl); - - xdr_setpos( source, 0 ); - if (!xdr_array( source, val, &num, DODS_MAX_ARRAY, width, - XDRUtils::xdr_coder( var->type() ) ) ) { - delete_xdrstdio( source ); - throw Error("Network I/O Error. Could not read array data."); - } + vector buf(size+4); + XDR source; + xdrmem_create(&source, &buf[0], size + 4, XDR_DECODE); + DBG(cerr << "size: " << size << endl); + memcpy(&buf[0], d_buf, 4); + + d_in.read(&buf[0] + 4, size); // +4 for the int already read + DBG(cerr << "bytes read: " << d_in.gcount() << endl); + + xdr_setpos(&source, 0); + if (!xdr_array(&source, val, &num, DODS_MAX_ARRAY, width, XDRUtils::xdr_coder(type))) { + xdr_destroy( &source ); + throw Error("Network I/O Error. Could not read array data."); + } - delete_xdrstdio(source); + xdr_destroy( &source ); } else { - _in.read(_buf + 4, size); - DBG2(cerr << "bytes read: " << _in.gcount() << endl); + d_in.read(d_buf + 4, size); + DBG(cerr << "bytes read (2): " << d_in.gcount() << endl); - xdr_setpos( _source, 0 ); - if (!xdr_array( _source, val, &num, DODS_MAX_ARRAY, width, - XDRUtils::xdr_coder( var->type() ) ) ) - throw Error("Network I/O Error. Could not read array data."); + xdr_setpos( &d_source, 0); + if (!xdr_array(&d_source, val, &num, DODS_MAX_ARRAY, width, XDRUtils::xdr_coder(type))) + throw Error("Network I/O Error. Could not read array data."); } } -void -XDRStreamUnMarshaller::dump(ostream &strm) const +void XDRStreamUnMarshaller::dump(ostream &strm) const { - strm << DapIndent::LMarg << "XDRStreamUnMarshaller::dump - (" - << (void *)this << ")" << endl ; + strm << DapIndent::LMarg << "XDRStreamUnMarshaller::dump - (" << (void *) this << ")" << endl; } } // namespace libdap diff -Nru libdap-3.11.1/XDRStreamUnMarshaller.h libdap-3.12.0/XDRStreamUnMarshaller.h --- libdap-3.11.1/XDRStreamUnMarshaller.h 2011-04-29 13:19:42.000000000 +0000 +++ libdap-3.12.0/XDRStreamUnMarshaller.h 2013-10-17 21:27:40.000000000 +0000 @@ -20,7 +20,7 @@ // // You should have received a copy of the GNU Lesser General Public // License along with this library; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA // // You can contact OPeNDAP, Inc. at PO Box 112, Saunderstown, RI. 02874-0112. @@ -52,40 +52,41 @@ class XDRStreamUnMarshaller : public UnMarshaller { private: - XDR * _source ; - istream & _in; - static char * _buf; + XDR d_source ; + istream & d_in; + static char * d_buf; XDRStreamUnMarshaller() ; XDRStreamUnMarshaller( const XDRStreamUnMarshaller &um ) ; XDRStreamUnMarshaller & operator=( const XDRStreamUnMarshaller & ) ; + public: XDRStreamUnMarshaller( istream &in ) ; virtual ~XDRStreamUnMarshaller() ; - virtual void get_byte( dods_byte &val ) ; + virtual void get_byte( dods_byte &val ) ; + + virtual void get_int16( dods_int16 &val ) ; + virtual void get_int32( dods_int32 &val ) ; - virtual void get_int16( dods_int16 &val ) ; - virtual void get_int32( dods_int32 &val ) ; + virtual void get_float32( dods_float32 &val ) ; + virtual void get_float64( dods_float64 &val ) ; - virtual void get_float32( dods_float32 &val ) ; - virtual void get_float64( dods_float64 &val ) ; + virtual void get_uint16( dods_uint16 &val ) ; + virtual void get_uint32( dods_uint32 &val ) ; - virtual void get_uint16( dods_uint16 &val ) ; - virtual void get_uint32( dods_uint32 &val ) ; + virtual void get_str( string &val ) ; + virtual void get_url( string &val ) ; - virtual void get_str( string &val ) ; - virtual void get_url( string &val ) ; + virtual void get_opaque( char *val, unsigned int len ) ; + virtual void get_int( int &val ) ; - virtual void get_opaque( char *val, unsigned int len ) ; - virtual void get_int( int &val ) ; + virtual void get_vector( char **val, unsigned int &num, Vector &vec ) ; + virtual void get_vector( char **val, unsigned int &num, int width, Vector &vec ) ; - virtual void get_vector( char **val, unsigned int &num, - Vector &vec ) ; - virtual void get_vector( char **val, unsigned int &num, - int width, Vector &vec ) ; + virtual void get_vector(char **val, unsigned int &num, int width, Type type); - virtual void dump(ostream &strm) const ; + virtual void dump(ostream &strm) const ; } ; } // namespace libdap diff -Nru libdap-3.11.1/XDRUtils.cc libdap-3.12.0/XDRUtils.cc --- libdap-3.11.1/XDRUtils.cc 2011-04-29 13:19:43.000000000 +0000 +++ libdap-3.12.0/XDRUtils.cc 2013-10-17 21:27:40.000000000 +0000 @@ -20,7 +20,7 @@ // // You should have received a copy of the GNU Lesser General Public // License along with this library; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA // // You can contact OPeNDAP, Inc. at PO Box 112, Saunderstown, RI. 02874-0112. diff -Nru libdap-3.11.1/XDRUtils.h libdap-3.12.0/XDRUtils.h --- libdap-3.11.1/XDRUtils.h 2011-04-29 13:19:42.000000000 +0000 +++ libdap-3.12.0/XDRUtils.h 2013-10-17 21:27:40.000000000 +0000 @@ -20,7 +20,7 @@ // // You should have received a copy of the GNU Lesser General Public // License along with this library; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA // // You can contact OPeNDAP, Inc. at PO Box 112, Saunderstown, RI. 02874-0112. diff -Nru libdap-3.11.1/XMLWriter.cc libdap-3.12.0/XMLWriter.cc --- libdap-3.11.1/XMLWriter.cc 1970-01-01 00:00:00.000000000 +0000 +++ libdap-3.12.0/XMLWriter.cc 2013-10-17 21:27:40.000000000 +0000 @@ -0,0 +1,150 @@ + +// This file is part of libdap, A C++ implementation of the OPeNDAP Data +// Access Protocol. + +// Copyright (c) 2010 OPeNDAP, Inc. +// Author: James Gallagher +// +// This library is free software; you can redistribute it and/or +// modify it under the terms of the GNU Lesser General Public +// License as published by the Free Software Foundation; either +// version 2.1 of the License, or (at your option) any later version. +// +// This library 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 +// Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, write to the Free Software +// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA +// +// You can contact OPeNDAP, Inc. at PO Box 112, Saunderstown, RI. 02874-0112. + +/* + * XMLWriter.cpp + * + * Created on: Jul 28, 2010 + * Author: jimg + */ + +#include "XMLWriter.h" + +#include +#include + +#include + +const char *ENCODING = "ISO-8859-1"; +const int XML_BUF_SIZE = 2000000; + +using namespace libdap; + +XMLWriter::XMLWriter(const string &pad) { + LIBXML_TEST_VERSION; + + /* Create a new XML buffer, to which the XML document will be + * written */ + try { + if (!(d_doc_buf = xmlBufferCreateSize(XML_BUF_SIZE))) + throw InternalErr(__FILE__, __LINE__, "Error allocating the xml buffer"); + + xmlBufferSetAllocationScheme(d_doc_buf, XML_BUFFER_ALLOC_DOUBLEIT); + + /* Create a new XmlWriter for memory, with no compression. + * Remark: there is no compression for this kind of xmlTextWriter */ + if (!(d_writer = xmlNewTextWriterMemory(d_doc_buf, 0))) + throw InternalErr(__FILE__, __LINE__, "Error allocating memory for xml writer"); + + if (xmlTextWriterSetIndent(d_writer, pad.length()) < 0) + throw InternalErr(__FILE__, __LINE__, "Error starting indentation for response document "); + + if (xmlTextWriterSetIndentString(d_writer, (const xmlChar*)pad.c_str()) < 0) + throw InternalErr(__FILE__, __LINE__, "Error setting indentation for response document "); + + d_started = true; + d_ended = false; + + /* Start the document with the xml default for the version, + * encoding ISO 8859-1 and the default for the standalone + * declaration. MY_ENCODING defined at top of this file*/ + if (xmlTextWriterStartDocument(d_writer, NULL, ENCODING, NULL) < 0) + throw InternalErr(__FILE__, __LINE__, "Error starting xml response document"); + } + catch (InternalErr &e) { + m_cleanup(); + throw; + } + +} + +XMLWriter::~XMLWriter() { + m_cleanup(); +} + +void XMLWriter::m_cleanup() { + // make sure the buffer and writer are all cleaned up + if (d_writer) { + xmlFreeTextWriter(d_writer); // This frees both d_writer and d_doc_buf + d_writer = 0; + // d_doc_buf = 0; + } + + // We could be here because of an exception and d_writer might be zero + if (d_doc_buf) { + xmlBufferFree(d_doc_buf); + d_doc_buf = 0; + } + + d_started = false; + d_ended = false; +} + +const char *XMLWriter::get_doc() { + if (d_writer && d_started) { + if (xmlTextWriterEndDocument(d_writer) < 0) + throw InternalErr(__FILE__, __LINE__, "Error ending the document"); + + d_ended = true; + + // must call this before getting the buffer content. Odd, but appears to be true. + // jhrg + xmlFreeTextWriter(d_writer); + d_writer = 0; + } + + if (!d_doc_buf->content) + throw InternalErr(__FILE__, __LINE__, "Error retrieving response document as string"); +#if 0 + // This is not needed when the TextWriter is freed before getting buffer content. + if (xmlTextWriterFlush(d_writer) < 0) + throw InternalErr(__FILE__, __LINE__, "Error flushing the xml writer buffer"); +#endif + + return (const char *)d_doc_buf->content; +} + +unsigned int XMLWriter::get_doc_size() { + if (d_writer && d_started) { + if (xmlTextWriterEndDocument(d_writer) < 0) + throw InternalErr(__FILE__, __LINE__, "Error ending the document"); + + d_ended = true; + + // must call this before getting the buffer content. Odd, but appears to be true. + // jhrg + xmlFreeTextWriter(d_writer); + d_writer = 0; + } + + if (!d_doc_buf->content) + throw InternalErr(__FILE__, __LINE__, "Error retrieving response document as string"); +#if 0 + // This is not needed when the TextWriter is freed before getting buffer content. + if (xmlTextWriterFlush(d_writer) < 0) + throw InternalErr(__FILE__, __LINE__, "Error flushing the xml writer buffer"); +#endif + + // how much of the buffer is in use? + return d_doc_buf->use; +} diff -Nru libdap-3.11.1/XMLWriter.h libdap-3.12.0/XMLWriter.h --- libdap-3.11.1/XMLWriter.h 1970-01-01 00:00:00.000000000 +0000 +++ libdap-3.12.0/XMLWriter.h 2013-10-17 21:27:40.000000000 +0000 @@ -0,0 +1,63 @@ + +// This file is part of libdap, A C++ implementation of the OPeNDAP Data +// Access Protocol. + +// Copyright (c) 2010 OPeNDAP, Inc. +// Author: James Gallagher +// +// This library is free software; you can redistribute it and/or +// modify it under the terms of the GNU Lesser General Public +// License as published by the Free Software Foundation; either +// version 2.1 of the License, or (at your option) any later version. +// +// This library 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 +// Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, write to the Free Software +// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA +// +// You can contact OPeNDAP, Inc. at PO Box 112, Saunderstown, RI. 02874-0112. +/* + * XMLWriter.h + * + * Created on: Jul 28, 2010 + * Author: jimg + */ + +#ifndef XMLWRITER_H_ +#define XMLWRITER_H_ + +#include +#include + +#include + +#include + +using namespace std; + +class XMLWriter { +private: + // Various xml writer stuff + xmlTextWriterPtr d_writer; + xmlBufferPtr d_doc_buf; + bool d_started; + bool d_ended; + + string d_doc; + + void m_cleanup() ; + +public: + XMLWriter(const string &pad = " "); + virtual ~XMLWriter(); + + xmlTextWriterPtr get_writer() { return d_writer; } + const char *get_doc(); + unsigned int get_doc_size(); +}; + +#endif /* XMLWRITER_H_ */ diff -Nru libdap-3.11.1/aclocal.m4 libdap-3.12.0/aclocal.m4 --- libdap-3.11.1/aclocal.m4 2011-05-06 17:36:24.000000000 +0000 +++ libdap-3.12.0/aclocal.m4 2013-10-17 21:27:40.000000000 +0000 @@ -1,7 +1,8 @@ -# generated automatically by aclocal 1.11 -*- Autoconf -*- +# generated automatically by aclocal 1.12 -*- Autoconf -*- # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, -# 2005, 2006, 2007, 2008, 2009 Free Software Foundation, Inc. +# 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software Foundation, +# Inc. # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. @@ -13,28 +14,30 @@ m4_ifndef([AC_AUTOCONF_VERSION], [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl -m4_if(m4_defn([AC_AUTOCONF_VERSION]), [2.65],, -[m4_warning([this file was generated for autoconf 2.65. +m4_if(m4_defn([AC_AUTOCONF_VERSION]), [2.69],, +[m4_warning([this file was generated for autoconf 2.69. You have another version of autoconf. It may work, but is not guaranteed to. If you have problems, you may need to regenerate the build system entirely. -To do so, use the procedure documented by the package, typically `autoreconf'.])]) +To do so, use the procedure documented by the package, typically 'autoreconf'.])]) -# Copyright (C) 2002, 2003, 2005, 2006, 2007, 2008 Free Software Foundation, Inc. +# Copyright (C) 2002-2012 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. +# serial 8 + # AM_AUTOMAKE_VERSION(VERSION) # ---------------------------- # Automake X.Y traces this macro to ensure aclocal.m4 has been # generated from the m4 files accompanying Automake X.Y. # (This private macro should not be called outside this file.) AC_DEFUN([AM_AUTOMAKE_VERSION], -[am__api_version='1.11' +[am__api_version='1.12' dnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to dnl require some minimum version. Point them to the right macro. -m4_if([$1], [1.11], [], +m4_if([$1], [1.12], [], [AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl ]) @@ -50,22 +53,24 @@ # Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced. # This function is AC_REQUIREd by AM_INIT_AUTOMAKE. AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION], -[AM_AUTOMAKE_VERSION([1.11])dnl +[AM_AUTOMAKE_VERSION([1.12])dnl m4_ifndef([AC_AUTOCONF_VERSION], [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl _AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))]) # AM_AUX_DIR_EXPAND -*- Autoconf -*- -# Copyright (C) 2001, 2003, 2005 Free Software Foundation, Inc. +# Copyright (C) 2001-2012 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. +# serial 2 + # For projects using AC_CONFIG_AUX_DIR([foo]), Autoconf sets -# $ac_aux_dir to `$srcdir/foo'. In other projects, it is set to -# `$srcdir', `$srcdir/..', or `$srcdir/../..'. +# $ac_aux_dir to '$srcdir/foo'. In other projects, it is set to +# '$srcdir', '$srcdir/..', or '$srcdir/../..'. # # Of course, Automake must honor this variable whenever it calls a # tool from the auxiliary directory. The problem is that $srcdir (and @@ -84,7 +89,7 @@ # # The reason of the latter failure is that $top_srcdir and $ac_aux_dir # are both prefixed by $srcdir. In an in-source build this is usually -# harmless because $srcdir is `.', but things will broke when you +# harmless because $srcdir is '.', but things will broke when you # start a VPATH build or use an absolute $srcdir. # # So we could use something similar to $top_srcdir/$ac_aux_dir/missing, @@ -110,22 +115,21 @@ # AM_CONDITIONAL -*- Autoconf -*- -# Copyright (C) 1997, 2000, 2001, 2003, 2004, 2005, 2006, 2008 -# Free Software Foundation, Inc. +# Copyright (C) 1997-2012 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. -# serial 9 +# serial 10 # AM_CONDITIONAL(NAME, SHELL-CONDITION) # ------------------------------------- # Define a conditional. AC_DEFUN([AM_CONDITIONAL], -[AC_PREREQ(2.52)dnl - ifelse([$1], [TRUE], [AC_FATAL([$0: invalid condition: $1])], - [$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnl +[AC_PREREQ([2.52])dnl + m4_if([$1], [TRUE], [AC_FATAL([$0: invalid condition: $1])], + [$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnl AC_SUBST([$1_TRUE])dnl AC_SUBST([$1_FALSE])dnl _AM_SUBST_NOTMAKE([$1_TRUE])dnl @@ -144,16 +148,15 @@ Usually this means the macro was only invoked conditionally.]]) fi])]) -# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2009 -# Free Software Foundation, Inc. +# Copyright (C) 1999-2012 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. -# serial 10 +# serial 16 -# There are a few dirty hacks below to avoid letting `AC_PROG_CC' be +# There are a few dirty hacks below to avoid letting 'AC_PROG_CC' be # written in clear, in which case automake, when reading aclocal.m4, # will think it sees a *use*, and therefore will trigger all it's # C support machinery. Also note that it means that autoscan, seeing @@ -176,12 +179,12 @@ AC_REQUIRE([AM_MAKE_INCLUDE])dnl AC_REQUIRE([AM_DEP_TRACK])dnl -ifelse([$1], CC, [depcc="$CC" am_compiler_list=], - [$1], CXX, [depcc="$CXX" am_compiler_list=], - [$1], OBJC, [depcc="$OBJC" am_compiler_list='gcc3 gcc'], - [$1], UPC, [depcc="$UPC" am_compiler_list=], - [$1], GCJ, [depcc="$GCJ" am_compiler_list='gcc3 gcc'], - [depcc="$$1" am_compiler_list=]) +m4_if([$1], [CC], [depcc="$CC" am_compiler_list=], + [$1], [CXX], [depcc="$CXX" am_compiler_list=], + [$1], [OBJC], [depcc="$OBJC" am_compiler_list='gcc3 gcc'], + [$1], [UPC], [depcc="$UPC" am_compiler_list=], + [$1], [GCJ], [depcc="$GCJ" am_compiler_list='gcc3 gcc'], + [depcc="$$1" am_compiler_list=]) AC_CACHE_CHECK([dependency style of $depcc], [am_cv_$1_dependencies_compiler_type], @@ -189,8 +192,9 @@ # We make a subdir and do the tests there. Otherwise we can end up # making bogus files that we don't know about and never remove. For # instance it was reported that on HP-UX the gcc test will end up - # making a dummy file named `D' -- because `-MD' means `put the output - # in D'. + # making a dummy file named 'D' -- because '-MD' means "put the output + # in D". + rm -rf conftest.dir mkdir conftest.dir # Copy depcomp to subdir because otherwise we won't find it if we're # using a relative directory. @@ -229,16 +233,16 @@ : > sub/conftest.c for i in 1 2 3 4 5 6; do echo '#include "conftst'$i'.h"' >> sub/conftest.c - # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with - # Solaris 8's {/usr,}/bin/sh. - touch sub/conftst$i.h + # Using ": > sub/conftst$i.h" creates only sub/conftst1.h with + # Solaris 10 /bin/sh. + echo '/* dummy */' > sub/conftst$i.h done echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf - # We check with `-c' and `-o' for the sake of the "dashmstdout" + # We check with '-c' and '-o' for the sake of the "dashmstdout" # mode. It turns out that the SunPro C++ compiler does not properly - # handle `-M -o', and we need to detect this. Also, some Intel - # versions had trouble with output in subdirs + # handle '-M -o', and we need to detect this. Also, some Intel + # versions had trouble with output in subdirs. am__obj=sub/conftest.${OBJEXT-o} am__minus_obj="-o $am__obj" case $depmode in @@ -247,16 +251,16 @@ test "$am__universal" = false || continue ;; nosideeffect) - # after this tag, mechanisms are not by side-effect, so they'll - # only be used when explicitly requested + # After this tag, mechanisms are not by side-effect, so they'll + # only be used when explicitly requested. if test "x$enable_dependency_tracking" = xyes; then continue else break fi ;; - msvisualcpp | msvcmsys) - # This compiler won't grok `-c -o', but also, the minuso test has + msvc7 | msvc7msys | msvisualcpp | msvcmsys) + # This compiler won't grok '-c -o', but also, the minuso test has # not run yet. These depmodes are late enough in the game, and # so weak that their functioning should not be impacted. am__obj=conftest.${OBJEXT-o} @@ -304,7 +308,7 @@ # AM_SET_DEPDIR # ------------- # Choose a directory name for dependency files. -# This macro is AC_REQUIREd in _AM_DEPENDENCIES +# This macro is AC_REQUIREd in _AM_DEPENDENCIES. AC_DEFUN([AM_SET_DEPDIR], [AC_REQUIRE([AM_SET_LEADING_DOT])dnl AC_SUBST([DEPDIR], ["${am__leading_dot}deps"])dnl @@ -314,28 +318,34 @@ # AM_DEP_TRACK # ------------ AC_DEFUN([AM_DEP_TRACK], -[AC_ARG_ENABLE(dependency-tracking, -[ --disable-dependency-tracking speeds up one-time build - --enable-dependency-tracking do not reject slow dependency extractors]) +[AC_ARG_ENABLE([dependency-tracking], [dnl +AS_HELP_STRING( + [--enable-dependency-tracking], + [do not reject slow dependency extractors]) +AS_HELP_STRING( + [--disable-dependency-tracking], + [speeds up one-time build])]) if test "x$enable_dependency_tracking" != xno; then am_depcomp="$ac_aux_dir/depcomp" AMDEPBACKSLASH='\' + am__nodep='_no' fi AM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno]) AC_SUBST([AMDEPBACKSLASH])dnl _AM_SUBST_NOTMAKE([AMDEPBACKSLASH])dnl +AC_SUBST([am__nodep])dnl +_AM_SUBST_NOTMAKE([am__nodep])dnl ]) # Generate code to set up dependency tracking. -*- Autoconf -*- -# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2008 -# Free Software Foundation, Inc. +# Copyright (C) 1999-2012 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. -#serial 5 +# serial 6 # _AM_OUTPUT_DEPENDENCY_COMMANDS # ------------------------------ @@ -354,7 +364,7 @@ # Strip MF so we end up with the name of the file. mf=`echo "$mf" | sed -e 's/:.*$//'` # Check whether this is an Automake generated Makefile or not. - # We used to match only the files named `Makefile.in', but + # We used to match only the files named 'Makefile.in', but # some people rename them; so instead we look at the file content. # Grep'ing the first line is not enough: some people post-process # each Makefile.in and add a new line on top of each file to say so. @@ -366,21 +376,19 @@ continue fi # Extract the definition of DEPDIR, am__include, and am__quote - # from the Makefile without running `make'. + # from the Makefile without running 'make'. DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"` test -z "$DEPDIR" && continue am__include=`sed -n 's/^am__include = //p' < "$mf"` test -z "am__include" && continue am__quote=`sed -n 's/^am__quote = //p' < "$mf"` - # When using ansi2knr, U may be empty or an underscore; expand it - U=`sed -n 's/^U = //p' < "$mf"` # Find all dependency output files, they are included files with # $(DEPDIR) in their names. We invoke sed twice because it is the # simplest approach to changing $(DEPDIR) to its actual value in the # expansion. for file in `sed -n " s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \ - sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do + sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g'`; do # Make sure the directory exists. test -f "$dirpart/$file" && continue fdir=`AS_DIRNAME(["$file"])` @@ -398,7 +406,7 @@ # This macro should only be invoked once -- use via AC_REQUIRE. # # This code is only required when automatic dependency tracking -# is enabled. FIXME. This creates each `.P' file that we will +# is enabled. FIXME. This creates each '.P' file that we will # need in order to bootstrap the dependency handling code. AC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS], [AC_CONFIG_COMMANDS([depfiles], @@ -406,28 +414,15 @@ [AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"]) ]) -# Copyright (C) 1996, 1997, 2000, 2001, 2003, 2005 -# Free Software Foundation, Inc. -# -# This file is free software; the Free Software Foundation -# gives unlimited permission to copy and/or distribute it, -# with or without modifications, as long as this notice is preserved. - -# serial 8 - -# AM_CONFIG_HEADER is obsolete. It has been replaced by AC_CONFIG_HEADERS. -AU_DEFUN([AM_CONFIG_HEADER], [AC_CONFIG_HEADERS($@)]) - # Do all the work for Automake. -*- Autoconf -*- -# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, -# 2005, 2006, 2008, 2009 Free Software Foundation, Inc. +# Copyright (C) 1996-2012 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. -# serial 16 +# serial 18 # This macro actually does too much. Some checks are only needed if # your package does certain things. But this isn't really a big deal. @@ -478,23 +473,25 @@ AC_SUBST([VERSION], [$2])], [_AM_SET_OPTIONS([$1])dnl dnl Diagnose old-style AC_INIT with new-style AM_AUTOMAKE_INIT. -m4_if(m4_ifdef([AC_PACKAGE_NAME], 1)m4_ifdef([AC_PACKAGE_VERSION], 1), 11,, +m4_if( + m4_ifdef([AC_PACKAGE_NAME], [ok]):m4_ifdef([AC_PACKAGE_VERSION], [ok]), + [ok:ok],, [m4_fatal([AC_INIT should be called with package and version arguments])])dnl AC_SUBST([PACKAGE], ['AC_PACKAGE_TARNAME'])dnl AC_SUBST([VERSION], ['AC_PACKAGE_VERSION'])])dnl _AM_IF_OPTION([no-define],, -[AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package]) - AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package])])dnl +[AC_DEFINE_UNQUOTED([PACKAGE], ["$PACKAGE"], [Name of package]) + AC_DEFINE_UNQUOTED([VERSION], ["$VERSION"], [Version number of package])])dnl # Some tools Automake needs. AC_REQUIRE([AM_SANITY_CHECK])dnl AC_REQUIRE([AC_ARG_PROGRAM])dnl -AM_MISSING_PROG(ACLOCAL, aclocal-${am__api_version}) -AM_MISSING_PROG(AUTOCONF, autoconf) -AM_MISSING_PROG(AUTOMAKE, automake-${am__api_version}) -AM_MISSING_PROG(AUTOHEADER, autoheader) -AM_MISSING_PROG(MAKEINFO, makeinfo) +AM_MISSING_PROG([ACLOCAL], [aclocal-${am__api_version}]) +AM_MISSING_PROG([AUTOCONF], [autoconf]) +AM_MISSING_PROG([AUTOMAKE], [automake-${am__api_version}]) +AM_MISSING_PROG([AUTOHEADER], [autoheader]) +AM_MISSING_PROG([MAKEINFO], [makeinfo]) AC_REQUIRE([AM_PROG_INSTALL_SH])dnl AC_REQUIRE([AM_PROG_INSTALL_STRIP])dnl AC_REQUIRE([AM_PROG_MKDIR_P])dnl @@ -508,28 +505,28 @@ [_AM_PROG_TAR([v7])])]) _AM_IF_OPTION([no-dependencies],, [AC_PROVIDE_IFELSE([AC_PROG_CC], - [_AM_DEPENDENCIES(CC)], + [_AM_DEPENDENCIES([CC])], [define([AC_PROG_CC], - defn([AC_PROG_CC])[_AM_DEPENDENCIES(CC)])])dnl + defn([AC_PROG_CC])[_AM_DEPENDENCIES([CC])])])dnl AC_PROVIDE_IFELSE([AC_PROG_CXX], - [_AM_DEPENDENCIES(CXX)], + [_AM_DEPENDENCIES([CXX])], [define([AC_PROG_CXX], - defn([AC_PROG_CXX])[_AM_DEPENDENCIES(CXX)])])dnl + defn([AC_PROG_CXX])[_AM_DEPENDENCIES([CXX])])])dnl AC_PROVIDE_IFELSE([AC_PROG_OBJC], - [_AM_DEPENDENCIES(OBJC)], + [_AM_DEPENDENCIES([OBJC])], [define([AC_PROG_OBJC], - defn([AC_PROG_OBJC])[_AM_DEPENDENCIES(OBJC)])])dnl + defn([AC_PROG_OBJC])[_AM_DEPENDENCIES([OBJC])])])dnl ]) _AM_IF_OPTION([silent-rules], [AC_REQUIRE([AM_SILENT_RULES])])dnl -dnl The `parallel-tests' driver may need to know about EXEEXT, so add the -dnl `am__EXEEXT' conditional if _AM_COMPILER_EXEEXT was seen. This macro +dnl The 'parallel-tests' driver may need to know about EXEEXT, so add the +dnl 'am__EXEEXT' conditional if _AM_COMPILER_EXEEXT was seen. This macro dnl is hooked onto _AC_COMPILER_EXEEXT early, see below. AC_CONFIG_COMMANDS_PRE(dnl [m4_provide_if([_AM_COMPILER_EXEEXT], [AM_CONDITIONAL([am__EXEEXT], [test -n "$EXEEXT"])])])dnl ]) -dnl Hook into `_AC_COMPILER_EXEEXT' early to learn its expansion. Do not +dnl Hook into '_AC_COMPILER_EXEEXT' early to learn its expansion. Do not dnl add the conditional right here, as _AC_COMPILER_EXEEXT may be further dnl mangled by Autoconf and run in a shell conditional statement. m4_define([_AC_COMPILER_EXEEXT], @@ -557,12 +554,14 @@ done echo "timestamp for $_am_arg" >`AS_DIRNAME(["$_am_arg"])`/stamp-h[]$_am_stamp_count]) -# Copyright (C) 2001, 2003, 2005, 2008 Free Software Foundation, Inc. +# Copyright (C) 2001-2012 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. +# serial 8 + # AM_PROG_INSTALL_SH # ------------------ # Define $install_sh. @@ -576,9 +575,9 @@ install_sh="\${SHELL} $am_aux_dir/install-sh" esac fi -AC_SUBST(install_sh)]) +AC_SUBST([install_sh])]) -# Copyright (C) 2003, 2005 Free Software Foundation, Inc. +# Copyright (C) 2003-2012 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -599,21 +598,20 @@ rmdir .tst 2>/dev/null AC_SUBST([am__leading_dot])]) -# Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2005 -# Free Software Foundation, Inc. +# Copyright (C) 1998-2012 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. -# serial 5 +# serial 6 # AM_PROG_LEX # ----------- # Autoconf leaves LEX=: if lex or flex can't be found. Change that to a # "missing" invocation, for better error output. AC_DEFUN([AM_PROG_LEX], -[AC_PREREQ(2.50)dnl +[AC_PREREQ([2.50])dnl AC_REQUIRE([AM_MISSING_HAS_RUN])dnl AC_REQUIRE([AC_PROG_LEX])dnl if test "$LEX" = :; then @@ -622,13 +620,13 @@ # Check to see how 'make' treats includes. -*- Autoconf -*- -# Copyright (C) 2001, 2002, 2003, 2005, 2009 Free Software Foundation, Inc. +# Copyright (C) 2001-2012 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. -# serial 4 +# serial 5 # AM_MAKE_INCLUDE() # ----------------- @@ -647,7 +645,7 @@ _am_result=none # First try GNU make style include. echo "include confinc" > confmf -# Ignore all kinds of additional output from `make'. +# Ignore all kinds of additional output from 'make'. case `$am_make -s -f confmf 2> /dev/null` in #( *the\ am__doit\ target*) am__include=include @@ -674,14 +672,13 @@ # Fake the existence of programs that GNU maintainers use. -*- Autoconf -*- -# Copyright (C) 1997, 1999, 2000, 2001, 2003, 2004, 2005, 2008 -# Free Software Foundation, Inc. +# Copyright (C) 1997-2012 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. -# serial 6 +# serial 7 # AM_MISSING_PROG(NAME, PROGRAM) # ------------------------------ @@ -711,19 +708,21 @@ am_missing_run="$MISSING --run " else am_missing_run= - AC_MSG_WARN([`missing' script is too old or missing]) + AC_MSG_WARN(['missing' script is too old or missing]) fi ]) -# Copyright (C) 2003, 2004, 2005, 2006 Free Software Foundation, Inc. +# Copyright (C) 2003-2012 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. +# serial 2 + # AM_PROG_MKDIR_P # --------------- -# Check for `mkdir -p'. +# Check for 'mkdir -p'. AC_DEFUN([AM_PROG_MKDIR_P], [AC_PREREQ([2.60])dnl AC_REQUIRE([AC_PROG_MKDIR_P])dnl @@ -743,13 +742,13 @@ # Helper functions for option handling. -*- Autoconf -*- -# Copyright (C) 2001, 2002, 2003, 2005, 2008 Free Software Foundation, Inc. +# Copyright (C) 2001-2012 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. -# serial 4 +# serial 6 # _AM_MANGLE_OPTION(NAME) # ----------------------- @@ -757,13 +756,13 @@ [[_AM_OPTION_]m4_bpatsubst($1, [[^a-zA-Z0-9_]], [_])]) # _AM_SET_OPTION(NAME) -# ------------------------------ +# -------------------- # Set option NAME. Presently that only means defining a flag for this option. AC_DEFUN([_AM_SET_OPTION], -[m4_define(_AM_MANGLE_OPTION([$1]), 1)]) +[m4_define(_AM_MANGLE_OPTION([$1]), [1])]) # _AM_SET_OPTIONS(OPTIONS) -# ---------------------------------- +# ------------------------ # OPTIONS is a space-separated list of Automake options. AC_DEFUN([_AM_SET_OPTIONS], [m4_foreach_w([_AM_Option], [$1], [_AM_SET_OPTION(_AM_Option)])]) @@ -776,22 +775,18 @@ # Check to make sure that the build environment is sane. -*- Autoconf -*- -# Copyright (C) 1996, 1997, 2000, 2001, 2003, 2005, 2008 -# Free Software Foundation, Inc. +# Copyright (C) 1996-2012 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. -# serial 5 +# serial 9 # AM_SANITY_CHECK # --------------- AC_DEFUN([AM_SANITY_CHECK], [AC_MSG_CHECKING([whether build environment is sane]) -# Just in case -sleep 1 -echo timestamp > conftest.file # Reject unsafe characters in $srcdir or the absolute working directory # name. Accept space and tab only in the latter. am_lf=' @@ -802,32 +797,40 @@ esac case $srcdir in *[[\\\"\#\$\&\'\`$am_lf\ \ ]]*) - AC_MSG_ERROR([unsafe srcdir value: `$srcdir']);; + AC_MSG_ERROR([unsafe srcdir value: '$srcdir']);; esac -# Do `set' in a subshell so we don't clobber the current shell's +# Do 'set' in a subshell so we don't clobber the current shell's # arguments. Must try -L first in case configure is actually a # symlink; some systems play weird games with the mod time of symlinks # (eg FreeBSD returns the mod time of the symlink's containing # directory). if ( - set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null` - if test "$[*]" = "X"; then - # -L didn't work. - set X `ls -t "$srcdir/configure" conftest.file` - fi - rm -f conftest.file - if test "$[*]" != "X $srcdir/configure conftest.file" \ - && test "$[*]" != "X conftest.file $srcdir/configure"; then - - # If neither matched, then we have a broken ls. This can happen - # if, for instance, CONFIG_SHELL is bash and it inherits a - # broken ls alias from the environment. This has actually - # happened. Such a system could not be considered "sane". - AC_MSG_ERROR([ls -t appears to fail. Make sure there is not a broken -alias in your environment]) - fi - + am_has_slept=no + for am_try in 1 2; do + echo "timestamp, slept: $am_has_slept" > conftest.file + set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null` + if test "$[*]" = "X"; then + # -L didn't work. + set X `ls -t "$srcdir/configure" conftest.file` + fi + if test "$[*]" != "X $srcdir/configure conftest.file" \ + && test "$[*]" != "X conftest.file $srcdir/configure"; then + + # If neither matched, then we have a broken ls. This can happen + # if, for instance, CONFIG_SHELL is bash and it inherits a + # broken ls alias from the environment. This has actually + # happened. Such a system could not be considered "sane". + AC_MSG_ERROR([ls -t appears to fail. Make sure there is not a broken + alias in your environment]) + fi + if test "$[2]" = conftest.file || test $am_try -eq 2; then + break + fi + # Just in case. + sleep 1 + am_has_slept=yes + done test "$[2]" = conftest.file ) then @@ -837,43 +840,61 @@ AC_MSG_ERROR([newly created file is older than distributed files! Check your system clock]) fi -AC_MSG_RESULT(yes)]) +AC_MSG_RESULT([yes]) +# If we didn't sleep, we still need to ensure time stamps of config.status and +# generated files are strictly newer. +am_sleep_pid= +if grep 'slept: no' conftest.file >/dev/null 2>&1; then + ( sleep 1 ) & + am_sleep_pid=$! +fi +AC_CONFIG_COMMANDS_PRE( + [AC_MSG_CHECKING([that generated files are newer than configure]) + if test -n "$am_sleep_pid"; then + # Hide warnings about reused PIDs. + wait $am_sleep_pid 2>/dev/null + fi + AC_MSG_RESULT([done])]) +rm -f conftest.file +]) -# Copyright (C) 2001, 2003, 2005 Free Software Foundation, Inc. +# Copyright (C) 2001-2012 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. +# serial 2 + # AM_PROG_INSTALL_STRIP # --------------------- -# One issue with vendor `install' (even GNU) is that you can't +# One issue with vendor 'install' (even GNU) is that you can't # specify the program used to strip binaries. This is especially # annoying in cross-compiling environments, where the build's strip # is unlikely to handle the host's binaries. # Fortunately install-sh will honor a STRIPPROG variable, so we -# always use install-sh in `make install-strip', and initialize +# always use install-sh in "make install-strip", and initialize # STRIPPROG with the value of the STRIP variable (set by the user). AC_DEFUN([AM_PROG_INSTALL_STRIP], [AC_REQUIRE([AM_PROG_INSTALL_SH])dnl -# Installed binaries are usually stripped using `strip' when the user -# run `make install-strip'. However `strip' might not be the right +# Installed binaries are usually stripped using 'strip' when the user +# run "make install-strip". However 'strip' might not be the right # tool to use in cross-compilation environments, therefore Automake -# will honor the `STRIP' environment variable to overrule this program. -dnl Don't test for $cross_compiling = yes, because it might be `maybe'. +# will honor the 'STRIP' environment variable to overrule this program. +dnl Don't test for $cross_compiling = yes, because it might be 'maybe'. if test "$cross_compiling" != no; then AC_CHECK_TOOL([STRIP], [strip], :) fi INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s" AC_SUBST([INSTALL_STRIP_PROGRAM])]) -# Copyright (C) 2006, 2008 Free Software Foundation, Inc. +# Copyright (C) 2006-2012 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. -# serial 2 +# serial 3 # _AM_SUBST_NOTMAKE(VARIABLE) # --------------------------- @@ -882,24 +903,24 @@ AC_DEFUN([_AM_SUBST_NOTMAKE]) # AM_SUBST_NOTMAKE(VARIABLE) -# --------------------------- +# -------------------------- # Public sister of _AM_SUBST_NOTMAKE. AC_DEFUN([AM_SUBST_NOTMAKE], [_AM_SUBST_NOTMAKE($@)]) # Check how to create a tarball. -*- Autoconf -*- -# Copyright (C) 2004, 2005 Free Software Foundation, Inc. +# Copyright (C) 2004-2012 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. -# serial 2 +# serial 3 # _AM_PROG_TAR(FORMAT) # -------------------- # Check how to create a tarball in format FORMAT. -# FORMAT should be one of `v7', `ustar', or `pax'. +# FORMAT should be one of 'v7', 'ustar', or 'pax'. # # Substitute a variable $(am__tar) that is a command # writing to stdout a FORMAT-tarball containing the directory @@ -910,10 +931,11 @@ # a tarball read from stdin. # $(am__untar) < result.tar AC_DEFUN([_AM_PROG_TAR], -[# Always define AMTAR for backward compatibility. -AM_MISSING_PROG([AMTAR], [tar]) +[# Always define AMTAR for backward compatibility. Yes, it's still used +# in the wild :-( We should find a proper way to deprecate it ... +AC_SUBST([AMTAR], ['$${TAR-tar}']) m4_if([$1], [v7], - [am__tar='${AMTAR} chof - "$$tardir"'; am__untar='${AMTAR} xf -'], + [am__tar='$${TAR-tar} chof - "$$tardir"' am__untar='$${TAR-tar} xf -'], [m4_case([$1], [ustar],, [pax],, [m4_fatal([Unknown tar format])]) AC_MSG_CHECKING([how to create a $1 tar archive]) @@ -921,7 +943,7 @@ _am_tools='gnutar m4_if([$1], [ustar], [plaintar]) pax cpio none' _am_tools=${am_cv_prog_tar_$1-$_am_tools} # Do not fold the above two line into one, because Tru64 sh and -# Solaris sh will not grok spaces in the rhs of `-'. +# Solaris sh will not grok spaces in the rhs of '-'. for _am_tool in $_am_tools do case $_am_tool in @@ -985,6 +1007,7 @@ m4_include([gl/m4/00gnulib.m4]) m4_include([gl/m4/alloca.m4]) m4_include([gl/m4/btowc.m4]) +m4_include([gl/m4/byteswap.m4]) m4_include([gl/m4/codeset.m4]) m4_include([gl/m4/configmake.m4]) m4_include([gl/m4/extensions.m4]) @@ -999,19 +1022,26 @@ m4_include([gl/m4/locale-fr.m4]) m4_include([gl/m4/locale-ja.m4]) m4_include([gl/m4/locale-zh.m4]) +m4_include([gl/m4/locale_h.m4]) +m4_include([gl/m4/localeconv.m4]) m4_include([gl/m4/longlong.m4]) m4_include([gl/m4/malloc.m4]) m4_include([gl/m4/mbrtowc.m4]) m4_include([gl/m4/mbsinit.m4]) m4_include([gl/m4/mbstate_t.m4]) +m4_include([gl/m4/mbtowc.m4]) m4_include([gl/m4/multiarch.m4]) m4_include([gl/m4/nl_langinfo.m4]) +m4_include([gl/m4/off_t.m4]) m4_include([gl/m4/regex.m4]) m4_include([gl/m4/ssize_t.m4]) m4_include([gl/m4/stdbool.m4]) m4_include([gl/m4/stddef_h.m4]) m4_include([gl/m4/stdint.m4]) m4_include([gl/m4/stdlib_h.m4]) +m4_include([gl/m4/strcase.m4]) +m4_include([gl/m4/strings_h.m4]) +m4_include([gl/m4/sys_types_h.m4]) m4_include([gl/m4/unistd_h.m4]) m4_include([gl/m4/warn-on-use.m4]) m4_include([gl/m4/wchar_h.m4]) @@ -1020,7 +1050,6 @@ m4_include([gl/m4/wctype_h.m4]) m4_include([gl/m4/wint_t.m4]) m4_include([conf/acinclude.m4]) -m4_include([conf/check_zlib.m4]) m4_include([conf/cppunit.m4]) m4_include([conf/libtool.m4]) m4_include([conf/ltoptions.m4]) diff -Nru libdap-3.11.1/ce_expr.lex libdap-3.12.0/ce_expr.lex --- libdap-3.11.1/ce_expr.lex 2011-04-29 13:19:43.000000000 +0000 +++ libdap-3.12.0/ce_expr.lex 2013-10-17 21:27:40.000000000 +0000 @@ -48,7 +48,7 @@ #include "config.h" -static char rcsid[] not_used = {"$Id: ce_expr.lex 20716 2009-04-08 19:50:54Z jimg $"}; +static char rcsid[] not_used = {"$Id: ce_expr.lex 27157 2013-09-28 21:22:52Z jimg $"}; #include #include @@ -61,7 +61,7 @@ #define YY_DECL int ce_exprlex YY_PROTO(( void )) #define YY_FATAL_ERROR(msg) {\ throw(Error(string("Error scanning constraint expression text: ") + string(msg))); \ - yy_fatal_error(msg); /* 'Used' here to suppress warning */ \ + yy_fatal_error(msg); /* see das.lex */ \ } #include "Error.h" @@ -80,6 +80,9 @@ %} %option noyywrap +%option nounput +%option noinput +%option 8bit %option prefix="ce_expr" %option outfile="lex.ce_expr.cc" @@ -106,21 +109,31 @@ SCAN_WORD [-+a-zA-Z0-9_/%.\\][-+a-zA-Z0-9_/%.\\#]* -SCAN_EQUAL = +SCAN_EQUAL = SCAN_NOT_EQUAL != SCAN_GREATER > SCAN_GREATER_EQL >= -SCAN_LESS < +SCAN_LESS < SCAN_LESS_EQL <= -SCAN_REGEXP =~ +SCAN_REGEXP =~ -NEVER [^\-+a-zA-Z0-9_/%.\\#:,(){}[\]&<>=~] +SCAN_HASH_BYTE $Byte +SCAN_HASH_INT16 $Int16 +SCAN_HASH_UINT16 $UInt16 +SCAN_HASH_INT32 $Int32 +SCAN_HASH_UINT32 $UInt32 +SCAN_HASH_FLOAT32 $Float32 +SCAN_HASH_FLOAT64 $Float64 + +SCAN_STAR \* + +NEVER [^\-+a-zA-Z0-9_/%.\\:,(){}[\]&<>=~] %% -"[" return (int)*yytext; -"]" return (int)*yytext; -":" return (int)*yytext; +"[" return (int)*yytext; +"]" return (int)*yytext; +":" return (int)*yytext; "," return (int)*yytext; "&" return (int)*yytext; "(" return (int)*yytext; @@ -128,39 +141,54 @@ "{" return (int)*yytext; "}" return (int)*yytext; -{SCAN_WORD} store_id(); return SCAN_WORD; +{SCAN_WORD} store_id(); return SCAN_WORD; -{SCAN_EQUAL} store_op(SCAN_EQUAL); return SCAN_EQUAL; -{SCAN_NOT_EQUAL} store_op(SCAN_NOT_EQUAL); return SCAN_NOT_EQUAL; -{SCAN_GREATER} store_op(SCAN_GREATER); return SCAN_GREATER; -{SCAN_GREATER_EQL} store_op(SCAN_GREATER_EQL); return SCAN_GREATER_EQL; -{SCAN_LESS} store_op(SCAN_LESS); return SCAN_LESS; -{SCAN_LESS_EQL} store_op(SCAN_LESS_EQL); return SCAN_LESS_EQL; -{SCAN_REGEXP} store_op(SCAN_REGEXP); return SCAN_REGEXP; +{SCAN_EQUAL} store_op(SCAN_EQUAL); return SCAN_EQUAL; +{SCAN_NOT_EQUAL} store_op(SCAN_NOT_EQUAL); return SCAN_NOT_EQUAL; +{SCAN_GREATER} store_op(SCAN_GREATER); return SCAN_GREATER; +{SCAN_GREATER_EQL} store_op(SCAN_GREATER_EQL); return SCAN_GREATER_EQL; +{SCAN_LESS} store_op(SCAN_LESS); return SCAN_LESS; +{SCAN_LESS_EQL} store_op(SCAN_LESS_EQL); return SCAN_LESS_EQL; +{SCAN_REGEXP} store_op(SCAN_REGEXP); return SCAN_REGEXP; + +{SCAN_STAR} store_op(SCAN_STAR); return SCAN_STAR; + +{SCAN_HASH_BYTE} return SCAN_HASH_BYTE; +{SCAN_HASH_INT16} return SCAN_HASH_INT16; +{SCAN_HASH_UINT16} return SCAN_HASH_UINT16; +{SCAN_HASH_INT32} return SCAN_HASH_INT32; +{SCAN_HASH_UINT32} return SCAN_HASH_UINT32; +{SCAN_HASH_FLOAT32} return SCAN_HASH_FLOAT32; +{SCAN_HASH_FLOAT64} return SCAN_HASH_FLOAT64; [ \t\r\n]+ <> yy_init = 1; yyterminate(); \" BEGIN(quote); yymore(); + [^"\\]* yymore(); /*"*/ + \\. yymore(); + \" { BEGIN(INITIAL); - store_str(); - return SCAN_STR; - } + store_str(); + return SCAN_STR; + } + <> { + BEGIN(INITIAL); /* resetting the state is needed for reentrant parsers */ char msg[256]; - sprintf(msg, "Unterminated quote\n"); - YY_FATAL_ERROR(msg); + sprintf(msg, "Unterminated quote\n"); + YY_FATAL_ERROR(msg); } {NEVER} { if (yytext) { /* suppress msgs about `' chars */ fprintf(stderr, "Character `%c' is not", *yytext); fprintf(stderr, " allowed and has been ignored\n"); - } - } + } + } %% // Three glue routines for string scanning. These are not declared in the @@ -192,7 +220,7 @@ static void store_id() { - strncpy(ce_exprlval.id, www2id(string(yytext)).c_str(), ID_MAX-1); + strncpy(ce_exprlval.id, yytext, ID_MAX-1); ce_exprlval.id[ID_MAX-1] = '\0'; } @@ -200,7 +228,7 @@ store_str() { // transform %20 to a space. 7/11/2001 jhrg - string *s = new string(www2id(string(yytext))); // XXX memory leak? + string *s = new string(yytext); // move all calls of www2id into the parser. jhrg 7/5/13 www2id(string(yytext))); if (*s->begin() == '\"' && *(s->end()-1) == '\"') { s->erase(s->begin()); diff -Nru libdap-3.11.1/ce_expr.tab.cc libdap-3.12.0/ce_expr.tab.cc --- libdap-3.11.1/ce_expr.tab.cc 2011-05-06 17:50:24.000000000 +0000 +++ libdap-3.12.0/ce_expr.tab.cc 2013-10-17 21:27:40.000000000 +0000 @@ -1,24 +1,23 @@ -/* A Bison parser, made by GNU Bison 2.3. */ -/* Skeleton implementation for Bison's Yacc-like parsers in C +/* A Bison parser, made by GNU Bison 2.4.1. */ - Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004, 2005, 2006 +/* Skeleton implementation for Bison's Yacc-like parsers in C + + Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc. - - This program is free software; you can redistribute it and/or modify + + This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2, or (at your option) - any later version. - + the Free Software Foundation, either version 3 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., 51 Franklin Street, Fifth Floor, - Boston, MA 02110-1301, USA. */ + along with this program. If not, see . */ /* As a special exception, you may create a larger work that contains part or all of the Bison parser skeleton and distribute that work @@ -29,7 +28,7 @@ special exception, which will cause the skeleton and the resulting Bison output files to be licensed under the GNU General Public License without this special exception. - + This special exception was added by the Free Software Foundation in version 2.2 of Bison. */ @@ -47,7 +46,7 @@ #define YYBISON 1 /* Bison version. */ -#define YYBISON_VERSION "2.3" +#define YYBISON_VERSION "2.4.1" /* Skeleton name. */ #define YYSKELETON_NAME "yacc.c" @@ -55,64 +54,69 @@ /* Pure parsers. */ #define YYPURE 0 +/* Push parsers. */ +#define YYPUSH 0 + +/* Pull parsers. */ +#define YYPULL 1 + /* Using locations. */ #define YYLSP_NEEDED 0 /* Substitute the variable and function names. */ -#define yyparse ce_exprparse -#define yylex ce_exprlex -#define yyerror ce_exprerror -#define yylval ce_exprlval -#define yychar ce_exprchar -#define yydebug ce_exprdebug -#define yynerrs ce_exprnerrs +#define yyparse ce_exprparse +#define yylex ce_exprlex +#define yyerror ce_exprerror +#define yylval ce_exprlval +#define yychar ce_exprchar +#define yydebug ce_exprdebug +#define yynerrs ce_exprnerrs -/* Tokens. */ -#ifndef YYTOKENTYPE -# define YYTOKENTYPE - /* Put the tokens into the symbol table, so that GDB and other debuggers - know about them. */ - enum yytokentype { - SCAN_STR = 258, - SCAN_WORD = 259, - SCAN_EQUAL = 260, - SCAN_NOT_EQUAL = 261, - SCAN_GREATER = 262, - SCAN_GREATER_EQL = 263, - SCAN_LESS = 264, - SCAN_LESS_EQL = 265, - SCAN_REGEXP = 266 - }; +/* Copy the first part of user declarations. */ + + +/* Line 189 of yacc.c */ +#line 81 "ce_expr.tab.cc" + +/* Enabling traces. */ +#ifndef YYDEBUG +# define YYDEBUG 1 #endif -/* Tokens. */ -#define SCAN_STR 258 -#define SCAN_WORD 259 -#define SCAN_EQUAL 260 -#define SCAN_NOT_EQUAL 261 -#define SCAN_GREATER 262 -#define SCAN_GREATER_EQL 263 -#define SCAN_LESS 264 -#define SCAN_LESS_EQL 265 -#define SCAN_REGEXP 266 +/* Enabling verbose error messages. */ +#ifdef YYERROR_VERBOSE +# undef YYERROR_VERBOSE +# define YYERROR_VERBOSE 1 +#else +# define YYERROR_VERBOSE 0 +#endif +/* Enabling the token table. */ +#ifndef YYTOKEN_TABLE +# define YYTOKEN_TABLE 0 +#endif +/* "%code requires" blocks. */ -/* Copy the first part of user declarations. */ -#line 41 "ce_expr.y" +/* Line 209 of yacc.c */ +#line 41 "ce_expr.yy" #include "config.h" -static char rcsid[] not_used = {"$Id: ce_expr.y 21578 2009-10-02 16:26:26Z jimg $"}; - #include #include -#include #include + +#include +#include +#include +#include #include +//#define DODS_DEBUG + #include "debug.h" #include "escaping.h" @@ -150,19 +154,14 @@ #define EVALUATOR(arg) (static_cast(arg)->get_eval()) #define DDS(arg) (static_cast(arg)->get_dds()) -#define YYPARSE_PARAM arg +// #define YYPARSE_PARAM arg int ce_exprlex(void); /* the scanner; see expr.lex */ -void ce_exprerror(const char *s); /* easier to overload than to use stdarg... */ -void ce_exprerror(const char *s, const char *s2); -void no_such_func(char *name); -void no_such_ident(char *name, char *word); - -void ce_exprerror(const string &s); -void ce_exprerror(const string &s, const string &s2); -void no_such_func(const string &name); -void no_such_ident(const string &name, const string &word); +void ce_exprerror(ce_parser_arg *arg, const string &s); +void ce_exprerror(ce_parser_arg *arg, const string &s, const string &s2); +void no_such_func(ce_parser_arg *arg, const string &name); +void no_such_ident(ce_parser_arg *arg, const string &name, const string &word); int_list *make_array_index(value &i1, value &i2, value &i3); int_list *make_array_index(value &i1, value &i2); @@ -171,8 +170,7 @@ int_list_list *append_array_index(int_list_list *indices, int_list *index); void delete_array_indices(int_list_list *indices); -bool bracket_projection(DDS &table, const char *name, - int_list_list *indices); +bool bracket_projection(DDS &table, const char *name, int_list_list *indices); void process_array_indices(BaseType *variable, int_list_list *indices); void process_grid_indices(BaseType *variable, int_list_list *indices); @@ -188,34 +186,76 @@ btp_func get_btp_function(const ConstraintEvaluator &eval, const char *name); proj_func get_proj_function(const ConstraintEvaluator &eval, const char *name); +template +arg_list make_fast_arg_list(unsigned long vector_size_hint, arg_type arg_value); +template +arg_list make_fast_arg_list(arg_list int_values, arg_type arg_value); -/* Enabling traces. */ -#ifndef YYDEBUG -# define YYDEBUG 0 -#endif +template +rvalue *build_constant_array(vector *values, DDS *dds); -/* Enabling verbose error messages. */ -#ifdef YYERROR_VERBOSE -# undef YYERROR_VERBOSE -# define YYERROR_VERBOSE 1 -#else -# define YYERROR_VERBOSE 0 -#endif -/* Enabling the token table. */ -#ifndef YYTOKEN_TABLE -# define YYTOKEN_TABLE 0 + + +/* Line 209 of yacc.c */ +#line 203 "ce_expr.tab.cc" + +/* Tokens. */ +#ifndef YYTOKENTYPE +# define YYTOKENTYPE + /* Put the tokens into the symbol table, so that GDB and other debuggers + know about them. */ + enum yytokentype { + SCAN_STR = 258, + SCAN_WORD = 259, + SCAN_EQUAL = 260, + SCAN_NOT_EQUAL = 261, + SCAN_GREATER = 262, + SCAN_GREATER_EQL = 263, + SCAN_LESS = 264, + SCAN_LESS_EQL = 265, + SCAN_REGEXP = 266, + SCAN_STAR = 267, + SCAN_HASH_BYTE = 268, + SCAN_HASH_INT16 = 269, + SCAN_HASH_UINT16 = 270, + SCAN_HASH_INT32 = 271, + SCAN_HASH_UINT32 = 272, + SCAN_HASH_FLOAT32 = 273, + SCAN_HASH_FLOAT64 = 274 + }; #endif + + #if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED typedef union YYSTYPE -#line 130 "ce_expr.y" { + +/* Line 214 of yacc.c */ +#line 145 "ce_expr.yy" + bool boolean; int op; char id[ID_MAX]; - + + libdap::dods_byte byte_value; + libdap::dods_int16 int16_value; + libdap::dods_uint16 uint16_value; + libdap::dods_int32 int32_value; + libdap::dods_uint32 uint32_value; + libdap::dods_float32 float32_value; + libdap::dods_float64 float64_value; + + libdap::byte_arg_list byte_values; + libdap::int16_arg_list int16_values; + libdap::uint16_arg_list uint16_values; + libdap::int32_arg_list int32_values; + libdap::uint32_arg_list uint32_values; + libdap::float32_arg_list float32_values; + libdap::float64_arg_list float64_values; + libdap::value val; // value is defined in expr.h libdap::bool_func b_func; @@ -226,22 +266,36 @@ libdap::rvalue *rval_ptr; libdap::rvalue_list *r_val_l_ptr; -} -/* Line 187 of yacc.c. */ -#line 232 "ce_expr.tab.cc" - YYSTYPE; + + + +/* Line 214 of yacc.c */ +#line 274 "ce_expr.tab.cc" +} YYSTYPE; +# define YYSTYPE_IS_TRIVIAL 1 # define yystype YYSTYPE /* obsolescent; will be withdrawn */ # define YYSTYPE_IS_DECLARED 1 -# define YYSTYPE_IS_TRIVIAL 1 #endif - /* Copy the second part of user declarations. */ -/* Line 216 of yacc.c. */ -#line 245 "ce_expr.tab.cc" +/* Line 264 of yacc.c */ +#line 286 "ce_expr.tab.cc" +/* Unqualified %code blocks. */ + +/* Line 265 of yacc.c */ +#line 232 "ce_expr.yy" + +/* This global is used by the rule 'arg_length_hint' so that the hint can + be used during the paraent rule's parse. See fast_int32_arg_list. */ +unsigned long arg_length_hint_value = 0; + + + +/* Line 265 of yacc.c */ +#line 299 "ce_expr.tab.cc" #ifdef short # undef short @@ -316,14 +370,14 @@ #if (defined __STDC__ || defined __C99__FUNC__ \ || defined __cplusplus || defined _MSC_VER) static int -YYID (int i) +YYID (int yyi) #else static int -YYID (i) - int i; +YYID (yyi) + int yyi; #endif { - return i; + return yyi; } #endif @@ -404,9 +458,9 @@ /* A type that is properly aligned for any stack member. */ union yyalloc { - yytype_int16 yyss; - YYSTYPE yyvs; - }; + yytype_int16 yyss_alloc; + YYSTYPE yyvs_alloc; +}; /* The size of the maximum gap between one aligned stack and the next. */ # define YYSTACK_GAP_MAXIMUM (sizeof (union yyalloc) - 1) @@ -440,12 +494,12 @@ elements in the stack, and YYPTR gives the new location of the stack. Advance YYPTR to a properly aligned location for the next stack. */ -# define YYSTACK_RELOCATE(Stack) \ +# define YYSTACK_RELOCATE(Stack_alloc, Stack) \ do \ { \ YYSIZE_T yynewbytes; \ - YYCOPY (&yyptr->Stack, Stack, yysize); \ - Stack = &yyptr->Stack; \ + YYCOPY (&yyptr->Stack_alloc, Stack, yysize); \ + Stack = &yyptr->Stack_alloc; \ yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \ yyptr += yynewbytes / sizeof (*yyptr); \ } \ @@ -454,22 +508,22 @@ #endif /* YYFINAL -- State number of the termination state. */ -#define YYFINAL 13 +#define YYFINAL 28 /* YYLAST -- Last index in YYTABLE. */ -#define YYLAST 60 +#define YYLAST 157 /* YYNTOKENS -- Number of terminals. */ -#define YYNTOKENS 21 +#define YYNTOKENS 29 /* YYNNTS -- Number of nonterminals. */ -#define YYNNTS 19 +#define YYNNTS 35 /* YYNRULES -- Number of rules. */ -#define YYNRULES 44 +#define YYNRULES 78 /* YYNRULES -- Number of states. */ -#define YYNSTATES 67 +#define YYNSTATES 146 /* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX. */ #define YYUNDEFTOK 2 -#define YYMAXUTOK 266 +#define YYMAXUTOK 274 #define YYTRANSLATE(YYX) \ ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK) @@ -480,16 +534,16 @@ 0, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 12, 2, - 14, 15, 2, 2, 13, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 20, 2, + 22, 24, 2, 2, 21, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 23, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 18, 2, 19, 2, 2, 2, 2, 2, 2, + 2, 27, 2, 28, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 16, 2, 17, 2, 2, 2, 2, + 2, 2, 2, 25, 2, 26, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, @@ -503,7 +557,8 @@ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 1, 2, 3, 4, - 5, 6, 7, 8, 9, 10, 11 + 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, + 15, 16, 17, 18, 19 }; #if YYDEBUG @@ -512,38 +567,57 @@ static const yytype_uint8 yyprhs[] = { 0, 0, 3, 4, 6, 7, 11, 15, 17, 21, - 23, 25, 27, 32, 34, 38, 44, 48, 50, 55, - 57, 62, 64, 68, 70, 71, 73, 75, 77, 80, - 83, 87, 89, 91, 93, 96, 100, 106, 114, 116, - 118, 120, 122, 124, 126 + 23, 25, 27, 29, 36, 43, 50, 57, 64, 71, + 78, 80, 82, 86, 88, 90, 94, 96, 98, 102, + 104, 106, 110, 112, 114, 118, 120, 122, 126, 128, + 130, 134, 136, 141, 143, 147, 153, 157, 159, 164, + 166, 171, 173, 175, 179, 181, 182, 184, 186, 188, + 191, 194, 198, 200, 202, 204, 207, 211, 215, 221, + 227, 235, 243, 245, 247, 249, 251, 253, 255 }; /* YYRHS -- A `-1'-separated list of the rules' RHS. */ static const yytype_int8 yyrhs[] = { - 22, 0, -1, -1, 24, -1, -1, 12, 23, 27, - -1, 24, 12, 27, -1, 25, -1, 25, 13, 24, - -1, 36, -1, 26, -1, 34, -1, 4, 14, 32, - 15, -1, 28, -1, 27, 12, 28, -1, 30, 39, - 16, 31, 17, -1, 30, 39, 30, -1, 29, -1, - 4, 14, 32, 15, -1, 33, -1, 4, 14, 32, - 15, -1, 30, -1, 31, 13, 30, -1, 31, -1, - -1, 4, -1, 3, -1, 35, -1, 36, 37, -1, - 35, 36, -1, 35, 36, 37, -1, 4, -1, 3, - -1, 38, -1, 37, 38, -1, 18, 4, 19, -1, - 18, 4, 20, 4, 19, -1, 18, 4, 20, 4, - 20, 4, 19, -1, 5, -1, 6, -1, 7, -1, - 8, -1, 9, -1, 10, -1, 11, -1 + 30, 0, -1, -1, 32, -1, -1, 20, 31, 51, + -1, 32, 20, 51, -1, 33, -1, 33, 21, 32, + -1, 60, -1, 50, -1, 58, -1, 34, -1, 13, + 22, 35, 23, 36, 24, -1, 14, 22, 35, 23, + 38, 24, -1, 15, 22, 35, 23, 40, 24, -1, + 16, 22, 35, 23, 42, 24, -1, 17, 22, 35, + 23, 44, 24, -1, 18, 22, 35, 23, 46, 24, + -1, 19, 22, 35, 23, 48, 24, -1, 4, -1, + 37, -1, 36, 21, 37, -1, 4, -1, 39, -1, + 38, 21, 39, -1, 4, -1, 41, -1, 40, 21, + 41, -1, 4, -1, 43, -1, 42, 21, 43, -1, + 4, -1, 45, -1, 44, 21, 45, -1, 4, -1, + 47, -1, 46, 21, 47, -1, 4, -1, 49, -1, + 48, 21, 49, -1, 4, -1, 4, 22, 56, 24, + -1, 52, -1, 51, 20, 52, -1, 54, 63, 25, + 55, 26, -1, 54, 63, 54, -1, 53, -1, 4, + 22, 56, 24, -1, 57, -1, 4, 22, 56, 24, + -1, 34, -1, 54, -1, 55, 21, 54, -1, 55, + -1, -1, 4, -1, 3, -1, 59, -1, 60, 61, + -1, 59, 60, -1, 59, 60, 61, -1, 4, -1, + 3, -1, 62, -1, 61, 62, -1, 27, 4, 28, + -1, 27, 12, 28, -1, 27, 4, 23, 4, 28, + -1, 27, 4, 23, 12, 28, -1, 27, 4, 23, + 4, 23, 4, 28, -1, 27, 4, 23, 4, 23, + 12, 28, -1, 5, -1, 6, -1, 7, -1, 8, + -1, 9, -1, 10, -1, 11, -1 }; /* YYRLINE[YYN] -- source line where rule number YYN was defined. */ static const yytype_uint16 yyrline[] = { - 0, 171, 171, 176, 178, 178, 182, 188, 189, 195, - 223, 227, 233, 255, 256, 262, 271, 282, 288, 301, - 302, 314, 321, 330, 335, 340, 371, 387, 392, 400, - 406, 417, 418, 440, 444, 450, 462, 480, 506, 507, - 508, 509, 510, 511, 512 + 0, 241, 241, 247, 249, 249, 253, 259, 260, 266, + 278, 282, 286, 310, 316, 322, 328, 334, 340, 346, + 355, 366, 370, 377, 384, 388, 395, 402, 406, 413, + 420, 424, 431, 438, 442, 449, 456, 460, 467, 474, + 478, 485, 492, 514, 515, 521, 530, 541, 548, 562, + 563, 573, 579, 586, 595, 600, 605, 634, 650, 655, + 664, 670, 681, 686, 697, 701, 713, 722, 729, 741, + 752, 767, 783, 784, 785, 786, 787, 788, 789 }; #endif @@ -554,11 +628,20 @@ { "$end", "error", "$undefined", "SCAN_STR", "SCAN_WORD", "SCAN_EQUAL", "SCAN_NOT_EQUAL", "SCAN_GREATER", "SCAN_GREATER_EQL", "SCAN_LESS", - "SCAN_LESS_EQL", "SCAN_REGEXP", "'&'", "','", "'('", "')'", "'{'", "'}'", - "'['", "']'", "':'", "$accept", "constraint_expr", "@1", "projection", - "proj_clause", "proj_function", "selection", "clause", "bool_function", - "r_value", "r_value_list", "arg_list", "id_or_const", "array_projection", - "array_proj_clause", "name", "array_indices", "array_index", "rel_op", 0 + "SCAN_LESS_EQL", "SCAN_REGEXP", "SCAN_STAR", "SCAN_HASH_BYTE", + "SCAN_HASH_INT16", "SCAN_HASH_UINT16", "SCAN_HASH_INT32", + "SCAN_HASH_UINT32", "SCAN_HASH_FLOAT32", "SCAN_HASH_FLOAT64", "'&'", + "','", "'('", "':'", "')'", "'{'", "'}'", "'['", "']'", "$accept", + "constraint_expr", "$@1", "projection", "proj_clause", + "array_const_special_form", "arg_length_hint", "fast_byte_arg_list", + "fast_byte_arg", "fast_int16_arg_list", "fast_int16_arg", + "fast_uint16_arg_list", "fast_uint16_arg", "fast_int32_arg_list", + "fast_int32_arg", "fast_uint32_arg_list", "fast_uint32_arg", + "fast_float32_arg_list", "fast_float32_arg", "fast_float64_arg_list", + "fast_float64_arg", "proj_function", "selection", "clause", + "bool_function", "r_value", "r_value_list", "arg_list", "id_or_const", + "array_projection", "array_proj_clause", "name", "array_indices", + "array_index", "rel_op", 0 }; #endif @@ -568,29 +651,35 @@ static const yytype_uint16 yytoknum[] = { 0, 256, 257, 258, 259, 260, 261, 262, 263, 264, - 265, 266, 38, 44, 40, 41, 123, 125, 91, 93, - 58 + 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, + 38, 44, 40, 58, 41, 123, 125, 91, 93 }; # endif /* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */ static const yytype_uint8 yyr1[] = { - 0, 21, 22, 22, 23, 22, 22, 24, 24, 25, - 25, 25, 26, 27, 27, 28, 28, 28, 29, 30, - 30, 31, 31, 32, 32, 33, 33, 34, 35, 35, - 35, 36, 36, 37, 37, 38, 38, 38, 39, 39, - 39, 39, 39, 39, 39 + 0, 29, 30, 30, 31, 30, 30, 32, 32, 33, + 33, 33, 33, 34, 34, 34, 34, 34, 34, 34, + 35, 36, 36, 37, 38, 38, 39, 40, 40, 41, + 42, 42, 43, 44, 44, 45, 46, 46, 47, 48, + 48, 49, 50, 51, 51, 52, 52, 52, 53, 54, + 54, 54, 55, 55, 56, 56, 57, 57, 58, 59, + 59, 59, 60, 60, 61, 61, 62, 62, 62, 62, + 62, 62, 63, 63, 63, 63, 63, 63, 63 }; /* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN. */ static const yytype_uint8 yyr2[] = { 0, 2, 0, 1, 0, 3, 3, 1, 3, 1, - 1, 1, 4, 1, 3, 5, 3, 1, 4, 1, - 4, 1, 3, 1, 0, 1, 1, 1, 2, 2, - 3, 1, 1, 1, 2, 3, 5, 7, 1, 1, - 1, 1, 1, 1, 1 + 1, 1, 1, 6, 6, 6, 6, 6, 6, 6, + 1, 1, 3, 1, 1, 3, 1, 1, 3, 1, + 1, 3, 1, 1, 3, 1, 1, 3, 1, 1, + 3, 1, 4, 1, 3, 5, 3, 1, 4, 1, + 4, 1, 1, 3, 1, 0, 1, 1, 1, 2, + 2, 3, 1, 1, 1, 2, 3, 3, 5, 5, + 7, 7, 1, 1, 1, 1, 1, 1, 1 }; /* YYDEFACT[STATE-NAME] -- Default rule to reduce with in state @@ -598,81 +687,127 @@ means the default is an error. */ static const yytype_uint8 yydefact[] = { - 2, 32, 31, 4, 0, 3, 7, 10, 11, 27, - 9, 24, 0, 1, 0, 0, 31, 29, 0, 28, - 33, 26, 25, 21, 23, 0, 19, 25, 5, 13, - 17, 0, 6, 8, 30, 0, 34, 24, 0, 12, - 24, 0, 38, 39, 40, 41, 42, 43, 44, 0, - 35, 0, 0, 22, 0, 14, 0, 16, 0, 20, - 20, 0, 36, 0, 15, 0, 37 + 2, 63, 62, 0, 0, 0, 0, 0, 0, 0, + 4, 0, 3, 7, 12, 10, 11, 58, 9, 55, + 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, + 0, 62, 60, 0, 59, 64, 57, 56, 51, 52, + 54, 0, 49, 20, 0, 0, 0, 0, 0, 0, + 0, 56, 5, 43, 47, 0, 6, 8, 61, 0, + 0, 65, 55, 0, 42, 0, 0, 0, 0, 0, + 0, 0, 55, 0, 72, 73, 74, 75, 76, 77, + 78, 0, 0, 66, 67, 0, 53, 23, 0, 21, + 26, 0, 24, 29, 0, 27, 32, 0, 30, 35, + 0, 33, 38, 0, 36, 41, 0, 39, 0, 44, + 0, 46, 0, 0, 50, 0, 13, 0, 14, 0, + 15, 0, 16, 0, 17, 0, 18, 0, 19, 50, + 0, 0, 68, 69, 22, 25, 28, 31, 34, 37, + 40, 45, 0, 0, 70, 71 }; /* YYDEFGOTO[NTERM-NUM]. */ static const yytype_int8 yydefgoto[] = { - -1, 4, 12, 5, 6, 7, 28, 29, 30, 23, - 24, 25, 26, 8, 9, 10, 19, 20, 49 + -1, 11, 27, 12, 13, 38, 44, 88, 89, 91, + 92, 94, 95, 97, 98, 100, 101, 103, 104, 106, + 107, 15, 52, 53, 54, 39, 40, 41, 42, 16, + 17, 18, 34, 35, 81 }; /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing STATE-NUM. */ -#define YYPACT_NINF -19 -static const yytype_int8 yypact[] = +#define YYPACT_NINF -58 +static const yytype_int16 yypact[] = { - 6, -19, -8, -19, 8, 2, 15, -19, -19, 9, - 24, 28, 30, -19, 30, 32, -19, 24, 39, 24, - -19, -19, 31, -19, 33, 29, -19, 34, 35, -19, - -19, 14, 35, -19, 24, 19, -19, 28, 28, -19, - 28, 30, -19, -19, -19, -19, -19, -19, -19, 1, - -19, 45, 36, -19, 37, -19, 28, -19, 21, -19, - 3, -6, -19, 46, -19, 38, -19 + 44, -58, -8, 56, 83, 86, 87, 88, 89, 90, + -58, 23, 31, 92, -58, -58, -58, 73, 71, 26, + 103, 103, 103, 103, 103, 103, 103, 52, -58, 52, + 69, -58, 71, 21, 71, -58, -58, 93, -58, -58, + 95, 94, -58, -58, 91, 96, 97, 98, 99, 100, + 101, 104, 105, -58, -58, 85, 105, -58, 71, 9, + 102, -58, 26, 26, -58, 113, 123, 124, 125, 127, + 128, 129, 26, 52, -58, -58, -58, -58, -58, -58, + -58, 3, 22, -58, -58, 110, -58, -58, 14, -58, + -58, 28, -58, -58, 29, -58, -58, 76, -58, -58, + 78, -58, -58, 80, -58, -58, 82, -58, 111, -58, + 26, -58, 51, 108, -58, 113, -58, 123, -58, 124, + -58, 125, -58, 127, -58, 128, -58, 129, -58, 4, + 54, 77, -58, -58, -58, -58, -58, -58, -58, -58, + -58, -58, 109, 112, -58, -58 }; /* YYPGOTO[NTERM-NUM]. */ -static const yytype_int8 yypgoto[] = +static const yytype_int16 yypgoto[] = { - -19, -19, -19, 40, -19, -19, 42, 12, -19, -12, - -2, -10, -19, -19, -19, 49, 43, -18, -19 + -58, -58, -58, 114, -58, 1, -13, -58, 24, -58, + 25, -58, 19, -58, 20, -58, 27, -58, 18, -58, + 30, -58, 116, 74, -58, -27, 36, -57, -58, -58, + -58, 131, 117, -31, -58 }; /* YYTABLE[YYPACT[STATE-NUM]]. What to do in state STATE-NUM. If positive, shift that token. If negative, reduce the rule which number is the opposite. If zero, do what YYDEFACT says. If YYTABLE_NINF, syntax error. */ -#define YYTABLE_NINF -19 -static const yytype_int8 yytable[] = +#define YYTABLE_NINF -49 +static const yytype_int16 yytable[] = { - 31, 36, 31, -18, 21, 22, 11, 38, 13, 1, - 2, 64, 1, 16, 14, -18, 36, 56, 3, 42, - 43, 44, 45, 46, 47, 48, 53, 52, 15, 31, - 54, 21, 22, 21, 27, 1, 2, 57, 50, 51, - 62, 63, 18, 35, 39, 37, 38, 41, 40, 58, - 65, 59, 60, 55, 61, 33, 32, 66, 17, 0, - 34 + 55, 14, 55, 61, -48, 85, 36, 37, 45, 46, + 47, 48, 49, 50, 19, 108, 3, 4, 5, 6, + 7, 8, 9, 28, -48, 59, 112, 61, 110, 36, + 37, 14, 82, 60, 113, 115, 86, 83, 116, 3, + 4, 5, 6, 7, 8, 9, 55, 1, 2, 117, + 119, 29, 118, 120, 111, 36, 51, 3, 4, 5, + 6, 7, 8, 9, 10, 3, 4, 5, 6, 7, + 8, 9, 1, 2, 131, 63, 1, 31, 20, 132, + 141, 142, 3, 4, 5, 6, 7, 8, 9, 143, + 74, 75, 76, 77, 78, 79, 80, 121, 33, 123, + 122, 125, 124, 127, 126, 21, 128, 43, 22, 23, + 24, 25, 26, 30, 65, 62, 63, 87, 64, 66, + 67, 68, 69, 70, 71, 73, 72, 90, 93, 96, + 84, 99, 102, 105, 114, 129, 133, 144, 136, 134, + 145, 137, 135, 139, 57, 56, 130, 109, 32, 58, + 138, 0, 0, 0, 0, 0, 0, 140 }; static const yytype_int8 yycheck[] = { - 12, 19, 14, 0, 3, 4, 14, 13, 0, 3, - 4, 17, 3, 4, 12, 12, 34, 16, 12, 5, - 6, 7, 8, 9, 10, 11, 38, 37, 13, 41, - 40, 3, 4, 3, 4, 3, 4, 49, 19, 20, - 19, 20, 18, 4, 15, 14, 13, 12, 14, 4, - 4, 15, 15, 41, 56, 15, 14, 19, 9, -1, - 17 + 27, 0, 29, 34, 0, 62, 3, 4, 21, 22, + 23, 24, 25, 26, 22, 72, 13, 14, 15, 16, + 17, 18, 19, 0, 20, 4, 4, 58, 25, 3, + 4, 30, 23, 12, 12, 21, 63, 28, 24, 13, + 14, 15, 16, 17, 18, 19, 73, 3, 4, 21, + 21, 20, 24, 24, 81, 3, 4, 13, 14, 15, + 16, 17, 18, 19, 20, 13, 14, 15, 16, 17, + 18, 19, 3, 4, 23, 21, 3, 4, 22, 28, + 26, 4, 13, 14, 15, 16, 17, 18, 19, 12, + 5, 6, 7, 8, 9, 10, 11, 21, 27, 21, + 24, 21, 24, 21, 24, 22, 24, 4, 22, 22, + 22, 22, 22, 21, 23, 22, 21, 4, 24, 23, + 23, 23, 23, 23, 23, 20, 22, 4, 4, 4, + 28, 4, 4, 4, 24, 24, 28, 28, 119, 115, + 28, 121, 117, 125, 30, 29, 110, 73, 17, 32, + 123, -1, -1, -1, -1, -1, -1, 127 }; /* YYSTOS[STATE-NUM] -- The (internal number of the) accessing symbol of state STATE-NUM. */ static const yytype_uint8 yystos[] = { - 0, 3, 4, 12, 22, 24, 25, 26, 34, 35, - 36, 14, 23, 0, 12, 13, 4, 36, 18, 37, - 38, 3, 4, 30, 31, 32, 33, 4, 27, 28, - 29, 30, 27, 24, 37, 4, 38, 14, 13, 15, - 14, 12, 5, 6, 7, 8, 9, 10, 11, 39, - 19, 20, 32, 30, 32, 28, 16, 30, 4, 15, - 15, 31, 19, 20, 17, 4, 19 + 0, 3, 4, 13, 14, 15, 16, 17, 18, 19, + 20, 30, 32, 33, 34, 50, 58, 59, 60, 22, + 22, 22, 22, 22, 22, 22, 22, 31, 0, 20, + 21, 4, 60, 27, 61, 62, 3, 4, 34, 54, + 55, 56, 57, 4, 35, 35, 35, 35, 35, 35, + 35, 4, 51, 52, 53, 54, 51, 32, 61, 4, + 12, 62, 22, 21, 24, 23, 23, 23, 23, 23, + 23, 23, 22, 20, 5, 6, 7, 8, 9, 10, + 11, 63, 23, 28, 28, 56, 54, 4, 36, 37, + 4, 38, 39, 4, 40, 41, 4, 42, 43, 4, + 44, 45, 4, 46, 47, 4, 48, 49, 56, 52, + 25, 54, 4, 12, 24, 21, 24, 21, 24, 21, + 24, 21, 24, 21, 24, 21, 24, 21, 24, 24, + 55, 23, 28, 28, 37, 39, 41, 43, 45, 47, + 49, 26, 4, 12, 28, 28 }; #define yyerrok (yyerrstatus = 0) @@ -705,7 +840,7 @@ } \ else \ { \ - yyerror (YY_("syntax error: cannot back up")); \ + yyerror (arg, YY_("syntax error: cannot back up")); \ YYERROR; \ } \ while (YYID (0)) @@ -785,7 +920,7 @@ { \ YYFPRINTF (stderr, "%s ", Title); \ yy_symbol_print (stderr, \ - Type, Value); \ + Type, Value, arg); \ YYFPRINTF (stderr, "\n"); \ } \ } while (YYID (0)) @@ -799,17 +934,19 @@ #if (defined __STDC__ || defined __C99__FUNC__ \ || defined __cplusplus || defined _MSC_VER) static void -yy_symbol_value_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep) +yy_symbol_value_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep, ce_parser_arg *arg) #else static void -yy_symbol_value_print (yyoutput, yytype, yyvaluep) +yy_symbol_value_print (yyoutput, yytype, yyvaluep, arg) FILE *yyoutput; int yytype; YYSTYPE const * const yyvaluep; + ce_parser_arg *arg; #endif { if (!yyvaluep) return; + YYUSE (arg); # ifdef YYPRINT if (yytype < YYNTOKENS) YYPRINT (yyoutput, yytoknum[yytype], *yyvaluep); @@ -831,13 +968,14 @@ #if (defined __STDC__ || defined __C99__FUNC__ \ || defined __cplusplus || defined _MSC_VER) static void -yy_symbol_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep) +yy_symbol_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep, ce_parser_arg *arg) #else static void -yy_symbol_print (yyoutput, yytype, yyvaluep) +yy_symbol_print (yyoutput, yytype, yyvaluep, arg) FILE *yyoutput; int yytype; YYSTYPE const * const yyvaluep; + ce_parser_arg *arg; #endif { if (yytype < YYNTOKENS) @@ -845,7 +983,7 @@ else YYFPRINTF (yyoutput, "nterm %s (", yytname[yytype]); - yy_symbol_value_print (yyoutput, yytype, yyvaluep); + yy_symbol_value_print (yyoutput, yytype, yyvaluep, arg); YYFPRINTF (yyoutput, ")"); } @@ -857,17 +995,20 @@ #if (defined __STDC__ || defined __C99__FUNC__ \ || defined __cplusplus || defined _MSC_VER) static void -yy_stack_print (yytype_int16 *bottom, yytype_int16 *top) +yy_stack_print (yytype_int16 *yybottom, yytype_int16 *yytop) #else static void -yy_stack_print (bottom, top) - yytype_int16 *bottom; - yytype_int16 *top; +yy_stack_print (yybottom, yytop) + yytype_int16 *yybottom; + yytype_int16 *yytop; #endif { YYFPRINTF (stderr, "Stack now"); - for (; bottom <= top; ++bottom) - YYFPRINTF (stderr, " %d", *bottom); + for (; yybottom <= yytop; yybottom++) + { + int yybot = *yybottom; + YYFPRINTF (stderr, " %d", yybot); + } YYFPRINTF (stderr, "\n"); } @@ -885,12 +1026,13 @@ #if (defined __STDC__ || defined __C99__FUNC__ \ || defined __cplusplus || defined _MSC_VER) static void -yy_reduce_print (YYSTYPE *yyvsp, int yyrule) +yy_reduce_print (YYSTYPE *yyvsp, int yyrule, ce_parser_arg *arg) #else static void -yy_reduce_print (yyvsp, yyrule) +yy_reduce_print (yyvsp, yyrule, arg) YYSTYPE *yyvsp; int yyrule; + ce_parser_arg *arg; #endif { int yynrhs = yyr2[yyrule]; @@ -901,18 +1043,18 @@ /* The symbols being reduced. */ for (yyi = 0; yyi < yynrhs; yyi++) { - fprintf (stderr, " $%d = ", yyi + 1); + YYFPRINTF (stderr, " $%d = ", yyi + 1); yy_symbol_print (stderr, yyrhs[yyprhs[yyrule] + yyi], &(yyvsp[(yyi + 1) - (yynrhs)]) - ); - fprintf (stderr, "\n"); + , arg); + YYFPRINTF (stderr, "\n"); } } # define YY_REDUCE_PRINT(Rule) \ do { \ if (yydebug) \ - yy_reduce_print (yyvsp, Rule); \ + yy_reduce_print (yyvsp, Rule, arg); \ } while (YYID (0)) /* Nonzero means print parse trace. It is left uninitialized so that @@ -1163,16 +1305,18 @@ #if (defined __STDC__ || defined __C99__FUNC__ \ || defined __cplusplus || defined _MSC_VER) static void -yydestruct (const char *yymsg, int yytype, YYSTYPE *yyvaluep) +yydestruct (const char *yymsg, int yytype, YYSTYPE *yyvaluep, ce_parser_arg *arg) #else static void -yydestruct (yymsg, yytype, yyvaluep) +yydestruct (yymsg, yytype, yyvaluep, arg) const char *yymsg; int yytype; YYSTYPE *yyvaluep; + ce_parser_arg *arg; #endif { YYUSE (yyvaluep); + YYUSE (arg); if (!yymsg) yymsg = "Deleting"; @@ -1185,10 +1329,8 @@ break; } } - /* Prevent warnings from -Wmissing-prototypes. */ - #ifdef YYPARSE_PARAM #if defined __STDC__ || defined __cplusplus int yyparse (void *YYPARSE_PARAM); @@ -1197,18 +1339,17 @@ #endif #else /* ! YYPARSE_PARAM */ #if defined __STDC__ || defined __cplusplus -int yyparse (void); +int yyparse (ce_parser_arg *arg); #else int yyparse (); #endif #endif /* ! YYPARSE_PARAM */ - -/* The look-ahead symbol. */ +/* The lookahead symbol. */ int yychar; -/* The semantic value of the look-ahead symbol. */ +/* The semantic value of the lookahead symbol. */ YYSTYPE yylval; /* Number of syntax errors so far. */ @@ -1216,9 +1357,9 @@ -/*----------. -| yyparse. | -`----------*/ +/*-------------------------. +| yyparse or yypush_parse. | +`-------------------------*/ #ifdef YYPARSE_PARAM #if (defined __STDC__ || defined __C99__FUNC__ \ @@ -1234,74 +1375,76 @@ #if (defined __STDC__ || defined __C99__FUNC__ \ || defined __cplusplus || defined _MSC_VER) int -yyparse (void) +yyparse (ce_parser_arg *arg) #else int -yyparse () - +yyparse (arg) + ce_parser_arg *arg; #endif #endif { - - int yystate; - int yyn; - int yyresult; - /* Number of tokens to shift before error messages enabled. */ - int yyerrstatus; - /* Look-ahead token as an internal (translated) token number. */ - int yytoken = 0; -#if YYERROR_VERBOSE - /* Buffer for error messages, and its allocated size. */ - char yymsgbuf[128]; - char *yymsg = yymsgbuf; - YYSIZE_T yymsg_alloc = sizeof yymsgbuf; -#endif - /* Three stacks and their tools: - `yyss': related to states, - `yyvs': related to semantic values, - `yyls': related to locations. - - Refer to the stacks thru separate pointers, to allow yyoverflow - to reallocate them elsewhere. */ - - /* The state stack. */ - yytype_int16 yyssa[YYINITDEPTH]; - yytype_int16 *yyss = yyssa; - yytype_int16 *yyssp; - - /* The semantic value stack. */ - YYSTYPE yyvsa[YYINITDEPTH]; - YYSTYPE *yyvs = yyvsa; - YYSTYPE *yyvsp; + int yystate; + /* Number of tokens to shift before error messages enabled. */ + int yyerrstatus; + /* The stacks and their tools: + `yyss': related to states. + `yyvs': related to semantic values. -#define YYPOPSTACK(N) (yyvsp -= (N), yyssp -= (N)) + Refer to the stacks thru separate pointers, to allow yyoverflow + to reallocate them elsewhere. */ + + /* The state stack. */ + yytype_int16 yyssa[YYINITDEPTH]; + yytype_int16 *yyss; + yytype_int16 *yyssp; + + /* The semantic value stack. */ + YYSTYPE yyvsa[YYINITDEPTH]; + YYSTYPE *yyvs; + YYSTYPE *yyvsp; - YYSIZE_T yystacksize = YYINITDEPTH; + YYSIZE_T yystacksize; + int yyn; + int yyresult; + /* Lookahead token as an internal (translated) token number. */ + int yytoken; /* The variables used to return semantic value and location from the action routines. */ YYSTYPE yyval; +#if YYERROR_VERBOSE + /* Buffer for error messages, and its allocated size. */ + char yymsgbuf[128]; + char *yymsg = yymsgbuf; + YYSIZE_T yymsg_alloc = sizeof yymsgbuf; +#endif + +#define YYPOPSTACK(N) (yyvsp -= (N), yyssp -= (N)) /* The number of symbols on the RHS of the reduced rule. Keep to zero when no symbol should be popped. */ int yylen = 0; + yytoken = 0; + yyss = yyssa; + yyvs = yyvsa; + yystacksize = YYINITDEPTH; + YYDPRINTF ((stderr, "Starting parse\n")); yystate = 0; yyerrstatus = 0; yynerrs = 0; - yychar = YYEMPTY; /* Cause a token to be read. */ + yychar = YYEMPTY; /* Cause a token to be read. */ /* Initialize stack pointers. Waste one element of value and location stack so that they stay on the same level as the state stack. The wasted elements are never initialized. */ - yyssp = yyss; yyvsp = yyvs; @@ -1331,7 +1474,6 @@ YYSTYPE *yyvs1 = yyvs; yytype_int16 *yyss1 = yyss; - /* Each stack pointer address is followed by the size of the data in use in that stack, in bytes. This used to be a conditional around just the two extra args, but that might @@ -1339,7 +1481,6 @@ yyoverflow (YY_("memory exhausted"), &yyss1, yysize * sizeof (*yyssp), &yyvs1, yysize * sizeof (*yyvsp), - &yystacksize); yyss = yyss1; @@ -1362,9 +1503,8 @@ (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize)); if (! yyptr) goto yyexhaustedlab; - YYSTACK_RELOCATE (yyss); - YYSTACK_RELOCATE (yyvs); - + YYSTACK_RELOCATE (yyss_alloc, yyss); + YYSTACK_RELOCATE (yyvs_alloc, yyvs); # undef YYSTACK_RELOCATE if (yyss1 != yyssa) YYSTACK_FREE (yyss1); @@ -1375,7 +1515,6 @@ yyssp = yyss + yysize - 1; yyvsp = yyvs + yysize - 1; - YYDPRINTF ((stderr, "Stack size increased to %lu\n", (unsigned long int) yystacksize)); @@ -1385,6 +1524,9 @@ YYDPRINTF ((stderr, "Entering state %d\n", yystate)); + if (yystate == YYFINAL) + YYACCEPT; + goto yybackup; /*-----------. @@ -1393,16 +1535,16 @@ yybackup: /* Do appropriate processing given the current state. Read a - look-ahead token if we need one and don't already have one. */ + lookahead token if we need one and don't already have one. */ - /* First try to decide what to do without reference to look-ahead token. */ + /* First try to decide what to do without reference to lookahead token. */ yyn = yypact[yystate]; if (yyn == YYPACT_NINF) goto yydefault; - /* Not known => get a look-ahead token if don't already have one. */ + /* Not known => get a lookahead token if don't already have one. */ - /* YYCHAR is either YYEMPTY or YYEOF or a valid look-ahead symbol. */ + /* YYCHAR is either YYEMPTY or YYEOF or a valid lookahead symbol. */ if (yychar == YYEMPTY) { YYDPRINTF ((stderr, "Reading a token: ")); @@ -1434,20 +1576,16 @@ goto yyreduce; } - if (yyn == YYFINAL) - YYACCEPT; - /* Count tokens shifted since error; after three, turn off error status. */ if (yyerrstatus) yyerrstatus--; - /* Shift the look-ahead token. */ + /* Shift the lookahead token. */ YY_SYMBOL_PRINT ("Shifting", yytoken, &yylval, &yylloc); - /* Discard the shifted token unless it is eof. */ - if (yychar != YYEOF) - yychar = YYEMPTY; + /* Discard the shifted token. */ + yychar = YYEMPTY; yystate = yyn; *++yyvsp = yylval; @@ -1487,100 +1625,411 @@ switch (yyn) { case 2: -#line 171 "ce_expr.y" + +/* Line 1455 of yacc.c */ +#line 241 "ce_expr.yy" { + DBG(cerr << "Mark all variables" << endl); DDS(arg)->mark_all(true); (yyval.boolean) = true; ;} break; case 4: -#line 178 "ce_expr.y" + +/* Line 1455 of yacc.c */ +#line 249 "ce_expr.yy" { DDS(arg)->mark_all(true); ;} break; case 5: -#line 179 "ce_expr.y" + +/* Line 1455 of yacc.c */ +#line 250 "ce_expr.yy" { (yyval.boolean) = (yyvsp[(3) - (3)].boolean); ;} break; case 6: -#line 183 "ce_expr.y" + +/* Line 1455 of yacc.c */ +#line 254 "ce_expr.yy" { (yyval.boolean) = (yyvsp[(1) - (3)].boolean) && (yyvsp[(3) - (3)].boolean); ;} break; case 8: -#line 190 "ce_expr.y" + +/* Line 1455 of yacc.c */ +#line 261 "ce_expr.yy" { - (yyval.boolean) = (yyvsp[(1) - (3)].boolean) && (yyvsp[(3) - (3)].boolean); - ;} + (yyval.boolean) = (yyvsp[(1) - (3)].boolean) && (yyvsp[(3) - (3)].boolean); + ;} break; case 9: -#line 196 "ce_expr.y" - { - BaseType *var = DDS(arg)->var((yyvsp[(1) - (1)].id)); - if (var) { - DBG(cerr << "Marking " << (yyvsp[(1) - (1)].id) << endl); - (yyval.boolean) = DDS(arg)->mark((yyvsp[(1) - (1)].id), true); - DBG(cerr << "result: " << (yyval.boolean) << endl); - } - else { - no_such_ident((yyvsp[(1) - (1)].id), "identifier"); - } + +/* Line 1455 of yacc.c */ +#line 267 "ce_expr.yy" + { + BaseType *var = DDS(arg)->var((yyvsp[(1) - (1)].id)); + if (var) { + DBG(cerr << "Marking " << (yyvsp[(1) - (1)].id) << endl); + (yyval.boolean) = DDS(arg)->mark((yyvsp[(1) - (1)].id), true); + DBG(cerr << "result: " << (yyval.boolean) << endl); + } + else { + no_such_ident(arg, (yyvsp[(1) - (1)].id), "identifier"); + } ;} break; case 10: -#line 224 "ce_expr.y" + +/* Line 1455 of yacc.c */ +#line 279 "ce_expr.yy" { (yyval.boolean) = (yyvsp[(1) - (1)].boolean); ;} break; case 11: -#line 228 "ce_expr.y" + +/* Line 1455 of yacc.c */ +#line 283 "ce_expr.yy" { (yyval.boolean) = (yyvsp[(1) - (1)].boolean); ;} break; case 12: -#line 234 "ce_expr.y" + +/* Line 1455 of yacc.c */ +#line 287 "ce_expr.yy" + { + Array *array = dynamic_cast((yyvsp[(1) - (1)].rval_ptr)->bvalue(*DDS(arg))); + if (array) { + /* When the special form appears here (not as a function argument) + set send_p so the data will be sent and add it to the DDS. This + streamlines testing (and is likely what is intended). */ + + array->set_send_p(true); + DDS(arg)->add_var_nocopy(array); + + return true; + } + else { + ce_exprerror(arg, "Could not create the anonymous vector using the # special form"); + return false; + } + ;} + break; + + case 13: + +/* Line 1455 of yacc.c */ +#line 311 "ce_expr.yy" + { + (yyval.rval_ptr) = build_constant_array((yyvsp[(5) - (6)].byte_values), DDS(arg)); + ;} + break; + + case 14: + +/* Line 1455 of yacc.c */ +#line 317 "ce_expr.yy" + { + (yyval.rval_ptr) = build_constant_array((yyvsp[(5) - (6)].int16_values), DDS(arg)); + ;} + break; + + case 15: + +/* Line 1455 of yacc.c */ +#line 323 "ce_expr.yy" + { + (yyval.rval_ptr) = build_constant_array((yyvsp[(5) - (6)].uint16_values), DDS(arg)); + ;} + break; + + case 16: + +/* Line 1455 of yacc.c */ +#line 329 "ce_expr.yy" + { + (yyval.rval_ptr) = build_constant_array((yyvsp[(5) - (6)].int32_values), DDS(arg)); + ;} + break; + + case 17: + +/* Line 1455 of yacc.c */ +#line 335 "ce_expr.yy" + { + (yyval.rval_ptr) = build_constant_array((yyvsp[(5) - (6)].uint32_values), DDS(arg)); + ;} + break; + + case 18: + +/* Line 1455 of yacc.c */ +#line 341 "ce_expr.yy" + { + (yyval.rval_ptr) = build_constant_array((yyvsp[(5) - (6)].float32_values), DDS(arg)); + ;} + break; + + case 19: + +/* Line 1455 of yacc.c */ +#line 347 "ce_expr.yy" + { + (yyval.rval_ptr) = build_constant_array((yyvsp[(5) - (6)].float64_values), DDS(arg)); + ;} + break; + + case 20: + +/* Line 1455 of yacc.c */ +#line 356 "ce_expr.yy" + { + if (!check_int32((yyvsp[(1) - (1)].id))) + throw Error(malformed_expr, "#(hint, value, ...) special form expected hint to be an integer"); + + arg_length_hint_value = atoi((yyvsp[(1) - (1)].id)); + (yyval.boolean) = true; + ;} + break; + + case 21: + +/* Line 1455 of yacc.c */ +#line 367 "ce_expr.yy" + { + (yyval.byte_values) = make_fast_arg_list(arg_length_hint_value, (yyvsp[(1) - (1)].byte_value)); + ;} + break; + + case 22: + +/* Line 1455 of yacc.c */ +#line 371 "ce_expr.yy" + { + (yyval.byte_values) = make_fast_arg_list((yyvsp[(1) - (3)].byte_values), (yyvsp[(3) - (3)].byte_value)); + ;} + break; + + case 23: + +/* Line 1455 of yacc.c */ +#line 378 "ce_expr.yy" + { + (yyval.byte_value) = strtol((yyvsp[(1) - (1)].id), 0, 0); + ;} + break; + + case 24: + +/* Line 1455 of yacc.c */ +#line 385 "ce_expr.yy" + { + (yyval.int16_values) = make_fast_arg_list(arg_length_hint_value, (yyvsp[(1) - (1)].int16_value)); + ;} + break; + + case 25: + +/* Line 1455 of yacc.c */ +#line 389 "ce_expr.yy" + { + (yyval.int16_values) = make_fast_arg_list((yyvsp[(1) - (3)].int16_values), (yyvsp[(3) - (3)].int16_value)); + ;} + break; + + case 26: + +/* Line 1455 of yacc.c */ +#line 396 "ce_expr.yy" + { + (yyval.int16_value) = strtol((yyvsp[(1) - (1)].id), 0, 0); + ;} + break; + + case 27: + +/* Line 1455 of yacc.c */ +#line 403 "ce_expr.yy" + { + (yyval.uint16_values) = make_fast_arg_list(arg_length_hint_value, (yyvsp[(1) - (1)].uint16_value)); + ;} + break; + + case 28: + +/* Line 1455 of yacc.c */ +#line 407 "ce_expr.yy" + { + (yyval.uint16_values) = make_fast_arg_list((yyvsp[(1) - (3)].uint16_values), (yyvsp[(3) - (3)].uint16_value)); + ;} + break; + + case 29: + +/* Line 1455 of yacc.c */ +#line 414 "ce_expr.yy" + { + (yyval.uint16_value) = strtoul((yyvsp[(1) - (1)].id), 0, 0); + ;} + break; + + case 30: + +/* Line 1455 of yacc.c */ +#line 421 "ce_expr.yy" + { + (yyval.int32_values) = make_fast_arg_list(arg_length_hint_value, (yyvsp[(1) - (1)].int32_value)); + ;} + break; + + case 31: + +/* Line 1455 of yacc.c */ +#line 425 "ce_expr.yy" + { + (yyval.int32_values) = make_fast_arg_list((yyvsp[(1) - (3)].int32_values), (yyvsp[(3) - (3)].int32_value)); + ;} + break; + + case 32: + +/* Line 1455 of yacc.c */ +#line 432 "ce_expr.yy" + { + (yyval.int32_value) = strtol((yyvsp[(1) - (1)].id), 0, 0); + ;} + break; + + case 33: + +/* Line 1455 of yacc.c */ +#line 439 "ce_expr.yy" + { + (yyval.uint32_values) = make_fast_arg_list(arg_length_hint_value, (yyvsp[(1) - (1)].uint32_value)); + ;} + break; + + case 34: + +/* Line 1455 of yacc.c */ +#line 443 "ce_expr.yy" + { + (yyval.uint32_values) = make_fast_arg_list((yyvsp[(1) - (3)].uint32_values), (yyvsp[(3) - (3)].uint32_value)); + ;} + break; + + case 35: + +/* Line 1455 of yacc.c */ +#line 450 "ce_expr.yy" + { + (yyval.uint32_value) = strtoul((yyvsp[(1) - (1)].id), 0, 0); + ;} + break; + + case 36: + +/* Line 1455 of yacc.c */ +#line 457 "ce_expr.yy" + { + (yyval.float32_values) = make_fast_arg_list(arg_length_hint_value, (yyvsp[(1) - (1)].float32_value)); + ;} + break; + + case 37: + +/* Line 1455 of yacc.c */ +#line 461 "ce_expr.yy" + { + (yyval.float32_values) = make_fast_arg_list((yyvsp[(1) - (3)].float32_values), (yyvsp[(3) - (3)].float32_value)); + ;} + break; + + case 38: + +/* Line 1455 of yacc.c */ +#line 468 "ce_expr.yy" + { + (yyval.float32_value) = strtof((yyvsp[(1) - (1)].id), 0); + ;} + break; + + case 39: + +/* Line 1455 of yacc.c */ +#line 475 "ce_expr.yy" + { + (yyval.float64_values) = make_fast_arg_list(arg_length_hint_value, (yyvsp[(1) - (1)].float64_value)); + ;} + break; + + case 40: + +/* Line 1455 of yacc.c */ +#line 479 "ce_expr.yy" + { + (yyval.float64_values) = make_fast_arg_list((yyvsp[(1) - (3)].float64_values), (yyvsp[(3) - (3)].float64_value)); + ;} + break; + + case 41: + +/* Line 1455 of yacc.c */ +#line 486 "ce_expr.yy" + { + (yyval.float64_value) = strtod((yyvsp[(1) - (1)].id), 0); + ;} + break; + + case 42: + +/* Line 1455 of yacc.c */ +#line 493 "ce_expr.yy" { proj_func p_f = 0; btp_func f = 0; if ((f = get_btp_function(*(EVALUATOR(arg)), (yyvsp[(1) - (4)].id)))) { - EVALUATOR(arg)->append_clause(f, (yyvsp[(3) - (4)].r_val_l_ptr)); - (yyval.boolean) = true; + EVALUATOR(arg)->append_clause(f, (yyvsp[(3) - (4)].r_val_l_ptr)); + (yyval.boolean) = true; } - else if ((p_f = get_proj_function(*(EVALUATOR(arg)), (yyvsp[(1) - (4)].id)))) { + else if ((p_f = get_proj_function(*(EVALUATOR(arg)), (yyvsp[(1) - (4)].id)))) { DDS &dds = dynamic_cast(*(DDS(arg))); - BaseType **args = build_btp_args( (yyvsp[(3) - (4)].r_val_l_ptr), dds ); - (*p_f)(((yyvsp[(3) - (4)].r_val_l_ptr)) ? (yyvsp[(3) - (4)].r_val_l_ptr)->size():0, args, dds, *(EVALUATOR(arg))); - delete[] args; - (yyval.boolean) = true; + BaseType **args = build_btp_args( (yyvsp[(3) - (4)].r_val_l_ptr), dds ); + (*p_f)(((yyvsp[(3) - (4)].r_val_l_ptr)) ? (yyvsp[(3) - (4)].r_val_l_ptr)->size():0, args, dds, *(EVALUATOR(arg))); + delete[] args; + (yyval.boolean) = true; } else { - no_such_func((yyvsp[(1) - (4)].id)); + no_such_func(arg, (yyvsp[(1) - (4)].id)); } ;} break; - case 14: -#line 257 "ce_expr.y" + case 44: + +/* Line 1455 of yacc.c */ +#line 516 "ce_expr.yy" { (yyval.boolean) = (yyvsp[(1) - (3)].boolean) && (yyvsp[(3) - (3)].boolean); ;} break; - case 15: -#line 263 "ce_expr.y" + case 45: + +/* Line 1455 of yacc.c */ +#line 522 "ce_expr.yy" { if ((yyvsp[(1) - (5)].rval_ptr)) { EVALUATOR(arg)->append_clause((yyvsp[(2) - (5)].op), (yyvsp[(1) - (5)].rval_ptr), (yyvsp[(4) - (5)].r_val_l_ptr)); @@ -1591,8 +2040,10 @@ ;} break; - case 16: -#line 272 "ce_expr.y" + case 46: + +/* Line 1455 of yacc.c */ +#line 531 "ce_expr.yy" { if ((yyvsp[(1) - (3)].rval_ptr)) { rvalue_list *rv = new rvalue_list; @@ -1605,19 +2056,23 @@ ;} break; - case 17: -#line 283 "ce_expr.y" + case 47: + +/* Line 1455 of yacc.c */ +#line 542 "ce_expr.yy" { (yyval.boolean) = (yyvsp[(1) - (1)].boolean); ;} break; - case 18: -#line 289 "ce_expr.y" + case 48: + +/* Line 1455 of yacc.c */ +#line 549 "ce_expr.yy" { bool_func b_func = get_function((*EVALUATOR(arg)), (yyvsp[(1) - (4)].id)); if (!b_func) { - no_such_func((yyvsp[(1) - (4)].id)); + no_such_func(arg, (yyvsp[(1) - (4)].id)); } else { EVALUATOR(arg)->append_clause(b_func, (yyvsp[(3) - (4)].r_val_l_ptr)); @@ -1626,94 +2081,115 @@ ;} break; - case 20: -#line 303 "ce_expr.y" + case 50: + +/* Line 1455 of yacc.c */ +#line 564 "ce_expr.yy" { btp_func func = get_btp_function((*EVALUATOR(arg)), (yyvsp[(1) - (4)].id)); if (func) { - (yyval.rval_ptr) = new rvalue(func, (yyvsp[(3) - (4)].r_val_l_ptr)); + (yyval.rval_ptr) = new rvalue(func, (yyvsp[(3) - (4)].r_val_l_ptr)); } - else { - no_such_func((yyvsp[(1) - (4)].id)); + else { + no_such_func(arg, (yyvsp[(1) - (4)].id)); } ;} break; - case 21: -#line 315 "ce_expr.y" + case 51: + +/* Line 1455 of yacc.c */ +#line 574 "ce_expr.yy" + { + (yyval.rval_ptr) = (yyvsp[(1) - (1)].rval_ptr); + ;} + break; + + case 52: + +/* Line 1455 of yacc.c */ +#line 580 "ce_expr.yy" { if ((yyvsp[(1) - (1)].rval_ptr)) - (yyval.r_val_l_ptr) = make_rvalue_list((yyvsp[(1) - (1)].rval_ptr)); + (yyval.r_val_l_ptr) = make_rvalue_list((yyvsp[(1) - (1)].rval_ptr)); else - (yyval.r_val_l_ptr) = 0; + (yyval.r_val_l_ptr) = 0; ;} break; - case 22: -#line 322 "ce_expr.y" + case 53: + +/* Line 1455 of yacc.c */ +#line 587 "ce_expr.yy" { if ((yyvsp[(1) - (3)].r_val_l_ptr) && (yyvsp[(3) - (3)].rval_ptr)) - (yyval.r_val_l_ptr) = append_rvalue_list((yyvsp[(1) - (3)].r_val_l_ptr), (yyvsp[(3) - (3)].rval_ptr)); + (yyval.r_val_l_ptr) = append_rvalue_list((yyvsp[(1) - (3)].r_val_l_ptr), (yyvsp[(3) - (3)].rval_ptr)); else - (yyval.r_val_l_ptr) = 0; + (yyval.r_val_l_ptr) = 0; ;} break; - case 23: -#line 331 "ce_expr.y" + case 54: + +/* Line 1455 of yacc.c */ +#line 596 "ce_expr.yy" { - (yyval.r_val_l_ptr) = (yyvsp[(1) - (1)].r_val_l_ptr); + (yyval.r_val_l_ptr) = (yyvsp[(1) - (1)].r_val_l_ptr); ;} break; - case 24: -#line 335 "ce_expr.y" + case 55: + +/* Line 1455 of yacc.c */ +#line 600 "ce_expr.yy" { - (yyval.r_val_l_ptr) = 0; + (yyval.r_val_l_ptr) = 0; ;} break; - case 25: -#line 341 "ce_expr.y" + case 56: + +/* Line 1455 of yacc.c */ +#line 606 "ce_expr.yy" { - BaseType *btp = DDS(arg)->var(www2id(string((yyvsp[(1) - (1)].id)))); + BaseType *btp = DDS(arg)->var(www2id((yyvsp[(1) - (1)].id))); if (btp) { - btp->set_in_selection(true); - (yyval.rval_ptr) = new rvalue(btp); + btp->set_in_selection(true); + (yyval.rval_ptr) = new rvalue(btp); } else { - value new_val; - if (check_int32((yyvsp[(1) - (1)].id))) { - new_val.type = dods_int32_c; - new_val.v.i = atoi((yyvsp[(1) - (1)].id)); - } - else if (check_uint32((yyvsp[(1) - (1)].id))) { - new_val.type = dods_uint32_c; - new_val.v.ui = atoi((yyvsp[(1) - (1)].id)); - } - else if (check_float64((yyvsp[(1) - (1)].id))) { - new_val.type = dods_float64_c; - new_val.v.f = atof((yyvsp[(1) - (1)].id)); - } - else { - new_val.type = dods_str_c; - new_val.v.s = new string((yyvsp[(1) - (1)].id)); - } - BaseType *btp = make_variable((*EVALUATOR(arg)), new_val); - // *** test for btp == null - // delete new_val.v.s; // Str::val2buf copies the value. - (yyval.rval_ptr) = new rvalue(btp); + value new_val; + if (check_int32((yyvsp[(1) - (1)].id))) { + new_val.type = dods_int32_c; + new_val.v.i = atoi((yyvsp[(1) - (1)].id)); + } + else if (check_uint32((yyvsp[(1) - (1)].id))) { + new_val.type = dods_uint32_c; + new_val.v.ui = atoi((yyvsp[(1) - (1)].id)); + } + else if (check_float64((yyvsp[(1) - (1)].id))) { + new_val.type = dods_float64_c; + new_val.v.f = atof((yyvsp[(1) - (1)].id)); + } + else { + new_val.type = dods_str_c; + new_val.v.s = new string(www2id((yyvsp[(1) - (1)].id))); + } + BaseType *btp = make_variable((*EVALUATOR(arg)), new_val); + (yyval.rval_ptr) = new rvalue(btp); } ;} break; - case 26: -#line 372 "ce_expr.y" + case 57: + +/* Line 1455 of yacc.c */ +#line 635 "ce_expr.yy" { if ((yyvsp[(1) - (1)].val).type != dods_str_c || (yyvsp[(1) - (1)].val).v.s == 0 || (yyvsp[(1) - (1)].val).v.s->empty()) - ce_exprerror("Malformed string", ""); + ce_exprerror(arg, "Malformed string", ""); - BaseType *var = DDS(arg)->var(*((yyvsp[(1) - (1)].val).v.s)); + BaseType *var = DDS(arg)->var(www2id(*((yyvsp[(1) - (1)].val).v.s))); if (var) { (yyval.rval_ptr) = new rvalue(var); } @@ -1724,148 +2200,198 @@ ;} break; - case 27: -#line 388 "ce_expr.y" + case 58: + +/* Line 1455 of yacc.c */ +#line 651 "ce_expr.yy" { (yyval.boolean) = (*DDS(arg)).mark((yyvsp[(1) - (1)].id), true); ;} break; - case 28: -#line 393 "ce_expr.y" + case 59: + +/* Line 1455 of yacc.c */ +#line 656 "ce_expr.yy" { + //string name = www2id($1); if (!bracket_projection((*DDS(arg)), (yyvsp[(1) - (2)].id), (yyvsp[(2) - (2)].int_ll_ptr))) - no_such_ident((yyvsp[(1) - (2)].id), "array, grid or sequence"); - + no_such_ident(arg, (yyvsp[(1) - (2)].id), "array, grid or sequence"); + strncpy((yyval.id), (yyvsp[(1) - (2)].id), ID_MAX-1); (yyval.id)[ID_MAX-1] = '\0'; ;} break; - case 29: -#line 401 "ce_expr.y" + case 60: + +/* Line 1455 of yacc.c */ +#line 665 "ce_expr.yy" { - string name = string((yyvsp[(1) - (2)].id)) + string ((yyvsp[(2) - (2)].id)); + string name = string((yyvsp[(1) - (2)].id)) + string((yyvsp[(2) - (2)].id)); strncpy((yyval.id), name.c_str(), ID_MAX-1); (yyval.id)[ID_MAX-1] = '\0'; ;} break; - case 30: -#line 407 "ce_expr.y" + case 61: + +/* Line 1455 of yacc.c */ +#line 671 "ce_expr.yy" { - string name = string((yyvsp[(1) - (3)].id)) + string ((yyvsp[(2) - (3)].id)); + string name = string((yyvsp[(1) - (3)].id)) + string((yyvsp[(2) - (3)].id)); if (!bracket_projection((*DDS(arg)), name.c_str(), (yyvsp[(3) - (3)].int_ll_ptr))) - no_such_ident(name.c_str(), "array, grid or sequence"); + no_such_ident(arg, name.c_str(), "array, grid or sequence"); strncpy((yyval.id), name.c_str(), ID_MAX-1); (yyval.id)[ID_MAX-1] = '\0'; ;} break; - case 32: -#line 419 "ce_expr.y" + case 62: + +/* Line 1455 of yacc.c */ +#line 682 "ce_expr.yy" + { + strncpy((yyval.id), www2id((yyvsp[(1) - (1)].id)).c_str(), ID_MAX-1); + (yyval.id)[ID_MAX-1] = '\0'; + ;} + break; + + case 63: + +/* Line 1455 of yacc.c */ +#line 687 "ce_expr.yy" { if ((yyvsp[(1) - (1)].val).type != dods_str_c || (yyvsp[(1) - (1)].val).v.s == 0 || (yyvsp[(1) - (1)].val).v.s->empty()) - ce_exprerror("Malformed string", ""); + ce_exprerror(arg, "Malformed string", ""); strncpy((yyval.id), www2id(*((yyvsp[(1) - (1)].val).v.s)).c_str(), ID_MAX-1); - // delete the string? *** + (yyval.id)[ID_MAX-1] = '\0'; -/* - BaseType *var = DDS(arg)->var(*($1.v.s)); - if (var) { - DBG(cerr << "Marking " << $1 << endl); - $$ = DDS(arg)->mark(*($1.v.s), true); - DBG(cerr << "result: " << $$ << endl); - } - else { - no_such_ident(*($1.v.s), "identifier"); - } -*/ ;} break; - case 33: -#line 441 "ce_expr.y" + case 64: + +/* Line 1455 of yacc.c */ +#line 698 "ce_expr.yy" { (yyval.int_ll_ptr) = make_array_indices((yyvsp[(1) - (1)].int_l_ptr)); ;} break; - case 34: -#line 445 "ce_expr.y" + case 65: + +/* Line 1455 of yacc.c */ +#line 702 "ce_expr.yy" { (yyval.int_ll_ptr) = append_array_index((yyvsp[(1) - (2)].int_ll_ptr), (yyvsp[(2) - (2)].int_l_ptr)); ;} break; - case 35: -#line 451 "ce_expr.y" + case 66: + +/* Line 1455 of yacc.c */ +#line 714 "ce_expr.yy" { - if (!check_uint32((yyvsp[(2) - (3)].id))) { - string msg = "The word `"; - msg += string((yyvsp[(2) - (3)].id)) + "' is not a valid array index."; - throw Error(malformed_expr, msg); - } - value i; - i.type = dods_uint32_c; - i.v.i = atoi((yyvsp[(2) - (3)].id)); - (yyval.int_l_ptr) = make_array_index(i); - ;} + if (!check_uint32((yyvsp[(2) - (3)].id))) + throw Error(malformed_expr, "The word `" + string((yyvsp[(2) - (3)].id)) + "' is not a valid array index."); + value i; + i.type = dods_uint32_c; + i.v.i = atoi((yyvsp[(2) - (3)].id)); + (yyval.int_l_ptr) = make_array_index(i); +;} break; - case 36: -#line 463 "ce_expr.y" + case 67: + +/* Line 1455 of yacc.c */ +#line 723 "ce_expr.yy" { - if (!check_uint32((yyvsp[(2) - (5)].id))) { - string msg = "The word `"; - msg += string((yyvsp[(2) - (5)].id)) + "' is not a valid array index."; - throw Error(malformed_expr, msg); - } - if (!check_uint32((yyvsp[(4) - (5)].id))) { - string msg = "The word `"; - msg += string((yyvsp[(4) - (5)].id)) + "' is not a valid array index."; - throw Error(malformed_expr, msg); - } - value i,j; - i.type = j.type = dods_uint32_c; - i.v.i = atoi((yyvsp[(2) - (5)].id)); - j.v.i = atoi((yyvsp[(4) - (5)].id)); - (yyval.int_l_ptr) = make_array_index(i, j); - ;} + value i; + i.type = dods_int32_c; + i.v.i =-1; + (yyval.int_l_ptr) = make_array_index(i); +;} break; - case 37: -#line 481 "ce_expr.y" + case 68: + +/* Line 1455 of yacc.c */ +#line 730 "ce_expr.yy" { - if (!check_uint32((yyvsp[(2) - (7)].id))) { - string msg = "The word `"; - msg += string((yyvsp[(2) - (7)].id)) + "' is not a valid array index."; - throw Error(malformed_expr, msg); - } - if (!check_uint32((yyvsp[(4) - (7)].id))) { - string msg = "The word `"; - msg += string((yyvsp[(4) - (7)].id)) + "' is not a valid array index."; - throw Error(malformed_expr, msg); - } - if (!check_uint32((yyvsp[(6) - (7)].id))) { - string msg = "The word `"; - msg += string((yyvsp[(6) - (7)].id)) + "' is not a valid array index."; - throw Error(malformed_expr, msg); - } - value i, j, k; - i.type = j.type = k.type = dods_uint32_c; - i.v.i = atoi((yyvsp[(2) - (7)].id)); - j.v.i = atoi((yyvsp[(4) - (7)].id)); - k.v.i = atoi((yyvsp[(6) - (7)].id)); - (yyval.int_l_ptr) = make_array_index(i, j, k); - ;} + if (!check_uint32((yyvsp[(2) - (5)].id))) + throw Error(malformed_expr, "The word `" + string((yyvsp[(2) - (5)].id)) + "' is not a valid array index."); + if (!check_uint32((yyvsp[(4) - (5)].id))) + throw Error(malformed_expr, "The word `" + string((yyvsp[(4) - (5)].id)) + "' is not a valid array index."); + value i,j; + i.type = j.type = dods_uint32_c; + i.v.i = atoi((yyvsp[(2) - (5)].id)); + j.v.i = atoi((yyvsp[(4) - (5)].id)); + (yyval.int_l_ptr) = make_array_index(i, j); +;} + break; + + case 69: + +/* Line 1455 of yacc.c */ +#line 742 "ce_expr.yy" + { + if (!check_uint32((yyvsp[(2) - (5)].id))) + throw Error(malformed_expr, "The word `" + string((yyvsp[(2) - (5)].id)) + "' is not a valid array index."); + value i,j; + i.type = dods_uint32_c; + j.type = dods_int32_c; /* signed */ + i.v.i = atoi((yyvsp[(2) - (5)].id)); + j.v.i = -1; + (yyval.int_l_ptr) = make_array_index(i, j); +;} + break; + + case 70: + +/* Line 1455 of yacc.c */ +#line 753 "ce_expr.yy" + { + if (!check_uint32((yyvsp[(2) - (7)].id))) + throw Error(malformed_expr, "The word `" + string((yyvsp[(2) - (7)].id)) + "' is not a valid array index."); + if (!check_uint32((yyvsp[(4) - (7)].id))) + throw Error(malformed_expr, "The word `" + string((yyvsp[(4) - (7)].id)) + "' is not a valid array index."); + if (!check_uint32((yyvsp[(6) - (7)].id))) + throw Error(malformed_expr, "The word `" + string((yyvsp[(6) - (7)].id)) + "' is not a valid array index."); + value i, j, k; + i.type = j.type = k.type = dods_uint32_c; + i.v.i = atoi((yyvsp[(2) - (7)].id)); + j.v.i = atoi((yyvsp[(4) - (7)].id)); + k.v.i = atoi((yyvsp[(6) - (7)].id)); + (yyval.int_l_ptr) = make_array_index(i, j, k); +;} break; + case 71: + +/* Line 1455 of yacc.c */ +#line 768 "ce_expr.yy" + { + if (!check_uint32((yyvsp[(2) - (7)].id))) + throw Error(malformed_expr, "The word `" + string((yyvsp[(2) - (7)].id)) + "' is not a valid array index."); + if (!check_uint32((yyvsp[(4) - (7)].id))) + throw Error(malformed_expr, "The word `" + string((yyvsp[(4) - (7)].id)) + "' is not a valid array index."); + value i, j, k; + i.type = j.type = dods_uint32_c; + k.type = dods_int32_c; + i.v.i = atoi((yyvsp[(2) - (7)].id)); + j.v.i = atoi((yyvsp[(4) - (7)].id)); + k.v.i = -1; + (yyval.int_l_ptr) = make_array_index(i, j, k); +;} + break; + + -/* Line 1267 of yacc.c. */ -#line 1869 "ce_expr.tab.cc" +/* Line 1455 of yacc.c */ +#line 2395 "ce_expr.tab.cc" default: break; } YY_SYMBOL_PRINT ("-> $$ =", yyr1[yyn], &yyval, &yyloc); @@ -1876,7 +2402,6 @@ *++yyvsp = yyval; - /* Now `shift' the result of the reduction. Determine what state that goes to, based on the state we popped back to and the rule number reduced by. */ @@ -1901,7 +2426,7 @@ { ++yynerrs; #if ! YYERROR_VERBOSE - yyerror (YY_("syntax error")); + yyerror (arg, YY_("syntax error")); #else { YYSIZE_T yysize = yysyntax_error (0, yystate, yychar); @@ -1925,11 +2450,11 @@ if (0 < yysize && yysize <= yymsg_alloc) { (void) yysyntax_error (yymsg, yystate, yychar); - yyerror (yymsg); + yyerror (arg, yymsg); } else { - yyerror (YY_("syntax error")); + yyerror (arg, YY_("syntax error")); if (yysize != 0) goto yyexhaustedlab; } @@ -1941,7 +2466,7 @@ if (yyerrstatus == 3) { - /* If just tried and failed to reuse look-ahead token after an + /* If just tried and failed to reuse lookahead token after an error, discard it. */ if (yychar <= YYEOF) @@ -1953,12 +2478,12 @@ else { yydestruct ("Error: discarding", - yytoken, &yylval); + yytoken, &yylval, arg); yychar = YYEMPTY; } } - /* Else will try to reuse look-ahead token after shifting the error + /* Else will try to reuse lookahead token after shifting the error token. */ goto yyerrlab1; @@ -2009,15 +2534,12 @@ yydestruct ("Error: popping", - yystos[yystate], yyvsp); + yystos[yystate], yyvsp, arg); YYPOPSTACK (1); yystate = *yyssp; YY_STACK_PRINT (yyss, yyssp); } - if (yyn == YYFINAL) - YYACCEPT; - *++yyvsp = yylval; @@ -2042,20 +2564,20 @@ yyresult = 1; goto yyreturn; -#ifndef yyoverflow +#if !defined(yyoverflow) || YYERROR_VERBOSE /*-------------------------------------------------. | yyexhaustedlab -- memory exhaustion comes here. | `-------------------------------------------------*/ yyexhaustedlab: - yyerror (YY_("memory exhausted")); + yyerror (arg, YY_("memory exhausted")); yyresult = 2; /* Fall through. */ #endif yyreturn: - if (yychar != YYEOF && yychar != YYEMPTY) + if (yychar != YYEMPTY) yydestruct ("Cleanup: discarding lookahead", - yytoken, &yylval); + yytoken, &yylval, arg); /* Do not reclaim the symbols of the rule which action triggered this YYABORT or YYACCEPT. */ YYPOPSTACK (yylen); @@ -2063,7 +2585,7 @@ while (yyssp != yyss) { yydestruct ("Cleanup: popping", - yystos[*yyssp], yyvsp); + yystos[*yyssp], yyvsp, arg); YYPOPSTACK (1); } #ifndef yyoverflow @@ -2079,7 +2601,9 @@ } -#line 515 "ce_expr.y" + +/* Line 1675 of yacc.c */ +#line 792 "ce_expr.yy" // All these error reporting function now throw instances of Error. The expr @@ -2087,133 +2611,110 @@ // jhrg. void -ce_exprerror(const string &s) -{ - ce_exprerror(s.c_str()); -} - -void -ce_exprerror(const char *s) +ce_exprerror(ce_parser_arg *, const string &s) { - // cerr << "Expression parse error: " << s << endl; - string msg = "Constraint expression parse error: " + (string)s; + //ce_exprerror(s.c_str()); + string msg = "Constraint expression parse error: " + (string) s; throw Error(malformed_expr, msg); } -void -ce_exprerror(const string &s, const string &s2) +void ce_exprerror(ce_parser_arg *, const string &s, const string &s2) { - ce_exprerror(s.c_str(), s2.c_str()); + //ce_exprerror(s.c_str(), s2.c_str()); + string msg = "Constraint expression parse error: " + (string) s + ": " + (string) s2; + throw Error(malformed_expr, msg); } -void -ce_exprerror(const char *s, const char *s2) -{ - string msg = "Constraint expression parse error: " + (string)s + ": " - + (string)s2; - throw Error(malformed_expr, msg); -} - -void -no_such_ident(const string &name, const string &word) +void no_such_ident(ce_parser_arg *arg, const string &name, const string &word) { string msg = "No such " + word + " in dataset"; - ce_exprerror(msg.c_str(), name); + ce_exprerror(arg, msg /*.c_str()*/, name); } -void -no_such_ident(char *name, char *word) -{ - string msg = "No such " + (string)word + " in dataset"; - ce_exprerror(msg.c_str(), name); -} - -void -no_such_func(const string &name) -{ - no_such_func(name.c_str()); -} - -void -no_such_func(char *name) +void no_such_func(ce_parser_arg *arg, const string &name) { - ce_exprerror("Not a registered function", name); + ce_exprerror(arg, "Not a registered function", name); + //no_such_func(name/*.c_str()*/); } /* If we're calling this, assume var is not a Sequence. But assume that the - name contains a dot and it's a separator. Look for the rightmost dot and - then look to see if the name to the left is a sequence. Return a pointer - to the sequence if it is otherwise return null. Uses tail-recursion to - 'walk' back from right to left looking at each dot. This way the sequence - will be found even if there are structures between the field and the - Sequence. */ + name contains a dot and it's a separator. Look for the rightmost dot and + then look to see if the name to the left is a sequence. Return a pointer + to the sequence if it is otherwise return null. Uses tail-recursion to + 'walk' back from right to left looking at each dot. This way the sequence + will be found even if there are structures between the field and the + Sequence. */ static Sequence * parent_is_sequence(DDS &table, const string &n) { string::size_type dotpos = n.find_last_of('.'); if (dotpos == string::npos) - return 0; + return 0; string s = n.substr(0, dotpos); - + // If the thing returned by table.var is not a Sequence, this cast // will yield null. - Sequence *seq = dynamic_cast(table.var(s)); + Sequence *seq = dynamic_cast (table.var(s)); if (seq) - return seq; + return seq; else - return parent_is_sequence(table, s); + return parent_is_sequence(table, s); } - -bool -bracket_projection(DDS &table, const char *name, int_list_list *indices) +bool bracket_projection(DDS &table, const char *name, int_list_list *indices) { BaseType *var = table.var(name); - Sequence *seq; // used in last else-if clause + Sequence *seq; // used in last else-if clause #if 0 Array *array; #endif if (!var) - return false; - + return false; + if (is_array_t(var)) { - /* calls to set_send_p should be replaced with - calls to DDS::mark so that arrays of Structures, - etc. will be processed correctly when individual - elements are projected using short names. - 9/1/98 jhrg */ - /* var->set_send_p(true); */ - //table.mark(name, true); - // We don't call mark() here for an array. Instead it is called from - // within the parser. jhrg 10/10/08 - process_array_indices(var, indices); // throws on error - delete_array_indices(indices); + /* calls to set_send_p should be replaced with + calls to DDS::mark so that arrays of Structures, + etc. will be processed correctly when individual + elements are projected using short names. + 9/1/98 jhrg */ + /* var->set_send_p(true); */ + //table.mark(name, true); + // We don't call mark() here for an array. Instead it is called from + // within the parser. jhrg 10/10/08 + process_array_indices(var, indices); // throws on error + delete_array_indices(indices); } else if (is_grid_t(var)) { - process_grid_indices(var, indices); + process_grid_indices(var, indices); table.mark(name, true); - delete_array_indices(indices); + delete_array_indices(indices); } else if (is_sequence_t(var)) { - table.mark(name, true); - process_sequence_indices(var, indices); - delete_array_indices(indices); + table.mark(name, true); + process_sequence_indices(var, indices); + delete_array_indices(indices); } else if ((seq = parent_is_sequence(table, name))) { - process_sequence_indices(seq, indices); + process_sequence_indices(seq, indices); table.mark(name, true); - delete_array_indices(indices); + delete_array_indices(indices); } else { - return false; + return false; } - + return true; } // Given three values (I1, I2, I3), all of which must be integers, build an // int_list which contains those values. +// +// Note that we added support for * in the rightmost position of an index +// (i.e., [*], [n:*], [n:m:*]) and indicate that star using -1 as an index value. +// Bescause of this change, the test for the type of the rightmost value in +// the index subexpr was changed to include signed int. +// jhrg 12/20/12 // // Returns: A pointer to an int_list of three integers or NULL if any of the // values are not integers. @@ -2221,21 +2722,18 @@ int_list * make_array_index(value &i1, value &i2, value &i3) { - if (i1.type != dods_uint32_c - || i2.type != dods_uint32_c - || i3.type != dods_uint32_c) - return (int_list *)0; + if (i1.type != dods_uint32_c || i2.type != dods_uint32_c || (i3.type != dods_uint32_c && i3.type != dods_int32_c)) + return (int_list *) 0; int_list *index = new int_list; - index->push_back((int)i1.v.i); - index->push_back((int)i2.v.i); - index->push_back((int)i3.v.i); - - DBG(cout << "index: ";\ - for (int_iter dp = index->begin(); dp != index->end(); dp++)\ - cout << (*dp) << " ";\ - cout << endl); + index->push_back((int) i1.v.i); + index->push_back((int) i2.v.i); + index->push_back((int) i3.v.i); + + DBG(cout << "index: "); + DBG(copy(index->begin(), index->end(), ostream_iterator(cerr, " "))); + DBG(cerr << endl); return index; } @@ -2243,19 +2741,18 @@ int_list * make_array_index(value &i1, value &i2) { - if (i1.type != dods_uint32_c || i2.type != dods_uint32_c) - return (int_list *)0; + if (i1.type != dods_uint32_c || (i2.type != dods_uint32_c && i2.type != dods_int32_c)) + return (int_list *) 0; int_list *index = new int_list; - - index->push_back((int)i1.v.i); + + index->push_back((int) i1.v.i); index->push_back(1); - index->push_back((int)i2.v.i); + index->push_back((int) i2.v.i); - DBG(cout << "index: ";\ - for (int_citer dp = index->begin(); dp != index->end(); dp++)\ - cout << (*dp) << " ";\ - cout << endl); + DBG(cout << "index: "); + DBG(copy(index->begin(), index->end(), ostream_iterator(cerr, " "))); + DBG(cerr << endl); return index; } @@ -2263,19 +2760,24 @@ int_list * make_array_index(value &i1) { - if (i1.type != dods_uint32_c) - return (int_list *)0; + if (i1.type != dods_uint32_c && i1.type != dods_int32_c) + return (int_list *) 0; int_list *index = new int_list; - index->push_back((int)i1.v.i); + // When the CE is Array[*] that means all of the elements, but the value + // of i1 will be -1. Make the projection triple be 0:1:-1 which is a + // pattern that libdap::Array will recognize. + if (i1.v.i == -1) + index->push_back(0); + else + index->push_back((int) i1.v.i); index->push_back(1); - index->push_back((int)i1.v.i); + index->push_back((int) i1.v.i); - DBG(cout << "index: ";\ - for (int_citer dp = index->begin(); dp != index->end(); dp++)\ - cout << (*dp) << " ";\ - cout << endl); + DBG(cout << "index: "); + DBG(copy(index->begin(), index->end(), ostream_iterator(cerr, " "))); + DBG(cerr << endl); return index; } @@ -2285,10 +2787,9 @@ { int_list_list *indices = new int_list_list; - DBG(cout << "index: ";\ - for (int_citer dp = index->begin(); dp != index->end(); dp++)\ - cout << (*dp) << " ";\ - cout << endl); + DBG(cout << "index: "); + DBG(copy(index->begin(), index->end(), ostream_iterator(cerr, " "))); + DBG(cerr << endl); assert(index); indices->push_back(index); @@ -2309,13 +2810,12 @@ // Delete an array indices list. -void -delete_array_indices(int_list_list *indices) +void delete_array_indices(int_list_list *indices) { assert(indices); for (int_list_citer i = indices->begin(); i != indices->end(); i++) { - int_list *il = *i ; + int_list *il = *i; assert(il); delete il; } @@ -2323,8 +2823,7 @@ delete indices; } -bool -is_array_t(BaseType *variable) +bool is_array_t(BaseType *variable) { assert(variable); @@ -2334,8 +2833,7 @@ return true; } -bool -is_grid_t(BaseType *variable) +bool is_grid_t(BaseType *variable) { assert(variable); @@ -2345,8 +2843,7 @@ return true; } -bool -is_sequence_t(BaseType *variable) +bool is_sequence_t(BaseType *variable) { assert(variable); @@ -2356,221 +2853,188 @@ return true; } -void -process_array_indices(BaseType *variable, int_list_list *indices) +void process_array_indices(BaseType *variable, int_list_list *indices) { assert(variable); Array *a = dynamic_cast(variable); // replace with dynamic cast if (!a) - throw Error(malformed_expr, - string("The constraint expression evaluator expected an array; ") - + variable->name() + " is not an array."); - - if (a->dimensions(true) != (unsigned)indices->size()) - throw Error(malformed_expr, - string("Error: The number of dimensions in the constraint for ") - + variable->name() - + " must match the number in the array."); - - DBG(cerr << "Before clear_constraint:" << endl); - DBG(a->print_decl(cerr, "", true, false, true)); + throw Error(malformed_expr, + string("The constraint expression evaluator expected an array; ") + variable->name() + " is not an array."); - // a->reset_constraint(); // each projection erases the previous one + if (a->dimensions(true) != (unsigned) indices->size()) + throw Error(malformed_expr, + string("Error: The number of dimensions in the constraint for ") + variable->name() + + " must match the number in the array."); - DBG(cerr << "After reset_constraint:" << endl); + DBG(cerr << "Before applying projection to array:" << endl); DBG(a->print_decl(cerr, "", true, false, true)); assert(indices); - int_list_citer p = indices->begin() ; - Array::Dim_iter r = a->dim_begin() ; + + int_list_citer p = indices->begin(); + Array::Dim_iter r = a->dim_begin(); for (; p != indices->end() && r != a->dim_end(); p++, r++) { - int_list *index = *p; - assert(index); - - int_citer q = index->begin(); - assert(q!=index->end()); - int start = *q; - - q++; - int stride = *q; - - q++; - int stop = *q; - - q++; - if (q != index->end()) { - throw Error(malformed_expr, - string("Too many values in index list for ") - + a->name() + "."); - } + int_list *index = *p; + assert(index); - DBG(cerr << "process_array_indices: Setting constraint on "\ - << a->name() << "[" << start << ":" << stop << "]" << endl); + int_citer q = index->begin(); + assert(q != index->end()); + int start = *q; + + q++; + int stride = *q; + + q++; + int stop = *q; + + q++; + if (q != index->end()) + throw Error(malformed_expr, string("Too many values in index list for ") + a->name() + "."); + + DBG(cerr << "process_array_indices: Setting constraint on " + << a->name() << "[" << start << ":" << stop << "]" + << endl); // It's possible that an array will appear more than once in a CE // (for example, if an array of structures is constrained so that // only two fields are projected and there's an associated hyperslab). // However, in this case the two hyperslabs must be equal; test for - // that here. But see clear_constraint above... 10/28/08 jhrg + // that here. + // + // We added '*' to mean 'the last element' in the array and use an index of -1 + // to indicate that. If 'stop' is -1, don't test it here because dimension_stop() + // won't be -1 but the actual ending index of the array. jhrg 12/20/12 - if (a->send_p() - && (a->dimension_start(r, true) != start - || a->dimension_stop(r, true) != stop - || a->dimension_stride(r, true) != stride)) + if (a->send_p() && (a->dimension_start(r, true) != start || (a->dimension_stop(r, true) != stop && stop != -1) + || a->dimension_stride(r, true) != stride)) throw Error(malformed_expr, - string("The Array was already projected differently in the constraint expression: ") - + a->name() + "."); - - a->add_constraint(r, start, stride, stop); + string("The Array was already projected differently in the constraint expression: ") + a->name() + "."); - DBG(cerr << "Set Constraint: " << a->dimension_size(r, true) << endl); + a->add_constraint(r, start, stride, stop); + + DBG(cerr << "Set Constraint: " << a->dimension_size(r, true) << endl); } - DBG(cerr << "After processing loop:" << endl); + DBG(cerr << "After applying projection to array:" << endl); DBG(a->print_decl(cerr, "", true, false, true)); - DBG(cout << "Array Constraint: ";\ - for (Array::Dim_iter dp = a->dim_begin(); dp != a->dim_end(); dp++)\ - cout << a->dimension_size(dp, true) << " ";\ - cout << endl); - - if (p != indices->end() && r == a->dim_end()) { - throw Error(malformed_expr, - string("Too many indices in constraint for ") - + a->name() + "."); - } + + if (p != indices->end() && r == a->dim_end()) + throw Error(malformed_expr, string("Too many indices in constraint for ") + a->name() + "."); } -void -process_grid_indices(BaseType *variable, int_list_list *indices) +void process_grid_indices(BaseType *variable, int_list_list *indices) { assert(variable); assert(variable->type() == dods_grid_c); Grid *g = dynamic_cast(variable); if (!g) - throw Error(unknown_error, "Expected a Grid variable"); + throw Error(unknown_error, "Expected a Grid variable"); Array *a = g->get_array(); -#if 0 - // This test s now part of Grid::get_array(). jhrg 3/5/09 - if (!a) - throw InternalErr(__FILE__, __LINE__, "Malformed Grid variable"); -#endif - if (a->dimensions(true) != (unsigned)indices->size()) - throw Error(malformed_expr, - string("Error: The number of dimensions in the constraint for ") - + variable->name() + + if (a->dimensions(true) != (unsigned) indices->size()) + throw Error(malformed_expr, + string("Error: The number of dimensions in the constraint for ") + variable->name() + " must match the number in the grid."); - + // First do the constraints on the ARRAY in the grid. process_array_indices(g->array_var(), indices); // Now process the maps. - Grid::Map_iter r = g->map_begin() ; + Grid::Map_iter r = g->map_begin(); // Suppress all maps by default. - for (; r != g->map_end(); r++) - { - (*r)->set_send_p(false); + for (; r != g->map_end(); r++) { + (*r)->set_send_p(false); } // Add specified maps to the current projection. assert(indices); int_list_citer p = indices->begin(); - r = g->map_begin(); - for (; p != indices->end() && r != g->map_end(); p++, r++) - { - int_list *index = *p; - assert(index); - - int_citer q = index->begin(); - assert(q != index->end()); - int start = *q; - - q++; - int stride = *q; - - q++; - int stop = *q; - - BaseType *btp = *r; - assert(btp); - assert(btp->type() == dods_array_c); - Array *a = (Array *)btp; - a->set_send_p(true); - a->reset_constraint(); - - q++; - if (q!=index->end()) { - throw Error(malformed_expr, - string("Too many values in index list for ") - + a->name() + "."); - } + r = g->map_begin(); + for (; p != indices->end() && r != g->map_end(); p++, r++) { + int_list *index = *p; + assert(index); + + int_citer q = index->begin(); + assert(q != index->end()); + int start = *q; + + q++; + int stride = *q; + + q++; + int stop = *q; + + BaseType *btp = *r; + assert(btp); + assert(btp->type() == dods_array_c); + Array *a = (Array *) btp; + a->set_send_p(true); + a->reset_constraint(); + + q++; + if (q != index->end()) { + throw Error(malformed_expr, string("Too many values in index list for ") + a->name() + "."); + } + + DBG(cerr << "process_grid_indices: Setting constraint on " + << a->name() << "[" << start << ":" + << stop << "]" << endl); + + Array::Dim_iter si = a->dim_begin(); + a->add_constraint(si, start, stride, stop); - DBG(cerr << "process_grid_indices: Setting constraint on "\ - << a->name() << "[" << start << ":" << stop << "]" << endl); + } - Array::Dim_iter si = a->dim_begin() ; - a->add_constraint(si, start, stride, stop); + DBG(cout << "Grid Constraint: "; + for (Array::Dim_iter dp = ((Array *) g->array_var())->dim_begin(); + dp != ((Array *) g->array_var())->dim_end(); dp++) + cout << ((Array *) g->array_var())->dimension_size(dp, true) << " "; + cout << endl + ); - DBG(Array::Dim_iter aiter = a->dim_begin() ; \ - cerr << "Set Constraint: " \ - << a->dimension_size(aiter, true) << endl); - } - - DBG(cout << "Grid Constraint: ";\ - for (Array::Dim_iter dp = ((Array *)g->array_var())->dim_begin(); - dp != ((Array *)g->array_var())->dim_end(); \ - dp++)\ - cout << ((Array *)g->array_var())->dimension_size(dp, true) << " ";\ - cout << endl); - - if (p!=indices->end() && r==g->map_end()) { - throw Error(malformed_expr, - string("Too many indices in constraint for ") - + (*r)->name() + "."); + if (p != indices->end() && r == g->map_end()) { + throw Error(malformed_expr, + string("Too many indices in constraint for ") + (*r)->name() + "."); } } -void -process_sequence_indices(BaseType *variable, int_list_list *indices) +void process_sequence_indices(BaseType *variable, int_list_list *indices) { assert(variable); assert(variable->type() == dods_sequence_c); - Sequence *s = dynamic_cast(variable); + Sequence *s = dynamic_cast (variable); if (!s) - throw Error(malformed_expr, "Expected a Sequence variable"); + throw Error(malformed_expr, "Expected a Sequence variable"); // Add specified maps to the current projection. assert(indices); - for (int_list_citer p = indices->begin(); p != indices->end(); p++) - { - int_list *index = *p; - assert(index); - - int_citer q = index->begin(); - assert(q!=index->end()); - int start = *q; - - q++; - int stride = *q; - - q++; - int stop = *q; - - q++; - if (q!=index->end()) { - throw Error(malformed_expr, - string("Too many values in index list for ") - + s->name() + "."); - } + for (int_list_citer p = indices->begin(); p != indices->end(); p++) { + int_list *index = *p; + assert(index); + + int_citer q = index->begin(); + assert(q != index->end()); + int start = *q; + + q++; + int stride = *q; + + q++; + int stop = *q; + + q++; + if (q != index->end()) { + throw Error(malformed_expr, string("Too many values in index list for ") + s->name() + "."); + } - s->set_row_number_constraint(start, stop, stride); + s->set_row_number_constraint(start, stop, stride); } } - // Given a value, wrap it up in a BaseType and return a pointer to the same. BaseType * @@ -2578,30 +3042,36 @@ { BaseType *var; switch (val.type) { - case dods_int32_c: { - var = new Int32("dummy"); - var->val2buf((void *)&val.v.i); - break; - } + case dods_int32_c: { + var = new Int32("dummy"); + var->val2buf((void *) &val.v.i); + break; + } - case dods_float64_c: { - var = new Float64("dummy"); - var->val2buf((void *)&val.v.f); - break; - } + case dods_uint32_c: { + var = new UInt32("dummy"); + var->val2buf((void *) &val.v.i); + break; + } - case dods_str_c: { - var = new Str("dummy"); - var->val2buf((void *)val.v.s); - break; - } + case dods_float64_c: { + var = new Float64("dummy"); + var->val2buf((void *) &val.v.f); + break; + } - default: - var = (BaseType *)0; - return var; + case dods_str_c: { + var = new Str("dummy"); + var->val2buf((void *) val.v.s); + break; } - var->set_read_p(true); // ...so the evaluator will know it has data + default: + var = (BaseType *) 0; + return var; + } + + var->set_read_p(true); // ...so the evaluator will know it has data eval.append_constant(var); return var; @@ -2613,37 +3083,80 @@ // // Returns: A pointer to the function or NULL if not such function exists. -bool_func -get_function(const ConstraintEvaluator &eval, const char *name) +bool_func get_function(const ConstraintEvaluator &eval, const char *name) { bool_func f; if (eval.find_function(name, &f)) - return f; + return f; else - return 0; + return 0; } -btp_func -get_btp_function(const ConstraintEvaluator &eval, const char *name) +btp_func get_btp_function(const ConstraintEvaluator &eval, const char *name) { btp_func f; if (eval.find_function(name, &f)) - return f; + return f; else - return 0; + return 0; } -proj_func -get_proj_function(const ConstraintEvaluator &eval, const char *name) +proj_func get_proj_function(const ConstraintEvaluator &eval, const char *name) { proj_func f; if (eval.find_function(name, &f)) - return f; + return f; else - return 0; + return 0; +} + +template +arg_type_list +make_fast_arg_list(unsigned long vector_size_hint, arg_type value) +{ + arg_type_list args = new std::vector; + + if (vector_size_hint > 0) args->reserve(vector_size_hint); + + args->push_back(value); + return args; +} + +template +arg_type_list +make_fast_arg_list(arg_type_list values, arg_type value) +{ + values->push_back(value); + return values; +} + +template +rvalue *build_constant_array(vector *values, DDS *dds) +{ + //vector *values = $5; + + T i(""); + Array *array = new Array("", &i); + array->append_dim(values->size()); + + // TODO Make set_value_nocopy() methods so that values' pointers can be copied + // instead of allocating memory twice. jhrg 7/5/13 + + array->set_value(*values, values->size()); + delete values; + array->set_read_p(true); + + static unsigned long counter = 1; + string name; + do { + name = "g" + long_to_string(counter++); + } while (dds->var(name)); + array->set_name(name); + + return new rvalue(array); } diff -Nru libdap-3.11.1/ce_expr.tab.hh libdap-3.12.0/ce_expr.tab.hh --- libdap-3.11.1/ce_expr.tab.hh 2011-05-06 17:50:24.000000000 +0000 +++ libdap-3.12.0/ce_expr.tab.hh 2013-10-17 21:27:40.000000000 +0000 @@ -1,24 +1,23 @@ -/* A Bison parser, made by GNU Bison 2.3. */ -/* Skeleton interface for Bison's Yacc-like parsers in C +/* A Bison parser, made by GNU Bison 2.4.1. */ - Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004, 2005, 2006 +/* Skeleton interface for Bison's Yacc-like parsers in C + + Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc. - - This program is free software; you can redistribute it and/or modify + + This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2, or (at your option) - any later version. - + the Free Software Foundation, either version 3 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., 51 Franklin Street, Fifth Floor, - Boston, MA 02110-1301, USA. */ + along with this program. If not, see . */ /* As a special exception, you may create a larger work that contains part or all of the Bison parser skeleton and distribute that work @@ -29,10 +28,114 @@ special exception, which will cause the skeleton and the resulting Bison output files to be licensed under the GNU General Public License without this special exception. - + This special exception was added by the Free Software Foundation in version 2.2 of Bison. */ +/* "%code requires" blocks. */ + +/* Line 1676 of yacc.c */ +#line 41 "ce_expr.yy" + + +#include "config.h" + +#include +#include +#include + +#include +#include +#include +#include +#include + +//#define DODS_DEBUG + +#include "debug.h" +#include "escaping.h" + +#include "DDS.h" +#include "ConstraintEvaluator.h" + +#include "BaseType.h" + +#include "Byte.h" +#include "Int16.h" +#include "UInt16.h" +#include "Int32.h" +#include "UInt32.h" +#include "Float32.h" +#include "Float64.h" +#include "Str.h" +#include "Url.h" +#include "Array.h" +#include "Structure.h" +#include "Sequence.h" +#include "Grid.h" + +#include "Error.h" + +#include "util.h" +#include "parser.h" +#include "ce_parser.h" +#include "expr.h" +#include "RValue.h" + +using std::cerr; +using std::endl; +using namespace libdap ; + +#define EVALUATOR(arg) (static_cast(arg)->get_eval()) +#define DDS(arg) (static_cast(arg)->get_dds()) + +// #define YYPARSE_PARAM arg + +int ce_exprlex(void); /* the scanner; see expr.lex */ + +void ce_exprerror(ce_parser_arg *arg, const string &s); +void ce_exprerror(ce_parser_arg *arg, const string &s, const string &s2); +void no_such_func(ce_parser_arg *arg, const string &name); +void no_such_ident(ce_parser_arg *arg, const string &name, const string &word); + +int_list *make_array_index(value &i1, value &i2, value &i3); +int_list *make_array_index(value &i1, value &i2); +int_list *make_array_index(value &i1); +int_list_list *make_array_indices(int_list *index); +int_list_list *append_array_index(int_list_list *indices, int_list *index); + +void delete_array_indices(int_list_list *indices); +bool bracket_projection(DDS &table, const char *name, int_list_list *indices); + +void process_array_indices(BaseType *variable, int_list_list *indices); +void process_grid_indices(BaseType *variable, int_list_list *indices); +void process_sequence_indices(BaseType *variable, int_list_list *indices); + +/* Replace these with method calls. jhrg 8/31/06 */ +bool is_array_t(BaseType *variable); +bool is_grid_t(BaseType *variable); +bool is_sequence_t(BaseType *variable); + +BaseType *make_variable(ConstraintEvaluator &eval, const value &val); +bool_func get_function(const ConstraintEvaluator &eval, const char *name); +btp_func get_btp_function(const ConstraintEvaluator &eval, const char *name); +proj_func get_proj_function(const ConstraintEvaluator &eval, const char *name); + +template +arg_list make_fast_arg_list(unsigned long vector_size_hint, arg_type arg_value); + +template +arg_list make_fast_arg_list(arg_list int_values, arg_type arg_value); + +template +rvalue *build_constant_array(vector *values, DDS *dds); + + + + +/* Line 1676 of yacc.c */ +#line 138 "ce_expr.tab.hh" + /* Tokens. */ #ifndef YYTOKENTYPE # define YYTOKENTYPE @@ -47,31 +150,47 @@ SCAN_GREATER_EQL = 263, SCAN_LESS = 264, SCAN_LESS_EQL = 265, - SCAN_REGEXP = 266 + SCAN_REGEXP = 266, + SCAN_STAR = 267, + SCAN_HASH_BYTE = 268, + SCAN_HASH_INT16 = 269, + SCAN_HASH_UINT16 = 270, + SCAN_HASH_INT32 = 271, + SCAN_HASH_UINT32 = 272, + SCAN_HASH_FLOAT32 = 273, + SCAN_HASH_FLOAT64 = 274 }; #endif -/* Tokens. */ -#define SCAN_STR 258 -#define SCAN_WORD 259 -#define SCAN_EQUAL 260 -#define SCAN_NOT_EQUAL 261 -#define SCAN_GREATER 262 -#define SCAN_GREATER_EQL 263 -#define SCAN_LESS 264 -#define SCAN_LESS_EQL 265 -#define SCAN_REGEXP 266 - #if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED typedef union YYSTYPE -#line 130 "ce_expr.y" { + +/* Line 1676 of yacc.c */ +#line 145 "ce_expr.yy" + bool boolean; int op; char id[ID_MAX]; - + + libdap::dods_byte byte_value; + libdap::dods_int16 int16_value; + libdap::dods_uint16 uint16_value; + libdap::dods_int32 int32_value; + libdap::dods_uint32 uint32_value; + libdap::dods_float32 float32_value; + libdap::dods_float64 float64_value; + + libdap::byte_arg_list byte_values; + libdap::int16_arg_list int16_values; + libdap::uint16_arg_list uint16_values; + libdap::int32_arg_list int32_values; + libdap::uint32_arg_list uint32_values; + libdap::float32_arg_list float32_values; + libdap::float64_arg_list float64_values; + libdap::value val; // value is defined in expr.h libdap::bool_func b_func; @@ -82,14 +201,17 @@ libdap::rvalue *rval_ptr; libdap::rvalue_list *r_val_l_ptr; -} -/* Line 1489 of yacc.c. */ -#line 88 "ce_expr.tab.hh" - YYSTYPE; + + + +/* Line 1676 of yacc.c */ +#line 209 "ce_expr.tab.hh" +} YYSTYPE; +# define YYSTYPE_IS_TRIVIAL 1 # define yystype YYSTYPE /* obsolescent; will be withdrawn */ # define YYSTYPE_IS_DECLARED 1 -# define YYSTYPE_IS_TRIVIAL 1 #endif extern YYSTYPE ce_exprlval; + diff -Nru libdap-3.11.1/ce_expr.y libdap-3.12.0/ce_expr.y --- libdap-3.11.1/ce_expr.y 2011-04-29 13:19:43.000000000 +0000 +++ libdap-3.12.0/ce_expr.y 1970-01-01 00:00:00.000000000 +0000 @@ -1,1080 +0,0 @@ - -// -*- mode: c++; c-basic-offset:4 -*- - -// This file is part of libdap, A C++ implementation of the OPeNDAP Data -// Access Protocol. - -// Copyright (c) 2002,2003 OPeNDAP, Inc. -// Author: James Gallagher -// -// This library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Lesser General Public -// License as published by the Free Software Foundation; either -// version 2.1 of the License, or (at your option) any later version. -// -// This library 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 -// Lesser General Public License for more details. -// -// You should have received a copy of the GNU Lesser General Public -// License along with this library; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -// -// You can contact OPeNDAP, Inc. at PO Box 112, Saunderstown, RI. 02874-0112. - -// (c) COPYRIGHT URI/MIT 1995-1999 -// Please read the full copyright statement in the file COPYRIGHT_URI. -// -// Authors: -// jhrg,jimg James Gallagher - -/* - This is the parser for the DODS constraint expression grammar. The parser - calls various `helper' functions defined by the DAP classes which either - implement the operations (in the case of relational ops) or store - information (in the case of selection operations). - - jhrg 9/5/95 -*/ - -%{ - -#include "config.h" - -static char rcsid[] not_used = {"$Id: ce_expr.y 21578 2009-10-02 16:26:26Z jimg $"}; - -#include -#include -#include -#include -#include - -#include "debug.h" -#include "escaping.h" - -#include "DDS.h" -#include "ConstraintEvaluator.h" - -#include "BaseType.h" - -#include "Byte.h" -#include "Int16.h" -#include "UInt16.h" -#include "Int32.h" -#include "UInt32.h" -#include "Float32.h" -#include "Float64.h" -#include "Str.h" -#include "Url.h" -#include "Array.h" -#include "Structure.h" -#include "Sequence.h" -#include "Grid.h" - -#include "Error.h" - -#include "util.h" -#include "parser.h" -#include "ce_parser.h" -#include "expr.h" -#include "RValue.h" - -using std::cerr; -using std::endl; -using namespace libdap ; - -#define EVALUATOR(arg) (static_cast(arg)->get_eval()) -#define DDS(arg) (static_cast(arg)->get_dds()) - -#define YYPARSE_PARAM arg - -int ce_exprlex(void); /* the scanner; see expr.lex */ - -void ce_exprerror(const char *s); /* easier to overload than to use stdarg... */ -void ce_exprerror(const char *s, const char *s2); -void no_such_func(char *name); -void no_such_ident(char *name, char *word); - -void ce_exprerror(const string &s); -void ce_exprerror(const string &s, const string &s2); -void no_such_func(const string &name); -void no_such_ident(const string &name, const string &word); - -int_list *make_array_index(value &i1, value &i2, value &i3); -int_list *make_array_index(value &i1, value &i2); -int_list *make_array_index(value &i1); -int_list_list *make_array_indices(int_list *index); -int_list_list *append_array_index(int_list_list *indices, int_list *index); - -void delete_array_indices(int_list_list *indices); -bool bracket_projection(DDS &table, const char *name, - int_list_list *indices); - -void process_array_indices(BaseType *variable, int_list_list *indices); -void process_grid_indices(BaseType *variable, int_list_list *indices); -void process_sequence_indices(BaseType *variable, int_list_list *indices); - -/* Replace these with method calls. jhrg 8/31/06 */ -bool is_array_t(BaseType *variable); -bool is_grid_t(BaseType *variable); -bool is_sequence_t(BaseType *variable); - -BaseType *make_variable(ConstraintEvaluator &eval, const value &val); -bool_func get_function(const ConstraintEvaluator &eval, const char *name); -btp_func get_btp_function(const ConstraintEvaluator &eval, const char *name); -proj_func get_proj_function(const ConstraintEvaluator &eval, const char *name); - -%} - -%union { - bool boolean; - int op; - char id[ID_MAX]; - - libdap::value val; // value is defined in expr.h - - libdap::bool_func b_func; - libdap::btp_func bt_func; - - libdap::int_list *int_l_ptr; - libdap::int_list_list *int_ll_ptr; - - libdap::rvalue *rval_ptr; - libdap::rvalue_list *r_val_l_ptr; -} - -%token SCAN_STR - -%token SCAN_WORD - -%token SCAN_EQUAL -%token SCAN_NOT_EQUAL -%token SCAN_GREATER -%token SCAN_GREATER_EQL -%token SCAN_LESS -%token SCAN_LESS_EQL -%token SCAN_REGEXP - -%type constraint_expr projection proj_clause proj_function -%type array_projection selection clause bool_function -%type array_proj_clause name -%type rel_op -%type array_index -%type array_indices -%type r_value id_or_const -%type r_value_list arg_list - -%% - -constraint_expr: /* empty constraint --> send all */ - { - DDS(arg)->mark_all(true); - $$ = true; - } - /* projection only */ - | projection - /* selection only --> project everything */ - | '&' { DDS(arg)->mark_all(true); } selection - { - $$ = $3; - } - | projection '&' selection - { - $$ = $1 && $3; - } -; - -projection: proj_clause - | proj_clause ',' projection - { - $$ = $1 && $3; - } -; - -proj_clause: name - { - BaseType *var = DDS(arg)->var($1); - if (var) { - DBG(cerr << "Marking " << $1 << endl); - $$ = DDS(arg)->mark($1, true); - DBG(cerr << "result: " << $$ << endl); - } - else { - no_such_ident($1, "identifier"); - } - } -/* | SCAN_STR - { - if ($1.type != dods_str_c || $1.v.s == 0 || $1.v.s->empty()) - ce_exprerror("Malformed string", ""); - - BaseType *var = DDS(arg)->var(*($1.v.s)); - if (var) { - DBG(cerr << "Marking " << $1 << endl); - $$ = DDS(arg)->mark(*($1.v.s), true); - DBG(cerr << "result: " << $$ << endl); - } - else { - no_such_ident(*($1.v.s), "identifier"); - } - } -*/ - | proj_function - { - $$ = $1; - } - | array_projection - { - $$ = $1; - } -; - -proj_function: SCAN_WORD '(' arg_list ')' - { - proj_func p_f = 0; - btp_func f = 0; - - if ((f = get_btp_function(*(EVALUATOR(arg)), $1))) { - EVALUATOR(arg)->append_clause(f, $3); - $$ = true; - } - else if ((p_f = get_proj_function(*(EVALUATOR(arg)), $1))) { - DDS &dds = dynamic_cast(*(DDS(arg))); - BaseType **args = build_btp_args( $3, dds ); - (*p_f)(($3) ? $3->size():0, args, dds, *(EVALUATOR(arg))); - delete[] args; - $$ = true; - } - else { - no_such_func($1); - } - } -; - -selection: clause - | selection '&' clause - { - $$ = $1 && $3; - } -; - -clause: r_value rel_op '{' r_value_list '}' - { - if ($1) { - EVALUATOR(arg)->append_clause($2, $1, $4); - $$ = true; - } - else - $$ = false; - } - | r_value rel_op r_value - { - if ($1) { - rvalue_list *rv = new rvalue_list; - rv->push_back($3); - EVALUATOR(arg)->append_clause($2, $1, rv); - $$ = true; - } - else - $$ = false; - } - | bool_function - { - $$ = $1; - } -; - -bool_function: SCAN_WORD '(' arg_list ')' - { - bool_func b_func = get_function((*EVALUATOR(arg)), $1); - if (!b_func) { - no_such_func($1); - } - else { - EVALUATOR(arg)->append_clause(b_func, $3); - $$ = true; - } - } -; - -r_value: id_or_const - | SCAN_WORD '(' arg_list ')' - { - btp_func func = get_btp_function((*EVALUATOR(arg)), $1); - if (func) { - $$ = new rvalue(func, $3); - } - else { - no_such_func($1); - } - } -; - -r_value_list: r_value - { - if ($1) - $$ = make_rvalue_list($1); - else - $$ = 0; - } - | r_value_list ',' r_value - { - if ($1 && $3) - $$ = append_rvalue_list($1, $3); - else - $$ = 0; - } -; - -arg_list: r_value_list - { - $$ = $1; - } - | /* Null, argument lists may be empty */ - { - $$ = 0; - } -; - -id_or_const: SCAN_WORD - { - BaseType *btp = DDS(arg)->var(www2id(string($1))); - if (btp) { - btp->set_in_selection(true); - $$ = new rvalue(btp); - } - else { - value new_val; - if (check_int32($1)) { - new_val.type = dods_int32_c; - new_val.v.i = atoi($1); - } - else if (check_uint32($1)) { - new_val.type = dods_uint32_c; - new_val.v.ui = atoi($1); - } - else if (check_float64($1)) { - new_val.type = dods_float64_c; - new_val.v.f = atof($1); - } - else { - new_val.type = dods_str_c; - new_val.v.s = new string($1); - } - BaseType *btp = make_variable((*EVALUATOR(arg)), new_val); - // *** test for btp == null - // delete new_val.v.s; // Str::val2buf copies the value. - $$ = new rvalue(btp); - } - } - | SCAN_STR - { - if ($1.type != dods_str_c || $1.v.s == 0 || $1.v.s->empty()) - ce_exprerror("Malformed string", ""); - - BaseType *var = DDS(arg)->var(*($1.v.s)); - if (var) { - $$ = new rvalue(var); - } - else { - var = make_variable((*EVALUATOR(arg)), $1); - $$ = new rvalue(var); - } - } -; - -array_projection : array_proj_clause - { - $$ = (*DDS(arg)).mark($1, true); - } - -array_proj_clause: name array_indices - { - if (!bracket_projection((*DDS(arg)), $1, $2)) - no_such_ident($1, "array, grid or sequence"); - - strncpy($$, $1, ID_MAX-1); - $$[ID_MAX-1] = '\0'; - } - | array_proj_clause name - { - string name = string($1) + string ($2); - strncpy($$, name.c_str(), ID_MAX-1); - $$[ID_MAX-1] = '\0'; - } - | array_proj_clause name array_indices - { - string name = string($1) + string ($2); - if (!bracket_projection((*DDS(arg)), name.c_str(), $3)) - no_such_ident(name.c_str(), "array, grid or sequence"); - - strncpy($$, name.c_str(), ID_MAX-1); - $$[ID_MAX-1] = '\0'; - } -; - -name: SCAN_WORD - | SCAN_STR - { - if ($1.type != dods_str_c || $1.v.s == 0 || $1.v.s->empty()) - ce_exprerror("Malformed string", ""); - - strncpy($$, www2id(*($1.v.s)).c_str(), ID_MAX-1); - // delete the string? *** - $$[ID_MAX-1] = '\0'; -/* - BaseType *var = DDS(arg)->var(*($1.v.s)); - if (var) { - DBG(cerr << "Marking " << $1 << endl); - $$ = DDS(arg)->mark(*($1.v.s), true); - DBG(cerr << "result: " << $$ << endl); - } - else { - no_such_ident(*($1.v.s), "identifier"); - } -*/ - } -; - -array_indices: array_index - { - $$ = make_array_indices($1); - } - | array_indices array_index - { - $$ = append_array_index($1, $2); - } -; - -array_index: '[' SCAN_WORD ']' - { - if (!check_uint32($2)) { - string msg = "The word `"; - msg += string($2) + "' is not a valid array index."; - throw Error(malformed_expr, msg); - } - value i; - i.type = dods_uint32_c; - i.v.i = atoi($2); - $$ = make_array_index(i); - } - |'[' SCAN_WORD ':' SCAN_WORD ']' - { - if (!check_uint32($2)) { - string msg = "The word `"; - msg += string($2) + "' is not a valid array index."; - throw Error(malformed_expr, msg); - } - if (!check_uint32($4)) { - string msg = "The word `"; - msg += string($4) + "' is not a valid array index."; - throw Error(malformed_expr, msg); - } - value i,j; - i.type = j.type = dods_uint32_c; - i.v.i = atoi($2); - j.v.i = atoi($4); - $$ = make_array_index(i, j); - } - | '[' SCAN_WORD ':' SCAN_WORD ':' SCAN_WORD ']' - { - if (!check_uint32($2)) { - string msg = "The word `"; - msg += string($2) + "' is not a valid array index."; - throw Error(malformed_expr, msg); - } - if (!check_uint32($4)) { - string msg = "The word `"; - msg += string($4) + "' is not a valid array index."; - throw Error(malformed_expr, msg); - } - if (!check_uint32($6)) { - string msg = "The word `"; - msg += string($6) + "' is not a valid array index."; - throw Error(malformed_expr, msg); - } - value i, j, k; - i.type = j.type = k.type = dods_uint32_c; - i.v.i = atoi($2); - j.v.i = atoi($4); - k.v.i = atoi($6); - $$ = make_array_index(i, j, k); - } -; - -rel_op: SCAN_EQUAL - | SCAN_NOT_EQUAL - | SCAN_GREATER - | SCAN_GREATER_EQL - | SCAN_LESS - | SCAN_LESS_EQL - | SCAN_REGEXP -; - -%% - -// All these error reporting function now throw instances of Error. The expr -// parser no longer returns an error code to indicate and error. 2/16/2000 -// jhrg. - -void -ce_exprerror(const string &s) -{ - ce_exprerror(s.c_str()); -} - -void -ce_exprerror(const char *s) -{ - // cerr << "Expression parse error: " << s << endl; - string msg = "Constraint expression parse error: " + (string)s; - throw Error(malformed_expr, msg); -} - -void -ce_exprerror(const string &s, const string &s2) -{ - ce_exprerror(s.c_str(), s2.c_str()); -} - -void -ce_exprerror(const char *s, const char *s2) -{ - string msg = "Constraint expression parse error: " + (string)s + ": " - + (string)s2; - throw Error(malformed_expr, msg); -} - -void -no_such_ident(const string &name, const string &word) -{ - string msg = "No such " + word + " in dataset"; - ce_exprerror(msg.c_str(), name); -} - -void -no_such_ident(char *name, char *word) -{ - string msg = "No such " + (string)word + " in dataset"; - ce_exprerror(msg.c_str(), name); -} - -void -no_such_func(const string &name) -{ - no_such_func(name.c_str()); -} - -void -no_such_func(char *name) -{ - ce_exprerror("Not a registered function", name); -} - -/* If we're calling this, assume var is not a Sequence. But assume that the - name contains a dot and it's a separator. Look for the rightmost dot and - then look to see if the name to the left is a sequence. Return a pointer - to the sequence if it is otherwise return null. Uses tail-recursion to - 'walk' back from right to left looking at each dot. This way the sequence - will be found even if there are structures between the field and the - Sequence. */ -static Sequence * -parent_is_sequence(DDS &table, const string &n) -{ - string::size_type dotpos = n.find_last_of('.'); - if (dotpos == string::npos) - return 0; - - string s = n.substr(0, dotpos); - - // If the thing returned by table.var is not a Sequence, this cast - // will yield null. - Sequence *seq = dynamic_cast(table.var(s)); - if (seq) - return seq; - else - return parent_is_sequence(table, s); -} - - -bool -bracket_projection(DDS &table, const char *name, int_list_list *indices) -{ - BaseType *var = table.var(name); - Sequence *seq; // used in last else-if clause -#if 0 - Array *array; -#endif - if (!var) - return false; - - if (is_array_t(var)) { - /* calls to set_send_p should be replaced with - calls to DDS::mark so that arrays of Structures, - etc. will be processed correctly when individual - elements are projected using short names. - 9/1/98 jhrg */ - /* var->set_send_p(true); */ - //table.mark(name, true); - // We don't call mark() here for an array. Instead it is called from - // within the parser. jhrg 10/10/08 - process_array_indices(var, indices); // throws on error - delete_array_indices(indices); - } - else if (is_grid_t(var)) { - process_grid_indices(var, indices); - table.mark(name, true); - delete_array_indices(indices); - } - else if (is_sequence_t(var)) { - table.mark(name, true); - process_sequence_indices(var, indices); - delete_array_indices(indices); - } - else if ((seq = parent_is_sequence(table, name))) { - process_sequence_indices(seq, indices); - table.mark(name, true); - delete_array_indices(indices); - } - else { - return false; - } - - return true; -} - -// Given three values (I1, I2, I3), all of which must be integers, build an -// int_list which contains those values. -// -// Returns: A pointer to an int_list of three integers or NULL if any of the -// values are not integers. - -int_list * -make_array_index(value &i1, value &i2, value &i3) -{ - if (i1.type != dods_uint32_c - || i2.type != dods_uint32_c - || i3.type != dods_uint32_c) - return (int_list *)0; - - int_list *index = new int_list; - - index->push_back((int)i1.v.i); - index->push_back((int)i2.v.i); - index->push_back((int)i3.v.i); - - DBG(cout << "index: ";\ - for (int_iter dp = index->begin(); dp != index->end(); dp++)\ - cout << (*dp) << " ";\ - cout << endl); - - return index; -} - -int_list * -make_array_index(value &i1, value &i2) -{ - if (i1.type != dods_uint32_c || i2.type != dods_uint32_c) - return (int_list *)0; - - int_list *index = new int_list; - - index->push_back((int)i1.v.i); - index->push_back(1); - index->push_back((int)i2.v.i); - - DBG(cout << "index: ";\ - for (int_citer dp = index->begin(); dp != index->end(); dp++)\ - cout << (*dp) << " ";\ - cout << endl); - - return index; -} - -int_list * -make_array_index(value &i1) -{ - if (i1.type != dods_uint32_c) - return (int_list *)0; - - int_list *index = new int_list; - - index->push_back((int)i1.v.i); - index->push_back(1); - index->push_back((int)i1.v.i); - - DBG(cout << "index: ";\ - for (int_citer dp = index->begin(); dp != index->end(); dp++)\ - cout << (*dp) << " ";\ - cout << endl); - - return index; -} - -int_list_list * -make_array_indices(int_list *index) -{ - int_list_list *indices = new int_list_list; - - DBG(cout << "index: ";\ - for (int_citer dp = index->begin(); dp != index->end(); dp++)\ - cout << (*dp) << " ";\ - cout << endl); - - assert(index); - indices->push_back(index); - - return indices; -} - -int_list_list * -append_array_index(int_list_list *indices, int_list *index) -{ - assert(indices); - assert(index); - - indices->push_back(index); - - return indices; -} - -// Delete an array indices list. - -void -delete_array_indices(int_list_list *indices) -{ - assert(indices); - - for (int_list_citer i = indices->begin(); i != indices->end(); i++) { - int_list *il = *i ; - assert(il); - delete il; - } - - delete indices; -} - -bool -is_array_t(BaseType *variable) -{ - assert(variable); - - if (variable->type() != dods_array_c) - return false; - else - return true; -} - -bool -is_grid_t(BaseType *variable) -{ - assert(variable); - - if (variable->type() != dods_grid_c) - return false; - else - return true; -} - -bool -is_sequence_t(BaseType *variable) -{ - assert(variable); - - if (variable->type() != dods_sequence_c) - return false; - else - return true; -} - -void -process_array_indices(BaseType *variable, int_list_list *indices) -{ - assert(variable); - - Array *a = dynamic_cast(variable); // replace with dynamic cast - if (!a) - throw Error(malformed_expr, - string("The constraint expression evaluator expected an array; ") - + variable->name() + " is not an array."); - - if (a->dimensions(true) != (unsigned)indices->size()) - throw Error(malformed_expr, - string("Error: The number of dimensions in the constraint for ") - + variable->name() - + " must match the number in the array."); - - DBG(cerr << "Before clear_constraint:" << endl); - DBG(a->print_decl(cerr, "", true, false, true)); - - // a->reset_constraint(); // each projection erases the previous one - - DBG(cerr << "After reset_constraint:" << endl); - DBG(a->print_decl(cerr, "", true, false, true)); - - assert(indices); - int_list_citer p = indices->begin() ; - Array::Dim_iter r = a->dim_begin() ; - for (; p != indices->end() && r != a->dim_end(); p++, r++) { - int_list *index = *p; - assert(index); - - int_citer q = index->begin(); - assert(q!=index->end()); - int start = *q; - - q++; - int stride = *q; - - q++; - int stop = *q; - - q++; - if (q != index->end()) { - throw Error(malformed_expr, - string("Too many values in index list for ") - + a->name() + "."); - } - - DBG(cerr << "process_array_indices: Setting constraint on "\ - << a->name() << "[" << start << ":" << stop << "]" << endl); - - // It's possible that an array will appear more than once in a CE - // (for example, if an array of structures is constrained so that - // only two fields are projected and there's an associated hyperslab). - // However, in this case the two hyperslabs must be equal; test for - // that here. But see clear_constraint above... 10/28/08 jhrg - - if (a->send_p() - && (a->dimension_start(r, true) != start - || a->dimension_stop(r, true) != stop - || a->dimension_stride(r, true) != stride)) - throw Error(malformed_expr, - string("The Array was already projected differently in the constraint expression: ") - + a->name() + "."); - - a->add_constraint(r, start, stride, stop); - - DBG(cerr << "Set Constraint: " << a->dimension_size(r, true) << endl); - } - - DBG(cerr << "After processing loop:" << endl); - DBG(a->print_decl(cerr, "", true, false, true)); - - DBG(cout << "Array Constraint: ";\ - for (Array::Dim_iter dp = a->dim_begin(); dp != a->dim_end(); dp++)\ - cout << a->dimension_size(dp, true) << " ";\ - cout << endl); - - if (p != indices->end() && r == a->dim_end()) { - throw Error(malformed_expr, - string("Too many indices in constraint for ") - + a->name() + "."); - } -} - -void -process_grid_indices(BaseType *variable, int_list_list *indices) -{ - assert(variable); - assert(variable->type() == dods_grid_c); - Grid *g = dynamic_cast(variable); - if (!g) - throw Error(unknown_error, "Expected a Grid variable"); - - Array *a = g->get_array(); -#if 0 - // This test s now part of Grid::get_array(). jhrg 3/5/09 - if (!a) - throw InternalErr(__FILE__, __LINE__, "Malformed Grid variable"); -#endif - if (a->dimensions(true) != (unsigned)indices->size()) - throw Error(malformed_expr, - string("Error: The number of dimensions in the constraint for ") - + variable->name() - + " must match the number in the grid."); - - // First do the constraints on the ARRAY in the grid. - process_array_indices(g->array_var(), indices); - - // Now process the maps. - Grid::Map_iter r = g->map_begin() ; - - // Suppress all maps by default. - for (; r != g->map_end(); r++) - { - (*r)->set_send_p(false); - } - - // Add specified maps to the current projection. - assert(indices); - int_list_citer p = indices->begin(); - r = g->map_begin(); - for (; p != indices->end() && r != g->map_end(); p++, r++) - { - int_list *index = *p; - assert(index); - - int_citer q = index->begin(); - assert(q != index->end()); - int start = *q; - - q++; - int stride = *q; - - q++; - int stop = *q; - - BaseType *btp = *r; - assert(btp); - assert(btp->type() == dods_array_c); - Array *a = (Array *)btp; - a->set_send_p(true); - a->reset_constraint(); - - q++; - if (q!=index->end()) { - throw Error(malformed_expr, - string("Too many values in index list for ") - + a->name() + "."); - } - - DBG(cerr << "process_grid_indices: Setting constraint on "\ - << a->name() << "[" << start << ":" << stop << "]" << endl); - - Array::Dim_iter si = a->dim_begin() ; - a->add_constraint(si, start, stride, stop); - - DBG(Array::Dim_iter aiter = a->dim_begin() ; \ - cerr << "Set Constraint: " \ - << a->dimension_size(aiter, true) << endl); - } - - DBG(cout << "Grid Constraint: ";\ - for (Array::Dim_iter dp = ((Array *)g->array_var())->dim_begin(); - dp != ((Array *)g->array_var())->dim_end(); \ - dp++)\ - cout << ((Array *)g->array_var())->dimension_size(dp, true) << " ";\ - cout << endl); - - if (p!=indices->end() && r==g->map_end()) { - throw Error(malformed_expr, - string("Too many indices in constraint for ") - + (*r)->name() + "."); - } -} - -void -process_sequence_indices(BaseType *variable, int_list_list *indices) -{ - assert(variable); - assert(variable->type() == dods_sequence_c); - Sequence *s = dynamic_cast(variable); - if (!s) - throw Error(malformed_expr, "Expected a Sequence variable"); - - // Add specified maps to the current projection. - assert(indices); - for (int_list_citer p = indices->begin(); p != indices->end(); p++) - { - int_list *index = *p; - assert(index); - - int_citer q = index->begin(); - assert(q!=index->end()); - int start = *q; - - q++; - int stride = *q; - - q++; - int stop = *q; - - q++; - if (q!=index->end()) { - throw Error(malformed_expr, - string("Too many values in index list for ") - + s->name() + "."); - } - - s->set_row_number_constraint(start, stop, stride); - } -} - - -// Given a value, wrap it up in a BaseType and return a pointer to the same. - -BaseType * -make_variable(ConstraintEvaluator &eval, const value &val) -{ - BaseType *var; - switch (val.type) { - case dods_int32_c: { - var = new Int32("dummy"); - var->val2buf((void *)&val.v.i); - break; - } - - case dods_float64_c: { - var = new Float64("dummy"); - var->val2buf((void *)&val.v.f); - break; - } - - case dods_str_c: { - var = new Str("dummy"); - var->val2buf((void *)val.v.s); - break; - } - - default: - var = (BaseType *)0; - return var; - } - - var->set_read_p(true); // ...so the evaluator will know it has data - eval.append_constant(var); - - return var; -} - -// Given a string (passed in VAL), consult the DDS CE function lookup table -// to see if a function by that name exists. -// NB: function arguments are type-checked at run-time. -// -// Returns: A pointer to the function or NULL if not such function exists. - -bool_func -get_function(const ConstraintEvaluator &eval, const char *name) -{ - bool_func f; - - if (eval.find_function(name, &f)) - return f; - else - return 0; -} - -btp_func -get_btp_function(const ConstraintEvaluator &eval, const char *name) -{ - btp_func f; - - if (eval.find_function(name, &f)) - return f; - else - return 0; -} - -proj_func -get_proj_function(const ConstraintEvaluator &eval, const char *name) -{ - proj_func f; - - if (eval.find_function(name, &f)) - return f; - else - return 0; -} - diff -Nru libdap-3.11.1/ce_expr.yy libdap-3.12.0/ce_expr.yy --- libdap-3.11.1/ce_expr.yy 1970-01-01 00:00:00.000000000 +0000 +++ libdap-3.12.0/ce_expr.yy 2013-10-17 21:27:40.000000000 +0000 @@ -0,0 +1,1346 @@ + +// -*- mode: c++; c-basic-offset:4 -*- + +// This file is part of libdap, A C++ implementation of the OPeNDAP Data +// Access Protocol. + +// Copyright (c) 2002,2003 OPeNDAP, Inc. +// Author: James Gallagher +// +// This library is free software; you can redistribute it and/or +// modify it under the terms of the GNU Lesser General Public +// License as published by the Free Software Foundation; either +// version 2.1 of the License, or (at your option) any later version. +// +// This library 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 +// Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// +// You can contact OPeNDAP, Inc. at PO Box 112, Saunderstown, RI. 02874-0112. + +// (c) COPYRIGHT URI/MIT 1995-1999 +// Please read the full copyright statement in the file COPYRIGHT_URI. +// +// Authors: +// jhrg,jimg James Gallagher + +/* + This is the parser for the DODS constraint expression grammar. The parser + calls various `helper' functions defined by the DAP classes which either + implement the operations (in the case of relational ops) or store + information (in the case of selection operations). + + jhrg 9/5/95 +*/ + +%code requires { + +#include "config.h" + +#include +#include +#include + +#include +#include +#include +#include +#include + +//#define DODS_DEBUG + +#include "debug.h" +#include "escaping.h" + +#include "DDS.h" +#include "ConstraintEvaluator.h" + +#include "BaseType.h" + +#include "Byte.h" +#include "Int16.h" +#include "UInt16.h" +#include "Int32.h" +#include "UInt32.h" +#include "Float32.h" +#include "Float64.h" +#include "Str.h" +#include "Url.h" +#include "Array.h" +#include "Structure.h" +#include "Sequence.h" +#include "Grid.h" + +#include "Error.h" + +#include "util.h" +#include "parser.h" +#include "ce_parser.h" +#include "expr.h" +#include "RValue.h" + +using std::cerr; +using std::endl; +using namespace libdap ; + +#define EVALUATOR(arg) (static_cast(arg)->get_eval()) +#define DDS(arg) (static_cast(arg)->get_dds()) + +// #define YYPARSE_PARAM arg + +int ce_exprlex(void); /* the scanner; see expr.lex */ + +void ce_exprerror(ce_parser_arg *arg, const string &s); +void ce_exprerror(ce_parser_arg *arg, const string &s, const string &s2); +void no_such_func(ce_parser_arg *arg, const string &name); +void no_such_ident(ce_parser_arg *arg, const string &name, const string &word); + +int_list *make_array_index(value &i1, value &i2, value &i3); +int_list *make_array_index(value &i1, value &i2); +int_list *make_array_index(value &i1); +int_list_list *make_array_indices(int_list *index); +int_list_list *append_array_index(int_list_list *indices, int_list *index); + +void delete_array_indices(int_list_list *indices); +bool bracket_projection(DDS &table, const char *name, int_list_list *indices); + +void process_array_indices(BaseType *variable, int_list_list *indices); +void process_grid_indices(BaseType *variable, int_list_list *indices); +void process_sequence_indices(BaseType *variable, int_list_list *indices); + +/* Replace these with method calls. jhrg 8/31/06 */ +bool is_array_t(BaseType *variable); +bool is_grid_t(BaseType *variable); +bool is_sequence_t(BaseType *variable); + +BaseType *make_variable(ConstraintEvaluator &eval, const value &val); +bool_func get_function(const ConstraintEvaluator &eval, const char *name); +btp_func get_btp_function(const ConstraintEvaluator &eval, const char *name); +proj_func get_proj_function(const ConstraintEvaluator &eval, const char *name); + +template +arg_list make_fast_arg_list(unsigned long vector_size_hint, arg_type arg_value); + +template +arg_list make_fast_arg_list(arg_list int_values, arg_type arg_value); + +template +rvalue *build_constant_array(vector *values, DDS *dds); + +} + +%require "2.4" + +%parse-param {ce_parser_arg *arg} +%name-prefix "ce_expr" +%defines +%debug +%verbose + +%union { + bool boolean; + int op; + char id[ID_MAX]; + + libdap::dods_byte byte_value; + libdap::dods_int16 int16_value; + libdap::dods_uint16 uint16_value; + libdap::dods_int32 int32_value; + libdap::dods_uint32 uint32_value; + libdap::dods_float32 float32_value; + libdap::dods_float64 float64_value; + + libdap::byte_arg_list byte_values; + libdap::int16_arg_list int16_values; + libdap::uint16_arg_list uint16_values; + libdap::int32_arg_list int32_values; + libdap::uint32_arg_list uint32_values; + libdap::float32_arg_list float32_values; + libdap::float64_arg_list float64_values; + + libdap::value val; // value is defined in expr.h + + libdap::bool_func b_func; + libdap::btp_func bt_func; + + libdap::int_list *int_l_ptr; + libdap::int_list_list *int_ll_ptr; + + libdap::rvalue *rval_ptr; + libdap::rvalue_list *r_val_l_ptr; +} + +%token SCAN_STR + +%token SCAN_WORD + +%token SCAN_EQUAL +%token SCAN_NOT_EQUAL +%token SCAN_GREATER +%token SCAN_GREATER_EQL +%token SCAN_LESS +%token SCAN_LESS_EQL +%token SCAN_REGEXP + +%token SCAN_STAR + +%token SCAN_HASH_BYTE +%token SCAN_HASH_INT16 +%token SCAN_HASH_UINT16 +%token SCAN_HASH_INT32 +%token SCAN_HASH_UINT32 +%token SCAN_HASH_FLOAT32 +%token SCAN_HASH_FLOAT64 + +%type constraint_expr projection proj_clause proj_function +%type array_projection selection clause bool_function arg_length_hint +%type array_proj_clause name +%type rel_op + +%type array_index +%type array_indices + +%type r_value id_or_const array_const_special_form +%type r_value_list arg_list + +%type fast_byte_arg +%type fast_byte_arg_list + +%type fast_int16_arg +%type fast_int16_arg_list + +%type fast_uint16_arg +%type fast_uint16_arg_list + +%type fast_int32_arg +%type fast_int32_arg_list + +%type fast_uint32_arg +%type fast_uint32_arg_list + +%type fast_float32_arg +%type fast_float32_arg_list + +%type fast_float64_arg +%type fast_float64_arg_list + +%code { +/* This global is used by the rule 'arg_length_hint' so that the hint can + be used during the paraent rule's parse. See fast_int32_arg_list. */ +unsigned long arg_length_hint_value = 0; +} + +%% + +constraint_expr: /* empty constraint --> send all */ + { + DBG(cerr << "Mark all variables" << endl); + DDS(arg)->mark_all(true); + $$ = true; + } + /* projection only */ + | projection + /* selection only --> project everything */ + | '&' { DDS(arg)->mark_all(true); } selection + { + $$ = $3; + } + | projection '&' selection + { + $$ = $1 && $3; + } +; + +projection: proj_clause + | proj_clause ',' projection + { + $$ = $1 && $3; + } +; + +proj_clause: name + { + BaseType *var = DDS(arg)->var($1); + if (var) { + DBG(cerr << "Marking " << $1 << endl); + $$ = DDS(arg)->mark($1, true); + DBG(cerr << "result: " << $$ << endl); + } + else { + no_such_ident(arg, $1, "identifier"); + } + } + | proj_function + { + $$ = $1; + } + | array_projection + { + $$ = $1; + } + | array_const_special_form + { + Array *array = dynamic_cast($1->bvalue(*DDS(arg))); + if (array) { + /* When the special form appears here (not as a function argument) + set send_p so the data will be sent and add it to the DDS. This + streamlines testing (and is likely what is intended). */ + + array->set_send_p(true); + DDS(arg)->add_var_nocopy(array); + + return true; + } + else { + ce_exprerror(arg, "Could not create the anonymous vector using the # special form"); + return false; + } + } +; + +/* The value parsed by arg_length_hint is stored in a global variable by that rule + so that it can be used during the parse of fast_byte_arg_list. */ + +/* return a rvalue */ +array_const_special_form: SCAN_HASH_BYTE '(' arg_length_hint ':' fast_byte_arg_list ')' + { + $$ = build_constant_array($5, DDS(arg)); + } +; + +array_const_special_form: SCAN_HASH_INT16 '(' arg_length_hint ':' fast_int16_arg_list ')' + { + $$ = build_constant_array($5, DDS(arg)); + } +; + +array_const_special_form: SCAN_HASH_UINT16 '(' arg_length_hint ':' fast_uint16_arg_list ')' + { + $$ = build_constant_array($5, DDS(arg)); + } +; + +array_const_special_form: SCAN_HASH_INT32 '(' arg_length_hint ':' fast_int32_arg_list ')' + { + $$ = build_constant_array($5, DDS(arg)); + } +; + +array_const_special_form: SCAN_HASH_UINT32 '(' arg_length_hint ':' fast_uint32_arg_list ')' + { + $$ = build_constant_array($5, DDS(arg)); + } +; + +array_const_special_form: SCAN_HASH_FLOAT32 '(' arg_length_hint ':' fast_float32_arg_list ')' + { + $$ = build_constant_array($5, DDS(arg)); + } +; + +array_const_special_form: SCAN_HASH_FLOAT64 '(' arg_length_hint ':' fast_float64_arg_list ')' + { + $$ = build_constant_array($5, DDS(arg)); + } +; + +/* Here the arg length hint is stored in a global so it can be used by the + function that allocates the vector. The value is passed to vector::reserve(). */ + +arg_length_hint: SCAN_WORD + { + if (!check_int32($1)) + throw Error(malformed_expr, "#(hint, value, ...) special form expected hint to be an integer"); + + arg_length_hint_value = atoi($1); + $$ = true; + } +; + +/* return an int_arg_list (a std::vector*) */ +fast_byte_arg_list: fast_byte_arg + { + $$ = make_fast_arg_list(arg_length_hint_value, $1); + } + | fast_byte_arg_list ',' fast_byte_arg + { + $$ = make_fast_arg_list($1, $3); + } +; + +/* This rule does not check SCAN_WORD nor does it perform www escaping */ +fast_byte_arg: SCAN_WORD + { + $$ = strtol($1, 0, 0); + } +; + +/* return an int_arg_list (a std::vector*) */ +fast_int16_arg_list: fast_int16_arg + { + $$ = make_fast_arg_list(arg_length_hint_value, $1); + } + | fast_int16_arg_list ',' fast_int16_arg + { + $$ = make_fast_arg_list($1, $3); + } +; + +/* This rule does not check SCAN_WORD nor does it perform www escaping */ +fast_int16_arg: SCAN_WORD + { + $$ = strtol($1, 0, 0); + } +; + +/* return an int_arg_list (a std::vector*) */ +fast_uint16_arg_list: fast_uint16_arg + { + $$ = make_fast_arg_list(arg_length_hint_value, $1); + } + | fast_uint16_arg_list ',' fast_uint16_arg + { + $$ = make_fast_arg_list($1, $3); + } +; + +/* This rule does not check SCAN_WORD nor does it perform www escaping */ +fast_uint16_arg: SCAN_WORD + { + $$ = strtoul($1, 0, 0); + } +; + +/* return an int_arg_list (a std::vector*) */ +fast_int32_arg_list: fast_int32_arg + { + $$ = make_fast_arg_list(arg_length_hint_value, $1); + } + | fast_int32_arg_list ',' fast_int32_arg + { + $$ = make_fast_arg_list($1, $3); + } +; + +/* This rule does not check SCAN_WORD nor does it perform www escaping */ +fast_int32_arg: SCAN_WORD + { + $$ = strtol($1, 0, 0); + } +; + +/* return an int_arg_list (a std::vector*) */ +fast_uint32_arg_list: fast_uint32_arg + { + $$ = make_fast_arg_list(arg_length_hint_value, $1); + } + | fast_uint32_arg_list ',' fast_uint32_arg + { + $$ = make_fast_arg_list($1, $3); + } +; + +/* This rule does not check SCAN_WORD nor does it perform www escaping */ +fast_uint32_arg: SCAN_WORD + { + $$ = strtoul($1, 0, 0); + } +; + +/* return an int_arg_list (a std::vector*) */ +fast_float32_arg_list: fast_float32_arg + { + $$ = make_fast_arg_list(arg_length_hint_value, $1); + } + | fast_float32_arg_list ',' fast_float32_arg + { + $$ = make_fast_arg_list($1, $3); + } +; + +/* This rule does not check SCAN_WORD nor does it perform www escaping */ +fast_float32_arg: SCAN_WORD + { + $$ = strtof($1, 0); + } +; + +/* return an int_arg_list (a std::vector*) */ +fast_float64_arg_list: fast_float64_arg + { + $$ = make_fast_arg_list(arg_length_hint_value, $1); + } + | fast_float64_arg_list ',' fast_float64_arg + { + $$ = make_fast_arg_list($1, $3); + } +; + +/* This rule does not check SCAN_WORD nor does it perform www escaping */ +fast_float64_arg: SCAN_WORD + { + $$ = strtod($1, 0); + } +; + +/* This rule does not check SCAN_WORD nor does it perform www escaping */ +proj_function: SCAN_WORD '(' arg_list ')' + { + proj_func p_f = 0; + btp_func f = 0; + + if ((f = get_btp_function(*(EVALUATOR(arg)), $1))) { + EVALUATOR(arg)->append_clause(f, $3); + $$ = true; + } + else if ((p_f = get_proj_function(*(EVALUATOR(arg)), $1))) { + DDS &dds = dynamic_cast(*(DDS(arg))); + BaseType **args = build_btp_args( $3, dds ); + (*p_f)(($3) ? $3->size():0, args, dds, *(EVALUATOR(arg))); + delete[] args; + $$ = true; + } + else { + no_such_func(arg, $1); + } + } +; + +selection: clause + | selection '&' clause + { + $$ = $1 && $3; + } +; + +clause: r_value rel_op '{' r_value_list '}' + { + if ($1) { + EVALUATOR(arg)->append_clause($2, $1, $4); + $$ = true; + } + else + $$ = false; + } + | r_value rel_op r_value + { + if ($1) { + rvalue_list *rv = new rvalue_list; + rv->push_back($3); + EVALUATOR(arg)->append_clause($2, $1, rv); + $$ = true; + } + else + $$ = false; + } + | bool_function + { + $$ = $1; + } +; + +/* This rule does not check SCAN_WORD nor does it perform www escaping */ +bool_function: SCAN_WORD '(' arg_list ')' + { + bool_func b_func = get_function((*EVALUATOR(arg)), $1); + if (!b_func) { + no_such_func(arg, $1); + } + else { + EVALUATOR(arg)->append_clause(b_func, $3); + $$ = true; + } + } +; + +/* This rule does not check SCAN_WORD nor does it perform www escaping */ +r_value: id_or_const + | SCAN_WORD '(' arg_list ')' + { + btp_func func = get_btp_function((*EVALUATOR(arg)), $1); + if (func) { + $$ = new rvalue(func, $3); + } + else { + no_such_func(arg, $1); + } + } + | array_const_special_form + { + $$ = $1; + } +; + +r_value_list: r_value + { + if ($1) + $$ = make_rvalue_list($1); + else + $$ = 0; + } + | r_value_list ',' r_value + { + if ($1 && $3) + $$ = append_rvalue_list($1, $3); + else + $$ = 0; + } +; + +arg_list: r_value_list + { + $$ = $1; + } + | /* Null, argument lists may be empty */ + { + $$ = 0; + } +; + +id_or_const: SCAN_WORD + { + BaseType *btp = DDS(arg)->var(www2id($1)); + if (btp) { + btp->set_in_selection(true); + $$ = new rvalue(btp); + } + else { + value new_val; + if (check_int32($1)) { + new_val.type = dods_int32_c; + new_val.v.i = atoi($1); + } + else if (check_uint32($1)) { + new_val.type = dods_uint32_c; + new_val.v.ui = atoi($1); + } + else if (check_float64($1)) { + new_val.type = dods_float64_c; + new_val.v.f = atof($1); + } + else { + new_val.type = dods_str_c; + new_val.v.s = new string(www2id($1)); + } + BaseType *btp = make_variable((*EVALUATOR(arg)), new_val); + $$ = new rvalue(btp); + } + } + | SCAN_STR + { + if ($1.type != dods_str_c || $1.v.s == 0 || $1.v.s->empty()) + ce_exprerror(arg, "Malformed string", ""); + + BaseType *var = DDS(arg)->var(www2id(*($1.v.s))); + if (var) { + $$ = new rvalue(var); + } + else { + var = make_variable((*EVALUATOR(arg)), $1); + $$ = new rvalue(var); + } + } +; + +array_projection : array_proj_clause + { + $$ = (*DDS(arg)).mark($1, true); + } + +array_proj_clause: name array_indices + { + //string name = www2id($1); + if (!bracket_projection((*DDS(arg)), $1, $2)) + no_such_ident(arg, $1, "array, grid or sequence"); + + strncpy($$, $1, ID_MAX-1); + $$[ID_MAX-1] = '\0'; + } + | array_proj_clause name + { + string name = string($1) + string($2); + strncpy($$, name.c_str(), ID_MAX-1); + $$[ID_MAX-1] = '\0'; + } + | array_proj_clause name array_indices + { + string name = string($1) + string($2); + if (!bracket_projection((*DDS(arg)), name.c_str(), $3)) + no_such_ident(arg, name.c_str(), "array, grid or sequence"); + + strncpy($$, name.c_str(), ID_MAX-1); + $$[ID_MAX-1] = '\0'; + } +; + +name: SCAN_WORD + { + strncpy($$, www2id($1).c_str(), ID_MAX-1); + $$[ID_MAX-1] = '\0'; + } + | SCAN_STR + { + if ($1.type != dods_str_c || $1.v.s == 0 || $1.v.s->empty()) + ce_exprerror(arg, "Malformed string", ""); + + strncpy($$, www2id(*($1.v.s)).c_str(), ID_MAX-1); + + $$[ID_MAX-1] = '\0'; + } +; + +array_indices: array_index + { + $$ = make_array_indices($1); + } + | array_indices array_index + { + $$ = append_array_index($1, $2); + } +; + +/* + * We added [*], [n:*] and [n:m:*] to the syntax for array projections. + * These mean, resp., all the elements, elements from n to the end, and + * from n to the end with a stride of m. To encode this with as little + * disruption as possible, we represent the star with -1. jhrg 12/20/12 + */ +array_index: '[' SCAN_WORD ']' +{ + if (!check_uint32($2)) + throw Error(malformed_expr, "The word `" + string($2) + "' is not a valid array index."); + value i; + i.type = dods_uint32_c; + i.v.i = atoi($2); + $$ = make_array_index(i); +} +| '[' SCAN_STAR ']' +{ + value i; + i.type = dods_int32_c; + i.v.i =-1; + $$ = make_array_index(i); +} +|'[' SCAN_WORD ':' SCAN_WORD ']' +{ + if (!check_uint32($2)) + throw Error(malformed_expr, "The word `" + string($2) + "' is not a valid array index."); + if (!check_uint32($4)) + throw Error(malformed_expr, "The word `" + string($4) + "' is not a valid array index."); + value i,j; + i.type = j.type = dods_uint32_c; + i.v.i = atoi($2); + j.v.i = atoi($4); + $$ = make_array_index(i, j); +} +|'[' SCAN_WORD ':' SCAN_STAR ']' +{ + if (!check_uint32($2)) + throw Error(malformed_expr, "The word `" + string($2) + "' is not a valid array index."); + value i,j; + i.type = dods_uint32_c; + j.type = dods_int32_c; /* signed */ + i.v.i = atoi($2); + j.v.i = -1; + $$ = make_array_index(i, j); +} +| '[' SCAN_WORD ':' SCAN_WORD ':' SCAN_WORD ']' +{ + if (!check_uint32($2)) + throw Error(malformed_expr, "The word `" + string($2) + "' is not a valid array index."); + if (!check_uint32($4)) + throw Error(malformed_expr, "The word `" + string($4) + "' is not a valid array index."); + if (!check_uint32($6)) + throw Error(malformed_expr, "The word `" + string($6) + "' is not a valid array index."); + value i, j, k; + i.type = j.type = k.type = dods_uint32_c; + i.v.i = atoi($2); + j.v.i = atoi($4); + k.v.i = atoi($6); + $$ = make_array_index(i, j, k); +} +| '[' SCAN_WORD ':' SCAN_WORD ':' SCAN_STAR ']' +{ + if (!check_uint32($2)) + throw Error(malformed_expr, "The word `" + string($2) + "' is not a valid array index."); + if (!check_uint32($4)) + throw Error(malformed_expr, "The word `" + string($4) + "' is not a valid array index."); + value i, j, k; + i.type = j.type = dods_uint32_c; + k.type = dods_int32_c; + i.v.i = atoi($2); + j.v.i = atoi($4); + k.v.i = -1; + $$ = make_array_index(i, j, k); +} +; + +rel_op: SCAN_EQUAL + | SCAN_NOT_EQUAL + | SCAN_GREATER + | SCAN_GREATER_EQL + | SCAN_LESS + | SCAN_LESS_EQL + | SCAN_REGEXP +; + +%% + +// All these error reporting function now throw instances of Error. The expr +// parser no longer returns an error code to indicate and error. 2/16/2000 +// jhrg. + +void +ce_exprerror(ce_parser_arg *, const string &s) +{ + //ce_exprerror(s.c_str()); + string msg = "Constraint expression parse error: " + (string) s; + throw Error(malformed_expr, msg); +} + +void ce_exprerror(ce_parser_arg *, const string &s, const string &s2) +{ + //ce_exprerror(s.c_str(), s2.c_str()); + string msg = "Constraint expression parse error: " + (string) s + ": " + (string) s2; + throw Error(malformed_expr, msg); +} + +void no_such_ident(ce_parser_arg *arg, const string &name, const string &word) +{ + string msg = "No such " + word + " in dataset"; + ce_exprerror(arg, msg /*.c_str()*/, name); +} + +void no_such_func(ce_parser_arg *arg, const string &name) +{ + ce_exprerror(arg, "Not a registered function", name); + //no_such_func(name/*.c_str()*/); +} + +/* If we're calling this, assume var is not a Sequence. But assume that the + name contains a dot and it's a separator. Look for the rightmost dot and + then look to see if the name to the left is a sequence. Return a pointer + to the sequence if it is otherwise return null. Uses tail-recursion to + 'walk' back from right to left looking at each dot. This way the sequence + will be found even if there are structures between the field and the + Sequence. */ +static Sequence * +parent_is_sequence(DDS &table, const string &n) +{ + string::size_type dotpos = n.find_last_of('.'); + if (dotpos == string::npos) + return 0; + + string s = n.substr(0, dotpos); + + // If the thing returned by table.var is not a Sequence, this cast + // will yield null. + Sequence *seq = dynamic_cast (table.var(s)); + if (seq) + return seq; + else + return parent_is_sequence(table, s); +} + +bool bracket_projection(DDS &table, const char *name, int_list_list *indices) +{ + BaseType *var = table.var(name); + Sequence *seq; // used in last else-if clause +#if 0 + Array *array; +#endif + if (!var) + return false; + + if (is_array_t(var)) { + /* calls to set_send_p should be replaced with + calls to DDS::mark so that arrays of Structures, + etc. will be processed correctly when individual + elements are projected using short names. + 9/1/98 jhrg */ + /* var->set_send_p(true); */ + //table.mark(name, true); + // We don't call mark() here for an array. Instead it is called from + // within the parser. jhrg 10/10/08 + process_array_indices(var, indices); // throws on error + delete_array_indices(indices); + } + else if (is_grid_t(var)) { + process_grid_indices(var, indices); + table.mark(name, true); + delete_array_indices(indices); + } + else if (is_sequence_t(var)) { + table.mark(name, true); + process_sequence_indices(var, indices); + delete_array_indices(indices); + } + else if ((seq = parent_is_sequence(table, name))) { + process_sequence_indices(seq, indices); + table.mark(name, true); + delete_array_indices(indices); + } + else { + return false; + } + + return true; +} + +// Given three values (I1, I2, I3), all of which must be integers, build an +// int_list which contains those values. +// +// Note that we added support for * in the rightmost position of an index +// (i.e., [*], [n:*], [n:m:*]) and indicate that star using -1 as an index value. +// Bescause of this change, the test for the type of the rightmost value in +// the index subexpr was changed to include signed int. +// jhrg 12/20/12 +// +// Returns: A pointer to an int_list of three integers or NULL if any of the +// values are not integers. + +int_list * +make_array_index(value &i1, value &i2, value &i3) +{ + if (i1.type != dods_uint32_c || i2.type != dods_uint32_c || (i3.type != dods_uint32_c && i3.type != dods_int32_c)) + return (int_list *) 0; + + int_list *index = new int_list; + + index->push_back((int) i1.v.i); + index->push_back((int) i2.v.i); + index->push_back((int) i3.v.i); + + DBG(cout << "index: "); + DBG(copy(index->begin(), index->end(), ostream_iterator(cerr, " "))); + DBG(cerr << endl); + + return index; +} + +int_list * +make_array_index(value &i1, value &i2) +{ + if (i1.type != dods_uint32_c || (i2.type != dods_uint32_c && i2.type != dods_int32_c)) + return (int_list *) 0; + + int_list *index = new int_list; + + index->push_back((int) i1.v.i); + index->push_back(1); + index->push_back((int) i2.v.i); + + DBG(cout << "index: "); + DBG(copy(index->begin(), index->end(), ostream_iterator(cerr, " "))); + DBG(cerr << endl); + + return index; +} + +int_list * +make_array_index(value &i1) +{ + if (i1.type != dods_uint32_c && i1.type != dods_int32_c) + return (int_list *) 0; + + int_list *index = new int_list; + + // When the CE is Array[*] that means all of the elements, but the value + // of i1 will be -1. Make the projection triple be 0:1:-1 which is a + // pattern that libdap::Array will recognize. + if (i1.v.i == -1) + index->push_back(0); + else + index->push_back((int) i1.v.i); + index->push_back(1); + index->push_back((int) i1.v.i); + + DBG(cout << "index: "); + DBG(copy(index->begin(), index->end(), ostream_iterator(cerr, " "))); + DBG(cerr << endl); + + return index; +} + +int_list_list * +make_array_indices(int_list *index) +{ + int_list_list *indices = new int_list_list; + + DBG(cout << "index: "); + DBG(copy(index->begin(), index->end(), ostream_iterator(cerr, " "))); + DBG(cerr << endl); + + assert(index); + indices->push_back(index); + + return indices; +} + +int_list_list * +append_array_index(int_list_list *indices, int_list *index) +{ + assert(indices); + assert(index); + + indices->push_back(index); + + return indices; +} + +// Delete an array indices list. + +void delete_array_indices(int_list_list *indices) +{ + assert(indices); + + for (int_list_citer i = indices->begin(); i != indices->end(); i++) { + int_list *il = *i; + assert(il); + delete il; + } + + delete indices; +} + +bool is_array_t(BaseType *variable) +{ + assert(variable); + + if (variable->type() != dods_array_c) + return false; + else + return true; +} + +bool is_grid_t(BaseType *variable) +{ + assert(variable); + + if (variable->type() != dods_grid_c) + return false; + else + return true; +} + +bool is_sequence_t(BaseType *variable) +{ + assert(variable); + + if (variable->type() != dods_sequence_c) + return false; + else + return true; +} + +void process_array_indices(BaseType *variable, int_list_list *indices) +{ + assert(variable); + + Array *a = dynamic_cast(variable); // replace with dynamic cast + if (!a) + throw Error(malformed_expr, + string("The constraint expression evaluator expected an array; ") + variable->name() + " is not an array."); + + if (a->dimensions(true) != (unsigned) indices->size()) + throw Error(malformed_expr, + string("Error: The number of dimensions in the constraint for ") + variable->name() + + " must match the number in the array."); + + DBG(cerr << "Before applying projection to array:" << endl); + DBG(a->print_decl(cerr, "", true, false, true)); + + assert(indices); + + int_list_citer p = indices->begin(); + Array::Dim_iter r = a->dim_begin(); + for (; p != indices->end() && r != a->dim_end(); p++, r++) { + int_list *index = *p; + assert(index); + + int_citer q = index->begin(); + assert(q != index->end()); + int start = *q; + + q++; + int stride = *q; + + q++; + int stop = *q; + + q++; + if (q != index->end()) + throw Error(malformed_expr, string("Too many values in index list for ") + a->name() + "."); + + DBG(cerr << "process_array_indices: Setting constraint on " + << a->name() << "[" << start << ":" << stop << "]" + << endl); + + // It's possible that an array will appear more than once in a CE + // (for example, if an array of structures is constrained so that + // only two fields are projected and there's an associated hyperslab). + // However, in this case the two hyperslabs must be equal; test for + // that here. + // + // We added '*' to mean 'the last element' in the array and use an index of -1 + // to indicate that. If 'stop' is -1, don't test it here because dimension_stop() + // won't be -1 but the actual ending index of the array. jhrg 12/20/12 + + if (a->send_p() && (a->dimension_start(r, true) != start || (a->dimension_stop(r, true) != stop && stop != -1) + || a->dimension_stride(r, true) != stride)) + throw Error(malformed_expr, + string("The Array was already projected differently in the constraint expression: ") + a->name() + "."); + + a->add_constraint(r, start, stride, stop); + + DBG(cerr << "Set Constraint: " << a->dimension_size(r, true) << endl); + } + + DBG(cerr << "After applying projection to array:" << endl); + DBG(a->print_decl(cerr, "", true, false, true)); + + + if (p != indices->end() && r == a->dim_end()) + throw Error(malformed_expr, string("Too many indices in constraint for ") + a->name() + "."); +} + +void process_grid_indices(BaseType *variable, int_list_list *indices) +{ + assert(variable); + assert(variable->type() == dods_grid_c); + Grid *g = dynamic_cast(variable); + if (!g) + throw Error(unknown_error, "Expected a Grid variable"); + + Array *a = g->get_array(); + + if (a->dimensions(true) != (unsigned) indices->size()) + throw Error(malformed_expr, + string("Error: The number of dimensions in the constraint for ") + variable->name() + + " must match the number in the grid."); + + // First do the constraints on the ARRAY in the grid. + process_array_indices(g->array_var(), indices); + + // Now process the maps. + Grid::Map_iter r = g->map_begin(); + + // Suppress all maps by default. + for (; r != g->map_end(); r++) { + (*r)->set_send_p(false); + } + + // Add specified maps to the current projection. + assert(indices); + int_list_citer p = indices->begin(); + r = g->map_begin(); + for (; p != indices->end() && r != g->map_end(); p++, r++) { + int_list *index = *p; + assert(index); + + int_citer q = index->begin(); + assert(q != index->end()); + int start = *q; + + q++; + int stride = *q; + + q++; + int stop = *q; + + BaseType *btp = *r; + assert(btp); + assert(btp->type() == dods_array_c); + Array *a = (Array *) btp; + a->set_send_p(true); + a->reset_constraint(); + + q++; + if (q != index->end()) { + throw Error(malformed_expr, string("Too many values in index list for ") + a->name() + "."); + } + + DBG(cerr << "process_grid_indices: Setting constraint on " + << a->name() << "[" << start << ":" + << stop << "]" << endl); + + Array::Dim_iter si = a->dim_begin(); + a->add_constraint(si, start, stride, stop); + + } + + DBG(cout << "Grid Constraint: "; + for (Array::Dim_iter dp = ((Array *) g->array_var())->dim_begin(); + dp != ((Array *) g->array_var())->dim_end(); dp++) + cout << ((Array *) g->array_var())->dimension_size(dp, true) << " "; + cout << endl + ); + + if (p != indices->end() && r == g->map_end()) { + throw Error(malformed_expr, + string("Too many indices in constraint for ") + (*r)->name() + "."); + } +} + +void process_sequence_indices(BaseType *variable, int_list_list *indices) +{ + assert(variable); + assert(variable->type() == dods_sequence_c); + Sequence *s = dynamic_cast (variable); + if (!s) + throw Error(malformed_expr, "Expected a Sequence variable"); + + // Add specified maps to the current projection. + assert(indices); + for (int_list_citer p = indices->begin(); p != indices->end(); p++) { + int_list *index = *p; + assert(index); + + int_citer q = index->begin(); + assert(q != index->end()); + int start = *q; + + q++; + int stride = *q; + + q++; + int stop = *q; + + q++; + if (q != index->end()) { + throw Error(malformed_expr, string("Too many values in index list for ") + s->name() + "."); + } + + s->set_row_number_constraint(start, stop, stride); + } +} + +// Given a value, wrap it up in a BaseType and return a pointer to the same. + +BaseType * +make_variable(ConstraintEvaluator &eval, const value &val) +{ + BaseType *var; + switch (val.type) { + case dods_int32_c: { + var = new Int32("dummy"); + var->val2buf((void *) &val.v.i); + break; + } + + case dods_uint32_c: { + var = new UInt32("dummy"); + var->val2buf((void *) &val.v.i); + break; + } + + case dods_float64_c: { + var = new Float64("dummy"); + var->val2buf((void *) &val.v.f); + break; + } + + case dods_str_c: { + var = new Str("dummy"); + var->val2buf((void *) val.v.s); + break; + } + + default: + var = (BaseType *) 0; + return var; + } + + var->set_read_p(true); // ...so the evaluator will know it has data + eval.append_constant(var); + + return var; +} + +// Given a string (passed in VAL), consult the DDS CE function lookup table +// to see if a function by that name exists. +// NB: function arguments are type-checked at run-time. +// +// Returns: A pointer to the function or NULL if not such function exists. + +bool_func get_function(const ConstraintEvaluator &eval, const char *name) +{ + bool_func f; + + if (eval.find_function(name, &f)) + return f; + else + return 0; +} + +btp_func get_btp_function(const ConstraintEvaluator &eval, const char *name) +{ + btp_func f; + + if (eval.find_function(name, &f)) + return f; + else + return 0; +} + +proj_func get_proj_function(const ConstraintEvaluator &eval, const char *name) +{ + proj_func f; + + if (eval.find_function(name, &f)) + return f; + else + return 0; +} + +template +arg_type_list +make_fast_arg_list(unsigned long vector_size_hint, arg_type value) +{ + arg_type_list args = new std::vector; + + if (vector_size_hint > 0) args->reserve(vector_size_hint); + + args->push_back(value); + return args; +} + +template +arg_type_list +make_fast_arg_list(arg_type_list values, arg_type value) +{ + values->push_back(value); + return values; +} + +template +rvalue *build_constant_array(vector *values, DDS *dds) +{ + //vector *values = $5; + + T i(""); + Array *array = new Array("", &i); + array->append_dim(values->size()); + + // TODO Make set_value_nocopy() methods so that values' pointers can be copied + // instead of allocating memory twice. jhrg 7/5/13 + + array->set_value(*values, values->size()); + delete values; + array->set_read_p(true); + + static unsigned long counter = 1; + string name; + do { + name = "g" + long_to_string(counter++); + } while (dds->var(name)); + array->set_name(name); + + return new rvalue(array); +} + diff -Nru libdap-3.11.1/ce_functions.cc libdap-3.12.0/ce_functions.cc --- libdap-3.11.1/ce_functions.cc 2011-04-29 13:19:43.000000000 +0000 +++ libdap-3.12.0/ce_functions.cc 1970-01-01 00:00:00.000000000 +0000 @@ -1,1071 +0,0 @@ -// -*- mode: c++; c-basic-offset:4 -*- - -// This file is part of libdap, A C++ implementation of the OPeNDAP Data -// Access Protocol. - -// Copyright (c) 2002,2003 OPeNDAP, Inc. -// Author: James Gallagher -// -// This library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Lesser General Public -// License as published by the Free Software Foundation; either -// version 2.1 of the License, or (at your option) any later version. -// -// This library 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 -// Lesser General Public License for more details. -// -// You should have received a copy of the GNU Lesser General Public -// License along with this library; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -// -// You can contact OPeNDAP, Inc. at PO Box 112, Saunderstown, RI. 02874-0112. - -// (c) COPYRIGHT URI/MIT 1999 -// Please read the full copyright statement in the file COPYRIGHT_URI. -// -// Authors: -// jhrg,jimg James Gallagher - - -// These functions are used by the CE evaluator -// -// 1/15/99 jhrg - -#include "config.h" - -static char rcsid[]not_used = -{ "$Id: ce_functions.cc 24370 2011-03-28 16:21:32Z jimg $" -}; - -#include - -#include // used by strtod() -#include -#include -#include -#include -#include - -//#define DODS_DEBUG -#undef FUNCTION_DAP // undef so the dap() function always returns an error; - // use keywords instead. - -#include "BaseType.h" -#include "Byte.h" -#include "Int16.h" -#include "UInt16.h" -#include "Int32.h" -#include "UInt32.h" -#include "Float32.h" -#include "Float64.h" -#include "Str.h" -#include "Url.h" -#include "Array.h" -#include "Structure.h" -#include "Sequence.h" -#include "Grid.h" -#include "Error.h" -#include "RValue.h" - -#include "GSEClause.h" -#include "GridGeoConstraint.h" -#include "ArrayGeoConstraint.h" - -#include "ce_functions.h" -#include "gse_parser.h" -#include "gse.tab.hh" -#include "debug.h" -#include "util.h" - -// We wrapped VC++ 6.x strtod() to account for a short coming -// in that function in regards to "NaN". I don't know if this -// still applies in more recent versions of that product. -// ROM - 12/2007 -#ifdef WIN32 -#include -double w32strtod(const char *, char **); -#endif - -using namespace std; - -int gse_parse(void *arg); -void gse_restart(FILE * in); - -// Glue routines declared in gse.lex -void gse_switch_to_buffer(void *new_buffer); -void gse_delete_buffer(void *buffer); -void *gse_string(const char *yy_str); - -namespace libdap { - -/** Is \e lhs equal to \e rhs? Use epsilon to determine equality. */ -inline bool double_eq(double lhs, double rhs, double epsilon = 1.0e-5) -{ - if (lhs > rhs) - return (lhs - rhs) < ((lhs + rhs) / epsilon); - else - return (rhs - lhs) < ((lhs + rhs) / epsilon); -} - -/** Given a BaseType pointer, extract the string value it contains and return - it. - - @param arg The BaseType pointer - @return A C++ string - @exception Error thrown if the referenced BaseType object does not contain - a DAP String. */ -string extract_string_argument(BaseType * arg) -{ - if (arg->type() != dods_str_c) - throw Error(malformed_expr, - "The function requires a DAP string argument."); - - if (!arg->read_p()) - throw InternalErr(__FILE__, __LINE__, - "The CE Evaluator built an argument list where some constants held no values."); - - string s = dynamic_cast(*arg).value(); - - DBG(cerr << "s: " << s << endl); - - return s; -} - -template static void set_array_using_double_helper(Array * a, - double *src, int src_len) -{ - T *values = new T[src_len]; - for (int i = 0; i < src_len; ++i) - values[i] = (T) src[i]; - -#ifdef VAL2BUF - a->val2buf(values, true); -#else - a->set_value(values, src_len); -#endif - - delete[]values; -} - -/** Given an array that holds some sort of numeric data, load it with values - using an array of doubles. This function makes several assumptions. First, - it assumes the caller really wants to put the doubles into whatever types - the array holds! Caveat emptor. Second, it assumes that if the size of - source (\e src) array is different than the destination (\e dest) the - caller has made a mistake. In that case it will throw an Error object. - - After setting the values, this method sets the \c read_p property for - \e dest. - - @param dest An Array. The values are written to this array, reusing - its storage. Existing values are lost. - @param src The source data. - @param src_len The number of elements in the \e src array. - @exception Error Thrown if \e dest is not a numeric-type array (Byte, ..., - Float64) or if the number of elements in \e src does not match the number - is \e dest. */ -void set_array_using_double(Array * dest, double *src, int src_len) -{ - // Simple types are Byte, ..., Float64, String and Url. - if ((dest->type() == dods_array_c && !dest->var()->is_simple_type()) - || dest->var()->type() == dods_str_c - || dest->var()->type() == dods_url_c) - throw InternalErr(__FILE__, __LINE__, - "The function requires a DAP numeric-type array argument."); - - // Test sizes. Note that Array::length() takes any constraint into account - // when it returns the length. Even if this was removed, the 'helper' - // function this uses calls Vector::val2buf() which uses Vector::width() - // which in turn uses length(). - if (dest->length() != src_len) - throw InternalErr(__FILE__, __LINE__, - "The source and destination array sizes don't match (" - + long_to_string(src_len) + " versus " - + long_to_string(dest->length()) + ")."); - - // The types of arguments that the CE Parser will build for numeric - // constants are limited to Uint32, Int32 and Float64. See ce_expr.y. - // Expanded to work for any numeric type so it can be used for more than - // just arguments. - switch (dest->var()->type()) { - case dods_byte_c: - set_array_using_double_helper(dest, src, src_len); - break; - case dods_uint16_c: - set_array_using_double_helper(dest, src, src_len); - break; - case dods_int16_c: - set_array_using_double_helper(dest, src, src_len); - break; - case dods_uint32_c: - set_array_using_double_helper(dest, src, src_len); - break; - case dods_int32_c: - set_array_using_double_helper(dest, src, src_len); - break; - case dods_float32_c: - set_array_using_double_helper(dest, src, src_len); - break; - case dods_float64_c: - set_array_using_double_helper(dest, src, src_len); - break; - default: - throw InternalErr(__FILE__, __LINE__, - "The argument list built by the CE parser contained an unsupported numeric type."); - } - - // Set the read_p property. - dest->set_read_p(true); -} - -template static double *extract_double_array_helper(Array * a) -{ - int length = a->length(); - - T *b = new T[length]; - a->value(b); - - double *dest = new double[length]; - for (int i = 0; i < length; ++i) - dest[i] = (double) b[i]; - delete[]b; - - return dest; -} - -/** Given a pointer to an Array which holds a numeric type, extract the - values and return in an array of doubles. This function allocates the - array using 'new double[n]' so delete[] can be used when you are done - the data. */ -double *extract_double_array(Array * a) -{ - // Simple types are Byte, ..., Float64, String and Url. - if ((a->type() == dods_array_c && !a->var()->is_simple_type()) - || a->var()->type() == dods_str_c || a->var()->type() == dods_url_c) - throw Error(malformed_expr, - "The function requires a DAP numeric-type array argument."); - - if (!a->read_p()) - throw InternalErr(__FILE__, __LINE__, - string("The Array '") + a->name() + - "'does not contain values."); - - // The types of arguments that the CE Parser will build for numeric - // constants are limited to Uint32, Int32 and Float64. See ce_expr.y. - // Expanded to work for any numeric type so it can be used for more than - // just arguments. - switch (a->var()->type()) { - case dods_byte_c: - return extract_double_array_helper(a); - case dods_uint16_c: - return extract_double_array_helper(a); - case dods_int16_c: - return extract_double_array_helper(a); - case dods_uint32_c: - return extract_double_array_helper(a); - case dods_int32_c: - return extract_double_array_helper(a); - case dods_float32_c: - return extract_double_array_helper(a); - case dods_float64_c: - return extract_double_array_helper(a); - default: - throw InternalErr(__FILE__, __LINE__, - "The argument list built by the CE parser contained an unsupported numeric type."); - } -} - -/** Given a BaseType pointer, extract the numeric value it contains and return - it in a C++ double. - - @param arg The BaseType pointer - @return A C++ double - @exception Error thrown if the referenced BaseType object does not contain - a DAP numeric value. */ -double extract_double_value(BaseType * arg) -{ - // Simple types are Byte, ..., Float64, String and Url. - if (!arg->is_simple_type() || arg->type() == dods_str_c || arg->type() - == dods_url_c) - throw Error(malformed_expr, - "The function requires a DAP numeric-type argument."); - - if (!arg->read_p()) - throw InternalErr(__FILE__, __LINE__, - "The CE Evaluator built an argument list where some constants held no values."); - - // The types of arguments that the CE Parser will build for numeric - // constants are limited to Uint32, Int32 and Float64. See ce_expr.y. - // Expanded to work for any numeric type so it can be used for more than - // just arguments. - switch (arg->type()) { - case dods_byte_c: - return (double)(dynamic_cast(*arg).value()); - case dods_uint16_c: - return (double)(dynamic_cast(*arg).value()); - case dods_int16_c: - return (double)(dynamic_cast(*arg).value()); - case dods_uint32_c: - return (double)(dynamic_cast(*arg).value()); - case dods_int32_c: - return (double)(dynamic_cast(*arg).value()); - case dods_float32_c: - return (double)(dynamic_cast(*arg).value()); - case dods_float64_c: - return dynamic_cast(*arg).value(); - default: - throw InternalErr(__FILE__, __LINE__, - "The argument list built by the CE parser contained an unsupported numeric type."); - } -} - -/** This server-side function returns version information for the server-side - functions. Note that this function takes no arguments and returns a - String using the BaseType value/result parameter. - - @param btpp A pointer to the return value; caller must delete. -*/ -void -function_version(int, BaseType *[], DDS &, BaseType **btpp) -{ - string - xml_value = - "\ - \ - \ - \ - \ - \ - \ - "; - - // - - Str *response = new Str("version"); - - response->set_value(xml_value); - *btpp = response; - return; -} - -void -function_dap(int, BaseType *[], DDS &, ConstraintEvaluator &) -{ -#ifdef FUNCTION_DAP - if (argc != 1) { - throw Error("The 'dap' function must be called with a version number.\n\ - see http://docs.opendap.org/index.php/Server_Side_Processing_Functions#dap"); - } - - double pv = extract_double_value(argv[0]); - dds.set_dap_version(pv); -#else - throw Error("The 'dap' function is not supported in lieu of Constraint expression 'keywords.'\n\ -see http://docs.opendap.org/index.php/Server_Side_Processing_Functions#keywords"); -#endif -} - -static void parse_gse_expression(gse_arg * arg, BaseType * expr) -{ - gse_restart(0); // Restart the scanner. - void *cls = gse_string(extract_string_argument(expr).c_str()); - // gse_switch_to_buffer(cls); // Get set to scan the string. - bool status = gse_parse((void *) arg) == 0; - gse_delete_buffer(cls); - if (!status) - throw Error(malformed_expr, "Error parsing grid selection."); -} - -static void apply_grid_selection_expr(Grid * grid, GSEClause * clause) -{ - // Basic plan: For each map, look at each clause and set start and stop - // to be the intersection of the ranges in those clauses. - Grid::Map_iter map_i = grid->map_begin(); - while (map_i != grid->map_end() && (*map_i)->name() != clause->get_map_name()) - ++map_i; - - if (map_i == grid->map_end()) - throw Error(malformed_expr,"The map vector '" + clause->get_map_name() - + "' is not in the grid '" + grid->name() + "'."); - - // Use pointer arith & the rule that map order must match array dim order - Array::Dim_iter grid_dim = (grid->get_array()->dim_begin() + (map_i - grid->map_begin())); - - Array *map = dynamic_cast < Array * >((*map_i)); - if (!map) - throw InternalErr(__FILE__, __LINE__, "Expected an Array"); - int start = max(map->dimension_start(map->dim_begin()), clause->get_start()); - int stop = min(map->dimension_stop(map->dim_begin()), clause->get_stop()); - - if (start > stop) { - ostringstream msg; - msg - << "The expressions passed to grid() do not result in an inclusive \n" - << "subset of '" << clause->get_map_name() - << "'. The map's values range " << "from " - << clause->get_map_min_value() << " to " - << clause->get_map_max_value() << "."; - throw Error(malformed_expr,msg.str()); - } - - DBG(cerr << "Setting constraint on " << map->name() - << "[" << start << ":" << stop << "]" << endl); - - // Stride is always one. - map->add_constraint(map->dim_begin(), start, 1, stop); - grid->get_array()->add_constraint(grid_dim, start, 1, stop); -} - -static void apply_grid_selection_expressions(Grid * grid, - vector < GSEClause * >clauses) -{ - vector < GSEClause * >::iterator clause_i = clauses.begin(); - while (clause_i != clauses.end()) - apply_grid_selection_expr(grid, *clause_i++); - - grid->set_read_p(false); -} - -/** The grid function uses a set of relational expressions to form a selection - within a Grid variable based on the values in the Grid's map vectors. - Thus, if a Grid has a 'temperature' map which ranges from 0.0 to 32.0 - degrees, it's possible to request the values of the Grid that fall between - 10.5 and 12.5 degrees without knowing to which array indexes those values - correspond. The function takes one or more arguments:
      -
    • The name of a Grid.
    • -
    • Zero or more strings which hold relational expressions of the form:
        -
      • <map var> <relop> <constant>
      • -
      • <constant> <relop> <map var> <relop> - <constant>
      • -
    • -
    - - Each of the relation expressions is applied to the Grid and the result is - returned. - - @note Since this is a function and one of the arguments is the grid, the - grid is read (using the Grid::read() method) at the time the argument list - is built. - - @todo In order to be used by geogrid() , this code may have to be modified - so that the maps and array are not re-read by the serialize() method. It - might also be a good idea to change from the '?grid(SST,"10\n") + - "\n" + - "\n"; - - if (argc == 0) { - Str *response = new Str("info"); - response->set_value(info); - *btpp = response; - return; - } - - Grid *original_grid = dynamic_cast < Grid * >(argv[0]); - if (!original_grid) - throw Error(malformed_expr,"The first argument to grid() must be a Grid variable!"); - - // Duplicate the grid; ResponseBuilder::send_data() will delete the variable - // after serializing it. - BaseType *btp = original_grid->ptr_duplicate(); - Grid *l_grid = dynamic_cast < Grid * >(btp); - if (!l_grid) { - delete btp; - throw InternalErr(__FILE__, __LINE__, "Expected a Grid."); - } - - DBG(cerr << "grid: past initialization code" << endl); - - // Read the maps. Do this before calling parse_gse_expression(). Avoid - // reading the array until the constraints have been applied because it - // might be really large. - - // This version makes sure to set the send_p flags which is needed for - // the hdf4 handler (and is what should be done in general). - Grid::Map_iter i = l_grid->map_begin(); - while (i != l_grid->map_end()) - (*i++)->set_send_p(true); - l_grid->read(); - - DBG(cerr << "grid: past map read" << endl); - - // argv[1..n] holds strings; each are little expressions to be parsed. - // When each expression is parsed, the parser makes a new instance of - // GSEClause. GSEClause checks to make sure the named map really exists - // in the Grid and that the range of values given makes sense. - vector < GSEClause * > clauses; - gse_arg *arg = new gse_arg(l_grid); - for (int i = 1; i < argc; ++i) { - parse_gse_expression(arg, argv[i]); - clauses.push_back(arg->get_gsec()); - } - delete arg; - arg = 0; - - apply_grid_selection_expressions(l_grid, clauses); - - DBG(cerr << "grid: past gse application" << endl); - - l_grid->get_array()->set_send_p(true); - - l_grid->read(); - - *btpp = l_grid; - return; -} - -/** The geogrid function returns the part of a Grid which includes a - geographically specified rectangle. The arguments to the function are the - name of a Grid, the left-top and right-bottom points of the rectangle and - zero or more relational expressions of the sort that the grid function - accepts. The constraints on the arguments are:
    • The Grid must have - Latitude and Longitude map vectors. Those are discovered by looking for - map vectors which satisfy enough of any one of a set of conventions to - make the identification of those map vectors positive or by guessing - which maps are which. The set of conventions supported is: COARDS, CF - 1.0, GDT and CSC (see - http://www.unidata.ucar.edu/software/netcdf/conventions.html). If the - geogrid guesses at the maps, it adds an attribute (geogrid_warning) which - says so. (in version 1.1)
    • The rectangle corner points are in - Longitude-Latitude. Longitude may be given using -180 to 180 or 0 to 360. - For data sources with global coverage, geogrid assumes that the Longitude - axis is circular. For requests made using 0/359 notation, it assumes it - is modulus 360. Requests made using -180/179 notation cannot use values - outside that range.
    • The notation used to specify the rectangular - region determines the notation used in the longitude/latitude map vectors - of the Grid returned by the function.
    • There are no restrictions - on the relational expressions beyond those for the grid() (see - func_grid_select()) function.
    - - @note The geogrid() function is implemented as a 'BaseType function' - which means that there can be only one function per request and no other - variables may be named in the request. - - @param argc The number of values in argv. - @param argv An array of BaseType pointers which hold the arguments to be - passed to geogrid. The arguments may be Strings, Integers, or Reals, - subject to the above constraints. - @param btpp A pointer to the return value; caller must delete. - - @return The constrained and read Grid, ready to be sent. */ -void -function_geogrid(int argc, BaseType * argv[], DDS &, BaseType **btpp) -{ - string info = - string("\n") + - "\n"+ - ""; - - if (argc == 0) { - Str *response = new Str("version"); - response->set_value(info); - *btpp = response; - return ; - } - - // There are two main forms of this function, one that takes a Grid and one - // that takes a Grid and two Arrays. The latter provides a way to explicitly - // tell the function which maps contain lat and lon data. The remaining - // arguments are the same for both versions, although that includes a - // varying argument list. - - // Look at the types of the first three arguments to determine which of the - // two forms were used to call this function. - Grid *l_grid = 0; - if (argc < 1 || !(l_grid = dynamic_cast < Grid * >(argv[0]->ptr_duplicate()))) - throw Error(malformed_expr,"The first argument to geogrid() must be a Grid variable!"); - - // Both forms require at least this many args - if (argc < 5) - throw Error(malformed_expr,"Wrong number of arguments to geogrid() (expected at least 5 args). See geogrid() for more information."); - - bool grid_lat_lon_form; - Array *l_lat = 0; - Array *l_lon = 0; - if (!(l_lat = dynamic_cast < Array * >(argv[1]))) //->ptr_duplicate()))) - grid_lat_lon_form = false; - else if (!(l_lon = dynamic_cast < Array * >(argv[2]))) //->ptr_duplicate()))) - throw Error(malformed_expr,"When using the Grid, Lat, Lon form of geogrid() both the lat and lon maps must be given (lon map missing)!"); - else - grid_lat_lon_form = true; - - if (grid_lat_lon_form && argc < 7) - throw Error(malformed_expr,"Wrong number of arguments to geogrid() (expected at least 7 args). See geogrid() for more information."); - -#if 0 - Grid *l_grid = dynamic_cast < Grid * >(argv[0]->ptr_duplicate()); - if (!l_grid) - throw Error(malformed_expr,"The first argument to geogrid() must be a Grid variable!"); -#endif - // Read the maps. Do this before calling parse_gse_expression(). Avoid - // reading the array until the constraints have been applied because it - // might be really large. - // - // Trick: Some handlers build Grids from a combination of Array - // variables and attributes. Those handlers (e.g., hdf4) use the send_p - // property to determine which parts of the Grid to read *but they can - // only read the maps from within Grid::read(), not the map's read()*. - // Since the Grid's array does not have send_p set, it will not be read - // by the call below to Grid::read(). - Grid::Map_iter i = l_grid->map_begin(); - while (i != l_grid->map_end()) - (*i++)->set_send_p(true); - - l_grid->read(); - // Calling read() above sets the read_p flag for the entire grid; clear it - // for the grid's array so that later on the code will be sure to read it - // under all circumstances. - l_grid->get_array()->set_read_p(false); - DBG(cerr << "geogrid: past map read" << endl); - - // Look for Grid Selection Expressions tacked onto the end of the BB - // specification. If there are any, evaluate them before evaluating the BB. - int min_arg_count = (grid_lat_lon_form) ? 7 : 5; - if (argc > min_arg_count) { - // argv[5..n] holds strings; each are little Grid Selection Expressions - // to be parsed and evaluated. - vector < GSEClause * > clauses; - gse_arg *arg = new gse_arg(l_grid); - for (int i = min_arg_count; i < argc; ++i) { - parse_gse_expression(arg, argv[i]); - clauses.push_back(arg->get_gsec()); - } - delete arg; - arg = 0; - - apply_grid_selection_expressions(l_grid, clauses); - } - - try { - // Build a GeoConstraint object. If there are no longitude/latitude - // maps then this constructor throws Error. - GridGeoConstraint gc(l_grid); - - // This sets the bounding box and modifies the maps to match the - // notation of the box (0/359 or -180/179) - int box_index_offset = (grid_lat_lon_form) ? 3 : 1; - double top = extract_double_value(argv[box_index_offset]); - double left = extract_double_value(argv[box_index_offset + 1]); - double bottom = extract_double_value(argv[box_index_offset + 2]); - double right = extract_double_value(argv[box_index_offset + 3]); - gc.set_bounding_box(top, left, bottom, right); - DBG(cerr << "geogrid: past bounding box set" << endl); - - // This also reads all of the data into the grid variable - gc.apply_constraint_to_data(); - DBG(cerr << "geogrid: past apply constraint" << endl); - - // In this function the l_grid pointer is the same as the pointer returned - // by this call. The caller of the function must free the pointer. - *btpp = gc.get_constrained_grid(); - return; - } - catch (Error &e) { - throw e; - } - catch (exception & e) { - throw - InternalErr(string - ("A C++ exception was thrown from inside geogrid(): ") - + e.what()); - } -} - -// These static functions could be moved to a class that provides a more -// general interface for COARDS/CF someday. Assume each BaseType comes bundled -// with an attribute table. - -// This was ripped from parser-util.cc -static double string_to_double(const char *val) -{ - char *ptr; - errno = 0; - // Clear previous value. 5/21/2001 jhrg - -#ifdef WIN32 - double v = w32strtod(val, &ptr); -#else - double v = strtod(val, &ptr); -#endif - - if ((v == 0.0 && (val == ptr || errno == HUGE_VAL || errno == ERANGE)) - || *ptr != '\0') { - throw Error(malformed_expr,string("Could not convert the string '") + val + "' to a double."); - } - - double abs_val = fabs(v); - if (abs_val > DODS_DBL_MAX || (abs_val != 0.0 && abs_val < DODS_DBL_MIN)) - throw Error(malformed_expr,string("Could not convert the string '") + val + "' to a double."); - - return v; -} - -/** Look for any one of a series of attribute values in the attribute table - for \e var. This function treats the list of attributes as if they are ordered - from most to least likely/important. It stops when the first of the vector of - values is found. If the variable (var) is a Grid, this function also looks - at the Grid's Array for the named attributes. In all cases it returns the - first value found. - @param var Look for attributes in this BaseType variable. - @param attributes A vector of attributes; the first one found will be returned. - @return The attribute value in a double. */ -static double get_attribute_double_value(BaseType *var, - vector &attributes) -{ - // This code also builds a list of the attribute values that have been - // passed in but not found so that an informative message can be returned. - AttrTable &attr = var->get_attr_table(); - string attribute_value = ""; - string values = ""; - vector::iterator i = attributes.begin(); - while (attribute_value == "" && i != attributes.end()) { - values += *i; - if (!values.empty()) - values += ", "; - attribute_value = attr.get_attr(*i++); - } - - // If the value string is empty, then look at the grid's array (if it's a - // grid) or throw an Error. - if (attribute_value.empty()) { - if (var->type() == dods_grid_c) - return get_attribute_double_value(dynamic_cast(*var).get_array(), attributes); - else - throw Error(malformed_expr,string("No COARDS/CF '") + values.substr(0, values.length() - 2) - + "' attribute was found for the variable '" - + var->name() + "'."); - } - - return string_to_double(remove_quotes(attribute_value).c_str()); -} - -static double get_attribute_double_value(BaseType *var, const string &attribute) -{ - AttrTable &attr = var->get_attr_table(); - string attribute_value = attr.get_attr(attribute); - - // If the value string is empty, then look at the grid's array (if it's a - // grid or throw an Error. - if (attribute_value.empty()) { - if (var->type() == dods_grid_c) - return get_attribute_double_value(dynamic_cast(*var).get_array(), attribute); - else - throw Error(malformed_expr,string("No COARDS '") + attribute - + "' attribute was found for the variable '" - + var->name() + "'."); - } - - return string_to_double(remove_quotes(attribute_value).c_str()); -} - -static double get_y_intercept(BaseType *var) -{ - vector attributes; - attributes.push_back("add_offset"); - attributes.push_back("add_off"); - return get_attribute_double_value(var, attributes); -} - -static double get_slope(BaseType *var) -{ - return get_attribute_double_value(var, "scale_factor"); -} - -static double get_missing_value(BaseType *var) -{ - return get_attribute_double_value(var, "missing_value"); -} - -/** Given a BaseType, scale it using 'y = mx + b'. Either provide the - constants 'm' and 'b' or the function will look for the COARDS attributes - 'scale_factor' and 'add_offset'. - - @param argc A count of the arguments - @param argv An array of pointers to each argument, wrapped in a child of BaseType - @param btpp A pointer to the return value; caller must delete. - - @return The scaled variable, represented using Float64 - @exception Error Thrown if scale_factor is not given and the COARDS - attributes cannot be found OR if the source variable is not a - numeric scalar, Array or Grid. */ -void -function_linear_scale(int argc, BaseType * argv[], DDS &, BaseType **btpp) -{ - string info = - string("\n") + - "\n" + - ""; - - if (argc == 0) { - Str *response = new Str("info"); - response->set_value(info); - *btpp = response; - return; - } - - // Check for 1 or 3 arguments: 1 --> use attributes; 3 --> m & b supplied - DBG(cerr << "argc = " << argc << endl); - if (!(argc == 1 || argc == 3 || argc == 4)) - throw Error(malformed_expr,"Wrong number of arguments to linear_scale(). See linear_scale() for more information"); - - // Get m & b - bool use_missing = false; - double m, b, missing = 0.0; - if (argc == 4) { - m = extract_double_value(argv[1]); - b = extract_double_value(argv[2]); - missing = extract_double_value(argv[3]); - use_missing = true; - } else if (argc == 3) { - m = extract_double_value(argv[1]); - b = extract_double_value(argv[2]); - use_missing = false; - } else { - m = get_slope(argv[0]); - - // This is really a hack; on a fair number of datasets, the y intercept - // is not given and is assumed to be 0. Here the function looks and - // catches the error if a y intercept is not found. - try { - b = get_y_intercept(argv[0]); - } - catch (Error &e) { - b = 0.0; - } - - // This is not the best plan; the get_missing_value() function should - // do something other than throw, but to do that would require mayor - // surgery on get_attribute_double_value(). - try { - missing = get_missing_value(argv[0]); - use_missing = true; - } - catch (Error &e) { - use_missing = false; - } - } - - DBG(cerr << "m: " << m << ", b: " << b << endl);DBG(cerr << "use_missing: " << use_missing << ", missing: " << missing << endl); - - // Read the data, scale and return the result. Must replace the new data - // in a constructor (i.e., Array part of a Grid). - BaseType *dest = 0; - double *data; - if (argv[0]->type() == dods_grid_c) { - Array &source = *dynamic_cast(*argv[0]).get_array(); - source.set_send_p(true); - source.read(); - data = extract_double_array(&source); - int length = source.length(); - int i = 0; - while (i < length) { - DBG2(cerr << "data[" << i << "]: " << data[i] << endl); - if (!use_missing || !double_eq(data[i], missing)) - data[i] = data[i] * m + b; - DBG2(cerr << " >> data[" << i << "]: " << data[i] << endl); - ++i; - } - - // Vector::add_var will delete the existing 'template' variable - Float64 *temp_f = new Float64(source.name()); - source.add_var(temp_f); -#ifdef VAL2BUF - source.val2buf(static_cast(data), false); -#else - source.set_value(data, i); -#endif - delete [] data; // val2buf copies. - delete temp_f; // add_var copies and then adds. - dest = argv[0]; - } else if (argv[0]->is_vector_type()) { - Array &source = dynamic_cast(*argv[0]); - source.set_send_p(true); - // If the array is really a map, make sure to read using the Grid - // because of the HDF4 handler's odd behavior WRT dimensions. - if (source.get_parent() && source.get_parent()->type() == dods_grid_c) - source.get_parent()->read(); - else - source.read(); - - data = extract_double_array(&source); - int length = source.length(); - int i = 0; - while (i < length) { - if (!use_missing || !double_eq(data[i], missing)) - data[i] = data[i] * m + b; - ++i; - } - - Float64 *temp_f = new Float64(source.name()); - source.add_var(temp_f); - - source.val2buf(static_cast(data), false); - - delete [] data; // val2buf copies. - delete temp_f; // add_var copies and then adds. - - dest = argv[0]; - } else if (argv[0]->is_simple_type() && !(argv[0]->type() == dods_str_c - || argv[0]->type() == dods_url_c)) { - double data = extract_double_value(argv[0]); - if (!use_missing || !double_eq(data, missing)) - data = data * m + b; - - dest = new Float64(argv[0]->name()); - - dest->val2buf(static_cast(&data)); - - } else { - throw Error(malformed_expr,"The linear_scale() function works only for numeric Grids, Arrays and scalars."); - } - - *btpp = dest; - return; -} - -#if 0 -/** Perform a selection on the array using geographical coordinates. This - function takes several groups of arguments. -
      -
    • geoarray(var, top, left, bottom, right)
    • -
    • geoarray(var, top, left, bottom, right, var_top, v_left, v_bottom, v_right)
    • -
    • geoarray(var, top, left, bottom, right, var_top, v_left, v_bottom, v_right, projection, datum)
    • -
    - - @note Only the plat-carre projection and wgs84 datum are currently - supported. - - @param argc A count of the arguments - @param argv An array of pointers to each argument, wrapped in a child of BaseType - @param btpp A pointer to the return value; caller must delete. - - @return The Array, constrained by the selection - @exception Error Thrown if thins go awry. */ -void -function_geoarray(int argc, BaseType * argv[], DDS &, BaseType **btpp) -{ - string info = - string("\n") + - "\n" + - ""; - - if (argc == 0) { - Str *response = new Str("version"); - response->set_value(info); - *btpp = response; - return; - } - - DBG(cerr << "argc = " << argc << endl); - if (!(argc == 5 || argc == 9 || argc == 11)) - throw Error(malformed_expr,"Wrong number of arguments to geoarray(). See geoarray() for more information."); - - // Check the Array (and dup because the caller will free the variable). - Array *l_array = dynamic_cast < Array * >(argv[0]->ptr_duplicate()); - if (!l_array) - throw Error(malformed_expr,"The first argument to geoarray() must be an Array variable!"); - - try { - - // Read the bounding box and variable extents from the params - double bb_top = extract_double_value(argv[1]); - double bb_left = extract_double_value(argv[2]); - double bb_bottom = extract_double_value(argv[3]); - double bb_right = extract_double_value(argv[4]); - - switch (argc) { - case 5: { - ArrayGeoConstraint agc(l_array); - - agc.set_bounding_box(bb_left, bb_top, bb_right, bb_bottom); - // This also reads all of the data into the grid variable - agc.apply_constraint_to_data(); - *btpp = agc.get_constrained_array(); - return; - break; - } - case 9: { - double var_top = extract_double_value(argv[5]); - double var_left = extract_double_value(argv[6]); - double var_bottom = extract_double_value(argv[7]); - double var_right = extract_double_value(argv[8]); - ArrayGeoConstraint agc (l_array, var_left, var_top, var_right, var_bottom); - - agc.set_bounding_box(bb_left, bb_top, bb_right, bb_bottom); - // This also reads all of the data into the grid variable - agc.apply_constraint_to_data(); - *btpp = agc.get_constrained_array(); - return; - break; - } - case 11: { - double var_top = extract_double_value(argv[5]); - double var_left = extract_double_value(argv[6]); - double var_bottom = extract_double_value(argv[7]); - double var_right = extract_double_value(argv[8]); - string projection = extract_string_argument(argv[9]); - string datum = extract_string_argument(argv[10]); - ArrayGeoConstraint agc(l_array, - var_left, var_top, var_right, var_bottom, - projection, datum); - - agc.set_bounding_box(bb_left, bb_top, bb_right, bb_bottom); - // This also reads all of the data into the grid variable - agc.apply_constraint_to_data(); - *btpp = agc.get_constrained_array(); - return; - break; - } - default: - throw InternalErr(__FILE__, __LINE__, "Wrong number of args to geoarray."); - } - } - catch (Error & e) { - throw e; - } - catch (exception & e) { - throw - InternalErr(string - ("A C++ exception was thrown from inside geoarray(): ") - + e.what()); - - } - - throw InternalErr(__FILE__, __LINE__, "Impossible condition in geoarray."); -} -#endif - -void register_functions(ConstraintEvaluator & ce) -{ - ce.add_function("grid", function_grid); - ce.add_function("geogrid", function_geogrid); - ce.add_function("linear_scale", function_linear_scale); -#if 0 - ce.add_function("geoarray", function_geoarray); -#endif - ce.add_function("version", function_version); - - ce.add_function("dap", function_dap); -} - -} // namespace libdap diff -Nru libdap-3.11.1/ce_functions.h libdap-3.12.0/ce_functions.h --- libdap-3.11.1/ce_functions.h 2011-04-29 13:19:43.000000000 +0000 +++ libdap-3.12.0/ce_functions.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,66 +0,0 @@ - -// -*- mode: c++; c-basic-offset:4 -*- - -// This file is part of libdap, A C++ implementation of the OPeNDAP Data -// Access Protocol. - -// Copyright (c) 2002,2003 OPeNDAP, Inc. -// Author: James Gallagher -// -// This library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Lesser General Public -// License as published by the Free Software Foundation; either -// version 2.1 of the License, or (at your option) any later version. -// -// This library 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 -// Lesser General Public License for more details. -// -// You should have received a copy of the GNU Lesser General Public -// License along with this library; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -// -// You can contact OPeNDAP, Inc. at PO Box 112, Saunderstown, RI. 02874-0112. - -// (c) COPYRIGHT URI/MIT 1999 -// Please read the full copyright statement in the file COPYRIGHT_URI. -// -// Authors: -// jhrg,jimg James Gallagher - -// Declarations for CE functions. -// -// 1/15/99 jhrg - -#ifndef _ce_functions_h -#define _ce_functions_h - -#include "BaseType.h" -#include "Array.h" -#include "Error.h" -#include "ConstraintEvaluator.h" - -namespace libdap -{ - -// These functions are use by the code in GeoConstraint -string extract_string_argument(BaseType *arg) ; -double extract_double_value(BaseType *arg) ; -double *extract_double_array(Array *a) ; -void set_array_using_double(Array *dest, double *src, int src_len) ; - -void func_version(int argc, BaseType *argv[], DDS &dds, BaseType **btpp) ; -void function_grid(int argc, BaseType *argv[], DDS &dds, BaseType **btpp) ; -void function_geogrid(int argc, BaseType *argv[], DDS &dds, BaseType **btpp) ; -void function_linear_scale(int argc, BaseType *argv[], DDS &dds, BaseType **btpp) ; -void function_geoarray(int argc, BaseType *argv[], DDS &dds, BaseType **btpp) ; - -// Projection function used to pass DAP version information -void function_dap(int argc, BaseType *argv[], DDS &dds, ConstraintEvaluator &ce); - -void register_functions(ConstraintEvaluator &ce); - -} // namespace libdap - -#endif // _ce_functions_h diff -Nru libdap-3.11.1/ce_parser.h libdap-3.12.0/ce_parser.h --- libdap-3.11.1/ce_parser.h 2011-04-29 13:19:43.000000000 +0000 +++ libdap-3.12.0/ce_parser.h 2013-10-17 21:27:40.000000000 +0000 @@ -1,3 +1,7 @@ + +#ifndef CE_PARSER_H_ +#define CE_PARSER_H_ + namespace libdap { @@ -34,3 +38,4 @@ } // namespace libdap +#endif // CE_PARSER_H_ diff -Nru libdap-3.11.1/conf/acinclude.m4 libdap-3.12.0/conf/acinclude.m4 --- libdap-3.11.1/conf/acinclude.m4 2011-04-29 13:19:26.000000000 +0000 +++ libdap-3.12.0/conf/acinclude.m4 2013-10-17 21:27:40.000000000 +0000 @@ -18,7 +18,7 @@ # 4. Macros for locating various systems (Matlab, etc.) # 5. Macros used to test things about the computer/OS/hardware # -# $Id: acinclude.m4 18942 2008-06-25 21:27:05Z jimg $ +# $Id: acinclude.m4 25670 2012-06-29 20:26:48Z jimg $ # 1. Unidata's macros #------------------------------------------------------------------------- @@ -516,16 +516,22 @@ # DMH: Divide into two sets of tests: one for DODS and one for XDR if test x"$dap_use_c99_types" = 'xyes'; then + DODS_INT64=int64_t + DODS_UINT64=uint64_t DODS_INT32=int32_t DODS_UINT32=uint32_t DODS_INT16=int16_t DODS_UINT16=uint16_t + DODS_INT8=int8_t DODS_BYTE=uint8_t else + DODS_INT64="long long" + DODS_UINT64="unsigned long long" DODS_INT16=short DODS_UINT16="unsigned short" DODS_INT32=int DODS_UINT32="unsigned int" + DODS_INT8=char DODS_BYTE="unsigned char" fi DODS_FLOAT64=double @@ -534,15 +540,22 @@ # I'm using the three arg form of AC_DEFINE_UNQUOTED because autoheader # needs the third argument (although I don't quite get the specifics... # 2/15/2001 jhrg - AC_DEFINE_UNQUOTED(DINT32, $DODS_INT32, [int32]) - AC_DEFINE_UNQUOTED(DUINT32, $DODS_UINT32, [uint32]) - AC_DEFINE_UNQUOTED(DINT16, $DODS_INT16, [dint16]) - AC_DEFINE_UNQUOTED(DUINT16, $DODS_UINT16, [uint16]) - AC_DEFINE_UNQUOTED(DFLOAT64, $DODS_FLOAT64, [dfloat64]) - AC_DEFINE_UNQUOTED(DFLOAT32, $DODS_FLOAT32, [dfloat32]) - AC_DEFINE_UNQUOTED(DBYTE, $DODS_BYTE, [dbyte]) + AC_DEFINE_UNQUOTED(DINT64, $DODS_INT64, [64-bit integer type]) + AC_DEFINE_UNQUOTED(DUINT64, $DODS_UINT64, [64-bit unsigned integer type]) + AC_DEFINE_UNQUOTED(DINT32, $DODS_INT32, [32-bit integer type]) + AC_DEFINE_UNQUOTED(DUINT32, $DODS_UINT32, [32-bit unsigned integer type]) + AC_DEFINE_UNQUOTED(DINT16, $DODS_INT16, [16-bit integer type]) + AC_DEFINE_UNQUOTED(DUINT16, $DODS_UINT16, [16-bit unsigned integer type]) + AC_DEFINE_UNQUOTED(DFLOAT64, $DODS_FLOAT64, [64-bit real type]) + AC_DEFINE_UNQUOTED(DFLOAT32, $DODS_FLOAT32, [32-bit real type]) + AC_DEFINE_UNQUOTED(DINT8, $DODS_INT8, [8-bit integer type]) + AC_DEFINE_UNQUOTED(DBYTE, $DODS_BYTE, [unsigned bytes/chars]) # XDR INTEGER TYPES + # + # Since DAP4 does not use XDR, there are no defines for the int8 or the + # 64-bit integer types used by DAP4. jhrg 6/26/12 + # # Unfortunately, there is little commonality about xdr # First, we need to see if the xdr routines are in libc, librpc, diff -Nru libdap-3.11.1/conf/arg-nonnull.h libdap-3.12.0/conf/arg-nonnull.h --- libdap-3.11.1/conf/arg-nonnull.h 2011-04-29 13:19:26.000000000 +0000 +++ libdap-3.12.0/conf/arg-nonnull.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,26 +0,0 @@ -/* A C macro for declaring that specific arguments must not be NULL. - Copyright (C) 2009-2011 Free Software Foundation, Inc. - - This program is free software: you can redistribute it and/or modify it - under the terms of the GNU General Public License as published - by the Free Software Foundation; either version 3 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 - Lesser General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program. If not, see . */ - -/* _GL_ARG_NONNULL((n,...,m)) tells the compiler and static analyzer tools - that the values passed as arguments n, ..., m must be non-NULL pointers. - n = 1 stands for the first argument, n = 2 for the second argument etc. */ -#ifndef _GL_ARG_NONNULL -# if (__GNUC__ == 3 && __GNUC_MINOR__ >= 3) || __GNUC__ > 3 -# define _GL_ARG_NONNULL(params) __attribute__ ((__nonnull__ params)) -# else -# define _GL_ARG_NONNULL(params) -# endif -#endif diff -Nru libdap-3.11.1/conf/c++defs.h libdap-3.12.0/conf/c++defs.h --- libdap-3.11.1/conf/c++defs.h 2011-04-29 13:19:26.000000000 +0000 +++ libdap-3.12.0/conf/c++defs.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,271 +0,0 @@ -/* C++ compatible function declaration macros. - Copyright (C) 2010-2011 Free Software Foundation, Inc. - - This program is free software: you can redistribute it and/or modify it - under the terms of the GNU General Public License as published - by the Free Software Foundation; either version 3 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 - Lesser General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program. If not, see . */ - -#ifndef _GL_CXXDEFS_H -#define _GL_CXXDEFS_H - -/* The three most frequent use cases of these macros are: - - * For providing a substitute for a function that is missing on some - platforms, but is declared and works fine on the platforms on which - it exists: - - #if @GNULIB_FOO@ - # if !@HAVE_FOO@ - _GL_FUNCDECL_SYS (foo, ...); - # endif - _GL_CXXALIAS_SYS (foo, ...); - _GL_CXXALIASWARN (foo); - #elif defined GNULIB_POSIXCHECK - ... - #endif - - * For providing a replacement for a function that exists on all platforms, - but is broken/insufficient and needs to be replaced on some platforms: - - #if @GNULIB_FOO@ - # if @REPLACE_FOO@ - # if !(defined __cplusplus && defined GNULIB_NAMESPACE) - # undef foo - # define foo rpl_foo - # endif - _GL_FUNCDECL_RPL (foo, ...); - _GL_CXXALIAS_RPL (foo, ...); - # else - _GL_CXXALIAS_SYS (foo, ...); - # endif - _GL_CXXALIASWARN (foo); - #elif defined GNULIB_POSIXCHECK - ... - #endif - - * For providing a replacement for a function that exists on some platforms - but is broken/insufficient and needs to be replaced on some of them and - is additionally either missing or undeclared on some other platforms: - - #if @GNULIB_FOO@ - # if @REPLACE_FOO@ - # if !(defined __cplusplus && defined GNULIB_NAMESPACE) - # undef foo - # define foo rpl_foo - # endif - _GL_FUNCDECL_RPL (foo, ...); - _GL_CXXALIAS_RPL (foo, ...); - # else - # if !@HAVE_FOO@ or if !@HAVE_DECL_FOO@ - _GL_FUNCDECL_SYS (foo, ...); - # endif - _GL_CXXALIAS_SYS (foo, ...); - # endif - _GL_CXXALIASWARN (foo); - #elif defined GNULIB_POSIXCHECK - ... - #endif -*/ - -/* _GL_EXTERN_C declaration; - performs the declaration with C linkage. */ -#if defined __cplusplus -# define _GL_EXTERN_C extern "C" -#else -# define _GL_EXTERN_C extern -#endif - -/* _GL_FUNCDECL_RPL (func, rettype, parameters_and_attributes); - declares a replacement function, named rpl_func, with the given prototype, - consisting of return type, parameters, and attributes. - Example: - _GL_FUNCDECL_RPL (open, int, (const char *filename, int flags, ...) - _GL_ARG_NONNULL ((1))); - */ -#define _GL_FUNCDECL_RPL(func,rettype,parameters_and_attributes) \ - _GL_FUNCDECL_RPL_1 (rpl_##func, rettype, parameters_and_attributes) -#define _GL_FUNCDECL_RPL_1(rpl_func,rettype,parameters_and_attributes) \ - _GL_EXTERN_C rettype rpl_func parameters_and_attributes - -/* _GL_FUNCDECL_SYS (func, rettype, parameters_and_attributes); - declares the system function, named func, with the given prototype, - consisting of return type, parameters, and attributes. - Example: - _GL_FUNCDECL_SYS (open, int, (const char *filename, int flags, ...) - _GL_ARG_NONNULL ((1))); - */ -#define _GL_FUNCDECL_SYS(func,rettype,parameters_and_attributes) \ - _GL_EXTERN_C rettype func parameters_and_attributes - -/* _GL_CXXALIAS_RPL (func, rettype, parameters); - declares a C++ alias called GNULIB_NAMESPACE::func - that redirects to rpl_func, if GNULIB_NAMESPACE is defined. - Example: - _GL_CXXALIAS_RPL (open, int, (const char *filename, int flags, ...)); - */ -#define _GL_CXXALIAS_RPL(func,rettype,parameters) \ - _GL_CXXALIAS_RPL_1 (func, rpl_##func, rettype, parameters) -#if defined __cplusplus && defined GNULIB_NAMESPACE -# define _GL_CXXALIAS_RPL_1(func,rpl_func,rettype,parameters) \ - namespace GNULIB_NAMESPACE \ - { \ - rettype (*const func) parameters = ::rpl_func; \ - } \ - _GL_EXTERN_C int _gl_cxxalias_dummy -#else -# define _GL_CXXALIAS_RPL_1(func,rpl_func,rettype,parameters) \ - _GL_EXTERN_C int _gl_cxxalias_dummy -#endif - -/* _GL_CXXALIAS_RPL_CAST_1 (func, rpl_func, rettype, parameters); - is like _GL_CXXALIAS_RPL_1 (func, rpl_func, rettype, parameters); - except that the C function rpl_func may have a slightly different - declaration. A cast is used to silence the "invalid conversion" error - that would otherwise occur. */ -#if defined __cplusplus && defined GNULIB_NAMESPACE -# define _GL_CXXALIAS_RPL_CAST_1(func,rpl_func,rettype,parameters) \ - namespace GNULIB_NAMESPACE \ - { \ - rettype (*const func) parameters = \ - reinterpret_cast(::rpl_func); \ - } \ - _GL_EXTERN_C int _gl_cxxalias_dummy -#else -# define _GL_CXXALIAS_RPL_CAST_1(func,rpl_func,rettype,parameters) \ - _GL_EXTERN_C int _gl_cxxalias_dummy -#endif - -/* _GL_CXXALIAS_SYS (func, rettype, parameters); - declares a C++ alias called GNULIB_NAMESPACE::func - that redirects to the system provided function func, if GNULIB_NAMESPACE - is defined. - Example: - _GL_CXXALIAS_SYS (open, int, (const char *filename, int flags, ...)); - */ -#if defined __cplusplus && defined GNULIB_NAMESPACE - /* If we were to write - rettype (*const func) parameters = ::func; - like above in _GL_CXXALIAS_RPL_1, the compiler could optimize calls - better (remove an indirection through a 'static' pointer variable), - but then the _GL_CXXALIASWARN macro below would cause a warning not only - for uses of ::func but also for uses of GNULIB_NAMESPACE::func. */ -# define _GL_CXXALIAS_SYS(func,rettype,parameters) \ - namespace GNULIB_NAMESPACE \ - { \ - static rettype (*func) parameters = ::func; \ - } \ - _GL_EXTERN_C int _gl_cxxalias_dummy -#else -# define _GL_CXXALIAS_SYS(func,rettype,parameters) \ - _GL_EXTERN_C int _gl_cxxalias_dummy -#endif - -/* _GL_CXXALIAS_SYS_CAST (func, rettype, parameters); - is like _GL_CXXALIAS_SYS (func, rettype, parameters); - except that the C function func may have a slightly different declaration. - A cast is used to silence the "invalid conversion" error that would - otherwise occur. */ -#if defined __cplusplus && defined GNULIB_NAMESPACE -# define _GL_CXXALIAS_SYS_CAST(func,rettype,parameters) \ - namespace GNULIB_NAMESPACE \ - { \ - static rettype (*func) parameters = \ - reinterpret_cast(::func); \ - } \ - _GL_EXTERN_C int _gl_cxxalias_dummy -#else -# define _GL_CXXALIAS_SYS_CAST(func,rettype,parameters) \ - _GL_EXTERN_C int _gl_cxxalias_dummy -#endif - -/* _GL_CXXALIAS_SYS_CAST2 (func, rettype, parameters, rettype2, parameters2); - is like _GL_CXXALIAS_SYS (func, rettype, parameters); - except that the C function is picked among a set of overloaded functions, - namely the one with rettype2 and parameters2. Two consecutive casts - are used to silence the "cannot find a match" and "invalid conversion" - errors that would otherwise occur. */ -#if defined __cplusplus && defined GNULIB_NAMESPACE - /* The outer cast must be a reinterpret_cast. - The inner cast: When the function is defined as a set of overloaded - functions, it works as a static_cast<>, choosing the designated variant. - When the function is defined as a single variant, it works as a - reinterpret_cast<>. The parenthesized cast syntax works both ways. */ -# define _GL_CXXALIAS_SYS_CAST2(func,rettype,parameters,rettype2,parameters2) \ - namespace GNULIB_NAMESPACE \ - { \ - static rettype (*func) parameters = \ - reinterpret_cast( \ - (rettype2(*)parameters2)(::func)); \ - } \ - _GL_EXTERN_C int _gl_cxxalias_dummy -#else -# define _GL_CXXALIAS_SYS_CAST2(func,rettype,parameters,rettype2,parameters2) \ - _GL_EXTERN_C int _gl_cxxalias_dummy -#endif - -/* _GL_CXXALIASWARN (func); - causes a warning to be emitted when ::func is used but not when - GNULIB_NAMESPACE::func is used. func must be defined without overloaded - variants. */ -#if defined __cplusplus && defined GNULIB_NAMESPACE -# define _GL_CXXALIASWARN(func) \ - _GL_CXXALIASWARN_1 (func, GNULIB_NAMESPACE) -# define _GL_CXXALIASWARN_1(func,namespace) \ - _GL_CXXALIASWARN_2 (func, namespace) -/* To work around GCC bug , - we enable the warning only when not optimizing. */ -# if !__OPTIMIZE__ -# define _GL_CXXALIASWARN_2(func,namespace) \ - _GL_WARN_ON_USE (func, \ - "The symbol ::" #func " refers to the system function. " \ - "Use " #namespace "::" #func " instead.") -# elif __GNUC__ >= 3 && GNULIB_STRICT_CHECKING -# define _GL_CXXALIASWARN_2(func,namespace) \ - extern __typeof__ (func) func -# else -# define _GL_CXXALIASWARN_2(func,namespace) \ - _GL_EXTERN_C int _gl_cxxalias_dummy -# endif -#else -# define _GL_CXXALIASWARN(func) \ - _GL_EXTERN_C int _gl_cxxalias_dummy -#endif - -/* _GL_CXXALIASWARN1 (func, rettype, parameters_and_attributes); - causes a warning to be emitted when the given overloaded variant of ::func - is used but not when GNULIB_NAMESPACE::func is used. */ -#if defined __cplusplus && defined GNULIB_NAMESPACE -# define _GL_CXXALIASWARN1(func,rettype,parameters_and_attributes) \ - _GL_CXXALIASWARN1_1 (func, rettype, parameters_and_attributes, \ - GNULIB_NAMESPACE) -# define _GL_CXXALIASWARN1_1(func,rettype,parameters_and_attributes,namespace) \ - _GL_CXXALIASWARN1_2 (func, rettype, parameters_and_attributes, namespace) -/* To work around GCC bug , - we enable the warning only when not optimizing. */ -# if !__OPTIMIZE__ -# define _GL_CXXALIASWARN1_2(func,rettype,parameters_and_attributes,namespace) \ - _GL_WARN_ON_USE_CXX (func, rettype, parameters_and_attributes, \ - "The symbol ::" #func " refers to the system function. " \ - "Use " #namespace "::" #func " instead.") -# elif __GNUC__ >= 3 && GNULIB_STRICT_CHECKING -# define _GL_CXXALIASWARN1_2(func,rettype,parameters_and_attributes,namespace) \ - extern __typeof__ (func) func -# else -# define _GL_CXXALIASWARN1_2(func,rettype,parameters_and_attributes,namespace) \ - _GL_EXTERN_C int _gl_cxxalias_dummy -# endif -#else -# define _GL_CXXALIASWARN1(func,rettype,parameters_and_attributes) \ - _GL_EXTERN_C int _gl_cxxalias_dummy -#endif - -#endif /* _GL_CXXDEFS_H */ diff -Nru libdap-3.11.1/conf/check_zlib.m4 libdap-3.12.0/conf/check_zlib.m4 --- libdap-3.11.1/conf/check_zlib.m4 2011-04-29 13:19:26.000000000 +0000 +++ libdap-3.12.0/conf/check_zlib.m4 1970-01-01 00:00:00.000000000 +0000 @@ -1,122 +0,0 @@ -##### http://autoconf-archive.cryp.to/check_zlib.html -# -# SYNOPSIS -# -# CHECK_ZLIB() -# -# DESCRIPTION -# -# This macro searches for an installed zlib library. If nothing was -# specified when calling configure, it searches first in /usr/local -# and then in /usr. If the --with-zlib=DIR is specified, it will try -# to find it in DIR/include/zlib.h and DIR/lib/libz.a. If -# --without-zlib is specified, the library is not searched at all. -# -# If either the header file (zlib.h) or the library (libz) is not -# found, the configuration exits on error, asking for a valid zlib -# installation directory or --without-zlib. -# -# The macro defines the symbol HAVE_LIBZ if the library is found. You -# should use autoheader to include a definition for this symbol in a -# config.h file. Sample usage in a C/C++ source is as follows: -# -# #ifdef HAVE_LIBZ -# #include -# #endif /* HAVE_LIBZ */ -# -# LAST MODIFICATION -# -# 2004-09-20 -# -# COPYLEFT -# -# Copyright (c) 2004 Loic Dachary -# -# This program is free software; you can redistribute it and/or -# modify it under the terms of the GNU General Public License as -# published by the Free Software Foundation; either version 2 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, the respective Autoconf Macro's copyright -# owner gives unlimited permission to copy, distribute and modify the -# configure scripts that are the output of Autoconf when processing -# the Macro. You need not follow the terms of the GNU General Public -# License when using or distributing such scripts, even though -# portions of the text of the Macro appear in them. The GNU General -# Public License (GPL) does govern all other use of the material that -# constitutes the Autoconf Macro. -# -# This special exception to the GPL applies to versions of the -# Autoconf Macro released by the Autoconf Macro Archive. When you -# make and distribute a modified version of the Autoconf Macro, you -# may extend this special exception to the GPL to apply to your -# modified version as well. - -AC_DEFUN([DAP_CHECK_ZLIB], -# -# Handle user hints -# -[ -AC_ARG_WITH(zlib, -[ --with-zlib=DIR root directory path of zlib installation [defaults to - /usr/local or /usr if not found in /usr/local] - --without-zlib to disable zlib usage completely], -[if test "$withval" != no ; then - if test -d "$withval" - then - ZLIB_HOME="$withval" - else - AC_MSG_WARN([Sorry, $withval does not exist, checking usual places]) - fi -else - AC_MSG_WARN([zlib is required for deflate, not disabled]) -fi]) - -ZLIB_OLD_LDFLAGS=$LDFLAGS -ZLIB_OLD_CPPFLAGS=$CPPFLAGS - -# -# Locate zlib, if wanted -# -if test -n "${ZLIB_HOME}" -then - LDFLAGS="$LDFLAGS -L${ZLIB_HOME}/lib" - CPPFLAGS="$CPPFLAGS -I${ZLIB_HOME}/include" -fi -AC_LANG_SAVE -AC_LANG_C -AC_CHECK_LIB(z, inflateEnd, [zlib_cv_libz=yes], [zlib_cv_libz=no]) -AC_CHECK_HEADER(zlib.h, [zlib_cv_zlib_h=yes], [zlib_cv_zlib_h=no]) -AC_LANG_RESTORE - -if test "$zlib_cv_libz" = "yes" -a "$zlib_cv_zlib_h" = "yes" -then - # - # If both library and header were found, use them - # - ZLIB_LIBS="-lz" -else - # - # If either header or library was not found, revert and bomb - # - AC_MSG_ERROR([zlib is required for deflate, specify a valid zlib installation with --with-zlib=DIR]) -fi - -LDFLAGS="$ZLIB_OLD_LDFLAGS" -CPPFLAGS="$ZLIB_OLD_CPPFLAGS" - -AC_SUBST([ZLIB_LIBS]) -AC_SUBST([ZLIB_LDFLAGS]) -AC_SUBST([ZLIB_CFLAGS]) - -]) diff -Nru libdap-3.11.1/conf/config.guess libdap-3.12.0/conf/config.guess --- libdap-3.11.1/conf/config.guess 2011-05-06 17:36:28.000000000 +0000 +++ libdap-3.12.0/conf/config.guess 2013-10-17 21:27:40.000000000 +0000 @@ -1,10 +1,10 @@ #! /bin/sh # Attempt to guess a canonical system name. # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, -# 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008 -# Free Software Foundation, Inc. +# 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, +# 2011, 2012 Free Software Foundation, Inc. -timestamp='2009-04-27' +timestamp='2012-02-10' # 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 @@ -17,9 +17,7 @@ # 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., 51 Franklin Street - Fifth Floor, Boston, MA -# 02110-1301, USA. +# along with this program; if not, see . # # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a @@ -27,16 +25,16 @@ # the same distribution terms that you use for the rest of that program. -# Originally written by Per Bothner . -# Please send patches to . Submit a context -# diff and a properly formatted ChangeLog entry. +# Originally written by Per Bothner. Please send patches (context +# diff format) to and include a 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. +# You can get the latest version of this script from: +# http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess;hb=HEAD me=`echo "$0" | sed -e 's,.*/,,'` @@ -56,8 +54,9 @@ GNU config.guess ($timestamp) Originally written by Per Bothner. -Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, -2002, 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc. +Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, +2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012 +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." @@ -144,7 +143,7 @@ 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*, + # more of the tuples: *-*-netbsdelf*, *-*-netbsdaout*, # *-*-netbsdecoff* and *-*-netbsd*. For targets that recently # switched to ELF, *-*-netbsd* would select the old # object file format. This provides both forward @@ -170,7 +169,7 @@ 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 + | grep -q __ELF__ then # Once all utilities can be ECOFF (netbsdecoff) or a.out (netbsdaout). # Return netbsd for either. FIX? @@ -180,7 +179,7 @@ fi ;; *) - os=netbsd + os=netbsd ;; esac # The OS release @@ -223,7 +222,7 @@ UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $3}'` ;; *5.*) - UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $4}'` + UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $4}'` ;; esac # According to Compaq, /usr/sbin/psrinfo has been available on @@ -269,7 +268,10 @@ # A Xn.n version is an unreleased experimental baselevel. # 1.2 uses "1.2" for uname -r. echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[PVTX]//' | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` - exit ;; + # Reset EXIT trap before exiting to avoid spurious non-zero exit code. + exitcode=$? + trap '' 0 + exit $exitcode ;; 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 @@ -295,7 +297,7 @@ echo s390-ibm-zvmoe exit ;; *:OS400:*:*) - echo powerpc-ibm-os400 + echo powerpc-ibm-os400 exit ;; arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*) echo arm-acorn-riscix${UNAME_RELEASE} @@ -333,6 +335,9 @@ sun4*:SunOS:5.*:* | tadpole*:SunOS:5.*:*) echo sparc-sun-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit ;; + i86pc:AuroraUX:5.*:* | i86xen:AuroraUX:5.*:*) + echo i386-pc-auroraux${UNAME_RELEASE} + exit ;; i86pc:SunOS:5.*:* | i86xen:SunOS:5.*:*) eval $set_cc_for_build SUN_ARCH="i386" @@ -391,23 +396,23 @@ # 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} + echo m68k-atari-mint${UNAME_RELEASE} exit ;; atari*:*MiNT:*:* | atari*:*mint:*:* | atarist[e]:*TOS:*:*) echo m68k-atari-mint${UNAME_RELEASE} - exit ;; + exit ;; *falcon*:*MiNT:*:* | *falcon*:*mint:*:* | *falcon*:*TOS:*:*) - echo m68k-atari-mint${UNAME_RELEASE} + echo m68k-atari-mint${UNAME_RELEASE} exit ;; milan*:*MiNT:*:* | milan*:*mint:*:* | *milan*:*TOS:*:*) - echo m68k-milan-mint${UNAME_RELEASE} - exit ;; + echo m68k-milan-mint${UNAME_RELEASE} + exit ;; hades*:*MiNT:*:* | hades*:*mint:*:* | *hades*:*TOS:*:*) - echo m68k-hades-mint${UNAME_RELEASE} - exit ;; + echo m68k-hades-mint${UNAME_RELEASE} + exit ;; *:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*) - echo m68k-unknown-mint${UNAME_RELEASE} - exit ;; + echo m68k-unknown-mint${UNAME_RELEASE} + exit ;; m68k:machten:*:*) echo m68k-apple-machten${UNAME_RELEASE} exit ;; @@ -477,8 +482,8 @@ echo m88k-motorola-sysv3 exit ;; AViiON:dgux:*:*) - # DG/UX returns AViiON for all architectures - UNAME_PROCESSOR=`/usr/bin/uname -p` + # 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 ] || \ @@ -491,7 +496,7 @@ else echo i586-dg-dgux${UNAME_RELEASE} fi - exit ;; + exit ;; M88*:DolphinOS:*:*) # DolphinOS (SVR3) echo m88k-dolphin-sysv3 exit ;; @@ -548,7 +553,7 @@ echo rs6000-ibm-aix3.2 fi exit ;; - *:AIX:*:[456]) + *:AIX:*:[4567]) 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 @@ -591,52 +596,52 @@ 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" ;; + 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 + esac ;; + esac fi if [ "${HP_ARCH}" = "" ]; then eval $set_cc_for_build - sed 's/^ //' << EOF >$dummy.c + sed 's/^ //' << EOF >$dummy.c - #define _HPUX_SOURCE - #include - #include - - 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); - } + #define _HPUX_SOURCE + #include + #include + + 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 -o $dummy $dummy.c 2>/dev/null) && HP_ARCH=`$dummy` test -z "$HP_ARCH" && HP_ARCH=hppa @@ -656,7 +661,7 @@ # => hppa64-hp-hpux11.23 if echo __LP64__ | (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | - grep __LP64__ >/dev/null + grep -q __LP64__ then HP_ARCH="hppa2.0w" else @@ -727,22 +732,22 @@ exit ;; C1*:ConvexOS:*:* | convex:ConvexOS:C1*:*) echo c1-convex-bsd - exit ;; + exit ;; C2*:ConvexOS:*:* | convex:ConvexOS:C2*:*) if getsysinfo -f scalar_acc then echo c32-convex-bsd else echo c2-convex-bsd fi - exit ;; + exit ;; C34*:ConvexOS:*:* | convex:ConvexOS:C34*:*) echo c34-convex-bsd - exit ;; + exit ;; C38*:ConvexOS:*:* | convex:ConvexOS:C38*:*) echo c38-convex-bsd - exit ;; + exit ;; C4*:ConvexOS:*:* | convex:ConvexOS:C4*:*) echo c4-convex-bsd - exit ;; + exit ;; CRAY*Y-MP:*:*:*) echo ymp-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit ;; @@ -766,14 +771,14 @@ exit ;; 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 ;; + 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 ;; 5000:UNIX_System_V:4.*:*) - FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'` - FUJITSU_REL=`echo ${UNAME_RELEASE} | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/ /_/'` - echo "sparc-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" + FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'` + FUJITSU_REL=`echo ${UNAME_RELEASE} | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/ /_/'` + echo "sparc-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" exit ;; i*86:BSD/386:*:* | i*86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*) echo ${UNAME_MACHINE}-pc-bsdi${UNAME_RELEASE} @@ -785,13 +790,12 @@ echo ${UNAME_MACHINE}-unknown-bsdi${UNAME_RELEASE} exit ;; *:FreeBSD:*:*) - case ${UNAME_MACHINE} in - pc98) - echo i386-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;; + UNAME_PROCESSOR=`/usr/bin/uname -p` + case ${UNAME_PROCESSOR} in amd64) echo x86_64-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;; *) - echo ${UNAME_MACHINE}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;; + echo ${UNAME_PROCESSOR}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;; esac exit ;; i*:CYGWIN*:*) @@ -800,19 +804,22 @@ *:MINGW*:*) echo ${UNAME_MACHINE}-pc-mingw32 exit ;; + i*:MSYS*:*) + echo ${UNAME_MACHINE}-pc-msys + exit ;; i*:windows32*:*) - # uname -m includes "-pc" on this system. - echo ${UNAME_MACHINE}-mingw32 + # uname -m includes "-pc" on this system. + echo ${UNAME_MACHINE}-mingw32 exit ;; i*:PW*:*) echo ${UNAME_MACHINE}-pc-pw32 exit ;; - *:Interix*:[3456]*) - case ${UNAME_MACHINE} in + *:Interix*:*) + case ${UNAME_MACHINE} in x86) echo i586-pc-interix${UNAME_RELEASE} exit ;; - EM64T | authenticamd | genuineintel) + authenticamd | genuineintel | EM64T) echo x86_64-unknown-interix${UNAME_RELEASE} exit ;; IA64) @@ -822,6 +829,9 @@ [345]86:Windows_95:* | [345]86:Windows_98:* | [345]86:Windows_NT:*) echo i${UNAME_MACHINE}-pc-mks exit ;; + 8664:Windows_NT:*) + echo x86_64-pc-mks + exit ;; 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 @@ -851,6 +861,27 @@ i*86:Minix:*:*) echo ${UNAME_MACHINE}-pc-minix exit ;; + aarch64:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-gnu + exit ;; + aarch64_be:Linux:*:*) + UNAME_MACHINE=aarch64_be + echo ${UNAME_MACHINE}-unknown-linux-gnu + exit ;; + 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 -q ld.so.1 + if test "$?" = 0 ; then LIBC="libc1" ; else LIBC="" ; fi + echo ${UNAME_MACHINE}-unknown-linux-gnu${LIBC} + exit ;; arm*:Linux:*:*) eval $set_cc_for_build if echo __ARM_EABI__ | $CC_FOR_BUILD -E - 2>/dev/null \ @@ -858,20 +889,40 @@ then echo ${UNAME_MACHINE}-unknown-linux-gnu else - echo ${UNAME_MACHINE}-unknown-linux-gnueabi + if echo __ARM_PCS_VFP | $CC_FOR_BUILD -E - 2>/dev/null \ + | grep -q __ARM_PCS_VFP + then + echo ${UNAME_MACHINE}-unknown-linux-gnueabi + else + echo ${UNAME_MACHINE}-unknown-linux-gnueabihf + fi fi exit ;; avr32*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; cris:Linux:*:*) - echo cris-axis-linux-gnu + echo ${UNAME_MACHINE}-axis-linux-gnu exit ;; crisv32:Linux:*:*) - echo crisv32-axis-linux-gnu + echo ${UNAME_MACHINE}-axis-linux-gnu exit ;; frv:Linux:*:*) - echo frv-unknown-linux-gnu + echo ${UNAME_MACHINE}-unknown-linux-gnu + exit ;; + hexagon:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-gnu + exit ;; + i*86:Linux:*:*) + LIBC=gnu + eval $set_cc_for_build + sed 's/^ //' << EOF >$dummy.c + #ifdef __dietlibc__ + LIBC=dietlibc + #endif +EOF + eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^LIBC'` + echo "${UNAME_MACHINE}-pc-linux-${LIBC}" exit ;; ia64:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu @@ -882,78 +933,34 @@ m68*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; - mips:Linux:*:*) + mips:Linux:*:* | mips64:Linux:*:*) eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #undef CPU - #undef mips - #undef mipsel + #undef ${UNAME_MACHINE} + #undef ${UNAME_MACHINE}el #if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL) - CPU=mipsel + CPU=${UNAME_MACHINE}el #else #if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB) - CPU=mips + CPU=${UNAME_MACHINE} #else CPU= #endif #endif EOF - eval "`$CC_FOR_BUILD -E $dummy.c 2>/dev/null | sed -n ' - /^CPU/{ - s: ::g - p - }'`" - test x"${CPU}" != x && { echo "${CPU}-unknown-linux-gnu"; exit; } - ;; - mips64:Linux:*:*) - eval $set_cc_for_build - sed 's/^ //' << EOF >$dummy.c - #undef CPU - #undef mips64 - #undef mips64el - #if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL) - CPU=mips64el - #else - #if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB) - CPU=mips64 - #else - CPU= - #endif - #endif -EOF - eval "`$CC_FOR_BUILD -E $dummy.c 2>/dev/null | sed -n ' - /^CPU/{ - s: ::g - p - }'`" + eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^CPU'` test x"${CPU}" != x && { echo "${CPU}-unknown-linux-gnu"; exit; } ;; or32:Linux:*:*) - echo or32-unknown-linux-gnu - exit ;; - ppc:Linux:*:*) - echo powerpc-unknown-linux-gnu - exit ;; - ppc64:Linux:*:*) - echo powerpc64-unknown-linux-gnu - exit ;; - 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} + echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; padre:Linux:*:*) echo sparc-unknown-linux-gnu exit ;; + parisc64:Linux:*:* | hppa64:Linux:*:*) + echo hppa64-unknown-linux-gnu + exit ;; parisc:Linux:*:* | hppa:Linux:*:*) # Look for CPU level case `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in @@ -962,14 +969,17 @@ *) echo hppa-unknown-linux-gnu ;; esac exit ;; - parisc64:Linux:*:* | hppa64:Linux:*:*) - echo hppa64-unknown-linux-gnu + ppc64:Linux:*:*) + echo powerpc64-unknown-linux-gnu + exit ;; + ppc:Linux:*:*) + echo powerpc-unknown-linux-gnu exit ;; s390:Linux:*:* | s390x:Linux:*:*) echo ${UNAME_MACHINE}-ibm-linux exit ;; sh64*:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-gnu + echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; sh*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu @@ -977,75 +987,18 @@ sparc:Linux:*:* | sparc64:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; + tile*:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-gnu + exit ;; vax:Linux:*:*) echo ${UNAME_MACHINE}-dec-linux-gnu exit ;; x86_64:Linux:*:*) - echo x86_64-unknown-linux-gnu + echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; xtensa*:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-gnu + echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; - 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 ;; - "") - # 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 ;; - esac - # Determine whether the default compiler is a.out or elf - eval $set_cc_for_build - sed 's/^ //' << EOF >$dummy.c - #include - #ifdef __ELF__ - # ifdef __GLIBC__ - # if __GLIBC__ >= 2 - LIBC=gnu - # else - LIBC=gnulibc1 - # endif - # else - LIBC=gnulibc1 - # endif - #else - #if defined(__INTEL_COMPILER) || defined(__PGI) || defined(__SUNPRO_C) || defined(__SUNPRO_CC) - LIBC=gnu - #else - LIBC=gnuaout - #endif - #endif - #ifdef __dietlibc__ - LIBC=dietlibc - #endif -EOF - eval "`$CC_FOR_BUILD -E $dummy.c 2>/dev/null | sed -n ' - /^LIBC/{ - s: ::g - p - }'`" - test x"${LIBC}" != x && { - echo "${UNAME_MACHINE}-pc-linux-${LIBC}" - exit - } - test x"${TENTATIVE}" != x && { echo "${TENTATIVE}"; exit; } - ;; 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 @@ -1053,11 +1006,11 @@ echo i386-sequent-sysv4 exit ;; 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, + # 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. + # Use sysv4.2uw... so that sysv4* matches it. echo ${UNAME_MACHINE}-pc-sysv4.2uw${UNAME_VERSION} exit ;; i*86:OS/2:*:*) @@ -1074,7 +1027,7 @@ i*86:syllable:*:*) echo ${UNAME_MACHINE}-pc-syllable exit ;; - i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.0*:*) + i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.[02]*:*) echo i386-unknown-lynxos${UNAME_RELEASE} exit ;; i*86:*DOS:*:*) @@ -1089,7 +1042,7 @@ fi exit ;; i*86:*:5:[678]*) - # UnixWare 7.x, OpenUNIX and OpenServer 6. + # UnixWare 7.x, OpenUNIX and OpenServer 6. case `/bin/uname -X | grep "^Machine"` in *486*) UNAME_MACHINE=i486 ;; *Pentium) UNAME_MACHINE=i586 ;; @@ -1117,13 +1070,13 @@ exit ;; 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 i586. + # uname -m prints for DJGPP always 'pc', but it prints nothing about + # the processor, so we play safe by assuming i586. # Note: whatever this is, it MUST be the same as what config.sub # prints for the "djgpp" host, or else GDB configury will decide that # this is a cross-build. echo i586-pc-msdosdjgpp - exit ;; + exit ;; Intel:Mach:3*:*) echo i386-pc-mach3 exit ;; @@ -1158,8 +1111,8 @@ /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \ && { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;; 3[34]??:*:4.0:* | 3[34]??,*:*:4.0:*) - /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ - && { echo i486-ncr-sysv4; exit; } ;; + /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ + && { echo i486-ncr-sysv4; exit; } ;; NCR*:*:4.2:* | MPRAS*:*:4.2:*) OS_REL='.3' test -r /etc/.relid \ @@ -1182,7 +1135,7 @@ rs6000:LynxOS:2.*:*) echo rs6000-unknown-lynxos${UNAME_RELEASE} exit ;; - PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:* | PowerPC:LynxOS:4.0*:*) + PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:* | PowerPC:LynxOS:4.[02]*:*) echo powerpc-unknown-lynxos${UNAME_RELEASE} exit ;; SM[BE]S:UNIX_SV:*:*) @@ -1202,10 +1155,10 @@ echo ns32k-sni-sysv fi exit ;; - PENTIUM:*:4.0*:*) # Unisys `ClearPath HMP IX 4000' SVR4/MP effort - # says - echo i586-unisys-sysv4 - exit ;; + PENTIUM:*:4.0*:*) # Unisys `ClearPath HMP IX 4000' SVR4/MP effort + # says + echo i586-unisys-sysv4 + exit ;; *:UNIX_System_V:4*:FTX*) # From Gerald Hewes . # How about differentiating between stratus architectures? -djm @@ -1231,11 +1184,11 @@ exit ;; R[34]000:*System_V*:*:* | R4000:UNIX_SYSV:*:* | R*000:UNIX_SV:*:*) if [ -d /usr/nec ]; then - echo mips-nec-sysv${UNAME_RELEASE} + echo mips-nec-sysv${UNAME_RELEASE} else - echo mips-unknown-sysv${UNAME_RELEASE} + echo mips-unknown-sysv${UNAME_RELEASE} fi - exit ;; + exit ;; BeBox:BeOS:*:*) # BeOS running on hardware made by Be, PPC only. echo powerpc-be-beos exit ;; @@ -1275,6 +1228,16 @@ *:Darwin:*:*) UNAME_PROCESSOR=`uname -p` || UNAME_PROCESSOR=unknown case $UNAME_PROCESSOR in + i386) + eval $set_cc_for_build + if [ "$CC_FOR_BUILD" != 'no_compiler_found' ]; then + if (echo '#ifdef __LP64__'; echo IS_64BIT_ARCH; echo '#endif') | \ + (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | \ + grep IS_64BIT_ARCH >/dev/null + then + UNAME_PROCESSOR="x86_64" + fi + fi ;; unknown) UNAME_PROCESSOR=powerpc ;; esac echo ${UNAME_PROCESSOR}-apple-darwin${UNAME_RELEASE} @@ -1290,6 +1253,9 @@ *:QNX:*:4*) echo i386-pc-qnx exit ;; + NEO-?:NONSTOP_KERNEL:*:*) + echo neo-tandem-nsk${UNAME_RELEASE} + exit ;; NSE-?:NONSTOP_KERNEL:*:*) echo nse-tandem-nsk${UNAME_RELEASE} exit ;; @@ -1335,13 +1301,13 @@ echo pdp10-unknown-its exit ;; SEI:*:*:SEIUX) - echo mips-sei-seiux${UNAME_RELEASE} + echo mips-sei-seiux${UNAME_RELEASE} exit ;; *:DragonFly:*:*) echo ${UNAME_MACHINE}-unknown-dragonfly`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` exit ;; *:*VMS:*:*) - UNAME_MACHINE=`(uname -p) 2>/dev/null` + UNAME_MACHINE=`(uname -p) 2>/dev/null` case "${UNAME_MACHINE}" in A*) echo alpha-dec-vms ; exit ;; I*) echo ia64-dec-vms ; exit ;; @@ -1359,6 +1325,9 @@ i*86:AROS:*:*) echo ${UNAME_MACHINE}-pc-aros exit ;; + x86_64:VMkernel:*:*) + echo ${UNAME_MACHINE}-unknown-esx + exit ;; esac #echo '(No uname command or uname output not recognized.)' 1>&2 @@ -1381,11 +1350,11 @@ #include printf ("m68k-sony-newsos%s\n", #ifdef NEWSOS4 - "4" + "4" #else - "" + "" #endif - ); exit (0); + ); exit (0); #endif #endif diff -Nru libdap-3.11.1/conf/config.sub libdap-3.12.0/conf/config.sub --- libdap-3.11.1/conf/config.sub 2011-05-06 17:36:28.000000000 +0000 +++ libdap-3.12.0/conf/config.sub 2013-10-17 21:27:40.000000000 +0000 @@ -1,10 +1,10 @@ #! /bin/sh # Configuration validation subroutine script. # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, -# 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008 -# Free Software Foundation, Inc. +# 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, +# 2011, 2012 Free Software Foundation, Inc. -timestamp='2009-04-17' +timestamp='2012-02-10' # This file is (in principle) common to ALL GNU software. # The presence of a machine in this file suggests that SOME GNU software @@ -21,9 +21,7 @@ # 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., 51 Franklin Street - Fifth Floor, Boston, MA -# 02110-1301, USA. +# along with this program; if not, see . # # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a @@ -32,13 +30,16 @@ # Please send patches to . Submit a context -# diff and a properly formatted ChangeLog entry. +# diff and a properly formatted GNU 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. +# You can get the latest version of this script from: +# http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub;hb=HEAD + # 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. @@ -72,8 +73,9 @@ version="\ GNU config.sub ($timestamp) -Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, -2002, 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc. +Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, +2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012 +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." @@ -120,13 +122,18 @@ # 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* | linux-dietlibc | linux-newlib* | linux-uclibc* | \ - uclinux-uclibc* | uclinux-gnu* | kfreebsd*-gnu* | knetbsd*-gnu* | netbsd*-gnu* | \ + nto-qnx* | linux-gnu* | linux-android* | linux-dietlibc | linux-newlib* | \ + linux-uclibc* | uclinux-uclibc* | uclinux-gnu* | kfreebsd*-gnu* | \ + knetbsd*-gnu* | netbsd*-gnu* | \ kopensolaris*-gnu* | \ storm-chaos* | os2-emx* | rtmk-nova*) os=-$maybe_os basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'` ;; + android-linux) + os=-linux-android + basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'`-unknown + ;; *) basic_machine=`echo $1 | sed 's/-[^-]*$//'` if [ $basic_machine != $1 ] @@ -149,10 +156,13 @@ -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 | -knuth | -cray) + -apple | -axis | -knuth | -cray | -microblaze) os= basic_machine=$1 ;; + -bluegene*) + os=-cnk + ;; -sim | -cisco | -oki | -wec | -winbond) os= basic_machine=$1 @@ -167,10 +177,10 @@ os=-chorusos basic_machine=$1 ;; - -chorusrdb) - os=-chorusrdb + -chorusrdb) + os=-chorusrdb basic_machine=$1 - ;; + ;; -hiux*) os=-hiuxwe2 ;; @@ -239,17 +249,22 @@ # Some are omitted here because they have special meanings below. 1750a | 580 \ | a29k \ + | aarch64 | aarch64_be \ | alpha | alphaev[4-8] | alphaev56 | alphaev6[78] | alphapca5[67] \ | alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] | alpha64pca5[67] \ | am33_2.0 \ | arc | arm | arm[bl]e | arme[lb] | armv[2345] | armv[345][lb] | avr | avr32 \ + | be32 | be64 \ | bfin \ | c4x | clipper \ | d10v | d30v | dlx | dsp16xx \ + | epiphany \ | fido | fr30 | frv \ | h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \ + | hexagon \ | i370 | i860 | i960 | ia64 \ | ip2k | iq2000 \ + | le32 | le64 \ | lm32 \ | m32c | m32r | m32rle | m68000 | m68k | m88k \ | maxq | mb | microblaze | mcore | mep | metag \ @@ -275,27 +290,39 @@ | moxie \ | mt \ | msp430 \ + | nds32 | nds32le | nds32be \ | nios | nios2 \ | ns16k | ns32k \ + | open8 \ | or32 \ | pdp10 | pdp11 | pj | pjl \ - | powerpc | powerpc64 | powerpc64le | powerpcle | ppcbe \ + | powerpc | powerpc64 | powerpc64le | powerpcle \ | pyramid \ + | rl78 | rx \ | score \ | sh | sh[1234] | sh[24]a | sh[24]aeb | sh[23]e | sh[34]eb | sheb | shbe | shle | sh[1234]le | sh3ele \ | sh64 | sh64le \ | sparc | sparc64 | sparc64b | sparc64v | sparc86x | sparclet | sparclite \ | sparcv8 | sparcv9 | sparcv9b | sparcv9v \ - | spu | strongarm \ - | tahoe | thumb | tic4x | tic80 | tron \ - | v850 | v850e \ + | spu \ + | tahoe | tic4x | tic54x | tic55x | tic6x | tic80 | tron \ + | ubicom32 \ + | v850 | v850e | v850e1 | v850e2 | v850es | v850e2v3 \ | we32k \ - | x86 | xc16x | xscale | xscalee[bl] | xstormy16 | xtensa \ + | x86 | xc16x | xstormy16 | xtensa \ | z8k | z80) basic_machine=$basic_machine-unknown ;; - m6811 | m68hc11 | m6812 | m68hc12) - # Motorola 68HC11/12. + c54x) + basic_machine=tic54x-unknown + ;; + c55x) + basic_machine=tic55x-unknown + ;; + c6x) + basic_machine=tic6x-unknown + ;; + m6811 | m68hc11 | m6812 | m68hc12 | m68hcs12x | picochip) basic_machine=$basic_machine-unknown os=-none ;; @@ -305,6 +332,21 @@ basic_machine=mt-unknown ;; + strongarm | thumb | xscale) + basic_machine=arm-unknown + ;; + xgate) + basic_machine=$basic_machine-unknown + os=-none + ;; + xscaleeb) + basic_machine=armeb-unknown + ;; + + xscaleel) + basic_machine=armel-unknown + ;; + # We use `pc' rather than `unknown' # because (1) that's what they normally are, and # (2) the word "unknown" tends to confuse beginning users. @@ -319,25 +361,29 @@ # Recognize the basic CPU types with company name. 580-* \ | a29k-* \ + | aarch64-* | aarch64_be-* \ | alpha-* | alphaev[4-8]-* | alphaev56-* | alphaev6[78]-* \ | alpha64-* | alpha64ev[4-8]-* | alpha64ev56-* | alpha64ev6[78]-* \ | alphapca5[67]-* | alpha64pca5[67]-* | arc-* \ | arm-* | armbe-* | armle-* | armeb-* | armv*-* \ | avr-* | avr32-* \ + | be32-* | be64-* \ | bfin-* | bs2000-* \ - | c[123]* | c30-* | [cjt]90-* | c4x-* | c54x-* | c55x-* | c6x-* \ + | c[123]* | c30-* | [cjt]90-* | c4x-* \ | clipper-* | craynv-* | cydra-* \ | d10v-* | d30v-* | dlx-* \ | elxsi-* \ | f30[01]-* | f700-* | fido-* | fr30-* | frv-* | fx80-* \ | h8300-* | h8500-* \ | hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \ + | hexagon-* \ | i*86-* | i860-* | i960-* | ia64-* \ | ip2k-* | iq2000-* \ + | le32-* | le64-* \ | lm32-* \ | m32c-* | m32r-* | m32rle-* \ | m68000-* | m680[012346]0-* | m68360-* | m683?2-* | m68k-* \ - | m88110-* | m88k-* | maxq-* | mcore-* | metag-* \ + | m88110-* | m88k-* | maxq-* | mcore-* | metag-* | microblaze-* \ | mips-* | mipsbe-* | mipseb-* | mipsel-* | mipsle-* \ | mips16-* \ | mips64-* | mips64el-* \ @@ -359,24 +405,29 @@ | mmix-* \ | mt-* \ | msp430-* \ + | nds32-* | nds32le-* | nds32be-* \ | nios-* | nios2-* \ | none-* | np1-* | ns16k-* | ns32k-* \ + | open8-* \ | orion-* \ | pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \ - | powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* | ppcbe-* \ + | powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* \ | pyramid-* \ - | romp-* | rs6000-* \ + | rl78-* | romp-* | rs6000-* | rx-* \ | sh-* | sh[1234]-* | sh[24]a-* | sh[24]aeb-* | sh[23]e-* | sh[34]eb-* | sheb-* | shbe-* \ | shle-* | sh[1234]le-* | sh3ele-* | sh64-* | sh64le-* \ | sparc-* | sparc64-* | sparc64b-* | sparc64v-* | sparc86x-* | sparclet-* \ | sparclite-* \ - | sparcv8-* | sparcv9-* | sparcv9b-* | sparcv9v-* | strongarm-* | sv1-* | sx?-* \ - | tahoe-* | thumb-* \ - | tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* | tile-* \ + | sparcv8-* | sparcv9-* | sparcv9b-* | sparcv9v-* | sv1-* | sx?-* \ + | tahoe-* \ + | tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* \ + | tile*-* \ | tron-* \ - | v850-* | v850e-* | vax-* \ + | ubicom32-* \ + | v850-* | v850e-* | v850e1-* | v850es-* | v850e2-* | v850e2v3-* \ + | vax-* \ | we32k-* \ - | x86-* | x86_64-* | xc16x-* | xps100-* | xscale-* | xscalee[bl]-* \ + | x86-* | x86_64-* | xc16x-* | xps100-* \ | xstormy16-* | xtensa*-* \ | ymp-* \ | z8k-* | z80-*) @@ -401,7 +452,7 @@ basic_machine=a29k-amd os=-udi ;; - abacus) + abacus) basic_machine=abacus-unknown ;; adobe68k) @@ -467,11 +518,24 @@ basic_machine=bfin-`echo $basic_machine | sed 's/^[^-]*-//'` os=-linux ;; + bluegene*) + basic_machine=powerpc-ibm + os=-cnk + ;; + c54x-*) + basic_machine=tic54x-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + c55x-*) + basic_machine=tic55x-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + c6x-*) + basic_machine=tic6x-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; c90) basic_machine=c90-cray os=-unicos ;; - cegcc) + cegcc) basic_machine=arm-unknown os=-cegcc ;; @@ -503,7 +567,7 @@ basic_machine=craynv-cray os=-unicosmp ;; - cr16) + cr16 | cr16-*) basic_machine=cr16-unknown os=-elf ;; @@ -661,7 +725,6 @@ 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 @@ -719,6 +782,9 @@ basic_machine=ns32k-utek os=-sysv ;; + microblaze) + basic_machine=microblaze-xilinx + ;; mingw32) basic_machine=i386-pc os=-mingw32 @@ -755,10 +821,18 @@ ms1-*) basic_machine=`echo $basic_machine | sed -e 's/ms1-/mt-/'` ;; + msys) + basic_machine=i386-pc + os=-msys + ;; mvs) basic_machine=i370-ibm os=-mvs ;; + nacl) + basic_machine=le32-unknown + os=-nacl + ;; ncr3000) basic_machine=i486-ncr os=-sysv4 @@ -823,6 +897,12 @@ np1) basic_machine=np1-gould ;; + neo-tandem) + basic_machine=neo-tandem + ;; + nse-tandem) + basic_machine=nse-tandem + ;; nsr-tandem) basic_machine=nsr-tandem ;; @@ -905,9 +985,10 @@ ;; power) basic_machine=power-ibm ;; - ppc) basic_machine=powerpc-unknown + ppc | ppcbe) basic_machine=powerpc-unknown ;; - ppc-*) basic_machine=powerpc-`echo $basic_machine | sed 's/^[^-]*-//'` + ppc-* | ppcbe-*) + basic_machine=powerpc-`echo $basic_machine | sed 's/^[^-]*-//'` ;; ppcle | powerpclittle | ppc-le | powerpc-little) basic_machine=powerpcle-unknown @@ -1001,6 +1082,9 @@ basic_machine=i860-stratus os=-sysv4 ;; + strongarm-* | thumb-*) + basic_machine=arm-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; sun2) basic_machine=m68000-sun ;; @@ -1057,20 +1141,8 @@ basic_machine=t90-cray os=-unicos ;; - tic54x | c54x*) - basic_machine=tic54x-unknown - os=-coff - ;; - tic55x | c55x*) - basic_machine=tic55x-unknown - os=-coff - ;; - tic6x | c6x*) - basic_machine=tic6x-unknown - os=-coff - ;; tile*) - basic_machine=tile-unknown + basic_machine=$basic_machine-unknown os=-linux-gnu ;; tx39) @@ -1140,6 +1212,9 @@ xps | xps100) basic_machine=xps100-honeywell ;; + xscale-* | xscalee[bl]-*) + basic_machine=`echo $basic_machine | sed 's/^xscale/arm/'` + ;; ymp) basic_machine=ymp-cray os=-unicos @@ -1237,9 +1312,12 @@ if [ x"$os" != x"" ] then case $os in - # First match some system type aliases - # that might get confused with valid system types. + # First match some system type aliases + # that might get confused with valid system types. # -solaris* is a basic system type, with this one exception. + -auroraux) + os=-auroraux + ;; -solaris1 | -solaris1.*) os=`echo $os | sed -e 's|solaris1|sunos4|'` ;; @@ -1260,9 +1338,9 @@ # 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* \ - | -kopensolaris* \ + | -*vms* | -sco* | -esix* | -isc* | -aix* | -cnk* | -sunos | -sunos[34]*\ + | -hpux* | -unos* | -osf* | -luna* | -dgux* | -auroraux* | -solaris* \ + | -sym* | -kopensolaris* \ | -amigaos* | -amigados* | -msdos* | -newsos* | -unicos* | -aof* \ | -aos* | -aros* \ | -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \ @@ -1274,8 +1352,9 @@ | -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \ | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \ | -chorusos* | -chorusrdb* | -cegcc* \ - | -cygwin* | -pe* | -psos* | -moss* | -proelf* | -rtems* \ - | -mingw32* | -linux-gnu* | -linux-newlib* | -linux-uclibc* \ + | -cygwin* | -msys* | -pe* | -psos* | -moss* | -proelf* | -rtems* \ + | -mingw32* | -linux-gnu* | -linux-android* \ + | -linux-newlib* | -linux-uclibc* \ | -uxpv* | -beos* | -mpeix* | -udk* \ | -interix* | -uwin* | -mks* | -rhapsody* | -darwin* | -opened* \ | -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \ @@ -1283,7 +1362,7 @@ | -os2* | -vos* | -palmos* | -uclinux* | -nucleus* \ | -morphos* | -superux* | -rtmk* | -rtmk-nova* | -windiss* \ | -powermax* | -dnix* | -nx6 | -nx7 | -sei* | -dragonfly* \ - | -skyos* | -haiku* | -rdos* | -toppers* | -drops*) + | -skyos* | -haiku* | -rdos* | -toppers* | -drops* | -es*) # Remember, each alternative MUST END IN *, to match a version number. ;; -qnx*) @@ -1322,7 +1401,7 @@ -opened*) os=-openedition ;; - -os400*) + -os400*) os=-os400 ;; -wince*) @@ -1371,7 +1450,7 @@ -sinix*) os=-sysv4 ;; - -tpf*) + -tpf*) os=-tpf ;; -triton*) @@ -1416,6 +1495,8 @@ -dicos*) os=-dicos ;; + -nacl*) + ;; -none) ;; *) @@ -1438,10 +1519,10 @@ # system, and we'll never get to this point. case $basic_machine in - score-*) + score-*) os=-elf ;; - spu-*) + spu-*) os=-elf ;; *-acorn) @@ -1453,8 +1534,17 @@ arm*-semi) os=-aout ;; - c4x-* | tic4x-*) - os=-coff + c4x-* | tic4x-*) + os=-coff + ;; + tic54x-*) + os=-coff + ;; + tic55x-*) + os=-coff + ;; + tic6x-*) + os=-coff ;; # This must come before the *-dec entry. pdp10-*) @@ -1474,14 +1564,11 @@ ;; m68000-sun) os=-sunos3 - # This also exists in the configure program, but was not the - # default. - # os=-sunos4 ;; m68*-cisco) os=-aout ;; - mep-*) + mep-*) os=-elf ;; mips*-cisco) @@ -1508,7 +1595,7 @@ *-ibm) os=-aix ;; - *-knuth) + *-knuth) os=-mmixware ;; *-wec) @@ -1613,7 +1700,7 @@ -sunos*) vendor=sun ;; - -aix*) + -cnk*|-aix*) vendor=ibm ;; -beos*) diff -Nru libdap-3.11.1/conf/depcomp libdap-3.12.0/conf/depcomp --- libdap-3.11.1/conf/depcomp 2011-05-06 17:36:29.000000000 +0000 +++ libdap-3.12.0/conf/depcomp 2013-10-17 21:27:40.000000000 +0000 @@ -1,10 +1,9 @@ #! /bin/sh # depcomp - compile a program generating dependencies as side-effects -scriptversion=2009-04-28.21; # UTC +scriptversion=2012-03-27.16; # UTC -# Copyright (C) 1999, 2000, 2003, 2004, 2005, 2006, 2007, 2009 Free -# Software Foundation, Inc. +# Copyright (C) 1999-2012 Free Software Foundation, Inc. # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -28,7 +27,7 @@ case $1 in '') - echo "$0: No command. Try \`$0 --help' for more information." 1>&2 + echo "$0: No command. Try '$0 --help' for more information." 1>&2 exit 1; ;; -h | --h*) @@ -40,11 +39,11 @@ Environment variables: depmode Dependency tracking mode. - source Source file read by `PROGRAMS ARGS'. - object Object file output by `PROGRAMS ARGS'. + source Source file read by 'PROGRAMS ARGS'. + object Object file output by 'PROGRAMS ARGS'. DEPDIR directory where to store dependencies. depfile Dependency file to output. - tmpdepfile Temporary file to use when outputing dependencies. + tmpdepfile Temporary file to use when outputting dependencies. libtool Whether libtool is used (yes/no). Report bugs to . @@ -57,6 +56,12 @@ ;; esac +# A tabulation character. +tab=' ' +# A newline character. +nl=' +' + if test -z "$depmode" || test -z "$source" || test -z "$object"; then echo "depcomp: Variables source, object and depmode must be set" 1>&2 exit 1 @@ -90,10 +95,24 @@ # This is just like msvisualcpp but w/o cygpath translation. # Just convert the backslash-escaped backslashes to single forward # slashes to satisfy depend.m4 - cygpath_u="sed s,\\\\\\\\,/,g" + cygpath_u='sed s,\\\\,/,g' depmode=msvisualcpp fi +if test "$depmode" = msvc7msys; then + # This is just like msvc7 but w/o cygpath translation. + # Just convert the backslash-escaped backslashes to single forward + # slashes to satisfy depend.m4 + cygpath_u='sed s,\\\\,/,g' + depmode=msvc7 +fi + +if test "$depmode" = xlc; then + # IBM C/C++ Compilers xlc/xlC can output gcc-like dependency informations. + gccflag=-qmakedep=gcc,-MF + depmode=gcc +fi + case "$depmode" in gcc3) ## gcc 3 implements dependency tracking that does exactly what @@ -148,20 +167,21 @@ ## The second -e expression handles DOS-style file names with drive letters. sed -e 's/^[^:]*: / /' \ -e 's/^['$alpha']:\/[^:]*: / /' < "$tmpdepfile" >> "$depfile" -## This next piece of magic avoids the `deleted header file' problem. +## This next piece of magic avoids the "deleted header file" problem. ## The problem is that when a header file which appears in a .P file ## is deleted, the dependency causes make to die (because there is ## typically no way to rebuild the header). We avoid this by adding ## dummy dependencies for each header file. Too bad gcc doesn't do ## this for us directly. - tr ' ' ' -' < "$tmpdepfile" | -## Some versions of gcc put a space before the `:'. On the theory + tr ' ' "$nl" < "$tmpdepfile" | +## Some versions of gcc put a space before the ':'. On the theory ## that the space means something, we add a space to the output as -## well. +## well. hp depmode also adds that space, but also prefixes the VPATH +## to the object. Take care to not repeat it in the output. ## Some versions of the HPUX 10.20 sed can't process this invocation ## correctly. Breaking it into two sed invocations is a workaround. - sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile" + sed -e 's/^\\$//' -e '/^$/d' -e "s|.*$object$||" -e '/:$/d' \ + | sed -e 's/$/ :/' >> "$depfile" rm -f "$tmpdepfile" ;; @@ -193,18 +213,15 @@ # clever and replace this with sed code, as IRIX sed won't handle # lines with more than a fixed number of characters (4096 in # IRIX 6.2 sed, 8192 in IRIX 6.5). We also remove comment lines; - # the IRIX cc adds comments like `#:fec' to the end of the + # the IRIX cc adds comments like '#:fec' to the end of the # dependency line. - tr ' ' ' -' < "$tmpdepfile" \ + tr ' ' "$nl" < "$tmpdepfile" \ | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' | \ - tr ' -' ' ' >> "$depfile" + tr "$nl" ' ' >> "$depfile" echo >> "$depfile" # The second pass generates a dummy entry for each header file. - tr ' ' ' -' < "$tmpdepfile" \ + tr ' ' "$nl" < "$tmpdepfile" \ | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' -e 's/$/:/' \ >> "$depfile" else @@ -216,10 +233,17 @@ rm -f "$tmpdepfile" ;; +xlc) + # This case exists only to let depend.m4 do its work. It works by + # looking at the text of this script. This case will never be run, + # since it is checked for above. + exit 1 + ;; + aix) # The C for AIX Compiler uses -M and outputs the dependencies # in a .u file. In older versions, this file always lives in the - # current directory. Also, the AIX compiler puts `$object:' at the + # current directory. Also, the AIX compiler puts '$object:' at the # start of each line; $object doesn't have directory information. # Version 6 uses the directory in both cases. dir=`echo "$object" | sed -e 's|/[^/]*$|/|'` @@ -249,12 +273,11 @@ test -f "$tmpdepfile" && break done if test -f "$tmpdepfile"; then - # Each line is of the form `foo.o: dependent.h'. + # Each line is of the form 'foo.o: dependent.h'. # Do two passes, one to just change these to - # `$object: dependent.h' and one to simply `dependent.h:'. + # '$object: dependent.h' and one to simply 'dependent.h:'. sed -e "s,^.*\.[a-z]*:,$object:," < "$tmpdepfile" > "$depfile" - # That's a tab and a space in the []. - sed -e 's,^.*\.[a-z]*:[ ]*,,' -e 's,$,:,' < "$tmpdepfile" >> "$depfile" + sed -e 's,^.*\.[a-z]*:['"$tab"' ]*,,' -e 's,$,:,' < "$tmpdepfile" >> "$depfile" else # The sourcefile does not contain any dependencies, so just # store a dummy comment line, to avoid errors with the Makefile @@ -265,23 +288,26 @@ ;; icc) - # Intel's C compiler understands `-MD -MF file'. However on - # icc -MD -MF foo.d -c -o sub/foo.o sub/foo.c + # Intel's C compiler anf tcc (Tiny C Compiler) understand '-MD -MF file'. + # However on + # $CC -MD -MF foo.d -c -o sub/foo.o sub/foo.c # ICC 7.0 will fill foo.d with something like # foo.o: sub/foo.c # foo.o: sub/foo.h - # which is wrong. We want: + # which is wrong. We want # sub/foo.o: sub/foo.c # sub/foo.o: sub/foo.h # sub/foo.c: # sub/foo.h: # ICC 7.1 will output # foo.o: sub/foo.c sub/foo.h - # and will wrap long lines using \ : + # and will wrap long lines using '\': # foo.o: sub/foo.c ... \ # sub/foo.h ... \ # ... - + # tcc 0.9.26 (FIXME still under development at the moment of writing) + # will emit a similar output, but also prepend the continuation lines + # with horizontal tabulation characters. "$@" -MD -MF "$tmpdepfile" stat=$? if test $stat -eq 0; then : @@ -290,15 +316,21 @@ exit $stat fi rm -f "$depfile" - # Each line is of the form `foo.o: dependent.h', - # or `foo.o: dep1.h dep2.h \', or ` dep3.h dep4.h \'. + # Each line is of the form 'foo.o: dependent.h', + # or 'foo.o: dep1.h dep2.h \', or ' dep3.h dep4.h \'. # Do two passes, one to just change these to - # `$object: dependent.h' and one to simply `dependent.h:'. - sed "s,^[^:]*:,$object :," < "$tmpdepfile" > "$depfile" - # Some versions of the HPUX 10.20 sed can't process this invocation - # correctly. Breaking it into two sed invocations is a workaround. - sed 's,^[^:]*: \(.*\)$,\1,;s/^\\$//;/^$/d;/:$/d' < "$tmpdepfile" | - sed -e 's/$/ :/' >> "$depfile" + # '$object: dependent.h' and one to simply 'dependent.h:'. + sed -e "s/^[ $tab][ $tab]*/ /" -e "s,^[^:]*:,$object :," \ + < "$tmpdepfile" > "$depfile" + sed ' + s/[ '"$tab"'][ '"$tab"']*/ /g + s/^ *// + s/ *\\*$// + s/^[^:]*: *// + /^$/d + /:$/d + s/$/ :/ + ' < "$tmpdepfile" >> "$depfile" rm -f "$tmpdepfile" ;; @@ -334,7 +366,7 @@ done if test -f "$tmpdepfile"; then sed -e "s,^.*\.[a-z]*:,$object:," "$tmpdepfile" > "$depfile" - # Add `dependent.h:' lines. + # Add 'dependent.h:' lines. sed -ne '2,${ s/^ *// s/ \\*$// @@ -349,9 +381,9 @@ tru64) # The Tru64 compiler uses -MD to generate dependencies as a side - # effect. `cc -MD -o foo.o ...' puts the dependencies into `foo.o.d'. + # effect. 'cc -MD -o foo.o ...' puts the dependencies into 'foo.o.d'. # At least on Alpha/Redhat 6.1, Compaq CCC V6.2-504 seems to put - # dependencies in `foo.d' instead, so we check for that too. + # dependencies in 'foo.d' instead, so we check for that too. # Subdirectories are respected. dir=`echo "$object" | sed -e 's|/[^/]*$|/|'` test "x$dir" = "x$object" && dir= @@ -397,14 +429,59 @@ done if test -f "$tmpdepfile"; then sed -e "s,^.*\.[a-z]*:,$object:," < "$tmpdepfile" > "$depfile" - # That's a tab and a space in the []. - sed -e 's,^.*\.[a-z]*:[ ]*,,' -e 's,$,:,' < "$tmpdepfile" >> "$depfile" + sed -e 's,^.*\.[a-z]*:['"$tab"' ]*,,' -e 's,$,:,' < "$tmpdepfile" >> "$depfile" else echo "#dummy" > "$depfile" fi rm -f "$tmpdepfile" ;; +msvc7) + if test "$libtool" = yes; then + showIncludes=-Wc,-showIncludes + else + showIncludes=-showIncludes + fi + "$@" $showIncludes > "$tmpdepfile" + stat=$? + grep -v '^Note: including file: ' "$tmpdepfile" + if test "$stat" = 0; then : + else + rm -f "$tmpdepfile" + exit $stat + fi + rm -f "$depfile" + echo "$object : \\" > "$depfile" + # The first sed program below extracts the file names and escapes + # backslashes for cygpath. The second sed program outputs the file + # name when reading, but also accumulates all include files in the + # hold buffer in order to output them again at the end. This only + # works with sed implementations that can handle large buffers. + sed < "$tmpdepfile" -n ' +/^Note: including file: *\(.*\)/ { + s//\1/ + s/\\/\\\\/g + p +}' | $cygpath_u | sort -u | sed -n ' +s/ /\\ /g +s/\(.*\)/'"$tab"'\1 \\/p +s/.\(.*\) \\/\1:/ +H +$ { + s/.*/'"$tab"'/ + G + p +}' >> "$depfile" + rm -f "$tmpdepfile" + ;; + +msvc7msys) + # This case exists only to let depend.m4 do its work. It works by + # looking at the text of this script. This case will never be run, + # since it is checked for above. + exit 1 + ;; + #nosideeffect) # This comment above is used by automake to tell side-effect # dependency tracking mechanisms from slower ones. @@ -422,7 +499,7 @@ shift fi - # Remove `-o $object'. + # Remove '-o $object'. IFS=" " for arg do @@ -442,15 +519,14 @@ done test -z "$dashmflag" && dashmflag=-M - # Require at least two characters before searching for `:' + # Require at least two characters before searching for ':' # in the target name. This is to cope with DOS-style filenames: - # a dependency such as `c:/foo/bar' could be seen as target `c' otherwise. + # a dependency such as 'c:/foo/bar' could be seen as target 'c' otherwise. "$@" $dashmflag | - sed 's:^[ ]*[^: ][^:][^:]*\:[ ]*:'"$object"'\: :' > "$tmpdepfile" + sed 's:^['"$tab"' ]*[^:'"$tab"' ][^:][^:]*\:['"$tab"' ]*:'"$object"'\: :' > "$tmpdepfile" rm -f "$depfile" cat < "$tmpdepfile" > "$depfile" - tr ' ' ' -' < "$tmpdepfile" | \ + tr ' ' "$nl" < "$tmpdepfile" | \ ## Some versions of the HPUX 10.20 sed can't process this invocation ## correctly. Breaking it into two sed invocations is a workaround. sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile" @@ -503,9 +579,10 @@ touch "$tmpdepfile" ${MAKEDEPEND-makedepend} -o"$obj_suffix" -f"$tmpdepfile" "$@" rm -f "$depfile" - cat < "$tmpdepfile" > "$depfile" - sed '1,2d' "$tmpdepfile" | tr ' ' ' -' | \ + # makedepend may prepend the VPATH from the source file name to the object. + # No need to regex-escape $object, excess matching of '.' is harmless. + sed "s|^.*\($object *:\)|\1|" "$tmpdepfile" > "$depfile" + sed '1,2d' "$tmpdepfile" | tr ' ' "$nl" | \ ## Some versions of the HPUX 10.20 sed can't process this invocation ## correctly. Breaking it into two sed invocations is a workaround. sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile" @@ -525,7 +602,7 @@ shift fi - # Remove `-o $object'. + # Remove '-o $object'. IFS=" " for arg do @@ -594,8 +671,8 @@ sed -n '/^#line [0-9][0-9]* "\([^"]*\)"/ s::\1:p' | $cygpath_u | sort -u > "$tmpdepfile" rm -f "$depfile" echo "$object : \\" > "$depfile" - sed < "$tmpdepfile" -n -e 's% %\\ %g' -e '/^\(.*\)$/ s:: \1 \\:p' >> "$depfile" - echo " " >> "$depfile" + sed < "$tmpdepfile" -n -e 's% %\\ %g' -e '/^\(.*\)$/ s::'"$tab"'\1 \\:p' >> "$depfile" + echo "$tab" >> "$depfile" sed < "$tmpdepfile" -n -e 's% %\\ %g' -e '/^\(.*\)$/ s::\1\::p' >> "$depfile" rm -f "$tmpdepfile" ;; diff -Nru libdap-3.11.1/conf/install-sh libdap-3.12.0/conf/install-sh --- libdap-3.11.1/conf/install-sh 2011-05-06 17:36:28.000000000 +0000 +++ libdap-3.12.0/conf/install-sh 2013-10-17 21:27:40.000000000 +0000 @@ -1,7 +1,7 @@ #!/bin/sh # install - install a program, script, or datafile -scriptversion=2009-04-28.21; # UTC +scriptversion=2011-11-20.07; # UTC # This originates from X11R5 (mit/util/scripts/install.sh), which was # later released in X11R6 (xc/config/util/install.sh) with the @@ -35,7 +35,7 @@ # FSF changes to this file are in the public domain. # # Calling this script install-sh is preferred over install.sh, to prevent -# `make' implicit rules from creating a file called install from it +# 'make' implicit rules from creating a file called install from it # when there is no Makefile. # # This script is compatible with the BSD install script, but was written @@ -156,6 +156,10 @@ -s) stripcmd=$stripprog;; -t) dst_arg=$2 + # Protect names problematic for 'test' and other utilities. + case $dst_arg in + -* | [=\(\)!]) dst_arg=./$dst_arg;; + esac shift;; -T) no_target_directory=true;; @@ -186,6 +190,10 @@ fi shift # arg dst_arg=$arg + # Protect names problematic for 'test' and other utilities. + case $dst_arg in + -* | [=\(\)!]) dst_arg=./$dst_arg;; + esac done fi @@ -194,13 +202,17 @@ echo "$0: no input file specified." >&2 exit 1 fi - # It's OK to call `install-sh -d' without argument. + # It's OK to call 'install-sh -d' without argument. # This can happen when creating conditional directories. exit 0 fi if test -z "$dir_arg"; then - trap '(exit $?); exit' 1 2 13 15 + do_exit='(exit $ret); exit $ret' + trap "ret=129; $do_exit" 1 + trap "ret=130; $do_exit" 2 + trap "ret=141; $do_exit" 13 + trap "ret=143; $do_exit" 15 # Set umask so as not to create temps with too-generous modes. # However, 'strip' requires both read and write access to temps. @@ -228,9 +240,9 @@ for src do - # Protect names starting with `-'. + # Protect names problematic for 'test' and other utilities. case $src in - -*) src=./$src;; + -* | [=\(\)!]) src=./$src;; esac if test -n "$dir_arg"; then @@ -252,12 +264,7 @@ echo "$0: no destination specified." >&2 exit 1 fi - dst=$dst_arg - # Protect names starting with `-'. - case $dst in - -*) dst=./$dst;; - esac # If destination is a directory, append the input filename; won't work # if double slashes aren't ignored. @@ -347,7 +354,7 @@ if test -z "$dir_arg" || { # Check for POSIX incompatibilities with -m. # HP-UX 11.23 and IRIX 6.5 mkdir -m -p sets group- or - # other-writeable bit of parent directory when it shouldn't. + # other-writable bit of parent directory when it shouldn't. # FreeBSD 6.1 mkdir -m -p sets mode of existing directory. ls_ld_tmpdir=`ls -ld "$tmpdir"` case $ls_ld_tmpdir in @@ -385,7 +392,7 @@ case $dstdir in /*) prefix='/';; - -*) prefix='./';; + [-=\(\)!]*) prefix='./';; *) prefix='';; esac @@ -403,7 +410,7 @@ for d do - test -z "$d" && continue + test X"$d" = X && continue prefix=$prefix$d if test -d "$prefix"; then diff -Nru libdap-3.11.1/conf/libtool.m4 libdap-3.12.0/conf/libtool.m4 --- libdap-3.11.1/conf/libtool.m4 2011-05-06 17:36:21.000000000 +0000 +++ libdap-3.12.0/conf/libtool.m4 2013-10-17 21:27:40.000000000 +0000 @@ -1,7 +1,8 @@ # libtool.m4 - Configure libtool for the host system. -*-Autoconf-*- # # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005, -# 2006, 2007, 2008 Free Software Foundation, Inc. +# 2006, 2007, 2008, 2009, 2010, 2011 Free Software +# Foundation, Inc. # Written by Gordon Matzigkeit, 1996 # # This file is free software; the Free Software Foundation gives @@ -10,7 +11,8 @@ m4_define([_LT_COPYING], [dnl # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005, -# 2006, 2007, 2008 Free Software Foundation, Inc. +# 2006, 2007, 2008, 2009, 2010, 2011 Free Software +# Foundation, Inc. # Written by Gordon Matzigkeit, 1996 # # This file is part of GNU Libtool. @@ -37,7 +39,7 @@ # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ]) -# serial 56 LT_INIT +# serial 57 LT_INIT # LT_PREREQ(VERSION) @@ -66,6 +68,7 @@ # ------------------ AC_DEFUN([LT_INIT], [AC_PREREQ([2.58])dnl We use AC_INCLUDES_DEFAULT +AC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT])dnl AC_BEFORE([$0], [LT_LANG])dnl AC_BEFORE([$0], [LT_OUTPUT])dnl AC_BEFORE([$0], [LTDL_INIT])dnl @@ -82,6 +85,8 @@ AC_REQUIRE([LTOBSOLETE_VERSION])dnl m4_require([_LT_PROG_LTMAIN])dnl +_LT_SHELL_INIT([SHELL=${CONFIG_SHELL-/bin/sh}]) + dnl Parse OPTIONS _LT_SET_OPTIONS([$0], [$1]) @@ -118,7 +123,7 @@ *) break;; esac done -cc_basename=`$ECHO "X$cc_temp" | $Xsed -e 's%.*/%%' -e "s%^$host_alias-%%"` +cc_basename=`$ECHO "$cc_temp" | $SED "s%.*/%%; s%^$host_alias-%%"` ]) @@ -138,6 +143,11 @@ m4_defun([_LT_SETUP], [AC_REQUIRE([AC_CANONICAL_HOST])dnl AC_REQUIRE([AC_CANONICAL_BUILD])dnl +AC_REQUIRE([_LT_PREPARE_SED_QUOTE_VARS])dnl +AC_REQUIRE([_LT_PROG_ECHO_BACKSLASH])dnl + +_LT_DECL([], [PATH_SEPARATOR], [1], [The PATH separator for the build system])dnl +dnl _LT_DECL([], [host_alias], [0], [The host system])dnl _LT_DECL([], [host], [0])dnl _LT_DECL([], [host_os], [0])dnl @@ -160,10 +170,13 @@ dnl m4_require([_LT_FILEUTILS_DEFAULTS])dnl m4_require([_LT_CHECK_SHELL_FEATURES])dnl +m4_require([_LT_PATH_CONVERSION_FUNCTIONS])dnl m4_require([_LT_CMD_RELOAD])dnl m4_require([_LT_CHECK_MAGIC_METHOD])dnl +m4_require([_LT_CHECK_SHAREDLIB_FROM_LINKLIB])dnl m4_require([_LT_CMD_OLD_ARCHIVE])dnl m4_require([_LT_CMD_GLOBAL_SYMBOLS])dnl +m4_require([_LT_WITH_SYSROOT])dnl _LT_CONFIG_LIBTOOL_INIT([ # See if we are running on zsh, and set the options which allow our @@ -179,7 +192,6 @@ _LT_CHECK_OBJDIR m4_require([_LT_TAG_COMPILER])dnl -_LT_PROG_ECHO_BACKSLASH case $host_os in aix3*) @@ -193,23 +205,6 @@ ;; esac -# Sed substitution that helps us do robust quoting. It backslashifies -# metacharacters that are still active within double-quoted strings. -sed_quote_subst='s/\([["`$\\]]\)/\\\1/g' - -# Same as above, but do not quote variable references. -double_quote_subst='s/\([["`\\]]\)/\\\1/g' - -# Sed substitution to delay expansion of an escaped shell variable in a -# double_quote_subst'ed string. -delay_variable_subst='s/\\\\\\\\\\\$/\\\\\\$/g' - -# Sed substitution to delay expansion of an escaped single quote. -delay_single_quote_subst='s/'\''/'\'\\\\\\\'\''/g' - -# Sed substitution to avoid accidental globbing in evaled expressions -no_glob_subst='s/\*/\\\*/g' - # Global variables: ofile=libtool can_build_shared=yes @@ -250,6 +245,28 @@ ])# _LT_SETUP +# _LT_PREPARE_SED_QUOTE_VARS +# -------------------------- +# Define a few sed substitution that help us do robust quoting. +m4_defun([_LT_PREPARE_SED_QUOTE_VARS], +[# Backslashify metacharacters that are still active within +# double-quoted strings. +sed_quote_subst='s/\([["`$\\]]\)/\\\1/g' + +# Same as above, but do not quote variable references. +double_quote_subst='s/\([["`\\]]\)/\\\1/g' + +# Sed substitution to delay expansion of an escaped shell variable in a +# double_quote_subst'ed string. +delay_variable_subst='s/\\\\\\\\\\\$/\\\\\\$/g' + +# Sed substitution to delay expansion of an escaped single quote. +delay_single_quote_subst='s/'\''/'\'\\\\\\\'\''/g' + +# Sed substitution to avoid accidental globbing in evaled expressions +no_glob_subst='s/\*/\\\*/g' +]) + # _LT_PROG_LTMAIN # --------------- # Note that this code is called both from `configure', and `config.status' @@ -408,7 +425,7 @@ # declaration there will have the same value as in `configure'. VARNAME # must have a single quote delimited value for this to work. m4_define([_LT_CONFIG_STATUS_DECLARE], -[$1='`$ECHO "X$][$1" | $Xsed -e "$delay_single_quote_subst"`']) +[$1='`$ECHO "$][$1" | $SED "$delay_single_quote_subst"`']) # _LT_CONFIG_STATUS_DECLARATIONS @@ -418,7 +435,7 @@ # embedded single quotes properly. In configure, this macro expands # each variable declared with _LT_DECL (and _LT_TAGDECL) into: # -# ='`$ECHO "X$" | $Xsed -e "$delay_single_quote_subst"`' +# ='`$ECHO "$" | $SED "$delay_single_quote_subst"`' m4_defun([_LT_CONFIG_STATUS_DECLARATIONS], [m4_foreach([_lt_var], m4_quote(lt_decl_all_varnames), [m4_n([_LT_CONFIG_STATUS_DECLARE(_lt_var)])])]) @@ -517,12 +534,20 @@ LTCFLAGS='$LTCFLAGS' compiler='$compiler_DEFAULT' +# A function that is used when there is no print builtin or printf. +func_fallback_echo () +{ + eval 'cat <<_LTECHO_EOF +\$[]1 +_LTECHO_EOF' +} + # Quote evaled strings. for var in lt_decl_all_varnames([[ \ ]], lt_decl_quote_varnames); do - case \`eval \\\\\$ECHO "X\\\\\$\$var"\` in + case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in *[[\\\\\\\`\\"\\\$]]*) - eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"X\\\$\$var\\" | \\\$Xsed -e \\"\\\$sed_quote_subst\\"\\\`\\\\\\"" + eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED \\"\\\$sed_quote_subst\\"\\\`\\\\\\"" ;; *) eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\"" @@ -533,9 +558,9 @@ # Double-quote double-evaled strings. for var in lt_decl_all_varnames([[ \ ]], lt_decl_dquote_varnames); do - case \`eval \\\\\$ECHO "X\\\\\$\$var"\` in + case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in *[[\\\\\\\`\\"\\\$]]*) - eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"X\\\$\$var\\" | \\\$Xsed -e \\"\\\$double_quote_subst\\" -e \\"\\\$sed_quote_subst\\" -e \\"\\\$delay_variable_subst\\"\\\`\\\\\\"" + eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED -e \\"\\\$double_quote_subst\\" -e \\"\\\$sed_quote_subst\\" -e \\"\\\$delay_variable_subst\\"\\\`\\\\\\"" ;; *) eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\"" @@ -543,16 +568,38 @@ esac done -# Fix-up fallback echo if it was mangled by the above quoting rules. -case \$lt_ECHO in -*'\\\[$]0 --fallback-echo"')dnl " - lt_ECHO=\`\$ECHO "X\$lt_ECHO" | \$Xsed -e 's/\\\\\\\\\\\\\\\[$]0 --fallback-echo"\[$]/\[$]0 --fallback-echo"/'\` - ;; -esac - _LT_OUTPUT_LIBTOOL_INIT ]) +# _LT_GENERATED_FILE_INIT(FILE, [COMMENT]) +# ------------------------------------ +# Generate a child script FILE with all initialization necessary to +# reuse the environment learned by the parent script, and make the +# file executable. If COMMENT is supplied, it is inserted after the +# `#!' sequence but before initialization text begins. After this +# macro, additional text can be appended to FILE to form the body of +# the child script. The macro ends with non-zero status if the +# file could not be fully written (such as if the disk is full). +m4_ifdef([AS_INIT_GENERATED], +[m4_defun([_LT_GENERATED_FILE_INIT],[AS_INIT_GENERATED($@)])], +[m4_defun([_LT_GENERATED_FILE_INIT], +[m4_require([AS_PREPARE])]dnl +[m4_pushdef([AS_MESSAGE_LOG_FD])]dnl +[lt_write_fail=0 +cat >$1 <<_ASEOF || lt_write_fail=1 +#! $SHELL +# Generated by $as_me. +$2 +SHELL=\${CONFIG_SHELL-$SHELL} +export SHELL +_ASEOF +cat >>$1 <<\_ASEOF || lt_write_fail=1 +AS_SHELL_SANITIZE +_AS_PREPARE +exec AS_MESSAGE_FD>&1 +_ASEOF +test $lt_write_fail = 0 && chmod +x $1[]dnl +m4_popdef([AS_MESSAGE_LOG_FD])])])# _LT_GENERATED_FILE_INIT # LT_OUTPUT # --------- @@ -562,20 +609,11 @@ AC_DEFUN([LT_OUTPUT], [: ${CONFIG_LT=./config.lt} AC_MSG_NOTICE([creating $CONFIG_LT]) -cat >"$CONFIG_LT" <<_LTEOF -#! $SHELL -# Generated by $as_me. -# Run this file to recreate a libtool stub with the current configuration. - -lt_cl_silent=false -SHELL=\${CONFIG_SHELL-$SHELL} -_LTEOF +_LT_GENERATED_FILE_INIT(["$CONFIG_LT"], +[# Run this file to recreate a libtool stub with the current configuration.]) cat >>"$CONFIG_LT" <<\_LTEOF -AS_SHELL_SANITIZE -_AS_PREPARE - -exec AS_MESSAGE_FD>&1 +lt_cl_silent=false exec AS_MESSAGE_LOG_FD>>config.log { echo @@ -601,7 +639,7 @@ m4_ifset([AC_PACKAGE_VERSION], [ AC_PACKAGE_VERSION]) configured by $[0], generated by m4_PACKAGE_STRING. -Copyright (C) 2008 Free Software Foundation, Inc. +Copyright (C) 2011 Free Software Foundation, Inc. This config.lt script is free software; the Free Software Foundation gives unlimited permision to copy, distribute and modify it." @@ -646,15 +684,13 @@ # appending to config.log, which fails on DOS, as config.log is still kept # open by configure. Here we exec the FD to /dev/null, effectively closing # config.log, so it can be properly (re)opened and appended to by config.lt. -if test "$no_create" != yes; then - lt_cl_success=: - test "$silent" = yes && - lt_config_lt_args="$lt_config_lt_args --quiet" - exec AS_MESSAGE_LOG_FD>/dev/null - $SHELL "$CONFIG_LT" $lt_config_lt_args || lt_cl_success=false - exec AS_MESSAGE_LOG_FD>>config.log - $lt_cl_success || AS_EXIT(1) -fi +lt_cl_success=: +test "$silent" = yes && + lt_config_lt_args="$lt_config_lt_args --quiet" +exec AS_MESSAGE_LOG_FD>/dev/null +$SHELL "$CONFIG_LT" $lt_config_lt_args || lt_cl_success=false +exec AS_MESSAGE_LOG_FD>>config.log +$lt_cl_success || AS_EXIT(1) ])# LT_OUTPUT @@ -717,15 +753,12 @@ # if finds mixed CR/LF and LF-only lines. Since sed operates in # text mode, it properly converts lines to CR/LF. This bash problem # is reportedly fixed, but why not run on old versions too? - sed '/^# Generated shell functions inserted here/q' "$ltmain" >> "$cfgfile" \ - || (rm -f "$cfgfile"; exit 1) - - _LT_PROG_XSI_SHELLFNS + sed '$q' "$ltmain" >> "$cfgfile" \ + || (rm -f "$cfgfile"; exit 1) - sed -n '/^# Generated shell functions inserted here/,$p' "$ltmain" >> "$cfgfile" \ - || (rm -f "$cfgfile"; exit 1) + _LT_PROG_REPLACE_SHELLFNS - mv -f "$cfgfile" "$ofile" || + mv -f "$cfgfile" "$ofile" || (rm -f "$ofile" && cp "$cfgfile" "$ofile" && rm -f "$cfgfile") chmod +x "$ofile" ], @@ -770,6 +803,7 @@ m4_case([$1], [C], [_LT_LANG(C)], [C++], [_LT_LANG(CXX)], + [Go], [_LT_LANG(GO)], [Java], [_LT_LANG(GCJ)], [Fortran 77], [_LT_LANG(F77)], [Fortran], [_LT_LANG(FC)], @@ -791,6 +825,31 @@ ])# _LT_LANG +m4_ifndef([AC_PROG_GO], [ +############################################################ +# NOTE: This macro has been submitted for inclusion into # +# GNU Autoconf as AC_PROG_GO. When it is available in # +# a released version of Autoconf we should remove this # +# macro and use it instead. # +############################################################ +m4_defun([AC_PROG_GO], +[AC_LANG_PUSH(Go)dnl +AC_ARG_VAR([GOC], [Go compiler command])dnl +AC_ARG_VAR([GOFLAGS], [Go compiler flags])dnl +_AC_ARG_VAR_LDFLAGS()dnl +AC_CHECK_TOOL(GOC, gccgo) +if test -z "$GOC"; then + if test -n "$ac_tool_prefix"; then + AC_CHECK_PROG(GOC, [${ac_tool_prefix}gccgo], [${ac_tool_prefix}gccgo]) + fi +fi +if test -z "$GOC"; then + AC_CHECK_PROG(GOC, gccgo, gccgo, false) +fi +])#m4_defun +])#m4_ifndef + + # _LT_LANG_DEFAULT_CONFIG # ----------------------- m4_defun([_LT_LANG_DEFAULT_CONFIG], @@ -821,6 +880,10 @@ m4_ifdef([LT_PROG_GCJ], [m4_define([LT_PROG_GCJ], defn([LT_PROG_GCJ])[LT_LANG(GCJ)])])])])]) +AC_PROVIDE_IFELSE([AC_PROG_GO], + [LT_LANG(GO)], + [m4_define([AC_PROG_GO], defn([AC_PROG_GO])[LT_LANG(GO)])]) + AC_PROVIDE_IFELSE([LT_PROG_RC], [LT_LANG(RC)], [m4_define([LT_PROG_RC], defn([LT_PROG_RC])[LT_LANG(RC)])]) @@ -831,11 +894,13 @@ AU_DEFUN([AC_LIBTOOL_F77], [LT_LANG(Fortran 77)]) AU_DEFUN([AC_LIBTOOL_FC], [LT_LANG(Fortran)]) AU_DEFUN([AC_LIBTOOL_GCJ], [LT_LANG(Java)]) +AU_DEFUN([AC_LIBTOOL_RC], [LT_LANG(Windows Resource)]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_LIBTOOL_CXX], []) dnl AC_DEFUN([AC_LIBTOOL_F77], []) dnl AC_DEFUN([AC_LIBTOOL_FC], []) dnl AC_DEFUN([AC_LIBTOOL_GCJ], []) +dnl AC_DEFUN([AC_LIBTOOL_RC], []) # _LT_TAG_COMPILER @@ -921,7 +986,13 @@ $LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \ -dynamiclib -Wl,-single_module conftest.c 2>conftest.err _lt_result=$? - if test -f libconftest.dylib && test ! -s conftest.err && test $_lt_result = 0; then + # If there is a non-empty error log, and "single_module" + # appears in it, assume the flag caused a linker warning + if test -s conftest.err && $GREP single_module conftest.err; then + cat conftest.err >&AS_MESSAGE_LOG_FD + # Otherwise, if the output was created with a 0 exit code from + # the compiler, it worked. + elif test -f libconftest.dylib && test $_lt_result -eq 0; then lt_cv_apple_cc_single_mod=yes else cat conftest.err >&AS_MESSAGE_LOG_FD @@ -929,6 +1000,7 @@ rm -rf libconftest.dylib* rm -f conftest.* fi]) + AC_CACHE_CHECK([for -exported_symbols_list linker flag], [lt_cv_ld_exported_symbols_list], [lt_cv_ld_exported_symbols_list=no @@ -940,6 +1012,34 @@ [lt_cv_ld_exported_symbols_list=no]) LDFLAGS="$save_LDFLAGS" ]) + + AC_CACHE_CHECK([for -force_load linker flag],[lt_cv_ld_force_load], + [lt_cv_ld_force_load=no + cat > conftest.c << _LT_EOF +int forced_loaded() { return 2;} +_LT_EOF + echo "$LTCC $LTCFLAGS -c -o conftest.o conftest.c" >&AS_MESSAGE_LOG_FD + $LTCC $LTCFLAGS -c -o conftest.o conftest.c 2>&AS_MESSAGE_LOG_FD + echo "$AR cru libconftest.a conftest.o" >&AS_MESSAGE_LOG_FD + $AR cru libconftest.a conftest.o 2>&AS_MESSAGE_LOG_FD + echo "$RANLIB libconftest.a" >&AS_MESSAGE_LOG_FD + $RANLIB libconftest.a 2>&AS_MESSAGE_LOG_FD + cat > conftest.c << _LT_EOF +int main() { return 0;} +_LT_EOF + echo "$LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a" >&AS_MESSAGE_LOG_FD + $LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a 2>conftest.err + _lt_result=$? + if test -s conftest.err && $GREP force_load conftest.err; then + cat conftest.err >&AS_MESSAGE_LOG_FD + elif test -f conftest && test $_lt_result -eq 0 && $GREP forced_load conftest >/dev/null 2>&1 ; then + lt_cv_ld_force_load=yes + else + cat conftest.err >&AS_MESSAGE_LOG_FD + fi + rm -f conftest.err libconftest.a conftest conftest.c + rm -rf conftest.dSYM + ]) case $host_os in rhapsody* | darwin1.[[012]]) _lt_dar_allow_undefined='${wl}-undefined ${wl}suppress' ;; @@ -967,7 +1067,7 @@ else _lt_dar_export_syms='~$NMEDIT -s $output_objdir/${libname}-symbols.expsym ${lib}' fi - if test "$DSYMUTIL" != ":"; then + if test "$DSYMUTIL" != ":" && test "$lt_cv_ld_force_load" = "no"; then _lt_dsymutil='~$DSYMUTIL $lib || :' else _lt_dsymutil= @@ -977,8 +1077,8 @@ ]) -# _LT_DARWIN_LINKER_FEATURES -# -------------------------- +# _LT_DARWIN_LINKER_FEATURES([TAG]) +# --------------------------------- # Checks for linker and compiler features on darwin m4_defun([_LT_DARWIN_LINKER_FEATURES], [ @@ -987,7 +1087,13 @@ _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_automatic, $1)=yes _LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported - _LT_TAGVAR(whole_archive_flag_spec, $1)='' + if test "$lt_cv_ld_force_load" = "yes"; then + _LT_TAGVAR(whole_archive_flag_spec, $1)='`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience ${wl}-force_load,$conv\"; done; func_echo_all \"$new_convenience\"`' + m4_case([$1], [F77], [_LT_TAGVAR(compiler_needs_object, $1)=yes], + [FC], [_LT_TAGVAR(compiler_needs_object, $1)=yes]) + else + _LT_TAGVAR(whole_archive_flag_spec, $1)='' + fi _LT_TAGVAR(link_all_deplibs, $1)=yes _LT_TAGVAR(allow_undefined_flag, $1)="$_lt_dar_allow_undefined" case $cc_basename in @@ -995,7 +1101,7 @@ *) _lt_dar_can_shared=$GCC ;; esac if test "$_lt_dar_can_shared" = "yes"; then - output_verbose_link_cmd=echo + output_verbose_link_cmd=func_echo_all _LT_TAGVAR(archive_cmds, $1)="\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod${_lt_dsymutil}" _LT_TAGVAR(module_cmds, $1)="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dsymutil}" _LT_TAGVAR(archive_expsym_cmds, $1)="sed 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring ${_lt_dar_single_mod}${_lt_dar_export_syms}${_lt_dsymutil}" @@ -1011,203 +1117,142 @@ fi ]) -# _LT_SYS_MODULE_PATH_AIX -# ----------------------- +# _LT_SYS_MODULE_PATH_AIX([TAGNAME]) +# ---------------------------------- # Links a minimal program and checks the executable # for the system default hardcoded library path. In most cases, # this is /usr/lib:/lib, but when the MPI compilers are used # the location of the communication and MPI libs are included too. # If we don't find anything, use the default library path according # to the aix ld manual. +# Store the results from the different compilers for each TAGNAME. +# Allow to override them for all tags through lt_cv_aix_libpath. m4_defun([_LT_SYS_MODULE_PATH_AIX], [m4_require([_LT_DECL_SED])dnl -AC_LINK_IFELSE(AC_LANG_PROGRAM,[ -lt_aix_libpath_sed=' - /Import File Strings/,/^$/ { - /^0/ { - s/^0 *\(.*\)$/\1/ - p - } - }' -aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` -# Check for a 64-bit object if we didn't find anything. -if test -z "$aix_libpath"; then - aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` -fi],[]) -if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi +if test "${lt_cv_aix_libpath+set}" = set; then + aix_libpath=$lt_cv_aix_libpath +else + AC_CACHE_VAL([_LT_TAGVAR([lt_cv_aix_libpath_], [$1])], + [AC_LINK_IFELSE([AC_LANG_PROGRAM],[ + lt_aix_libpath_sed='[ + /Import File Strings/,/^$/ { + /^0/ { + s/^0 *\([^ ]*\) *$/\1/ + p + } + }]' + _LT_TAGVAR([lt_cv_aix_libpath_], [$1])=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` + # Check for a 64-bit object if we didn't find anything. + if test -z "$_LT_TAGVAR([lt_cv_aix_libpath_], [$1])"; then + _LT_TAGVAR([lt_cv_aix_libpath_], [$1])=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` + fi],[]) + if test -z "$_LT_TAGVAR([lt_cv_aix_libpath_], [$1])"; then + _LT_TAGVAR([lt_cv_aix_libpath_], [$1])="/usr/lib:/lib" + fi + ]) + aix_libpath=$_LT_TAGVAR([lt_cv_aix_libpath_], [$1]) +fi ])# _LT_SYS_MODULE_PATH_AIX # _LT_SHELL_INIT(ARG) # ------------------- m4_define([_LT_SHELL_INIT], -[ifdef([AC_DIVERSION_NOTICE], - [AC_DIVERT_PUSH(AC_DIVERSION_NOTICE)], - [AC_DIVERT_PUSH(NOTICE)]) -$1 -AC_DIVERT_POP -])# _LT_SHELL_INIT +[m4_divert_text([M4SH-INIT], [$1 +])])# _LT_SHELL_INIT + # _LT_PROG_ECHO_BACKSLASH # ----------------------- -# Add some code to the start of the generated configure script which -# will find an echo command which doesn't interpret backslashes. +# Find how we can fake an echo command that does not interpret backslash. +# In particular, with Autoconf 2.60 or later we add some code to the start +# of the generated configure script which will find a shell with a builtin +# printf (which we can use as an echo command). m4_defun([_LT_PROG_ECHO_BACKSLASH], -[_LT_SHELL_INIT([ -# Check that we are running under the correct shell. -SHELL=${CONFIG_SHELL-/bin/sh} - -case X$lt_ECHO in -X*--fallback-echo) - # Remove one level of quotation (which was required for Make). - ECHO=`echo "$lt_ECHO" | sed 's,\\\\\[$]\\[$]0,'[$]0','` - ;; -esac - -ECHO=${lt_ECHO-echo} -if test "X[$]1" = X--no-reexec; then - # Discard the --no-reexec flag, and continue. - shift -elif test "X[$]1" = X--fallback-echo; then - # Avoid inline document here, it may be left over - : -elif test "X`{ $ECHO '\t'; } 2>/dev/null`" = 'X\t' ; then - # Yippee, $ECHO works! - : +[ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' +ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO +ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO$ECHO + +AC_MSG_CHECKING([how to print strings]) +# Test print first, because it will be a builtin if present. +if test "X`( print -r -- -n ) 2>/dev/null`" = X-n && \ + test "X`print -r -- $ECHO 2>/dev/null`" = "X$ECHO"; then + ECHO='print -r --' +elif test "X`printf %s $ECHO 2>/dev/null`" = "X$ECHO"; then + ECHO='printf %s\n' else - # Restart under the correct shell. - exec $SHELL "[$]0" --no-reexec ${1+"[$]@"} -fi - -if test "X[$]1" = X--fallback-echo; then - # used as fallback echo - shift - cat <<_LT_EOF -[$]* -_LT_EOF - exit 0 + # Use this function as a fallback that always works. + func_fallback_echo () + { + eval 'cat <<_LTECHO_EOF +$[]1 +_LTECHO_EOF' + } + ECHO='func_fallback_echo' fi -# The HP-UX ksh and POSIX shell print the target directory to stdout -# if CDPATH is set. -(unset CDPATH) >/dev/null 2>&1 && unset CDPATH - -if test -z "$lt_ECHO"; then - if test "X${echo_test_string+set}" != Xset; then - # find a string as large as possible, as long as the shell can cope with it - for cmd in 'sed 50q "[$]0"' 'sed 20q "[$]0"' 'sed 10q "[$]0"' 'sed 2q "[$]0"' 'echo test'; do - # expected sizes: less than 2Kb, 1Kb, 512 bytes, 16 bytes, ... - if { echo_test_string=`eval $cmd`; } 2>/dev/null && - { test "X$echo_test_string" = "X$echo_test_string"; } 2>/dev/null - then - break - fi - done - fi - - if test "X`{ $ECHO '\t'; } 2>/dev/null`" = 'X\t' && - echo_testing_string=`{ $ECHO "$echo_test_string"; } 2>/dev/null` && - test "X$echo_testing_string" = "X$echo_test_string"; then - : - else - # The Solaris, AIX, and Digital Unix default echo programs unquote - # backslashes. This makes it impossible to quote backslashes using - # echo "$something" | sed 's/\\/\\\\/g' - # - # So, first we look for a working echo in the user's PATH. - - lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR - for dir in $PATH /usr/ucb; do - IFS="$lt_save_ifs" - if (test -f $dir/echo || test -f $dir/echo$ac_exeext) && - test "X`($dir/echo '\t') 2>/dev/null`" = 'X\t' && - echo_testing_string=`($dir/echo "$echo_test_string") 2>/dev/null` && - test "X$echo_testing_string" = "X$echo_test_string"; then - ECHO="$dir/echo" - break - fi - done - IFS="$lt_save_ifs" - - if test "X$ECHO" = Xecho; then - # We didn't find a better echo, so look for alternatives. - if test "X`{ print -r '\t'; } 2>/dev/null`" = 'X\t' && - echo_testing_string=`{ print -r "$echo_test_string"; } 2>/dev/null` && - test "X$echo_testing_string" = "X$echo_test_string"; then - # This shell has a builtin print -r that does the trick. - ECHO='print -r' - elif { test -f /bin/ksh || test -f /bin/ksh$ac_exeext; } && - test "X$CONFIG_SHELL" != X/bin/ksh; then - # If we have ksh, try running configure again with it. - ORIGINAL_CONFIG_SHELL=${CONFIG_SHELL-/bin/sh} - export ORIGINAL_CONFIG_SHELL - CONFIG_SHELL=/bin/ksh - export CONFIG_SHELL - exec $CONFIG_SHELL "[$]0" --no-reexec ${1+"[$]@"} - else - # Try using printf. - ECHO='printf %s\n' - if test "X`{ $ECHO '\t'; } 2>/dev/null`" = 'X\t' && - echo_testing_string=`{ $ECHO "$echo_test_string"; } 2>/dev/null` && - test "X$echo_testing_string" = "X$echo_test_string"; then - # Cool, printf works - : - elif echo_testing_string=`($ORIGINAL_CONFIG_SHELL "[$]0" --fallback-echo '\t') 2>/dev/null` && - test "X$echo_testing_string" = 'X\t' && - echo_testing_string=`($ORIGINAL_CONFIG_SHELL "[$]0" --fallback-echo "$echo_test_string") 2>/dev/null` && - test "X$echo_testing_string" = "X$echo_test_string"; then - CONFIG_SHELL=$ORIGINAL_CONFIG_SHELL - export CONFIG_SHELL - SHELL="$CONFIG_SHELL" - export SHELL - ECHO="$CONFIG_SHELL [$]0 --fallback-echo" - elif echo_testing_string=`($CONFIG_SHELL "[$]0" --fallback-echo '\t') 2>/dev/null` && - test "X$echo_testing_string" = 'X\t' && - echo_testing_string=`($CONFIG_SHELL "[$]0" --fallback-echo "$echo_test_string") 2>/dev/null` && - test "X$echo_testing_string" = "X$echo_test_string"; then - ECHO="$CONFIG_SHELL [$]0 --fallback-echo" - else - # maybe with a smaller string... - prev=: - - for cmd in 'echo test' 'sed 2q "[$]0"' 'sed 10q "[$]0"' 'sed 20q "[$]0"' 'sed 50q "[$]0"'; do - if { test "X$echo_test_string" = "X`eval $cmd`"; } 2>/dev/null - then - break - fi - prev="$cmd" - done +# func_echo_all arg... +# Invoke $ECHO with all args, space-separated. +func_echo_all () +{ + $ECHO "$*" +} - if test "$prev" != 'sed 50q "[$]0"'; then - echo_test_string=`eval $prev` - export echo_test_string - exec ${ORIGINAL_CONFIG_SHELL-${CONFIG_SHELL-/bin/sh}} "[$]0" ${1+"[$]@"} - else - # Oops. We lost completely, so just stick with echo. - ECHO=echo - fi - fi - fi - fi - fi -fi +case "$ECHO" in + printf*) AC_MSG_RESULT([printf]) ;; + print*) AC_MSG_RESULT([print -r]) ;; + *) AC_MSG_RESULT([cat]) ;; +esac -# Copy echo and quote the copy suitably for passing to libtool from -# the Makefile, instead of quoting the original, which is used later. -lt_ECHO=$ECHO -if test "X$lt_ECHO" = "X$CONFIG_SHELL [$]0 --fallback-echo"; then - lt_ECHO="$CONFIG_SHELL \\\$\[$]0 --fallback-echo" -fi +m4_ifdef([_AS_DETECT_SUGGESTED], +[_AS_DETECT_SUGGESTED([ + test -n "${ZSH_VERSION+set}${BASH_VERSION+set}" || ( + ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' + ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO + ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO$ECHO + PATH=/empty FPATH=/empty; export PATH FPATH + test "X`printf %s $ECHO`" = "X$ECHO" \ + || test "X`print -r -- $ECHO`" = "X$ECHO" )])]) -AC_SUBST(lt_ECHO) -]) _LT_DECL([], [SHELL], [1], [Shell to use when invoking shell scripts]) -_LT_DECL([], [ECHO], [1], - [An echo program that does not interpret backslashes]) +_LT_DECL([], [ECHO], [1], [An echo program that protects backslashes]) ])# _LT_PROG_ECHO_BACKSLASH +# _LT_WITH_SYSROOT +# ---------------- +AC_DEFUN([_LT_WITH_SYSROOT], +[AC_MSG_CHECKING([for sysroot]) +AC_ARG_WITH([sysroot], +[ --with-sysroot[=DIR] Search for dependent libraries within DIR + (or the compiler's sysroot if not specified).], +[], [with_sysroot=no]) + +dnl lt_sysroot will always be passed unquoted. We quote it here +dnl in case the user passed a directory name. +lt_sysroot= +case ${with_sysroot} in #( + yes) + if test "$GCC" = yes; then + lt_sysroot=`$CC --print-sysroot 2>/dev/null` + fi + ;; #( + /*) + lt_sysroot=`echo "$with_sysroot" | sed -e "$sed_quote_subst"` + ;; #( + no|'') + ;; #( + *) + AC_MSG_RESULT([${with_sysroot}]) + AC_MSG_ERROR([The sysroot must be an absolute path.]) + ;; +esac + + AC_MSG_RESULT([${lt_sysroot:-no}]) +_LT_DECL([], [lt_sysroot], [0], [The root where to search for ]dnl +[dependent libraries, and in which our libraries should be installed.])]) + # _LT_ENABLE_LOCK # --------------- m4_defun([_LT_ENABLE_LOCK], @@ -1236,7 +1281,7 @@ ;; *-*-irix6*) # Find out which ABI we are using. - echo '[#]line __oline__ "configure"' > conftest.$ac_ext + echo '[#]line '$LINENO' "configure"' > conftest.$ac_ext if AC_TRY_EVAL(ac_compile); then if test "$lt_cv_prog_gnu_ld" = yes; then case `/usr/bin/file conftest.$ac_objext` in @@ -1329,14 +1374,27 @@ CFLAGS="$SAVE_CFLAGS" fi ;; -sparc*-*solaris*) +*-*solaris*) # Find out which ABI we are using. echo 'int i;' > conftest.$ac_ext if AC_TRY_EVAL(ac_compile); then case `/usr/bin/file conftest.o` in *64-bit*) case $lt_cv_prog_gnu_ld in - yes*) LD="${LD-ld} -m elf64_sparc" ;; + yes*) + case $host in + i?86-*-solaris*) + LD="${LD-ld} -m elf_x86_64" + ;; + sparc*-*-solaris*) + LD="${LD-ld} -m elf64_sparc" + ;; + esac + # GNU ld 2.21 introduced _sol2 emulations. Use them if available. + if ${LD-ld} -V | grep _sol2 >/dev/null 2>&1; then + LD="${LD-ld}_sol2" + fi + ;; *) if ${LD-ld} -64 -r -o conftest2.o conftest.o >/dev/null 2>&1; then LD="${LD-ld} -64" @@ -1354,14 +1412,47 @@ ])# _LT_ENABLE_LOCK +# _LT_PROG_AR +# ----------- +m4_defun([_LT_PROG_AR], +[AC_CHECK_TOOLS(AR, [ar], false) +: ${AR=ar} +: ${AR_FLAGS=cru} +_LT_DECL([], [AR], [1], [The archiver]) +_LT_DECL([], [AR_FLAGS], [1], [Flags to create an archive]) + +AC_CACHE_CHECK([for archiver @FILE support], [lt_cv_ar_at_file], + [lt_cv_ar_at_file=no + AC_COMPILE_IFELSE([AC_LANG_PROGRAM], + [echo conftest.$ac_objext > conftest.lst + lt_ar_try='$AR $AR_FLAGS libconftest.a @conftest.lst >&AS_MESSAGE_LOG_FD' + AC_TRY_EVAL([lt_ar_try]) + if test "$ac_status" -eq 0; then + # Ensure the archiver fails upon bogus file names. + rm -f conftest.$ac_objext libconftest.a + AC_TRY_EVAL([lt_ar_try]) + if test "$ac_status" -ne 0; then + lt_cv_ar_at_file=@ + fi + fi + rm -f conftest.* libconftest.a + ]) + ]) + +if test "x$lt_cv_ar_at_file" = xno; then + archiver_list_spec= +else + archiver_list_spec=$lt_cv_ar_at_file +fi +_LT_DECL([], [archiver_list_spec], [1], + [How to feed a file listing to the archiver]) +])# _LT_PROG_AR + + # _LT_CMD_OLD_ARCHIVE # ------------------- m4_defun([_LT_CMD_OLD_ARCHIVE], -[AC_CHECK_TOOL(AR, ar, false) -test -z "$AR" && AR=ar -test -z "$AR_FLAGS" && AR_FLAGS=cru -_LT_DECL([], [AR], [1], [The archiver]) -_LT_DECL([], [AR_FLAGS], [1]) +[_LT_PROG_AR AC_CHECK_TOOL(STRIP, strip, :) test -z "$STRIP" && STRIP=: @@ -1380,18 +1471,27 @@ if test -n "$RANLIB"; then case $host_os in openbsd*) - old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB -t \$oldlib" + old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB -t \$tool_oldlib" ;; *) - old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB \$oldlib" + old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB \$tool_oldlib" ;; esac - old_archive_cmds="$old_archive_cmds~\$RANLIB \$oldlib" + old_archive_cmds="$old_archive_cmds~\$RANLIB \$tool_oldlib" fi + +case $host_os in + darwin*) + lock_old_archive_extraction=yes ;; + *) + lock_old_archive_extraction=no ;; +esac _LT_DECL([], [old_postinstall_cmds], [2]) _LT_DECL([], [old_postuninstall_cmds], [2]) _LT_TAGDECL([], [old_archive_cmds], [2], [Commands used to build an old-style archive]) +_LT_DECL([], [lock_old_archive_extraction], [0], + [Whether to use a lock for old archive extraction]) ])# _LT_CMD_OLD_ARCHIVE @@ -1416,15 +1516,15 @@ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [[^ ]]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:__oline__: $lt_compile\"" >&AS_MESSAGE_LOG_FD) + (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&AS_MESSAGE_LOG_FD) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&AS_MESSAGE_LOG_FD - echo "$as_me:__oline__: \$? = $ac_status" >&AS_MESSAGE_LOG_FD + echo "$as_me:$LINENO: \$? = $ac_status" >&AS_MESSAGE_LOG_FD if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings other than the usual output. - $ECHO "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' >conftest.exp + $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' >conftest.exp $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then $2=yes @@ -1464,7 +1564,7 @@ if test -s conftest.err; then # Append any errors to the config.log. cat conftest.err 1>&AS_MESSAGE_LOG_FD - $ECHO "X$_lt_linker_boilerplate" | $Xsed -e '/^$/d' > conftest.exp + $ECHO "$_lt_linker_boilerplate" | $SED '/^$/d' > conftest.exp $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 if diff conftest.exp conftest.er2 >/dev/null; then $2=yes @@ -1527,6 +1627,11 @@ lt_cv_sys_max_cmd_len=8192; ;; + mint*) + # On MiNT this can take a long time and run out of memory. + lt_cv_sys_max_cmd_len=8192; + ;; + amigaos*) # On AmigaOS with pdksh, this test takes hours, literally. # So we just punt and use a minimum line length of 8192. @@ -1552,6 +1657,11 @@ lt_cv_sys_max_cmd_len=196608 ;; + os2*) + # The test takes a long time on OS/2. + lt_cv_sys_max_cmd_len=8192 + ;; + osf*) # Dr. Hans Ekkehard Plesser reports seeing a kernel panic running configure # due to this test when exec_disable_arg_limit is 1 on Tru64. It is not @@ -1591,8 +1701,8 @@ # If test is not a shell built-in, we'll probably end up computing a # maximum length that is only half of the actual maximum length, but # we can't tell. - while { test "X"`$SHELL [$]0 --fallback-echo "X$teststring$teststring" 2>/dev/null` \ - = "XX$teststring$teststring"; } >/dev/null 2>&1 && + while { test "X"`env echo "$teststring$teststring" 2>/dev/null` \ + = "X$teststring$teststring"; } >/dev/null 2>&1 && test $i != 17 # 1/2 MB should be enough do i=`expr $i + 1` @@ -1643,7 +1753,7 @@ lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<_LT_EOF -[#line __oline__ "configure" +[#line $LINENO "configure" #include "confdefs.h" #if HAVE_DLFCN_H @@ -1684,7 +1794,13 @@ # endif #endif -void fnord() { int i=42;} +/* When -fvisbility=hidden is used, assume the code has been annotated + correspondingly for the symbols needed. */ +#if defined(__GNUC__) && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3)) +int fnord () __attribute__((visibility("default"))); +#endif + +int fnord () { return 42; } int main () { void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW); @@ -1693,7 +1809,11 @@ if (self) { if (dlsym (self,"fnord")) status = $lt_dlno_uscore; - else if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore; + else + { + if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore; + else puts (dlerror ()); + } /* dlclose (self); */ } else @@ -1869,16 +1989,16 @@ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [[^ ]]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:__oline__: $lt_compile\"" >&AS_MESSAGE_LOG_FD) + (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&AS_MESSAGE_LOG_FD) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&AS_MESSAGE_LOG_FD - echo "$as_me:__oline__: \$? = $ac_status" >&AS_MESSAGE_LOG_FD + echo "$as_me:$LINENO: \$? = $ac_status" >&AS_MESSAGE_LOG_FD if (exit $ac_status) && test -s out/conftest2.$ac_objext then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings - $ECHO "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' > out/conftest.exp + $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' > out/conftest.exp $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2 if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then _LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)=yes @@ -2037,6 +2157,7 @@ m4_require([_LT_FILEUTILS_DEFAULTS])dnl m4_require([_LT_DECL_OBJDUMP])dnl m4_require([_LT_DECL_SED])dnl +m4_require([_LT_CHECK_SHELL_FEATURES])dnl AC_MSG_CHECKING([dynamic linker characteristics]) m4_if([$1], [], [ @@ -2045,16 +2166,23 @@ darwin*) lt_awk_arg="/^libraries:/,/LR/" ;; *) lt_awk_arg="/^libraries:/" ;; esac - lt_search_path_spec=`$CC -print-search-dirs | awk $lt_awk_arg | $SED -e "s/^libraries://" -e "s,=/,/,g"` - if $ECHO "$lt_search_path_spec" | $GREP ';' >/dev/null ; then + case $host_os in + mingw* | cegcc*) lt_sed_strip_eq="s,=\([[A-Za-z]]:\),\1,g" ;; + *) lt_sed_strip_eq="s,=/,/,g" ;; + esac + lt_search_path_spec=`$CC -print-search-dirs | awk $lt_awk_arg | $SED -e "s/^libraries://" -e $lt_sed_strip_eq` + case $lt_search_path_spec in + *\;*) # if the path contains ";" then we assume it to be the separator # otherwise default to the standard path separator (i.e. ":") - it is # assumed that no part of a normal pathname contains ";" but that should # okay in the real world where ";" in dirpaths is itself problematic. - lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED -e 's/;/ /g'` - else - lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` - fi + lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED 's/;/ /g'` + ;; + *) + lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED "s/$PATH_SEPARATOR/ /g"` + ;; + esac # Ok, now we have the path, separated by spaces, we can step through it # and add multilib dir if necessary. lt_tmp_lt_search_path_spec= @@ -2067,7 +2195,7 @@ lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path" fi done - lt_search_path_spec=`$ECHO $lt_tmp_lt_search_path_spec | awk ' + lt_search_path_spec=`$ECHO "$lt_tmp_lt_search_path_spec" | awk ' BEGIN {RS=" "; FS="/|\n";} { lt_foo=""; lt_count=0; @@ -2087,7 +2215,13 @@ if (lt_foo != "") { lt_freq[[lt_foo]]++; } if (lt_freq[[lt_foo]] == 1) { print lt_foo; } }'` - sys_lib_search_path_spec=`$ECHO $lt_search_path_spec` + # AWK program above erroneously prepends '/' to C:/dos/paths + # for these hosts. + case $host_os in + mingw* | cegcc*) lt_search_path_spec=`$ECHO "$lt_search_path_spec" |\ + $SED 's,/\([[A-Za-z]]:\),\1,g'` ;; + esac + sys_lib_search_path_spec=`$ECHO "$lt_search_path_spec" | $lt_NL2SP` else sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib" fi]) @@ -2113,7 +2247,7 @@ case $host_os in aix3*) - version_type=linux + version_type=linux # correct to gnu/linux during the next big refactor library_names_spec='${libname}${release}${shared_ext}$versuffix $libname.a' shlibpath_var=LIBPATH @@ -2122,7 +2256,7 @@ ;; aix[[4-9]]*) - version_type=linux + version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no hardcode_into_libs=yes @@ -2175,7 +2309,7 @@ m68k) library_names_spec='$libname.ixlibrary $libname.a' # Create ${libname}_ixlibrary.a entries in /sys/libs. - finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`$ECHO "X$lib" | $Xsed -e '\''s%^.*/\([[^/]]*\)\.ixlibrary$%\1%'\''`; test $RM /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done' + finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`func_echo_all "$lib" | $SED '\''s%^.*/\([[^/]]*\)\.ixlibrary$%\1%'\''`; test $RM /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done' ;; esac ;; @@ -2187,7 +2321,7 @@ ;; bsdi[[45]]*) - version_type=linux + version_type=linux # correct to gnu/linux during the next big refactor need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' @@ -2206,8 +2340,9 @@ need_version=no need_lib_prefix=no - case $GCC,$host_os in - yes,cygwin* | yes,mingw* | yes,pw32* | yes,cegcc*) + case $GCC,$cc_basename in + yes,*) + # gcc library_names_spec='$libname.dll.a' # DLL is installed to $(libdir)/../bin by postinstall_cmds postinstall_cmds='base_file=`basename \${file}`~ @@ -2228,36 +2363,83 @@ cygwin*) # Cygwin DLLs use 'cyg' prefix rather than 'lib' soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}' - sys_lib_search_path_spec="/usr/lib /lib/w32api /lib /usr/local/lib" +m4_if([$1], [],[ + sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/lib/w32api"]) ;; mingw* | cegcc*) # MinGW DLLs use traditional 'lib' prefix soname_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}' - sys_lib_search_path_spec=`$CC -print-search-dirs | $GREP "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"` - if $ECHO "$sys_lib_search_path_spec" | [$GREP ';[c-zC-Z]:/' >/dev/null]; then - # It is most probably a Windows format PATH printed by - # mingw gcc, but we are running on Cygwin. Gcc prints its search - # path with ; separators, and with drive letters. We can handle the - # drive letters (cygwin fileutils understands them), so leave them, - # especially as we might pass files found there to a mingw objdump, - # which wouldn't understand a cygwinified path. Ahh. - sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'` - else - sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` - fi ;; pw32*) # pw32 DLLs use 'pw' prefix rather than 'lib' library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}' ;; esac + dynamic_linker='Win32 ld.exe' + ;; + + *,cl*) + # Native MSVC + libname_spec='$name' + soname_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}' + library_names_spec='${libname}.dll.lib' + + case $build_os in + mingw*) + sys_lib_search_path_spec= + lt_save_ifs=$IFS + IFS=';' + for lt_path in $LIB + do + IFS=$lt_save_ifs + # Let DOS variable expansion print the short 8.3 style file name. + lt_path=`cd "$lt_path" 2>/dev/null && cmd //C "for %i in (".") do @echo %~si"` + sys_lib_search_path_spec="$sys_lib_search_path_spec $lt_path" + done + IFS=$lt_save_ifs + # Convert to MSYS style. + sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | sed -e 's|\\\\|/|g' -e 's| \\([[a-zA-Z]]\\):| /\\1|g' -e 's|^ ||'` + ;; + cygwin*) + # Convert to unix form, then to dos form, then back to unix form + # but this time dos style (no spaces!) so that the unix form looks + # like /cygdrive/c/PROGRA~1:/cygdr... + sys_lib_search_path_spec=`cygpath --path --unix "$LIB"` + sys_lib_search_path_spec=`cygpath --path --dos "$sys_lib_search_path_spec" 2>/dev/null` + sys_lib_search_path_spec=`cygpath --path --unix "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` + ;; + *) + sys_lib_search_path_spec="$LIB" + if $ECHO "$sys_lib_search_path_spec" | [$GREP ';[c-zC-Z]:/' >/dev/null]; then + # It is most probably a Windows format PATH. + sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'` + else + sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` + fi + # FIXME: find the short name or the path components, as spaces are + # common. (e.g. "Program Files" -> "PROGRA~1") + ;; + esac + + # DLL is installed to $(libdir)/../bin by postinstall_cmds + postinstall_cmds='base_file=`basename \${file}`~ + dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i; echo \$dlname'\''`~ + dldir=$destdir/`dirname \$dlpath`~ + test -d \$dldir || mkdir -p \$dldir~ + $install_prog $dir/$dlname \$dldir/$dlname' + postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ + dlpath=$dir/\$dldll~ + $RM \$dlpath' + shlibpath_overrides_runpath=yes + dynamic_linker='Win32 link.exe' ;; *) + # Assume MSVC wrapper library_names_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext} $libname.lib' + dynamic_linker='Win32 ld.exe' ;; esac - dynamic_linker='Win32 ld.exe' # FIXME: first we should search . and the directory the executable is in shlibpath_var=PATH ;; @@ -2278,7 +2460,7 @@ ;; dgux*) - version_type=linux + version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname$shared_ext' @@ -2286,10 +2468,6 @@ shlibpath_var=LD_LIBRARY_PATH ;; -freebsd1*) - dynamic_linker=no - ;; - freebsd* | dragonfly*) # DragonFly does not have aout. When/if they implement a new # versioning mechanism, adjust this. @@ -2297,7 +2475,7 @@ objformat=`/usr/bin/objformat` else case $host_os in - freebsd[[123]]*) objformat=aout ;; + freebsd[[23]].*) objformat=aout ;; *) objformat=elf ;; esac fi @@ -2315,7 +2493,7 @@ esac shlibpath_var=LD_LIBRARY_PATH case $host_os in - freebsd2*) + freebsd2.*) shlibpath_overrides_runpath=yes ;; freebsd3.[[01]]* | freebsdelf3.[[01]]*) @@ -2335,12 +2513,26 @@ ;; gnu*) - version_type=linux + version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=no + hardcode_into_libs=yes + ;; + +haiku*) + version_type=linux # correct to gnu/linux during the next big refactor + need_lib_prefix=no + need_version=no + dynamic_linker="$host_os runtime_loader" + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LIBRARY_PATH + shlibpath_overrides_runpath=yes + sys_lib_dlsearch_path_spec='/boot/home/config/lib /boot/common/lib /boot/system/lib' hardcode_into_libs=yes ;; @@ -2386,12 +2578,14 @@ soname_spec='${libname}${release}${shared_ext}$major' ;; esac - # HP-UX runs *really* slowly unless shared libraries are mode 555. + # HP-UX runs *really* slowly unless shared libraries are mode 555, ... postinstall_cmds='chmod 555 $lib' + # or fails outright, so override atomically: + install_override_mode=555 ;; interix[[3-9]]*) - version_type=linux + version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' @@ -2407,7 +2601,7 @@ nonstopux*) version_type=nonstopux ;; *) if test "$lt_cv_prog_gnu_ld" = yes; then - version_type=linux + version_type=linux # correct to gnu/linux during the next big refactor else version_type=irix fi ;; @@ -2444,9 +2638,9 @@ dynamic_linker=no ;; -# This must be Linux ELF. -linux* | k*bsd*-gnu) - version_type=linux +# This must be glibc/ELF. +linux* | k*bsd*-gnu | kopensolaris*-gnu) + version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' @@ -2454,16 +2648,21 @@ finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no + # Some binutils ld are patched to set DT_RUNPATH - save_LDFLAGS=$LDFLAGS - save_libdir=$libdir - eval "libdir=/foo; wl=\"$_LT_TAGVAR(lt_prog_compiler_wl, $1)\"; \ - LDFLAGS=\"\$LDFLAGS $_LT_TAGVAR(hardcode_libdir_flag_spec, $1)\"" - AC_LINK_IFELSE([AC_LANG_PROGRAM([],[])], - [AS_IF([ ($OBJDUMP -p conftest$ac_exeext) 2>/dev/null | grep "RUNPATH.*$libdir" >/dev/null], - [shlibpath_overrides_runpath=yes])]) - LDFLAGS=$save_LDFLAGS - libdir=$save_libdir + AC_CACHE_VAL([lt_cv_shlibpath_overrides_runpath], + [lt_cv_shlibpath_overrides_runpath=no + save_LDFLAGS=$LDFLAGS + save_libdir=$libdir + eval "libdir=/foo; wl=\"$_LT_TAGVAR(lt_prog_compiler_wl, $1)\"; \ + LDFLAGS=\"\$LDFLAGS $_LT_TAGVAR(hardcode_libdir_flag_spec, $1)\"" + AC_LINK_IFELSE([AC_LANG_PROGRAM([],[])], + [AS_IF([ ($OBJDUMP -p conftest$ac_exeext) 2>/dev/null | grep "RUNPATH.*$libdir" >/dev/null], + [lt_cv_shlibpath_overrides_runpath=yes])]) + LDFLAGS=$save_LDFLAGS + libdir=$save_libdir + ]) + shlibpath_overrides_runpath=$lt_cv_shlibpath_overrides_runpath # This implies no fast_install, which is unacceptable. # Some rework will be needed to allow for fast_install @@ -2472,7 +2671,7 @@ # Append ld.so.conf contents to the search path if test -f /etc/ld.so.conf; then - lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \[$]2)); skip = 1; } { if (!skip) print \[$]0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;/^[ ]*hwcap[ ]/d;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;/^$/d' | tr '\n' ' '` + lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \[$]2)); skip = 1; } { if (!skip) print \[$]0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;/^[ ]*hwcap[ ]/d;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;s/"//g;/^$/d' | tr '\n' ' '` sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra" fi @@ -2504,7 +2703,7 @@ ;; newsos6) - version_type=linux + version_type=linux # correct to gnu/linux during the next big refactor library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes @@ -2573,7 +2772,7 @@ ;; solaris*) - version_type=linux + version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' @@ -2598,7 +2797,7 @@ ;; sysv4 | sysv4.3*) - version_type=linux + version_type=linux # correct to gnu/linux during the next big refactor library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH @@ -2622,7 +2821,7 @@ sysv4*MP*) if test -d /usr/nec ;then - version_type=linux + version_type=linux # correct to gnu/linux during the next big refactor library_names_spec='$libname${shared_ext}.$versuffix $libname${shared_ext}.$major $libname${shared_ext}' soname_spec='$libname${shared_ext}.$major' shlibpath_var=LD_LIBRARY_PATH @@ -2653,7 +2852,7 @@ tpf*) # TPF is a cross-target only. Preferred cross-host = GNU/Linux. - version_type=linux + version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' @@ -2663,7 +2862,7 @@ ;; uts4*) - version_type=linux + version_type=linux # correct to gnu/linux during the next big refactor library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH @@ -2705,6 +2904,8 @@ The last name is the one that the linker finds with -lNAME]]) _LT_DECL([], [soname_spec], [1], [[The coded name of the library, if different from the real name]]) +_LT_DECL([], [install_override_mode], [1], + [Permission mode override for installation of shared libraries]) _LT_DECL([], [postinstall_cmds], [2], [Command to use after installation of a shared archive]) _LT_DECL([], [postuninstall_cmds], [2], @@ -2817,6 +3018,7 @@ AC_REQUIRE([AC_CANONICAL_BUILD])dnl m4_require([_LT_DECL_SED])dnl m4_require([_LT_DECL_EGREP])dnl +m4_require([_LT_PROG_ECHO_BACKSLASH])dnl AC_ARG_WITH([gnu-ld], [AS_HELP_STRING([--with-gnu-ld], @@ -2938,6 +3140,11 @@ esac reload_cmds='$LD$reload_flag -o $output$reload_objs' case $host_os in + cygwin* | mingw* | pw32* | cegcc*) + if test "$GCC" != yes; then + reload_cmds=false + fi + ;; darwin*) if test "$GCC" = yes; then reload_cmds='$LTCC $LTCFLAGS -nostdlib ${wl}-r -o $output$reload_objs' @@ -2946,8 +3153,8 @@ fi ;; esac -_LT_DECL([], [reload_flag], [1], [How to create reloadable object files])dnl -_LT_DECL([], [reload_cmds], [2])dnl +_LT_TAGDECL([], [reload_flag], [1], [How to create reloadable object files])dnl +_LT_TAGDECL([], [reload_cmds], [2])dnl ])# _LT_CMD_RELOAD @@ -2999,16 +3206,18 @@ # Base MSYS/MinGW do not provide the 'file' command needed by # func_win32_libid shell function, so use a weaker test based on 'objdump', # unless we find 'file', for example because we are cross-compiling. - if ( file / ) >/dev/null 2>&1; then + # func_win32_libid assumes BSD nm, so disallow it if using MS dumpbin. + if ( test "$lt_cv_nm_interface" = "BSD nm" && file / ) >/dev/null 2>&1; then lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL' lt_cv_file_magic_cmd='func_win32_libid' else - lt_cv_deplibs_check_method='file_magic file format pei*-i386(.*architecture: i386)?' + # Keep this pattern in sync with the one in func_win32_libid. + lt_cv_deplibs_check_method='file_magic file format (pei*-i386(.*architecture: i386)?|pe-arm-wince|pe-x86-64)' lt_cv_file_magic_cmd='$OBJDUMP -f' fi ;; -cegcc) +cegcc*) # use the weaker test based on 'objdump'. See mingw*. lt_cv_deplibs_check_method='file_magic file format pe-arm-.*little(.*architecture: arm)?' lt_cv_file_magic_cmd='$OBJDUMP -f' @@ -3038,6 +3247,10 @@ lt_cv_deplibs_check_method=pass_all ;; +haiku*) + lt_cv_deplibs_check_method=pass_all + ;; + hpux10.20* | hpux11*) lt_cv_file_magic_cmd=/usr/bin/file case $host_cpu in @@ -3046,11 +3259,11 @@ lt_cv_file_magic_test_file=/usr/lib/hpux32/libc.so ;; hppa*64*) - [lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF-[0-9][0-9]) shared object file - PA-RISC [0-9].[0-9]'] + [lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF[ -][0-9][0-9])(-bit)?( [LM]SB)? shared object( file)?[, -]* PA-RISC [0-9]\.[0-9]'] lt_cv_file_magic_test_file=/usr/lib/pa20_64/libc.sl ;; *) - lt_cv_deplibs_check_method='file_magic (s[[0-9]][[0-9]][[0-9]]|PA-RISC[[0-9]].[[0-9]]) shared library' + lt_cv_deplibs_check_method='file_magic (s[[0-9]][[0-9]][[0-9]]|PA-RISC[[0-9]]\.[[0-9]]) shared library' lt_cv_file_magic_test_file=/usr/lib/libc.sl ;; esac @@ -3071,8 +3284,8 @@ lt_cv_deplibs_check_method=pass_all ;; -# This must be Linux ELF. -linux* | k*bsd*-gnu) +# This must be glibc/ELF. +linux* | k*bsd*-gnu | kopensolaris*-gnu) lt_cv_deplibs_check_method=pass_all ;; @@ -3150,6 +3363,21 @@ ;; esac ]) + +file_magic_glob= +want_nocaseglob=no +if test "$build" = "$host"; then + case $host_os in + mingw* | pw32*) + if ( shopt | grep nocaseglob ) >/dev/null 2>&1; then + want_nocaseglob=yes + else + file_magic_glob=`echo aAbBcCdDeEfFgGhHiIjJkKlLmMnNoOpPqQrRsStTuUvVwWxXyYzZ | $SED -e "s/\(..\)/s\/[[\1]]\/[[\1]]\/g;/g"` + fi + ;; + esac +fi + file_magic_cmd=$lt_cv_file_magic_cmd deplibs_check_method=$lt_cv_deplibs_check_method test -z "$deplibs_check_method" && deplibs_check_method=unknown @@ -3157,7 +3385,11 @@ _LT_DECL([], [deplibs_check_method], [1], [Method to check whether dependent libraries are shared objects]) _LT_DECL([], [file_magic_cmd], [1], - [Command to use when deplibs_check_method == "file_magic"]) + [Command to use when deplibs_check_method = "file_magic"]) +_LT_DECL([], [file_magic_glob], [1], + [How to find potential files when deplibs_check_method = "file_magic"]) +_LT_DECL([], [want_nocaseglob], [1], + [Find potential files using nocaseglob when deplibs_check_method = "file_magic"]) ])# _LT_CHECK_MAGIC_METHOD @@ -3214,7 +3446,19 @@ NM="$lt_cv_path_NM" else # Didn't find any BSD compatible name lister, look for dumpbin. - AC_CHECK_TOOLS(DUMPBIN, ["dumpbin -symbols" "link -dump -symbols"], :) + if test -n "$DUMPBIN"; then : + # Let the user override the test. + else + AC_CHECK_TOOLS(DUMPBIN, [dumpbin "link -dump"], :) + case `$DUMPBIN -symbols /dev/null 2>&1 | sed '1q'` in + *COFF*) + DUMPBIN="$DUMPBIN -symbols" + ;; + *) + DUMPBIN=: + ;; + esac + fi AC_SUBST([DUMPBIN]) if test "$DUMPBIN" != ":"; then NM="$DUMPBIN" @@ -3227,13 +3471,13 @@ AC_CACHE_CHECK([the name lister ($NM) interface], [lt_cv_nm_interface], [lt_cv_nm_interface="BSD nm" echo "int some_variable = 0;" > conftest.$ac_ext - (eval echo "\"\$as_me:__oline__: $ac_compile\"" >&AS_MESSAGE_LOG_FD) + (eval echo "\"\$as_me:$LINENO: $ac_compile\"" >&AS_MESSAGE_LOG_FD) (eval "$ac_compile" 2>conftest.err) cat conftest.err >&AS_MESSAGE_LOG_FD - (eval echo "\"\$as_me:__oline__: $NM \\\"conftest.$ac_objext\\\"\"" >&AS_MESSAGE_LOG_FD) + (eval echo "\"\$as_me:$LINENO: $NM \\\"conftest.$ac_objext\\\"\"" >&AS_MESSAGE_LOG_FD) (eval "$NM \"conftest.$ac_objext\"" 2>conftest.err > conftest.out) cat conftest.err >&AS_MESSAGE_LOG_FD - (eval echo "\"\$as_me:__oline__: output\"" >&AS_MESSAGE_LOG_FD) + (eval echo "\"\$as_me:$LINENO: output\"" >&AS_MESSAGE_LOG_FD) cat conftest.out >&AS_MESSAGE_LOG_FD if $GREP 'External.*some_variable' conftest.out > /dev/null; then lt_cv_nm_interface="MS dumpbin" @@ -3248,15 +3492,76 @@ dnl AC_DEFUN([AM_PROG_NM], []) dnl AC_DEFUN([AC_PROG_NM], []) +# _LT_CHECK_SHAREDLIB_FROM_LINKLIB +# -------------------------------- +# how to determine the name of the shared library +# associated with a specific link library. +# -- PORTME fill in with the dynamic library characteristics +m4_defun([_LT_CHECK_SHAREDLIB_FROM_LINKLIB], +[m4_require([_LT_DECL_EGREP]) +m4_require([_LT_DECL_OBJDUMP]) +m4_require([_LT_DECL_DLLTOOL]) +AC_CACHE_CHECK([how to associate runtime and link libraries], +lt_cv_sharedlib_from_linklib_cmd, +[lt_cv_sharedlib_from_linklib_cmd='unknown' -# LT_LIB_M -# -------- -# check for math library +case $host_os in +cygwin* | mingw* | pw32* | cegcc*) + # two different shell functions defined in ltmain.sh + # decide which to use based on capabilities of $DLLTOOL + case `$DLLTOOL --help 2>&1` in + *--identify-strict*) + lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib + ;; + *) + lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib_fallback + ;; + esac + ;; +*) + # fallback: assume linklib IS sharedlib + lt_cv_sharedlib_from_linklib_cmd="$ECHO" + ;; +esac +]) +sharedlib_from_linklib_cmd=$lt_cv_sharedlib_from_linklib_cmd +test -z "$sharedlib_from_linklib_cmd" && sharedlib_from_linklib_cmd=$ECHO + +_LT_DECL([], [sharedlib_from_linklib_cmd], [1], + [Command to associate shared and link libraries]) +])# _LT_CHECK_SHAREDLIB_FROM_LINKLIB + + +# _LT_PATH_MANIFEST_TOOL +# ---------------------- +# locate the manifest tool +m4_defun([_LT_PATH_MANIFEST_TOOL], +[AC_CHECK_TOOL(MANIFEST_TOOL, mt, :) +test -z "$MANIFEST_TOOL" && MANIFEST_TOOL=mt +AC_CACHE_CHECK([if $MANIFEST_TOOL is a manifest tool], [lt_cv_path_mainfest_tool], + [lt_cv_path_mainfest_tool=no + echo "$as_me:$LINENO: $MANIFEST_TOOL '-?'" >&AS_MESSAGE_LOG_FD + $MANIFEST_TOOL '-?' 2>conftest.err > conftest.out + cat conftest.err >&AS_MESSAGE_LOG_FD + if $GREP 'Manifest Tool' conftest.out > /dev/null; then + lt_cv_path_mainfest_tool=yes + fi + rm -f conftest*]) +if test "x$lt_cv_path_mainfest_tool" != xyes; then + MANIFEST_TOOL=: +fi +_LT_DECL([], [MANIFEST_TOOL], [1], [Manifest tool])dnl +])# _LT_PATH_MANIFEST_TOOL + + +# LT_LIB_M +# -------- +# check for math library AC_DEFUN([LT_LIB_M], [AC_REQUIRE([AC_CANONICAL_HOST])dnl LIBM= case $host in -*-*-beos* | *-*-cygwin* | *-*-pw32* | *-*-darwin*) +*-*-beos* | *-*-cegcc* | *-*-cygwin* | *-*-haiku* | *-*-pw32* | *-*-darwin*) # These system don't have libm, or don't need it ;; *-ncr-sysv4.3*) @@ -3284,7 +3589,12 @@ _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)= if test "$GCC" = yes; then - _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin' + case $cc_basename in + nvcc*) + _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -Xcompiler -fno-builtin' ;; + *) + _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin' ;; + esac _LT_COMPILER_OPTION([if $compiler supports -fno-rtti -fno-exceptions], lt_cv_prog_compiler_rtti_exceptions, @@ -3301,6 +3611,7 @@ m4_defun([_LT_CMD_GLOBAL_SYMBOLS], [AC_REQUIRE([AC_CANONICAL_HOST])dnl AC_REQUIRE([AC_PROG_CC])dnl +AC_REQUIRE([AC_PROG_AWK])dnl AC_REQUIRE([LT_PATH_NM])dnl AC_REQUIRE([LT_PATH_LD])dnl m4_require([_LT_DECL_SED])dnl @@ -3368,8 +3679,8 @@ lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'" # Transform an extracted symbol line into symbol name and symbol address -lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([[^ ]]*\) $/ {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([[^ ]]*\) \([[^ ]]*\)$/ {\"\2\", (void *) \&\2},/p'" -lt_cv_sys_global_symbol_to_c_name_address_lib_prefix="sed -n -e 's/^: \([[^ ]]*\) $/ {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([[^ ]]*\) \(lib[[^ ]]*\)$/ {\"\2\", (void *) \&\2},/p' -e 's/^$symcode* \([[^ ]]*\) \([[^ ]]*\)$/ {\"lib\2\", (void *) \&\2},/p'" +lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([[^ ]]*\)[[ ]]*$/ {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([[^ ]]*\) \([[^ ]]*\)$/ {\"\2\", (void *) \&\2},/p'" +lt_cv_sys_global_symbol_to_c_name_address_lib_prefix="sed -n -e 's/^: \([[^ ]]*\)[[ ]]*$/ {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([[^ ]]*\) \(lib[[^ ]]*\)$/ {\"\2\", (void *) \&\2},/p' -e 's/^$symcode* \([[^ ]]*\) \([[^ ]]*\)$/ {\"lib\2\", (void *) \&\2},/p'" # Handle CRLF in mingw tool chain opt_cr= @@ -3393,6 +3704,7 @@ # which start with @ or ?. lt_cv_sys_global_symbol_pipe="$AWK ['"\ " {last_section=section; section=\$ 3};"\ +" /^COFF SYMBOL TABLE/{for(i in hide) delete hide[i]};"\ " /Section length .*#relocs.*(pick any)/{hide[last_section]=1};"\ " \$ 0!~/External *\|/{next};"\ " / 0+ UNDEF /{next}; / UNDEF \([^|]\)*()/{next};"\ @@ -3405,6 +3717,7 @@ else lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[[ ]]\($symcode$symcode*\)[[ ]][[ ]]*$ac_symprfx$sympat$opt_cr$/$symxfrm/p'" fi + lt_cv_sys_global_symbol_pipe="$lt_cv_sys_global_symbol_pipe | sed '/ __gnu_lto/d'" # Check to see that the pipe works correctly. pipe_works=no @@ -3426,7 +3739,7 @@ if AC_TRY_EVAL(ac_compile); then # Now try to grab the symbols. nlist=conftest.nm - if AC_TRY_EVAL(NM conftest.$ac_objext \| $lt_cv_sys_global_symbol_pipe \> $nlist) && test -s "$nlist"; then + if AC_TRY_EVAL(NM conftest.$ac_objext \| "$lt_cv_sys_global_symbol_pipe" \> $nlist) && test -s "$nlist"; then # Try sorting and uniquifying the output. if sort "$nlist" | uniq > "$nlist"T; then mv -f "$nlist"T "$nlist" @@ -3438,6 +3751,18 @@ if $GREP ' nm_test_var$' "$nlist" >/dev/null; then if $GREP ' nm_test_func$' "$nlist" >/dev/null; then cat <<_LT_EOF > conftest.$ac_ext +/* Keep this code in sync between libtool.m4, ltmain, lt_system.h, and tests. */ +#if defined(_WIN32) || defined(__CYGWIN__) || defined(_WIN32_WCE) +/* DATA imports from DLLs on WIN32 con't be const, because runtime + relocations are performed -- see ld's documentation on pseudo-relocs. */ +# define LT@&t@_DLSYM_CONST +#elif defined(__osf__) +/* This system does not cope well with relocations in const data. */ +# define LT@&t@_DLSYM_CONST +#else +# define LT@&t@_DLSYM_CONST const +#endif + #ifdef __cplusplus extern "C" { #endif @@ -3449,7 +3774,7 @@ cat <<_LT_EOF >> conftest.$ac_ext /* The mapping between symbol names and symbols. */ -const struct { +LT@&t@_DLSYM_CONST struct { const char *name; void *address; } @@ -3475,15 +3800,15 @@ _LT_EOF # Now try linking the two files. mv conftest.$ac_objext conftstm.$ac_objext - lt_save_LIBS="$LIBS" - lt_save_CFLAGS="$CFLAGS" + lt_globsym_save_LIBS=$LIBS + lt_globsym_save_CFLAGS=$CFLAGS LIBS="conftstm.$ac_objext" CFLAGS="$CFLAGS$_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)" if AC_TRY_EVAL(ac_link) && test -s conftest${ac_exeext}; then pipe_works=yes fi - LIBS="$lt_save_LIBS" - CFLAGS="$lt_save_CFLAGS" + LIBS=$lt_globsym_save_LIBS + CFLAGS=$lt_globsym_save_CFLAGS else echo "cannot find nm_test_func in $nlist" >&AS_MESSAGE_LOG_FD fi @@ -3516,6 +3841,13 @@ AC_MSG_RESULT(ok) fi +# Response file support. +if test "$lt_cv_nm_interface" = "MS dumpbin"; then + nm_file_list_spec='@' +elif $NM --help 2>/dev/null | grep '[[@]]FILE' >/dev/null; then + nm_file_list_spec='@' +fi + _LT_DECL([global_symbol_pipe], [lt_cv_sys_global_symbol_pipe], [1], [Take the output of nm and produce a listing of raw symbols and C names]) _LT_DECL([global_symbol_to_cdecl], [lt_cv_sys_global_symbol_to_cdecl], [1], @@ -3526,6 +3858,8 @@ _LT_DECL([global_symbol_to_c_name_address_lib_prefix], [lt_cv_sys_global_symbol_to_c_name_address_lib_prefix], [1], [Transform the output of nm in a C name address pair when lib prefix is needed]) +_LT_DECL([], [nm_file_list_spec], [1], + [Specify filename containing input files for $NM]) ]) # _LT_CMD_GLOBAL_SYMBOLS @@ -3537,7 +3871,6 @@ _LT_TAGVAR(lt_prog_compiler_pic, $1)= _LT_TAGVAR(lt_prog_compiler_static, $1)= -AC_MSG_CHECKING([for $compiler option to produce PIC]) m4_if([$1], [CXX], [ # C++ specific cases for pic, static, wl, etc. if test "$GXX" = yes; then @@ -3588,6 +3921,11 @@ # DJGPP does not support shared libraries at all _LT_TAGVAR(lt_prog_compiler_pic, $1)= ;; + haiku*) + # PIC is the default for Haiku. + # The "-static" flag exists, but is broken. + _LT_TAGVAR(lt_prog_compiler_static, $1)= + ;; interix[[3-9]]*) # Interix 3.x gcc -fpic/-fPIC options generate broken code. # Instead, we relocate shared libraries at runtime. @@ -3637,6 +3975,12 @@ ;; esac ;; + mingw* | cygwin* | os2* | pw32* | cegcc*) + # This hack is so that the source file can tell whether it is being + # built for inclusion in a dll (and should export symbols for example). + m4_if([$1], [GCJ], [], + [_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT']) + ;; dgux*) case $cc_basename in ec++*) @@ -3693,7 +4037,7 @@ ;; esac ;; - linux* | k*bsd*-gnu) + linux* | k*bsd*-gnu | kopensolaris*-gnu) case $cc_basename in KCC*) # KAI C++ Compiler @@ -3726,8 +4070,8 @@ _LT_TAGVAR(lt_prog_compiler_pic, $1)= _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' ;; - xlc* | xlC*) - # IBM XL 8.0 on PPC + xlc* | xlC* | bgxl[[cC]]* | mpixl[[cC]]*) + # IBM XL 8.0, 9.0 on PPC and BlueGene _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-qpic' _LT_TAGVAR(lt_prog_compiler_static, $1)='-qstaticlink' @@ -3789,7 +4133,7 @@ ;; solaris*) case $cc_basename in - CC*) + CC* | sunCC*) # Sun C++ 4.2, 5.x and Centerline C++ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' @@ -3893,6 +4237,12 @@ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common' ;; + haiku*) + # PIC is the default for Haiku. + # The "-static" flag exists, but is broken. + _LT_TAGVAR(lt_prog_compiler_static, $1)= + ;; + hpux*) # PIC is the default for 64-bit PA HP-UX, but not for 32-bit # PA HP-UX. On IA64 HP-UX, PIC is the default but the pic flag @@ -3935,6 +4285,15 @@ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' ;; esac + + case $cc_basename in + nvcc*) # Cuda Compiler Driver 2.2 + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Xlinker ' + if test -n "$_LT_TAGVAR(lt_prog_compiler_pic, $1)"; then + _LT_TAGVAR(lt_prog_compiler_pic, $1)="-Xcompiler $_LT_TAGVAR(lt_prog_compiler_pic, $1)" + fi + ;; + esac else # PORTME Check for flag to pass linker flags through the system compiler. case $host_os in @@ -3977,7 +4336,7 @@ _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' ;; - linux* | k*bsd*-gnu) + linux* | k*bsd*-gnu | kopensolaris*-gnu) case $cc_basename in # old Intel for x86_64 which still supported -KPIC. ecc*) @@ -3998,7 +4357,13 @@ _LT_TAGVAR(lt_prog_compiler_pic, $1)='--shared' _LT_TAGVAR(lt_prog_compiler_static, $1)='--static' ;; - pgcc* | pgf77* | pgf90* | pgf95*) + nagfor*) + # NAG Fortran compiler + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,-Wl,,' + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + ;; + pgcc* | pgf77* | pgf90* | pgf95* | pgfortran*) # Portland Group compilers (*not* the Pentium gcc compiler, # which looks to be a dead project) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' @@ -4010,25 +4375,40 @@ # All Alpha code is PIC. _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' ;; - xl*) - # IBM XL C 8.0/Fortran 10.1 on PPC + xl* | bgxl* | bgf* | mpixl*) + # IBM XL C 8.0/Fortran 10.1, 11.1 on PPC and BlueGene _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-qpic' _LT_TAGVAR(lt_prog_compiler_static, $1)='-qstaticlink' ;; *) case `$CC -V 2>&1 | sed 5q` in + *Sun\ Ceres\ Fortran* | *Sun*Fortran*\ [[1-7]].* | *Sun*Fortran*\ 8.[[0-3]]*) + # Sun Fortran 8.3 passes all unrecognized flags to the linker + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + _LT_TAGVAR(lt_prog_compiler_wl, $1)='' + ;; + *Sun\ F* | *Sun*Fortran*) + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ' + ;; *Sun\ C*) # Sun C 5.9 _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' ;; - *Sun\ F*) - # Sun Fortran 8.3 passes all unrecognized flags to the linker - _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' + *Intel*\ [[CF]]*Compiler*) + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' + ;; + *Portland\ Group*) + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fpic' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' - _LT_TAGVAR(lt_prog_compiler_wl, $1)='' ;; esac ;; @@ -4060,7 +4440,7 @@ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' case $cc_basename in - f77* | f90* | f95*) + f77* | f90* | f95* | sunf77* | sunf90* | sunf95*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ';; *) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,';; @@ -4117,9 +4497,11 @@ _LT_TAGVAR(lt_prog_compiler_pic, $1)="$_LT_TAGVAR(lt_prog_compiler_pic, $1)@&t@m4_if([$1],[],[ -DPIC],[m4_if([$1],[CXX],[ -DPIC],[])])" ;; esac -AC_MSG_RESULT([$_LT_TAGVAR(lt_prog_compiler_pic, $1)]) -_LT_TAGDECL([wl], [lt_prog_compiler_wl], [1], - [How to pass a linker flag through the compiler]) + +AC_CACHE_CHECK([for $compiler option to produce PIC], + [_LT_TAGVAR(lt_cv_prog_compiler_pic, $1)], + [_LT_TAGVAR(lt_cv_prog_compiler_pic, $1)=$_LT_TAGVAR(lt_prog_compiler_pic, $1)]) +_LT_TAGVAR(lt_prog_compiler_pic, $1)=$_LT_TAGVAR(lt_cv_prog_compiler_pic, $1) # # Check to make sure the PIC flag actually works. @@ -4138,6 +4520,8 @@ _LT_TAGDECL([pic_flag], [lt_prog_compiler_pic], [1], [Additional compiler flags for building library objects]) +_LT_TAGDECL([wl], [lt_prog_compiler_wl], [1], + [How to pass a linker flag through the compiler]) # # Check to make sure the static flag actually works. # @@ -4158,6 +4542,7 @@ m4_defun([_LT_LINKER_SHLIBS], [AC_REQUIRE([LT_PATH_LD])dnl AC_REQUIRE([LT_PATH_NM])dnl +m4_require([_LT_PATH_MANIFEST_TOOL])dnl m4_require([_LT_FILEUTILS_DEFAULTS])dnl m4_require([_LT_DECL_EGREP])dnl m4_require([_LT_DECL_SED])dnl @@ -4166,27 +4551,37 @@ AC_MSG_CHECKING([whether the $compiler linker ($LD) supports shared libraries]) m4_if([$1], [CXX], [ _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' + _LT_TAGVAR(exclude_expsyms, $1)=['_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*'] case $host_os in aix[[4-9]]*) # If we're using GNU nm, then we don't want the "-C" option. # -C means demangle to AIX nm, but means don't demangle with GNU nm + # Also, AIX nm treats weak defined symbols like other global defined + # symbols, whereas GNU nm marks them as "W". if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then - _LT_TAGVAR(export_symbols_cmds, $1)='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B")) && ([substr](\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols' + _LT_TAGVAR(export_symbols_cmds, $1)='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && ([substr](\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols' else _LT_TAGVAR(export_symbols_cmds, $1)='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B")) && ([substr](\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols' fi ;; pw32*) _LT_TAGVAR(export_symbols_cmds, $1)="$ltdll_cmds" - ;; + ;; cygwin* | mingw* | cegcc*) - _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]][[ ]]/s/.*[[ ]]\([[^ ]]*\)/\1 DATA/;/^.*[[ ]]__nm__/s/^.*[[ ]]__nm__\([[^ ]]*\)[[ ]][[^ ]]*/\1 DATA/;/^I[[ ]]/d;/^[[AITW]][[ ]]/s/.* //'\'' | sort | uniq > $export_symbols' - ;; + case $cc_basename in + cl*) + _LT_TAGVAR(exclude_expsyms, $1)='_NULL_IMPORT_DESCRIPTOR|_IMPORT_DESCRIPTOR_.*' + ;; + *) + _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]][[ ]]/s/.*[[ ]]\([[^ ]]*\)/\1 DATA/;s/^.*[[ ]]__nm__\([[^ ]]*\)[[ ]][[^ ]]*/\1 DATA/;/^I[[ ]]/d;/^[[AITW]][[ ]]/s/.* //'\'' | sort | uniq > $export_symbols' + _LT_TAGVAR(exclude_expsyms, $1)=['[_]+GLOBAL_OFFSET_TABLE_|[_]+GLOBAL__[FID]_.*|[_]+head_[A-Za-z0-9_]+_dll|[A-Za-z0-9_]+_dll_iname'] + ;; + esac + ;; *) _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' - ;; + ;; esac - _LT_TAGVAR(exclude_expsyms, $1)=['_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*'] ], [ runpath_var= _LT_TAGVAR(allow_undefined_flag, $1)= @@ -4201,7 +4596,6 @@ _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_direct_absolute, $1)=no _LT_TAGVAR(hardcode_libdir_flag_spec, $1)= - _LT_TAGVAR(hardcode_libdir_flag_spec_ld, $1)= _LT_TAGVAR(hardcode_libdir_separator, $1)= _LT_TAGVAR(hardcode_minus_L, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported @@ -4249,7 +4643,33 @@ esac _LT_TAGVAR(ld_shlibs, $1)=yes + + # On some targets, GNU ld is compatible enough with the native linker + # that we're better off using the native interface for both. + lt_use_gnu_ld_interface=no if test "$with_gnu_ld" = yes; then + case $host_os in + aix*) + # The AIX port of GNU ld has always aspired to compatibility + # with the native linker. However, as the warning in the GNU ld + # block says, versions before 2.19.5* couldn't really create working + # shared libraries, regardless of the interface used. + case `$LD -v 2>&1` in + *\ \(GNU\ Binutils\)\ 2.19.5*) ;; + *\ \(GNU\ Binutils\)\ 2.[[2-9]]*) ;; + *\ \(GNU\ Binutils\)\ [[3-9]]*) ;; + *) + lt_use_gnu_ld_interface=yes + ;; + esac + ;; + *) + lt_use_gnu_ld_interface=yes + ;; + esac + fi + + if test "$lt_use_gnu_ld_interface" = yes; then # If archive_cmds runs LD, not CC, wlarc should be empty wlarc='${wl}' @@ -4267,6 +4687,7 @@ fi supports_anon_versioning=no case `$LD -v 2>&1` in + *GNU\ gold*) supports_anon_versioning=yes ;; *\ [[01]].* | *\ 2.[[0-9]].* | *\ 2.10.*) ;; # catch versions < 2.11 *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ... *\ 2.11.92.0.12\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ... @@ -4282,11 +4703,12 @@ _LT_TAGVAR(ld_shlibs, $1)=no cat <<_LT_EOF 1>&2 -*** Warning: the GNU linker, at least up to release 2.9.1, is reported +*** Warning: the GNU linker, at least up to release 2.19, is reported *** to be unable to reliably create shared libraries on AIX. *** Therefore, libtool is disabling shared libraries support. If you -*** really care for shared libraries, you may want to modify your PATH -*** so that a non-GNU linker is found, and then restart. +*** really care for shared libraries, you may want to install binutils +*** 2.20 or above, or modify your PATH so that a non-GNU linker is found. +*** You will then need to restart the configuration process. _LT_EOF fi @@ -4322,10 +4744,12 @@ # _LT_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless, # as there is no search path for DLLs. _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' + _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-all-symbols' _LT_TAGVAR(allow_undefined_flag, $1)=unsupported _LT_TAGVAR(always_export_symbols, $1)=no _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes - _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]][[ ]]/s/.*[[ ]]\([[^ ]]*\)/\1 DATA/'\'' | $SED -e '\''/^[[AITW]][[ ]]/s/.*[[ ]]//'\'' | sort | uniq > $export_symbols' + _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]][[ ]]/s/.*[[ ]]\([[^ ]]*\)/\1 DATA/;s/^.*[[ ]]__nm__\([[^ ]]*\)[[ ]][[^ ]]*/\1 DATA/;/^I[[ ]]/d;/^[[AITW]][[ ]]/s/.* //'\'' | sort | uniq > $export_symbols' + _LT_TAGVAR(exclude_expsyms, $1)=['[_]+GLOBAL_OFFSET_TABLE_|[_]+GLOBAL__[FID]_.*|[_]+head_[A-Za-z0-9_]+_dll|[A-Za-z0-9_]+_dll_iname'] if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' @@ -4343,6 +4767,11 @@ fi ;; + haiku*) + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + _LT_TAGVAR(link_all_deplibs, $1)=yes + ;; + interix[[3-9]]*) _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=no @@ -4358,7 +4787,7 @@ _LT_TAGVAR(archive_expsym_cmds, $1)='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' ;; - gnu* | linux* | tpf* | k*bsd*-gnu) + gnu* | linux* | tpf* | k*bsd*-gnu | kopensolaris*-gnu) tmp_diet=no if test "$host_os" = linux-dietlibc; then case $cc_basename in @@ -4368,15 +4797,16 @@ if $LD --help 2>&1 | $EGREP ': supported targets:.* elf' > /dev/null \ && test "$tmp_diet" = no then - tmp_addflag= + tmp_addflag=' $pic_flag' tmp_sharedflag='-shared' case $cc_basename,$host_cpu in pgcc*) # Portland Group C compiler - _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $ECHO \"$new_convenience\"` ${wl}--no-whole-archive' + _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' tmp_addflag=' $pic_flag' ;; - pgf77* | pgf90* | pgf95*) # Portland Group f77 and f90 compilers - _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $ECHO \"$new_convenience\"` ${wl}--no-whole-archive' + pgf77* | pgf90* | pgf95* | pgfortran*) + # Portland Group f77 and f90 compilers + _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' tmp_addflag=' $pic_flag -Mnomain' ;; ecc*,ia64* | icc*,ia64*) # Intel C compiler on ia64 tmp_addflag=' -i_dynamic' ;; @@ -4387,13 +4817,17 @@ lf95*) # Lahey Fortran 8.1 _LT_TAGVAR(whole_archive_flag_spec, $1)= tmp_sharedflag='--shared' ;; - xl[[cC]]*) # IBM XL C 8.0 on PPC (deal with xlf below) + xl[[cC]]* | bgxl[[cC]]* | mpixl[[cC]]*) # IBM XL C 8.0 on PPC (deal with xlf below) tmp_sharedflag='-qmkshrobj' tmp_addflag= ;; + nvcc*) # Cuda Compiler Driver 2.2 + _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' + _LT_TAGVAR(compiler_needs_object, $1)=yes + ;; esac case `$CC -V 2>&1 | sed 5q` in *Sun\ C*) # Sun C 5.9 - _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; $ECHO \"$new_convenience\"` ${wl}--no-whole-archive' + _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' _LT_TAGVAR(compiler_needs_object, $1)=yes tmp_sharedflag='-G' ;; *Sun\ F*) # Sun Fortran 8.3 @@ -4409,17 +4843,16 @@ fi case $cc_basename in - xlf*) + xlf* | bgf* | bgxlf* | mpixlf*) # IBM XL Fortran 10.1 on PPC cannot create shared libs itself _LT_TAGVAR(whole_archive_flag_spec, $1)='--whole-archive$convenience --no-whole-archive' - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)= - _LT_TAGVAR(hardcode_libdir_flag_spec_ld, $1)='-rpath $libdir' - _LT_TAGVAR(archive_cmds, $1)='$LD -shared $libobjs $deplibs $compiler_flags -soname $soname -o $lib' + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' + _LT_TAGVAR(archive_cmds, $1)='$LD -shared $libobjs $deplibs $linker_flags -soname $soname -o $lib' if test "x$supports_anon_versioning" = xyes; then _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~ cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ echo "local: *; };" >> $output_objdir/$libname.ver~ - $LD -shared $libobjs $deplibs $compiler_flags -soname $soname -version-script $output_objdir/$libname.ver -o $lib' + $LD -shared $libobjs $deplibs $linker_flags -soname $soname -version-script $output_objdir/$libname.ver -o $lib' fi ;; esac @@ -4433,8 +4866,8 @@ _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib' wlarc= else - _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' - _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' fi ;; @@ -4452,8 +4885,8 @@ _LT_EOF elif $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then - _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' - _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' else _LT_TAGVAR(ld_shlibs, $1)=no fi @@ -4499,8 +4932,8 @@ *) if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then - _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' - _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' else _LT_TAGVAR(ld_shlibs, $1)=no fi @@ -4540,8 +4973,10 @@ else # If we're using GNU nm, then we don't want the "-C" option. # -C means demangle to AIX nm, but means don't demangle with GNU nm + # Also, AIX nm treats weak defined symbols like other global + # defined symbols, whereas GNU nm marks them as "W". if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then - _LT_TAGVAR(export_symbols_cmds, $1)='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B")) && ([substr](\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols' + _LT_TAGVAR(export_symbols_cmds, $1)='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && ([substr](\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols' else _LT_TAGVAR(export_symbols_cmds, $1)='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B")) && ([substr](\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols' fi @@ -4628,9 +5063,9 @@ _LT_TAGVAR(allow_undefined_flag, $1)='-berok' # Determine the default libpath from the value encoded in an # empty executable. - _LT_SYS_MODULE_PATH_AIX + _LT_SYS_MODULE_PATH_AIX([$1]) _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath" - _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then $ECHO "X${wl}${allow_undefined_flag}" | $Xsed; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag" + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then func_echo_all "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag" else if test "$host_cpu" = ia64; then _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $libdir:/usr/lib:/lib' @@ -4639,14 +5074,19 @@ else # Determine the default libpath from the value encoded in an # empty executable. - _LT_SYS_MODULE_PATH_AIX + _LT_SYS_MODULE_PATH_AIX([$1]) _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath" # Warning - without using the other run time loading flags, # -berok will link without error, but may produce a broken library. _LT_TAGVAR(no_undefined_flag, $1)=' ${wl}-bernotok' _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-berok' - # Exported symbols can be pulled into shared objects from archives - _LT_TAGVAR(whole_archive_flag_spec, $1)='$convenience' + if test "$with_gnu_ld" = yes; then + # We only use this code for GNU lds that support --whole-archive. + _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive$convenience ${wl}--no-whole-archive' + else + # Exported symbols can be pulled into shared objects from archives + _LT_TAGVAR(whole_archive_flag_spec, $1)='$convenience' + fi _LT_TAGVAR(archive_cmds_need_lc, $1)=yes # This is similar to how AIX traditionally builds its shared libraries. _LT_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname' @@ -4678,20 +5118,64 @@ # Microsoft Visual C++. # hardcode_libdir_flag_spec is actually meaningless, as there is # no search path for DLLs. - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' ' - _LT_TAGVAR(allow_undefined_flag, $1)=unsupported - # Tell ltmain to make .lib files, not .a files. - libext=lib - # Tell ltmain to make .dll files, not .so files. - shrext_cmds=".dll" - # FIXME: Setting linknames here is a bad hack. - _LT_TAGVAR(archive_cmds, $1)='$CC -o $lib $libobjs $compiler_flags `$ECHO "X$deplibs" | $Xsed -e '\''s/ -lc$//'\''` -link -dll~linknames=' - # The linker will automatically build a .lib file if we build a DLL. - _LT_TAGVAR(old_archive_from_new_cmds, $1)='true' - # FIXME: Should let the user specify the lib program. - _LT_TAGVAR(old_archive_cmds, $1)='lib -OUT:$oldlib$oldobjs$old_deplibs' - _LT_TAGVAR(fix_srcfile_path, $1)='`cygpath -w "$srcfile"`' - _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes + case $cc_basename in + cl*) + # Native MSVC + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' ' + _LT_TAGVAR(allow_undefined_flag, $1)=unsupported + _LT_TAGVAR(always_export_symbols, $1)=yes + _LT_TAGVAR(file_list_spec, $1)='@' + # Tell ltmain to make .lib files, not .a files. + libext=lib + # Tell ltmain to make .dll files, not .so files. + shrext_cmds=".dll" + # FIXME: Setting linknames here is a bad hack. + _LT_TAGVAR(archive_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-dll~linknames=' + _LT_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then + sed -n -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' -e '1\\\!p' < $export_symbols > $output_objdir/$soname.exp; + else + sed -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' < $export_symbols > $output_objdir/$soname.exp; + fi~ + $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~ + linknames=' + # The linker will not automatically build a static lib if we build a DLL. + # _LT_TAGVAR(old_archive_from_new_cmds, $1)='true' + _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes + _LT_TAGVAR(exclude_expsyms, $1)='_NULL_IMPORT_DESCRIPTOR|_IMPORT_DESCRIPTOR_.*' + _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]][[ ]]/s/.*[[ ]]\([[^ ]]*\)/\1,DATA/'\'' | $SED -e '\''/^[[AITW]][[ ]]/s/.*[[ ]]//'\'' | sort | uniq > $export_symbols' + # Don't use ranlib + _LT_TAGVAR(old_postinstall_cmds, $1)='chmod 644 $oldlib' + _LT_TAGVAR(postlink_cmds, $1)='lt_outputfile="@OUTPUT@"~ + lt_tool_outputfile="@TOOL_OUTPUT@"~ + case $lt_outputfile in + *.exe|*.EXE) ;; + *) + lt_outputfile="$lt_outputfile.exe" + lt_tool_outputfile="$lt_tool_outputfile.exe" + ;; + esac~ + if test "$MANIFEST_TOOL" != ":" && test -f "$lt_outputfile.manifest"; then + $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1; + $RM "$lt_outputfile.manifest"; + fi' + ;; + *) + # Assume MSVC wrapper + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' ' + _LT_TAGVAR(allow_undefined_flag, $1)=unsupported + # Tell ltmain to make .lib files, not .a files. + libext=lib + # Tell ltmain to make .dll files, not .so files. + shrext_cmds=".dll" + # FIXME: Setting linknames here is a bad hack. + _LT_TAGVAR(archive_cmds, $1)='$CC -o $lib $libobjs $compiler_flags `func_echo_all "$deplibs" | $SED '\''s/ -lc$//'\''` -link -dll~linknames=' + # The linker will automatically build a .lib file if we build a DLL. + _LT_TAGVAR(old_archive_from_new_cmds, $1)='true' + # FIXME: Should let the user specify the lib program. + _LT_TAGVAR(old_archive_cmds, $1)='lib -OUT:$oldlib$oldobjs$old_deplibs' + _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes + ;; + esac ;; darwin* | rhapsody*) @@ -4704,10 +5188,6 @@ _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; - freebsd1*) - _LT_TAGVAR(ld_shlibs, $1)=no - ;; - # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor # support. Future versions do this automatically, but an explicit c++rt0.o # does not break anything, and helps significantly (at the cost of a little @@ -4720,7 +5200,7 @@ ;; # Unfortunately, older versions of FreeBSD 2 do not have this feature. - freebsd2*) + freebsd2.*) _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_minus_L, $1)=yes @@ -4729,7 +5209,7 @@ # FreeBSD 3 and greater uses gcc -shared to do shared libraries. freebsd* | dragonfly*) - _LT_TAGVAR(archive_cmds, $1)='$CC -shared -o $lib $libobjs $deplibs $compiler_flags' + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_shlibpath_var, $1)=no @@ -4737,7 +5217,7 @@ hpux9*) if test "$GCC" = yes; then - _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$CC -shared -fPIC ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' + _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$CC -shared $pic_flag ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' else _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' fi @@ -4752,14 +5232,13 @@ ;; hpux10*) - if test "$GCC" = yes -a "$with_gnu_ld" = no; then - _LT_TAGVAR(archive_cmds, $1)='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' + if test "$GCC" = yes && test "$with_gnu_ld" = no; then + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' else _LT_TAGVAR(archive_cmds, $1)='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags' fi if test "$with_gnu_ld" = no; then _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' - _LT_TAGVAR(hardcode_libdir_flag_spec_ld, $1)='+b $libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_direct_absolute, $1)=yes @@ -4771,16 +5250,16 @@ ;; hpux11*) - if test "$GCC" = yes -a "$with_gnu_ld" = no; then + if test "$GCC" = yes && test "$with_gnu_ld" = no; then case $host_cpu in hppa*64*) _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' ;; ia64*) - _LT_TAGVAR(archive_cmds, $1)='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' ;; *) - _LT_TAGVAR(archive_cmds, $1)='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' ;; esac else @@ -4792,7 +5271,14 @@ _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' ;; *) - _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' + m4_if($1, [], [ + # Older versions of the 11.00 compiler do not understand -b yet + # (HP92453-01 A.11.01.20 doesn't, HP92453-01 B.11.X.35175-35176.GP does) + _LT_LINKER_OPTION([if $CC understands -b], + _LT_TAGVAR(lt_cv_prog_compiler__b, $1), [-b], + [_LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'], + [_LT_TAGVAR(archive_cmds, $1)='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags'])], + [_LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags']) ;; esac fi @@ -4820,19 +5306,34 @@ irix5* | irix6* | nonstopux*) if test "$GCC" = yes; then - _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "X${wl}-set_version ${wl}$verstring" | $Xsed` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' # Try to use the -exported_symbol ld option, if it does not # work, assume that -exports_file does not work either and # implicitly export all symbols. - save_LDFLAGS="$LDFLAGS" - LDFLAGS="$LDFLAGS -shared ${wl}-exported_symbol ${wl}foo ${wl}-update_registry ${wl}/dev/null" - AC_LINK_IFELSE(int foo(void) {}, - _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "X${wl}-set_version ${wl}$verstring" | $Xsed` ${wl}-update_registry ${wl}${output_objdir}/so_locations ${wl}-exports_file ${wl}$export_symbols -o $lib' - ) - LDFLAGS="$save_LDFLAGS" + # This should be the same for all languages, so no per-tag cache variable. + AC_CACHE_CHECK([whether the $host_os linker accepts -exported_symbol], + [lt_cv_irix_exported_symbol], + [save_LDFLAGS="$LDFLAGS" + LDFLAGS="$LDFLAGS -shared ${wl}-exported_symbol ${wl}foo ${wl}-update_registry ${wl}/dev/null" + AC_LINK_IFELSE( + [AC_LANG_SOURCE( + [AC_LANG_CASE([C], [[int foo (void) { return 0; }]], + [C++], [[int foo (void) { return 0; }]], + [Fortran 77], [[ + subroutine foo + end]], + [Fortran], [[ + subroutine foo + end]])])], + [lt_cv_irix_exported_symbol=yes], + [lt_cv_irix_exported_symbol=no]) + LDFLAGS="$save_LDFLAGS"]) + if test "$lt_cv_irix_exported_symbol" = yes; then + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations ${wl}-exports_file ${wl}$export_symbols -o $lib' + fi else - _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -o $lib' - _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -exports_file $export_symbols -o $lib' + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -exports_file $export_symbols -o $lib' fi _LT_TAGVAR(archive_cmds_need_lc, $1)='no' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' @@ -4894,17 +5395,17 @@ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(hardcode_minus_L, $1)=yes _LT_TAGVAR(allow_undefined_flag, $1)=unsupported - _LT_TAGVAR(archive_cmds, $1)='$ECHO "LIBRARY $libname INITINSTANCE" > $output_objdir/$libname.def~$ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~$ECHO DATA >> $output_objdir/$libname.def~$ECHO " SINGLE NONSHARED" >> $output_objdir/$libname.def~$ECHO EXPORTS >> $output_objdir/$libname.def~emxexp $libobjs >> $output_objdir/$libname.def~$CC -Zdll -Zcrtdll -o $lib $libobjs $deplibs $compiler_flags $output_objdir/$libname.def' + _LT_TAGVAR(archive_cmds, $1)='$ECHO "LIBRARY $libname INITINSTANCE" > $output_objdir/$libname.def~$ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~echo DATA >> $output_objdir/$libname.def~echo " SINGLE NONSHARED" >> $output_objdir/$libname.def~echo EXPORTS >> $output_objdir/$libname.def~emxexp $libobjs >> $output_objdir/$libname.def~$CC -Zdll -Zcrtdll -o $lib $libobjs $deplibs $compiler_flags $output_objdir/$libname.def' _LT_TAGVAR(old_archive_from_new_cmds, $1)='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def' ;; osf3*) if test "$GCC" = yes; then _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*' - _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "X${wl}-set_version ${wl}$verstring" | $Xsed` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' + _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' else _LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*' - _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -o $lib' + _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' fi _LT_TAGVAR(archive_cmds_need_lc, $1)='no' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' @@ -4914,13 +5415,13 @@ osf4* | osf5*) # as osf3* with the addition of -msym flag if test "$GCC" = yes; then _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*' - _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "X${wl}-set_version ${wl}$verstring" | $Xsed` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' + _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $pic_flag $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' else _LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*' - _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags -msym -soname $soname `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -o $lib' + _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags -msym -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done; printf "%s\\n" "-hidden">> $lib.exp~ - $CC -shared${allow_undefined_flag} ${wl}-input ${wl}$lib.exp $compiler_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -o $lib~$RM $lib.exp' + $CC -shared${allow_undefined_flag} ${wl}-input ${wl}$lib.exp $compiler_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && $ECHO "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib~$RM $lib.exp' # Both c and cxx compiler support -rpath directly _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir' @@ -4933,9 +5434,9 @@ _LT_TAGVAR(no_undefined_flag, $1)=' -z defs' if test "$GCC" = yes; then wlarc='${wl}' - _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-z ${wl}text ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag ${wl}-z ${wl}text ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ - $CC -shared ${wl}-z ${wl}text ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp' + $CC -shared $pic_flag ${wl}-z ${wl}text ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp' else case `$CC -V 2>&1` in *"Compilers 5.0"*) @@ -5111,36 +5612,38 @@ # Test whether the compiler implicitly links with -lc since on some # systems, -lgcc has to come before -lc. If gcc already passes -lc # to ld, don't add -lc before -lgcc. - AC_MSG_CHECKING([whether -lc should be explicitly linked in]) - $RM conftest* - echo "$lt_simple_compile_test_code" > conftest.$ac_ext - - if AC_TRY_EVAL(ac_compile) 2>conftest.err; then - soname=conftest - lib=conftest - libobjs=conftest.$ac_objext - deplibs= - wl=$_LT_TAGVAR(lt_prog_compiler_wl, $1) - pic_flag=$_LT_TAGVAR(lt_prog_compiler_pic, $1) - compiler_flags=-v - linker_flags=-v - verstring= - output_objdir=. - libname=conftest - lt_save_allow_undefined_flag=$_LT_TAGVAR(allow_undefined_flag, $1) - _LT_TAGVAR(allow_undefined_flag, $1)= - if AC_TRY_EVAL(_LT_TAGVAR(archive_cmds, $1) 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1) - then - _LT_TAGVAR(archive_cmds_need_lc, $1)=no - else - _LT_TAGVAR(archive_cmds_need_lc, $1)=yes - fi - _LT_TAGVAR(allow_undefined_flag, $1)=$lt_save_allow_undefined_flag - else - cat conftest.err 1>&5 - fi - $RM conftest* - AC_MSG_RESULT([$_LT_TAGVAR(archive_cmds_need_lc, $1)]) + AC_CACHE_CHECK([whether -lc should be explicitly linked in], + [lt_cv_]_LT_TAGVAR(archive_cmds_need_lc, $1), + [$RM conftest* + echo "$lt_simple_compile_test_code" > conftest.$ac_ext + + if AC_TRY_EVAL(ac_compile) 2>conftest.err; then + soname=conftest + lib=conftest + libobjs=conftest.$ac_objext + deplibs= + wl=$_LT_TAGVAR(lt_prog_compiler_wl, $1) + pic_flag=$_LT_TAGVAR(lt_prog_compiler_pic, $1) + compiler_flags=-v + linker_flags=-v + verstring= + output_objdir=. + libname=conftest + lt_save_allow_undefined_flag=$_LT_TAGVAR(allow_undefined_flag, $1) + _LT_TAGVAR(allow_undefined_flag, $1)= + if AC_TRY_EVAL(_LT_TAGVAR(archive_cmds, $1) 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1) + then + lt_cv_[]_LT_TAGVAR(archive_cmds_need_lc, $1)=no + else + lt_cv_[]_LT_TAGVAR(archive_cmds_need_lc, $1)=yes + fi + _LT_TAGVAR(allow_undefined_flag, $1)=$lt_save_allow_undefined_flag + else + cat conftest.err 1>&5 + fi + $RM conftest* + ]) + _LT_TAGVAR(archive_cmds_need_lc, $1)=$lt_cv_[]_LT_TAGVAR(archive_cmds_need_lc, $1) ;; esac fi @@ -5177,9 +5680,6 @@ _LT_TAGDECL([], [hardcode_libdir_flag_spec], [1], [Flag to hardcode $libdir into a binary during linking. This must work even if $libdir does not exist]) -_LT_TAGDECL([], [hardcode_libdir_flag_spec_ld], [1], - [[If ld is used when linking, flag to hardcode $libdir into a binary - during linking. This must work even if $libdir does not exist]]) _LT_TAGDECL([], [hardcode_libdir_separator], [1], [Whether we need a single "-rpath" flag with a separated argument]) _LT_TAGDECL([], [hardcode_direct], [0], @@ -5205,8 +5705,6 @@ to runtime path list]) _LT_TAGDECL([], [link_all_deplibs], [0], [Whether libtool must link a program against all its dependency libraries]) -_LT_TAGDECL([], [fix_srcfile_path], [1], - [Fix the shell variable $srcfile for the compiler]) _LT_TAGDECL([], [always_export_symbols], [0], [Set to "yes" if exported symbols are required]) _LT_TAGDECL([], [export_symbols_cmds], [2], @@ -5217,6 +5715,8 @@ [Symbols that must always be exported]) _LT_TAGDECL([], [prelink_cmds], [2], [Commands necessary for linking programs (against libraries) with templates]) +_LT_TAGDECL([], [postlink_cmds], [2], + [Commands necessary for finishing linking programs]) _LT_TAGDECL([], [file_list_spec], [1], [Specify filename containing input files]) dnl FIXME: Not yet implemented @@ -5310,37 +5810,22 @@ ])# _LT_LANG_C_CONFIG -# _LT_PROG_CXX -# ------------ -# Since AC_PROG_CXX is broken, in that it returns g++ if there is no c++ -# compiler, we have our own version here. -m4_defun([_LT_PROG_CXX], -[ -pushdef([AC_MSG_ERROR], [_lt_caught_CXX_error=yes]) -AC_PROG_CXX -if test -n "$CXX" && ( test "X$CXX" != "Xno" && - ( (test "X$CXX" = "Xg++" && `g++ -v >/dev/null 2>&1` ) || - (test "X$CXX" != "Xg++"))) ; then - AC_PROG_CXXCPP -else - _lt_caught_CXX_error=yes -fi -popdef([AC_MSG_ERROR]) -])# _LT_PROG_CXX - -dnl aclocal-1.4 backwards compatibility: -dnl AC_DEFUN([_LT_PROG_CXX], []) - - # _LT_LANG_CXX_CONFIG([TAG]) # -------------------------- # Ensure that the configuration variables for a C++ compiler are suitably # defined. These variables are subsequently used by _LT_CONFIG to write # the compiler configuration to `libtool'. m4_defun([_LT_LANG_CXX_CONFIG], -[AC_REQUIRE([_LT_PROG_CXX])dnl -m4_require([_LT_FILEUTILS_DEFAULTS])dnl +[m4_require([_LT_FILEUTILS_DEFAULTS])dnl m4_require([_LT_DECL_EGREP])dnl +m4_require([_LT_PATH_MANIFEST_TOOL])dnl +if test -n "$CXX" && ( test "X$CXX" != "Xno" && + ( (test "X$CXX" = "Xg++" && `g++ -v >/dev/null 2>&1` ) || + (test "X$CXX" != "Xg++"))) ; then + AC_PROG_CXXCPP +else + _lt_caught_CXX_error=yes +fi AC_LANG_PUSH(C++) _LT_TAGVAR(archive_cmds_need_lc, $1)=no @@ -5352,7 +5837,6 @@ _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_direct_absolute, $1)=no _LT_TAGVAR(hardcode_libdir_flag_spec, $1)= -_LT_TAGVAR(hardcode_libdir_flag_spec_ld, $1)= _LT_TAGVAR(hardcode_libdir_separator, $1)= _LT_TAGVAR(hardcode_minus_L, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported @@ -5362,6 +5846,8 @@ _LT_TAGVAR(module_expsym_cmds, $1)= _LT_TAGVAR(link_all_deplibs, $1)=unknown _LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds +_LT_TAGVAR(reload_flag, $1)=$reload_flag +_LT_TAGVAR(reload_cmds, $1)=$reload_cmds _LT_TAGVAR(no_undefined_flag, $1)= _LT_TAGVAR(whole_archive_flag_spec, $1)= _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no @@ -5393,6 +5879,7 @@ # Allow CC to be a program name with arguments. lt_save_CC=$CC + lt_save_CFLAGS=$CFLAGS lt_save_LD=$LD lt_save_GCC=$GCC GCC=$GXX @@ -5410,6 +5897,7 @@ fi test -z "${LDCXX+set}" || LD=$LDCXX CC=${CXX-"c++"} + CFLAGS=$CXXFLAGS compiler=$CC _LT_TAGVAR(compiler, $1)=$CC _LT_CC_BASENAME([$compiler]) @@ -5431,8 +5919,8 @@ # Check if GNU C++ uses GNU ld as the underlying linker, since the # archiving commands below assume that GNU ld is being used. if test "$with_gnu_ld" = yes; then - _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib' - _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' + _LT_TAGVAR(archive_cmds, $1)='$CC $pic_flag -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib' + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC $pic_flag -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' @@ -5464,7 +5952,7 @@ # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. - output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "\-L"' + output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"' else GXX=no @@ -5573,10 +6061,10 @@ _LT_TAGVAR(allow_undefined_flag, $1)='-berok' # Determine the default libpath from the value encoded in an empty # executable. - _LT_SYS_MODULE_PATH_AIX + _LT_SYS_MODULE_PATH_AIX([$1]) _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath" - _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then $ECHO "X${wl}${allow_undefined_flag}" | $Xsed; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag" + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then func_echo_all "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag" else if test "$host_cpu" = ia64; then _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $libdir:/usr/lib:/lib' @@ -5585,14 +6073,19 @@ else # Determine the default libpath from the value encoded in an # empty executable. - _LT_SYS_MODULE_PATH_AIX + _LT_SYS_MODULE_PATH_AIX([$1]) _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath" # Warning - without using the other run time loading flags, # -berok will link without error, but may produce a broken library. _LT_TAGVAR(no_undefined_flag, $1)=' ${wl}-bernotok' _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-berok' - # Exported symbols can be pulled into shared objects from archives - _LT_TAGVAR(whole_archive_flag_spec, $1)='$convenience' + if test "$with_gnu_ld" = yes; then + # We only use this code for GNU lds that support --whole-archive. + _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive$convenience ${wl}--no-whole-archive' + else + # Exported symbols can be pulled into shared objects from archives + _LT_TAGVAR(whole_archive_flag_spec, $1)='$convenience' + fi _LT_TAGVAR(archive_cmds_need_lc, $1)=yes # This is similar to how AIX traditionally builds its shared # libraries. @@ -5622,28 +6115,75 @@ ;; cygwin* | mingw* | pw32* | cegcc*) - # _LT_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless, - # as there is no search path for DLLs. - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' - _LT_TAGVAR(allow_undefined_flag, $1)=unsupported - _LT_TAGVAR(always_export_symbols, $1)=no - _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes - - if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then - _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' - # If the export-symbols file already is a .def file (1st line - # is EXPORTS), use it as is; otherwise, prepend... - _LT_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then - cp $export_symbols $output_objdir/$soname.def; - else - echo EXPORTS > $output_objdir/$soname.def; - cat $export_symbols >> $output_objdir/$soname.def; - fi~ - $CC -shared -nostdlib $output_objdir/$soname.def $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' - else - _LT_TAGVAR(ld_shlibs, $1)=no - fi - ;; + case $GXX,$cc_basename in + ,cl* | no,cl*) + # Native MSVC + # hardcode_libdir_flag_spec is actually meaningless, as there is + # no search path for DLLs. + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' ' + _LT_TAGVAR(allow_undefined_flag, $1)=unsupported + _LT_TAGVAR(always_export_symbols, $1)=yes + _LT_TAGVAR(file_list_spec, $1)='@' + # Tell ltmain to make .lib files, not .a files. + libext=lib + # Tell ltmain to make .dll files, not .so files. + shrext_cmds=".dll" + # FIXME: Setting linknames here is a bad hack. + _LT_TAGVAR(archive_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-dll~linknames=' + _LT_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then + $SED -n -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' -e '1\\\!p' < $export_symbols > $output_objdir/$soname.exp; + else + $SED -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' < $export_symbols > $output_objdir/$soname.exp; + fi~ + $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~ + linknames=' + # The linker will not automatically build a static lib if we build a DLL. + # _LT_TAGVAR(old_archive_from_new_cmds, $1)='true' + _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes + # Don't use ranlib + _LT_TAGVAR(old_postinstall_cmds, $1)='chmod 644 $oldlib' + _LT_TAGVAR(postlink_cmds, $1)='lt_outputfile="@OUTPUT@"~ + lt_tool_outputfile="@TOOL_OUTPUT@"~ + case $lt_outputfile in + *.exe|*.EXE) ;; + *) + lt_outputfile="$lt_outputfile.exe" + lt_tool_outputfile="$lt_tool_outputfile.exe" + ;; + esac~ + func_to_tool_file "$lt_outputfile"~ + if test "$MANIFEST_TOOL" != ":" && test -f "$lt_outputfile.manifest"; then + $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1; + $RM "$lt_outputfile.manifest"; + fi' + ;; + *) + # g++ + # _LT_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless, + # as there is no search path for DLLs. + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' + _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-all-symbols' + _LT_TAGVAR(allow_undefined_flag, $1)=unsupported + _LT_TAGVAR(always_export_symbols, $1)=no + _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes + + if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then + _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' + # If the export-symbols file already is a .def file (1st line + # is EXPORTS), use it as is; otherwise, prepend... + _LT_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then + cp $export_symbols $output_objdir/$soname.def; + else + echo EXPORTS > $output_objdir/$soname.def; + cat $export_symbols >> $output_objdir/$soname.def; + fi~ + $CC -shared -nostdlib $output_objdir/$soname.def $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' + else + _LT_TAGVAR(ld_shlibs, $1)=no + fi + ;; + esac + ;; darwin* | rhapsody*) _LT_DARWIN_LINKER_FEATURES($1) ;; @@ -5666,7 +6206,7 @@ esac ;; - freebsd[[12]]*) + freebsd2.*) # C++ shared libraries reported to be fairly broken before # switch to ELF _LT_TAGVAR(ld_shlibs, $1)=no @@ -5685,6 +6225,11 @@ gnu*) ;; + haiku*) + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + _LT_TAGVAR(link_all_deplibs, $1)=yes + ;; + hpux9*) _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: @@ -5709,11 +6254,11 @@ # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. - output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | $EGREP "\-L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; $ECHO "X$list" | $Xsed' + output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | $EGREP "\-L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"' ;; *) if test "$GXX" = yes; then - _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$CC -shared -nostdlib -fPIC ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' + _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$CC -shared -nostdlib $pic_flag ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' else # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no @@ -5774,7 +6319,7 @@ # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. - output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | $GREP "\-L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; $ECHO "X$list" | $Xsed' + output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | $GREP "\-L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"' ;; *) if test "$GXX" = yes; then @@ -5784,10 +6329,10 @@ _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; ia64*) - _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' + _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $pic_flag ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; *) - _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' + _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $pic_flag ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; esac fi @@ -5817,7 +6362,7 @@ case $cc_basename in CC*) # SGI C++ - _LT_TAGVAR(archive_cmds, $1)='$CC -shared -all -multigot $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -soname $soname `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -o $lib' + _LT_TAGVAR(archive_cmds, $1)='$CC -shared -all -multigot $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' # Archives containing C++ object files must be created using # "CC -ar", where "CC" is the IRIX C++ compiler. This is @@ -5828,9 +6373,9 @@ *) if test "$GXX" = yes; then if test "$with_gnu_ld" = no; then - _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "X${wl}-set_version ${wl}$verstring" | $Xsed` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' else - _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "X${wl}-set_version ${wl}$verstring" | $Xsed` -o $lib' + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` -o $lib' fi fi _LT_TAGVAR(link_all_deplibs, $1)=yes @@ -5841,7 +6386,7 @@ _LT_TAGVAR(inherit_rpath, $1)=yes ;; - linux* | k*bsd*-gnu) + linux* | k*bsd*-gnu | kopensolaris*-gnu) case $cc_basename in KCC*) # Kuck and Associates, Inc. (KAI) C++ Compiler @@ -5859,7 +6404,7 @@ # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. - output_verbose_link_cmd='templist=`$CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1 | $GREP "ld"`; rm -f libconftest$shared_ext; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; $ECHO "X$list" | $Xsed' + output_verbose_link_cmd='templist=`$CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1 | $GREP "ld"`; rm -f libconftest$shared_ext; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' @@ -5896,26 +6441,26 @@ pgCC* | pgcpp*) # Portland Group C++ compiler case `$CC -V` in - *pgCC\ [[1-5]]* | *pgcpp\ [[1-5]]*) + *pgCC\ [[1-5]].* | *pgcpp\ [[1-5]].*) _LT_TAGVAR(prelink_cmds, $1)='tpldir=Template.dir~ rm -rf $tpldir~ $CC --prelink_objects --instantiation_dir $tpldir $objs $libobjs $compile_deplibs~ - compile_command="$compile_command `find $tpldir -name \*.o | $NL2SP`"' + compile_command="$compile_command `find $tpldir -name \*.o | sort | $NL2SP`"' _LT_TAGVAR(old_archive_cmds, $1)='tpldir=Template.dir~ rm -rf $tpldir~ $CC --prelink_objects --instantiation_dir $tpldir $oldobjs$old_deplibs~ - $AR $AR_FLAGS $oldlib$oldobjs$old_deplibs `find $tpldir -name \*.o | $NL2SP`~ + $AR $AR_FLAGS $oldlib$oldobjs$old_deplibs `find $tpldir -name \*.o | sort | $NL2SP`~ $RANLIB $oldlib' _LT_TAGVAR(archive_cmds, $1)='tpldir=Template.dir~ rm -rf $tpldir~ $CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~ - $CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | $NL2SP` $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname -o $lib' + $CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | sort | $NL2SP` $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='tpldir=Template.dir~ rm -rf $tpldir~ $CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~ - $CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | $NL2SP` $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname ${wl}-retain-symbols-file ${wl}$export_symbols -o $lib' + $CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | sort | $NL2SP` $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname ${wl}-retain-symbols-file ${wl}$export_symbols -o $lib' ;; - *) # Version 6 will use weak symbols + *) # Version 6 and above use weak symbols _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname ${wl}-retain-symbols-file ${wl}$export_symbols -o $lib' ;; @@ -5923,7 +6468,7 @@ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}--rpath ${wl}$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' - _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $ECHO \"$new_convenience\"` ${wl}--no-whole-archive' + _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' ;; cxx*) # Compaq C++ @@ -5942,9 +6487,9 @@ # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. - output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "ld"`; templist=`$ECHO "X$templist" | $Xsed -e "s/\(^.*ld.*\)\( .*ld .*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; $ECHO "X$list" | $Xsed' + output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "ld"`; templist=`func_echo_all "$templist" | $SED "s/\(^.*ld.*\)\( .*ld .*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "X$list" | $Xsed' ;; - xl*) + xl* | mpixl* | bgxl*) # IBM XL 8.0 on PPC, with GNU ld _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' @@ -5964,13 +6509,13 @@ _LT_TAGVAR(archive_cmds, $1)='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-retain-symbols-file ${wl}$export_symbols' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' - _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; $ECHO \"$new_convenience\"` ${wl}--no-whole-archive' + _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' _LT_TAGVAR(compiler_needs_object, $1)=yes # Not sure whether something based on # $CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1 # would be better. - output_verbose_link_cmd='echo' + output_verbose_link_cmd='func_echo_all' # Archives containing C++ object files must be created using # "CC -xar", where "CC" is the Sun C++ compiler. This is @@ -6039,7 +6584,7 @@ _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' _LT_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' fi - output_verbose_link_cmd=echo + output_verbose_link_cmd=func_echo_all else _LT_TAGVAR(ld_shlibs, $1)=no fi @@ -6074,15 +6619,15 @@ case $host in osf3*) _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*' - _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $soname `test -n "$verstring" && $ECHO "X${wl}-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -o $lib' + _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $soname `test -n "$verstring" && func_echo_all "${wl}-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' ;; *) _LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*' - _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -o $lib' + _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done~ echo "-hidden">> $lib.exp~ - $CC -shared$allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname ${wl}-input ${wl}$lib.exp `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -o $lib~ + $CC -shared$allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname ${wl}-input ${wl}$lib.exp `test -n "$verstring" && $ECHO "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib~ $RM $lib.exp' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir' ;; @@ -6098,17 +6643,17 @@ # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. - output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "ld" | $GREP -v "ld:"`; templist=`$ECHO "X$templist" | $Xsed -e "s/\(^.*ld.*\)\( .*ld.*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; $ECHO "X$list" | $Xsed' + output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "ld" | $GREP -v "ld:"`; templist=`func_echo_all "$templist" | $SED "s/\(^.*ld.*\)\( .*ld.*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"' ;; *) if test "$GXX" = yes && test "$with_gnu_ld" = no; then _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*' case $host in osf3*) - _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "X${wl}-set_version ${wl}$verstring" | $Xsed` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' + _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' ;; *) - _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "${wl}-set_version ${wl}$verstring" | $Xsed` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' ;; esac @@ -6118,7 +6663,7 @@ # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. - output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "\-L"' + output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"' else # FIXME: insert proper C++ library support @@ -6154,7 +6699,7 @@ solaris*) case $cc_basename in - CC*) + CC* | sunCC*) # Sun C++ 4.2, 5.x and Centerline C++ _LT_TAGVAR(archive_cmds_need_lc,$1)=yes _LT_TAGVAR(no_undefined_flag, $1)=' -zdefs' @@ -6175,7 +6720,7 @@ esac _LT_TAGVAR(link_all_deplibs, $1)=yes - output_verbose_link_cmd='echo' + output_verbose_link_cmd='func_echo_all' # Archives containing C++ object files must be created using # "CC -xar", where "CC" is the Sun C++ compiler. This is @@ -6195,14 +6740,14 @@ if test "$GXX" = yes && test "$with_gnu_ld" = no; then _LT_TAGVAR(no_undefined_flag, $1)=' ${wl}-z ${wl}defs' if $CC --version | $GREP -v '^2\.7' > /dev/null; then - _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib' + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ - $CC -shared -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp' + $CC -shared $pic_flag -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp' # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. - output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "\-L"' + output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"' else # g++ 2.7 appears to require `-G' NOT `-shared' on this # platform. @@ -6213,7 +6758,7 @@ # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. - output_verbose_link_cmd='$CC -G $CFLAGS -v conftest.$objext 2>&1 | $GREP "\-L"' + output_verbose_link_cmd='$CC -G $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"' fi _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $wl$libdir' @@ -6267,6 +6812,10 @@ CC*) _LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + _LT_TAGVAR(old_archive_cmds, $1)='$CC -Tprelink_objects $oldobjs~ + '"$_LT_TAGVAR(old_archive_cmds, $1)" + _LT_TAGVAR(reload_cmds, $1)='$CC -Tprelink_objects $reload_objs~ + '"$_LT_TAGVAR(reload_cmds, $1)" ;; *) _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' @@ -6322,6 +6871,7 @@ fi # test -n "$compiler" CC=$lt_save_CC + CFLAGS=$lt_save_CFLAGS LDCXX=$LD LD=$lt_save_LD GCC=$lt_save_GCC @@ -6336,6 +6886,29 @@ ])# _LT_LANG_CXX_CONFIG +# _LT_FUNC_STRIPNAME_CNF +# ---------------------- +# func_stripname_cnf prefix suffix name +# strip PREFIX and SUFFIX off of NAME. +# PREFIX and SUFFIX must not contain globbing or regex special +# characters, hashes, percent signs, but SUFFIX may contain a leading +# dot (in which case that matches only a dot). +# +# This function is identical to the (non-XSI) version of func_stripname, +# except this one can be used by m4 code that may be executed by configure, +# rather than the libtool script. +m4_defun([_LT_FUNC_STRIPNAME_CNF],[dnl +AC_REQUIRE([_LT_DECL_SED]) +AC_REQUIRE([_LT_PROG_ECHO_BACKSLASH]) +func_stripname_cnf () +{ + case ${2} in + .*) func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%\\\\${2}\$%%"`;; + *) func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%${2}\$%%"`;; + esac +} # func_stripname_cnf +])# _LT_FUNC_STRIPNAME_CNF + # _LT_SYS_HIDDEN_LIBDEPS([TAGNAME]) # --------------------------------- # Figure out "hidden" library dependencies from verbose @@ -6344,6 +6917,7 @@ # objects, libraries and library flags. m4_defun([_LT_SYS_HIDDEN_LIBDEPS], [m4_require([_LT_FILEUTILS_DEFAULTS])dnl +AC_REQUIRE([_LT_FUNC_STRIPNAME_CNF])dnl # Dependencies to place before and after the object being linked: _LT_TAGVAR(predep_objects, $1)= _LT_TAGVAR(postdep_objects, $1)= @@ -6393,7 +6967,20 @@ } }; _LT_EOF +], [$1], [GO], [cat > conftest.$ac_ext <<_LT_EOF +package foo +func foo() { +} +_LT_EOF ]) + +_lt_libdeps_save_CFLAGS=$CFLAGS +case "$CC $CFLAGS " in #( +*\ -flto*\ *) CFLAGS="$CFLAGS -fno-lto" ;; +*\ -fwhopr*\ *) CFLAGS="$CFLAGS -fno-whopr" ;; +*\ -fuse-linker-plugin*\ *) CFLAGS="$CFLAGS -fno-use-linker-plugin" ;; +esac + dnl Parse the compiler output and extract the necessary dnl objects, libraries and library flags. if AC_TRY_EVAL(ac_compile); then @@ -6405,7 +6992,7 @@ pre_test_object_deps_done=no for p in `eval "$output_verbose_link_cmd"`; do - case $p in + case ${prev}${p} in -L* | -R* | -l*) # Some compilers place space between "-{L,R}" and the path. @@ -6414,13 +7001,22 @@ test $p = "-R"; then prev=$p continue - else - prev= fi + # Expand the sysroot to ease extracting the directories later. + if test -z "$prev"; then + case $p in + -L*) func_stripname_cnf '-L' '' "$p"; prev=-L; p=$func_stripname_result ;; + -R*) func_stripname_cnf '-R' '' "$p"; prev=-R; p=$func_stripname_result ;; + -l*) func_stripname_cnf '-l' '' "$p"; prev=-l; p=$func_stripname_result ;; + esac + fi + case $p in + =*) func_stripname_cnf '=' '' "$p"; p=$lt_sysroot$func_stripname_result ;; + esac if test "$pre_test_object_deps_done" = no; then - case $p in - -L* | -R*) + case ${prev} in + -L | -R) # Internal compiler library paths should come after those # provided the user. The postdeps already come after the # user supplied libs so there is no need to process them. @@ -6440,8 +7036,10 @@ _LT_TAGVAR(postdeps, $1)="${_LT_TAGVAR(postdeps, $1)} ${prev}${p}" fi fi + prev= ;; + *.lto.$objext) ;; # Ignore GCC LTO objects *.$objext) # This assumes that the test object file only shows up # once in the compiler output. @@ -6477,6 +7075,7 @@ fi $RM -f confest.$objext +CFLAGS=$_lt_libdeps_save_CFLAGS # PORTME: override above test on systems where it is broken m4_if([$1], [CXX], @@ -6513,7 +7112,7 @@ solaris*) case $cc_basename in - CC*) + CC* | sunCC*) # The more standards-conforming stlport4 library is # incompatible with the Cstd library. Avoid specifying # it if it's in CXXFLAGS. Ignore libCrun as @@ -6557,32 +7156,16 @@ ])# _LT_SYS_HIDDEN_LIBDEPS -# _LT_PROG_F77 -# ------------ -# Since AC_PROG_F77 is broken, in that it returns the empty string -# if there is no fortran compiler, we have our own version here. -m4_defun([_LT_PROG_F77], -[ -pushdef([AC_MSG_ERROR], [_lt_disable_F77=yes]) -AC_PROG_F77 -if test -z "$F77" || test "X$F77" = "Xno"; then - _lt_disable_F77=yes -fi -popdef([AC_MSG_ERROR]) -])# _LT_PROG_F77 - -dnl aclocal-1.4 backwards compatibility: -dnl AC_DEFUN([_LT_PROG_F77], []) - - # _LT_LANG_F77_CONFIG([TAG]) # -------------------------- # Ensure that the configuration variables for a Fortran 77 compiler are # suitably defined. These variables are subsequently used by _LT_CONFIG # to write the compiler configuration to `libtool'. m4_defun([_LT_LANG_F77_CONFIG], -[AC_REQUIRE([_LT_PROG_F77])dnl -AC_LANG_PUSH(Fortran 77) +[AC_LANG_PUSH(Fortran 77) +if test -z "$F77" || test "X$F77" = "Xno"; then + _lt_disable_F77=yes +fi _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(allow_undefined_flag, $1)= @@ -6592,7 +7175,6 @@ _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_direct_absolute, $1)=no _LT_TAGVAR(hardcode_libdir_flag_spec, $1)= -_LT_TAGVAR(hardcode_libdir_flag_spec_ld, $1)= _LT_TAGVAR(hardcode_libdir_separator, $1)= _LT_TAGVAR(hardcode_minus_L, $1)=no _LT_TAGVAR(hardcode_automatic, $1)=no @@ -6601,6 +7183,8 @@ _LT_TAGVAR(module_expsym_cmds, $1)= _LT_TAGVAR(link_all_deplibs, $1)=unknown _LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds +_LT_TAGVAR(reload_flag, $1)=$reload_flag +_LT_TAGVAR(reload_cmds, $1)=$reload_cmds _LT_TAGVAR(no_undefined_flag, $1)= _LT_TAGVAR(whole_archive_flag_spec, $1)= _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no @@ -6640,7 +7224,9 @@ # Allow CC to be a program name with arguments. lt_save_CC="$CC" lt_save_GCC=$GCC + lt_save_CFLAGS=$CFLAGS CC=${F77-"f77"} + CFLAGS=$FFLAGS compiler=$CC _LT_TAGVAR(compiler, $1)=$CC _LT_CC_BASENAME([$compiler]) @@ -6694,38 +7280,24 @@ GCC=$lt_save_GCC CC="$lt_save_CC" + CFLAGS="$lt_save_CFLAGS" fi # test "$_lt_disable_F77" != yes AC_LANG_POP ])# _LT_LANG_F77_CONFIG -# _LT_PROG_FC -# ----------- -# Since AC_PROG_FC is broken, in that it returns the empty string -# if there is no fortran compiler, we have our own version here. -m4_defun([_LT_PROG_FC], -[ -pushdef([AC_MSG_ERROR], [_lt_disable_FC=yes]) -AC_PROG_FC -if test -z "$FC" || test "X$FC" = "Xno"; then - _lt_disable_FC=yes -fi -popdef([AC_MSG_ERROR]) -])# _LT_PROG_FC - -dnl aclocal-1.4 backwards compatibility: -dnl AC_DEFUN([_LT_PROG_FC], []) - - # _LT_LANG_FC_CONFIG([TAG]) # ------------------------- # Ensure that the configuration variables for a Fortran compiler are # suitably defined. These variables are subsequently used by _LT_CONFIG # to write the compiler configuration to `libtool'. m4_defun([_LT_LANG_FC_CONFIG], -[AC_REQUIRE([_LT_PROG_FC])dnl -AC_LANG_PUSH(Fortran) +[AC_LANG_PUSH(Fortran) + +if test -z "$FC" || test "X$FC" = "Xno"; then + _lt_disable_FC=yes +fi _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(allow_undefined_flag, $1)= @@ -6735,7 +7307,6 @@ _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_direct_absolute, $1)=no _LT_TAGVAR(hardcode_libdir_flag_spec, $1)= -_LT_TAGVAR(hardcode_libdir_flag_spec_ld, $1)= _LT_TAGVAR(hardcode_libdir_separator, $1)= _LT_TAGVAR(hardcode_minus_L, $1)=no _LT_TAGVAR(hardcode_automatic, $1)=no @@ -6744,6 +7315,8 @@ _LT_TAGVAR(module_expsym_cmds, $1)= _LT_TAGVAR(link_all_deplibs, $1)=unknown _LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds +_LT_TAGVAR(reload_flag, $1)=$reload_flag +_LT_TAGVAR(reload_cmds, $1)=$reload_cmds _LT_TAGVAR(no_undefined_flag, $1)= _LT_TAGVAR(whole_archive_flag_spec, $1)= _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no @@ -6783,7 +7356,9 @@ # Allow CC to be a program name with arguments. lt_save_CC="$CC" lt_save_GCC=$GCC + lt_save_CFLAGS=$CFLAGS CC=${FC-"f95"} + CFLAGS=$FCFLAGS compiler=$CC GCC=$ac_cv_fc_compiler_gnu @@ -6839,7 +7414,8 @@ fi # test -n "$compiler" GCC=$lt_save_GCC - CC="$lt_save_CC" + CC=$lt_save_CC + CFLAGS=$lt_save_CFLAGS fi # test "$_lt_disable_FC" != yes AC_LANG_POP @@ -6876,10 +7452,12 @@ _LT_LINKER_BOILERPLATE # Allow CC to be a program name with arguments. -lt_save_CC="$CC" +lt_save_CC=$CC +lt_save_CFLAGS=$CFLAGS lt_save_GCC=$GCC GCC=yes CC=${GCJ-"gcj"} +CFLAGS=$GCJFLAGS compiler=$CC _LT_TAGVAR(compiler, $1)=$CC _LT_TAGVAR(LD, $1)="$LD" @@ -6889,6 +7467,8 @@ _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds +_LT_TAGVAR(reload_flag, $1)=$reload_flag +_LT_TAGVAR(reload_cmds, $1)=$reload_cmds ## CAVEAT EMPTOR: ## There is no encapsulation within the following macros, do not change @@ -6908,10 +7488,82 @@ AC_LANG_RESTORE GCC=$lt_save_GCC -CC="$lt_save_CC" +CC=$lt_save_CC +CFLAGS=$lt_save_CFLAGS ])# _LT_LANG_GCJ_CONFIG +# _LT_LANG_GO_CONFIG([TAG]) +# -------------------------- +# Ensure that the configuration variables for the GNU Go compiler +# are suitably defined. These variables are subsequently used by _LT_CONFIG +# to write the compiler configuration to `libtool'. +m4_defun([_LT_LANG_GO_CONFIG], +[AC_REQUIRE([LT_PROG_GO])dnl +AC_LANG_SAVE + +# Source file extension for Go test sources. +ac_ext=go + +# Object file extension for compiled Go test sources. +objext=o +_LT_TAGVAR(objext, $1)=$objext + +# Code to be used in simple compile tests +lt_simple_compile_test_code="package main; func main() { }" + +# Code to be used in simple link tests +lt_simple_link_test_code='package main; func main() { }' + +# ltmain only uses $CC for tagged configurations so make sure $CC is set. +_LT_TAG_COMPILER + +# save warnings/boilerplate of simple test code +_LT_COMPILER_BOILERPLATE +_LT_LINKER_BOILERPLATE + +# Allow CC to be a program name with arguments. +lt_save_CC=$CC +lt_save_CFLAGS=$CFLAGS +lt_save_GCC=$GCC +GCC=yes +CC=${GOC-"gccgo"} +CFLAGS=$GOFLAGS +compiler=$CC +_LT_TAGVAR(compiler, $1)=$CC +_LT_TAGVAR(LD, $1)="$LD" +_LT_CC_BASENAME([$compiler]) + +# Go did not exist at the time GCC didn't implicitly link libc in. +_LT_TAGVAR(archive_cmds_need_lc, $1)=no + +_LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds +_LT_TAGVAR(reload_flag, $1)=$reload_flag +_LT_TAGVAR(reload_cmds, $1)=$reload_cmds + +## CAVEAT EMPTOR: +## There is no encapsulation within the following macros, do not change +## the running order or otherwise move them around unless you know exactly +## what you are doing... +if test -n "$compiler"; then + _LT_COMPILER_NO_RTTI($1) + _LT_COMPILER_PIC($1) + _LT_COMPILER_C_O($1) + _LT_COMPILER_FILE_LOCKS($1) + _LT_LINKER_SHLIBS($1) + _LT_LINKER_HARDCODE_LIBPATH($1) + + _LT_CONFIG($1) +fi + +AC_LANG_RESTORE + +GCC=$lt_save_GCC +CC=$lt_save_CC +CFLAGS=$lt_save_CFLAGS +])# _LT_LANG_GO_CONFIG + + # _LT_LANG_RC_CONFIG([TAG]) # ------------------------- # Ensure that the configuration variables for the Windows resource compiler @@ -6943,9 +7595,11 @@ # Allow CC to be a program name with arguments. lt_save_CC="$CC" +lt_save_CFLAGS=$CFLAGS lt_save_GCC=$GCC GCC= CC=${RC-"windres"} +CFLAGS= compiler=$CC _LT_TAGVAR(compiler, $1)=$CC _LT_CC_BASENAME([$compiler]) @@ -6958,7 +7612,8 @@ GCC=$lt_save_GCC AC_LANG_RESTORE -CC="$lt_save_CC" +CC=$lt_save_CC +CFLAGS=$lt_save_CFLAGS ])# _LT_LANG_RC_CONFIG @@ -6978,6 +7633,13 @@ dnl AC_DEFUN([LT_AC_PROG_GCJ], []) +# LT_PROG_GO +# ---------- +AC_DEFUN([LT_PROG_GO], +[AC_CHECK_TOOL(GOC, gccgo,) +]) + + # LT_PROG_RC # ---------- AC_DEFUN([LT_PROG_RC], @@ -7017,6 +7679,15 @@ AC_SUBST([OBJDUMP]) ]) +# _LT_DECL_DLLTOOL +# ---------------- +# Ensure DLLTOOL variable is set. +m4_defun([_LT_DECL_DLLTOOL], +[AC_CHECK_TOOL(DLLTOOL, dlltool, false) +test -z "$DLLTOOL" && DLLTOOL=dlltool +_LT_DECL([], [DLLTOOL], [1], [DLL creation program]) +AC_SUBST([DLLTOOL]) +]) # _LT_DECL_SED # ------------ @@ -7110,8 +7781,8 @@ # Try some XSI features xsi_shell=no ( _lt_dummy="a/b/c" - test "${_lt_dummy##*/},${_lt_dummy%/*},"${_lt_dummy%"$_lt_dummy"}, \ - = c,a/b,, \ + test "${_lt_dummy##*/},${_lt_dummy%/*},${_lt_dummy#??}"${_lt_dummy%"$_lt_dummy"}, \ + = c,a/b,b/c, \ && eval 'test $(( 1 + 1 )) -eq 2 \ && test "${#_lt_dummy}" -eq 5' ) >/dev/null 2>&1 \ && xsi_shell=yes @@ -7150,208 +7821,162 @@ ])# _LT_CHECK_SHELL_FEATURES -# _LT_PROG_XSI_SHELLFNS -# --------------------- -# Bourne and XSI compatible variants of some useful shell functions. -m4_defun([_LT_PROG_XSI_SHELLFNS], -[case $xsi_shell in - yes) - cat << \_LT_EOF >> "$cfgfile" - -# func_dirname file append nondir_replacement -# Compute the dirname of FILE. If nonempty, add APPEND to the result, -# otherwise set result to NONDIR_REPLACEMENT. -func_dirname () -{ - case ${1} in - */*) func_dirname_result="${1%/*}${2}" ;; - * ) func_dirname_result="${3}" ;; - esac -} - -# func_basename file -func_basename () -{ - func_basename_result="${1##*/}" -} - -# func_dirname_and_basename file append nondir_replacement -# perform func_basename and func_dirname in a single function -# call: -# dirname: Compute the dirname of FILE. If nonempty, -# add APPEND to the result, otherwise set result -# to NONDIR_REPLACEMENT. -# value returned in "$func_dirname_result" -# basename: Compute filename of FILE. -# value retuned in "$func_basename_result" -# Implementation must be kept synchronized with func_dirname -# and func_basename. For efficiency, we do not delegate to -# those functions but instead duplicate the functionality here. -func_dirname_and_basename () -{ - case ${1} in - */*) func_dirname_result="${1%/*}${2}" ;; - * ) func_dirname_result="${3}" ;; - esac - func_basename_result="${1##*/}" -} - -# func_stripname prefix suffix name -# strip PREFIX and SUFFIX off of NAME. -# PREFIX and SUFFIX must not contain globbing or regex special -# characters, hashes, percent signs, but SUFFIX may contain a leading -# dot (in which case that matches only a dot). -func_stripname () -{ - # pdksh 5.2.14 does not do ${X%$Y} correctly if both X and Y are - # positional parameters, so assign one to ordinary parameter first. - func_stripname_result=${3} - func_stripname_result=${func_stripname_result#"${1}"} - func_stripname_result=${func_stripname_result%"${2}"} -} - -# func_opt_split -func_opt_split () -{ - func_opt_split_opt=${1%%=*} - func_opt_split_arg=${1#*=} -} - -# func_lo2o object -func_lo2o () -{ - case ${1} in - *.lo) func_lo2o_result=${1%.lo}.${objext} ;; - *) func_lo2o_result=${1} ;; - esac -} - -# func_xform libobj-or-source -func_xform () -{ - func_xform_result=${1%.*}.lo -} +# _LT_PROG_FUNCTION_REPLACE (FUNCNAME, REPLACEMENT-BODY) +# ------------------------------------------------------ +# In `$cfgfile', look for function FUNCNAME delimited by `^FUNCNAME ()$' and +# '^} FUNCNAME ', and replace its body with REPLACEMENT-BODY. +m4_defun([_LT_PROG_FUNCTION_REPLACE], +[dnl { +sed -e '/^$1 ()$/,/^} # $1 /c\ +$1 ()\ +{\ +m4_bpatsubsts([$2], [$], [\\], [^\([ ]\)], [\\\1]) +} # Extended-shell $1 implementation' "$cfgfile" > $cfgfile.tmp \ + && mv -f "$cfgfile.tmp" "$cfgfile" \ + || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") +test 0 -eq $? || _lt_function_replace_fail=: +]) -# func_arith arithmetic-term... -func_arith () -{ - func_arith_result=$(( $[*] )) -} -# func_len string -# STRING may not start with a hyphen. -func_len () -{ - func_len_result=${#1} -} +# _LT_PROG_REPLACE_SHELLFNS +# ------------------------- +# Replace existing portable implementations of several shell functions with +# equivalent extended shell implementations where those features are available.. +m4_defun([_LT_PROG_REPLACE_SHELLFNS], +[if test x"$xsi_shell" = xyes; then + _LT_PROG_FUNCTION_REPLACE([func_dirname], [dnl + case ${1} in + */*) func_dirname_result="${1%/*}${2}" ;; + * ) func_dirname_result="${3}" ;; + esac]) + + _LT_PROG_FUNCTION_REPLACE([func_basename], [dnl + func_basename_result="${1##*/}"]) + + _LT_PROG_FUNCTION_REPLACE([func_dirname_and_basename], [dnl + case ${1} in + */*) func_dirname_result="${1%/*}${2}" ;; + * ) func_dirname_result="${3}" ;; + esac + func_basename_result="${1##*/}"]) -_LT_EOF - ;; - *) # Bourne compatible functions. - cat << \_LT_EOF >> "$cfgfile" + _LT_PROG_FUNCTION_REPLACE([func_stripname], [dnl + # pdksh 5.2.14 does not do ${X%$Y} correctly if both X and Y are + # positional parameters, so assign one to ordinary parameter first. + func_stripname_result=${3} + func_stripname_result=${func_stripname_result#"${1}"} + func_stripname_result=${func_stripname_result%"${2}"}]) -# func_dirname file append nondir_replacement -# Compute the dirname of FILE. If nonempty, add APPEND to the result, -# otherwise set result to NONDIR_REPLACEMENT. -func_dirname () -{ - # Extract subdirectory from the argument. - func_dirname_result=`$ECHO "X${1}" | $Xsed -e "$dirname"` - if test "X$func_dirname_result" = "X${1}"; then - func_dirname_result="${3}" - else - func_dirname_result="$func_dirname_result${2}" - fi -} - -# func_basename file -func_basename () -{ - func_basename_result=`$ECHO "X${1}" | $Xsed -e "$basename"` -} + _LT_PROG_FUNCTION_REPLACE([func_split_long_opt], [dnl + func_split_long_opt_name=${1%%=*} + func_split_long_opt_arg=${1#*=}]) -dnl func_dirname_and_basename -dnl A portable version of this function is already defined in general.m4sh -dnl so there is no need for it here. + _LT_PROG_FUNCTION_REPLACE([func_split_short_opt], [dnl + func_split_short_opt_arg=${1#??} + func_split_short_opt_name=${1%"$func_split_short_opt_arg"}]) -# func_stripname prefix suffix name -# strip PREFIX and SUFFIX off of NAME. -# PREFIX and SUFFIX must not contain globbing or regex special -# characters, hashes, percent signs, but SUFFIX may contain a leading -# dot (in which case that matches only a dot). -# func_strip_suffix prefix name -func_stripname () -{ - case ${2} in - .*) func_stripname_result=`$ECHO "X${3}" \ - | $Xsed -e "s%^${1}%%" -e "s%\\\\${2}\$%%"`;; - *) func_stripname_result=`$ECHO "X${3}" \ - | $Xsed -e "s%^${1}%%" -e "s%${2}\$%%"`;; - esac -} + _LT_PROG_FUNCTION_REPLACE([func_lo2o], [dnl + case ${1} in + *.lo) func_lo2o_result=${1%.lo}.${objext} ;; + *) func_lo2o_result=${1} ;; + esac]) -# sed scripts: -my_sed_long_opt='1s/^\(-[[^=]]*\)=.*/\1/;q' -my_sed_long_arg='1s/^-[[^=]]*=//' + _LT_PROG_FUNCTION_REPLACE([func_xform], [ func_xform_result=${1%.*}.lo]) -# func_opt_split -func_opt_split () -{ - func_opt_split_opt=`$ECHO "X${1}" | $Xsed -e "$my_sed_long_opt"` - func_opt_split_arg=`$ECHO "X${1}" | $Xsed -e "$my_sed_long_arg"` -} + _LT_PROG_FUNCTION_REPLACE([func_arith], [ func_arith_result=$(( $[*] ))]) -# func_lo2o object -func_lo2o () -{ - func_lo2o_result=`$ECHO "X${1}" | $Xsed -e "$lo2o"` -} + _LT_PROG_FUNCTION_REPLACE([func_len], [ func_len_result=${#1}]) +fi -# func_xform libobj-or-source -func_xform () -{ - func_xform_result=`$ECHO "X${1}" | $Xsed -e 's/\.[[^.]]*$/.lo/'` -} +if test x"$lt_shell_append" = xyes; then + _LT_PROG_FUNCTION_REPLACE([func_append], [ eval "${1}+=\\${2}"]) -# func_arith arithmetic-term... -func_arith () -{ - func_arith_result=`expr "$[@]"` -} + _LT_PROG_FUNCTION_REPLACE([func_append_quoted], [dnl + func_quote_for_eval "${2}" +dnl m4 expansion turns \\\\ into \\, and then the shell eval turns that into \ + eval "${1}+=\\\\ \\$func_quote_for_eval_result"]) -# func_len string -# STRING may not start with a hyphen. -func_len () -{ - func_len_result=`expr "$[1]" : ".*" 2>/dev/null || echo $max_cmd_len` -} + # Save a `func_append' function call where possible by direct use of '+=' + sed -e 's%func_append \([[a-zA-Z_]]\{1,\}\) "%\1+="%g' $cfgfile > $cfgfile.tmp \ + && mv -f "$cfgfile.tmp" "$cfgfile" \ + || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") + test 0 -eq $? || _lt_function_replace_fail=: +else + # Save a `func_append' function call even when '+=' is not available + sed -e 's%func_append \([[a-zA-Z_]]\{1,\}\) "%\1="$\1%g' $cfgfile > $cfgfile.tmp \ + && mv -f "$cfgfile.tmp" "$cfgfile" \ + || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") + test 0 -eq $? || _lt_function_replace_fail=: +fi -_LT_EOF -esac +if test x"$_lt_function_replace_fail" = x":"; then + AC_MSG_WARN([Unable to substitute extended shell functions in $ofile]) +fi +]) -case $lt_shell_append in - yes) - cat << \_LT_EOF >> "$cfgfile" - -# func_append var value -# Append VALUE to the end of shell variable VAR. -func_append () -{ - eval "$[1]+=\$[2]" -} -_LT_EOF +# _LT_PATH_CONVERSION_FUNCTIONS +# ----------------------------- +# Determine which file name conversion functions should be used by +# func_to_host_file (and, implicitly, by func_to_host_path). These are needed +# for certain cross-compile configurations and native mingw. +m4_defun([_LT_PATH_CONVERSION_FUNCTIONS], +[AC_REQUIRE([AC_CANONICAL_HOST])dnl +AC_REQUIRE([AC_CANONICAL_BUILD])dnl +AC_MSG_CHECKING([how to convert $build file names to $host format]) +AC_CACHE_VAL(lt_cv_to_host_file_cmd, +[case $host in + *-*-mingw* ) + case $build in + *-*-mingw* ) # actually msys + lt_cv_to_host_file_cmd=func_convert_file_msys_to_w32 + ;; + *-*-cygwin* ) + lt_cv_to_host_file_cmd=func_convert_file_cygwin_to_w32 + ;; + * ) # otherwise, assume *nix + lt_cv_to_host_file_cmd=func_convert_file_nix_to_w32 + ;; + esac ;; - *) - cat << \_LT_EOF >> "$cfgfile" - -# func_append var value -# Append VALUE to the end of shell variable VAR. -func_append () -{ - eval "$[1]=\$$[1]\$[2]" -} - -_LT_EOF + *-*-cygwin* ) + case $build in + *-*-mingw* ) # actually msys + lt_cv_to_host_file_cmd=func_convert_file_msys_to_cygwin + ;; + *-*-cygwin* ) + lt_cv_to_host_file_cmd=func_convert_file_noop + ;; + * ) # otherwise, assume *nix + lt_cv_to_host_file_cmd=func_convert_file_nix_to_cygwin + ;; + esac ;; - esac + * ) # unhandled hosts (and "normal" native builds) + lt_cv_to_host_file_cmd=func_convert_file_noop + ;; +esac +]) +to_host_file_cmd=$lt_cv_to_host_file_cmd +AC_MSG_RESULT([$lt_cv_to_host_file_cmd]) +_LT_DECL([to_host_file_cmd], [lt_cv_to_host_file_cmd], + [0], [convert $build file names to $host format])dnl + +AC_MSG_CHECKING([how to convert $build file names to toolchain format]) +AC_CACHE_VAL(lt_cv_to_tool_file_cmd, +[#assume ordinary cross tools, or native build. +lt_cv_to_tool_file_cmd=func_convert_file_noop +case $host in + *-*-mingw* ) + case $build in + *-*-mingw* ) # actually msys + lt_cv_to_tool_file_cmd=func_convert_file_msys_to_w32 + ;; + esac + ;; +esac ]) +to_tool_file_cmd=$lt_cv_to_tool_file_cmd +AC_MSG_RESULT([$lt_cv_to_tool_file_cmd]) +_LT_DECL([to_tool_file_cmd], [lt_cv_to_tool_file_cmd], + [0], [convert $build files to toolchain format])dnl +])# _LT_PATH_CONVERSION_FUNCTIONS diff -Nru libdap-3.11.1/conf/ltmain.sh libdap-3.12.0/conf/ltmain.sh --- libdap-3.11.1/conf/ltmain.sh 2011-05-06 17:36:21.000000000 +0000 +++ libdap-3.12.0/conf/ltmain.sh 2013-10-17 21:27:40.000000000 +0000 @@ -1,9 +1,9 @@ -# Generated from ltmain.m4sh. -# ltmain.sh (GNU libtool) 2.2.6b +# libtool (GNU libtool) 2.4.2 # Written by Gordon Matzigkeit , 1996 -# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005, 2006, 2007 2008 Free Software Foundation, Inc. +# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005, 2006, +# 2007, 2008, 2009, 2010, 2011 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. @@ -32,50 +32,57 @@ # # Provide generalized library-building support services. # -# --config show all configuration variables -# --debug enable verbose shell tracing -# -n, --dry-run display commands without modifying any files -# --features display basic configuration information and exit -# --mode=MODE use operation mode MODE -# --preserve-dup-deps don't remove duplicate dependency libraries -# --quiet, --silent don't print informational messages -# --tag=TAG use configuration variables from tag TAG -# -v, --verbose print informational messages (default) -# --version print version information -# -h, --help print short or long help message +# --config show all configuration variables +# --debug enable verbose shell tracing +# -n, --dry-run display commands without modifying any files +# --features display basic configuration information and exit +# --mode=MODE use operation mode MODE +# --preserve-dup-deps don't remove duplicate dependency libraries +# --quiet, --silent don't print informational messages +# --no-quiet, --no-silent +# print informational messages (default) +# --no-warn don't display warning messages +# --tag=TAG use configuration variables from tag TAG +# -v, --verbose print more informational messages than default +# --no-verbose don't print the extra informational messages +# --version print version information +# -h, --help, --help-all print short, long, or detailed help message # # MODE must be one of the following: # -# clean remove files from the build directory -# compile compile a source file into a libtool object -# execute automatically set library path, then run a program -# finish complete the installation of libtool libraries -# install install libraries or executables -# link create a library or an executable -# uninstall remove libraries from an installed directory +# clean remove files from the build directory +# compile compile a source file into a libtool object +# execute automatically set library path, then run a program +# finish complete the installation of libtool libraries +# install install libraries or executables +# link create a library or an executable +# uninstall remove libraries from an installed directory # -# MODE-ARGS vary depending on the MODE. +# MODE-ARGS vary depending on the MODE. When passed as first option, +# `--mode=MODE' may be abbreviated as `MODE' or a unique abbreviation of that. # Try `$progname --help --mode=MODE' for a more detailed description of MODE. # # When reporting a bug, please describe a test case to reproduce it and # include the following information: # -# host-triplet: $host -# shell: $SHELL -# compiler: $LTCC -# compiler flags: $LTCFLAGS -# linker: $LD (gnu? $with_gnu_ld) -# $progname: (GNU libtool) 2.2.6b -# automake: $automake_version -# autoconf: $autoconf_version +# host-triplet: $host +# shell: $SHELL +# compiler: $LTCC +# compiler flags: $LTCFLAGS +# linker: $LD (gnu? $with_gnu_ld) +# $progname: (GNU libtool) 2.4.2 +# automake: $automake_version +# autoconf: $autoconf_version # # Report bugs to . +# GNU libtool home page: . +# General help using GNU software: . -PROGRAM=ltmain.sh +PROGRAM=libtool PACKAGE=libtool -VERSION=2.2.6b +VERSION=2.4.2 TIMESTAMP="" -package_revision=1.3017 +package_revision=1.3337 # Be Bourne compatible if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then @@ -91,10 +98,15 @@ BIN_SH=xpg4; export BIN_SH # for Tru64 DUALCASE=1; export DUALCASE # for MKS sh +# A function that is used when there is no print builtin or printf. +func_fallback_echo () +{ + eval 'cat <<_LTECHO_EOF +$1 +_LTECHO_EOF' +} + # NLS nuisances: We save the old values to restore during execute mode. -# Only set LANG and LC_ALL to C if already set. -# These must not be set unconditionally because not all systems understand -# e.g. LANG=C (notably SCO). lt_user_locale= lt_safe_locale= for lt_var in LANG LANGUAGE LC_ALL LC_CTYPE LC_COLLATE LC_MESSAGES @@ -107,24 +119,28 @@ lt_safe_locale=\"$lt_var=C; \$lt_safe_locale\" fi" done +LC_ALL=C +LANGUAGE=C +export LANGUAGE LC_ALL $lt_unset CDPATH +# Work around backward compatibility issue on IRIX 6.5. On IRIX 6.4+, sh +# is ksh but when the shell is invoked as "sh" and the current value of +# the _XPG environment variable is not equal to 1 (one), the special +# positional parameter $0, within a function call, is the name of the +# function. +progpath="$0" : ${CP="cp -f"} -: ${ECHO="echo"} -: ${EGREP="/bin/grep -E"} -: ${FGREP="/bin/grep -F"} -: ${GREP="/bin/grep"} -: ${LN_S="ln -s"} +test "${ECHO+set}" = set || ECHO=${as_echo-'printf %s\n'} : ${MAKE="make"} : ${MKDIR="mkdir"} : ${MV="mv -f"} : ${RM="rm -f"} -: ${SED="/bin/sed"} : ${SHELL="${CONFIG_SHELL-/bin/sh}"} : ${Xsed="$SED -e 1s/^X//"} @@ -144,6 +160,27 @@ dirname="s,/[^/]*$,," basename="s,^.*/,," +# func_dirname file append nondir_replacement +# Compute the dirname of FILE. If nonempty, add APPEND to the result, +# otherwise set result to NONDIR_REPLACEMENT. +func_dirname () +{ + func_dirname_result=`$ECHO "${1}" | $SED "$dirname"` + if test "X$func_dirname_result" = "X${1}"; then + func_dirname_result="${3}" + else + func_dirname_result="$func_dirname_result${2}" + fi +} # func_dirname may be replaced by extended shell implementation + + +# func_basename file +func_basename () +{ + func_basename_result=`$ECHO "${1}" | $SED "$basename"` +} # func_basename may be replaced by extended shell implementation + + # func_dirname_and_basename file append nondir_replacement # perform func_basename and func_dirname in a single function # call: @@ -158,33 +195,183 @@ # those functions but instead duplicate the functionality here. func_dirname_and_basename () { - # Extract subdirectory from the argument. - func_dirname_result=`$ECHO "X${1}" | $Xsed -e "$dirname"` - if test "X$func_dirname_result" = "X${1}"; then - func_dirname_result="${3}" - else - func_dirname_result="$func_dirname_result${2}" - fi - func_basename_result=`$ECHO "X${1}" | $Xsed -e "$basename"` + # Extract subdirectory from the argument. + func_dirname_result=`$ECHO "${1}" | $SED -e "$dirname"` + if test "X$func_dirname_result" = "X${1}"; then + func_dirname_result="${3}" + else + func_dirname_result="$func_dirname_result${2}" + fi + func_basename_result=`$ECHO "${1}" | $SED -e "$basename"` +} # func_dirname_and_basename may be replaced by extended shell implementation + + +# func_stripname prefix suffix name +# strip PREFIX and SUFFIX off of NAME. +# PREFIX and SUFFIX must not contain globbing or regex special +# characters, hashes, percent signs, but SUFFIX may contain a leading +# dot (in which case that matches only a dot). +# func_strip_suffix prefix name +func_stripname () +{ + case ${2} in + .*) func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%\\\\${2}\$%%"`;; + *) func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%${2}\$%%"`;; + esac +} # func_stripname may be replaced by extended shell implementation + + +# These SED scripts presuppose an absolute path with a trailing slash. +pathcar='s,^/\([^/]*\).*$,\1,' +pathcdr='s,^/[^/]*,,' +removedotparts=':dotsl + s@/\./@/@g + t dotsl + s,/\.$,/,' +collapseslashes='s@/\{1,\}@/@g' +finalslash='s,/*$,/,' + +# func_normal_abspath PATH +# Remove doubled-up and trailing slashes, "." path components, +# and cancel out any ".." path components in PATH after making +# it an absolute path. +# value returned in "$func_normal_abspath_result" +func_normal_abspath () +{ + # Start from root dir and reassemble the path. + func_normal_abspath_result= + func_normal_abspath_tpath=$1 + func_normal_abspath_altnamespace= + case $func_normal_abspath_tpath in + "") + # Empty path, that just means $cwd. + func_stripname '' '/' "`pwd`" + func_normal_abspath_result=$func_stripname_result + return + ;; + # The next three entries are used to spot a run of precisely + # two leading slashes without using negated character classes; + # we take advantage of case's first-match behaviour. + ///*) + # Unusual form of absolute path, do nothing. + ;; + //*) + # Not necessarily an ordinary path; POSIX reserves leading '//' + # and for example Cygwin uses it to access remote file shares + # over CIFS/SMB, so we conserve a leading double slash if found. + func_normal_abspath_altnamespace=/ + ;; + /*) + # Absolute path, do nothing. + ;; + *) + # Relative path, prepend $cwd. + func_normal_abspath_tpath=`pwd`/$func_normal_abspath_tpath + ;; + esac + # Cancel out all the simple stuff to save iterations. We also want + # the path to end with a slash for ease of parsing, so make sure + # there is one (and only one) here. + func_normal_abspath_tpath=`$ECHO "$func_normal_abspath_tpath" | $SED \ + -e "$removedotparts" -e "$collapseslashes" -e "$finalslash"` + while :; do + # Processed it all yet? + if test "$func_normal_abspath_tpath" = / ; then + # If we ascended to the root using ".." the result may be empty now. + if test -z "$func_normal_abspath_result" ; then + func_normal_abspath_result=/ + fi + break + fi + func_normal_abspath_tcomponent=`$ECHO "$func_normal_abspath_tpath" | $SED \ + -e "$pathcar"` + func_normal_abspath_tpath=`$ECHO "$func_normal_abspath_tpath" | $SED \ + -e "$pathcdr"` + # Figure out what to do with it + case $func_normal_abspath_tcomponent in + "") + # Trailing empty path component, ignore it. + ;; + ..) + # Parent dir; strip last assembled component from result. + func_dirname "$func_normal_abspath_result" + func_normal_abspath_result=$func_dirname_result + ;; + *) + # Actual path component, append it. + func_normal_abspath_result=$func_normal_abspath_result/$func_normal_abspath_tcomponent + ;; + esac + done + # Restore leading double-slash if one was found on entry. + func_normal_abspath_result=$func_normal_abspath_altnamespace$func_normal_abspath_result } -# Generated shell functions inserted here. +# func_relative_path SRCDIR DSTDIR +# generates a relative path from SRCDIR to DSTDIR, with a trailing +# slash if non-empty, suitable for immediately appending a filename +# without needing to append a separator. +# value returned in "$func_relative_path_result" +func_relative_path () +{ + func_relative_path_result= + func_normal_abspath "$1" + func_relative_path_tlibdir=$func_normal_abspath_result + func_normal_abspath "$2" + func_relative_path_tbindir=$func_normal_abspath_result + + # Ascend the tree starting from libdir + while :; do + # check if we have found a prefix of bindir + case $func_relative_path_tbindir in + $func_relative_path_tlibdir) + # found an exact match + func_relative_path_tcancelled= + break + ;; + $func_relative_path_tlibdir*) + # found a matching prefix + func_stripname "$func_relative_path_tlibdir" '' "$func_relative_path_tbindir" + func_relative_path_tcancelled=$func_stripname_result + if test -z "$func_relative_path_result"; then + func_relative_path_result=. + fi + break + ;; + *) + func_dirname $func_relative_path_tlibdir + func_relative_path_tlibdir=${func_dirname_result} + if test "x$func_relative_path_tlibdir" = x ; then + # Have to descend all the way to the root! + func_relative_path_result=../$func_relative_path_result + func_relative_path_tcancelled=$func_relative_path_tbindir + break + fi + func_relative_path_result=../$func_relative_path_result + ;; + esac + done -# Work around backward compatibility issue on IRIX 6.5. On IRIX 6.4+, sh -# is ksh but when the shell is invoked as "sh" and the current value of -# the _XPG environment variable is not equal to 1 (one), the special -# positional parameter $0, within a function call, is the name of the -# function. -progpath="$0" + # Now calculate path; take care to avoid doubling-up slashes. + func_stripname '' '/' "$func_relative_path_result" + func_relative_path_result=$func_stripname_result + func_stripname '/' '/' "$func_relative_path_tcancelled" + if test "x$func_stripname_result" != x ; then + func_relative_path_result=${func_relative_path_result}/${func_stripname_result} + fi + + # Normalisation. If bindir is libdir, return empty string, + # else relative path ending with a slash; either way, target + # file name can be directly appended. + if test ! -z "$func_relative_path_result"; then + func_stripname './' '' "$func_relative_path_result/" + func_relative_path_result=$func_stripname_result + fi +} # The name of this program: -# In the unlikely event $progname began with a '-', it would play havoc with -# func_echo (imagine progname=-n), so we prepend ./ in that case: func_dirname_and_basename "$progpath" progname=$func_basename_result -case $progname in - -*) progname=./$progname ;; -esac # Make sure we have an absolute path for reexecution: case $progpath in @@ -196,7 +383,7 @@ ;; *) save_IFS="$IFS" - IFS=: + IFS=${PATH_SEPARATOR-:} for progdir in $PATH; do IFS="$save_IFS" test -x "$progdir/$progname" && break @@ -215,6 +402,15 @@ # Same as above, but do not quote variable references. double_quote_subst='s/\(["`\\]\)/\\\1/g' +# Sed substitution that turns a string into a regex matching for the +# string literally. +sed_make_literal_regex='s,[].[^$\\*\/],\\&,g' + +# Sed substitution that converts a w32 file name or path +# which contains forward slashes, into one that contains +# (escaped) backslashes. A very naive implementation. +lt_sed_naive_backslashify='s|\\\\*|\\|g;s|/|\\|g;s|\\|\\\\|g' + # Re-`\' parameter expansions in output of double_quote_subst that were # `\'-ed in input to the same. If an odd number of `\' preceded a '$' # in input to double_quote_subst, that '$' was protected from expansion. @@ -243,7 +439,7 @@ # name if it has been set yet. func_echo () { - $ECHO "$progname${mode+: }$mode: $*" + $ECHO "$progname: ${opt_mode+$opt_mode: }$*" } # func_verbose arg... @@ -258,18 +454,25 @@ : } +# func_echo_all arg... +# Invoke $ECHO with all args, space-separated. +func_echo_all () +{ + $ECHO "$*" +} + # func_error arg... # Echo program name prefixed message to standard error. func_error () { - $ECHO "$progname${mode+: }$mode: "${1+"$@"} 1>&2 + $ECHO "$progname: ${opt_mode+$opt_mode: }"${1+"$@"} 1>&2 } # func_warning arg... # Echo program name prefixed warning message to standard error. func_warning () { - $opt_warning && $ECHO "$progname${mode+: }$mode: warning: "${1+"$@"} 1>&2 + $opt_warning && $ECHO "$progname: ${opt_mode+$opt_mode: }warning: "${1+"$@"} 1>&2 # bash bug again: : @@ -326,9 +529,9 @@ case $my_directory_path in */*) ;; *) break ;; esac # ...otherwise throw away the child directory and loop - my_directory_path=`$ECHO "X$my_directory_path" | $Xsed -e "$dirname"` + my_directory_path=`$ECHO "$my_directory_path" | $SED -e "$dirname"` done - my_dir_list=`$ECHO "X$my_dir_list" | $Xsed -e 's,:*$,,'` + my_dir_list=`$ECHO "$my_dir_list" | $SED 's,:*$,,'` save_mkdir_p_IFS="$IFS"; IFS=':' for my_dir in $my_dir_list; do @@ -378,7 +581,7 @@ func_fatal_error "cannot create temporary directory \`$my_tmpdir'" fi - $ECHO "X$my_tmpdir" | $Xsed + $ECHO "$my_tmpdir" } @@ -392,7 +595,7 @@ { case $1 in *[\\\`\"\$]*) - func_quote_for_eval_unquoted_result=`$ECHO "X$1" | $Xsed -e "$sed_quote_subst"` ;; + func_quote_for_eval_unquoted_result=`$ECHO "$1" | $SED "$sed_quote_subst"` ;; *) func_quote_for_eval_unquoted_result="$1" ;; esac @@ -419,7 +622,7 @@ { case $1 in *[\\\`\"]*) - my_arg=`$ECHO "X$1" | $Xsed \ + my_arg=`$ECHO "$1" | $SED \ -e "$double_quote_subst" -e "$sed_double_backslash"` ;; *) my_arg="$1" ;; @@ -488,15 +691,39 @@ fi } - - +# func_tr_sh +# Turn $1 into a string suitable for a shell variable name. +# Result is stored in $func_tr_sh_result. All characters +# not in the set a-zA-Z0-9_ are replaced with '_'. Further, +# if $1 begins with a digit, a '_' is prepended as well. +func_tr_sh () +{ + case $1 in + [0-9]* | *[!a-zA-Z0-9_]*) + func_tr_sh_result=`$ECHO "$1" | $SED 's/^\([0-9]\)/_\1/; s/[^a-zA-Z0-9_]/_/g'` + ;; + * ) + func_tr_sh_result=$1 + ;; + esac +} # func_version # Echo version message to standard output and exit. func_version () { - $SED -n '/^# '$PROGRAM' (GNU /,/# warranty; / { + $opt_debug + + $SED -n '/(C)/!b go + :more + /\./!{ + N + s/\n# / / + b more + } + :go + /^# '$PROGRAM' (GNU /,/# warranty; / { s/^# // s/^# *$// s/\((C)\)[ 0-9,-]*\( [1-9][0-9]*\)/\1\2/ @@ -509,22 +736,28 @@ # Echo short help message to standard output and exit. func_usage () { - $SED -n '/^# Usage:/,/# -h/ { + $opt_debug + + $SED -n '/^# Usage:/,/^# *.*--help/ { s/^# // s/^# *$// s/\$progname/'$progname'/ p }' < "$progpath" - $ECHO + echo $ECHO "run \`$progname --help | more' for full usage" exit $? } -# func_help -# Echo long help message to standard output and exit. +# func_help [NOEXIT] +# Echo long help message to standard output and exit, +# unless 'noexit' is passed as argument. func_help () { + $opt_debug + $SED -n '/^# Usage:/,/# Report bugs to/ { + :print s/^# // s/^# *$// s*\$progname*'$progname'* @@ -534,11 +767,18 @@ s*\$LTCFLAGS*'"$LTCFLAGS"'* s*\$LD*'"$LD"'* s/\$with_gnu_ld/'"$with_gnu_ld"'/ - s/\$automake_version/'"`(automake --version) 2>/dev/null |$SED 1q`"'/ - s/\$autoconf_version/'"`(autoconf --version) 2>/dev/null |$SED 1q`"'/ + s/\$automake_version/'"`(${AUTOMAKE-automake} --version) 2>/dev/null |$SED 1q`"'/ + s/\$autoconf_version/'"`(${AUTOCONF-autoconf} --version) 2>/dev/null |$SED 1q`"'/ p - }' < "$progpath" - exit $? + d + } + /^# .* home page:/b print + /^# General help using/b print + ' < "$progpath" + ret=$? + if test -z "$1"; then + exit $ret + fi } # func_missing_arg argname @@ -546,63 +786,106 @@ # exit_cmd. func_missing_arg () { - func_error "missing argument for $1" + $opt_debug + + func_error "missing argument for $1." exit_cmd=exit } -exit_cmd=: +# func_split_short_opt shortopt +# Set func_split_short_opt_name and func_split_short_opt_arg shell +# variables after splitting SHORTOPT after the 2nd character. +func_split_short_opt () +{ + my_sed_short_opt='1s/^\(..\).*$/\1/;q' + my_sed_short_rest='1s/^..\(.*\)$/\1/;q' + + func_split_short_opt_name=`$ECHO "$1" | $SED "$my_sed_short_opt"` + func_split_short_opt_arg=`$ECHO "$1" | $SED "$my_sed_short_rest"` +} # func_split_short_opt may be replaced by extended shell implementation + + +# func_split_long_opt longopt +# Set func_split_long_opt_name and func_split_long_opt_arg shell +# variables after splitting LONGOPT at the `=' sign. +func_split_long_opt () +{ + my_sed_long_opt='1s/^\(--[^=]*\)=.*/\1/;q' + my_sed_long_arg='1s/^--[^=]*=//' + + func_split_long_opt_name=`$ECHO "$1" | $SED "$my_sed_long_opt"` + func_split_long_opt_arg=`$ECHO "$1" | $SED "$my_sed_long_arg"` +} # func_split_long_opt may be replaced by extended shell implementation +exit_cmd=: -# Check that we have a working $ECHO. -if test "X$1" = X--no-reexec; then - # Discard the --no-reexec flag, and continue. - shift -elif test "X$1" = X--fallback-echo; then - # Avoid inline document here, it may be left over - : -elif test "X`{ $ECHO '\t'; } 2>/dev/null`" = 'X\t'; then - # Yippee, $ECHO works! - : -else - # Restart under the correct shell, and then maybe $ECHO will work. - exec $SHELL "$progpath" --no-reexec ${1+"$@"} -fi -if test "X$1" = X--fallback-echo; then - # used as fallback echo - shift - cat </dev/null || echo $max_cmd_len` +} # func_len may be replaced by extended shell implementation + + +# func_lo2o object +func_lo2o () +{ + func_lo2o_result=`$ECHO "${1}" | $SED "$lo2o"` +} # func_lo2o may be replaced by extended shell implementation + + +# func_xform libobj-or-source +func_xform () +{ + func_xform_result=`$ECHO "${1}" | $SED 's/\.[^.]*$/.lo/'` +} # func_xform may be replaced by extended shell implementation + + # func_fatal_configuration arg... # Echo program name prefixed message to standard error, followed by # a configuration failure hint, and exit. @@ -636,16 +919,16 @@ # Display the features supported by this script. func_features () { - $ECHO "host: $host" + echo "host: $host" if test "$build_libtool_libs" = yes; then - $ECHO "enable shared libraries" + echo "enable shared libraries" else - $ECHO "disable shared libraries" + echo "disable shared libraries" fi if test "$build_old_libs" = yes; then - $ECHO "enable static libraries" + echo "enable static libraries" else - $ECHO "disable static libraries" + echo "disable static libraries" fi exit $? @@ -692,117 +975,209 @@ esac } -# Parse options once, thoroughly. This comes as soon as possible in -# the script to make things like `libtool --version' happen quickly. +# func_check_version_match +# Ensure that we are using m4 macros, and libtool script from the same +# release of libtool. +func_check_version_match () { + if test "$package_revision" != "$macro_revision"; then + if test "$VERSION" != "$macro_version"; then + if test -z "$macro_version"; then + cat >&2 <<_LT_EOF +$progname: Version mismatch error. This is $PACKAGE $VERSION, but the +$progname: definition of this LT_INIT comes from an older release. +$progname: You should recreate aclocal.m4 with macros from $PACKAGE $VERSION +$progname: and run autoconf again. +_LT_EOF + else + cat >&2 <<_LT_EOF +$progname: Version mismatch error. This is $PACKAGE $VERSION, but the +$progname: definition of this LT_INIT comes from $PACKAGE $macro_version. +$progname: You should recreate aclocal.m4 with macros from $PACKAGE $VERSION +$progname: and run autoconf again. +_LT_EOF + fi + else + cat >&2 <<_LT_EOF +$progname: Version mismatch error. This is $PACKAGE $VERSION, revision $package_revision, +$progname: but the definition of this LT_INIT comes from revision $macro_revision. +$progname: You should recreate aclocal.m4 with macros from revision $package_revision +$progname: of $PACKAGE $VERSION and run autoconf again. +_LT_EOF + fi - # Shorthand for --mode=foo, only valid as the first argument - case $1 in - clean|clea|cle|cl) - shift; set dummy --mode clean ${1+"$@"}; shift - ;; - compile|compil|compi|comp|com|co|c) - shift; set dummy --mode compile ${1+"$@"}; shift - ;; - execute|execut|execu|exec|exe|ex|e) - shift; set dummy --mode execute ${1+"$@"}; shift - ;; - finish|finis|fini|fin|fi|f) - shift; set dummy --mode finish ${1+"$@"}; shift - ;; - install|instal|insta|inst|ins|in|i) - shift; set dummy --mode install ${1+"$@"}; shift - ;; - link|lin|li|l) - shift; set dummy --mode link ${1+"$@"}; shift - ;; - uninstall|uninstal|uninsta|uninst|unins|unin|uni|un|u) - shift; set dummy --mode uninstall ${1+"$@"}; shift - ;; - esac + exit $EXIT_MISMATCH + fi +} + + +# Shorthand for --mode=foo, only valid as the first argument +case $1 in +clean|clea|cle|cl) + shift; set dummy --mode clean ${1+"$@"}; shift + ;; +compile|compil|compi|comp|com|co|c) + shift; set dummy --mode compile ${1+"$@"}; shift + ;; +execute|execut|execu|exec|exe|ex|e) + shift; set dummy --mode execute ${1+"$@"}; shift + ;; +finish|finis|fini|fin|fi|f) + shift; set dummy --mode finish ${1+"$@"}; shift + ;; +install|instal|insta|inst|ins|in|i) + shift; set dummy --mode install ${1+"$@"}; shift + ;; +link|lin|li|l) + shift; set dummy --mode link ${1+"$@"}; shift + ;; +uninstall|uninstal|uninsta|uninst|unins|unin|uni|un|u) + shift; set dummy --mode uninstall ${1+"$@"}; shift + ;; +esac - # Parse non-mode specific arguments: - while test "$#" -gt 0; do + + +# Option defaults: +opt_debug=: +opt_dry_run=false +opt_config=false +opt_preserve_dup_deps=false +opt_features=false +opt_finish=false +opt_help=false +opt_help_all=false +opt_silent=: +opt_warning=: +opt_verbose=: +opt_silent=false +opt_verbose=false + + +# Parse options once, thoroughly. This comes as soon as possible in the +# script to make things like `--version' happen as quickly as we can. +{ + # this just eases exit handling + while test $# -gt 0; do opt="$1" shift - case $opt in - --config) func_config ;; - - --debug) preserve_args="$preserve_args $opt" + --debug|-x) opt_debug='set -x' func_echo "enabling shell trace mode" - opt_debug='set -x' $opt_debug ;; - - -dlopen) test "$#" -eq 0 && func_missing_arg "$opt" && break - execute_dlfiles="$execute_dlfiles $1" - shift + --dry-run|--dryrun|-n) + opt_dry_run=: ;; - - --dry-run | -n) opt_dry_run=: ;; - --features) func_features ;; - --finish) mode="finish" ;; - - --mode) test "$#" -eq 0 && func_missing_arg "$opt" && break - case $1 in - # Valid mode arguments: - clean) ;; - compile) ;; - execute) ;; - finish) ;; - install) ;; - link) ;; - relink) ;; - uninstall) ;; - - # Catch anything else as an error - *) func_error "invalid argument for $opt" - exit_cmd=exit - break - ;; - esac - - mode="$1" + --config) + opt_config=: +func_config + ;; + --dlopen|-dlopen) + optarg="$1" + opt_dlopen="${opt_dlopen+$opt_dlopen +}$optarg" shift ;; - --preserve-dup-deps) - opt_duplicate_deps=: ;; - - --quiet|--silent) preserve_args="$preserve_args $opt" - opt_silent=: + opt_preserve_dup_deps=: ;; - - --verbose| -v) preserve_args="$preserve_args $opt" + --features) + opt_features=: +func_features + ;; + --finish) + opt_finish=: +set dummy --mode finish ${1+"$@"}; shift + ;; + --help) + opt_help=: + ;; + --help-all) + opt_help_all=: +opt_help=': help-all' + ;; + --mode) + test $# = 0 && func_missing_arg $opt && break + optarg="$1" + opt_mode="$optarg" +case $optarg in + # Valid mode arguments: + clean|compile|execute|finish|install|link|relink|uninstall) ;; + + # Catch anything else as an error + *) func_error "invalid argument for $opt" + exit_cmd=exit + break + ;; +esac + shift + ;; + --no-silent|--no-quiet) opt_silent=false +func_append preserve_args " $opt" ;; - - --tag) test "$#" -eq 0 && func_missing_arg "$opt" && break - preserve_args="$preserve_args $opt $1" - func_enable_tag "$1" # tagname is set here + --no-warning|--no-warn) + opt_warning=false +func_append preserve_args " $opt" + ;; + --no-verbose) + opt_verbose=false +func_append preserve_args " $opt" + ;; + --silent|--quiet) + opt_silent=: +func_append preserve_args " $opt" + opt_verbose=false + ;; + --verbose|-v) + opt_verbose=: +func_append preserve_args " $opt" +opt_silent=false + ;; + --tag) + test $# = 0 && func_missing_arg $opt && break + optarg="$1" + opt_tag="$optarg" +func_append preserve_args " $opt $optarg" +func_enable_tag "$optarg" shift ;; + -\?|-h) func_usage ;; + --help) func_help ;; + --version) func_version ;; + # Separate optargs to long options: - -dlopen=*|--mode=*|--tag=*) - func_opt_split "$opt" - set dummy "$func_opt_split_opt" "$func_opt_split_arg" ${1+"$@"} + --*=*) + func_split_long_opt "$opt" + set dummy "$func_split_long_opt_name" "$func_split_long_opt_arg" ${1+"$@"} shift ;; - -\?|-h) func_usage ;; - --help) opt_help=: ;; - --version) func_version ;; - - -*) func_fatal_help "unrecognized option \`$opt'" ;; - - *) nonopt="$opt" - break + # Separate non-argument short options: + -\?*|-h*|-n*|-v*) + func_split_short_opt "$opt" + set dummy "$func_split_short_opt_name" "-$func_split_short_opt_arg" ${1+"$@"} + shift ;; + + --) break ;; + -*) func_fatal_help "unrecognized option \`$opt'" ;; + *) set dummy "$opt" ${1+"$@"}; shift; break ;; esac done + # Validate options: + + # save first non-option argument + if test "$#" -gt 0; then + nonopt="$opt" + shift + fi + + # preserve --debug + test "$opt_debug" = : || func_append preserve_args " --debug" case $host in *cygwin* | *mingw* | *pw32* | *cegcc*) @@ -810,82 +1185,44 @@ opt_duplicate_compiler_generated_deps=: ;; *) - opt_duplicate_compiler_generated_deps=$opt_duplicate_deps + opt_duplicate_compiler_generated_deps=$opt_preserve_dup_deps ;; esac - # Having warned about all mis-specified options, bail out if - # anything was wrong. - $exit_cmd $EXIT_FAILURE -} + $opt_help || { + # Sanity checks first: + func_check_version_match -# func_check_version_match -# Ensure that we are using m4 macros, and libtool script from the same -# release of libtool. -func_check_version_match () -{ - if test "$package_revision" != "$macro_revision"; then - if test "$VERSION" != "$macro_version"; then - if test -z "$macro_version"; then - cat >&2 <<_LT_EOF -$progname: Version mismatch error. This is $PACKAGE $VERSION, but the -$progname: definition of this LT_INIT comes from an older release. -$progname: You should recreate aclocal.m4 with macros from $PACKAGE $VERSION -$progname: and run autoconf again. -_LT_EOF - else - cat >&2 <<_LT_EOF -$progname: Version mismatch error. This is $PACKAGE $VERSION, but the -$progname: definition of this LT_INIT comes from $PACKAGE $macro_version. -$progname: You should recreate aclocal.m4 with macros from $PACKAGE $VERSION -$progname: and run autoconf again. -_LT_EOF - fi - else - cat >&2 <<_LT_EOF -$progname: Version mismatch error. This is $PACKAGE $VERSION, revision $package_revision, -$progname: but the definition of this LT_INIT comes from revision $macro_revision. -$progname: You should recreate aclocal.m4 with macros from revision $package_revision -$progname: of $PACKAGE $VERSION and run autoconf again. -_LT_EOF + if test "$build_libtool_libs" != yes && test "$build_old_libs" != yes; then + func_fatal_configuration "not configured to build any kind of library" fi - exit $EXIT_MISMATCH - fi -} - + # Darwin sucks + eval std_shrext=\"$shrext_cmds\" -## ----------- ## -## Main. ## -## ----------- ## - -$opt_help || { - # Sanity checks first: - func_check_version_match - - if test "$build_libtool_libs" != yes && test "$build_old_libs" != yes; then - func_fatal_configuration "not configured to build any kind of library" - fi + # Only execute mode is allowed to have -dlopen flags. + if test -n "$opt_dlopen" && test "$opt_mode" != execute; then + func_error "unrecognized option \`-dlopen'" + $ECHO "$help" 1>&2 + exit $EXIT_FAILURE + fi - test -z "$mode" && func_fatal_error "error: you must specify a MODE." + # Change the help message to a mode-specific one. + generic_help="$help" + help="Try \`$progname --help --mode=$opt_mode' for more information." + } - # Darwin sucks - eval std_shrext=\"$shrext_cmds\" + # Bail if the options were screwed + $exit_cmd $EXIT_FAILURE +} - # Only execute mode is allowed to have -dlopen flags. - if test -n "$execute_dlfiles" && test "$mode" != execute; then - func_error "unrecognized option \`-dlopen'" - $ECHO "$help" 1>&2 - exit $EXIT_FAILURE - fi - # Change the help message to a mode-specific one. - generic_help="$help" - help="Try \`$progname --help --mode=$mode' for more information." -} +## ----------- ## +## Main. ## +## ----------- ## # func_lalib_p file # True iff FILE is a libtool `.la' library or `.lo' object file. @@ -950,12 +1287,9 @@ # temporary ltwrapper_script. func_ltwrapper_scriptname () { - func_ltwrapper_scriptname_result="" - if func_ltwrapper_executable_p "$1"; then - func_dirname_and_basename "$1" "" "." - func_stripname '' '.exe' "$func_basename_result" - func_ltwrapper_scriptname_result="$func_dirname_result/$objdir/${func_stripname_result}_ltshwrapper" - fi + func_dirname_and_basename "$1" "" "." + func_stripname '' '.exe' "$func_basename_result" + func_ltwrapper_scriptname_result="$func_dirname_result/$objdir/${func_stripname_result}_ltshwrapper" } # func_ltwrapper_p file @@ -1001,6 +1335,37 @@ } +# func_resolve_sysroot PATH +# Replace a leading = in PATH with a sysroot. Store the result into +# func_resolve_sysroot_result +func_resolve_sysroot () +{ + func_resolve_sysroot_result=$1 + case $func_resolve_sysroot_result in + =*) + func_stripname '=' '' "$func_resolve_sysroot_result" + func_resolve_sysroot_result=$lt_sysroot$func_stripname_result + ;; + esac +} + +# func_replace_sysroot PATH +# If PATH begins with the sysroot, replace it with = and +# store the result into func_replace_sysroot_result. +func_replace_sysroot () +{ + case "$lt_sysroot:$1" in + ?*:"$lt_sysroot"*) + func_stripname "$lt_sysroot" '' "$1" + func_replace_sysroot_result="=$func_stripname_result" + ;; + *) + # Including no sysroot. + func_replace_sysroot_result=$1 + ;; + esac +} + # func_infer_tag arg # Infer tagged configuration to use if any are available and # if one wasn't chosen via the "--tag" command line option. @@ -1013,13 +1378,15 @@ if test -n "$available_tags" && test -z "$tagname"; then CC_quoted= for arg in $CC; do - func_quote_for_eval "$arg" - CC_quoted="$CC_quoted $func_quote_for_eval_result" + func_append_quoted CC_quoted "$arg" done + CC_expanded=`func_echo_all $CC` + CC_quoted_expanded=`func_echo_all $CC_quoted` case $@ in # Blanks in the command may have been stripped by the calling shell, # but not from the CC environment variable when configure was run. - " $CC "* | "$CC "* | " `$ECHO $CC` "* | "`$ECHO $CC` "* | " $CC_quoted"* | "$CC_quoted "* | " `$ECHO $CC_quoted` "* | "`$ECHO $CC_quoted` "*) ;; + " $CC "* | "$CC "* | " $CC_expanded "* | "$CC_expanded "* | \ + " $CC_quoted"* | "$CC_quoted "* | " $CC_quoted_expanded "* | "$CC_quoted_expanded "*) ;; # Blanks at the start of $base_compile will cause this to fail # if we don't check for them as well. *) @@ -1030,11 +1397,13 @@ CC_quoted= for arg in $CC; do # Double-quote args containing other shell metacharacters. - func_quote_for_eval "$arg" - CC_quoted="$CC_quoted $func_quote_for_eval_result" + func_append_quoted CC_quoted "$arg" done + CC_expanded=`func_echo_all $CC` + CC_quoted_expanded=`func_echo_all $CC_quoted` case "$@ " in - " $CC "* | "$CC "* | " `$ECHO $CC` "* | "`$ECHO $CC` "* | " $CC_quoted"* | "$CC_quoted "* | " `$ECHO $CC_quoted` "* | "`$ECHO $CC_quoted` "*) + " $CC "* | "$CC "* | " $CC_expanded "* | "$CC_expanded "* | \ + " $CC_quoted"* | "$CC_quoted "* | " $CC_quoted_expanded "* | "$CC_quoted_expanded "*) # The compiler in the base compile command matches # the one in the tagged configuration. # Assume this is the tagged configuration we want. @@ -1097,6 +1466,486 @@ } } + +################################################## +# FILE NAME AND PATH CONVERSION HELPER FUNCTIONS # +################################################## + +# func_convert_core_file_wine_to_w32 ARG +# Helper function used by file name conversion functions when $build is *nix, +# and $host is mingw, cygwin, or some other w32 environment. Relies on a +# correctly configured wine environment available, with the winepath program +# in $build's $PATH. +# +# ARG is the $build file name to be converted to w32 format. +# Result is available in $func_convert_core_file_wine_to_w32_result, and will +# be empty on error (or when ARG is empty) +func_convert_core_file_wine_to_w32 () +{ + $opt_debug + func_convert_core_file_wine_to_w32_result="$1" + if test -n "$1"; then + # Unfortunately, winepath does not exit with a non-zero error code, so we + # are forced to check the contents of stdout. On the other hand, if the + # command is not found, the shell will set an exit code of 127 and print + # *an error message* to stdout. So we must check for both error code of + # zero AND non-empty stdout, which explains the odd construction: + func_convert_core_file_wine_to_w32_tmp=`winepath -w "$1" 2>/dev/null` + if test "$?" -eq 0 && test -n "${func_convert_core_file_wine_to_w32_tmp}"; then + func_convert_core_file_wine_to_w32_result=`$ECHO "$func_convert_core_file_wine_to_w32_tmp" | + $SED -e "$lt_sed_naive_backslashify"` + else + func_convert_core_file_wine_to_w32_result= + fi + fi +} +# end: func_convert_core_file_wine_to_w32 + + +# func_convert_core_path_wine_to_w32 ARG +# Helper function used by path conversion functions when $build is *nix, and +# $host is mingw, cygwin, or some other w32 environment. Relies on a correctly +# configured wine environment available, with the winepath program in $build's +# $PATH. Assumes ARG has no leading or trailing path separator characters. +# +# ARG is path to be converted from $build format to win32. +# Result is available in $func_convert_core_path_wine_to_w32_result. +# Unconvertible file (directory) names in ARG are skipped; if no directory names +# are convertible, then the result may be empty. +func_convert_core_path_wine_to_w32 () +{ + $opt_debug + # unfortunately, winepath doesn't convert paths, only file names + func_convert_core_path_wine_to_w32_result="" + if test -n "$1"; then + oldIFS=$IFS + IFS=: + for func_convert_core_path_wine_to_w32_f in $1; do + IFS=$oldIFS + func_convert_core_file_wine_to_w32 "$func_convert_core_path_wine_to_w32_f" + if test -n "$func_convert_core_file_wine_to_w32_result" ; then + if test -z "$func_convert_core_path_wine_to_w32_result"; then + func_convert_core_path_wine_to_w32_result="$func_convert_core_file_wine_to_w32_result" + else + func_append func_convert_core_path_wine_to_w32_result ";$func_convert_core_file_wine_to_w32_result" + fi + fi + done + IFS=$oldIFS + fi +} +# end: func_convert_core_path_wine_to_w32 + + +# func_cygpath ARGS... +# Wrapper around calling the cygpath program via LT_CYGPATH. This is used when +# when (1) $build is *nix and Cygwin is hosted via a wine environment; or (2) +# $build is MSYS and $host is Cygwin, or (3) $build is Cygwin. In case (1) or +# (2), returns the Cygwin file name or path in func_cygpath_result (input +# file name or path is assumed to be in w32 format, as previously converted +# from $build's *nix or MSYS format). In case (3), returns the w32 file name +# or path in func_cygpath_result (input file name or path is assumed to be in +# Cygwin format). Returns an empty string on error. +# +# ARGS are passed to cygpath, with the last one being the file name or path to +# be converted. +# +# Specify the absolute *nix (or w32) name to cygpath in the LT_CYGPATH +# environment variable; do not put it in $PATH. +func_cygpath () +{ + $opt_debug + if test -n "$LT_CYGPATH" && test -f "$LT_CYGPATH"; then + func_cygpath_result=`$LT_CYGPATH "$@" 2>/dev/null` + if test "$?" -ne 0; then + # on failure, ensure result is empty + func_cygpath_result= + fi + else + func_cygpath_result= + func_error "LT_CYGPATH is empty or specifies non-existent file: \`$LT_CYGPATH'" + fi +} +#end: func_cygpath + + +# func_convert_core_msys_to_w32 ARG +# Convert file name or path ARG from MSYS format to w32 format. Return +# result in func_convert_core_msys_to_w32_result. +func_convert_core_msys_to_w32 () +{ + $opt_debug + # awkward: cmd appends spaces to result + func_convert_core_msys_to_w32_result=`( cmd //c echo "$1" ) 2>/dev/null | + $SED -e 's/[ ]*$//' -e "$lt_sed_naive_backslashify"` +} +#end: func_convert_core_msys_to_w32 + + +# func_convert_file_check ARG1 ARG2 +# Verify that ARG1 (a file name in $build format) was converted to $host +# format in ARG2. Otherwise, emit an error message, but continue (resetting +# func_to_host_file_result to ARG1). +func_convert_file_check () +{ + $opt_debug + if test -z "$2" && test -n "$1" ; then + func_error "Could not determine host file name corresponding to" + func_error " \`$1'" + func_error "Continuing, but uninstalled executables may not work." + # Fallback: + func_to_host_file_result="$1" + fi +} +# end func_convert_file_check + + +# func_convert_path_check FROM_PATHSEP TO_PATHSEP FROM_PATH TO_PATH +# Verify that FROM_PATH (a path in $build format) was converted to $host +# format in TO_PATH. Otherwise, emit an error message, but continue, resetting +# func_to_host_file_result to a simplistic fallback value (see below). +func_convert_path_check () +{ + $opt_debug + if test -z "$4" && test -n "$3"; then + func_error "Could not determine the host path corresponding to" + func_error " \`$3'" + func_error "Continuing, but uninstalled executables may not work." + # Fallback. This is a deliberately simplistic "conversion" and + # should not be "improved". See libtool.info. + if test "x$1" != "x$2"; then + lt_replace_pathsep_chars="s|$1|$2|g" + func_to_host_path_result=`echo "$3" | + $SED -e "$lt_replace_pathsep_chars"` + else + func_to_host_path_result="$3" + fi + fi +} +# end func_convert_path_check + + +# func_convert_path_front_back_pathsep FRONTPAT BACKPAT REPL ORIG +# Modifies func_to_host_path_result by prepending REPL if ORIG matches FRONTPAT +# and appending REPL if ORIG matches BACKPAT. +func_convert_path_front_back_pathsep () +{ + $opt_debug + case $4 in + $1 ) func_to_host_path_result="$3$func_to_host_path_result" + ;; + esac + case $4 in + $2 ) func_append func_to_host_path_result "$3" + ;; + esac +} +# end func_convert_path_front_back_pathsep + + +################################################## +# $build to $host FILE NAME CONVERSION FUNCTIONS # +################################################## +# invoked via `$to_host_file_cmd ARG' +# +# In each case, ARG is the path to be converted from $build to $host format. +# Result will be available in $func_to_host_file_result. + + +# func_to_host_file ARG +# Converts the file name ARG from $build format to $host format. Return result +# in func_to_host_file_result. +func_to_host_file () +{ + $opt_debug + $to_host_file_cmd "$1" +} +# end func_to_host_file + + +# func_to_tool_file ARG LAZY +# converts the file name ARG from $build format to toolchain format. Return +# result in func_to_tool_file_result. If the conversion in use is listed +# in (the comma separated) LAZY, no conversion takes place. +func_to_tool_file () +{ + $opt_debug + case ,$2, in + *,"$to_tool_file_cmd",*) + func_to_tool_file_result=$1 + ;; + *) + $to_tool_file_cmd "$1" + func_to_tool_file_result=$func_to_host_file_result + ;; + esac +} +# end func_to_tool_file + + +# func_convert_file_noop ARG +# Copy ARG to func_to_host_file_result. +func_convert_file_noop () +{ + func_to_host_file_result="$1" +} +# end func_convert_file_noop + + +# func_convert_file_msys_to_w32 ARG +# Convert file name ARG from (mingw) MSYS to (mingw) w32 format; automatic +# conversion to w32 is not available inside the cwrapper. Returns result in +# func_to_host_file_result. +func_convert_file_msys_to_w32 () +{ + $opt_debug + func_to_host_file_result="$1" + if test -n "$1"; then + func_convert_core_msys_to_w32 "$1" + func_to_host_file_result="$func_convert_core_msys_to_w32_result" + fi + func_convert_file_check "$1" "$func_to_host_file_result" +} +# end func_convert_file_msys_to_w32 + + +# func_convert_file_cygwin_to_w32 ARG +# Convert file name ARG from Cygwin to w32 format. Returns result in +# func_to_host_file_result. +func_convert_file_cygwin_to_w32 () +{ + $opt_debug + func_to_host_file_result="$1" + if test -n "$1"; then + # because $build is cygwin, we call "the" cygpath in $PATH; no need to use + # LT_CYGPATH in this case. + func_to_host_file_result=`cygpath -m "$1"` + fi + func_convert_file_check "$1" "$func_to_host_file_result" +} +# end func_convert_file_cygwin_to_w32 + + +# func_convert_file_nix_to_w32 ARG +# Convert file name ARG from *nix to w32 format. Requires a wine environment +# and a working winepath. Returns result in func_to_host_file_result. +func_convert_file_nix_to_w32 () +{ + $opt_debug + func_to_host_file_result="$1" + if test -n "$1"; then + func_convert_core_file_wine_to_w32 "$1" + func_to_host_file_result="$func_convert_core_file_wine_to_w32_result" + fi + func_convert_file_check "$1" "$func_to_host_file_result" +} +# end func_convert_file_nix_to_w32 + + +# func_convert_file_msys_to_cygwin ARG +# Convert file name ARG from MSYS to Cygwin format. Requires LT_CYGPATH set. +# Returns result in func_to_host_file_result. +func_convert_file_msys_to_cygwin () +{ + $opt_debug + func_to_host_file_result="$1" + if test -n "$1"; then + func_convert_core_msys_to_w32 "$1" + func_cygpath -u "$func_convert_core_msys_to_w32_result" + func_to_host_file_result="$func_cygpath_result" + fi + func_convert_file_check "$1" "$func_to_host_file_result" +} +# end func_convert_file_msys_to_cygwin + + +# func_convert_file_nix_to_cygwin ARG +# Convert file name ARG from *nix to Cygwin format. Requires Cygwin installed +# in a wine environment, working winepath, and LT_CYGPATH set. Returns result +# in func_to_host_file_result. +func_convert_file_nix_to_cygwin () +{ + $opt_debug + func_to_host_file_result="$1" + if test -n "$1"; then + # convert from *nix to w32, then use cygpath to convert from w32 to cygwin. + func_convert_core_file_wine_to_w32 "$1" + func_cygpath -u "$func_convert_core_file_wine_to_w32_result" + func_to_host_file_result="$func_cygpath_result" + fi + func_convert_file_check "$1" "$func_to_host_file_result" +} +# end func_convert_file_nix_to_cygwin + + +############################################# +# $build to $host PATH CONVERSION FUNCTIONS # +############################################# +# invoked via `$to_host_path_cmd ARG' +# +# In each case, ARG is the path to be converted from $build to $host format. +# The result will be available in $func_to_host_path_result. +# +# Path separators are also converted from $build format to $host format. If +# ARG begins or ends with a path separator character, it is preserved (but +# converted to $host format) on output. +# +# All path conversion functions are named using the following convention: +# file name conversion function : func_convert_file_X_to_Y () +# path conversion function : func_convert_path_X_to_Y () +# where, for any given $build/$host combination the 'X_to_Y' value is the +# same. If conversion functions are added for new $build/$host combinations, +# the two new functions must follow this pattern, or func_init_to_host_path_cmd +# will break. + + +# func_init_to_host_path_cmd +# Ensures that function "pointer" variable $to_host_path_cmd is set to the +# appropriate value, based on the value of $to_host_file_cmd. +to_host_path_cmd= +func_init_to_host_path_cmd () +{ + $opt_debug + if test -z "$to_host_path_cmd"; then + func_stripname 'func_convert_file_' '' "$to_host_file_cmd" + to_host_path_cmd="func_convert_path_${func_stripname_result}" + fi +} + + +# func_to_host_path ARG +# Converts the path ARG from $build format to $host format. Return result +# in func_to_host_path_result. +func_to_host_path () +{ + $opt_debug + func_init_to_host_path_cmd + $to_host_path_cmd "$1" +} +# end func_to_host_path + + +# func_convert_path_noop ARG +# Copy ARG to func_to_host_path_result. +func_convert_path_noop () +{ + func_to_host_path_result="$1" +} +# end func_convert_path_noop + + +# func_convert_path_msys_to_w32 ARG +# Convert path ARG from (mingw) MSYS to (mingw) w32 format; automatic +# conversion to w32 is not available inside the cwrapper. Returns result in +# func_to_host_path_result. +func_convert_path_msys_to_w32 () +{ + $opt_debug + func_to_host_path_result="$1" + if test -n "$1"; then + # Remove leading and trailing path separator characters from ARG. MSYS + # behavior is inconsistent here; cygpath turns them into '.;' and ';.'; + # and winepath ignores them completely. + func_stripname : : "$1" + func_to_host_path_tmp1=$func_stripname_result + func_convert_core_msys_to_w32 "$func_to_host_path_tmp1" + func_to_host_path_result="$func_convert_core_msys_to_w32_result" + func_convert_path_check : ";" \ + "$func_to_host_path_tmp1" "$func_to_host_path_result" + func_convert_path_front_back_pathsep ":*" "*:" ";" "$1" + fi +} +# end func_convert_path_msys_to_w32 + + +# func_convert_path_cygwin_to_w32 ARG +# Convert path ARG from Cygwin to w32 format. Returns result in +# func_to_host_file_result. +func_convert_path_cygwin_to_w32 () +{ + $opt_debug + func_to_host_path_result="$1" + if test -n "$1"; then + # See func_convert_path_msys_to_w32: + func_stripname : : "$1" + func_to_host_path_tmp1=$func_stripname_result + func_to_host_path_result=`cygpath -m -p "$func_to_host_path_tmp1"` + func_convert_path_check : ";" \ + "$func_to_host_path_tmp1" "$func_to_host_path_result" + func_convert_path_front_back_pathsep ":*" "*:" ";" "$1" + fi +} +# end func_convert_path_cygwin_to_w32 + + +# func_convert_path_nix_to_w32 ARG +# Convert path ARG from *nix to w32 format. Requires a wine environment and +# a working winepath. Returns result in func_to_host_file_result. +func_convert_path_nix_to_w32 () +{ + $opt_debug + func_to_host_path_result="$1" + if test -n "$1"; then + # See func_convert_path_msys_to_w32: + func_stripname : : "$1" + func_to_host_path_tmp1=$func_stripname_result + func_convert_core_path_wine_to_w32 "$func_to_host_path_tmp1" + func_to_host_path_result="$func_convert_core_path_wine_to_w32_result" + func_convert_path_check : ";" \ + "$func_to_host_path_tmp1" "$func_to_host_path_result" + func_convert_path_front_back_pathsep ":*" "*:" ";" "$1" + fi +} +# end func_convert_path_nix_to_w32 + + +# func_convert_path_msys_to_cygwin ARG +# Convert path ARG from MSYS to Cygwin format. Requires LT_CYGPATH set. +# Returns result in func_to_host_file_result. +func_convert_path_msys_to_cygwin () +{ + $opt_debug + func_to_host_path_result="$1" + if test -n "$1"; then + # See func_convert_path_msys_to_w32: + func_stripname : : "$1" + func_to_host_path_tmp1=$func_stripname_result + func_convert_core_msys_to_w32 "$func_to_host_path_tmp1" + func_cygpath -u -p "$func_convert_core_msys_to_w32_result" + func_to_host_path_result="$func_cygpath_result" + func_convert_path_check : : \ + "$func_to_host_path_tmp1" "$func_to_host_path_result" + func_convert_path_front_back_pathsep ":*" "*:" : "$1" + fi +} +# end func_convert_path_msys_to_cygwin + + +# func_convert_path_nix_to_cygwin ARG +# Convert path ARG from *nix to Cygwin format. Requires Cygwin installed in a +# a wine environment, working winepath, and LT_CYGPATH set. Returns result in +# func_to_host_file_result. +func_convert_path_nix_to_cygwin () +{ + $opt_debug + func_to_host_path_result="$1" + if test -n "$1"; then + # Remove leading and trailing path separator characters from + # ARG. msys behavior is inconsistent here, cygpath turns them + # into '.;' and ';.', and winepath ignores them completely. + func_stripname : : "$1" + func_to_host_path_tmp1=$func_stripname_result + func_convert_core_path_wine_to_w32 "$func_to_host_path_tmp1" + func_cygpath -u -p "$func_convert_core_path_wine_to_w32_result" + func_to_host_path_result="$func_cygpath_result" + func_convert_path_check : : \ + "$func_to_host_path_tmp1" "$func_to_host_path_result" + func_convert_path_front_back_pathsep ":*" "*:" : "$1" + fi +} +# end func_convert_path_nix_to_cygwin + + # func_mode_compile arg... func_mode_compile () { @@ -1137,12 +1986,12 @@ ;; -pie | -fpie | -fPIE) - pie_flag="$pie_flag $arg" + func_append pie_flag " $arg" continue ;; -shared | -static | -prefer-pic | -prefer-non-pic) - later="$later $arg" + func_append later " $arg" continue ;; @@ -1163,15 +2012,14 @@ save_ifs="$IFS"; IFS=',' for arg in $args; do IFS="$save_ifs" - func_quote_for_eval "$arg" - lastarg="$lastarg $func_quote_for_eval_result" + func_append_quoted lastarg "$arg" done IFS="$save_ifs" func_stripname ' ' '' "$lastarg" lastarg=$func_stripname_result # Add the arguments to base_compile. - base_compile="$base_compile $lastarg" + func_append base_compile " $lastarg" continue ;; @@ -1187,8 +2035,7 @@ esac # case $arg_mode # Aesthetically quote the previous argument. - func_quote_for_eval "$lastarg" - base_compile="$base_compile $func_quote_for_eval_result" + func_append_quoted base_compile "$lastarg" done # for arg case $arg_mode in @@ -1213,7 +2060,7 @@ *.[cCFSifmso] | \ *.ada | *.adb | *.ads | *.asm | \ *.c++ | *.cc | *.ii | *.class | *.cpp | *.cxx | \ - *.[fF][09]? | *.for | *.java | *.obj | *.sx) + *.[fF][09]? | *.for | *.java | *.go | *.obj | *.sx | *.cu | *.cup) func_xform "$libobj" libobj=$func_xform_result ;; @@ -1288,7 +2135,7 @@ # Calculate the filename of the output object if compiler does # not support -o with -c if test "$compiler_c_o" = no; then - output_obj=`$ECHO "X$srcfile" | $Xsed -e 's%^.*/%%' -e 's%\.[^.]*$%%'`.${objext} + output_obj=`$ECHO "$srcfile" | $SED 's%^.*/%%; s%\.[^.]*$%%'`.${objext} lockfile="$output_obj.lock" else output_obj= @@ -1319,17 +2166,16 @@ $opt_dry_run || $RM $removelist exit $EXIT_FAILURE fi - removelist="$removelist $output_obj" + func_append removelist " $output_obj" $ECHO "$srcfile" > "$lockfile" fi $opt_dry_run || $RM $removelist - removelist="$removelist $lockfile" + func_append removelist " $lockfile" trap '$opt_dry_run || $RM $removelist; exit $EXIT_FAILURE' 1 2 15 - if test -n "$fix_srcfile_path"; then - eval srcfile=\"$fix_srcfile_path\" - fi + func_to_tool_file "$srcfile" func_convert_file_msys_to_w32 + srcfile=$func_to_tool_file_result func_quote_for_eval "$srcfile" qsrcfile=$func_quote_for_eval_result @@ -1349,7 +2195,7 @@ if test -z "$output_obj"; then # Place PIC objects in $objdir - command="$command -o $lobj" + func_append command " -o $lobj" fi func_show_eval_locale "$command" \ @@ -1396,11 +2242,11 @@ command="$base_compile $qsrcfile $pic_flag" fi if test "$compiler_c_o" = yes; then - command="$command -o $obj" + func_append command " -o $obj" fi # Suppress compiler output if we already did a PIC compilation. - command="$command$suppress_output" + func_append command "$suppress_output" func_show_eval_locale "$command" \ '$opt_dry_run || $RM $removelist; exit $EXIT_FAILURE' @@ -1445,13 +2291,13 @@ } $opt_help || { -test "$mode" = compile && func_mode_compile ${1+"$@"} + test "$opt_mode" = compile && func_mode_compile ${1+"$@"} } func_mode_help () { # We need to display help for each of the modes. - case $mode in + case $opt_mode in "") # Generic help is extracted from the usage comments # at the start of this file. @@ -1482,10 +2328,11 @@ -o OUTPUT-FILE set the output file name to OUTPUT-FILE -no-suppress do not suppress compiler output for multiple passes - -prefer-pic try to building PIC objects only - -prefer-non-pic try to building non-PIC objects only + -prefer-pic try to build PIC objects only + -prefer-non-pic try to build non-PIC objects only -shared do not build a \`.o' file suitable for static linking -static only build a \`.o' file suitable for static linking + -Wc,FLAG pass FLAG directly to the compiler COMPILE-COMMAND is a command to be used in creating a \`standard' object file from the given SOURCEFILE. @@ -1538,7 +2385,7 @@ The following components of INSTALL-COMMAND are treated specially: - -inst-prefix PREFIX-DIR Use PREFIX-DIR as a staging area for installation + -inst-prefix-dir PREFIX-DIR Use PREFIX-DIR as a staging area for installation The rest of the components are interpreted as arguments to that command (only BSD-compatible install options are recognized)." @@ -1558,6 +2405,8 @@ -all-static do not do any dynamic linking at all -avoid-version do not add a version suffix if possible + -bindir BINDIR specify path to binaries directory (for systems where + libraries must be found in the PATH setting at runtime) -dlopen FILE \`-dlpreopen' FILE if it cannot be dlopened at runtime -dlpreopen FILE link in FILE and add its symbols to lt_preloaded_symbols -export-dynamic allow symbols from OUTPUT-FILE to be resolved with dlsym(3) @@ -1586,6 +2435,11 @@ -version-info CURRENT[:REVISION[:AGE]] specify library version info [each variable defaults to 0] -weak LIBNAME declare that the target provides the LIBNAME interface + -Wc,FLAG + -Xcompiler FLAG pass linker-specific FLAG directly to the compiler + -Wl,FLAG + -Xlinker FLAG pass linker-specific FLAG directly to the linker + -XCClinker FLAG pass link-specific FLAG to the compiler driver (CC) All other options (arguments beginning with \`-') are ignored. @@ -1619,18 +2473,44 @@ ;; *) - func_fatal_help "invalid operation mode \`$mode'" + func_fatal_help "invalid operation mode \`$opt_mode'" ;; esac - $ECHO + echo $ECHO "Try \`$progname --help' for more information about other modes." - - exit $? } - # Now that we've collected a possible --mode arg, show help if necessary - $opt_help && func_mode_help +# Now that we've collected a possible --mode arg, show help if necessary +if $opt_help; then + if test "$opt_help" = :; then + func_mode_help + else + { + func_help noexit + for opt_mode in compile link execute install finish uninstall clean; do + func_mode_help + done + } | sed -n '1p; 2,$s/^Usage:/ or: /p' + { + func_help noexit + for opt_mode in compile link execute install finish uninstall clean; do + echo + func_mode_help + done + } | + sed '1d + /^When reporting/,/^Report/{ + H + d + } + $x + /information about other modes/d + /more detailed .*MODE/d + s/^Usage:.*--mode=\([^ ]*\) .*/Description of \1 mode:/' + fi + exit $? +fi # func_mode_execute arg... @@ -1643,13 +2523,16 @@ func_fatal_help "you must specify a COMMAND" # Handle -dlopen flags immediately. - for file in $execute_dlfiles; do + for file in $opt_dlopen; do test -f "$file" \ || func_fatal_help "\`$file' is not a file" dir= case $file in *.la) + func_resolve_sysroot "$file" + file=$func_resolve_sysroot_result + # Check to see that this really is a libtool archive. func_lalib_unsafe_p "$file" \ || func_fatal_help "\`$lib' is not a valid libtool archive" @@ -1671,7 +2554,7 @@ dir="$func_dirname_result" if test -f "$dir/$objdir/$dlname"; then - dir="$dir/$objdir" + func_append dir "/$objdir" else if test ! -f "$dir/$dlname"; then func_fatal_error "cannot find \`$dlname' in \`$dir' or \`$dir/$objdir'" @@ -1712,7 +2595,7 @@ for file do case $file in - -*) ;; + -* | *.la | *.lo ) ;; *) # Do a test to see if this is really a libtool program. if func_ltwrapper_script_p "$file"; then @@ -1728,8 +2611,7 @@ ;; esac # Quote arguments (to preserve shell metacharacters). - func_quote_for_eval "$file" - args="$args $func_quote_for_eval_result" + func_append_quoted args "$file" done if test "X$opt_dry_run" = Xfalse; then @@ -1754,29 +2636,66 @@ # Display what would be done. if test -n "$shlibpath_var"; then eval "\$ECHO \"\$shlibpath_var=\$$shlibpath_var\"" - $ECHO "export $shlibpath_var" + echo "export $shlibpath_var" fi $ECHO "$cmd$args" exit $EXIT_SUCCESS fi } -test "$mode" = execute && func_mode_execute ${1+"$@"} +test "$opt_mode" = execute && func_mode_execute ${1+"$@"} + + +# func_mode_finish arg... +func_mode_finish () +{ + $opt_debug + libs= + libdirs= + admincmds= + + for opt in "$nonopt" ${1+"$@"} + do + if test -d "$opt"; then + func_append libdirs " $opt" + + elif test -f "$opt"; then + if func_lalib_unsafe_p "$opt"; then + func_append libs " $opt" + else + func_warning "\`$opt' is not a valid libtool archive" + fi + + else + func_fatal_error "invalid argument \`$opt'" + fi + done + if test -n "$libs"; then + if test -n "$lt_sysroot"; then + sysroot_regex=`$ECHO "$lt_sysroot" | $SED "$sed_make_literal_regex"` + sysroot_cmd="s/\([ ']\)$sysroot_regex/\1/g;" + else + sysroot_cmd= + fi -# func_mode_finish arg... -func_mode_finish () -{ - $opt_debug - libdirs="$nonopt" - admincmds= + # Remove sysroot references + if $opt_dry_run; then + for lib in $libs; do + echo "removing references to $lt_sysroot and \`=' prefixes from $lib" + done + else + tmpdir=`func_mktempdir` + for lib in $libs; do + sed -e "${sysroot_cmd} s/\([ ']-[LR]\)=/\1/g; s/\([ ']\)=/\1/g" $lib \ + > $tmpdir/tmp-la + mv -f $tmpdir/tmp-la $lib + done + ${RM}r "$tmpdir" + fi + fi if test -n "$finish_cmds$finish_eval" && test -n "$libdirs"; then - for dir - do - libdirs="$libdirs $dir" - done - for libdir in $libdirs; do if test -n "$finish_cmds"; then # Do each command in the finish commands. @@ -1786,7 +2705,7 @@ if test -n "$finish_eval"; then # Do the single finish_eval. eval cmds=\"$finish_eval\" - $opt_dry_run || eval "$cmds" || admincmds="$admincmds + $opt_dry_run || eval "$cmds" || func_append admincmds " $cmds" fi done @@ -1795,53 +2714,55 @@ # Exit here if they wanted silent mode. $opt_silent && exit $EXIT_SUCCESS - $ECHO "X----------------------------------------------------------------------" | $Xsed - $ECHO "Libraries have been installed in:" - for libdir in $libdirs; do - $ECHO " $libdir" - done - $ECHO - $ECHO "If you ever happen to want to link against installed libraries" - $ECHO "in a given directory, LIBDIR, you must either use libtool, and" - $ECHO "specify the full pathname of the library, or use the \`-LLIBDIR'" - $ECHO "flag during linking and do at least one of the following:" - if test -n "$shlibpath_var"; then - $ECHO " - add LIBDIR to the \`$shlibpath_var' environment variable" - $ECHO " during execution" - fi - if test -n "$runpath_var"; then - $ECHO " - add LIBDIR to the \`$runpath_var' environment variable" - $ECHO " during linking" - fi - if test -n "$hardcode_libdir_flag_spec"; then - libdir=LIBDIR - eval flag=\"$hardcode_libdir_flag_spec\" + if test -n "$finish_cmds$finish_eval" && test -n "$libdirs"; then + echo "----------------------------------------------------------------------" + echo "Libraries have been installed in:" + for libdir in $libdirs; do + $ECHO " $libdir" + done + echo + echo "If you ever happen to want to link against installed libraries" + echo "in a given directory, LIBDIR, you must either use libtool, and" + echo "specify the full pathname of the library, or use the \`-LLIBDIR'" + echo "flag during linking and do at least one of the following:" + if test -n "$shlibpath_var"; then + echo " - add LIBDIR to the \`$shlibpath_var' environment variable" + echo " during execution" + fi + if test -n "$runpath_var"; then + echo " - add LIBDIR to the \`$runpath_var' environment variable" + echo " during linking" + fi + if test -n "$hardcode_libdir_flag_spec"; then + libdir=LIBDIR + eval flag=\"$hardcode_libdir_flag_spec\" - $ECHO " - use the \`$flag' linker flag" - fi - if test -n "$admincmds"; then - $ECHO " - have your system administrator run these commands:$admincmds" - fi - if test -f /etc/ld.so.conf; then - $ECHO " - have your system administrator add LIBDIR to \`/etc/ld.so.conf'" - fi - $ECHO + $ECHO " - use the \`$flag' linker flag" + fi + if test -n "$admincmds"; then + $ECHO " - have your system administrator run these commands:$admincmds" + fi + if test -f /etc/ld.so.conf; then + echo " - have your system administrator add LIBDIR to \`/etc/ld.so.conf'" + fi + echo - $ECHO "See any operating system documentation about shared libraries for" - case $host in - solaris2.[6789]|solaris2.1[0-9]) - $ECHO "more information, such as the ld(1), crle(1) and ld.so(8) manual" - $ECHO "pages." - ;; - *) - $ECHO "more information, such as the ld(1) and ld.so(8) manual pages." - ;; - esac - $ECHO "X----------------------------------------------------------------------" | $Xsed + echo "See any operating system documentation about shared libraries for" + case $host in + solaris2.[6789]|solaris2.1[0-9]) + echo "more information, such as the ld(1), crle(1) and ld.so(8) manual" + echo "pages." + ;; + *) + echo "more information, such as the ld(1) and ld.so(8) manual pages." + ;; + esac + echo "----------------------------------------------------------------------" + fi exit $EXIT_SUCCESS } -test "$mode" = finish && func_mode_finish ${1+"$@"} +test "$opt_mode" = finish && func_mode_finish ${1+"$@"} # func_mode_install arg... @@ -1852,7 +2773,7 @@ # install_prog (especially on Windows NT). if test "$nonopt" = "$SHELL" || test "$nonopt" = /bin/sh || # Allow the use of GNU shtool's install command. - $ECHO "X$nonopt" | $GREP shtool >/dev/null; then + case $nonopt in *shtool*) :;; *) false;; esac; then # Aesthetically quote it. func_quote_for_eval "$nonopt" install_prog="$func_quote_for_eval_result " @@ -1866,7 +2787,12 @@ # The real first argument should be the name of the installation program. # Aesthetically quote it. func_quote_for_eval "$arg" - install_prog="$install_prog$func_quote_for_eval_result" + func_append install_prog "$func_quote_for_eval_result" + install_shared_prog=$install_prog + case " $install_prog " in + *[\\\ /]cp\ *) install_cp=: ;; + *) install_cp=false ;; + esac # We need to accept at least all the BSD install flags. dest= @@ -1876,10 +2802,12 @@ install_type= isdir=no stripme= + no_mode=: for arg do + arg2= if test -n "$dest"; then - files="$files $dest" + func_append files " $dest" dest=$arg continue fi @@ -1887,10 +2815,9 @@ case $arg in -d) isdir=yes ;; -f) - case " $install_prog " in - *[\\\ /]cp\ *) ;; - *) prev=$arg ;; - esac + if $install_cp; then :; else + prev=$arg + fi ;; -g | -m | -o) prev=$arg @@ -1904,6 +2831,10 @@ *) # If the previous option needed an argument, then skip it. if test -n "$prev"; then + if test "x$prev" = x-m && test -n "$install_override_mode"; then + arg2=$install_override_mode + no_mode=false + fi prev= else dest=$arg @@ -1914,7 +2845,11 @@ # Aesthetically quote the argument. func_quote_for_eval "$arg" - install_prog="$install_prog $func_quote_for_eval_result" + func_append install_prog " $func_quote_for_eval_result" + if test -n "$arg2"; then + func_quote_for_eval "$arg2" + fi + func_append install_shared_prog " $func_quote_for_eval_result" done test -z "$install_prog" && \ @@ -1923,6 +2858,13 @@ test -n "$prev" && \ func_fatal_help "the \`$prev' option requires an argument" + if test -n "$install_override_mode" && $no_mode; then + if $install_cp; then :; else + func_quote_for_eval "$install_override_mode" + func_append install_shared_prog " -m $func_quote_for_eval_result" + fi + fi + if test -z "$files"; then if test -z "$dest"; then func_fatal_help "no file or destination specified" @@ -1977,10 +2919,13 @@ case $file in *.$libext) # Do the static libraries later. - staticlibs="$staticlibs $file" + func_append staticlibs " $file" ;; *.la) + func_resolve_sysroot "$file" + file=$func_resolve_sysroot_result + # Check to see that this really is a libtool archive. func_lalib_unsafe_p "$file" \ || func_fatal_help "\`$file' is not a valid libtool archive" @@ -1994,23 +2939,23 @@ if test "X$destdir" = "X$libdir"; then case "$current_libdirs " in *" $libdir "*) ;; - *) current_libdirs="$current_libdirs $libdir" ;; + *) func_append current_libdirs " $libdir" ;; esac else # Note the libdir as a future libdir. case "$future_libdirs " in *" $libdir "*) ;; - *) future_libdirs="$future_libdirs $libdir" ;; + *) func_append future_libdirs " $libdir" ;; esac fi func_dirname "$file" "/" "" dir="$func_dirname_result" - dir="$dir$objdir" + func_append dir "$objdir" if test -n "$relink_command"; then # Determine the prefix the user has applied to our future dir. - inst_prefix_dir=`$ECHO "X$destdir" | $Xsed -e "s%$libdir\$%%"` + inst_prefix_dir=`$ECHO "$destdir" | $SED -e "s%$libdir\$%%"` # Don't allow the user to place us outside of our expected # location b/c this prevents finding dependent libraries that @@ -2023,9 +2968,9 @@ if test -n "$inst_prefix_dir"; then # Stick the inst_prefix_dir data into the link command. - relink_command=`$ECHO "X$relink_command" | $Xsed -e "s%@inst_prefix_dir@%-inst-prefix-dir $inst_prefix_dir%"` + relink_command=`$ECHO "$relink_command" | $SED "s%@inst_prefix_dir@%-inst-prefix-dir $inst_prefix_dir%"` else - relink_command=`$ECHO "X$relink_command" | $Xsed -e "s%@inst_prefix_dir@%%"` + relink_command=`$ECHO "$relink_command" | $SED "s%@inst_prefix_dir@%%"` fi func_warning "relinking \`$file'" @@ -2043,7 +2988,7 @@ test -n "$relink_command" && srcname="$realname"T # Install the shared library and build the symlinks. - func_show_eval "$install_prog $dir/$srcname $destdir/$realname" \ + func_show_eval "$install_shared_prog $dir/$srcname $destdir/$realname" \ 'exit $?' tstripme="$stripme" case $host_os in @@ -2083,7 +3028,7 @@ func_show_eval "$install_prog $instname $destdir/$name" 'exit $?' # Maybe install the static library, too. - test -n "$old_library" && staticlibs="$staticlibs $dir/$old_library" + test -n "$old_library" && func_append staticlibs " $dir/$old_library" ;; *.lo) @@ -2183,7 +3128,7 @@ if test -f "$lib"; then func_source "$lib" fi - libfile="$libdir/"`$ECHO "X$lib" | $Xsed -e 's%^.*/%%g'` ### testsuite: skip nested quoting test + libfile="$libdir/"`$ECHO "$lib" | $SED 's%^.*/%%g'` ### testsuite: skip nested quoting test if test -n "$libdir" && test ! -f "$libfile"; then func_warning "\`$lib' has not been installed in \`$libdir'" finalize=no @@ -2202,7 +3147,7 @@ file="$func_basename_result" outputname="$tmpdir/$file" # Replace the output file specification. - relink_command=`$ECHO "X$relink_command" | $Xsed -e 's%@OUTPUT@%'"$outputname"'%g'` + relink_command=`$ECHO "$relink_command" | $SED 's%@OUTPUT@%'"$outputname"'%g'` $opt_silent || { func_quote_for_expand "$relink_command" @@ -2221,7 +3166,7 @@ } else # Install the binary that we compiled earlier. - file=`$ECHO "X$file$stripped_ext" | $Xsed -e "s%\([^/]*\)$%$objdir/\1%"` + file=`$ECHO "$file$stripped_ext" | $SED "s%\([^/]*\)$%$objdir/\1%"` fi fi @@ -2257,11 +3202,13 @@ # Set up the ranlib parameters. oldlib="$destdir/$name" + func_to_tool_file "$oldlib" func_convert_file_msys_to_w32 + tool_oldlib=$func_to_tool_file_result func_show_eval "$install_prog \$file \$oldlib" 'exit $?' if test -n "$stripme" && test -n "$old_striplib"; then - func_show_eval "$old_striplib $oldlib" 'exit $?' + func_show_eval "$old_striplib $tool_oldlib" 'exit $?' fi # Do each command in the postinstall commands. @@ -2280,7 +3227,7 @@ fi } -test "$mode" = install && func_mode_install ${1+"$@"} +test "$opt_mode" = install && func_mode_install ${1+"$@"} # func_generate_dlsyms outputname originator pic_p @@ -2323,6 +3270,22 @@ extern \"C\" { #endif +#if defined(__GNUC__) && (((__GNUC__ == 4) && (__GNUC_MINOR__ >= 4)) || (__GNUC__ > 4)) +#pragma GCC diagnostic ignored \"-Wstrict-prototypes\" +#endif + +/* Keep this code in sync between libtool.m4, ltmain, lt_system.h, and tests. */ +#if defined(_WIN32) || defined(__CYGWIN__) || defined(_WIN32_WCE) +/* DATA imports from DLLs on WIN32 con't be const, because runtime + relocations are performed -- see ld's documentation on pseudo-relocs. */ +# define LT_DLSYM_CONST +#elif defined(__osf__) +/* This system does not cope well with relocations in const data. */ +# define LT_DLSYM_CONST +#else +# define LT_DLSYM_CONST const +#endif + /* External symbol declarations for the compiler. */\ " @@ -2332,10 +3295,11 @@ $opt_dry_run || echo ': @PROGRAM@ ' > "$nlist" # Add our own program objects to the symbol list. - progfiles=`$ECHO "X$objs$old_deplibs" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP` + progfiles=`$ECHO "$objs$old_deplibs" | $SP2NL | $SED "$lo2o" | $NL2SP` for progfile in $progfiles; do - func_verbose "extracting global C symbols from \`$progfile'" - $opt_dry_run || eval "$NM $progfile | $global_symbol_pipe >> '$nlist'" + func_to_tool_file "$progfile" func_convert_file_msys_to_w32 + func_verbose "extracting global C symbols from \`$func_to_tool_file_result'" + $opt_dry_run || eval "$NM $func_to_tool_file_result | $global_symbol_pipe >> '$nlist'" done if test -n "$exclude_expsyms"; then @@ -2371,7 +3335,7 @@ eval '$GREP -f "$output_objdir/$outputname.exp" < "$nlist" > "$nlist"T' eval '$MV "$nlist"T "$nlist"' case $host in - *cygwin | *mingw* | *cegcc* ) + *cygwin* | *mingw* | *cegcc* ) eval "echo EXPORTS "'> "$output_objdir/$outputname.def"' eval 'cat "$nlist" >> "$output_objdir/$outputname.def"' ;; @@ -2384,10 +3348,52 @@ func_verbose "extracting global C symbols from \`$dlprefile'" func_basename "$dlprefile" name="$func_basename_result" - $opt_dry_run || { - eval '$ECHO ": $name " >> "$nlist"' - eval "$NM $dlprefile 2>/dev/null | $global_symbol_pipe >> '$nlist'" - } + case $host in + *cygwin* | *mingw* | *cegcc* ) + # if an import library, we need to obtain dlname + if func_win32_import_lib_p "$dlprefile"; then + func_tr_sh "$dlprefile" + eval "curr_lafile=\$libfile_$func_tr_sh_result" + dlprefile_dlbasename="" + if test -n "$curr_lafile" && func_lalib_p "$curr_lafile"; then + # Use subshell, to avoid clobbering current variable values + dlprefile_dlname=`source "$curr_lafile" && echo "$dlname"` + if test -n "$dlprefile_dlname" ; then + func_basename "$dlprefile_dlname" + dlprefile_dlbasename="$func_basename_result" + else + # no lafile. user explicitly requested -dlpreopen . + $sharedlib_from_linklib_cmd "$dlprefile" + dlprefile_dlbasename=$sharedlib_from_linklib_result + fi + fi + $opt_dry_run || { + if test -n "$dlprefile_dlbasename" ; then + eval '$ECHO ": $dlprefile_dlbasename" >> "$nlist"' + else + func_warning "Could not compute DLL name from $name" + eval '$ECHO ": $name " >> "$nlist"' + fi + func_to_tool_file "$dlprefile" func_convert_file_msys_to_w32 + eval "$NM \"$func_to_tool_file_result\" 2>/dev/null | $global_symbol_pipe | + $SED -e '/I __imp/d' -e 's/I __nm_/D /;s/_nm__//' >> '$nlist'" + } + else # not an import lib + $opt_dry_run || { + eval '$ECHO ": $name " >> "$nlist"' + func_to_tool_file "$dlprefile" func_convert_file_msys_to_w32 + eval "$NM \"$func_to_tool_file_result\" 2>/dev/null | $global_symbol_pipe >> '$nlist'" + } + fi + ;; + *) + $opt_dry_run || { + eval '$ECHO ": $name " >> "$nlist"' + func_to_tool_file "$dlprefile" func_convert_file_msys_to_w32 + eval "$NM \"$func_to_tool_file_result\" 2>/dev/null | $global_symbol_pipe >> '$nlist'" + } + ;; + esac done $opt_dry_run || { @@ -2415,36 +3421,19 @@ if test -f "$nlist"S; then eval "$global_symbol_to_cdecl"' < "$nlist"S >> "$output_objdir/$my_dlsyms"' else - $ECHO '/* NONE */' >> "$output_objdir/$my_dlsyms" + echo '/* NONE */' >> "$output_objdir/$my_dlsyms" fi - $ECHO >> "$output_objdir/$my_dlsyms" "\ + echo >> "$output_objdir/$my_dlsyms" "\ /* The mapping between symbol names and symbols. */ typedef struct { const char *name; void *address; } lt_dlsymlist; -" - case $host in - *cygwin* | *mingw* | *cegcc* ) - $ECHO >> "$output_objdir/$my_dlsyms" "\ -/* DATA imports from DLLs on WIN32 con't be const, because - runtime relocations are performed -- see ld's documentation - on pseudo-relocs. */" - lt_dlsym_const= ;; - *osf5*) - echo >> "$output_objdir/$my_dlsyms" "\ -/* This system does not cope well with relocations in const data */" - lt_dlsym_const= ;; - *) - lt_dlsym_const=const ;; - esac - - $ECHO >> "$output_objdir/$my_dlsyms" "\ -extern $lt_dlsym_const lt_dlsymlist +extern LT_DLSYM_CONST lt_dlsymlist lt_${my_prefix}_LTX_preloaded_symbols[]; -$lt_dlsym_const lt_dlsymlist +LT_DLSYM_CONST lt_dlsymlist lt_${my_prefix}_LTX_preloaded_symbols[] = {\ { \"$my_originator\", (void *) 0 }," @@ -2457,7 +3446,7 @@ eval "$global_symbol_to_c_name_address_lib_prefix" < "$nlist" >> "$output_objdir/$my_dlsyms" ;; esac - $ECHO >> "$output_objdir/$my_dlsyms" "\ + echo >> "$output_objdir/$my_dlsyms" "\ {0, (void *) 0} }; @@ -2484,7 +3473,7 @@ # linked before any other PIC object. But we must not use # pic_flag when linking with -static. The problem exists in # FreeBSD 2.2.6 and is fixed in FreeBSD 3.1. - *-*-freebsd2*|*-*-freebsd3.0*|*-*-freebsdelf3.0*) + *-*-freebsd2.*|*-*-freebsd3.0*|*-*-freebsdelf3.0*) pic_flag_for_symtable=" $pic_flag -DFREEBSD_WORKAROUND" ;; *-*-hpux*) pic_flag_for_symtable=" $pic_flag" ;; @@ -2500,7 +3489,7 @@ for arg in $LTCFLAGS; do case $arg in -pie | -fpie | -fPIE) ;; - *) symtab_cflags="$symtab_cflags $arg" ;; + *) func_append symtab_cflags " $arg" ;; esac done @@ -2515,16 +3504,16 @@ case $host in *cygwin* | *mingw* | *cegcc* ) if test -f "$output_objdir/$my_outputname.def"; then - compile_command=`$ECHO "X$compile_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/$my_outputname.def $symfileobj%"` - finalize_command=`$ECHO "X$finalize_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/$my_outputname.def $symfileobj%"` + compile_command=`$ECHO "$compile_command" | $SED "s%@SYMFILE@%$output_objdir/$my_outputname.def $symfileobj%"` + finalize_command=`$ECHO "$finalize_command" | $SED "s%@SYMFILE@%$output_objdir/$my_outputname.def $symfileobj%"` else - compile_command=`$ECHO "X$compile_command" | $Xsed -e "s%@SYMFILE@%$symfileobj%"` - finalize_command=`$ECHO "X$finalize_command" | $Xsed -e "s%@SYMFILE@%$symfileobj%"` + compile_command=`$ECHO "$compile_command" | $SED "s%@SYMFILE@%$symfileobj%"` + finalize_command=`$ECHO "$finalize_command" | $SED "s%@SYMFILE@%$symfileobj%"` fi ;; *) - compile_command=`$ECHO "X$compile_command" | $Xsed -e "s%@SYMFILE@%$symfileobj%"` - finalize_command=`$ECHO "X$finalize_command" | $Xsed -e "s%@SYMFILE@%$symfileobj%"` + compile_command=`$ECHO "$compile_command" | $SED "s%@SYMFILE@%$symfileobj%"` + finalize_command=`$ECHO "$finalize_command" | $SED "s%@SYMFILE@%$symfileobj%"` ;; esac ;; @@ -2538,8 +3527,8 @@ # really was required. # Nullify the symbol file. - compile_command=`$ECHO "X$compile_command" | $Xsed -e "s% @SYMFILE@%%"` - finalize_command=`$ECHO "X$finalize_command" | $Xsed -e "s% @SYMFILE@%%"` + compile_command=`$ECHO "$compile_command" | $SED "s% @SYMFILE@%%"` + finalize_command=`$ECHO "$finalize_command" | $SED "s% @SYMFILE@%%"` fi } @@ -2549,6 +3538,7 @@ # Need a lot of goo to handle *both* DLLs and import libs # Has to be a shell function in order to 'eat' the argument # that is supplied when $file_magic_command is called. +# Despite the name, also deal with 64 bit binaries. func_win32_libid () { $opt_debug @@ -2559,9 +3549,11 @@ win32_libid_type="x86 archive import" ;; *ar\ archive*) # could be an import, or static + # Keep the egrep pattern in sync with the one in _LT_CHECK_MAGIC_METHOD. if eval $OBJDUMP -f $1 | $SED -e '10q' 2>/dev/null | - $EGREP 'file format pe-i386(.*architecture: i386)?' >/dev/null ; then - win32_nmres=`eval $NM -f posix -A $1 | + $EGREP 'file format (pei*-i386(.*architecture: i386)?|pe-arm-wince|pe-x86-64)' >/dev/null; then + func_to_tool_file "$1" func_convert_file_msys_to_w32 + win32_nmres=`eval $NM -f posix -A \"$func_to_tool_file_result\" | $SED -n -e ' 1,100{ / I /{ @@ -2590,6 +3582,131 @@ $ECHO "$win32_libid_type" } +# func_cygming_dll_for_implib ARG +# +# Platform-specific function to extract the +# name of the DLL associated with the specified +# import library ARG. +# Invoked by eval'ing the libtool variable +# $sharedlib_from_linklib_cmd +# Result is available in the variable +# $sharedlib_from_linklib_result +func_cygming_dll_for_implib () +{ + $opt_debug + sharedlib_from_linklib_result=`$DLLTOOL --identify-strict --identify "$1"` +} + +# func_cygming_dll_for_implib_fallback_core SECTION_NAME LIBNAMEs +# +# The is the core of a fallback implementation of a +# platform-specific function to extract the name of the +# DLL associated with the specified import library LIBNAME. +# +# SECTION_NAME is either .idata$6 or .idata$7, depending +# on the platform and compiler that created the implib. +# +# Echos the name of the DLL associated with the +# specified import library. +func_cygming_dll_for_implib_fallback_core () +{ + $opt_debug + match_literal=`$ECHO "$1" | $SED "$sed_make_literal_regex"` + $OBJDUMP -s --section "$1" "$2" 2>/dev/null | + $SED '/^Contents of section '"$match_literal"':/{ + # Place marker at beginning of archive member dllname section + s/.*/====MARK====/ + p + d + } + # These lines can sometimes be longer than 43 characters, but + # are always uninteresting + /:[ ]*file format pe[i]\{,1\}-/d + /^In archive [^:]*:/d + # Ensure marker is printed + /^====MARK====/p + # Remove all lines with less than 43 characters + /^.\{43\}/!d + # From remaining lines, remove first 43 characters + s/^.\{43\}//' | + $SED -n ' + # Join marker and all lines until next marker into a single line + /^====MARK====/ b para + H + $ b para + b + :para + x + s/\n//g + # Remove the marker + s/^====MARK====// + # Remove trailing dots and whitespace + s/[\. \t]*$// + # Print + /./p' | + # we now have a list, one entry per line, of the stringified + # contents of the appropriate section of all members of the + # archive which possess that section. Heuristic: eliminate + # all those which have a first or second character that is + # a '.' (that is, objdump's representation of an unprintable + # character.) This should work for all archives with less than + # 0x302f exports -- but will fail for DLLs whose name actually + # begins with a literal '.' or a single character followed by + # a '.'. + # + # Of those that remain, print the first one. + $SED -e '/^\./d;/^.\./d;q' +} + +# func_cygming_gnu_implib_p ARG +# This predicate returns with zero status (TRUE) if +# ARG is a GNU/binutils-style import library. Returns +# with nonzero status (FALSE) otherwise. +func_cygming_gnu_implib_p () +{ + $opt_debug + func_to_tool_file "$1" func_convert_file_msys_to_w32 + func_cygming_gnu_implib_tmp=`$NM "$func_to_tool_file_result" | eval "$global_symbol_pipe" | $EGREP ' (_head_[A-Za-z0-9_]+_[ad]l*|[A-Za-z0-9_]+_[ad]l*_iname)$'` + test -n "$func_cygming_gnu_implib_tmp" +} + +# func_cygming_ms_implib_p ARG +# This predicate returns with zero status (TRUE) if +# ARG is an MS-style import library. Returns +# with nonzero status (FALSE) otherwise. +func_cygming_ms_implib_p () +{ + $opt_debug + func_to_tool_file "$1" func_convert_file_msys_to_w32 + func_cygming_ms_implib_tmp=`$NM "$func_to_tool_file_result" | eval "$global_symbol_pipe" | $GREP '_NULL_IMPORT_DESCRIPTOR'` + test -n "$func_cygming_ms_implib_tmp" +} + +# func_cygming_dll_for_implib_fallback ARG +# Platform-specific function to extract the +# name of the DLL associated with the specified +# import library ARG. +# +# This fallback implementation is for use when $DLLTOOL +# does not support the --identify-strict option. +# Invoked by eval'ing the libtool variable +# $sharedlib_from_linklib_cmd +# Result is available in the variable +# $sharedlib_from_linklib_result +func_cygming_dll_for_implib_fallback () +{ + $opt_debug + if func_cygming_gnu_implib_p "$1" ; then + # binutils import library + sharedlib_from_linklib_result=`func_cygming_dll_for_implib_fallback_core '.idata$7' "$1"` + elif func_cygming_ms_implib_p "$1" ; then + # ms-generated import library + sharedlib_from_linklib_result=`func_cygming_dll_for_implib_fallback_core '.idata$6' "$1"` + else + # unknown + sharedlib_from_linklib_result="" + fi +} # func_extract_an_archive dir oldlib @@ -2598,7 +3715,18 @@ $opt_debug f_ex_an_ar_dir="$1"; shift f_ex_an_ar_oldlib="$1" - func_show_eval "(cd \$f_ex_an_ar_dir && $AR x \"\$f_ex_an_ar_oldlib\")" 'exit $?' + if test "$lock_old_archive_extraction" = yes; then + lockfile=$f_ex_an_ar_oldlib.lock + until $opt_dry_run || ln "$progpath" "$lockfile" 2>/dev/null; do + func_echo "Waiting for $lockfile to be removed" + sleep 2 + done + fi + func_show_eval "(cd \$f_ex_an_ar_dir && $AR x \"\$f_ex_an_ar_oldlib\")" \ + 'stat=$?; rm -f "$lockfile"; exit $stat' + if test "$lock_old_archive_extraction" = yes; then + $opt_dry_run || rm -f "$lockfile" + fi if ($AR t "$f_ex_an_ar_oldlib" | sort | sort -uc >/dev/null 2>&1); then : else @@ -2669,7 +3797,7 @@ darwin_file= darwin_files= for darwin_file in $darwin_filelist; do - darwin_files=`find unfat-$$ -name $darwin_file -print | $NL2SP` + darwin_files=`find unfat-$$ -name $darwin_file -print | sort | $NL2SP` $LIPO -create -output "$darwin_file" $darwin_files done # $darwin_filelist $RM -rf unfat-$$ @@ -2684,25 +3812,30 @@ func_extract_an_archive "$my_xdir" "$my_xabs" ;; esac - my_oldobjs="$my_oldobjs "`find $my_xdir -name \*.$objext -print -o -name \*.lo -print | $NL2SP` + my_oldobjs="$my_oldobjs "`find $my_xdir -name \*.$objext -print -o -name \*.lo -print | sort | $NL2SP` done func_extract_archives_result="$my_oldobjs" } - -# func_emit_wrapper_part1 [arg=no] +# func_emit_wrapper [arg=no] # -# Emit the first part of a libtool wrapper script on stdout. -# For more information, see the description associated with -# func_emit_wrapper(), below. -func_emit_wrapper_part1 () -{ - func_emit_wrapper_part1_arg1=no - if test -n "$1" ; then - func_emit_wrapper_part1_arg1=$1 - fi +# Emit a libtool wrapper script on stdout. +# Don't directly open a file because we may want to +# incorporate the script contents within a cygwin/mingw +# wrapper executable. Must ONLY be called from within +# func_mode_link because it depends on a number of variables +# set therein. +# +# ARG is the value that the WRAPPER_SCRIPT_BELONGS_IN_OBJDIR +# variable will take. If 'yes', then the emitted script +# will assume that the directory in which it is stored is +# the $objdir directory. This is a cygwin/mingw-specific +# behavior. +func_emit_wrapper () +{ + func_emit_wrapper_arg1=${1-no} $ECHO "\ #! $SHELL @@ -2718,7 +3851,6 @@ # Sed substitution that helps us do robust quoting. It backslashifies # metacharacters that are still active within double-quoted strings. -Xsed='${SED} -e 1s/^X//' sed_quote_subst='$sed_quote_subst' # Be Bourne compatible @@ -2749,31 +3881,135 @@ else # When we are sourced in execute mode, \$file and \$ECHO are already set. if test \"\$libtool_execute_magic\" != \"$magic\"; then - ECHO=\"$qecho\" - file=\"\$0\" - # Make sure echo works. - if test \"X\$1\" = X--no-reexec; then - # Discard the --no-reexec flag, and continue. - shift - elif test \"X\`{ \$ECHO '\t'; } 2>/dev/null\`\" = 'X\t'; then - # Yippee, \$ECHO works! - : - else - # Restart under the correct shell, and then maybe \$ECHO will work. - exec $SHELL \"\$0\" --no-reexec \${1+\"\$@\"} - fi - fi\ + file=\"\$0\"" + + qECHO=`$ECHO "$ECHO" | $SED "$sed_quote_subst"` + $ECHO "\ + +# A function that is used when there is no print builtin or printf. +func_fallback_echo () +{ + eval 'cat <<_LTECHO_EOF +\$1 +_LTECHO_EOF' +} + ECHO=\"$qECHO\" + fi + +# Very basic option parsing. These options are (a) specific to +# the libtool wrapper, (b) are identical between the wrapper +# /script/ and the wrapper /executable/ which is used only on +# windows platforms, and (c) all begin with the string "--lt-" +# (application programs are unlikely to have options which match +# this pattern). +# +# There are only two supported options: --lt-debug and +# --lt-dump-script. There is, deliberately, no --lt-help. +# +# The first argument to this parsing function should be the +# script's $0 value, followed by "$@". +lt_option_debug= +func_parse_lt_options () +{ + lt_script_arg0=\$0 + shift + for lt_opt + do + case \"\$lt_opt\" in + --lt-debug) lt_option_debug=1 ;; + --lt-dump-script) + lt_dump_D=\`\$ECHO \"X\$lt_script_arg0\" | $SED -e 's/^X//' -e 's%/[^/]*$%%'\` + test \"X\$lt_dump_D\" = \"X\$lt_script_arg0\" && lt_dump_D=. + lt_dump_F=\`\$ECHO \"X\$lt_script_arg0\" | $SED -e 's/^X//' -e 's%^.*/%%'\` + cat \"\$lt_dump_D/\$lt_dump_F\" + exit 0 + ;; + --lt-*) + \$ECHO \"Unrecognized --lt- option: '\$lt_opt'\" 1>&2 + exit 1 + ;; + esac + done + + # Print the debug banner immediately: + if test -n \"\$lt_option_debug\"; then + echo \"${outputname}:${output}:\${LINENO}: libtool wrapper (GNU $PACKAGE$TIMESTAMP) $VERSION\" 1>&2 + fi +} + +# Used when --lt-debug. Prints its arguments to stdout +# (redirection is the responsibility of the caller) +func_lt_dump_args () +{ + lt_dump_args_N=1; + for lt_arg + do + \$ECHO \"${outputname}:${output}:\${LINENO}: newargv[\$lt_dump_args_N]: \$lt_arg\" + lt_dump_args_N=\`expr \$lt_dump_args_N + 1\` + done +} + +# Core function for launching the target application +func_exec_program_core () +{ " - $ECHO "\ + case $host in + # Backslashes separate directories on plain windows + *-*-mingw | *-*-os2* | *-cegcc*) + $ECHO "\ + if test -n \"\$lt_option_debug\"; then + \$ECHO \"${outputname}:${output}:\${LINENO}: newargv[0]: \$progdir\\\\\$program\" 1>&2 + func_lt_dump_args \${1+\"\$@\"} 1>&2 + fi + exec \"\$progdir\\\\\$program\" \${1+\"\$@\"} +" + ;; + + *) + $ECHO "\ + if test -n \"\$lt_option_debug\"; then + \$ECHO \"${outputname}:${output}:\${LINENO}: newargv[0]: \$progdir/\$program\" 1>&2 + func_lt_dump_args \${1+\"\$@\"} 1>&2 + fi + exec \"\$progdir/\$program\" \${1+\"\$@\"} +" + ;; + esac + $ECHO "\ + \$ECHO \"\$0: cannot exec \$program \$*\" 1>&2 + exit 1 +} + +# A function to encapsulate launching the target application +# Strips options in the --lt-* namespace from \$@ and +# launches target application with the remaining arguments. +func_exec_program () +{ + case \" \$* \" in + *\\ --lt-*) + for lt_wr_arg + do + case \$lt_wr_arg in + --lt-*) ;; + *) set x \"\$@\" \"\$lt_wr_arg\"; shift;; + esac + shift + done ;; + esac + func_exec_program_core \${1+\"\$@\"} +} + + # Parse options + func_parse_lt_options \"\$0\" \${1+\"\$@\"} # Find the directory that this script lives in. - thisdir=\`\$ECHO \"X\$file\" | \$Xsed -e 's%/[^/]*$%%'\` + thisdir=\`\$ECHO \"\$file\" | $SED 's%/[^/]*$%%'\` test \"x\$thisdir\" = \"x\$file\" && thisdir=. # Follow symbolic links until we get to the real thisdir. - file=\`ls -ld \"\$file\" | ${SED} -n 's/.*-> //p'\` + file=\`ls -ld \"\$file\" | $SED -n 's/.*-> //p'\` while test -n \"\$file\"; do - destdir=\`\$ECHO \"X\$file\" | \$Xsed -e 's%/[^/]*\$%%'\` + destdir=\`\$ECHO \"\$file\" | $SED 's%/[^/]*\$%%'\` # If there was a directory component, then change thisdir. if test \"x\$destdir\" != \"x\$file\"; then @@ -2783,30 +4019,13 @@ esac fi - file=\`\$ECHO \"X\$file\" | \$Xsed -e 's%^.*/%%'\` - file=\`ls -ld \"\$thisdir/\$file\" | ${SED} -n 's/.*-> //p'\` + file=\`\$ECHO \"\$file\" | $SED 's%^.*/%%'\` + file=\`ls -ld \"\$thisdir/\$file\" | $SED -n 's/.*-> //p'\` done -" -} -# end: func_emit_wrapper_part1 - -# func_emit_wrapper_part2 [arg=no] -# -# Emit the second part of a libtool wrapper script on stdout. -# For more information, see the description associated with -# func_emit_wrapper(), below. -func_emit_wrapper_part2 () -{ - func_emit_wrapper_part2_arg1=no - if test -n "$1" ; then - func_emit_wrapper_part2_arg1=$1 - fi - - $ECHO "\ # Usually 'no', except on cygwin/mingw when embedded into # the cwrapper. - WRAPPER_SCRIPT_BELONGS_IN_OBJDIR=$func_emit_wrapper_part2_arg1 + WRAPPER_SCRIPT_BELONGS_IN_OBJDIR=$func_emit_wrapper_arg1 if test \"\$WRAPPER_SCRIPT_BELONGS_IN_OBJDIR\" = \"yes\"; then # special case for '.' if test \"\$thisdir\" = \".\"; then @@ -2814,7 +4033,7 @@ fi # remove .libs from thisdir case \"\$thisdir\" in - *[\\\\/]$objdir ) thisdir=\`\$ECHO \"X\$thisdir\" | \$Xsed -e 's%[\\\\/][^\\\\/]*$%%'\` ;; + *[\\\\/]$objdir ) thisdir=\`\$ECHO \"\$thisdir\" | $SED 's%[\\\\/][^\\\\/]*$%%'\` ;; $objdir ) thisdir=. ;; esac fi @@ -2869,6 +4088,18 @@ if test -f \"\$progdir/\$program\"; then" + # fixup the dll searchpath if we need to. + # + # Fix the DLL searchpath if we need to. Do this before prepending + # to shlibpath, because on Windows, both are PATH and uninstalled + # libraries must come first. + if test -n "$dllsearchpath"; then + $ECHO "\ + # Add the dll search path components to the executable PATH + PATH=$dllsearchpath:\$PATH +" + fi + # Export our shlibpath_var if we have one. if test "$shlibpath_overrides_runpath" = yes && test -n "$shlibpath_var" && test -n "$temp_rpath"; then $ECHO "\ @@ -2877,253 +4108,28 @@ # Some systems cannot cope with colon-terminated $shlibpath_var # The second colon is a workaround for a bug in BeOS R4 sed - $shlibpath_var=\`\$ECHO \"X\$$shlibpath_var\" | \$Xsed -e 's/::*\$//'\` + $shlibpath_var=\`\$ECHO \"\$$shlibpath_var\" | $SED 's/::*\$//'\` export $shlibpath_var " fi - # fixup the dll searchpath if we need to. - if test -n "$dllsearchpath"; then - $ECHO "\ - # Add the dll search path components to the executable PATH - PATH=$dllsearchpath:\$PATH -" - fi - $ECHO "\ if test \"\$libtool_execute_magic\" != \"$magic\"; then # Run the actual program with our arguments. -" - case $host in - # Backslashes separate directories on plain windows - *-*-mingw | *-*-os2* | *-cegcc*) - $ECHO "\ - exec \"\$progdir\\\\\$program\" \${1+\"\$@\"} -" - ;; - - *) - $ECHO "\ - exec \"\$progdir/\$program\" \${1+\"\$@\"} -" - ;; - esac - $ECHO "\ - \$ECHO \"\$0: cannot exec \$program \$*\" 1>&2 - exit 1 + func_exec_program \${1+\"\$@\"} fi else # The program doesn't exist. \$ECHO \"\$0: error: \\\`\$progdir/\$program' does not exist\" 1>&2 \$ECHO \"This script is just a wrapper for \$program.\" 1>&2 - $ECHO \"See the $PACKAGE documentation for more information.\" 1>&2 + \$ECHO \"See the $PACKAGE documentation for more information.\" 1>&2 exit 1 fi fi\ " } -# end: func_emit_wrapper_part2 - - -# func_emit_wrapper [arg=no] -# -# Emit a libtool wrapper script on stdout. -# Don't directly open a file because we may want to -# incorporate the script contents within a cygwin/mingw -# wrapper executable. Must ONLY be called from within -# func_mode_link because it depends on a number of variables -# set therein. -# -# ARG is the value that the WRAPPER_SCRIPT_BELONGS_IN_OBJDIR -# variable will take. If 'yes', then the emitted script -# will assume that the directory in which it is stored is -# the $objdir directory. This is a cygwin/mingw-specific -# behavior. -func_emit_wrapper () -{ - func_emit_wrapper_arg1=no - if test -n "$1" ; then - func_emit_wrapper_arg1=$1 - fi - - # split this up so that func_emit_cwrapperexe_src - # can call each part independently. - func_emit_wrapper_part1 "${func_emit_wrapper_arg1}" - func_emit_wrapper_part2 "${func_emit_wrapper_arg1}" -} - - -# func_to_host_path arg -# -# Convert paths to host format when used with build tools. -# Intended for use with "native" mingw (where libtool itself -# is running under the msys shell), or in the following cross- -# build environments: -# $build $host -# mingw (msys) mingw [e.g. native] -# cygwin mingw -# *nix + wine mingw -# where wine is equipped with the `winepath' executable. -# In the native mingw case, the (msys) shell automatically -# converts paths for any non-msys applications it launches, -# but that facility isn't available from inside the cwrapper. -# Similar accommodations are necessary for $host mingw and -# $build cygwin. Calling this function does no harm for other -# $host/$build combinations not listed above. -# -# ARG is the path (on $build) that should be converted to -# the proper representation for $host. The result is stored -# in $func_to_host_path_result. -func_to_host_path () -{ - func_to_host_path_result="$1" - if test -n "$1" ; then - case $host in - *mingw* ) - lt_sed_naive_backslashify='s|\\\\*|\\|g;s|/|\\|g;s|\\|\\\\|g' - case $build in - *mingw* ) # actually, msys - # awkward: cmd appends spaces to result - lt_sed_strip_trailing_spaces="s/[ ]*\$//" - func_to_host_path_tmp1=`( cmd //c echo "$1" |\ - $SED -e "$lt_sed_strip_trailing_spaces" ) 2>/dev/null || echo ""` - func_to_host_path_result=`echo "$func_to_host_path_tmp1" |\ - $SED -e "$lt_sed_naive_backslashify"` - ;; - *cygwin* ) - func_to_host_path_tmp1=`cygpath -w "$1"` - func_to_host_path_result=`echo "$func_to_host_path_tmp1" |\ - $SED -e "$lt_sed_naive_backslashify"` - ;; - * ) - # Unfortunately, winepath does not exit with a non-zero - # error code, so we are forced to check the contents of - # stdout. On the other hand, if the command is not - # found, the shell will set an exit code of 127 and print - # *an error message* to stdout. So we must check for both - # error code of zero AND non-empty stdout, which explains - # the odd construction: - func_to_host_path_tmp1=`winepath -w "$1" 2>/dev/null` - if test "$?" -eq 0 && test -n "${func_to_host_path_tmp1}"; then - func_to_host_path_result=`echo "$func_to_host_path_tmp1" |\ - $SED -e "$lt_sed_naive_backslashify"` - else - # Allow warning below. - func_to_host_path_result="" - fi - ;; - esac - if test -z "$func_to_host_path_result" ; then - func_error "Could not determine host path corresponding to" - func_error " '$1'" - func_error "Continuing, but uninstalled executables may not work." - # Fallback: - func_to_host_path_result="$1" - fi - ;; - esac - fi -} -# end: func_to_host_path - -# func_to_host_pathlist arg -# -# Convert pathlists to host format when used with build tools. -# See func_to_host_path(), above. This function supports the -# following $build/$host combinations (but does no harm for -# combinations not listed here): -# $build $host -# mingw (msys) mingw [e.g. native] -# cygwin mingw -# *nix + wine mingw -# -# Path separators are also converted from $build format to -# $host format. If ARG begins or ends with a path separator -# character, it is preserved (but converted to $host format) -# on output. -# -# ARG is a pathlist (on $build) that should be converted to -# the proper representation on $host. The result is stored -# in $func_to_host_pathlist_result. -func_to_host_pathlist () -{ - func_to_host_pathlist_result="$1" - if test -n "$1" ; then - case $host in - *mingw* ) - lt_sed_naive_backslashify='s|\\\\*|\\|g;s|/|\\|g;s|\\|\\\\|g' - # Remove leading and trailing path separator characters from - # ARG. msys behavior is inconsistent here, cygpath turns them - # into '.;' and ';.', and winepath ignores them completely. - func_to_host_pathlist_tmp2="$1" - # Once set for this call, this variable should not be - # reassigned. It is used in tha fallback case. - func_to_host_pathlist_tmp1=`echo "$func_to_host_pathlist_tmp2" |\ - $SED -e 's|^:*||' -e 's|:*$||'` - case $build in - *mingw* ) # Actually, msys. - # Awkward: cmd appends spaces to result. - lt_sed_strip_trailing_spaces="s/[ ]*\$//" - func_to_host_pathlist_tmp2=`( cmd //c echo "$func_to_host_pathlist_tmp1" |\ - $SED -e "$lt_sed_strip_trailing_spaces" ) 2>/dev/null || echo ""` - func_to_host_pathlist_result=`echo "$func_to_host_pathlist_tmp2" |\ - $SED -e "$lt_sed_naive_backslashify"` - ;; - *cygwin* ) - func_to_host_pathlist_tmp2=`cygpath -w -p "$func_to_host_pathlist_tmp1"` - func_to_host_pathlist_result=`echo "$func_to_host_pathlist_tmp2" |\ - $SED -e "$lt_sed_naive_backslashify"` - ;; - * ) - # unfortunately, winepath doesn't convert pathlists - func_to_host_pathlist_result="" - func_to_host_pathlist_oldIFS=$IFS - IFS=: - for func_to_host_pathlist_f in $func_to_host_pathlist_tmp1 ; do - IFS=$func_to_host_pathlist_oldIFS - if test -n "$func_to_host_pathlist_f" ; then - func_to_host_path "$func_to_host_pathlist_f" - if test -n "$func_to_host_path_result" ; then - if test -z "$func_to_host_pathlist_result" ; then - func_to_host_pathlist_result="$func_to_host_path_result" - else - func_to_host_pathlist_result="$func_to_host_pathlist_result;$func_to_host_path_result" - fi - fi - fi - IFS=: - done - IFS=$func_to_host_pathlist_oldIFS - ;; - esac - if test -z "$func_to_host_pathlist_result" ; then - func_error "Could not determine the host path(s) corresponding to" - func_error " '$1'" - func_error "Continuing, but uninstalled executables may not work." - # Fallback. This may break if $1 contains DOS-style drive - # specifications. The fix is not to complicate the expression - # below, but for the user to provide a working wine installation - # with winepath so that path translation in the cross-to-mingw - # case works properly. - lt_replace_pathsep_nix_to_dos="s|:|;|g" - func_to_host_pathlist_result=`echo "$func_to_host_pathlist_tmp1" |\ - $SED -e "$lt_replace_pathsep_nix_to_dos"` - fi - # Now, add the leading and trailing path separators back - case "$1" in - :* ) func_to_host_pathlist_result=";$func_to_host_pathlist_result" - ;; - esac - case "$1" in - *: ) func_to_host_pathlist_result="$func_to_host_pathlist_result;" - ;; - esac - ;; - esac - fi -} -# end: func_to_host_pathlist + # func_emit_cwrapperexe_src # emit the source code for a wrapper executable on stdout @@ -3141,31 +4147,23 @@ This wrapper executable should never be moved out of the build directory. If it is, it will not operate correctly. - - Currently, it simply execs the wrapper *script* "$SHELL $output", - but could eventually absorb all of the scripts functionality and - exec $objdir/$outputname directly. */ EOF cat <<"EOF" +#ifdef _MSC_VER +# define _CRT_SECURE_NO_DEPRECATE 1 +#endif #include #include #ifdef _MSC_VER # include # include # include -# define setmode _setmode #else # include # include # ifdef __CYGWIN__ # include -# define HAVE_SETENV -# ifdef __STRICT_ANSI__ -char *realpath (const char *, char *); -int putenv (char *); -int setenv (const char *, const char *, int); -# endif # endif #endif #include @@ -3177,6 +4175,44 @@ #include #include +/* declarations of non-ANSI functions */ +#if defined(__MINGW32__) +# ifdef __STRICT_ANSI__ +int _putenv (const char *); +# endif +#elif defined(__CYGWIN__) +# ifdef __STRICT_ANSI__ +char *realpath (const char *, char *); +int putenv (char *); +int setenv (const char *, const char *, int); +# endif +/* #elif defined (other platforms) ... */ +#endif + +/* portability defines, excluding path handling macros */ +#if defined(_MSC_VER) +# define setmode _setmode +# define stat _stat +# define chmod _chmod +# define getcwd _getcwd +# define putenv _putenv +# define S_IXUSR _S_IEXEC +# ifndef _INTPTR_T_DEFINED +# define _INTPTR_T_DEFINED +# define intptr_t int +# endif +#elif defined(__MINGW32__) +# define setmode _setmode +# define stat _stat +# define chmod _chmod +# define getcwd _getcwd +# define putenv _putenv +#elif defined(__CYGWIN__) +# define HAVE_SETENV +# define FOPEN_WB "wb" +/* #elif defined (other platforms) ... */ +#endif + #if defined(PATH_MAX) # define LT_PATHMAX PATH_MAX #elif defined(MAXPATHLEN) @@ -3192,14 +4228,7 @@ # define S_IXGRP 0 #endif -#ifdef _MSC_VER -# define S_IXUSR _S_IEXEC -# define stat _stat -# ifndef _INTPTR_T_DEFINED -# define intptr_t int -# endif -#endif - +/* path handling portability macros */ #ifndef DIR_SEPARATOR # define DIR_SEPARATOR '/' # define PATH_SEPARATOR ':' @@ -3230,10 +4259,6 @@ # define IS_PATH_SEPARATOR(ch) ((ch) == PATH_SEPARATOR_2) #endif /* PATH_SEPARATOR_2 */ -#ifdef __CYGWIN__ -# define FOPEN_WB "wb" -#endif - #ifndef FOPEN_WB # define FOPEN_WB "w" #endif @@ -3246,22 +4271,13 @@ if (stale) { free ((void *) stale); stale = 0; } \ } while (0) -#undef LTWRAPPER_DEBUGPRINTF -#if defined DEBUGWRAPPER -# define LTWRAPPER_DEBUGPRINTF(args) ltwrapper_debugprintf args -static void -ltwrapper_debugprintf (const char *fmt, ...) -{ - va_list args; - va_start (args, fmt); - (void) vfprintf (stderr, fmt, args); - va_end (args); -} +#if defined(LT_DEBUGWRAPPER) +static int lt_debug = 1; #else -# define LTWRAPPER_DEBUGPRINTF(args) +static int lt_debug = 0; #endif -const char *program_name = NULL; +const char *program_name = "libtool-wrapper"; /* in case xstrdup fails */ void *xmalloc (size_t num); char *xstrdup (const char *string); @@ -3271,41 +4287,27 @@ int make_executable (const char *path); int check_executable (const char *path); char *strendzap (char *str, const char *pat); -void lt_fatal (const char *message, ...); +void lt_debugprintf (const char *file, int line, const char *fmt, ...); +void lt_fatal (const char *file, int line, const char *message, ...); +static const char *nonnull (const char *s); +static const char *nonempty (const char *s); void lt_setenv (const char *name, const char *value); char *lt_extend_str (const char *orig_value, const char *add, int to_end); -void lt_opt_process_env_set (const char *arg); -void lt_opt_process_env_prepend (const char *arg); -void lt_opt_process_env_append (const char *arg); -int lt_split_name_value (const char *arg, char** name, char** value); void lt_update_exe_path (const char *name, const char *value); void lt_update_lib_path (const char *name, const char *value); - -static const char *script_text_part1 = -EOF - - func_emit_wrapper_part1 yes | - $SED -e 's/\([\\"]\)/\\\1/g' \ - -e 's/^/ "/' -e 's/$/\\n"/' - echo ";" - cat <"))); + lt_debugprintf (__FILE__, __LINE__, "(main) lt_argv_zero: %s\n", + nonnull (lt_argv_zero)); for (i = 0; i < newargc; i++) { - LTWRAPPER_DEBUGPRINTF (("(main) newargz[%d] : %s\n", i, (newargz[i] ? newargz[i] : ""))); + lt_debugprintf (__FILE__, __LINE__, "(main) newargz[%d]: %s\n", + i, nonnull (newargz[i])); } EOF @@ -3560,11 +4523,14 @@ mingw*) cat <<"EOF" /* execv doesn't actually work on mingw as expected on unix */ + newargz = prepare_spawn (newargz); rval = _spawnv (_P_WAIT, lt_argv_zero, (const char * const *) newargz); if (rval == -1) { /* failed to start process */ - LTWRAPPER_DEBUGPRINTF (("(main) failed to launch target \"%s\": errno = %d\n", lt_argv_zero, errno)); + lt_debugprintf (__FILE__, __LINE__, + "(main) failed to launch target \"%s\": %s\n", + lt_argv_zero, nonnull (strerror (errno))); return 127; } return rval; @@ -3586,7 +4552,7 @@ { void *p = (void *) malloc (num); if (!p) - lt_fatal ("Memory exhausted"); + lt_fatal (__FILE__, __LINE__, "memory exhausted"); return p; } @@ -3620,8 +4586,8 @@ { struct stat st; - LTWRAPPER_DEBUGPRINTF (("(check_executable) : %s\n", - path ? (*path ? path : "EMPTY!") : "NULL!")); + lt_debugprintf (__FILE__, __LINE__, "(check_executable): %s\n", + nonempty (path)); if ((!path) || (!*path)) return 0; @@ -3638,8 +4604,8 @@ int rval = 0; struct stat st; - LTWRAPPER_DEBUGPRINTF (("(make_executable) : %s\n", - path ? (*path ? path : "EMPTY!") : "NULL!")); + lt_debugprintf (__FILE__, __LINE__, "(make_executable): %s\n", + nonempty (path)); if ((!path) || (!*path)) return 0; @@ -3665,8 +4631,8 @@ int tmp_len; char *concat_name; - LTWRAPPER_DEBUGPRINTF (("(find_executable) : %s\n", - wrapper ? (*wrapper ? wrapper : "EMPTY!") : "NULL!")); + lt_debugprintf (__FILE__, __LINE__, "(find_executable): %s\n", + nonempty (wrapper)); if ((wrapper == NULL) || (*wrapper == '\0')) return NULL; @@ -3719,7 +4685,8 @@ { /* empty path: current directory */ if (getcwd (tmp, LT_PATHMAX) == NULL) - lt_fatal ("getcwd failed"); + lt_fatal (__FILE__, __LINE__, "getcwd failed: %s", + nonnull (strerror (errno))); tmp_len = strlen (tmp); concat_name = XMALLOC (char, tmp_len + 1 + strlen (wrapper) + 1); @@ -3744,7 +4711,8 @@ } /* Relative path | not found in path: prepend cwd */ if (getcwd (tmp, LT_PATHMAX) == NULL) - lt_fatal ("getcwd failed"); + lt_fatal (__FILE__, __LINE__, "getcwd failed: %s", + nonnull (strerror (errno))); tmp_len = strlen (tmp); concat_name = XMALLOC (char, tmp_len + 1 + strlen (wrapper) + 1); memcpy (concat_name, tmp, tmp_len); @@ -3770,8 +4738,9 @@ int has_symlinks = 0; while (strlen (tmp_pathspec) && !has_symlinks) { - LTWRAPPER_DEBUGPRINTF (("checking path component for symlinks: %s\n", - tmp_pathspec)); + lt_debugprintf (__FILE__, __LINE__, + "checking path component for symlinks: %s\n", + tmp_pathspec); if (lstat (tmp_pathspec, &s) == 0) { if (S_ISLNK (s.st_mode) != 0) @@ -3793,8 +4762,9 @@ } else { - char *errstr = strerror (errno); - lt_fatal ("Error accessing file %s (%s)", tmp_pathspec, errstr); + lt_fatal (__FILE__, __LINE__, + "error accessing file \"%s\": %s", + tmp_pathspec, nonnull (strerror (errno))); } } XFREE (tmp_pathspec); @@ -3807,7 +4777,8 @@ tmp_pathspec = realpath (pathspec, buf); if (tmp_pathspec == 0) { - lt_fatal ("Could not follow symlinks for %s", pathspec); + lt_fatal (__FILE__, __LINE__, + "could not follow symlinks for %s", pathspec); } return xstrdup (tmp_pathspec); #endif @@ -3833,11 +4804,25 @@ return str; } +void +lt_debugprintf (const char *file, int line, const char *fmt, ...) +{ + va_list args; + if (lt_debug) + { + (void) fprintf (stderr, "%s:%s:%d: ", program_name, file, line); + va_start (args, fmt); + (void) vfprintf (stderr, fmt, args); + va_end (args); + } +} + static void -lt_error_core (int exit_status, const char *mode, +lt_error_core (int exit_status, const char *file, + int line, const char *mode, const char *message, va_list ap) { - fprintf (stderr, "%s: %s: ", program_name, mode); + fprintf (stderr, "%s:%s:%d: %s: ", program_name, file, line, mode); vfprintf (stderr, message, ap); fprintf (stderr, ".\n"); @@ -3846,20 +4831,32 @@ } void -lt_fatal (const char *message, ...) +lt_fatal (const char *file, int line, const char *message, ...) { va_list ap; va_start (ap, message); - lt_error_core (EXIT_FAILURE, "FATAL", message, ap); + lt_error_core (EXIT_FAILURE, file, line, "FATAL", message, ap); va_end (ap); } +static const char * +nonnull (const char *s) +{ + return s ? s : "(null)"; +} + +static const char * +nonempty (const char *s) +{ + return (s && !*s) ? "(empty)" : nonnull (s); +} + void lt_setenv (const char *name, const char *value) { - LTWRAPPER_DEBUGPRINTF (("(lt_setenv) setting '%s' to '%s'\n", - (name ? name : ""), - (value ? value : ""))); + lt_debugprintf (__FILE__, __LINE__, + "(lt_setenv) setting '%s' to '%s'\n", + nonnull (name), nonnull (value)); { #ifdef HAVE_SETENV /* always make a copy, for consistency with !HAVE_SETENV */ @@ -3904,95 +4901,12 @@ return new_value; } -int -lt_split_name_value (const char *arg, char** name, char** value) -{ - const char *p; - int len; - if (!arg || !*arg) - return 1; - - p = strchr (arg, (int)'='); - - if (!p) - return 1; - - *value = xstrdup (++p); - - len = strlen (arg) - strlen (*value); - *name = XMALLOC (char, len); - strncpy (*name, arg, len-1); - (*name)[len - 1] = '\0'; - - return 0; -} - -void -lt_opt_process_env_set (const char *arg) -{ - char *name = NULL; - char *value = NULL; - - if (lt_split_name_value (arg, &name, &value) != 0) - { - XFREE (name); - XFREE (value); - lt_fatal ("bad argument for %s: '%s'", env_set_opt, arg); - } - - lt_setenv (name, value); - XFREE (name); - XFREE (value); -} - -void -lt_opt_process_env_prepend (const char *arg) -{ - char *name = NULL; - char *value = NULL; - char *new_value = NULL; - - if (lt_split_name_value (arg, &name, &value) != 0) - { - XFREE (name); - XFREE (value); - lt_fatal ("bad argument for %s: '%s'", env_prepend_opt, arg); - } - - new_value = lt_extend_str (getenv (name), value, 0); - lt_setenv (name, new_value); - XFREE (new_value); - XFREE (name); - XFREE (value); -} - -void -lt_opt_process_env_append (const char *arg) -{ - char *name = NULL; - char *value = NULL; - char *new_value = NULL; - - if (lt_split_name_value (arg, &name, &value) != 0) - { - XFREE (name); - XFREE (value); - lt_fatal ("bad argument for %s: '%s'", env_append_opt, arg); - } - - new_value = lt_extend_str (getenv (name), value, 1); - lt_setenv (name, new_value); - XFREE (new_value); - XFREE (name); - XFREE (value); -} - void lt_update_exe_path (const char *name, const char *value) { - LTWRAPPER_DEBUGPRINTF (("(lt_update_exe_path) modifying '%s' by prepending '%s'\n", - (name ? name : ""), - (value ? value : ""))); + lt_debugprintf (__FILE__, __LINE__, + "(lt_update_exe_path) modifying '%s' by prepending '%s'\n", + nonnull (name), nonnull (value)); if (name && *name && value && *value) { @@ -4011,9 +4925,9 @@ void lt_update_lib_path (const char *name, const char *value) { - LTWRAPPER_DEBUGPRINTF (("(lt_update_lib_path) modifying '%s' by prepending '%s'\n", - (name ? name : ""), - (value ? value : ""))); + lt_debugprintf (__FILE__, __LINE__, + "(lt_update_lib_path) modifying '%s' by prepending '%s'\n", + nonnull (name), nonnull (value)); if (name && *name && value && *value) { @@ -4023,11 +4937,158 @@ } } +EOF + case $host_os in + mingw*) + cat <<"EOF" + +/* Prepares an argument vector before calling spawn(). + Note that spawn() does not by itself call the command interpreter + (getenv ("COMSPEC") != NULL ? getenv ("COMSPEC") : + ({ OSVERSIONINFO v; v.dwOSVersionInfoSize = sizeof(OSVERSIONINFO); + GetVersionEx(&v); + v.dwPlatformId == VER_PLATFORM_WIN32_NT; + }) ? "cmd.exe" : "command.com"). + Instead it simply concatenates the arguments, separated by ' ', and calls + CreateProcess(). We must quote the arguments since Win32 CreateProcess() + interprets characters like ' ', '\t', '\\', '"' (but not '<' and '>') in a + special way: + - Space and tab are interpreted as delimiters. They are not treated as + delimiters if they are surrounded by double quotes: "...". + - Unescaped double quotes are removed from the input. Their only effect is + that within double quotes, space and tab are treated like normal + characters. + - Backslashes not followed by double quotes are not special. + - But 2*n+1 backslashes followed by a double quote become + n backslashes followed by a double quote (n >= 0): + \" -> " + \\\" -> \" + \\\\\" -> \\" + */ +#define SHELL_SPECIAL_CHARS "\"\\ \001\002\003\004\005\006\007\010\011\012\013\014\015\016\017\020\021\022\023\024\025\026\027\030\031\032\033\034\035\036\037" +#define SHELL_SPACE_CHARS " \001\002\003\004\005\006\007\010\011\012\013\014\015\016\017\020\021\022\023\024\025\026\027\030\031\032\033\034\035\036\037" +char ** +prepare_spawn (char **argv) +{ + size_t argc; + char **new_argv; + size_t i; + + /* Count number of arguments. */ + for (argc = 0; argv[argc] != NULL; argc++) + ; + + /* Allocate new argument vector. */ + new_argv = XMALLOC (char *, argc + 1); + + /* Put quoted arguments into the new argument vector. */ + for (i = 0; i < argc; i++) + { + const char *string = argv[i]; + + if (string[0] == '\0') + new_argv[i] = xstrdup ("\"\""); + else if (strpbrk (string, SHELL_SPECIAL_CHARS) != NULL) + { + int quote_around = (strpbrk (string, SHELL_SPACE_CHARS) != NULL); + size_t length; + unsigned int backslashes; + const char *s; + char *quoted_string; + char *p; + + length = 0; + backslashes = 0; + if (quote_around) + length++; + for (s = string; *s != '\0'; s++) + { + char c = *s; + if (c == '"') + length += backslashes + 1; + length++; + if (c == '\\') + backslashes++; + else + backslashes = 0; + } + if (quote_around) + length += backslashes + 1; + + quoted_string = XMALLOC (char, length + 1); + + p = quoted_string; + backslashes = 0; + if (quote_around) + *p++ = '"'; + for (s = string; *s != '\0'; s++) + { + char c = *s; + if (c == '"') + { + unsigned int j; + for (j = backslashes + 1; j > 0; j--) + *p++ = '\\'; + } + *p++ = c; + if (c == '\\') + backslashes++; + else + backslashes = 0; + } + if (quote_around) + { + unsigned int j; + for (j = backslashes; j > 0; j--) + *p++ = '\\'; + *p++ = '"'; + } + *p = '\0'; + + new_argv[i] = quoted_string; + } + else + new_argv[i] = (char *) string; + } + new_argv[argc] = NULL; + + return new_argv; +} +EOF + ;; + esac + cat <<"EOF" +void lt_dump_script (FILE* f) +{ +EOF + func_emit_wrapper yes | + $SED -n -e ' +s/^\(.\{79\}\)\(..*\)/\1\ +\2/ +h +s/\([\\"]\)/\\\1/g +s/$/\\n/ +s/\([^\n]*\).*/ fputs ("\1", f);/p +g +D' + cat <<"EOF" +} EOF } # end: func_emit_cwrapperexe_src +# func_win32_import_lib_p ARG +# True if ARG is an import lib, as indicated by $file_magic_cmd +func_win32_import_lib_p () +{ + $opt_debug + case `eval $file_magic_cmd \"\$1\" 2>/dev/null | $SED -e 10q` in + *import*) : ;; + *) false ;; + esac +} + # func_mode_link arg... func_mode_link () { @@ -4072,6 +5133,7 @@ new_inherited_linker_flags= avoid_version=no + bindir= dlfiles= dlprefiles= dlself=no @@ -4164,6 +5226,11 @@ esac case $prev in + bindir) + bindir="$arg" + prev= + continue + ;; dlfiles|dlprefiles) if test "$preload" = no; then # Add the symbol object into the linking commands. @@ -4195,9 +5262,9 @@ ;; *) if test "$prev" = dlfiles; then - dlfiles="$dlfiles $arg" + func_append dlfiles " $arg" else - dlprefiles="$dlprefiles $arg" + func_append dlprefiles " $arg" fi prev= continue @@ -4221,7 +5288,7 @@ *-*-darwin*) case "$deplibs " in *" $qarg.ltframework "*) ;; - *) deplibs="$deplibs $qarg.ltframework" # this is fixed later + *) func_append deplibs " $qarg.ltframework" # this is fixed later ;; esac ;; @@ -4240,7 +5307,7 @@ moreargs= for fil in `cat "$save_arg"` do -# moreargs="$moreargs $fil" +# func_append moreargs " $fil" arg=$fil # A libtool-controlled object. @@ -4269,7 +5336,7 @@ if test "$prev" = dlfiles; then if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then - dlfiles="$dlfiles $pic_object" + func_append dlfiles " $pic_object" prev= continue else @@ -4281,7 +5348,7 @@ # CHECK ME: I think I busted this. -Ossama if test "$prev" = dlprefiles; then # Preload the old-style object. - dlprefiles="$dlprefiles $pic_object" + func_append dlprefiles " $pic_object" prev= fi @@ -4351,12 +5418,12 @@ if test "$prev" = rpath; then case "$rpath " in *" $arg "*) ;; - *) rpath="$rpath $arg" ;; + *) func_append rpath " $arg" ;; esac else case "$xrpath " in *" $arg "*) ;; - *) xrpath="$xrpath $arg" ;; + *) func_append xrpath " $arg" ;; esac fi prev= @@ -4368,28 +5435,28 @@ continue ;; weak) - weak_libs="$weak_libs $arg" + func_append weak_libs " $arg" prev= continue ;; xcclinker) - linker_flags="$linker_flags $qarg" - compiler_flags="$compiler_flags $qarg" + func_append linker_flags " $qarg" + func_append compiler_flags " $qarg" prev= func_append compile_command " $qarg" func_append finalize_command " $qarg" continue ;; xcompiler) - compiler_flags="$compiler_flags $qarg" + func_append compiler_flags " $qarg" prev= func_append compile_command " $qarg" func_append finalize_command " $qarg" continue ;; xlinker) - linker_flags="$linker_flags $qarg" - compiler_flags="$compiler_flags $wl$qarg" + func_append linker_flags " $qarg" + func_append compiler_flags " $wl$qarg" prev= func_append compile_command " $wl$qarg" func_append finalize_command " $wl$qarg" @@ -4425,6 +5492,11 @@ continue ;; + -bindir) + prev=bindir + continue + ;; + -dlopen) prev=dlfiles continue @@ -4475,15 +5547,16 @@ ;; -L*) - func_stripname '-L' '' "$arg" - dir=$func_stripname_result - if test -z "$dir"; then + func_stripname "-L" '' "$arg" + if test -z "$func_stripname_result"; then if test "$#" -gt 0; then func_fatal_error "require no space between \`-L' and \`$1'" else func_fatal_error "need path for \`-L' option" fi fi + func_resolve_sysroot "$func_stripname_result" + dir=$func_resolve_sysroot_result # We need an absolute path. case $dir in [\\/]* | [A-Za-z]:[\\/]*) ;; @@ -4495,24 +5568,30 @@ ;; esac case "$deplibs " in - *" -L$dir "*) ;; + *" -L$dir "* | *" $arg "*) + # Will only happen for absolute or sysroot arguments + ;; *) - deplibs="$deplibs -L$dir" - lib_search_path="$lib_search_path $dir" + # Preserve sysroot, but never include relative directories + case $dir in + [\\/]* | [A-Za-z]:[\\/]* | =*) func_append deplibs " $arg" ;; + *) func_append deplibs " -L$dir" ;; + esac + func_append lib_search_path " $dir" ;; esac case $host in *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-cegcc*) - testbindir=`$ECHO "X$dir" | $Xsed -e 's*/lib$*/bin*'` + testbindir=`$ECHO "$dir" | $SED 's*/lib$*/bin*'` case :$dllsearchpath: in *":$dir:"*) ;; ::) dllsearchpath=$dir;; - *) dllsearchpath="$dllsearchpath:$dir";; + *) func_append dllsearchpath ":$dir";; esac case :$dllsearchpath: in *":$testbindir:"*) ;; ::) dllsearchpath=$testbindir;; - *) dllsearchpath="$dllsearchpath:$testbindir";; + *) func_append dllsearchpath ":$testbindir";; esac ;; esac @@ -4522,7 +5601,7 @@ -l*) if test "X$arg" = "X-lc" || test "X$arg" = "X-lm"; then case $host in - *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-beos* | *-cegcc*) + *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-beos* | *-cegcc* | *-*-haiku*) # These systems don't actually have a C or math library (as such) continue ;; @@ -4536,7 +5615,7 @@ ;; *-*-rhapsody* | *-*-darwin1.[012]) # Rhapsody C and math libraries are in the System framework - deplibs="$deplibs System.ltframework" + func_append deplibs " System.ltframework" continue ;; *-*-sco3.2v5* | *-*-sco5v6*) @@ -4556,7 +5635,7 @@ ;; esac fi - deplibs="$deplibs $arg" + func_append deplibs " $arg" continue ;; @@ -4568,21 +5647,22 @@ # Tru64 UNIX uses -model [arg] to determine the layout of C++ # classes, name mangling, and exception handling. # Darwin uses the -arch flag to determine output architecture. - -model|-arch|-isysroot) - compiler_flags="$compiler_flags $arg" + -model|-arch|-isysroot|--sysroot) + func_append compiler_flags " $arg" func_append compile_command " $arg" func_append finalize_command " $arg" prev=xcompiler continue ;; - -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe|-threads) - compiler_flags="$compiler_flags $arg" + -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe \ + |-threads|-fopenmp|-openmp|-mp|-xopenmp|-omp|-qsmp=*) + func_append compiler_flags " $arg" func_append compile_command " $arg" func_append finalize_command " $arg" case "$new_inherited_linker_flags " in *" $arg "*) ;; - * ) new_inherited_linker_flags="$new_inherited_linker_flags $arg" ;; + * ) func_append new_inherited_linker_flags " $arg" ;; esac continue ;; @@ -4649,13 +5729,17 @@ # We need an absolute path. case $dir in [\\/]* | [A-Za-z]:[\\/]*) ;; + =*) + func_stripname '=' '' "$dir" + dir=$lt_sysroot$func_stripname_result + ;; *) func_fatal_error "only absolute run-paths are allowed" ;; esac case "$xrpath " in *" $dir "*) ;; - *) xrpath="$xrpath $dir" ;; + *) func_append xrpath " $dir" ;; esac continue ;; @@ -4708,8 +5792,8 @@ for flag in $args; do IFS="$save_ifs" func_quote_for_eval "$flag" - arg="$arg $wl$func_quote_for_eval_result" - compiler_flags="$compiler_flags $func_quote_for_eval_result" + func_append arg " $func_quote_for_eval_result" + func_append compiler_flags " $func_quote_for_eval_result" done IFS="$save_ifs" func_stripname ' ' '' "$arg" @@ -4724,9 +5808,9 @@ for flag in $args; do IFS="$save_ifs" func_quote_for_eval "$flag" - arg="$arg $wl$func_quote_for_eval_result" - compiler_flags="$compiler_flags $wl$func_quote_for_eval_result" - linker_flags="$linker_flags $func_quote_for_eval_result" + func_append arg " $wl$func_quote_for_eval_result" + func_append compiler_flags " $wl$func_quote_for_eval_result" + func_append linker_flags " $func_quote_for_eval_result" done IFS="$save_ifs" func_stripname ' ' '' "$arg" @@ -4754,23 +5838,27 @@ arg="$func_quote_for_eval_result" ;; - # -64, -mips[0-9] enable 64-bit mode on the SGI compiler - # -r[0-9][0-9]* specifies the processor on the SGI compiler - # -xarch=*, -xtarget=* enable 64-bit mode on the Sun compiler - # +DA*, +DD* enable 64-bit mode on the HP compiler - # -q* pass through compiler args for the IBM compiler - # -m*, -t[45]*, -txscale* pass through architecture-specific - # compiler args for GCC - # -F/path gives path to uninstalled frameworks, gcc on darwin - # -p, -pg, --coverage, -fprofile-* pass through profiling flag for GCC - # @file GCC response files + # Flags to be passed through unchanged, with rationale: + # -64, -mips[0-9] enable 64-bit mode for the SGI compiler + # -r[0-9][0-9]* specify processor for the SGI compiler + # -xarch=*, -xtarget=* enable 64-bit mode for the Sun compiler + # +DA*, +DD* enable 64-bit mode for the HP compiler + # -q* compiler args for the IBM compiler + # -m*, -t[45]*, -txscale* architecture-specific flags for GCC + # -F/path path to uninstalled frameworks, gcc on darwin + # -p, -pg, --coverage, -fprofile-* profiling flags for GCC + # @file GCC response files + # -tp=* Portland pgcc target processor selection + # --sysroot=* for sysroot support + # -O*, -flto*, -fwhopr*, -fuse-linker-plugin GCC link-time optimization -64|-mips[0-9]|-r[0-9][0-9]*|-xarch=*|-xtarget=*|+DA*|+DD*|-q*|-m*| \ - -t[45]*|-txscale*|-p|-pg|--coverage|-fprofile-*|-F*|@*) + -t[45]*|-txscale*|-p|-pg|--coverage|-fprofile-*|-F*|@*|-tp=*|--sysroot=*| \ + -O*|-flto*|-fwhopr*|-fuse-linker-plugin) func_quote_for_eval "$arg" arg="$func_quote_for_eval_result" func_append compile_command " $arg" func_append finalize_command " $arg" - compiler_flags="$compiler_flags $arg" + func_append compiler_flags " $arg" continue ;; @@ -4782,7 +5870,7 @@ *.$objext) # A standard object. - objs="$objs $arg" + func_append objs " $arg" ;; *.lo) @@ -4813,7 +5901,7 @@ if test "$prev" = dlfiles; then if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then - dlfiles="$dlfiles $pic_object" + func_append dlfiles " $pic_object" prev= continue else @@ -4825,7 +5913,7 @@ # CHECK ME: I think I busted this. -Ossama if test "$prev" = dlprefiles; then # Preload the old-style object. - dlprefiles="$dlprefiles $pic_object" + func_append dlprefiles " $pic_object" prev= fi @@ -4870,24 +5958,25 @@ *.$libext) # An archive. - deplibs="$deplibs $arg" - old_deplibs="$old_deplibs $arg" + func_append deplibs " $arg" + func_append old_deplibs " $arg" continue ;; *.la) # A libtool-controlled library. + func_resolve_sysroot "$arg" if test "$prev" = dlfiles; then # This library was specified with -dlopen. - dlfiles="$dlfiles $arg" + func_append dlfiles " $func_resolve_sysroot_result" prev= elif test "$prev" = dlprefiles; then # The library was specified with -dlpreopen. - dlprefiles="$dlprefiles $arg" + func_append dlprefiles " $func_resolve_sysroot_result" prev= else - deplibs="$deplibs $arg" + func_append deplibs " $func_resolve_sysroot_result" fi continue ;; @@ -4925,7 +6014,7 @@ if test -n "$shlibpath_var"; then # get the directories listed in $shlibpath_var - eval shlib_search_path=\`\$ECHO \"X\${$shlibpath_var}\" \| \$Xsed -e \'s/:/ /g\'\` + eval shlib_search_path=\`\$ECHO \"\${$shlibpath_var}\" \| \$SED \'s/:/ /g\'\` else shlib_search_path= fi @@ -4934,6 +6023,8 @@ func_dirname "$output" "/" "" output_objdir="$func_dirname_result$objdir" + func_to_tool_file "$output_objdir/" + tool_output_objdir=$func_to_tool_file_result # Create the object directory. func_mkdir_p "$output_objdir" @@ -4954,12 +6045,12 @@ # Find all interdependent deplibs by searching for libraries # that are linked more than once (e.g. -la -lb -la) for deplib in $deplibs; do - if $opt_duplicate_deps ; then + if $opt_preserve_dup_deps ; then case "$libs " in - *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;; + *" $deplib "*) func_append specialdeplibs " $deplib" ;; esac fi - libs="$libs $deplib" + func_append libs " $deplib" done if test "$linkmode" = lib; then @@ -4972,9 +6063,9 @@ if $opt_duplicate_compiler_generated_deps; then for pre_post_dep in $predeps $postdeps; do case "$pre_post_deps " in - *" $pre_post_dep "*) specialdeplibs="$specialdeplibs $pre_post_deps" ;; + *" $pre_post_dep "*) func_append specialdeplibs " $pre_post_deps" ;; esac - pre_post_deps="$pre_post_deps $pre_post_dep" + func_append pre_post_deps " $pre_post_dep" done fi pre_post_deps= @@ -5041,17 +6132,19 @@ for lib in $dlprefiles; do # Ignore non-libtool-libs dependency_libs= + func_resolve_sysroot "$lib" case $lib in - *.la) func_source "$lib" ;; + *.la) func_source "$func_resolve_sysroot_result" ;; esac # Collect preopened libtool deplibs, except any this library # has declared as weak libs for deplib in $dependency_libs; do - deplib_base=`$ECHO "X$deplib" | $Xsed -e "$basename"` + func_basename "$deplib" + deplib_base=$func_basename_result case " $weak_libs " in *" $deplib_base "*) ;; - *) deplibs="$deplibs $deplib" ;; + *) func_append deplibs " $deplib" ;; esac done done @@ -5067,16 +6160,17 @@ lib= found=no case $deplib in - -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe|-threads) + -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe \ + |-threads|-fopenmp|-openmp|-mp|-xopenmp|-omp|-qsmp=*) if test "$linkmode,$pass" = "prog,link"; then compile_deplibs="$deplib $compile_deplibs" finalize_deplibs="$deplib $finalize_deplibs" else - compiler_flags="$compiler_flags $deplib" + func_append compiler_flags " $deplib" if test "$linkmode" = lib ; then case "$new_inherited_linker_flags " in *" $deplib "*) ;; - * ) new_inherited_linker_flags="$new_inherited_linker_flags $deplib" ;; + * ) func_append new_inherited_linker_flags " $deplib" ;; esac fi fi @@ -5161,7 +6255,7 @@ if test "$linkmode" = lib ; then case "$new_inherited_linker_flags " in *" $deplib "*) ;; - * ) new_inherited_linker_flags="$new_inherited_linker_flags $deplib" ;; + * ) func_append new_inherited_linker_flags " $deplib" ;; esac fi fi @@ -5174,7 +6268,8 @@ test "$pass" = conv && continue newdependency_libs="$deplib $newdependency_libs" func_stripname '-L' '' "$deplib" - newlib_search_path="$newlib_search_path $func_stripname_result" + func_resolve_sysroot "$func_stripname_result" + func_append newlib_search_path " $func_resolve_sysroot_result" ;; prog) if test "$pass" = conv; then @@ -5188,7 +6283,8 @@ finalize_deplibs="$deplib $finalize_deplibs" fi func_stripname '-L' '' "$deplib" - newlib_search_path="$newlib_search_path $func_stripname_result" + func_resolve_sysroot "$func_stripname_result" + func_append newlib_search_path " $func_resolve_sysroot_result" ;; *) func_warning "\`-L' is ignored for archives/objects" @@ -5199,17 +6295,21 @@ -R*) if test "$pass" = link; then func_stripname '-R' '' "$deplib" - dir=$func_stripname_result + func_resolve_sysroot "$func_stripname_result" + dir=$func_resolve_sysroot_result # Make sure the xrpath contains only unique directories. case "$xrpath " in *" $dir "*) ;; - *) xrpath="$xrpath $dir" ;; + *) func_append xrpath " $dir" ;; esac fi deplibs="$deplib $deplibs" continue ;; - *.la) lib="$deplib" ;; + *.la) + func_resolve_sysroot "$deplib" + lib=$func_resolve_sysroot_result + ;; *.$libext) if test "$pass" = conv; then deplibs="$deplib $deplibs" @@ -5227,7 +6327,7 @@ match_pattern*) set dummy $deplibs_check_method; shift match_pattern_regex=`expr "$deplibs_check_method" : "$1 \(.*\)"` - if eval "\$ECHO \"X$deplib\"" 2>/dev/null | $Xsed -e 10q \ + if eval "\$ECHO \"$deplib\"" 2>/dev/null | $SED 10q \ | $EGREP "$match_pattern_regex" > /dev/null; then valid_a_lib=yes fi @@ -5237,15 +6337,15 @@ ;; esac if test "$valid_a_lib" != yes; then - $ECHO + echo $ECHO "*** Warning: Trying to link with static lib archive $deplib." - $ECHO "*** I have the capability to make that library automatically link in when" - $ECHO "*** you link to this library. But I can only do this if you have a" - $ECHO "*** shared version of the library, which you do not appear to have" - $ECHO "*** because the file extensions .$libext of this argument makes me believe" - $ECHO "*** that it is just a static archive that I should not use here." + echo "*** I have the capability to make that library automatically link in when" + echo "*** you link to this library. But I can only do this if you have a" + echo "*** shared version of the library, which you do not appear to have" + echo "*** because the file extensions .$libext of this argument makes me believe" + echo "*** that it is just a static archive that I should not use here." else - $ECHO + echo $ECHO "*** Warning: Linking the shared library $output against the" $ECHO "*** static library $deplib is not portable!" deplibs="$deplib $deplibs" @@ -5272,11 +6372,11 @@ if test "$pass" = dlpreopen || test "$dlopen_support" != yes || test "$build_libtool_libs" = no; then # If there is no dlopen support or we're linking statically, # we need to preload. - newdlprefiles="$newdlprefiles $deplib" + func_append newdlprefiles " $deplib" compile_deplibs="$deplib $compile_deplibs" finalize_deplibs="$deplib $finalize_deplibs" else - newdlfiles="$newdlfiles $deplib" + func_append newdlfiles " $deplib" fi fi continue @@ -5318,20 +6418,20 @@ # Convert "-framework foo" to "foo.ltframework" if test -n "$inherited_linker_flags"; then - tmp_inherited_linker_flags=`$ECHO "X$inherited_linker_flags" | $Xsed -e 's/-framework \([^ $]*\)/\1.ltframework/g'` + tmp_inherited_linker_flags=`$ECHO "$inherited_linker_flags" | $SED 's/-framework \([^ $]*\)/\1.ltframework/g'` for tmp_inherited_linker_flag in $tmp_inherited_linker_flags; do case " $new_inherited_linker_flags " in *" $tmp_inherited_linker_flag "*) ;; - *) new_inherited_linker_flags="$new_inherited_linker_flags $tmp_inherited_linker_flag";; + *) func_append new_inherited_linker_flags " $tmp_inherited_linker_flag";; esac done fi - dependency_libs=`$ECHO "X $dependency_libs" | $Xsed -e 's% \([^ $]*\).ltframework% -framework \1%g'` + dependency_libs=`$ECHO " $dependency_libs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` if test "$linkmode,$pass" = "lib,link" || test "$linkmode,$pass" = "prog,scan" || { test "$linkmode" != prog && test "$linkmode" != lib; }; then - test -n "$dlopen" && dlfiles="$dlfiles $dlopen" - test -n "$dlpreopen" && dlprefiles="$dlprefiles $dlpreopen" + test -n "$dlopen" && func_append dlfiles " $dlopen" + test -n "$dlpreopen" && func_append dlprefiles " $dlpreopen" fi if test "$pass" = conv; then @@ -5342,20 +6442,20 @@ func_fatal_error "cannot find name of link library for \`$lib'" fi # It is a libtool convenience library, so add in its objects. - convenience="$convenience $ladir/$objdir/$old_library" - old_convenience="$old_convenience $ladir/$objdir/$old_library" + func_append convenience " $ladir/$objdir/$old_library" + func_append old_convenience " $ladir/$objdir/$old_library" elif test "$linkmode" != prog && test "$linkmode" != lib; then func_fatal_error "\`$lib' is not a convenience library" fi tmp_libs= for deplib in $dependency_libs; do deplibs="$deplib $deplibs" - if $opt_duplicate_deps ; then + if $opt_preserve_dup_deps ; then case "$tmp_libs " in - *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;; + *" $deplib "*) func_append specialdeplibs " $deplib" ;; esac fi - tmp_libs="$tmp_libs $deplib" + func_append tmp_libs " $deplib" done continue fi # $pass = conv @@ -5363,9 +6463,15 @@ # Get the name of the library we link against. linklib= - for l in $old_library $library_names; do - linklib="$l" - done + if test -n "$old_library" && + { test "$prefer_static_libs" = yes || + test "$prefer_static_libs,$installed" = "built,no"; }; then + linklib=$old_library + else + for l in $old_library $library_names; do + linklib="$l" + done + fi if test -z "$linklib"; then func_fatal_error "cannot find name of link library for \`$lib'" fi @@ -5382,9 +6488,9 @@ # statically, we need to preload. We also need to preload any # dependent libraries so libltdl's deplib preloader doesn't # bomb out in the load deplibs phase. - dlprefiles="$dlprefiles $lib $dependency_libs" + func_append dlprefiles " $lib $dependency_libs" else - newdlfiles="$newdlfiles $lib" + func_append newdlfiles " $lib" fi continue fi # $pass = dlopen @@ -5406,14 +6512,14 @@ # Find the relevant object directory and library name. if test "X$installed" = Xyes; then - if test ! -f "$libdir/$linklib" && test -f "$abs_ladir/$linklib"; then + if test ! -f "$lt_sysroot$libdir/$linklib" && test -f "$abs_ladir/$linklib"; then func_warning "library \`$lib' was moved." dir="$ladir" absdir="$abs_ladir" libdir="$abs_ladir" else - dir="$libdir" - absdir="$libdir" + dir="$lt_sysroot$libdir" + absdir="$lt_sysroot$libdir" fi test "X$hardcode_automatic" = Xyes && avoidtemprpath=yes else @@ -5421,12 +6527,12 @@ dir="$ladir" absdir="$abs_ladir" # Remove this search path later - notinst_path="$notinst_path $abs_ladir" + func_append notinst_path " $abs_ladir" else dir="$ladir/$objdir" absdir="$abs_ladir/$objdir" # Remove this search path later - notinst_path="$notinst_path $abs_ladir" + func_append notinst_path " $abs_ladir" fi fi # $installed = yes func_stripname 'lib' '.la' "$laname" @@ -5437,20 +6543,46 @@ if test -z "$libdir" && test "$linkmode" = prog; then func_fatal_error "only libraries may -dlpreopen a convenience library: \`$lib'" fi - # Prefer using a static library (so that no silly _DYNAMIC symbols - # are required to link). - if test -n "$old_library"; then - newdlprefiles="$newdlprefiles $dir/$old_library" - # Keep a list of preopened convenience libraries to check - # that they are being used correctly in the link pass. - test -z "$libdir" && \ - dlpreconveniencelibs="$dlpreconveniencelibs $dir/$old_library" - # Otherwise, use the dlname, so that lt_dlopen finds it. - elif test -n "$dlname"; then - newdlprefiles="$newdlprefiles $dir/$dlname" - else - newdlprefiles="$newdlprefiles $dir/$linklib" - fi + case "$host" in + # special handling for platforms with PE-DLLs. + *cygwin* | *mingw* | *cegcc* ) + # Linker will automatically link against shared library if both + # static and shared are present. Therefore, ensure we extract + # symbols from the import library if a shared library is present + # (otherwise, the dlopen module name will be incorrect). We do + # this by putting the import library name into $newdlprefiles. + # We recover the dlopen module name by 'saving' the la file + # name in a special purpose variable, and (later) extracting the + # dlname from the la file. + if test -n "$dlname"; then + func_tr_sh "$dir/$linklib" + eval "libfile_$func_tr_sh_result=\$abs_ladir/\$laname" + func_append newdlprefiles " $dir/$linklib" + else + func_append newdlprefiles " $dir/$old_library" + # Keep a list of preopened convenience libraries to check + # that they are being used correctly in the link pass. + test -z "$libdir" && \ + func_append dlpreconveniencelibs " $dir/$old_library" + fi + ;; + * ) + # Prefer using a static library (so that no silly _DYNAMIC symbols + # are required to link). + if test -n "$old_library"; then + func_append newdlprefiles " $dir/$old_library" + # Keep a list of preopened convenience libraries to check + # that they are being used correctly in the link pass. + test -z "$libdir" && \ + func_append dlpreconveniencelibs " $dir/$old_library" + # Otherwise, use the dlname, so that lt_dlopen finds it. + elif test -n "$dlname"; then + func_append newdlprefiles " $dir/$dlname" + else + func_append newdlprefiles " $dir/$linklib" + fi + ;; + esac fi # $pass = dlpreopen if test -z "$libdir"; then @@ -5468,7 +6600,7 @@ if test "$linkmode" = prog && test "$pass" != link; then - newlib_search_path="$newlib_search_path $ladir" + func_append newlib_search_path " $ladir" deplibs="$lib $deplibs" linkalldeplibs=no @@ -5481,7 +6613,8 @@ for deplib in $dependency_libs; do case $deplib in -L*) func_stripname '-L' '' "$deplib" - newlib_search_path="$newlib_search_path $func_stripname_result" + func_resolve_sysroot "$func_stripname_result" + func_append newlib_search_path " $func_resolve_sysroot_result" ;; esac # Need to link against all dependency_libs? @@ -5492,12 +6625,12 @@ # or/and link against static libraries newdependency_libs="$deplib $newdependency_libs" fi - if $opt_duplicate_deps ; then + if $opt_preserve_dup_deps ; then case "$tmp_libs " in - *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;; + *" $deplib "*) func_append specialdeplibs " $deplib" ;; esac fi - tmp_libs="$tmp_libs $deplib" + func_append tmp_libs " $deplib" done # for deplib continue fi # $linkmode = prog... @@ -5512,7 +6645,7 @@ # Make sure the rpath contains only unique directories. case "$temp_rpath:" in *"$absdir:"*) ;; - *) temp_rpath="$temp_rpath$absdir:" ;; + *) func_append temp_rpath "$absdir:" ;; esac fi @@ -5524,7 +6657,7 @@ *) case "$compile_rpath " in *" $absdir "*) ;; - *) compile_rpath="$compile_rpath $absdir" + *) func_append compile_rpath " $absdir" ;; esac ;; esac @@ -5533,7 +6666,7 @@ *) case "$finalize_rpath " in *" $libdir "*) ;; - *) finalize_rpath="$finalize_rpath $libdir" + *) func_append finalize_rpath " $libdir" ;; esac ;; esac @@ -5558,12 +6691,12 @@ case $host in *cygwin* | *mingw* | *cegcc*) # No point in relinking DLLs because paths are not encoded - notinst_deplibs="$notinst_deplibs $lib" + func_append notinst_deplibs " $lib" need_relink=no ;; *) if test "$installed" = no; then - notinst_deplibs="$notinst_deplibs $lib" + func_append notinst_deplibs " $lib" need_relink=yes fi ;; @@ -5580,7 +6713,7 @@ fi done if test -z "$dlopenmodule" && test "$shouldnotlink" = yes && test "$pass" = link; then - $ECHO + echo if test "$linkmode" = prog; then $ECHO "*** Warning: Linking the executable $output against the loadable module" else @@ -5598,7 +6731,7 @@ *) case "$compile_rpath " in *" $absdir "*) ;; - *) compile_rpath="$compile_rpath $absdir" + *) func_append compile_rpath " $absdir" ;; esac ;; esac @@ -5607,7 +6740,7 @@ *) case "$finalize_rpath " in *" $libdir "*) ;; - *) finalize_rpath="$finalize_rpath $libdir" + *) func_append finalize_rpath " $libdir" ;; esac ;; esac @@ -5661,7 +6794,7 @@ linklib=$newlib fi # test -n "$old_archive_from_expsyms_cmds" - if test "$linkmode" = prog || test "$mode" != relink; then + if test "$linkmode" = prog || test "$opt_mode" != relink; then add_shlibpath= add_dir= add= @@ -5683,9 +6816,9 @@ if test "X$dlopenmodule" != "X$lib"; then $ECHO "*** Warning: lib $linklib is a module, not a shared library" if test -z "$old_library" ; then - $ECHO - $ECHO "*** And there doesn't seem to be a static archive available" - $ECHO "*** The link will probably fail, sorry" + echo + echo "*** And there doesn't seem to be a static archive available" + echo "*** The link will probably fail, sorry" else add="$dir/$old_library" fi @@ -5712,12 +6845,12 @@ test "$hardcode_direct_absolute" = no; then add="$dir/$linklib" elif test "$hardcode_minus_L" = yes; then - add_dir="-L$dir" + add_dir="-L$absdir" # Try looking first in the location we're being installed to. if test -n "$inst_prefix_dir"; then case $libdir in [\\/]*) - add_dir="$add_dir -L$inst_prefix_dir$libdir" + func_append add_dir " -L$inst_prefix_dir$libdir" ;; esac fi @@ -5739,7 +6872,7 @@ if test -n "$add_shlibpath"; then case :$compile_shlibpath: in *":$add_shlibpath:"*) ;; - *) compile_shlibpath="$compile_shlibpath$add_shlibpath:" ;; + *) func_append compile_shlibpath "$add_shlibpath:" ;; esac fi if test "$linkmode" = prog; then @@ -5753,13 +6886,13 @@ test "$hardcode_shlibpath_var" = yes; then case :$finalize_shlibpath: in *":$libdir:"*) ;; - *) finalize_shlibpath="$finalize_shlibpath$libdir:" ;; + *) func_append finalize_shlibpath "$libdir:" ;; esac fi fi fi - if test "$linkmode" = prog || test "$mode" = relink; then + if test "$linkmode" = prog || test "$opt_mode" = relink; then add_shlibpath= add_dir= add= @@ -5773,7 +6906,7 @@ elif test "$hardcode_shlibpath_var" = yes; then case :$finalize_shlibpath: in *":$libdir:"*) ;; - *) finalize_shlibpath="$finalize_shlibpath$libdir:" ;; + *) func_append finalize_shlibpath "$libdir:" ;; esac add="-l$name" elif test "$hardcode_automatic" = yes; then @@ -5790,7 +6923,7 @@ if test -n "$inst_prefix_dir"; then case $libdir in [\\/]*) - add_dir="$add_dir -L$inst_prefix_dir$libdir" + func_append add_dir " -L$inst_prefix_dir$libdir" ;; esac fi @@ -5825,21 +6958,21 @@ # Just print a warning and add the library to dependency_libs so # that the program can be linked against the static library. - $ECHO + echo $ECHO "*** Warning: This system can not link to static lib archive $lib." - $ECHO "*** I have the capability to make that library automatically link in when" - $ECHO "*** you link to this library. But I can only do this if you have a" - $ECHO "*** shared version of the library, which you do not appear to have." + echo "*** I have the capability to make that library automatically link in when" + echo "*** you link to this library. But I can only do this if you have a" + echo "*** shared version of the library, which you do not appear to have." if test "$module" = yes; then - $ECHO "*** But as you try to build a module library, libtool will still create " - $ECHO "*** a static module, that should work as long as the dlopening application" - $ECHO "*** is linked with the -dlopen flag to resolve symbols at runtime." + echo "*** But as you try to build a module library, libtool will still create " + echo "*** a static module, that should work as long as the dlopening application" + echo "*** is linked with the -dlopen flag to resolve symbols at runtime." if test -z "$global_symbol_pipe"; then - $ECHO - $ECHO "*** However, this would only work if libtool was able to extract symbol" - $ECHO "*** lists from a program, using \`nm' or equivalent, but libtool could" - $ECHO "*** not find such a program. So, this module is probably useless." - $ECHO "*** \`nm' from GNU binutils and a full rebuild may help." + echo + echo "*** However, this would only work if libtool was able to extract symbol" + echo "*** lists from a program, using \`nm' or equivalent, but libtool could" + echo "*** not find such a program. So, this module is probably useless." + echo "*** \`nm' from GNU binutils and a full rebuild may help." fi if test "$build_old_libs" = no; then build_libtool_libs=module @@ -5867,37 +7000,46 @@ temp_xrpath=$func_stripname_result case " $xrpath " in *" $temp_xrpath "*) ;; - *) xrpath="$xrpath $temp_xrpath";; + *) func_append xrpath " $temp_xrpath";; esac;; - *) temp_deplibs="$temp_deplibs $libdir";; + *) func_append temp_deplibs " $libdir";; esac done dependency_libs="$temp_deplibs" fi - newlib_search_path="$newlib_search_path $absdir" + func_append newlib_search_path " $absdir" # Link against this library test "$link_static" = no && newdependency_libs="$abs_ladir/$laname $newdependency_libs" # ... and its dependency_libs tmp_libs= for deplib in $dependency_libs; do newdependency_libs="$deplib $newdependency_libs" - if $opt_duplicate_deps ; then + case $deplib in + -L*) func_stripname '-L' '' "$deplib" + func_resolve_sysroot "$func_stripname_result";; + *) func_resolve_sysroot "$deplib" ;; + esac + if $opt_preserve_dup_deps ; then case "$tmp_libs " in - *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;; + *" $func_resolve_sysroot_result "*) + func_append specialdeplibs " $func_resolve_sysroot_result" ;; esac fi - tmp_libs="$tmp_libs $deplib" + func_append tmp_libs " $func_resolve_sysroot_result" done if test "$link_all_deplibs" != no; then # Add the search paths of all dependency libraries for deplib in $dependency_libs; do + path= case $deplib in -L*) path="$deplib" ;; *.la) + func_resolve_sysroot "$deplib" + deplib=$func_resolve_sysroot_result func_dirname "$deplib" "" "." - dir="$func_dirname_result" + dir=$func_dirname_result # We need an absolute path. case $dir in [\\/]* | [A-Za-z]:[\\/]*) absdir="$dir" ;; @@ -5924,8 +7066,8 @@ if test -z "$darwin_install_name"; then darwin_install_name=`${OTOOL64} -L $depdepl | awk '{if (NR == 2) {print $1;exit}}'` fi - compiler_flags="$compiler_flags ${wl}-dylib_file ${wl}${darwin_install_name}:${depdepl}" - linker_flags="$linker_flags -dylib_file ${darwin_install_name}:${depdepl}" + func_append compiler_flags " ${wl}-dylib_file ${wl}${darwin_install_name}:${depdepl}" + func_append linker_flags " -dylib_file ${darwin_install_name}:${depdepl}" path= fi fi @@ -5958,7 +7100,7 @@ compile_deplibs="$new_inherited_linker_flags $compile_deplibs" finalize_deplibs="$new_inherited_linker_flags $finalize_deplibs" else - compiler_flags="$compiler_flags "`$ECHO "X $new_inherited_linker_flags" | $Xsed -e 's% \([^ $]*\).ltframework% -framework \1%g'` + compiler_flags="$compiler_flags "`$ECHO " $new_inherited_linker_flags" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` fi fi dependency_libs="$newdependency_libs" @@ -5975,7 +7117,7 @@ for dir in $newlib_search_path; do case "$lib_search_path " in *" $dir "*) ;; - *) lib_search_path="$lib_search_path $dir" ;; + *) func_append lib_search_path " $dir" ;; esac done newlib_search_path= @@ -6033,10 +7175,10 @@ -L*) case " $tmp_libs " in *" $deplib "*) ;; - *) tmp_libs="$tmp_libs $deplib" ;; + *) func_append tmp_libs " $deplib" ;; esac ;; - *) tmp_libs="$tmp_libs $deplib" ;; + *) func_append tmp_libs " $deplib" ;; esac done eval $var=\"$tmp_libs\" @@ -6052,7 +7194,7 @@ ;; esac if test -n "$i" ; then - tmp_libs="$tmp_libs $i" + func_append tmp_libs " $i" fi done dependency_libs=$tmp_libs @@ -6093,7 +7235,7 @@ # Now set the variables for building old libraries. build_libtool_libs=no oldlibs="$output" - objs="$objs$old_deplibs" + func_append objs "$old_deplibs" ;; lib) @@ -6126,10 +7268,10 @@ if test "$deplibs_check_method" != pass_all; then func_fatal_error "cannot build libtool library \`$output' from non-libtool objects on this host:$objs" else - $ECHO + echo $ECHO "*** Warning: Linking the shared library $output against the non-libtool" $ECHO "*** objects $objs is not portable!" - libobjs="$libobjs $objs" + func_append libobjs " $objs" fi fi @@ -6188,13 +7330,14 @@ # which has an extra 1 added just for fun # case $version_type in + # correct linux to gnu/linux during the next big refactor darwin|linux|osf|windows|none) func_arith $number_major + $number_minor current=$func_arith_result age="$number_minor" revision="$number_revision" ;; - freebsd-aout|freebsd-elf|sunos) + freebsd-aout|freebsd-elf|qnx|sunos) current="$number_major" revision="$number_minor" age="0" @@ -6304,7 +7447,7 @@ versuffix="$major.$revision" ;; - linux) + linux) # correct to gnu/linux during the next big refactor func_arith $current - $age major=.$func_arith_result versuffix="$major.$age.$revision" @@ -6327,7 +7470,7 @@ done # Make executables depend on our current version. - verstring="$verstring:${current}.0" + func_append verstring ":${current}.0" ;; qnx) @@ -6395,10 +7538,10 @@ fi func_generate_dlsyms "$libname" "$libname" "yes" - libobjs="$libobjs $symfileobj" + func_append libobjs " $symfileobj" test "X$libobjs" = "X " && libobjs= - if test "$mode" != relink; then + if test "$opt_mode" != relink; then # Remove our outputs, but don't remove object files since they # may have been created when compiling PIC objects. removelist= @@ -6414,7 +7557,7 @@ continue fi fi - removelist="$removelist $p" + func_append removelist " $p" ;; *) ;; esac @@ -6425,27 +7568,28 @@ # Now set the variables for building old libraries. if test "$build_old_libs" = yes && test "$build_libtool_libs" != convenience ; then - oldlibs="$oldlibs $output_objdir/$libname.$libext" + func_append oldlibs " $output_objdir/$libname.$libext" # Transform .lo files to .o files. - oldobjs="$objs "`$ECHO "X$libobjs" | $SP2NL | $Xsed -e '/\.'${libext}'$/d' -e "$lo2o" | $NL2SP` + oldobjs="$objs "`$ECHO "$libobjs" | $SP2NL | $SED "/\.${libext}$/d; $lo2o" | $NL2SP` fi # Eliminate all temporary directories. #for path in $notinst_path; do - # lib_search_path=`$ECHO "X$lib_search_path " | $Xsed -e "s% $path % %g"` - # deplibs=`$ECHO "X$deplibs " | $Xsed -e "s% -L$path % %g"` - # dependency_libs=`$ECHO "X$dependency_libs " | $Xsed -e "s% -L$path % %g"` + # lib_search_path=`$ECHO "$lib_search_path " | $SED "s% $path % %g"` + # deplibs=`$ECHO "$deplibs " | $SED "s% -L$path % %g"` + # dependency_libs=`$ECHO "$dependency_libs " | $SED "s% -L$path % %g"` #done if test -n "$xrpath"; then # If the user specified any rpath flags, then add them. temp_xrpath= for libdir in $xrpath; do - temp_xrpath="$temp_xrpath -R$libdir" + func_replace_sysroot "$libdir" + func_append temp_xrpath " -R$func_replace_sysroot_result" case "$finalize_rpath " in *" $libdir "*) ;; - *) finalize_rpath="$finalize_rpath $libdir" ;; + *) func_append finalize_rpath " $libdir" ;; esac done if test "$hardcode_into_libs" != yes || test "$build_old_libs" = yes; then @@ -6459,7 +7603,7 @@ for lib in $old_dlfiles; do case " $dlprefiles $dlfiles " in *" $lib "*) ;; - *) dlfiles="$dlfiles $lib" ;; + *) func_append dlfiles " $lib" ;; esac done @@ -6469,19 +7613,19 @@ for lib in $old_dlprefiles; do case "$dlprefiles " in *" $lib "*) ;; - *) dlprefiles="$dlprefiles $lib" ;; + *) func_append dlprefiles " $lib" ;; esac done if test "$build_libtool_libs" = yes; then if test -n "$rpath"; then case $host in - *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-beos* | *-cegcc*) + *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-beos* | *-cegcc* | *-*-haiku*) # these systems don't actually have a c library (as such)! ;; *-*-rhapsody* | *-*-darwin1.[012]) # Rhapsody C library is in the System framework - deplibs="$deplibs System.ltframework" + func_append deplibs " System.ltframework" ;; *-*-netbsd*) # Don't link with libc until the a.out ld.so is fixed. @@ -6498,7 +7642,7 @@ *) # Add libc to deplibs on all other systems if necessary. if test "$build_libtool_need_lc" = "yes"; then - deplibs="$deplibs -lc" + func_append deplibs " -lc" fi ;; esac @@ -6547,7 +7691,7 @@ if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then case " $predeps $postdeps " in *" $i "*) - newdeplibs="$newdeplibs $i" + func_append newdeplibs " $i" i="" ;; esac @@ -6558,21 +7702,21 @@ set dummy $deplib_matches; shift deplib_match=$1 if test `expr "$ldd_output" : ".*$deplib_match"` -ne 0 ; then - newdeplibs="$newdeplibs $i" + func_append newdeplibs " $i" else droppeddeps=yes - $ECHO + echo $ECHO "*** Warning: dynamic linker does not accept needed library $i." - $ECHO "*** I have the capability to make that library automatically link in when" - $ECHO "*** you link to this library. But I can only do this if you have a" - $ECHO "*** shared version of the library, which I believe you do not have" - $ECHO "*** because a test_compile did reveal that the linker did not use it for" - $ECHO "*** its dynamic dependency list that programs get resolved with at runtime." + echo "*** I have the capability to make that library automatically link in when" + echo "*** you link to this library. But I can only do this if you have a" + echo "*** shared version of the library, which I believe you do not have" + echo "*** because a test_compile did reveal that the linker did not use it for" + echo "*** its dynamic dependency list that programs get resolved with at runtime." fi fi ;; *) - newdeplibs="$newdeplibs $i" + func_append newdeplibs " $i" ;; esac done @@ -6590,7 +7734,7 @@ if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then case " $predeps $postdeps " in *" $i "*) - newdeplibs="$newdeplibs $i" + func_append newdeplibs " $i" i="" ;; esac @@ -6601,29 +7745,29 @@ set dummy $deplib_matches; shift deplib_match=$1 if test `expr "$ldd_output" : ".*$deplib_match"` -ne 0 ; then - newdeplibs="$newdeplibs $i" + func_append newdeplibs " $i" else droppeddeps=yes - $ECHO + echo $ECHO "*** Warning: dynamic linker does not accept needed library $i." - $ECHO "*** I have the capability to make that library automatically link in when" - $ECHO "*** you link to this library. But I can only do this if you have a" - $ECHO "*** shared version of the library, which you do not appear to have" - $ECHO "*** because a test_compile did reveal that the linker did not use this one" - $ECHO "*** as a dynamic dependency that programs can get resolved with at runtime." + echo "*** I have the capability to make that library automatically link in when" + echo "*** you link to this library. But I can only do this if you have a" + echo "*** shared version of the library, which you do not appear to have" + echo "*** because a test_compile did reveal that the linker did not use this one" + echo "*** as a dynamic dependency that programs can get resolved with at runtime." fi fi else droppeddeps=yes - $ECHO + echo $ECHO "*** Warning! Library $i is needed by this library but I was not able to" - $ECHO "*** make it link in! You will probably need to install it or some" - $ECHO "*** library that it depends on before this library will be fully" - $ECHO "*** functional. Installing it before continuing would be even better." + echo "*** make it link in! You will probably need to install it or some" + echo "*** library that it depends on before this library will be fully" + echo "*** functional. Installing it before continuing would be even better." fi ;; *) - newdeplibs="$newdeplibs $i" + func_append newdeplibs " $i" ;; esac done @@ -6640,15 +7784,27 @@ if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then case " $predeps $postdeps " in *" $a_deplib "*) - newdeplibs="$newdeplibs $a_deplib" + func_append newdeplibs " $a_deplib" a_deplib="" ;; esac fi if test -n "$a_deplib" ; then libname=`eval "\\$ECHO \"$libname_spec\""` + if test -n "$file_magic_glob"; then + libnameglob=`func_echo_all "$libname" | $SED -e $file_magic_glob` + else + libnameglob=$libname + fi + test "$want_nocaseglob" = yes && nocaseglob=`shopt -p nocaseglob` for i in $lib_search_path $sys_lib_search_path $shlib_search_path; do - potential_libs=`ls $i/$libname[.-]* 2>/dev/null` + if test "$want_nocaseglob" = yes; then + shopt -s nocaseglob + potential_libs=`ls $i/$libnameglob[.-]* 2>/dev/null` + $nocaseglob + else + potential_libs=`ls $i/$libnameglob[.-]* 2>/dev/null` + fi for potent_lib in $potential_libs; do # Follow soft links. if ls -lLd "$potent_lib" 2>/dev/null | @@ -6665,13 +7821,13 @@ potliblink=`ls -ld $potlib | ${SED} 's/.* -> //'` case $potliblink in [\\/]* | [A-Za-z]:[\\/]*) potlib="$potliblink";; - *) potlib=`$ECHO "X$potlib" | $Xsed -e 's,[^/]*$,,'`"$potliblink";; + *) potlib=`$ECHO "$potlib" | $SED 's,[^/]*$,,'`"$potliblink";; esac done if eval $file_magic_cmd \"\$potlib\" 2>/dev/null | $SED -e 10q | $EGREP "$file_magic_regex" > /dev/null; then - newdeplibs="$newdeplibs $a_deplib" + func_append newdeplibs " $a_deplib" a_deplib="" break 2 fi @@ -6680,12 +7836,12 @@ fi if test -n "$a_deplib" ; then droppeddeps=yes - $ECHO + echo $ECHO "*** Warning: linker path does not have real file for library $a_deplib." - $ECHO "*** I have the capability to make that library automatically link in when" - $ECHO "*** you link to this library. But I can only do this if you have a" - $ECHO "*** shared version of the library, which you do not appear to have" - $ECHO "*** because I did check the linker path looking for a file starting" + echo "*** I have the capability to make that library automatically link in when" + echo "*** you link to this library. But I can only do this if you have a" + echo "*** shared version of the library, which you do not appear to have" + echo "*** because I did check the linker path looking for a file starting" if test -z "$potlib" ; then $ECHO "*** with $libname but no candidates were found. (...for file magic test)" else @@ -6696,7 +7852,7 @@ ;; *) # Add a -L argument. - newdeplibs="$newdeplibs $a_deplib" + func_append newdeplibs " $a_deplib" ;; esac done # Gone through all deplibs. @@ -6712,7 +7868,7 @@ if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then case " $predeps $postdeps " in *" $a_deplib "*) - newdeplibs="$newdeplibs $a_deplib" + func_append newdeplibs " $a_deplib" a_deplib="" ;; esac @@ -6723,9 +7879,9 @@ potential_libs=`ls $i/$libname[.-]* 2>/dev/null` for potent_lib in $potential_libs; do potlib="$potent_lib" # see symlink-check above in file_magic test - if eval "\$ECHO \"X$potent_lib\"" 2>/dev/null | $Xsed -e 10q | \ + if eval "\$ECHO \"$potent_lib\"" 2>/dev/null | $SED 10q | \ $EGREP "$match_pattern_regex" > /dev/null; then - newdeplibs="$newdeplibs $a_deplib" + func_append newdeplibs " $a_deplib" a_deplib="" break 2 fi @@ -6734,12 +7890,12 @@ fi if test -n "$a_deplib" ; then droppeddeps=yes - $ECHO + echo $ECHO "*** Warning: linker path does not have real file for library $a_deplib." - $ECHO "*** I have the capability to make that library automatically link in when" - $ECHO "*** you link to this library. But I can only do this if you have a" - $ECHO "*** shared version of the library, which you do not appear to have" - $ECHO "*** because I did check the linker path looking for a file starting" + echo "*** I have the capability to make that library automatically link in when" + echo "*** you link to this library. But I can only do this if you have a" + echo "*** shared version of the library, which you do not appear to have" + echo "*** because I did check the linker path looking for a file starting" if test -z "$potlib" ; then $ECHO "*** with $libname but no candidates were found. (...for regex pattern test)" else @@ -6750,32 +7906,32 @@ ;; *) # Add a -L argument. - newdeplibs="$newdeplibs $a_deplib" + func_append newdeplibs " $a_deplib" ;; esac done # Gone through all deplibs. ;; none | unknown | *) newdeplibs="" - tmp_deplibs=`$ECHO "X $deplibs" | $Xsed \ - -e 's/ -lc$//' -e 's/ -[LR][^ ]*//g'` + tmp_deplibs=`$ECHO " $deplibs" | $SED 's/ -lc$//; s/ -[LR][^ ]*//g'` if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then for i in $predeps $postdeps ; do # can't use Xsed below, because $i might contain '/' - tmp_deplibs=`$ECHO "X $tmp_deplibs" | $Xsed -e "s,$i,,"` + tmp_deplibs=`$ECHO " $tmp_deplibs" | $SED "s,$i,,"` done fi - if $ECHO "X $tmp_deplibs" | $Xsed -e 's/[ ]//g' | - $GREP . >/dev/null; then - $ECHO + case $tmp_deplibs in + *[!\ \ ]*) + echo if test "X$deplibs_check_method" = "Xnone"; then - $ECHO "*** Warning: inter-library dependencies are not supported in this platform." + echo "*** Warning: inter-library dependencies are not supported in this platform." else - $ECHO "*** Warning: inter-library dependencies are not known to be supported." + echo "*** Warning: inter-library dependencies are not known to be supported." fi - $ECHO "*** All declared inter-library dependencies are being dropped." + echo "*** All declared inter-library dependencies are being dropped." droppeddeps=yes - fi + ;; + esac ;; esac versuffix=$versuffix_save @@ -6787,23 +7943,23 @@ case $host in *-*-rhapsody* | *-*-darwin1.[012]) # On Rhapsody replace the C library with the System framework - newdeplibs=`$ECHO "X $newdeplibs" | $Xsed -e 's/ -lc / System.ltframework /'` + newdeplibs=`$ECHO " $newdeplibs" | $SED 's/ -lc / System.ltframework /'` ;; esac if test "$droppeddeps" = yes; then if test "$module" = yes; then - $ECHO - $ECHO "*** Warning: libtool could not satisfy all declared inter-library" + echo + echo "*** Warning: libtool could not satisfy all declared inter-library" $ECHO "*** dependencies of module $libname. Therefore, libtool will create" - $ECHO "*** a static module, that should work as long as the dlopening" - $ECHO "*** application is linked with the -dlopen flag." + echo "*** a static module, that should work as long as the dlopening" + echo "*** application is linked with the -dlopen flag." if test -z "$global_symbol_pipe"; then - $ECHO - $ECHO "*** However, this would only work if libtool was able to extract symbol" - $ECHO "*** lists from a program, using \`nm' or equivalent, but libtool could" - $ECHO "*** not find such a program. So, this module is probably useless." - $ECHO "*** \`nm' from GNU binutils and a full rebuild may help." + echo + echo "*** However, this would only work if libtool was able to extract symbol" + echo "*** lists from a program, using \`nm' or equivalent, but libtool could" + echo "*** not find such a program. So, this module is probably useless." + echo "*** \`nm' from GNU binutils and a full rebuild may help." fi if test "$build_old_libs" = no; then oldlibs="$output_objdir/$libname.$libext" @@ -6813,16 +7969,16 @@ build_libtool_libs=no fi else - $ECHO "*** The inter-library dependencies that have been dropped here will be" - $ECHO "*** automatically added whenever a program is linked with this library" - $ECHO "*** or is declared to -dlopen it." + echo "*** The inter-library dependencies that have been dropped here will be" + echo "*** automatically added whenever a program is linked with this library" + echo "*** or is declared to -dlopen it." if test "$allow_undefined" = no; then - $ECHO - $ECHO "*** Since this library must not contain undefined symbols," - $ECHO "*** because either the platform does not support them or" - $ECHO "*** it was explicitly requested with -no-undefined," - $ECHO "*** libtool will only create a static version of it." + echo + echo "*** Since this library must not contain undefined symbols," + echo "*** because either the platform does not support them or" + echo "*** it was explicitly requested with -no-undefined," + echo "*** libtool will only create a static version of it." if test "$build_old_libs" = no; then oldlibs="$output_objdir/$libname.$libext" build_libtool_libs=module @@ -6839,9 +7995,9 @@ # Time to change all our "foo.ltframework" stuff back to "-framework foo" case $host in *-*-darwin*) - newdeplibs=`$ECHO "X $newdeplibs" | $Xsed -e 's% \([^ $]*\).ltframework% -framework \1%g'` - new_inherited_linker_flags=`$ECHO "X $new_inherited_linker_flags" | $Xsed -e 's% \([^ $]*\).ltframework% -framework \1%g'` - deplibs=`$ECHO "X $deplibs" | $Xsed -e 's% \([^ $]*\).ltframework% -framework \1%g'` + newdeplibs=`$ECHO " $newdeplibs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` + new_inherited_linker_flags=`$ECHO " $new_inherited_linker_flags" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` + deplibs=`$ECHO " $deplibs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` ;; esac @@ -6854,7 +8010,7 @@ *) case " $deplibs " in *" -L$path/$objdir "*) - new_libs="$new_libs -L$path/$objdir" ;; + func_append new_libs " -L$path/$objdir" ;; esac ;; esac @@ -6864,10 +8020,10 @@ -L*) case " $new_libs " in *" $deplib "*) ;; - *) new_libs="$new_libs $deplib" ;; + *) func_append new_libs " $deplib" ;; esac ;; - *) new_libs="$new_libs $deplib" ;; + *) func_append new_libs " $deplib" ;; esac done deplibs="$new_libs" @@ -6879,15 +8035,22 @@ # Test again, we may have decided not to build it any more if test "$build_libtool_libs" = yes; then + # Remove ${wl} instances when linking with ld. + # FIXME: should test the right _cmds variable. + case $archive_cmds in + *\$LD\ *) wl= ;; + esac if test "$hardcode_into_libs" = yes; then # Hardcode the library paths hardcode_libdirs= dep_rpath= rpath="$finalize_rpath" - test "$mode" != relink && rpath="$compile_rpath$rpath" + test "$opt_mode" != relink && rpath="$compile_rpath$rpath" for libdir in $rpath; do if test -n "$hardcode_libdir_flag_spec"; then if test -n "$hardcode_libdir_separator"; then + func_replace_sysroot "$libdir" + libdir=$func_replace_sysroot_result if test -z "$hardcode_libdirs"; then hardcode_libdirs="$libdir" else @@ -6896,18 +8059,18 @@ *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*) ;; *) - hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir" + func_append hardcode_libdirs "$hardcode_libdir_separator$libdir" ;; esac fi else eval flag=\"$hardcode_libdir_flag_spec\" - dep_rpath="$dep_rpath $flag" + func_append dep_rpath " $flag" fi elif test -n "$runpath_var"; then case "$perm_rpath " in *" $libdir "*) ;; - *) perm_rpath="$perm_rpath $libdir" ;; + *) func_append perm_rpath " $libdir" ;; esac fi done @@ -6915,17 +8078,13 @@ if test -n "$hardcode_libdir_separator" && test -n "$hardcode_libdirs"; then libdir="$hardcode_libdirs" - if test -n "$hardcode_libdir_flag_spec_ld"; then - eval dep_rpath=\"$hardcode_libdir_flag_spec_ld\" - else - eval dep_rpath=\"$hardcode_libdir_flag_spec\" - fi + eval "dep_rpath=\"$hardcode_libdir_flag_spec\"" fi if test -n "$runpath_var" && test -n "$perm_rpath"; then # We should set the runpath_var. rpath= for dir in $perm_rpath; do - rpath="$rpath$dir:" + func_append rpath "$dir:" done eval "$runpath_var='$rpath\$$runpath_var'; export $runpath_var" fi @@ -6933,7 +8092,7 @@ fi shlibpath="$finalize_shlibpath" - test "$mode" != relink && shlibpath="$compile_shlibpath$shlibpath" + test "$opt_mode" != relink && shlibpath="$compile_shlibpath$shlibpath" if test -n "$shlibpath"; then eval "$shlibpath_var='$shlibpath\$$shlibpath_var'; export $shlibpath_var" fi @@ -6959,18 +8118,18 @@ linknames= for link do - linknames="$linknames $link" + func_append linknames " $link" done # Use standard objects if they are pic - test -z "$pic_flag" && libobjs=`$ECHO "X$libobjs" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP` + test -z "$pic_flag" && libobjs=`$ECHO "$libobjs" | $SP2NL | $SED "$lo2o" | $NL2SP` test "X$libobjs" = "X " && libobjs= delfiles= if test -n "$export_symbols" && test -n "$include_expsyms"; then $opt_dry_run || cp "$export_symbols" "$output_objdir/$libname.uexp" export_symbols="$output_objdir/$libname.uexp" - delfiles="$delfiles $export_symbols" + func_append delfiles " $export_symbols" fi orig_export_symbols= @@ -7001,13 +8160,45 @@ $opt_dry_run || $RM $export_symbols cmds=$export_symbols_cmds save_ifs="$IFS"; IFS='~' - for cmd in $cmds; do + for cmd1 in $cmds; do IFS="$save_ifs" - eval cmd=\"$cmd\" - func_len " $cmd" - len=$func_len_result - if test "$len" -lt "$max_cmd_len" || test "$max_cmd_len" -le -1; then + # Take the normal branch if the nm_file_list_spec branch + # doesn't work or if tool conversion is not needed. + case $nm_file_list_spec~$to_tool_file_cmd in + *~func_convert_file_noop | *~func_convert_file_msys_to_w32 | ~*) + try_normal_branch=yes + eval cmd=\"$cmd1\" + func_len " $cmd" + len=$func_len_result + ;; + *) + try_normal_branch=no + ;; + esac + if test "$try_normal_branch" = yes \ + && { test "$len" -lt "$max_cmd_len" \ + || test "$max_cmd_len" -le -1; } + then + func_show_eval "$cmd" 'exit $?' + skipped_export=false + elif test -n "$nm_file_list_spec"; then + func_basename "$output" + output_la=$func_basename_result + save_libobjs=$libobjs + save_output=$output + output=${output_objdir}/${output_la}.nm + func_to_tool_file "$output" + libobjs=$nm_file_list_spec$func_to_tool_file_result + func_append delfiles " $output" + func_verbose "creating $NM input file list: $output" + for obj in $save_libobjs; do + func_to_tool_file "$obj" + $ECHO "$func_to_tool_file_result" + done > "$output" + eval cmd=\"$cmd1\" func_show_eval "$cmd" 'exit $?' + output=$save_output + libobjs=$save_libobjs skipped_export=false else # The command line is too long to execute in one step. @@ -7029,7 +8220,7 @@ if test -n "$export_symbols" && test -n "$include_expsyms"; then tmp_export_symbols="$export_symbols" test -n "$orig_export_symbols" && tmp_export_symbols="$orig_export_symbols" - $opt_dry_run || eval '$ECHO "X$include_expsyms" | $Xsed | $SP2NL >> "$tmp_export_symbols"' + $opt_dry_run || eval '$ECHO "$include_expsyms" | $SP2NL >> "$tmp_export_symbols"' fi if test "X$skipped_export" != "X:" && test -n "$orig_export_symbols"; then @@ -7041,7 +8232,7 @@ # global variables. join(1) would be nice here, but unfortunately # isn't a blessed tool. $opt_dry_run || $SED -e '/[ ,]DATA/!d;s,\(.*\)\([ \,].*\),s|^\1$|\1\2|,' < $export_symbols > $output_objdir/$libname.filter - delfiles="$delfiles $export_symbols $output_objdir/$libname.filter" + func_append delfiles " $export_symbols $output_objdir/$libname.filter" export_symbols=$output_objdir/$libname.def $opt_dry_run || $SED -f $output_objdir/$libname.filter < $orig_export_symbols > $export_symbols fi @@ -7051,7 +8242,7 @@ case " $convenience " in *" $test_deplib "*) ;; *) - tmp_deplibs="$tmp_deplibs $test_deplib" + func_append tmp_deplibs " $test_deplib" ;; esac done @@ -7071,21 +8262,21 @@ test "X$libobjs" = "X " && libobjs= else gentop="$output_objdir/${outputname}x" - generated="$generated $gentop" + func_append generated " $gentop" func_extract_archives $gentop $convenience - libobjs="$libobjs $func_extract_archives_result" + func_append libobjs " $func_extract_archives_result" test "X$libobjs" = "X " && libobjs= fi fi if test "$thread_safe" = yes && test -n "$thread_safe_flag_spec"; then eval flag=\"$thread_safe_flag_spec\" - linker_flags="$linker_flags $flag" + func_append linker_flags " $flag" fi # Make a backup of the uninstalled library when relinking - if test "$mode" = relink; then + if test "$opt_mode" = relink; then $opt_dry_run || eval '(cd $output_objdir && $RM ${realname}U && $MV $realname ${realname}U)' || exit $? fi @@ -7130,7 +8321,8 @@ save_libobjs=$libobjs fi save_output=$output - output_la=`$ECHO "X$output" | $Xsed -e "$basename"` + func_basename "$output" + output_la=$func_basename_result # Clear the reloadable object creation command queue and # initialize k to one. @@ -7143,13 +8335,16 @@ if test -n "$save_libobjs" && test "X$skipped_export" != "X:" && test "$with_gnu_ld" = yes; then output=${output_objdir}/${output_la}.lnkscript func_verbose "creating GNU ld script: $output" - $ECHO 'INPUT (' > $output + echo 'INPUT (' > $output for obj in $save_libobjs do - $ECHO "$obj" >> $output + func_to_tool_file "$obj" + $ECHO "$func_to_tool_file_result" >> $output done - $ECHO ')' >> $output - delfiles="$delfiles $output" + echo ')' >> $output + func_append delfiles " $output" + func_to_tool_file "$output" + output=$func_to_tool_file_result elif test -n "$save_libobjs" && test "X$skipped_export" != "X:" && test "X$file_list_spec" != X; then output=${output_objdir}/${output_la}.lnk func_verbose "creating linker input file list: $output" @@ -7163,10 +8358,12 @@ fi for obj do - $ECHO "$obj" >> $output + func_to_tool_file "$obj" + $ECHO "$func_to_tool_file_result" >> $output done - delfiles="$delfiles $output" - output=$firstobj\"$file_list_spec$output\" + func_append delfiles " $output" + func_to_tool_file "$output" + output=$firstobj\"$file_list_spec$func_to_tool_file_result\" else if test -n "$save_libobjs"; then func_verbose "creating reloadable object files..." @@ -7190,17 +8387,19 @@ # command to the queue. if test "$k" -eq 1 ; then # The first file doesn't have a previous command to add. - eval concat_cmds=\"$reload_cmds $objlist $last_robj\" + reload_objs=$objlist + eval concat_cmds=\"$reload_cmds\" else # All subsequent reloadable object files will link in # the last one created. - eval concat_cmds=\"\$concat_cmds~$reload_cmds $objlist $last_robj~\$RM $last_robj\" + reload_objs="$objlist $last_robj" + eval concat_cmds=\"\$concat_cmds~$reload_cmds~\$RM $last_robj\" fi last_robj=$output_objdir/$output_la-${k}.$objext func_arith $k + 1 k=$func_arith_result output=$output_objdir/$output_la-${k}.$objext - objlist=$obj + objlist=" $obj" func_len " $last_robj" func_arith $len0 + $func_len_result len=$func_arith_result @@ -7210,11 +8409,12 @@ # reloadable object file. All subsequent reloadable object # files will link in the last one created. test -z "$concat_cmds" || concat_cmds=$concat_cmds~ - eval concat_cmds=\"\${concat_cmds}$reload_cmds $objlist $last_robj\" + reload_objs="$objlist $last_robj" + eval concat_cmds=\"\${concat_cmds}$reload_cmds\" if test -n "$last_robj"; then eval concat_cmds=\"\${concat_cmds}~\$RM $last_robj\" fi - delfiles="$delfiles $output" + func_append delfiles " $output" else output= @@ -7248,7 +8448,7 @@ lt_exit=$? # Restore the uninstalled library and exit - if test "$mode" = relink; then + if test "$opt_mode" = relink; then ( cd "$output_objdir" && \ $RM "${realname}T" && \ $MV "${realname}U" "$realname" ) @@ -7269,7 +8469,7 @@ if test -n "$export_symbols" && test -n "$include_expsyms"; then tmp_export_symbols="$export_symbols" test -n "$orig_export_symbols" && tmp_export_symbols="$orig_export_symbols" - $opt_dry_run || eval '$ECHO "X$include_expsyms" | $Xsed | $SP2NL >> "$tmp_export_symbols"' + $opt_dry_run || eval '$ECHO "$include_expsyms" | $SP2NL >> "$tmp_export_symbols"' fi if test -n "$orig_export_symbols"; then @@ -7281,7 +8481,7 @@ # global variables. join(1) would be nice here, but unfortunately # isn't a blessed tool. $opt_dry_run || $SED -e '/[ ,]DATA/!d;s,\(.*\)\([ \,].*\),s|^\1$|\1\2|,' < $export_symbols > $output_objdir/$libname.filter - delfiles="$delfiles $export_symbols $output_objdir/$libname.filter" + func_append delfiles " $export_symbols $output_objdir/$libname.filter" export_symbols=$output_objdir/$libname.def $opt_dry_run || $SED -f $output_objdir/$libname.filter < $orig_export_symbols > $export_symbols fi @@ -7322,10 +8522,10 @@ # Add any objects from preloaded convenience libraries if test -n "$dlprefiles"; then gentop="$output_objdir/${outputname}x" - generated="$generated $gentop" + func_append generated " $gentop" func_extract_archives $gentop $dlprefiles - libobjs="$libobjs $func_extract_archives_result" + func_append libobjs " $func_extract_archives_result" test "X$libobjs" = "X " && libobjs= fi @@ -7341,7 +8541,7 @@ lt_exit=$? # Restore the uninstalled library and exit - if test "$mode" = relink; then + if test "$opt_mode" = relink; then ( cd "$output_objdir" && \ $RM "${realname}T" && \ $MV "${realname}U" "$realname" ) @@ -7353,7 +8553,7 @@ IFS="$save_ifs" # Restore the uninstalled library and exit - if test "$mode" = relink; then + if test "$opt_mode" = relink; then $opt_dry_run || eval '(cd $output_objdir && $RM ${realname}T && $MV $realname ${realname}T && $MV ${realname}U $realname)' || exit $? if test -n "$convenience"; then @@ -7434,18 +8634,21 @@ if test -n "$convenience"; then if test -n "$whole_archive_flag_spec"; then eval tmp_whole_archive_flags=\"$whole_archive_flag_spec\" - reload_conv_objs=$reload_objs\ `$ECHO "X$tmp_whole_archive_flags" | $Xsed -e 's|,| |g'` + reload_conv_objs=$reload_objs\ `$ECHO "$tmp_whole_archive_flags" | $SED 's|,| |g'` else gentop="$output_objdir/${obj}x" - generated="$generated $gentop" + func_append generated " $gentop" func_extract_archives $gentop $convenience reload_conv_objs="$reload_objs $func_extract_archives_result" fi fi + # If we're not building shared, we need to use non_pic_objs + test "$build_libtool_libs" != yes && libobjs="$non_pic_objects" + # Create the old-style object. - reload_objs="$objs$old_deplibs "`$ECHO "X$libobjs" | $SP2NL | $Xsed -e '/\.'${libext}$'/d' -e '/\.lib$/d' -e "$lo2o" | $NL2SP`" $reload_conv_objs" ### testsuite: skip nested quoting test + reload_objs="$objs$old_deplibs "`$ECHO "$libobjs" | $SP2NL | $SED "/\.${libext}$/d; /\.lib$/d; $lo2o" | $NL2SP`" $reload_conv_objs" ### testsuite: skip nested quoting test output="$obj" func_execute_cmds "$reload_cmds" 'exit $?' @@ -7505,8 +8708,8 @@ case $host in *-*-rhapsody* | *-*-darwin1.[012]) # On Rhapsody replace the C library is the System framework - compile_deplibs=`$ECHO "X $compile_deplibs" | $Xsed -e 's/ -lc / System.ltframework /'` - finalize_deplibs=`$ECHO "X $finalize_deplibs" | $Xsed -e 's/ -lc / System.ltframework /'` + compile_deplibs=`$ECHO " $compile_deplibs" | $SED 's/ -lc / System.ltframework /'` + finalize_deplibs=`$ECHO " $finalize_deplibs" | $SED 's/ -lc / System.ltframework /'` ;; esac @@ -7517,14 +8720,14 @@ if test "$tagname" = CXX ; then case ${MACOSX_DEPLOYMENT_TARGET-10.0} in 10.[0123]) - compile_command="$compile_command ${wl}-bind_at_load" - finalize_command="$finalize_command ${wl}-bind_at_load" + func_append compile_command " ${wl}-bind_at_load" + func_append finalize_command " ${wl}-bind_at_load" ;; esac fi # Time to change all our "foo.ltframework" stuff back to "-framework foo" - compile_deplibs=`$ECHO "X $compile_deplibs" | $Xsed -e 's% \([^ $]*\).ltframework% -framework \1%g'` - finalize_deplibs=`$ECHO "X $finalize_deplibs" | $Xsed -e 's% \([^ $]*\).ltframework% -framework \1%g'` + compile_deplibs=`$ECHO " $compile_deplibs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` + finalize_deplibs=`$ECHO " $finalize_deplibs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` ;; esac @@ -7538,7 +8741,7 @@ *) case " $compile_deplibs " in *" -L$path/$objdir "*) - new_libs="$new_libs -L$path/$objdir" ;; + func_append new_libs " -L$path/$objdir" ;; esac ;; esac @@ -7548,17 +8751,17 @@ -L*) case " $new_libs " in *" $deplib "*) ;; - *) new_libs="$new_libs $deplib" ;; + *) func_append new_libs " $deplib" ;; esac ;; - *) new_libs="$new_libs $deplib" ;; + *) func_append new_libs " $deplib" ;; esac done compile_deplibs="$new_libs" - compile_command="$compile_command $compile_deplibs" - finalize_command="$finalize_command $finalize_deplibs" + func_append compile_command " $compile_deplibs" + func_append finalize_command " $finalize_deplibs" if test -n "$rpath$xrpath"; then # If the user specified any rpath flags, then add them. @@ -7566,7 +8769,7 @@ # This is the magic to use -rpath. case "$finalize_rpath " in *" $libdir "*) ;; - *) finalize_rpath="$finalize_rpath $libdir" ;; + *) func_append finalize_rpath " $libdir" ;; esac done fi @@ -7585,18 +8788,18 @@ *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*) ;; *) - hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir" + func_append hardcode_libdirs "$hardcode_libdir_separator$libdir" ;; esac fi else eval flag=\"$hardcode_libdir_flag_spec\" - rpath="$rpath $flag" + func_append rpath " $flag" fi elif test -n "$runpath_var"; then case "$perm_rpath " in *" $libdir "*) ;; - *) perm_rpath="$perm_rpath $libdir" ;; + *) func_append perm_rpath " $libdir" ;; esac fi case $host in @@ -7605,12 +8808,12 @@ case :$dllsearchpath: in *":$libdir:"*) ;; ::) dllsearchpath=$libdir;; - *) dllsearchpath="$dllsearchpath:$libdir";; + *) func_append dllsearchpath ":$libdir";; esac case :$dllsearchpath: in *":$testbindir:"*) ;; ::) dllsearchpath=$testbindir;; - *) dllsearchpath="$dllsearchpath:$testbindir";; + *) func_append dllsearchpath ":$testbindir";; esac ;; esac @@ -7636,18 +8839,18 @@ *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*) ;; *) - hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir" + func_append hardcode_libdirs "$hardcode_libdir_separator$libdir" ;; esac fi else eval flag=\"$hardcode_libdir_flag_spec\" - rpath="$rpath $flag" + func_append rpath " $flag" fi elif test -n "$runpath_var"; then case "$finalize_perm_rpath " in *" $libdir "*) ;; - *) finalize_perm_rpath="$finalize_perm_rpath $libdir" ;; + *) func_append finalize_perm_rpath " $libdir" ;; esac fi done @@ -7661,8 +8864,8 @@ if test -n "$libobjs" && test "$build_old_libs" = yes; then # Transform all the library objects into standard objects. - compile_command=`$ECHO "X$compile_command" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP` - finalize_command=`$ECHO "X$finalize_command" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP` + compile_command=`$ECHO "$compile_command" | $SP2NL | $SED "$lo2o" | $NL2SP` + finalize_command=`$ECHO "$finalize_command" | $SP2NL | $SED "$lo2o" | $NL2SP` fi func_generate_dlsyms "$outputname" "@PROGRAM@" "no" @@ -7674,15 +8877,15 @@ wrappers_required=yes case $host in + *cegcc* | *mingw32ce*) + # Disable wrappers for cegcc and mingw32ce hosts, we are cross compiling anyway. + wrappers_required=no + ;; *cygwin* | *mingw* ) if test "$build_libtool_libs" != yes; then wrappers_required=no fi ;; - *cegcc) - # Disable wrappers for cegcc, we are cross compiling anyway. - wrappers_required=no - ;; *) if test "$need_relink" = no || test "$build_libtool_libs" != yes; then wrappers_required=no @@ -7691,13 +8894,19 @@ esac if test "$wrappers_required" = no; then # Replace the output file specification. - compile_command=`$ECHO "X$compile_command" | $Xsed -e 's%@OUTPUT@%'"$output"'%g'` + compile_command=`$ECHO "$compile_command" | $SED 's%@OUTPUT@%'"$output"'%g'` link_command="$compile_command$compile_rpath" # We have no uninstalled library dependencies, so finalize right now. exit_status=0 func_show_eval "$link_command" 'exit_status=$?' + if test -n "$postlink_cmds"; then + func_to_tool_file "$output" + postlink_cmds=`func_echo_all "$postlink_cmds" | $SED -e 's%@OUTPUT@%'"$output"'%g' -e 's%@TOOL_OUTPUT@%'"$func_to_tool_file_result"'%g'` + func_execute_cmds "$postlink_cmds" 'exit $?' + fi + # Delete the generated files. if test -f "$output_objdir/${outputname}S.${objext}"; then func_show_eval '$RM "$output_objdir/${outputname}S.${objext}"' @@ -7720,7 +8929,7 @@ # We should set the runpath_var. rpath= for dir in $perm_rpath; do - rpath="$rpath$dir:" + func_append rpath "$dir:" done compile_var="$runpath_var=\"$rpath\$$runpath_var\" " fi @@ -7728,7 +8937,7 @@ # We should set the runpath_var. rpath= for dir in $finalize_perm_rpath; do - rpath="$rpath$dir:" + func_append rpath "$dir:" done finalize_var="$runpath_var=\"$rpath\$$runpath_var\" " fi @@ -7738,11 +8947,18 @@ # We don't need to create a wrapper script. link_command="$compile_var$compile_command$compile_rpath" # Replace the output file specification. - link_command=`$ECHO "X$link_command" | $Xsed -e 's%@OUTPUT@%'"$output"'%g'` + link_command=`$ECHO "$link_command" | $SED 's%@OUTPUT@%'"$output"'%g'` # Delete the old output file. $opt_dry_run || $RM $output # Link the executable and exit func_show_eval "$link_command" 'exit $?' + + if test -n "$postlink_cmds"; then + func_to_tool_file "$output" + postlink_cmds=`func_echo_all "$postlink_cmds" | $SED -e 's%@OUTPUT@%'"$output"'%g' -e 's%@TOOL_OUTPUT@%'"$func_to_tool_file_result"'%g'` + func_execute_cmds "$postlink_cmds" 'exit $?' + fi + exit $EXIT_SUCCESS fi @@ -7757,7 +8973,7 @@ if test "$fast_install" != no; then link_command="$finalize_var$compile_command$finalize_rpath" if test "$fast_install" = yes; then - relink_command=`$ECHO "X$compile_var$compile_command$compile_rpath" | $Xsed -e 's%@OUTPUT@%\$progdir/\$file%g'` + relink_command=`$ECHO "$compile_var$compile_command$compile_rpath" | $SED 's%@OUTPUT@%\$progdir/\$file%g'` else # fast_install is set to needless relink_command= @@ -7769,13 +8985,19 @@ fi # Replace the output file specification. - link_command=`$ECHO "X$link_command" | $Xsed -e 's%@OUTPUT@%'"$output_objdir/$outputname"'%g'` + link_command=`$ECHO "$link_command" | $SED 's%@OUTPUT@%'"$output_objdir/$outputname"'%g'` # Delete the old output files. $opt_dry_run || $RM $output $output_objdir/$outputname $output_objdir/lt-$outputname func_show_eval "$link_command" 'exit $?' + if test -n "$postlink_cmds"; then + func_to_tool_file "$output_objdir/$outputname" + postlink_cmds=`func_echo_all "$postlink_cmds" | $SED -e 's%@OUTPUT@%'"$output_objdir/$outputname"'%g' -e 's%@TOOL_OUTPUT@%'"$func_to_tool_file_result"'%g'` + func_execute_cmds "$postlink_cmds" 'exit $?' + fi + # Now create the wrapper script. func_verbose "creating $output" @@ -7793,18 +9015,7 @@ fi done relink_command="(cd `pwd`; $relink_command)" - relink_command=`$ECHO "X$relink_command" | $Xsed -e "$sed_quote_subst"` - fi - - # Quote $ECHO for shipping. - if test "X$ECHO" = "X$SHELL $progpath --fallback-echo"; then - case $progpath in - [\\/]* | [A-Za-z]:[\\/]*) qecho="$SHELL $progpath --fallback-echo";; - *) qecho="$SHELL `pwd`/$progpath --fallback-echo";; - esac - qecho=`$ECHO "X$qecho" | $Xsed -e "$sed_quote_subst"` - else - qecho=`$ECHO "X$ECHO" | $Xsed -e "$sed_quote_subst"` + relink_command=`$ECHO "$relink_command" | $SED "$sed_quote_subst"` fi # Only actually do things if not in dry run mode. @@ -7884,7 +9095,7 @@ else oldobjs="$old_deplibs $non_pic_objects" if test "$preload" = yes && test -f "$symfileobj"; then - oldobjs="$oldobjs $symfileobj" + func_append oldobjs " $symfileobj" fi fi addlibs="$old_convenience" @@ -7892,10 +9103,10 @@ if test -n "$addlibs"; then gentop="$output_objdir/${outputname}x" - generated="$generated $gentop" + func_append generated " $gentop" func_extract_archives $gentop $addlibs - oldobjs="$oldobjs $func_extract_archives_result" + func_append oldobjs " $func_extract_archives_result" fi # Do each command in the archive commands. @@ -7906,10 +9117,10 @@ # Add any objects from preloaded convenience libraries if test -n "$dlprefiles"; then gentop="$output_objdir/${outputname}x" - generated="$generated $gentop" + func_append generated " $gentop" func_extract_archives $gentop $dlprefiles - oldobjs="$oldobjs $func_extract_archives_result" + func_append oldobjs " $func_extract_archives_result" fi # POSIX demands no paths to be encoded in archives. We have @@ -7925,9 +9136,9 @@ done | sort | sort -uc >/dev/null 2>&1); then : else - $ECHO "copying selected object files to avoid basename conflicts..." + echo "copying selected object files to avoid basename conflicts..." gentop="$output_objdir/${outputname}x" - generated="$generated $gentop" + func_append generated " $gentop" func_mkdir_p "$gentop" save_oldobjs=$oldobjs oldobjs= @@ -7951,18 +9162,30 @@ esac done func_show_eval "ln $obj $gentop/$newobj || cp $obj $gentop/$newobj" - oldobjs="$oldobjs $gentop/$newobj" + func_append oldobjs " $gentop/$newobj" ;; - *) oldobjs="$oldobjs $obj" ;; + *) func_append oldobjs " $obj" ;; esac done fi + func_to_tool_file "$oldlib" func_convert_file_msys_to_w32 + tool_oldlib=$func_to_tool_file_result eval cmds=\"$old_archive_cmds\" func_len " $cmds" len=$func_len_result if test "$len" -lt "$max_cmd_len" || test "$max_cmd_len" -le -1; then cmds=$old_archive_cmds + elif test -n "$archiver_list_spec"; then + func_verbose "using command file archive linking..." + for obj in $oldobjs + do + func_to_tool_file "$obj" + $ECHO "$func_to_tool_file_result" + done > $output_objdir/$libname.libcmd + func_to_tool_file "$output_objdir/$libname.libcmd" + oldobjs=" $archiver_list_spec$func_to_tool_file_result" + cmds=$old_archive_cmds else # the command line is too long to link in one step, link in parts func_verbose "using piecewise archive linking..." @@ -8036,7 +9259,7 @@ done # Quote the link command for shipping. relink_command="(cd `pwd`; $SHELL $progpath $preserve_args --mode=relink $libtool_args @inst_prefix_dir@)" - relink_command=`$ECHO "X$relink_command" | $Xsed -e "$sed_quote_subst"` + relink_command=`$ECHO "$relink_command" | $SED "$sed_quote_subst"` if test "$hardcode_automatic" = yes ; then relink_command= fi @@ -8056,12 +9279,23 @@ *.la) func_basename "$deplib" name="$func_basename_result" - eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $deplib` + func_resolve_sysroot "$deplib" + eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $func_resolve_sysroot_result` test -z "$libdir" && \ func_fatal_error "\`$deplib' is not a valid libtool archive" - newdependency_libs="$newdependency_libs $libdir/$name" + func_append newdependency_libs " ${lt_sysroot:+=}$libdir/$name" + ;; + -L*) + func_stripname -L '' "$deplib" + func_replace_sysroot "$func_stripname_result" + func_append newdependency_libs " -L$func_replace_sysroot_result" ;; - *) newdependency_libs="$newdependency_libs $deplib" ;; + -R*) + func_stripname -R '' "$deplib" + func_replace_sysroot "$func_stripname_result" + func_append newdependency_libs " -R$func_replace_sysroot_result" + ;; + *) func_append newdependency_libs " $deplib" ;; esac done dependency_libs="$newdependency_libs" @@ -8075,9 +9309,9 @@ eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $lib` test -z "$libdir" && \ func_fatal_error "\`$lib' is not a valid libtool archive" - newdlfiles="$newdlfiles $libdir/$name" + func_append newdlfiles " ${lt_sysroot:+=}$libdir/$name" ;; - *) newdlfiles="$newdlfiles $lib" ;; + *) func_append newdlfiles " $lib" ;; esac done dlfiles="$newdlfiles" @@ -8094,7 +9328,7 @@ eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $lib` test -z "$libdir" && \ func_fatal_error "\`$lib' is not a valid libtool archive" - newdlprefiles="$newdlprefiles $libdir/$name" + func_append newdlprefiles " ${lt_sysroot:+=}$libdir/$name" ;; esac done @@ -8106,7 +9340,7 @@ [\\/]* | [A-Za-z]:[\\/]*) abs="$lib" ;; *) abs=`pwd`"/$lib" ;; esac - newdlfiles="$newdlfiles $abs" + func_append newdlfiles " $abs" done dlfiles="$newdlfiles" newdlprefiles= @@ -8115,15 +9349,33 @@ [\\/]* | [A-Za-z]:[\\/]*) abs="$lib" ;; *) abs=`pwd`"/$lib" ;; esac - newdlprefiles="$newdlprefiles $abs" + func_append newdlprefiles " $abs" done dlprefiles="$newdlprefiles" fi $RM $output # place dlname in correct position for cygwin + # In fact, it would be nice if we could use this code for all target + # systems that can't hard-code library paths into their executables + # and that have no shared library path variable independent of PATH, + # but it turns out we can't easily determine that from inspecting + # libtool variables, so we have to hard-code the OSs to which it + # applies here; at the moment, that means platforms that use the PE + # object format with DLL files. See the long comment at the top of + # tests/bindir.at for full details. tdlname=$dlname case $host,$output,$installed,$module,$dlname in - *cygwin*,*lai,yes,no,*.dll | *mingw*,*lai,yes,no,*.dll | *cegcc*,*lai,yes,no,*.dll) tdlname=../bin/$dlname ;; + *cygwin*,*lai,yes,no,*.dll | *mingw*,*lai,yes,no,*.dll | *cegcc*,*lai,yes,no,*.dll) + # If a -bindir argument was supplied, place the dll there. + if test "x$bindir" != x ; + then + func_relative_path "$install_libdir" "$bindir" + tdlname=$func_relative_path_result$dlname + else + # Otherwise fall back on heuristic. + tdlname=../bin/$dlname + fi + ;; esac $ECHO > $output "\ # $outputname - a libtool library file @@ -8182,7 +9434,7 @@ exit $EXIT_SUCCESS } -{ test "$mode" = link || test "$mode" = relink; } && +{ test "$opt_mode" = link || test "$opt_mode" = relink; } && func_mode_link ${1+"$@"} @@ -8202,9 +9454,9 @@ for arg do case $arg in - -f) RM="$RM $arg"; rmforce=yes ;; - -*) RM="$RM $arg" ;; - *) files="$files $arg" ;; + -f) func_append RM " $arg"; rmforce=yes ;; + -*) func_append RM " $arg" ;; + *) func_append files " $arg" ;; esac done @@ -8213,24 +9465,23 @@ rmdirs= - origobjdir="$objdir" for file in $files; do func_dirname "$file" "" "." dir="$func_dirname_result" if test "X$dir" = X.; then - objdir="$origobjdir" + odir="$objdir" else - objdir="$dir/$origobjdir" + odir="$dir/$objdir" fi func_basename "$file" name="$func_basename_result" - test "$mode" = uninstall && objdir="$dir" + test "$opt_mode" = uninstall && odir="$dir" - # Remember objdir for removal later, being careful to avoid duplicates - if test "$mode" = clean; then + # Remember odir for removal later, being careful to avoid duplicates + if test "$opt_mode" = clean; then case " $rmdirs " in - *" $objdir "*) ;; - *) rmdirs="$rmdirs $objdir" ;; + *" $odir "*) ;; + *) func_append rmdirs " $odir" ;; esac fi @@ -8256,18 +9507,17 @@ # Delete the libtool libraries and symlinks. for n in $library_names; do - rmfiles="$rmfiles $objdir/$n" + func_append rmfiles " $odir/$n" done - test -n "$old_library" && rmfiles="$rmfiles $objdir/$old_library" + test -n "$old_library" && func_append rmfiles " $odir/$old_library" - case "$mode" in + case "$opt_mode" in clean) - case " $library_names " in - # " " in the beginning catches empty $dlname + case " $library_names " in *" $dlname "*) ;; - *) rmfiles="$rmfiles $objdir/$dlname" ;; + *) test -n "$dlname" && func_append rmfiles " $odir/$dlname" ;; esac - test -n "$libdir" && rmfiles="$rmfiles $objdir/$name $objdir/${name}i" + test -n "$libdir" && func_append rmfiles " $odir/$name $odir/${name}i" ;; uninstall) if test -n "$library_names"; then @@ -8295,19 +9545,19 @@ # Add PIC object to the list of files to remove. if test -n "$pic_object" && test "$pic_object" != none; then - rmfiles="$rmfiles $dir/$pic_object" + func_append rmfiles " $dir/$pic_object" fi # Add non-PIC object to the list of files to remove. if test -n "$non_pic_object" && test "$non_pic_object" != none; then - rmfiles="$rmfiles $dir/$non_pic_object" + func_append rmfiles " $dir/$non_pic_object" fi fi ;; *) - if test "$mode" = clean ; then + if test "$opt_mode" = clean ; then noexename=$name case $file in *.exe) @@ -8317,7 +9567,7 @@ noexename=$func_stripname_result # $file with .exe has already been added to rmfiles, # add $file without .exe - rmfiles="$rmfiles $file" + func_append rmfiles " $file" ;; esac # Do a test to see if this is a libtool program. @@ -8326,7 +9576,7 @@ func_ltwrapper_scriptname "$file" relink_command= func_source $func_ltwrapper_scriptname_result - rmfiles="$rmfiles $func_ltwrapper_scriptname_result" + func_append rmfiles " $func_ltwrapper_scriptname_result" else relink_command= func_source $dir/$noexename @@ -8334,12 +9584,12 @@ # note $name still contains .exe if it was in $file originally # as does the version of $file that was added into $rmfiles - rmfiles="$rmfiles $objdir/$name $objdir/${name}S.${objext}" + func_append rmfiles " $odir/$name $odir/${name}S.${objext}" if test "$fast_install" = yes && test -n "$relink_command"; then - rmfiles="$rmfiles $objdir/lt-$name" + func_append rmfiles " $odir/lt-$name" fi if test "X$noexename" != "X$name" ; then - rmfiles="$rmfiles $objdir/lt-${noexename}.c" + func_append rmfiles " $odir/lt-${noexename}.c" fi fi fi @@ -8347,7 +9597,6 @@ esac func_show_eval "$RM $rmfiles" 'exit_status=1' done - objdir="$origobjdir" # Try to remove the ${objdir}s in the directories where we deleted files for dir in $rmdirs; do @@ -8359,16 +9608,16 @@ exit $exit_status } -{ test "$mode" = uninstall || test "$mode" = clean; } && +{ test "$opt_mode" = uninstall || test "$opt_mode" = clean; } && func_mode_uninstall ${1+"$@"} -test -z "$mode" && { +test -z "$opt_mode" && { help="$generic_help" func_fatal_help "you must specify a MODE" } test -z "$exec_cmd" && \ - func_fatal_help "invalid operation mode \`$mode'" + func_fatal_help "invalid operation mode \`$opt_mode'" if test -n "$exec_cmd"; then eval exec "$exec_cmd" diff -Nru libdap-3.11.1/conf/ltoptions.m4 libdap-3.12.0/conf/ltoptions.m4 --- libdap-3.11.1/conf/ltoptions.m4 2011-05-06 17:36:21.000000000 +0000 +++ libdap-3.12.0/conf/ltoptions.m4 2013-10-17 21:27:40.000000000 +0000 @@ -1,13 +1,14 @@ # Helper functions for option handling. -*- Autoconf -*- # -# Copyright (C) 2004, 2005, 2007, 2008 Free Software Foundation, Inc. +# Copyright (C) 2004, 2005, 2007, 2008, 2009 Free Software Foundation, +# Inc. # Written by Gary V. Vaughan, 2004 # # This file is free software; the Free Software Foundation gives # unlimited permission to copy and/or distribute it, with or without # modifications, as long as this notice is preserved. -# serial 6 ltoptions.m4 +# serial 7 ltoptions.m4 # This is to help aclocal find these macros, as it can't see m4_define. AC_DEFUN([LTOPTIONS_VERSION], [m4_if([1])]) @@ -125,7 +126,7 @@ [enable_win32_dll=yes case $host in -*-*-cygwin* | *-*-mingw* | *-*-pw32* | *-cegcc*) +*-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-cegcc*) AC_CHECK_TOOL(AS, as, false) AC_CHECK_TOOL(DLLTOOL, dlltool, false) AC_CHECK_TOOL(OBJDUMP, objdump, false) @@ -133,13 +134,13 @@ esac test -z "$AS" && AS=as -_LT_DECL([], [AS], [0], [Assembler program])dnl +_LT_DECL([], [AS], [1], [Assembler program])dnl test -z "$DLLTOOL" && DLLTOOL=dlltool -_LT_DECL([], [DLLTOOL], [0], [DLL creation program])dnl +_LT_DECL([], [DLLTOOL], [1], [DLL creation program])dnl test -z "$OBJDUMP" && OBJDUMP=objdump -_LT_DECL([], [OBJDUMP], [0], [Object dumper program])dnl +_LT_DECL([], [OBJDUMP], [1], [Object dumper program])dnl ])# win32-dll AU_DEFUN([AC_LIBTOOL_WIN32_DLL], @@ -325,9 +326,24 @@ # MODE is either `yes' or `no'. If omitted, it defaults to `both'. m4_define([_LT_WITH_PIC], [AC_ARG_WITH([pic], - [AS_HELP_STRING([--with-pic], + [AS_HELP_STRING([--with-pic@<:@=PKGS@:>@], [try to use only PIC/non-PIC objects @<:@default=use both@:>@])], - [pic_mode="$withval"], + [lt_p=${PACKAGE-default} + case $withval in + yes|no) pic_mode=$withval ;; + *) + pic_mode=default + # Look at the argument we got. We use all the common list separators. + lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," + for lt_pkg in $withval; do + IFS="$lt_save_ifs" + if test "X$lt_pkg" = "X$lt_p"; then + pic_mode=yes + fi + done + IFS="$lt_save_ifs" + ;; + esac], [pic_mode=default]) test -z "$pic_mode" && pic_mode=m4_default([$1], [default]) diff -Nru libdap-3.11.1/conf/ltversion.m4 libdap-3.12.0/conf/ltversion.m4 --- libdap-3.11.1/conf/ltversion.m4 2011-05-06 17:36:21.000000000 +0000 +++ libdap-3.12.0/conf/ltversion.m4 2013-10-17 21:27:40.000000000 +0000 @@ -7,17 +7,17 @@ # unlimited permission to copy and/or distribute it, with or without # modifications, as long as this notice is preserved. -# Generated from ltversion.in. +# @configure_input@ -# serial 3017 ltversion.m4 +# serial 3337 ltversion.m4 # This file is part of GNU Libtool -m4_define([LT_PACKAGE_VERSION], [2.2.6b]) -m4_define([LT_PACKAGE_REVISION], [1.3017]) +m4_define([LT_PACKAGE_VERSION], [2.4.2]) +m4_define([LT_PACKAGE_REVISION], [1.3337]) AC_DEFUN([LTVERSION_VERSION], -[macro_version='2.2.6b' -macro_revision='1.3017' +[macro_version='2.4.2' +macro_revision='1.3337' _LT_DECL(, macro_version, 0, [Which release of libtool.m4 was used?]) _LT_DECL(, macro_revision, 0) ]) diff -Nru libdap-3.11.1/conf/lt~obsolete.m4 libdap-3.12.0/conf/lt~obsolete.m4 --- libdap-3.11.1/conf/lt~obsolete.m4 2011-05-06 17:36:22.000000000 +0000 +++ libdap-3.12.0/conf/lt~obsolete.m4 2013-10-17 21:27:40.000000000 +0000 @@ -1,13 +1,13 @@ # lt~obsolete.m4 -- aclocal satisfying obsolete definitions. -*-Autoconf-*- # -# Copyright (C) 2004, 2005, 2007 Free Software Foundation, Inc. +# Copyright (C) 2004, 2005, 2007, 2009 Free Software Foundation, Inc. # Written by Scott James Remnant, 2004. # # This file is free software; the Free Software Foundation gives # unlimited permission to copy and/or distribute it, with or without # modifications, as long as this notice is preserved. -# serial 4 lt~obsolete.m4 +# serial 5 lt~obsolete.m4 # These exist entirely to fool aclocal when bootstrapping libtool. # @@ -77,7 +77,6 @@ m4_ifndef([_LT_AC_LANG_CXX], [AC_DEFUN([_LT_AC_LANG_CXX])]) m4_ifndef([_LT_AC_LANG_F77], [AC_DEFUN([_LT_AC_LANG_F77])]) m4_ifndef([_LT_AC_LANG_GCJ], [AC_DEFUN([_LT_AC_LANG_GCJ])]) -m4_ifndef([AC_LIBTOOL_RC], [AC_DEFUN([AC_LIBTOOL_RC])]) m4_ifndef([AC_LIBTOOL_LANG_C_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_C_CONFIG])]) m4_ifndef([_LT_AC_LANG_C_CONFIG], [AC_DEFUN([_LT_AC_LANG_C_CONFIG])]) m4_ifndef([AC_LIBTOOL_LANG_CXX_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_CXX_CONFIG])]) @@ -90,3 +89,10 @@ m4_ifndef([_LT_AC_LANG_RC_CONFIG], [AC_DEFUN([_LT_AC_LANG_RC_CONFIG])]) m4_ifndef([AC_LIBTOOL_CONFIG], [AC_DEFUN([AC_LIBTOOL_CONFIG])]) m4_ifndef([_LT_AC_FILE_LTDLL_C], [AC_DEFUN([_LT_AC_FILE_LTDLL_C])]) +m4_ifndef([_LT_REQUIRED_DARWIN_CHECKS], [AC_DEFUN([_LT_REQUIRED_DARWIN_CHECKS])]) +m4_ifndef([_LT_AC_PROG_CXXCPP], [AC_DEFUN([_LT_AC_PROG_CXXCPP])]) +m4_ifndef([_LT_PREPARE_SED_QUOTE_VARS], [AC_DEFUN([_LT_PREPARE_SED_QUOTE_VARS])]) +m4_ifndef([_LT_PROG_ECHO_BACKSLASH], [AC_DEFUN([_LT_PROG_ECHO_BACKSLASH])]) +m4_ifndef([_LT_PROG_F77], [AC_DEFUN([_LT_PROG_F77])]) +m4_ifndef([_LT_PROG_FC], [AC_DEFUN([_LT_PROG_FC])]) +m4_ifndef([_LT_PROG_CXX], [AC_DEFUN([_LT_PROG_CXX])]) diff -Nru libdap-3.11.1/conf/missing libdap-3.12.0/conf/missing --- libdap-3.11.1/conf/missing 2011-05-06 17:36:28.000000000 +0000 +++ libdap-3.12.0/conf/missing 2013-10-17 21:27:40.000000000 +0000 @@ -1,10 +1,9 @@ #! /bin/sh # Common stub for a few missing GNU programs while installing. -scriptversion=2009-04-28.21; # UTC +scriptversion=2012-01-06.18; # UTC -# Copyright (C) 1996, 1997, 1999, 2000, 2002, 2003, 2004, 2005, 2006, -# 2008, 2009 Free Software Foundation, Inc. +# Copyright (C) 1996-2012 Free Software Foundation, Inc. # Originally by Fran,cois Pinard , 1996. # This program is free software; you can redistribute it and/or modify @@ -26,7 +25,7 @@ # the same distribution terms that you use for the rest of that program. if test $# -eq 0; then - echo 1>&2 "Try \`$0 --help' for more information" + echo 1>&2 "Try '$0 --help' for more information" exit 1 fi @@ -34,7 +33,7 @@ sed_output='s/.* --output[ =]\([^ ]*\).*/\1/p' sed_minuso='s/.* -o \([^ ]*\).*/\1/p' -# In the cases where this matters, `missing' is being run in the +# In the cases where this matters, 'missing' is being run in the # srcdir already. if test -f configure.ac; then configure_ac=configure.ac @@ -65,7 +64,7 @@ echo "\ $0 [OPTION]... PROGRAM [ARGUMENT]... -Handle \`PROGRAM [ARGUMENT]...' for when PROGRAM is missing, or return an +Handle 'PROGRAM [ARGUMENT]...' for when PROGRAM is missing, or return an error status if there is no known handling for PROGRAM. Options: @@ -74,21 +73,20 @@ --run try to run the given command, and emulate it if it fails Supported PROGRAM values: - aclocal touch file \`aclocal.m4' - autoconf touch file \`configure' - autoheader touch file \`config.h.in' + aclocal touch file 'aclocal.m4' + autoconf touch file 'configure' + autoheader touch file 'config.h.in' autom4te touch the output file, or create a stub one - automake touch all \`Makefile.in' files - bison create \`y.tab.[ch]', if possible, from existing .[ch] - flex create \`lex.yy.c', if possible, from existing .c + automake touch all 'Makefile.in' files + bison create 'y.tab.[ch]', if possible, from existing .[ch] + flex create 'lex.yy.c', if possible, from existing .c help2man touch the output file - lex create \`lex.yy.c', if possible, from existing .c + lex create 'lex.yy.c', if possible, from existing .c makeinfo touch the output file - tar try tar, gnutar, gtar, then tar without non-portable flags - yacc create \`y.tab.[ch]', if possible, from existing .[ch] + yacc create 'y.tab.[ch]', if possible, from existing .[ch] -Version suffixes to PROGRAM as well as the prefixes \`gnu-', \`gnu', and -\`g' are ignored when checking the name. +Version suffixes to PROGRAM as well as the prefixes 'gnu-', 'gnu', and +'g' are ignored when checking the name. Send bug reports to ." exit $? @@ -100,8 +98,8 @@ ;; -*) - echo 1>&2 "$0: Unknown \`$1' option" - echo 1>&2 "Try \`$0 --help' for more information" + echo 1>&2 "$0: Unknown '$1' option" + echo 1>&2 "Try '$0 --help' for more information" exit 1 ;; @@ -122,22 +120,13 @@ # Not GNU programs, they don't have --version. ;; - tar*) - if test -n "$run"; then - echo 1>&2 "ERROR: \`tar' requires --run" - exit 1 - elif test "x$2" = "x--version" || test "x$2" = "x--help"; then - exit 1 - fi - ;; - *) if test -z "$run" && ($1 --version) > /dev/null 2>&1; then # We have it, but it failed. exit 1 elif test "x$2" = "x--version" || test "x$2" = "x--help"; then # Could not run --version or --help. This is probably someone - # running `$TOOL --version' or `$TOOL --help' to check whether + # running '$TOOL --version' or '$TOOL --help' to check whether # $TOOL exists and not knowing $TOOL uses missing. exit 1 fi @@ -149,27 +138,27 @@ case $program in aclocal*) echo 1>&2 "\ -WARNING: \`$1' is $msg. You should only need it if - you modified \`acinclude.m4' or \`${configure_ac}'. You might want - to install the \`Automake' and \`Perl' packages. Grab them from +WARNING: '$1' is $msg. You should only need it if + you modified 'acinclude.m4' or '${configure_ac}'. You might want + to install the Automake and Perl packages. Grab them from any GNU archive site." touch aclocal.m4 ;; autoconf*) echo 1>&2 "\ -WARNING: \`$1' is $msg. You should only need it if - you modified \`${configure_ac}'. You might want to install the - \`Autoconf' and \`GNU m4' packages. Grab them from any GNU +WARNING: '$1' is $msg. You should only need it if + you modified '${configure_ac}'. You might want to install the + Autoconf and GNU m4 packages. Grab them from any GNU archive site." touch configure ;; autoheader*) echo 1>&2 "\ -WARNING: \`$1' is $msg. You should only need it if - you modified \`acconfig.h' or \`${configure_ac}'. You might want - to install the \`Autoconf' and \`GNU m4' packages. Grab them +WARNING: '$1' is $msg. You should only need it if + you modified 'acconfig.h' or '${configure_ac}'. You might want + to install the Autoconf and GNU m4 packages. Grab them from any GNU archive site." files=`sed -n 's/^[ ]*A[CM]_CONFIG_HEADER(\([^)]*\)).*/\1/p' ${configure_ac}` test -z "$files" && files="config.h" @@ -186,9 +175,9 @@ automake*) echo 1>&2 "\ -WARNING: \`$1' is $msg. You should only need it if - you modified \`Makefile.am', \`acinclude.m4' or \`${configure_ac}'. - You might want to install the \`Automake' and \`Perl' packages. +WARNING: '$1' is $msg. You should only need it if + you modified 'Makefile.am', 'acinclude.m4' or '${configure_ac}'. + You might want to install the Automake and Perl packages. Grab them from any GNU archive site." find . -type f -name Makefile.am -print | sed 's/\.am$/.in/' | @@ -197,10 +186,10 @@ autom4te*) echo 1>&2 "\ -WARNING: \`$1' is needed, but is $msg. +WARNING: '$1' is needed, but is $msg. You might have modified some files without having the proper tools for further handling them. - You can get \`$1' as part of \`Autoconf' from any GNU + You can get '$1' as part of Autoconf from any GNU archive site." file=`echo "$*" | sed -n "$sed_output"` @@ -220,13 +209,13 @@ bison*|yacc*) echo 1>&2 "\ -WARNING: \`$1' $msg. You should only need it if - you modified a \`.y' file. You may need the \`Bison' package +WARNING: '$1' $msg. You should only need it if + you modified a '.y' file. You may need the Bison package in order for those modifications to take effect. You can get - \`Bison' from any GNU archive site." + Bison from any GNU archive site." rm -f y.tab.c y.tab.h if test $# -ne 1; then - eval LASTARG="\${$#}" + eval LASTARG=\${$#} case $LASTARG in *.y) SRCFILE=`echo "$LASTARG" | sed 's/y$/c/'` @@ -250,13 +239,13 @@ lex*|flex*) echo 1>&2 "\ -WARNING: \`$1' is $msg. You should only need it if - you modified a \`.l' file. You may need the \`Flex' package +WARNING: '$1' is $msg. You should only need it if + you modified a '.l' file. You may need the Flex package in order for those modifications to take effect. You can get - \`Flex' from any GNU archive site." + Flex from any GNU archive site." rm -f lex.yy.c if test $# -ne 1; then - eval LASTARG="\${$#}" + eval LASTARG=\${$#} case $LASTARG in *.l) SRCFILE=`echo "$LASTARG" | sed 's/l$/c/'` @@ -273,10 +262,10 @@ help2man*) echo 1>&2 "\ -WARNING: \`$1' is $msg. You should only need it if +WARNING: '$1' is $msg. You should only need it if you modified a dependency of a manual page. You may need the - \`Help2man' package in order for those modifications to take - effect. You can get \`Help2man' from any GNU archive site." + Help2man package in order for those modifications to take + effect. You can get Help2man from any GNU archive site." file=`echo "$*" | sed -n "$sed_output"` test -z "$file" && file=`echo "$*" | sed -n "$sed_minuso"` @@ -291,12 +280,12 @@ makeinfo*) echo 1>&2 "\ -WARNING: \`$1' is $msg. You should only need it if - you modified a \`.texi' or \`.texinfo' file, or any other file +WARNING: '$1' is $msg. You should only need it if + you modified a '.texi' or '.texinfo' file, or any other file indirectly affecting the aspect of the manual. The spurious - call might also be the consequence of using a buggy \`make' (AIX, - DU, IRIX). You might want to install the \`Texinfo' package or - the \`GNU make' package. Grab either from any GNU archive site." + call might also be the consequence of using a buggy 'make' (AIX, + DU, IRIX). You might want to install the Texinfo package or + the GNU make package. Grab either from any GNU archive site." # The file to touch is that specified with -o ... file=`echo "$*" | sed -n "$sed_output"` test -z "$file" && file=`echo "$*" | sed -n "$sed_minuso"` @@ -318,49 +307,14 @@ touch $file ;; - tar*) - shift - - # We have already tried tar in the generic part. - # Look for gnutar/gtar before invocation to avoid ugly error - # messages. - if (gnutar --version > /dev/null 2>&1); then - gnutar "$@" && exit 0 - fi - if (gtar --version > /dev/null 2>&1); then - gtar "$@" && exit 0 - fi - firstarg="$1" - if shift; then - case $firstarg in - *o*) - firstarg=`echo "$firstarg" | sed s/o//` - tar "$firstarg" "$@" && exit 0 - ;; - esac - case $firstarg in - *h*) - firstarg=`echo "$firstarg" | sed s/h//` - tar "$firstarg" "$@" && exit 0 - ;; - esac - fi - - echo 1>&2 "\ -WARNING: I can't seem to be able to run \`tar' with the given arguments. - You may want to install GNU tar or Free paxutils, or check the - command line arguments." - exit 1 - ;; - *) echo 1>&2 "\ -WARNING: \`$1' is needed, and is $msg. +WARNING: '$1' is needed, and is $msg. You might have modified some files without having the - proper tools for further handling them. Check the \`README' file, + proper tools for further handling them. Check the 'README' file, it often tells you about the needed prerequisites for installing this package. You may also peek at any GNU archive site, in case - some other package would contain this missing \`$1' program." + some other package would contain this missing '$1' program." exit 1 ;; esac diff -Nru libdap-3.11.1/conf/snippet/_Noreturn.h libdap-3.12.0/conf/snippet/_Noreturn.h --- libdap-3.11.1/conf/snippet/_Noreturn.h 1970-01-01 00:00:00.000000000 +0000 +++ libdap-3.12.0/conf/snippet/_Noreturn.h 2013-10-17 21:27:40.000000000 +0000 @@ -0,0 +1,10 @@ +#if !defined _Noreturn && __STDC_VERSION__ < 201112 +# if (3 <= __GNUC__ || (__GNUC__ == 2 && 8 <= __GNUC_MINOR__) \ + || 0x5110 <= __SUNPRO_C) +# define _Noreturn __attribute__ ((__noreturn__)) +# elif 1200 <= _MSC_VER +# define _Noreturn __declspec (noreturn) +# else +# define _Noreturn +# endif +#endif diff -Nru libdap-3.11.1/conf/snippet/arg-nonnull.h libdap-3.12.0/conf/snippet/arg-nonnull.h --- libdap-3.11.1/conf/snippet/arg-nonnull.h 1970-01-01 00:00:00.000000000 +0000 +++ libdap-3.12.0/conf/snippet/arg-nonnull.h 2013-10-17 21:27:40.000000000 +0000 @@ -0,0 +1,26 @@ +/* A C macro for declaring that specific arguments must not be NULL. + Copyright (C) 2009-2012 Free Software Foundation, Inc. + + This program is free software: you can redistribute it and/or modify it + under the terms of the GNU General Public License as published + by the Free Software Foundation; either version 3 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, see . */ + +/* _GL_ARG_NONNULL((n,...,m)) tells the compiler and static analyzer tools + that the values passed as arguments n, ..., m must be non-NULL pointers. + n = 1 stands for the first argument, n = 2 for the second argument etc. */ +#ifndef _GL_ARG_NONNULL +# if (__GNUC__ == 3 && __GNUC_MINOR__ >= 3) || __GNUC__ > 3 +# define _GL_ARG_NONNULL(params) __attribute__ ((__nonnull__ params)) +# else +# define _GL_ARG_NONNULL(params) +# endif +#endif diff -Nru libdap-3.11.1/conf/snippet/c++defs.h libdap-3.12.0/conf/snippet/c++defs.h --- libdap-3.11.1/conf/snippet/c++defs.h 1970-01-01 00:00:00.000000000 +0000 +++ libdap-3.12.0/conf/snippet/c++defs.h 2013-10-17 21:27:40.000000000 +0000 @@ -0,0 +1,271 @@ +/* C++ compatible function declaration macros. + Copyright (C) 2010-2012 Free Software Foundation, Inc. + + This program is free software: you can redistribute it and/or modify it + under the terms of the GNU General Public License as published + by the Free Software Foundation; either version 3 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, see . */ + +#ifndef _GL_CXXDEFS_H +#define _GL_CXXDEFS_H + +/* The three most frequent use cases of these macros are: + + * For providing a substitute for a function that is missing on some + platforms, but is declared and works fine on the platforms on which + it exists: + + #if @GNULIB_FOO@ + # if !@HAVE_FOO@ + _GL_FUNCDECL_SYS (foo, ...); + # endif + _GL_CXXALIAS_SYS (foo, ...); + _GL_CXXALIASWARN (foo); + #elif defined GNULIB_POSIXCHECK + ... + #endif + + * For providing a replacement for a function that exists on all platforms, + but is broken/insufficient and needs to be replaced on some platforms: + + #if @GNULIB_FOO@ + # if @REPLACE_FOO@ + # if !(defined __cplusplus && defined GNULIB_NAMESPACE) + # undef foo + # define foo rpl_foo + # endif + _GL_FUNCDECL_RPL (foo, ...); + _GL_CXXALIAS_RPL (foo, ...); + # else + _GL_CXXALIAS_SYS (foo, ...); + # endif + _GL_CXXALIASWARN (foo); + #elif defined GNULIB_POSIXCHECK + ... + #endif + + * For providing a replacement for a function that exists on some platforms + but is broken/insufficient and needs to be replaced on some of them and + is additionally either missing or undeclared on some other platforms: + + #if @GNULIB_FOO@ + # if @REPLACE_FOO@ + # if !(defined __cplusplus && defined GNULIB_NAMESPACE) + # undef foo + # define foo rpl_foo + # endif + _GL_FUNCDECL_RPL (foo, ...); + _GL_CXXALIAS_RPL (foo, ...); + # else + # if !@HAVE_FOO@ or if !@HAVE_DECL_FOO@ + _GL_FUNCDECL_SYS (foo, ...); + # endif + _GL_CXXALIAS_SYS (foo, ...); + # endif + _GL_CXXALIASWARN (foo); + #elif defined GNULIB_POSIXCHECK + ... + #endif +*/ + +/* _GL_EXTERN_C declaration; + performs the declaration with C linkage. */ +#if defined __cplusplus +# define _GL_EXTERN_C extern "C" +#else +# define _GL_EXTERN_C extern +#endif + +/* _GL_FUNCDECL_RPL (func, rettype, parameters_and_attributes); + declares a replacement function, named rpl_func, with the given prototype, + consisting of return type, parameters, and attributes. + Example: + _GL_FUNCDECL_RPL (open, int, (const char *filename, int flags, ...) + _GL_ARG_NONNULL ((1))); + */ +#define _GL_FUNCDECL_RPL(func,rettype,parameters_and_attributes) \ + _GL_FUNCDECL_RPL_1 (rpl_##func, rettype, parameters_and_attributes) +#define _GL_FUNCDECL_RPL_1(rpl_func,rettype,parameters_and_attributes) \ + _GL_EXTERN_C rettype rpl_func parameters_and_attributes + +/* _GL_FUNCDECL_SYS (func, rettype, parameters_and_attributes); + declares the system function, named func, with the given prototype, + consisting of return type, parameters, and attributes. + Example: + _GL_FUNCDECL_SYS (open, int, (const char *filename, int flags, ...) + _GL_ARG_NONNULL ((1))); + */ +#define _GL_FUNCDECL_SYS(func,rettype,parameters_and_attributes) \ + _GL_EXTERN_C rettype func parameters_and_attributes + +/* _GL_CXXALIAS_RPL (func, rettype, parameters); + declares a C++ alias called GNULIB_NAMESPACE::func + that redirects to rpl_func, if GNULIB_NAMESPACE is defined. + Example: + _GL_CXXALIAS_RPL (open, int, (const char *filename, int flags, ...)); + */ +#define _GL_CXXALIAS_RPL(func,rettype,parameters) \ + _GL_CXXALIAS_RPL_1 (func, rpl_##func, rettype, parameters) +#if defined __cplusplus && defined GNULIB_NAMESPACE +# define _GL_CXXALIAS_RPL_1(func,rpl_func,rettype,parameters) \ + namespace GNULIB_NAMESPACE \ + { \ + rettype (*const func) parameters = ::rpl_func; \ + } \ + _GL_EXTERN_C int _gl_cxxalias_dummy +#else +# define _GL_CXXALIAS_RPL_1(func,rpl_func,rettype,parameters) \ + _GL_EXTERN_C int _gl_cxxalias_dummy +#endif + +/* _GL_CXXALIAS_RPL_CAST_1 (func, rpl_func, rettype, parameters); + is like _GL_CXXALIAS_RPL_1 (func, rpl_func, rettype, parameters); + except that the C function rpl_func may have a slightly different + declaration. A cast is used to silence the "invalid conversion" error + that would otherwise occur. */ +#if defined __cplusplus && defined GNULIB_NAMESPACE +# define _GL_CXXALIAS_RPL_CAST_1(func,rpl_func,rettype,parameters) \ + namespace GNULIB_NAMESPACE \ + { \ + rettype (*const func) parameters = \ + reinterpret_cast(::rpl_func); \ + } \ + _GL_EXTERN_C int _gl_cxxalias_dummy +#else +# define _GL_CXXALIAS_RPL_CAST_1(func,rpl_func,rettype,parameters) \ + _GL_EXTERN_C int _gl_cxxalias_dummy +#endif + +/* _GL_CXXALIAS_SYS (func, rettype, parameters); + declares a C++ alias called GNULIB_NAMESPACE::func + that redirects to the system provided function func, if GNULIB_NAMESPACE + is defined. + Example: + _GL_CXXALIAS_SYS (open, int, (const char *filename, int flags, ...)); + */ +#if defined __cplusplus && defined GNULIB_NAMESPACE + /* If we were to write + rettype (*const func) parameters = ::func; + like above in _GL_CXXALIAS_RPL_1, the compiler could optimize calls + better (remove an indirection through a 'static' pointer variable), + but then the _GL_CXXALIASWARN macro below would cause a warning not only + for uses of ::func but also for uses of GNULIB_NAMESPACE::func. */ +# define _GL_CXXALIAS_SYS(func,rettype,parameters) \ + namespace GNULIB_NAMESPACE \ + { \ + static rettype (*func) parameters = ::func; \ + } \ + _GL_EXTERN_C int _gl_cxxalias_dummy +#else +# define _GL_CXXALIAS_SYS(func,rettype,parameters) \ + _GL_EXTERN_C int _gl_cxxalias_dummy +#endif + +/* _GL_CXXALIAS_SYS_CAST (func, rettype, parameters); + is like _GL_CXXALIAS_SYS (func, rettype, parameters); + except that the C function func may have a slightly different declaration. + A cast is used to silence the "invalid conversion" error that would + otherwise occur. */ +#if defined __cplusplus && defined GNULIB_NAMESPACE +# define _GL_CXXALIAS_SYS_CAST(func,rettype,parameters) \ + namespace GNULIB_NAMESPACE \ + { \ + static rettype (*func) parameters = \ + reinterpret_cast(::func); \ + } \ + _GL_EXTERN_C int _gl_cxxalias_dummy +#else +# define _GL_CXXALIAS_SYS_CAST(func,rettype,parameters) \ + _GL_EXTERN_C int _gl_cxxalias_dummy +#endif + +/* _GL_CXXALIAS_SYS_CAST2 (func, rettype, parameters, rettype2, parameters2); + is like _GL_CXXALIAS_SYS (func, rettype, parameters); + except that the C function is picked among a set of overloaded functions, + namely the one with rettype2 and parameters2. Two consecutive casts + are used to silence the "cannot find a match" and "invalid conversion" + errors that would otherwise occur. */ +#if defined __cplusplus && defined GNULIB_NAMESPACE + /* The outer cast must be a reinterpret_cast. + The inner cast: When the function is defined as a set of overloaded + functions, it works as a static_cast<>, choosing the designated variant. + When the function is defined as a single variant, it works as a + reinterpret_cast<>. The parenthesized cast syntax works both ways. */ +# define _GL_CXXALIAS_SYS_CAST2(func,rettype,parameters,rettype2,parameters2) \ + namespace GNULIB_NAMESPACE \ + { \ + static rettype (*func) parameters = \ + reinterpret_cast( \ + (rettype2(*)parameters2)(::func)); \ + } \ + _GL_EXTERN_C int _gl_cxxalias_dummy +#else +# define _GL_CXXALIAS_SYS_CAST2(func,rettype,parameters,rettype2,parameters2) \ + _GL_EXTERN_C int _gl_cxxalias_dummy +#endif + +/* _GL_CXXALIASWARN (func); + causes a warning to be emitted when ::func is used but not when + GNULIB_NAMESPACE::func is used. func must be defined without overloaded + variants. */ +#if defined __cplusplus && defined GNULIB_NAMESPACE +# define _GL_CXXALIASWARN(func) \ + _GL_CXXALIASWARN_1 (func, GNULIB_NAMESPACE) +# define _GL_CXXALIASWARN_1(func,namespace) \ + _GL_CXXALIASWARN_2 (func, namespace) +/* To work around GCC bug , + we enable the warning only when not optimizing. */ +# if !__OPTIMIZE__ +# define _GL_CXXALIASWARN_2(func,namespace) \ + _GL_WARN_ON_USE (func, \ + "The symbol ::" #func " refers to the system function. " \ + "Use " #namespace "::" #func " instead.") +# elif __GNUC__ >= 3 && GNULIB_STRICT_CHECKING +# define _GL_CXXALIASWARN_2(func,namespace) \ + extern __typeof__ (func) func +# else +# define _GL_CXXALIASWARN_2(func,namespace) \ + _GL_EXTERN_C int _gl_cxxalias_dummy +# endif +#else +# define _GL_CXXALIASWARN(func) \ + _GL_EXTERN_C int _gl_cxxalias_dummy +#endif + +/* _GL_CXXALIASWARN1 (func, rettype, parameters_and_attributes); + causes a warning to be emitted when the given overloaded variant of ::func + is used but not when GNULIB_NAMESPACE::func is used. */ +#if defined __cplusplus && defined GNULIB_NAMESPACE +# define _GL_CXXALIASWARN1(func,rettype,parameters_and_attributes) \ + _GL_CXXALIASWARN1_1 (func, rettype, parameters_and_attributes, \ + GNULIB_NAMESPACE) +# define _GL_CXXALIASWARN1_1(func,rettype,parameters_and_attributes,namespace) \ + _GL_CXXALIASWARN1_2 (func, rettype, parameters_and_attributes, namespace) +/* To work around GCC bug , + we enable the warning only when not optimizing. */ +# if !__OPTIMIZE__ +# define _GL_CXXALIASWARN1_2(func,rettype,parameters_and_attributes,namespace) \ + _GL_WARN_ON_USE_CXX (func, rettype, parameters_and_attributes, \ + "The symbol ::" #func " refers to the system function. " \ + "Use " #namespace "::" #func " instead.") +# elif __GNUC__ >= 3 && GNULIB_STRICT_CHECKING +# define _GL_CXXALIASWARN1_2(func,rettype,parameters_and_attributes,namespace) \ + extern __typeof__ (func) func +# else +# define _GL_CXXALIASWARN1_2(func,rettype,parameters_and_attributes,namespace) \ + _GL_EXTERN_C int _gl_cxxalias_dummy +# endif +#else +# define _GL_CXXALIASWARN1(func,rettype,parameters_and_attributes) \ + _GL_EXTERN_C int _gl_cxxalias_dummy +#endif + +#endif /* _GL_CXXDEFS_H */ diff -Nru libdap-3.11.1/conf/snippet/warn-on-use.h libdap-3.12.0/conf/snippet/warn-on-use.h --- libdap-3.11.1/conf/snippet/warn-on-use.h 1970-01-01 00:00:00.000000000 +0000 +++ libdap-3.12.0/conf/snippet/warn-on-use.h 2013-10-17 21:27:40.000000000 +0000 @@ -0,0 +1,109 @@ +/* A C macro for emitting warnings if a function is used. + Copyright (C) 2010-2012 Free Software Foundation, Inc. + + This program is free software: you can redistribute it and/or modify it + under the terms of the GNU General Public License as published + by the Free Software Foundation; either version 3 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, see . */ + +/* _GL_WARN_ON_USE (function, "literal string") issues a declaration + for FUNCTION which will then trigger a compiler warning containing + the text of "literal string" anywhere that function is called, if + supported by the compiler. If the compiler does not support this + feature, the macro expands to an unused extern declaration. + + This macro is useful for marking a function as a potential + portability trap, with the intent that "literal string" include + instructions on the replacement function that should be used + instead. However, one of the reasons that a function is a + portability trap is if it has the wrong signature. Declaring + FUNCTION with a different signature in C is a compilation error, so + this macro must use the same type as any existing declaration so + that programs that avoid the problematic FUNCTION do not fail to + compile merely because they included a header that poisoned the + function. But this implies that _GL_WARN_ON_USE is only safe to + use if FUNCTION is known to already have a declaration. Use of + this macro implies that there must not be any other macro hiding + the declaration of FUNCTION; but undefining FUNCTION first is part + of the poisoning process anyway (although for symbols that are + provided only via a macro, the result is a compilation error rather + than a warning containing "literal string"). Also note that in + C++, it is only safe to use if FUNCTION has no overloads. + + For an example, it is possible to poison 'getline' by: + - adding a call to gl_WARN_ON_USE_PREPARE([[#include ]], + [getline]) in configure.ac, which potentially defines + HAVE_RAW_DECL_GETLINE + - adding this code to a header that wraps the system : + #undef getline + #if HAVE_RAW_DECL_GETLINE + _GL_WARN_ON_USE (getline, "getline is required by POSIX 2008, but" + "not universally present; use the gnulib module getline"); + #endif + + It is not possible to directly poison global variables. But it is + possible to write a wrapper accessor function, and poison that + (less common usage, like &environ, will cause a compilation error + rather than issue the nice warning, but the end result of informing + the developer about their portability problem is still achieved): + #if HAVE_RAW_DECL_ENVIRON + static inline char ***rpl_environ (void) { return &environ; } + _GL_WARN_ON_USE (rpl_environ, "environ is not always properly declared"); + # undef environ + # define environ (*rpl_environ ()) + #endif + */ +#ifndef _GL_WARN_ON_USE + +# if 4 < __GNUC__ || (__GNUC__ == 4 && 3 <= __GNUC_MINOR__) +/* A compiler attribute is available in gcc versions 4.3.0 and later. */ +# define _GL_WARN_ON_USE(function, message) \ +extern __typeof__ (function) function __attribute__ ((__warning__ (message))) +# elif __GNUC__ >= 3 && GNULIB_STRICT_CHECKING +/* Verify the existence of the function. */ +# define _GL_WARN_ON_USE(function, message) \ +extern __typeof__ (function) function +# else /* Unsupported. */ +# define _GL_WARN_ON_USE(function, message) \ +_GL_WARN_EXTERN_C int _gl_warn_on_use +# endif +#endif + +/* _GL_WARN_ON_USE_CXX (function, rettype, parameters_and_attributes, "string") + is like _GL_WARN_ON_USE (function, "string"), except that the function is + declared with the given prototype, consisting of return type, parameters, + and attributes. + This variant is useful for overloaded functions in C++. _GL_WARN_ON_USE does + not work in this case. */ +#ifndef _GL_WARN_ON_USE_CXX +# if 4 < __GNUC__ || (__GNUC__ == 4 && 3 <= __GNUC_MINOR__) +# define _GL_WARN_ON_USE_CXX(function,rettype,parameters_and_attributes,msg) \ +extern rettype function parameters_and_attributes \ + __attribute__ ((__warning__ (msg))) +# elif __GNUC__ >= 3 && GNULIB_STRICT_CHECKING +/* Verify the existence of the function. */ +# define _GL_WARN_ON_USE_CXX(function,rettype,parameters_and_attributes,msg) \ +extern rettype function parameters_and_attributes +# else /* Unsupported. */ +# define _GL_WARN_ON_USE_CXX(function,rettype,parameters_and_attributes,msg) \ +_GL_WARN_EXTERN_C int _gl_warn_on_use +# endif +#endif + +/* _GL_WARN_EXTERN_C declaration; + performs the declaration with C linkage. */ +#ifndef _GL_WARN_EXTERN_C +# if defined __cplusplus +# define _GL_WARN_EXTERN_C extern "C" +# else +# define _GL_WARN_EXTERN_C extern +# endif +#endif diff -Nru libdap-3.11.1/conf/warn-on-use.h libdap-3.12.0/conf/warn-on-use.h --- libdap-3.11.1/conf/warn-on-use.h 2011-04-29 13:19:26.000000000 +0000 +++ libdap-3.12.0/conf/warn-on-use.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,109 +0,0 @@ -/* A C macro for emitting warnings if a function is used. - Copyright (C) 2010-2011 Free Software Foundation, Inc. - - This program is free software: you can redistribute it and/or modify it - under the terms of the GNU General Public License as published - by the Free Software Foundation; either version 3 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 - Lesser General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program. If not, see . */ - -/* _GL_WARN_ON_USE (function, "literal string") issues a declaration - for FUNCTION which will then trigger a compiler warning containing - the text of "literal string" anywhere that function is called, if - supported by the compiler. If the compiler does not support this - feature, the macro expands to an unused extern declaration. - - This macro is useful for marking a function as a potential - portability trap, with the intent that "literal string" include - instructions on the replacement function that should be used - instead. However, one of the reasons that a function is a - portability trap is if it has the wrong signature. Declaring - FUNCTION with a different signature in C is a compilation error, so - this macro must use the same type as any existing declaration so - that programs that avoid the problematic FUNCTION do not fail to - compile merely because they included a header that poisoned the - function. But this implies that _GL_WARN_ON_USE is only safe to - use if FUNCTION is known to already have a declaration. Use of - this macro implies that there must not be any other macro hiding - the declaration of FUNCTION; but undefining FUNCTION first is part - of the poisoning process anyway (although for symbols that are - provided only via a macro, the result is a compilation error rather - than a warning containing "literal string"). Also note that in - C++, it is only safe to use if FUNCTION has no overloads. - - For an example, it is possible to poison 'getline' by: - - adding a call to gl_WARN_ON_USE_PREPARE([[#include ]], - [getline]) in configure.ac, which potentially defines - HAVE_RAW_DECL_GETLINE - - adding this code to a header that wraps the system : - #undef getline - #if HAVE_RAW_DECL_GETLINE - _GL_WARN_ON_USE (getline, "getline is required by POSIX 2008, but" - "not universally present; use the gnulib module getline"); - #endif - - It is not possible to directly poison global variables. But it is - possible to write a wrapper accessor function, and poison that - (less common usage, like &environ, will cause a compilation error - rather than issue the nice warning, but the end result of informing - the developer about their portability problem is still achieved): - #if HAVE_RAW_DECL_ENVIRON - static inline char ***rpl_environ (void) { return &environ; } - _GL_WARN_ON_USE (rpl_environ, "environ is not always properly declared"); - # undef environ - # define environ (*rpl_environ ()) - #endif - */ -#ifndef _GL_WARN_ON_USE - -# if 4 < __GNUC__ || (__GNUC__ == 4 && 3 <= __GNUC_MINOR__) -/* A compiler attribute is available in gcc versions 4.3.0 and later. */ -# define _GL_WARN_ON_USE(function, message) \ -extern __typeof__ (function) function __attribute__ ((__warning__ (message))) -# elif __GNUC__ >= 3 && GNULIB_STRICT_CHECKING -/* Verify the existence of the function. */ -# define _GL_WARN_ON_USE(function, message) \ -extern __typeof__ (function) function -# else /* Unsupported. */ -# define _GL_WARN_ON_USE(function, message) \ -_GL_WARN_EXTERN_C int _gl_warn_on_use -# endif -#endif - -/* _GL_WARN_ON_USE_CXX (function, rettype, parameters_and_attributes, "string") - is like _GL_WARN_ON_USE (function, "string"), except that the function is - declared with the given prototype, consisting of return type, parameters, - and attributes. - This variant is useful for overloaded functions in C++. _GL_WARN_ON_USE does - not work in this case. */ -#ifndef _GL_WARN_ON_USE_CXX -# if 4 < __GNUC__ || (__GNUC__ == 4 && 3 <= __GNUC_MINOR__) -# define _GL_WARN_ON_USE_CXX(function,rettype,parameters_and_attributes,msg) \ -extern rettype function parameters_and_attributes \ - __attribute__ ((__warning__ (msg))) -# elif __GNUC__ >= 3 && GNULIB_STRICT_CHECKING -/* Verify the existence of the function. */ -# define _GL_WARN_ON_USE_CXX(function,rettype,parameters_and_attributes,msg) \ -extern rettype function parameters_and_attributes -# else /* Unsupported. */ -# define _GL_WARN_ON_USE_CXX(function,rettype,parameters_and_attributes,msg) \ -_GL_WARN_EXTERN_C int _gl_warn_on_use -# endif -#endif - -/* _GL_WARN_EXTERN_C declaration; - performs the declaration with C linkage. */ -#ifndef _GL_WARN_EXTERN_C -# if defined __cplusplus -# define _GL_WARN_EXTERN_C extern "C" -# else -# define _GL_WARN_EXTERN_C extern -# endif -#endif diff -Nru libdap-3.11.1/config.h.in libdap-3.12.0/config.h.in --- libdap-3.11.1/config.h.in 2011-05-06 17:36:27.000000000 +0000 +++ libdap-3.12.0/config.h.in 2013-10-17 21:27:40.000000000 +0000 @@ -3,6 +3,9 @@ #ifndef _config_h #define _config_h +/* Define if building universal (internal helper macro) */ +#undef AC_APPLE_UNIVERSAL_BUILD + /* Define to the number of bits in type 'ptrdiff_t'. */ #undef BITSIZEOF_PTRDIFF_T @@ -21,6 +24,9 @@ /* What sort of HTTP client is this? */ #undef CNAME +/* Should a function (run-time) be used to determine the byte order? */ +#undef COMPUTE_ENDIAN_AT_RUNTIME + /* Define to one of `_getb67', `GETB67', `getb67' for Cray-2 and Cray-YMP systems. This function is required for `alloca.c' support on those systems. */ @@ -32,36 +38,48 @@ /* Define to 1 if using `alloca.c'. */ #undef C_ALLOCA +/* Should DAP4 support be enabled? */ +#undef DAP4 + /* Highest DAP version implemented? */ #undef DAP_PROTOCOL_VERSION -/* dbyte */ +/* unsigned bytes/chars */ #undef DBYTE -/* dfloat32 */ +/* 32-bit real type */ #undef DFLOAT32 -/* dfloat64 */ +/* 64-bit real type */ #undef DFLOAT64 -/* dint16 */ +/* 16-bit integer type */ #undef DINT16 -/* int32 */ +/* 32-bit integer type */ #undef DINT32 +/* 64-bit integer type */ +#undef DINT64 + +/* 8-bit integer type */ +#undef DINT8 + /* Set instrumentation to level 1 (see debug.h) */ #undef DODS_DEBUG /* Set instrumentation to level 2 */ #undef DODS_DEBUG2 -/* uint16 */ +/* 16-bit unsigned integer type */ #undef DUINT16 -/* uint32 */ +/* 32-bit unsigned integer type */ #undef DUINT32 +/* 64-bit unsigned integer type */ +#undef DUINT64 + /* Client name and version combined */ #undef DVR @@ -78,6 +96,9 @@ /* Define to 1 when the gnulib module btowc should be tested. */ #undef GNULIB_TEST_BTOWC +/* Define to 1 when the gnulib module localeconv should be tested. */ +#undef GNULIB_TEST_LOCALECONV + /* Define to 1 when the gnulib module malloc-posix should be tested. */ #undef GNULIB_TEST_MALLOC_POSIX @@ -87,6 +108,9 @@ /* Define to 1 when the gnulib module mbsinit should be tested. */ #undef GNULIB_TEST_MBSINIT +/* Define to 1 when the gnulib module mbtowc should be tested. */ +#undef GNULIB_TEST_MBTOWC + /* Define to 1 when the gnulib module nl_langinfo should be tested. */ #undef GNULIB_TEST_NL_LANGINFO @@ -110,6 +134,9 @@ /* Define to 1 if you have the `btowc' function. */ #undef HAVE_BTOWC +/* Define to 1 if you have the header file. */ +#undef HAVE_BYTESWAP_H + /* Define to 1 if you have the `bzero' function. */ #undef HAVE_BZERO @@ -121,9 +148,25 @@ don't. */ #undef HAVE_DECL_ISBLANK -/* Define to 1 if you have the declaration of `iswblank', and to 0 if you +/* Define to 1 if you have the declaration of `mbrtowc', and to 0 if you don't. */ -#undef HAVE_DECL_ISWBLANK +#undef HAVE_DECL_MBRTOWC + +/* Define to 1 if you have the declaration of `mbsinit', and to 0 if you + don't. */ +#undef HAVE_DECL_MBSINIT + +/* Define to 1 if you have the declaration of `strncasecmp', and to 0 if you + don't. */ +#undef HAVE_DECL_STRNCASECMP + +/* Define to 1 if you have the declaration of `towlower', and to 0 if you + don't. */ +#undef HAVE_DECL_TOWLOWER + +/* Define to 1 if you have the declaration of `wcrtomb', and to 0 if you + don't. */ +#undef HAVE_DECL_WCRTOMB /* Define to 1 if you have the header file, and it defines `DIR'. */ @@ -153,9 +196,6 @@ /* Define to 1 if you have the `isblank' function. */ #undef HAVE_ISBLANK -/* Define to 1 if you have the `iswblank' function. */ -#undef HAVE_ISWBLANK - /* Define to 1 if you have the `iswcntrl' function. */ #undef HAVE_ISWCNTRL @@ -174,7 +214,7 @@ /* Define to 1 if you have the `localtime_r' function. */ #undef HAVE_LOCALTIME_R -/* Define to 1 if the system has the type `long long int'. */ +/* Define to 1 if the system has the type 'long long int'. */ #undef HAVE_LONG_LONG_INT /* Define to 1 if your system has a GNU libc compatible 'malloc' function, and @@ -223,9 +263,6 @@ /* Define to 1 if you have the `putenv' function. */ #undef HAVE_PUTENV -/* Define to 1 if you have the header file. */ -#undef HAVE_RANDOM_H - /* Define to 1 if atoll is declared even after undefining macros. */ #undef HAVE_RAW_DECL_ATOLL @@ -236,15 +273,24 @@ macros. */ #undef HAVE_RAW_DECL_CANONICALIZE_FILE_NAME +/* Define to 1 if chdir is declared even after undefining macros. */ +#undef HAVE_RAW_DECL_CHDIR + /* Define to 1 if chown is declared even after undefining macros. */ #undef HAVE_RAW_DECL_CHOWN +/* Define to 1 if dup is declared even after undefining macros. */ +#undef HAVE_RAW_DECL_DUP + /* Define to 1 if dup2 is declared even after undefining macros. */ #undef HAVE_RAW_DECL_DUP2 /* Define to 1 if dup3 is declared even after undefining macros. */ #undef HAVE_RAW_DECL_DUP3 +/* Define to 1 if duplocale is declared even after undefining macros. */ +#undef HAVE_RAW_DECL_DUPLOCALE + /* Define to 1 if endusershell is declared even after undefining macros. */ #undef HAVE_RAW_DECL_ENDUSERSHELL @@ -263,6 +309,12 @@ /* Define to 1 if fchownat is declared even after undefining macros. */ #undef HAVE_RAW_DECL_FCHOWNAT +/* Define to 1 if fdatasync is declared even after undefining macros. */ +#undef HAVE_RAW_DECL_FDATASYNC + +/* Define to 1 if ffs is declared even after undefining macros. */ +#undef HAVE_RAW_DECL_FFS + /* Define to 1 if fsync is declared even after undefining macros. */ #undef HAVE_RAW_DECL_FSYNC @@ -305,8 +357,20 @@ /* Define to 1 if grantpt is declared even after undefining macros. */ #undef HAVE_RAW_DECL_GRANTPT -/* Define to 1 if initstat_r is declared even after undefining macros. */ -#undef HAVE_RAW_DECL_INITSTAT_R +/* Define to 1 if group_member is declared even after undefining macros. */ +#undef HAVE_RAW_DECL_GROUP_MEMBER + +/* Define to 1 if initstate is declared even after undefining macros. */ +#undef HAVE_RAW_DECL_INITSTATE + +/* Define to 1 if initstate_r is declared even after undefining macros. */ +#undef HAVE_RAW_DECL_INITSTATE_R + +/* Define to 1 if isatty is declared even after undefining macros. */ +#undef HAVE_RAW_DECL_ISATTY + +/* Define to 1 if iswctype is declared even after undefining macros. */ +#undef HAVE_RAW_DECL_ISWCTYPE /* Define to 1 if lchown is declared even after undefining macros. */ #undef HAVE_RAW_DECL_LCHOWN @@ -359,15 +423,24 @@ /* Define to 1 if pipe2 is declared even after undefining macros. */ #undef HAVE_RAW_DECL_PIPE2 +/* Define to 1 if posix_openpt is declared even after undefining macros. */ +#undef HAVE_RAW_DECL_POSIX_OPENPT + /* Define to 1 if pread is declared even after undefining macros. */ #undef HAVE_RAW_DECL_PREAD /* Define to 1 if ptsname is declared even after undefining macros. */ #undef HAVE_RAW_DECL_PTSNAME +/* Define to 1 if ptsname_r is declared even after undefining macros. */ +#undef HAVE_RAW_DECL_PTSNAME_R + /* Define to 1 if pwrite is declared even after undefining macros. */ #undef HAVE_RAW_DECL_PWRITE +/* Define to 1 if random is declared even after undefining macros. */ +#undef HAVE_RAW_DECL_RANDOM + /* Define to 1 if random_r is declared even after undefining macros. */ #undef HAVE_RAW_DECL_RANDOM_R @@ -389,6 +462,15 @@ /* Define to 1 if setenv is declared even after undefining macros. */ #undef HAVE_RAW_DECL_SETENV +/* Define to 1 if sethostname is declared even after undefining macros. */ +#undef HAVE_RAW_DECL_SETHOSTNAME + +/* Define to 1 if setlocale is declared even after undefining macros. */ +#undef HAVE_RAW_DECL_SETLOCALE + +/* Define to 1 if setstate is declared even after undefining macros. */ +#undef HAVE_RAW_DECL_SETSTATE + /* Define to 1 if setstate_r is declared even after undefining macros. */ #undef HAVE_RAW_DECL_SETSTATE_R @@ -398,9 +480,18 @@ /* Define to 1 if sleep is declared even after undefining macros. */ #undef HAVE_RAW_DECL_SLEEP +/* Define to 1 if srandom is declared even after undefining macros. */ +#undef HAVE_RAW_DECL_SRANDOM + /* Define to 1 if srandom_r is declared even after undefining macros. */ #undef HAVE_RAW_DECL_SRANDOM_R +/* Define to 1 if strcasecmp is declared even after undefining macros. */ +#undef HAVE_RAW_DECL_STRCASECMP + +/* Define to 1 if strncasecmp is declared even after undefining macros. */ +#undef HAVE_RAW_DECL_STRNCASECMP + /* Define to 1 if strtod is declared even after undefining macros. */ #undef HAVE_RAW_DECL_STRTOD @@ -416,6 +507,9 @@ /* Define to 1 if symlinkat is declared even after undefining macros. */ #undef HAVE_RAW_DECL_SYMLINKAT +/* Define to 1 if towctrans is declared even after undefining macros. */ +#undef HAVE_RAW_DECL_TOWCTRANS + /* Define to 1 if ttyname_r is declared even after undefining macros. */ #undef HAVE_RAW_DECL_TTYNAME_R @@ -434,21 +528,111 @@ /* Define to 1 if usleep is declared even after undefining macros. */ #undef HAVE_RAW_DECL_USLEEP +/* Define to 1 if wcpcpy is declared even after undefining macros. */ +#undef HAVE_RAW_DECL_WCPCPY + +/* Define to 1 if wcpncpy is declared even after undefining macros. */ +#undef HAVE_RAW_DECL_WCPNCPY + /* Define to 1 if wcrtomb is declared even after undefining macros. */ #undef HAVE_RAW_DECL_WCRTOMB +/* Define to 1 if wcscasecmp is declared even after undefining macros. */ +#undef HAVE_RAW_DECL_WCSCASECMP + +/* Define to 1 if wcscat is declared even after undefining macros. */ +#undef HAVE_RAW_DECL_WCSCAT + +/* Define to 1 if wcschr is declared even after undefining macros. */ +#undef HAVE_RAW_DECL_WCSCHR + +/* Define to 1 if wcscmp is declared even after undefining macros. */ +#undef HAVE_RAW_DECL_WCSCMP + +/* Define to 1 if wcscoll is declared even after undefining macros. */ +#undef HAVE_RAW_DECL_WCSCOLL + +/* Define to 1 if wcscpy is declared even after undefining macros. */ +#undef HAVE_RAW_DECL_WCSCPY + +/* Define to 1 if wcscspn is declared even after undefining macros. */ +#undef HAVE_RAW_DECL_WCSCSPN + +/* Define to 1 if wcsdup is declared even after undefining macros. */ +#undef HAVE_RAW_DECL_WCSDUP + +/* Define to 1 if wcslen is declared even after undefining macros. */ +#undef HAVE_RAW_DECL_WCSLEN + +/* Define to 1 if wcsncasecmp is declared even after undefining macros. */ +#undef HAVE_RAW_DECL_WCSNCASECMP + +/* Define to 1 if wcsncat is declared even after undefining macros. */ +#undef HAVE_RAW_DECL_WCSNCAT + +/* Define to 1 if wcsncmp is declared even after undefining macros. */ +#undef HAVE_RAW_DECL_WCSNCMP + +/* Define to 1 if wcsncpy is declared even after undefining macros. */ +#undef HAVE_RAW_DECL_WCSNCPY + +/* Define to 1 if wcsnlen is declared even after undefining macros. */ +#undef HAVE_RAW_DECL_WCSNLEN + /* Define to 1 if wcsnrtombs is declared even after undefining macros. */ #undef HAVE_RAW_DECL_WCSNRTOMBS +/* Define to 1 if wcspbrk is declared even after undefining macros. */ +#undef HAVE_RAW_DECL_WCSPBRK + +/* Define to 1 if wcsrchr is declared even after undefining macros. */ +#undef HAVE_RAW_DECL_WCSRCHR + /* Define to 1 if wcsrtombs is declared even after undefining macros. */ #undef HAVE_RAW_DECL_WCSRTOMBS +/* Define to 1 if wcsspn is declared even after undefining macros. */ +#undef HAVE_RAW_DECL_WCSSPN + +/* Define to 1 if wcsstr is declared even after undefining macros. */ +#undef HAVE_RAW_DECL_WCSSTR + +/* Define to 1 if wcstok is declared even after undefining macros. */ +#undef HAVE_RAW_DECL_WCSTOK + +/* Define to 1 if wcswidth is declared even after undefining macros. */ +#undef HAVE_RAW_DECL_WCSWIDTH + +/* Define to 1 if wcsxfrm is declared even after undefining macros. */ +#undef HAVE_RAW_DECL_WCSXFRM + /* Define to 1 if wctob is declared even after undefining macros. */ #undef HAVE_RAW_DECL_WCTOB +/* Define to 1 if wctrans is declared even after undefining macros. */ +#undef HAVE_RAW_DECL_WCTRANS + +/* Define to 1 if wctype is declared even after undefining macros. */ +#undef HAVE_RAW_DECL_WCTYPE + /* Define to 1 if wcwidth is declared even after undefining macros. */ #undef HAVE_RAW_DECL_WCWIDTH +/* Define to 1 if wmemchr is declared even after undefining macros. */ +#undef HAVE_RAW_DECL_WMEMCHR + +/* Define to 1 if wmemcmp is declared even after undefining macros. */ +#undef HAVE_RAW_DECL_WMEMCMP + +/* Define to 1 if wmemcpy is declared even after undefining macros. */ +#undef HAVE_RAW_DECL_WMEMCPY + +/* Define to 1 if wmemmove is declared even after undefining macros. */ +#undef HAVE_RAW_DECL_WMEMMOVE + +/* Define to 1 if wmemset is declared even after undefining macros. */ +#undef HAVE_RAW_DECL_WMEMSET + /* Define to 1 if _Exit is declared even after undefining macros. */ #undef HAVE_RAW_DECL__EXIT @@ -464,9 +648,6 @@ /* Define to 1 if 'wint_t' is a signed integer type. */ #undef HAVE_SIGNED_WINT_T -/* Define to 1 if stdbool.h conforms to C99. */ -#undef HAVE_STDBOOL_H - /* Define to 1 if you have the header file. */ #undef HAVE_STDDEF_H @@ -476,6 +657,9 @@ /* Define to 1 if you have the header file. */ #undef HAVE_STDLIB_H +/* Define to 1 if you have the `strcasecmp' function. */ +#undef HAVE_STRCASECMP + /* Define to 1 if you have the `strchr' function. */ #undef HAVE_STRCHR @@ -488,18 +672,24 @@ /* Define to 1 if you have the header file. */ #undef HAVE_STRING_H +/* Define to 1 if you have the `strncasecmp' function. */ +#undef HAVE_STRNCASECMP + /* Define to 1 if you have the `strtol' function. */ #undef HAVE_STRTOL /* Define to 1 if you have the `strtoul' function. */ #undef HAVE_STRTOUL -/* Define to 1 if the system has the type `struct random_data'. */ -#undef HAVE_STRUCT_RANDOM_DATA +/* Define to 1 if `decimal_point' is a member of `struct lconv'. */ +#undef HAVE_STRUCT_LCONV_DECIMAL_POINT /* Define to 1 if `st_blksize' is a member of `struct stat'. */ #undef HAVE_STRUCT_STAT_ST_BLKSIZE +/* Define to 1 if you have the `symlink' function. */ +#undef HAVE_SYMLINK + /* Define to 1 if you have the header file. */ #undef HAVE_SYS_BITYPES_H @@ -532,10 +722,13 @@ /* Define to 1 if you have the `timegm' function. */ #undef HAVE_TIMEGM +/* Define to 1 if you have the `towlower' function. */ +#undef HAVE_TOWLOWER + /* Define to 1 if you have the header file. */ #undef HAVE_UNISTD_H -/* Define to 1 if the system has the type `unsigned long long int'. */ +/* Define to 1 if the system has the type 'unsigned long long int'. */ #undef HAVE_UNSIGNED_LONG_LONG_INT /* Define to 1 if you have the header file. */ @@ -562,6 +755,9 @@ /* Define to 1 if O_NOFOLLOW works. */ #undef HAVE_WORKING_O_NOFOLLOW +/* Define to 1 if you have the header file. */ +#undef HAVE_XLOCALE_H + /* Define to 1 if the system has the type `_Bool'. */ #undef HAVE__BOOL @@ -584,6 +780,9 @@ /* Define if the mbrtowc function returns a wrong return value. */ #undef MBRTOWC_RETVAL_BUG +/* Remove this to activate assert() calls. */ +#undef NDEBUG + /* Name of package */ #undef PACKAGE @@ -678,6 +877,18 @@ 'wint_t'. */ #undef WINT_T_SUFFIX +/* Define WORDS_BIGENDIAN to 1 if your processor stores words with the most + significant byte first (like Motorola and SPARC, unlike Intel). */ +#if defined AC_APPLE_UNIVERSAL_BUILD +# if defined __BIG_ENDIAN__ +# define WORDS_BIGENDIAN 1 +# endif +#else +# ifndef WORDS_BIGENDIAN +# undef WORDS_BIGENDIAN +# endif +#endif + /* xdr float32 */ #undef XDR_FLOAT32 @@ -700,16 +911,37 @@ `char[]'. */ #undef YYTEXT_POINTER +/* Define to 1 on Solaris. */ +#undef _LCONV_C99 + /* Define to 1 if on MINIX. */ #undef _MINIX +/* The _Noreturn keyword of C11. */ +#if ! (defined _Noreturn \ + || (defined __STDC_VERSION__ && 201112 <= __STDC_VERSION__)) +# if (3 <= __GNUC__ || (__GNUC__ == 2 && 8 <= __GNUC_MINOR__) \ + || 0x5110 <= __SUNPRO_C) +# define _Noreturn __attribute__ ((__noreturn__)) +# elif defined _MSC_VER && 1200 <= _MSC_VER +# define _Noreturn __declspec (noreturn) +# else +# define _Noreturn +# endif +#endif + + /* Define to 2 if the system does not provide POSIX.1 features except with this defined. */ #undef _POSIX_1_SOURCE -/* Define to 1 if you need to in order for `stat' and other things to work. */ +/* Define to 1 if you need to in order for 'stat' and other things to work. */ #undef _POSIX_SOURCE +/* Define if you want to include , so that it consistently + overrides 's RE_DUP_MAX. */ +#undef _REGEX_INCLUDE_LIMITS_H + /* Define if you want regoff_t to be at least as wide POSIX requires. */ #undef _REGEX_LARGE_OFFSETS @@ -720,6 +952,10 @@ #ifndef _ALL_SOURCE # undef _ALL_SOURCE #endif +/* Enable general extensions on Mac OS X. */ +#ifndef _DARWIN_C_SOURCE +# undef _DARWIN_C_SOURCE +#endif /* Enable GNU extensions on systems that have them. */ #ifndef _GNU_SOURCE # undef _GNU_SOURCE @@ -750,7 +986,7 @@ /* Work around a bug in Apple GCC 4.0.1 build 5465: In C99 mode, it supports the ISO C 99 semantics of 'extern inline' (unlike the GNU C semantics of earlier versions), but does not display it by setting __GNUC_STDC_INLINE__. - __APPLE__ && __MACH__ test for MacOS X. + __APPLE__ && __MACH__ test for Mac OS X. __APPLE_CC__ tests for the Apple compiler and its version. __STDC_VERSION__ tests for the C99 mode. */ #if defined __APPLE__ && defined __MACH__ && __APPLE_CC__ >= 5465 && !defined __cplusplus && __STDC_VERSION__ >= 199901L && !defined __GNUC_STDC_INLINE__ @@ -760,6 +996,12 @@ /* Define to a type if does not define. */ #undef mbstate_t +/* Define to `int' if does not define. */ +#undef mode_t + +/* Define to `int' if does not define. */ +#undef pid_t + /* Define to rpl_re_comp if the replacement should be used. */ #undef re_comp @@ -837,6 +1079,20 @@ is a misnomer outside of parameter lists. */ #define _UNUSED_PARAMETER_ _GL_UNUSED +/* The __pure__ attribute was added in gcc 2.96. */ +#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 96) +# define _GL_ATTRIBUTE_PURE __attribute__ ((__pure__)) +#else +# define _GL_ATTRIBUTE_PURE /* empty */ +#endif + +/* The __const__ attribute was added in gcc 2.95. */ +#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 95) +# define _GL_ATTRIBUTE_CONST __attribute__ ((__const__)) +#else +# define _GL_ATTRIBUTE_CONST /* empty */ +#endif + /* Define to empty if the keyword `volatile' does not work. Warning: valid code using `volatile' can become incorrect without. Disable with care. */ diff -Nru libdap-3.11.1/configure libdap-3.12.0/configure --- libdap-3.11.1/configure 2011-05-06 17:36:26.000000000 +0000 +++ libdap-3.12.0/configure 2013-10-17 21:27:40.000000000 +0000 @@ -1,13 +1,11 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.65 for libdap 3.11.1. +# Generated by GNU Autoconf 2.69 for libdap 3.12.0. # # Report bugs to . # # -# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, -# 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, -# Inc. +# Copyright (C) 1992-1996, 1998-2012 Free Software Foundation, Inc. # # # This configure script is free software; the Free Software Foundation @@ -91,6 +89,7 @@ IFS=" "" $as_nl" # Find who we are. Look in the path if we contain no directory separator. +as_myself= case $0 in #(( *[\\/]* ) as_myself=$0 ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR @@ -135,6 +134,31 @@ # CDPATH. (unset CDPATH) >/dev/null 2>&1 && unset CDPATH +# Use a proper internal environment variable to ensure we don't fall + # into an infinite loop, continuously re-executing ourselves. + if test x"${_as_can_reexec}" != xno && test "x$CONFIG_SHELL" != x; then + _as_can_reexec=no; export _as_can_reexec; + # We cannot yet assume a decent shell, so we have to provide a +# neutralization value for shells without unset; and this also +# works around shells that cannot unset nonexistent variables. +# Preserve -v and -x to the replacement shell. +BASH_ENV=/dev/null +ENV=/dev/null +(unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV +case $- in # (((( + *v*x* | *x*v* ) as_opts=-vx ;; + *v* ) as_opts=-v ;; + *x* ) as_opts=-x ;; + * ) as_opts= ;; +esac +exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"} +# Admittedly, this is quite paranoid, since all the known shells bail +# out after a failed `exec'. +$as_echo "$0: could not re-execute with $CONFIG_SHELL" >&2 +as_fn_exit 255 + fi + # We don't want this to propagate to other subprocesses. + { _as_can_reexec=; unset _as_can_reexec;} if test "x$CONFIG_SHELL" = x; then as_bourne_compatible="if test -n \"\${ZSH_VERSION+set}\" && (emulate sh) >/dev/null 2>&1; then : emulate sh @@ -168,12 +192,21 @@ else exitcode=1; echo positional parameters were not saved. fi -test x\$exitcode = x0 || exit 1" +test x\$exitcode = x0 || exit 1 +test -x / || exit 1" as_suggested=" as_lineno_1=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_1a=\$LINENO as_lineno_2=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_2a=\$LINENO eval 'test \"x\$as_lineno_1'\$as_run'\" != \"x\$as_lineno_2'\$as_run'\" && test \"x\`expr \$as_lineno_1'\$as_run' + 1\`\" = \"x\$as_lineno_2'\$as_run'\"' || exit 1 -test \$(( 1 + 1 )) = 2 || exit 1" +test \$(( 1 + 1 )) = 2 || exit 1 + + test -n \"\${ZSH_VERSION+set}\${BASH_VERSION+set}\" || ( + ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' + ECHO=\$ECHO\$ECHO\$ECHO\$ECHO\$ECHO + ECHO=\$ECHO\$ECHO\$ECHO\$ECHO\$ECHO\$ECHO + PATH=/empty FPATH=/empty; export PATH FPATH + test \"X\`printf %s \$ECHO\`\" = \"X\$ECHO\" \\ + || test \"X\`print -r -- \$ECHO\`\" = \"X\$ECHO\" ) || exit 1" if (eval "$as_required") 2>/dev/null; then : as_have_required=yes else @@ -213,14 +246,25 @@ if test "x$CONFIG_SHELL" != x; then : - # We cannot yet assume a decent shell, so we have to provide a - # neutralization value for shells without unset; and this also - # works around shells that cannot unset nonexistent variables. - BASH_ENV=/dev/null - ENV=/dev/null - (unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV - export CONFIG_SHELL - exec "$CONFIG_SHELL" "$as_myself" ${1+"$@"} + export CONFIG_SHELL + # We cannot yet assume a decent shell, so we have to provide a +# neutralization value for shells without unset; and this also +# works around shells that cannot unset nonexistent variables. +# Preserve -v and -x to the replacement shell. +BASH_ENV=/dev/null +ENV=/dev/null +(unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV +case $- in # (((( + *v*x* | *x*v* ) as_opts=-vx ;; + *v* ) as_opts=-v ;; + *x* ) as_opts=-x ;; + * ) as_opts= ;; +esac +exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"} +# Admittedly, this is quite paranoid, since all the known shells bail +# out after a failed `exec'. +$as_echo "$0: could not re-execute with $CONFIG_SHELL" >&2 +exit 255 fi if test x$as_have_required = xno; then : @@ -319,10 +363,18 @@ test -d "$as_dir" && break done test -z "$as_dirs" || eval "mkdir $as_dirs" - } || test -d "$as_dir" || as_fn_error "cannot create directory $as_dir" + } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir" } # as_fn_mkdir_p + +# as_fn_executable_p FILE +# ----------------------- +# Test if FILE is an executable regular file. +as_fn_executable_p () +{ + test -f "$1" && test -x "$1" +} # as_fn_executable_p # as_fn_append VAR VALUE # ---------------------- # Append the text in VALUE to the end of the definition contained in VAR. Take @@ -359,19 +411,19 @@ fi # as_fn_arith -# as_fn_error ERROR [LINENO LOG_FD] -# --------------------------------- +# as_fn_error STATUS ERROR [LINENO LOG_FD] +# ---------------------------------------- # Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are # provided, also output the error to LOG_FD, referencing LINENO. Then exit the -# script with status $?, using 1 if that was 0. +# script with STATUS, using 1 if that was 0. as_fn_error () { - as_status=$?; test $as_status -eq 0 && as_status=1 - if test "$3"; then - as_lineno=${as_lineno-"$2"} as_lineno_stack=as_lineno_stack=$as_lineno_stack - $as_echo "$as_me:${as_lineno-$LINENO}: error: $1" >&$3 + as_status=$1; test $as_status -eq 0 && as_status=1 + if test "$4"; then + as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4 fi - $as_echo "$as_me: error: $1" >&2 + $as_echo "$as_me: error: $2" >&2 as_fn_exit $as_status } # as_fn_error @@ -444,6 +496,10 @@ chmod +x "$as_me.lineno" || { $as_echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2; as_fn_exit 1; } + # If we had to re-execute with $CONFIG_SHELL, we're ensured to have + # already done that, so ensure we don't try to do so again and fall + # in an infinite loop. This has already happened in practice. + _as_can_reexec=no; export _as_can_reexec # Don't try to exec as it changes $[0], causing all sort of problems # (the dirname of $[0] is not the place where we might find the # original and so on. Autoconf is especially sensitive to this). @@ -478,16 +534,16 @@ # ... but there are two gotchas: # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. - # In both cases, we have to default to `cp -p'. + # In both cases, we have to default to `cp -pR'. ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || - as_ln_s='cp -p' + as_ln_s='cp -pR' elif ln conf$$.file conf$$ 2>/dev/null; then as_ln_s=ln else - as_ln_s='cp -p' + as_ln_s='cp -pR' fi else - as_ln_s='cp -p' + as_ln_s='cp -pR' fi rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file rmdir conf$$.dir 2>/dev/null @@ -499,28 +555,8 @@ as_mkdir_p=false fi -if test -x / >/dev/null 2>&1; then - as_test_x='test -x' -else - if ls -dL / >/dev/null 2>&1; then - as_ls_L_option=L - else - as_ls_L_option= - fi - as_test_x=' - eval sh -c '\'' - if test -d "$1"; then - test -d "$1/."; - else - case $1 in #( - -*)set "./$1";; - esac; - case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in #(( - ???[sx]*):;;*)false;;esac;fi - '\'' sh - ' -fi -as_executable_p=$as_test_x +as_test_x='test -x' +as_executable_p=as_fn_executable_p # Sed expression to map a string onto a valid CPP name. as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" @@ -528,161 +564,74 @@ # Sed expression to map a string onto a valid variable name. as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" - - -# Check that we are running under the correct shell. SHELL=${CONFIG_SHELL-/bin/sh} -case X$lt_ECHO in -X*--fallback-echo) - # Remove one level of quotation (which was required for Make). - ECHO=`echo "$lt_ECHO" | sed 's,\\\\\$\\$0,'$0','` - ;; -esac - -ECHO=${lt_ECHO-echo} -if test "X$1" = X--no-reexec; then - # Discard the --no-reexec flag, and continue. - shift -elif test "X$1" = X--fallback-echo; then - # Avoid inline document here, it may be left over - : -elif test "X`{ $ECHO '\t'; } 2>/dev/null`" = 'X\t' ; then - # Yippee, $ECHO works! - : -else - # Restart under the correct shell. - exec $SHELL "$0" --no-reexec ${1+"$@"} -fi - -if test "X$1" = X--fallback-echo; then - # used as fallback echo - shift - cat <<_LT_EOF -$* -_LT_EOF - exit 0 -fi - -# The HP-UX ksh and POSIX shell print the target directory to stdout -# if CDPATH is set. -(unset CDPATH) >/dev/null 2>&1 && unset CDPATH - -if test -z "$lt_ECHO"; then - if test "X${echo_test_string+set}" != Xset; then - # find a string as large as possible, as long as the shell can cope with it - for cmd in 'sed 50q "$0"' 'sed 20q "$0"' 'sed 10q "$0"' 'sed 2q "$0"' 'echo test'; do - # expected sizes: less than 2Kb, 1Kb, 512 bytes, 16 bytes, ... - if { echo_test_string=`eval $cmd`; } 2>/dev/null && - { test "X$echo_test_string" = "X$echo_test_string"; } 2>/dev/null - then - break - fi - done - fi - - if test "X`{ $ECHO '\t'; } 2>/dev/null`" = 'X\t' && - echo_testing_string=`{ $ECHO "$echo_test_string"; } 2>/dev/null` && - test "X$echo_testing_string" = "X$echo_test_string"; then - : - else - # The Solaris, AIX, and Digital Unix default echo programs unquote - # backslashes. This makes it impossible to quote backslashes using - # echo "$something" | sed 's/\\/\\\\/g' - # - # So, first we look for a working echo in the user's PATH. - - lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR - for dir in $PATH /usr/ucb; do - IFS="$lt_save_ifs" - if (test -f $dir/echo || test -f $dir/echo$ac_exeext) && - test "X`($dir/echo '\t') 2>/dev/null`" = 'X\t' && - echo_testing_string=`($dir/echo "$echo_test_string") 2>/dev/null` && - test "X$echo_testing_string" = "X$echo_test_string"; then - ECHO="$dir/echo" - break - fi - done - IFS="$lt_save_ifs" - - if test "X$ECHO" = Xecho; then - # We didn't find a better echo, so look for alternatives. - if test "X`{ print -r '\t'; } 2>/dev/null`" = 'X\t' && - echo_testing_string=`{ print -r "$echo_test_string"; } 2>/dev/null` && - test "X$echo_testing_string" = "X$echo_test_string"; then - # This shell has a builtin print -r that does the trick. - ECHO='print -r' - elif { test -f /bin/ksh || test -f /bin/ksh$ac_exeext; } && - test "X$CONFIG_SHELL" != X/bin/ksh; then - # If we have ksh, try running configure again with it. - ORIGINAL_CONFIG_SHELL=${CONFIG_SHELL-/bin/sh} - export ORIGINAL_CONFIG_SHELL - CONFIG_SHELL=/bin/ksh - export CONFIG_SHELL - exec $CONFIG_SHELL "$0" --no-reexec ${1+"$@"} - else - # Try using printf. - ECHO='printf %s\n' - if test "X`{ $ECHO '\t'; } 2>/dev/null`" = 'X\t' && - echo_testing_string=`{ $ECHO "$echo_test_string"; } 2>/dev/null` && - test "X$echo_testing_string" = "X$echo_test_string"; then - # Cool, printf works - : - elif echo_testing_string=`($ORIGINAL_CONFIG_SHELL "$0" --fallback-echo '\t') 2>/dev/null` && - test "X$echo_testing_string" = 'X\t' && - echo_testing_string=`($ORIGINAL_CONFIG_SHELL "$0" --fallback-echo "$echo_test_string") 2>/dev/null` && - test "X$echo_testing_string" = "X$echo_test_string"; then - CONFIG_SHELL=$ORIGINAL_CONFIG_SHELL - export CONFIG_SHELL - SHELL="$CONFIG_SHELL" - export SHELL - ECHO="$CONFIG_SHELL $0 --fallback-echo" - elif echo_testing_string=`($CONFIG_SHELL "$0" --fallback-echo '\t') 2>/dev/null` && - test "X$echo_testing_string" = 'X\t' && - echo_testing_string=`($CONFIG_SHELL "$0" --fallback-echo "$echo_test_string") 2>/dev/null` && - test "X$echo_testing_string" = "X$echo_test_string"; then - ECHO="$CONFIG_SHELL $0 --fallback-echo" - else - # maybe with a smaller string... - prev=: - - for cmd in 'echo test' 'sed 2q "$0"' 'sed 10q "$0"' 'sed 20q "$0"' 'sed 50q "$0"'; do - if { test "X$echo_test_string" = "X`eval $cmd`"; } 2>/dev/null - then - break - fi - prev="$cmd" - done - - if test "$prev" != 'sed 50q "$0"'; then - echo_test_string=`eval $prev` - export echo_test_string - exec ${ORIGINAL_CONFIG_SHELL-${CONFIG_SHELL-/bin/sh}} "$0" ${1+"$@"} - else - # Oops. We lost completely, so just stick with echo. - ECHO=echo - fi - fi - fi - fi - fi -fi - -# Copy echo and quote the copy suitably for passing to libtool from -# the Makefile, instead of quoting the original, which is used later. -lt_ECHO=$ECHO -if test "X$lt_ECHO" = "X$CONFIG_SHELL $0 --fallback-echo"; then - lt_ECHO="$CONFIG_SHELL \\\$\$0 --fallback-echo" -fi - - - +as_awk_strverscmp=' + # Use only awk features that work with 7th edition Unix awk (1978). + # My, what an old awk you have, Mr. Solaris! + END { + while (length(v1) && length(v2)) { + # Set d1 to be the next thing to compare from v1, and likewise for d2. + # Normally this is a single character, but if v1 and v2 contain digits, + # compare them as integers and fractions as strverscmp does. + if (v1 ~ /^[0-9]/ && v2 ~ /^[0-9]/) { + # Split v1 and v2 into their leading digit string components d1 and d2, + # and advance v1 and v2 past the leading digit strings. + for (len1 = 1; substr(v1, len1 + 1) ~ /^[0-9]/; len1++) continue + for (len2 = 1; substr(v2, len2 + 1) ~ /^[0-9]/; len2++) continue + d1 = substr(v1, 1, len1); v1 = substr(v1, len1 + 1) + d2 = substr(v2, 1, len2); v2 = substr(v2, len2 + 1) + if (d1 ~ /^0/) { + if (d2 ~ /^0/) { + # Compare two fractions. + while (d1 ~ /^0/ && d2 ~ /^0/) { + d1 = substr(d1, 2); len1-- + d2 = substr(d2, 2); len2-- + } + if (len1 != len2 && ! (len1 && len2 && substr(d1, 1, 1) == substr(d2, 1, 1))) { + # The two components differ in length, and the common prefix + # contains only leading zeros. Consider the longer to be less. + d1 = -len1 + d2 = -len2 + } else { + # Otherwise, compare as strings. + d1 = "x" d1 + d2 = "x" d2 + } + } else { + # A fraction is less than an integer. + exit 1 + } + } else { + if (d2 ~ /^0/) { + # An integer is greater than a fraction. + exit 2 + } else { + # Compare two integers. + d1 += 0 + d2 += 0 + } + } + } else { + # The normal case, without worrying about digits. + d1 = substr(v1, 1, 1); v1 = substr(v1, 2) + d2 = substr(v2, 1, 1); v2 = substr(v2, 2) + } + if (d1 < d2) exit 1 + if (d1 > d2) exit 2 + } + # Beware Solaris /usr/xgp4/bin/awk (at least through Solaris 10), + # which mishandles some comparisons of empty strings to integers. + if (length(v2)) exit 1 + if (length(v1)) exit 2 + } +' test -n "$DJDIR" || exec 7<&0 &1 # Name of the host. -# hostname on some systems (SVR3.2, Linux) returns a bogus exit status, +# hostname on some systems (SVR3.2, old GNU/Linux) returns a bogus exit status, # so uname gets run too. ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q` @@ -701,8 +650,8 @@ # Identity of this package. PACKAGE_NAME='libdap' PACKAGE_TARNAME='libdap' -PACKAGE_VERSION='3.11.1' -PACKAGE_STRING='libdap 3.11.1' +PACKAGE_VERSION='3.12.0' +PACKAGE_STRING='libdap 3.12.0' PACKAGE_BUGREPORT='opendap-tech@opendap.org' PACKAGE_URL='' @@ -753,6 +702,10 @@ am__EXEEXT_TRUE LTLIBOBJS LIBOBJS +BUILD_DEVELOPER_FALSE +BUILD_DEVELOPER_TRUE +DAP4_DEFINED_FALSE +DAP4_DEFINED_TRUE CPPUNIT_LIBS CPPUNIT_CFLAGS CPPUNIT_FALSE @@ -760,10 +713,6 @@ CPPUNIT_CONFIG UUID_LIBS PTHREAD_LIBS -ZLIB_CFLAGS -ZLIB_LDFLAGS -ZLIB_LIBS -XML2_STATIC_LIBS xmlprivatelibs xmlprivatereq XML2_LIBS @@ -775,16 +724,23 @@ CURL_CFLAGS PKG_CONFIG gltests_WITNESS +REPLACE_TOWLOWER REPLACE_ISWCNTRL HAVE_WCTYPE_H NEXT_AS_FIRST_DIRECTIVE_WCTYPE_H NEXT_WCTYPE_H +HAVE_ISWCNTRL REPLACE_ISWBLANK +HAVE_WCTRANS_T +HAVE_WCTYPE_T HAVE_ISWBLANK -HAVE_ISWCNTRL +GNULIB_TOWCTRANS +GNULIB_WCTRANS +GNULIB_ISWCTYPE +GNULIB_WCTYPE +GNULIB_ISWBLANK HAVE_WINT_T HAVE_FEATURES_H -HAVE_WCHAR_H NEXT_AS_FIRST_DIRECTIVE_WCHAR_H NEXT_WCHAR_H HAVE_UNISTD_H @@ -801,17 +757,20 @@ REPLACE_SLEEP REPLACE_RMDIR REPLACE_READLINK +REPLACE_READ REPLACE_PWRITE REPLACE_PREAD REPLACE_LSEEK REPLACE_LINKAT REPLACE_LINK REPLACE_LCHOWN +REPLACE_ISATTY REPLACE_GETPAGESIZE REPLACE_GETGROUPS REPLACE_GETLOGIN_R REPLACE_GETDOMAINNAME REPLACE_GETCWD +REPLACE_FTRUNCATE REPLACE_FCHOWNAT REPLACE_DUP2 REPLACE_DUP @@ -820,10 +779,12 @@ HAVE_SYS_PARAM_H HAVE_OS_H HAVE_DECL_TTYNAME_R +HAVE_DECL_SETHOSTNAME HAVE_DECL_GETUSERSHELL HAVE_DECL_GETPAGESIZE HAVE_DECL_GETLOGIN_R HAVE_DECL_GETDOMAINNAME +HAVE_DECL_FDATASYNC HAVE_DECL_FCHDIR HAVE_DECL_ENVIRON HAVE_USLEEP @@ -831,6 +792,7 @@ HAVE_SYMLINKAT HAVE_SYMLINK HAVE_SLEEP +HAVE_SETHOSTNAME HAVE_READLINKAT HAVE_READLINK HAVE_PWRITE @@ -840,6 +802,7 @@ HAVE_LINKAT HAVE_LINK HAVE_LCHOWN +HAVE_GROUP_MEMBER HAVE_GETPAGESIZE HAVE_GETLOGIN HAVE_GETHOSTNAME @@ -847,6 +810,7 @@ HAVE_GETDTABLESIZE HAVE_FTRUNCATE HAVE_FSYNC +HAVE_FDATASYNC HAVE_FCHOWNAT HAVE_FCHDIR HAVE_FACCESSAT @@ -859,14 +823,16 @@ GNULIB_UNLINKAT GNULIB_UNLINK GNULIB_UNISTD_H_SIGPIPE -GNULIB_UNISTD_H_GETOPT +GNULIB_UNISTD_H_NONBLOCKING GNULIB_TTYNAME_R GNULIB_SYMLINKAT GNULIB_SYMLINK GNULIB_SLEEP +GNULIB_SETHOSTNAME GNULIB_RMDIR GNULIB_READLINKAT GNULIB_READLINK +GNULIB_READ GNULIB_PWRITE GNULIB_PREAD GNULIB_PIPE2 @@ -875,6 +841,8 @@ GNULIB_LINKAT GNULIB_LINK GNULIB_LCHOWN +GNULIB_ISATTY +GNULIB_GROUP_MEMBER GNULIB_GETUSERSHELL GNULIB_GETPAGESIZE GNULIB_GETLOGIN_R @@ -886,6 +854,7 @@ GNULIB_GETCWD GNULIB_FTRUNCATE GNULIB_FSYNC +GNULIB_FDATASYNC GNULIB_FCHOWNAT GNULIB_FCHDIR GNULIB_FACCESSAT @@ -893,11 +862,24 @@ GNULIB_ENVIRON GNULIB_DUP3 GNULIB_DUP2 +GNULIB_DUP GNULIB_CLOSE GNULIB_CHOWN -HAVE_RANDOM_H +GNULIB_CHDIR +WINDOWS_64_BIT_OFF_T +NEXT_AS_FIRST_DIRECTIVE_SYS_TYPES_H +NEXT_SYS_TYPES_H +HAVE_STRINGS_H +NEXT_AS_FIRST_DIRECTIVE_STRINGS_H +NEXT_STRINGS_H +HAVE_DECL_STRNCASECMP +HAVE_STRCASECMP +HAVE_FFS +GNULIB_FFS NEXT_AS_FIRST_DIRECTIVE_STDLIB_H NEXT_STDLIB_H +GL_GENERATE_STDINT_H_FALSE +GL_GENERATE_STDINT_H_TRUE STDINT_H WINT_T_SUFFIX WCHAR_T_SUFFIX @@ -919,26 +901,28 @@ NEXT_STDINT_H HAVE_SYS_TYPES_H HAVE_INTTYPES_H +HAVE_WCHAR_H HAVE_UNSIGNED_LONG_LONG_INT HAVE_LONG_LONG_INT -NEXT_AS_FIRST_DIRECTIVE_STDDEF_H -NEXT_STDDEF_H -STDDEF_H -HAVE_WCHAR_T -REPLACE_NULL HAVE__BOOL +GL_GENERATE_STDBOOL_H_FALSE +GL_GENERATE_STDBOOL_H_TRUE STDBOOL_H APPLE_UNIVERSAL_BUILD LOCALE_FR_UTF8 LOCALE_ZH_CN LOCALE_JA +REPLACE_WCTOMB REPLACE_UNSETENV REPLACE_STRTOD REPLACE_SETENV REPLACE_REALPATH REPLACE_REALLOC +REPLACE_RANDOM_R REPLACE_PUTENV +REPLACE_PTSNAME_R REPLACE_MKSTEMP +REPLACE_MBTOWC REPLACE_MALLOC REPLACE_CANONICALIZE_FILE_NAME REPLACE_CALLOC @@ -954,7 +938,11 @@ HAVE_RPMATCH HAVE_REALPATH HAVE_RANDOM_R +HAVE_RANDOM_H +HAVE_RANDOM +HAVE_PTSNAME_R HAVE_PTSNAME +HAVE_POSIX_OPENPT HAVE_MKSTEMPS HAVE_MKSTEMP HAVE_MKOSTEMPS @@ -966,6 +954,7 @@ HAVE_CANONICALIZE_FILE_NAME HAVE_ATOLL HAVE__EXIT +GNULIB_WCTOMB GNULIB_UNSETENV GNULIB_UNLOCKPT GNULIB_SYSTEM_POSIX @@ -977,13 +966,17 @@ GNULIB_REALPATH GNULIB_REALLOC_POSIX GNULIB_RANDOM_R +GNULIB_RANDOM GNULIB_PUTENV +GNULIB_PTSNAME_R GNULIB_PTSNAME +GNULIB_POSIX_OPENPT GNULIB_MKSTEMPS GNULIB_MKSTEMP GNULIB_MKOSTEMPS GNULIB_MKOSTEMP GNULIB_MKDTEMP +GNULIB_MBTOWC GNULIB_MALLOC_POSIX GNULIB_GRANTPT GNULIB_GETSUBOPT @@ -992,6 +985,24 @@ GNULIB_CALLOC_POSIX GNULIB_ATOLL GNULIB__EXIT +NEXT_AS_FIRST_DIRECTIVE_LOCALE_H +NEXT_LOCALE_H +HAVE_XLOCALE_H +NEXT_AS_FIRST_DIRECTIVE_STDDEF_H +NEXT_STDDEF_H +GL_GENERATE_STDDEF_H_FALSE +GL_GENERATE_STDDEF_H_TRUE +STDDEF_H +HAVE_WCHAR_T +REPLACE_NULL +REPLACE_STRUCT_LCONV +REPLACE_DUPLOCALE +REPLACE_SETLOCALE +REPLACE_LOCALECONV +HAVE_DUPLOCALE +GNULIB_DUPLOCALE +GNULIB_SETLOCALE +GNULIB_LOCALECONV LOCALCHARSET_TESTS_ENVIRONMENT GLIBC21 HAVE_LANGINFO_YESEXPR @@ -1012,7 +1023,11 @@ LIBINTL pkglibexecdir lispdir +GL_GENERATE_BYTESWAP_H_FALSE +GL_GENERATE_BYTESWAP_H_TRUE +BYTESWAP_H LOCALE_FR +REPLACE_WCSWIDTH REPLACE_WCWIDTH REPLACE_WCSNRTOMBS REPLACE_WCSRTOMBS @@ -1027,6 +1042,34 @@ REPLACE_MBSTATE_T HAVE_DECL_WCWIDTH HAVE_DECL_WCTOB +HAVE_WCSWIDTH +HAVE_WCSTOK +HAVE_WCSSTR +HAVE_WCSPBRK +HAVE_WCSSPN +HAVE_WCSCSPN +HAVE_WCSRCHR +HAVE_WCSCHR +HAVE_WCSDUP +HAVE_WCSXFRM +HAVE_WCSCOLL +HAVE_WCSNCASECMP +HAVE_WCSCASECMP +HAVE_WCSNCMP +HAVE_WCSCMP +HAVE_WCSNCAT +HAVE_WCSCAT +HAVE_WCPNCPY +HAVE_WCSNCPY +HAVE_WCPCPY +HAVE_WCSCPY +HAVE_WCSNLEN +HAVE_WCSLEN +HAVE_WMEMSET +HAVE_WMEMMOVE +HAVE_WMEMCPY +HAVE_WMEMCMP +HAVE_WMEMCHR HAVE_WCSNRTOMBS HAVE_WCSRTOMBS HAVE_WCRTOMB @@ -1036,6 +1079,34 @@ HAVE_MBRTOWC HAVE_MBSINIT HAVE_BTOWC +GNULIB_WCSWIDTH +GNULIB_WCSTOK +GNULIB_WCSSTR +GNULIB_WCSPBRK +GNULIB_WCSSPN +GNULIB_WCSCSPN +GNULIB_WCSRCHR +GNULIB_WCSCHR +GNULIB_WCSDUP +GNULIB_WCSXFRM +GNULIB_WCSCOLL +GNULIB_WCSNCASECMP +GNULIB_WCSCASECMP +GNULIB_WCSNCMP +GNULIB_WCSCMP +GNULIB_WCSNCAT +GNULIB_WCSCAT +GNULIB_WCPNCPY +GNULIB_WCSNCPY +GNULIB_WCPCPY +GNULIB_WCSCPY +GNULIB_WCSNLEN +GNULIB_WCSLEN +GNULIB_WMEMSET +GNULIB_WMEMMOVE +GNULIB_WMEMCPY +GNULIB_WMEMCMP +GNULIB_WMEMCHR GNULIB_WCWIDTH GNULIB_WCSNRTOMBS GNULIB_WCSRTOMBS @@ -1047,12 +1118,12 @@ GNULIB_MBSINIT GNULIB_WCTOB GNULIB_BTOWC +GL_GENERATE_ALLOCA_H_FALSE +GL_GENERATE_ALLOCA_H_TRUE ALLOCA_H ALLOCA GL_COND_LIBTOOL_FALSE GL_COND_LIBTOOL_TRUE -COMPILER_IS_GCC_FALSE -COMPILER_IS_GCC_TRUE USE_C99_TYPES_FALSE USE_C99_TYPES_TRUE YACC @@ -1062,8 +1133,9 @@ LIPO NMEDIT DSYMUTIL -lt_ECHO -AR +MANIFEST_TOOL +ac_ct_AR +DLLTOOL OBJDUMP NM ac_ct_DUMPBIN @@ -1076,10 +1148,14 @@ LEXLIB LEX_OUTPUT_ROOT LEX +COMPILER_IS_GCC_FALSE +COMPILER_IS_GCC_TRUE +RANLIB +ARFLAGS +AR EGREP GREP CPP -RANLIB am__fastdepCC_FALSE am__fastdepCC_TRUE CCDEPMODE @@ -1089,6 +1165,7 @@ am__fastdepCXX_FALSE am__fastdepCXX_TRUE CXXDEPMODE +am__nodep AMDEPBACKSLASH AMDEP_FALSE AMDEP_TRUE @@ -1198,12 +1275,17 @@ with_pic enable_fast_install with_gnu_ld +with_sysroot enable_libtool_lock +enable_runtime_endian_check with_included_regex -with_zlib +with_curl +with_xml2 with_cppunit_prefix with_cppunit_exec_prefix enable_debug +enable_dap4 +enable_developer ' ac_precious_vars='build_alias host_alias @@ -1285,8 +1367,9 @@ fi case $ac_option in - *=*) ac_optarg=`expr "X$ac_option" : '[^=]*=\(.*\)'` ;; - *) ac_optarg=yes ;; + *=?*) ac_optarg=`expr "X$ac_option" : '[^=]*=\(.*\)'` ;; + *=) ac_optarg= ;; + *) ac_optarg=yes ;; esac # Accept the important Cygnus configure options, so we can diagnose typos. @@ -1331,7 +1414,7 @@ ac_useropt=`expr "x$ac_option" : 'x-*disable-\(.*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && - as_fn_error "invalid feature name: $ac_useropt" + as_fn_error $? "invalid feature name: $ac_useropt" ac_useropt_orig=$ac_useropt ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in @@ -1357,7 +1440,7 @@ ac_useropt=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && - as_fn_error "invalid feature name: $ac_useropt" + as_fn_error $? "invalid feature name: $ac_useropt" ac_useropt_orig=$ac_useropt ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in @@ -1561,7 +1644,7 @@ ac_useropt=`expr "x$ac_option" : 'x-*with-\([^=]*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && - as_fn_error "invalid package name: $ac_useropt" + as_fn_error $? "invalid package name: $ac_useropt" ac_useropt_orig=$ac_useropt ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in @@ -1577,7 +1660,7 @@ ac_useropt=`expr "x$ac_option" : 'x-*without-\(.*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && - as_fn_error "invalid package name: $ac_useropt" + as_fn_error $? "invalid package name: $ac_useropt" ac_useropt_orig=$ac_useropt ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in @@ -1607,8 +1690,8 @@ | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*) x_libraries=$ac_optarg ;; - -*) as_fn_error "unrecognized option: \`$ac_option' -Try \`$0 --help' for more information." + -*) as_fn_error $? "unrecognized option: \`$ac_option' +Try \`$0 --help' for more information" ;; *=*) @@ -1616,7 +1699,7 @@ # Reject names that are not valid shell variable names. case $ac_envvar in #( '' | [0-9]* | *[!_$as_cr_alnum]* ) - as_fn_error "invalid variable name: \`$ac_envvar'" ;; + as_fn_error $? "invalid variable name: \`$ac_envvar'" ;; esac eval $ac_envvar=\$ac_optarg export $ac_envvar ;; @@ -1626,7 +1709,7 @@ $as_echo "$as_me: WARNING: you should use --build, --host, --target" >&2 expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null && $as_echo "$as_me: WARNING: invalid host type: $ac_option" >&2 - : ${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option} + : "${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option}" ;; esac @@ -1634,13 +1717,13 @@ if test -n "$ac_prev"; then ac_option=--`echo $ac_prev | sed 's/_/-/g'` - as_fn_error "missing argument to $ac_option" + as_fn_error $? "missing argument to $ac_option" fi if test -n "$ac_unrecognized_opts"; then case $enable_option_checking in no) ;; - fatal) as_fn_error "unrecognized options: $ac_unrecognized_opts" ;; + fatal) as_fn_error $? "unrecognized options: $ac_unrecognized_opts" ;; *) $as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2 ;; esac fi @@ -1663,7 +1746,7 @@ [\\/$]* | ?:[\\/]* ) continue;; NONE | '' ) case $ac_var in *prefix ) continue;; esac;; esac - as_fn_error "expected an absolute directory name for --$ac_var: $ac_val" + as_fn_error $? "expected an absolute directory name for --$ac_var: $ac_val" done # There might be people who depend on the old broken behavior: `$host' @@ -1677,8 +1760,6 @@ if test "x$host_alias" != x; then if test "x$build_alias" = x; then cross_compiling=maybe - $as_echo "$as_me: WARNING: If you wanted to set the --build type, don't use --host. - If a cross compiler is detected then cross compile mode will be used." >&2 elif test "x$build_alias" != "x$host_alias"; then cross_compiling=yes fi @@ -1693,9 +1774,9 @@ ac_pwd=`pwd` && test -n "$ac_pwd" && ac_ls_di=`ls -di .` && ac_pwd_ls_di=`cd "$ac_pwd" && ls -di .` || - as_fn_error "working directory cannot be determined" + as_fn_error $? "working directory cannot be determined" test "X$ac_ls_di" = "X$ac_pwd_ls_di" || - as_fn_error "pwd does not report name of working directory" + as_fn_error $? "pwd does not report name of working directory" # Find the source files, if location was not specified. @@ -1734,11 +1815,11 @@ fi if test ! -r "$srcdir/$ac_unique_file"; then test "$ac_srcdir_defaulted" = yes && srcdir="$ac_confdir or .." - as_fn_error "cannot find sources ($ac_unique_file) in $srcdir" + as_fn_error $? "cannot find sources ($ac_unique_file) in $srcdir" fi ac_msg="sources are in $srcdir, but \`cd $srcdir' does not work" ac_abs_confdir=`( - cd "$srcdir" && test -r "./$ac_unique_file" || as_fn_error "$ac_msg" + cd "$srcdir" && test -r "./$ac_unique_file" || as_fn_error $? "$ac_msg" pwd)` # When building in place, set srcdir=. if test "$ac_abs_confdir" = "$ac_pwd"; then @@ -1764,7 +1845,7 @@ # 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 <<_ACEOF -\`configure' configures libdap 3.11.1 to adapt to many kinds of systems. +\`configure' configures libdap 3.12.0 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... @@ -1778,7 +1859,7 @@ --help=short display options specific to this package --help=recursive display the short help of all the included packages -V, --version display version information and exit - -q, --quiet, --silent do not print \`checking...' messages + -q, --quiet, --silent do not print \`checking ...' messages --cache-file=FILE cache test results in FILE [disabled] -C, --config-cache alias for \`--cache-file=config.cache' -n, --no-create do not create output files @@ -1834,7 +1915,7 @@ if test -n "$ac_init_help"; then case $ac_init_help in - short | recursive ) echo "Configuration of libdap 3.11.1:";; + short | recursive ) echo "Configuration of libdap 3.12.0:";; esac cat <<\_ACEOF @@ -1842,28 +1923,38 @@ --disable-option-checking ignore unrecognized --enable/--with options --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no) --enable-FEATURE[=ARG] include FEATURE [ARG=yes] - --disable-dependency-tracking speeds up one-time build - --enable-dependency-tracking do not reject slow dependency extractors + --enable-dependency-tracking + do not reject slow dependency extractors + --disable-dependency-tracking + speeds up one-time build --enable-shared[=PKGS] build shared libraries [default=yes] --enable-static[=PKGS] build static libraries [default=yes] --enable-fast-install[=PKGS] optimize for fast installation [default=yes] --disable-libtool-lock avoid locking (might break parallel builds) + --enable-runtime-endian-check + Enable runtime tests for big- or little-endian byte + order (default is NO) + --enable-debug=ARG Program instrumentation (1,2) + --enable-dap4 Enable DAP4 types and responses (default is NO) + --enable-developer Build a debug (-g3 -O0) version of this code and + include assert() calls in the code (default is no) Optional Packages: --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no) - --with-pic try to use only PIC/non-PIC objects [default=use + --with-pic[=PKGS] try to use only PIC/non-PIC objects [default=use both] --with-gnu-ld assume the C compiler uses GNU ld [default=no] + --with-sysroot=DIR Search for dependent libraries within DIR + (or the compiler's sysroot if not specified). --without-included-regex don't compile regex; this is the default on systems with recent-enough versions of the GNU C Library (use with caution on other systems). - --with-zlib=DIR root directory path of zlib installation defaults to - /usr/local or /usr if not found in /usr/local - --without-zlib to disable zlib usage completely + --with-curl=PFX Prefix where curl/libcurl is installed (optional). This will override pkgconfig, etc. + --with-xml2=PFX Prefix where libxml2 is installed (optional). This will override pkgconfig, etc. --with-cppunit-prefix=PFX Prefix where CppUnit is installed (optional) --with-cppunit-exec-prefix=PFX Exec prefix where CppUnit is installed (optional) @@ -1951,10 +2042,10 @@ test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF -libdap configure 3.11.1 -generated by GNU Autoconf 2.65 +libdap configure 3.12.0 +generated by GNU Autoconf 2.69 -Copyright (C) 2009 Free Software Foundation, Inc. +Copyright (C) 2012 Free Software Foundation, Inc. This configure script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it. _ACEOF @@ -1998,7 +2089,7 @@ ac_retval=1 fi - eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;} + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno as_fn_set_status $ac_retval } # ac_fn_cxx_try_compile @@ -2036,7 +2127,7 @@ ac_retval=1 fi - eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;} + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno as_fn_set_status $ac_retval } # ac_fn_c_try_compile @@ -2062,7 +2153,7 @@ mv -f conftest.er1 conftest.err fi $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; } >/dev/null && { + test $ac_status = 0; } > conftest.i && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.err }; then : @@ -2073,7 +2164,7 @@ ac_retval=1 fi - eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;} + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno as_fn_set_status $ac_retval } # ac_fn_c_try_cpp @@ -2086,10 +2177,10 @@ ac_fn_c_check_header_mongrel () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack - if { as_var=$3; eval "test \"\${$as_var+set}\" = set"; }; then : + if eval \${$3+:} false; then : { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 $as_echo_n "checking for $2... " >&6; } -if { as_var=$3; eval "test \"\${$as_var+set}\" = set"; }; then : +if eval \${$3+:} false; then : $as_echo_n "(cached) " >&6 fi eval ac_res=\$$3 @@ -2125,7 +2216,7 @@ else ac_header_preproc=no fi -rm -f conftest.err conftest.$ac_ext +rm -f conftest.err conftest.i conftest.$ac_ext { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_header_preproc" >&5 $as_echo "$ac_header_preproc" >&6; } @@ -2148,17 +2239,15 @@ $as_echo "$as_me: WARNING: $2: section \"Present But Cannot Be Compiled\"" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: proceeding with the compiler's result" >&5 $as_echo "$as_me: WARNING: $2: proceeding with the compiler's result" >&2;} -( cat <<\_ASBOX -## --------------------------------------- ## +( $as_echo "## --------------------------------------- ## ## Report this to opendap-tech@opendap.org ## -## --------------------------------------- ## -_ASBOX +## --------------------------------------- ##" ) | sed "s/^/$as_me: WARNING: /" >&2 ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 $as_echo_n "checking for $2... " >&6; } -if { as_var=$3; eval "test \"\${$as_var+set}\" = set"; }; then : +if eval \${$3+:} false; then : $as_echo_n "(cached) " >&6 else eval "$3=\$ac_header_compiler" @@ -2167,7 +2256,7 @@ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } fi - eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;} + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno } # ac_fn_c_check_header_mongrel @@ -2208,7 +2297,7 @@ ac_retval=$ac_status fi rm -rf conftest.dSYM conftest_ipa8_conftest.oo - eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;} + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno as_fn_set_status $ac_retval } # ac_fn_c_try_run @@ -2222,7 +2311,7 @@ as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 $as_echo_n "checking for $2... " >&6; } -if { as_var=$3; eval "test \"\${$as_var+set}\" = set"; }; then : +if eval \${$3+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -2240,7 +2329,7 @@ eval ac_res=\$$3 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } - eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;} + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno } # ac_fn_c_check_header_compile @@ -2271,7 +2360,7 @@ test ! -s conftest.err } && test -s conftest$ac_exeext && { test "$cross_compiling" = yes || - $as_test_x conftest$ac_exeext + test -x conftest$ac_exeext }; then : ac_retval=0 else @@ -2285,7 +2374,7 @@ # interfere with the next link command; also delete a directory that is # left behind by Apple's compiler. We do this before executing the actions. rm -rf conftest.dSYM conftest_ipa8_conftest.oo - eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;} + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno as_fn_set_status $ac_retval } # ac_fn_c_try_link @@ -2298,7 +2387,7 @@ as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 $as_echo_n "checking for $2... " >&6; } -if { as_var=$3; eval "test \"\${$as_var+set}\" = set"; }; then : +if eval \${$3+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -2353,7 +2442,7 @@ eval ac_res=\$$3 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } - eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;} + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno } # ac_fn_c_check_func @@ -2378,7 +2467,7 @@ mv -f conftest.er1 conftest.err fi $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; } >/dev/null && { + test $ac_status = 0; } > conftest.i && { test -z "$ac_cxx_preproc_warn_flag$ac_cxx_werror_flag" || test ! -s conftest.err }; then : @@ -2389,7 +2478,7 @@ ac_retval=1 fi - eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;} + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno as_fn_set_status $ac_retval } # ac_fn_cxx_try_cpp @@ -2421,7 +2510,7 @@ test ! -s conftest.err } && test -s conftest$ac_exeext && { test "$cross_compiling" = yes || - $as_test_x conftest$ac_exeext + test -x conftest$ac_exeext }; then : ac_retval=0 else @@ -2435,7 +2524,7 @@ # interfere with the next link command; also delete a directory that is # left behind by Apple's compiler. We do this before executing the actions. rm -rf conftest.dSYM conftest_ipa8_conftest.oo - eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;} + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno as_fn_set_status $ac_retval } # ac_fn_cxx_try_link @@ -2449,7 +2538,7 @@ as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 $as_echo_n "checking for $2... " >&6; } -if { as_var=$3; eval "test \"\${$as_var+set}\" = set"; }; then : +if eval \${$3+:} false; then : $as_echo_n "(cached) " >&6 else eval "$3=no" @@ -2490,7 +2579,7 @@ eval ac_res=\$$3 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } - eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;} + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno } # ac_fn_c_check_type @@ -2503,7 +2592,7 @@ as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2.$3" >&5 $as_echo_n "checking for $2.$3... " >&6; } -if { as_var=$4; eval "test \"\${$as_var+set}\" = set"; }; then : +if eval \${$4+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -2547,7 +2636,7 @@ eval ac_res=\$$4 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } - eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;} + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno } # ac_fn_c_check_member @@ -2568,7 +2657,8 @@ main () { static int test_array [1 - 2 * !(($2) >= 0)]; -test_array [0] = 0 +test_array [0] = 0; +return test_array [0]; ; return 0; @@ -2584,7 +2674,8 @@ main () { static int test_array [1 - 2 * !(($2) <= $ac_mid)]; -test_array [0] = 0 +test_array [0] = 0; +return test_array [0]; ; return 0; @@ -2610,7 +2701,8 @@ main () { static int test_array [1 - 2 * !(($2) < 0)]; -test_array [0] = 0 +test_array [0] = 0; +return test_array [0]; ; return 0; @@ -2626,7 +2718,8 @@ main () { static int test_array [1 - 2 * !(($2) >= $ac_mid)]; -test_array [0] = 0 +test_array [0] = 0; +return test_array [0]; ; return 0; @@ -2660,7 +2753,8 @@ main () { static int test_array [1 - 2 * !(($2) <= $ac_mid)]; -test_array [0] = 0 +test_array [0] = 0; +return test_array [0]; ; return 0; @@ -2724,20 +2818,23 @@ rm -f conftest.val fi - eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;} + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno as_fn_set_status $ac_retval } # ac_fn_c_compute_int -# ac_fn_c_check_decl LINENO SYMBOL VAR -# ------------------------------------ -# Tests whether SYMBOL is declared, setting cache variable VAR accordingly. +# ac_fn_c_check_decl LINENO SYMBOL VAR INCLUDES +# --------------------------------------------- +# Tests whether SYMBOL is declared in INCLUDES, setting cache variable VAR +# accordingly. ac_fn_c_check_decl () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $2 is declared" >&5 -$as_echo_n "checking whether $2 is declared... " >&6; } -if { as_var=$3; eval "test \"\${$as_var+set}\" = set"; }; then : + as_decl_name=`echo $2|sed 's/ *(.*//'` + as_decl_use=`echo $2|sed -e 's/(/((/' -e 's/)/) 0&/' -e 's/,/) 0& (/g'` + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $as_decl_name is declared" >&5 +$as_echo_n "checking whether $as_decl_name is declared... " >&6; } +if eval \${$3+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -2746,8 +2843,12 @@ int main () { -#ifndef $2 - (void) $2; +#ifndef $as_decl_name +#ifdef __cplusplus + (void) $as_decl_use; +#else + (void) $as_decl_name; +#endif #endif ; @@ -2764,15 +2865,15 @@ eval ac_res=\$$3 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } - eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;} + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno } # ac_fn_c_check_decl cat >config.log <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. -It was created by libdap $as_me 3.11.1, which was -generated by GNU Autoconf 2.65. Invocation command line was +It was created by libdap $as_me 3.12.0, which was +generated by GNU Autoconf 2.69. Invocation command line was $ $0 $@ @@ -2882,11 +2983,9 @@ { echo - cat <<\_ASBOX -## ---------------- ## + $as_echo "## ---------------- ## ## Cache variables. ## -## ---------------- ## -_ASBOX +## ---------------- ##" echo # The following way of writing the cache mishandles newlines in values, ( @@ -2920,11 +3019,9 @@ ) echo - cat <<\_ASBOX -## ----------------- ## + $as_echo "## ----------------- ## ## Output variables. ## -## ----------------- ## -_ASBOX +## ----------------- ##" echo for ac_var in $ac_subst_vars do @@ -2937,11 +3034,9 @@ echo if test -n "$ac_subst_files"; then - cat <<\_ASBOX -## ------------------- ## + $as_echo "## ------------------- ## ## File substitutions. ## -## ------------------- ## -_ASBOX +## ------------------- ##" echo for ac_var in $ac_subst_files do @@ -2955,11 +3050,9 @@ fi if test -s confdefs.h; then - cat <<\_ASBOX -## ----------- ## + $as_echo "## ----------- ## ## confdefs.h. ## -## ----------- ## -_ASBOX +## ----------- ##" echo cat confdefs.h echo @@ -3014,7 +3107,12 @@ ac_site_file1=NONE ac_site_file2=NONE if test -n "$CONFIG_SITE"; then - ac_site_file1=$CONFIG_SITE + # We do not want a PATH search for config.site. + case $CONFIG_SITE in #(( + -*) ac_site_file1=./$CONFIG_SITE;; + */*) ac_site_file1=$CONFIG_SITE;; + *) ac_site_file1=./$CONFIG_SITE;; + esac elif test "x$prefix" != xNONE; then ac_site_file1=$prefix/share/config.site ac_site_file2=$prefix/etc/config.site @@ -3029,7 +3127,11 @@ { $as_echo "$as_me:${as_lineno-$LINENO}: loading site script $ac_site_file" >&5 $as_echo "$as_me: loading site script $ac_site_file" >&6;} sed 's/^/| /' "$ac_site_file" >&5 - . "$ac_site_file" + . "$ac_site_file" \ + || { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "failed to load site script $ac_site_file +See \`config.log' for more details" "$LINENO" 5; } fi done @@ -3052,19 +3154,21 @@ as_fn_append ac_func_list " btowc" as_fn_append ac_header_list " langinfo.h" +as_fn_append ac_header_list " unistd.h" +as_fn_append ac_func_list " symlink" +as_fn_append ac_header_list " xlocale.h" as_fn_append ac_func_list " mbsinit" as_fn_append ac_func_list " mbrtowc" as_fn_append ac_func_list " nl_langinfo" as_fn_append ac_func_list " isblank" as_fn_append ac_func_list " iswctype" as_fn_append ac_func_list " wcscoll" -as_fn_append ac_header_list " stdint.h" as_fn_append ac_header_list " wchar.h" -as_fn_append ac_header_list " unistd.h" +as_fn_append ac_header_list " stdint.h" +as_fn_append ac_header_list " strings.h" as_fn_append ac_header_list " features.h" as_fn_append ac_func_list " wcrtomb" as_fn_append ac_func_list " iswcntrl" -as_fn_append ac_func_list " iswblank" as_fn_append ac_header_list " wctype.h" # Check that the precious variables saved in the cache have kept the same # value. @@ -3121,7 +3225,7 @@ $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: error: changes in the environment can compromise the build" >&5 $as_echo "$as_me: error: changes in the environment can compromise the build" >&2;} - as_fn_error "run \`make distclean' and/or \`rm $cache_file' and start over" "$LINENO" 5 + as_fn_error $? "run \`make distclean' and/or \`rm $cache_file' and start over" "$LINENO" 5 fi ## -------------------- ## ## Main body of script. ## @@ -3142,16 +3246,22 @@ ac_aux_dir= for ac_dir in conf "$srcdir"/conf; do - for ac_t in install-sh install.sh shtool; do - if test -f "$ac_dir/$ac_t"; then - ac_aux_dir=$ac_dir - ac_install_sh="$ac_aux_dir/$ac_t -c" - break 2 - fi - done + if test -f "$ac_dir/install-sh"; then + ac_aux_dir=$ac_dir + ac_install_sh="$ac_aux_dir/install-sh -c" + break + elif test -f "$ac_dir/install.sh"; then + ac_aux_dir=$ac_dir + ac_install_sh="$ac_aux_dir/install.sh -c" + break + elif test -f "$ac_dir/shtool"; then + ac_aux_dir=$ac_dir + ac_install_sh="$ac_aux_dir/shtool install -c" + break + fi done if test -z "$ac_aux_dir"; then - as_fn_error "cannot find install-sh, install.sh, or shtool in conf \"$srcdir\"/conf" "$LINENO" 5 + as_fn_error $? "cannot find install-sh, install.sh, or shtool in conf \"$srcdir\"/conf" "$LINENO" 5 fi # These three variables are undocumented and unsupported, @@ -3167,7 +3277,7 @@ -am__api_version='1.11' +am__api_version='1.12' # Find a good install program. We prefer a C program (faster), # so one script is as good as another. But avoid the broken or @@ -3186,7 +3296,7 @@ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for a BSD-compatible install" >&5 $as_echo_n "checking for a BSD-compatible install... " >&6; } if test -z "$INSTALL"; then -if test "${ac_cv_path_install+set}" = set; then : +if ${ac_cv_path_install+:} false; then : $as_echo_n "(cached) " >&6 else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR @@ -3206,7 +3316,7 @@ # by default. for ac_prog in ginstall scoinst install; do for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_prog$ac_exec_ext" && $as_test_x "$as_dir/$ac_prog$ac_exec_ext"; }; then + if as_fn_executable_p "$as_dir/$ac_prog$ac_exec_ext"; then if test $ac_prog = install && grep dspmsg "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then # AIX install. It has an incompatible calling convention. @@ -3264,56 +3374,71 @@ { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether build environment is sane" >&5 $as_echo_n "checking whether build environment is sane... " >&6; } -# Just in case -sleep 1 -echo timestamp > conftest.file # Reject unsafe characters in $srcdir or the absolute working directory # name. Accept space and tab only in the latter. am_lf=' ' case `pwd` in *[\\\"\#\$\&\'\`$am_lf]*) - as_fn_error "unsafe absolute working directory name" "$LINENO" 5;; + as_fn_error $? "unsafe absolute working directory name" "$LINENO" 5;; esac case $srcdir in *[\\\"\#\$\&\'\`$am_lf\ \ ]*) - as_fn_error "unsafe srcdir value: \`$srcdir'" "$LINENO" 5;; + as_fn_error $? "unsafe srcdir value: '$srcdir'" "$LINENO" 5;; esac -# Do `set' in a subshell so we don't clobber the current shell's +# Do 'set' in a subshell so we don't clobber the current shell's # arguments. Must try -L first in case configure is actually a # symlink; some systems play weird games with the mod time of symlinks # (eg FreeBSD returns the mod time of the symlink's containing # directory). if ( - set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null` - if test "$*" = "X"; then - # -L didn't work. - set X `ls -t "$srcdir/configure" conftest.file` - fi - rm -f conftest.file - if test "$*" != "X $srcdir/configure conftest.file" \ - && test "$*" != "X conftest.file $srcdir/configure"; then - - # If neither matched, then we have a broken ls. This can happen - # if, for instance, CONFIG_SHELL is bash and it inherits a - # broken ls alias from the environment. This has actually - # happened. Such a system could not be considered "sane". - as_fn_error "ls -t appears to fail. Make sure there is not a broken -alias in your environment" "$LINENO" 5 - fi + am_has_slept=no + for am_try in 1 2; do + echo "timestamp, slept: $am_has_slept" > conftest.file + set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null` + if test "$*" = "X"; then + # -L didn't work. + set X `ls -t "$srcdir/configure" conftest.file` + fi + if test "$*" != "X $srcdir/configure conftest.file" \ + && test "$*" != "X conftest.file $srcdir/configure"; then + # If neither matched, then we have a broken ls. This can happen + # if, for instance, CONFIG_SHELL is bash and it inherits a + # broken ls alias from the environment. This has actually + # happened. Such a system could not be considered "sane". + as_fn_error $? "ls -t appears to fail. Make sure there is not a broken + alias in your environment" "$LINENO" 5 + fi + if test "$2" = conftest.file || test $am_try -eq 2; then + break + fi + # Just in case. + sleep 1 + am_has_slept=yes + done test "$2" = conftest.file ) then # Ok. : else - as_fn_error "newly created file is older than distributed files! + as_fn_error $? "newly created file is older than distributed files! Check your system clock" "$LINENO" 5 fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } +# If we didn't sleep, we still need to ensure time stamps of config.status and +# generated files are strictly newer. +am_sleep_pid= +if grep 'slept: no' conftest.file >/dev/null 2>&1; then + ( sleep 1 ) & + am_sleep_pid=$! +fi + +rm -f conftest.file + test "$program_prefix" != NONE && program_transform_name="s&^&$program_prefix&;$program_transform_name" # Use a double $ so make ignores it. @@ -3340,8 +3465,8 @@ am_missing_run="$MISSING --run " else am_missing_run= - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: \`missing' script is too old or missing" >&5 -$as_echo "$as_me: WARNING: \`missing' script is too old or missing" >&2;} + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: 'missing' script is too old or missing" >&5 +$as_echo "$as_me: WARNING: 'missing' script is too old or missing" >&2;} fi if test x"${install_sh}" != xset; then @@ -3353,17 +3478,17 @@ esac fi -# Installed binaries are usually stripped using `strip' when the user -# run `make install-strip'. However `strip' might not be the right +# Installed binaries are usually stripped using 'strip' when the user +# run "make install-strip". However 'strip' might not be the right # tool to use in cross-compilation environments, therefore Automake -# will honor the `STRIP' environment variable to overrule this program. +# will honor the 'STRIP' environment variable to overrule this program. if test "$cross_compiling" != no; then if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args. set dummy ${ac_tool_prefix}strip; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_prog_STRIP+set}" = set; then : +if ${ac_cv_prog_STRIP+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$STRIP"; then @@ -3375,7 +3500,7 @@ IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_STRIP="${ac_tool_prefix}strip" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 @@ -3403,7 +3528,7 @@ set dummy strip; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_prog_ac_ct_STRIP+set}" = set; then : +if ${ac_cv_prog_ac_ct_STRIP+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_STRIP"; then @@ -3415,7 +3540,7 @@ IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_STRIP="strip" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 @@ -3456,7 +3581,7 @@ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for a thread-safe mkdir -p" >&5 $as_echo_n "checking for a thread-safe mkdir -p... " >&6; } if test -z "$MKDIR_P"; then - if test "${ac_cv_path_mkdir+set}" = set; then : + if ${ac_cv_path_mkdir+:} false; then : $as_echo_n "(cached) " >&6 else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR @@ -3466,7 +3591,7 @@ test -z "$as_dir" && as_dir=. for ac_prog in mkdir gmkdir; do for ac_exec_ext in '' $ac_executable_extensions; do - { test -f "$as_dir/$ac_prog$ac_exec_ext" && $as_test_x "$as_dir/$ac_prog$ac_exec_ext"; } || continue + as_fn_executable_p "$as_dir/$ac_prog$ac_exec_ext" || continue case `"$as_dir/$ac_prog$ac_exec_ext" --version 2>&1` in #( 'mkdir (GNU coreutils) '* | \ 'mkdir (coreutils) '* | \ @@ -3508,7 +3633,7 @@ set dummy $ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_prog_AWK+set}" = set; then : +if ${ac_cv_prog_AWK+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$AWK"; then @@ -3520,7 +3645,7 @@ IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_AWK="$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 @@ -3548,7 +3673,7 @@ $as_echo_n "checking whether ${MAKE-make} sets \$(MAKE)... " >&6; } set x ${MAKE-make} ac_make=`$as_echo "$2" | sed 's/+/p/g; s/[^a-zA-Z0-9_]/_/g'` -if { as_var=ac_cv_prog_make_${ac_make}_set; eval "test \"\${$as_var+set}\" = set"; }; then : +if eval \${ac_cv_prog_make_${ac_make}_set+:} false; then : $as_echo_n "(cached) " >&6 else cat >conftest.make <<\_ACEOF @@ -3556,7 +3681,7 @@ all: @echo '@@@%%%=$(MAKE)=@@@%%%' _ACEOF -# GNU make sometimes prints "make[1]: Entering...", which would confuse us. +# GNU make sometimes prints "make[1]: Entering ...", which would confuse us. case `${MAKE-make} -f conftest.make 2>/dev/null` in *@@@%%%=?*=@@@%%%*) eval ac_cv_prog_make_${ac_make}_set=yes;; @@ -3590,7 +3715,7 @@ am__isrc=' -I$(srcdir)' # test to see if srcdir already configured if test -f $srcdir/config.status; then - as_fn_error "source directory already configured; run \"make distclean\" there first" "$LINENO" 5 + as_fn_error $? "source directory already configured; run \"make distclean\" there first" "$LINENO" 5 fi fi @@ -3606,7 +3731,7 @@ # Define the identity of the package. PACKAGE='libdap' - VERSION='3.11.1' + VERSION='3.12.0' cat >>confdefs.h <<_ACEOF @@ -3636,11 +3761,11 @@ # We need awk for the "check" target. The system "awk" is bad on # some platforms. -# Always define AMTAR for backward compatibility. +# Always define AMTAR for backward compatibility. Yes, it's still used +# in the wild :-( We should find a proper way to deprecate it ... +AMTAR='$${TAR-tar}' -AMTAR=${AMTAR-"${am_missing_run}tar"} - -am__tar='${AMTAR} chof - "$$tardir"'; am__untar='${AMTAR} xf -' +am__tar='$${TAR-tar} chof - "$$tardir"' am__untar='$${TAR-tar} xf -' @@ -3650,7 +3775,6 @@ - $as_echo "#define CNAME \"libdap\"" >>confdefs.h @@ -3665,7 +3789,6 @@ - PACKAGE_MAJOR_VERSION=`echo $PACKAGE_VERSION | sed 's@^\([0-9]\)*\.\([0-9]*\)\.\([0-9]*\)$@\1@'` PACKAGE_MINOR_VERSION=`echo $PACKAGE_VERSION | sed 's@^\([0-9]\)*\.\([0-9]*\)\.\([0-9]*\)$@\2@'` PACKAGE_SUBMINOR_VERSION=`echo $PACKAGE_VERSION | sed 's@^\([0-9]\)*\.\([0-9]*\)\.\([0-9]*\)$@\3@'` @@ -3680,8 +3803,6 @@ - - $as_echo "#define EVAL 1" >>confdefs.h @@ -3689,27 +3810,27 @@ # Make sure we can run config.sub. $SHELL "$ac_aux_dir/config.sub" sun4 >/dev/null 2>&1 || - as_fn_error "cannot run $SHELL $ac_aux_dir/config.sub" "$LINENO" 5 + as_fn_error $? "cannot run $SHELL $ac_aux_dir/config.sub" "$LINENO" 5 { $as_echo "$as_me:${as_lineno-$LINENO}: checking build system type" >&5 $as_echo_n "checking build system type... " >&6; } -if test "${ac_cv_build+set}" = set; then : +if ${ac_cv_build+:} false; then : $as_echo_n "(cached) " >&6 else ac_build_alias=$build_alias test "x$ac_build_alias" = x && ac_build_alias=`$SHELL "$ac_aux_dir/config.guess"` test "x$ac_build_alias" = x && - as_fn_error "cannot guess build type; you must specify one" "$LINENO" 5 + as_fn_error $? "cannot guess build type; you must specify one" "$LINENO" 5 ac_cv_build=`$SHELL "$ac_aux_dir/config.sub" $ac_build_alias` || - as_fn_error "$SHELL $ac_aux_dir/config.sub $ac_build_alias failed" "$LINENO" 5 + as_fn_error $? "$SHELL $ac_aux_dir/config.sub $ac_build_alias failed" "$LINENO" 5 fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_build" >&5 $as_echo "$ac_cv_build" >&6; } case $ac_cv_build in *-*-*) ;; -*) as_fn_error "invalid value of canonical build" "$LINENO" 5;; +*) as_fn_error $? "invalid value of canonical build" "$LINENO" 5;; esac build=$ac_cv_build ac_save_IFS=$IFS; IFS='-' @@ -3727,14 +3848,14 @@ { $as_echo "$as_me:${as_lineno-$LINENO}: checking host system type" >&5 $as_echo_n "checking host system type... " >&6; } -if test "${ac_cv_host+set}" = set; then : +if ${ac_cv_host+:} false; then : $as_echo_n "(cached) " >&6 else if test "x$host_alias" = x; then ac_cv_host=$ac_cv_build else ac_cv_host=`$SHELL "$ac_aux_dir/config.sub" $host_alias` || - as_fn_error "$SHELL $ac_aux_dir/config.sub $host_alias failed" "$LINENO" 5 + as_fn_error $? "$SHELL $ac_aux_dir/config.sub $host_alias failed" "$LINENO" 5 fi fi @@ -3742,7 +3863,7 @@ $as_echo "$ac_cv_host" >&6; } case $ac_cv_host in *-*-*) ;; -*) as_fn_error "invalid value of canonical host" "$LINENO" 5;; +*) as_fn_error $? "invalid value of canonical host" "$LINENO" 5;; esac host=$ac_cv_host ac_save_IFS=$IFS; IFS='-' @@ -3760,8 +3881,8 @@ -DAPLIB_CURRENT=14 -DAPLIB_AGE=3 +DAPLIB_CURRENT=16 +DAPLIB_AGE=5 DAPLIB_REVISION=0 @@ -3770,8 +3891,8 @@ LIBDAP_VERSION="$DAPLIB_CURRENT:$DAPLIB_REVISION:$DAPLIB_AGE" -CLIENTLIB_CURRENT=4 -CLIENTLIB_AGE=1 +CLIENTLIB_CURRENT=5 +CLIENTLIB_AGE=2 CLIENTLIB_REVISION=0 @@ -3780,8 +3901,8 @@ CLIENTLIB_VERSION="$CLIENTLIB_CURRENT:$CLIENTLIB_REVISION:$CLIENTLIB_AGE" -SERVERLIB_CURRENT=9 -SERVERLIB_AGE=2 +SERVERLIB_CURRENT=12 +SERVERLIB_AGE=5 SERVERLIB_REVISION=0 @@ -3796,7 +3917,7 @@ set dummy $ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_prog_AWK+set}" = set; then : +if ${ac_cv_prog_AWK+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$AWK"; then @@ -3808,7 +3929,7 @@ IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_AWK="$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 @@ -3848,7 +3969,7 @@ set dummy $ac_tool_prefix$ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_prog_CXX+set}" = set; then : +if ${ac_cv_prog_CXX+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$CXX"; then @@ -3860,7 +3981,7 @@ IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_CXX="$ac_tool_prefix$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 @@ -3892,7 +4013,7 @@ set dummy $ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_prog_ac_ct_CXX+set}" = set; then : +if ${ac_cv_prog_ac_ct_CXX+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_CXX"; then @@ -3904,7 +4025,7 @@ IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_CXX="$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 @@ -4055,9 +4176,8 @@ { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -{ as_fn_set_status 77 -as_fn_error "C++ compiler cannot create executables -See \`config.log' for more details." "$LINENO" 5; }; } +as_fn_error 77 "C++ compiler cannot create executables +See \`config.log' for more details" "$LINENO" 5; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } @@ -4099,8 +4219,8 @@ else { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -as_fn_error "cannot compute suffix of executables: cannot compile and link -See \`config.log' for more details." "$LINENO" 5; } +as_fn_error $? "cannot compute suffix of executables: cannot compile and link +See \`config.log' for more details" "$LINENO" 5; } fi rm -f conftest conftest$ac_cv_exeext { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_exeext" >&5 @@ -4157,9 +4277,9 @@ else { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -as_fn_error "cannot run C++ compiled programs. +as_fn_error $? "cannot run C++ compiled programs. If you meant to cross compile, use \`--host'. -See \`config.log' for more details." "$LINENO" 5; } +See \`config.log' for more details" "$LINENO" 5; } fi fi fi @@ -4170,7 +4290,7 @@ ac_clean_files=$ac_clean_files_save { $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of object files" >&5 $as_echo_n "checking for suffix of object files... " >&6; } -if test "${ac_cv_objext+set}" = set; then : +if ${ac_cv_objext+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -4210,8 +4330,8 @@ { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -as_fn_error "cannot compute suffix of object files: cannot compile -See \`config.log' for more details." "$LINENO" 5; } +as_fn_error $? "cannot compute suffix of object files: cannot compile +See \`config.log' for more details" "$LINENO" 5; } fi rm -f conftest.$ac_cv_objext conftest.$ac_ext fi @@ -4221,7 +4341,7 @@ ac_objext=$OBJEXT { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the GNU C++ compiler" >&5 $as_echo_n "checking whether we are using the GNU C++ compiler... " >&6; } -if test "${ac_cv_cxx_compiler_gnu+set}" = set; then : +if ${ac_cv_cxx_compiler_gnu+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -4258,7 +4378,7 @@ ac_save_CXXFLAGS=$CXXFLAGS { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CXX accepts -g" >&5 $as_echo_n "checking whether $CXX accepts -g... " >&6; } -if test "${ac_cv_prog_cxx_g+set}" = set; then : +if ${ac_cv_prog_cxx_g+:} false; then : $as_echo_n "(cached) " >&6 else ac_save_cxx_werror_flag=$ac_cxx_werror_flag @@ -4358,7 +4478,7 @@ _am_result=none # First try GNU make style include. echo "include confinc" > confmf -# Ignore all kinds of additional output from `make'. +# Ignore all kinds of additional output from 'make'. case `$am_make -s -f confmf 2> /dev/null` in #( *the\ am__doit\ target*) am__include=include @@ -4391,6 +4511,7 @@ if test "x$enable_dependency_tracking" != xno; then am_depcomp="$ac_aux_dir/depcomp" AMDEPBACKSLASH='\' + am__nodep='_no' fi if test "x$enable_dependency_tracking" != xno; then AMDEP_TRUE= @@ -4406,15 +4527,16 @@ { $as_echo "$as_me:${as_lineno-$LINENO}: checking dependency style of $depcc" >&5 $as_echo_n "checking dependency style of $depcc... " >&6; } -if test "${am_cv_CXX_dependencies_compiler_type+set}" = set; then : +if ${am_cv_CXX_dependencies_compiler_type+:} false; then : $as_echo_n "(cached) " >&6 else if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then # We make a subdir and do the tests there. Otherwise we can end up # making bogus files that we don't know about and never remove. For # instance it was reported that on HP-UX the gcc test will end up - # making a dummy file named `D' -- because `-MD' means `put the output - # in D'. + # making a dummy file named 'D' -- because '-MD' means "put the output + # in D". + rm -rf conftest.dir mkdir conftest.dir # Copy depcomp to subdir because otherwise we won't find it if we're # using a relative directory. @@ -4448,16 +4570,16 @@ : > sub/conftest.c for i in 1 2 3 4 5 6; do echo '#include "conftst'$i'.h"' >> sub/conftest.c - # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with - # Solaris 8's {/usr,}/bin/sh. - touch sub/conftst$i.h + # Using ": > sub/conftst$i.h" creates only sub/conftst1.h with + # Solaris 10 /bin/sh. + echo '/* dummy */' > sub/conftst$i.h done echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf - # We check with `-c' and `-o' for the sake of the "dashmstdout" + # We check with '-c' and '-o' for the sake of the "dashmstdout" # mode. It turns out that the SunPro C++ compiler does not properly - # handle `-M -o', and we need to detect this. Also, some Intel - # versions had trouble with output in subdirs + # handle '-M -o', and we need to detect this. Also, some Intel + # versions had trouble with output in subdirs. am__obj=sub/conftest.${OBJEXT-o} am__minus_obj="-o $am__obj" case $depmode in @@ -4466,16 +4588,16 @@ test "$am__universal" = false || continue ;; nosideeffect) - # after this tag, mechanisms are not by side-effect, so they'll - # only be used when explicitly requested + # After this tag, mechanisms are not by side-effect, so they'll + # only be used when explicitly requested. if test "x$enable_dependency_tracking" = xyes; then continue else break fi ;; - msvisualcpp | msvcmsys) - # This compiler won't grok `-c -o', but also, the minuso test has + msvc7 | msvc7msys | msvisualcpp | msvcmsys) + # This compiler won't grok '-c -o', but also, the minuso test has # not run yet. These depmodes are late enough in the game, and # so weak that their functioning should not be impacted. am__obj=conftest.${OBJEXT-o} @@ -4539,7 +4661,7 @@ set dummy ${ac_tool_prefix}gcc; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_prog_CC+set}" = set; then : +if ${ac_cv_prog_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$CC"; then @@ -4551,7 +4673,7 @@ IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_CC="${ac_tool_prefix}gcc" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 @@ -4579,7 +4701,7 @@ set dummy gcc; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_prog_ac_ct_CC+set}" = set; then : +if ${ac_cv_prog_ac_ct_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_CC"; then @@ -4591,7 +4713,7 @@ IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_CC="gcc" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 @@ -4632,7 +4754,7 @@ set dummy ${ac_tool_prefix}cc; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_prog_CC+set}" = set; then : +if ${ac_cv_prog_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$CC"; then @@ -4644,7 +4766,7 @@ IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_CC="${ac_tool_prefix}cc" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 @@ -4672,7 +4794,7 @@ set dummy cc; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_prog_CC+set}" = set; then : +if ${ac_cv_prog_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$CC"; then @@ -4685,7 +4807,7 @@ IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then ac_prog_rejected=yes continue @@ -4731,7 +4853,7 @@ set dummy $ac_tool_prefix$ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_prog_CC+set}" = set; then : +if ${ac_cv_prog_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$CC"; then @@ -4743,7 +4865,7 @@ IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_CC="$ac_tool_prefix$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 @@ -4775,7 +4897,7 @@ set dummy $ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_prog_ac_ct_CC+set}" = set; then : +if ${ac_cv_prog_ac_ct_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_CC"; then @@ -4787,7 +4909,7 @@ IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_CC="$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 @@ -4829,8 +4951,8 @@ test -z "$CC" && { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -as_fn_error "no acceptable C compiler found in \$PATH -See \`config.log' for more details." "$LINENO" 5; } +as_fn_error $? "no acceptable C compiler found in \$PATH +See \`config.log' for more details" "$LINENO" 5; } # Provide some information about the compiler. $as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler version" >&5 @@ -4859,7 +4981,7 @@ { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the GNU C compiler" >&5 $as_echo_n "checking whether we are using the GNU C compiler... " >&6; } -if test "${ac_cv_c_compiler_gnu+set}" = set; then : +if ${ac_cv_c_compiler_gnu+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -4896,7 +5018,7 @@ ac_save_CFLAGS=$CFLAGS { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC accepts -g" >&5 $as_echo_n "checking whether $CC accepts -g... " >&6; } -if test "${ac_cv_prog_cc_g+set}" = set; then : +if ${ac_cv_prog_cc_g+:} false; then : $as_echo_n "(cached) " >&6 else ac_save_c_werror_flag=$ac_c_werror_flag @@ -4974,7 +5096,7 @@ fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $CC option to accept ISO C89" >&5 $as_echo_n "checking for $CC option to accept ISO C89... " >&6; } -if test "${ac_cv_prog_cc_c89+set}" = set; then : +if ${ac_cv_prog_cc_c89+:} false; then : $as_echo_n "(cached) " >&6 else ac_cv_prog_cc_c89=no @@ -4983,8 +5105,7 @@ /* end confdefs.h. */ #include #include -#include -#include +struct stat; /* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */ struct buf { int x; }; FILE * (*rcsopen) (struct buf *, struct stat *, int); @@ -5073,15 +5194,16 @@ { $as_echo "$as_me:${as_lineno-$LINENO}: checking dependency style of $depcc" >&5 $as_echo_n "checking dependency style of $depcc... " >&6; } -if test "${am_cv_CC_dependencies_compiler_type+set}" = set; then : +if ${am_cv_CC_dependencies_compiler_type+:} false; then : $as_echo_n "(cached) " >&6 else if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then # We make a subdir and do the tests there. Otherwise we can end up # making bogus files that we don't know about and never remove. For # instance it was reported that on HP-UX the gcc test will end up - # making a dummy file named `D' -- because `-MD' means `put the output - # in D'. + # making a dummy file named 'D' -- because '-MD' means "put the output + # in D". + rm -rf conftest.dir mkdir conftest.dir # Copy depcomp to subdir because otherwise we won't find it if we're # using a relative directory. @@ -5115,16 +5237,16 @@ : > sub/conftest.c for i in 1 2 3 4 5 6; do echo '#include "conftst'$i'.h"' >> sub/conftest.c - # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with - # Solaris 8's {/usr,}/bin/sh. - touch sub/conftst$i.h + # Using ": > sub/conftst$i.h" creates only sub/conftst1.h with + # Solaris 10 /bin/sh. + echo '/* dummy */' > sub/conftst$i.h done echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf - # We check with `-c' and `-o' for the sake of the "dashmstdout" + # We check with '-c' and '-o' for the sake of the "dashmstdout" # mode. It turns out that the SunPro C++ compiler does not properly - # handle `-M -o', and we need to detect this. Also, some Intel - # versions had trouble with output in subdirs + # handle '-M -o', and we need to detect this. Also, some Intel + # versions had trouble with output in subdirs. am__obj=sub/conftest.${OBJEXT-o} am__minus_obj="-o $am__obj" case $depmode in @@ -5133,16 +5255,16 @@ test "$am__universal" = false || continue ;; nosideeffect) - # after this tag, mechanisms are not by side-effect, so they'll - # only be used when explicitly requested + # After this tag, mechanisms are not by side-effect, so they'll + # only be used when explicitly requested. if test "x$enable_dependency_tracking" = xyes; then continue else break fi ;; - msvisualcpp | msvcmsys) - # This compiler won't grok `-c -o', but also, the minuso test has + msvc7 | msvc7msys | msvisualcpp | msvcmsys) + # This compiler won't grok '-c -o', but also, the minuso test has # not run yet. These depmodes are late enough in the game, and # so weak that their functioning should not be impacted. am__obj=conftest.${OBJEXT-o} @@ -5197,98 +5319,6 @@ -if test -n "$ac_tool_prefix"; then - # Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args. -set dummy ${ac_tool_prefix}ranlib; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_prog_RANLIB+set}" = set; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$RANLIB"; then - ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - -fi -fi -RANLIB=$ac_cv_prog_RANLIB -if test -n "$RANLIB"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $RANLIB" >&5 -$as_echo "$RANLIB" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - -fi -if test -z "$ac_cv_prog_RANLIB"; then - ac_ct_RANLIB=$RANLIB - # Extract the first word of "ranlib", so it can be a program name with args. -set dummy ranlib; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_prog_ac_ct_RANLIB+set}" = set; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$ac_ct_RANLIB"; then - ac_cv_prog_ac_ct_RANLIB="$ac_ct_RANLIB" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_prog_ac_ct_RANLIB="ranlib" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - -fi -fi -ac_ct_RANLIB=$ac_cv_prog_ac_ct_RANLIB -if test -n "$ac_ct_RANLIB"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_RANLIB" >&5 -$as_echo "$ac_ct_RANLIB" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - if test "x$ac_ct_RANLIB" = x; then - RANLIB=":" - else - case $cross_compiling:$ac_tool_warned in -yes:) -{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 -$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} -ac_tool_warned=yes ;; -esac - RANLIB=$ac_ct_RANLIB - fi -else - RANLIB="$ac_cv_prog_RANLIB" -fi - ac_ext=c ac_cpp='$CPP $CPPFLAGS' @@ -5302,7 +5332,7 @@ CPP= fi if test -z "$CPP"; then - if test "${ac_cv_prog_CPP+set}" = set; then : + if ${ac_cv_prog_CPP+:} false; then : $as_echo_n "(cached) " >&6 else # Double quotes because CPP needs to be expanded @@ -5332,7 +5362,7 @@ # Broken: fails on valid input. continue fi -rm -f conftest.err conftest.$ac_ext +rm -f conftest.err conftest.i conftest.$ac_ext # OK, works on sane cases. Now check whether nonexistent headers # can be detected and how. @@ -5348,11 +5378,11 @@ ac_preproc_ok=: break fi -rm -f conftest.err conftest.$ac_ext +rm -f conftest.err conftest.i conftest.$ac_ext done # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. -rm -f conftest.err conftest.$ac_ext +rm -f conftest.i conftest.err conftest.$ac_ext if $ac_preproc_ok; then : break fi @@ -5391,7 +5421,7 @@ # Broken: fails on valid input. continue fi -rm -f conftest.err conftest.$ac_ext +rm -f conftest.err conftest.i conftest.$ac_ext # OK, works on sane cases. Now check whether nonexistent headers # can be detected and how. @@ -5407,18 +5437,18 @@ ac_preproc_ok=: break fi -rm -f conftest.err conftest.$ac_ext +rm -f conftest.err conftest.i conftest.$ac_ext done # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. -rm -f conftest.err conftest.$ac_ext +rm -f conftest.i conftest.err conftest.$ac_ext if $ac_preproc_ok; then : else { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -as_fn_error "C preprocessor \"$CPP\" fails sanity check -See \`config.log' for more details." "$LINENO" 5; } +as_fn_error $? "C preprocessor \"$CPP\" fails sanity check +See \`config.log' for more details" "$LINENO" 5; } fi ac_ext=c @@ -5430,7 +5460,7 @@ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for grep that handles long lines and -e" >&5 $as_echo_n "checking for grep that handles long lines and -e... " >&6; } -if test "${ac_cv_path_GREP+set}" = set; then : +if ${ac_cv_path_GREP+:} false; then : $as_echo_n "(cached) " >&6 else if test -z "$GREP"; then @@ -5444,7 +5474,7 @@ for ac_prog in grep ggrep; do for ac_exec_ext in '' $ac_executable_extensions; do ac_path_GREP="$as_dir/$ac_prog$ac_exec_ext" - { test -f "$ac_path_GREP" && $as_test_x "$ac_path_GREP"; } || continue + as_fn_executable_p "$ac_path_GREP" || continue # Check for GNU ac_path_GREP and select it if it is found. # Check for GNU $ac_path_GREP case `"$ac_path_GREP" --version 2>&1` in @@ -5479,7 +5509,7 @@ done IFS=$as_save_IFS if test -z "$ac_cv_path_GREP"; then - as_fn_error "no acceptable grep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 + as_fn_error $? "no acceptable grep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 fi else ac_cv_path_GREP=$GREP @@ -5493,7 +5523,7 @@ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for egrep" >&5 $as_echo_n "checking for egrep... " >&6; } -if test "${ac_cv_path_EGREP+set}" = set; then : +if ${ac_cv_path_EGREP+:} false; then : $as_echo_n "(cached) " >&6 else if echo a | $GREP -E '(a|b)' >/dev/null 2>&1 @@ -5510,7 +5540,7 @@ for ac_prog in egrep; do for ac_exec_ext in '' $ac_executable_extensions; do ac_path_EGREP="$as_dir/$ac_prog$ac_exec_ext" - { test -f "$ac_path_EGREP" && $as_test_x "$ac_path_EGREP"; } || continue + as_fn_executable_p "$ac_path_EGREP" || continue # Check for GNU ac_path_EGREP and select it if it is found. # Check for GNU $ac_path_EGREP case `"$ac_path_EGREP" --version 2>&1` in @@ -5545,7 +5575,7 @@ done IFS=$as_save_IFS if test -z "$ac_cv_path_EGREP"; then - as_fn_error "no acceptable egrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 + as_fn_error $? "no acceptable egrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 fi else ac_cv_path_EGREP=$EGREP @@ -5558,37 +5588,275 @@ EGREP="$ac_cv_path_EGREP" -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for ANSI C header files" >&5 -$as_echo_n "checking for ANSI C header files... " >&6; } -if test "${ac_cv_header_stdc+set}" = set; then : + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Minix Amsterdam compiler" >&5 +$as_echo_n "checking for Minix Amsterdam compiler... " >&6; } +if ${gl_cv_c_amsterdam_compiler+:} false; then : $as_echo_n "(cached) " >&6 else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ -#include -#include -#include -#include -int -main () -{ +#ifdef __ACK__ +Amsterdam +#endif - ; - return 0; -} _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - ac_cv_header_stdc=yes +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP "Amsterdam" >/dev/null 2>&1; then : + gl_cv_c_amsterdam_compiler=yes else - ac_cv_header_stdc=no + gl_cv_c_amsterdam_compiler=no fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f conftest* -if test $ac_cv_header_stdc = yes; then - # SunOS 4.x string.h does not declare mem*, contrary to ANSI. - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_c_amsterdam_compiler" >&5 +$as_echo "$gl_cv_c_amsterdam_compiler" >&6; } + if test -z "$AR"; then + if test $gl_cv_c_amsterdam_compiler = yes; then + AR='cc -c.a' + if test -z "$ARFLAGS"; then + ARFLAGS='-o' + fi + else + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}ar", so it can be a program name with args. +set dummy ${ac_tool_prefix}ar; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_AR+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$AR"; then + ac_cv_prog_AR="$AR" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_AR="${ac_tool_prefix}ar" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +AR=$ac_cv_prog_AR +if test -n "$AR"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AR" >&5 +$as_echo "$AR" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +fi +if test -z "$ac_cv_prog_AR"; then + ac_ct_AR=$AR + # Extract the first word of "ar", so it can be a program name with args. +set dummy ar; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_ac_ct_AR+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_AR"; then + ac_cv_prog_ac_ct_AR="$ac_ct_AR" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_AR="ar" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_AR=$ac_cv_prog_ac_ct_AR +if test -n "$ac_ct_AR"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_AR" >&5 +$as_echo "$ac_ct_AR" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + if test "x$ac_ct_AR" = x; then + AR="ar" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + AR=$ac_ct_AR + fi +else + AR="$ac_cv_prog_AR" +fi + + if test -z "$ARFLAGS"; then + ARFLAGS='cru' + fi + fi + else + if test -z "$ARFLAGS"; then + ARFLAGS='cru' + fi + fi + + + if test -z "$RANLIB"; then + if test $gl_cv_c_amsterdam_compiler = yes; then + RANLIB=':' + else + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args. +set dummy ${ac_tool_prefix}ranlib; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_RANLIB+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$RANLIB"; then + ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +RANLIB=$ac_cv_prog_RANLIB +if test -n "$RANLIB"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $RANLIB" >&5 +$as_echo "$RANLIB" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +fi +if test -z "$ac_cv_prog_RANLIB"; then + ac_ct_RANLIB=$RANLIB + # Extract the first word of "ranlib", so it can be a program name with args. +set dummy ranlib; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_ac_ct_RANLIB+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_RANLIB"; then + ac_cv_prog_ac_ct_RANLIB="$ac_ct_RANLIB" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_RANLIB="ranlib" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_RANLIB=$ac_cv_prog_ac_ct_RANLIB +if test -n "$ac_ct_RANLIB"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_RANLIB" >&5 +$as_echo "$ac_ct_RANLIB" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + if test "x$ac_ct_RANLIB" = x; then + RANLIB=":" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + RANLIB=$ac_ct_RANLIB + fi +else + RANLIB="$ac_cv_prog_RANLIB" +fi + + fi + fi + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for ANSI C header files" >&5 +$as_echo_n "checking for ANSI C header files... " >&6; } +if ${ac_cv_header_stdc+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +#include +#include +#include + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_cv_header_stdc=yes +else + ac_cv_header_stdc=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + +if test $ac_cv_header_stdc = yes; then + # SunOS 4.x string.h does not declare mem*, contrary to ANSI. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ #include _ACEOF @@ -5677,8 +5945,7 @@ as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` ac_fn_c_check_header_compile "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default " -eval as_val=\$$as_ac_Header - if test "x$as_val" = x""yes; then : +if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF @@ -5692,7 +5959,7 @@ ac_fn_c_check_header_mongrel "$LINENO" "minix/config.h" "ac_cv_header_minix_config_h" "$ac_includes_default" -if test "x$ac_cv_header_minix_config_h" = x""yes; then : +if test "x$ac_cv_header_minix_config_h" = xyes; then : MINIX=yes else MINIX= @@ -5722,7 +5989,7 @@ { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether it is safe to define __EXTENSIONS__" >&5 $as_echo_n "checking whether it is safe to define __EXTENSIONS__... " >&6; } -if test "${ac_cv_safe_to_define___extensions__+set}" = set; then : +if ${ac_cv_safe_to_define___extensions__+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -5752,6 +6019,8 @@ $as_echo "#define _ALL_SOURCE 1" >>confdefs.h + $as_echo "#define _DARWIN_C_SOURCE 1" >>confdefs.h + $as_echo "#define _GNU_SOURCE 1" >>confdefs.h $as_echo "#define _POSIX_PTHREAD_SEMANTICS 1" >>confdefs.h @@ -5768,9 +6037,8 @@ # Code from module alloca-opt: - # Code from module arg-nonnull: # Code from module btowc: - # Code from module c++defs: + # Code from module byteswap: # Code from module configmake: # Code from module extensions: @@ -5778,26 +6046,56 @@ # Code from module include_next: # Code from module langinfo: # Code from module localcharset: + # Code from module locale: + # Code from module localeconv: # Code from module malloc-gnu: # Code from module malloc-posix: # Code from module mbrtowc: # Code from module mbsinit: + # Code from module mbtowc: # Code from module multiarch: # Code from module nl_langinfo: # Code from module regex: + # Code from module snippet/_Noreturn: + # Code from module snippet/arg-nonnull: + # Code from module snippet/c++defs: + # Code from module snippet/warn-on-use: # Code from module ssize_t: # Code from module stdbool: # Code from module stddef: # Code from module stdint: # Code from module stdlib: + # Code from module strcase: # Code from module streq: + # Code from module strings: + # Code from module sys_types: # Code from module unistd: # Code from module verify: - # Code from module warn-on-use: # Code from module wchar: # Code from module wcrtomb: - # Code from module wctype: + # Code from module wctype-h: + + +if test "$CC" = "gcc" +then + if true; then + COMPILER_IS_GCC_TRUE= + COMPILER_IS_GCC_FALSE='#' +else + COMPILER_IS_GCC_TRUE='#' + COMPILER_IS_GCC_FALSE= +fi + +else + if false; then + COMPILER_IS_GCC_TRUE= + COMPILER_IS_GCC_FALSE='#' +else + COMPILER_IS_GCC_TRUE='#' + COMPILER_IS_GCC_FALSE= +fi +fi for ac_prog in flex lex do @@ -5805,7 +6103,7 @@ set dummy $ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_prog_LEX+set}" = set; then : +if ${ac_cv_prog_LEX+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$LEX"; then @@ -5817,7 +6115,7 @@ IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_LEX="$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 @@ -5849,7 +6147,8 @@ b { REJECT; } c { yymore (); } d { yyless (1); } -e { yyless (input () != 0); } +e { /* IRIX 6.5 flex 2.5.4 underquotes its yyless argument. */ + yyless ((input () != 0)); } f { unput (yytext[0]); } . { BEGIN INITIAL; } %% @@ -5875,7 +6174,7 @@ test $ac_status = 0; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking lex output file root" >&5 $as_echo_n "checking lex output file root... " >&6; } -if test "${ac_cv_prog_lex_root+set}" = set; then : +if ${ac_cv_prog_lex_root+:} false; then : $as_echo_n "(cached) " >&6 else @@ -5884,7 +6183,7 @@ elif test -f lexyy.c; then ac_cv_prog_lex_root=lexyy else - as_fn_error "cannot find output from $LEX; giving up" "$LINENO" 5 + as_fn_error $? "cannot find output from $LEX; giving up" "$LINENO" 5 fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_lex_root" >&5 @@ -5894,7 +6193,7 @@ if test -z "${LEXLIB+set}"; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking lex library" >&5 $as_echo_n "checking lex library... " >&6; } -if test "${ac_cv_lib_lex+set}" = set; then : +if ${ac_cv_lib_lex+:} false; then : $as_echo_n "(cached) " >&6 else @@ -5924,7 +6223,7 @@ { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether yytext is a pointer" >&5 $as_echo_n "checking whether yytext is a pointer... " >&6; } -if test "${ac_cv_prog_lex_yytext_pointer+set}" = set; then : +if ${ac_cv_prog_lex_yytext_pointer+:} false; then : $as_echo_n "(cached) " >&6 else # POSIX says lex can declare yytext either as a pointer or an array; the @@ -5935,7 +6234,8 @@ LIBS="$LEXLIB $ac_save_LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ -#define YYTEXT_POINTER 1 + + #define YYTEXT_POINTER 1 `cat $LEX_OUTPUT_ROOT.c` _ACEOF if ac_fn_c_try_link "$LINENO"; then : @@ -5975,7 +6275,7 @@ $as_echo_n "checking whether ${MAKE-make} sets \$(MAKE)... " >&6; } set x ${MAKE-make} ac_make=`$as_echo "$2" | sed 's/+/p/g; s/[^a-zA-Z0-9_]/_/g'` -if { as_var=ac_cv_prog_make_${ac_make}_set; eval "test \"\${$as_var+set}\" = set"; }; then : +if eval \${ac_cv_prog_make_${ac_make}_set+:} false; then : $as_echo_n "(cached) " >&6 else cat >conftest.make <<\_ACEOF @@ -5983,7 +6283,7 @@ all: @echo '@@@%%%=$(MAKE)=@@@%%%' _ACEOF -# GNU make sometimes prints "make[1]: Entering...", which would confuse us. +# GNU make sometimes prints "make[1]: Entering ...", which would confuse us. case `${MAKE-make} -f conftest.make 2>/dev/null` in *@@@%%%=?*=@@@%%%*) eval ac_cv_prog_make_${ac_make}_set=yes;; @@ -6010,8 +6310,8 @@ -macro_version='2.2.6b' -macro_revision='1.3017' +macro_version='2.4.2' +macro_revision='1.3337' @@ -6027,21 +6327,90 @@ ltmain="$ac_aux_dir/ltmain.sh" -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for a sed that does not truncate output" >&5 -$as_echo_n "checking for a sed that does not truncate output... " >&6; } -if test "${ac_cv_path_SED+set}" = set; then : - $as_echo_n "(cached) " >&6 -else - ac_script=s/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb/ - for ac_i in 1 2 3 4 5 6 7; do - ac_script="$ac_script$as_nl$ac_script" - done - echo "$ac_script" 2>/dev/null | sed 99q >conftest.sed - { ac_script=; unset ac_script;} - if test -z "$SED"; then - ac_path_SED_found=false - # Loop through the user's path and test for each of PROGNAME-LIST - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +# Backslashify metacharacters that are still active within +# double-quoted strings. +sed_quote_subst='s/\(["`$\\]\)/\\\1/g' + +# Same as above, but do not quote variable references. +double_quote_subst='s/\(["`\\]\)/\\\1/g' + +# Sed substitution to delay expansion of an escaped shell variable in a +# double_quote_subst'ed string. +delay_variable_subst='s/\\\\\\\\\\\$/\\\\\\$/g' + +# Sed substitution to delay expansion of an escaped single quote. +delay_single_quote_subst='s/'\''/'\'\\\\\\\'\''/g' + +# Sed substitution to avoid accidental globbing in evaled expressions +no_glob_subst='s/\*/\\\*/g' + +ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' +ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO +ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO$ECHO + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to print strings" >&5 +$as_echo_n "checking how to print strings... " >&6; } +# Test print first, because it will be a builtin if present. +if test "X`( print -r -- -n ) 2>/dev/null`" = X-n && \ + test "X`print -r -- $ECHO 2>/dev/null`" = "X$ECHO"; then + ECHO='print -r --' +elif test "X`printf %s $ECHO 2>/dev/null`" = "X$ECHO"; then + ECHO='printf %s\n' +else + # Use this function as a fallback that always works. + func_fallback_echo () + { + eval 'cat <<_LTECHO_EOF +$1 +_LTECHO_EOF' + } + ECHO='func_fallback_echo' +fi + +# func_echo_all arg... +# Invoke $ECHO with all args, space-separated. +func_echo_all () +{ + $ECHO "" +} + +case "$ECHO" in + printf*) { $as_echo "$as_me:${as_lineno-$LINENO}: result: printf" >&5 +$as_echo "printf" >&6; } ;; + print*) { $as_echo "$as_me:${as_lineno-$LINENO}: result: print -r" >&5 +$as_echo "print -r" >&6; } ;; + *) { $as_echo "$as_me:${as_lineno-$LINENO}: result: cat" >&5 +$as_echo "cat" >&6; } ;; +esac + + + + + + + + + + + + + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for a sed that does not truncate output" >&5 +$as_echo_n "checking for a sed that does not truncate output... " >&6; } +if ${ac_cv_path_SED+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_script=s/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb/ + for ac_i in 1 2 3 4 5 6 7; do + ac_script="$ac_script$as_nl$ac_script" + done + echo "$ac_script" 2>/dev/null | sed 99q >conftest.sed + { ac_script=; unset ac_script;} + if test -z "$SED"; then + ac_path_SED_found=false + # Loop through the user's path and test for each of PROGNAME-LIST + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS @@ -6049,7 +6418,7 @@ for ac_prog in sed gsed; do for ac_exec_ext in '' $ac_executable_extensions; do ac_path_SED="$as_dir/$ac_prog$ac_exec_ext" - { test -f "$ac_path_SED" && $as_test_x "$ac_path_SED"; } || continue + as_fn_executable_p "$ac_path_SED" || continue # Check for GNU ac_path_SED and select it if it is found. # Check for GNU $ac_path_SED case `"$ac_path_SED" --version 2>&1` in @@ -6084,7 +6453,7 @@ done IFS=$as_save_IFS if test -z "$ac_cv_path_SED"; then - as_fn_error "no acceptable sed could be found in \$PATH" "$LINENO" 5 + as_fn_error $? "no acceptable sed could be found in \$PATH" "$LINENO" 5 fi else ac_cv_path_SED=$SED @@ -6111,7 +6480,7 @@ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for fgrep" >&5 $as_echo_n "checking for fgrep... " >&6; } -if test "${ac_cv_path_FGREP+set}" = set; then : +if ${ac_cv_path_FGREP+:} false; then : $as_echo_n "(cached) " >&6 else if echo 'ab*c' | $GREP -F 'ab*c' >/dev/null 2>&1 @@ -6128,7 +6497,7 @@ for ac_prog in fgrep; do for ac_exec_ext in '' $ac_executable_extensions; do ac_path_FGREP="$as_dir/$ac_prog$ac_exec_ext" - { test -f "$ac_path_FGREP" && $as_test_x "$ac_path_FGREP"; } || continue + as_fn_executable_p "$ac_path_FGREP" || continue # Check for GNU ac_path_FGREP and select it if it is found. # Check for GNU $ac_path_FGREP case `"$ac_path_FGREP" --version 2>&1` in @@ -6163,7 +6532,7 @@ done IFS=$as_save_IFS if test -z "$ac_cv_path_FGREP"; then - as_fn_error "no acceptable fgrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 + as_fn_error $? "no acceptable fgrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 fi else ac_cv_path_FGREP=$FGREP @@ -6242,7 +6611,7 @@ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for non-GNU ld" >&5 $as_echo_n "checking for non-GNU ld... " >&6; } fi -if test "${lt_cv_path_LD+set}" = set; then : +if ${lt_cv_path_LD+:} false; then : $as_echo_n "(cached) " >&6 else if test -z "$LD"; then @@ -6279,10 +6648,10 @@ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi -test -z "$LD" && as_fn_error "no acceptable ld found in \$PATH" "$LINENO" 5 +test -z "$LD" && as_fn_error $? "no acceptable ld found in \$PATH" "$LINENO" 5 { $as_echo "$as_me:${as_lineno-$LINENO}: checking if the linker ($LD) is GNU ld" >&5 $as_echo_n "checking if the linker ($LD) is GNU ld... " >&6; } -if test "${lt_cv_prog_gnu_ld+set}" = set; then : +if ${lt_cv_prog_gnu_ld+:} false; then : $as_echo_n "(cached) " >&6 else # I'd rather use --version here, but apparently some GNU lds only accept -v. @@ -6309,7 +6678,7 @@ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for BSD- or MS-compatible name lister (nm)" >&5 $as_echo_n "checking for BSD- or MS-compatible name lister (nm)... " >&6; } -if test "${lt_cv_path_NM+set}" = set; then : +if ${lt_cv_path_NM+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$NM"; then @@ -6362,14 +6731,17 @@ NM="$lt_cv_path_NM" else # Didn't find any BSD compatible name lister, look for dumpbin. - if test -n "$ac_tool_prefix"; then - for ac_prog in "dumpbin -symbols" "link -dump -symbols" + if test -n "$DUMPBIN"; then : + # Let the user override the test. + else + if test -n "$ac_tool_prefix"; then + for ac_prog in dumpbin "link -dump" do # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. set dummy $ac_tool_prefix$ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_prog_DUMPBIN+set}" = set; then : +if ${ac_cv_prog_DUMPBIN+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$DUMPBIN"; then @@ -6381,7 +6753,7 @@ IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_DUMPBIN="$ac_tool_prefix$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 @@ -6407,13 +6779,13 @@ fi if test -z "$DUMPBIN"; then ac_ct_DUMPBIN=$DUMPBIN - for ac_prog in "dumpbin -symbols" "link -dump -symbols" + for ac_prog in dumpbin "link -dump" do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_prog_ac_ct_DUMPBIN+set}" = set; then : +if ${ac_cv_prog_ac_ct_DUMPBIN+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_DUMPBIN"; then @@ -6425,7 +6797,7 @@ IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_DUMPBIN="$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 @@ -6462,6 +6834,15 @@ fi fi + case `$DUMPBIN -symbols /dev/null 2>&1 | sed '1q'` in + *COFF*) + DUMPBIN="$DUMPBIN -symbols" + ;; + *) + DUMPBIN=: + ;; + esac + fi if test "$DUMPBIN" != ":"; then NM="$DUMPBIN" @@ -6476,18 +6857,18 @@ { $as_echo "$as_me:${as_lineno-$LINENO}: checking the name lister ($NM) interface" >&5 $as_echo_n "checking the name lister ($NM) interface... " >&6; } -if test "${lt_cv_nm_interface+set}" = set; then : +if ${lt_cv_nm_interface+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_nm_interface="BSD nm" echo "int some_variable = 0;" > conftest.$ac_ext - (eval echo "\"\$as_me:6484: $ac_compile\"" >&5) + (eval echo "\"\$as_me:$LINENO: $ac_compile\"" >&5) (eval "$ac_compile" 2>conftest.err) cat conftest.err >&5 - (eval echo "\"\$as_me:6487: $NM \\\"conftest.$ac_objext\\\"\"" >&5) + (eval echo "\"\$as_me:$LINENO: $NM \\\"conftest.$ac_objext\\\"\"" >&5) (eval "$NM \"conftest.$ac_objext\"" 2>conftest.err > conftest.out) cat conftest.err >&5 - (eval echo "\"\$as_me:6490: output\"" >&5) + (eval echo "\"\$as_me:$LINENO: output\"" >&5) cat conftest.out >&5 if $GREP 'External.*some_variable' conftest.out > /dev/null; then lt_cv_nm_interface="MS dumpbin" @@ -6500,7 +6881,7 @@ # find the maximum length of command line arguments { $as_echo "$as_me:${as_lineno-$LINENO}: checking the maximum length of command line arguments" >&5 $as_echo_n "checking the maximum length of command line arguments... " >&6; } -if test "${lt_cv_sys_max_cmd_len+set}" = set; then : +if ${lt_cv_sys_max_cmd_len+:} false; then : $as_echo_n "(cached) " >&6 else i=0 @@ -6533,6 +6914,11 @@ lt_cv_sys_max_cmd_len=8192; ;; + mint*) + # On MiNT this can take a long time and run out of memory. + lt_cv_sys_max_cmd_len=8192; + ;; + amigaos*) # On AmigaOS with pdksh, this test takes hours, literally. # So we just punt and use a minimum line length of 8192. @@ -6558,6 +6944,11 @@ lt_cv_sys_max_cmd_len=196608 ;; + os2*) + # The test takes a long time on OS/2. + lt_cv_sys_max_cmd_len=8192 + ;; + osf*) # Dr. Hans Ekkehard Plesser reports seeing a kernel panic running configure # due to this test when exec_disable_arg_limit is 1 on Tru64. It is not @@ -6597,8 +6988,8 @@ # If test is not a shell built-in, we'll probably end up computing a # maximum length that is only half of the actual maximum length, but # we can't tell. - while { test "X"`$SHELL $0 --fallback-echo "X$teststring$teststring" 2>/dev/null` \ - = "XX$teststring$teststring"; } >/dev/null 2>&1 && + while { test "X"`env echo "$teststring$teststring" 2>/dev/null` \ + = "X$teststring$teststring"; } >/dev/null 2>&1 && test $i != 17 # 1/2 MB should be enough do i=`expr $i + 1` @@ -6640,8 +7031,8 @@ # Try some XSI features xsi_shell=no ( _lt_dummy="a/b/c" - test "${_lt_dummy##*/},${_lt_dummy%/*},"${_lt_dummy%"$_lt_dummy"}, \ - = c,a/b,, \ + test "${_lt_dummy##*/},${_lt_dummy%/*},${_lt_dummy#??}"${_lt_dummy%"$_lt_dummy"}, \ + = c,a/b,b/c, \ && eval 'test $(( 1 + 1 )) -eq 2 \ && test "${#_lt_dummy}" -eq 5' ) >/dev/null 2>&1 \ && xsi_shell=yes @@ -6690,9 +7081,83 @@ +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to convert $build file names to $host format" >&5 +$as_echo_n "checking how to convert $build file names to $host format... " >&6; } +if ${lt_cv_to_host_file_cmd+:} false; then : + $as_echo_n "(cached) " >&6 +else + case $host in + *-*-mingw* ) + case $build in + *-*-mingw* ) # actually msys + lt_cv_to_host_file_cmd=func_convert_file_msys_to_w32 + ;; + *-*-cygwin* ) + lt_cv_to_host_file_cmd=func_convert_file_cygwin_to_w32 + ;; + * ) # otherwise, assume *nix + lt_cv_to_host_file_cmd=func_convert_file_nix_to_w32 + ;; + esac + ;; + *-*-cygwin* ) + case $build in + *-*-mingw* ) # actually msys + lt_cv_to_host_file_cmd=func_convert_file_msys_to_cygwin + ;; + *-*-cygwin* ) + lt_cv_to_host_file_cmd=func_convert_file_noop + ;; + * ) # otherwise, assume *nix + lt_cv_to_host_file_cmd=func_convert_file_nix_to_cygwin + ;; + esac + ;; + * ) # unhandled hosts (and "normal" native builds) + lt_cv_to_host_file_cmd=func_convert_file_noop + ;; +esac + +fi + +to_host_file_cmd=$lt_cv_to_host_file_cmd +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_to_host_file_cmd" >&5 +$as_echo "$lt_cv_to_host_file_cmd" >&6; } + + + + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to convert $build file names to toolchain format" >&5 +$as_echo_n "checking how to convert $build file names to toolchain format... " >&6; } +if ${lt_cv_to_tool_file_cmd+:} false; then : + $as_echo_n "(cached) " >&6 +else + #assume ordinary cross tools, or native build. +lt_cv_to_tool_file_cmd=func_convert_file_noop +case $host in + *-*-mingw* ) + case $build in + *-*-mingw* ) # actually msys + lt_cv_to_tool_file_cmd=func_convert_file_msys_to_w32 + ;; + esac + ;; +esac + +fi + +to_tool_file_cmd=$lt_cv_to_tool_file_cmd +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_to_tool_file_cmd" >&5 +$as_echo "$lt_cv_to_tool_file_cmd" >&6; } + + + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $LD option to reload object files" >&5 $as_echo_n "checking for $LD option to reload object files... " >&6; } -if test "${lt_cv_ld_reload_flag+set}" = set; then : +if ${lt_cv_ld_reload_flag+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_ld_reload_flag='-r' @@ -6706,6 +7171,11 @@ esac reload_cmds='$LD$reload_flag -o $output$reload_objs' case $host_os in + cygwin* | mingw* | pw32* | cegcc*) + if test "$GCC" != yes; then + reload_cmds=false + fi + ;; darwin*) if test "$GCC" = yes; then reload_cmds='$LTCC $LTCFLAGS -nostdlib ${wl}-r -o $output$reload_objs' @@ -6728,7 +7198,7 @@ set dummy ${ac_tool_prefix}objdump; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_prog_OBJDUMP+set}" = set; then : +if ${ac_cv_prog_OBJDUMP+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$OBJDUMP"; then @@ -6740,7 +7210,7 @@ IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_OBJDUMP="${ac_tool_prefix}objdump" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 @@ -6768,7 +7238,7 @@ set dummy objdump; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_prog_ac_ct_OBJDUMP+set}" = set; then : +if ${ac_cv_prog_ac_ct_OBJDUMP+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_OBJDUMP"; then @@ -6780,7 +7250,7 @@ IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_OBJDUMP="objdump" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 @@ -6827,7 +7297,7 @@ { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to recognize dependent libraries" >&5 $as_echo_n "checking how to recognize dependent libraries... " >&6; } -if test "${lt_cv_deplibs_check_method+set}" = set; then : +if ${lt_cv_deplibs_check_method+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_file_magic_cmd='$MAGIC_CMD' @@ -6869,16 +7339,18 @@ # Base MSYS/MinGW do not provide the 'file' command needed by # func_win32_libid shell function, so use a weaker test based on 'objdump', # unless we find 'file', for example because we are cross-compiling. - if ( file / ) >/dev/null 2>&1; then + # func_win32_libid assumes BSD nm, so disallow it if using MS dumpbin. + if ( test "$lt_cv_nm_interface" = "BSD nm" && file / ) >/dev/null 2>&1; then lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL' lt_cv_file_magic_cmd='func_win32_libid' else - lt_cv_deplibs_check_method='file_magic file format pei*-i386(.*architecture: i386)?' + # Keep this pattern in sync with the one in func_win32_libid. + lt_cv_deplibs_check_method='file_magic file format (pei*-i386(.*architecture: i386)?|pe-arm-wince|pe-x86-64)' lt_cv_file_magic_cmd='$OBJDUMP -f' fi ;; -cegcc) +cegcc*) # use the weaker test based on 'objdump'. See mingw*. lt_cv_deplibs_check_method='file_magic file format pe-arm-.*little(.*architecture: arm)?' lt_cv_file_magic_cmd='$OBJDUMP -f' @@ -6908,6 +7380,10 @@ lt_cv_deplibs_check_method=pass_all ;; +haiku*) + lt_cv_deplibs_check_method=pass_all + ;; + hpux10.20* | hpux11*) lt_cv_file_magic_cmd=/usr/bin/file case $host_cpu in @@ -6916,11 +7392,11 @@ lt_cv_file_magic_test_file=/usr/lib/hpux32/libc.so ;; hppa*64*) - lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF-[0-9][0-9]) shared object file - PA-RISC [0-9].[0-9]' + lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF[ -][0-9][0-9])(-bit)?( [LM]SB)? shared object( file)?[, -]* PA-RISC [0-9]\.[0-9]' lt_cv_file_magic_test_file=/usr/lib/pa20_64/libc.sl ;; *) - lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|PA-RISC[0-9].[0-9]) shared library' + lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|PA-RISC[0-9]\.[0-9]) shared library' lt_cv_file_magic_test_file=/usr/lib/libc.sl ;; esac @@ -6941,8 +7417,8 @@ lt_cv_deplibs_check_method=pass_all ;; -# This must be Linux ELF. -linux* | k*bsd*-gnu) +# This must be glibc/ELF. +linux* | k*bsd*-gnu | kopensolaris*-gnu) lt_cv_deplibs_check_method=pass_all ;; @@ -7023,6 +7499,21 @@ fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_deplibs_check_method" >&5 $as_echo "$lt_cv_deplibs_check_method" >&6; } + +file_magic_glob= +want_nocaseglob=no +if test "$build" = "$host"; then + case $host_os in + mingw* | pw32*) + if ( shopt | grep nocaseglob ) >/dev/null 2>&1; then + want_nocaseglob=yes + else + file_magic_glob=`echo aAbBcCdDeEfFgGhHiIjJkKlLmMnNoOpPqQrRsStTuUvVwWxXyYzZ | $SED -e "s/\(..\)/s\/[\1]\/[\1]\/g;/g"` + fi + ;; + esac +fi + file_magic_cmd=$lt_cv_file_magic_cmd deplibs_check_method=$lt_cv_deplibs_check_method test -z "$deplibs_check_method" && deplibs_check_method=unknown @@ -7038,16 +7529,26 @@ + + + + + + + + + + if test -n "$ac_tool_prefix"; then - # Extract the first word of "${ac_tool_prefix}ar", so it can be a program name with args. -set dummy ${ac_tool_prefix}ar; ac_word=$2 + # Extract the first word of "${ac_tool_prefix}dlltool", so it can be a program name with args. +set dummy ${ac_tool_prefix}dlltool; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_prog_AR+set}" = set; then : +if ${ac_cv_prog_DLLTOOL+:} false; then : $as_echo_n "(cached) " >&6 else - if test -n "$AR"; then - ac_cv_prog_AR="$AR" # Let the user override the test. + if test -n "$DLLTOOL"; then + ac_cv_prog_DLLTOOL="$DLLTOOL" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH @@ -7055,8 +7556,8 @@ IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_prog_AR="${ac_tool_prefix}ar" + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_DLLTOOL="${ac_tool_prefix}dlltool" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi @@ -7066,10 +7567,10 @@ fi fi -AR=$ac_cv_prog_AR -if test -n "$AR"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AR" >&5 -$as_echo "$AR" >&6; } +DLLTOOL=$ac_cv_prog_DLLTOOL +if test -n "$DLLTOOL"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DLLTOOL" >&5 +$as_echo "$DLLTOOL" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } @@ -7077,17 +7578,17 @@ fi -if test -z "$ac_cv_prog_AR"; then - ac_ct_AR=$AR - # Extract the first word of "ar", so it can be a program name with args. -set dummy ar; ac_word=$2 +if test -z "$ac_cv_prog_DLLTOOL"; then + ac_ct_DLLTOOL=$DLLTOOL + # Extract the first word of "dlltool", so it can be a program name with args. +set dummy dlltool; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_prog_ac_ct_AR+set}" = set; then : +if ${ac_cv_prog_ac_ct_DLLTOOL+:} false; then : $as_echo_n "(cached) " >&6 else - if test -n "$ac_ct_AR"; then - ac_cv_prog_ac_ct_AR="$ac_ct_AR" # Let the user override the test. + if test -n "$ac_ct_DLLTOOL"; then + ac_cv_prog_ac_ct_DLLTOOL="$ac_ct_DLLTOOL" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH @@ -7095,8 +7596,8 @@ IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_prog_ac_ct_AR="ar" + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_DLLTOOL="dlltool" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi @@ -7106,17 +7607,17 @@ fi fi -ac_ct_AR=$ac_cv_prog_ac_ct_AR -if test -n "$ac_ct_AR"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_AR" >&5 -$as_echo "$ac_ct_AR" >&6; } +ac_ct_DLLTOOL=$ac_cv_prog_ac_ct_DLLTOOL +if test -n "$ac_ct_DLLTOOL"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_DLLTOOL" >&5 +$as_echo "$ac_ct_DLLTOOL" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi - if test "x$ac_ct_AR" = x; then - AR="false" + if test "x$ac_ct_DLLTOOL" = x; then + DLLTOOL="false" else case $cross_compiling:$ac_tool_warned in yes:) @@ -7124,18 +7625,54 @@ $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac - AR=$ac_ct_AR + DLLTOOL=$ac_ct_DLLTOOL fi else - AR="$ac_cv_prog_AR" + DLLTOOL="$ac_cv_prog_DLLTOOL" fi -test -z "$AR" && AR=ar -test -z "$AR_FLAGS" && AR_FLAGS=cru +test -z "$DLLTOOL" && DLLTOOL=dlltool + + + + + + + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to associate runtime and link libraries" >&5 +$as_echo_n "checking how to associate runtime and link libraries... " >&6; } +if ${lt_cv_sharedlib_from_linklib_cmd+:} false; then : + $as_echo_n "(cached) " >&6 +else + lt_cv_sharedlib_from_linklib_cmd='unknown' +case $host_os in +cygwin* | mingw* | pw32* | cegcc*) + # two different shell functions defined in ltmain.sh + # decide which to use based on capabilities of $DLLTOOL + case `$DLLTOOL --help 2>&1` in + *--identify-strict*) + lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib + ;; + *) + lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib_fallback + ;; + esac + ;; +*) + # fallback: assume linklib IS sharedlib + lt_cv_sharedlib_from_linklib_cmd="$ECHO" + ;; +esac +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_sharedlib_from_linklib_cmd" >&5 +$as_echo "$lt_cv_sharedlib_from_linklib_cmd" >&6; } +sharedlib_from_linklib_cmd=$lt_cv_sharedlib_from_linklib_cmd +test -z "$sharedlib_from_linklib_cmd" && sharedlib_from_linklib_cmd=$ECHO @@ -7144,15 +7681,17 @@ if test -n "$ac_tool_prefix"; then - # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args. -set dummy ${ac_tool_prefix}strip; ac_word=$2 + for ac_prog in ar + do + # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. +set dummy $ac_tool_prefix$ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_prog_STRIP+set}" = set; then : +if ${ac_cv_prog_AR+:} false; then : $as_echo_n "(cached) " >&6 else - if test -n "$STRIP"; then - ac_cv_prog_STRIP="$STRIP" # Let the user override the test. + if test -n "$AR"; then + ac_cv_prog_AR="$AR" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH @@ -7160,8 +7699,8 @@ IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_prog_STRIP="${ac_tool_prefix}strip" + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_AR="$ac_tool_prefix$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi @@ -7171,28 +7710,32 @@ fi fi -STRIP=$ac_cv_prog_STRIP -if test -n "$STRIP"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $STRIP" >&5 -$as_echo "$STRIP" >&6; } +AR=$ac_cv_prog_AR +if test -n "$AR"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AR" >&5 +$as_echo "$AR" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi + test -n "$AR" && break + done fi -if test -z "$ac_cv_prog_STRIP"; then - ac_ct_STRIP=$STRIP - # Extract the first word of "strip", so it can be a program name with args. -set dummy strip; ac_word=$2 +if test -z "$AR"; then + ac_ct_AR=$AR + for ac_prog in ar +do + # Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_prog_ac_ct_STRIP+set}" = set; then : +if ${ac_cv_prog_ac_ct_AR+:} false; then : $as_echo_n "(cached) " >&6 else - if test -n "$ac_ct_STRIP"; then - ac_cv_prog_ac_ct_STRIP="$ac_ct_STRIP" # Let the user override the test. + if test -n "$ac_ct_AR"; then + ac_cv_prog_ac_ct_AR="$ac_ct_AR" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH @@ -7200,8 +7743,8 @@ IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_prog_ac_ct_STRIP="strip" + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_AR="$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi @@ -7211,17 +7754,21 @@ fi fi -ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP -if test -n "$ac_ct_STRIP"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_STRIP" >&5 -$as_echo "$ac_ct_STRIP" >&6; } +ac_ct_AR=$ac_cv_prog_ac_ct_AR +if test -n "$ac_ct_AR"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_AR" >&5 +$as_echo "$ac_ct_AR" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi - if test "x$ac_ct_STRIP" = x; then - STRIP=":" + + test -n "$ac_ct_AR" && break +done + + if test "x$ac_ct_AR" = x; then + AR="false" else case $cross_compiling:$ac_tool_warned in yes:) @@ -7229,48 +7776,209 @@ $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac - STRIP=$ac_ct_STRIP + AR=$ac_ct_AR fi -else - STRIP="$ac_cv_prog_STRIP" fi -test -z "$STRIP" && STRIP=: +: ${AR=ar} +: ${AR_FLAGS=cru} -if test -n "$ac_tool_prefix"; then - # Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args. -set dummy ${ac_tool_prefix}ranlib; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_prog_RANLIB+set}" = set; then : + + + + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for archiver @FILE support" >&5 +$as_echo_n "checking for archiver @FILE support... " >&6; } +if ${lt_cv_ar_at_file+:} false; then : $as_echo_n "(cached) " >&6 else - if test -n "$RANLIB"; then - ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS + lt_cv_ar_at_file=no + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ -fi -fi -RANLIB=$ac_cv_prog_RANLIB +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + echo conftest.$ac_objext > conftest.lst + lt_ar_try='$AR $AR_FLAGS libconftest.a @conftest.lst >&5' + { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$lt_ar_try\""; } >&5 + (eval $lt_ar_try) 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } + if test "$ac_status" -eq 0; then + # Ensure the archiver fails upon bogus file names. + rm -f conftest.$ac_objext libconftest.a + { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$lt_ar_try\""; } >&5 + (eval $lt_ar_try) 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } + if test "$ac_status" -ne 0; then + lt_cv_ar_at_file=@ + fi + fi + rm -f conftest.* libconftest.a + +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ar_at_file" >&5 +$as_echo "$lt_cv_ar_at_file" >&6; } + +if test "x$lt_cv_ar_at_file" = xno; then + archiver_list_spec= +else + archiver_list_spec=$lt_cv_ar_at_file +fi + + + + + + + +if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args. +set dummy ${ac_tool_prefix}strip; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_STRIP+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$STRIP"; then + ac_cv_prog_STRIP="$STRIP" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_STRIP="${ac_tool_prefix}strip" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +STRIP=$ac_cv_prog_STRIP +if test -n "$STRIP"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $STRIP" >&5 +$as_echo "$STRIP" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +fi +if test -z "$ac_cv_prog_STRIP"; then + ac_ct_STRIP=$STRIP + # Extract the first word of "strip", so it can be a program name with args. +set dummy strip; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_ac_ct_STRIP+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_STRIP"; then + ac_cv_prog_ac_ct_STRIP="$ac_ct_STRIP" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_STRIP="strip" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP +if test -n "$ac_ct_STRIP"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_STRIP" >&5 +$as_echo "$ac_ct_STRIP" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + if test "x$ac_ct_STRIP" = x; then + STRIP=":" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + STRIP=$ac_ct_STRIP + fi +else + STRIP="$ac_cv_prog_STRIP" +fi + +test -z "$STRIP" && STRIP=: + + + + + + +if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args. +set dummy ${ac_tool_prefix}ranlib; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_RANLIB+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$RANLIB"; then + ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +RANLIB=$ac_cv_prog_RANLIB if test -n "$RANLIB"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $RANLIB" >&5 $as_echo "$RANLIB" >&6; } @@ -7287,7 +7995,7 @@ set dummy ranlib; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_prog_ac_ct_RANLIB+set}" = set; then : +if ${ac_cv_prog_ac_ct_RANLIB+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_RANLIB"; then @@ -7299,7 +8007,7 @@ IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_RANLIB="ranlib" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 @@ -7349,15 +8057,27 @@ if test -n "$RANLIB"; then case $host_os in openbsd*) - old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB -t \$oldlib" + old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB -t \$tool_oldlib" ;; *) - old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB \$oldlib" + old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB \$tool_oldlib" ;; esac - old_archive_cmds="$old_archive_cmds~\$RANLIB \$oldlib" + old_archive_cmds="$old_archive_cmds~\$RANLIB \$tool_oldlib" fi +case $host_os in + darwin*) + lock_old_archive_extraction=yes ;; + *) + lock_old_archive_extraction=no ;; +esac + + + + + + @@ -7404,7 +8124,7 @@ # Check for command to grab the raw symbol name followed by C symbol from nm. { $as_echo "$as_me:${as_lineno-$LINENO}: checking command to parse $NM output from $compiler object" >&5 $as_echo_n "checking command to parse $NM output from $compiler object... " >&6; } -if test "${lt_cv_sys_global_symbol_pipe+set}" = set; then : +if ${lt_cv_sys_global_symbol_pipe+:} false; then : $as_echo_n "(cached) " >&6 else @@ -7465,8 +8185,8 @@ lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'" # Transform an extracted symbol line into symbol name and symbol address -lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([^ ]*\) $/ {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([^ ]*\) \([^ ]*\)$/ {\"\2\", (void *) \&\2},/p'" -lt_cv_sys_global_symbol_to_c_name_address_lib_prefix="sed -n -e 's/^: \([^ ]*\) $/ {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([^ ]*\) \(lib[^ ]*\)$/ {\"\2\", (void *) \&\2},/p' -e 's/^$symcode* \([^ ]*\) \([^ ]*\)$/ {\"lib\2\", (void *) \&\2},/p'" +lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([^ ]*\)[ ]*$/ {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([^ ]*\) \([^ ]*\)$/ {\"\2\", (void *) \&\2},/p'" +lt_cv_sys_global_symbol_to_c_name_address_lib_prefix="sed -n -e 's/^: \([^ ]*\)[ ]*$/ {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([^ ]*\) \(lib[^ ]*\)$/ {\"\2\", (void *) \&\2},/p' -e 's/^$symcode* \([^ ]*\) \([^ ]*\)$/ {\"lib\2\", (void *) \&\2},/p'" # Handle CRLF in mingw tool chain opt_cr= @@ -7490,6 +8210,7 @@ # which start with @ or ?. lt_cv_sys_global_symbol_pipe="$AWK '"\ " {last_section=section; section=\$ 3};"\ +" /^COFF SYMBOL TABLE/{for(i in hide) delete hide[i]};"\ " /Section length .*#relocs.*(pick any)/{hide[last_section]=1};"\ " \$ 0!~/External *\|/{next};"\ " / 0+ UNDEF /{next}; / UNDEF \([^|]\)*()/{next};"\ @@ -7502,6 +8223,7 @@ else lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[ ]\($symcode$symcode*\)[ ][ ]*$ac_symprfx$sympat$opt_cr$/$symxfrm/p'" fi + lt_cv_sys_global_symbol_pipe="$lt_cv_sys_global_symbol_pipe | sed '/ __gnu_lto/d'" # Check to see that the pipe works correctly. pipe_works=no @@ -7527,8 +8249,8 @@ test $ac_status = 0; }; then # Now try to grab the symbols. nlist=conftest.nm - if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$NM conftest.$ac_objext \| $lt_cv_sys_global_symbol_pipe \> $nlist\""; } >&5 - (eval $NM conftest.$ac_objext \| $lt_cv_sys_global_symbol_pipe \> $nlist) 2>&5 + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$NM conftest.$ac_objext \| "$lt_cv_sys_global_symbol_pipe" \> $nlist\""; } >&5 + (eval $NM conftest.$ac_objext \| "$lt_cv_sys_global_symbol_pipe" \> $nlist) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && test -s "$nlist"; then @@ -7543,6 +8265,18 @@ if $GREP ' nm_test_var$' "$nlist" >/dev/null; then if $GREP ' nm_test_func$' "$nlist" >/dev/null; then cat <<_LT_EOF > conftest.$ac_ext +/* Keep this code in sync between libtool.m4, ltmain, lt_system.h, and tests. */ +#if defined(_WIN32) || defined(__CYGWIN__) || defined(_WIN32_WCE) +/* DATA imports from DLLs on WIN32 con't be const, because runtime + relocations are performed -- see ld's documentation on pseudo-relocs. */ +# define LT_DLSYM_CONST +#elif defined(__osf__) +/* This system does not cope well with relocations in const data. */ +# define LT_DLSYM_CONST +#else +# define LT_DLSYM_CONST const +#endif + #ifdef __cplusplus extern "C" { #endif @@ -7554,7 +8288,7 @@ cat <<_LT_EOF >> conftest.$ac_ext /* The mapping between symbol names and symbols. */ -const struct { +LT_DLSYM_CONST struct { const char *name; void *address; } @@ -7580,8 +8314,8 @@ _LT_EOF # Now try linking the two files. mv conftest.$ac_objext conftstm.$ac_objext - lt_save_LIBS="$LIBS" - lt_save_CFLAGS="$CFLAGS" + lt_globsym_save_LIBS=$LIBS + lt_globsym_save_CFLAGS=$CFLAGS LIBS="conftstm.$ac_objext" CFLAGS="$CFLAGS$lt_prog_compiler_no_builtin_flag" if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5 @@ -7591,8 +8325,8 @@ test $ac_status = 0; } && test -s conftest${ac_exeext}; then pipe_works=yes fi - LIBS="$lt_save_LIBS" - CFLAGS="$lt_save_CFLAGS" + LIBS=$lt_globsym_save_LIBS + CFLAGS=$lt_globsym_save_CFLAGS else echo "cannot find nm_test_func in $nlist" >&5 fi @@ -7629,6 +8363,20 @@ $as_echo "ok" >&6; } fi +# Response file support. +if test "$lt_cv_nm_interface" = "MS dumpbin"; then + nm_file_list_spec='@' +elif $NM --help 2>/dev/null | grep '[@]FILE' >/dev/null; then + nm_file_list_spec='@' +fi + + + + + + + + @@ -7648,6 +8396,41 @@ +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for sysroot" >&5 +$as_echo_n "checking for sysroot... " >&6; } + +# Check whether --with-sysroot was given. +if test "${with_sysroot+set}" = set; then : + withval=$with_sysroot; +else + with_sysroot=no +fi + + +lt_sysroot= +case ${with_sysroot} in #( + yes) + if test "$GCC" = yes; then + lt_sysroot=`$CC --print-sysroot 2>/dev/null` + fi + ;; #( + /*) + lt_sysroot=`echo "$with_sysroot" | sed -e "$sed_quote_subst"` + ;; #( + no|'') + ;; #( + *) + { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${with_sysroot}" >&5 +$as_echo "${with_sysroot}" >&6; } + as_fn_error $? "The sysroot must be an absolute path." "$LINENO" 5 + ;; +esac + + { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${lt_sysroot:-no}" >&5 +$as_echo "${lt_sysroot:-no}" >&6; } + + + # Check whether --enable-libtool-lock was given. @@ -7681,7 +8464,7 @@ ;; *-*-irix6*) # Find out which ABI we are using. - echo '#line 7684 "configure"' > conftest.$ac_ext + echo '#line '$LINENO' "configure"' > conftest.$ac_ext if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 (eval $ac_compile) 2>&5 ac_status=$? @@ -7775,7 +8558,7 @@ CFLAGS="$CFLAGS -belf" { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the C compiler needs -belf" >&5 $as_echo_n "checking whether the C compiler needs -belf... " >&6; } -if test "${lt_cv_cc_needs_belf+set}" = set; then : +if ${lt_cv_cc_needs_belf+:} false; then : $as_echo_n "(cached) " >&6 else ac_ext=c @@ -7816,7 +8599,7 @@ CFLAGS="$SAVE_CFLAGS" fi ;; -sparc*-*solaris*) +*-*solaris*) # Find out which ABI we are using. echo 'int i;' > conftest.$ac_ext if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 @@ -7827,7 +8610,20 @@ case `/usr/bin/file conftest.o` in *64-bit*) case $lt_cv_prog_gnu_ld in - yes*) LD="${LD-ld} -m elf64_sparc" ;; + yes*) + case $host in + i?86-*-solaris*) + LD="${LD-ld} -m elf_x86_64" + ;; + sparc*-*-solaris*) + LD="${LD-ld} -m elf64_sparc" + ;; + esac + # GNU ld 2.21 introduced _sol2 emulations. Use them if available. + if ${LD-ld} -V | grep _sol2 >/dev/null 2>&1; then + LD="${LD-ld}_sol2" + fi + ;; *) if ${LD-ld} -64 -r -o conftest2.o conftest.o >/dev/null 2>&1; then LD="${LD-ld} -64" @@ -7843,19 +8639,16 @@ need_locks="$enable_libtool_lock" - - case $host_os in - rhapsody* | darwin*) - if test -n "$ac_tool_prefix"; then - # Extract the first word of "${ac_tool_prefix}dsymutil", so it can be a program name with args. -set dummy ${ac_tool_prefix}dsymutil; ac_word=$2 +if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}mt", so it can be a program name with args. +set dummy ${ac_tool_prefix}mt; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_prog_DSYMUTIL+set}" = set; then : +if ${ac_cv_prog_MANIFEST_TOOL+:} false; then : $as_echo_n "(cached) " >&6 else - if test -n "$DSYMUTIL"; then - ac_cv_prog_DSYMUTIL="$DSYMUTIL" # Let the user override the test. + if test -n "$MANIFEST_TOOL"; then + ac_cv_prog_MANIFEST_TOOL="$MANIFEST_TOOL" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH @@ -7863,8 +8656,8 @@ IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_prog_DSYMUTIL="${ac_tool_prefix}dsymutil" + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_MANIFEST_TOOL="${ac_tool_prefix}mt" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi @@ -7874,10 +8667,10 @@ fi fi -DSYMUTIL=$ac_cv_prog_DSYMUTIL -if test -n "$DSYMUTIL"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DSYMUTIL" >&5 -$as_echo "$DSYMUTIL" >&6; } +MANIFEST_TOOL=$ac_cv_prog_MANIFEST_TOOL +if test -n "$MANIFEST_TOOL"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MANIFEST_TOOL" >&5 +$as_echo "$MANIFEST_TOOL" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } @@ -7885,17 +8678,17 @@ fi -if test -z "$ac_cv_prog_DSYMUTIL"; then - ac_ct_DSYMUTIL=$DSYMUTIL - # Extract the first word of "dsymutil", so it can be a program name with args. -set dummy dsymutil; ac_word=$2 +if test -z "$ac_cv_prog_MANIFEST_TOOL"; then + ac_ct_MANIFEST_TOOL=$MANIFEST_TOOL + # Extract the first word of "mt", so it can be a program name with args. +set dummy mt; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_prog_ac_ct_DSYMUTIL+set}" = set; then : +if ${ac_cv_prog_ac_ct_MANIFEST_TOOL+:} false; then : $as_echo_n "(cached) " >&6 else - if test -n "$ac_ct_DSYMUTIL"; then - ac_cv_prog_ac_ct_DSYMUTIL="$ac_ct_DSYMUTIL" # Let the user override the test. + if test -n "$ac_ct_MANIFEST_TOOL"; then + ac_cv_prog_ac_ct_MANIFEST_TOOL="$ac_ct_MANIFEST_TOOL" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH @@ -7903,8 +8696,8 @@ IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_prog_ac_ct_DSYMUTIL="dsymutil" + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_MANIFEST_TOOL="mt" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi @@ -7914,17 +8707,17 @@ fi fi -ac_ct_DSYMUTIL=$ac_cv_prog_ac_ct_DSYMUTIL -if test -n "$ac_ct_DSYMUTIL"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_DSYMUTIL" >&5 -$as_echo "$ac_ct_DSYMUTIL" >&6; } +ac_ct_MANIFEST_TOOL=$ac_cv_prog_ac_ct_MANIFEST_TOOL +if test -n "$ac_ct_MANIFEST_TOOL"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_MANIFEST_TOOL" >&5 +$as_echo "$ac_ct_MANIFEST_TOOL" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi - if test "x$ac_ct_DSYMUTIL" = x; then - DSYMUTIL=":" + if test "x$ac_ct_MANIFEST_TOOL" = x; then + MANIFEST_TOOL=":" else case $cross_compiling:$ac_tool_warned in yes:) @@ -7932,22 +8725,50 @@ $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac - DSYMUTIL=$ac_ct_DSYMUTIL + MANIFEST_TOOL=$ac_ct_MANIFEST_TOOL fi else - DSYMUTIL="$ac_cv_prog_DSYMUTIL" + MANIFEST_TOOL="$ac_cv_prog_MANIFEST_TOOL" +fi + +test -z "$MANIFEST_TOOL" && MANIFEST_TOOL=mt +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if $MANIFEST_TOOL is a manifest tool" >&5 +$as_echo_n "checking if $MANIFEST_TOOL is a manifest tool... " >&6; } +if ${lt_cv_path_mainfest_tool+:} false; then : + $as_echo_n "(cached) " >&6 +else + lt_cv_path_mainfest_tool=no + echo "$as_me:$LINENO: $MANIFEST_TOOL '-?'" >&5 + $MANIFEST_TOOL '-?' 2>conftest.err > conftest.out + cat conftest.err >&5 + if $GREP 'Manifest Tool' conftest.out > /dev/null; then + lt_cv_path_mainfest_tool=yes + fi + rm -f conftest* fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_path_mainfest_tool" >&5 +$as_echo "$lt_cv_path_mainfest_tool" >&6; } +if test "x$lt_cv_path_mainfest_tool" != xyes; then + MANIFEST_TOOL=: +fi + + + + + + case $host_os in + rhapsody* | darwin*) if test -n "$ac_tool_prefix"; then - # Extract the first word of "${ac_tool_prefix}nmedit", so it can be a program name with args. -set dummy ${ac_tool_prefix}nmedit; ac_word=$2 + # Extract the first word of "${ac_tool_prefix}dsymutil", so it can be a program name with args. +set dummy ${ac_tool_prefix}dsymutil; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_prog_NMEDIT+set}" = set; then : +if ${ac_cv_prog_DSYMUTIL+:} false; then : $as_echo_n "(cached) " >&6 else - if test -n "$NMEDIT"; then - ac_cv_prog_NMEDIT="$NMEDIT" # Let the user override the test. + if test -n "$DSYMUTIL"; then + ac_cv_prog_DSYMUTIL="$DSYMUTIL" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH @@ -7955,8 +8776,8 @@ IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_prog_NMEDIT="${ac_tool_prefix}nmedit" + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_DSYMUTIL="${ac_tool_prefix}dsymutil" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi @@ -7966,10 +8787,10 @@ fi fi -NMEDIT=$ac_cv_prog_NMEDIT -if test -n "$NMEDIT"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $NMEDIT" >&5 -$as_echo "$NMEDIT" >&6; } +DSYMUTIL=$ac_cv_prog_DSYMUTIL +if test -n "$DSYMUTIL"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DSYMUTIL" >&5 +$as_echo "$DSYMUTIL" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } @@ -7977,13 +8798,105 @@ fi -if test -z "$ac_cv_prog_NMEDIT"; then - ac_ct_NMEDIT=$NMEDIT - # Extract the first word of "nmedit", so it can be a program name with args. -set dummy nmedit; ac_word=$2 +if test -z "$ac_cv_prog_DSYMUTIL"; then + ac_ct_DSYMUTIL=$DSYMUTIL + # Extract the first word of "dsymutil", so it can be a program name with args. +set dummy dsymutil; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_ac_ct_DSYMUTIL+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_DSYMUTIL"; then + ac_cv_prog_ac_ct_DSYMUTIL="$ac_ct_DSYMUTIL" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_DSYMUTIL="dsymutil" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_DSYMUTIL=$ac_cv_prog_ac_ct_DSYMUTIL +if test -n "$ac_ct_DSYMUTIL"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_DSYMUTIL" >&5 +$as_echo "$ac_ct_DSYMUTIL" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + if test "x$ac_ct_DSYMUTIL" = x; then + DSYMUTIL=":" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + DSYMUTIL=$ac_ct_DSYMUTIL + fi +else + DSYMUTIL="$ac_cv_prog_DSYMUTIL" +fi + + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}nmedit", so it can be a program name with args. +set dummy ${ac_tool_prefix}nmedit; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_NMEDIT+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$NMEDIT"; then + ac_cv_prog_NMEDIT="$NMEDIT" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_NMEDIT="${ac_tool_prefix}nmedit" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +NMEDIT=$ac_cv_prog_NMEDIT +if test -n "$NMEDIT"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $NMEDIT" >&5 +$as_echo "$NMEDIT" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +fi +if test -z "$ac_cv_prog_NMEDIT"; then + ac_ct_NMEDIT=$NMEDIT + # Extract the first word of "nmedit", so it can be a program name with args. +set dummy nmedit; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_prog_ac_ct_NMEDIT+set}" = set; then : +if ${ac_cv_prog_ac_ct_NMEDIT+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_NMEDIT"; then @@ -7995,7 +8908,7 @@ IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_NMEDIT="nmedit" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 @@ -8035,7 +8948,7 @@ set dummy ${ac_tool_prefix}lipo; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_prog_LIPO+set}" = set; then : +if ${ac_cv_prog_LIPO+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$LIPO"; then @@ -8047,7 +8960,7 @@ IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_LIPO="${ac_tool_prefix}lipo" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 @@ -8075,7 +8988,7 @@ set dummy lipo; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_prog_ac_ct_LIPO+set}" = set; then : +if ${ac_cv_prog_ac_ct_LIPO+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_LIPO"; then @@ -8087,7 +9000,7 @@ IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_LIPO="lipo" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 @@ -8127,7 +9040,7 @@ set dummy ${ac_tool_prefix}otool; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_prog_OTOOL+set}" = set; then : +if ${ac_cv_prog_OTOOL+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$OTOOL"; then @@ -8139,7 +9052,7 @@ IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_OTOOL="${ac_tool_prefix}otool" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 @@ -8167,7 +9080,7 @@ set dummy otool; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_prog_ac_ct_OTOOL+set}" = set; then : +if ${ac_cv_prog_ac_ct_OTOOL+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_OTOOL"; then @@ -8179,7 +9092,7 @@ IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_OTOOL="otool" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 @@ -8219,7 +9132,7 @@ set dummy ${ac_tool_prefix}otool64; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_prog_OTOOL64+set}" = set; then : +if ${ac_cv_prog_OTOOL64+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$OTOOL64"; then @@ -8231,7 +9144,7 @@ IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_OTOOL64="${ac_tool_prefix}otool64" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 @@ -8259,7 +9172,7 @@ set dummy otool64; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_prog_ac_ct_OTOOL64+set}" = set; then : +if ${ac_cv_prog_ac_ct_OTOOL64+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_OTOOL64"; then @@ -8271,7 +9184,7 @@ IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_OTOOL64="otool64" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 @@ -8334,7 +9247,7 @@ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for -single_module linker flag" >&5 $as_echo_n "checking for -single_module linker flag... " >&6; } -if test "${lt_cv_apple_cc_single_mod+set}" = set; then : +if ${lt_cv_apple_cc_single_mod+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_apple_cc_single_mod=no @@ -8350,7 +9263,13 @@ $LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \ -dynamiclib -Wl,-single_module conftest.c 2>conftest.err _lt_result=$? - if test -f libconftest.dylib && test ! -s conftest.err && test $_lt_result = 0; then + # If there is a non-empty error log, and "single_module" + # appears in it, assume the flag caused a linker warning + if test -s conftest.err && $GREP single_module conftest.err; then + cat conftest.err >&5 + # Otherwise, if the output was created with a 0 exit code from + # the compiler, it worked. + elif test -f libconftest.dylib && test $_lt_result -eq 0; then lt_cv_apple_cc_single_mod=yes else cat conftest.err >&5 @@ -8361,9 +9280,10 @@ fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_apple_cc_single_mod" >&5 $as_echo "$lt_cv_apple_cc_single_mod" >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for -exported_symbols_list linker flag" >&5 $as_echo_n "checking for -exported_symbols_list linker flag... " >&6; } -if test "${lt_cv_ld_exported_symbols_list+set}" = set; then : +if ${lt_cv_ld_exported_symbols_list+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_ld_exported_symbols_list=no @@ -8393,6 +9313,41 @@ fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ld_exported_symbols_list" >&5 $as_echo "$lt_cv_ld_exported_symbols_list" >&6; } + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for -force_load linker flag" >&5 +$as_echo_n "checking for -force_load linker flag... " >&6; } +if ${lt_cv_ld_force_load+:} false; then : + $as_echo_n "(cached) " >&6 +else + lt_cv_ld_force_load=no + cat > conftest.c << _LT_EOF +int forced_loaded() { return 2;} +_LT_EOF + echo "$LTCC $LTCFLAGS -c -o conftest.o conftest.c" >&5 + $LTCC $LTCFLAGS -c -o conftest.o conftest.c 2>&5 + echo "$AR cru libconftest.a conftest.o" >&5 + $AR cru libconftest.a conftest.o 2>&5 + echo "$RANLIB libconftest.a" >&5 + $RANLIB libconftest.a 2>&5 + cat > conftest.c << _LT_EOF +int main() { return 0;} +_LT_EOF + echo "$LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a" >&5 + $LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a 2>conftest.err + _lt_result=$? + if test -s conftest.err && $GREP force_load conftest.err; then + cat conftest.err >&5 + elif test -f conftest && test $_lt_result -eq 0 && $GREP forced_load conftest >/dev/null 2>&1 ; then + lt_cv_ld_force_load=yes + else + cat conftest.err >&5 + fi + rm -f conftest.err libconftest.a conftest conftest.c + rm -rf conftest.dSYM + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ld_force_load" >&5 +$as_echo "$lt_cv_ld_force_load" >&6; } case $host_os in rhapsody* | darwin1.[012]) _lt_dar_allow_undefined='${wl}-undefined ${wl}suppress' ;; @@ -8420,7 +9375,7 @@ else _lt_dar_export_syms='~$NMEDIT -s $output_objdir/${libname}-symbols.expsym ${lib}' fi - if test "$DSYMUTIL" != ":"; then + if test "$DSYMUTIL" != ":" && test "$lt_cv_ld_force_load" = "no"; then _lt_dsymutil='~$DSYMUTIL $lib || :' else _lt_dsymutil= @@ -8432,7 +9387,7 @@ do : ac_fn_c_check_header_compile "$LINENO" "dlfcn.h" "ac_cv_header_dlfcn_h" "$ac_includes_default " -if test "x$ac_cv_header_dlfcn_h" = x""yes; then : +if test "x$ac_cv_header_dlfcn_h" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_DLFCN_H 1 _ACEOF @@ -8443,615 +9398,116 @@ -ac_ext=cpp -ac_cpp='$CXXCPP $CPPFLAGS' -ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_cxx_compiler_gnu -if test -z "$CXX"; then - if test -n "$CCC"; then - CXX=$CCC - else - if test -n "$ac_tool_prefix"; then - for ac_prog in g++ c++ gpp aCC CC cxx cc++ cl.exe FCC KCC RCC xlC_r xlC - do - # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. -set dummy $ac_tool_prefix$ac_prog; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_prog_CXX+set}" = set; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$CXX"; then - ac_cv_prog_CXX="$CXX" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_prog_CXX="$ac_tool_prefix$ac_prog" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS -fi -fi -CXX=$ac_cv_prog_CXX -if test -n "$CXX"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CXX" >&5 -$as_echo "$CXX" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi +func_stripname_cnf () +{ + case ${2} in + .*) func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%\\\\${2}\$%%"`;; + *) func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%${2}\$%%"`;; + esac +} # func_stripname_cnf - test -n "$CXX" && break - done -fi -if test -z "$CXX"; then - ac_ct_CXX=$CXX - for ac_prog in g++ c++ gpp aCC CC cxx cc++ cl.exe FCC KCC RCC xlC_r xlC -do - # Extract the first word of "$ac_prog", so it can be a program name with args. -set dummy $ac_prog; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_prog_ac_ct_CXX+set}" = set; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$ac_ct_CXX"; then - ac_cv_prog_ac_ct_CXX="$ac_ct_CXX" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_prog_ac_ct_CXX="$ac_prog" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS -fi -fi -ac_ct_CXX=$ac_cv_prog_ac_ct_CXX -if test -n "$ac_ct_CXX"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CXX" >&5 -$as_echo "$ac_ct_CXX" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - test -n "$ac_ct_CXX" && break -done +# Set options - if test "x$ac_ct_CXX" = x; then - CXX="g++" - else - case $cross_compiling:$ac_tool_warned in -yes:) -{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 -$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} -ac_tool_warned=yes ;; -esac - CXX=$ac_ct_CXX - fi -fi - fi -fi -# Provide some information about the compiler. -$as_echo "$as_me:${as_lineno-$LINENO}: checking for C++ compiler version" >&5 -set X $ac_compile -ac_compiler=$2 -for ac_option in --version -v -V -qversion; do - { { ac_try="$ac_compiler $ac_option >&5" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -$as_echo "$ac_try_echo"; } >&5 - (eval "$ac_compiler $ac_option >&5") 2>conftest.err - ac_status=$? - if test -s conftest.err; then - sed '10a\ -... rest of stderr output deleted ... - 10q' conftest.err >conftest.er1 - cat conftest.er1 >&5 - fi - rm -f conftest.er1 conftest.err - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; } -done -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the GNU C++ compiler" >&5 -$as_echo_n "checking whether we are using the GNU C++ compiler... " >&6; } -if test "${ac_cv_cxx_compiler_gnu+set}" = set; then : - $as_echo_n "(cached) " >&6 -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ + enable_dlopen=no -int -main () -{ -#ifndef __GNUC__ - choke me -#endif - ; - return 0; -} -_ACEOF -if ac_fn_cxx_try_compile "$LINENO"; then : - ac_compiler_gnu=yes -else - ac_compiler_gnu=no -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -ac_cv_cxx_compiler_gnu=$ac_compiler_gnu + enable_win32_dll=no -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_cxx_compiler_gnu" >&5 -$as_echo "$ac_cv_cxx_compiler_gnu" >&6; } -if test $ac_compiler_gnu = yes; then - GXX=yes + + # Check whether --enable-shared was given. +if test "${enable_shared+set}" = set; then : + enableval=$enable_shared; p=${PACKAGE-default} + case $enableval in + yes) enable_shared=yes ;; + no) enable_shared=no ;; + *) + enable_shared=no + # Look at the argument we got. We use all the common list separators. + lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," + for pkg in $enableval; do + IFS="$lt_save_ifs" + if test "X$pkg" = "X$p"; then + enable_shared=yes + fi + done + IFS="$lt_save_ifs" + ;; + esac else - GXX= + enable_shared=yes fi -ac_test_CXXFLAGS=${CXXFLAGS+set} -ac_save_CXXFLAGS=$CXXFLAGS -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CXX accepts -g" >&5 -$as_echo_n "checking whether $CXX accepts -g... " >&6; } -if test "${ac_cv_prog_cxx_g+set}" = set; then : - $as_echo_n "(cached) " >&6 -else - ac_save_cxx_werror_flag=$ac_cxx_werror_flag - ac_cxx_werror_flag=yes - ac_cv_prog_cxx_g=no - CXXFLAGS="-g" - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -int -main () -{ - ; - return 0; -} -_ACEOF -if ac_fn_cxx_try_compile "$LINENO"; then : - ac_cv_prog_cxx_g=yes -else - CXXFLAGS="" - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -int -main () -{ - ; - return 0; -} -_ACEOF -if ac_fn_cxx_try_compile "$LINENO"; then : -else - ac_cxx_werror_flag=$ac_save_cxx_werror_flag - CXXFLAGS="-g" - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -int -main () -{ - ; - return 0; -} -_ACEOF -if ac_fn_cxx_try_compile "$LINENO"; then : - ac_cv_prog_cxx_g=yes -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - ac_cxx_werror_flag=$ac_save_cxx_werror_flag -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cxx_g" >&5 -$as_echo "$ac_cv_prog_cxx_g" >&6; } -if test "$ac_test_CXXFLAGS" = set; then - CXXFLAGS=$ac_save_CXXFLAGS -elif test $ac_cv_prog_cxx_g = yes; then - if test "$GXX" = yes; then - CXXFLAGS="-g -O2" - else - CXXFLAGS="-g" - fi + + + # Check whether --enable-static was given. +if test "${enable_static+set}" = set; then : + enableval=$enable_static; p=${PACKAGE-default} + case $enableval in + yes) enable_static=yes ;; + no) enable_static=no ;; + *) + enable_static=no + # Look at the argument we got. We use all the common list separators. + lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," + for pkg in $enableval; do + IFS="$lt_save_ifs" + if test "X$pkg" = "X$p"; then + enable_static=yes + fi + done + IFS="$lt_save_ifs" + ;; + esac else - if test "$GXX" = yes; then - CXXFLAGS="-O2" - else - CXXFLAGS= - fi + enable_static=yes fi -ac_ext=c -ac_cpp='$CPP $CPPFLAGS' -ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_c_compiler_gnu -depcc="$CXX" am_compiler_list= -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking dependency style of $depcc" >&5 -$as_echo_n "checking dependency style of $depcc... " >&6; } -if test "${am_cv_CXX_dependencies_compiler_type+set}" = set; then : - $as_echo_n "(cached) " >&6 -else - if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then - # We make a subdir and do the tests there. Otherwise we can end up - # making bogus files that we don't know about and never remove. For - # instance it was reported that on HP-UX the gcc test will end up - # making a dummy file named `D' -- because `-MD' means `put the output - # in D'. - mkdir conftest.dir - # Copy depcomp to subdir because otherwise we won't find it if we're - # using a relative directory. - cp "$am_depcomp" conftest.dir - cd conftest.dir - # We will build objects and dependencies in a subdirectory because - # it helps to detect inapplicable dependency modes. For instance - # both Tru64's cc and ICC support -MD to output dependencies as a - # side effect of compilation, but ICC will put the dependencies in - # the current directory while Tru64 will put them in the object - # directory. - mkdir sub - am_cv_CXX_dependencies_compiler_type=none - if test "$am_compiler_list" = ""; then - am_compiler_list=`sed -n 's/^#*\([a-zA-Z0-9]*\))$/\1/p' < ./depcomp` - fi - am__universal=false - case " $depcc " in #( - *\ -arch\ *\ -arch\ *) am__universal=true ;; - esac - for depmode in $am_compiler_list; do - # Setup a source with many dependencies, because some compilers - # like to wrap large dependency lists on column 80 (with \), and - # we should not choose a depcomp mode which is confused by this. - # - # We need to recreate these files for each test, as the compiler may - # overwrite some of them when testing with obscure command lines. - # This happens at least with the AIX C compiler. - : > sub/conftest.c - for i in 1 2 3 4 5 6; do - echo '#include "conftst'$i'.h"' >> sub/conftest.c - # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with - # Solaris 8's {/usr,}/bin/sh. - touch sub/conftst$i.h - done - echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf - # We check with `-c' and `-o' for the sake of the "dashmstdout" - # mode. It turns out that the SunPro C++ compiler does not properly - # handle `-M -o', and we need to detect this. Also, some Intel - # versions had trouble with output in subdirs - am__obj=sub/conftest.${OBJEXT-o} - am__minus_obj="-o $am__obj" - case $depmode in - gcc) - # This depmode causes a compiler race in universal mode. - test "$am__universal" = false || continue - ;; - nosideeffect) - # after this tag, mechanisms are not by side-effect, so they'll - # only be used when explicitly requested - if test "x$enable_dependency_tracking" = xyes; then - continue - else - break - fi - ;; - msvisualcpp | msvcmsys) - # This compiler won't grok `-c -o', but also, the minuso test has - # not run yet. These depmodes are late enough in the game, and - # so weak that their functioning should not be impacted. - am__obj=conftest.${OBJEXT-o} - am__minus_obj= + + + + + +# Check whether --with-pic was given. +if test "${with_pic+set}" = set; then : + withval=$with_pic; lt_p=${PACKAGE-default} + case $withval in + yes|no) pic_mode=$withval ;; + *) + pic_mode=default + # Look at the argument we got. We use all the common list separators. + lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," + for lt_pkg in $withval; do + IFS="$lt_save_ifs" + if test "X$lt_pkg" = "X$lt_p"; then + pic_mode=yes + fi + done + IFS="$lt_save_ifs" ;; - none) break ;; esac - if depmode=$depmode \ - source=sub/conftest.c object=$am__obj \ - depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ - $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \ - >/dev/null 2>conftest.err && - grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 && - grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && - grep $am__obj sub/conftest.Po > /dev/null 2>&1 && - ${MAKE-make} -s -f confmf > /dev/null 2>&1; then - # icc doesn't choke on unknown options, it will just issue warnings - # or remarks (even with -Werror). So we grep stderr for any message - # that says an option was ignored or not supported. - # When given -MP, icc 7.0 and 7.1 complain thusly: - # icc: Command line warning: ignoring option '-M'; no argument required - # The diagnosis changed in icc 8.0: - # icc: Command line remark: option '-MP' not supported - if (grep 'ignoring option' conftest.err || - grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else - am_cv_CXX_dependencies_compiler_type=$depmode - break - fi - fi - done - - cd .. - rm -rf conftest.dir else - am_cv_CXX_dependencies_compiler_type=none + pic_mode=default fi -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_CXX_dependencies_compiler_type" >&5 -$as_echo "$am_cv_CXX_dependencies_compiler_type" >&6; } -CXXDEPMODE=depmode=$am_cv_CXX_dependencies_compiler_type - if - test "x$enable_dependency_tracking" != xno \ - && test "$am_cv_CXX_dependencies_compiler_type" = gcc3; then - am__fastdepCXX_TRUE= - am__fastdepCXX_FALSE='#' -else - am__fastdepCXX_TRUE='#' - am__fastdepCXX_FALSE= -fi - - -if test -n "$CXX" && ( test "X$CXX" != "Xno" && - ( (test "X$CXX" = "Xg++" && `g++ -v >/dev/null 2>&1` ) || - (test "X$CXX" != "Xg++"))) ; then - ac_ext=cpp -ac_cpp='$CXXCPP $CPPFLAGS' -ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_cxx_compiler_gnu -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to run the C++ preprocessor" >&5 -$as_echo_n "checking how to run the C++ preprocessor... " >&6; } -if test -z "$CXXCPP"; then - if test "${ac_cv_prog_CXXCPP+set}" = set; then : - $as_echo_n "(cached) " >&6 -else - # Double quotes because CXXCPP needs to be expanded - for CXXCPP in "$CXX -E" "/lib/cpp" - do - ac_preproc_ok=false -for ac_cxx_preproc_warn_flag in '' yes -do - # Use a header file that comes with gcc, so configuring glibc - # with a fresh cross-compiler works. - # Prefer to if __STDC__ is defined, since - # exists even on freestanding compilers. - # On the NeXT, cc -E runs the code through the compiler's parser, - # not just through cpp. "Syntax error" is here to catch this case. - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#ifdef __STDC__ -# include -#else -# include -#endif - Syntax error -_ACEOF -if ac_fn_cxx_try_cpp "$LINENO"; then : - -else - # Broken: fails on valid input. -continue -fi -rm -f conftest.err conftest.$ac_ext - - # OK, works on sane cases. Now check whether nonexistent headers - # can be detected and how. - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include -_ACEOF -if ac_fn_cxx_try_cpp "$LINENO"; then : - # Broken: success on invalid input. -continue -else - # Passes both tests. -ac_preproc_ok=: -break -fi -rm -f conftest.err conftest.$ac_ext - -done -# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. -rm -f conftest.err conftest.$ac_ext -if $ac_preproc_ok; then : - break -fi - - done - ac_cv_prog_CXXCPP=$CXXCPP - -fi - CXXCPP=$ac_cv_prog_CXXCPP -else - ac_cv_prog_CXXCPP=$CXXCPP -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $CXXCPP" >&5 -$as_echo "$CXXCPP" >&6; } -ac_preproc_ok=false -for ac_cxx_preproc_warn_flag in '' yes -do - # Use a header file that comes with gcc, so configuring glibc - # with a fresh cross-compiler works. - # Prefer to if __STDC__ is defined, since - # exists even on freestanding compilers. - # On the NeXT, cc -E runs the code through the compiler's parser, - # not just through cpp. "Syntax error" is here to catch this case. - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#ifdef __STDC__ -# include -#else -# include -#endif - Syntax error -_ACEOF -if ac_fn_cxx_try_cpp "$LINENO"; then : - -else - # Broken: fails on valid input. -continue -fi -rm -f conftest.err conftest.$ac_ext - - # OK, works on sane cases. Now check whether nonexistent headers - # can be detected and how. - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include -_ACEOF -if ac_fn_cxx_try_cpp "$LINENO"; then : - # Broken: success on invalid input. -continue -else - # Passes both tests. -ac_preproc_ok=: -break -fi -rm -f conftest.err conftest.$ac_ext - -done -# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. -rm -f conftest.err conftest.$ac_ext -if $ac_preproc_ok; then : - -else - { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -_lt_caught_CXX_error=yes; } -fi - -ac_ext=c -ac_cpp='$CPP $CPPFLAGS' -ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_c_compiler_gnu - -else - _lt_caught_CXX_error=yes -fi - - - - - -# Set options - - - - enable_dlopen=no - - - enable_win32_dll=no - - - # Check whether --enable-shared was given. -if test "${enable_shared+set}" = set; then : - enableval=$enable_shared; p=${PACKAGE-default} - case $enableval in - yes) enable_shared=yes ;; - no) enable_shared=no ;; - *) - enable_shared=no - # Look at the argument we got. We use all the common list separators. - lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," - for pkg in $enableval; do - IFS="$lt_save_ifs" - if test "X$pkg" = "X$p"; then - enable_shared=yes - fi - done - IFS="$lt_save_ifs" - ;; - esac -else - enable_shared=yes -fi - - - - - - - - - - # Check whether --enable-static was given. -if test "${enable_static+set}" = set; then : - enableval=$enable_static; p=${PACKAGE-default} - case $enableval in - yes) enable_static=yes ;; - no) enable_static=no ;; - *) - enable_static=no - # Look at the argument we got. We use all the common list separators. - lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," - for pkg in $enableval; do - IFS="$lt_save_ifs" - if test "X$pkg" = "X$p"; then - enable_static=yes - fi - done - IFS="$lt_save_ifs" - ;; - esac -else - enable_static=yes -fi - - - - - - - - - - -# Check whether --with-pic was given. -if test "${with_pic+set}" = set; then : - withval=$with_pic; pic_mode="$withval" -else - pic_mode=default -fi - - -test -z "$pic_mode" && pic_mode=default +test -z "$pic_mode" && pic_mode=default @@ -9122,6 +9578,11 @@ + + + + + test -z "$LN_S" && LN_S="ln -s" @@ -9143,7 +9604,7 @@ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for objdir" >&5 $as_echo_n "checking for objdir... " >&6; } -if test "${lt_cv_objdir+set}" = set; then : +if ${lt_cv_objdir+:} false; then : $as_echo_n "(cached) " >&6 else rm -f .libs 2>/dev/null @@ -9171,19 +9632,6 @@ - - - - - - - - - - - - - case $host_os in aix3*) # AIX sometimes has problems with the GCC collect2 program. For some @@ -9196,23 +9644,6 @@ ;; esac -# Sed substitution that helps us do robust quoting. It backslashifies -# metacharacters that are still active within double-quoted strings. -sed_quote_subst='s/\(["`$\\]\)/\\\1/g' - -# Same as above, but do not quote variable references. -double_quote_subst='s/\(["`\\]\)/\\\1/g' - -# Sed substitution to delay expansion of an escaped shell variable in a -# double_quote_subst'ed string. -delay_variable_subst='s/\\\\\\\\\\\$/\\\\\\$/g' - -# Sed substitution to delay expansion of an escaped single quote. -delay_single_quote_subst='s/'\''/'\'\\\\\\\'\''/g' - -# Sed substitution to avoid accidental globbing in evaled expressions -no_glob_subst='s/\*/\\\*/g' - # Global variables: ofile=libtool can_build_shared=yes @@ -9241,7 +9672,7 @@ *) break;; esac done -cc_basename=`$ECHO "X$cc_temp" | $Xsed -e 's%.*/%%' -e "s%^$host_alias-%%"` +cc_basename=`$ECHO "$cc_temp" | $SED "s%.*/%%; s%^$host_alias-%%"` # Only perform the check for file, if the check method requires it @@ -9251,7 +9682,7 @@ if test "$file_magic_cmd" = '$MAGIC_CMD'; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ${ac_tool_prefix}file" >&5 $as_echo_n "checking for ${ac_tool_prefix}file... " >&6; } -if test "${lt_cv_path_MAGIC_CMD+set}" = set; then : +if ${lt_cv_path_MAGIC_CMD+:} false; then : $as_echo_n "(cached) " >&6 else case $MAGIC_CMD in @@ -9317,7 +9748,7 @@ if test -n "$ac_tool_prefix"; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for file" >&5 $as_echo_n "checking for file... " >&6; } -if test "${lt_cv_path_MAGIC_CMD+set}" = set; then : +if ${lt_cv_path_MAGIC_CMD+:} false; then : $as_echo_n "(cached) " >&6 else case $MAGIC_CMD in @@ -9450,11 +9881,16 @@ lt_prog_compiler_no_builtin_flag= if test "$GCC" = yes; then - lt_prog_compiler_no_builtin_flag=' -fno-builtin' + case $cc_basename in + nvcc*) + lt_prog_compiler_no_builtin_flag=' -Xcompiler -fno-builtin' ;; + *) + lt_prog_compiler_no_builtin_flag=' -fno-builtin' ;; + esac { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -fno-rtti -fno-exceptions" >&5 $as_echo_n "checking if $compiler supports -fno-rtti -fno-exceptions... " >&6; } -if test "${lt_cv_prog_compiler_rtti_exceptions+set}" = set; then : +if ${lt_cv_prog_compiler_rtti_exceptions+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_prog_compiler_rtti_exceptions=no @@ -9470,15 +9906,15 @@ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:9473: $lt_compile\"" >&5) + (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 - echo "$as_me:9477: \$? = $ac_status" >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings other than the usual output. - $ECHO "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' >conftest.exp + $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' >conftest.exp $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then lt_cv_prog_compiler_rtti_exceptions=yes @@ -9507,8 +9943,6 @@ lt_prog_compiler_pic= lt_prog_compiler_static= -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $compiler option to produce PIC" >&5 -$as_echo_n "checking for $compiler option to produce PIC... " >&6; } if test "$GCC" = yes; then lt_prog_compiler_wl='-Wl,' @@ -9556,6 +9990,12 @@ lt_prog_compiler_pic='-fno-common' ;; + haiku*) + # PIC is the default for Haiku. + # The "-static" flag exists, but is broken. + lt_prog_compiler_static= + ;; + hpux*) # PIC is the default for 64-bit PA HP-UX, but not for 32-bit # PA HP-UX. On IA64 HP-UX, PIC is the default but the pic flag @@ -9598,6 +10038,15 @@ lt_prog_compiler_pic='-fPIC' ;; esac + + case $cc_basename in + nvcc*) # Cuda Compiler Driver 2.2 + lt_prog_compiler_wl='-Xlinker ' + if test -n "$lt_prog_compiler_pic"; then + lt_prog_compiler_pic="-Xcompiler $lt_prog_compiler_pic" + fi + ;; + esac else # PORTME Check for flag to pass linker flags through the system compiler. case $host_os in @@ -9639,7 +10088,7 @@ lt_prog_compiler_static='-non_shared' ;; - linux* | k*bsd*-gnu) + linux* | k*bsd*-gnu | kopensolaris*-gnu) case $cc_basename in # old Intel for x86_64 which still supported -KPIC. ecc*) @@ -9660,7 +10109,13 @@ lt_prog_compiler_pic='--shared' lt_prog_compiler_static='--static' ;; - pgcc* | pgf77* | pgf90* | pgf95*) + nagfor*) + # NAG Fortran compiler + lt_prog_compiler_wl='-Wl,-Wl,,' + lt_prog_compiler_pic='-PIC' + lt_prog_compiler_static='-Bstatic' + ;; + pgcc* | pgf77* | pgf90* | pgf95* | pgfortran*) # Portland Group compilers (*not* the Pentium gcc compiler, # which looks to be a dead project) lt_prog_compiler_wl='-Wl,' @@ -9672,27 +10127,42 @@ # All Alpha code is PIC. lt_prog_compiler_static='-non_shared' ;; - xl*) - # IBM XL C 8.0/Fortran 10.1 on PPC + xl* | bgxl* | bgf* | mpixl*) + # IBM XL C 8.0/Fortran 10.1, 11.1 on PPC and BlueGene lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-qpic' lt_prog_compiler_static='-qstaticlink' ;; *) case `$CC -V 2>&1 | sed 5q` in - *Sun\ C*) - # Sun C 5.9 + *Sun\ Ceres\ Fortran* | *Sun*Fortran*\ [1-7].* | *Sun*Fortran*\ 8.[0-3]*) + # Sun Fortran 8.3 passes all unrecognized flags to the linker lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-Bstatic' - lt_prog_compiler_wl='-Wl,' + lt_prog_compiler_wl='' ;; - *Sun\ F*) - # Sun Fortran 8.3 passes all unrecognized flags to the linker + *Sun\ F* | *Sun*Fortran*) lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-Bstatic' - lt_prog_compiler_wl='' + lt_prog_compiler_wl='-Qoption ld ' ;; - esac + *Sun\ C*) + # Sun C 5.9 + lt_prog_compiler_pic='-KPIC' + lt_prog_compiler_static='-Bstatic' + lt_prog_compiler_wl='-Wl,' + ;; + *Intel*\ [CF]*Compiler*) + lt_prog_compiler_wl='-Wl,' + lt_prog_compiler_pic='-fPIC' + lt_prog_compiler_static='-static' + ;; + *Portland\ Group*) + lt_prog_compiler_wl='-Wl,' + lt_prog_compiler_pic='-fpic' + lt_prog_compiler_static='-Bstatic' + ;; + esac ;; esac ;; @@ -9722,7 +10192,7 @@ lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-Bstatic' case $cc_basename in - f77* | f90* | f95*) + f77* | f90* | f95* | sunf77* | sunf90* | sunf95*) lt_prog_compiler_wl='-Qoption ld ';; *) lt_prog_compiler_wl='-Wl,';; @@ -9779,13 +10249,17 @@ lt_prog_compiler_pic="$lt_prog_compiler_pic -DPIC" ;; esac -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_prog_compiler_pic" >&5 -$as_echo "$lt_prog_compiler_pic" >&6; } - - - - +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $compiler option to produce PIC" >&5 +$as_echo_n "checking for $compiler option to produce PIC... " >&6; } +if ${lt_cv_prog_compiler_pic+:} false; then : + $as_echo_n "(cached) " >&6 +else + lt_cv_prog_compiler_pic=$lt_prog_compiler_pic +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_pic" >&5 +$as_echo "$lt_cv_prog_compiler_pic" >&6; } +lt_prog_compiler_pic=$lt_cv_prog_compiler_pic # # Check to make sure the PIC flag actually works. @@ -9793,7 +10267,7 @@ if test -n "$lt_prog_compiler_pic"; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler PIC flag $lt_prog_compiler_pic works" >&5 $as_echo_n "checking if $compiler PIC flag $lt_prog_compiler_pic works... " >&6; } -if test "${lt_cv_prog_compiler_pic_works+set}" = set; then : +if ${lt_cv_prog_compiler_pic_works+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_prog_compiler_pic_works=no @@ -9809,15 +10283,15 @@ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:9812: $lt_compile\"" >&5) + (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 - echo "$as_me:9816: \$? = $ac_status" >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings other than the usual output. - $ECHO "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' >conftest.exp + $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' >conftest.exp $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then lt_cv_prog_compiler_pic_works=yes @@ -9846,13 +10320,18 @@ + + + + + # # Check to make sure the static flag actually works. # wl=$lt_prog_compiler_wl eval lt_tmp_static_flag=\"$lt_prog_compiler_static\" { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler static flag $lt_tmp_static_flag works" >&5 $as_echo_n "checking if $compiler static flag $lt_tmp_static_flag works... " >&6; } -if test "${lt_cv_prog_compiler_static_works+set}" = set; then : +if ${lt_cv_prog_compiler_static_works+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_prog_compiler_static_works=no @@ -9865,7 +10344,7 @@ if test -s conftest.err; then # Append any errors to the config.log. cat conftest.err 1>&5 - $ECHO "X$_lt_linker_boilerplate" | $Xsed -e '/^$/d' > conftest.exp + $ECHO "$_lt_linker_boilerplate" | $SED '/^$/d' > conftest.exp $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 if diff conftest.exp conftest.er2 >/dev/null; then lt_cv_prog_compiler_static_works=yes @@ -9895,7 +10374,7 @@ { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -c -o file.$ac_objext" >&5 $as_echo_n "checking if $compiler supports -c -o file.$ac_objext... " >&6; } -if test "${lt_cv_prog_compiler_c_o+set}" = set; then : +if ${lt_cv_prog_compiler_c_o+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_prog_compiler_c_o=no @@ -9914,16 +10393,16 @@ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:9917: $lt_compile\"" >&5) + (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&5 - echo "$as_me:9921: \$? = $ac_status" >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 if (exit $ac_status) && test -s out/conftest2.$ac_objext then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings - $ECHO "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' > out/conftest.exp + $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' > out/conftest.exp $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2 if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then lt_cv_prog_compiler_c_o=yes @@ -9950,7 +10429,7 @@ { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -c -o file.$ac_objext" >&5 $as_echo_n "checking if $compiler supports -c -o file.$ac_objext... " >&6; } -if test "${lt_cv_prog_compiler_c_o+set}" = set; then : +if ${lt_cv_prog_compiler_c_o+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_prog_compiler_c_o=no @@ -9969,16 +10448,16 @@ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:9972: $lt_compile\"" >&5) + (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&5 - echo "$as_me:9976: \$? = $ac_status" >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 if (exit $ac_status) && test -s out/conftest2.$ac_objext then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings - $ECHO "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' > out/conftest.exp + $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' > out/conftest.exp $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2 if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then lt_cv_prog_compiler_c_o=yes @@ -10044,7 +10523,6 @@ hardcode_direct=no hardcode_direct_absolute=no hardcode_libdir_flag_spec= - hardcode_libdir_flag_spec_ld= hardcode_libdir_separator= hardcode_minus_L=no hardcode_shlibpath_var=unsupported @@ -10091,7 +10569,33 @@ esac ld_shlibs=yes + + # On some targets, GNU ld is compatible enough with the native linker + # that we're better off using the native interface for both. + lt_use_gnu_ld_interface=no if test "$with_gnu_ld" = yes; then + case $host_os in + aix*) + # The AIX port of GNU ld has always aspired to compatibility + # with the native linker. However, as the warning in the GNU ld + # block says, versions before 2.19.5* couldn't really create working + # shared libraries, regardless of the interface used. + case `$LD -v 2>&1` in + *\ \(GNU\ Binutils\)\ 2.19.5*) ;; + *\ \(GNU\ Binutils\)\ 2.[2-9]*) ;; + *\ \(GNU\ Binutils\)\ [3-9]*) ;; + *) + lt_use_gnu_ld_interface=yes + ;; + esac + ;; + *) + lt_use_gnu_ld_interface=yes + ;; + esac + fi + + if test "$lt_use_gnu_ld_interface" = yes; then # If archive_cmds runs LD, not CC, wlarc should be empty wlarc='${wl}' @@ -10109,6 +10613,7 @@ fi supports_anon_versioning=no case `$LD -v 2>&1` in + *GNU\ gold*) supports_anon_versioning=yes ;; *\ [01].* | *\ 2.[0-9].* | *\ 2.10.*) ;; # catch versions < 2.11 *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ... *\ 2.11.92.0.12\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ... @@ -10124,11 +10629,12 @@ ld_shlibs=no cat <<_LT_EOF 1>&2 -*** Warning: the GNU linker, at least up to release 2.9.1, is reported +*** Warning: the GNU linker, at least up to release 2.19, is reported *** to be unable to reliably create shared libraries on AIX. *** Therefore, libtool is disabling shared libraries support. If you -*** really care for shared libraries, you may want to modify your PATH -*** so that a non-GNU linker is found, and then restart. +*** really care for shared libraries, you may want to install binutils +*** 2.20 or above, or modify your PATH so that a non-GNU linker is found. +*** You will then need to restart the configuration process. _LT_EOF fi @@ -10164,10 +10670,12 @@ # _LT_TAGVAR(hardcode_libdir_flag_spec, ) is actually meaningless, # as there is no search path for DLLs. hardcode_libdir_flag_spec='-L$libdir' + export_dynamic_flag_spec='${wl}--export-all-symbols' allow_undefined_flag=unsupported always_export_symbols=no enable_shared_with_static_runtimes=yes - export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS][ ]/s/.*[ ]\([^ ]*\)/\1 DATA/'\'' | $SED -e '\''/^[AITW][ ]/s/.*[ ]//'\'' | sort | uniq > $export_symbols' + export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS][ ]/s/.*[ ]\([^ ]*\)/\1 DATA/;s/^.*[ ]__nm__\([^ ]*\)[ ][^ ]*/\1 DATA/;/^I[ ]/d;/^[AITW][ ]/s/.* //'\'' | sort | uniq > $export_symbols' + exclude_expsyms='[_]+GLOBAL_OFFSET_TABLE_|[_]+GLOBAL__[FID]_.*|[_]+head_[A-Za-z0-9_]+_dll|[A-Za-z0-9_]+_dll_iname' if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' @@ -10185,6 +10693,11 @@ fi ;; + haiku*) + archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + link_all_deplibs=yes + ;; + interix[3-9]*) hardcode_direct=no hardcode_shlibpath_var=no @@ -10200,7 +10713,7 @@ archive_expsym_cmds='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' ;; - gnu* | linux* | tpf* | k*bsd*-gnu) + gnu* | linux* | tpf* | k*bsd*-gnu | kopensolaris*-gnu) tmp_diet=no if test "$host_os" = linux-dietlibc; then case $cc_basename in @@ -10210,15 +10723,16 @@ if $LD --help 2>&1 | $EGREP ': supported targets:.* elf' > /dev/null \ && test "$tmp_diet" = no then - tmp_addflag= + tmp_addflag=' $pic_flag' tmp_sharedflag='-shared' case $cc_basename,$host_cpu in pgcc*) # Portland Group C compiler - whole_archive_flag_spec='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $ECHO \"$new_convenience\"` ${wl}--no-whole-archive' + whole_archive_flag_spec='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' tmp_addflag=' $pic_flag' ;; - pgf77* | pgf90* | pgf95*) # Portland Group f77 and f90 compilers - whole_archive_flag_spec='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $ECHO \"$new_convenience\"` ${wl}--no-whole-archive' + pgf77* | pgf90* | pgf95* | pgfortran*) + # Portland Group f77 and f90 compilers + whole_archive_flag_spec='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' tmp_addflag=' $pic_flag -Mnomain' ;; ecc*,ia64* | icc*,ia64*) # Intel C compiler on ia64 tmp_addflag=' -i_dynamic' ;; @@ -10229,13 +10743,17 @@ lf95*) # Lahey Fortran 8.1 whole_archive_flag_spec= tmp_sharedflag='--shared' ;; - xl[cC]*) # IBM XL C 8.0 on PPC (deal with xlf below) + xl[cC]* | bgxl[cC]* | mpixl[cC]*) # IBM XL C 8.0 on PPC (deal with xlf below) tmp_sharedflag='-qmkshrobj' tmp_addflag= ;; + nvcc*) # Cuda Compiler Driver 2.2 + whole_archive_flag_spec='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' + compiler_needs_object=yes + ;; esac case `$CC -V 2>&1 | sed 5q` in *Sun\ C*) # Sun C 5.9 - whole_archive_flag_spec='${wl}--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; $ECHO \"$new_convenience\"` ${wl}--no-whole-archive' + whole_archive_flag_spec='${wl}--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' compiler_needs_object=yes tmp_sharedflag='-G' ;; *Sun\ F*) # Sun Fortran 8.3 @@ -10251,17 +10769,16 @@ fi case $cc_basename in - xlf*) + xlf* | bgf* | bgxlf* | mpixlf*) # IBM XL Fortran 10.1 on PPC cannot create shared libs itself whole_archive_flag_spec='--whole-archive$convenience --no-whole-archive' - hardcode_libdir_flag_spec= - hardcode_libdir_flag_spec_ld='-rpath $libdir' - archive_cmds='$LD -shared $libobjs $deplibs $compiler_flags -soname $soname -o $lib' + hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' + archive_cmds='$LD -shared $libobjs $deplibs $linker_flags -soname $soname -o $lib' if test "x$supports_anon_versioning" = xyes; then archive_expsym_cmds='echo "{ global:" > $output_objdir/$libname.ver~ cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ echo "local: *; };" >> $output_objdir/$libname.ver~ - $LD -shared $libobjs $deplibs $compiler_flags -soname $soname -version-script $output_objdir/$libname.ver -o $lib' + $LD -shared $libobjs $deplibs $linker_flags -soname $soname -version-script $output_objdir/$libname.ver -o $lib' fi ;; esac @@ -10275,8 +10792,8 @@ archive_cmds='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib' wlarc= else - archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' - archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' + archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' fi ;; @@ -10294,8 +10811,8 @@ _LT_EOF elif $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then - archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' - archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' + archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' else ld_shlibs=no fi @@ -10341,8 +10858,8 @@ *) if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then - archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' - archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' + archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' else ld_shlibs=no fi @@ -10382,8 +10899,10 @@ else # If we're using GNU nm, then we don't want the "-C" option. # -C means demangle to AIX nm, but means don't demangle with GNU nm + # Also, AIX nm treats weak defined symbols like other global + # defined symbols, whereas GNU nm marks them as "W". if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then - export_symbols_cmds='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B")) && (substr(\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols' + export_symbols_cmds='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && (substr(\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols' else export_symbols_cmds='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B")) && (substr(\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols' fi @@ -10470,7 +10989,13 @@ allow_undefined_flag='-berok' # Determine the default libpath from the value encoded in an # empty executable. - cat confdefs.h - <<_ACEOF >conftest.$ac_ext + if test "${lt_cv_aix_libpath+set}" = set; then + aix_libpath=$lt_cv_aix_libpath +else + if ${lt_cv_aix_libpath_+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int @@ -10483,25 +11008,32 @@ _ACEOF if ac_fn_c_try_link "$LINENO"; then : -lt_aix_libpath_sed=' - /Import File Strings/,/^$/ { - /^0/ { - s/^0 *\(.*\)$/\1/ - p - } - }' -aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` -# Check for a 64-bit object if we didn't find anything. -if test -z "$aix_libpath"; then - aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` -fi + lt_aix_libpath_sed=' + /Import File Strings/,/^$/ { + /^0/ { + s/^0 *\([^ ]*\) *$/\1/ + p + } + }' + lt_cv_aix_libpath_=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` + # Check for a 64-bit object if we didn't find anything. + if test -z "$lt_cv_aix_libpath_"; then + lt_cv_aix_libpath_=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` + fi fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext -if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi + if test -z "$lt_cv_aix_libpath_"; then + lt_cv_aix_libpath_="/usr/lib:/lib" + fi + +fi + + aix_libpath=$lt_cv_aix_libpath_ +fi hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:'"$aix_libpath" - archive_expsym_cmds='$CC -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then $ECHO "X${wl}${allow_undefined_flag}" | $Xsed; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag" + archive_expsym_cmds='$CC -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then func_echo_all "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag" else if test "$host_cpu" = ia64; then hardcode_libdir_flag_spec='${wl}-R $libdir:/usr/lib:/lib' @@ -10510,7 +11042,13 @@ else # Determine the default libpath from the value encoded in an # empty executable. - cat confdefs.h - <<_ACEOF >conftest.$ac_ext + if test "${lt_cv_aix_libpath+set}" = set; then + aix_libpath=$lt_cv_aix_libpath +else + if ${lt_cv_aix_libpath_+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int @@ -10523,30 +11061,42 @@ _ACEOF if ac_fn_c_try_link "$LINENO"; then : -lt_aix_libpath_sed=' - /Import File Strings/,/^$/ { - /^0/ { - s/^0 *\(.*\)$/\1/ - p - } - }' -aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` -# Check for a 64-bit object if we didn't find anything. -if test -z "$aix_libpath"; then - aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` -fi + lt_aix_libpath_sed=' + /Import File Strings/,/^$/ { + /^0/ { + s/^0 *\([^ ]*\) *$/\1/ + p + } + }' + lt_cv_aix_libpath_=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` + # Check for a 64-bit object if we didn't find anything. + if test -z "$lt_cv_aix_libpath_"; then + lt_cv_aix_libpath_=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` + fi fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext -if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi + if test -z "$lt_cv_aix_libpath_"; then + lt_cv_aix_libpath_="/usr/lib:/lib" + fi + +fi + + aix_libpath=$lt_cv_aix_libpath_ +fi hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:'"$aix_libpath" # Warning - without using the other run time loading flags, # -berok will link without error, but may produce a broken library. no_undefined_flag=' ${wl}-bernotok' allow_undefined_flag=' ${wl}-berok' - # Exported symbols can be pulled into shared objects from archives - whole_archive_flag_spec='$convenience' + if test "$with_gnu_ld" = yes; then + # We only use this code for GNU lds that support --whole-archive. + whole_archive_flag_spec='${wl}--whole-archive$convenience ${wl}--no-whole-archive' + else + # Exported symbols can be pulled into shared objects from archives + whole_archive_flag_spec='$convenience' + fi archive_cmds_need_lc=yes # This is similar to how AIX traditionally builds its shared libraries. archive_expsym_cmds="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname' @@ -10578,20 +11128,64 @@ # Microsoft Visual C++. # hardcode_libdir_flag_spec is actually meaningless, as there is # no search path for DLLs. - hardcode_libdir_flag_spec=' ' - allow_undefined_flag=unsupported - # Tell ltmain to make .lib files, not .a files. - libext=lib - # Tell ltmain to make .dll files, not .so files. - shrext_cmds=".dll" - # FIXME: Setting linknames here is a bad hack. - archive_cmds='$CC -o $lib $libobjs $compiler_flags `$ECHO "X$deplibs" | $Xsed -e '\''s/ -lc$//'\''` -link -dll~linknames=' - # The linker will automatically build a .lib file if we build a DLL. - old_archive_from_new_cmds='true' - # FIXME: Should let the user specify the lib program. - old_archive_cmds='lib -OUT:$oldlib$oldobjs$old_deplibs' - fix_srcfile_path='`cygpath -w "$srcfile"`' - enable_shared_with_static_runtimes=yes + case $cc_basename in + cl*) + # Native MSVC + hardcode_libdir_flag_spec=' ' + allow_undefined_flag=unsupported + always_export_symbols=yes + file_list_spec='@' + # Tell ltmain to make .lib files, not .a files. + libext=lib + # Tell ltmain to make .dll files, not .so files. + shrext_cmds=".dll" + # FIXME: Setting linknames here is a bad hack. + archive_cmds='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-dll~linknames=' + archive_expsym_cmds='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then + sed -n -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' -e '1\\\!p' < $export_symbols > $output_objdir/$soname.exp; + else + sed -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' < $export_symbols > $output_objdir/$soname.exp; + fi~ + $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~ + linknames=' + # The linker will not automatically build a static lib if we build a DLL. + # _LT_TAGVAR(old_archive_from_new_cmds, )='true' + enable_shared_with_static_runtimes=yes + exclude_expsyms='_NULL_IMPORT_DESCRIPTOR|_IMPORT_DESCRIPTOR_.*' + export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS][ ]/s/.*[ ]\([^ ]*\)/\1,DATA/'\'' | $SED -e '\''/^[AITW][ ]/s/.*[ ]//'\'' | sort | uniq > $export_symbols' + # Don't use ranlib + old_postinstall_cmds='chmod 644 $oldlib' + postlink_cmds='lt_outputfile="@OUTPUT@"~ + lt_tool_outputfile="@TOOL_OUTPUT@"~ + case $lt_outputfile in + *.exe|*.EXE) ;; + *) + lt_outputfile="$lt_outputfile.exe" + lt_tool_outputfile="$lt_tool_outputfile.exe" + ;; + esac~ + if test "$MANIFEST_TOOL" != ":" && test -f "$lt_outputfile.manifest"; then + $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1; + $RM "$lt_outputfile.manifest"; + fi' + ;; + *) + # Assume MSVC wrapper + hardcode_libdir_flag_spec=' ' + allow_undefined_flag=unsupported + # Tell ltmain to make .lib files, not .a files. + libext=lib + # Tell ltmain to make .dll files, not .so files. + shrext_cmds=".dll" + # FIXME: Setting linknames here is a bad hack. + archive_cmds='$CC -o $lib $libobjs $compiler_flags `func_echo_all "$deplibs" | $SED '\''s/ -lc$//'\''` -link -dll~linknames=' + # The linker will automatically build a .lib file if we build a DLL. + old_archive_from_new_cmds='true' + # FIXME: Should let the user specify the lib program. + old_archive_cmds='lib -OUT:$oldlib$oldobjs$old_deplibs' + enable_shared_with_static_runtimes=yes + ;; + esac ;; darwin* | rhapsody*) @@ -10601,7 +11195,12 @@ hardcode_direct=no hardcode_automatic=yes hardcode_shlibpath_var=unsupported - whole_archive_flag_spec='' + if test "$lt_cv_ld_force_load" = "yes"; then + whole_archive_flag_spec='`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience ${wl}-force_load,$conv\"; done; func_echo_all \"$new_convenience\"`' + + else + whole_archive_flag_spec='' + fi link_all_deplibs=yes allow_undefined_flag="$_lt_dar_allow_undefined" case $cc_basename in @@ -10609,7 +11208,7 @@ *) _lt_dar_can_shared=$GCC ;; esac if test "$_lt_dar_can_shared" = "yes"; then - output_verbose_link_cmd=echo + output_verbose_link_cmd=func_echo_all archive_cmds="\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod${_lt_dsymutil}" module_cmds="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dsymutil}" archive_expsym_cmds="sed 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring ${_lt_dar_single_mod}${_lt_dar_export_syms}${_lt_dsymutil}" @@ -10627,10 +11226,6 @@ hardcode_shlibpath_var=no ;; - freebsd1*) - ld_shlibs=no - ;; - # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor # support. Future versions do this automatically, but an explicit c++rt0.o # does not break anything, and helps significantly (at the cost of a little @@ -10643,7 +11238,7 @@ ;; # Unfortunately, older versions of FreeBSD 2 do not have this feature. - freebsd2*) + freebsd2.*) archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' hardcode_direct=yes hardcode_minus_L=yes @@ -10652,7 +11247,7 @@ # FreeBSD 3 and greater uses gcc -shared to do shared libraries. freebsd* | dragonfly*) - archive_cmds='$CC -shared -o $lib $libobjs $deplibs $compiler_flags' + archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' hardcode_libdir_flag_spec='-R$libdir' hardcode_direct=yes hardcode_shlibpath_var=no @@ -10660,7 +11255,7 @@ hpux9*) if test "$GCC" = yes; then - archive_cmds='$RM $output_objdir/$soname~$CC -shared -fPIC ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' + archive_cmds='$RM $output_objdir/$soname~$CC -shared $pic_flag ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' else archive_cmds='$RM $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' fi @@ -10675,14 +11270,13 @@ ;; hpux10*) - if test "$GCC" = yes -a "$with_gnu_ld" = no; then - archive_cmds='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' + if test "$GCC" = yes && test "$with_gnu_ld" = no; then + archive_cmds='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' else archive_cmds='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags' fi if test "$with_gnu_ld" = no; then hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir' - hardcode_libdir_flag_spec_ld='+b $libdir' hardcode_libdir_separator=: hardcode_direct=yes hardcode_direct_absolute=yes @@ -10694,16 +11288,16 @@ ;; hpux11*) - if test "$GCC" = yes -a "$with_gnu_ld" = no; then + if test "$GCC" = yes && test "$with_gnu_ld" = no; then case $host_cpu in hppa*64*) archive_cmds='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' ;; ia64*) - archive_cmds='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' + archive_cmds='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' ;; *) - archive_cmds='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' + archive_cmds='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' ;; esac else @@ -10715,7 +11309,46 @@ archive_cmds='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' ;; *) - archive_cmds='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' + + # Older versions of the 11.00 compiler do not understand -b yet + # (HP92453-01 A.11.01.20 doesn't, HP92453-01 B.11.X.35175-35176.GP does) + { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC understands -b" >&5 +$as_echo_n "checking if $CC understands -b... " >&6; } +if ${lt_cv_prog_compiler__b+:} false; then : + $as_echo_n "(cached) " >&6 +else + lt_cv_prog_compiler__b=no + save_LDFLAGS="$LDFLAGS" + LDFLAGS="$LDFLAGS -b" + echo "$lt_simple_link_test_code" > conftest.$ac_ext + if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then + # The linker can only warn and ignore the option if not recognized + # So say no if there are warnings + if test -s conftest.err; then + # Append any errors to the config.log. + cat conftest.err 1>&5 + $ECHO "$_lt_linker_boilerplate" | $SED '/^$/d' > conftest.exp + $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 + if diff conftest.exp conftest.er2 >/dev/null; then + lt_cv_prog_compiler__b=yes + fi + else + lt_cv_prog_compiler__b=yes + fi + fi + $RM -r conftest* + LDFLAGS="$save_LDFLAGS" + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler__b" >&5 +$as_echo "$lt_cv_prog_compiler__b" >&6; } + +if test x"$lt_cv_prog_compiler__b" = xyes; then + archive_cmds='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' +else + archive_cmds='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags' +fi + ;; esac fi @@ -10743,26 +11376,39 @@ irix5* | irix6* | nonstopux*) if test "$GCC" = yes; then - archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "X${wl}-set_version ${wl}$verstring" | $Xsed` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' + archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' # Try to use the -exported_symbol ld option, if it does not # work, assume that -exports_file does not work either and # implicitly export all symbols. - save_LDFLAGS="$LDFLAGS" - LDFLAGS="$LDFLAGS -shared ${wl}-exported_symbol ${wl}foo ${wl}-update_registry ${wl}/dev/null" - cat confdefs.h - <<_ACEOF >conftest.$ac_ext + # This should be the same for all languages, so no per-tag cache variable. + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the $host_os linker accepts -exported_symbol" >&5 +$as_echo_n "checking whether the $host_os linker accepts -exported_symbol... " >&6; } +if ${lt_cv_irix_exported_symbol+:} false; then : + $as_echo_n "(cached) " >&6 +else + save_LDFLAGS="$LDFLAGS" + LDFLAGS="$LDFLAGS -shared ${wl}-exported_symbol ${wl}foo ${wl}-update_registry ${wl}/dev/null" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ -int foo(void) {} +int foo (void) { return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : - archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "X${wl}-set_version ${wl}$verstring" | $Xsed` ${wl}-update_registry ${wl}${output_objdir}/so_locations ${wl}-exports_file ${wl}$export_symbols -o $lib' - + lt_cv_irix_exported_symbol=yes +else + lt_cv_irix_exported_symbol=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext - LDFLAGS="$save_LDFLAGS" + LDFLAGS="$save_LDFLAGS" +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_irix_exported_symbol" >&5 +$as_echo "$lt_cv_irix_exported_symbol" >&6; } + if test "$lt_cv_irix_exported_symbol" = yes; then + archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations ${wl}-exports_file ${wl}$export_symbols -o $lib' + fi else - archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -o $lib' - archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -exports_file $export_symbols -o $lib' + archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' + archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -exports_file $export_symbols -o $lib' fi archive_cmds_need_lc='no' hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' @@ -10824,17 +11470,17 @@ hardcode_libdir_flag_spec='-L$libdir' hardcode_minus_L=yes allow_undefined_flag=unsupported - archive_cmds='$ECHO "LIBRARY $libname INITINSTANCE" > $output_objdir/$libname.def~$ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~$ECHO DATA >> $output_objdir/$libname.def~$ECHO " SINGLE NONSHARED" >> $output_objdir/$libname.def~$ECHO EXPORTS >> $output_objdir/$libname.def~emxexp $libobjs >> $output_objdir/$libname.def~$CC -Zdll -Zcrtdll -o $lib $libobjs $deplibs $compiler_flags $output_objdir/$libname.def' + archive_cmds='$ECHO "LIBRARY $libname INITINSTANCE" > $output_objdir/$libname.def~$ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~echo DATA >> $output_objdir/$libname.def~echo " SINGLE NONSHARED" >> $output_objdir/$libname.def~echo EXPORTS >> $output_objdir/$libname.def~emxexp $libobjs >> $output_objdir/$libname.def~$CC -Zdll -Zcrtdll -o $lib $libobjs $deplibs $compiler_flags $output_objdir/$libname.def' old_archive_from_new_cmds='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def' ;; osf3*) if test "$GCC" = yes; then allow_undefined_flag=' ${wl}-expect_unresolved ${wl}\*' - archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "X${wl}-set_version ${wl}$verstring" | $Xsed` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' + archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' else allow_undefined_flag=' -expect_unresolved \*' - archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -o $lib' + archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' fi archive_cmds_need_lc='no' hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' @@ -10844,13 +11490,13 @@ osf4* | osf5*) # as osf3* with the addition of -msym flag if test "$GCC" = yes; then allow_undefined_flag=' ${wl}-expect_unresolved ${wl}\*' - archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "X${wl}-set_version ${wl}$verstring" | $Xsed` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' + archive_cmds='$CC -shared${allow_undefined_flag} $pic_flag $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' else allow_undefined_flag=' -expect_unresolved \*' - archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags -msym -soname $soname `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -o $lib' + archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags -msym -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' archive_expsym_cmds='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done; printf "%s\\n" "-hidden">> $lib.exp~ - $CC -shared${allow_undefined_flag} ${wl}-input ${wl}$lib.exp $compiler_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -o $lib~$RM $lib.exp' + $CC -shared${allow_undefined_flag} ${wl}-input ${wl}$lib.exp $compiler_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && $ECHO "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib~$RM $lib.exp' # Both c and cxx compiler support -rpath directly hardcode_libdir_flag_spec='-rpath $libdir' @@ -10863,9 +11509,9 @@ no_undefined_flag=' -z defs' if test "$GCC" = yes; then wlarc='${wl}' - archive_cmds='$CC -shared ${wl}-z ${wl}text ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' + archive_cmds='$CC -shared $pic_flag ${wl}-z ${wl}text ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ - $CC -shared ${wl}-z ${wl}text ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp' + $CC -shared $pic_flag ${wl}-z ${wl}text ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp' else case `$CC -V 2>&1` in *"Compilers 5.0"*) @@ -11053,44 +11699,50 @@ # to ld, don't add -lc before -lgcc. { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether -lc should be explicitly linked in" >&5 $as_echo_n "checking whether -lc should be explicitly linked in... " >&6; } - $RM conftest* - echo "$lt_simple_compile_test_code" > conftest.$ac_ext +if ${lt_cv_archive_cmds_need_lc+:} false; then : + $as_echo_n "(cached) " >&6 +else + $RM conftest* + echo "$lt_simple_compile_test_code" > conftest.$ac_ext - if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 (eval $ac_compile) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } 2>conftest.err; then - soname=conftest - lib=conftest - libobjs=conftest.$ac_objext - deplibs= - wl=$lt_prog_compiler_wl - pic_flag=$lt_prog_compiler_pic - compiler_flags=-v - linker_flags=-v - verstring= - output_objdir=. - libname=conftest - lt_save_allow_undefined_flag=$allow_undefined_flag - allow_undefined_flag= - if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$archive_cmds 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1\""; } >&5 + soname=conftest + lib=conftest + libobjs=conftest.$ac_objext + deplibs= + wl=$lt_prog_compiler_wl + pic_flag=$lt_prog_compiler_pic + compiler_flags=-v + linker_flags=-v + verstring= + output_objdir=. + libname=conftest + lt_save_allow_undefined_flag=$allow_undefined_flag + allow_undefined_flag= + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$archive_cmds 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1\""; } >&5 (eval $archive_cmds 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } - then - archive_cmds_need_lc=no - else - archive_cmds_need_lc=yes - fi - allow_undefined_flag=$lt_save_allow_undefined_flag - else - cat conftest.err 1>&5 - fi - $RM conftest* - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $archive_cmds_need_lc" >&5 -$as_echo "$archive_cmds_need_lc" >&6; } + then + lt_cv_archive_cmds_need_lc=no + else + lt_cv_archive_cmds_need_lc=yes + fi + allow_undefined_flag=$lt_save_allow_undefined_flag + else + cat conftest.err 1>&5 + fi + $RM conftest* + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_archive_cmds_need_lc" >&5 +$as_echo "$lt_cv_archive_cmds_need_lc" >&6; } + archive_cmds_need_lc=$lt_cv_archive_cmds_need_lc ;; esac fi @@ -11248,11 +11900,6 @@ - - - - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking dynamic linker characteristics" >&5 $as_echo_n "checking dynamic linker characteristics... " >&6; } @@ -11261,16 +11908,23 @@ darwin*) lt_awk_arg="/^libraries:/,/LR/" ;; *) lt_awk_arg="/^libraries:/" ;; esac - lt_search_path_spec=`$CC -print-search-dirs | awk $lt_awk_arg | $SED -e "s/^libraries://" -e "s,=/,/,g"` - if $ECHO "$lt_search_path_spec" | $GREP ';' >/dev/null ; then + case $host_os in + mingw* | cegcc*) lt_sed_strip_eq="s,=\([A-Za-z]:\),\1,g" ;; + *) lt_sed_strip_eq="s,=/,/,g" ;; + esac + lt_search_path_spec=`$CC -print-search-dirs | awk $lt_awk_arg | $SED -e "s/^libraries://" -e $lt_sed_strip_eq` + case $lt_search_path_spec in + *\;*) # if the path contains ";" then we assume it to be the separator # otherwise default to the standard path separator (i.e. ":") - it is # assumed that no part of a normal pathname contains ";" but that should # okay in the real world where ";" in dirpaths is itself problematic. - lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED -e 's/;/ /g'` - else - lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` - fi + lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED 's/;/ /g'` + ;; + *) + lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED "s/$PATH_SEPARATOR/ /g"` + ;; + esac # Ok, now we have the path, separated by spaces, we can step through it # and add multilib dir if necessary. lt_tmp_lt_search_path_spec= @@ -11283,7 +11937,7 @@ lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path" fi done - lt_search_path_spec=`$ECHO $lt_tmp_lt_search_path_spec | awk ' + lt_search_path_spec=`$ECHO "$lt_tmp_lt_search_path_spec" | awk ' BEGIN {RS=" "; FS="/|\n";} { lt_foo=""; lt_count=0; @@ -11303,7 +11957,13 @@ if (lt_foo != "") { lt_freq[lt_foo]++; } if (lt_freq[lt_foo] == 1) { print lt_foo; } }'` - sys_lib_search_path_spec=`$ECHO $lt_search_path_spec` + # AWK program above erroneously prepends '/' to C:/dos/paths + # for these hosts. + case $host_os in + mingw* | cegcc*) lt_search_path_spec=`$ECHO "$lt_search_path_spec" |\ + $SED 's,/\([A-Za-z]:\),\1,g'` ;; + esac + sys_lib_search_path_spec=`$ECHO "$lt_search_path_spec" | $lt_NL2SP` else sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib" fi @@ -11329,7 +11989,7 @@ case $host_os in aix3*) - version_type=linux + version_type=linux # correct to gnu/linux during the next big refactor library_names_spec='${libname}${release}${shared_ext}$versuffix $libname.a' shlibpath_var=LIBPATH @@ -11338,7 +11998,7 @@ ;; aix[4-9]*) - version_type=linux + version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no hardcode_into_libs=yes @@ -11391,7 +12051,7 @@ m68k) library_names_spec='$libname.ixlibrary $libname.a' # Create ${libname}_ixlibrary.a entries in /sys/libs. - finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`$ECHO "X$lib" | $Xsed -e '\''s%^.*/\([^/]*\)\.ixlibrary$%\1%'\''`; test $RM /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done' + finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`func_echo_all "$lib" | $SED '\''s%^.*/\([^/]*\)\.ixlibrary$%\1%'\''`; test $RM /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done' ;; esac ;; @@ -11403,7 +12063,7 @@ ;; bsdi[45]*) - version_type=linux + version_type=linux # correct to gnu/linux during the next big refactor need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' @@ -11422,8 +12082,9 @@ need_version=no need_lib_prefix=no - case $GCC,$host_os in - yes,cygwin* | yes,mingw* | yes,pw32* | yes,cegcc*) + case $GCC,$cc_basename in + yes,*) + # gcc library_names_spec='$libname.dll.a' # DLL is installed to $(libdir)/../bin by postinstall_cmds postinstall_cmds='base_file=`basename \${file}`~ @@ -11444,36 +12105,83 @@ cygwin*) # Cygwin DLLs use 'cyg' prefix rather than 'lib' soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' - sys_lib_search_path_spec="/usr/lib /lib/w32api /lib /usr/local/lib" + + sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/lib/w32api" ;; mingw* | cegcc*) # MinGW DLLs use traditional 'lib' prefix soname_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' - sys_lib_search_path_spec=`$CC -print-search-dirs | $GREP "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"` - if $ECHO "$sys_lib_search_path_spec" | $GREP ';[c-zC-Z]:/' >/dev/null; then - # It is most probably a Windows format PATH printed by - # mingw gcc, but we are running on Cygwin. Gcc prints its search - # path with ; separators, and with drive letters. We can handle the - # drive letters (cygwin fileutils understands them), so leave them, - # especially as we might pass files found there to a mingw objdump, - # which wouldn't understand a cygwinified path. Ahh. - sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'` - else - sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` - fi ;; pw32*) # pw32 DLLs use 'pw' prefix rather than 'lib' library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' ;; esac + dynamic_linker='Win32 ld.exe' + ;; + + *,cl*) + # Native MSVC + libname_spec='$name' + soname_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' + library_names_spec='${libname}.dll.lib' + + case $build_os in + mingw*) + sys_lib_search_path_spec= + lt_save_ifs=$IFS + IFS=';' + for lt_path in $LIB + do + IFS=$lt_save_ifs + # Let DOS variable expansion print the short 8.3 style file name. + lt_path=`cd "$lt_path" 2>/dev/null && cmd //C "for %i in (".") do @echo %~si"` + sys_lib_search_path_spec="$sys_lib_search_path_spec $lt_path" + done + IFS=$lt_save_ifs + # Convert to MSYS style. + sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | sed -e 's|\\\\|/|g' -e 's| \\([a-zA-Z]\\):| /\\1|g' -e 's|^ ||'` + ;; + cygwin*) + # Convert to unix form, then to dos form, then back to unix form + # but this time dos style (no spaces!) so that the unix form looks + # like /cygdrive/c/PROGRA~1:/cygdr... + sys_lib_search_path_spec=`cygpath --path --unix "$LIB"` + sys_lib_search_path_spec=`cygpath --path --dos "$sys_lib_search_path_spec" 2>/dev/null` + sys_lib_search_path_spec=`cygpath --path --unix "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` + ;; + *) + sys_lib_search_path_spec="$LIB" + if $ECHO "$sys_lib_search_path_spec" | $GREP ';[c-zC-Z]:/' >/dev/null; then + # It is most probably a Windows format PATH. + sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'` + else + sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` + fi + # FIXME: find the short name or the path components, as spaces are + # common. (e.g. "Program Files" -> "PROGRA~1") + ;; + esac + + # DLL is installed to $(libdir)/../bin by postinstall_cmds + postinstall_cmds='base_file=`basename \${file}`~ + dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i; echo \$dlname'\''`~ + dldir=$destdir/`dirname \$dlpath`~ + test -d \$dldir || mkdir -p \$dldir~ + $install_prog $dir/$dlname \$dldir/$dlname' + postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ + dlpath=$dir/\$dldll~ + $RM \$dlpath' + shlibpath_overrides_runpath=yes + dynamic_linker='Win32 link.exe' ;; *) + # Assume MSVC wrapper library_names_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext} $libname.lib' + dynamic_linker='Win32 ld.exe' ;; esac - dynamic_linker='Win32 ld.exe' # FIXME: first we should search . and the directory the executable is in shlibpath_var=PATH ;; @@ -11494,7 +12202,7 @@ ;; dgux*) - version_type=linux + version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname$shared_ext' @@ -11502,10 +12210,6 @@ shlibpath_var=LD_LIBRARY_PATH ;; -freebsd1*) - dynamic_linker=no - ;; - freebsd* | dragonfly*) # DragonFly does not have aout. When/if they implement a new # versioning mechanism, adjust this. @@ -11513,7 +12217,7 @@ objformat=`/usr/bin/objformat` else case $host_os in - freebsd[123]*) objformat=aout ;; + freebsd[23].*) objformat=aout ;; *) objformat=elf ;; esac fi @@ -11531,7 +12235,7 @@ esac shlibpath_var=LD_LIBRARY_PATH case $host_os in - freebsd2*) + freebsd2.*) shlibpath_overrides_runpath=yes ;; freebsd3.[01]* | freebsdelf3.[01]*) @@ -11551,12 +12255,26 @@ ;; gnu*) - version_type=linux + version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=no + hardcode_into_libs=yes + ;; + +haiku*) + version_type=linux # correct to gnu/linux during the next big refactor + need_lib_prefix=no + need_version=no + dynamic_linker="$host_os runtime_loader" + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LIBRARY_PATH + shlibpath_overrides_runpath=yes + sys_lib_dlsearch_path_spec='/boot/home/config/lib /boot/common/lib /boot/system/lib' hardcode_into_libs=yes ;; @@ -11602,12 +12320,14 @@ soname_spec='${libname}${release}${shared_ext}$major' ;; esac - # HP-UX runs *really* slowly unless shared libraries are mode 555. + # HP-UX runs *really* slowly unless shared libraries are mode 555, ... postinstall_cmds='chmod 555 $lib' + # or fails outright, so override atomically: + install_override_mode=555 ;; interix[3-9]*) - version_type=linux + version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' @@ -11623,7 +12343,7 @@ nonstopux*) version_type=nonstopux ;; *) if test "$lt_cv_prog_gnu_ld" = yes; then - version_type=linux + version_type=linux # correct to gnu/linux during the next big refactor else version_type=irix fi ;; @@ -11660,9 +12380,9 @@ dynamic_linker=no ;; -# This must be Linux ELF. -linux* | k*bsd*-gnu) - version_type=linux +# This must be glibc/ELF. +linux* | k*bsd*-gnu | kopensolaris*-gnu) + version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' @@ -11670,12 +12390,17 @@ finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no + # Some binutils ld are patched to set DT_RUNPATH - save_LDFLAGS=$LDFLAGS - save_libdir=$libdir - eval "libdir=/foo; wl=\"$lt_prog_compiler_wl\"; \ - LDFLAGS=\"\$LDFLAGS $hardcode_libdir_flag_spec\"" - cat confdefs.h - <<_ACEOF >conftest.$ac_ext + if ${lt_cv_shlibpath_overrides_runpath+:} false; then : + $as_echo_n "(cached) " >&6 +else + lt_cv_shlibpath_overrides_runpath=no + save_LDFLAGS=$LDFLAGS + save_libdir=$libdir + eval "libdir=/foo; wl=\"$lt_prog_compiler_wl\"; \ + LDFLAGS=\"\$LDFLAGS $hardcode_libdir_flag_spec\"" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int @@ -11688,13 +12413,17 @@ _ACEOF if ac_fn_c_try_link "$LINENO"; then : if ($OBJDUMP -p conftest$ac_exeext) 2>/dev/null | grep "RUNPATH.*$libdir" >/dev/null; then : - shlibpath_overrides_runpath=yes + lt_cv_shlibpath_overrides_runpath=yes fi fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext - LDFLAGS=$save_LDFLAGS - libdir=$save_libdir + LDFLAGS=$save_LDFLAGS + libdir=$save_libdir + +fi + + shlibpath_overrides_runpath=$lt_cv_shlibpath_overrides_runpath # This implies no fast_install, which is unacceptable. # Some rework will be needed to allow for fast_install @@ -11703,7 +12432,7 @@ # Append ld.so.conf contents to the search path if test -f /etc/ld.so.conf; then - lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \$2)); skip = 1; } { if (!skip) print \$0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;/^[ ]*hwcap[ ]/d;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;/^$/d' | tr '\n' ' '` + lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \$2)); skip = 1; } { if (!skip) print \$0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;/^[ ]*hwcap[ ]/d;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;s/"//g;/^$/d' | tr '\n' ' '` sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra" fi @@ -11735,7 +12464,7 @@ ;; newsos6) - version_type=linux + version_type=linux # correct to gnu/linux during the next big refactor library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes @@ -11804,7 +12533,7 @@ ;; solaris*) - version_type=linux + version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' @@ -11829,7 +12558,7 @@ ;; sysv4 | sysv4.3*) - version_type=linux + version_type=linux # correct to gnu/linux during the next big refactor library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH @@ -11853,7 +12582,7 @@ sysv4*MP*) if test -d /usr/nec ;then - version_type=linux + version_type=linux # correct to gnu/linux during the next big refactor library_names_spec='$libname${shared_ext}.$versuffix $libname${shared_ext}.$major $libname${shared_ext}' soname_spec='$libname${shared_ext}.$major' shlibpath_var=LD_LIBRARY_PATH @@ -11884,7 +12613,7 @@ tpf*) # TPF is a cross-target only. Preferred cross-host = GNU/Linux. - version_type=linux + version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' @@ -11894,7 +12623,7 @@ ;; uts4*) - version_type=linux + version_type=linux # correct to gnu/linux during the next big refactor library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH @@ -12006,6 +12735,11 @@ + + + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to hardcode library paths into programs" >&5 $as_echo_n "checking how to hardcode library paths into programs... " >&6; } hardcode_action= @@ -12078,7 +12812,7 @@ # if libdl is installed we need to link against it { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dlopen in -ldl" >&5 $as_echo_n "checking for dlopen in -ldl... " >&6; } -if test "${ac_cv_lib_dl_dlopen+set}" = set; then : +if ${ac_cv_lib_dl_dlopen+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS @@ -12112,7 +12846,7 @@ fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dl_dlopen" >&5 $as_echo "$ac_cv_lib_dl_dlopen" >&6; } -if test "x$ac_cv_lib_dl_dlopen" = x""yes; then : +if test "x$ac_cv_lib_dl_dlopen" = xyes; then : lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl" else @@ -12126,12 +12860,12 @@ *) ac_fn_c_check_func "$LINENO" "shl_load" "ac_cv_func_shl_load" -if test "x$ac_cv_func_shl_load" = x""yes; then : +if test "x$ac_cv_func_shl_load" = xyes; then : lt_cv_dlopen="shl_load" else { $as_echo "$as_me:${as_lineno-$LINENO}: checking for shl_load in -ldld" >&5 $as_echo_n "checking for shl_load in -ldld... " >&6; } -if test "${ac_cv_lib_dld_shl_load+set}" = set; then : +if ${ac_cv_lib_dld_shl_load+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS @@ -12165,16 +12899,16 @@ fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dld_shl_load" >&5 $as_echo "$ac_cv_lib_dld_shl_load" >&6; } -if test "x$ac_cv_lib_dld_shl_load" = x""yes; then : +if test "x$ac_cv_lib_dld_shl_load" = xyes; then : lt_cv_dlopen="shl_load" lt_cv_dlopen_libs="-ldld" else ac_fn_c_check_func "$LINENO" "dlopen" "ac_cv_func_dlopen" -if test "x$ac_cv_func_dlopen" = x""yes; then : +if test "x$ac_cv_func_dlopen" = xyes; then : lt_cv_dlopen="dlopen" else { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dlopen in -ldl" >&5 $as_echo_n "checking for dlopen in -ldl... " >&6; } -if test "${ac_cv_lib_dl_dlopen+set}" = set; then : +if ${ac_cv_lib_dl_dlopen+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS @@ -12208,12 +12942,12 @@ fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dl_dlopen" >&5 $as_echo "$ac_cv_lib_dl_dlopen" >&6; } -if test "x$ac_cv_lib_dl_dlopen" = x""yes; then : +if test "x$ac_cv_lib_dl_dlopen" = xyes; then : lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl" else { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dlopen in -lsvld" >&5 $as_echo_n "checking for dlopen in -lsvld... " >&6; } -if test "${ac_cv_lib_svld_dlopen+set}" = set; then : +if ${ac_cv_lib_svld_dlopen+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS @@ -12247,12 +12981,12 @@ fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_svld_dlopen" >&5 $as_echo "$ac_cv_lib_svld_dlopen" >&6; } -if test "x$ac_cv_lib_svld_dlopen" = x""yes; then : +if test "x$ac_cv_lib_svld_dlopen" = xyes; then : lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-lsvld" else { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dld_link in -ldld" >&5 $as_echo_n "checking for dld_link in -ldld... " >&6; } -if test "${ac_cv_lib_dld_dld_link+set}" = set; then : +if ${ac_cv_lib_dld_dld_link+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS @@ -12286,7 +13020,7 @@ fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dld_dld_link" >&5 $as_echo "$ac_cv_lib_dld_dld_link" >&6; } -if test "x$ac_cv_lib_dld_dld_link" = x""yes; then : +if test "x$ac_cv_lib_dld_dld_link" = xyes; then : lt_cv_dlopen="dld_link" lt_cv_dlopen_libs="-ldld" fi @@ -12327,7 +13061,7 @@ { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether a program can dlopen itself" >&5 $as_echo_n "checking whether a program can dlopen itself... " >&6; } -if test "${lt_cv_dlopen_self+set}" = set; then : +if ${lt_cv_dlopen_self+:} false; then : $as_echo_n "(cached) " >&6 else if test "$cross_compiling" = yes; then : @@ -12336,7 +13070,7 @@ lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<_LT_EOF -#line 12339 "configure" +#line $LINENO "configure" #include "confdefs.h" #if HAVE_DLFCN_H @@ -12377,7 +13111,13 @@ # endif #endif -void fnord() { int i=42;} +/* When -fvisbility=hidden is used, assume the code has been annotated + correspondingly for the symbols needed. */ +#if defined(__GNUC__) && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3)) +int fnord () __attribute__((visibility("default"))); +#endif + +int fnord () { return 42; } int main () { void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW); @@ -12386,7 +13126,11 @@ if (self) { if (dlsym (self,"fnord")) status = $lt_dlno_uscore; - else if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore; + else + { + if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore; + else puts (dlerror ()); + } /* dlclose (self); */ } else @@ -12423,7 +13167,7 @@ wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $lt_prog_compiler_static\" { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether a statically linked program can dlopen itself" >&5 $as_echo_n "checking whether a statically linked program can dlopen itself... " >&6; } -if test "${lt_cv_dlopen_self_static+set}" = set; then : +if ${lt_cv_dlopen_self_static+:} false; then : $as_echo_n "(cached) " >&6 else if test "$cross_compiling" = yes; then : @@ -12432,7 +13176,7 @@ lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<_LT_EOF -#line 12435 "configure" +#line $LINENO "configure" #include "confdefs.h" #if HAVE_DLFCN_H @@ -12473,7 +13217,13 @@ # endif #endif -void fnord() { int i=42;} +/* When -fvisbility=hidden is used, assume the code has been annotated + correspondingly for the symbols needed. */ +#if defined(__GNUC__) && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3)) +int fnord () __attribute__((visibility("default"))); +#endif + +int fnord () { return 42; } int main () { void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW); @@ -12482,7 +13232,11 @@ if (self) { if (dlsym (self,"fnord")) status = $lt_dlno_uscore; - else if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore; + else + { + if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore; + else puts (dlerror ()); + } /* dlclose (self); */ } else @@ -12639,23 +13393,161 @@ CC="$lt_save_CC" - -ac_ext=cpp + if test -n "$CXX" && ( test "X$CXX" != "Xno" && + ( (test "X$CXX" = "Xg++" && `g++ -v >/dev/null 2>&1` ) || + (test "X$CXX" != "Xg++"))) ; then + ac_ext=cpp ac_cpp='$CXXCPP $CPPFLAGS' ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_cxx_compiler_gnu +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to run the C++ preprocessor" >&5 +$as_echo_n "checking how to run the C++ preprocessor... " >&6; } +if test -z "$CXXCPP"; then + if ${ac_cv_prog_CXXCPP+:} false; then : + $as_echo_n "(cached) " >&6 +else + # Double quotes because CXXCPP needs to be expanded + for CXXCPP in "$CXX -E" "/lib/cpp" + do + ac_preproc_ok=false +for ac_cxx_preproc_warn_flag in '' yes +do + # Use a header file that comes with gcc, so configuring glibc + # with a fresh cross-compiler works. + # Prefer to if __STDC__ is defined, since + # exists even on freestanding compilers. + # On the NeXT, cc -E runs the code through the compiler's parser, + # not just through cpp. "Syntax error" is here to catch this case. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#ifdef __STDC__ +# include +#else +# include +#endif + Syntax error +_ACEOF +if ac_fn_cxx_try_cpp "$LINENO"; then : -archive_cmds_need_lc_CXX=no -allow_undefined_flag_CXX= -always_export_symbols_CXX=no +else + # Broken: fails on valid input. +continue +fi +rm -f conftest.err conftest.i conftest.$ac_ext + + # OK, works on sane cases. Now check whether nonexistent headers + # can be detected and how. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +_ACEOF +if ac_fn_cxx_try_cpp "$LINENO"; then : + # Broken: success on invalid input. +continue +else + # Passes both tests. +ac_preproc_ok=: +break +fi +rm -f conftest.err conftest.i conftest.$ac_ext + +done +# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. +rm -f conftest.i conftest.err conftest.$ac_ext +if $ac_preproc_ok; then : + break +fi + + done + ac_cv_prog_CXXCPP=$CXXCPP + +fi + CXXCPP=$ac_cv_prog_CXXCPP +else + ac_cv_prog_CXXCPP=$CXXCPP +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $CXXCPP" >&5 +$as_echo "$CXXCPP" >&6; } +ac_preproc_ok=false +for ac_cxx_preproc_warn_flag in '' yes +do + # Use a header file that comes with gcc, so configuring glibc + # with a fresh cross-compiler works. + # Prefer to if __STDC__ is defined, since + # exists even on freestanding compilers. + # On the NeXT, cc -E runs the code through the compiler's parser, + # not just through cpp. "Syntax error" is here to catch this case. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#ifdef __STDC__ +# include +#else +# include +#endif + Syntax error +_ACEOF +if ac_fn_cxx_try_cpp "$LINENO"; then : + +else + # Broken: fails on valid input. +continue +fi +rm -f conftest.err conftest.i conftest.$ac_ext + + # OK, works on sane cases. Now check whether nonexistent headers + # can be detected and how. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +_ACEOF +if ac_fn_cxx_try_cpp "$LINENO"; then : + # Broken: success on invalid input. +continue +else + # Passes both tests. +ac_preproc_ok=: +break +fi +rm -f conftest.err conftest.i conftest.$ac_ext + +done +# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. +rm -f conftest.i conftest.err conftest.$ac_ext +if $ac_preproc_ok; then : + +else + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "C++ preprocessor \"$CXXCPP\" fails sanity check +See \`config.log' for more details" "$LINENO" 5; } +fi + +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + +else + _lt_caught_CXX_error=yes +fi + +ac_ext=cpp +ac_cpp='$CXXCPP $CPPFLAGS' +ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_cxx_compiler_gnu + +archive_cmds_need_lc_CXX=no +allow_undefined_flag_CXX= +always_export_symbols_CXX=no archive_expsym_cmds_CXX= compiler_needs_object_CXX=no export_dynamic_flag_spec_CXX= hardcode_direct_CXX=no hardcode_direct_absolute_CXX=no hardcode_libdir_flag_spec_CXX= -hardcode_libdir_flag_spec_ld_CXX= hardcode_libdir_separator_CXX= hardcode_minus_L_CXX=no hardcode_shlibpath_var_CXX=unsupported @@ -12665,6 +13557,8 @@ module_expsym_cmds_CXX= link_all_deplibs_CXX=unknown old_archive_cmds_CXX=$old_archive_cmds +reload_flag_CXX=$reload_flag +reload_cmds_CXX=$reload_cmds no_undefined_flag_CXX= whole_archive_flag_spec_CXX= enable_shared_with_static_runtimes_CXX=no @@ -12720,6 +13614,7 @@ # Allow CC to be a program name with arguments. lt_save_CC=$CC + lt_save_CFLAGS=$CFLAGS lt_save_LD=$LD lt_save_GCC=$GCC GCC=$GXX @@ -12737,6 +13632,7 @@ fi test -z "${LDCXX+set}" || LD=$LDCXX CC=${CXX-"c++"} + CFLAGS=$CXXFLAGS compiler=$CC compiler_CXX=$CC for cc_temp in $compiler""; do @@ -12747,7 +13643,7 @@ *) break;; esac done -cc_basename=`$ECHO "X$cc_temp" | $Xsed -e 's%.*/%%' -e "s%^$host_alias-%%"` +cc_basename=`$ECHO "$cc_temp" | $SED "s%.*/%%; s%^$host_alias-%%"` if test -n "$compiler"; then @@ -12810,7 +13706,7 @@ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for non-GNU ld" >&5 $as_echo_n "checking for non-GNU ld... " >&6; } fi -if test "${lt_cv_path_LD+set}" = set; then : +if ${lt_cv_path_LD+:} false; then : $as_echo_n "(cached) " >&6 else if test -z "$LD"; then @@ -12847,10 +13743,10 @@ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi -test -z "$LD" && as_fn_error "no acceptable ld found in \$PATH" "$LINENO" 5 +test -z "$LD" && as_fn_error $? "no acceptable ld found in \$PATH" "$LINENO" 5 { $as_echo "$as_me:${as_lineno-$LINENO}: checking if the linker ($LD) is GNU ld" >&5 $as_echo_n "checking if the linker ($LD) is GNU ld... " >&6; } -if test "${lt_cv_prog_gnu_ld+set}" = set; then : +if ${lt_cv_prog_gnu_ld+:} false; then : $as_echo_n "(cached) " >&6 else # I'd rather use --version here, but apparently some GNU lds only accept -v. @@ -12876,8 +13772,8 @@ # Check if GNU C++ uses GNU ld as the underlying linker, since the # archiving commands below assume that GNU ld is being used. if test "$with_gnu_ld" = yes; then - archive_cmds_CXX='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib' - archive_expsym_cmds_CXX='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' + archive_cmds_CXX='$CC $pic_flag -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib' + archive_expsym_cmds_CXX='$CC $pic_flag -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' hardcode_libdir_flag_spec_CXX='${wl}-rpath ${wl}$libdir' export_dynamic_flag_spec_CXX='${wl}--export-dynamic' @@ -12909,7 +13805,7 @@ # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. - output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "\-L"' + output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"' else GXX=no @@ -13019,7 +13915,13 @@ allow_undefined_flag_CXX='-berok' # Determine the default libpath from the value encoded in an empty # executable. - cat confdefs.h - <<_ACEOF >conftest.$ac_ext + if test "${lt_cv_aix_libpath+set}" = set; then + aix_libpath=$lt_cv_aix_libpath +else + if ${lt_cv_aix_libpath__CXX+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int @@ -13032,26 +13934,33 @@ _ACEOF if ac_fn_cxx_try_link "$LINENO"; then : -lt_aix_libpath_sed=' - /Import File Strings/,/^$/ { - /^0/ { - s/^0 *\(.*\)$/\1/ - p - } - }' -aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` -# Check for a 64-bit object if we didn't find anything. -if test -z "$aix_libpath"; then - aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` -fi + lt_aix_libpath_sed=' + /Import File Strings/,/^$/ { + /^0/ { + s/^0 *\([^ ]*\) *$/\1/ + p + } + }' + lt_cv_aix_libpath__CXX=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` + # Check for a 64-bit object if we didn't find anything. + if test -z "$lt_cv_aix_libpath__CXX"; then + lt_cv_aix_libpath__CXX=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` + fi fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext -if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi + if test -z "$lt_cv_aix_libpath__CXX"; then + lt_cv_aix_libpath__CXX="/usr/lib:/lib" + fi + +fi + + aix_libpath=$lt_cv_aix_libpath__CXX +fi hardcode_libdir_flag_spec_CXX='${wl}-blibpath:$libdir:'"$aix_libpath" - archive_expsym_cmds_CXX='$CC -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then $ECHO "X${wl}${allow_undefined_flag}" | $Xsed; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag" + archive_expsym_cmds_CXX='$CC -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then func_echo_all "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag" else if test "$host_cpu" = ia64; then hardcode_libdir_flag_spec_CXX='${wl}-R $libdir:/usr/lib:/lib' @@ -13060,7 +13969,13 @@ else # Determine the default libpath from the value encoded in an # empty executable. - cat confdefs.h - <<_ACEOF >conftest.$ac_ext + if test "${lt_cv_aix_libpath+set}" = set; then + aix_libpath=$lt_cv_aix_libpath +else + if ${lt_cv_aix_libpath__CXX+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int @@ -13073,30 +13988,42 @@ _ACEOF if ac_fn_cxx_try_link "$LINENO"; then : -lt_aix_libpath_sed=' - /Import File Strings/,/^$/ { - /^0/ { - s/^0 *\(.*\)$/\1/ - p - } - }' -aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` -# Check for a 64-bit object if we didn't find anything. -if test -z "$aix_libpath"; then - aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` -fi + lt_aix_libpath_sed=' + /Import File Strings/,/^$/ { + /^0/ { + s/^0 *\([^ ]*\) *$/\1/ + p + } + }' + lt_cv_aix_libpath__CXX=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` + # Check for a 64-bit object if we didn't find anything. + if test -z "$lt_cv_aix_libpath__CXX"; then + lt_cv_aix_libpath__CXX=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` + fi fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext -if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi + if test -z "$lt_cv_aix_libpath__CXX"; then + lt_cv_aix_libpath__CXX="/usr/lib:/lib" + fi + +fi + + aix_libpath=$lt_cv_aix_libpath__CXX +fi hardcode_libdir_flag_spec_CXX='${wl}-blibpath:$libdir:'"$aix_libpath" # Warning - without using the other run time loading flags, # -berok will link without error, but may produce a broken library. no_undefined_flag_CXX=' ${wl}-bernotok' allow_undefined_flag_CXX=' ${wl}-berok' - # Exported symbols can be pulled into shared objects from archives - whole_archive_flag_spec_CXX='$convenience' + if test "$with_gnu_ld" = yes; then + # We only use this code for GNU lds that support --whole-archive. + whole_archive_flag_spec_CXX='${wl}--whole-archive$convenience ${wl}--no-whole-archive' + else + # Exported symbols can be pulled into shared objects from archives + whole_archive_flag_spec_CXX='$convenience' + fi archive_cmds_need_lc_CXX=yes # This is similar to how AIX traditionally builds its shared # libraries. @@ -13126,28 +14053,75 @@ ;; cygwin* | mingw* | pw32* | cegcc*) - # _LT_TAGVAR(hardcode_libdir_flag_spec, CXX) is actually meaningless, - # as there is no search path for DLLs. - hardcode_libdir_flag_spec_CXX='-L$libdir' - allow_undefined_flag_CXX=unsupported - always_export_symbols_CXX=no - enable_shared_with_static_runtimes_CXX=yes - - if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then - archive_cmds_CXX='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' - # If the export-symbols file already is a .def file (1st line - # is EXPORTS), use it as is; otherwise, prepend... - archive_expsym_cmds_CXX='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then - cp $export_symbols $output_objdir/$soname.def; - else - echo EXPORTS > $output_objdir/$soname.def; - cat $export_symbols >> $output_objdir/$soname.def; - fi~ - $CC -shared -nostdlib $output_objdir/$soname.def $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' - else - ld_shlibs_CXX=no - fi - ;; + case $GXX,$cc_basename in + ,cl* | no,cl*) + # Native MSVC + # hardcode_libdir_flag_spec is actually meaningless, as there is + # no search path for DLLs. + hardcode_libdir_flag_spec_CXX=' ' + allow_undefined_flag_CXX=unsupported + always_export_symbols_CXX=yes + file_list_spec_CXX='@' + # Tell ltmain to make .lib files, not .a files. + libext=lib + # Tell ltmain to make .dll files, not .so files. + shrext_cmds=".dll" + # FIXME: Setting linknames here is a bad hack. + archive_cmds_CXX='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-dll~linknames=' + archive_expsym_cmds_CXX='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then + $SED -n -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' -e '1\\\!p' < $export_symbols > $output_objdir/$soname.exp; + else + $SED -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' < $export_symbols > $output_objdir/$soname.exp; + fi~ + $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~ + linknames=' + # The linker will not automatically build a static lib if we build a DLL. + # _LT_TAGVAR(old_archive_from_new_cmds, CXX)='true' + enable_shared_with_static_runtimes_CXX=yes + # Don't use ranlib + old_postinstall_cmds_CXX='chmod 644 $oldlib' + postlink_cmds_CXX='lt_outputfile="@OUTPUT@"~ + lt_tool_outputfile="@TOOL_OUTPUT@"~ + case $lt_outputfile in + *.exe|*.EXE) ;; + *) + lt_outputfile="$lt_outputfile.exe" + lt_tool_outputfile="$lt_tool_outputfile.exe" + ;; + esac~ + func_to_tool_file "$lt_outputfile"~ + if test "$MANIFEST_TOOL" != ":" && test -f "$lt_outputfile.manifest"; then + $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1; + $RM "$lt_outputfile.manifest"; + fi' + ;; + *) + # g++ + # _LT_TAGVAR(hardcode_libdir_flag_spec, CXX) is actually meaningless, + # as there is no search path for DLLs. + hardcode_libdir_flag_spec_CXX='-L$libdir' + export_dynamic_flag_spec_CXX='${wl}--export-all-symbols' + allow_undefined_flag_CXX=unsupported + always_export_symbols_CXX=no + enable_shared_with_static_runtimes_CXX=yes + + if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then + archive_cmds_CXX='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' + # If the export-symbols file already is a .def file (1st line + # is EXPORTS), use it as is; otherwise, prepend... + archive_expsym_cmds_CXX='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then + cp $export_symbols $output_objdir/$soname.def; + else + echo EXPORTS > $output_objdir/$soname.def; + cat $export_symbols >> $output_objdir/$soname.def; + fi~ + $CC -shared -nostdlib $output_objdir/$soname.def $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' + else + ld_shlibs_CXX=no + fi + ;; + esac + ;; darwin* | rhapsody*) @@ -13155,7 +14129,12 @@ hardcode_direct_CXX=no hardcode_automatic_CXX=yes hardcode_shlibpath_var_CXX=unsupported - whole_archive_flag_spec_CXX='' + if test "$lt_cv_ld_force_load" = "yes"; then + whole_archive_flag_spec_CXX='`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience ${wl}-force_load,$conv\"; done; func_echo_all \"$new_convenience\"`' + + else + whole_archive_flag_spec_CXX='' + fi link_all_deplibs_CXX=yes allow_undefined_flag_CXX="$_lt_dar_allow_undefined" case $cc_basename in @@ -13163,7 +14142,7 @@ *) _lt_dar_can_shared=$GCC ;; esac if test "$_lt_dar_can_shared" = "yes"; then - output_verbose_link_cmd=echo + output_verbose_link_cmd=func_echo_all archive_cmds_CXX="\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod${_lt_dsymutil}" module_cmds_CXX="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dsymutil}" archive_expsym_cmds_CXX="sed 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring ${_lt_dar_single_mod}${_lt_dar_export_syms}${_lt_dsymutil}" @@ -13197,7 +14176,7 @@ esac ;; - freebsd[12]*) + freebsd2.*) # C++ shared libraries reported to be fairly broken before # switch to ELF ld_shlibs_CXX=no @@ -13216,6 +14195,11 @@ gnu*) ;; + haiku*) + archive_cmds_CXX='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + link_all_deplibs_CXX=yes + ;; + hpux9*) hardcode_libdir_flag_spec_CXX='${wl}+b ${wl}$libdir' hardcode_libdir_separator_CXX=: @@ -13240,11 +14224,11 @@ # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. - output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | $EGREP "\-L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; $ECHO "X$list" | $Xsed' + output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | $EGREP "\-L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"' ;; *) if test "$GXX" = yes; then - archive_cmds_CXX='$RM $output_objdir/$soname~$CC -shared -nostdlib -fPIC ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' + archive_cmds_CXX='$RM $output_objdir/$soname~$CC -shared -nostdlib $pic_flag ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' else # FIXME: insert proper C++ library support ld_shlibs_CXX=no @@ -13305,7 +14289,7 @@ # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. - output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | $GREP "\-L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; $ECHO "X$list" | $Xsed' + output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | $GREP "\-L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"' ;; *) if test "$GXX" = yes; then @@ -13315,10 +14299,10 @@ archive_cmds_CXX='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; ia64*) - archive_cmds_CXX='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' + archive_cmds_CXX='$CC -shared -nostdlib $pic_flag ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; *) - archive_cmds_CXX='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' + archive_cmds_CXX='$CC -shared -nostdlib $pic_flag ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; esac fi @@ -13348,7 +14332,7 @@ case $cc_basename in CC*) # SGI C++ - archive_cmds_CXX='$CC -shared -all -multigot $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -soname $soname `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -o $lib' + archive_cmds_CXX='$CC -shared -all -multigot $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' # Archives containing C++ object files must be created using # "CC -ar", where "CC" is the IRIX C++ compiler. This is @@ -13359,9 +14343,9 @@ *) if test "$GXX" = yes; then if test "$with_gnu_ld" = no; then - archive_cmds_CXX='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "X${wl}-set_version ${wl}$verstring" | $Xsed` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' + archive_cmds_CXX='$CC -shared $pic_flag -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' else - archive_cmds_CXX='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "X${wl}-set_version ${wl}$verstring" | $Xsed` -o $lib' + archive_cmds_CXX='$CC -shared $pic_flag -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` -o $lib' fi fi link_all_deplibs_CXX=yes @@ -13372,7 +14356,7 @@ inherit_rpath_CXX=yes ;; - linux* | k*bsd*-gnu) + linux* | k*bsd*-gnu | kopensolaris*-gnu) case $cc_basename in KCC*) # Kuck and Associates, Inc. (KAI) C++ Compiler @@ -13390,7 +14374,7 @@ # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. - output_verbose_link_cmd='templist=`$CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1 | $GREP "ld"`; rm -f libconftest$shared_ext; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; $ECHO "X$list" | $Xsed' + output_verbose_link_cmd='templist=`$CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1 | $GREP "ld"`; rm -f libconftest$shared_ext; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"' hardcode_libdir_flag_spec_CXX='${wl}-rpath,$libdir' export_dynamic_flag_spec_CXX='${wl}--export-dynamic' @@ -13427,26 +14411,26 @@ pgCC* | pgcpp*) # Portland Group C++ compiler case `$CC -V` in - *pgCC\ [1-5]* | *pgcpp\ [1-5]*) + *pgCC\ [1-5].* | *pgcpp\ [1-5].*) prelink_cmds_CXX='tpldir=Template.dir~ rm -rf $tpldir~ $CC --prelink_objects --instantiation_dir $tpldir $objs $libobjs $compile_deplibs~ - compile_command="$compile_command `find $tpldir -name \*.o | $NL2SP`"' + compile_command="$compile_command `find $tpldir -name \*.o | sort | $NL2SP`"' old_archive_cmds_CXX='tpldir=Template.dir~ rm -rf $tpldir~ $CC --prelink_objects --instantiation_dir $tpldir $oldobjs$old_deplibs~ - $AR $AR_FLAGS $oldlib$oldobjs$old_deplibs `find $tpldir -name \*.o | $NL2SP`~ + $AR $AR_FLAGS $oldlib$oldobjs$old_deplibs `find $tpldir -name \*.o | sort | $NL2SP`~ $RANLIB $oldlib' archive_cmds_CXX='tpldir=Template.dir~ rm -rf $tpldir~ $CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~ - $CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | $NL2SP` $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname -o $lib' + $CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | sort | $NL2SP` $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname -o $lib' archive_expsym_cmds_CXX='tpldir=Template.dir~ rm -rf $tpldir~ $CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~ - $CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | $NL2SP` $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname ${wl}-retain-symbols-file ${wl}$export_symbols -o $lib' + $CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | sort | $NL2SP` $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname ${wl}-retain-symbols-file ${wl}$export_symbols -o $lib' ;; - *) # Version 6 will use weak symbols + *) # Version 6 and above use weak symbols archive_cmds_CXX='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname -o $lib' archive_expsym_cmds_CXX='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname ${wl}-retain-symbols-file ${wl}$export_symbols -o $lib' ;; @@ -13454,7 +14438,7 @@ hardcode_libdir_flag_spec_CXX='${wl}--rpath ${wl}$libdir' export_dynamic_flag_spec_CXX='${wl}--export-dynamic' - whole_archive_flag_spec_CXX='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $ECHO \"$new_convenience\"` ${wl}--no-whole-archive' + whole_archive_flag_spec_CXX='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' ;; cxx*) # Compaq C++ @@ -13473,9 +14457,9 @@ # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. - output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "ld"`; templist=`$ECHO "X$templist" | $Xsed -e "s/\(^.*ld.*\)\( .*ld .*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; $ECHO "X$list" | $Xsed' + output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "ld"`; templist=`func_echo_all "$templist" | $SED "s/\(^.*ld.*\)\( .*ld .*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "X$list" | $Xsed' ;; - xl*) + xl* | mpixl* | bgxl*) # IBM XL 8.0 on PPC, with GNU ld hardcode_libdir_flag_spec_CXX='${wl}-rpath ${wl}$libdir' export_dynamic_flag_spec_CXX='${wl}--export-dynamic' @@ -13495,13 +14479,13 @@ archive_cmds_CXX='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' archive_expsym_cmds_CXX='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-retain-symbols-file ${wl}$export_symbols' hardcode_libdir_flag_spec_CXX='-R$libdir' - whole_archive_flag_spec_CXX='${wl}--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; $ECHO \"$new_convenience\"` ${wl}--no-whole-archive' + whole_archive_flag_spec_CXX='${wl}--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' compiler_needs_object_CXX=yes # Not sure whether something based on # $CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1 # would be better. - output_verbose_link_cmd='echo' + output_verbose_link_cmd='func_echo_all' # Archives containing C++ object files must be created using # "CC -xar", where "CC" is the Sun C++ compiler. This is @@ -13570,7 +14554,7 @@ export_dynamic_flag_spec_CXX='${wl}-E' whole_archive_flag_spec_CXX="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' fi - output_verbose_link_cmd=echo + output_verbose_link_cmd=func_echo_all else ld_shlibs_CXX=no fi @@ -13605,15 +14589,15 @@ case $host in osf3*) allow_undefined_flag_CXX=' ${wl}-expect_unresolved ${wl}\*' - archive_cmds_CXX='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $soname `test -n "$verstring" && $ECHO "X${wl}-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -o $lib' + archive_cmds_CXX='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $soname `test -n "$verstring" && func_echo_all "${wl}-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' hardcode_libdir_flag_spec_CXX='${wl}-rpath ${wl}$libdir' ;; *) allow_undefined_flag_CXX=' -expect_unresolved \*' - archive_cmds_CXX='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -o $lib' + archive_cmds_CXX='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' archive_expsym_cmds_CXX='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done~ echo "-hidden">> $lib.exp~ - $CC -shared$allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname ${wl}-input ${wl}$lib.exp `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -o $lib~ + $CC -shared$allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname ${wl}-input ${wl}$lib.exp `test -n "$verstring" && $ECHO "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib~ $RM $lib.exp' hardcode_libdir_flag_spec_CXX='-rpath $libdir' ;; @@ -13629,17 +14613,17 @@ # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. - output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "ld" | $GREP -v "ld:"`; templist=`$ECHO "X$templist" | $Xsed -e "s/\(^.*ld.*\)\( .*ld.*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; $ECHO "X$list" | $Xsed' + output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "ld" | $GREP -v "ld:"`; templist=`func_echo_all "$templist" | $SED "s/\(^.*ld.*\)\( .*ld.*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"' ;; *) if test "$GXX" = yes && test "$with_gnu_ld" = no; then allow_undefined_flag_CXX=' ${wl}-expect_unresolved ${wl}\*' case $host in osf3*) - archive_cmds_CXX='$CC -shared -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "X${wl}-set_version ${wl}$verstring" | $Xsed` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' + archive_cmds_CXX='$CC -shared -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' ;; *) - archive_cmds_CXX='$CC -shared -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "${wl}-set_version ${wl}$verstring" | $Xsed` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' + archive_cmds_CXX='$CC -shared $pic_flag -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' ;; esac @@ -13649,7 +14633,7 @@ # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. - output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "\-L"' + output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"' else # FIXME: insert proper C++ library support @@ -13685,7 +14669,7 @@ solaris*) case $cc_basename in - CC*) + CC* | sunCC*) # Sun C++ 4.2, 5.x and Centerline C++ archive_cmds_need_lc_CXX=yes no_undefined_flag_CXX=' -zdefs' @@ -13706,7 +14690,7 @@ esac link_all_deplibs_CXX=yes - output_verbose_link_cmd='echo' + output_verbose_link_cmd='func_echo_all' # Archives containing C++ object files must be created using # "CC -xar", where "CC" is the Sun C++ compiler. This is @@ -13726,14 +14710,14 @@ if test "$GXX" = yes && test "$with_gnu_ld" = no; then no_undefined_flag_CXX=' ${wl}-z ${wl}defs' if $CC --version | $GREP -v '^2\.7' > /dev/null; then - archive_cmds_CXX='$CC -shared -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib' + archive_cmds_CXX='$CC -shared $pic_flag -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib' archive_expsym_cmds_CXX='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ - $CC -shared -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp' + $CC -shared $pic_flag -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp' # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. - output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "\-L"' + output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"' else # g++ 2.7 appears to require `-G' NOT `-shared' on this # platform. @@ -13744,7 +14728,7 @@ # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. - output_verbose_link_cmd='$CC -G $CFLAGS -v conftest.$objext 2>&1 | $GREP "\-L"' + output_verbose_link_cmd='$CC -G $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"' fi hardcode_libdir_flag_spec_CXX='${wl}-R $wl$libdir' @@ -13798,6 +14782,10 @@ CC*) archive_cmds_CXX='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds_CXX='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + old_archive_cmds_CXX='$CC -Tprelink_objects $oldobjs~ + '"$old_archive_cmds_CXX" + reload_cmds_CXX='$CC -Tprelink_objects $reload_objs~ + '"$reload_cmds_CXX" ;; *) archive_cmds_CXX='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' @@ -13859,6 +14847,14 @@ }; _LT_EOF + +_lt_libdeps_save_CFLAGS=$CFLAGS +case "$CC $CFLAGS " in #( +*\ -flto*\ *) CFLAGS="$CFLAGS -fno-lto" ;; +*\ -fwhopr*\ *) CFLAGS="$CFLAGS -fno-whopr" ;; +*\ -fuse-linker-plugin*\ *) CFLAGS="$CFLAGS -fno-use-linker-plugin" ;; +esac + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 (eval $ac_compile) 2>&5 ac_status=$? @@ -13872,7 +14868,7 @@ pre_test_object_deps_done=no for p in `eval "$output_verbose_link_cmd"`; do - case $p in + case ${prev}${p} in -L* | -R* | -l*) # Some compilers place space between "-{L,R}" and the path. @@ -13881,13 +14877,22 @@ test $p = "-R"; then prev=$p continue - else - prev= fi + # Expand the sysroot to ease extracting the directories later. + if test -z "$prev"; then + case $p in + -L*) func_stripname_cnf '-L' '' "$p"; prev=-L; p=$func_stripname_result ;; + -R*) func_stripname_cnf '-R' '' "$p"; prev=-R; p=$func_stripname_result ;; + -l*) func_stripname_cnf '-l' '' "$p"; prev=-l; p=$func_stripname_result ;; + esac + fi + case $p in + =*) func_stripname_cnf '=' '' "$p"; p=$lt_sysroot$func_stripname_result ;; + esac if test "$pre_test_object_deps_done" = no; then - case $p in - -L* | -R*) + case ${prev} in + -L | -R) # Internal compiler library paths should come after those # provided the user. The postdeps already come after the # user supplied libs so there is no need to process them. @@ -13907,8 +14912,10 @@ postdeps_CXX="${postdeps_CXX} ${prev}${p}" fi fi + prev= ;; + *.lto.$objext) ;; # Ignore GCC LTO objects *.$objext) # This assumes that the test object file only shows up # once in the compiler output. @@ -13944,6 +14951,7 @@ fi $RM -f confest.$objext +CFLAGS=$_lt_libdeps_save_CFLAGS # PORTME: override above test on systems where it is broken case $host_os in @@ -13979,7 +14987,7 @@ solaris*) case $cc_basename in - CC*) + CC* | sunCC*) # The more standards-conforming stlport4 library is # incompatible with the Cstd library. Avoid specifying # it if it's in CXXFLAGS. Ignore libCrun as @@ -14044,8 +15052,6 @@ lt_prog_compiler_pic_CXX= lt_prog_compiler_static_CXX= -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $compiler option to produce PIC" >&5 -$as_echo_n "checking for $compiler option to produce PIC... " >&6; } # C++ specific cases for pic, static, wl, etc. if test "$GXX" = yes; then @@ -14095,6 +15101,11 @@ # DJGPP does not support shared libraries at all lt_prog_compiler_pic_CXX= ;; + haiku*) + # PIC is the default for Haiku. + # The "-static" flag exists, but is broken. + lt_prog_compiler_static_CXX= + ;; interix[3-9]*) # Interix 3.x gcc -fpic/-fPIC options generate broken code. # Instead, we relocate shared libraries at runtime. @@ -14144,6 +15155,11 @@ ;; esac ;; + mingw* | cygwin* | os2* | pw32* | cegcc*) + # This hack is so that the source file can tell whether it is being + # built for inclusion in a dll (and should export symbols for example). + lt_prog_compiler_pic_CXX='-DDLL_EXPORT' + ;; dgux*) case $cc_basename in ec++*) @@ -14200,7 +15216,7 @@ ;; esac ;; - linux* | k*bsd*-gnu) + linux* | k*bsd*-gnu | kopensolaris*-gnu) case $cc_basename in KCC*) # KAI C++ Compiler @@ -14233,8 +15249,8 @@ lt_prog_compiler_pic_CXX= lt_prog_compiler_static_CXX='-non_shared' ;; - xlc* | xlC*) - # IBM XL 8.0 on PPC + xlc* | xlC* | bgxl[cC]* | mpixl[cC]*) + # IBM XL 8.0, 9.0 on PPC and BlueGene lt_prog_compiler_wl_CXX='-Wl,' lt_prog_compiler_pic_CXX='-qpic' lt_prog_compiler_static_CXX='-qstaticlink' @@ -14296,7 +15312,7 @@ ;; solaris*) case $cc_basename in - CC*) + CC* | sunCC*) # Sun C++ 4.2, 5.x and Centerline C++ lt_prog_compiler_pic_CXX='-KPIC' lt_prog_compiler_static_CXX='-Bstatic' @@ -14361,10 +15377,17 @@ lt_prog_compiler_pic_CXX="$lt_prog_compiler_pic_CXX -DPIC" ;; esac -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_prog_compiler_pic_CXX" >&5 -$as_echo "$lt_prog_compiler_pic_CXX" >&6; } - +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $compiler option to produce PIC" >&5 +$as_echo_n "checking for $compiler option to produce PIC... " >&6; } +if ${lt_cv_prog_compiler_pic_CXX+:} false; then : + $as_echo_n "(cached) " >&6 +else + lt_cv_prog_compiler_pic_CXX=$lt_prog_compiler_pic_CXX +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_pic_CXX" >&5 +$as_echo "$lt_cv_prog_compiler_pic_CXX" >&6; } +lt_prog_compiler_pic_CXX=$lt_cv_prog_compiler_pic_CXX # # Check to make sure the PIC flag actually works. @@ -14372,7 +15395,7 @@ if test -n "$lt_prog_compiler_pic_CXX"; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler PIC flag $lt_prog_compiler_pic_CXX works" >&5 $as_echo_n "checking if $compiler PIC flag $lt_prog_compiler_pic_CXX works... " >&6; } -if test "${lt_cv_prog_compiler_pic_works_CXX+set}" = set; then : +if ${lt_cv_prog_compiler_pic_works_CXX+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_prog_compiler_pic_works_CXX=no @@ -14388,15 +15411,15 @@ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:14391: $lt_compile\"" >&5) + (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 - echo "$as_me:14395: \$? = $ac_status" >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings other than the usual output. - $ECHO "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' >conftest.exp + $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' >conftest.exp $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then lt_cv_prog_compiler_pic_works_CXX=yes @@ -14422,13 +15445,15 @@ + + # # Check to make sure the static flag actually works. # wl=$lt_prog_compiler_wl_CXX eval lt_tmp_static_flag=\"$lt_prog_compiler_static_CXX\" { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler static flag $lt_tmp_static_flag works" >&5 $as_echo_n "checking if $compiler static flag $lt_tmp_static_flag works... " >&6; } -if test "${lt_cv_prog_compiler_static_works_CXX+set}" = set; then : +if ${lt_cv_prog_compiler_static_works_CXX+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_prog_compiler_static_works_CXX=no @@ -14441,7 +15466,7 @@ if test -s conftest.err; then # Append any errors to the config.log. cat conftest.err 1>&5 - $ECHO "X$_lt_linker_boilerplate" | $Xsed -e '/^$/d' > conftest.exp + $ECHO "$_lt_linker_boilerplate" | $SED '/^$/d' > conftest.exp $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 if diff conftest.exp conftest.er2 >/dev/null; then lt_cv_prog_compiler_static_works_CXX=yes @@ -14468,7 +15493,7 @@ { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -c -o file.$ac_objext" >&5 $as_echo_n "checking if $compiler supports -c -o file.$ac_objext... " >&6; } -if test "${lt_cv_prog_compiler_c_o_CXX+set}" = set; then : +if ${lt_cv_prog_compiler_c_o_CXX+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_prog_compiler_c_o_CXX=no @@ -14487,16 +15512,16 @@ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:14490: $lt_compile\"" >&5) + (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&5 - echo "$as_me:14494: \$? = $ac_status" >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 if (exit $ac_status) && test -s out/conftest2.$ac_objext then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings - $ECHO "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' > out/conftest.exp + $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' > out/conftest.exp $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2 if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then lt_cv_prog_compiler_c_o_CXX=yes @@ -14520,7 +15545,7 @@ { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -c -o file.$ac_objext" >&5 $as_echo_n "checking if $compiler supports -c -o file.$ac_objext... " >&6; } -if test "${lt_cv_prog_compiler_c_o_CXX+set}" = set; then : +if ${lt_cv_prog_compiler_c_o_CXX+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_prog_compiler_c_o_CXX=no @@ -14539,16 +15564,16 @@ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:14542: $lt_compile\"" >&5) + (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&5 - echo "$as_me:14546: \$? = $ac_status" >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 if (exit $ac_status) && test -s out/conftest2.$ac_objext then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings - $ECHO "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' > out/conftest.exp + $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' > out/conftest.exp $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2 if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then lt_cv_prog_compiler_c_o_CXX=yes @@ -14599,27 +15624,37 @@ $as_echo_n "checking whether the $compiler linker ($LD) supports shared libraries... " >&6; } export_symbols_cmds_CXX='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' + exclude_expsyms_CXX='_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*' case $host_os in aix[4-9]*) # If we're using GNU nm, then we don't want the "-C" option. # -C means demangle to AIX nm, but means don't demangle with GNU nm + # Also, AIX nm treats weak defined symbols like other global defined + # symbols, whereas GNU nm marks them as "W". if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then - export_symbols_cmds_CXX='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B")) && (substr(\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols' + export_symbols_cmds_CXX='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && (substr(\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols' else export_symbols_cmds_CXX='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B")) && (substr(\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols' fi ;; pw32*) export_symbols_cmds_CXX="$ltdll_cmds" - ;; + ;; cygwin* | mingw* | cegcc*) - export_symbols_cmds_CXX='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS][ ]/s/.*[ ]\([^ ]*\)/\1 DATA/;/^.*[ ]__nm__/s/^.*[ ]__nm__\([^ ]*\)[ ][^ ]*/\1 DATA/;/^I[ ]/d;/^[AITW][ ]/s/.* //'\'' | sort | uniq > $export_symbols' - ;; + case $cc_basename in + cl*) + exclude_expsyms_CXX='_NULL_IMPORT_DESCRIPTOR|_IMPORT_DESCRIPTOR_.*' + ;; + *) + export_symbols_cmds_CXX='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS][ ]/s/.*[ ]\([^ ]*\)/\1 DATA/;s/^.*[ ]__nm__\([^ ]*\)[ ][^ ]*/\1 DATA/;/^I[ ]/d;/^[AITW][ ]/s/.* //'\'' | sort | uniq > $export_symbols' + exclude_expsyms_CXX='[_]+GLOBAL_OFFSET_TABLE_|[_]+GLOBAL__[FID]_.*|[_]+head_[A-Za-z0-9_]+_dll|[A-Za-z0-9_]+_dll_iname' + ;; + esac + ;; *) export_symbols_cmds_CXX='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' - ;; + ;; esac - exclude_expsyms_CXX='_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*' { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ld_shlibs_CXX" >&5 $as_echo "$ld_shlibs_CXX" >&6; } @@ -14651,44 +15686,50 @@ # to ld, don't add -lc before -lgcc. { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether -lc should be explicitly linked in" >&5 $as_echo_n "checking whether -lc should be explicitly linked in... " >&6; } - $RM conftest* - echo "$lt_simple_compile_test_code" > conftest.$ac_ext +if ${lt_cv_archive_cmds_need_lc_CXX+:} false; then : + $as_echo_n "(cached) " >&6 +else + $RM conftest* + echo "$lt_simple_compile_test_code" > conftest.$ac_ext - if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 (eval $ac_compile) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } 2>conftest.err; then - soname=conftest - lib=conftest - libobjs=conftest.$ac_objext - deplibs= - wl=$lt_prog_compiler_wl_CXX - pic_flag=$lt_prog_compiler_pic_CXX - compiler_flags=-v - linker_flags=-v - verstring= - output_objdir=. - libname=conftest - lt_save_allow_undefined_flag=$allow_undefined_flag_CXX - allow_undefined_flag_CXX= - if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$archive_cmds_CXX 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1\""; } >&5 + soname=conftest + lib=conftest + libobjs=conftest.$ac_objext + deplibs= + wl=$lt_prog_compiler_wl_CXX + pic_flag=$lt_prog_compiler_pic_CXX + compiler_flags=-v + linker_flags=-v + verstring= + output_objdir=. + libname=conftest + lt_save_allow_undefined_flag=$allow_undefined_flag_CXX + allow_undefined_flag_CXX= + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$archive_cmds_CXX 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1\""; } >&5 (eval $archive_cmds_CXX 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } - then - archive_cmds_need_lc_CXX=no - else - archive_cmds_need_lc_CXX=yes - fi - allow_undefined_flag_CXX=$lt_save_allow_undefined_flag - else - cat conftest.err 1>&5 - fi - $RM conftest* - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $archive_cmds_need_lc_CXX" >&5 -$as_echo "$archive_cmds_need_lc_CXX" >&6; } + then + lt_cv_archive_cmds_need_lc_CXX=no + else + lt_cv_archive_cmds_need_lc_CXX=yes + fi + allow_undefined_flag_CXX=$lt_save_allow_undefined_flag + else + cat conftest.err 1>&5 + fi + $RM conftest* + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_archive_cmds_need_lc_CXX" >&5 +$as_echo "$lt_cv_archive_cmds_need_lc_CXX" >&6; } + archive_cmds_need_lc_CXX=$lt_cv_archive_cmds_need_lc_CXX ;; esac fi @@ -14756,8 +15797,6 @@ - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking dynamic linker characteristics" >&5 $as_echo_n "checking dynamic linker characteristics... " >&6; } @@ -14783,7 +15822,7 @@ case $host_os in aix3*) - version_type=linux + version_type=linux # correct to gnu/linux during the next big refactor library_names_spec='${libname}${release}${shared_ext}$versuffix $libname.a' shlibpath_var=LIBPATH @@ -14792,7 +15831,7 @@ ;; aix[4-9]*) - version_type=linux + version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no hardcode_into_libs=yes @@ -14845,7 +15884,7 @@ m68k) library_names_spec='$libname.ixlibrary $libname.a' # Create ${libname}_ixlibrary.a entries in /sys/libs. - finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`$ECHO "X$lib" | $Xsed -e '\''s%^.*/\([^/]*\)\.ixlibrary$%\1%'\''`; test $RM /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done' + finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`func_echo_all "$lib" | $SED '\''s%^.*/\([^/]*\)\.ixlibrary$%\1%'\''`; test $RM /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done' ;; esac ;; @@ -14857,7 +15896,7 @@ ;; bsdi[45]*) - version_type=linux + version_type=linux # correct to gnu/linux during the next big refactor need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' @@ -14876,8 +15915,9 @@ need_version=no need_lib_prefix=no - case $GCC,$host_os in - yes,cygwin* | yes,mingw* | yes,pw32* | yes,cegcc*) + case $GCC,$cc_basename in + yes,*) + # gcc library_names_spec='$libname.dll.a' # DLL is installed to $(libdir)/../bin by postinstall_cmds postinstall_cmds='base_file=`basename \${file}`~ @@ -14898,36 +15938,82 @@ cygwin*) # Cygwin DLLs use 'cyg' prefix rather than 'lib' soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' - sys_lib_search_path_spec="/usr/lib /lib/w32api /lib /usr/local/lib" + ;; mingw* | cegcc*) # MinGW DLLs use traditional 'lib' prefix soname_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' - sys_lib_search_path_spec=`$CC -print-search-dirs | $GREP "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"` - if $ECHO "$sys_lib_search_path_spec" | $GREP ';[c-zC-Z]:/' >/dev/null; then - # It is most probably a Windows format PATH printed by - # mingw gcc, but we are running on Cygwin. Gcc prints its search - # path with ; separators, and with drive letters. We can handle the - # drive letters (cygwin fileutils understands them), so leave them, - # especially as we might pass files found there to a mingw objdump, - # which wouldn't understand a cygwinified path. Ahh. - sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'` - else - sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` - fi ;; pw32*) # pw32 DLLs use 'pw' prefix rather than 'lib' library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' ;; esac + dynamic_linker='Win32 ld.exe' + ;; + + *,cl*) + # Native MSVC + libname_spec='$name' + soname_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' + library_names_spec='${libname}.dll.lib' + + case $build_os in + mingw*) + sys_lib_search_path_spec= + lt_save_ifs=$IFS + IFS=';' + for lt_path in $LIB + do + IFS=$lt_save_ifs + # Let DOS variable expansion print the short 8.3 style file name. + lt_path=`cd "$lt_path" 2>/dev/null && cmd //C "for %i in (".") do @echo %~si"` + sys_lib_search_path_spec="$sys_lib_search_path_spec $lt_path" + done + IFS=$lt_save_ifs + # Convert to MSYS style. + sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | sed -e 's|\\\\|/|g' -e 's| \\([a-zA-Z]\\):| /\\1|g' -e 's|^ ||'` + ;; + cygwin*) + # Convert to unix form, then to dos form, then back to unix form + # but this time dos style (no spaces!) so that the unix form looks + # like /cygdrive/c/PROGRA~1:/cygdr... + sys_lib_search_path_spec=`cygpath --path --unix "$LIB"` + sys_lib_search_path_spec=`cygpath --path --dos "$sys_lib_search_path_spec" 2>/dev/null` + sys_lib_search_path_spec=`cygpath --path --unix "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` + ;; + *) + sys_lib_search_path_spec="$LIB" + if $ECHO "$sys_lib_search_path_spec" | $GREP ';[c-zC-Z]:/' >/dev/null; then + # It is most probably a Windows format PATH. + sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'` + else + sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` + fi + # FIXME: find the short name or the path components, as spaces are + # common. (e.g. "Program Files" -> "PROGRA~1") + ;; + esac + + # DLL is installed to $(libdir)/../bin by postinstall_cmds + postinstall_cmds='base_file=`basename \${file}`~ + dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i; echo \$dlname'\''`~ + dldir=$destdir/`dirname \$dlpath`~ + test -d \$dldir || mkdir -p \$dldir~ + $install_prog $dir/$dlname \$dldir/$dlname' + postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ + dlpath=$dir/\$dldll~ + $RM \$dlpath' + shlibpath_overrides_runpath=yes + dynamic_linker='Win32 link.exe' ;; *) + # Assume MSVC wrapper library_names_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext} $libname.lib' + dynamic_linker='Win32 ld.exe' ;; esac - dynamic_linker='Win32 ld.exe' # FIXME: first we should search . and the directory the executable is in shlibpath_var=PATH ;; @@ -14947,7 +16033,7 @@ ;; dgux*) - version_type=linux + version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname$shared_ext' @@ -14955,10 +16041,6 @@ shlibpath_var=LD_LIBRARY_PATH ;; -freebsd1*) - dynamic_linker=no - ;; - freebsd* | dragonfly*) # DragonFly does not have aout. When/if they implement a new # versioning mechanism, adjust this. @@ -14966,7 +16048,7 @@ objformat=`/usr/bin/objformat` else case $host_os in - freebsd[123]*) objformat=aout ;; + freebsd[23].*) objformat=aout ;; *) objformat=elf ;; esac fi @@ -14984,7 +16066,7 @@ esac shlibpath_var=LD_LIBRARY_PATH case $host_os in - freebsd2*) + freebsd2.*) shlibpath_overrides_runpath=yes ;; freebsd3.[01]* | freebsdelf3.[01]*) @@ -15004,12 +16086,26 @@ ;; gnu*) - version_type=linux + version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=no + hardcode_into_libs=yes + ;; + +haiku*) + version_type=linux # correct to gnu/linux during the next big refactor + need_lib_prefix=no + need_version=no + dynamic_linker="$host_os runtime_loader" + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LIBRARY_PATH + shlibpath_overrides_runpath=yes + sys_lib_dlsearch_path_spec='/boot/home/config/lib /boot/common/lib /boot/system/lib' hardcode_into_libs=yes ;; @@ -15055,12 +16151,14 @@ soname_spec='${libname}${release}${shared_ext}$major' ;; esac - # HP-UX runs *really* slowly unless shared libraries are mode 555. + # HP-UX runs *really* slowly unless shared libraries are mode 555, ... postinstall_cmds='chmod 555 $lib' + # or fails outright, so override atomically: + install_override_mode=555 ;; interix[3-9]*) - version_type=linux + version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' @@ -15076,7 +16174,7 @@ nonstopux*) version_type=nonstopux ;; *) if test "$lt_cv_prog_gnu_ld" = yes; then - version_type=linux + version_type=linux # correct to gnu/linux during the next big refactor else version_type=irix fi ;; @@ -15113,9 +16211,9 @@ dynamic_linker=no ;; -# This must be Linux ELF. -linux* | k*bsd*-gnu) - version_type=linux +# This must be glibc/ELF. +linux* | k*bsd*-gnu | kopensolaris*-gnu) + version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' @@ -15123,12 +16221,17 @@ finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no + # Some binutils ld are patched to set DT_RUNPATH - save_LDFLAGS=$LDFLAGS - save_libdir=$libdir - eval "libdir=/foo; wl=\"$lt_prog_compiler_wl_CXX\"; \ - LDFLAGS=\"\$LDFLAGS $hardcode_libdir_flag_spec_CXX\"" - cat confdefs.h - <<_ACEOF >conftest.$ac_ext + if ${lt_cv_shlibpath_overrides_runpath+:} false; then : + $as_echo_n "(cached) " >&6 +else + lt_cv_shlibpath_overrides_runpath=no + save_LDFLAGS=$LDFLAGS + save_libdir=$libdir + eval "libdir=/foo; wl=\"$lt_prog_compiler_wl_CXX\"; \ + LDFLAGS=\"\$LDFLAGS $hardcode_libdir_flag_spec_CXX\"" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int @@ -15141,22 +16244,26 @@ _ACEOF if ac_fn_cxx_try_link "$LINENO"; then : if ($OBJDUMP -p conftest$ac_exeext) 2>/dev/null | grep "RUNPATH.*$libdir" >/dev/null; then : - shlibpath_overrides_runpath=yes + lt_cv_shlibpath_overrides_runpath=yes fi fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext - LDFLAGS=$save_LDFLAGS - libdir=$save_libdir + LDFLAGS=$save_LDFLAGS + libdir=$save_libdir - # This implies no fast_install, which is unacceptable. +fi + + shlibpath_overrides_runpath=$lt_cv_shlibpath_overrides_runpath + + # This implies no fast_install, which is unacceptable. # Some rework will be needed to allow for fast_install # before this can be enabled. hardcode_into_libs=yes # Append ld.so.conf contents to the search path if test -f /etc/ld.so.conf; then - lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \$2)); skip = 1; } { if (!skip) print \$0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;/^[ ]*hwcap[ ]/d;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;/^$/d' | tr '\n' ' '` + lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \$2)); skip = 1; } { if (!skip) print \$0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;/^[ ]*hwcap[ ]/d;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;s/"//g;/^$/d' | tr '\n' ' '` sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra" fi @@ -15188,7 +16295,7 @@ ;; newsos6) - version_type=linux + version_type=linux # correct to gnu/linux during the next big refactor library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes @@ -15257,7 +16364,7 @@ ;; solaris*) - version_type=linux + version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' @@ -15282,7 +16389,7 @@ ;; sysv4 | sysv4.3*) - version_type=linux + version_type=linux # correct to gnu/linux during the next big refactor library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH @@ -15306,7 +16413,7 @@ sysv4*MP*) if test -d /usr/nec ;then - version_type=linux + version_type=linux # correct to gnu/linux during the next big refactor library_names_spec='$libname${shared_ext}.$versuffix $libname${shared_ext}.$major $libname${shared_ext}' soname_spec='$libname${shared_ext}.$major' shlibpath_var=LD_LIBRARY_PATH @@ -15337,7 +16444,7 @@ tpf*) # TPF is a cross-target only. Preferred cross-host = GNU/Linux. - version_type=linux + version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' @@ -15347,7 +16454,7 @@ ;; uts4*) - version_type=linux + version_type=linux # correct to gnu/linux during the next big refactor library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH @@ -15408,6 +16515,8 @@ + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to hardcode library paths into programs" >&5 $as_echo_n "checking how to hardcode library paths into programs... " >&6; } hardcode_action_CXX= @@ -15455,6 +16564,7 @@ fi # test -n "$compiler" CC=$lt_save_CC + CFLAGS=$lt_save_CFLAGS LDCXX=$LD LD=$lt_save_LD GCC=$lt_save_GCC @@ -15483,6 +16593,8 @@ + + ac_config_commands="$ac_config_commands libtool" @@ -15496,7 +16608,7 @@ set dummy bison; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_prog_YACC+set}" = set; then : +if ${ac_cv_prog_YACC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$YACC"; then @@ -15508,7 +16620,7 @@ IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_YACC="bison" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 @@ -15535,7 +16647,7 @@ as_ac_Header=`$as_echo "ac_cv_header_dirent_$ac_hdr" | $as_tr_sh` { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_hdr that defines DIR" >&5 $as_echo_n "checking for $ac_hdr that defines DIR... " >&6; } -if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then : +if eval \${$as_ac_Header+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -15562,8 +16674,7 @@ eval ac_res=\$$as_ac_Header { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } -eval as_val=\$$as_ac_Header - if test "x$as_val" = x""yes; then : +if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_hdr" | $as_tr_cpp` 1 _ACEOF @@ -15576,7 +16687,7 @@ if test $ac_header_dirent = dirent.h; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing opendir" >&5 $as_echo_n "checking for library containing opendir... " >&6; } -if test "${ac_cv_search_opendir+set}" = set; then : +if ${ac_cv_search_opendir+:} false; then : $as_echo_n "(cached) " >&6 else ac_func_search_save_LIBS=$LIBS @@ -15610,11 +16721,11 @@ fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext - if test "${ac_cv_search_opendir+set}" = set; then : + if ${ac_cv_search_opendir+:} false; then : break fi done -if test "${ac_cv_search_opendir+set}" = set; then : +if ${ac_cv_search_opendir+:} false; then : else ac_cv_search_opendir=no @@ -15633,7 +16744,7 @@ else { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing opendir" >&5 $as_echo_n "checking for library containing opendir... " >&6; } -if test "${ac_cv_search_opendir+set}" = set; then : +if ${ac_cv_search_opendir+:} false; then : $as_echo_n "(cached) " >&6 else ac_func_search_save_LIBS=$LIBS @@ -15667,11 +16778,11 @@ fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext - if test "${ac_cv_search_opendir+set}" = set; then : + if ${ac_cv_search_opendir+:} false; then : break fi done -if test "${ac_cv_search_opendir+set}" = set; then : +if ${ac_cv_search_opendir+:} false; then : else ac_cv_search_opendir=no @@ -15691,7 +16802,7 @@ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ANSI C header files" >&5 $as_echo_n "checking for ANSI C header files... " >&6; } -if test "${ac_cv_header_stdc+set}" = set; then : +if ${ac_cv_header_stdc+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -15803,7 +16914,7 @@ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for sys/wait.h that is POSIX.1 compatible" >&5 $as_echo_n "checking for sys/wait.h that is POSIX.1 compatible... " >&6; } -if test "${ac_cv_header_sys_wait_h+set}" = set; then : +if ${ac_cv_header_sys_wait_h+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -15842,12 +16953,12 @@ fi + for ac_header in fcntl.h malloc.h memory.h netinet/in.h stddef.h stdlib.h string.h strings.h sys/param.h sys/time.h unistd.h do : as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default" -eval as_val=\$$as_ac_Header - if test "x$as_val" = x""yes; then : +if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF @@ -15859,7 +16970,7 @@ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for an ANSI C-conforming const" >&5 $as_echo_n "checking for an ANSI C-conforming const... " >&6; } -if test "${ac_cv_c_const+set}" = set; then : +if ${ac_cv_c_const+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -15868,11 +16979,11 @@ int main () { -/* FIXME: Include the comments suggested by Paul. */ + #ifndef __cplusplus - /* Ultrix mips cc rejects this. */ + /* Ultrix mips cc rejects this sort of thing. */ typedef int charset[2]; - const charset cs; + const charset cs = { 0, 0 }; /* SunOS 4.1.1 cc rejects this. */ char const *const *pcpcc; char **ppc; @@ -15889,8 +17000,9 @@ ++pcpcc; ppc = (char**) pcpcc; pcpcc = (char const *const *) ppc; - { /* SCO 3.2v4 cc rejects this. */ - char *t; + { /* SCO 3.2v4 cc rejects this sort of thing. */ + char tx; + char *t = &tx; char const *s = 0 ? (char *) 0 : (char const *) 0; *t++ = 0; @@ -15906,10 +17018,10 @@ iptr p = 0; ++p; } - { /* AIX XL C 1.02.0.0 rejects this saying + { /* AIX XL C 1.02.0.0 rejects this sort of thing, saying "k.c", line 2.27: 1506-025 (S) Operand must be a modifiable lvalue. */ - struct s { int j; const int *ap[3]; }; - struct s *b; b->j = 5; + struct s { int j; const int *ap[3]; } bx; + struct s *b = &bx; b->j = 5; } { /* ULTRIX-32 V3.1 (Rev 9) vcc rejects this */ const int foo = 10; @@ -15939,7 +17051,7 @@ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for inline" >&5 $as_echo_n "checking for inline... " >&6; } -if test "${ac_cv_c_inline+set}" = set; then : +if ${ac_cv_c_inline+:} false; then : $as_echo_n "(cached) " >&6 else ac_cv_c_inline=no @@ -15980,7 +17092,7 @@ esac ac_fn_c_check_type "$LINENO" "size_t" "ac_cv_type_size_t" "$ac_includes_default" -if test "x$ac_cv_type_size_t" = x""yes; then : +if test "x$ac_cv_type_size_t" = xyes; then : else @@ -15991,7 +17103,7 @@ fi ac_fn_c_check_member "$LINENO" "struct stat" "st_blksize" "ac_cv_member_struct_stat_st_blksize" "$ac_includes_default" -if test "x$ac_cv_member_struct_stat_st_blksize" = x""yes; then : +if test "x$ac_cv_member_struct_stat_st_blksize" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_STRUCT_STAT_ST_BLKSIZE 1 @@ -16002,7 +17114,7 @@ { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether time.h and sys/time.h may both be included" >&5 $as_echo_n "checking whether time.h and sys/time.h may both be included... " >&6; } -if test "${ac_cv_header_time+set}" = set; then : +if ${ac_cv_header_time+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -16037,7 +17149,7 @@ { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether struct tm is in sys/time.h or time.h" >&5 $as_echo_n "checking whether struct tm is in sys/time.h or time.h... " >&6; } -if test "${ac_cv_struct_tm+set}" = set; then : +if ${ac_cv_struct_tm+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -16072,7 +17184,7 @@ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for working volatile" >&5 $as_echo_n "checking for working volatile... " >&6; } -if test "${ac_cv_c_volatile+set}" = set; then : +if ${ac_cv_c_volatile+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -16104,6 +17216,231 @@ fi + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether byte ordering is bigendian" >&5 +$as_echo_n "checking whether byte ordering is bigendian... " >&6; } +if ${ac_cv_c_bigendian+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_cv_c_bigendian=unknown + # See if we're dealing with a universal compiler. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#ifndef __APPLE_CC__ + not a universal capable compiler + #endif + typedef int dummy; + +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + + # Check for potential -arch flags. It is not universal unless + # there are at least two -arch flags with different values. + ac_arch= + ac_prev= + for ac_word in $CC $CFLAGS $CPPFLAGS $LDFLAGS; do + if test -n "$ac_prev"; then + case $ac_word in + i?86 | x86_64 | ppc | ppc64) + if test -z "$ac_arch" || test "$ac_arch" = "$ac_word"; then + ac_arch=$ac_word + else + ac_cv_c_bigendian=universal + break + fi + ;; + esac + ac_prev= + elif test "x$ac_word" = "x-arch"; then + ac_prev=arch + fi + done +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + if test $ac_cv_c_bigendian = unknown; then + # See if sys/param.h defines the BYTE_ORDER macro. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include + #include + +int +main () +{ +#if ! (defined BYTE_ORDER && defined BIG_ENDIAN \ + && defined LITTLE_ENDIAN && BYTE_ORDER && BIG_ENDIAN \ + && LITTLE_ENDIAN) + bogus endian macros + #endif + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + # It does; now see whether it defined to BIG_ENDIAN or not. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include + #include + +int +main () +{ +#if BYTE_ORDER != BIG_ENDIAN + not big endian + #endif + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_cv_c_bigendian=yes +else + ac_cv_c_bigendian=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + fi + if test $ac_cv_c_bigendian = unknown; then + # See if defines _LITTLE_ENDIAN or _BIG_ENDIAN (e.g., Solaris). + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include + +int +main () +{ +#if ! (defined _LITTLE_ENDIAN || defined _BIG_ENDIAN) + bogus endian macros + #endif + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + # It does; now see whether it defined to _BIG_ENDIAN or not. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include + +int +main () +{ +#ifndef _BIG_ENDIAN + not big endian + #endif + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_cv_c_bigendian=yes +else + ac_cv_c_bigendian=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + fi + if test $ac_cv_c_bigendian = unknown; then + # Compile a test program. + if test "$cross_compiling" = yes; then : + # Try to guess by grepping values from an object file. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +short int ascii_mm[] = + { 0x4249, 0x4765, 0x6E44, 0x6961, 0x6E53, 0x7953, 0 }; + short int ascii_ii[] = + { 0x694C, 0x5454, 0x656C, 0x6E45, 0x6944, 0x6E61, 0 }; + int use_ascii (int i) { + return ascii_mm[i] + ascii_ii[i]; + } + short int ebcdic_ii[] = + { 0x89D3, 0xE3E3, 0x8593, 0x95C5, 0x89C4, 0x9581, 0 }; + short int ebcdic_mm[] = + { 0xC2C9, 0xC785, 0x95C4, 0x8981, 0x95E2, 0xA8E2, 0 }; + int use_ebcdic (int i) { + return ebcdic_mm[i] + ebcdic_ii[i]; + } + extern int foo; + +int +main () +{ +return use_ascii (foo) == use_ebcdic (foo); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + if grep BIGenDianSyS conftest.$ac_objext >/dev/null; then + ac_cv_c_bigendian=yes + fi + if grep LiTTleEnDian conftest.$ac_objext >/dev/null ; then + if test "$ac_cv_c_bigendian" = unknown; then + ac_cv_c_bigendian=no + else + # finding both strings is unlikely to happen, but who knows? + ac_cv_c_bigendian=unknown + fi + fi +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$ac_includes_default +int +main () +{ + + /* Are we little or big endian? From Harbison&Steele. */ + union + { + long int l; + char c[sizeof (long int)]; + } u; + u.l = 1; + return u.c[sizeof (long int) - 1] == 1; + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_run "$LINENO"; then : + ac_cv_c_bigendian=no +else + ac_cv_c_bigendian=yes +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext +fi + + fi +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_bigendian" >&5 +$as_echo "$ac_cv_c_bigendian" >&6; } + case $ac_cv_c_bigendian in #( + yes) + $as_echo "#define WORDS_BIGENDIAN 1" >>confdefs.h +;; #( + no) + ;; #( + universal) + +$as_echo "#define AC_APPLE_UNIVERSAL_BUILD 1" >>confdefs.h + + ;; #( + *) + as_fn_error $? "unknown endianness + presetting ac_cv_c_bigendian=no (or yes) will help" "$LINENO" 5 ;; + esac + + # Ignore the errors about AC_TRY_RUN missing an argument. jhrg 5/2/95 @@ -16114,7 +17451,7 @@ # This bug is HP SR number 8606223364. { $as_echo "$as_me:${as_lineno-$LINENO}: checking size of int" >&5 $as_echo_n "checking size of int... " >&6; } -if test "${ac_cv_sizeof_int+set}" = set; then : +if ${ac_cv_sizeof_int+:} false; then : $as_echo_n "(cached) " >&6 else if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (int))" "ac_cv_sizeof_int" "$ac_includes_default"; then : @@ -16123,9 +17460,8 @@ if test "$ac_cv_type_int" = yes; then { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -{ as_fn_set_status 77 -as_fn_error "cannot compute sizeof (int) -See \`config.log' for more details." "$LINENO" 5; }; } +as_fn_error 77 "cannot compute sizeof (int) +See \`config.log' for more details" "$LINENO" 5; } else ac_cv_sizeof_int=0 fi @@ -16148,7 +17484,7 @@ # This bug is HP SR number 8606223364. { $as_echo "$as_me:${as_lineno-$LINENO}: checking size of long" >&5 $as_echo_n "checking size of long... " >&6; } -if test "${ac_cv_sizeof_long+set}" = set; then : +if ${ac_cv_sizeof_long+:} false; then : $as_echo_n "(cached) " >&6 else if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (long))" "ac_cv_sizeof_long" "$ac_includes_default"; then : @@ -16157,9 +17493,8 @@ if test "$ac_cv_type_long" = yes; then { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -{ as_fn_set_status 77 -as_fn_error "cannot compute sizeof (long) -See \`config.log' for more details." "$LINENO" 5; }; } +as_fn_error 77 "cannot compute sizeof (long) +See \`config.log' for more details" "$LINENO" 5; } else ac_cv_sizeof_long=0 fi @@ -16182,7 +17517,7 @@ # This bug is HP SR number 8606223364. { $as_echo "$as_me:${as_lineno-$LINENO}: checking size of char" >&5 $as_echo_n "checking size of char... " >&6; } -if test "${ac_cv_sizeof_char+set}" = set; then : +if ${ac_cv_sizeof_char+:} false; then : $as_echo_n "(cached) " >&6 else if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (char))" "ac_cv_sizeof_char" "$ac_includes_default"; then : @@ -16191,9 +17526,8 @@ if test "$ac_cv_type_char" = yes; then { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -{ as_fn_set_status 77 -as_fn_error "cannot compute sizeof (char) -See \`config.log' for more details." "$LINENO" 5; }; } +as_fn_error 77 "cannot compute sizeof (char) +See \`config.log' for more details" "$LINENO" 5; } else ac_cv_sizeof_char=0 fi @@ -16216,7 +17550,7 @@ # This bug is HP SR number 8606223364. { $as_echo "$as_me:${as_lineno-$LINENO}: checking size of double" >&5 $as_echo_n "checking size of double... " >&6; } -if test "${ac_cv_sizeof_double+set}" = set; then : +if ${ac_cv_sizeof_double+:} false; then : $as_echo_n "(cached) " >&6 else if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (double))" "ac_cv_sizeof_double" "$ac_includes_default"; then : @@ -16225,9 +17559,8 @@ if test "$ac_cv_type_double" = yes; then { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -{ as_fn_set_status 77 -as_fn_error "cannot compute sizeof (double) -See \`config.log' for more details." "$LINENO" 5; }; } +as_fn_error 77 "cannot compute sizeof (double) +See \`config.log' for more details" "$LINENO" 5; } else ac_cv_sizeof_double=0 fi @@ -16250,7 +17583,7 @@ # This bug is HP SR number 8606223364. { $as_echo "$as_me:${as_lineno-$LINENO}: checking size of float" >&5 $as_echo_n "checking size of float... " >&6; } -if test "${ac_cv_sizeof_float+set}" = set; then : +if ${ac_cv_sizeof_float+:} false; then : $as_echo_n "(cached) " >&6 else if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (float))" "ac_cv_sizeof_float" "$ac_includes_default"; then : @@ -16259,9 +17592,8 @@ if test "$ac_cv_type_float" = yes; then { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -{ as_fn_set_status 77 -as_fn_error "cannot compute sizeof (float) -See \`config.log' for more details." "$LINENO" 5; }; } +as_fn_error 77 "cannot compute sizeof (float) +See \`config.log' for more details" "$LINENO" 5; } else ac_cv_sizeof_float=0 fi @@ -16281,7 +17613,7 @@ # check for C99 types, headers and functions ac_fn_c_check_header_mongrel "$LINENO" "inttypes.h" "ac_cv_header_inttypes_h" "$ac_includes_default" -if test "x$ac_cv_header_inttypes_h" = x""yes; then : +if test "x$ac_cv_header_inttypes_h" = xyes; then : dap_inttypes_header=yes fi @@ -16293,7 +17625,7 @@ # This bug is HP SR number 8606223364. { $as_echo "$as_me:${as_lineno-$LINENO}: checking size of int32_t" >&5 $as_echo_n "checking size of int32_t... " >&6; } -if test "${ac_cv_sizeof_int32_t+set}" = set; then : +if ${ac_cv_sizeof_int32_t+:} false; then : $as_echo_n "(cached) " >&6 else if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (int32_t))" "ac_cv_sizeof_int32_t" "$ac_includes_default"; then : @@ -16302,9 +17634,8 @@ if test "$ac_cv_type_int32_t" = yes; then { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -{ as_fn_set_status 77 -as_fn_error "cannot compute sizeof (int32_t) -See \`config.log' for more details." "$LINENO" 5; }; } +as_fn_error 77 "cannot compute sizeof (int32_t) +See \`config.log' for more details" "$LINENO" 5; } else ac_cv_sizeof_int32_t=0 fi @@ -16328,7 +17659,7 @@ # This bug is HP SR number 8606223364. { $as_echo "$as_me:${as_lineno-$LINENO}: checking size of uint32_t" >&5 $as_echo_n "checking size of uint32_t... " >&6; } -if test "${ac_cv_sizeof_uint32_t+set}" = set; then : +if ${ac_cv_sizeof_uint32_t+:} false; then : $as_echo_n "(cached) " >&6 else if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (uint32_t))" "ac_cv_sizeof_uint32_t" "$ac_includes_default"; then : @@ -16337,9 +17668,8 @@ if test "$ac_cv_type_uint32_t" = yes; then { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -{ as_fn_set_status 77 -as_fn_error "cannot compute sizeof (uint32_t) -See \`config.log' for more details." "$LINENO" 5; }; } +as_fn_error 77 "cannot compute sizeof (uint32_t) +See \`config.log' for more details" "$LINENO" 5; } else ac_cv_sizeof_uint32_t=0 fi @@ -16363,7 +17693,7 @@ # This bug is HP SR number 8606223364. { $as_echo "$as_me:${as_lineno-$LINENO}: checking size of int16_t" >&5 $as_echo_n "checking size of int16_t... " >&6; } -if test "${ac_cv_sizeof_int16_t+set}" = set; then : +if ${ac_cv_sizeof_int16_t+:} false; then : $as_echo_n "(cached) " >&6 else if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (int16_t))" "ac_cv_sizeof_int16_t" "$ac_includes_default"; then : @@ -16372,9 +17702,8 @@ if test "$ac_cv_type_int16_t" = yes; then { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -{ as_fn_set_status 77 -as_fn_error "cannot compute sizeof (int16_t) -See \`config.log' for more details." "$LINENO" 5; }; } +as_fn_error 77 "cannot compute sizeof (int16_t) +See \`config.log' for more details" "$LINENO" 5; } else ac_cv_sizeof_int16_t=0 fi @@ -16398,7 +17727,7 @@ # This bug is HP SR number 8606223364. { $as_echo "$as_me:${as_lineno-$LINENO}: checking size of uint16_t" >&5 $as_echo_n "checking size of uint16_t... " >&6; } -if test "${ac_cv_sizeof_uint16_t+set}" = set; then : +if ${ac_cv_sizeof_uint16_t+:} false; then : $as_echo_n "(cached) " >&6 else if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (uint16_t))" "ac_cv_sizeof_uint16_t" "$ac_includes_default"; then : @@ -16407,9 +17736,8 @@ if test "$ac_cv_type_uint16_t" = yes; then { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -{ as_fn_set_status 77 -as_fn_error "cannot compute sizeof (uint16_t) -See \`config.log' for more details." "$LINENO" 5; }; } +as_fn_error 77 "cannot compute sizeof (uint16_t) +See \`config.log' for more details" "$LINENO" 5; } else ac_cv_sizeof_uint16_t=0 fi @@ -16433,7 +17761,7 @@ # This bug is HP SR number 8606223364. { $as_echo "$as_me:${as_lineno-$LINENO}: checking size of uint8_t" >&5 $as_echo_n "checking size of uint8_t... " >&6; } -if test "${ac_cv_sizeof_uint8_t+set}" = set; then : +if ${ac_cv_sizeof_uint8_t+:} false; then : $as_echo_n "(cached) " >&6 else if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (uint8_t))" "ac_cv_sizeof_uint8_t" "$ac_includes_default"; then : @@ -16442,9 +17770,8 @@ if test "$ac_cv_type_uint8_t" = yes; then { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -{ as_fn_set_status 77 -as_fn_error "cannot compute sizeof (uint8_t) -See \`config.log' for more details." "$LINENO" 5; }; } +as_fn_error 77 "cannot compute sizeof (uint8_t) +See \`config.log' for more details" "$LINENO" 5; } else ac_cv_sizeof_uint8_t=0 fi @@ -16489,16 +17816,22 @@ # DMH: Divide into two sets of tests: one for DODS and one for XDR if test x"$dap_use_c99_types" = 'xyes'; then + DODS_INT64=int64_t + DODS_UINT64=uint64_t DODS_INT32=int32_t DODS_UINT32=uint32_t DODS_INT16=int16_t DODS_UINT16=uint16_t + DODS_INT8=int8_t DODS_BYTE=uint8_t else + DODS_INT64="long long" + DODS_UINT64="unsigned long long" DODS_INT16=short DODS_UINT16="unsigned short" DODS_INT32=int DODS_UINT32="unsigned int" + DODS_INT8=char DODS_BYTE="unsigned char" fi DODS_FLOAT64=double @@ -16509,6 +17842,16 @@ # 2/15/2001 jhrg cat >>confdefs.h <<_ACEOF +#define DINT64 $DODS_INT64 +_ACEOF + + +cat >>confdefs.h <<_ACEOF +#define DUINT64 $DODS_UINT64 +_ACEOF + + +cat >>confdefs.h <<_ACEOF #define DINT32 $DODS_INT32 _ACEOF @@ -16539,11 +17882,20 @@ cat >>confdefs.h <<_ACEOF +#define DINT8 $DODS_INT8 +_ACEOF + + +cat >>confdefs.h <<_ACEOF #define DBYTE $DODS_BYTE _ACEOF # XDR INTEGER TYPES + # + # Since DAP4 does not use XDR, there are no defines for the int8 or the + # 64-bit integer types used by DAP4. jhrg 6/26/12 + # # Unfortunately, there is little commonality about xdr # First, we need to see if the xdr routines are in libc, librpc, @@ -16551,7 +17903,7 @@ dap_xdrlib= { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing xdr_void" >&5 $as_echo_n "checking for library containing xdr_void... " >&6; } -if test "${ac_cv_search_xdr_void+set}" = set; then : +if ${ac_cv_search_xdr_void+:} false; then : $as_echo_n "(cached) " >&6 else ac_func_search_save_LIBS=$LIBS @@ -16585,11 +17937,11 @@ fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext - if test "${ac_cv_search_xdr_void+set}" = set; then : + if ${ac_cv_search_xdr_void+:} false; then : break fi done -if test "${ac_cv_search_xdr_void+set}" = set; then : +if ${ac_cv_search_xdr_void+:} false; then : else ac_cv_search_xdr_void=no @@ -16620,7 +17972,7 @@ as_ac_Lib=`$as_echo "ac_cv_lib_$dap_xdrlib''_xdr_void" | $as_tr_sh` { $as_echo "$as_me:${as_lineno-$LINENO}: checking for xdr_void in -l$dap_xdrlib" >&5 $as_echo_n "checking for xdr_void in -l$dap_xdrlib... " >&6; } -if { as_var=$as_ac_Lib; eval "test \"\${$as_var+set}\" = set"; }; then : +if eval \${$as_ac_Lib+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS @@ -16655,8 +18007,7 @@ eval ac_res=\$$as_ac_Lib { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } -eval as_val=\$$as_ac_Lib - if test "x$as_val" = x""yes; then : +if eval test \"x\$"$as_ac_Lib"\" = x"yes"; then : cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_LIB$dap_xdrlib" | $as_tr_cpp` 1 _ACEOF @@ -16671,7 +18022,7 @@ as_ac_Lib=`$as_echo "ac_cv_lib_$dap_xdrlib''_xdr_uint32_t" | $as_tr_sh` { $as_echo "$as_me:${as_lineno-$LINENO}: checking for xdr_uint32_t in -l$dap_xdrlib" >&5 $as_echo_n "checking for xdr_uint32_t in -l$dap_xdrlib... " >&6; } -if { as_var=$as_ac_Lib; eval "test \"\${$as_var+set}\" = set"; }; then : +if eval \${$as_ac_Lib+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS @@ -16706,15 +18057,14 @@ eval ac_res=\$$as_ac_Lib { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } -eval as_val=\$$as_ac_Lib - if test "x$as_val" = x""yes; then : +if eval test \"x\$"$as_ac_Lib"\" = x"yes"; then : dap_xdrint=1 else as_ac_Lib=`$as_echo "ac_cv_lib_$dap_xdrlib''_xdr_u_int32_t" | $as_tr_sh` { $as_echo "$as_me:${as_lineno-$LINENO}: checking for xdr_u_int32_t in -l$dap_xdrlib" >&5 $as_echo_n "checking for xdr_u_int32_t in -l$dap_xdrlib... " >&6; } -if { as_var=$as_ac_Lib; eval "test \"\${$as_var+set}\" = set"; }; then : +if eval \${$as_ac_Lib+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS @@ -16749,15 +18099,14 @@ eval ac_res=\$$as_ac_Lib { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } -eval as_val=\$$as_ac_Lib - if test "x$as_val" = x""yes; then : +if eval test \"x\$"$as_ac_Lib"\" = x"yes"; then : dap_xdrint=2 else as_ac_Lib=`$as_echo "ac_cv_lib_$dap_xdrlib''_xdr_uint" | $as_tr_sh` { $as_echo "$as_me:${as_lineno-$LINENO}: checking for xdr_uint in -l$dap_xdrlib" >&5 $as_echo_n "checking for xdr_uint in -l$dap_xdrlib... " >&6; } -if { as_var=$as_ac_Lib; eval "test \"\${$as_var+set}\" = set"; }; then : +if eval \${$as_ac_Lib+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS @@ -16792,15 +18141,14 @@ eval ac_res=\$$as_ac_Lib { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } -eval as_val=\$$as_ac_Lib - if test "x$as_val" = x""yes; then : +if eval test \"x\$"$as_ac_Lib"\" = x"yes"; then : dap_xdrint=3 else as_ac_Lib=`$as_echo "ac_cv_lib_$dap_xdrlib''_xdr_u_int" | $as_tr_sh` { $as_echo "$as_me:${as_lineno-$LINENO}: checking for xdr_u_int in -l$dap_xdrlib" >&5 $as_echo_n "checking for xdr_u_int in -l$dap_xdrlib... " >&6; } -if { as_var=$as_ac_Lib; eval "test \"\${$as_var+set}\" = set"; }; then : +if eval \${$as_ac_Lib+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS @@ -16835,8 +18183,7 @@ eval ac_res=\$$as_ac_Lib { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } -eval as_val=\$$as_ac_Lib - if test "x$as_val" = x""yes; then : +if eval test \"x\$"$as_ac_Lib"\" = x"yes"; then : dap_xdrint=4 fi @@ -16872,7 +18219,7 @@ XDR_UINT16=xdr_u_short ;; *) - as_fn_error "Cannot determine DODS XDR integer sizes" "$LINENO" 5 + as_fn_error $? "Cannot determine DODS XDR integer sizes" "$LINENO" 5 ;; esac XDR_FLOAT64=xdr_double @@ -16909,42 +18256,27 @@ _ACEOF -if test "$CC" = "gcc" -then - if true; then - COMPILER_IS_GCC_TRUE= - COMPILER_IS_GCC_FALSE='#' -else - COMPILER_IS_GCC_TRUE='#' - COMPILER_IS_GCC_FALSE= +# Check whether --enable-runtime-endian-check was given. +if test "${enable_runtime_endian_check+set}" = set; then : + enableval=$enable_runtime_endian_check; fi -else - if false; then - COMPILER_IS_GCC_TRUE= - COMPILER_IS_GCC_FALSE='#' -else - COMPILER_IS_GCC_TRUE='#' - COMPILER_IS_GCC_FALSE= -fi -fi +if test "x$enable_runtime_endian_check" = "xyes"; then : -# Checks for library functions. -# These, at least some of them, cannot be used along with gnulib without -# breaking stuff. Since we are not bothering to handle the cases where these -# functions break, there's not much point in testing for them. However, it -# might be a good thing to use the gnulib versions since those fix various -# common problems found in many distributions. +$as_echo "#define COMPUTE_ENDIAN_AT_RUNTIME 1" >>confdefs.h + + +fi +# Checks for library functions. for ac_func in alarm atexit bzero dup2 getcwd getpagesize localtime_r memmove memset pow putenv setenv strchr strerror strtol strtoul timegm mktime do : as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var" -eval as_val=\$$as_ac_var - if test "x$as_val" = x""yes; then : +if eval test \"x\$"$as_ac_var"\" = x"yes"; then : cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF @@ -16961,6 +18293,7 @@ + LIBC_FATAL_STDERR_=1 export LIBC_FATAL_STDERR_ @@ -16968,7 +18301,7 @@ # for constant arguments. Useless! { $as_echo "$as_me:${as_lineno-$LINENO}: checking for working alloca.h" >&5 $as_echo_n "checking for working alloca.h... " >&6; } -if test "${ac_cv_working_alloca_h+set}" = set; then : +if ${ac_cv_working_alloca_h+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -17001,7 +18334,7 @@ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for alloca" >&5 $as_echo_n "checking for alloca... " >&6; } -if test "${ac_cv_func_alloca_works+set}" = set; then : +if ${ac_cv_func_alloca_works+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -17020,7 +18353,7 @@ #pragma alloca # else # ifndef alloca /* predefined by HP cc +Olibcalls */ -char *alloca (); +void *alloca (size_t); # endif # endif # endif @@ -17068,7 +18401,7 @@ { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether \`alloca.c' needs Cray hooks" >&5 $as_echo_n "checking whether \`alloca.c' needs Cray hooks... " >&6; } -if test "${ac_cv_os_cray+set}" = set; then : +if ${ac_cv_os_cray+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -17095,8 +18428,7 @@ for ac_func in _getb67 GETB67 getb67; do as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var" -eval as_val=\$$as_ac_var - if test "x$as_val" = x""yes; then : +if eval test \"x\$"$as_ac_var"\" = x"yes"; then : cat >>confdefs.h <<_ACEOF #define CRAY_STACKSEG_END $ac_func @@ -17110,7 +18442,7 @@ { $as_echo "$as_me:${as_lineno-$LINENO}: checking stack direction for C alloca" >&5 $as_echo_n "checking stack direction for C alloca... " >&6; } -if test "${ac_cv_c_stack_direction+set}" = set; then : +if ${ac_cv_c_stack_direction+:} false; then : $as_echo_n "(cached) " >&6 else if test "$cross_compiling" = yes; then : @@ -17120,23 +18452,20 @@ /* end confdefs.h. */ $ac_includes_default int -find_stack_direction () +find_stack_direction (int *addr, int depth) { - static char *addr = 0; - auto char dummy; - if (addr == 0) - { - addr = &dummy; - return find_stack_direction (); - } - else - return (&dummy > addr) ? 1 : -1; + int dir, dummy = 0; + if (! addr) + addr = &dummy; + *addr = addr < &dummy ? 1 : addr == &dummy ? 0 : -1; + dir = depth ? find_stack_direction (addr, depth - 1) : 0; + return dir + dummy; } int -main () +main (int argc, char **argv) { - return find_stack_direction () < 0; + return find_stack_direction (0, argc + !argv + 20) < 0; } _ACEOF if ac_fn_c_try_run "$LINENO"; then : @@ -17170,6 +18499,34 @@ GNULIB_WCSRTOMBS=0; GNULIB_WCSNRTOMBS=0; GNULIB_WCWIDTH=0; + GNULIB_WMEMCHR=0; + GNULIB_WMEMCMP=0; + GNULIB_WMEMCPY=0; + GNULIB_WMEMMOVE=0; + GNULIB_WMEMSET=0; + GNULIB_WCSLEN=0; + GNULIB_WCSNLEN=0; + GNULIB_WCSCPY=0; + GNULIB_WCPCPY=0; + GNULIB_WCSNCPY=0; + GNULIB_WCPNCPY=0; + GNULIB_WCSCAT=0; + GNULIB_WCSNCAT=0; + GNULIB_WCSCMP=0; + GNULIB_WCSNCMP=0; + GNULIB_WCSCASECMP=0; + GNULIB_WCSNCASECMP=0; + GNULIB_WCSCOLL=0; + GNULIB_WCSXFRM=0; + GNULIB_WCSDUP=0; + GNULIB_WCSCHR=0; + GNULIB_WCSRCHR=0; + GNULIB_WCSCSPN=0; + GNULIB_WCSSPN=0; + GNULIB_WCSPBRK=0; + GNULIB_WCSSTR=0; + GNULIB_WCSTOK=0; + GNULIB_WCSWIDTH=0; HAVE_BTOWC=1; HAVE_MBSINIT=1; HAVE_MBRTOWC=1; @@ -17179,6 +18536,34 @@ HAVE_WCRTOMB=1; HAVE_WCSRTOMBS=1; HAVE_WCSNRTOMBS=1; + HAVE_WMEMCHR=1; + HAVE_WMEMCMP=1; + HAVE_WMEMCPY=1; + HAVE_WMEMMOVE=1; + HAVE_WMEMSET=1; + HAVE_WCSLEN=1; + HAVE_WCSNLEN=1; + HAVE_WCSCPY=1; + HAVE_WCPCPY=1; + HAVE_WCSNCPY=1; + HAVE_WCPNCPY=1; + HAVE_WCSCAT=1; + HAVE_WCSNCAT=1; + HAVE_WCSCMP=1; + HAVE_WCSNCMP=1; + HAVE_WCSCASECMP=1; + HAVE_WCSNCASECMP=1; + HAVE_WCSCOLL=1; + HAVE_WCSXFRM=1; + HAVE_WCSDUP=1; + HAVE_WCSCHR=1; + HAVE_WCSRCHR=1; + HAVE_WCSCSPN=1; + HAVE_WCSSPN=1; + HAVE_WCSPBRK=1; + HAVE_WCSSTR=1; + HAVE_WCSTOK=1; + HAVE_WCSWIDTH=1; HAVE_DECL_WCTOB=1; HAVE_DECL_WCWIDTH=1; REPLACE_MBSTATE_T=0; @@ -17193,11 +18578,12 @@ REPLACE_WCSRTOMBS=0; REPLACE_WCSNRTOMBS=0; REPLACE_WCWIDTH=0; + REPLACE_WCSWIDTH=0; { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether uses 'inline' correctly" >&5 $as_echo_n "checking whether uses 'inline' correctly... " >&6; } -if test "${gl_cv_header_wchar_h_correct_inline+set}" = set; then : +if ${gl_cv_header_wchar_h_correct_inline+:} false; then : $as_echo_n "(cached) " >&6 else gl_cv_header_wchar_h_correct_inline=yes @@ -17257,7 +18643,7 @@ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_header_wchar_h_correct_inline" >&5 $as_echo "$gl_cv_header_wchar_h_correct_inline" >&6; } if test $gl_cv_header_wchar_h_correct_inline = no; then - as_fn_error " cannot be used with this compiler ($CC $CFLAGS $CPPFLAGS). + as_fn_error $? " cannot be used with this compiler ($CC $CFLAGS $CPPFLAGS). This is a known interoperability problem of glibc <= 2.5 with gcc >= 4.3 in C99 mode. You have four options: - Add the flag -fgnu89-inline to CC and reconfigure, or @@ -17275,8 +18661,7 @@ do : as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var" -eval as_val=\$$as_ac_var - if test "x$as_val" = x""yes; then : +if eval test \"x\$"$as_ac_var"\" = x"yes"; then : cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF @@ -17289,7 +18674,7 @@ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for nl_langinfo and CODESET" >&5 $as_echo_n "checking for nl_langinfo and CODESET... " >&6; } -if test "${am_cv_langinfo_codeset+set}" = set; then : +if ${am_cv_langinfo_codeset+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -17325,7 +18710,7 @@ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for a traditional french locale" >&5 $as_echo_n "checking for a traditional french locale... " >&6; } -if test "${gt_cv_locale_fr+set}" = set; then : +if ${gt_cv_locale_fr+:} false; then : $as_echo_n "(cached) " >&6 else @@ -17343,9 +18728,19 @@ char buf[16]; int main () { /* Check whether the given locale name is recognized by the system. */ +#if (defined _WIN32 || defined __WIN32__) && !defined __CYGWIN__ + /* On native Windows, setlocale(category, "") looks at the system settings, + not at the environment variables. Also, when an encoding suffix such + as ".65001" or ".54936" is specified, it succeeds but sets the LC_CTYPE + category of the locale to "C". */ + if (setlocale (LC_ALL, getenv ("LC_ALL")) == NULL + || strcmp (setlocale (LC_CTYPE, NULL), "C") == 0) + return 1; +#else if (setlocale (LC_ALL, "") == NULL) return 1; +#endif /* Check whether nl_langinfo(CODESET) is nonempty and not "ASCII" or "646". - On MacOS X 10.3.5 (Darwin 7.5) in the fr_FR locale, nl_langinfo(CODESET) + On Mac OS X 10.3.5 (Darwin 7.5) in the fr_FR locale, nl_langinfo(CODESET) is empty, and the behaviour of Tcl 8.4 in this locale is not useful. On OpenBSD 4.0, when an unsupported locale is specified, setlocale() succeeds but then nl_langinfo(CODESET) is "646". In this situation, @@ -17371,10 +18766,12 @@ one byte long. This excludes the UTF-8 encoding. */ t.tm_year = 1975 - 1900; t.tm_mon = 2 - 1; t.tm_mday = 4; if (strftime (buf, sizeof (buf), "%b", &t) < 3 || buf[2] != 'v') return 1; +#if !defined __BIONIC__ /* Bionic libc's 'struct lconv' is just a dummy. */ /* Check whether the decimal separator is a comma. On NetBSD 3.0 in the fr_FR.ISO8859-1 locale, localeconv()->decimal_point are nl_langinfo(RADIXCHAR) are both ".". */ if (localeconv () ->decimal_point[0] != ',') return 1; +#endif return 0; } @@ -17384,37 +18781,56 @@ ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && test -s conftest$ac_exeext; then - # Setting LC_ALL is not enough. Need to set LC_TIME to empty, because - # otherwise on MacOS X 10.3.5 the LC_TIME=C from the beginning of the - # configure script would override the LC_ALL setting. Likewise for - # LC_CTYPE, which is also set at the beginning of the configure script. - # Test for the usual locale name. - if (LC_ALL=fr_FR LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then - gt_cv_locale_fr=fr_FR - else - # Test for the locale name with explicit encoding suffix. - if (LC_ALL=fr_FR.ISO-8859-1 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then - gt_cv_locale_fr=fr_FR.ISO-8859-1 - else - # Test for the AIX, OSF/1, FreeBSD, NetBSD, OpenBSD locale name. - if (LC_ALL=fr_FR.ISO8859-1 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then - gt_cv_locale_fr=fr_FR.ISO8859-1 + case "$host_os" in + # Handle native Windows specially, because there setlocale() interprets + # "ar" as "Arabic" or "Arabic_Saudi Arabia.1256", + # "fr" or "fra" as "French" or "French_France.1252", + # "ge"(!) or "deu"(!) as "German" or "German_Germany.1252", + # "ja" as "Japanese" or "Japanese_Japan.932", + # and similar. + mingw*) + # Test for the native Windows locale name. + if (LC_ALL=French_France.1252 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_fr=French_France.1252 + else + # None found. + gt_cv_locale_fr=none + fi + ;; + *) + # Setting LC_ALL is not enough. Need to set LC_TIME to empty, because + # otherwise on Mac OS X 10.3.5 the LC_TIME=C from the beginning of the + # configure script would override the LC_ALL setting. Likewise for + # LC_CTYPE, which is also set at the beginning of the configure script. + # Test for the usual locale name. + if (LC_ALL=fr_FR LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_fr=fr_FR else - # Test for the HP-UX locale name. - if (LC_ALL=fr_FR.iso88591 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then - gt_cv_locale_fr=fr_FR.iso88591 + # Test for the locale name with explicit encoding suffix. + if (LC_ALL=fr_FR.ISO-8859-1 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_fr=fr_FR.ISO-8859-1 else - # Test for the Solaris 7 locale name. - if (LC_ALL=fr LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then - gt_cv_locale_fr=fr + # Test for the AIX, OSF/1, FreeBSD, NetBSD, OpenBSD locale name. + if (LC_ALL=fr_FR.ISO8859-1 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_fr=fr_FR.ISO8859-1 else - # None found. - gt_cv_locale_fr=none + # Test for the HP-UX locale name. + if (LC_ALL=fr_FR.iso88591 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_fr=fr_FR.iso88591 + else + # Test for the Solaris 7 locale name. + if (LC_ALL=fr LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_fr=fr + else + # None found. + gt_cv_locale_fr=none + fi + fi fi fi fi - fi - fi + ;; + esac fi rm -fr conftest* @@ -17433,7 +18849,7 @@ { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the preprocessor supports include_next" >&5 $as_echo_n "checking whether the preprocessor supports include_next... " >&6; } -if test "${gl_cv_have_include_next+set}" = set; then : +if ${gl_cv_have_include_next+:} false; then : $as_echo_n "(cached) " >&6 else rm -rf conftestd1a conftestd1b conftestd2 @@ -17513,7 +18929,7 @@ { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether system header files limit the line length" >&5 $as_echo_n "checking whether system header files limit the line length... " >&6; } -if test "${gl_cv_pragma_columns+set}" = set; then : +if ${gl_cv_pragma_columns+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -17551,8 +18967,7 @@ as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` ac_fn_c_check_header_compile "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default " -eval as_val=\$$as_ac_Header - if test "x$as_val" = x""yes; then : +if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF @@ -17565,9 +18980,16 @@ + + + + + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for working fcntl.h" >&5 $as_echo_n "checking for working fcntl.h... " >&6; } -if test "${gl_cv_header_working_fcntl_h+set}" = set; then : +if ${gl_cv_header_working_fcntl_h+:} false; then : $as_echo_n "(cached) " >&6 else if test "$cross_compiling" = yes; then : @@ -17577,7 +18999,13 @@ /* end confdefs.h. */ #include #include - #include + #if HAVE_UNISTD_H + # include + #else /* on Windows with MSVC */ + # include + # include + # defined sleep(n) _sleep ((n) * 1000) + #endif #include #ifndef O_NOATIME #define O_NOATIME 0 @@ -17596,6 +19024,7 @@ { int result = !constants; + #if HAVE_SYMLINK { static char const sym[] = "conftest.sym"; if (symlink (".", sym) != 0) @@ -17611,6 +19040,7 @@ } unlink (sym); } + #endif { static char const file[] = "confdefs.h"; int fd = open (file, O_RDONLY | O_NOATIME); @@ -17688,7 +19118,7 @@ ac_fn_c_check_decl "$LINENO" "getc_unlocked" "ac_cv_have_decl_getc_unlocked" "$ac_includes_default" -if test "x$ac_cv_have_decl_getc_unlocked" = x""yes; then : +if test "x$ac_cv_have_decl_getc_unlocked" = xyes; then : ac_have_decl=1 else ac_have_decl=0 @@ -17701,7 +19131,7 @@ { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the GNU C Library >= 2.1 or uClibc" >&5 $as_echo_n "checking whether we are using the GNU C Library >= 2.1 or uClibc... " >&6; } -if test "${ac_cv_gnu_library_2_1+set}" = set; then : +if ${ac_cv_gnu_library_2_1+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -17736,71 +19166,251 @@ - GNULIB__EXIT=0; - GNULIB_ATOLL=0; - GNULIB_CALLOC_POSIX=0; - GNULIB_CANONICALIZE_FILE_NAME=0; - GNULIB_GETLOADAVG=0; - GNULIB_GETSUBOPT=0; - GNULIB_GRANTPT=0; - GNULIB_MALLOC_POSIX=0; - GNULIB_MKDTEMP=0; - GNULIB_MKOSTEMP=0; - GNULIB_MKOSTEMPS=0; - GNULIB_MKSTEMP=0; - GNULIB_MKSTEMPS=0; - GNULIB_PTSNAME=0; - GNULIB_PUTENV=0; - GNULIB_RANDOM_R=0; - GNULIB_REALLOC_POSIX=0; - GNULIB_REALPATH=0; - GNULIB_RPMATCH=0; - GNULIB_SETENV=0; - GNULIB_STRTOD=0; - GNULIB_STRTOLL=0; - GNULIB_STRTOULL=0; - GNULIB_SYSTEM_POSIX=0; - GNULIB_UNLOCKPT=0; - GNULIB_UNSETENV=0; - HAVE__EXIT=1; - HAVE_ATOLL=1; - HAVE_CANONICALIZE_FILE_NAME=1; - HAVE_DECL_GETLOADAVG=1; - HAVE_GETSUBOPT=1; - HAVE_GRANTPT=1; - HAVE_MKDTEMP=1; - HAVE_MKOSTEMP=1; - HAVE_MKOSTEMPS=1; - HAVE_MKSTEMP=1; - HAVE_MKSTEMPS=1; - HAVE_PTSNAME=1; - HAVE_RANDOM_R=1; - HAVE_REALPATH=1; - HAVE_RPMATCH=1; - HAVE_SETENV=1; - HAVE_DECL_SETENV=1; - HAVE_STRTOD=1; - HAVE_STRTOLL=1; - HAVE_STRTOULL=1; - HAVE_STRUCT_RANDOM_DATA=1; - HAVE_SYS_LOADAVG_H=0; - HAVE_UNLOCKPT=1; - HAVE_DECL_UNSETENV=1; - REPLACE_CALLOC=0; - REPLACE_CANONICALIZE_FILE_NAME=0; - REPLACE_MALLOC=0; - REPLACE_MKSTEMP=0; - REPLACE_PUTENV=0; - REPLACE_REALLOC=0; + GNULIB_LOCALECONV=0; + GNULIB_SETLOCALE=0; + GNULIB_DUPLOCALE=0; + HAVE_DUPLOCALE=1; + REPLACE_LOCALECONV=0; + REPLACE_SETLOCALE=0; + REPLACE_DUPLOCALE=0; + REPLACE_STRUCT_LCONV=0; + + + REPLACE_NULL=0; + HAVE_WCHAR_T=1; + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for wchar_t" >&5 +$as_echo_n "checking for wchar_t... " >&6; } +if ${gt_cv_c_wchar_t+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include + wchar_t foo = (wchar_t)'\0'; +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + gt_cv_c_wchar_t=yes +else + gt_cv_c_wchar_t=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gt_cv_c_wchar_t" >&5 +$as_echo "$gt_cv_c_wchar_t" >&6; } + if test $gt_cv_c_wchar_t = yes; then + +$as_echo "#define HAVE_WCHAR_T 1" >>confdefs.h + + fi + + + + + STDDEF_H= + if test $gt_cv_c_wchar_t = no; then + HAVE_WCHAR_T=0 + STDDEF_H=stddef.h + fi + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether NULL can be used in arbitrary expressions" >&5 +$as_echo_n "checking whether NULL can be used in arbitrary expressions... " >&6; } +if ${gl_cv_decl_null_works+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include + int test[2 * (sizeof NULL == sizeof (void *)) -1]; + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + gl_cv_decl_null_works=yes +else + gl_cv_decl_null_works=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_decl_null_works" >&5 +$as_echo "$gl_cv_decl_null_works" >&6; } + if test $gl_cv_decl_null_works = no; then + REPLACE_NULL=1 + STDDEF_H=stddef.h + fi + + if test -n "$STDDEF_H"; then + GL_GENERATE_STDDEF_H_TRUE= + GL_GENERATE_STDDEF_H_FALSE='#' +else + GL_GENERATE_STDDEF_H_TRUE='#' + GL_GENERATE_STDDEF_H_FALSE= +fi + + if test -n "$STDDEF_H"; then + + + + + + + + + if test $gl_cv_have_include_next = yes; then + gl_cv_next_stddef_h='<'stddef.h'>' + else + { $as_echo "$as_me:${as_lineno-$LINENO}: checking absolute name of " >&5 +$as_echo_n "checking absolute name of ... " >&6; } +if ${gl_cv_next_stddef_h+:} false; then : + $as_echo_n "(cached) " >&6 +else + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include + +_ACEOF + case "$host_os" in + aix*) gl_absname_cpp="$ac_cpp -C" ;; + *) gl_absname_cpp="$ac_cpp" ;; + esac + + case "$host_os" in + mingw*) + gl_dirsep_regex='[/\\]' + ;; + *) + gl_dirsep_regex='\/' + ;; + esac + gl_make_literal_regex_sed='s,[]$^\\.*/[],\\&,g' + + gl_header_literal_regex=`echo 'stddef.h' \ + | sed -e "$gl_make_literal_regex_sed"` + gl_absolute_header_sed="/${gl_dirsep_regex}${gl_header_literal_regex}/"'{ + s/.*"\(.*'"${gl_dirsep_regex}${gl_header_literal_regex}"'\)".*/\1/ + s|^/[^/]|//&| + p + q + }' + gl_cv_next_stddef_h='"'`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 | + sed -n "$gl_absolute_header_sed"`'"' + + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_stddef_h" >&5 +$as_echo "$gl_cv_next_stddef_h" >&6; } + fi + NEXT_STDDEF_H=$gl_cv_next_stddef_h + + if test $gl_cv_have_include_next = yes || test $gl_cv_have_include_next = buggy; then + # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include_next' + gl_next_as_first_directive='<'stddef.h'>' + else + # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include' + gl_next_as_first_directive=$gl_cv_next_stddef_h + fi + NEXT_AS_FIRST_DIRECTIVE_STDDEF_H=$gl_next_as_first_directive + + + + + fi + + + + + GNULIB__EXIT=0; + GNULIB_ATOLL=0; + GNULIB_CALLOC_POSIX=0; + GNULIB_CANONICALIZE_FILE_NAME=0; + GNULIB_GETLOADAVG=0; + GNULIB_GETSUBOPT=0; + GNULIB_GRANTPT=0; + GNULIB_MALLOC_POSIX=0; + GNULIB_MBTOWC=0; + GNULIB_MKDTEMP=0; + GNULIB_MKOSTEMP=0; + GNULIB_MKOSTEMPS=0; + GNULIB_MKSTEMP=0; + GNULIB_MKSTEMPS=0; + GNULIB_POSIX_OPENPT=0; + GNULIB_PTSNAME=0; + GNULIB_PTSNAME_R=0; + GNULIB_PUTENV=0; + GNULIB_RANDOM=0; + GNULIB_RANDOM_R=0; + GNULIB_REALLOC_POSIX=0; + GNULIB_REALPATH=0; + GNULIB_RPMATCH=0; + GNULIB_SETENV=0; + GNULIB_STRTOD=0; + GNULIB_STRTOLL=0; + GNULIB_STRTOULL=0; + GNULIB_SYSTEM_POSIX=0; + GNULIB_UNLOCKPT=0; + GNULIB_UNSETENV=0; + GNULIB_WCTOMB=0; + HAVE__EXIT=1; + HAVE_ATOLL=1; + HAVE_CANONICALIZE_FILE_NAME=1; + HAVE_DECL_GETLOADAVG=1; + HAVE_GETSUBOPT=1; + HAVE_GRANTPT=1; + HAVE_MKDTEMP=1; + HAVE_MKOSTEMP=1; + HAVE_MKOSTEMPS=1; + HAVE_MKSTEMP=1; + HAVE_MKSTEMPS=1; + HAVE_POSIX_OPENPT=1; + HAVE_PTSNAME=1; + HAVE_PTSNAME_R=1; + HAVE_RANDOM=1; + HAVE_RANDOM_H=1; + HAVE_RANDOM_R=1; + HAVE_REALPATH=1; + HAVE_RPMATCH=1; + HAVE_SETENV=1; + HAVE_DECL_SETENV=1; + HAVE_STRTOD=1; + HAVE_STRTOLL=1; + HAVE_STRTOULL=1; + HAVE_STRUCT_RANDOM_DATA=1; + HAVE_SYS_LOADAVG_H=0; + HAVE_UNLOCKPT=1; + HAVE_DECL_UNSETENV=1; + REPLACE_CALLOC=0; + REPLACE_CANONICALIZE_FILE_NAME=0; + REPLACE_MALLOC=0; + REPLACE_MBTOWC=0; + REPLACE_MKSTEMP=0; + REPLACE_PTSNAME_R=0; + REPLACE_PUTENV=0; + REPLACE_RANDOM_R=0; + REPLACE_REALLOC=0; REPLACE_REALPATH=0; REPLACE_SETENV=0; REPLACE_STRTOD=0; REPLACE_UNSETENV=0; + REPLACE_WCTOMB=0; { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether malloc, realloc, calloc are POSIX compliant" >&5 $as_echo_n "checking whether malloc, realloc, calloc are POSIX compliant... " >&6; } -if test "${gl_cv_func_malloc_posix+set}" = set; then : +if ${gl_cv_func_malloc_posix+:} false; then : $as_echo_n "(cached) " >&6 else @@ -17833,7 +19443,7 @@ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for mbstate_t" >&5 $as_echo_n "checking for mbstate_t... " >&6; } -if test "${ac_cv_type_mbstate_t+set}" = set; then : +if ${ac_cv_type_mbstate_t+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -17883,7 +19493,7 @@ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for a traditional japanese locale" >&5 $as_echo_n "checking for a traditional japanese locale... " >&6; } -if test "${gt_cv_locale_ja+set}" = set; then : +if ${gt_cv_locale_ja+:} false; then : $as_echo_n "(cached) " >&6 else @@ -17903,9 +19513,19 @@ { const char *p; /* Check whether the given locale name is recognized by the system. */ +#if (defined _WIN32 || defined __WIN32__) && !defined __CYGWIN__ + /* On native Windows, setlocale(category, "") looks at the system settings, + not at the environment variables. Also, when an encoding suffix such + as ".65001" or ".54936" is specified, it succeeds but sets the LC_CTYPE + category of the locale to "C". */ + if (setlocale (LC_ALL, getenv ("LC_ALL")) == NULL + || strcmp (setlocale (LC_CTYPE, NULL), "C") == 0) + return 1; +#else if (setlocale (LC_ALL, "") == NULL) return 1; +#endif /* Check whether nl_langinfo(CODESET) is nonempty and not "ASCII" or "646". - On MacOS X 10.3.5 (Darwin 7.5) in the fr_FR locale, nl_langinfo(CODESET) + On Mac OS X 10.3.5 (Darwin 7.5) in the fr_FR locale, nl_langinfo(CODESET) is empty, and the behaviour of Tcl 8.4 in this locale is not useful. On OpenBSD 4.0, when an unsupported locale is specified, setlocale() succeeds but then nl_langinfo(CODESET) is "646". In this situation, @@ -17946,42 +19566,58 @@ ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && test -s conftest$ac_exeext; then - # Setting LC_ALL is not enough. Need to set LC_TIME to empty, because - # otherwise on MacOS X 10.3.5 the LC_TIME=C from the beginning of the - # configure script would override the LC_ALL setting. Likewise for - # LC_CTYPE, which is also set at the beginning of the configure script. - # Test for the AIX locale name. - if (LC_ALL=ja_JP LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then - gt_cv_locale_ja=ja_JP - else - # Test for the locale name with explicit encoding suffix. - if (LC_ALL=ja_JP.EUC-JP LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then - gt_cv_locale_ja=ja_JP.EUC-JP - else - # Test for the HP-UX, OSF/1, NetBSD locale name. - if (LC_ALL=ja_JP.eucJP LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then - gt_cv_locale_ja=ja_JP.eucJP + case "$host_os" in + # Handle native Windows specially, because there setlocale() interprets + # "ar" as "Arabic" or "Arabic_Saudi Arabia.1256", + # "fr" or "fra" as "French" or "French_France.1252", + # "ge"(!) or "deu"(!) as "German" or "German_Germany.1252", + # "ja" as "Japanese" or "Japanese_Japan.932", + # and similar. + mingw*) + # Note that on native Windows, the Japanese locale is + # Japanese_Japan.932, and CP932 is very different from EUC-JP, so we + # cannot use it here. + gt_cv_locale_ja=none + ;; + *) + # Setting LC_ALL is not enough. Need to set LC_TIME to empty, because + # otherwise on Mac OS X 10.3.5 the LC_TIME=C from the beginning of the + # configure script would override the LC_ALL setting. Likewise for + # LC_CTYPE, which is also set at the beginning of the configure script. + # Test for the AIX locale name. + if (LC_ALL=ja_JP LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_ja=ja_JP else - # Test for the IRIX, FreeBSD locale name. - if (LC_ALL=ja_JP.EUC LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then - gt_cv_locale_ja=ja_JP.EUC + # Test for the locale name with explicit encoding suffix. + if (LC_ALL=ja_JP.EUC-JP LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_ja=ja_JP.EUC-JP else - # Test for the Solaris 7 locale name. - if (LC_ALL=ja LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then - gt_cv_locale_ja=ja + # Test for the HP-UX, OSF/1, NetBSD locale name. + if (LC_ALL=ja_JP.eucJP LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_ja=ja_JP.eucJP else - # Special test for NetBSD 1.6. - if test -f /usr/share/locale/ja_JP.eucJP/LC_CTYPE; then - gt_cv_locale_ja=ja_JP.eucJP + # Test for the IRIX, FreeBSD locale name. + if (LC_ALL=ja_JP.EUC LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_ja=ja_JP.EUC else - # None found. - gt_cv_locale_ja=none + # Test for the Solaris 7 locale name. + if (LC_ALL=ja LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_ja=ja + else + # Special test for NetBSD 1.6. + if test -f /usr/share/locale/ja_JP.eucJP/LC_CTYPE; then + gt_cv_locale_ja=ja_JP.eucJP + else + # None found. + gt_cv_locale_ja=none + fi + fi fi fi fi fi - fi - fi + ;; + esac fi rm -fr conftest* @@ -17994,575 +19630,1465 @@ - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for a transitional chinese locale" >&5 -$as_echo_n "checking for a transitional chinese locale... " >&6; } -if test "${gt_cv_locale_zh_CN+set}" = set; then : - $as_echo_n "(cached) " >&6 -else + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for a transitional chinese locale" >&5 +$as_echo_n "checking for a transitional chinese locale... " >&6; } +if ${gt_cv_locale_zh_CN+:} false; then : + $as_echo_n "(cached) " >&6 +else + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include +#include +#include +#if HAVE_LANGINFO_CODESET +# include +#endif +#include +#include +struct tm t; +char buf[16]; +int main () +{ + const char *p; + /* Check whether the given locale name is recognized by the system. */ +#if (defined _WIN32 || defined __WIN32__) && !defined __CYGWIN__ + /* On native Windows, setlocale(category, "") looks at the system settings, + not at the environment variables. Also, when an encoding suffix such + as ".65001" or ".54936" is specified, it succeeds but sets the LC_CTYPE + category of the locale to "C". */ + if (setlocale (LC_ALL, getenv ("LC_ALL")) == NULL + || strcmp (setlocale (LC_CTYPE, NULL), "C") == 0) + return 1; +#else + if (setlocale (LC_ALL, "") == NULL) return 1; +#endif + /* Check whether nl_langinfo(CODESET) is nonempty and not "ASCII" or "646". + On Mac OS X 10.3.5 (Darwin 7.5) in the fr_FR locale, nl_langinfo(CODESET) + is empty, and the behaviour of Tcl 8.4 in this locale is not useful. + On OpenBSD 4.0, when an unsupported locale is specified, setlocale() + succeeds but then nl_langinfo(CODESET) is "646". In this situation, + some unit tests fail. + On MirBSD 10, when an unsupported locale is specified, setlocale() + succeeds but then nl_langinfo(CODESET) is "UTF-8". */ +#if HAVE_LANGINFO_CODESET + { + const char *cs = nl_langinfo (CODESET); + if (cs[0] == '\0' || strcmp (cs, "ASCII") == 0 || strcmp (cs, "646") == 0 + || strcmp (cs, "UTF-8") == 0) + return 1; + } +#endif +#ifdef __CYGWIN__ + /* On Cygwin, avoid locale names without encoding suffix, because the + locale_charset() function relies on the encoding suffix. Note that + LC_ALL is set on the command line. */ + if (strchr (getenv ("LC_ALL"), '.') == NULL) return 1; +#endif + /* Check whether in a month name, no byte in the range 0x80..0x9F occurs. + This excludes the UTF-8 encoding (except on MirBSD). */ + t.tm_year = 1975 - 1900; t.tm_mon = 2 - 1; t.tm_mday = 4; + if (strftime (buf, sizeof (buf), "%B", &t) < 2) return 1; + for (p = buf; *p != '\0'; p++) + if ((unsigned char) *p >= 0x80 && (unsigned char) *p < 0xa0) + return 1; + /* Check whether a typical GB18030 multibyte sequence is recognized as a + single wide character. This excludes the GB2312 and GBK encodings. */ + if (mblen ("\203\062\332\066", 5) != 4) + return 1; + return 0; +} + +_ACEOF + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5 + (eval $ac_link) 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && test -s conftest$ac_exeext; then + case "$host_os" in + # Handle native Windows specially, because there setlocale() interprets + # "ar" as "Arabic" or "Arabic_Saudi Arabia.1256", + # "fr" or "fra" as "French" or "French_France.1252", + # "ge"(!) or "deu"(!) as "German" or "German_Germany.1252", + # "ja" as "Japanese" or "Japanese_Japan.932", + # and similar. + mingw*) + # Test for the hypothetical native Windows locale name. + if (LC_ALL=Chinese_China.54936 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_zh_CN=Chinese_China.54936 + else + # None found. + gt_cv_locale_zh_CN=none + fi + ;; + solaris2.8) + # On Solaris 8, the locales zh_CN.GB18030, zh_CN.GBK, zh.GBK are + # broken. One witness is the test case in gl_MBRTOWC_SANITYCHECK. + # Another witness is that "LC_ALL=zh_CN.GB18030 bash -c true" dumps core. + gt_cv_locale_zh_CN=none + ;; + *) + # Setting LC_ALL is not enough. Need to set LC_TIME to empty, because + # otherwise on Mac OS X 10.3.5 the LC_TIME=C from the beginning of the + # configure script would override the LC_ALL setting. Likewise for + # LC_CTYPE, which is also set at the beginning of the configure script. + # Test for the locale name without encoding suffix. + if (LC_ALL=zh_CN LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_zh_CN=zh_CN + else + # Test for the locale name with explicit encoding suffix. + if (LC_ALL=zh_CN.GB18030 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_zh_CN=zh_CN.GB18030 + else + # None found. + gt_cv_locale_zh_CN=none + fi + fi + ;; + esac + else + # If there was a link error, due to mblen(), the system is so old that + # it certainly doesn't have a chinese locale. + gt_cv_locale_zh_CN=none + fi + rm -fr conftest* + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gt_cv_locale_zh_CN" >&5 +$as_echo "$gt_cv_locale_zh_CN" >&6; } + LOCALE_ZH_CN=$gt_cv_locale_zh_CN + + + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for a french Unicode locale" >&5 +$as_echo_n "checking for a french Unicode locale... " >&6; } +if ${gt_cv_locale_fr_utf8+:} false; then : + $as_echo_n "(cached) " >&6 +else + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include +#include +#if HAVE_LANGINFO_CODESET +# include +#endif +#include +#include +struct tm t; +char buf[16]; +int main () { + /* On BeOS and Haiku, locales are not implemented in libc. Rather, libintl + imitates locale dependent behaviour by looking at the environment + variables, and all locales use the UTF-8 encoding. */ +#if !(defined __BEOS__ || defined __HAIKU__) + /* Check whether the given locale name is recognized by the system. */ +# if (defined _WIN32 || defined __WIN32__) && !defined __CYGWIN__ + /* On native Windows, setlocale(category, "") looks at the system settings, + not at the environment variables. Also, when an encoding suffix such + as ".65001" or ".54936" is specified, it succeeds but sets the LC_CTYPE + category of the locale to "C". */ + if (setlocale (LC_ALL, getenv ("LC_ALL")) == NULL + || strcmp (setlocale (LC_CTYPE, NULL), "C") == 0) + return 1; +# else + if (setlocale (LC_ALL, "") == NULL) return 1; +# endif + /* Check whether nl_langinfo(CODESET) is nonempty and not "ASCII" or "646". + On Mac OS X 10.3.5 (Darwin 7.5) in the fr_FR locale, nl_langinfo(CODESET) + is empty, and the behaviour of Tcl 8.4 in this locale is not useful. + On OpenBSD 4.0, when an unsupported locale is specified, setlocale() + succeeds but then nl_langinfo(CODESET) is "646". In this situation, + some unit tests fail. */ +# if HAVE_LANGINFO_CODESET + { + const char *cs = nl_langinfo (CODESET); + if (cs[0] == '\0' || strcmp (cs, "ASCII") == 0 || strcmp (cs, "646") == 0) + return 1; + } +# endif +# ifdef __CYGWIN__ + /* On Cygwin, avoid locale names without encoding suffix, because the + locale_charset() function relies on the encoding suffix. Note that + LC_ALL is set on the command line. */ + if (strchr (getenv ("LC_ALL"), '.') == NULL) return 1; +# endif + /* Check whether in the abbreviation of the second month, the second + character (should be U+00E9: LATIN SMALL LETTER E WITH ACUTE) is + two bytes long, with UTF-8 encoding. */ + t.tm_year = 1975 - 1900; t.tm_mon = 2 - 1; t.tm_mday = 4; + if (strftime (buf, sizeof (buf), "%b", &t) < 4 + || buf[1] != (char) 0xc3 || buf[2] != (char) 0xa9 || buf[3] != 'v') + return 1; +#endif +#if !defined __BIONIC__ /* Bionic libc's 'struct lconv' is just a dummy. */ + /* Check whether the decimal separator is a comma. + On NetBSD 3.0 in the fr_FR.ISO8859-1 locale, localeconv()->decimal_point + are nl_langinfo(RADIXCHAR) are both ".". */ + if (localeconv () ->decimal_point[0] != ',') return 1; +#endif + return 0; +} + +_ACEOF + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5 + (eval $ac_link) 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && test -s conftest$ac_exeext; then + case "$host_os" in + # Handle native Windows specially, because there setlocale() interprets + # "ar" as "Arabic" or "Arabic_Saudi Arabia.1256", + # "fr" or "fra" as "French" or "French_France.1252", + # "ge"(!) or "deu"(!) as "German" or "German_Germany.1252", + # "ja" as "Japanese" or "Japanese_Japan.932", + # and similar. + mingw*) + # Test for the hypothetical native Windows locale name. + if (LC_ALL=French_France.65001 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_fr_utf8=French_France.65001 + else + # None found. + gt_cv_locale_fr_utf8=none + fi + ;; + *) + # Setting LC_ALL is not enough. Need to set LC_TIME to empty, because + # otherwise on Mac OS X 10.3.5 the LC_TIME=C from the beginning of the + # configure script would override the LC_ALL setting. Likewise for + # LC_CTYPE, which is also set at the beginning of the configure script. + # Test for the usual locale name. + if (LC_ALL=fr_FR LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_fr_utf8=fr_FR + else + # Test for the locale name with explicit encoding suffix. + if (LC_ALL=fr_FR.UTF-8 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_fr_utf8=fr_FR.UTF-8 + else + # Test for the Solaris 7 locale name. + if (LC_ALL=fr.UTF-8 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_fr_utf8=fr.UTF-8 + else + # None found. + gt_cv_locale_fr_utf8=none + fi + fi + fi + ;; + esac + fi + rm -fr conftest* + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gt_cv_locale_fr_utf8" >&5 +$as_echo "$gt_cv_locale_fr_utf8" >&6; } + LOCALE_FR_UTF8=$gt_cv_locale_fr_utf8 + + + + gl_cv_c_multiarch=no + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#ifndef __APPLE_CC__ + not a universal capable compiler + #endif + typedef int dummy; + +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + + arch= + prev= + for word in ${CC} ${CFLAGS} ${CPPFLAGS} ${LDFLAGS}; do + if test -n "$prev"; then + case $word in + i?86 | x86_64 | ppc | ppc64) + if test -z "$arch" || test "$arch" = "$word"; then + arch="$word" + else + gl_cv_c_multiarch=yes + fi + ;; + esac + prev= + else + if test "x$word" = "x-arch"; then + prev=arch + fi + fi + done + +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + if test $gl_cv_c_multiarch = yes; then + APPLE_UNIVERSAL_BUILD=1 + else + APPLE_UNIVERSAL_BUILD=0 + fi + + + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for C/C++ restrict keyword" >&5 +$as_echo_n "checking for C/C++ restrict keyword... " >&6; } +if ${ac_cv_c_restrict+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_cv_c_restrict=no + # The order here caters to the fact that C++ does not require restrict. + for ac_kw in __restrict __restrict__ _Restrict restrict; do + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +typedef int * int_ptr; + int foo (int_ptr $ac_kw ip) { + return ip[0]; + } +int +main () +{ +int s[1]; + int * $ac_kw t = s; + t[0] = 0; + return foo(t) + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_cv_c_restrict=$ac_kw +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + test "$ac_cv_c_restrict" != no && break + done + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_restrict" >&5 +$as_echo "$ac_cv_c_restrict" >&6; } + + case $ac_cv_c_restrict in + restrict) ;; + no) $as_echo "#define restrict /**/" >>confdefs.h + ;; + *) cat >>confdefs.h <<_ACEOF +#define restrict $ac_cv_c_restrict +_ACEOF + ;; + esac + + + + + + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for stdbool.h that conforms to C99" >&5 +$as_echo_n "checking for stdbool.h that conforms to C99... " >&6; } +if ${ac_cv_header_stdbool_h+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + + #include + #ifndef bool + "error: bool is not defined" + #endif + #ifndef false + "error: false is not defined" + #endif + #if false + "error: false is not 0" + #endif + #ifndef true + "error: true is not defined" + #endif + #if true != 1 + "error: true is not 1" + #endif + #ifndef __bool_true_false_are_defined + "error: __bool_true_false_are_defined is not defined" + #endif + + struct s { _Bool s: 1; _Bool t; } s; + + char a[true == 1 ? 1 : -1]; + char b[false == 0 ? 1 : -1]; + char c[__bool_true_false_are_defined == 1 ? 1 : -1]; + char d[(bool) 0.5 == true ? 1 : -1]; + /* See body of main program for 'e'. */ + char f[(_Bool) 0.0 == false ? 1 : -1]; + char g[true]; + char h[sizeof (_Bool)]; + char i[sizeof s.t]; + enum { j = false, k = true, l = false * true, m = true * 256 }; + /* The following fails for + HP aC++/ANSI C B3910B A.05.55 [Dec 04 2003]. */ + _Bool n[m]; + char o[sizeof n == m * sizeof n[0] ? 1 : -1]; + char p[-1 - (_Bool) 0 < 0 && -1 - (bool) 0 < 0 ? 1 : -1]; + /* Catch a bug in an HP-UX C compiler. See + http://gcc.gnu.org/ml/gcc-patches/2003-12/msg02303.html + http://lists.gnu.org/archive/html/bug-coreutils/2005-11/msg00161.html + */ + _Bool q = true; + _Bool *pq = &q; + +int +main () +{ + + bool e = &s; + *pq |= q; + *pq |= ! q; + /* Refer to every declared value, to avoid compiler optimizations. */ + return (!a + !b + !c + !d + !e + !f + !g + !h + !i + !!j + !k + !!l + + !m + !n + !o + !p + !q + !pq); + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_cv_header_stdbool_h=yes +else + ac_cv_header_stdbool_h=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_stdbool_h" >&5 +$as_echo "$ac_cv_header_stdbool_h" >&6; } + ac_fn_c_check_type "$LINENO" "_Bool" "ac_cv_type__Bool" "$ac_includes_default" +if test "x$ac_cv_type__Bool" = xyes; then : + +cat >>confdefs.h <<_ACEOF +#define HAVE__BOOL 1 +_ACEOF + + +fi + + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for unsigned long long int" >&5 +$as_echo_n "checking for unsigned long long int... " >&6; } +if ${ac_cv_type_unsigned_long_long_int+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_cv_type_unsigned_long_long_int=yes + if test "x${ac_cv_prog_cc_c99-no}" = xno; then + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + + /* For now, do not test the preprocessor; as of 2007 there are too many + implementations with broken preprocessors. Perhaps this can + be revisited in 2012. In the meantime, code should not expect + #if to work with literals wider than 32 bits. */ + /* Test literals. */ + long long int ll = 9223372036854775807ll; + long long int nll = -9223372036854775807LL; + unsigned long long int ull = 18446744073709551615ULL; + /* Test constant expressions. */ + typedef int a[((-9223372036854775807LL < 0 && 0 < 9223372036854775807ll) + ? 1 : -1)]; + typedef int b[(18446744073709551615ULL <= (unsigned long long int) -1 + ? 1 : -1)]; + int i = 63; +int +main () +{ +/* Test availability of runtime routines for shift and division. */ + long long int llmax = 9223372036854775807ll; + unsigned long long int ullmax = 18446744073709551615ull; + return ((ll << 63) | (ll >> 63) | (ll < i) | (ll > i) + | (llmax / ll) | (llmax % ll) + | (ull << 63) | (ull >> 63) | (ull << i) | (ull >> i) + | (ullmax / ull) | (ullmax % ull)); + ; + return 0; +} + +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + +else + ac_cv_type_unsigned_long_long_int=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + fi +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_type_unsigned_long_long_int" >&5 +$as_echo "$ac_cv_type_unsigned_long_long_int" >&6; } + if test $ac_cv_type_unsigned_long_long_int = yes; then + +$as_echo "#define HAVE_UNSIGNED_LONG_LONG_INT 1" >>confdefs.h + + fi + + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for long long int" >&5 +$as_echo_n "checking for long long int... " >&6; } +if ${ac_cv_type_long_long_int+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_cv_type_long_long_int=yes + if test "x${ac_cv_prog_cc_c99-no}" = xno; then + ac_cv_type_long_long_int=$ac_cv_type_unsigned_long_long_int + if test $ac_cv_type_long_long_int = yes; then + if test "$cross_compiling" = yes; then : + : +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include + #ifndef LLONG_MAX + # define HALF \ + (1LL << (sizeof (long long int) * CHAR_BIT - 2)) + # define LLONG_MAX (HALF - 1 + HALF) + #endif +int +main () +{ +long long int n = 1; + int i; + for (i = 0; ; i++) + { + long long int m = n << i; + if (m >> i != n) + return 1; + if (LLONG_MAX / 2 < m) + break; + } + return 0; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_run "$LINENO"; then : + +else + ac_cv_type_long_long_int=no +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext +fi + + fi + fi +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_type_long_long_int" >&5 +$as_echo "$ac_cv_type_long_long_int" >&6; } + if test $ac_cv_type_long_long_int = yes; then + +$as_echo "#define HAVE_LONG_LONG_INT 1" >>confdefs.h + + fi + + + + + + + + + if test $ac_cv_type_long_long_int = yes; then + HAVE_LONG_LONG_INT=1 + else + HAVE_LONG_LONG_INT=0 + fi + + + if test $ac_cv_type_unsigned_long_long_int = yes; then + HAVE_UNSIGNED_LONG_LONG_INT=1 + else + HAVE_UNSIGNED_LONG_LONG_INT=0 + fi + + + + if test $ac_cv_header_wchar_h = yes; then + HAVE_WCHAR_H=1 + else + HAVE_WCHAR_H=0 + fi + + + if test $ac_cv_header_inttypes_h = yes; then + HAVE_INTTYPES_H=1 + else + HAVE_INTTYPES_H=0 + fi + + + if test $ac_cv_header_sys_types_h = yes; then + HAVE_SYS_TYPES_H=1 + else + HAVE_SYS_TYPES_H=0 + fi + + + + + + + + + + + + if test $gl_cv_have_include_next = yes; then + gl_cv_next_stdint_h='<'stdint.h'>' + else + { $as_echo "$as_me:${as_lineno-$LINENO}: checking absolute name of " >&5 +$as_echo_n "checking absolute name of ... " >&6; } +if ${gl_cv_next_stdint_h+:} false; then : + $as_echo_n "(cached) " >&6 +else + + if test $ac_cv_header_stdint_h = yes; then + + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include + +_ACEOF + case "$host_os" in + aix*) gl_absname_cpp="$ac_cpp -C" ;; + *) gl_absname_cpp="$ac_cpp" ;; + esac + + case "$host_os" in + mingw*) + gl_dirsep_regex='[/\\]' + ;; + *) + gl_dirsep_regex='\/' + ;; + esac + gl_make_literal_regex_sed='s,[]$^\\.*/[],\\&,g' + + gl_header_literal_regex=`echo 'stdint.h' \ + | sed -e "$gl_make_literal_regex_sed"` + gl_absolute_header_sed="/${gl_dirsep_regex}${gl_header_literal_regex}/"'{ + s/.*"\(.*'"${gl_dirsep_regex}${gl_header_literal_regex}"'\)".*/\1/ + s|^/[^/]|//&| + p + q + }' + gl_cv_next_stdint_h='"'`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 | + sed -n "$gl_absolute_header_sed"`'"' + else + gl_cv_next_stdint_h='<'stdint.h'>' + fi + + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_stdint_h" >&5 +$as_echo "$gl_cv_next_stdint_h" >&6; } + fi + NEXT_STDINT_H=$gl_cv_next_stdint_h + + if test $gl_cv_have_include_next = yes || test $gl_cv_have_include_next = buggy; then + # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include_next' + gl_next_as_first_directive='<'stdint.h'>' + else + # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include' + gl_next_as_first_directive=$gl_cv_next_stdint_h + fi + NEXT_AS_FIRST_DIRECTIVE_STDINT_H=$gl_next_as_first_directive + + + + + if test $ac_cv_header_stdint_h = yes; then + HAVE_STDINT_H=1 + else + HAVE_STDINT_H=0 + fi + + + if test $ac_cv_header_stdint_h = yes; then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether stdint.h conforms to C99" >&5 +$as_echo_n "checking whether stdint.h conforms to C99... " >&6; } +if ${gl_cv_header_working_stdint_h+:} false; then : + $as_echo_n "(cached) " >&6 +else + gl_cv_header_working_stdint_h=no + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + + +#define _GL_JUST_INCLUDE_SYSTEM_STDINT_H 1 /* work if build isn't clean */ +#include +/* Dragonfly defines WCHAR_MIN, WCHAR_MAX only in . */ +#if !(defined WCHAR_MIN && defined WCHAR_MAX) +#error "WCHAR_MIN, WCHAR_MAX not defined in " +#endif + + + /* BSD/OS 4.0.1 has a bug: , and must be + included before . */ + #include + #include + #if HAVE_WCHAR_H + # include + # include + # include + #endif + + +#ifdef INT8_MAX +int8_t a1 = INT8_MAX; +int8_t a1min = INT8_MIN; +#endif +#ifdef INT16_MAX +int16_t a2 = INT16_MAX; +int16_t a2min = INT16_MIN; +#endif +#ifdef INT32_MAX +int32_t a3 = INT32_MAX; +int32_t a3min = INT32_MIN; +#endif +#ifdef INT64_MAX +int64_t a4 = INT64_MAX; +int64_t a4min = INT64_MIN; +#endif +#ifdef UINT8_MAX +uint8_t b1 = UINT8_MAX; +#else +typedef int b1[(unsigned char) -1 != 255 ? 1 : -1]; +#endif +#ifdef UINT16_MAX +uint16_t b2 = UINT16_MAX; +#endif +#ifdef UINT32_MAX +uint32_t b3 = UINT32_MAX; +#endif +#ifdef UINT64_MAX +uint64_t b4 = UINT64_MAX; +#endif +int_least8_t c1 = INT8_C (0x7f); +int_least8_t c1max = INT_LEAST8_MAX; +int_least8_t c1min = INT_LEAST8_MIN; +int_least16_t c2 = INT16_C (0x7fff); +int_least16_t c2max = INT_LEAST16_MAX; +int_least16_t c2min = INT_LEAST16_MIN; +int_least32_t c3 = INT32_C (0x7fffffff); +int_least32_t c3max = INT_LEAST32_MAX; +int_least32_t c3min = INT_LEAST32_MIN; +int_least64_t c4 = INT64_C (0x7fffffffffffffff); +int_least64_t c4max = INT_LEAST64_MAX; +int_least64_t c4min = INT_LEAST64_MIN; +uint_least8_t d1 = UINT8_C (0xff); +uint_least8_t d1max = UINT_LEAST8_MAX; +uint_least16_t d2 = UINT16_C (0xffff); +uint_least16_t d2max = UINT_LEAST16_MAX; +uint_least32_t d3 = UINT32_C (0xffffffff); +uint_least32_t d3max = UINT_LEAST32_MAX; +uint_least64_t d4 = UINT64_C (0xffffffffffffffff); +uint_least64_t d4max = UINT_LEAST64_MAX; +int_fast8_t e1 = INT_FAST8_MAX; +int_fast8_t e1min = INT_FAST8_MIN; +int_fast16_t e2 = INT_FAST16_MAX; +int_fast16_t e2min = INT_FAST16_MIN; +int_fast32_t e3 = INT_FAST32_MAX; +int_fast32_t e3min = INT_FAST32_MIN; +int_fast64_t e4 = INT_FAST64_MAX; +int_fast64_t e4min = INT_FAST64_MIN; +uint_fast8_t f1 = UINT_FAST8_MAX; +uint_fast16_t f2 = UINT_FAST16_MAX; +uint_fast32_t f3 = UINT_FAST32_MAX; +uint_fast64_t f4 = UINT_FAST64_MAX; +#ifdef INTPTR_MAX +intptr_t g = INTPTR_MAX; +intptr_t gmin = INTPTR_MIN; +#endif +#ifdef UINTPTR_MAX +uintptr_t h = UINTPTR_MAX; +#endif +intmax_t i = INTMAX_MAX; +uintmax_t j = UINTMAX_MAX; + +#include /* for CHAR_BIT */ +#define TYPE_MINIMUM(t) \ + ((t) ((t) 0 < (t) -1 ? (t) 0 : ~ TYPE_MAXIMUM (t))) +#define TYPE_MAXIMUM(t) \ + ((t) ((t) 0 < (t) -1 \ + ? (t) -1 \ + : ((((t) 1 << (sizeof (t) * CHAR_BIT - 2)) - 1) * 2 + 1))) +struct s { + int check_PTRDIFF: + PTRDIFF_MIN == TYPE_MINIMUM (ptrdiff_t) + && PTRDIFF_MAX == TYPE_MAXIMUM (ptrdiff_t) + ? 1 : -1; + /* Detect bug in FreeBSD 6.0 / ia64. */ + int check_SIG_ATOMIC: + SIG_ATOMIC_MIN == TYPE_MINIMUM (sig_atomic_t) + && SIG_ATOMIC_MAX == TYPE_MAXIMUM (sig_atomic_t) + ? 1 : -1; + int check_SIZE: SIZE_MAX == TYPE_MAXIMUM (size_t) ? 1 : -1; + int check_WCHAR: + WCHAR_MIN == TYPE_MINIMUM (wchar_t) + && WCHAR_MAX == TYPE_MAXIMUM (wchar_t) + ? 1 : -1; + /* Detect bug in mingw. */ + int check_WINT: + WINT_MIN == TYPE_MINIMUM (wint_t) + && WINT_MAX == TYPE_MAXIMUM (wint_t) + ? 1 : -1; + + /* Detect bugs in glibc 2.4 and Solaris 10 stdint.h, among others. */ + int check_UINT8_C: + (-1 < UINT8_C (0)) == (-1 < (uint_least8_t) 0) ? 1 : -1; + int check_UINT16_C: + (-1 < UINT16_C (0)) == (-1 < (uint_least16_t) 0) ? 1 : -1; + + /* Detect bugs in OpenBSD 3.9 stdint.h. */ +#ifdef UINT8_MAX + int check_uint8: (uint8_t) -1 == UINT8_MAX ? 1 : -1; +#endif +#ifdef UINT16_MAX + int check_uint16: (uint16_t) -1 == UINT16_MAX ? 1 : -1; +#endif +#ifdef UINT32_MAX + int check_uint32: (uint32_t) -1 == UINT32_MAX ? 1 : -1; +#endif +#ifdef UINT64_MAX + int check_uint64: (uint64_t) -1 == UINT64_MAX ? 1 : -1; +#endif + int check_uint_least8: (uint_least8_t) -1 == UINT_LEAST8_MAX ? 1 : -1; + int check_uint_least16: (uint_least16_t) -1 == UINT_LEAST16_MAX ? 1 : -1; + int check_uint_least32: (uint_least32_t) -1 == UINT_LEAST32_MAX ? 1 : -1; + int check_uint_least64: (uint_least64_t) -1 == UINT_LEAST64_MAX ? 1 : -1; + int check_uint_fast8: (uint_fast8_t) -1 == UINT_FAST8_MAX ? 1 : -1; + int check_uint_fast16: (uint_fast16_t) -1 == UINT_FAST16_MAX ? 1 : -1; + int check_uint_fast32: (uint_fast32_t) -1 == UINT_FAST32_MAX ? 1 : -1; + int check_uint_fast64: (uint_fast64_t) -1 == UINT_FAST64_MAX ? 1 : -1; + int check_uintptr: (uintptr_t) -1 == UINTPTR_MAX ? 1 : -1; + int check_uintmax: (uintmax_t) -1 == UINTMAX_MAX ? 1 : -1; + int check_size: (size_t) -1 == SIZE_MAX ? 1 : -1; +}; + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + if test "$cross_compiling" = yes; then : + gl_cv_header_working_stdint_h=yes + +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + + +#define _GL_JUST_INCLUDE_SYSTEM_STDINT_H 1 /* work if build isn't clean */ +#include + + + /* BSD/OS 4.0.1 has a bug: , and must be + included before . */ + #include + #include + #if HAVE_WCHAR_H + # include + # include + # include + #endif - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include -#include -#include -#if HAVE_LANGINFO_CODESET -# include -#endif -#include +#include #include -struct tm t; -char buf[16]; -int main () -{ - const char *p; - /* Check whether the given locale name is recognized by the system. */ - if (setlocale (LC_ALL, "") == NULL) return 1; - /* Check whether nl_langinfo(CODESET) is nonempty and not "ASCII" or "646". - On MacOS X 10.3.5 (Darwin 7.5) in the fr_FR locale, nl_langinfo(CODESET) - is empty, and the behaviour of Tcl 8.4 in this locale is not useful. - On OpenBSD 4.0, when an unsupported locale is specified, setlocale() - succeeds but then nl_langinfo(CODESET) is "646". In this situation, - some unit tests fail. - On MirBSD 10, when an unsupported locale is specified, setlocale() - succeeds but then nl_langinfo(CODESET) is "UTF-8". */ -#if HAVE_LANGINFO_CODESET +#define MVAL(macro) MVAL1(macro) +#define MVAL1(expression) #expression +static const char *macro_values[] = { - const char *cs = nl_langinfo (CODESET); - if (cs[0] == '\0' || strcmp (cs, "ASCII") == 0 || strcmp (cs, "646") == 0 - || strcmp (cs, "UTF-8") == 0) - return 1; - } +#ifdef INT8_MAX + MVAL (INT8_MAX), #endif -#ifdef __CYGWIN__ - /* On Cygwin, avoid locale names without encoding suffix, because the - locale_charset() function relies on the encoding suffix. Note that - LC_ALL is set on the command line. */ - if (strchr (getenv ("LC_ALL"), '.') == NULL) return 1; +#ifdef INT16_MAX + MVAL (INT16_MAX), #endif - /* Check whether in a month name, no byte in the range 0x80..0x9F occurs. - This excludes the UTF-8 encoding (except on MirBSD). */ - t.tm_year = 1975 - 1900; t.tm_mon = 2 - 1; t.tm_mday = 4; - if (strftime (buf, sizeof (buf), "%B", &t) < 2) return 1; - for (p = buf; *p != '\0'; p++) - if ((unsigned char) *p >= 0x80 && (unsigned char) *p < 0xa0) - return 1; - /* Check whether a typical GB18030 multibyte sequence is recognized as a - single wide character. This excludes the GB2312 and GBK encodings. */ - if (mblen ("\203\062\332\066", 5) != 4) - return 1; +#ifdef INT32_MAX + MVAL (INT32_MAX), +#endif +#ifdef INT64_MAX + MVAL (INT64_MAX), +#endif +#ifdef UINT8_MAX + MVAL (UINT8_MAX), +#endif +#ifdef UINT16_MAX + MVAL (UINT16_MAX), +#endif +#ifdef UINT32_MAX + MVAL (UINT32_MAX), +#endif +#ifdef UINT64_MAX + MVAL (UINT64_MAX), +#endif + NULL + }; + +int +main () +{ + + const char **mv; + for (mv = macro_values; *mv != NULL; mv++) + { + const char *value = *mv; + /* Test whether it looks like a cast expression. */ + if (strncmp (value, "((unsigned int)"/*)*/, 15) == 0 + || strncmp (value, "((unsigned short)"/*)*/, 17) == 0 + || strncmp (value, "((unsigned char)"/*)*/, 16) == 0 + || strncmp (value, "((int)"/*)*/, 6) == 0 + || strncmp (value, "((signed short)"/*)*/, 15) == 0 + || strncmp (value, "((signed char)"/*)*/, 14) == 0) + return mv - macro_values + 1; + } + return 0; + + ; return 0; } +_ACEOF +if ac_fn_c_try_run "$LINENO"; then : + gl_cv_header_working_stdint_h=yes +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext +fi + +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_header_working_stdint_h" >&5 +$as_echo "$gl_cv_header_working_stdint_h" >&6; } + fi + if test "$gl_cv_header_working_stdint_h" = yes; then + STDINT_H= + else + for ac_header in sys/inttypes.h sys/bitypes.h +do : + as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` +ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default" +if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : + cat >>confdefs.h <<_ACEOF +#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF - if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5 - (eval $ac_link) 2>&5 - ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; } && test -s conftest$ac_exeext; then - # Setting LC_ALL is not enough. Need to set LC_TIME to empty, because - # otherwise on MacOS X 10.3.5 the LC_TIME=C from the beginning of the - # configure script would override the LC_ALL setting. Likewise for - # LC_CTYPE, which is also set at the beginning of the configure script. - # Test for the locale name without encoding suffix. - if (LC_ALL=zh_CN LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then - gt_cv_locale_zh_CN=zh_CN - else - # Test for the locale name with explicit encoding suffix. - if (LC_ALL=zh_CN.GB18030 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then - gt_cv_locale_zh_CN=zh_CN.GB18030 - else - # None found. - gt_cv_locale_zh_CN=none - fi - fi + +fi + +done + + if test $ac_cv_header_sys_inttypes_h = yes; then + HAVE_SYS_INTTYPES_H=1 else - # If there was a link error, due to mblen(), the system is so old that - # it certainly doesn't have a chinese locale. - gt_cv_locale_zh_CN=none + HAVE_SYS_INTTYPES_H=0 fi - rm -fr conftest* -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gt_cv_locale_zh_CN" >&5 -$as_echo "$gt_cv_locale_zh_CN" >&6; } - LOCALE_ZH_CN=$gt_cv_locale_zh_CN + if test $ac_cv_header_sys_bitypes_h = yes; then + HAVE_SYS_BITYPES_H=1 + else + HAVE_SYS_BITYPES_H=0 + fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for a french Unicode locale" >&5 -$as_echo_n "checking for a french Unicode locale... " >&6; } -if test "${gt_cv_locale_fr_utf8+set}" = set; then : + if test $APPLE_UNIVERSAL_BUILD = 0; then + + + for gltype in ptrdiff_t size_t ; do + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for bit size of $gltype" >&5 +$as_echo_n "checking for bit size of $gltype... " >&6; } +if eval \${gl_cv_bitsizeof_${gltype}+:} false; then : $as_echo_n "(cached) " >&6 else + if ac_fn_c_compute_int "$LINENO" "sizeof ($gltype) * CHAR_BIT" "result" " + /* BSD/OS 4.0.1 has a bug: , and must be + included before . */ + #include + #include + #if HAVE_WCHAR_H + # include + # include + # include + #endif - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ +#include "; then : -#include -#include -#if HAVE_LANGINFO_CODESET -# include -#endif -#include -#include -struct tm t; -char buf[16]; -int main () { - /* On BeOS and Haiku, locales are not implemented in libc. Rather, libintl - imitates locale dependent behaviour by looking at the environment - variables, and all locales use the UTF-8 encoding. */ -#if !(defined __BEOS__ || defined __HAIKU__) - /* Check whether the given locale name is recognized by the system. */ - if (setlocale (LC_ALL, "") == NULL) return 1; - /* Check whether nl_langinfo(CODESET) is nonempty and not "ASCII" or "646". - On MacOS X 10.3.5 (Darwin 7.5) in the fr_FR locale, nl_langinfo(CODESET) - is empty, and the behaviour of Tcl 8.4 in this locale is not useful. - On OpenBSD 4.0, when an unsupported locale is specified, setlocale() - succeeds but then nl_langinfo(CODESET) is "646". In this situation, - some unit tests fail. */ -# if HAVE_LANGINFO_CODESET - { - const char *cs = nl_langinfo (CODESET); - if (cs[0] == '\0' || strcmp (cs, "ASCII") == 0 || strcmp (cs, "646") == 0) - return 1; - } -# endif -# ifdef __CYGWIN__ - /* On Cygwin, avoid locale names without encoding suffix, because the - locale_charset() function relies on the encoding suffix. Note that - LC_ALL is set on the command line. */ - if (strchr (getenv ("LC_ALL"), '.') == NULL) return 1; -# endif - /* Check whether in the abbreviation of the second month, the second - character (should be U+00E9: LATIN SMALL LETTER E WITH ACUTE) is - two bytes long, with UTF-8 encoding. */ - t.tm_year = 1975 - 1900; t.tm_mon = 2 - 1; t.tm_mday = 4; - if (strftime (buf, sizeof (buf), "%b", &t) < 4 - || buf[1] != (char) 0xc3 || buf[2] != (char) 0xa9 || buf[3] != 'v') - return 1; -#endif - /* Check whether the decimal separator is a comma. - On NetBSD 3.0 in the fr_FR.ISO8859-1 locale, localeconv()->decimal_point - are nl_langinfo(RADIXCHAR) are both ".". */ - if (localeconv () ->decimal_point[0] != ',') return 1; - return 0; -} +else + result=unknown +fi -_ACEOF - if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5 - (eval $ac_link) 2>&5 - ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; } && test -s conftest$ac_exeext; then - # Setting LC_ALL is not enough. Need to set LC_TIME to empty, because - # otherwise on MacOS X 10.3.5 the LC_TIME=C from the beginning of the - # configure script would override the LC_ALL setting. Likewise for - # LC_CTYPE, which is also set at the beginning of the configure script. - # Test for the usual locale name. - if (LC_ALL=fr_FR LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then - gt_cv_locale_fr_utf8=fr_FR - else - # Test for the locale name with explicit encoding suffix. - if (LC_ALL=fr_FR.UTF-8 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then - gt_cv_locale_fr_utf8=fr_FR.UTF-8 - else - # Test for the Solaris 7 locale name. - if (LC_ALL=fr.UTF-8 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then - gt_cv_locale_fr_utf8=fr.UTF-8 - else - # None found. - gt_cv_locale_fr_utf8=none - fi - fi - fi - fi - rm -fr conftest* + eval gl_cv_bitsizeof_${gltype}=\$result fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gt_cv_locale_fr_utf8" >&5 -$as_echo "$gt_cv_locale_fr_utf8" >&6; } - LOCALE_FR_UTF8=$gt_cv_locale_fr_utf8 +eval ac_res=\$gl_cv_bitsizeof_${gltype} + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } + eval result=\$gl_cv_bitsizeof_${gltype} + if test $result = unknown; then + result=0 + fi + GLTYPE=`echo "$gltype" | tr 'abcdefghijklmnopqrstuvwxyz ' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ_'` + cat >>confdefs.h <<_ACEOF +#define BITSIZEOF_${GLTYPE} $result +_ACEOF + eval BITSIZEOF_${GLTYPE}=\$result + done - gl_cv_c_multiarch=no - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#ifndef __APPLE_CC__ - not a universal capable compiler - #endif - typedef int dummy; + fi -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - arch= - prev= - for word in ${CC} ${CFLAGS} ${CPPFLAGS} ${LDFLAGS}; do - if test -n "$prev"; then - case $word in - i?86 | x86_64 | ppc | ppc64) - if test -z "$arch" || test "$arch" = "$word"; then - arch="$word" - else - gl_cv_c_multiarch=yes - fi - ;; - esac - prev= - else - if test "x$word" = "x-arch"; then - prev=arch - fi - fi - done + for gltype in sig_atomic_t wchar_t wint_t ; do + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for bit size of $gltype" >&5 +$as_echo_n "checking for bit size of $gltype... " >&6; } +if eval \${gl_cv_bitsizeof_${gltype}+:} false; then : + $as_echo_n "(cached) " >&6 +else + if ac_fn_c_compute_int "$LINENO" "sizeof ($gltype) * CHAR_BIT" "result" " + /* BSD/OS 4.0.1 has a bug: , and must be + included before . */ + #include + #include + #if HAVE_WCHAR_H + # include + # include + # include + #endif + +#include "; then : + +else + result=unknown +fi + + eval gl_cv_bitsizeof_${gltype}=\$result fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - if test $gl_cv_c_multiarch = yes; then - APPLE_UNIVERSAL_BUILD=1 - else - APPLE_UNIVERSAL_BUILD=0 - fi +eval ac_res=\$gl_cv_bitsizeof_${gltype} + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } + eval result=\$gl_cv_bitsizeof_${gltype} + if test $result = unknown; then + result=0 + fi + GLTYPE=`echo "$gltype" | tr 'abcdefghijklmnopqrstuvwxyz ' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ_'` + cat >>confdefs.h <<_ACEOF +#define BITSIZEOF_${GLTYPE} $result +_ACEOF + + eval BITSIZEOF_${GLTYPE}=\$result + done -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for C/C++ restrict keyword" >&5 -$as_echo_n "checking for C/C++ restrict keyword... " >&6; } -if test "${ac_cv_c_restrict+set}" = set; then : + for gltype in sig_atomic_t wchar_t wint_t ; do + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $gltype is signed" >&5 +$as_echo_n "checking whether $gltype is signed... " >&6; } +if eval \${gl_cv_type_${gltype}_signed+:} false; then : $as_echo_n "(cached) " >&6 else - ac_cv_c_restrict=no - # The order here caters to the fact that C++ does not require restrict. - for ac_kw in __restrict __restrict__ _Restrict restrict; do - cat confdefs.h - <<_ACEOF >conftest.$ac_ext + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ -typedef int * int_ptr; - int foo (int_ptr $ac_kw ip) { - return ip[0]; - } + + /* BSD/OS 4.0.1 has a bug: , and must be + included before . */ + #include + #include + #if HAVE_WCHAR_H + # include + # include + # include + #endif + + int verify[2 * (($gltype) -1 < ($gltype) 0) - 1]; int main () { -int s[1]; - int * $ac_kw t = s; - t[0] = 0; - return foo(t) + ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : - ac_cv_c_restrict=$ac_kw + result=yes +else + result=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - test "$ac_cv_c_restrict" != no && break - done + eval gl_cv_type_${gltype}_signed=\$result fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_restrict" >&5 -$as_echo "$ac_cv_c_restrict" >&6; } - - case $ac_cv_c_restrict in - restrict) ;; - no) $as_echo "#define restrict /**/" >>confdefs.h - ;; - *) cat >>confdefs.h <<_ACEOF -#define restrict $ac_cv_c_restrict +eval ac_res=\$gl_cv_type_${gltype}_signed + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } + eval result=\$gl_cv_type_${gltype}_signed + GLTYPE=`echo $gltype | tr 'abcdefghijklmnopqrstuvwxyz ' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ_'` + if test "$result" = yes; then + cat >>confdefs.h <<_ACEOF +#define HAVE_SIGNED_${GLTYPE} 1 _ACEOF - ;; - esac - - + eval HAVE_SIGNED_${GLTYPE}=1 + else + eval HAVE_SIGNED_${GLTYPE}=0 + fi + done + gl_cv_type_ptrdiff_t_signed=yes + gl_cv_type_size_t_signed=no + if test $APPLE_UNIVERSAL_BUILD = 0; then -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for stdbool.h that conforms to C99" >&5 -$as_echo_n "checking for stdbool.h that conforms to C99... " >&6; } -if test "${ac_cv_header_stdbool_h+set}" = set; then : + for gltype in ptrdiff_t size_t ; do + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $gltype integer literal suffix" >&5 +$as_echo_n "checking for $gltype integer literal suffix... " >&6; } +if eval \${gl_cv_type_${gltype}_suffix+:} false; then : $as_echo_n "(cached) " >&6 else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext + eval gl_cv_type_${gltype}_suffix=no + eval result=\$gl_cv_type_${gltype}_signed + if test "$result" = yes; then + glsufu= + else + glsufu=u + fi + for glsuf in "$glsufu" ${glsufu}l ${glsufu}ll ${glsufu}i64; do + case $glsuf in + '') gltype1='int';; + l) gltype1='long int';; + ll) gltype1='long long int';; + i64) gltype1='__int64';; + u) gltype1='unsigned int';; + ul) gltype1='unsigned long int';; + ull) gltype1='unsigned long long int';; + ui64)gltype1='unsigned __int64';; + esac + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ - #include - #ifndef bool - "error: bool is not defined" - #endif - #ifndef false - "error: false is not defined" - #endif - #if false - "error: false is not 0" - #endif - #ifndef true - "error: true is not defined" - #endif - #if true != 1 - "error: true is not 1" - #endif - #ifndef __bool_true_false_are_defined - "error: __bool_true_false_are_defined is not defined" - #endif + /* BSD/OS 4.0.1 has a bug: , and must be + included before . */ + #include + #include + #if HAVE_WCHAR_H + # include + # include + # include + #endif - struct s { _Bool s: 1; _Bool t; } s; + extern $gltype foo; + extern $gltype1 foo; +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + eval gl_cv_type_${gltype}_suffix=\$glsuf +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + eval result=\$gl_cv_type_${gltype}_suffix + test "$result" != no && break + done +fi +eval ac_res=\$gl_cv_type_${gltype}_suffix + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } + GLTYPE=`echo $gltype | tr 'abcdefghijklmnopqrstuvwxyz ' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ_'` + eval result=\$gl_cv_type_${gltype}_suffix + test "$result" = no && result= + eval ${GLTYPE}_SUFFIX=\$result + cat >>confdefs.h <<_ACEOF +#define ${GLTYPE}_SUFFIX $result +_ACEOF + + done + + + fi + + + for gltype in sig_atomic_t wchar_t wint_t ; do + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $gltype integer literal suffix" >&5 +$as_echo_n "checking for $gltype integer literal suffix... " >&6; } +if eval \${gl_cv_type_${gltype}_suffix+:} false; then : + $as_echo_n "(cached) " >&6 +else + eval gl_cv_type_${gltype}_suffix=no + eval result=\$gl_cv_type_${gltype}_signed + if test "$result" = yes; then + glsufu= + else + glsufu=u + fi + for glsuf in "$glsufu" ${glsufu}l ${glsufu}ll ${glsufu}i64; do + case $glsuf in + '') gltype1='int';; + l) gltype1='long int';; + ll) gltype1='long long int';; + i64) gltype1='__int64';; + u) gltype1='unsigned int';; + ul) gltype1='unsigned long int';; + ull) gltype1='unsigned long long int';; + ui64)gltype1='unsigned __int64';; + esac + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ - char a[true == 1 ? 1 : -1]; - char b[false == 0 ? 1 : -1]; - char c[__bool_true_false_are_defined == 1 ? 1 : -1]; - char d[(bool) 0.5 == true ? 1 : -1]; - /* See body of main program for 'e'. */ - char f[(_Bool) 0.0 == false ? 1 : -1]; - char g[true]; - char h[sizeof (_Bool)]; - char i[sizeof s.t]; - enum { j = false, k = true, l = false * true, m = true * 256 }; - /* The following fails for - HP aC++/ANSI C B3910B A.05.55 [Dec 04 2003]. */ - _Bool n[m]; - char o[sizeof n == m * sizeof n[0] ? 1 : -1]; - char p[-1 - (_Bool) 0 < 0 && -1 - (bool) 0 < 0 ? 1 : -1]; - /* Catch a bug in an HP-UX C compiler. See - http://gcc.gnu.org/ml/gcc-patches/2003-12/msg02303.html - http://lists.gnu.org/archive/html/bug-coreutils/2005-11/msg00161.html - */ - _Bool q = true; - _Bool *pq = &q; + /* BSD/OS 4.0.1 has a bug: , and must be + included before . */ + #include + #include + #if HAVE_WCHAR_H + # include + # include + # include + #endif + extern $gltype foo; + extern $gltype1 foo; int main () { - bool e = &s; - *pq |= q; - *pq |= ! q; - /* Refer to every declared value, to avoid compiler optimizations. */ - return (!a + !b + !c + !d + !e + !f + !g + !h + !i + !!j + !k + !!l - + !m + !n + !o + !p + !q + !pq); - ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : - ac_cv_header_stdbool_h=yes -else - ac_cv_header_stdbool_h=no + eval gl_cv_type_${gltype}_suffix=\$glsuf fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + eval result=\$gl_cv_type_${gltype}_suffix + test "$result" != no && break + done fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_stdbool_h" >&5 -$as_echo "$ac_cv_header_stdbool_h" >&6; } - ac_fn_c_check_type "$LINENO" "_Bool" "ac_cv_type__Bool" "$ac_includes_default" -if test "x$ac_cv_type__Bool" = x""yes; then : - -cat >>confdefs.h <<_ACEOF -#define HAVE__BOOL 1 +eval ac_res=\$gl_cv_type_${gltype}_suffix + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } + GLTYPE=`echo $gltype | tr 'abcdefghijklmnopqrstuvwxyz ' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ_'` + eval result=\$gl_cv_type_${gltype}_suffix + test "$result" = no && result= + eval ${GLTYPE}_SUFFIX=\$result + cat >>confdefs.h <<_ACEOF +#define ${GLTYPE}_SUFFIX $result _ACEOF + done + + + + if test $BITSIZEOF_WINT_T -lt 32; then + BITSIZEOF_WINT_T=32 + fi + + STDINT_H=stdint.h + fi + if test -n "$STDINT_H"; then + GL_GENERATE_STDINT_H_TRUE= + GL_GENERATE_STDINT_H_FALSE='#' +else + GL_GENERATE_STDINT_H_TRUE='#' + GL_GENERATE_STDINT_H_FALSE= fi - if test $ac_cv_header_stdbool_h = yes; then -$as_echo "#define HAVE_STDBOOL_H 1" >>confdefs.h - fi + GNULIB_FFS=0; + HAVE_FFS=1; + HAVE_STRCASECMP=1; + HAVE_DECL_STRNCASECMP=1; - REPLACE_NULL=0; - HAVE_WCHAR_T=1; - STDDEF_H=''; - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for wchar_t" >&5 -$as_echo_n "checking for wchar_t... " >&6; } -if test "${gt_cv_c_wchar_t+set}" = set; then : + + + + + + + + + + + + + if test $gl_cv_have_include_next = yes; then + gl_cv_next_strings_h='<'strings.h'>' + else + { $as_echo "$as_me:${as_lineno-$LINENO}: checking absolute name of " >&5 +$as_echo_n "checking absolute name of ... " >&6; } +if ${gl_cv_next_strings_h+:} false; then : $as_echo_n "(cached) " >&6 else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext + + if test $ac_cv_header_strings_h = yes; then + + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ -#include - wchar_t foo = (wchar_t)'\0'; -int -main () -{ +#include - ; - return 0; -} _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - gt_cv_c_wchar_t=yes -else - gt_cv_c_wchar_t=no -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + case "$host_os" in + aix*) gl_absname_cpp="$ac_cpp -C" ;; + *) gl_absname_cpp="$ac_cpp" ;; + esac + + case "$host_os" in + mingw*) + gl_dirsep_regex='[/\\]' + ;; + *) + gl_dirsep_regex='\/' + ;; + esac + gl_make_literal_regex_sed='s,[]$^\\.*/[],\\&,g' + + gl_header_literal_regex=`echo 'strings.h' \ + | sed -e "$gl_make_literal_regex_sed"` + gl_absolute_header_sed="/${gl_dirsep_regex}${gl_header_literal_regex}/"'{ + s/.*"\(.*'"${gl_dirsep_regex}${gl_header_literal_regex}"'\)".*/\1/ + s|^/[^/]|//&| + p + q + }' + gl_cv_next_strings_h='"'`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 | + sed -n "$gl_absolute_header_sed"`'"' + else + gl_cv_next_strings_h='<'strings.h'>' + fi + + fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gt_cv_c_wchar_t" >&5 -$as_echo "$gt_cv_c_wchar_t" >&6; } - if test $gt_cv_c_wchar_t = yes; then +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_strings_h" >&5 +$as_echo "$gl_cv_next_strings_h" >&6; } + fi + NEXT_STRINGS_H=$gl_cv_next_strings_h + + if test $gl_cv_have_include_next = yes || test $gl_cv_have_include_next = buggy; then + # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include_next' + gl_next_as_first_directive='<'strings.h'>' + else + # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include' + gl_next_as_first_directive=$gl_cv_next_strings_h + fi + NEXT_AS_FIRST_DIRECTIVE_STRINGS_H=$gl_next_as_first_directive -$as_echo "#define HAVE_WCHAR_T 1" >>confdefs.h + + + if test $ac_cv_header_strings_h = yes; then + HAVE_STRINGS_H=1 + else + HAVE_STRINGS_H=0 fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for long long int" >&5 -$as_echo_n "checking for long long int... " >&6; } -if test "${ac_cv_type_long_long_int+set}" = set; then : + + for gl_func in ffs strcasecmp strncasecmp; do + as_gl_Symbol=`$as_echo "gl_cv_have_raw_decl_$gl_func" | $as_tr_sh` + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $gl_func is declared without a macro" >&5 +$as_echo_n "checking whether $gl_func is declared without a macro... " >&6; } +if eval \${$as_gl_Symbol+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ - /* For now, do not test the preprocessor; as of 2007 there are too many - implementations with broken preprocessors. Perhaps this can - be revisited in 2012. In the meantime, code should not expect - #if to work with literals wider than 32 bits. */ - /* Test literals. */ - long long int ll = 9223372036854775807ll; - long long int nll = -9223372036854775807LL; - unsigned long long int ull = 18446744073709551615ULL; - /* Test constant expressions. */ - typedef int a[((-9223372036854775807LL < 0 && 0 < 9223372036854775807ll) - ? 1 : -1)]; - typedef int b[(18446744073709551615ULL <= (unsigned long long int) -1 - ? 1 : -1)]; - int i = 63; -int -main () -{ -/* Test availability of runtime routines for shift and division. */ - long long int llmax = 9223372036854775807ll; - unsigned long long int ullmax = 18446744073709551615ull; - return ((ll << 63) | (ll >> 63) | (ll < i) | (ll > i) - | (llmax / ll) | (llmax % ll) - | (ull << 63) | (ull >> 63) | (ull << i) | (ull >> i) - | (ullmax / ull) | (ullmax % ull)); - ; - return 0; -} + /* Minix 3.1.8 has a bug: must be included before + . */ + #include + #include -_ACEOF -if ac_fn_c_try_link "$LINENO"; then : - if test "$cross_compiling" = yes; then : - ac_cv_type_long_long_int=yes -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include - #ifndef LLONG_MAX - # define HALF \ - (1LL << (sizeof (long long int) * CHAR_BIT - 2)) - # define LLONG_MAX (HALF - 1 + HALF) - #endif int main () { -long long int n = 1; - int i; - for (i = 0; ; i++) - { - long long int m = n << i; - if (m >> i != n) - return 1; - if (LLONG_MAX / 2 < m) - break; - } - return 0; +#undef $gl_func + (void) $gl_func; ; return 0; } _ACEOF -if ac_fn_c_try_run "$LINENO"; then : - ac_cv_type_long_long_int=yes +if ac_fn_c_try_compile "$LINENO"; then : + eval "$as_gl_Symbol=yes" else - ac_cv_type_long_long_int=no + eval "$as_gl_Symbol=no" fi -rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ - conftest.$ac_objext conftest.beam conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi +eval ac_res=\$$as_gl_Symbol + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } + if eval test \"x\$"$as_gl_Symbol"\" = x"yes"; then : + cat >>confdefs.h <<_ACEOF +#define `$as_echo "HAVE_RAW_DECL_$gl_func" | $as_tr_cpp` 1 +_ACEOF -else - ac_cv_type_long_long_int=no -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext + eval ac_cv_have_decl_$gl_func=yes fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_type_long_long_int" >&5 -$as_echo "$ac_cv_type_long_long_int" >&6; } - if test $ac_cv_type_long_long_int = yes; then + done -$as_echo "#define HAVE_LONG_LONG_INT 1" >>confdefs.h - fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for unsigned long long int" >&5 -$as_echo_n "checking for unsigned long long int... " >&6; } -if test "${ac_cv_type_unsigned_long_long_int+set}" = set; then : - $as_echo_n "(cached) " >&6 +ac_fn_c_check_type "$LINENO" "pid_t" "ac_cv_type_pid_t" "$ac_includes_default" +if test "x$ac_cv_type_pid_t" = xyes; then : + else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - /* For now, do not test the preprocessor; as of 2007 there are too many - implementations with broken preprocessors. Perhaps this can - be revisited in 2012. In the meantime, code should not expect - #if to work with literals wider than 32 bits. */ - /* Test literals. */ - long long int ll = 9223372036854775807ll; - long long int nll = -9223372036854775807LL; - unsigned long long int ull = 18446744073709551615ULL; - /* Test constant expressions. */ - typedef int a[((-9223372036854775807LL < 0 && 0 < 9223372036854775807ll) - ? 1 : -1)]; - typedef int b[(18446744073709551615ULL <= (unsigned long long int) -1 - ? 1 : -1)]; - int i = 63; -int -main () -{ -/* Test availability of runtime routines for shift and division. */ - long long int llmax = 9223372036854775807ll; - unsigned long long int ullmax = 18446744073709551615ull; - return ((ll << 63) | (ll >> 63) | (ll < i) | (ll > i) - | (llmax / ll) | (llmax % ll) - | (ull << 63) | (ull >> 63) | (ull << i) | (ull >> i) - | (ullmax / ull) | (ullmax % ull)); - ; - return 0; -} +cat >>confdefs.h <<_ACEOF +#define pid_t int +_ACEOF + +fi + +ac_fn_c_check_type "$LINENO" "mode_t" "ac_cv_type_mode_t" "$ac_includes_default" +if test "x$ac_cv_type_mode_t" = xyes; then : + +else +cat >>confdefs.h <<_ACEOF +#define mode_t int _ACEOF -if ac_fn_c_try_link "$LINENO"; then : - ac_cv_type_unsigned_long_long_int=yes -else - ac_cv_type_unsigned_long_long_int=no -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_type_unsigned_long_long_int" >&5 -$as_echo "$ac_cv_type_unsigned_long_long_int" >&6; } - if test $ac_cv_type_unsigned_long_long_int = yes; then -$as_echo "#define HAVE_UNSIGNED_LONG_LONG_INT 1" >>confdefs.h +fi - fi + WINDOWS_64_BIT_OFF_T=0 + GNULIB_CHDIR=0; GNULIB_CHOWN=0; GNULIB_CLOSE=0; + GNULIB_DUP=0; GNULIB_DUP2=0; GNULIB_DUP3=0; GNULIB_ENVIRON=0; @@ -18570,6 +21096,7 @@ GNULIB_FACCESSAT=0; GNULIB_FCHDIR=0; GNULIB_FCHOWNAT=0; + GNULIB_FDATASYNC=0; GNULIB_FSYNC=0; GNULIB_FTRUNCATE=0; GNULIB_GETCWD=0; @@ -18581,6 +21108,8 @@ GNULIB_GETLOGIN_R=0; GNULIB_GETPAGESIZE=0; GNULIB_GETUSERSHELL=0; + GNULIB_GROUP_MEMBER=0; + GNULIB_ISATTY=0; GNULIB_LCHOWN=0; GNULIB_LINK=0; GNULIB_LINKAT=0; @@ -18589,14 +21118,16 @@ GNULIB_PIPE2=0; GNULIB_PREAD=0; GNULIB_PWRITE=0; + GNULIB_READ=0; GNULIB_READLINK=0; GNULIB_READLINKAT=0; GNULIB_RMDIR=0; + GNULIB_SETHOSTNAME=0; GNULIB_SLEEP=0; GNULIB_SYMLINK=0; GNULIB_SYMLINKAT=0; GNULIB_TTYNAME_R=0; - GNULIB_UNISTD_H_GETOPT=0; + GNULIB_UNISTD_H_NONBLOCKING=0; GNULIB_UNISTD_H_SIGPIPE=0; GNULIB_UNLINK=0; GNULIB_UNLINKAT=0; @@ -18609,6 +21140,7 @@ HAVE_FACCESSAT=1; HAVE_FCHDIR=1; HAVE_FCHOWNAT=1; + HAVE_FDATASYNC=1; HAVE_FSYNC=1; HAVE_FTRUNCATE=1; HAVE_GETDTABLESIZE=1; @@ -18616,6 +21148,7 @@ HAVE_GETHOSTNAME=1; HAVE_GETLOGIN=1; HAVE_GETPAGESIZE=1; + HAVE_GROUP_MEMBER=1; HAVE_LCHOWN=1; HAVE_LINK=1; HAVE_LINKAT=1; @@ -18625,6 +21158,7 @@ HAVE_PWRITE=1; HAVE_READLINK=1; HAVE_READLINKAT=1; + HAVE_SETHOSTNAME=1; HAVE_SLEEP=1; HAVE_SYMLINK=1; HAVE_SYMLINKAT=1; @@ -18632,10 +21166,12 @@ HAVE_USLEEP=1; HAVE_DECL_ENVIRON=1; HAVE_DECL_FCHDIR=1; + HAVE_DECL_FDATASYNC=1; HAVE_DECL_GETDOMAINNAME=1; HAVE_DECL_GETLOGIN_R=1; HAVE_DECL_GETPAGESIZE=1; HAVE_DECL_GETUSERSHELL=1; + HAVE_DECL_SETHOSTNAME=1; HAVE_DECL_TTYNAME_R=1; HAVE_OS_H=0; HAVE_SYS_PARAM_H=0; @@ -18644,17 +21180,20 @@ REPLACE_DUP=0; REPLACE_DUP2=0; REPLACE_FCHOWNAT=0; + REPLACE_FTRUNCATE=0; REPLACE_GETCWD=0; REPLACE_GETDOMAINNAME=0; REPLACE_GETLOGIN_R=0; REPLACE_GETGROUPS=0; REPLACE_GETPAGESIZE=0; + REPLACE_ISATTY=0; REPLACE_LCHOWN=0; REPLACE_LINK=0; REPLACE_LINKAT=0; REPLACE_LSEEK=0; REPLACE_PREAD=0; REPLACE_PWRITE=0; + REPLACE_READ=0; REPLACE_READLINK=0; REPLACE_RMDIR=0; REPLACE_SLEEP=0; @@ -18672,8 +21211,6 @@ - - if test $ac_cv_header_features_h = yes; then HAVE_FEATURES_H=1 else @@ -18684,7 +21221,7 @@ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for wint_t" >&5 $as_echo_n "checking for wint_t... " >&6; } -if test "${gt_cv_c_wint_t+set}" = set; then : +if ${gt_cv_c_wint_t+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -18725,20 +21262,18 @@ + GNULIB_ISWBLANK=0; + GNULIB_WCTYPE=0; + GNULIB_ISWCTYPE=0; + GNULIB_WCTRANS=0; + GNULIB_TOWCTRANS=0; + HAVE_ISWBLANK=1; + HAVE_WCTYPE_T=1; + HAVE_WCTRANS_T=1; + REPLACE_ISWBLANK=0; -ac_fn_c_check_decl "$LINENO" "iswblank" "ac_cv_have_decl_iswblank" "$ac_includes_default" -if test "x$ac_cv_have_decl_iswblank" = x""yes; then : - ac_have_decl=1 -else - ac_have_decl=0 -fi - -cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_ISWBLANK $ac_have_decl -_ACEOF - @@ -18762,7 +21297,6 @@ gl_source_base='gl' - # Code from module alloca-opt: if test $ac_cv_func_alloca_works = no; then @@ -18773,7 +21307,7 @@ if test $ac_cv_working_alloca_h = yes; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for alloca as a compiler built-in" >&5 $as_echo_n "checking for alloca as a compiler built-in... " >&6; } -if test "${gl_cv_rpl_alloca+set}" = set; then : +if ${gl_cv_rpl_alloca+:} false; then : $as_echo_n "(cached) " >&6 else @@ -18809,9 +21343,15 @@ ALLOCA_H=alloca.h fi + if test -n "$ALLOCA_H"; then + GL_GENERATE_ALLOCA_H_TRUE= + GL_GENERATE_ALLOCA_H_FALSE='#' +else + GL_GENERATE_ALLOCA_H_TRUE='#' + GL_GENERATE_ALLOCA_H_FALSE= +fi + - # Code from module arg-nonnull: - # Code from module btowc: @@ -18827,7 +21367,7 @@ { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether btowc(0) is correct" >&5 $as_echo_n "checking whether btowc(0) is correct... " >&6; } -if test "${gl_cv_func_btowc_nul+set}" = set; then : +if ${gl_cv_func_btowc_nul+:} false; then : $as_echo_n "(cached) " >&6 else @@ -18876,7 +21416,7 @@ { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether btowc(EOF) is correct" >&5 $as_echo_n "checking whether btowc(EOF) is correct... " >&6; } -if test "${gl_cv_func_btowc_eof+set}" = set; then : +if ${gl_cv_func_btowc_eof+:} false; then : $as_echo_n "(cached) " >&6 else @@ -18937,10 +21477,8 @@ *) REPLACE_BTOWC=1 ;; esac fi - if test $HAVE_BTOWC = 0 || test $REPLACE_BTOWC = 1; then - - : +if test $HAVE_BTOWC = 0 || test $REPLACE_BTOWC = 1; then @@ -18954,12 +21492,15 @@ : - fi +fi + - GNULIB_BTOWC=1 + GNULIB_BTOWC=1 + + @@ -18967,8 +21508,35 @@ - # Code from module c++defs: - # Code from module configmake: + + for ac_header in byteswap.h +do : + ac_fn_c_check_header_mongrel "$LINENO" "byteswap.h" "ac_cv_header_byteswap_h" "$ac_includes_default" +if test "x$ac_cv_header_byteswap_h" = xyes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_BYTESWAP_H 1 +_ACEOF + + BYTESWAP_H='' + +else + + BYTESWAP_H='byteswap.h' + +fi + +done + + + if test -n "$BYTESWAP_H"; then + GL_GENERATE_BYTESWAP_H_TRUE= + GL_GENERATE_BYTESWAP_H_FALSE='#' +else + GL_GENERATE_BYTESWAP_H_TRUE='#' + GL_GENERATE_BYTESWAP_H_FALSE= +fi + + if test "x$datarootdir" = x; then datarootdir='${datadir}' @@ -19006,12 +21574,8 @@ pkglibexecdir='${libexecdir}/${PACKAGE}' - # Code from module extensions: - # Code from module gettext-h: - # Code from module include_next: - # Code from module langinfo: @@ -19031,7 +21595,7 @@ else { $as_echo "$as_me:${as_lineno-$LINENO}: checking absolute name of " >&5 $as_echo_n "checking absolute name of ... " >&6; } -if test "${gl_cv_next_langinfo_h+set}" = set; then : +if ${gl_cv_next_langinfo_h+:} false; then : $as_echo_n "(cached) " >&6 else @@ -19047,13 +21611,27 @@ aix*) gl_absname_cpp="$ac_cpp -C" ;; *) gl_absname_cpp="$ac_cpp" ;; esac + + case "$host_os" in + mingw*) + gl_dirsep_regex='[/\\]' + ;; + *) + gl_dirsep_regex='\/' + ;; + esac + gl_make_literal_regex_sed='s,[]$^\\.*/[],\\&,g' + + gl_header_literal_regex=`echo 'langinfo.h' \ + | sed -e "$gl_make_literal_regex_sed"` + gl_absolute_header_sed="/${gl_dirsep_regex}${gl_header_literal_regex}/"'{ + s/.*"\(.*'"${gl_dirsep_regex}${gl_header_literal_regex}"'\)".*/\1/ + s|^/[^/]|//&| + p + q + }' gl_cv_next_langinfo_h='"'`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 | - sed -n '\#/langinfo.h#{ - s#.*"\(.*/langinfo.h\)".*#\1# - s#^/[^/]#//&# - p - q - }'`'"' + sed -n "$gl_absolute_header_sed"`'"' else gl_cv_next_langinfo_h='<'langinfo.h'>' fi @@ -19087,7 +21665,7 @@ HAVE_LANGINFO_H=1 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether langinfo.h defines CODESET" >&5 $as_echo_n "checking whether langinfo.h defines CODESET... " >&6; } -if test "${gl_cv_header_langinfo_codeset+set}" = set; then : +if ${gl_cv_header_langinfo_codeset+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -19118,7 +21696,7 @@ fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether langinfo.h defines T_FMT_AMPM" >&5 $as_echo_n "checking whether langinfo.h defines T_FMT_AMPM... " >&6; } -if test "${gl_cv_header_langinfo_t_fmt_ampm+set}" = set; then : +if ${gl_cv_header_langinfo_t_fmt_ampm+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -19149,7 +21727,7 @@ fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether langinfo.h defines ERA" >&5 $as_echo_n "checking whether langinfo.h defines ERA... " >&6; } -if test "${gl_cv_header_langinfo_era+set}" = set; then : +if ${gl_cv_header_langinfo_era+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -19180,7 +21758,7 @@ fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether langinfo.h defines YESEXPR" >&5 $as_echo_n "checking whether langinfo.h defines YESEXPR... " >&6; } -if test "${gl_cv_header_langinfo_yesexpr+set}" = set; then : +if ${gl_cv_header_langinfo_yesexpr+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -19223,7 +21801,7 @@ as_gl_Symbol=`$as_echo "gl_cv_have_raw_decl_$gl_func" | $as_tr_sh` { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $gl_func is declared without a macro" >&5 $as_echo_n "checking whether $gl_func is declared without a macro... " >&6; } -if { as_var=$as_gl_Symbol; eval "test \"\${$as_var+set}\" = set"; }; then : +if eval \${$as_gl_Symbol+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -19249,35 +21827,312 @@ eval ac_res=\$$as_gl_Symbol { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } - eval as_val=\$$as_gl_Symbol - if test "x$as_val" = x""yes; then : + if eval test \"x\$"$as_gl_Symbol"\" = x"yes"; then : + cat >>confdefs.h <<_ACEOF +#define `$as_echo "HAVE_RAW_DECL_$gl_func" | $as_tr_cpp` 1 +_ACEOF + + eval ac_cv_have_decl_$gl_func=yes +fi + done + + + + + + + + + + +LOCALCHARSET_TESTS_ENVIRONMENT="CHARSETALIASDIR=\"\$(abs_top_builddir)/$gl_source_base\"" + + + + + + + + + + case "$host_os" in + solaris*) + +$as_echo "#define _LCONV_C99 1" >>confdefs.h + + ;; + esac + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether locale.h conforms to POSIX:2001" >&5 +$as_echo_n "checking whether locale.h conforms to POSIX:2001... " >&6; } +if ${gl_cv_header_locale_h_posix2001+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include + int x = LC_MESSAGES; + int y = sizeof (((struct lconv *) 0)->decimal_point); +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + gl_cv_header_locale_h_posix2001=yes +else + gl_cv_header_locale_h_posix2001=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_header_locale_h_posix2001" >&5 +$as_echo "$gl_cv_header_locale_h_posix2001" >&6; } + + + if test $ac_cv_header_xlocale_h = yes; then + HAVE_XLOCALE_H=1 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether locale.h defines locale_t" >&5 +$as_echo_n "checking whether locale.h defines locale_t... " >&6; } +if ${gl_cv_header_locale_has_locale_t+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include + locale_t x; +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + gl_cv_header_locale_has_locale_t=yes +else + gl_cv_header_locale_has_locale_t=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_header_locale_has_locale_t" >&5 +$as_echo "$gl_cv_header_locale_has_locale_t" >&6; } + if test $gl_cv_header_locale_has_locale_t = yes; then + gl_cv_header_locale_h_needs_xlocale_h=no + else + gl_cv_header_locale_h_needs_xlocale_h=yes + fi + else + HAVE_XLOCALE_H=0 + gl_cv_header_locale_h_needs_xlocale_h=no + fi + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether struct lconv is properly defined" >&5 +$as_echo_n "checking whether struct lconv is properly defined... " >&6; } +if ${gl_cv_sys_struct_lconv_ok+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include + struct lconv l; + int x = sizeof (l.decimal_point); + int y = sizeof (l.int_p_cs_precedes); +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + gl_cv_sys_struct_lconv_ok=yes +else + gl_cv_sys_struct_lconv_ok=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_sys_struct_lconv_ok" >&5 +$as_echo "$gl_cv_sys_struct_lconv_ok" >&6; } + if test $gl_cv_sys_struct_lconv_ok = no; then + REPLACE_STRUCT_LCONV=1 + fi + + + + + + + + + + if test $gl_cv_have_include_next = yes; then + gl_cv_next_locale_h='<'locale.h'>' + else + { $as_echo "$as_me:${as_lineno-$LINENO}: checking absolute name of " >&5 +$as_echo_n "checking absolute name of ... " >&6; } +if ${gl_cv_next_locale_h+:} false; then : + $as_echo_n "(cached) " >&6 +else + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include + +_ACEOF + case "$host_os" in + aix*) gl_absname_cpp="$ac_cpp -C" ;; + *) gl_absname_cpp="$ac_cpp" ;; + esac + + case "$host_os" in + mingw*) + gl_dirsep_regex='[/\\]' + ;; + *) + gl_dirsep_regex='\/' + ;; + esac + gl_make_literal_regex_sed='s,[]$^\\.*/[],\\&,g' + + gl_header_literal_regex=`echo 'locale.h' \ + | sed -e "$gl_make_literal_regex_sed"` + gl_absolute_header_sed="/${gl_dirsep_regex}${gl_header_literal_regex}/"'{ + s/.*"\(.*'"${gl_dirsep_regex}${gl_header_literal_regex}"'\)".*/\1/ + s|^/[^/]|//&| + p + q + }' + gl_cv_next_locale_h='"'`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 | + sed -n "$gl_absolute_header_sed"`'"' + + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_locale_h" >&5 +$as_echo "$gl_cv_next_locale_h" >&6; } + fi + NEXT_LOCALE_H=$gl_cv_next_locale_h + + if test $gl_cv_have_include_next = yes || test $gl_cv_have_include_next = buggy; then + # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include_next' + gl_next_as_first_directive='<'locale.h'>' + else + # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include' + gl_next_as_first_directive=$gl_cv_next_locale_h + fi + NEXT_AS_FIRST_DIRECTIVE_LOCALE_H=$gl_next_as_first_directive + + + + + + + for gl_func in setlocale duplocale; do + as_gl_Symbol=`$as_echo "gl_cv_have_raw_decl_$gl_func" | $as_tr_sh` + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $gl_func is declared without a macro" >&5 +$as_echo_n "checking whether $gl_func is declared without a macro... " >&6; } +if eval \${$as_gl_Symbol+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +/* Some systems provide declarations in a non-standard header. */ +#if HAVE_XLOCALE_H +# include +#endif + +int +main () +{ +#undef $gl_func + (void) $gl_func; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + eval "$as_gl_Symbol=yes" +else + eval "$as_gl_Symbol=no" +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +eval ac_res=\$$as_gl_Symbol + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } + if eval test \"x\$"$as_gl_Symbol"\" = x"yes"; then : cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_RAW_DECL_$gl_func" | $as_tr_cpp` 1 _ACEOF - eval ac_cv_have_decl_$gl_func=yes + eval ac_cv_have_decl_$gl_func=yes +fi + done + + + + + + + if test $REPLACE_STRUCT_LCONV = 1; then + REPLACE_LOCALECONV=1 + fi + +if test $REPLACE_LOCALECONV = 1; then + + + + + + + + + gl_LIBOBJS="$gl_LIBOBJS localeconv.$ac_objext" + + + ac_fn_c_check_member "$LINENO" "struct lconv" "decimal_point" "ac_cv_member_struct_lconv_decimal_point" "#include +" +if test "x$ac_cv_member_struct_lconv_decimal_point" = xyes; then : + +cat >>confdefs.h <<_ACEOF +#define HAVE_STRUCT_LCONV_DECIMAL_POINT 1 +_ACEOF + + fi - done - # Code from module localcharset: +fi + GNULIB_LOCALECONV=1 - LOCALCHARSET_TESTS_ENVIRONMENT="CHARSETALIASDIR=\"\$(top_builddir)/$gl_source_base\"" - # Code from module malloc-gnu: +$as_echo "#define GNULIB_TEST_LOCALECONV 1" >>confdefs.h - for ac_header in stdlib.h + + + + + + for ac_header in stdlib.h do : ac_fn_c_check_header_mongrel "$LINENO" "stdlib.h" "ac_cv_header_stdlib_h" "$ac_includes_default" -if test "x$ac_cv_header_stdlib_h" = x""yes; then : +if test "x$ac_cv_header_stdlib_h" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_STDLIB_H 1 _ACEOF @@ -19286,21 +22141,29 @@ done -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for GNU libc compatible malloc" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for GNU libc compatible malloc" >&5 $as_echo_n "checking for GNU libc compatible malloc... " >&6; } -if test "${ac_cv_func_malloc_0_nonnull+set}" = set; then : +if ${ac_cv_func_malloc_0_nonnull+:} false; then : $as_echo_n "(cached) " >&6 else if test "$cross_compiling" = yes; then : - ac_cv_func_malloc_0_nonnull=no + case "$host_os" in + # Guess yes on platforms where we know the result. + *-gnu* | freebsd* | netbsd* | openbsd* \ + | hpux* | solaris* | cygwin* | mingw*) + ac_cv_func_malloc_0_nonnull=yes ;; + # If we don't know, assume the worst. + *) ac_cv_func_malloc_0_nonnull=no ;; + esac + else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #if defined STDC_HEADERS || defined HAVE_STDLIB_H -# include -#else -char *malloc (); -#endif + # include + #else + char *malloc (); + #endif int main () @@ -19309,6 +22172,7 @@ ; return 0; } + _ACEOF if ac_fn_c_try_run "$LINENO"; then : ac_cv_func_malloc_0_nonnull=yes @@ -19319,41 +22183,41 @@ conftest.$ac_objext conftest.beam conftest.$ac_ext fi + fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_malloc_0_nonnull" >&5 $as_echo "$ac_cv_func_malloc_0_nonnull" >&6; } -if test $ac_cv_func_malloc_0_nonnull = yes; then : + if test $ac_cv_func_malloc_0_nonnull = yes; then : $as_echo "#define HAVE_MALLOC_GNU 1" >>confdefs.h else $as_echo "#define HAVE_MALLOC_GNU 0" >>confdefs.h + REPLACE_MALLOC=1 +fi +if test $REPLACE_MALLOC = 1; then - gl_LIBOBJS="$gl_LIBOBJS malloc.$ac_objext" - REPLACE_MALLOC=1 + gl_LIBOBJS="$gl_LIBOBJS malloc.$ac_objext" fi - - cat >>confdefs.h <<_ACEOF #define GNULIB_MALLOC_GNU 1 _ACEOF - # Code from module malloc-posix: @@ -19362,293 +22226,63 @@ $as_echo "#define HAVE_MALLOC_POSIX 1" >>confdefs.h else - - - - - - - - - - gl_LIBOBJS="$gl_LIBOBJS malloc.$ac_objext" - - REPLACE_MALLOC=1 - + REPLACE_MALLOC=1 fi - - - - GNULIB_MALLOC_POSIX=1 - - - -$as_echo "#define GNULIB_TEST_MALLOC_POSIX 1" >>confdefs.h - - - - # Code from module mbrtowc: - - - - - - +if test $REPLACE_MALLOC = 1; then - if test $ac_cv_func_mbsinit = yes && test $ac_cv_func_mbrtowc = yes; then - - - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether mbrtowc handles incomplete characters" >&5 -$as_echo_n "checking whether mbrtowc handles incomplete characters... " >&6; } -if test "${gl_cv_func_mbrtowc_incomplete_state+set}" = set; then : - $as_echo_n "(cached) " >&6 -else - case "$host_os" in - # Guess no on AIX and OSF/1. - aix* | osf*) gl_cv_func_mbrtowc_incomplete_state="guessing no" ;; - # Guess yes otherwise. - *) gl_cv_func_mbrtowc_incomplete_state="guessing yes" ;; - esac - if test $LOCALE_JA != none; then - if test "$cross_compiling" = yes; then : - : -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include -#include -/* Tru64 with Desktop Toolkit C has a bug: must be included before - . - BSD/OS 4.0.1 has a bug: , and must be - included before . */ -#include -#include -#include -#include -int main () -{ - if (setlocale (LC_ALL, "$LOCALE_JA") != NULL) - { - const char input[] = "B\217\253\344\217\251\316er"; /* "Büßer" */ - mbstate_t state; - wchar_t wc; - memset (&state, '\0', sizeof (mbstate_t)); - if (mbrtowc (&wc, input + 1, 1, &state) == (size_t)(-2)) - if (mbsinit (&state)) - return 1; - } - return 0; -} -_ACEOF -if ac_fn_c_try_run "$LINENO"; then : - gl_cv_func_mbrtowc_incomplete_state=yes -else - gl_cv_func_mbrtowc_incomplete_state=no -fi -rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ - conftest.$ac_objext conftest.beam conftest.$ac_ext -fi - fi + gl_LIBOBJS="$gl_LIBOBJS malloc.$ac_objext" fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_mbrtowc_incomplete_state" >&5 -$as_echo "$gl_cv_func_mbrtowc_incomplete_state" >&6; } - - - - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether mbrtowc works as well as mbtowc" >&5 -$as_echo_n "checking whether mbrtowc works as well as mbtowc... " >&6; } -if test "${gl_cv_func_mbrtowc_sanitycheck+set}" = set; then : - $as_echo_n "(cached) " >&6 -else - case "$host_os" in - # Guess no on Solaris 8. - solaris2.8) gl_cv_func_mbrtowc_sanitycheck="guessing no" ;; - # Guess yes otherwise. - *) gl_cv_func_mbrtowc_sanitycheck="guessing yes" ;; - esac - if test $LOCALE_ZH_CN != none; then - if test "$cross_compiling" = yes; then : - : -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include -#include -#include -/* Tru64 with Desktop Toolkit C has a bug: must be included before - . - BSD/OS 4.0.1 has a bug: , and must be - included before . */ -#include -#include -#include -#include -int main () -{ - /* This fails on Solaris 8: - mbrtowc returns 2, and sets wc to 0x00F0. - mbtowc returns 4 (correct) and sets wc to 0x5EDC. */ - if (setlocale (LC_ALL, "$LOCALE_ZH_CN") != NULL) - { - char input[] = "B\250\271\201\060\211\070er"; /* "Büßer" */ - mbstate_t state; - wchar_t wc; - memset (&state, '\0', sizeof (mbstate_t)); - if (mbrtowc (&wc, input + 3, 6, &state) != 4 - && mbtowc (&wc, input + 3, 6) == 4) - return 1; - } - return 0; -} -_ACEOF -if ac_fn_c_try_run "$LINENO"; then : - gl_cv_func_mbrtowc_sanitycheck=yes -else - gl_cv_func_mbrtowc_sanitycheck=no -fi -rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ - conftest.$ac_objext conftest.beam conftest.$ac_ext -fi - fi -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_mbrtowc_sanitycheck" >&5 -$as_echo "$gl_cv_func_mbrtowc_sanitycheck" >&6; } + GNULIB_MALLOC_POSIX=1 - REPLACE_MBSTATE_T=0 - case "$gl_cv_func_mbrtowc_incomplete_state" in - *yes) ;; - *) REPLACE_MBSTATE_T=1 ;; - esac - case "$gl_cv_func_mbrtowc_sanitycheck" in - *yes) ;; - *) REPLACE_MBSTATE_T=1 ;; - esac - else - REPLACE_MBSTATE_T=1 - fi - if test $REPLACE_MBSTATE_T = 1; then - : - fi +$as_echo "#define GNULIB_TEST_MALLOC_POSIX 1" >>confdefs.h - if test $ac_cv_func_mbrtowc = no; then - HAVE_MBRTOWC=0 - else - if test $REPLACE_MBSTATE_T = 1; then - REPLACE_MBRTOWC=1 - else - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether mbrtowc handles a NULL pwc argument" >&5 -$as_echo_n "checking whether mbrtowc handles a NULL pwc argument... " >&6; } -if test "${gl_cv_func_mbrtowc_null_arg1+set}" = set; then : - $as_echo_n "(cached) " >&6 -else - case "$host_os" in - # Guess no on Solaris. - solaris*) gl_cv_func_mbrtowc_null_arg1="guessing no" ;; - # Guess yes otherwise. - *) gl_cv_func_mbrtowc_null_arg1="guessing yes" ;; - esac - if test $LOCALE_FR_UTF8 != none; then - if test "$cross_compiling" = yes; then : - : -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include -#include -#include -/* Tru64 with Desktop Toolkit C has a bug: must be included before - . - BSD/OS 4.0.1 has a bug: , and must be - included before . */ -#include -#include -#include -#include -int main () -{ - int result = 0; - if (setlocale (LC_ALL, "$LOCALE_FR_UTF8") != NULL) - { - char input[] = "\303\237er"; - mbstate_t state; - wchar_t wc; - size_t ret; - memset (&state, '\0', sizeof (mbstate_t)); - wc = (wchar_t) 0xBADFACE; - ret = mbrtowc (&wc, input, 5, &state); - if (ret != 2) - result |= 1; - if (!mbsinit (&state)) - result |= 2; - memset (&state, '\0', sizeof (mbstate_t)); - ret = mbrtowc (NULL, input, 5, &state); - if (ret != 2) /* Solaris 7 fails here: ret is -1. */ - result |= 4; - if (!mbsinit (&state)) - result |= 8; - } - return result; -} -_ACEOF -if ac_fn_c_try_run "$LINENO"; then : - gl_cv_func_mbrtowc_null_arg1=yes -else - gl_cv_func_mbrtowc_null_arg1=no -fi -rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ - conftest.$ac_objext conftest.beam conftest.$ac_ext -fi - fi -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_mbrtowc_null_arg1" >&5 -$as_echo "$gl_cv_func_mbrtowc_null_arg1" >&6; } + if test $ac_cv_func_mbsinit = yes && test $ac_cv_func_mbrtowc = yes; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether mbrtowc handles a NULL string argument" >&5 -$as_echo_n "checking whether mbrtowc handles a NULL string argument... " >&6; } -if test "${gl_cv_func_mbrtowc_null_arg2+set}" = set; then : + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether mbrtowc handles incomplete characters" >&5 +$as_echo_n "checking whether mbrtowc handles incomplete characters... " >&6; } +if ${gl_cv_func_mbrtowc_incomplete_state+:} false; then : $as_echo_n "(cached) " >&6 else case "$host_os" in - # Guess no on OSF/1. - osf*) gl_cv_func_mbrtowc_null_arg2="guessing no" ;; - # Guess yes otherwise. - *) gl_cv_func_mbrtowc_null_arg2="guessing yes" ;; + # Guess no on AIX and OSF/1. + aix* | osf*) gl_cv_func_mbrtowc_incomplete_state="guessing no" ;; + # Guess yes otherwise. + *) gl_cv_func_mbrtowc_incomplete_state="guessing yes" ;; esac - if test $LOCALE_FR_UTF8 != none; then + if test $LOCALE_JA != none; then if test "$cross_compiling" = yes; then : : else @@ -19667,26 +22301,24 @@ #include int main () { - if (setlocale (LC_ALL, "$LOCALE_FR_UTF8") != NULL) + if (setlocale (LC_ALL, "$LOCALE_JA") != NULL) { + const char input[] = "B\217\253\344\217\251\316er"; /* "Büßer" */ mbstate_t state; wchar_t wc; - int ret; memset (&state, '\0', sizeof (mbstate_t)); - wc = (wchar_t) 0xBADFACE; - mbrtowc (&wc, NULL, 5, &state); - /* Check that wc was not modified. */ - if (wc != (wchar_t) 0xBADFACE) - return 1; + if (mbrtowc (&wc, input + 1, 1, &state) == (size_t)(-2)) + if (mbsinit (&state)) + return 1; } return 0; } _ACEOF if ac_fn_c_try_run "$LINENO"; then : - gl_cv_func_mbrtowc_null_arg2=yes + gl_cv_func_mbrtowc_incomplete_state=yes else - gl_cv_func_mbrtowc_null_arg2=no + gl_cv_func_mbrtowc_incomplete_state=no fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ conftest.$ac_objext conftest.beam conftest.$ac_ext @@ -19695,26 +22327,25 @@ fi fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_mbrtowc_null_arg2" >&5 -$as_echo "$gl_cv_func_mbrtowc_null_arg2" >&6; } - +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_mbrtowc_incomplete_state" >&5 +$as_echo "$gl_cv_func_mbrtowc_incomplete_state" >&6; } - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether mbrtowc has a correct return value" >&5 -$as_echo_n "checking whether mbrtowc has a correct return value... " >&6; } -if test "${gl_cv_func_mbrtowc_retval+set}" = set; then : + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether mbrtowc works as well as mbtowc" >&5 +$as_echo_n "checking whether mbrtowc works as well as mbtowc... " >&6; } +if ${gl_cv_func_mbrtowc_sanitycheck+:} false; then : $as_echo_n "(cached) " >&6 else case "$host_os" in - # Guess no on HP-UX and Solaris. - hpux* | solaris*) gl_cv_func_mbrtowc_retval="guessing no" ;; - # Guess yes otherwise. - *) gl_cv_func_mbrtowc_retval="guessing yes" ;; + # Guess no on Solaris 8. + solaris2.8) gl_cv_func_mbrtowc_sanitycheck="guessing no" ;; + # Guess yes otherwise. + *) gl_cv_func_mbrtowc_sanitycheck="guessing yes" ;; esac - if test $LOCALE_FR_UTF8 != none || test $LOCALE_JA != none; then + if test $LOCALE_ZH_CN != none; then if test "$cross_compiling" = yes; then : : else @@ -19722,6 +22353,7 @@ /* end confdefs.h. */ #include +#include #include /* Tru64 with Desktop Toolkit C has a bug: must be included before . @@ -19733,44 +22365,27 @@ #include int main () { - int result = 0; - /* This fails on Solaris. */ - if (setlocale (LC_ALL, "$LOCALE_FR_UTF8") != NULL) - { - char input[] = "B\303\274\303\237er"; /* "Büßer" */ - mbstate_t state; - wchar_t wc; - - memset (&state, '\0', sizeof (mbstate_t)); - if (mbrtowc (&wc, input + 1, 1, &state) == (size_t)(-2)) - { - input[1] = '\0'; - if (mbrtowc (&wc, input + 2, 5, &state) != 1) - result |= 1; - } - } - /* This fails on HP-UX 11.11. */ - if (setlocale (LC_ALL, "$LOCALE_JA") != NULL) + /* This fails on Solaris 8: + mbrtowc returns 2, and sets wc to 0x00F0. + mbtowc returns 4 (correct) and sets wc to 0x5EDC. */ + if (setlocale (LC_ALL, "$LOCALE_ZH_CN") != NULL) { - char input[] = "B\217\253\344\217\251\316er"; /* "Büßer" */ + char input[] = "B\250\271\201\060\211\070er"; /* "Büßer" */ mbstate_t state; wchar_t wc; memset (&state, '\0', sizeof (mbstate_t)); - if (mbrtowc (&wc, input + 1, 1, &state) == (size_t)(-2)) - { - input[1] = '\0'; - if (mbrtowc (&wc, input + 2, 5, &state) != 2) - result |= 2; - } + if (mbrtowc (&wc, input + 3, 6, &state) != 4 + && mbtowc (&wc, input + 3, 6) == 4) + return 1; } - return result; + return 0; } _ACEOF if ac_fn_c_try_run "$LINENO"; then : - gl_cv_func_mbrtowc_retval=yes + gl_cv_func_mbrtowc_sanitycheck=yes else - gl_cv_func_mbrtowc_retval=no + gl_cv_func_mbrtowc_sanitycheck=no fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ conftest.$ac_objext conftest.beam conftest.$ac_ext @@ -19779,25 +22394,70 @@ fi fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_mbrtowc_retval" >&5 -$as_echo "$gl_cv_func_mbrtowc_retval" >&6; } +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_mbrtowc_sanitycheck" >&5 +$as_echo "$gl_cv_func_mbrtowc_sanitycheck" >&6; } + + REPLACE_MBSTATE_T=0 + case "$gl_cv_func_mbrtowc_incomplete_state" in + *yes) ;; + *) REPLACE_MBSTATE_T=1 ;; + esac + case "$gl_cv_func_mbrtowc_sanitycheck" in + *yes) ;; + *) REPLACE_MBSTATE_T=1 ;; + esac + else + REPLACE_MBSTATE_T=1 + fi + + if test $ac_cv_func_mbrtowc = no; then + HAVE_MBRTOWC=0 + ac_fn_c_check_decl "$LINENO" "mbrtowc" "ac_cv_have_decl_mbrtowc" " +/* Tru64 with Desktop Toolkit C has a bug: must be included before + . + BSD/OS 4.0.1 has a bug: , and must be + included before . */ +#include +#include +#include +#include + +" +if test "x$ac_cv_have_decl_mbrtowc" = xyes; then : + ac_have_decl=1 +else + ac_have_decl=0 +fi +cat >>confdefs.h <<_ACEOF +#define HAVE_DECL_MBRTOWC $ac_have_decl +_ACEOF - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether mbrtowc returns 0 when parsing a NUL character" >&5 -$as_echo_n "checking whether mbrtowc returns 0 when parsing a NUL character... " >&6; } -if test "${gl_cv_func_mbrtowc_nul_retval+set}" = set; then : + if test $ac_cv_have_decl_mbrtowc = yes; then + REPLACE_MBRTOWC=1 + fi + else + if test $REPLACE_MBSTATE_T = 1; then + REPLACE_MBRTOWC=1 + else + + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether mbrtowc handles a NULL pwc argument" >&5 +$as_echo_n "checking whether mbrtowc handles a NULL pwc argument... " >&6; } +if ${gl_cv_func_mbrtowc_null_arg1+:} false; then : $as_echo_n "(cached) " >&6 else case "$host_os" in - # Guess no on Solaris 8 and 9. - solaris2.[89]) gl_cv_func_mbrtowc_nul_retval="guessing no" ;; - # Guess yes otherwise. - *) gl_cv_func_mbrtowc_nul_retval="guessing yes" ;; + # Guess no on Solaris. + solaris*) gl_cv_func_mbrtowc_null_arg1="guessing no" ;; + # Guess yes otherwise. + *) gl_cv_func_mbrtowc_null_arg1="guessing yes" ;; esac - if test $LOCALE_ZH_CN != none; then + if test $LOCALE_FR_UTF8 != none; then if test "$cross_compiling" = yes; then : : else @@ -19805,6 +22465,7 @@ /* end confdefs.h. */ #include +#include #include /* Tru64 with Desktop Toolkit C has a bug: must be included before . @@ -19816,23 +22477,37 @@ #include int main () { - /* This fails on Solaris 8 and 9. */ - if (setlocale (LC_ALL, "$LOCALE_ZH_CN") != NULL) + int result = 0; + + if (setlocale (LC_ALL, "$LOCALE_FR_UTF8") != NULL) { + char input[] = "\303\237er"; mbstate_t state; wchar_t wc; + size_t ret; memset (&state, '\0', sizeof (mbstate_t)); - if (mbrtowc (&wc, "", 1, &state) != 0) - return 1; + wc = (wchar_t) 0xBADFACE; + ret = mbrtowc (&wc, input, 5, &state); + if (ret != 2) + result |= 1; + if (!mbsinit (&state)) + result |= 2; + + memset (&state, '\0', sizeof (mbstate_t)); + ret = mbrtowc (NULL, input, 5, &state); + if (ret != 2) /* Solaris 7 fails here: ret is -1. */ + result |= 4; + if (!mbsinit (&state)) + result |= 8; } - return 0; + return result; } _ACEOF if ac_fn_c_try_run "$LINENO"; then : - gl_cv_func_mbrtowc_nul_retval=yes + gl_cv_func_mbrtowc_null_arg1=yes else - gl_cv_func_mbrtowc_nul_retval=no + gl_cv_func_mbrtowc_null_arg1=no fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ conftest.$ac_objext conftest.beam conftest.$ac_ext @@ -19841,101 +22516,25 @@ fi fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_mbrtowc_nul_retval" >&5 -$as_echo "$gl_cv_func_mbrtowc_nul_retval" >&6; } - - case "$gl_cv_func_mbrtowc_null_arg1" in - *yes) ;; - *) -$as_echo "#define MBRTOWC_NULL_ARG1_BUG 1" >>confdefs.h - - REPLACE_MBRTOWC=1 - ;; - esac - case "$gl_cv_func_mbrtowc_null_arg2" in - *yes) ;; - *) -$as_echo "#define MBRTOWC_NULL_ARG2_BUG 1" >>confdefs.h - - REPLACE_MBRTOWC=1 - ;; - esac - case "$gl_cv_func_mbrtowc_retval" in - *yes) ;; - *) -$as_echo "#define MBRTOWC_RETVAL_BUG 1" >>confdefs.h - - REPLACE_MBRTOWC=1 - ;; - esac - case "$gl_cv_func_mbrtowc_nul_retval" in - *yes) ;; - *) -$as_echo "#define MBRTOWC_NUL_RETVAL_BUG 1" >>confdefs.h - - REPLACE_MBRTOWC=1 - ;; - esac - fi - fi - if test $HAVE_MBRTOWC = 0 || test $REPLACE_MBRTOWC = 1; then - - : - - - - - - - - - - gl_LIBOBJS="$gl_LIBOBJS mbrtowc.$ac_objext" - - - : - - fi - - - - - GNULIB_MBRTOWC=1 - - - -$as_echo "#define GNULIB_TEST_MBRTOWC 1" >>confdefs.h - - - - # Code from module mbsinit: - - - - - - - - - +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_mbrtowc_null_arg1" >&5 +$as_echo "$gl_cv_func_mbrtowc_null_arg1" >&6; } - if test $ac_cv_func_mbsinit = yes && test $ac_cv_func_mbrtowc = yes; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether mbrtowc handles incomplete characters" >&5 -$as_echo_n "checking whether mbrtowc handles incomplete characters... " >&6; } -if test "${gl_cv_func_mbrtowc_incomplete_state+set}" = set; then : + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether mbrtowc handles a NULL string argument" >&5 +$as_echo_n "checking whether mbrtowc handles a NULL string argument... " >&6; } +if ${gl_cv_func_mbrtowc_null_arg2+:} false; then : $as_echo_n "(cached) " >&6 else case "$host_os" in - # Guess no on AIX and OSF/1. - aix* | osf*) gl_cv_func_mbrtowc_incomplete_state="guessing no" ;; - # Guess yes otherwise. - *) gl_cv_func_mbrtowc_incomplete_state="guessing yes" ;; + # Guess no on OSF/1. + osf*) gl_cv_func_mbrtowc_null_arg2="guessing no" ;; + # Guess yes otherwise. + *) gl_cv_func_mbrtowc_null_arg2="guessing yes" ;; esac - if test $LOCALE_JA != none; then + if test $LOCALE_FR_UTF8 != none; then if test "$cross_compiling" = yes; then : : else @@ -19954,24 +22553,26 @@ #include int main () { - if (setlocale (LC_ALL, "$LOCALE_JA") != NULL) + if (setlocale (LC_ALL, "$LOCALE_FR_UTF8") != NULL) { - const char input[] = "B\217\253\344\217\251\316er"; /* "Büßer" */ mbstate_t state; wchar_t wc; + int ret; memset (&state, '\0', sizeof (mbstate_t)); - if (mbrtowc (&wc, input + 1, 1, &state) == (size_t)(-2)) - if (mbsinit (&state)) - return 1; + wc = (wchar_t) 0xBADFACE; + mbrtowc (&wc, NULL, 5, &state); + /* Check that wc was not modified. */ + if (wc != (wchar_t) 0xBADFACE) + return 1; } return 0; } _ACEOF if ac_fn_c_try_run "$LINENO"; then : - gl_cv_func_mbrtowc_incomplete_state=yes + gl_cv_func_mbrtowc_null_arg2=yes else - gl_cv_func_mbrtowc_incomplete_state=no + gl_cv_func_mbrtowc_null_arg2=no fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ conftest.$ac_objext conftest.beam conftest.$ac_ext @@ -19980,25 +22581,28 @@ fi fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_mbrtowc_incomplete_state" >&5 -$as_echo "$gl_cv_func_mbrtowc_incomplete_state" >&6; } +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_mbrtowc_null_arg2" >&5 +$as_echo "$gl_cv_func_mbrtowc_null_arg2" >&6; } - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether mbrtowc works as well as mbtowc" >&5 -$as_echo_n "checking whether mbrtowc works as well as mbtowc... " >&6; } -if test "${gl_cv_func_mbrtowc_sanitycheck+set}" = set; then : + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether mbrtowc has a correct return value" >&5 +$as_echo_n "checking whether mbrtowc has a correct return value... " >&6; } +if ${gl_cv_func_mbrtowc_retval+:} false; then : $as_echo_n "(cached) " >&6 else case "$host_os" in - # Guess no on Solaris 8. - solaris2.8) gl_cv_func_mbrtowc_sanitycheck="guessing no" ;; - # Guess yes otherwise. - *) gl_cv_func_mbrtowc_sanitycheck="guessing yes" ;; + # Guess no on HP-UX, Solaris, native Windows. + hpux* | solaris* | mingw*) gl_cv_func_mbrtowc_retval="guessing no" ;; + # Guess yes otherwise. + *) gl_cv_func_mbrtowc_retval="guessing yes" ;; esac - if test $LOCALE_ZH_CN != none; then + if test $LOCALE_FR_UTF8 != none || test $LOCALE_JA != none \ + || { case "$host_os" in mingw*) true;; *) false;; esac; }; then if test "$cross_compiling" = yes; then : : else @@ -20006,7 +22610,6 @@ /* end confdefs.h. */ #include -#include #include /* Tru64 with Desktop Toolkit C has a bug: must be included before . @@ -20018,27 +22621,96 @@ #include int main () { - /* This fails on Solaris 8: - mbrtowc returns 2, and sets wc to 0x00F0. - mbtowc returns 4 (correct) and sets wc to 0x5EDC. */ - if (setlocale (LC_ALL, "$LOCALE_ZH_CN") != NULL) + int result = 0; + int found_some_locale = 0; + /* This fails on Solaris. */ + if (setlocale (LC_ALL, "$LOCALE_FR_UTF8") != NULL) { - char input[] = "B\250\271\201\060\211\070er"; /* "Büßer" */ + char input[] = "B\303\274\303\237er"; /* "Büßer" */ mbstate_t state; wchar_t wc; memset (&state, '\0', sizeof (mbstate_t)); - if (mbrtowc (&wc, input + 3, 6, &state) != 4 - && mbtowc (&wc, input + 3, 6) == 4) - return 1; + if (mbrtowc (&wc, input + 1, 1, &state) == (size_t)(-2)) + { + input[1] = '\0'; + if (mbrtowc (&wc, input + 2, 5, &state) != 1) + result |= 1; + } + found_some_locale = 1; } - return 0; + /* This fails on HP-UX 11.11. */ + if (setlocale (LC_ALL, "$LOCALE_JA") != NULL) + { + char input[] = "B\217\253\344\217\251\316er"; /* "Büßer" */ + mbstate_t state; + wchar_t wc; + + memset (&state, '\0', sizeof (mbstate_t)); + if (mbrtowc (&wc, input + 1, 1, &state) == (size_t)(-2)) + { + input[1] = '\0'; + if (mbrtowc (&wc, input + 2, 5, &state) != 2) + result |= 2; + } + found_some_locale = 1; + } + /* This fails on native Windows. */ + if (setlocale (LC_ALL, "Japanese_Japan.932") != NULL) + { + char input[] = "<\223\372\226\173\214\352>"; /* "<日本語>" */ + mbstate_t state; + wchar_t wc; + + memset (&state, '\0', sizeof (mbstate_t)); + if (mbrtowc (&wc, input + 3, 1, &state) == (size_t)(-2)) + { + input[3] = '\0'; + if (mbrtowc (&wc, input + 4, 4, &state) != 1) + result |= 4; + } + found_some_locale = 1; + } + if (setlocale (LC_ALL, "Chinese_Taiwan.950") != NULL) + { + char input[] = "<\244\351\245\273\273\171>"; /* "<日本語>" */ + mbstate_t state; + wchar_t wc; + + memset (&state, '\0', sizeof (mbstate_t)); + if (mbrtowc (&wc, input + 3, 1, &state) == (size_t)(-2)) + { + input[3] = '\0'; + if (mbrtowc (&wc, input + 4, 4, &state) != 1) + result |= 8; + } + found_some_locale = 1; + } + if (setlocale (LC_ALL, "Chinese_China.936") != NULL) + { + char input[] = "<\310\325\261\276\325\132>"; /* "<日本語>" */ + mbstate_t state; + wchar_t wc; + + memset (&state, '\0', sizeof (mbstate_t)); + if (mbrtowc (&wc, input + 3, 1, &state) == (size_t)(-2)) + { + input[3] = '\0'; + if (mbrtowc (&wc, input + 4, 4, &state) != 1) + result |= 16; + } + found_some_locale = 1; + } + return (found_some_locale ? result : 77); } _ACEOF if ac_fn_c_try_run "$LINENO"; then : - gl_cv_func_mbrtowc_sanitycheck=yes + gl_cv_func_mbrtowc_retval=yes else - gl_cv_func_mbrtowc_sanitycheck=no + if test $? != 77; then + gl_cv_func_mbrtowc_retval=no + fi + fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ conftest.$ac_objext conftest.beam conftest.$ac_ext @@ -20047,540 +22719,393 @@ fi fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_mbrtowc_sanitycheck" >&5 -$as_echo "$gl_cv_func_mbrtowc_sanitycheck" >&6; } - - REPLACE_MBSTATE_T=0 - case "$gl_cv_func_mbrtowc_incomplete_state" in - *yes) ;; - *) REPLACE_MBSTATE_T=1 ;; - esac - case "$gl_cv_func_mbrtowc_sanitycheck" in - *yes) ;; - *) REPLACE_MBSTATE_T=1 ;; - esac - else - REPLACE_MBSTATE_T=1 - fi - if test $REPLACE_MBSTATE_T = 1; then - - : - - fi - - - - if test $ac_cv_func_mbsinit = no; then - HAVE_MBSINIT=0 - else - if test $REPLACE_MBSTATE_T = 1; then - REPLACE_MBSINIT=1 - fi - fi - if test $HAVE_MBSINIT = 0 || test $REPLACE_MBSINIT = 1; then - - : - - - - - - - - - - gl_LIBOBJS="$gl_LIBOBJS mbsinit.$ac_objext" - - - : - - fi - - - - - GNULIB_MBSINIT=1 - - - -$as_echo "#define GNULIB_TEST_MBSINIT 1" >>confdefs.h - - - - # Code from module multiarch: - - # Code from module nl_langinfo: +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_mbrtowc_retval" >&5 +$as_echo "$gl_cv_func_mbrtowc_retval" >&6; } - if test $ac_cv_func_nl_langinfo = yes; then - # On Irix 6.5, YESEXPR is defined, but nl_langinfo(YESEXPR) is broken. - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether YESEXPR works" >&5 -$as_echo_n "checking whether YESEXPR works... " >&6; } -if test "${gl_cv_func_nl_langinfo_yesexpr_works+set}" = set; then : + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether mbrtowc returns 0 when parsing a NUL character" >&5 +$as_echo_n "checking whether mbrtowc returns 0 when parsing a NUL character... " >&6; } +if ${gl_cv_func_mbrtowc_nul_retval+:} false; then : $as_echo_n "(cached) " >&6 else - if test "$cross_compiling" = yes; then : - - case "$host_os" in - # Guess no on irix systems. - irix*) gl_cv_func_nl_langinfo_yesexpr_works="guessing no";; - # Guess yes elsewhere. - *) gl_cv_func_nl_langinfo_yesexpr_works="guessing yes";; - esac + case "$host_os" in + # Guess no on Solaris 8 and 9. + solaris2.[89]) gl_cv_func_mbrtowc_nul_retval="guessing no" ;; + # Guess yes otherwise. + *) gl_cv_func_mbrtowc_nul_retval="guessing yes" ;; + esac + if test $LOCALE_ZH_CN != none; then + if test "$cross_compiling" = yes; then : + : else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ -#include -int -main () +#include +#include +/* Tru64 with Desktop Toolkit C has a bug: must be included before + . + BSD/OS 4.0.1 has a bug: , and must be + included before . */ +#include +#include +#include +#include +int main () { -return !*nl_langinfo(YESEXPR); + /* This fails on Solaris 8 and 9. */ + if (setlocale (LC_ALL, "$LOCALE_ZH_CN") != NULL) + { + mbstate_t state; + wchar_t wc; - ; + memset (&state, '\0', sizeof (mbstate_t)); + if (mbrtowc (&wc, "", 1, &state) != 0) + return 1; + } return 0; } _ACEOF if ac_fn_c_try_run "$LINENO"; then : - gl_cv_func_nl_langinfo_yesexpr_works=yes + gl_cv_func_mbrtowc_nul_retval=yes else - gl_cv_func_nl_langinfo_yesexpr_works=no + gl_cv_func_mbrtowc_nul_retval=no fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ conftest.$ac_objext conftest.beam conftest.$ac_ext fi + fi + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_mbrtowc_nul_retval" >&5 +$as_echo "$gl_cv_func_mbrtowc_nul_retval" >&6; } + + case "$gl_cv_func_mbrtowc_null_arg1" in + *yes) ;; + *) +$as_echo "#define MBRTOWC_NULL_ARG1_BUG 1" >>confdefs.h + + REPLACE_MBRTOWC=1 + ;; + esac + case "$gl_cv_func_mbrtowc_null_arg2" in + *yes) ;; + *) +$as_echo "#define MBRTOWC_NULL_ARG2_BUG 1" >>confdefs.h + + REPLACE_MBRTOWC=1 + ;; + esac + case "$gl_cv_func_mbrtowc_retval" in + *yes) ;; + *) +$as_echo "#define MBRTOWC_RETVAL_BUG 1" >>confdefs.h + + REPLACE_MBRTOWC=1 + ;; + esac + case "$gl_cv_func_mbrtowc_nul_retval" in + *yes) ;; + *) +$as_echo "#define MBRTOWC_NUL_RETVAL_BUG 1" >>confdefs.h + + REPLACE_MBRTOWC=1 + ;; + esac + fi + fi + +if test $HAVE_MBRTOWC = 0 || test $REPLACE_MBRTOWC = 1; then -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_nl_langinfo_yesexpr_works" >&5 -$as_echo "$gl_cv_func_nl_langinfo_yesexpr_works" >&6; } - case $gl_cv_func_nl_langinfo_yesexpr_works in - *yes) FUNC_NL_LANGINFO_YESEXPR_WORKS=1 ;; - *) FUNC_NL_LANGINFO_YESEXPR_WORKS=0 ;; - esac -cat >>confdefs.h <<_ACEOF -#define FUNC_NL_LANGINFO_YESEXPR_WORKS $FUNC_NL_LANGINFO_YESEXPR_WORKS -_ACEOF - if test $HAVE_LANGINFO_CODESET = 1 && test $HAVE_LANGINFO_ERA = 1 \ - && test $FUNC_NL_LANGINFO_YESEXPR_WORKS = 1; then - : - else - REPLACE_NL_LANGINFO=1 -$as_echo "#define REPLACE_NL_LANGINFO 1" >>confdefs.h + gl_LIBOBJS="$gl_LIBOBJS mbrtowc.$ac_objext" + : +fi - gl_LIBOBJS="$gl_LIBOBJS nl_langinfo.$ac_objext" - fi - else - HAVE_NL_LANGINFO=0 + GNULIB_MBRTOWC=1 +$as_echo "#define GNULIB_TEST_MBRTOWC 1" >>confdefs.h - gl_LIBOBJS="$gl_LIBOBJS nl_langinfo.$ac_objext" - fi - GNULIB_NL_LANGINFO=1 -$as_echo "#define GNULIB_TEST_NL_LANGINFO 1" >>confdefs.h - # Code from module regex: -# Check whether --with-included-regex was given. -if test "${with_included_regex+set}" = set; then : - withval=$with_included_regex; -fi + if test $ac_cv_func_mbsinit = yes && test $ac_cv_func_mbrtowc = yes; then - case $with_included_regex in #( - yes|no) ac_use_included_regex=$with_included_regex - ;; - '') - # If the system regex support is good enough that it passes the - # following run test, then default to *not* using the included regex.c. - # If cross compiling, assume the test would fail and use the included - # regex.c. - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for working re_compile_pattern" >&5 -$as_echo_n "checking for working re_compile_pattern... " >&6; } -if test "${gl_cv_func_re_compile_pattern_working+set}" = set; then : + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether mbrtowc handles incomplete characters" >&5 +$as_echo_n "checking whether mbrtowc handles incomplete characters... " >&6; } +if ${gl_cv_func_mbrtowc_incomplete_state+:} false; then : $as_echo_n "(cached) " >&6 else - if test "$cross_compiling" = yes; then : - gl_cv_func_re_compile_pattern_working=no + + case "$host_os" in + # Guess no on AIX and OSF/1. + aix* | osf*) gl_cv_func_mbrtowc_incomplete_state="guessing no" ;; + # Guess yes otherwise. + *) gl_cv_func_mbrtowc_incomplete_state="guessing yes" ;; + esac + if test $LOCALE_JA != none; then + if test "$cross_compiling" = yes; then : + : else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ -$ac_includes_default - #include - #include - #include -int -main () +#include +#include +/* Tru64 with Desktop Toolkit C has a bug: must be included before + . + BSD/OS 4.0.1 has a bug: , and must be + included before . */ +#include +#include +#include +#include +int main () { -int result = 0; - static struct re_pattern_buffer regex; - unsigned char folded_chars[UCHAR_MAX + 1]; - int i; - const char *s; - struct re_registers regs; - - /* http://sourceware.org/ml/libc-hacker/2006-09/msg00008.html - This test needs valgrind to catch the bug on Debian - GNU/Linux 3.1 x86, but it might catch the bug better - on other platforms and it shouldn't hurt to try the - test here. */ - if (setlocale (LC_ALL, "en_US.UTF-8")) - { - static char const pat[] = "insert into"; - static char const data[] = - "\xFF\0\x12\xA2\xAA\xC4\xB1,K\x12\xC4\xB1*\xACK"; - re_set_syntax (RE_SYNTAX_GREP | RE_HAT_LISTS_NOT_NEWLINE - | RE_ICASE); - memset (®ex, 0, sizeof regex); - s = re_compile_pattern (pat, sizeof pat - 1, ®ex); - if (s) - result |= 1; - else if (re_search (®ex, data, sizeof data - 1, - 0, sizeof data - 1, ®s) - != -1) - result |= 1; - if (! setlocale (LC_ALL, "C")) - return 1; - } - - /* This test is from glibc bug 3957, reported by Andrew Mackey. */ - re_set_syntax (RE_SYNTAX_EGREP | RE_HAT_LISTS_NOT_NEWLINE); - memset (®ex, 0, sizeof regex); - s = re_compile_pattern ("a[^x]b", 6, ®ex); - if (s) - result |= 2; - /* This should fail, but succeeds for glibc-2.5. */ - else if (re_search (®ex, "a\nb", 3, 0, 3, ®s) != -1) - result |= 2; - - /* This regular expression is from Spencer ere test number 75 - in grep-2.3. */ - re_set_syntax (RE_SYNTAX_POSIX_EGREP); - memset (®ex, 0, sizeof regex); - for (i = 0; i <= UCHAR_MAX; i++) - folded_chars[i] = i; - regex.translate = folded_chars; - s = re_compile_pattern ("a[[:]:]]b\n", 11, ®ex); - /* This should fail with _Invalid character class name_ error. */ - if (!s) - result |= 4; + if (setlocale (LC_ALL, "$LOCALE_JA") != NULL) + { + const char input[] = "B\217\253\344\217\251\316er"; /* "Büßer" */ + mbstate_t state; + wchar_t wc; - /* Ensure that [b-a] is diagnosed as invalid, when - using RE_NO_EMPTY_RANGES. */ - re_set_syntax (RE_SYNTAX_POSIX_EGREP | RE_NO_EMPTY_RANGES); - memset (®ex, 0, sizeof regex); - s = re_compile_pattern ("a[b-a]", 6, ®ex); - if (s == 0) - result |= 8; + memset (&state, '\0', sizeof (mbstate_t)); + if (mbrtowc (&wc, input + 1, 1, &state) == (size_t)(-2)) + if (mbsinit (&state)) + return 1; + } + return 0; +} +_ACEOF +if ac_fn_c_try_run "$LINENO"; then : + gl_cv_func_mbrtowc_incomplete_state=yes +else + gl_cv_func_mbrtowc_incomplete_state=no +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext +fi - /* This should succeed, but does not for glibc-2.1.3. */ - memset (®ex, 0, sizeof regex); - s = re_compile_pattern ("{1", 2, ®ex); - if (s) - result |= 8; + fi - /* The following example is derived from a problem report - against gawk from Jorge Stolfi . */ - memset (®ex, 0, sizeof regex); - s = re_compile_pattern ("[an\371]*n", 7, ®ex); - if (s) - result |= 8; - /* This should match, but does not for glibc-2.2.1. */ - else if (re_match (®ex, "an", 2, 0, ®s) != 2) - result |= 8; +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_mbrtowc_incomplete_state" >&5 +$as_echo "$gl_cv_func_mbrtowc_incomplete_state" >&6; } - memset (®ex, 0, sizeof regex); - s = re_compile_pattern ("x", 1, ®ex); - if (s) - result |= 8; - /* glibc-2.2.93 does not work with a negative RANGE argument. */ - else if (re_search (®ex, "wxy", 3, 2, -2, ®s) != 1) - result |= 8; - /* The version of regex.c in older versions of gnulib - ignored RE_ICASE. Detect that problem too. */ - re_set_syntax (RE_SYNTAX_EMACS | RE_ICASE); - memset (®ex, 0, sizeof regex); - s = re_compile_pattern ("x", 1, ®ex); - if (s) - result |= 16; - else if (re_search (®ex, "WXY", 3, 0, 3, ®s) < 0) - result |= 16; - /* Catch a bug reported by Vin Shelton in - http://lists.gnu.org/archive/html/bug-coreutils/2007-06/msg00089.html - */ - re_set_syntax (RE_SYNTAX_POSIX_BASIC - & ~RE_CONTEXT_INVALID_DUP - & ~RE_NO_EMPTY_RANGES); - memset (®ex, 0, sizeof regex); - s = re_compile_pattern ("[[:alnum:]_-]\\\\+$", 16, ®ex); - if (s) - result |= 32; - /* REG_STARTEND was added to glibc on 2004-01-15. - Reject older versions. */ - if (! REG_STARTEND) - result |= 64; + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether mbrtowc works as well as mbtowc" >&5 +$as_echo_n "checking whether mbrtowc works as well as mbtowc... " >&6; } +if ${gl_cv_func_mbrtowc_sanitycheck+:} false; then : + $as_echo_n "(cached) " >&6 +else -#if 0 - /* It would be nice to reject hosts whose regoff_t values are too - narrow (including glibc on hosts with 64-bit ptrdiff_t and - 32-bit int), but we should wait until glibc implements this - feature. Otherwise, support for equivalence classes and - multibyte collation symbols would always be broken except - when compiling --without-included-regex. */ - if (sizeof (regoff_t) < sizeof (ptrdiff_t) - || sizeof (regoff_t) < sizeof (ssize_t)) - result |= 64; -#endif + case "$host_os" in + # Guess no on Solaris 8. + solaris2.8) gl_cv_func_mbrtowc_sanitycheck="guessing no" ;; + # Guess yes otherwise. + *) gl_cv_func_mbrtowc_sanitycheck="guessing yes" ;; + esac + if test $LOCALE_ZH_CN != none; then + if test "$cross_compiling" = yes; then : + : +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ - return result; +#include +#include +#include +/* Tru64 with Desktop Toolkit C has a bug: must be included before + . + BSD/OS 4.0.1 has a bug: , and must be + included before . */ +#include +#include +#include +#include +int main () +{ + /* This fails on Solaris 8: + mbrtowc returns 2, and sets wc to 0x00F0. + mbtowc returns 4 (correct) and sets wc to 0x5EDC. */ + if (setlocale (LC_ALL, "$LOCALE_ZH_CN") != NULL) + { + char input[] = "B\250\271\201\060\211\070er"; /* "Büßer" */ + mbstate_t state; + wchar_t wc; - ; + memset (&state, '\0', sizeof (mbstate_t)); + if (mbrtowc (&wc, input + 3, 6, &state) != 4 + && mbtowc (&wc, input + 3, 6) == 4) + return 1; + } return 0; } _ACEOF if ac_fn_c_try_run "$LINENO"; then : - gl_cv_func_re_compile_pattern_working=yes + gl_cv_func_mbrtowc_sanitycheck=yes else - gl_cv_func_re_compile_pattern_working=no + gl_cv_func_mbrtowc_sanitycheck=no fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ conftest.$ac_objext conftest.beam conftest.$ac_ext fi -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_re_compile_pattern_working" >&5 -$as_echo "$gl_cv_func_re_compile_pattern_working" >&6; } - case $gl_cv_func_re_compile_pattern_working in #( - yes) ac_use_included_regex=no;; #( - no) ac_use_included_regex=yes;; - esac - ;; - *) as_fn_error "Invalid value for --with-included-regex: $with_included_regex" "$LINENO" 5 - ;; - esac - - if test $ac_use_included_regex = yes; then - -$as_echo "#define _REGEX_LARGE_OFFSETS 1" >>confdefs.h - - -$as_echo "#define re_syntax_options rpl_re_syntax_options" >>confdefs.h - - -$as_echo "#define re_set_syntax rpl_re_set_syntax" >>confdefs.h - - -$as_echo "#define re_compile_pattern rpl_re_compile_pattern" >>confdefs.h + fi +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_mbrtowc_sanitycheck" >&5 +$as_echo "$gl_cv_func_mbrtowc_sanitycheck" >&6; } -$as_echo "#define re_compile_fastmap rpl_re_compile_fastmap" >>confdefs.h + REPLACE_MBSTATE_T=0 + case "$gl_cv_func_mbrtowc_incomplete_state" in + *yes) ;; + *) REPLACE_MBSTATE_T=1 ;; + esac + case "$gl_cv_func_mbrtowc_sanitycheck" in + *yes) ;; + *) REPLACE_MBSTATE_T=1 ;; + esac + else + REPLACE_MBSTATE_T=1 + fi -$as_echo "#define re_search rpl_re_search" >>confdefs.h + if test $ac_cv_func_mbsinit = no; then + HAVE_MBSINIT=0 + ac_fn_c_check_decl "$LINENO" "mbsinit" "ac_cv_have_decl_mbsinit" " +/* Tru64 with Desktop Toolkit C has a bug: must be included before + . + BSD/OS 4.0.1 has a bug: , and must be + included before . */ +#include +#include +#include +#include -$as_echo "#define re_search_2 rpl_re_search_2" >>confdefs.h +" +if test "x$ac_cv_have_decl_mbsinit" = xyes; then : + ac_have_decl=1 +else + ac_have_decl=0 +fi +cat >>confdefs.h <<_ACEOF +#define HAVE_DECL_MBSINIT $ac_have_decl +_ACEOF -$as_echo "#define re_match rpl_re_match" >>confdefs.h + if test $ac_cv_have_decl_mbsinit = yes; then + REPLACE_MBSINIT=1 + fi + else + if test $REPLACE_MBSTATE_T = 1; then + REPLACE_MBSINIT=1 + else + case "$host_os" in + mingw*) REPLACE_MBSINIT=1 ;; + esac + fi + fi +if test $HAVE_MBSINIT = 0 || test $REPLACE_MBSINIT = 1; then -$as_echo "#define re_match_2 rpl_re_match_2" >>confdefs.h -$as_echo "#define re_set_registers rpl_re_set_registers" >>confdefs.h -$as_echo "#define re_comp rpl_re_comp" >>confdefs.h -$as_echo "#define re_exec rpl_re_exec" >>confdefs.h + gl_LIBOBJS="$gl_LIBOBJS mbsinit.$ac_objext" -$as_echo "#define regcomp rpl_regcomp" >>confdefs.h + : -$as_echo "#define regexec rpl_regexec" >>confdefs.h +fi -$as_echo "#define regerror rpl_regerror" >>confdefs.h -$as_echo "#define regfree rpl_regfree" >>confdefs.h + GNULIB_MBSINIT=1 +$as_echo "#define GNULIB_TEST_MBSINIT 1" >>confdefs.h - gl_LIBOBJS="$gl_LIBOBJS regex.$ac_objext" + if false; then + REPLACE_MBTOWC=1 + fi +if test $REPLACE_MBTOWC = 1; then - for ac_header in libintl.h -do : - ac_fn_c_check_header_mongrel "$LINENO" "libintl.h" "ac_cv_header_libintl_h" "$ac_includes_default" -if test "x$ac_cv_header_libintl_h" = x""yes; then : - cat >>confdefs.h <<_ACEOF -#define HAVE_LIBINTL_H 1 -_ACEOF -fi -done - ac_fn_c_check_decl "$LINENO" "isblank" "ac_cv_have_decl_isblank" "#include -" -if test "x$ac_cv_have_decl_isblank" = x""yes; then : - ac_have_decl=1 -else - ac_have_decl=0 -fi -cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_ISBLANK $ac_have_decl -_ACEOF + gl_LIBOBJS="$gl_LIBOBJS mbtowc.$ac_objext" - fi - # Code from module ssize_t: + : - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ssize_t" >&5 -$as_echo_n "checking for ssize_t... " >&6; } -if test "${gt_cv_ssize_t+set}" = set; then : - $as_echo_n "(cached) " >&6 -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include -int -main () -{ -int x = sizeof (ssize_t *) + sizeof (ssize_t); - return !x; - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - gt_cv_ssize_t=yes -else - gt_cv_ssize_t=no fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gt_cv_ssize_t" >&5 -$as_echo "$gt_cv_ssize_t" >&6; } - if test $gt_cv_ssize_t = no; then - -$as_echo "#define ssize_t int" >>confdefs.h - - fi - - # Code from module stdbool: - - # Define two additional variables used in the Makefile substitution. - - if test "$ac_cv_header_stdbool_h" = yes; then - STDBOOL_H='' - else - STDBOOL_H='stdbool.h' - fi - - if test "$ac_cv_type__Bool" = yes; then - HAVE__BOOL=1 - else - HAVE__BOOL=0 - fi - # Code from module stddef: + GNULIB_MBTOWC=1 - if test $gt_cv_c_wchar_t = no; then - HAVE_WCHAR_T=0 - STDDEF_H=stddef.h - fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether NULL can be used in arbitrary expressions" >&5 -$as_echo_n "checking whether NULL can be used in arbitrary expressions... " >&6; } -if test "${gl_cv_decl_null_works+set}" = set; then : - $as_echo_n "(cached) " >&6 -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include - int test[2 * (sizeof NULL == sizeof (void *)) -1]; -int -main () -{ - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - gl_cv_decl_null_works=yes -else - gl_cv_decl_null_works=no -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_decl_null_works" >&5 -$as_echo "$gl_cv_decl_null_works" >&6; } - if test $gl_cv_decl_null_works = no; then - REPLACE_NULL=1 - STDDEF_H=stddef.h - fi - if test -n "$STDDEF_H"; then +$as_echo "#define GNULIB_TEST_MBTOWC 1" >>confdefs.h @@ -20589,717 +23114,457 @@ - if test $gl_cv_have_include_next = yes; then - gl_cv_next_stddef_h='<'stddef.h'>' - else - { $as_echo "$as_me:${as_lineno-$LINENO}: checking absolute name of " >&5 -$as_echo_n "checking absolute name of ... " >&6; } -if test "${gl_cv_next_stddef_h+set}" = set; then : + if test $ac_cv_func_nl_langinfo = yes; then + # On Irix 6.5, YESEXPR is defined, but nl_langinfo(YESEXPR) is broken. + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether YESEXPR works" >&5 +$as_echo_n "checking whether YESEXPR works... " >&6; } +if ${gl_cv_func_nl_langinfo_yesexpr_works+:} false; then : $as_echo_n "(cached) " >&6 else + if test "$cross_compiling" = yes; then : - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include - -_ACEOF - case "$host_os" in - aix*) gl_absname_cpp="$ac_cpp -C" ;; - *) gl_absname_cpp="$ac_cpp" ;; - esac - gl_cv_next_stddef_h='"'`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 | - sed -n '\#/stddef.h#{ - s#.*"\(.*/stddef.h\)".*#\1# - s#^/[^/]#//&# - p - q - }'`'"' - - -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_stddef_h" >&5 -$as_echo "$gl_cv_next_stddef_h" >&6; } - fi - NEXT_STDDEF_H=$gl_cv_next_stddef_h - - if test $gl_cv_have_include_next = yes || test $gl_cv_have_include_next = buggy; then - # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include_next' - gl_next_as_first_directive='<'stddef.h'>' - else - # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include' - gl_next_as_first_directive=$gl_cv_next_stddef_h - fi - NEXT_AS_FIRST_DIRECTIVE_STDDEF_H=$gl_next_as_first_directive - - - - - fi - - # Code from module stdint: - - - - if test $ac_cv_type_long_long_int = yes; then - HAVE_LONG_LONG_INT=1 - else - HAVE_LONG_LONG_INT=0 - fi - - - if test $ac_cv_type_unsigned_long_long_int = yes; then - HAVE_UNSIGNED_LONG_LONG_INT=1 - else - HAVE_UNSIGNED_LONG_LONG_INT=0 - fi - - - if test $ac_cv_header_inttypes_h = yes; then - HAVE_INTTYPES_H=1 - else - HAVE_INTTYPES_H=0 - fi - + case "$host_os" in + # Guess no on irix systems. + irix*) gl_cv_func_nl_langinfo_yesexpr_works="guessing no";; + # Guess yes elsewhere. + *) gl_cv_func_nl_langinfo_yesexpr_works="guessing yes";; + esac - if test $ac_cv_header_sys_types_h = yes; then - HAVE_SYS_TYPES_H=1 - else - HAVE_SYS_TYPES_H=0 - fi +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +int +main () +{ +return !*nl_langinfo(YESEXPR); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_run "$LINENO"; then : + gl_cv_func_nl_langinfo_yesexpr_works=yes +else + gl_cv_func_nl_langinfo_yesexpr_works=no +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext +fi +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_nl_langinfo_yesexpr_works" >&5 +$as_echo "$gl_cv_func_nl_langinfo_yesexpr_works" >&6; } + case $gl_cv_func_nl_langinfo_yesexpr_works in + *yes) FUNC_NL_LANGINFO_YESEXPR_WORKS=1 ;; + *) FUNC_NL_LANGINFO_YESEXPR_WORKS=0 ;; + esac +cat >>confdefs.h <<_ACEOF +#define FUNC_NL_LANGINFO_YESEXPR_WORKS $FUNC_NL_LANGINFO_YESEXPR_WORKS +_ACEOF + if test $HAVE_LANGINFO_CODESET = 1 && test $HAVE_LANGINFO_ERA = 1 \ + && test $FUNC_NL_LANGINFO_YESEXPR_WORKS = 1; then + : + else + REPLACE_NL_LANGINFO=1 +$as_echo "#define REPLACE_NL_LANGINFO 1" >>confdefs.h + fi + else + HAVE_NL_LANGINFO=0 + fi +if test $HAVE_NL_LANGINFO = 0 || test $REPLACE_NL_LANGINFO = 1; then - if test $gl_cv_have_include_next = yes; then - gl_cv_next_stdint_h='<'stdint.h'>' - else - { $as_echo "$as_me:${as_lineno-$LINENO}: checking absolute name of " >&5 -$as_echo_n "checking absolute name of ... " >&6; } -if test "${gl_cv_next_stdint_h+set}" = set; then : - $as_echo_n "(cached) " >&6 -else - if test $ac_cv_header_stdint_h = yes; then - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include -_ACEOF - case "$host_os" in - aix*) gl_absname_cpp="$ac_cpp -C" ;; - *) gl_absname_cpp="$ac_cpp" ;; - esac - gl_cv_next_stdint_h='"'`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 | - sed -n '\#/stdint.h#{ - s#.*"\(.*/stdint.h\)".*#\1# - s#^/[^/]#//&# - p - q - }'`'"' - else - gl_cv_next_stdint_h='<'stdint.h'>' - fi + gl_LIBOBJS="$gl_LIBOBJS nl_langinfo.$ac_objext" + fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_stdint_h" >&5 -$as_echo "$gl_cv_next_stdint_h" >&6; } - fi - NEXT_STDINT_H=$gl_cv_next_stdint_h - if test $gl_cv_have_include_next = yes || test $gl_cv_have_include_next = buggy; then - # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include_next' - gl_next_as_first_directive='<'stdint.h'>' - else - # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include' - gl_next_as_first_directive=$gl_cv_next_stdint_h - fi - NEXT_AS_FIRST_DIRECTIVE_STDINT_H=$gl_next_as_first_directive - if test $ac_cv_header_stdint_h = yes; then - HAVE_STDINT_H=1 - else - HAVE_STDINT_H=0 - fi + GNULIB_NL_LANGINFO=1 - if test $ac_cv_header_stdint_h = yes; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether stdint.h conforms to C99" >&5 -$as_echo_n "checking whether stdint.h conforms to C99... " >&6; } -if test "${gl_cv_header_working_stdint_h+set}" = set; then : - $as_echo_n "(cached) " >&6 -else - gl_cv_header_working_stdint_h=no - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#define __STDC_LIMIT_MACROS 1 /* to make it work also in C++ mode */ -#define __STDC_CONSTANT_MACROS 1 /* to make it work also in C++ mode */ -#define _GL_JUST_INCLUDE_SYSTEM_STDINT_H 1 /* work if build isn't clean */ -#include -/* Dragonfly defines WCHAR_MIN, WCHAR_MAX only in . */ -#if !(defined WCHAR_MIN && defined WCHAR_MAX) -#error "WCHAR_MIN, WCHAR_MAX not defined in " -#endif +$as_echo "#define GNULIB_TEST_NL_LANGINFO 1" >>confdefs.h - /* BSD/OS 4.0.1 has a bug: , and must be - included before . */ - #include - #include - #if HAVE_WCHAR_H - # include - # include - # include - #endif -#ifdef INT8_MAX -int8_t a1 = INT8_MAX; -int8_t a1min = INT8_MIN; -#endif -#ifdef INT16_MAX -int16_t a2 = INT16_MAX; -int16_t a2min = INT16_MIN; -#endif -#ifdef INT32_MAX -int32_t a3 = INT32_MAX; -int32_t a3min = INT32_MIN; -#endif -#ifdef INT64_MAX -int64_t a4 = INT64_MAX; -int64_t a4min = INT64_MIN; -#endif -#ifdef UINT8_MAX -uint8_t b1 = UINT8_MAX; -#else -typedef int b1[(unsigned char) -1 != 255 ? 1 : -1]; -#endif -#ifdef UINT16_MAX -uint16_t b2 = UINT16_MAX; -#endif -#ifdef UINT32_MAX -uint32_t b3 = UINT32_MAX; -#endif -#ifdef UINT64_MAX -uint64_t b4 = UINT64_MAX; -#endif -int_least8_t c1 = INT8_C (0x7f); -int_least8_t c1max = INT_LEAST8_MAX; -int_least8_t c1min = INT_LEAST8_MIN; -int_least16_t c2 = INT16_C (0x7fff); -int_least16_t c2max = INT_LEAST16_MAX; -int_least16_t c2min = INT_LEAST16_MIN; -int_least32_t c3 = INT32_C (0x7fffffff); -int_least32_t c3max = INT_LEAST32_MAX; -int_least32_t c3min = INT_LEAST32_MIN; -int_least64_t c4 = INT64_C (0x7fffffffffffffff); -int_least64_t c4max = INT_LEAST64_MAX; -int_least64_t c4min = INT_LEAST64_MIN; -uint_least8_t d1 = UINT8_C (0xff); -uint_least8_t d1max = UINT_LEAST8_MAX; -uint_least16_t d2 = UINT16_C (0xffff); -uint_least16_t d2max = UINT_LEAST16_MAX; -uint_least32_t d3 = UINT32_C (0xffffffff); -uint_least32_t d3max = UINT_LEAST32_MAX; -uint_least64_t d4 = UINT64_C (0xffffffffffffffff); -uint_least64_t d4max = UINT_LEAST64_MAX; -int_fast8_t e1 = INT_FAST8_MAX; -int_fast8_t e1min = INT_FAST8_MIN; -int_fast16_t e2 = INT_FAST16_MAX; -int_fast16_t e2min = INT_FAST16_MIN; -int_fast32_t e3 = INT_FAST32_MAX; -int_fast32_t e3min = INT_FAST32_MIN; -int_fast64_t e4 = INT_FAST64_MAX; -int_fast64_t e4min = INT_FAST64_MIN; -uint_fast8_t f1 = UINT_FAST8_MAX; -uint_fast16_t f2 = UINT_FAST16_MAX; -uint_fast32_t f3 = UINT_FAST32_MAX; -uint_fast64_t f4 = UINT_FAST64_MAX; -#ifdef INTPTR_MAX -intptr_t g = INTPTR_MAX; -intptr_t gmin = INTPTR_MIN; -#endif -#ifdef UINTPTR_MAX -uintptr_t h = UINTPTR_MAX; -#endif -intmax_t i = INTMAX_MAX; -uintmax_t j = UINTMAX_MAX; -#include /* for CHAR_BIT */ -#define TYPE_MINIMUM(t) \ - ((t) ((t) 0 < (t) -1 ? (t) 0 : ~ TYPE_MAXIMUM (t))) -#define TYPE_MAXIMUM(t) \ - ((t) ((t) 0 < (t) -1 \ - ? (t) -1 \ - : ((((t) 1 << (sizeof (t) * CHAR_BIT - 2)) - 1) * 2 + 1))) -struct s { - int check_PTRDIFF: - PTRDIFF_MIN == TYPE_MINIMUM (ptrdiff_t) - && PTRDIFF_MAX == TYPE_MAXIMUM (ptrdiff_t) - ? 1 : -1; - /* Detect bug in FreeBSD 6.0 / ia64. */ - int check_SIG_ATOMIC: - SIG_ATOMIC_MIN == TYPE_MINIMUM (sig_atomic_t) - && SIG_ATOMIC_MAX == TYPE_MAXIMUM (sig_atomic_t) - ? 1 : -1; - int check_SIZE: SIZE_MAX == TYPE_MAXIMUM (size_t) ? 1 : -1; - int check_WCHAR: - WCHAR_MIN == TYPE_MINIMUM (wchar_t) - && WCHAR_MAX == TYPE_MAXIMUM (wchar_t) - ? 1 : -1; - /* Detect bug in mingw. */ - int check_WINT: - WINT_MIN == TYPE_MINIMUM (wint_t) - && WINT_MAX == TYPE_MAXIMUM (wint_t) - ? 1 : -1; - /* Detect bugs in glibc 2.4 and Solaris 10 stdint.h, among others. */ - int check_UINT8_C: - (-1 < UINT8_C (0)) == (-1 < (uint_least8_t) 0) ? 1 : -1; - int check_UINT16_C: - (-1 < UINT16_C (0)) == (-1 < (uint_least16_t) 0) ? 1 : -1; +# Check whether --with-included-regex was given. +if test "${with_included_regex+set}" = set; then : + withval=$with_included_regex; +fi - /* Detect bugs in OpenBSD 3.9 stdint.h. */ -#ifdef UINT8_MAX - int check_uint8: (uint8_t) -1 == UINT8_MAX ? 1 : -1; -#endif -#ifdef UINT16_MAX - int check_uint16: (uint16_t) -1 == UINT16_MAX ? 1 : -1; -#endif -#ifdef UINT32_MAX - int check_uint32: (uint32_t) -1 == UINT32_MAX ? 1 : -1; -#endif -#ifdef UINT64_MAX - int check_uint64: (uint64_t) -1 == UINT64_MAX ? 1 : -1; -#endif - int check_uint_least8: (uint_least8_t) -1 == UINT_LEAST8_MAX ? 1 : -1; - int check_uint_least16: (uint_least16_t) -1 == UINT_LEAST16_MAX ? 1 : -1; - int check_uint_least32: (uint_least32_t) -1 == UINT_LEAST32_MAX ? 1 : -1; - int check_uint_least64: (uint_least64_t) -1 == UINT_LEAST64_MAX ? 1 : -1; - int check_uint_fast8: (uint_fast8_t) -1 == UINT_FAST8_MAX ? 1 : -1; - int check_uint_fast16: (uint_fast16_t) -1 == UINT_FAST16_MAX ? 1 : -1; - int check_uint_fast32: (uint_fast32_t) -1 == UINT_FAST32_MAX ? 1 : -1; - int check_uint_fast64: (uint_fast64_t) -1 == UINT_FAST64_MAX ? 1 : -1; - int check_uintptr: (uintptr_t) -1 == UINTPTR_MAX ? 1 : -1; - int check_uintmax: (uintmax_t) -1 == UINTMAX_MAX ? 1 : -1; - int check_size: (size_t) -1 == SIZE_MAX ? 1 : -1; -}; + + case $with_included_regex in #( + yes|no) ac_use_included_regex=$with_included_regex + ;; + '') + # If the system regex support is good enough that it passes the + # following run test, then default to *not* using the included regex.c. + # If cross compiling, assume the test would fail and use the included + # regex.c. + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for working re_compile_pattern" >&5 +$as_echo_n "checking for working re_compile_pattern... " >&6; } +if ${gl_cv_func_re_compile_pattern_working+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test "$cross_compiling" = yes; then : + gl_cv_func_re_compile_pattern_working=no +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$ac_includes_default + #include + #include + #include int main () { +int result = 0; + static struct re_pattern_buffer regex; + unsigned char folded_chars[UCHAR_MAX + 1]; + int i; + const char *s; + struct re_registers regs; - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - if test "$cross_compiling" = yes; then : - gl_cv_header_working_stdint_h=yes + /* http://sourceware.org/ml/libc-hacker/2006-09/msg00008.html + This test needs valgrind to catch the bug on Debian + GNU/Linux 3.1 x86, but it might catch the bug better + on other platforms and it shouldn't hurt to try the + test here. */ + if (setlocale (LC_ALL, "en_US.UTF-8")) + { + static char const pat[] = "insert into"; + static char const data[] = + "\xFF\0\x12\xA2\xAA\xC4\xB1,K\x12\xC4\xB1*\xACK"; + re_set_syntax (RE_SYNTAX_GREP | RE_HAT_LISTS_NOT_NEWLINE + | RE_ICASE); + memset (®ex, 0, sizeof regex); + s = re_compile_pattern (pat, sizeof pat - 1, ®ex); + if (s) + result |= 1; + else if (re_search (®ex, data, sizeof data - 1, + 0, sizeof data - 1, ®s) + != -1) + result |= 1; + if (! setlocale (LC_ALL, "C")) + return 1; + } -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ + /* This test is from glibc bug 3957, reported by Andrew Mackey. */ + re_set_syntax (RE_SYNTAX_EGREP | RE_HAT_LISTS_NOT_NEWLINE); + memset (®ex, 0, sizeof regex); + s = re_compile_pattern ("a[^x]b", 6, ®ex); + if (s) + result |= 2; + /* This should fail, but succeeds for glibc-2.5. */ + else if (re_search (®ex, "a\nb", 3, 0, 3, ®s) != -1) + result |= 2; + /* This regular expression is from Spencer ere test number 75 + in grep-2.3. */ + re_set_syntax (RE_SYNTAX_POSIX_EGREP); + memset (®ex, 0, sizeof regex); + for (i = 0; i <= UCHAR_MAX; i++) + folded_chars[i] = i; + regex.translate = folded_chars; + s = re_compile_pattern ("a[[:]:]]b\n", 11, ®ex); + /* This should fail with _Invalid character class name_ error. */ + if (!s) + result |= 4; -#define __STDC_LIMIT_MACROS 1 /* to make it work also in C++ mode */ -#define __STDC_CONSTANT_MACROS 1 /* to make it work also in C++ mode */ -#define _GL_JUST_INCLUDE_SYSTEM_STDINT_H 1 /* work if build isn't clean */ -#include + /* Ensure that [b-a] is diagnosed as invalid, when + using RE_NO_EMPTY_RANGES. */ + re_set_syntax (RE_SYNTAX_POSIX_EGREP | RE_NO_EMPTY_RANGES); + memset (®ex, 0, sizeof regex); + s = re_compile_pattern ("a[b-a]", 6, ®ex); + if (s == 0) + result |= 8; + /* This should succeed, but does not for glibc-2.1.3. */ + memset (®ex, 0, sizeof regex); + s = re_compile_pattern ("{1", 2, ®ex); + if (s) + result |= 8; - /* BSD/OS 4.0.1 has a bug: , and must be - included before . */ - #include - #include - #if HAVE_WCHAR_H - # include - # include - # include - #endif + /* The following example is derived from a problem report + against gawk from Jorge Stolfi . */ + memset (®ex, 0, sizeof regex); + s = re_compile_pattern ("[an\371]*n", 7, ®ex); + if (s) + result |= 8; + /* This should match, but does not for glibc-2.2.1. */ + else if (re_match (®ex, "an", 2, 0, ®s) != 2) + result |= 8; + memset (®ex, 0, sizeof regex); + s = re_compile_pattern ("x", 1, ®ex); + if (s) + result |= 8; + /* glibc-2.2.93 does not work with a negative RANGE argument. */ + else if (re_search (®ex, "wxy", 3, 2, -2, ®s) != 1) + result |= 8; -#include -#include -#define MVAL(macro) MVAL1(macro) -#define MVAL1(expression) #expression -static const char *macro_values[] = - { -#ifdef INT8_MAX - MVAL (INT8_MAX), -#endif -#ifdef INT16_MAX - MVAL (INT16_MAX), -#endif -#ifdef INT32_MAX - MVAL (INT32_MAX), -#endif -#ifdef INT64_MAX - MVAL (INT64_MAX), -#endif -#ifdef UINT8_MAX - MVAL (UINT8_MAX), -#endif -#ifdef UINT16_MAX - MVAL (UINT16_MAX), -#endif -#ifdef UINT32_MAX - MVAL (UINT32_MAX), -#endif -#ifdef UINT64_MAX - MVAL (UINT64_MAX), -#endif - NULL - }; + /* The version of regex.c in older versions of gnulib + ignored RE_ICASE. Detect that problem too. */ + re_set_syntax (RE_SYNTAX_EMACS | RE_ICASE); + memset (®ex, 0, sizeof regex); + s = re_compile_pattern ("x", 1, ®ex); + if (s) + result |= 16; + else if (re_search (®ex, "WXY", 3, 0, 3, ®s) < 0) + result |= 16; -int -main () -{ + /* Catch a bug reported by Vin Shelton in + http://lists.gnu.org/archive/html/bug-coreutils/2007-06/msg00089.html + */ + re_set_syntax (RE_SYNTAX_POSIX_BASIC + & ~RE_CONTEXT_INVALID_DUP + & ~RE_NO_EMPTY_RANGES); + memset (®ex, 0, sizeof regex); + s = re_compile_pattern ("[[:alnum:]_-]\\\\+$", 16, ®ex); + if (s) + result |= 32; - const char **mv; - for (mv = macro_values; *mv != NULL; mv++) - { - const char *value = *mv; - /* Test whether it looks like a cast expression. */ - if (strncmp (value, "((unsigned int)"/*)*/, 15) == 0 - || strncmp (value, "((unsigned short)"/*)*/, 17) == 0 - || strncmp (value, "((unsigned char)"/*)*/, 16) == 0 - || strncmp (value, "((int)"/*)*/, 6) == 0 - || strncmp (value, "((signed short)"/*)*/, 15) == 0 - || strncmp (value, "((signed char)"/*)*/, 14) == 0) - return mv - macro_values + 1; - } - return 0; + /* REG_STARTEND was added to glibc on 2004-01-15. + Reject older versions. */ + if (! REG_STARTEND) + result |= 64; + +#if 0 + /* It would be nice to reject hosts whose regoff_t values are too + narrow (including glibc on hosts with 64-bit ptrdiff_t and + 32-bit int), but we should wait until glibc implements this + feature. Otherwise, support for equivalence classes and + multibyte collation symbols would always be broken except + when compiling --without-included-regex. */ + if (sizeof (regoff_t) < sizeof (ptrdiff_t) + || sizeof (regoff_t) < sizeof (ssize_t)) + result |= 64; +#endif + + return result; ; return 0; } _ACEOF if ac_fn_c_try_run "$LINENO"; then : - gl_cv_header_working_stdint_h=yes + gl_cv_func_re_compile_pattern_working=yes +else + gl_cv_func_re_compile_pattern_working=no fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ conftest.$ac_objext conftest.beam conftest.$ac_ext fi - fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_re_compile_pattern_working" >&5 +$as_echo "$gl_cv_func_re_compile_pattern_working" >&6; } + case $gl_cv_func_re_compile_pattern_working in #( + yes) ac_use_included_regex=no;; #( + no) ac_use_included_regex=yes;; + esac + ;; + *) as_fn_error $? "Invalid value for --with-included-regex: $with_included_regex" "$LINENO" 5 + ;; + esac -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_header_working_stdint_h" >&5 -$as_echo "$gl_cv_header_working_stdint_h" >&6; } - fi - if test "$gl_cv_header_working_stdint_h" = yes; then - STDINT_H= - else - for ac_header in sys/inttypes.h sys/bitypes.h -do : - as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` -ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default" -eval as_val=\$$as_ac_Header - if test "x$as_val" = x""yes; then : - cat >>confdefs.h <<_ACEOF -#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 -_ACEOF + if test $ac_use_included_regex = yes; then -fi +$as_echo "#define _REGEX_INCLUDE_LIMITS_H 1" >>confdefs.h -done - if test $ac_cv_header_sys_inttypes_h = yes; then - HAVE_SYS_INTTYPES_H=1 - else - HAVE_SYS_INTTYPES_H=0 - fi +$as_echo "#define _REGEX_LARGE_OFFSETS 1" >>confdefs.h + + +$as_echo "#define re_syntax_options rpl_re_syntax_options" >>confdefs.h + + +$as_echo "#define re_set_syntax rpl_re_set_syntax" >>confdefs.h + + +$as_echo "#define re_compile_pattern rpl_re_compile_pattern" >>confdefs.h + + +$as_echo "#define re_compile_fastmap rpl_re_compile_fastmap" >>confdefs.h + + +$as_echo "#define re_search rpl_re_search" >>confdefs.h + + +$as_echo "#define re_search_2 rpl_re_search_2" >>confdefs.h + + +$as_echo "#define re_match rpl_re_match" >>confdefs.h - if test $ac_cv_header_sys_bitypes_h = yes; then - HAVE_SYS_BITYPES_H=1 - else - HAVE_SYS_BITYPES_H=0 - fi +$as_echo "#define re_match_2 rpl_re_match_2" >>confdefs.h +$as_echo "#define re_set_registers rpl_re_set_registers" >>confdefs.h +$as_echo "#define re_comp rpl_re_comp" >>confdefs.h - if test $APPLE_UNIVERSAL_BUILD = 0; then +$as_echo "#define re_exec rpl_re_exec" >>confdefs.h - for gltype in ptrdiff_t size_t ; do - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for bit size of $gltype" >&5 -$as_echo_n "checking for bit size of $gltype... " >&6; } -if { as_var=gl_cv_bitsizeof_${gltype}; eval "test \"\${$as_var+set}\" = set"; }; then : - $as_echo_n "(cached) " >&6 -else - if ac_fn_c_compute_int "$LINENO" "sizeof ($gltype) * CHAR_BIT" "result" " - /* BSD/OS 4.0.1 has a bug: , and must be - included before . */ - #include - #include - #if HAVE_WCHAR_H - # include - # include - # include - #endif -#include "; then : +$as_echo "#define regcomp rpl_regcomp" >>confdefs.h -else - result=unknown -fi - eval gl_cv_bitsizeof_${gltype}=\$result +$as_echo "#define regexec rpl_regexec" >>confdefs.h -fi -eval ac_res=\$gl_cv_bitsizeof_${gltype} - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } - eval result=\$gl_cv_bitsizeof_${gltype} - if test $result = unknown; then - result=0 - fi - GLTYPE=`echo "$gltype" | tr 'abcdefghijklmnopqrstuvwxyz ' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ_'` - cat >>confdefs.h <<_ACEOF -#define BITSIZEOF_${GLTYPE} $result -_ACEOF - eval BITSIZEOF_${GLTYPE}=\$result - done +$as_echo "#define regerror rpl_regerror" >>confdefs.h + +$as_echo "#define regfree rpl_regfree" >>confdefs.h fi +if test $ac_use_included_regex = yes; then - for gltype in sig_atomic_t wchar_t wint_t ; do - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for bit size of $gltype" >&5 -$as_echo_n "checking for bit size of $gltype... " >&6; } -if { as_var=gl_cv_bitsizeof_${gltype}; eval "test \"\${$as_var+set}\" = set"; }; then : - $as_echo_n "(cached) " >&6 -else - if ac_fn_c_compute_int "$LINENO" "sizeof ($gltype) * CHAR_BIT" "result" " - /* BSD/OS 4.0.1 has a bug: , and must be - included before . */ - #include - #include - #if HAVE_WCHAR_H - # include - # include - # include - #endif -#include "; then : -else - result=unknown -fi - eval gl_cv_bitsizeof_${gltype}=\$result -fi -eval ac_res=\$gl_cv_bitsizeof_${gltype} - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } - eval result=\$gl_cv_bitsizeof_${gltype} - if test $result = unknown; then - result=0 - fi - GLTYPE=`echo "$gltype" | tr 'abcdefghijklmnopqrstuvwxyz ' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ_'` - cat >>confdefs.h <<_ACEOF -#define BITSIZEOF_${GLTYPE} $result -_ACEOF - eval BITSIZEOF_${GLTYPE}=\$result - done + gl_LIBOBJS="$gl_LIBOBJS regex.$ac_objext" - for gltype in sig_atomic_t wchar_t wint_t ; do - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $gltype is signed" >&5 -$as_echo_n "checking whether $gltype is signed... " >&6; } -if { as_var=gl_cv_type_${gltype}_signed; eval "test \"\${$as_var+set}\" = set"; }; then : - $as_echo_n "(cached) " >&6 -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - /* BSD/OS 4.0.1 has a bug: , and must be - included before . */ - #include - #include - #if HAVE_WCHAR_H - # include - # include - # include - #endif - int verify[2 * (($gltype) -1 < ($gltype) 0) - 1]; -int -main () -{ - ; - return 0; -} + + for ac_header in libintl.h +do : + ac_fn_c_check_header_mongrel "$LINENO" "libintl.h" "ac_cv_header_libintl_h" "$ac_includes_default" +if test "x$ac_cv_header_libintl_h" = xyes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_LIBINTL_H 1 _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - result=yes -else - result=no -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - eval gl_cv_type_${gltype}_signed=\$result fi -eval ac_res=\$gl_cv_type_${gltype}_signed - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } - eval result=\$gl_cv_type_${gltype}_signed - GLTYPE=`echo $gltype | tr 'abcdefghijklmnopqrstuvwxyz ' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ_'` - if test "$result" = yes; then - cat >>confdefs.h <<_ACEOF -#define HAVE_SIGNED_${GLTYPE} 1 -_ACEOF - eval HAVE_SIGNED_${GLTYPE}=1 - else - eval HAVE_SIGNED_${GLTYPE}=0 - fi - done +done - gl_cv_type_ptrdiff_t_signed=yes - gl_cv_type_size_t_signed=no - if test $APPLE_UNIVERSAL_BUILD = 0; then + ac_fn_c_check_decl "$LINENO" "isblank" "ac_cv_have_decl_isblank" "#include +" +if test "x$ac_cv_have_decl_isblank" = xyes; then : + ac_have_decl=1 +else + ac_have_decl=0 +fi +cat >>confdefs.h <<_ACEOF +#define HAVE_DECL_ISBLANK $ac_have_decl +_ACEOF - for gltype in ptrdiff_t size_t ; do - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $gltype integer literal suffix" >&5 -$as_echo_n "checking for $gltype integer literal suffix... " >&6; } -if { as_var=gl_cv_type_${gltype}_suffix; eval "test \"\${$as_var+set}\" = set"; }; then : + +fi + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ssize_t" >&5 +$as_echo_n "checking for ssize_t... " >&6; } +if ${gt_cv_ssize_t+:} false; then : $as_echo_n "(cached) " >&6 else - eval gl_cv_type_${gltype}_suffix=no - eval result=\$gl_cv_type_${gltype}_signed - if test "$result" = yes; then - glsufu= - else - glsufu=u - fi - for glsuf in "$glsufu" ${glsufu}l ${glsufu}ll ${glsufu}i64; do - case $glsuf in - '') gltype1='int';; - l) gltype1='long int';; - ll) gltype1='long long int';; - i64) gltype1='__int64';; - u) gltype1='unsigned int';; - ul) gltype1='unsigned long int';; - ull) gltype1='unsigned long long int';; - ui64)gltype1='unsigned __int64';; - esac - cat confdefs.h - <<_ACEOF >conftest.$ac_ext + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ - - /* BSD/OS 4.0.1 has a bug: , and must be - included before . */ - #include - #include - #if HAVE_WCHAR_H - # include - # include - # include - #endif - - extern $gltype foo; - extern $gltype1 foo; +#include int main () { - +int x = sizeof (ssize_t *) + sizeof (ssize_t); + return !x; ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : - eval gl_cv_type_${gltype}_suffix=\$glsuf + gt_cv_ssize_t=yes +else + gt_cv_ssize_t=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - eval result=\$gl_cv_type_${gltype}_suffix - test "$result" != no && break - done fi -eval ac_res=\$gl_cv_type_${gltype}_suffix - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } - GLTYPE=`echo $gltype | tr 'abcdefghijklmnopqrstuvwxyz ' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ_'` - eval result=\$gl_cv_type_${gltype}_suffix - test "$result" = no && result= - eval ${GLTYPE}_SUFFIX=\$result - cat >>confdefs.h <<_ACEOF -#define ${GLTYPE}_SUFFIX $result -_ACEOF - - done +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gt_cv_ssize_t" >&5 +$as_echo "$gt_cv_ssize_t" >&6; } + if test $gt_cv_ssize_t = no; then +$as_echo "#define ssize_t int" >>confdefs.h fi - for gltype in sig_atomic_t wchar_t wint_t ; do - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $gltype integer literal suffix" >&5 -$as_echo_n "checking for $gltype integer literal suffix... " >&6; } -if { as_var=gl_cv_type_${gltype}_suffix; eval "test \"\${$as_var+set}\" = set"; }; then : - $as_echo_n "(cached) " >&6 + + + # Define two additional variables used in the Makefile substitution. + + if test "$ac_cv_header_stdbool_h" = yes; then + STDBOOL_H='' + else + STDBOOL_H='stdbool.h' + fi + + if test -n "$STDBOOL_H"; then + GL_GENERATE_STDBOOL_H_TRUE= + GL_GENERATE_STDBOOL_H_FALSE='#' else - eval gl_cv_type_${gltype}_suffix=no - eval result=\$gl_cv_type_${gltype}_signed - if test "$result" = yes; then - glsufu= - else - glsufu=u - fi - for glsuf in "$glsufu" ${glsufu}l ${glsufu}ll ${glsufu}i64; do - case $glsuf in - '') gltype1='int';; - l) gltype1='long int';; - ll) gltype1='long long int';; - i64) gltype1='__int64';; - u) gltype1='unsigned int';; - ul) gltype1='unsigned long int';; - ull) gltype1='unsigned long long int';; - ui64)gltype1='unsigned __int64';; - esac - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ + GL_GENERATE_STDBOOL_H_TRUE='#' + GL_GENERATE_STDBOOL_H_FALSE= +fi + + + if test "$ac_cv_type__Bool" = yes; then + HAVE__BOOL=1 + else + HAVE__BOOL=0 + fi - /* BSD/OS 4.0.1 has a bug: , and must be - included before . */ - #include - #include - #if HAVE_WCHAR_H - # include - # include - # include - #endif - extern $gltype foo; - extern $gltype1 foo; + + + + STDDEF_H= + if test $gt_cv_c_wchar_t = no; then + HAVE_WCHAR_T=0 + STDDEF_H=stddef.h + fi + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether NULL can be used in arbitrary expressions" >&5 +$as_echo_n "checking whether NULL can be used in arbitrary expressions... " >&6; } +if ${gl_cv_decl_null_works+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include + int test[2 * (sizeof NULL == sizeof (void *)) -1]; + int main () { @@ -21309,33 +23574,98 @@ } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : - eval gl_cv_type_${gltype}_suffix=\$glsuf + gl_cv_decl_null_works=yes +else + gl_cv_decl_null_works=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - eval result=\$gl_cv_type_${gltype}_suffix - test "$result" != no && break - done fi -eval ac_res=\$gl_cv_type_${gltype}_suffix - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } - GLTYPE=`echo $gltype | tr 'abcdefghijklmnopqrstuvwxyz ' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ_'` - eval result=\$gl_cv_type_${gltype}_suffix - test "$result" = no && result= - eval ${GLTYPE}_SUFFIX=\$result - cat >>confdefs.h <<_ACEOF -#define ${GLTYPE}_SUFFIX $result +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_decl_null_works" >&5 +$as_echo "$gl_cv_decl_null_works" >&6; } + if test $gl_cv_decl_null_works = no; then + REPLACE_NULL=1 + STDDEF_H=stddef.h + fi + + if test -n "$STDDEF_H"; then + GL_GENERATE_STDDEF_H_TRUE= + GL_GENERATE_STDDEF_H_FALSE='#' +else + GL_GENERATE_STDDEF_H_TRUE='#' + GL_GENERATE_STDDEF_H_FALSE= +fi + + if test -n "$STDDEF_H"; then + + + + + + + + + if test $gl_cv_have_include_next = yes; then + gl_cv_next_stddef_h='<'stddef.h'>' + else + { $as_echo "$as_me:${as_lineno-$LINENO}: checking absolute name of " >&5 +$as_echo_n "checking absolute name of ... " >&6; } +if ${gl_cv_next_stddef_h+:} false; then : + $as_echo_n "(cached) " >&6 +else + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include + _ACEOF + case "$host_os" in + aix*) gl_absname_cpp="$ac_cpp -C" ;; + *) gl_absname_cpp="$ac_cpp" ;; + esac + + case "$host_os" in + mingw*) + gl_dirsep_regex='[/\\]' + ;; + *) + gl_dirsep_regex='\/' + ;; + esac + gl_make_literal_regex_sed='s,[]$^\\.*/[],\\&,g' + + gl_header_literal_regex=`echo 'stddef.h' \ + | sed -e "$gl_make_literal_regex_sed"` + gl_absolute_header_sed="/${gl_dirsep_regex}${gl_header_literal_regex}/"'{ + s/.*"\(.*'"${gl_dirsep_regex}${gl_header_literal_regex}"'\)".*/\1/ + s|^/[^/]|//&| + p + q + }' + gl_cv_next_stddef_h='"'`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 | + sed -n "$gl_absolute_header_sed"`'"' + + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_stddef_h" >&5 +$as_echo "$gl_cv_next_stddef_h" >&6; } + fi + NEXT_STDDEF_H=$gl_cv_next_stddef_h + + if test $gl_cv_have_include_next = yes || test $gl_cv_have_include_next = buggy; then + # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include_next' + gl_next_as_first_directive='<'stddef.h'>' + else + # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include' + gl_next_as_first_directive=$gl_cv_next_stddef_h + fi + NEXT_AS_FIRST_DIRECTIVE_STDDEF_H=$gl_next_as_first_directive - done - STDINT_H=stdint.h fi - # Code from module stdlib: @@ -21351,7 +23681,7 @@ else { $as_echo "$as_me:${as_lineno-$LINENO}: checking absolute name of " >&5 $as_echo_n "checking absolute name of ... " >&6; } -if test "${gl_cv_next_stdlib_h+set}" = set; then : +if ${gl_cv_next_stdlib_h+:} false; then : $as_echo_n "(cached) " >&6 else @@ -21364,13 +23694,27 @@ aix*) gl_absname_cpp="$ac_cpp -C" ;; *) gl_absname_cpp="$ac_cpp" ;; esac + + case "$host_os" in + mingw*) + gl_dirsep_regex='[/\\]' + ;; + *) + gl_dirsep_regex='\/' + ;; + esac + gl_make_literal_regex_sed='s,[]$^\\.*/[],\\&,g' + + gl_header_literal_regex=`echo 'stdlib.h' \ + | sed -e "$gl_make_literal_regex_sed"` + gl_absolute_header_sed="/${gl_dirsep_regex}${gl_header_literal_regex}/"'{ + s/.*"\(.*'"${gl_dirsep_regex}${gl_header_literal_regex}"'\)".*/\1/ + s|^/[^/]|//&| + p + q + }' gl_cv_next_stdlib_h='"'`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 | - sed -n '\#/stdlib.h#{ - s#.*"\(.*/stdlib.h\)".*#\1# - s#^/[^/]#//&# - p - q - }'`'"' + sed -n "$gl_absolute_header_sed"`'"' fi @@ -21391,49 +23735,13 @@ - for ac_header in random.h -do : - ac_fn_c_check_header_compile "$LINENO" "random.h" "ac_cv_header_random_h" "$ac_includes_default -" -if test "x$ac_cv_header_random_h" = x""yes; then : - cat >>confdefs.h <<_ACEOF -#define HAVE_RANDOM_H 1 -_ACEOF - -fi - -done - - if test $ac_cv_header_random_h = yes; then - HAVE_RANDOM_H=1 - else - HAVE_RANDOM_H=0 - fi - - ac_fn_c_check_type "$LINENO" "struct random_data" "ac_cv_type_struct_random_data" "#include - #if HAVE_RANDOM_H - # include - #endif - -" -if test "x$ac_cv_type_struct_random_data" = x""yes; then : - -cat >>confdefs.h <<_ACEOF -#define HAVE_STRUCT_RANDOM_DATA 1 -_ACEOF - - -else - HAVE_STRUCT_RANDOM_DATA=0 -fi - - for gl_func in _Exit atoll canonicalize_file_name getloadavg getsubopt grantpt mkdtemp mkostemp mkostemps mkstemp mkstemps ptsname random_r initstat_r srandom_r setstate_r realpath rpmatch setenv strtod strtoll strtoull unlockpt unsetenv; do + for gl_func in _Exit atoll canonicalize_file_name getloadavg getsubopt grantpt initstate initstate_r mkdtemp mkostemp mkostemps mkstemp mkstemps posix_openpt ptsname ptsname_r random random_r realpath rpmatch setenv setstate setstate_r srandom srandom_r strtod strtoll strtoull unlockpt unsetenv; do as_gl_Symbol=`$as_echo "gl_cv_have_raw_decl_$gl_func" | $as_tr_sh` { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $gl_func is declared without a macro" >&5 $as_echo_n "checking whether $gl_func is declared without a macro... " >&6; } -if { as_var=$as_gl_Symbol; eval "test \"\${$as_var+set}\" = set"; }; then : +if eval \${$as_gl_Symbol+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -21465,8 +23773,7 @@ eval ac_res=\$$as_gl_Symbol { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } - eval as_val=\$$as_gl_Symbol - if test "x$as_val" = x""yes; then : + if eval test \"x\$"$as_gl_Symbol"\" = x"yes"; then : cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_RAW_DECL_$gl_func" | $as_tr_cpp` 1 _ACEOF @@ -21476,8 +23783,168 @@ done - # Code from module streq: - # Code from module unistd: + + + + for ac_func in strcasecmp +do : + ac_fn_c_check_func "$LINENO" "strcasecmp" "ac_cv_func_strcasecmp" +if test "x$ac_cv_func_strcasecmp" = xyes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_STRCASECMP 1 +_ACEOF + +fi +done + + if test $ac_cv_func_strcasecmp = no; then + HAVE_STRCASECMP=0 + fi + + + + for ac_func in strncasecmp +do : + ac_fn_c_check_func "$LINENO" "strncasecmp" "ac_cv_func_strncasecmp" +if test "x$ac_cv_func_strncasecmp" = xyes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_STRNCASECMP 1 +_ACEOF + +fi +done + + if test $ac_cv_func_strncasecmp = yes; then + HAVE_STRNCASECMP=1 + else + HAVE_STRNCASECMP=0 + fi + ac_fn_c_check_decl "$LINENO" "strncasecmp" "ac_cv_have_decl_strncasecmp" "$ac_includes_default" +if test "x$ac_cv_have_decl_strncasecmp" = xyes; then : + ac_have_decl=1 +else + ac_have_decl=0 +fi + +cat >>confdefs.h <<_ACEOF +#define HAVE_DECL_STRNCASECMP $ac_have_decl +_ACEOF + + if test $ac_cv_have_decl_strncasecmp = no; then + HAVE_DECL_STRNCASECMP=0 + fi + + +if test $HAVE_STRCASECMP = 0; then + + + + + + + + + gl_LIBOBJS="$gl_LIBOBJS strcasecmp.$ac_objext" + + + : + +fi +if test $HAVE_STRNCASECMP = 0; then + + + + + + + + + gl_LIBOBJS="$gl_LIBOBJS strncasecmp.$ac_objext" + + + : + +fi + + + + + + + + + + + + + + if test $gl_cv_have_include_next = yes; then + gl_cv_next_sys_types_h='<'sys/types.h'>' + else + { $as_echo "$as_me:${as_lineno-$LINENO}: checking absolute name of " >&5 +$as_echo_n "checking absolute name of ... " >&6; } +if ${gl_cv_next_sys_types_h+:} false; then : + $as_echo_n "(cached) " >&6 +else + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include + +_ACEOF + case "$host_os" in + aix*) gl_absname_cpp="$ac_cpp -C" ;; + *) gl_absname_cpp="$ac_cpp" ;; + esac + + case "$host_os" in + mingw*) + gl_dirsep_regex='[/\\]' + ;; + *) + gl_dirsep_regex='\/' + ;; + esac + gl_make_literal_regex_sed='s,[]$^\\.*/[],\\&,g' + + gl_header_literal_regex=`echo 'sys/types.h' \ + | sed -e "$gl_make_literal_regex_sed"` + gl_absolute_header_sed="/${gl_dirsep_regex}${gl_header_literal_regex}/"'{ + s/.*"\(.*'"${gl_dirsep_regex}${gl_header_literal_regex}"'\)".*/\1/ + s|^/[^/]|//&| + p + q + }' + gl_cv_next_sys_types_h='"'`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 | + sed -n "$gl_absolute_header_sed"`'"' + + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_sys_types_h" >&5 +$as_echo "$gl_cv_next_sys_types_h" >&6; } + fi + NEXT_SYS_TYPES_H=$gl_cv_next_sys_types_h + + if test $gl_cv_have_include_next = yes || test $gl_cv_have_include_next = buggy; then + # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include_next' + gl_next_as_first_directive='<'sys/types.h'>' + else + # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include' + gl_next_as_first_directive=$gl_cv_next_sys_types_h + fi + NEXT_AS_FIRST_DIRECTIVE_SYS_TYPES_H=$gl_next_as_first_directive + + + + + + + + + + + + @@ -21496,7 +23963,7 @@ else { $as_echo "$as_me:${as_lineno-$LINENO}: checking absolute name of " >&5 $as_echo_n "checking absolute name of ... " >&6; } -if test "${gl_cv_next_unistd_h+set}" = set; then : +if ${gl_cv_next_unistd_h+:} false; then : $as_echo_n "(cached) " >&6 else @@ -21512,13 +23979,27 @@ aix*) gl_absname_cpp="$ac_cpp -C" ;; *) gl_absname_cpp="$ac_cpp" ;; esac + + case "$host_os" in + mingw*) + gl_dirsep_regex='[/\\]' + ;; + *) + gl_dirsep_regex='\/' + ;; + esac + gl_make_literal_regex_sed='s,[]$^\\.*/[],\\&,g' + + gl_header_literal_regex=`echo 'unistd.h' \ + | sed -e "$gl_make_literal_regex_sed"` + gl_absolute_header_sed="/${gl_dirsep_regex}${gl_header_literal_regex}/"'{ + s/.*"\(.*'"${gl_dirsep_regex}${gl_header_literal_regex}"'\)".*/\1/ + s|^/[^/]|//&| + p + q + }' gl_cv_next_unistd_h='"'`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 | - sed -n '\#/unistd.h#{ - s#.*"\(.*/unistd.h\)".*#\1# - s#^/[^/]#//&# - p - q - }'`'"' + sed -n "$gl_absolute_header_sed"`'"' else gl_cv_next_unistd_h='<'unistd.h'>' fi @@ -21550,16 +24031,23 @@ - for gl_func in chown dup2 dup3 environ euidaccess faccessat fchdir fchownat fsync ftruncate getcwd getdomainname getdtablesize getgroups gethostname getlogin getlogin_r getpagesize getusershell setusershell endusershell lchown link linkat lseek pipe pipe2 pread pwrite readlink readlinkat rmdir sleep symlink symlinkat ttyname_r unlink unlinkat usleep; do + + + + + for gl_func in chdir chown dup dup2 dup3 environ euidaccess faccessat fchdir fchownat fdatasync fsync ftruncate getcwd getdomainname getdtablesize getgroups gethostname getlogin getlogin_r getpagesize getusershell setusershell endusershell group_member isatty lchown link linkat lseek pipe pipe2 pread pwrite readlink readlinkat rmdir sethostname sleep symlink symlinkat ttyname_r unlink unlinkat usleep; do as_gl_Symbol=`$as_echo "gl_cv_have_raw_decl_$gl_func" | $as_tr_sh` { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $gl_func is declared without a macro" >&5 $as_echo_n "checking whether $gl_func is declared without a macro... " >&6; } -if { as_var=$as_gl_Symbol; eval "test \"\${$as_var+set}\" = set"; }; then : +if eval \${$as_gl_Symbol+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ -#include + +#if HAVE_UNISTD_H +# include +#endif /* Some systems declare various items in the wrong headers. */ #if !(defined __GLIBC__ && !defined __UCLIBC__) # include @@ -21589,8 +24077,7 @@ eval ac_res=\$$as_gl_Symbol { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } - eval as_val=\$$as_gl_Symbol - if test "x$as_val" = x""yes; then : + if eval test \"x\$"$as_gl_Symbol"\" = x"yes"; then : cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_RAW_DECL_$gl_func" | $as_tr_cpp` 1 _ACEOF @@ -21600,9 +24087,6 @@ done - # Code from module verify: - # Code from module warn-on-use: - # Code from module wchar: @@ -21620,7 +24104,7 @@ else { $as_echo "$as_me:${as_lineno-$LINENO}: checking absolute name of " >&5 $as_echo_n "checking absolute name of ... " >&6; } -if test "${gl_cv_next_wchar_h+set}" = set; then : +if ${gl_cv_next_wchar_h+:} false; then : $as_echo_n "(cached) " >&6 else @@ -21636,13 +24120,27 @@ aix*) gl_absname_cpp="$ac_cpp -C" ;; *) gl_absname_cpp="$ac_cpp" ;; esac + + case "$host_os" in + mingw*) + gl_dirsep_regex='[/\\]' + ;; + *) + gl_dirsep_regex='\/' + ;; + esac + gl_make_literal_regex_sed='s,[]$^\\.*/[],\\&,g' + + gl_header_literal_regex=`echo 'wchar.h' \ + | sed -e "$gl_make_literal_regex_sed"` + gl_absolute_header_sed="/${gl_dirsep_regex}${gl_header_literal_regex}/"'{ + s/.*"\(.*'"${gl_dirsep_regex}${gl_header_literal_regex}"'\)".*/\1/ + s|^/[^/]|//&| + p + q + }' gl_cv_next_wchar_h='"'`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 | - sed -n '\#/wchar.h#{ - s#.*"\(.*/wchar.h\)".*#\1# - s#^/[^/]#//&# - p - q - }'`'"' + sed -n "$gl_absolute_header_sed"`'"' else gl_cv_next_wchar_h='<'wchar.h'>' fi @@ -21684,11 +24182,11 @@ - for gl_func in btowc wctob mbsinit mbrtowc mbrlen mbsrtowcs mbsnrtowcs wcrtomb wcsrtombs wcsnrtombs wcwidth; do + for gl_func in btowc wctob mbsinit mbrtowc mbrlen mbsrtowcs mbsnrtowcs wcrtomb wcsrtombs wcsnrtombs wcwidth wmemchr wmemcmp wmemcpy wmemmove wmemset wcslen wcsnlen wcscpy wcpcpy wcsncpy wcpncpy wcscat wcsncat wcscmp wcsncmp wcscasecmp wcsncasecmp wcscoll wcsxfrm wcsdup wcschr wcsrchr wcscspn wcsspn wcspbrk wcsstr wcstok wcswidth ; do as_gl_Symbol=`$as_echo "gl_cv_have_raw_decl_$gl_func" | $as_tr_sh` { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $gl_func is declared without a macro" >&5 $as_echo_n "checking whether $gl_func is declared without a macro... " >&6; } -if { as_var=$as_gl_Symbol; eval "test \"\${$as_var+set}\" = set"; }; then : +if eval \${$as_gl_Symbol+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -21724,8 +24222,7 @@ eval ac_res=\$$as_gl_Symbol { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } - eval as_val=\$$as_gl_Symbol - if test "x$as_val" = x""yes; then : + if eval test \"x\$"$as_gl_Symbol"\" = x"yes"; then : cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_RAW_DECL_$gl_func" | $as_tr_cpp` 1 _ACEOF @@ -21735,7 +24232,6 @@ done - # Code from module wcrtomb: @@ -21752,7 +24248,7 @@ { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether mbrtowc handles incomplete characters" >&5 $as_echo_n "checking whether mbrtowc handles incomplete characters... " >&6; } -if test "${gl_cv_func_mbrtowc_incomplete_state+set}" = set; then : +if ${gl_cv_func_mbrtowc_incomplete_state+:} false; then : $as_echo_n "(cached) " >&6 else @@ -21815,7 +24311,7 @@ { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether mbrtowc works as well as mbtowc" >&5 $as_echo_n "checking whether mbrtowc works as well as mbtowc... " >&6; } -if test "${gl_cv_func_mbrtowc_sanitycheck+set}" = set; then : +if ${gl_cv_func_mbrtowc_sanitycheck+:} false; then : $as_echo_n "(cached) " >&6 else @@ -21889,16 +24385,35 @@ else REPLACE_MBSTATE_T=1 fi - if test $REPLACE_MBSTATE_T = 1; then - - : - - fi if test $ac_cv_func_wcrtomb = no; then HAVE_WCRTOMB=0 + ac_fn_c_check_decl "$LINENO" "wcrtomb" "ac_cv_have_decl_wcrtomb" " +/* Tru64 with Desktop Toolkit C has a bug: must be included before + . + BSD/OS 4.0.1 has a bug: , and must be + included before . */ +#include +#include +#include +#include + +" +if test "x$ac_cv_have_decl_wcrtomb" = xyes; then : + ac_have_decl=1 +else + ac_have_decl=0 +fi + +cat >>confdefs.h <<_ACEOF +#define HAVE_DECL_WCRTOMB $ac_have_decl +_ACEOF + + if test $ac_cv_have_decl_wcrtomb = yes; then + REPLACE_WCRTOMB=1 + fi else if test $REPLACE_MBSTATE_T = 1; then REPLACE_WCRTOMB=1 @@ -21910,7 +24425,7 @@ { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether wcrtomb return value is correct" >&5 $as_echo_n "checking whether wcrtomb return value is correct... " >&6; } -if test "${gl_cv_func_wcrtomb_retval+set}" = set; then : +if ${gl_cv_func_wcrtomb_retval+:} false; then : $as_echo_n "(cached) " >&6 else @@ -21983,10 +24498,8 @@ esac fi fi - if test $HAVE_WCRTOMB = 0 || test $REPLACE_WCRTOMB = 1; then - - : +if test $HAVE_WCRTOMB = 0 || test $REPLACE_WCRTOMB = 1; then @@ -22000,12 +24513,15 @@ : - fi +fi + + + + GNULIB_WCRTOMB=1 - GNULIB_WCRTOMB=1 @@ -22013,7 +24529,7 @@ - # Code from module wctype: + @@ -22026,21 +24542,6 @@ - if test $ac_cv_func_iswblank = yes; then - HAVE_ISWBLANK=1 - REPLACE_ISWBLANK=0 - else - HAVE_ISWBLANK=0 - if test $ac_cv_have_decl_iswblank = yes; then - REPLACE_ISWBLANK=1 - else - REPLACE_ISWBLANK=0 - fi - fi - - - - if test $gt_cv_c_wint_t = yes; then @@ -22064,7 +24565,7 @@ else { $as_echo "$as_me:${as_lineno-$LINENO}: checking absolute name of " >&5 $as_echo_n "checking absolute name of ... " >&6; } -if test "${gl_cv_next_wctype_h+set}" = set; then : +if ${gl_cv_next_wctype_h+:} false; then : $as_echo_n "(cached) " >&6 else @@ -22080,13 +24581,27 @@ aix*) gl_absname_cpp="$ac_cpp -C" ;; *) gl_absname_cpp="$ac_cpp" ;; esac + + case "$host_os" in + mingw*) + gl_dirsep_regex='[/\\]' + ;; + *) + gl_dirsep_regex='\/' + ;; + esac + gl_make_literal_regex_sed='s,[]$^\\.*/[],\\&,g' + + gl_header_literal_regex=`echo 'wctype.h' \ + | sed -e "$gl_make_literal_regex_sed"` + gl_absolute_header_sed="/${gl_dirsep_regex}${gl_header_literal_regex}/"'{ + s/.*"\(.*'"${gl_dirsep_regex}${gl_header_literal_regex}"'\)".*/\1/ + s|^/[^/]|//&| + p + q + }' gl_cv_next_wctype_h='"'`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 | - sed -n '\#/wctype.h#{ - s#.*"\(.*/wctype.h\)".*#\1# - s#^/[^/]#//&# - p - q - }'`'"' + sed -n "$gl_absolute_header_sed"`'"' else gl_cv_next_wctype_h='<'wctype.h'>' fi @@ -22114,7 +24629,7 @@ if test $ac_cv_func_iswcntrl = yes; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether iswcntrl works" >&5 $as_echo_n "checking whether iswcntrl works... " >&6; } -if test "${gl_cv_func_iswcntrl_works+set}" = set; then : +if ${gl_cv_func_iswcntrl_works+:} false; then : $as_echo_n "(cached) " >&6 else @@ -22134,9 +24649,9 @@ } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : - gl_cv_func_iswcntrl_works=yes + gl_cv_func_iswcntrl_works="guessing yes" else - gl_cv_func_iswcntrl_works=no + gl_cv_func_iswcntrl_works="guessing no" fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext @@ -22176,30 +24691,203 @@ fi - if test "$gl_cv_func_iswcntrl_works" = no; then - REPLACE_ISWCNTRL=1 - else - REPLACE_ISWCNTRL=0 - fi + case "$gl_cv_func_iswcntrl_works" in + *yes) REPLACE_ISWCNTRL=0 ;; + *) REPLACE_ISWCNTRL=1 ;; + esac if test $HAVE_ISWCNTRL = 0 || test $REPLACE_ISWCNTRL = 1; then : + fi + + if test $REPLACE_ISWCNTRL = 1; then + REPLACE_TOWLOWER=1 else - if test $HAVE_ISWBLANK = 0 || test $REPLACE_ISWBLANK = 1; then + for ac_func in towlower +do : + ac_fn_c_check_func "$LINENO" "towlower" "ac_cv_func_towlower" +if test "x$ac_cv_func_towlower" = xyes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_TOWLOWER 1 +_ACEOF + +fi +done + + if test $ac_cv_func_towlower = yes; then + REPLACE_TOWLOWER=0 + else + ac_fn_c_check_decl "$LINENO" "towlower" "ac_cv_have_decl_towlower" "/* Tru64 with Desktop Toolkit C has a bug: must be + included before . + BSD/OS 4.0.1 has a bug: , and + must be included before . */ + #include + #include + #include + #include + #if HAVE_WCTYPE_H + # include + #endif + +" +if test "x$ac_cv_have_decl_towlower" = xyes; then : + ac_have_decl=1 +else + ac_have_decl=0 +fi +cat >>confdefs.h <<_ACEOF +#define HAVE_DECL_TOWLOWER $ac_have_decl +_ACEOF + + if test $ac_cv_have_decl_towlower = yes; then + REPLACE_TOWLOWER=1 + else + REPLACE_TOWLOWER=0 + fi + fi + fi + if test $HAVE_ISWCNTRL = 0 || test $REPLACE_TOWLOWER = 1; then + : + fi + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for wctype_t" >&5 +$as_echo_n "checking for wctype_t... " >&6; } +if ${gl_cv_type_wctype_t+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +/* Tru64 with Desktop Toolkit C has a bug: must be + included before . + BSD/OS 4.0.1 has a bug: , and + must be included before . */ + #include + #include + #include + #include + #if HAVE_WCTYPE_H + # include + #endif + wctype_t a; +int +main () +{ + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + gl_cv_type_wctype_t=yes +else + gl_cv_type_wctype_t=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_type_wctype_t" >&5 +$as_echo "$gl_cv_type_wctype_t" >&6; } + if test $gl_cv_type_wctype_t = no; then + HAVE_WCTYPE_T=0 + fi - gl_LIBOBJS="$gl_LIBOBJS iswblank.$ac_objext" + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for wctrans_t" >&5 +$as_echo_n "checking for wctrans_t... " >&6; } +if ${gl_cv_type_wctrans_t+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +/* Tru64 with Desktop Toolkit C has a bug: must be + included before . + BSD/OS 4.0.1 has a bug: , and + must be included before . */ + #include + #include + #include + #include + #include + wctrans_t a; - fi +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + gl_cv_type_wctrans_t=yes +else + gl_cv_type_wctrans_t=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_type_wctrans_t" >&5 +$as_echo "$gl_cv_type_wctrans_t" >&6; } + if test $gl_cv_type_wctrans_t = no; then + HAVE_WCTRANS_T=0 fi + + for gl_func in wctype iswctype wctrans towctrans ; do + as_gl_Symbol=`$as_echo "gl_cv_have_raw_decl_$gl_func" | $as_tr_sh` + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $gl_func is declared without a macro" >&5 +$as_echo_n "checking whether $gl_func is declared without a macro... " >&6; } +if eval \${$as_gl_Symbol+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Tru64 with Desktop Toolkit C has a bug: must be included before + . + BSD/OS 4.0.1 has a bug: , and must be + included before . */ +#if !(defined __GLIBC__ && !defined __UCLIBC__) +# include +# include +# include +# include +#endif +#include + +int +main () +{ +#undef $gl_func + (void) $gl_func; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + eval "$as_gl_Symbol=yes" +else + eval "$as_gl_Symbol=no" +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +eval ac_res=\$$as_gl_Symbol + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } + if eval test \"x\$"$as_gl_Symbol"\" = x"yes"; then : + cat >>confdefs.h <<_ACEOF +#define `$as_echo "HAVE_RAW_DECL_$gl_func" | $as_tr_cpp` 1 +_ACEOF + + eval ac_cv_have_decl_$gl_func=yes +fi + done + + # End of code from modules @@ -22237,10 +24925,39 @@ +# Check whether --with-curl was given. +if test "${with_curl+set}" = set; then : + withval=$with_curl; with_curl_prefix="$withval" +else + with_curl_prefix="" +fi + + + curlprivatereq= curlprivatelibs= -libdap_pkgconfig_libcurl=yes -libdap_libcurl_module='libcurl >= 7.10.6' +curl_set= + +if test -n "$with_curl_prefix" -a -x $with_curl_prefix/bin/curl-config +then + { $as_echo "$as_me:${as_lineno-$LINENO}: Using $with_curl_prefix as the curl prefix directory." >&5 +$as_echo "$as_me: Using $with_curl_prefix as the curl prefix directory." >&6;} + CURL_LIBS="`$with_curl_prefix/bin/curl-config --libs`" + CURL_STATIC_LIBS=$CURL_LIBS + curlprivatelibs="`$with_curl_prefix/bin/curl-config --libs`" + CURL_CFLAGS="`$with_curl_prefix/bin/curl-config --cflags`" + curl_set="yes" +elif test -n "$with_curl_prefix" +then + as_fn_error $? "You set the curl-prefix directory to $with_curl_prefix, but curl-config is not there." "$LINENO" 5 +fi + +if test -z "$curl_set" +then + # curlprivatereq= + # curlprivatelibs= + libdap_pkgconfig_libcurl=yes + libdap_libcurl_module='libcurl >= 7.10.6' if test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then @@ -22249,7 +24966,7 @@ set dummy ${ac_tool_prefix}pkg-config; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_path_PKG_CONFIG+set}" = set; then : +if ${ac_cv_path_PKG_CONFIG+:} false; then : $as_echo_n "(cached) " >&6 else case $PKG_CONFIG in @@ -22263,7 +24980,7 @@ IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_path_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 @@ -22292,7 +25009,7 @@ set dummy pkg-config; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_path_ac_pt_PKG_CONFIG+set}" = set; then : +if ${ac_cv_path_ac_pt_PKG_CONFIG+:} false; then : $as_echo_n "(cached) " >&6 else case $ac_pt_PKG_CONFIG in @@ -22306,7 +25023,7 @@ IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_path_ac_pt_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 @@ -22428,59 +25145,78 @@ $as_echo "yes" >&6; } : fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for libcurl" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libcurl" >&5 $as_echo_n "checking for libcurl... " >&6; } -if test $libdap_pkgconfig_libcurl = 'yes' -then - curlprivatereq=$libdap_libcurl_module - CURL_STATIC_LIBS="`$PKG_CONFIG --static --libs libcurl`" - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes; used pkg-config" >&5 -$as_echo "yes; used pkg-config" >&6; } -elif curl-config --version > /dev/null 2>&1 -then - version_libcurl=`curl-config --version | sed 's@libcurl \(.*\)@\1@'` - version_M=`echo $version_libcurl | sed 's@^\([0-9]\)*\.\([0-9]*\)\.\([0-9]*\)$@\1@'` - version_m=`echo $version_libcurl | sed 's@^\([0-9]\)*\.\([0-9]*\)\.\([0-9]*\)$@\2@'` - version_m_m=`echo $version_libcurl | sed 's@^\([0-9]\)*\.\([0-9]*\)\.\([0-9]*\)$@\3@'` + if test $libdap_pkgconfig_libcurl = 'yes' + then + curlprivatereq=$libdap_libcurl_module + CURL_STATIC_LIBS="`$PKG_CONFIG --static --libs libcurl`" + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes; used pkg-config" >&5 +$as_echo "yes; used pkg-config" >&6; } + elif curl-config --version > /dev/null 2>&1 + then + version_libcurl=`curl-config --version | sed 's@libcurl \(.*\)@\1@'` + + as_arg_v1="$version_libcurl" +as_arg_v2="7.10.6" +awk "$as_awk_strverscmp" v1="$as_arg_v1" v2="$as_arg_v2" /dev/null +case $? in #( + 1) : + as_fn_error $? "I could not find libcurl 7.10.6 or newer, found $version_libcurl" "$LINENO" 5 ;; #( + 0) : + ;; #( + 2) : + ;; #( + *) : + ;; +esac + CURL_LIBS="`curl-config --libs`" + CURL_STATIC_LIBS=$CURL_LIBS + curlprivatelibs="`curl-config --libs`" + CURL_CFLAGS="`curl-config --cflags`" + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes; used curl-config and found version $version_libcurl" >&5 +$as_echo "yes; used curl-config and found version $version_libcurl" >&6; } + else + as_fn_error $? "I could not find libcurl" "$LINENO" 5 + fi +fi - if test $version_M -gt 7 - then - libcurl_ok='yes' - elif test $version_M -eq 7 && test $version_m -gt 10 - then - libcurl_ok='yes' - elif test $version_M -eq 7 && test $version_m -eq 10 && test $version_m_m -gt 5 - then - libcurl_ok='yes' - else - libcurl_ok='no' - fi - if test $libcurl_ok = "no" - then - as_fn_error "must have libcurl 7.10.6 or greater, found $version_libcurl" "$LINENO" 5 - fi - CURL_LIBS="`curl-config --libs`" - CURL_STATIC_LIBS=$CURL_LIBS - curlprivatelibs="`curl-config --libs`" - CURL_CFLAGS="`curl-config --cflags`" - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes; used curl-config" >&5 -$as_echo "yes; used curl-config" >&6; } -else - as_fn_error "I could not find libcurl" "$LINENO" 5 -fi +# Check whether --with-xml2 was given. +if test "${with_xml2+set}" = set; then : + withval=$with_xml2; with_xml2_prefix="$withval" +else + with_xml2_prefix="" +fi xmlprivatereq= xmlprivatelibs= +xml_set= + +if test -n "$with_xml2_prefix" -a -x $with_xml2_prefix/bin/xml2-config +then + { $as_echo "$as_me:${as_lineno-$LINENO}: Using $with_xml2_prefix as the libxml2 prefix directory." >&5 +$as_echo "$as_me: Using $with_xml2_prefix as the libxml2 prefix directory." >&6;} + XML2_LIBS="`$with_xml2_prefix/bin/xml2-config --libs`" + xmlprivatelibs="`$with_xml2_prefix/bin/xml2-config --libs`" + XML2_CFLAGS="`$with_xml2_prefix/bin/xml2-config --cflags`" + xml_set="yes" +elif test -n "$with_xml2_prefix" +then + as_fn_error $? "You set the libxml2 prefix directory to $with_xml2_prefix, but xml2-config is not there." "$LINENO" 5 +fi + +if test -z "$xml_set" +then libdap_pkgconfig_libxml2=yes libdap_libxml2_module='libxml-2.0 >= 2.6.16' @@ -22559,153 +25295,37 @@ if test $libdap_pkgconfig_libxml2 = 'yes' then xmlprivatereq=$libdap_libxml2_module - XML2_STATIC_LIBS="`$PKG_CONFIG --static --libs libxml-2.0`" + XML2_LIBS="`$PKG_CONFIG --libs libxml-2.0`" { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes; used pkg-config" >&5 $as_echo "yes; used pkg-config" >&6; } elif xml2-config --version > /dev/null 2>&1 then version_libxml2=`xml2-config --version` - version_M=`echo $version_libxml2 | sed 's@^\([0-9]\)*\.\([0-9]*\)\.\([0-9]*\)$@\1@'` - version_m=`echo $version_libxml2 | sed 's@^\([0-9]\)*\.\([0-9]*\)\.\([0-9]*\)$@\2@'` - version_m_m=`echo $version_libxml2 | sed 's@^\([0-9]\)*\.\([0-9]*\)\.\([0-9]*\)$@\3@'` - - if test $version_M -gt 2 - then - libxml2_ok='yes' - elif test $version_M -eq 2 && test $version_m -eq 6 && test $version_m_m -ge 16 - then - libxml2_ok='yes' - fi - - XML2_LIBS="`xml2-config --libs`" - XML2_STATIC_LIBS=$XML2_LIBS - XML2_CFLAGS="`xml2-config --cflags`" - xmlprivatelibs="`xml2-config --libs`" - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes; used xml2-config" >&5 -$as_echo "yes; used xml2-config" >&6; } -else - as_fn_error "I could not find libxml2 2.6.16 or newer" "$LINENO" 5 -fi - - - - - - -# -# Handle user hints -# - - -# Check whether --with-zlib was given. -if test "${with_zlib+set}" = set; then : - withval=$with_zlib; if test "$withval" != no ; then - if test -d "$withval" - then - ZLIB_HOME="$withval" - else - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Sorry, $withval does not exist, checking usual places" >&5 -$as_echo "$as_me: WARNING: Sorry, $withval does not exist, checking usual places" >&2;} - fi -else - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: zlib is required for deflate, not disabled" >&5 -$as_echo "$as_me: WARNING: zlib is required for deflate, not disabled" >&2;} -fi -fi - - -ZLIB_OLD_LDFLAGS=$LDFLAGS -ZLIB_OLD_CPPFLAGS=$CPPFLAGS - -# -# Locate zlib, if wanted -# -if test -n "${ZLIB_HOME}" -then - LDFLAGS="$LDFLAGS -L${ZLIB_HOME}/lib" - CPPFLAGS="$CPPFLAGS -I${ZLIB_HOME}/include" -fi - -ac_ext=c -ac_cpp='$CPP $CPPFLAGS' -ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_c_compiler_gnu - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for inflateEnd in -lz" >&5 -$as_echo_n "checking for inflateEnd in -lz... " >&6; } -if test "${ac_cv_lib_z_inflateEnd+set}" = set; then : - $as_echo_n "(cached) " >&6 -else - ac_check_lib_save_LIBS=$LIBS -LIBS="-lz $LIBS" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char inflateEnd (); -int -main () -{ -return inflateEnd (); - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO"; then : - ac_cv_lib_z_inflateEnd=yes -else - ac_cv_lib_z_inflateEnd=no -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_z_inflateEnd" >&5 -$as_echo "$ac_cv_lib_z_inflateEnd" >&6; } -if test "x$ac_cv_lib_z_inflateEnd" = x""yes; then : - zlib_cv_libz=yes -else - zlib_cv_libz=no -fi + as_arg_v1="$version_libxml2" +as_arg_v2="2.6.16" +awk "$as_awk_strverscmp" v1="$as_arg_v1" v2="$as_arg_v2" /dev/null +case $? in #( + 1) : + as_fn_error $? "I could not find libxml2 2.6.16 or newer" "$LINENO" 5 ;; #( + 0) : + ;; #( + 2) : + ;; #( + *) : + ;; +esac -ac_fn_c_check_header_mongrel "$LINENO" "zlib.h" "ac_cv_header_zlib_h" "$ac_includes_default" -if test "x$ac_cv_header_zlib_h" = x""yes; then : - zlib_cv_zlib_h=yes + XML2_LIBS="`xml2-config --libs`" + XML2_CFLAGS="`xml2-config --cflags`" + xmlprivatelibs="`xml2-config --libs`" + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes; used xml2-config and found version $version_libxml2" >&5 +$as_echo "yes; used xml2-config and found version $version_libxml2" >&6; } else - zlib_cv_zlib_h=no + as_fn_error $? "I could not find ml2-config" "$LINENO" 5 fi - - -ac_ext=c -ac_cpp='$CPP $CPPFLAGS' -ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_c_compiler_gnu - - -if test "$zlib_cv_libz" = "yes" -a "$zlib_cv_zlib_h" = "yes" -then - # - # If both library and header were found, use them - # - ZLIB_LIBS="-lz" -else - # - # If either header or library was not found, revert and bomb - # - as_fn_error "zlib is required for deflate, specify a valid zlib installation with --with-zlib=DIR" "$LINENO" 5 fi -LDFLAGS="$ZLIB_OLD_LDFLAGS" -CPPFLAGS="$ZLIB_OLD_CPPFLAGS" - - @@ -22713,7 +25333,7 @@ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for pthread_kill in -lpthread" >&5 $as_echo_n "checking for pthread_kill in -lpthread... " >&6; } -if test "${ac_cv_lib_pthread_pthread_kill+set}" = set; then : +if ${ac_cv_lib_pthread_pthread_kill+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS @@ -22747,17 +25367,17 @@ fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_pthread_pthread_kill" >&5 $as_echo "$ac_cv_lib_pthread_pthread_kill" >&6; } -if test "x$ac_cv_lib_pthread_pthread_kill" = x""yes; then : +if test "x$ac_cv_lib_pthread_pthread_kill" = xyes; then : PTHREAD_LIBS="-lpthread" else - as_fn_error "I could not find pthreads" "$LINENO" 5 + as_fn_error $? "I could not find pthreads" "$LINENO" 5 fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for uuid_generate in -luuid" >&5 $as_echo_n "checking for uuid_generate in -luuid... " >&6; } -if test "${ac_cv_lib_uuid_uuid_generate+set}" = set; then : +if ${ac_cv_lib_uuid_uuid_generate+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS @@ -22791,7 +25411,7 @@ fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_uuid_uuid_generate" >&5 $as_echo "$ac_cv_lib_uuid_uuid_generate" >&6; } -if test "x$ac_cv_lib_uuid_uuid_generate" = x""yes; then : +if test "x$ac_cv_lib_uuid_uuid_generate" = xyes; then : UUID_LIBS="-luuid" else UUID_LIBS="" @@ -22835,7 +25455,7 @@ set dummy cppunit-config; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_path_CPPUNIT_CONFIG+set}" = set; then : +if ${ac_cv_path_CPPUNIT_CONFIG+:} false; then : $as_echo_n "(cached) " >&6 else case $CPPUNIT_CONFIG in @@ -22849,7 +25469,7 @@ IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_path_CPPUNIT_CONFIG="$as_dir/$ac_word$ac_exec_ext" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 @@ -22955,6 +25575,31 @@ +libdap_libgridfields_module='libgridfields >= 0.7.0' + +libgf_ok="no" + + + + + + + + + + + + + + + + + + + + + + # Check whether --enable-debug was given. if test "${enable_debug+set}" = set; then : enableval=$enable_debug; DEBUG=$enableval @@ -22983,7 +25628,7 @@ ;; *) - as_fn_error "Bad debug value" "$LINENO" 5 + as_fn_error $? "Bad debug value" "$LINENO" 5 ;; esac @@ -23000,12 +25645,77 @@ fi +# Check whether --enable-dap4 was given. +if test "${enable_dap4+set}" = set; then : + enableval=$enable_dap4; +fi + + +if test "x$enable_dap4" = "xyes"; then : + + +$as_echo "#define DAP4 1" >>confdefs.h + + if true; then + DAP4_DEFINED_TRUE= + DAP4_DEFINED_FALSE='#' +else + DAP4_DEFINED_TRUE='#' + DAP4_DEFINED_FALSE= +fi + +else + if false; then + DAP4_DEFINED_TRUE= + DAP4_DEFINED_FALSE='#' +else + DAP4_DEFINED_TRUE='#' + DAP4_DEFINED_FALSE= +fi + + +fi + +# Check whether --enable-developer was given. +if test "${enable_developer+set}" = set; then : + enableval=$enable_developer; case "${enableval}" in + yes) build_developer=true ;; + no) build_developer=false ;; + *) as_fn_error $? "bad value ${enableval} for --enable-developer" "$LINENO" 5 ;; + esac +else + build_developer=false +fi + + +if test "x$build_developer" = "xtrue"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: \"Building developer version\"" >&5 +$as_echo "$as_me: \"Building developer version\"" >&6;} +else + { $as_echo "$as_me:${as_lineno-$LINENO}: \"Not building developer version\"" >&5 +$as_echo "$as_me: \"Not building developer version\"" >&6;} + +$as_echo "#define NDEBUG 1" >>confdefs.h + +fi + if test "x$build_developer" = "xtrue"; then + BUILD_DEVELOPER_TRUE= + BUILD_DEVELOPER_FALSE='#' +else + BUILD_DEVELOPER_TRUE='#' + BUILD_DEVELOPER_FALSE= +fi + + -ac_config_files="$ac_config_files Makefile libdap.pc libdapclient.pc libdapserver.pc gl/Makefile tests/Makefile tests/atlocal unit-tests/Makefile unit-tests/cache-testsuite/Makefile" + +ac_config_files="$ac_config_files Makefile libdap.pc libdapclient.pc libdapserver.pc main_page.doxygen doxy.conf gl/Makefile tests/Makefile tests/atlocal unit-tests/Makefile unit-tests/cache-testsuite/Makefile" + + ac_config_files="$ac_config_files dap-config" @@ -23074,10 +25784,21 @@ :end' >>confcache if diff "$cache_file" confcache >/dev/null 2>&1; then :; else if test -w "$cache_file"; then - test "x$cache_file" != "x/dev/null" && + if test "x$cache_file" != "x/dev/null"; then { $as_echo "$as_me:${as_lineno-$LINENO}: updating cache $cache_file" >&5 $as_echo "$as_me: updating cache $cache_file" >&6;} - cat confcache >$cache_file + if test ! -f "$cache_file" || test -h "$cache_file"; then + cat confcache >"$cache_file" + else + case $cache_file in #( + */* | ?:*) + mv -f confcache "$cache_file"$$ && + mv -f "$cache_file"$$ "$cache_file" ;; #( + *) + mv -f confcache "$cache_file" ;; + esac + fi + fi else { $as_echo "$as_me:${as_lineno-$LINENO}: not updating unwritable cache $cache_file" >&5 $as_echo "$as_me: not updating unwritable cache $cache_file" >&6;} @@ -23093,6 +25814,7 @@ ac_libobjs= ac_ltlibobjs= +U= for ac_i in : $LIBOBJS; do test "x$ac_i" = x: && continue # 1. Remove the extension, and $U if already installed. ac_script='s/\$U\././;s/\.o$//;s/\.obj$//' @@ -23107,6 +25829,14 @@ LTLIBOBJS=$ac_ltlibobjs +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking that generated files are newer than configure" >&5 +$as_echo_n "checking that generated files are newer than configure... " >&6; } + if test -n "$am_sleep_pid"; then + # Hide warnings about reused PIDs. + wait $am_sleep_pid 2>/dev/null + fi + { $as_echo "$as_me:${as_lineno-$LINENO}: result: done" >&5 +$as_echo "done" >&6; } if test -n "$EXEEXT"; then am__EXEEXT_TRUE= am__EXEEXT_FALSE='#' @@ -23116,35 +25846,56 @@ fi if test -z "${AMDEP_TRUE}" && test -z "${AMDEP_FALSE}"; then - as_fn_error "conditional \"AMDEP\" was never defined. + as_fn_error $? "conditional \"AMDEP\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${am__fastdepCXX_TRUE}" && test -z "${am__fastdepCXX_FALSE}"; then - as_fn_error "conditional \"am__fastdepCXX\" was never defined. + as_fn_error $? "conditional \"am__fastdepCXX\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${am__fastdepCC_TRUE}" && test -z "${am__fastdepCC_FALSE}"; then - as_fn_error "conditional \"am__fastdepCC\" was never defined. + as_fn_error $? "conditional \"am__fastdepCC\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi -if test -z "${am__fastdepCXX_TRUE}" && test -z "${am__fastdepCXX_FALSE}"; then - as_fn_error "conditional \"am__fastdepCXX\" was never defined. +if test -z "${COMPILER_IS_GCC_TRUE}" && test -z "${COMPILER_IS_GCC_FALSE}"; then + as_fn_error $? "conditional \"COMPILER_IS_GCC\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${COMPILER_IS_GCC_TRUE}" && test -z "${COMPILER_IS_GCC_FALSE}"; then + as_fn_error $? "conditional \"COMPILER_IS_GCC\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi + if test -z "${USE_C99_TYPES_TRUE}" && test -z "${USE_C99_TYPES_FALSE}"; then - as_fn_error "conditional \"USE_C99_TYPES\" was never defined. + as_fn_error $? "conditional \"USE_C99_TYPES\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi -if test -z "${COMPILER_IS_GCC_TRUE}" && test -z "${COMPILER_IS_GCC_FALSE}"; then - as_fn_error "conditional \"COMPILER_IS_GCC\" was never defined. +if test -z "${GL_COND_LIBTOOL_TRUE}" && test -z "${GL_COND_LIBTOOL_FALSE}"; then + as_fn_error $? "conditional \"GL_COND_LIBTOOL\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi -if test -z "${COMPILER_IS_GCC_TRUE}" && test -z "${COMPILER_IS_GCC_FALSE}"; then - as_fn_error "conditional \"COMPILER_IS_GCC\" was never defined. +if test -z "${GL_GENERATE_ALLOCA_H_TRUE}" && test -z "${GL_GENERATE_ALLOCA_H_FALSE}"; then + as_fn_error $? "conditional \"GL_GENERATE_ALLOCA_H\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi -if test -z "${GL_COND_LIBTOOL_TRUE}" && test -z "${GL_COND_LIBTOOL_FALSE}"; then - as_fn_error "conditional \"GL_COND_LIBTOOL\" was never defined. +if test -z "${GL_GENERATE_BYTESWAP_H_TRUE}" && test -z "${GL_GENERATE_BYTESWAP_H_FALSE}"; then + as_fn_error $? "conditional \"GL_GENERATE_BYTESWAP_H\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${GL_GENERATE_STDDEF_H_TRUE}" && test -z "${GL_GENERATE_STDDEF_H_FALSE}"; then + as_fn_error $? "conditional \"GL_GENERATE_STDDEF_H\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${GL_GENERATE_STDBOOL_H_TRUE}" && test -z "${GL_GENERATE_STDBOOL_H_FALSE}"; then + as_fn_error $? "conditional \"GL_GENERATE_STDBOOL_H\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${GL_GENERATE_STDDEF_H_TRUE}" && test -z "${GL_GENERATE_STDDEF_H_FALSE}"; then + as_fn_error $? "conditional \"GL_GENERATE_STDDEF_H\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${GL_GENERATE_STDINT_H_TRUE}" && test -z "${GL_GENERATE_STDINT_H_FALSE}"; then + as_fn_error $? "conditional \"GL_GENERATE_STDINT_H\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi @@ -23180,15 +25931,27 @@ if test -z "${CPPUNIT_TRUE}" && test -z "${CPPUNIT_FALSE}"; then - as_fn_error "conditional \"CPPUNIT\" was never defined. + as_fn_error $? "conditional \"CPPUNIT\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${CPPUNIT_TRUE}" && test -z "${CPPUNIT_FALSE}"; then - as_fn_error "conditional \"CPPUNIT\" was never defined. + as_fn_error $? "conditional \"CPPUNIT\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${DAP4_DEFINED_TRUE}" && test -z "${DAP4_DEFINED_FALSE}"; then + as_fn_error $? "conditional \"DAP4_DEFINED\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${DAP4_DEFINED_TRUE}" && test -z "${DAP4_DEFINED_FALSE}"; then + as_fn_error $? "conditional \"DAP4_DEFINED\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${BUILD_DEVELOPER_TRUE}" && test -z "${BUILD_DEVELOPER_FALSE}"; then + as_fn_error $? "conditional \"BUILD_DEVELOPER\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi -: ${CONFIG_STATUS=./config.status} +: "${CONFIG_STATUS=./config.status}" ac_write_fail=0 ac_clean_files_save=$ac_clean_files ac_clean_files="$ac_clean_files $CONFIG_STATUS" @@ -23289,6 +26052,7 @@ IFS=" "" $as_nl" # Find who we are. Look in the path if we contain no directory separator. +as_myself= case $0 in #(( *[\\/]* ) as_myself=$0 ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR @@ -23334,19 +26098,19 @@ (unset CDPATH) >/dev/null 2>&1 && unset CDPATH -# as_fn_error ERROR [LINENO LOG_FD] -# --------------------------------- +# as_fn_error STATUS ERROR [LINENO LOG_FD] +# ---------------------------------------- # Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are # provided, also output the error to LOG_FD, referencing LINENO. Then exit the -# script with status $?, using 1 if that was 0. +# script with STATUS, using 1 if that was 0. as_fn_error () { - as_status=$?; test $as_status -eq 0 && as_status=1 - if test "$3"; then - as_lineno=${as_lineno-"$2"} as_lineno_stack=as_lineno_stack=$as_lineno_stack - $as_echo "$as_me:${as_lineno-$LINENO}: error: $1" >&$3 + as_status=$1; test $as_status -eq 0 && as_status=1 + if test "$4"; then + as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4 fi - $as_echo "$as_me: error: $1" >&2 + $as_echo "$as_me: error: $2" >&2 as_fn_exit $as_status } # as_fn_error @@ -23484,16 +26248,16 @@ # ... but there are two gotchas: # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. - # In both cases, we have to default to `cp -p'. + # In both cases, we have to default to `cp -pR'. ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || - as_ln_s='cp -p' + as_ln_s='cp -pR' elif ln conf$$.file conf$$ 2>/dev/null; then as_ln_s=ln else - as_ln_s='cp -p' + as_ln_s='cp -pR' fi else - as_ln_s='cp -p' + as_ln_s='cp -pR' fi rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file rmdir conf$$.dir 2>/dev/null @@ -23542,7 +26306,7 @@ test -d "$as_dir" && break done test -z "$as_dirs" || eval "mkdir $as_dirs" - } || test -d "$as_dir" || as_fn_error "cannot create directory $as_dir" + } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir" } # as_fn_mkdir_p @@ -23553,28 +26317,16 @@ as_mkdir_p=false fi -if test -x / >/dev/null 2>&1; then - as_test_x='test -x' -else - if ls -dL / >/dev/null 2>&1; then - as_ls_L_option=L - else - as_ls_L_option= - fi - as_test_x=' - eval sh -c '\'' - if test -d "$1"; then - test -d "$1/."; - else - case $1 in #( - -*)set "./$1";; - esac; - case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in #(( - ???[sx]*):;;*)false;;esac;fi - '\'' sh - ' -fi -as_executable_p=$as_test_x + +# as_fn_executable_p FILE +# ----------------------- +# Test if FILE is an executable regular file. +as_fn_executable_p () +{ + test -f "$1" && test -x "$1" +} # as_fn_executable_p +as_test_x='test -x' +as_executable_p=as_fn_executable_p # Sed expression to map a string onto a valid CPP name. as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" @@ -23595,8 +26347,8 @@ # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" -This file was extended by libdap $as_me 3.11.1, which was -generated by GNU Autoconf 2.65. Invocation command line was +This file was extended by libdap $as_me 3.12.0, which was +generated by GNU Autoconf 2.69. Invocation command line was CONFIG_FILES = $CONFIG_FILES CONFIG_HEADERS = $CONFIG_HEADERS @@ -23661,11 +26413,11 @@ cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" ac_cs_version="\\ -libdap config.status 3.11.1 -configured by $0, generated by GNU Autoconf 2.65, +libdap config.status 3.12.0 +configured by $0, generated by GNU Autoconf 2.69, with options \\"\$ac_cs_config\\" -Copyright (C) 2009 Free Software Foundation, Inc. +Copyright (C) 2012 Free Software Foundation, Inc. This config.status script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it." @@ -23683,11 +26435,16 @@ while test $# != 0 do case $1 in - --*=*) + --*=?*) ac_option=`expr "X$1" : 'X\([^=]*\)='` ac_optarg=`expr "X$1" : 'X[^=]*=\(.*\)'` ac_shift=: ;; + --*=) + ac_option=`expr "X$1" : 'X\([^=]*\)='` + ac_optarg= + ac_shift=: + ;; *) ac_option=$1 ac_optarg=$2 @@ -23709,6 +26466,7 @@ $ac_shift case $ac_optarg in *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;; + '') as_fn_error $? "missing file argument" ;; esac as_fn_append CONFIG_FILES " '$ac_optarg'" ac_need_defaults=false;; @@ -23721,7 +26479,7 @@ ac_need_defaults=false;; --he | --h) # Conflict between --help and --header - as_fn_error "ambiguous option: \`$1' + as_fn_error $? "ambiguous option: \`$1' Try \`$0 --help' for more information.";; --help | --hel | -h ) $as_echo "$ac_cs_usage"; exit ;; @@ -23730,7 +26488,7 @@ ac_cs_silent=: ;; # This is an error. - -*) as_fn_error "unrecognized option: \`$1' + -*) as_fn_error $? "unrecognized option: \`$1' Try \`$0 --help' for more information." ;; *) as_fn_append ac_config_targets " $1" @@ -23750,7 +26508,7 @@ _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 if \$ac_cs_recheck; then - set X '$SHELL' '$0' $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion + set X $SHELL '$0' $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion shift \$as_echo "running CONFIG_SHELL=$SHELL \$*" >&6 CONFIG_SHELL='$SHELL' @@ -23785,184 +26543,208 @@ sed_quote_subst='$sed_quote_subst' double_quote_subst='$double_quote_subst' delay_variable_subst='$delay_variable_subst' -macro_version='`$ECHO "X$macro_version" | $Xsed -e "$delay_single_quote_subst"`' -macro_revision='`$ECHO "X$macro_revision" | $Xsed -e "$delay_single_quote_subst"`' -enable_shared='`$ECHO "X$enable_shared" | $Xsed -e "$delay_single_quote_subst"`' -enable_static='`$ECHO "X$enable_static" | $Xsed -e "$delay_single_quote_subst"`' -pic_mode='`$ECHO "X$pic_mode" | $Xsed -e "$delay_single_quote_subst"`' -enable_fast_install='`$ECHO "X$enable_fast_install" | $Xsed -e "$delay_single_quote_subst"`' -host_alias='`$ECHO "X$host_alias" | $Xsed -e "$delay_single_quote_subst"`' -host='`$ECHO "X$host" | $Xsed -e "$delay_single_quote_subst"`' -host_os='`$ECHO "X$host_os" | $Xsed -e "$delay_single_quote_subst"`' -build_alias='`$ECHO "X$build_alias" | $Xsed -e "$delay_single_quote_subst"`' -build='`$ECHO "X$build" | $Xsed -e "$delay_single_quote_subst"`' -build_os='`$ECHO "X$build_os" | $Xsed -e "$delay_single_quote_subst"`' -SED='`$ECHO "X$SED" | $Xsed -e "$delay_single_quote_subst"`' -Xsed='`$ECHO "X$Xsed" | $Xsed -e "$delay_single_quote_subst"`' -GREP='`$ECHO "X$GREP" | $Xsed -e "$delay_single_quote_subst"`' -EGREP='`$ECHO "X$EGREP" | $Xsed -e "$delay_single_quote_subst"`' -FGREP='`$ECHO "X$FGREP" | $Xsed -e "$delay_single_quote_subst"`' -LD='`$ECHO "X$LD" | $Xsed -e "$delay_single_quote_subst"`' -NM='`$ECHO "X$NM" | $Xsed -e "$delay_single_quote_subst"`' -LN_S='`$ECHO "X$LN_S" | $Xsed -e "$delay_single_quote_subst"`' -max_cmd_len='`$ECHO "X$max_cmd_len" | $Xsed -e "$delay_single_quote_subst"`' -ac_objext='`$ECHO "X$ac_objext" | $Xsed -e "$delay_single_quote_subst"`' -exeext='`$ECHO "X$exeext" | $Xsed -e "$delay_single_quote_subst"`' -lt_unset='`$ECHO "X$lt_unset" | $Xsed -e "$delay_single_quote_subst"`' -lt_SP2NL='`$ECHO "X$lt_SP2NL" | $Xsed -e "$delay_single_quote_subst"`' -lt_NL2SP='`$ECHO "X$lt_NL2SP" | $Xsed -e "$delay_single_quote_subst"`' -reload_flag='`$ECHO "X$reload_flag" | $Xsed -e "$delay_single_quote_subst"`' -reload_cmds='`$ECHO "X$reload_cmds" | $Xsed -e "$delay_single_quote_subst"`' -OBJDUMP='`$ECHO "X$OBJDUMP" | $Xsed -e "$delay_single_quote_subst"`' -deplibs_check_method='`$ECHO "X$deplibs_check_method" | $Xsed -e "$delay_single_quote_subst"`' -file_magic_cmd='`$ECHO "X$file_magic_cmd" | $Xsed -e "$delay_single_quote_subst"`' -AR='`$ECHO "X$AR" | $Xsed -e "$delay_single_quote_subst"`' -AR_FLAGS='`$ECHO "X$AR_FLAGS" | $Xsed -e "$delay_single_quote_subst"`' -STRIP='`$ECHO "X$STRIP" | $Xsed -e "$delay_single_quote_subst"`' -RANLIB='`$ECHO "X$RANLIB" | $Xsed -e "$delay_single_quote_subst"`' -old_postinstall_cmds='`$ECHO "X$old_postinstall_cmds" | $Xsed -e "$delay_single_quote_subst"`' -old_postuninstall_cmds='`$ECHO "X$old_postuninstall_cmds" | $Xsed -e "$delay_single_quote_subst"`' -old_archive_cmds='`$ECHO "X$old_archive_cmds" | $Xsed -e "$delay_single_quote_subst"`' -CC='`$ECHO "X$CC" | $Xsed -e "$delay_single_quote_subst"`' -CFLAGS='`$ECHO "X$CFLAGS" | $Xsed -e "$delay_single_quote_subst"`' -compiler='`$ECHO "X$compiler" | $Xsed -e "$delay_single_quote_subst"`' -GCC='`$ECHO "X$GCC" | $Xsed -e "$delay_single_quote_subst"`' -lt_cv_sys_global_symbol_pipe='`$ECHO "X$lt_cv_sys_global_symbol_pipe" | $Xsed -e "$delay_single_quote_subst"`' -lt_cv_sys_global_symbol_to_cdecl='`$ECHO "X$lt_cv_sys_global_symbol_to_cdecl" | $Xsed -e "$delay_single_quote_subst"`' -lt_cv_sys_global_symbol_to_c_name_address='`$ECHO "X$lt_cv_sys_global_symbol_to_c_name_address" | $Xsed -e "$delay_single_quote_subst"`' -lt_cv_sys_global_symbol_to_c_name_address_lib_prefix='`$ECHO "X$lt_cv_sys_global_symbol_to_c_name_address_lib_prefix" | $Xsed -e "$delay_single_quote_subst"`' -objdir='`$ECHO "X$objdir" | $Xsed -e "$delay_single_quote_subst"`' -SHELL='`$ECHO "X$SHELL" | $Xsed -e "$delay_single_quote_subst"`' -ECHO='`$ECHO "X$ECHO" | $Xsed -e "$delay_single_quote_subst"`' -MAGIC_CMD='`$ECHO "X$MAGIC_CMD" | $Xsed -e "$delay_single_quote_subst"`' -lt_prog_compiler_no_builtin_flag='`$ECHO "X$lt_prog_compiler_no_builtin_flag" | $Xsed -e "$delay_single_quote_subst"`' -lt_prog_compiler_wl='`$ECHO "X$lt_prog_compiler_wl" | $Xsed -e "$delay_single_quote_subst"`' -lt_prog_compiler_pic='`$ECHO "X$lt_prog_compiler_pic" | $Xsed -e "$delay_single_quote_subst"`' -lt_prog_compiler_static='`$ECHO "X$lt_prog_compiler_static" | $Xsed -e "$delay_single_quote_subst"`' -lt_cv_prog_compiler_c_o='`$ECHO "X$lt_cv_prog_compiler_c_o" | $Xsed -e "$delay_single_quote_subst"`' -need_locks='`$ECHO "X$need_locks" | $Xsed -e "$delay_single_quote_subst"`' -DSYMUTIL='`$ECHO "X$DSYMUTIL" | $Xsed -e "$delay_single_quote_subst"`' -NMEDIT='`$ECHO "X$NMEDIT" | $Xsed -e "$delay_single_quote_subst"`' -LIPO='`$ECHO "X$LIPO" | $Xsed -e "$delay_single_quote_subst"`' -OTOOL='`$ECHO "X$OTOOL" | $Xsed -e "$delay_single_quote_subst"`' -OTOOL64='`$ECHO "X$OTOOL64" | $Xsed -e "$delay_single_quote_subst"`' -libext='`$ECHO "X$libext" | $Xsed -e "$delay_single_quote_subst"`' -shrext_cmds='`$ECHO "X$shrext_cmds" | $Xsed -e "$delay_single_quote_subst"`' -extract_expsyms_cmds='`$ECHO "X$extract_expsyms_cmds" | $Xsed -e "$delay_single_quote_subst"`' -archive_cmds_need_lc='`$ECHO "X$archive_cmds_need_lc" | $Xsed -e "$delay_single_quote_subst"`' -enable_shared_with_static_runtimes='`$ECHO "X$enable_shared_with_static_runtimes" | $Xsed -e "$delay_single_quote_subst"`' -export_dynamic_flag_spec='`$ECHO "X$export_dynamic_flag_spec" | $Xsed -e "$delay_single_quote_subst"`' -whole_archive_flag_spec='`$ECHO "X$whole_archive_flag_spec" | $Xsed -e "$delay_single_quote_subst"`' -compiler_needs_object='`$ECHO "X$compiler_needs_object" | $Xsed -e "$delay_single_quote_subst"`' -old_archive_from_new_cmds='`$ECHO "X$old_archive_from_new_cmds" | $Xsed -e "$delay_single_quote_subst"`' -old_archive_from_expsyms_cmds='`$ECHO "X$old_archive_from_expsyms_cmds" | $Xsed -e "$delay_single_quote_subst"`' -archive_cmds='`$ECHO "X$archive_cmds" | $Xsed -e "$delay_single_quote_subst"`' -archive_expsym_cmds='`$ECHO "X$archive_expsym_cmds" | $Xsed -e "$delay_single_quote_subst"`' -module_cmds='`$ECHO "X$module_cmds" | $Xsed -e "$delay_single_quote_subst"`' -module_expsym_cmds='`$ECHO "X$module_expsym_cmds" | $Xsed -e "$delay_single_quote_subst"`' -with_gnu_ld='`$ECHO "X$with_gnu_ld" | $Xsed -e "$delay_single_quote_subst"`' -allow_undefined_flag='`$ECHO "X$allow_undefined_flag" | $Xsed -e "$delay_single_quote_subst"`' -no_undefined_flag='`$ECHO "X$no_undefined_flag" | $Xsed -e "$delay_single_quote_subst"`' -hardcode_libdir_flag_spec='`$ECHO "X$hardcode_libdir_flag_spec" | $Xsed -e "$delay_single_quote_subst"`' -hardcode_libdir_flag_spec_ld='`$ECHO "X$hardcode_libdir_flag_spec_ld" | $Xsed -e "$delay_single_quote_subst"`' -hardcode_libdir_separator='`$ECHO "X$hardcode_libdir_separator" | $Xsed -e "$delay_single_quote_subst"`' -hardcode_direct='`$ECHO "X$hardcode_direct" | $Xsed -e "$delay_single_quote_subst"`' -hardcode_direct_absolute='`$ECHO "X$hardcode_direct_absolute" | $Xsed -e "$delay_single_quote_subst"`' -hardcode_minus_L='`$ECHO "X$hardcode_minus_L" | $Xsed -e "$delay_single_quote_subst"`' -hardcode_shlibpath_var='`$ECHO "X$hardcode_shlibpath_var" | $Xsed -e "$delay_single_quote_subst"`' -hardcode_automatic='`$ECHO "X$hardcode_automatic" | $Xsed -e "$delay_single_quote_subst"`' -inherit_rpath='`$ECHO "X$inherit_rpath" | $Xsed -e "$delay_single_quote_subst"`' -link_all_deplibs='`$ECHO "X$link_all_deplibs" | $Xsed -e "$delay_single_quote_subst"`' -fix_srcfile_path='`$ECHO "X$fix_srcfile_path" | $Xsed -e "$delay_single_quote_subst"`' -always_export_symbols='`$ECHO "X$always_export_symbols" | $Xsed -e "$delay_single_quote_subst"`' -export_symbols_cmds='`$ECHO "X$export_symbols_cmds" | $Xsed -e "$delay_single_quote_subst"`' -exclude_expsyms='`$ECHO "X$exclude_expsyms" | $Xsed -e "$delay_single_quote_subst"`' -include_expsyms='`$ECHO "X$include_expsyms" | $Xsed -e "$delay_single_quote_subst"`' -prelink_cmds='`$ECHO "X$prelink_cmds" | $Xsed -e "$delay_single_quote_subst"`' -file_list_spec='`$ECHO "X$file_list_spec" | $Xsed -e "$delay_single_quote_subst"`' -variables_saved_for_relink='`$ECHO "X$variables_saved_for_relink" | $Xsed -e "$delay_single_quote_subst"`' -need_lib_prefix='`$ECHO "X$need_lib_prefix" | $Xsed -e "$delay_single_quote_subst"`' -need_version='`$ECHO "X$need_version" | $Xsed -e "$delay_single_quote_subst"`' -version_type='`$ECHO "X$version_type" | $Xsed -e "$delay_single_quote_subst"`' -runpath_var='`$ECHO "X$runpath_var" | $Xsed -e "$delay_single_quote_subst"`' -shlibpath_var='`$ECHO "X$shlibpath_var" | $Xsed -e "$delay_single_quote_subst"`' -shlibpath_overrides_runpath='`$ECHO "X$shlibpath_overrides_runpath" | $Xsed -e "$delay_single_quote_subst"`' -libname_spec='`$ECHO "X$libname_spec" | $Xsed -e "$delay_single_quote_subst"`' -library_names_spec='`$ECHO "X$library_names_spec" | $Xsed -e "$delay_single_quote_subst"`' -soname_spec='`$ECHO "X$soname_spec" | $Xsed -e "$delay_single_quote_subst"`' -postinstall_cmds='`$ECHO "X$postinstall_cmds" | $Xsed -e "$delay_single_quote_subst"`' -postuninstall_cmds='`$ECHO "X$postuninstall_cmds" | $Xsed -e "$delay_single_quote_subst"`' -finish_cmds='`$ECHO "X$finish_cmds" | $Xsed -e "$delay_single_quote_subst"`' -finish_eval='`$ECHO "X$finish_eval" | $Xsed -e "$delay_single_quote_subst"`' -hardcode_into_libs='`$ECHO "X$hardcode_into_libs" | $Xsed -e "$delay_single_quote_subst"`' -sys_lib_search_path_spec='`$ECHO "X$sys_lib_search_path_spec" | $Xsed -e "$delay_single_quote_subst"`' -sys_lib_dlsearch_path_spec='`$ECHO "X$sys_lib_dlsearch_path_spec" | $Xsed -e "$delay_single_quote_subst"`' -hardcode_action='`$ECHO "X$hardcode_action" | $Xsed -e "$delay_single_quote_subst"`' -enable_dlopen='`$ECHO "X$enable_dlopen" | $Xsed -e "$delay_single_quote_subst"`' -enable_dlopen_self='`$ECHO "X$enable_dlopen_self" | $Xsed -e "$delay_single_quote_subst"`' -enable_dlopen_self_static='`$ECHO "X$enable_dlopen_self_static" | $Xsed -e "$delay_single_quote_subst"`' -old_striplib='`$ECHO "X$old_striplib" | $Xsed -e "$delay_single_quote_subst"`' -striplib='`$ECHO "X$striplib" | $Xsed -e "$delay_single_quote_subst"`' -compiler_lib_search_dirs='`$ECHO "X$compiler_lib_search_dirs" | $Xsed -e "$delay_single_quote_subst"`' -predep_objects='`$ECHO "X$predep_objects" | $Xsed -e "$delay_single_quote_subst"`' -postdep_objects='`$ECHO "X$postdep_objects" | $Xsed -e "$delay_single_quote_subst"`' -predeps='`$ECHO "X$predeps" | $Xsed -e "$delay_single_quote_subst"`' -postdeps='`$ECHO "X$postdeps" | $Xsed -e "$delay_single_quote_subst"`' -compiler_lib_search_path='`$ECHO "X$compiler_lib_search_path" | $Xsed -e "$delay_single_quote_subst"`' -LD_CXX='`$ECHO "X$LD_CXX" | $Xsed -e "$delay_single_quote_subst"`' -old_archive_cmds_CXX='`$ECHO "X$old_archive_cmds_CXX" | $Xsed -e "$delay_single_quote_subst"`' -compiler_CXX='`$ECHO "X$compiler_CXX" | $Xsed -e "$delay_single_quote_subst"`' -GCC_CXX='`$ECHO "X$GCC_CXX" | $Xsed -e "$delay_single_quote_subst"`' -lt_prog_compiler_no_builtin_flag_CXX='`$ECHO "X$lt_prog_compiler_no_builtin_flag_CXX" | $Xsed -e "$delay_single_quote_subst"`' -lt_prog_compiler_wl_CXX='`$ECHO "X$lt_prog_compiler_wl_CXX" | $Xsed -e "$delay_single_quote_subst"`' -lt_prog_compiler_pic_CXX='`$ECHO "X$lt_prog_compiler_pic_CXX" | $Xsed -e "$delay_single_quote_subst"`' -lt_prog_compiler_static_CXX='`$ECHO "X$lt_prog_compiler_static_CXX" | $Xsed -e "$delay_single_quote_subst"`' -lt_cv_prog_compiler_c_o_CXX='`$ECHO "X$lt_cv_prog_compiler_c_o_CXX" | $Xsed -e "$delay_single_quote_subst"`' -archive_cmds_need_lc_CXX='`$ECHO "X$archive_cmds_need_lc_CXX" | $Xsed -e "$delay_single_quote_subst"`' -enable_shared_with_static_runtimes_CXX='`$ECHO "X$enable_shared_with_static_runtimes_CXX" | $Xsed -e "$delay_single_quote_subst"`' -export_dynamic_flag_spec_CXX='`$ECHO "X$export_dynamic_flag_spec_CXX" | $Xsed -e "$delay_single_quote_subst"`' -whole_archive_flag_spec_CXX='`$ECHO "X$whole_archive_flag_spec_CXX" | $Xsed -e "$delay_single_quote_subst"`' -compiler_needs_object_CXX='`$ECHO "X$compiler_needs_object_CXX" | $Xsed -e "$delay_single_quote_subst"`' -old_archive_from_new_cmds_CXX='`$ECHO "X$old_archive_from_new_cmds_CXX" | $Xsed -e "$delay_single_quote_subst"`' -old_archive_from_expsyms_cmds_CXX='`$ECHO "X$old_archive_from_expsyms_cmds_CXX" | $Xsed -e "$delay_single_quote_subst"`' -archive_cmds_CXX='`$ECHO "X$archive_cmds_CXX" | $Xsed -e "$delay_single_quote_subst"`' -archive_expsym_cmds_CXX='`$ECHO "X$archive_expsym_cmds_CXX" | $Xsed -e "$delay_single_quote_subst"`' -module_cmds_CXX='`$ECHO "X$module_cmds_CXX" | $Xsed -e "$delay_single_quote_subst"`' -module_expsym_cmds_CXX='`$ECHO "X$module_expsym_cmds_CXX" | $Xsed -e "$delay_single_quote_subst"`' -with_gnu_ld_CXX='`$ECHO "X$with_gnu_ld_CXX" | $Xsed -e "$delay_single_quote_subst"`' -allow_undefined_flag_CXX='`$ECHO "X$allow_undefined_flag_CXX" | $Xsed -e "$delay_single_quote_subst"`' -no_undefined_flag_CXX='`$ECHO "X$no_undefined_flag_CXX" | $Xsed -e "$delay_single_quote_subst"`' -hardcode_libdir_flag_spec_CXX='`$ECHO "X$hardcode_libdir_flag_spec_CXX" | $Xsed -e "$delay_single_quote_subst"`' -hardcode_libdir_flag_spec_ld_CXX='`$ECHO "X$hardcode_libdir_flag_spec_ld_CXX" | $Xsed -e "$delay_single_quote_subst"`' -hardcode_libdir_separator_CXX='`$ECHO "X$hardcode_libdir_separator_CXX" | $Xsed -e "$delay_single_quote_subst"`' -hardcode_direct_CXX='`$ECHO "X$hardcode_direct_CXX" | $Xsed -e "$delay_single_quote_subst"`' -hardcode_direct_absolute_CXX='`$ECHO "X$hardcode_direct_absolute_CXX" | $Xsed -e "$delay_single_quote_subst"`' -hardcode_minus_L_CXX='`$ECHO "X$hardcode_minus_L_CXX" | $Xsed -e "$delay_single_quote_subst"`' -hardcode_shlibpath_var_CXX='`$ECHO "X$hardcode_shlibpath_var_CXX" | $Xsed -e "$delay_single_quote_subst"`' -hardcode_automatic_CXX='`$ECHO "X$hardcode_automatic_CXX" | $Xsed -e "$delay_single_quote_subst"`' -inherit_rpath_CXX='`$ECHO "X$inherit_rpath_CXX" | $Xsed -e "$delay_single_quote_subst"`' -link_all_deplibs_CXX='`$ECHO "X$link_all_deplibs_CXX" | $Xsed -e "$delay_single_quote_subst"`' -fix_srcfile_path_CXX='`$ECHO "X$fix_srcfile_path_CXX" | $Xsed -e "$delay_single_quote_subst"`' -always_export_symbols_CXX='`$ECHO "X$always_export_symbols_CXX" | $Xsed -e "$delay_single_quote_subst"`' -export_symbols_cmds_CXX='`$ECHO "X$export_symbols_cmds_CXX" | $Xsed -e "$delay_single_quote_subst"`' -exclude_expsyms_CXX='`$ECHO "X$exclude_expsyms_CXX" | $Xsed -e "$delay_single_quote_subst"`' -include_expsyms_CXX='`$ECHO "X$include_expsyms_CXX" | $Xsed -e "$delay_single_quote_subst"`' -prelink_cmds_CXX='`$ECHO "X$prelink_cmds_CXX" | $Xsed -e "$delay_single_quote_subst"`' -file_list_spec_CXX='`$ECHO "X$file_list_spec_CXX" | $Xsed -e "$delay_single_quote_subst"`' -hardcode_action_CXX='`$ECHO "X$hardcode_action_CXX" | $Xsed -e "$delay_single_quote_subst"`' -compiler_lib_search_dirs_CXX='`$ECHO "X$compiler_lib_search_dirs_CXX" | $Xsed -e "$delay_single_quote_subst"`' -predep_objects_CXX='`$ECHO "X$predep_objects_CXX" | $Xsed -e "$delay_single_quote_subst"`' -postdep_objects_CXX='`$ECHO "X$postdep_objects_CXX" | $Xsed -e "$delay_single_quote_subst"`' -predeps_CXX='`$ECHO "X$predeps_CXX" | $Xsed -e "$delay_single_quote_subst"`' -postdeps_CXX='`$ECHO "X$postdeps_CXX" | $Xsed -e "$delay_single_quote_subst"`' -compiler_lib_search_path_CXX='`$ECHO "X$compiler_lib_search_path_CXX" | $Xsed -e "$delay_single_quote_subst"`' +macro_version='`$ECHO "$macro_version" | $SED "$delay_single_quote_subst"`' +macro_revision='`$ECHO "$macro_revision" | $SED "$delay_single_quote_subst"`' +enable_shared='`$ECHO "$enable_shared" | $SED "$delay_single_quote_subst"`' +enable_static='`$ECHO "$enable_static" | $SED "$delay_single_quote_subst"`' +pic_mode='`$ECHO "$pic_mode" | $SED "$delay_single_quote_subst"`' +enable_fast_install='`$ECHO "$enable_fast_install" | $SED "$delay_single_quote_subst"`' +SHELL='`$ECHO "$SHELL" | $SED "$delay_single_quote_subst"`' +ECHO='`$ECHO "$ECHO" | $SED "$delay_single_quote_subst"`' +PATH_SEPARATOR='`$ECHO "$PATH_SEPARATOR" | $SED "$delay_single_quote_subst"`' +host_alias='`$ECHO "$host_alias" | $SED "$delay_single_quote_subst"`' +host='`$ECHO "$host" | $SED "$delay_single_quote_subst"`' +host_os='`$ECHO "$host_os" | $SED "$delay_single_quote_subst"`' +build_alias='`$ECHO "$build_alias" | $SED "$delay_single_quote_subst"`' +build='`$ECHO "$build" | $SED "$delay_single_quote_subst"`' +build_os='`$ECHO "$build_os" | $SED "$delay_single_quote_subst"`' +SED='`$ECHO "$SED" | $SED "$delay_single_quote_subst"`' +Xsed='`$ECHO "$Xsed" | $SED "$delay_single_quote_subst"`' +GREP='`$ECHO "$GREP" | $SED "$delay_single_quote_subst"`' +EGREP='`$ECHO "$EGREP" | $SED "$delay_single_quote_subst"`' +FGREP='`$ECHO "$FGREP" | $SED "$delay_single_quote_subst"`' +LD='`$ECHO "$LD" | $SED "$delay_single_quote_subst"`' +NM='`$ECHO "$NM" | $SED "$delay_single_quote_subst"`' +LN_S='`$ECHO "$LN_S" | $SED "$delay_single_quote_subst"`' +max_cmd_len='`$ECHO "$max_cmd_len" | $SED "$delay_single_quote_subst"`' +ac_objext='`$ECHO "$ac_objext" | $SED "$delay_single_quote_subst"`' +exeext='`$ECHO "$exeext" | $SED "$delay_single_quote_subst"`' +lt_unset='`$ECHO "$lt_unset" | $SED "$delay_single_quote_subst"`' +lt_SP2NL='`$ECHO "$lt_SP2NL" | $SED "$delay_single_quote_subst"`' +lt_NL2SP='`$ECHO "$lt_NL2SP" | $SED "$delay_single_quote_subst"`' +lt_cv_to_host_file_cmd='`$ECHO "$lt_cv_to_host_file_cmd" | $SED "$delay_single_quote_subst"`' +lt_cv_to_tool_file_cmd='`$ECHO "$lt_cv_to_tool_file_cmd" | $SED "$delay_single_quote_subst"`' +reload_flag='`$ECHO "$reload_flag" | $SED "$delay_single_quote_subst"`' +reload_cmds='`$ECHO "$reload_cmds" | $SED "$delay_single_quote_subst"`' +OBJDUMP='`$ECHO "$OBJDUMP" | $SED "$delay_single_quote_subst"`' +deplibs_check_method='`$ECHO "$deplibs_check_method" | $SED "$delay_single_quote_subst"`' +file_magic_cmd='`$ECHO "$file_magic_cmd" | $SED "$delay_single_quote_subst"`' +file_magic_glob='`$ECHO "$file_magic_glob" | $SED "$delay_single_quote_subst"`' +want_nocaseglob='`$ECHO "$want_nocaseglob" | $SED "$delay_single_quote_subst"`' +DLLTOOL='`$ECHO "$DLLTOOL" | $SED "$delay_single_quote_subst"`' +sharedlib_from_linklib_cmd='`$ECHO "$sharedlib_from_linklib_cmd" | $SED "$delay_single_quote_subst"`' +AR='`$ECHO "$AR" | $SED "$delay_single_quote_subst"`' +AR_FLAGS='`$ECHO "$AR_FLAGS" | $SED "$delay_single_quote_subst"`' +archiver_list_spec='`$ECHO "$archiver_list_spec" | $SED "$delay_single_quote_subst"`' +STRIP='`$ECHO "$STRIP" | $SED "$delay_single_quote_subst"`' +RANLIB='`$ECHO "$RANLIB" | $SED "$delay_single_quote_subst"`' +old_postinstall_cmds='`$ECHO "$old_postinstall_cmds" | $SED "$delay_single_quote_subst"`' +old_postuninstall_cmds='`$ECHO "$old_postuninstall_cmds" | $SED "$delay_single_quote_subst"`' +old_archive_cmds='`$ECHO "$old_archive_cmds" | $SED "$delay_single_quote_subst"`' +lock_old_archive_extraction='`$ECHO "$lock_old_archive_extraction" | $SED "$delay_single_quote_subst"`' +CC='`$ECHO "$CC" | $SED "$delay_single_quote_subst"`' +CFLAGS='`$ECHO "$CFLAGS" | $SED "$delay_single_quote_subst"`' +compiler='`$ECHO "$compiler" | $SED "$delay_single_quote_subst"`' +GCC='`$ECHO "$GCC" | $SED "$delay_single_quote_subst"`' +lt_cv_sys_global_symbol_pipe='`$ECHO "$lt_cv_sys_global_symbol_pipe" | $SED "$delay_single_quote_subst"`' +lt_cv_sys_global_symbol_to_cdecl='`$ECHO "$lt_cv_sys_global_symbol_to_cdecl" | $SED "$delay_single_quote_subst"`' +lt_cv_sys_global_symbol_to_c_name_address='`$ECHO "$lt_cv_sys_global_symbol_to_c_name_address" | $SED "$delay_single_quote_subst"`' +lt_cv_sys_global_symbol_to_c_name_address_lib_prefix='`$ECHO "$lt_cv_sys_global_symbol_to_c_name_address_lib_prefix" | $SED "$delay_single_quote_subst"`' +nm_file_list_spec='`$ECHO "$nm_file_list_spec" | $SED "$delay_single_quote_subst"`' +lt_sysroot='`$ECHO "$lt_sysroot" | $SED "$delay_single_quote_subst"`' +objdir='`$ECHO "$objdir" | $SED "$delay_single_quote_subst"`' +MAGIC_CMD='`$ECHO "$MAGIC_CMD" | $SED "$delay_single_quote_subst"`' +lt_prog_compiler_no_builtin_flag='`$ECHO "$lt_prog_compiler_no_builtin_flag" | $SED "$delay_single_quote_subst"`' +lt_prog_compiler_pic='`$ECHO "$lt_prog_compiler_pic" | $SED "$delay_single_quote_subst"`' +lt_prog_compiler_wl='`$ECHO "$lt_prog_compiler_wl" | $SED "$delay_single_quote_subst"`' +lt_prog_compiler_static='`$ECHO "$lt_prog_compiler_static" | $SED "$delay_single_quote_subst"`' +lt_cv_prog_compiler_c_o='`$ECHO "$lt_cv_prog_compiler_c_o" | $SED "$delay_single_quote_subst"`' +need_locks='`$ECHO "$need_locks" | $SED "$delay_single_quote_subst"`' +MANIFEST_TOOL='`$ECHO "$MANIFEST_TOOL" | $SED "$delay_single_quote_subst"`' +DSYMUTIL='`$ECHO "$DSYMUTIL" | $SED "$delay_single_quote_subst"`' +NMEDIT='`$ECHO "$NMEDIT" | $SED "$delay_single_quote_subst"`' +LIPO='`$ECHO "$LIPO" | $SED "$delay_single_quote_subst"`' +OTOOL='`$ECHO "$OTOOL" | $SED "$delay_single_quote_subst"`' +OTOOL64='`$ECHO "$OTOOL64" | $SED "$delay_single_quote_subst"`' +libext='`$ECHO "$libext" | $SED "$delay_single_quote_subst"`' +shrext_cmds='`$ECHO "$shrext_cmds" | $SED "$delay_single_quote_subst"`' +extract_expsyms_cmds='`$ECHO "$extract_expsyms_cmds" | $SED "$delay_single_quote_subst"`' +archive_cmds_need_lc='`$ECHO "$archive_cmds_need_lc" | $SED "$delay_single_quote_subst"`' +enable_shared_with_static_runtimes='`$ECHO "$enable_shared_with_static_runtimes" | $SED "$delay_single_quote_subst"`' +export_dynamic_flag_spec='`$ECHO "$export_dynamic_flag_spec" | $SED "$delay_single_quote_subst"`' +whole_archive_flag_spec='`$ECHO "$whole_archive_flag_spec" | $SED "$delay_single_quote_subst"`' +compiler_needs_object='`$ECHO "$compiler_needs_object" | $SED "$delay_single_quote_subst"`' +old_archive_from_new_cmds='`$ECHO "$old_archive_from_new_cmds" | $SED "$delay_single_quote_subst"`' +old_archive_from_expsyms_cmds='`$ECHO "$old_archive_from_expsyms_cmds" | $SED "$delay_single_quote_subst"`' +archive_cmds='`$ECHO "$archive_cmds" | $SED "$delay_single_quote_subst"`' +archive_expsym_cmds='`$ECHO "$archive_expsym_cmds" | $SED "$delay_single_quote_subst"`' +module_cmds='`$ECHO "$module_cmds" | $SED "$delay_single_quote_subst"`' +module_expsym_cmds='`$ECHO "$module_expsym_cmds" | $SED "$delay_single_quote_subst"`' +with_gnu_ld='`$ECHO "$with_gnu_ld" | $SED "$delay_single_quote_subst"`' +allow_undefined_flag='`$ECHO "$allow_undefined_flag" | $SED "$delay_single_quote_subst"`' +no_undefined_flag='`$ECHO "$no_undefined_flag" | $SED "$delay_single_quote_subst"`' +hardcode_libdir_flag_spec='`$ECHO "$hardcode_libdir_flag_spec" | $SED "$delay_single_quote_subst"`' +hardcode_libdir_separator='`$ECHO "$hardcode_libdir_separator" | $SED "$delay_single_quote_subst"`' +hardcode_direct='`$ECHO "$hardcode_direct" | $SED "$delay_single_quote_subst"`' +hardcode_direct_absolute='`$ECHO "$hardcode_direct_absolute" | $SED "$delay_single_quote_subst"`' +hardcode_minus_L='`$ECHO "$hardcode_minus_L" | $SED "$delay_single_quote_subst"`' +hardcode_shlibpath_var='`$ECHO "$hardcode_shlibpath_var" | $SED "$delay_single_quote_subst"`' +hardcode_automatic='`$ECHO "$hardcode_automatic" | $SED "$delay_single_quote_subst"`' +inherit_rpath='`$ECHO "$inherit_rpath" | $SED "$delay_single_quote_subst"`' +link_all_deplibs='`$ECHO "$link_all_deplibs" | $SED "$delay_single_quote_subst"`' +always_export_symbols='`$ECHO "$always_export_symbols" | $SED "$delay_single_quote_subst"`' +export_symbols_cmds='`$ECHO "$export_symbols_cmds" | $SED "$delay_single_quote_subst"`' +exclude_expsyms='`$ECHO "$exclude_expsyms" | $SED "$delay_single_quote_subst"`' +include_expsyms='`$ECHO "$include_expsyms" | $SED "$delay_single_quote_subst"`' +prelink_cmds='`$ECHO "$prelink_cmds" | $SED "$delay_single_quote_subst"`' +postlink_cmds='`$ECHO "$postlink_cmds" | $SED "$delay_single_quote_subst"`' +file_list_spec='`$ECHO "$file_list_spec" | $SED "$delay_single_quote_subst"`' +variables_saved_for_relink='`$ECHO "$variables_saved_for_relink" | $SED "$delay_single_quote_subst"`' +need_lib_prefix='`$ECHO "$need_lib_prefix" | $SED "$delay_single_quote_subst"`' +need_version='`$ECHO "$need_version" | $SED "$delay_single_quote_subst"`' +version_type='`$ECHO "$version_type" | $SED "$delay_single_quote_subst"`' +runpath_var='`$ECHO "$runpath_var" | $SED "$delay_single_quote_subst"`' +shlibpath_var='`$ECHO "$shlibpath_var" | $SED "$delay_single_quote_subst"`' +shlibpath_overrides_runpath='`$ECHO "$shlibpath_overrides_runpath" | $SED "$delay_single_quote_subst"`' +libname_spec='`$ECHO "$libname_spec" | $SED "$delay_single_quote_subst"`' +library_names_spec='`$ECHO "$library_names_spec" | $SED "$delay_single_quote_subst"`' +soname_spec='`$ECHO "$soname_spec" | $SED "$delay_single_quote_subst"`' +install_override_mode='`$ECHO "$install_override_mode" | $SED "$delay_single_quote_subst"`' +postinstall_cmds='`$ECHO "$postinstall_cmds" | $SED "$delay_single_quote_subst"`' +postuninstall_cmds='`$ECHO "$postuninstall_cmds" | $SED "$delay_single_quote_subst"`' +finish_cmds='`$ECHO "$finish_cmds" | $SED "$delay_single_quote_subst"`' +finish_eval='`$ECHO "$finish_eval" | $SED "$delay_single_quote_subst"`' +hardcode_into_libs='`$ECHO "$hardcode_into_libs" | $SED "$delay_single_quote_subst"`' +sys_lib_search_path_spec='`$ECHO "$sys_lib_search_path_spec" | $SED "$delay_single_quote_subst"`' +sys_lib_dlsearch_path_spec='`$ECHO "$sys_lib_dlsearch_path_spec" | $SED "$delay_single_quote_subst"`' +hardcode_action='`$ECHO "$hardcode_action" | $SED "$delay_single_quote_subst"`' +enable_dlopen='`$ECHO "$enable_dlopen" | $SED "$delay_single_quote_subst"`' +enable_dlopen_self='`$ECHO "$enable_dlopen_self" | $SED "$delay_single_quote_subst"`' +enable_dlopen_self_static='`$ECHO "$enable_dlopen_self_static" | $SED "$delay_single_quote_subst"`' +old_striplib='`$ECHO "$old_striplib" | $SED "$delay_single_quote_subst"`' +striplib='`$ECHO "$striplib" | $SED "$delay_single_quote_subst"`' +compiler_lib_search_dirs='`$ECHO "$compiler_lib_search_dirs" | $SED "$delay_single_quote_subst"`' +predep_objects='`$ECHO "$predep_objects" | $SED "$delay_single_quote_subst"`' +postdep_objects='`$ECHO "$postdep_objects" | $SED "$delay_single_quote_subst"`' +predeps='`$ECHO "$predeps" | $SED "$delay_single_quote_subst"`' +postdeps='`$ECHO "$postdeps" | $SED "$delay_single_quote_subst"`' +compiler_lib_search_path='`$ECHO "$compiler_lib_search_path" | $SED "$delay_single_quote_subst"`' +LD_CXX='`$ECHO "$LD_CXX" | $SED "$delay_single_quote_subst"`' +reload_flag_CXX='`$ECHO "$reload_flag_CXX" | $SED "$delay_single_quote_subst"`' +reload_cmds_CXX='`$ECHO "$reload_cmds_CXX" | $SED "$delay_single_quote_subst"`' +old_archive_cmds_CXX='`$ECHO "$old_archive_cmds_CXX" | $SED "$delay_single_quote_subst"`' +compiler_CXX='`$ECHO "$compiler_CXX" | $SED "$delay_single_quote_subst"`' +GCC_CXX='`$ECHO "$GCC_CXX" | $SED "$delay_single_quote_subst"`' +lt_prog_compiler_no_builtin_flag_CXX='`$ECHO "$lt_prog_compiler_no_builtin_flag_CXX" | $SED "$delay_single_quote_subst"`' +lt_prog_compiler_pic_CXX='`$ECHO "$lt_prog_compiler_pic_CXX" | $SED "$delay_single_quote_subst"`' +lt_prog_compiler_wl_CXX='`$ECHO "$lt_prog_compiler_wl_CXX" | $SED "$delay_single_quote_subst"`' +lt_prog_compiler_static_CXX='`$ECHO "$lt_prog_compiler_static_CXX" | $SED "$delay_single_quote_subst"`' +lt_cv_prog_compiler_c_o_CXX='`$ECHO "$lt_cv_prog_compiler_c_o_CXX" | $SED "$delay_single_quote_subst"`' +archive_cmds_need_lc_CXX='`$ECHO "$archive_cmds_need_lc_CXX" | $SED "$delay_single_quote_subst"`' +enable_shared_with_static_runtimes_CXX='`$ECHO "$enable_shared_with_static_runtimes_CXX" | $SED "$delay_single_quote_subst"`' +export_dynamic_flag_spec_CXX='`$ECHO "$export_dynamic_flag_spec_CXX" | $SED "$delay_single_quote_subst"`' +whole_archive_flag_spec_CXX='`$ECHO "$whole_archive_flag_spec_CXX" | $SED "$delay_single_quote_subst"`' +compiler_needs_object_CXX='`$ECHO "$compiler_needs_object_CXX" | $SED "$delay_single_quote_subst"`' +old_archive_from_new_cmds_CXX='`$ECHO "$old_archive_from_new_cmds_CXX" | $SED "$delay_single_quote_subst"`' +old_archive_from_expsyms_cmds_CXX='`$ECHO "$old_archive_from_expsyms_cmds_CXX" | $SED "$delay_single_quote_subst"`' +archive_cmds_CXX='`$ECHO "$archive_cmds_CXX" | $SED "$delay_single_quote_subst"`' +archive_expsym_cmds_CXX='`$ECHO "$archive_expsym_cmds_CXX" | $SED "$delay_single_quote_subst"`' +module_cmds_CXX='`$ECHO "$module_cmds_CXX" | $SED "$delay_single_quote_subst"`' +module_expsym_cmds_CXX='`$ECHO "$module_expsym_cmds_CXX" | $SED "$delay_single_quote_subst"`' +with_gnu_ld_CXX='`$ECHO "$with_gnu_ld_CXX" | $SED "$delay_single_quote_subst"`' +allow_undefined_flag_CXX='`$ECHO "$allow_undefined_flag_CXX" | $SED "$delay_single_quote_subst"`' +no_undefined_flag_CXX='`$ECHO "$no_undefined_flag_CXX" | $SED "$delay_single_quote_subst"`' +hardcode_libdir_flag_spec_CXX='`$ECHO "$hardcode_libdir_flag_spec_CXX" | $SED "$delay_single_quote_subst"`' +hardcode_libdir_separator_CXX='`$ECHO "$hardcode_libdir_separator_CXX" | $SED "$delay_single_quote_subst"`' +hardcode_direct_CXX='`$ECHO "$hardcode_direct_CXX" | $SED "$delay_single_quote_subst"`' +hardcode_direct_absolute_CXX='`$ECHO "$hardcode_direct_absolute_CXX" | $SED "$delay_single_quote_subst"`' +hardcode_minus_L_CXX='`$ECHO "$hardcode_minus_L_CXX" | $SED "$delay_single_quote_subst"`' +hardcode_shlibpath_var_CXX='`$ECHO "$hardcode_shlibpath_var_CXX" | $SED "$delay_single_quote_subst"`' +hardcode_automatic_CXX='`$ECHO "$hardcode_automatic_CXX" | $SED "$delay_single_quote_subst"`' +inherit_rpath_CXX='`$ECHO "$inherit_rpath_CXX" | $SED "$delay_single_quote_subst"`' +link_all_deplibs_CXX='`$ECHO "$link_all_deplibs_CXX" | $SED "$delay_single_quote_subst"`' +always_export_symbols_CXX='`$ECHO "$always_export_symbols_CXX" | $SED "$delay_single_quote_subst"`' +export_symbols_cmds_CXX='`$ECHO "$export_symbols_cmds_CXX" | $SED "$delay_single_quote_subst"`' +exclude_expsyms_CXX='`$ECHO "$exclude_expsyms_CXX" | $SED "$delay_single_quote_subst"`' +include_expsyms_CXX='`$ECHO "$include_expsyms_CXX" | $SED "$delay_single_quote_subst"`' +prelink_cmds_CXX='`$ECHO "$prelink_cmds_CXX" | $SED "$delay_single_quote_subst"`' +postlink_cmds_CXX='`$ECHO "$postlink_cmds_CXX" | $SED "$delay_single_quote_subst"`' +file_list_spec_CXX='`$ECHO "$file_list_spec_CXX" | $SED "$delay_single_quote_subst"`' +hardcode_action_CXX='`$ECHO "$hardcode_action_CXX" | $SED "$delay_single_quote_subst"`' +compiler_lib_search_dirs_CXX='`$ECHO "$compiler_lib_search_dirs_CXX" | $SED "$delay_single_quote_subst"`' +predep_objects_CXX='`$ECHO "$predep_objects_CXX" | $SED "$delay_single_quote_subst"`' +postdep_objects_CXX='`$ECHO "$postdep_objects_CXX" | $SED "$delay_single_quote_subst"`' +predeps_CXX='`$ECHO "$predeps_CXX" | $SED "$delay_single_quote_subst"`' +postdeps_CXX='`$ECHO "$postdeps_CXX" | $SED "$delay_single_quote_subst"`' +compiler_lib_search_path_CXX='`$ECHO "$compiler_lib_search_path_CXX" | $SED "$delay_single_quote_subst"`' LTCC='$LTCC' LTCFLAGS='$LTCFLAGS' compiler='$compiler_DEFAULT' +# A function that is used when there is no print builtin or printf. +func_fallback_echo () +{ + eval 'cat <<_LTECHO_EOF +\$1 +_LTECHO_EOF' +} + # Quote evaled strings. -for var in SED \ +for var in SHELL \ +ECHO \ +PATH_SEPARATOR \ +SED \ GREP \ EGREP \ FGREP \ @@ -23975,8 +26757,13 @@ OBJDUMP \ deplibs_check_method \ file_magic_cmd \ +file_magic_glob \ +want_nocaseglob \ +DLLTOOL \ +sharedlib_from_linklib_cmd \ AR \ AR_FLAGS \ +archiver_list_spec \ STRIP \ RANLIB \ CC \ @@ -23986,14 +26773,14 @@ lt_cv_sys_global_symbol_to_cdecl \ lt_cv_sys_global_symbol_to_c_name_address \ lt_cv_sys_global_symbol_to_c_name_address_lib_prefix \ -SHELL \ -ECHO \ +nm_file_list_spec \ lt_prog_compiler_no_builtin_flag \ -lt_prog_compiler_wl \ lt_prog_compiler_pic \ +lt_prog_compiler_wl \ lt_prog_compiler_static \ lt_cv_prog_compiler_c_o \ need_locks \ +MANIFEST_TOOL \ DSYMUTIL \ NMEDIT \ LIPO \ @@ -24007,9 +26794,7 @@ allow_undefined_flag \ no_undefined_flag \ hardcode_libdir_flag_spec \ -hardcode_libdir_flag_spec_ld \ hardcode_libdir_separator \ -fix_srcfile_path \ exclude_expsyms \ include_expsyms \ file_list_spec \ @@ -24017,6 +26802,7 @@ libname_spec \ library_names_spec \ soname_spec \ +install_override_mode \ finish_eval \ old_striplib \ striplib \ @@ -24027,10 +26813,11 @@ postdeps \ compiler_lib_search_path \ LD_CXX \ +reload_flag_CXX \ compiler_CXX \ lt_prog_compiler_no_builtin_flag_CXX \ -lt_prog_compiler_wl_CXX \ lt_prog_compiler_pic_CXX \ +lt_prog_compiler_wl_CXX \ lt_prog_compiler_static_CXX \ lt_cv_prog_compiler_c_o_CXX \ export_dynamic_flag_spec_CXX \ @@ -24040,9 +26827,7 @@ allow_undefined_flag_CXX \ no_undefined_flag_CXX \ hardcode_libdir_flag_spec_CXX \ -hardcode_libdir_flag_spec_ld_CXX \ hardcode_libdir_separator_CXX \ -fix_srcfile_path_CXX \ exclude_expsyms_CXX \ include_expsyms_CXX \ file_list_spec_CXX \ @@ -24052,9 +26837,9 @@ predeps_CXX \ postdeps_CXX \ compiler_lib_search_path_CXX; do - case \`eval \\\\\$ECHO "X\\\\\$\$var"\` in + case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in *[\\\\\\\`\\"\\\$]*) - eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"X\\\$\$var\\" | \\\$Xsed -e \\"\\\$sed_quote_subst\\"\\\`\\\\\\"" + eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED \\"\\\$sed_quote_subst\\"\\\`\\\\\\"" ;; *) eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\"" @@ -24076,11 +26861,13 @@ module_expsym_cmds \ export_symbols_cmds \ prelink_cmds \ +postlink_cmds \ postinstall_cmds \ postuninstall_cmds \ finish_cmds \ sys_lib_search_path_spec \ sys_lib_dlsearch_path_spec \ +reload_cmds_CXX \ old_archive_cmds_CXX \ old_archive_from_new_cmds_CXX \ old_archive_from_expsyms_cmds_CXX \ @@ -24089,10 +26876,11 @@ module_cmds_CXX \ module_expsym_cmds_CXX \ export_symbols_cmds_CXX \ -prelink_cmds_CXX; do - case \`eval \\\\\$ECHO "X\\\\\$\$var"\` in +prelink_cmds_CXX \ +postlink_cmds_CXX; do + case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in *[\\\\\\\`\\"\\\$]*) - eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"X\\\$\$var\\" | \\\$Xsed -e \\"\\\$double_quote_subst\\" -e \\"\\\$sed_quote_subst\\" -e \\"\\\$delay_variable_subst\\"\\\`\\\\\\"" + eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED -e \\"\\\$double_quote_subst\\" -e \\"\\\$sed_quote_subst\\" -e \\"\\\$delay_variable_subst\\"\\\`\\\\\\"" ;; *) eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\"" @@ -24100,12 +26888,6 @@ esac done -# Fix-up fallback echo if it was mangled by the above quoting rules. -case \$lt_ECHO in -*'\\\$0 --fallback-echo"') lt_ECHO=\`\$ECHO "X\$lt_ECHO" | \$Xsed -e 's/\\\\\\\\\\\\\\\$0 --fallback-echo"\$/\$0 --fallback-echo"/'\` - ;; -esac - ac_aux_dir='$ac_aux_dir' xsi_shell='$xsi_shell' lt_shell_append='$lt_shell_append' @@ -24146,6 +26928,8 @@ "libdap.pc") CONFIG_FILES="$CONFIG_FILES libdap.pc" ;; "libdapclient.pc") CONFIG_FILES="$CONFIG_FILES libdapclient.pc" ;; "libdapserver.pc") CONFIG_FILES="$CONFIG_FILES libdapserver.pc" ;; + "main_page.doxygen") CONFIG_FILES="$CONFIG_FILES main_page.doxygen" ;; + "doxy.conf") CONFIG_FILES="$CONFIG_FILES doxy.conf" ;; "gl/Makefile") CONFIG_FILES="$CONFIG_FILES gl/Makefile" ;; "tests/Makefile") CONFIG_FILES="$CONFIG_FILES tests/Makefile" ;; "tests/atlocal") CONFIG_FILES="$CONFIG_FILES tests/atlocal" ;; @@ -24153,7 +26937,7 @@ "unit-tests/cache-testsuite/Makefile") CONFIG_FILES="$CONFIG_FILES unit-tests/cache-testsuite/Makefile" ;; "dap-config") CONFIG_FILES="$CONFIG_FILES dap-config" ;; - *) as_fn_error "invalid argument: \`$ac_config_target'" "$LINENO" 5;; + *) as_fn_error $? "invalid argument: \`$ac_config_target'" "$LINENO" 5;; esac done @@ -24176,9 +26960,10 @@ # after its creation but before its name has been assigned to `$tmp'. $debug || { - tmp= + tmp= ac_tmp= trap 'exit_status=$? - { test -z "$tmp" || test ! -d "$tmp" || rm -fr "$tmp"; } && exit $exit_status + : "${ac_tmp:=$tmp}" + { test ! -d "$ac_tmp" || rm -fr "$ac_tmp"; } && exit $exit_status ' 0 trap 'as_fn_exit 1' 1 2 13 15 } @@ -24186,12 +26971,13 @@ { tmp=`(umask 077 && mktemp -d "./confXXXXXX") 2>/dev/null` && - test -n "$tmp" && test -d "$tmp" + test -d "$tmp" } || { tmp=./conf$$-$RANDOM (umask 077 && mkdir "$tmp") -} || as_fn_error "cannot create a temporary directory in ." "$LINENO" 5 +} || as_fn_error $? "cannot create a temporary directory in ." "$LINENO" 5 +ac_tmp=$tmp # Set up the scripts for CONFIG_FILES section. # No need to generate them if there are no CONFIG_FILES. @@ -24208,12 +26994,12 @@ fi ac_cs_awk_cr=`$AWK 'BEGIN { print "a\rb" }' /dev/null` if test "$ac_cs_awk_cr" = "a${ac_cr}b"; then - ac_cs_awk_cr='\r' + ac_cs_awk_cr='\\r' else ac_cs_awk_cr=$ac_cr fi -echo 'BEGIN {' >"$tmp/subs1.awk" && +echo 'BEGIN {' >"$ac_tmp/subs1.awk" && _ACEOF @@ -24222,18 +27008,18 @@ echo "$ac_subst_vars" | sed 's/.*/&!$&$ac_delim/' && echo "_ACEOF" } >conf$$subs.sh || - as_fn_error "could not make $CONFIG_STATUS" "$LINENO" 5 -ac_delim_num=`echo "$ac_subst_vars" | grep -c '$'` + as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 +ac_delim_num=`echo "$ac_subst_vars" | grep -c '^'` ac_delim='%!_!# ' for ac_last_try in false false false false false :; do . ./conf$$subs.sh || - as_fn_error "could not make $CONFIG_STATUS" "$LINENO" 5 + as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 ac_delim_n=`sed -n "s/.*$ac_delim\$/X/p" conf$$subs.awk | grep -c X` if test $ac_delim_n = $ac_delim_num; then break elif $ac_last_try; then - as_fn_error "could not make $CONFIG_STATUS" "$LINENO" 5 + as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 else ac_delim="$ac_delim!$ac_delim _$ac_delim!! " fi @@ -24241,7 +27027,7 @@ rm -f conf$$subs.sh cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 -cat >>"\$tmp/subs1.awk" <<\\_ACAWK && +cat >>"\$ac_tmp/subs1.awk" <<\\_ACAWK && _ACEOF sed -n ' h @@ -24289,7 +27075,7 @@ rm -f conf$$subs.awk cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 _ACAWK -cat >>"\$tmp/subs1.awk" <<_ACAWK && +cat >>"\$ac_tmp/subs1.awk" <<_ACAWK && for (key in S) S_is_set[key] = 1 FS = "" @@ -24321,21 +27107,29 @@ sed "s/$ac_cr\$//; s/$ac_cr/$ac_cs_awk_cr/g" else cat -fi < "$tmp/subs1.awk" > "$tmp/subs.awk" \ - || as_fn_error "could not setup config files machinery" "$LINENO" 5 +fi < "$ac_tmp/subs1.awk" > "$ac_tmp/subs.awk" \ + || as_fn_error $? "could not setup config files machinery" "$LINENO" 5 _ACEOF -# VPATH may cause trouble with some makes, so we remove $(srcdir), -# ${srcdir} and @srcdir@ from VPATH if srcdir is ".", strip leading and +# VPATH may cause trouble with some makes, so we remove sole $(srcdir), +# ${srcdir} and @srcdir@ entries from VPATH if srcdir is ".", strip leading and # trailing colons and then remove the whole line if VPATH becomes empty # (actually we leave an empty line to preserve line numbers). if test "x$srcdir" = x.; then - ac_vpsub='/^[ ]*VPATH[ ]*=/{ -s/:*\$(srcdir):*/:/ -s/:*\${srcdir}:*/:/ -s/:*@srcdir@:*/:/ -s/^\([^=]*=[ ]*\):*/\1/ + ac_vpsub='/^[ ]*VPATH[ ]*=[ ]*/{ +h +s/// +s/^/:/ +s/[ ]*$/:/ +s/:\$(srcdir):/:/g +s/:\${srcdir}:/:/g +s/:@srcdir@:/:/g +s/^:*// s/:*$// +x +s/\(=[ ]*\).*/\1/ +G +s/\n// s/^[^=]*=[ ]*$// }' fi @@ -24347,7 +27141,7 @@ # No need to generate them if there are no CONFIG_HEADERS. # This happens for instance with `./config.status Makefile'. if test -n "$CONFIG_HEADERS"; then -cat >"$tmp/defines.awk" <<\_ACAWK || +cat >"$ac_tmp/defines.awk" <<\_ACAWK || BEGIN { _ACEOF @@ -24359,11 +27153,11 @@ # handling of long lines. ac_delim='%!_!# ' for ac_last_try in false false :; do - ac_t=`sed -n "/$ac_delim/p" confdefs.h` - if test -z "$ac_t"; then + ac_tt=`sed -n "/$ac_delim/p" confdefs.h` + if test -z "$ac_tt"; then break elif $ac_last_try; then - as_fn_error "could not make $CONFIG_HEADERS" "$LINENO" 5 + as_fn_error $? "could not make $CONFIG_HEADERS" "$LINENO" 5 else ac_delim="$ac_delim!$ac_delim _$ac_delim!! " fi @@ -24448,7 +27242,7 @@ _ACAWK _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 - as_fn_error "could not setup config headers machinery" "$LINENO" 5 + as_fn_error $? "could not setup config headers machinery" "$LINENO" 5 fi # test -n "$CONFIG_HEADERS" @@ -24461,7 +27255,7 @@ esac case $ac_mode$ac_tag in :[FHL]*:*);; - :L* | :C*:*) as_fn_error "invalid tag \`$ac_tag'" "$LINENO" 5;; + :L* | :C*:*) as_fn_error $? "invalid tag \`$ac_tag'" "$LINENO" 5;; :[FH]-) ac_tag=-:-;; :[FH]*) ac_tag=$ac_tag:$ac_tag.in;; esac @@ -24480,7 +27274,7 @@ for ac_f do case $ac_f in - -) ac_f="$tmp/stdin";; + -) ac_f="$ac_tmp/stdin";; *) # Look for the file first in the build tree, then in the source tree # (if the path is not absolute). The absolute path cannot be DOS-style, # because $ac_f cannot contain `:'. @@ -24489,7 +27283,7 @@ [\\/$]*) false;; *) test -f "$srcdir/$ac_f" && ac_f="$srcdir/$ac_f";; esac || - as_fn_error "cannot find input file: \`$ac_f'" "$LINENO" 5;; + as_fn_error 1 "cannot find input file: \`$ac_f'" "$LINENO" 5;; esac case $ac_f in *\'*) ac_f=`$as_echo "$ac_f" | sed "s/'/'\\\\\\\\''/g"`;; esac as_fn_append ac_file_inputs " '$ac_f'" @@ -24515,8 +27309,8 @@ esac case $ac_tag in - *:-:* | *:-) cat >"$tmp/stdin" \ - || as_fn_error "could not create $ac_file" "$LINENO" 5 ;; + *:-:* | *:-) cat >"$ac_tmp/stdin" \ + || as_fn_error $? "could not create $ac_file" "$LINENO" 5 ;; esac ;; esac @@ -24652,23 +27446,24 @@ s&@MKDIR_P@&$ac_MKDIR_P&;t t $ac_datarootdir_hack " -eval sed \"\$ac_sed_extra\" "$ac_file_inputs" | $AWK -f "$tmp/subs.awk" >$tmp/out \ - || as_fn_error "could not create $ac_file" "$LINENO" 5 +eval sed \"\$ac_sed_extra\" "$ac_file_inputs" | $AWK -f "$ac_tmp/subs.awk" \ + >$ac_tmp/out || as_fn_error $? "could not create $ac_file" "$LINENO" 5 test -z "$ac_datarootdir_hack$ac_datarootdir_seen" && - { ac_out=`sed -n '/\${datarootdir}/p' "$tmp/out"`; test -n "$ac_out"; } && - { ac_out=`sed -n '/^[ ]*datarootdir[ ]*:*=/p' "$tmp/out"`; test -z "$ac_out"; } && + { ac_out=`sed -n '/\${datarootdir}/p' "$ac_tmp/out"`; test -n "$ac_out"; } && + { ac_out=`sed -n '/^[ ]*datarootdir[ ]*:*=/p' \ + "$ac_tmp/out"`; test -z "$ac_out"; } && { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file contains a reference to the variable \`datarootdir' -which seems to be undefined. Please make sure it is defined." >&5 +which seems to be undefined. Please make sure it is defined" >&5 $as_echo "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir' -which seems to be undefined. Please make sure it is defined." >&2;} +which seems to be undefined. Please make sure it is defined" >&2;} - rm -f "$tmp/stdin" + rm -f "$ac_tmp/stdin" case $ac_file in - -) cat "$tmp/out" && rm -f "$tmp/out";; - *) rm -f "$ac_file" && mv "$tmp/out" "$ac_file";; + -) cat "$ac_tmp/out" && rm -f "$ac_tmp/out";; + *) rm -f "$ac_file" && mv "$ac_tmp/out" "$ac_file";; esac \ - || as_fn_error "could not create $ac_file" "$LINENO" 5 + || as_fn_error $? "could not create $ac_file" "$LINENO" 5 ;; :H) # @@ -24677,21 +27472,21 @@ if test x"$ac_file" != x-; then { $as_echo "/* $configure_input */" \ - && eval '$AWK -f "$tmp/defines.awk"' "$ac_file_inputs" - } >"$tmp/config.h" \ - || as_fn_error "could not create $ac_file" "$LINENO" 5 - if diff "$ac_file" "$tmp/config.h" >/dev/null 2>&1; then + && eval '$AWK -f "$ac_tmp/defines.awk"' "$ac_file_inputs" + } >"$ac_tmp/config.h" \ + || as_fn_error $? "could not create $ac_file" "$LINENO" 5 + if diff "$ac_file" "$ac_tmp/config.h" >/dev/null 2>&1; then { $as_echo "$as_me:${as_lineno-$LINENO}: $ac_file is unchanged" >&5 $as_echo "$as_me: $ac_file is unchanged" >&6;} else rm -f "$ac_file" - mv "$tmp/config.h" "$ac_file" \ - || as_fn_error "could not create $ac_file" "$LINENO" 5 + mv "$ac_tmp/config.h" "$ac_file" \ + || as_fn_error $? "could not create $ac_file" "$LINENO" 5 fi else $as_echo "/* $configure_input */" \ - && eval '$AWK -f "$tmp/defines.awk"' "$ac_file_inputs" \ - || as_fn_error "could not create -" "$LINENO" 5 + && eval '$AWK -f "$ac_tmp/defines.awk"' "$ac_file_inputs" \ + || as_fn_error $? "could not create -" "$LINENO" 5 fi # Compute "$ac_file"'s index in $config_headers. _am_arg="$ac_file" @@ -24739,7 +27534,7 @@ "tests/atconfig":C) cat >tests/atconfig <> "$cfgfile" \ - || (rm -f "$cfgfile"; exit 1) - - case $xsi_shell in - yes) - cat << \_LT_EOF >> "$cfgfile" - -# func_dirname file append nondir_replacement -# Compute the dirname of FILE. If nonempty, add APPEND to the result, -# otherwise set result to NONDIR_REPLACEMENT. -func_dirname () -{ - case ${1} in - */*) func_dirname_result="${1%/*}${2}" ;; - * ) func_dirname_result="${3}" ;; - esac -} - -# func_basename file -func_basename () -{ - func_basename_result="${1##*/}" -} - -# func_dirname_and_basename file append nondir_replacement -# perform func_basename and func_dirname in a single function -# call: -# dirname: Compute the dirname of FILE. If nonempty, -# add APPEND to the result, otherwise set result -# to NONDIR_REPLACEMENT. -# value returned in "$func_dirname_result" -# basename: Compute filename of FILE. -# value retuned in "$func_basename_result" -# Implementation must be kept synchronized with func_dirname -# and func_basename. For efficiency, we do not delegate to -# those functions but instead duplicate the functionality here. -func_dirname_and_basename () -{ - case ${1} in - */*) func_dirname_result="${1%/*}${2}" ;; - * ) func_dirname_result="${3}" ;; - esac - func_basename_result="${1##*/}" -} - -# func_stripname prefix suffix name -# strip PREFIX and SUFFIX off of NAME. -# PREFIX and SUFFIX must not contain globbing or regex special -# characters, hashes, percent signs, but SUFFIX may contain a leading -# dot (in which case that matches only a dot). -func_stripname () -{ - # pdksh 5.2.14 does not do ${X%$Y} correctly if both X and Y are - # positional parameters, so assign one to ordinary parameter first. - func_stripname_result=${3} - func_stripname_result=${func_stripname_result#"${1}"} - func_stripname_result=${func_stripname_result%"${2}"} -} - -# func_opt_split -func_opt_split () -{ - func_opt_split_opt=${1%%=*} - func_opt_split_arg=${1#*=} -} - -# func_lo2o object -func_lo2o () -{ - case ${1} in - *.lo) func_lo2o_result=${1%.lo}.${objext} ;; - *) func_lo2o_result=${1} ;; - esac -} - -# func_xform libobj-or-source -func_xform () -{ - func_xform_result=${1%.*}.lo -} - -# func_arith arithmetic-term... -func_arith () -{ - func_arith_result=$(( $* )) -} - -# func_len string -# STRING may not start with a hyphen. -func_len () -{ - func_len_result=${#1} -} - -_LT_EOF - ;; - *) # Bourne compatible functions. - cat << \_LT_EOF >> "$cfgfile" - -# func_dirname file append nondir_replacement -# Compute the dirname of FILE. If nonempty, add APPEND to the result, -# otherwise set result to NONDIR_REPLACEMENT. -func_dirname () -{ - # Extract subdirectory from the argument. - func_dirname_result=`$ECHO "X${1}" | $Xsed -e "$dirname"` - if test "X$func_dirname_result" = "X${1}"; then - func_dirname_result="${3}" - else - func_dirname_result="$func_dirname_result${2}" - fi -} - -# func_basename file -func_basename () -{ - func_basename_result=`$ECHO "X${1}" | $Xsed -e "$basename"` -} - - -# func_stripname prefix suffix name -# strip PREFIX and SUFFIX off of NAME. -# PREFIX and SUFFIX must not contain globbing or regex special -# characters, hashes, percent signs, but SUFFIX may contain a leading -# dot (in which case that matches only a dot). -# func_strip_suffix prefix name -func_stripname () -{ - case ${2} in - .*) func_stripname_result=`$ECHO "X${3}" \ - | $Xsed -e "s%^${1}%%" -e "s%\\\\${2}\$%%"`;; - *) func_stripname_result=`$ECHO "X${3}" \ - | $Xsed -e "s%^${1}%%" -e "s%${2}\$%%"`;; - esac -} - -# sed scripts: -my_sed_long_opt='1s/^\(-[^=]*\)=.*/\1/;q' -my_sed_long_arg='1s/^-[^=]*=//' - -# func_opt_split -func_opt_split () -{ - func_opt_split_opt=`$ECHO "X${1}" | $Xsed -e "$my_sed_long_opt"` - func_opt_split_arg=`$ECHO "X${1}" | $Xsed -e "$my_sed_long_arg"` -} - -# func_lo2o object -func_lo2o () -{ - func_lo2o_result=`$ECHO "X${1}" | $Xsed -e "$lo2o"` -} - -# func_xform libobj-or-source -func_xform () -{ - func_xform_result=`$ECHO "X${1}" | $Xsed -e 's/\.[^.]*$/.lo/'` -} - -# func_arith arithmetic-term... -func_arith () -{ - func_arith_result=`expr "$@"` -} - -# func_len string -# STRING may not start with a hyphen. -func_len () -{ - func_len_result=`expr "$1" : ".*" 2>/dev/null || echo $max_cmd_len` -} - -_LT_EOF -esac - -case $lt_shell_append in - yes) - cat << \_LT_EOF >> "$cfgfile" - -# func_append var value -# Append VALUE to the end of shell variable VAR. -func_append () -{ - eval "$1+=\$2" -} -_LT_EOF - ;; - *) - cat << \_LT_EOF >> "$cfgfile" - -# func_append var value -# Append VALUE to the end of shell variable VAR. -func_append () -{ - eval "$1=\$$1\$2" -} - -_LT_EOF - ;; - esac + sed '$q' "$ltmain" >> "$cfgfile" \ + || (rm -f "$cfgfile"; exit 1) + if test x"$xsi_shell" = xyes; then + sed -e '/^func_dirname ()$/,/^} # func_dirname /c\ +func_dirname ()\ +{\ +\ case ${1} in\ +\ */*) func_dirname_result="${1%/*}${2}" ;;\ +\ * ) func_dirname_result="${3}" ;;\ +\ esac\ +} # Extended-shell func_dirname implementation' "$cfgfile" > $cfgfile.tmp \ + && mv -f "$cfgfile.tmp" "$cfgfile" \ + || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") +test 0 -eq $? || _lt_function_replace_fail=: + + + sed -e '/^func_basename ()$/,/^} # func_basename /c\ +func_basename ()\ +{\ +\ func_basename_result="${1##*/}"\ +} # Extended-shell func_basename implementation' "$cfgfile" > $cfgfile.tmp \ + && mv -f "$cfgfile.tmp" "$cfgfile" \ + || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") +test 0 -eq $? || _lt_function_replace_fail=: + + + sed -e '/^func_dirname_and_basename ()$/,/^} # func_dirname_and_basename /c\ +func_dirname_and_basename ()\ +{\ +\ case ${1} in\ +\ */*) func_dirname_result="${1%/*}${2}" ;;\ +\ * ) func_dirname_result="${3}" ;;\ +\ esac\ +\ func_basename_result="${1##*/}"\ +} # Extended-shell func_dirname_and_basename implementation' "$cfgfile" > $cfgfile.tmp \ + && mv -f "$cfgfile.tmp" "$cfgfile" \ + || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") +test 0 -eq $? || _lt_function_replace_fail=: + + + sed -e '/^func_stripname ()$/,/^} # func_stripname /c\ +func_stripname ()\ +{\ +\ # pdksh 5.2.14 does not do ${X%$Y} correctly if both X and Y are\ +\ # positional parameters, so assign one to ordinary parameter first.\ +\ func_stripname_result=${3}\ +\ func_stripname_result=${func_stripname_result#"${1}"}\ +\ func_stripname_result=${func_stripname_result%"${2}"}\ +} # Extended-shell func_stripname implementation' "$cfgfile" > $cfgfile.tmp \ + && mv -f "$cfgfile.tmp" "$cfgfile" \ + || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") +test 0 -eq $? || _lt_function_replace_fail=: + + + sed -e '/^func_split_long_opt ()$/,/^} # func_split_long_opt /c\ +func_split_long_opt ()\ +{\ +\ func_split_long_opt_name=${1%%=*}\ +\ func_split_long_opt_arg=${1#*=}\ +} # Extended-shell func_split_long_opt implementation' "$cfgfile" > $cfgfile.tmp \ + && mv -f "$cfgfile.tmp" "$cfgfile" \ + || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") +test 0 -eq $? || _lt_function_replace_fail=: + + + sed -e '/^func_split_short_opt ()$/,/^} # func_split_short_opt /c\ +func_split_short_opt ()\ +{\ +\ func_split_short_opt_arg=${1#??}\ +\ func_split_short_opt_name=${1%"$func_split_short_opt_arg"}\ +} # Extended-shell func_split_short_opt implementation' "$cfgfile" > $cfgfile.tmp \ + && mv -f "$cfgfile.tmp" "$cfgfile" \ + || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") +test 0 -eq $? || _lt_function_replace_fail=: + + + sed -e '/^func_lo2o ()$/,/^} # func_lo2o /c\ +func_lo2o ()\ +{\ +\ case ${1} in\ +\ *.lo) func_lo2o_result=${1%.lo}.${objext} ;;\ +\ *) func_lo2o_result=${1} ;;\ +\ esac\ +} # Extended-shell func_lo2o implementation' "$cfgfile" > $cfgfile.tmp \ + && mv -f "$cfgfile.tmp" "$cfgfile" \ + || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") +test 0 -eq $? || _lt_function_replace_fail=: + + + sed -e '/^func_xform ()$/,/^} # func_xform /c\ +func_xform ()\ +{\ + func_xform_result=${1%.*}.lo\ +} # Extended-shell func_xform implementation' "$cfgfile" > $cfgfile.tmp \ + && mv -f "$cfgfile.tmp" "$cfgfile" \ + || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") +test 0 -eq $? || _lt_function_replace_fail=: + + + sed -e '/^func_arith ()$/,/^} # func_arith /c\ +func_arith ()\ +{\ + func_arith_result=$(( $* ))\ +} # Extended-shell func_arith implementation' "$cfgfile" > $cfgfile.tmp \ + && mv -f "$cfgfile.tmp" "$cfgfile" \ + || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") +test 0 -eq $? || _lt_function_replace_fail=: + + + sed -e '/^func_len ()$/,/^} # func_len /c\ +func_len ()\ +{\ + func_len_result=${#1}\ +} # Extended-shell func_len implementation' "$cfgfile" > $cfgfile.tmp \ + && mv -f "$cfgfile.tmp" "$cfgfile" \ + || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") +test 0 -eq $? || _lt_function_replace_fail=: + +fi + +if test x"$lt_shell_append" = xyes; then + sed -e '/^func_append ()$/,/^} # func_append /c\ +func_append ()\ +{\ + eval "${1}+=\\${2}"\ +} # Extended-shell func_append implementation' "$cfgfile" > $cfgfile.tmp \ + && mv -f "$cfgfile.tmp" "$cfgfile" \ + || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") +test 0 -eq $? || _lt_function_replace_fail=: + + + sed -e '/^func_append_quoted ()$/,/^} # func_append_quoted /c\ +func_append_quoted ()\ +{\ +\ func_quote_for_eval "${2}"\ +\ eval "${1}+=\\\\ \\$func_quote_for_eval_result"\ +} # Extended-shell func_append_quoted implementation' "$cfgfile" > $cfgfile.tmp \ + && mv -f "$cfgfile.tmp" "$cfgfile" \ + || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") +test 0 -eq $? || _lt_function_replace_fail=: + + + # Save a `func_append' function call where possible by direct use of '+=' + sed -e 's%func_append \([a-zA-Z_]\{1,\}\) "%\1+="%g' $cfgfile > $cfgfile.tmp \ + && mv -f "$cfgfile.tmp" "$cfgfile" \ + || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") + test 0 -eq $? || _lt_function_replace_fail=: +else + # Save a `func_append' function call even when '+=' is not available + sed -e 's%func_append \([a-zA-Z_]\{1,\}\) "%\1="$\1%g' $cfgfile > $cfgfile.tmp \ + && mv -f "$cfgfile.tmp" "$cfgfile" \ + || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") + test 0 -eq $? || _lt_function_replace_fail=: +fi + +if test x"$_lt_function_replace_fail" = x":"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Unable to substitute extended shell functions in $ofile" >&5 +$as_echo "$as_me: WARNING: Unable to substitute extended shell functions in $ofile" >&2;} +fi - sed -n '/^# Generated shell functions inserted here/,$p' "$ltmain" >> "$cfgfile" \ - || (rm -f "$cfgfile"; exit 1) - mv -f "$cfgfile" "$ofile" || + mv -f "$cfgfile" "$ofile" || (rm -f "$ofile" && cp "$cfgfile" "$ofile" && rm -f "$cfgfile") chmod +x "$ofile" @@ -25510,6 +28298,10 @@ # The linker used to build libraries. LD=$lt_LD_CXX +# How to create reloadable object files. +reload_flag=$lt_reload_flag_CXX +reload_cmds=$lt_reload_cmds_CXX + # Commands used to build an old-style archive. old_archive_cmds=$lt_old_archive_cmds_CXX @@ -25522,12 +28314,12 @@ # Compiler flag to turn off builtin functions. no_builtin_flag=$lt_lt_prog_compiler_no_builtin_flag_CXX -# How to pass a linker flag through the compiler. -wl=$lt_lt_prog_compiler_wl_CXX - # Additional compiler flags for building library objects. pic_flag=$lt_lt_prog_compiler_pic_CXX +# How to pass a linker flag through the compiler. +wl=$lt_lt_prog_compiler_wl_CXX + # Compiler flag to prevent dynamic linking. link_static_flag=$lt_lt_prog_compiler_static_CXX @@ -25577,10 +28369,6 @@ # This must work even if \$libdir does not exist hardcode_libdir_flag_spec=$lt_hardcode_libdir_flag_spec_CXX -# If ld is used when linking, flag to hardcode \$libdir into a binary -# during linking. This must work even if \$libdir does not exist. -hardcode_libdir_flag_spec_ld=$lt_hardcode_libdir_flag_spec_ld_CXX - # Whether we need a single "-rpath" flag with a separated argument. hardcode_libdir_separator=$lt_hardcode_libdir_separator_CXX @@ -25614,9 +28402,6 @@ # Whether libtool must link a program against all its dependency libraries. link_all_deplibs=$link_all_deplibs_CXX -# Fix the shell variable \$srcfile for the compiler. -fix_srcfile_path=$lt_fix_srcfile_path_CXX - # Set to "yes" if exported symbols are required. always_export_symbols=$always_export_symbols_CXX @@ -25632,6 +28417,9 @@ # Commands necessary for linking programs (against libraries) with templates. prelink_cmds=$lt_prelink_cmds_CXX +# Commands necessary for finishing linking programs. +postlink_cmds=$lt_postlink_cmds_CXX + # Specify filename containing input files. file_list_spec=$lt_file_list_spec_CXX @@ -25667,7 +28455,7 @@ ac_clean_files=$ac_clean_files_save test $ac_write_fail = 0 || - as_fn_error "write failure creating $CONFIG_STATUS" "$LINENO" 5 + as_fn_error $? "write failure creating $CONFIG_STATUS" "$LINENO" 5 # configure is writing to config.log, and then calls config.status. @@ -25688,7 +28476,7 @@ exec 5>>config.log # Use ||, not &&, to avoid exiting from the if with $? = 1, which # would make configure fail if this is the last instruction. - $ac_cs_success || as_fn_exit $? + $ac_cs_success || as_fn_exit 1 fi if test -n "$ac_unrecognized_opts" && test "$enable_option_checking" != no; then { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: unrecognized options: $ac_unrecognized_opts" >&5 diff -Nru libdap-3.11.1/configure.ac libdap-3.12.0/configure.ac --- libdap-3.11.1/configure.ac 2011-04-29 13:19:42.000000000 +0000 +++ libdap-3.12.0/configure.ac 2013-10-17 21:27:40.000000000 +0000 @@ -2,28 +2,25 @@ dnl -*- autoconf -*- dnl Process this file with autoconf to produce a configure script. -AC_PREREQ(2.62) +AC_PREREQ(2.61) dnl Update version here and below at LIB_CURRENT, ..., if needed. -AC_INIT(libdap, 3.11.1, opendap-tech@opendap.org) +AC_INIT(libdap, 3.12.0, opendap-tech@opendap.org) AC_DEFINE(DAP_PROTOCOL_VERSION, ["3.4"], [Highest DAP version implemented?]) AC_SUBST(DAP_PROTOCOL_VERSION) AC_CONFIG_SRCDIR([Connect.cc]) AC_CONFIG_AUX_DIR(conf) -AM_CONFIG_HEADER([config.h dods-datatypes-config.h xdr-datatypes-config.h]) +AC_CONFIG_HEADERS([config.h dods-datatypes-config.h xdr-datatypes-config.h]) AC_CONFIG_MACRO_DIR([conf]) AM_INIT_AUTOMAKE AC_CONFIG_TESTDIR(tests, [.]) -dnl AC_DEFINE([FILE_METHODS], [1], [Define this to activate the old FILE * methods.]) - AC_DEFINE(CNAME, "libdap", [What sort of HTTP client is this?]) AC_DEFINE_UNQUOTED(CVER, "$PACKAGE_VERSION", [Client version number]) AC_DEFINE_UNQUOTED(DVR, "libdap/$PACKAGE_VERSION", [Client name and version combined]) AC_SUBST(DVR) - PACKAGE_MAJOR_VERSION=`echo $PACKAGE_VERSION | sed 's@^\([[0-9]]\)*\.\([[0-9]]*\)\.\([[0-9]]*\)$@\1@'` PACKAGE_MINOR_VERSION=`echo $PACKAGE_VERSION | sed 's@^\([[0-9]]\)*\.\([[0-9]]*\)\.\([[0-9]]*\)$@\2@'` PACKAGE_SUBMINOR_VERSION=`echo $PACKAGE_VERSION | sed 's@^\([[0-9]]\)*\.\([[0-9]]*\)\.\([[0-9]]*\)$@\3@'` @@ -34,8 +31,6 @@ AC_SUBST(PACKAGE_MINOR_VERSION) AC_SUBST(PACKAGE_SUBMINOR_VERSION) - - AC_DEFINE(EVAL, 1, [Should all the classes run ConstraintEvaluator::eval()?]) AC_SUBST(EVAL) @@ -46,10 +41,8 @@ AC_CANONICAL_HOST AC_SUBST(host) -dnl library version: Update these when the interface changes. Generally, -dnl assume that the interface tracks the major and minor release numbers. -DAPLIB_CURRENT=14 -DAPLIB_AGE=3 +DAPLIB_CURRENT=16 +DAPLIB_AGE=5 DAPLIB_REVISION=0 AC_SUBST(DAPLIB_CURRENT) AC_SUBST(DAPLIB_AGE) @@ -58,8 +51,8 @@ LIBDAP_VERSION="$DAPLIB_CURRENT:$DAPLIB_REVISION:$DAPLIB_AGE" AC_SUBST(LIBDAP_VERSION) -CLIENTLIB_CURRENT=4 -CLIENTLIB_AGE=1 +CLIENTLIB_CURRENT=5 +CLIENTLIB_AGE=2 CLIENTLIB_REVISION=0 AC_SUBST(CLIENTLIB_CURRENT) AC_SUBST(CLIENTLIB_AGE) @@ -68,8 +61,8 @@ CLIENTLIB_VERSION="$CLIENTLIB_CURRENT:$CLIENTLIB_REVISION:$CLIENTLIB_AGE" AC_SUBST(CLIENTLIB_VERSION) -SERVERLIB_CURRENT=9 -SERVERLIB_AGE=2 +SERVERLIB_CURRENT=12 +SERVERLIB_AGE=5 SERVERLIB_REVISION=0 AC_SUBST(SERVERLIB_CURRENT) AC_SUBST(SERVERLIB_AGE) @@ -86,6 +79,14 @@ dnl Call this gnulib macro right after a working C Compiler is found gl_EARLY +dnl echo "CC = $CC" +if test "$CC" = "gcc" +then + AM_CONDITIONAL([COMPILER_IS_GCC],[true]) +else + AM_CONDITIONAL([COMPILER_IS_GCC],[false]) +fi + AM_PROG_LEX AC_PROG_INSTALL AC_PROG_LN_S @@ -101,6 +102,7 @@ AC_HEADER_DIRENT AC_HEADER_STDC AC_HEADER_SYS_WAIT + AC_CHECK_HEADERS([fcntl.h malloc.h memory.h netinet/in.h stddef.h stdlib.h string.h strings.h sys/param.h sys/time.h unistd.h]) dnl Checks for typedefs, structures, and compiler characteristics. @@ -111,151 +113,146 @@ AC_HEADER_TIME AC_STRUCT_TM AC_C_VOLATILE +AC_C_BIGENDIAN + DODS_CHECK_SIZES -dnl echo "CC = $CC" -if test "$CC" = "gcc" -then - AM_CONDITIONAL([COMPILER_IS_GCC],[true]) -else - AM_CONDITIONAL([COMPILER_IS_GCC],[false]) -fi +AC_ARG_ENABLE([runtime-endian-check], + AC_HELP_STRING([--enable-runtime-endian-check], [Enable runtime tests for big- or little-endian byte order (default is NO)]) +) + +AS_IF([test "x$enable_runtime_endian_check" = "xyes"], [ + dnl Do the stuff needed for enabling the feature + AC_DEFINE([COMPUTE_ENDIAN_AT_RUNTIME], 1, [Should a function (run-time) be used to determine the byte order?]) +]) # Checks for library functions. -# These, at least some of them, cannot be used along with gnulib without -# breaking stuff. Since we are not bothering to handle the cases where these -# functions break, there's not much point in testing for them. However, it -# might be a good thing to use the gnulib versions since those fix various -# common problems found in many distributions. - -dnl AC_FUNC_CLOSEDIR_VOID -dnl AC_FUNC_FORK -dnl AC_FUNC_STRFTIME -dnl AC_HEADER_STDBOOL -dnl AC_FUNC_ALLOCA -dnl AC_FUNC_ERROR_AT_LINE -dnl AC_FUNC_MALLOC -dnl AC_FUNC_MEMCMP -dnl AC_FUNC_REALLOC -dnl AC_FUNC_STAT -dnl AC_FUNC_STRTOD - dnl using AC_CHECK_FUNCS does not run macros from gnulib. AC_CHECK_FUNCS([alarm atexit bzero dup2 getcwd getpagesize localtime_r memmove memset pow putenv setenv strchr strerror strtol strtoul timegm mktime]) gl_SOURCE_BASE(gl) gl_M4_BASE(gl/m4) -gl_MODULES(regex) +gl_MODULES(regex btyeswap) gl_INIT +AC_ARG_WITH(curl,[ --with-curl=PFX Prefix where curl/libcurl is installed (optional). This will override pkgconfig, etc.], + with_curl_prefix="$withval", with_curl_prefix="") + dnl I wrote these checks because we need the *-config scripts to build, so dnl the AC_CHECK_LIB macro is not needed. curlprivatereq= curlprivatelibs= -libdap_pkgconfig_libcurl=yes -libdap_libcurl_module='libcurl >= 7.10.6' -PKG_CHECK_MODULES([CURL],[$libdap_libcurl_module],, - [libdap_pkgconfig_libcurl=no]) -AC_MSG_CHECKING([for libcurl]) -if test $libdap_pkgconfig_libcurl = 'yes' +curl_set= + +if test -n "$with_curl_prefix" -a -x $with_curl_prefix/bin/curl-config then - curlprivatereq=$libdap_libcurl_module - CURL_STATIC_LIBS="`$PKG_CONFIG --static --libs libcurl`" - AC_MSG_RESULT([yes; used pkg-config]) -elif curl-config --version > /dev/null 2>&1 + AC_MSG_NOTICE([Using $with_curl_prefix as the curl prefix directory.]) + CURL_LIBS="`$with_curl_prefix/bin/curl-config --libs`" + CURL_STATIC_LIBS=$CURL_LIBS + curlprivatelibs="`$with_curl_prefix/bin/curl-config --libs`" + CURL_CFLAGS="`$with_curl_prefix/bin/curl-config --cflags`" + curl_set="yes" +elif test -n "$with_curl_prefix" then - version_libcurl=`curl-config --version | sed 's@libcurl \(.*\)@\1@'` - - version_M=`echo $version_libcurl | sed 's@^\([[0-9]]\)*\.\([[0-9]]*\)\.\([[0-9]]*\)$@\1@'` - version_m=`echo $version_libcurl | sed 's@^\([[0-9]]\)*\.\([[0-9]]*\)\.\([[0-9]]*\)$@\2@'` - version_m_m=`echo $version_libcurl | sed 's@^\([[0-9]]\)*\.\([[0-9]]*\)\.\([[0-9]]*\)$@\3@'` - - dnl echo "version_M: $version_M" - dnl echo "version_m: $version_m" - dnl echo "version_m_m: $version_m_m" + AC_MSG_ERROR([You set the curl-prefix directory to $with_curl_prefix, but curl-config is not there.]) +fi - dnl Test for several different versions of libcurl. We can use 7.10.6 - dnl or newer. - - if test $version_M -gt 7 - then - libcurl_ok='yes' - elif test $version_M -eq 7 && test $version_m -gt 10 - then - libcurl_ok='yes' - elif test $version_M -eq 7 && test $version_m -eq 10 && test $version_m_m -gt 5 - then - libcurl_ok='yes' - else - libcurl_ok='no' - fi - - dnl First test the minimum - if test $libcurl_ok = "no" - then - AC_MSG_ERROR([must have libcurl 7.10.6 or greater, found $version_libcurl]) - fi - - CURL_LIBS="`curl-config --libs`" - CURL_STATIC_LIBS=$CURL_LIBS - curlprivatelibs="`curl-config --libs`" - CURL_CFLAGS="`curl-config --cflags`" - AC_MSG_RESULT([yes; used curl-config]) -else - AC_MSG_ERROR([I could not find libcurl]) +if test -z "$curl_set" +then + # curlprivatereq= + # curlprivatelibs= + libdap_pkgconfig_libcurl=yes + libdap_libcurl_module='libcurl >= 7.10.6' + PKG_CHECK_MODULES([CURL],[$libdap_libcurl_module],, + [libdap_pkgconfig_libcurl=no]) + AC_MSG_CHECKING([for libcurl]) + + if test $libdap_pkgconfig_libcurl = 'yes' + then + curlprivatereq=$libdap_libcurl_module + CURL_STATIC_LIBS="`$PKG_CONFIG --static --libs libcurl`" + AC_MSG_RESULT([yes; used pkg-config]) + elif curl-config --version > /dev/null 2>&1 + then + version_libcurl=`curl-config --version | sed 's@libcurl \(.*\)@\1@'` + + AS_VERSION_COMPARE(["$version_libcurl"], ["7.10.6"], + [AC_MSG_ERROR([I could not find libcurl 7.10.6 or newer, found $version_libcurl])]) + + CURL_LIBS="`curl-config --libs`" + CURL_STATIC_LIBS=$CURL_LIBS + curlprivatelibs="`curl-config --libs`" + CURL_CFLAGS="`curl-config --cflags`" + AC_MSG_RESULT([yes; used curl-config and found version $version_libcurl]) + else + AC_MSG_ERROR([I could not find libcurl]) + fi fi + AC_SUBST([curlprivatereq]) AC_SUBST([curlprivatelibs]) AC_SUBST([CURL_LIBS]) AC_SUBST([CURL_STATIC_LIBS]) AC_SUBST([CURL_CFLAGS]) +AC_ARG_WITH(xml2,[ --with-xml2=PFX Prefix where libxml2 is installed (optional). This will override pkgconfig, etc.], + with_xml2_prefix="$withval", with_xml2_prefix="") + xmlprivatereq= xmlprivatelibs= +xml_set= + +if test -n "$with_xml2_prefix" -a -x $with_xml2_prefix/bin/xml2-config +then + AC_MSG_NOTICE([Using $with_xml2_prefix as the libxml2 prefix directory.]) + XML2_LIBS="`$with_xml2_prefix/bin/xml2-config --libs`" + dnl XML2_STATIC_LIBS=$XML2_LIBS + xmlprivatelibs="`$with_xml2_prefix/bin/xml2-config --libs`" + XML2_CFLAGS="`$with_xml2_prefix/bin/xml2-config --cflags`" + xml_set="yes" +elif test -n "$with_xml2_prefix" +then + AC_MSG_ERROR([You set the libxml2 prefix directory to $with_xml2_prefix, but xml2-config is not there.]) +fi + +if test -z "$xml_set" +then libdap_pkgconfig_libxml2=yes libdap_libxml2_module='libxml-2.0 >= 2.6.16' -PKG_CHECK_MODULES([XML2],[$libdap_libxml2_module],, - [libdap_pkgconfig_libxml2=no]) +PKG_CHECK_MODULES([XML2],[$libdap_libxml2_module], ,[libdap_pkgconfig_libxml2=no]) AC_MSG_CHECKING([for libxml2]) if test $libdap_pkgconfig_libxml2 = 'yes' then xmlprivatereq=$libdap_libxml2_module - XML2_STATIC_LIBS="`$PKG_CONFIG --static --libs libxml-2.0`" + dnl XML2_STATIC_LIBS="`$PKG_CONFIG --static --libs libxml-2.0`" + XML2_LIBS="`$PKG_CONFIG --libs libxml-2.0`" AC_MSG_RESULT([yes; used pkg-config]) elif xml2-config --version > /dev/null 2>&1 then version_libxml2=`xml2-config --version` - version_M=`echo $version_libxml2 | sed 's@^\([[0-9]]\)*\.\([[0-9]]*\)\.\([[0-9]]*\)$@\1@'` - version_m=`echo $version_libxml2 | sed 's@^\([[0-9]]\)*\.\([[0-9]]*\)\.\([[0-9]]*\)$@\2@'` - version_m_m=`echo $version_libxml2 | sed 's@^\([[0-9]]\)*\.\([[0-9]]*\)\.\([[0-9]]*\)$@\3@'` - - if test $version_M -gt 2 - then - libxml2_ok='yes' - elif test $version_M -eq 2 && test $version_m -eq 6 && test $version_m_m -ge 16 - then - libxml2_ok='yes' - fi + AS_VERSION_COMPARE(["$version_libxml2"], ["2.6.16"], + [AC_MSG_ERROR([I could not find libxml2 2.6.16 or newer])]) + XML2_LIBS="`xml2-config --libs`" - XML2_STATIC_LIBS=$XML2_LIBS + dnl XML2_STATIC_LIBS=$XML2_LIBS XML2_CFLAGS="`xml2-config --cflags`" xmlprivatelibs="`xml2-config --libs`" - AC_MSG_RESULT([yes; used xml2-config]) + AC_MSG_RESULT([yes; used xml2-config and found version $version_libxml2]) else - AC_MSG_ERROR([I could not find libxml2 2.6.16 or newer]) + AC_MSG_ERROR([I could not find ml2-config]) +fi fi + AC_SUBST([xmlprivatereq]) AC_SUBST([xmlprivatelibs]) AC_SUBST([XML2_LIBS]) -AC_SUBST([XML2_STATIC_LIBS]) +dnl AC_SUBST([XML2_STATIC_LIBS]) AC_SUBST([XML2_CFLAGS]) -DAP_CHECK_ZLIB - AC_CHECK_LIB([pthread], [pthread_kill], [PTHREAD_LIBS="-lpthread"], [AC_MSG_ERROR([I could not find pthreads])]) @@ -270,10 +267,130 @@ [AM_CONDITIONAL([CPPUNIT], [true])], [AM_CONDITIONAL([CPPUNIT], [false])]) +dnl When pkgconfig support is added, use this +libdap_libgridfields_module='libgridfields >= 0.7.0' + +libgf_ok="no" + +dnl AC_ARG_WITH([gridfields], +dnl AC_HELP_STRING([--with-gridfields=path], [Use the gridfields library at this location.]), +dnl [if test "$withval" = "yes" +dnl then +dnl AC_MSG_ERROR([You must supply a path when using --with-gridfields; try --enable-gridfields.]) +dnl else +dnl AC_MSG_NOTICE([Using $withval as the GridFields prefix directory.]) +dnl GF_LIBS="-L$withval/lib -lgridfields" +dnl GF_CFLAGS="-I$withval/include" +dnl AC_DEFINE([GRIDFIELDS],[1],[define if gridfields lib is present]) +dnl libgf_ok="yes" +dnl fi], +dnl []) + +dnl AC_ARG_ENABLE([gridfields], +dnl AC_HELP_STRING([--enable-gridfields], [Enable libgridfields-based server functions (default is NO)])) + +dnl if test "$libgf_ok" = "no" -a "$enable_gridfields" = "yes" +dnl then + +dnl AC_MSG_CHECKING([for libgridfields]) +dnl if gridfields-config --version > /dev/null 2>&1 +dnl then +dnl version_libgf=`gridfields-config --version | sed 's@libgridfields \(.*\)@\1@'` + +dnl version_M=`echo $version_libgf | sed 's@^\([[0-9]]\)*\.\([[0-9]]*\)\.\([[0-9]]*\)$@\1@'` +dnl version_m=`echo $version_libgf | sed 's@^\([[0-9]]\)*\.\([[0-9]]*\)\.\([[0-9]]*\)$@\2@'` +dnl version_m_m=`echo $version_libgf | sed 's@^\([[0-9]]\)*\.\([[0-9]]*\)\.\([[0-9]]*\)$@\3@'` + +dnl dnl Test for several different versions of libgridfields + +dnl if test $version_M -gt 0 +dnl then +dnl libgf_ok='yes' +dnl elif test $version_M -eq 0 && test $version_m -gt 7 +dnl then +dnl libgf_ok='yes' +dnl elif test $version_M -eq 0 && test $version_m -eq 7 && test $version_m_m -gt 0 +dnl then +dnl libgf_ok='yes' +dnl else +dnl libgf_ok='no' +dnl fi + +dnl if test "$libgf_ok"="no" +dnl then +dnl AC_MSG_ERROR([must have libgf 0.7.0 or greater, found $version_libgf]) +dnl fi + +dnl GF_LIBS="`gridfields-config --libs`" +dnl GF_CFLAGS="`gridfields-config --cflags`" + +dnl AC_DEFINE([GRDIFIELDS],[1],[define if gridfields lib is present]) +dnl AC_MSG_RESULT([yes; used gridfields-config]) +dnl else +dnl AC_MSG_ERROR([I could not find libgridfields]) +dnl fi + +dnl fi + +dnl AC_SUBST([GF_LIBS]) +dnl AC_SUBST([GF_CFLAGS]) + +dnl if test "$libgf_ok" = "yes" +dnl then +dnl echo "Set gridfields CFLAGS to $GF_CFLAGS" +dnl echo "Set gridfields LIBS to $GF_LIBS" +dnl AM_CONDITIONAL([USING_GRIDFIELDS],[true]) +dnl else +dnl AM_CONDITIONAL([USING_GRIDFIELDS],[false]) +dnl fi + +dnl # Which, if any, copy of GDAL should be used for the build? +dnl GDAL_FOUND= + +dnl AC_ARG_WITH(gdal, AS_HELP_STRING([--with-gdal], [Use the copy of GDAL at this location]), +dnl with_gdal_prefix="$withval", with_gdal_prefix="") + +dnl if test -n "$with_gdal_prefix" -a -x $with_gdal_prefix/bin/gdal-config +dnl then +dnl AC_MSG_NOTICE([Using $with_gdal_prefix as the GDAL prefix directory.]) +dnl GDAL_LIBS="`$with_gdal_prefix/bin/gdal-config --libs` `$with_gdal_prefix/bin/gdal-config --dep-libs`" +dnl GDAL_CFLAGS="`$with_gdal_prefix/bin/gdal-config --cflags`" +dnl GDAL_FOUND="yes" +dnl elif test -n "$with_gdal_prefix" +dnl then +dnl AC_MSG_ERROR([You set the gdal-prefix directory to $with_gdal_prefix, but gdal-config is not there.]) +dnl fi + +dnl # Because of the run-time errors encountered when there are competing +dnl # versions of libs, only include GDAL when explictly told to. NB: see +dnl # the fileout_gdal handler for another place where GDAL can be added to +dnl # a running Hyrax server. jhrg 11/23/12 + +dnl # if test -z "$GDAL_FOUND" +dnl # then +dnl # AX_LIB_GDAL([1.9.0]) +dnl # if test ! -z "$GDAL_CFLAGS" -a ! -z "$GDAL_LDFLAGS"; then +dnl # GDAL_FOUND="yes" +dnl # fi +dnl # fi + +dnl AC_SUBST([GDAL_LIBS]) +dnl AC_SUBST([GDAL_CFLAGS]) + + +dnl if test -n "$GDAL_FOUND" +dnl then +dnl echo "Set GDAL_CFLAGS to $GDAL_CFLAGS" +dnl echo "Set GDAL_LIBS to $GF_LIBS" +dnl AM_CONDITIONAL([USING_GDAL],[true]) +dnl AC_DEFINE([GDAL],[1],[define if gdal lib is present]) +dnl else +dnl AM_CONDITIONAL([USING_GDAL],[false]) +dnl fi + DODS_DEBUG_OPTION -dnl Temporary hack; find a home for the deflate program; set it to -dnl prefix/etc/deflate. See util.cc:dods_root() +dnl See util.cc:dods_root() if test "$prefix" = "NONE" then AC_DEFINE([LIBDAP_ROOT], ["/usr/local"], [Set to the prefix directory]) @@ -281,6 +398,49 @@ AC_DEFINE_UNQUOTED([LIBDAP_ROOT], ["$prefix"], [Set to the prefix directory]) fi +AC_ARG_ENABLE([dap4], + AC_HELP_STRING([--enable-dap4], [Enable DAP4 types and responses (default is NO)])) + +AS_IF([test "x$enable_dap4" = "xyes"], [ + dnl Do the stuff needed for enabling the feature + dnl echo "Defining DAP4! " + AC_DEFINE([DAP4], 1, [Should DAP4 support be enabled?]) + AM_CONDITIONAL([DAP4_DEFINED], [true]) ], + [ dnl else enable_dap4 is false + AM_CONDITIONAL([DAP4_DEFINED], [false]) +]) + +AC_ARG_ENABLE([developer], +[AS_HELP_STRING([--enable-developer], +[Build a debug (-g3 -O0) version of this code and include assert() calls in the code (default is no)])], +[case "${enableval}" in + yes) build_developer=true ;; + no) build_developer=false ;; + *) AC_MSG_ERROR([bad value ${enableval} for --enable-developer]) ;; + esac], +[build_developer=false]) + +if test "x$build_developer" = "xtrue"; then + AC_MSG_NOTICE(["Building developer version"]) +else + AC_MSG_NOTICE(["Not building developer version"]) + AC_DEFINE([NDEBUG], [1], [Remove this to activate assert() calls.]) +fi +AM_CONDITIONAL([BUILD_DEVELOPER], [test "x$build_developer" = "xtrue"]) + +dnl AC_ARG_ENABLE([checksums], +dnl AC_HELP_STRING([--enable-checksums], [Enable MD5 checksums for DAP2 (default is NO)])) +dnl +dnl echo "enable_checksums = $enable_checksums" +dnl AS_IF([test "x$enable_checksums" = "xyes"], [ +dnl dnl Do the stuff needed for enabling the feature +dnl dnl echo "Defining checksums! " +dnl AC_DEFINE([CHECKSUMS], 1, [Should checksums be generated]) +dnl AM_CONDITIONAL([CHECKSUMS_DEFINED], [true]) ], +dnl [ dnl else enable_checksums is false +dnl AM_CONDITIONAL([CHECKSUMS_DEFINED], [false]) +dnl]) + dnl autoheader macros; tack some text at the top and bottom of config_dap.h.in AH_TOP([#ifndef _config_h @@ -299,11 +459,18 @@ libdap.pc libdapclient.pc libdapserver.pc + main_page.doxygen + doxy.conf gl/Makefile tests/Makefile tests/atlocal unit-tests/Makefile unit-tests/cache-testsuite/Makefile]) + +dnl swath2grid/Makefile +dnl swath2grid/bes.conf +dnl ugridFunctions/Makefile + AC_CONFIG_FILES([dap-config], [chmod +x dap-config]) - + AC_OUTPUT diff -Nru libdap-3.11.1/dap-config.in libdap-3.12.0/dap-config.in --- libdap-3.11.1/dap-config.in 2011-04-29 13:19:43.000000000 +0000 +++ libdap-3.12.0/dap-config.in 2013-10-17 21:27:40.000000000 +0000 @@ -5,6 +5,7 @@ prefix=@prefix@ exec_prefix=${prefix} libdir=${exec_prefix}/lib +libdir64=${exec_prefix}/lib64 includedir=${prefix}/include usage() @@ -55,19 +56,24 @@ ;; --cflags) - echo "-I${includedir}/libdap" + echo "-I${includedir}/libdap @XML2_CFLAGS@ @CURL_CFLAGS@" ;; --libs) - echo "-L${libdir} -ldap -ldapserver -ldapclient @CURL_STATIC_LIBS@ @XML2_STATIC_LIBS@ @PTHREAD_LIBS@ @UUID_LIBS@ @LIBS@" - ;; + echo "-L${libdir64} -L${libdir} -ldap -ldapserver -ldapclient @CURL_LIBS@ @XML2_LIBS@ @PTHREAD_LIBS@ @UUID_LIBS@ @LIBS@" + ;; +# +# Changed CURL_STATIC_LIBS to CURL_LIBS because the former was including a +# a boatload of crypto stuff that might or might not be present on a server. +# Various handlers use this script to determine which libraries to link with. +# jhrg 2/7/12 --server-libs) - echo "-L${libdir} -ldap -ldapserver @XML2_STATIC_LIBS@ @PTHREAD_LIBS@ @UUID_LIBS@ @LIBS@" + echo "-L${libdir64} -L${libdir} -ldap -ldapserver @XML2_LIBS@ @PTHREAD_LIBS@ @UUID_LIBS@ @LIBS@" ;; --client-libs) - echo "-L${libdir} -ldap -ldapclient @CURL_STATIC_LIBS@ @XML2_STATIC_LIBS@ @PTHREAD_LIBS@ @UUID_LIBS@ @LIBS@" + echo "-L${libdir64} -L${libdir} -ldap -ldapclient @CURL_LIBS@ @XML2_LIBS@ @PTHREAD_LIBS@ @UUID_LIBS@ @LIBS@" ;; --prefix) diff -Nru libdap-3.11.1/dap-config.man1 libdap-3.12.0/dap-config.man1 --- libdap-3.11.1/dap-config.man1 1970-01-01 00:00:00.000000000 +0000 +++ libdap-3.12.0/dap-config.man1 2013-10-17 21:27:40.000000000 +0000 @@ -0,0 +1,48 @@ +.\" dap-config.1 +.\" +.\" Created on: Dec 29, 2011 +.\" Author: jimg +.TH DAP-CONFIG 1 "December 2011" Linux "User Manuals" +.SH NAME +dap-config \- get information about the libdap library +.SH SYNOPSIS +.B dap-config [OPTIONS] +.SH DESCRIPTION +.B dap-config +Get information about the libdap library so that it can be easily used +in building other software. Option exist to help with build configuration, +compilation, linking. +.SH OPTIONS +Available values for OPTION include: + +.IP --help +display a help message and exit +.IP --cc +C compiler +.IP --cxx +C++ compiler +.IP --cflags +pre-processor and compiler flags +.IP --libs +library linking information for libdap (both clients and servers) +.IP --server-libs +libraries for servers +.IP --client-libs +libraries for clients +.IP --prefix +OPeNDAP install prefix +.IP --version +Library version +.SH FILES +.I none +.SH ENVIRONMENT +.I none +.SH DIAGNOSTICS +.I none +.SH BUGS +The pkg-config tool provides the same information, although it is sometimes +not available. +.SH AUTHOR +James Gallagher +.SH "SEE ALSO" +.BR getdap (1) \ No newline at end of file diff -Nru libdap-3.11.1/das.lex libdap-3.12.0/das.lex --- libdap-3.11.1/das.lex 2011-04-29 13:19:43.000000000 +0000 +++ libdap-3.12.0/das.lex 2013-10-17 21:27:40.000000000 +0000 @@ -64,7 +64,7 @@ #include -static char rcsid[] not_used ={"$Id: das.lex 21577 2009-10-02 16:12:17Z jimg $"}; +static char rcsid[] not_used ={"$Id: das.lex 27157 2013-09-28 21:22:52Z jimg $"}; #ifndef _MSC_VER #include @@ -88,7 +88,7 @@ #define YY_DECL int daslex YY_PROTO(( void )) #define YY_FATAL_ERROR(msg) {\ throw(Error(string("Error scanning DAS object text: ") + string(msg))); \ - yy_fatal_error(msg); /* 'Used' here to suppress warning */ \ + yy_fatal_error(msg); /* This will never be run but putting it here removes a warning that the funtion is never used. */ \ } #include "das.tab.hh" @@ -99,6 +99,9 @@ %} %option noyywrap +%option nounput +%option noinput +%option 8bit %option prefix="das" %option outfile="lex.das.cc" diff -Nru libdap-3.11.1/das.tab.cc libdap-3.12.0/das.tab.cc --- libdap-3.11.1/das.tab.cc 2011-05-06 17:50:24.000000000 +0000 +++ libdap-3.12.0/das.tab.cc 2013-10-17 21:27:40.000000000 +0000 @@ -1,24 +1,23 @@ -/* A Bison parser, made by GNU Bison 2.3. */ -/* Skeleton implementation for Bison's Yacc-like parsers in C +/* A Bison parser, made by GNU Bison 2.4.1. */ - Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004, 2005, 2006 +/* Skeleton implementation for Bison's Yacc-like parsers in C + + Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc. - - This program is free software; you can redistribute it and/or modify + + This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2, or (at your option) - any later version. - + the Free Software Foundation, either version 3 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., 51 Franklin Street, Fifth Floor, - Boston, MA 02110-1301, USA. */ + along with this program. If not, see . */ /* As a special exception, you may create a larger work that contains part or all of the Bison parser skeleton and distribute that work @@ -29,7 +28,7 @@ special exception, which will cause the skeleton and the resulting Bison output files to be licensed under the GNU General Public License without this special exception. - + This special exception was added by the Free Software Foundation in version 2.2 of Bison. */ @@ -47,7 +46,7 @@ #define YYBISON 1 /* Bison version. */ -#define YYBISON_VERSION "2.3" +#define YYBISON_VERSION "2.4.1" /* Skeleton name. */ #define YYSKELETON_NAME "yacc.c" @@ -55,60 +54,53 @@ /* Pure parsers. */ #define YYPURE 0 +/* Push parsers. */ +#define YYPUSH 0 + +/* Pull parsers. */ +#define YYPULL 1 + /* Using locations. */ #define YYLSP_NEEDED 0 /* Substitute the variable and function names. */ -#define yyparse dasparse -#define yylex daslex -#define yyerror daserror -#define yylval daslval -#define yychar daschar -#define yydebug dasdebug -#define yynerrs dasnerrs +#define yyparse dasparse +#define yylex daslex +#define yyerror daserror +#define yylval daslval +#define yychar daschar +#define yydebug dasdebug +#define yynerrs dasnerrs -/* Tokens. */ -#ifndef YYTOKENTYPE -# define YYTOKENTYPE - /* Put the tokens into the symbol table, so that GDB and other debuggers - know about them. */ - enum yytokentype { - SCAN_ATTR = 258, - SCAN_WORD = 259, - SCAN_ALIAS = 260, - SCAN_BYTE = 261, - SCAN_INT16 = 262, - SCAN_UINT16 = 263, - SCAN_INT32 = 264, - SCAN_UINT32 = 265, - SCAN_FLOAT32 = 266, - SCAN_FLOAT64 = 267, - SCAN_STRING = 268, - SCAN_URL = 269, - SCAN_XML = 270 - }; +/* Copy the first part of user declarations. */ + + +/* Line 189 of yacc.c */ +#line 81 "das.tab.cc" + +/* Enabling traces. */ +#ifndef YYDEBUG +# define YYDEBUG 1 #endif -/* Tokens. */ -#define SCAN_ATTR 258 -#define SCAN_WORD 259 -#define SCAN_ALIAS 260 -#define SCAN_BYTE 261 -#define SCAN_INT16 262 -#define SCAN_UINT16 263 -#define SCAN_INT32 264 -#define SCAN_UINT32 265 -#define SCAN_FLOAT32 266 -#define SCAN_FLOAT64 267 -#define SCAN_STRING 268 -#define SCAN_URL 269 -#define SCAN_XML 270 +/* Enabling verbose error messages. */ +#ifdef YYERROR_VERBOSE +# undef YYERROR_VERBOSE +# define YYERROR_VERBOSE 1 +#else +# define YYERROR_VERBOSE 0 +#endif +/* Enabling the token table. */ +#ifndef YYTOKEN_TABLE +# define YYTOKEN_TABLE 0 +#endif +/* "%code requires" blocks. */ -/* Copy the first part of user declarations. */ -#line 40 "das.y" +/* Line 209 of yacc.c */ +#line 40 "das.yy" #define YYSTYPE char * @@ -116,8 +108,6 @@ #include "config.h" -static char rcsid[] not_used = {"$Id: das.y 21577 2009-10-02 16:12:17Z jimg $"}; - #include #include @@ -129,7 +119,7 @@ #include "debug.h" #include "parser.h" #include "util.h" -#include "das.tab.hh" + // #include "das.tab.hh" #ifdef TRACE_NEW #include "trace_new.h" @@ -150,10 +140,58 @@ #define DAS_OBJ(arg) ((DAS *)((parser_arg *)(arg))->_object) -#define YYPARSE_PARAM arg +//#define YYPARSE_PARAM arg extern int das_line_num; /* defined in das.lex */ + + + +/* Line 209 of yacc.c */ +#line 152 "das.tab.cc" + +/* Tokens. */ +#ifndef YYTOKENTYPE +# define YYTOKENTYPE + /* Put the tokens into the symbol table, so that GDB and other debuggers + know about them. */ + enum yytokentype { + SCAN_ATTR = 258, + SCAN_WORD = 259, + SCAN_ALIAS = 260, + SCAN_BYTE = 261, + SCAN_INT16 = 262, + SCAN_UINT16 = 263, + SCAN_INT32 = 264, + SCAN_UINT32 = 265, + SCAN_FLOAT32 = 266, + SCAN_FLOAT64 = 267, + SCAN_STRING = 268, + SCAN_URL = 269, + SCAN_XML = 270 + }; +#endif + + + +#if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED +typedef int YYSTYPE; +# define YYSTYPE_IS_TRIVIAL 1 +# define yystype YYSTYPE /* obsolescent; will be withdrawn */ +# define YYSTYPE_IS_DECLARED 1 +#endif + + +/* Copy the second part of user declarations. */ + + +/* Line 264 of yacc.c */ +#line 190 "das.tab.cc" +/* Unqualified %code blocks. */ + +/* Line 265 of yacc.c */ +#line 85 "das.yy" + // No global static objects. We go through this every so often, I guess I // should learn... 1/24/2000 jhrg static string *name; /* holds name in attr_pair rule */ @@ -182,7 +220,7 @@ typedef int checker(const char *); int daslex(void); -static void daserror(char *s); +static void daserror(parser_arg *arg, const string &s /*char *s*/); static void add_attribute(const string &type, const string &name, const string &value, checker *chk) throw (Error); static void add_alias(AttrTable *das, AttrTable *current, const string &name, @@ -193,38 +231,9 @@ -/* Enabling traces. */ -#ifndef YYDEBUG -# define YYDEBUG 0 -#endif - -/* Enabling verbose error messages. */ -#ifdef YYERROR_VERBOSE -# undef YYERROR_VERBOSE -# define YYERROR_VERBOSE 1 -#else -# define YYERROR_VERBOSE 0 -#endif -/* Enabling the token table. */ -#ifndef YYTOKEN_TABLE -# define YYTOKEN_TABLE 0 -#endif - -#if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED -typedef int YYSTYPE; -# define yystype YYSTYPE /* obsolescent; will be withdrawn */ -# define YYSTYPE_IS_DECLARED 1 -# define YYSTYPE_IS_TRIVIAL 1 -#endif - - - -/* Copy the second part of user declarations. */ - - -/* Line 216 of yacc.c. */ -#line 228 "das.tab.cc" +/* Line 265 of yacc.c */ +#line 237 "das.tab.cc" #ifdef short # undef short @@ -299,14 +308,14 @@ #if (defined __STDC__ || defined __C99__FUNC__ \ || defined __cplusplus || defined _MSC_VER) static int -YYID (int i) +YYID (int yyi) #else static int -YYID (i) - int i; +YYID (yyi) + int yyi; #endif { - return i; + return yyi; } #endif @@ -387,9 +396,9 @@ /* A type that is properly aligned for any stack member. */ union yyalloc { - yytype_int16 yyss; - YYSTYPE yyvs; - }; + yytype_int16 yyss_alloc; + YYSTYPE yyvs_alloc; +}; /* The size of the maximum gap between one aligned stack and the next. */ # define YYSTACK_GAP_MAXIMUM (sizeof (union yyalloc) - 1) @@ -423,12 +432,12 @@ elements in the stack, and YYPTR gives the new location of the stack. Advance YYPTR to a properly aligned location for the next stack. */ -# define YYSTACK_RELOCATE(Stack) \ +# define YYSTACK_RELOCATE(Stack_alloc, Stack) \ do \ { \ YYSIZE_T yynewbytes; \ - YYCOPY (&yyptr->Stack, Stack, yysize); \ - Stack = &yyptr->Stack; \ + YYCOPY (&yyptr->Stack_alloc, Stack, yysize); \ + Stack = &yyptr->Stack_alloc; \ yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \ yyptr += yynewbytes / sizeof (*yyptr); \ } \ @@ -537,15 +546,15 @@ /* YYRLINE[YYN] -- source line where rule number YYN was defined. */ static const yytype_uint16 yyrline[] = { - 0, 185, 185, 185, 202, 203, 207, 208, 214, 215, - 216, 219, 221, 222, 221, 225, 226, 225, 229, 230, - 229, 233, 234, 233, 237, 238, 237, 241, 242, 241, - 245, 246, 245, 249, 250, 249, 253, 254, 253, 257, - 258, 257, 262, 282, 261, 290, 289, 295, 299, 305, - 309, 315, 319, 325, 329, 335, 339, 345, 349, 355, - 359, 365, 370, 377, 381, 387, 403, 406, 409, 412, - 412, 412, 412, 412, 413, 413, 413, 413, 414, 414, - 414, 414, 418, 422, 417 + 0, 194, 194, 194, 211, 212, 216, 217, 223, 224, + 225, 228, 230, 231, 230, 234, 235, 234, 238, 239, + 238, 242, 243, 242, 246, 247, 246, 250, 251, 250, + 254, 255, 254, 258, 259, 258, 262, 263, 262, 266, + 267, 266, 271, 291, 270, 299, 298, 304, 308, 314, + 318, 324, 328, 334, 338, 344, 348, 354, 358, 364, + 368, 374, 379, 386, 390, 396, 412, 415, 418, 421, + 421, 421, 421, 421, 422, 422, 422, 422, 423, 423, + 423, 423, 427, 431, 426 }; #endif @@ -557,12 +566,13 @@ "$end", "error", "$undefined", "SCAN_ATTR", "SCAN_WORD", "SCAN_ALIAS", "SCAN_BYTE", "SCAN_INT16", "SCAN_UINT16", "SCAN_INT32", "SCAN_UINT32", "SCAN_FLOAT32", "SCAN_FLOAT64", "SCAN_STRING", "SCAN_URL", "SCAN_XML", - "'{'", "'}'", "';'", "','", "$accept", "attr_start", "@1", "attributes", - "attribute", "attr_list", "attr_tuple", "@2", "@3", "@4", "@5", "@6", - "@7", "@8", "@9", "@10", "@11", "@12", "@13", "@14", "@15", "@16", "@17", - "@18", "@19", "@20", "@21", "@22", "@23", "@24", "bytes", "int16", - "uint16", "int32", "uint32", "float32", "float64", "strs", "urls", "xml", - "url", "str_or_id", "float_or_int", "name", "alias", "@25", "@26", 0 + "'{'", "'}'", "';'", "','", "$accept", "attr_start", "$@1", "attributes", + "attribute", "attr_list", "attr_tuple", "$@2", "$@3", "$@4", "$@5", + "$@6", "$@7", "$@8", "$@9", "$@10", "$@11", "$@12", "$@13", "$@14", + "$@15", "$@16", "$@17", "$@18", "$@19", "$@20", "$@21", "$@22", "$@23", + "$@24", "bytes", "int16", "uint16", "int32", "uint32", "float32", + "float64", "strs", "urls", "xml", "url", "str_or_id", "float_or_int", + "name", "alias", "$@25", "$@26", 0 }; #endif @@ -753,7 +763,7 @@ } \ else \ { \ - yyerror (YY_("syntax error: cannot back up")); \ + yyerror (arg, YY_("syntax error: cannot back up")); \ YYERROR; \ } \ while (YYID (0)) @@ -833,7 +843,7 @@ { \ YYFPRINTF (stderr, "%s ", Title); \ yy_symbol_print (stderr, \ - Type, Value); \ + Type, Value, arg); \ YYFPRINTF (stderr, "\n"); \ } \ } while (YYID (0)) @@ -847,17 +857,19 @@ #if (defined __STDC__ || defined __C99__FUNC__ \ || defined __cplusplus || defined _MSC_VER) static void -yy_symbol_value_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep) +yy_symbol_value_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep, parser_arg *arg) #else static void -yy_symbol_value_print (yyoutput, yytype, yyvaluep) +yy_symbol_value_print (yyoutput, yytype, yyvaluep, arg) FILE *yyoutput; int yytype; YYSTYPE const * const yyvaluep; + parser_arg *arg; #endif { if (!yyvaluep) return; + YYUSE (arg); # ifdef YYPRINT if (yytype < YYNTOKENS) YYPRINT (yyoutput, yytoknum[yytype], *yyvaluep); @@ -879,13 +891,14 @@ #if (defined __STDC__ || defined __C99__FUNC__ \ || defined __cplusplus || defined _MSC_VER) static void -yy_symbol_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep) +yy_symbol_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep, parser_arg *arg) #else static void -yy_symbol_print (yyoutput, yytype, yyvaluep) +yy_symbol_print (yyoutput, yytype, yyvaluep, arg) FILE *yyoutput; int yytype; YYSTYPE const * const yyvaluep; + parser_arg *arg; #endif { if (yytype < YYNTOKENS) @@ -893,7 +906,7 @@ else YYFPRINTF (yyoutput, "nterm %s (", yytname[yytype]); - yy_symbol_value_print (yyoutput, yytype, yyvaluep); + yy_symbol_value_print (yyoutput, yytype, yyvaluep, arg); YYFPRINTF (yyoutput, ")"); } @@ -905,17 +918,20 @@ #if (defined __STDC__ || defined __C99__FUNC__ \ || defined __cplusplus || defined _MSC_VER) static void -yy_stack_print (yytype_int16 *bottom, yytype_int16 *top) +yy_stack_print (yytype_int16 *yybottom, yytype_int16 *yytop) #else static void -yy_stack_print (bottom, top) - yytype_int16 *bottom; - yytype_int16 *top; +yy_stack_print (yybottom, yytop) + yytype_int16 *yybottom; + yytype_int16 *yytop; #endif { YYFPRINTF (stderr, "Stack now"); - for (; bottom <= top; ++bottom) - YYFPRINTF (stderr, " %d", *bottom); + for (; yybottom <= yytop; yybottom++) + { + int yybot = *yybottom; + YYFPRINTF (stderr, " %d", yybot); + } YYFPRINTF (stderr, "\n"); } @@ -933,12 +949,13 @@ #if (defined __STDC__ || defined __C99__FUNC__ \ || defined __cplusplus || defined _MSC_VER) static void -yy_reduce_print (YYSTYPE *yyvsp, int yyrule) +yy_reduce_print (YYSTYPE *yyvsp, int yyrule, parser_arg *arg) #else static void -yy_reduce_print (yyvsp, yyrule) +yy_reduce_print (yyvsp, yyrule, arg) YYSTYPE *yyvsp; int yyrule; + parser_arg *arg; #endif { int yynrhs = yyr2[yyrule]; @@ -949,18 +966,18 @@ /* The symbols being reduced. */ for (yyi = 0; yyi < yynrhs; yyi++) { - fprintf (stderr, " $%d = ", yyi + 1); + YYFPRINTF (stderr, " $%d = ", yyi + 1); yy_symbol_print (stderr, yyrhs[yyprhs[yyrule] + yyi], &(yyvsp[(yyi + 1) - (yynrhs)]) - ); - fprintf (stderr, "\n"); + , arg); + YYFPRINTF (stderr, "\n"); } } # define YY_REDUCE_PRINT(Rule) \ do { \ if (yydebug) \ - yy_reduce_print (yyvsp, Rule); \ + yy_reduce_print (yyvsp, Rule, arg); \ } while (YYID (0)) /* Nonzero means print parse trace. It is left uninitialized so that @@ -1211,16 +1228,18 @@ #if (defined __STDC__ || defined __C99__FUNC__ \ || defined __cplusplus || defined _MSC_VER) static void -yydestruct (const char *yymsg, int yytype, YYSTYPE *yyvaluep) +yydestruct (const char *yymsg, int yytype, YYSTYPE *yyvaluep, parser_arg *arg) #else static void -yydestruct (yymsg, yytype, yyvaluep) +yydestruct (yymsg, yytype, yyvaluep, arg) const char *yymsg; int yytype; YYSTYPE *yyvaluep; + parser_arg *arg; #endif { YYUSE (yyvaluep); + YYUSE (arg); if (!yymsg) yymsg = "Deleting"; @@ -1233,10 +1252,8 @@ break; } } - /* Prevent warnings from -Wmissing-prototypes. */ - #ifdef YYPARSE_PARAM #if defined __STDC__ || defined __cplusplus int yyparse (void *YYPARSE_PARAM); @@ -1245,18 +1262,17 @@ #endif #else /* ! YYPARSE_PARAM */ #if defined __STDC__ || defined __cplusplus -int yyparse (void); +int yyparse (parser_arg *arg); #else int yyparse (); #endif #endif /* ! YYPARSE_PARAM */ - -/* The look-ahead symbol. */ +/* The lookahead symbol. */ int yychar; -/* The semantic value of the look-ahead symbol. */ +/* The semantic value of the lookahead symbol. */ YYSTYPE yylval; /* Number of syntax errors so far. */ @@ -1264,9 +1280,9 @@ -/*----------. -| yyparse. | -`----------*/ +/*-------------------------. +| yyparse or yypush_parse. | +`-------------------------*/ #ifdef YYPARSE_PARAM #if (defined __STDC__ || defined __C99__FUNC__ \ @@ -1282,74 +1298,76 @@ #if (defined __STDC__ || defined __C99__FUNC__ \ || defined __cplusplus || defined _MSC_VER) int -yyparse (void) +yyparse (parser_arg *arg) #else int -yyparse () - +yyparse (arg) + parser_arg *arg; #endif #endif { - - int yystate; - int yyn; - int yyresult; - /* Number of tokens to shift before error messages enabled. */ - int yyerrstatus; - /* Look-ahead token as an internal (translated) token number. */ - int yytoken = 0; -#if YYERROR_VERBOSE - /* Buffer for error messages, and its allocated size. */ - char yymsgbuf[128]; - char *yymsg = yymsgbuf; - YYSIZE_T yymsg_alloc = sizeof yymsgbuf; -#endif - /* Three stacks and their tools: - `yyss': related to states, - `yyvs': related to semantic values, - `yyls': related to locations. - - Refer to the stacks thru separate pointers, to allow yyoverflow - to reallocate them elsewhere. */ - - /* The state stack. */ - yytype_int16 yyssa[YYINITDEPTH]; - yytype_int16 *yyss = yyssa; - yytype_int16 *yyssp; - - /* The semantic value stack. */ - YYSTYPE yyvsa[YYINITDEPTH]; - YYSTYPE *yyvs = yyvsa; - YYSTYPE *yyvsp; + int yystate; + /* Number of tokens to shift before error messages enabled. */ + int yyerrstatus; + /* The stacks and their tools: + `yyss': related to states. + `yyvs': related to semantic values. -#define YYPOPSTACK(N) (yyvsp -= (N), yyssp -= (N)) + Refer to the stacks thru separate pointers, to allow yyoverflow + to reallocate them elsewhere. */ - YYSIZE_T yystacksize = YYINITDEPTH; + /* The state stack. */ + yytype_int16 yyssa[YYINITDEPTH]; + yytype_int16 *yyss; + yytype_int16 *yyssp; + + /* The semantic value stack. */ + YYSTYPE yyvsa[YYINITDEPTH]; + YYSTYPE *yyvs; + YYSTYPE *yyvsp; + YYSIZE_T yystacksize; + + int yyn; + int yyresult; + /* Lookahead token as an internal (translated) token number. */ + int yytoken; /* The variables used to return semantic value and location from the action routines. */ YYSTYPE yyval; +#if YYERROR_VERBOSE + /* Buffer for error messages, and its allocated size. */ + char yymsgbuf[128]; + char *yymsg = yymsgbuf; + YYSIZE_T yymsg_alloc = sizeof yymsgbuf; +#endif + +#define YYPOPSTACK(N) (yyvsp -= (N), yyssp -= (N)) /* The number of symbols on the RHS of the reduced rule. Keep to zero when no symbol should be popped. */ int yylen = 0; + yytoken = 0; + yyss = yyssa; + yyvs = yyvsa; + yystacksize = YYINITDEPTH; + YYDPRINTF ((stderr, "Starting parse\n")); yystate = 0; yyerrstatus = 0; yynerrs = 0; - yychar = YYEMPTY; /* Cause a token to be read. */ + yychar = YYEMPTY; /* Cause a token to be read. */ /* Initialize stack pointers. Waste one element of value and location stack so that they stay on the same level as the state stack. The wasted elements are never initialized. */ - yyssp = yyss; yyvsp = yyvs; @@ -1379,7 +1397,6 @@ YYSTYPE *yyvs1 = yyvs; yytype_int16 *yyss1 = yyss; - /* Each stack pointer address is followed by the size of the data in use in that stack, in bytes. This used to be a conditional around just the two extra args, but that might @@ -1387,7 +1404,6 @@ yyoverflow (YY_("memory exhausted"), &yyss1, yysize * sizeof (*yyssp), &yyvs1, yysize * sizeof (*yyvsp), - &yystacksize); yyss = yyss1; @@ -1410,9 +1426,8 @@ (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize)); if (! yyptr) goto yyexhaustedlab; - YYSTACK_RELOCATE (yyss); - YYSTACK_RELOCATE (yyvs); - + YYSTACK_RELOCATE (yyss_alloc, yyss); + YYSTACK_RELOCATE (yyvs_alloc, yyvs); # undef YYSTACK_RELOCATE if (yyss1 != yyssa) YYSTACK_FREE (yyss1); @@ -1423,7 +1438,6 @@ yyssp = yyss + yysize - 1; yyvsp = yyvs + yysize - 1; - YYDPRINTF ((stderr, "Stack size increased to %lu\n", (unsigned long int) yystacksize)); @@ -1433,6 +1447,9 @@ YYDPRINTF ((stderr, "Entering state %d\n", yystate)); + if (yystate == YYFINAL) + YYACCEPT; + goto yybackup; /*-----------. @@ -1441,16 +1458,16 @@ yybackup: /* Do appropriate processing given the current state. Read a - look-ahead token if we need one and don't already have one. */ + lookahead token if we need one and don't already have one. */ - /* First try to decide what to do without reference to look-ahead token. */ + /* First try to decide what to do without reference to lookahead token. */ yyn = yypact[yystate]; if (yyn == YYPACT_NINF) goto yydefault; - /* Not known => get a look-ahead token if don't already have one. */ + /* Not known => get a lookahead token if don't already have one. */ - /* YYCHAR is either YYEMPTY or YYEOF or a valid look-ahead symbol. */ + /* YYCHAR is either YYEMPTY or YYEOF or a valid lookahead symbol. */ if (yychar == YYEMPTY) { YYDPRINTF ((stderr, "Reading a token: ")); @@ -1482,20 +1499,16 @@ goto yyreduce; } - if (yyn == YYFINAL) - YYACCEPT; - /* Count tokens shifted since error; after three, turn off error status. */ if (yyerrstatus) yyerrstatus--; - /* Shift the look-ahead token. */ + /* Shift the lookahead token. */ YY_SYMBOL_PRINT ("Shifting", yytoken, &yylval, &yylloc); - /* Discard the shifted token unless it is eof. */ - if (yychar != YYEOF) - yychar = YYEMPTY; + /* Discard the shifted token. */ + yychar = YYEMPTY; yystate = yyn; *++yyvsp = yylval; @@ -1535,7 +1548,9 @@ switch (yyn) { case 2: -#line 185 "das.y" + +/* Line 1455 of yacc.c */ +#line 194 "das.yy" { name = new string(); type = new string(); @@ -1547,7 +1562,9 @@ break; case 3: -#line 194 "das.y" + +/* Line 1455 of yacc.c */ +#line 203 "das.yy" { POP; // pop the DAS/AttrTable before stack's dtor delete name; @@ -1557,114 +1574,158 @@ break; case 7: -#line 209 "das.y" + +/* Line 1455 of yacc.c */ +#line 218 "das.yy" { parse_error((parser_arg *)arg, NO_DAS_MSG, das_line_num); ;} break; case 12: -#line 221 "das.y" + +/* Line 1455 of yacc.c */ +#line 230 "das.yy" { save_str(*type, "Byte", das_line_num); ;} break; case 13: -#line 222 "das.y" + +/* Line 1455 of yacc.c */ +#line 231 "das.yy" { save_str(*name, (yyvsp[(3) - (3)]), das_line_num); ;} break; case 15: -#line 225 "das.y" + +/* Line 1455 of yacc.c */ +#line 234 "das.yy" { save_str(*type, "Int16", das_line_num); ;} break; case 16: -#line 226 "das.y" + +/* Line 1455 of yacc.c */ +#line 235 "das.yy" { save_str(*name, (yyvsp[(3) - (3)]), das_line_num); ;} break; case 18: -#line 229 "das.y" + +/* Line 1455 of yacc.c */ +#line 238 "das.yy" { save_str(*type, "UInt16", das_line_num); ;} break; case 19: -#line 230 "das.y" + +/* Line 1455 of yacc.c */ +#line 239 "das.yy" { save_str(*name, (yyvsp[(3) - (3)]), das_line_num); ;} break; case 21: -#line 233 "das.y" + +/* Line 1455 of yacc.c */ +#line 242 "das.yy" { save_str(*type, "Int32", das_line_num); ;} break; case 22: -#line 234 "das.y" + +/* Line 1455 of yacc.c */ +#line 243 "das.yy" { save_str(*name, (yyvsp[(3) - (3)]), das_line_num); ;} break; case 24: -#line 237 "das.y" + +/* Line 1455 of yacc.c */ +#line 246 "das.yy" { save_str(*type, "UInt32", das_line_num); ;} break; case 25: -#line 238 "das.y" + +/* Line 1455 of yacc.c */ +#line 247 "das.yy" { save_str(*name, (yyvsp[(3) - (3)]), das_line_num); ;} break; case 27: -#line 241 "das.y" + +/* Line 1455 of yacc.c */ +#line 250 "das.yy" { save_str(*type, "Float32", das_line_num); ;} break; case 28: -#line 242 "das.y" + +/* Line 1455 of yacc.c */ +#line 251 "das.yy" { save_str(*name, (yyvsp[(3) - (3)]), das_line_num); ;} break; case 30: -#line 245 "das.y" + +/* Line 1455 of yacc.c */ +#line 254 "das.yy" { save_str(*type, "Float64", das_line_num); ;} break; case 31: -#line 246 "das.y" + +/* Line 1455 of yacc.c */ +#line 255 "das.yy" { save_str(*name, (yyvsp[(3) - (3)]), das_line_num); ;} break; case 33: -#line 249 "das.y" + +/* Line 1455 of yacc.c */ +#line 258 "das.yy" { *type = "String"; ;} break; case 34: -#line 250 "das.y" + +/* Line 1455 of yacc.c */ +#line 259 "das.yy" { *name = (yyvsp[(3) - (3)]); ;} break; case 36: -#line 253 "das.y" + +/* Line 1455 of yacc.c */ +#line 262 "das.yy" { *type = "Url"; ;} break; case 37: -#line 254 "das.y" + +/* Line 1455 of yacc.c */ +#line 263 "das.yy" { *name = (yyvsp[(3) - (3)]); ;} break; case 39: -#line 257 "das.y" + +/* Line 1455 of yacc.c */ +#line 266 "das.yy" { *type = "OtherXML"; ;} break; case 40: -#line 258 "das.y" + +/* Line 1455 of yacc.c */ +#line 267 "das.yy" { *name = (yyvsp[(3) - (3)]); ;} break; case 42: -#line 262 "das.y" + +/* Line 1455 of yacc.c */ +#line 271 "das.yy" { DBG(cerr << "Processing ID: " << (yyvsp[(1) - (1)]) << endl); @@ -1687,7 +1748,9 @@ break; case 43: -#line 282 "das.y" + +/* Line 1455 of yacc.c */ +#line 291 "das.yy" { /* pop top of stack; store in attr_tab */ DBG(cerr << " Popped attr_tab: " << TOP_OF_STACK << endl); @@ -1696,112 +1759,144 @@ break; case 45: -#line 290 "das.y" + +/* Line 1455 of yacc.c */ +#line 299 "das.yy" { parse_error(ATTR_TUPLE_MSG, das_line_num, (yyvsp[(1) - (1)])); ;} break; case 47: -#line 296 "das.y" + +/* Line 1455 of yacc.c */ +#line 305 "das.yy" { add_attribute(*type, *name, (yyvsp[(1) - (1)]), &check_byte); ;} break; case 48: -#line 300 "das.y" + +/* Line 1455 of yacc.c */ +#line 309 "das.yy" { add_attribute(*type, *name, (yyvsp[(3) - (3)]), &check_byte); ;} break; case 49: -#line 306 "das.y" + +/* Line 1455 of yacc.c */ +#line 315 "das.yy" { add_attribute(*type, *name, (yyvsp[(1) - (1)]), &check_int16); ;} break; case 50: -#line 310 "das.y" + +/* Line 1455 of yacc.c */ +#line 319 "das.yy" { add_attribute(*type, *name, (yyvsp[(3) - (3)]), &check_int16); ;} break; case 51: -#line 316 "das.y" + +/* Line 1455 of yacc.c */ +#line 325 "das.yy" { add_attribute(*type, *name, (yyvsp[(1) - (1)]), &check_uint16); ;} break; case 52: -#line 320 "das.y" + +/* Line 1455 of yacc.c */ +#line 329 "das.yy" { add_attribute(*type, *name, (yyvsp[(3) - (3)]), &check_uint16); ;} break; case 53: -#line 326 "das.y" + +/* Line 1455 of yacc.c */ +#line 335 "das.yy" { add_attribute(*type, *name, (yyvsp[(1) - (1)]), &check_int32); ;} break; case 54: -#line 330 "das.y" + +/* Line 1455 of yacc.c */ +#line 339 "das.yy" { add_attribute(*type, *name, (yyvsp[(3) - (3)]), &check_int32); ;} break; case 55: -#line 336 "das.y" + +/* Line 1455 of yacc.c */ +#line 345 "das.yy" { add_attribute(*type, *name, (yyvsp[(1) - (1)]), &check_uint32); ;} break; case 56: -#line 340 "das.y" + +/* Line 1455 of yacc.c */ +#line 349 "das.yy" { add_attribute(*type, *name, (yyvsp[(3) - (3)]), &check_uint32); ;} break; case 57: -#line 346 "das.y" + +/* Line 1455 of yacc.c */ +#line 355 "das.yy" { add_attribute(*type, *name, (yyvsp[(1) - (1)]), &check_float32); ;} break; case 58: -#line 350 "das.y" + +/* Line 1455 of yacc.c */ +#line 359 "das.yy" { add_attribute(*type, *name, (yyvsp[(3) - (3)]), &check_float32); ;} break; case 59: -#line 356 "das.y" + +/* Line 1455 of yacc.c */ +#line 365 "das.yy" { add_attribute(*type, *name, (yyvsp[(1) - (1)]), &check_float64); ;} break; case 60: -#line 360 "das.y" + +/* Line 1455 of yacc.c */ +#line 369 "das.yy" { add_attribute(*type, *name, (yyvsp[(3) - (3)]), &check_float64); ;} break; case 61: -#line 366 "das.y" + +/* Line 1455 of yacc.c */ +#line 375 "das.yy" { string attr = remove_quotes((yyvsp[(1) - (1)])); add_attribute(*type, *name, attr, 0); @@ -1809,7 +1904,9 @@ break; case 62: -#line 371 "das.y" + +/* Line 1455 of yacc.c */ +#line 380 "das.yy" { string attr = remove_quotes((yyvsp[(3) - (3)])); add_attribute(*type, *name, attr, 0); @@ -1817,21 +1914,27 @@ break; case 63: -#line 378 "das.y" + +/* Line 1455 of yacc.c */ +#line 387 "das.yy" { add_attribute(*type, *name, (yyvsp[(1) - (1)]), &check_url); ;} break; case 64: -#line 382 "das.y" + +/* Line 1455 of yacc.c */ +#line 391 "das.yy" { add_attribute(*type, *name, (yyvsp[(3) - (3)]), &check_url); ;} break; case 65: -#line 388 "das.y" + +/* Line 1455 of yacc.c */ +#line 397 "das.yy" { // XML must be quoted in the DAS but the quotes are an // artifact of the DAS syntax so they are not part of the @@ -1848,14 +1951,18 @@ break; case 82: -#line 418 "das.y" + +/* Line 1455 of yacc.c */ +#line 427 "das.yy" { *name = (yyvsp[(2) - (2)]); ;} break; case 83: -#line 422 "das.y" + +/* Line 1455 of yacc.c */ +#line 431 "das.yy" { add_alias( DAS_OBJ(arg)->get_top_level_attributes(), TOP_OF_STACK, *name, string((yyvsp[(4) - (4)])) ) ; @@ -1863,8 +1970,9 @@ break; -/* Line 1267 of yacc.c. */ -#line 1868 "das.tab.cc" + +/* Line 1455 of yacc.c */ +#line 1976 "das.tab.cc" default: break; } YY_SYMBOL_PRINT ("-> $$ =", yyr1[yyn], &yyval, &yyloc); @@ -1875,7 +1983,6 @@ *++yyvsp = yyval; - /* Now `shift' the result of the reduction. Determine what state that goes to, based on the state we popped back to and the rule number reduced by. */ @@ -1900,7 +2007,7 @@ { ++yynerrs; #if ! YYERROR_VERBOSE - yyerror (YY_("syntax error")); + yyerror (arg, YY_("syntax error")); #else { YYSIZE_T yysize = yysyntax_error (0, yystate, yychar); @@ -1924,11 +2031,11 @@ if (0 < yysize && yysize <= yymsg_alloc) { (void) yysyntax_error (yymsg, yystate, yychar); - yyerror (yymsg); + yyerror (arg, yymsg); } else { - yyerror (YY_("syntax error")); + yyerror (arg, YY_("syntax error")); if (yysize != 0) goto yyexhaustedlab; } @@ -1940,7 +2047,7 @@ if (yyerrstatus == 3) { - /* If just tried and failed to reuse look-ahead token after an + /* If just tried and failed to reuse lookahead token after an error, discard it. */ if (yychar <= YYEOF) @@ -1952,12 +2059,12 @@ else { yydestruct ("Error: discarding", - yytoken, &yylval); + yytoken, &yylval, arg); yychar = YYEMPTY; } } - /* Else will try to reuse look-ahead token after shifting the error + /* Else will try to reuse lookahead token after shifting the error token. */ goto yyerrlab1; @@ -2008,15 +2115,12 @@ yydestruct ("Error: popping", - yystos[yystate], yyvsp); + yystos[yystate], yyvsp, arg); YYPOPSTACK (1); yystate = *yyssp; YY_STACK_PRINT (yyss, yyssp); } - if (yyn == YYFINAL) - YYACCEPT; - *++yyvsp = yylval; @@ -2041,20 +2145,20 @@ yyresult = 1; goto yyreturn; -#ifndef yyoverflow +#if !defined(yyoverflow) || YYERROR_VERBOSE /*-------------------------------------------------. | yyexhaustedlab -- memory exhaustion comes here. | `-------------------------------------------------*/ yyexhaustedlab: - yyerror (YY_("memory exhausted")); + yyerror (arg, YY_("memory exhausted")); yyresult = 2; /* Fall through. */ #endif yyreturn: - if (yychar != YYEOF && yychar != YYEMPTY) + if (yychar != YYEMPTY) yydestruct ("Cleanup: discarding lookahead", - yytoken, &yylval); + yytoken, &yylval, arg); /* Do not reclaim the symbols of the rule which action triggered this YYABORT or YYACCEPT. */ YYPOPSTACK (yylen); @@ -2062,7 +2166,7 @@ while (yyssp != yyss) { yydestruct ("Cleanup: popping", - yystos[*yyssp], yyvsp); + yystos[*yyssp], yyvsp, arg); YYPOPSTACK (1); } #ifndef yyoverflow @@ -2078,14 +2182,16 @@ } -#line 429 "das.y" + +/* Line 1675 of yacc.c */ +#line 438 "das.yy" // This function is required for linking, but DODS uses its own error // reporting mechanism. static void -daserror(char *) +daserror(parser_arg *, const string &) { } diff -Nru libdap-3.11.1/das.tab.hh libdap-3.12.0/das.tab.hh --- libdap-3.11.1/das.tab.hh 2011-05-06 17:50:24.000000000 +0000 +++ libdap-3.12.0/das.tab.hh 2013-10-17 21:27:40.000000000 +0000 @@ -1,24 +1,23 @@ -/* A Bison parser, made by GNU Bison 2.3. */ -/* Skeleton interface for Bison's Yacc-like parsers in C +/* A Bison parser, made by GNU Bison 2.4.1. */ - Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004, 2005, 2006 +/* Skeleton interface for Bison's Yacc-like parsers in C + + Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc. - - This program is free software; you can redistribute it and/or modify + + This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2, or (at your option) - any later version. - + the Free Software Foundation, either version 3 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., 51 Franklin Street, Fifth Floor, - Boston, MA 02110-1301, USA. */ + along with this program. If not, see . */ /* As a special exception, you may create a larger work that contains part or all of the Bison parser skeleton and distribute that work @@ -29,10 +28,63 @@ special exception, which will cause the skeleton and the resulting Bison output files to be licensed under the GNU General Public License without this special exception. - + This special exception was added by the Free Software Foundation in version 2.2 of Bison. */ +/* "%code requires" blocks. */ + +/* Line 1676 of yacc.c */ +#line 40 "das.yy" + + +#define YYSTYPE char * +#define ATTR_STRING_QUOTE_FIX + +#include "config.h" + +#include + +#include + +#include "DAS.h" +#include "Error.h" +#include "util.h" +#include "escaping.h" +#include "debug.h" +#include "parser.h" +#include "util.h" + // #include "das.tab.hh" + +#ifdef TRACE_NEW +#include "trace_new.h" +#endif + +#define yylex daslex +#define yyerror daserror + +using namespace std; +using namespace libdap ; + +// These macros are used to access the `arguments' passed to the parser. A +// pointer to an error object and a pointer to an integer status variable are +// passed in to the parser within a structure (which itself is passed as a +// pointer). Note that the ERROR macro explicitly casts OBJ to an ERROR *. +// The parser now throws an exception when it encounters an error. 5/23/2002 +// jhrg + +#define DAS_OBJ(arg) ((DAS *)((parser_arg *)(arg))->_object) + +//#define YYPARSE_PARAM arg + +extern int das_line_num; /* defined in das.lex */ + + + + +/* Line 1676 of yacc.c */ +#line 87 "das.tab.hh" + /* Tokens. */ #ifndef YYTOKENTYPE # define YYTOKENTYPE @@ -54,30 +106,16 @@ SCAN_XML = 270 }; #endif -/* Tokens. */ -#define SCAN_ATTR 258 -#define SCAN_WORD 259 -#define SCAN_ALIAS 260 -#define SCAN_BYTE 261 -#define SCAN_INT16 262 -#define SCAN_UINT16 263 -#define SCAN_INT32 264 -#define SCAN_UINT32 265 -#define SCAN_FLOAT32 266 -#define SCAN_FLOAT64 267 -#define SCAN_STRING 268 -#define SCAN_URL 269 -#define SCAN_XML 270 - #if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED typedef int YYSTYPE; +# define YYSTYPE_IS_TRIVIAL 1 # define yystype YYSTYPE /* obsolescent; will be withdrawn */ # define YYSTYPE_IS_DECLARED 1 -# define YYSTYPE_IS_TRIVIAL 1 #endif extern YYSTYPE daslval; + diff -Nru libdap-3.11.1/das.y libdap-3.12.0/das.y --- libdap-3.11.1/das.y 2011-04-29 13:19:43.000000000 +0000 +++ libdap-3.12.0/das.y 1970-01-01 00:00:00.000000000 +0000 @@ -1,547 +0,0 @@ - -// -*- mode: c++; c-basic-offset:4 -*- - -// This file is part of libdap, A C++ implementation of the OPeNDAP Data -// Access Protocol. - -// Copyright (c) 2002,2003 OPeNDAP, Inc. -// Author: James Gallagher -// -// This library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Lesser General Public -// License as published by the Free Software Foundation; either -// version 2.1 of the License, or (at your option) any later version. -// -// This library 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 -// Lesser General Public License for more details. -// -// You should have received a copy of the GNU Lesser General Public -// License along with this library; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -// -// You can contact OPeNDAP, Inc. at PO Box 112, Saunderstown, RI. 02874-0112. - -// (c) COPYRIGHT URI/MIT 1994-1999 -// Please read the full copyright statement in the file COPYRIGHT_URI. -// -// Authors: -// jhrg,jimg James Gallagher - -/* - Grammar for the DAS. This grammar can be used with the bison parser - generator to build a parser for the DAS. It assumes that a scanner called - `daslex()' exists and that the objects DAS and AttrTable also exist. - - jhrg 7/12/94 -*/ - -%{ - -#define YYSTYPE char * -#define ATTR_STRING_QUOTE_FIX - -#include "config.h" - -static char rcsid[] not_used = {"$Id: das.y 21577 2009-10-02 16:12:17Z jimg $"}; - -#include - -#include - -#include "DAS.h" -#include "Error.h" -#include "util.h" -#include "escaping.h" -#include "debug.h" -#include "parser.h" -#include "util.h" -#include "das.tab.hh" - -#ifdef TRACE_NEW -#include "trace_new.h" -#endif - -#define yylex daslex -#define yyerror daserror - -using namespace std; -using namespace libdap ; - -// These macros are used to access the `arguments' passed to the parser. A -// pointer to an error object and a pointer to an integer status variable are -// passed in to the parser within a structure (which itself is passed as a -// pointer). Note that the ERROR macro explicitly casts OBJ to an ERROR *. -// The parser now throws an exception when it encounters an error. 5/23/2002 -// jhrg - -#define DAS_OBJ(arg) ((DAS *)((parser_arg *)(arg))->_object) - -#define YYPARSE_PARAM arg - -extern int das_line_num; /* defined in das.lex */ - -// No global static objects. We go through this every so often, I guess I -// should learn... 1/24/2000 jhrg -static string *name; /* holds name in attr_pair rule */ -static string *type; /* holds type in attr_pair rule */ - -static vector *attr_tab_stack; - -// I use a vector of AttrTable pointers for a stack - -#define TOP_OF_STACK (attr_tab_stack->back()) -#define PUSH(x) (attr_tab_stack->push_back((x))) -#define POP (attr_tab_stack->pop_back()) -#define STACK_LENGTH (attr_tab_stack->size()) -#define OUTER_TABLE_ONLY (attr_tab_stack->size() == 1) -#define STACK_EMPTY (attr_tab_stack->empty()) - -#define TYPE_NAME_VALUE(x) *type << " " << *name << " " << (x) - -static const char *ATTR_TUPLE_MSG = -"Expected an attribute type (Byte, Int16, UInt16, Int32, UInt32, Float32,\n\ -Float64, String or Url) followed by a name and value."; -static const char *NO_DAS_MSG = -"The attribute object returned from the dataset was null\n\ -Check that the URL is correct."; - -typedef int checker(const char *); - -int daslex(void); -static void daserror(char *s); -static void add_attribute(const string &type, const string &name, - const string &value, checker *chk) throw (Error); -static void add_alias(AttrTable *das, AttrTable *current, const string &name, - const string &src) throw (Error); -static void add_bad_attribute(AttrTable *attr, const string &type, - const string &name, const string &value, - const string &msg); - -%} - -%expect 26 - -%token SCAN_ATTR - -%token SCAN_WORD - -%token SCAN_ALIAS - -%token SCAN_BYTE -%token SCAN_INT16 -%token SCAN_UINT16 -%token SCAN_INT32 -%token SCAN_UINT32 -%token SCAN_FLOAT32 -%token SCAN_FLOAT64 -%token SCAN_STRING -%token SCAN_URL -%token SCAN_XML - -%% - -/* - Parser algorithm: - - Look for a `variable' name (this can be any identifier, but by convention - it is either the name of a variable in a dataset or the name of a grouping - of global attributes). Create a new attribute table for this identifier and - push the new attribute table onto a stack. If attribute tuples - (type-name-value tuples) are found, intern them in the attribute table - found on the top of the stack. If the start of a new attribute table if - found (before the current table is closed), create the new table and push - *it* on the stack. As attribute tables are closed, pop them off the stack. - This algorithm ensures that we can nest attribute tables to an arbitrary - depth. - - Aliases are handled using mfuncs of both the DAS and AttrTable objects. This - is necessary because the first level of a DAS object can contain only - AttrTables, not attribute tuples. Whereas, the subsequent levels can - contain both. Thus the compete definition is split into two objects. In - part this is also a hold over from an older design which did not - have the recursive properties of the current design. - - Aliases can be made between attributes within a given lexical level, from - one level to the next within a sub-hierarchy or across hierarchies. - - Tokens: - - BYTE, INT32, UINT32, FLOAT64, STRING and URL are tokens for the type - keywords. The tokens INT, FLOAT, STR and ID are returned by the scanner to - indicate the type of the value represented by the string contained in the - global DASLVAL. These two types of tokens are used to implement type - checking for the attributes. See the rules `bytes', etc. Additional tokens: - ATTR (indicates the start of an attribute object) and ALIAS (indicates an - alias). */ - -/* This rule makes sure the objects needed by this parser are built. Because - the DODS DAP library is often used with linkers that are not C++-aware, we - cannot use global objects (because their constructors might never be - called). I had thought this was going to go away... 1/24/2000 jhrg */ - -attr_start: - { - name = new string(); - type = new string(); - attr_tab_stack = new vector; - - // push outermost AttrTable - PUSH(DAS_OBJ(arg)->get_top_level_attributes()); - } - attributes - { - POP; // pop the DAS/AttrTable before stack's dtor - delete name; - delete type; - delete attr_tab_stack; - } -; - -attributes: attribute - | attributes attribute - -; - -attribute: SCAN_ATTR '{' attr_list '}' - | error - { - parse_error((parser_arg *)arg, NO_DAS_MSG, das_line_num); - } -; - -attr_list: /* empty */ - | attr_tuple - | attr_list attr_tuple -; - -attr_tuple: alias - - | SCAN_BYTE { save_str(*type, "Byte", das_line_num); } - name { save_str(*name, $3, das_line_num); } - bytes ';' - - | SCAN_INT16 { save_str(*type, "Int16", das_line_num); } - name { save_str(*name, $3, das_line_num); } - int16 ';' - - | SCAN_UINT16 { save_str(*type, "UInt16", das_line_num); } - name { save_str(*name, $3, das_line_num); } - uint16 ';' - - | SCAN_INT32 { save_str(*type, "Int32", das_line_num); } - name { save_str(*name, $3, das_line_num); } - int32 ';' - - | SCAN_UINT32 { save_str(*type, "UInt32", das_line_num); } - name { save_str(*name, $3, das_line_num); } - uint32 ';' - - | SCAN_FLOAT32 { save_str(*type, "Float32", das_line_num); } - name { save_str(*name, $3, das_line_num); } - float32 ';' - - | SCAN_FLOAT64 { save_str(*type, "Float64", das_line_num); } - name { save_str(*name, $3, das_line_num); } - float64 ';' - - | SCAN_STRING { *type = "String"; } - name { *name = $3; } - strs ';' - - | SCAN_URL { *type = "Url"; } - name { *name = $3; } - urls ';' - - | SCAN_XML { *type = "OtherXML"; } - name { *name = $3; } - xml ';' - - | SCAN_WORD - { - DBG(cerr << "Processing ID: " << $1 << endl); - - AttrTable *at = TOP_OF_STACK->get_attr_table($1); - if (!at) { - try { - at = TOP_OF_STACK->append_container($1); - } - catch (Error &e) { - // re-throw with line number info - parse_error(e.get_error_message().c_str(), - das_line_num); - } - } - PUSH(at); - - DBG(cerr << " Pushed attr_tab: " << at << endl); - - } - '{' attr_list - { - /* pop top of stack; store in attr_tab */ - DBG(cerr << " Popped attr_tab: " << TOP_OF_STACK << endl); - POP; - } - '}' - - | error - { - parse_error(ATTR_TUPLE_MSG, das_line_num, $1); - } ';' -; - -bytes: SCAN_WORD - { - add_attribute(*type, *name, $1, &check_byte); - } - | bytes ',' SCAN_WORD - { - add_attribute(*type, *name, $3, &check_byte); - } -; - -int16: SCAN_WORD - { - add_attribute(*type, *name, $1, &check_int16); - } - | int16 ',' SCAN_WORD - { - add_attribute(*type, *name, $3, &check_int16); - } -; - -uint16: SCAN_WORD - { - add_attribute(*type, *name, $1, &check_uint16); - } - | uint16 ',' SCAN_WORD - { - add_attribute(*type, *name, $3, &check_uint16); - } -; - -int32: SCAN_WORD - { - add_attribute(*type, *name, $1, &check_int32); - } - | int32 ',' SCAN_WORD - { - add_attribute(*type, *name, $3, &check_int32); - } -; - -uint32: SCAN_WORD - { - add_attribute(*type, *name, $1, &check_uint32); - } - | uint32 ',' SCAN_WORD - { - add_attribute(*type, *name, $3, &check_uint32); - } -; - -float32: float_or_int - { - add_attribute(*type, *name, $1, &check_float32); - } - | float32 ',' float_or_int - { - add_attribute(*type, *name, $3, &check_float32); - } -; - -float64: float_or_int - { - add_attribute(*type, *name, $1, &check_float64); - } - | float64 ',' float_or_int - { - add_attribute(*type, *name, $3, &check_float64); - } -; - -strs: str_or_id - { - string attr = remove_quotes($1); - add_attribute(*type, *name, attr, 0); - } - | strs ',' str_or_id - { - string attr = remove_quotes($3); - add_attribute(*type, *name, attr, 0); - } -; - -urls: url - { - add_attribute(*type, *name, $1, &check_url); - } - | urls ',' url - { - add_attribute(*type, *name, $3, &check_url); - } -; - -xml: SCAN_WORD - { - // XML must be quoted in the DAS but the quotes are an - // artifact of the DAS syntax so they are not part of the - // value. - cerr << "Attr value as read: " << $1 << endl; - string xml = unescape_double_quotes($1); - cerr << "w/o quotes: " << remove_quotes(xml) << endl; - - if (is_quoted(xml)) - add_attribute(*type, *name, remove_quotes(xml), 0); - else - add_attribute(*type, *name, xml, 0); - } -; - -url: SCAN_WORD -; - -str_or_id: SCAN_WORD -; - -float_or_int: SCAN_WORD -; - -name: SCAN_WORD | SCAN_ATTR | SCAN_ALIAS | SCAN_BYTE | SCAN_INT16 - | SCAN_UINT16 | SCAN_INT32 | SCAN_UINT32 | SCAN_FLOAT32 - | SCAN_FLOAT64 | SCAN_STRING | SCAN_URL | SCAN_XML -; - -alias: SCAN_ALIAS SCAN_WORD - { - *name = $2; - } - SCAN_WORD - { - add_alias( DAS_OBJ(arg)->get_top_level_attributes(), - TOP_OF_STACK, *name, string($4) ) ; - } - ';' -; - -%% - -// This function is required for linking, but DODS uses its own error -// reporting mechanism. - -static void -daserror(char *) -{ -} - -static string -a_or_an(const string &subject) -{ - string first_char(1, subject[0]); - string::size_type pos = first_char.find_first_of("aeiouAEIOUyY"); - - if (pos == string::npos) - return "a"; - else - return "an"; -} - -// This code used to throw an exception when a bad attribute value came -// along; now it dumps the errant value(s) into a sub container called *_DODS -// and stores the parser's error message in a string attribute named -// `explanation.' -static void -add_attribute(const string &type, const string &name, const string &value, - checker *chk) throw (Error) -{ - DBG(cerr << "Adding: " << type << " " << name << " " << value \ - << " to Attrtable: " << TOP_OF_STACK << endl); - - if (chk && !(*chk)(value.c_str())) { - string msg = "`"; - msg += value + "' is not " + a_or_an(type) + " " + type + " value."; - add_bad_attribute(TOP_OF_STACK, type, name, value, msg); - return; - } - - if (STACK_EMPTY) { - string msg = "Whoa! Attribute table stack empty when adding `" ; - msg += name + ".' "; - parse_error(msg, das_line_num); - } - - try { -#if 0 - // Special treatment for XML: remove the double quotes that were - // included in the value by this parser. - if (type == OtherXML && is_quoted(value)) - TOP_OF_STACK->append_attr(name, type, value.substr(1, value.size()-2)); - else -#endif - TOP_OF_STACK->append_attr(name, type, value); - } - catch (Error &e) { - // re-throw with line number - parse_error(e.get_error_message().c_str(), das_line_num); - } -} - -static void -add_alias(AttrTable *das, AttrTable *current, const string &name, - const string &src) throw (Error) -{ - DBG(cerr << "Adding an alias: " << name << ": " << src << endl); - - AttrTable *table = das->get_attr_table(src); - if (table) { - try { - current->add_container_alias(name, table); - } - catch (Error &e) { - parse_error(e.get_error_message().c_str(), das_line_num); - } - } - else { - try { - current->add_value_alias(das, name, src); - } - catch (Error &e) { - parse_error(e.get_error_message().c_str(), das_line_num); - } - } -} - -static void -add_bad_attribute(AttrTable *attr, const string &type, const string &name, - const string &value, const string &msg) -{ - // First, if this bad value is already in a *_dods_errors container, - // then just add it. This can happen when the server side processes a DAS - // and then hands it off to a client which does the same. - // Make a new container. Call it _errors. If that container - // already exists, use it. - // Add the attribute. - // Add the error string to an attribute in the container called - // `get_name().find("_dods_errors") != string::npos) { - attr->append_attr(name, type, value); - } - else { - string error_cont_name = attr->get_name() + "_dods_errors"; - AttrTable *error_cont = attr->get_attr_table(error_cont_name); - if (!error_cont) - error_cont = attr->append_container(error_cont_name); - - error_cont->append_attr(name, type, value); -#ifndef ATTR_STRING_QUOTE_FIX - error_cont->append_attr(name + "_explanation", "String", - "\"" + msg + "\""); -#else - error_cont->append_attr(name + "_explanation", "String", msg); -#endif - } -} - diff -Nru libdap-3.11.1/das.yy libdap-3.12.0/das.yy --- libdap-3.11.1/das.yy 1970-01-01 00:00:00.000000000 +0000 +++ libdap-3.12.0/das.yy 2013-10-17 21:27:40.000000000 +0000 @@ -0,0 +1,556 @@ + +// -*- mode: c++; c-basic-offset:4 -*- + +// This file is part of libdap, A C++ implementation of the OPeNDAP Data +// Access Protocol. + +// Copyright (c) 2002,2003 OPeNDAP, Inc. +// Author: James Gallagher +// +// This library is free software; you can redistribute it and/or +// modify it under the terms of the GNU Lesser General Public +// License as published by the Free Software Foundation; either +// version 2.1 of the License, or (at your option) any later version. +// +// This library 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 +// Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// +// You can contact OPeNDAP, Inc. at PO Box 112, Saunderstown, RI. 02874-0112. + +// (c) COPYRIGHT URI/MIT 1994-1999 +// Please read the full copyright statement in the file COPYRIGHT_URI. +// +// Authors: +// jhrg,jimg James Gallagher + +/* + Grammar for the DAS. This grammar can be used with the bison parser + generator to build a parser for the DAS. It assumes that a scanner called + `daslex()' exists and that the objects DAS and AttrTable also exist. + + jhrg 7/12/94 +*/ + +%code requires { + +#define YYSTYPE char * +#define ATTR_STRING_QUOTE_FIX + +#include "config.h" + +#include + +#include + +#include "DAS.h" +#include "Error.h" +#include "util.h" +#include "escaping.h" +#include "debug.h" +#include "parser.h" +#include "util.h" + // #include "das.tab.hh" + +#ifdef TRACE_NEW +#include "trace_new.h" +#endif + +#define yylex daslex +#define yyerror daserror + +using namespace std; +using namespace libdap ; + +// These macros are used to access the `arguments' passed to the parser. A +// pointer to an error object and a pointer to an integer status variable are +// passed in to the parser within a structure (which itself is passed as a +// pointer). Note that the ERROR macro explicitly casts OBJ to an ERROR *. +// The parser now throws an exception when it encounters an error. 5/23/2002 +// jhrg + +#define DAS_OBJ(arg) ((DAS *)((parser_arg *)(arg))->_object) + +//#define YYPARSE_PARAM arg + +extern int das_line_num; /* defined in das.lex */ + +} // code requires + +%code { +// No global static objects. We go through this every so often, I guess I +// should learn... 1/24/2000 jhrg +static string *name; /* holds name in attr_pair rule */ +static string *type; /* holds type in attr_pair rule */ + +static vector *attr_tab_stack; + +// I use a vector of AttrTable pointers for a stack + +#define TOP_OF_STACK (attr_tab_stack->back()) +#define PUSH(x) (attr_tab_stack->push_back((x))) +#define POP (attr_tab_stack->pop_back()) +#define STACK_LENGTH (attr_tab_stack->size()) +#define OUTER_TABLE_ONLY (attr_tab_stack->size() == 1) +#define STACK_EMPTY (attr_tab_stack->empty()) + +#define TYPE_NAME_VALUE(x) *type << " " << *name << " " << (x) + +static const char *ATTR_TUPLE_MSG = +"Expected an attribute type (Byte, Int16, UInt16, Int32, UInt32, Float32,\n\ +Float64, String or Url) followed by a name and value."; +static const char *NO_DAS_MSG = +"The attribute object returned from the dataset was null\n\ +Check that the URL is correct."; + +typedef int checker(const char *); + +int daslex(void); +static void daserror(parser_arg *arg, const string &s /*char *s*/); +static void add_attribute(const string &type, const string &name, + const string &value, checker *chk) throw (Error); +static void add_alias(AttrTable *das, AttrTable *current, const string &name, + const string &src) throw (Error); +static void add_bad_attribute(AttrTable *attr, const string &type, + const string &name, const string &value, + const string &msg); + +} // code + +%require "2.4" + +%parse-param {parser_arg *arg} +%name-prefix "das" +%defines +%debug +%verbose + +%expect 26 + +%token SCAN_ATTR + +%token SCAN_WORD + +%token SCAN_ALIAS + +%token SCAN_BYTE +%token SCAN_INT16 +%token SCAN_UINT16 +%token SCAN_INT32 +%token SCAN_UINT32 +%token SCAN_FLOAT32 +%token SCAN_FLOAT64 +%token SCAN_STRING +%token SCAN_URL +%token SCAN_XML + +%% + +/* + Parser algorithm: + + Look for a `variable' name (this can be any identifier, but by convention + it is either the name of a variable in a dataset or the name of a grouping + of global attributes). Create a new attribute table for this identifier and + push the new attribute table onto a stack. If attribute tuples + (type-name-value tuples) are found, intern them in the attribute table + found on the top of the stack. If the start of a new attribute table if + found (before the current table is closed), create the new table and push + *it* on the stack. As attribute tables are closed, pop them off the stack. + This algorithm ensures that we can nest attribute tables to an arbitrary + depth. + + Aliases are handled using mfuncs of both the DAS and AttrTable objects. This + is necessary because the first level of a DAS object can contain only + AttrTables, not attribute tuples. Whereas, the subsequent levels can + contain both. Thus the compete definition is split into two objects. In + part this is also a hold over from an older design which did not + have the recursive properties of the current design. + + Aliases can be made between attributes within a given lexical level, from + one level to the next within a sub-hierarchy or across hierarchies. + + Tokens: + + BYTE, INT32, UINT32, FLOAT64, STRING and URL are tokens for the type + keywords. The tokens INT, FLOAT, STR and ID are returned by the scanner to + indicate the type of the value represented by the string contained in the + global DASLVAL. These two types of tokens are used to implement type + checking for the attributes. See the rules `bytes', etc. Additional tokens: + ATTR (indicates the start of an attribute object) and ALIAS (indicates an + alias). */ + +/* This rule makes sure the objects needed by this parser are built. Because + the DODS DAP library is often used with linkers that are not C++-aware, we + cannot use global objects (because their constructors might never be + called). I had thought this was going to go away... 1/24/2000 jhrg */ + +attr_start: + { + name = new string(); + type = new string(); + attr_tab_stack = new vector; + + // push outermost AttrTable + PUSH(DAS_OBJ(arg)->get_top_level_attributes()); + } + attributes + { + POP; // pop the DAS/AttrTable before stack's dtor + delete name; + delete type; + delete attr_tab_stack; + } +; + +attributes: attribute + | attributes attribute + +; + +attribute: SCAN_ATTR '{' attr_list '}' + | error + { + parse_error((parser_arg *)arg, NO_DAS_MSG, das_line_num); + } +; + +attr_list: /* empty */ + | attr_tuple + | attr_list attr_tuple +; + +attr_tuple: alias + + | SCAN_BYTE { save_str(*type, "Byte", das_line_num); } + name { save_str(*name, $3, das_line_num); } + bytes ';' + + | SCAN_INT16 { save_str(*type, "Int16", das_line_num); } + name { save_str(*name, $3, das_line_num); } + int16 ';' + + | SCAN_UINT16 { save_str(*type, "UInt16", das_line_num); } + name { save_str(*name, $3, das_line_num); } + uint16 ';' + + | SCAN_INT32 { save_str(*type, "Int32", das_line_num); } + name { save_str(*name, $3, das_line_num); } + int32 ';' + + | SCAN_UINT32 { save_str(*type, "UInt32", das_line_num); } + name { save_str(*name, $3, das_line_num); } + uint32 ';' + + | SCAN_FLOAT32 { save_str(*type, "Float32", das_line_num); } + name { save_str(*name, $3, das_line_num); } + float32 ';' + + | SCAN_FLOAT64 { save_str(*type, "Float64", das_line_num); } + name { save_str(*name, $3, das_line_num); } + float64 ';' + + | SCAN_STRING { *type = "String"; } + name { *name = $3; } + strs ';' + + | SCAN_URL { *type = "Url"; } + name { *name = $3; } + urls ';' + + | SCAN_XML { *type = "OtherXML"; } + name { *name = $3; } + xml ';' + + | SCAN_WORD + { + DBG(cerr << "Processing ID: " << $1 << endl); + + AttrTable *at = TOP_OF_STACK->get_attr_table($1); + if (!at) { + try { + at = TOP_OF_STACK->append_container($1); + } + catch (Error &e) { + // re-throw with line number info + parse_error(e.get_error_message().c_str(), + das_line_num); + } + } + PUSH(at); + + DBG(cerr << " Pushed attr_tab: " << at << endl); + + } + '{' attr_list + { + /* pop top of stack; store in attr_tab */ + DBG(cerr << " Popped attr_tab: " << TOP_OF_STACK << endl); + POP; + } + '}' + + | error + { + parse_error(ATTR_TUPLE_MSG, das_line_num, $1); + } ';' +; + +bytes: SCAN_WORD + { + add_attribute(*type, *name, $1, &check_byte); + } + | bytes ',' SCAN_WORD + { + add_attribute(*type, *name, $3, &check_byte); + } +; + +int16: SCAN_WORD + { + add_attribute(*type, *name, $1, &check_int16); + } + | int16 ',' SCAN_WORD + { + add_attribute(*type, *name, $3, &check_int16); + } +; + +uint16: SCAN_WORD + { + add_attribute(*type, *name, $1, &check_uint16); + } + | uint16 ',' SCAN_WORD + { + add_attribute(*type, *name, $3, &check_uint16); + } +; + +int32: SCAN_WORD + { + add_attribute(*type, *name, $1, &check_int32); + } + | int32 ',' SCAN_WORD + { + add_attribute(*type, *name, $3, &check_int32); + } +; + +uint32: SCAN_WORD + { + add_attribute(*type, *name, $1, &check_uint32); + } + | uint32 ',' SCAN_WORD + { + add_attribute(*type, *name, $3, &check_uint32); + } +; + +float32: float_or_int + { + add_attribute(*type, *name, $1, &check_float32); + } + | float32 ',' float_or_int + { + add_attribute(*type, *name, $3, &check_float32); + } +; + +float64: float_or_int + { + add_attribute(*type, *name, $1, &check_float64); + } + | float64 ',' float_or_int + { + add_attribute(*type, *name, $3, &check_float64); + } +; + +strs: str_or_id + { + string attr = remove_quotes($1); + add_attribute(*type, *name, attr, 0); + } + | strs ',' str_or_id + { + string attr = remove_quotes($3); + add_attribute(*type, *name, attr, 0); + } +; + +urls: url + { + add_attribute(*type, *name, $1, &check_url); + } + | urls ',' url + { + add_attribute(*type, *name, $3, &check_url); + } +; + +xml: SCAN_WORD + { + // XML must be quoted in the DAS but the quotes are an + // artifact of the DAS syntax so they are not part of the + // value. + cerr << "Attr value as read: " << $1 << endl; + string xml = unescape_double_quotes($1); + cerr << "w/o quotes: " << remove_quotes(xml) << endl; + + if (is_quoted(xml)) + add_attribute(*type, *name, remove_quotes(xml), 0); + else + add_attribute(*type, *name, xml, 0); + } +; + +url: SCAN_WORD +; + +str_or_id: SCAN_WORD +; + +float_or_int: SCAN_WORD +; + +name: SCAN_WORD | SCAN_ATTR | SCAN_ALIAS | SCAN_BYTE | SCAN_INT16 + | SCAN_UINT16 | SCAN_INT32 | SCAN_UINT32 | SCAN_FLOAT32 + | SCAN_FLOAT64 | SCAN_STRING | SCAN_URL | SCAN_XML +; + +alias: SCAN_ALIAS SCAN_WORD + { + *name = $2; + } + SCAN_WORD + { + add_alias( DAS_OBJ(arg)->get_top_level_attributes(), + TOP_OF_STACK, *name, string($4) ) ; + } + ';' +; + +%% + +// This function is required for linking, but DODS uses its own error +// reporting mechanism. + +static void +daserror(parser_arg *, const string &) +{ +} + +static string +a_or_an(const string &subject) +{ + string first_char(1, subject[0]); + string::size_type pos = first_char.find_first_of("aeiouAEIOUyY"); + + if (pos == string::npos) + return "a"; + else + return "an"; +} + +// This code used to throw an exception when a bad attribute value came +// along; now it dumps the errant value(s) into a sub container called *_DODS +// and stores the parser's error message in a string attribute named +// `explanation.' +static void +add_attribute(const string &type, const string &name, const string &value, + checker *chk) throw (Error) +{ + DBG(cerr << "Adding: " << type << " " << name << " " << value \ + << " to Attrtable: " << TOP_OF_STACK << endl); + + if (chk && !(*chk)(value.c_str())) { + string msg = "`"; + msg += value + "' is not " + a_or_an(type) + " " + type + " value."; + add_bad_attribute(TOP_OF_STACK, type, name, value, msg); + return; + } + + if (STACK_EMPTY) { + string msg = "Whoa! Attribute table stack empty when adding `" ; + msg += name + ".' "; + parse_error(msg, das_line_num); + } + + try { +#if 0 + // Special treatment for XML: remove the double quotes that were + // included in the value by this parser. + if (type == OtherXML && is_quoted(value)) + TOP_OF_STACK->append_attr(name, type, value.substr(1, value.size()-2)); + else +#endif + TOP_OF_STACK->append_attr(name, type, value); + } + catch (Error &e) { + // re-throw with line number + parse_error(e.get_error_message().c_str(), das_line_num); + } +} + +static void +add_alias(AttrTable *das, AttrTable *current, const string &name, + const string &src) throw (Error) +{ + DBG(cerr << "Adding an alias: " << name << ": " << src << endl); + + AttrTable *table = das->get_attr_table(src); + if (table) { + try { + current->add_container_alias(name, table); + } + catch (Error &e) { + parse_error(e.get_error_message().c_str(), das_line_num); + } + } + else { + try { + current->add_value_alias(das, name, src); + } + catch (Error &e) { + parse_error(e.get_error_message().c_str(), das_line_num); + } + } +} + +static void +add_bad_attribute(AttrTable *attr, const string &type, const string &name, + const string &value, const string &msg) +{ + // First, if this bad value is already in a *_dods_errors container, + // then just add it. This can happen when the server side processes a DAS + // and then hands it off to a client which does the same. + // Make a new container. Call it _errors. If that container + // already exists, use it. + // Add the attribute. + // Add the error string to an attribute in the container called + // `get_name().find("_dods_errors") != string::npos) { + attr->append_attr(name, type, value); + } + else { + string error_cont_name = attr->get_name() + "_dods_errors"; + AttrTable *error_cont = attr->get_attr_table(error_cont_name); + if (!error_cont) + error_cont = attr->append_container(error_cont_name); + + error_cont->append_attr(name, type, value); +#ifndef ATTR_STRING_QUOTE_FIX + error_cont->append_attr(name + "_explanation", "String", + "\"" + msg + "\""); +#else + error_cont->append_attr(name + "_explanation", "String", msg); +#endif + } +} + diff -Nru libdap-3.11.1/dds.lex libdap-3.12.0/dds.lex --- libdap-3.11.1/dds.lex 2011-04-29 13:19:43.000000000 +0000 +++ libdap-3.12.0/dds.lex 2013-10-17 21:27:40.000000000 +0000 @@ -56,8 +56,6 @@ #include #include -static char rcsid[] not_used = {"$Id: dds.lex 20716 2009-04-08 19:50:54Z jimg $"}; - #include "parser.h" #include "dds.tab.hh" #include "escaping.h" @@ -80,7 +78,7 @@ #define YY_FATAL_ERROR(msg) {\ throw(Error(string("Error scanning DDS object text: ") + string(msg))); \ - yy_fatal_error(msg); /* 'Used' here to suppress warning */ \ + yy_fatal_error(msg); /* see das.lex */ \ } int dds_line_num = 1; @@ -90,6 +88,9 @@ %} %option noyywrap +%option nounput +%option noinput +%option 8bit %option prefix="dds" %option outfile="lex.dds.cc" %x comment diff -Nru libdap-3.11.1/dds.tab.cc libdap-3.12.0/dds.tab.cc --- libdap-3.11.1/dds.tab.cc 2011-05-06 17:50:24.000000000 +0000 +++ libdap-3.12.0/dds.tab.cc 2013-10-17 21:27:40.000000000 +0000 @@ -1,24 +1,23 @@ -/* A Bison parser, made by GNU Bison 2.3. */ -/* Skeleton implementation for Bison's Yacc-like parsers in C +/* A Bison parser, made by GNU Bison 2.4.1. */ - Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004, 2005, 2006 +/* Skeleton implementation for Bison's Yacc-like parsers in C + + Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc. - - This program is free software; you can redistribute it and/or modify + + This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2, or (at your option) - any later version. - + the Free Software Foundation, either version 3 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., 51 Franklin Street, Fifth Floor, - Boston, MA 02110-1301, USA. */ + along with this program. If not, see . */ /* As a special exception, you may create a larger work that contains part or all of the Bison parser skeleton and distribute that work @@ -29,7 +28,7 @@ special exception, which will cause the skeleton and the resulting Bison output files to be licensed under the GNU General Public License without this special exception. - + This special exception was added by the Free Software Foundation in version 2.2 of Bison. */ @@ -47,7 +46,7 @@ #define YYBISON 1 /* Bison version. */ -#define YYBISON_VERSION "2.3" +#define YYBISON_VERSION "2.4.1" /* Skeleton name. */ #define YYSKELETON_NAME "yacc.c" @@ -55,72 +54,57 @@ /* Pure parsers. */ #define YYPURE 0 +/* Push parsers. */ +#define YYPUSH 0 + +/* Pull parsers. */ +#define YYPULL 1 + /* Using locations. */ #define YYLSP_NEEDED 0 /* Substitute the variable and function names. */ -#define yyparse ddsparse -#define yylex ddslex -#define yyerror ddserror -#define yylval ddslval -#define yychar ddschar -#define yydebug ddsdebug -#define yynerrs ddsnerrs +#define yyparse ddsparse +#define yylex ddslex +#define yyerror ddserror +#define yylval ddslval +#define yychar ddschar +#define yydebug ddsdebug +#define yynerrs ddsnerrs -/* Tokens. */ -#ifndef YYTOKENTYPE -# define YYTOKENTYPE - /* Put the tokens into the symbol table, so that GDB and other debuggers - know about them. */ - enum yytokentype { - SCAN_WORD = 258, - SCAN_DATASET = 259, - SCAN_LIST = 260, - SCAN_SEQUENCE = 261, - SCAN_STRUCTURE = 262, - SCAN_FUNCTION = 263, - SCAN_GRID = 264, - SCAN_BYTE = 265, - SCAN_INT16 = 266, - SCAN_UINT16 = 267, - SCAN_INT32 = 268, - SCAN_UINT32 = 269, - SCAN_FLOAT32 = 270, - SCAN_FLOAT64 = 271, - SCAN_STRING = 272, - SCAN_URL = 273 - }; +/* Copy the first part of user declarations. */ + + +/* Line 189 of yacc.c */ +#line 81 "dds.tab.cc" + +/* Enabling traces. */ +#ifndef YYDEBUG +# define YYDEBUG 1 #endif -/* Tokens. */ -#define SCAN_WORD 258 -#define SCAN_DATASET 259 -#define SCAN_LIST 260 -#define SCAN_SEQUENCE 261 -#define SCAN_STRUCTURE 262 -#define SCAN_FUNCTION 263 -#define SCAN_GRID 264 -#define SCAN_BYTE 265 -#define SCAN_INT16 266 -#define SCAN_UINT16 267 -#define SCAN_INT32 268 -#define SCAN_UINT32 269 -#define SCAN_FLOAT32 270 -#define SCAN_FLOAT64 271 -#define SCAN_STRING 272 -#define SCAN_URL 273 +/* Enabling verbose error messages. */ +#ifdef YYERROR_VERBOSE +# undef YYERROR_VERBOSE +# define YYERROR_VERBOSE 1 +#else +# define YYERROR_VERBOSE 0 +#endif +/* Enabling the token table. */ +#ifndef YYTOKEN_TABLE +# define YYTOKEN_TABLE 0 +#endif +/* "%code requires" blocks. */ -/* Copy the first part of user declarations. */ -#line 47 "dds.y" +/* Line 209 of yacc.c */ +#line 47 "dds.yy" #include "config_dap.h" -static char rcsid[] not_used = {"$Id: dds.y 21577 2009-10-02 16:12:17Z jimg $"}; - #include #include #include @@ -157,10 +141,75 @@ // exceptions. 5/22/2002 jhrg #define DDS_OBJ(arg) ((DDS *)((parser_arg *)(arg))->_object) -#define YYPARSE_PARAM arg +// #define YYPARSE_PARAM arg extern int dds_line_num; /* defined in dds.lex */ + + + +/* Line 209 of yacc.c */ +#line 153 "dds.tab.cc" + +/* Tokens. */ +#ifndef YYTOKENTYPE +# define YYTOKENTYPE + /* Put the tokens into the symbol table, so that GDB and other debuggers + know about them. */ + enum yytokentype { + SCAN_WORD = 258, + SCAN_DATASET = 259, + SCAN_LIST = 260, + SCAN_SEQUENCE = 261, + SCAN_STRUCTURE = 262, + SCAN_FUNCTION = 263, + SCAN_GRID = 264, + SCAN_BYTE = 265, + SCAN_INT16 = 266, + SCAN_UINT16 = 267, + SCAN_INT32 = 268, + SCAN_UINT32 = 269, + SCAN_FLOAT32 = 270, + SCAN_FLOAT64 = 271, + SCAN_STRING = 272, + SCAN_URL = 273 + }; +#endif + + + +#if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED +typedef union YYSTYPE +{ + +/* Line 214 of yacc.c */ +#line 131 "dds.yy" + + bool boolean; + char word[ID_MAX]; + + + +/* Line 214 of yacc.c */ +#line 195 "dds.tab.cc" +} YYSTYPE; +# define YYSTYPE_IS_TRIVIAL 1 +# define yystype YYSTYPE /* obsolescent; will be withdrawn */ +# define YYSTYPE_IS_DECLARED 1 +#endif + + +/* Copy the second part of user declarations. */ + + +/* Line 264 of yacc.c */ +#line 207 "dds.tab.cc" +/* Unqualified %code blocks. */ + +/* Line 265 of yacc.c */ +#line 93 "dds.yy" + + // No global static objects in the dap library! 1/24/2000 jhrg static stack *ctor; static BaseType *current; @@ -176,9 +225,9 @@ (e.g., Int32 i;). Make sure that the variable name is not the name\n\ of a datatype and that the Array: and Maps: sections of a Grid are\n\ labeled properly."; - + int ddslex(); -void ddserror(char *s); +void ddserror(parser_arg *arg, const string &s /*char *s*/); void error_exit_cleanup(); void add_entry(DDS &table, stack **ctor, BaseType **current, Part p); @@ -187,46 +236,9 @@ -/* Enabling traces. */ -#ifndef YYDEBUG -# define YYDEBUG 0 -#endif - -/* Enabling verbose error messages. */ -#ifdef YYERROR_VERBOSE -# undef YYERROR_VERBOSE -# define YYERROR_VERBOSE 1 -#else -# define YYERROR_VERBOSE 0 -#endif - -/* Enabling the token table. */ -#ifndef YYTOKEN_TABLE -# define YYTOKEN_TABLE 0 -#endif - -#if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED -typedef union YYSTYPE -#line 121 "dds.y" -{ - bool boolean; - char word[ID_MAX]; -} -/* Line 187 of yacc.c. */ -#line 217 "dds.tab.cc" - YYSTYPE; -# define yystype YYSTYPE /* obsolescent; will be withdrawn */ -# define YYSTYPE_IS_DECLARED 1 -# define YYSTYPE_IS_TRIVIAL 1 -#endif - - - -/* Copy the second part of user declarations. */ - -/* Line 216 of yacc.c. */ -#line 230 "dds.tab.cc" +/* Line 265 of yacc.c */ +#line 242 "dds.tab.cc" #ifdef short # undef short @@ -301,14 +313,14 @@ #if (defined __STDC__ || defined __C99__FUNC__ \ || defined __cplusplus || defined _MSC_VER) static int -YYID (int i) +YYID (int yyi) #else static int -YYID (i) - int i; +YYID (yyi) + int yyi; #endif { - return i; + return yyi; } #endif @@ -389,9 +401,9 @@ /* A type that is properly aligned for any stack member. */ union yyalloc { - yytype_int16 yyss; - YYSTYPE yyvs; - }; + yytype_int16 yyss_alloc; + YYSTYPE yyvs_alloc; +}; /* The size of the maximum gap between one aligned stack and the next. */ # define YYSTACK_GAP_MAXIMUM (sizeof (union yyalloc) - 1) @@ -425,12 +437,12 @@ elements in the stack, and YYPTR gives the new location of the stack. Advance YYPTR to a properly aligned location for the next stack. */ -# define YYSTACK_RELOCATE(Stack) \ +# define YYSTACK_RELOCATE(Stack_alloc, Stack) \ do \ { \ YYSIZE_T yynewbytes; \ - YYCOPY (&yyptr->Stack, Stack, yysize); \ - Stack = &yyptr->Stack; \ + YYCOPY (&yyptr->Stack_alloc, Stack, yysize); \ + Stack = &yyptr->Stack_alloc; \ yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \ yyptr += yynewbytes / sizeof (*yyptr); \ } \ @@ -528,12 +540,12 @@ /* YYRLINE[YYN] -- source line where rule number YYN was defined. */ static const yytype_uint16 yyrline[] = { - 0, 150, 150, 150, 160, 161, 164, 168, 178, 182, - 183, 190, 213, 212, 233, 232, 253, 265, 277, 252, - 298, 309, 315, 321, 327, 328, 329, 330, 331, 332, - 333, 334, 335, 338, 339, 342, 342, 342, 342, 342, - 343, 343, 343, 343, 344, 344, 344, 344, 345, 348, - 372, 376, 371, 403, 414, 415, 416 + 0, 160, 160, 160, 170, 171, 174, 178, 188, 192, + 193, 200, 223, 222, 243, 242, 263, 275, 287, 262, + 308, 319, 325, 331, 337, 338, 339, 340, 341, 342, + 343, 344, 345, 348, 349, 352, 352, 352, 352, 352, + 353, 353, 353, 353, 354, 354, 354, 354, 355, 358, + 382, 386, 381, 413, 424, 425, 426 }; #endif @@ -546,10 +558,10 @@ "SCAN_SEQUENCE", "SCAN_STRUCTURE", "SCAN_FUNCTION", "SCAN_GRID", "SCAN_BYTE", "SCAN_INT16", "SCAN_UINT16", "SCAN_INT32", "SCAN_UINT32", "SCAN_FLOAT32", "SCAN_FLOAT64", "SCAN_STRING", "SCAN_URL", "'{'", "'}'", - "';'", "':'", "'['", "']'", "'='", "$accept", "start", "@1", "datasets", - "dataset", "declarations", "declaration", "@2", "@3", "@4", "@5", "@6", - "structure", "sequence", "grid", "base_type", "var", "var_name", - "array_decl", "@7", "@8", "name", 0 + "';'", "':'", "'['", "']'", "'='", "$accept", "start", "$@1", "datasets", + "dataset", "declarations", "declaration", "$@2", "$@3", "$@4", "$@5", + "$@6", "structure", "sequence", "grid", "base_type", "var", "var_name", + "array_decl", "$@7", "$@8", "name", 0 }; #endif @@ -732,7 +744,7 @@ } \ else \ { \ - yyerror (YY_("syntax error: cannot back up")); \ + yyerror (arg, YY_("syntax error: cannot back up")); \ YYERROR; \ } \ while (YYID (0)) @@ -812,7 +824,7 @@ { \ YYFPRINTF (stderr, "%s ", Title); \ yy_symbol_print (stderr, \ - Type, Value); \ + Type, Value, arg); \ YYFPRINTF (stderr, "\n"); \ } \ } while (YYID (0)) @@ -826,17 +838,19 @@ #if (defined __STDC__ || defined __C99__FUNC__ \ || defined __cplusplus || defined _MSC_VER) static void -yy_symbol_value_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep) +yy_symbol_value_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep, parser_arg *arg) #else static void -yy_symbol_value_print (yyoutput, yytype, yyvaluep) +yy_symbol_value_print (yyoutput, yytype, yyvaluep, arg) FILE *yyoutput; int yytype; YYSTYPE const * const yyvaluep; + parser_arg *arg; #endif { if (!yyvaluep) return; + YYUSE (arg); # ifdef YYPRINT if (yytype < YYNTOKENS) YYPRINT (yyoutput, yytoknum[yytype], *yyvaluep); @@ -858,13 +872,14 @@ #if (defined __STDC__ || defined __C99__FUNC__ \ || defined __cplusplus || defined _MSC_VER) static void -yy_symbol_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep) +yy_symbol_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep, parser_arg *arg) #else static void -yy_symbol_print (yyoutput, yytype, yyvaluep) +yy_symbol_print (yyoutput, yytype, yyvaluep, arg) FILE *yyoutput; int yytype; YYSTYPE const * const yyvaluep; + parser_arg *arg; #endif { if (yytype < YYNTOKENS) @@ -872,7 +887,7 @@ else YYFPRINTF (yyoutput, "nterm %s (", yytname[yytype]); - yy_symbol_value_print (yyoutput, yytype, yyvaluep); + yy_symbol_value_print (yyoutput, yytype, yyvaluep, arg); YYFPRINTF (yyoutput, ")"); } @@ -884,17 +899,20 @@ #if (defined __STDC__ || defined __C99__FUNC__ \ || defined __cplusplus || defined _MSC_VER) static void -yy_stack_print (yytype_int16 *bottom, yytype_int16 *top) +yy_stack_print (yytype_int16 *yybottom, yytype_int16 *yytop) #else static void -yy_stack_print (bottom, top) - yytype_int16 *bottom; - yytype_int16 *top; +yy_stack_print (yybottom, yytop) + yytype_int16 *yybottom; + yytype_int16 *yytop; #endif { YYFPRINTF (stderr, "Stack now"); - for (; bottom <= top; ++bottom) - YYFPRINTF (stderr, " %d", *bottom); + for (; yybottom <= yytop; yybottom++) + { + int yybot = *yybottom; + YYFPRINTF (stderr, " %d", yybot); + } YYFPRINTF (stderr, "\n"); } @@ -912,12 +930,13 @@ #if (defined __STDC__ || defined __C99__FUNC__ \ || defined __cplusplus || defined _MSC_VER) static void -yy_reduce_print (YYSTYPE *yyvsp, int yyrule) +yy_reduce_print (YYSTYPE *yyvsp, int yyrule, parser_arg *arg) #else static void -yy_reduce_print (yyvsp, yyrule) +yy_reduce_print (yyvsp, yyrule, arg) YYSTYPE *yyvsp; int yyrule; + parser_arg *arg; #endif { int yynrhs = yyr2[yyrule]; @@ -928,18 +947,18 @@ /* The symbols being reduced. */ for (yyi = 0; yyi < yynrhs; yyi++) { - fprintf (stderr, " $%d = ", yyi + 1); + YYFPRINTF (stderr, " $%d = ", yyi + 1); yy_symbol_print (stderr, yyrhs[yyprhs[yyrule] + yyi], &(yyvsp[(yyi + 1) - (yynrhs)]) - ); - fprintf (stderr, "\n"); + , arg); + YYFPRINTF (stderr, "\n"); } } # define YY_REDUCE_PRINT(Rule) \ do { \ if (yydebug) \ - yy_reduce_print (yyvsp, Rule); \ + yy_reduce_print (yyvsp, Rule, arg); \ } while (YYID (0)) /* Nonzero means print parse trace. It is left uninitialized so that @@ -1190,16 +1209,18 @@ #if (defined __STDC__ || defined __C99__FUNC__ \ || defined __cplusplus || defined _MSC_VER) static void -yydestruct (const char *yymsg, int yytype, YYSTYPE *yyvaluep) +yydestruct (const char *yymsg, int yytype, YYSTYPE *yyvaluep, parser_arg *arg) #else static void -yydestruct (yymsg, yytype, yyvaluep) +yydestruct (yymsg, yytype, yyvaluep, arg) const char *yymsg; int yytype; YYSTYPE *yyvaluep; + parser_arg *arg; #endif { YYUSE (yyvaluep); + YYUSE (arg); if (!yymsg) yymsg = "Deleting"; @@ -1212,10 +1233,8 @@ break; } } - /* Prevent warnings from -Wmissing-prototypes. */ - #ifdef YYPARSE_PARAM #if defined __STDC__ || defined __cplusplus int yyparse (void *YYPARSE_PARAM); @@ -1224,18 +1243,17 @@ #endif #else /* ! YYPARSE_PARAM */ #if defined __STDC__ || defined __cplusplus -int yyparse (void); +int yyparse (parser_arg *arg); #else int yyparse (); #endif #endif /* ! YYPARSE_PARAM */ - -/* The look-ahead symbol. */ +/* The lookahead symbol. */ int yychar; -/* The semantic value of the look-ahead symbol. */ +/* The semantic value of the lookahead symbol. */ YYSTYPE yylval; /* Number of syntax errors so far. */ @@ -1243,9 +1261,9 @@ -/*----------. -| yyparse. | -`----------*/ +/*-------------------------. +| yyparse or yypush_parse. | +`-------------------------*/ #ifdef YYPARSE_PARAM #if (defined __STDC__ || defined __C99__FUNC__ \ @@ -1261,74 +1279,76 @@ #if (defined __STDC__ || defined __C99__FUNC__ \ || defined __cplusplus || defined _MSC_VER) int -yyparse (void) +yyparse (parser_arg *arg) #else int -yyparse () - +yyparse (arg) + parser_arg *arg; #endif #endif { - - int yystate; - int yyn; - int yyresult; - /* Number of tokens to shift before error messages enabled. */ - int yyerrstatus; - /* Look-ahead token as an internal (translated) token number. */ - int yytoken = 0; -#if YYERROR_VERBOSE - /* Buffer for error messages, and its allocated size. */ - char yymsgbuf[128]; - char *yymsg = yymsgbuf; - YYSIZE_T yymsg_alloc = sizeof yymsgbuf; -#endif - /* Three stacks and their tools: - `yyss': related to states, - `yyvs': related to semantic values, - `yyls': related to locations. - - Refer to the stacks thru separate pointers, to allow yyoverflow - to reallocate them elsewhere. */ - - /* The state stack. */ - yytype_int16 yyssa[YYINITDEPTH]; - yytype_int16 *yyss = yyssa; - yytype_int16 *yyssp; - - /* The semantic value stack. */ - YYSTYPE yyvsa[YYINITDEPTH]; - YYSTYPE *yyvs = yyvsa; - YYSTYPE *yyvsp; + int yystate; + /* Number of tokens to shift before error messages enabled. */ + int yyerrstatus; + /* The stacks and their tools: + `yyss': related to states. + `yyvs': related to semantic values. -#define YYPOPSTACK(N) (yyvsp -= (N), yyssp -= (N)) + Refer to the stacks thru separate pointers, to allow yyoverflow + to reallocate them elsewhere. */ + + /* The state stack. */ + yytype_int16 yyssa[YYINITDEPTH]; + yytype_int16 *yyss; + yytype_int16 *yyssp; + + /* The semantic value stack. */ + YYSTYPE yyvsa[YYINITDEPTH]; + YYSTYPE *yyvs; + YYSTYPE *yyvsp; - YYSIZE_T yystacksize = YYINITDEPTH; + YYSIZE_T yystacksize; + int yyn; + int yyresult; + /* Lookahead token as an internal (translated) token number. */ + int yytoken; /* The variables used to return semantic value and location from the action routines. */ YYSTYPE yyval; +#if YYERROR_VERBOSE + /* Buffer for error messages, and its allocated size. */ + char yymsgbuf[128]; + char *yymsg = yymsgbuf; + YYSIZE_T yymsg_alloc = sizeof yymsgbuf; +#endif + +#define YYPOPSTACK(N) (yyvsp -= (N), yyssp -= (N)) /* The number of symbols on the RHS of the reduced rule. Keep to zero when no symbol should be popped. */ int yylen = 0; + yytoken = 0; + yyss = yyssa; + yyvs = yyvsa; + yystacksize = YYINITDEPTH; + YYDPRINTF ((stderr, "Starting parse\n")); yystate = 0; yyerrstatus = 0; yynerrs = 0; - yychar = YYEMPTY; /* Cause a token to be read. */ + yychar = YYEMPTY; /* Cause a token to be read. */ /* Initialize stack pointers. Waste one element of value and location stack so that they stay on the same level as the state stack. The wasted elements are never initialized. */ - yyssp = yyss; yyvsp = yyvs; @@ -1358,7 +1378,6 @@ YYSTYPE *yyvs1 = yyvs; yytype_int16 *yyss1 = yyss; - /* Each stack pointer address is followed by the size of the data in use in that stack, in bytes. This used to be a conditional around just the two extra args, but that might @@ -1366,7 +1385,6 @@ yyoverflow (YY_("memory exhausted"), &yyss1, yysize * sizeof (*yyssp), &yyvs1, yysize * sizeof (*yyvsp), - &yystacksize); yyss = yyss1; @@ -1389,9 +1407,8 @@ (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize)); if (! yyptr) goto yyexhaustedlab; - YYSTACK_RELOCATE (yyss); - YYSTACK_RELOCATE (yyvs); - + YYSTACK_RELOCATE (yyss_alloc, yyss); + YYSTACK_RELOCATE (yyvs_alloc, yyvs); # undef YYSTACK_RELOCATE if (yyss1 != yyssa) YYSTACK_FREE (yyss1); @@ -1402,7 +1419,6 @@ yyssp = yyss + yysize - 1; yyvsp = yyvs + yysize - 1; - YYDPRINTF ((stderr, "Stack size increased to %lu\n", (unsigned long int) yystacksize)); @@ -1412,6 +1428,9 @@ YYDPRINTF ((stderr, "Entering state %d\n", yystate)); + if (yystate == YYFINAL) + YYACCEPT; + goto yybackup; /*-----------. @@ -1420,16 +1439,16 @@ yybackup: /* Do appropriate processing given the current state. Read a - look-ahead token if we need one and don't already have one. */ + lookahead token if we need one and don't already have one. */ - /* First try to decide what to do without reference to look-ahead token. */ + /* First try to decide what to do without reference to lookahead token. */ yyn = yypact[yystate]; if (yyn == YYPACT_NINF) goto yydefault; - /* Not known => get a look-ahead token if don't already have one. */ + /* Not known => get a lookahead token if don't already have one. */ - /* YYCHAR is either YYEMPTY or YYEOF or a valid look-ahead symbol. */ + /* YYCHAR is either YYEMPTY or YYEOF or a valid lookahead symbol. */ if (yychar == YYEMPTY) { YYDPRINTF ((stderr, "Reading a token: ")); @@ -1461,20 +1480,16 @@ goto yyreduce; } - if (yyn == YYFINAL) - YYACCEPT; - /* Count tokens shifted since error; after three, turn off error status. */ if (yyerrstatus) yyerrstatus--; - /* Shift the look-ahead token. */ + /* Shift the lookahead token. */ YY_SYMBOL_PRINT ("Shifting", yytoken, &yylval, &yylloc); - /* Discard the shifted token unless it is eof. */ - if (yychar != YYEOF) - yychar = YYEMPTY; + /* Discard the shifted token. */ + yychar = YYEMPTY; yystate = yyn; *++yyvsp = yylval; @@ -1514,7 +1529,9 @@ switch (yyn) { case 2: -#line 150 "dds.y" + +/* Line 1455 of yacc.c */ +#line 160 "dds.yy" { /* On entry to the parser, make the BaseType stack. */ ctor = new stack; @@ -1522,21 +1539,27 @@ break; case 3: -#line 155 "dds.y" + +/* Line 1455 of yacc.c */ +#line 165 "dds.yy" { delete ctor; ctor = 0; ;} break; case 6: -#line 165 "dds.y" + +/* Line 1455 of yacc.c */ +#line 175 "dds.yy" { (yyval.boolean) = (yyvsp[(3) - (6)].boolean) && (yyvsp[(5) - (6)].word); ;} break; case 7: -#line 169 "dds.y" + +/* Line 1455 of yacc.c */ +#line 179 "dds.yy" { parse_error((parser_arg *)arg, NO_DDS_MSG, dds_line_num, (yyvsp[(1) - (1)].word)); @@ -1546,24 +1569,32 @@ break; case 8: -#line 178 "dds.y" + +/* Line 1455 of yacc.c */ +#line 188 "dds.yy" { (yyval.boolean) = true; ;} break; case 9: -#line 182 "dds.y" + +/* Line 1455 of yacc.c */ +#line 192 "dds.yy" { (yyval.boolean) = true; ;} break; case 10: -#line 183 "dds.y" + +/* Line 1455 of yacc.c */ +#line 193 "dds.yy" { (yyval.boolean) = true; ;} break; case 11: -#line 191 "dds.y" + +/* Line 1455 of yacc.c */ +#line 201 "dds.yy" { string smsg; if (current->check_semantics(smsg)) { @@ -1587,7 +1618,9 @@ break; case 12: -#line 213 "dds.y" + +/* Line 1455 of yacc.c */ +#line 223 "dds.yy" { if( current ) delete current ; current = ctor->top(); @@ -1596,7 +1629,9 @@ break; case 13: -#line 219 "dds.y" + +/* Line 1455 of yacc.c */ +#line 229 "dds.yy" { string smsg; if (current->check_semantics(smsg)) @@ -1612,7 +1647,9 @@ break; case 14: -#line 233 "dds.y" + +/* Line 1455 of yacc.c */ +#line 243 "dds.yy" { if( current ) delete current ; current = ctor->top(); @@ -1621,7 +1658,9 @@ break; case 15: -#line 239 "dds.y" + +/* Line 1455 of yacc.c */ +#line 249 "dds.yy" { string smsg; if (current->check_semantics(smsg)) @@ -1637,7 +1676,9 @@ break; case 16: -#line 253 "dds.y" + +/* Line 1455 of yacc.c */ +#line 263 "dds.yy" { if (is_keyword(string((yyvsp[(3) - (4)].word)), "array")) part = array; @@ -1652,7 +1693,9 @@ break; case 17: -#line 265 "dds.y" + +/* Line 1455 of yacc.c */ +#line 275 "dds.yy" { if (is_keyword(string((yyvsp[(7) - (8)].word)), "maps")) part = maps; @@ -1667,7 +1710,9 @@ break; case 18: -#line 277 "dds.y" + +/* Line 1455 of yacc.c */ +#line 287 "dds.yy" { if( current ) delete current ; current = ctor->top(); @@ -1676,7 +1721,9 @@ break; case 19: -#line 283 "dds.y" + +/* Line 1455 of yacc.c */ +#line 293 "dds.yy" { string smsg; if (current->check_semantics(smsg)) { @@ -1694,7 +1741,9 @@ break; case 20: -#line 299 "dds.y" + +/* Line 1455 of yacc.c */ +#line 309 "dds.yy" { ostringstream msg; msg << BAD_DECLARATION; @@ -1705,78 +1754,106 @@ break; case 21: -#line 310 "dds.y" + +/* Line 1455 of yacc.c */ +#line 320 "dds.yy" { ctor->push(DDS_OBJ(arg)->get_factory()->NewStructure()); ;} break; case 22: -#line 316 "dds.y" + +/* Line 1455 of yacc.c */ +#line 326 "dds.yy" { ctor->push(DDS_OBJ(arg)->get_factory()->NewSequence()); ;} break; case 23: -#line 322 "dds.y" + +/* Line 1455 of yacc.c */ +#line 332 "dds.yy" { ctor->push(DDS_OBJ(arg)->get_factory()->NewGrid()); ;} break; case 24: -#line 327 "dds.y" + +/* Line 1455 of yacc.c */ +#line 337 "dds.yy" { if( current ) delete current ;current = DDS_OBJ(arg)->get_factory()->NewByte(); ;} break; case 25: -#line 328 "dds.y" + +/* Line 1455 of yacc.c */ +#line 338 "dds.yy" { if( current ) delete current ;current = DDS_OBJ(arg)->get_factory()->NewInt16(); ;} break; case 26: -#line 329 "dds.y" + +/* Line 1455 of yacc.c */ +#line 339 "dds.yy" { if( current ) delete current ;current = DDS_OBJ(arg)->get_factory()->NewUInt16(); ;} break; case 27: -#line 330 "dds.y" + +/* Line 1455 of yacc.c */ +#line 340 "dds.yy" { if( current ) delete current ;current = DDS_OBJ(arg)->get_factory()->NewInt32(); ;} break; case 28: -#line 331 "dds.y" + +/* Line 1455 of yacc.c */ +#line 341 "dds.yy" { if( current ) delete current ;current = DDS_OBJ(arg)->get_factory()->NewUInt32(); ;} break; case 29: -#line 332 "dds.y" + +/* Line 1455 of yacc.c */ +#line 342 "dds.yy" { if( current ) delete current ;current = DDS_OBJ(arg)->get_factory()->NewFloat32(); ;} break; case 30: -#line 333 "dds.y" + +/* Line 1455 of yacc.c */ +#line 343 "dds.yy" { if( current ) delete current ;current = DDS_OBJ(arg)->get_factory()->NewFloat64(); ;} break; case 31: -#line 334 "dds.y" + +/* Line 1455 of yacc.c */ +#line 344 "dds.yy" { if( current ) delete current ;current = DDS_OBJ(arg)->get_factory()->NewStr(); ;} break; case 32: -#line 335 "dds.y" + +/* Line 1455 of yacc.c */ +#line 345 "dds.yy" { if( current ) delete current ;current = DDS_OBJ(arg)->get_factory()->NewUrl(); ;} break; case 33: -#line 338 "dds.y" + +/* Line 1455 of yacc.c */ +#line 348 "dds.yy" { current->set_name((yyvsp[(1) - (1)].word)); ;} break; case 49: -#line 349 "dds.y" + +/* Line 1455 of yacc.c */ +#line 359 "dds.yy" { if (!check_int32((yyvsp[(2) - (3)].word))) { string msg = "In the dataset descriptor object:\n"; @@ -1801,14 +1878,18 @@ break; case 50: -#line 372 "dds.y" + +/* Line 1455 of yacc.c */ +#line 382 "dds.yy" { id = new string((yyvsp[(2) - (2)].word)); ;} break; case 51: -#line 376 "dds.y" + +/* Line 1455 of yacc.c */ +#line 386 "dds.yy" { if (!check_int32((yyvsp[(5) - (5)].word))) { string msg = "In the dataset descriptor object:\n"; @@ -1834,14 +1915,18 @@ break; case 52: -#line 399 "dds.y" + +/* Line 1455 of yacc.c */ +#line 409 "dds.yy" { (yyval.boolean) = true; ;} break; case 53: -#line 404 "dds.y" + +/* Line 1455 of yacc.c */ +#line 414 "dds.yy" { ostringstream msg; msg << "In the dataset descriptor object:" << endl @@ -1853,17 +1938,23 @@ break; case 54: -#line 414 "dds.y" + +/* Line 1455 of yacc.c */ +#line 424 "dds.yy" { (*DDS_OBJ(arg)).set_dataset_name((yyvsp[(1) - (1)].word)); ;} break; case 55: -#line 415 "dds.y" + +/* Line 1455 of yacc.c */ +#line 425 "dds.yy" { (*DDS_OBJ(arg)).set_dataset_name((yyvsp[(1) - (1)].word)); ;} break; case 56: -#line 417 "dds.y" + +/* Line 1455 of yacc.c */ +#line 427 "dds.yy" { ostringstream msg; msg << "Error parsing the dataset name." << endl @@ -1875,8 +1966,9 @@ break; -/* Line 1267 of yacc.c. */ -#line 1880 "dds.tab.cc" + +/* Line 1455 of yacc.c */ +#line 1972 "dds.tab.cc" default: break; } YY_SYMBOL_PRINT ("-> $$ =", yyr1[yyn], &yyval, &yyloc); @@ -1887,7 +1979,6 @@ *++yyvsp = yyval; - /* Now `shift' the result of the reduction. Determine what state that goes to, based on the state we popped back to and the rule number reduced by. */ @@ -1912,7 +2003,7 @@ { ++yynerrs; #if ! YYERROR_VERBOSE - yyerror (YY_("syntax error")); + yyerror (arg, YY_("syntax error")); #else { YYSIZE_T yysize = yysyntax_error (0, yystate, yychar); @@ -1936,11 +2027,11 @@ if (0 < yysize && yysize <= yymsg_alloc) { (void) yysyntax_error (yymsg, yystate, yychar); - yyerror (yymsg); + yyerror (arg, yymsg); } else { - yyerror (YY_("syntax error")); + yyerror (arg, YY_("syntax error")); if (yysize != 0) goto yyexhaustedlab; } @@ -1952,7 +2043,7 @@ if (yyerrstatus == 3) { - /* If just tried and failed to reuse look-ahead token after an + /* If just tried and failed to reuse lookahead token after an error, discard it. */ if (yychar <= YYEOF) @@ -1964,12 +2055,12 @@ else { yydestruct ("Error: discarding", - yytoken, &yylval); + yytoken, &yylval, arg); yychar = YYEMPTY; } } - /* Else will try to reuse look-ahead token after shifting the error + /* Else will try to reuse lookahead token after shifting the error token. */ goto yyerrlab1; @@ -2020,15 +2111,12 @@ yydestruct ("Error: popping", - yystos[yystate], yyvsp); + yystos[yystate], yyvsp, arg); YYPOPSTACK (1); yystate = *yyssp; YY_STACK_PRINT (yyss, yyssp); } - if (yyn == YYFINAL) - YYACCEPT; - *++yyvsp = yylval; @@ -2053,20 +2141,20 @@ yyresult = 1; goto yyreturn; -#ifndef yyoverflow +#if !defined(yyoverflow) || YYERROR_VERBOSE /*-------------------------------------------------. | yyexhaustedlab -- memory exhaustion comes here. | `-------------------------------------------------*/ yyexhaustedlab: - yyerror (YY_("memory exhausted")); + yyerror (arg, YY_("memory exhausted")); yyresult = 2; /* Fall through. */ #endif yyreturn: - if (yychar != YYEOF && yychar != YYEMPTY) + if (yychar != YYEMPTY) yydestruct ("Cleanup: discarding lookahead", - yytoken, &yylval); + yytoken, &yylval, arg); /* Do not reclaim the symbols of the rule which action triggered this YYABORT or YYACCEPT. */ YYPOPSTACK (yylen); @@ -2074,7 +2162,7 @@ while (yyssp != yyss) { yydestruct ("Cleanup: popping", - yystos[*yyssp], yyvsp); + yystos[*yyssp], yyvsp, arg); YYPOPSTACK (1); } #ifndef yyoverflow @@ -2090,87 +2178,88 @@ } -#line 427 "dds.y" + +/* Line 1675 of yacc.c */ +#line 437 "dds.yy" /* - This function must be defined. However, use the error reporting code in - parser-utils.cc. -*/ + This function must be defined. However, use the error reporting code in + parser-utils.cc. + */ -void -ddserror(char *) +void +ddserror(parser_arg *, const string &) { } /* - Error clean up. Call this before calling YYBORT. Don't call this on a - normal exit. -*/ - -void -error_exit_cleanup() -{ - delete id; id = 0; - delete current; current = 0; - delete ctor; ctor = 0; + Error clean up. Call this before calling YYBORT. Don't call this on a + normal exit. + */ + +void error_exit_cleanup() +{ + delete id; + id = 0; + delete current; + current = 0; + delete ctor; + ctor = 0; } /* - Invalid declaration message. -*/ + Invalid declaration message. + */ -void -invalid_declaration(parser_arg *arg, string semantic_err_msg, char *type, - char *name) +void invalid_declaration(parser_arg *arg, string semantic_err_msg, char *type, char *name) { - ostringstream msg; - msg << "In the dataset descriptor object: `" << type << " " << name - << "'" << endl << "is not a valid declaration." << endl - << semantic_err_msg; - parse_error((parser_arg *)arg, msg.str().c_str(), dds_line_num); + ostringstream msg; + msg << "In the dataset descriptor object: `" << type << " " << name << "'" << endl << "is not a valid declaration." + << endl << semantic_err_msg; + parse_error((parser_arg *) arg, msg.str().c_str(), dds_line_num); } /* - Add the variable pointed to by CURRENT to either the topmost ctor object on - the stack CTOR or to the dataset variable table TABLE if CTOR is empty. If - it exists, the current ctor object is popped off the stack and assigned to - CURRENT. - - NB: the ctor stack is popped for arrays because they are ctors which - contain only a single variable. For other ctor types, several variables may - be members and the parse rule (see `declaration' above) determines when to - pop the stack. - - Returns: void -*/ - -void -add_entry(DDS &table, stack **ctor, BaseType **current, Part part) -{ + Add the variable pointed to by CURRENT to either the topmost ctor object on + the stack CTOR or to the dataset variable table TABLE if CTOR is empty. If + it exists, the current ctor object is popped off the stack and assigned to + CURRENT. + + NB: the ctor stack is popped for arrays because they are ctors which + contain only a single variable. For other ctor types, several variables may + be members and the parse rule (see `declaration' above) determines when to + pop the stack. + + Returns: void + */ + +void add_entry(DDS &table, stack **ctor, BaseType **current, Part part) +{ if (!*ctor) - *ctor = new stack; + *ctor = new stack ; if (!(*ctor)->empty()) { /* must be parsing a ctor type */ - (*ctor)->top()->add_var(*current, part); - - const Type &ctor_type = (*ctor)->top()->type(); + (*ctor)->top()->add_var(*current, part); - if (ctor_type == dods_array_c) { - if( *current ) delete *current ; - *current = (*ctor)->top(); - (*ctor)->pop(); + const Type &ctor_type = (*ctor)->top()->type(); - // Return here to avoid deleting the new value of 'current.' - return; - } + if (ctor_type == dods_array_c) { + if (*current) + delete *current; + *current = (*ctor)->top(); + (*ctor)->pop(); + + // Return here to avoid deleting the new value of 'current.' + return; + } } else { - table.add_var(*current); + table.add_var(*current); } - if (*current) - delete *current; + if (*current) + delete *current; *current = 0; } diff -Nru libdap-3.11.1/dds.tab.hh libdap-3.12.0/dds.tab.hh --- libdap-3.11.1/dds.tab.hh 2011-05-06 17:50:24.000000000 +0000 +++ libdap-3.12.0/dds.tab.hh 2013-10-17 21:27:40.000000000 +0000 @@ -1,24 +1,23 @@ -/* A Bison parser, made by GNU Bison 2.3. */ -/* Skeleton interface for Bison's Yacc-like parsers in C +/* A Bison parser, made by GNU Bison 2.4.1. */ - Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004, 2005, 2006 +/* Skeleton interface for Bison's Yacc-like parsers in C + + Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc. - - This program is free software; you can redistribute it and/or modify + + This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2, or (at your option) - any later version. - + the Free Software Foundation, either version 3 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., 51 Franklin Street, Fifth Floor, - Boston, MA 02110-1301, USA. */ + along with this program. If not, see . */ /* As a special exception, you may create a larger work that contains part or all of the Bison parser skeleton and distribute that work @@ -29,10 +28,64 @@ special exception, which will cause the skeleton and the resulting Bison output files to be licensed under the GNU General Public License without this special exception. - + This special exception was added by the Free Software Foundation in version 2.2 of Bison. */ +/* "%code requires" blocks. */ + +/* Line 1676 of yacc.c */ +#line 47 "dds.yy" + + +#include "config_dap.h" + +#include +#include +#include +#include +#include + +#include "Byte.h" +#include "Int16.h" +#include "UInt16.h" +#include "Int32.h" +#include "UInt32.h" +#include "Float32.h" +#include "Float64.h" +#include "Str.h" +#include "Url.h" +#include "Array.h" +#include "Structure.h" +#include "Sequence.h" +#include "Grid.h" + +#include "DDS.h" +#include "Error.h" +#include "parser.h" +#include "util.h" + +using namespace std; +using namespace libdap; + +// These macros are used to access the `arguments' passed to the parser. A +// pointer to an error object and a pointer to an integer status variable are +// passed in to the parser within a structure (which itself is passed as a +// pointer). Note that the ERROR macro explicitly casts OBJ to an ERROR *. +// ERROR is no longer used. These parsers now signal problems by throwing +// exceptions. 5/22/2002 jhrg +#define DDS_OBJ(arg) ((DDS *)((parser_arg *)(arg))->_object) + +// #define YYPARSE_PARAM arg + +extern int dds_line_num; /* defined in dds.lex */ + + + + +/* Line 1676 of yacc.c */ +#line 88 "dds.tab.hh" + /* Tokens. */ #ifndef YYTOKENTYPE # define YYTOKENTYPE @@ -57,41 +110,29 @@ SCAN_URL = 273 }; #endif -/* Tokens. */ -#define SCAN_WORD 258 -#define SCAN_DATASET 259 -#define SCAN_LIST 260 -#define SCAN_SEQUENCE 261 -#define SCAN_STRUCTURE 262 -#define SCAN_FUNCTION 263 -#define SCAN_GRID 264 -#define SCAN_BYTE 265 -#define SCAN_INT16 266 -#define SCAN_UINT16 267 -#define SCAN_INT32 268 -#define SCAN_UINT32 269 -#define SCAN_FLOAT32 270 -#define SCAN_FLOAT64 271 -#define SCAN_STRING 272 -#define SCAN_URL 273 - #if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED typedef union YYSTYPE -#line 121 "dds.y" { + +/* Line 1676 of yacc.c */ +#line 131 "dds.yy" + bool boolean; char word[ID_MAX]; -} -/* Line 1489 of yacc.c. */ -#line 90 "dds.tab.hh" - YYSTYPE; + + + +/* Line 1676 of yacc.c */ +#line 130 "dds.tab.hh" +} YYSTYPE; +# define YYSTYPE_IS_TRIVIAL 1 # define yystype YYSTYPE /* obsolescent; will be withdrawn */ # define YYSTYPE_IS_DECLARED 1 -# define YYSTYPE_IS_TRIVIAL 1 #endif extern YYSTYPE ddslval; + diff -Nru libdap-3.11.1/dds.y libdap-3.12.0/dds.y --- libdap-3.11.1/dds.y 2011-04-29 13:19:43.000000000 +0000 +++ libdap-3.12.0/dds.y 1970-01-01 00:00:00.000000000 +0000 @@ -1,509 +0,0 @@ - -// -*- mode: c++; c-basic-offset:4 -*- - -// This file is part of libdap, A C++ implementation of the OPeNDAP Data -// Access Protocol. - -// Copyright (c) 2002,2003 OPeNDAP, Inc. -// Author: James Gallagher -// -// This library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Lesser General Public -// License as published by the Free Software Foundation; either -// version 2.1 of the License, or (at your option) any later version. -// -// This library 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 -// Lesser General Public License for more details. -// -// You should have received a copy of the GNU Lesser General Public -// License along with this library; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -// -// You can contact OPeNDAP, Inc. at PO Box 112, Saunderstown, RI. 02874-0112. - -// (c) COPYRIGHT URI/MIT 1994-1999 -// Please read the full copyright statement in the file COPYRIGHT_URI. -// -// Authors: -// jhrg,jimg James Gallagher - -/* - Grammar for the DDS. This grammar can be used with the bison parser - generator to build a parser for the DDS. It assumes that a scanner called - `ddslex()' exists and returns several token types (see das.tab.h) - in addition to several single character token types. The matched lexeme - for an ID is stored by the scanner in a global char * `ddslval'. - Because the scanner returns a value via this global and because the parser - stores ddslval (not the information pointed to), the values of rule - components must be stored as they are parsed and used once accumulated at - or near the end of a rule. If ddslval returned a value (instead of a - pointer to a value) this would not be necessary. - - jhrg 8/29/94 -*/ - -%{ - -#include "config_dap.h" - -static char rcsid[] not_used = {"$Id: dds.y 21577 2009-10-02 16:12:17Z jimg $"}; - -#include -#include -#include -#include -#include - -#include "Byte.h" -#include "Int16.h" -#include "UInt16.h" -#include "Int32.h" -#include "UInt32.h" -#include "Float32.h" -#include "Float64.h" -#include "Str.h" -#include "Url.h" -#include "Array.h" -#include "Structure.h" -#include "Sequence.h" -#include "Grid.h" - -#include "DDS.h" -#include "Error.h" -#include "parser.h" -#include "util.h" - -using namespace std; -using namespace libdap; - -// These macros are used to access the `arguments' passed to the parser. A -// pointer to an error object and a pointer to an integer status variable are -// passed in to the parser within a structure (which itself is passed as a -// pointer). Note that the ERROR macro explicitly casts OBJ to an ERROR *. -// ERROR is no longer used. These parsers now signal problems by throwing -// exceptions. 5/22/2002 jhrg -#define DDS_OBJ(arg) ((DDS *)((parser_arg *)(arg))->_object) - -#define YYPARSE_PARAM arg - -extern int dds_line_num; /* defined in dds.lex */ - -// No global static objects in the dap library! 1/24/2000 jhrg -static stack *ctor; -static BaseType *current; -static string *id; -static Part part = nil; /* Part is defined in BaseType */ - -static const char *NO_DDS_MSG = -"The descriptor object returned from the dataset was null.\n\ -Check that the URL is correct."; - -static const char *BAD_DECLARATION = -"In the dataset descriptor object: Expected a variable declaration\n\ -(e.g., Int32 i;). Make sure that the variable name is not the name\n\ -of a datatype and that the Array: and Maps: sections of a Grid are\n\ -labeled properly."; - -int ddslex(); -void ddserror(char *s); -void error_exit_cleanup(); -void add_entry(DDS &table, stack **ctor, BaseType **current, - Part p); -void invalid_declaration(parser_arg *arg, string semantic_err_msg, - char *type, char *name); - -%} - -%expect 52 - -%union { - bool boolean; - char word[ID_MAX]; -} - -%token SCAN_WORD -%token SCAN_DATASET -%token SCAN_LIST -%token SCAN_SEQUENCE -%token SCAN_STRUCTURE -%token SCAN_FUNCTION -%token SCAN_GRID -%token SCAN_BYTE -%token SCAN_INT16 -%token SCAN_UINT16 -%token SCAN_INT32 -%token SCAN_UINT32 -%token SCAN_FLOAT32 -%token SCAN_FLOAT64 -%token SCAN_STRING -%token SCAN_URL - -%type datasets dataset declarations array_decl - -%type declaration base_type structure sequence grid var var_name name - -%% - -start: - { - /* On entry to the parser, make the BaseType stack. */ - ctor = new stack; - } - datasets - { - delete ctor; ctor = 0; - } -; - -datasets: dataset - | datasets dataset -; - -dataset: SCAN_DATASET '{' declarations '}' name ';' - { - $$ = $3 && $5; - } - | error - { - parse_error((parser_arg *)arg, NO_DDS_MSG, - dds_line_num, $1); - error_exit_cleanup(); - YYABORT; - } -; - -declarations: /* empty */ - { - $$ = true; - } - - | declaration { $$ = true; } - | declarations declaration { $$ = true; } -; - -/* This non-terminal is here only to keep types like `List List Int32' from - parsing. DODS does not allow Lists of Lists. Those types make translation - to/from arrays too hard. */ - -declaration: base_type var ';' - { - string smsg; - if (current->check_semantics(smsg)) { - /* BaseType *current_save = current ; */ - add_entry(*DDS_OBJ(arg), &ctor, ¤t, part); - /* FIX - if( current_save == current ) - { - delete current ; - current = 0 ; - } - */ - } else { - invalid_declaration((parser_arg *)arg, smsg, $1, $2); - error_exit_cleanup(); - YYABORT; - } - strncpy($$,$2,ID_MAX); - $$[ID_MAX-1] = '\0'; - } - - | structure '{' declarations '}' - { - if( current ) delete current ; - current = ctor->top(); - ctor->pop(); - } - var ';' - { - string smsg; - if (current->check_semantics(smsg)) - add_entry(*DDS_OBJ(arg), &ctor, ¤t, part); - else { - invalid_declaration((parser_arg *)arg, smsg, $1, $6); - error_exit_cleanup(); - YYABORT; - } - strncpy($$,$6,ID_MAX); - $$[ID_MAX-1] = '\0'; - } - - | sequence '{' declarations '}' - { - if( current ) delete current ; - current = ctor->top(); - ctor->pop(); - } - var ';' - { - string smsg; - if (current->check_semantics(smsg)) - add_entry(*DDS_OBJ(arg), &ctor, ¤t, part); - else { - invalid_declaration((parser_arg *)arg, smsg, $1, $6); - error_exit_cleanup(); - YYABORT; - } - strncpy($$,$6,ID_MAX); - $$[ID_MAX-1] = '\0'; - } - - | grid '{' SCAN_WORD ':' - { - if (is_keyword(string($3), "array")) - part = array; - else { - ostringstream msg; - msg << BAD_DECLARATION; - parse_error((parser_arg *)arg, msg.str().c_str(), - dds_line_num, $3); - YYABORT; - } - } - declaration SCAN_WORD ':' - { - if (is_keyword(string($7), "maps")) - part = maps; - else { - ostringstream msg; - msg << BAD_DECLARATION; - parse_error((parser_arg *)arg, msg.str().c_str(), - dds_line_num, $7); - YYABORT; - } - } - declarations '}' - { - if( current ) delete current ; - current = ctor->top(); - ctor->pop(); - } - var ';' - { - string smsg; - if (current->check_semantics(smsg)) { - part = nil; - add_entry(*DDS_OBJ(arg), &ctor, ¤t, part); - } - else { - invalid_declaration((parser_arg *)arg, smsg, $1, $13); - error_exit_cleanup(); - YYABORT; - } - strncpy($$,$13,ID_MAX); - $$[ID_MAX-1] = '\0'; - } - - | error - { - ostringstream msg; - msg << BAD_DECLARATION; - parse_error((parser_arg *)arg, msg.str().c_str(), - dds_line_num, $1); - YYABORT; - } -; - - -structure: SCAN_STRUCTURE - { - ctor->push(DDS_OBJ(arg)->get_factory()->NewStructure()); - } -; - -sequence: SCAN_SEQUENCE - { - ctor->push(DDS_OBJ(arg)->get_factory()->NewSequence()); - } -; - -grid: SCAN_GRID - { - ctor->push(DDS_OBJ(arg)->get_factory()->NewGrid()); - } -; - -base_type: SCAN_BYTE { if( current ) delete current ;current = DDS_OBJ(arg)->get_factory()->NewByte(); } - | SCAN_INT16 { if( current ) delete current ;current = DDS_OBJ(arg)->get_factory()->NewInt16(); } - | SCAN_UINT16 { if( current ) delete current ;current = DDS_OBJ(arg)->get_factory()->NewUInt16(); } - | SCAN_INT32 { if( current ) delete current ;current = DDS_OBJ(arg)->get_factory()->NewInt32(); } - | SCAN_UINT32 { if( current ) delete current ;current = DDS_OBJ(arg)->get_factory()->NewUInt32(); } - | SCAN_FLOAT32 { if( current ) delete current ;current = DDS_OBJ(arg)->get_factory()->NewFloat32(); } - | SCAN_FLOAT64 { if( current ) delete current ;current = DDS_OBJ(arg)->get_factory()->NewFloat64(); } - | SCAN_STRING { if( current ) delete current ;current = DDS_OBJ(arg)->get_factory()->NewStr(); } - | SCAN_URL { if( current ) delete current ;current = DDS_OBJ(arg)->get_factory()->NewUrl(); } -; - -var: var_name { current->set_name($1); } - | var array_decl -; - -var_name: SCAN_WORD | SCAN_BYTE | SCAN_INT16 | SCAN_INT32 | SCAN_UINT16 - | SCAN_UINT32 | SCAN_FLOAT32 | SCAN_FLOAT64 | SCAN_STRING - | SCAN_URL | SCAN_STRUCTURE | SCAN_SEQUENCE | SCAN_GRID - | SCAN_LIST -; - -array_decl: '[' SCAN_WORD ']' - { - if (!check_int32($2)) { - string msg = "In the dataset descriptor object:\n"; - msg += "Expected an array subscript.\n"; - parse_error((parser_arg *)arg, msg.c_str(), - dds_line_num, $2); - } - if (current->type() == dods_array_c - && check_int32($2)) { - ((Array *)current)->append_dim(atoi($2)); - } - else { - Array *a = DDS_OBJ(arg)->get_factory()->NewArray(); - a->add_var(current); - a->append_dim(atoi($2)); - if( current ) delete current ; - current = a; - } - - $$ = true; - } - - | '[' SCAN_WORD - { - id = new string($2); - } - '=' SCAN_WORD - { - if (!check_int32($5)) { - string msg = "In the dataset descriptor object:\n"; - msg += "Expected an array subscript.\n"; - parse_error((parser_arg *)arg, msg.c_str(), - dds_line_num, $5); - error_exit_cleanup(); - YYABORT; - } - if (current->type() == dods_array_c) { - ((Array *)current)->append_dim(atoi($5), *id); - } - else { - Array *a = DDS_OBJ(arg)->get_factory()->NewArray(); - a->add_var(current); - a->append_dim(atoi($5), *id); - if( current ) delete current ; - current = a; - } - - delete id; id = 0; - } - ']' - { - $$ = true; - } - - | error - { - ostringstream msg; - msg << "In the dataset descriptor object:" << endl - << "Expected an array subscript." << endl; - parse_error((parser_arg *)arg, msg.str().c_str(), - dds_line_num, $1); - YYABORT; - } -; - -name: var_name { (*DDS_OBJ(arg)).set_dataset_name($1); } - | SCAN_DATASET { (*DDS_OBJ(arg)).set_dataset_name($1); } - | error - { - ostringstream msg; - msg << "Error parsing the dataset name." << endl - << "The name may be missing or may contain an illegal character." << endl; - parse_error((parser_arg *)arg, msg.str().c_str(), - dds_line_num, $1); - YYABORT; - } -; - -%% - -/* - This function must be defined. However, use the error reporting code in - parser-utils.cc. -*/ - -void -ddserror(char *) -{ -} - -/* - Error clean up. Call this before calling YYBORT. Don't call this on a - normal exit. -*/ - -void -error_exit_cleanup() -{ - delete id; id = 0; - delete current; current = 0; - delete ctor; ctor = 0; -} - -/* - Invalid declaration message. -*/ - -void -invalid_declaration(parser_arg *arg, string semantic_err_msg, char *type, - char *name) -{ - ostringstream msg; - msg << "In the dataset descriptor object: `" << type << " " << name - << "'" << endl << "is not a valid declaration." << endl - << semantic_err_msg; - parse_error((parser_arg *)arg, msg.str().c_str(), dds_line_num); -} - -/* - Add the variable pointed to by CURRENT to either the topmost ctor object on - the stack CTOR or to the dataset variable table TABLE if CTOR is empty. If - it exists, the current ctor object is popped off the stack and assigned to - CURRENT. - - NB: the ctor stack is popped for arrays because they are ctors which - contain only a single variable. For other ctor types, several variables may - be members and the parse rule (see `declaration' above) determines when to - pop the stack. - - Returns: void -*/ - -void -add_entry(DDS &table, stack **ctor, BaseType **current, Part part) -{ - if (!*ctor) - *ctor = new stack; - - if (!(*ctor)->empty()) { /* must be parsing a ctor type */ - (*ctor)->top()->add_var(*current, part); - - const Type &ctor_type = (*ctor)->top()->type(); - - if (ctor_type == dods_array_c) { - if( *current ) delete *current ; - *current = (*ctor)->top(); - (*ctor)->pop(); - - // Return here to avoid deleting the new value of 'current.' - return; - } - } - else { - table.add_var(*current); - } - - if (*current) - delete *current; - *current = 0; -} - diff -Nru libdap-3.11.1/dds.yy libdap-3.12.0/dds.yy --- libdap-3.11.1/dds.yy 1970-01-01 00:00:00.000000000 +0000 +++ libdap-3.12.0/dds.yy 2013-10-17 21:27:40.000000000 +0000 @@ -0,0 +1,518 @@ + +// -*- mode: c++; c-basic-offset:4 -*- + +// This file is part of libdap, A C++ implementation of the OPeNDAP Data +// Access Protocol. + +// Copyright (c) 2002,2003 OPeNDAP, Inc. +// Author: James Gallagher +// +// This library is free software; you can redistribute it and/or +// modify it under the terms of the GNU Lesser General Public +// License as published by the Free Software Foundation; either +// version 2.1 of the License, or (at your option) any later version. +// +// This library 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 +// Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// +// You can contact OPeNDAP, Inc. at PO Box 112, Saunderstown, RI. 02874-0112. + +// (c) COPYRIGHT URI/MIT 1994-1999 +// Please read the full copyright statement in the file COPYRIGHT_URI. +// +// Authors: +// jhrg,jimg James Gallagher + +/* + Grammar for the DDS. This grammar can be used with the bison parser + generator to build a parser for the DDS. It assumes that a scanner called + `ddslex()' exists and returns several token types (see das.tab.h) + in addition to several single character token types. The matched lexeme + for an ID is stored by the scanner in a global char * `ddslval'. + Because the scanner returns a value via this global and because the parser + stores ddslval (not the information pointed to), the values of rule + components must be stored as they are parsed and used once accumulated at + or near the end of a rule. If ddslval returned a value (instead of a + pointer to a value) this would not be necessary. + + jhrg 8/29/94 +*/ + +%code requires { + +#include "config_dap.h" + +#include +#include +#include +#include +#include + +#include "Byte.h" +#include "Int16.h" +#include "UInt16.h" +#include "Int32.h" +#include "UInt32.h" +#include "Float32.h" +#include "Float64.h" +#include "Str.h" +#include "Url.h" +#include "Array.h" +#include "Structure.h" +#include "Sequence.h" +#include "Grid.h" + +#include "DDS.h" +#include "Error.h" +#include "parser.h" +#include "util.h" + +using namespace std; +using namespace libdap; + +// These macros are used to access the `arguments' passed to the parser. A +// pointer to an error object and a pointer to an integer status variable are +// passed in to the parser within a structure (which itself is passed as a +// pointer). Note that the ERROR macro explicitly casts OBJ to an ERROR *. +// ERROR is no longer used. These parsers now signal problems by throwing +// exceptions. 5/22/2002 jhrg +#define DDS_OBJ(arg) ((DDS *)((parser_arg *)(arg))->_object) + +// #define YYPARSE_PARAM arg + +extern int dds_line_num; /* defined in dds.lex */ + +} // code requires + +%code { + +// No global static objects in the dap library! 1/24/2000 jhrg +static stack *ctor; +static BaseType *current; +static string *id; +static Part part = nil; /* Part is defined in BaseType */ + +static const char *NO_DDS_MSG = +"The descriptor object returned from the dataset was null.\n\ +Check that the URL is correct."; + +static const char *BAD_DECLARATION = +"In the dataset descriptor object: Expected a variable declaration\n\ +(e.g., Int32 i;). Make sure that the variable name is not the name\n\ +of a datatype and that the Array: and Maps: sections of a Grid are\n\ +labeled properly."; + +int ddslex(); +void ddserror(parser_arg *arg, const string &s /*char *s*/); +void error_exit_cleanup(); +void add_entry(DDS &table, stack **ctor, BaseType **current, + Part p); +void invalid_declaration(parser_arg *arg, string semantic_err_msg, + char *type, char *name); + +} // code + +%require "2.4" + +%parse-param {parser_arg *arg} +%name-prefix "dds" +%defines +%debug +%verbose + +%expect 52 + +%union { + bool boolean; + char word[ID_MAX]; +} + +%token SCAN_WORD +%token SCAN_DATASET +%token SCAN_LIST +%token SCAN_SEQUENCE +%token SCAN_STRUCTURE +%token SCAN_FUNCTION +%token SCAN_GRID +%token SCAN_BYTE +%token SCAN_INT16 +%token SCAN_UINT16 +%token SCAN_INT32 +%token SCAN_UINT32 +%token SCAN_FLOAT32 +%token SCAN_FLOAT64 +%token SCAN_STRING +%token SCAN_URL + +%type datasets dataset declarations array_decl + +%type declaration base_type structure sequence grid var var_name name + +%% + +start: + { + /* On entry to the parser, make the BaseType stack. */ + ctor = new stack; + } + datasets + { + delete ctor; ctor = 0; + } +; + +datasets: dataset + | datasets dataset +; + +dataset: SCAN_DATASET '{' declarations '}' name ';' + { + $$ = $3 && $5; + } + | error + { + parse_error((parser_arg *)arg, NO_DDS_MSG, + dds_line_num, $1); + error_exit_cleanup(); + YYABORT; + } +; + +declarations: /* empty */ + { + $$ = true; + } + + | declaration { $$ = true; } + | declarations declaration { $$ = true; } +; + +/* This non-terminal is here only to keep types like `List List Int32' from + parsing. DODS does not allow Lists of Lists. Those types make translation + to/from arrays too hard. */ + +declaration: base_type var ';' + { + string smsg; + if (current->check_semantics(smsg)) { + /* BaseType *current_save = current ; */ + add_entry(*DDS_OBJ(arg), &ctor, ¤t, part); + /* FIX + if( current_save == current ) + { + delete current ; + current = 0 ; + } + */ + } else { + invalid_declaration((parser_arg *)arg, smsg, $1, $2); + error_exit_cleanup(); + YYABORT; + } + strncpy($$,$2,ID_MAX); + $$[ID_MAX-1] = '\0'; + } + + | structure '{' declarations '}' + { + if( current ) delete current ; + current = ctor->top(); + ctor->pop(); + } + var ';' + { + string smsg; + if (current->check_semantics(smsg)) + add_entry(*DDS_OBJ(arg), &ctor, ¤t, part); + else { + invalid_declaration((parser_arg *)arg, smsg, $1, $6); + error_exit_cleanup(); + YYABORT; + } + strncpy($$,$6,ID_MAX); + $$[ID_MAX-1] = '\0'; + } + + | sequence '{' declarations '}' + { + if( current ) delete current ; + current = ctor->top(); + ctor->pop(); + } + var ';' + { + string smsg; + if (current->check_semantics(smsg)) + add_entry(*DDS_OBJ(arg), &ctor, ¤t, part); + else { + invalid_declaration((parser_arg *)arg, smsg, $1, $6); + error_exit_cleanup(); + YYABORT; + } + strncpy($$,$6,ID_MAX); + $$[ID_MAX-1] = '\0'; + } + + | grid '{' SCAN_WORD ':' + { + if (is_keyword(string($3), "array")) + part = array; + else { + ostringstream msg; + msg << BAD_DECLARATION; + parse_error((parser_arg *)arg, msg.str().c_str(), + dds_line_num, $3); + YYABORT; + } + } + declaration SCAN_WORD ':' + { + if (is_keyword(string($7), "maps")) + part = maps; + else { + ostringstream msg; + msg << BAD_DECLARATION; + parse_error((parser_arg *)arg, msg.str().c_str(), + dds_line_num, $7); + YYABORT; + } + } + declarations '}' + { + if( current ) delete current ; + current = ctor->top(); + ctor->pop(); + } + var ';' + { + string smsg; + if (current->check_semantics(smsg)) { + part = nil; + add_entry(*DDS_OBJ(arg), &ctor, ¤t, part); + } + else { + invalid_declaration((parser_arg *)arg, smsg, $1, $13); + error_exit_cleanup(); + YYABORT; + } + strncpy($$,$13,ID_MAX); + $$[ID_MAX-1] = '\0'; + } + + | error + { + ostringstream msg; + msg << BAD_DECLARATION; + parse_error((parser_arg *)arg, msg.str().c_str(), + dds_line_num, $1); + YYABORT; + } +; + + +structure: SCAN_STRUCTURE + { + ctor->push(DDS_OBJ(arg)->get_factory()->NewStructure()); + } +; + +sequence: SCAN_SEQUENCE + { + ctor->push(DDS_OBJ(arg)->get_factory()->NewSequence()); + } +; + +grid: SCAN_GRID + { + ctor->push(DDS_OBJ(arg)->get_factory()->NewGrid()); + } +; + +base_type: SCAN_BYTE { if( current ) delete current ;current = DDS_OBJ(arg)->get_factory()->NewByte(); } + | SCAN_INT16 { if( current ) delete current ;current = DDS_OBJ(arg)->get_factory()->NewInt16(); } + | SCAN_UINT16 { if( current ) delete current ;current = DDS_OBJ(arg)->get_factory()->NewUInt16(); } + | SCAN_INT32 { if( current ) delete current ;current = DDS_OBJ(arg)->get_factory()->NewInt32(); } + | SCAN_UINT32 { if( current ) delete current ;current = DDS_OBJ(arg)->get_factory()->NewUInt32(); } + | SCAN_FLOAT32 { if( current ) delete current ;current = DDS_OBJ(arg)->get_factory()->NewFloat32(); } + | SCAN_FLOAT64 { if( current ) delete current ;current = DDS_OBJ(arg)->get_factory()->NewFloat64(); } + | SCAN_STRING { if( current ) delete current ;current = DDS_OBJ(arg)->get_factory()->NewStr(); } + | SCAN_URL { if( current ) delete current ;current = DDS_OBJ(arg)->get_factory()->NewUrl(); } +; + +var: var_name { current->set_name($1); } + | var array_decl +; + +var_name: SCAN_WORD | SCAN_BYTE | SCAN_INT16 | SCAN_INT32 | SCAN_UINT16 + | SCAN_UINT32 | SCAN_FLOAT32 | SCAN_FLOAT64 | SCAN_STRING + | SCAN_URL | SCAN_STRUCTURE | SCAN_SEQUENCE | SCAN_GRID + | SCAN_LIST +; + +array_decl: '[' SCAN_WORD ']' + { + if (!check_int32($2)) { + string msg = "In the dataset descriptor object:\n"; + msg += "Expected an array subscript.\n"; + parse_error((parser_arg *)arg, msg.c_str(), + dds_line_num, $2); + } + if (current->type() == dods_array_c + && check_int32($2)) { + ((Array *)current)->append_dim(atoi($2)); + } + else { + Array *a = DDS_OBJ(arg)->get_factory()->NewArray(); + a->add_var(current); + a->append_dim(atoi($2)); + if( current ) delete current ; + current = a; + } + + $$ = true; + } + + | '[' SCAN_WORD + { + id = new string($2); + } + '=' SCAN_WORD + { + if (!check_int32($5)) { + string msg = "In the dataset descriptor object:\n"; + msg += "Expected an array subscript.\n"; + parse_error((parser_arg *)arg, msg.c_str(), + dds_line_num, $5); + error_exit_cleanup(); + YYABORT; + } + if (current->type() == dods_array_c) { + ((Array *)current)->append_dim(atoi($5), *id); + } + else { + Array *a = DDS_OBJ(arg)->get_factory()->NewArray(); + a->add_var(current); + a->append_dim(atoi($5), *id); + if( current ) delete current ; + current = a; + } + + delete id; id = 0; + } + ']' + { + $$ = true; + } + + | error + { + ostringstream msg; + msg << "In the dataset descriptor object:" << endl + << "Expected an array subscript." << endl; + parse_error((parser_arg *)arg, msg.str().c_str(), + dds_line_num, $1); + YYABORT; + } +; + +name: var_name { (*DDS_OBJ(arg)).set_dataset_name($1); } + | SCAN_DATASET { (*DDS_OBJ(arg)).set_dataset_name($1); } + | error + { + ostringstream msg; + msg << "Error parsing the dataset name." << endl + << "The name may be missing or may contain an illegal character." << endl; + parse_error((parser_arg *)arg, msg.str().c_str(), + dds_line_num, $1); + YYABORT; + } +; + +%% + +/* + This function must be defined. However, use the error reporting code in + parser-utils.cc. + */ + +void +ddserror(parser_arg *, const string &) +{ +} + +/* + Error clean up. Call this before calling YYBORT. Don't call this on a + normal exit. + */ + +void error_exit_cleanup() +{ + delete id; + id = 0; + delete current; + current = 0; + delete ctor; + ctor = 0; +} + +/* + Invalid declaration message. + */ + +void invalid_declaration(parser_arg *arg, string semantic_err_msg, char *type, char *name) +{ + ostringstream msg; + msg << "In the dataset descriptor object: `" << type << " " << name << "'" << endl << "is not a valid declaration." + << endl << semantic_err_msg; + parse_error((parser_arg *) arg, msg.str().c_str(), dds_line_num); +} + +/* + Add the variable pointed to by CURRENT to either the topmost ctor object on + the stack CTOR or to the dataset variable table TABLE if CTOR is empty. If + it exists, the current ctor object is popped off the stack and assigned to + CURRENT. + + NB: the ctor stack is popped for arrays because they are ctors which + contain only a single variable. For other ctor types, several variables may + be members and the parse rule (see `declaration' above) determines when to + pop the stack. + + Returns: void + */ + +void add_entry(DDS &table, stack **ctor, BaseType **current, Part part) +{ + if (!*ctor) + *ctor = new stack ; + + if (!(*ctor)->empty()) { /* must be parsing a ctor type */ + (*ctor)->top()->add_var(*current, part); + + const Type &ctor_type = (*ctor)->top()->type(); + + if (ctor_type == dods_array_c) { + if (*current) + delete *current; + *current = (*ctor)->top(); + (*ctor)->pop(); + + // Return here to avoid deleting the new value of 'current.' + return; + } + } + else { + table.add_var(*current); + } + + if (*current) + delete *current; + *current = 0; +} + diff -Nru libdap-3.11.1/debian/changelog libdap-3.12.0/debian/changelog --- libdap-3.11.1/debian/changelog 2013-07-10 08:25:14.000000000 +0000 +++ libdap-3.12.0/debian/changelog 2013-10-17 23:03:53.000000000 +0000 @@ -1,3 +1,15 @@ +libdap (3.12.0-1) unstable; urgency=low + + * New upstream release. + - No longer need curl-types-remove.patch + * Add debian/watch file. + * Fix typo in hardening flags; Change to =all,-pie ; + Use DEB_LDFLAGS_MAINT_APPEND. Closes: #697387. + * Enable parallel build. Closes: #723938. + * Depend on libcurl4-gnutls-dev | libcurl-dev. Closes: #722701. + + -- Alastair McKinstry Thu, 17 Oct 2013 22:12:11 +0100 + libdap (3.11.1-15) unstable; urgency=low * Avoid exit 1 in conditional in ./rules by adding echo. diff -Nru libdap-3.11.1/debian/control libdap-3.12.0/debian/control --- libdap-3.11.1/debian/control 2013-07-10 08:25:14.000000000 +0000 +++ libdap-3.12.0/debian/control 2013-10-17 23:03:53.000000000 +0000 @@ -2,7 +2,7 @@ Section: utils Priority: optional Maintainer: Alastair McKinstry -Build-Depends: zlib1g-dev, debhelper (>= 9), pkg-config, libxml2-dev, libcurl4-gnutls-dev , dejagnu, doxygen, graphviz, dh-autoreconf (>= 4~), +Build-Depends: zlib1g-dev, debhelper (>= 9), pkg-config, libxml2-dev, libcurl4-gnutls-dev, dejagnu, doxygen, graphviz, dh-autoreconf (>= 4~), autoconf, automake, libtool, flex, bison, uuid-dev, libjs-jquery Build-Conflicts: autoconf2.13 Standards-Version: 3.9.4 @@ -85,7 +85,7 @@ Section: libdevel Architecture: any Multi-Arch: same -Depends: libdap11 ( = ${binary:Version} ), libdapserver7 (=${binary:Version}), libdapclient3 (=${binary:Version}) , ${misc:Depends}, libxml2-dev, libcurl4-gnutls-dev, uuid-dev, pkg-config +Depends: libdap11 ( = ${binary:Version} ), libdapserver7 (=${binary:Version}), libdapclient3 (=${binary:Version}) , ${misc:Depends}, libxml2-dev, libcurl4-gnutls-dev | libcurl-dev, uuid-dev, pkg-config Description: Development files (headers and static libraries) for libdap OPeNDAP provides software that allows you to access data over the internet, from programs that weren't originally designed for that purpose, as well diff -Nru libdap-3.11.1/debian/libdap11.install libdap-3.12.0/debian/libdap11.install --- libdap-3.11.1/debian/libdap11.install 2013-07-10 08:25:14.000000000 +0000 +++ libdap-3.12.0/debian/libdap11.install 2013-10-17 23:03:53.000000000 +0000 @@ -1 +1 @@ -usr/lib/*/libdap.so.11.3.0 +usr/lib/*/libdap.so.11.5.0 diff -Nru libdap-3.11.1/debian/libdapclient3.install libdap-3.12.0/debian/libdapclient3.install --- libdap-3.11.1/debian/libdapclient3.install 2013-07-10 08:25:14.000000000 +0000 +++ libdap-3.12.0/debian/libdapclient3.install 2013-10-17 23:03:53.000000000 +0000 @@ -1 +1 @@ -usr/lib/*/libdapclient.so.3.1.0 +usr/lib/*/libdapclient.so.3.2.0 diff -Nru libdap-3.11.1/debian/libdapserver7.install libdap-3.12.0/debian/libdapserver7.install --- libdap-3.11.1/debian/libdapserver7.install 2013-07-10 08:25:14.000000000 +0000 +++ libdap-3.12.0/debian/libdapserver7.install 2013-10-17 23:03:53.000000000 +0000 @@ -1 +1 @@ -usr/lib/*/libdapserver.so.7.2.0 +usr/lib/*/libdapserver.so.7.5.0 diff -Nru libdap-3.11.1/debian/patches/series libdap-3.12.0/debian/patches/series --- libdap-3.11.1/debian/patches/series 2013-07-10 08:25:14.000000000 +0000 +++ libdap-3.12.0/debian/patches/series 2013-10-17 23:03:53.000000000 +0000 @@ -1,5 +1,3 @@ -curl-types-remove.patch xml_libs.patch testsuite-failures.patch pkgconfig.patch -g++47-fix.patch diff -Nru libdap-3.11.1/debian/patches/testsuite-failures.patch libdap-3.12.0/debian/patches/testsuite-failures.patch --- libdap-3.11.1/debian/patches/testsuite-failures.patch 2013-07-10 08:25:14.000000000 +0000 +++ libdap-3.12.0/debian/patches/testsuite-failures.patch 2013-10-17 23:03:53.000000000 +0000 @@ -2,20 +2,12 @@ Issue reported upstream. Author: Alastair McKinstry Forwarded: no -Last-Updated: 2011-08-13 +Last-Updated: 2013-10-17 -Index: libdap-3.11.1/tests/expr-testsuite/test.6b.base +Index: libdap-3.12.0/tests/EXPRTest.at =================================================================== ---- libdap-3.11.1.orig/tests/expr-testsuite/test.6b.base 2011-12-07 14:05:05.000000000 +0000 -+++ libdap-3.11.1/tests/expr-testsuite/test.6b.base 2011-12-07 17:08:53.000000000 +0000 -@@ -1,2 +1 @@ - Error: The number of dimensions in the constraint for i must match the number in the array. -- -\ No newline at end of file -Index: libdap-3.11.1/tests/EXPRTest.at -=================================================================== ---- libdap-3.11.1.orig/tests/EXPRTest.at 2011-12-07 14:05:05.000000000 +0000 -+++ libdap-3.11.1/tests/EXPRTest.at 2011-12-07 17:08:53.000000000 +0000 +--- libdap-3.12.0.orig/tests/EXPRTest.at 2013-10-17 22:56:27.000000000 +0100 ++++ libdap-3.12.0/tests/EXPRTest.at 2013-10-17 22:56:27.000000000 +0100 @@ -74,7 +74,7 @@ EXPR_RESPONSE_P([test.8], ["data%20name,y"], [test.8b], [pass]) EXPR_RESPONSE_P([test.9], ["Data-Set-2.fakeDim0[[0:3]],Data-Set-2.fakeDim1[[0:3]]"], [test.9], [pass]) diff -Nru libdap-3.11.1/debian/patches/xml_libs.patch libdap-3.12.0/debian/patches/xml_libs.patch --- libdap-3.11.1/debian/patches/xml_libs.patch 2013-07-10 08:25:14.000000000 +0000 +++ libdap-3.12.0/debian/patches/xml_libs.patch 2013-10-17 23:03:53.000000000 +0000 @@ -3,14 +3,14 @@ Forwarded: no Last-Updated: 2011-12-08 -Index: libdap-3.11.1/Makefile.am +Index: libdap-3.12.0/Makefile.am =================================================================== ---- libdap-3.11.1.orig/Makefile.am 2011-12-07 14:05:05.000000000 +0000 -+++ libdap-3.11.1/Makefile.am 2011-12-07 17:08:53.000000000 +0000 -@@ -49,7 +49,7 @@ +--- libdap-3.12.0.orig/Makefile.am 2013-10-17 22:54:41.000000000 +0100 ++++ libdap-3.12.0/Makefile.am 2013-10-17 22:55:52.000000000 +0100 +@@ -71,7 +71,7 @@ libdapclient_la_SOURCES = $(CLIENT_SRC) libdapclient_la_LDFLAGS = -version-info $(CLIENTLIB_VERSION) - libdapclient_la_CPPFLAGS = $(AM_CPPFLAGS) $(CURL_CFLAGS) $(XML2_CFLAGS) + libdapclient_la_CPPFLAGS = $(AM_CPPFLAGS) $(CURL_CFLAGS) -libdapclient_la_LIBADD = $(CURL_LIBS) libdap.la $(PTHREAD_LIBS) +libdapclient_la_LIBADD = $(XML2_LIBS) $(CURL_LIBS) libdap.la $(PTHREAD_LIBS) diff -Nru libdap-3.11.1/debian/rules libdap-3.12.0/debian/rules --- libdap-3.11.1/debian/rules 2013-07-10 08:25:14.000000000 +0000 +++ libdap-3.12.0/debian/rules 2013-10-17 23:03:53.000000000 +0000 @@ -5,18 +5,19 @@ LIBDIR:=/usr/lib/$(DEB_HOST_MULTIARCH) # To enable all, uncomment following line -DEB_BUILD_MAINT_OPTIONS:= hardening=+allx +DEB_BUILD_MAINT_OPTIONS:= hardening=+all,-pie DEB_CFLAGS_MAINT_APPEND:= -Wall -pedantic +DEB_LDFLAGS_MAINT_APPEND:= -Wl,--as-needed export DEB_BUILD_MAINT_OPTIONS export DEB_CFLAGS_MAINT_APPEND +export DEB_LDFLAGS_MAINT_APPEND # Always do verbose. export DH_VERBOSE=1 # The magic debhelper rule: %: - dh $@ --with autoreconf - + dh $@ --with autoreconf --parallel override_dh_autoreconf: # remove out of date files @@ -25,7 +26,7 @@ dh_autoreconf --as-needed override_dh_auto_configure: - LDFLAGS="$(LDFLAGS) -Wl,--as-needed" dh_auto_configure -- --with-gnu-ld + dh_auto_configure -- --with-gnu-ld override_dh_auto_build: dh_auto_build @@ -34,12 +35,12 @@ override_dh_auto_install: dh_auto_install # dh_links needed for multi-arch - dh_link -p libdap11 $(LIBDIR)/libdap.so.11.3.0 $(LIBDIR)/libdap.so.11 - dh_link -p libdapclient3 $(LIBDIR)/libdapclient.so.3.1.0 $(LIBDIR)/libdapclient.so.3 - dh_link -p libdapserver7 $(LIBDIR)/libdapserver.so.7.2.0 $(LIBDIR)/libdapserver.so.7 - dh_link -p libdap-dev $(LIBDIR)/libdap.so.11.3.0 $(LIBDIR)/libdap.so - dh_link -p libdap-dev $(LIBDIR)/libdapclient.so.3.1.0 $(LIBDIR)/libdapclient.so - dh_link -p libdap-dev $(LIBDIR)/libdapserver.so.7.2.0 $(LIBDIR)/libdapserver.so + dh_link -p libdap11 $(LIBDIR)/libdap.so.11.5.0 $(LIBDIR)/libdap.so.11 + dh_link -p libdapclient3 $(LIBDIR)/libdapclient.so.3.2.0 $(LIBDIR)/libdapclient.so.3 + dh_link -p libdapserver7 $(LIBDIR)/libdapserver.so.7.5.0 $(LIBDIR)/libdapserver.so.7 + dh_link -p libdap-dev $(LIBDIR)/libdap.so.11.5.0 $(LIBDIR)/libdap.so + dh_link -p libdap-dev $(LIBDIR)/libdapclient.so.3.2.0 $(LIBDIR)/libdapclient.so + dh_link -p libdap-dev $(LIBDIR)/libdapserver.so.7.5.0 $(LIBDIR)/libdapserver.so cp debian/dap-config.pkg debian/libdap-dev/usr/bin/dap-config override_dh_installdocs: diff -Nru libdap-3.11.1/debian/watch libdap-3.12.0/debian/watch --- libdap-3.11.1/debian/watch 1970-01-01 00:00:00.000000000 +0000 +++ libdap-3.12.0/debian/watch 2013-10-17 23:03:53.000000000 +0000 @@ -0,0 +1,3 @@ +version=3 +http://www.opendap.org/download/libdap \ +(?:|.*/)libdap(?:[_\-]v?|)(\d[^\s/]*)\.(?:tar\.xz|txz|tar\.bz2|tbz2|tar\.gz|tgz) diff -Nru libdap-3.11.1/debug.h libdap-3.12.0/debug.h --- libdap-3.11.1/debug.h 2011-04-29 13:19:42.000000000 +0000 +++ libdap-3.12.0/debug.h 2013-10-17 21:27:40.000000000 +0000 @@ -19,7 +19,7 @@ // // You should have received a copy of the GNU Lesser General Public // License along with this library; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA // // You can contact OPeNDAP, Inc. at PO Box 112, Saunderstown, RI. 02874-0112. */ diff -Nru libdap-3.11.1/dods-datatypes-config.h.in libdap-3.12.0/dods-datatypes-config.h.in --- libdap-3.11.1/dods-datatypes-config.h.in 2011-04-29 13:19:43.000000000 +0000 +++ libdap-3.12.0/dods-datatypes-config.h.in 2013-10-17 21:27:40.000000000 +0000 @@ -23,7 +23,7 @@ the dods-datatypes.h header when its contents change. This saves on compilation since the header is used by many files in the dap++ library. The downside is that the typedefs are so ugly... 2/14/2001 jhrg */ - + #undef DINT32 typedef DINT32 dods_int32; @@ -43,7 +43,16 @@ typedef DFLOAT64 dods_float64; #undef DFLOAT32 -typedef DFLOAT32 dods_float32; +typedef DFLOAT32 dods_float32; + +#undef DINT8 +typedef DINT8 dods_int8; + +#undef DINT64 +typedef DINT64 dods_int64; + +#undef DUINT64 +typedef DUINT64 dods_uint64; #endif /* __DODS_DATATYPES__ */ diff -Nru libdap-3.11.1/dods-datatypes-static.h libdap-3.12.0/dods-datatypes-static.h --- libdap-3.11.1/dods-datatypes-static.h 2011-04-29 13:19:43.000000000 +0000 +++ libdap-3.12.0/dods-datatypes-static.h 2013-10-17 21:27:40.000000000 +0000 @@ -44,6 +44,13 @@ typedef float dods_float32; +// Added for DAP4 +typedef int8_t dods_int8; + +typedef int64_t dods_int64; + +typedef uint64_t dods_uint64; + } // namespace libdap #endif /* __DODS_DATATYPES__ */ diff -Nru libdap-3.11.1/dods-datatypes.h libdap-3.12.0/dods-datatypes.h --- libdap-3.11.1/dods-datatypes.h 2011-04-29 13:19:43.000000000 +0000 +++ libdap-3.12.0/dods-datatypes.h 2013-10-17 21:27:40.000000000 +0000 @@ -44,6 +44,13 @@ typedef float dods_float32; +// Added for DAP4 +typedef int8_t dods_int8; + +typedef int64_t dods_int64; + +typedef uint64_t dods_uint64; + } // namespace libdap #endif /* __DODS_DATATYPES__ */ diff -Nru libdap-3.11.1/dods-limits.h libdap-3.12.0/dods-limits.h --- libdap-3.11.1/dods-limits.h 2011-04-29 13:19:43.000000000 +0000 +++ libdap-3.12.0/dods-limits.h 2013-10-17 21:27:40.000000000 +0000 @@ -19,7 +19,7 @@ // // You should have received a copy of the GNU Lesser General Public // License along with this library; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA // // You can contact OPeNDAP, Inc. at PO Box 112, Saunderstown, RI. 02874-0112. @@ -35,6 +35,9 @@ #ifndef _dods_limits_h #define _dods_limits_h +#if 0 +// The old values. I switched to hex notation when 64-bit ints were added +// to DAP4. #define DODS_CHAR_BIT 8 #define DODS_SCHAR_MIN -128 #define DODS_SCHAR_MAX 127 @@ -45,13 +48,39 @@ #define DODS_SHRT_MAX 32767 #define DODS_USHRT_MAX 65535U -#define DODS_INT_MIN (-2147483647 - 1) +#define DODS_INT_MIN -2147483648 +// was (-2147483647 - 1) #define DODS_INT_MAX 2147483647 #define DODS_UINT_MAX 4294967295U -#define DODS_LONG_MIN (-2147483647 - 1) +#define DODS_LONG_MIN -2147483648 +// was (-2147483647 - 1) #define DODS_LONG_MAX 2147483647 #define DODS_ULONG_MAX 4294967295UL +#endif + +#define DODS_CHAR_BIT 8 +#define DODS_SCHAR_MIN (-0x7f-1) +#define DODS_SCHAR_MAX 0x7f +#define DODS_UCHAR_MAX 0xffU +#define DODS_UCHAR_MIN 0 + +#define DODS_SHRT_MIN (-0x7fff-1) +#define DODS_SHRT_MAX 0x7fff +#define DODS_USHRT_MAX 0xffffU + +#define DODS_INT_MIN (-0x7fffffff-1) +#define DODS_INT_MAX 0x7fffffff +#define DODS_UINT_MAX 0xffffffffUL + +#define DODS_LONG_MIN DODS_INT_MIN +#define DODS_LONG_MAX DODS_INT_MAX +#define DODS_ULONG_MAX DODS_UINT_MAX + +#define DODS_LLONG_MIN (-0x7fffffffffffffffLL-1) +#define DODS_LLONG_MAX 0x7fffffffffffffffLL +#define DODS_ULLONG_MAX 0xffffffffffffffffULL + #define DODS_DBL_DIG 15 /* digits of precision of a "double" */ #define DODS_DBL_MAX 1.7976931348623157E+308 /* max decimal value of a */ diff -Nru libdap-3.11.1/doxy.conf libdap-3.12.0/doxy.conf --- libdap-3.11.1/doxy.conf 2011-04-29 13:19:43.000000000 +0000 +++ libdap-3.12.0/doxy.conf 2013-10-17 21:27:40.000000000 +0000 @@ -31,7 +31,7 @@ # This could be handy for archiving the generated documentation or # if some version control system is used. -PROJECT_NUMBER = "Updated for version 3.8.2" +PROJECT_NUMBER = "Updated for version 3.12.0" # The OUTPUT_DIRECTORY tag is used to specify the (relative or absolute) # base path where the generated documentation will be put. diff -Nru libdap-3.11.1/doxy.conf.in libdap-3.12.0/doxy.conf.in --- libdap-3.11.1/doxy.conf.in 1970-01-01 00:00:00.000000000 +0000 +++ libdap-3.12.0/doxy.conf.in 2013-10-17 21:27:40.000000000 +0000 @@ -0,0 +1,1363 @@ +# Doxyfile 1.5.5 + +# This file describes the settings to be used by the documentation system +# doxygen (www.doxygen.org) for a project +# +# All text after a hash (#) is considered a comment and will be ignored +# The format is: +# TAG = value [value, ...] +# For lists items can also be appended using: +# TAG += value [value, ...] +# Values that contain spaces should be placed between quotes (" ") + +#--------------------------------------------------------------------------- +# Project related configuration options +#--------------------------------------------------------------------------- + +# This tag specifies the encoding used for all characters in the config file +# that follow. The default is UTF-8 which is also the encoding used for all +# text before the first occurrence of this tag. Doxygen uses libiconv (or the +# iconv built into libc) for the transcoding. See +# http://www.gnu.org/software/libiconv for the list of possible encodings. + +DOXYFILE_ENCODING = UTF-8 + +# The PROJECT_NAME tag is a single word (or a sequence of words surrounded +# by quotes) that should identify the project. + +PROJECT_NAME = libdap++ + +# The PROJECT_NUMBER tag can be used to enter a project or revision number. +# This could be handy for archiving the generated documentation or +# if some version control system is used. + +PROJECT_NUMBER = "Updated for version @PACKAGE_VERSION@" + +# The OUTPUT_DIRECTORY tag is used to specify the (relative or absolute) +# base path where the generated documentation will be put. +# If a relative path is entered, it will be relative to the location +# where doxygen was started. If left blank the current directory will be used. + +OUTPUT_DIRECTORY = docs + +# If the CREATE_SUBDIRS tag is set to YES, then doxygen will create +# 4096 sub-directories (in 2 levels) under the output directory of each output +# format and will distribute the generated files over these directories. +# Enabling this option can be useful when feeding doxygen a huge amount of +# source files, where putting all generated files in the same directory would +# otherwise cause performance problems for the file system. + +CREATE_SUBDIRS = NO + +# The OUTPUT_LANGUAGE tag is used to specify the language in which all +# documentation generated by doxygen is written. Doxygen will use this +# information to generate all constant output in the proper language. +# The default language is English, other supported languages are: +# Afrikaans, Arabic, Brazilian, Catalan, Chinese, Chinese-Traditional, +# Croatian, Czech, Danish, Dutch, Farsi, Finnish, French, German, Greek, +# Hungarian, Italian, Japanese, Japanese-en (Japanese with English messages), +# Korean, Korean-en, Lithuanian, Norwegian, Macedonian, Persian, Polish, +# Portuguese, Romanian, Russian, Serbian, Slovak, Slovene, Spanish, Swedish, +# and Ukrainian. + +OUTPUT_LANGUAGE = English + +# If the BRIEF_MEMBER_DESC tag is set to YES (the default) Doxygen will +# include brief member descriptions after the members that are listed in +# the file and class documentation (similar to JavaDoc). +# Set to NO to disable this. + +BRIEF_MEMBER_DESC = YES + +# If the REPEAT_BRIEF tag is set to YES (the default) Doxygen will prepend +# the brief description of a member or function before the detailed description. +# Note: if both HIDE_UNDOC_MEMBERS and BRIEF_MEMBER_DESC are set to NO, the +# brief descriptions will be completely suppressed. + +REPEAT_BRIEF = NO + +# This tag implements a quasi-intelligent brief description abbreviator +# that is used to form the text in various listings. Each string +# in this list, if found as the leading text of the brief description, will be +# stripped from the text and the result after processing the whole list, is +# used as the annotated text. Otherwise, the brief description is used as-is. +# If left blank, the following values are used ("$name" is automatically +# replaced with the name of the entity): "The $name class" "The $name widget" +# "The $name file" "is" "provides" "specifies" "contains" +# "represents" "a" "an" "the" + +ABBREVIATE_BRIEF = + +# If the ALWAYS_DETAILED_SEC and REPEAT_BRIEF tags are both set to YES then +# Doxygen will generate a detailed section even if there is only a brief +# description. + +ALWAYS_DETAILED_SEC = YES + +# If the INLINE_INHERITED_MEMB tag is set to YES, doxygen will show all +# inherited members of a class in the documentation of that class as if those +# members were ordinary class members. Constructors, destructors and assignment +# operators of the base classes will not be shown. + +INLINE_INHERITED_MEMB = YES + +# If the FULL_PATH_NAMES tag is set to YES then Doxygen will prepend the full +# path before files name in the file list and in the header files. If set +# to NO the shortest path that makes the file name unique will be used. + +FULL_PATH_NAMES = NO + +# If the FULL_PATH_NAMES tag is set to YES then the STRIP_FROM_PATH tag +# can be used to strip a user-defined part of the path. Stripping is +# only done if one of the specified strings matches the left-hand part of +# the path. The tag can be used to show relative paths in the file list. +# If left blank the directory from which doxygen is run is used as the +# path to strip. + +STRIP_FROM_PATH = + +# The STRIP_FROM_INC_PATH tag can be used to strip a user-defined part of +# the path mentioned in the documentation of a class, which tells +# the reader which header file to include in order to use a class. +# If left blank only the name of the header file containing the class +# definition is used. Otherwise one should specify the include paths that +# are normally passed to the compiler using the -I flag. + +STRIP_FROM_INC_PATH = + +# If the SHORT_NAMES tag is set to YES, doxygen will generate much shorter +# (but less readable) file names. This can be useful is your file systems +# doesn't support long names like on DOS, Mac, or CD-ROM. + +SHORT_NAMES = NO + +# If the JAVADOC_AUTOBRIEF tag is set to YES then Doxygen +# will interpret the first line (until the first dot) of a JavaDoc-style +# comment as the brief description. If set to NO, the JavaDoc +# comments will behave just like regular Qt-style comments +# (thus requiring an explicit @brief command for a brief description.) + +JAVADOC_AUTOBRIEF = NO + +# If the QT_AUTOBRIEF tag is set to YES then Doxygen will +# interpret the first line (until the first dot) of a Qt-style +# comment as the brief description. If set to NO, the comments +# will behave just like regular Qt-style comments (thus requiring +# an explicit \brief command for a brief description.) + +QT_AUTOBRIEF = NO + +# The MULTILINE_CPP_IS_BRIEF tag can be set to YES to make Doxygen +# treat a multi-line C++ special comment block (i.e. a block of //! or /// +# comments) as a brief description. This used to be the default behaviour. +# The new default is to treat a multi-line C++ comment block as a detailed +# description. Set this tag to YES if you prefer the old behaviour instead. + +MULTILINE_CPP_IS_BRIEF = NO + +# If the DETAILS_AT_TOP tag is set to YES then Doxygen +# will output the detailed description near the top, like JavaDoc. +# If set to NO, the detailed description appears after the member +# documentation. + +DETAILS_AT_TOP = NO + +# If the INHERIT_DOCS tag is set to YES (the default) then an undocumented +# member inherits the documentation from any documented member that it +# re-implements. + +INHERIT_DOCS = YES + +# If the SEPARATE_MEMBER_PAGES tag is set to YES, then doxygen will produce +# a new page for each member. If set to NO, the documentation of a member will +# be part of the file/class/namespace that contains it. + +SEPARATE_MEMBER_PAGES = NO + +# The TAB_SIZE tag can be used to set the number of spaces in a tab. +# Doxygen uses this value to replace tabs by spaces in code fragments. + +TAB_SIZE = 8 + +# This tag can be used to specify a number of aliases that acts +# as commands in the documentation. An alias has the form "name=value". +# For example adding "sideeffect=\par Side Effects:\n" will allow you to +# put the command \sideeffect (or @sideeffect) in the documentation, which +# will result in a user-defined paragraph with heading "Side Effects:". +# You can put \n's in the value part of an alias to insert newlines. + +ALIASES = + +# Set the OPTIMIZE_OUTPUT_FOR_C tag to YES if your project consists of C +# sources only. Doxygen will then generate output that is more tailored for C. +# For instance, some of the names that are used will be different. The list +# of all members will be omitted, etc. + +OPTIMIZE_OUTPUT_FOR_C = NO + +# Set the OPTIMIZE_OUTPUT_JAVA tag to YES if your project consists of Java +# sources only. Doxygen will then generate output that is more tailored for +# Java. For instance, namespaces will be presented as packages, qualified +# scopes will look different, etc. + +OPTIMIZE_OUTPUT_JAVA = NO + +# Set the OPTIMIZE_FOR_FORTRAN tag to YES if your project consists of Fortran +# sources only. Doxygen will then generate output that is more tailored for +# Fortran. + +OPTIMIZE_FOR_FORTRAN = NO + +# Set the OPTIMIZE_OUTPUT_VHDL tag to YES if your project consists of VHDL +# sources. Doxygen will then generate output that is tailored for +# VHDL. + +OPTIMIZE_OUTPUT_VHDL = NO + +# If you use STL classes (i.e. std::string, std::vector, etc.) but do not want +# to include (a tag file for) the STL sources as input, then you should +# set this tag to YES in order to let doxygen match functions declarations and +# definitions whose arguments contain STL classes (e.g. func(std::string); v.s. +# func(std::string) {}). This also make the inheritance and collaboration +# diagrams that involve STL classes more complete and accurate. + +BUILTIN_STL_SUPPORT = NO + +# If you use Microsoft's C++/CLI language, you should set this option to YES to +# enable parsing support. + +CPP_CLI_SUPPORT = NO + +# Set the SIP_SUPPORT tag to YES if your project consists of sip sources only. +# Doxygen will parse them like normal C++ but will assume all classes use public +# instead of private inheritance when no explicit protection keyword is present. + +SIP_SUPPORT = NO + +# If member grouping is used in the documentation and the DISTRIBUTE_GROUP_DOC +# tag is set to YES, then doxygen will reuse the documentation of the first +# member in the group (if any) for the other members of the group. By default +# all members of a group must be documented explicitly. + +DISTRIBUTE_GROUP_DOC = NO + +# Set the SUBGROUPING tag to YES (the default) to allow class member groups of +# the same type (for instance a group of public functions) to be put as a +# subgroup of that type (e.g. under the Public Functions section). Set it to +# NO to prevent subgrouping. Alternatively, this can be done per class using +# the \nosubgrouping command. + +SUBGROUPING = YES + +# When TYPEDEF_HIDES_STRUCT is enabled, a typedef of a struct, union, or enum +# is documented as struct, union, or enum with the name of the typedef. So +# typedef struct TypeS {} TypeT, will appear in the documentation as a struct +# with name TypeT. When disabled the typedef will appear as a member of a file, +# namespace, or class. And the struct will be named TypeS. This can typically +# be useful for C code in case the coding convention dictates that all compound +# types are typedef'ed and only the typedef is referenced, never the tag name. + +TYPEDEF_HIDES_STRUCT = NO + +#--------------------------------------------------------------------------- +# Build related configuration options +#--------------------------------------------------------------------------- + +# If the EXTRACT_ALL tag is set to YES doxygen will assume all entities in +# documentation are documented, even if no documentation was available. +# Private class members and static file members will be hidden unless +# the EXTRACT_PRIVATE and EXTRACT_STATIC tags are set to YES + +EXTRACT_ALL = YES + +# If the EXTRACT_PRIVATE tag is set to YES all private members of a class +# will be included in the documentation. + +EXTRACT_PRIVATE = NO + +# If the EXTRACT_STATIC tag is set to YES all static members of a file +# will be included in the documentation. + +EXTRACT_STATIC = NO + +# If the EXTRACT_LOCAL_CLASSES tag is set to YES classes (and structs) +# defined locally in source files will be included in the documentation. +# If set to NO only classes defined in header files are included. + +EXTRACT_LOCAL_CLASSES = NO + +# This flag is only useful for Objective-C code. When set to YES local +# methods, which are defined in the implementation section but not in +# the interface are included in the documentation. +# If set to NO (the default) only methods in the interface are included. + +EXTRACT_LOCAL_METHODS = NO + +# If this flag is set to YES, the members of anonymous namespaces will be +# extracted and appear in the documentation as a namespace called +# 'anonymous_namespace{file}', where file will be replaced with the base +# name of the file that contains the anonymous namespace. By default +# anonymous namespace are hidden. + +EXTRACT_ANON_NSPACES = NO + +# If the HIDE_UNDOC_MEMBERS tag is set to YES, Doxygen will hide all +# undocumented members of documented classes, files or namespaces. +# If set to NO (the default) these members will be included in the +# various overviews, but no documentation section is generated. +# This option has no effect if EXTRACT_ALL is enabled. + +HIDE_UNDOC_MEMBERS = NO + +# If the HIDE_UNDOC_CLASSES tag is set to YES, Doxygen will hide all +# undocumented classes that are normally visible in the class hierarchy. +# If set to NO (the default) these classes will be included in the various +# overviews. This option has no effect if EXTRACT_ALL is enabled. + +HIDE_UNDOC_CLASSES = NO + +# If the HIDE_FRIEND_COMPOUNDS tag is set to YES, Doxygen will hide all +# friend (class|struct|union) declarations. +# If set to NO (the default) these declarations will be included in the +# documentation. + +HIDE_FRIEND_COMPOUNDS = NO + +# If the HIDE_IN_BODY_DOCS tag is set to YES, Doxygen will hide any +# documentation blocks found inside the body of a function. +# If set to NO (the default) these blocks will be appended to the +# function's detailed documentation block. + +HIDE_IN_BODY_DOCS = NO + +# The INTERNAL_DOCS tag determines if documentation +# that is typed after a \internal command is included. If the tag is set +# to NO (the default) then the documentation will be excluded. +# Set it to YES to include the internal documentation. + +INTERNAL_DOCS = NO + +# If the CASE_SENSE_NAMES tag is set to NO then Doxygen will only generate +# file names in lower-case letters. If set to YES upper-case letters are also +# allowed. This is useful if you have classes or files whose names only differ +# in case and if your file system supports case sensitive file names. Windows +# and Mac users are advised to set this option to NO. + +CASE_SENSE_NAMES = YES + +# If the HIDE_SCOPE_NAMES tag is set to NO (the default) then Doxygen +# will show members with their full class and namespace scopes in the +# documentation. If set to YES the scope will be hidden. + +HIDE_SCOPE_NAMES = NO + +# If the SHOW_INCLUDE_FILES tag is set to YES (the default) then Doxygen +# will put a list of the files that are included by a file in the documentation +# of that file. + +SHOW_INCLUDE_FILES = YES + +# If the INLINE_INFO tag is set to YES (the default) then a tag [inline] +# is inserted in the documentation for inline members. + +INLINE_INFO = YES + +# If the SORT_MEMBER_DOCS tag is set to YES (the default) then doxygen +# will sort the (detailed) documentation of file and class members +# alphabetically by member name. If set to NO the members will appear in +# declaration order. + +SORT_MEMBER_DOCS = YES + +# If the SORT_BRIEF_DOCS tag is set to YES then doxygen will sort the +# brief documentation of file, namespace and class members alphabetically +# by member name. If set to NO (the default) the members will appear in +# declaration order. + +SORT_BRIEF_DOCS = YES + +# If the SORT_GROUP_NAMES tag is set to YES then doxygen will sort the +# hierarchy of group names into alphabetical order. If set to NO (the default) +# the group names will appear in their defined order. + +SORT_GROUP_NAMES = NO + +# If the SORT_BY_SCOPE_NAME tag is set to YES, the class list will be +# sorted by fully-qualified names, including namespaces. If set to +# NO (the default), the class list will be sorted only by class name, +# not including the namespace part. +# Note: This option is not very useful if HIDE_SCOPE_NAMES is set to YES. +# Note: This option applies only to the class list, not to the +# alphabetical list. + +SORT_BY_SCOPE_NAME = NO + +# The GENERATE_TODOLIST tag can be used to enable (YES) or +# disable (NO) the todo list. This list is created by putting \todo +# commands in the documentation. + +GENERATE_TODOLIST = YES + +# The GENERATE_TESTLIST tag can be used to enable (YES) or +# disable (NO) the test list. This list is created by putting \test +# commands in the documentation. + +GENERATE_TESTLIST = YES + +# The GENERATE_BUGLIST tag can be used to enable (YES) or +# disable (NO) the bug list. This list is created by putting \bug +# commands in the documentation. + +GENERATE_BUGLIST = YES + +# The GENERATE_DEPRECATEDLIST tag can be used to enable (YES) or +# disable (NO) the deprecated list. This list is created by putting +# \deprecated commands in the documentation. + +GENERATE_DEPRECATEDLIST= YES + +# The ENABLED_SECTIONS tag can be used to enable conditional +# documentation sections, marked by \if sectionname ... \endif. + +ENABLED_SECTIONS = + +# The MAX_INITIALIZER_LINES tag determines the maximum number of lines +# the initial value of a variable or define consists of for it to appear in +# the documentation. If the initializer consists of more lines than specified +# here it will be hidden. Use a value of 0 to hide initializers completely. +# The appearance of the initializer of individual variables and defines in the +# documentation can be controlled using \showinitializer or \hideinitializer +# command in the documentation regardless of this setting. + +MAX_INITIALIZER_LINES = 30 + +# Set the SHOW_USED_FILES tag to NO to disable the list of files generated +# at the bottom of the documentation of classes and structs. If set to YES the +# list will mention the files that were used to generate the documentation. + +SHOW_USED_FILES = YES + +# If the sources in your project are distributed over multiple directories +# then setting the SHOW_DIRECTORIES tag to YES will show the directory hierarchy +# in the documentation. The default is NO. + +SHOW_DIRECTORIES = NO + +# The FILE_VERSION_FILTER tag can be used to specify a program or script that +# doxygen should invoke to get the current version for each file (typically from +# the version control system). Doxygen will invoke the program by executing (via +# popen()) the command , where is the value of +# the FILE_VERSION_FILTER tag, and is the name of an input file +# provided by doxygen. Whatever the program writes to standard output +# is used as the file version. See the manual for examples. + +FILE_VERSION_FILTER = + +#--------------------------------------------------------------------------- +# configuration options related to warning and progress messages +#--------------------------------------------------------------------------- + +# The QUIET tag can be used to turn on/off the messages that are generated +# by doxygen. Possible values are YES and NO. If left blank NO is used. + +QUIET = NO + +# The WARNINGS tag can be used to turn on/off the warning messages that are +# generated by doxygen. Possible values are YES and NO. If left blank +# NO is used. + +WARNINGS = YES + +# If WARN_IF_UNDOCUMENTED is set to YES, then doxygen will generate warnings +# for undocumented members. If EXTRACT_ALL is set to YES then this flag will +# automatically be disabled. + +WARN_IF_UNDOCUMENTED = YES + +# If WARN_IF_DOC_ERROR is set to YES, doxygen will generate warnings for +# potential errors in the documentation, such as not documenting some +# parameters in a documented function, or documenting parameters that +# don't exist or using markup commands wrongly. + +WARN_IF_DOC_ERROR = YES + +# This WARN_NO_PARAMDOC option can be abled to get warnings for +# functions that are documented, but have no documentation for their parameters +# or return value. If set to NO (the default) doxygen will only warn about +# wrong or incomplete parameter documentation, but not about the absence of +# documentation. + +WARN_NO_PARAMDOC = NO + +# The WARN_FORMAT tag determines the format of the warning messages that +# doxygen can produce. The string should contain the $file, $line, and $text +# tags, which will be replaced by the file and line number from which the +# warning originated and the warning text. Optionally the format may contain +# $version, which will be replaced by the version of the file (if it could +# be obtained via FILE_VERSION_FILTER) + +WARN_FORMAT = "$file:$line: $text" + +# The WARN_LOGFILE tag can be used to specify a file to which warning +# and error messages should be written. If left blank the output is written +# to stderr. + +WARN_LOGFILE = + +#--------------------------------------------------------------------------- +# configuration options related to the input files +#--------------------------------------------------------------------------- + +# The INPUT tag can be used to specify the files and/or directories that contain +# documented source files. You may enter file names like "myfile.cpp" or +# directories like "/usr/src/myproject". Separate the files or directories +# with spaces. + +INPUT = . + +# This tag can be used to specify the character encoding of the source files +# that doxygen parses. Internally doxygen uses the UTF-8 encoding, which is +# also the default input encoding. Doxygen uses libiconv (or the iconv built +# into libc) for the transcoding. See http://www.gnu.org/software/libiconv for +# the list of possible encodings. + +INPUT_ENCODING = UTF-8 + +# If the value of the INPUT tag contains directories, you can use the +# FILE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp +# and *.h) to filter out the source-files in the directories. If left +# blank the following patterns are tested: +# *.c *.cc *.cxx *.cpp *.c++ *.java *.ii *.ixx *.ipp *.i++ *.inl *.h *.hh *.hxx +# *.hpp *.h++ *.idl *.odl *.cs *.php *.php3 *.inc *.m *.mm *.py *.f90 + +FILE_PATTERNS = *.cc \ + *.h \ + *.doxygen + +# The RECURSIVE tag can be used to turn specify whether or not subdirectories +# should be searched for input files as well. Possible values are YES and NO. +# If left blank NO is used. + +RECURSIVE = NO + +# The EXCLUDE tag can be used to specify files and/or directories that should +# excluded from the INPUT source files. This way you can easily exclude a +# subdirectory from a directory tree whose root is specified with the INPUT tag. + +EXCLUDE = expr.h + +# The EXCLUDE_SYMLINKS tag can be used select whether or not files or +# directories that are symbolic links (a Unix filesystem feature) are excluded +# from the input. + +EXCLUDE_SYMLINKS = NO + +# If the value of the INPUT tag contains directories, you can use the +# EXCLUDE_PATTERNS tag to specify one or more wildcard patterns to exclude +# certain files from those directories. Note that the wildcards are matched +# against the file with absolute path, so to exclude all test directories +# for example use the pattern */test/* + +EXCLUDE_PATTERNS = *.tab.cc \ + *.tab.h \ + lex.* \ + Test*.cc \ + Test*.h \ + *Test.cc + +# The EXCLUDE_SYMBOLS tag can be used to specify one or more symbol names +# (namespaces, classes, functions, etc.) that should be excluded from the +# output. The symbol name can be a fully qualified name, a word, or if the +# wildcard * is used, a substring. Examples: ANamespace, AClass, +# AClass::ANamespace, ANamespace::*Test + +EXCLUDE_SYMBOLS = + +# The EXAMPLE_PATH tag can be used to specify one or more files or +# directories that contain example code fragments that are included (see +# the \include command). + +EXAMPLE_PATH = + +# If the value of the EXAMPLE_PATH tag contains directories, you can use the +# EXAMPLE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp +# and *.h) to filter out the source-files in the directories. If left +# blank all files are included. + +EXAMPLE_PATTERNS = + +# If the EXAMPLE_RECURSIVE tag is set to YES then subdirectories will be +# searched for input files to be used with the \include or \dontinclude +# commands irrespective of the value of the RECURSIVE tag. +# Possible values are YES and NO. If left blank NO is used. + +EXAMPLE_RECURSIVE = NO + +# The IMAGE_PATH tag can be used to specify one or more files or +# directories that contain image that are included in the documentation (see +# the \image command). + +IMAGE_PATH = + +# The INPUT_FILTER tag can be used to specify a program that doxygen should +# invoke to filter for each input file. Doxygen will invoke the filter program +# by executing (via popen()) the command , where +# is the value of the INPUT_FILTER tag, and is the name of an +# input file. Doxygen will then use the output that the filter program writes +# to standard output. If FILTER_PATTERNS is specified, this tag will be +# ignored. + +INPUT_FILTER = + +# The FILTER_PATTERNS tag can be used to specify filters on a per file pattern +# basis. Doxygen will compare the file name with each pattern and apply the +# filter if there is a match. The filters are a list of the form: +# pattern=filter (like *.cpp=my_cpp_filter). See INPUT_FILTER for further +# info on how filters are used. If FILTER_PATTERNS is empty, INPUT_FILTER +# is applied to all files. + +FILTER_PATTERNS = + +# If the FILTER_SOURCE_FILES tag is set to YES, the input filter (if set using +# INPUT_FILTER) will be used to filter the input files when producing source +# files to browse (i.e. when SOURCE_BROWSER is set to YES). + +FILTER_SOURCE_FILES = NO + +#--------------------------------------------------------------------------- +# configuration options related to source browsing +#--------------------------------------------------------------------------- + +# If the SOURCE_BROWSER tag is set to YES then a list of source files will +# be generated. Documented entities will be cross-referenced with these sources. +# Note: To get rid of all source code in the generated output, make sure also +# VERBATIM_HEADERS is set to NO. + +SOURCE_BROWSER = YES + +# Setting the INLINE_SOURCES tag to YES will include the body +# of functions and classes directly in the documentation. + +INLINE_SOURCES = NO + +# Setting the STRIP_CODE_COMMENTS tag to YES (the default) will instruct +# doxygen to hide any special comment blocks from generated source code +# fragments. Normal C and C++ comments will always remain visible. + +STRIP_CODE_COMMENTS = YES + +# If the REFERENCED_BY_RELATION tag is set to YES (the default) +# then for each documented function all documented +# functions referencing it will be listed. + +REFERENCED_BY_RELATION = YES + +# If the REFERENCES_RELATION tag is set to YES (the default) +# then for each documented function all documented entities +# called/used by that function will be listed. + +REFERENCES_RELATION = YES + +# If the REFERENCES_LINK_SOURCE tag is set to YES (the default) +# and SOURCE_BROWSER tag is set to YES, then the hyperlinks from +# functions in REFERENCES_RELATION and REFERENCED_BY_RELATION lists will +# link to the source code. Otherwise they will link to the documentstion. + +REFERENCES_LINK_SOURCE = YES + +# If the USE_HTAGS tag is set to YES then the references to source code +# will point to the HTML generated by the htags(1) tool instead of doxygen +# built-in source browser. The htags tool is part of GNU's global source +# tagging system (see http://www.gnu.org/software/global/global.html). You +# will need version 4.8.6 or higher. + +USE_HTAGS = NO + +# If the VERBATIM_HEADERS tag is set to YES (the default) then Doxygen +# will generate a verbatim copy of the header file for each class for +# which an include is specified. Set to NO to disable this. + +VERBATIM_HEADERS = YES + +#--------------------------------------------------------------------------- +# configuration options related to the alphabetical class index +#--------------------------------------------------------------------------- + +# If the ALPHABETICAL_INDEX tag is set to YES, an alphabetical index +# of all compounds will be generated. Enable this if the project +# contains a lot of classes, structs, unions or interfaces. + +ALPHABETICAL_INDEX = YES + +# If the alphabetical index is enabled (see ALPHABETICAL_INDEX) then +# the COLS_IN_ALPHA_INDEX tag can be used to specify the number of columns +# in which this list will be split (can be a number in the range [1..20]) + +COLS_IN_ALPHA_INDEX = 5 + +# In case all classes in a project start with a common prefix, all +# classes will be put under the same header in the alphabetical index. +# The IGNORE_PREFIX tag can be used to specify one or more prefixes that +# should be ignored while generating the index headers. + +IGNORE_PREFIX = + +#--------------------------------------------------------------------------- +# configuration options related to the HTML output +#--------------------------------------------------------------------------- + +# If the GENERATE_HTML tag is set to YES (the default) Doxygen will +# generate HTML output. + +GENERATE_HTML = YES + +# The HTML_OUTPUT tag is used to specify where the HTML docs will be put. +# If a relative path is entered the value of OUTPUT_DIRECTORY will be +# put in front of it. If left blank `html' will be used as the default path. + +HTML_OUTPUT = html + +# The HTML_FILE_EXTENSION tag can be used to specify the file extension for +# each generated HTML page (for example: .htm,.php,.asp). If it is left blank +# doxygen will generate files with .html extension. + +HTML_FILE_EXTENSION = .html + +# The HTML_HEADER tag can be used to specify a personal HTML header for +# each generated HTML page. If it is left blank doxygen will generate a +# standard header. + +HTML_HEADER = + +# The HTML_FOOTER tag can be used to specify a personal HTML footer for +# each generated HTML page. If it is left blank doxygen will generate a +# standard footer. + +HTML_FOOTER = + +# The HTML_STYLESHEET tag can be used to specify a user-defined cascading +# style sheet that is used by each HTML page. It can be used to +# fine-tune the look of the HTML output. If the tag is left blank doxygen +# will generate a default style sheet. Note that doxygen will try to copy +# the style sheet file to the HTML output directory, so don't put your own +# stylesheet in the HTML output directory as well, or it will be erased! + +HTML_STYLESHEET = + +# If the HTML_ALIGN_MEMBERS tag is set to YES, the members of classes, +# files or namespaces will be aligned in HTML using tables. If set to +# NO a bullet list will be used. + +HTML_ALIGN_MEMBERS = YES + +# If the GENERATE_HTMLHELP tag is set to YES, additional index files +# will be generated that can be used as input for tools like the +# Microsoft HTML help workshop to generate a compiled HTML help file (.chm) +# of the generated HTML documentation. + +GENERATE_HTMLHELP = NO + +# If the GENERATE_DOCSET tag is set to YES, additional index files +# will be generated that can be used as input for Apple's Xcode 3 +# integrated development environment, introduced with OSX 10.5 (Leopard). +# To create a documentation set, doxygen will generate a Makefile in the +# HTML output directory. Running make will produce the docset in that +# directory and running "make install" will install the docset in +# ~/Library/Developer/Shared/Documentation/DocSets so that Xcode will find +# it at startup. + +GENERATE_DOCSET = NO + +# When GENERATE_DOCSET tag is set to YES, this tag determines the name of the +# feed. A documentation feed provides an umbrella under which multiple +# documentation sets from a single provider (such as a company or product suite) +# can be grouped. + +DOCSET_FEEDNAME = "Doxygen generated docs" + +# When GENERATE_DOCSET tag is set to YES, this tag specifies a string that +# should uniquely identify the documentation set bundle. This should be a +# reverse domain-name style string, e.g. com.mycompany.MyDocSet. Doxygen +# will append .docset to the name. + +DOCSET_BUNDLE_ID = org.doxygen.Project + +# If the HTML_DYNAMIC_SECTIONS tag is set to YES then the generated HTML +# documentation will contain sections that can be hidden and shown after the +# page has loaded. For this to work a browser that supports +# JavaScript and DHTML is required (for instance Mozilla 1.0+, Firefox +# Netscape 6.0+, Internet explorer 5.0+, Konqueror, or Safari). + +HTML_DYNAMIC_SECTIONS = NO + +# If the GENERATE_HTMLHELP tag is set to YES, the CHM_FILE tag can +# be used to specify the file name of the resulting .chm file. You +# can add a path in front of the file if the result should not be +# written to the html output directory. + +CHM_FILE = + +# If the GENERATE_HTMLHELP tag is set to YES, the HHC_LOCATION tag can +# be used to specify the location (absolute path including file name) of +# the HTML help compiler (hhc.exe). If non-empty doxygen will try to run +# the HTML help compiler on the generated index.hhp. + +HHC_LOCATION = + +# If the GENERATE_HTMLHELP tag is set to YES, the GENERATE_CHI flag +# controls if a separate .chi index file is generated (YES) or that +# it should be included in the master .chm file (NO). + +GENERATE_CHI = NO + +# If the GENERATE_HTMLHELP tag is set to YES, the BINARY_TOC flag +# controls whether a binary table of contents is generated (YES) or a +# normal table of contents (NO) in the .chm file. + +BINARY_TOC = NO + +# The TOC_EXPAND flag can be set to YES to add extra items for group members +# to the contents of the HTML help documentation and to the tree view. + +TOC_EXPAND = YES + +# The DISABLE_INDEX tag can be used to turn on/off the condensed index at +# top of each HTML page. The value NO (the default) enables the index and +# the value YES disables it. + +DISABLE_INDEX = NO + +# This tag can be used to set the number of enum values (range [1..20]) +# that doxygen will group on one line in the generated HTML documentation. + +ENUM_VALUES_PER_LINE = 4 + +# If the GENERATE_TREEVIEW tag is set to YES, a side panel will be +# generated containing a tree-like index structure (just like the one that +# is generated for HTML Help). For this to work a browser that supports +# JavaScript, DHTML, CSS and frames is required (for instance Mozilla 1.0+, +# Netscape 6.0+, Internet explorer 5.0+, or Konqueror). Windows users are +# probably better off using the HTML help feature. + +GENERATE_TREEVIEW = YES + +# If the treeview is enabled (see GENERATE_TREEVIEW) then this tag can be +# used to set the initial width (in pixels) of the frame in which the tree +# is shown. + +TREEVIEW_WIDTH = 250 + +#--------------------------------------------------------------------------- +# configuration options related to the LaTeX output +#--------------------------------------------------------------------------- + +# If the GENERATE_LATEX tag is set to YES (the default) Doxygen will +# generate Latex output. + +GENERATE_LATEX = NO + +# The LATEX_OUTPUT tag is used to specify where the LaTeX docs will be put. +# If a relative path is entered the value of OUTPUT_DIRECTORY will be +# put in front of it. If left blank `latex' will be used as the default path. + +LATEX_OUTPUT = latex + +# The LATEX_CMD_NAME tag can be used to specify the LaTeX command name to be +# invoked. If left blank `latex' will be used as the default command name. + +LATEX_CMD_NAME = latex + +# The MAKEINDEX_CMD_NAME tag can be used to specify the command name to +# generate index for LaTeX. If left blank `makeindex' will be used as the +# default command name. + +MAKEINDEX_CMD_NAME = makeindex + +# If the COMPACT_LATEX tag is set to YES Doxygen generates more compact +# LaTeX documents. This may be useful for small projects and may help to +# save some trees in general. + +COMPACT_LATEX = YES + +# The PAPER_TYPE tag can be used to set the paper type that is used +# by the printer. Possible values are: a4, a4wide, letter, legal and +# executive. If left blank a4wide will be used. + +PAPER_TYPE = letter + +# The EXTRA_PACKAGES tag can be to specify one or more names of LaTeX +# packages that should be included in the LaTeX output. + +EXTRA_PACKAGES = + +# The LATEX_HEADER tag can be used to specify a personal LaTeX header for +# the generated latex document. The header should contain everything until +# the first chapter. If it is left blank doxygen will generate a +# standard header. Notice: only use this tag if you know what you are doing! + +LATEX_HEADER = + +# If the PDF_HYPERLINKS tag is set to YES, the LaTeX that is generated +# is prepared for conversion to pdf (using ps2pdf). The pdf file will +# contain links (just like the HTML output) instead of page references +# This makes the output suitable for online browsing using a pdf viewer. + +PDF_HYPERLINKS = YES + +# If the USE_PDFLATEX tag is set to YES, pdflatex will be used instead of +# plain latex in the generated Makefile. Set this option to YES to get a +# higher quality PDF documentation. + +USE_PDFLATEX = NO + +# If the LATEX_BATCHMODE tag is set to YES, doxygen will add the \\batchmode. +# command to the generated LaTeX files. This will instruct LaTeX to keep +# running if errors occur, instead of asking the user for help. +# This option is also used when generating formulas in HTML. + +LATEX_BATCHMODE = NO + +# If LATEX_HIDE_INDICES is set to YES then doxygen will not +# include the index chapters (such as File Index, Compound Index, etc.) +# in the output. + +LATEX_HIDE_INDICES = NO + +#--------------------------------------------------------------------------- +# configuration options related to the RTF output +#--------------------------------------------------------------------------- + +# If the GENERATE_RTF tag is set to YES Doxygen will generate RTF output +# The RTF output is optimized for Word 97 and may not look very pretty with +# other RTF readers or editors. + +GENERATE_RTF = NO + +# The RTF_OUTPUT tag is used to specify where the RTF docs will be put. +# If a relative path is entered the value of OUTPUT_DIRECTORY will be +# put in front of it. If left blank `rtf' will be used as the default path. + +RTF_OUTPUT = rtf + +# If the COMPACT_RTF tag is set to YES Doxygen generates more compact +# RTF documents. This may be useful for small projects and may help to +# save some trees in general. + +COMPACT_RTF = NO + +# If the RTF_HYPERLINKS tag is set to YES, the RTF that is generated +# will contain hyperlink fields. The RTF file will +# contain links (just like the HTML output) instead of page references. +# This makes the output suitable for online browsing using WORD or other +# programs which support those fields. +# Note: wordpad (write) and others do not support links. + +RTF_HYPERLINKS = NO + +# Load stylesheet definitions from file. Syntax is similar to doxygen's +# config file, i.e. a series of assignments. You only have to provide +# replacements, missing definitions are set to their default value. + +RTF_STYLESHEET_FILE = + +# Set optional variables used in the generation of an rtf document. +# Syntax is similar to doxygen's config file. + +RTF_EXTENSIONS_FILE = + +#--------------------------------------------------------------------------- +# configuration options related to the man page output +#--------------------------------------------------------------------------- + +# If the GENERATE_MAN tag is set to YES (the default) Doxygen will +# generate man pages + +GENERATE_MAN = NO + +# The MAN_OUTPUT tag is used to specify where the man pages will be put. +# If a relative path is entered the value of OUTPUT_DIRECTORY will be +# put in front of it. If left blank `man' will be used as the default path. + +MAN_OUTPUT = man + +# The MAN_EXTENSION tag determines the extension that is added to +# the generated man pages (default is the subroutine's section .3) + +MAN_EXTENSION = .3n + +# If the MAN_LINKS tag is set to YES and Doxygen generates man output, +# then it will generate one additional man file for each entity +# documented in the real man page(s). These additional files +# only source the real man page, but without them the man command +# would be unable to find the correct page. The default is NO. + +MAN_LINKS = NO + +#--------------------------------------------------------------------------- +# configuration options related to the XML output +#--------------------------------------------------------------------------- + +# If the GENERATE_XML tag is set to YES Doxygen will +# generate an XML file that captures the structure of +# the code including all documentation. + +GENERATE_XML = NO + +# The XML_OUTPUT tag is used to specify where the XML pages will be put. +# If a relative path is entered the value of OUTPUT_DIRECTORY will be +# put in front of it. If left blank `xml' will be used as the default path. + +XML_OUTPUT = xml + +# The XML_SCHEMA tag can be used to specify an XML schema, +# which can be used by a validating XML parser to check the +# syntax of the XML files. + +XML_SCHEMA = + +# The XML_DTD tag can be used to specify an XML DTD, +# which can be used by a validating XML parser to check the +# syntax of the XML files. + +XML_DTD = + +# If the XML_PROGRAMLISTING tag is set to YES Doxygen will +# dump the program listings (including syntax highlighting +# and cross-referencing information) to the XML output. Note that +# enabling this will significantly increase the size of the XML output. + +XML_PROGRAMLISTING = YES + +#--------------------------------------------------------------------------- +# configuration options for the AutoGen Definitions output +#--------------------------------------------------------------------------- + +# If the GENERATE_AUTOGEN_DEF tag is set to YES Doxygen will +# generate an AutoGen Definitions (see autogen.sf.net) file +# that captures the structure of the code including all +# documentation. Note that this feature is still experimental +# and incomplete at the moment. + +GENERATE_AUTOGEN_DEF = NO + +#--------------------------------------------------------------------------- +# configuration options related to the Perl module output +#--------------------------------------------------------------------------- + +# If the GENERATE_PERLMOD tag is set to YES Doxygen will +# generate a Perl module file that captures the structure of +# the code including all documentation. Note that this +# feature is still experimental and incomplete at the +# moment. + +GENERATE_PERLMOD = NO + +# If the PERLMOD_LATEX tag is set to YES Doxygen will generate +# the necessary Makefile rules, Perl scripts and LaTeX code to be able +# to generate PDF and DVI output from the Perl module output. + +PERLMOD_LATEX = NO + +# If the PERLMOD_PRETTY tag is set to YES the Perl module output will be +# nicely formatted so it can be parsed by a human reader. This is useful +# if you want to understand what is going on. On the other hand, if this +# tag is set to NO the size of the Perl module output will be much smaller +# and Perl will parse it just the same. + +PERLMOD_PRETTY = YES + +# The names of the make variables in the generated doxyrules.make file +# are prefixed with the string contained in PERLMOD_MAKEVAR_PREFIX. +# This is useful so different doxyrules.make files included by the same +# Makefile don't overwrite each other's variables. + +PERLMOD_MAKEVAR_PREFIX = + +#--------------------------------------------------------------------------- +# Configuration options related to the preprocessor +#--------------------------------------------------------------------------- + +# If the ENABLE_PREPROCESSING tag is set to YES (the default) Doxygen will +# evaluate all C-preprocessor directives found in the sources and include +# files. + +ENABLE_PREPROCESSING = YES + +# If the MACRO_EXPANSION tag is set to YES Doxygen will expand all macro +# names in the source code. If set to NO (the default) only conditional +# compilation will be performed. Macro expansion can be done in a controlled +# way by setting EXPAND_ONLY_PREDEF to YES. + +MACRO_EXPANSION = NO + +# If the EXPAND_ONLY_PREDEF and MACRO_EXPANSION tags are both set to YES +# then the macro expansion is limited to the macros specified with the +# PREDEFINED and EXPAND_AS_DEFINED tags. + +EXPAND_ONLY_PREDEF = NO + +# If the SEARCH_INCLUDES tag is set to YES (the default) the includes files +# in the INCLUDE_PATH (see below) will be search if a #include is found. + +SEARCH_INCLUDES = YES + +# The INCLUDE_PATH tag can be used to specify one or more directories that +# contain include files that are not input files but should be processed by +# the preprocessor. + +INCLUDE_PATH = + +# You can use the INCLUDE_FILE_PATTERNS tag to specify one or more wildcard +# patterns (like *.h and *.hpp) to filter out the header-files in the +# directories. If left blank, the patterns specified with FILE_PATTERNS will +# be used. + +INCLUDE_FILE_PATTERNS = + +# The PREDEFINED tag can be used to specify one or more macro names that +# are defined before the preprocessor is started (similar to the -D option of +# gcc). The argument of the tag is a list of macros of the form: name +# or name=definition (no spaces). If the definition and the = are +# omitted =1 is assumed. To prevent a macro definition from being +# undefined via #undef or recursively expanded use the := operator +# instead of the = operator. + +PREDEFINED = + +# If the MACRO_EXPANSION and EXPAND_ONLY_PREDEF tags are set to YES then +# this tag can be used to specify a list of macro names that should be expanded. +# The macro definition that is found in the sources will be used. +# Use the PREDEFINED tag if you want to use a different macro definition. + +EXPAND_AS_DEFINED = + +# If the SKIP_FUNCTION_MACROS tag is set to YES (the default) then +# doxygen's preprocessor will remove all function-like macros that are alone +# on a line, have an all uppercase name, and do not end with a semicolon. Such +# function macros are typically used for boiler-plate code, and will confuse +# the parser if not removed. + +SKIP_FUNCTION_MACROS = YES + +#--------------------------------------------------------------------------- +# Configuration::additions related to external references +#--------------------------------------------------------------------------- + +# The TAGFILES option can be used to specify one or more tagfiles. +# Optionally an initial location of the external documentation +# can be added for each tagfile. The format of a tag file without +# this location is as follows: +# TAGFILES = file1 file2 ... +# Adding location for the tag files is done as follows: +# TAGFILES = file1=loc1 "file2 = loc2" ... +# where "loc1" and "loc2" can be relative or absolute paths or +# URLs. If a location is present for each tag, the installdox tool +# does not have to be run to correct the links. +# Note that each tag file must have a unique name +# (where the name does NOT include the path) +# If a tag file is not located in the directory in which doxygen +# is run, you must also specify the path to the tagfile here. + +TAGFILES = + +# When a file name is specified after GENERATE_TAGFILE, doxygen will create +# a tag file that is based on the input files it reads. + +GENERATE_TAGFILE = + +# If the ALLEXTERNALS tag is set to YES all external classes will be listed +# in the class index. If set to NO only the inherited external classes +# will be listed. + +ALLEXTERNALS = NO + +# If the EXTERNAL_GROUPS tag is set to YES all external groups will be listed +# in the modules index. If set to NO, only the current project's groups will +# be listed. + +EXTERNAL_GROUPS = YES + +# The PERL_PATH should be the absolute path and name of the perl script +# interpreter (i.e. the result of `which perl'). + +PERL_PATH = /usr/bin/perl + +#--------------------------------------------------------------------------- +# Configuration options related to the dot tool +#--------------------------------------------------------------------------- + +# If the CLASS_DIAGRAMS tag is set to YES (the default) Doxygen will +# generate a inheritance diagram (in HTML, RTF and LaTeX) for classes with base +# or super classes. Setting the tag to NO turns the diagrams off. Note that +# this option is superseded by the HAVE_DOT option below. This is only a +# fallback. It is recommended to install and use dot, since it yields more +# powerful graphs. + +CLASS_DIAGRAMS = YES + +# You can define message sequence charts within doxygen comments using the \msc +# command. Doxygen will then run the mscgen tool (see +# http://www.mcternan.me.uk/mscgen/) to produce the chart and insert it in the +# documentation. The MSCGEN_PATH tag allows you to specify the directory where +# the mscgen tool resides. If left empty the tool is assumed to be found in the +# default search path. + +MSCGEN_PATH = + +# If set to YES, the inheritance and collaboration graphs will hide +# inheritance and usage relations if the target is undocumented +# or is not a class. + +HIDE_UNDOC_RELATIONS = NO + +# If you set the HAVE_DOT tag to YES then doxygen will assume the dot tool is +# available from the path. This tool is part of Graphviz, a graph visualization +# toolkit from AT&T and Lucent Bell Labs. The other options in this section +# have no effect if this option is set to NO (the default) + +HAVE_DOT = YES + +# If the CLASS_GRAPH and HAVE_DOT tags are set to YES then doxygen +# will generate a graph for each documented class showing the direct and +# indirect inheritance relations. Setting this tag to YES will force the +# the CLASS_DIAGRAMS tag to NO. + +CLASS_GRAPH = YES + +# If the COLLABORATION_GRAPH and HAVE_DOT tags are set to YES then doxygen +# will generate a graph for each documented class showing the direct and +# indirect implementation dependencies (inheritance, containment, and +# class references variables) of the class with other documented classes. + +COLLABORATION_GRAPH = YES + +# If the GROUP_GRAPHS and HAVE_DOT tags are set to YES then doxygen +# will generate a graph for groups, showing the direct groups dependencies + +GROUP_GRAPHS = YES + +# If the UML_LOOK tag is set to YES doxygen will generate inheritance and +# collaboration diagrams in a style similar to the OMG's Unified Modeling +# Language. + +UML_LOOK = YES + +# If set to YES, the inheritance and collaboration graphs will show the +# relations between templates and their instances. + +TEMPLATE_RELATIONS = YES + +# If the ENABLE_PREPROCESSING, SEARCH_INCLUDES, INCLUDE_GRAPH, and HAVE_DOT +# tags are set to YES then doxygen will generate a graph for each documented +# file showing the direct and indirect include dependencies of the file with +# other documented files. + +INCLUDE_GRAPH = YES + +# If the ENABLE_PREPROCESSING, SEARCH_INCLUDES, INCLUDED_BY_GRAPH, and +# HAVE_DOT tags are set to YES then doxygen will generate a graph for each +# documented header file showing the documented files that directly or +# indirectly include this file. + +INCLUDED_BY_GRAPH = YES + +# If the CALL_GRAPH and HAVE_DOT options are set to YES then +# doxygen will generate a call dependency graph for every global function +# or class method. Note that enabling this option will significantly increase +# the time of a run. So in most cases it will be better to enable call graphs +# for selected functions only using the \callgraph command. + +CALL_GRAPH = YES + +# If the CALLER_GRAPH and HAVE_DOT tags are set to YES then +# doxygen will generate a caller dependency graph for every global function +# or class method. Note that enabling this option will significantly increase +# the time of a run. So in most cases it will be better to enable caller +# graphs for selected functions only using the \callergraph command. + +CALLER_GRAPH = NO + +# If the GRAPHICAL_HIERARCHY and HAVE_DOT tags are set to YES then doxygen +# will graphical hierarchy of all classes instead of a textual one. + +GRAPHICAL_HIERARCHY = YES + +# If the DIRECTORY_GRAPH, SHOW_DIRECTORIES and HAVE_DOT tags are set to YES +# then doxygen will show the dependencies a directory has on other directories +# in a graphical way. The dependency relations are determined by the #include +# relations between the files in the directories. + +DIRECTORY_GRAPH = YES + +# The DOT_IMAGE_FORMAT tag can be used to set the image format of the images +# generated by dot. Possible values are png, jpg, or gif +# If left blank png will be used. + +DOT_IMAGE_FORMAT = png + +# The tag DOT_PATH can be used to specify the path where the dot tool can be +# found. If left blank, it is assumed the dot tool can be found in the path. + +DOT_PATH = + +# The DOTFILE_DIRS tag can be used to specify one or more directories that +# contain dot files that are included in the documentation (see the +# \dotfile command). + +DOTFILE_DIRS = + +# The MAX_DOT_GRAPH_MAX_NODES tag can be used to set the maximum number of +# nodes that will be shown in the graph. If the number of nodes in a graph +# becomes larger than this value, doxygen will truncate the graph, which is +# visualized by representing a node as a red box. Note that doxygen if the +# number of direct children of the root node in a graph is already larger than +# DOT_GRAPH_MAX_NODES then the graph will not be shown at all. Also note +# that the size of a graph can be further restricted by MAX_DOT_GRAPH_DEPTH. + +DOT_GRAPH_MAX_NODES = 50 + +# The MAX_DOT_GRAPH_DEPTH tag can be used to set the maximum depth of the +# graphs generated by dot. A depth value of 3 means that only nodes reachable +# from the root by following a path via at most 3 edges will be shown. Nodes +# that lay further from the root node will be omitted. Note that setting this +# option to 1 or 2 may greatly reduce the computation time needed for large +# code bases. Also note that the size of a graph can be further restricted by +# DOT_GRAPH_MAX_NODES. Using a depth of 0 means no depth restriction. + +MAX_DOT_GRAPH_DEPTH = 0 + +# Set the DOT_TRANSPARENT tag to YES to generate images with a transparent +# background. This is enabled by default, which results in a transparent +# background. Warning: Depending on the platform used, enabling this option +# may lead to badly anti-aliased labels on the edges of a graph (i.e. they +# become hard to read). + +DOT_TRANSPARENT = YES + +# Set the DOT_MULTI_TARGETS tag to YES allow dot to generate multiple output +# files in one run (i.e. multiple -o and -T options on the command line). This +# makes dot run faster, but since only newer versions of dot (>1.8.10) +# support this, this feature is disabled by default. + +DOT_MULTI_TARGETS = NO + +# If the GENERATE_LEGEND tag is set to YES (the default) Doxygen will +# generate a legend page explaining the meaning of the various boxes and +# arrows in the dot generated graphs. + +GENERATE_LEGEND = YES + +# If the DOT_CLEANUP tag is set to YES (the default) Doxygen will +# remove the intermediate dot files that are used to generate +# the various graphs. + +DOT_CLEANUP = YES + +#--------------------------------------------------------------------------- +# Configuration::additions related to the search engine +#--------------------------------------------------------------------------- + +# The SEARCHENGINE tag specifies whether or not a search engine should be +# used. If set to NO the values of all tags below this one will be ignored. + +SEARCHENGINE = NO diff -Nru libdap-3.11.1/escaping.cc libdap-3.12.0/escaping.cc --- libdap-3.11.1/escaping.cc 2011-04-29 13:19:43.000000000 +0000 +++ libdap-3.12.0/escaping.cc 2013-10-17 21:27:40.000000000 +0000 @@ -19,7 +19,7 @@ // // You should have received a copy of the GNU Lesser General Public // License along with this library; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA // // You can contact OPeNDAP, Inc. at PO Box 112, Saunderstown, RI. 02874-0112. diff -Nru libdap-3.11.1/escaping.h libdap-3.12.0/escaping.h --- libdap-3.11.1/escaping.h 2011-04-29 13:19:42.000000000 +0000 +++ libdap-3.12.0/escaping.h 2013-10-17 21:27:40.000000000 +0000 @@ -19,7 +19,7 @@ // // You should have received a copy of the GNU Lesser General Public // License along with this library; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA // // You can contact OPeNDAP, Inc. at PO Box 112, Saunderstown, RI. 02874-0112. diff -Nru libdap-3.11.1/expr.h libdap-3.12.0/expr.h --- libdap-3.11.1/expr.h 2011-04-29 13:19:43.000000000 +0000 +++ libdap-3.12.0/expr.h 2013-10-17 21:27:40.000000000 +0000 @@ -19,7 +19,7 @@ // // You should have received a copy of the GNU Lesser General Public // License along with this library; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA // // You can contact OPeNDAP, Inc. at PO Box 112, Saunderstown, RI. 02874-0112. @@ -62,11 +62,10 @@ // Syntactic sugar for `pointer to function returning boolean' (bool_func) // and `pointer to function returning BaseType *' (btp_func). Both function -// types take three arguments, an integer (argc), a vector of BaseType *s -// (argv) and the DDS for the dataset for which these function is being -// evaluated (analogous to the ENVP in UNIX). ARGC is the length of ARGV. - -// These two types of functions now take four args - the DDS was added. +// types take four arguments, an integer (argc), a vector of BaseType *s +// (argv), the DDS for the dataset for which these function is being +// evaluated (analogous to the ENVP in UNIX) and a pointer for the function's +// return value. ARGC is the length of ARGV. /** @todo A better design would wrap these in a class and record at minimum their names so that error messages could be a bit more informative. jhrg @@ -84,6 +83,10 @@ // INT_LIST and INT_LIST_LIST are used by the parser to store the array // indexes. +// To add the new feature of 'to the end' in an array projection (denoted using +// start), I used the value -1 for an index. This makes do difference here. jhrg +// 12/20/12 + typedef std::vector int_list; typedef std::vector::const_iterator int_citer ; typedef std::vector::iterator int_iter ; diff -Nru libdap-3.11.1/getdap.cc libdap-3.12.0/getdap.cc --- libdap-3.11.1/getdap.cc 2011-04-29 13:19:43.000000000 +0000 +++ libdap-3.12.0/getdap.cc 2013-10-17 21:27:40.000000000 +0000 @@ -19,7 +19,7 @@ // // You should have received a copy of the GNU Lesser General Public // License along with this library; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA // // You can contact OPeNDAP, Inc. at PO Box 112, Saunderstown, RI. 02874-0112. @@ -35,10 +35,6 @@ #include "config.h" -static char rcsid[] not_used = - { "$Id: getdap.cc 21695 2009-11-04 17:45:04Z jimg $" - }; - #ifdef WIN32 #include #include diff -Nru libdap-3.11.1/getdap.man1 libdap-3.12.0/getdap.man1 --- libdap-3.11.1/getdap.man1 1970-01-01 00:00:00.000000000 +0000 +++ libdap-3.12.0/getdap.man1 2013-10-17 21:27:40.000000000 +0000 @@ -0,0 +1,107 @@ +.\" getdap.man +.\" +.\" Created on: Dec 29, 2011 +.\" Author: jimg +.\" +.\" Process this file with +.\" groff -man -Tascii getdap.1 +.\" +.TH GETDAP 1 "December 2011" Linux "User Manuals" +.SH NAME +getdap \- test driver for the libdap library +.SH SYNOPSIS +.B getdap [-idaDxXBvVkzsM] [-c +.I expr +.B ] [-m +.I num +.B ] [-p +.I x.y +.B ] +.I url +.B ... + +.B getdap [-VvksM] +.I file +.B ... +.SH DESCRIPTION +.B getdap +In the first form of the command, dereference the URL and +perform the requested operations. This includes routing +the returned information through the DAP processing +library (parsing the returned objects, et c.). If none +of a, d, or D are used with a URL, then the DAP library +routines are NOT used and the URLs contents are dumped +to standard output. + +In the second form of the command, assume the files are +DataDDS objects (stored in files or read from pipes) +and process them as if -D were given. In this case the +information *must* contain valid MIME header in order +to be processed. +.SH OPTIONS +.IP -i +For each URL, get the server version. +.IP -d +For each URL, get the the DDS. +.IP -a +For each URL, get the the DAS. +.IP -D +For each URL, get the the DataDDS. +.IP -x +For each URL, get the DDX object. Does not get data. +.IP -X +Request a DataDDX from the server (the DAP4 data response). +.IP -B +Build a DDX in getdap using the DDS and DAS. +.IP -v +Verbose output. +.IP -V +Version of this client; see 'i' for server version. +.IP "-c expr" +.I expr +is a constraint expression. Used with -D/X. +You can use a `?' for the CE also. +.IP -k +Keep temporary files created by libdap. +.IP "-m num" +Request the same URL +.I num +times +.IP -z +Ask the server to compress data. +.IP -s +Print Sequences using numbered rows. +.IP -M +Assume data read from a file has no MIME headers +(the default is to assume the headers are present). +.IP "-p x.y" +Set DAP protocol to +.I x.y +. +.SH FILES +.I ~/.dodsrc +.RS +The +.I .dodsrc +file contains various parameters that affect the runtime behavior for DAP clients. +See +.BR dodsrc (5) +for further details. +.RE +.SH ENVIRONMENT +.IP DODS_CONF +Specifies an alternate file or directory for the +.I .dodsrc +file. +.SH DIAGNOSTICS +Various self-explanitory messages may be issued on stderr. + +.SH BUGS +The command name should have been chosen more carefully +to reflect its purpose. + +The dodsrc man page needs to be written. +.SH AUTHOR +James Gallagher +.SH "SEE ALSO" +.BR dodsrc (5) diff -Nru libdap-3.11.1/gl/Makefile.am libdap-3.12.0/gl/Makefile.am --- libdap-3.11.1/gl/Makefile.am 2011-04-29 13:19:36.000000000 +0000 +++ libdap-3.12.0/gl/Makefile.am 2013-10-17 21:27:40.000000000 +0000 @@ -1,15 +1,27 @@ ## DO NOT EDIT! GENERATED AUTOMATICALLY! ## Process this file with automake to produce Makefile.in. -# Copyright (C) 2002-2011 Free Software Foundation, Inc. +# Copyright (C) 2002-2012 Free Software Foundation, Inc. # -# This file is free software, distributed under the terms of the GNU -# General Public License. As a special exception to the GNU General -# Public License, this file may be distributed as part of a program -# that contains a configuration script generated by Autoconf, under +# 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 3 of the License, or +# (at your option) any later version. +# +# This file 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 file. If not, see . +# +# As a special exception to the GNU General Public License, +# this file may be distributed as part of a program that +# contains a configuration script generated by Autoconf, under # the same distribution terms as the rest of that program. # # Generated by gnulib-tool. -# Reproduce by: gnulib-tool --import --dir=. --lib=libgnu --source-base=gl --m4-base=gl/m4 --doc-base=gl/doc --tests-base=tests --aux-dir=conf --lgpl --libtool --macro-prefix=gl regex +# Reproduce by: gnulib-tool --import --dir=. --lib=libgnu --source-base=gl --m4-base=gl/m4 --doc-base=gl/doc --tests-base=tests --aux-dir=conf --lgpl --no-conditional-dependencies --libtool --macro-prefix=gl byteswap regex AUTOMAKE_OPTIONS = 1.5 gnits @@ -46,42 +58,23 @@ # We need the following in order to create when the system # doesn't have one that works with the given compiler. -alloca.h: alloca.in.h +if GL_GENERATE_ALLOCA_H +alloca.h: alloca.in.h $(top_builddir)/config.status $(AM_V_GEN)rm -f $@-t $@ && \ { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \ cat $(srcdir)/alloca.in.h; \ } > $@-t && \ mv -f $@-t $@ +else +alloca.h: $(top_builddir)/config.status + rm -f $@ +endif MOSTLYCLEANFILES += alloca.h alloca.h-t EXTRA_DIST += alloca.in.h ## end gnulib module alloca-opt -## begin gnulib module arg-nonnull - -# The BUILT_SOURCES created by this Makefile snippet are not used via #include -# statements but through direct file reference. Therefore this snippet must be -# present in all Makefile.am that need it. This is ensured by the applicability -# 'all' defined above. - -BUILT_SOURCES += arg-nonnull.h -# The arg-nonnull.h that gets inserted into generated .h files is the same as -# build-aux/arg-nonnull.h, except that it has the copyright header cut off. -arg-nonnull.h: $(top_srcdir)/conf/arg-nonnull.h - $(AM_V_GEN)rm -f $@-t $@ && \ - sed -n -e '/GL_ARG_NONNULL/,$$p' \ - < $(top_srcdir)/conf/arg-nonnull.h \ - > $@-t && \ - mv $@-t $@ -MOSTLYCLEANFILES += arg-nonnull.h arg-nonnull.h-t - -ARG_NONNULL_H=arg-nonnull.h - -EXTRA_DIST += $(top_srcdir)/conf/arg-nonnull.h - -## end gnulib module arg-nonnull - ## begin gnulib module btowc @@ -91,29 +84,28 @@ ## end gnulib module btowc -## begin gnulib module c++defs +## begin gnulib module byteswap -# The BUILT_SOURCES created by this Makefile snippet are not used via #include -# statements but through direct file reference. Therefore this snippet must be -# present in all Makefile.am that need it. This is ensured by the applicability -# 'all' defined above. +BUILT_SOURCES += $(BYTESWAP_H) -BUILT_SOURCES += c++defs.h -# The c++defs.h that gets inserted into generated .h files is the same as -# build-aux/c++defs.h, except that it has the copyright header cut off. -c++defs.h: $(top_srcdir)/conf/c++defs.h +# We need the following in order to create when the system +# doesn't have one. +if GL_GENERATE_BYTESWAP_H +byteswap.h: byteswap.in.h $(top_builddir)/config.status $(AM_V_GEN)rm -f $@-t $@ && \ - sed -n -e '/_GL_CXXDEFS/,$$p' \ - < $(top_srcdir)/conf/c++defs.h \ - > $@-t && \ - mv $@-t $@ -MOSTLYCLEANFILES += c++defs.h c++defs.h-t - -CXXDEFS_H=c++defs.h + { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \ + cat $(srcdir)/byteswap.in.h; \ + } > $@-t && \ + mv -f $@-t $@ +else +byteswap.h: $(top_builddir)/config.status + rm -f $@ +endif +MOSTLYCLEANFILES += byteswap.h byteswap.h-t -EXTRA_DIST += $(top_srcdir)/conf/c++defs.h +EXTRA_DIST += byteswap.in.h -## end gnulib module c++defs +## end gnulib module byteswap ## begin gnulib module configmake @@ -152,11 +144,7 @@ echo '#define PKGLIBDIR "$(pkglibdir)"'; \ echo '#define PKGLIBEXECDIR "$(pkglibexecdir)"'; \ } | sed '/""/d' > $@-t && \ - if test -f $@ && cmp $@-t $@ > /dev/null; then \ - rm -f $@-t; \ - else \ - rm -f $@; mv $@-t $@; \ - fi + mv -f $@-t $@ BUILT_SOURCES += configmake.h CLEANFILES += configmake.h configmake.h-t @@ -175,15 +163,16 @@ # We need the following in order to create an empty placeholder for # when the system doesn't have one. -langinfo.h: langinfo.in.h $(CXXDEFS_H) $(WARN_ON_USE_H) +langinfo.h: langinfo.in.h $(top_builddir)/config.status $(CXXDEFS_H) $(WARN_ON_USE_H) $(AM_V_GEN)rm -f $@-t $@ && \ { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \ - sed -e 's|@''HAVE_LANGINFO_H''@|$(HAVE_LANGINFO_H)|g' \ + sed -e 's|@''GUARD_PREFIX''@|GL|g' \ + -e 's|@''HAVE_LANGINFO_H''@|$(HAVE_LANGINFO_H)|g' \ -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \ -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \ -e 's|@''PRAGMA_COLUMNS''@|@PRAGMA_COLUMNS@|g' \ -e 's|@''NEXT_LANGINFO_H''@|$(NEXT_LANGINFO_H)|g' \ - -e 's|@''GNULIB_NL_LANGINFO''@|$(GNULIB_NL_LANGINFO)|g' \ + -e 's/@''GNULIB_NL_LANGINFO''@/$(GNULIB_NL_LANGINFO)/g' \ -e 's|@''HAVE_LANGINFO_CODESET''@|$(HAVE_LANGINFO_CODESET)|g' \ -e 's|@''HAVE_LANGINFO_T_FMT_AMPM''@|$(HAVE_LANGINFO_T_FMT_AMPM)|g' \ -e 's|@''HAVE_LANGINFO_ERA''@|$(HAVE_LANGINFO_ERA)|g' \ @@ -275,6 +264,50 @@ ## end gnulib module localcharset +## begin gnulib module locale + +BUILT_SOURCES += locale.h + +# We need the following in order to create when the system +# doesn't have one that provides all definitions. +locale.h: locale.in.h $(top_builddir)/config.status $(CXXDEFS_H) $(ARG_NONNULL_H) $(WARN_ON_USE_H) + $(AM_V_GEN)rm -f $@-t $@ && \ + { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */' && \ + sed -e 's|@''GUARD_PREFIX''@|GL|g' \ + -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \ + -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \ + -e 's|@''PRAGMA_COLUMNS''@|@PRAGMA_COLUMNS@|g' \ + -e 's|@''NEXT_LOCALE_H''@|$(NEXT_LOCALE_H)|g' \ + -e 's/@''GNULIB_LOCALECONV''@/$(GNULIB_LOCALECONV)/g' \ + -e 's/@''GNULIB_SETLOCALE''@/$(GNULIB_SETLOCALE)/g' \ + -e 's/@''GNULIB_DUPLOCALE''@/$(GNULIB_DUPLOCALE)/g' \ + -e 's|@''HAVE_DUPLOCALE''@|$(HAVE_DUPLOCALE)|g' \ + -e 's|@''HAVE_XLOCALE_H''@|$(HAVE_XLOCALE_H)|g' \ + -e 's|@''REPLACE_LOCALECONV''@|$(REPLACE_LOCALECONV)|g' \ + -e 's|@''REPLACE_SETLOCALE''@|$(REPLACE_SETLOCALE)|g' \ + -e 's|@''REPLACE_DUPLOCALE''@|$(REPLACE_DUPLOCALE)|g' \ + -e 's|@''REPLACE_STRUCT_LCONV''@|$(REPLACE_STRUCT_LCONV)|g' \ + -e '/definitions of _GL_FUNCDECL_RPL/r $(CXXDEFS_H)' \ + -e '/definition of _GL_ARG_NONNULL/r $(ARG_NONNULL_H)' \ + -e '/definition of _GL_WARN_ON_USE/r $(WARN_ON_USE_H)' \ + < $(srcdir)/locale.in.h; \ + } > $@-t && \ + mv $@-t $@ +MOSTLYCLEANFILES += locale.h locale.h-t + +EXTRA_DIST += locale.in.h + +## end gnulib module locale + +## begin gnulib module localeconv + + +EXTRA_DIST += localeconv.c + +EXTRA_libgnu_la_SOURCES += localeconv.c + +## end gnulib module localeconv + ## begin gnulib module malloc-gnu @@ -311,6 +344,15 @@ ## end gnulib module mbsinit +## begin gnulib module mbtowc + + +EXTRA_DIST += mbtowc-impl.h mbtowc.c + +EXTRA_libgnu_la_SOURCES += mbtowc.c + +## end gnulib module mbtowc + ## begin gnulib module nl_langinfo @@ -329,18 +371,104 @@ ## end gnulib module regex +## begin gnulib module snippet/_Noreturn + +# Because this Makefile snippet defines a variable used by other +# gnulib Makefile snippets, it must be present in all Makefile.am that +# need it. This is ensured by the applicability 'all' defined above. + +_NORETURN_H=$(top_srcdir)/conf/snippet/_Noreturn.h + +EXTRA_DIST += $(top_srcdir)/conf/snippet/_Noreturn.h + +## end gnulib module snippet/_Noreturn + +## begin gnulib module snippet/arg-nonnull + +# The BUILT_SOURCES created by this Makefile snippet are not used via #include +# statements but through direct file reference. Therefore this snippet must be +# present in all Makefile.am that need it. This is ensured by the applicability +# 'all' defined above. + +BUILT_SOURCES += arg-nonnull.h +# The arg-nonnull.h that gets inserted into generated .h files is the same as +# build-aux/snippet/arg-nonnull.h, except that it has the copyright header cut +# off. +arg-nonnull.h: $(top_srcdir)/conf/snippet/arg-nonnull.h + $(AM_V_GEN)rm -f $@-t $@ && \ + sed -n -e '/GL_ARG_NONNULL/,$$p' \ + < $(top_srcdir)/conf/snippet/arg-nonnull.h \ + > $@-t && \ + mv $@-t $@ +MOSTLYCLEANFILES += arg-nonnull.h arg-nonnull.h-t + +ARG_NONNULL_H=arg-nonnull.h + +EXTRA_DIST += $(top_srcdir)/conf/snippet/arg-nonnull.h + +## end gnulib module snippet/arg-nonnull + +## begin gnulib module snippet/c++defs + +# The BUILT_SOURCES created by this Makefile snippet are not used via #include +# statements but through direct file reference. Therefore this snippet must be +# present in all Makefile.am that need it. This is ensured by the applicability +# 'all' defined above. + +BUILT_SOURCES += c++defs.h +# The c++defs.h that gets inserted into generated .h files is the same as +# build-aux/snippet/c++defs.h, except that it has the copyright header cut off. +c++defs.h: $(top_srcdir)/conf/snippet/c++defs.h + $(AM_V_GEN)rm -f $@-t $@ && \ + sed -n -e '/_GL_CXXDEFS/,$$p' \ + < $(top_srcdir)/conf/snippet/c++defs.h \ + > $@-t && \ + mv $@-t $@ +MOSTLYCLEANFILES += c++defs.h c++defs.h-t + +CXXDEFS_H=c++defs.h + +EXTRA_DIST += $(top_srcdir)/conf/snippet/c++defs.h + +## end gnulib module snippet/c++defs + +## begin gnulib module snippet/warn-on-use + +BUILT_SOURCES += warn-on-use.h +# The warn-on-use.h that gets inserted into generated .h files is the same as +# build-aux/snippet/warn-on-use.h, except that it has the copyright header cut +# off. +warn-on-use.h: $(top_srcdir)/conf/snippet/warn-on-use.h + $(AM_V_GEN)rm -f $@-t $@ && \ + sed -n -e '/^.ifndef/,$$p' \ + < $(top_srcdir)/conf/snippet/warn-on-use.h \ + > $@-t && \ + mv $@-t $@ +MOSTLYCLEANFILES += warn-on-use.h warn-on-use.h-t + +WARN_ON_USE_H=warn-on-use.h + +EXTRA_DIST += $(top_srcdir)/conf/snippet/warn-on-use.h + +## end gnulib module snippet/warn-on-use + ## begin gnulib module stdbool BUILT_SOURCES += $(STDBOOL_H) # We need the following in order to create when the system # doesn't have one that works. -stdbool.h: stdbool.in.h +if GL_GENERATE_STDBOOL_H +stdbool.h: stdbool.in.h $(top_builddir)/config.status $(AM_V_GEN)rm -f $@-t $@ && \ { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \ sed -e 's/@''HAVE__BOOL''@/$(HAVE__BOOL)/g' < $(srcdir)/stdbool.in.h; \ } > $@-t && \ mv $@-t $@ +else +stdbool.h: $(top_builddir)/config.status + rm -f $@ +endif MOSTLYCLEANFILES += stdbool.h stdbool.h-t EXTRA_DIST += stdbool.in.h @@ -353,10 +481,12 @@ # We need the following in order to create when the system # doesn't have one that works with the given compiler. -stddef.h: stddef.in.h +if GL_GENERATE_STDDEF_H +stddef.h: stddef.in.h $(top_builddir)/config.status $(AM_V_GEN)rm -f $@-t $@ && \ { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */' && \ - sed -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \ + sed -e 's|@''GUARD_PREFIX''@|GL|g' \ + -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \ -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \ -e 's|@''PRAGMA_COLUMNS''@|@PRAGMA_COLUMNS@|g' \ -e 's|@''NEXT_STDDEF_H''@|$(NEXT_STDDEF_H)|g' \ @@ -365,6 +495,10 @@ < $(srcdir)/stddef.in.h; \ } > $@-t && \ mv $@-t $@ +else +stddef.h: $(top_builddir)/config.status + rm -f $@ +endif MOSTLYCLEANFILES += stddef.h stddef.h-t EXTRA_DIST += stddef.in.h @@ -377,10 +511,12 @@ # We need the following in order to create when the system # doesn't have one that works with the given compiler. -stdint.h: stdint.in.h +if GL_GENERATE_STDINT_H +stdint.h: stdint.in.h $(top_builddir)/config.status $(AM_V_GEN)rm -f $@-t $@ && \ { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \ - sed -e 's/@''HAVE_STDINT_H''@/$(HAVE_STDINT_H)/g' \ + sed -e 's|@''GUARD_PREFIX''@|GL|g' \ + -e 's/@''HAVE_STDINT_H''@/$(HAVE_STDINT_H)/g' \ -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \ -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \ -e 's|@''PRAGMA_COLUMNS''@|@PRAGMA_COLUMNS@|g' \ @@ -389,6 +525,7 @@ -e 's/@''HAVE_INTTYPES_H''@/$(HAVE_INTTYPES_H)/g' \ -e 's/@''HAVE_SYS_INTTYPES_H''@/$(HAVE_SYS_INTTYPES_H)/g' \ -e 's/@''HAVE_SYS_BITYPES_H''@/$(HAVE_SYS_BITYPES_H)/g' \ + -e 's/@''HAVE_WCHAR_H''@/$(HAVE_WCHAR_H)/g' \ -e 's/@''HAVE_LONG_LONG_INT''@/$(HAVE_LONG_LONG_INT)/g' \ -e 's/@''HAVE_UNSIGNED_LONG_LONG_INT''@/$(HAVE_UNSIGNED_LONG_LONG_INT)/g' \ -e 's/@''APPLE_UNIVERSAL_BUILD''@/$(APPLE_UNIVERSAL_BUILD)/g' \ @@ -408,6 +545,10 @@ < $(srcdir)/stdint.in.h; \ } > $@-t && \ mv $@-t $@ +else +stdint.h: $(top_builddir)/config.status + rm -f $@ +endif MOSTLYCLEANFILES += stdint.h stdint.h-t EXTRA_DIST += stdint.in.h @@ -420,40 +561,48 @@ # We need the following in order to create when the system # doesn't have one that works with the given compiler. -stdlib.h: stdlib.in.h $(CXXDEFS_H) $(ARG_NONNULL_H) $(WARN_ON_USE_H) +stdlib.h: stdlib.in.h $(top_builddir)/config.status $(CXXDEFS_H) \ + $(_NORETURN_H) $(ARG_NONNULL_H) $(WARN_ON_USE_H) $(AM_V_GEN)rm -f $@-t $@ && \ { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */' && \ - sed -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \ + sed -e 's|@''GUARD_PREFIX''@|GL|g' \ + -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \ -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \ -e 's|@''PRAGMA_COLUMNS''@|@PRAGMA_COLUMNS@|g' \ -e 's|@''NEXT_STDLIB_H''@|$(NEXT_STDLIB_H)|g' \ - -e 's|@''GNULIB__EXIT''@|$(GNULIB__EXIT)|g' \ - -e 's|@''GNULIB_ATOLL''@|$(GNULIB_ATOLL)|g' \ - -e 's|@''GNULIB_CALLOC_POSIX''@|$(GNULIB_CALLOC_POSIX)|g' \ - -e 's|@''GNULIB_CANONICALIZE_FILE_NAME''@|$(GNULIB_CANONICALIZE_FILE_NAME)|g' \ - -e 's|@''GNULIB_GETLOADAVG''@|$(GNULIB_GETLOADAVG)|g' \ - -e 's|@''GNULIB_GETSUBOPT''@|$(GNULIB_GETSUBOPT)|g' \ - -e 's|@''GNULIB_GRANTPT''@|$(GNULIB_GRANTPT)|g' \ - -e 's|@''GNULIB_MALLOC_POSIX''@|$(GNULIB_MALLOC_POSIX)|g' \ - -e 's|@''GNULIB_MKDTEMP''@|$(GNULIB_MKDTEMP)|g' \ - -e 's|@''GNULIB_MKOSTEMP''@|$(GNULIB_MKOSTEMP)|g' \ - -e 's|@''GNULIB_MKOSTEMPS''@|$(GNULIB_MKOSTEMPS)|g' \ - -e 's|@''GNULIB_MKSTEMP''@|$(GNULIB_MKSTEMP)|g' \ - -e 's|@''GNULIB_MKSTEMPS''@|$(GNULIB_MKSTEMPS)|g' \ - -e 's|@''GNULIB_PTSNAME''@|$(GNULIB_PTSNAME)|g' \ - -e 's|@''GNULIB_PUTENV''@|$(GNULIB_PUTENV)|g' \ - -e 's|@''GNULIB_RANDOM_R''@|$(GNULIB_RANDOM_R)|g' \ - -e 's|@''GNULIB_REALLOC_POSIX''@|$(GNULIB_REALLOC_POSIX)|g' \ - -e 's|@''GNULIB_REALPATH''@|$(GNULIB_REALPATH)|g' \ - -e 's|@''GNULIB_RPMATCH''@|$(GNULIB_RPMATCH)|g' \ - -e 's|@''GNULIB_SETENV''@|$(GNULIB_SETENV)|g' \ - -e 's|@''GNULIB_STRTOD''@|$(GNULIB_STRTOD)|g' \ - -e 's|@''GNULIB_STRTOLL''@|$(GNULIB_STRTOLL)|g' \ - -e 's|@''GNULIB_STRTOULL''@|$(GNULIB_STRTOULL)|g' \ - -e 's|@''GNULIB_SYSTEM_POSIX''@|$(GNULIB_SYSTEM_POSIX)|g' \ - -e 's|@''GNULIB_UNLOCKPT''@|$(GNULIB_UNLOCKPT)|g' \ - -e 's|@''GNULIB_UNSETENV''@|$(GNULIB_UNSETENV)|g' \ - -e 's|@''HAVE__EXIT''@|$(HAVE__EXIT)|g' \ + -e 's/@''GNULIB__EXIT''@/$(GNULIB__EXIT)/g' \ + -e 's/@''GNULIB_ATOLL''@/$(GNULIB_ATOLL)/g' \ + -e 's/@''GNULIB_CALLOC_POSIX''@/$(GNULIB_CALLOC_POSIX)/g' \ + -e 's/@''GNULIB_CANONICALIZE_FILE_NAME''@/$(GNULIB_CANONICALIZE_FILE_NAME)/g' \ + -e 's/@''GNULIB_GETLOADAVG''@/$(GNULIB_GETLOADAVG)/g' \ + -e 's/@''GNULIB_GETSUBOPT''@/$(GNULIB_GETSUBOPT)/g' \ + -e 's/@''GNULIB_GRANTPT''@/$(GNULIB_GRANTPT)/g' \ + -e 's/@''GNULIB_MALLOC_POSIX''@/$(GNULIB_MALLOC_POSIX)/g' \ + -e 's/@''GNULIB_MBTOWC''@/$(GNULIB_MBTOWC)/g' \ + -e 's/@''GNULIB_MKDTEMP''@/$(GNULIB_MKDTEMP)/g' \ + -e 's/@''GNULIB_MKOSTEMP''@/$(GNULIB_MKOSTEMP)/g' \ + -e 's/@''GNULIB_MKOSTEMPS''@/$(GNULIB_MKOSTEMPS)/g' \ + -e 's/@''GNULIB_MKSTEMP''@/$(GNULIB_MKSTEMP)/g' \ + -e 's/@''GNULIB_MKSTEMPS''@/$(GNULIB_MKSTEMPS)/g' \ + -e 's/@''GNULIB_POSIX_OPENPT''@/$(GNULIB_POSIX_OPENPT)/g' \ + -e 's/@''GNULIB_PTSNAME''@/$(GNULIB_PTSNAME)/g' \ + -e 's/@''GNULIB_PTSNAME_R''@/$(GNULIB_PTSNAME_R)/g' \ + -e 's/@''GNULIB_PUTENV''@/$(GNULIB_PUTENV)/g' \ + -e 's/@''GNULIB_RANDOM''@/$(GNULIB_RANDOM)/g' \ + -e 's/@''GNULIB_RANDOM_R''@/$(GNULIB_RANDOM_R)/g' \ + -e 's/@''GNULIB_REALLOC_POSIX''@/$(GNULIB_REALLOC_POSIX)/g' \ + -e 's/@''GNULIB_REALPATH''@/$(GNULIB_REALPATH)/g' \ + -e 's/@''GNULIB_RPMATCH''@/$(GNULIB_RPMATCH)/g' \ + -e 's/@''GNULIB_SETENV''@/$(GNULIB_SETENV)/g' \ + -e 's/@''GNULIB_STRTOD''@/$(GNULIB_STRTOD)/g' \ + -e 's/@''GNULIB_STRTOLL''@/$(GNULIB_STRTOLL)/g' \ + -e 's/@''GNULIB_STRTOULL''@/$(GNULIB_STRTOULL)/g' \ + -e 's/@''GNULIB_SYSTEM_POSIX''@/$(GNULIB_SYSTEM_POSIX)/g' \ + -e 's/@''GNULIB_UNLOCKPT''@/$(GNULIB_UNLOCKPT)/g' \ + -e 's/@''GNULIB_UNSETENV''@/$(GNULIB_UNSETENV)/g' \ + -e 's/@''GNULIB_WCTOMB''@/$(GNULIB_WCTOMB)/g' \ + < $(srcdir)/stdlib.in.h | \ + sed -e 's|@''HAVE__EXIT''@|$(HAVE__EXIT)|g' \ -e 's|@''HAVE_ATOLL''@|$(HAVE_ATOLL)|g' \ -e 's|@''HAVE_CANONICALIZE_FILE_NAME''@|$(HAVE_CANONICALIZE_FILE_NAME)|g' \ -e 's|@''HAVE_DECL_GETLOADAVG''@|$(HAVE_DECL_GETLOADAVG)|g' \ @@ -464,7 +613,10 @@ -e 's|@''HAVE_MKOSTEMPS''@|$(HAVE_MKOSTEMPS)|g' \ -e 's|@''HAVE_MKSTEMP''@|$(HAVE_MKSTEMP)|g' \ -e 's|@''HAVE_MKSTEMPS''@|$(HAVE_MKSTEMPS)|g' \ + -e 's|@''HAVE_POSIX_OPENPT''@|$(HAVE_POSIX_OPENPT)|g' \ -e 's|@''HAVE_PTSNAME''@|$(HAVE_PTSNAME)|g' \ + -e 's|@''HAVE_PTSNAME_R''@|$(HAVE_PTSNAME_R)|g' \ + -e 's|@''HAVE_RANDOM''@|$(HAVE_RANDOM)|g' \ -e 's|@''HAVE_RANDOM_H''@|$(HAVE_RANDOM_H)|g' \ -e 's|@''HAVE_RANDOM_R''@|$(HAVE_RANDOM_R)|g' \ -e 's|@''HAVE_REALPATH''@|$(HAVE_REALPATH)|g' \ @@ -480,17 +632,21 @@ -e 's|@''REPLACE_CALLOC''@|$(REPLACE_CALLOC)|g' \ -e 's|@''REPLACE_CANONICALIZE_FILE_NAME''@|$(REPLACE_CANONICALIZE_FILE_NAME)|g' \ -e 's|@''REPLACE_MALLOC''@|$(REPLACE_MALLOC)|g' \ + -e 's|@''REPLACE_MBTOWC''@|$(REPLACE_MBTOWC)|g' \ -e 's|@''REPLACE_MKSTEMP''@|$(REPLACE_MKSTEMP)|g' \ + -e 's|@''REPLACE_PTSNAME_R''@|$(REPLACE_PTSNAME_R)|g' \ -e 's|@''REPLACE_PUTENV''@|$(REPLACE_PUTENV)|g' \ + -e 's|@''REPLACE_RANDOM_R''@|$(REPLACE_RANDOM_R)|g' \ -e 's|@''REPLACE_REALLOC''@|$(REPLACE_REALLOC)|g' \ -e 's|@''REPLACE_REALPATH''@|$(REPLACE_REALPATH)|g' \ -e 's|@''REPLACE_SETENV''@|$(REPLACE_SETENV)|g' \ -e 's|@''REPLACE_STRTOD''@|$(REPLACE_STRTOD)|g' \ -e 's|@''REPLACE_UNSETENV''@|$(REPLACE_UNSETENV)|g' \ + -e 's|@''REPLACE_WCTOMB''@|$(REPLACE_WCTOMB)|g' \ -e '/definitions of _GL_FUNCDECL_RPL/r $(CXXDEFS_H)' \ + -e '/definition of _Noreturn/r $(_NORETURN_H)' \ -e '/definition of _GL_ARG_NONNULL/r $(ARG_NONNULL_H)' \ - -e '/definition of _GL_WARN_ON_USE/r $(WARN_ON_USE_H)' \ - < $(srcdir)/stdlib.in.h; \ + -e '/definition of _GL_WARN_ON_USE/r $(WARN_ON_USE_H)'; \ } > $@-t && \ mv $@-t $@ MOSTLYCLEANFILES += stdlib.h stdlib.h-t @@ -499,6 +655,15 @@ ## end gnulib module stdlib +## begin gnulib module strcase + + +EXTRA_DIST += strcasecmp.c strncasecmp.c + +EXTRA_libgnu_la_SOURCES += strcasecmp.c strncasecmp.c + +## end gnulib module strcase + ## begin gnulib module streq @@ -506,61 +671,127 @@ ## end gnulib module streq +## begin gnulib module strings + +BUILT_SOURCES += strings.h + +# We need the following in order to create when the system +# doesn't have one that works with the given compiler. +strings.h: strings.in.h $(top_builddir)/config.status $(CXXDEFS_H) $(WARN_ON_USE_H) $(ARG_NONNULL_H) + $(AM_V_GEN)rm -f $@-t $@ && \ + { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */' && \ + sed -e 's|@''GUARD_PREFIX''@|GL|g' \ + -e 's|@''HAVE_STRINGS_H''@|$(HAVE_STRINGS_H)|g' \ + -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \ + -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \ + -e 's|@''PRAGMA_COLUMNS''@|@PRAGMA_COLUMNS@|g' \ + -e 's|@''NEXT_STRINGS_H''@|$(NEXT_STRINGS_H)|g' \ + -e 's|@''GNULIB_FFS''@|$(GNULIB_FFS)|g' \ + -e 's|@''HAVE_FFS''@|$(HAVE_FFS)|g' \ + -e 's|@''HAVE_STRCASECMP''@|$(HAVE_STRCASECMP)|g' \ + -e 's|@''HAVE_DECL_STRNCASECMP''@|$(HAVE_DECL_STRNCASECMP)|g' \ + -e '/definitions of _GL_FUNCDECL_RPL/r $(CXXDEFS_H)' \ + -e '/definition of _GL_ARG_NONNULL/r $(ARG_NONNULL_H)' \ + -e '/definition of _GL_WARN_ON_USE/r $(WARN_ON_USE_H)' \ + < $(srcdir)/strings.in.h; \ + } > $@-t && \ + mv $@-t $@ +MOSTLYCLEANFILES += strings.h strings.h-t + +EXTRA_DIST += strings.in.h + +## end gnulib module strings + +## begin gnulib module sys_types + +BUILT_SOURCES += sys/types.h + +# We need the following in order to create when the system +# doesn't have one that works with the given compiler. +sys/types.h: sys_types.in.h $(top_builddir)/config.status + $(AM_V_at)$(MKDIR_P) sys + $(AM_V_GEN)rm -f $@-t $@ && \ + { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \ + sed -e 's|@''GUARD_PREFIX''@|GL|g' \ + -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \ + -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \ + -e 's|@''PRAGMA_COLUMNS''@|@PRAGMA_COLUMNS@|g' \ + -e 's|@''NEXT_SYS_TYPES_H''@|$(NEXT_SYS_TYPES_H)|g' \ + -e 's|@''WINDOWS_64_BIT_OFF_T''@|$(WINDOWS_64_BIT_OFF_T)|g' \ + < $(srcdir)/sys_types.in.h; \ + } > $@-t && \ + mv $@-t $@ +MOSTLYCLEANFILES += sys/types.h sys/types.h-t + +EXTRA_DIST += sys_types.in.h + +## end gnulib module sys_types + ## begin gnulib module unistd BUILT_SOURCES += unistd.h # We need the following in order to create an empty placeholder for # when the system doesn't have one. -unistd.h: unistd.in.h $(CXXDEFS_H) $(ARG_NONNULL_H) $(WARN_ON_USE_H) +unistd.h: unistd.in.h $(top_builddir)/config.status $(CXXDEFS_H) $(ARG_NONNULL_H) $(WARN_ON_USE_H) $(AM_V_GEN)rm -f $@-t $@ && \ { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \ - sed -e 's|@''HAVE_UNISTD_H''@|$(HAVE_UNISTD_H)|g' \ + sed -e 's|@''GUARD_PREFIX''@|GL|g' \ + -e 's|@''HAVE_UNISTD_H''@|$(HAVE_UNISTD_H)|g' \ -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \ -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \ -e 's|@''PRAGMA_COLUMNS''@|@PRAGMA_COLUMNS@|g' \ -e 's|@''NEXT_UNISTD_H''@|$(NEXT_UNISTD_H)|g' \ - -e 's|@''GNULIB_CHOWN''@|$(GNULIB_CHOWN)|g' \ - -e 's|@''GNULIB_CLOSE''@|$(GNULIB_CLOSE)|g' \ - -e 's|@''GNULIB_DUP2''@|$(GNULIB_DUP2)|g' \ - -e 's|@''GNULIB_DUP3''@|$(GNULIB_DUP3)|g' \ - -e 's|@''GNULIB_ENVIRON''@|$(GNULIB_ENVIRON)|g' \ - -e 's|@''GNULIB_EUIDACCESS''@|$(GNULIB_EUIDACCESS)|g' \ - -e 's|@''GNULIB_FACCESSAT''@|$(GNULIB_FACCESSAT)|g' \ - -e 's|@''GNULIB_FCHDIR''@|$(GNULIB_FCHDIR)|g' \ - -e 's|@''GNULIB_FCHOWNAT''@|$(GNULIB_FCHOWNAT)|g' \ - -e 's|@''GNULIB_FSYNC''@|$(GNULIB_FSYNC)|g' \ - -e 's|@''GNULIB_FTRUNCATE''@|$(GNULIB_FTRUNCATE)|g' \ - -e 's|@''GNULIB_GETCWD''@|$(GNULIB_GETCWD)|g' \ - -e 's|@''GNULIB_GETDOMAINNAME''@|$(GNULIB_GETDOMAINNAME)|g' \ - -e 's|@''GNULIB_GETDTABLESIZE''@|$(GNULIB_GETDTABLESIZE)|g' \ - -e 's|@''GNULIB_GETGROUPS''@|$(GNULIB_GETGROUPS)|g' \ - -e 's|@''GNULIB_GETHOSTNAME''@|$(GNULIB_GETHOSTNAME)|g' \ - -e 's|@''GNULIB_GETLOGIN''@|$(GNULIB_GETLOGIN)|g' \ - -e 's|@''GNULIB_GETLOGIN_R''@|$(GNULIB_GETLOGIN_R)|g' \ - -e 's|@''GNULIB_GETPAGESIZE''@|$(GNULIB_GETPAGESIZE)|g' \ - -e 's|@''GNULIB_GETUSERSHELL''@|$(GNULIB_GETUSERSHELL)|g' \ - -e 's|@''GNULIB_LCHOWN''@|$(GNULIB_LCHOWN)|g' \ - -e 's|@''GNULIB_LINK''@|$(GNULIB_LINK)|g' \ - -e 's|@''GNULIB_LINKAT''@|$(GNULIB_LINKAT)|g' \ - -e 's|@''GNULIB_LSEEK''@|$(GNULIB_LSEEK)|g' \ - -e 's|@''GNULIB_PIPE''@|$(GNULIB_PIPE)|g' \ - -e 's|@''GNULIB_PIPE2''@|$(GNULIB_PIPE2)|g' \ - -e 's|@''GNULIB_PREAD''@|$(GNULIB_PREAD)|g' \ - -e 's|@''GNULIB_PWRITE''@|$(GNULIB_PWRITE)|g' \ - -e 's|@''GNULIB_READLINK''@|$(GNULIB_READLINK)|g' \ - -e 's|@''GNULIB_READLINKAT''@|$(GNULIB_READLINKAT)|g' \ - -e 's|@''GNULIB_RMDIR''@|$(GNULIB_RMDIR)|g' \ - -e 's|@''GNULIB_SLEEP''@|$(GNULIB_SLEEP)|g' \ - -e 's|@''GNULIB_SYMLINK''@|$(GNULIB_SYMLINK)|g' \ - -e 's|@''GNULIB_SYMLINKAT''@|$(GNULIB_SYMLINKAT)|g' \ - -e 's|@''GNULIB_TTYNAME_R''@|$(GNULIB_TTYNAME_R)|g' \ - -e 's|@''GNULIB_UNISTD_H_GETOPT''@|$(GNULIB_UNISTD_H_GETOPT)|g' \ - -e 's|@''GNULIB_UNISTD_H_SIGPIPE''@|$(GNULIB_UNISTD_H_SIGPIPE)|g' \ - -e 's|@''GNULIB_UNLINK''@|$(GNULIB_UNLINK)|g' \ - -e 's|@''GNULIB_UNLINKAT''@|$(GNULIB_UNLINKAT)|g' \ - -e 's|@''GNULIB_USLEEP''@|$(GNULIB_USLEEP)|g' \ - -e 's|@''GNULIB_WRITE''@|$(GNULIB_WRITE)|g' \ + -e 's|@''WINDOWS_64_BIT_OFF_T''@|$(WINDOWS_64_BIT_OFF_T)|g' \ + -e 's/@''GNULIB_CHDIR''@/$(GNULIB_CHDIR)/g' \ + -e 's/@''GNULIB_CHOWN''@/$(GNULIB_CHOWN)/g' \ + -e 's/@''GNULIB_CLOSE''@/$(GNULIB_CLOSE)/g' \ + -e 's/@''GNULIB_DUP''@/$(GNULIB_DUP)/g' \ + -e 's/@''GNULIB_DUP2''@/$(GNULIB_DUP2)/g' \ + -e 's/@''GNULIB_DUP3''@/$(GNULIB_DUP3)/g' \ + -e 's/@''GNULIB_ENVIRON''@/$(GNULIB_ENVIRON)/g' \ + -e 's/@''GNULIB_EUIDACCESS''@/$(GNULIB_EUIDACCESS)/g' \ + -e 's/@''GNULIB_FACCESSAT''@/$(GNULIB_FACCESSAT)/g' \ + -e 's/@''GNULIB_FCHDIR''@/$(GNULIB_FCHDIR)/g' \ + -e 's/@''GNULIB_FCHOWNAT''@/$(GNULIB_FCHOWNAT)/g' \ + -e 's/@''GNULIB_FDATASYNC''@/$(GNULIB_FDATASYNC)/g' \ + -e 's/@''GNULIB_FSYNC''@/$(GNULIB_FSYNC)/g' \ + -e 's/@''GNULIB_FTRUNCATE''@/$(GNULIB_FTRUNCATE)/g' \ + -e 's/@''GNULIB_GETCWD''@/$(GNULIB_GETCWD)/g' \ + -e 's/@''GNULIB_GETDOMAINNAME''@/$(GNULIB_GETDOMAINNAME)/g' \ + -e 's/@''GNULIB_GETDTABLESIZE''@/$(GNULIB_GETDTABLESIZE)/g' \ + -e 's/@''GNULIB_GETGROUPS''@/$(GNULIB_GETGROUPS)/g' \ + -e 's/@''GNULIB_GETHOSTNAME''@/$(GNULIB_GETHOSTNAME)/g' \ + -e 's/@''GNULIB_GETLOGIN''@/$(GNULIB_GETLOGIN)/g' \ + -e 's/@''GNULIB_GETLOGIN_R''@/$(GNULIB_GETLOGIN_R)/g' \ + -e 's/@''GNULIB_GETPAGESIZE''@/$(GNULIB_GETPAGESIZE)/g' \ + -e 's/@''GNULIB_GETUSERSHELL''@/$(GNULIB_GETUSERSHELL)/g' \ + -e 's/@''GNULIB_GROUP_MEMBER''@/$(GNULIB_GROUP_MEMBER)/g' \ + -e 's/@''GNULIB_ISATTY''@/$(GNULIB_ISATTY)/g' \ + -e 's/@''GNULIB_LCHOWN''@/$(GNULIB_LCHOWN)/g' \ + -e 's/@''GNULIB_LINK''@/$(GNULIB_LINK)/g' \ + -e 's/@''GNULIB_LINKAT''@/$(GNULIB_LINKAT)/g' \ + -e 's/@''GNULIB_LSEEK''@/$(GNULIB_LSEEK)/g' \ + -e 's/@''GNULIB_PIPE''@/$(GNULIB_PIPE)/g' \ + -e 's/@''GNULIB_PIPE2''@/$(GNULIB_PIPE2)/g' \ + -e 's/@''GNULIB_PREAD''@/$(GNULIB_PREAD)/g' \ + -e 's/@''GNULIB_PWRITE''@/$(GNULIB_PWRITE)/g' \ + -e 's/@''GNULIB_READ''@/$(GNULIB_READ)/g' \ + -e 's/@''GNULIB_READLINK''@/$(GNULIB_READLINK)/g' \ + -e 's/@''GNULIB_READLINKAT''@/$(GNULIB_READLINKAT)/g' \ + -e 's/@''GNULIB_RMDIR''@/$(GNULIB_RMDIR)/g' \ + -e 's/@''GNULIB_SETHOSTNAME''@/$(GNULIB_SETHOSTNAME)/g' \ + -e 's/@''GNULIB_SLEEP''@/$(GNULIB_SLEEP)/g' \ + -e 's/@''GNULIB_SYMLINK''@/$(GNULIB_SYMLINK)/g' \ + -e 's/@''GNULIB_SYMLINKAT''@/$(GNULIB_SYMLINKAT)/g' \ + -e 's/@''GNULIB_TTYNAME_R''@/$(GNULIB_TTYNAME_R)/g' \ + -e 's/@''GNULIB_UNISTD_H_GETOPT''@/0$(GNULIB_GL_UNISTD_H_GETOPT)/g' \ + -e 's/@''GNULIB_UNISTD_H_NONBLOCKING''@/$(GNULIB_UNISTD_H_NONBLOCKING)/g' \ + -e 's/@''GNULIB_UNISTD_H_SIGPIPE''@/$(GNULIB_UNISTD_H_SIGPIPE)/g' \ + -e 's/@''GNULIB_UNLINK''@/$(GNULIB_UNLINK)/g' \ + -e 's/@''GNULIB_UNLINKAT''@/$(GNULIB_UNLINKAT)/g' \ + -e 's/@''GNULIB_USLEEP''@/$(GNULIB_USLEEP)/g' \ + -e 's/@''GNULIB_WRITE''@/$(GNULIB_WRITE)/g' \ < $(srcdir)/unistd.in.h | \ sed -e 's|@''HAVE_CHOWN''@|$(HAVE_CHOWN)|g' \ -e 's|@''HAVE_DUP2''@|$(HAVE_DUP2)|g' \ @@ -569,6 +800,7 @@ -e 's|@''HAVE_FACCESSAT''@|$(HAVE_FACCESSAT)|g' \ -e 's|@''HAVE_FCHDIR''@|$(HAVE_FCHDIR)|g' \ -e 's|@''HAVE_FCHOWNAT''@|$(HAVE_FCHOWNAT)|g' \ + -e 's|@''HAVE_FDATASYNC''@|$(HAVE_FDATASYNC)|g' \ -e 's|@''HAVE_FSYNC''@|$(HAVE_FSYNC)|g' \ -e 's|@''HAVE_FTRUNCATE''@|$(HAVE_FTRUNCATE)|g' \ -e 's|@''HAVE_GETDTABLESIZE''@|$(HAVE_GETDTABLESIZE)|g' \ @@ -576,6 +808,7 @@ -e 's|@''HAVE_GETHOSTNAME''@|$(HAVE_GETHOSTNAME)|g' \ -e 's|@''HAVE_GETLOGIN''@|$(HAVE_GETLOGIN)|g' \ -e 's|@''HAVE_GETPAGESIZE''@|$(HAVE_GETPAGESIZE)|g' \ + -e 's|@''HAVE_GROUP_MEMBER''@|$(HAVE_GROUP_MEMBER)|g' \ -e 's|@''HAVE_LCHOWN''@|$(HAVE_LCHOWN)|g' \ -e 's|@''HAVE_LINK''@|$(HAVE_LINK)|g' \ -e 's|@''HAVE_LINKAT''@|$(HAVE_LINKAT)|g' \ @@ -585,6 +818,7 @@ -e 's|@''HAVE_PWRITE''@|$(HAVE_PWRITE)|g' \ -e 's|@''HAVE_READLINK''@|$(HAVE_READLINK)|g' \ -e 's|@''HAVE_READLINKAT''@|$(HAVE_READLINKAT)|g' \ + -e 's|@''HAVE_SETHOSTNAME''@|$(HAVE_SETHOSTNAME)|g' \ -e 's|@''HAVE_SLEEP''@|$(HAVE_SLEEP)|g' \ -e 's|@''HAVE_SYMLINK''@|$(HAVE_SYMLINK)|g' \ -e 's|@''HAVE_SYMLINKAT''@|$(HAVE_SYMLINKAT)|g' \ @@ -592,29 +826,35 @@ -e 's|@''HAVE_USLEEP''@|$(HAVE_USLEEP)|g' \ -e 's|@''HAVE_DECL_ENVIRON''@|$(HAVE_DECL_ENVIRON)|g' \ -e 's|@''HAVE_DECL_FCHDIR''@|$(HAVE_DECL_FCHDIR)|g' \ + -e 's|@''HAVE_DECL_FDATASYNC''@|$(HAVE_DECL_FDATASYNC)|g' \ -e 's|@''HAVE_DECL_GETDOMAINNAME''@|$(HAVE_DECL_GETDOMAINNAME)|g' \ -e 's|@''HAVE_DECL_GETLOGIN_R''@|$(HAVE_DECL_GETLOGIN_R)|g' \ -e 's|@''HAVE_DECL_GETPAGESIZE''@|$(HAVE_DECL_GETPAGESIZE)|g' \ -e 's|@''HAVE_DECL_GETUSERSHELL''@|$(HAVE_DECL_GETUSERSHELL)|g' \ + -e 's|@''HAVE_DECL_SETHOSTNAME''@|$(HAVE_DECL_SETHOSTNAME)|g' \ -e 's|@''HAVE_DECL_TTYNAME_R''@|$(HAVE_DECL_TTYNAME_R)|g' \ -e 's|@''HAVE_OS_H''@|$(HAVE_OS_H)|g' \ -e 's|@''HAVE_SYS_PARAM_H''@|$(HAVE_SYS_PARAM_H)|g' \ - -e 's|@''REPLACE_CHOWN''@|$(REPLACE_CHOWN)|g' \ + | \ + sed -e 's|@''REPLACE_CHOWN''@|$(REPLACE_CHOWN)|g' \ -e 's|@''REPLACE_CLOSE''@|$(REPLACE_CLOSE)|g' \ -e 's|@''REPLACE_DUP''@|$(REPLACE_DUP)|g' \ -e 's|@''REPLACE_DUP2''@|$(REPLACE_DUP2)|g' \ -e 's|@''REPLACE_FCHOWNAT''@|$(REPLACE_FCHOWNAT)|g' \ + -e 's|@''REPLACE_FTRUNCATE''@|$(REPLACE_FTRUNCATE)|g' \ -e 's|@''REPLACE_GETCWD''@|$(REPLACE_GETCWD)|g' \ -e 's|@''REPLACE_GETDOMAINNAME''@|$(REPLACE_GETDOMAINNAME)|g' \ -e 's|@''REPLACE_GETLOGIN_R''@|$(REPLACE_GETLOGIN_R)|g' \ -e 's|@''REPLACE_GETGROUPS''@|$(REPLACE_GETGROUPS)|g' \ -e 's|@''REPLACE_GETPAGESIZE''@|$(REPLACE_GETPAGESIZE)|g' \ + -e 's|@''REPLACE_ISATTY''@|$(REPLACE_ISATTY)|g' \ -e 's|@''REPLACE_LCHOWN''@|$(REPLACE_LCHOWN)|g' \ -e 's|@''REPLACE_LINK''@|$(REPLACE_LINK)|g' \ -e 's|@''REPLACE_LINKAT''@|$(REPLACE_LINKAT)|g' \ -e 's|@''REPLACE_LSEEK''@|$(REPLACE_LSEEK)|g' \ -e 's|@''REPLACE_PREAD''@|$(REPLACE_PREAD)|g' \ -e 's|@''REPLACE_PWRITE''@|$(REPLACE_PWRITE)|g' \ + -e 's|@''REPLACE_READ''@|$(REPLACE_READ)|g' \ -e 's|@''REPLACE_READLINK''@|$(REPLACE_READLINK)|g' \ -e 's|@''REPLACE_RMDIR''@|$(REPLACE_RMDIR)|g' \ -e 's|@''REPLACE_SLEEP''@|$(REPLACE_SLEEP)|g' \ @@ -639,28 +879,10 @@ ## begin gnulib module verify -libgnu_la_SOURCES += verify.h -## end gnulib module verify - -## begin gnulib module warn-on-use +EXTRA_DIST += verify.h -BUILT_SOURCES += warn-on-use.h -# The warn-on-use.h that gets inserted into generated .h files is the same as -# build-aux/warn-on-use.h, except that it has the copyright header cut off. -warn-on-use.h: $(top_srcdir)/conf/warn-on-use.h - $(AM_V_GEN)rm -f $@-t $@ && \ - sed -n -e '/^.ifndef/,$$p' \ - < $(top_srcdir)/conf/warn-on-use.h \ - > $@-t && \ - mv $@-t $@ -MOSTLYCLEANFILES += warn-on-use.h warn-on-use.h-t - -WARN_ON_USE_H=warn-on-use.h - -EXTRA_DIST += $(top_srcdir)/conf/warn-on-use.h - -## end gnulib module warn-on-use +## end gnulib module verify ## begin gnulib module wchar @@ -668,27 +890,57 @@ # We need the following in order to create when the system # version does not work standalone. -wchar.h: wchar.in.h $(CXXDEFS_H) $(ARG_NONNULL_H) $(WARN_ON_USE_H) +wchar.h: wchar.in.h $(top_builddir)/config.status $(CXXDEFS_H) $(ARG_NONNULL_H) $(WARN_ON_USE_H) $(AM_V_GEN)rm -f $@-t $@ && \ { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \ - sed -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \ + sed -e 's|@''GUARD_PREFIX''@|GL|g' \ + -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \ -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \ -e 's|@''PRAGMA_COLUMNS''@|@PRAGMA_COLUMNS@|g' \ -e 's|@''HAVE_FEATURES_H''@|$(HAVE_FEATURES_H)|g' \ -e 's|@''NEXT_WCHAR_H''@|$(NEXT_WCHAR_H)|g' \ -e 's|@''HAVE_WCHAR_H''@|$(HAVE_WCHAR_H)|g' \ - -e 's|@''GNULIB_BTOWC''@|$(GNULIB_BTOWC)|g' \ - -e 's|@''GNULIB_WCTOB''@|$(GNULIB_WCTOB)|g' \ - -e 's|@''GNULIB_MBSINIT''@|$(GNULIB_MBSINIT)|g' \ - -e 's|@''GNULIB_MBRTOWC''@|$(GNULIB_MBRTOWC)|g' \ - -e 's|@''GNULIB_MBRLEN''@|$(GNULIB_MBRLEN)|g' \ - -e 's|@''GNULIB_MBSRTOWCS''@|$(GNULIB_MBSRTOWCS)|g' \ - -e 's|@''GNULIB_MBSNRTOWCS''@|$(GNULIB_MBSNRTOWCS)|g' \ - -e 's|@''GNULIB_WCRTOMB''@|$(GNULIB_WCRTOMB)|g' \ - -e 's|@''GNULIB_WCSRTOMBS''@|$(GNULIB_WCSRTOMBS)|g' \ - -e 's|@''GNULIB_WCSNRTOMBS''@|$(GNULIB_WCSNRTOMBS)|g' \ - -e 's|@''GNULIB_WCWIDTH''@|$(GNULIB_WCWIDTH)|g' \ - -e 's|@''HAVE_WINT_T''@|$(HAVE_WINT_T)|g' \ + -e 's/@''GNULIB_BTOWC''@/$(GNULIB_BTOWC)/g' \ + -e 's/@''GNULIB_WCTOB''@/$(GNULIB_WCTOB)/g' \ + -e 's/@''GNULIB_MBSINIT''@/$(GNULIB_MBSINIT)/g' \ + -e 's/@''GNULIB_MBRTOWC''@/$(GNULIB_MBRTOWC)/g' \ + -e 's/@''GNULIB_MBRLEN''@/$(GNULIB_MBRLEN)/g' \ + -e 's/@''GNULIB_MBSRTOWCS''@/$(GNULIB_MBSRTOWCS)/g' \ + -e 's/@''GNULIB_MBSNRTOWCS''@/$(GNULIB_MBSNRTOWCS)/g' \ + -e 's/@''GNULIB_WCRTOMB''@/$(GNULIB_WCRTOMB)/g' \ + -e 's/@''GNULIB_WCSRTOMBS''@/$(GNULIB_WCSRTOMBS)/g' \ + -e 's/@''GNULIB_WCSNRTOMBS''@/$(GNULIB_WCSNRTOMBS)/g' \ + -e 's/@''GNULIB_WCWIDTH''@/$(GNULIB_WCWIDTH)/g' \ + -e 's/@''GNULIB_WMEMCHR''@/$(GNULIB_WMEMCHR)/g' \ + -e 's/@''GNULIB_WMEMCMP''@/$(GNULIB_WMEMCMP)/g' \ + -e 's/@''GNULIB_WMEMCPY''@/$(GNULIB_WMEMCPY)/g' \ + -e 's/@''GNULIB_WMEMMOVE''@/$(GNULIB_WMEMMOVE)/g' \ + -e 's/@''GNULIB_WMEMSET''@/$(GNULIB_WMEMSET)/g' \ + -e 's/@''GNULIB_WCSLEN''@/$(GNULIB_WCSLEN)/g' \ + -e 's/@''GNULIB_WCSNLEN''@/$(GNULIB_WCSNLEN)/g' \ + -e 's/@''GNULIB_WCSCPY''@/$(GNULIB_WCSCPY)/g' \ + -e 's/@''GNULIB_WCPCPY''@/$(GNULIB_WCPCPY)/g' \ + -e 's/@''GNULIB_WCSNCPY''@/$(GNULIB_WCSNCPY)/g' \ + -e 's/@''GNULIB_WCPNCPY''@/$(GNULIB_WCPNCPY)/g' \ + -e 's/@''GNULIB_WCSCAT''@/$(GNULIB_WCSCAT)/g' \ + -e 's/@''GNULIB_WCSNCAT''@/$(GNULIB_WCSNCAT)/g' \ + -e 's/@''GNULIB_WCSCMP''@/$(GNULIB_WCSCMP)/g' \ + -e 's/@''GNULIB_WCSNCMP''@/$(GNULIB_WCSNCMP)/g' \ + -e 's/@''GNULIB_WCSCASECMP''@/$(GNULIB_WCSCASECMP)/g' \ + -e 's/@''GNULIB_WCSNCASECMP''@/$(GNULIB_WCSNCASECMP)/g' \ + -e 's/@''GNULIB_WCSCOLL''@/$(GNULIB_WCSCOLL)/g' \ + -e 's/@''GNULIB_WCSXFRM''@/$(GNULIB_WCSXFRM)/g' \ + -e 's/@''GNULIB_WCSDUP''@/$(GNULIB_WCSDUP)/g' \ + -e 's/@''GNULIB_WCSCHR''@/$(GNULIB_WCSCHR)/g' \ + -e 's/@''GNULIB_WCSRCHR''@/$(GNULIB_WCSRCHR)/g' \ + -e 's/@''GNULIB_WCSCSPN''@/$(GNULIB_WCSCSPN)/g' \ + -e 's/@''GNULIB_WCSSPN''@/$(GNULIB_WCSSPN)/g' \ + -e 's/@''GNULIB_WCSPBRK''@/$(GNULIB_WCSPBRK)/g' \ + -e 's/@''GNULIB_WCSSTR''@/$(GNULIB_WCSSTR)/g' \ + -e 's/@''GNULIB_WCSTOK''@/$(GNULIB_WCSTOK)/g' \ + -e 's/@''GNULIB_WCSWIDTH''@/$(GNULIB_WCSWIDTH)/g' \ + < $(srcdir)/wchar.in.h | \ + sed -e 's|@''HAVE_WINT_T''@|$(HAVE_WINT_T)|g' \ -e 's|@''HAVE_BTOWC''@|$(HAVE_BTOWC)|g' \ -e 's|@''HAVE_MBSINIT''@|$(HAVE_MBSINIT)|g' \ -e 's|@''HAVE_MBRTOWC''@|$(HAVE_MBRTOWC)|g' \ @@ -698,9 +950,38 @@ -e 's|@''HAVE_WCRTOMB''@|$(HAVE_WCRTOMB)|g' \ -e 's|@''HAVE_WCSRTOMBS''@|$(HAVE_WCSRTOMBS)|g' \ -e 's|@''HAVE_WCSNRTOMBS''@|$(HAVE_WCSNRTOMBS)|g' \ + -e 's|@''HAVE_WMEMCHR''@|$(HAVE_WMEMCHR)|g' \ + -e 's|@''HAVE_WMEMCMP''@|$(HAVE_WMEMCMP)|g' \ + -e 's|@''HAVE_WMEMCPY''@|$(HAVE_WMEMCPY)|g' \ + -e 's|@''HAVE_WMEMMOVE''@|$(HAVE_WMEMMOVE)|g' \ + -e 's|@''HAVE_WMEMSET''@|$(HAVE_WMEMSET)|g' \ + -e 's|@''HAVE_WCSLEN''@|$(HAVE_WCSLEN)|g' \ + -e 's|@''HAVE_WCSNLEN''@|$(HAVE_WCSNLEN)|g' \ + -e 's|@''HAVE_WCSCPY''@|$(HAVE_WCSCPY)|g' \ + -e 's|@''HAVE_WCPCPY''@|$(HAVE_WCPCPY)|g' \ + -e 's|@''HAVE_WCSNCPY''@|$(HAVE_WCSNCPY)|g' \ + -e 's|@''HAVE_WCPNCPY''@|$(HAVE_WCPNCPY)|g' \ + -e 's|@''HAVE_WCSCAT''@|$(HAVE_WCSCAT)|g' \ + -e 's|@''HAVE_WCSNCAT''@|$(HAVE_WCSNCAT)|g' \ + -e 's|@''HAVE_WCSCMP''@|$(HAVE_WCSCMP)|g' \ + -e 's|@''HAVE_WCSNCMP''@|$(HAVE_WCSNCMP)|g' \ + -e 's|@''HAVE_WCSCASECMP''@|$(HAVE_WCSCASECMP)|g' \ + -e 's|@''HAVE_WCSNCASECMP''@|$(HAVE_WCSNCASECMP)|g' \ + -e 's|@''HAVE_WCSCOLL''@|$(HAVE_WCSCOLL)|g' \ + -e 's|@''HAVE_WCSXFRM''@|$(HAVE_WCSXFRM)|g' \ + -e 's|@''HAVE_WCSDUP''@|$(HAVE_WCSDUP)|g' \ + -e 's|@''HAVE_WCSCHR''@|$(HAVE_WCSCHR)|g' \ + -e 's|@''HAVE_WCSRCHR''@|$(HAVE_WCSRCHR)|g' \ + -e 's|@''HAVE_WCSCSPN''@|$(HAVE_WCSCSPN)|g' \ + -e 's|@''HAVE_WCSSPN''@|$(HAVE_WCSSPN)|g' \ + -e 's|@''HAVE_WCSPBRK''@|$(HAVE_WCSPBRK)|g' \ + -e 's|@''HAVE_WCSSTR''@|$(HAVE_WCSSTR)|g' \ + -e 's|@''HAVE_WCSTOK''@|$(HAVE_WCSTOK)|g' \ + -e 's|@''HAVE_WCSWIDTH''@|$(HAVE_WCSWIDTH)|g' \ -e 's|@''HAVE_DECL_WCTOB''@|$(HAVE_DECL_WCTOB)|g' \ -e 's|@''HAVE_DECL_WCWIDTH''@|$(HAVE_DECL_WCWIDTH)|g' \ - -e 's|@''REPLACE_MBSTATE_T''@|$(REPLACE_MBSTATE_T)|g' \ + | \ + sed -e 's|@''REPLACE_MBSTATE_T''@|$(REPLACE_MBSTATE_T)|g' \ -e 's|@''REPLACE_BTOWC''@|$(REPLACE_BTOWC)|g' \ -e 's|@''REPLACE_WCTOB''@|$(REPLACE_WCTOB)|g' \ -e 's|@''REPLACE_MBSINIT''@|$(REPLACE_MBSINIT)|g' \ @@ -712,10 +993,10 @@ -e 's|@''REPLACE_WCSRTOMBS''@|$(REPLACE_WCSRTOMBS)|g' \ -e 's|@''REPLACE_WCSNRTOMBS''@|$(REPLACE_WCSNRTOMBS)|g' \ -e 's|@''REPLACE_WCWIDTH''@|$(REPLACE_WCWIDTH)|g' \ + -e 's|@''REPLACE_WCSWIDTH''@|$(REPLACE_WCSWIDTH)|g' \ -e '/definitions of _GL_FUNCDECL_RPL/r $(CXXDEFS_H)' \ -e '/definition of _GL_ARG_NONNULL/r $(ARG_NONNULL_H)' \ - -e '/definition of _GL_WARN_ON_USE/r $(WARN_ON_USE_H)' \ - < $(srcdir)/wchar.in.h; \ + -e '/definition of _GL_WARN_ON_USE/r $(WARN_ON_USE_H)'; \ } > $@-t && \ mv $@-t $@ MOSTLYCLEANFILES += wchar.h wchar.h-t @@ -733,25 +1014,34 @@ ## end gnulib module wcrtomb -## begin gnulib module wctype +## begin gnulib module wctype-h BUILT_SOURCES += wctype.h # We need the following in order to create when the system # doesn't have one that works with the given compiler. -wctype.h: wctype.in.h $(CXXDEFS_H) $(WARN_ON_USE_H) +wctype.h: wctype.in.h $(top_builddir)/config.status $(CXXDEFS_H) $(WARN_ON_USE_H) $(AM_V_GEN)rm -f $@-t $@ && \ { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \ - sed -e 's/@''HAVE_WCTYPE_H''@/$(HAVE_WCTYPE_H)/g' \ + sed -e 's|@''GUARD_PREFIX''@|GL|g' \ + -e 's/@''HAVE_WCTYPE_H''@/$(HAVE_WCTYPE_H)/g' \ -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \ -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \ -e 's|@''PRAGMA_COLUMNS''@|@PRAGMA_COLUMNS@|g' \ -e 's|@''NEXT_WCTYPE_H''@|$(NEXT_WCTYPE_H)|g' \ + -e 's/@''GNULIB_ISWBLANK''@/$(GNULIB_ISWBLANK)/g' \ + -e 's/@''GNULIB_WCTYPE''@/$(GNULIB_WCTYPE)/g' \ + -e 's/@''GNULIB_ISWCTYPE''@/$(GNULIB_ISWCTYPE)/g' \ + -e 's/@''GNULIB_WCTRANS''@/$(GNULIB_WCTRANS)/g' \ + -e 's/@''GNULIB_TOWCTRANS''@/$(GNULIB_TOWCTRANS)/g' \ -e 's/@''HAVE_ISWBLANK''@/$(HAVE_ISWBLANK)/g' \ -e 's/@''HAVE_ISWCNTRL''@/$(HAVE_ISWCNTRL)/g' \ + -e 's/@''HAVE_WCTYPE_T''@/$(HAVE_WCTYPE_T)/g' \ + -e 's/@''HAVE_WCTRANS_T''@/$(HAVE_WCTRANS_T)/g' \ -e 's/@''HAVE_WINT_T''@/$(HAVE_WINT_T)/g' \ -e 's/@''REPLACE_ISWBLANK''@/$(REPLACE_ISWBLANK)/g' \ -e 's/@''REPLACE_ISWCNTRL''@/$(REPLACE_ISWCNTRL)/g' \ + -e 's/@''REPLACE_TOWLOWER''@/$(REPLACE_TOWLOWER)/g' \ -e '/definitions of _GL_FUNCDECL_RPL/r $(CXXDEFS_H)' \ -e '/definition of _GL_WARN_ON_USE/r $(WARN_ON_USE_H)' \ < $(srcdir)/wctype.in.h; \ @@ -759,11 +1049,9 @@ mv $@-t $@ MOSTLYCLEANFILES += wctype.h wctype.h-t -EXTRA_DIST += iswblank.c wctype.in.h - -EXTRA_libgnu_la_SOURCES += iswblank.c +EXTRA_DIST += wctype.in.h -## end gnulib module wctype +## end gnulib module wctype-h mostlyclean-local: mostlyclean-generic diff -Nru libdap-3.11.1/gl/Makefile.in libdap-3.12.0/gl/Makefile.in --- libdap-3.11.1/gl/Makefile.in 2011-05-06 17:36:28.000000000 +0000 +++ libdap-3.12.0/gl/Makefile.in 2013-10-17 21:27:40.000000000 +0000 @@ -1,9 +1,9 @@ -# Makefile.in generated by automake 1.11 from Makefile.am. +# Makefile.in generated by automake 1.12 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, -# 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, -# Inc. +# 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software +# Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. @@ -15,20 +15,49 @@ @SET_MAKE@ -# Copyright (C) 2002-2011 Free Software Foundation, Inc. +# Copyright (C) 2002-2012 Free Software Foundation, Inc. # -# This file is free software, distributed under the terms of the GNU -# General Public License. As a special exception to the GNU General -# Public License, this file may be distributed as part of a program -# that contains a configuration script generated by Autoconf, under +# 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 3 of the License, or +# (at your option) any later version. +# +# This file 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 file. If not, see . +# +# As a special exception to the GNU General Public License, +# this file may be distributed as part of a program that +# contains a configuration script generated by Autoconf, under # the same distribution terms as the rest of that program. # # Generated by gnulib-tool. -# Reproduce by: gnulib-tool --import --dir=. --lib=libgnu --source-base=gl --m4-base=gl/m4 --doc-base=gl/doc --tests-base=tests --aux-dir=conf --lgpl --libtool --macro-prefix=gl regex +# Reproduce by: gnulib-tool --import --dir=. --lib=libgnu --source-base=gl --m4-base=gl/m4 --doc-base=gl/doc --tests-base=tests --aux-dir=conf --lgpl --no-conditional-dependencies --libtool --macro-prefix=gl byteswap regex VPATH = @srcdir@ +am__make_dryrun = \ + { \ + am__dry=no; \ + case $$MAKEFLAGS in \ + *\\[\ \ ]*) \ + echo 'am--echo: ; @echo "AM" OK' | $(MAKE) -f - 2>/dev/null \ + | grep '^AM OK$$' >/dev/null || am__dry=yes;; \ + *) \ + for am__flg in $$MAKEFLAGS; do \ + case $$am__flg in \ + *=*|--*) ;; \ + *n*) am__dry=yes; break;; \ + esac; \ + done;; \ + esac; \ + test $$am__dry = yes; \ + } pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ @@ -48,11 +77,11 @@ host_triplet = @host@ subdir = gl DIST_COMMON = $(noinst_HEADERS) $(srcdir)/Makefile.am \ - $(srcdir)/Makefile.in + $(srcdir)/Makefile.in $(top_srcdir)/conf/depcomp ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/gl/m4/00gnulib.m4 \ $(top_srcdir)/gl/m4/alloca.m4 $(top_srcdir)/gl/m4/btowc.m4 \ - $(top_srcdir)/gl/m4/codeset.m4 \ + $(top_srcdir)/gl/m4/byteswap.m4 $(top_srcdir)/gl/m4/codeset.m4 \ $(top_srcdir)/gl/m4/configmake.m4 \ $(top_srcdir)/gl/m4/extensions.m4 \ $(top_srcdir)/gl/m4/fcntl-o.m4 $(top_srcdir)/gl/m4/glibc21.m4 \ @@ -65,22 +94,27 @@ $(top_srcdir)/gl/m4/locale-fr.m4 \ $(top_srcdir)/gl/m4/locale-ja.m4 \ $(top_srcdir)/gl/m4/locale-zh.m4 \ + $(top_srcdir)/gl/m4/locale_h.m4 \ + $(top_srcdir)/gl/m4/localeconv.m4 \ $(top_srcdir)/gl/m4/longlong.m4 $(top_srcdir)/gl/m4/malloc.m4 \ $(top_srcdir)/gl/m4/mbrtowc.m4 $(top_srcdir)/gl/m4/mbsinit.m4 \ - $(top_srcdir)/gl/m4/mbstate_t.m4 \ + $(top_srcdir)/gl/m4/mbstate_t.m4 $(top_srcdir)/gl/m4/mbtowc.m4 \ $(top_srcdir)/gl/m4/multiarch.m4 \ $(top_srcdir)/gl/m4/nl_langinfo.m4 \ - $(top_srcdir)/gl/m4/regex.m4 $(top_srcdir)/gl/m4/ssize_t.m4 \ - $(top_srcdir)/gl/m4/stdbool.m4 $(top_srcdir)/gl/m4/stddef_h.m4 \ - $(top_srcdir)/gl/m4/stdint.m4 $(top_srcdir)/gl/m4/stdlib_h.m4 \ + $(top_srcdir)/gl/m4/off_t.m4 $(top_srcdir)/gl/m4/regex.m4 \ + $(top_srcdir)/gl/m4/ssize_t.m4 $(top_srcdir)/gl/m4/stdbool.m4 \ + $(top_srcdir)/gl/m4/stddef_h.m4 $(top_srcdir)/gl/m4/stdint.m4 \ + $(top_srcdir)/gl/m4/stdlib_h.m4 $(top_srcdir)/gl/m4/strcase.m4 \ + $(top_srcdir)/gl/m4/strings_h.m4 \ + $(top_srcdir)/gl/m4/sys_types_h.m4 \ $(top_srcdir)/gl/m4/unistd_h.m4 \ $(top_srcdir)/gl/m4/warn-on-use.m4 \ $(top_srcdir)/gl/m4/wchar_h.m4 $(top_srcdir)/gl/m4/wchar_t.m4 \ $(top_srcdir)/gl/m4/wcrtomb.m4 $(top_srcdir)/gl/m4/wctype_h.m4 \ $(top_srcdir)/gl/m4/wint_t.m4 $(top_srcdir)/conf/acinclude.m4 \ - $(top_srcdir)/conf/check_zlib.m4 $(top_srcdir)/conf/cppunit.m4 \ - $(top_srcdir)/conf/libtool.m4 $(top_srcdir)/conf/ltoptions.m4 \ - $(top_srcdir)/conf/ltsugar.m4 $(top_srcdir)/conf/ltversion.m4 \ + $(top_srcdir)/conf/cppunit.m4 $(top_srcdir)/conf/libtool.m4 \ + $(top_srcdir)/conf/ltoptions.m4 $(top_srcdir)/conf/ltsugar.m4 \ + $(top_srcdir)/conf/ltversion.m4 \ $(top_srcdir)/conf/lt~obsolete.m4 $(top_srcdir)/conf/pkg.m4 \ $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ @@ -121,6 +155,11 @@ install-pdf-recursive install-ps-recursive install-recursive \ installcheck-recursive installdirs-recursive pdf-recursive \ ps-recursive uninstall-recursive +am__can_run_installinfo = \ + case $$AM_UPDATE_INFO_DIR in \ + n|no|NO) false;; \ + *) (install-info --version) >/dev/null 2>&1;; \ + esac HEADERS = $(noinst_HEADERS) RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \ distclean-recursive maintainer-clean-recursive @@ -163,6 +202,7 @@ AMTAR = @AMTAR@ APPLE_UNIVERSAL_BUILD = @APPLE_UNIVERSAL_BUILD@ AR = @AR@ +ARFLAGS = @ARFLAGS@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ @@ -172,6 +212,7 @@ BITSIZEOF_SIZE_T = @BITSIZEOF_SIZE_T@ BITSIZEOF_WCHAR_T = @BITSIZEOF_WCHAR_T@ BITSIZEOF_WINT_T = @BITSIZEOF_WINT_T@ +BYTESWAP_H = @BYTESWAP_H@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ @@ -198,6 +239,7 @@ DAP_PROTOCOL_VERSION = @DAP_PROTOCOL_VERSION@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ +DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ DVR = @DVR@ @@ -213,15 +255,20 @@ GNULIB_BTOWC = @GNULIB_BTOWC@ GNULIB_CALLOC_POSIX = @GNULIB_CALLOC_POSIX@ GNULIB_CANONICALIZE_FILE_NAME = @GNULIB_CANONICALIZE_FILE_NAME@ +GNULIB_CHDIR = @GNULIB_CHDIR@ GNULIB_CHOWN = @GNULIB_CHOWN@ GNULIB_CLOSE = @GNULIB_CLOSE@ +GNULIB_DUP = @GNULIB_DUP@ GNULIB_DUP2 = @GNULIB_DUP2@ GNULIB_DUP3 = @GNULIB_DUP3@ +GNULIB_DUPLOCALE = @GNULIB_DUPLOCALE@ GNULIB_ENVIRON = @GNULIB_ENVIRON@ GNULIB_EUIDACCESS = @GNULIB_EUIDACCESS@ GNULIB_FACCESSAT = @GNULIB_FACCESSAT@ GNULIB_FCHDIR = @GNULIB_FCHDIR@ GNULIB_FCHOWNAT = @GNULIB_FCHOWNAT@ +GNULIB_FDATASYNC = @GNULIB_FDATASYNC@ +GNULIB_FFS = @GNULIB_FFS@ GNULIB_FSYNC = @GNULIB_FSYNC@ GNULIB_FTRUNCATE = @GNULIB_FTRUNCATE@ GNULIB_GETCWD = @GNULIB_GETCWD@ @@ -236,9 +283,14 @@ GNULIB_GETSUBOPT = @GNULIB_GETSUBOPT@ GNULIB_GETUSERSHELL = @GNULIB_GETUSERSHELL@ GNULIB_GRANTPT = @GNULIB_GRANTPT@ +GNULIB_GROUP_MEMBER = @GNULIB_GROUP_MEMBER@ +GNULIB_ISATTY = @GNULIB_ISATTY@ +GNULIB_ISWBLANK = @GNULIB_ISWBLANK@ +GNULIB_ISWCTYPE = @GNULIB_ISWCTYPE@ GNULIB_LCHOWN = @GNULIB_LCHOWN@ GNULIB_LINK = @GNULIB_LINK@ GNULIB_LINKAT = @GNULIB_LINKAT@ +GNULIB_LOCALECONV = @GNULIB_LOCALECONV@ GNULIB_LSEEK = @GNULIB_LSEEK@ GNULIB_MALLOC_POSIX = @GNULIB_MALLOC_POSIX@ GNULIB_MBRLEN = @GNULIB_MBRLEN@ @@ -246,6 +298,7 @@ GNULIB_MBSINIT = @GNULIB_MBSINIT@ GNULIB_MBSNRTOWCS = @GNULIB_MBSNRTOWCS@ GNULIB_MBSRTOWCS = @GNULIB_MBSRTOWCS@ +GNULIB_MBTOWC = @GNULIB_MBTOWC@ GNULIB_MKDTEMP = @GNULIB_MKDTEMP@ GNULIB_MKOSTEMP = @GNULIB_MKOSTEMP@ GNULIB_MKOSTEMPS = @GNULIB_MKOSTEMPS@ @@ -254,11 +307,15 @@ GNULIB_NL_LANGINFO = @GNULIB_NL_LANGINFO@ GNULIB_PIPE = @GNULIB_PIPE@ GNULIB_PIPE2 = @GNULIB_PIPE2@ +GNULIB_POSIX_OPENPT = @GNULIB_POSIX_OPENPT@ GNULIB_PREAD = @GNULIB_PREAD@ GNULIB_PTSNAME = @GNULIB_PTSNAME@ +GNULIB_PTSNAME_R = @GNULIB_PTSNAME_R@ GNULIB_PUTENV = @GNULIB_PUTENV@ GNULIB_PWRITE = @GNULIB_PWRITE@ +GNULIB_RANDOM = @GNULIB_RANDOM@ GNULIB_RANDOM_R = @GNULIB_RANDOM_R@ +GNULIB_READ = @GNULIB_READ@ GNULIB_READLINK = @GNULIB_READLINK@ GNULIB_READLINKAT = @GNULIB_READLINKAT@ GNULIB_REALLOC_POSIX = @GNULIB_REALLOC_POSIX@ @@ -266,6 +323,8 @@ GNULIB_RMDIR = @GNULIB_RMDIR@ GNULIB_RPMATCH = @GNULIB_RPMATCH@ GNULIB_SETENV = @GNULIB_SETENV@ +GNULIB_SETHOSTNAME = @GNULIB_SETHOSTNAME@ +GNULIB_SETLOCALE = @GNULIB_SETLOCALE@ GNULIB_SLEEP = @GNULIB_SLEEP@ GNULIB_STRTOD = @GNULIB_STRTOD@ GNULIB_STRTOLL = @GNULIB_STRTOLL@ @@ -273,19 +332,51 @@ GNULIB_SYMLINK = @GNULIB_SYMLINK@ GNULIB_SYMLINKAT = @GNULIB_SYMLINKAT@ GNULIB_SYSTEM_POSIX = @GNULIB_SYSTEM_POSIX@ +GNULIB_TOWCTRANS = @GNULIB_TOWCTRANS@ GNULIB_TTYNAME_R = @GNULIB_TTYNAME_R@ -GNULIB_UNISTD_H_GETOPT = @GNULIB_UNISTD_H_GETOPT@ +GNULIB_UNISTD_H_NONBLOCKING = @GNULIB_UNISTD_H_NONBLOCKING@ GNULIB_UNISTD_H_SIGPIPE = @GNULIB_UNISTD_H_SIGPIPE@ GNULIB_UNLINK = @GNULIB_UNLINK@ GNULIB_UNLINKAT = @GNULIB_UNLINKAT@ GNULIB_UNLOCKPT = @GNULIB_UNLOCKPT@ GNULIB_UNSETENV = @GNULIB_UNSETENV@ GNULIB_USLEEP = @GNULIB_USLEEP@ +GNULIB_WCPCPY = @GNULIB_WCPCPY@ +GNULIB_WCPNCPY = @GNULIB_WCPNCPY@ GNULIB_WCRTOMB = @GNULIB_WCRTOMB@ +GNULIB_WCSCASECMP = @GNULIB_WCSCASECMP@ +GNULIB_WCSCAT = @GNULIB_WCSCAT@ +GNULIB_WCSCHR = @GNULIB_WCSCHR@ +GNULIB_WCSCMP = @GNULIB_WCSCMP@ +GNULIB_WCSCOLL = @GNULIB_WCSCOLL@ +GNULIB_WCSCPY = @GNULIB_WCSCPY@ +GNULIB_WCSCSPN = @GNULIB_WCSCSPN@ +GNULIB_WCSDUP = @GNULIB_WCSDUP@ +GNULIB_WCSLEN = @GNULIB_WCSLEN@ +GNULIB_WCSNCASECMP = @GNULIB_WCSNCASECMP@ +GNULIB_WCSNCAT = @GNULIB_WCSNCAT@ +GNULIB_WCSNCMP = @GNULIB_WCSNCMP@ +GNULIB_WCSNCPY = @GNULIB_WCSNCPY@ +GNULIB_WCSNLEN = @GNULIB_WCSNLEN@ GNULIB_WCSNRTOMBS = @GNULIB_WCSNRTOMBS@ +GNULIB_WCSPBRK = @GNULIB_WCSPBRK@ +GNULIB_WCSRCHR = @GNULIB_WCSRCHR@ GNULIB_WCSRTOMBS = @GNULIB_WCSRTOMBS@ +GNULIB_WCSSPN = @GNULIB_WCSSPN@ +GNULIB_WCSSTR = @GNULIB_WCSSTR@ +GNULIB_WCSTOK = @GNULIB_WCSTOK@ +GNULIB_WCSWIDTH = @GNULIB_WCSWIDTH@ +GNULIB_WCSXFRM = @GNULIB_WCSXFRM@ GNULIB_WCTOB = @GNULIB_WCTOB@ +GNULIB_WCTOMB = @GNULIB_WCTOMB@ +GNULIB_WCTRANS = @GNULIB_WCTRANS@ +GNULIB_WCTYPE = @GNULIB_WCTYPE@ GNULIB_WCWIDTH = @GNULIB_WCWIDTH@ +GNULIB_WMEMCHR = @GNULIB_WMEMCHR@ +GNULIB_WMEMCMP = @GNULIB_WMEMCMP@ +GNULIB_WMEMCPY = @GNULIB_WMEMCPY@ +GNULIB_WMEMMOVE = @GNULIB_WMEMMOVE@ +GNULIB_WMEMSET = @GNULIB_WMEMSET@ GNULIB_WRITE = @GNULIB_WRITE@ GNULIB__EXIT = @GNULIB__EXIT@ GREP = @GREP@ @@ -295,23 +386,29 @@ HAVE_CHOWN = @HAVE_CHOWN@ HAVE_DECL_ENVIRON = @HAVE_DECL_ENVIRON@ HAVE_DECL_FCHDIR = @HAVE_DECL_FCHDIR@ +HAVE_DECL_FDATASYNC = @HAVE_DECL_FDATASYNC@ HAVE_DECL_GETDOMAINNAME = @HAVE_DECL_GETDOMAINNAME@ HAVE_DECL_GETLOADAVG = @HAVE_DECL_GETLOADAVG@ HAVE_DECL_GETLOGIN_R = @HAVE_DECL_GETLOGIN_R@ HAVE_DECL_GETPAGESIZE = @HAVE_DECL_GETPAGESIZE@ HAVE_DECL_GETUSERSHELL = @HAVE_DECL_GETUSERSHELL@ HAVE_DECL_SETENV = @HAVE_DECL_SETENV@ +HAVE_DECL_SETHOSTNAME = @HAVE_DECL_SETHOSTNAME@ +HAVE_DECL_STRNCASECMP = @HAVE_DECL_STRNCASECMP@ HAVE_DECL_TTYNAME_R = @HAVE_DECL_TTYNAME_R@ HAVE_DECL_UNSETENV = @HAVE_DECL_UNSETENV@ HAVE_DECL_WCTOB = @HAVE_DECL_WCTOB@ HAVE_DECL_WCWIDTH = @HAVE_DECL_WCWIDTH@ HAVE_DUP2 = @HAVE_DUP2@ HAVE_DUP3 = @HAVE_DUP3@ +HAVE_DUPLOCALE = @HAVE_DUPLOCALE@ HAVE_EUIDACCESS = @HAVE_EUIDACCESS@ HAVE_FACCESSAT = @HAVE_FACCESSAT@ HAVE_FCHDIR = @HAVE_FCHDIR@ HAVE_FCHOWNAT = @HAVE_FCHOWNAT@ +HAVE_FDATASYNC = @HAVE_FDATASYNC@ HAVE_FEATURES_H = @HAVE_FEATURES_H@ +HAVE_FFS = @HAVE_FFS@ HAVE_FSYNC = @HAVE_FSYNC@ HAVE_FTRUNCATE = @HAVE_FTRUNCATE@ HAVE_GETDTABLESIZE = @HAVE_GETDTABLESIZE@ @@ -321,6 +418,7 @@ HAVE_GETPAGESIZE = @HAVE_GETPAGESIZE@ HAVE_GETSUBOPT = @HAVE_GETSUBOPT@ HAVE_GRANTPT = @HAVE_GRANTPT@ +HAVE_GROUP_MEMBER = @HAVE_GROUP_MEMBER@ HAVE_INTTYPES_H = @HAVE_INTTYPES_H@ HAVE_ISWBLANK = @HAVE_ISWBLANK@ HAVE_ISWCNTRL = @HAVE_ISWCNTRL@ @@ -347,9 +445,12 @@ HAVE_OS_H = @HAVE_OS_H@ HAVE_PIPE = @HAVE_PIPE@ HAVE_PIPE2 = @HAVE_PIPE2@ +HAVE_POSIX_OPENPT = @HAVE_POSIX_OPENPT@ HAVE_PREAD = @HAVE_PREAD@ HAVE_PTSNAME = @HAVE_PTSNAME@ +HAVE_PTSNAME_R = @HAVE_PTSNAME_R@ HAVE_PWRITE = @HAVE_PWRITE@ +HAVE_RANDOM = @HAVE_RANDOM@ HAVE_RANDOM_H = @HAVE_RANDOM_H@ HAVE_RANDOM_R = @HAVE_RANDOM_R@ HAVE_READLINK = @HAVE_READLINK@ @@ -357,11 +458,14 @@ HAVE_REALPATH = @HAVE_REALPATH@ HAVE_RPMATCH = @HAVE_RPMATCH@ HAVE_SETENV = @HAVE_SETENV@ +HAVE_SETHOSTNAME = @HAVE_SETHOSTNAME@ HAVE_SIGNED_SIG_ATOMIC_T = @HAVE_SIGNED_SIG_ATOMIC_T@ HAVE_SIGNED_WCHAR_T = @HAVE_SIGNED_WCHAR_T@ HAVE_SIGNED_WINT_T = @HAVE_SIGNED_WINT_T@ HAVE_SLEEP = @HAVE_SLEEP@ HAVE_STDINT_H = @HAVE_STDINT_H@ +HAVE_STRCASECMP = @HAVE_STRCASECMP@ +HAVE_STRINGS_H = @HAVE_STRINGS_H@ HAVE_STRTOD = @HAVE_STRTOD@ HAVE_STRTOLL = @HAVE_STRTOLL@ HAVE_STRTOULL = @HAVE_STRTOULL@ @@ -380,11 +484,42 @@ HAVE_USLEEP = @HAVE_USLEEP@ HAVE_WCHAR_H = @HAVE_WCHAR_H@ HAVE_WCHAR_T = @HAVE_WCHAR_T@ +HAVE_WCPCPY = @HAVE_WCPCPY@ +HAVE_WCPNCPY = @HAVE_WCPNCPY@ HAVE_WCRTOMB = @HAVE_WCRTOMB@ +HAVE_WCSCASECMP = @HAVE_WCSCASECMP@ +HAVE_WCSCAT = @HAVE_WCSCAT@ +HAVE_WCSCHR = @HAVE_WCSCHR@ +HAVE_WCSCMP = @HAVE_WCSCMP@ +HAVE_WCSCOLL = @HAVE_WCSCOLL@ +HAVE_WCSCPY = @HAVE_WCSCPY@ +HAVE_WCSCSPN = @HAVE_WCSCSPN@ +HAVE_WCSDUP = @HAVE_WCSDUP@ +HAVE_WCSLEN = @HAVE_WCSLEN@ +HAVE_WCSNCASECMP = @HAVE_WCSNCASECMP@ +HAVE_WCSNCAT = @HAVE_WCSNCAT@ +HAVE_WCSNCMP = @HAVE_WCSNCMP@ +HAVE_WCSNCPY = @HAVE_WCSNCPY@ +HAVE_WCSNLEN = @HAVE_WCSNLEN@ HAVE_WCSNRTOMBS = @HAVE_WCSNRTOMBS@ +HAVE_WCSPBRK = @HAVE_WCSPBRK@ +HAVE_WCSRCHR = @HAVE_WCSRCHR@ HAVE_WCSRTOMBS = @HAVE_WCSRTOMBS@ +HAVE_WCSSPN = @HAVE_WCSSPN@ +HAVE_WCSSTR = @HAVE_WCSSTR@ +HAVE_WCSTOK = @HAVE_WCSTOK@ +HAVE_WCSWIDTH = @HAVE_WCSWIDTH@ +HAVE_WCSXFRM = @HAVE_WCSXFRM@ +HAVE_WCTRANS_T = @HAVE_WCTRANS_T@ HAVE_WCTYPE_H = @HAVE_WCTYPE_H@ +HAVE_WCTYPE_T = @HAVE_WCTYPE_T@ HAVE_WINT_T = @HAVE_WINT_T@ +HAVE_WMEMCHR = @HAVE_WMEMCHR@ +HAVE_WMEMCMP = @HAVE_WMEMCMP@ +HAVE_WMEMCPY = @HAVE_WMEMCPY@ +HAVE_WMEMMOVE = @HAVE_WMEMMOVE@ +HAVE_WMEMSET = @HAVE_WMEMSET@ +HAVE_XLOCALE_H = @HAVE_XLOCALE_H@ HAVE__BOOL = @HAVE__BOOL@ HAVE__EXIT = @HAVE__EXIT@ INCLUDE_NEXT = @INCLUDE_NEXT@ @@ -414,18 +549,25 @@ LTLIBINTL = @LTLIBINTL@ LTLIBOBJS = @LTLIBOBJS@ MAKEINFO = @MAKEINFO@ +MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ NEXT_AS_FIRST_DIRECTIVE_LANGINFO_H = @NEXT_AS_FIRST_DIRECTIVE_LANGINFO_H@ +NEXT_AS_FIRST_DIRECTIVE_LOCALE_H = @NEXT_AS_FIRST_DIRECTIVE_LOCALE_H@ NEXT_AS_FIRST_DIRECTIVE_STDDEF_H = @NEXT_AS_FIRST_DIRECTIVE_STDDEF_H@ NEXT_AS_FIRST_DIRECTIVE_STDINT_H = @NEXT_AS_FIRST_DIRECTIVE_STDINT_H@ NEXT_AS_FIRST_DIRECTIVE_STDLIB_H = @NEXT_AS_FIRST_DIRECTIVE_STDLIB_H@ +NEXT_AS_FIRST_DIRECTIVE_STRINGS_H = @NEXT_AS_FIRST_DIRECTIVE_STRINGS_H@ +NEXT_AS_FIRST_DIRECTIVE_SYS_TYPES_H = @NEXT_AS_FIRST_DIRECTIVE_SYS_TYPES_H@ NEXT_AS_FIRST_DIRECTIVE_UNISTD_H = @NEXT_AS_FIRST_DIRECTIVE_UNISTD_H@ NEXT_AS_FIRST_DIRECTIVE_WCHAR_H = @NEXT_AS_FIRST_DIRECTIVE_WCHAR_H@ NEXT_AS_FIRST_DIRECTIVE_WCTYPE_H = @NEXT_AS_FIRST_DIRECTIVE_WCTYPE_H@ NEXT_LANGINFO_H = @NEXT_LANGINFO_H@ +NEXT_LOCALE_H = @NEXT_LOCALE_H@ NEXT_STDDEF_H = @NEXT_STDDEF_H@ NEXT_STDINT_H = @NEXT_STDINT_H@ NEXT_STDLIB_H = @NEXT_STDLIB_H@ +NEXT_STRINGS_H = @NEXT_STRINGS_H@ +NEXT_SYS_TYPES_H = @NEXT_SYS_TYPES_H@ NEXT_UNISTD_H = @NEXT_UNISTD_H@ NEXT_WCHAR_H = @NEXT_WCHAR_H@ NEXT_WCTYPE_H = @NEXT_WCTYPE_H@ @@ -459,17 +601,21 @@ REPLACE_CLOSE = @REPLACE_CLOSE@ REPLACE_DUP = @REPLACE_DUP@ REPLACE_DUP2 = @REPLACE_DUP2@ +REPLACE_DUPLOCALE = @REPLACE_DUPLOCALE@ REPLACE_FCHOWNAT = @REPLACE_FCHOWNAT@ +REPLACE_FTRUNCATE = @REPLACE_FTRUNCATE@ REPLACE_GETCWD = @REPLACE_GETCWD@ REPLACE_GETDOMAINNAME = @REPLACE_GETDOMAINNAME@ REPLACE_GETGROUPS = @REPLACE_GETGROUPS@ REPLACE_GETLOGIN_R = @REPLACE_GETLOGIN_R@ REPLACE_GETPAGESIZE = @REPLACE_GETPAGESIZE@ +REPLACE_ISATTY = @REPLACE_ISATTY@ REPLACE_ISWBLANK = @REPLACE_ISWBLANK@ REPLACE_ISWCNTRL = @REPLACE_ISWCNTRL@ REPLACE_LCHOWN = @REPLACE_LCHOWN@ REPLACE_LINK = @REPLACE_LINK@ REPLACE_LINKAT = @REPLACE_LINKAT@ +REPLACE_LOCALECONV = @REPLACE_LOCALECONV@ REPLACE_LSEEK = @REPLACE_LSEEK@ REPLACE_MALLOC = @REPLACE_MALLOC@ REPLACE_MBRLEN = @REPLACE_MBRLEN@ @@ -478,20 +624,27 @@ REPLACE_MBSNRTOWCS = @REPLACE_MBSNRTOWCS@ REPLACE_MBSRTOWCS = @REPLACE_MBSRTOWCS@ REPLACE_MBSTATE_T = @REPLACE_MBSTATE_T@ +REPLACE_MBTOWC = @REPLACE_MBTOWC@ REPLACE_MKSTEMP = @REPLACE_MKSTEMP@ REPLACE_NL_LANGINFO = @REPLACE_NL_LANGINFO@ REPLACE_NULL = @REPLACE_NULL@ REPLACE_PREAD = @REPLACE_PREAD@ +REPLACE_PTSNAME_R = @REPLACE_PTSNAME_R@ REPLACE_PUTENV = @REPLACE_PUTENV@ REPLACE_PWRITE = @REPLACE_PWRITE@ +REPLACE_RANDOM_R = @REPLACE_RANDOM_R@ +REPLACE_READ = @REPLACE_READ@ REPLACE_READLINK = @REPLACE_READLINK@ REPLACE_REALLOC = @REPLACE_REALLOC@ REPLACE_REALPATH = @REPLACE_REALPATH@ REPLACE_RMDIR = @REPLACE_RMDIR@ REPLACE_SETENV = @REPLACE_SETENV@ +REPLACE_SETLOCALE = @REPLACE_SETLOCALE@ REPLACE_SLEEP = @REPLACE_SLEEP@ REPLACE_STRTOD = @REPLACE_STRTOD@ +REPLACE_STRUCT_LCONV = @REPLACE_STRUCT_LCONV@ REPLACE_SYMLINK = @REPLACE_SYMLINK@ +REPLACE_TOWLOWER = @REPLACE_TOWLOWER@ REPLACE_TTYNAME_R = @REPLACE_TTYNAME_R@ REPLACE_UNLINK = @REPLACE_UNLINK@ REPLACE_UNLINKAT = @REPLACE_UNLINKAT@ @@ -500,7 +653,9 @@ REPLACE_WCRTOMB = @REPLACE_WCRTOMB@ REPLACE_WCSNRTOMBS = @REPLACE_WCSNRTOMBS@ REPLACE_WCSRTOMBS = @REPLACE_WCSRTOMBS@ +REPLACE_WCSWIDTH = @REPLACE_WCSWIDTH@ REPLACE_WCTOB = @REPLACE_WCTOB@ +REPLACE_WCTOMB = @REPLACE_WCTOMB@ REPLACE_WCWIDTH = @REPLACE_WCWIDTH@ REPLACE_WRITE = @REPLACE_WRITE@ SED = @SED@ @@ -521,18 +676,16 @@ UUID_LIBS = @UUID_LIBS@ VERSION = @VERSION@ WCHAR_T_SUFFIX = @WCHAR_T_SUFFIX@ +WINDOWS_64_BIT_OFF_T = @WINDOWS_64_BIT_OFF_T@ WINT_T_SUFFIX = @WINT_T_SUFFIX@ XML2_CFLAGS = @XML2_CFLAGS@ XML2_LIBS = @XML2_LIBS@ -XML2_STATIC_LIBS = @XML2_STATIC_LIBS@ YACC = @YACC@ -ZLIB_CFLAGS = @ZLIB_CFLAGS@ -ZLIB_LDFLAGS = @ZLIB_LDFLAGS@ -ZLIB_LIBS = @ZLIB_LIBS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ +ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ @@ -574,7 +727,6 @@ lispdir = @lispdir@ localedir = @localedir@ localstatedir = @localstatedir@ -lt_ECHO = @lt_ECHO@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ @@ -597,15 +749,18 @@ noinst_HEADERS = noinst_LIBRARIES = noinst_LTLIBRARIES = libgnu.la -EXTRA_DIST = m4/gnulib-cache.m4 alloca.in.h \ - $(top_srcdir)/conf/arg-nonnull.h btowc.c \ - $(top_srcdir)/conf/c++defs.h langinfo.in.h config.charset \ - ref-add.sin ref-del.sin malloc.c malloc.c mbrtowc.c mbsinit.c \ - nl_langinfo.c regcomp.c regex.c regex.h regex_internal.c \ - regex_internal.h regexec.c stdbool.in.h stddef.in.h \ - stdint.in.h stdlib.in.h streq.h unistd.in.h \ - $(top_srcdir)/conf/warn-on-use.h wchar.in.h wcrtomb.c \ - iswblank.c wctype.in.h +EXTRA_DIST = m4/gnulib-cache.m4 alloca.in.h btowc.c byteswap.in.h \ + langinfo.in.h config.charset ref-add.sin ref-del.sin \ + locale.in.h localeconv.c malloc.c malloc.c mbrtowc.c mbsinit.c \ + mbtowc-impl.h mbtowc.c nl_langinfo.c regcomp.c regex.c regex.h \ + regex_internal.c regex_internal.h regexec.c \ + $(top_srcdir)/conf/snippet/_Noreturn.h \ + $(top_srcdir)/conf/snippet/arg-nonnull.h \ + $(top_srcdir)/conf/snippet/c++defs.h \ + $(top_srcdir)/conf/snippet/warn-on-use.h stdbool.in.h \ + stddef.in.h stdint.in.h stdlib.in.h strcasecmp.c strncasecmp.c \ + streq.h strings.in.h sys_types.in.h unistd.in.h verify.h \ + wchar.in.h wcrtomb.c wctype.in.h # The BUILT_SOURCES created by this Makefile snippet are not used via #include # statements but through direct file reference. Therefore this snippet must be @@ -616,15 +771,18 @@ # statements but through direct file reference. Therefore this snippet must be # present in all Makefile.am that need it. This is ensured by the applicability # 'all' defined above. -BUILT_SOURCES = $(ALLOCA_H) arg-nonnull.h c++defs.h configmake.h \ - langinfo.h $(STDBOOL_H) $(STDDEF_H) $(STDINT_H) stdlib.h \ - unistd.h warn-on-use.h wchar.h wctype.h +BUILT_SOURCES = $(ALLOCA_H) $(BYTESWAP_H) configmake.h langinfo.h \ + locale.h arg-nonnull.h c++defs.h warn-on-use.h $(STDBOOL_H) \ + $(STDDEF_H) $(STDINT_H) stdlib.h strings.h sys/types.h \ + unistd.h wchar.h wctype.h SUFFIXES = .sed .sin -MOSTLYCLEANFILES = core *.stackdump alloca.h alloca.h-t arg-nonnull.h \ - arg-nonnull.h-t c++defs.h c++defs.h-t langinfo.h langinfo.h-t \ - stdbool.h stdbool.h-t stddef.h stddef.h-t stdint.h stdint.h-t \ - stdlib.h stdlib.h-t unistd.h unistd.h-t warn-on-use.h \ - warn-on-use.h-t wchar.h wchar.h-t wctype.h wctype.h-t +MOSTLYCLEANFILES = core *.stackdump alloca.h alloca.h-t byteswap.h \ + byteswap.h-t langinfo.h langinfo.h-t locale.h locale.h-t \ + arg-nonnull.h arg-nonnull.h-t c++defs.h c++defs.h-t \ + warn-on-use.h warn-on-use.h-t stdbool.h stdbool.h-t stddef.h \ + stddef.h-t stdint.h stdint.h-t stdlib.h stdlib.h-t strings.h \ + strings.h-t sys/types.h sys/types.h-t unistd.h unistd.h-t \ + wchar.h wchar.h-t wctype.h wctype.h-t MOSTLYCLEANDIRS = CLEANFILES = configmake.h configmake.h-t charset.alias ref-add.sed \ ref-del.sed @@ -632,17 +790,23 @@ MAINTAINERCLEANFILES = AM_CPPFLAGS = AM_CFLAGS = -libgnu_la_SOURCES = gettext.h localcharset.h localcharset.c verify.h +libgnu_la_SOURCES = gettext.h localcharset.h localcharset.c libgnu_la_LIBADD = $(gl_LTLIBOBJS) libgnu_la_DEPENDENCIES = $(gl_LTLIBOBJS) -EXTRA_libgnu_la_SOURCES = btowc.c malloc.c malloc.c mbrtowc.c \ - mbsinit.c nl_langinfo.c regcomp.c regex.c regex_internal.c \ - regexec.c wcrtomb.c iswblank.c +EXTRA_libgnu_la_SOURCES = btowc.c localeconv.c malloc.c malloc.c \ + mbrtowc.c mbsinit.c mbtowc.c nl_langinfo.c regcomp.c regex.c \ + regex_internal.c regexec.c strcasecmp.c strncasecmp.c \ + wcrtomb.c libgnu_la_LDFLAGS = $(AM_LDFLAGS) -no-undefined $(LTLIBINTL) -ARG_NONNULL_H = arg-nonnull.h -CXXDEFS_H = c++defs.h charset_alias = $(DESTDIR)$(libdir)/charset.alias charset_tmp = $(DESTDIR)$(libdir)/charset.tmp + +# Because this Makefile snippet defines a variable used by other +# gnulib Makefile snippets, it must be present in all Makefile.am that +# need it. This is ensured by the applicability 'all' defined above. +_NORETURN_H = $(top_srcdir)/conf/snippet/_Noreturn.h +ARG_NONNULL_H = arg-nonnull.h +CXXDEFS_H = c++defs.h WARN_ON_USE_H = warn-on-use.h all: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) all-recursive @@ -685,13 +849,15 @@ clean-noinstLTLIBRARIES: -test -z "$(noinst_LTLIBRARIES)" || rm -f $(noinst_LTLIBRARIES) - @list='$(noinst_LTLIBRARIES)'; for p in $$list; do \ - dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \ - test "$$dir" != "$$p" || dir=.; \ - echo "rm -f \"$${dir}/so_locations\""; \ - rm -f "$${dir}/so_locations"; \ - done -libgnu.la: $(libgnu_la_OBJECTS) $(libgnu_la_DEPENDENCIES) + @list='$(noinst_LTLIBRARIES)'; \ + locs=`for p in $$list; do echo $$p; done | \ + sed 's|^[^/]*$$|.|; s|/[^/]*$$||; s|$$|/so_locations|' | \ + sort -u`; \ + test -z "$$locs" || { \ + echo rm -f $${locs}; \ + rm -f $${locs}; \ + } +libgnu.la: $(libgnu_la_OBJECTS) $(libgnu_la_DEPENDENCIES) $(EXTRA_libgnu_la_DEPENDENCIES) $(libgnu_la_LINK) $(libgnu_la_OBJECTS) $(libgnu_la_LIBADD) $(LIBS) mostlyclean-compile: @@ -701,16 +867,19 @@ -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/btowc.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/iswblank.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/localcharset.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/localeconv.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/malloc.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mbrtowc.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mbsinit.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mbtowc.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/nl_langinfo.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/regcomp.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/regex.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/regex_internal.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/regexec.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strcasecmp.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strncasecmp.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/wcrtomb.Plo@am__quote@ .c.o: @@ -741,13 +910,13 @@ -rm -rf .libs _libs # This directory's subdirectories are mostly independent; you can cd -# into them and run `make' without going through this Makefile. -# To change the values of `make' variables: instead of editing Makefiles, -# (1) if the variable is set in `config.status', edit `config.status' -# (which will cause the Makefiles to be regenerated when you run `make'); -# (2) otherwise, pass the desired values on the `make' command line. +# into them and run 'make' without going through this Makefile. +# To change the values of 'make' variables: instead of editing Makefiles, +# (1) if the variable is set in 'config.status', edit 'config.status' +# (which will cause the Makefiles to be regenerated when you run 'make'); +# (2) otherwise, pass the desired values on the 'make' command line. $(RECURSIVE_TARGETS): - @failcom='exit 1'; \ + @fail= failcom='exit 1'; \ for f in x $$MAKEFLAGS; do \ case $$f in \ *=* | --[!k]*);; \ @@ -772,7 +941,7 @@ fi; test -z "$$fail" $(RECURSIVE_CLEAN_TARGETS): - @failcom='exit 1'; \ + @fail= failcom='exit 1'; \ for f in x $$MAKEFLAGS; do \ case $$f in \ *=* | --[!k]*);; \ @@ -809,6 +978,10 @@ list='$(SUBDIRS)'; for subdir in $$list; do \ test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \ done +cscopelist-recursive: + list='$(SUBDIRS)'; for subdir in $$list; do \ + test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) cscopelist); \ + done ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ @@ -872,6 +1045,20 @@ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" +cscopelist: cscopelist-recursive $(HEADERS) $(SOURCES) $(LISP) + list='$(SOURCES) $(HEADERS) $(LISP)'; \ + case "$(srcdir)" in \ + [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ + *) sdir=$(subdir)/$(srcdir) ;; \ + esac; \ + for i in $$list; do \ + if test -f "$$i"; then \ + echo "$(subdir)/$$i"; \ + else \ + echo "$$sdir/$$i"; \ + fi; \ + done >> $(top_builddir)/cscope.files + distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags @@ -907,13 +1094,10 @@ done @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ - test -d "$(distdir)/$$subdir" \ - || $(MKDIR_P) "$(distdir)/$$subdir" \ - || exit 1; \ - fi; \ - done - @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ - if test "$$subdir" = .; then :; else \ + $(am__make_dryrun) \ + || test -d "$(distdir)/$$subdir" \ + || $(MKDIR_P) "$(distdir)/$$subdir" \ + || exit 1; \ dir1=$$subdir; dir2="$(distdir)/$$subdir"; \ $(am__relativize); \ new_distdir=$$reldir; \ @@ -950,10 +1134,15 @@ installcheck: installcheck-recursive install-strip: - $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ - install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ - `test -z '$(STRIP)' || \ - echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install + if test -z '$(STRIP)'; then \ + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + install; \ + else \ + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ + fi mostlyclean-generic: -test -z "$(MOSTLYCLEANFILES)" || rm -f $(MOSTLYCLEANFILES) @@ -1042,17 +1231,18 @@ uninstall-am: uninstall-local .MAKE: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) all check \ - ctags-recursive install install-am install-strip \ - tags-recursive + cscopelist-recursive ctags-recursive install install-am \ + install-strip tags-recursive .PHONY: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) CTAGS GTAGS \ all all-am all-local check check-am clean clean-generic \ clean-libtool clean-noinstLIBRARIES clean-noinstLTLIBRARIES \ - ctags ctags-recursive distclean distclean-compile \ - distclean-generic distclean-libtool distclean-tags distdir dvi \ - dvi-am html html-am info info-am install install-am \ - install-data install-data-am install-dvi install-dvi-am \ - install-exec install-exec-am install-exec-local install-html \ + cscopelist cscopelist-recursive ctags ctags-recursive \ + distclean distclean-compile distclean-generic \ + distclean-libtool distclean-tags distdir dvi dvi-am html \ + html-am info info-am install install-am install-data \ + install-data-am install-dvi install-dvi-am install-exec \ + install-exec-am install-exec-local install-html \ install-html-am install-info install-info-am install-man \ install-pdf install-pdf-am install-ps install-ps-am \ install-strip installcheck installcheck-am installdirs \ @@ -1064,28 +1254,25 @@ # We need the following in order to create when the system # doesn't have one that works with the given compiler. -alloca.h: alloca.in.h - $(AM_V_GEN)rm -f $@-t $@ && \ - { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \ - cat $(srcdir)/alloca.in.h; \ - } > $@-t && \ - mv -f $@-t $@ -# The arg-nonnull.h that gets inserted into generated .h files is the same as -# build-aux/arg-nonnull.h, except that it has the copyright header cut off. -arg-nonnull.h: $(top_srcdir)/conf/arg-nonnull.h - $(AM_V_GEN)rm -f $@-t $@ && \ - sed -n -e '/GL_ARG_NONNULL/,$$p' \ - < $(top_srcdir)/conf/arg-nonnull.h \ - > $@-t && \ - mv $@-t $@ -# The c++defs.h that gets inserted into generated .h files is the same as -# build-aux/c++defs.h, except that it has the copyright header cut off. -c++defs.h: $(top_srcdir)/conf/c++defs.h - $(AM_V_GEN)rm -f $@-t $@ && \ - sed -n -e '/_GL_CXXDEFS/,$$p' \ - < $(top_srcdir)/conf/c++defs.h \ - > $@-t && \ - mv $@-t $@ +@GL_GENERATE_ALLOCA_H_TRUE@alloca.h: alloca.in.h $(top_builddir)/config.status +@GL_GENERATE_ALLOCA_H_TRUE@ $(AM_V_GEN)rm -f $@-t $@ && \ +@GL_GENERATE_ALLOCA_H_TRUE@ { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \ +@GL_GENERATE_ALLOCA_H_TRUE@ cat $(srcdir)/alloca.in.h; \ +@GL_GENERATE_ALLOCA_H_TRUE@ } > $@-t && \ +@GL_GENERATE_ALLOCA_H_TRUE@ mv -f $@-t $@ +@GL_GENERATE_ALLOCA_H_FALSE@alloca.h: $(top_builddir)/config.status +@GL_GENERATE_ALLOCA_H_FALSE@ rm -f $@ + +# We need the following in order to create when the system +# doesn't have one. +@GL_GENERATE_BYTESWAP_H_TRUE@byteswap.h: byteswap.in.h $(top_builddir)/config.status +@GL_GENERATE_BYTESWAP_H_TRUE@ $(AM_V_GEN)rm -f $@-t $@ && \ +@GL_GENERATE_BYTESWAP_H_TRUE@ { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \ +@GL_GENERATE_BYTESWAP_H_TRUE@ cat $(srcdir)/byteswap.in.h; \ +@GL_GENERATE_BYTESWAP_H_TRUE@ } > $@-t && \ +@GL_GENERATE_BYTESWAP_H_TRUE@ mv -f $@-t $@ +@GL_GENERATE_BYTESWAP_H_FALSE@byteswap.h: $(top_builddir)/config.status +@GL_GENERATE_BYTESWAP_H_FALSE@ rm -f $@ # Listed in the same order as the GNU makefile conventions, and # provided by autoconf 2.59c+. @@ -1122,23 +1309,20 @@ echo '#define PKGLIBDIR "$(pkglibdir)"'; \ echo '#define PKGLIBEXECDIR "$(pkglibexecdir)"'; \ } | sed '/""/d' > $@-t && \ - if test -f $@ && cmp $@-t $@ > /dev/null; then \ - rm -f $@-t; \ - else \ - rm -f $@; mv $@-t $@; \ - fi + mv -f $@-t $@ # We need the following in order to create an empty placeholder for # when the system doesn't have one. -langinfo.h: langinfo.in.h $(CXXDEFS_H) $(WARN_ON_USE_H) +langinfo.h: langinfo.in.h $(top_builddir)/config.status $(CXXDEFS_H) $(WARN_ON_USE_H) $(AM_V_GEN)rm -f $@-t $@ && \ { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \ - sed -e 's|@''HAVE_LANGINFO_H''@|$(HAVE_LANGINFO_H)|g' \ + sed -e 's|@''GUARD_PREFIX''@|GL|g' \ + -e 's|@''HAVE_LANGINFO_H''@|$(HAVE_LANGINFO_H)|g' \ -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \ -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \ -e 's|@''PRAGMA_COLUMNS''@|@PRAGMA_COLUMNS@|g' \ -e 's|@''NEXT_LANGINFO_H''@|$(NEXT_LANGINFO_H)|g' \ - -e 's|@''GNULIB_NL_LANGINFO''@|$(GNULIB_NL_LANGINFO)|g' \ + -e 's/@''GNULIB_NL_LANGINFO''@/$(GNULIB_NL_LANGINFO)/g' \ -e 's|@''HAVE_LANGINFO_CODESET''@|$(HAVE_LANGINFO_CODESET)|g' \ -e 's|@''HAVE_LANGINFO_T_FMT_AMPM''@|$(HAVE_LANGINFO_T_FMT_AMPM)|g' \ -e 's|@''HAVE_LANGINFO_ERA''@|$(HAVE_LANGINFO_ERA)|g' \ @@ -1210,100 +1394,169 @@ sed -e '/^#/d' -e 's/@''PACKAGE''@/$(PACKAGE)/g' $< > t-$@ && \ mv t-$@ $@ -# We need the following in order to create when the system -# doesn't have one that works. -stdbool.h: stdbool.in.h - $(AM_V_GEN)rm -f $@-t $@ && \ - { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \ - sed -e 's/@''HAVE__BOOL''@/$(HAVE__BOOL)/g' < $(srcdir)/stdbool.in.h; \ - } > $@-t && \ - mv $@-t $@ - -# We need the following in order to create when the system -# doesn't have one that works with the given compiler. -stddef.h: stddef.in.h +# We need the following in order to create when the system +# doesn't have one that provides all definitions. +locale.h: locale.in.h $(top_builddir)/config.status $(CXXDEFS_H) $(ARG_NONNULL_H) $(WARN_ON_USE_H) $(AM_V_GEN)rm -f $@-t $@ && \ { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */' && \ - sed -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \ + sed -e 's|@''GUARD_PREFIX''@|GL|g' \ + -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \ -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \ -e 's|@''PRAGMA_COLUMNS''@|@PRAGMA_COLUMNS@|g' \ - -e 's|@''NEXT_STDDEF_H''@|$(NEXT_STDDEF_H)|g' \ - -e 's|@''HAVE_WCHAR_T''@|$(HAVE_WCHAR_T)|g' \ - -e 's|@''REPLACE_NULL''@|$(REPLACE_NULL)|g' \ - < $(srcdir)/stddef.in.h; \ + -e 's|@''NEXT_LOCALE_H''@|$(NEXT_LOCALE_H)|g' \ + -e 's/@''GNULIB_LOCALECONV''@/$(GNULIB_LOCALECONV)/g' \ + -e 's/@''GNULIB_SETLOCALE''@/$(GNULIB_SETLOCALE)/g' \ + -e 's/@''GNULIB_DUPLOCALE''@/$(GNULIB_DUPLOCALE)/g' \ + -e 's|@''HAVE_DUPLOCALE''@|$(HAVE_DUPLOCALE)|g' \ + -e 's|@''HAVE_XLOCALE_H''@|$(HAVE_XLOCALE_H)|g' \ + -e 's|@''REPLACE_LOCALECONV''@|$(REPLACE_LOCALECONV)|g' \ + -e 's|@''REPLACE_SETLOCALE''@|$(REPLACE_SETLOCALE)|g' \ + -e 's|@''REPLACE_DUPLOCALE''@|$(REPLACE_DUPLOCALE)|g' \ + -e 's|@''REPLACE_STRUCT_LCONV''@|$(REPLACE_STRUCT_LCONV)|g' \ + -e '/definitions of _GL_FUNCDECL_RPL/r $(CXXDEFS_H)' \ + -e '/definition of _GL_ARG_NONNULL/r $(ARG_NONNULL_H)' \ + -e '/definition of _GL_WARN_ON_USE/r $(WARN_ON_USE_H)' \ + < $(srcdir)/locale.in.h; \ } > $@-t && \ mv $@-t $@ +# The arg-nonnull.h that gets inserted into generated .h files is the same as +# build-aux/snippet/arg-nonnull.h, except that it has the copyright header cut +# off. +arg-nonnull.h: $(top_srcdir)/conf/snippet/arg-nonnull.h + $(AM_V_GEN)rm -f $@-t $@ && \ + sed -n -e '/GL_ARG_NONNULL/,$$p' \ + < $(top_srcdir)/conf/snippet/arg-nonnull.h \ + > $@-t && \ + mv $@-t $@ +# The c++defs.h that gets inserted into generated .h files is the same as +# build-aux/snippet/c++defs.h, except that it has the copyright header cut off. +c++defs.h: $(top_srcdir)/conf/snippet/c++defs.h + $(AM_V_GEN)rm -f $@-t $@ && \ + sed -n -e '/_GL_CXXDEFS/,$$p' \ + < $(top_srcdir)/conf/snippet/c++defs.h \ + > $@-t && \ + mv $@-t $@ +# The warn-on-use.h that gets inserted into generated .h files is the same as +# build-aux/snippet/warn-on-use.h, except that it has the copyright header cut +# off. +warn-on-use.h: $(top_srcdir)/conf/snippet/warn-on-use.h + $(AM_V_GEN)rm -f $@-t $@ && \ + sed -n -e '/^.ifndef/,$$p' \ + < $(top_srcdir)/conf/snippet/warn-on-use.h \ + > $@-t && \ + mv $@-t $@ + +# We need the following in order to create when the system +# doesn't have one that works. +@GL_GENERATE_STDBOOL_H_TRUE@stdbool.h: stdbool.in.h $(top_builddir)/config.status +@GL_GENERATE_STDBOOL_H_TRUE@ $(AM_V_GEN)rm -f $@-t $@ && \ +@GL_GENERATE_STDBOOL_H_TRUE@ { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \ +@GL_GENERATE_STDBOOL_H_TRUE@ sed -e 's/@''HAVE__BOOL''@/$(HAVE__BOOL)/g' < $(srcdir)/stdbool.in.h; \ +@GL_GENERATE_STDBOOL_H_TRUE@ } > $@-t && \ +@GL_GENERATE_STDBOOL_H_TRUE@ mv $@-t $@ +@GL_GENERATE_STDBOOL_H_FALSE@stdbool.h: $(top_builddir)/config.status +@GL_GENERATE_STDBOOL_H_FALSE@ rm -f $@ + +# We need the following in order to create when the system +# doesn't have one that works with the given compiler. +@GL_GENERATE_STDDEF_H_TRUE@stddef.h: stddef.in.h $(top_builddir)/config.status +@GL_GENERATE_STDDEF_H_TRUE@ $(AM_V_GEN)rm -f $@-t $@ && \ +@GL_GENERATE_STDDEF_H_TRUE@ { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */' && \ +@GL_GENERATE_STDDEF_H_TRUE@ sed -e 's|@''GUARD_PREFIX''@|GL|g' \ +@GL_GENERATE_STDDEF_H_TRUE@ -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \ +@GL_GENERATE_STDDEF_H_TRUE@ -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \ +@GL_GENERATE_STDDEF_H_TRUE@ -e 's|@''PRAGMA_COLUMNS''@|@PRAGMA_COLUMNS@|g' \ +@GL_GENERATE_STDDEF_H_TRUE@ -e 's|@''NEXT_STDDEF_H''@|$(NEXT_STDDEF_H)|g' \ +@GL_GENERATE_STDDEF_H_TRUE@ -e 's|@''HAVE_WCHAR_T''@|$(HAVE_WCHAR_T)|g' \ +@GL_GENERATE_STDDEF_H_TRUE@ -e 's|@''REPLACE_NULL''@|$(REPLACE_NULL)|g' \ +@GL_GENERATE_STDDEF_H_TRUE@ < $(srcdir)/stddef.in.h; \ +@GL_GENERATE_STDDEF_H_TRUE@ } > $@-t && \ +@GL_GENERATE_STDDEF_H_TRUE@ mv $@-t $@ +@GL_GENERATE_STDDEF_H_FALSE@stddef.h: $(top_builddir)/config.status +@GL_GENERATE_STDDEF_H_FALSE@ rm -f $@ # We need the following in order to create when the system # doesn't have one that works with the given compiler. -stdint.h: stdint.in.h - $(AM_V_GEN)rm -f $@-t $@ && \ - { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \ - sed -e 's/@''HAVE_STDINT_H''@/$(HAVE_STDINT_H)/g' \ - -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \ - -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \ - -e 's|@''PRAGMA_COLUMNS''@|@PRAGMA_COLUMNS@|g' \ - -e 's|@''NEXT_STDINT_H''@|$(NEXT_STDINT_H)|g' \ - -e 's/@''HAVE_SYS_TYPES_H''@/$(HAVE_SYS_TYPES_H)/g' \ - -e 's/@''HAVE_INTTYPES_H''@/$(HAVE_INTTYPES_H)/g' \ - -e 's/@''HAVE_SYS_INTTYPES_H''@/$(HAVE_SYS_INTTYPES_H)/g' \ - -e 's/@''HAVE_SYS_BITYPES_H''@/$(HAVE_SYS_BITYPES_H)/g' \ - -e 's/@''HAVE_LONG_LONG_INT''@/$(HAVE_LONG_LONG_INT)/g' \ - -e 's/@''HAVE_UNSIGNED_LONG_LONG_INT''@/$(HAVE_UNSIGNED_LONG_LONG_INT)/g' \ - -e 's/@''APPLE_UNIVERSAL_BUILD''@/$(APPLE_UNIVERSAL_BUILD)/g' \ - -e 's/@''BITSIZEOF_PTRDIFF_T''@/$(BITSIZEOF_PTRDIFF_T)/g' \ - -e 's/@''PTRDIFF_T_SUFFIX''@/$(PTRDIFF_T_SUFFIX)/g' \ - -e 's/@''BITSIZEOF_SIG_ATOMIC_T''@/$(BITSIZEOF_SIG_ATOMIC_T)/g' \ - -e 's/@''HAVE_SIGNED_SIG_ATOMIC_T''@/$(HAVE_SIGNED_SIG_ATOMIC_T)/g' \ - -e 's/@''SIG_ATOMIC_T_SUFFIX''@/$(SIG_ATOMIC_T_SUFFIX)/g' \ - -e 's/@''BITSIZEOF_SIZE_T''@/$(BITSIZEOF_SIZE_T)/g' \ - -e 's/@''SIZE_T_SUFFIX''@/$(SIZE_T_SUFFIX)/g' \ - -e 's/@''BITSIZEOF_WCHAR_T''@/$(BITSIZEOF_WCHAR_T)/g' \ - -e 's/@''HAVE_SIGNED_WCHAR_T''@/$(HAVE_SIGNED_WCHAR_T)/g' \ - -e 's/@''WCHAR_T_SUFFIX''@/$(WCHAR_T_SUFFIX)/g' \ - -e 's/@''BITSIZEOF_WINT_T''@/$(BITSIZEOF_WINT_T)/g' \ - -e 's/@''HAVE_SIGNED_WINT_T''@/$(HAVE_SIGNED_WINT_T)/g' \ - -e 's/@''WINT_T_SUFFIX''@/$(WINT_T_SUFFIX)/g' \ - < $(srcdir)/stdint.in.h; \ - } > $@-t && \ - mv $@-t $@ +@GL_GENERATE_STDINT_H_TRUE@stdint.h: stdint.in.h $(top_builddir)/config.status +@GL_GENERATE_STDINT_H_TRUE@ $(AM_V_GEN)rm -f $@-t $@ && \ +@GL_GENERATE_STDINT_H_TRUE@ { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \ +@GL_GENERATE_STDINT_H_TRUE@ sed -e 's|@''GUARD_PREFIX''@|GL|g' \ +@GL_GENERATE_STDINT_H_TRUE@ -e 's/@''HAVE_STDINT_H''@/$(HAVE_STDINT_H)/g' \ +@GL_GENERATE_STDINT_H_TRUE@ -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \ +@GL_GENERATE_STDINT_H_TRUE@ -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \ +@GL_GENERATE_STDINT_H_TRUE@ -e 's|@''PRAGMA_COLUMNS''@|@PRAGMA_COLUMNS@|g' \ +@GL_GENERATE_STDINT_H_TRUE@ -e 's|@''NEXT_STDINT_H''@|$(NEXT_STDINT_H)|g' \ +@GL_GENERATE_STDINT_H_TRUE@ -e 's/@''HAVE_SYS_TYPES_H''@/$(HAVE_SYS_TYPES_H)/g' \ +@GL_GENERATE_STDINT_H_TRUE@ -e 's/@''HAVE_INTTYPES_H''@/$(HAVE_INTTYPES_H)/g' \ +@GL_GENERATE_STDINT_H_TRUE@ -e 's/@''HAVE_SYS_INTTYPES_H''@/$(HAVE_SYS_INTTYPES_H)/g' \ +@GL_GENERATE_STDINT_H_TRUE@ -e 's/@''HAVE_SYS_BITYPES_H''@/$(HAVE_SYS_BITYPES_H)/g' \ +@GL_GENERATE_STDINT_H_TRUE@ -e 's/@''HAVE_WCHAR_H''@/$(HAVE_WCHAR_H)/g' \ +@GL_GENERATE_STDINT_H_TRUE@ -e 's/@''HAVE_LONG_LONG_INT''@/$(HAVE_LONG_LONG_INT)/g' \ +@GL_GENERATE_STDINT_H_TRUE@ -e 's/@''HAVE_UNSIGNED_LONG_LONG_INT''@/$(HAVE_UNSIGNED_LONG_LONG_INT)/g' \ +@GL_GENERATE_STDINT_H_TRUE@ -e 's/@''APPLE_UNIVERSAL_BUILD''@/$(APPLE_UNIVERSAL_BUILD)/g' \ +@GL_GENERATE_STDINT_H_TRUE@ -e 's/@''BITSIZEOF_PTRDIFF_T''@/$(BITSIZEOF_PTRDIFF_T)/g' \ +@GL_GENERATE_STDINT_H_TRUE@ -e 's/@''PTRDIFF_T_SUFFIX''@/$(PTRDIFF_T_SUFFIX)/g' \ +@GL_GENERATE_STDINT_H_TRUE@ -e 's/@''BITSIZEOF_SIG_ATOMIC_T''@/$(BITSIZEOF_SIG_ATOMIC_T)/g' \ +@GL_GENERATE_STDINT_H_TRUE@ -e 's/@''HAVE_SIGNED_SIG_ATOMIC_T''@/$(HAVE_SIGNED_SIG_ATOMIC_T)/g' \ +@GL_GENERATE_STDINT_H_TRUE@ -e 's/@''SIG_ATOMIC_T_SUFFIX''@/$(SIG_ATOMIC_T_SUFFIX)/g' \ +@GL_GENERATE_STDINT_H_TRUE@ -e 's/@''BITSIZEOF_SIZE_T''@/$(BITSIZEOF_SIZE_T)/g' \ +@GL_GENERATE_STDINT_H_TRUE@ -e 's/@''SIZE_T_SUFFIX''@/$(SIZE_T_SUFFIX)/g' \ +@GL_GENERATE_STDINT_H_TRUE@ -e 's/@''BITSIZEOF_WCHAR_T''@/$(BITSIZEOF_WCHAR_T)/g' \ +@GL_GENERATE_STDINT_H_TRUE@ -e 's/@''HAVE_SIGNED_WCHAR_T''@/$(HAVE_SIGNED_WCHAR_T)/g' \ +@GL_GENERATE_STDINT_H_TRUE@ -e 's/@''WCHAR_T_SUFFIX''@/$(WCHAR_T_SUFFIX)/g' \ +@GL_GENERATE_STDINT_H_TRUE@ -e 's/@''BITSIZEOF_WINT_T''@/$(BITSIZEOF_WINT_T)/g' \ +@GL_GENERATE_STDINT_H_TRUE@ -e 's/@''HAVE_SIGNED_WINT_T''@/$(HAVE_SIGNED_WINT_T)/g' \ +@GL_GENERATE_STDINT_H_TRUE@ -e 's/@''WINT_T_SUFFIX''@/$(WINT_T_SUFFIX)/g' \ +@GL_GENERATE_STDINT_H_TRUE@ < $(srcdir)/stdint.in.h; \ +@GL_GENERATE_STDINT_H_TRUE@ } > $@-t && \ +@GL_GENERATE_STDINT_H_TRUE@ mv $@-t $@ +@GL_GENERATE_STDINT_H_FALSE@stdint.h: $(top_builddir)/config.status +@GL_GENERATE_STDINT_H_FALSE@ rm -f $@ # We need the following in order to create when the system # doesn't have one that works with the given compiler. -stdlib.h: stdlib.in.h $(CXXDEFS_H) $(ARG_NONNULL_H) $(WARN_ON_USE_H) +stdlib.h: stdlib.in.h $(top_builddir)/config.status $(CXXDEFS_H) \ + $(_NORETURN_H) $(ARG_NONNULL_H) $(WARN_ON_USE_H) $(AM_V_GEN)rm -f $@-t $@ && \ { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */' && \ - sed -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \ + sed -e 's|@''GUARD_PREFIX''@|GL|g' \ + -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \ -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \ -e 's|@''PRAGMA_COLUMNS''@|@PRAGMA_COLUMNS@|g' \ -e 's|@''NEXT_STDLIB_H''@|$(NEXT_STDLIB_H)|g' \ - -e 's|@''GNULIB__EXIT''@|$(GNULIB__EXIT)|g' \ - -e 's|@''GNULIB_ATOLL''@|$(GNULIB_ATOLL)|g' \ - -e 's|@''GNULIB_CALLOC_POSIX''@|$(GNULIB_CALLOC_POSIX)|g' \ - -e 's|@''GNULIB_CANONICALIZE_FILE_NAME''@|$(GNULIB_CANONICALIZE_FILE_NAME)|g' \ - -e 's|@''GNULIB_GETLOADAVG''@|$(GNULIB_GETLOADAVG)|g' \ - -e 's|@''GNULIB_GETSUBOPT''@|$(GNULIB_GETSUBOPT)|g' \ - -e 's|@''GNULIB_GRANTPT''@|$(GNULIB_GRANTPT)|g' \ - -e 's|@''GNULIB_MALLOC_POSIX''@|$(GNULIB_MALLOC_POSIX)|g' \ - -e 's|@''GNULIB_MKDTEMP''@|$(GNULIB_MKDTEMP)|g' \ - -e 's|@''GNULIB_MKOSTEMP''@|$(GNULIB_MKOSTEMP)|g' \ - -e 's|@''GNULIB_MKOSTEMPS''@|$(GNULIB_MKOSTEMPS)|g' \ - -e 's|@''GNULIB_MKSTEMP''@|$(GNULIB_MKSTEMP)|g' \ - -e 's|@''GNULIB_MKSTEMPS''@|$(GNULIB_MKSTEMPS)|g' \ - -e 's|@''GNULIB_PTSNAME''@|$(GNULIB_PTSNAME)|g' \ - -e 's|@''GNULIB_PUTENV''@|$(GNULIB_PUTENV)|g' \ - -e 's|@''GNULIB_RANDOM_R''@|$(GNULIB_RANDOM_R)|g' \ - -e 's|@''GNULIB_REALLOC_POSIX''@|$(GNULIB_REALLOC_POSIX)|g' \ - -e 's|@''GNULIB_REALPATH''@|$(GNULIB_REALPATH)|g' \ - -e 's|@''GNULIB_RPMATCH''@|$(GNULIB_RPMATCH)|g' \ - -e 's|@''GNULIB_SETENV''@|$(GNULIB_SETENV)|g' \ - -e 's|@''GNULIB_STRTOD''@|$(GNULIB_STRTOD)|g' \ - -e 's|@''GNULIB_STRTOLL''@|$(GNULIB_STRTOLL)|g' \ - -e 's|@''GNULIB_STRTOULL''@|$(GNULIB_STRTOULL)|g' \ - -e 's|@''GNULIB_SYSTEM_POSIX''@|$(GNULIB_SYSTEM_POSIX)|g' \ - -e 's|@''GNULIB_UNLOCKPT''@|$(GNULIB_UNLOCKPT)|g' \ - -e 's|@''GNULIB_UNSETENV''@|$(GNULIB_UNSETENV)|g' \ - -e 's|@''HAVE__EXIT''@|$(HAVE__EXIT)|g' \ + -e 's/@''GNULIB__EXIT''@/$(GNULIB__EXIT)/g' \ + -e 's/@''GNULIB_ATOLL''@/$(GNULIB_ATOLL)/g' \ + -e 's/@''GNULIB_CALLOC_POSIX''@/$(GNULIB_CALLOC_POSIX)/g' \ + -e 's/@''GNULIB_CANONICALIZE_FILE_NAME''@/$(GNULIB_CANONICALIZE_FILE_NAME)/g' \ + -e 's/@''GNULIB_GETLOADAVG''@/$(GNULIB_GETLOADAVG)/g' \ + -e 's/@''GNULIB_GETSUBOPT''@/$(GNULIB_GETSUBOPT)/g' \ + -e 's/@''GNULIB_GRANTPT''@/$(GNULIB_GRANTPT)/g' \ + -e 's/@''GNULIB_MALLOC_POSIX''@/$(GNULIB_MALLOC_POSIX)/g' \ + -e 's/@''GNULIB_MBTOWC''@/$(GNULIB_MBTOWC)/g' \ + -e 's/@''GNULIB_MKDTEMP''@/$(GNULIB_MKDTEMP)/g' \ + -e 's/@''GNULIB_MKOSTEMP''@/$(GNULIB_MKOSTEMP)/g' \ + -e 's/@''GNULIB_MKOSTEMPS''@/$(GNULIB_MKOSTEMPS)/g' \ + -e 's/@''GNULIB_MKSTEMP''@/$(GNULIB_MKSTEMP)/g' \ + -e 's/@''GNULIB_MKSTEMPS''@/$(GNULIB_MKSTEMPS)/g' \ + -e 's/@''GNULIB_POSIX_OPENPT''@/$(GNULIB_POSIX_OPENPT)/g' \ + -e 's/@''GNULIB_PTSNAME''@/$(GNULIB_PTSNAME)/g' \ + -e 's/@''GNULIB_PTSNAME_R''@/$(GNULIB_PTSNAME_R)/g' \ + -e 's/@''GNULIB_PUTENV''@/$(GNULIB_PUTENV)/g' \ + -e 's/@''GNULIB_RANDOM''@/$(GNULIB_RANDOM)/g' \ + -e 's/@''GNULIB_RANDOM_R''@/$(GNULIB_RANDOM_R)/g' \ + -e 's/@''GNULIB_REALLOC_POSIX''@/$(GNULIB_REALLOC_POSIX)/g' \ + -e 's/@''GNULIB_REALPATH''@/$(GNULIB_REALPATH)/g' \ + -e 's/@''GNULIB_RPMATCH''@/$(GNULIB_RPMATCH)/g' \ + -e 's/@''GNULIB_SETENV''@/$(GNULIB_SETENV)/g' \ + -e 's/@''GNULIB_STRTOD''@/$(GNULIB_STRTOD)/g' \ + -e 's/@''GNULIB_STRTOLL''@/$(GNULIB_STRTOLL)/g' \ + -e 's/@''GNULIB_STRTOULL''@/$(GNULIB_STRTOULL)/g' \ + -e 's/@''GNULIB_SYSTEM_POSIX''@/$(GNULIB_SYSTEM_POSIX)/g' \ + -e 's/@''GNULIB_UNLOCKPT''@/$(GNULIB_UNLOCKPT)/g' \ + -e 's/@''GNULIB_UNSETENV''@/$(GNULIB_UNSETENV)/g' \ + -e 's/@''GNULIB_WCTOMB''@/$(GNULIB_WCTOMB)/g' \ + < $(srcdir)/stdlib.in.h | \ + sed -e 's|@''HAVE__EXIT''@|$(HAVE__EXIT)|g' \ -e 's|@''HAVE_ATOLL''@|$(HAVE_ATOLL)|g' \ -e 's|@''HAVE_CANONICALIZE_FILE_NAME''@|$(HAVE_CANONICALIZE_FILE_NAME)|g' \ -e 's|@''HAVE_DECL_GETLOADAVG''@|$(HAVE_DECL_GETLOADAVG)|g' \ @@ -1314,7 +1567,10 @@ -e 's|@''HAVE_MKOSTEMPS''@|$(HAVE_MKOSTEMPS)|g' \ -e 's|@''HAVE_MKSTEMP''@|$(HAVE_MKSTEMP)|g' \ -e 's|@''HAVE_MKSTEMPS''@|$(HAVE_MKSTEMPS)|g' \ + -e 's|@''HAVE_POSIX_OPENPT''@|$(HAVE_POSIX_OPENPT)|g' \ -e 's|@''HAVE_PTSNAME''@|$(HAVE_PTSNAME)|g' \ + -e 's|@''HAVE_PTSNAME_R''@|$(HAVE_PTSNAME_R)|g' \ + -e 's|@''HAVE_RANDOM''@|$(HAVE_RANDOM)|g' \ -e 's|@''HAVE_RANDOM_H''@|$(HAVE_RANDOM_H)|g' \ -e 's|@''HAVE_RANDOM_R''@|$(HAVE_RANDOM_R)|g' \ -e 's|@''HAVE_REALPATH''@|$(HAVE_REALPATH)|g' \ @@ -1330,71 +1586,123 @@ -e 's|@''REPLACE_CALLOC''@|$(REPLACE_CALLOC)|g' \ -e 's|@''REPLACE_CANONICALIZE_FILE_NAME''@|$(REPLACE_CANONICALIZE_FILE_NAME)|g' \ -e 's|@''REPLACE_MALLOC''@|$(REPLACE_MALLOC)|g' \ + -e 's|@''REPLACE_MBTOWC''@|$(REPLACE_MBTOWC)|g' \ -e 's|@''REPLACE_MKSTEMP''@|$(REPLACE_MKSTEMP)|g' \ + -e 's|@''REPLACE_PTSNAME_R''@|$(REPLACE_PTSNAME_R)|g' \ -e 's|@''REPLACE_PUTENV''@|$(REPLACE_PUTENV)|g' \ + -e 's|@''REPLACE_RANDOM_R''@|$(REPLACE_RANDOM_R)|g' \ -e 's|@''REPLACE_REALLOC''@|$(REPLACE_REALLOC)|g' \ -e 's|@''REPLACE_REALPATH''@|$(REPLACE_REALPATH)|g' \ -e 's|@''REPLACE_SETENV''@|$(REPLACE_SETENV)|g' \ -e 's|@''REPLACE_STRTOD''@|$(REPLACE_STRTOD)|g' \ -e 's|@''REPLACE_UNSETENV''@|$(REPLACE_UNSETENV)|g' \ + -e 's|@''REPLACE_WCTOMB''@|$(REPLACE_WCTOMB)|g' \ + -e '/definitions of _GL_FUNCDECL_RPL/r $(CXXDEFS_H)' \ + -e '/definition of _Noreturn/r $(_NORETURN_H)' \ + -e '/definition of _GL_ARG_NONNULL/r $(ARG_NONNULL_H)' \ + -e '/definition of _GL_WARN_ON_USE/r $(WARN_ON_USE_H)'; \ + } > $@-t && \ + mv $@-t $@ + +# We need the following in order to create when the system +# doesn't have one that works with the given compiler. +strings.h: strings.in.h $(top_builddir)/config.status $(CXXDEFS_H) $(WARN_ON_USE_H) $(ARG_NONNULL_H) + $(AM_V_GEN)rm -f $@-t $@ && \ + { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */' && \ + sed -e 's|@''GUARD_PREFIX''@|GL|g' \ + -e 's|@''HAVE_STRINGS_H''@|$(HAVE_STRINGS_H)|g' \ + -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \ + -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \ + -e 's|@''PRAGMA_COLUMNS''@|@PRAGMA_COLUMNS@|g' \ + -e 's|@''NEXT_STRINGS_H''@|$(NEXT_STRINGS_H)|g' \ + -e 's|@''GNULIB_FFS''@|$(GNULIB_FFS)|g' \ + -e 's|@''HAVE_FFS''@|$(HAVE_FFS)|g' \ + -e 's|@''HAVE_STRCASECMP''@|$(HAVE_STRCASECMP)|g' \ + -e 's|@''HAVE_DECL_STRNCASECMP''@|$(HAVE_DECL_STRNCASECMP)|g' \ -e '/definitions of _GL_FUNCDECL_RPL/r $(CXXDEFS_H)' \ -e '/definition of _GL_ARG_NONNULL/r $(ARG_NONNULL_H)' \ -e '/definition of _GL_WARN_ON_USE/r $(WARN_ON_USE_H)' \ - < $(srcdir)/stdlib.in.h; \ + < $(srcdir)/strings.in.h; \ + } > $@-t && \ + mv $@-t $@ + +# We need the following in order to create when the system +# doesn't have one that works with the given compiler. +sys/types.h: sys_types.in.h $(top_builddir)/config.status + $(AM_V_at)$(MKDIR_P) sys + $(AM_V_GEN)rm -f $@-t $@ && \ + { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \ + sed -e 's|@''GUARD_PREFIX''@|GL|g' \ + -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \ + -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \ + -e 's|@''PRAGMA_COLUMNS''@|@PRAGMA_COLUMNS@|g' \ + -e 's|@''NEXT_SYS_TYPES_H''@|$(NEXT_SYS_TYPES_H)|g' \ + -e 's|@''WINDOWS_64_BIT_OFF_T''@|$(WINDOWS_64_BIT_OFF_T)|g' \ + < $(srcdir)/sys_types.in.h; \ } > $@-t && \ mv $@-t $@ # We need the following in order to create an empty placeholder for # when the system doesn't have one. -unistd.h: unistd.in.h $(CXXDEFS_H) $(ARG_NONNULL_H) $(WARN_ON_USE_H) +unistd.h: unistd.in.h $(top_builddir)/config.status $(CXXDEFS_H) $(ARG_NONNULL_H) $(WARN_ON_USE_H) $(AM_V_GEN)rm -f $@-t $@ && \ { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \ - sed -e 's|@''HAVE_UNISTD_H''@|$(HAVE_UNISTD_H)|g' \ + sed -e 's|@''GUARD_PREFIX''@|GL|g' \ + -e 's|@''HAVE_UNISTD_H''@|$(HAVE_UNISTD_H)|g' \ -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \ -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \ -e 's|@''PRAGMA_COLUMNS''@|@PRAGMA_COLUMNS@|g' \ -e 's|@''NEXT_UNISTD_H''@|$(NEXT_UNISTD_H)|g' \ - -e 's|@''GNULIB_CHOWN''@|$(GNULIB_CHOWN)|g' \ - -e 's|@''GNULIB_CLOSE''@|$(GNULIB_CLOSE)|g' \ - -e 's|@''GNULIB_DUP2''@|$(GNULIB_DUP2)|g' \ - -e 's|@''GNULIB_DUP3''@|$(GNULIB_DUP3)|g' \ - -e 's|@''GNULIB_ENVIRON''@|$(GNULIB_ENVIRON)|g' \ - -e 's|@''GNULIB_EUIDACCESS''@|$(GNULIB_EUIDACCESS)|g' \ - -e 's|@''GNULIB_FACCESSAT''@|$(GNULIB_FACCESSAT)|g' \ - -e 's|@''GNULIB_FCHDIR''@|$(GNULIB_FCHDIR)|g' \ - -e 's|@''GNULIB_FCHOWNAT''@|$(GNULIB_FCHOWNAT)|g' \ - -e 's|@''GNULIB_FSYNC''@|$(GNULIB_FSYNC)|g' \ - -e 's|@''GNULIB_FTRUNCATE''@|$(GNULIB_FTRUNCATE)|g' \ - -e 's|@''GNULIB_GETCWD''@|$(GNULIB_GETCWD)|g' \ - -e 's|@''GNULIB_GETDOMAINNAME''@|$(GNULIB_GETDOMAINNAME)|g' \ - -e 's|@''GNULIB_GETDTABLESIZE''@|$(GNULIB_GETDTABLESIZE)|g' \ - -e 's|@''GNULIB_GETGROUPS''@|$(GNULIB_GETGROUPS)|g' \ - -e 's|@''GNULIB_GETHOSTNAME''@|$(GNULIB_GETHOSTNAME)|g' \ - -e 's|@''GNULIB_GETLOGIN''@|$(GNULIB_GETLOGIN)|g' \ - -e 's|@''GNULIB_GETLOGIN_R''@|$(GNULIB_GETLOGIN_R)|g' \ - -e 's|@''GNULIB_GETPAGESIZE''@|$(GNULIB_GETPAGESIZE)|g' \ - -e 's|@''GNULIB_GETUSERSHELL''@|$(GNULIB_GETUSERSHELL)|g' \ - -e 's|@''GNULIB_LCHOWN''@|$(GNULIB_LCHOWN)|g' \ - -e 's|@''GNULIB_LINK''@|$(GNULIB_LINK)|g' \ - -e 's|@''GNULIB_LINKAT''@|$(GNULIB_LINKAT)|g' \ - -e 's|@''GNULIB_LSEEK''@|$(GNULIB_LSEEK)|g' \ - -e 's|@''GNULIB_PIPE''@|$(GNULIB_PIPE)|g' \ - -e 's|@''GNULIB_PIPE2''@|$(GNULIB_PIPE2)|g' \ - -e 's|@''GNULIB_PREAD''@|$(GNULIB_PREAD)|g' \ - -e 's|@''GNULIB_PWRITE''@|$(GNULIB_PWRITE)|g' \ - -e 's|@''GNULIB_READLINK''@|$(GNULIB_READLINK)|g' \ - -e 's|@''GNULIB_READLINKAT''@|$(GNULIB_READLINKAT)|g' \ - -e 's|@''GNULIB_RMDIR''@|$(GNULIB_RMDIR)|g' \ - -e 's|@''GNULIB_SLEEP''@|$(GNULIB_SLEEP)|g' \ - -e 's|@''GNULIB_SYMLINK''@|$(GNULIB_SYMLINK)|g' \ - -e 's|@''GNULIB_SYMLINKAT''@|$(GNULIB_SYMLINKAT)|g' \ - -e 's|@''GNULIB_TTYNAME_R''@|$(GNULIB_TTYNAME_R)|g' \ - -e 's|@''GNULIB_UNISTD_H_GETOPT''@|$(GNULIB_UNISTD_H_GETOPT)|g' \ - -e 's|@''GNULIB_UNISTD_H_SIGPIPE''@|$(GNULIB_UNISTD_H_SIGPIPE)|g' \ - -e 's|@''GNULIB_UNLINK''@|$(GNULIB_UNLINK)|g' \ - -e 's|@''GNULIB_UNLINKAT''@|$(GNULIB_UNLINKAT)|g' \ - -e 's|@''GNULIB_USLEEP''@|$(GNULIB_USLEEP)|g' \ - -e 's|@''GNULIB_WRITE''@|$(GNULIB_WRITE)|g' \ + -e 's|@''WINDOWS_64_BIT_OFF_T''@|$(WINDOWS_64_BIT_OFF_T)|g' \ + -e 's/@''GNULIB_CHDIR''@/$(GNULIB_CHDIR)/g' \ + -e 's/@''GNULIB_CHOWN''@/$(GNULIB_CHOWN)/g' \ + -e 's/@''GNULIB_CLOSE''@/$(GNULIB_CLOSE)/g' \ + -e 's/@''GNULIB_DUP''@/$(GNULIB_DUP)/g' \ + -e 's/@''GNULIB_DUP2''@/$(GNULIB_DUP2)/g' \ + -e 's/@''GNULIB_DUP3''@/$(GNULIB_DUP3)/g' \ + -e 's/@''GNULIB_ENVIRON''@/$(GNULIB_ENVIRON)/g' \ + -e 's/@''GNULIB_EUIDACCESS''@/$(GNULIB_EUIDACCESS)/g' \ + -e 's/@''GNULIB_FACCESSAT''@/$(GNULIB_FACCESSAT)/g' \ + -e 's/@''GNULIB_FCHDIR''@/$(GNULIB_FCHDIR)/g' \ + -e 's/@''GNULIB_FCHOWNAT''@/$(GNULIB_FCHOWNAT)/g' \ + -e 's/@''GNULIB_FDATASYNC''@/$(GNULIB_FDATASYNC)/g' \ + -e 's/@''GNULIB_FSYNC''@/$(GNULIB_FSYNC)/g' \ + -e 's/@''GNULIB_FTRUNCATE''@/$(GNULIB_FTRUNCATE)/g' \ + -e 's/@''GNULIB_GETCWD''@/$(GNULIB_GETCWD)/g' \ + -e 's/@''GNULIB_GETDOMAINNAME''@/$(GNULIB_GETDOMAINNAME)/g' \ + -e 's/@''GNULIB_GETDTABLESIZE''@/$(GNULIB_GETDTABLESIZE)/g' \ + -e 's/@''GNULIB_GETGROUPS''@/$(GNULIB_GETGROUPS)/g' \ + -e 's/@''GNULIB_GETHOSTNAME''@/$(GNULIB_GETHOSTNAME)/g' \ + -e 's/@''GNULIB_GETLOGIN''@/$(GNULIB_GETLOGIN)/g' \ + -e 's/@''GNULIB_GETLOGIN_R''@/$(GNULIB_GETLOGIN_R)/g' \ + -e 's/@''GNULIB_GETPAGESIZE''@/$(GNULIB_GETPAGESIZE)/g' \ + -e 's/@''GNULIB_GETUSERSHELL''@/$(GNULIB_GETUSERSHELL)/g' \ + -e 's/@''GNULIB_GROUP_MEMBER''@/$(GNULIB_GROUP_MEMBER)/g' \ + -e 's/@''GNULIB_ISATTY''@/$(GNULIB_ISATTY)/g' \ + -e 's/@''GNULIB_LCHOWN''@/$(GNULIB_LCHOWN)/g' \ + -e 's/@''GNULIB_LINK''@/$(GNULIB_LINK)/g' \ + -e 's/@''GNULIB_LINKAT''@/$(GNULIB_LINKAT)/g' \ + -e 's/@''GNULIB_LSEEK''@/$(GNULIB_LSEEK)/g' \ + -e 's/@''GNULIB_PIPE''@/$(GNULIB_PIPE)/g' \ + -e 's/@''GNULIB_PIPE2''@/$(GNULIB_PIPE2)/g' \ + -e 's/@''GNULIB_PREAD''@/$(GNULIB_PREAD)/g' \ + -e 's/@''GNULIB_PWRITE''@/$(GNULIB_PWRITE)/g' \ + -e 's/@''GNULIB_READ''@/$(GNULIB_READ)/g' \ + -e 's/@''GNULIB_READLINK''@/$(GNULIB_READLINK)/g' \ + -e 's/@''GNULIB_READLINKAT''@/$(GNULIB_READLINKAT)/g' \ + -e 's/@''GNULIB_RMDIR''@/$(GNULIB_RMDIR)/g' \ + -e 's/@''GNULIB_SETHOSTNAME''@/$(GNULIB_SETHOSTNAME)/g' \ + -e 's/@''GNULIB_SLEEP''@/$(GNULIB_SLEEP)/g' \ + -e 's/@''GNULIB_SYMLINK''@/$(GNULIB_SYMLINK)/g' \ + -e 's/@''GNULIB_SYMLINKAT''@/$(GNULIB_SYMLINKAT)/g' \ + -e 's/@''GNULIB_TTYNAME_R''@/$(GNULIB_TTYNAME_R)/g' \ + -e 's/@''GNULIB_UNISTD_H_GETOPT''@/0$(GNULIB_GL_UNISTD_H_GETOPT)/g' \ + -e 's/@''GNULIB_UNISTD_H_NONBLOCKING''@/$(GNULIB_UNISTD_H_NONBLOCKING)/g' \ + -e 's/@''GNULIB_UNISTD_H_SIGPIPE''@/$(GNULIB_UNISTD_H_SIGPIPE)/g' \ + -e 's/@''GNULIB_UNLINK''@/$(GNULIB_UNLINK)/g' \ + -e 's/@''GNULIB_UNLINKAT''@/$(GNULIB_UNLINKAT)/g' \ + -e 's/@''GNULIB_USLEEP''@/$(GNULIB_USLEEP)/g' \ + -e 's/@''GNULIB_WRITE''@/$(GNULIB_WRITE)/g' \ < $(srcdir)/unistd.in.h | \ sed -e 's|@''HAVE_CHOWN''@|$(HAVE_CHOWN)|g' \ -e 's|@''HAVE_DUP2''@|$(HAVE_DUP2)|g' \ @@ -1403,6 +1711,7 @@ -e 's|@''HAVE_FACCESSAT''@|$(HAVE_FACCESSAT)|g' \ -e 's|@''HAVE_FCHDIR''@|$(HAVE_FCHDIR)|g' \ -e 's|@''HAVE_FCHOWNAT''@|$(HAVE_FCHOWNAT)|g' \ + -e 's|@''HAVE_FDATASYNC''@|$(HAVE_FDATASYNC)|g' \ -e 's|@''HAVE_FSYNC''@|$(HAVE_FSYNC)|g' \ -e 's|@''HAVE_FTRUNCATE''@|$(HAVE_FTRUNCATE)|g' \ -e 's|@''HAVE_GETDTABLESIZE''@|$(HAVE_GETDTABLESIZE)|g' \ @@ -1410,6 +1719,7 @@ -e 's|@''HAVE_GETHOSTNAME''@|$(HAVE_GETHOSTNAME)|g' \ -e 's|@''HAVE_GETLOGIN''@|$(HAVE_GETLOGIN)|g' \ -e 's|@''HAVE_GETPAGESIZE''@|$(HAVE_GETPAGESIZE)|g' \ + -e 's|@''HAVE_GROUP_MEMBER''@|$(HAVE_GROUP_MEMBER)|g' \ -e 's|@''HAVE_LCHOWN''@|$(HAVE_LCHOWN)|g' \ -e 's|@''HAVE_LINK''@|$(HAVE_LINK)|g' \ -e 's|@''HAVE_LINKAT''@|$(HAVE_LINKAT)|g' \ @@ -1419,6 +1729,7 @@ -e 's|@''HAVE_PWRITE''@|$(HAVE_PWRITE)|g' \ -e 's|@''HAVE_READLINK''@|$(HAVE_READLINK)|g' \ -e 's|@''HAVE_READLINKAT''@|$(HAVE_READLINKAT)|g' \ + -e 's|@''HAVE_SETHOSTNAME''@|$(HAVE_SETHOSTNAME)|g' \ -e 's|@''HAVE_SLEEP''@|$(HAVE_SLEEP)|g' \ -e 's|@''HAVE_SYMLINK''@|$(HAVE_SYMLINK)|g' \ -e 's|@''HAVE_SYMLINKAT''@|$(HAVE_SYMLINKAT)|g' \ @@ -1426,29 +1737,35 @@ -e 's|@''HAVE_USLEEP''@|$(HAVE_USLEEP)|g' \ -e 's|@''HAVE_DECL_ENVIRON''@|$(HAVE_DECL_ENVIRON)|g' \ -e 's|@''HAVE_DECL_FCHDIR''@|$(HAVE_DECL_FCHDIR)|g' \ + -e 's|@''HAVE_DECL_FDATASYNC''@|$(HAVE_DECL_FDATASYNC)|g' \ -e 's|@''HAVE_DECL_GETDOMAINNAME''@|$(HAVE_DECL_GETDOMAINNAME)|g' \ -e 's|@''HAVE_DECL_GETLOGIN_R''@|$(HAVE_DECL_GETLOGIN_R)|g' \ -e 's|@''HAVE_DECL_GETPAGESIZE''@|$(HAVE_DECL_GETPAGESIZE)|g' \ -e 's|@''HAVE_DECL_GETUSERSHELL''@|$(HAVE_DECL_GETUSERSHELL)|g' \ + -e 's|@''HAVE_DECL_SETHOSTNAME''@|$(HAVE_DECL_SETHOSTNAME)|g' \ -e 's|@''HAVE_DECL_TTYNAME_R''@|$(HAVE_DECL_TTYNAME_R)|g' \ -e 's|@''HAVE_OS_H''@|$(HAVE_OS_H)|g' \ -e 's|@''HAVE_SYS_PARAM_H''@|$(HAVE_SYS_PARAM_H)|g' \ - -e 's|@''REPLACE_CHOWN''@|$(REPLACE_CHOWN)|g' \ + | \ + sed -e 's|@''REPLACE_CHOWN''@|$(REPLACE_CHOWN)|g' \ -e 's|@''REPLACE_CLOSE''@|$(REPLACE_CLOSE)|g' \ -e 's|@''REPLACE_DUP''@|$(REPLACE_DUP)|g' \ -e 's|@''REPLACE_DUP2''@|$(REPLACE_DUP2)|g' \ -e 's|@''REPLACE_FCHOWNAT''@|$(REPLACE_FCHOWNAT)|g' \ + -e 's|@''REPLACE_FTRUNCATE''@|$(REPLACE_FTRUNCATE)|g' \ -e 's|@''REPLACE_GETCWD''@|$(REPLACE_GETCWD)|g' \ -e 's|@''REPLACE_GETDOMAINNAME''@|$(REPLACE_GETDOMAINNAME)|g' \ -e 's|@''REPLACE_GETLOGIN_R''@|$(REPLACE_GETLOGIN_R)|g' \ -e 's|@''REPLACE_GETGROUPS''@|$(REPLACE_GETGROUPS)|g' \ -e 's|@''REPLACE_GETPAGESIZE''@|$(REPLACE_GETPAGESIZE)|g' \ + -e 's|@''REPLACE_ISATTY''@|$(REPLACE_ISATTY)|g' \ -e 's|@''REPLACE_LCHOWN''@|$(REPLACE_LCHOWN)|g' \ -e 's|@''REPLACE_LINK''@|$(REPLACE_LINK)|g' \ -e 's|@''REPLACE_LINKAT''@|$(REPLACE_LINKAT)|g' \ -e 's|@''REPLACE_LSEEK''@|$(REPLACE_LSEEK)|g' \ -e 's|@''REPLACE_PREAD''@|$(REPLACE_PREAD)|g' \ -e 's|@''REPLACE_PWRITE''@|$(REPLACE_PWRITE)|g' \ + -e 's|@''REPLACE_READ''@|$(REPLACE_READ)|g' \ -e 's|@''REPLACE_READLINK''@|$(REPLACE_READLINK)|g' \ -e 's|@''REPLACE_RMDIR''@|$(REPLACE_RMDIR)|g' \ -e 's|@''REPLACE_SLEEP''@|$(REPLACE_SLEEP)|g' \ @@ -1465,38 +1782,60 @@ -e '/definition of _GL_WARN_ON_USE/r $(WARN_ON_USE_H)'; \ } > $@-t && \ mv $@-t $@ -# The warn-on-use.h that gets inserted into generated .h files is the same as -# build-aux/warn-on-use.h, except that it has the copyright header cut off. -warn-on-use.h: $(top_srcdir)/conf/warn-on-use.h - $(AM_V_GEN)rm -f $@-t $@ && \ - sed -n -e '/^.ifndef/,$$p' \ - < $(top_srcdir)/conf/warn-on-use.h \ - > $@-t && \ - mv $@-t $@ # We need the following in order to create when the system # version does not work standalone. -wchar.h: wchar.in.h $(CXXDEFS_H) $(ARG_NONNULL_H) $(WARN_ON_USE_H) +wchar.h: wchar.in.h $(top_builddir)/config.status $(CXXDEFS_H) $(ARG_NONNULL_H) $(WARN_ON_USE_H) $(AM_V_GEN)rm -f $@-t $@ && \ { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \ - sed -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \ + sed -e 's|@''GUARD_PREFIX''@|GL|g' \ + -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \ -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \ -e 's|@''PRAGMA_COLUMNS''@|@PRAGMA_COLUMNS@|g' \ -e 's|@''HAVE_FEATURES_H''@|$(HAVE_FEATURES_H)|g' \ -e 's|@''NEXT_WCHAR_H''@|$(NEXT_WCHAR_H)|g' \ -e 's|@''HAVE_WCHAR_H''@|$(HAVE_WCHAR_H)|g' \ - -e 's|@''GNULIB_BTOWC''@|$(GNULIB_BTOWC)|g' \ - -e 's|@''GNULIB_WCTOB''@|$(GNULIB_WCTOB)|g' \ - -e 's|@''GNULIB_MBSINIT''@|$(GNULIB_MBSINIT)|g' \ - -e 's|@''GNULIB_MBRTOWC''@|$(GNULIB_MBRTOWC)|g' \ - -e 's|@''GNULIB_MBRLEN''@|$(GNULIB_MBRLEN)|g' \ - -e 's|@''GNULIB_MBSRTOWCS''@|$(GNULIB_MBSRTOWCS)|g' \ - -e 's|@''GNULIB_MBSNRTOWCS''@|$(GNULIB_MBSNRTOWCS)|g' \ - -e 's|@''GNULIB_WCRTOMB''@|$(GNULIB_WCRTOMB)|g' \ - -e 's|@''GNULIB_WCSRTOMBS''@|$(GNULIB_WCSRTOMBS)|g' \ - -e 's|@''GNULIB_WCSNRTOMBS''@|$(GNULIB_WCSNRTOMBS)|g' \ - -e 's|@''GNULIB_WCWIDTH''@|$(GNULIB_WCWIDTH)|g' \ - -e 's|@''HAVE_WINT_T''@|$(HAVE_WINT_T)|g' \ + -e 's/@''GNULIB_BTOWC''@/$(GNULIB_BTOWC)/g' \ + -e 's/@''GNULIB_WCTOB''@/$(GNULIB_WCTOB)/g' \ + -e 's/@''GNULIB_MBSINIT''@/$(GNULIB_MBSINIT)/g' \ + -e 's/@''GNULIB_MBRTOWC''@/$(GNULIB_MBRTOWC)/g' \ + -e 's/@''GNULIB_MBRLEN''@/$(GNULIB_MBRLEN)/g' \ + -e 's/@''GNULIB_MBSRTOWCS''@/$(GNULIB_MBSRTOWCS)/g' \ + -e 's/@''GNULIB_MBSNRTOWCS''@/$(GNULIB_MBSNRTOWCS)/g' \ + -e 's/@''GNULIB_WCRTOMB''@/$(GNULIB_WCRTOMB)/g' \ + -e 's/@''GNULIB_WCSRTOMBS''@/$(GNULIB_WCSRTOMBS)/g' \ + -e 's/@''GNULIB_WCSNRTOMBS''@/$(GNULIB_WCSNRTOMBS)/g' \ + -e 's/@''GNULIB_WCWIDTH''@/$(GNULIB_WCWIDTH)/g' \ + -e 's/@''GNULIB_WMEMCHR''@/$(GNULIB_WMEMCHR)/g' \ + -e 's/@''GNULIB_WMEMCMP''@/$(GNULIB_WMEMCMP)/g' \ + -e 's/@''GNULIB_WMEMCPY''@/$(GNULIB_WMEMCPY)/g' \ + -e 's/@''GNULIB_WMEMMOVE''@/$(GNULIB_WMEMMOVE)/g' \ + -e 's/@''GNULIB_WMEMSET''@/$(GNULIB_WMEMSET)/g' \ + -e 's/@''GNULIB_WCSLEN''@/$(GNULIB_WCSLEN)/g' \ + -e 's/@''GNULIB_WCSNLEN''@/$(GNULIB_WCSNLEN)/g' \ + -e 's/@''GNULIB_WCSCPY''@/$(GNULIB_WCSCPY)/g' \ + -e 's/@''GNULIB_WCPCPY''@/$(GNULIB_WCPCPY)/g' \ + -e 's/@''GNULIB_WCSNCPY''@/$(GNULIB_WCSNCPY)/g' \ + -e 's/@''GNULIB_WCPNCPY''@/$(GNULIB_WCPNCPY)/g' \ + -e 's/@''GNULIB_WCSCAT''@/$(GNULIB_WCSCAT)/g' \ + -e 's/@''GNULIB_WCSNCAT''@/$(GNULIB_WCSNCAT)/g' \ + -e 's/@''GNULIB_WCSCMP''@/$(GNULIB_WCSCMP)/g' \ + -e 's/@''GNULIB_WCSNCMP''@/$(GNULIB_WCSNCMP)/g' \ + -e 's/@''GNULIB_WCSCASECMP''@/$(GNULIB_WCSCASECMP)/g' \ + -e 's/@''GNULIB_WCSNCASECMP''@/$(GNULIB_WCSNCASECMP)/g' \ + -e 's/@''GNULIB_WCSCOLL''@/$(GNULIB_WCSCOLL)/g' \ + -e 's/@''GNULIB_WCSXFRM''@/$(GNULIB_WCSXFRM)/g' \ + -e 's/@''GNULIB_WCSDUP''@/$(GNULIB_WCSDUP)/g' \ + -e 's/@''GNULIB_WCSCHR''@/$(GNULIB_WCSCHR)/g' \ + -e 's/@''GNULIB_WCSRCHR''@/$(GNULIB_WCSRCHR)/g' \ + -e 's/@''GNULIB_WCSCSPN''@/$(GNULIB_WCSCSPN)/g' \ + -e 's/@''GNULIB_WCSSPN''@/$(GNULIB_WCSSPN)/g' \ + -e 's/@''GNULIB_WCSPBRK''@/$(GNULIB_WCSPBRK)/g' \ + -e 's/@''GNULIB_WCSSTR''@/$(GNULIB_WCSSTR)/g' \ + -e 's/@''GNULIB_WCSTOK''@/$(GNULIB_WCSTOK)/g' \ + -e 's/@''GNULIB_WCSWIDTH''@/$(GNULIB_WCSWIDTH)/g' \ + < $(srcdir)/wchar.in.h | \ + sed -e 's|@''HAVE_WINT_T''@|$(HAVE_WINT_T)|g' \ -e 's|@''HAVE_BTOWC''@|$(HAVE_BTOWC)|g' \ -e 's|@''HAVE_MBSINIT''@|$(HAVE_MBSINIT)|g' \ -e 's|@''HAVE_MBRTOWC''@|$(HAVE_MBRTOWC)|g' \ @@ -1506,9 +1845,38 @@ -e 's|@''HAVE_WCRTOMB''@|$(HAVE_WCRTOMB)|g' \ -e 's|@''HAVE_WCSRTOMBS''@|$(HAVE_WCSRTOMBS)|g' \ -e 's|@''HAVE_WCSNRTOMBS''@|$(HAVE_WCSNRTOMBS)|g' \ + -e 's|@''HAVE_WMEMCHR''@|$(HAVE_WMEMCHR)|g' \ + -e 's|@''HAVE_WMEMCMP''@|$(HAVE_WMEMCMP)|g' \ + -e 's|@''HAVE_WMEMCPY''@|$(HAVE_WMEMCPY)|g' \ + -e 's|@''HAVE_WMEMMOVE''@|$(HAVE_WMEMMOVE)|g' \ + -e 's|@''HAVE_WMEMSET''@|$(HAVE_WMEMSET)|g' \ + -e 's|@''HAVE_WCSLEN''@|$(HAVE_WCSLEN)|g' \ + -e 's|@''HAVE_WCSNLEN''@|$(HAVE_WCSNLEN)|g' \ + -e 's|@''HAVE_WCSCPY''@|$(HAVE_WCSCPY)|g' \ + -e 's|@''HAVE_WCPCPY''@|$(HAVE_WCPCPY)|g' \ + -e 's|@''HAVE_WCSNCPY''@|$(HAVE_WCSNCPY)|g' \ + -e 's|@''HAVE_WCPNCPY''@|$(HAVE_WCPNCPY)|g' \ + -e 's|@''HAVE_WCSCAT''@|$(HAVE_WCSCAT)|g' \ + -e 's|@''HAVE_WCSNCAT''@|$(HAVE_WCSNCAT)|g' \ + -e 's|@''HAVE_WCSCMP''@|$(HAVE_WCSCMP)|g' \ + -e 's|@''HAVE_WCSNCMP''@|$(HAVE_WCSNCMP)|g' \ + -e 's|@''HAVE_WCSCASECMP''@|$(HAVE_WCSCASECMP)|g' \ + -e 's|@''HAVE_WCSNCASECMP''@|$(HAVE_WCSNCASECMP)|g' \ + -e 's|@''HAVE_WCSCOLL''@|$(HAVE_WCSCOLL)|g' \ + -e 's|@''HAVE_WCSXFRM''@|$(HAVE_WCSXFRM)|g' \ + -e 's|@''HAVE_WCSDUP''@|$(HAVE_WCSDUP)|g' \ + -e 's|@''HAVE_WCSCHR''@|$(HAVE_WCSCHR)|g' \ + -e 's|@''HAVE_WCSRCHR''@|$(HAVE_WCSRCHR)|g' \ + -e 's|@''HAVE_WCSCSPN''@|$(HAVE_WCSCSPN)|g' \ + -e 's|@''HAVE_WCSSPN''@|$(HAVE_WCSSPN)|g' \ + -e 's|@''HAVE_WCSPBRK''@|$(HAVE_WCSPBRK)|g' \ + -e 's|@''HAVE_WCSSTR''@|$(HAVE_WCSSTR)|g' \ + -e 's|@''HAVE_WCSTOK''@|$(HAVE_WCSTOK)|g' \ + -e 's|@''HAVE_WCSWIDTH''@|$(HAVE_WCSWIDTH)|g' \ -e 's|@''HAVE_DECL_WCTOB''@|$(HAVE_DECL_WCTOB)|g' \ -e 's|@''HAVE_DECL_WCWIDTH''@|$(HAVE_DECL_WCWIDTH)|g' \ - -e 's|@''REPLACE_MBSTATE_T''@|$(REPLACE_MBSTATE_T)|g' \ + | \ + sed -e 's|@''REPLACE_MBSTATE_T''@|$(REPLACE_MBSTATE_T)|g' \ -e 's|@''REPLACE_BTOWC''@|$(REPLACE_BTOWC)|g' \ -e 's|@''REPLACE_WCTOB''@|$(REPLACE_WCTOB)|g' \ -e 's|@''REPLACE_MBSINIT''@|$(REPLACE_MBSINIT)|g' \ @@ -1520,28 +1888,37 @@ -e 's|@''REPLACE_WCSRTOMBS''@|$(REPLACE_WCSRTOMBS)|g' \ -e 's|@''REPLACE_WCSNRTOMBS''@|$(REPLACE_WCSNRTOMBS)|g' \ -e 's|@''REPLACE_WCWIDTH''@|$(REPLACE_WCWIDTH)|g' \ + -e 's|@''REPLACE_WCSWIDTH''@|$(REPLACE_WCSWIDTH)|g' \ -e '/definitions of _GL_FUNCDECL_RPL/r $(CXXDEFS_H)' \ -e '/definition of _GL_ARG_NONNULL/r $(ARG_NONNULL_H)' \ - -e '/definition of _GL_WARN_ON_USE/r $(WARN_ON_USE_H)' \ - < $(srcdir)/wchar.in.h; \ + -e '/definition of _GL_WARN_ON_USE/r $(WARN_ON_USE_H)'; \ } > $@-t && \ mv $@-t $@ # We need the following in order to create when the system # doesn't have one that works with the given compiler. -wctype.h: wctype.in.h $(CXXDEFS_H) $(WARN_ON_USE_H) +wctype.h: wctype.in.h $(top_builddir)/config.status $(CXXDEFS_H) $(WARN_ON_USE_H) $(AM_V_GEN)rm -f $@-t $@ && \ { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \ - sed -e 's/@''HAVE_WCTYPE_H''@/$(HAVE_WCTYPE_H)/g' \ + sed -e 's|@''GUARD_PREFIX''@|GL|g' \ + -e 's/@''HAVE_WCTYPE_H''@/$(HAVE_WCTYPE_H)/g' \ -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \ -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \ -e 's|@''PRAGMA_COLUMNS''@|@PRAGMA_COLUMNS@|g' \ -e 's|@''NEXT_WCTYPE_H''@|$(NEXT_WCTYPE_H)|g' \ + -e 's/@''GNULIB_ISWBLANK''@/$(GNULIB_ISWBLANK)/g' \ + -e 's/@''GNULIB_WCTYPE''@/$(GNULIB_WCTYPE)/g' \ + -e 's/@''GNULIB_ISWCTYPE''@/$(GNULIB_ISWCTYPE)/g' \ + -e 's/@''GNULIB_WCTRANS''@/$(GNULIB_WCTRANS)/g' \ + -e 's/@''GNULIB_TOWCTRANS''@/$(GNULIB_TOWCTRANS)/g' \ -e 's/@''HAVE_ISWBLANK''@/$(HAVE_ISWBLANK)/g' \ -e 's/@''HAVE_ISWCNTRL''@/$(HAVE_ISWCNTRL)/g' \ + -e 's/@''HAVE_WCTYPE_T''@/$(HAVE_WCTYPE_T)/g' \ + -e 's/@''HAVE_WCTRANS_T''@/$(HAVE_WCTRANS_T)/g' \ -e 's/@''HAVE_WINT_T''@/$(HAVE_WINT_T)/g' \ -e 's/@''REPLACE_ISWBLANK''@/$(REPLACE_ISWBLANK)/g' \ -e 's/@''REPLACE_ISWCNTRL''@/$(REPLACE_ISWCNTRL)/g' \ + -e 's/@''REPLACE_TOWLOWER''@/$(REPLACE_TOWLOWER)/g' \ -e '/definitions of _GL_FUNCDECL_RPL/r $(CXXDEFS_H)' \ -e '/definition of _GL_WARN_ON_USE/r $(WARN_ON_USE_H)' \ < $(srcdir)/wctype.in.h; \ diff -Nru libdap-3.11.1/gl/alloca.in.h libdap-3.12.0/gl/alloca.in.h --- libdap-3.11.1/gl/alloca.in.h 2011-04-29 13:19:36.000000000 +0000 +++ libdap-3.12.0/gl/alloca.in.h 2013-10-17 21:27:40.000000000 +0000 @@ -1,6 +1,6 @@ /* Memory allocation on the stack. - Copyright (C) 1995, 1999, 2001-2004, 2006-2011 Free Software Foundation, + Copyright (C) 1995, 1999, 2001-2004, 2006-2012 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it @@ -11,12 +11,12 @@ 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. + Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public - License along with this program; if not, write to the Free Software - Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, - USA. */ + License along with this program; if not, see + . + */ /* Avoid using the symbol _ALLOCA_H here, as Bison assumes _ALLOCA_H means there is a real alloca function. */ diff -Nru libdap-3.11.1/gl/btowc.c libdap-3.12.0/gl/btowc.c --- libdap-3.11.1/gl/btowc.c 2011-04-29 13:19:36.000000000 +0000 +++ libdap-3.12.0/gl/btowc.c 2013-10-17 21:27:40.000000000 +0000 @@ -1,5 +1,5 @@ /* Convert unibyte character to wide character. - Copyright (C) 2008, 2010-2011 Free Software Foundation, Inc. + Copyright (C) 2008, 2010-2012 Free Software Foundation, Inc. Written by Bruno Haible , 2008. This program is free software: you can redistribute it and/or modify diff -Nru libdap-3.11.1/gl/byteswap.in.h libdap-3.12.0/gl/byteswap.in.h --- libdap-3.11.1/gl/byteswap.in.h 1970-01-01 00:00:00.000000000 +0000 +++ libdap-3.12.0/gl/byteswap.in.h 2013-10-17 21:27:40.000000000 +0000 @@ -0,0 +1,44 @@ +/* byteswap.h - Byte swapping + Copyright (C) 2005, 2007, 2009-2012 Free Software Foundation, Inc. + Written by Oskar Liljeblad , 2005. + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU Lesser General Public License as published by + the Free Software Foundation; either version 3 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 Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public License + along with this program. If not, see . */ + +#ifndef _GL_BYTESWAP_H +#define _GL_BYTESWAP_H + +/* Given an unsigned 16-bit argument X, return the value corresponding to + X with reversed byte order. */ +#define bswap_16(x) ((((x) & 0x00FF) << 8) | \ + (((x) & 0xFF00) >> 8)) + +/* Given an unsigned 32-bit argument X, return the value corresponding to + X with reversed byte order. */ +#define bswap_32(x) ((((x) & 0x000000FF) << 24) | \ + (((x) & 0x0000FF00) << 8) | \ + (((x) & 0x00FF0000) >> 8) | \ + (((x) & 0xFF000000) >> 24)) + +/* Given an unsigned 64-bit argument X, return the value corresponding to + X with reversed byte order. */ +#define bswap_64(x) ((((x) & 0x00000000000000FFULL) << 56) | \ + (((x) & 0x000000000000FF00ULL) << 40) | \ + (((x) & 0x0000000000FF0000ULL) << 24) | \ + (((x) & 0x00000000FF000000ULL) << 8) | \ + (((x) & 0x000000FF00000000ULL) >> 8) | \ + (((x) & 0x0000FF0000000000ULL) >> 24) | \ + (((x) & 0x00FF000000000000ULL) >> 40) | \ + (((x) & 0xFF00000000000000ULL) >> 56)) + +#endif /* _GL_BYTESWAP_H */ diff -Nru libdap-3.11.1/gl/config.charset libdap-3.12.0/gl/config.charset --- libdap-3.11.1/gl/config.charset 2011-04-29 13:19:36.000000000 +0000 +++ libdap-3.12.0/gl/config.charset 2013-10-17 21:27:40.000000000 +0000 @@ -1,7 +1,7 @@ #! /bin/sh # Output a system dependent table of character encoding aliases. # -# Copyright (C) 2000-2004, 2006-2011 Free Software Foundation, Inc. +# Copyright (C) 2000-2004, 2006-2012 Free Software Foundation, Inc. # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU Lesser General Public License as published by @@ -14,8 +14,7 @@ # GNU Lesser General Public License for more details. # # You should have received a copy of the GNU Lesser General Public License along -# with this program; if not, write to the Free Software Foundation, -# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +# with this program; if not, see . # # The table consists of lines of the form # ALIAS CANONICAL @@ -30,6 +29,8 @@ # The current list of GNU canonical charset names is as follows. # # name MIME? used by which systems +# (darwin = Mac OS X, woe32 = native Windows) +# # ASCII, ANSI_X3.4-1968 glibc solaris freebsd netbsd darwin cygwin # ISO-8859-1 Y glibc aix hpux irix osf solaris freebsd netbsd openbsd darwin cygwin # ISO-8859-2 Y glibc aix hpux irix osf solaris freebsd netbsd openbsd darwin cygwin diff -Nru libdap-3.11.1/gl/gettext.h libdap-3.12.0/gl/gettext.h --- libdap-3.11.1/gl/gettext.h 2011-04-29 13:19:36.000000000 +0000 +++ libdap-3.12.0/gl/gettext.h 2013-10-17 21:27:40.000000000 +0000 @@ -1,5 +1,5 @@ /* Convenience header for conditional use of GNU . - Copyright (C) 1995-1998, 2000-2002, 2004-2006, 2009-2011 Free Software + Copyright (C) 1995-1998, 2000-2002, 2004-2006, 2009-2012 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify @@ -13,8 +13,7 @@ GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along - with this program; if not, write to the Free Software Foundation, - Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ + with this program; if not, see . */ #ifndef _LIBGETTEXT_H #define _LIBGETTEXT_H 1 @@ -93,6 +92,12 @@ #endif +/* Prefer gnulib's setlocale override over libintl's setlocale override. */ +#ifdef GNULIB_defined_setlocale +# undef setlocale +# define setlocale rpl_setlocale +#endif + /* A pseudo function call that serves as a marker for the automated extraction of messages, but does not call gettext(). The run-time translation is done at a different place in the code. @@ -179,7 +184,7 @@ #include #define _LIBGETTEXT_HAVE_VARIABLE_SIZE_ARRAYS \ - (((__GNUC__ >= 3 || __GNUG__ >= 2) && !__STRICT_ANSI__) \ + (((__GNUC__ >= 3 || __GNUG__ >= 2) && !defined __STRICT_ANSI__) \ /* || __STDC_VERSION__ >= 199901L */ ) #if !_LIBGETTEXT_HAVE_VARIABLE_SIZE_ARRAYS diff -Nru libdap-3.11.1/gl/iswblank.c libdap-3.12.0/gl/iswblank.c --- libdap-3.11.1/gl/iswblank.c 2011-04-29 13:19:36.000000000 +0000 +++ libdap-3.12.0/gl/iswblank.c 1970-01-01 00:00:00.000000000 +0000 @@ -1,27 +0,0 @@ -/* Test wide character for being blank. - Copyright (C) 2008-2011 Free Software Foundation, Inc. - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU Lesser General Public License as published by - the Free Software Foundation; either version 2, 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 Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public License along - with this program; if not, write to the Free Software Foundation, - Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ - -#include - -/* Specification. */ -#include - -int -iswblank (wint_t wc) -{ - return wc == ' ' || wc == '\t'; -} diff -Nru libdap-3.11.1/gl/langinfo.in.h libdap-3.12.0/gl/langinfo.in.h --- libdap-3.11.1/gl/langinfo.in.h 2011-04-29 13:19:36.000000000 +0000 +++ libdap-3.12.0/gl/langinfo.in.h 2013-10-17 21:27:40.000000000 +0000 @@ -1,5 +1,5 @@ /* Substitute for and wrapper around . - Copyright (C) 2009-2011 Free Software Foundation, Inc. + Copyright (C) 2009-2012 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by @@ -12,15 +12,14 @@ GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License - along with this program; if not, write to the Free Software Foundation, - Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ + along with this program; if not, see . */ /* * POSIX for platforms that lack it or have an incomplete one. * */ -#ifndef _GL_LANGINFO_H +#ifndef _@GUARD_PREFIX@_LANGINFO_H #if __GNUC__ >= 3 @PRAGMA_SYSTEM_HEADER@ @@ -32,8 +31,8 @@ # @INCLUDE_NEXT@ @NEXT_LANGINFO_H@ #endif -#ifndef _GL_LANGINFO_H -#define _GL_LANGINFO_H +#ifndef _@GUARD_PREFIX@_LANGINFO_H +#define _@GUARD_PREFIX@_LANGINFO_H #if !@HAVE_LANGINFO_H@ @@ -41,7 +40,10 @@ /* A platform that lacks . */ /* Assume that it also lacks and the nl_item type. */ +# if !GNULIB_defined_nl_item typedef int nl_item; +# define GNULIB_defined_nl_item 1 +# endif /* nl_langinfo items of the LC_CTYPE category */ # define CODESET 10000 @@ -170,5 +172,5 @@ #endif -#endif /* _GL_LANGINFO_H */ -#endif /* _GL_LANGINFO_H */ +#endif /* _@GUARD_PREFIX@_LANGINFO_H */ +#endif /* _@GUARD_PREFIX@_LANGINFO_H */ diff -Nru libdap-3.11.1/gl/localcharset.c libdap-3.12.0/gl/localcharset.c --- libdap-3.11.1/gl/localcharset.c 2011-04-29 13:19:36.000000000 +0000 +++ libdap-3.12.0/gl/localcharset.c 2013-10-17 21:27:40.000000000 +0000 @@ -1,6 +1,6 @@ /* Determine a canonical name for the current locale's character encoding. - Copyright (C) 2000-2006, 2008-2011 Free Software Foundation, Inc. + Copyright (C) 2000-2006, 2008-2012 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by @@ -13,8 +13,7 @@ GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along - with this program; if not, write to the Free Software Foundation, - Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ + with this program; if not, see . */ /* Written by Bruno Haible . */ @@ -30,11 +29,11 @@ #include #if defined __APPLE__ && defined __MACH__ && HAVE_LANGINFO_CODESET -# define DARWIN7 /* Darwin 7 or newer, i.e. MacOS X 10.3 or newer */ +# define DARWIN7 /* Darwin 7 or newer, i.e. Mac OS X 10.3 or newer */ #endif #if defined _WIN32 || defined __WIN32__ -# define WIN32_NATIVE +# define WINDOWS_NATIVE #endif #if defined __EMX__ @@ -44,7 +43,7 @@ # endif #endif -#if !defined WIN32_NATIVE +#if !defined WINDOWS_NATIVE # include # if HAVE_LANGINFO_CODESET # include @@ -57,7 +56,7 @@ # define WIN32_LEAN_AND_MEAN # include # endif -#elif defined WIN32_NATIVE +#elif defined WINDOWS_NATIVE # define WIN32_LEAN_AND_MEAN # include #endif @@ -83,7 +82,7 @@ #endif #if defined _WIN32 || defined __WIN32__ || defined __CYGWIN__ || defined __EMX__ || defined __DJGPP__ - /* Win32, Cygwin, OS/2, DOS */ + /* Native Windows, Cygwin, OS/2, DOS */ # define ISSLASH(C) ((C) == '/' || (C) == '\\') #endif @@ -123,7 +122,7 @@ cp = charset_aliases; if (cp == NULL) { -#if !(defined DARWIN7 || defined VMS || defined WIN32_NATIVE || defined __CYGWIN__) +#if !(defined DARWIN7 || defined VMS || defined WINDOWS_NATIVE || defined __CYGWIN__) const char *dir; const char *base = "charset.alias"; char *file_name; @@ -228,8 +227,7 @@ { /* Out of memory. */ res_size = 0; - if (old_res_ptr != NULL) - free (old_res_ptr); + free (old_res_ptr); break; } strcpy (res_ptr + res_size - (l2 + 1) - (l1 + 1), buf1); @@ -309,7 +307,7 @@ "DECKOREAN" "\0" "EUC-KR" "\0"; # endif -# if defined WIN32_NATIVE || defined __CYGWIN__ +# if defined WINDOWS_NATIVE || defined __CYGWIN__ /* To avoid the troubles of installing a separate file in the same directory as the DLL and of retrieving the DLL's directory at runtime, simply inline the aliases here. */ @@ -361,7 +359,7 @@ const char *codeset; const char *aliases; -#if !(defined WIN32_NATIVE || defined OS2) +#if !(defined WINDOWS_NATIVE || defined OS2) # if HAVE_LANGINFO_CODESET @@ -408,10 +406,10 @@ } } - /* Woe32 has a function returning the locale's codepage as a number: - GetACP(). This encoding is used by Cygwin, unless the user has set - the environment variable CYGWIN=codepage:oem (which very few people - do). + /* The Windows API has a function returning the locale's codepage as a + number: GetACP(). This encoding is used by Cygwin, unless the user + has set the environment variable CYGWIN=codepage:oem (which very few + people do). Output directed to console windows needs to be converted (to GetOEMCP() if the console is using a raster font, or to GetConsoleOutputCP() if it is using a TrueType font). Cygwin does @@ -454,12 +452,12 @@ # endif -#elif defined WIN32_NATIVE +#elif defined WINDOWS_NATIVE static char buf[2 + 10 + 1]; - /* Woe32 has a function returning the locale's codepage as a number: - GetACP(). + /* The Windows API has a function returning the locale's codepage as a + number: GetACP(). When the output goes to a console window, it needs to be provided in GetOEMCP() encoding if the console is using a raster font, or in GetConsoleOutputCP() encoding if it is using a TrueType font. diff -Nru libdap-3.11.1/gl/localcharset.h libdap-3.12.0/gl/localcharset.h --- libdap-3.11.1/gl/localcharset.h 2011-04-29 13:19:36.000000000 +0000 +++ libdap-3.12.0/gl/localcharset.h 2013-10-17 21:27:40.000000000 +0000 @@ -1,5 +1,5 @@ /* Determine a canonical name for the current locale's character encoding. - Copyright (C) 2000-2003, 2009-2011 Free Software Foundation, Inc. + Copyright (C) 2000-2003, 2009-2012 Free Software Foundation, Inc. This file is part of the GNU CHARSET Library. This program is free software; you can redistribute it and/or modify @@ -13,8 +13,7 @@ GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along - with this program; if not, write to the Free Software Foundation, - Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ + with this program; if not, see . */ #ifndef _LOCALCHARSET_H #define _LOCALCHARSET_H diff -Nru libdap-3.11.1/gl/locale.in.h libdap-3.12.0/gl/locale.in.h --- libdap-3.11.1/gl/locale.in.h 1970-01-01 00:00:00.000000000 +0000 +++ libdap-3.12.0/gl/locale.in.h 2013-10-17 21:27:40.000000000 +0000 @@ -0,0 +1,201 @@ +/* A POSIX . + Copyright (C) 2007-2012 Free Software Foundation, Inc. + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU Lesser General Public License as published by + the Free Software Foundation; either version 3 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 Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public License + along with this program. If not, see . */ + +#ifndef _@GUARD_PREFIX@_LOCALE_H + +#if __GNUC__ >= 3 +@PRAGMA_SYSTEM_HEADER@ +#endif +@PRAGMA_COLUMNS@ + +/* The include_next requires a split double-inclusion guard. */ +#@INCLUDE_NEXT@ @NEXT_LOCALE_H@ + +#ifndef _@GUARD_PREFIX@_LOCALE_H +#define _@GUARD_PREFIX@_LOCALE_H + +/* NetBSD 5.0 mis-defines NULL. */ +#include + +/* Mac OS X 10.5 defines the locale_t type in . */ +#if @HAVE_XLOCALE_H@ +# include +#endif + +/* The definitions of _GL_FUNCDECL_RPL etc. are copied here. */ + +/* The definition of _GL_ARG_NONNULL is copied here. */ + +/* The definition of _GL_WARN_ON_USE is copied here. */ + +/* The LC_MESSAGES locale category is specified in POSIX, but not in ISO C. + On systems that don't define it, use the same value as GNU libintl. */ +#if !defined LC_MESSAGES +# define LC_MESSAGES 1729 +#endif + +/* Bionic libc's 'struct lconv' is just a dummy. */ +#if @REPLACE_STRUCT_LCONV@ +# define lconv rpl_lconv +struct lconv +{ + /* All 'char *' are actually 'const char *'. */ + + /* Members that depend on the LC_NUMERIC category of the locale. See + */ + + /* Symbol used as decimal point. */ + char *decimal_point; + /* Symbol used to separate groups of digits to the left of the decimal + point. */ + char *thousands_sep; + /* Definition of the size of groups of digits to the left of the decimal + point. */ + char *grouping; + + /* Members that depend on the LC_MONETARY category of the locale. See + */ + + /* Symbol used as decimal point. */ + char *mon_decimal_point; + /* Symbol used to separate groups of digits to the left of the decimal + point. */ + char *mon_thousands_sep; + /* Definition of the size of groups of digits to the left of the decimal + point. */ + char *mon_grouping; + /* Sign used to indicate a value >= 0. */ + char *positive_sign; + /* Sign used to indicate a value < 0. */ + char *negative_sign; + + /* For formatting local currency. */ + /* Currency symbol (3 characters) followed by separator (1 character). */ + char *currency_symbol; + /* Number of digits after the decimal point. */ + char frac_digits; + /* For values >= 0: 1 if the currency symbol precedes the number, 0 if it + comes after the number. */ + char p_cs_precedes; + /* For values >= 0: Position of the sign. */ + char p_sign_posn; + /* For values >= 0: Placement of spaces between currency symbol, sign, and + number. */ + char p_sep_by_space; + /* For values < 0: 1 if the currency symbol precedes the number, 0 if it + comes after the number. */ + char n_cs_precedes; + /* For values < 0: Position of the sign. */ + char n_sign_posn; + /* For values < 0: Placement of spaces between currency symbol, sign, and + number. */ + char n_sep_by_space; + + /* For formatting international currency. */ + /* Currency symbol (3 characters) followed by separator (1 character). */ + char *int_curr_symbol; + /* Number of digits after the decimal point. */ + char int_frac_digits; + /* For values >= 0: 1 if the currency symbol precedes the number, 0 if it + comes after the number. */ + char int_p_cs_precedes; + /* For values >= 0: Position of the sign. */ + char int_p_sign_posn; + /* For values >= 0: Placement of spaces between currency symbol, sign, and + number. */ + char int_p_sep_by_space; + /* For values < 0: 1 if the currency symbol precedes the number, 0 if it + comes after the number. */ + char int_n_cs_precedes; + /* For values < 0: Position of the sign. */ + char int_n_sign_posn; + /* For values < 0: Placement of spaces between currency symbol, sign, and + number. */ + char int_n_sep_by_space; +}; +#endif + +#if @GNULIB_LOCALECONV@ +# if @REPLACE_LOCALECONV@ +# if !(defined __cplusplus && defined GNULIB_NAMESPACE) +# undef localeconv +# define localeconv rpl_localeconv +# endif +_GL_FUNCDECL_RPL (localeconv, struct lconv *, (void)); +_GL_CXXALIAS_RPL (localeconv, struct lconv *, (void)); +# else +_GL_CXXALIAS_SYS (localeconv, struct lconv *, (void)); +# endif +_GL_CXXALIASWARN (localeconv); +#elif @REPLACE_STRUCT_LCONV@ +# undef localeconv +# define localeconv localeconv_used_without_requesting_gnulib_module_localeconv +#elif defined GNULIB_POSIXCHECK +# undef localeconv +# if HAVE_RAW_DECL_LOCALECONV +_GL_WARN_ON_USE (localeconv, + "localeconv returns too few information on some platforms - " + "use gnulib module localeconv for portability"); +# endif +#endif + +#if @GNULIB_SETLOCALE@ +# if @REPLACE_SETLOCALE@ +# if !(defined __cplusplus && defined GNULIB_NAMESPACE) +# undef setlocale +# define setlocale rpl_setlocale +# define GNULIB_defined_setlocale 1 +# endif +_GL_FUNCDECL_RPL (setlocale, char *, (int category, const char *locale)); +_GL_CXXALIAS_RPL (setlocale, char *, (int category, const char *locale)); +# else +_GL_CXXALIAS_SYS (setlocale, char *, (int category, const char *locale)); +# endif +_GL_CXXALIASWARN (setlocale); +#elif defined GNULIB_POSIXCHECK +# undef setlocale +# if HAVE_RAW_DECL_SETLOCALE +_GL_WARN_ON_USE (setlocale, "setlocale works differently on native Windows - " + "use gnulib module setlocale for portability"); +# endif +#endif + +#if @GNULIB_DUPLOCALE@ +# if @REPLACE_DUPLOCALE@ +# if !(defined __cplusplus && defined GNULIB_NAMESPACE) +# undef duplocale +# define duplocale rpl_duplocale +# endif +_GL_FUNCDECL_RPL (duplocale, locale_t, (locale_t locale) _GL_ARG_NONNULL ((1))); +_GL_CXXALIAS_RPL (duplocale, locale_t, (locale_t locale)); +# else +# if @HAVE_DUPLOCALE@ +_GL_CXXALIAS_SYS (duplocale, locale_t, (locale_t locale)); +# endif +# endif +# if @HAVE_DUPLOCALE@ +_GL_CXXALIASWARN (duplocale); +# endif +#elif defined GNULIB_POSIXCHECK +# undef duplocale +# if HAVE_RAW_DECL_DUPLOCALE +_GL_WARN_ON_USE (duplocale, "duplocale is buggy on some glibc systems - " + "use gnulib module duplocale for portability"); +# endif +#endif + +#endif /* _@GUARD_PREFIX@_LOCALE_H */ +#endif /* _@GUARD_PREFIX@_LOCALE_H */ diff -Nru libdap-3.11.1/gl/localeconv.c libdap-3.12.0/gl/localeconv.c --- libdap-3.11.1/gl/localeconv.c 1970-01-01 00:00:00.000000000 +0000 +++ libdap-3.12.0/gl/localeconv.c 2013-10-17 21:27:40.000000000 +0000 @@ -0,0 +1,103 @@ +/* Query locale dependent information for formatting numbers. + Copyright (C) 2012 Free Software Foundation, Inc. + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU Lesser General Public License as published by + the Free Software Foundation; either version 3 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 Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public License + along with this program. If not, see . */ + +#include + +/* Specification. */ +#include + +#if HAVE_STRUCT_LCONV_DECIMAL_POINT + +/* Override for platforms where 'struct lconv' lacks the int_p_*, int_n_* + members. */ + +struct lconv * +localeconv (void) +{ + static struct lconv result; +# undef lconv +# undef localeconv + struct lconv *sys_result = localeconv (); + + result.decimal_point = sys_result->decimal_point; + result.thousands_sep = sys_result->thousands_sep; + result.grouping = sys_result->grouping; + result.mon_decimal_point = sys_result->mon_decimal_point; + result.mon_thousands_sep = sys_result->mon_thousands_sep; + result.mon_grouping = sys_result->mon_grouping; + result.positive_sign = sys_result->positive_sign; + result.negative_sign = sys_result->negative_sign; + result.currency_symbol = sys_result->currency_symbol; + result.frac_digits = sys_result->frac_digits; + result.p_cs_precedes = sys_result->p_cs_precedes; + result.p_sign_posn = sys_result->p_sign_posn; + result.p_sep_by_space = sys_result->p_sep_by_space; + result.n_cs_precedes = sys_result->n_cs_precedes; + result.n_sign_posn = sys_result->n_sign_posn; + result.n_sep_by_space = sys_result->n_sep_by_space; + result.int_curr_symbol = sys_result->int_curr_symbol; + result.int_frac_digits = sys_result->int_frac_digits; + result.int_p_cs_precedes = sys_result->p_cs_precedes; + result.int_p_sign_posn = sys_result->p_sign_posn; + result.int_p_sep_by_space = sys_result->p_sep_by_space; + result.int_n_cs_precedes = sys_result->n_cs_precedes; + result.int_n_sign_posn = sys_result->n_sign_posn; + result.int_n_sep_by_space = sys_result->n_sep_by_space; + + return &result; +} + +#else + +/* Override for platforms where 'struct lconv' is a dummy. */ + +# include + +struct lconv * +localeconv (void) +{ + static /*const*/ struct lconv result = + { + /* decimal_point */ ".", + /* thousands_sep */ "", + /* grouping */ "", + /* mon_decimal_point */ "", + /* mon_thousands_sep */ "", + /* mon_grouping */ "", + /* positive_sign */ "", + /* negative_sign */ "", + /* currency_symbol */ "", + /* frac_digits */ CHAR_MAX, + /* p_cs_precedes */ CHAR_MAX, + /* p_sign_posn */ CHAR_MAX, + /* p_sep_by_space */ CHAR_MAX, + /* n_cs_precedes */ CHAR_MAX, + /* n_sign_posn */ CHAR_MAX, + /* n_sep_by_space */ CHAR_MAX, + /* int_curr_symbol */ "", + /* int_frac_digits */ CHAR_MAX, + /* int_p_cs_precedes */ CHAR_MAX, + /* int_p_sign_posn */ CHAR_MAX, + /* int_p_sep_by_space */ CHAR_MAX, + /* int_n_cs_precedes */ CHAR_MAX, + /* int_n_sign_posn */ CHAR_MAX, + /* int_n_sep_by_space */ CHAR_MAX + }; + + return &result; +} + +#endif diff -Nru libdap-3.11.1/gl/m4/00gnulib.m4 libdap-3.12.0/gl/m4/00gnulib.m4 --- libdap-3.11.1/gl/m4/00gnulib.m4 2011-04-29 13:19:35.000000000 +0000 +++ libdap-3.12.0/gl/m4/00gnulib.m4 2013-10-17 21:27:40.000000000 +0000 @@ -1,5 +1,5 @@ # 00gnulib.m4 serial 2 -dnl Copyright (C) 2009-2011 Free Software Foundation, Inc. +dnl Copyright (C) 2009-2012 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. diff -Nru libdap-3.11.1/gl/m4/alloca.m4 libdap-3.12.0/gl/m4/alloca.m4 --- libdap-3.11.1/gl/m4/alloca.m4 2011-04-29 13:19:35.000000000 +0000 +++ libdap-3.12.0/gl/m4/alloca.m4 2013-10-17 21:27:40.000000000 +0000 @@ -1,5 +1,5 @@ -# alloca.m4 serial 10 -dnl Copyright (C) 2002-2004, 2006-2007, 2009-2011 Free Software Foundation, +# alloca.m4 serial 14 +dnl Copyright (C) 2002-2004, 2006-2007, 2009-2012 Free Software Foundation, dnl Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, @@ -36,8 +36,86 @@ ALLOCA_H=alloca.h fi AC_SUBST([ALLOCA_H]) + AM_CONDITIONAL([GL_GENERATE_ALLOCA_H], [test -n "$ALLOCA_H"]) ]) # Prerequisites of lib/alloca.c. # STACK_DIRECTION is already handled by AC_FUNC_ALLOCA. AC_DEFUN([gl_PREREQ_ALLOCA], [:]) + +# This works around a bug in autoconf <= 2.68. +# See . + +m4_version_prereq([2.69], [] ,[ + +# This is taken from the following Autoconf patch: +# http://git.savannah.gnu.org/cgit/autoconf.git/commit/?id=6cd9f12520b0d6f76d3230d7565feba1ecf29497 + +# _AC_LIBOBJ_ALLOCA +# ----------------- +# Set up the LIBOBJ replacement of 'alloca'. Well, not exactly +# AC_LIBOBJ since we actually set the output variable 'ALLOCA'. +# Nevertheless, for Automake, AC_LIBSOURCES it. +m4_define([_AC_LIBOBJ_ALLOCA], +[# The SVR3 libPW and SVR4 libucb both contain incompatible functions +# that cause trouble. Some versions do not even contain alloca or +# contain a buggy version. If you still want to use their alloca, +# use ar to extract alloca.o from them instead of compiling alloca.c. +AC_LIBSOURCES(alloca.c) +AC_SUBST([ALLOCA], [\${LIBOBJDIR}alloca.$ac_objext])dnl +AC_DEFINE(C_ALLOCA, 1, [Define to 1 if using 'alloca.c'.]) + +AC_CACHE_CHECK(whether 'alloca.c' needs Cray hooks, ac_cv_os_cray, +[AC_EGREP_CPP(webecray, +[#if defined CRAY && ! defined CRAY2 +webecray +#else +wenotbecray +#endif +], ac_cv_os_cray=yes, ac_cv_os_cray=no)]) +if test $ac_cv_os_cray = yes; then + for ac_func in _getb67 GETB67 getb67; do + AC_CHECK_FUNC($ac_func, + [AC_DEFINE_UNQUOTED(CRAY_STACKSEG_END, $ac_func, + [Define to one of '_getb67', 'GETB67', + 'getb67' for Cray-2 and Cray-YMP + systems. This function is required for + 'alloca.c' support on those systems.]) + break]) + done +fi + +AC_CACHE_CHECK([stack direction for C alloca], + [ac_cv_c_stack_direction], +[AC_RUN_IFELSE([AC_LANG_SOURCE( +[AC_INCLUDES_DEFAULT +int +find_stack_direction (int *addr, int depth) +{ + int dir, dummy = 0; + if (! addr) + addr = &dummy; + *addr = addr < &dummy ? 1 : addr == &dummy ? 0 : -1; + dir = depth ? find_stack_direction (addr, depth - 1) : 0; + return dir + dummy; +} + +int +main (int argc, char **argv) +{ + return find_stack_direction (0, argc + !argv + 20) < 0; +}])], + [ac_cv_c_stack_direction=1], + [ac_cv_c_stack_direction=-1], + [ac_cv_c_stack_direction=0])]) +AH_VERBATIM([STACK_DIRECTION], +[/* If using the C implementation of alloca, define if you know the + direction of stack growth for your system; otherwise it will be + automatically deduced at runtime. + STACK_DIRECTION > 0 => grows toward higher addresses + STACK_DIRECTION < 0 => grows toward lower addresses + STACK_DIRECTION = 0 => direction of growth unknown */ +@%:@undef STACK_DIRECTION])dnl +AC_DEFINE_UNQUOTED(STACK_DIRECTION, $ac_cv_c_stack_direction) +])# _AC_LIBOBJ_ALLOCA +]) diff -Nru libdap-3.11.1/gl/m4/btowc.m4 libdap-3.12.0/gl/m4/btowc.m4 --- libdap-3.11.1/gl/m4/btowc.m4 2011-04-29 13:19:35.000000000 +0000 +++ libdap-3.12.0/gl/m4/btowc.m4 2013-10-17 21:27:40.000000000 +0000 @@ -1,5 +1,5 @@ -# btowc.m4 serial 8 -dnl Copyright (C) 2008-2011 Free Software Foundation, Inc. +# btowc.m4 serial 10 +dnl Copyright (C) 2008-2012 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. @@ -108,11 +108,6 @@ *) REPLACE_BTOWC=1 ;; esac fi - if test $HAVE_BTOWC = 0 || test $REPLACE_BTOWC = 1; then - gl_REPLACE_WCHAR_H - AC_LIBOBJ([btowc]) - gl_PREREQ_BTOWC - fi ]) # Prerequisites of lib/btowc.c. diff -Nru libdap-3.11.1/gl/m4/byteswap.m4 libdap-3.12.0/gl/m4/byteswap.m4 --- libdap-3.11.1/gl/m4/byteswap.m4 1970-01-01 00:00:00.000000000 +0000 +++ libdap-3.12.0/gl/m4/byteswap.m4 2013-10-17 21:27:40.000000000 +0000 @@ -0,0 +1,19 @@ +# byteswap.m4 serial 4 +dnl Copyright (C) 2005, 2007, 2009-2012 Free Software Foundation, Inc. +dnl This file is free software; the Free Software Foundation +dnl gives unlimited permission to copy and/or distribute it, +dnl with or without modifications, as long as this notice is preserved. + +dnl Written by Oskar Liljeblad. + +AC_DEFUN([gl_BYTESWAP], +[ + dnl Prerequisites of lib/byteswap.in.h. + AC_CHECK_HEADERS([byteswap.h], [ + BYTESWAP_H='' + ], [ + BYTESWAP_H='byteswap.h' + ]) + AC_SUBST([BYTESWAP_H]) + AM_CONDITIONAL([GL_GENERATE_BYTESWAP_H], [test -n "$BYTESWAP_H"]) +]) diff -Nru libdap-3.11.1/gl/m4/codeset.m4 libdap-3.12.0/gl/m4/codeset.m4 --- libdap-3.11.1/gl/m4/codeset.m4 2011-04-29 13:19:35.000000000 +0000 +++ libdap-3.12.0/gl/m4/codeset.m4 2013-10-17 21:27:40.000000000 +0000 @@ -1,5 +1,5 @@ # codeset.m4 serial 5 (gettext-0.18.2) -dnl Copyright (C) 2000-2002, 2006, 2008-2011 Free Software Foundation, Inc. +dnl Copyright (C) 2000-2002, 2006, 2008-2012 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. diff -Nru libdap-3.11.1/gl/m4/configmake.m4 libdap-3.12.0/gl/m4/configmake.m4 --- libdap-3.11.1/gl/m4/configmake.m4 2011-04-29 13:19:35.000000000 +0000 +++ libdap-3.12.0/gl/m4/configmake.m4 2013-10-17 21:27:40.000000000 +0000 @@ -1,5 +1,5 @@ # configmake.m4 serial 1 -dnl Copyright (C) 2010-2011 Free Software Foundation, Inc. +dnl Copyright (C) 2010-2012 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. diff -Nru libdap-3.11.1/gl/m4/extensions.m4 libdap-3.12.0/gl/m4/extensions.m4 --- libdap-3.11.1/gl/m4/extensions.m4 2011-04-29 13:19:35.000000000 +0000 +++ libdap-3.12.0/gl/m4/extensions.m4 2013-10-17 21:27:40.000000000 +0000 @@ -1,7 +1,7 @@ -# serial 9 -*- Autoconf -*- +# serial 12 -*- Autoconf -*- # Enable extensions on systems that normally disable them. -# Copyright (C) 2003, 2006-2011 Free Software Foundation, Inc. +# Copyright (C) 2003, 2006-2012 Free Software Foundation, Inc. # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. @@ -43,7 +43,7 @@ AC_CHECK_HEADER([minix/config.h], [MINIX=yes], [MINIX=]) if test "$MINIX" = yes; then AC_DEFINE([_POSIX_SOURCE], [1], - [Define to 1 if you need to in order for `stat' and other + [Define to 1 if you need to in order for 'stat' and other things to work.]) AC_DEFINE([_POSIX_1_SOURCE], [2], [Define to 2 if the system does not provide POSIX.1 features @@ -67,6 +67,10 @@ #ifndef _ALL_SOURCE # undef _ALL_SOURCE #endif +/* Enable general extensions on Mac OS X. */ +#ifndef _DARWIN_C_SOURCE +# undef _DARWIN_C_SOURCE +#endif /* Enable GNU extensions on systems that have them. */ #ifndef _GNU_SOURCE # undef _GNU_SOURCE @@ -95,6 +99,7 @@ test $ac_cv_safe_to_define___extensions__ = yes && AC_DEFINE([__EXTENSIONS__]) AC_DEFINE([_ALL_SOURCE]) + AC_DEFINE([_DARWIN_C_SOURCE]) AC_DEFINE([_GNU_SOURCE]) AC_DEFINE([_POSIX_PTHREAD_SEMANTICS]) AC_DEFINE([_TANDEM_SOURCE]) diff -Nru libdap-3.11.1/gl/m4/fcntl-o.m4 libdap-3.12.0/gl/m4/fcntl-o.m4 --- libdap-3.11.1/gl/m4/fcntl-o.m4 2011-04-29 13:19:35.000000000 +0000 +++ libdap-3.12.0/gl/m4/fcntl-o.m4 2013-10-17 21:27:40.000000000 +0000 @@ -1,5 +1,5 @@ -# fcntl-o.m4 serial 3 -dnl Copyright (C) 2006, 2009-2011 Free Software Foundation, Inc. +# fcntl-o.m4 serial 4 +dnl Copyright (C) 2006, 2009-2012 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. @@ -17,12 +17,21 @@ m4_ifdef([AC_USE_SYSTEM_EXTENSIONS], [AC_REQUIRE([AC_USE_SYSTEM_EXTENSIONS])], [AC_REQUIRE([AC_GNU_SOURCE])]) + + AC_CHECK_HEADERS_ONCE([unistd.h]) + AC_CHECK_FUNCS_ONCE([symlink]) AC_CACHE_CHECK([for working fcntl.h], [gl_cv_header_working_fcntl_h], [AC_RUN_IFELSE( [AC_LANG_PROGRAM( [[#include #include - #include + #if HAVE_UNISTD_H + # include + #else /* on Windows with MSVC */ + # include + # include + # defined sleep(n) _sleep ((n) * 1000) + #endif #include #ifndef O_NOATIME #define O_NOATIME 0 @@ -38,6 +47,7 @@ ]], [[ int result = !constants; + #if HAVE_SYMLINK { static char const sym[] = "conftest.sym"; if (symlink (".", sym) != 0) @@ -53,6 +63,7 @@ } unlink (sym); } + #endif { static char const file[] = "confdefs.h"; int fd = open (file, O_RDONLY | O_NOATIME); diff -Nru libdap-3.11.1/gl/m4/glibc21.m4 libdap-3.12.0/gl/m4/glibc21.m4 --- libdap-3.11.1/gl/m4/glibc21.m4 2011-04-29 13:19:35.000000000 +0000 +++ libdap-3.12.0/gl/m4/glibc21.m4 2013-10-17 21:27:40.000000000 +0000 @@ -1,5 +1,5 @@ # glibc21.m4 serial 5 -dnl Copyright (C) 2000-2002, 2004, 2008, 2010-2011 Free Software Foundation, +dnl Copyright (C) 2000-2002, 2004, 2008, 2010-2012 Free Software Foundation, dnl Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, diff -Nru libdap-3.11.1/gl/m4/gnulib-cache.m4 libdap-3.12.0/gl/m4/gnulib-cache.m4 --- libdap-3.11.1/gl/m4/gnulib-cache.m4 2011-04-29 13:19:35.000000000 +0000 +++ libdap-3.12.0/gl/m4/gnulib-cache.m4 2013-10-17 21:27:40.000000000 +0000 @@ -1,9 +1,21 @@ -# Copyright (C) 2002-2011 Free Software Foundation, Inc. +# Copyright (C) 2002-2012 Free Software Foundation, Inc. # -# This file is free software, distributed under the terms of the GNU -# General Public License. As a special exception to the GNU General -# Public License, this file may be distributed as part of a program -# that contains a configuration script generated by Autoconf, under +# 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 3 of the License, or +# (at your option) any later version. +# +# This file 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 file. If not, see . +# +# As a special exception to the GNU General Public License, +# this file may be distributed as part of a program that +# contains a configuration script generated by Autoconf, under # the same distribution terms as the rest of that program. # # Generated by gnulib-tool. @@ -15,11 +27,12 @@ # Specification in the form of a command-line invocation: -# gnulib-tool --import --dir=. --lib=libgnu --source-base=gl --m4-base=gl/m4 --doc-base=gl/doc --tests-base=tests --aux-dir=conf --lgpl --libtool --macro-prefix=gl regex +# gnulib-tool --import --dir=. --lib=libgnu --source-base=gl --m4-base=gl/m4 --doc-base=gl/doc --tests-base=tests --aux-dir=conf --lgpl --no-conditional-dependencies --libtool --macro-prefix=gl byteswap regex # Specification in the form of a few gnulib-tool.m4 macro invocations: gl_LOCAL_DIR([]) gl_MODULES([ + byteswap regex ]) gl_AVOID([]) @@ -34,3 +47,4 @@ gl_LIBTOOL gl_MACRO_PREFIX([gl]) gl_PO_DOMAIN([]) +gl_WITNESS_C_DOMAIN([]) diff -Nru libdap-3.11.1/gl/m4/gnulib-common.m4 libdap-3.12.0/gl/m4/gnulib-common.m4 --- libdap-3.11.1/gl/m4/gnulib-common.m4 2011-04-29 13:19:35.000000000 +0000 +++ libdap-3.12.0/gl/m4/gnulib-common.m4 2013-10-17 21:27:40.000000000 +0000 @@ -1,5 +1,5 @@ -# gnulib-common.m4 serial 23 -dnl Copyright (C) 2007-2011 Free Software Foundation, Inc. +# gnulib-common.m4 serial 33 +dnl Copyright (C) 2007-2012 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. @@ -12,11 +12,25 @@ AC_REQUIRE([gl_COMMON_BODY]) ]) AC_DEFUN([gl_COMMON_BODY], [ + AH_VERBATIM([_Noreturn], +[/* The _Noreturn keyword of C11. */ +#if ! (defined _Noreturn \ + || (defined __STDC_VERSION__ && 201112 <= __STDC_VERSION__)) +# if (3 <= __GNUC__ || (__GNUC__ == 2 && 8 <= __GNUC_MINOR__) \ + || 0x5110 <= __SUNPRO_C) +# define _Noreturn __attribute__ ((__noreturn__)) +# elif defined _MSC_VER && 1200 <= _MSC_VER +# define _Noreturn __declspec (noreturn) +# else +# define _Noreturn +# endif +#endif +]) AH_VERBATIM([isoc99_inline], [/* Work around a bug in Apple GCC 4.0.1 build 5465: In C99 mode, it supports the ISO C 99 semantics of 'extern inline' (unlike the GNU C semantics of earlier versions), but does not display it by setting __GNUC_STDC_INLINE__. - __APPLE__ && __MACH__ test for MacOS X. + __APPLE__ && __MACH__ test for Mac OS X. __APPLE_CC__ tests for the Apple compiler and its version. __STDC_VERSION__ tests for the C99 mode. */ #if defined __APPLE__ && defined __MACH__ && __APPLE_CC__ >= 5465 && !defined __cplusplus && __STDC_VERSION__ >= 199901L && !defined __GNUC_STDC_INLINE__ @@ -34,6 +48,20 @@ /* The name _UNUSED_PARAMETER_ is an earlier spelling, although the name is a misnomer outside of parameter lists. */ #define _UNUSED_PARAMETER_ _GL_UNUSED + +/* The __pure__ attribute was added in gcc 2.96. */ +#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 96) +# define _GL_ATTRIBUTE_PURE __attribute__ ((__pure__)) +#else +# define _GL_ATTRIBUTE_PURE /* empty */ +#endif + +/* The __const__ attribute was added in gcc 2.95. */ +#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 95) +# define _GL_ATTRIBUTE_CONST __attribute__ ((__const__)) +#else +# define _GL_ATTRIBUTE_CONST /* empty */ +#endif ]) dnl Preparation for running test programs: dnl Tell glibc to write diagnostics from -D_FORTIFY_SOURCE=2 to stderr, not @@ -47,16 +75,49 @@ # expands to a C preprocessor expression that evaluates to 1 or 0, depending # whether a gnulib module that has been requested shall be considered present # or not. -AC_DEFUN([gl_MODULE_INDICATOR_CONDITION], [1]) +m4_define([gl_MODULE_INDICATOR_CONDITION], [1]) # gl_MODULE_INDICATOR_SET_VARIABLE([modulename]) # sets the shell variable that indicates the presence of the given module to # a C preprocessor expression that will evaluate to 1. AC_DEFUN([gl_MODULE_INDICATOR_SET_VARIABLE], [ - GNULIB_[]m4_translit([[$1]], - [abcdefghijklmnopqrstuvwxyz./-], - [ABCDEFGHIJKLMNOPQRSTUVWXYZ___])=gl_MODULE_INDICATOR_CONDITION + gl_MODULE_INDICATOR_SET_VARIABLE_AUX( + [GNULIB_[]m4_translit([[$1]], + [abcdefghijklmnopqrstuvwxyz./-], + [ABCDEFGHIJKLMNOPQRSTUVWXYZ___])], + [gl_MODULE_INDICATOR_CONDITION]) +]) + +# gl_MODULE_INDICATOR_SET_VARIABLE_AUX([variable]) +# modifies the shell variable to include the gl_MODULE_INDICATOR_CONDITION. +# The shell variable's value is a C preprocessor expression that evaluates +# to 0 or 1. +AC_DEFUN([gl_MODULE_INDICATOR_SET_VARIABLE_AUX], +[ + m4_if(m4_defn([gl_MODULE_INDICATOR_CONDITION]), [1], + [ + dnl Simplify the expression VALUE || 1 to 1. + $1=1 + ], + [gl_MODULE_INDICATOR_SET_VARIABLE_AUX_OR([$1], + [gl_MODULE_INDICATOR_CONDITION])]) +]) + +# gl_MODULE_INDICATOR_SET_VARIABLE_AUX_OR([variable], [condition]) +# modifies the shell variable to include the given condition. The shell +# variable's value is a C preprocessor expression that evaluates to 0 or 1. +AC_DEFUN([gl_MODULE_INDICATOR_SET_VARIABLE_AUX_OR], +[ + dnl Simplify the expression 1 || CONDITION to 1. + if test "$[]$1" != 1; then + dnl Simplify the expression 0 || CONDITION to CONDITION. + if test "$[]$1" = 0; then + $1=$2 + else + $1="($[]$1 || $2)" + fi + fi ]) # gl_MODULE_INDICATOR([modulename]) @@ -109,7 +170,8 @@ AC_DEFUN([gl_ASSERT_NO_GNULIB_POSIXCHECK], [ dnl Override gl_WARN_ON_USE_PREPARE. - AC_DEFUN([gl_WARN_ON_USE_PREPARE], []) + dnl But hide this definition from 'aclocal'. + AC_DEFUN([gl_W][ARN_ON_USE_PREPARE], []) ]) # gl_ASSERT_NO_GNULIB_TESTS @@ -150,6 +212,83 @@ [m4_define([AS_VAR_IF], [AS_IF([test x"AS_VAR_GET([$1])" = x""$2], [$3], [$4])])]) +# gl_PROG_CC_C99 +# Modifies the value of the shell variable CC in an attempt to make $CC +# understand ISO C99 source code. +# This is like AC_PROG_CC_C99, except that +# - AC_PROG_CC_C99 did not exist in Autoconf versions < 2.60, +# - AC_PROG_CC_C99 does not mix well with AC_PROG_CC_STDC +# , +# but many more packages use AC_PROG_CC_STDC than AC_PROG_CC_C99 +# . +# Remaining problems: +# - When AC_PROG_CC_STDC is invoked twice, it adds the C99 enabling options +# to CC twice +# . +# - AC_PROG_CC_STDC is likely to change now that C11 is an ISO standard. +AC_DEFUN([gl_PROG_CC_C99], +[ + dnl Change that version number to the minimum Autoconf version that supports + dnl mixing AC_PROG_CC_C99 calls with AC_PROG_CC_STDC calls. + m4_version_prereq([9.0], + [AC_REQUIRE([AC_PROG_CC_C99])], + [AC_REQUIRE([AC_PROG_CC_STDC])]) +]) + +# gl_PROG_AR_RANLIB +# Determines the values for AR, ARFLAGS, RANLIB that fit with the compiler. +# The user can set the variables AR, ARFLAGS, RANLIB if he wants to override +# the values. +AC_DEFUN([gl_PROG_AR_RANLIB], +[ + dnl Minix 3 comes with two toolchains: The Amsterdam Compiler Kit compiler + dnl as "cc", and GCC as "gcc". They have different object file formats and + dnl library formats. In particular, the GNU binutils programs ar, ranlib + dnl produce libraries that work only with gcc, not with cc. + AC_REQUIRE([AC_PROG_CC]) + AC_CACHE_CHECK([for Minix Amsterdam compiler], [gl_cv_c_amsterdam_compiler], + [ + AC_EGREP_CPP([Amsterdam], + [ +#ifdef __ACK__ +Amsterdam +#endif + ], + [gl_cv_c_amsterdam_compiler=yes], + [gl_cv_c_amsterdam_compiler=no]) + ]) + if test -z "$AR"; then + if test $gl_cv_c_amsterdam_compiler = yes; then + AR='cc -c.a' + if test -z "$ARFLAGS"; then + ARFLAGS='-o' + fi + else + dnl Use the Automake-documented default values for AR and ARFLAGS, + dnl but prefer ${host}-ar over ar (useful for cross-compiling). + AC_CHECK_TOOL([AR], [ar], [ar]) + if test -z "$ARFLAGS"; then + ARFLAGS='cru' + fi + fi + else + if test -z "$ARFLAGS"; then + ARFLAGS='cru' + fi + fi + AC_SUBST([AR]) + AC_SUBST([ARFLAGS]) + if test -z "$RANLIB"; then + if test $gl_cv_c_amsterdam_compiler = yes; then + RANLIB=':' + else + dnl Use the ranlib program if it is available. + AC_PROG_RANLIB + fi + fi + AC_SUBST([RANLIB]) +]) + # AC_PROG_MKDIR_P # is a backport of autoconf-2.60's AC_PROG_MKDIR_P, with a fix # for interoperability with automake-1.9.6 from autoconf-2.62. diff -Nru libdap-3.11.1/gl/m4/gnulib-comp.m4 libdap-3.12.0/gl/m4/gnulib-comp.m4 --- libdap-3.11.1/gl/m4/gnulib-comp.m4 2011-04-29 13:19:35.000000000 +0000 +++ libdap-3.12.0/gl/m4/gnulib-comp.m4 2013-10-17 21:27:40.000000000 +0000 @@ -1,10 +1,22 @@ # DO NOT EDIT! GENERATED AUTOMATICALLY! -# Copyright (C) 2002-2011 Free Software Foundation, Inc. +# Copyright (C) 2002-2012 Free Software Foundation, Inc. # -# This file is free software, distributed under the terms of the GNU -# General Public License. As a special exception to the GNU General -# Public License, this file may be distributed as part of a program -# that contains a configuration script generated by Autoconf, under +# 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 3 of the License, or +# (at your option) any later version. +# +# This file 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 file. If not, see . +# +# As a special exception to the GNU General Public License, +# this file may be distributed as part of a program that +# contains a configuration script generated by Autoconf, under # the same distribution terms as the rest of that program. # # Generated by gnulib-tool. @@ -25,11 +37,10 @@ m4_pattern_allow([^gl_ES$])dnl a valid locale name m4_pattern_allow([^gl_LIBOBJS$])dnl a variable m4_pattern_allow([^gl_LTLIBOBJS$])dnl a variable - AC_REQUIRE([AC_PROG_RANLIB]) + AC_REQUIRE([gl_PROG_AR_RANLIB]) # Code from module alloca-opt: - # Code from module arg-nonnull: # Code from module btowc: - # Code from module c++defs: + # Code from module byteswap: # Code from module configmake: # Code from module extensions: AC_REQUIRE([gl_USE_SYSTEM_EXTENSIONS]) @@ -37,25 +48,34 @@ # Code from module include_next: # Code from module langinfo: # Code from module localcharset: + # Code from module locale: + # Code from module localeconv: # Code from module malloc-gnu: # Code from module malloc-posix: # Code from module mbrtowc: # Code from module mbsinit: + # Code from module mbtowc: # Code from module multiarch: # Code from module nl_langinfo: # Code from module regex: + # Code from module snippet/_Noreturn: + # Code from module snippet/arg-nonnull: + # Code from module snippet/c++defs: + # Code from module snippet/warn-on-use: # Code from module ssize_t: # Code from module stdbool: # Code from module stddef: # Code from module stdint: # Code from module stdlib: + # Code from module strcase: # Code from module streq: + # Code from module strings: + # Code from module sys_types: # Code from module unistd: # Code from module verify: - # Code from module warn-on-use: # Code from module wchar: # Code from module wcrtomb: - # Code from module wctype: + # Code from module wctype-h: ]) # This macro should be invoked from ./configure.ac, in the section @@ -72,67 +92,93 @@ m4_pushdef([gl_LIBSOURCES_DIR], []) gl_COMMON gl_source_base='gl' - # Code from module alloca-opt: - gl_FUNC_ALLOCA - # Code from module arg-nonnull: - # Code from module btowc: - gl_FUNC_BTOWC - gl_WCHAR_MODULE_INDICATOR([btowc]) - # Code from module c++defs: - # Code from module configmake: - gl_CONFIGMAKE_PREP - # Code from module extensions: - # Code from module gettext-h: - AC_SUBST([LIBINTL]) - AC_SUBST([LTLIBINTL]) - # Code from module include_next: - # Code from module langinfo: - gl_LANGINFO_H - # Code from module localcharset: - gl_LOCALCHARSET - LOCALCHARSET_TESTS_ENVIRONMENT="CHARSETALIASDIR=\"\$(top_builddir)/$gl_source_base\"" - AC_SUBST([LOCALCHARSET_TESTS_ENVIRONMENT]) - # Code from module malloc-gnu: - gl_FUNC_MALLOC_GNU - gl_MODULE_INDICATOR([malloc-gnu]) - # Code from module malloc-posix: - gl_FUNC_MALLOC_POSIX - gl_STDLIB_MODULE_INDICATOR([malloc-posix]) - # Code from module mbrtowc: - gl_FUNC_MBRTOWC - gl_WCHAR_MODULE_INDICATOR([mbrtowc]) - # Code from module mbsinit: - gl_FUNC_MBSINIT - gl_WCHAR_MODULE_INDICATOR([mbsinit]) - # Code from module multiarch: - gl_MULTIARCH - # Code from module nl_langinfo: - gl_FUNC_NL_LANGINFO - gl_LANGINFO_MODULE_INDICATOR([nl_langinfo]) - # Code from module regex: - gl_REGEX - # Code from module ssize_t: - gt_TYPE_SSIZE_T - # Code from module stdbool: - AM_STDBOOL_H - # Code from module stddef: - gl_STDDEF_H - # Code from module stdint: - gl_STDINT_H - # Code from module stdlib: - gl_STDLIB_H - # Code from module streq: - # Code from module unistd: - gl_UNISTD_H - # Code from module verify: - # Code from module warn-on-use: - # Code from module wchar: - gl_WCHAR_H - # Code from module wcrtomb: - gl_FUNC_WCRTOMB - gl_WCHAR_MODULE_INDICATOR([wcrtomb]) - # Code from module wctype: - gl_WCTYPE_H +gl_FUNC_ALLOCA +gl_FUNC_BTOWC +if test $HAVE_BTOWC = 0 || test $REPLACE_BTOWC = 1; then + AC_LIBOBJ([btowc]) + gl_PREREQ_BTOWC +fi +gl_WCHAR_MODULE_INDICATOR([btowc]) +gl_BYTESWAP +gl_CONFIGMAKE_PREP +AC_SUBST([LIBINTL]) +AC_SUBST([LTLIBINTL]) +gl_LANGINFO_H +gl_LOCALCHARSET +LOCALCHARSET_TESTS_ENVIRONMENT="CHARSETALIASDIR=\"\$(abs_top_builddir)/$gl_source_base\"" +AC_SUBST([LOCALCHARSET_TESTS_ENVIRONMENT]) +gl_LOCALE_H +gl_FUNC_LOCALECONV +if test $REPLACE_LOCALECONV = 1; then + AC_LIBOBJ([localeconv]) + gl_PREREQ_LOCALECONV +fi +gl_LOCALE_MODULE_INDICATOR([localeconv]) +gl_FUNC_MALLOC_GNU +if test $REPLACE_MALLOC = 1; then + AC_LIBOBJ([malloc]) +fi +gl_MODULE_INDICATOR([malloc-gnu]) +gl_FUNC_MALLOC_POSIX +if test $REPLACE_MALLOC = 1; then + AC_LIBOBJ([malloc]) +fi +gl_STDLIB_MODULE_INDICATOR([malloc-posix]) +gl_FUNC_MBRTOWC +if test $HAVE_MBRTOWC = 0 || test $REPLACE_MBRTOWC = 1; then + AC_LIBOBJ([mbrtowc]) + gl_PREREQ_MBRTOWC +fi +gl_WCHAR_MODULE_INDICATOR([mbrtowc]) +gl_FUNC_MBSINIT +if test $HAVE_MBSINIT = 0 || test $REPLACE_MBSINIT = 1; then + AC_LIBOBJ([mbsinit]) + gl_PREREQ_MBSINIT +fi +gl_WCHAR_MODULE_INDICATOR([mbsinit]) +gl_FUNC_MBTOWC +if test $REPLACE_MBTOWC = 1; then + AC_LIBOBJ([mbtowc]) + gl_PREREQ_MBTOWC +fi +gl_STDLIB_MODULE_INDICATOR([mbtowc]) +gl_MULTIARCH +gl_FUNC_NL_LANGINFO +if test $HAVE_NL_LANGINFO = 0 || test $REPLACE_NL_LANGINFO = 1; then + AC_LIBOBJ([nl_langinfo]) +fi +gl_LANGINFO_MODULE_INDICATOR([nl_langinfo]) +gl_REGEX +if test $ac_use_included_regex = yes; then + AC_LIBOBJ([regex]) + gl_PREREQ_REGEX +fi +gt_TYPE_SSIZE_T +AM_STDBOOL_H +gl_STDDEF_H +gl_STDINT_H +gl_STDLIB_H +gl_STRCASE +if test $HAVE_STRCASECMP = 0; then + AC_LIBOBJ([strcasecmp]) + gl_PREREQ_STRCASECMP +fi +if test $HAVE_STRNCASECMP = 0; then + AC_LIBOBJ([strncasecmp]) + gl_PREREQ_STRNCASECMP +fi +gl_HEADER_STRINGS_H +gl_SYS_TYPES_H +AC_PROG_MKDIR_P +gl_UNISTD_H +gl_WCHAR_H +gl_FUNC_WCRTOMB +if test $HAVE_WCRTOMB = 0 || test $REPLACE_WCRTOMB = 1; then + AC_LIBOBJ([wcrtomb]) + gl_PREREQ_WCRTOMB +fi +gl_WCHAR_MODULE_INDICATOR([wcrtomb]) +gl_WCTYPE_H # End of code from modules m4_ifval(gl_LIBSOURCES_LIST, [ m4_syscmd([test ! -d ]m4_defn([gl_LIBSOURCES_DIR])[ || @@ -269,20 +315,25 @@ # This macro records the list of files which have been installed by # gnulib-tool and may be removed by future gnulib-tool invocations. AC_DEFUN([gl_FILE_LIST], [ - build-aux/arg-nonnull.h - build-aux/c++defs.h - build-aux/warn-on-use.h + build-aux/snippet/_Noreturn.h + build-aux/snippet/arg-nonnull.h + build-aux/snippet/c++defs.h + build-aux/snippet/warn-on-use.h lib/alloca.in.h lib/btowc.c + lib/byteswap.in.h lib/config.charset lib/gettext.h - lib/iswblank.c lib/langinfo.in.h lib/localcharset.c lib/localcharset.h + lib/locale.in.h + lib/localeconv.c lib/malloc.c lib/mbrtowc.c lib/mbsinit.c + lib/mbtowc-impl.h + lib/mbtowc.c lib/nl_langinfo.c lib/ref-add.sin lib/ref-del.sin @@ -296,7 +347,11 @@ lib/stddef.in.h lib/stdint.in.h lib/stdlib.in.h + lib/strcasecmp.c lib/streq.h + lib/strings.in.h + lib/strncasecmp.c + lib/sys_types.in.h lib/unistd.in.h lib/verify.h lib/wchar.in.h @@ -305,6 +360,7 @@ m4/00gnulib.m4 m4/alloca.m4 m4/btowc.m4 + m4/byteswap.m4 m4/codeset.m4 m4/configmake.m4 m4/extensions.m4 @@ -317,19 +373,26 @@ m4/locale-fr.m4 m4/locale-ja.m4 m4/locale-zh.m4 + m4/locale_h.m4 + m4/localeconv.m4 m4/longlong.m4 m4/malloc.m4 m4/mbrtowc.m4 m4/mbsinit.m4 m4/mbstate_t.m4 + m4/mbtowc.m4 m4/multiarch.m4 m4/nl_langinfo.m4 + m4/off_t.m4 m4/regex.m4 m4/ssize_t.m4 m4/stdbool.m4 m4/stddef_h.m4 m4/stdint.m4 m4/stdlib_h.m4 + m4/strcase.m4 + m4/strings_h.m4 + m4/sys_types_h.m4 m4/unistd_h.m4 m4/warn-on-use.m4 m4/wchar_h.m4 diff -Nru libdap-3.11.1/gl/m4/gnulib-tool.m4 libdap-3.12.0/gl/m4/gnulib-tool.m4 --- libdap-3.11.1/gl/m4/gnulib-tool.m4 2011-04-29 13:19:35.000000000 +0000 +++ libdap-3.12.0/gl/m4/gnulib-tool.m4 2013-10-17 21:27:40.000000000 +0000 @@ -1,5 +1,5 @@ # gnulib-tool.m4 serial 2 -dnl Copyright (C) 2004-2005, 2009-2011 Free Software Foundation, Inc. +dnl Copyright (C) 2004-2005, 2009-2012 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. diff -Nru libdap-3.11.1/gl/m4/include_next.m4 libdap-3.12.0/gl/m4/include_next.m4 --- libdap-3.11.1/gl/m4/include_next.m4 2011-04-29 13:19:35.000000000 +0000 +++ libdap-3.12.0/gl/m4/include_next.m4 2013-10-17 21:27:40.000000000 +0000 @@ -1,5 +1,5 @@ -# include_next.m4 serial 18 -dnl Copyright (C) 2006-2011 Free Software Foundation, Inc. +# include_next.m4 serial 23 +dnl Copyright (C) 2006-2012 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. @@ -143,7 +143,7 @@ # even if the compiler does not support include_next. # The three "///" are to pacify Sun C 5.8, which otherwise would say # "warning: #include of /usr/include/... may be non-portable". -# Use `""', not `<>', so that the /// cannot be confused with a C99 comment. +# Use '""', not '<>', so that the /// cannot be confused with a C99 comment. # Note: This macro assumes that the header file is not empty after # preprocessing, i.e. it does not only define preprocessor macros but also # provides some type/enum definitions or function/variable declarations. @@ -175,11 +175,13 @@ [AC_CHECK_HEADERS_ONCE([$1]) ]) +dnl FIXME: gl_next_header and gl_header_exists must be used unquoted +dnl until we can assume autoconf 2.64 or newer. m4_foreach_w([gl_HEADER_NAME], [$1], [AS_VAR_PUSHDEF([gl_next_header], [gl_cv_next_]m4_defn([gl_HEADER_NAME])) if test $gl_cv_have_include_next = yes; then - AS_VAR_SET([gl_next_header], ['<'gl_HEADER_NAME'>']) + AS_VAR_SET(gl_next_header, ['<'gl_HEADER_NAME'>']) else AC_CACHE_CHECK( [absolute name of <]m4_defn([gl_HEADER_NAME])[>], @@ -205,33 +207,57 @@ aix*) gl_absname_cpp="$ac_cpp -C" ;; *) gl_absname_cpp="$ac_cpp" ;; esac +changequote(,) + case "$host_os" in + mingw*) + dnl For the sake of native Windows compilers (excluding gcc), + dnl treat backslash as a directory separator, like /. + dnl Actually, these compilers use a double-backslash as + dnl directory separator, inside the + dnl # line "filename" + dnl directives. + gl_dirsep_regex='[/\\]' + ;; + *) + gl_dirsep_regex='\/' + ;; + esac + dnl A sed expression that turns a string into a basic regular + dnl expression, for use within "/.../". + gl_make_literal_regex_sed='s,[]$^\\.*/[],\\&,g' +changequote([,]) + gl_header_literal_regex=`echo ']m4_defn([gl_HEADER_NAME])[' \ + | sed -e "$gl_make_literal_regex_sed"` + gl_absolute_header_sed="/${gl_dirsep_regex}${gl_header_literal_regex}/"'{ + s/.*"\(.*'"${gl_dirsep_regex}${gl_header_literal_regex}"'\)".*/\1/ +changequote(,)dnl + s|^/[^/]|//&| +changequote([,])dnl + p + q + }' dnl eval is necessary to expand gl_absname_cpp. dnl Ultrix and Pyramid sh refuse to redirect output of eval, dnl so use subshell. - AS_VAR_SET([gl_next_header], + AS_VAR_SET(gl_next_header, ['"'`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&AS_MESSAGE_LOG_FD | - sed -n '\#/]m4_defn([gl_HEADER_NAME])[#{ - s#.*"\(.*/]m4_defn([gl_HEADER_NAME])[\)".*#\1# - s#^/[^/]#//&# - p - q - }'`'"']) + sed -n "$gl_absolute_header_sed"`'"']) m4_if([$2], [check], [else - AS_VAR_SET([gl_next_header], ['<'gl_HEADER_NAME'>']) + AS_VAR_SET(gl_next_header, ['<'gl_HEADER_NAME'>']) fi ]) ]) fi AC_SUBST( AS_TR_CPP([NEXT_]m4_defn([gl_HEADER_NAME])), - [AS_VAR_GET([gl_next_header])]) + [AS_VAR_GET(gl_next_header)]) if test $gl_cv_have_include_next = yes || test $gl_cv_have_include_next = buggy; then # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include_next' gl_next_as_first_directive='<'gl_HEADER_NAME'>' else # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include' - gl_next_as_first_directive=AS_VAR_GET([gl_next_header]) + gl_next_as_first_directive=AS_VAR_GET(gl_next_header) fi AC_SUBST( AS_TR_CPP([NEXT_AS_FIRST_DIRECTIVE_]m4_defn([gl_HEADER_NAME])), diff -Nru libdap-3.11.1/gl/m4/langinfo_h.m4 libdap-3.12.0/gl/m4/langinfo_h.m4 --- libdap-3.11.1/gl/m4/langinfo_h.m4 2011-04-29 13:19:35.000000000 +0000 +++ libdap-3.12.0/gl/m4/langinfo_h.m4 2013-10-17 21:27:40.000000000 +0000 @@ -1,5 +1,5 @@ # langinfo_h.m4 serial 7 -dnl Copyright (C) 2009-2011 Free Software Foundation, Inc. +dnl Copyright (C) 2009-2012 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. diff -Nru libdap-3.11.1/gl/m4/localcharset.m4 libdap-3.12.0/gl/m4/localcharset.m4 --- libdap-3.11.1/gl/m4/localcharset.m4 2011-04-29 13:19:35.000000000 +0000 +++ libdap-3.12.0/gl/m4/localcharset.m4 2013-10-17 21:27:40.000000000 +0000 @@ -1,5 +1,5 @@ # localcharset.m4 serial 7 -dnl Copyright (C) 2002, 2004, 2006, 2009-2011 Free Software Foundation, Inc. +dnl Copyright (C) 2002, 2004, 2006, 2009-2012 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. diff -Nru libdap-3.11.1/gl/m4/locale-fr.m4 libdap-3.12.0/gl/m4/locale-fr.m4 --- libdap-3.11.1/gl/m4/locale-fr.m4 2011-04-29 13:19:35.000000000 +0000 +++ libdap-3.12.0/gl/m4/locale-fr.m4 2013-10-17 21:27:40.000000000 +0000 @@ -1,5 +1,5 @@ -# locale-fr.m4 serial 12 -dnl Copyright (C) 2003, 2005-2011 Free Software Foundation, Inc. +# locale-fr.m4 serial 17 +dnl Copyright (C) 2003, 2005-2012 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. @@ -25,9 +25,19 @@ char buf[16]; int main () { /* Check whether the given locale name is recognized by the system. */ +#if (defined _WIN32 || defined __WIN32__) && !defined __CYGWIN__ + /* On native Windows, setlocale(category, "") looks at the system settings, + not at the environment variables. Also, when an encoding suffix such + as ".65001" or ".54936" is specified, it succeeds but sets the LC_CTYPE + category of the locale to "C". */ + if (setlocale (LC_ALL, getenv ("LC_ALL")) == NULL + || strcmp (setlocale (LC_CTYPE, NULL), "C") == 0) + return 1; +#else if (setlocale (LC_ALL, "") == NULL) return 1; +#endif /* Check whether nl_langinfo(CODESET) is nonempty and not "ASCII" or "646". - On MacOS X 10.3.5 (Darwin 7.5) in the fr_FR locale, nl_langinfo(CODESET) + On Mac OS X 10.3.5 (Darwin 7.5) in the fr_FR locale, nl_langinfo(CODESET) is empty, and the behaviour of Tcl 8.4 in this locale is not useful. On OpenBSD 4.0, when an unsupported locale is specified, setlocale() succeeds but then nl_langinfo(CODESET) is "646". In this situation, @@ -53,46 +63,67 @@ one byte long. This excludes the UTF-8 encoding. */ t.tm_year = 1975 - 1900; t.tm_mon = 2 - 1; t.tm_mday = 4; if (strftime (buf, sizeof (buf), "%b", &t) < 3 || buf[2] != 'v') return 1; +#if !defined __BIONIC__ /* Bionic libc's 'struct lconv' is just a dummy. */ /* Check whether the decimal separator is a comma. On NetBSD 3.0 in the fr_FR.ISO8859-1 locale, localeconv()->decimal_point are nl_langinfo(RADIXCHAR) are both ".". */ if (localeconv () ->decimal_point[0] != ',') return 1; +#endif return 0; } changequote([,])dnl ])]) if AC_TRY_EVAL([ac_link]) && test -s conftest$ac_exeext; then - # Setting LC_ALL is not enough. Need to set LC_TIME to empty, because - # otherwise on MacOS X 10.3.5 the LC_TIME=C from the beginning of the - # configure script would override the LC_ALL setting. Likewise for - # LC_CTYPE, which is also set at the beginning of the configure script. - # Test for the usual locale name. - if (LC_ALL=fr_FR LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then - gt_cv_locale_fr=fr_FR - else - # Test for the locale name with explicit encoding suffix. - if (LC_ALL=fr_FR.ISO-8859-1 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then - gt_cv_locale_fr=fr_FR.ISO-8859-1 - else - # Test for the AIX, OSF/1, FreeBSD, NetBSD, OpenBSD locale name. - if (LC_ALL=fr_FR.ISO8859-1 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then - gt_cv_locale_fr=fr_FR.ISO8859-1 + case "$host_os" in + # Handle native Windows specially, because there setlocale() interprets + # "ar" as "Arabic" or "Arabic_Saudi Arabia.1256", + # "fr" or "fra" as "French" or "French_France.1252", + # "ge"(!) or "deu"(!) as "German" or "German_Germany.1252", + # "ja" as "Japanese" or "Japanese_Japan.932", + # and similar. + mingw*) + # Test for the native Windows locale name. + if (LC_ALL=French_France.1252 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_fr=French_France.1252 + else + # None found. + gt_cv_locale_fr=none + fi + ;; + *) + # Setting LC_ALL is not enough. Need to set LC_TIME to empty, because + # otherwise on Mac OS X 10.3.5 the LC_TIME=C from the beginning of the + # configure script would override the LC_ALL setting. Likewise for + # LC_CTYPE, which is also set at the beginning of the configure script. + # Test for the usual locale name. + if (LC_ALL=fr_FR LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_fr=fr_FR else - # Test for the HP-UX locale name. - if (LC_ALL=fr_FR.iso88591 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then - gt_cv_locale_fr=fr_FR.iso88591 + # Test for the locale name with explicit encoding suffix. + if (LC_ALL=fr_FR.ISO-8859-1 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_fr=fr_FR.ISO-8859-1 else - # Test for the Solaris 7 locale name. - if (LC_ALL=fr LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then - gt_cv_locale_fr=fr + # Test for the AIX, OSF/1, FreeBSD, NetBSD, OpenBSD locale name. + if (LC_ALL=fr_FR.ISO8859-1 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_fr=fr_FR.ISO8859-1 else - # None found. - gt_cv_locale_fr=none + # Test for the HP-UX locale name. + if (LC_ALL=fr_FR.iso88591 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_fr=fr_FR.iso88591 + else + # Test for the Solaris 7 locale name. + if (LC_ALL=fr LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_fr=fr + else + # None found. + gt_cv_locale_fr=none + fi + fi fi fi fi - fi - fi + ;; + esac fi rm -fr conftest* ]) @@ -122,9 +153,19 @@ variables, and all locales use the UTF-8 encoding. */ #if !(defined __BEOS__ || defined __HAIKU__) /* Check whether the given locale name is recognized by the system. */ +# if (defined _WIN32 || defined __WIN32__) && !defined __CYGWIN__ + /* On native Windows, setlocale(category, "") looks at the system settings, + not at the environment variables. Also, when an encoding suffix such + as ".65001" or ".54936" is specified, it succeeds but sets the LC_CTYPE + category of the locale to "C". */ + if (setlocale (LC_ALL, getenv ("LC_ALL")) == NULL + || strcmp (setlocale (LC_CTYPE, NULL), "C") == 0) + return 1; +# else if (setlocale (LC_ALL, "") == NULL) return 1; +# endif /* Check whether nl_langinfo(CODESET) is nonempty and not "ASCII" or "646". - On MacOS X 10.3.5 (Darwin 7.5) in the fr_FR locale, nl_langinfo(CODESET) + On Mac OS X 10.3.5 (Darwin 7.5) in the fr_FR locale, nl_langinfo(CODESET) is empty, and the behaviour of Tcl 8.4 in this locale is not useful. On OpenBSD 4.0, when an unsupported locale is specified, setlocale() succeeds but then nl_langinfo(CODESET) is "646". In this situation, @@ -150,36 +191,57 @@ || buf[1] != (char) 0xc3 || buf[2] != (char) 0xa9 || buf[3] != 'v') return 1; #endif +#if !defined __BIONIC__ /* Bionic libc's 'struct lconv' is just a dummy. */ /* Check whether the decimal separator is a comma. On NetBSD 3.0 in the fr_FR.ISO8859-1 locale, localeconv()->decimal_point are nl_langinfo(RADIXCHAR) are both ".". */ if (localeconv () ->decimal_point[0] != ',') return 1; +#endif return 0; } changequote([,])dnl ])]) if AC_TRY_EVAL([ac_link]) && test -s conftest$ac_exeext; then - # Setting LC_ALL is not enough. Need to set LC_TIME to empty, because - # otherwise on MacOS X 10.3.5 the LC_TIME=C from the beginning of the - # configure script would override the LC_ALL setting. Likewise for - # LC_CTYPE, which is also set at the beginning of the configure script. - # Test for the usual locale name. - if (LC_ALL=fr_FR LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then - gt_cv_locale_fr_utf8=fr_FR - else - # Test for the locale name with explicit encoding suffix. - if (LC_ALL=fr_FR.UTF-8 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then - gt_cv_locale_fr_utf8=fr_FR.UTF-8 - else - # Test for the Solaris 7 locale name. - if (LC_ALL=fr.UTF-8 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then - gt_cv_locale_fr_utf8=fr.UTF-8 + case "$host_os" in + # Handle native Windows specially, because there setlocale() interprets + # "ar" as "Arabic" or "Arabic_Saudi Arabia.1256", + # "fr" or "fra" as "French" or "French_France.1252", + # "ge"(!) or "deu"(!) as "German" or "German_Germany.1252", + # "ja" as "Japanese" or "Japanese_Japan.932", + # and similar. + mingw*) + # Test for the hypothetical native Windows locale name. + if (LC_ALL=French_France.65001 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_fr_utf8=French_France.65001 else # None found. gt_cv_locale_fr_utf8=none fi - fi - fi + ;; + *) + # Setting LC_ALL is not enough. Need to set LC_TIME to empty, because + # otherwise on Mac OS X 10.3.5 the LC_TIME=C from the beginning of the + # configure script would override the LC_ALL setting. Likewise for + # LC_CTYPE, which is also set at the beginning of the configure script. + # Test for the usual locale name. + if (LC_ALL=fr_FR LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_fr_utf8=fr_FR + else + # Test for the locale name with explicit encoding suffix. + if (LC_ALL=fr_FR.UTF-8 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_fr_utf8=fr_FR.UTF-8 + else + # Test for the Solaris 7 locale name. + if (LC_ALL=fr.UTF-8 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_fr_utf8=fr.UTF-8 + else + # None found. + gt_cv_locale_fr_utf8=none + fi + fi + fi + ;; + esac fi rm -fr conftest* ]) diff -Nru libdap-3.11.1/gl/m4/locale-ja.m4 libdap-3.12.0/gl/m4/locale-ja.m4 --- libdap-3.11.1/gl/m4/locale-ja.m4 2011-04-29 13:19:35.000000000 +0000 +++ libdap-3.12.0/gl/m4/locale-ja.m4 2013-10-17 21:27:40.000000000 +0000 @@ -1,5 +1,5 @@ -# locale-ja.m4 serial 8 -dnl Copyright (C) 2003, 2005-2011 Free Software Foundation, Inc. +# locale-ja.m4 serial 12 +dnl Copyright (C) 2003, 2005-2012 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. @@ -27,9 +27,19 @@ { const char *p; /* Check whether the given locale name is recognized by the system. */ +#if (defined _WIN32 || defined __WIN32__) && !defined __CYGWIN__ + /* On native Windows, setlocale(category, "") looks at the system settings, + not at the environment variables. Also, when an encoding suffix such + as ".65001" or ".54936" is specified, it succeeds but sets the LC_CTYPE + category of the locale to "C". */ + if (setlocale (LC_ALL, getenv ("LC_ALL")) == NULL + || strcmp (setlocale (LC_CTYPE, NULL), "C") == 0) + return 1; +#else if (setlocale (LC_ALL, "") == NULL) return 1; +#endif /* Check whether nl_langinfo(CODESET) is nonempty and not "ASCII" or "646". - On MacOS X 10.3.5 (Darwin 7.5) in the fr_FR locale, nl_langinfo(CODESET) + On Mac OS X 10.3.5 (Darwin 7.5) in the fr_FR locale, nl_langinfo(CODESET) is empty, and the behaviour of Tcl 8.4 in this locale is not useful. On OpenBSD 4.0, when an unsupported locale is specified, setlocale() succeeds but then nl_langinfo(CODESET) is "646". In this situation, @@ -66,42 +76,58 @@ changequote([,])dnl ])]) if AC_TRY_EVAL([ac_link]) && test -s conftest$ac_exeext; then - # Setting LC_ALL is not enough. Need to set LC_TIME to empty, because - # otherwise on MacOS X 10.3.5 the LC_TIME=C from the beginning of the - # configure script would override the LC_ALL setting. Likewise for - # LC_CTYPE, which is also set at the beginning of the configure script. - # Test for the AIX locale name. - if (LC_ALL=ja_JP LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then - gt_cv_locale_ja=ja_JP - else - # Test for the locale name with explicit encoding suffix. - if (LC_ALL=ja_JP.EUC-JP LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then - gt_cv_locale_ja=ja_JP.EUC-JP - else - # Test for the HP-UX, OSF/1, NetBSD locale name. - if (LC_ALL=ja_JP.eucJP LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then - gt_cv_locale_ja=ja_JP.eucJP + case "$host_os" in + # Handle native Windows specially, because there setlocale() interprets + # "ar" as "Arabic" or "Arabic_Saudi Arabia.1256", + # "fr" or "fra" as "French" or "French_France.1252", + # "ge"(!) or "deu"(!) as "German" or "German_Germany.1252", + # "ja" as "Japanese" or "Japanese_Japan.932", + # and similar. + mingw*) + # Note that on native Windows, the Japanese locale is + # Japanese_Japan.932, and CP932 is very different from EUC-JP, so we + # cannot use it here. + gt_cv_locale_ja=none + ;; + *) + # Setting LC_ALL is not enough. Need to set LC_TIME to empty, because + # otherwise on Mac OS X 10.3.5 the LC_TIME=C from the beginning of the + # configure script would override the LC_ALL setting. Likewise for + # LC_CTYPE, which is also set at the beginning of the configure script. + # Test for the AIX locale name. + if (LC_ALL=ja_JP LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_ja=ja_JP else - # Test for the IRIX, FreeBSD locale name. - if (LC_ALL=ja_JP.EUC LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then - gt_cv_locale_ja=ja_JP.EUC + # Test for the locale name with explicit encoding suffix. + if (LC_ALL=ja_JP.EUC-JP LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_ja=ja_JP.EUC-JP else - # Test for the Solaris 7 locale name. - if (LC_ALL=ja LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then - gt_cv_locale_ja=ja + # Test for the HP-UX, OSF/1, NetBSD locale name. + if (LC_ALL=ja_JP.eucJP LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_ja=ja_JP.eucJP else - # Special test for NetBSD 1.6. - if test -f /usr/share/locale/ja_JP.eucJP/LC_CTYPE; then - gt_cv_locale_ja=ja_JP.eucJP + # Test for the IRIX, FreeBSD locale name. + if (LC_ALL=ja_JP.EUC LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_ja=ja_JP.EUC else - # None found. - gt_cv_locale_ja=none + # Test for the Solaris 7 locale name. + if (LC_ALL=ja LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_ja=ja + else + # Special test for NetBSD 1.6. + if test -f /usr/share/locale/ja_JP.eucJP/LC_CTYPE; then + gt_cv_locale_ja=ja_JP.eucJP + else + # None found. + gt_cv_locale_ja=none + fi + fi fi fi fi fi - fi - fi + ;; + esac fi rm -fr conftest* ]) diff -Nru libdap-3.11.1/gl/m4/locale-zh.m4 libdap-3.12.0/gl/m4/locale-zh.m4 --- libdap-3.11.1/gl/m4/locale-zh.m4 2011-04-29 13:19:35.000000000 +0000 +++ libdap-3.12.0/gl/m4/locale-zh.m4 2013-10-17 21:27:40.000000000 +0000 @@ -1,5 +1,5 @@ -# locale-zh.m4 serial 7 -dnl Copyright (C) 2003, 2005-2011 Free Software Foundation, Inc. +# locale-zh.m4 serial 12 +dnl Copyright (C) 2003, 2005-2012 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. @@ -28,9 +28,19 @@ { const char *p; /* Check whether the given locale name is recognized by the system. */ +#if (defined _WIN32 || defined __WIN32__) && !defined __CYGWIN__ + /* On native Windows, setlocale(category, "") looks at the system settings, + not at the environment variables. Also, when an encoding suffix such + as ".65001" or ".54936" is specified, it succeeds but sets the LC_CTYPE + category of the locale to "C". */ + if (setlocale (LC_ALL, getenv ("LC_ALL")) == NULL + || strcmp (setlocale (LC_CTYPE, NULL), "C") == 0) + return 1; +#else if (setlocale (LC_ALL, "") == NULL) return 1; +#endif /* Check whether nl_langinfo(CODESET) is nonempty and not "ASCII" or "646". - On MacOS X 10.3.5 (Darwin 7.5) in the fr_FR locale, nl_langinfo(CODESET) + On Mac OS X 10.3.5 (Darwin 7.5) in the fr_FR locale, nl_langinfo(CODESET) is empty, and the behaviour of Tcl 8.4 in this locale is not useful. On OpenBSD 4.0, when an unsupported locale is specified, setlocale() succeeds but then nl_langinfo(CODESET) is "646". In this situation, @@ -67,22 +77,47 @@ changequote([,])dnl ])]) if AC_TRY_EVAL([ac_link]) && test -s conftest$ac_exeext; then - # Setting LC_ALL is not enough. Need to set LC_TIME to empty, because - # otherwise on MacOS X 10.3.5 the LC_TIME=C from the beginning of the - # configure script would override the LC_ALL setting. Likewise for - # LC_CTYPE, which is also set at the beginning of the configure script. - # Test for the locale name without encoding suffix. - if (LC_ALL=zh_CN LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then - gt_cv_locale_zh_CN=zh_CN - else - # Test for the locale name with explicit encoding suffix. - if (LC_ALL=zh_CN.GB18030 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then - gt_cv_locale_zh_CN=zh_CN.GB18030 - else - # None found. + case "$host_os" in + # Handle native Windows specially, because there setlocale() interprets + # "ar" as "Arabic" or "Arabic_Saudi Arabia.1256", + # "fr" or "fra" as "French" or "French_France.1252", + # "ge"(!) or "deu"(!) as "German" or "German_Germany.1252", + # "ja" as "Japanese" or "Japanese_Japan.932", + # and similar. + mingw*) + # Test for the hypothetical native Windows locale name. + if (LC_ALL=Chinese_China.54936 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_zh_CN=Chinese_China.54936 + else + # None found. + gt_cv_locale_zh_CN=none + fi + ;; + solaris2.8) + # On Solaris 8, the locales zh_CN.GB18030, zh_CN.GBK, zh.GBK are + # broken. One witness is the test case in gl_MBRTOWC_SANITYCHECK. + # Another witness is that "LC_ALL=zh_CN.GB18030 bash -c true" dumps core. gt_cv_locale_zh_CN=none - fi - fi + ;; + *) + # Setting LC_ALL is not enough. Need to set LC_TIME to empty, because + # otherwise on Mac OS X 10.3.5 the LC_TIME=C from the beginning of the + # configure script would override the LC_ALL setting. Likewise for + # LC_CTYPE, which is also set at the beginning of the configure script. + # Test for the locale name without encoding suffix. + if (LC_ALL=zh_CN LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_zh_CN=zh_CN + else + # Test for the locale name with explicit encoding suffix. + if (LC_ALL=zh_CN.GB18030 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_zh_CN=zh_CN.GB18030 + else + # None found. + gt_cv_locale_zh_CN=none + fi + fi + ;; + esac else # If there was a link error, due to mblen(), the system is so old that # it certainly doesn't have a chinese locale. diff -Nru libdap-3.11.1/gl/m4/locale_h.m4 libdap-3.12.0/gl/m4/locale_h.m4 --- libdap-3.11.1/gl/m4/locale_h.m4 1970-01-01 00:00:00.000000000 +0000 +++ libdap-3.12.0/gl/m4/locale_h.m4 2013-10-17 21:27:40.000000000 +0000 @@ -0,0 +1,122 @@ +# locale_h.m4 serial 19 +dnl Copyright (C) 2007, 2009-2012 Free Software Foundation, Inc. +dnl This file is free software; the Free Software Foundation +dnl gives unlimited permission to copy and/or distribute it, +dnl with or without modifications, as long as this notice is preserved. + +AC_DEFUN([gl_LOCALE_H], +[ + dnl Use AC_REQUIRE here, so that the default behavior below is expanded + dnl once only, before all statements that occur in other macros. + AC_REQUIRE([gl_LOCALE_H_DEFAULTS]) + + dnl Persuade glibc to define locale_t and the int_p_*, int_n_* + dnl members of 'struct lconv'. + AC_REQUIRE([gl_USE_SYSTEM_EXTENSIONS]) + + dnl If is replaced, then must also be replaced. + AC_REQUIRE([gl_STDDEF_H]) + + dnl Solaris 11 2011-11 defines the int_p_*, int_n_* members of 'struct lconv' + dnl only if _LCONV_C99 is defined. + AC_REQUIRE([AC_CANONICAL_HOST]) + case "$host_os" in + solaris*) + AC_DEFINE([_LCONV_C99], [1], [Define to 1 on Solaris.]) + ;; + esac + + AC_CACHE_CHECK([whether locale.h conforms to POSIX:2001], + [gl_cv_header_locale_h_posix2001], + [AC_COMPILE_IFELSE( + [AC_LANG_PROGRAM( + [[#include + int x = LC_MESSAGES; + int y = sizeof (((struct lconv *) 0)->decimal_point);]], + [[]])], + [gl_cv_header_locale_h_posix2001=yes], + [gl_cv_header_locale_h_posix2001=no])]) + + dnl Check for . + AC_CHECK_HEADERS_ONCE([xlocale.h]) + if test $ac_cv_header_xlocale_h = yes; then + HAVE_XLOCALE_H=1 + dnl Check whether use of locale_t requires inclusion of , + dnl e.g. on Mac OS X 10.5. If does not define locale_t by + dnl itself, we assume that will do so. + AC_CACHE_CHECK([whether locale.h defines locale_t], + [gl_cv_header_locale_has_locale_t], + [AC_COMPILE_IFELSE( + [AC_LANG_PROGRAM( + [[#include + locale_t x;]], + [[]])], + [gl_cv_header_locale_has_locale_t=yes], + [gl_cv_header_locale_has_locale_t=no]) + ]) + if test $gl_cv_header_locale_has_locale_t = yes; then + gl_cv_header_locale_h_needs_xlocale_h=no + else + gl_cv_header_locale_h_needs_xlocale_h=yes + fi + else + HAVE_XLOCALE_H=0 + gl_cv_header_locale_h_needs_xlocale_h=no + fi + AC_SUBST([HAVE_XLOCALE_H]) + + dnl Check whether 'struct lconv' is complete. + dnl Bionic libc's 'struct lconv' is just a dummy. + dnl On OpenBSD 4.9, HP-UX 11, IRIX 6.5, OSF/1 5.1, Solaris 9, Cygwin 1.5.x, + dnl mingw, MSVC 9, it lacks the int_p_* and int_n_* members. + AC_CACHE_CHECK([whether struct lconv is properly defined], + [gl_cv_sys_struct_lconv_ok], + [AC_COMPILE_IFELSE( + [AC_LANG_PROGRAM( + [[#include + struct lconv l; + int x = sizeof (l.decimal_point); + int y = sizeof (l.int_p_cs_precedes);]], + [[]])], + [gl_cv_sys_struct_lconv_ok=yes], + [gl_cv_sys_struct_lconv_ok=no]) + ]) + if test $gl_cv_sys_struct_lconv_ok = no; then + REPLACE_STRUCT_LCONV=1 + fi + + dnl is always overridden, because of GNULIB_POSIXCHECK. + gl_NEXT_HEADERS([locale.h]) + + dnl Check for declarations of anything we want to poison if the + dnl corresponding gnulib module is not in use. + gl_WARN_ON_USE_PREPARE([[#include +/* Some systems provide declarations in a non-standard header. */ +#if HAVE_XLOCALE_H +# include +#endif + ]], + [setlocale duplocale]) +]) + +AC_DEFUN([gl_LOCALE_MODULE_INDICATOR], +[ + dnl Use AC_REQUIRE here, so that the default settings are expanded once only. + AC_REQUIRE([gl_LOCALE_H_DEFAULTS]) + gl_MODULE_INDICATOR_SET_VARIABLE([$1]) + dnl Define it also as a C macro, for the benefit of the unit tests. + gl_MODULE_INDICATOR_FOR_TESTS([$1]) +]) + +AC_DEFUN([gl_LOCALE_H_DEFAULTS], +[ + GNULIB_LOCALECONV=0; AC_SUBST([GNULIB_LOCALECONV]) + GNULIB_SETLOCALE=0; AC_SUBST([GNULIB_SETLOCALE]) + GNULIB_DUPLOCALE=0; AC_SUBST([GNULIB_DUPLOCALE]) + dnl Assume proper GNU behavior unless another module says otherwise. + HAVE_DUPLOCALE=1; AC_SUBST([HAVE_DUPLOCALE]) + REPLACE_LOCALECONV=0; AC_SUBST([REPLACE_LOCALECONV]) + REPLACE_SETLOCALE=0; AC_SUBST([REPLACE_SETLOCALE]) + REPLACE_DUPLOCALE=0; AC_SUBST([REPLACE_DUPLOCALE]) + REPLACE_STRUCT_LCONV=0; AC_SUBST([REPLACE_STRUCT_LCONV]) +]) diff -Nru libdap-3.11.1/gl/m4/localeconv.m4 libdap-3.12.0/gl/m4/localeconv.m4 --- libdap-3.11.1/gl/m4/localeconv.m4 1970-01-01 00:00:00.000000000 +0000 +++ libdap-3.12.0/gl/m4/localeconv.m4 2013-10-17 21:27:40.000000000 +0000 @@ -0,0 +1,22 @@ +# localeconv.m4 serial 1 +dnl Copyright (C) 2012 Free Software Foundation, Inc. +dnl This file is free software; the Free Software Foundation +dnl gives unlimited permission to copy and/or distribute it, +dnl with or without modifications, as long as this notice is preserved. + +AC_DEFUN([gl_FUNC_LOCALECONV], +[ + AC_REQUIRE([gl_LOCALE_H_DEFAULTS]) + AC_REQUIRE([gl_LOCALE_H]) + + if test $REPLACE_STRUCT_LCONV = 1; then + REPLACE_LOCALECONV=1 + fi +]) + +# Prerequisites of lib/localeconv.c. +AC_DEFUN([gl_PREREQ_LOCALECONV], +[ + AC_CHECK_MEMBERS([struct lconv.decimal_point], [], [], + [[#include ]]) +]) diff -Nru libdap-3.11.1/gl/m4/longlong.m4 libdap-3.12.0/gl/m4/longlong.m4 --- libdap-3.11.1/gl/m4/longlong.m4 2011-04-29 13:19:35.000000000 +0000 +++ libdap-3.12.0/gl/m4/longlong.m4 2013-10-17 21:27:40.000000000 +0000 @@ -1,5 +1,5 @@ -# longlong.m4 serial 14 -dnl Copyright (C) 1999-2007, 2009-2011 Free Software Foundation, Inc. +# longlong.m4 serial 17 +dnl Copyright (C) 1999-2007, 2009-2012 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. @@ -7,8 +7,8 @@ dnl From Paul Eggert. # Define HAVE_LONG_LONG_INT if 'long long int' works. -# This fixes a bug in Autoconf 2.61, but can be removed once we -# assume 2.62 everywhere. +# This fixes a bug in Autoconf 2.61, and can be faster +# than what's in Autoconf 2.62 through 2.68. # Note: If the type 'long long int' exists but is only 32 bits large # (as on some very old compilers), HAVE_LONG_LONG_INT will not be @@ -16,44 +16,48 @@ AC_DEFUN([AC_TYPE_LONG_LONG_INT], [ + AC_REQUIRE([AC_TYPE_UNSIGNED_LONG_LONG_INT]) AC_CACHE_CHECK([for long long int], [ac_cv_type_long_long_int], - [AC_LINK_IFELSE( - [_AC_TYPE_LONG_LONG_SNIPPET], - [dnl This catches a bug in Tandem NonStop Kernel (OSS) cc -O circa 2004. - dnl If cross compiling, assume the bug isn't important, since - dnl nobody cross compiles for this platform as far as we know. - AC_RUN_IFELSE( - [AC_LANG_PROGRAM( - [[@%:@include - @%:@ifndef LLONG_MAX - @%:@ define HALF \ - (1LL << (sizeof (long long int) * CHAR_BIT - 2)) - @%:@ define LLONG_MAX (HALF - 1 + HALF) - @%:@endif]], - [[long long int n = 1; - int i; - for (i = 0; ; i++) - { - long long int m = n << i; - if (m >> i != n) - return 1; - if (LLONG_MAX / 2 < m) - break; - } - return 0;]])], - [ac_cv_type_long_long_int=yes], - [ac_cv_type_long_long_int=no], - [ac_cv_type_long_long_int=yes])], - [ac_cv_type_long_long_int=no])]) + [ac_cv_type_long_long_int=yes + if test "x${ac_cv_prog_cc_c99-no}" = xno; then + ac_cv_type_long_long_int=$ac_cv_type_unsigned_long_long_int + if test $ac_cv_type_long_long_int = yes; then + dnl Catch a bug in Tandem NonStop Kernel (OSS) cc -O circa 2004. + dnl If cross compiling, assume the bug is not important, since + dnl nobody cross compiles for this platform as far as we know. + AC_RUN_IFELSE( + [AC_LANG_PROGRAM( + [[@%:@include + @%:@ifndef LLONG_MAX + @%:@ define HALF \ + (1LL << (sizeof (long long int) * CHAR_BIT - 2)) + @%:@ define LLONG_MAX (HALF - 1 + HALF) + @%:@endif]], + [[long long int n = 1; + int i; + for (i = 0; ; i++) + { + long long int m = n << i; + if (m >> i != n) + return 1; + if (LLONG_MAX / 2 < m) + break; + } + return 0;]])], + [], + [ac_cv_type_long_long_int=no], + [:]) + fi + fi]) if test $ac_cv_type_long_long_int = yes; then AC_DEFINE([HAVE_LONG_LONG_INT], [1], - [Define to 1 if the system has the type `long long int'.]) + [Define to 1 if the system has the type 'long long int'.]) fi ]) # Define HAVE_UNSIGNED_LONG_LONG_INT if 'unsigned long long int' works. -# This fixes a bug in Autoconf 2.61, but can be removed once we -# assume 2.62 everywhere. +# This fixes a bug in Autoconf 2.61, and can be faster +# than what's in Autoconf 2.62 through 2.68. # Note: If the type 'unsigned long long int' exists but is only 32 bits # large (as on some very old compilers), AC_TYPE_UNSIGNED_LONG_LONG_INT @@ -64,13 +68,16 @@ [ AC_CACHE_CHECK([for unsigned long long int], [ac_cv_type_unsigned_long_long_int], - [AC_LINK_IFELSE( - [_AC_TYPE_LONG_LONG_SNIPPET], - [ac_cv_type_unsigned_long_long_int=yes], - [ac_cv_type_unsigned_long_long_int=no])]) + [ac_cv_type_unsigned_long_long_int=yes + if test "x${ac_cv_prog_cc_c99-no}" = xno; then + AC_LINK_IFELSE( + [_AC_TYPE_LONG_LONG_SNIPPET], + [], + [ac_cv_type_unsigned_long_long_int=no]) + fi]) if test $ac_cv_type_unsigned_long_long_int = yes; then AC_DEFINE([HAVE_UNSIGNED_LONG_LONG_INT], [1], - [Define to 1 if the system has the type `unsigned long long int'.]) + [Define to 1 if the system has the type 'unsigned long long int'.]) fi ]) diff -Nru libdap-3.11.1/gl/m4/malloc.m4 libdap-3.12.0/gl/m4/malloc.m4 --- libdap-3.11.1/gl/m4/malloc.m4 2011-04-29 13:19:35.000000000 +0000 +++ libdap-3.12.0/gl/m4/malloc.m4 2013-10-17 21:27:40.000000000 +0000 @@ -1,9 +1,47 @@ -# malloc.m4 serial 12 -dnl Copyright (C) 2007, 2009-2011 Free Software Foundation, Inc. +# malloc.m4 serial 14 +dnl Copyright (C) 2007, 2009-2012 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. +m4_version_prereq([2.70], [] ,[ + +# This is taken from the following Autoconf patch: +# http://git.savannah.gnu.org/gitweb/?p=autoconf.git;a=commitdiff;h=7fbb553727ed7e0e689a17594b58559ecf3ea6e9 +AC_DEFUN([_AC_FUNC_MALLOC_IF], +[ + AC_REQUIRE([AC_HEADER_STDC])dnl + AC_REQUIRE([AC_CANONICAL_HOST])dnl for cross-compiles + AC_CHECK_HEADERS([stdlib.h]) + AC_CACHE_CHECK([for GNU libc compatible malloc], + [ac_cv_func_malloc_0_nonnull], + [AC_RUN_IFELSE( + [AC_LANG_PROGRAM( + [[#if defined STDC_HEADERS || defined HAVE_STDLIB_H + # include + #else + char *malloc (); + #endif + ]], + [[return ! malloc (0);]]) + ], + [ac_cv_func_malloc_0_nonnull=yes], + [ac_cv_func_malloc_0_nonnull=no], + [case "$host_os" in + # Guess yes on platforms where we know the result. + *-gnu* | freebsd* | netbsd* | openbsd* \ + | hpux* | solaris* | cygwin* | mingw*) + ac_cv_func_malloc_0_nonnull=yes ;; + # If we don't know, assume the worst. + *) ac_cv_func_malloc_0_nonnull=no ;; + esac + ]) + ]) + AS_IF([test $ac_cv_func_malloc_0_nonnull = yes], [$1], [$2]) +])# _AC_FUNC_MALLOC_IF + +]) + # gl_FUNC_MALLOC_GNU # ------------------ # Test whether 'malloc (0)' is handled like in GNU libc, and replace malloc if @@ -17,7 +55,7 @@ [Define to 1 if your system has a GNU libc compatible 'malloc' function, and to 0 otherwise.])], [AC_DEFINE([HAVE_MALLOC_GNU], [0]) - gl_REPLACE_MALLOC + REPLACE_MALLOC=1 ]) ]) @@ -33,7 +71,7 @@ AC_DEFINE([HAVE_MALLOC_POSIX], [1], [Define if the 'malloc' function is POSIX compliant.]) else - gl_REPLACE_MALLOC + REPLACE_MALLOC=1 fi ]) @@ -58,9 +96,3 @@ [gl_cv_func_malloc_posix=no]) ]) ]) - -AC_DEFUN([gl_REPLACE_MALLOC], -[ - AC_LIBOBJ([malloc]) - REPLACE_MALLOC=1 -]) diff -Nru libdap-3.11.1/gl/m4/mbrtowc.m4 libdap-3.12.0/gl/m4/mbrtowc.m4 --- libdap-3.11.1/gl/m4/mbrtowc.m4 2011-04-29 13:19:35.000000000 +0000 +++ libdap-3.12.0/gl/m4/mbrtowc.m4 2013-10-17 21:27:40.000000000 +0000 @@ -1,5 +1,5 @@ -# mbrtowc.m4 serial 21 -dnl Copyright (C) 2001-2002, 2004-2005, 2008-2011 Free Software Foundation, +# mbrtowc.m4 serial 25 +dnl Copyright (C) 2001-2002, 2004-2005, 2008-2012 Free Software Foundation, dnl Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, @@ -15,6 +15,22 @@ AC_CHECK_FUNCS_ONCE([mbrtowc]) if test $ac_cv_func_mbrtowc = no; then HAVE_MBRTOWC=0 + AC_CHECK_DECLS([mbrtowc],,, [[ +/* Tru64 with Desktop Toolkit C has a bug: must be included before + . + BSD/OS 4.0.1 has a bug: , and must be + included before . */ +#include +#include +#include +#include +]]) + if test $ac_cv_have_decl_mbrtowc = yes; then + dnl On Minix 3.1.8, the system's declares mbrtowc() although + dnl it does not have the function. Avoid a collision with gnulib's + dnl replacement. + REPLACE_MBRTOWC=1 + fi else if test $REPLACE_MBSTATE_T = 1; then REPLACE_MBRTOWC=1 @@ -53,11 +69,6 @@ esac fi fi - if test $HAVE_MBRTOWC = 0 || test $REPLACE_MBRTOWC = 1; then - gl_REPLACE_WCHAR_H - AC_LIBOBJ([mbrtowc]) - gl_PREREQ_MBRTOWC - fi ]) dnl Test whether mbsinit() and mbrtowc() need to be overridden in a way that @@ -88,9 +99,6 @@ else REPLACE_MBSTATE_T=1 fi - if test $REPLACE_MBSTATE_T = 1; then - gl_REPLACE_WCHAR_H - fi ]) dnl Test whether mbrtowc puts the state into non-initial state when parsing an @@ -348,7 +356,7 @@ AC_REQUIRE([AC_PROG_CC]) AC_REQUIRE([gt_LOCALE_FR_UTF8]) AC_REQUIRE([gt_LOCALE_JA]) - AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles + AC_REQUIRE([AC_CANONICAL_HOST]) AC_CACHE_CHECK([whether mbrtowc has a correct return value], [gl_cv_func_mbrtowc_retval], [ @@ -356,13 +364,14 @@ dnl is present. changequote(,)dnl case "$host_os" in - # Guess no on HP-UX and Solaris. - hpux* | solaris*) gl_cv_func_mbrtowc_retval="guessing no" ;; - # Guess yes otherwise. - *) gl_cv_func_mbrtowc_retval="guessing yes" ;; + # Guess no on HP-UX, Solaris, native Windows. + hpux* | solaris* | mingw*) gl_cv_func_mbrtowc_retval="guessing no" ;; + # Guess yes otherwise. + *) gl_cv_func_mbrtowc_retval="guessing yes" ;; esac changequote([,])dnl - if test $LOCALE_FR_UTF8 != none || test $LOCALE_JA != none; then + if test $LOCALE_FR_UTF8 != none || test $LOCALE_JA != none \ + || { case "$host_os" in mingw*) true;; *) false;; esac; }; then AC_RUN_IFELSE( [AC_LANG_SOURCE([[ #include @@ -378,6 +387,7 @@ int main () { int result = 0; + int found_some_locale = 0; /* This fails on Solaris. */ if (setlocale (LC_ALL, "$LOCALE_FR_UTF8") != NULL) { @@ -392,6 +402,7 @@ if (mbrtowc (&wc, input + 2, 5, &state) != 1) result |= 1; } + found_some_locale = 1; } /* This fails on HP-UX 11.11. */ if (setlocale (LC_ALL, "$LOCALE_JA") != NULL) @@ -407,11 +418,61 @@ if (mbrtowc (&wc, input + 2, 5, &state) != 2) result |= 2; } + found_some_locale = 1; } - return result; + /* This fails on native Windows. */ + if (setlocale (LC_ALL, "Japanese_Japan.932") != NULL) + { + char input[] = "<\223\372\226\173\214\352>"; /* "<日本語>" */ + mbstate_t state; + wchar_t wc; + + memset (&state, '\0', sizeof (mbstate_t)); + if (mbrtowc (&wc, input + 3, 1, &state) == (size_t)(-2)) + { + input[3] = '\0'; + if (mbrtowc (&wc, input + 4, 4, &state) != 1) + result |= 4; + } + found_some_locale = 1; + } + if (setlocale (LC_ALL, "Chinese_Taiwan.950") != NULL) + { + char input[] = "<\244\351\245\273\273\171>"; /* "<日本語>" */ + mbstate_t state; + wchar_t wc; + + memset (&state, '\0', sizeof (mbstate_t)); + if (mbrtowc (&wc, input + 3, 1, &state) == (size_t)(-2)) + { + input[3] = '\0'; + if (mbrtowc (&wc, input + 4, 4, &state) != 1) + result |= 8; + } + found_some_locale = 1; + } + if (setlocale (LC_ALL, "Chinese_China.936") != NULL) + { + char input[] = "<\310\325\261\276\325\132>"; /* "<日本語>" */ + mbstate_t state; + wchar_t wc; + + memset (&state, '\0', sizeof (mbstate_t)); + if (mbrtowc (&wc, input + 3, 1, &state) == (size_t)(-2)) + { + input[3] = '\0'; + if (mbrtowc (&wc, input + 4, 4, &state) != 1) + result |= 16; + } + found_some_locale = 1; + } + return (found_some_locale ? result : 77); }]])], [gl_cv_func_mbrtowc_retval=yes], - [gl_cv_func_mbrtowc_retval=no], + [if test $? != 77; then + gl_cv_func_mbrtowc_retval=no + fi + ], [:]) fi ]) diff -Nru libdap-3.11.1/gl/m4/mbsinit.m4 libdap-3.12.0/gl/m4/mbsinit.m4 --- libdap-3.11.1/gl/m4/mbsinit.m4 2011-04-29 13:19:35.000000000 +0000 +++ libdap-3.12.0/gl/m4/mbsinit.m4 2013-10-17 21:27:40.000000000 +0000 @@ -1,5 +1,5 @@ -# mbsinit.m4 serial 4 -dnl Copyright (C) 2008, 2010-2011 Free Software Foundation, Inc. +# mbsinit.m4 serial 8 +dnl Copyright (C) 2008, 2010-2012 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. @@ -7,6 +7,7 @@ AC_DEFUN([gl_FUNC_MBSINIT], [ AC_REQUIRE([gl_WCHAR_H_DEFAULTS]) + AC_REQUIRE([AC_CANONICAL_HOST]) AC_REQUIRE([AC_TYPE_MBSTATE_T]) gl_MBSTATE_T_BROKEN @@ -14,16 +15,34 @@ AC_CHECK_FUNCS_ONCE([mbsinit]) if test $ac_cv_func_mbsinit = no; then HAVE_MBSINIT=0 + AC_CHECK_DECLS([mbsinit],,, [[ +/* Tru64 with Desktop Toolkit C has a bug: must be included before + . + BSD/OS 4.0.1 has a bug: , and must be + included before . */ +#include +#include +#include +#include +]]) + if test $ac_cv_have_decl_mbsinit = yes; then + dnl On Minix 3.1.8, the system's declares mbsinit() although + dnl it does not have the function. Avoid a collision with gnulib's + dnl replacement. + REPLACE_MBSINIT=1 + fi else if test $REPLACE_MBSTATE_T = 1; then REPLACE_MBSINIT=1 + else + dnl On mingw, mbsinit() always returns 1, which is inappropriate for + dnl states produced by mbrtowc() for an incomplete multibyte character + dnl in multibyte locales. + case "$host_os" in + mingw*) REPLACE_MBSINIT=1 ;; + esac fi fi - if test $HAVE_MBSINIT = 0 || test $REPLACE_MBSINIT = 1; then - gl_REPLACE_WCHAR_H - AC_LIBOBJ([mbsinit]) - gl_PREREQ_MBSINIT - fi ]) # Prerequisites of lib/mbsinit.c. diff -Nru libdap-3.11.1/gl/m4/mbstate_t.m4 libdap-3.12.0/gl/m4/mbstate_t.m4 --- libdap-3.11.1/gl/m4/mbstate_t.m4 2011-04-29 13:19:35.000000000 +0000 +++ libdap-3.12.0/gl/m4/mbstate_t.m4 2013-10-17 21:27:40.000000000 +0000 @@ -1,5 +1,5 @@ # mbstate_t.m4 serial 13 -dnl Copyright (C) 2000-2002, 2008-2011 Free Software Foundation, Inc. +dnl Copyright (C) 2000-2002, 2008-2012 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. diff -Nru libdap-3.11.1/gl/m4/mbtowc.m4 libdap-3.12.0/gl/m4/mbtowc.m4 --- libdap-3.11.1/gl/m4/mbtowc.m4 1970-01-01 00:00:00.000000000 +0000 +++ libdap-3.12.0/gl/m4/mbtowc.m4 2013-10-17 21:27:40.000000000 +0000 @@ -0,0 +1,19 @@ +# mbtowc.m4 serial 2 +dnl Copyright (C) 2011-2012 Free Software Foundation, Inc. +dnl This file is free software; the Free Software Foundation +dnl gives unlimited permission to copy and/or distribute it, +dnl with or without modifications, as long as this notice is preserved. + +AC_DEFUN([gl_FUNC_MBTOWC], +[ + AC_REQUIRE([gl_STDLIB_H_DEFAULTS]) + + if false; then + REPLACE_MBTOWC=1 + fi +]) + +# Prerequisites of lib/mbtowc.c. +AC_DEFUN([gl_PREREQ_MBTOWC], [ + : +]) diff -Nru libdap-3.11.1/gl/m4/multiarch.m4 libdap-3.12.0/gl/m4/multiarch.m4 --- libdap-3.11.1/gl/m4/multiarch.m4 2011-04-29 13:19:35.000000000 +0000 +++ libdap-3.12.0/gl/m4/multiarch.m4 2013-10-17 21:27:40.000000000 +0000 @@ -1,12 +1,12 @@ -# multiarch.m4 serial 6 -dnl Copyright (C) 2008-2011 Free Software Foundation, Inc. +# multiarch.m4 serial 7 +dnl Copyright (C) 2008-2012 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. # Determine whether the compiler is or may be producing universal binaries. # -# On MacOS X 10.5 and later systems, the user can create libraries and +# On Mac OS X 10.5 and later systems, the user can create libraries and # executables that work on multiple system types--known as "fat" or # "universal" binaries--by specifying multiple '-arch' options to the # compiler but only a single '-arch' option to the preprocessor. Like diff -Nru libdap-3.11.1/gl/m4/nl_langinfo.m4 libdap-3.12.0/gl/m4/nl_langinfo.m4 --- libdap-3.11.1/gl/m4/nl_langinfo.m4 2011-04-29 13:19:35.000000000 +0000 +++ libdap-3.12.0/gl/m4/nl_langinfo.m4 2013-10-17 21:27:40.000000000 +0000 @@ -1,5 +1,5 @@ -# nl_langinfo.m4 serial 4 -dnl Copyright (C) 2009-2011 Free Software Foundation, Inc. +# nl_langinfo.m4 serial 5 +dnl Copyright (C) 2009-2012 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. @@ -43,10 +43,8 @@ REPLACE_NL_LANGINFO=1 AC_DEFINE([REPLACE_NL_LANGINFO], [1], [Define if nl_langinfo exists but is overridden by gnulib.]) - AC_LIBOBJ([nl_langinfo]) fi else HAVE_NL_LANGINFO=0 - AC_LIBOBJ([nl_langinfo]) fi ]) diff -Nru libdap-3.11.1/gl/m4/off_t.m4 libdap-3.12.0/gl/m4/off_t.m4 --- libdap-3.11.1/gl/m4/off_t.m4 1970-01-01 00:00:00.000000000 +0000 +++ libdap-3.12.0/gl/m4/off_t.m4 2013-10-17 21:27:40.000000000 +0000 @@ -0,0 +1,18 @@ +# off_t.m4 serial 1 +dnl Copyright (C) 2012 Free Software Foundation, Inc. +dnl This file is free software; the Free Software Foundation +dnl gives unlimited permission to copy and/or distribute it, +dnl with or without modifications, as long as this notice is preserved. + +dnl Check whether to override the 'off_t' type. +dnl Set WINDOWS_64_BIT_OFF_T. + +AC_DEFUN([gl_TYPE_OFF_T], +[ + m4_ifdef([gl_LARGEFILE], [ + AC_REQUIRE([gl_LARGEFILE]) + ], [ + WINDOWS_64_BIT_OFF_T=0 + ]) + AC_SUBST([WINDOWS_64_BIT_OFF_T]) +]) diff -Nru libdap-3.11.1/gl/m4/regex.m4 libdap-3.12.0/gl/m4/regex.m4 --- libdap-3.11.1/gl/m4/regex.m4 2011-04-29 13:19:35.000000000 +0000 +++ libdap-3.12.0/gl/m4/regex.m4 2013-10-17 21:27:40.000000000 +0000 @@ -1,6 +1,6 @@ -# serial 58 +# serial 61 -# Copyright (C) 1996-2001, 2003-2011 Free Software Foundation, Inc. +# Copyright (C) 1996-2001, 2003-2012 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -175,6 +175,9 @@ esac if test $ac_use_included_regex = yes; then + AC_DEFINE([_REGEX_INCLUDE_LIMITS_H], [1], + [Define if you want to include , so that it + consistently overrides 's RE_DUP_MAX.]) AC_DEFINE([_REGEX_LARGE_OFFSETS], [1], [Define if you want regoff_t to be at least as wide POSIX requires.]) AC_DEFINE([re_syntax_options], [rpl_re_syntax_options], @@ -207,8 +210,6 @@ [Define to rpl_regerror if the replacement should be used.]) AC_DEFINE([regfree], [rpl_regfree], [Define to rpl_regfree if the replacement should be used.]) - AC_LIBOBJ([regex]) - gl_PREREQ_REGEX fi ]) @@ -221,5 +222,5 @@ AC_REQUIRE([AC_TYPE_MBSTATE_T]) AC_CHECK_HEADERS([libintl.h]) AC_CHECK_FUNCS_ONCE([isblank iswctype wcscoll]) - AC_CHECK_DECLS([isblank], [], [], [#include ]) + AC_CHECK_DECLS([isblank], [], [], [[#include ]]) ]) diff -Nru libdap-3.11.1/gl/m4/ssize_t.m4 libdap-3.12.0/gl/m4/ssize_t.m4 --- libdap-3.11.1/gl/m4/ssize_t.m4 2011-04-29 13:19:35.000000000 +0000 +++ libdap-3.12.0/gl/m4/ssize_t.m4 2013-10-17 21:27:40.000000000 +0000 @@ -1,5 +1,5 @@ # ssize_t.m4 serial 5 (gettext-0.18.2) -dnl Copyright (C) 2001-2003, 2006, 2010-2011 Free Software Foundation, Inc. +dnl Copyright (C) 2001-2003, 2006, 2010-2012 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. diff -Nru libdap-3.11.1/gl/m4/stdbool.m4 libdap-3.12.0/gl/m4/stdbool.m4 --- libdap-3.11.1/gl/m4/stdbool.m4 2011-04-29 13:19:35.000000000 +0000 +++ libdap-3.12.0/gl/m4/stdbool.m4 2013-10-17 21:27:40.000000000 +0000 @@ -1,17 +1,17 @@ # Check for stdbool.h that conforms to C99. -dnl Copyright (C) 2002-2006, 2009-2011 Free Software Foundation, Inc. +dnl Copyright (C) 2002-2006, 2009-2012 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. -#serial 3 +#serial 5 # Prepare for substituting if it is not supported. AC_DEFUN([AM_STDBOOL_H], [ - AC_REQUIRE([AC_HEADER_STDBOOL]) + AC_REQUIRE([AC_CHECK_HEADER_STDBOOL]) # Define two additional variables used in the Makefile substitution. @@ -21,6 +21,7 @@ STDBOOL_H='stdbool.h' fi AC_SUBST([STDBOOL_H]) + AM_CONDITIONAL([GL_GENERATE_STDBOOL_H], [test -n "$STDBOOL_H"]) if test "$ac_cv_type__Bool" = yes; then HAVE__BOOL=1 @@ -33,11 +34,9 @@ # AM_STDBOOL_H will be renamed to gl_STDBOOL_H in the future. AC_DEFUN([gl_STDBOOL_H], [AM_STDBOOL_H]) -# This version of the macro is needed in autoconf <= 2.67. Autoconf has -# it built in since 2.60, but we want the tweaks from the 2.68 version -# to avoid rejecting xlc and clang due to relying on extensions. +# This version of the macro is needed in autoconf <= 2.68. -AC_DEFUN([AC_HEADER_STDBOOL], +AC_DEFUN([AC_CHECK_HEADER_STDBOOL], [AC_CACHE_CHECK([for stdbool.h that conforms to C99], [ac_cv_header_stdbool_h], [AC_COMPILE_IFELSE( @@ -98,6 +97,4 @@ [ac_cv_header_stdbool_h=yes], [ac_cv_header_stdbool_h=no])]) AC_CHECK_TYPES([_Bool]) - if test $ac_cv_header_stdbool_h = yes; then - AC_DEFINE([HAVE_STDBOOL_H], [1], [Define to 1 if stdbool.h conforms to C99.]) - fi]) +]) diff -Nru libdap-3.11.1/gl/m4/stddef_h.m4 libdap-3.12.0/gl/m4/stddef_h.m4 --- libdap-3.11.1/gl/m4/stddef_h.m4 2011-04-29 13:19:35.000000000 +0000 +++ libdap-3.12.0/gl/m4/stddef_h.m4 2013-10-17 21:27:40.000000000 +0000 @@ -1,6 +1,6 @@ dnl A placeholder for POSIX 2008 , for platforms that have issues. -# stddef_h.m4 serial 3 -dnl Copyright (C) 2009-2011 Free Software Foundation, Inc. +# stddef_h.m4 serial 4 +dnl Copyright (C) 2009-2012 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. @@ -9,6 +9,7 @@ [ AC_REQUIRE([gl_STDDEF_H_DEFAULTS]) AC_REQUIRE([gt_TYPE_WCHAR_T]) + STDDEF_H= if test $gt_cv_c_wchar_t = no; then HAVE_WCHAR_T=0 STDDEF_H=stddef.h @@ -24,6 +25,8 @@ REPLACE_NULL=1 STDDEF_H=stddef.h fi + AC_SUBST([STDDEF_H]) + AM_CONDITIONAL([GL_GENERATE_STDDEF_H], [test -n "$STDDEF_H"]) if test -n "$STDDEF_H"; then gl_NEXT_HEADERS([stddef.h]) fi @@ -41,5 +44,4 @@ dnl Assume proper GNU behavior unless another module says otherwise. REPLACE_NULL=0; AC_SUBST([REPLACE_NULL]) HAVE_WCHAR_T=1; AC_SUBST([HAVE_WCHAR_T]) - STDDEF_H=''; AC_SUBST([STDDEF_H]) ]) diff -Nru libdap-3.11.1/gl/m4/stdint.m4 libdap-3.12.0/gl/m4/stdint.m4 --- libdap-3.11.1/gl/m4/stdint.m4 2011-04-29 13:19:35.000000000 +0000 +++ libdap-3.12.0/gl/m4/stdint.m4 2013-10-17 21:27:40.000000000 +0000 @@ -1,5 +1,5 @@ -# stdint.m4 serial 37 -dnl Copyright (C) 2001-2011 Free Software Foundation, Inc. +# stdint.m4 serial 43 +dnl Copyright (C) 2001-2012 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. @@ -7,7 +7,7 @@ dnl From Paul Eggert and Bruno Haible. dnl Test whether is supported or must be substituted. -AC_DEFUN([gl_STDINT_H], +AC_DEFUN_ONCE([gl_STDINT_H], [ AC_PREREQ([2.59])dnl @@ -27,6 +27,15 @@ fi AC_SUBST([HAVE_UNSIGNED_LONG_LONG_INT]) + dnl Check for , in the same way as gl_WCHAR_H does. + AC_CHECK_HEADERS_ONCE([wchar.h]) + if test $ac_cv_header_wchar_h = yes; then + HAVE_WCHAR_H=1 + else + HAVE_WCHAR_H=0 + fi + AC_SUBST([HAVE_WCHAR_H]) + dnl Check for . dnl AC_INCLUDES_DEFAULT defines $ac_cv_header_inttypes_h. if test $ac_cv_header_inttypes_h = yes; then @@ -60,8 +69,6 @@ [gl_cv_header_working_stdint_h=no AC_COMPILE_IFELSE([ AC_LANG_PROGRAM([[ -#define __STDC_LIMIT_MACROS 1 /* to make it work also in C++ mode */ -#define __STDC_CONSTANT_MACROS 1 /* to make it work also in C++ mode */ #define _GL_JUST_INCLUDE_SYSTEM_STDINT_H 1 /* work if build isn't clean */ #include /* Dragonfly defines WCHAR_MIN, WCHAR_MAX only in . */ @@ -210,8 +217,6 @@ dnl This detects a bug on HP-UX 11.23/ia64. AC_RUN_IFELSE([ AC_LANG_PROGRAM([[ -#define __STDC_LIMIT_MACROS 1 /* to make it work also in C++ mode */ -#define __STDC_CONSTANT_MACROS 1 /* to make it work also in C++ mode */ #define _GL_JUST_INCLUDE_SYSTEM_STDINT_H 1 /* work if build isn't clean */ #include ] @@ -292,14 +297,11 @@ fi AC_SUBST([HAVE_SYS_BITYPES_H]) - dnl Check for (missing in Linux uClibc when built without wide - dnl character support). - AC_CHECK_HEADERS_ONCE([wchar.h]) - gl_STDINT_TYPE_PROPERTIES STDINT_H=stdint.h fi AC_SUBST([STDINT_H]) + AM_CONDITIONAL([GL_GENERATE_STDINT_H], [test -n "$STDINT_H"]) ]) dnl gl_STDINT_BITSIZEOF(TYPES, INCLUDES) @@ -460,6 +462,14 @@ fi gl_INTEGER_TYPE_SUFFIX([sig_atomic_t wchar_t wint_t], [gl_STDINT_INCLUDES]) + + dnl If wint_t is smaller than 'int', it cannot satisfy the ISO C 99 + dnl requirement that wint_t is "unchanged by default argument promotions". + dnl In this case gnulib's and override wint_t. + dnl Set the variable BITSIZEOF_WINT_T accordingly. + if test $BITSIZEOF_WINT_T -lt 32; then + BITSIZEOF_WINT_T=32 + fi ]) dnl Autoconf >= 2.61 has AC_COMPUTE_INT built-in. diff -Nru libdap-3.11.1/gl/m4/stdlib_h.m4 libdap-3.12.0/gl/m4/stdlib_h.m4 --- libdap-3.11.1/gl/m4/stdlib_h.m4 2011-04-29 13:19:35.000000000 +0000 +++ libdap-3.12.0/gl/m4/stdlib_h.m4 2013-10-17 21:27:40.000000000 +0000 @@ -1,5 +1,5 @@ -# stdlib_h.m4 serial 34 -dnl Copyright (C) 2007-2011 Free Software Foundation, Inc. +# stdlib_h.m4 serial 41 +dnl Copyright (C) 2007-2012 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. @@ -8,20 +8,6 @@ [ AC_REQUIRE([gl_STDLIB_H_DEFAULTS]) gl_NEXT_HEADERS([stdlib.h]) - AC_CHECK_HEADERS([random.h], [], [], [AC_INCLUDES_DEFAULT]) - if test $ac_cv_header_random_h = yes; then - HAVE_RANDOM_H=1 - else - HAVE_RANDOM_H=0 - fi - AC_SUBST([HAVE_RANDOM_H]) - AC_CHECK_TYPES([struct random_data], - [], [HAVE_STRUCT_RANDOM_DATA=0], - [[#include - #if HAVE_RANDOM_H - # include - #endif - ]]) dnl Check for declarations of anything we want to poison if the dnl corresponding gnulib module is not in use, and which is not @@ -33,10 +19,11 @@ #if HAVE_RANDOM_H # include #endif - ]], [_Exit atoll canonicalize_file_name getloadavg getsubopt grantpt mkdtemp - mkostemp mkostemps mkstemp mkstemps ptsname random_r initstat_r srandom_r - setstate_r realpath rpmatch setenv strtod strtoll strtoull unlockpt - unsetenv]) + ]], [_Exit atoll canonicalize_file_name getloadavg getsubopt grantpt + initstate initstate_r mkdtemp mkostemp mkostemps mkstemp mkstemps + posix_openpt ptsname ptsname_r random random_r realpath rpmatch + setenv setstate setstate_r srandom srandom_r + strtod strtoll strtoull unlockpt unsetenv]) ]) AC_DEFUN([gl_STDLIB_MODULE_INDICATOR], @@ -58,13 +45,17 @@ GNULIB_GETSUBOPT=0; AC_SUBST([GNULIB_GETSUBOPT]) GNULIB_GRANTPT=0; AC_SUBST([GNULIB_GRANTPT]) GNULIB_MALLOC_POSIX=0; AC_SUBST([GNULIB_MALLOC_POSIX]) + GNULIB_MBTOWC=0; AC_SUBST([GNULIB_MBTOWC]) GNULIB_MKDTEMP=0; AC_SUBST([GNULIB_MKDTEMP]) GNULIB_MKOSTEMP=0; AC_SUBST([GNULIB_MKOSTEMP]) GNULIB_MKOSTEMPS=0; AC_SUBST([GNULIB_MKOSTEMPS]) GNULIB_MKSTEMP=0; AC_SUBST([GNULIB_MKSTEMP]) GNULIB_MKSTEMPS=0; AC_SUBST([GNULIB_MKSTEMPS]) + GNULIB_POSIX_OPENPT=0; AC_SUBST([GNULIB_POSIX_OPENPT]) GNULIB_PTSNAME=0; AC_SUBST([GNULIB_PTSNAME]) + GNULIB_PTSNAME_R=0; AC_SUBST([GNULIB_PTSNAME_R]) GNULIB_PUTENV=0; AC_SUBST([GNULIB_PUTENV]) + GNULIB_RANDOM=0; AC_SUBST([GNULIB_RANDOM]) GNULIB_RANDOM_R=0; AC_SUBST([GNULIB_RANDOM_R]) GNULIB_REALLOC_POSIX=0; AC_SUBST([GNULIB_REALLOC_POSIX]) GNULIB_REALPATH=0; AC_SUBST([GNULIB_REALPATH]) @@ -76,6 +67,7 @@ GNULIB_SYSTEM_POSIX=0; AC_SUBST([GNULIB_SYSTEM_POSIX]) GNULIB_UNLOCKPT=0; AC_SUBST([GNULIB_UNLOCKPT]) GNULIB_UNSETENV=0; AC_SUBST([GNULIB_UNSETENV]) + GNULIB_WCTOMB=0; AC_SUBST([GNULIB_WCTOMB]) dnl Assume proper GNU behavior unless another module says otherwise. HAVE__EXIT=1; AC_SUBST([HAVE__EXIT]) HAVE_ATOLL=1; AC_SUBST([HAVE_ATOLL]) @@ -88,7 +80,11 @@ HAVE_MKOSTEMPS=1; AC_SUBST([HAVE_MKOSTEMPS]) HAVE_MKSTEMP=1; AC_SUBST([HAVE_MKSTEMP]) HAVE_MKSTEMPS=1; AC_SUBST([HAVE_MKSTEMPS]) + HAVE_POSIX_OPENPT=1; AC_SUBST([HAVE_POSIX_OPENPT]) HAVE_PTSNAME=1; AC_SUBST([HAVE_PTSNAME]) + HAVE_PTSNAME_R=1; AC_SUBST([HAVE_PTSNAME_R]) + HAVE_RANDOM=1; AC_SUBST([HAVE_RANDOM]) + HAVE_RANDOM_H=1; AC_SUBST([HAVE_RANDOM_H]) HAVE_RANDOM_R=1; AC_SUBST([HAVE_RANDOM_R]) HAVE_REALPATH=1; AC_SUBST([HAVE_REALPATH]) HAVE_RPMATCH=1; AC_SUBST([HAVE_RPMATCH]) @@ -104,11 +100,15 @@ REPLACE_CALLOC=0; AC_SUBST([REPLACE_CALLOC]) REPLACE_CANONICALIZE_FILE_NAME=0; AC_SUBST([REPLACE_CANONICALIZE_FILE_NAME]) REPLACE_MALLOC=0; AC_SUBST([REPLACE_MALLOC]) + REPLACE_MBTOWC=0; AC_SUBST([REPLACE_MBTOWC]) REPLACE_MKSTEMP=0; AC_SUBST([REPLACE_MKSTEMP]) + REPLACE_PTSNAME_R=0; AC_SUBST([REPLACE_PTSNAME_R]) REPLACE_PUTENV=0; AC_SUBST([REPLACE_PUTENV]) + REPLACE_RANDOM_R=0; AC_SUBST([REPLACE_RANDOM_R]) REPLACE_REALLOC=0; AC_SUBST([REPLACE_REALLOC]) REPLACE_REALPATH=0; AC_SUBST([REPLACE_REALPATH]) REPLACE_SETENV=0; AC_SUBST([REPLACE_SETENV]) REPLACE_STRTOD=0; AC_SUBST([REPLACE_STRTOD]) REPLACE_UNSETENV=0; AC_SUBST([REPLACE_UNSETENV]) + REPLACE_WCTOMB=0; AC_SUBST([REPLACE_WCTOMB]) ]) diff -Nru libdap-3.11.1/gl/m4/strcase.m4 libdap-3.12.0/gl/m4/strcase.m4 --- libdap-3.11.1/gl/m4/strcase.m4 1970-01-01 00:00:00.000000000 +0000 +++ libdap-3.12.0/gl/m4/strcase.m4 2013-10-17 21:27:40.000000000 +0000 @@ -0,0 +1,45 @@ +# strcase.m4 serial 11 +dnl Copyright (C) 2002, 2005-2012 Free Software Foundation, Inc. +dnl This file is free software; the Free Software Foundation +dnl gives unlimited permission to copy and/or distribute it, +dnl with or without modifications, as long as this notice is preserved. + +AC_DEFUN([gl_STRCASE], +[ + gl_FUNC_STRCASECMP + gl_FUNC_STRNCASECMP +]) + +AC_DEFUN([gl_FUNC_STRCASECMP], +[ + AC_REQUIRE([gl_HEADER_STRINGS_H_DEFAULTS]) + AC_CHECK_FUNCS([strcasecmp]) + if test $ac_cv_func_strcasecmp = no; then + HAVE_STRCASECMP=0 + fi +]) + +AC_DEFUN([gl_FUNC_STRNCASECMP], +[ + AC_REQUIRE([gl_HEADER_STRINGS_H_DEFAULTS]) + AC_CHECK_FUNCS([strncasecmp]) + if test $ac_cv_func_strncasecmp = yes; then + HAVE_STRNCASECMP=1 + else + HAVE_STRNCASECMP=0 + fi + AC_CHECK_DECLS([strncasecmp]) + if test $ac_cv_have_decl_strncasecmp = no; then + HAVE_DECL_STRNCASECMP=0 + fi +]) + +# Prerequisites of lib/strcasecmp.c. +AC_DEFUN([gl_PREREQ_STRCASECMP], [ + : +]) + +# Prerequisites of lib/strncasecmp.c. +AC_DEFUN([gl_PREREQ_STRNCASECMP], [ + : +]) diff -Nru libdap-3.11.1/gl/m4/strings_h.m4 libdap-3.12.0/gl/m4/strings_h.m4 --- libdap-3.11.1/gl/m4/strings_h.m4 1970-01-01 00:00:00.000000000 +0000 +++ libdap-3.12.0/gl/m4/strings_h.m4 2013-10-17 21:27:40.000000000 +0000 @@ -0,0 +1,52 @@ +# Configure a replacement for . +# serial 6 + +# Copyright (C) 2007, 2009-2012 Free Software Foundation, Inc. +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +AC_DEFUN([gl_HEADER_STRINGS_H], +[ + dnl Use AC_REQUIRE here, so that the default behavior below is expanded + dnl once only, before all statements that occur in other macros. + AC_REQUIRE([gl_HEADER_STRINGS_H_BODY]) +]) + +AC_DEFUN([gl_HEADER_STRINGS_H_BODY], +[ + AC_REQUIRE([gl_HEADER_STRINGS_H_DEFAULTS]) + + gl_CHECK_NEXT_HEADERS([strings.h]) + if test $ac_cv_header_strings_h = yes; then + HAVE_STRINGS_H=1 + else + HAVE_STRINGS_H=0 + fi + AC_SUBST([HAVE_STRINGS_H]) + + dnl Check for declarations of anything we want to poison if the + dnl corresponding gnulib module is not in use. + gl_WARN_ON_USE_PREPARE([[ + /* Minix 3.1.8 has a bug: must be included before + . */ + #include + #include + ]], [ffs strcasecmp strncasecmp]) +]) + +AC_DEFUN([gl_STRINGS_MODULE_INDICATOR], +[ + dnl Use AC_REQUIRE here, so that the default settings are expanded once only. + AC_REQUIRE([gl_HEADER_STRINGS_H_DEFAULTS]) + gl_MODULE_INDICATOR_SET_VARIABLE([$1]) +]) + +AC_DEFUN([gl_HEADER_STRINGS_H_DEFAULTS], +[ + GNULIB_FFS=0; AC_SUBST([GNULIB_FFS]) + dnl Assume proper GNU behavior unless another module says otherwise. + HAVE_FFS=1; AC_SUBST([HAVE_FFS]) + HAVE_STRCASECMP=1; AC_SUBST([HAVE_STRCASECMP]) + HAVE_DECL_STRNCASECMP=1; AC_SUBST([HAVE_DECL_STRNCASECMP]) +]) diff -Nru libdap-3.11.1/gl/m4/sys_types_h.m4 libdap-3.12.0/gl/m4/sys_types_h.m4 --- libdap-3.11.1/gl/m4/sys_types_h.m4 1970-01-01 00:00:00.000000000 +0000 +++ libdap-3.12.0/gl/m4/sys_types_h.m4 2013-10-17 21:27:40.000000000 +0000 @@ -0,0 +1,24 @@ +# sys_types_h.m4 serial 4 +dnl Copyright (C) 2011-2012 Free Software Foundation, Inc. +dnl This file is free software; the Free Software Foundation +dnl gives unlimited permission to copy and/or distribute it, +dnl with or without modifications, as long as this notice is preserved. + +AC_DEFUN([gl_SYS_TYPES_H], +[ + AC_REQUIRE([gl_SYS_TYPES_H_DEFAULTS]) + gl_NEXT_HEADERS([sys/types.h]) + + dnl Ensure the type pid_t gets defined. + AC_REQUIRE([AC_TYPE_PID_T]) + + dnl Ensure the type mode_t gets defined. + AC_REQUIRE([AC_TYPE_MODE_T]) + + dnl Whether to override the 'off_t' type. + AC_REQUIRE([gl_TYPE_OFF_T]) +]) + +AC_DEFUN([gl_SYS_TYPES_H_DEFAULTS], +[ +]) diff -Nru libdap-3.11.1/gl/m4/unistd_h.m4 libdap-3.12.0/gl/m4/unistd_h.m4 --- libdap-3.11.1/gl/m4/unistd_h.m4 2011-04-29 13:19:35.000000000 +0000 +++ libdap-3.12.0/gl/m4/unistd_h.m4 2013-10-17 21:27:40.000000000 +0000 @@ -1,5 +1,5 @@ -# unistd_h.m4 serial 53 -dnl Copyright (C) 2006-2011 Free Software Foundation, Inc. +# unistd_h.m4 serial 65 +dnl Copyright (C) 2006-2012 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. @@ -21,9 +21,18 @@ fi AC_SUBST([HAVE_UNISTD_H]) + dnl Ensure the type pid_t gets defined. + AC_REQUIRE([AC_TYPE_PID_T]) + + dnl Determine WINDOWS_64_BIT_OFF_T. + AC_REQUIRE([gl_TYPE_OFF_T]) + dnl Check for declarations of anything we want to poison if the dnl corresponding gnulib module is not in use. - gl_WARN_ON_USE_PREPARE([[#include + gl_WARN_ON_USE_PREPARE([[ +#if HAVE_UNISTD_H +# include +#endif /* Some systems declare various items in the wrong headers. */ #if !(defined __GLIBC__ && !defined __UCLIBC__) # include @@ -33,12 +42,13 @@ # include # endif #endif - ]], [chown dup2 dup3 environ euidaccess faccessat fchdir fchownat - fsync ftruncate getcwd getdomainname getdtablesize getgroups - gethostname getlogin getlogin_r getpagesize getusershell setusershell - endusershell lchown link linkat lseek pipe pipe2 pread pwrite readlink - readlinkat rmdir sleep symlink symlinkat ttyname_r unlink unlinkat - usleep]) + ]], [chdir chown dup dup2 dup3 environ euidaccess faccessat fchdir fchownat + fdatasync fsync ftruncate getcwd getdomainname getdtablesize getgroups + gethostname getlogin getlogin_r getpagesize + getusershell setusershell endusershell + group_member isatty lchown link linkat lseek pipe pipe2 pread pwrite + readlink readlinkat rmdir sethostname sleep symlink symlinkat ttyname_r + unlink unlinkat usleep]) ]) AC_DEFUN([gl_UNISTD_MODULE_INDICATOR], @@ -52,47 +62,54 @@ AC_DEFUN([gl_UNISTD_H_DEFAULTS], [ - GNULIB_CHOWN=0; AC_SUBST([GNULIB_CHOWN]) - GNULIB_CLOSE=0; AC_SUBST([GNULIB_CLOSE]) - GNULIB_DUP2=0; AC_SUBST([GNULIB_DUP2]) - GNULIB_DUP3=0; AC_SUBST([GNULIB_DUP3]) - GNULIB_ENVIRON=0; AC_SUBST([GNULIB_ENVIRON]) - GNULIB_EUIDACCESS=0; AC_SUBST([GNULIB_EUIDACCESS]) - GNULIB_FACCESSAT=0; AC_SUBST([GNULIB_FACCESSAT]) - GNULIB_FCHDIR=0; AC_SUBST([GNULIB_FCHDIR]) - GNULIB_FCHOWNAT=0; AC_SUBST([GNULIB_FCHOWNAT]) - GNULIB_FSYNC=0; AC_SUBST([GNULIB_FSYNC]) - GNULIB_FTRUNCATE=0; AC_SUBST([GNULIB_FTRUNCATE]) - GNULIB_GETCWD=0; AC_SUBST([GNULIB_GETCWD]) - GNULIB_GETDOMAINNAME=0; AC_SUBST([GNULIB_GETDOMAINNAME]) - GNULIB_GETDTABLESIZE=0; AC_SUBST([GNULIB_GETDTABLESIZE]) - GNULIB_GETGROUPS=0; AC_SUBST([GNULIB_GETGROUPS]) - GNULIB_GETHOSTNAME=0; AC_SUBST([GNULIB_GETHOSTNAME]) - GNULIB_GETLOGIN=0; AC_SUBST([GNULIB_GETLOGIN]) - GNULIB_GETLOGIN_R=0; AC_SUBST([GNULIB_GETLOGIN_R]) - GNULIB_GETPAGESIZE=0; AC_SUBST([GNULIB_GETPAGESIZE]) - GNULIB_GETUSERSHELL=0; AC_SUBST([GNULIB_GETUSERSHELL]) - GNULIB_LCHOWN=0; AC_SUBST([GNULIB_LCHOWN]) - GNULIB_LINK=0; AC_SUBST([GNULIB_LINK]) - GNULIB_LINKAT=0; AC_SUBST([GNULIB_LINKAT]) - GNULIB_LSEEK=0; AC_SUBST([GNULIB_LSEEK]) - GNULIB_PIPE=0; AC_SUBST([GNULIB_PIPE]) - GNULIB_PIPE2=0; AC_SUBST([GNULIB_PIPE2]) - GNULIB_PREAD=0; AC_SUBST([GNULIB_PREAD]) - GNULIB_PWRITE=0; AC_SUBST([GNULIB_PWRITE]) - GNULIB_READLINK=0; AC_SUBST([GNULIB_READLINK]) - GNULIB_READLINKAT=0; AC_SUBST([GNULIB_READLINKAT]) - GNULIB_RMDIR=0; AC_SUBST([GNULIB_RMDIR]) - GNULIB_SLEEP=0; AC_SUBST([GNULIB_SLEEP]) - GNULIB_SYMLINK=0; AC_SUBST([GNULIB_SYMLINK]) - GNULIB_SYMLINKAT=0; AC_SUBST([GNULIB_SYMLINKAT]) - GNULIB_TTYNAME_R=0; AC_SUBST([GNULIB_TTYNAME_R]) - GNULIB_UNISTD_H_GETOPT=0; AC_SUBST([GNULIB_UNISTD_H_GETOPT]) - GNULIB_UNISTD_H_SIGPIPE=0; AC_SUBST([GNULIB_UNISTD_H_SIGPIPE]) - GNULIB_UNLINK=0; AC_SUBST([GNULIB_UNLINK]) - GNULIB_UNLINKAT=0; AC_SUBST([GNULIB_UNLINKAT]) - GNULIB_USLEEP=0; AC_SUBST([GNULIB_USLEEP]) - GNULIB_WRITE=0; AC_SUBST([GNULIB_WRITE]) + GNULIB_CHDIR=0; AC_SUBST([GNULIB_CHDIR]) + GNULIB_CHOWN=0; AC_SUBST([GNULIB_CHOWN]) + GNULIB_CLOSE=0; AC_SUBST([GNULIB_CLOSE]) + GNULIB_DUP=0; AC_SUBST([GNULIB_DUP]) + GNULIB_DUP2=0; AC_SUBST([GNULIB_DUP2]) + GNULIB_DUP3=0; AC_SUBST([GNULIB_DUP3]) + GNULIB_ENVIRON=0; AC_SUBST([GNULIB_ENVIRON]) + GNULIB_EUIDACCESS=0; AC_SUBST([GNULIB_EUIDACCESS]) + GNULIB_FACCESSAT=0; AC_SUBST([GNULIB_FACCESSAT]) + GNULIB_FCHDIR=0; AC_SUBST([GNULIB_FCHDIR]) + GNULIB_FCHOWNAT=0; AC_SUBST([GNULIB_FCHOWNAT]) + GNULIB_FDATASYNC=0; AC_SUBST([GNULIB_FDATASYNC]) + GNULIB_FSYNC=0; AC_SUBST([GNULIB_FSYNC]) + GNULIB_FTRUNCATE=0; AC_SUBST([GNULIB_FTRUNCATE]) + GNULIB_GETCWD=0; AC_SUBST([GNULIB_GETCWD]) + GNULIB_GETDOMAINNAME=0; AC_SUBST([GNULIB_GETDOMAINNAME]) + GNULIB_GETDTABLESIZE=0; AC_SUBST([GNULIB_GETDTABLESIZE]) + GNULIB_GETGROUPS=0; AC_SUBST([GNULIB_GETGROUPS]) + GNULIB_GETHOSTNAME=0; AC_SUBST([GNULIB_GETHOSTNAME]) + GNULIB_GETLOGIN=0; AC_SUBST([GNULIB_GETLOGIN]) + GNULIB_GETLOGIN_R=0; AC_SUBST([GNULIB_GETLOGIN_R]) + GNULIB_GETPAGESIZE=0; AC_SUBST([GNULIB_GETPAGESIZE]) + GNULIB_GETUSERSHELL=0; AC_SUBST([GNULIB_GETUSERSHELL]) + GNULIB_GROUP_MEMBER=0; AC_SUBST([GNULIB_GROUP_MEMBER]) + GNULIB_ISATTY=0; AC_SUBST([GNULIB_ISATTY]) + GNULIB_LCHOWN=0; AC_SUBST([GNULIB_LCHOWN]) + GNULIB_LINK=0; AC_SUBST([GNULIB_LINK]) + GNULIB_LINKAT=0; AC_SUBST([GNULIB_LINKAT]) + GNULIB_LSEEK=0; AC_SUBST([GNULIB_LSEEK]) + GNULIB_PIPE=0; AC_SUBST([GNULIB_PIPE]) + GNULIB_PIPE2=0; AC_SUBST([GNULIB_PIPE2]) + GNULIB_PREAD=0; AC_SUBST([GNULIB_PREAD]) + GNULIB_PWRITE=0; AC_SUBST([GNULIB_PWRITE]) + GNULIB_READ=0; AC_SUBST([GNULIB_READ]) + GNULIB_READLINK=0; AC_SUBST([GNULIB_READLINK]) + GNULIB_READLINKAT=0; AC_SUBST([GNULIB_READLINKAT]) + GNULIB_RMDIR=0; AC_SUBST([GNULIB_RMDIR]) + GNULIB_SETHOSTNAME=0; AC_SUBST([GNULIB_SETHOSTNAME]) + GNULIB_SLEEP=0; AC_SUBST([GNULIB_SLEEP]) + GNULIB_SYMLINK=0; AC_SUBST([GNULIB_SYMLINK]) + GNULIB_SYMLINKAT=0; AC_SUBST([GNULIB_SYMLINKAT]) + GNULIB_TTYNAME_R=0; AC_SUBST([GNULIB_TTYNAME_R]) + GNULIB_UNISTD_H_NONBLOCKING=0; AC_SUBST([GNULIB_UNISTD_H_NONBLOCKING]) + GNULIB_UNISTD_H_SIGPIPE=0; AC_SUBST([GNULIB_UNISTD_H_SIGPIPE]) + GNULIB_UNLINK=0; AC_SUBST([GNULIB_UNLINK]) + GNULIB_UNLINKAT=0; AC_SUBST([GNULIB_UNLINKAT]) + GNULIB_USLEEP=0; AC_SUBST([GNULIB_USLEEP]) + GNULIB_WRITE=0; AC_SUBST([GNULIB_WRITE]) dnl Assume proper GNU behavior unless another module says otherwise. HAVE_CHOWN=1; AC_SUBST([HAVE_CHOWN]) HAVE_DUP2=1; AC_SUBST([HAVE_DUP2]) @@ -101,6 +118,7 @@ HAVE_FACCESSAT=1; AC_SUBST([HAVE_FACCESSAT]) HAVE_FCHDIR=1; AC_SUBST([HAVE_FCHDIR]) HAVE_FCHOWNAT=1; AC_SUBST([HAVE_FCHOWNAT]) + HAVE_FDATASYNC=1; AC_SUBST([HAVE_FDATASYNC]) HAVE_FSYNC=1; AC_SUBST([HAVE_FSYNC]) HAVE_FTRUNCATE=1; AC_SUBST([HAVE_FTRUNCATE]) HAVE_GETDTABLESIZE=1; AC_SUBST([HAVE_GETDTABLESIZE]) @@ -108,6 +126,7 @@ HAVE_GETHOSTNAME=1; AC_SUBST([HAVE_GETHOSTNAME]) HAVE_GETLOGIN=1; AC_SUBST([HAVE_GETLOGIN]) HAVE_GETPAGESIZE=1; AC_SUBST([HAVE_GETPAGESIZE]) + HAVE_GROUP_MEMBER=1; AC_SUBST([HAVE_GROUP_MEMBER]) HAVE_LCHOWN=1; AC_SUBST([HAVE_LCHOWN]) HAVE_LINK=1; AC_SUBST([HAVE_LINK]) HAVE_LINKAT=1; AC_SUBST([HAVE_LINKAT]) @@ -117,6 +136,7 @@ HAVE_PWRITE=1; AC_SUBST([HAVE_PWRITE]) HAVE_READLINK=1; AC_SUBST([HAVE_READLINK]) HAVE_READLINKAT=1; AC_SUBST([HAVE_READLINKAT]) + HAVE_SETHOSTNAME=1; AC_SUBST([HAVE_SETHOSTNAME]) HAVE_SLEEP=1; AC_SUBST([HAVE_SLEEP]) HAVE_SYMLINK=1; AC_SUBST([HAVE_SYMLINK]) HAVE_SYMLINKAT=1; AC_SUBST([HAVE_SYMLINKAT]) @@ -124,10 +144,12 @@ HAVE_USLEEP=1; AC_SUBST([HAVE_USLEEP]) HAVE_DECL_ENVIRON=1; AC_SUBST([HAVE_DECL_ENVIRON]) HAVE_DECL_FCHDIR=1; AC_SUBST([HAVE_DECL_FCHDIR]) + HAVE_DECL_FDATASYNC=1; AC_SUBST([HAVE_DECL_FDATASYNC]) HAVE_DECL_GETDOMAINNAME=1; AC_SUBST([HAVE_DECL_GETDOMAINNAME]) HAVE_DECL_GETLOGIN_R=1; AC_SUBST([HAVE_DECL_GETLOGIN_R]) HAVE_DECL_GETPAGESIZE=1; AC_SUBST([HAVE_DECL_GETPAGESIZE]) HAVE_DECL_GETUSERSHELL=1; AC_SUBST([HAVE_DECL_GETUSERSHELL]) + HAVE_DECL_SETHOSTNAME=1; AC_SUBST([HAVE_DECL_SETHOSTNAME]) HAVE_DECL_TTYNAME_R=1; AC_SUBST([HAVE_DECL_TTYNAME_R]) HAVE_OS_H=0; AC_SUBST([HAVE_OS_H]) HAVE_SYS_PARAM_H=0; AC_SUBST([HAVE_SYS_PARAM_H]) @@ -136,17 +158,20 @@ REPLACE_DUP=0; AC_SUBST([REPLACE_DUP]) REPLACE_DUP2=0; AC_SUBST([REPLACE_DUP2]) REPLACE_FCHOWNAT=0; AC_SUBST([REPLACE_FCHOWNAT]) + REPLACE_FTRUNCATE=0; AC_SUBST([REPLACE_FTRUNCATE]) REPLACE_GETCWD=0; AC_SUBST([REPLACE_GETCWD]) REPLACE_GETDOMAINNAME=0; AC_SUBST([REPLACE_GETDOMAINNAME]) REPLACE_GETLOGIN_R=0; AC_SUBST([REPLACE_GETLOGIN_R]) REPLACE_GETGROUPS=0; AC_SUBST([REPLACE_GETGROUPS]) REPLACE_GETPAGESIZE=0; AC_SUBST([REPLACE_GETPAGESIZE]) + REPLACE_ISATTY=0; AC_SUBST([REPLACE_ISATTY]) REPLACE_LCHOWN=0; AC_SUBST([REPLACE_LCHOWN]) REPLACE_LINK=0; AC_SUBST([REPLACE_LINK]) REPLACE_LINKAT=0; AC_SUBST([REPLACE_LINKAT]) REPLACE_LSEEK=0; AC_SUBST([REPLACE_LSEEK]) REPLACE_PREAD=0; AC_SUBST([REPLACE_PREAD]) REPLACE_PWRITE=0; AC_SUBST([REPLACE_PWRITE]) + REPLACE_READ=0; AC_SUBST([REPLACE_READ]) REPLACE_READLINK=0; AC_SUBST([REPLACE_READLINK]) REPLACE_RMDIR=0; AC_SUBST([REPLACE_RMDIR]) REPLACE_SLEEP=0; AC_SUBST([REPLACE_SLEEP]) diff -Nru libdap-3.11.1/gl/m4/warn-on-use.m4 libdap-3.12.0/gl/m4/warn-on-use.m4 --- libdap-3.11.1/gl/m4/warn-on-use.m4 2011-04-29 13:19:35.000000000 +0000 +++ libdap-3.12.0/gl/m4/warn-on-use.m4 2013-10-17 21:27:40.000000000 +0000 @@ -1,5 +1,5 @@ -# warn-on-use.m4 serial 2 -dnl Copyright (C) 2010-2011 Free Software Foundation, Inc. +# warn-on-use.m4 serial 5 +dnl Copyright (C) 2010-2012 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. @@ -18,8 +18,8 @@ # some systems declare functions in the wrong header, then INCLUDES # should do likewise. # -# If you assume C89, then it is generally safe to assume declarations -# for functions declared in that standard (such as gets) without +# It is generally safe to assume declarations for functions declared +# in the intersection of C89 and C11 (such as printf) without # needing gl_WARN_ON_USE_PREPARE. AC_DEFUN([gl_WARN_ON_USE_PREPARE], [ @@ -27,6 +27,8 @@ [AH_TEMPLATE([HAVE_RAW_DECL_]AS_TR_CPP(m4_defn([gl_decl])), [Define to 1 if ]m4_defn([gl_decl])[ is declared even after undefining macros.])])dnl +dnl FIXME: gl_Symbol must be used unquoted until we can assume +dnl autoconf 2.64 or newer. for gl_func in m4_flatten([$2]); do AS_VAR_PUSHDEF([gl_Symbol], [gl_cv_have_raw_decl_$gl_func])dnl AC_CACHE_CHECK([whether $gl_func is declared without a macro], @@ -35,8 +37,8 @@ [@%:@undef $gl_func (void) $gl_func;])], [AS_VAR_SET(gl_Symbol, [yes])], [AS_VAR_SET(gl_Symbol, [no])])]) - AS_VAR_IF(gl_Symbol, [yes], - [AC_DEFINE_UNQUOTED(AS_TR_CPP([HAVE_RAW_DECL_$gl_func]), [1]) + AS_VAR_IF(gl_Symbol, [yes], + [AC_DEFINE_UNQUOTED(AS_TR_CPP([HAVE_RAW_DECL_$gl_func]), [1]) dnl shortcut - if the raw declaration exists, then set a cache dnl variable to allow skipping any later AC_CHECK_DECL efforts eval ac_cv_have_decl_$gl_func=yes]) diff -Nru libdap-3.11.1/gl/m4/wchar_h.m4 libdap-3.12.0/gl/m4/wchar_h.m4 --- libdap-3.11.1/gl/m4/wchar_h.m4 2011-04-29 13:19:35.000000000 +0000 +++ libdap-3.12.0/gl/m4/wchar_h.m4 2013-10-17 21:27:40.000000000 +0000 @@ -1,13 +1,13 @@ dnl A placeholder for ISO C99 , for platforms that have issues. -dnl Copyright (C) 2007-2011 Free Software Foundation, Inc. +dnl Copyright (C) 2007-2012 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. dnl Written by Eric Blake. -# wchar_h.m4 serial 37 +# wchar_h.m4 serial 39 AC_DEFUN([gl_WCHAR_H], [ @@ -48,8 +48,13 @@ # include #endif #include - ]], [btowc wctob mbsinit mbrtowc mbrlen mbsrtowcs mbsnrtowcs wcrtomb - wcsrtombs wcsnrtombs wcwidth]) + ]], + [btowc wctob mbsinit mbrtowc mbrlen mbsrtowcs mbsnrtowcs wcrtomb + wcsrtombs wcsnrtombs wcwidth wmemchr wmemcmp wmemcpy wmemmove wmemset + wcslen wcsnlen wcscpy wcpcpy wcsncpy wcpncpy wcscat wcsncat wcscmp + wcsncmp wcscasecmp wcsncasecmp wcscoll wcsxfrm wcsdup wcschr wcsrchr + wcscspn wcsspn wcspbrk wcsstr wcstok wcswidth + ]) ]) dnl Check whether is usable at all. @@ -114,13 +119,6 @@ fi ]) -dnl Unconditionally enables the replacement of . -AC_DEFUN([gl_REPLACE_WCHAR_H], -[ - dnl This is a no-op, because is always overridden. - : -]) - AC_DEFUN([gl_WCHAR_MODULE_INDICATOR], [ dnl Use AC_REQUIRE here, so that the default settings are expanded once only. @@ -132,17 +130,45 @@ AC_DEFUN([gl_WCHAR_H_DEFAULTS], [ - GNULIB_BTOWC=0; AC_SUBST([GNULIB_BTOWC]) - GNULIB_WCTOB=0; AC_SUBST([GNULIB_WCTOB]) - GNULIB_MBSINIT=0; AC_SUBST([GNULIB_MBSINIT]) - GNULIB_MBRTOWC=0; AC_SUBST([GNULIB_MBRTOWC]) - GNULIB_MBRLEN=0; AC_SUBST([GNULIB_MBRLEN]) - GNULIB_MBSRTOWCS=0; AC_SUBST([GNULIB_MBSRTOWCS]) - GNULIB_MBSNRTOWCS=0; AC_SUBST([GNULIB_MBSNRTOWCS]) - GNULIB_WCRTOMB=0; AC_SUBST([GNULIB_WCRTOMB]) - GNULIB_WCSRTOMBS=0; AC_SUBST([GNULIB_WCSRTOMBS]) - GNULIB_WCSNRTOMBS=0; AC_SUBST([GNULIB_WCSNRTOMBS]) - GNULIB_WCWIDTH=0; AC_SUBST([GNULIB_WCWIDTH]) + GNULIB_BTOWC=0; AC_SUBST([GNULIB_BTOWC]) + GNULIB_WCTOB=0; AC_SUBST([GNULIB_WCTOB]) + GNULIB_MBSINIT=0; AC_SUBST([GNULIB_MBSINIT]) + GNULIB_MBRTOWC=0; AC_SUBST([GNULIB_MBRTOWC]) + GNULIB_MBRLEN=0; AC_SUBST([GNULIB_MBRLEN]) + GNULIB_MBSRTOWCS=0; AC_SUBST([GNULIB_MBSRTOWCS]) + GNULIB_MBSNRTOWCS=0; AC_SUBST([GNULIB_MBSNRTOWCS]) + GNULIB_WCRTOMB=0; AC_SUBST([GNULIB_WCRTOMB]) + GNULIB_WCSRTOMBS=0; AC_SUBST([GNULIB_WCSRTOMBS]) + GNULIB_WCSNRTOMBS=0; AC_SUBST([GNULIB_WCSNRTOMBS]) + GNULIB_WCWIDTH=0; AC_SUBST([GNULIB_WCWIDTH]) + GNULIB_WMEMCHR=0; AC_SUBST([GNULIB_WMEMCHR]) + GNULIB_WMEMCMP=0; AC_SUBST([GNULIB_WMEMCMP]) + GNULIB_WMEMCPY=0; AC_SUBST([GNULIB_WMEMCPY]) + GNULIB_WMEMMOVE=0; AC_SUBST([GNULIB_WMEMMOVE]) + GNULIB_WMEMSET=0; AC_SUBST([GNULIB_WMEMSET]) + GNULIB_WCSLEN=0; AC_SUBST([GNULIB_WCSLEN]) + GNULIB_WCSNLEN=0; AC_SUBST([GNULIB_WCSNLEN]) + GNULIB_WCSCPY=0; AC_SUBST([GNULIB_WCSCPY]) + GNULIB_WCPCPY=0; AC_SUBST([GNULIB_WCPCPY]) + GNULIB_WCSNCPY=0; AC_SUBST([GNULIB_WCSNCPY]) + GNULIB_WCPNCPY=0; AC_SUBST([GNULIB_WCPNCPY]) + GNULIB_WCSCAT=0; AC_SUBST([GNULIB_WCSCAT]) + GNULIB_WCSNCAT=0; AC_SUBST([GNULIB_WCSNCAT]) + GNULIB_WCSCMP=0; AC_SUBST([GNULIB_WCSCMP]) + GNULIB_WCSNCMP=0; AC_SUBST([GNULIB_WCSNCMP]) + GNULIB_WCSCASECMP=0; AC_SUBST([GNULIB_WCSCASECMP]) + GNULIB_WCSNCASECMP=0; AC_SUBST([GNULIB_WCSNCASECMP]) + GNULIB_WCSCOLL=0; AC_SUBST([GNULIB_WCSCOLL]) + GNULIB_WCSXFRM=0; AC_SUBST([GNULIB_WCSXFRM]) + GNULIB_WCSDUP=0; AC_SUBST([GNULIB_WCSDUP]) + GNULIB_WCSCHR=0; AC_SUBST([GNULIB_WCSCHR]) + GNULIB_WCSRCHR=0; AC_SUBST([GNULIB_WCSRCHR]) + GNULIB_WCSCSPN=0; AC_SUBST([GNULIB_WCSCSPN]) + GNULIB_WCSSPN=0; AC_SUBST([GNULIB_WCSSPN]) + GNULIB_WCSPBRK=0; AC_SUBST([GNULIB_WCSPBRK]) + GNULIB_WCSSTR=0; AC_SUBST([GNULIB_WCSSTR]) + GNULIB_WCSTOK=0; AC_SUBST([GNULIB_WCSTOK]) + GNULIB_WCSWIDTH=0; AC_SUBST([GNULIB_WCSWIDTH]) dnl Assume proper GNU behavior unless another module says otherwise. HAVE_BTOWC=1; AC_SUBST([HAVE_BTOWC]) HAVE_MBSINIT=1; AC_SUBST([HAVE_MBSINIT]) @@ -153,6 +179,34 @@ HAVE_WCRTOMB=1; AC_SUBST([HAVE_WCRTOMB]) HAVE_WCSRTOMBS=1; AC_SUBST([HAVE_WCSRTOMBS]) HAVE_WCSNRTOMBS=1; AC_SUBST([HAVE_WCSNRTOMBS]) + HAVE_WMEMCHR=1; AC_SUBST([HAVE_WMEMCHR]) + HAVE_WMEMCMP=1; AC_SUBST([HAVE_WMEMCMP]) + HAVE_WMEMCPY=1; AC_SUBST([HAVE_WMEMCPY]) + HAVE_WMEMMOVE=1; AC_SUBST([HAVE_WMEMMOVE]) + HAVE_WMEMSET=1; AC_SUBST([HAVE_WMEMSET]) + HAVE_WCSLEN=1; AC_SUBST([HAVE_WCSLEN]) + HAVE_WCSNLEN=1; AC_SUBST([HAVE_WCSNLEN]) + HAVE_WCSCPY=1; AC_SUBST([HAVE_WCSCPY]) + HAVE_WCPCPY=1; AC_SUBST([HAVE_WCPCPY]) + HAVE_WCSNCPY=1; AC_SUBST([HAVE_WCSNCPY]) + HAVE_WCPNCPY=1; AC_SUBST([HAVE_WCPNCPY]) + HAVE_WCSCAT=1; AC_SUBST([HAVE_WCSCAT]) + HAVE_WCSNCAT=1; AC_SUBST([HAVE_WCSNCAT]) + HAVE_WCSCMP=1; AC_SUBST([HAVE_WCSCMP]) + HAVE_WCSNCMP=1; AC_SUBST([HAVE_WCSNCMP]) + HAVE_WCSCASECMP=1; AC_SUBST([HAVE_WCSCASECMP]) + HAVE_WCSNCASECMP=1; AC_SUBST([HAVE_WCSNCASECMP]) + HAVE_WCSCOLL=1; AC_SUBST([HAVE_WCSCOLL]) + HAVE_WCSXFRM=1; AC_SUBST([HAVE_WCSXFRM]) + HAVE_WCSDUP=1; AC_SUBST([HAVE_WCSDUP]) + HAVE_WCSCHR=1; AC_SUBST([HAVE_WCSCHR]) + HAVE_WCSRCHR=1; AC_SUBST([HAVE_WCSRCHR]) + HAVE_WCSCSPN=1; AC_SUBST([HAVE_WCSCSPN]) + HAVE_WCSSPN=1; AC_SUBST([HAVE_WCSSPN]) + HAVE_WCSPBRK=1; AC_SUBST([HAVE_WCSPBRK]) + HAVE_WCSSTR=1; AC_SUBST([HAVE_WCSSTR]) + HAVE_WCSTOK=1; AC_SUBST([HAVE_WCSTOK]) + HAVE_WCSWIDTH=1; AC_SUBST([HAVE_WCSWIDTH]) HAVE_DECL_WCTOB=1; AC_SUBST([HAVE_DECL_WCTOB]) HAVE_DECL_WCWIDTH=1; AC_SUBST([HAVE_DECL_WCWIDTH]) REPLACE_MBSTATE_T=0; AC_SUBST([REPLACE_MBSTATE_T]) @@ -167,4 +221,5 @@ REPLACE_WCSRTOMBS=0; AC_SUBST([REPLACE_WCSRTOMBS]) REPLACE_WCSNRTOMBS=0; AC_SUBST([REPLACE_WCSNRTOMBS]) REPLACE_WCWIDTH=0; AC_SUBST([REPLACE_WCWIDTH]) + REPLACE_WCSWIDTH=0; AC_SUBST([REPLACE_WCSWIDTH]) ]) diff -Nru libdap-3.11.1/gl/m4/wchar_t.m4 libdap-3.12.0/gl/m4/wchar_t.m4 --- libdap-3.11.1/gl/m4/wchar_t.m4 2011-04-29 13:19:35.000000000 +0000 +++ libdap-3.12.0/gl/m4/wchar_t.m4 2013-10-17 21:27:40.000000000 +0000 @@ -1,5 +1,5 @@ # wchar_t.m4 serial 4 (gettext-0.18.2) -dnl Copyright (C) 2002-2003, 2008-2011 Free Software Foundation, Inc. +dnl Copyright (C) 2002-2003, 2008-2012 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. diff -Nru libdap-3.11.1/gl/m4/wcrtomb.m4 libdap-3.12.0/gl/m4/wcrtomb.m4 --- libdap-3.11.1/gl/m4/wcrtomb.m4 2011-04-29 13:19:35.000000000 +0000 +++ libdap-3.12.0/gl/m4/wcrtomb.m4 2013-10-17 21:27:40.000000000 +0000 @@ -1,5 +1,5 @@ -# wcrtomb.m4 serial 8 -dnl Copyright (C) 2008-2011 Free Software Foundation, Inc. +# wcrtomb.m4 serial 11 +dnl Copyright (C) 2008-2012 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. @@ -14,6 +14,22 @@ AC_CHECK_FUNCS_ONCE([wcrtomb]) if test $ac_cv_func_wcrtomb = no; then HAVE_WCRTOMB=0 + AC_CHECK_DECLS([wcrtomb],,, [[ +/* Tru64 with Desktop Toolkit C has a bug: must be included before + . + BSD/OS 4.0.1 has a bug: , and must be + included before . */ +#include +#include +#include +#include +]]) + if test $ac_cv_have_decl_wcrtomb = yes; then + dnl On Minix 3.1.8, the system's declares wcrtomb() although + dnl it does not have the function. Avoid a collision with gnulib's + dnl replacement. + REPLACE_WCRTOMB=1 + fi else if test $REPLACE_MBSTATE_T = 1; then REPLACE_WCRTOMB=1 @@ -88,11 +104,6 @@ esac fi fi - if test $HAVE_WCRTOMB = 0 || test $REPLACE_WCRTOMB = 1; then - gl_REPLACE_WCHAR_H - AC_LIBOBJ([wcrtomb]) - gl_PREREQ_WCRTOMB - fi ]) # Prerequisites of lib/wcrtomb.c. diff -Nru libdap-3.11.1/gl/m4/wctype_h.m4 libdap-3.12.0/gl/m4/wctype_h.m4 --- libdap-3.11.1/gl/m4/wctype_h.m4 2011-04-29 13:19:35.000000000 +0000 +++ libdap-3.12.0/gl/m4/wctype_h.m4 2013-10-17 21:27:40.000000000 +0000 @@ -1,8 +1,8 @@ -# wctype_h.m4 serial 12 +# wctype_h.m4 serial 17 dnl A placeholder for ISO C99 , for platforms that lack it. -dnl Copyright (C) 2006-2011 Free Software Foundation, Inc. +dnl Copyright (C) 2006-2012 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. @@ -11,6 +11,7 @@ AC_DEFUN([gl_WCTYPE_H], [ + AC_REQUIRE([gl_WCTYPE_H_DEFAULTS]) AC_REQUIRE([AC_PROG_CC]) AC_REQUIRE([AC_CANONICAL_HOST]) AC_CHECK_FUNCS_ONCE([iswcntrl]) @@ -20,21 +21,6 @@ HAVE_ISWCNTRL=0 fi AC_SUBST([HAVE_ISWCNTRL]) - AC_CHECK_FUNCS_ONCE([iswblank]) - AC_CHECK_DECLS_ONCE([iswblank]) - if test $ac_cv_func_iswblank = yes; then - HAVE_ISWBLANK=1 - REPLACE_ISWBLANK=0 - else - HAVE_ISWBLANK=0 - if test $ac_cv_have_decl_iswblank = yes; then - REPLACE_ISWBLANK=1 - else - REPLACE_ISWBLANK=0 - fi - fi - AC_SUBST([HAVE_ISWBLANK]) - AC_SUBST([REPLACE_ISWBLANK]) AC_REQUIRE([AC_C_INLINE]) @@ -71,7 +57,8 @@ #if __GNU_LIBRARY__ == 1 Linux libc5 i18n is broken. #endif]], [])], - [gl_cv_func_iswcntrl_works=yes], [gl_cv_func_iswcntrl_works=no]) + [gl_cv_func_iswcntrl_works="guessing yes"], + [gl_cv_func_iswcntrl_works="guessing no"]) ]) ]) fi @@ -81,20 +68,144 @@ fi AC_SUBST([HAVE_WCTYPE_H]) - if test "$gl_cv_func_iswcntrl_works" = no; then - REPLACE_ISWCNTRL=1 - else - REPLACE_ISWCNTRL=0 - fi + case "$gl_cv_func_iswcntrl_works" in + *yes) REPLACE_ISWCNTRL=0 ;; + *) REPLACE_ISWCNTRL=1 ;; + esac AC_SUBST([REPLACE_ISWCNTRL]) if test $HAVE_ISWCNTRL = 0 || test $REPLACE_ISWCNTRL = 1; then - dnl Redefine all of iswcntrl, ..., towupper in . + dnl Redefine all of iswcntrl, ..., iswxdigit in . : + fi + + if test $REPLACE_ISWCNTRL = 1; then + REPLACE_TOWLOWER=1 else - if test $HAVE_ISWBLANK = 0 || test $REPLACE_ISWBLANK = 1; then - dnl Redefine only iswblank. - AC_LIBOBJ([iswblank]) + AC_CHECK_FUNCS([towlower]) + if test $ac_cv_func_towlower = yes; then + REPLACE_TOWLOWER=0 + else + AC_CHECK_DECLS([towlower],,, + [[/* Tru64 with Desktop Toolkit C has a bug: must be + included before . + BSD/OS 4.0.1 has a bug: , and + must be included before . */ + #include + #include + #include + #include + #if HAVE_WCTYPE_H + # include + #endif + ]]) + if test $ac_cv_have_decl_towlower = yes; then + dnl On Minix 3.1.8, the system's declares towlower() and + dnl towupper() although it does not have the functions. Avoid a + dnl collision with gnulib's replacement. + REPLACE_TOWLOWER=1 + else + REPLACE_TOWLOWER=0 + fi fi fi + AC_SUBST([REPLACE_TOWLOWER]) + + if test $HAVE_ISWCNTRL = 0 || test $REPLACE_TOWLOWER = 1; then + dnl Redefine towlower, towupper in . + : + fi + + dnl We assume that the wctype() and iswctype() functions exist if and only + dnl if the type wctype_t is defined in or in if that + dnl exists. + dnl HP-UX 11.00 declares all these in and lacks . + AC_CACHE_CHECK([for wctype_t], [gl_cv_type_wctype_t], + [AC_COMPILE_IFELSE( + [AC_LANG_PROGRAM( + [[/* Tru64 with Desktop Toolkit C has a bug: must be + included before . + BSD/OS 4.0.1 has a bug: , and + must be included before . */ + #include + #include + #include + #include + #if HAVE_WCTYPE_H + # include + #endif + wctype_t a; + ]], + [[]])], + [gl_cv_type_wctype_t=yes], + [gl_cv_type_wctype_t=no]) + ]) + if test $gl_cv_type_wctype_t = no; then + HAVE_WCTYPE_T=0 + fi + + dnl We assume that the wctrans() and towctrans() functions exist if and only + dnl if the type wctrans_t is defined in . + AC_CACHE_CHECK([for wctrans_t], [gl_cv_type_wctrans_t], + [AC_COMPILE_IFELSE( + [AC_LANG_PROGRAM( + [[/* Tru64 with Desktop Toolkit C has a bug: must be + included before . + BSD/OS 4.0.1 has a bug: , and + must be included before . */ + #include + #include + #include + #include + #include + wctrans_t a; + ]], + [[]])], + [gl_cv_type_wctrans_t=yes], + [gl_cv_type_wctrans_t=no]) + ]) + if test $gl_cv_type_wctrans_t = no; then + HAVE_WCTRANS_T=0 + fi + + dnl Check for declarations of anything we want to poison if the + dnl corresponding gnulib module is not in use. + gl_WARN_ON_USE_PREPARE([[ +/* Tru64 with Desktop Toolkit C has a bug: must be included before + . + BSD/OS 4.0.1 has a bug: , and must be + included before . */ +#if !(defined __GLIBC__ && !defined __UCLIBC__) +# include +# include +# include +# include +#endif +#include + ]], + [wctype iswctype wctrans towctrans + ]) +]) + +AC_DEFUN([gl_WCTYPE_MODULE_INDICATOR], +[ + dnl Use AC_REQUIRE here, so that the default settings are expanded once only. + AC_REQUIRE([gl_WCTYPE_H_DEFAULTS]) + gl_MODULE_INDICATOR_SET_VARIABLE([$1]) + dnl Define it also as a C macro, for the benefit of the unit tests. + gl_MODULE_INDICATOR_FOR_TESTS([$1]) +]) + +AC_DEFUN([gl_WCTYPE_H_DEFAULTS], +[ + GNULIB_ISWBLANK=0; AC_SUBST([GNULIB_ISWBLANK]) + GNULIB_WCTYPE=0; AC_SUBST([GNULIB_WCTYPE]) + GNULIB_ISWCTYPE=0; AC_SUBST([GNULIB_ISWCTYPE]) + GNULIB_WCTRANS=0; AC_SUBST([GNULIB_WCTRANS]) + GNULIB_TOWCTRANS=0; AC_SUBST([GNULIB_TOWCTRANS]) + dnl Assume proper GNU behavior unless another module says otherwise. + HAVE_ISWBLANK=1; AC_SUBST([HAVE_ISWBLANK]) + HAVE_WCTYPE_T=1; AC_SUBST([HAVE_WCTYPE_T]) + HAVE_WCTRANS_T=1; AC_SUBST([HAVE_WCTRANS_T]) + REPLACE_ISWBLANK=0; AC_SUBST([REPLACE_ISWBLANK]) ]) diff -Nru libdap-3.11.1/gl/m4/wint_t.m4 libdap-3.12.0/gl/m4/wint_t.m4 --- libdap-3.11.1/gl/m4/wint_t.m4 2011-04-29 13:19:35.000000000 +0000 +++ libdap-3.12.0/gl/m4/wint_t.m4 2013-10-17 21:27:40.000000000 +0000 @@ -1,5 +1,5 @@ # wint_t.m4 serial 5 (gettext-0.18.2) -dnl Copyright (C) 2003, 2007-2011 Free Software Foundation, Inc. +dnl Copyright (C) 2003, 2007-2012 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. diff -Nru libdap-3.11.1/gl/malloc.c libdap-3.12.0/gl/malloc.c --- libdap-3.11.1/gl/malloc.c 2011-04-29 13:19:36.000000000 +0000 +++ libdap-3.12.0/gl/malloc.c 2013-10-17 21:27:40.000000000 +0000 @@ -1,6 +1,6 @@ /* malloc() function that is glibc compatible. - Copyright (C) 1997-1998, 2006-2007, 2009-2011 Free Software Foundation, Inc. + Copyright (C) 1997-1998, 2006-2007, 2009-2012 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by @@ -13,11 +13,11 @@ GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License - along with this program; if not, write to the Free Software Foundation, - Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ + along with this program; if not, see . */ /* written by Jim Meyering and Bruno Haible */ +#define _GL_USE_STDLIB_ALLOC 1 #include /* Only the AC_FUNC_MALLOC macro defines 'malloc' already in config.h. */ #ifdef malloc @@ -28,14 +28,10 @@ # define NEED_MALLOC_GNU 1 #endif -/* Specification. */ #include #include -/* Call the system's malloc below. */ -#undef malloc - /* Allocate an N-byte block of memory from the heap. If N is zero, allocate a 1-byte block. */ diff -Nru libdap-3.11.1/gl/mbrtowc.c libdap-3.12.0/gl/mbrtowc.c --- libdap-3.11.1/gl/mbrtowc.c 2011-04-29 13:19:36.000000000 +0000 +++ libdap-3.12.0/gl/mbrtowc.c 2013-10-17 21:27:40.000000000 +0000 @@ -1,5 +1,5 @@ /* Convert multibyte character to wide character. - Copyright (C) 1999-2002, 2005-2011 Free Software Foundation, Inc. + Copyright (C) 1999-2002, 2005-2012 Free Software Foundation, Inc. Written by Bruno Haible , 2008. This program is free software: you can redistribute it and/or modify @@ -40,9 +40,6 @@ { char *pstate = (char *)ps; - if (pstate == NULL) - pstate = internal_state; - if (s == NULL) { pwc = NULL; @@ -54,6 +51,10 @@ return (size_t)(-2); /* Here n > 0. */ + + if (pstate == NULL) + pstate = internal_state; + { size_t nstate = pstate[0]; char buf[4]; @@ -127,7 +128,7 @@ { const char *encoding = locale_charset (); - if (STREQ (encoding, "UTF-8", 'U', 'T', 'F', '-', '8', 0, 0, 0, 0)) + if (STREQ_OPT (encoding, "UTF-8", 'U', 'T', 'F', '-', '8', 0, 0, 0, 0)) { /* Cf. unistr/u8-mblen.c. */ unsigned char c = (unsigned char) p[0]; @@ -184,7 +185,8 @@ /* As a reference for this code, you can use the GNU libiconv implementation. Look for uses of the RET_TOOFEW macro. */ - if (STREQ (encoding, "EUC-JP", 'E', 'U', 'C', '-', 'J', 'P', 0, 0, 0)) + if (STREQ_OPT (encoding, + "EUC-JP", 'E', 'U', 'C', '-', 'J', 'P', 0, 0, 0)) { if (m == 1) { @@ -207,9 +209,12 @@ } goto invalid; } - if (STREQ (encoding, "EUC-KR", 'E', 'U', 'C', '-', 'K', 'R', 0, 0, 0) - || STREQ (encoding, "GB2312", 'G', 'B', '2', '3', '1', '2', 0, 0, 0) - || STREQ (encoding, "BIG5", 'B', 'I', 'G', '5', 0, 0, 0, 0, 0)) + if (STREQ_OPT (encoding, + "EUC-KR", 'E', 'U', 'C', '-', 'K', 'R', 0, 0, 0) + || STREQ_OPT (encoding, + "GB2312", 'G', 'B', '2', '3', '1', '2', 0, 0, 0) + || STREQ_OPT (encoding, + "BIG5", 'B', 'I', 'G', '5', 0, 0, 0, 0, 0)) { if (m == 1) { @@ -220,7 +225,8 @@ } goto invalid; } - if (STREQ (encoding, "EUC-TW", 'E', 'U', 'C', '-', 'T', 'W', 0, 0, 0)) + if (STREQ_OPT (encoding, + "EUC-TW", 'E', 'U', 'C', '-', 'T', 'W', 0, 0, 0)) { if (m == 1) { @@ -238,7 +244,8 @@ } goto invalid; } - if (STREQ (encoding, "GB18030", 'G', 'B', '1', '8', '0', '3', '0', 0, 0)) + if (STREQ_OPT (encoding, + "GB18030", 'G', 'B', '1', '8', '0', '3', '0', 0, 0)) { if (m == 1) { @@ -271,7 +278,7 @@ } goto invalid; } - if (STREQ (encoding, "SJIS", 'S', 'J', 'I', 'S', 0, 0, 0, 0, 0)) + if (STREQ_OPT (encoding, "SJIS", 'S', 'J', 'I', 'S', 0, 0, 0, 0, 0)) { if (m == 1) { @@ -334,7 +341,7 @@ { static mbstate_t internal_state; - /* Override mbrtowc's internal state. We can not call mbsinit() on the + /* Override mbrtowc's internal state. We cannot call mbsinit() on the hidden internal state, but we can call it on our variable. */ if (ps == NULL) ps = &internal_state; diff -Nru libdap-3.11.1/gl/mbsinit.c libdap-3.12.0/gl/mbsinit.c --- libdap-3.11.1/gl/mbsinit.c 2011-04-29 13:19:36.000000000 +0000 +++ libdap-3.12.0/gl/mbsinit.c 2013-10-17 21:27:40.000000000 +0000 @@ -1,5 +1,5 @@ /* Test for initial conversion state. - Copyright (C) 2008-2011 Free Software Foundation, Inc. + Copyright (C) 2008-2012 Free Software Foundation, Inc. Written by Bruno Haible , 2008. This program is free software: you can redistribute it and/or modify @@ -22,6 +22,18 @@ #include "verify.h" +#if (defined _WIN32 || defined __WIN32__) && !defined __CYGWIN__ + +/* On native Windows, 'mbstate_t' is defined as 'int'. */ + +int +mbsinit (const mbstate_t *ps) +{ + return ps == NULL || *ps == 0; +} + +#else + /* Platforms that lack mbsinit() also lack mbrlen(), mbrtowc(), mbsrtowcs() and wcrtomb(), wcsrtombs(). We assume that @@ -43,5 +55,7 @@ { const char *pstate = (const char *)ps; - return pstate[0] == 0; + return pstate == NULL || pstate[0] == 0; } + +#endif diff -Nru libdap-3.11.1/gl/mbtowc-impl.h libdap-3.12.0/gl/mbtowc-impl.h --- libdap-3.11.1/gl/mbtowc-impl.h 1970-01-01 00:00:00.000000000 +0000 +++ libdap-3.12.0/gl/mbtowc-impl.h 2013-10-17 21:27:40.000000000 +0000 @@ -0,0 +1,44 @@ +/* Convert multibyte character to wide character. + Copyright (C) 2011-2012 Free Software Foundation, Inc. + Written by Bruno Haible , 2011. + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU Lesser General Public License as published by + the Free Software Foundation; either version 3 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 Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public License + along with this program. If not, see . */ + +/* We don't need a static internal state, because the encoding is not state + dependent, and when mbrtowc returns (size_t)(-2). we throw the result + away. */ + +int +mbtowc (wchar_t *pwc, const char *s, size_t n) +{ + if (s == NULL) + return 0; + else + { + mbstate_t state; + wchar_t wc; + size_t result; + + memset (&state, 0, sizeof (mbstate_t)); + result = mbrtowc (&wc, s, n, &state); + if (result == (size_t)-1 || result == (size_t)-2) + { + errno = EILSEQ; + return -1; + } + if (pwc != NULL) + *pwc = wc; + return (wc == 0 ? 0 : result); + } +} diff -Nru libdap-3.11.1/gl/mbtowc.c libdap-3.12.0/gl/mbtowc.c --- libdap-3.11.1/gl/mbtowc.c 1970-01-01 00:00:00.000000000 +0000 +++ libdap-3.12.0/gl/mbtowc.c 2013-10-17 21:27:40.000000000 +0000 @@ -0,0 +1,26 @@ +/* Convert multibyte character to wide character. + Copyright (C) 2011-2012 Free Software Foundation, Inc. + Written by Bruno Haible , 2011. + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU Lesser General Public License as published by + the Free Software Foundation; either version 3 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 Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public License + along with this program. If not, see . */ + +#include + +#include + +#include +#include +#include + +#include "mbtowc-impl.h" diff -Nru libdap-3.11.1/gl/nl_langinfo.c libdap-3.12.0/gl/nl_langinfo.c --- libdap-3.11.1/gl/nl_langinfo.c 2011-04-29 13:19:36.000000000 +0000 +++ libdap-3.12.0/gl/nl_langinfo.c 2013-10-17 21:27:40.000000000 +0000 @@ -1,6 +1,6 @@ /* nl_langinfo() replacement: query locale dependent information. - Copyright (C) 2007-2011 Free Software Foundation, Inc. + Copyright (C) 2007-2012 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by @@ -141,7 +141,8 @@ { static char buf[2 + 10 + 1]; - /* Woe32 has a function returning the locale's codepage as a number. */ + /* The Windows API has a function returning the locale's codepage as + a number. */ sprintf (buf, "CP%u", GetACP ()); return buf; } diff -Nru libdap-3.11.1/gl/ref-add.sin libdap-3.12.0/gl/ref-add.sin --- libdap-3.11.1/gl/ref-add.sin 2011-04-29 13:19:36.000000000 +0000 +++ libdap-3.12.0/gl/ref-add.sin 2013-10-17 21:27:40.000000000 +0000 @@ -1,6 +1,6 @@ # Add this package to a list of references stored in a text file. # -# Copyright (C) 2000, 2009-2011 Free Software Foundation, Inc. +# Copyright (C) 2000, 2009-2012 Free Software Foundation, Inc. # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU Lesser General Public License as published by @@ -13,8 +13,7 @@ # GNU Lesser General Public License for more details. # # You should have received a copy of the GNU Lesser General Public License along -# with this program; if not, write to the Free Software Foundation, -# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +# with this program; if not, see . # # Written by Bruno Haible . # diff -Nru libdap-3.11.1/gl/ref-del.sin libdap-3.12.0/gl/ref-del.sin --- libdap-3.11.1/gl/ref-del.sin 2011-04-29 13:19:36.000000000 +0000 +++ libdap-3.12.0/gl/ref-del.sin 2013-10-17 21:27:40.000000000 +0000 @@ -1,6 +1,6 @@ # Remove this package from a list of references stored in a text file. # -# Copyright (C) 2000, 2009-2011 Free Software Foundation, Inc. +# Copyright (C) 2000, 2009-2012 Free Software Foundation, Inc. # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU Lesser General Public License as published by @@ -13,8 +13,7 @@ # GNU Lesser General Public License for more details. # # You should have received a copy of the GNU Lesser General Public License along -# with this program; if not, write to the Free Software Foundation, -# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +# with this program; if not, see . # # Written by Bruno Haible . # diff -Nru libdap-3.11.1/gl/regcomp.c libdap-3.12.0/gl/regcomp.c --- libdap-3.11.1/gl/regcomp.c 2011-04-29 13:19:36.000000000 +0000 +++ libdap-3.12.0/gl/regcomp.c 2013-10-17 21:27:40.000000000 +0000 @@ -1,5 +1,5 @@ /* Extended regular expression matching and search library. - Copyright (C) 2002-2011 Free Software Foundation, Inc. + Copyright (C) 2002-2012 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Isamu Hasegawa . @@ -14,8 +14,7 @@ GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along - with this program; if not, write to the Free Software Foundation, - Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ + with this program; if not, see . */ static reg_errcode_t re_compile_internal (regex_t *preg, const char * pattern, size_t length, reg_syntax_t syntax); @@ -206,7 +205,7 @@ compiles PATTERN (of length LENGTH) and puts the result in BUFP. Returns 0 if the pattern was valid, otherwise an error string. - Assumes the `allocated' (and perhaps `buffer') and `translate' fields + Assumes the 'allocated' (and perhaps 'buffer') and 'translate' fields are set in BUFP on entry. */ #ifdef _LIBC @@ -241,7 +240,7 @@ weak_alias (__re_compile_pattern, re_compile_pattern) #endif -/* Set by `re_set_syntax' to the current regexp syntax to recognize. Can +/* Set by 're_set_syntax' to the current regexp syntax to recognize. Can also be assigned to arbitrarily: each pattern buffer stores its own syntax, so it can be changed between regex compilations. */ /* This has no initializer because initialized variables in Emacs @@ -273,7 +272,7 @@ re_compile_fastmap (bufp) struct re_pattern_buffer *bufp; { - re_dfa_t *dfa = (re_dfa_t *) bufp->buffer; + re_dfa_t *dfa = bufp->buffer; char *fastmap = bufp->fastmap; memset (fastmap, '\0', sizeof (char) * SBC_MAX); @@ -307,7 +306,7 @@ re_compile_fastmap_iter (regex_t *bufp, const re_dfastate_t *init_state, char *fastmap) { - re_dfa_t *dfa = (re_dfa_t *) bufp->buffer; + re_dfa_t *dfa = bufp->buffer; Idx node_cnt; bool icase = (dfa->mb_cur_max == 1 && (bufp->syntax & RE_ICASE)); for (node_cnt = 0; node_cnt < init_state->nodes.nelem; ++node_cnt) @@ -439,15 +438,15 @@ PREG is a regex_t *. We do not expect any fields to be initialized, since POSIX says we shouldn't. Thus, we set - `buffer' to the compiled pattern; - `used' to the length of the compiled pattern; - `syntax' to RE_SYNTAX_POSIX_EXTENDED if the + 'buffer' to the compiled pattern; + 'used' to the length of the compiled pattern; + 'syntax' to RE_SYNTAX_POSIX_EXTENDED if the REG_EXTENDED bit in CFLAGS is set; otherwise, to RE_SYNTAX_POSIX_BASIC; - `newline_anchor' to REG_NEWLINE being set in CFLAGS; - `fastmap' to an allocated space for the fastmap; - `fastmap_accurate' to zero; - `re_nsub' to the number of subexpressions in PATTERN. + 'newline_anchor' to REG_NEWLINE being set in CFLAGS; + 'fastmap' to an allocated space for the fastmap; + 'fastmap_accurate' to zero; + 're_nsub' to the number of subexpressions in PATTERN. PATTERN is the address of the pattern string. @@ -586,19 +585,23 @@ static const bitset_t utf8_sb_map = { /* Set the first 128 bits. */ -# if 4 * BITSET_WORD_BITS < ASCII_CHARS -# error "bitset_word_t is narrower than 32 bits" -# elif 3 * BITSET_WORD_BITS < ASCII_CHARS +# ifdef __GNUC__ + [0 ... 0x80 / BITSET_WORD_BITS - 1] = BITSET_WORD_MAX +# else +# if 4 * BITSET_WORD_BITS < ASCII_CHARS +# error "bitset_word_t is narrower than 32 bits" +# elif 3 * BITSET_WORD_BITS < ASCII_CHARS BITSET_WORD_MAX, BITSET_WORD_MAX, BITSET_WORD_MAX, -# elif 2 * BITSET_WORD_BITS < ASCII_CHARS +# elif 2 * BITSET_WORD_BITS < ASCII_CHARS BITSET_WORD_MAX, BITSET_WORD_MAX, -# elif 1 * BITSET_WORD_BITS < ASCII_CHARS +# elif 1 * BITSET_WORD_BITS < ASCII_CHARS BITSET_WORD_MAX, -# endif +# endif (BITSET_WORD_MAX >> (SBC_MAX % BITSET_WORD_BITS == 0 ? 0 : BITSET_WORD_BITS - SBC_MAX % BITSET_WORD_BITS)) +# endif }; #endif @@ -657,7 +660,7 @@ regfree (preg) regex_t *preg; { - re_dfa_t *dfa = (re_dfa_t *) preg->buffer; + re_dfa_t *dfa = preg->buffer; if (BE (dfa != NULL, 1)) free_dfa_content (dfa); preg->buffer = NULL; @@ -718,7 +721,7 @@ + __re_error_msgid_idx[(int) REG_ESPACE]); } - /* Since `re_exec' always passes NULL for the `regs' argument, we + /* Since 're_exec' always passes NULL for the 'regs' argument, we don't need to initialize the pattern buffer fields which affect it. */ /* Match anchors at newlines. */ @@ -729,7 +732,7 @@ if (!ret) return NULL; - /* Yes, we're discarding `const' here if !HAVE_LIBINTL. */ + /* Yes, we're discarding 'const' here if !HAVE_LIBINTL. */ return (char *) gettext (__re_error_msgid + __re_error_msgid_idx[(int) ret]); } @@ -764,7 +767,7 @@ preg->regs_allocated = REGS_UNALLOCATED; /* Initialize the dfa. */ - dfa = (re_dfa_t *) preg->buffer; + dfa = preg->buffer; if (BE (preg->allocated < sizeof (re_dfa_t), 0)) { /* If zero allocated, but buffer is non-null, try to realloc @@ -775,7 +778,7 @@ if (dfa == NULL) return REG_ESPACE; preg->allocated = sizeof (re_dfa_t); - preg->buffer = (unsigned char *) dfa; + preg->buffer = dfa; } preg->used = sizeof (re_dfa_t); @@ -850,7 +853,7 @@ { __re_size_t table_size; #ifndef _LIBC - char *codeset_name; + const char *codeset_name; #endif #ifdef RE_ENABLE_I18N size_t max_i18n_object_size = MAX (sizeof (wchar_t), sizeof (wctype_t)); @@ -873,7 +876,7 @@ calculation below, and for similar doubling calculations elsewhere. And it's <= rather than <, because some of the doubling calculations add 1 afterwards. */ - if (BE (SIZE_MAX / max_object_size / 2 <= pat_len, 0)) + if (BE (MIN (IDX_MAX, SIZE_MAX / max_object_size) / 2 <= pat_len, 0)) return REG_ESPACE; dfa->nodes_alloc = pat_len + 1; @@ -947,9 +950,43 @@ internal_function init_word_char (re_dfa_t *dfa) { - int i, j, ch; dfa->word_ops_used = 1; - for (i = 0, ch = 0; i < BITSET_WORDS; ++i) + int i = 0; + int j; + int ch = 0; + if (BE (dfa->map_notascii == 0, 1)) + { + bitset_word_t bits0 = 0x00000000; + bitset_word_t bits1 = 0x03ff0000; + bitset_word_t bits2 = 0x87fffffe; + bitset_word_t bits3 = 0x07fffffe; + if (BITSET_WORD_BITS == 64) + { + dfa->word_char[0] = bits1 << 31 << 1 | bits0; + dfa->word_char[1] = bits3 << 31 << 1 | bits2; + i = 2; + } + else if (BITSET_WORD_BITS == 32) + { + dfa->word_char[0] = bits0; + dfa->word_char[1] = bits1; + dfa->word_char[2] = bits2; + dfa->word_char[3] = bits3; + i = 4; + } + else + goto general_case; + ch = 128; + + if (BE (dfa->is_utf8, 1)) + { + memset (&dfa->word_char[i], '\0', (SBC_MAX - ch) / 8); + return; + } + } + + general_case: + for (; i < BITSET_WORDS; ++i) for (j = 0; j < BITSET_WORD_BITS; ++j, ++ch) if (isalnum (ch) || ch == '_') dfa->word_char[i] |= (bitset_word_t) 1 << j; @@ -960,7 +997,7 @@ static void free_workarea_compile (regex_t *preg) { - re_dfa_t *dfa = (re_dfa_t *) preg->buffer; + re_dfa_t *dfa = preg->buffer; bin_tree_storage_t *storage, *next; for (storage = dfa->str_tree_storage; storage; storage = next) { @@ -1144,7 +1181,7 @@ static reg_errcode_t analyze (regex_t *preg) { - re_dfa_t *dfa = (re_dfa_t *) preg->buffer; + re_dfa_t *dfa = preg->buffer; reg_errcode_t ret; /* Allocate arrays. */ @@ -1325,7 +1362,7 @@ static bin_tree_t * lower_subexp (reg_errcode_t *err, regex_t *preg, bin_tree_t *node) { - re_dfa_t *dfa = (re_dfa_t *) preg->buffer; + re_dfa_t *dfa = preg->buffer; bin_tree_t *body = node->left; bin_tree_t *op, *cls, *tree1, *tree; @@ -1659,7 +1696,7 @@ /* If we have already calculated, skip it. */ if (dfa->eclosures[node_idx].nelem != 0) continue; - /* Calculate epsilon closure of `node_idx'. */ + /* Calculate epsilon closure of 'node_idx'. */ err = calc_eclosure_iter (&eclosure_elem, dfa, node_idx, true); if (BE (err != REG_NOERROR, 0)) return err; @@ -1709,14 +1746,14 @@ { re_node_set eclosure_elem; Idx edest = dfa->edests[node].elems[i]; - /* If calculating the epsilon closure of `edest' is in progress, + /* If calculating the epsilon closure of 'edest' is in progress, return intermediate result. */ if (dfa->eclosures[edest].nelem == REG_MISSING) { incomplete = true; continue; } - /* If we haven't calculated the epsilon closure of `edest' yet, + /* If we haven't calculated the epsilon closure of 'edest' yet, calculate now. Otherwise use calculated epsilon closure. */ if (dfa->eclosures[edest].nelem == 0) { @@ -1726,11 +1763,11 @@ } else eclosure_elem = dfa->eclosures[edest]; - /* Merge the epsilon closure of `edest'. */ + /* Merge the epsilon closure of 'edest'. */ err = re_node_set_merge (&eclosure, &eclosure_elem); if (BE (err != REG_NOERROR, 0)) return err; - /* If the epsilon closure of `edest' is incomplete, + /* If the epsilon closure of 'edest' is incomplete, the epsilon closure of this node is also incomplete. */ if (dfa->eclosures[edest].nelem == 0) { @@ -2092,7 +2129,7 @@ /* Entry point of the parser. Parse the regular expression REGEXP and return the structure tree. - If an error is occured, ERR is set by error code, and return NULL. + If an error occurs, ERR is set by error code, and return NULL. This function build the following tree, from regular expression : CAT / \ @@ -2106,7 +2143,7 @@ parse (re_string_t *regexp, regex_t *preg, reg_syntax_t syntax, reg_errcode_t *err) { - re_dfa_t *dfa = (re_dfa_t *) preg->buffer; + re_dfa_t *dfa = preg->buffer; bin_tree_t *tree, *eor, *root; re_token_t current_token; dfa->syntax = syntax; @@ -2134,13 +2171,13 @@ / \ - ALT means alternative, which represents the operator `|'. */ + ALT means alternative, which represents the operator '|'. */ static bin_tree_t * parse_reg_exp (re_string_t *regexp, regex_t *preg, re_token_t *token, reg_syntax_t syntax, Idx nest, reg_errcode_t *err) { - re_dfa_t *dfa = (re_dfa_t *) preg->buffer; + re_dfa_t *dfa = preg->buffer; bin_tree_t *tree, *branch = NULL; tree = parse_branch (regexp, preg, token, syntax, nest, err); if (BE (*err != REG_NOERROR && tree == NULL, 0)) @@ -2182,7 +2219,7 @@ reg_syntax_t syntax, Idx nest, reg_errcode_t *err) { bin_tree_t *tree, *expr; - re_dfa_t *dfa = (re_dfa_t *) preg->buffer; + re_dfa_t *dfa = preg->buffer; tree = parse_expression (regexp, preg, token, syntax, nest, err); if (BE (*err != REG_NOERROR && tree == NULL, 0)) return NULL; @@ -2193,16 +2230,21 @@ expr = parse_expression (regexp, preg, token, syntax, nest, err); if (BE (*err != REG_NOERROR && expr == NULL, 0)) { + if (tree != NULL) + postorder (tree, free_tree, NULL); return NULL; } if (tree != NULL && expr != NULL) { - tree = create_tree (dfa, tree, expr, CONCAT); - if (tree == NULL) + bin_tree_t *newtree = create_tree (dfa, tree, expr, CONCAT); + if (newtree == NULL) { + postorder (expr, free_tree, NULL); + postorder (tree, free_tree, NULL); *err = REG_ESPACE; return NULL; } + tree = newtree; } else if (tree == NULL) tree = expr; @@ -2221,7 +2263,7 @@ parse_expression (re_string_t *regexp, regex_t *preg, re_token_t *token, reg_syntax_t syntax, Idx nest, reg_errcode_t *err) { - re_dfa_t *dfa = (re_dfa_t *) preg->buffer; + re_dfa_t *dfa = preg->buffer; bin_tree_t *tree; switch (token->type) { @@ -2437,7 +2479,7 @@ parse_sub_exp (re_string_t *regexp, regex_t *preg, re_token_t *token, reg_syntax_t syntax, Idx nest, reg_errcode_t *err) { - re_dfa_t *dfa = (re_dfa_t *) preg->buffer; + re_dfa_t *dfa = preg->buffer; bin_tree_t *tree; size_t cur_nsub; cur_nsub = preg->re_nsub++; @@ -2451,7 +2493,11 @@ { tree = parse_reg_exp (regexp, preg, token, syntax, nest, err); if (BE (*err == REG_NOERROR && token->type != OP_CLOSE_SUBEXP, 0)) - *err = REG_EPAREN; + { + if (tree != NULL) + postorder (tree, free_tree, NULL); + *err = REG_EPAREN; + } if (BE (*err != REG_NOERROR, 0)) return NULL; } @@ -2529,6 +2575,12 @@ *err = REG_BADBR; return NULL; } + + if (BE (RE_DUP_MAX < (end == REG_MISSING ? start : end), 0)) + { + *err = REG_ESIZE; + return NULL; + } } else { @@ -2569,7 +2621,10 @@ old_tree = NULL; if (elem->token.type == SUBEXP) - postorder (elem, mark_opt_subexp, (void *) (long) elem->token.opr.idx); + { + uintptr_t subidx = elem->token.opr.idx; + postorder (elem, mark_opt_subexp, (void *) subidx); + } tree = create_tree (dfa, elem, NULL, (end == REG_MISSING ? OP_DUP_ASTERISK : OP_ALT)); @@ -2615,7 +2670,7 @@ Build the range expression which starts from START_ELEM, and ends at END_ELEM. The result are written to MBCSET and SBCSET. RANGE_ALLOC is the allocated size of mbcset->range_starts, and - mbcset->range_ends, is a pointer argument sinse we may + mbcset->range_ends, is a pointer argument since we may update it. */ static reg_errcode_t @@ -2749,11 +2804,12 @@ static reg_errcode_t internal_function -build_collating_symbol (bitset_t sbcset, # ifdef RE_ENABLE_I18N - re_charset_t *mbcset, Idx *coll_sym_alloc, -# endif - const unsigned char *name) +build_collating_symbol (bitset_t sbcset, re_charset_t *mbcset, + Idx *coll_sym_alloc, const unsigned char *name) +# else /* not RE_ENABLE_I18N */ +build_collating_symbol (bitset_t sbcset, const unsigned char *name) +# endif /* not RE_ENABLE_I18N */ { size_t name_len = strlen ((const char *) name); if (BE (name_len != 1, 0)) @@ -2781,8 +2837,8 @@ const int32_t *symb_table; const unsigned char *extra; - /* Local function for parse_bracket_exp used in _LIBC environement. - Seek the collating symbol entry correspondings to NAME. + /* Local function for parse_bracket_exp used in _LIBC environment. + Seek the collating symbol entry corresponding to NAME. Return the index of the symbol in the SYMB_TABLE. */ auto inline int32_t @@ -2885,11 +2941,11 @@ return UINT_MAX; } - /* Local function for parse_bracket_exp used in _LIBC environement. + /* Local function for parse_bracket_exp used in _LIBC environment. Build the range expression which starts from START_ELEM, and ends at END_ELEM. The result are written to MBCSET and SBCSET. RANGE_ALLOC is the allocated size of mbcset->range_starts, and - mbcset->range_ends, is a pointer argument sinse we may + mbcset->range_ends, is a pointer argument since we may update it. */ auto inline reg_errcode_t @@ -2969,11 +3025,11 @@ return REG_NOERROR; } - /* Local function for parse_bracket_exp used in _LIBC environement. + /* Local function for parse_bracket_exp used in _LIBC environment. Build the collating element which is represented by NAME. The result are written to MBCSET and SBCSET. COLL_SYM_ALLOC is the allocated size of mbcset->coll_sym, is a - pointer argument sinse we may update it. */ + pointer argument since we may update it. */ auto inline reg_errcode_t __attribute ((always_inline)) @@ -3075,6 +3131,10 @@ if (BE (sbcset == NULL, 0)) #endif /* RE_ENABLE_I18N */ { + re_free (sbcset); +#ifdef RE_ENABLE_I18N + re_free (mbcset); +#endif *err = REG_ESPACE; return NULL; } @@ -3413,7 +3473,7 @@ Build the equivalence class which is represented by NAME. The result are written to MBCSET and SBCSET. EQUIV_CLASS_ALLOC is the allocated size of mbcset->equiv_classes, - is a pointer argument sinse we may update it. */ + is a pointer argument since we may update it. */ static reg_errcode_t #ifdef RE_ENABLE_I18N @@ -3444,19 +3504,18 @@ _NL_COLLATE_EXTRAMB); indirect = (const int32_t *) _NL_CURRENT (LC_COLLATE, _NL_COLLATE_INDIRECTMB); - idx1 = findidx (&cp); - if (BE (idx1 == 0 || cp < name + strlen ((const char *) name), 0)) + idx1 = findidx (&cp, -1); + if (BE (idx1 == 0 || *cp != '\0', 0)) /* This isn't a valid character. */ return REG_ECOLLATE; - /* Build single byte matcing table for this equivalence class. */ - char_buf[1] = (unsigned char) '\0'; + /* Build single byte matching table for this equivalence class. */ len = weights[idx1 & 0xffffff]; for (ch = 0; ch < SBC_MAX; ++ch) { char_buf[0] = ch; cp = char_buf; - idx2 = findidx (&cp); + idx2 = findidx (&cp, 1); /* idx2 = table[ch]; */ @@ -3509,7 +3568,7 @@ Build the character class which is represented by NAME. The result are written to MBCSET and SBCSET. CHAR_CLASS_ALLOC is the allocated size of mbcset->char_classes, - is a pointer argument sinse we may update it. */ + is a pointer argument since we may update it. */ static reg_errcode_t #ifdef RE_ENABLE_I18N @@ -3703,8 +3762,9 @@ } /* This is intended for the expressions like "a{1,3}". - Fetch a number from `input', and return the number. + Fetch a number from 'input', and return the number. Return REG_MISSING if the number field is empty like "{,1}". + Return RE_DUP_MAX + 1 if the number field is too large. Return REG_ERROR if an error occurred. */ static Idx @@ -3723,8 +3783,9 @@ num = ((token->type != CHARACTER || c < '0' || '9' < c || num == REG_ERROR) ? REG_ERROR - : ((num == REG_MISSING) ? c - '0' : num * 10 + c - '0')); - num = (num > RE_DUP_MAX) ? REG_ERROR : num; + : num == REG_MISSING + ? c - '0' + : MIN (RE_DUP_MAX + 1, num * 10 + c - '0')); } return num; } @@ -3798,7 +3859,7 @@ static reg_errcode_t mark_opt_subexp (void *extra, bin_tree_t *node) { - Idx idx = (Idx) (long) extra; + Idx idx = (uintptr_t) extra; if (node->token.type == SUBEXP && node->token.opr.idx == idx) node->token.opt_subexp = 1; diff -Nru libdap-3.11.1/gl/regex.c libdap-3.12.0/gl/regex.c --- libdap-3.11.1/gl/regex.c 2011-04-29 13:19:36.000000000 +0000 +++ libdap-3.12.0/gl/regex.c 2013-10-17 21:27:40.000000000 +0000 @@ -1,5 +1,5 @@ /* Extended regular expression matching and search library. - Copyright (C) 2002-2003, 2005-2006, 2009-2011 Free Software Foundation, Inc. + Copyright (C) 2002-2003, 2005-2006, 2009-2012 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Isamu Hasegawa . @@ -14,12 +14,20 @@ GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along - with this program; if not, write to the Free Software Foundation, - Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ + with this program; if not, see . */ -#include +#ifndef _LIBC +# include -/* Make sure noone compiles this code with a C++ compiler. */ +# if (__GNUC__ == 4 && 6 <= __GNUC_MINOR__) || 4 < __GNUC__ +# pragma GCC diagnostic ignored "-Wsuggest-attribute=pure" +# endif +# if (__GNUC__ == 4 && 3 <= __GNUC_MINOR__) || 4 < __GNUC__ +# pragma GCC diagnostic ignored "-Wtype-limits" +# endif +#endif + +/* Make sure no one compiles this code with a C++ compiler. */ #if defined __cplusplus && defined _LIBC # error "This is C code, use a C compiler" #endif diff -Nru libdap-3.11.1/gl/regex.h libdap-3.12.0/gl/regex.h --- libdap-3.11.1/gl/regex.h 2011-04-29 13:19:36.000000000 +0000 +++ libdap-3.12.0/gl/regex.h 2013-10-17 21:27:40.000000000 +0000 @@ -1,6 +1,6 @@ /* Definitions for data structures and routines for the regular expression library. - Copyright (C) 1985, 1989-1993, 1995-1998, 2000-2003, 2005-2006, 2009-2011 + Copyright (C) 1985, 1989-1993, 1995-1998, 2000-2003, 2005-2012 Free Software Foundation, Inc. This file is part of the GNU C Library. @@ -15,8 +15,7 @@ GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along - with this program; if not, write to the Free Software Foundation, - Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ + with this program; if not, see . */ #ifndef _REGEX_H #define _REGEX_H 1 @@ -28,13 +27,10 @@ extern "C" { #endif -/* Define __USE_GNU_REGEX to declare GNU extensions that violate the +/* Define __USE_GNU to declare GNU extensions that violate the POSIX name space rules. */ -#undef __USE_GNU_REGEX -#if (defined _GNU_SOURCE \ - || (!defined _POSIX_C_SOURCE && !defined _POSIX_SOURCE \ - && !defined _XOPEN_SOURCE)) -# define __USE_GNU_REGEX 1 +#ifdef _GNU_SOURCE +# define __USE_GNU 1 #endif #ifdef _REGEX_LARGE_OFFSETS @@ -45,16 +41,6 @@ supported within glibc itself, and glibc users should not define _REGEX_LARGE_OFFSETS. */ -/* The type of the offset of a byte within a string. - For historical reasons POSIX 1003.1-2004 requires that regoff_t be - at least as wide as off_t. However, many common POSIX platforms set - regoff_t to the more-sensible ssize_t and the Open Group has - signalled its intention to change the requirement to be that - regoff_t be at least as wide as ptrdiff_t and ssize_t; see XBD ERN - 60 (2005-08-25). We don't know of any hosts where ssize_t or - ptrdiff_t is wider than ssize_t, so ssize_t is safe. */ -typedef ssize_t regoff_t; - /* The type of nonnegative object indexes. Traditionally, GNU regex uses 'int' for these. Code that uses __re_idx_t should work regardless of whether the type is signed. */ @@ -69,10 +55,8 @@ #else -/* Use types that are binary-compatible with the traditional GNU regex - implementation, which mishandles strings longer than INT_MAX. */ - -typedef int regoff_t; +/* The traditional GNU regex implementation mishandles strings longer + than INT_MAX. */ typedef int __re_idx_t; typedef unsigned int __re_size_t; typedef unsigned long int __re_long_size_t; @@ -93,8 +77,7 @@ add or remove a bit, only one other definition need change. */ typedef unsigned long int reg_syntax_t; -#ifdef __USE_GNU_REGEX - +#ifdef __USE_GNU /* If this bit is not set, then \ inside a bracket expression is literal. If set, then such a \ quotes the following character. */ # define RE_BACKSLASH_ESCAPE_IN_LISTS ((unsigned long int) 1) @@ -161,9 +144,9 @@ If not set, newline is literal. */ # define RE_NEWLINE_ALT (RE_LIMITED_OPS << 1) -/* If this bit is set, then `{...}' defines an interval, and \{ and \} +/* If this bit is set, then '{...}' defines an interval, and \{ and \} are literals. - If not set, then `\{...\}' defines an interval. */ + If not set, then '\{...\}' defines an interval. */ # define RE_NO_BK_BRACES (RE_NEWLINE_ALT << 1) /* If this bit is set, (...) defines a group, and \( and \) are literals. @@ -225,8 +208,7 @@ /* If this bit is set, then no_sub will be set to 1 during re_compile_pattern. */ # define RE_NO_SUB (RE_CONTEXT_INVALID_DUP << 1) - -#endif /* defined __USE_GNU_REGEX */ +#endif /* This global variable defines the particular regexp syntax to use (for some interfaces). When a regexp is compiled, the syntax used is @@ -234,7 +216,7 @@ already-compiled regexps. */ extern reg_syntax_t re_syntax_options; -#ifdef __USE_GNU_REGEX +#ifdef __USE_GNU /* Define combinations of the above bits for the standard possibilities. (The [[[ comments delimit what gets put into the Texinfo file, so don't delete them!) */ @@ -246,16 +228,19 @@ | RE_NO_BK_PARENS | RE_NO_BK_REFS \ | RE_NO_BK_VBAR | RE_NO_EMPTY_RANGES \ | RE_DOT_NEWLINE | RE_CONTEXT_INDEP_ANCHORS \ + | RE_CHAR_CLASSES \ | RE_UNMATCHED_RIGHT_PAREN_ORD | RE_NO_GNU_OPS) # define RE_SYNTAX_GNU_AWK \ - ((RE_SYNTAX_POSIX_EXTENDED | RE_BACKSLASH_ESCAPE_IN_LISTS | RE_DEBUG) \ - & ~(RE_DOT_NOT_NULL | RE_INTERVALS | RE_CONTEXT_INDEP_OPS \ - | RE_CONTEXT_INVALID_OPS )) + ((RE_SYNTAX_POSIX_EXTENDED | RE_BACKSLASH_ESCAPE_IN_LISTS \ + | RE_INVALID_INTERVAL_ORD) \ + & ~(RE_DOT_NOT_NULL | RE_CONTEXT_INDEP_OPS \ + | RE_CONTEXT_INVALID_OPS )) # define RE_SYNTAX_POSIX_AWK \ (RE_SYNTAX_POSIX_EXTENDED | RE_BACKSLASH_ESCAPE_IN_LISTS \ - | RE_INTERVALS | RE_NO_GNU_OPS) + | RE_INTERVALS | RE_NO_GNU_OPS \ + | RE_INVALID_INTERVAL_ORD) # define RE_SYNTAX_GREP \ (RE_BK_PLUS_QM | RE_CHAR_CLASSES \ @@ -306,13 +291,12 @@ | RE_NO_BK_VBAR | RE_UNMATCHED_RIGHT_PAREN_ORD) /* [[[end syntaxes]]] */ -#endif /* defined __USE_GNU_REGEX */ - -#ifdef __USE_GNU_REGEX - /* Maximum number of duplicates an interval can allow. POSIX-conforming systems might define this in , but we want our value, so remove any previous define. */ +# ifdef _REGEX_INCLUDE_LIMITS_H +# include +# endif # ifdef RE_DUP_MAX # undef RE_DUP_MAX # endif @@ -320,16 +304,15 @@ /* RE_DUP_MAX is 2**15 - 1 because an earlier implementation stored the counter as a 2-byte signed integer. This is no longer true, so RE_DUP_MAX could be increased to (INT_MAX / 10 - 1), or to - ((SIZE_MAX - 2) / 10 - 1) if _REGEX_LARGE_OFFSETS is defined. + ((SIZE_MAX - 9) / 10) if _REGEX_LARGE_OFFSETS is defined. However, there would be a huge performance problem if someone actually used a pattern like a\{214748363\}, so RE_DUP_MAX retains its historical value. */ # define RE_DUP_MAX (0x7fff) - -#endif /* defined __USE_GNU_REGEX */ +#endif -/* POSIX `cflags' bits (i.e., information for `regcomp'). */ +/* POSIX 'cflags' bits (i.e., information for 'regcomp'). */ /* If this bit is set, then use extended regular expression syntax. If not set, then use basic regular expression syntax. */ @@ -349,7 +332,7 @@ #define REG_NOSUB (1 << 3) -/* POSIX `eflags' bits (i.e., information for regexec). */ +/* POSIX 'eflags' bits (i.e., information for regexec). */ /* If this bit is set, then the beginning-of-line operator doesn't match the beginning of the string (presumably because it's not the @@ -367,7 +350,7 @@ /* If any error codes are removed, changed, or added, update the - `__re_error_msgid' table in regcomp.c. */ + '__re_error_msgid' table in regcomp.c. */ typedef enum { @@ -392,11 +375,11 @@ /* Error codes we've added. */ _REG_EEND, /* Premature end. */ - _REG_ESIZE, /* Compiled pattern bigger than 2^16 bytes. */ + _REG_ESIZE, /* Too large (e.g., repeat count too large). */ _REG_ERPAREN /* Unmatched ) or \); not returned from regcomp. */ } reg_errcode_t; -#ifdef _XOPEN_SOURCE +#if defined _XOPEN_SOURCE || defined __USE_XOPEN2K # define REG_ENOSYS _REG_ENOSYS #endif #define REG_NOERROR _REG_NOERROR @@ -417,126 +400,127 @@ #define REG_ESIZE _REG_ESIZE #define REG_ERPAREN _REG_ERPAREN -/* struct re_pattern_buffer normally uses member names like `buffer' - that POSIX does not allow. In POSIX mode these members have names - with leading `re_' (e.g., `re_buffer'). */ -#ifdef __USE_GNU_REGEX -# define _REG_RE_NAME(id) id -# define _REG_RM_NAME(id) id -#else -# define _REG_RE_NAME(id) re_##id -# define _REG_RM_NAME(id) rm_##id +/* This data structure represents a compiled pattern. Before calling + the pattern compiler, the fields 'buffer', 'allocated', 'fastmap', + and 'translate' can be set. After the pattern has been compiled, + the fields 're_nsub', 'not_bol' and 'not_eol' are available. All + other fields are private to the regex routines. */ + +#ifndef RE_TRANSLATE_TYPE +# define __RE_TRANSLATE_TYPE unsigned char * +# ifdef __USE_GNU +# define RE_TRANSLATE_TYPE __RE_TRANSLATE_TYPE +# endif #endif -/* The user can specify the type of the re_translate member by - defining the macro RE_TRANSLATE_TYPE, which defaults to unsigned - char *. This pollutes the POSIX name space, so in POSIX mode just - use unsigned char *. */ -#ifdef __USE_GNU_REGEX -# ifndef RE_TRANSLATE_TYPE -# define RE_TRANSLATE_TYPE unsigned char * -# endif -# define REG_TRANSLATE_TYPE RE_TRANSLATE_TYPE +#ifdef __USE_GNU +# define __REPB_PREFIX(name) name #else -# define REG_TRANSLATE_TYPE unsigned char * +# define __REPB_PREFIX(name) __##name #endif -/* This data structure represents a compiled pattern. Before calling - the pattern compiler, the fields `buffer', `allocated', `fastmap', - `translate', and `no_sub' can be set. After the pattern has been - compiled, the `re_nsub' field is available. All other fields are - private to the regex routines. */ - struct re_pattern_buffer { - /* Space that holds the compiled pattern. It is declared as - `unsigned char *' because its elements are sometimes used as - array indexes. */ - unsigned char *_REG_RE_NAME (buffer); + /* Space that holds the compiled pattern. The type + 'struct re_dfa_t' is private and is not declared here. */ + struct re_dfa_t *__REPB_PREFIX(buffer); - /* Number of bytes to which `buffer' points. */ - __re_long_size_t _REG_RE_NAME (allocated); + /* Number of bytes to which 'buffer' points. */ + __re_long_size_t __REPB_PREFIX(allocated); - /* Number of bytes actually used in `buffer'. */ - __re_long_size_t _REG_RE_NAME (used); + /* Number of bytes actually used in 'buffer'. */ + __re_long_size_t __REPB_PREFIX(used); /* Syntax setting with which the pattern was compiled. */ - reg_syntax_t _REG_RE_NAME (syntax); + reg_syntax_t __REPB_PREFIX(syntax); /* Pointer to a fastmap, if any, otherwise zero. re_search uses the fastmap, if there is one, to skip over impossible starting points for matches. */ - char *_REG_RE_NAME (fastmap); + char *__REPB_PREFIX(fastmap); /* Either a translate table to apply to all characters before comparing them, or zero for no translation. The translation is applied to a pattern when it is compiled and to a string when it is matched. */ - REG_TRANSLATE_TYPE _REG_RE_NAME (translate); + __RE_TRANSLATE_TYPE __REPB_PREFIX(translate); /* Number of subexpressions found by the compiler. */ size_t re_nsub; /* Zero if this pattern cannot match the empty string, one else. - Well, in truth it's used only in `re_search_2', to see whether or + Well, in truth it's used only in 're_search_2', to see whether or not we should use the fastmap, so we don't set this absolutely - perfectly; see `re_compile_fastmap' (the `duplicate' case). */ - unsigned int _REG_RE_NAME (can_be_null) : 1; + perfectly; see 're_compile_fastmap' (the "duplicate" case). */ + unsigned __REPB_PREFIX(can_be_null) : 1; - /* If REGS_UNALLOCATED, allocate space in the `regs' structure - for `max (RE_NREGS, re_nsub + 1)' groups. + /* If REGS_UNALLOCATED, allocate space in the 'regs' structure + for 'max (RE_NREGS, re_nsub + 1)' groups. If REGS_REALLOCATE, reallocate space if necessary. If REGS_FIXED, use what's there. */ -#ifdef __USE_GNU_REGEX +#ifdef __USE_GNU # define REGS_UNALLOCATED 0 # define REGS_REALLOCATE 1 # define REGS_FIXED 2 #endif - unsigned int _REG_RE_NAME (regs_allocated) : 2; + unsigned __REPB_PREFIX(regs_allocated) : 2; - /* Set to zero when `re_compile_pattern' compiles a pattern; set to - one by `re_compile_fastmap' if it updates the fastmap. */ - unsigned int _REG_RE_NAME (fastmap_accurate) : 1; + /* Set to zero when 're_compile_pattern' compiles a pattern; set to + one by 're_compile_fastmap' if it updates the fastmap. */ + unsigned __REPB_PREFIX(fastmap_accurate) : 1; - /* If set, `re_match_2' does not return information about + /* If set, 're_match_2' does not return information about subexpressions. */ - unsigned int _REG_RE_NAME (no_sub) : 1; + unsigned __REPB_PREFIX(no_sub) : 1; /* If set, a beginning-of-line anchor doesn't match at the beginning of the string. */ - unsigned int _REG_RE_NAME (not_bol) : 1; + unsigned __REPB_PREFIX(not_bol) : 1; /* Similarly for an end-of-line anchor. */ - unsigned int _REG_RE_NAME (not_eol) : 1; + unsigned __REPB_PREFIX(not_eol) : 1; /* If true, an anchor at a newline matches. */ - unsigned int _REG_RE_NAME (newline_anchor) : 1; - -/* [[[end pattern_buffer]]] */ + unsigned __REPB_PREFIX(newline_anchor) : 1; }; typedef struct re_pattern_buffer regex_t; +/* Type for byte offsets within the string. POSIX mandates this. */ +#ifdef _REGEX_LARGE_OFFSETS +/* POSIX 1003.1-2008 requires that regoff_t be at least as wide as + ptrdiff_t and ssize_t. We don't know of any hosts where ptrdiff_t + is wider than ssize_t, so ssize_t is safe. */ +typedef ssize_t regoff_t; +#else +/* The traditional GNU regex implementation mishandles strings longer + than INT_MAX. */ +typedef int regoff_t; +#endif + + +#ifdef __USE_GNU /* This is the structure we store register match data in. See regex.texinfo for a full description of what registers match. */ struct re_registers { - __re_size_t _REG_RM_NAME (num_regs); - regoff_t *_REG_RM_NAME (start); - regoff_t *_REG_RM_NAME (end); + __re_size_t num_regs; + regoff_t *start; + regoff_t *end; }; -/* If `regs_allocated' is REGS_UNALLOCATED in the pattern buffer, - `re_match_2' returns information about at least this many registers - the first time a `regs' structure is passed. */ -#if !defined RE_NREGS && defined __USE_GNU_REGEX -# define RE_NREGS 30 +/* If 'regs_allocated' is REGS_UNALLOCATED in the pattern buffer, + 're_match_2' returns information about at least this many registers + the first time a 'regs' structure is passed. */ +# ifndef RE_NREGS +# define RE_NREGS 30 +# endif #endif /* POSIX specification for registers. Aside from the different names than - `re_registers', POSIX uses an array of structures, instead of a + 're_registers', POSIX uses an array of structures, instead of a structure of arrays. */ typedef struct { @@ -546,13 +530,19 @@ /* Declarations for routines. */ +#ifdef __USE_GNU /* Sets the current default syntax to SYNTAX, and return the old syntax. - You can also simply assign to the `re_syntax_options' variable. */ + You can also simply assign to the 're_syntax_options' variable. */ extern reg_syntax_t re_set_syntax (reg_syntax_t __syntax); /* Compile the regular expression PATTERN, with length LENGTH - and syntax given by the global `re_syntax_options', into the buffer - BUFFER. Return NULL if successful, and an error string if not. */ + and syntax given by the global 're_syntax_options', into the buffer + BUFFER. Return NULL if successful, and an error string if not. + + To free the allocated storage, you must call 'regfree' on BUFFER. + Note that the translate table must either have been initialised by + 'regcomp', with a malloc'ed value, or set to NULL before calling + 'regfree'. */ extern const char *re_compile_pattern (const char *__pattern, size_t __length, struct re_pattern_buffer *__buffer); @@ -574,7 +564,7 @@ struct re_registers *__regs); -/* Like `re_search', but search in the concatenation of STRING1 and +/* Like 're_search', but search in the concatenation of STRING1 and STRING2. Also, stop searching at index START + STOP. */ extern regoff_t re_search_2 (struct re_pattern_buffer *__buffer, const char *__string1, __re_idx_t __length1, @@ -584,14 +574,14 @@ __re_idx_t __stop); -/* Like `re_search', but return how many characters in STRING the regexp +/* Like 're_search', but return how many characters in STRING the regexp in BUFFER matched, starting at position START. */ extern regoff_t re_match (struct re_pattern_buffer *__buffer, const char *__string, __re_idx_t __length, __re_idx_t __start, struct re_registers *__regs); -/* Relates to `re_match' as `re_search_2' relates to `re_search'. */ +/* Relates to 're_match' as 're_search_2' relates to 're_search'. */ extern regoff_t re_match_2 (struct re_pattern_buffer *__buffer, const char *__string1, __re_idx_t __length1, const char *__string2, __re_idx_t __length2, @@ -602,21 +592,22 @@ /* Set REGS to hold NUM_REGS registers, storing them in STARTS and ENDS. Subsequent matches using BUFFER and REGS will use this memory for recording register information. STARTS and ENDS must be - allocated with malloc, and must each be at least `NUM_REGS * sizeof + allocated with malloc, and must each be at least 'NUM_REGS * sizeof (regoff_t)' bytes long. If NUM_REGS == 0, then subsequent matches should allocate their own register data. Unless this function is called, the first search or match using - BUFFER will allocate its own register data, without freeing the old - data. */ + BUFFER will allocate its own register data, without + freeing the old data. */ extern void re_set_registers (struct re_pattern_buffer *__buffer, struct re_registers *__regs, __re_size_t __num_regs, regoff_t *__starts, regoff_t *__ends); +#endif /* Use GNU */ -#if defined _REGEX_RE_COMP || defined _LIBC +#if defined _REGEX_RE_COMP || (defined _LIBC && defined __USE_BSD) # ifndef _CRAY /* 4.2 bsd compatibility. */ extern char *re_comp (const char *); @@ -644,7 +635,7 @@ #ifndef _Restrict_arr_ # if ((199901L <= __STDC_VERSION__ \ || ((3 < __GNUC__ || (3 == __GNUC__ && 1 <= __GNUC_MINOR__)) \ - && !__STRICT_ANSI__)) \ + && !defined __STRICT_ANSI__)) \ && !defined __GNUG__) # define _Restrict_arr_ _Restrict_ # else diff -Nru libdap-3.11.1/gl/regex_internal.c libdap-3.12.0/gl/regex_internal.c --- libdap-3.11.1/gl/regex_internal.c 2011-04-29 13:19:36.000000000 +0000 +++ libdap-3.12.0/gl/regex_internal.c 2013-10-17 21:27:40.000000000 +0000 @@ -1,5 +1,5 @@ /* Extended regular expression matching and search library. - Copyright (C) 2002-2011 Free Software Foundation, Inc. + Copyright (C) 2002-2012 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Isamu Hasegawa . @@ -14,8 +14,7 @@ GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along - with this program; if not, write to the Free Software Foundation, - Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ + with this program; if not, see . */ static void re_string_construct_common (const char *str, Idx len, re_string_t *pstr, @@ -134,9 +133,9 @@ { wint_t *new_wcs; - /* Avoid overflow. */ - size_t max_object_size = MAX (sizeof (wint_t), sizeof (Idx)); - if (BE (SIZE_MAX / max_object_size < new_buf_len, 0)) + /* Avoid overflow in realloc. */ + const size_t max_object_size = MAX (sizeof (wint_t), sizeof (Idx)); + if (BE (MIN (IDX_MAX, SIZE_MAX / max_object_size) < new_buf_len, 0)) return REG_ESPACE; new_wcs = re_realloc (pstr->wcs, wint_t, new_buf_len); @@ -236,13 +235,8 @@ else p = (const char *) pstr->raw_mbs + pstr->raw_mbs_idx + byte_idx; mbclen = __mbrtowc (&wc, p, remain_len, &pstr->cur_state); - if (BE (mbclen == (size_t) -2, 0)) - { - /* The buffer doesn't have enough space, finish to build. */ - pstr->cur_state = prev_st; - break; - } - else if (BE (mbclen == (size_t) -1 || mbclen == 0, 0)) + if (BE (mbclen == (size_t) -1 || mbclen == 0 + || (mbclen == (size_t) -2 && pstr->bufs_len >= pstr->len), 0)) { /* We treat these cases as a singlebyte character. */ mbclen = 1; @@ -251,6 +245,12 @@ wc = pstr->trans[wc]; pstr->cur_state = prev_st; } + else if (BE (mbclen == (size_t) -2, 0)) + { + /* The buffer doesn't have enough space, finish to build. */ + pstr->cur_state = prev_st; + break; + } /* Write wide character and padding. */ pstr->wcs[byte_idx++] = wc; @@ -333,9 +333,11 @@ for (remain_len = byte_idx + mbclen - 1; byte_idx < remain_len ;) pstr->wcs[byte_idx++] = WEOF; } - else if (mbclen == (size_t) -1 || mbclen == 0) + else if (mbclen == (size_t) -1 || mbclen == 0 + || (mbclen == (size_t) -2 && pstr->bufs_len >= pstr->len)) { - /* It is an invalid character or '\0'. Just use the byte. */ + /* It is an invalid character, an incomplete character + at the end of the string, or '\0'. Just use the byte. */ int ch = pstr->raw_mbs[pstr->raw_mbs_idx + byte_idx]; pstr->mbs[byte_idx] = ch; /* And also cast it to wide char. */ @@ -448,7 +450,8 @@ for (remain_len = byte_idx + mbclen - 1; byte_idx < remain_len ;) pstr->wcs[byte_idx++] = WEOF; } - else if (mbclen == (size_t) -1 || mbclen == 0) + else if (mbclen == (size_t) -1 || mbclen == 0 + || (mbclen == (size_t) -2 && pstr->bufs_len >= pstr->len)) { /* It is an invalid character or '\0'. Just use the byte. */ int ch = pstr->raw_mbs[pstr->raw_mbs_idx + src_idx]; @@ -495,8 +498,7 @@ rawbuf_idx < new_raw_idx;) { wchar_t wc2; - Idx remain_len; - remain_len = pstr->len - rawbuf_idx; + Idx remain_len = pstr->raw_len - rawbuf_idx; prev_st = pstr->cur_state; mbclen = __mbrtowc (&wc2, (const char *) pstr->raw_mbs + rawbuf_idx, remain_len, &pstr->cur_state); @@ -732,21 +734,21 @@ mbstate_t cur_state; wchar_t wc2; Idx mlen = raw + pstr->len - p; + unsigned char buf[6]; size_t mbclen; -#if 0 /* dead code: buf is set but never used */ - unsigned char buf[6]; + const unsigned char *pp = p; if (BE (pstr->trans != NULL, 0)) { int i = mlen < 6 ? mlen : 6; while (--i >= 0) buf[i] = pstr->trans[p[i]]; + pp = buf; } -#endif /* XXX Don't use mbrtowc, we know which conversion to use (UTF-8 -> UCS4). */ memset (&cur_state, 0, sizeof (cur_state)); - mbclen = __mbrtowc (&wc2, (const char *) p, mlen, + mbclen = __mbrtowc (&wc2, (const char *) pp, mlen, &cur_state); if (raw + offset - p <= mbclen && mbclen < (size_t) -2) @@ -868,7 +870,7 @@ } static unsigned char -internal_function __attribute ((pure)) +internal_function re_string_fetch_byte_case (re_string_t *pstr) { if (BE (!pstr->mbs_allocated, 1)) @@ -1412,13 +1414,12 @@ Idx *new_nexts, *new_indices; re_node_set *new_edests, *new_eclosures; re_token_t *new_nodes; - size_t max_object_size = - MAX (sizeof (re_token_t), - MAX (sizeof (re_node_set), - sizeof (Idx))); - /* Avoid overflows. */ - if (BE (SIZE_MAX / 2 / max_object_size < dfa->nodes_alloc, 0)) + /* Avoid overflows in realloc. */ + const size_t max_object_size = MAX (sizeof (re_token_t), + MAX (sizeof (re_node_set), + sizeof (Idx))); + if (BE (MIN (IDX_MAX, SIZE_MAX / max_object_size) < new_nodes_alloc, 0)) return REG_MISSING; new_nodes = re_realloc (dfa->nodes, re_token_t, new_nodes_alloc); @@ -1550,7 +1551,7 @@ && re_node_set_compare (state->entrance_nodes, nodes)) return state; } - /* There are no appropriate state in `dfa', create the new one. */ + /* There are no appropriate state in 'dfa', create the new one. */ new_state = create_cd_newstate (dfa, nodes, context, hash); if (BE (new_state == NULL, 0)) *err = REG_ESPACE; @@ -1579,7 +1580,7 @@ { Idx elem = newstate->nodes.elems[i]; if (!IS_EPSILON_NODE (dfa->nodes[elem].type)) - if (BE (! re_node_set_insert_last (&newstate->non_eps_nodes, elem), 0)) + if (! re_node_set_insert_last (&newstate->non_eps_nodes, elem)) return REG_ESPACE; } @@ -1614,7 +1615,7 @@ re_free (state); } -/* Create the new state which is independ of contexts. +/* Create the new state which is independent of contexts. Return the new state if succeeded, otherwise return NULL. */ static re_dfastate_t * diff -Nru libdap-3.11.1/gl/regex_internal.h libdap-3.12.0/gl/regex_internal.h --- libdap-3.11.1/gl/regex_internal.h 2011-04-29 13:19:36.000000000 +0000 +++ libdap-3.12.0/gl/regex_internal.h 2013-10-17 21:27:40.000000000 +0000 @@ -1,5 +1,5 @@ /* Extended regular expression matching and search library. - Copyright (C) 2002-2011 Free Software Foundation, Inc. + Copyright (C) 2002-2012 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Isamu Hasegawa . @@ -14,15 +14,13 @@ GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along - with this program; if not, write to the Free Software Foundation, - Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ + with this program; if not, see . */ #ifndef _REGEX_INTERNAL_H #define _REGEX_INTERNAL_H 1 #include #include -#include #include #include #include @@ -32,13 +30,14 @@ # include "localcharset.h" #endif #include - #include #include +#include #include #if defined _LIBC # include #else +# define __libc_lock_define(CLASS,NAME) # define __libc_lock_init(NAME) do { } while (0) # define __libc_lock_lock(NAME) do { } while (0) # define __libc_lock_unlock(NAME) do { } while (0) @@ -76,11 +75,6 @@ # define gettext_noop(String) String #endif -/* For loser systems without the definition. */ -#ifndef SIZE_MAX -# define SIZE_MAX ((size_t) -1) -#endif - #if (defined MB_CUR_MAX && HAVE_WCTYPE_H && HAVE_ISWCTYPE && HAVE_WCSCOLL) || _LIBC # define RE_ENABLE_I18N #endif @@ -111,8 +105,8 @@ # define __wctype wctype # define __iswctype iswctype # define __btowc btowc -# define __wcrtomb wcrtomb # define __mbrtowc mbrtowc +# define __wcrtomb wcrtomb # define __regfree regfree # define attribute_hidden #endif /* not _LIBC */ @@ -124,6 +118,11 @@ #endif typedef __re_idx_t Idx; +#ifdef _REGEX_LARGE_OFFSETS +# define IDX_MAX (SIZE_MAX - 2) +#else +# define IDX_MAX INT_MAX +#endif /* Special return value for failure to match. */ #define REG_MISSING ((Idx) -1) @@ -334,7 +333,7 @@ Idx idx; /* for BACK_REF */ re_context_type ctx_type; /* for ANCHOR */ } opr; -#if __GNUC__ >= 2 && !__STRICT_ANSI__ +#if __GNUC__ >= 2 && !defined __STRICT_ANSI__ re_token_type_t type : 8; #else re_token_type_t type; @@ -415,26 +414,24 @@ typedef struct re_dfa_t re_dfa_t; #ifndef _LIBC -# if defined __i386__ && !defined __EMX__ -# define internal_function __attribute ((regparm (3), stdcall)) -# else -# define internal_function -# endif +# define internal_function #endif +#ifndef NOT_IN_libc static reg_errcode_t re_string_realloc_buffers (re_string_t *pstr, Idx new_buf_len) internal_function; -#ifdef RE_ENABLE_I18N +# ifdef RE_ENABLE_I18N static void build_wcs_buffer (re_string_t *pstr) internal_function; static reg_errcode_t build_wcs_upper_buffer (re_string_t *pstr) - internal_function; -#endif /* RE_ENABLE_I18N */ + internal_function; +# endif /* RE_ENABLE_I18N */ static void build_upper_buffer (re_string_t *pstr) internal_function; static void re_string_translate_buffer (re_string_t *pstr) internal_function; static unsigned int re_string_context_at (const re_string_t *input, Idx idx, int eflags) internal_function __attribute ((pure)); +#endif #define re_string_peek_byte(pstr, offset) \ ((pstr)->mbs[(pstr)->cur_idx + offset]) #define re_string_fetch_byte(pstr) \ @@ -472,6 +469,9 @@ #ifndef MAX # define MAX(a,b) ((a) < (b) ? (b) : (a)) #endif +#ifndef MIN +# define MIN(a,b) ((a) < (b) ? (a) : (b)) +#endif #define re_malloc(t,n) ((t *) malloc ((n) * sizeof (t))) #define re_realloc(p,t,n) ((t *) realloc (p, (n) * sizeof (t))) @@ -487,8 +487,8 @@ re_token_t token; - /* `node_idx' is the index in dfa->nodes, if `type' == 0. - Otherwise `type' indicate the type of this node. */ + /* 'node_idx' is the index in dfa->nodes, if 'type' == 0. + Otherwise 'type' indicate the type of this node. */ Idx node_idx; }; typedef struct bin_tree_t bin_tree_t; @@ -541,9 +541,9 @@ struct re_dfastate_t **trtable, **word_trtable; unsigned int context : 4; unsigned int halt : 1; - /* If this state can accept `multi byte'. + /* If this state can accept "multi byte". Note that we refer to multibyte characters, and multi character - collating elements as `multi byte'. */ + collating elements as "multi byte". */ unsigned int accept_mb : 1; /* If this state has backreference node(s). */ unsigned int has_backref : 1; @@ -672,7 +672,7 @@ re_bitset_ptr_t sb_char; int str_tree_storage_idx; - /* number of subexpressions `re_nsub' is in regex_t. */ + /* number of subexpressions 're_nsub' is in regex_t. */ re_hashval_t state_hash_mask; Idx init_node; Idx nbackref; /* The number of backreference in this dfa. */ @@ -696,9 +696,7 @@ #ifdef DEBUG char* re_str; #endif -#ifdef _LIBC __libc_lock_define (, lock) -#endif }; #define re_node_set_init_empty(set) memset (set, '\0', sizeof (re_node_set)) @@ -822,15 +820,15 @@ return (wint_t) pstr->wcs[idx]; } +# ifndef NOT_IN_libc static int internal_function __attribute ((pure)) re_string_elem_size_at (const re_string_t *pstr, Idx idx) { -# ifdef _LIBC +# ifdef _LIBC const unsigned char *p, *extra; const int32_t *table, *indirect; - int32_t tmp; -# include +# include uint_fast32_t nrules = _NL_CURRENT_WORD (LC_COLLATE, _NL_COLLATE_NRULES); if (nrules != 0) @@ -841,13 +839,14 @@ indirect = (const int32_t *) _NL_CURRENT (LC_COLLATE, _NL_COLLATE_INDIRECTMB); p = pstr->mbs + idx; - tmp = findidx (&p); + findidx (&p, pstr->len - idx); return p - pstr->mbs - idx; } else -# endif /* _LIBC */ +# endif /* _LIBC */ return 1; } +# endif #endif /* RE_ENABLE_I18N */ #ifndef __GNUC_PREREQ diff -Nru libdap-3.11.1/gl/regexec.c libdap-3.12.0/gl/regexec.c --- libdap-3.11.1/gl/regexec.c 2011-04-29 13:19:36.000000000 +0000 +++ libdap-3.12.0/gl/regexec.c 2013-10-17 21:27:40.000000000 +0000 @@ -1,5 +1,5 @@ /* Extended regular expression matching and search library. - Copyright (C) 2002-2011 Free Software Foundation, Inc. + Copyright (C) 2002-2012 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Isamu Hasegawa . @@ -14,8 +14,7 @@ GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along - with this program; if not, write to the Free Software Foundation, - Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ + with this program; if not, see . */ static reg_errcode_t match_ctx_init (re_match_context_t *cache, int eflags, Idx n) internal_function; @@ -51,9 +50,8 @@ regoff_t range, Idx stop, struct re_registers *regs, bool ret_len) internal_function; -static unsigned int re_copy_regs (struct re_registers *regs, regmatch_t *pmatch, - Idx nregs, int regs_allocated) - internal_function; +static unsigned re_copy_regs (struct re_registers *regs, regmatch_t *pmatch, + Idx nregs, int regs_allocated) internal_function; static reg_errcode_t prune_impossible_nodes (re_match_context_t *mctx) internal_function; static Idx check_matching (re_match_context_t *mctx, bool fl_longest_match, @@ -209,11 +207,11 @@ string STRING. If NMATCH is zero or REG_NOSUB was set in the cflags argument to - `regcomp', we ignore PMATCH. Otherwise, we assume PMATCH has at + 'regcomp', we ignore PMATCH. Otherwise, we assume PMATCH has at least NMATCH elements, and we set them to the offsets of the corresponding matched substrings. - EFLAGS specifies `execution flags' which affect matching: if + EFLAGS specifies "execution flags" which affect matching: if REG_NOTBOL is set, then ^ does not match at the beginning of the string; if REG_NOTEOL is set, then $ does not match at the end. @@ -230,7 +228,7 @@ reg_errcode_t err; Idx start, length; #ifdef _LIBC - re_dfa_t *dfa = (re_dfa_t *) preg->buffer; + re_dfa_t *dfa = preg->buffer; #endif if (eflags & ~(REG_NOTBOL | REG_NOTEOL | REG_STARTEND)) @@ -365,7 +363,6 @@ #endif static regoff_t -internal_function re_search_2_stub (struct re_pattern_buffer *bufp, const char *string1, Idx length1, const char *string2, Idx length2, @@ -413,7 +410,6 @@ otherwise the position of the match is returned. */ static regoff_t -internal_function re_search_stub (struct re_pattern_buffer *bufp, const char *string, Idx length, Idx start, regoff_t range, Idx stop, struct re_registers *regs, @@ -425,7 +421,7 @@ regoff_t rval; int eflags = 0; #ifdef _LIBC - re_dfa_t *dfa = (re_dfa_t *) bufp->buffer; + re_dfa_t *dfa = bufp->buffer; #endif Idx last_start = start + range; @@ -477,9 +473,9 @@ rval = 0; - /* I hope we needn't fill ther regs with -1's when no match was found. */ + /* I hope we needn't fill their regs with -1's when no match was found. */ if (result != REG_NOERROR) - rval = -1; + rval = result == REG_NOMATCH ? -1 : -2; else if (regs != NULL) { /* If caller wants register contents data back, copy them. */ @@ -505,15 +501,14 @@ return rval; } -static unsigned int -internal_function +static unsigned re_copy_regs (struct re_registers *regs, regmatch_t *pmatch, Idx nregs, int regs_allocated) { int rval = REGS_REALLOCATE; Idx i; Idx need_regs = nregs + 1; - /* We need one extra element beyond `num_regs' for the `-1' marker GNU code + /* We need one extra element beyond 'num_regs' for the '-1' marker GNU code uses. */ /* Have the register data arrays been allocated? */ @@ -636,7 +631,7 @@ (0 <= LAST_START && LAST_START <= LENGTH) */ static reg_errcode_t -internal_function __attribute_warn_unused_result__ +__attribute_warn_unused_result__ re_search_internal (const regex_t *preg, const char *string, Idx length, Idx start, Idx last_start, Idx stop, @@ -644,7 +639,7 @@ int eflags) { reg_errcode_t err; - const re_dfa_t *dfa = (const re_dfa_t *) preg->buffer; + const re_dfa_t *dfa = preg->buffer; Idx left_lim, right_lim; int incr; bool fl_longest_match; @@ -719,7 +714,8 @@ if (nmatch > 1 || dfa->has_mb_node) { /* Avoid overflow. */ - if (BE (SIZE_MAX / sizeof (re_dfastate_t *) <= mctx.input.bufs_len, 0)) + if (BE ((MIN (IDX_MAX, SIZE_MAX / sizeof (re_dfastate_t *)) + <= mctx.input.bufs_len), 0)) { err = REG_ESPACE; goto free_return; @@ -921,7 +917,7 @@ goto free_return; } - /* At last, add the offset to the each registers, since we slided + /* At last, add the offset to each register, since we slid the buffers so that we could assume that the matching starts from 0. */ for (reg_idx = 0; reg_idx < nmatch; ++reg_idx) @@ -971,7 +967,7 @@ } static reg_errcode_t -internal_function __attribute_warn_unused_result__ +__attribute_warn_unused_result__ prune_impossible_nodes (re_match_context_t *mctx) { const re_dfa_t *const dfa = mctx->dfa; @@ -987,7 +983,7 @@ halt_node = mctx->last_node; /* Avoid overflow. */ - if (BE (SIZE_MAX / sizeof (re_dfastate_t *) <= match_last, 0)) + if (BE (MIN (IDX_MAX, SIZE_MAX / sizeof (re_dfastate_t *)) <= match_last, 0)) return REG_ESPACE; sifted_states = re_malloc (re_dfastate_t *, match_last + 1); @@ -1105,7 +1101,7 @@ FL_LONGEST_MATCH means we want the POSIX longest matching. If P_MATCH_FIRST is not NULL, and the match fails, it is set to the next place where we may want to try matching. - Note that the matcher assume that the maching starts from the current + Note that the matcher assumes that the matching starts from the current index of the buffer. */ static Idx @@ -1174,7 +1170,8 @@ re_dfastate_t *old_state = cur_state; Idx next_char_idx = re_string_cur_idx (&mctx->input) + 1; - if (BE (next_char_idx >= mctx->input.bufs_len, 0) + if ((BE (next_char_idx >= mctx->input.bufs_len, 0) + && mctx->input.bufs_len < mctx->input.len) || (BE (next_char_idx >= mctx->input.valid_len, 0) && mctx->input.valid_len < mctx->input.len)) { @@ -1435,7 +1432,7 @@ set_regs (const regex_t *preg, const re_match_context_t *mctx, size_t nmatch, regmatch_t *pmatch, bool fl_backtrack) { - const re_dfa_t *dfa = (const re_dfa_t *) preg->buffer; + const re_dfa_t *dfa = preg->buffer; Idx idx, cur_node; re_node_set eps_via_nodes; struct re_fail_stack_t *fs; @@ -1607,21 +1604,21 @@ and sift the nodes in each states according to the following rules. Updated state_log will be wrote to STATE_LOG. - Rules: We throw away the Node `a' in the STATE_LOG[STR_IDX] if... + Rules: We throw away the Node 'a' in the STATE_LOG[STR_IDX] if... 1. When STR_IDX == MATCH_LAST(the last index in the state_log): - If `a' isn't the LAST_NODE and `a' can't epsilon transit to - the LAST_NODE, we throw away the node `a'. - 2. When 0 <= STR_IDX < MATCH_LAST and `a' accepts - string `s' and transit to `b': + If 'a' isn't the LAST_NODE and 'a' can't epsilon transit to + the LAST_NODE, we throw away the node 'a'. + 2. When 0 <= STR_IDX < MATCH_LAST and 'a' accepts + string 's' and transit to 'b': i. If 'b' isn't in the STATE_LOG[STR_IDX+strlen('s')], we throw - away the node `a'. + away the node 'a'. ii. If 'b' is in the STATE_LOG[STR_IDX+strlen('s')] but 'b' is - thrown away, we throw away the node `a'. + thrown away, we throw away the node 'a'. 3. When 0 <= STR_IDX < MATCH_LAST and 'a' epsilon transit to 'b': i. If 'b' isn't in the STATE_LOG[STR_IDX], we throw away the - node `a'. + node 'a'. ii. If 'b' is in the STATE_LOG[STR_IDX] but 'b' is thrown away, - we throw away the node `a'. */ + we throw away the node 'a'. */ #define STATE_NODE_CONTAINS(state,node) \ ((state) != NULL && re_node_set_contains (&(state)->nodes, node)) @@ -1694,11 +1691,11 @@ Idx i; /* Then build the next sifted state. - We build the next sifted state on `cur_dest', and update - `sifted_states[str_idx]' with `cur_dest'. + We build the next sifted state on 'cur_dest', and update + 'sifted_states[str_idx]' with 'cur_dest'. Note: - `cur_dest' is the sifted state from `state_log[str_idx + 1]'. - `cur_src' points the node_set of the old `state_log[str_idx]' + 'cur_dest' is the sifted state from 'state_log[str_idx + 1]'. + 'cur_src' points the node_set of the old 'state_log[str_idx]' (with the epsilon nodes pre-filtered out). */ for (i = 0; i < cur_src->nelem; i++) { @@ -1711,7 +1708,7 @@ assert (!IS_EPSILON_NODE (type)); #endif #ifdef RE_ENABLE_I18N - /* If the node may accept `multi byte'. */ + /* If the node may accept "multi byte". */ if (dfa->nodes[prev_node].accept_mb) naccepted = sift_states_iter_mb (mctx, sctx, prev_node, str_idx, sctx->last_str_idx); @@ -1752,7 +1749,8 @@ { Idx top = mctx->state_log_top; - if (next_state_log_idx >= mctx->input.bufs_len + if ((next_state_log_idx >= mctx->input.bufs_len + && mctx->input.bufs_len < mctx->input.len) || (next_state_log_idx >= mctx->input.valid_len && mctx->input.valid_len < mctx->input.len)) { @@ -2267,17 +2265,17 @@ { const re_dfa_t *const dfa = mctx->dfa; int naccepted; - /* Check the node can accept `multi byte'. */ + /* Check the node can accept "multi byte". */ naccepted = check_node_accept_bytes (dfa, node_idx, &mctx->input, str_idx); if (naccepted > 0 && str_idx + naccepted <= max_str_idx && !STATE_NODE_CONTAINS (sctx->sifted_states[str_idx + naccepted], dfa->nexts[node_idx])) - /* The node can't accept the `multi byte', or the + /* The node can't accept the "multi byte", or the destination was already thrown away, then the node - could't accept the current input `multi byte'. */ + could't accept the current input "multi byte". */ naccepted = 0; /* Otherwise, it is sure that the node could accept - `naccepted' bytes input. */ + 'naccepted' bytes input. */ return naccepted; } #endif /* RE_ENABLE_I18N */ @@ -2456,7 +2454,7 @@ /* From the node set CUR_NODES, pick up the nodes whose types are OP_OPEN_SUBEXP and which have corresponding back references in the regular expression. And register them to use them later for evaluating the - correspoding back references. */ + corresponding back references. */ static reg_errcode_t internal_function @@ -2567,7 +2565,7 @@ if (naccepted == 0) continue; - /* The node can accepts `naccepted' bytes. */ + /* The node can accepts 'naccepted' bytes. */ dest_idx = re_string_cur_idx (&mctx->input) + naccepted; mctx->max_mb_elem_len = ((mctx->max_mb_elem_len < naccepted) ? naccepted : mctx->max_mb_elem_len); @@ -2619,7 +2617,7 @@ const re_token_t *node = dfa->nodes + node_idx; re_node_set *new_dest_nodes; - /* Check whether `node' is a backreference or not. */ + /* Check whether 'node' is a backreference or not. */ if (node->type != OP_BACK_REF) continue; @@ -2631,14 +2629,14 @@ continue; } - /* `node' is a backreference. + /* 'node' is a backreference. Check the substring which the substring matched. */ bkc_idx = mctx->nbkref_ents; err = get_subexp (mctx, node_idx, cur_str_idx); if (BE (err != REG_NOERROR, 0)) goto free_return; - /* And add the epsilon closures (which is `new_dest_nodes') of + /* And add the epsilon closures (which is 'new_dest_nodes') of the backreference to appropriate state_log. */ #ifdef DEBUG assert (dfa->nexts[node_idx] != REG_MISSING); @@ -2662,7 +2660,7 @@ dest_state = mctx->state_log[dest_str_idx]; prev_nelem = ((mctx->state_log[cur_str_idx] == NULL) ? 0 : mctx->state_log[cur_str_idx]->nodes.nelem); - /* Add `new_dest_node' to state_log. */ + /* Add 'new_dest_node' to state_log. */ if (dest_state == NULL) { mctx->state_log[dest_str_idx] @@ -2936,9 +2934,12 @@ { re_dfastate_t **new_array; Idx old_alloc = path->alloc; - Idx new_alloc = old_alloc + last_str + mctx->max_mb_elem_len + 1; - if (BE (new_alloc < old_alloc, 0) - || BE (SIZE_MAX / sizeof (re_dfastate_t *) < new_alloc, 0)) + Idx incr_alloc = last_str + mctx->max_mb_elem_len + 1; + Idx new_alloc; + if (BE (IDX_MAX - old_alloc < incr_alloc, 0)) + return REG_ESPACE; + new_alloc = old_alloc + incr_alloc; + if (BE (SIZE_MAX / sizeof (re_dfastate_t *) < new_alloc, 0)) return REG_ESPACE; new_array = re_realloc (path->array, re_dfastate_t *, new_alloc); if (BE (new_array == NULL, 0)) @@ -3101,7 +3102,7 @@ assert (!IS_EPSILON_NODE (type)); #endif #ifdef RE_ENABLE_I18N - /* If the node may accept `multi byte'. */ + /* If the node may accept "multi byte". */ if (dfa->nodes[cur_node].accept_mb) { naccepted = check_node_accept_bytes (dfa, cur_node, &mctx->input, @@ -3358,7 +3359,7 @@ bitset_word_t elem, mask; bool dests_node_malloced = false; bool dest_states_malloced = false; - Idx ndests; /* Number of the destination states from `state'. */ + Idx ndests; /* Number of the destination states from 'state'. */ re_dfastate_t **trtable; re_dfastate_t **dest_states = NULL, **dest_states_word, **dest_states_nl; re_node_set follows, *dests_node; @@ -3372,8 +3373,8 @@ } *dests_alloc; /* We build DFA states which corresponds to the destination nodes - from `state'. `dests_node[i]' represents the nodes which i-th - destination state contains, and `dests_ch[i]' represents the + from 'state'. 'dests_node[i]' represents the nodes which i-th + destination state contains, and 'dests_ch[i]' represents the characters which i-th destination state accepts. */ if (__libc_use_alloca (sizeof (struct dests_alloc))) dests_alloc = (struct dests_alloc *) alloca (sizeof (struct dests_alloc)); @@ -3387,16 +3388,17 @@ dests_node = dests_alloc->dests_node; dests_ch = dests_alloc->dests_ch; - /* Initialize transiton table. */ + /* Initialize transition table. */ state->word_trtable = state->trtable = NULL; - /* At first, group all nodes belonging to `state' into several + /* At first, group all nodes belonging to 'state' into several destinations. */ ndests = group_nodes_into_DFAstates (dfa, state, dests_node, dests_ch); if (BE (! REG_VALID_NONZERO_INDEX (ndests), 0)) { if (dests_node_malloced) free (dests_alloc); + /* Return false in case of an error, true otherwise. */ if (ndests == 0) { state->trtable = (re_dfastate_t **) @@ -3592,13 +3594,13 @@ reg_errcode_t err; bool ok; Idx i, j, k; - Idx ndests; /* Number of the destinations from `state'. */ + Idx ndests; /* Number of the destinations from 'state'. */ bitset_t accepts; /* Characters a node can accept. */ const re_node_set *cur_nodes = &state->nodes; bitset_empty (accepts); ndests = 0; - /* For all the nodes belonging to `state', */ + /* For all the nodes belonging to 'state', */ for (i = 0; i < cur_nodes->nelem; ++i) { re_token_t *node = &dfa->nodes[cur_nodes->elems[i]]; @@ -3641,7 +3643,7 @@ else continue; - /* Check the `accepts' and sift the characters which are not + /* Check the 'accepts' and sift the characters which are not match it the context. */ if (constraint) { @@ -3700,7 +3702,7 @@ } } - /* Then divide `accepts' into DFA states, or create a new + /* Then divide 'accepts' into DFA states, or create a new state. Above, we make sure that accepts is not empty. */ for (j = 0; j < ndests; ++j) { @@ -3713,7 +3715,7 @@ if (type == CHARACTER && !bitset_contain (dests_ch[j], node->opr.c)) continue; - /* Enumerate the intersection set of this state and `accepts'. */ + /* Enumerate the intersection set of this state and 'accepts'. */ has_intersec = 0; for (k = 0; k < BITSET_WORDS; ++k) has_intersec |= intersec[k] = accepts[k] & dests_ch[j][k]; @@ -3721,7 +3723,7 @@ if (!has_intersec) continue; - /* Then check if this state is a subset of `accepts'. */ + /* Then check if this state is a subset of 'accepts'. */ not_subset = not_consumed = 0; for (k = 0; k < BITSET_WORDS; ++k) { @@ -3729,8 +3731,8 @@ not_consumed |= accepts[k] = accepts[k] & ~dests_ch[j][k]; } - /* If this state isn't a subset of `accepts', create a - new group state, which has the `remains'. */ + /* If this state isn't a subset of 'accepts', create a + new group state, which has the 'remains'. */ if (not_subset) { bitset_copy (dests_ch[ndests], remains); @@ -3769,7 +3771,7 @@ } #ifdef RE_ENABLE_I18N -/* Check how many bytes the node `dfa->nodes[node_idx]' accepts. +/* Check how many bytes the node 'dfa->nodes[node_idx]' accepts. Return the number of the bytes the node accepts. STR_IDX is the current index of the input string. @@ -3896,7 +3898,6 @@ const int32_t *table, *indirect; const unsigned char *weights, *extra; const char *collseqwc; - int32_t idx; /* This #include defines a local function! */ # include @@ -3954,7 +3955,7 @@ _NL_CURRENT (LC_COLLATE, _NL_COLLATE_EXTRAMB); indirect = (const int32_t *) _NL_CURRENT (LC_COLLATE, _NL_COLLATE_INDIRECTMB); - int32_t idx = findidx (&cp); + int32_t idx = findidx (&cp, elem_len); if (idx > 0) for (i = 0; i < cset->nequiv_classes; ++i) { @@ -3985,7 +3986,7 @@ # endif /* _LIBC */ { /* match with range expression? */ -#if __GNUC__ >= 2 && ! (__STDC_VERSION__ < 199901L && __STRICT_ANSI__) +#if __GNUC__ >= 2 && ! (__STDC_VERSION__ < 199901L && defined __STRICT_ANSI__) wchar_t cmp_buf[] = {L'\0', L'\0', wc, L'\0', L'\0', L'\0'}; #else wchar_t cmp_buf[] = {L'\0', L'\0', L'\0', L'\0', L'\0', L'\0'}; @@ -4066,7 +4067,7 @@ /* Skip the collation sequence value. */ idx += sizeof (uint32_t); /* Skip the wide char sequence of the collating element. */ - idx = idx + sizeof (uint32_t) * (extra[idx] + 1); + idx = idx + sizeof (uint32_t) * (*(int32_t *) (extra + idx) + 1); /* If we found the entry, return the sequence value. */ if (found) return *(uint32_t *) (extra + idx); @@ -4140,11 +4141,12 @@ re_string_t *pstr = &mctx->input; /* Avoid overflow. */ - if (BE (SIZE_MAX / 2 / sizeof (re_dfastate_t *) <= pstr->bufs_len, 0)) + if (BE (MIN (IDX_MAX, SIZE_MAX / sizeof (re_dfastate_t *)) / 2 + <= pstr->bufs_len, 0)) return REG_ESPACE; - /* Double the lengthes of the buffers. */ - ret = re_string_realloc_buffers (pstr, pstr->bufs_len * 2); + /* Double the lengths of the buffers. */ + ret = re_string_realloc_buffers (pstr, MIN (pstr->len, pstr->bufs_len * 2)); if (BE (ret != REG_NOERROR, 0)) return ret; @@ -4207,7 +4209,7 @@ size_t max_object_size = MAX (sizeof (struct re_backref_cache_entry), sizeof (re_sub_match_top_t *)); - if (BE (SIZE_MAX / max_object_size < n, 0)) + if (BE (MIN (IDX_MAX, SIZE_MAX / max_object_size) < n, 0)) return REG_ESPACE; mctx->bkref_ents = re_malloc (struct re_backref_cache_entry, n); diff -Nru libdap-3.11.1/gl/stdbool.in.h libdap-3.12.0/gl/stdbool.in.h --- libdap-3.11.1/gl/stdbool.in.h 2011-04-29 13:19:36.000000000 +0000 +++ libdap-3.12.0/gl/stdbool.in.h 2013-10-17 21:27:40.000000000 +0000 @@ -1,4 +1,4 @@ -/* Copyright (C) 2001-2003, 2006-2011 Free Software Foundation, Inc. +/* Copyright (C) 2001-2003, 2006-2012 Free Software Foundation, Inc. Written by Bruno Haible , 2001. This program is free software; you can redistribute it and/or modify @@ -12,8 +12,7 @@ GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License - along with this program; if not, write to the Free Software Foundation, - Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ + along with this program; if not, see . */ #ifndef _GL_STDBOOL_H #define _GL_STDBOOL_H diff -Nru libdap-3.11.1/gl/stddef.in.h libdap-3.12.0/gl/stddef.in.h --- libdap-3.11.1/gl/stddef.in.h 2011-04-29 13:19:36.000000000 +0000 +++ libdap-3.12.0/gl/stddef.in.h 2013-10-17 21:27:40.000000000 +0000 @@ -1,6 +1,6 @@ /* A substitute for POSIX 2008 , for platforms that have issues. - Copyright (C) 2009-2011 Free Software Foundation, Inc. + Copyright (C) 2009-2012 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by @@ -13,8 +13,7 @@ GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License - along with this program; if not, write to the Free Software Foundation, - Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ + along with this program; if not, see . */ /* Written by Eric Blake. */ @@ -38,9 +37,9 @@ remember if special invocation has ever been used to obtain wint_t, in which case we need to clean up NULL yet again. */ -# if !(defined _GL_STDDEF_H && defined _GL_STDDEF_WINT_T) +# if !(defined _@GUARD_PREFIX@_STDDEF_H && defined _GL_STDDEF_WINT_T) # ifdef __need_wint_t -# undef _GL_STDDEF_H +# undef _@GUARD_PREFIX@_STDDEF_H # define _GL_STDDEF_WINT_T # endif # @INCLUDE_NEXT@ @NEXT_STDDEF_H@ @@ -49,14 +48,14 @@ #else /* Normal invocation convention. */ -# ifndef _GL_STDDEF_H +# ifndef _@GUARD_PREFIX@_STDDEF_H /* The include_next requires a split double-inclusion guard. */ # @INCLUDE_NEXT@ @NEXT_STDDEF_H@ -# ifndef _GL_STDDEF_H -# define _GL_STDDEF_H +# ifndef _@GUARD_PREFIX@_STDDEF_H +# define _@GUARD_PREFIX@_STDDEF_H /* On NetBSD 5.0, the definition of NULL lacks proper parentheses. */ #if @REPLACE_NULL@ @@ -82,6 +81,6 @@ # define wchar_t int #endif -# endif /* _GL_STDDEF_H */ -# endif /* _GL_STDDEF_H */ +# endif /* _@GUARD_PREFIX@_STDDEF_H */ +# endif /* _@GUARD_PREFIX@_STDDEF_H */ #endif /* __need_XXX */ diff -Nru libdap-3.11.1/gl/stdint.in.h libdap-3.12.0/gl/stdint.in.h --- libdap-3.11.1/gl/stdint.in.h 2011-04-29 13:19:36.000000000 +0000 +++ libdap-3.12.0/gl/stdint.in.h 2013-10-17 21:27:40.000000000 +0000 @@ -1,4 +1,4 @@ -/* Copyright (C) 2001-2002, 2004-2011 Free Software Foundation, Inc. +/* Copyright (C) 2001-2002, 2004-2012 Free Software Foundation, Inc. Written by Paul Eggert, Bruno Haible, Sam Steingold, Peter Burwood. This file is part of gnulib. @@ -13,15 +13,14 @@ GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License - along with this program; if not, write to the Free Software Foundation, - Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ + along with this program; if not, see . */ /* * ISO C 99 for platforms that lack it. * */ -#ifndef _GL_STDINT_H +#ifndef _@GUARD_PREFIX@_STDINT_H #if __GNUC__ >= 3 @PRAGMA_SYSTEM_HEADER@ @@ -34,6 +33,16 @@ . */ #define _GL_JUST_INCLUDE_SYSTEM_INTTYPES_H +/* On Android (Bionic libc), includes this file before + having defined 'time_t'. Therefore in this case avoid including + other system header files; just include the system's . + Ideally we should test __BIONIC__ here, but it is only defined after + has been included; hence test __ANDROID__ instead. */ +#if defined __ANDROID__ \ + && defined _SYS_TYPES_H_ && !defined _SSIZE_T_DEFINED_ +# @INCLUDE_NEXT@ @NEXT_STDINT_H@ +#else + /* Get those types that are already defined in other system include files, so that we can "#define int8_t signed char" below without worrying about a later system include file containing a "typedef @@ -49,28 +58,40 @@ diagnostics. */ # define __STDINT_H__ # endif + + /* Some pre-C++11 implementations need this. */ +# ifdef __cplusplus +# ifndef __STDC_CONSTANT_MACROS +# define __STDC_CONSTANT_MACROS 1 +# endif +# ifndef __STDC_LIMIT_MACROS +# define __STDC_LIMIT_MACROS 1 +# endif +# endif + /* Other systems may have an incomplete or buggy . Include it before , since any "#include " in would reinclude us, skipping our contents because - _GL_STDINT_H is defined. + _@GUARD_PREFIX@_STDINT_H is defined. The include_next requires a split double-inclusion guard. */ # @INCLUDE_NEXT@ @NEXT_STDINT_H@ #endif -#if ! defined _GL_STDINT_H && ! defined _GL_JUST_INCLUDE_SYSTEM_STDINT_H -#define _GL_STDINT_H +#if ! defined _@GUARD_PREFIX@_STDINT_H && ! defined _GL_JUST_INCLUDE_SYSTEM_STDINT_H +#define _@GUARD_PREFIX@_STDINT_H /* defines some of the stdint.h types as well, on glibc, IRIX 6.5, and OpenBSD 3.8 (via ). AIX 5.2 isn't needed and causes troubles. - MacOS X 10.4.6 includes (which is us), but + Mac OS X 10.4.6 includes (which is us), but relies on the system definitions, so include after @NEXT_STDINT_H@. */ #if @HAVE_SYS_TYPES_H@ && ! defined _AIX # include #endif -/* Get LONG_MIN, LONG_MAX, ULONG_MAX. */ +/* Get SCHAR_MIN, SCHAR_MAX, UCHAR_MAX, INT_MIN, INT_MAX, + LONG_MIN, LONG_MAX, ULONG_MAX. */ #include #if @HAVE_INTTYPES_H@ @@ -93,7 +114,7 @@ #undef _GL_JUST_INCLUDE_SYSTEM_INTTYPES_H -/* Minimum and maximum values for a integer type under the usual assumption. +/* Minimum and maximum values for an integer type under the usual assumption. Return an unspecified value if BITS == 0, adding a check to pacify picky compilers. */ @@ -108,6 +129,8 @@ warnings in the signed case. */ \ ((((zero) + 1) << ((bits) ? (bits) - 1 - (signed) : 0)) - 1) * 2 + 1) +#if !GNULIB_defined_stdint_types + /* 7.18.1.1. Exact-width integer types */ /* Here we assume a standard architecture where the hardware integer @@ -224,8 +247,9 @@ /* Here we assume a standard architecture where the hardware integer types have 8, 16, 32, optionally 64 bits. Therefore the fastN_t types - are taken from the same list of types. Assume that 'long int' - is fast enough for all narrower integers. */ + are taken from the same list of types. The following code normally + uses types consistent with glibc, as that lessens the chance of + incompatibility with older GNU hosts. */ #undef int_fast8_t #undef uint_fast8_t @@ -235,12 +259,21 @@ #undef uint_fast32_t #undef int_fast64_t #undef uint_fast64_t -typedef long int gl_int_fast8_t; -typedef unsigned long int gl_uint_fast8_t; -typedef long int gl_int_fast16_t; -typedef unsigned long int gl_uint_fast16_t; +typedef signed char gl_int_fast8_t; +typedef unsigned char gl_uint_fast8_t; + +#ifdef __sun +/* Define types compatible with SunOS 5.10, so that code compiled under + earlier SunOS versions works with code compiled under SunOS 5.10. */ +typedef int gl_int_fast32_t; +typedef unsigned int gl_uint_fast32_t; +#else typedef long int gl_int_fast32_t; typedef unsigned long int gl_uint_fast32_t; +#endif +typedef gl_int_fast32_t gl_int_fast16_t; +typedef gl_uint_fast32_t gl_uint_fast16_t; + #define int_fast8_t gl_int_fast8_t #define uint_fast8_t gl_uint_fast8_t #define int_fast16_t gl_int_fast16_t @@ -268,26 +301,36 @@ /* Note: These types are compiler dependent. It may be unwise to use them in public header files. */ -#undef intmax_t -#if @HAVE_LONG_LONG_INT@ && LONG_MAX >> 30 == 1 +/* If the system defines INTMAX_MAX, assume that intmax_t works, and + similarly for UINTMAX_MAX and uintmax_t. This avoids problems with + assuming one type where another is used by the system. */ + +#ifndef INTMAX_MAX +# undef INTMAX_C +# undef intmax_t +# if @HAVE_LONG_LONG_INT@ && LONG_MAX >> 30 == 1 typedef long long int gl_intmax_t; -# define intmax_t gl_intmax_t -#elif defined GL_INT64_T -# define intmax_t int64_t -#else +# define intmax_t gl_intmax_t +# elif defined GL_INT64_T +# define intmax_t int64_t +# else typedef long int gl_intmax_t; -# define intmax_t gl_intmax_t +# define intmax_t gl_intmax_t +# endif #endif -#undef uintmax_t -#if @HAVE_UNSIGNED_LONG_LONG_INT@ && ULONG_MAX >> 31 == 1 +#ifndef UINTMAX_MAX +# undef UINTMAX_C +# undef uintmax_t +# if @HAVE_UNSIGNED_LONG_LONG_INT@ && ULONG_MAX >> 31 == 1 typedef unsigned long long int gl_uintmax_t; -# define uintmax_t gl_uintmax_t -#elif defined GL_UINT64_T -# define uintmax_t uint64_t -#else +# define uintmax_t gl_uintmax_t +# elif defined GL_UINT64_T +# define uintmax_t uint64_t +# else typedef unsigned long int gl_uintmax_t; -# define uintmax_t gl_uintmax_t +# define uintmax_t gl_uintmax_t +# endif #endif /* Verify that intmax_t and uintmax_t have the same size. Too much code @@ -296,9 +339,10 @@ typedef int _verify_intmax_size[sizeof (intmax_t) == sizeof (uintmax_t) ? 1 : -1]; -/* 7.18.2. Limits of specified-width integer types */ +#define GNULIB_defined_stdint_types 1 +#endif /* !GNULIB_defined_stdint_types */ -#if ! defined __cplusplus || defined __STDC_LIMIT_MACROS +/* 7.18.2. Limits of specified-width integer types */ /* 7.18.2.1. Limits of exact-width integer types */ @@ -385,23 +429,29 @@ #undef INT_FAST8_MIN #undef INT_FAST8_MAX #undef UINT_FAST8_MAX -#define INT_FAST8_MIN LONG_MIN -#define INT_FAST8_MAX LONG_MAX -#define UINT_FAST8_MAX ULONG_MAX +#define INT_FAST8_MIN SCHAR_MIN +#define INT_FAST8_MAX SCHAR_MAX +#define UINT_FAST8_MAX UCHAR_MAX #undef INT_FAST16_MIN #undef INT_FAST16_MAX #undef UINT_FAST16_MAX -#define INT_FAST16_MIN LONG_MIN -#define INT_FAST16_MAX LONG_MAX -#define UINT_FAST16_MAX ULONG_MAX +#define INT_FAST16_MIN INT_FAST32_MIN +#define INT_FAST16_MAX INT_FAST32_MAX +#define UINT_FAST16_MAX UINT_FAST32_MAX #undef INT_FAST32_MIN #undef INT_FAST32_MAX #undef UINT_FAST32_MAX -#define INT_FAST32_MIN LONG_MIN -#define INT_FAST32_MAX LONG_MAX -#define UINT_FAST32_MAX ULONG_MAX +#ifdef __sun +# define INT_FAST32_MIN INT_MIN +# define INT_FAST32_MAX INT_MAX +# define UINT_FAST32_MAX UINT_MAX +#else +# define INT_FAST32_MIN LONG_MIN +# define INT_FAST32_MAX LONG_MAX +# define UINT_FAST32_MAX ULONG_MAX +#endif #undef INT_FAST64_MIN #undef INT_FAST64_MAX @@ -426,21 +476,23 @@ /* 7.18.2.5. Limits of greatest-width integer types */ -#undef INTMAX_MIN -#undef INTMAX_MAX -#ifdef INT64_MAX -# define INTMAX_MIN INT64_MIN -# define INTMAX_MAX INT64_MAX -#else -# define INTMAX_MIN INT32_MIN -# define INTMAX_MAX INT32_MAX +#ifndef INTMAX_MAX +# undef INTMAX_MIN +# ifdef INT64_MAX +# define INTMAX_MIN INT64_MIN +# define INTMAX_MAX INT64_MAX +# else +# define INTMAX_MIN INT32_MIN +# define INTMAX_MAX INT32_MAX +# endif #endif -#undef UINTMAX_MAX -#ifdef UINT64_MAX -# define UINTMAX_MAX UINT64_MAX -#else -# define UINTMAX_MAX UINT32_MAX +#ifndef UINTMAX_MAX +# ifdef UINT64_MAX +# define UINTMAX_MAX UINT64_MAX +# else +# define UINTMAX_MAX UINT32_MAX +# endif #endif /* 7.18.3. Limits of other integer types */ @@ -492,7 +544,12 @@ sequence of nested includes -> -> -> , and the latter includes and assumes its types are already defined. */ -#if ! (defined WCHAR_MIN && defined WCHAR_MAX) +#if @HAVE_WCHAR_H@ && ! (defined WCHAR_MIN && defined WCHAR_MAX) + /* BSD/OS 4.0.1 has a bug: , and must be + included before . */ +# include +# include +# include # define _GL_JUST_INCLUDE_SYSTEM_WCHAR_H # include # undef _GL_JUST_INCLUDE_SYSTEM_WCHAR_H @@ -512,12 +569,8 @@ #define WINT_MAX \ _STDINT_MAX (@HAVE_SIGNED_WINT_T@, @BITSIZEOF_WINT_T@, 0@WINT_T_SUFFIX@) -#endif /* !defined __cplusplus || defined __STDC_LIMIT_MACROS */ - /* 7.18.4. Macros for integer constants */ -#if ! defined __cplusplus || defined __STDC_CONSTANT_MACROS - /* 7.18.4.1. Macros for minimum-width integer constants */ /* According to ISO C 99 Technical Corrigendum 1 */ @@ -558,25 +611,26 @@ /* 7.18.4.2. Macros for greatest-width integer constants */ -#undef INTMAX_C -#if @HAVE_LONG_LONG_INT@ && LONG_MAX >> 30 == 1 -# define INTMAX_C(x) x##LL -#elif defined GL_INT64_T -# define INTMAX_C(x) INT64_C(x) -#else -# define INTMAX_C(x) x##L +#ifndef INTMAX_C +# if @HAVE_LONG_LONG_INT@ && LONG_MAX >> 30 == 1 +# define INTMAX_C(x) x##LL +# elif defined GL_INT64_T +# define INTMAX_C(x) INT64_C(x) +# else +# define INTMAX_C(x) x##L +# endif #endif -#undef UINTMAX_C -#if @HAVE_UNSIGNED_LONG_LONG_INT@ && ULONG_MAX >> 31 == 1 -# define UINTMAX_C(x) x##ULL -#elif defined GL_UINT64_T -# define UINTMAX_C(x) UINT64_C(x) -#else -# define UINTMAX_C(x) x##UL +#ifndef UINTMAX_C +# if @HAVE_UNSIGNED_LONG_LONG_INT@ && ULONG_MAX >> 31 == 1 +# define UINTMAX_C(x) x##ULL +# elif defined GL_UINT64_T +# define UINTMAX_C(x) UINT64_C(x) +# else +# define UINTMAX_C(x) x##UL +# endif #endif -#endif /* !defined __cplusplus || defined __STDC_CONSTANT_MACROS */ - -#endif /* _GL_STDINT_H */ -#endif /* !defined _GL_STDINT_H && !defined _GL_JUST_INCLUDE_SYSTEM_STDINT_H */ +#endif /* _@GUARD_PREFIX@_STDINT_H */ +#endif /* !(defined __ANDROID__ && ...) */ +#endif /* !defined _@GUARD_PREFIX@_STDINT_H && !defined _GL_JUST_INCLUDE_SYSTEM_STDINT_H */ diff -Nru libdap-3.11.1/gl/stdlib.in.h libdap-3.12.0/gl/stdlib.in.h --- libdap-3.11.1/gl/stdlib.in.h 2011-04-29 13:19:36.000000000 +0000 +++ libdap-3.12.0/gl/stdlib.in.h 2013-10-17 21:27:40.000000000 +0000 @@ -1,6 +1,6 @@ /* A GNU-like . - Copyright (C) 1995, 2001-2004, 2006-2011 Free Software Foundation, Inc. + Copyright (C) 1995, 2001-2004, 2006-2012 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by @@ -28,13 +28,13 @@ #else /* Normal invocation convention. */ -#ifndef _GL_STDLIB_H +#ifndef _@GUARD_PREFIX@_STDLIB_H /* The include_next requires a split double-inclusion guard. */ #@INCLUDE_NEXT@ @NEXT_STDLIB_H@ -#ifndef _GL_STDLIB_H -#define _GL_STDLIB_H +#ifndef _@GUARD_PREFIX@_STDLIB_H +#define _@GUARD_PREFIX@_STDLIB_H /* NetBSD 5.0 mis-defines NULL. */ #include @@ -49,21 +49,28 @@ # include #endif -/* OSF/1 5.1 declares 'struct random_data' in , which is included - from if _REENTRANT is defined. Include it always. */ -#if @HAVE_RANDOM_H@ -# include +/* Native Windows platforms declare mktemp() in . */ +#if 0 && ((defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__) +# include #endif -#if !@HAVE_STRUCT_RANDOM_DATA@ || (@GNULIB_RANDOM_R@ && !@HAVE_RANDOM_R@) \ - || defined GNULIB_POSIXCHECK -# include -#endif +#if @GNULIB_RANDOM_R@ + +/* OSF/1 5.1 declares 'struct random_data' in , which is included + from if _REENTRANT is defined. Include it whenever we need + 'struct random_data'. */ +# if @HAVE_RANDOM_H@ +# include +# endif + +# if !@HAVE_STRUCT_RANDOM_DATA@ || @REPLACE_RANDOM_R@ || !@HAVE_RANDOM_R@ +# include +# endif -#if !@HAVE_STRUCT_RANDOM_DATA@ +# if !@HAVE_STRUCT_RANDOM_DATA@ /* Define 'struct random_data'. But allow multiple gnulib generated replacements to coexist. */ -# if !GNULIB_defined_struct_random_data +# if !GNULIB_defined_struct_random_data struct random_data { int32_t *fptr; /* Front pointer. */ @@ -74,23 +81,29 @@ int rand_sep; /* Distance between front and rear. */ int32_t *end_ptr; /* Pointer behind state table. */ }; -# define GNULIB_defined_struct_random_data 1 +# define GNULIB_defined_struct_random_data 1 +# endif # endif #endif -#if (@GNULIB_MKSTEMP@ || @GNULIB_GETSUBOPT@ || defined GNULIB_POSIXCHECK) && ! defined __GLIBC__ && !((defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__) -/* On MacOS X 10.3, only declares mkstemp. */ +#if (@GNULIB_MKSTEMP@ || @GNULIB_MKSTEMPS@ || @GNULIB_GETSUBOPT@ || defined GNULIB_POSIXCHECK) && ! defined __GLIBC__ && !((defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__) +/* On Mac OS X 10.3, only declares mkstemp. */ +/* On Mac OS X 10.5, only declares mkstemps. */ /* On Cygwin 1.7.1, only declares getsubopt. */ /* But avoid namespace pollution on glibc systems and native Windows. */ # include #endif -#ifndef __attribute__ -# if __GNUC__ < 2 || (__GNUC__ == 2 && __GNUC_MINOR__ < 8) -# define __attribute__(Spec) /* empty */ -# endif +/* The __attribute__ feature is available in gcc versions 2.5 and later. + The attribute __pure__ was added in gcc 2.96. */ +#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 96) +# define _GL_ATTRIBUTE_PURE __attribute__ ((__pure__)) +#else +# define _GL_ATTRIBUTE_PURE /* empty */ #endif +/* The definition of _Noreturn is copied here. */ + /* The definitions of _GL_FUNCDECL_RPL etc. are copied here. */ /* The definition of _GL_ARG_NONNULL is copied here. */ @@ -116,7 +129,7 @@ /* Terminate the current process with the given return code, without running the 'atexit' handlers. */ # if !@HAVE__EXIT@ -_GL_FUNCDECL_SYS (_Exit, void, (int status) __attribute__ ((__noreturn__))); +_GL_FUNCDECL_SYS (_Exit, _Noreturn void, (int status)); # endif _GL_CXXALIAS_SYS (_Exit, void, (int status)); _GL_CXXALIASWARN (_Exit); @@ -133,7 +146,9 @@ /* Parse a signed decimal integer. Returns the value of the integer. Errors are not detected. */ # if !@HAVE_ATOLL@ -_GL_FUNCDECL_SYS (atoll, long long, (const char *string) _GL_ARG_NONNULL ((1))); +_GL_FUNCDECL_SYS (atoll, long long, (const char *string) + _GL_ATTRIBUTE_PURE + _GL_ARG_NONNULL ((1))); # endif _GL_CXXALIAS_SYS (atoll, long long, (const char *string)); _GL_CXXALIASWARN (atoll); @@ -247,14 +262,19 @@ #elif defined GNULIB_POSIXCHECK # undef grantpt # if HAVE_RAW_DECL_GRANTPT -_GL_WARN_ON_USE (ptsname, "grantpt is not portable - " +_GL_WARN_ON_USE (grantpt, "grantpt is not portable - " "use gnulib module grantpt for portability"); # endif #endif +/* If _GL_USE_STDLIB_ALLOC is nonzero, the including module does not + rely on GNU or POSIX semantics for malloc and realloc (for example, + by never specifying a zero size), so it does not need malloc or + realloc to be redefined. */ #if @GNULIB_MALLOC_POSIX@ # if @REPLACE_MALLOC@ -# if !(defined __cplusplus && defined GNULIB_NAMESPACE) +# if !((defined __cplusplus && defined GNULIB_NAMESPACE) \ + || _GL_USE_STDLIB_ALLOC) # undef malloc # define malloc rpl_malloc # endif @@ -264,13 +284,28 @@ _GL_CXXALIAS_SYS (malloc, void *, (size_t size)); # endif _GL_CXXALIASWARN (malloc); -#elif defined GNULIB_POSIXCHECK +#elif defined GNULIB_POSIXCHECK && !_GL_USE_STDLIB_ALLOC # undef malloc /* Assume malloc is always declared. */ _GL_WARN_ON_USE (malloc, "malloc is not POSIX compliant everywhere - " "use gnulib module malloc-posix for portability"); #endif +/* Convert a multibyte character to a wide character. */ +#if @GNULIB_MBTOWC@ +# if @REPLACE_MBTOWC@ +# if !(defined __cplusplus && defined GNULIB_NAMESPACE) +# undef mbtowc +# define mbtowc rpl_mbtowc +# endif +_GL_FUNCDECL_RPL (mbtowc, int, (wchar_t *pwc, const char *s, size_t n)); +_GL_CXXALIAS_RPL (mbtowc, int, (wchar_t *pwc, const char *s, size_t n)); +# else +_GL_CXXALIAS_SYS (mbtowc, int, (wchar_t *pwc, const char *s, size_t n)); +# endif +_GL_CXXALIASWARN (mbtowc); +#endif + #if @GNULIB_MKDTEMP@ /* Create a unique temporary directory from TEMPLATE. The last six characters of TEMPLATE must be "XXXXXX"; @@ -403,6 +438,22 @@ # endif #endif +#if @GNULIB_POSIX_OPENPT@ +/* Return an FD open to the master side of a pseudo-terminal. Flags should + include O_RDWR, and may also include O_NOCTTY. */ +# if !@HAVE_POSIX_OPENPT@ +_GL_FUNCDECL_SYS (posix_openpt, int, (int flags)); +# endif +_GL_CXXALIAS_SYS (posix_openpt, int, (int flags)); +_GL_CXXALIASWARN (posix_openpt); +#elif defined GNULIB_POSIXCHECK +# undef posix_openpt +# if HAVE_RAW_DECL_POSIX_OPENPT +_GL_WARN_ON_USE (posix_openpt, "posix_openpt is not portable - " + "use gnulib module posix_openpt for portability"); +# endif +#endif + #if @GNULIB_PTSNAME@ /* Return the pathname of the pseudo-terminal slave associated with the master FD is open on, or NULL on errors. */ @@ -419,6 +470,32 @@ # endif #endif +#if @GNULIB_PTSNAME_R@ +/* Set the pathname of the pseudo-terminal slave associated with + the master FD is open on and return 0, or set errno and return + non-zero on errors. */ +# if @REPLACE_PTSNAME_R@ +# if !(defined __cplusplus && defined GNULIB_NAMESPACE) +# undef ptsname_r +# define ptsname_r rpl_ptsname_r +# endif +_GL_FUNCDECL_RPL (ptsname_r, int, (int fd, char *buf, size_t len)); +_GL_CXXALIAS_RPL (ptsname_r, int, (int fd, char *buf, size_t len)); +# else +# if !@HAVE_PTSNAME_R@ +_GL_FUNCDECL_SYS (ptsname_r, int, (int fd, char *buf, size_t len)); +# endif +_GL_CXXALIAS_SYS (ptsname_r, int, (int fd, char *buf, size_t len)); +# endif +_GL_CXXALIASWARN (ptsname_r); +#elif defined GNULIB_POSIXCHECK +# undef ptsname_r +# if HAVE_RAW_DECL_PTSNAME_R +_GL_WARN_ON_USE (ptsname_r, "ptsname_r is not portable - " + "use gnulib module ptsname_r for portability"); +# endif +#endif + #if @GNULIB_PUTENV@ # if @REPLACE_PUTENV@ # if !(defined __cplusplus && defined GNULIB_NAMESPACE) @@ -442,12 +519,83 @@ # endif #endif + +#if @GNULIB_RANDOM@ +# if !@HAVE_RANDOM@ +_GL_FUNCDECL_SYS (random, long, (void)); +# endif +_GL_CXXALIAS_SYS (random, long, (void)); +_GL_CXXALIASWARN (random); +#elif defined GNULIB_POSIXCHECK +# undef random +# if HAVE_RAW_DECL_RANDOM +_GL_WARN_ON_USE (random, "random is unportable - " + "use gnulib module random for portability"); +# endif +#endif + +#if @GNULIB_RANDOM@ +# if !@HAVE_RANDOM@ +_GL_FUNCDECL_SYS (srandom, void, (unsigned int seed)); +# endif +_GL_CXXALIAS_SYS (srandom, void, (unsigned int seed)); +_GL_CXXALIASWARN (srandom); +#elif defined GNULIB_POSIXCHECK +# undef srandom +# if HAVE_RAW_DECL_SRANDOM +_GL_WARN_ON_USE (srandom, "srandom is unportable - " + "use gnulib module random for portability"); +# endif +#endif + +#if @GNULIB_RANDOM@ +# if !@HAVE_RANDOM@ +_GL_FUNCDECL_SYS (initstate, char *, + (unsigned int seed, char *buf, size_t buf_size) + _GL_ARG_NONNULL ((2))); +# endif +_GL_CXXALIAS_SYS (initstate, char *, + (unsigned int seed, char *buf, size_t buf_size)); +_GL_CXXALIASWARN (initstate); +#elif defined GNULIB_POSIXCHECK +# undef initstate +# if HAVE_RAW_DECL_INITSTATE_R +_GL_WARN_ON_USE (initstate, "initstate is unportable - " + "use gnulib module random for portability"); +# endif +#endif + +#if @GNULIB_RANDOM@ +# if !@HAVE_RANDOM@ +_GL_FUNCDECL_SYS (setstate, char *, (char *arg_state) _GL_ARG_NONNULL ((1))); +# endif +_GL_CXXALIAS_SYS (setstate, char *, (char *arg_state)); +_GL_CXXALIASWARN (setstate); +#elif defined GNULIB_POSIXCHECK +# undef setstate +# if HAVE_RAW_DECL_SETSTATE_R +_GL_WARN_ON_USE (setstate, "setstate is unportable - " + "use gnulib module random for portability"); +# endif +#endif + + #if @GNULIB_RANDOM_R@ -# if !@HAVE_RANDOM_R@ +# if @REPLACE_RANDOM_R@ +# if !(defined __cplusplus && defined GNULIB_NAMESPACE) +# undef random_r +# define random_r rpl_random_r +# endif +_GL_FUNCDECL_RPL (random_r, int, (struct random_data *buf, int32_t *result) + _GL_ARG_NONNULL ((1, 2))); +_GL_CXXALIAS_RPL (random_r, int, (struct random_data *buf, int32_t *result)); +# else +# if !@HAVE_RANDOM_R@ _GL_FUNCDECL_SYS (random_r, int, (struct random_data *buf, int32_t *result) _GL_ARG_NONNULL ((1, 2))); -# endif +# endif _GL_CXXALIAS_SYS (random_r, int, (struct random_data *buf, int32_t *result)); +# endif _GL_CXXALIASWARN (random_r); #elif defined GNULIB_POSIXCHECK # undef random_r @@ -458,13 +606,25 @@ #endif #if @GNULIB_RANDOM_R@ -# if !@HAVE_RANDOM_R@ +# if @REPLACE_RANDOM_R@ +# if !(defined __cplusplus && defined GNULIB_NAMESPACE) +# undef srandom_r +# define srandom_r rpl_srandom_r +# endif +_GL_FUNCDECL_RPL (srandom_r, int, + (unsigned int seed, struct random_data *rand_state) + _GL_ARG_NONNULL ((2))); +_GL_CXXALIAS_RPL (srandom_r, int, + (unsigned int seed, struct random_data *rand_state)); +# else +# if !@HAVE_RANDOM_R@ _GL_FUNCDECL_SYS (srandom_r, int, (unsigned int seed, struct random_data *rand_state) _GL_ARG_NONNULL ((2))); -# endif +# endif _GL_CXXALIAS_SYS (srandom_r, int, (unsigned int seed, struct random_data *rand_state)); +# endif _GL_CXXALIASWARN (srandom_r); #elif defined GNULIB_POSIXCHECK # undef srandom_r @@ -475,15 +635,29 @@ #endif #if @GNULIB_RANDOM_R@ -# if !@HAVE_RANDOM_R@ +# if @REPLACE_RANDOM_R@ +# if !(defined __cplusplus && defined GNULIB_NAMESPACE) +# undef initstate_r +# define initstate_r rpl_initstate_r +# endif +_GL_FUNCDECL_RPL (initstate_r, int, + (unsigned int seed, char *buf, size_t buf_size, + struct random_data *rand_state) + _GL_ARG_NONNULL ((2, 4))); +_GL_CXXALIAS_RPL (initstate_r, int, + (unsigned int seed, char *buf, size_t buf_size, + struct random_data *rand_state)); +# else +# if !@HAVE_RANDOM_R@ _GL_FUNCDECL_SYS (initstate_r, int, (unsigned int seed, char *buf, size_t buf_size, struct random_data *rand_state) _GL_ARG_NONNULL ((2, 4))); -# endif +# endif _GL_CXXALIAS_SYS (initstate_r, int, (unsigned int seed, char *buf, size_t buf_size, struct random_data *rand_state)); +# endif _GL_CXXALIASWARN (initstate_r); #elif defined GNULIB_POSIXCHECK # undef initstate_r @@ -494,13 +668,25 @@ #endif #if @GNULIB_RANDOM_R@ -# if !@HAVE_RANDOM_R@ +# if @REPLACE_RANDOM_R@ +# if !(defined __cplusplus && defined GNULIB_NAMESPACE) +# undef setstate_r +# define setstate_r rpl_setstate_r +# endif +_GL_FUNCDECL_RPL (setstate_r, int, + (char *arg_state, struct random_data *rand_state) + _GL_ARG_NONNULL ((1, 2))); +_GL_CXXALIAS_RPL (setstate_r, int, + (char *arg_state, struct random_data *rand_state)); +# else +# if !@HAVE_RANDOM_R@ _GL_FUNCDECL_SYS (setstate_r, int, (char *arg_state, struct random_data *rand_state) _GL_ARG_NONNULL ((1, 2))); -# endif +# endif _GL_CXXALIAS_SYS (setstate_r, int, (char *arg_state, struct random_data *rand_state)); +# endif _GL_CXXALIASWARN (setstate_r); #elif defined GNULIB_POSIXCHECK # undef setstate_r @@ -513,7 +699,8 @@ #if @GNULIB_REALLOC_POSIX@ # if @REPLACE_REALLOC@ -# if !(defined __cplusplus && defined GNULIB_NAMESPACE) +# if !((defined __cplusplus && defined GNULIB_NAMESPACE) \ + || _GL_USE_STDLIB_ALLOC) # undef realloc # define realloc rpl_realloc # endif @@ -523,7 +710,7 @@ _GL_CXXALIAS_SYS (realloc, void *, (void *ptr, size_t size)); # endif _GL_CXXALIASWARN (realloc); -#elif defined GNULIB_POSIXCHECK +#elif defined GNULIB_POSIXCHECK && !_GL_USE_STDLIB_ALLOC # undef realloc /* Assume realloc is always declared. */ _GL_WARN_ON_USE (realloc, "realloc is not POSIX compliant everywhere - " @@ -720,7 +907,22 @@ # endif #endif +/* Convert a wide character to a multibyte character. */ +#if @GNULIB_WCTOMB@ +# if @REPLACE_WCTOMB@ +# if !(defined __cplusplus && defined GNULIB_NAMESPACE) +# undef wctomb +# define wctomb rpl_wctomb +# endif +_GL_FUNCDECL_RPL (wctomb, int, (char *s, wchar_t wc)); +_GL_CXXALIAS_RPL (wctomb, int, (char *s, wchar_t wc)); +# else +_GL_CXXALIAS_SYS (wctomb, int, (char *s, wchar_t wc)); +# endif +_GL_CXXALIASWARN (wctomb); +#endif + -#endif /* _GL_STDLIB_H */ -#endif /* _GL_STDLIB_H */ +#endif /* _@GUARD_PREFIX@_STDLIB_H */ +#endif /* _@GUARD_PREFIX@_STDLIB_H */ #endif diff -Nru libdap-3.11.1/gl/strcasecmp.c libdap-3.12.0/gl/strcasecmp.c --- libdap-3.11.1/gl/strcasecmp.c 1970-01-01 00:00:00.000000000 +0000 +++ libdap-3.12.0/gl/strcasecmp.c 2013-10-17 21:27:40.000000000 +0000 @@ -0,0 +1,62 @@ +/* Case-insensitive string comparison function. + Copyright (C) 1998-1999, 2005-2007, 2009-2012 Free Software Foundation, Inc. + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU Lesser General Public License as published by + the Free Software Foundation; either version 2, 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 Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public License + along with this program; if not, see . */ + +#include + +/* Specification. */ +#include + +#include +#include + +#define TOLOWER(Ch) (isupper (Ch) ? tolower (Ch) : (Ch)) + +/* Compare strings S1 and S2, ignoring case, returning less than, equal to or + greater than zero if S1 is lexicographically less than, equal to or greater + than S2. + Note: This function does not work with multibyte strings! */ + +int +strcasecmp (const char *s1, const char *s2) +{ + const unsigned char *p1 = (const unsigned char *) s1; + const unsigned char *p2 = (const unsigned char *) s2; + unsigned char c1, c2; + + if (p1 == p2) + return 0; + + do + { + c1 = TOLOWER (*p1); + c2 = TOLOWER (*p2); + + if (c1 == '\0') + break; + + ++p1; + ++p2; + } + while (c1 == c2); + + if (UCHAR_MAX <= INT_MAX) + return c1 - c2; + else + /* On machines where 'char' and 'int' are types of the same size, the + difference of two 'unsigned char' values - including the sign bit - + doesn't fit in an 'int'. */ + return (c1 > c2 ? 1 : c1 < c2 ? -1 : 0); +} diff -Nru libdap-3.11.1/gl/streq.h libdap-3.12.0/gl/streq.h --- libdap-3.11.1/gl/streq.h 2011-04-29 13:19:36.000000000 +0000 +++ libdap-3.12.0/gl/streq.h 2013-10-17 21:27:40.000000000 +0000 @@ -1,5 +1,5 @@ /* Optimized string comparison. - Copyright (C) 2001-2002, 2007, 2009-2011 Free Software Foundation, Inc. + Copyright (C) 2001-2002, 2007, 2009-2012 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published @@ -21,8 +21,8 @@ #include -/* STREQ allows to optimize string comparison with a small literal string. - STREQ (s, "EUC-KR", 'E', 'U', 'C', '-', 'K', 'R', 0, 0, 0) +/* STREQ_OPT allows to optimize string comparison with a small literal string. + STREQ_OPT (s, "EUC-KR", 'E', 'U', 'C', '-', 'K', 'R', 0, 0, 0) is semantically equivalent to strcmp (s, "EUC-KR") == 0 just faster. */ @@ -163,12 +163,12 @@ return 0; } -#define STREQ(s1,s2,s20,s21,s22,s23,s24,s25,s26,s27,s28) \ +#define STREQ_OPT(s1,s2,s20,s21,s22,s23,s24,s25,s26,s27,s28) \ streq0 (s1, s2, s20, s21, s22, s23, s24, s25, s26, s27, s28) #else -#define STREQ(s1,s2,s20,s21,s22,s23,s24,s25,s26,s27,s28) \ +#define STREQ_OPT(s1,s2,s20,s21,s22,s23,s24,s25,s26,s27,s28) \ (strcmp (s1, s2) == 0) #endif diff -Nru libdap-3.11.1/gl/strings.in.h libdap-3.12.0/gl/strings.in.h --- libdap-3.11.1/gl/strings.in.h 1970-01-01 00:00:00.000000000 +0000 +++ libdap-3.12.0/gl/strings.in.h 2013-10-17 21:27:40.000000000 +0000 @@ -0,0 +1,122 @@ +/* A substitute . + + Copyright (C) 2007-2012 Free Software Foundation, Inc. + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU Lesser General Public License as published by + the Free Software Foundation; either version 2, 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 Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public License + along with this program; if not, see . */ + +#ifndef _@GUARD_PREFIX@_STRINGS_H + +#if __GNUC__ >= 3 +@PRAGMA_SYSTEM_HEADER@ +#endif +@PRAGMA_COLUMNS@ + +/* Minix 3.1.8 has a bug: must be included before . + But avoid namespace pollution on glibc systems. */ +#if defined __minix && !defined __GLIBC__ +# include +#endif + +/* The include_next requires a split double-inclusion guard. */ +#if @HAVE_STRINGS_H@ +# @INCLUDE_NEXT@ @NEXT_STRINGS_H@ +#endif + +#ifndef _@GUARD_PREFIX@_STRINGS_H +#define _@GUARD_PREFIX@_STRINGS_H + +#if ! @HAVE_DECL_STRNCASECMP@ +/* Get size_t. */ +# include +#endif + + +/* The definitions of _GL_FUNCDECL_RPL etc. are copied here. */ + +/* The definition of _GL_ARG_NONNULL is copied here. */ + +/* The definition of _GL_WARN_ON_USE is copied here. */ + +#ifdef __cplusplus +extern "C" { +#endif + + + /* Find the index of the least-significant set bit. */ +#if @GNULIB_FFS@ +# if !@HAVE_FFS@ +_GL_FUNCDECL_SYS (ffs, int, (int i)); +# endif +_GL_CXXALIAS_SYS (ffs, int, (int i)); +_GL_CXXALIASWARN (ffs); +#elif defined GNULIB_POSIXCHECK +# undef ffs +# if HAVE_RAW_DECL_FFS +_GL_WARN_ON_USE (ffs, "ffs is not portable - use the ffs module"); +# endif +#endif + +/* Compare strings S1 and S2, ignoring case, returning less than, equal to or + greater than zero if S1 is lexicographically less than, equal to or greater + than S2. + Note: This function does not work in multibyte locales. */ +#if ! @HAVE_STRCASECMP@ +extern int strcasecmp (char const *s1, char const *s2) + _GL_ARG_NONNULL ((1, 2)); +#endif +#if defined GNULIB_POSIXCHECK +/* strcasecmp() does not work with multibyte strings: + POSIX says that it operates on "strings", and "string" in POSIX is defined + as a sequence of bytes, not of characters. */ +# undef strcasecmp +# if HAVE_RAW_DECL_STRCASECMP +_GL_WARN_ON_USE (strcasecmp, "strcasecmp cannot work correctly on character " + "strings in multibyte locales - " + "use mbscasecmp if you care about " + "internationalization, or use c_strcasecmp , " + "gnulib module c-strcase) if you want a locale " + "independent function"); +# endif +#endif + +/* Compare no more than N bytes of strings S1 and S2, ignoring case, + returning less than, equal to or greater than zero if S1 is + lexicographically less than, equal to or greater than S2. + Note: This function cannot work correctly in multibyte locales. */ +#if ! @HAVE_DECL_STRNCASECMP@ +extern int strncasecmp (char const *s1, char const *s2, size_t n) + _GL_ARG_NONNULL ((1, 2)); +#endif +#if defined GNULIB_POSIXCHECK +/* strncasecmp() does not work with multibyte strings: + POSIX says that it operates on "strings", and "string" in POSIX is defined + as a sequence of bytes, not of characters. */ +# undef strncasecmp +# if HAVE_RAW_DECL_STRNCASECMP +_GL_WARN_ON_USE (strncasecmp, "strncasecmp cannot work correctly on character " + "strings in multibyte locales - " + "use mbsncasecmp or mbspcasecmp if you care about " + "internationalization, or use c_strncasecmp , " + "gnulib module c-strcase) if you want a locale " + "independent function"); +# endif +#endif + + +#ifdef __cplusplus +} +#endif + +#endif /* _@GUARD_PREFIX@_STRING_H */ +#endif /* _@GUARD_PREFIX@_STRING_H */ diff -Nru libdap-3.11.1/gl/strncasecmp.c libdap-3.12.0/gl/strncasecmp.c --- libdap-3.11.1/gl/strncasecmp.c 1970-01-01 00:00:00.000000000 +0000 +++ libdap-3.12.0/gl/strncasecmp.c 2013-10-17 21:27:40.000000000 +0000 @@ -0,0 +1,62 @@ +/* strncasecmp.c -- case insensitive string comparator + Copyright (C) 1998-1999, 2005-2007, 2009-2012 Free Software Foundation, Inc. + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU Lesser General Public License as published by + the Free Software Foundation; either version 2, 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 Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public License + along with this program; if not, see . */ + +#include + +/* Specification. */ +#include + +#include +#include + +#define TOLOWER(Ch) (isupper (Ch) ? tolower (Ch) : (Ch)) + +/* Compare no more than N bytes of strings S1 and S2, ignoring case, + returning less than, equal to or greater than zero if S1 is + lexicographically less than, equal to or greater than S2. + Note: This function cannot work correctly in multibyte locales. */ + +int +strncasecmp (const char *s1, const char *s2, size_t n) +{ + register const unsigned char *p1 = (const unsigned char *) s1; + register const unsigned char *p2 = (const unsigned char *) s2; + unsigned char c1, c2; + + if (p1 == p2 || n == 0) + return 0; + + do + { + c1 = TOLOWER (*p1); + c2 = TOLOWER (*p2); + + if (--n == 0 || c1 == '\0') + break; + + ++p1; + ++p2; + } + while (c1 == c2); + + if (UCHAR_MAX <= INT_MAX) + return c1 - c2; + else + /* On machines where 'char' and 'int' are types of the same size, the + difference of two 'unsigned char' values - including the sign bit - + doesn't fit in an 'int'. */ + return (c1 > c2 ? 1 : c1 < c2 ? -1 : 0); +} diff -Nru libdap-3.11.1/gl/sys_types.in.h libdap-3.12.0/gl/sys_types.in.h --- libdap-3.11.1/gl/sys_types.in.h 1970-01-01 00:00:00.000000000 +0000 +++ libdap-3.12.0/gl/sys_types.in.h 2013-10-17 21:27:40.000000000 +0000 @@ -0,0 +1,51 @@ +/* Provide a more complete sys/types.h. + + Copyright (C) 2011-2012 Free Software Foundation, Inc. + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU Lesser General Public License as published by + the Free Software Foundation; either version 2, 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 Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public License + along with this program; if not, see . */ + +#if __GNUC__ >= 3 +@PRAGMA_SYSTEM_HEADER@ +#endif +@PRAGMA_COLUMNS@ + +#ifndef _@GUARD_PREFIX@_SYS_TYPES_H + +/* The include_next requires a split double-inclusion guard. */ +#@INCLUDE_NEXT@ @NEXT_SYS_TYPES_H@ + +#ifndef _@GUARD_PREFIX@_SYS_TYPES_H +#define _@GUARD_PREFIX@_SYS_TYPES_H + +/* Override off_t if Large File Support is requested on native Windows. */ +#if @WINDOWS_64_BIT_OFF_T@ +/* Same as int64_t in . */ +# if defined _MSC_VER +# define off_t __int64 +# else +# define off_t long long int +# endif +/* Indicator, for gnulib internal purposes. */ +# define _GL_WINDOWS_64_BIT_OFF_T 1 +#endif + +/* MSVC 9 defines size_t in , not in . */ +/* But avoid namespace pollution on glibc systems. */ +#if ((defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__) \ + && ! defined __GLIBC__ +# include +#endif + +#endif /* _@GUARD_PREFIX@_SYS_TYPES_H */ +#endif /* _@GUARD_PREFIX@_SYS_TYPES_H */ diff -Nru libdap-3.11.1/gl/unistd.in.h libdap-3.12.0/gl/unistd.in.h --- libdap-3.11.1/gl/unistd.in.h 2011-04-29 13:19:36.000000000 +0000 +++ libdap-3.12.0/gl/unistd.in.h 2013-10-17 21:27:40.000000000 +0000 @@ -1,5 +1,5 @@ /* Substitute for and wrapper around . - Copyright (C) 2003-2011 Free Software Foundation, Inc. + Copyright (C) 2003-2012 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by @@ -12,8 +12,7 @@ GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License - along with this program; if not, write to the Free Software Foundation, - Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ + along with this program; if not, see . */ #if __GNUC__ >= 3 @PRAGMA_SYSTEM_HEADER@ @@ -36,7 +35,7 @@ # define _GL_WINSOCK2_H_WITNESS /* Normal invocation. */ -#elif !defined _GL_UNISTD_H +#elif !defined _@GUARD_PREFIX@_UNISTD_H /* The include_next requires a split double-inclusion guard. */ #if @HAVE_UNISTD_H@ @@ -51,8 +50,8 @@ # undef _GL_INCLUDING_WINSOCK2_H #endif -#if !defined _GL_UNISTD_H && !defined _GL_INCLUDING_WINSOCK2_H -#define _GL_UNISTD_H +#if !defined _@GUARD_PREFIX@_UNISTD_H && !defined _GL_INCLUDING_WINSOCK2_H +#define _@GUARD_PREFIX@_UNISTD_H /* NetBSD 5.0 mis-defines NULL. Also get size_t. */ #include @@ -75,16 +74,27 @@ #endif /* mingw fails to declare _exit in . */ -/* mingw, BeOS, Haiku declare environ in , not in . */ +/* mingw, MSVC, BeOS, Haiku declare environ in , not in + . */ /* Solaris declares getcwd not only in but also in . */ /* But avoid namespace pollution on glibc systems. */ #ifndef __GLIBC__ # include #endif -/* mingw declares getcwd in , not in . */ -#if ((@GNULIB_GETCWD@ || defined GNULIB_POSIXCHECK) \ +/* Native Windows platforms declare chdir, getcwd, rmdir in + and/or , not in . + They also declare access(), chmod(), close(), dup(), dup2(), isatty(), + lseek(), read(), unlink(), write() in . */ +#if ((@GNULIB_CHDIR@ || @GNULIB_GETCWD@ || @GNULIB_RMDIR@ \ + || defined GNULIB_POSIXCHECK) \ && ((defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__)) +# include /* mingw32, mingw64 */ +# include /* mingw64, MSVC 9 */ +#elif (@GNULIB_CLOSE@ || @GNULIB_DUP@ || @GNULIB_DUP2@ || @GNULIB_ISATTY@ \ + || @GNULIB_LSEEK@ || @GNULIB_READ@ || @GNULIB_UNLINK@ || @GNULIB_WRITE@ \ + || defined GNULIB_POSIXCHECK) \ + && ((defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__) # include #endif @@ -97,7 +107,15 @@ # include #endif -#if (@GNULIB_WRITE@ || @GNULIB_READLINK@ || @GNULIB_READLINKAT@ \ +/* MSVC defines off_t in . + May also define off_t to a 64-bit type on native Windows. */ +#if !@HAVE_UNISTD_H@ || @WINDOWS_64_BIT_OFF_T@ +/* Get off_t. */ +# include +#endif + +#if (@GNULIB_READ@ || @GNULIB_WRITE@ \ + || @GNULIB_READLINK@ || @GNULIB_READLINKAT@ \ || @GNULIB_PREAD@ || @GNULIB_PWRITE@ || defined GNULIB_POSIXCHECK) /* Get ssize_t. */ # include @@ -116,78 +134,77 @@ /* The definition of _GL_WARN_ON_USE is copied here. */ -#if @GNULIB_GETHOSTNAME@ -/* Get all possible declarations of gethostname(). */ -# if @UNISTD_H_HAVE_WINSOCK2_H@ -# if !defined _GL_SYS_SOCKET_H -# if !(defined __cplusplus && defined GNULIB_NAMESPACE) -# undef socket -# define socket socket_used_without_including_sys_socket_h -# undef connect -# define connect connect_used_without_including_sys_socket_h -# undef accept -# define accept accept_used_without_including_sys_socket_h -# undef bind -# define bind bind_used_without_including_sys_socket_h -# undef getpeername -# define getpeername getpeername_used_without_including_sys_socket_h -# undef getsockname -# define getsockname getsockname_used_without_including_sys_socket_h -# undef getsockopt -# define getsockopt getsockopt_used_without_including_sys_socket_h -# undef listen -# define listen listen_used_without_including_sys_socket_h -# undef recv -# define recv recv_used_without_including_sys_socket_h -# undef send -# define send send_used_without_including_sys_socket_h -# undef recvfrom -# define recvfrom recvfrom_used_without_including_sys_socket_h -# undef sendto -# define sendto sendto_used_without_including_sys_socket_h -# undef setsockopt -# define setsockopt setsockopt_used_without_including_sys_socket_h -# undef shutdown -# define shutdown shutdown_used_without_including_sys_socket_h -# else - _GL_WARN_ON_USE (socket, - "socket() used without including "); - _GL_WARN_ON_USE (connect, - "connect() used without including "); - _GL_WARN_ON_USE (accept, - "accept() used without including "); - _GL_WARN_ON_USE (bind, - "bind() used without including "); - _GL_WARN_ON_USE (getpeername, - "getpeername() used without including "); - _GL_WARN_ON_USE (getsockname, - "getsockname() used without including "); - _GL_WARN_ON_USE (getsockopt, - "getsockopt() used without including "); - _GL_WARN_ON_USE (listen, - "listen() used without including "); - _GL_WARN_ON_USE (recv, - "recv() used without including "); - _GL_WARN_ON_USE (send, - "send() used without including "); - _GL_WARN_ON_USE (recvfrom, - "recvfrom() used without including "); - _GL_WARN_ON_USE (sendto, - "sendto() used without including "); - _GL_WARN_ON_USE (setsockopt, - "setsockopt() used without including "); - _GL_WARN_ON_USE (shutdown, - "shutdown() used without including "); -# endif +/* Hide some function declarations from . */ + +#if @GNULIB_GETHOSTNAME@ && @UNISTD_H_HAVE_WINSOCK2_H@ +# if !defined _@GUARD_PREFIX@_SYS_SOCKET_H +# if !(defined __cplusplus && defined GNULIB_NAMESPACE) +# undef socket +# define socket socket_used_without_including_sys_socket_h +# undef connect +# define connect connect_used_without_including_sys_socket_h +# undef accept +# define accept accept_used_without_including_sys_socket_h +# undef bind +# define bind bind_used_without_including_sys_socket_h +# undef getpeername +# define getpeername getpeername_used_without_including_sys_socket_h +# undef getsockname +# define getsockname getsockname_used_without_including_sys_socket_h +# undef getsockopt +# define getsockopt getsockopt_used_without_including_sys_socket_h +# undef listen +# define listen listen_used_without_including_sys_socket_h +# undef recv +# define recv recv_used_without_including_sys_socket_h +# undef send +# define send send_used_without_including_sys_socket_h +# undef recvfrom +# define recvfrom recvfrom_used_without_including_sys_socket_h +# undef sendto +# define sendto sendto_used_without_including_sys_socket_h +# undef setsockopt +# define setsockopt setsockopt_used_without_including_sys_socket_h +# undef shutdown +# define shutdown shutdown_used_without_including_sys_socket_h +# else + _GL_WARN_ON_USE (socket, + "socket() used without including "); + _GL_WARN_ON_USE (connect, + "connect() used without including "); + _GL_WARN_ON_USE (accept, + "accept() used without including "); + _GL_WARN_ON_USE (bind, + "bind() used without including "); + _GL_WARN_ON_USE (getpeername, + "getpeername() used without including "); + _GL_WARN_ON_USE (getsockname, + "getsockname() used without including "); + _GL_WARN_ON_USE (getsockopt, + "getsockopt() used without including "); + _GL_WARN_ON_USE (listen, + "listen() used without including "); + _GL_WARN_ON_USE (recv, + "recv() used without including "); + _GL_WARN_ON_USE (send, + "send() used without including "); + _GL_WARN_ON_USE (recvfrom, + "recvfrom() used without including "); + _GL_WARN_ON_USE (sendto, + "sendto() used without including "); + _GL_WARN_ON_USE (setsockopt, + "setsockopt() used without including "); + _GL_WARN_ON_USE (shutdown, + "shutdown() used without including "); # endif -# if !defined _GL_SYS_SELECT_H -# if !(defined __cplusplus && defined GNULIB_NAMESPACE) -# undef select -# define select select_used_without_including_sys_select_h -# else - _GL_WARN_ON_USE (select, - "select() used without including "); -# endif +# endif +# if !defined _@GUARD_PREFIX@_SYS_SELECT_H +# if !(defined __cplusplus && defined GNULIB_NAMESPACE) +# undef select +# define select select_used_without_including_sys_select_h +# else + _GL_WARN_ON_USE (select, + "select() used without including "); # endif # endif #endif @@ -223,12 +240,24 @@ #endif +#if @GNULIB_CHDIR@ +_GL_CXXALIAS_SYS (chdir, int, (const char *file) _GL_ARG_NONNULL ((1))); +_GL_CXXALIASWARN (chdir); +#elif defined GNULIB_POSIXCHECK +# undef chdir +# if HAVE_RAW_DECL_CHDIR +_GL_WARN_ON_USE (chown, "chdir is not always in - " + "use gnulib module chdir for portability"); +# endif +#endif + + #if @GNULIB_CHOWN@ /* Change the owner of FILE to UID (if UID is not -1) and the group of FILE to GID (if GID is not -1). Follow symbolic links. Return 0 if successful, otherwise -1 and errno set. - See the POSIX:2001 specification - . */ + See the POSIX:2008 specification + . */ + See the POSIX:2008 specification + . */ # if @REPLACE_DUP2@ # if !(defined __cplusplus && defined GNULIB_NAMESPACE) # define dup2 rpl_dup2 @@ -425,8 +462,8 @@ /* Change the process' current working directory to the directory on which the given file descriptor is open. Return 0 if successful, otherwise -1 and errno set. - See the POSIX:2001 specification - . */ + See the POSIX:2008 specification + . */ # if ! @HAVE_FCHDIR@ _GL_FUNCDECL_SYS (fchdir, int, (int /*fd*/)); @@ -483,11 +520,30 @@ #endif -#if @GNULIB_FSYNC@ +#if @GNULIB_FDATASYNC@ /* Synchronize changes to a file. Return 0 if successful, otherwise -1 and errno set. - See POSIX:2001 specification - . */ + See POSIX:2008 specification + . */ +# if !@HAVE_FDATASYNC@ || !@HAVE_DECL_FDATASYNC@ +_GL_FUNCDECL_SYS (fdatasync, int, (int fd)); +# endif +_GL_CXXALIAS_SYS (fdatasync, int, (int fd)); +_GL_CXXALIASWARN (fdatasync); +#elif defined GNULIB_POSIXCHECK +# undef fdatasync +# if HAVE_RAW_DECL_FDATASYNC +_GL_WARN_ON_USE (fdatasync, "fdatasync is unportable - " + "use gnulib module fdatasync for portability"); +# endif +#endif + + +#if @GNULIB_FSYNC@ +/* Synchronize changes, including metadata, to a file. + Return 0 if successful, otherwise -1 and errno set. + See POSIX:2008 specification + . */ # if !@HAVE_FSYNC@ _GL_FUNCDECL_SYS (fsync, int, (int fd)); # endif @@ -505,12 +561,21 @@ #if @GNULIB_FTRUNCATE@ /* Change the size of the file to which FD is opened to become equal to LENGTH. Return 0 if successful, otherwise -1 and errno set. - See the POSIX:2001 specification - . */ -# if !@HAVE_FTRUNCATE@ + See the POSIX:2008 specification + . */ +# if @REPLACE_FTRUNCATE@ +# if !(defined __cplusplus && defined GNULIB_NAMESPACE) +# undef ftruncate +# define ftruncate rpl_ftruncate +# endif +_GL_FUNCDECL_RPL (ftruncate, int, (int fd, off_t length)); +_GL_CXXALIAS_RPL (ftruncate, int, (int fd, off_t length)); +# else +# if !@HAVE_FTRUNCATE@ _GL_FUNCDECL_SYS (ftruncate, int, (int fd, off_t length)); -# endif +# endif _GL_CXXALIAS_SYS (ftruncate, int, (int fd, off_t length)); +# endif _GL_CXXALIASWARN (ftruncate); #elif defined GNULIB_POSIXCHECK # undef ftruncate @@ -526,8 +591,8 @@ of BUF. Return BUF if successful, or NULL if the directory couldn't be determined or SIZE was too small. - See the POSIX:2001 specification - . + See the POSIX:2008 specification + . Additionally, the gnulib module 'getcwd' guarantees the following GNU extension: If BUF is NULL, an array is allocated with 'malloc'; the array is SIZE bytes long, unless SIZE == 0, in which case it is as big as @@ -796,11 +861,14 @@ # if !(defined __cplusplus && defined GNULIB_NAMESPACE) # define getpagesize() _gl_getpagesize () # else +# if !GNULIB_defined_getpagesize_function static inline int getpagesize () { return _gl_getpagesize (); } +# define GNULIB_defined_getpagesize_function 1 +# endif # endif # endif # endif @@ -867,12 +935,49 @@ #endif +#if @GNULIB_GROUP_MEMBER@ +/* Determine whether group id is in calling user's group list. */ +# if !@HAVE_GROUP_MEMBER@ +_GL_FUNCDECL_SYS (group_member, int, (gid_t gid)); +# endif +_GL_CXXALIAS_SYS (group_member, int, (gid_t gid)); +_GL_CXXALIASWARN (group_member); +#elif defined GNULIB_POSIXCHECK +# undef group_member +# if HAVE_RAW_DECL_GROUP_MEMBER +_GL_WARN_ON_USE (group_member, "group_member is unportable - " + "use gnulib module group-member for portability"); +# endif +#endif + + +#if @GNULIB_ISATTY@ +# if @REPLACE_ISATTY@ +# if !(defined __cplusplus && defined GNULIB_NAMESPACE) +# undef isatty +# define isatty rpl_isatty +# endif +_GL_FUNCDECL_RPL (isatty, int, (int fd)); +_GL_CXXALIAS_RPL (isatty, int, (int fd)); +# else +_GL_CXXALIAS_SYS (isatty, int, (int fd)); +# endif +_GL_CXXALIASWARN (isatty); +#elif defined GNULIB_POSIXCHECK +# undef isatty +# if HAVE_RAW_DECL_ISATTY +_GL_WARN_ON_USE (isatty, "isatty has portability problems on native Windows - " + "use gnulib module isatty for portability"); +# endif +#endif + + #if @GNULIB_LCHOWN@ /* Change the owner of FILE to UID (if UID is not -1) and the group of FILE to GID (if GID is not -1). Do not follow symbolic links. Return 0 if successful, otherwise -1 and errno set. - See the POSIX:2001 specification - . */ + See the POSIX:2008 specification + . */ # if @REPLACE_LCHOWN@ # if !(defined __cplusplus && defined GNULIB_NAMESPACE) # undef lchown @@ -901,8 +1006,8 @@ #if @GNULIB_LINK@ /* Create a new hard link for an existing file. Return 0 if successful, otherwise -1 and errno set. - See POSIX:2001 specification - . */ + See POSIX:2008 specification + . */ # if @REPLACE_LINK@ # if !(defined __cplusplus && defined GNULIB_NAMESPACE) # define link rpl_link @@ -967,8 +1072,8 @@ #if @GNULIB_LSEEK@ /* Set the offset of FD relative to SEEK_SET, SEEK_CUR, or SEEK_END. Return the new offset if successful, otherwise -1 and errno set. - See the POSIX:2001 specification - . */ + See the POSIX:2008 specification + . */ # if @REPLACE_LSEEK@ # if !(defined __cplusplus && defined GNULIB_NAMESPACE) # define lseek rpl_lseek @@ -1038,10 +1143,12 @@ #if @GNULIB_PREAD@ /* Read at most BUFSIZE bytes from FD into BUF, starting at OFFSET. Return the number of bytes placed into BUF if successful, otherwise - set errno and return -1. 0 indicates EOF. See the POSIX:2001 - specification . */ + set errno and return -1. 0 indicates EOF. + See the POSIX:2008 specification + . */ # if @REPLACE_PREAD@ # if !(defined __cplusplus && defined GNULIB_NAMESPACE) +# undef pread # define pread rpl_pread # endif _GL_FUNCDECL_RPL (pread, ssize_t, @@ -1072,10 +1179,11 @@ /* Write at most BUFSIZE bytes from BUF into FD, starting at OFFSET. Return the number of bytes written if successful, otherwise set errno and return -1. 0 indicates nothing written. See the - POSIX:2001 specification - . */ + POSIX:2008 specification + . */ # if @REPLACE_PWRITE@ # if !(defined __cplusplus && defined GNULIB_NAMESPACE) +# undef pwrite # define pwrite rpl_pwrite # endif _GL_FUNCDECL_RPL (pwrite, ssize_t, @@ -1102,12 +1210,34 @@ #endif +#if @GNULIB_READ@ +/* Read up to COUNT bytes from file descriptor FD into the buffer starting + at BUF. See the POSIX:2008 specification + . */ +# if @REPLACE_READ@ +# if !(defined __cplusplus && defined GNULIB_NAMESPACE) +# undef read +# define read rpl_read +# endif +_GL_FUNCDECL_RPL (read, ssize_t, (int fd, void *buf, size_t count) + _GL_ARG_NONNULL ((2))); +_GL_CXXALIAS_RPL (read, ssize_t, (int fd, void *buf, size_t count)); +# else +/* Need to cast, because on mingw, the third parameter is + unsigned int count + and the return type is 'int'. */ +_GL_CXXALIAS_SYS_CAST (read, ssize_t, (int fd, void *buf, size_t count)); +# endif +_GL_CXXALIASWARN (read); +#endif + + #if @GNULIB_READLINK@ /* Read the contents of the symbolic link FILE and place the first BUFSIZE bytes of it into BUF. Return the number of bytes placed into BUF if successful, otherwise -1 and errno set. - See the POSIX:2001 specification - . */ + See the POSIX:2008 specification + . */ # if @REPLACE_READLINK@ # if !(defined __cplusplus && defined GNULIB_NAMESPACE) # define readlink rpl_readlink @@ -1175,11 +1305,38 @@ #endif +#if @GNULIB_SETHOSTNAME@ +/* Set the host name of the machine. + The host name may or may not be fully qualified. + + Put LEN bytes of NAME into the host name. + Return 0 if successful, otherwise, set errno and return -1. + + Platforms with no ability to set the hostname return -1 and set + errno = ENOSYS. */ +# if !@HAVE_SETHOSTNAME@ || !@HAVE_DECL_SETHOSTNAME@ +_GL_FUNCDECL_SYS (sethostname, int, (const char *name, size_t len) + _GL_ARG_NONNULL ((1))); +# endif +/* Need to cast, because on Solaris 11 2011-10, Mac OS X 10.5, IRIX 6.5 + and FreeBSD 6.4 the second parameter is int. On Solaris 11 + 2011-10, the first parameter is not const. */ +_GL_CXXALIAS_SYS_CAST (sethostname, int, (const char *name, size_t len)); +_GL_CXXALIASWARN (sethostname); +#elif defined GNULIB_POSIXCHECK +# undef sethostname +# if HAVE_RAW_DECL_SETHOSTNAME +_GL_WARN_ON_USE (sethostname, "sethostname is unportable - " + "use gnulib module sethostname for portability"); +# endif +#endif + + #if @GNULIB_SLEEP@ /* Pause the execution of the current thread for N seconds. Returns the number of seconds left to sleep. - See the POSIX:2001 specification - . */ + See the POSIX:2008 specification + . */ # if @REPLACE_SLEEP@ # if !(defined __cplusplus && defined GNULIB_NAMESPACE) # undef sleep @@ -1328,7 +1485,7 @@ /* Pause the execution of the current thread for N microseconds. Returns 0 on completion, or -1 on range error. See the POSIX:2001 specification - . */ + . */ # if @REPLACE_USLEEP@ # if !(defined __cplusplus && defined GNULIB_NAMESPACE) # undef usleep @@ -1354,9 +1511,9 @@ #if @GNULIB_WRITE@ /* Write up to COUNT bytes starting at BUF to file descriptor FD. - See the POSIX:2001 specification - . */ -# if @REPLACE_WRITE@ && @GNULIB_UNISTD_H_SIGPIPE@ + See the POSIX:2008 specification + . */ +# if @REPLACE_WRITE@ # if !(defined __cplusplus && defined GNULIB_NAMESPACE) # undef write # define write rpl_write @@ -1374,5 +1531,5 @@ #endif -#endif /* _GL_UNISTD_H */ -#endif /* _GL_UNISTD_H */ +#endif /* _@GUARD_PREFIX@_UNISTD_H */ +#endif /* _@GUARD_PREFIX@_UNISTD_H */ diff -Nru libdap-3.11.1/gl/verify.h libdap-3.12.0/gl/verify.h --- libdap-3.11.1/gl/verify.h 2011-04-29 13:19:36.000000000 +0000 +++ libdap-3.12.0/gl/verify.h 2013-10-17 21:27:40.000000000 +0000 @@ -1,6 +1,6 @@ /* Compile-time assert-like macros. - Copyright (C) 2005-2006, 2009-2011 Free Software Foundation, Inc. + Copyright (C) 2005-2006, 2009-2012 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by @@ -17,21 +17,39 @@ /* Written by Paul Eggert, Bruno Haible, and Jim Meyering. */ -#ifndef VERIFY_H -# define VERIFY_H 1 +#ifndef _GL_VERIFY_H +# define _GL_VERIFY_H + + +/* Define _GL_HAVE__STATIC_ASSERT to 1 if _Static_assert works as per C11. + This is supported by GCC 4.6.0 and later, in C mode, and its use + here generates easier-to-read diagnostics when verify (R) fails. + + Define _GL_HAVE_STATIC_ASSERT to 1 if static_assert works as per C++11. + This will likely be supported by future GCC versions, in C++ mode. + + Use this only with GCC. If we were willing to slow 'configure' + down we could also use it with other compilers, but since this + affects only the quality of diagnostics, why bother? */ +# if (4 < __GNUC__ || (__GNUC__ == 4 && 6 <= __GNUC_MINOR__)) && !defined __cplusplus +# define _GL_HAVE__STATIC_ASSERT 1 +# endif +/* The condition (99 < __GNUC__) is temporary, until we know about the + first G++ release that supports static_assert. */ +# if (99 < __GNUC__) && defined __cplusplus +# define _GL_HAVE_STATIC_ASSERT 1 +# endif /* Each of these macros verifies that its argument R is nonzero. To be portable, R should be an integer constant expression. Unlike assert (R), there is no run-time overhead. - There are two macros, since no single macro can be used in all - contexts in C. verify_true (R) is for scalar contexts, including - integer constant expression contexts. verify (R) is for declaration - contexts, e.g., the top level. + If _Static_assert works, verify (R) uses it directly. Similarly, + _GL_VERIFY_TRUE works by packaging a _Static_assert inside a struct + that is an operand of sizeof. - Symbols ending in "__" are private to this header. - - The code below uses several ideas. + The code below uses several ideas for C++ compilers, and for C + compilers that do not support _Static_assert: * The first step is ((R) ? 1 : -1). Given an expression R, of integral or boolean or floating-point type, this yields an @@ -39,7 +57,9 @@ constant and nonnegative. * Next this expression W is wrapped in a type - struct verify_type__ { unsigned int verify_error_if_negative_size__: W; }. + struct _gl_verify_type { + unsigned int _gl_verify_error_if_negative: W; + }. If W is negative, this yields a compile-time error. No compiler can deal with a bit-field of negative size. @@ -53,7 +73,7 @@ void function (int n) { verify (n < 0); } - * For the verify macro, the struct verify_type__ will need to + * For the verify macro, the struct _gl_verify_type will need to somehow be embedded into a declaration. To be portable, this declaration must declare an object, a constant, a function, or a typedef name. If the declared entity uses the type directly, @@ -91,11 +111,11 @@ Which of the following alternatives can be used? extern int dummy [sizeof (struct {...})]; - extern int dummy [sizeof (struct verify_type__ {...})]; + extern int dummy [sizeof (struct _gl_verify_type {...})]; extern void dummy (int [sizeof (struct {...})]); - extern void dummy (int [sizeof (struct verify_type__ {...})]); + extern void dummy (int [sizeof (struct _gl_verify_type {...})]); extern int (*dummy (void)) [sizeof (struct {...})]; - extern int (*dummy (void)) [sizeof (struct verify_type__ {...})]; + extern int (*dummy (void)) [sizeof (struct _gl_verify_type {...})]; In the second and sixth case, the struct type is exported to the outer scope; two such declarations therefore collide. GCC warns @@ -109,15 +129,9 @@ __COUNTER__ macro that can let us generate unique identifiers for each dummy function, to suppress this warning. - * This implementation exploits the fact that GCC does not warn about - the last declaration mentioned above. If a future version of GCC - introduces a warning for this, the problem could be worked around - by using code specialized to GCC, just as __COUNTER__ is already - being used if available. - - #if 4 <= __GNUC__ - # define verify(R) [another version to keep GCC happy] - #endif + * This implementation exploits the fact that older versions of GCC, + which do not support _Static_assert, also do not warn about the + last declaration mentioned above. * In C++, any struct definition inside sizeof is invalid. Use a template type to work around the problem. */ @@ -140,24 +154,88 @@ possible. */ # define _GL_GENSYM(prefix) _GL_CONCAT (prefix, _GL_COUNTER) -/* Verify requirement R at compile-time, as an integer constant expression. - Return 1. */ +/* Verify requirement R at compile-time, as an integer constant expression + that returns 1. If R is false, fail at compile-time, preferably + with a diagnostic that includes the string-literal DIAGNOSTIC. */ + +# define _GL_VERIFY_TRUE(R, DIAGNOSTIC) \ + (!!sizeof (_GL_VERIFY_TYPE (R, DIAGNOSTIC))) # ifdef __cplusplus +# if !GNULIB_defined_struct__gl_verify_type template - struct verify_type__ { unsigned int verify_error_if_negative_size__: w; }; -# define verify_true(R) \ - (!!sizeof (verify_type__<(R) ? 1 : -1>)) + struct _gl_verify_type { + unsigned int _gl_verify_error_if_negative: w; + }; +# define GNULIB_defined_struct__gl_verify_type 1 +# endif +# define _GL_VERIFY_TYPE(R, DIAGNOSTIC) \ + _gl_verify_type<(R) ? 1 : -1> +# elif defined _GL_HAVE__STATIC_ASSERT +# define _GL_VERIFY_TYPE(R, DIAGNOSTIC) \ + struct { \ + _Static_assert (R, DIAGNOSTIC); \ + int _gl_dummy; \ + } +# else +# define _GL_VERIFY_TYPE(R, DIAGNOSTIC) \ + struct { unsigned int _gl_verify_error_if_negative: (R) ? 1 : -1; } +# endif + +/* Verify requirement R at compile-time, as a declaration without a + trailing ';'. If R is false, fail at compile-time, preferably + with a diagnostic that includes the string-literal DIAGNOSTIC. + + Unfortunately, unlike C11, this implementation must appear as an + ordinary declaration, and cannot appear inside struct { ... }. */ + +# ifdef _GL_HAVE__STATIC_ASSERT +# define _GL_VERIFY _Static_assert # else -# define verify_true(R) \ - (!!sizeof \ - (struct { unsigned int verify_error_if_negative_size__: (R) ? 1 : -1; })) +# define _GL_VERIFY(R, DIAGNOSTIC) \ + extern int (*_GL_GENSYM (_gl_verify_function) (void)) \ + [_GL_VERIFY_TRUE (R, DIAGNOSTIC)] +# endif + +/* _GL_STATIC_ASSERT_H is defined if this code is copied into assert.h. */ +# ifdef _GL_STATIC_ASSERT_H +# if !defined _GL_HAVE__STATIC_ASSERT && !defined _Static_assert +# define _Static_assert(R, DIAGNOSTIC) _GL_VERIFY (R, DIAGNOSTIC) +# endif +# if !defined _GL_HAVE_STATIC_ASSERT && !defined static_assert +# define static_assert _Static_assert /* C11 requires this #define. */ +# endif # endif +/* @assert.h omit start@ */ + +/* Each of these macros verifies that its argument R is nonzero. To + be portable, R should be an integer constant expression. Unlike + assert (R), there is no run-time overhead. + + There are two macros, since no single macro can be used in all + contexts in C. verify_true (R) is for scalar contexts, including + integer constant expression contexts. verify (R) is for declaration + contexts, e.g., the top level. */ + +/* Verify requirement R at compile-time, as an integer constant expression. + Return 1. This is equivalent to verify_expr (R, 1). + + verify_true is obsolescent; please use verify_expr instead. */ + +# define verify_true(R) _GL_VERIFY_TRUE (R, "verify_true (" #R ")") + +/* Verify requirement R at compile-time. Return the value of the + expression E. */ + +# define verify_expr(R, E) \ + (_GL_VERIFY_TRUE (R, "verify_expr (" #R ", " #E ")") ? (E) : (E)) + /* Verify requirement R at compile-time, as a declaration without a trailing ';'. */ -# define verify(R) \ - extern int (* _GL_GENSYM (verify_function) (void)) [verify_true (R)] +# define verify(R) _GL_VERIFY (R, "verify (" #R ")") + +/* @assert.h omit end@ */ #endif diff -Nru libdap-3.11.1/gl/wchar.in.h libdap-3.12.0/gl/wchar.in.h --- libdap-3.11.1/gl/wchar.in.h 2011-04-29 13:19:36.000000000 +0000 +++ libdap-3.12.0/gl/wchar.in.h 2013-10-17 21:27:40.000000000 +0000 @@ -1,6 +1,6 @@ /* A substitute for ISO C99 , for platforms that have issues. - Copyright (C) 2007-2011 Free Software Foundation, Inc. + Copyright (C) 2007-2012 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by @@ -13,8 +13,7 @@ GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License - along with this program; if not, write to the Free Software Foundation, - Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ + along with this program; if not, see . */ /* Written by Eric Blake. */ @@ -49,7 +48,7 @@ #else /* Normal invocation convention. */ -#ifndef _GL_WCHAR_H +#ifndef _@GUARD_PREFIX@_WCHAR_H #define _GL_ALREADY_INCLUDING_WCHAR_H @@ -61,9 +60,13 @@ . BSD/OS 4.0.1 has a bug: , and must be included before . + In some builds of uClibc, is nonexistent and wchar_t is defined + by . But avoid namespace pollution on glibc systems. */ -#ifndef __GLIBC__ +#if !(defined __GLIBC__ && !defined __UCLIBC__) # include +#endif +#ifndef __GLIBC__ # include # include #endif @@ -77,8 +80,16 @@ #undef _GL_ALREADY_INCLUDING_WCHAR_H -#ifndef _GL_WCHAR_H -#define _GL_WCHAR_H +#ifndef _@GUARD_PREFIX@_WCHAR_H +#define _@GUARD_PREFIX@_WCHAR_H + +/* The __attribute__ feature is available in gcc versions 2.5 and later. + The attribute __pure__ was added in gcc 2.96. */ +#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 96) +# define _GL_ATTRIBUTE_PURE __attribute__ ((__pure__)) +#else +# define _GL_ATTRIBUTE_PURE /* empty */ +#endif /* The definitions of _GL_FUNCDECL_RPL etc. are copied here. */ @@ -94,6 +105,18 @@ # define WEOF -1 # endif #else +/* MSVC defines wint_t as 'unsigned short' in . + This is too small: ISO C 99 section 7.24.1.(2) says that wint_t must be + "unchanged by default argument promotions". Override it. */ +# if defined _MSC_VER +# if !GNULIB_defined_wint_t +# include +typedef unsigned int rpl_wint_t; +# undef wint_t +# define wint_t rpl_wint_t +# define GNULIB_defined_wint_t 1 +# endif +# endif # ifndef WEOF # define WEOF ((wint_t) -1) # endif @@ -104,10 +127,12 @@ On IRIX 6.5, sizeof (mbstate_t) == 1, which is not sufficient for implementing mbrtowc for encodings like UTF-8. */ #if !(@HAVE_MBSINIT@ && @HAVE_MBRTOWC@) || @REPLACE_MBSTATE_T@ +# if !GNULIB_defined_mbstate_t typedef int rpl_mbstate_t; -# undef mbstate_t -# define mbstate_t rpl_mbstate_t -# define GNULIB_defined_mbstate_t 1 +# undef mbstate_t +# define mbstate_t rpl_mbstate_t +# define GNULIB_defined_mbstate_t 1 +# endif #endif @@ -118,11 +143,11 @@ # undef btowc # define btowc rpl_btowc # endif -_GL_FUNCDECL_RPL (btowc, wint_t, (int c)); +_GL_FUNCDECL_RPL (btowc, wint_t, (int c) _GL_ATTRIBUTE_PURE); _GL_CXXALIAS_RPL (btowc, wint_t, (int c)); # else # if !@HAVE_BTOWC@ -_GL_FUNCDECL_SYS (btowc, wint_t, (int c)); +_GL_FUNCDECL_SYS (btowc, wint_t, (int c) _GL_ATTRIBUTE_PURE); # endif _GL_CXXALIAS_SYS (btowc, wint_t, (int c)); # endif @@ -143,12 +168,12 @@ # undef wctob # define wctob rpl_wctob # endif -_GL_FUNCDECL_RPL (wctob, int, (wint_t wc)); +_GL_FUNCDECL_RPL (wctob, int, (wint_t wc) _GL_ATTRIBUTE_PURE); _GL_CXXALIAS_RPL (wctob, int, (wint_t wc)); # else # if !defined wctob && !@HAVE_DECL_WCTOB@ /* wctob is provided by gnulib, or wctob exists but is not declared. */ -_GL_FUNCDECL_SYS (wctob, int, (wint_t wc)); +_GL_FUNCDECL_SYS (wctob, int, (wint_t wc) _GL_ATTRIBUTE_PURE); # endif _GL_CXXALIAS_SYS (wctob, int, (wint_t wc)); # endif @@ -409,12 +434,12 @@ # undef wcwidth # define wcwidth rpl_wcwidth # endif -_GL_FUNCDECL_RPL (wcwidth, int, (wchar_t)); +_GL_FUNCDECL_RPL (wcwidth, int, (wchar_t) _GL_ATTRIBUTE_PURE); _GL_CXXALIAS_RPL (wcwidth, int, (wchar_t)); # else # if !@HAVE_DECL_WCWIDTH@ /* wcwidth exists but is not declared. */ -_GL_FUNCDECL_SYS (wcwidth, int, (wchar_t)); +_GL_FUNCDECL_SYS (wcwidth, int, (wchar_t) _GL_ATTRIBUTE_PURE); # endif _GL_CXXALIAS_SYS (wcwidth, int, (wchar_t)); # endif @@ -428,6 +453,576 @@ #endif -#endif /* _GL_WCHAR_H */ -#endif /* _GL_WCHAR_H */ +/* Search N wide characters of S for C. */ +#if @GNULIB_WMEMCHR@ +# if !@HAVE_WMEMCHR@ +_GL_FUNCDECL_SYS (wmemchr, wchar_t *, (const wchar_t *s, wchar_t c, size_t n) + _GL_ATTRIBUTE_PURE); +# endif + /* On some systems, this function is defined as an overloaded function: + extern "C++" { + const wchar_t * std::wmemchr (const wchar_t *, wchar_t, size_t); + wchar_t * std::wmemchr (wchar_t *, wchar_t, size_t); + } */ +_GL_CXXALIAS_SYS_CAST2 (wmemchr, + wchar_t *, (const wchar_t *, wchar_t, size_t), + const wchar_t *, (const wchar_t *, wchar_t, size_t)); +# if ((__GLIBC__ == 2 && __GLIBC_MINOR__ >= 10) && !defined __UCLIBC__) \ + && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 4)) +_GL_CXXALIASWARN1 (wmemchr, wchar_t *, (wchar_t *s, wchar_t c, size_t n)); +_GL_CXXALIASWARN1 (wmemchr, const wchar_t *, + (const wchar_t *s, wchar_t c, size_t n)); +# else +_GL_CXXALIASWARN (wmemchr); +# endif +#elif defined GNULIB_POSIXCHECK +# undef wmemchr +# if HAVE_RAW_DECL_WMEMCHR +_GL_WARN_ON_USE (wmemchr, "wmemchr is unportable - " + "use gnulib module wmemchr for portability"); +# endif +#endif + + +/* Compare N wide characters of S1 and S2. */ +#if @GNULIB_WMEMCMP@ +# if !@HAVE_WMEMCMP@ +_GL_FUNCDECL_SYS (wmemcmp, int, + (const wchar_t *s1, const wchar_t *s2, size_t n) + _GL_ATTRIBUTE_PURE); +# endif +_GL_CXXALIAS_SYS (wmemcmp, int, + (const wchar_t *s1, const wchar_t *s2, size_t n)); +_GL_CXXALIASWARN (wmemcmp); +#elif defined GNULIB_POSIXCHECK +# undef wmemcmp +# if HAVE_RAW_DECL_WMEMCMP +_GL_WARN_ON_USE (wmemcmp, "wmemcmp is unportable - " + "use gnulib module wmemcmp for portability"); +# endif +#endif + + +/* Copy N wide characters of SRC to DEST. */ +#if @GNULIB_WMEMCPY@ +# if !@HAVE_WMEMCPY@ +_GL_FUNCDECL_SYS (wmemcpy, wchar_t *, + (wchar_t *dest, const wchar_t *src, size_t n)); +# endif +_GL_CXXALIAS_SYS (wmemcpy, wchar_t *, + (wchar_t *dest, const wchar_t *src, size_t n)); +_GL_CXXALIASWARN (wmemcpy); +#elif defined GNULIB_POSIXCHECK +# undef wmemcpy +# if HAVE_RAW_DECL_WMEMCPY +_GL_WARN_ON_USE (wmemcpy, "wmemcpy is unportable - " + "use gnulib module wmemcpy for portability"); +# endif +#endif + + +/* Copy N wide characters of SRC to DEST, guaranteeing correct behavior for + overlapping memory areas. */ +#if @GNULIB_WMEMMOVE@ +# if !@HAVE_WMEMMOVE@ +_GL_FUNCDECL_SYS (wmemmove, wchar_t *, + (wchar_t *dest, const wchar_t *src, size_t n)); +# endif +_GL_CXXALIAS_SYS (wmemmove, wchar_t *, + (wchar_t *dest, const wchar_t *src, size_t n)); +_GL_CXXALIASWARN (wmemmove); +#elif defined GNULIB_POSIXCHECK +# undef wmemmove +# if HAVE_RAW_DECL_WMEMMOVE +_GL_WARN_ON_USE (wmemmove, "wmemmove is unportable - " + "use gnulib module wmemmove for portability"); +# endif +#endif + + +/* Set N wide characters of S to C. */ +#if @GNULIB_WMEMSET@ +# if !@HAVE_WMEMSET@ +_GL_FUNCDECL_SYS (wmemset, wchar_t *, (wchar_t *s, wchar_t c, size_t n)); +# endif +_GL_CXXALIAS_SYS (wmemset, wchar_t *, (wchar_t *s, wchar_t c, size_t n)); +_GL_CXXALIASWARN (wmemset); +#elif defined GNULIB_POSIXCHECK +# undef wmemset +# if HAVE_RAW_DECL_WMEMSET +_GL_WARN_ON_USE (wmemset, "wmemset is unportable - " + "use gnulib module wmemset for portability"); +# endif +#endif + + +/* Return the number of wide characters in S. */ +#if @GNULIB_WCSLEN@ +# if !@HAVE_WCSLEN@ +_GL_FUNCDECL_SYS (wcslen, size_t, (const wchar_t *s) _GL_ATTRIBUTE_PURE); +# endif +_GL_CXXALIAS_SYS (wcslen, size_t, (const wchar_t *s)); +_GL_CXXALIASWARN (wcslen); +#elif defined GNULIB_POSIXCHECK +# undef wcslen +# if HAVE_RAW_DECL_WCSLEN +_GL_WARN_ON_USE (wcslen, "wcslen is unportable - " + "use gnulib module wcslen for portability"); +# endif +#endif + + +/* Return the number of wide characters in S, but at most MAXLEN. */ +#if @GNULIB_WCSNLEN@ +# if !@HAVE_WCSNLEN@ +_GL_FUNCDECL_SYS (wcsnlen, size_t, (const wchar_t *s, size_t maxlen) + _GL_ATTRIBUTE_PURE); +# endif +_GL_CXXALIAS_SYS (wcsnlen, size_t, (const wchar_t *s, size_t maxlen)); +_GL_CXXALIASWARN (wcsnlen); +#elif defined GNULIB_POSIXCHECK +# undef wcsnlen +# if HAVE_RAW_DECL_WCSNLEN +_GL_WARN_ON_USE (wcsnlen, "wcsnlen is unportable - " + "use gnulib module wcsnlen for portability"); +# endif +#endif + + +/* Copy SRC to DEST. */ +#if @GNULIB_WCSCPY@ +# if !@HAVE_WCSCPY@ +_GL_FUNCDECL_SYS (wcscpy, wchar_t *, (wchar_t *dest, const wchar_t *src)); +# endif +_GL_CXXALIAS_SYS (wcscpy, wchar_t *, (wchar_t *dest, const wchar_t *src)); +_GL_CXXALIASWARN (wcscpy); +#elif defined GNULIB_POSIXCHECK +# undef wcscpy +# if HAVE_RAW_DECL_WCSCPY +_GL_WARN_ON_USE (wcscpy, "wcscpy is unportable - " + "use gnulib module wcscpy for portability"); +# endif +#endif + + +/* Copy SRC to DEST, returning the address of the terminating L'\0' in DEST. */ +#if @GNULIB_WCPCPY@ +# if !@HAVE_WCPCPY@ +_GL_FUNCDECL_SYS (wcpcpy, wchar_t *, (wchar_t *dest, const wchar_t *src)); +# endif +_GL_CXXALIAS_SYS (wcpcpy, wchar_t *, (wchar_t *dest, const wchar_t *src)); +_GL_CXXALIASWARN (wcpcpy); +#elif defined GNULIB_POSIXCHECK +# undef wcpcpy +# if HAVE_RAW_DECL_WCPCPY +_GL_WARN_ON_USE (wcpcpy, "wcpcpy is unportable - " + "use gnulib module wcpcpy for portability"); +# endif +#endif + + +/* Copy no more than N wide characters of SRC to DEST. */ +#if @GNULIB_WCSNCPY@ +# if !@HAVE_WCSNCPY@ +_GL_FUNCDECL_SYS (wcsncpy, wchar_t *, + (wchar_t *dest, const wchar_t *src, size_t n)); +# endif +_GL_CXXALIAS_SYS (wcsncpy, wchar_t *, + (wchar_t *dest, const wchar_t *src, size_t n)); +_GL_CXXALIASWARN (wcsncpy); +#elif defined GNULIB_POSIXCHECK +# undef wcsncpy +# if HAVE_RAW_DECL_WCSNCPY +_GL_WARN_ON_USE (wcsncpy, "wcsncpy is unportable - " + "use gnulib module wcsncpy for portability"); +# endif +#endif + + +/* Copy no more than N characters of SRC to DEST, returning the address of + the last character written into DEST. */ +#if @GNULIB_WCPNCPY@ +# if !@HAVE_WCPNCPY@ +_GL_FUNCDECL_SYS (wcpncpy, wchar_t *, + (wchar_t *dest, const wchar_t *src, size_t n)); +# endif +_GL_CXXALIAS_SYS (wcpncpy, wchar_t *, + (wchar_t *dest, const wchar_t *src, size_t n)); +_GL_CXXALIASWARN (wcpncpy); +#elif defined GNULIB_POSIXCHECK +# undef wcpncpy +# if HAVE_RAW_DECL_WCPNCPY +_GL_WARN_ON_USE (wcpncpy, "wcpncpy is unportable - " + "use gnulib module wcpncpy for portability"); +# endif +#endif + + +/* Append SRC onto DEST. */ +#if @GNULIB_WCSCAT@ +# if !@HAVE_WCSCAT@ +_GL_FUNCDECL_SYS (wcscat, wchar_t *, (wchar_t *dest, const wchar_t *src)); +# endif +_GL_CXXALIAS_SYS (wcscat, wchar_t *, (wchar_t *dest, const wchar_t *src)); +_GL_CXXALIASWARN (wcscat); +#elif defined GNULIB_POSIXCHECK +# undef wcscat +# if HAVE_RAW_DECL_WCSCAT +_GL_WARN_ON_USE (wcscat, "wcscat is unportable - " + "use gnulib module wcscat for portability"); +# endif +#endif + + +/* Append no more than N wide characters of SRC onto DEST. */ +#if @GNULIB_WCSNCAT@ +# if !@HAVE_WCSNCAT@ +_GL_FUNCDECL_SYS (wcsncat, wchar_t *, + (wchar_t *dest, const wchar_t *src, size_t n)); +# endif +_GL_CXXALIAS_SYS (wcsncat, wchar_t *, + (wchar_t *dest, const wchar_t *src, size_t n)); +_GL_CXXALIASWARN (wcsncat); +#elif defined GNULIB_POSIXCHECK +# undef wcsncat +# if HAVE_RAW_DECL_WCSNCAT +_GL_WARN_ON_USE (wcsncat, "wcsncat is unportable - " + "use gnulib module wcsncat for portability"); +# endif +#endif + + +/* Compare S1 and S2. */ +#if @GNULIB_WCSCMP@ +# if !@HAVE_WCSCMP@ +_GL_FUNCDECL_SYS (wcscmp, int, (const wchar_t *s1, const wchar_t *s2) + _GL_ATTRIBUTE_PURE); +# endif +_GL_CXXALIAS_SYS (wcscmp, int, (const wchar_t *s1, const wchar_t *s2)); +_GL_CXXALIASWARN (wcscmp); +#elif defined GNULIB_POSIXCHECK +# undef wcscmp +# if HAVE_RAW_DECL_WCSCMP +_GL_WARN_ON_USE (wcscmp, "wcscmp is unportable - " + "use gnulib module wcscmp for portability"); +# endif +#endif + + +/* Compare no more than N wide characters of S1 and S2. */ +#if @GNULIB_WCSNCMP@ +# if !@HAVE_WCSNCMP@ +_GL_FUNCDECL_SYS (wcsncmp, int, + (const wchar_t *s1, const wchar_t *s2, size_t n) + _GL_ATTRIBUTE_PURE); +# endif +_GL_CXXALIAS_SYS (wcsncmp, int, + (const wchar_t *s1, const wchar_t *s2, size_t n)); +_GL_CXXALIASWARN (wcsncmp); +#elif defined GNULIB_POSIXCHECK +# undef wcsncmp +# if HAVE_RAW_DECL_WCSNCMP +_GL_WARN_ON_USE (wcsncmp, "wcsncmp is unportable - " + "use gnulib module wcsncmp for portability"); +# endif +#endif + + +/* Compare S1 and S2, ignoring case. */ +#if @GNULIB_WCSCASECMP@ +# if !@HAVE_WCSCASECMP@ +_GL_FUNCDECL_SYS (wcscasecmp, int, (const wchar_t *s1, const wchar_t *s2) + _GL_ATTRIBUTE_PURE); +# endif +_GL_CXXALIAS_SYS (wcscasecmp, int, (const wchar_t *s1, const wchar_t *s2)); +_GL_CXXALIASWARN (wcscasecmp); +#elif defined GNULIB_POSIXCHECK +# undef wcscasecmp +# if HAVE_RAW_DECL_WCSCASECMP +_GL_WARN_ON_USE (wcscasecmp, "wcscasecmp is unportable - " + "use gnulib module wcscasecmp for portability"); +# endif +#endif + + +/* Compare no more than N chars of S1 and S2, ignoring case. */ +#if @GNULIB_WCSNCASECMP@ +# if !@HAVE_WCSNCASECMP@ +_GL_FUNCDECL_SYS (wcsncasecmp, int, + (const wchar_t *s1, const wchar_t *s2, size_t n) + _GL_ATTRIBUTE_PURE); +# endif +_GL_CXXALIAS_SYS (wcsncasecmp, int, + (const wchar_t *s1, const wchar_t *s2, size_t n)); +_GL_CXXALIASWARN (wcsncasecmp); +#elif defined GNULIB_POSIXCHECK +# undef wcsncasecmp +# if HAVE_RAW_DECL_WCSNCASECMP +_GL_WARN_ON_USE (wcsncasecmp, "wcsncasecmp is unportable - " + "use gnulib module wcsncasecmp for portability"); +# endif +#endif + + +/* Compare S1 and S2, both interpreted as appropriate to the LC_COLLATE + category of the current locale. */ +#if @GNULIB_WCSCOLL@ +# if !@HAVE_WCSCOLL@ +_GL_FUNCDECL_SYS (wcscoll, int, (const wchar_t *s1, const wchar_t *s2)); +# endif +_GL_CXXALIAS_SYS (wcscoll, int, (const wchar_t *s1, const wchar_t *s2)); +_GL_CXXALIASWARN (wcscoll); +#elif defined GNULIB_POSIXCHECK +# undef wcscoll +# if HAVE_RAW_DECL_WCSCOLL +_GL_WARN_ON_USE (wcscoll, "wcscoll is unportable - " + "use gnulib module wcscoll for portability"); +# endif +#endif + + +/* Transform S2 into array pointed to by S1 such that if wcscmp is applied + to two transformed strings the result is the as applying 'wcscoll' to the + original strings. */ +#if @GNULIB_WCSXFRM@ +# if !@HAVE_WCSXFRM@ +_GL_FUNCDECL_SYS (wcsxfrm, size_t, (wchar_t *s1, const wchar_t *s2, size_t n)); +# endif +_GL_CXXALIAS_SYS (wcsxfrm, size_t, (wchar_t *s1, const wchar_t *s2, size_t n)); +_GL_CXXALIASWARN (wcsxfrm); +#elif defined GNULIB_POSIXCHECK +# undef wcsxfrm +# if HAVE_RAW_DECL_WCSXFRM +_GL_WARN_ON_USE (wcsxfrm, "wcsxfrm is unportable - " + "use gnulib module wcsxfrm for portability"); +# endif +#endif + + +/* Duplicate S, returning an identical malloc'd string. */ +#if @GNULIB_WCSDUP@ +# if !@HAVE_WCSDUP@ +_GL_FUNCDECL_SYS (wcsdup, wchar_t *, (const wchar_t *s)); +# endif +_GL_CXXALIAS_SYS (wcsdup, wchar_t *, (const wchar_t *s)); +_GL_CXXALIASWARN (wcsdup); +#elif defined GNULIB_POSIXCHECK +# undef wcsdup +# if HAVE_RAW_DECL_WCSDUP +_GL_WARN_ON_USE (wcsdup, "wcsdup is unportable - " + "use gnulib module wcsdup for portability"); +# endif +#endif + + +/* Find the first occurrence of WC in WCS. */ +#if @GNULIB_WCSCHR@ +# if !@HAVE_WCSCHR@ +_GL_FUNCDECL_SYS (wcschr, wchar_t *, (const wchar_t *wcs, wchar_t wc) + _GL_ATTRIBUTE_PURE); +# endif + /* On some systems, this function is defined as an overloaded function: + extern "C++" { + const wchar_t * std::wcschr (const wchar_t *, wchar_t); + wchar_t * std::wcschr (wchar_t *, wchar_t); + } */ +_GL_CXXALIAS_SYS_CAST2 (wcschr, + wchar_t *, (const wchar_t *, wchar_t), + const wchar_t *, (const wchar_t *, wchar_t)); +# if ((__GLIBC__ == 2 && __GLIBC_MINOR__ >= 10) && !defined __UCLIBC__) \ + && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 4)) +_GL_CXXALIASWARN1 (wcschr, wchar_t *, (wchar_t *wcs, wchar_t wc)); +_GL_CXXALIASWARN1 (wcschr, const wchar_t *, (const wchar_t *wcs, wchar_t wc)); +# else +_GL_CXXALIASWARN (wcschr); +# endif +#elif defined GNULIB_POSIXCHECK +# undef wcschr +# if HAVE_RAW_DECL_WCSCHR +_GL_WARN_ON_USE (wcschr, "wcschr is unportable - " + "use gnulib module wcschr for portability"); +# endif +#endif + + +/* Find the last occurrence of WC in WCS. */ +#if @GNULIB_WCSRCHR@ +# if !@HAVE_WCSRCHR@ +_GL_FUNCDECL_SYS (wcsrchr, wchar_t *, (const wchar_t *wcs, wchar_t wc) + _GL_ATTRIBUTE_PURE); +# endif + /* On some systems, this function is defined as an overloaded function: + extern "C++" { + const wchar_t * std::wcsrchr (const wchar_t *, wchar_t); + wchar_t * std::wcsrchr (wchar_t *, wchar_t); + } */ +_GL_CXXALIAS_SYS_CAST2 (wcsrchr, + wchar_t *, (const wchar_t *, wchar_t), + const wchar_t *, (const wchar_t *, wchar_t)); +# if ((__GLIBC__ == 2 && __GLIBC_MINOR__ >= 10) && !defined __UCLIBC__) \ + && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 4)) +_GL_CXXALIASWARN1 (wcsrchr, wchar_t *, (wchar_t *wcs, wchar_t wc)); +_GL_CXXALIASWARN1 (wcsrchr, const wchar_t *, (const wchar_t *wcs, wchar_t wc)); +# else +_GL_CXXALIASWARN (wcsrchr); +# endif +#elif defined GNULIB_POSIXCHECK +# undef wcsrchr +# if HAVE_RAW_DECL_WCSRCHR +_GL_WARN_ON_USE (wcsrchr, "wcsrchr is unportable - " + "use gnulib module wcsrchr for portability"); +# endif +#endif + + +/* Return the length of the initial segmet of WCS which consists entirely + of wide characters not in REJECT. */ +#if @GNULIB_WCSCSPN@ +# if !@HAVE_WCSCSPN@ +_GL_FUNCDECL_SYS (wcscspn, size_t, (const wchar_t *wcs, const wchar_t *reject) + _GL_ATTRIBUTE_PURE); +# endif +_GL_CXXALIAS_SYS (wcscspn, size_t, (const wchar_t *wcs, const wchar_t *reject)); +_GL_CXXALIASWARN (wcscspn); +#elif defined GNULIB_POSIXCHECK +# undef wcscspn +# if HAVE_RAW_DECL_WCSCSPN +_GL_WARN_ON_USE (wcscspn, "wcscspn is unportable - " + "use gnulib module wcscspn for portability"); +# endif +#endif + + +/* Return the length of the initial segmet of WCS which consists entirely + of wide characters in ACCEPT. */ +#if @GNULIB_WCSSPN@ +# if !@HAVE_WCSSPN@ +_GL_FUNCDECL_SYS (wcsspn, size_t, (const wchar_t *wcs, const wchar_t *accept) + _GL_ATTRIBUTE_PURE); +# endif +_GL_CXXALIAS_SYS (wcsspn, size_t, (const wchar_t *wcs, const wchar_t *accept)); +_GL_CXXALIASWARN (wcsspn); +#elif defined GNULIB_POSIXCHECK +# undef wcsspn +# if HAVE_RAW_DECL_WCSSPN +_GL_WARN_ON_USE (wcsspn, "wcsspn is unportable - " + "use gnulib module wcsspn for portability"); +# endif +#endif + + +/* Find the first occurrence in WCS of any character in ACCEPT. */ +#if @GNULIB_WCSPBRK@ +# if !@HAVE_WCSPBRK@ +_GL_FUNCDECL_SYS (wcspbrk, wchar_t *, + (const wchar_t *wcs, const wchar_t *accept) + _GL_ATTRIBUTE_PURE); +# endif + /* On some systems, this function is defined as an overloaded function: + extern "C++" { + const wchar_t * std::wcspbrk (const wchar_t *, const wchar_t *); + wchar_t * std::wcspbrk (wchar_t *, const wchar_t *); + } */ +_GL_CXXALIAS_SYS_CAST2 (wcspbrk, + wchar_t *, (const wchar_t *, const wchar_t *), + const wchar_t *, (const wchar_t *, const wchar_t *)); +# if ((__GLIBC__ == 2 && __GLIBC_MINOR__ >= 10) && !defined __UCLIBC__) \ + && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 4)) +_GL_CXXALIASWARN1 (wcspbrk, wchar_t *, + (wchar_t *wcs, const wchar_t *accept)); +_GL_CXXALIASWARN1 (wcspbrk, const wchar_t *, + (const wchar_t *wcs, const wchar_t *accept)); +# else +_GL_CXXALIASWARN (wcspbrk); +# endif +#elif defined GNULIB_POSIXCHECK +# undef wcspbrk +# if HAVE_RAW_DECL_WCSPBRK +_GL_WARN_ON_USE (wcspbrk, "wcspbrk is unportable - " + "use gnulib module wcspbrk for portability"); +# endif +#endif + + +/* Find the first occurrence of NEEDLE in HAYSTACK. */ +#if @GNULIB_WCSSTR@ +# if !@HAVE_WCSSTR@ +_GL_FUNCDECL_SYS (wcsstr, wchar_t *, + (const wchar_t *haystack, const wchar_t *needle) + _GL_ATTRIBUTE_PURE); +# endif + /* On some systems, this function is defined as an overloaded function: + extern "C++" { + const wchar_t * std::wcsstr (const wchar_t *, const wchar_t *); + wchar_t * std::wcsstr (wchar_t *, const wchar_t *); + } */ +_GL_CXXALIAS_SYS_CAST2 (wcsstr, + wchar_t *, (const wchar_t *, const wchar_t *), + const wchar_t *, (const wchar_t *, const wchar_t *)); +# if ((__GLIBC__ == 2 && __GLIBC_MINOR__ >= 10) && !defined __UCLIBC__) \ + && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 4)) +_GL_CXXALIASWARN1 (wcsstr, wchar_t *, + (wchar_t *haystack, const wchar_t *needle)); +_GL_CXXALIASWARN1 (wcsstr, const wchar_t *, + (const wchar_t *haystack, const wchar_t *needle)); +# else +_GL_CXXALIASWARN (wcsstr); +# endif +#elif defined GNULIB_POSIXCHECK +# undef wcsstr +# if HAVE_RAW_DECL_WCSSTR +_GL_WARN_ON_USE (wcsstr, "wcsstr is unportable - " + "use gnulib module wcsstr for portability"); +# endif +#endif + + +/* Divide WCS into tokens separated by characters in DELIM. */ +#if @GNULIB_WCSTOK@ +# if !@HAVE_WCSTOK@ +_GL_FUNCDECL_SYS (wcstok, wchar_t *, + (wchar_t *wcs, const wchar_t *delim, wchar_t **ptr)); +# endif +_GL_CXXALIAS_SYS (wcstok, wchar_t *, + (wchar_t *wcs, const wchar_t *delim, wchar_t **ptr)); +_GL_CXXALIASWARN (wcstok); +#elif defined GNULIB_POSIXCHECK +# undef wcstok +# if HAVE_RAW_DECL_WCSTOK +_GL_WARN_ON_USE (wcstok, "wcstok is unportable - " + "use gnulib module wcstok for portability"); +# endif +#endif + + +/* Determine number of column positions required for first N wide + characters (or fewer if S ends before this) in S. */ +#if @GNULIB_WCSWIDTH@ +# if @REPLACE_WCSWIDTH@ +# if !(defined __cplusplus && defined GNULIB_NAMESPACE) +# undef wcswidth +# define wcswidth rpl_wcswidth +# endif +_GL_FUNCDECL_RPL (wcswidth, int, (const wchar_t *s, size_t n) + _GL_ATTRIBUTE_PURE); +_GL_CXXALIAS_RPL (wcswidth, int, (const wchar_t *s, size_t n)); +# else +# if !@HAVE_WCSWIDTH@ +_GL_FUNCDECL_SYS (wcswidth, int, (const wchar_t *s, size_t n) + _GL_ATTRIBUTE_PURE); +# endif +_GL_CXXALIAS_SYS (wcswidth, int, (const wchar_t *s, size_t n)); +# endif +_GL_CXXALIASWARN (wcswidth); +#elif defined GNULIB_POSIXCHECK +# undef wcswidth +# if HAVE_RAW_DECL_WCSWIDTH +_GL_WARN_ON_USE (wcswidth, "wcswidth is unportable - " + "use gnulib module wcswidth for portability"); +# endif +#endif + + +#endif /* _@GUARD_PREFIX@_WCHAR_H */ +#endif /* _@GUARD_PREFIX@_WCHAR_H */ #endif diff -Nru libdap-3.11.1/gl/wcrtomb.c libdap-3.12.0/gl/wcrtomb.c --- libdap-3.11.1/gl/wcrtomb.c 2011-04-29 13:19:36.000000000 +0000 +++ libdap-3.12.0/gl/wcrtomb.c 2013-10-17 21:27:40.000000000 +0000 @@ -1,5 +1,5 @@ /* Convert wide character to multibyte character. - Copyright (C) 2008-2011 Free Software Foundation, Inc. + Copyright (C) 2008-2012 Free Software Foundation, Inc. Written by Bruno Haible , 2008. This program is free software: you can redistribute it and/or modify diff -Nru libdap-3.11.1/gl/wctype.in.h libdap-3.12.0/gl/wctype.in.h --- libdap-3.11.1/gl/wctype.in.h 2011-04-29 13:19:36.000000000 +0000 +++ libdap-3.12.0/gl/wctype.in.h 2013-10-17 21:27:40.000000000 +0000 @@ -1,6 +1,6 @@ /* A substitute for ISO C99 , for platforms that lack it. - Copyright (C) 2006-2011 Free Software Foundation, Inc. + Copyright (C) 2006-2012 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by @@ -13,8 +13,7 @@ GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License - along with this program; if not, write to the Free Software Foundation, - Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ + along with this program; if not, see . */ /* Written by Bruno Haible and Paul Eggert. */ @@ -26,7 +25,7 @@ * wctrans_t, and wctype_t are not yet implemented. */ -#ifndef _GL_WCTYPE_H +#ifndef _@GUARD_PREFIX@_WCTYPE_H #if __GNUC__ >= 3 @PRAGMA_SYSTEM_HEADER@ @@ -52,13 +51,26 @@ # @INCLUDE_NEXT@ @NEXT_WCTYPE_H@ #endif -#ifndef _GL_WCTYPE_H -#define _GL_WCTYPE_H +#ifndef _@GUARD_PREFIX@_WCTYPE_H +#define _@GUARD_PREFIX@_WCTYPE_H /* The definitions of _GL_FUNCDECL_RPL etc. are copied here. */ /* The definition of _GL_WARN_ON_USE is copied here. */ +/* Solaris 2.6 includes which includes which + #defines a number of identifiers in the application namespace. Revert + these #defines. */ +#ifdef __sun +# undef multibyte +# undef eucw1 +# undef eucw2 +# undef eucw3 +# undef scrw1 +# undef scrw2 +# undef scrw3 +#endif + /* Define wint_t and WEOF. (Also done in wchar.in.h.) */ #if !@HAVE_WINT_T@ && !defined wint_t # define wint_t int @@ -66,64 +78,82 @@ # define WEOF -1 # endif #else +/* MSVC defines wint_t as 'unsigned short' in . + This is too small: ISO C 99 section 7.24.1.(2) says that wint_t must be + "unchanged by default argument promotions". Override it. */ +# if defined _MSC_VER +# if !GNULIB_defined_wint_t +# include +typedef unsigned int rpl_wint_t; +# undef wint_t +# define wint_t rpl_wint_t +# define GNULIB_defined_wint_t 1 +# endif +# endif # ifndef WEOF # define WEOF ((wint_t) -1) # endif #endif +#if !GNULIB_defined_wctype_functions + /* FreeBSD 4.4 to 4.11 has but lacks the functions. Linux libc5 has and the functions but they are broken. Assume all 11 functions (all isw* except iswblank) are implemented the same way, or not at all. */ -#if ! @HAVE_ISWCNTRL@ || @REPLACE_ISWCNTRL@ +# if ! @HAVE_ISWCNTRL@ || @REPLACE_ISWCNTRL@ /* IRIX 5.3 has macros but no functions, its isw* macros refer to an undefined variable _ctmp_ and to macros like _P, and they refer to system functions like _iswctype that are not in the standard C library. Rather than try to get ancient buggy implementations like this to work, just disable them. */ -# undef iswalnum -# undef iswalpha -# undef iswblank -# undef iswcntrl -# undef iswdigit -# undef iswgraph -# undef iswlower -# undef iswprint -# undef iswpunct -# undef iswspace -# undef iswupper -# undef iswxdigit -# undef towlower -# undef towupper +# undef iswalnum +# undef iswalpha +# undef iswblank +# undef iswcntrl +# undef iswdigit +# undef iswgraph +# undef iswlower +# undef iswprint +# undef iswpunct +# undef iswspace +# undef iswupper +# undef iswxdigit +# undef towlower +# undef towupper /* Linux libc5 has and the functions but they are broken. */ -# if @REPLACE_ISWCNTRL@ -# if !(defined __cplusplus && defined GNULIB_NAMESPACE) -# define iswalnum rpl_iswalnum -# define iswalpha rpl_iswalpha -# define iswblank rpl_iswblank -# define iswcntrl rpl_iswcntrl -# define iswdigit rpl_iswdigit -# define iswgraph rpl_iswgraph -# define iswlower rpl_iswlower -# define iswprint rpl_iswprint -# define iswpunct rpl_iswpunct -# define iswspace rpl_iswspace -# define iswupper rpl_iswupper -# define iswxdigit rpl_iswxdigit -# define towlower rpl_towlower -# define towupper rpl_towupper +# if @REPLACE_ISWCNTRL@ +# if !(defined __cplusplus && defined GNULIB_NAMESPACE) +# define iswalnum rpl_iswalnum +# define iswalpha rpl_iswalpha +# define iswblank rpl_iswblank +# define iswcntrl rpl_iswcntrl +# define iswdigit rpl_iswdigit +# define iswgraph rpl_iswgraph +# define iswlower rpl_iswlower +# define iswprint rpl_iswprint +# define iswpunct rpl_iswpunct +# define iswspace rpl_iswspace +# define iswupper rpl_iswupper +# define iswxdigit rpl_iswxdigit +# endif +# endif +# if @REPLACE_TOWLOWER@ +# if !(defined __cplusplus && defined GNULIB_NAMESPACE) +# define towlower rpl_towlower +# define towupper rpl_towupper +# endif # endif -# endif static inline int -# if @REPLACE_ISWCNTRL@ +# if @REPLACE_ISWCNTRL@ rpl_iswalnum -# else +# else iswalnum -# endif +# endif (wint_t wc) { return ((wc >= '0' && wc <= '9') @@ -131,88 +161,88 @@ } static inline int -# if @REPLACE_ISWCNTRL@ +# if @REPLACE_ISWCNTRL@ rpl_iswalpha -# else +# else iswalpha -# endif +# endif (wint_t wc) { return (wc & ~0x20) >= 'A' && (wc & ~0x20) <= 'Z'; } static inline int -# if @REPLACE_ISWCNTRL@ +# if @REPLACE_ISWCNTRL@ rpl_iswblank -# else +# else iswblank -# endif +# endif (wint_t wc) { return wc == ' ' || wc == '\t'; } static inline int -# if @REPLACE_ISWCNTRL@ +# if @REPLACE_ISWCNTRL@ rpl_iswcntrl -# else +# else iswcntrl -# endif +# endif (wint_t wc) { return (wc & ~0x1f) == 0 || wc == 0x7f; } static inline int -# if @REPLACE_ISWCNTRL@ +# if @REPLACE_ISWCNTRL@ rpl_iswdigit -# else +# else iswdigit -# endif +# endif (wint_t wc) { return wc >= '0' && wc <= '9'; } static inline int -# if @REPLACE_ISWCNTRL@ +# if @REPLACE_ISWCNTRL@ rpl_iswgraph -# else +# else iswgraph -# endif +# endif (wint_t wc) { return wc >= '!' && wc <= '~'; } static inline int -# if @REPLACE_ISWCNTRL@ +# if @REPLACE_ISWCNTRL@ rpl_iswlower -# else +# else iswlower -# endif +# endif (wint_t wc) { return wc >= 'a' && wc <= 'z'; } static inline int -# if @REPLACE_ISWCNTRL@ +# if @REPLACE_ISWCNTRL@ rpl_iswprint -# else +# else iswprint -# endif +# endif (wint_t wc) { return wc >= ' ' && wc <= '~'; } static inline int -# if @REPLACE_ISWCNTRL@ +# if @REPLACE_ISWCNTRL@ rpl_iswpunct -# else +# else iswpunct -# endif +# endif (wint_t wc) { return (wc >= '!' && wc <= '~' @@ -221,11 +251,11 @@ } static inline int -# if @REPLACE_ISWCNTRL@ +# if @REPLACE_ISWCNTRL@ rpl_iswspace -# else +# else iswspace -# endif +# endif (wint_t wc) { return (wc == ' ' || wc == '\t' @@ -233,22 +263,22 @@ } static inline int -# if @REPLACE_ISWCNTRL@ +# if @REPLACE_ISWCNTRL@ rpl_iswupper -# else +# else iswupper -# endif +# endif (wint_t wc) { return wc >= 'A' && wc <= 'Z'; } static inline int -# if @REPLACE_ISWCNTRL@ +# if @REPLACE_ISWCNTRL@ rpl_iswxdigit -# else +# else iswxdigit -# endif +# endif (wint_t wc) { return ((wc >= '0' && wc <= '9') @@ -256,42 +286,42 @@ } static inline wint_t -# if @REPLACE_ISWCNTRL@ +# if @REPLACE_TOWLOWER@ rpl_towlower -# else +# else towlower -# endif +# endif (wint_t wc) { return (wc >= 'A' && wc <= 'Z' ? wc - 'A' + 'a' : wc); } static inline wint_t -# if @REPLACE_ISWCNTRL@ +# if @REPLACE_TOWLOWER@ rpl_towupper -# else +# else towupper -# endif +# endif (wint_t wc) { return (wc >= 'a' && wc <= 'z' ? wc - 'a' + 'A' : wc); } -#elif ! @HAVE_ISWBLANK@ || @REPLACE_ISWBLANK@ +# elif @GNULIB_ISWBLANK@ && (! @HAVE_ISWBLANK@ || @REPLACE_ISWBLANK@) /* Only the iswblank function is missing. */ -# if @REPLACE_ISWBLANK@ -# if !(defined __cplusplus && defined GNULIB_NAMESPACE) -# define iswblank rpl_iswblank -# endif +# if @REPLACE_ISWBLANK@ +# if !(defined __cplusplus && defined GNULIB_NAMESPACE) +# define iswblank rpl_iswblank +# endif _GL_FUNCDECL_RPL (iswblank, int, (wint_t wc)); -# else +# else _GL_FUNCDECL_SYS (iswblank, int, (wint_t wc)); -# endif +# endif -#endif +# endif -#if defined __MINGW32__ +# if defined __MINGW32__ /* On native Windows, wchar_t is uint16_t, and wint_t is uint32_t. The functions towlower and towupper are implemented in the MSVCRT library @@ -311,25 +341,27 @@ { return (wint_t) (wchar_t) towlower (wc); } -# if !(defined __cplusplus && defined GNULIB_NAMESPACE) -# define towlower rpl_towlower -# endif +# if !(defined __cplusplus && defined GNULIB_NAMESPACE) +# define towlower rpl_towlower +# endif static inline wint_t rpl_towupper (wint_t wc) { return (wint_t) (wchar_t) towupper (wc); } -# if !(defined __cplusplus && defined GNULIB_NAMESPACE) -# define towupper rpl_towupper -# endif +# if !(defined __cplusplus && defined GNULIB_NAMESPACE) +# define towupper rpl_towupper +# endif + +# endif /* __MINGW32__ */ -#endif /* __MINGW32__ */ +# define GNULIB_defined_wctype_functions 1 +#endif #if @REPLACE_ISWCNTRL@ _GL_CXXALIAS_RPL (iswalnum, int, (wint_t wc)); _GL_CXXALIAS_RPL (iswalpha, int, (wint_t wc)); -_GL_CXXALIAS_RPL (iswblank, int, (wint_t wc)); _GL_CXXALIAS_RPL (iswcntrl, int, (wint_t wc)); _GL_CXXALIAS_RPL (iswdigit, int, (wint_t wc)); _GL_CXXALIAS_RPL (iswgraph, int, (wint_t wc)); @@ -342,11 +374,6 @@ #else _GL_CXXALIAS_SYS (iswalnum, int, (wint_t wc)); _GL_CXXALIAS_SYS (iswalpha, int, (wint_t wc)); -# if @REPLACE_ISWBLANK@ -_GL_CXXALIAS_RPL (iswblank, int, (wint_t wc)); -# else -_GL_CXXALIAS_SYS (iswblank, int, (wint_t wc)); -# endif _GL_CXXALIAS_SYS (iswcntrl, int, (wint_t wc)); _GL_CXXALIAS_SYS (iswdigit, int, (wint_t wc)); _GL_CXXALIAS_SYS (iswgraph, int, (wint_t wc)); @@ -359,7 +386,6 @@ #endif _GL_CXXALIASWARN (iswalnum); _GL_CXXALIASWARN (iswalpha); -_GL_CXXALIASWARN (iswblank); _GL_CXXALIASWARN (iswcntrl); _GL_CXXALIASWARN (iswdigit); _GL_CXXALIASWARN (iswgraph); @@ -370,7 +396,55 @@ _GL_CXXALIASWARN (iswupper); _GL_CXXALIASWARN (iswxdigit); -#if @REPLACE_ISWCNTRL@ || defined __MINGW32__ +#if @GNULIB_ISWBLANK@ +# if @REPLACE_ISWCNTRL@ || @REPLACE_ISWBLANK@ +_GL_CXXALIAS_RPL (iswblank, int, (wint_t wc)); +# else +_GL_CXXALIAS_SYS (iswblank, int, (wint_t wc)); +# endif +_GL_CXXALIASWARN (iswblank); +#endif + +#if !@HAVE_WCTYPE_T@ +# if !GNULIB_defined_wctype_t +typedef void * wctype_t; +# define GNULIB_defined_wctype_t 1 +# endif +#endif + +/* Get a descriptor for a wide character property. */ +#if @GNULIB_WCTYPE@ +# if !@HAVE_WCTYPE_T@ +_GL_FUNCDECL_SYS (wctype, wctype_t, (const char *name)); +# endif +_GL_CXXALIAS_SYS (wctype, wctype_t, (const char *name)); +_GL_CXXALIASWARN (wctype); +#elif defined GNULIB_POSIXCHECK +# undef wctype +# if HAVE_RAW_DECL_WCTYPE +_GL_WARN_ON_USE (wctype, "wctype is unportable - " + "use gnulib module wctype for portability"); +# endif +#endif + +/* Test whether a wide character has a given property. + The argument WC must be either a wchar_t value or WEOF. + The argument DESC must have been returned by the wctype() function. */ +#if @GNULIB_ISWCTYPE@ +# if !@HAVE_WCTYPE_T@ +_GL_FUNCDECL_SYS (iswctype, int, (wint_t wc, wctype_t desc)); +# endif +_GL_CXXALIAS_SYS (iswctype, int, (wint_t wc, wctype_t desc)); +_GL_CXXALIASWARN (iswctype); +#elif defined GNULIB_POSIXCHECK +# undef iswctype +# if HAVE_RAW_DECL_ISWCTYPE +_GL_WARN_ON_USE (iswctype, "iswctype is unportable - " + "use gnulib module iswctype for portability"); +# endif +#endif + +#if @REPLACE_TOWLOWER@ || defined __MINGW32__ _GL_CXXALIAS_RPL (towlower, wint_t, (wint_t wc)); _GL_CXXALIAS_RPL (towupper, wint_t, (wint_t wc)); #else @@ -380,6 +454,45 @@ _GL_CXXALIASWARN (towlower); _GL_CXXALIASWARN (towupper); +#if !@HAVE_WCTRANS_T@ +# if !GNULIB_defined_wctrans_t +typedef void * wctrans_t; +# define GNULIB_defined_wctrans_t 1 +# endif +#endif + +/* Get a descriptor for a wide character case conversion. */ +#if @GNULIB_WCTRANS@ +# if !@HAVE_WCTRANS_T@ +_GL_FUNCDECL_SYS (wctrans, wctrans_t, (const char *name)); +# endif +_GL_CXXALIAS_SYS (wctrans, wctrans_t, (const char *name)); +_GL_CXXALIASWARN (wctrans); +#elif defined GNULIB_POSIXCHECK +# undef wctrans +# if HAVE_RAW_DECL_WCTRANS +_GL_WARN_ON_USE (wctrans, "wctrans is unportable - " + "use gnulib module wctrans for portability"); +# endif +#endif + +/* Perform a given case conversion on a wide character. + The argument WC must be either a wchar_t value or WEOF. + The argument DESC must have been returned by the wctrans() function. */ +#if @GNULIB_TOWCTRANS@ +# if !@HAVE_WCTRANS_T@ +_GL_FUNCDECL_SYS (towctrans, wint_t, (wint_t wc, wctrans_t desc)); +# endif +_GL_CXXALIAS_SYS (towctrans, wint_t, (wint_t wc, wctrans_t desc)); +_GL_CXXALIASWARN (towctrans); +#elif defined GNULIB_POSIXCHECK +# undef towctrans +# if HAVE_RAW_DECL_TOWCTRANS +_GL_WARN_ON_USE (towctrans, "towctrans is unportable - " + "use gnulib module towctrans for portability"); +# endif +#endif + -#endif /* _GL_WCTYPE_H */ -#endif /* _GL_WCTYPE_H */ +#endif /* _@GUARD_PREFIX@_WCTYPE_H */ +#endif /* _@GUARD_PREFIX@_WCTYPE_H */ diff -Nru libdap-3.11.1/gse.lex libdap-3.12.0/gse.lex --- libdap-3.11.1/gse.lex 2011-04-29 13:19:43.000000000 +0000 +++ libdap-3.12.0/gse.lex 1970-01-01 00:00:00.000000000 +0000 @@ -1,174 +0,0 @@ - -/* - -*- mode: c++; c-basic-offset:4 -*- - - This file is part of libdap, A C++ implementation of the OPeNDAP Data - Access Protocol. - - Copyright (c) 2002,2003 OPeNDAP, Inc. - Author: James Gallagher - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - This library 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 - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with this library; if not, write to the Free Software - Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - - You can contact OPeNDAP, Inc. at PO Box 112, Saunderstown, RI. 02874-0112. - - (c) COPYRIGHT URI/MIT 1999 -*/ - -/* - Scanner for grid selection sub-expressions. The scanner is not reentrant, - but can share a name space with other scanners. - - Note: - 1) The `defines' file gse.tab.h is built using `bison -d'. - 2) Define YY_DECL such that the scanner is called `gse_lex'. - 3) When bison builds the gse.tab.h file, it uses `gse_' instead - of `yy' for variable name prefixes (e.g., yylval --> gse_lval). - - 1/13/99 jhrg -*/ - -%{ - -#include "config_dap.h" - -static char rcsid[] not_used = {"$Id: gse.lex 18500 2008-03-19 19:39:45Z jimg $"}; - -#include -#include - -#include "Error.h" - -#ifndef YY_PROTO -#define YY_PROTO(proto) proto -#endif - -#define YY_DECL int gse_lex YY_PROTO(( void )) -#define ID_MAX 256 -#define YY_NO_UNPUT 1 -#define YY_NO_INPUT 1 -#define YY_FATAL_ERROR(msg) {\ - throw(Error(string("Error scanning grid constraint expression text: ") + string(msg))); \ - yy_fatal_error(msg); /* 'Used' here to suppress warning */ \ -} - -#include "gse.tab.hh" - -using namespace std; -using namespace libdap; - -static void store_int32(); -static void store_float64(); -static void store_id(); -static void store_op(int op); - -%} - -%option noyywrap -%option prefix="gse_" -%option outfile="lex.gse_.cc" - -NAN [Nn][Aa][Nn] -INF [Ii][Nn][Ff] - -SCAN_INT [-+]?[0-9]+ - -SCAN_MANTISA ([0-9]+\.?[0-9]*)|([0-9]*\.?[0-9]+) -SCAN_EXPONENT (E|e)[-+]?[0-9]+ - -SCAN_FLOAT ([-+]?{SCAN_MANTISA}{SCAN_EXPONENT}?)|({NAN})|({INF}) - -/* See das.lex for comments about the characters allowed in a WORD. - 10/31/2001 jhrg */ - -SCAN_WORD [-+a-zA-Z0-9_/%.\\][-+a-zA-Z0-9_/%.\\#]* - -SCAN_EQUAL = -SCAN_NOT_EQUAL != -SCAN_GREATER > -SCAN_GREATER_EQL >= -SCAN_LESS < -SCAN_LESS_EQL <= - -NEVER [^a-zA-Z0-9_/%.#:+\-,] - -%% - -{SCAN_INT} store_int32(); return SCAN_INT; -{SCAN_FLOAT} store_float64(); return SCAN_FLOAT; - -{SCAN_WORD} store_id(); return SCAN_WORD; - -{SCAN_EQUAL} store_op(SCAN_EQUAL); return SCAN_EQUAL; -{SCAN_NOT_EQUAL} store_op(SCAN_NOT_EQUAL); return SCAN_NOT_EQUAL; -{SCAN_GREATER} store_op(SCAN_GREATER); return SCAN_GREATER; -{SCAN_GREATER_EQL} store_op(SCAN_GREATER_EQL); return SCAN_GREATER_EQL; -{SCAN_LESS} store_op(SCAN_LESS); return SCAN_LESS; -{SCAN_LESS_EQL} store_op(SCAN_LESS_EQL); return SCAN_LESS_EQL; - -%% - -// Three glue routines for string scanning. These are not declared in the -// header gse.tab.h nor is YY_BUFFER_STATE. Including these here allows them -// to see the type definitions in lex.gse.c (where YY_BUFFER_STATE is -// defined) and allows callers to declare them (since callers outside of this -// file cannot declare YY_BUFFER_STATE variable). - -void * -gse_string(const char *str) -{ - return (void *)gse__scan_string(str); -} - -void -gse_switch_to_buffer(void *buf) -{ - gse__switch_to_buffer((YY_BUFFER_STATE)buf); -} - -void -gse_delete_buffer(void *buf) -{ - gse__delete_buffer((YY_BUFFER_STATE)buf); -} - -// Note that the grid() CE function only deals with numeric maps (8/28/2001 -// jhrg) and that all comparisons are done using doubles. - -static void -store_int32() -{ - gse_lval.val = atof(yytext); -} - -static void -store_float64() -{ - gse_lval.val = atof(yytext); -} - -static void -store_id() -{ - strncpy(gse_lval.id, yytext, ID_MAX-1); - gse_lval.id[ID_MAX-1] = '\0'; -} - -static void -store_op(int op) -{ - gse_lval.op = op; -} - diff -Nru libdap-3.11.1/gse.tab.cc libdap-3.12.0/gse.tab.cc --- libdap-3.11.1/gse.tab.cc 2011-05-06 17:50:25.000000000 +0000 +++ libdap-3.12.0/gse.tab.cc 1970-01-01 00:00:00.000000000 +0000 @@ -1,1716 +0,0 @@ -/* A Bison parser, made by GNU Bison 2.3. */ - -/* Skeleton implementation for Bison's Yacc-like parsers in C - - Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004, 2005, 2006 - Free Software Foundation, Inc. - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2, or (at your option) - 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., 51 Franklin Street, Fifth Floor, - Boston, MA 02110-1301, USA. */ - -/* As a special exception, you may create a larger work that contains - part or all of the Bison parser skeleton and distribute that work - under terms of your choice, so long as that work isn't itself a - parser generator using the skeleton or a modified version thereof - as a parser skeleton. Alternatively, if you modify or redistribute - the parser skeleton itself, you may (at your option) remove this - special exception, which will cause the skeleton and the resulting - Bison output files to be licensed under the GNU General Public - License without this special exception. - - This special exception was added by the Free Software Foundation in - version 2.2 of Bison. */ - -/* C LALR(1) parser skeleton written by Richard Stallman, by - simplifying the original so-called "semantic" parser. */ - -/* All symbols defined below should begin with yy or YY, to avoid - infringing on user name space. This should be done even for local - variables, as they might otherwise be expanded by user macros. - There are some unavoidable exceptions within include files to - define necessary library symbols; they are noted "INFRINGES ON - USER NAME SPACE" below. */ - -/* Identify Bison output. */ -#define YYBISON 1 - -/* Bison version. */ -#define YYBISON_VERSION "2.3" - -/* Skeleton name. */ -#define YYSKELETON_NAME "yacc.c" - -/* Pure parsers. */ -#define YYPURE 0 - -/* Using locations. */ -#define YYLSP_NEEDED 0 - -/* Substitute the variable and function names. */ -#define yyparse gse_parse -#define yylex gse_lex -#define yyerror gse_error -#define yylval gse_lval -#define yychar gse_char -#define yydebug gse_debug -#define yynerrs gse_nerrs - - -/* Tokens. */ -#ifndef YYTOKENTYPE -# define YYTOKENTYPE - /* Put the tokens into the symbol table, so that GDB and other debuggers - know about them. */ - enum yytokentype { - SCAN_INT = 258, - SCAN_FLOAT = 259, - SCAN_WORD = 260, - SCAN_FIELD = 261, - SCAN_EQUAL = 262, - SCAN_NOT_EQUAL = 263, - SCAN_GREATER = 264, - SCAN_GREATER_EQL = 265, - SCAN_LESS = 266, - SCAN_LESS_EQL = 267 - }; -#endif -/* Tokens. */ -#define SCAN_INT 258 -#define SCAN_FLOAT 259 -#define SCAN_WORD 260 -#define SCAN_FIELD 261 -#define SCAN_EQUAL 262 -#define SCAN_NOT_EQUAL 263 -#define SCAN_GREATER 264 -#define SCAN_GREATER_EQL 265 -#define SCAN_LESS 266 -#define SCAN_LESS_EQL 267 - - - - -/* Copy the first part of user declarations. */ -#line 35 "gse.y" - - -#include "config_dap.h" - -static char rcsid[] not_used = {"$Id: gse.y 17856 2008-02-02 21:25:59Z pwest $"}; - -#include - -#include "Error.h" -#include "GSEClause.h" -#include "gse_parser.h" - -using std::cerr; -using std::endl; -using namespace libdap; - -// This macro is used to access the instance of a gse_arg class which is -// passed to the parser through a void *. See parser.h. - -#define gse_arg(arg) ((gse_arg *)(arg)) - -// Assume bison 1.25 -#define YYPARSE_PARAM arg - -int gse_lex(void); -void gse_error(const char *str); -GSEClause *build_gse_clause(gse_arg *arg, char id[ID_MAX], int op, double val); -GSEClause *build_rev_gse_clause(gse_arg *arg, char id[ID_MAX], int op, - double val); -GSEClause * -build_dual_gse_clause(gse_arg *arg, char id[ID_MAX], int op1, double val1, - int op2, double val2); - - - -/* Enabling traces. */ -#ifndef YYDEBUG -# define YYDEBUG 0 -#endif - -/* Enabling verbose error messages. */ -#ifdef YYERROR_VERBOSE -# undef YYERROR_VERBOSE -# define YYERROR_VERBOSE 1 -#else -# define YYERROR_VERBOSE 0 -#endif - -/* Enabling the token table. */ -#ifndef YYTOKEN_TABLE -# define YYTOKEN_TABLE 0 -#endif - -#if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED -typedef union YYSTYPE -#line 70 "gse.y" -{ - bool boolean; - - int op; - char id[ID_MAX]; - double val; -} -/* Line 187 of yacc.c. */ -#line 171 "gse.tab.cc" - YYSTYPE; -# define yystype YYSTYPE /* obsolescent; will be withdrawn */ -# define YYSTYPE_IS_DECLARED 1 -# define YYSTYPE_IS_TRIVIAL 1 -#endif - - - -/* Copy the second part of user declarations. */ - - -/* Line 216 of yacc.c. */ -#line 184 "gse.tab.cc" - -#ifdef short -# undef short -#endif - -#ifdef YYTYPE_UINT8 -typedef YYTYPE_UINT8 yytype_uint8; -#else -typedef unsigned char yytype_uint8; -#endif - -#ifdef YYTYPE_INT8 -typedef YYTYPE_INT8 yytype_int8; -#elif (defined __STDC__ || defined __C99__FUNC__ \ - || defined __cplusplus || defined _MSC_VER) -typedef signed char yytype_int8; -#else -typedef short int yytype_int8; -#endif - -#ifdef YYTYPE_UINT16 -typedef YYTYPE_UINT16 yytype_uint16; -#else -typedef unsigned short int yytype_uint16; -#endif - -#ifdef YYTYPE_INT16 -typedef YYTYPE_INT16 yytype_int16; -#else -typedef short int yytype_int16; -#endif - -#ifndef YYSIZE_T -# ifdef __SIZE_TYPE__ -# define YYSIZE_T __SIZE_TYPE__ -# elif defined size_t -# define YYSIZE_T size_t -# elif ! defined YYSIZE_T && (defined __STDC__ || defined __C99__FUNC__ \ - || defined __cplusplus || defined _MSC_VER) -# include /* INFRINGES ON USER NAME SPACE */ -# define YYSIZE_T size_t -# else -# define YYSIZE_T unsigned int -# endif -#endif - -#define YYSIZE_MAXIMUM ((YYSIZE_T) -1) - -#ifndef YY_ -# if YYENABLE_NLS -# if ENABLE_NLS -# include /* INFRINGES ON USER NAME SPACE */ -# define YY_(msgid) dgettext ("bison-runtime", msgid) -# endif -# endif -# ifndef YY_ -# define YY_(msgid) msgid -# endif -#endif - -/* Suppress unused-variable warnings by "using" E. */ -#if ! defined lint || defined __GNUC__ -# define YYUSE(e) ((void) (e)) -#else -# define YYUSE(e) /* empty */ -#endif - -/* Identity function, used to suppress warnings about constant conditions. */ -#ifndef lint -# define YYID(n) (n) -#else -#if (defined __STDC__ || defined __C99__FUNC__ \ - || defined __cplusplus || defined _MSC_VER) -static int -YYID (int i) -#else -static int -YYID (i) - int i; -#endif -{ - return i; -} -#endif - -#if ! defined yyoverflow || YYERROR_VERBOSE - -/* The parser invokes alloca or malloc; define the necessary symbols. */ - -# ifdef YYSTACK_USE_ALLOCA -# if YYSTACK_USE_ALLOCA -# ifdef __GNUC__ -# define YYSTACK_ALLOC __builtin_alloca -# elif defined __BUILTIN_VA_ARG_INCR -# include /* INFRINGES ON USER NAME SPACE */ -# elif defined _AIX -# define YYSTACK_ALLOC __alloca -# elif defined _MSC_VER -# include /* INFRINGES ON USER NAME SPACE */ -# define alloca _alloca -# else -# define YYSTACK_ALLOC alloca -# if ! defined _ALLOCA_H && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \ - || defined __cplusplus || defined _MSC_VER) -# include /* INFRINGES ON USER NAME SPACE */ -# ifndef _STDLIB_H -# define _STDLIB_H 1 -# endif -# endif -# endif -# endif -# endif - -# ifdef YYSTACK_ALLOC - /* Pacify GCC's `empty if-body' warning. */ -# define YYSTACK_FREE(Ptr) do { /* empty */; } while (YYID (0)) -# ifndef YYSTACK_ALLOC_MAXIMUM - /* The OS might guarantee only one guard page at the bottom of the stack, - and a page size can be as small as 4096 bytes. So we cannot safely - invoke alloca (N) if N exceeds 4096. Use a slightly smaller number - to allow for a few compiler-allocated temporary stack slots. */ -# define YYSTACK_ALLOC_MAXIMUM 4032 /* reasonable circa 2006 */ -# endif -# else -# define YYSTACK_ALLOC YYMALLOC -# define YYSTACK_FREE YYFREE -# ifndef YYSTACK_ALLOC_MAXIMUM -# define YYSTACK_ALLOC_MAXIMUM YYSIZE_MAXIMUM -# endif -# if (defined __cplusplus && ! defined _STDLIB_H \ - && ! ((defined YYMALLOC || defined malloc) \ - && (defined YYFREE || defined free))) -# include /* INFRINGES ON USER NAME SPACE */ -# ifndef _STDLIB_H -# define _STDLIB_H 1 -# endif -# endif -# ifndef YYMALLOC -# define YYMALLOC malloc -# if ! defined malloc && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \ - || defined __cplusplus || defined _MSC_VER) -void *malloc (YYSIZE_T); /* INFRINGES ON USER NAME SPACE */ -# endif -# endif -# ifndef YYFREE -# define YYFREE free -# if ! defined free && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \ - || defined __cplusplus || defined _MSC_VER) -void free (void *); /* INFRINGES ON USER NAME SPACE */ -# endif -# endif -# endif -#endif /* ! defined yyoverflow || YYERROR_VERBOSE */ - - -#if (! defined yyoverflow \ - && (! defined __cplusplus \ - || (defined YYSTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL))) - -/* A type that is properly aligned for any stack member. */ -union yyalloc -{ - yytype_int16 yyss; - YYSTYPE yyvs; - }; - -/* The size of the maximum gap between one aligned stack and the next. */ -# define YYSTACK_GAP_MAXIMUM (sizeof (union yyalloc) - 1) - -/* The size of an array large to enough to hold all stacks, each with - N elements. */ -# define YYSTACK_BYTES(N) \ - ((N) * (sizeof (yytype_int16) + sizeof (YYSTYPE)) \ - + YYSTACK_GAP_MAXIMUM) - -/* Copy COUNT objects from FROM to TO. The source and destination do - not overlap. */ -# ifndef YYCOPY -# if defined __GNUC__ && 1 < __GNUC__ -# define YYCOPY(To, From, Count) \ - __builtin_memcpy (To, From, (Count) * sizeof (*(From))) -# else -# define YYCOPY(To, From, Count) \ - do \ - { \ - YYSIZE_T yyi; \ - for (yyi = 0; yyi < (Count); yyi++) \ - (To)[yyi] = (From)[yyi]; \ - } \ - while (YYID (0)) -# endif -# endif - -/* Relocate STACK from its old location to the new one. The - local variables YYSIZE and YYSTACKSIZE give the old and new number of - elements in the stack, and YYPTR gives the new location of the - stack. Advance YYPTR to a properly aligned location for the next - stack. */ -# define YYSTACK_RELOCATE(Stack) \ - do \ - { \ - YYSIZE_T yynewbytes; \ - YYCOPY (&yyptr->Stack, Stack, yysize); \ - Stack = &yyptr->Stack; \ - yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \ - yyptr += yynewbytes / sizeof (*yyptr); \ - } \ - while (YYID (0)) - -#endif - -/* YYFINAL -- State number of the termination state. */ -#define YYFINAL 7 -/* YYLAST -- Last index in YYTABLE. */ -#define YYLAST 17 - -/* YYNTOKENS -- Number of terminals. */ -#define YYNTOKENS 13 -/* YYNNTS -- Number of nonterminals. */ -#define YYNNTS 5 -/* YYNRULES -- Number of rules. */ -#define YYNRULES 13 -/* YYNRULES -- Number of states. */ -#define YYNSTATES 20 - -/* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX. */ -#define YYUNDEFTOK 2 -#define YYMAXUTOK 267 - -#define YYTRANSLATE(YYX) \ - ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK) - -/* YYTRANSLATE[YYLEX] -- Bison symbol number corresponding to YYLEX. */ -static const yytype_uint8 yytranslate[] = -{ - 0, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 1, 2, 3, 4, - 5, 6, 7, 8, 9, 10, 11, 12 -}; - -#if YYDEBUG -/* YYPRHS[YYN] -- Index of the first RHS symbol of rule number YYN in - YYRHS. */ -static const yytype_uint8 yyprhs[] = -{ - 0, 0, 3, 7, 11, 17, 19, 21, 23, 25, - 27, 29, 31, 33 -}; - -/* YYRHS -- A `-1'-separated list of the rules' RHS. */ -static const yytype_int8 yyrhs[] = -{ - 14, 0, -1, 15, 17, 16, -1, 16, 17, 15, - -1, 16, 17, 15, 17, 16, -1, 5, -1, 3, - -1, 4, -1, 7, -1, 8, -1, 9, -1, 10, - -1, 11, -1, 12, -1 -}; - -/* YYRLINE[YYN] -- source line where rule number YYN was defined. */ -static const yytype_uint8 yyrline[] = -{ - 0, 98, 98, 104, 110, 119, 122, 123, 126, 127, - 128, 129, 130, 131 -}; -#endif - -#if YYDEBUG || YYERROR_VERBOSE || YYTOKEN_TABLE -/* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM. - First, the terminals, then, starting at YYNTOKENS, nonterminals. */ -static const char *const yytname[] = -{ - "$end", "error", "$undefined", "SCAN_INT", "SCAN_FLOAT", "SCAN_WORD", - "SCAN_FIELD", "SCAN_EQUAL", "SCAN_NOT_EQUAL", "SCAN_GREATER", - "SCAN_GREATER_EQL", "SCAN_LESS", "SCAN_LESS_EQL", "$accept", "clause", - "identifier", "constant", "relop", 0 -}; -#endif - -# ifdef YYPRINT -/* YYTOKNUM[YYLEX-NUM] -- Internal token number corresponding to - token YYLEX-NUM. */ -static const yytype_uint16 yytoknum[] = -{ - 0, 256, 257, 258, 259, 260, 261, 262, 263, 264, - 265, 266, 267 -}; -# endif - -/* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */ -static const yytype_uint8 yyr1[] = -{ - 0, 13, 14, 14, 14, 15, 16, 16, 17, 17, - 17, 17, 17, 17 -}; - -/* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN. */ -static const yytype_uint8 yyr2[] = -{ - 0, 2, 3, 3, 5, 1, 1, 1, 1, 1, - 1, 1, 1, 1 -}; - -/* YYDEFACT[STATE-NAME] -- Default rule to reduce with in state - STATE-NUM when YYTABLE doesn't specify something else to do. Zero - means the default is an error. */ -static const yytype_uint8 yydefact[] = -{ - 0, 6, 7, 5, 0, 0, 0, 1, 8, 9, - 10, 11, 12, 13, 0, 0, 2, 3, 0, 4 -}; - -/* YYDEFGOTO[NTERM-NUM]. */ -static const yytype_int8 yydefgoto[] = -{ - -1, 4, 5, 6, 14 -}; - -/* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing - STATE-NUM. */ -#define YYPACT_NINF -7 -static const yytype_int8 yypact[] = -{ - 12, -7, -7, -7, 1, -5, -5, -7, -7, -7, - -7, -7, -7, -7, 5, 7, -7, -5, 5, -7 -}; - -/* YYPGOTO[NTERM-NUM]. */ -static const yytype_int8 yypgoto[] = -{ - -7, -7, -2, -4, -6 -}; - -/* YYTABLE[YYPACT[STATE-NUM]]. What to do in state STATE-NUM. If - positive, shift that token. If negative, reduce the rule which - number is the opposite. If zero, do what YYDEFACT says. - If YYTABLE_NINF, syntax error. */ -#define YYTABLE_NINF -1 -static const yytype_uint8 yytable[] = -{ - 15, 7, 8, 9, 10, 11, 12, 13, 1, 2, - 16, 18, 3, 17, 19, 1, 2, 3 -}; - -static const yytype_uint8 yycheck[] = -{ - 6, 0, 7, 8, 9, 10, 11, 12, 3, 4, - 14, 17, 5, 15, 18, 3, 4, 5 -}; - -/* YYSTOS[STATE-NUM] -- The (internal number of the) accessing - symbol of state STATE-NUM. */ -static const yytype_uint8 yystos[] = -{ - 0, 3, 4, 5, 14, 15, 16, 0, 7, 8, - 9, 10, 11, 12, 17, 17, 16, 15, 17, 16 -}; - -#define yyerrok (yyerrstatus = 0) -#define yyclearin (yychar = YYEMPTY) -#define YYEMPTY (-2) -#define YYEOF 0 - -#define YYACCEPT goto yyacceptlab -#define YYABORT goto yyabortlab -#define YYERROR goto yyerrorlab - - -/* Like YYERROR except do call yyerror. This remains here temporarily - to ease the transition to the new meaning of YYERROR, for GCC. - Once GCC version 2 has supplanted version 1, this can go. */ - -#define YYFAIL goto yyerrlab - -#define YYRECOVERING() (!!yyerrstatus) - -#define YYBACKUP(Token, Value) \ -do \ - if (yychar == YYEMPTY && yylen == 1) \ - { \ - yychar = (Token); \ - yylval = (Value); \ - yytoken = YYTRANSLATE (yychar); \ - YYPOPSTACK (1); \ - goto yybackup; \ - } \ - else \ - { \ - yyerror (YY_("syntax error: cannot back up")); \ - YYERROR; \ - } \ -while (YYID (0)) - - -#define YYTERROR 1 -#define YYERRCODE 256 - - -/* YYLLOC_DEFAULT -- Set CURRENT to span from RHS[1] to RHS[N]. - If N is 0, then set CURRENT to the empty location which ends - the previous symbol: RHS[0] (always defined). */ - -#define YYRHSLOC(Rhs, K) ((Rhs)[K]) -#ifndef YYLLOC_DEFAULT -# define YYLLOC_DEFAULT(Current, Rhs, N) \ - do \ - if (YYID (N)) \ - { \ - (Current).first_line = YYRHSLOC (Rhs, 1).first_line; \ - (Current).first_column = YYRHSLOC (Rhs, 1).first_column; \ - (Current).last_line = YYRHSLOC (Rhs, N).last_line; \ - (Current).last_column = YYRHSLOC (Rhs, N).last_column; \ - } \ - else \ - { \ - (Current).first_line = (Current).last_line = \ - YYRHSLOC (Rhs, 0).last_line; \ - (Current).first_column = (Current).last_column = \ - YYRHSLOC (Rhs, 0).last_column; \ - } \ - while (YYID (0)) -#endif - - -/* YY_LOCATION_PRINT -- Print the location on the stream. - This macro was not mandated originally: define only if we know - we won't break user code: when these are the locations we know. */ - -#ifndef YY_LOCATION_PRINT -# if YYLTYPE_IS_TRIVIAL -# define YY_LOCATION_PRINT(File, Loc) \ - fprintf (File, "%d.%d-%d.%d", \ - (Loc).first_line, (Loc).first_column, \ - (Loc).last_line, (Loc).last_column) -# else -# define YY_LOCATION_PRINT(File, Loc) ((void) 0) -# endif -#endif - - -/* YYLEX -- calling `yylex' with the right arguments. */ - -#ifdef YYLEX_PARAM -# define YYLEX yylex (YYLEX_PARAM) -#else -# define YYLEX yylex () -#endif - -/* Enable debugging if requested. */ -#if YYDEBUG - -# ifndef YYFPRINTF -# include /* INFRINGES ON USER NAME SPACE */ -# define YYFPRINTF fprintf -# endif - -# define YYDPRINTF(Args) \ -do { \ - if (yydebug) \ - YYFPRINTF Args; \ -} while (YYID (0)) - -# define YY_SYMBOL_PRINT(Title, Type, Value, Location) \ -do { \ - if (yydebug) \ - { \ - YYFPRINTF (stderr, "%s ", Title); \ - yy_symbol_print (stderr, \ - Type, Value); \ - YYFPRINTF (stderr, "\n"); \ - } \ -} while (YYID (0)) - - -/*--------------------------------. -| Print this symbol on YYOUTPUT. | -`--------------------------------*/ - -/*ARGSUSED*/ -#if (defined __STDC__ || defined __C99__FUNC__ \ - || defined __cplusplus || defined _MSC_VER) -static void -yy_symbol_value_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep) -#else -static void -yy_symbol_value_print (yyoutput, yytype, yyvaluep) - FILE *yyoutput; - int yytype; - YYSTYPE const * const yyvaluep; -#endif -{ - if (!yyvaluep) - return; -# ifdef YYPRINT - if (yytype < YYNTOKENS) - YYPRINT (yyoutput, yytoknum[yytype], *yyvaluep); -# else - YYUSE (yyoutput); -# endif - switch (yytype) - { - default: - break; - } -} - - -/*--------------------------------. -| Print this symbol on YYOUTPUT. | -`--------------------------------*/ - -#if (defined __STDC__ || defined __C99__FUNC__ \ - || defined __cplusplus || defined _MSC_VER) -static void -yy_symbol_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep) -#else -static void -yy_symbol_print (yyoutput, yytype, yyvaluep) - FILE *yyoutput; - int yytype; - YYSTYPE const * const yyvaluep; -#endif -{ - if (yytype < YYNTOKENS) - YYFPRINTF (yyoutput, "token %s (", yytname[yytype]); - else - YYFPRINTF (yyoutput, "nterm %s (", yytname[yytype]); - - yy_symbol_value_print (yyoutput, yytype, yyvaluep); - YYFPRINTF (yyoutput, ")"); -} - -/*------------------------------------------------------------------. -| yy_stack_print -- Print the state stack from its BOTTOM up to its | -| TOP (included). | -`------------------------------------------------------------------*/ - -#if (defined __STDC__ || defined __C99__FUNC__ \ - || defined __cplusplus || defined _MSC_VER) -static void -yy_stack_print (yytype_int16 *bottom, yytype_int16 *top) -#else -static void -yy_stack_print (bottom, top) - yytype_int16 *bottom; - yytype_int16 *top; -#endif -{ - YYFPRINTF (stderr, "Stack now"); - for (; bottom <= top; ++bottom) - YYFPRINTF (stderr, " %d", *bottom); - YYFPRINTF (stderr, "\n"); -} - -# define YY_STACK_PRINT(Bottom, Top) \ -do { \ - if (yydebug) \ - yy_stack_print ((Bottom), (Top)); \ -} while (YYID (0)) - - -/*------------------------------------------------. -| Report that the YYRULE is going to be reduced. | -`------------------------------------------------*/ - -#if (defined __STDC__ || defined __C99__FUNC__ \ - || defined __cplusplus || defined _MSC_VER) -static void -yy_reduce_print (YYSTYPE *yyvsp, int yyrule) -#else -static void -yy_reduce_print (yyvsp, yyrule) - YYSTYPE *yyvsp; - int yyrule; -#endif -{ - int yynrhs = yyr2[yyrule]; - int yyi; - unsigned long int yylno = yyrline[yyrule]; - YYFPRINTF (stderr, "Reducing stack by rule %d (line %lu):\n", - yyrule - 1, yylno); - /* The symbols being reduced. */ - for (yyi = 0; yyi < yynrhs; yyi++) - { - fprintf (stderr, " $%d = ", yyi + 1); - yy_symbol_print (stderr, yyrhs[yyprhs[yyrule] + yyi], - &(yyvsp[(yyi + 1) - (yynrhs)]) - ); - fprintf (stderr, "\n"); - } -} - -# define YY_REDUCE_PRINT(Rule) \ -do { \ - if (yydebug) \ - yy_reduce_print (yyvsp, Rule); \ -} while (YYID (0)) - -/* Nonzero means print parse trace. It is left uninitialized so that - multiple parsers can coexist. */ -int yydebug; -#else /* !YYDEBUG */ -# define YYDPRINTF(Args) -# define YY_SYMBOL_PRINT(Title, Type, Value, Location) -# define YY_STACK_PRINT(Bottom, Top) -# define YY_REDUCE_PRINT(Rule) -#endif /* !YYDEBUG */ - - -/* YYINITDEPTH -- initial size of the parser's stacks. */ -#ifndef YYINITDEPTH -# define YYINITDEPTH 200 -#endif - -/* YYMAXDEPTH -- maximum size the stacks can grow to (effective only - if the built-in stack extension method is used). - - Do not make this value too large; the results are undefined if - YYSTACK_ALLOC_MAXIMUM < YYSTACK_BYTES (YYMAXDEPTH) - evaluated with infinite-precision integer arithmetic. */ - -#ifndef YYMAXDEPTH -# define YYMAXDEPTH 10000 -#endif - - - -#if YYERROR_VERBOSE - -# ifndef yystrlen -# if defined __GLIBC__ && defined _STRING_H -# define yystrlen strlen -# else -/* Return the length of YYSTR. */ -#if (defined __STDC__ || defined __C99__FUNC__ \ - || defined __cplusplus || defined _MSC_VER) -static YYSIZE_T -yystrlen (const char *yystr) -#else -static YYSIZE_T -yystrlen (yystr) - const char *yystr; -#endif -{ - YYSIZE_T yylen; - for (yylen = 0; yystr[yylen]; yylen++) - continue; - return yylen; -} -# endif -# endif - -# ifndef yystpcpy -# if defined __GLIBC__ && defined _STRING_H && defined _GNU_SOURCE -# define yystpcpy stpcpy -# else -/* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in - YYDEST. */ -#if (defined __STDC__ || defined __C99__FUNC__ \ - || defined __cplusplus || defined _MSC_VER) -static char * -yystpcpy (char *yydest, const char *yysrc) -#else -static char * -yystpcpy (yydest, yysrc) - char *yydest; - const char *yysrc; -#endif -{ - char *yyd = yydest; - const char *yys = yysrc; - - while ((*yyd++ = *yys++) != '\0') - continue; - - return yyd - 1; -} -# endif -# endif - -# ifndef yytnamerr -/* Copy to YYRES the contents of YYSTR after stripping away unnecessary - quotes and backslashes, so that it's suitable for yyerror. The - heuristic is that double-quoting is unnecessary unless the string - contains an apostrophe, a comma, or backslash (other than - backslash-backslash). YYSTR is taken from yytname. If YYRES is - null, do not copy; instead, return the length of what the result - would have been. */ -static YYSIZE_T -yytnamerr (char *yyres, const char *yystr) -{ - if (*yystr == '"') - { - YYSIZE_T yyn = 0; - char const *yyp = yystr; - - for (;;) - switch (*++yyp) - { - case '\'': - case ',': - goto do_not_strip_quotes; - - case '\\': - if (*++yyp != '\\') - goto do_not_strip_quotes; - /* Fall through. */ - default: - if (yyres) - yyres[yyn] = *yyp; - yyn++; - break; - - case '"': - if (yyres) - yyres[yyn] = '\0'; - return yyn; - } - do_not_strip_quotes: ; - } - - if (! yyres) - return yystrlen (yystr); - - return yystpcpy (yyres, yystr) - yyres; -} -# endif - -/* Copy into YYRESULT an error message about the unexpected token - YYCHAR while in state YYSTATE. Return the number of bytes copied, - including the terminating null byte. If YYRESULT is null, do not - copy anything; just return the number of bytes that would be - copied. As a special case, return 0 if an ordinary "syntax error" - message will do. Return YYSIZE_MAXIMUM if overflow occurs during - size calculation. */ -static YYSIZE_T -yysyntax_error (char *yyresult, int yystate, int yychar) -{ - int yyn = yypact[yystate]; - - if (! (YYPACT_NINF < yyn && yyn <= YYLAST)) - return 0; - else - { - int yytype = YYTRANSLATE (yychar); - YYSIZE_T yysize0 = yytnamerr (0, yytname[yytype]); - YYSIZE_T yysize = yysize0; - YYSIZE_T yysize1; - int yysize_overflow = 0; - enum { YYERROR_VERBOSE_ARGS_MAXIMUM = 5 }; - char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM]; - int yyx; - -# if 0 - /* This is so xgettext sees the translatable formats that are - constructed on the fly. */ - YY_("syntax error, unexpected %s"); - YY_("syntax error, unexpected %s, expecting %s"); - YY_("syntax error, unexpected %s, expecting %s or %s"); - YY_("syntax error, unexpected %s, expecting %s or %s or %s"); - YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s"); -# endif - char *yyfmt; - char const *yyf; - static char const yyunexpected[] = "syntax error, unexpected %s"; - static char const yyexpecting[] = ", expecting %s"; - static char const yyor[] = " or %s"; - char yyformat[sizeof yyunexpected - + sizeof yyexpecting - 1 - + ((YYERROR_VERBOSE_ARGS_MAXIMUM - 2) - * (sizeof yyor - 1))]; - char const *yyprefix = yyexpecting; - - /* Start YYX at -YYN if negative to avoid negative indexes in - YYCHECK. */ - int yyxbegin = yyn < 0 ? -yyn : 0; - - /* Stay within bounds of both yycheck and yytname. */ - int yychecklim = YYLAST - yyn + 1; - int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS; - int yycount = 1; - - yyarg[0] = yytname[yytype]; - yyfmt = yystpcpy (yyformat, yyunexpected); - - for (yyx = yyxbegin; yyx < yyxend; ++yyx) - if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR) - { - if (yycount == YYERROR_VERBOSE_ARGS_MAXIMUM) - { - yycount = 1; - yysize = yysize0; - yyformat[sizeof yyunexpected - 1] = '\0'; - break; - } - yyarg[yycount++] = yytname[yyx]; - yysize1 = yysize + yytnamerr (0, yytname[yyx]); - yysize_overflow |= (yysize1 < yysize); - yysize = yysize1; - yyfmt = yystpcpy (yyfmt, yyprefix); - yyprefix = yyor; - } - - yyf = YY_(yyformat); - yysize1 = yysize + yystrlen (yyf); - yysize_overflow |= (yysize1 < yysize); - yysize = yysize1; - - if (yysize_overflow) - return YYSIZE_MAXIMUM; - - if (yyresult) - { - /* Avoid sprintf, as that infringes on the user's name space. - Don't have undefined behavior even if the translation - produced a string with the wrong number of "%s"s. */ - char *yyp = yyresult; - int yyi = 0; - while ((*yyp = *yyf) != '\0') - { - if (*yyp == '%' && yyf[1] == 's' && yyi < yycount) - { - yyp += yytnamerr (yyp, yyarg[yyi++]); - yyf += 2; - } - else - { - yyp++; - yyf++; - } - } - } - return yysize; - } -} -#endif /* YYERROR_VERBOSE */ - - -/*-----------------------------------------------. -| Release the memory associated to this symbol. | -`-----------------------------------------------*/ - -/*ARGSUSED*/ -#if (defined __STDC__ || defined __C99__FUNC__ \ - || defined __cplusplus || defined _MSC_VER) -static void -yydestruct (const char *yymsg, int yytype, YYSTYPE *yyvaluep) -#else -static void -yydestruct (yymsg, yytype, yyvaluep) - const char *yymsg; - int yytype; - YYSTYPE *yyvaluep; -#endif -{ - YYUSE (yyvaluep); - - if (!yymsg) - yymsg = "Deleting"; - YY_SYMBOL_PRINT (yymsg, yytype, yyvaluep, yylocationp); - - switch (yytype) - { - - default: - break; - } -} - - -/* Prevent warnings from -Wmissing-prototypes. */ - -#ifdef YYPARSE_PARAM -#if defined __STDC__ || defined __cplusplus -int yyparse (void *YYPARSE_PARAM); -#else -int yyparse (); -#endif -#else /* ! YYPARSE_PARAM */ -#if defined __STDC__ || defined __cplusplus -int yyparse (void); -#else -int yyparse (); -#endif -#endif /* ! YYPARSE_PARAM */ - - - -/* The look-ahead symbol. */ -int yychar; - -/* The semantic value of the look-ahead symbol. */ -YYSTYPE yylval; - -/* Number of syntax errors so far. */ -int yynerrs; - - - -/*----------. -| yyparse. | -`----------*/ - -#ifdef YYPARSE_PARAM -#if (defined __STDC__ || defined __C99__FUNC__ \ - || defined __cplusplus || defined _MSC_VER) -int -yyparse (void *YYPARSE_PARAM) -#else -int -yyparse (YYPARSE_PARAM) - void *YYPARSE_PARAM; -#endif -#else /* ! YYPARSE_PARAM */ -#if (defined __STDC__ || defined __C99__FUNC__ \ - || defined __cplusplus || defined _MSC_VER) -int -yyparse (void) -#else -int -yyparse () - -#endif -#endif -{ - - int yystate; - int yyn; - int yyresult; - /* Number of tokens to shift before error messages enabled. */ - int yyerrstatus; - /* Look-ahead token as an internal (translated) token number. */ - int yytoken = 0; -#if YYERROR_VERBOSE - /* Buffer for error messages, and its allocated size. */ - char yymsgbuf[128]; - char *yymsg = yymsgbuf; - YYSIZE_T yymsg_alloc = sizeof yymsgbuf; -#endif - - /* Three stacks and their tools: - `yyss': related to states, - `yyvs': related to semantic values, - `yyls': related to locations. - - Refer to the stacks thru separate pointers, to allow yyoverflow - to reallocate them elsewhere. */ - - /* The state stack. */ - yytype_int16 yyssa[YYINITDEPTH]; - yytype_int16 *yyss = yyssa; - yytype_int16 *yyssp; - - /* The semantic value stack. */ - YYSTYPE yyvsa[YYINITDEPTH]; - YYSTYPE *yyvs = yyvsa; - YYSTYPE *yyvsp; - - - -#define YYPOPSTACK(N) (yyvsp -= (N), yyssp -= (N)) - - YYSIZE_T yystacksize = YYINITDEPTH; - - /* The variables used to return semantic value and location from the - action routines. */ - YYSTYPE yyval; - - - /* The number of symbols on the RHS of the reduced rule. - Keep to zero when no symbol should be popped. */ - int yylen = 0; - - YYDPRINTF ((stderr, "Starting parse\n")); - - yystate = 0; - yyerrstatus = 0; - yynerrs = 0; - yychar = YYEMPTY; /* Cause a token to be read. */ - - /* Initialize stack pointers. - Waste one element of value and location stack - so that they stay on the same level as the state stack. - The wasted elements are never initialized. */ - - yyssp = yyss; - yyvsp = yyvs; - - goto yysetstate; - -/*------------------------------------------------------------. -| yynewstate -- Push a new state, which is found in yystate. | -`------------------------------------------------------------*/ - yynewstate: - /* In all cases, when you get here, the value and location stacks - have just been pushed. So pushing a state here evens the stacks. */ - yyssp++; - - yysetstate: - *yyssp = yystate; - - if (yyss + yystacksize - 1 <= yyssp) - { - /* Get the current used size of the three stacks, in elements. */ - YYSIZE_T yysize = yyssp - yyss + 1; - -#ifdef yyoverflow - { - /* Give user a chance to reallocate the stack. Use copies of - these so that the &'s don't force the real ones into - memory. */ - YYSTYPE *yyvs1 = yyvs; - yytype_int16 *yyss1 = yyss; - - - /* Each stack pointer address is followed by the size of the - data in use in that stack, in bytes. This used to be a - conditional around just the two extra args, but that might - be undefined if yyoverflow is a macro. */ - yyoverflow (YY_("memory exhausted"), - &yyss1, yysize * sizeof (*yyssp), - &yyvs1, yysize * sizeof (*yyvsp), - - &yystacksize); - - yyss = yyss1; - yyvs = yyvs1; - } -#else /* no yyoverflow */ -# ifndef YYSTACK_RELOCATE - goto yyexhaustedlab; -# else - /* Extend the stack our own way. */ - if (YYMAXDEPTH <= yystacksize) - goto yyexhaustedlab; - yystacksize *= 2; - if (YYMAXDEPTH < yystacksize) - yystacksize = YYMAXDEPTH; - - { - yytype_int16 *yyss1 = yyss; - union yyalloc *yyptr = - (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize)); - if (! yyptr) - goto yyexhaustedlab; - YYSTACK_RELOCATE (yyss); - YYSTACK_RELOCATE (yyvs); - -# undef YYSTACK_RELOCATE - if (yyss1 != yyssa) - YYSTACK_FREE (yyss1); - } -# endif -#endif /* no yyoverflow */ - - yyssp = yyss + yysize - 1; - yyvsp = yyvs + yysize - 1; - - - YYDPRINTF ((stderr, "Stack size increased to %lu\n", - (unsigned long int) yystacksize)); - - if (yyss + yystacksize - 1 <= yyssp) - YYABORT; - } - - YYDPRINTF ((stderr, "Entering state %d\n", yystate)); - - goto yybackup; - -/*-----------. -| yybackup. | -`-----------*/ -yybackup: - - /* Do appropriate processing given the current state. Read a - look-ahead token if we need one and don't already have one. */ - - /* First try to decide what to do without reference to look-ahead token. */ - yyn = yypact[yystate]; - if (yyn == YYPACT_NINF) - goto yydefault; - - /* Not known => get a look-ahead token if don't already have one. */ - - /* YYCHAR is either YYEMPTY or YYEOF or a valid look-ahead symbol. */ - if (yychar == YYEMPTY) - { - YYDPRINTF ((stderr, "Reading a token: ")); - yychar = YYLEX; - } - - if (yychar <= YYEOF) - { - yychar = yytoken = YYEOF; - YYDPRINTF ((stderr, "Now at end of input.\n")); - } - else - { - yytoken = YYTRANSLATE (yychar); - YY_SYMBOL_PRINT ("Next token is", yytoken, &yylval, &yylloc); - } - - /* If the proper action on seeing token YYTOKEN is to reduce or to - detect an error, take that action. */ - yyn += yytoken; - if (yyn < 0 || YYLAST < yyn || yycheck[yyn] != yytoken) - goto yydefault; - yyn = yytable[yyn]; - if (yyn <= 0) - { - if (yyn == 0 || yyn == YYTABLE_NINF) - goto yyerrlab; - yyn = -yyn; - goto yyreduce; - } - - if (yyn == YYFINAL) - YYACCEPT; - - /* Count tokens shifted since error; after three, turn off error - status. */ - if (yyerrstatus) - yyerrstatus--; - - /* Shift the look-ahead token. */ - YY_SYMBOL_PRINT ("Shifting", yytoken, &yylval, &yylloc); - - /* Discard the shifted token unless it is eof. */ - if (yychar != YYEOF) - yychar = YYEMPTY; - - yystate = yyn; - *++yyvsp = yylval; - - goto yynewstate; - - -/*-----------------------------------------------------------. -| yydefault -- do the default action for the current state. | -`-----------------------------------------------------------*/ -yydefault: - yyn = yydefact[yystate]; - if (yyn == 0) - goto yyerrlab; - goto yyreduce; - - -/*-----------------------------. -| yyreduce -- Do a reduction. | -`-----------------------------*/ -yyreduce: - /* yyn is the number of a rule to reduce with. */ - yylen = yyr2[yyn]; - - /* If YYLEN is nonzero, implement the default value of the action: - `$$ = $1'. - - Otherwise, the following line sets YYVAL to garbage. - This behavior is undocumented and Bison - users should not rely upon it. Assigning to YYVAL - unconditionally makes the parser a bit smaller, and it avoids a - GCC warning that YYVAL may be used uninitialized. */ - yyval = yyvsp[1-yylen]; - - - YY_REDUCE_PRINT (yyn); - switch (yyn) - { - case 2: -#line 99 "gse.y" - { - ((gse_arg *)arg)->set_gsec( - build_gse_clause((gse_arg *)(arg), (yyvsp[(1) - (3)].id), (yyvsp[(2) - (3)].op), (yyvsp[(3) - (3)].val))); - (yyval.boolean) = true; - ;} - break; - - case 3: -#line 105 "gse.y" - { - ((gse_arg *)arg)->set_gsec( - build_rev_gse_clause((gse_arg *)(arg), (yyvsp[(3) - (3)].id), (yyvsp[(2) - (3)].op), (yyvsp[(1) - (3)].val))); - (yyval.boolean) = true; - ;} - break; - - case 4: -#line 111 "gse.y" - { - ((gse_arg *)arg)->set_gsec( - build_dual_gse_clause((gse_arg *)(arg), (yyvsp[(3) - (5)].id), (yyvsp[(2) - (5)].op), (yyvsp[(1) - (5)].val), (yyvsp[(4) - (5)].op), - (yyvsp[(5) - (5)].val))); - (yyval.boolean) = true; - ;} - break; - - -/* Line 1267 of yacc.c. */ -#line 1407 "gse.tab.cc" - default: break; - } - YY_SYMBOL_PRINT ("-> $$ =", yyr1[yyn], &yyval, &yyloc); - - YYPOPSTACK (yylen); - yylen = 0; - YY_STACK_PRINT (yyss, yyssp); - - *++yyvsp = yyval; - - - /* Now `shift' the result of the reduction. Determine what state - that goes to, based on the state we popped back to and the rule - number reduced by. */ - - yyn = yyr1[yyn]; - - yystate = yypgoto[yyn - YYNTOKENS] + *yyssp; - if (0 <= yystate && yystate <= YYLAST && yycheck[yystate] == *yyssp) - yystate = yytable[yystate]; - else - yystate = yydefgoto[yyn - YYNTOKENS]; - - goto yynewstate; - - -/*------------------------------------. -| yyerrlab -- here on detecting error | -`------------------------------------*/ -yyerrlab: - /* If not already recovering from an error, report this error. */ - if (!yyerrstatus) - { - ++yynerrs; -#if ! YYERROR_VERBOSE - yyerror (YY_("syntax error")); -#else - { - YYSIZE_T yysize = yysyntax_error (0, yystate, yychar); - if (yymsg_alloc < yysize && yymsg_alloc < YYSTACK_ALLOC_MAXIMUM) - { - YYSIZE_T yyalloc = 2 * yysize; - if (! (yysize <= yyalloc && yyalloc <= YYSTACK_ALLOC_MAXIMUM)) - yyalloc = YYSTACK_ALLOC_MAXIMUM; - if (yymsg != yymsgbuf) - YYSTACK_FREE (yymsg); - yymsg = (char *) YYSTACK_ALLOC (yyalloc); - if (yymsg) - yymsg_alloc = yyalloc; - else - { - yymsg = yymsgbuf; - yymsg_alloc = sizeof yymsgbuf; - } - } - - if (0 < yysize && yysize <= yymsg_alloc) - { - (void) yysyntax_error (yymsg, yystate, yychar); - yyerror (yymsg); - } - else - { - yyerror (YY_("syntax error")); - if (yysize != 0) - goto yyexhaustedlab; - } - } -#endif - } - - - - if (yyerrstatus == 3) - { - /* If just tried and failed to reuse look-ahead token after an - error, discard it. */ - - if (yychar <= YYEOF) - { - /* Return failure if at end of input. */ - if (yychar == YYEOF) - YYABORT; - } - else - { - yydestruct ("Error: discarding", - yytoken, &yylval); - yychar = YYEMPTY; - } - } - - /* Else will try to reuse look-ahead token after shifting the error - token. */ - goto yyerrlab1; - - -/*---------------------------------------------------. -| yyerrorlab -- error raised explicitly by YYERROR. | -`---------------------------------------------------*/ -yyerrorlab: - - /* Pacify compilers like GCC when the user code never invokes - YYERROR and the label yyerrorlab therefore never appears in user - code. */ - if (/*CONSTCOND*/ 0) - goto yyerrorlab; - - /* Do not reclaim the symbols of the rule which action triggered - this YYERROR. */ - YYPOPSTACK (yylen); - yylen = 0; - YY_STACK_PRINT (yyss, yyssp); - yystate = *yyssp; - goto yyerrlab1; - - -/*-------------------------------------------------------------. -| yyerrlab1 -- common code for both syntax error and YYERROR. | -`-------------------------------------------------------------*/ -yyerrlab1: - yyerrstatus = 3; /* Each real token shifted decrements this. */ - - for (;;) - { - yyn = yypact[yystate]; - if (yyn != YYPACT_NINF) - { - yyn += YYTERROR; - if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR) - { - yyn = yytable[yyn]; - if (0 < yyn) - break; - } - } - - /* Pop the current state because it cannot handle the error token. */ - if (yyssp == yyss) - YYABORT; - - - yydestruct ("Error: popping", - yystos[yystate], yyvsp); - YYPOPSTACK (1); - yystate = *yyssp; - YY_STACK_PRINT (yyss, yyssp); - } - - if (yyn == YYFINAL) - YYACCEPT; - - *++yyvsp = yylval; - - - /* Shift the error token. */ - YY_SYMBOL_PRINT ("Shifting", yystos[yyn], yyvsp, yylsp); - - yystate = yyn; - goto yynewstate; - - -/*-------------------------------------. -| yyacceptlab -- YYACCEPT comes here. | -`-------------------------------------*/ -yyacceptlab: - yyresult = 0; - goto yyreturn; - -/*-----------------------------------. -| yyabortlab -- YYABORT comes here. | -`-----------------------------------*/ -yyabortlab: - yyresult = 1; - goto yyreturn; - -#ifndef yyoverflow -/*-------------------------------------------------. -| yyexhaustedlab -- memory exhaustion comes here. | -`-------------------------------------------------*/ -yyexhaustedlab: - yyerror (YY_("memory exhausted")); - yyresult = 2; - /* Fall through. */ -#endif - -yyreturn: - if (yychar != YYEOF && yychar != YYEMPTY) - yydestruct ("Cleanup: discarding lookahead", - yytoken, &yylval); - /* Do not reclaim the symbols of the rule which action triggered - this YYABORT or YYACCEPT. */ - YYPOPSTACK (yylen); - YY_STACK_PRINT (yyss, yyssp); - while (yyssp != yyss) - { - yydestruct ("Cleanup: popping", - yystos[*yyssp], yyvsp); - YYPOPSTACK (1); - } -#ifndef yyoverflow - if (yyss != yyssa) - YYSTACK_FREE (yyss); -#endif -#if YYERROR_VERBOSE - if (yymsg != yymsgbuf) - YYSTACK_FREE (yymsg); -#endif - /* Make sure YYID is used. */ - return YYID (yyresult); -} - - -#line 134 "gse.y" - - -void -gse_error(const char *) -{ - throw Error( -"An expression passed to the grid() function could not be parsed.\n\ -Examples of expressions that will work are: \"i>=10.0\" or \"23.6get_grid(), (string)id, val, decode_relop(op)); -} - -// Build a GSE Clause given that the operands are reversed. - -GSEClause * -build_rev_gse_clause(gse_arg *arg, char id[ID_MAX], int op, double val) -{ - return new GSEClause(arg->get_grid(), (string)id, val, - decode_inverse_relop(op)); -} - -GSEClause * -build_dual_gse_clause(gse_arg *arg, char id[ID_MAX], int op1, double val1, - int op2, double val2) -{ - // Check that the operands (op1 and op2) and the values (val1 and val2) - // describe a monotonic interval. - relop rop1 = decode_inverse_relop(op1); - relop rop2 = decode_relop(op2); - - switch (rop1) { - case dods_less_op: - case dods_less_equal_op: - if (rop2 == dods_less_op || rop2 == dods_less_equal_op) - throw Error(malformed_expr, -"GSE Clause operands must define a monotonic interval."); - break; - case dods_greater_op: - case dods_greater_equal_op: - if (rop2 == dods_greater_op || rop2 == dods_greater_equal_op) - throw Error(malformed_expr, -"GSE Clause operands must define a monotonic interval."); - break; - case dods_equal_op: - break; - default: - throw Error(malformed_expr, "Unrecognized relational operator."); - } - - return new GSEClause(arg->get_grid(), (string)id, val1, rop1, val2, rop2); -} - - diff -Nru libdap-3.11.1/gse.tab.hh libdap-3.12.0/gse.tab.hh --- libdap-3.11.1/gse.tab.hh 2011-05-06 17:50:25.000000000 +0000 +++ libdap-3.12.0/gse.tab.hh 1970-01-01 00:00:00.000000000 +0000 @@ -1,88 +0,0 @@ -/* A Bison parser, made by GNU Bison 2.3. */ - -/* Skeleton interface for Bison's Yacc-like parsers in C - - Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004, 2005, 2006 - Free Software Foundation, Inc. - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2, or (at your option) - 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., 51 Franklin Street, Fifth Floor, - Boston, MA 02110-1301, USA. */ - -/* As a special exception, you may create a larger work that contains - part or all of the Bison parser skeleton and distribute that work - under terms of your choice, so long as that work isn't itself a - parser generator using the skeleton or a modified version thereof - as a parser skeleton. Alternatively, if you modify or redistribute - the parser skeleton itself, you may (at your option) remove this - special exception, which will cause the skeleton and the resulting - Bison output files to be licensed under the GNU General Public - License without this special exception. - - This special exception was added by the Free Software Foundation in - version 2.2 of Bison. */ - -/* Tokens. */ -#ifndef YYTOKENTYPE -# define YYTOKENTYPE - /* Put the tokens into the symbol table, so that GDB and other debuggers - know about them. */ - enum yytokentype { - SCAN_INT = 258, - SCAN_FLOAT = 259, - SCAN_WORD = 260, - SCAN_FIELD = 261, - SCAN_EQUAL = 262, - SCAN_NOT_EQUAL = 263, - SCAN_GREATER = 264, - SCAN_GREATER_EQL = 265, - SCAN_LESS = 266, - SCAN_LESS_EQL = 267 - }; -#endif -/* Tokens. */ -#define SCAN_INT 258 -#define SCAN_FLOAT 259 -#define SCAN_WORD 260 -#define SCAN_FIELD 261 -#define SCAN_EQUAL 262 -#define SCAN_NOT_EQUAL 263 -#define SCAN_GREATER 264 -#define SCAN_GREATER_EQL 265 -#define SCAN_LESS 266 -#define SCAN_LESS_EQL 267 - - - - -#if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED -typedef union YYSTYPE -#line 70 "gse.y" -{ - bool boolean; - - int op; - char id[ID_MAX]; - double val; -} -/* Line 1489 of yacc.c. */ -#line 81 "gse.tab.hh" - YYSTYPE; -# define yystype YYSTYPE /* obsolescent; will be withdrawn */ -# define YYSTYPE_IS_DECLARED 1 -# define YYSTYPE_IS_TRIVIAL 1 -#endif - -extern YYSTYPE gse_lval; - diff -Nru libdap-3.11.1/gse.y libdap-3.12.0/gse.y --- libdap-3.11.1/gse.y 2011-04-29 13:19:43.000000000 +0000 +++ libdap-3.12.0/gse.y 1970-01-01 00:00:00.000000000 +0000 @@ -1,228 +0,0 @@ - -// -*- mode: c++; c-basic-offset:4 -*- - -// This file is part of libdap, A C++ implementation of the OPeNDAP Data -// Access Protocol. - -// Copyright (c) 2002,2003 OPeNDAP, Inc. -// Author: James Gallagher -// -// This library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Lesser General Public -// License as published by the Free Software Foundation; either -// version 2.1 of the License, or (at your option) any later version. -// -// This library 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 -// Lesser General Public License for more details. -// -// You should have received a copy of the GNU Lesser General Public -// License along with this library; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -// -// You can contact OPeNDAP, Inc. at PO Box 112, Saunderstown, RI. 02874-0112. - -// (c) COPYRIGHT URI/MIT 1999 -// Please read the full copyright statement in the file COPYRIGHT_URI. -// -// Authors: -// jhrg,jimg James Gallagher - -// Parse a Grid selection expression. This parser is a little different than -// the other parsers and uses its own argument class. See parser.h. - -%{ - -#include "config_dap.h" - -static char rcsid[] not_used = {"$Id: gse.y 17856 2008-02-02 21:25:59Z pwest $"}; - -#include - -#include "Error.h" -#include "GSEClause.h" -#include "gse_parser.h" - -using std::cerr; -using std::endl; -using namespace libdap; - -// This macro is used to access the instance of a gse_arg class which is -// passed to the parser through a void *. See parser.h. - -#define gse_arg(arg) ((gse_arg *)(arg)) - -// Assume bison 1.25 -#define YYPARSE_PARAM arg - -int gse_lex(void); -void gse_error(const char *str); -GSEClause *build_gse_clause(gse_arg *arg, char id[ID_MAX], int op, double val); -GSEClause *build_rev_gse_clause(gse_arg *arg, char id[ID_MAX], int op, - double val); -GSEClause * -build_dual_gse_clause(gse_arg *arg, char id[ID_MAX], int op1, double val1, - int op2, double val2); - -%} - -%union { - bool boolean; - - int op; - char id[ID_MAX]; - double val; -} - -%token SCAN_INT -%token SCAN_FLOAT - -%token SCAN_WORD -%token SCAN_FIELD - -%token SCAN_EQUAL -%token SCAN_NOT_EQUAL -%token SCAN_GREATER -%token SCAN_GREATER_EQL -%token SCAN_LESS -%token SCAN_LESS_EQL - -%type clause -%type identifier -%type relop -%type constant - -%% - -clause: identifier relop constant - { - ((gse_arg *)arg)->set_gsec( - build_gse_clause((gse_arg *)(arg), $1, $2, $3)); - $$ = true; - } - | constant relop identifier - { - ((gse_arg *)arg)->set_gsec( - build_rev_gse_clause((gse_arg *)(arg), $3, $2, $1)); - $$ = true; - } - | constant relop identifier relop constant - { - ((gse_arg *)arg)->set_gsec( - build_dual_gse_clause((gse_arg *)(arg), $3, $2, $1, $4, - $5)); - $$ = true; - } -; - -identifier: SCAN_WORD -; - -constant: SCAN_INT - | SCAN_FLOAT -; - -relop: SCAN_EQUAL - | SCAN_NOT_EQUAL - | SCAN_GREATER - | SCAN_GREATER_EQL - | SCAN_LESS - | SCAN_LESS_EQL -; - -%% - -void -gse_error(const char *) -{ - throw Error( -"An expression passed to the grid() function could not be parsed.\n\ -Examples of expressions that will work are: \"i>=10.0\" or \"23.6get_grid(), (string)id, val, decode_relop(op)); -} - -// Build a GSE Clause given that the operands are reversed. - -GSEClause * -build_rev_gse_clause(gse_arg *arg, char id[ID_MAX], int op, double val) -{ - return new GSEClause(arg->get_grid(), (string)id, val, - decode_inverse_relop(op)); -} - -GSEClause * -build_dual_gse_clause(gse_arg *arg, char id[ID_MAX], int op1, double val1, - int op2, double val2) -{ - // Check that the operands (op1 and op2) and the values (val1 and val2) - // describe a monotonic interval. - relop rop1 = decode_inverse_relop(op1); - relop rop2 = decode_relop(op2); - - switch (rop1) { - case dods_less_op: - case dods_less_equal_op: - if (rop2 == dods_less_op || rop2 == dods_less_equal_op) - throw Error(malformed_expr, -"GSE Clause operands must define a monotonic interval."); - break; - case dods_greater_op: - case dods_greater_equal_op: - if (rop2 == dods_greater_op || rop2 == dods_greater_equal_op) - throw Error(malformed_expr, -"GSE Clause operands must define a monotonic interval."); - break; - case dods_equal_op: - break; - default: - throw Error(malformed_expr, "Unrecognized relational operator."); - } - - return new GSEClause(arg->get_grid(), (string)id, val1, rop1, val2, rop2); -} - diff -Nru libdap-3.11.1/gse_parser.h libdap-3.12.0/gse_parser.h --- libdap-3.11.1/gse_parser.h 2011-04-29 13:19:43.000000000 +0000 +++ libdap-3.12.0/gse_parser.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,84 +0,0 @@ -// -*- mode: c++; c-basic-offset:4 -*- - -// This file is part of libdap, A C++ implementation of the OPeNDAP Data -// Access Protocol. - -// Copyright (c) 2006 OPeNDAP, Inc. -// Author: James Gallagher -// -// This library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Lesser General Public -// License as published by the Free Software Foundation; either -// version 2.1 of the License, or (at your option) any later version. -// -// This library 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 -// Lesser General Public License for more details. -// -// You should have received a copy of the GNU Lesser General Public -// License along with this library; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -// -// You can contact OPeNDAP, Inc. at PO Box 112, Saunderstown, RI. 02874-0112. - -#ifndef _gseclause_h -#include "GSEClause.h" -#endif - -#define YYDEBUG 1 -#undef YYERROR_VERBOSE -#define YY_NO_UNPUT 1 - -#define ID_MAX 256 - -#ifndef TRUE -#define TRUE 1 -#define FALSE 0 -#endif - -namespace libdap -{ - -/** Argument to the GSE parser. Assumes all errors will be signaled by - throws; Error objects are not returned. */ -struct gse_arg -{ - GSEClause *_gsec; // The gse parsed. - Grid *_grid; // The Grid being constrained. - int _status; // The parser's status. - - gse_arg(): _gsec(0), _grid(0), _status(1) - {} - gse_arg(Grid *g): _gsec(0), _grid(g), _status(1) - {} - virtual ~gse_arg() - {} - - void set_gsec(GSEClause *gsec) - { - _gsec = gsec; - } - GSEClause *get_gsec() - { - return _gsec; - } - void set_grid(Grid *g) - { - _grid = g; - } - Grid *get_grid() - { - return _grid; - } - void set_status(int stat) - { - _status = stat; - } - int get_status() - { - return _status; - } -}; - -} // namespace libdap diff -Nru libdap-3.11.1/lex.Error.cc libdap-3.12.0/lex.Error.cc --- libdap-3.11.1/lex.Error.cc 2011-05-06 17:50:25.000000000 +0000 +++ libdap-3.12.0/lex.Error.cc 2013-10-17 21:27:40.000000000 +0000 @@ -6,10 +6,29 @@ /* A lexical scanner generated by flex */ +#define yy_create_buffer Error_create_buffer +#define yy_delete_buffer Error_delete_buffer +#define yy_flex_debug Error_flex_debug +#define yy_init_buffer Error_init_buffer +#define yy_flush_buffer Error_flush_buffer +#define yy_load_buffer_state Error_load_buffer_state +#define yy_switch_to_buffer Error_switch_to_buffer +#define yyin Errorin +#define yyleng Errorleng +#define yylex Errorlex +#define yylineno Errorlineno +#define yyout Errorout +#define yyrestart Errorrestart +#define yytext Errortext +#define yywrap Errorwrap +#define yyalloc Erroralloc +#define yyrealloc Errorrealloc +#define yyfree Errorfree + #define FLEX_SCANNER #define YY_FLEX_MAJOR_VERSION 2 #define YY_FLEX_MINOR_VERSION 5 -#define YY_FLEX_SUBMINOR_VERSION 33 +#define YY_FLEX_SUBMINOR_VERSION 35 #if YY_FLEX_SUBMINOR_VERSION > 0 #define FLEX_BETA #endif @@ -31,7 +50,7 @@ /* C99 systems have . Non-C99 systems may or may not. */ -#if __STDC_VERSION__ >= 199901L +#if defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L /* C99 says to define __STDC_LIMIT_MACROS before including stdint.h, * if you want the limit (max/min) macros for int types. @@ -94,11 +113,12 @@ #else /* ! __cplusplus */ -#if __STDC__ +/* C99 requires __STDC__ to be defined as 1. */ +#if defined (__STDC__) #define YY_USE_CONST -#endif /* __STDC__ */ +#endif /* defined (__STDC__) */ #endif /* ! __cplusplus */ #ifdef YY_USE_CONST @@ -178,14 +198,9 @@ #define unput(c) yyunput( c, (yytext_ptr) ) -/* The following is because we cannot portably get our hands on size_t - * (without autoconf's help, which isn't available because we want - * flex-generated scanners to compile on their own). - */ - #ifndef YY_TYPEDEF_YY_SIZE_T #define YY_TYPEDEF_YY_SIZE_T -typedef unsigned int yy_size_t; +typedef size_t yy_size_t; #endif #ifndef YY_STRUCT_YY_BUFFER_STATE @@ -544,19 +559,30 @@ #include "config_dap.h" -static char rcsid[] not_used = {"$Id: Error.lex 18315 2008-03-03 20:14:44Z jimg $"}; +static char rcsid[] not_used = {"$Id: Error.lex 27157 2013-09-28 21:22:52Z jimg $"}; #include #include +#include + +#include + +#include "parser.h" +#include "Error.tab.hh" + +using namespace libdap; #ifndef YY_PROTO #define YY_PROTO(proto) proto #endif -#define YY_NO_UNPUT +//#define YY_NO_UNPUT #define YY_DECL int Errorlex YY_PROTO(( void )) -#include "Error.tab.hh" +#define YY_FATAL_ERROR(msg) {\ + throw(Error(string("Error scanning the error response: ") + string(msg))); \ + yy_fatal_error(msg); /* see das.lex */ \ +} int error_line_num = 1; static int start_line; /* used in quote and comment error handlers */ @@ -564,9 +590,10 @@ void store_integer(); void store_string(); +#define YY_NO_INPUT 1 -#line 570 "lex.Error.cc" +#line 597 "lex.Error.cc" #define INITIAL 0 #define quote 1 @@ -586,6 +613,35 @@ static int yy_init_globals (void ); +/* Accessor methods to globals. + These are made visible to non-reentrant scanners for convenience. */ + +int Errorlex_destroy (void ); + +int Errorget_debug (void ); + +void Errorset_debug (int debug_flag ); + +YY_EXTRA_TYPE Errorget_extra (void ); + +void Errorset_extra (YY_EXTRA_TYPE user_defined ); + +FILE *Errorget_in (void ); + +void Errorset_in (FILE * in_str ); + +FILE *Errorget_out (void ); + +void Errorset_out (FILE * out_str ); + +int Errorget_leng (void ); + +char *Errorget_text (void ); + +int Errorget_lineno (void ); + +void Errorset_lineno (int line_number ); + /* Macros after this point can all be overridden by user definitions in * section 1. */ @@ -598,8 +654,6 @@ #endif #endif - static void yyunput (int c,char *buf_ptr ); - #ifndef yytext_ptr static void yy_flex_strncpy (char *,yyconst char *,int ); #endif @@ -628,7 +682,7 @@ /* This used to be an fputs(), but since the string might contain NUL's, * we now use fwrite(). */ -#define ECHO (void) fwrite( Errortext, Errorleng, 1, Errorout ) +#define ECHO do { if (fwrite( Errortext, Errorleng, 1, Errorout )) {} } while (0) #endif /* Gets input and stuffs it into "buf". number of characters read, or YY_NULL, @@ -639,7 +693,7 @@ if ( YY_CURRENT_BUFFER_LVALUE->yy_is_interactive ) \ { \ int c = '*'; \ - size_t n; \ + unsigned n; \ for ( n = 0; n < max_size && \ (c = getc( Errorin )) != EOF && c != '\n'; ++n ) \ buf[n] = (char) c; \ @@ -721,11 +775,11 @@ register char *yy_cp, *yy_bp; register int yy_act; -#line 82 "Error.lex" +#line 96 "Error.lex" -#line 729 "lex.Error.cc" +#line 783 "lex.Error.cc" if ( !(yy_init) ) { @@ -816,103 +870,103 @@ case 1: YY_RULE_SETUP -#line 85 "Error.lex" +#line 99 "Error.lex" store_string(); return SCAN_ERROR; YY_BREAK case 2: YY_RULE_SETUP -#line 87 "Error.lex" +#line 101 "Error.lex" store_string(); return SCAN_CODE; YY_BREAK case 3: YY_RULE_SETUP -#line 88 "Error.lex" +#line 102 "Error.lex" store_string(); return SCAN_MSG; YY_BREAK case 4: YY_RULE_SETUP -#line 90 "Error.lex" +#line 104 "Error.lex" store_integer(); return SCAN_INT; YY_BREAK case 5: YY_RULE_SETUP -#line 92 "Error.lex" +#line 106 "Error.lex" return (int)*Errortext; YY_BREAK case 6: YY_RULE_SETUP -#line 93 "Error.lex" +#line 107 "Error.lex" return (int)*Errortext; YY_BREAK case 7: YY_RULE_SETUP -#line 94 "Error.lex" +#line 108 "Error.lex" return (int)*Errortext; YY_BREAK case 8: YY_RULE_SETUP -#line 95 "Error.lex" +#line 109 "Error.lex" return (int)*Errortext; YY_BREAK case 9: YY_RULE_SETUP -#line 97 "Error.lex" +#line 111 "Error.lex" YY_BREAK case 10: /* rule 10 can match eol */ YY_RULE_SETUP -#line 98 "Error.lex" +#line 112 "Error.lex" ++error_line_num; YY_BREAK case YY_STATE_EOF(INITIAL): -#line 99 "Error.lex" +#line 113 "Error.lex" yy_init = 1; error_line_num = 1; yyterminate(); YY_BREAK case 11: YY_RULE_SETUP -#line 101 "Error.lex" +#line 115 "Error.lex" BEGIN(comment); YY_BREAK case 12: YY_RULE_SETUP -#line 102 "Error.lex" +#line 116 "Error.lex" YY_BREAK case 13: /* rule 13 can match eol */ YY_RULE_SETUP -#line 103 "Error.lex" +#line 117 "Error.lex" ++error_line_num; BEGIN(INITIAL); YY_BREAK case YY_STATE_EOF(comment): -#line 104 "Error.lex" +#line 118 "Error.lex" yy_init = 1; error_line_num = 1; yyterminate(); YY_BREAK case 14: YY_RULE_SETUP -#line 106 "Error.lex" +#line 120 "Error.lex" BEGIN(quote); start_line = error_line_num; yymore(); YY_BREAK case 15: YY_RULE_SETUP -#line 107 "Error.lex" +#line 121 "Error.lex" yymore(); YY_BREAK case 16: /* rule 16 can match eol */ YY_RULE_SETUP -#line 108 "Error.lex" +#line 122 "Error.lex" yymore(); ++error_line_num; YY_BREAK case 17: YY_RULE_SETUP -#line 109 "Error.lex" +#line 123 "Error.lex" yymore(); YY_BREAK case 18: YY_RULE_SETUP -#line 110 "Error.lex" +#line 124 "Error.lex" { BEGIN(INITIAL); store_string(); @@ -920,10 +974,10 @@ } YY_BREAK case YY_STATE_EOF(quote): -#line 115 "Error.lex" +#line 129 "Error.lex" { char msg[256]; - sprintf(msg, + snprintf(msg, 255, "Unterminated quote (starts on line %d)\n", start_line); YY_FATAL_ERROR(msg); @@ -932,7 +986,7 @@ case 19: /* rule 19 can match eol */ YY_RULE_SETUP -#line 123 "Error.lex" +#line 137 "Error.lex" { if (Errortext) { /* suppress msgs about `' chars */ fprintf(stderr, "Character `%c' is not", *Errortext); @@ -943,10 +997,10 @@ YY_BREAK case 20: YY_RULE_SETUP -#line 130 "Error.lex" +#line 144 "Error.lex" ECHO; YY_BREAK -#line 950 "lex.Error.cc" +#line 1004 "lex.Error.cc" case YY_END_OF_BUFFER: { @@ -1175,7 +1229,7 @@ /* Read in more data. */ YY_INPUT( (&YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move]), - (yy_n_chars), num_to_read ); + (yy_n_chars), (size_t) num_to_read ); YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars); } @@ -1199,6 +1253,14 @@ else ret_val = EOB_ACT_CONTINUE_SCAN; + if ((yy_size_t) ((yy_n_chars) + number_to_move) > YY_CURRENT_BUFFER_LVALUE->yy_buf_size) { + /* Extend the array by 50%, plus the number we really need. */ + yy_size_t new_size = (yy_n_chars) + number_to_move + ((yy_n_chars) >> 1); + YY_CURRENT_BUFFER_LVALUE->yy_ch_buf = (char *) Errorrealloc((void *) YY_CURRENT_BUFFER_LVALUE->yy_ch_buf,new_size ); + if ( ! YY_CURRENT_BUFFER_LVALUE->yy_ch_buf ) + YY_FATAL_ERROR( "out of dynamic memory in yy_get_next_buffer()" ); + } + (yy_n_chars) += number_to_move; YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] = YY_END_OF_BUFFER_CHAR; YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars) + 1] = YY_END_OF_BUFFER_CHAR; @@ -1265,43 +1327,6 @@ return yy_is_jam ? 0 : yy_current_state; } - static void yyunput (int c, register char * yy_bp ) -{ - register char *yy_cp; - - yy_cp = (yy_c_buf_p); - - /* undo effects of setting up Errortext */ - *yy_cp = (yy_hold_char); - - if ( yy_cp < YY_CURRENT_BUFFER_LVALUE->yy_ch_buf + 2 ) - { /* need to shift things up to make room */ - /* +2 for EOB chars. */ - register int number_to_move = (yy_n_chars) + 2; - register char *dest = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[ - YY_CURRENT_BUFFER_LVALUE->yy_buf_size + 2]; - register char *source = - &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move]; - - while ( source > YY_CURRENT_BUFFER_LVALUE->yy_ch_buf ) - *--dest = *--source; - - yy_cp += (int) (dest - source); - yy_bp += (int) (dest - source); - YY_CURRENT_BUFFER_LVALUE->yy_n_chars = - (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_buf_size; - - if ( yy_cp < YY_CURRENT_BUFFER_LVALUE->yy_ch_buf + 2 ) - YY_FATAL_ERROR( "flex scanner push-back overflow" ); - } - - *--yy_cp = (char) c; - - (yytext_ptr) = yy_bp; - (yy_hold_char) = *yy_cp; - (yy_c_buf_p) = yy_cp; -} - #ifndef YY_NO_INPUT #ifdef __cplusplus static int yyinput (void) @@ -1350,7 +1375,7 @@ case EOB_ACT_END_OF_FILE: { if ( Errorwrap( ) ) - return 0; + return EOF; if ( ! (yy_did_buffer_switch_on_eof) ) YY_NEW_FILE; @@ -1614,7 +1639,9 @@ (yy_buffer_stack) = (struct yy_buffer_state**)Erroralloc (num_to_alloc * sizeof(struct yy_buffer_state*) ); - + if ( ! (yy_buffer_stack) ) + YY_FATAL_ERROR( "out of dynamic memory in Errorensure_buffer_stack()" ); + memset((yy_buffer_stack), 0, num_to_alloc * sizeof(struct yy_buffer_state*)); (yy_buffer_stack_max) = num_to_alloc; @@ -1632,6 +1659,8 @@ ((yy_buffer_stack), num_to_alloc * sizeof(struct yy_buffer_state*) ); + if ( ! (yy_buffer_stack) ) + YY_FATAL_ERROR( "out of dynamic memory in Errorensure_buffer_stack()" ); /* zero only the new slots.*/ memset((yy_buffer_stack) + (yy_buffer_stack_max), 0, grow_size * sizeof(struct yy_buffer_state*)); @@ -1676,7 +1705,7 @@ /** Setup the input buffer state to scan a string. The next call to Errorlex() will * scan from a @e copy of @a str. - * @param str a NUL-terminated string to scan + * @param yystr a NUL-terminated string to scan * * @return the newly allocated buffer state object. * @note If you want to scan bytes that may contain NUL values, then use @@ -1930,7 +1959,7 @@ #define YYTABLES_NAME "yytables" -#line 130 "Error.lex" +#line 144 "Error.lex" diff -Nru libdap-3.11.1/lex.ce_expr.cc libdap-3.12.0/lex.ce_expr.cc --- libdap-3.11.1/lex.ce_expr.cc 2011-05-06 17:50:24.000000000 +0000 +++ libdap-3.12.0/lex.ce_expr.cc 2013-10-17 21:27:40.000000000 +0000 @@ -6,10 +6,29 @@ /* A lexical scanner generated by flex */ +#define yy_create_buffer ce_expr_create_buffer +#define yy_delete_buffer ce_expr_delete_buffer +#define yy_flex_debug ce_expr_flex_debug +#define yy_init_buffer ce_expr_init_buffer +#define yy_flush_buffer ce_expr_flush_buffer +#define yy_load_buffer_state ce_expr_load_buffer_state +#define yy_switch_to_buffer ce_expr_switch_to_buffer +#define yyin ce_exprin +#define yyleng ce_exprleng +#define yylex ce_exprlex +#define yylineno ce_exprlineno +#define yyout ce_exprout +#define yyrestart ce_exprrestart +#define yytext ce_exprtext +#define yywrap ce_exprwrap +#define yyalloc ce_expralloc +#define yyrealloc ce_exprrealloc +#define yyfree ce_exprfree + #define FLEX_SCANNER #define YY_FLEX_MAJOR_VERSION 2 #define YY_FLEX_MINOR_VERSION 5 -#define YY_FLEX_SUBMINOR_VERSION 33 +#define YY_FLEX_SUBMINOR_VERSION 35 #if YY_FLEX_SUBMINOR_VERSION > 0 #define FLEX_BETA #endif @@ -31,7 +50,7 @@ /* C99 systems have . Non-C99 systems may or may not. */ -#if __STDC_VERSION__ >= 199901L +#if defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L /* C99 says to define __STDC_LIMIT_MACROS before including stdint.h, * if you want the limit (max/min) macros for int types. @@ -94,11 +113,12 @@ #else /* ! __cplusplus */ -#if __STDC__ +/* C99 requires __STDC__ to be defined as 1. */ +#if defined (__STDC__) #define YY_USE_CONST -#endif /* __STDC__ */ +#endif /* defined (__STDC__) */ #endif /* ! __cplusplus */ #ifdef YY_USE_CONST @@ -178,14 +198,9 @@ #define unput(c) yyunput( c, (yytext_ptr) ) -/* The following is because we cannot portably get our hands on size_t - * (without autoconf's help, which isn't available because we want - * flex-generated scanners to compile on their own). - */ - #ifndef YY_TYPEDEF_YY_SIZE_T #define YY_TYPEDEF_YY_SIZE_T -typedef unsigned int yy_size_t; +typedef size_t yy_size_t; #endif #ifndef YY_STRUCT_YY_BUFFER_STATE @@ -368,8 +383,8 @@ *yy_cp = '\0'; \ (yy_c_buf_p) = yy_cp; -#define YY_NUM_RULES 24 -#define YY_END_OF_BUFFER 25 +#define YY_NUM_RULES 32 +#define YY_END_OF_BUFFER 33 /* This struct is not used in this scanner, but its presence is necessary. */ struct yy_trans_info @@ -377,12 +392,15 @@ flex_int32_t yy_verify; flex_int32_t yy_nxt; }; -static yyconst flex_int16_t yy_accept[36] = +static yyconst flex_int16_t yy_accept[66] = { 0, - 0, 0, 20, 20, 25, 23, 18, 23, 19, 24, - 10, 5, 6, 7, 4, 3, 15, 11, 13, 1, - 2, 8, 9, 20, 22, 24, 18, 12, 10, 16, - 17, 14, 20, 21, 0 + 0, 0, 28, 28, 33, 31, 26, 31, 27, 31, + 10, 5, 6, 7, 18, 4, 3, 15, 11, 13, + 1, 2, 8, 9, 32, 28, 30, 32, 26, 12, + 0, 0, 0, 0, 10, 16, 17, 14, 28, 29, + 0, 0, 0, 0, 0, 0, 0, 0, 19, 0, + 0, 0, 0, 0, 20, 22, 0, 0, 0, 0, + 21, 23, 24, 25, 0 } ; static yyconst flex_int32_t yy_ec[256] = @@ -390,17 +408,17 @@ 1, 1, 1, 1, 1, 1, 1, 1, 2, 3, 1, 1, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 2, 4, 5, 6, 1, 7, 8, 1, 9, - 10, 1, 7, 11, 7, 7, 7, 7, 7, 7, - 7, 7, 7, 7, 7, 7, 7, 12, 1, 13, - 14, 15, 1, 1, 7, 7, 7, 7, 7, 7, - 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, - 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, - 16, 17, 18, 1, 7, 1, 7, 7, 7, 7, - - 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, - 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, - 7, 7, 19, 1, 20, 21, 1, 1, 1, 1, + 1, 2, 4, 5, 6, 7, 8, 9, 1, 10, + 11, 12, 8, 13, 8, 8, 8, 8, 14, 15, + 16, 17, 8, 18, 8, 8, 8, 19, 1, 20, + 21, 22, 1, 1, 8, 23, 8, 8, 8, 24, + 8, 8, 25, 8, 8, 8, 8, 8, 8, 8, + 8, 8, 8, 8, 26, 8, 8, 8, 8, 8, + 27, 28, 29, 1, 8, 1, 30, 8, 8, 8, + + 31, 8, 8, 8, 8, 8, 8, 32, 8, 33, + 34, 8, 8, 8, 8, 35, 8, 8, 8, 8, + 36, 8, 37, 1, 38, 39, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, @@ -417,51 +435,72 @@ 1, 1, 1, 1, 1 } ; -static yyconst flex_int32_t yy_meta[22] = +static yyconst flex_int32_t yy_meta[40] = { 0, - 1, 1, 2, 1, 3, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 3, 1, 1, 1, - 1 + 1, 1, 2, 1, 3, 4, 1, 4, 1, 1, + 1, 1, 1, 4, 4, 4, 4, 4, 1, 1, + 1, 1, 4, 4, 4, 4, 1, 5, 1, 4, + 4, 4, 4, 4, 4, 4, 1, 1, 1 } ; -static yyconst flex_int16_t yy_base[39] = +static yyconst flex_int16_t yy_base[70] = { 0, - 0, 0, 17, 18, 39, 50, 22, 24, 50, 50, - 20, 50, 50, 50, 50, 50, 22, 12, 18, 50, - 50, 50, 50, 0, 50, 0, 26, 50, 24, 50, - 50, 50, 0, 50, 50, 41, 44, 46 + 0, 0, 35, 36, 94, 95, 40, 72, 95, 21, + 0, 95, 95, 95, 95, 95, 95, 71, 52, 69, + 95, 95, 95, 95, 95, 0, 95, 0, 46, 95, + 53, 56, 54, 61, 0, 95, 95, 95, 0, 95, + 50, 50, 48, 49, 50, 47, 36, 39, 95, 27, + 43, 45, 37, 38, 95, 95, 41, 43, 42, 38, + 95, 95, 95, 95, 95, 64, 66, 71, 75 } ; -static yyconst flex_int16_t yy_def[39] = +static yyconst flex_int16_t yy_def[70] = { 0, - 35, 1, 36, 36, 35, 35, 35, 35, 35, 35, - 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, - 35, 35, 35, 37, 35, 38, 35, 35, 35, 35, - 35, 35, 37, 35, 0, 35, 35, 35 + 65, 1, 66, 66, 65, 65, 65, 65, 65, 65, + 67, 65, 65, 65, 65, 65, 65, 65, 65, 65, + 65, 65, 65, 65, 65, 68, 65, 69, 65, 65, + 65, 65, 65, 65, 67, 65, 65, 65, 68, 65, + 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, + 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, + 65, 65, 65, 65, 0, 65, 65, 65, 65 } ; -static yyconst flex_int16_t yy_nxt[72] = +static yyconst flex_int16_t yy_nxt[135] = { 0, - 6, 7, 7, 8, 9, 10, 11, 12, 13, 14, - 15, 16, 17, 18, 19, 20, 11, 21, 22, 23, - 10, 25, 25, 27, 27, 29, 29, 27, 27, 29, - 29, 32, 31, 26, 26, 30, 29, 28, 35, 35, - 29, 24, 24, 24, 33, 33, 34, 35, 34, 5, - 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, - 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, - 35 + 6, 7, 7, 8, 9, 6, 10, 11, 12, 13, + 14, 15, 16, 11, 11, 11, 11, 11, 17, 18, + 19, 20, 11, 11, 11, 11, 21, 11, 22, 11, + 11, 11, 11, 11, 11, 11, 23, 24, 25, 27, + 27, 29, 29, 31, 32, 33, 34, 29, 29, 51, + 57, 52, 58, 59, 64, 60, 63, 62, 61, 56, + 55, 54, 28, 28, 26, 26, 26, 26, 26, 35, + 35, 39, 39, 53, 39, 40, 50, 40, 40, 40, + 49, 48, 47, 46, 45, 44, 43, 42, 41, 38, + 37, 36, 30, 65, 5, 65, 65, 65, 65, 65, + + 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, + 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, + 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, + 65, 65, 65, 65 } ; -static yyconst flex_int16_t yy_chk[72] = +static yyconst flex_int16_t yy_chk[135] = { 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 3, 4, 7, 7, 11, 11, 27, 27, 29, - 29, 19, 18, 3, 4, 17, 11, 8, 5, 0, - 29, 36, 36, 36, 37, 37, 38, 0, 38, 35, - 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, - 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, - 35 + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 3, + 4, 7, 7, 10, 10, 10, 10, 29, 29, 47, + 53, 47, 53, 54, 60, 54, 59, 58, 57, 52, + 51, 50, 3, 4, 66, 66, 66, 66, 66, 67, + 67, 68, 68, 48, 68, 69, 46, 69, 69, 69, + 45, 44, 43, 42, 41, 34, 33, 32, 31, 20, + 19, 18, 8, 5, 65, 65, 65, 65, 65, 65, + + 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, + 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, + 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, + 65, 65, 65, 65 } ; static yy_state_type yy_last_accepting_state; @@ -528,7 +567,7 @@ #include "config.h" -static char rcsid[] not_used = {"$Id: ce_expr.lex 20716 2009-04-08 19:50:54Z jimg $"}; +static char rcsid[] not_used = {"$Id: ce_expr.lex 27157 2013-09-28 21:22:52Z jimg $"}; #include #include @@ -541,7 +580,7 @@ #define YY_DECL int ce_exprlex YY_PROTO(( void )) #define YY_FATAL_ERROR(msg) {\ throw(Error(string("Error scanning constraint expression text: ") + string(msg))); \ - yy_fatal_error(msg); /* 'Used' here to suppress warning */ \ + yy_fatal_error(msg); /* see das.lex */ \ } #include "Error.h" @@ -557,6 +596,7 @@ static void store_str(); static void store_op(int op); +#define YY_NO_INPUT 1 /* In the DAS and DDS parsers I removed the INT and FLOAT lexemes. However, not having them here complicates parsing since you must check to see if a @@ -573,7 +613,7 @@ scanners, but not here because it'll conflict with the url dereference operator. 6/10/2002 jhrg */ -#line 577 "lex.ce_expr.cc" +#line 617 "lex.ce_expr.cc" #define INITIAL 0 #define quote 1 @@ -592,6 +632,35 @@ static int yy_init_globals (void ); +/* Accessor methods to globals. + These are made visible to non-reentrant scanners for convenience. */ + +int ce_exprlex_destroy (void ); + +int ce_exprget_debug (void ); + +void ce_exprset_debug (int debug_flag ); + +YY_EXTRA_TYPE ce_exprget_extra (void ); + +void ce_exprset_extra (YY_EXTRA_TYPE user_defined ); + +FILE *ce_exprget_in (void ); + +void ce_exprset_in (FILE * in_str ); + +FILE *ce_exprget_out (void ); + +void ce_exprset_out (FILE * out_str ); + +int ce_exprget_leng (void ); + +char *ce_exprget_text (void ); + +int ce_exprget_lineno (void ); + +void ce_exprset_lineno (int line_number ); + /* Macros after this point can all be overridden by user definitions in * section 1. */ @@ -604,8 +673,6 @@ #endif #endif - static void yyunput (int c,char *buf_ptr ); - #ifndef yytext_ptr static void yy_flex_strncpy (char *,yyconst char *,int ); #endif @@ -634,7 +701,7 @@ /* This used to be an fputs(), but since the string might contain NUL's, * we now use fwrite(). */ -#define ECHO (void) fwrite( ce_exprtext, ce_exprleng, 1, ce_exprout ) +#define ECHO do { if (fwrite( ce_exprtext, ce_exprleng, 1, ce_exprout )) {} } while (0) #endif /* Gets input and stuffs it into "buf". number of characters read, or YY_NULL, @@ -645,7 +712,7 @@ if ( YY_CURRENT_BUFFER_LVALUE->yy_is_interactive ) \ { \ int c = '*'; \ - size_t n; \ + unsigned n; \ for ( n = 0; n < max_size && \ (c = getc( ce_exprin )) != EOF && c != '\n'; ++n ) \ buf[n] = (char) c; \ @@ -727,10 +794,10 @@ register char *yy_cp, *yy_bp; register int yy_act; -#line 119 "ce_expr.lex" +#line 132 "ce_expr.lex" -#line 734 "lex.ce_expr.cc" +#line 801 "lex.ce_expr.cc" if ( !(yy_init) ) { @@ -789,13 +856,13 @@ while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) { yy_current_state = (int) yy_def[yy_current_state]; - if ( yy_current_state >= 36 ) + if ( yy_current_state >= 66 ) yy_c = yy_meta[(unsigned int) yy_c]; } yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; ++yy_cp; } - while ( yy_base[yy_current_state] != 50 ); + while ( yy_base[yy_current_state] != 95 ); yy_find_action: yy_act = yy_accept[yy_current_state]; @@ -821,149 +888,190 @@ case 1: YY_RULE_SETUP -#line 121 "ce_expr.lex" +#line 134 "ce_expr.lex" return (int)*ce_exprtext; YY_BREAK case 2: YY_RULE_SETUP -#line 122 "ce_expr.lex" +#line 135 "ce_expr.lex" return (int)*ce_exprtext; YY_BREAK case 3: YY_RULE_SETUP -#line 123 "ce_expr.lex" +#line 136 "ce_expr.lex" return (int)*ce_exprtext; YY_BREAK case 4: YY_RULE_SETUP -#line 124 "ce_expr.lex" +#line 137 "ce_expr.lex" return (int)*ce_exprtext; YY_BREAK case 5: YY_RULE_SETUP -#line 125 "ce_expr.lex" +#line 138 "ce_expr.lex" return (int)*ce_exprtext; YY_BREAK case 6: YY_RULE_SETUP -#line 126 "ce_expr.lex" +#line 139 "ce_expr.lex" return (int)*ce_exprtext; YY_BREAK case 7: YY_RULE_SETUP -#line 127 "ce_expr.lex" +#line 140 "ce_expr.lex" return (int)*ce_exprtext; YY_BREAK case 8: YY_RULE_SETUP -#line 128 "ce_expr.lex" +#line 141 "ce_expr.lex" return (int)*ce_exprtext; YY_BREAK case 9: YY_RULE_SETUP -#line 129 "ce_expr.lex" +#line 142 "ce_expr.lex" return (int)*ce_exprtext; YY_BREAK case 10: YY_RULE_SETUP -#line 131 "ce_expr.lex" +#line 144 "ce_expr.lex" store_id(); return SCAN_WORD; YY_BREAK case 11: YY_RULE_SETUP -#line 133 "ce_expr.lex" +#line 146 "ce_expr.lex" store_op(SCAN_EQUAL); return SCAN_EQUAL; YY_BREAK case 12: YY_RULE_SETUP -#line 134 "ce_expr.lex" +#line 147 "ce_expr.lex" store_op(SCAN_NOT_EQUAL); return SCAN_NOT_EQUAL; YY_BREAK case 13: YY_RULE_SETUP -#line 135 "ce_expr.lex" +#line 148 "ce_expr.lex" store_op(SCAN_GREATER); return SCAN_GREATER; YY_BREAK case 14: YY_RULE_SETUP -#line 136 "ce_expr.lex" +#line 149 "ce_expr.lex" store_op(SCAN_GREATER_EQL); return SCAN_GREATER_EQL; YY_BREAK case 15: YY_RULE_SETUP -#line 137 "ce_expr.lex" +#line 150 "ce_expr.lex" store_op(SCAN_LESS); return SCAN_LESS; YY_BREAK case 16: YY_RULE_SETUP -#line 138 "ce_expr.lex" +#line 151 "ce_expr.lex" store_op(SCAN_LESS_EQL); return SCAN_LESS_EQL; YY_BREAK case 17: YY_RULE_SETUP -#line 139 "ce_expr.lex" +#line 152 "ce_expr.lex" store_op(SCAN_REGEXP); return SCAN_REGEXP; YY_BREAK case 18: -/* rule 18 can match eol */ YY_RULE_SETUP -#line 141 "ce_expr.lex" +#line 154 "ce_expr.lex" +store_op(SCAN_STAR); return SCAN_STAR; + YY_BREAK +case 19: +YY_RULE_SETUP +#line 156 "ce_expr.lex" +return SCAN_HASH_BYTE; + YY_BREAK +case 20: +YY_RULE_SETUP +#line 157 "ce_expr.lex" +return SCAN_HASH_INT16; + YY_BREAK +case 21: +YY_RULE_SETUP +#line 158 "ce_expr.lex" +return SCAN_HASH_UINT16; + YY_BREAK +case 22: +YY_RULE_SETUP +#line 159 "ce_expr.lex" +return SCAN_HASH_INT32; + YY_BREAK +case 23: +YY_RULE_SETUP +#line 160 "ce_expr.lex" +return SCAN_HASH_UINT32; + YY_BREAK +case 24: +YY_RULE_SETUP +#line 161 "ce_expr.lex" +return SCAN_HASH_FLOAT32; + YY_BREAK +case 25: +YY_RULE_SETUP +#line 162 "ce_expr.lex" +return SCAN_HASH_FLOAT64; + YY_BREAK +case 26: +/* rule 26 can match eol */ +YY_RULE_SETUP +#line 164 "ce_expr.lex" YY_BREAK case YY_STATE_EOF(INITIAL): -#line 142 "ce_expr.lex" +#line 165 "ce_expr.lex" yy_init = 1; yyterminate(); YY_BREAK -case 19: +case 27: YY_RULE_SETUP -#line 144 "ce_expr.lex" +#line 167 "ce_expr.lex" BEGIN(quote); yymore(); YY_BREAK -case 20: -/* rule 20 can match eol */ +case 28: +/* rule 28 can match eol */ YY_RULE_SETUP -#line 145 "ce_expr.lex" +#line 169 "ce_expr.lex" yymore(); /*"*/ YY_BREAK -case 21: +case 29: YY_RULE_SETUP -#line 146 "ce_expr.lex" +#line 171 "ce_expr.lex" yymore(); YY_BREAK -case 22: +case 30: YY_RULE_SETUP -#line 147 "ce_expr.lex" +#line 173 "ce_expr.lex" { BEGIN(INITIAL); - store_str(); - return SCAN_STR; - } + store_str(); + return SCAN_STR; + } YY_BREAK case YY_STATE_EOF(quote): -#line 152 "ce_expr.lex" +#line 179 "ce_expr.lex" { + BEGIN(INITIAL); /* resetting the state is needed for reentrant parsers */ char msg[256]; - sprintf(msg, "Unterminated quote\n"); - YY_FATAL_ERROR(msg); + sprintf(msg, "Unterminated quote\n"); + YY_FATAL_ERROR(msg); } YY_BREAK -case 23: -/* rule 23 can match eol */ +case 31: +/* rule 31 can match eol */ YY_RULE_SETUP -#line 158 "ce_expr.lex" +#line 186 "ce_expr.lex" { if (ce_exprtext) { /* suppress msgs about `' chars */ fprintf(stderr, "Character `%c' is not", *ce_exprtext); fprintf(stderr, " allowed and has been ignored\n"); - } - } + } + } YY_BREAK -case 24: +case 32: YY_RULE_SETUP -#line 164 "ce_expr.lex" +#line 192 "ce_expr.lex" ECHO; YY_BREAK -#line 967 "lex.ce_expr.cc" +#line 1075 "lex.ce_expr.cc" case YY_END_OF_BUFFER: { @@ -1192,7 +1300,7 @@ /* Read in more data. */ YY_INPUT( (&YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move]), - (yy_n_chars), num_to_read ); + (yy_n_chars), (size_t) num_to_read ); YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars); } @@ -1216,6 +1324,14 @@ else ret_val = EOB_ACT_CONTINUE_SCAN; + if ((yy_size_t) ((yy_n_chars) + number_to_move) > YY_CURRENT_BUFFER_LVALUE->yy_buf_size) { + /* Extend the array by 50%, plus the number we really need. */ + yy_size_t new_size = (yy_n_chars) + number_to_move + ((yy_n_chars) >> 1); + YY_CURRENT_BUFFER_LVALUE->yy_ch_buf = (char *) ce_exprrealloc((void *) YY_CURRENT_BUFFER_LVALUE->yy_ch_buf,new_size ); + if ( ! YY_CURRENT_BUFFER_LVALUE->yy_ch_buf ) + YY_FATAL_ERROR( "out of dynamic memory in yy_get_next_buffer()" ); + } + (yy_n_chars) += number_to_move; YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] = YY_END_OF_BUFFER_CHAR; YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars) + 1] = YY_END_OF_BUFFER_CHAR; @@ -1245,7 +1361,7 @@ while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) { yy_current_state = (int) yy_def[yy_current_state]; - if ( yy_current_state >= 36 ) + if ( yy_current_state >= 66 ) yy_c = yy_meta[(unsigned int) yy_c]; } yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; @@ -1273,52 +1389,15 @@ while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) { yy_current_state = (int) yy_def[yy_current_state]; - if ( yy_current_state >= 36 ) + if ( yy_current_state >= 66 ) yy_c = yy_meta[(unsigned int) yy_c]; } yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; - yy_is_jam = (yy_current_state == 35); + yy_is_jam = (yy_current_state == 65); return yy_is_jam ? 0 : yy_current_state; } - static void yyunput (int c, register char * yy_bp ) -{ - register char *yy_cp; - - yy_cp = (yy_c_buf_p); - - /* undo effects of setting up ce_exprtext */ - *yy_cp = (yy_hold_char); - - if ( yy_cp < YY_CURRENT_BUFFER_LVALUE->yy_ch_buf + 2 ) - { /* need to shift things up to make room */ - /* +2 for EOB chars. */ - register int number_to_move = (yy_n_chars) + 2; - register char *dest = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[ - YY_CURRENT_BUFFER_LVALUE->yy_buf_size + 2]; - register char *source = - &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move]; - - while ( source > YY_CURRENT_BUFFER_LVALUE->yy_ch_buf ) - *--dest = *--source; - - yy_cp += (int) (dest - source); - yy_bp += (int) (dest - source); - YY_CURRENT_BUFFER_LVALUE->yy_n_chars = - (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_buf_size; - - if ( yy_cp < YY_CURRENT_BUFFER_LVALUE->yy_ch_buf + 2 ) - YY_FATAL_ERROR( "flex scanner push-back overflow" ); - } - - *--yy_cp = (char) c; - - (yytext_ptr) = yy_bp; - (yy_hold_char) = *yy_cp; - (yy_c_buf_p) = yy_cp; -} - #ifndef YY_NO_INPUT #ifdef __cplusplus static int yyinput (void) @@ -1367,7 +1446,7 @@ case EOB_ACT_END_OF_FILE: { if ( ce_exprwrap( ) ) - return 0; + return EOF; if ( ! (yy_did_buffer_switch_on_eof) ) YY_NEW_FILE; @@ -1631,7 +1710,9 @@ (yy_buffer_stack) = (struct yy_buffer_state**)ce_expralloc (num_to_alloc * sizeof(struct yy_buffer_state*) ); - + if ( ! (yy_buffer_stack) ) + YY_FATAL_ERROR( "out of dynamic memory in ce_exprensure_buffer_stack()" ); + memset((yy_buffer_stack), 0, num_to_alloc * sizeof(struct yy_buffer_state*)); (yy_buffer_stack_max) = num_to_alloc; @@ -1649,6 +1730,8 @@ ((yy_buffer_stack), num_to_alloc * sizeof(struct yy_buffer_state*) ); + if ( ! (yy_buffer_stack) ) + YY_FATAL_ERROR( "out of dynamic memory in ce_exprensure_buffer_stack()" ); /* zero only the new slots.*/ memset((yy_buffer_stack) + (yy_buffer_stack_max), 0, grow_size * sizeof(struct yy_buffer_state*)); @@ -1693,7 +1776,7 @@ /** Setup the input buffer state to scan a string. The next call to ce_exprlex() will * scan from a @e copy of @a str. - * @param str a NUL-terminated string to scan + * @param yystr a NUL-terminated string to scan * * @return the newly allocated buffer state object. * @note If you want to scan bytes that may contain NUL values, then use @@ -1947,7 +2030,7 @@ #define YYTABLES_NAME "yytables" -#line 164 "ce_expr.lex" +#line 192 "ce_expr.lex" @@ -1980,7 +2063,7 @@ static void store_id() { - strncpy(ce_exprlval.id, www2id(string(ce_exprtext)).c_str(), ID_MAX-1); + strncpy(ce_exprlval.id, ce_exprtext, ID_MAX-1); ce_exprlval.id[ID_MAX-1] = '\0'; } @@ -1988,7 +2071,7 @@ store_str() { // transform %20 to a space. 7/11/2001 jhrg - string *s = new string(www2id(string(ce_exprtext))); // XXX memory leak? + string *s = new string(ce_exprtext); // move all calls of www2id into the parser. jhrg 7/5/13 www2id(string(ce_exprtext))); if (*s->begin() == '\"' && *(s->end()-1) == '\"') { s->erase(s->begin()); diff -Nru libdap-3.11.1/lex.das.cc libdap-3.12.0/lex.das.cc --- libdap-3.11.1/lex.das.cc 2011-05-06 17:50:24.000000000 +0000 +++ libdap-3.12.0/lex.das.cc 2013-10-17 21:27:40.000000000 +0000 @@ -6,10 +6,29 @@ /* A lexical scanner generated by flex */ +#define yy_create_buffer das_create_buffer +#define yy_delete_buffer das_delete_buffer +#define yy_flex_debug das_flex_debug +#define yy_init_buffer das_init_buffer +#define yy_flush_buffer das_flush_buffer +#define yy_load_buffer_state das_load_buffer_state +#define yy_switch_to_buffer das_switch_to_buffer +#define yyin dasin +#define yyleng dasleng +#define yylex daslex +#define yylineno daslineno +#define yyout dasout +#define yyrestart dasrestart +#define yytext dastext +#define yywrap daswrap +#define yyalloc dasalloc +#define yyrealloc dasrealloc +#define yyfree dasfree + #define FLEX_SCANNER #define YY_FLEX_MAJOR_VERSION 2 #define YY_FLEX_MINOR_VERSION 5 -#define YY_FLEX_SUBMINOR_VERSION 33 +#define YY_FLEX_SUBMINOR_VERSION 35 #if YY_FLEX_SUBMINOR_VERSION > 0 #define FLEX_BETA #endif @@ -31,7 +50,7 @@ /* C99 systems have . Non-C99 systems may or may not. */ -#if __STDC_VERSION__ >= 199901L +#if defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L /* C99 says to define __STDC_LIMIT_MACROS before including stdint.h, * if you want the limit (max/min) macros for int types. @@ -94,11 +113,12 @@ #else /* ! __cplusplus */ -#if __STDC__ +/* C99 requires __STDC__ to be defined as 1. */ +#if defined (__STDC__) #define YY_USE_CONST -#endif /* __STDC__ */ +#endif /* defined (__STDC__) */ #endif /* ! __cplusplus */ #ifdef YY_USE_CONST @@ -178,14 +198,9 @@ #define unput(c) yyunput( c, (yytext_ptr) ) -/* The following is because we cannot portably get our hands on size_t - * (without autoconf's help, which isn't available because we want - * flex-generated scanners to compile on their own). - */ - #ifndef YY_TYPEDEF_YY_SIZE_T #define YY_TYPEDEF_YY_SIZE_T -typedef unsigned int yy_size_t; +typedef size_t yy_size_t; #endif #ifndef YY_STRUCT_YY_BUFFER_STATE @@ -655,7 +670,7 @@ #include -static char rcsid[] not_used ={"$Id: das.lex 21577 2009-10-02 16:12:17Z jimg $"}; +static char rcsid[] not_used ={"$Id: das.lex 27157 2013-09-28 21:22:52Z jimg $"}; #ifndef _MSC_VER #include @@ -679,7 +694,7 @@ #define YY_DECL int daslex YY_PROTO(( void )) #define YY_FATAL_ERROR(msg) {\ throw(Error(string("Error scanning DAS object text: ") + string(msg))); \ - yy_fatal_error(msg); /* 'Used' here to suppress warning */ \ + yy_fatal_error(msg); /* This will never be run but putting it here removes a warning that the funtion is never used. */ \ } #include "das.tab.hh" @@ -687,6 +702,7 @@ int das_line_num = 1; static int start_line; /* used in quote and comment error handlers */ +#define YY_NO_INPUT 1 @@ -695,7 +711,7 @@ parens and colons while the DDS and expr scanners don't. It's too hard to disambiguate functions when IDs have parens in them and adding colons makes parsing the array projections hard. 10/31/2001 jhrg */ -#line 699 "lex.das.cc" +#line 715 "lex.das.cc" #define INITIAL 0 #define quote 1 @@ -716,6 +732,35 @@ static int yy_init_globals (void ); +/* Accessor methods to globals. + These are made visible to non-reentrant scanners for convenience. */ + +int daslex_destroy (void ); + +int dasget_debug (void ); + +void dasset_debug (int debug_flag ); + +YY_EXTRA_TYPE dasget_extra (void ); + +void dasset_extra (YY_EXTRA_TYPE user_defined ); + +FILE *dasget_in (void ); + +void dasset_in (FILE * in_str ); + +FILE *dasget_out (void ); + +void dasset_out (FILE * out_str ); + +int dasget_leng (void ); + +char *dasget_text (void ); + +int dasget_lineno (void ); + +void dasset_lineno (int line_number ); + /* Macros after this point can all be overridden by user definitions in * section 1. */ @@ -728,8 +773,6 @@ #endif #endif - static void yyunput (int c,char *buf_ptr ); - #ifndef yytext_ptr static void yy_flex_strncpy (char *,yyconst char *,int ); #endif @@ -758,7 +801,7 @@ /* This used to be an fputs(), but since the string might contain NUL's, * we now use fwrite(). */ -#define ECHO (void) fwrite( dastext, dasleng, 1, dasout ) +#define ECHO do { if (fwrite( dastext, dasleng, 1, dasout )) {} } while (0) #endif /* Gets input and stuffs it into "buf". number of characters read, or YY_NULL, @@ -769,7 +812,7 @@ if ( YY_CURRENT_BUFFER_LVALUE->yy_is_interactive ) \ { \ int c = '*'; \ - size_t n; \ + unsigned n; \ for ( n = 0; n < max_size && \ (c = getc( dasin )) != EOF && c != '\n'; ++n ) \ buf[n] = (char) c; \ @@ -851,10 +894,10 @@ register char *yy_cp, *yy_bp; register int yy_act; -#line 133 "das.lex" +#line 136 "das.lex" -#line 858 "lex.das.cc" +#line 901 "lex.das.cc" if ( !(yy_init) ) { @@ -945,67 +988,67 @@ case 1: YY_RULE_SETUP -#line 135 "das.lex" +#line 138 "das.lex" daslval = dastext; return SCAN_ATTR; YY_BREAK case 2: YY_RULE_SETUP -#line 137 "das.lex" +#line 140 "das.lex" daslval = dastext; return SCAN_ALIAS; YY_BREAK case 3: YY_RULE_SETUP -#line 138 "das.lex" +#line 141 "das.lex" daslval = dastext; return SCAN_BYTE; YY_BREAK case 4: YY_RULE_SETUP -#line 139 "das.lex" +#line 142 "das.lex" daslval = dastext; return SCAN_INT16; YY_BREAK case 5: YY_RULE_SETUP -#line 140 "das.lex" +#line 143 "das.lex" daslval = dastext; return SCAN_UINT16; YY_BREAK case 6: YY_RULE_SETUP -#line 141 "das.lex" +#line 144 "das.lex" daslval = dastext; return SCAN_INT32; YY_BREAK case 7: YY_RULE_SETUP -#line 142 "das.lex" +#line 145 "das.lex" daslval = dastext; return SCAN_UINT32; YY_BREAK case 8: YY_RULE_SETUP -#line 143 "das.lex" +#line 146 "das.lex" daslval = dastext; return SCAN_FLOAT32; YY_BREAK case 9: YY_RULE_SETUP -#line 144 "das.lex" +#line 147 "das.lex" daslval = dastext; return SCAN_FLOAT64; YY_BREAK case 10: YY_RULE_SETUP -#line 145 "das.lex" +#line 148 "das.lex" daslval = dastext; return SCAN_STRING; YY_BREAK case 11: YY_RULE_SETUP -#line 146 "das.lex" +#line 149 "das.lex" daslval = dastext; return SCAN_URL; YY_BREAK case 12: YY_RULE_SETUP -#line 147 "das.lex" +#line 150 "das.lex" daslval = dastext; return SCAN_XML; YY_BREAK case 13: YY_RULE_SETUP -#line 149 "das.lex" +#line 152 "das.lex" { daslval = dastext; DBG(cerr << "WORD: " << dastext << endl); @@ -1014,95 +1057,95 @@ YY_BREAK case 14: YY_RULE_SETUP -#line 155 "das.lex" +#line 158 "das.lex" return (int)*dastext; YY_BREAK case 15: YY_RULE_SETUP -#line 156 "das.lex" +#line 159 "das.lex" return (int)*dastext; YY_BREAK case 16: YY_RULE_SETUP -#line 157 "das.lex" +#line 160 "das.lex" return (int)*dastext; YY_BREAK case 17: YY_RULE_SETUP -#line 158 "das.lex" +#line 161 "das.lex" return (int)*dastext; YY_BREAK case 18: YY_RULE_SETUP -#line 160 "das.lex" +#line 163 "das.lex" YY_BREAK case 19: /* rule 19 can match eol */ YY_RULE_SETUP -#line 161 "das.lex" +#line 164 "das.lex" ++das_line_num; YY_BREAK case YY_STATE_EOF(INITIAL): -#line 162 "das.lex" +#line 165 "das.lex" yy_init = 1; das_line_num = 1; yyterminate(); YY_BREAK case 20: YY_RULE_SETUP -#line 164 "das.lex" +#line 167 "das.lex" BEGIN(comment); YY_BREAK case 21: YY_RULE_SETUP -#line 165 "das.lex" +#line 168 "das.lex" YY_BREAK case 22: /* rule 22 can match eol */ YY_RULE_SETUP -#line 166 "das.lex" +#line 169 "das.lex" ++das_line_num; BEGIN(INITIAL); YY_BREAK case 23: /* rule 23 can match eol */ YY_RULE_SETUP -#line 167 "das.lex" +#line 170 "das.lex" ++das_line_num; BEGIN(INITIAL); YY_BREAK case YY_STATE_EOF(comment): -#line 168 "das.lex" +#line 171 "das.lex" yy_init = 1; das_line_num = 1; yyterminate(); YY_BREAK case 24: YY_RULE_SETUP -#line 170 "das.lex" +#line 173 "das.lex" BEGIN(quote); start_line = das_line_num; yymore(); YY_BREAK case 25: YY_RULE_SETUP -#line 171 "das.lex" +#line 174 "das.lex" yymore(); YY_BREAK case 26: /* rule 26 can match eol */ YY_RULE_SETUP -#line 172 "das.lex" +#line 175 "das.lex" yymore(); ++das_line_num; YY_BREAK case 27: /* rule 27 can match eol */ YY_RULE_SETUP -#line 173 "das.lex" +#line 176 "das.lex" yymore(); ++das_line_num; YY_BREAK case 28: YY_RULE_SETUP -#line 174 "das.lex" +#line 177 "das.lex" yymore(); YY_BREAK case 29: YY_RULE_SETUP -#line 175 "das.lex" +#line 178 "das.lex" { BEGIN(INITIAL); @@ -1112,7 +1155,7 @@ } YY_BREAK case YY_STATE_EOF(quote): -#line 182 "das.lex" +#line 185 "das.lex" { char msg[256]; sprintf(msg, @@ -1124,7 +1167,7 @@ case 30: /* rule 30 can match eol */ YY_RULE_SETUP -#line 190 "das.lex" +#line 193 "das.lex" { if (dastext) { fprintf(stderr, "Character '%c' (%d) is not", @@ -1135,10 +1178,10 @@ YY_BREAK case 31: YY_RULE_SETUP -#line 197 "das.lex" +#line 200 "das.lex" ECHO; YY_BREAK -#line 1142 "lex.das.cc" +#line 1185 "lex.das.cc" case YY_STATE_EOF(xml): yyterminate(); @@ -1369,7 +1412,7 @@ /* Read in more data. */ YY_INPUT( (&YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move]), - (yy_n_chars), num_to_read ); + (yy_n_chars), (size_t) num_to_read ); YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars); } @@ -1393,6 +1436,14 @@ else ret_val = EOB_ACT_CONTINUE_SCAN; + if ((yy_size_t) ((yy_n_chars) + number_to_move) > YY_CURRENT_BUFFER_LVALUE->yy_buf_size) { + /* Extend the array by 50%, plus the number we really need. */ + yy_size_t new_size = (yy_n_chars) + number_to_move + ((yy_n_chars) >> 1); + YY_CURRENT_BUFFER_LVALUE->yy_ch_buf = (char *) dasrealloc((void *) YY_CURRENT_BUFFER_LVALUE->yy_ch_buf,new_size ); + if ( ! YY_CURRENT_BUFFER_LVALUE->yy_ch_buf ) + YY_FATAL_ERROR( "out of dynamic memory in yy_get_next_buffer()" ); + } + (yy_n_chars) += number_to_move; YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] = YY_END_OF_BUFFER_CHAR; YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars) + 1] = YY_END_OF_BUFFER_CHAR; @@ -1459,43 +1510,6 @@ return yy_is_jam ? 0 : yy_current_state; } - static void yyunput (int c, register char * yy_bp ) -{ - register char *yy_cp; - - yy_cp = (yy_c_buf_p); - - /* undo effects of setting up dastext */ - *yy_cp = (yy_hold_char); - - if ( yy_cp < YY_CURRENT_BUFFER_LVALUE->yy_ch_buf + 2 ) - { /* need to shift things up to make room */ - /* +2 for EOB chars. */ - register int number_to_move = (yy_n_chars) + 2; - register char *dest = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[ - YY_CURRENT_BUFFER_LVALUE->yy_buf_size + 2]; - register char *source = - &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move]; - - while ( source > YY_CURRENT_BUFFER_LVALUE->yy_ch_buf ) - *--dest = *--source; - - yy_cp += (int) (dest - source); - yy_bp += (int) (dest - source); - YY_CURRENT_BUFFER_LVALUE->yy_n_chars = - (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_buf_size; - - if ( yy_cp < YY_CURRENT_BUFFER_LVALUE->yy_ch_buf + 2 ) - YY_FATAL_ERROR( "flex scanner push-back overflow" ); - } - - *--yy_cp = (char) c; - - (yytext_ptr) = yy_bp; - (yy_hold_char) = *yy_cp; - (yy_c_buf_p) = yy_cp; -} - #ifndef YY_NO_INPUT #ifdef __cplusplus static int yyinput (void) @@ -1544,7 +1558,7 @@ case EOB_ACT_END_OF_FILE: { if ( daswrap( ) ) - return 0; + return EOF; if ( ! (yy_did_buffer_switch_on_eof) ) YY_NEW_FILE; @@ -1808,7 +1822,9 @@ (yy_buffer_stack) = (struct yy_buffer_state**)dasalloc (num_to_alloc * sizeof(struct yy_buffer_state*) ); - + if ( ! (yy_buffer_stack) ) + YY_FATAL_ERROR( "out of dynamic memory in dasensure_buffer_stack()" ); + memset((yy_buffer_stack), 0, num_to_alloc * sizeof(struct yy_buffer_state*)); (yy_buffer_stack_max) = num_to_alloc; @@ -1826,6 +1842,8 @@ ((yy_buffer_stack), num_to_alloc * sizeof(struct yy_buffer_state*) ); + if ( ! (yy_buffer_stack) ) + YY_FATAL_ERROR( "out of dynamic memory in dasensure_buffer_stack()" ); /* zero only the new slots.*/ memset((yy_buffer_stack) + (yy_buffer_stack_max), 0, grow_size * sizeof(struct yy_buffer_state*)); @@ -1870,7 +1888,7 @@ /** Setup the input buffer state to scan a string. The next call to daslex() will * scan from a @e copy of @a str. - * @param str a NUL-terminated string to scan + * @param yystr a NUL-terminated string to scan * * @return the newly allocated buffer state object. * @note If you want to scan bytes that may contain NUL values, then use @@ -2124,7 +2142,7 @@ #define YYTABLES_NAME "yytables" -#line 197 "das.lex" +#line 200 "das.lex" diff -Nru libdap-3.11.1/lex.dds.cc libdap-3.12.0/lex.dds.cc --- libdap-3.11.1/lex.dds.cc 2011-05-06 17:50:24.000000000 +0000 +++ libdap-3.12.0/lex.dds.cc 2013-10-17 21:27:40.000000000 +0000 @@ -6,10 +6,29 @@ /* A lexical scanner generated by flex */ +#define yy_create_buffer dds_create_buffer +#define yy_delete_buffer dds_delete_buffer +#define yy_flex_debug dds_flex_debug +#define yy_init_buffer dds_init_buffer +#define yy_flush_buffer dds_flush_buffer +#define yy_load_buffer_state dds_load_buffer_state +#define yy_switch_to_buffer dds_switch_to_buffer +#define yyin ddsin +#define yyleng ddsleng +#define yylex ddslex +#define yylineno ddslineno +#define yyout ddsout +#define yyrestart ddsrestart +#define yytext ddstext +#define yywrap ddswrap +#define yyalloc ddsalloc +#define yyrealloc ddsrealloc +#define yyfree ddsfree + #define FLEX_SCANNER #define YY_FLEX_MAJOR_VERSION 2 #define YY_FLEX_MINOR_VERSION 5 -#define YY_FLEX_SUBMINOR_VERSION 33 +#define YY_FLEX_SUBMINOR_VERSION 35 #if YY_FLEX_SUBMINOR_VERSION > 0 #define FLEX_BETA #endif @@ -31,7 +50,7 @@ /* C99 systems have . Non-C99 systems may or may not. */ -#if __STDC_VERSION__ >= 199901L +#if defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L /* C99 says to define __STDC_LIMIT_MACROS before including stdint.h, * if you want the limit (max/min) macros for int types. @@ -94,11 +113,12 @@ #else /* ! __cplusplus */ -#if __STDC__ +/* C99 requires __STDC__ to be defined as 1. */ +#if defined (__STDC__) #define YY_USE_CONST -#endif /* __STDC__ */ +#endif /* defined (__STDC__) */ #endif /* ! __cplusplus */ #ifdef YY_USE_CONST @@ -178,14 +198,9 @@ #define unput(c) yyunput( c, (yytext_ptr) ) -/* The following is because we cannot portably get our hands on size_t - * (without autoconf's help, which isn't available because we want - * flex-generated scanners to compile on their own). - */ - #ifndef YY_TYPEDEF_YY_SIZE_T #define YY_TYPEDEF_YY_SIZE_T -typedef unsigned int yy_size_t; +typedef size_t yy_size_t; #endif #ifndef YY_STRUCT_YY_BUFFER_STATE @@ -635,8 +650,6 @@ #include #include -static char rcsid[] not_used = {"$Id: dds.lex 20716 2009-04-08 19:50:54Z jimg $"}; - #include "parser.h" #include "dds.tab.hh" #include "escaping.h" @@ -659,17 +672,18 @@ #define YY_FATAL_ERROR(msg) {\ throw(Error(string("Error scanning DDS object text: ") + string(msg))); \ - yy_fatal_error(msg); /* 'Used' here to suppress warning */ \ + yy_fatal_error(msg); /* see das.lex */ \ } int dds_line_num = 1; static void store_word(); +#define YY_NO_INPUT 1 /* See das.lex for comments about the characters allowed in a WORD. 10/31/2001 jhrg */ -#line 673 "lex.dds.cc" +#line 687 "lex.dds.cc" #define INITIAL 0 #define comment 1 @@ -688,6 +702,35 @@ static int yy_init_globals (void ); +/* Accessor methods to globals. + These are made visible to non-reentrant scanners for convenience. */ + +int ddslex_destroy (void ); + +int ddsget_debug (void ); + +void ddsset_debug (int debug_flag ); + +YY_EXTRA_TYPE ddsget_extra (void ); + +void ddsset_extra (YY_EXTRA_TYPE user_defined ); + +FILE *ddsget_in (void ); + +void ddsset_in (FILE * in_str ); + +FILE *ddsget_out (void ); + +void ddsset_out (FILE * out_str ); + +int ddsget_leng (void ); + +char *ddsget_text (void ); + +int ddsget_lineno (void ); + +void ddsset_lineno (int line_number ); + /* Macros after this point can all be overridden by user definitions in * section 1. */ @@ -700,8 +743,6 @@ #endif #endif - static void yyunput (int c,char *buf_ptr ); - #ifndef yytext_ptr static void yy_flex_strncpy (char *,yyconst char *,int ); #endif @@ -730,7 +771,7 @@ /* This used to be an fputs(), but since the string might contain NUL's, * we now use fwrite(). */ -#define ECHO (void) fwrite( ddstext, ddsleng, 1, ddsout ) +#define ECHO do { if (fwrite( ddstext, ddsleng, 1, ddsout )) {} } while (0) #endif /* Gets input and stuffs it into "buf". number of characters read, or YY_NULL, @@ -741,7 +782,7 @@ if ( YY_CURRENT_BUFFER_LVALUE->yy_is_interactive ) \ { \ int c = '*'; \ - size_t n; \ + unsigned n; \ for ( n = 0; n < max_size && \ (c = getc( ddsin )) != EOF && c != '\n'; ++n ) \ buf[n] = (char) c; \ @@ -823,10 +864,10 @@ register char *yy_cp, *yy_bp; register int yy_act; -#line 119 "dds.lex" +#line 120 "dds.lex" -#line 830 "lex.dds.cc" +#line 871 "lex.dds.cc" if ( !(yy_init) ) { @@ -911,165 +952,165 @@ case 1: YY_RULE_SETUP -#line 121 "dds.lex" +#line 122 "dds.lex" return (int)*ddstext; YY_BREAK case 2: YY_RULE_SETUP -#line 122 "dds.lex" +#line 123 "dds.lex" return (int)*ddstext; YY_BREAK case 3: YY_RULE_SETUP -#line 123 "dds.lex" +#line 124 "dds.lex" return (int)*ddstext; YY_BREAK case 4: YY_RULE_SETUP -#line 124 "dds.lex" +#line 125 "dds.lex" return (int)*ddstext; YY_BREAK case 5: YY_RULE_SETUP -#line 125 "dds.lex" +#line 126 "dds.lex" return (int)*ddstext; YY_BREAK case 6: YY_RULE_SETUP -#line 126 "dds.lex" +#line 127 "dds.lex" return (int)*ddstext; YY_BREAK case 7: YY_RULE_SETUP -#line 127 "dds.lex" +#line 128 "dds.lex" return (int)*ddstext; YY_BREAK case 8: YY_RULE_SETUP -#line 129 "dds.lex" +#line 130 "dds.lex" store_word(); return SCAN_DATASET; YY_BREAK case 9: YY_RULE_SETUP -#line 130 "dds.lex" +#line 131 "dds.lex" store_word(); return SCAN_LIST; YY_BREAK case 10: YY_RULE_SETUP -#line 131 "dds.lex" +#line 132 "dds.lex" store_word(); return SCAN_SEQUENCE; YY_BREAK case 11: YY_RULE_SETUP -#line 132 "dds.lex" +#line 133 "dds.lex" store_word(); return SCAN_STRUCTURE; YY_BREAK case 12: YY_RULE_SETUP -#line 133 "dds.lex" +#line 134 "dds.lex" store_word(); return SCAN_GRID; YY_BREAK case 13: YY_RULE_SETUP -#line 134 "dds.lex" +#line 135 "dds.lex" store_word(); return SCAN_BYTE; YY_BREAK case 14: YY_RULE_SETUP -#line 135 "dds.lex" +#line 136 "dds.lex" store_word(); return SCAN_INT16; YY_BREAK case 15: YY_RULE_SETUP -#line 136 "dds.lex" +#line 137 "dds.lex" store_word(); return SCAN_UINT16; YY_BREAK case 16: YY_RULE_SETUP -#line 137 "dds.lex" +#line 138 "dds.lex" store_word(); return SCAN_INT32; YY_BREAK case 17: YY_RULE_SETUP -#line 138 "dds.lex" +#line 139 "dds.lex" store_word(); return SCAN_UINT32; YY_BREAK case 18: YY_RULE_SETUP -#line 139 "dds.lex" +#line 140 "dds.lex" store_word(); return SCAN_FLOAT32; YY_BREAK case 19: YY_RULE_SETUP -#line 140 "dds.lex" +#line 141 "dds.lex" store_word(); return SCAN_FLOAT64; YY_BREAK case 20: YY_RULE_SETUP -#line 141 "dds.lex" +#line 142 "dds.lex" store_word(); return SCAN_STRING; YY_BREAK case 21: YY_RULE_SETUP -#line 142 "dds.lex" +#line 143 "dds.lex" store_word(); return SCAN_URL; YY_BREAK case 22: YY_RULE_SETUP -#line 144 "dds.lex" +#line 145 "dds.lex" store_word(); return SCAN_WORD; YY_BREAK case 23: YY_RULE_SETUP -#line 146 "dds.lex" +#line 147 "dds.lex" YY_BREAK case 24: /* rule 24 can match eol */ YY_RULE_SETUP -#line 147 "dds.lex" +#line 148 "dds.lex" ++dds_line_num; YY_BREAK case YY_STATE_EOF(INITIAL): -#line 148 "dds.lex" +#line 149 "dds.lex" yy_init = 1; dds_line_num = 1; yyterminate(); YY_BREAK case 25: YY_RULE_SETUP -#line 150 "dds.lex" +#line 151 "dds.lex" BEGIN(comment); YY_BREAK case 26: YY_RULE_SETUP -#line 151 "dds.lex" +#line 152 "dds.lex" YY_BREAK case 27: /* rule 27 can match eol */ YY_RULE_SETUP -#line 152 "dds.lex" +#line 153 "dds.lex" ++dds_line_num; BEGIN(INITIAL); YY_BREAK case YY_STATE_EOF(comment): -#line 153 "dds.lex" +#line 154 "dds.lex" yy_init = 1; dds_line_num = 1; yyterminate(); YY_BREAK case 28: /* rule 28 can match eol */ YY_RULE_SETUP -#line 155 "dds.lex" +#line 156 "dds.lex" yyterminate(); YY_BREAK case 29: /* rule 29 can match eol */ YY_RULE_SETUP -#line 156 "dds.lex" +#line 157 "dds.lex" yyterminate(); YY_BREAK case 30: /* rule 30 can match eol */ YY_RULE_SETUP -#line 158 "dds.lex" +#line 159 "dds.lex" { if (ddstext) { /* suppress msgs about `' chars */ fprintf(stderr, "Character `%c' is not", *ddstext); @@ -1079,10 +1120,10 @@ YY_BREAK case 31: YY_RULE_SETUP -#line 164 "dds.lex" +#line 165 "dds.lex" ECHO; YY_BREAK -#line 1086 "lex.dds.cc" +#line 1127 "lex.dds.cc" case YY_END_OF_BUFFER: { @@ -1311,7 +1352,7 @@ /* Read in more data. */ YY_INPUT( (&YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move]), - (yy_n_chars), num_to_read ); + (yy_n_chars), (size_t) num_to_read ); YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars); } @@ -1335,6 +1376,14 @@ else ret_val = EOB_ACT_CONTINUE_SCAN; + if ((yy_size_t) ((yy_n_chars) + number_to_move) > YY_CURRENT_BUFFER_LVALUE->yy_buf_size) { + /* Extend the array by 50%, plus the number we really need. */ + yy_size_t new_size = (yy_n_chars) + number_to_move + ((yy_n_chars) >> 1); + YY_CURRENT_BUFFER_LVALUE->yy_ch_buf = (char *) ddsrealloc((void *) YY_CURRENT_BUFFER_LVALUE->yy_ch_buf,new_size ); + if ( ! YY_CURRENT_BUFFER_LVALUE->yy_ch_buf ) + YY_FATAL_ERROR( "out of dynamic memory in yy_get_next_buffer()" ); + } + (yy_n_chars) += number_to_move; YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] = YY_END_OF_BUFFER_CHAR; YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars) + 1] = YY_END_OF_BUFFER_CHAR; @@ -1401,43 +1450,6 @@ return yy_is_jam ? 0 : yy_current_state; } - static void yyunput (int c, register char * yy_bp ) -{ - register char *yy_cp; - - yy_cp = (yy_c_buf_p); - - /* undo effects of setting up ddstext */ - *yy_cp = (yy_hold_char); - - if ( yy_cp < YY_CURRENT_BUFFER_LVALUE->yy_ch_buf + 2 ) - { /* need to shift things up to make room */ - /* +2 for EOB chars. */ - register int number_to_move = (yy_n_chars) + 2; - register char *dest = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[ - YY_CURRENT_BUFFER_LVALUE->yy_buf_size + 2]; - register char *source = - &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move]; - - while ( source > YY_CURRENT_BUFFER_LVALUE->yy_ch_buf ) - *--dest = *--source; - - yy_cp += (int) (dest - source); - yy_bp += (int) (dest - source); - YY_CURRENT_BUFFER_LVALUE->yy_n_chars = - (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_buf_size; - - if ( yy_cp < YY_CURRENT_BUFFER_LVALUE->yy_ch_buf + 2 ) - YY_FATAL_ERROR( "flex scanner push-back overflow" ); - } - - *--yy_cp = (char) c; - - (yytext_ptr) = yy_bp; - (yy_hold_char) = *yy_cp; - (yy_c_buf_p) = yy_cp; -} - #ifndef YY_NO_INPUT #ifdef __cplusplus static int yyinput (void) @@ -1486,7 +1498,7 @@ case EOB_ACT_END_OF_FILE: { if ( ddswrap( ) ) - return 0; + return EOF; if ( ! (yy_did_buffer_switch_on_eof) ) YY_NEW_FILE; @@ -1750,7 +1762,9 @@ (yy_buffer_stack) = (struct yy_buffer_state**)ddsalloc (num_to_alloc * sizeof(struct yy_buffer_state*) ); - + if ( ! (yy_buffer_stack) ) + YY_FATAL_ERROR( "out of dynamic memory in ddsensure_buffer_stack()" ); + memset((yy_buffer_stack), 0, num_to_alloc * sizeof(struct yy_buffer_state*)); (yy_buffer_stack_max) = num_to_alloc; @@ -1768,6 +1782,8 @@ ((yy_buffer_stack), num_to_alloc * sizeof(struct yy_buffer_state*) ); + if ( ! (yy_buffer_stack) ) + YY_FATAL_ERROR( "out of dynamic memory in ddsensure_buffer_stack()" ); /* zero only the new slots.*/ memset((yy_buffer_stack) + (yy_buffer_stack_max), 0, grow_size * sizeof(struct yy_buffer_state*)); @@ -1812,7 +1828,7 @@ /** Setup the input buffer state to scan a string. The next call to ddslex() will * scan from a @e copy of @a str. - * @param str a NUL-terminated string to scan + * @param yystr a NUL-terminated string to scan * * @return the newly allocated buffer state object. * @note If you want to scan bytes that may contain NUL values, then use @@ -2066,7 +2082,7 @@ #define YYTABLES_NAME "yytables" -#line 164 "dds.lex" +#line 165 "dds.lex" diff -Nru libdap-3.11.1/lex.gse_.cc libdap-3.12.0/lex.gse_.cc --- libdap-3.11.1/lex.gse_.cc 2011-05-06 17:50:25.000000000 +0000 +++ libdap-3.12.0/lex.gse_.cc 1970-01-01 00:00:00.000000000 +0000 @@ -1,1882 +0,0 @@ -#line 2 "lex.gse_.cc" - -#line 4 "lex.gse_.cc" - -#define YY_INT_ALIGNED short int - -/* A lexical scanner generated by flex */ - -#define FLEX_SCANNER -#define YY_FLEX_MAJOR_VERSION 2 -#define YY_FLEX_MINOR_VERSION 5 -#define YY_FLEX_SUBMINOR_VERSION 33 -#if YY_FLEX_SUBMINOR_VERSION > 0 -#define FLEX_BETA -#endif - -/* First, we deal with platform-specific or compiler-specific issues. */ - -/* begin standard C headers. */ -#include -#include -#include -#include - -/* end standard C headers. */ - -/* flex integer type definitions */ - -#ifndef FLEXINT_H -#define FLEXINT_H - -/* C99 systems have . Non-C99 systems may or may not. */ - -#if __STDC_VERSION__ >= 199901L - -/* C99 says to define __STDC_LIMIT_MACROS before including stdint.h, - * if you want the limit (max/min) macros for int types. - */ -#ifndef __STDC_LIMIT_MACROS -#define __STDC_LIMIT_MACROS 1 -#endif - -#include -typedef int8_t flex_int8_t; -typedef uint8_t flex_uint8_t; -typedef int16_t flex_int16_t; -typedef uint16_t flex_uint16_t; -typedef int32_t flex_int32_t; -typedef uint32_t flex_uint32_t; -#else -typedef signed char flex_int8_t; -typedef short int flex_int16_t; -typedef int flex_int32_t; -typedef unsigned char flex_uint8_t; -typedef unsigned short int flex_uint16_t; -typedef unsigned int flex_uint32_t; -#endif /* ! C99 */ - -/* Limits of integral types. */ -#ifndef INT8_MIN -#define INT8_MIN (-128) -#endif -#ifndef INT16_MIN -#define INT16_MIN (-32767-1) -#endif -#ifndef INT32_MIN -#define INT32_MIN (-2147483647-1) -#endif -#ifndef INT8_MAX -#define INT8_MAX (127) -#endif -#ifndef INT16_MAX -#define INT16_MAX (32767) -#endif -#ifndef INT32_MAX -#define INT32_MAX (2147483647) -#endif -#ifndef UINT8_MAX -#define UINT8_MAX (255U) -#endif -#ifndef UINT16_MAX -#define UINT16_MAX (65535U) -#endif -#ifndef UINT32_MAX -#define UINT32_MAX (4294967295U) -#endif - -#endif /* ! FLEXINT_H */ - -#ifdef __cplusplus - -/* The "const" storage-class-modifier is valid. */ -#define YY_USE_CONST - -#else /* ! __cplusplus */ - -#if __STDC__ - -#define YY_USE_CONST - -#endif /* __STDC__ */ -#endif /* ! __cplusplus */ - -#ifdef YY_USE_CONST -#define yyconst const -#else -#define yyconst -#endif - -/* Returned upon end-of-file. */ -#define YY_NULL 0 - -/* Promotes a possibly negative, possibly signed char to an unsigned - * integer for use as an array index. If the signed char is negative, - * we want to instead treat it as an 8-bit unsigned char, hence the - * double cast. - */ -#define YY_SC_TO_UI(c) ((unsigned int) (unsigned char) c) - -/* Enter a start condition. This macro really ought to take a parameter, - * but we do it the disgusting crufty way forced on us by the ()-less - * definition of BEGIN. - */ -#define BEGIN (yy_start) = 1 + 2 * - -/* Translate the current start state into a value that can be later handed - * to BEGIN to return to the state. The YYSTATE alias is for lex - * compatibility. - */ -#define YY_START (((yy_start) - 1) / 2) -#define YYSTATE YY_START - -/* Action number for EOF rule of a given start state. */ -#define YY_STATE_EOF(state) (YY_END_OF_BUFFER + state + 1) - -/* Special action meaning "start processing a new file". */ -#define YY_NEW_FILE gse_restart(gse_in ) - -#define YY_END_OF_BUFFER_CHAR 0 - -/* Size of default input buffer. */ -#ifndef YY_BUF_SIZE -#define YY_BUF_SIZE 16384 -#endif - -/* The state buf must be large enough to hold one state per character in the main buffer. - */ -#define YY_STATE_BUF_SIZE ((YY_BUF_SIZE + 2) * sizeof(yy_state_type)) - -#ifndef YY_TYPEDEF_YY_BUFFER_STATE -#define YY_TYPEDEF_YY_BUFFER_STATE -typedef struct yy_buffer_state *YY_BUFFER_STATE; -#endif - -extern int gse_leng; - -extern FILE *gse_in, *gse_out; - -#define EOB_ACT_CONTINUE_SCAN 0 -#define EOB_ACT_END_OF_FILE 1 -#define EOB_ACT_LAST_MATCH 2 - - #define YY_LESS_LINENO(n) - -/* Return all but the first "n" matched characters back to the input stream. */ -#define yyless(n) \ - do \ - { \ - /* Undo effects of setting up gse_text. */ \ - int yyless_macro_arg = (n); \ - YY_LESS_LINENO(yyless_macro_arg);\ - *yy_cp = (yy_hold_char); \ - YY_RESTORE_YY_MORE_OFFSET \ - (yy_c_buf_p) = yy_cp = yy_bp + yyless_macro_arg - YY_MORE_ADJ; \ - YY_DO_BEFORE_ACTION; /* set up gse_text again */ \ - } \ - while ( 0 ) - -#define unput(c) yyunput( c, (yytext_ptr) ) - -/* The following is because we cannot portably get our hands on size_t - * (without autoconf's help, which isn't available because we want - * flex-generated scanners to compile on their own). - */ - -#ifndef YY_TYPEDEF_YY_SIZE_T -#define YY_TYPEDEF_YY_SIZE_T -typedef unsigned int yy_size_t; -#endif - -#ifndef YY_STRUCT_YY_BUFFER_STATE -#define YY_STRUCT_YY_BUFFER_STATE -struct yy_buffer_state - { - FILE *yy_input_file; - - char *yy_ch_buf; /* input buffer */ - char *yy_buf_pos; /* current position in input buffer */ - - /* Size of input buffer in bytes, not including room for EOB - * characters. - */ - yy_size_t yy_buf_size; - - /* Number of characters read into yy_ch_buf, not including EOB - * characters. - */ - int yy_n_chars; - - /* Whether we "own" the buffer - i.e., we know we created it, - * and can realloc() it to grow it, and should free() it to - * delete it. - */ - int yy_is_our_buffer; - - /* Whether this is an "interactive" input source; if so, and - * if we're using stdio for input, then we want to use getc() - * instead of fread(), to make sure we stop fetching input after - * each newline. - */ - int yy_is_interactive; - - /* Whether we're considered to be at the beginning of a line. - * If so, '^' rules will be active on the next match, otherwise - * not. - */ - int yy_at_bol; - - int yy_bs_lineno; /**< The line count. */ - int yy_bs_column; /**< The column count. */ - - /* Whether to try to fill the input buffer when we reach the - * end of it. - */ - int yy_fill_buffer; - - int yy_buffer_status; - -#define YY_BUFFER_NEW 0 -#define YY_BUFFER_NORMAL 1 - /* When an EOF's been seen but there's still some text to process - * then we mark the buffer as YY_EOF_PENDING, to indicate that we - * shouldn't try reading from the input source any more. We might - * still have a bunch of tokens to match, though, because of - * possible backing-up. - * - * When we actually see the EOF, we change the status to "new" - * (via gse_restart()), so that the user can continue scanning by - * just pointing gse_in at a new input file. - */ -#define YY_BUFFER_EOF_PENDING 2 - - }; -#endif /* !YY_STRUCT_YY_BUFFER_STATE */ - -/* Stack of input buffers. */ -static size_t yy_buffer_stack_top = 0; /**< index of top of stack. */ -static size_t yy_buffer_stack_max = 0; /**< capacity of stack. */ -static YY_BUFFER_STATE * yy_buffer_stack = 0; /**< Stack as an array. */ - -/* We provide macros for accessing buffer states in case in the - * future we want to put the buffer states in a more general - * "scanner state". - * - * Returns the top of the stack, or NULL. - */ -#define YY_CURRENT_BUFFER ( (yy_buffer_stack) \ - ? (yy_buffer_stack)[(yy_buffer_stack_top)] \ - : NULL) - -/* Same as previous macro, but useful when we know that the buffer stack is not - * NULL or when we need an lvalue. For internal use only. - */ -#define YY_CURRENT_BUFFER_LVALUE (yy_buffer_stack)[(yy_buffer_stack_top)] - -/* yy_hold_char holds the character lost when gse_text is formed. */ -static char yy_hold_char; -static int yy_n_chars; /* number of characters read into yy_ch_buf */ -int gse_leng; - -/* Points to current character in buffer. */ -static char *yy_c_buf_p = (char *) 0; -static int yy_init = 0; /* whether we need to initialize */ -static int yy_start = 0; /* start state number */ - -/* Flag which is used to allow gse_wrap()'s to do buffer switches - * instead of setting up a fresh gse_in. A bit of a hack ... - */ -static int yy_did_buffer_switch_on_eof; - -void gse_restart (FILE *input_file ); -void gse__switch_to_buffer (YY_BUFFER_STATE new_buffer ); -YY_BUFFER_STATE gse__create_buffer (FILE *file,int size ); -void gse__delete_buffer (YY_BUFFER_STATE b ); -void gse__flush_buffer (YY_BUFFER_STATE b ); -void gse_push_buffer_state (YY_BUFFER_STATE new_buffer ); -void gse_pop_buffer_state (void ); - -static void gse_ensure_buffer_stack (void ); -static void gse__load_buffer_state (void ); -static void gse__init_buffer (YY_BUFFER_STATE b,FILE *file ); - -#define YY_FLUSH_BUFFER gse__flush_buffer(YY_CURRENT_BUFFER ) - -YY_BUFFER_STATE gse__scan_buffer (char *base,yy_size_t size ); -YY_BUFFER_STATE gse__scan_string (yyconst char *yy_str ); -YY_BUFFER_STATE gse__scan_bytes (yyconst char *bytes,int len ); - -void *gse_alloc (yy_size_t ); -void *gse_realloc (void *,yy_size_t ); -void gse_free (void * ); - -#define yy_new_buffer gse__create_buffer - -#define yy_set_interactive(is_interactive) \ - { \ - if ( ! YY_CURRENT_BUFFER ){ \ - gse_ensure_buffer_stack (); \ - YY_CURRENT_BUFFER_LVALUE = \ - gse__create_buffer(gse_in,YY_BUF_SIZE ); \ - } \ - YY_CURRENT_BUFFER_LVALUE->yy_is_interactive = is_interactive; \ - } - -#define yy_set_bol(at_bol) \ - { \ - if ( ! YY_CURRENT_BUFFER ){\ - gse_ensure_buffer_stack (); \ - YY_CURRENT_BUFFER_LVALUE = \ - gse__create_buffer(gse_in,YY_BUF_SIZE ); \ - } \ - YY_CURRENT_BUFFER_LVALUE->yy_at_bol = at_bol; \ - } - -#define YY_AT_BOL() (YY_CURRENT_BUFFER_LVALUE->yy_at_bol) - -/* Begin user sect3 */ - -#define gse_wrap(n) 1 -#define YY_SKIP_YYWRAP - -typedef unsigned char YY_CHAR; - -FILE *gse_in = (FILE *) 0, *gse_out = (FILE *) 0; - -typedef int yy_state_type; - -extern int gse_lineno; - -int gse_lineno = 1; - -extern char *gse_text; -#define yytext_ptr gse_text - -static yy_state_type yy_get_previous_state (void ); -static yy_state_type yy_try_NUL_trans (yy_state_type current_state ); -static int yy_get_next_buffer (void ); -static void yy_fatal_error (yyconst char msg[] ); - -/* Done after the current pattern has been matched and before the - * corresponding action - sets up gse_text. - */ -#define YY_DO_BEFORE_ACTION \ - (yytext_ptr) = yy_bp; \ - gse_leng = (size_t) (yy_cp - yy_bp); \ - (yy_hold_char) = *yy_cp; \ - *yy_cp = '\0'; \ - (yy_c_buf_p) = yy_cp; - -#define YY_NUM_RULES 10 -#define YY_END_OF_BUFFER 11 -/* This struct is not used in this scanner, - but its presence is necessary. */ -struct yy_trans_info - { - flex_int32_t yy_verify; - flex_int32_t yy_nxt; - }; -static yyconst flex_int16_t yy_accept[32] = - { 0, - 0, 0, 11, 10, 10, 3, 3, 3, 1, 8, - 4, 6, 3, 3, 5, 3, 3, 1, 2, 2, - 1, 3, 9, 7, 3, 3, 2, 3, 2, 2, - 0 - } ; - -static yyconst flex_int32_t yy_ec[256] = - { 0, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 2, 1, 3, 1, 4, 1, 1, 1, - 1, 1, 5, 1, 5, 6, 4, 7, 7, 7, - 7, 7, 7, 7, 7, 7, 7, 1, 1, 8, - 9, 10, 1, 1, 11, 4, 4, 4, 12, 13, - 4, 4, 14, 4, 4, 4, 4, 15, 4, 4, - 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, - 1, 4, 1, 1, 4, 1, 11, 4, 4, 4, - - 16, 13, 4, 4, 14, 4, 4, 4, 4, 15, - 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, - 4, 4, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1 - } ; - -static yyconst flex_int32_t yy_meta[17] = - { 0, - 1, 1, 2, 2, 2, 2, 2, 1, 1, 1, - 2, 2, 2, 2, 2, 2 - } ; - -static yyconst flex_int16_t yy_base[33] = - { 0, - 0, 0, 43, 44, 33, 0, 11, 34, 13, 31, - 44, 30, 23, 26, 44, 0, 29, 0, 15, 17, - 0, 21, 44, 44, 22, 19, 24, 26, 25, 0, - 44, 25 - } ; - -static yyconst flex_int16_t yy_def[33] = - { 0, - 31, 1, 31, 31, 31, 32, 32, 32, 32, 31, - 31, 31, 32, 32, 31, 32, 32, 9, 9, 9, - 9, 32, 31, 31, 32, 32, 9, 32, 32, 32, - 0, 31 - } ; - -static yyconst flex_int16_t yy_nxt[61] = - { 0, - 4, 5, 4, 6, 7, 8, 9, 10, 11, 12, - 6, 6, 6, 13, 14, 6, 17, 18, 20, 21, - 16, 19, 16, 27, 22, 28, 16, 29, 22, 16, - 27, 29, 29, 30, 30, 19, 26, 25, 24, 23, - 19, 15, 31, 3, 31, 31, 31, 31, 31, 31, - 31, 31, 31, 31, 31, 31, 31, 31, 31, 31 - } ; - -static yyconst flex_int16_t yy_chk[61] = - { 0, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 7, 7, 9, 9, - 19, 19, 20, 20, 9, 22, 32, 22, 9, 27, - 27, 29, 28, 26, 25, 17, 14, 13, 12, 10, - 8, 5, 3, 31, 31, 31, 31, 31, 31, 31, - 31, 31, 31, 31, 31, 31, 31, 31, 31, 31 - } ; - -static yy_state_type yy_last_accepting_state; -static char *yy_last_accepting_cpos; - -extern int gse__flex_debug; -int gse__flex_debug = 0; - -/* The intent behind this definition is that it'll catch - * any uses of REJECT which flex missed. - */ -#define REJECT reject_used_but_not_detected -#define yymore() yymore_used_but_not_detected -#define YY_MORE_ADJ 0 -#define YY_RESTORE_YY_MORE_OFFSET -char *gse_text; -#line 1 "gse.lex" -/* - -*- mode: c++; c-basic-offset:4 -*- - - This file is part of libdap, A C++ implementation of the OPeNDAP Data - Access Protocol. - - Copyright (c) 2002,2003 OPeNDAP, Inc. - Author: James Gallagher - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - This library 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 - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with this library; if not, write to the Free Software - Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - - You can contact OPeNDAP, Inc. at PO Box 112, Saunderstown, RI. 02874-0112. - - (c) COPYRIGHT URI/MIT 1999 -*/ -/* - Scanner for grid selection sub-expressions. The scanner is not reentrant, - but can share a name space with other scanners. - - Note: - 1) The `defines' file gse.tab.h is built using `bison -d'. - 2) Define YY_DECL such that the scanner is called `gse_lex'. - 3) When bison builds the gse.tab.h file, it uses `gse_' instead - of `yy' for variable name prefixes (e.g., yylval --> gse_lval). - - 1/13/99 jhrg -*/ -#line 44 "gse.lex" - -#include "config_dap.h" - -static char rcsid[] not_used = {"$Id: gse.lex 18500 2008-03-19 19:39:45Z jimg $"}; - -#include -#include - -#include "Error.h" - -#ifndef YY_PROTO -#define YY_PROTO(proto) proto -#endif - -#define YY_DECL int gse_lex YY_PROTO(( void )) -#define ID_MAX 256 -#define YY_NO_UNPUT 1 -#define YY_NO_INPUT 1 -#define YY_FATAL_ERROR(msg) {\ - throw(Error(string("Error scanning grid constraint expression text: ") + string(msg))); \ - yy_fatal_error(msg); /* 'Used' here to suppress warning */ \ -} - -#include "gse.tab.hh" - -using namespace std; -using namespace libdap; - -static void store_int32(); -static void store_float64(); -static void store_id(); -static void store_op(int op); - -/* See das.lex for comments about the characters allowed in a WORD. - 10/31/2001 jhrg */ -#line 552 "lex.gse_.cc" - -#define INITIAL 0 - -#ifndef YY_NO_UNISTD_H -/* Special case for "unistd.h", since it is non-ANSI. We include it way - * down here because we want the user's section 1 to have been scanned first. - * The user has a chance to override it with an option. - */ -#include -#endif - -#ifndef YY_EXTRA_TYPE -#define YY_EXTRA_TYPE void * -#endif - -static int yy_init_globals (void ); - -/* Macros after this point can all be overridden by user definitions in - * section 1. - */ - -#ifndef YY_SKIP_YYWRAP -#ifdef __cplusplus -extern "C" int gse_wrap (void ); -#else -extern int gse_wrap (void ); -#endif -#endif - - static void yyunput (int c,char *buf_ptr ); - -#ifndef yytext_ptr -static void yy_flex_strncpy (char *,yyconst char *,int ); -#endif - -#ifdef YY_NEED_STRLEN -static int yy_flex_strlen (yyconst char * ); -#endif - -#ifndef YY_NO_INPUT - -#ifdef __cplusplus -static int yyinput (void ); -#else -static int input (void ); -#endif - -#endif - -/* Amount of stuff to slurp up with each read. */ -#ifndef YY_READ_BUF_SIZE -#define YY_READ_BUF_SIZE 8192 -#endif - -/* Copy whatever the last rule matched to the standard output. */ -#ifndef ECHO -/* This used to be an fputs(), but since the string might contain NUL's, - * we now use fwrite(). - */ -#define ECHO (void) fwrite( gse_text, gse_leng, 1, gse_out ) -#endif - -/* Gets input and stuffs it into "buf". number of characters read, or YY_NULL, - * is returned in "result". - */ -#ifndef YY_INPUT -#define YY_INPUT(buf,result,max_size) \ - if ( YY_CURRENT_BUFFER_LVALUE->yy_is_interactive ) \ - { \ - int c = '*'; \ - size_t n; \ - for ( n = 0; n < max_size && \ - (c = getc( gse_in )) != EOF && c != '\n'; ++n ) \ - buf[n] = (char) c; \ - if ( c == '\n' ) \ - buf[n++] = (char) c; \ - if ( c == EOF && ferror( gse_in ) ) \ - YY_FATAL_ERROR( "input in flex scanner failed" ); \ - result = n; \ - } \ - else \ - { \ - errno=0; \ - while ( (result = fread(buf, 1, max_size, gse_in))==0 && ferror(gse_in)) \ - { \ - if( errno != EINTR) \ - { \ - YY_FATAL_ERROR( "input in flex scanner failed" ); \ - break; \ - } \ - errno=0; \ - clearerr(gse_in); \ - } \ - }\ -\ - -#endif - -/* No semi-colon after return; correct usage is to write "yyterminate();" - - * we don't want an extra ';' after the "return" because that will cause - * some compilers to complain about unreachable statements. - */ -#ifndef yyterminate -#define yyterminate() return YY_NULL -#endif - -/* Number of entries by which start-condition stack grows. */ -#ifndef YY_START_STACK_INCR -#define YY_START_STACK_INCR 25 -#endif - -/* Report a fatal error. */ -#ifndef YY_FATAL_ERROR -#define YY_FATAL_ERROR(msg) yy_fatal_error( msg ) -#endif - -/* end tables serialization structures and prototypes */ - -/* Default declaration of generated scanner - a define so the user can - * easily add parameters. - */ -#ifndef YY_DECL -#define YY_DECL_IS_OURS 1 - -extern int gse_lex (void); - -#define YY_DECL int gse_lex (void) -#endif /* !YY_DECL */ - -/* Code executed at the beginning of each rule, after gse_text and gse_leng - * have been set up. - */ -#ifndef YY_USER_ACTION -#define YY_USER_ACTION -#endif - -/* Code executed at the end of each rule. */ -#ifndef YY_BREAK -#define YY_BREAK break; -#endif - -#define YY_RULE_SETUP \ - YY_USER_ACTION - -/** The main scanner function which does all the work. - */ -YY_DECL -{ - register yy_state_type yy_current_state; - register char *yy_cp, *yy_bp; - register int yy_act; - -#line 107 "gse.lex" - - -#line 708 "lex.gse_.cc" - - if ( !(yy_init) ) - { - (yy_init) = 1; - -#ifdef YY_USER_INIT - YY_USER_INIT; -#endif - - if ( ! (yy_start) ) - (yy_start) = 1; /* first start state */ - - if ( ! gse_in ) - gse_in = stdin; - - if ( ! gse_out ) - gse_out = stdout; - - if ( ! YY_CURRENT_BUFFER ) { - gse_ensure_buffer_stack (); - YY_CURRENT_BUFFER_LVALUE = - gse__create_buffer(gse_in,YY_BUF_SIZE ); - } - - gse__load_buffer_state( ); - } - - while ( 1 ) /* loops until end-of-file is reached */ - { - yy_cp = (yy_c_buf_p); - - /* Support of gse_text. */ - *yy_cp = (yy_hold_char); - - /* yy_bp points to the position in yy_ch_buf of the start of - * the current run. - */ - yy_bp = yy_cp; - - yy_current_state = (yy_start); -yy_match: - do - { - register YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)]; - if ( yy_accept[yy_current_state] ) - { - (yy_last_accepting_state) = yy_current_state; - (yy_last_accepting_cpos) = yy_cp; - } - while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) - { - yy_current_state = (int) yy_def[yy_current_state]; - if ( yy_current_state >= 32 ) - yy_c = yy_meta[(unsigned int) yy_c]; - } - yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; - ++yy_cp; - } - while ( yy_base[yy_current_state] != 44 ); - -yy_find_action: - yy_act = yy_accept[yy_current_state]; - if ( yy_act == 0 ) - { /* have to back up */ - yy_cp = (yy_last_accepting_cpos); - yy_current_state = (yy_last_accepting_state); - yy_act = yy_accept[yy_current_state]; - } - - YY_DO_BEFORE_ACTION; - -do_action: /* This label is used only to access EOF actions. */ - - switch ( yy_act ) - { /* beginning of action switch */ - case 0: /* must back up */ - /* undo the effects of YY_DO_BEFORE_ACTION */ - *yy_cp = (yy_hold_char); - yy_cp = (yy_last_accepting_cpos); - yy_current_state = (yy_last_accepting_state); - goto yy_find_action; - -case 1: -YY_RULE_SETUP -#line 109 "gse.lex" -store_int32(); return SCAN_INT; - YY_BREAK -case 2: -YY_RULE_SETUP -#line 110 "gse.lex" -store_float64(); return SCAN_FLOAT; - YY_BREAK -case 3: -YY_RULE_SETUP -#line 112 "gse.lex" -store_id(); return SCAN_WORD; - YY_BREAK -case 4: -YY_RULE_SETUP -#line 114 "gse.lex" -store_op(SCAN_EQUAL); return SCAN_EQUAL; - YY_BREAK -case 5: -YY_RULE_SETUP -#line 115 "gse.lex" -store_op(SCAN_NOT_EQUAL); return SCAN_NOT_EQUAL; - YY_BREAK -case 6: -YY_RULE_SETUP -#line 116 "gse.lex" -store_op(SCAN_GREATER); return SCAN_GREATER; - YY_BREAK -case 7: -YY_RULE_SETUP -#line 117 "gse.lex" -store_op(SCAN_GREATER_EQL); return SCAN_GREATER_EQL; - YY_BREAK -case 8: -YY_RULE_SETUP -#line 118 "gse.lex" -store_op(SCAN_LESS); return SCAN_LESS; - YY_BREAK -case 9: -YY_RULE_SETUP -#line 119 "gse.lex" -store_op(SCAN_LESS_EQL); return SCAN_LESS_EQL; - YY_BREAK -case 10: -YY_RULE_SETUP -#line 121 "gse.lex" -ECHO; - YY_BREAK -#line 841 "lex.gse_.cc" -case YY_STATE_EOF(INITIAL): - yyterminate(); - - case YY_END_OF_BUFFER: - { - /* Amount of text matched not including the EOB char. */ - int yy_amount_of_matched_text = (int) (yy_cp - (yytext_ptr)) - 1; - - /* Undo the effects of YY_DO_BEFORE_ACTION. */ - *yy_cp = (yy_hold_char); - YY_RESTORE_YY_MORE_OFFSET - - if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_NEW ) - { - /* We're scanning a new file or input source. It's - * possible that this happened because the user - * just pointed gse_in at a new source and called - * gse_lex(). If so, then we have to assure - * consistency between YY_CURRENT_BUFFER and our - * globals. Here is the right place to do so, because - * this is the first action (other than possibly a - * back-up) that will match for the new input source. - */ - (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_n_chars; - YY_CURRENT_BUFFER_LVALUE->yy_input_file = gse_in; - YY_CURRENT_BUFFER_LVALUE->yy_buffer_status = YY_BUFFER_NORMAL; - } - - /* Note that here we test for yy_c_buf_p "<=" to the position - * of the first EOB in the buffer, since yy_c_buf_p will - * already have been incremented past the NUL character - * (since all states make transitions on EOB to the - * end-of-buffer state). Contrast this with the test - * in input(). - */ - if ( (yy_c_buf_p) <= &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] ) - { /* This was really a NUL. */ - yy_state_type yy_next_state; - - (yy_c_buf_p) = (yytext_ptr) + yy_amount_of_matched_text; - - yy_current_state = yy_get_previous_state( ); - - /* Okay, we're now positioned to make the NUL - * transition. We couldn't have - * yy_get_previous_state() go ahead and do it - * for us because it doesn't know how to deal - * with the possibility of jamming (and we don't - * want to build jamming into it because then it - * will run more slowly). - */ - - yy_next_state = yy_try_NUL_trans( yy_current_state ); - - yy_bp = (yytext_ptr) + YY_MORE_ADJ; - - if ( yy_next_state ) - { - /* Consume the NUL. */ - yy_cp = ++(yy_c_buf_p); - yy_current_state = yy_next_state; - goto yy_match; - } - - else - { - yy_cp = (yy_c_buf_p); - goto yy_find_action; - } - } - - else switch ( yy_get_next_buffer( ) ) - { - case EOB_ACT_END_OF_FILE: - { - (yy_did_buffer_switch_on_eof) = 0; - - if ( gse_wrap( ) ) - { - /* Note: because we've taken care in - * yy_get_next_buffer() to have set up - * gse_text, we can now set up - * yy_c_buf_p so that if some total - * hoser (like flex itself) wants to - * call the scanner after we return the - * YY_NULL, it'll still work - another - * YY_NULL will get returned. - */ - (yy_c_buf_p) = (yytext_ptr) + YY_MORE_ADJ; - - yy_act = YY_STATE_EOF(YY_START); - goto do_action; - } - - else - { - if ( ! (yy_did_buffer_switch_on_eof) ) - YY_NEW_FILE; - } - break; - } - - case EOB_ACT_CONTINUE_SCAN: - (yy_c_buf_p) = - (yytext_ptr) + yy_amount_of_matched_text; - - yy_current_state = yy_get_previous_state( ); - - yy_cp = (yy_c_buf_p); - yy_bp = (yytext_ptr) + YY_MORE_ADJ; - goto yy_match; - - case EOB_ACT_LAST_MATCH: - (yy_c_buf_p) = - &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)]; - - yy_current_state = yy_get_previous_state( ); - - yy_cp = (yy_c_buf_p); - yy_bp = (yytext_ptr) + YY_MORE_ADJ; - goto yy_find_action; - } - break; - } - - default: - YY_FATAL_ERROR( - "fatal flex scanner internal error--no action found" ); - } /* end of action switch */ - } /* end of scanning one token */ -} /* end of gse_lex */ - -/* yy_get_next_buffer - try to read in a new buffer - * - * Returns a code representing an action: - * EOB_ACT_LAST_MATCH - - * EOB_ACT_CONTINUE_SCAN - continue scanning from current position - * EOB_ACT_END_OF_FILE - end of file - */ -static int yy_get_next_buffer (void) -{ - register char *dest = YY_CURRENT_BUFFER_LVALUE->yy_ch_buf; - register char *source = (yytext_ptr); - register int number_to_move, i; - int ret_val; - - if ( (yy_c_buf_p) > &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars) + 1] ) - YY_FATAL_ERROR( - "fatal flex scanner internal error--end of buffer missed" ); - - if ( YY_CURRENT_BUFFER_LVALUE->yy_fill_buffer == 0 ) - { /* Don't try to fill the buffer, so this is an EOF. */ - if ( (yy_c_buf_p) - (yytext_ptr) - YY_MORE_ADJ == 1 ) - { - /* We matched a single character, the EOB, so - * treat this as a final EOF. - */ - return EOB_ACT_END_OF_FILE; - } - - else - { - /* We matched some text prior to the EOB, first - * process it. - */ - return EOB_ACT_LAST_MATCH; - } - } - - /* Try to read more data. */ - - /* First move last chars to start of buffer. */ - number_to_move = (int) ((yy_c_buf_p) - (yytext_ptr)) - 1; - - for ( i = 0; i < number_to_move; ++i ) - *(dest++) = *(source++); - - if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_EOF_PENDING ) - /* don't do the read, it's not guaranteed to return an EOF, - * just force an EOF - */ - YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars) = 0; - - else - { - int num_to_read = - YY_CURRENT_BUFFER_LVALUE->yy_buf_size - number_to_move - 1; - - while ( num_to_read <= 0 ) - { /* Not enough room in the buffer - grow it. */ - - /* just a shorter name for the current buffer */ - YY_BUFFER_STATE b = YY_CURRENT_BUFFER; - - int yy_c_buf_p_offset = - (int) ((yy_c_buf_p) - b->yy_ch_buf); - - if ( b->yy_is_our_buffer ) - { - int new_size = b->yy_buf_size * 2; - - if ( new_size <= 0 ) - b->yy_buf_size += b->yy_buf_size / 8; - else - b->yy_buf_size *= 2; - - b->yy_ch_buf = (char *) - /* Include room in for 2 EOB chars. */ - gse_realloc((void *) b->yy_ch_buf,b->yy_buf_size + 2 ); - } - else - /* Can't grow it, we don't own it. */ - b->yy_ch_buf = 0; - - if ( ! b->yy_ch_buf ) - YY_FATAL_ERROR( - "fatal error - scanner input buffer overflow" ); - - (yy_c_buf_p) = &b->yy_ch_buf[yy_c_buf_p_offset]; - - num_to_read = YY_CURRENT_BUFFER_LVALUE->yy_buf_size - - number_to_move - 1; - - } - - if ( num_to_read > YY_READ_BUF_SIZE ) - num_to_read = YY_READ_BUF_SIZE; - - /* Read in more data. */ - YY_INPUT( (&YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move]), - (yy_n_chars), num_to_read ); - - YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars); - } - - if ( (yy_n_chars) == 0 ) - { - if ( number_to_move == YY_MORE_ADJ ) - { - ret_val = EOB_ACT_END_OF_FILE; - gse_restart(gse_in ); - } - - else - { - ret_val = EOB_ACT_LAST_MATCH; - YY_CURRENT_BUFFER_LVALUE->yy_buffer_status = - YY_BUFFER_EOF_PENDING; - } - } - - else - ret_val = EOB_ACT_CONTINUE_SCAN; - - (yy_n_chars) += number_to_move; - YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] = YY_END_OF_BUFFER_CHAR; - YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars) + 1] = YY_END_OF_BUFFER_CHAR; - - (yytext_ptr) = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[0]; - - return ret_val; -} - -/* yy_get_previous_state - get the state just before the EOB char was reached */ - - static yy_state_type yy_get_previous_state (void) -{ - register yy_state_type yy_current_state; - register char *yy_cp; - - yy_current_state = (yy_start); - - for ( yy_cp = (yytext_ptr) + YY_MORE_ADJ; yy_cp < (yy_c_buf_p); ++yy_cp ) - { - register YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1); - if ( yy_accept[yy_current_state] ) - { - (yy_last_accepting_state) = yy_current_state; - (yy_last_accepting_cpos) = yy_cp; - } - while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) - { - yy_current_state = (int) yy_def[yy_current_state]; - if ( yy_current_state >= 32 ) - yy_c = yy_meta[(unsigned int) yy_c]; - } - yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; - } - - return yy_current_state; -} - -/* yy_try_NUL_trans - try to make a transition on the NUL character - * - * synopsis - * next_state = yy_try_NUL_trans( current_state ); - */ - static yy_state_type yy_try_NUL_trans (yy_state_type yy_current_state ) -{ - register int yy_is_jam; - register char *yy_cp = (yy_c_buf_p); - - register YY_CHAR yy_c = 1; - if ( yy_accept[yy_current_state] ) - { - (yy_last_accepting_state) = yy_current_state; - (yy_last_accepting_cpos) = yy_cp; - } - while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) - { - yy_current_state = (int) yy_def[yy_current_state]; - if ( yy_current_state >= 32 ) - yy_c = yy_meta[(unsigned int) yy_c]; - } - yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; - yy_is_jam = (yy_current_state == 31); - - return yy_is_jam ? 0 : yy_current_state; -} - - static void yyunput (int c, register char * yy_bp ) -{ - register char *yy_cp; - - yy_cp = (yy_c_buf_p); - - /* undo effects of setting up gse_text */ - *yy_cp = (yy_hold_char); - - if ( yy_cp < YY_CURRENT_BUFFER_LVALUE->yy_ch_buf + 2 ) - { /* need to shift things up to make room */ - /* +2 for EOB chars. */ - register int number_to_move = (yy_n_chars) + 2; - register char *dest = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[ - YY_CURRENT_BUFFER_LVALUE->yy_buf_size + 2]; - register char *source = - &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move]; - - while ( source > YY_CURRENT_BUFFER_LVALUE->yy_ch_buf ) - *--dest = *--source; - - yy_cp += (int) (dest - source); - yy_bp += (int) (dest - source); - YY_CURRENT_BUFFER_LVALUE->yy_n_chars = - (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_buf_size; - - if ( yy_cp < YY_CURRENT_BUFFER_LVALUE->yy_ch_buf + 2 ) - YY_FATAL_ERROR( "flex scanner push-back overflow" ); - } - - *--yy_cp = (char) c; - - (yytext_ptr) = yy_bp; - (yy_hold_char) = *yy_cp; - (yy_c_buf_p) = yy_cp; -} - -#ifndef YY_NO_INPUT -#ifdef __cplusplus - static int yyinput (void) -#else - static int input (void) -#endif - -{ - int c; - - *(yy_c_buf_p) = (yy_hold_char); - - if ( *(yy_c_buf_p) == YY_END_OF_BUFFER_CHAR ) - { - /* yy_c_buf_p now points to the character we want to return. - * If this occurs *before* the EOB characters, then it's a - * valid NUL; if not, then we've hit the end of the buffer. - */ - if ( (yy_c_buf_p) < &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] ) - /* This was really a NUL. */ - *(yy_c_buf_p) = '\0'; - - else - { /* need more input */ - int offset = (yy_c_buf_p) - (yytext_ptr); - ++(yy_c_buf_p); - - switch ( yy_get_next_buffer( ) ) - { - case EOB_ACT_LAST_MATCH: - /* This happens because yy_g_n_b() - * sees that we've accumulated a - * token and flags that we need to - * try matching the token before - * proceeding. But for input(), - * there's no matching to consider. - * So convert the EOB_ACT_LAST_MATCH - * to EOB_ACT_END_OF_FILE. - */ - - /* Reset buffer status. */ - gse_restart(gse_in ); - - /*FALLTHROUGH*/ - - case EOB_ACT_END_OF_FILE: - { - if ( gse_wrap( ) ) - return 0; - - if ( ! (yy_did_buffer_switch_on_eof) ) - YY_NEW_FILE; -#ifdef __cplusplus - return yyinput(); -#else - return input(); -#endif - } - - case EOB_ACT_CONTINUE_SCAN: - (yy_c_buf_p) = (yytext_ptr) + offset; - break; - } - } - } - - c = *(unsigned char *) (yy_c_buf_p); /* cast for 8-bit char's */ - *(yy_c_buf_p) = '\0'; /* preserve gse_text */ - (yy_hold_char) = *++(yy_c_buf_p); - - return c; -} -#endif /* ifndef YY_NO_INPUT */ - -/** Immediately switch to a different input stream. - * @param input_file A readable stream. - * - * @note This function does not reset the start condition to @c INITIAL . - */ - void gse_restart (FILE * input_file ) -{ - - if ( ! YY_CURRENT_BUFFER ){ - gse_ensure_buffer_stack (); - YY_CURRENT_BUFFER_LVALUE = - gse__create_buffer(gse_in,YY_BUF_SIZE ); - } - - gse__init_buffer(YY_CURRENT_BUFFER,input_file ); - gse__load_buffer_state( ); -} - -/** Switch to a different input buffer. - * @param new_buffer The new input buffer. - * - */ - void gse__switch_to_buffer (YY_BUFFER_STATE new_buffer ) -{ - - /* TODO. We should be able to replace this entire function body - * with - * gse_pop_buffer_state(); - * gse_push_buffer_state(new_buffer); - */ - gse_ensure_buffer_stack (); - if ( YY_CURRENT_BUFFER == new_buffer ) - return; - - if ( YY_CURRENT_BUFFER ) - { - /* Flush out information for old buffer. */ - *(yy_c_buf_p) = (yy_hold_char); - YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = (yy_c_buf_p); - YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars); - } - - YY_CURRENT_BUFFER_LVALUE = new_buffer; - gse__load_buffer_state( ); - - /* We don't actually know whether we did this switch during - * EOF (gse_wrap()) processing, but the only time this flag - * is looked at is after gse_wrap() is called, so it's safe - * to go ahead and always set it. - */ - (yy_did_buffer_switch_on_eof) = 1; -} - -static void gse__load_buffer_state (void) -{ - (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_n_chars; - (yytext_ptr) = (yy_c_buf_p) = YY_CURRENT_BUFFER_LVALUE->yy_buf_pos; - gse_in = YY_CURRENT_BUFFER_LVALUE->yy_input_file; - (yy_hold_char) = *(yy_c_buf_p); -} - -/** Allocate and initialize an input buffer state. - * @param file A readable stream. - * @param size The character buffer size in bytes. When in doubt, use @c YY_BUF_SIZE. - * - * @return the allocated buffer state. - */ - YY_BUFFER_STATE gse__create_buffer (FILE * file, int size ) -{ - YY_BUFFER_STATE b; - - b = (YY_BUFFER_STATE) gse_alloc(sizeof( struct yy_buffer_state ) ); - if ( ! b ) - YY_FATAL_ERROR( "out of dynamic memory in gse__create_buffer()" ); - - b->yy_buf_size = size; - - /* yy_ch_buf has to be 2 characters longer than the size given because - * we need to put in 2 end-of-buffer characters. - */ - b->yy_ch_buf = (char *) gse_alloc(b->yy_buf_size + 2 ); - if ( ! b->yy_ch_buf ) - YY_FATAL_ERROR( "out of dynamic memory in gse__create_buffer()" ); - - b->yy_is_our_buffer = 1; - - gse__init_buffer(b,file ); - - return b; -} - -/** Destroy the buffer. - * @param b a buffer created with gse__create_buffer() - * - */ - void gse__delete_buffer (YY_BUFFER_STATE b ) -{ - - if ( ! b ) - return; - - if ( b == YY_CURRENT_BUFFER ) /* Not sure if we should pop here. */ - YY_CURRENT_BUFFER_LVALUE = (YY_BUFFER_STATE) 0; - - if ( b->yy_is_our_buffer ) - gse_free((void *) b->yy_ch_buf ); - - gse_free((void *) b ); -} - -#ifndef __cplusplus -extern int isatty (int ); -#endif /* __cplusplus */ - -/* Initializes or reinitializes a buffer. - * This function is sometimes called more than once on the same buffer, - * such as during a gse_restart() or at EOF. - */ - static void gse__init_buffer (YY_BUFFER_STATE b, FILE * file ) - -{ - int oerrno = errno; - - gse__flush_buffer(b ); - - b->yy_input_file = file; - b->yy_fill_buffer = 1; - - /* If b is the current buffer, then gse__init_buffer was _probably_ - * called from gse_restart() or through yy_get_next_buffer. - * In that case, we don't want to reset the lineno or column. - */ - if (b != YY_CURRENT_BUFFER){ - b->yy_bs_lineno = 1; - b->yy_bs_column = 0; - } - - b->yy_is_interactive = file ? (isatty( fileno(file) ) > 0) : 0; - - errno = oerrno; -} - -/** Discard all buffered characters. On the next scan, YY_INPUT will be called. - * @param b the buffer state to be flushed, usually @c YY_CURRENT_BUFFER. - * - */ - void gse__flush_buffer (YY_BUFFER_STATE b ) -{ - if ( ! b ) - return; - - b->yy_n_chars = 0; - - /* We always need two end-of-buffer characters. The first causes - * a transition to the end-of-buffer state. The second causes - * a jam in that state. - */ - b->yy_ch_buf[0] = YY_END_OF_BUFFER_CHAR; - b->yy_ch_buf[1] = YY_END_OF_BUFFER_CHAR; - - b->yy_buf_pos = &b->yy_ch_buf[0]; - - b->yy_at_bol = 1; - b->yy_buffer_status = YY_BUFFER_NEW; - - if ( b == YY_CURRENT_BUFFER ) - gse__load_buffer_state( ); -} - -/** Pushes the new state onto the stack. The new state becomes - * the current state. This function will allocate the stack - * if necessary. - * @param new_buffer The new state. - * - */ -void gse_push_buffer_state (YY_BUFFER_STATE new_buffer ) -{ - if (new_buffer == NULL) - return; - - gse_ensure_buffer_stack(); - - /* This block is copied from gse__switch_to_buffer. */ - if ( YY_CURRENT_BUFFER ) - { - /* Flush out information for old buffer. */ - *(yy_c_buf_p) = (yy_hold_char); - YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = (yy_c_buf_p); - YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars); - } - - /* Only push if top exists. Otherwise, replace top. */ - if (YY_CURRENT_BUFFER) - (yy_buffer_stack_top)++; - YY_CURRENT_BUFFER_LVALUE = new_buffer; - - /* copied from gse__switch_to_buffer. */ - gse__load_buffer_state( ); - (yy_did_buffer_switch_on_eof) = 1; -} - -/** Removes and deletes the top of the stack, if present. - * The next element becomes the new top. - * - */ -void gse_pop_buffer_state (void) -{ - if (!YY_CURRENT_BUFFER) - return; - - gse__delete_buffer(YY_CURRENT_BUFFER ); - YY_CURRENT_BUFFER_LVALUE = NULL; - if ((yy_buffer_stack_top) > 0) - --(yy_buffer_stack_top); - - if (YY_CURRENT_BUFFER) { - gse__load_buffer_state( ); - (yy_did_buffer_switch_on_eof) = 1; - } -} - -/* Allocates the stack if it does not exist. - * Guarantees space for at least one push. - */ -static void gse_ensure_buffer_stack (void) -{ - int num_to_alloc; - - if (!(yy_buffer_stack)) { - - /* First allocation is just for 2 elements, since we don't know if this - * scanner will even need a stack. We use 2 instead of 1 to avoid an - * immediate realloc on the next call. - */ - num_to_alloc = 1; - (yy_buffer_stack) = (struct yy_buffer_state**)gse_alloc - (num_to_alloc * sizeof(struct yy_buffer_state*) - ); - - memset((yy_buffer_stack), 0, num_to_alloc * sizeof(struct yy_buffer_state*)); - - (yy_buffer_stack_max) = num_to_alloc; - (yy_buffer_stack_top) = 0; - return; - } - - if ((yy_buffer_stack_top) >= ((yy_buffer_stack_max)) - 1){ - - /* Increase the buffer to prepare for a possible push. */ - int grow_size = 8 /* arbitrary grow size */; - - num_to_alloc = (yy_buffer_stack_max) + grow_size; - (yy_buffer_stack) = (struct yy_buffer_state**)gse_realloc - ((yy_buffer_stack), - num_to_alloc * sizeof(struct yy_buffer_state*) - ); - - /* zero only the new slots.*/ - memset((yy_buffer_stack) + (yy_buffer_stack_max), 0, grow_size * sizeof(struct yy_buffer_state*)); - (yy_buffer_stack_max) = num_to_alloc; - } -} - -/** Setup the input buffer state to scan directly from a user-specified character buffer. - * @param base the character buffer - * @param size the size in bytes of the character buffer - * - * @return the newly allocated buffer state object. - */ -YY_BUFFER_STATE gse__scan_buffer (char * base, yy_size_t size ) -{ - YY_BUFFER_STATE b; - - if ( size < 2 || - base[size-2] != YY_END_OF_BUFFER_CHAR || - base[size-1] != YY_END_OF_BUFFER_CHAR ) - /* They forgot to leave room for the EOB's. */ - return 0; - - b = (YY_BUFFER_STATE) gse_alloc(sizeof( struct yy_buffer_state ) ); - if ( ! b ) - YY_FATAL_ERROR( "out of dynamic memory in gse__scan_buffer()" ); - - b->yy_buf_size = size - 2; /* "- 2" to take care of EOB's */ - b->yy_buf_pos = b->yy_ch_buf = base; - b->yy_is_our_buffer = 0; - b->yy_input_file = 0; - b->yy_n_chars = b->yy_buf_size; - b->yy_is_interactive = 0; - b->yy_at_bol = 1; - b->yy_fill_buffer = 0; - b->yy_buffer_status = YY_BUFFER_NEW; - - gse__switch_to_buffer(b ); - - return b; -} - -/** Setup the input buffer state to scan a string. The next call to gse_lex() will - * scan from a @e copy of @a str. - * @param str a NUL-terminated string to scan - * - * @return the newly allocated buffer state object. - * @note If you want to scan bytes that may contain NUL values, then use - * gse__scan_bytes() instead. - */ -YY_BUFFER_STATE gse__scan_string (yyconst char * yystr ) -{ - - return gse__scan_bytes(yystr,strlen(yystr) ); -} - -/** Setup the input buffer state to scan the given bytes. The next call to gse_lex() will - * scan from a @e copy of @a bytes. - * @param bytes the byte buffer to scan - * @param len the number of bytes in the buffer pointed to by @a bytes. - * - * @return the newly allocated buffer state object. - */ -YY_BUFFER_STATE gse__scan_bytes (yyconst char * yybytes, int _yybytes_len ) -{ - YY_BUFFER_STATE b; - char *buf; - yy_size_t n; - int i; - - /* Get memory for full buffer, including space for trailing EOB's. */ - n = _yybytes_len + 2; - buf = (char *) gse_alloc(n ); - if ( ! buf ) - YY_FATAL_ERROR( "out of dynamic memory in gse__scan_bytes()" ); - - for ( i = 0; i < _yybytes_len; ++i ) - buf[i] = yybytes[i]; - - buf[_yybytes_len] = buf[_yybytes_len+1] = YY_END_OF_BUFFER_CHAR; - - b = gse__scan_buffer(buf,n ); - if ( ! b ) - YY_FATAL_ERROR( "bad buffer in gse__scan_bytes()" ); - - /* It's okay to grow etc. this buffer, and we should throw it - * away when we're done. - */ - b->yy_is_our_buffer = 1; - - return b; -} - -#ifndef YY_EXIT_FAILURE -#define YY_EXIT_FAILURE 2 -#endif - -static void yy_fatal_error (yyconst char* msg ) -{ - (void) fprintf( stderr, "%s\n", msg ); - exit( YY_EXIT_FAILURE ); -} - -/* Redefine yyless() so it works in section 3 code. */ - -#undef yyless -#define yyless(n) \ - do \ - { \ - /* Undo effects of setting up gse_text. */ \ - int yyless_macro_arg = (n); \ - YY_LESS_LINENO(yyless_macro_arg);\ - gse_text[gse_leng] = (yy_hold_char); \ - (yy_c_buf_p) = gse_text + yyless_macro_arg; \ - (yy_hold_char) = *(yy_c_buf_p); \ - *(yy_c_buf_p) = '\0'; \ - gse_leng = yyless_macro_arg; \ - } \ - while ( 0 ) - -/* Accessor methods (get/set functions) to struct members. */ - -/** Get the current line number. - * - */ -int gse_get_lineno (void) -{ - - return gse_lineno; -} - -/** Get the input stream. - * - */ -FILE *gse_get_in (void) -{ - return gse_in; -} - -/** Get the output stream. - * - */ -FILE *gse_get_out (void) -{ - return gse_out; -} - -/** Get the length of the current token. - * - */ -int gse_get_leng (void) -{ - return gse_leng; -} - -/** Get the current token. - * - */ - -char *gse_get_text (void) -{ - return gse_text; -} - -/** Set the current line number. - * @param line_number - * - */ -void gse_set_lineno (int line_number ) -{ - - gse_lineno = line_number; -} - -/** Set the input stream. This does not discard the current - * input buffer. - * @param in_str A readable stream. - * - * @see gse__switch_to_buffer - */ -void gse_set_in (FILE * in_str ) -{ - gse_in = in_str ; -} - -void gse_set_out (FILE * out_str ) -{ - gse_out = out_str ; -} - -int gse_get_debug (void) -{ - return gse__flex_debug; -} - -void gse_set_debug (int bdebug ) -{ - gse__flex_debug = bdebug ; -} - -static int yy_init_globals (void) -{ - /* Initialization is the same as for the non-reentrant scanner. - * This function is called from gse_lex_destroy(), so don't allocate here. - */ - - (yy_buffer_stack) = 0; - (yy_buffer_stack_top) = 0; - (yy_buffer_stack_max) = 0; - (yy_c_buf_p) = (char *) 0; - (yy_init) = 0; - (yy_start) = 0; - -/* Defined in main.c */ -#ifdef YY_STDINIT - gse_in = stdin; - gse_out = stdout; -#else - gse_in = (FILE *) 0; - gse_out = (FILE *) 0; -#endif - - /* For future reference: Set errno on error, since we are called by - * gse_lex_init() - */ - return 0; -} - -/* gse_lex_destroy is for both reentrant and non-reentrant scanners. */ -int gse_lex_destroy (void) -{ - - /* Pop the buffer stack, destroying each element. */ - while(YY_CURRENT_BUFFER){ - gse__delete_buffer(YY_CURRENT_BUFFER ); - YY_CURRENT_BUFFER_LVALUE = NULL; - gse_pop_buffer_state(); - } - - /* Destroy the stack itself. */ - gse_free((yy_buffer_stack) ); - (yy_buffer_stack) = NULL; - - /* Reset the globals. This is important in a non-reentrant scanner so the next time - * gse_lex() is called, initialization will occur. */ - yy_init_globals( ); - - return 0; -} - -/* - * Internal utility routines. - */ - -#ifndef yytext_ptr -static void yy_flex_strncpy (char* s1, yyconst char * s2, int n ) -{ - register int i; - for ( i = 0; i < n; ++i ) - s1[i] = s2[i]; -} -#endif - -#ifdef YY_NEED_STRLEN -static int yy_flex_strlen (yyconst char * s ) -{ - register int n; - for ( n = 0; s[n]; ++n ) - ; - - return n; -} -#endif - -void *gse_alloc (yy_size_t size ) -{ - return (void *) malloc( size ); -} - -void *gse_realloc (void * ptr, yy_size_t size ) -{ - /* The cast to (char *) in the following accommodates both - * implementations that use char* generic pointers, and those - * that use void* generic pointers. It works with the latter - * because both ANSI C and C++ allow castless assignment from - * any pointer type to void*, and deal with argument conversions - * as though doing an assignment. - */ - return (void *) realloc( (char *) ptr, size ); -} - -void gse_free (void * ptr ) -{ - free( (char *) ptr ); /* see gse_realloc() for (char *) cast */ -} - -#define YYTABLES_NAME "yytables" - -#line 121 "gse.lex" - - - -// Three glue routines for string scanning. These are not declared in the -// header gse.tab.h nor is YY_BUFFER_STATE. Including these here allows them -// to see the type definitions in lex.gse.c (where YY_BUFFER_STATE is -// defined) and allows callers to declare them (since callers outside of this -// file cannot declare YY_BUFFER_STATE variable). - -void * -gse_string(const char *str) -{ - return (void *)gse__scan_string(str); -} - -void -gse_switch_to_buffer(void *buf) -{ - gse__switch_to_buffer((YY_BUFFER_STATE)buf); -} - -void -gse_delete_buffer(void *buf) -{ - gse__delete_buffer((YY_BUFFER_STATE)buf); -} - -// Note that the grid() CE function only deals with numeric maps (8/28/2001 -// jhrg) and that all comparisons are done using doubles. - -static void -store_int32() -{ - gse_lval.val = atof(gse_text); -} - -static void -store_float64() -{ - gse_lval.val = atof(gse_text); -} - -static void -store_id() -{ - strncpy(gse_lval.id, gse_text, ID_MAX-1); - gse_lval.id[ID_MAX-1] = '\0'; -} - -static void -store_op(int op) -{ - gse_lval.op = op; -} - - diff -Nru libdap-3.11.1/libdap.spec libdap-3.12.0/libdap.spec --- libdap-3.11.1/libdap.spec 2011-04-29 13:19:43.000000000 +0000 +++ libdap-3.12.0/libdap.spec 2013-10-17 21:27:40.000000000 +0000 @@ -1,6 +1,6 @@ Name: libdap Summary: The C++ DAP2 library from OPeNDAP -Version: 3.11.1 +Version: 3.12.0 Release: 1 License: LGPLv2+ @@ -83,13 +83,16 @@ %defattr(-,root,root,-) %{_bindir}/getdap %{_libdir}/libdap.so.* +%{_libdir}/libtest-types.a %{_libdir}/libdapclient.so.* %{_libdir}/libdapserver.so.* %doc README NEWS COPYING COPYRIGHT_URI README.dodsrc +%{_mandir}/man1/* %files devel %defattr(-,root,root,-) %{_libdir}/libdap.so +%{_libdir}/libtest-types.a %{_libdir}/libdapclient.so %{_libdir}/libdapserver.so %{_libdir}/pkgconfig/libdap*.pc diff -Nru libdap-3.11.1/main_page.doxygen.in libdap-3.12.0/main_page.doxygen.in --- libdap-3.11.1/main_page.doxygen.in 1970-01-01 00:00:00.000000000 +0000 +++ libdap-3.12.0/main_page.doxygen.in 2013-10-17 21:27:40.000000000 +0000 @@ -0,0 +1,80 @@ +// -*- C++ -*- + +// $Id: main_page.doxygen 21281 2009-08-18 06:38:17Z tomss $ + +// Documentation for the main page of the doxygen-generated reference manual + +/** \mainpage + +\section intro Introduction + +This reference documentation corresponds to version @PACKAGE_VERSION@ of libdap, a C++ +implementation of DAP2, with some extensions. The libdap library +includes classes and functions which implement DAP 2.0 as well as utilities +which simpify building clients and servers for DAP 2.0. The library also +contains a few new features which will eventually become part of DAP 4.0. + +\section conventions Doxygen Conventions + +This section lists some conventions used by the Doxygen comments +which are used to generate this Reference Guide. Follow these conventions +when adding to or modifying the reference documentation. + +\subsection general General + +
      +
    • When using the name of a parameter, use italics (the \c e +command or \c em tag).
    • +
    • Use the \c c command or \c code tag when talking about literal text.
    • +
    • When talking about functions or methods, using func() +or func(arg0, ..., agrN) will get Doxygen to insert a link to +its documentation.
    • +
    • Typos: If you're using emacs, the command \c ispell-comments-and-strings +may help in removing typos in the comments (and strings ...)
    • +
    + +\subsection classes Classes + +Classes should be documented in the header (\c .h) file where they are +defined. + +Commands that should be used for the documentation of classes: + +
    +
    author
    Use this to attribute authorship. Include this for +all the classes except internal ones which are not visible to users of the +library.
    +
    + +\subsection methods Methods and Functions + +Methods should be documented in the implementation (\c .cc) files where +they are defined. You can put the \c brief documentation in the header file, +but that may be more confusing than keeping all the method documentation in +one place. + +Functions should be documented in their implementation files. + +Commands that should be used for the documentation of public methods and +non-static functions: + +
    +
    param
    Include for all parameters. Doxygen complains if an +overloaded method changes a parameter name, so scan the warnings and try to +keep the names in sync..
    + +
    return
    Include for all methods that return something unless the +method is so simple its full description starts off with "Returns..."
    + +
    brief
    Include for all methods. In doxy.conf I have turned off +the option that generates the \c brief entry from the first sentence of the +detailed doc and the option that includes the \c brief documentation in the +detailed documentation. So, the \c brief doc will appear only with the +summary information and not with the detailed documentation for the +method.
    + +
    exception
    Document the exceptions using the \c exception +command.
    + +
    +*/ diff -Nru libdap-3.11.1/mime_util.cc libdap-3.12.0/mime_util.cc --- libdap-3.11.1/mime_util.cc 2011-04-29 13:19:43.000000000 +0000 +++ libdap-3.12.0/mime_util.cc 2013-10-17 21:27:40.000000000 +0000 @@ -20,7 +20,7 @@ // // You should have received a copy of the GNU Lesser General Public // License along with this library; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA // // You can contact OPeNDAP, Inc. at PO Box 112, Saunderstown, RI. 02874-0112. @@ -36,11 +36,6 @@ // ReZa 9/30/94 #include "config.h" -#undef FILE_METHODS - -static char rcsid[] not_used = - {"$Id: mime_util.cc 24370 2011-03-28 16:21:32Z jimg $" - }; #include #include @@ -159,6 +154,9 @@ rfc822_date(const time_t t) { struct tm *stm = gmtime(&t); + if (!stm) + return ""; + char d[256]; snprintf(d, 255, "%s, %02d %s %4d %02d:%02d:%02d GMT", days[stm->tm_wday], @@ -170,7 +168,7 @@ } static const int TimLen = 26; // length of string from asctime() -static const int CLUMP_SIZE = 1024; // size of clumps to new in fmakeword() +//static const int CLUMP_SIZE = 1024; // size of clumps to new in fmakeword() /** This sends a formatted block of text to the client, containing version information about various aspects of the server. The @@ -227,8 +225,17 @@ if (time(&TimBin) == (time_t) - 1) strncpy(TimStr, "time() error ", TimLen-1); else { - strncpy(TimStr, ctime(&TimBin), TimLen-1); - TimStr[TimLen - 2] = '\0'; // overwrite the \n + char *ctime_value = ctime(&TimBin); + if (!ctime_value) + strncpy(TimStr, "Unknown", TimLen-1); + else { + strncpy(TimStr, ctime_value, TimLen-1); + TimStr[TimLen - 2] = '\0'; // overwrite the \n + } +#if 0 + strncpy(TimStr, ctime(&TimBin), TimLen-1); + TimStr[TimLen - 2] = '\0'; // overwrite the \n +#endif } cerr << "[" << TimStr << "] DAP server error: " << Msgt << endl; @@ -358,7 +365,6 @@ return unknown_type; } -#if FILE_METHODS /** Generate an HTTP 1.0 response header for a text document. This is used when returning a serialized DAS or DDS object. @@ -376,43 +382,10 @@ set_mime_text(FILE *out, ObjectType type, const string &ver, EncodingType enc, const time_t last_modified) { - fprintf(out, "HTTP/1.0 200 OK%s", CRLF) ; - if (ver == "") { - fprintf(out, "XDODS-Server: %s%s", DVR, CRLF) ; - fprintf(out, "XOPeNDAP-Server: %s%s", DVR, CRLF) ; - } - else { - fprintf(out, "XDODS-Server: %s%s", ver.c_str(), CRLF) ; - fprintf(out, "XOPeNDAP-Server: %s%s", ver.c_str(), CRLF) ; - } - fprintf(out, "XDAP: %s%s", DAP_PROTOCOL_VERSION, CRLF) ; - - const time_t t = time(0); - fprintf(out, "Date: %s%s", rfc822_date(t).c_str(), CRLF) ; - - fprintf(out, "Last-Modified: ") ; - if (last_modified > 0) - fprintf(out, "%s%s", rfc822_date(last_modified).c_str(), CRLF) ; - else - fprintf(out, "%s%s", rfc822_date(t).c_str(), CRLF) ; - - if (type == dap4_ddx) - fprintf(out, "Content-Type: text/xml%s", CRLF) ; - else - fprintf(out, "Content-Type: text/plain%s", CRLF) ; - - // Note that Content-Description is from RFC 2045 (MIME, pt 1), not 2616. - // jhrg 12/23/05 - fprintf(out, "Content-Description: %s%s", descrip[type], CRLF) ; - if (type == dods_error) // don't cache our error responses. - fprintf(out, "Cache-Control: no-cache%s", CRLF) ; - // Don't write a Content-Encoding header for x-plain since that breaks - // Netscape on NT. jhrg 3/23/97 - if (enc != x_plain) - fprintf(out, "Content-Encoding: %s%s", encoding[enc], CRLF) ; - fprintf(out, CRLF) ; + ostringstream oss; + set_mime_text(oss, type, ver, enc, last_modified); + fwrite(oss.str().data(), 1, oss.str().length(), out); } -#endif /** Generate an HTTP 1.0 response header for a text document. This is used when returning a serialized DAS or DDS object. @@ -468,7 +441,60 @@ strm << CRLF ; } -#if FILE_METHODS +/** Generate an HTTP 1.0 response header for a text document. This is used + when returning a serialized DAS or DDS object. + + @note In Hyrax these headers are not used. Instead the front end of the + server will build the response headers + + @param strm Write the MIME header to this stream. + @param type The type of this this response. Defaults to + application/octet-stream. + @param ver The version string; denotes the libdap implementation + version. + @param enc How is this response encoded? Can be plain or deflate or the + x_... versions of those. Default is x_plain. + @param last_modified The time to use for the Last-Modified header value. + Default is zero which means use the current time. */ +void set_mime_text(ostream &strm, ObjectType type, EncodingType enc, const time_t last_modified, + const string &protocol) +{ + strm << "HTTP/1.0 200 OK" << CRLF; + + strm << "XDODS-Server: " << DVR<< CRLF; + strm << "XOPeNDAP-Server: " << DVR<< CRLF; + + if (protocol == "") + strm << "XDAP: " << DAP_PROTOCOL_VERSION << CRLF; + else + strm << "XDAP: " << protocol << CRLF; + + const time_t t = time(0); + strm << "Date: " << rfc822_date(t).c_str() << CRLF; + + strm << "Last-Modified: "; + if (last_modified > 0) + strm << rfc822_date(last_modified).c_str() << CRLF; + else + strm << rfc822_date(t).c_str() << CRLF; + + if (type == dap4_ddx) + strm << "Content-Type: text/xml" << CRLF; + else + strm << "Content-Type: text/plain" << CRLF; + + // Note that Content-Description is from RFC 2045 (MIME, pt 1), not 2616. + // jhrg 12/23/05 + strm << "Content-Description: " << descrip[type] << CRLF; + if (type == dods_error) // don't cache our error responses. + strm << "Cache-Control: no-cache" << CRLF; + // Don't write a Content-Encoding header for x-plain since that breaks + // Netscape on NT. jhrg 3/23/97 + if (enc != x_plain) + strm << "Content-Encoding: " << encoding[enc] << CRLF; + strm << CRLF; +} + /** Generate an HTTP 1.0 response header for a html document. @deprecated @@ -484,38 +510,10 @@ set_mime_html(FILE *out, ObjectType type, const string &ver, EncodingType enc, const time_t last_modified) { - fprintf(out, "HTTP/1.0 200 OK%s", CRLF) ; - if (ver == "") { - fprintf(out, "XDODS-Server: %s%s", DVR, CRLF) ; - fprintf(out, "XOPeNDAP-Server: %s%s", DVR, CRLF) ; - } - else { - fprintf(out, "XDODS-Server: %s%s", ver.c_str(), CRLF) ; - fprintf(out, "XOPeNDAP-Server: %s%s", ver.c_str(), CRLF) ; - } - fprintf(out, "XDAP: %s%s", DAP_PROTOCOL_VERSION, CRLF) ; - - const time_t t = time(0); - fprintf(out, "Date: %s%s", rfc822_date(t).c_str(), CRLF) ; - - fprintf(out, "Last-Modified: ") ; - if (last_modified > 0) - fprintf(out, "%s%s", rfc822_date(last_modified).c_str(), CRLF) ; - else - fprintf(out, "%s%s", rfc822_date(t).c_str(), CRLF) ; - - fprintf(out, "Content-type: text/html%s", CRLF) ; - // See note above about Content-Description header. jhrg 12/23/05 - fprintf(out, "Content-Description: %s%s", descrip[type], CRLF) ; - if (type == dods_error) // don't cache our error responses. - fprintf(out, "Cache-Control: no-cache%s", CRLF) ; - // Don't write a Content-Encoding header for x-plain since that breaks - // Netscape on NT. jhrg 3/23/97 - if (enc != x_plain) - fprintf(out, "Content-Encoding: %s%s", encoding[enc], CRLF) ; - fprintf(out, CRLF) ; + ostringstream oss; + set_mime_html(oss, type, ver, enc, last_modified); + fwrite(oss.str().data(), 1, oss.str().length(), out); } -#endif /** Generate an HTTP 1.0 response header for a html document. @@ -564,7 +562,50 @@ strm << CRLF ; } -#if FILE_METHODS +/** Generate an HTTP 1.0 response header for a html document. + + @param strm Write the MIME header to this stream. + @param type The type of this this response. + @param ver The version string; denotes the libdap implementation + version. + @param enc How is this response encoded? Can be plain or deflate or the + x_... versions of those. Default is x_plain. + @param last_modified The time to use for the Last-Modified header value. + Default is zero which means use the current time. */ +void set_mime_html(ostream &strm, ObjectType type, EncodingType enc, const time_t last_modified, + const string &protocol) +{ + strm << "HTTP/1.0 200 OK" << CRLF; + + strm << "XDODS-Server: " << DVR<< CRLF; + strm << "XOPeNDAP-Server: " << DVR<< CRLF; + + if (protocol == "") + strm << "XDAP: " << DAP_PROTOCOL_VERSION << CRLF; + else + strm << "XDAP: " << protocol << CRLF; + + const time_t t = time(0); + strm << "Date: " << rfc822_date(t).c_str() << CRLF; + + strm << "Last-Modified: "; + if (last_modified > 0) + strm << rfc822_date(last_modified).c_str() << CRLF; + else + strm << rfc822_date(t).c_str() << CRLF; + + strm << "Content-type: text/html" << CRLF; + // See note above about Content-Description header. jhrg 12/23/05 + strm << "Content-Description: " << descrip[type] << CRLF; + if (type == dods_error) // don't cache our error responses. + strm << "Cache-Control: no-cache" << CRLF; + // Don't write a Content-Encoding header for x-plain since that breaks + // Netscape on NT. jhrg 3/23/97 + if (enc != x_plain) + strm << "Content-Encoding: " << encoding[enc] << CRLF; + strm << CRLF; +} + /** Write an HTTP 1.0 response header for our binary response document (i.e., the DataDDS object). @@ -583,34 +624,10 @@ set_mime_binary(FILE *out, ObjectType type, const string &ver, EncodingType enc, const time_t last_modified) { - fprintf(out, "HTTP/1.0 200 OK%s", CRLF) ; - if (ver == "") { - fprintf(out, "XDODS-Server: %s%s", DVR, CRLF) ; - fprintf(out, "XOPeNDAP-Server: %s%s", DVR, CRLF) ; - } - else { - fprintf(out, "XDODS-Server: %s%s", ver.c_str(), CRLF) ; - fprintf(out, "XOPeNDAP-Server: %s%s", ver.c_str(), CRLF) ; - } - fprintf(out, "XDAP: %s%s", DAP_PROTOCOL_VERSION, CRLF) ; - - const time_t t = time(0); - fprintf(out, "Date: %s%s", rfc822_date(t).c_str(), CRLF) ; - - fprintf(out, "Last-Modified: ") ; - if (last_modified > 0) - fprintf(out, "%s%s", rfc822_date(last_modified).c_str(), CRLF) ; - else - fprintf(out, "%s%s", rfc822_date(t).c_str(), CRLF) ; - - fprintf(out, "Content-Type: application/octet-stream%s", CRLF) ; - fprintf(out, "Content-Description: %s%s", descrip[type], CRLF) ; - if (enc != x_plain) - fprintf(out, "Content-Encoding: %s%s", encoding[enc], CRLF) ; - - fprintf(out, CRLF) ; + ostringstream oss; + set_mime_binary(oss, type, ver, enc, last_modified); + fwrite(oss.str().data(), 1, oss.str().length(), out); } -#endif /** Write an HTTP 1.0 response header for our binary response document (i.e., the DataDDS object). @@ -658,6 +675,49 @@ strm << CRLF ; } +/** Write an HTTP 1.0 response header for our binary response document (i.e., + the DataDDS object). + + @param strm Write the MIME header to this stream. + @param type The type of this this response. Defaults to + application/octet-stream. + @param ver The version string; denotes the libdap implementation + version. + @param enc How is this response encoded? Can be plain or deflate or the + x_... versions of those. Default is x_plain. + @param last_modified The time to use for the Last-Modified header value. + Default is zero which means use the current time. + */ +void set_mime_binary(ostream &strm, ObjectType type, EncodingType enc, const time_t last_modified, + const string &protocol) +{ + strm << "HTTP/1.0 200 OK" << CRLF; + + strm << "XDODS-Server: " << DVR << CRLF; + strm << "XOPeNDAP-Server: " << DVR << CRLF; + + if (protocol == "") + strm << "XDAP: " << DAP_PROTOCOL_VERSION << CRLF; + else + strm << "XDAP: " << protocol << CRLF; + + const time_t t = time(0); + strm << "Date: " << rfc822_date(t).c_str() << CRLF; + + strm << "Last-Modified: "; + if (last_modified > 0) + strm << rfc822_date(last_modified).c_str() << CRLF; + else + strm << rfc822_date(t).c_str() << CRLF; + + strm << "Content-Type: application/octet-stream" << CRLF; + strm << "Content-Description: " << descrip[type] << CRLF; + if (enc != x_plain) + strm << "Content-Encoding: " << encoding[enc] << CRLF; + + strm << CRLF; +} + void set_mime_multipart(ostream &strm, const string &boundary, const string &start, ObjectType type, const string &version, EncodingType enc, @@ -692,6 +752,46 @@ strm << CRLF ; } +/** Build the initial headers for the DAP4 data response */ + +void set_mime_multipart(ostream &strm, const string &boundary, const string &start, ObjectType type, EncodingType enc, + const time_t last_modified, const string &protocol, const string &url) +{ + strm << "HTTP/1.1 200 OK" << CRLF; + + const time_t t = time(0); + strm << "Date: " << rfc822_date(t).c_str() << CRLF; + + strm << "Last-Modified: "; + if (last_modified > 0) + strm << rfc822_date(last_modified).c_str() << CRLF; + else + strm << rfc822_date(t).c_str() << CRLF; + + strm << "Content-Type: multipart/related; boundary=" << boundary << "; start=\"<" << start + << ">\"; type=\"text/xml\"" << CRLF; + + // data-ddx;"; removed as a result of the merge of the hyrax 1.8 release + // branch. + strm << "Content-Description: " << descrip[type] << ";"; + if (!url.empty()) + strm << " url=\"" << url << "\"" << CRLF; + else + strm << CRLF; + + if (enc != x_plain) + strm << "Content-Encoding: " << encoding[enc] << CRLF; + + if (protocol == "") + strm << "X-DAP: " << DAP_PROTOCOL_VERSION << CRLF; + else + strm << "X-DAP: " << protocol << CRLF; + + strm << "X-OPeNDAP-Server: " << DVR<< CRLF; + + strm << CRLF; +} + void set_mime_ddx_boundary(ostream &strm, const string &boundary, const string &cid, ObjectType type, EncodingType enc) { @@ -723,7 +823,7 @@ /** Read the next MIME header from the input stream and return it in a string object. This function consumes any leading whitespace before the next header. It returns an empty string when the blank line that separates - the headers from the body is found. this function works for header and + the headers from the body is found. This function works for header and separator lines that use either a CRLF pair (the correct line ending) or just a newline (a common error). @@ -755,6 +855,40 @@ throw Error("I expected to find a MIME header, but got EOF instead."); } +string get_next_mime_header(istream &in) +{ +#if 0 + // Get the header line and strip \r\n. Some headers end with just \n. + // If a blank line is found, return an empty string. + char line[line_length]; + while (!in.eof()) { + in.getline(line, line_length); + if (strncmp(line, CRLF, 2) == 0 || line[0] == '\n') { + return ""; + } + else { + size_t slen = min(strlen(line), line_length); // Never > line_length + line[slen - 1] = '\0'; // remove the newline + if (line[slen - 2] == '\r') // ...and the preceding carriage return + line[slen - 2] = '\0'; + return string(line); + } + } +#endif + // Get the header line and strip \r\n. Some headers end with just \n. + // If a blank line is found, return an empty string. + char raw_line[line_length]; + while (!in.eof()) { + in.getline(raw_line, line_length); // strips the trailing newline; terminates with null + string line = raw_line; + if (line.find('\r') != string::npos) + line = line.substr(0, line.size()-1); + return line; + } + + throw Error("I expected to find a MIME header, but got EOF instead."); +} + /** Given a string that contains a MIME header line, parse it into the the header (name) and its value. Both are downcased. @@ -821,13 +955,27 @@ return boundary_line; } +string read_multipart_boundary(istream &in, const string &boundary) +{ + string boundary_line = get_next_mime_header(in); + // If the caller passed in a value for the boundary, test for that value, + // else just see that this line starts with '--'. + // The value of 'boundary_line' is returned by this function. + if ((!boundary.empty() && is_boundary(boundary_line.c_str(), boundary)) + || boundary_line.find("--") != 0) + throw Error( + "The DAP4 data response document is broken - missing or malformed boundary."); + + return boundary_line; +} + /** Consume the Multipart MIME headers that prefix the DDX in a DataDDX response. The stream pointer is advanced to the start of the DDX. It might seem odd that this function both takes the value of the MPM boundary as a parameter _and_ returns that value as a result, but this code can be used in two different situations. In one case, it is called on a partial document read from stdin and needs to return the value of boundary to the - downstream DDX parser to that code can sense the end of hte DDX. In the + downstream DDX parser so that code can sense the end of the DDX. In the other case, this function is told the value of boundary and tests for it to ensure document correctness. @@ -841,39 +989,70 @@ header values don't match. The optional values are tested only if they are given (the default values are not tested). */ -void read_multipart_headers(FILE *in, const string &content_type, - const ObjectType object_type, const string &cid) +void read_multipart_headers(FILE *in, const string &content_type, const ObjectType object_type, const string &cid) { - bool ct = false, cd = false, ci = false; + bool ct = false, cd = false, ci = false; - string header = get_next_mime_header(in); - while (!header.empty()) { - string name, value; - parse_mime_header(header, name, value); - - if (name =="content-type") { - ct = true; - if (value.find(content_type) == string::npos) - throw Error("Content-Type for this part of a DAP4 data response must be " + content_type + "."); - } - else if (name == "content-description") { - cd = true; - if (get_description_type(value) != object_type) - throw Error("Content-Description for this part of a DAP4 data response must be dap4-ddx or dap4-data-ddx"); - } - else if (name == "content-id") { - ci = true; - if (!cid.empty() && value != cid) - throw Error("Content-Id mismatch. Expected: " + cid - + ", but got: " + value); + string header = get_next_mime_header(in); + while (!header.empty()) { + string name, value; + parse_mime_header(header, name, value); + + if (name == "content-type") { + ct = true; + if (value.find(content_type) == string::npos) + throw Error("Content-Type for this part of a DAP4 data response must be " + content_type + "."); + } + else if (name == "content-description") { + cd = true; + if (get_description_type(value) != object_type) + throw Error( + "Content-Description for this part of a DAP4 data response must be dap4-ddx or dap4-data-ddx"); + } + else if (name == "content-id") { + ci = true; + if (!cid.empty() && value != cid) + throw Error("Content-Id mismatch. Expected: " + cid + ", but got: " + value); + } + + header = get_next_mime_header(in); } - header = get_next_mime_header(in); - } + if (!(ct && cd && ci)) throw Error("The DAP4 data response document is broken - missing header."); +} + +void read_multipart_headers(istream &in, const string &content_type, const ObjectType object_type, const string &cid) +{ + bool ct = false, cd = false, ci = false; - if (!(ct && cd && ci)) - throw Error("The DAP4 data response document is broken - missing header."); + string header = get_next_mime_header(in); + while (!header.empty()) { + string name, value; + parse_mime_header(header, name, value); + + if (name == "content-type") { + ct = true; + if (value.find(content_type) == string::npos) + throw Error("Content-Type for this part of a DAP4 data response must be " + content_type + "."); + } + else if (name == "content-description") { + cd = true; + if (get_description_type(value) != object_type) + throw Error( + "Content-Description for this part of a DAP4 data response must be dap4-ddx or dap4-data-ddx"); + } + else if (name == "content-id") { + ci = true; + if (!cid.empty() && value != cid) + throw Error("Content-Id mismatch. Expected: " + cid + ", but got: " + value); + } + + header = get_next_mime_header(in); + } + + if (!(ct && cd && ci)) throw Error("The DAP4 data response document is broken - missing header."); } + /** Given a Content-Id read from the DDX, return the value to look for in a MPM Content-Id header. This function downcases the CID to match the value returned by parse_mime_header. @@ -886,7 +1065,7 @@ { string::size_type offset = cid.find("cid:"); if (offset != 0) - throw Error("expected CID to start with 'cid:'"); + throw Error("expected CID to start with 'cid:'"); string value = "<"; value.append(cid.substr(offset + 4)); @@ -896,7 +1075,6 @@ return value; } -#if FILE_METHODS /** Generate an HTTP 1.0 response header for an Error object. @deprecated @@ -909,23 +1087,10 @@ set_mime_error(FILE *out, int code, const string &reason, const string &version) { - fprintf(out, "HTTP/1.0 %d %s%s", code, reason.c_str(), CRLF) ; - if (version == "") { - fprintf(out, "XDODS-Server: %s%s", DVR, CRLF) ; - fprintf(out, "XOPeNDAP-Server: %s%s", DVR, CRLF) ; - } - else { - fprintf(out, "XDODS-Server: %s%s", version.c_str(), CRLF) ; - fprintf(out, "XOPeNDAP-Server: %s%s", version.c_str(), CRLF) ; - } - fprintf(out, "XDAP: %s%s", DAP_PROTOCOL_VERSION, CRLF) ; - - const time_t t = time(0); - fprintf(out, "Date: %s%s", rfc822_date(t).c_str(), CRLF) ; - fprintf(out, "Cache-Control: no-cache%s", CRLF) ; - fprintf(out, CRLF) ; + ostringstream oss; + set_mime_error(oss, code, reason, version); + fwrite(oss.str().data(), 1, oss.str().length(), out); } -#endif /** Generate an HTTP 1.0 response header for an Error object. @@ -956,7 +1121,6 @@ strm << CRLF ; } -#if FILE_METHODS /** Use this function to create a response signaling that the target of a conditional get has not been modified relative to the condition given in the request. This will have to be a date until the servers support ETags. @@ -967,12 +1131,10 @@ void set_mime_not_modified(FILE *out) { - fprintf(out, "HTTP/1.0 304 NOT MODIFIED%s", CRLF) ; - const time_t t = time(0); - fprintf(out, "Date: %s%s", rfc822_date(t).c_str(), CRLF) ; - fprintf(out, CRLF) ; + ostringstream oss; + set_mime_not_modified(oss); + fwrite(oss.str().data(), 1, oss.str().length(), out); } -#endif /** Use this function to create a response signaling that the target of a conditional get has not been modified relative to the condition given in @@ -990,6 +1152,10 @@ strm << CRLF ; } +#if 0 + +// This was removed because it's not being used by our server. + /** Look for the override file by taking the dataset name and appending `.ovr' to it. If such a file exists, then read it in and store the contents in doc. Note that the file contents @@ -1010,13 +1176,15 @@ doc = ""; while (!ifs.eof()) { ifs.getline(tmp, 255); - strcat(tmp, "\n"); + tmp[255] = '\0'; + strncat(tmp, "\n", sizeof(tmp) - strlen(tmp) - 1); doc += tmp; } ifs.close(); return true; } +#endif /** Read the input stream in and discard the MIME header. The MIME header is separated from the body of the document by a single blank line. diff -Nru libdap-3.11.1/mime_util.h libdap-3.12.0/mime_util.h --- libdap-3.11.1/mime_util.h 2011-04-29 13:19:43.000000000 +0000 +++ libdap-3.12.0/mime_util.h 2013-10-17 21:27:40.000000000 +0000 @@ -19,7 +19,7 @@ // // You should have received a copy of the GNU Lesser General Public // License along with this library; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA // // You can contact OPeNDAP, Inc. at PO Box 112, Saunderstown, RI. 02874-0112. @@ -73,17 +73,29 @@ ObjectType get_description_type(const string &value); bool is_boundary(const char *line, const string &boundary); string cid_to_header_value(const string &cid); -string read_multipart_boundary(FILE *in, const string &boundary = ""); + +string read_multipart_boundary(istream &in, const string &boundary = ""); + void parse_mime_header(const string &header, string &name, string &value); string name_path(const string &path); +string get_next_mime_header(istream &in); + +void read_multipart_headers(istream &in, const string &content_type, + const ObjectType object_type, const string &cid = ""); // All of these are deprecated +string read_multipart_boundary(FILE *in, const string &boundary = ""); +void read_multipart_headers(FILE *in, const string &content_type, + const ObjectType object_type, const string &cid = ""); bool do_version(const string &script_ver, const string &dataset_ver); void ErrMsgT(const string &Msgt); -ObjectType get_type(const string &value); // deprecated +ObjectType get_type(const string &value); bool remove_mime_header(FILE *in); string get_next_mime_header(FILE *in); + +#if 0 bool found_override(string name, string &doc); +#endif //@} /** These functions are used to create the MIME headers for a message @@ -104,6 +116,10 @@ void set_mime_text(ostream &out, ObjectType type = unknown_type, const string &version = "", EncodingType enc = x_plain, const time_t last_modified = 0); +void set_mime_text(std::ostream &out, ObjectType type = unknown_type, + EncodingType enc = x_plain, + const time_t last_modified = 0, + const std::string &protocol = ""); void set_mime_html(FILE *out, ObjectType type = unknown_type, const string &version = "", EncodingType enc = x_plain, @@ -111,6 +127,10 @@ void set_mime_html(ostream &out, ObjectType type = unknown_type, const string &version = "", EncodingType enc = x_plain, const time_t last_modified = 0); +void set_mime_html(std::ostream &out, ObjectType type = unknown_type, + EncodingType enc = x_plain, + const time_t last_modified = 0, + const std::string &protocol = ""); void set_mime_binary(FILE *out, ObjectType type = unknown_type, const string &version = "", EncodingType enc = x_plain, @@ -118,12 +138,21 @@ void set_mime_binary(ostream &out, ObjectType type = unknown_type, const string &version = "", EncodingType enc = x_plain, const time_t last_modified = 0); +void set_mime_binary(std::ostream &out, ObjectType type = unknown_type, + EncodingType enc = x_plain, + const time_t last_modified = 0, + const std::string &protocol = ""); void set_mime_multipart(ostream &out, const string &boundary, const string &start, ObjectType type = unknown_type, const string &version = "", EncodingType enc = x_plain, const time_t last_modified = 0); +void set_mime_multipart(std::ostream &out, const std::string &boundary, + const std::string &start, ObjectType type = unknown_type, EncodingType enc = x_plain, + const time_t last_modified = 0, const std::string &protocol = "", + const std::string &url = ""); + void set_mime_ddx_boundary(ostream &out, const string &boundary, const string &start, ObjectType type = unknown_type, EncodingType enc = x_plain); @@ -132,9 +161,6 @@ const string &cid, ObjectType type = unknown_type, EncodingType enc = x_plain); -void read_multipart_headers(FILE *in, const string &content_type, - const ObjectType object_type, const string &cid = ""); - void set_mime_error(FILE *out, int code = 404, const string &reason = "Dataset not found", const string &version = ""); diff -Nru libdap-3.11.1/parser-util.cc libdap-3.12.0/parser-util.cc --- libdap-3.11.1/parser-util.cc 2011-04-29 13:19:43.000000000 +0000 +++ libdap-3.12.0/parser-util.cc 2013-10-17 21:27:40.000000000 +0000 @@ -19,7 +19,7 @@ // // You should have received a copy of the GNU Lesser General Public // License along with this library; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA // // You can contact OPeNDAP, Inc. at PO Box 112, Saunderstown, RI. 02874-0112. @@ -35,10 +35,6 @@ #include "config.h" -static char rcsid[] not_used = - { "$Id: parser-util.cc 22703 2010-05-11 18:10:01Z jimg $" - }; - #include #include #include diff -Nru libdap-3.11.1/parser.h libdap-3.12.0/parser.h --- libdap-3.11.1/parser.h 2011-04-29 13:19:43.000000000 +0000 +++ libdap-3.12.0/parser.h 2013-10-17 21:27:40.000000000 +0000 @@ -19,7 +19,7 @@ // // You should have received a copy of the GNU Lesser General Public // License along with this library; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA // // You can contact OPeNDAP, Inc. at PO Box 112, Saunderstown, RI. 02874-0112. diff -Nru libdap-3.11.1/tests/DASTest libdap-3.12.0/tests/DASTest --- libdap-3.11.1/tests/DASTest 2011-05-06 15:28:46.000000000 +0000 +++ libdap-3.12.0/tests/DASTest 2013-10-17 21:27:40.000000000 +0000 @@ -1,7 +1,7 @@ #! /bin/sh -# Generated from DASTest.at by GNU Autoconf 2.65. +# Generated from DASTest.at by GNU Autoconf 2.69. # -# Copyright (C) 2009 Free Software Foundation, Inc. +# Copyright (C) 2009-2012 Free Software Foundation, Inc. # # This test suite is free software; the Free Software Foundation gives # unlimited permission to copy, distribute and modify it. @@ -84,6 +84,7 @@ IFS=" "" $as_nl" # Find who we are. Look in the path if we contain no directory separator. +as_myself= case $0 in #(( *[\\/]* ) as_myself=$0 ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR @@ -161,7 +162,8 @@ else exitcode=1; echo positional parameters were not saved. fi -test x\$exitcode = x0 || exit 1" +test x\$exitcode = x0 || exit 1 +test -x / || exit 1" as_suggested=" as_lineno_1=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_1a=\$LINENO as_lineno_2=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_2a=\$LINENO eval 'test \"x\$as_lineno_1'\$as_run'\" != \"x\$as_lineno_2'\$as_run'\" && @@ -206,14 +208,25 @@ if test "x$CONFIG_SHELL" != x; then : - # We cannot yet assume a decent shell, so we have to provide a - # neutralization value for shells without unset; and this also - # works around shells that cannot unset nonexistent variables. - BASH_ENV=/dev/null - ENV=/dev/null - (unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV - export CONFIG_SHELL - exec "$CONFIG_SHELL" "$as_myself" ${1+"$@"} + export CONFIG_SHELL + # We cannot yet assume a decent shell, so we have to provide a +# neutralization value for shells without unset; and this also +# works around shells that cannot unset nonexistent variables. +# Preserve -v and -x to the replacement shell. +BASH_ENV=/dev/null +ENV=/dev/null +(unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV +case $- in # (((( + *v*x* | *x*v* ) as_opts=-vx ;; + *v* ) as_opts=-v ;; + *x* ) as_opts=-x ;; + * ) as_opts= ;; +esac +exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"} +# Admittedly, this is quite paranoid, since all the known shells bail +# out after a failed `exec'. +$as_echo "$0: could not re-execute with $CONFIG_SHELL" >&2 +exit 255 fi if test x$as_have_required = xno; then : @@ -311,10 +324,18 @@ test -d "$as_dir" && break done test -z "$as_dirs" || eval "mkdir $as_dirs" - } || test -d "$as_dir" || as_fn_error "cannot create directory $as_dir" + } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir" } # as_fn_mkdir_p + +# as_fn_executable_p FILE +# ----------------------- +# Test if FILE is an executable regular file. +as_fn_executable_p () +{ + test -f "$1" && test -x "$1" +} # as_fn_executable_p # as_fn_append VAR VALUE # ---------------------- # Append the text in VALUE to the end of the definition contained in VAR. Take @@ -351,19 +372,19 @@ fi # as_fn_arith -# as_fn_error ERROR [LINENO LOG_FD] -# --------------------------------- +# as_fn_error STATUS ERROR [LINENO LOG_FD] +# ---------------------------------------- # Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are # provided, also output the error to LOG_FD, referencing LINENO. Then exit the -# script with status $?, using 1 if that was 0. +# script with STATUS, using 1 if that was 0. as_fn_error () { - as_status=$?; test $as_status -eq 0 && as_status=1 - if test "$3"; then - as_lineno=${as_lineno-"$2"} as_lineno_stack=as_lineno_stack=$as_lineno_stack - $as_echo "$as_me:${as_lineno-$LINENO}: error: $1" >&$3 + as_status=$1; test $as_status -eq 0 && as_status=1 + if test "$4"; then + as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4 fi - $as_echo "$as_me: error: $1" >&2 + $as_echo "$as_me: error: $2" >&2 as_fn_exit $as_status } # as_fn_error @@ -436,6 +457,10 @@ chmod +x "$as_me.lineno" || { $as_echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2; as_fn_exit 1; } + # If we had to re-execute with $CONFIG_SHELL, we're ensured to have + # already done that, so ensure we don't try to do so again and fall + # in an infinite loop. This has already happened in practice. + _as_can_reexec=no; export _as_can_reexec # Don't try to exec as it changes $[0], causing all sort of problems # (the dirname of $[0] is not the place where we might find the # original and so on. Autoconf is especially sensitive to this). @@ -470,16 +495,16 @@ # ... but there are two gotchas: # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. - # In both cases, we have to default to `cp -p'. + # In both cases, we have to default to `cp -pR'. ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || - as_ln_s='cp -p' + as_ln_s='cp -pR' elif ln conf$$.file conf$$ 2>/dev/null; then as_ln_s=ln else - as_ln_s='cp -p' + as_ln_s='cp -pR' fi else - as_ln_s='cp -p' + as_ln_s='cp -pR' fi rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file rmdir conf$$.dir 2>/dev/null @@ -491,28 +516,8 @@ as_mkdir_p=false fi -if test -x / >/dev/null 2>&1; then - as_test_x='test -x' -else - if ls -dL / >/dev/null 2>&1; then - as_ls_L_option=L - else - as_ls_L_option= - fi - as_test_x=' - eval sh -c '\'' - if test -d "$1"; then - test -d "$1/."; - else - case $1 in #( - -*)set "./$1";; - esac; - case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in #(( - ???[sx]*):;;*)false;;esac;fi - '\'' sh - ' -fi -as_executable_p=$as_test_x +as_test_x='test -x' +as_executable_p=as_fn_executable_p # Sed expression to map a string onto a valid CPP name. as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" @@ -561,6 +566,8 @@ at_clean=false # Test groups to run at_groups= +# Whether to rerun failed tests. +at_recheck= # Whether a write failure occurred at_write_fail=0 @@ -574,10 +581,10 @@ # Whether -C is in effect. at_change_dir=false +# Whether to enable colored test results. +at_color=no # List of the tested programs. at_tested='' -# List of the all the test groups. -at_groups_all=' 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40' # As many question marks as there are digits in the last test group number. # Used to normalize the test group numbers so that `ls' lists them in # numerical order. @@ -624,6 +631,8 @@ 39;DASTest.at:69;DAS \$abs_srcdir/das-testsuite/test.8.das;das; 40;DASTest.at:70;DAS \$abs_srcdir/das-testsuite/test.9.das;das; " +# List of the all the test groups. +at_groups_all=`$as_echo "$at_help_all" | sed 's/;.*//'` # at_fn_validate_ranges NAME... # ----------------------------- @@ -659,8 +668,8 @@ fi case $at_option in - *=*) at_optarg=`expr "x$at_option" : 'x[^=]*=\(.*\)'` ;; - *) at_optarg= ;; + *=?*) at_optarg=`expr "X$at_option" : '[^=]*=\(.*\)'` ;; + *) at_optarg= ;; esac # Accept the important Cygnus configure options, so we can diagnose typos. @@ -682,6 +691,19 @@ at_clean=: ;; + --color ) + at_color=always + ;; + --color=* ) + case $at_optarg in + no | never | none) at_color=never ;; + auto | tty | if-tty) at_color=auto ;; + always | yes | force) at_color=always ;; + *) at_optname=`echo " $at_option" | sed 's/^ //; s/=.*//'` + as_fn_error $? "unrecognized argument to $at_optname: $at_optarg" ;; + esac + ;; + --debug | -d ) at_debug_p=: ;; @@ -703,24 +725,24 @@ [0-9] | [0-9][0-9] | [0-9][0-9][0-9] | [0-9][0-9][0-9][0-9]) at_fn_validate_ranges at_option - as_fn_append at_groups "$at_option " + as_fn_append at_groups "$at_option$as_nl" ;; # Ranges [0-9]- | [0-9][0-9]- | [0-9][0-9][0-9]- | [0-9][0-9][0-9][0-9]-) at_range_start=`echo $at_option |tr -d X-` at_fn_validate_ranges at_range_start - at_range=`$as_echo " $at_groups_all " | \ - sed -e 's/^.* \('$at_range_start' \)/\1/'` - as_fn_append at_groups "$at_range " + at_range=`$as_echo "$at_groups_all" | \ + sed -ne '/^'$at_range_start'$/,$p'` + as_fn_append at_groups "$at_range$as_nl" ;; -[0-9] | -[0-9][0-9] | -[0-9][0-9][0-9] | -[0-9][0-9][0-9][0-9]) at_range_end=`echo $at_option |tr -d X-` at_fn_validate_ranges at_range_end - at_range=`$as_echo " $at_groups_all " | \ - sed -e 's/\( '$at_range_end'\) .*$/\1/'` - as_fn_append at_groups "$at_range " + at_range=`$as_echo "$at_groups_all" | \ + sed -ne '1,/^'$at_range_end'$/p'` + as_fn_append at_groups "$at_range$as_nl" ;; [0-9]-[0-9] | [0-9]-[0-9][0-9] | [0-9]-[0-9][0-9][0-9] | \ @@ -737,10 +759,9 @@ at_range_start=$at_tmp fi at_fn_validate_ranges at_range_start at_range_end - at_range=`$as_echo " $at_groups_all " | \ - sed -e 's/^.*\( '$at_range_start' \)/\1/' \ - -e 's/\( '$at_range_end'\) .*$/\1/'` - as_fn_append at_groups "$at_range " + at_range=`$as_echo "$at_groups_all" | \ + sed -ne '/^'$at_range_start'$/,/^'$at_range_end'$/p'` + as_fn_append at_groups "$at_range$as_nl" ;; # Directory selection. @@ -750,6 +771,9 @@ --directory=* ) at_change_dir=: at_dir=$at_optarg + if test x- = "x$at_dir" ; then + at_dir=./- + fi ;; # Parallel execution. @@ -764,7 +788,7 @@ fi case $at_jobs in *[!0-9]*) at_optname=`echo " $at_option" | sed 's/^ //; s/[0-9=].*//'` - as_fn_error "non-numeric argument to $at_optname: $at_jobs" ;; + as_fn_error $? "non-numeric argument to $at_optname: $at_jobs" ;; esac ;; @@ -792,11 +816,12 @@ at_groups_selected=`$as_echo "$at_groups_selected" | grep -i $at_invert "^[1-9][^;]*;.*[; ]$at_keyword[ ;]"` done - # Smash the newlines. - at_groups_selected=`$as_echo "$at_groups_selected" | sed 's/;.*//' | - tr "$as_nl" ' ' - ` - as_fn_append at_groups "$at_groups_selected " + # Smash the keywords. + at_groups_selected=`$as_echo "$at_groups_selected" | sed 's/;.*//'` + as_fn_append at_groups "$at_groups_selected$as_nl" + ;; + --recheck) + at_recheck=: ;; *=*) @@ -804,7 +829,7 @@ # Reject names that are not valid shell variable names. case $at_envvar in '' | [0-9]* | *[!_$as_cr_alnum]* ) - as_fn_error "invalid variable name: \`$at_envvar'" ;; + as_fn_error $? "invalid variable name: \`$at_envvar'" ;; esac at_value=`$as_echo "$at_optarg" | sed "s/'/'\\\\\\\\''/g"` # Export now, but save eval for later and for debug scripts. @@ -821,15 +846,41 @@ # Verify our last option didn't require an argument if test -n "$at_prev"; then : - as_fn_error "\`$at_prev' requires an argument." + as_fn_error $? "\`$at_prev' requires an argument" fi +# The file containing the suite. +at_suite_log=$at_dir/$as_me.log + # Selected test groups. -if test -z "$at_groups"; then +if test -z "$at_groups$at_recheck"; then at_groups=$at_groups_all else + if test -n "$at_recheck" && test -r "$at_suite_log"; then + at_oldfails=`sed -n ' + /^Failed tests:$/,/^Skipped tests:$/{ + s/^[ ]*\([1-9][0-9]*\):.*/\1/p + } + /^Unexpected passes:$/,/^## Detailed failed tests/{ + s/^[ ]*\([1-9][0-9]*\):.*/\1/p + } + /^## Detailed failed tests/q + ' "$at_suite_log"` + as_fn_append at_groups "$at_oldfails$as_nl" + fi # Sort the tests, removing duplicates. - at_groups=`$as_echo "$at_groups" | tr ' ' "$as_nl" | sort -nu` + at_groups=`$as_echo "$at_groups" | sort -nu | sed '/^$/d'` +fi + +if test x"$at_color" = xalways \ + || { test x"$at_color" = xauto && test -t 1; }; then + at_red=`printf '\033[0;31m'` + at_grn=`printf '\033[0;32m'` + at_lgn=`printf '\033[1;32m'` + at_blu=`printf '\033[1;34m'` + at_std=`printf '\033[m'` +else + at_red= at_grn= at_lgn= at_blu= at_std= fi # Help message. @@ -865,11 +916,14 @@ Execution tuning: -C, --directory=DIR change to directory DIR before starting + --color[=never|auto|always] + enable colored test results on terminal, or always -j, --jobs[=N] Allow N jobs at once; infinite jobs with no arg (default 1) -k, --keywords=KEYWORDS select the tests matching all the comma-separated KEYWORDS multiple \`-k' accumulate; prefixed \`!' negates a KEYWORD + --recheck select all tests that failed or passed unexpectedly last time -e, --errexit abort as soon as a test fails; implies --debug -v, --verbose force more detailed output default for debugging scripts @@ -887,27 +941,19 @@ # List of tests. if $at_list_p; then cat <<_ATEOF || at_write_fail=1 -libdap 3.11.1 test suite: das-test test groups: +libdap 3.12.0 test suite: das-test test groups: NUM: FILE-NAME:LINE TEST-GROUP-NAME KEYWORDS _ATEOF - # Passing at_groups is tricky. We cannot use it to form a literal string - # or regexp because of the limitation of AIX awk. And Solaris' awk - # doesn't grok more than 99 fields in a record, so we have to use `split'. - # at_groups needs to be space-separated for this script to work. - case $at_groups in - *"$as_nl"* ) - at_groups=`$as_echo "$at_groups" | tr "$as_nl" ' '` ;; - esac - $as_echo "$at_groups$as_nl$at_help_all" | - awk 'BEGIN { FS = ";" } - NR == 1 { - for (n = split ($ 0, a, " "); n; n--) - selected[a[n]] = 1 + # Pass an empty line as separator between selected groups and help. + $as_echo "$at_groups$as_nl$as_nl$at_help_all" | + awk 'NF == 1 && FS != ";" { + selected[$ 1] = 1 next } + /^$/ { FS = ";" } NF > 0 { if (selected[$ 1]) { printf " %3d: %-18s %s\n", $ 1, $ 2, $ 3 @@ -936,32 +982,28 @@ exit $at_write_fail fi if $at_version_p; then - $as_echo "$as_me (libdap 3.11.1)" && + $as_echo "$as_me (libdap 3.12.0)" && cat <<\_ATEOF || at_write_fail=1 -Copyright (C) 2009 Free Software Foundation, Inc. +Copyright (C) 2012 Free Software Foundation, Inc. This test suite is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it. _ATEOF exit $at_write_fail fi -# Should we print banners? at_groups is space-separated for entire test, -# newline-separated if only a subset of the testsuite is run. -case $at_groups in - *' '*' '* | *"$as_nl"*"$as_nl"* ) - at_print_banners=: ;; +# Should we print banners? Yes if more than one test is run. +case $at_groups in #( + *$as_nl* ) + at_print_banners=: ;; #( * ) at_print_banners=false ;; esac -# Text for banner N, set to empty once printed. +# Text for banner N, set to a single space once printed. # Take any -C into account. if $at_change_dir ; then - if test x- = "x$at_dir" ; then - at_dir=./- - fi test x != "x$at_dir" && cd "$at_dir" \ - || as_fn_error "unable to change directory" + || as_fn_error $? "unable to change directory" at_dir=`pwd` fi @@ -969,11 +1011,11 @@ for at_file in atconfig atlocal do test -r $at_file || continue - . ./$at_file || as_fn_error "invalid content: $at_file" + . ./$at_file || as_fn_error $? "invalid content: $at_file" done # Autoconf <=2.59b set at_top_builddir instead of at_top_build_prefix: -: ${at_top_build_prefix=$at_top_builddir} +: "${at_top_build_prefix=$at_top_builddir}" # Perform any assignments requested during argument parsing. eval "$at_debug_args" @@ -1026,7 +1068,7 @@ # The directory the whole suite works in. # Should be absolute to let the user `cd' at will. at_suite_dir=$at_dir/$as_me.dir -# The file containing the suite. +# The file containing the suite ($at_dir might have changed since earlier). at_suite_log=$at_dir/$as_me.log # The directory containing helper files per test group. at_helper_dir=$at_suite_dir/at-groups @@ -1106,6 +1148,7 @@ # Setting up the FDs. + # 5 is the log file. Not to be overwritten if `-d'. if $at_debug_p; then at_suite_log=/dev/null @@ -1115,43 +1158,28 @@ exec 5>>"$at_suite_log" # Banners and logs. -cat <<\_ASBOX -## ----------------------------------- ## -## libdap 3.11.1 test suite: das-test. ## -## ----------------------------------- ## -_ASBOX -{ - cat <<\_ASBOX -## ----------------------------------- ## -## libdap 3.11.1 test suite: das-test. ## -## ----------------------------------- ## -_ASBOX +$as_echo "## ----------------------------------- ## +## libdap 3.12.0 test suite: das-test. ## +## ----------------------------------- ##" +{ + $as_echo "## ----------------------------------- ## +## libdap 3.12.0 test suite: das-test. ## +## ----------------------------------- ##" echo $as_echo "$as_me: command line was:" $as_echo " \$ $0 $at_cli_args" echo - # Try to find a few ChangeLogs in case it might help determining the - # exact version. Use the relative dir: if the top dir is a symlink, - # find will not follow it (and options to follow the links are not - # portable), which would result in no output here. Prune directories - # matching the package tarname, since they tend to be leftovers from - # `make dist' or `make distcheck' and contain redundant or stale logs. - if test -n "$at_top_srcdir"; then - cat <<\_ASBOX -## ----------- ## -## ChangeLogs. ## -## ----------- ## -_ASBOX + # If ChangeLog exists, list a few lines in case it might help determining + # the exact version. + if test -n "$at_top_srcdir" && test -f "$at_top_srcdir/ChangeLog"; then + $as_echo "## ---------- ## +## ChangeLog. ## +## ---------- ##" + echo + sed 's/^/| /;10q' "$at_top_srcdir/ChangeLog" echo - for at_file in `find "$at_top_srcdir" -name "libdap-*" -prune -o -name ChangeLog -print` - do - $as_echo "$as_me: $at_file:" - sed 's/^/| /;10q' $at_file - echo - done - fi { @@ -1214,9 +1242,13 @@ { $at_print_banners || return 0 eval at_banner_text=\$at_banner_text_$1 - test "x$at_banner_text" = x && return 0 - eval at_banner_text_$1= - $as_echo "$as_nl$at_banner_text$as_nl" + test "x$at_banner_text" = "x " && return 0 + eval "at_banner_text_$1=\" \"" + if test -z "$at_banner_text"; then + $at_first || echo + else + $as_echo "$as_nl$at_banner_text$as_nl" + fi } # at_fn_banner # at_fn_check_prepare_notrace REASON LINE @@ -1350,11 +1382,9 @@ ## End of autotest shell functions. ## ## -------------------------------- ## { - cat <<\_ASBOX -## ---------------- ## + $as_echo "## ---------------- ## ## Tested programs. ## -## ---------------- ## -_ASBOX +## ---------------- ##" echo } >&5 @@ -1383,16 +1413,14 @@ echo } >&5 2>&1 else - as_fn_error "cannot find $at_program" "$LINENO" 5 + as_fn_error $? "cannot find $at_program" "$LINENO" 5 fi done { - cat <<\_ASBOX -## ------------------ ## + $as_echo "## ------------------ ## ## Running the tests. ## -## ------------------ ## -_ASBOX +## ------------------ ##" } >&5 at_start_date=`date` @@ -1401,7 +1429,7 @@ # Create the master directory if it doesn't already exist. as_dir="$at_suite_dir"; as_fn_mkdir_p || - as_fn_error "cannot create \`$at_suite_dir'" "$LINENO" 5 + as_fn_error $? "cannot create \`$at_suite_dir'" "$LINENO" 5 # Can we diff with `/dev/null'? DU 5.0 refuses. if diff /dev/null /dev/null >/dev/null 2>&1; then @@ -1435,7 +1463,7 @@ if (test == "'"$at_group"'") exit }' "$at_myself" > "$at_suite_dir/at-source-lines" && . "$at_suite_dir/at-source-lines" || - as_fn_error "cannot create test line number cache" "$LINENO" 5 + as_fn_error $? "cannot create test line number cache" "$LINENO" 5 rm -f "$at_suite_dir/at-source-lines" # Set number of jobs for `-j'; avoid more jobs than test groups. @@ -1459,7 +1487,7 @@ mkdir "$at_helper_dir" && cd "$at_helper_dir" && { test -z "$at_groups" || mkdir $at_groups; } || -as_fn_error "testsuite directory setup failed" "$LINENO" 5 +as_fn_error $? "testsuite directory setup failed" "$LINENO" 5 # Functions for running a test group. We leave the actual # test group execution outside of a shell function in order @@ -1467,7 +1495,7 @@ # at_fn_group_prepare # ------------------- -# Prepare running a test group. +# Prepare for running a test group. at_fn_group_prepare () { # The directory for additional per-group helper files. @@ -1512,8 +1540,8 @@ find "$at_group_dir" -type d ! -perm -700 -exec chmod u+rwx {} \; rm -fr "$at_group_dir"/* "$at_group_dir"/.[!.] "$at_group_dir"/.??* fi || - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: test directory for $at_group_normalized could not be cleaned." >&5 -$as_echo "$as_me: WARNING: test directory for $at_group_normalized could not be cleaned." >&2;} + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: test directory for $at_group_normalized could not be cleaned" >&5 +$as_echo "$as_me: WARNING: test directory for $at_group_normalized could not be cleaned" >&2;} # Be tolerant if the above `rm' was not able to remove the directory. as_dir="$at_group_dir"; as_fn_mkdir_p @@ -1528,6 +1556,25 @@ fi } +# at_fn_group_banner ORDINAL LINE DESC PAD [BANNER] +# ------------------------------------------------- +# Declare the test group ORDINAL, located at LINE with group description DESC, +# and residing under BANNER. Use PAD to align the status column. +at_fn_group_banner () +{ + at_setup_line="$2" + test -n "$5" && at_fn_banner $5 + at_desc="$3" + case $1 in + [0-9]) at_desc_line=" $1: ";; + [0-9][0-9]) at_desc_line=" $1: " ;; + *) at_desc_line="$1: " ;; + esac + as_fn_append at_desc_line "$3$4" + $at_quiet $as_echo_n "$at_desc_line" + echo "# -*- compilation -*-" >> "$at_group_log" +} + # at_fn_group_postprocess # ----------------------- # Perform cleanup after running a test group. @@ -1549,44 +1596,44 @@ $at_verbose $as_echo_n "$at_group. $at_setup_line: " $as_echo_n "$at_group. $at_setup_line: " >> "$at_group_log" case $at_xfail:$at_status in - *:99) - at_msg='FAILED ('`cat "$at_check_line_file"`')' - at_res=fail - at_errexit=$at_errexit_p - ;; yes:0) at_msg="UNEXPECTED PASS" at_res=xpass at_errexit=$at_errexit_p + at_color=$at_red ;; no:0) at_msg="ok" at_res=pass at_errexit=false + at_color=$at_grn ;; *:77) at_msg='skipped ('`cat "$at_check_line_file"`')' at_res=skip at_errexit=false + at_color=$at_blu + ;; + no:* | *:99) + at_msg='FAILED ('`cat "$at_check_line_file"`')' + at_res=fail + at_errexit=$at_errexit_p + at_color=$at_red ;; yes:*) at_msg='expected failure ('`cat "$at_check_line_file"`')' at_res=xfail at_errexit=false - ;; - no:*) - at_msg='FAILED ('`cat "$at_check_line_file"`')' - at_res=fail - at_errexit=$at_errexit_p + at_color=$at_lgn ;; esac echo "$at_res" > "$at_job_dir/$at_res" # In parallel mode, output the summary line only afterwards. if test $at_jobs -ne 1 && test -n "$at_verbose"; then - $as_echo "$at_desc_line $at_msg" + $as_echo "$at_desc_line $at_color$at_msg$at_std" else # Make sure there is a separator even with long titles. - $as_echo " $at_msg" + $as_echo " $at_color$at_msg$at_std" fi at_log_msg="$at_group. $at_desc ($at_setup_line): $at_msg" case $at_status in @@ -1602,9 +1649,13 @@ $as_echo "$at_log_msg" >> "$at_group_log" $as_echo "$at_log_msg" >&5 - # Cleanup the group directory, unless the user wants the files. - if $at_debug_p; then + # Cleanup the group directory, unless the user wants the files + # or the success was unexpected. + if $at_debug_p || test $at_res = xpass; then at_fn_create_debugging_script + if test $at_res = xpass && $at_errexit; then + echo stop > "$at_stop_file" + fi else if test -d "$at_group_dir"; then find "$at_group_dir" -type d ! -perm -700 -exec chmod u+rwx \{\} \; @@ -1690,8 +1741,7 @@ echo # Turn jobs into a list of numbers, starting from 1. - at_joblist=`$as_echo " $at_groups_all " | \ - sed 's/\( '$at_jobs'\) .*/\1/'` + at_joblist=`$as_echo "$at_groups" | sed -n 1,${at_jobs}p` set X $at_joblist shift @@ -1700,28 +1750,32 @@ ( # Start one test group. $at_job_control_off - exec 6>"$at_job_fifo" + if $at_first; then + exec 7>"$at_job_fifo" + else + exec 6<&- + fi trap 'set +x; set +e trap "" PIPE echo stop > "$at_stop_file" - echo token >&6 + echo >&7 as_fn_exit 141' PIPE at_fn_group_prepare if cd "$at_group_dir" && at_fn_test $at_group && - . "$at_test_source" # AT_JOB_FIFO_FD>&- + . "$at_test_source" then :; else { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: unable to parse test group: $at_group" >&5 $as_echo "$as_me: WARNING: unable to parse test group: $at_group" >&2;} at_failed=: fi at_fn_group_postprocess - echo token >&6 + echo >&7 ) & $at_job_control_off if $at_first; then at_first=false - exec 6<"$at_job_fifo" + exec 6<"$at_job_fifo" 7>"$at_job_fifo" fi shift # Consume one token. if test $# -gt 0; then :; else @@ -1730,6 +1784,7 @@ fi test -f "$at_stop_file" && break done + exec 7>&- # Read back the remaining ($at_jobs - 1) tokens. set X $at_joblist shift @@ -1803,19 +1858,15 @@ esac echo -cat <<\_ASBOX -## ------------- ## +$as_echo "## ------------- ## ## Test results. ## -## ------------- ## -_ASBOX +## ------------- ##" echo { echo - cat <<\_ASBOX -## ------------- ## + $as_echo "## ------------- ## ## Test results. ## -## ------------- ## -_ASBOX +## ------------- ##" echo } >&5 @@ -1833,12 +1884,14 @@ at_result="$at_result $at_were run, one failed" fi at_result="$at_result unexpectedly and inhibited subsequent tests." + at_color=$at_red else # Don't you just love exponential explosion of the number of cases? + at_color=$at_red case $at_xpass_count:$at_fail_count:$at_xfail_count in # So far, so good. - 0:0:0) at_result="$at_result $at_were successful." ;; - 0:0:*) at_result="$at_result behaved as expected." ;; + 0:0:0) at_result="$at_result $at_were successful." at_color=$at_grn ;; + 0:0:*) at_result="$at_result behaved as expected." at_color=$at_lgn ;; # Some unexpected failures 0:*:0) at_result="$at_result $at_were run, @@ -1884,18 +1937,16 @@ esac if test $at_unexpected_count = 0; then - echo "$at_result" + echo "$at_color$at_result$at_std" echo "$at_result" >&5 else - echo "ERROR: $at_result" >&2 + echo "${at_color}ERROR: $at_result$at_std" >&2 echo "ERROR: $at_result" >&5 { echo - cat <<\_ASBOX -## ------------------------ ## + $as_echo "## ------------------------ ## ## Summary of the failures. ## -## ------------------------ ## -_ASBOX +## ------------------------ ##" # Summary of failed and skipped tests. if test $at_fail_count != 0; then @@ -1914,11 +1965,9 @@ echo fi if test $at_fail_count != 0; then - cat <<\_ASBOX -## ---------------------- ## + $as_echo "## ---------------------- ## ## Detailed failed tests. ## -## ---------------------- ## -_ASBOX +## ---------------------- ##" echo for at_group in $at_fail_list do @@ -1958,7 +2007,7 @@ $as_echo "Please send $at_msg and all information you think might help: To: - Subject: [libdap 3.11.1] $as_me: $at_fail_list${at_fail_list:+ failed${at_xpass_list:+, }}$at_xpass_list${at_xpass_list:+ passed unexpectedly} + Subject: [libdap 3.12.0] $as_me: $at_fail_list${at_fail_list:+ failed${at_xpass_list:+, }}$at_xpass_list${at_xpass_list:+ passed unexpectedly} You may investigate any problem if you feel able to do so, in which case the test suite provides a good starting point. Its output may @@ -1973,15 +2022,11 @@ ## Actual tests. ## ## ------------- ## #AT_START_1 -# 1. DASTest.at:31: DAS $abs_srcdir/das-testsuite/bad_value_test.1.das -at_setup_line='DASTest.at:31' -at_desc="DAS \$abs_srcdir/das-testsuite/bad_value_test.1.das" -at_desc_line=" 1: $at_desc" -$at_quiet $as_echo_n "$at_desc_line" +at_fn_group_banner 1 'DASTest.at:31' \ + "DAS \$abs_srcdir/das-testsuite/bad_value_test.1.das" "" at_xfail=no -echo "# -*- compilation -*-" >> "$at_group_log" ( - $as_echo "1. DASTest.at:31: testing ..." + $as_echo "1. $at_setup_line: testing $at_desc ..." $at_traceon @@ -1991,7 +2036,7 @@ $as_echo "$at_srcdir/DASTest.at:31: \$abs_builddir/das-test -p < \$abs_srcdir/das-testsuite/bad_value_test.1.das || true" at_fn_check_prepare_dynamic "$abs_builddir/das-test -p < $abs_srcdir/das-testsuite/bad_value_test.1.das || true" "DASTest.at:31" ( $at_check_trace; $abs_builddir/das-test -p < $abs_srcdir/das-testsuite/bad_value_test.1.das || true -) >>"$at_stdout" 2>>"$at_stderr" +) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" @@ -2006,7 +2051,7 @@ $as_echo "$at_srcdir/DASTest.at:31: diff -b -B \$abs_srcdir/das-testsuite/bad_value_test.1.das.base stdout || diff -b -B \$abs_srcdir/das-testsuite/bad_value_test.1.das.base stderr" at_fn_check_prepare_dynamic "diff -b -B $abs_srcdir/das-testsuite/bad_value_test.1.das.base stdout || diff -b -B $abs_srcdir/das-testsuite/bad_value_test.1.das.base stderr" "DASTest.at:31" ( $at_check_trace; diff -b -B $abs_srcdir/das-testsuite/bad_value_test.1.das.base stdout || diff -b -B $abs_srcdir/das-testsuite/bad_value_test.1.das.base stderr -) >>"$at_stdout" 2>>"$at_stderr" +) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: @@ -2017,19 +2062,15 @@ set +x $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 | eval $at_tee_pipe +) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_1 #AT_START_2 -# 2. DASTest.at:32: DAS $abs_srcdir/das-testsuite/das.das -at_setup_line='DASTest.at:32' -at_desc="DAS \$abs_srcdir/das-testsuite/das.das" -at_desc_line=" 2: $at_desc " -$at_quiet $as_echo_n "$at_desc_line" +at_fn_group_banner 2 'DASTest.at:32' \ + "DAS \$abs_srcdir/das-testsuite/das.das" " " at_xfail=no -echo "# -*- compilation -*-" >> "$at_group_log" ( - $as_echo "2. DASTest.at:32: testing ..." + $as_echo "2. $at_setup_line: testing $at_desc ..." $at_traceon @@ -2039,7 +2080,7 @@ $as_echo "$at_srcdir/DASTest.at:32: \$abs_builddir/das-test -p < \$abs_srcdir/das-testsuite/das.das || true" at_fn_check_prepare_dynamic "$abs_builddir/das-test -p < $abs_srcdir/das-testsuite/das.das || true" "DASTest.at:32" ( $at_check_trace; $abs_builddir/das-test -p < $abs_srcdir/das-testsuite/das.das || true -) >>"$at_stdout" 2>>"$at_stderr" +) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" @@ -2054,7 +2095,7 @@ $as_echo "$at_srcdir/DASTest.at:32: diff -b -B \$abs_srcdir/das-testsuite/das.das.base stdout || diff -b -B \$abs_srcdir/das-testsuite/das.das.base stderr" at_fn_check_prepare_dynamic "diff -b -B $abs_srcdir/das-testsuite/das.das.base stdout || diff -b -B $abs_srcdir/das-testsuite/das.das.base stderr" "DASTest.at:32" ( $at_check_trace; diff -b -B $abs_srcdir/das-testsuite/das.das.base stdout || diff -b -B $abs_srcdir/das-testsuite/das.das.base stderr -) >>"$at_stdout" 2>>"$at_stderr" +) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: @@ -2065,19 +2106,15 @@ set +x $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 | eval $at_tee_pipe +) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_2 #AT_START_3 -# 3. DASTest.at:33: DAS $abs_srcdir/das-testsuite/special.test.das -at_setup_line='DASTest.at:33' -at_desc="DAS \$abs_srcdir/das-testsuite/special.test.das" -at_desc_line=" 3: $at_desc " -$at_quiet $as_echo_n "$at_desc_line" +at_fn_group_banner 3 'DASTest.at:33' \ + "DAS \$abs_srcdir/das-testsuite/special.test.das" " " at_xfail=no -echo "# -*- compilation -*-" >> "$at_group_log" ( - $as_echo "3. DASTest.at:33: testing ..." + $as_echo "3. $at_setup_line: testing $at_desc ..." $at_traceon @@ -2087,7 +2124,7 @@ $as_echo "$at_srcdir/DASTest.at:33: \$abs_builddir/das-test -p < \$abs_srcdir/das-testsuite/special.test.das || true" at_fn_check_prepare_dynamic "$abs_builddir/das-test -p < $abs_srcdir/das-testsuite/special.test.das || true" "DASTest.at:33" ( $at_check_trace; $abs_builddir/das-test -p < $abs_srcdir/das-testsuite/special.test.das || true -) >>"$at_stdout" 2>>"$at_stderr" +) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" @@ -2102,7 +2139,7 @@ $as_echo "$at_srcdir/DASTest.at:33: diff -b -B \$abs_srcdir/das-testsuite/special.test.das.base stdout || diff -b -B \$abs_srcdir/das-testsuite/special.test.das.base stderr" at_fn_check_prepare_dynamic "diff -b -B $abs_srcdir/das-testsuite/special.test.das.base stdout || diff -b -B $abs_srcdir/das-testsuite/special.test.das.base stderr" "DASTest.at:33" ( $at_check_trace; diff -b -B $abs_srcdir/das-testsuite/special.test.das.base stdout || diff -b -B $abs_srcdir/das-testsuite/special.test.das.base stderr -) >>"$at_stdout" 2>>"$at_stderr" +) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: @@ -2113,19 +2150,15 @@ set +x $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 | eval $at_tee_pipe +) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_3 #AT_START_4 -# 4. DASTest.at:34: DAS $abs_srcdir/das-testsuite/special.test.hdf.das -at_setup_line='DASTest.at:34' -at_desc="DAS \$abs_srcdir/das-testsuite/special.test.hdf.das" -at_desc_line=" 4: $at_desc" -$at_quiet $as_echo_n "$at_desc_line" +at_fn_group_banner 4 'DASTest.at:34' \ + "DAS \$abs_srcdir/das-testsuite/special.test.hdf.das" "" at_xfail=no -echo "# -*- compilation -*-" >> "$at_group_log" ( - $as_echo "4. DASTest.at:34: testing ..." + $as_echo "4. $at_setup_line: testing $at_desc ..." $at_traceon @@ -2135,7 +2168,7 @@ $as_echo "$at_srcdir/DASTest.at:34: \$abs_builddir/das-test -p < \$abs_srcdir/das-testsuite/special.test.hdf.das || true" at_fn_check_prepare_dynamic "$abs_builddir/das-test -p < $abs_srcdir/das-testsuite/special.test.hdf.das || true" "DASTest.at:34" ( $at_check_trace; $abs_builddir/das-test -p < $abs_srcdir/das-testsuite/special.test.hdf.das || true -) >>"$at_stdout" 2>>"$at_stderr" +) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" @@ -2150,7 +2183,7 @@ $as_echo "$at_srcdir/DASTest.at:34: diff -b -B \$abs_srcdir/das-testsuite/special.test.hdf.das.base stdout || diff -b -B \$abs_srcdir/das-testsuite/special.test.hdf.das.base stderr" at_fn_check_prepare_dynamic "diff -b -B $abs_srcdir/das-testsuite/special.test.hdf.das.base stdout || diff -b -B $abs_srcdir/das-testsuite/special.test.hdf.das.base stderr" "DASTest.at:34" ( $at_check_trace; diff -b -B $abs_srcdir/das-testsuite/special.test.hdf.das.base stdout || diff -b -B $abs_srcdir/das-testsuite/special.test.hdf.das.base stderr -) >>"$at_stdout" 2>>"$at_stderr" +) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: @@ -2161,19 +2194,15 @@ set +x $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 | eval $at_tee_pipe +) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_4 #AT_START_5 -# 5. DASTest.at:35: DAS $abs_srcdir/das-testsuite/test.1.das -at_setup_line='DASTest.at:35' -at_desc="DAS \$abs_srcdir/das-testsuite/test.1.das" -at_desc_line=" 5: $at_desc " -$at_quiet $as_echo_n "$at_desc_line" +at_fn_group_banner 5 'DASTest.at:35' \ + "DAS \$abs_srcdir/das-testsuite/test.1.das" " " at_xfail=no -echo "# -*- compilation -*-" >> "$at_group_log" ( - $as_echo "5. DASTest.at:35: testing ..." + $as_echo "5. $at_setup_line: testing $at_desc ..." $at_traceon @@ -2183,7 +2212,7 @@ $as_echo "$at_srcdir/DASTest.at:35: \$abs_builddir/das-test -p < \$abs_srcdir/das-testsuite/test.1.das || true" at_fn_check_prepare_dynamic "$abs_builddir/das-test -p < $abs_srcdir/das-testsuite/test.1.das || true" "DASTest.at:35" ( $at_check_trace; $abs_builddir/das-test -p < $abs_srcdir/das-testsuite/test.1.das || true -) >>"$at_stdout" 2>>"$at_stderr" +) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" @@ -2198,7 +2227,7 @@ $as_echo "$at_srcdir/DASTest.at:35: diff -b -B \$abs_srcdir/das-testsuite/test.1.das.base stdout || diff -b -B \$abs_srcdir/das-testsuite/test.1.das.base stderr" at_fn_check_prepare_dynamic "diff -b -B $abs_srcdir/das-testsuite/test.1.das.base stdout || diff -b -B $abs_srcdir/das-testsuite/test.1.das.base stderr" "DASTest.at:35" ( $at_check_trace; diff -b -B $abs_srcdir/das-testsuite/test.1.das.base stdout || diff -b -B $abs_srcdir/das-testsuite/test.1.das.base stderr -) >>"$at_stdout" 2>>"$at_stderr" +) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: @@ -2209,19 +2238,15 @@ set +x $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 | eval $at_tee_pipe +) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_5 #AT_START_6 -# 6. DASTest.at:36: DAS $abs_srcdir/das-testsuite/test.11.das -at_setup_line='DASTest.at:36' -at_desc="DAS \$abs_srcdir/das-testsuite/test.11.das" -at_desc_line=" 6: $at_desc " -$at_quiet $as_echo_n "$at_desc_line" +at_fn_group_banner 6 'DASTest.at:36' \ + "DAS \$abs_srcdir/das-testsuite/test.11.das" " " at_xfail=no -echo "# -*- compilation -*-" >> "$at_group_log" ( - $as_echo "6. DASTest.at:36: testing ..." + $as_echo "6. $at_setup_line: testing $at_desc ..." $at_traceon @@ -2231,7 +2256,7 @@ $as_echo "$at_srcdir/DASTest.at:36: \$abs_builddir/das-test -p < \$abs_srcdir/das-testsuite/test.11.das || true" at_fn_check_prepare_dynamic "$abs_builddir/das-test -p < $abs_srcdir/das-testsuite/test.11.das || true" "DASTest.at:36" ( $at_check_trace; $abs_builddir/das-test -p < $abs_srcdir/das-testsuite/test.11.das || true -) >>"$at_stdout" 2>>"$at_stderr" +) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" @@ -2246,7 +2271,7 @@ $as_echo "$at_srcdir/DASTest.at:36: diff -b -B \$abs_srcdir/das-testsuite/test.11.das.base stdout || diff -b -B \$abs_srcdir/das-testsuite/test.11.das.base stderr" at_fn_check_prepare_dynamic "diff -b -B $abs_srcdir/das-testsuite/test.11.das.base stdout || diff -b -B $abs_srcdir/das-testsuite/test.11.das.base stderr" "DASTest.at:36" ( $at_check_trace; diff -b -B $abs_srcdir/das-testsuite/test.11.das.base stdout || diff -b -B $abs_srcdir/das-testsuite/test.11.das.base stderr -) >>"$at_stdout" 2>>"$at_stderr" +) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: @@ -2257,19 +2282,15 @@ set +x $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 | eval $at_tee_pipe +) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_6 #AT_START_7 -# 7. DASTest.at:37: DAS $abs_srcdir/das-testsuite/test.12.das -at_setup_line='DASTest.at:37' -at_desc="DAS \$abs_srcdir/das-testsuite/test.12.das" -at_desc_line=" 7: $at_desc " -$at_quiet $as_echo_n "$at_desc_line" +at_fn_group_banner 7 'DASTest.at:37' \ + "DAS \$abs_srcdir/das-testsuite/test.12.das" " " at_xfail=no -echo "# -*- compilation -*-" >> "$at_group_log" ( - $as_echo "7. DASTest.at:37: testing ..." + $as_echo "7. $at_setup_line: testing $at_desc ..." $at_traceon @@ -2279,7 +2300,7 @@ $as_echo "$at_srcdir/DASTest.at:37: \$abs_builddir/das-test -p < \$abs_srcdir/das-testsuite/test.12.das || true" at_fn_check_prepare_dynamic "$abs_builddir/das-test -p < $abs_srcdir/das-testsuite/test.12.das || true" "DASTest.at:37" ( $at_check_trace; $abs_builddir/das-test -p < $abs_srcdir/das-testsuite/test.12.das || true -) >>"$at_stdout" 2>>"$at_stderr" +) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" @@ -2294,7 +2315,7 @@ $as_echo "$at_srcdir/DASTest.at:37: diff -b -B \$abs_srcdir/das-testsuite/test.12.das.base stdout || diff -b -B \$abs_srcdir/das-testsuite/test.12.das.base stderr" at_fn_check_prepare_dynamic "diff -b -B $abs_srcdir/das-testsuite/test.12.das.base stdout || diff -b -B $abs_srcdir/das-testsuite/test.12.das.base stderr" "DASTest.at:37" ( $at_check_trace; diff -b -B $abs_srcdir/das-testsuite/test.12.das.base stdout || diff -b -B $abs_srcdir/das-testsuite/test.12.das.base stderr -) >>"$at_stdout" 2>>"$at_stderr" +) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: @@ -2305,19 +2326,15 @@ set +x $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 | eval $at_tee_pipe +) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_7 #AT_START_8 -# 8. DASTest.at:38: DAS $abs_srcdir/das-testsuite/test.13.das -at_setup_line='DASTest.at:38' -at_desc="DAS \$abs_srcdir/das-testsuite/test.13.das" -at_desc_line=" 8: $at_desc " -$at_quiet $as_echo_n "$at_desc_line" +at_fn_group_banner 8 'DASTest.at:38' \ + "DAS \$abs_srcdir/das-testsuite/test.13.das" " " at_xfail=no -echo "# -*- compilation -*-" >> "$at_group_log" ( - $as_echo "8. DASTest.at:38: testing ..." + $as_echo "8. $at_setup_line: testing $at_desc ..." $at_traceon @@ -2327,7 +2344,7 @@ $as_echo "$at_srcdir/DASTest.at:38: \$abs_builddir/das-test -p < \$abs_srcdir/das-testsuite/test.13.das || true" at_fn_check_prepare_dynamic "$abs_builddir/das-test -p < $abs_srcdir/das-testsuite/test.13.das || true" "DASTest.at:38" ( $at_check_trace; $abs_builddir/das-test -p < $abs_srcdir/das-testsuite/test.13.das || true -) >>"$at_stdout" 2>>"$at_stderr" +) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" @@ -2342,7 +2359,7 @@ $as_echo "$at_srcdir/DASTest.at:38: diff -b -B \$abs_srcdir/das-testsuite/test.13.das.base stdout || diff -b -B \$abs_srcdir/das-testsuite/test.13.das.base stderr" at_fn_check_prepare_dynamic "diff -b -B $abs_srcdir/das-testsuite/test.13.das.base stdout || diff -b -B $abs_srcdir/das-testsuite/test.13.das.base stderr" "DASTest.at:38" ( $at_check_trace; diff -b -B $abs_srcdir/das-testsuite/test.13.das.base stdout || diff -b -B $abs_srcdir/das-testsuite/test.13.das.base stderr -) >>"$at_stdout" 2>>"$at_stderr" +) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: @@ -2353,19 +2370,15 @@ set +x $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 | eval $at_tee_pipe +) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_8 #AT_START_9 -# 9. DASTest.at:39: DAS $abs_srcdir/das-testsuite/test.14.das -at_setup_line='DASTest.at:39' -at_desc="DAS \$abs_srcdir/das-testsuite/test.14.das" -at_desc_line=" 9: $at_desc " -$at_quiet $as_echo_n "$at_desc_line" +at_fn_group_banner 9 'DASTest.at:39' \ + "DAS \$abs_srcdir/das-testsuite/test.14.das" " " at_xfail=no -echo "# -*- compilation -*-" >> "$at_group_log" ( - $as_echo "9. DASTest.at:39: testing ..." + $as_echo "9. $at_setup_line: testing $at_desc ..." $at_traceon @@ -2375,7 +2388,7 @@ $as_echo "$at_srcdir/DASTest.at:39: \$abs_builddir/das-test -p < \$abs_srcdir/das-testsuite/test.14.das || true" at_fn_check_prepare_dynamic "$abs_builddir/das-test -p < $abs_srcdir/das-testsuite/test.14.das || true" "DASTest.at:39" ( $at_check_trace; $abs_builddir/das-test -p < $abs_srcdir/das-testsuite/test.14.das || true -) >>"$at_stdout" 2>>"$at_stderr" +) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" @@ -2390,7 +2403,7 @@ $as_echo "$at_srcdir/DASTest.at:39: diff -b -B \$abs_srcdir/das-testsuite/test.14.das.base stdout || diff -b -B \$abs_srcdir/das-testsuite/test.14.das.base stderr" at_fn_check_prepare_dynamic "diff -b -B $abs_srcdir/das-testsuite/test.14.das.base stdout || diff -b -B $abs_srcdir/das-testsuite/test.14.das.base stderr" "DASTest.at:39" ( $at_check_trace; diff -b -B $abs_srcdir/das-testsuite/test.14.das.base stdout || diff -b -B $abs_srcdir/das-testsuite/test.14.das.base stderr -) >>"$at_stdout" 2>>"$at_stderr" +) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: @@ -2401,19 +2414,15 @@ set +x $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 | eval $at_tee_pipe +) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_9 #AT_START_10 -# 10. DASTest.at:40: DAS $abs_srcdir/das-testsuite/test.15.das -at_setup_line='DASTest.at:40' -at_desc="DAS \$abs_srcdir/das-testsuite/test.15.das" -at_desc_line=" 10: $at_desc " -$at_quiet $as_echo_n "$at_desc_line" +at_fn_group_banner 10 'DASTest.at:40' \ + "DAS \$abs_srcdir/das-testsuite/test.15.das" " " at_xfail=no -echo "# -*- compilation -*-" >> "$at_group_log" ( - $as_echo "10. DASTest.at:40: testing ..." + $as_echo "10. $at_setup_line: testing $at_desc ..." $at_traceon @@ -2423,7 +2432,7 @@ $as_echo "$at_srcdir/DASTest.at:40: \$abs_builddir/das-test -p < \$abs_srcdir/das-testsuite/test.15.das || true" at_fn_check_prepare_dynamic "$abs_builddir/das-test -p < $abs_srcdir/das-testsuite/test.15.das || true" "DASTest.at:40" ( $at_check_trace; $abs_builddir/das-test -p < $abs_srcdir/das-testsuite/test.15.das || true -) >>"$at_stdout" 2>>"$at_stderr" +) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" @@ -2438,7 +2447,7 @@ $as_echo "$at_srcdir/DASTest.at:40: diff -b -B \$abs_srcdir/das-testsuite/test.15.das.base stdout || diff -b -B \$abs_srcdir/das-testsuite/test.15.das.base stderr" at_fn_check_prepare_dynamic "diff -b -B $abs_srcdir/das-testsuite/test.15.das.base stdout || diff -b -B $abs_srcdir/das-testsuite/test.15.das.base stderr" "DASTest.at:40" ( $at_check_trace; diff -b -B $abs_srcdir/das-testsuite/test.15.das.base stdout || diff -b -B $abs_srcdir/das-testsuite/test.15.das.base stderr -) >>"$at_stdout" 2>>"$at_stderr" +) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: @@ -2449,19 +2458,15 @@ set +x $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 | eval $at_tee_pipe +) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_10 #AT_START_11 -# 11. DASTest.at:41: DAS $abs_srcdir/das-testsuite/test.16.das -at_setup_line='DASTest.at:41' -at_desc="DAS \$abs_srcdir/das-testsuite/test.16.das" -at_desc_line=" 11: $at_desc " -$at_quiet $as_echo_n "$at_desc_line" +at_fn_group_banner 11 'DASTest.at:41' \ + "DAS \$abs_srcdir/das-testsuite/test.16.das" " " at_xfail=no -echo "# -*- compilation -*-" >> "$at_group_log" ( - $as_echo "11. DASTest.at:41: testing ..." + $as_echo "11. $at_setup_line: testing $at_desc ..." $at_traceon @@ -2471,7 +2476,7 @@ $as_echo "$at_srcdir/DASTest.at:41: \$abs_builddir/das-test -p < \$abs_srcdir/das-testsuite/test.16.das || true" at_fn_check_prepare_dynamic "$abs_builddir/das-test -p < $abs_srcdir/das-testsuite/test.16.das || true" "DASTest.at:41" ( $at_check_trace; $abs_builddir/das-test -p < $abs_srcdir/das-testsuite/test.16.das || true -) >>"$at_stdout" 2>>"$at_stderr" +) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" @@ -2486,7 +2491,7 @@ $as_echo "$at_srcdir/DASTest.at:41: diff -b -B \$abs_srcdir/das-testsuite/test.16.das.base stdout || diff -b -B \$abs_srcdir/das-testsuite/test.16.das.base stderr" at_fn_check_prepare_dynamic "diff -b -B $abs_srcdir/das-testsuite/test.16.das.base stdout || diff -b -B $abs_srcdir/das-testsuite/test.16.das.base stderr" "DASTest.at:41" ( $at_check_trace; diff -b -B $abs_srcdir/das-testsuite/test.16.das.base stdout || diff -b -B $abs_srcdir/das-testsuite/test.16.das.base stderr -) >>"$at_stdout" 2>>"$at_stderr" +) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: @@ -2497,19 +2502,15 @@ set +x $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 | eval $at_tee_pipe +) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_11 #AT_START_12 -# 12. DASTest.at:42: DAS $abs_srcdir/das-testsuite/test.17.das -at_setup_line='DASTest.at:42' -at_desc="DAS \$abs_srcdir/das-testsuite/test.17.das" -at_desc_line=" 12: $at_desc " -$at_quiet $as_echo_n "$at_desc_line" +at_fn_group_banner 12 'DASTest.at:42' \ + "DAS \$abs_srcdir/das-testsuite/test.17.das" " " at_xfail=no -echo "# -*- compilation -*-" >> "$at_group_log" ( - $as_echo "12. DASTest.at:42: testing ..." + $as_echo "12. $at_setup_line: testing $at_desc ..." $at_traceon @@ -2519,7 +2520,7 @@ $as_echo "$at_srcdir/DASTest.at:42: \$abs_builddir/das-test -p < \$abs_srcdir/das-testsuite/test.17.das || true" at_fn_check_prepare_dynamic "$abs_builddir/das-test -p < $abs_srcdir/das-testsuite/test.17.das || true" "DASTest.at:42" ( $at_check_trace; $abs_builddir/das-test -p < $abs_srcdir/das-testsuite/test.17.das || true -) >>"$at_stdout" 2>>"$at_stderr" +) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" @@ -2534,7 +2535,7 @@ $as_echo "$at_srcdir/DASTest.at:42: diff -b -B \$abs_srcdir/das-testsuite/test.17.das.base stdout || diff -b -B \$abs_srcdir/das-testsuite/test.17.das.base stderr" at_fn_check_prepare_dynamic "diff -b -B $abs_srcdir/das-testsuite/test.17.das.base stdout || diff -b -B $abs_srcdir/das-testsuite/test.17.das.base stderr" "DASTest.at:42" ( $at_check_trace; diff -b -B $abs_srcdir/das-testsuite/test.17.das.base stdout || diff -b -B $abs_srcdir/das-testsuite/test.17.das.base stderr -) >>"$at_stdout" 2>>"$at_stderr" +) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: @@ -2545,19 +2546,15 @@ set +x $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 | eval $at_tee_pipe +) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_12 #AT_START_13 -# 13. DASTest.at:43: DAS $abs_srcdir/das-testsuite/test.18.das -at_setup_line='DASTest.at:43' -at_desc="DAS \$abs_srcdir/das-testsuite/test.18.das" -at_desc_line=" 13: $at_desc " -$at_quiet $as_echo_n "$at_desc_line" +at_fn_group_banner 13 'DASTest.at:43' \ + "DAS \$abs_srcdir/das-testsuite/test.18.das" " " at_xfail=no -echo "# -*- compilation -*-" >> "$at_group_log" ( - $as_echo "13. DASTest.at:43: testing ..." + $as_echo "13. $at_setup_line: testing $at_desc ..." $at_traceon @@ -2567,7 +2564,7 @@ $as_echo "$at_srcdir/DASTest.at:43: \$abs_builddir/das-test -p < \$abs_srcdir/das-testsuite/test.18.das || true" at_fn_check_prepare_dynamic "$abs_builddir/das-test -p < $abs_srcdir/das-testsuite/test.18.das || true" "DASTest.at:43" ( $at_check_trace; $abs_builddir/das-test -p < $abs_srcdir/das-testsuite/test.18.das || true -) >>"$at_stdout" 2>>"$at_stderr" +) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" @@ -2582,7 +2579,7 @@ $as_echo "$at_srcdir/DASTest.at:43: diff -b -B \$abs_srcdir/das-testsuite/test.18.das.base stdout || diff -b -B \$abs_srcdir/das-testsuite/test.18.das.base stderr" at_fn_check_prepare_dynamic "diff -b -B $abs_srcdir/das-testsuite/test.18.das.base stdout || diff -b -B $abs_srcdir/das-testsuite/test.18.das.base stderr" "DASTest.at:43" ( $at_check_trace; diff -b -B $abs_srcdir/das-testsuite/test.18.das.base stdout || diff -b -B $abs_srcdir/das-testsuite/test.18.das.base stderr -) >>"$at_stdout" 2>>"$at_stderr" +) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: @@ -2593,19 +2590,15 @@ set +x $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 | eval $at_tee_pipe +) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_13 #AT_START_14 -# 14. DASTest.at:44: DAS $abs_srcdir/das-testsuite/test.19.das -at_setup_line='DASTest.at:44' -at_desc="DAS \$abs_srcdir/das-testsuite/test.19.das" -at_desc_line=" 14: $at_desc " -$at_quiet $as_echo_n "$at_desc_line" +at_fn_group_banner 14 'DASTest.at:44' \ + "DAS \$abs_srcdir/das-testsuite/test.19.das" " " at_xfail=no -echo "# -*- compilation -*-" >> "$at_group_log" ( - $as_echo "14. DASTest.at:44: testing ..." + $as_echo "14. $at_setup_line: testing $at_desc ..." $at_traceon @@ -2615,7 +2608,7 @@ $as_echo "$at_srcdir/DASTest.at:44: \$abs_builddir/das-test -p < \$abs_srcdir/das-testsuite/test.19.das || true" at_fn_check_prepare_dynamic "$abs_builddir/das-test -p < $abs_srcdir/das-testsuite/test.19.das || true" "DASTest.at:44" ( $at_check_trace; $abs_builddir/das-test -p < $abs_srcdir/das-testsuite/test.19.das || true -) >>"$at_stdout" 2>>"$at_stderr" +) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" @@ -2630,7 +2623,7 @@ $as_echo "$at_srcdir/DASTest.at:44: diff -b -B \$abs_srcdir/das-testsuite/test.19.das.base stdout || diff -b -B \$abs_srcdir/das-testsuite/test.19.das.base stderr" at_fn_check_prepare_dynamic "diff -b -B $abs_srcdir/das-testsuite/test.19.das.base stdout || diff -b -B $abs_srcdir/das-testsuite/test.19.das.base stderr" "DASTest.at:44" ( $at_check_trace; diff -b -B $abs_srcdir/das-testsuite/test.19.das.base stdout || diff -b -B $abs_srcdir/das-testsuite/test.19.das.base stderr -) >>"$at_stdout" 2>>"$at_stderr" +) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: @@ -2641,19 +2634,15 @@ set +x $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 | eval $at_tee_pipe +) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_14 #AT_START_15 -# 15. DASTest.at:45: DAS $abs_srcdir/das-testsuite/test.1a.das -at_setup_line='DASTest.at:45' -at_desc="DAS \$abs_srcdir/das-testsuite/test.1a.das" -at_desc_line=" 15: $at_desc " -$at_quiet $as_echo_n "$at_desc_line" +at_fn_group_banner 15 'DASTest.at:45' \ + "DAS \$abs_srcdir/das-testsuite/test.1a.das" " " at_xfail=no -echo "# -*- compilation -*-" >> "$at_group_log" ( - $as_echo "15. DASTest.at:45: testing ..." + $as_echo "15. $at_setup_line: testing $at_desc ..." $at_traceon @@ -2663,7 +2652,7 @@ $as_echo "$at_srcdir/DASTest.at:45: \$abs_builddir/das-test -p < \$abs_srcdir/das-testsuite/test.1a.das || true" at_fn_check_prepare_dynamic "$abs_builddir/das-test -p < $abs_srcdir/das-testsuite/test.1a.das || true" "DASTest.at:45" ( $at_check_trace; $abs_builddir/das-test -p < $abs_srcdir/das-testsuite/test.1a.das || true -) >>"$at_stdout" 2>>"$at_stderr" +) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" @@ -2678,7 +2667,7 @@ $as_echo "$at_srcdir/DASTest.at:45: diff -b -B \$abs_srcdir/das-testsuite/test.1a.das.base stdout || diff -b -B \$abs_srcdir/das-testsuite/test.1a.das.base stderr" at_fn_check_prepare_dynamic "diff -b -B $abs_srcdir/das-testsuite/test.1a.das.base stdout || diff -b -B $abs_srcdir/das-testsuite/test.1a.das.base stderr" "DASTest.at:45" ( $at_check_trace; diff -b -B $abs_srcdir/das-testsuite/test.1a.das.base stdout || diff -b -B $abs_srcdir/das-testsuite/test.1a.das.base stderr -) >>"$at_stdout" 2>>"$at_stderr" +) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: @@ -2689,19 +2678,15 @@ set +x $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 | eval $at_tee_pipe +) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_15 #AT_START_16 -# 16. DASTest.at:46: DAS $abs_srcdir/das-testsuite/test.2.das -at_setup_line='DASTest.at:46' -at_desc="DAS \$abs_srcdir/das-testsuite/test.2.das" -at_desc_line=" 16: $at_desc " -$at_quiet $as_echo_n "$at_desc_line" +at_fn_group_banner 16 'DASTest.at:46' \ + "DAS \$abs_srcdir/das-testsuite/test.2.das" " " at_xfail=no -echo "# -*- compilation -*-" >> "$at_group_log" ( - $as_echo "16. DASTest.at:46: testing ..." + $as_echo "16. $at_setup_line: testing $at_desc ..." $at_traceon @@ -2711,7 +2696,7 @@ $as_echo "$at_srcdir/DASTest.at:46: \$abs_builddir/das-test -p < \$abs_srcdir/das-testsuite/test.2.das || true" at_fn_check_prepare_dynamic "$abs_builddir/das-test -p < $abs_srcdir/das-testsuite/test.2.das || true" "DASTest.at:46" ( $at_check_trace; $abs_builddir/das-test -p < $abs_srcdir/das-testsuite/test.2.das || true -) >>"$at_stdout" 2>>"$at_stderr" +) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" @@ -2726,7 +2711,7 @@ $as_echo "$at_srcdir/DASTest.at:46: diff -b -B \$abs_srcdir/das-testsuite/test.2.das.base stdout || diff -b -B \$abs_srcdir/das-testsuite/test.2.das.base stderr" at_fn_check_prepare_dynamic "diff -b -B $abs_srcdir/das-testsuite/test.2.das.base stdout || diff -b -B $abs_srcdir/das-testsuite/test.2.das.base stderr" "DASTest.at:46" ( $at_check_trace; diff -b -B $abs_srcdir/das-testsuite/test.2.das.base stdout || diff -b -B $abs_srcdir/das-testsuite/test.2.das.base stderr -) >>"$at_stdout" 2>>"$at_stderr" +) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: @@ -2737,19 +2722,15 @@ set +x $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 | eval $at_tee_pipe +) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_16 #AT_START_17 -# 17. DASTest.at:47: DAS $abs_srcdir/das-testsuite/test.20.das -at_setup_line='DASTest.at:47' -at_desc="DAS \$abs_srcdir/das-testsuite/test.20.das" -at_desc_line=" 17: $at_desc " -$at_quiet $as_echo_n "$at_desc_line" +at_fn_group_banner 17 'DASTest.at:47' \ + "DAS \$abs_srcdir/das-testsuite/test.20.das" " " at_xfail=no -echo "# -*- compilation -*-" >> "$at_group_log" ( - $as_echo "17. DASTest.at:47: testing ..." + $as_echo "17. $at_setup_line: testing $at_desc ..." $at_traceon @@ -2759,7 +2740,7 @@ $as_echo "$at_srcdir/DASTest.at:47: \$abs_builddir/das-test -p < \$abs_srcdir/das-testsuite/test.20.das || true" at_fn_check_prepare_dynamic "$abs_builddir/das-test -p < $abs_srcdir/das-testsuite/test.20.das || true" "DASTest.at:47" ( $at_check_trace; $abs_builddir/das-test -p < $abs_srcdir/das-testsuite/test.20.das || true -) >>"$at_stdout" 2>>"$at_stderr" +) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" @@ -2774,7 +2755,7 @@ $as_echo "$at_srcdir/DASTest.at:47: diff -b -B \$abs_srcdir/das-testsuite/test.20.das.base stdout || diff -b -B \$abs_srcdir/das-testsuite/test.20.das.base stderr" at_fn_check_prepare_dynamic "diff -b -B $abs_srcdir/das-testsuite/test.20.das.base stdout || diff -b -B $abs_srcdir/das-testsuite/test.20.das.base stderr" "DASTest.at:47" ( $at_check_trace; diff -b -B $abs_srcdir/das-testsuite/test.20.das.base stdout || diff -b -B $abs_srcdir/das-testsuite/test.20.das.base stderr -) >>"$at_stdout" 2>>"$at_stderr" +) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: @@ -2785,19 +2766,15 @@ set +x $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 | eval $at_tee_pipe +) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_17 #AT_START_18 -# 18. DASTest.at:48: DAS $abs_srcdir/das-testsuite/test.21.das -at_setup_line='DASTest.at:48' -at_desc="DAS \$abs_srcdir/das-testsuite/test.21.das" -at_desc_line=" 18: $at_desc " -$at_quiet $as_echo_n "$at_desc_line" +at_fn_group_banner 18 'DASTest.at:48' \ + "DAS \$abs_srcdir/das-testsuite/test.21.das" " " at_xfail=no -echo "# -*- compilation -*-" >> "$at_group_log" ( - $as_echo "18. DASTest.at:48: testing ..." + $as_echo "18. $at_setup_line: testing $at_desc ..." $at_traceon @@ -2807,7 +2784,7 @@ $as_echo "$at_srcdir/DASTest.at:48: \$abs_builddir/das-test -p < \$abs_srcdir/das-testsuite/test.21.das || true" at_fn_check_prepare_dynamic "$abs_builddir/das-test -p < $abs_srcdir/das-testsuite/test.21.das || true" "DASTest.at:48" ( $at_check_trace; $abs_builddir/das-test -p < $abs_srcdir/das-testsuite/test.21.das || true -) >>"$at_stdout" 2>>"$at_stderr" +) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" @@ -2822,7 +2799,7 @@ $as_echo "$at_srcdir/DASTest.at:48: diff -b -B \$abs_srcdir/das-testsuite/test.21.das.base stdout || diff -b -B \$abs_srcdir/das-testsuite/test.21.das.base stderr" at_fn_check_prepare_dynamic "diff -b -B $abs_srcdir/das-testsuite/test.21.das.base stdout || diff -b -B $abs_srcdir/das-testsuite/test.21.das.base stderr" "DASTest.at:48" ( $at_check_trace; diff -b -B $abs_srcdir/das-testsuite/test.21.das.base stdout || diff -b -B $abs_srcdir/das-testsuite/test.21.das.base stderr -) >>"$at_stdout" 2>>"$at_stderr" +) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: @@ -2833,19 +2810,15 @@ set +x $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 | eval $at_tee_pipe +) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_18 #AT_START_19 -# 19. DASTest.at:49: DAS $abs_srcdir/das-testsuite/test.22.das -at_setup_line='DASTest.at:49' -at_desc="DAS \$abs_srcdir/das-testsuite/test.22.das" -at_desc_line=" 19: $at_desc " -$at_quiet $as_echo_n "$at_desc_line" +at_fn_group_banner 19 'DASTest.at:49' \ + "DAS \$abs_srcdir/das-testsuite/test.22.das" " " at_xfail=no -echo "# -*- compilation -*-" >> "$at_group_log" ( - $as_echo "19. DASTest.at:49: testing ..." + $as_echo "19. $at_setup_line: testing $at_desc ..." $at_traceon @@ -2855,7 +2828,7 @@ $as_echo "$at_srcdir/DASTest.at:49: \$abs_builddir/das-test -p < \$abs_srcdir/das-testsuite/test.22.das || true" at_fn_check_prepare_dynamic "$abs_builddir/das-test -p < $abs_srcdir/das-testsuite/test.22.das || true" "DASTest.at:49" ( $at_check_trace; $abs_builddir/das-test -p < $abs_srcdir/das-testsuite/test.22.das || true -) >>"$at_stdout" 2>>"$at_stderr" +) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" @@ -2870,7 +2843,7 @@ $as_echo "$at_srcdir/DASTest.at:49: diff -b -B \$abs_srcdir/das-testsuite/test.22.das.base stdout || diff -b -B \$abs_srcdir/das-testsuite/test.22.das.base stderr" at_fn_check_prepare_dynamic "diff -b -B $abs_srcdir/das-testsuite/test.22.das.base stdout || diff -b -B $abs_srcdir/das-testsuite/test.22.das.base stderr" "DASTest.at:49" ( $at_check_trace; diff -b -B $abs_srcdir/das-testsuite/test.22.das.base stdout || diff -b -B $abs_srcdir/das-testsuite/test.22.das.base stderr -) >>"$at_stdout" 2>>"$at_stderr" +) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: @@ -2881,19 +2854,15 @@ set +x $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 | eval $at_tee_pipe +) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_19 #AT_START_20 -# 20. DASTest.at:50: DAS $abs_srcdir/das-testsuite/test.23.das -at_setup_line='DASTest.at:50' -at_desc="DAS \$abs_srcdir/das-testsuite/test.23.das" -at_desc_line=" 20: $at_desc " -$at_quiet $as_echo_n "$at_desc_line" +at_fn_group_banner 20 'DASTest.at:50' \ + "DAS \$abs_srcdir/das-testsuite/test.23.das" " " at_xfail=no -echo "# -*- compilation -*-" >> "$at_group_log" ( - $as_echo "20. DASTest.at:50: testing ..." + $as_echo "20. $at_setup_line: testing $at_desc ..." $at_traceon @@ -2903,7 +2872,7 @@ $as_echo "$at_srcdir/DASTest.at:50: \$abs_builddir/das-test -p < \$abs_srcdir/das-testsuite/test.23.das || true" at_fn_check_prepare_dynamic "$abs_builddir/das-test -p < $abs_srcdir/das-testsuite/test.23.das || true" "DASTest.at:50" ( $at_check_trace; $abs_builddir/das-test -p < $abs_srcdir/das-testsuite/test.23.das || true -) >>"$at_stdout" 2>>"$at_stderr" +) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" @@ -2918,7 +2887,7 @@ $as_echo "$at_srcdir/DASTest.at:50: diff -b -B \$abs_srcdir/das-testsuite/test.23.das.base stdout || diff -b -B \$abs_srcdir/das-testsuite/test.23.das.base stderr" at_fn_check_prepare_dynamic "diff -b -B $abs_srcdir/das-testsuite/test.23.das.base stdout || diff -b -B $abs_srcdir/das-testsuite/test.23.das.base stderr" "DASTest.at:50" ( $at_check_trace; diff -b -B $abs_srcdir/das-testsuite/test.23.das.base stdout || diff -b -B $abs_srcdir/das-testsuite/test.23.das.base stderr -) >>"$at_stdout" 2>>"$at_stderr" +) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: @@ -2929,19 +2898,15 @@ set +x $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 | eval $at_tee_pipe +) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_20 #AT_START_21 -# 21. DASTest.at:51: DAS $abs_srcdir/das-testsuite/test.24.das -at_setup_line='DASTest.at:51' -at_desc="DAS \$abs_srcdir/das-testsuite/test.24.das" -at_desc_line=" 21: $at_desc " -$at_quiet $as_echo_n "$at_desc_line" +at_fn_group_banner 21 'DASTest.at:51' \ + "DAS \$abs_srcdir/das-testsuite/test.24.das" " " at_xfail=no -echo "# -*- compilation -*-" >> "$at_group_log" ( - $as_echo "21. DASTest.at:51: testing ..." + $as_echo "21. $at_setup_line: testing $at_desc ..." $at_traceon @@ -2951,7 +2916,7 @@ $as_echo "$at_srcdir/DASTest.at:51: \$abs_builddir/das-test -p < \$abs_srcdir/das-testsuite/test.24.das || true" at_fn_check_prepare_dynamic "$abs_builddir/das-test -p < $abs_srcdir/das-testsuite/test.24.das || true" "DASTest.at:51" ( $at_check_trace; $abs_builddir/das-test -p < $abs_srcdir/das-testsuite/test.24.das || true -) >>"$at_stdout" 2>>"$at_stderr" +) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" @@ -2966,7 +2931,7 @@ $as_echo "$at_srcdir/DASTest.at:51: diff -b -B \$abs_srcdir/das-testsuite/test.24.das.base stdout || diff -b -B \$abs_srcdir/das-testsuite/test.24.das.base stderr" at_fn_check_prepare_dynamic "diff -b -B $abs_srcdir/das-testsuite/test.24.das.base stdout || diff -b -B $abs_srcdir/das-testsuite/test.24.das.base stderr" "DASTest.at:51" ( $at_check_trace; diff -b -B $abs_srcdir/das-testsuite/test.24.das.base stdout || diff -b -B $abs_srcdir/das-testsuite/test.24.das.base stderr -) >>"$at_stdout" 2>>"$at_stderr" +) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: @@ -2977,19 +2942,15 @@ set +x $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 | eval $at_tee_pipe +) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_21 #AT_START_22 -# 22. DASTest.at:52: DAS $abs_srcdir/das-testsuite/test.25.das -at_setup_line='DASTest.at:52' -at_desc="DAS \$abs_srcdir/das-testsuite/test.25.das" -at_desc_line=" 22: $at_desc " -$at_quiet $as_echo_n "$at_desc_line" +at_fn_group_banner 22 'DASTest.at:52' \ + "DAS \$abs_srcdir/das-testsuite/test.25.das" " " at_xfail=no -echo "# -*- compilation -*-" >> "$at_group_log" ( - $as_echo "22. DASTest.at:52: testing ..." + $as_echo "22. $at_setup_line: testing $at_desc ..." $at_traceon @@ -2999,7 +2960,7 @@ $as_echo "$at_srcdir/DASTest.at:52: \$abs_builddir/das-test -p < \$abs_srcdir/das-testsuite/test.25.das || true" at_fn_check_prepare_dynamic "$abs_builddir/das-test -p < $abs_srcdir/das-testsuite/test.25.das || true" "DASTest.at:52" ( $at_check_trace; $abs_builddir/das-test -p < $abs_srcdir/das-testsuite/test.25.das || true -) >>"$at_stdout" 2>>"$at_stderr" +) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" @@ -3014,7 +2975,7 @@ $as_echo "$at_srcdir/DASTest.at:52: diff -b -B \$abs_srcdir/das-testsuite/test.25.das.base stdout || diff -b -B \$abs_srcdir/das-testsuite/test.25.das.base stderr" at_fn_check_prepare_dynamic "diff -b -B $abs_srcdir/das-testsuite/test.25.das.base stdout || diff -b -B $abs_srcdir/das-testsuite/test.25.das.base stderr" "DASTest.at:52" ( $at_check_trace; diff -b -B $abs_srcdir/das-testsuite/test.25.das.base stdout || diff -b -B $abs_srcdir/das-testsuite/test.25.das.base stderr -) >>"$at_stdout" 2>>"$at_stderr" +) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: @@ -3025,19 +2986,15 @@ set +x $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 | eval $at_tee_pipe +) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_22 #AT_START_23 -# 23. DASTest.at:53: DAS $abs_srcdir/das-testsuite/test.26.das -at_setup_line='DASTest.at:53' -at_desc="DAS \$abs_srcdir/das-testsuite/test.26.das" -at_desc_line=" 23: $at_desc " -$at_quiet $as_echo_n "$at_desc_line" +at_fn_group_banner 23 'DASTest.at:53' \ + "DAS \$abs_srcdir/das-testsuite/test.26.das" " " at_xfail=no -echo "# -*- compilation -*-" >> "$at_group_log" ( - $as_echo "23. DASTest.at:53: testing ..." + $as_echo "23. $at_setup_line: testing $at_desc ..." $at_traceon @@ -3047,7 +3004,7 @@ $as_echo "$at_srcdir/DASTest.at:53: \$abs_builddir/das-test -p < \$abs_srcdir/das-testsuite/test.26.das || true" at_fn_check_prepare_dynamic "$abs_builddir/das-test -p < $abs_srcdir/das-testsuite/test.26.das || true" "DASTest.at:53" ( $at_check_trace; $abs_builddir/das-test -p < $abs_srcdir/das-testsuite/test.26.das || true -) >>"$at_stdout" 2>>"$at_stderr" +) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" @@ -3062,7 +3019,7 @@ $as_echo "$at_srcdir/DASTest.at:53: diff -b -B \$abs_srcdir/das-testsuite/test.26.das.base stdout || diff -b -B \$abs_srcdir/das-testsuite/test.26.das.base stderr" at_fn_check_prepare_dynamic "diff -b -B $abs_srcdir/das-testsuite/test.26.das.base stdout || diff -b -B $abs_srcdir/das-testsuite/test.26.das.base stderr" "DASTest.at:53" ( $at_check_trace; diff -b -B $abs_srcdir/das-testsuite/test.26.das.base stdout || diff -b -B $abs_srcdir/das-testsuite/test.26.das.base stderr -) >>"$at_stdout" 2>>"$at_stderr" +) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: @@ -3073,19 +3030,15 @@ set +x $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 | eval $at_tee_pipe +) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_23 #AT_START_24 -# 24. DASTest.at:54: DAS $abs_srcdir/das-testsuite/test.27.das -at_setup_line='DASTest.at:54' -at_desc="DAS \$abs_srcdir/das-testsuite/test.27.das" -at_desc_line=" 24: $at_desc " -$at_quiet $as_echo_n "$at_desc_line" +at_fn_group_banner 24 'DASTest.at:54' \ + "DAS \$abs_srcdir/das-testsuite/test.27.das" " " at_xfail=no -echo "# -*- compilation -*-" >> "$at_group_log" ( - $as_echo "24. DASTest.at:54: testing ..." + $as_echo "24. $at_setup_line: testing $at_desc ..." $at_traceon @@ -3095,7 +3048,7 @@ $as_echo "$at_srcdir/DASTest.at:54: \$abs_builddir/das-test -p < \$abs_srcdir/das-testsuite/test.27.das || true" at_fn_check_prepare_dynamic "$abs_builddir/das-test -p < $abs_srcdir/das-testsuite/test.27.das || true" "DASTest.at:54" ( $at_check_trace; $abs_builddir/das-test -p < $abs_srcdir/das-testsuite/test.27.das || true -) >>"$at_stdout" 2>>"$at_stderr" +) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" @@ -3110,7 +3063,7 @@ $as_echo "$at_srcdir/DASTest.at:54: diff -b -B \$abs_srcdir/das-testsuite/test.27.das.base stdout || diff -b -B \$abs_srcdir/das-testsuite/test.27.das.base stderr" at_fn_check_prepare_dynamic "diff -b -B $abs_srcdir/das-testsuite/test.27.das.base stdout || diff -b -B $abs_srcdir/das-testsuite/test.27.das.base stderr" "DASTest.at:54" ( $at_check_trace; diff -b -B $abs_srcdir/das-testsuite/test.27.das.base stdout || diff -b -B $abs_srcdir/das-testsuite/test.27.das.base stderr -) >>"$at_stdout" 2>>"$at_stderr" +) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: @@ -3121,19 +3074,15 @@ set +x $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 | eval $at_tee_pipe +) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_24 #AT_START_25 -# 25. DASTest.at:55: DAS $abs_srcdir/das-testsuite/test.28.das -at_setup_line='DASTest.at:55' -at_desc="DAS \$abs_srcdir/das-testsuite/test.28.das" -at_desc_line=" 25: $at_desc " -$at_quiet $as_echo_n "$at_desc_line" +at_fn_group_banner 25 'DASTest.at:55' \ + "DAS \$abs_srcdir/das-testsuite/test.28.das" " " at_xfail=no -echo "# -*- compilation -*-" >> "$at_group_log" ( - $as_echo "25. DASTest.at:55: testing ..." + $as_echo "25. $at_setup_line: testing $at_desc ..." $at_traceon @@ -3143,7 +3092,7 @@ $as_echo "$at_srcdir/DASTest.at:55: \$abs_builddir/das-test -p < \$abs_srcdir/das-testsuite/test.28.das || true" at_fn_check_prepare_dynamic "$abs_builddir/das-test -p < $abs_srcdir/das-testsuite/test.28.das || true" "DASTest.at:55" ( $at_check_trace; $abs_builddir/das-test -p < $abs_srcdir/das-testsuite/test.28.das || true -) >>"$at_stdout" 2>>"$at_stderr" +) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" @@ -3158,7 +3107,7 @@ $as_echo "$at_srcdir/DASTest.at:55: diff -b -B \$abs_srcdir/das-testsuite/test.28.das.base stdout || diff -b -B \$abs_srcdir/das-testsuite/test.28.das.base stderr" at_fn_check_prepare_dynamic "diff -b -B $abs_srcdir/das-testsuite/test.28.das.base stdout || diff -b -B $abs_srcdir/das-testsuite/test.28.das.base stderr" "DASTest.at:55" ( $at_check_trace; diff -b -B $abs_srcdir/das-testsuite/test.28.das.base stdout || diff -b -B $abs_srcdir/das-testsuite/test.28.das.base stderr -) >>"$at_stdout" 2>>"$at_stderr" +) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: @@ -3169,19 +3118,15 @@ set +x $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 | eval $at_tee_pipe +) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_25 #AT_START_26 -# 26. DASTest.at:56: DAS $abs_srcdir/das-testsuite/test.29.das -at_setup_line='DASTest.at:56' -at_desc="DAS \$abs_srcdir/das-testsuite/test.29.das" -at_desc_line=" 26: $at_desc " -$at_quiet $as_echo_n "$at_desc_line" +at_fn_group_banner 26 'DASTest.at:56' \ + "DAS \$abs_srcdir/das-testsuite/test.29.das" " " at_xfail=no -echo "# -*- compilation -*-" >> "$at_group_log" ( - $as_echo "26. DASTest.at:56: testing ..." + $as_echo "26. $at_setup_line: testing $at_desc ..." $at_traceon @@ -3191,7 +3136,7 @@ $as_echo "$at_srcdir/DASTest.at:56: \$abs_builddir/das-test -p < \$abs_srcdir/das-testsuite/test.29.das || true" at_fn_check_prepare_dynamic "$abs_builddir/das-test -p < $abs_srcdir/das-testsuite/test.29.das || true" "DASTest.at:56" ( $at_check_trace; $abs_builddir/das-test -p < $abs_srcdir/das-testsuite/test.29.das || true -) >>"$at_stdout" 2>>"$at_stderr" +) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" @@ -3206,7 +3151,7 @@ $as_echo "$at_srcdir/DASTest.at:56: diff -b -B \$abs_srcdir/das-testsuite/test.29.das.base stdout || diff -b -B \$abs_srcdir/das-testsuite/test.29.das.base stderr" at_fn_check_prepare_dynamic "diff -b -B $abs_srcdir/das-testsuite/test.29.das.base stdout || diff -b -B $abs_srcdir/das-testsuite/test.29.das.base stderr" "DASTest.at:56" ( $at_check_trace; diff -b -B $abs_srcdir/das-testsuite/test.29.das.base stdout || diff -b -B $abs_srcdir/das-testsuite/test.29.das.base stderr -) >>"$at_stdout" 2>>"$at_stderr" +) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: @@ -3217,19 +3162,15 @@ set +x $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 | eval $at_tee_pipe +) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_26 #AT_START_27 -# 27. DASTest.at:57: DAS $abs_srcdir/das-testsuite/test.3.das -at_setup_line='DASTest.at:57' -at_desc="DAS \$abs_srcdir/das-testsuite/test.3.das" -at_desc_line=" 27: $at_desc " -$at_quiet $as_echo_n "$at_desc_line" +at_fn_group_banner 27 'DASTest.at:57' \ + "DAS \$abs_srcdir/das-testsuite/test.3.das" " " at_xfail=no -echo "# -*- compilation -*-" >> "$at_group_log" ( - $as_echo "27. DASTest.at:57: testing ..." + $as_echo "27. $at_setup_line: testing $at_desc ..." $at_traceon @@ -3239,7 +3180,7 @@ $as_echo "$at_srcdir/DASTest.at:57: \$abs_builddir/das-test -p < \$abs_srcdir/das-testsuite/test.3.das || true" at_fn_check_prepare_dynamic "$abs_builddir/das-test -p < $abs_srcdir/das-testsuite/test.3.das || true" "DASTest.at:57" ( $at_check_trace; $abs_builddir/das-test -p < $abs_srcdir/das-testsuite/test.3.das || true -) >>"$at_stdout" 2>>"$at_stderr" +) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" @@ -3254,7 +3195,7 @@ $as_echo "$at_srcdir/DASTest.at:57: diff -b -B \$abs_srcdir/das-testsuite/test.3.das.base stdout || diff -b -B \$abs_srcdir/das-testsuite/test.3.das.base stderr" at_fn_check_prepare_dynamic "diff -b -B $abs_srcdir/das-testsuite/test.3.das.base stdout || diff -b -B $abs_srcdir/das-testsuite/test.3.das.base stderr" "DASTest.at:57" ( $at_check_trace; diff -b -B $abs_srcdir/das-testsuite/test.3.das.base stdout || diff -b -B $abs_srcdir/das-testsuite/test.3.das.base stderr -) >>"$at_stdout" 2>>"$at_stderr" +) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: @@ -3265,19 +3206,15 @@ set +x $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 | eval $at_tee_pipe +) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_27 #AT_START_28 -# 28. DASTest.at:58: DAS $abs_srcdir/das-testsuite/test.3.Z.das -at_setup_line='DASTest.at:58' -at_desc="DAS \$abs_srcdir/das-testsuite/test.3.Z.das" -at_desc_line=" 28: $at_desc " -$at_quiet $as_echo_n "$at_desc_line" +at_fn_group_banner 28 'DASTest.at:58' \ + "DAS \$abs_srcdir/das-testsuite/test.3.Z.das" " " at_xfail=no -echo "# -*- compilation -*-" >> "$at_group_log" ( - $as_echo "28. DASTest.at:58: testing ..." + $as_echo "28. $at_setup_line: testing $at_desc ..." $at_traceon @@ -3287,7 +3224,7 @@ $as_echo "$at_srcdir/DASTest.at:58: \$abs_builddir/das-test -p < \$abs_srcdir/das-testsuite/test.3.Z.das || true" at_fn_check_prepare_dynamic "$abs_builddir/das-test -p < $abs_srcdir/das-testsuite/test.3.Z.das || true" "DASTest.at:58" ( $at_check_trace; $abs_builddir/das-test -p < $abs_srcdir/das-testsuite/test.3.Z.das || true -) >>"$at_stdout" 2>>"$at_stderr" +) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" @@ -3302,7 +3239,7 @@ $as_echo "$at_srcdir/DASTest.at:58: diff -b -B \$abs_srcdir/das-testsuite/test.3.Z.das.base stdout || diff -b -B \$abs_srcdir/das-testsuite/test.3.Z.das.base stderr" at_fn_check_prepare_dynamic "diff -b -B $abs_srcdir/das-testsuite/test.3.Z.das.base stdout || diff -b -B $abs_srcdir/das-testsuite/test.3.Z.das.base stderr" "DASTest.at:58" ( $at_check_trace; diff -b -B $abs_srcdir/das-testsuite/test.3.Z.das.base stdout || diff -b -B $abs_srcdir/das-testsuite/test.3.Z.das.base stderr -) >>"$at_stdout" 2>>"$at_stderr" +) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: @@ -3313,19 +3250,15 @@ set +x $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 | eval $at_tee_pipe +) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_28 #AT_START_29 -# 29. DASTest.at:59: DAS $abs_srcdir/das-testsuite/test.30.das -at_setup_line='DASTest.at:59' -at_desc="DAS \$abs_srcdir/das-testsuite/test.30.das" -at_desc_line=" 29: $at_desc " -$at_quiet $as_echo_n "$at_desc_line" +at_fn_group_banner 29 'DASTest.at:59' \ + "DAS \$abs_srcdir/das-testsuite/test.30.das" " " at_xfail=no -echo "# -*- compilation -*-" >> "$at_group_log" ( - $as_echo "29. DASTest.at:59: testing ..." + $as_echo "29. $at_setup_line: testing $at_desc ..." $at_traceon @@ -3335,7 +3268,7 @@ $as_echo "$at_srcdir/DASTest.at:59: \$abs_builddir/das-test -p < \$abs_srcdir/das-testsuite/test.30.das || true" at_fn_check_prepare_dynamic "$abs_builddir/das-test -p < $abs_srcdir/das-testsuite/test.30.das || true" "DASTest.at:59" ( $at_check_trace; $abs_builddir/das-test -p < $abs_srcdir/das-testsuite/test.30.das || true -) >>"$at_stdout" 2>>"$at_stderr" +) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" @@ -3350,7 +3283,7 @@ $as_echo "$at_srcdir/DASTest.at:59: diff -b -B \$abs_srcdir/das-testsuite/test.30.das.base stdout || diff -b -B \$abs_srcdir/das-testsuite/test.30.das.base stderr" at_fn_check_prepare_dynamic "diff -b -B $abs_srcdir/das-testsuite/test.30.das.base stdout || diff -b -B $abs_srcdir/das-testsuite/test.30.das.base stderr" "DASTest.at:59" ( $at_check_trace; diff -b -B $abs_srcdir/das-testsuite/test.30.das.base stdout || diff -b -B $abs_srcdir/das-testsuite/test.30.das.base stderr -) >>"$at_stdout" 2>>"$at_stderr" +) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: @@ -3361,19 +3294,15 @@ set +x $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 | eval $at_tee_pipe +) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_29 #AT_START_30 -# 30. DASTest.at:60: DAS $abs_srcdir/das-testsuite/test.31.das -at_setup_line='DASTest.at:60' -at_desc="DAS \$abs_srcdir/das-testsuite/test.31.das" -at_desc_line=" 30: $at_desc " -$at_quiet $as_echo_n "$at_desc_line" +at_fn_group_banner 30 'DASTest.at:60' \ + "DAS \$abs_srcdir/das-testsuite/test.31.das" " " at_xfail=no -echo "# -*- compilation -*-" >> "$at_group_log" ( - $as_echo "30. DASTest.at:60: testing ..." + $as_echo "30. $at_setup_line: testing $at_desc ..." $at_traceon @@ -3383,7 +3312,7 @@ $as_echo "$at_srcdir/DASTest.at:60: \$abs_builddir/das-test -p < \$abs_srcdir/das-testsuite/test.31.das || true" at_fn_check_prepare_dynamic "$abs_builddir/das-test -p < $abs_srcdir/das-testsuite/test.31.das || true" "DASTest.at:60" ( $at_check_trace; $abs_builddir/das-test -p < $abs_srcdir/das-testsuite/test.31.das || true -) >>"$at_stdout" 2>>"$at_stderr" +) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" @@ -3398,7 +3327,7 @@ $as_echo "$at_srcdir/DASTest.at:60: diff -b -B \$abs_srcdir/das-testsuite/test.31.das.base stdout || diff -b -B \$abs_srcdir/das-testsuite/test.31.das.base stderr" at_fn_check_prepare_dynamic "diff -b -B $abs_srcdir/das-testsuite/test.31.das.base stdout || diff -b -B $abs_srcdir/das-testsuite/test.31.das.base stderr" "DASTest.at:60" ( $at_check_trace; diff -b -B $abs_srcdir/das-testsuite/test.31.das.base stdout || diff -b -B $abs_srcdir/das-testsuite/test.31.das.base stderr -) >>"$at_stdout" 2>>"$at_stderr" +) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: @@ -3409,19 +3338,15 @@ set +x $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 | eval $at_tee_pipe +) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_30 #AT_START_31 -# 31. DASTest.at:61: DAS $abs_srcdir/das-testsuite/test.32.das -at_setup_line='DASTest.at:61' -at_desc="DAS \$abs_srcdir/das-testsuite/test.32.das" -at_desc_line=" 31: $at_desc " -$at_quiet $as_echo_n "$at_desc_line" +at_fn_group_banner 31 'DASTest.at:61' \ + "DAS \$abs_srcdir/das-testsuite/test.32.das" " " at_xfail=no -echo "# -*- compilation -*-" >> "$at_group_log" ( - $as_echo "31. DASTest.at:61: testing ..." + $as_echo "31. $at_setup_line: testing $at_desc ..." $at_traceon @@ -3431,7 +3356,7 @@ $as_echo "$at_srcdir/DASTest.at:61: \$abs_builddir/das-test -p < \$abs_srcdir/das-testsuite/test.32.das || true" at_fn_check_prepare_dynamic "$abs_builddir/das-test -p < $abs_srcdir/das-testsuite/test.32.das || true" "DASTest.at:61" ( $at_check_trace; $abs_builddir/das-test -p < $abs_srcdir/das-testsuite/test.32.das || true -) >>"$at_stdout" 2>>"$at_stderr" +) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" @@ -3446,7 +3371,7 @@ $as_echo "$at_srcdir/DASTest.at:61: diff -b -B \$abs_srcdir/das-testsuite/test.32.das.base stdout || diff -b -B \$abs_srcdir/das-testsuite/test.32.das.base stderr" at_fn_check_prepare_dynamic "diff -b -B $abs_srcdir/das-testsuite/test.32.das.base stdout || diff -b -B $abs_srcdir/das-testsuite/test.32.das.base stderr" "DASTest.at:61" ( $at_check_trace; diff -b -B $abs_srcdir/das-testsuite/test.32.das.base stdout || diff -b -B $abs_srcdir/das-testsuite/test.32.das.base stderr -) >>"$at_stdout" 2>>"$at_stderr" +) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: @@ -3457,19 +3382,15 @@ set +x $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 | eval $at_tee_pipe +) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_31 #AT_START_32 -# 32. DASTest.at:62: DAS $abs_srcdir/das-testsuite/test.33.das -at_setup_line='DASTest.at:62' -at_desc="DAS \$abs_srcdir/das-testsuite/test.33.das" -at_desc_line=" 32: $at_desc " -$at_quiet $as_echo_n "$at_desc_line" +at_fn_group_banner 32 'DASTest.at:62' \ + "DAS \$abs_srcdir/das-testsuite/test.33.das" " " at_xfail=no -echo "# -*- compilation -*-" >> "$at_group_log" ( - $as_echo "32. DASTest.at:62: testing ..." + $as_echo "32. $at_setup_line: testing $at_desc ..." $at_traceon @@ -3479,7 +3400,7 @@ $as_echo "$at_srcdir/DASTest.at:62: \$abs_builddir/das-test -p < \$abs_srcdir/das-testsuite/test.33.das || true" at_fn_check_prepare_dynamic "$abs_builddir/das-test -p < $abs_srcdir/das-testsuite/test.33.das || true" "DASTest.at:62" ( $at_check_trace; $abs_builddir/das-test -p < $abs_srcdir/das-testsuite/test.33.das || true -) >>"$at_stdout" 2>>"$at_stderr" +) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" @@ -3494,7 +3415,7 @@ $as_echo "$at_srcdir/DASTest.at:62: diff -b -B \$abs_srcdir/das-testsuite/test.33.das.base stdout || diff -b -B \$abs_srcdir/das-testsuite/test.33.das.base stderr" at_fn_check_prepare_dynamic "diff -b -B $abs_srcdir/das-testsuite/test.33.das.base stdout || diff -b -B $abs_srcdir/das-testsuite/test.33.das.base stderr" "DASTest.at:62" ( $at_check_trace; diff -b -B $abs_srcdir/das-testsuite/test.33.das.base stdout || diff -b -B $abs_srcdir/das-testsuite/test.33.das.base stderr -) >>"$at_stdout" 2>>"$at_stderr" +) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: @@ -3505,19 +3426,15 @@ set +x $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 | eval $at_tee_pipe +) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_32 #AT_START_33 -# 33. DASTest.at:63: DAS $abs_srcdir/das-testsuite/test.34.das -at_setup_line='DASTest.at:63' -at_desc="DAS \$abs_srcdir/das-testsuite/test.34.das" -at_desc_line=" 33: $at_desc " -$at_quiet $as_echo_n "$at_desc_line" +at_fn_group_banner 33 'DASTest.at:63' \ + "DAS \$abs_srcdir/das-testsuite/test.34.das" " " at_xfail=no -echo "# -*- compilation -*-" >> "$at_group_log" ( - $as_echo "33. DASTest.at:63: testing ..." + $as_echo "33. $at_setup_line: testing $at_desc ..." $at_traceon @@ -3527,7 +3444,7 @@ $as_echo "$at_srcdir/DASTest.at:63: \$abs_builddir/das-test -p < \$abs_srcdir/das-testsuite/test.34.das || true" at_fn_check_prepare_dynamic "$abs_builddir/das-test -p < $abs_srcdir/das-testsuite/test.34.das || true" "DASTest.at:63" ( $at_check_trace; $abs_builddir/das-test -p < $abs_srcdir/das-testsuite/test.34.das || true -) >>"$at_stdout" 2>>"$at_stderr" +) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" @@ -3542,7 +3459,7 @@ $as_echo "$at_srcdir/DASTest.at:63: diff -b -B \$abs_srcdir/das-testsuite/test.34.das.base stdout || diff -b -B \$abs_srcdir/das-testsuite/test.34.das.base stderr" at_fn_check_prepare_dynamic "diff -b -B $abs_srcdir/das-testsuite/test.34.das.base stdout || diff -b -B $abs_srcdir/das-testsuite/test.34.das.base stderr" "DASTest.at:63" ( $at_check_trace; diff -b -B $abs_srcdir/das-testsuite/test.34.das.base stdout || diff -b -B $abs_srcdir/das-testsuite/test.34.das.base stderr -) >>"$at_stdout" 2>>"$at_stderr" +) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: @@ -3553,19 +3470,15 @@ set +x $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 | eval $at_tee_pipe +) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_33 #AT_START_34 -# 34. DASTest.at:64: DAS $abs_srcdir/das-testsuite/test.35.das -at_setup_line='DASTest.at:64' -at_desc="DAS \$abs_srcdir/das-testsuite/test.35.das" -at_desc_line=" 34: $at_desc " -$at_quiet $as_echo_n "$at_desc_line" +at_fn_group_banner 34 'DASTest.at:64' \ + "DAS \$abs_srcdir/das-testsuite/test.35.das" " " at_xfail=no -echo "# -*- compilation -*-" >> "$at_group_log" ( - $as_echo "34. DASTest.at:64: testing ..." + $as_echo "34. $at_setup_line: testing $at_desc ..." $at_traceon @@ -3575,7 +3488,7 @@ $as_echo "$at_srcdir/DASTest.at:64: \$abs_builddir/das-test -p < \$abs_srcdir/das-testsuite/test.35.das || true" at_fn_check_prepare_dynamic "$abs_builddir/das-test -p < $abs_srcdir/das-testsuite/test.35.das || true" "DASTest.at:64" ( $at_check_trace; $abs_builddir/das-test -p < $abs_srcdir/das-testsuite/test.35.das || true -) >>"$at_stdout" 2>>"$at_stderr" +) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" @@ -3590,7 +3503,7 @@ $as_echo "$at_srcdir/DASTest.at:64: diff -b -B \$abs_srcdir/das-testsuite/test.35.das.base stdout || diff -b -B \$abs_srcdir/das-testsuite/test.35.das.base stderr" at_fn_check_prepare_dynamic "diff -b -B $abs_srcdir/das-testsuite/test.35.das.base stdout || diff -b -B $abs_srcdir/das-testsuite/test.35.das.base stderr" "DASTest.at:64" ( $at_check_trace; diff -b -B $abs_srcdir/das-testsuite/test.35.das.base stdout || diff -b -B $abs_srcdir/das-testsuite/test.35.das.base stderr -) >>"$at_stdout" 2>>"$at_stderr" +) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: @@ -3601,19 +3514,15 @@ set +x $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 | eval $at_tee_pipe +) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_34 #AT_START_35 -# 35. DASTest.at:65: DAS $abs_srcdir/das-testsuite/test.4.das -at_setup_line='DASTest.at:65' -at_desc="DAS \$abs_srcdir/das-testsuite/test.4.das" -at_desc_line=" 35: $at_desc " -$at_quiet $as_echo_n "$at_desc_line" +at_fn_group_banner 35 'DASTest.at:65' \ + "DAS \$abs_srcdir/das-testsuite/test.4.das" " " at_xfail=no -echo "# -*- compilation -*-" >> "$at_group_log" ( - $as_echo "35. DASTest.at:65: testing ..." + $as_echo "35. $at_setup_line: testing $at_desc ..." $at_traceon @@ -3623,7 +3532,7 @@ $as_echo "$at_srcdir/DASTest.at:65: \$abs_builddir/das-test -p < \$abs_srcdir/das-testsuite/test.4.das || true" at_fn_check_prepare_dynamic "$abs_builddir/das-test -p < $abs_srcdir/das-testsuite/test.4.das || true" "DASTest.at:65" ( $at_check_trace; $abs_builddir/das-test -p < $abs_srcdir/das-testsuite/test.4.das || true -) >>"$at_stdout" 2>>"$at_stderr" +) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" @@ -3638,7 +3547,7 @@ $as_echo "$at_srcdir/DASTest.at:65: diff -b -B \$abs_srcdir/das-testsuite/test.4.das.base stdout || diff -b -B \$abs_srcdir/das-testsuite/test.4.das.base stderr" at_fn_check_prepare_dynamic "diff -b -B $abs_srcdir/das-testsuite/test.4.das.base stdout || diff -b -B $abs_srcdir/das-testsuite/test.4.das.base stderr" "DASTest.at:65" ( $at_check_trace; diff -b -B $abs_srcdir/das-testsuite/test.4.das.base stdout || diff -b -B $abs_srcdir/das-testsuite/test.4.das.base stderr -) >>"$at_stdout" 2>>"$at_stderr" +) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: @@ -3649,19 +3558,15 @@ set +x $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 | eval $at_tee_pipe +) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_35 #AT_START_36 -# 36. DASTest.at:66: DAS $abs_srcdir/das-testsuite/test.5.das -at_setup_line='DASTest.at:66' -at_desc="DAS \$abs_srcdir/das-testsuite/test.5.das" -at_desc_line=" 36: $at_desc " -$at_quiet $as_echo_n "$at_desc_line" +at_fn_group_banner 36 'DASTest.at:66' \ + "DAS \$abs_srcdir/das-testsuite/test.5.das" " " at_xfail=no -echo "# -*- compilation -*-" >> "$at_group_log" ( - $as_echo "36. DASTest.at:66: testing ..." + $as_echo "36. $at_setup_line: testing $at_desc ..." $at_traceon @@ -3671,7 +3576,7 @@ $as_echo "$at_srcdir/DASTest.at:66: \$abs_builddir/das-test -p < \$abs_srcdir/das-testsuite/test.5.das || true" at_fn_check_prepare_dynamic "$abs_builddir/das-test -p < $abs_srcdir/das-testsuite/test.5.das || true" "DASTest.at:66" ( $at_check_trace; $abs_builddir/das-test -p < $abs_srcdir/das-testsuite/test.5.das || true -) >>"$at_stdout" 2>>"$at_stderr" +) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" @@ -3686,7 +3591,7 @@ $as_echo "$at_srcdir/DASTest.at:66: diff -b -B \$abs_srcdir/das-testsuite/test.5.das.base stdout || diff -b -B \$abs_srcdir/das-testsuite/test.5.das.base stderr" at_fn_check_prepare_dynamic "diff -b -B $abs_srcdir/das-testsuite/test.5.das.base stdout || diff -b -B $abs_srcdir/das-testsuite/test.5.das.base stderr" "DASTest.at:66" ( $at_check_trace; diff -b -B $abs_srcdir/das-testsuite/test.5.das.base stdout || diff -b -B $abs_srcdir/das-testsuite/test.5.das.base stderr -) >>"$at_stdout" 2>>"$at_stderr" +) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: @@ -3697,19 +3602,15 @@ set +x $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 | eval $at_tee_pipe +) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_36 #AT_START_37 -# 37. DASTest.at:67: DAS $abs_srcdir/das-testsuite/test.6.das -at_setup_line='DASTest.at:67' -at_desc="DAS \$abs_srcdir/das-testsuite/test.6.das" -at_desc_line=" 37: $at_desc " -$at_quiet $as_echo_n "$at_desc_line" +at_fn_group_banner 37 'DASTest.at:67' \ + "DAS \$abs_srcdir/das-testsuite/test.6.das" " " at_xfail=no -echo "# -*- compilation -*-" >> "$at_group_log" ( - $as_echo "37. DASTest.at:67: testing ..." + $as_echo "37. $at_setup_line: testing $at_desc ..." $at_traceon @@ -3719,7 +3620,7 @@ $as_echo "$at_srcdir/DASTest.at:67: \$abs_builddir/das-test -p < \$abs_srcdir/das-testsuite/test.6.das || true" at_fn_check_prepare_dynamic "$abs_builddir/das-test -p < $abs_srcdir/das-testsuite/test.6.das || true" "DASTest.at:67" ( $at_check_trace; $abs_builddir/das-test -p < $abs_srcdir/das-testsuite/test.6.das || true -) >>"$at_stdout" 2>>"$at_stderr" +) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" @@ -3734,7 +3635,7 @@ $as_echo "$at_srcdir/DASTest.at:67: diff -b -B \$abs_srcdir/das-testsuite/test.6.das.base stdout || diff -b -B \$abs_srcdir/das-testsuite/test.6.das.base stderr" at_fn_check_prepare_dynamic "diff -b -B $abs_srcdir/das-testsuite/test.6.das.base stdout || diff -b -B $abs_srcdir/das-testsuite/test.6.das.base stderr" "DASTest.at:67" ( $at_check_trace; diff -b -B $abs_srcdir/das-testsuite/test.6.das.base stdout || diff -b -B $abs_srcdir/das-testsuite/test.6.das.base stderr -) >>"$at_stdout" 2>>"$at_stderr" +) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: @@ -3745,19 +3646,15 @@ set +x $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 | eval $at_tee_pipe +) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_37 #AT_START_38 -# 38. DASTest.at:68: DAS $abs_srcdir/das-testsuite/test.7.das -at_setup_line='DASTest.at:68' -at_desc="DAS \$abs_srcdir/das-testsuite/test.7.das" -at_desc_line=" 38: $at_desc " -$at_quiet $as_echo_n "$at_desc_line" +at_fn_group_banner 38 'DASTest.at:68' \ + "DAS \$abs_srcdir/das-testsuite/test.7.das" " " at_xfail=no -echo "# -*- compilation -*-" >> "$at_group_log" ( - $as_echo "38. DASTest.at:68: testing ..." + $as_echo "38. $at_setup_line: testing $at_desc ..." $at_traceon @@ -3767,7 +3664,7 @@ $as_echo "$at_srcdir/DASTest.at:68: \$abs_builddir/das-test -p < \$abs_srcdir/das-testsuite/test.7.das || true" at_fn_check_prepare_dynamic "$abs_builddir/das-test -p < $abs_srcdir/das-testsuite/test.7.das || true" "DASTest.at:68" ( $at_check_trace; $abs_builddir/das-test -p < $abs_srcdir/das-testsuite/test.7.das || true -) >>"$at_stdout" 2>>"$at_stderr" +) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" @@ -3782,7 +3679,7 @@ $as_echo "$at_srcdir/DASTest.at:68: diff -b -B \$abs_srcdir/das-testsuite/test.7.das.base stdout || diff -b -B \$abs_srcdir/das-testsuite/test.7.das.base stderr" at_fn_check_prepare_dynamic "diff -b -B $abs_srcdir/das-testsuite/test.7.das.base stdout || diff -b -B $abs_srcdir/das-testsuite/test.7.das.base stderr" "DASTest.at:68" ( $at_check_trace; diff -b -B $abs_srcdir/das-testsuite/test.7.das.base stdout || diff -b -B $abs_srcdir/das-testsuite/test.7.das.base stderr -) >>"$at_stdout" 2>>"$at_stderr" +) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: @@ -3793,19 +3690,15 @@ set +x $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 | eval $at_tee_pipe +) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_38 #AT_START_39 -# 39. DASTest.at:69: DAS $abs_srcdir/das-testsuite/test.8.das -at_setup_line='DASTest.at:69' -at_desc="DAS \$abs_srcdir/das-testsuite/test.8.das" -at_desc_line=" 39: $at_desc " -$at_quiet $as_echo_n "$at_desc_line" +at_fn_group_banner 39 'DASTest.at:69' \ + "DAS \$abs_srcdir/das-testsuite/test.8.das" " " at_xfail=no -echo "# -*- compilation -*-" >> "$at_group_log" ( - $as_echo "39. DASTest.at:69: testing ..." + $as_echo "39. $at_setup_line: testing $at_desc ..." $at_traceon @@ -3815,7 +3708,7 @@ $as_echo "$at_srcdir/DASTest.at:69: \$abs_builddir/das-test -p < \$abs_srcdir/das-testsuite/test.8.das || true" at_fn_check_prepare_dynamic "$abs_builddir/das-test -p < $abs_srcdir/das-testsuite/test.8.das || true" "DASTest.at:69" ( $at_check_trace; $abs_builddir/das-test -p < $abs_srcdir/das-testsuite/test.8.das || true -) >>"$at_stdout" 2>>"$at_stderr" +) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" @@ -3830,7 +3723,7 @@ $as_echo "$at_srcdir/DASTest.at:69: diff -b -B \$abs_srcdir/das-testsuite/test.8.das.base stdout || diff -b -B \$abs_srcdir/das-testsuite/test.8.das.base stderr" at_fn_check_prepare_dynamic "diff -b -B $abs_srcdir/das-testsuite/test.8.das.base stdout || diff -b -B $abs_srcdir/das-testsuite/test.8.das.base stderr" "DASTest.at:69" ( $at_check_trace; diff -b -B $abs_srcdir/das-testsuite/test.8.das.base stdout || diff -b -B $abs_srcdir/das-testsuite/test.8.das.base stderr -) >>"$at_stdout" 2>>"$at_stderr" +) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: @@ -3841,19 +3734,15 @@ set +x $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 | eval $at_tee_pipe +) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_39 #AT_START_40 -# 40. DASTest.at:70: DAS $abs_srcdir/das-testsuite/test.9.das -at_setup_line='DASTest.at:70' -at_desc="DAS \$abs_srcdir/das-testsuite/test.9.das" -at_desc_line=" 40: $at_desc " -$at_quiet $as_echo_n "$at_desc_line" +at_fn_group_banner 40 'DASTest.at:70' \ + "DAS \$abs_srcdir/das-testsuite/test.9.das" " " at_xfail=no -echo "# -*- compilation -*-" >> "$at_group_log" ( - $as_echo "40. DASTest.at:70: testing ..." + $as_echo "40. $at_setup_line: testing $at_desc ..." $at_traceon @@ -3863,7 +3752,7 @@ $as_echo "$at_srcdir/DASTest.at:70: \$abs_builddir/das-test -p < \$abs_srcdir/das-testsuite/test.9.das || true" at_fn_check_prepare_dynamic "$abs_builddir/das-test -p < $abs_srcdir/das-testsuite/test.9.das || true" "DASTest.at:70" ( $at_check_trace; $abs_builddir/das-test -p < $abs_srcdir/das-testsuite/test.9.das || true -) >>"$at_stdout" 2>>"$at_stderr" +) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" @@ -3878,7 +3767,7 @@ $as_echo "$at_srcdir/DASTest.at:70: diff -b -B \$abs_srcdir/das-testsuite/test.9.das.base stdout || diff -b -B \$abs_srcdir/das-testsuite/test.9.das.base stderr" at_fn_check_prepare_dynamic "diff -b -B $abs_srcdir/das-testsuite/test.9.das.base stdout || diff -b -B $abs_srcdir/das-testsuite/test.9.das.base stderr" "DASTest.at:70" ( $at_check_trace; diff -b -B $abs_srcdir/das-testsuite/test.9.das.base stdout || diff -b -B $abs_srcdir/das-testsuite/test.9.das.base stderr -) >>"$at_stdout" 2>>"$at_stderr" +) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: @@ -3889,6 +3778,6 @@ set +x $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 | eval $at_tee_pipe +) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_40 diff -Nru libdap-3.11.1/tests/DDSTest libdap-3.12.0/tests/DDSTest --- libdap-3.11.1/tests/DDSTest 2011-05-06 15:28:46.000000000 +0000 +++ libdap-3.12.0/tests/DDSTest 2013-10-17 21:27:40.000000000 +0000 @@ -1,7 +1,7 @@ #! /bin/sh -# Generated from DDSTest.at by GNU Autoconf 2.65. +# Generated from DDSTest.at by GNU Autoconf 2.69. # -# Copyright (C) 2009 Free Software Foundation, Inc. +# Copyright (C) 2009-2012 Free Software Foundation, Inc. # # This test suite is free software; the Free Software Foundation gives # unlimited permission to copy, distribute and modify it. @@ -84,6 +84,7 @@ IFS=" "" $as_nl" # Find who we are. Look in the path if we contain no directory separator. +as_myself= case $0 in #(( *[\\/]* ) as_myself=$0 ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR @@ -161,7 +162,8 @@ else exitcode=1; echo positional parameters were not saved. fi -test x\$exitcode = x0 || exit 1" +test x\$exitcode = x0 || exit 1 +test -x / || exit 1" as_suggested=" as_lineno_1=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_1a=\$LINENO as_lineno_2=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_2a=\$LINENO eval 'test \"x\$as_lineno_1'\$as_run'\" != \"x\$as_lineno_2'\$as_run'\" && @@ -206,14 +208,25 @@ if test "x$CONFIG_SHELL" != x; then : - # We cannot yet assume a decent shell, so we have to provide a - # neutralization value for shells without unset; and this also - # works around shells that cannot unset nonexistent variables. - BASH_ENV=/dev/null - ENV=/dev/null - (unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV - export CONFIG_SHELL - exec "$CONFIG_SHELL" "$as_myself" ${1+"$@"} + export CONFIG_SHELL + # We cannot yet assume a decent shell, so we have to provide a +# neutralization value for shells without unset; and this also +# works around shells that cannot unset nonexistent variables. +# Preserve -v and -x to the replacement shell. +BASH_ENV=/dev/null +ENV=/dev/null +(unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV +case $- in # (((( + *v*x* | *x*v* ) as_opts=-vx ;; + *v* ) as_opts=-v ;; + *x* ) as_opts=-x ;; + * ) as_opts= ;; +esac +exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"} +# Admittedly, this is quite paranoid, since all the known shells bail +# out after a failed `exec'. +$as_echo "$0: could not re-execute with $CONFIG_SHELL" >&2 +exit 255 fi if test x$as_have_required = xno; then : @@ -311,10 +324,18 @@ test -d "$as_dir" && break done test -z "$as_dirs" || eval "mkdir $as_dirs" - } || test -d "$as_dir" || as_fn_error "cannot create directory $as_dir" + } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir" } # as_fn_mkdir_p + +# as_fn_executable_p FILE +# ----------------------- +# Test if FILE is an executable regular file. +as_fn_executable_p () +{ + test -f "$1" && test -x "$1" +} # as_fn_executable_p # as_fn_append VAR VALUE # ---------------------- # Append the text in VALUE to the end of the definition contained in VAR. Take @@ -351,19 +372,19 @@ fi # as_fn_arith -# as_fn_error ERROR [LINENO LOG_FD] -# --------------------------------- +# as_fn_error STATUS ERROR [LINENO LOG_FD] +# ---------------------------------------- # Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are # provided, also output the error to LOG_FD, referencing LINENO. Then exit the -# script with status $?, using 1 if that was 0. +# script with STATUS, using 1 if that was 0. as_fn_error () { - as_status=$?; test $as_status -eq 0 && as_status=1 - if test "$3"; then - as_lineno=${as_lineno-"$2"} as_lineno_stack=as_lineno_stack=$as_lineno_stack - $as_echo "$as_me:${as_lineno-$LINENO}: error: $1" >&$3 + as_status=$1; test $as_status -eq 0 && as_status=1 + if test "$4"; then + as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4 fi - $as_echo "$as_me: error: $1" >&2 + $as_echo "$as_me: error: $2" >&2 as_fn_exit $as_status } # as_fn_error @@ -436,6 +457,10 @@ chmod +x "$as_me.lineno" || { $as_echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2; as_fn_exit 1; } + # If we had to re-execute with $CONFIG_SHELL, we're ensured to have + # already done that, so ensure we don't try to do so again and fall + # in an infinite loop. This has already happened in practice. + _as_can_reexec=no; export _as_can_reexec # Don't try to exec as it changes $[0], causing all sort of problems # (the dirname of $[0] is not the place where we might find the # original and so on. Autoconf is especially sensitive to this). @@ -470,16 +495,16 @@ # ... but there are two gotchas: # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. - # In both cases, we have to default to `cp -p'. + # In both cases, we have to default to `cp -pR'. ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || - as_ln_s='cp -p' + as_ln_s='cp -pR' elif ln conf$$.file conf$$ 2>/dev/null; then as_ln_s=ln else - as_ln_s='cp -p' + as_ln_s='cp -pR' fi else - as_ln_s='cp -p' + as_ln_s='cp -pR' fi rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file rmdir conf$$.dir 2>/dev/null @@ -491,28 +516,8 @@ as_mkdir_p=false fi -if test -x / >/dev/null 2>&1; then - as_test_x='test -x' -else - if ls -dL / >/dev/null 2>&1; then - as_ls_L_option=L - else - as_ls_L_option= - fi - as_test_x=' - eval sh -c '\'' - if test -d "$1"; then - test -d "$1/."; - else - case $1 in #( - -*)set "./$1";; - esac; - case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in #(( - ???[sx]*):;;*)false;;esac;fi - '\'' sh - ' -fi -as_executable_p=$as_test_x +as_test_x='test -x' +as_executable_p=as_fn_executable_p # Sed expression to map a string onto a valid CPP name. as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" @@ -561,6 +566,8 @@ at_clean=false # Test groups to run at_groups= +# Whether to rerun failed tests. +at_recheck= # Whether a write failure occurred at_write_fail=0 @@ -574,10 +581,10 @@ # Whether -C is in effect. at_change_dir=false +# Whether to enable colored test results. +at_color=no # List of the tested programs. at_tested='' -# List of the all the test groups. -at_groups_all=' 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29' # As many question marks as there are digits in the last test group number. # Used to normalize the test group numbers so that `ls' lists them in # numerical order. @@ -613,6 +620,8 @@ 28;DDSTest.at:61;DDS \$abs_srcdir/dds-testsuite/test.8.dds;dds; 29;DDSTest.at:62;DDS \$abs_srcdir/dds-testsuite/test.9.dds;dds; " +# List of the all the test groups. +at_groups_all=`$as_echo "$at_help_all" | sed 's/;.*//'` # at_fn_validate_ranges NAME... # ----------------------------- @@ -648,8 +657,8 @@ fi case $at_option in - *=*) at_optarg=`expr "x$at_option" : 'x[^=]*=\(.*\)'` ;; - *) at_optarg= ;; + *=?*) at_optarg=`expr "X$at_option" : '[^=]*=\(.*\)'` ;; + *) at_optarg= ;; esac # Accept the important Cygnus configure options, so we can diagnose typos. @@ -671,6 +680,19 @@ at_clean=: ;; + --color ) + at_color=always + ;; + --color=* ) + case $at_optarg in + no | never | none) at_color=never ;; + auto | tty | if-tty) at_color=auto ;; + always | yes | force) at_color=always ;; + *) at_optname=`echo " $at_option" | sed 's/^ //; s/=.*//'` + as_fn_error $? "unrecognized argument to $at_optname: $at_optarg" ;; + esac + ;; + --debug | -d ) at_debug_p=: ;; @@ -692,24 +714,24 @@ [0-9] | [0-9][0-9] | [0-9][0-9][0-9] | [0-9][0-9][0-9][0-9]) at_fn_validate_ranges at_option - as_fn_append at_groups "$at_option " + as_fn_append at_groups "$at_option$as_nl" ;; # Ranges [0-9]- | [0-9][0-9]- | [0-9][0-9][0-9]- | [0-9][0-9][0-9][0-9]-) at_range_start=`echo $at_option |tr -d X-` at_fn_validate_ranges at_range_start - at_range=`$as_echo " $at_groups_all " | \ - sed -e 's/^.* \('$at_range_start' \)/\1/'` - as_fn_append at_groups "$at_range " + at_range=`$as_echo "$at_groups_all" | \ + sed -ne '/^'$at_range_start'$/,$p'` + as_fn_append at_groups "$at_range$as_nl" ;; -[0-9] | -[0-9][0-9] | -[0-9][0-9][0-9] | -[0-9][0-9][0-9][0-9]) at_range_end=`echo $at_option |tr -d X-` at_fn_validate_ranges at_range_end - at_range=`$as_echo " $at_groups_all " | \ - sed -e 's/\( '$at_range_end'\) .*$/\1/'` - as_fn_append at_groups "$at_range " + at_range=`$as_echo "$at_groups_all" | \ + sed -ne '1,/^'$at_range_end'$/p'` + as_fn_append at_groups "$at_range$as_nl" ;; [0-9]-[0-9] | [0-9]-[0-9][0-9] | [0-9]-[0-9][0-9][0-9] | \ @@ -726,10 +748,9 @@ at_range_start=$at_tmp fi at_fn_validate_ranges at_range_start at_range_end - at_range=`$as_echo " $at_groups_all " | \ - sed -e 's/^.*\( '$at_range_start' \)/\1/' \ - -e 's/\( '$at_range_end'\) .*$/\1/'` - as_fn_append at_groups "$at_range " + at_range=`$as_echo "$at_groups_all" | \ + sed -ne '/^'$at_range_start'$/,/^'$at_range_end'$/p'` + as_fn_append at_groups "$at_range$as_nl" ;; # Directory selection. @@ -739,6 +760,9 @@ --directory=* ) at_change_dir=: at_dir=$at_optarg + if test x- = "x$at_dir" ; then + at_dir=./- + fi ;; # Parallel execution. @@ -753,7 +777,7 @@ fi case $at_jobs in *[!0-9]*) at_optname=`echo " $at_option" | sed 's/^ //; s/[0-9=].*//'` - as_fn_error "non-numeric argument to $at_optname: $at_jobs" ;; + as_fn_error $? "non-numeric argument to $at_optname: $at_jobs" ;; esac ;; @@ -781,11 +805,12 @@ at_groups_selected=`$as_echo "$at_groups_selected" | grep -i $at_invert "^[1-9][^;]*;.*[; ]$at_keyword[ ;]"` done - # Smash the newlines. - at_groups_selected=`$as_echo "$at_groups_selected" | sed 's/;.*//' | - tr "$as_nl" ' ' - ` - as_fn_append at_groups "$at_groups_selected " + # Smash the keywords. + at_groups_selected=`$as_echo "$at_groups_selected" | sed 's/;.*//'` + as_fn_append at_groups "$at_groups_selected$as_nl" + ;; + --recheck) + at_recheck=: ;; *=*) @@ -793,7 +818,7 @@ # Reject names that are not valid shell variable names. case $at_envvar in '' | [0-9]* | *[!_$as_cr_alnum]* ) - as_fn_error "invalid variable name: \`$at_envvar'" ;; + as_fn_error $? "invalid variable name: \`$at_envvar'" ;; esac at_value=`$as_echo "$at_optarg" | sed "s/'/'\\\\\\\\''/g"` # Export now, but save eval for later and for debug scripts. @@ -810,15 +835,41 @@ # Verify our last option didn't require an argument if test -n "$at_prev"; then : - as_fn_error "\`$at_prev' requires an argument." + as_fn_error $? "\`$at_prev' requires an argument" fi +# The file containing the suite. +at_suite_log=$at_dir/$as_me.log + # Selected test groups. -if test -z "$at_groups"; then +if test -z "$at_groups$at_recheck"; then at_groups=$at_groups_all else + if test -n "$at_recheck" && test -r "$at_suite_log"; then + at_oldfails=`sed -n ' + /^Failed tests:$/,/^Skipped tests:$/{ + s/^[ ]*\([1-9][0-9]*\):.*/\1/p + } + /^Unexpected passes:$/,/^## Detailed failed tests/{ + s/^[ ]*\([1-9][0-9]*\):.*/\1/p + } + /^## Detailed failed tests/q + ' "$at_suite_log"` + as_fn_append at_groups "$at_oldfails$as_nl" + fi # Sort the tests, removing duplicates. - at_groups=`$as_echo "$at_groups" | tr ' ' "$as_nl" | sort -nu` + at_groups=`$as_echo "$at_groups" | sort -nu | sed '/^$/d'` +fi + +if test x"$at_color" = xalways \ + || { test x"$at_color" = xauto && test -t 1; }; then + at_red=`printf '\033[0;31m'` + at_grn=`printf '\033[0;32m'` + at_lgn=`printf '\033[1;32m'` + at_blu=`printf '\033[1;34m'` + at_std=`printf '\033[m'` +else + at_red= at_grn= at_lgn= at_blu= at_std= fi # Help message. @@ -854,11 +905,14 @@ Execution tuning: -C, --directory=DIR change to directory DIR before starting + --color[=never|auto|always] + enable colored test results on terminal, or always -j, --jobs[=N] Allow N jobs at once; infinite jobs with no arg (default 1) -k, --keywords=KEYWORDS select the tests matching all the comma-separated KEYWORDS multiple \`-k' accumulate; prefixed \`!' negates a KEYWORD + --recheck select all tests that failed or passed unexpectedly last time -e, --errexit abort as soon as a test fails; implies --debug -v, --verbose force more detailed output default for debugging scripts @@ -876,27 +930,19 @@ # List of tests. if $at_list_p; then cat <<_ATEOF || at_write_fail=1 -libdap 3.11.1 test suite: dds-test test groups: +libdap 3.12.0 test suite: dds-test test groups: NUM: FILE-NAME:LINE TEST-GROUP-NAME KEYWORDS _ATEOF - # Passing at_groups is tricky. We cannot use it to form a literal string - # or regexp because of the limitation of AIX awk. And Solaris' awk - # doesn't grok more than 99 fields in a record, so we have to use `split'. - # at_groups needs to be space-separated for this script to work. - case $at_groups in - *"$as_nl"* ) - at_groups=`$as_echo "$at_groups" | tr "$as_nl" ' '` ;; - esac - $as_echo "$at_groups$as_nl$at_help_all" | - awk 'BEGIN { FS = ";" } - NR == 1 { - for (n = split ($ 0, a, " "); n; n--) - selected[a[n]] = 1 + # Pass an empty line as separator between selected groups and help. + $as_echo "$at_groups$as_nl$as_nl$at_help_all" | + awk 'NF == 1 && FS != ";" { + selected[$ 1] = 1 next } + /^$/ { FS = ";" } NF > 0 { if (selected[$ 1]) { printf " %3d: %-18s %s\n", $ 1, $ 2, $ 3 @@ -925,32 +971,28 @@ exit $at_write_fail fi if $at_version_p; then - $as_echo "$as_me (libdap 3.11.1)" && + $as_echo "$as_me (libdap 3.12.0)" && cat <<\_ATEOF || at_write_fail=1 -Copyright (C) 2009 Free Software Foundation, Inc. +Copyright (C) 2012 Free Software Foundation, Inc. This test suite is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it. _ATEOF exit $at_write_fail fi -# Should we print banners? at_groups is space-separated for entire test, -# newline-separated if only a subset of the testsuite is run. -case $at_groups in - *' '*' '* | *"$as_nl"*"$as_nl"* ) - at_print_banners=: ;; +# Should we print banners? Yes if more than one test is run. +case $at_groups in #( + *$as_nl* ) + at_print_banners=: ;; #( * ) at_print_banners=false ;; esac -# Text for banner N, set to empty once printed. +# Text for banner N, set to a single space once printed. # Take any -C into account. if $at_change_dir ; then - if test x- = "x$at_dir" ; then - at_dir=./- - fi test x != "x$at_dir" && cd "$at_dir" \ - || as_fn_error "unable to change directory" + || as_fn_error $? "unable to change directory" at_dir=`pwd` fi @@ -958,11 +1000,11 @@ for at_file in atconfig atlocal do test -r $at_file || continue - . ./$at_file || as_fn_error "invalid content: $at_file" + . ./$at_file || as_fn_error $? "invalid content: $at_file" done # Autoconf <=2.59b set at_top_builddir instead of at_top_build_prefix: -: ${at_top_build_prefix=$at_top_builddir} +: "${at_top_build_prefix=$at_top_builddir}" # Perform any assignments requested during argument parsing. eval "$at_debug_args" @@ -1015,7 +1057,7 @@ # The directory the whole suite works in. # Should be absolute to let the user `cd' at will. at_suite_dir=$at_dir/$as_me.dir -# The file containing the suite. +# The file containing the suite ($at_dir might have changed since earlier). at_suite_log=$at_dir/$as_me.log # The directory containing helper files per test group. at_helper_dir=$at_suite_dir/at-groups @@ -1095,6 +1137,7 @@ # Setting up the FDs. + # 5 is the log file. Not to be overwritten if `-d'. if $at_debug_p; then at_suite_log=/dev/null @@ -1104,43 +1147,28 @@ exec 5>>"$at_suite_log" # Banners and logs. -cat <<\_ASBOX -## ----------------------------------- ## -## libdap 3.11.1 test suite: dds-test. ## -## ----------------------------------- ## -_ASBOX -{ - cat <<\_ASBOX -## ----------------------------------- ## -## libdap 3.11.1 test suite: dds-test. ## -## ----------------------------------- ## -_ASBOX +$as_echo "## ----------------------------------- ## +## libdap 3.12.0 test suite: dds-test. ## +## ----------------------------------- ##" +{ + $as_echo "## ----------------------------------- ## +## libdap 3.12.0 test suite: dds-test. ## +## ----------------------------------- ##" echo $as_echo "$as_me: command line was:" $as_echo " \$ $0 $at_cli_args" echo - # Try to find a few ChangeLogs in case it might help determining the - # exact version. Use the relative dir: if the top dir is a symlink, - # find will not follow it (and options to follow the links are not - # portable), which would result in no output here. Prune directories - # matching the package tarname, since they tend to be leftovers from - # `make dist' or `make distcheck' and contain redundant or stale logs. - if test -n "$at_top_srcdir"; then - cat <<\_ASBOX -## ----------- ## -## ChangeLogs. ## -## ----------- ## -_ASBOX + # If ChangeLog exists, list a few lines in case it might help determining + # the exact version. + if test -n "$at_top_srcdir" && test -f "$at_top_srcdir/ChangeLog"; then + $as_echo "## ---------- ## +## ChangeLog. ## +## ---------- ##" + echo + sed 's/^/| /;10q' "$at_top_srcdir/ChangeLog" echo - for at_file in `find "$at_top_srcdir" -name "libdap-*" -prune -o -name ChangeLog -print` - do - $as_echo "$as_me: $at_file:" - sed 's/^/| /;10q' $at_file - echo - done - fi { @@ -1203,9 +1231,13 @@ { $at_print_banners || return 0 eval at_banner_text=\$at_banner_text_$1 - test "x$at_banner_text" = x && return 0 - eval at_banner_text_$1= - $as_echo "$as_nl$at_banner_text$as_nl" + test "x$at_banner_text" = "x " && return 0 + eval "at_banner_text_$1=\" \"" + if test -z "$at_banner_text"; then + $at_first || echo + else + $as_echo "$as_nl$at_banner_text$as_nl" + fi } # at_fn_banner # at_fn_check_prepare_notrace REASON LINE @@ -1339,11 +1371,9 @@ ## End of autotest shell functions. ## ## -------------------------------- ## { - cat <<\_ASBOX -## ---------------- ## + $as_echo "## ---------------- ## ## Tested programs. ## -## ---------------- ## -_ASBOX +## ---------------- ##" echo } >&5 @@ -1372,16 +1402,14 @@ echo } >&5 2>&1 else - as_fn_error "cannot find $at_program" "$LINENO" 5 + as_fn_error $? "cannot find $at_program" "$LINENO" 5 fi done { - cat <<\_ASBOX -## ------------------ ## + $as_echo "## ------------------ ## ## Running the tests. ## -## ------------------ ## -_ASBOX +## ------------------ ##" } >&5 at_start_date=`date` @@ -1390,7 +1418,7 @@ # Create the master directory if it doesn't already exist. as_dir="$at_suite_dir"; as_fn_mkdir_p || - as_fn_error "cannot create \`$at_suite_dir'" "$LINENO" 5 + as_fn_error $? "cannot create \`$at_suite_dir'" "$LINENO" 5 # Can we diff with `/dev/null'? DU 5.0 refuses. if diff /dev/null /dev/null >/dev/null 2>&1; then @@ -1424,7 +1452,7 @@ if (test == "'"$at_group"'") exit }' "$at_myself" > "$at_suite_dir/at-source-lines" && . "$at_suite_dir/at-source-lines" || - as_fn_error "cannot create test line number cache" "$LINENO" 5 + as_fn_error $? "cannot create test line number cache" "$LINENO" 5 rm -f "$at_suite_dir/at-source-lines" # Set number of jobs for `-j'; avoid more jobs than test groups. @@ -1448,7 +1476,7 @@ mkdir "$at_helper_dir" && cd "$at_helper_dir" && { test -z "$at_groups" || mkdir $at_groups; } || -as_fn_error "testsuite directory setup failed" "$LINENO" 5 +as_fn_error $? "testsuite directory setup failed" "$LINENO" 5 # Functions for running a test group. We leave the actual # test group execution outside of a shell function in order @@ -1456,7 +1484,7 @@ # at_fn_group_prepare # ------------------- -# Prepare running a test group. +# Prepare for running a test group. at_fn_group_prepare () { # The directory for additional per-group helper files. @@ -1501,8 +1529,8 @@ find "$at_group_dir" -type d ! -perm -700 -exec chmod u+rwx {} \; rm -fr "$at_group_dir"/* "$at_group_dir"/.[!.] "$at_group_dir"/.??* fi || - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: test directory for $at_group_normalized could not be cleaned." >&5 -$as_echo "$as_me: WARNING: test directory for $at_group_normalized could not be cleaned." >&2;} + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: test directory for $at_group_normalized could not be cleaned" >&5 +$as_echo "$as_me: WARNING: test directory for $at_group_normalized could not be cleaned" >&2;} # Be tolerant if the above `rm' was not able to remove the directory. as_dir="$at_group_dir"; as_fn_mkdir_p @@ -1517,6 +1545,25 @@ fi } +# at_fn_group_banner ORDINAL LINE DESC PAD [BANNER] +# ------------------------------------------------- +# Declare the test group ORDINAL, located at LINE with group description DESC, +# and residing under BANNER. Use PAD to align the status column. +at_fn_group_banner () +{ + at_setup_line="$2" + test -n "$5" && at_fn_banner $5 + at_desc="$3" + case $1 in + [0-9]) at_desc_line=" $1: ";; + [0-9][0-9]) at_desc_line=" $1: " ;; + *) at_desc_line="$1: " ;; + esac + as_fn_append at_desc_line "$3$4" + $at_quiet $as_echo_n "$at_desc_line" + echo "# -*- compilation -*-" >> "$at_group_log" +} + # at_fn_group_postprocess # ----------------------- # Perform cleanup after running a test group. @@ -1538,44 +1585,44 @@ $at_verbose $as_echo_n "$at_group. $at_setup_line: " $as_echo_n "$at_group. $at_setup_line: " >> "$at_group_log" case $at_xfail:$at_status in - *:99) - at_msg='FAILED ('`cat "$at_check_line_file"`')' - at_res=fail - at_errexit=$at_errexit_p - ;; yes:0) at_msg="UNEXPECTED PASS" at_res=xpass at_errexit=$at_errexit_p + at_color=$at_red ;; no:0) at_msg="ok" at_res=pass at_errexit=false + at_color=$at_grn ;; *:77) at_msg='skipped ('`cat "$at_check_line_file"`')' at_res=skip at_errexit=false + at_color=$at_blu + ;; + no:* | *:99) + at_msg='FAILED ('`cat "$at_check_line_file"`')' + at_res=fail + at_errexit=$at_errexit_p + at_color=$at_red ;; yes:*) at_msg='expected failure ('`cat "$at_check_line_file"`')' at_res=xfail at_errexit=false - ;; - no:*) - at_msg='FAILED ('`cat "$at_check_line_file"`')' - at_res=fail - at_errexit=$at_errexit_p + at_color=$at_lgn ;; esac echo "$at_res" > "$at_job_dir/$at_res" # In parallel mode, output the summary line only afterwards. if test $at_jobs -ne 1 && test -n "$at_verbose"; then - $as_echo "$at_desc_line $at_msg" + $as_echo "$at_desc_line $at_color$at_msg$at_std" else # Make sure there is a separator even with long titles. - $as_echo " $at_msg" + $as_echo " $at_color$at_msg$at_std" fi at_log_msg="$at_group. $at_desc ($at_setup_line): $at_msg" case $at_status in @@ -1591,9 +1638,13 @@ $as_echo "$at_log_msg" >> "$at_group_log" $as_echo "$at_log_msg" >&5 - # Cleanup the group directory, unless the user wants the files. - if $at_debug_p; then + # Cleanup the group directory, unless the user wants the files + # or the success was unexpected. + if $at_debug_p || test $at_res = xpass; then at_fn_create_debugging_script + if test $at_res = xpass && $at_errexit; then + echo stop > "$at_stop_file" + fi else if test -d "$at_group_dir"; then find "$at_group_dir" -type d ! -perm -700 -exec chmod u+rwx \{\} \; @@ -1679,8 +1730,7 @@ echo # Turn jobs into a list of numbers, starting from 1. - at_joblist=`$as_echo " $at_groups_all " | \ - sed 's/\( '$at_jobs'\) .*/\1/'` + at_joblist=`$as_echo "$at_groups" | sed -n 1,${at_jobs}p` set X $at_joblist shift @@ -1689,28 +1739,32 @@ ( # Start one test group. $at_job_control_off - exec 6>"$at_job_fifo" + if $at_first; then + exec 7>"$at_job_fifo" + else + exec 6<&- + fi trap 'set +x; set +e trap "" PIPE echo stop > "$at_stop_file" - echo token >&6 + echo >&7 as_fn_exit 141' PIPE at_fn_group_prepare if cd "$at_group_dir" && at_fn_test $at_group && - . "$at_test_source" # AT_JOB_FIFO_FD>&- + . "$at_test_source" then :; else { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: unable to parse test group: $at_group" >&5 $as_echo "$as_me: WARNING: unable to parse test group: $at_group" >&2;} at_failed=: fi at_fn_group_postprocess - echo token >&6 + echo >&7 ) & $at_job_control_off if $at_first; then at_first=false - exec 6<"$at_job_fifo" + exec 6<"$at_job_fifo" 7>"$at_job_fifo" fi shift # Consume one token. if test $# -gt 0; then :; else @@ -1719,6 +1773,7 @@ fi test -f "$at_stop_file" && break done + exec 7>&- # Read back the remaining ($at_jobs - 1) tokens. set X $at_joblist shift @@ -1792,19 +1847,15 @@ esac echo -cat <<\_ASBOX -## ------------- ## +$as_echo "## ------------- ## ## Test results. ## -## ------------- ## -_ASBOX +## ------------- ##" echo { echo - cat <<\_ASBOX -## ------------- ## + $as_echo "## ------------- ## ## Test results. ## -## ------------- ## -_ASBOX +## ------------- ##" echo } >&5 @@ -1822,12 +1873,14 @@ at_result="$at_result $at_were run, one failed" fi at_result="$at_result unexpectedly and inhibited subsequent tests." + at_color=$at_red else # Don't you just love exponential explosion of the number of cases? + at_color=$at_red case $at_xpass_count:$at_fail_count:$at_xfail_count in # So far, so good. - 0:0:0) at_result="$at_result $at_were successful." ;; - 0:0:*) at_result="$at_result behaved as expected." ;; + 0:0:0) at_result="$at_result $at_were successful." at_color=$at_grn ;; + 0:0:*) at_result="$at_result behaved as expected." at_color=$at_lgn ;; # Some unexpected failures 0:*:0) at_result="$at_result $at_were run, @@ -1873,18 +1926,16 @@ esac if test $at_unexpected_count = 0; then - echo "$at_result" + echo "$at_color$at_result$at_std" echo "$at_result" >&5 else - echo "ERROR: $at_result" >&2 + echo "${at_color}ERROR: $at_result$at_std" >&2 echo "ERROR: $at_result" >&5 { echo - cat <<\_ASBOX -## ------------------------ ## + $as_echo "## ------------------------ ## ## Summary of the failures. ## -## ------------------------ ## -_ASBOX +## ------------------------ ##" # Summary of failed and skipped tests. if test $at_fail_count != 0; then @@ -1903,11 +1954,9 @@ echo fi if test $at_fail_count != 0; then - cat <<\_ASBOX -## ---------------------- ## + $as_echo "## ---------------------- ## ## Detailed failed tests. ## -## ---------------------- ## -_ASBOX +## ---------------------- ##" echo for at_group in $at_fail_list do @@ -1947,7 +1996,7 @@ $as_echo "Please send $at_msg and all information you think might help: To: - Subject: [libdap 3.11.1] $as_me: $at_fail_list${at_fail_list:+ failed${at_xpass_list:+, }}$at_xpass_list${at_xpass_list:+ passed unexpectedly} + Subject: [libdap 3.12.0] $as_me: $at_fail_list${at_fail_list:+ failed${at_xpass_list:+, }}$at_xpass_list${at_xpass_list:+ passed unexpectedly} You may investigate any problem if you feel able to do so, in which case the test suite provides a good starting point. Its output may @@ -1962,15 +2011,11 @@ ## Actual tests. ## ## ------------- ## #AT_START_1 -# 1. DDSTest.at:34: DDS $abs_srcdir/dds-testsuite/3B42.980909.5.hacked.HDF.das.dds -at_setup_line='DDSTest.at:34' -at_desc="DDS \$abs_srcdir/dds-testsuite/3B42.980909.5.hacked.HDF.das.dds" -at_desc_line=" 1: $at_desc" -$at_quiet $as_echo_n "$at_desc_line" +at_fn_group_banner 1 'DDSTest.at:34' \ + "DDS \$abs_srcdir/dds-testsuite/3B42.980909.5.hacked.HDF.das.dds" "" at_xfail=no -echo "# -*- compilation -*-" >> "$at_group_log" ( - $as_echo "1. DDSTest.at:34: testing ..." + $as_echo "1. $at_setup_line: testing $at_desc ..." $at_traceon @@ -1980,7 +2025,7 @@ $as_echo "$at_srcdir/DDSTest.at:34: \$abs_builddir/dds-test -p < \$abs_srcdir/dds-testsuite/3B42.980909.5.hacked.HDF.das.dds || true" at_fn_check_prepare_dynamic "$abs_builddir/dds-test -p < $abs_srcdir/dds-testsuite/3B42.980909.5.hacked.HDF.das.dds || true" "DDSTest.at:34" ( $at_check_trace; $abs_builddir/dds-test -p < $abs_srcdir/dds-testsuite/3B42.980909.5.hacked.HDF.das.dds || true -) >>"$at_stdout" 2>>"$at_stderr" +) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" @@ -1995,7 +2040,7 @@ $as_echo "$at_srcdir/DDSTest.at:34: diff -b -B \$abs_srcdir/dds-testsuite/3B42.980909.5.hacked.HDF.das.dds.base stdout || diff -b -B \$abs_srcdir/dds-testsuite/3B42.980909.5.hacked.HDF.das.dds.base stderr" at_fn_check_prepare_dynamic "diff -b -B $abs_srcdir/dds-testsuite/3B42.980909.5.hacked.HDF.das.dds.base stdout || diff -b -B $abs_srcdir/dds-testsuite/3B42.980909.5.hacked.HDF.das.dds.base stderr" "DDSTest.at:34" ( $at_check_trace; diff -b -B $abs_srcdir/dds-testsuite/3B42.980909.5.hacked.HDF.das.dds.base stdout || diff -b -B $abs_srcdir/dds-testsuite/3B42.980909.5.hacked.HDF.das.dds.base stderr -) >>"$at_stdout" 2>>"$at_stderr" +) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: @@ -2006,19 +2051,15 @@ set +x $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 | eval $at_tee_pipe +) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_1 #AT_START_2 -# 2. DDSTest.at:35: DDS $abs_srcdir/dds-testsuite/3B42.980909.5.HDF.das.dds -at_setup_line='DDSTest.at:35' -at_desc="DDS \$abs_srcdir/dds-testsuite/3B42.980909.5.HDF.das.dds" -at_desc_line=" 2: $at_desc" -$at_quiet $as_echo_n "$at_desc_line" +at_fn_group_banner 2 'DDSTest.at:35' \ + "DDS \$abs_srcdir/dds-testsuite/3B42.980909.5.HDF.das.dds" "" at_xfail=no -echo "# -*- compilation -*-" >> "$at_group_log" ( - $as_echo "2. DDSTest.at:35: testing ..." + $as_echo "2. $at_setup_line: testing $at_desc ..." $at_traceon @@ -2028,7 +2069,7 @@ $as_echo "$at_srcdir/DDSTest.at:35: \$abs_builddir/dds-test -p < \$abs_srcdir/dds-testsuite/3B42.980909.5.HDF.das.dds || true" at_fn_check_prepare_dynamic "$abs_builddir/dds-test -p < $abs_srcdir/dds-testsuite/3B42.980909.5.HDF.das.dds || true" "DDSTest.at:35" ( $at_check_trace; $abs_builddir/dds-test -p < $abs_srcdir/dds-testsuite/3B42.980909.5.HDF.das.dds || true -) >>"$at_stdout" 2>>"$at_stderr" +) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" @@ -2043,7 +2084,7 @@ $as_echo "$at_srcdir/DDSTest.at:35: diff -b -B \$abs_srcdir/dds-testsuite/3B42.980909.5.HDF.das.dds.base stdout || diff -b -B \$abs_srcdir/dds-testsuite/3B42.980909.5.HDF.das.dds.base stderr" at_fn_check_prepare_dynamic "diff -b -B $abs_srcdir/dds-testsuite/3B42.980909.5.HDF.das.dds.base stdout || diff -b -B $abs_srcdir/dds-testsuite/3B42.980909.5.HDF.das.dds.base stderr" "DDSTest.at:35" ( $at_check_trace; diff -b -B $abs_srcdir/dds-testsuite/3B42.980909.5.HDF.das.dds.base stdout || diff -b -B $abs_srcdir/dds-testsuite/3B42.980909.5.HDF.das.dds.base stderr -) >>"$at_stdout" 2>>"$at_stderr" +) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: @@ -2054,19 +2095,15 @@ set +x $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 | eval $at_tee_pipe +) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_2 #AT_START_3 -# 3. DDSTest.at:36: DDS $abs_srcdir/dds-testsuite/3B42.980909.5.HDF.dds -at_setup_line='DDSTest.at:36' -at_desc="DDS \$abs_srcdir/dds-testsuite/3B42.980909.5.HDF.dds" -at_desc_line=" 3: $at_desc" -$at_quiet $as_echo_n "$at_desc_line" +at_fn_group_banner 3 'DDSTest.at:36' \ + "DDS \$abs_srcdir/dds-testsuite/3B42.980909.5.HDF.dds" "" at_xfail=no -echo "# -*- compilation -*-" >> "$at_group_log" ( - $as_echo "3. DDSTest.at:36: testing ..." + $as_echo "3. $at_setup_line: testing $at_desc ..." $at_traceon @@ -2076,7 +2113,7 @@ $as_echo "$at_srcdir/DDSTest.at:36: \$abs_builddir/dds-test -p < \$abs_srcdir/dds-testsuite/3B42.980909.5.HDF.dds || true" at_fn_check_prepare_dynamic "$abs_builddir/dds-test -p < $abs_srcdir/dds-testsuite/3B42.980909.5.HDF.dds || true" "DDSTest.at:36" ( $at_check_trace; $abs_builddir/dds-test -p < $abs_srcdir/dds-testsuite/3B42.980909.5.HDF.dds || true -) >>"$at_stdout" 2>>"$at_stderr" +) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" @@ -2091,7 +2128,7 @@ $as_echo "$at_srcdir/DDSTest.at:36: diff -b -B \$abs_srcdir/dds-testsuite/3B42.980909.5.HDF.dds.base stdout || diff -b -B \$abs_srcdir/dds-testsuite/3B42.980909.5.HDF.dds.base stderr" at_fn_check_prepare_dynamic "diff -b -B $abs_srcdir/dds-testsuite/3B42.980909.5.HDF.dds.base stdout || diff -b -B $abs_srcdir/dds-testsuite/3B42.980909.5.HDF.dds.base stderr" "DDSTest.at:36" ( $at_check_trace; diff -b -B $abs_srcdir/dds-testsuite/3B42.980909.5.HDF.dds.base stdout || diff -b -B $abs_srcdir/dds-testsuite/3B42.980909.5.HDF.dds.base stderr -) >>"$at_stdout" 2>>"$at_stderr" +) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: @@ -2102,19 +2139,15 @@ set +x $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 | eval $at_tee_pipe +) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_3 #AT_START_4 -# 4. DDSTest.at:37: DDS $abs_srcdir/dds-testsuite/AsciiOutputTest1.dds -at_setup_line='DDSTest.at:37' -at_desc="DDS \$abs_srcdir/dds-testsuite/AsciiOutputTest1.dds" -at_desc_line=" 4: $at_desc" -$at_quiet $as_echo_n "$at_desc_line" +at_fn_group_banner 4 'DDSTest.at:37' \ + "DDS \$abs_srcdir/dds-testsuite/AsciiOutputTest1.dds" "" at_xfail=no -echo "# -*- compilation -*-" >> "$at_group_log" ( - $as_echo "4. DDSTest.at:37: testing ..." + $as_echo "4. $at_setup_line: testing $at_desc ..." $at_traceon @@ -2124,7 +2157,7 @@ $as_echo "$at_srcdir/DDSTest.at:37: \$abs_builddir/dds-test -p < \$abs_srcdir/dds-testsuite/AsciiOutputTest1.dds || true" at_fn_check_prepare_dynamic "$abs_builddir/dds-test -p < $abs_srcdir/dds-testsuite/AsciiOutputTest1.dds || true" "DDSTest.at:37" ( $at_check_trace; $abs_builddir/dds-test -p < $abs_srcdir/dds-testsuite/AsciiOutputTest1.dds || true -) >>"$at_stdout" 2>>"$at_stderr" +) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" @@ -2139,7 +2172,7 @@ $as_echo "$at_srcdir/DDSTest.at:37: diff -b -B \$abs_srcdir/dds-testsuite/AsciiOutputTest1.dds.base stdout || diff -b -B \$abs_srcdir/dds-testsuite/AsciiOutputTest1.dds.base stderr" at_fn_check_prepare_dynamic "diff -b -B $abs_srcdir/dds-testsuite/AsciiOutputTest1.dds.base stdout || diff -b -B $abs_srcdir/dds-testsuite/AsciiOutputTest1.dds.base stderr" "DDSTest.at:37" ( $at_check_trace; diff -b -B $abs_srcdir/dds-testsuite/AsciiOutputTest1.dds.base stdout || diff -b -B $abs_srcdir/dds-testsuite/AsciiOutputTest1.dds.base stderr -) >>"$at_stdout" 2>>"$at_stderr" +) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: @@ -2150,19 +2183,15 @@ set +x $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 | eval $at_tee_pipe +) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_4 #AT_START_5 -# 5. DDSTest.at:38: DDS $abs_srcdir/dds-testsuite/fnoc1.nc.das.dds -at_setup_line='DDSTest.at:38' -at_desc="DDS \$abs_srcdir/dds-testsuite/fnoc1.nc.das.dds" -at_desc_line=" 5: $at_desc " -$at_quiet $as_echo_n "$at_desc_line" +at_fn_group_banner 5 'DDSTest.at:38' \ + "DDS \$abs_srcdir/dds-testsuite/fnoc1.nc.das.dds" " " at_xfail=no -echo "# -*- compilation -*-" >> "$at_group_log" ( - $as_echo "5. DDSTest.at:38: testing ..." + $as_echo "5. $at_setup_line: testing $at_desc ..." $at_traceon @@ -2172,7 +2201,7 @@ $as_echo "$at_srcdir/DDSTest.at:38: \$abs_builddir/dds-test -p < \$abs_srcdir/dds-testsuite/fnoc1.nc.das.dds || true" at_fn_check_prepare_dynamic "$abs_builddir/dds-test -p < $abs_srcdir/dds-testsuite/fnoc1.nc.das.dds || true" "DDSTest.at:38" ( $at_check_trace; $abs_builddir/dds-test -p < $abs_srcdir/dds-testsuite/fnoc1.nc.das.dds || true -) >>"$at_stdout" 2>>"$at_stderr" +) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" @@ -2187,7 +2216,7 @@ $as_echo "$at_srcdir/DDSTest.at:38: diff -b -B \$abs_srcdir/dds-testsuite/fnoc1.nc.das.dds.base stdout || diff -b -B \$abs_srcdir/dds-testsuite/fnoc1.nc.das.dds.base stderr" at_fn_check_prepare_dynamic "diff -b -B $abs_srcdir/dds-testsuite/fnoc1.nc.das.dds.base stdout || diff -b -B $abs_srcdir/dds-testsuite/fnoc1.nc.das.dds.base stderr" "DDSTest.at:38" ( $at_check_trace; diff -b -B $abs_srcdir/dds-testsuite/fnoc1.nc.das.dds.base stdout || diff -b -B $abs_srcdir/dds-testsuite/fnoc1.nc.das.dds.base stderr -) >>"$at_stdout" 2>>"$at_stderr" +) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: @@ -2198,19 +2227,15 @@ set +x $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 | eval $at_tee_pipe +) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_5 #AT_START_6 -# 6. DDSTest.at:39: DDS $abs_srcdir/dds-testsuite/fnoc1.nc.dds -at_setup_line='DDSTest.at:39' -at_desc="DDS \$abs_srcdir/dds-testsuite/fnoc1.nc.dds" -at_desc_line=" 6: $at_desc " -$at_quiet $as_echo_n "$at_desc_line" +at_fn_group_banner 6 'DDSTest.at:39' \ + "DDS \$abs_srcdir/dds-testsuite/fnoc1.nc.dds" " " at_xfail=no -echo "# -*- compilation -*-" >> "$at_group_log" ( - $as_echo "6. DDSTest.at:39: testing ..." + $as_echo "6. $at_setup_line: testing $at_desc ..." $at_traceon @@ -2220,7 +2245,7 @@ $as_echo "$at_srcdir/DDSTest.at:39: \$abs_builddir/dds-test -p < \$abs_srcdir/dds-testsuite/fnoc1.nc.dds || true" at_fn_check_prepare_dynamic "$abs_builddir/dds-test -p < $abs_srcdir/dds-testsuite/fnoc1.nc.dds || true" "DDSTest.at:39" ( $at_check_trace; $abs_builddir/dds-test -p < $abs_srcdir/dds-testsuite/fnoc1.nc.dds || true -) >>"$at_stdout" 2>>"$at_stderr" +) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" @@ -2235,7 +2260,7 @@ $as_echo "$at_srcdir/DDSTest.at:39: diff -b -B \$abs_srcdir/dds-testsuite/fnoc1.nc.dds.base stdout || diff -b -B \$abs_srcdir/dds-testsuite/fnoc1.nc.dds.base stderr" at_fn_check_prepare_dynamic "diff -b -B $abs_srcdir/dds-testsuite/fnoc1.nc.dds.base stdout || diff -b -B $abs_srcdir/dds-testsuite/fnoc1.nc.dds.base stderr" "DDSTest.at:39" ( $at_check_trace; diff -b -B $abs_srcdir/dds-testsuite/fnoc1.nc.dds.base stdout || diff -b -B $abs_srcdir/dds-testsuite/fnoc1.nc.dds.base stderr -) >>"$at_stdout" 2>>"$at_stderr" +) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: @@ -2246,19 +2271,15 @@ set +x $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 | eval $at_tee_pipe +) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_6 #AT_START_7 -# 7. DDSTest.at:40: DDS $abs_srcdir/dds-testsuite/S2000415.HDF.das.dds -at_setup_line='DDSTest.at:40' -at_desc="DDS \$abs_srcdir/dds-testsuite/S2000415.HDF.das.dds" -at_desc_line=" 7: $at_desc" -$at_quiet $as_echo_n "$at_desc_line" +at_fn_group_banner 7 'DDSTest.at:40' \ + "DDS \$abs_srcdir/dds-testsuite/S2000415.HDF.das.dds" "" at_xfail=no -echo "# -*- compilation -*-" >> "$at_group_log" ( - $as_echo "7. DDSTest.at:40: testing ..." + $as_echo "7. $at_setup_line: testing $at_desc ..." $at_traceon @@ -2268,7 +2289,7 @@ $as_echo "$at_srcdir/DDSTest.at:40: \$abs_builddir/dds-test -p < \$abs_srcdir/dds-testsuite/S2000415.HDF.das.dds || true" at_fn_check_prepare_dynamic "$abs_builddir/dds-test -p < $abs_srcdir/dds-testsuite/S2000415.HDF.das.dds || true" "DDSTest.at:40" ( $at_check_trace; $abs_builddir/dds-test -p < $abs_srcdir/dds-testsuite/S2000415.HDF.das.dds || true -) >>"$at_stdout" 2>>"$at_stderr" +) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" @@ -2283,7 +2304,7 @@ $as_echo "$at_srcdir/DDSTest.at:40: diff -b -B \$abs_srcdir/dds-testsuite/S2000415.HDF.das.dds.base stdout || diff -b -B \$abs_srcdir/dds-testsuite/S2000415.HDF.das.dds.base stderr" at_fn_check_prepare_dynamic "diff -b -B $abs_srcdir/dds-testsuite/S2000415.HDF.das.dds.base stdout || diff -b -B $abs_srcdir/dds-testsuite/S2000415.HDF.das.dds.base stderr" "DDSTest.at:40" ( $at_check_trace; diff -b -B $abs_srcdir/dds-testsuite/S2000415.HDF.das.dds.base stdout || diff -b -B $abs_srcdir/dds-testsuite/S2000415.HDF.das.dds.base stderr -) >>"$at_stdout" 2>>"$at_stderr" +) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: @@ -2294,19 +2315,15 @@ set +x $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 | eval $at_tee_pipe +) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_7 #AT_START_8 -# 8. DDSTest.at:41: DDS $abs_srcdir/dds-testsuite/S2000415.HDF.dds -at_setup_line='DDSTest.at:41' -at_desc="DDS \$abs_srcdir/dds-testsuite/S2000415.HDF.dds" -at_desc_line=" 8: $at_desc " -$at_quiet $as_echo_n "$at_desc_line" +at_fn_group_banner 8 'DDSTest.at:41' \ + "DDS \$abs_srcdir/dds-testsuite/S2000415.HDF.dds" " " at_xfail=no -echo "# -*- compilation -*-" >> "$at_group_log" ( - $as_echo "8. DDSTest.at:41: testing ..." + $as_echo "8. $at_setup_line: testing $at_desc ..." $at_traceon @@ -2316,7 +2333,7 @@ $as_echo "$at_srcdir/DDSTest.at:41: \$abs_builddir/dds-test -p < \$abs_srcdir/dds-testsuite/S2000415.HDF.dds || true" at_fn_check_prepare_dynamic "$abs_builddir/dds-test -p < $abs_srcdir/dds-testsuite/S2000415.HDF.dds || true" "DDSTest.at:41" ( $at_check_trace; $abs_builddir/dds-test -p < $abs_srcdir/dds-testsuite/S2000415.HDF.dds || true -) >>"$at_stdout" 2>>"$at_stderr" +) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" @@ -2331,7 +2348,7 @@ $as_echo "$at_srcdir/DDSTest.at:41: diff -b -B \$abs_srcdir/dds-testsuite/S2000415.HDF.dds.base stdout || diff -b -B \$abs_srcdir/dds-testsuite/S2000415.HDF.dds.base stderr" at_fn_check_prepare_dynamic "diff -b -B $abs_srcdir/dds-testsuite/S2000415.HDF.dds.base stdout || diff -b -B $abs_srcdir/dds-testsuite/S2000415.HDF.dds.base stderr" "DDSTest.at:41" ( $at_check_trace; diff -b -B $abs_srcdir/dds-testsuite/S2000415.HDF.dds.base stdout || diff -b -B $abs_srcdir/dds-testsuite/S2000415.HDF.dds.base stderr -) >>"$at_stdout" 2>>"$at_stderr" +) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: @@ -2342,19 +2359,15 @@ set +x $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 | eval $at_tee_pipe +) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_8 #AT_START_9 -# 9. DDSTest.at:42: DDS $abs_srcdir/dds-testsuite/test.1.dds -at_setup_line='DDSTest.at:42' -at_desc="DDS \$abs_srcdir/dds-testsuite/test.1.dds" -at_desc_line=" 9: $at_desc " -$at_quiet $as_echo_n "$at_desc_line" +at_fn_group_banner 9 'DDSTest.at:42' \ + "DDS \$abs_srcdir/dds-testsuite/test.1.dds" " " at_xfail=no -echo "# -*- compilation -*-" >> "$at_group_log" ( - $as_echo "9. DDSTest.at:42: testing ..." + $as_echo "9. $at_setup_line: testing $at_desc ..." $at_traceon @@ -2364,7 +2377,7 @@ $as_echo "$at_srcdir/DDSTest.at:42: \$abs_builddir/dds-test -p < \$abs_srcdir/dds-testsuite/test.1.dds || true" at_fn_check_prepare_dynamic "$abs_builddir/dds-test -p < $abs_srcdir/dds-testsuite/test.1.dds || true" "DDSTest.at:42" ( $at_check_trace; $abs_builddir/dds-test -p < $abs_srcdir/dds-testsuite/test.1.dds || true -) >>"$at_stdout" 2>>"$at_stderr" +) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" @@ -2379,7 +2392,7 @@ $as_echo "$at_srcdir/DDSTest.at:42: diff -b -B \$abs_srcdir/dds-testsuite/test.1.dds.base stdout || diff -b -B \$abs_srcdir/dds-testsuite/test.1.dds.base stderr" at_fn_check_prepare_dynamic "diff -b -B $abs_srcdir/dds-testsuite/test.1.dds.base stdout || diff -b -B $abs_srcdir/dds-testsuite/test.1.dds.base stderr" "DDSTest.at:42" ( $at_check_trace; diff -b -B $abs_srcdir/dds-testsuite/test.1.dds.base stdout || diff -b -B $abs_srcdir/dds-testsuite/test.1.dds.base stderr -) >>"$at_stdout" 2>>"$at_stderr" +) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: @@ -2390,19 +2403,15 @@ set +x $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 | eval $at_tee_pipe +) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_9 #AT_START_10 -# 10. DDSTest.at:43: DDS $abs_srcdir/dds-testsuite/test.10.dds -at_setup_line='DDSTest.at:43' -at_desc="DDS \$abs_srcdir/dds-testsuite/test.10.dds" -at_desc_line=" 10: $at_desc " -$at_quiet $as_echo_n "$at_desc_line" +at_fn_group_banner 10 'DDSTest.at:43' \ + "DDS \$abs_srcdir/dds-testsuite/test.10.dds" " " at_xfail=no -echo "# -*- compilation -*-" >> "$at_group_log" ( - $as_echo "10. DDSTest.at:43: testing ..." + $as_echo "10. $at_setup_line: testing $at_desc ..." $at_traceon @@ -2412,7 +2421,7 @@ $as_echo "$at_srcdir/DDSTest.at:43: \$abs_builddir/dds-test -p < \$abs_srcdir/dds-testsuite/test.10.dds || true" at_fn_check_prepare_dynamic "$abs_builddir/dds-test -p < $abs_srcdir/dds-testsuite/test.10.dds || true" "DDSTest.at:43" ( $at_check_trace; $abs_builddir/dds-test -p < $abs_srcdir/dds-testsuite/test.10.dds || true -) >>"$at_stdout" 2>>"$at_stderr" +) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" @@ -2427,7 +2436,7 @@ $as_echo "$at_srcdir/DDSTest.at:43: diff -b -B \$abs_srcdir/dds-testsuite/test.10.dds.base stdout || diff -b -B \$abs_srcdir/dds-testsuite/test.10.dds.base stderr" at_fn_check_prepare_dynamic "diff -b -B $abs_srcdir/dds-testsuite/test.10.dds.base stdout || diff -b -B $abs_srcdir/dds-testsuite/test.10.dds.base stderr" "DDSTest.at:43" ( $at_check_trace; diff -b -B $abs_srcdir/dds-testsuite/test.10.dds.base stdout || diff -b -B $abs_srcdir/dds-testsuite/test.10.dds.base stderr -) >>"$at_stdout" 2>>"$at_stderr" +) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: @@ -2438,19 +2447,15 @@ set +x $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 | eval $at_tee_pipe +) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_10 #AT_START_11 -# 11. DDSTest.at:44: DDS $abs_srcdir/dds-testsuite/test.11.dds -at_setup_line='DDSTest.at:44' -at_desc="DDS \$abs_srcdir/dds-testsuite/test.11.dds" -at_desc_line=" 11: $at_desc " -$at_quiet $as_echo_n "$at_desc_line" +at_fn_group_banner 11 'DDSTest.at:44' \ + "DDS \$abs_srcdir/dds-testsuite/test.11.dds" " " at_xfail=no -echo "# -*- compilation -*-" >> "$at_group_log" ( - $as_echo "11. DDSTest.at:44: testing ..." + $as_echo "11. $at_setup_line: testing $at_desc ..." $at_traceon @@ -2460,7 +2465,7 @@ $as_echo "$at_srcdir/DDSTest.at:44: \$abs_builddir/dds-test -p < \$abs_srcdir/dds-testsuite/test.11.dds || true" at_fn_check_prepare_dynamic "$abs_builddir/dds-test -p < $abs_srcdir/dds-testsuite/test.11.dds || true" "DDSTest.at:44" ( $at_check_trace; $abs_builddir/dds-test -p < $abs_srcdir/dds-testsuite/test.11.dds || true -) >>"$at_stdout" 2>>"$at_stderr" +) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" @@ -2475,7 +2480,7 @@ $as_echo "$at_srcdir/DDSTest.at:44: diff -b -B \$abs_srcdir/dds-testsuite/test.11.dds.base stdout || diff -b -B \$abs_srcdir/dds-testsuite/test.11.dds.base stderr" at_fn_check_prepare_dynamic "diff -b -B $abs_srcdir/dds-testsuite/test.11.dds.base stdout || diff -b -B $abs_srcdir/dds-testsuite/test.11.dds.base stderr" "DDSTest.at:44" ( $at_check_trace; diff -b -B $abs_srcdir/dds-testsuite/test.11.dds.base stdout || diff -b -B $abs_srcdir/dds-testsuite/test.11.dds.base stderr -) >>"$at_stdout" 2>>"$at_stderr" +) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: @@ -2486,19 +2491,15 @@ set +x $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 | eval $at_tee_pipe +) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_11 #AT_START_12 -# 12. DDSTest.at:45: DDS $abs_srcdir/dds-testsuite/test.12.dds -at_setup_line='DDSTest.at:45' -at_desc="DDS \$abs_srcdir/dds-testsuite/test.12.dds" -at_desc_line=" 12: $at_desc " -$at_quiet $as_echo_n "$at_desc_line" +at_fn_group_banner 12 'DDSTest.at:45' \ + "DDS \$abs_srcdir/dds-testsuite/test.12.dds" " " at_xfail=no -echo "# -*- compilation -*-" >> "$at_group_log" ( - $as_echo "12. DDSTest.at:45: testing ..." + $as_echo "12. $at_setup_line: testing $at_desc ..." $at_traceon @@ -2508,7 +2509,7 @@ $as_echo "$at_srcdir/DDSTest.at:45: \$abs_builddir/dds-test -p < \$abs_srcdir/dds-testsuite/test.12.dds || true" at_fn_check_prepare_dynamic "$abs_builddir/dds-test -p < $abs_srcdir/dds-testsuite/test.12.dds || true" "DDSTest.at:45" ( $at_check_trace; $abs_builddir/dds-test -p < $abs_srcdir/dds-testsuite/test.12.dds || true -) >>"$at_stdout" 2>>"$at_stderr" +) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" @@ -2523,7 +2524,7 @@ $as_echo "$at_srcdir/DDSTest.at:45: diff -b -B \$abs_srcdir/dds-testsuite/test.12.dds.base stdout || diff -b -B \$abs_srcdir/dds-testsuite/test.12.dds.base stderr" at_fn_check_prepare_dynamic "diff -b -B $abs_srcdir/dds-testsuite/test.12.dds.base stdout || diff -b -B $abs_srcdir/dds-testsuite/test.12.dds.base stderr" "DDSTest.at:45" ( $at_check_trace; diff -b -B $abs_srcdir/dds-testsuite/test.12.dds.base stdout || diff -b -B $abs_srcdir/dds-testsuite/test.12.dds.base stderr -) >>"$at_stdout" 2>>"$at_stderr" +) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: @@ -2534,19 +2535,15 @@ set +x $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 | eval $at_tee_pipe +) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_12 #AT_START_13 -# 13. DDSTest.at:46: DDS $abs_srcdir/dds-testsuite/test.13.dds -at_setup_line='DDSTest.at:46' -at_desc="DDS \$abs_srcdir/dds-testsuite/test.13.dds" -at_desc_line=" 13: $at_desc " -$at_quiet $as_echo_n "$at_desc_line" +at_fn_group_banner 13 'DDSTest.at:46' \ + "DDS \$abs_srcdir/dds-testsuite/test.13.dds" " " at_xfail=no -echo "# -*- compilation -*-" >> "$at_group_log" ( - $as_echo "13. DDSTest.at:46: testing ..." + $as_echo "13. $at_setup_line: testing $at_desc ..." $at_traceon @@ -2556,7 +2553,7 @@ $as_echo "$at_srcdir/DDSTest.at:46: \$abs_builddir/dds-test -p < \$abs_srcdir/dds-testsuite/test.13.dds || true" at_fn_check_prepare_dynamic "$abs_builddir/dds-test -p < $abs_srcdir/dds-testsuite/test.13.dds || true" "DDSTest.at:46" ( $at_check_trace; $abs_builddir/dds-test -p < $abs_srcdir/dds-testsuite/test.13.dds || true -) >>"$at_stdout" 2>>"$at_stderr" +) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" @@ -2571,7 +2568,7 @@ $as_echo "$at_srcdir/DDSTest.at:46: diff -b -B \$abs_srcdir/dds-testsuite/test.13.dds.base stdout || diff -b -B \$abs_srcdir/dds-testsuite/test.13.dds.base stderr" at_fn_check_prepare_dynamic "diff -b -B $abs_srcdir/dds-testsuite/test.13.dds.base stdout || diff -b -B $abs_srcdir/dds-testsuite/test.13.dds.base stderr" "DDSTest.at:46" ( $at_check_trace; diff -b -B $abs_srcdir/dds-testsuite/test.13.dds.base stdout || diff -b -B $abs_srcdir/dds-testsuite/test.13.dds.base stderr -) >>"$at_stdout" 2>>"$at_stderr" +) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: @@ -2582,19 +2579,15 @@ set +x $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 | eval $at_tee_pipe +) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_13 #AT_START_14 -# 14. DDSTest.at:47: DDS $abs_srcdir/dds-testsuite/test.14.dds -at_setup_line='DDSTest.at:47' -at_desc="DDS \$abs_srcdir/dds-testsuite/test.14.dds" -at_desc_line=" 14: $at_desc " -$at_quiet $as_echo_n "$at_desc_line" +at_fn_group_banner 14 'DDSTest.at:47' \ + "DDS \$abs_srcdir/dds-testsuite/test.14.dds" " " at_xfail=no -echo "# -*- compilation -*-" >> "$at_group_log" ( - $as_echo "14. DDSTest.at:47: testing ..." + $as_echo "14. $at_setup_line: testing $at_desc ..." $at_traceon @@ -2604,7 +2597,7 @@ $as_echo "$at_srcdir/DDSTest.at:47: \$abs_builddir/dds-test -p < \$abs_srcdir/dds-testsuite/test.14.dds || true" at_fn_check_prepare_dynamic "$abs_builddir/dds-test -p < $abs_srcdir/dds-testsuite/test.14.dds || true" "DDSTest.at:47" ( $at_check_trace; $abs_builddir/dds-test -p < $abs_srcdir/dds-testsuite/test.14.dds || true -) >>"$at_stdout" 2>>"$at_stderr" +) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" @@ -2619,7 +2612,7 @@ $as_echo "$at_srcdir/DDSTest.at:47: diff -b -B \$abs_srcdir/dds-testsuite/test.14.dds.base stdout || diff -b -B \$abs_srcdir/dds-testsuite/test.14.dds.base stderr" at_fn_check_prepare_dynamic "diff -b -B $abs_srcdir/dds-testsuite/test.14.dds.base stdout || diff -b -B $abs_srcdir/dds-testsuite/test.14.dds.base stderr" "DDSTest.at:47" ( $at_check_trace; diff -b -B $abs_srcdir/dds-testsuite/test.14.dds.base stdout || diff -b -B $abs_srcdir/dds-testsuite/test.14.dds.base stderr -) >>"$at_stdout" 2>>"$at_stderr" +) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: @@ -2630,19 +2623,15 @@ set +x $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 | eval $at_tee_pipe +) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_14 #AT_START_15 -# 15. DDSTest.at:48: DDS $abs_srcdir/dds-testsuite/test.15.dds -at_setup_line='DDSTest.at:48' -at_desc="DDS \$abs_srcdir/dds-testsuite/test.15.dds" -at_desc_line=" 15: $at_desc " -$at_quiet $as_echo_n "$at_desc_line" +at_fn_group_banner 15 'DDSTest.at:48' \ + "DDS \$abs_srcdir/dds-testsuite/test.15.dds" " " at_xfail=no -echo "# -*- compilation -*-" >> "$at_group_log" ( - $as_echo "15. DDSTest.at:48: testing ..." + $as_echo "15. $at_setup_line: testing $at_desc ..." $at_traceon @@ -2652,7 +2641,7 @@ $as_echo "$at_srcdir/DDSTest.at:48: \$abs_builddir/dds-test -p < \$abs_srcdir/dds-testsuite/test.15.dds || true" at_fn_check_prepare_dynamic "$abs_builddir/dds-test -p < $abs_srcdir/dds-testsuite/test.15.dds || true" "DDSTest.at:48" ( $at_check_trace; $abs_builddir/dds-test -p < $abs_srcdir/dds-testsuite/test.15.dds || true -) >>"$at_stdout" 2>>"$at_stderr" +) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" @@ -2667,7 +2656,7 @@ $as_echo "$at_srcdir/DDSTest.at:48: diff -b -B \$abs_srcdir/dds-testsuite/test.15.dds.base stdout || diff -b -B \$abs_srcdir/dds-testsuite/test.15.dds.base stderr" at_fn_check_prepare_dynamic "diff -b -B $abs_srcdir/dds-testsuite/test.15.dds.base stdout || diff -b -B $abs_srcdir/dds-testsuite/test.15.dds.base stderr" "DDSTest.at:48" ( $at_check_trace; diff -b -B $abs_srcdir/dds-testsuite/test.15.dds.base stdout || diff -b -B $abs_srcdir/dds-testsuite/test.15.dds.base stderr -) >>"$at_stdout" 2>>"$at_stderr" +) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: @@ -2678,19 +2667,15 @@ set +x $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 | eval $at_tee_pipe +) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_15 #AT_START_16 -# 16. DDSTest.at:49: DDS $abs_srcdir/dds-testsuite/test.16.dds -at_setup_line='DDSTest.at:49' -at_desc="DDS \$abs_srcdir/dds-testsuite/test.16.dds" -at_desc_line=" 16: $at_desc " -$at_quiet $as_echo_n "$at_desc_line" +at_fn_group_banner 16 'DDSTest.at:49' \ + "DDS \$abs_srcdir/dds-testsuite/test.16.dds" " " at_xfail=no -echo "# -*- compilation -*-" >> "$at_group_log" ( - $as_echo "16. DDSTest.at:49: testing ..." + $as_echo "16. $at_setup_line: testing $at_desc ..." $at_traceon @@ -2700,7 +2685,7 @@ $as_echo "$at_srcdir/DDSTest.at:49: \$abs_builddir/dds-test -p < \$abs_srcdir/dds-testsuite/test.16.dds || true" at_fn_check_prepare_dynamic "$abs_builddir/dds-test -p < $abs_srcdir/dds-testsuite/test.16.dds || true" "DDSTest.at:49" ( $at_check_trace; $abs_builddir/dds-test -p < $abs_srcdir/dds-testsuite/test.16.dds || true -) >>"$at_stdout" 2>>"$at_stderr" +) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" @@ -2715,7 +2700,7 @@ $as_echo "$at_srcdir/DDSTest.at:49: diff -b -B \$abs_srcdir/dds-testsuite/test.16.dds.base stdout || diff -b -B \$abs_srcdir/dds-testsuite/test.16.dds.base stderr" at_fn_check_prepare_dynamic "diff -b -B $abs_srcdir/dds-testsuite/test.16.dds.base stdout || diff -b -B $abs_srcdir/dds-testsuite/test.16.dds.base stderr" "DDSTest.at:49" ( $at_check_trace; diff -b -B $abs_srcdir/dds-testsuite/test.16.dds.base stdout || diff -b -B $abs_srcdir/dds-testsuite/test.16.dds.base stderr -) >>"$at_stdout" 2>>"$at_stderr" +) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: @@ -2726,19 +2711,15 @@ set +x $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 | eval $at_tee_pipe +) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_16 #AT_START_17 -# 17. DDSTest.at:50: DDS $abs_srcdir/dds-testsuite/test.17.dds -at_setup_line='DDSTest.at:50' -at_desc="DDS \$abs_srcdir/dds-testsuite/test.17.dds" -at_desc_line=" 17: $at_desc " -$at_quiet $as_echo_n "$at_desc_line" +at_fn_group_banner 17 'DDSTest.at:50' \ + "DDS \$abs_srcdir/dds-testsuite/test.17.dds" " " at_xfail=no -echo "# -*- compilation -*-" >> "$at_group_log" ( - $as_echo "17. DDSTest.at:50: testing ..." + $as_echo "17. $at_setup_line: testing $at_desc ..." $at_traceon @@ -2748,7 +2729,7 @@ $as_echo "$at_srcdir/DDSTest.at:50: \$abs_builddir/dds-test -p < \$abs_srcdir/dds-testsuite/test.17.dds || true" at_fn_check_prepare_dynamic "$abs_builddir/dds-test -p < $abs_srcdir/dds-testsuite/test.17.dds || true" "DDSTest.at:50" ( $at_check_trace; $abs_builddir/dds-test -p < $abs_srcdir/dds-testsuite/test.17.dds || true -) >>"$at_stdout" 2>>"$at_stderr" +) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" @@ -2763,7 +2744,7 @@ $as_echo "$at_srcdir/DDSTest.at:50: diff -b -B \$abs_srcdir/dds-testsuite/test.17.dds.base stdout || diff -b -B \$abs_srcdir/dds-testsuite/test.17.dds.base stderr" at_fn_check_prepare_dynamic "diff -b -B $abs_srcdir/dds-testsuite/test.17.dds.base stdout || diff -b -B $abs_srcdir/dds-testsuite/test.17.dds.base stderr" "DDSTest.at:50" ( $at_check_trace; diff -b -B $abs_srcdir/dds-testsuite/test.17.dds.base stdout || diff -b -B $abs_srcdir/dds-testsuite/test.17.dds.base stderr -) >>"$at_stdout" 2>>"$at_stderr" +) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: @@ -2774,19 +2755,15 @@ set +x $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 | eval $at_tee_pipe +) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_17 #AT_START_18 -# 18. DDSTest.at:51: DDS $abs_srcdir/dds-testsuite/test.18.dds -at_setup_line='DDSTest.at:51' -at_desc="DDS \$abs_srcdir/dds-testsuite/test.18.dds" -at_desc_line=" 18: $at_desc " -$at_quiet $as_echo_n "$at_desc_line" +at_fn_group_banner 18 'DDSTest.at:51' \ + "DDS \$abs_srcdir/dds-testsuite/test.18.dds" " " at_xfail=no -echo "# -*- compilation -*-" >> "$at_group_log" ( - $as_echo "18. DDSTest.at:51: testing ..." + $as_echo "18. $at_setup_line: testing $at_desc ..." $at_traceon @@ -2796,7 +2773,7 @@ $as_echo "$at_srcdir/DDSTest.at:51: \$abs_builddir/dds-test -p < \$abs_srcdir/dds-testsuite/test.18.dds || true" at_fn_check_prepare_dynamic "$abs_builddir/dds-test -p < $abs_srcdir/dds-testsuite/test.18.dds || true" "DDSTest.at:51" ( $at_check_trace; $abs_builddir/dds-test -p < $abs_srcdir/dds-testsuite/test.18.dds || true -) >>"$at_stdout" 2>>"$at_stderr" +) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" @@ -2811,7 +2788,7 @@ $as_echo "$at_srcdir/DDSTest.at:51: diff -b -B \$abs_srcdir/dds-testsuite/test.18.dds.base stdout || diff -b -B \$abs_srcdir/dds-testsuite/test.18.dds.base stderr" at_fn_check_prepare_dynamic "diff -b -B $abs_srcdir/dds-testsuite/test.18.dds.base stdout || diff -b -B $abs_srcdir/dds-testsuite/test.18.dds.base stderr" "DDSTest.at:51" ( $at_check_trace; diff -b -B $abs_srcdir/dds-testsuite/test.18.dds.base stdout || diff -b -B $abs_srcdir/dds-testsuite/test.18.dds.base stderr -) >>"$at_stdout" 2>>"$at_stderr" +) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: @@ -2822,19 +2799,15 @@ set +x $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 | eval $at_tee_pipe +) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_18 #AT_START_19 -# 19. DDSTest.at:52: DDS $abs_srcdir/dds-testsuite/test.19.dds -at_setup_line='DDSTest.at:52' -at_desc="DDS \$abs_srcdir/dds-testsuite/test.19.dds" -at_desc_line=" 19: $at_desc " -$at_quiet $as_echo_n "$at_desc_line" +at_fn_group_banner 19 'DDSTest.at:52' \ + "DDS \$abs_srcdir/dds-testsuite/test.19.dds" " " at_xfail=no -echo "# -*- compilation -*-" >> "$at_group_log" ( - $as_echo "19. DDSTest.at:52: testing ..." + $as_echo "19. $at_setup_line: testing $at_desc ..." $at_traceon @@ -2844,7 +2817,7 @@ $as_echo "$at_srcdir/DDSTest.at:52: \$abs_builddir/dds-test -p < \$abs_srcdir/dds-testsuite/test.19.dds || true" at_fn_check_prepare_dynamic "$abs_builddir/dds-test -p < $abs_srcdir/dds-testsuite/test.19.dds || true" "DDSTest.at:52" ( $at_check_trace; $abs_builddir/dds-test -p < $abs_srcdir/dds-testsuite/test.19.dds || true -) >>"$at_stdout" 2>>"$at_stderr" +) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" @@ -2859,7 +2832,7 @@ $as_echo "$at_srcdir/DDSTest.at:52: diff -b -B \$abs_srcdir/dds-testsuite/test.19.dds.base stdout || diff -b -B \$abs_srcdir/dds-testsuite/test.19.dds.base stderr" at_fn_check_prepare_dynamic "diff -b -B $abs_srcdir/dds-testsuite/test.19.dds.base stdout || diff -b -B $abs_srcdir/dds-testsuite/test.19.dds.base stderr" "DDSTest.at:52" ( $at_check_trace; diff -b -B $abs_srcdir/dds-testsuite/test.19.dds.base stdout || diff -b -B $abs_srcdir/dds-testsuite/test.19.dds.base stderr -) >>"$at_stdout" 2>>"$at_stderr" +) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: @@ -2870,19 +2843,15 @@ set +x $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 | eval $at_tee_pipe +) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_19 #AT_START_20 -# 20. DDSTest.at:53: DDS $abs_srcdir/dds-testsuite/test.19b.das.dds -at_setup_line='DDSTest.at:53' -at_desc="DDS \$abs_srcdir/dds-testsuite/test.19b.das.dds" -at_desc_line=" 20: $at_desc " -$at_quiet $as_echo_n "$at_desc_line" +at_fn_group_banner 20 'DDSTest.at:53' \ + "DDS \$abs_srcdir/dds-testsuite/test.19b.das.dds" " " at_xfail=no -echo "# -*- compilation -*-" >> "$at_group_log" ( - $as_echo "20. DDSTest.at:53: testing ..." + $as_echo "20. $at_setup_line: testing $at_desc ..." $at_traceon @@ -2892,7 +2861,7 @@ $as_echo "$at_srcdir/DDSTest.at:53: \$abs_builddir/dds-test -p < \$abs_srcdir/dds-testsuite/test.19b.das.dds || true" at_fn_check_prepare_dynamic "$abs_builddir/dds-test -p < $abs_srcdir/dds-testsuite/test.19b.das.dds || true" "DDSTest.at:53" ( $at_check_trace; $abs_builddir/dds-test -p < $abs_srcdir/dds-testsuite/test.19b.das.dds || true -) >>"$at_stdout" 2>>"$at_stderr" +) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" @@ -2907,7 +2876,7 @@ $as_echo "$at_srcdir/DDSTest.at:53: diff -b -B \$abs_srcdir/dds-testsuite/test.19b.das.dds.base stdout || diff -b -B \$abs_srcdir/dds-testsuite/test.19b.das.dds.base stderr" at_fn_check_prepare_dynamic "diff -b -B $abs_srcdir/dds-testsuite/test.19b.das.dds.base stdout || diff -b -B $abs_srcdir/dds-testsuite/test.19b.das.dds.base stderr" "DDSTest.at:53" ( $at_check_trace; diff -b -B $abs_srcdir/dds-testsuite/test.19b.das.dds.base stdout || diff -b -B $abs_srcdir/dds-testsuite/test.19b.das.dds.base stderr -) >>"$at_stdout" 2>>"$at_stderr" +) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: @@ -2918,19 +2887,15 @@ set +x $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 | eval $at_tee_pipe +) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_20 #AT_START_21 -# 21. DDSTest.at:54: DDS $abs_srcdir/dds-testsuite/test.19b.dds -at_setup_line='DDSTest.at:54' -at_desc="DDS \$abs_srcdir/dds-testsuite/test.19b.dds" -at_desc_line=" 21: $at_desc " -$at_quiet $as_echo_n "$at_desc_line" +at_fn_group_banner 21 'DDSTest.at:54' \ + "DDS \$abs_srcdir/dds-testsuite/test.19b.dds" " " at_xfail=no -echo "# -*- compilation -*-" >> "$at_group_log" ( - $as_echo "21. DDSTest.at:54: testing ..." + $as_echo "21. $at_setup_line: testing $at_desc ..." $at_traceon @@ -2940,7 +2905,7 @@ $as_echo "$at_srcdir/DDSTest.at:54: \$abs_builddir/dds-test -p < \$abs_srcdir/dds-testsuite/test.19b.dds || true" at_fn_check_prepare_dynamic "$abs_builddir/dds-test -p < $abs_srcdir/dds-testsuite/test.19b.dds || true" "DDSTest.at:54" ( $at_check_trace; $abs_builddir/dds-test -p < $abs_srcdir/dds-testsuite/test.19b.dds || true -) >>"$at_stdout" 2>>"$at_stderr" +) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" @@ -2955,7 +2920,7 @@ $as_echo "$at_srcdir/DDSTest.at:54: diff -b -B \$abs_srcdir/dds-testsuite/test.19b.dds.base stdout || diff -b -B \$abs_srcdir/dds-testsuite/test.19b.dds.base stderr" at_fn_check_prepare_dynamic "diff -b -B $abs_srcdir/dds-testsuite/test.19b.dds.base stdout || diff -b -B $abs_srcdir/dds-testsuite/test.19b.dds.base stderr" "DDSTest.at:54" ( $at_check_trace; diff -b -B $abs_srcdir/dds-testsuite/test.19b.dds.base stdout || diff -b -B $abs_srcdir/dds-testsuite/test.19b.dds.base stderr -) >>"$at_stdout" 2>>"$at_stderr" +) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: @@ -2966,19 +2931,15 @@ set +x $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 | eval $at_tee_pipe +) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_21 #AT_START_22 -# 22. DDSTest.at:55: DDS $abs_srcdir/dds-testsuite/test.2.dds -at_setup_line='DDSTest.at:55' -at_desc="DDS \$abs_srcdir/dds-testsuite/test.2.dds" -at_desc_line=" 22: $at_desc " -$at_quiet $as_echo_n "$at_desc_line" +at_fn_group_banner 22 'DDSTest.at:55' \ + "DDS \$abs_srcdir/dds-testsuite/test.2.dds" " " at_xfail=no -echo "# -*- compilation -*-" >> "$at_group_log" ( - $as_echo "22. DDSTest.at:55: testing ..." + $as_echo "22. $at_setup_line: testing $at_desc ..." $at_traceon @@ -2988,7 +2949,7 @@ $as_echo "$at_srcdir/DDSTest.at:55: \$abs_builddir/dds-test -p < \$abs_srcdir/dds-testsuite/test.2.dds || true" at_fn_check_prepare_dynamic "$abs_builddir/dds-test -p < $abs_srcdir/dds-testsuite/test.2.dds || true" "DDSTest.at:55" ( $at_check_trace; $abs_builddir/dds-test -p < $abs_srcdir/dds-testsuite/test.2.dds || true -) >>"$at_stdout" 2>>"$at_stderr" +) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" @@ -3003,7 +2964,7 @@ $as_echo "$at_srcdir/DDSTest.at:55: diff -b -B \$abs_srcdir/dds-testsuite/test.2.dds.base stdout || diff -b -B \$abs_srcdir/dds-testsuite/test.2.dds.base stderr" at_fn_check_prepare_dynamic "diff -b -B $abs_srcdir/dds-testsuite/test.2.dds.base stdout || diff -b -B $abs_srcdir/dds-testsuite/test.2.dds.base stderr" "DDSTest.at:55" ( $at_check_trace; diff -b -B $abs_srcdir/dds-testsuite/test.2.dds.base stdout || diff -b -B $abs_srcdir/dds-testsuite/test.2.dds.base stderr -) >>"$at_stdout" 2>>"$at_stderr" +) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: @@ -3014,19 +2975,15 @@ set +x $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 | eval $at_tee_pipe +) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_22 #AT_START_23 -# 23. DDSTest.at:56: DDS $abs_srcdir/dds-testsuite/test.20.dds -at_setup_line='DDSTest.at:56' -at_desc="DDS \$abs_srcdir/dds-testsuite/test.20.dds" -at_desc_line=" 23: $at_desc " -$at_quiet $as_echo_n "$at_desc_line" +at_fn_group_banner 23 'DDSTest.at:56' \ + "DDS \$abs_srcdir/dds-testsuite/test.20.dds" " " at_xfail=no -echo "# -*- compilation -*-" >> "$at_group_log" ( - $as_echo "23. DDSTest.at:56: testing ..." + $as_echo "23. $at_setup_line: testing $at_desc ..." $at_traceon @@ -3036,7 +2993,7 @@ $as_echo "$at_srcdir/DDSTest.at:56: \$abs_builddir/dds-test -p < \$abs_srcdir/dds-testsuite/test.20.dds || true" at_fn_check_prepare_dynamic "$abs_builddir/dds-test -p < $abs_srcdir/dds-testsuite/test.20.dds || true" "DDSTest.at:56" ( $at_check_trace; $abs_builddir/dds-test -p < $abs_srcdir/dds-testsuite/test.20.dds || true -) >>"$at_stdout" 2>>"$at_stderr" +) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" @@ -3051,7 +3008,7 @@ $as_echo "$at_srcdir/DDSTest.at:56: diff -b -B \$abs_srcdir/dds-testsuite/test.20.dds.base stdout || diff -b -B \$abs_srcdir/dds-testsuite/test.20.dds.base stderr" at_fn_check_prepare_dynamic "diff -b -B $abs_srcdir/dds-testsuite/test.20.dds.base stdout || diff -b -B $abs_srcdir/dds-testsuite/test.20.dds.base stderr" "DDSTest.at:56" ( $at_check_trace; diff -b -B $abs_srcdir/dds-testsuite/test.20.dds.base stdout || diff -b -B $abs_srcdir/dds-testsuite/test.20.dds.base stderr -) >>"$at_stdout" 2>>"$at_stderr" +) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: @@ -3062,19 +3019,15 @@ set +x $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 | eval $at_tee_pipe +) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_23 #AT_START_24 -# 24. DDSTest.at:57: DDS $abs_srcdir/dds-testsuite/test.3.dds -at_setup_line='DDSTest.at:57' -at_desc="DDS \$abs_srcdir/dds-testsuite/test.3.dds" -at_desc_line=" 24: $at_desc " -$at_quiet $as_echo_n "$at_desc_line" +at_fn_group_banner 24 'DDSTest.at:57' \ + "DDS \$abs_srcdir/dds-testsuite/test.3.dds" " " at_xfail=no -echo "# -*- compilation -*-" >> "$at_group_log" ( - $as_echo "24. DDSTest.at:57: testing ..." + $as_echo "24. $at_setup_line: testing $at_desc ..." $at_traceon @@ -3084,7 +3037,7 @@ $as_echo "$at_srcdir/DDSTest.at:57: \$abs_builddir/dds-test -p < \$abs_srcdir/dds-testsuite/test.3.dds || true" at_fn_check_prepare_dynamic "$abs_builddir/dds-test -p < $abs_srcdir/dds-testsuite/test.3.dds || true" "DDSTest.at:57" ( $at_check_trace; $abs_builddir/dds-test -p < $abs_srcdir/dds-testsuite/test.3.dds || true -) >>"$at_stdout" 2>>"$at_stderr" +) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" @@ -3099,7 +3052,7 @@ $as_echo "$at_srcdir/DDSTest.at:57: diff -b -B \$abs_srcdir/dds-testsuite/test.3.dds.base stdout || diff -b -B \$abs_srcdir/dds-testsuite/test.3.dds.base stderr" at_fn_check_prepare_dynamic "diff -b -B $abs_srcdir/dds-testsuite/test.3.dds.base stdout || diff -b -B $abs_srcdir/dds-testsuite/test.3.dds.base stderr" "DDSTest.at:57" ( $at_check_trace; diff -b -B $abs_srcdir/dds-testsuite/test.3.dds.base stdout || diff -b -B $abs_srcdir/dds-testsuite/test.3.dds.base stderr -) >>"$at_stdout" 2>>"$at_stderr" +) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: @@ -3110,19 +3063,15 @@ set +x $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 | eval $at_tee_pipe +) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_24 #AT_START_25 -# 25. DDSTest.at:58: DDS $abs_srcdir/dds-testsuite/test.4.dds -at_setup_line='DDSTest.at:58' -at_desc="DDS \$abs_srcdir/dds-testsuite/test.4.dds" -at_desc_line=" 25: $at_desc " -$at_quiet $as_echo_n "$at_desc_line" +at_fn_group_banner 25 'DDSTest.at:58' \ + "DDS \$abs_srcdir/dds-testsuite/test.4.dds" " " at_xfail=no -echo "# -*- compilation -*-" >> "$at_group_log" ( - $as_echo "25. DDSTest.at:58: testing ..." + $as_echo "25. $at_setup_line: testing $at_desc ..." $at_traceon @@ -3132,7 +3081,7 @@ $as_echo "$at_srcdir/DDSTest.at:58: \$abs_builddir/dds-test -p < \$abs_srcdir/dds-testsuite/test.4.dds || true" at_fn_check_prepare_dynamic "$abs_builddir/dds-test -p < $abs_srcdir/dds-testsuite/test.4.dds || true" "DDSTest.at:58" ( $at_check_trace; $abs_builddir/dds-test -p < $abs_srcdir/dds-testsuite/test.4.dds || true -) >>"$at_stdout" 2>>"$at_stderr" +) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" @@ -3147,7 +3096,7 @@ $as_echo "$at_srcdir/DDSTest.at:58: diff -b -B \$abs_srcdir/dds-testsuite/test.4.dds.base stdout || diff -b -B \$abs_srcdir/dds-testsuite/test.4.dds.base stderr" at_fn_check_prepare_dynamic "diff -b -B $abs_srcdir/dds-testsuite/test.4.dds.base stdout || diff -b -B $abs_srcdir/dds-testsuite/test.4.dds.base stderr" "DDSTest.at:58" ( $at_check_trace; diff -b -B $abs_srcdir/dds-testsuite/test.4.dds.base stdout || diff -b -B $abs_srcdir/dds-testsuite/test.4.dds.base stderr -) >>"$at_stdout" 2>>"$at_stderr" +) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: @@ -3158,19 +3107,15 @@ set +x $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 | eval $at_tee_pipe +) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_25 #AT_START_26 -# 26. DDSTest.at:59: DDS $abs_srcdir/dds-testsuite/test.6.dds -at_setup_line='DDSTest.at:59' -at_desc="DDS \$abs_srcdir/dds-testsuite/test.6.dds" -at_desc_line=" 26: $at_desc " -$at_quiet $as_echo_n "$at_desc_line" +at_fn_group_banner 26 'DDSTest.at:59' \ + "DDS \$abs_srcdir/dds-testsuite/test.6.dds" " " at_xfail=no -echo "# -*- compilation -*-" >> "$at_group_log" ( - $as_echo "26. DDSTest.at:59: testing ..." + $as_echo "26. $at_setup_line: testing $at_desc ..." $at_traceon @@ -3180,7 +3125,7 @@ $as_echo "$at_srcdir/DDSTest.at:59: \$abs_builddir/dds-test -p < \$abs_srcdir/dds-testsuite/test.6.dds || true" at_fn_check_prepare_dynamic "$abs_builddir/dds-test -p < $abs_srcdir/dds-testsuite/test.6.dds || true" "DDSTest.at:59" ( $at_check_trace; $abs_builddir/dds-test -p < $abs_srcdir/dds-testsuite/test.6.dds || true -) >>"$at_stdout" 2>>"$at_stderr" +) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" @@ -3195,7 +3140,7 @@ $as_echo "$at_srcdir/DDSTest.at:59: diff -b -B \$abs_srcdir/dds-testsuite/test.6.dds.base stdout || diff -b -B \$abs_srcdir/dds-testsuite/test.6.dds.base stderr" at_fn_check_prepare_dynamic "diff -b -B $abs_srcdir/dds-testsuite/test.6.dds.base stdout || diff -b -B $abs_srcdir/dds-testsuite/test.6.dds.base stderr" "DDSTest.at:59" ( $at_check_trace; diff -b -B $abs_srcdir/dds-testsuite/test.6.dds.base stdout || diff -b -B $abs_srcdir/dds-testsuite/test.6.dds.base stderr -) >>"$at_stdout" 2>>"$at_stderr" +) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: @@ -3206,19 +3151,15 @@ set +x $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 | eval $at_tee_pipe +) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_26 #AT_START_27 -# 27. DDSTest.at:60: DDS $abs_srcdir/dds-testsuite/test.7.dds -at_setup_line='DDSTest.at:60' -at_desc="DDS \$abs_srcdir/dds-testsuite/test.7.dds" -at_desc_line=" 27: $at_desc " -$at_quiet $as_echo_n "$at_desc_line" +at_fn_group_banner 27 'DDSTest.at:60' \ + "DDS \$abs_srcdir/dds-testsuite/test.7.dds" " " at_xfail=no -echo "# -*- compilation -*-" >> "$at_group_log" ( - $as_echo "27. DDSTest.at:60: testing ..." + $as_echo "27. $at_setup_line: testing $at_desc ..." $at_traceon @@ -3228,7 +3169,7 @@ $as_echo "$at_srcdir/DDSTest.at:60: \$abs_builddir/dds-test -p < \$abs_srcdir/dds-testsuite/test.7.dds || true" at_fn_check_prepare_dynamic "$abs_builddir/dds-test -p < $abs_srcdir/dds-testsuite/test.7.dds || true" "DDSTest.at:60" ( $at_check_trace; $abs_builddir/dds-test -p < $abs_srcdir/dds-testsuite/test.7.dds || true -) >>"$at_stdout" 2>>"$at_stderr" +) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" @@ -3243,7 +3184,7 @@ $as_echo "$at_srcdir/DDSTest.at:60: diff -b -B \$abs_srcdir/dds-testsuite/test.7.dds.base stdout || diff -b -B \$abs_srcdir/dds-testsuite/test.7.dds.base stderr" at_fn_check_prepare_dynamic "diff -b -B $abs_srcdir/dds-testsuite/test.7.dds.base stdout || diff -b -B $abs_srcdir/dds-testsuite/test.7.dds.base stderr" "DDSTest.at:60" ( $at_check_trace; diff -b -B $abs_srcdir/dds-testsuite/test.7.dds.base stdout || diff -b -B $abs_srcdir/dds-testsuite/test.7.dds.base stderr -) >>"$at_stdout" 2>>"$at_stderr" +) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: @@ -3254,19 +3195,15 @@ set +x $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 | eval $at_tee_pipe +) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_27 #AT_START_28 -# 28. DDSTest.at:61: DDS $abs_srcdir/dds-testsuite/test.8.dds -at_setup_line='DDSTest.at:61' -at_desc="DDS \$abs_srcdir/dds-testsuite/test.8.dds" -at_desc_line=" 28: $at_desc " -$at_quiet $as_echo_n "$at_desc_line" +at_fn_group_banner 28 'DDSTest.at:61' \ + "DDS \$abs_srcdir/dds-testsuite/test.8.dds" " " at_xfail=no -echo "# -*- compilation -*-" >> "$at_group_log" ( - $as_echo "28. DDSTest.at:61: testing ..." + $as_echo "28. $at_setup_line: testing $at_desc ..." $at_traceon @@ -3276,7 +3213,7 @@ $as_echo "$at_srcdir/DDSTest.at:61: \$abs_builddir/dds-test -p < \$abs_srcdir/dds-testsuite/test.8.dds || true" at_fn_check_prepare_dynamic "$abs_builddir/dds-test -p < $abs_srcdir/dds-testsuite/test.8.dds || true" "DDSTest.at:61" ( $at_check_trace; $abs_builddir/dds-test -p < $abs_srcdir/dds-testsuite/test.8.dds || true -) >>"$at_stdout" 2>>"$at_stderr" +) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" @@ -3291,7 +3228,7 @@ $as_echo "$at_srcdir/DDSTest.at:61: diff -b -B \$abs_srcdir/dds-testsuite/test.8.dds.base stdout || diff -b -B \$abs_srcdir/dds-testsuite/test.8.dds.base stderr" at_fn_check_prepare_dynamic "diff -b -B $abs_srcdir/dds-testsuite/test.8.dds.base stdout || diff -b -B $abs_srcdir/dds-testsuite/test.8.dds.base stderr" "DDSTest.at:61" ( $at_check_trace; diff -b -B $abs_srcdir/dds-testsuite/test.8.dds.base stdout || diff -b -B $abs_srcdir/dds-testsuite/test.8.dds.base stderr -) >>"$at_stdout" 2>>"$at_stderr" +) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: @@ -3302,19 +3239,15 @@ set +x $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 | eval $at_tee_pipe +) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_28 #AT_START_29 -# 29. DDSTest.at:62: DDS $abs_srcdir/dds-testsuite/test.9.dds -at_setup_line='DDSTest.at:62' -at_desc="DDS \$abs_srcdir/dds-testsuite/test.9.dds" -at_desc_line=" 29: $at_desc " -$at_quiet $as_echo_n "$at_desc_line" +at_fn_group_banner 29 'DDSTest.at:62' \ + "DDS \$abs_srcdir/dds-testsuite/test.9.dds" " " at_xfail=no -echo "# -*- compilation -*-" >> "$at_group_log" ( - $as_echo "29. DDSTest.at:62: testing ..." + $as_echo "29. $at_setup_line: testing $at_desc ..." $at_traceon @@ -3324,7 +3257,7 @@ $as_echo "$at_srcdir/DDSTest.at:62: \$abs_builddir/dds-test -p < \$abs_srcdir/dds-testsuite/test.9.dds || true" at_fn_check_prepare_dynamic "$abs_builddir/dds-test -p < $abs_srcdir/dds-testsuite/test.9.dds || true" "DDSTest.at:62" ( $at_check_trace; $abs_builddir/dds-test -p < $abs_srcdir/dds-testsuite/test.9.dds || true -) >>"$at_stdout" 2>>"$at_stderr" +) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" @@ -3339,7 +3272,7 @@ $as_echo "$at_srcdir/DDSTest.at:62: diff -b -B \$abs_srcdir/dds-testsuite/test.9.dds.base stdout || diff -b -B \$abs_srcdir/dds-testsuite/test.9.dds.base stderr" at_fn_check_prepare_dynamic "diff -b -B $abs_srcdir/dds-testsuite/test.9.dds.base stdout || diff -b -B $abs_srcdir/dds-testsuite/test.9.dds.base stderr" "DDSTest.at:62" ( $at_check_trace; diff -b -B $abs_srcdir/dds-testsuite/test.9.dds.base stdout || diff -b -B $abs_srcdir/dds-testsuite/test.9.dds.base stderr -) >>"$at_stdout" 2>>"$at_stderr" +) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: @@ -3350,6 +3283,6 @@ set +x $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 | eval $at_tee_pipe +) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_29 diff -Nru libdap-3.11.1/tests/EXPRTest libdap-3.12.0/tests/EXPRTest --- libdap-3.11.1/tests/EXPRTest 2011-05-06 15:28:47.000000000 +0000 +++ libdap-3.12.0/tests/EXPRTest 2013-10-17 21:27:40.000000000 +0000 @@ -1,7 +1,7 @@ #! /bin/sh -# Generated from EXPRTest.at by GNU Autoconf 2.65. +# Generated from EXPRTest.at by GNU Autoconf 2.69. # -# Copyright (C) 2009 Free Software Foundation, Inc. +# Copyright (C) 2009-2012 Free Software Foundation, Inc. # # This test suite is free software; the Free Software Foundation gives # unlimited permission to copy, distribute and modify it. @@ -84,6 +84,7 @@ IFS=" "" $as_nl" # Find who we are. Look in the path if we contain no directory separator. +as_myself= case $0 in #(( *[\\/]* ) as_myself=$0 ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR @@ -161,7 +162,8 @@ else exitcode=1; echo positional parameters were not saved. fi -test x\$exitcode = x0 || exit 1" +test x\$exitcode = x0 || exit 1 +test -x / || exit 1" as_suggested=" as_lineno_1=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_1a=\$LINENO as_lineno_2=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_2a=\$LINENO eval 'test \"x\$as_lineno_1'\$as_run'\" != \"x\$as_lineno_2'\$as_run'\" && @@ -206,14 +208,25 @@ if test "x$CONFIG_SHELL" != x; then : - # We cannot yet assume a decent shell, so we have to provide a - # neutralization value for shells without unset; and this also - # works around shells that cannot unset nonexistent variables. - BASH_ENV=/dev/null - ENV=/dev/null - (unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV - export CONFIG_SHELL - exec "$CONFIG_SHELL" "$as_myself" ${1+"$@"} + export CONFIG_SHELL + # We cannot yet assume a decent shell, so we have to provide a +# neutralization value for shells without unset; and this also +# works around shells that cannot unset nonexistent variables. +# Preserve -v and -x to the replacement shell. +BASH_ENV=/dev/null +ENV=/dev/null +(unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV +case $- in # (((( + *v*x* | *x*v* ) as_opts=-vx ;; + *v* ) as_opts=-v ;; + *x* ) as_opts=-x ;; + * ) as_opts= ;; +esac +exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"} +# Admittedly, this is quite paranoid, since all the known shells bail +# out after a failed `exec'. +$as_echo "$0: could not re-execute with $CONFIG_SHELL" >&2 +exit 255 fi if test x$as_have_required = xno; then : @@ -311,10 +324,18 @@ test -d "$as_dir" && break done test -z "$as_dirs" || eval "mkdir $as_dirs" - } || test -d "$as_dir" || as_fn_error "cannot create directory $as_dir" + } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir" } # as_fn_mkdir_p + +# as_fn_executable_p FILE +# ----------------------- +# Test if FILE is an executable regular file. +as_fn_executable_p () +{ + test -f "$1" && test -x "$1" +} # as_fn_executable_p # as_fn_append VAR VALUE # ---------------------- # Append the text in VALUE to the end of the definition contained in VAR. Take @@ -351,19 +372,19 @@ fi # as_fn_arith -# as_fn_error ERROR [LINENO LOG_FD] -# --------------------------------- +# as_fn_error STATUS ERROR [LINENO LOG_FD] +# ---------------------------------------- # Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are # provided, also output the error to LOG_FD, referencing LINENO. Then exit the -# script with status $?, using 1 if that was 0. +# script with STATUS, using 1 if that was 0. as_fn_error () { - as_status=$?; test $as_status -eq 0 && as_status=1 - if test "$3"; then - as_lineno=${as_lineno-"$2"} as_lineno_stack=as_lineno_stack=$as_lineno_stack - $as_echo "$as_me:${as_lineno-$LINENO}: error: $1" >&$3 + as_status=$1; test $as_status -eq 0 && as_status=1 + if test "$4"; then + as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4 fi - $as_echo "$as_me: error: $1" >&2 + $as_echo "$as_me: error: $2" >&2 as_fn_exit $as_status } # as_fn_error @@ -436,6 +457,10 @@ chmod +x "$as_me.lineno" || { $as_echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2; as_fn_exit 1; } + # If we had to re-execute with $CONFIG_SHELL, we're ensured to have + # already done that, so ensure we don't try to do so again and fall + # in an infinite loop. This has already happened in practice. + _as_can_reexec=no; export _as_can_reexec # Don't try to exec as it changes $[0], causing all sort of problems # (the dirname of $[0] is not the place where we might find the # original and so on. Autoconf is especially sensitive to this). @@ -470,16 +495,16 @@ # ... but there are two gotchas: # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. - # In both cases, we have to default to `cp -p'. + # In both cases, we have to default to `cp -pR'. ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || - as_ln_s='cp -p' + as_ln_s='cp -pR' elif ln conf$$.file conf$$ 2>/dev/null; then as_ln_s=ln else - as_ln_s='cp -p' + as_ln_s='cp -pR' fi else - as_ln_s='cp -p' + as_ln_s='cp -pR' fi rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file rmdir conf$$.dir 2>/dev/null @@ -491,28 +516,8 @@ as_mkdir_p=false fi -if test -x / >/dev/null 2>&1; then - as_test_x='test -x' -else - if ls -dL / >/dev/null 2>&1; then - as_ls_L_option=L - else - as_ls_L_option= - fi - as_test_x=' - eval sh -c '\'' - if test -d "$1"; then - test -d "$1/."; - else - case $1 in #( - -*)set "./$1";; - esac; - case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in #(( - ???[sx]*):;;*)false;;esac;fi - '\'' sh - ' -fi -as_executable_p=$as_test_x +as_test_x='test -x' +as_executable_p=as_fn_executable_p # Sed expression to map a string onto a valid CPP name. as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" @@ -561,6 +566,8 @@ at_clean=false # Test groups to run at_groups= +# Whether to rerun failed tests. +at_recheck= # Whether a write failure occurred at_write_fail=0 @@ -574,10 +581,10 @@ # Whether -C is in effect. at_change_dir=false +# Whether to enable colored test results. +at_color=no # List of the tested programs. at_tested='' -# List of the all the test groups. -at_groups_all=' 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122' # As many question marks as there are digits in the last test group number. # Used to normalize the test group numbers so that `ls' lists them in # numerical order. @@ -687,25 +694,11 @@ 102;EXPRTest.at:99;expr-test -b -W \$abs_srcdir/expr-testsuite/test.61 -k i[1:2][0:2] (pass);expr; 103;EXPRTest.at:100;expr-test -b -w \$abs_srcdir/expr-testsuite/test.61 -k i[1:2][1:2] (pass);expr; 104;EXPRTest.at:100;expr-test -b -W \$abs_srcdir/expr-testsuite/test.61 -k i[1:2][1:2] (pass);expr; -105;EXPRTest.at:101;expr-test -b -w \$abs_srcdir/expr-testsuite/test.c0 -k \"geogrid(SST)\" (pass);expr; -106;EXPRTest.at:101;expr-test -b -W \$abs_srcdir/expr-testsuite/test.c0 -k \"geogrid(SST)\" (pass);expr; -107;EXPRTest.at:102;expr-test -b -w \$abs_srcdir/expr-testsuite/test.c0 -k SST (pass);expr; -108;EXPRTest.at:102;expr-test -b -W \$abs_srcdir/expr-testsuite/test.c0 -k SST (pass);expr; -109;EXPRTest.at:104;expr-test -b -w \$abs_srcdir/expr-testsuite/test.c0 -k \"geogrid(SST,61,97,38,160)\" (pass);expr; -110;EXPRTest.at:104;expr-test -b -W \$abs_srcdir/expr-testsuite/test.c0 -k \"geogrid(SST,61,97,38,160)\" (pass);expr; -111;EXPRTest.at:105;expr-test -b -w \$abs_srcdir/expr-testsuite/test.c1 -k \"geogrid(SST,61,97,38,160)\" (pass);expr; -112;EXPRTest.at:105;expr-test -b -W \$abs_srcdir/expr-testsuite/test.c1 -k \"geogrid(SST,61,97,38,160)\" (pass);expr; -113;EXPRTest.at:106;expr-test -b -w \$abs_srcdir/expr-testsuite/test.c2 -k \"geogrid(SST,61,97,38,160)\" (pass);expr; -114;EXPRTest.at:106;expr-test -b -W \$abs_srcdir/expr-testsuite/test.c2 -k \"geogrid(SST,61,97,38,160)\" (pass);expr; -115;EXPRTest.at:107;expr-test -b -w \$abs_srcdir/expr-testsuite/test.c2 -k \"geogrid(SST,61,97,38,160,\\\"time=1024\\\")\" (pass);expr; -116;EXPRTest.at:107;expr-test -b -W \$abs_srcdir/expr-testsuite/test.c2 -k \"geogrid(SST,61,97,38,160,\\\"time=1024\\\")\" (pass);expr; -117;EXPRTest.at:108;expr-test -b -w \$abs_srcdir/expr-testsuite/test.c3 -k \"geogrid(SST,61,97,38,160)\" (pass);expr; -118;EXPRTest.at:108;expr-test -b -W \$abs_srcdir/expr-testsuite/test.c3 -k \"geogrid(SST,61,97,38,160)\" (pass);expr; -119;EXPRTest.at:109;expr-test -b -w \$abs_srcdir/expr-testsuite/test.c4 -k \"geogrid(SST,61,97,38,160,\\\"time=1024\\\")\" (pass);expr; -120;EXPRTest.at:109;expr-test -b -W \$abs_srcdir/expr-testsuite/test.c4 -k \"geogrid(SST,61,97,38,160,\\\"time=1024\\\")\" (pass);expr; -121;EXPRTest.at:110;expr-test -b -w \$abs_srcdir/expr-testsuite/test.c5 -k \"geogrid(SST,61,97,38,160),geogrid(AIRT,61,97,38,160)\" (pass);expr; -122;EXPRTest.at:110;expr-test -b -W \$abs_srcdir/expr-testsuite/test.c5 -k \"geogrid(SST,61,97,38,160),geogrid(AIRT,61,97,38,160)\" (pass);expr; +105;EXPRTest.at:102;expr-test -b -w \$abs_srcdir/expr-testsuite/test.c0 -k SST (pass);expr; +106;EXPRTest.at:102;expr-test -b -W \$abs_srcdir/expr-testsuite/test.c0 -k SST (pass);expr; " +# List of the all the test groups. +at_groups_all=`$as_echo "$at_help_all" | sed 's/;.*//'` # at_fn_validate_ranges NAME... # ----------------------------- @@ -716,7 +709,7 @@ for at_grp do eval at_value=\$$at_grp - if test $at_value -lt 1 || test $at_value -gt 122; then + if test $at_value -lt 1 || test $at_value -gt 106; then $as_echo "invalid test group: $at_value" >&2 exit 1 fi @@ -741,8 +734,8 @@ fi case $at_option in - *=*) at_optarg=`expr "x$at_option" : 'x[^=]*=\(.*\)'` ;; - *) at_optarg= ;; + *=?*) at_optarg=`expr "X$at_option" : '[^=]*=\(.*\)'` ;; + *) at_optarg= ;; esac # Accept the important Cygnus configure options, so we can diagnose typos. @@ -764,6 +757,19 @@ at_clean=: ;; + --color ) + at_color=always + ;; + --color=* ) + case $at_optarg in + no | never | none) at_color=never ;; + auto | tty | if-tty) at_color=auto ;; + always | yes | force) at_color=always ;; + *) at_optname=`echo " $at_option" | sed 's/^ //; s/=.*//'` + as_fn_error $? "unrecognized argument to $at_optname: $at_optarg" ;; + esac + ;; + --debug | -d ) at_debug_p=: ;; @@ -785,24 +791,24 @@ [0-9] | [0-9][0-9] | [0-9][0-9][0-9] | [0-9][0-9][0-9][0-9]) at_fn_validate_ranges at_option - as_fn_append at_groups "$at_option " + as_fn_append at_groups "$at_option$as_nl" ;; # Ranges [0-9]- | [0-9][0-9]- | [0-9][0-9][0-9]- | [0-9][0-9][0-9][0-9]-) at_range_start=`echo $at_option |tr -d X-` at_fn_validate_ranges at_range_start - at_range=`$as_echo " $at_groups_all " | \ - sed -e 's/^.* \('$at_range_start' \)/\1/'` - as_fn_append at_groups "$at_range " + at_range=`$as_echo "$at_groups_all" | \ + sed -ne '/^'$at_range_start'$/,$p'` + as_fn_append at_groups "$at_range$as_nl" ;; -[0-9] | -[0-9][0-9] | -[0-9][0-9][0-9] | -[0-9][0-9][0-9][0-9]) at_range_end=`echo $at_option |tr -d X-` at_fn_validate_ranges at_range_end - at_range=`$as_echo " $at_groups_all " | \ - sed -e 's/\( '$at_range_end'\) .*$/\1/'` - as_fn_append at_groups "$at_range " + at_range=`$as_echo "$at_groups_all" | \ + sed -ne '1,/^'$at_range_end'$/p'` + as_fn_append at_groups "$at_range$as_nl" ;; [0-9]-[0-9] | [0-9]-[0-9][0-9] | [0-9]-[0-9][0-9][0-9] | \ @@ -819,10 +825,9 @@ at_range_start=$at_tmp fi at_fn_validate_ranges at_range_start at_range_end - at_range=`$as_echo " $at_groups_all " | \ - sed -e 's/^.*\( '$at_range_start' \)/\1/' \ - -e 's/\( '$at_range_end'\) .*$/\1/'` - as_fn_append at_groups "$at_range " + at_range=`$as_echo "$at_groups_all" | \ + sed -ne '/^'$at_range_start'$/,/^'$at_range_end'$/p'` + as_fn_append at_groups "$at_range$as_nl" ;; # Directory selection. @@ -832,6 +837,9 @@ --directory=* ) at_change_dir=: at_dir=$at_optarg + if test x- = "x$at_dir" ; then + at_dir=./- + fi ;; # Parallel execution. @@ -846,7 +854,7 @@ fi case $at_jobs in *[!0-9]*) at_optname=`echo " $at_option" | sed 's/^ //; s/[0-9=].*//'` - as_fn_error "non-numeric argument to $at_optname: $at_jobs" ;; + as_fn_error $? "non-numeric argument to $at_optname: $at_jobs" ;; esac ;; @@ -874,11 +882,12 @@ at_groups_selected=`$as_echo "$at_groups_selected" | grep -i $at_invert "^[1-9][^;]*;.*[; ]$at_keyword[ ;]"` done - # Smash the newlines. - at_groups_selected=`$as_echo "$at_groups_selected" | sed 's/;.*//' | - tr "$as_nl" ' ' - ` - as_fn_append at_groups "$at_groups_selected " + # Smash the keywords. + at_groups_selected=`$as_echo "$at_groups_selected" | sed 's/;.*//'` + as_fn_append at_groups "$at_groups_selected$as_nl" + ;; + --recheck) + at_recheck=: ;; *=*) @@ -886,7 +895,7 @@ # Reject names that are not valid shell variable names. case $at_envvar in '' | [0-9]* | *[!_$as_cr_alnum]* ) - as_fn_error "invalid variable name: \`$at_envvar'" ;; + as_fn_error $? "invalid variable name: \`$at_envvar'" ;; esac at_value=`$as_echo "$at_optarg" | sed "s/'/'\\\\\\\\''/g"` # Export now, but save eval for later and for debug scripts. @@ -903,15 +912,41 @@ # Verify our last option didn't require an argument if test -n "$at_prev"; then : - as_fn_error "\`$at_prev' requires an argument." + as_fn_error $? "\`$at_prev' requires an argument" fi +# The file containing the suite. +at_suite_log=$at_dir/$as_me.log + # Selected test groups. -if test -z "$at_groups"; then +if test -z "$at_groups$at_recheck"; then at_groups=$at_groups_all else + if test -n "$at_recheck" && test -r "$at_suite_log"; then + at_oldfails=`sed -n ' + /^Failed tests:$/,/^Skipped tests:$/{ + s/^[ ]*\([1-9][0-9]*\):.*/\1/p + } + /^Unexpected passes:$/,/^## Detailed failed tests/{ + s/^[ ]*\([1-9][0-9]*\):.*/\1/p + } + /^## Detailed failed tests/q + ' "$at_suite_log"` + as_fn_append at_groups "$at_oldfails$as_nl" + fi # Sort the tests, removing duplicates. - at_groups=`$as_echo "$at_groups" | tr ' ' "$as_nl" | sort -nu` + at_groups=`$as_echo "$at_groups" | sort -nu | sed '/^$/d'` +fi + +if test x"$at_color" = xalways \ + || { test x"$at_color" = xauto && test -t 1; }; then + at_red=`printf '\033[0;31m'` + at_grn=`printf '\033[0;32m'` + at_lgn=`printf '\033[1;32m'` + at_blu=`printf '\033[1;34m'` + at_std=`printf '\033[m'` +else + at_red= at_grn= at_lgn= at_blu= at_std= fi # Help message. @@ -947,11 +982,14 @@ Execution tuning: -C, --directory=DIR change to directory DIR before starting + --color[=never|auto|always] + enable colored test results on terminal, or always -j, --jobs[=N] Allow N jobs at once; infinite jobs with no arg (default 1) -k, --keywords=KEYWORDS select the tests matching all the comma-separated KEYWORDS multiple \`-k' accumulate; prefixed \`!' negates a KEYWORD + --recheck select all tests that failed or passed unexpectedly last time -e, --errexit abort as soon as a test fails; implies --debug -v, --verbose force more detailed output default for debugging scripts @@ -969,27 +1007,19 @@ # List of tests. if $at_list_p; then cat <<_ATEOF || at_write_fail=1 -libdap 3.11.1 test suite: expr-test test groups: +libdap 3.12.0 test suite: expr-test test groups: NUM: FILE-NAME:LINE TEST-GROUP-NAME KEYWORDS _ATEOF - # Passing at_groups is tricky. We cannot use it to form a literal string - # or regexp because of the limitation of AIX awk. And Solaris' awk - # doesn't grok more than 99 fields in a record, so we have to use `split'. - # at_groups needs to be space-separated for this script to work. - case $at_groups in - *"$as_nl"* ) - at_groups=`$as_echo "$at_groups" | tr "$as_nl" ' '` ;; - esac - $as_echo "$at_groups$as_nl$at_help_all" | - awk 'BEGIN { FS = ";" } - NR == 1 { - for (n = split ($ 0, a, " "); n; n--) - selected[a[n]] = 1 + # Pass an empty line as separator between selected groups and help. + $as_echo "$at_groups$as_nl$as_nl$at_help_all" | + awk 'NF == 1 && FS != ";" { + selected[$ 1] = 1 next } + /^$/ { FS = ";" } NF > 0 { if (selected[$ 1]) { printf " %3d: %-18s %s\n", $ 1, $ 2, $ 3 @@ -1018,32 +1048,28 @@ exit $at_write_fail fi if $at_version_p; then - $as_echo "$as_me (libdap 3.11.1)" && + $as_echo "$as_me (libdap 3.12.0)" && cat <<\_ATEOF || at_write_fail=1 -Copyright (C) 2009 Free Software Foundation, Inc. +Copyright (C) 2012 Free Software Foundation, Inc. This test suite is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it. _ATEOF exit $at_write_fail fi -# Should we print banners? at_groups is space-separated for entire test, -# newline-separated if only a subset of the testsuite is run. -case $at_groups in - *' '*' '* | *"$as_nl"*"$as_nl"* ) - at_print_banners=: ;; +# Should we print banners? Yes if more than one test is run. +case $at_groups in #( + *$as_nl* ) + at_print_banners=: ;; #( * ) at_print_banners=false ;; esac -# Text for banner N, set to empty once printed. +# Text for banner N, set to a single space once printed. # Take any -C into account. if $at_change_dir ; then - if test x- = "x$at_dir" ; then - at_dir=./- - fi test x != "x$at_dir" && cd "$at_dir" \ - || as_fn_error "unable to change directory" + || as_fn_error $? "unable to change directory" at_dir=`pwd` fi @@ -1051,11 +1077,11 @@ for at_file in atconfig atlocal do test -r $at_file || continue - . ./$at_file || as_fn_error "invalid content: $at_file" + . ./$at_file || as_fn_error $? "invalid content: $at_file" done # Autoconf <=2.59b set at_top_builddir instead of at_top_build_prefix: -: ${at_top_build_prefix=$at_top_builddir} +: "${at_top_build_prefix=$at_top_builddir}" # Perform any assignments requested during argument parsing. eval "$at_debug_args" @@ -1108,7 +1134,7 @@ # The directory the whole suite works in. # Should be absolute to let the user `cd' at will. at_suite_dir=$at_dir/$as_me.dir -# The file containing the suite. +# The file containing the suite ($at_dir might have changed since earlier). at_suite_log=$at_dir/$as_me.log # The directory containing helper files per test group. at_helper_dir=$at_suite_dir/at-groups @@ -1188,6 +1214,7 @@ # Setting up the FDs. + # 5 is the log file. Not to be overwritten if `-d'. if $at_debug_p; then at_suite_log=/dev/null @@ -1197,43 +1224,28 @@ exec 5>>"$at_suite_log" # Banners and logs. -cat <<\_ASBOX -## ------------------------------------ ## -## libdap 3.11.1 test suite: expr-test. ## -## ------------------------------------ ## -_ASBOX +$as_echo "## ------------------------------------ ## +## libdap 3.12.0 test suite: expr-test. ## +## ------------------------------------ ##" { - cat <<\_ASBOX -## ------------------------------------ ## -## libdap 3.11.1 test suite: expr-test. ## -## ------------------------------------ ## -_ASBOX + $as_echo "## ------------------------------------ ## +## libdap 3.12.0 test suite: expr-test. ## +## ------------------------------------ ##" echo $as_echo "$as_me: command line was:" $as_echo " \$ $0 $at_cli_args" echo - # Try to find a few ChangeLogs in case it might help determining the - # exact version. Use the relative dir: if the top dir is a symlink, - # find will not follow it (and options to follow the links are not - # portable), which would result in no output here. Prune directories - # matching the package tarname, since they tend to be leftovers from - # `make dist' or `make distcheck' and contain redundant or stale logs. - if test -n "$at_top_srcdir"; then - cat <<\_ASBOX -## ----------- ## -## ChangeLogs. ## -## ----------- ## -_ASBOX + # If ChangeLog exists, list a few lines in case it might help determining + # the exact version. + if test -n "$at_top_srcdir" && test -f "$at_top_srcdir/ChangeLog"; then + $as_echo "## ---------- ## +## ChangeLog. ## +## ---------- ##" + echo + sed 's/^/| /;10q' "$at_top_srcdir/ChangeLog" echo - for at_file in `find "$at_top_srcdir" -name "libdap-*" -prune -o -name ChangeLog -print` - do - $as_echo "$as_me: $at_file:" - sed 's/^/| /;10q' $at_file - echo - done - fi { @@ -1296,9 +1308,13 @@ { $at_print_banners || return 0 eval at_banner_text=\$at_banner_text_$1 - test "x$at_banner_text" = x && return 0 - eval at_banner_text_$1= - $as_echo "$as_nl$at_banner_text$as_nl" + test "x$at_banner_text" = "x " && return 0 + eval "at_banner_text_$1=\" \"" + if test -z "$at_banner_text"; then + $at_first || echo + else + $as_echo "$as_nl$at_banner_text$as_nl" + fi } # at_fn_banner # at_fn_check_prepare_notrace REASON LINE @@ -1432,11 +1448,9 @@ ## End of autotest shell functions. ## ## -------------------------------- ## { - cat <<\_ASBOX -## ---------------- ## + $as_echo "## ---------------- ## ## Tested programs. ## -## ---------------- ## -_ASBOX +## ---------------- ##" echo } >&5 @@ -1465,16 +1479,14 @@ echo } >&5 2>&1 else - as_fn_error "cannot find $at_program" "$LINENO" 5 + as_fn_error $? "cannot find $at_program" "$LINENO" 5 fi done { - cat <<\_ASBOX -## ------------------ ## + $as_echo "## ------------------ ## ## Running the tests. ## -## ------------------ ## -_ASBOX +## ------------------ ##" } >&5 at_start_date=`date` @@ -1483,7 +1495,7 @@ # Create the master directory if it doesn't already exist. as_dir="$at_suite_dir"; as_fn_mkdir_p || - as_fn_error "cannot create \`$at_suite_dir'" "$LINENO" 5 + as_fn_error $? "cannot create \`$at_suite_dir'" "$LINENO" 5 # Can we diff with `/dev/null'? DU 5.0 refuses. if diff /dev/null /dev/null >/dev/null 2>&1; then @@ -1517,7 +1529,7 @@ if (test == "'"$at_group"'") exit }' "$at_myself" > "$at_suite_dir/at-source-lines" && . "$at_suite_dir/at-source-lines" || - as_fn_error "cannot create test line number cache" "$LINENO" 5 + as_fn_error $? "cannot create test line number cache" "$LINENO" 5 rm -f "$at_suite_dir/at-source-lines" # Set number of jobs for `-j'; avoid more jobs than test groups. @@ -1541,7 +1553,7 @@ mkdir "$at_helper_dir" && cd "$at_helper_dir" && { test -z "$at_groups" || mkdir $at_groups; } || -as_fn_error "testsuite directory setup failed" "$LINENO" 5 +as_fn_error $? "testsuite directory setup failed" "$LINENO" 5 # Functions for running a test group. We leave the actual # test group execution outside of a shell function in order @@ -1549,7 +1561,7 @@ # at_fn_group_prepare # ------------------- -# Prepare running a test group. +# Prepare for running a test group. at_fn_group_prepare () { # The directory for additional per-group helper files. @@ -1594,8 +1606,8 @@ find "$at_group_dir" -type d ! -perm -700 -exec chmod u+rwx {} \; rm -fr "$at_group_dir"/* "$at_group_dir"/.[!.] "$at_group_dir"/.??* fi || - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: test directory for $at_group_normalized could not be cleaned." >&5 -$as_echo "$as_me: WARNING: test directory for $at_group_normalized could not be cleaned." >&2;} + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: test directory for $at_group_normalized could not be cleaned" >&5 +$as_echo "$as_me: WARNING: test directory for $at_group_normalized could not be cleaned" >&2;} # Be tolerant if the above `rm' was not able to remove the directory. as_dir="$at_group_dir"; as_fn_mkdir_p @@ -1610,6 +1622,25 @@ fi } +# at_fn_group_banner ORDINAL LINE DESC PAD [BANNER] +# ------------------------------------------------- +# Declare the test group ORDINAL, located at LINE with group description DESC, +# and residing under BANNER. Use PAD to align the status column. +at_fn_group_banner () +{ + at_setup_line="$2" + test -n "$5" && at_fn_banner $5 + at_desc="$3" + case $1 in + [0-9]) at_desc_line=" $1: ";; + [0-9][0-9]) at_desc_line=" $1: " ;; + *) at_desc_line="$1: " ;; + esac + as_fn_append at_desc_line "$3$4" + $at_quiet $as_echo_n "$at_desc_line" + echo "# -*- compilation -*-" >> "$at_group_log" +} + # at_fn_group_postprocess # ----------------------- # Perform cleanup after running a test group. @@ -1631,44 +1662,44 @@ $at_verbose $as_echo_n "$at_group. $at_setup_line: " $as_echo_n "$at_group. $at_setup_line: " >> "$at_group_log" case $at_xfail:$at_status in - *:99) - at_msg='FAILED ('`cat "$at_check_line_file"`')' - at_res=fail - at_errexit=$at_errexit_p - ;; yes:0) at_msg="UNEXPECTED PASS" at_res=xpass at_errexit=$at_errexit_p + at_color=$at_red ;; no:0) at_msg="ok" at_res=pass at_errexit=false + at_color=$at_grn ;; *:77) at_msg='skipped ('`cat "$at_check_line_file"`')' at_res=skip at_errexit=false + at_color=$at_blu + ;; + no:* | *:99) + at_msg='FAILED ('`cat "$at_check_line_file"`')' + at_res=fail + at_errexit=$at_errexit_p + at_color=$at_red ;; yes:*) at_msg='expected failure ('`cat "$at_check_line_file"`')' at_res=xfail at_errexit=false - ;; - no:*) - at_msg='FAILED ('`cat "$at_check_line_file"`')' - at_res=fail - at_errexit=$at_errexit_p + at_color=$at_lgn ;; esac echo "$at_res" > "$at_job_dir/$at_res" # In parallel mode, output the summary line only afterwards. if test $at_jobs -ne 1 && test -n "$at_verbose"; then - $as_echo "$at_desc_line $at_msg" + $as_echo "$at_desc_line $at_color$at_msg$at_std" else # Make sure there is a separator even with long titles. - $as_echo " $at_msg" + $as_echo " $at_color$at_msg$at_std" fi at_log_msg="$at_group. $at_desc ($at_setup_line): $at_msg" case $at_status in @@ -1684,9 +1715,13 @@ $as_echo "$at_log_msg" >> "$at_group_log" $as_echo "$at_log_msg" >&5 - # Cleanup the group directory, unless the user wants the files. - if $at_debug_p; then + # Cleanup the group directory, unless the user wants the files + # or the success was unexpected. + if $at_debug_p || test $at_res = xpass; then at_fn_create_debugging_script + if test $at_res = xpass && $at_errexit; then + echo stop > "$at_stop_file" + fi else if test -d "$at_group_dir"; then find "$at_group_dir" -type d ! -perm -700 -exec chmod u+rwx \{\} \; @@ -1772,8 +1807,7 @@ echo # Turn jobs into a list of numbers, starting from 1. - at_joblist=`$as_echo " $at_groups_all " | \ - sed 's/\( '$at_jobs'\) .*/\1/'` + at_joblist=`$as_echo "$at_groups" | sed -n 1,${at_jobs}p` set X $at_joblist shift @@ -1782,28 +1816,32 @@ ( # Start one test group. $at_job_control_off - exec 6>"$at_job_fifo" + if $at_first; then + exec 7>"$at_job_fifo" + else + exec 6<&- + fi trap 'set +x; set +e trap "" PIPE echo stop > "$at_stop_file" - echo token >&6 + echo >&7 as_fn_exit 141' PIPE at_fn_group_prepare if cd "$at_group_dir" && at_fn_test $at_group && - . "$at_test_source" # AT_JOB_FIFO_FD>&- + . "$at_test_source" then :; else { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: unable to parse test group: $at_group" >&5 $as_echo "$as_me: WARNING: unable to parse test group: $at_group" >&2;} at_failed=: fi at_fn_group_postprocess - echo token >&6 + echo >&7 ) & $at_job_control_off if $at_first; then at_first=false - exec 6<"$at_job_fifo" + exec 6<"$at_job_fifo" 7>"$at_job_fifo" fi shift # Consume one token. if test $# -gt 0; then :; else @@ -1812,6 +1850,7 @@ fi test -f "$at_stop_file" && break done + exec 7>&- # Read back the remaining ($at_jobs - 1) tokens. set X $at_joblist shift @@ -1885,19 +1924,15 @@ esac echo -cat <<\_ASBOX -## ------------- ## +$as_echo "## ------------- ## ## Test results. ## -## ------------- ## -_ASBOX +## ------------- ##" echo { echo - cat <<\_ASBOX -## ------------- ## + $as_echo "## ------------- ## ## Test results. ## -## ------------- ## -_ASBOX +## ------------- ##" echo } >&5 @@ -1915,12 +1950,14 @@ at_result="$at_result $at_were run, one failed" fi at_result="$at_result unexpectedly and inhibited subsequent tests." + at_color=$at_red else # Don't you just love exponential explosion of the number of cases? + at_color=$at_red case $at_xpass_count:$at_fail_count:$at_xfail_count in # So far, so good. - 0:0:0) at_result="$at_result $at_were successful." ;; - 0:0:*) at_result="$at_result behaved as expected." ;; + 0:0:0) at_result="$at_result $at_were successful." at_color=$at_grn ;; + 0:0:*) at_result="$at_result behaved as expected." at_color=$at_lgn ;; # Some unexpected failures 0:*:0) at_result="$at_result $at_were run, @@ -1966,18 +2003,16 @@ esac if test $at_unexpected_count = 0; then - echo "$at_result" + echo "$at_color$at_result$at_std" echo "$at_result" >&5 else - echo "ERROR: $at_result" >&2 + echo "${at_color}ERROR: $at_result$at_std" >&2 echo "ERROR: $at_result" >&5 { echo - cat <<\_ASBOX -## ------------------------ ## + $as_echo "## ------------------------ ## ## Summary of the failures. ## -## ------------------------ ## -_ASBOX +## ------------------------ ##" # Summary of failed and skipped tests. if test $at_fail_count != 0; then @@ -1996,11 +2031,9 @@ echo fi if test $at_fail_count != 0; then - cat <<\_ASBOX -## ---------------------- ## + $as_echo "## ---------------------- ## ## Detailed failed tests. ## -## ---------------------- ## -_ASBOX +## ---------------------- ##" echo for at_group in $at_fail_list do @@ -2040,7 +2073,7 @@ $as_echo "Please send $at_msg and all information you think might help: To: - Subject: [libdap 3.11.1] $as_me: $at_fail_list${at_fail_list:+ failed${at_xpass_list:+, }}$at_xpass_list${at_xpass_list:+ passed unexpectedly} + Subject: [libdap 3.12.0] $as_me: $at_fail_list${at_fail_list:+ failed${at_xpass_list:+, }}$at_xpass_list${at_xpass_list:+ passed unexpectedly} You may investigate any problem if you feel able to do so, in which case the test suite provides a good starting point. Its output may @@ -2055,16 +2088,12 @@ ## Actual tests. ## ## ------------- ## #AT_START_1 -# 1. EXPRTest.at:45: expr-test -w $abs_srcdir/expr-testsuite/test.1 -k i (pass) -at_setup_line='EXPRTest.at:45' -at_desc="expr-test -w \$abs_srcdir/expr-testsuite/test.1 -k i (pass)" -at_desc_line=" 1: $at_desc" -$at_quiet $as_echo_n "$at_desc_line" +at_fn_group_banner 1 'EXPRTest.at:45' \ + "expr-test -w \$abs_srcdir/expr-testsuite/test.1 -k i (pass)" "" at_xfail=no test "pass" = "xfail" && at_xfail=yes -echo "# -*- compilation -*-" >> "$at_group_log" ( - $as_echo "1. EXPRTest.at:45: testing ..." + $as_echo "1. $at_setup_line: testing $at_desc ..." $at_traceon @@ -2080,7 +2109,7 @@ $as_echo "$at_srcdir/EXPRTest.at:45: \$abs_builddir/expr-test -w \$abs_srcdir/expr-testsuite/test.1 -k i -f \"dummy\" || true" at_fn_check_prepare_dynamic "$abs_builddir/expr-test -w $abs_srcdir/expr-testsuite/test.1 -k i -f \"dummy\" || true" "EXPRTest.at:45" ( $at_check_trace; $abs_builddir/expr-test -w $abs_srcdir/expr-testsuite/test.1 -k i -f "dummy" || true -) >>"$at_stdout" 2>>"$at_stderr" +) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" @@ -2093,7 +2122,7 @@ $as_echo "$at_srcdir/EXPRTest.at:45: diff -b -B \$abs_srcdir/expr-testsuite/test.1.base stdout || diff -b -B \$abs_srcdir/expr-testsuite/test.1.base stderr" at_fn_check_prepare_dynamic "diff -b -B $abs_srcdir/expr-testsuite/test.1.base stdout || diff -b -B $abs_srcdir/expr-testsuite/test.1.base stderr" "EXPRTest.at:45" ( $at_check_trace; diff -b -B $abs_srcdir/expr-testsuite/test.1.base stdout || diff -b -B $abs_srcdir/expr-testsuite/test.1.base stderr -) >>"$at_stdout" 2>>"$at_stderr" +) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: @@ -2105,20 +2134,16 @@ set +x $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 | eval $at_tee_pipe +) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_1 #AT_START_2 -# 2. EXPRTest.at:45: expr-test -W $abs_srcdir/expr-testsuite/test.1 -k i (pass) -at_setup_line='EXPRTest.at:45' -at_desc="expr-test -W \$abs_srcdir/expr-testsuite/test.1 -k i (pass)" -at_desc_line=" 2: $at_desc" -$at_quiet $as_echo_n "$at_desc_line" +at_fn_group_banner 2 'EXPRTest.at:45' \ + "expr-test -W \$abs_srcdir/expr-testsuite/test.1 -k i (pass)" "" at_xfail=no test "pass" = "xfail" && at_xfail=yes -echo "# -*- compilation -*-" >> "$at_group_log" ( - $as_echo "2. EXPRTest.at:45: testing ..." + $as_echo "2. $at_setup_line: testing $at_desc ..." $at_traceon @@ -2134,7 +2159,7 @@ $as_echo "$at_srcdir/EXPRTest.at:45: \$abs_builddir/expr-test -W \$abs_srcdir/expr-testsuite/test.1 -k i -f \"dummy\" || true" at_fn_check_prepare_dynamic "$abs_builddir/expr-test -W $abs_srcdir/expr-testsuite/test.1 -k i -f \"dummy\" || true" "EXPRTest.at:45" ( $at_check_trace; $abs_builddir/expr-test -W $abs_srcdir/expr-testsuite/test.1 -k i -f "dummy" || true -) >>"$at_stdout" 2>>"$at_stderr" +) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" @@ -2147,7 +2172,7 @@ $as_echo "$at_srcdir/EXPRTest.at:45: diff -b -B \$abs_srcdir/expr-testsuite/test.1.base stdout || diff -b -B \$abs_srcdir/expr-testsuite/test.1.base stderr" at_fn_check_prepare_dynamic "diff -b -B $abs_srcdir/expr-testsuite/test.1.base stdout || diff -b -B $abs_srcdir/expr-testsuite/test.1.base stderr" "EXPRTest.at:45" ( $at_check_trace; diff -b -B $abs_srcdir/expr-testsuite/test.1.base stdout || diff -b -B $abs_srcdir/expr-testsuite/test.1.base stderr -) >>"$at_stdout" 2>>"$at_stderr" +) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: @@ -2159,20 +2184,16 @@ set +x $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 | eval $at_tee_pipe +) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_2 #AT_START_3 -# 3. EXPRTest.at:46: expr-test -w $abs_srcdir/expr-testsuite/test.1 -k i,j (pass) -at_setup_line='EXPRTest.at:46' -at_desc="expr-test -w \$abs_srcdir/expr-testsuite/test.1 -k i,j (pass)" -at_desc_line=" 3: $at_desc" -$at_quiet $as_echo_n "$at_desc_line" +at_fn_group_banner 3 'EXPRTest.at:46' \ + "expr-test -w \$abs_srcdir/expr-testsuite/test.1 -k i,j (pass)" "" at_xfail=no test "pass" = "xfail" && at_xfail=yes -echo "# -*- compilation -*-" >> "$at_group_log" ( - $as_echo "3. EXPRTest.at:46: testing ..." + $as_echo "3. $at_setup_line: testing $at_desc ..." $at_traceon @@ -2188,7 +2209,7 @@ $as_echo "$at_srcdir/EXPRTest.at:46: \$abs_builddir/expr-test -w \$abs_srcdir/expr-testsuite/test.1 -k i,j -f \"dummy\" || true" at_fn_check_prepare_dynamic "$abs_builddir/expr-test -w $abs_srcdir/expr-testsuite/test.1 -k i,j -f \"dummy\" || true" "EXPRTest.at:46" ( $at_check_trace; $abs_builddir/expr-test -w $abs_srcdir/expr-testsuite/test.1 -k i,j -f "dummy" || true -) >>"$at_stdout" 2>>"$at_stderr" +) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" @@ -2201,7 +2222,7 @@ $as_echo "$at_srcdir/EXPRTest.at:46: diff -b -B \$abs_srcdir/expr-testsuite/test.1a.base stdout || diff -b -B \$abs_srcdir/expr-testsuite/test.1a.base stderr" at_fn_check_prepare_dynamic "diff -b -B $abs_srcdir/expr-testsuite/test.1a.base stdout || diff -b -B $abs_srcdir/expr-testsuite/test.1a.base stderr" "EXPRTest.at:46" ( $at_check_trace; diff -b -B $abs_srcdir/expr-testsuite/test.1a.base stdout || diff -b -B $abs_srcdir/expr-testsuite/test.1a.base stderr -) >>"$at_stdout" 2>>"$at_stderr" +) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: @@ -2213,20 +2234,16 @@ set +x $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 | eval $at_tee_pipe +) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_3 #AT_START_4 -# 4. EXPRTest.at:46: expr-test -W $abs_srcdir/expr-testsuite/test.1 -k i,j (pass) -at_setup_line='EXPRTest.at:46' -at_desc="expr-test -W \$abs_srcdir/expr-testsuite/test.1 -k i,j (pass)" -at_desc_line=" 4: $at_desc" -$at_quiet $as_echo_n "$at_desc_line" +at_fn_group_banner 4 'EXPRTest.at:46' \ + "expr-test -W \$abs_srcdir/expr-testsuite/test.1 -k i,j (pass)" "" at_xfail=no test "pass" = "xfail" && at_xfail=yes -echo "# -*- compilation -*-" >> "$at_group_log" ( - $as_echo "4. EXPRTest.at:46: testing ..." + $as_echo "4. $at_setup_line: testing $at_desc ..." $at_traceon @@ -2242,7 +2259,7 @@ $as_echo "$at_srcdir/EXPRTest.at:46: \$abs_builddir/expr-test -W \$abs_srcdir/expr-testsuite/test.1 -k i,j -f \"dummy\" || true" at_fn_check_prepare_dynamic "$abs_builddir/expr-test -W $abs_srcdir/expr-testsuite/test.1 -k i,j -f \"dummy\" || true" "EXPRTest.at:46" ( $at_check_trace; $abs_builddir/expr-test -W $abs_srcdir/expr-testsuite/test.1 -k i,j -f "dummy" || true -) >>"$at_stdout" 2>>"$at_stderr" +) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" @@ -2255,7 +2272,7 @@ $as_echo "$at_srcdir/EXPRTest.at:46: diff -b -B \$abs_srcdir/expr-testsuite/test.1a.base stdout || diff -b -B \$abs_srcdir/expr-testsuite/test.1a.base stderr" at_fn_check_prepare_dynamic "diff -b -B $abs_srcdir/expr-testsuite/test.1a.base stdout || diff -b -B $abs_srcdir/expr-testsuite/test.1a.base stderr" "EXPRTest.at:46" ( $at_check_trace; diff -b -B $abs_srcdir/expr-testsuite/test.1a.base stdout || diff -b -B $abs_srcdir/expr-testsuite/test.1a.base stderr -) >>"$at_stdout" 2>>"$at_stderr" +) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: @@ -2267,20 +2284,16 @@ set +x $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 | eval $at_tee_pipe +) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_4 #AT_START_5 -# 5. EXPRTest.at:47: expr-test -w $abs_srcdir/expr-testsuite/test.1 -k 'i,j&i=j' (pass) -at_setup_line='EXPRTest.at:47' -at_desc="expr-test -w \$abs_srcdir/expr-testsuite/test.1 -k 'i,j&i=j' (pass)" -at_desc_line=" 5: $at_desc" -$at_quiet $as_echo_n "$at_desc_line" +at_fn_group_banner 5 'EXPRTest.at:47' \ + "expr-test -w \$abs_srcdir/expr-testsuite/test.1 -k 'i,j&i=j' (pass)" "" at_xfail=no test "pass" = "xfail" && at_xfail=yes -echo "# -*- compilation -*-" >> "$at_group_log" ( - $as_echo "5. EXPRTest.at:47: testing ..." + $as_echo "5. $at_setup_line: testing $at_desc ..." $at_traceon @@ -2296,7 +2309,7 @@ $as_echo "$at_srcdir/EXPRTest.at:47: \$abs_builddir/expr-test -w \$abs_srcdir/expr-testsuite/test.1 -k 'i,j&i=j' -f \"dummy\" || true" at_fn_check_prepare_dynamic "$abs_builddir/expr-test -w $abs_srcdir/expr-testsuite/test.1 -k 'i,j&i=j' -f \"dummy\" || true" "EXPRTest.at:47" ( $at_check_trace; $abs_builddir/expr-test -w $abs_srcdir/expr-testsuite/test.1 -k 'i,j&i=j' -f "dummy" || true -) >>"$at_stdout" 2>>"$at_stderr" +) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" @@ -2309,7 +2322,7 @@ $as_echo "$at_srcdir/EXPRTest.at:47: diff -b -B \$abs_srcdir/expr-testsuite/test.1b.base stdout || diff -b -B \$abs_srcdir/expr-testsuite/test.1b.base stderr" at_fn_check_prepare_dynamic "diff -b -B $abs_srcdir/expr-testsuite/test.1b.base stdout || diff -b -B $abs_srcdir/expr-testsuite/test.1b.base stderr" "EXPRTest.at:47" ( $at_check_trace; diff -b -B $abs_srcdir/expr-testsuite/test.1b.base stdout || diff -b -B $abs_srcdir/expr-testsuite/test.1b.base stderr -) >>"$at_stdout" 2>>"$at_stderr" +) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: @@ -2321,20 +2334,16 @@ set +x $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 | eval $at_tee_pipe +) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_5 #AT_START_6 -# 6. EXPRTest.at:47: expr-test -W $abs_srcdir/expr-testsuite/test.1 -k 'i,j&i=j' (pass) -at_setup_line='EXPRTest.at:47' -at_desc="expr-test -W \$abs_srcdir/expr-testsuite/test.1 -k 'i,j&i=j' (pass)" -at_desc_line=" 6: $at_desc" -$at_quiet $as_echo_n "$at_desc_line" +at_fn_group_banner 6 'EXPRTest.at:47' \ + "expr-test -W \$abs_srcdir/expr-testsuite/test.1 -k 'i,j&i=j' (pass)" "" at_xfail=no test "pass" = "xfail" && at_xfail=yes -echo "# -*- compilation -*-" >> "$at_group_log" ( - $as_echo "6. EXPRTest.at:47: testing ..." + $as_echo "6. $at_setup_line: testing $at_desc ..." $at_traceon @@ -2350,7 +2359,7 @@ $as_echo "$at_srcdir/EXPRTest.at:47: \$abs_builddir/expr-test -W \$abs_srcdir/expr-testsuite/test.1 -k 'i,j&i=j' -f \"dummy\" || true" at_fn_check_prepare_dynamic "$abs_builddir/expr-test -W $abs_srcdir/expr-testsuite/test.1 -k 'i,j&i=j' -f \"dummy\" || true" "EXPRTest.at:47" ( $at_check_trace; $abs_builddir/expr-test -W $abs_srcdir/expr-testsuite/test.1 -k 'i,j&i=j' -f "dummy" || true -) >>"$at_stdout" 2>>"$at_stderr" +) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" @@ -2363,7 +2372,7 @@ $as_echo "$at_srcdir/EXPRTest.at:47: diff -b -B \$abs_srcdir/expr-testsuite/test.1b.base stdout || diff -b -B \$abs_srcdir/expr-testsuite/test.1b.base stderr" at_fn_check_prepare_dynamic "diff -b -B $abs_srcdir/expr-testsuite/test.1b.base stdout || diff -b -B $abs_srcdir/expr-testsuite/test.1b.base stderr" "EXPRTest.at:47" ( $at_check_trace; diff -b -B $abs_srcdir/expr-testsuite/test.1b.base stdout || diff -b -B $abs_srcdir/expr-testsuite/test.1b.base stderr -) >>"$at_stdout" 2>>"$at_stderr" +) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: @@ -2375,20 +2384,16 @@ set +x $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 | eval $at_tee_pipe +) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_6 #AT_START_7 -# 7. EXPRTest.at:48: expr-test -w $abs_srcdir/expr-testsuite/test.1 -k 'i&i=j' (pass) -at_setup_line='EXPRTest.at:48' -at_desc="expr-test -w \$abs_srcdir/expr-testsuite/test.1 -k 'i&i=j' (pass)" -at_desc_line=" 7: $at_desc" -$at_quiet $as_echo_n "$at_desc_line" +at_fn_group_banner 7 'EXPRTest.at:48' \ + "expr-test -w \$abs_srcdir/expr-testsuite/test.1 -k 'i&i=j' (pass)" "" at_xfail=no test "pass" = "xfail" && at_xfail=yes -echo "# -*- compilation -*-" >> "$at_group_log" ( - $as_echo "7. EXPRTest.at:48: testing ..." + $as_echo "7. $at_setup_line: testing $at_desc ..." $at_traceon @@ -2404,7 +2409,7 @@ $as_echo "$at_srcdir/EXPRTest.at:48: \$abs_builddir/expr-test -w \$abs_srcdir/expr-testsuite/test.1 -k 'i&i=j' -f \"dummy\" || true" at_fn_check_prepare_dynamic "$abs_builddir/expr-test -w $abs_srcdir/expr-testsuite/test.1 -k 'i&i=j' -f \"dummy\" || true" "EXPRTest.at:48" ( $at_check_trace; $abs_builddir/expr-test -w $abs_srcdir/expr-testsuite/test.1 -k 'i&i=j' -f "dummy" || true -) >>"$at_stdout" 2>>"$at_stderr" +) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" @@ -2417,7 +2422,7 @@ $as_echo "$at_srcdir/EXPRTest.at:48: diff -b -B \$abs_srcdir/expr-testsuite/test.1d.base stdout || diff -b -B \$abs_srcdir/expr-testsuite/test.1d.base stderr" at_fn_check_prepare_dynamic "diff -b -B $abs_srcdir/expr-testsuite/test.1d.base stdout || diff -b -B $abs_srcdir/expr-testsuite/test.1d.base stderr" "EXPRTest.at:48" ( $at_check_trace; diff -b -B $abs_srcdir/expr-testsuite/test.1d.base stdout || diff -b -B $abs_srcdir/expr-testsuite/test.1d.base stderr -) >>"$at_stdout" 2>>"$at_stderr" +) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: @@ -2429,20 +2434,16 @@ set +x $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 | eval $at_tee_pipe +) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_7 #AT_START_8 -# 8. EXPRTest.at:48: expr-test -W $abs_srcdir/expr-testsuite/test.1 -k 'i&i=j' (pass) -at_setup_line='EXPRTest.at:48' -at_desc="expr-test -W \$abs_srcdir/expr-testsuite/test.1 -k 'i&i=j' (pass)" -at_desc_line=" 8: $at_desc" -$at_quiet $as_echo_n "$at_desc_line" +at_fn_group_banner 8 'EXPRTest.at:48' \ + "expr-test -W \$abs_srcdir/expr-testsuite/test.1 -k 'i&i=j' (pass)" "" at_xfail=no test "pass" = "xfail" && at_xfail=yes -echo "# -*- compilation -*-" >> "$at_group_log" ( - $as_echo "8. EXPRTest.at:48: testing ..." + $as_echo "8. $at_setup_line: testing $at_desc ..." $at_traceon @@ -2458,7 +2459,7 @@ $as_echo "$at_srcdir/EXPRTest.at:48: \$abs_builddir/expr-test -W \$abs_srcdir/expr-testsuite/test.1 -k 'i&i=j' -f \"dummy\" || true" at_fn_check_prepare_dynamic "$abs_builddir/expr-test -W $abs_srcdir/expr-testsuite/test.1 -k 'i&i=j' -f \"dummy\" || true" "EXPRTest.at:48" ( $at_check_trace; $abs_builddir/expr-test -W $abs_srcdir/expr-testsuite/test.1 -k 'i&i=j' -f "dummy" || true -) >>"$at_stdout" 2>>"$at_stderr" +) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" @@ -2471,7 +2472,7 @@ $as_echo "$at_srcdir/EXPRTest.at:48: diff -b -B \$abs_srcdir/expr-testsuite/test.1d.base stdout || diff -b -B \$abs_srcdir/expr-testsuite/test.1d.base stderr" at_fn_check_prepare_dynamic "diff -b -B $abs_srcdir/expr-testsuite/test.1d.base stdout || diff -b -B $abs_srcdir/expr-testsuite/test.1d.base stderr" "EXPRTest.at:48" ( $at_check_trace; diff -b -B $abs_srcdir/expr-testsuite/test.1d.base stdout || diff -b -B $abs_srcdir/expr-testsuite/test.1d.base stderr -) >>"$at_stdout" 2>>"$at_stderr" +) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: @@ -2483,20 +2484,16 @@ set +x $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 | eval $at_tee_pipe +) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_8 #AT_START_9 -# 9. EXPRTest.at:49: expr-test -w $abs_srcdir/expr-testsuite/test.2 -k s1 (pass) -at_setup_line='EXPRTest.at:49' -at_desc="expr-test -w \$abs_srcdir/expr-testsuite/test.2 -k s1 (pass)" -at_desc_line=" 9: $at_desc" -$at_quiet $as_echo_n "$at_desc_line" +at_fn_group_banner 9 'EXPRTest.at:49' \ + "expr-test -w \$abs_srcdir/expr-testsuite/test.2 -k s1 (pass)" "" at_xfail=no test "pass" = "xfail" && at_xfail=yes -echo "# -*- compilation -*-" >> "$at_group_log" ( - $as_echo "9. EXPRTest.at:49: testing ..." + $as_echo "9. $at_setup_line: testing $at_desc ..." $at_traceon @@ -2512,7 +2509,7 @@ $as_echo "$at_srcdir/EXPRTest.at:49: \$abs_builddir/expr-test -w \$abs_srcdir/expr-testsuite/test.2 -k s1 -f \"dummy\" || true" at_fn_check_prepare_dynamic "$abs_builddir/expr-test -w $abs_srcdir/expr-testsuite/test.2 -k s1 -f \"dummy\" || true" "EXPRTest.at:49" ( $at_check_trace; $abs_builddir/expr-test -w $abs_srcdir/expr-testsuite/test.2 -k s1 -f "dummy" || true -) >>"$at_stdout" 2>>"$at_stderr" +) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" @@ -2525,7 +2522,7 @@ $as_echo "$at_srcdir/EXPRTest.at:49: diff -b -B \$abs_srcdir/expr-testsuite/test.2.base stdout || diff -b -B \$abs_srcdir/expr-testsuite/test.2.base stderr" at_fn_check_prepare_dynamic "diff -b -B $abs_srcdir/expr-testsuite/test.2.base stdout || diff -b -B $abs_srcdir/expr-testsuite/test.2.base stderr" "EXPRTest.at:49" ( $at_check_trace; diff -b -B $abs_srcdir/expr-testsuite/test.2.base stdout || diff -b -B $abs_srcdir/expr-testsuite/test.2.base stderr -) >>"$at_stdout" 2>>"$at_stderr" +) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: @@ -2537,20 +2534,16 @@ set +x $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 | eval $at_tee_pipe +) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_9 #AT_START_10 -# 10. EXPRTest.at:49: expr-test -W $abs_srcdir/expr-testsuite/test.2 -k s1 (pass) -at_setup_line='EXPRTest.at:49' -at_desc="expr-test -W \$abs_srcdir/expr-testsuite/test.2 -k s1 (pass)" -at_desc_line=" 10: $at_desc" -$at_quiet $as_echo_n "$at_desc_line" +at_fn_group_banner 10 'EXPRTest.at:49' \ + "expr-test -W \$abs_srcdir/expr-testsuite/test.2 -k s1 (pass)" "" at_xfail=no test "pass" = "xfail" && at_xfail=yes -echo "# -*- compilation -*-" >> "$at_group_log" ( - $as_echo "10. EXPRTest.at:49: testing ..." + $as_echo "10. $at_setup_line: testing $at_desc ..." $at_traceon @@ -2566,7 +2559,7 @@ $as_echo "$at_srcdir/EXPRTest.at:49: \$abs_builddir/expr-test -W \$abs_srcdir/expr-testsuite/test.2 -k s1 -f \"dummy\" || true" at_fn_check_prepare_dynamic "$abs_builddir/expr-test -W $abs_srcdir/expr-testsuite/test.2 -k s1 -f \"dummy\" || true" "EXPRTest.at:49" ( $at_check_trace; $abs_builddir/expr-test -W $abs_srcdir/expr-testsuite/test.2 -k s1 -f "dummy" || true -) >>"$at_stdout" 2>>"$at_stderr" +) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" @@ -2579,7 +2572,7 @@ $as_echo "$at_srcdir/EXPRTest.at:49: diff -b -B \$abs_srcdir/expr-testsuite/test.2.base stdout || diff -b -B \$abs_srcdir/expr-testsuite/test.2.base stderr" at_fn_check_prepare_dynamic "diff -b -B $abs_srcdir/expr-testsuite/test.2.base stdout || diff -b -B $abs_srcdir/expr-testsuite/test.2.base stderr" "EXPRTest.at:49" ( $at_check_trace; diff -b -B $abs_srcdir/expr-testsuite/test.2.base stdout || diff -b -B $abs_srcdir/expr-testsuite/test.2.base stderr -) >>"$at_stdout" 2>>"$at_stderr" +) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: @@ -2591,20 +2584,16 @@ set +x $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 | eval $at_tee_pipe +) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_10 #AT_START_11 -# 11. EXPRTest.at:50: expr-test -w $abs_srcdir/expr-testsuite/test.2 -k s2 (pass) -at_setup_line='EXPRTest.at:50' -at_desc="expr-test -w \$abs_srcdir/expr-testsuite/test.2 -k s2 (pass)" -at_desc_line=" 11: $at_desc" -$at_quiet $as_echo_n "$at_desc_line" +at_fn_group_banner 11 'EXPRTest.at:50' \ + "expr-test -w \$abs_srcdir/expr-testsuite/test.2 -k s2 (pass)" "" at_xfail=no test "pass" = "xfail" && at_xfail=yes -echo "# -*- compilation -*-" >> "$at_group_log" ( - $as_echo "11. EXPRTest.at:50: testing ..." + $as_echo "11. $at_setup_line: testing $at_desc ..." $at_traceon @@ -2620,7 +2609,7 @@ $as_echo "$at_srcdir/EXPRTest.at:50: \$abs_builddir/expr-test -w \$abs_srcdir/expr-testsuite/test.2 -k s2 -f \"dummy\" || true" at_fn_check_prepare_dynamic "$abs_builddir/expr-test -w $abs_srcdir/expr-testsuite/test.2 -k s2 -f \"dummy\" || true" "EXPRTest.at:50" ( $at_check_trace; $abs_builddir/expr-test -w $abs_srcdir/expr-testsuite/test.2 -k s2 -f "dummy" || true -) >>"$at_stdout" 2>>"$at_stderr" +) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" @@ -2633,7 +2622,7 @@ $as_echo "$at_srcdir/EXPRTest.at:50: diff -b -B \$abs_srcdir/expr-testsuite/test.2a.base stdout || diff -b -B \$abs_srcdir/expr-testsuite/test.2a.base stderr" at_fn_check_prepare_dynamic "diff -b -B $abs_srcdir/expr-testsuite/test.2a.base stdout || diff -b -B $abs_srcdir/expr-testsuite/test.2a.base stderr" "EXPRTest.at:50" ( $at_check_trace; diff -b -B $abs_srcdir/expr-testsuite/test.2a.base stdout || diff -b -B $abs_srcdir/expr-testsuite/test.2a.base stderr -) >>"$at_stdout" 2>>"$at_stderr" +) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: @@ -2645,20 +2634,16 @@ set +x $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 | eval $at_tee_pipe +) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_11 #AT_START_12 -# 12. EXPRTest.at:50: expr-test -W $abs_srcdir/expr-testsuite/test.2 -k s2 (pass) -at_setup_line='EXPRTest.at:50' -at_desc="expr-test -W \$abs_srcdir/expr-testsuite/test.2 -k s2 (pass)" -at_desc_line=" 12: $at_desc" -$at_quiet $as_echo_n "$at_desc_line" +at_fn_group_banner 12 'EXPRTest.at:50' \ + "expr-test -W \$abs_srcdir/expr-testsuite/test.2 -k s2 (pass)" "" at_xfail=no test "pass" = "xfail" && at_xfail=yes -echo "# -*- compilation -*-" >> "$at_group_log" ( - $as_echo "12. EXPRTest.at:50: testing ..." + $as_echo "12. $at_setup_line: testing $at_desc ..." $at_traceon @@ -2674,7 +2659,7 @@ $as_echo "$at_srcdir/EXPRTest.at:50: \$abs_builddir/expr-test -W \$abs_srcdir/expr-testsuite/test.2 -k s2 -f \"dummy\" || true" at_fn_check_prepare_dynamic "$abs_builddir/expr-test -W $abs_srcdir/expr-testsuite/test.2 -k s2 -f \"dummy\" || true" "EXPRTest.at:50" ( $at_check_trace; $abs_builddir/expr-test -W $abs_srcdir/expr-testsuite/test.2 -k s2 -f "dummy" || true -) >>"$at_stdout" 2>>"$at_stderr" +) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" @@ -2687,7 +2672,7 @@ $as_echo "$at_srcdir/EXPRTest.at:50: diff -b -B \$abs_srcdir/expr-testsuite/test.2a.base stdout || diff -b -B \$abs_srcdir/expr-testsuite/test.2a.base stderr" at_fn_check_prepare_dynamic "diff -b -B $abs_srcdir/expr-testsuite/test.2a.base stdout || diff -b -B $abs_srcdir/expr-testsuite/test.2a.base stderr" "EXPRTest.at:50" ( $at_check_trace; diff -b -B $abs_srcdir/expr-testsuite/test.2a.base stdout || diff -b -B $abs_srcdir/expr-testsuite/test.2a.base stderr -) >>"$at_stdout" 2>>"$at_stderr" +) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: @@ -2699,20 +2684,16 @@ set +x $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 | eval $at_tee_pipe +) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_12 #AT_START_13 -# 13. EXPRTest.at:51: expr-test -w $abs_srcdir/expr-testsuite/test.2 -k s2,s3 (pass) -at_setup_line='EXPRTest.at:51' -at_desc="expr-test -w \$abs_srcdir/expr-testsuite/test.2 -k s2,s3 (pass)" -at_desc_line=" 13: $at_desc" -$at_quiet $as_echo_n "$at_desc_line" +at_fn_group_banner 13 'EXPRTest.at:51' \ + "expr-test -w \$abs_srcdir/expr-testsuite/test.2 -k s2,s3 (pass)" "" at_xfail=no test "pass" = "xfail" && at_xfail=yes -echo "# -*- compilation -*-" >> "$at_group_log" ( - $as_echo "13. EXPRTest.at:51: testing ..." + $as_echo "13. $at_setup_line: testing $at_desc ..." $at_traceon @@ -2728,7 +2709,7 @@ $as_echo "$at_srcdir/EXPRTest.at:51: \$abs_builddir/expr-test -w \$abs_srcdir/expr-testsuite/test.2 -k s2,s3 -f \"dummy\" || true" at_fn_check_prepare_dynamic "$abs_builddir/expr-test -w $abs_srcdir/expr-testsuite/test.2 -k s2,s3 -f \"dummy\" || true" "EXPRTest.at:51" ( $at_check_trace; $abs_builddir/expr-test -w $abs_srcdir/expr-testsuite/test.2 -k s2,s3 -f "dummy" || true -) >>"$at_stdout" 2>>"$at_stderr" +) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" @@ -2741,7 +2722,7 @@ $as_echo "$at_srcdir/EXPRTest.at:51: diff -b -B \$abs_srcdir/expr-testsuite/test.2b.base stdout || diff -b -B \$abs_srcdir/expr-testsuite/test.2b.base stderr" at_fn_check_prepare_dynamic "diff -b -B $abs_srcdir/expr-testsuite/test.2b.base stdout || diff -b -B $abs_srcdir/expr-testsuite/test.2b.base stderr" "EXPRTest.at:51" ( $at_check_trace; diff -b -B $abs_srcdir/expr-testsuite/test.2b.base stdout || diff -b -B $abs_srcdir/expr-testsuite/test.2b.base stderr -) >>"$at_stdout" 2>>"$at_stderr" +) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: @@ -2753,20 +2734,16 @@ set +x $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 | eval $at_tee_pipe +) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_13 #AT_START_14 -# 14. EXPRTest.at:51: expr-test -W $abs_srcdir/expr-testsuite/test.2 -k s2,s3 (pass) -at_setup_line='EXPRTest.at:51' -at_desc="expr-test -W \$abs_srcdir/expr-testsuite/test.2 -k s2,s3 (pass)" -at_desc_line=" 14: $at_desc" -$at_quiet $as_echo_n "$at_desc_line" +at_fn_group_banner 14 'EXPRTest.at:51' \ + "expr-test -W \$abs_srcdir/expr-testsuite/test.2 -k s2,s3 (pass)" "" at_xfail=no test "pass" = "xfail" && at_xfail=yes -echo "# -*- compilation -*-" >> "$at_group_log" ( - $as_echo "14. EXPRTest.at:51: testing ..." + $as_echo "14. $at_setup_line: testing $at_desc ..." $at_traceon @@ -2782,7 +2759,7 @@ $as_echo "$at_srcdir/EXPRTest.at:51: \$abs_builddir/expr-test -W \$abs_srcdir/expr-testsuite/test.2 -k s2,s3 -f \"dummy\" || true" at_fn_check_prepare_dynamic "$abs_builddir/expr-test -W $abs_srcdir/expr-testsuite/test.2 -k s2,s3 -f \"dummy\" || true" "EXPRTest.at:51" ( $at_check_trace; $abs_builddir/expr-test -W $abs_srcdir/expr-testsuite/test.2 -k s2,s3 -f "dummy" || true -) >>"$at_stdout" 2>>"$at_stderr" +) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" @@ -2795,7 +2772,7 @@ $as_echo "$at_srcdir/EXPRTest.at:51: diff -b -B \$abs_srcdir/expr-testsuite/test.2b.base stdout || diff -b -B \$abs_srcdir/expr-testsuite/test.2b.base stderr" at_fn_check_prepare_dynamic "diff -b -B $abs_srcdir/expr-testsuite/test.2b.base stdout || diff -b -B $abs_srcdir/expr-testsuite/test.2b.base stderr" "EXPRTest.at:51" ( $at_check_trace; diff -b -B $abs_srcdir/expr-testsuite/test.2b.base stdout || diff -b -B $abs_srcdir/expr-testsuite/test.2b.base stderr -) >>"$at_stdout" 2>>"$at_stderr" +) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: @@ -2807,20 +2784,16 @@ set +x $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 | eval $at_tee_pipe +) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_14 #AT_START_15 -# 15. EXPRTest.at:52: expr-test -w $abs_srcdir/expr-testsuite/test.2 -k s2[2:2:4],s3.o (pass) -at_setup_line='EXPRTest.at:52' -at_desc="expr-test -w \$abs_srcdir/expr-testsuite/test.2 -k s2[2:2:4],s3.o (pass)" -at_desc_line=" 15: $at_desc" -$at_quiet $as_echo_n "$at_desc_line" +at_fn_group_banner 15 'EXPRTest.at:52' \ + "expr-test -w \$abs_srcdir/expr-testsuite/test.2 -k s2[2:2:4],s3.o (pass)" "" at_xfail=no test "pass" = "xfail" && at_xfail=yes -echo "# -*- compilation -*-" >> "$at_group_log" ( - $as_echo "15. EXPRTest.at:52: testing ..." + $as_echo "15. $at_setup_line: testing $at_desc ..." $at_traceon @@ -2836,7 +2809,7 @@ $as_echo "$at_srcdir/EXPRTest.at:52: \$abs_builddir/expr-test -w \$abs_srcdir/expr-testsuite/test.2 -k s2[2:2:4],s3.o -f \"dummy\" || true" at_fn_check_prepare_dynamic "$abs_builddir/expr-test -w $abs_srcdir/expr-testsuite/test.2 -k s2[2:2:4],s3.o -f \"dummy\" || true" "EXPRTest.at:52" ( $at_check_trace; $abs_builddir/expr-test -w $abs_srcdir/expr-testsuite/test.2 -k s2[2:2:4],s3.o -f "dummy" || true -) >>"$at_stdout" 2>>"$at_stderr" +) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" @@ -2849,7 +2822,7 @@ $as_echo "$at_srcdir/EXPRTest.at:52: diff -b -B \$abs_srcdir/expr-testsuite/test.2c.base stdout || diff -b -B \$abs_srcdir/expr-testsuite/test.2c.base stderr" at_fn_check_prepare_dynamic "diff -b -B $abs_srcdir/expr-testsuite/test.2c.base stdout || diff -b -B $abs_srcdir/expr-testsuite/test.2c.base stderr" "EXPRTest.at:52" ( $at_check_trace; diff -b -B $abs_srcdir/expr-testsuite/test.2c.base stdout || diff -b -B $abs_srcdir/expr-testsuite/test.2c.base stderr -) >>"$at_stdout" 2>>"$at_stderr" +) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: @@ -2861,20 +2834,16 @@ set +x $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 | eval $at_tee_pipe +) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_15 #AT_START_16 -# 16. EXPRTest.at:52: expr-test -W $abs_srcdir/expr-testsuite/test.2 -k s2[2:2:4],s3.o (pass) -at_setup_line='EXPRTest.at:52' -at_desc="expr-test -W \$abs_srcdir/expr-testsuite/test.2 -k s2[2:2:4],s3.o (pass)" -at_desc_line=" 16: $at_desc" -$at_quiet $as_echo_n "$at_desc_line" +at_fn_group_banner 16 'EXPRTest.at:52' \ + "expr-test -W \$abs_srcdir/expr-testsuite/test.2 -k s2[2:2:4],s3.o (pass)" "" at_xfail=no test "pass" = "xfail" && at_xfail=yes -echo "# -*- compilation -*-" >> "$at_group_log" ( - $as_echo "16. EXPRTest.at:52: testing ..." + $as_echo "16. $at_setup_line: testing $at_desc ..." $at_traceon @@ -2890,7 +2859,7 @@ $as_echo "$at_srcdir/EXPRTest.at:52: \$abs_builddir/expr-test -W \$abs_srcdir/expr-testsuite/test.2 -k s2[2:2:4],s3.o -f \"dummy\" || true" at_fn_check_prepare_dynamic "$abs_builddir/expr-test -W $abs_srcdir/expr-testsuite/test.2 -k s2[2:2:4],s3.o -f \"dummy\" || true" "EXPRTest.at:52" ( $at_check_trace; $abs_builddir/expr-test -W $abs_srcdir/expr-testsuite/test.2 -k s2[2:2:4],s3.o -f "dummy" || true -) >>"$at_stdout" 2>>"$at_stderr" +) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" @@ -2903,7 +2872,7 @@ $as_echo "$at_srcdir/EXPRTest.at:52: diff -b -B \$abs_srcdir/expr-testsuite/test.2c.base stdout || diff -b -B \$abs_srcdir/expr-testsuite/test.2c.base stderr" at_fn_check_prepare_dynamic "diff -b -B $abs_srcdir/expr-testsuite/test.2c.base stdout || diff -b -B $abs_srcdir/expr-testsuite/test.2c.base stderr" "EXPRTest.at:52" ( $at_check_trace; diff -b -B $abs_srcdir/expr-testsuite/test.2c.base stdout || diff -b -B $abs_srcdir/expr-testsuite/test.2c.base stderr -) >>"$at_stdout" 2>>"$at_stderr" +) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: @@ -2915,20 +2884,16 @@ set +x $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 | eval $at_tee_pipe +) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_16 #AT_START_17 -# 17. EXPRTest.at:54: expr-test -w $abs_srcdir/expr-testsuite/test.2 -k s2[2:2:4].m (pass) -at_setup_line='EXPRTest.at:54' -at_desc="expr-test -w \$abs_srcdir/expr-testsuite/test.2 -k s2[2:2:4].m (pass)" -at_desc_line=" 17: $at_desc" -$at_quiet $as_echo_n "$at_desc_line" +at_fn_group_banner 17 'EXPRTest.at:54' \ + "expr-test -w \$abs_srcdir/expr-testsuite/test.2 -k s2[2:2:4].m (pass)" "" at_xfail=no test "pass" = "xfail" && at_xfail=yes -echo "# -*- compilation -*-" >> "$at_group_log" ( - $as_echo "17. EXPRTest.at:54: testing ..." + $as_echo "17. $at_setup_line: testing $at_desc ..." $at_traceon @@ -2944,7 +2909,7 @@ $as_echo "$at_srcdir/EXPRTest.at:54: \$abs_builddir/expr-test -w \$abs_srcdir/expr-testsuite/test.2 -k s2[2:2:4].m -f \"dummy\" || true" at_fn_check_prepare_dynamic "$abs_builddir/expr-test -w $abs_srcdir/expr-testsuite/test.2 -k s2[2:2:4].m -f \"dummy\" || true" "EXPRTest.at:54" ( $at_check_trace; $abs_builddir/expr-test -w $abs_srcdir/expr-testsuite/test.2 -k s2[2:2:4].m -f "dummy" || true -) >>"$at_stdout" 2>>"$at_stderr" +) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" @@ -2957,7 +2922,7 @@ $as_echo "$at_srcdir/EXPRTest.at:54: diff -b -B \$abs_srcdir/expr-testsuite/test.2d.base stdout || diff -b -B \$abs_srcdir/expr-testsuite/test.2d.base stderr" at_fn_check_prepare_dynamic "diff -b -B $abs_srcdir/expr-testsuite/test.2d.base stdout || diff -b -B $abs_srcdir/expr-testsuite/test.2d.base stderr" "EXPRTest.at:54" ( $at_check_trace; diff -b -B $abs_srcdir/expr-testsuite/test.2d.base stdout || diff -b -B $abs_srcdir/expr-testsuite/test.2d.base stderr -) >>"$at_stdout" 2>>"$at_stderr" +) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: @@ -2969,20 +2934,16 @@ set +x $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 | eval $at_tee_pipe +) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_17 #AT_START_18 -# 18. EXPRTest.at:54: expr-test -W $abs_srcdir/expr-testsuite/test.2 -k s2[2:2:4].m (pass) -at_setup_line='EXPRTest.at:54' -at_desc="expr-test -W \$abs_srcdir/expr-testsuite/test.2 -k s2[2:2:4].m (pass)" -at_desc_line=" 18: $at_desc" -$at_quiet $as_echo_n "$at_desc_line" +at_fn_group_banner 18 'EXPRTest.at:54' \ + "expr-test -W \$abs_srcdir/expr-testsuite/test.2 -k s2[2:2:4].m (pass)" "" at_xfail=no test "pass" = "xfail" && at_xfail=yes -echo "# -*- compilation -*-" >> "$at_group_log" ( - $as_echo "18. EXPRTest.at:54: testing ..." + $as_echo "18. $at_setup_line: testing $at_desc ..." $at_traceon @@ -2998,7 +2959,7 @@ $as_echo "$at_srcdir/EXPRTest.at:54: \$abs_builddir/expr-test -W \$abs_srcdir/expr-testsuite/test.2 -k s2[2:2:4].m -f \"dummy\" || true" at_fn_check_prepare_dynamic "$abs_builddir/expr-test -W $abs_srcdir/expr-testsuite/test.2 -k s2[2:2:4].m -f \"dummy\" || true" "EXPRTest.at:54" ( $at_check_trace; $abs_builddir/expr-test -W $abs_srcdir/expr-testsuite/test.2 -k s2[2:2:4].m -f "dummy" || true -) >>"$at_stdout" 2>>"$at_stderr" +) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" @@ -3011,7 +2972,7 @@ $as_echo "$at_srcdir/EXPRTest.at:54: diff -b -B \$abs_srcdir/expr-testsuite/test.2d.base stdout || diff -b -B \$abs_srcdir/expr-testsuite/test.2d.base stderr" at_fn_check_prepare_dynamic "diff -b -B $abs_srcdir/expr-testsuite/test.2d.base stdout || diff -b -B $abs_srcdir/expr-testsuite/test.2d.base stderr" "EXPRTest.at:54" ( $at_check_trace; diff -b -B $abs_srcdir/expr-testsuite/test.2d.base stdout || diff -b -B $abs_srcdir/expr-testsuite/test.2d.base stderr -) >>"$at_stdout" 2>>"$at_stderr" +) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: @@ -3023,20 +2984,16 @@ set +x $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 | eval $at_tee_pipe +) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_18 #AT_START_19 -# 19. EXPRTest.at:55: expr-test -w $abs_srcdir/expr-testsuite/test.2 -k s2[2:2:4].m,s2[2:2:4].l (pass) -at_setup_line='EXPRTest.at:55' -at_desc="expr-test -w \$abs_srcdir/expr-testsuite/test.2 -k s2[2:2:4].m,s2[2:2:4].l (pass)" -at_desc_line=" 19: $at_desc" -$at_quiet $as_echo_n "$at_desc_line" +at_fn_group_banner 19 'EXPRTest.at:55' \ + "expr-test -w \$abs_srcdir/expr-testsuite/test.2 -k s2[2:2:4].m,s2[2:2:4].l (pass)" "" at_xfail=no test "pass" = "xfail" && at_xfail=yes -echo "# -*- compilation -*-" >> "$at_group_log" ( - $as_echo "19. EXPRTest.at:55: testing ..." + $as_echo "19. $at_setup_line: testing $at_desc ..." $at_traceon @@ -3052,7 +3009,7 @@ $as_echo "$at_srcdir/EXPRTest.at:55: \$abs_builddir/expr-test -w \$abs_srcdir/expr-testsuite/test.2 -k s2[2:2:4].m,s2[2:2:4].l -f \"dummy\" || true" at_fn_check_prepare_dynamic "$abs_builddir/expr-test -w $abs_srcdir/expr-testsuite/test.2 -k s2[2:2:4].m,s2[2:2:4].l -f \"dummy\" || true" "EXPRTest.at:55" ( $at_check_trace; $abs_builddir/expr-test -w $abs_srcdir/expr-testsuite/test.2 -k s2[2:2:4].m,s2[2:2:4].l -f "dummy" || true -) >>"$at_stdout" 2>>"$at_stderr" +) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" @@ -3065,7 +3022,7 @@ $as_echo "$at_srcdir/EXPRTest.at:55: diff -b -B \$abs_srcdir/expr-testsuite/test.2e.base stdout || diff -b -B \$abs_srcdir/expr-testsuite/test.2e.base stderr" at_fn_check_prepare_dynamic "diff -b -B $abs_srcdir/expr-testsuite/test.2e.base stdout || diff -b -B $abs_srcdir/expr-testsuite/test.2e.base stderr" "EXPRTest.at:55" ( $at_check_trace; diff -b -B $abs_srcdir/expr-testsuite/test.2e.base stdout || diff -b -B $abs_srcdir/expr-testsuite/test.2e.base stderr -) >>"$at_stdout" 2>>"$at_stderr" +) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: @@ -3077,20 +3034,16 @@ set +x $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 | eval $at_tee_pipe +) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_19 #AT_START_20 -# 20. EXPRTest.at:55: expr-test -W $abs_srcdir/expr-testsuite/test.2 -k s2[2:2:4].m,s2[2:2:4].l (pass) -at_setup_line='EXPRTest.at:55' -at_desc="expr-test -W \$abs_srcdir/expr-testsuite/test.2 -k s2[2:2:4].m,s2[2:2:4].l (pass)" -at_desc_line=" 20: $at_desc" -$at_quiet $as_echo_n "$at_desc_line" +at_fn_group_banner 20 'EXPRTest.at:55' \ + "expr-test -W \$abs_srcdir/expr-testsuite/test.2 -k s2[2:2:4].m,s2[2:2:4].l (pass)" "" at_xfail=no test "pass" = "xfail" && at_xfail=yes -echo "# -*- compilation -*-" >> "$at_group_log" ( - $as_echo "20. EXPRTest.at:55: testing ..." + $as_echo "20. $at_setup_line: testing $at_desc ..." $at_traceon @@ -3106,7 +3059,7 @@ $as_echo "$at_srcdir/EXPRTest.at:55: \$abs_builddir/expr-test -W \$abs_srcdir/expr-testsuite/test.2 -k s2[2:2:4].m,s2[2:2:4].l -f \"dummy\" || true" at_fn_check_prepare_dynamic "$abs_builddir/expr-test -W $abs_srcdir/expr-testsuite/test.2 -k s2[2:2:4].m,s2[2:2:4].l -f \"dummy\" || true" "EXPRTest.at:55" ( $at_check_trace; $abs_builddir/expr-test -W $abs_srcdir/expr-testsuite/test.2 -k s2[2:2:4].m,s2[2:2:4].l -f "dummy" || true -) >>"$at_stdout" 2>>"$at_stderr" +) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" @@ -3119,7 +3072,7 @@ $as_echo "$at_srcdir/EXPRTest.at:55: diff -b -B \$abs_srcdir/expr-testsuite/test.2e.base stdout || diff -b -B \$abs_srcdir/expr-testsuite/test.2e.base stderr" at_fn_check_prepare_dynamic "diff -b -B $abs_srcdir/expr-testsuite/test.2e.base stdout || diff -b -B $abs_srcdir/expr-testsuite/test.2e.base stderr" "EXPRTest.at:55" ( $at_check_trace; diff -b -B $abs_srcdir/expr-testsuite/test.2e.base stdout || diff -b -B $abs_srcdir/expr-testsuite/test.2e.base stderr -) >>"$at_stdout" 2>>"$at_stderr" +) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: @@ -3131,20 +3084,16 @@ set +x $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 | eval $at_tee_pipe +) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_20 #AT_START_21 -# 21. EXPRTest.at:57: expr-test -w $abs_srcdir/expr-testsuite/test.2a -k s2[2:4].m[0:4],s2[2:4].l[0:5] (pass) -at_setup_line='EXPRTest.at:57' -at_desc="expr-test -w \$abs_srcdir/expr-testsuite/test.2a -k s2[2:4].m[0:4],s2[2:4].l[0:5] (pass)" -at_desc_line=" 21: $at_desc" -$at_quiet $as_echo_n "$at_desc_line" +at_fn_group_banner 21 'EXPRTest.at:57' \ + "expr-test -w \$abs_srcdir/expr-testsuite/test.2a -k s2[2:4].m[0:4],s2[2:4].l[0:5] (pass)" "" at_xfail=no test "pass" = "xfail" && at_xfail=yes -echo "# -*- compilation -*-" >> "$at_group_log" ( - $as_echo "21. EXPRTest.at:57: testing ..." + $as_echo "21. $at_setup_line: testing $at_desc ..." $at_traceon @@ -3160,7 +3109,7 @@ $as_echo "$at_srcdir/EXPRTest.at:57: \$abs_builddir/expr-test -w \$abs_srcdir/expr-testsuite/test.2a -k s2[2:4].m[0:4],s2[2:4].l[0:5] -f \"dummy\" || true" at_fn_check_prepare_dynamic "$abs_builddir/expr-test -w $abs_srcdir/expr-testsuite/test.2a -k s2[2:4].m[0:4],s2[2:4].l[0:5] -f \"dummy\" || true" "EXPRTest.at:57" ( $at_check_trace; $abs_builddir/expr-test -w $abs_srcdir/expr-testsuite/test.2a -k s2[2:4].m[0:4],s2[2:4].l[0:5] -f "dummy" || true -) >>"$at_stdout" 2>>"$at_stderr" +) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" @@ -3173,7 +3122,7 @@ $as_echo "$at_srcdir/EXPRTest.at:57: diff -b -B \$abs_srcdir/expr-testsuite/test.2f.base stdout || diff -b -B \$abs_srcdir/expr-testsuite/test.2f.base stderr" at_fn_check_prepare_dynamic "diff -b -B $abs_srcdir/expr-testsuite/test.2f.base stdout || diff -b -B $abs_srcdir/expr-testsuite/test.2f.base stderr" "EXPRTest.at:57" ( $at_check_trace; diff -b -B $abs_srcdir/expr-testsuite/test.2f.base stdout || diff -b -B $abs_srcdir/expr-testsuite/test.2f.base stderr -) >>"$at_stdout" 2>>"$at_stderr" +) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: @@ -3185,20 +3134,16 @@ set +x $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 | eval $at_tee_pipe +) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_21 #AT_START_22 -# 22. EXPRTest.at:57: expr-test -W $abs_srcdir/expr-testsuite/test.2a -k s2[2:4].m[0:4],s2[2:4].l[0:5] (pass) -at_setup_line='EXPRTest.at:57' -at_desc="expr-test -W \$abs_srcdir/expr-testsuite/test.2a -k s2[2:4].m[0:4],s2[2:4].l[0:5] (pass)" -at_desc_line=" 22: $at_desc" -$at_quiet $as_echo_n "$at_desc_line" +at_fn_group_banner 22 'EXPRTest.at:57' \ + "expr-test -W \$abs_srcdir/expr-testsuite/test.2a -k s2[2:4].m[0:4],s2[2:4].l[0:5] (pass)" "" at_xfail=no test "pass" = "xfail" && at_xfail=yes -echo "# -*- compilation -*-" >> "$at_group_log" ( - $as_echo "22. EXPRTest.at:57: testing ..." + $as_echo "22. $at_setup_line: testing $at_desc ..." $at_traceon @@ -3214,7 +3159,7 @@ $as_echo "$at_srcdir/EXPRTest.at:57: \$abs_builddir/expr-test -W \$abs_srcdir/expr-testsuite/test.2a -k s2[2:4].m[0:4],s2[2:4].l[0:5] -f \"dummy\" || true" at_fn_check_prepare_dynamic "$abs_builddir/expr-test -W $abs_srcdir/expr-testsuite/test.2a -k s2[2:4].m[0:4],s2[2:4].l[0:5] -f \"dummy\" || true" "EXPRTest.at:57" ( $at_check_trace; $abs_builddir/expr-test -W $abs_srcdir/expr-testsuite/test.2a -k s2[2:4].m[0:4],s2[2:4].l[0:5] -f "dummy" || true -) >>"$at_stdout" 2>>"$at_stderr" +) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" @@ -3227,7 +3172,7 @@ $as_echo "$at_srcdir/EXPRTest.at:57: diff -b -B \$abs_srcdir/expr-testsuite/test.2f.base stdout || diff -b -B \$abs_srcdir/expr-testsuite/test.2f.base stderr" at_fn_check_prepare_dynamic "diff -b -B $abs_srcdir/expr-testsuite/test.2f.base stdout || diff -b -B $abs_srcdir/expr-testsuite/test.2f.base stderr" "EXPRTest.at:57" ( $at_check_trace; diff -b -B $abs_srcdir/expr-testsuite/test.2f.base stdout || diff -b -B $abs_srcdir/expr-testsuite/test.2f.base stderr -) >>"$at_stdout" 2>>"$at_stderr" +) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: @@ -3239,20 +3184,16 @@ set +x $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 | eval $at_tee_pipe +) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_22 #AT_START_23 -# 23. EXPRTest.at:58: expr-test -w $abs_srcdir/expr-testsuite/test.3 -k i[1:10] (pass) -at_setup_line='EXPRTest.at:58' -at_desc="expr-test -w \$abs_srcdir/expr-testsuite/test.3 -k i[1:10] (pass)" -at_desc_line=" 23: $at_desc" -$at_quiet $as_echo_n "$at_desc_line" +at_fn_group_banner 23 'EXPRTest.at:58' \ + "expr-test -w \$abs_srcdir/expr-testsuite/test.3 -k i[1:10] (pass)" "" at_xfail=no test "pass" = "xfail" && at_xfail=yes -echo "# -*- compilation -*-" >> "$at_group_log" ( - $as_echo "23. EXPRTest.at:58: testing ..." + $as_echo "23. $at_setup_line: testing $at_desc ..." $at_traceon @@ -3268,7 +3209,7 @@ $as_echo "$at_srcdir/EXPRTest.at:58: \$abs_builddir/expr-test -w \$abs_srcdir/expr-testsuite/test.3 -k i[1:10] -f \"dummy\" || true" at_fn_check_prepare_dynamic "$abs_builddir/expr-test -w $abs_srcdir/expr-testsuite/test.3 -k i[1:10] -f \"dummy\" || true" "EXPRTest.at:58" ( $at_check_trace; $abs_builddir/expr-test -w $abs_srcdir/expr-testsuite/test.3 -k i[1:10] -f "dummy" || true -) >>"$at_stdout" 2>>"$at_stderr" +) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" @@ -3281,7 +3222,7 @@ $as_echo "$at_srcdir/EXPRTest.at:58: diff -b -B \$abs_srcdir/expr-testsuite/test.3.base stdout || diff -b -B \$abs_srcdir/expr-testsuite/test.3.base stderr" at_fn_check_prepare_dynamic "diff -b -B $abs_srcdir/expr-testsuite/test.3.base stdout || diff -b -B $abs_srcdir/expr-testsuite/test.3.base stderr" "EXPRTest.at:58" ( $at_check_trace; diff -b -B $abs_srcdir/expr-testsuite/test.3.base stdout || diff -b -B $abs_srcdir/expr-testsuite/test.3.base stderr -) >>"$at_stdout" 2>>"$at_stderr" +) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: @@ -3293,20 +3234,16 @@ set +x $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 | eval $at_tee_pipe +) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_23 #AT_START_24 -# 24. EXPRTest.at:58: expr-test -W $abs_srcdir/expr-testsuite/test.3 -k i[1:10] (pass) -at_setup_line='EXPRTest.at:58' -at_desc="expr-test -W \$abs_srcdir/expr-testsuite/test.3 -k i[1:10] (pass)" -at_desc_line=" 24: $at_desc" -$at_quiet $as_echo_n "$at_desc_line" +at_fn_group_banner 24 'EXPRTest.at:58' \ + "expr-test -W \$abs_srcdir/expr-testsuite/test.3 -k i[1:10] (pass)" "" at_xfail=no test "pass" = "xfail" && at_xfail=yes -echo "# -*- compilation -*-" >> "$at_group_log" ( - $as_echo "24. EXPRTest.at:58: testing ..." + $as_echo "24. $at_setup_line: testing $at_desc ..." $at_traceon @@ -3322,7 +3259,7 @@ $as_echo "$at_srcdir/EXPRTest.at:58: \$abs_builddir/expr-test -W \$abs_srcdir/expr-testsuite/test.3 -k i[1:10] -f \"dummy\" || true" at_fn_check_prepare_dynamic "$abs_builddir/expr-test -W $abs_srcdir/expr-testsuite/test.3 -k i[1:10] -f \"dummy\" || true" "EXPRTest.at:58" ( $at_check_trace; $abs_builddir/expr-test -W $abs_srcdir/expr-testsuite/test.3 -k i[1:10] -f "dummy" || true -) >>"$at_stdout" 2>>"$at_stderr" +) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" @@ -3335,7 +3272,7 @@ $as_echo "$at_srcdir/EXPRTest.at:58: diff -b -B \$abs_srcdir/expr-testsuite/test.3.base stdout || diff -b -B \$abs_srcdir/expr-testsuite/test.3.base stderr" at_fn_check_prepare_dynamic "diff -b -B $abs_srcdir/expr-testsuite/test.3.base stdout || diff -b -B $abs_srcdir/expr-testsuite/test.3.base stderr" "EXPRTest.at:58" ( $at_check_trace; diff -b -B $abs_srcdir/expr-testsuite/test.3.base stdout || diff -b -B $abs_srcdir/expr-testsuite/test.3.base stderr -) >>"$at_stdout" 2>>"$at_stderr" +) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: @@ -3347,20 +3284,16 @@ set +x $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 | eval $at_tee_pipe +) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_24 #AT_START_25 -# 25. EXPRTest.at:59: expr-test -w $abs_srcdir/expr-testsuite/test.4 -k 's&s=~"^Silly.*"' (pass) -at_setup_line='EXPRTest.at:59' -at_desc="expr-test -w \$abs_srcdir/expr-testsuite/test.4 -k 's&s=~\"^Silly.*\"' (pass)" -at_desc_line=" 25: $at_desc" -$at_quiet $as_echo_n "$at_desc_line" +at_fn_group_banner 25 'EXPRTest.at:59' \ + "expr-test -w \$abs_srcdir/expr-testsuite/test.4 -k 's&s=~\"^Silly.*\"' (pass)" "" at_xfail=no test "pass" = "xfail" && at_xfail=yes -echo "# -*- compilation -*-" >> "$at_group_log" ( - $as_echo "25. EXPRTest.at:59: testing ..." + $as_echo "25. $at_setup_line: testing $at_desc ..." $at_traceon @@ -3376,7 +3309,7 @@ $as_echo "$at_srcdir/EXPRTest.at:59: \$abs_builddir/expr-test -w \$abs_srcdir/expr-testsuite/test.4 -k 's&s=~\"^Silly.*\"' -f \"dummy\" || true" at_fn_check_prepare_dynamic "$abs_builddir/expr-test -w $abs_srcdir/expr-testsuite/test.4 -k 's&s=~\"^Silly.*\"' -f \"dummy\" || true" "EXPRTest.at:59" ( $at_check_trace; $abs_builddir/expr-test -w $abs_srcdir/expr-testsuite/test.4 -k 's&s=~"^Silly.*"' -f "dummy" || true -) >>"$at_stdout" 2>>"$at_stderr" +) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" @@ -3389,7 +3322,7 @@ $as_echo "$at_srcdir/EXPRTest.at:59: diff -b -B \$abs_srcdir/expr-testsuite/test.4.base stdout || diff -b -B \$abs_srcdir/expr-testsuite/test.4.base stderr" at_fn_check_prepare_dynamic "diff -b -B $abs_srcdir/expr-testsuite/test.4.base stdout || diff -b -B $abs_srcdir/expr-testsuite/test.4.base stderr" "EXPRTest.at:59" ( $at_check_trace; diff -b -B $abs_srcdir/expr-testsuite/test.4.base stdout || diff -b -B $abs_srcdir/expr-testsuite/test.4.base stderr -) >>"$at_stdout" 2>>"$at_stderr" +) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: @@ -3401,20 +3334,16 @@ set +x $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 | eval $at_tee_pipe +) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_25 #AT_START_26 -# 26. EXPRTest.at:59: expr-test -W $abs_srcdir/expr-testsuite/test.4 -k 's&s=~"^Silly.*"' (pass) -at_setup_line='EXPRTest.at:59' -at_desc="expr-test -W \$abs_srcdir/expr-testsuite/test.4 -k 's&s=~\"^Silly.*\"' (pass)" -at_desc_line=" 26: $at_desc" -$at_quiet $as_echo_n "$at_desc_line" +at_fn_group_banner 26 'EXPRTest.at:59' \ + "expr-test -W \$abs_srcdir/expr-testsuite/test.4 -k 's&s=~\"^Silly.*\"' (pass)" "" at_xfail=no test "pass" = "xfail" && at_xfail=yes -echo "# -*- compilation -*-" >> "$at_group_log" ( - $as_echo "26. EXPRTest.at:59: testing ..." + $as_echo "26. $at_setup_line: testing $at_desc ..." $at_traceon @@ -3430,7 +3359,7 @@ $as_echo "$at_srcdir/EXPRTest.at:59: \$abs_builddir/expr-test -W \$abs_srcdir/expr-testsuite/test.4 -k 's&s=~\"^Silly.*\"' -f \"dummy\" || true" at_fn_check_prepare_dynamic "$abs_builddir/expr-test -W $abs_srcdir/expr-testsuite/test.4 -k 's&s=~\"^Silly.*\"' -f \"dummy\" || true" "EXPRTest.at:59" ( $at_check_trace; $abs_builddir/expr-test -W $abs_srcdir/expr-testsuite/test.4 -k 's&s=~"^Silly.*"' -f "dummy" || true -) >>"$at_stdout" 2>>"$at_stderr" +) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" @@ -3443,7 +3372,7 @@ $as_echo "$at_srcdir/EXPRTest.at:59: diff -b -B \$abs_srcdir/expr-testsuite/test.4.base stdout || diff -b -B \$abs_srcdir/expr-testsuite/test.4.base stderr" at_fn_check_prepare_dynamic "diff -b -B $abs_srcdir/expr-testsuite/test.4.base stdout || diff -b -B $abs_srcdir/expr-testsuite/test.4.base stderr" "EXPRTest.at:59" ( $at_check_trace; diff -b -B $abs_srcdir/expr-testsuite/test.4.base stdout || diff -b -B $abs_srcdir/expr-testsuite/test.4.base stderr -) >>"$at_stdout" 2>>"$at_stderr" +) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: @@ -3455,20 +3384,16 @@ set +x $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 | eval $at_tee_pipe +) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_26 #AT_START_27 -# 27. EXPRTest.at:61: expr-test -w $abs_srcdir/expr-testsuite/test.e -k 'names.s&names.s=~".*: 3"' (pass) -at_setup_line='EXPRTest.at:61' -at_desc="expr-test -w \$abs_srcdir/expr-testsuite/test.e -k 'names.s&names.s=~\".*: 3\"' (pass)" -at_desc_line=" 27: $at_desc" -$at_quiet $as_echo_n "$at_desc_line" +at_fn_group_banner 27 'EXPRTest.at:61' \ + "expr-test -w \$abs_srcdir/expr-testsuite/test.e -k 'names.s&names.s=~\".*: 3\"' (pass)" "" at_xfail=no test "pass" = "xfail" && at_xfail=yes -echo "# -*- compilation -*-" >> "$at_group_log" ( - $as_echo "27. EXPRTest.at:61: testing ..." + $as_echo "27. $at_setup_line: testing $at_desc ..." $at_traceon @@ -3484,7 +3409,7 @@ $as_echo "$at_srcdir/EXPRTest.at:61: \$abs_builddir/expr-test -w \$abs_srcdir/expr-testsuite/test.e -k 'names.s&names.s=~\".*: 3\"' -f \"dummy\" || true" at_fn_check_prepare_dynamic "$abs_builddir/expr-test -w $abs_srcdir/expr-testsuite/test.e -k 'names.s&names.s=~\".*: 3\"' -f \"dummy\" || true" "EXPRTest.at:61" ( $at_check_trace; $abs_builddir/expr-test -w $abs_srcdir/expr-testsuite/test.e -k 'names.s&names.s=~".*: 3"' -f "dummy" || true -) >>"$at_stdout" 2>>"$at_stderr" +) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" @@ -3497,7 +3422,7 @@ $as_echo "$at_srcdir/EXPRTest.at:61: diff -b -B \$abs_srcdir/expr-testsuite/test.ea.base stdout || diff -b -B \$abs_srcdir/expr-testsuite/test.ea.base stderr" at_fn_check_prepare_dynamic "diff -b -B $abs_srcdir/expr-testsuite/test.ea.base stdout || diff -b -B $abs_srcdir/expr-testsuite/test.ea.base stderr" "EXPRTest.at:61" ( $at_check_trace; diff -b -B $abs_srcdir/expr-testsuite/test.ea.base stdout || diff -b -B $abs_srcdir/expr-testsuite/test.ea.base stderr -) >>"$at_stdout" 2>>"$at_stderr" +) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: @@ -3509,20 +3434,16 @@ set +x $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 | eval $at_tee_pipe +) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_27 #AT_START_28 -# 28. EXPRTest.at:61: expr-test -W $abs_srcdir/expr-testsuite/test.e -k 'names.s&names.s=~".*: 3"' (pass) -at_setup_line='EXPRTest.at:61' -at_desc="expr-test -W \$abs_srcdir/expr-testsuite/test.e -k 'names.s&names.s=~\".*: 3\"' (pass)" -at_desc_line=" 28: $at_desc" -$at_quiet $as_echo_n "$at_desc_line" +at_fn_group_banner 28 'EXPRTest.at:61' \ + "expr-test -W \$abs_srcdir/expr-testsuite/test.e -k 'names.s&names.s=~\".*: 3\"' (pass)" "" at_xfail=no test "pass" = "xfail" && at_xfail=yes -echo "# -*- compilation -*-" >> "$at_group_log" ( - $as_echo "28. EXPRTest.at:61: testing ..." + $as_echo "28. $at_setup_line: testing $at_desc ..." $at_traceon @@ -3538,7 +3459,7 @@ $as_echo "$at_srcdir/EXPRTest.at:61: \$abs_builddir/expr-test -W \$abs_srcdir/expr-testsuite/test.e -k 'names.s&names.s=~\".*: 3\"' -f \"dummy\" || true" at_fn_check_prepare_dynamic "$abs_builddir/expr-test -W $abs_srcdir/expr-testsuite/test.e -k 'names.s&names.s=~\".*: 3\"' -f \"dummy\" || true" "EXPRTest.at:61" ( $at_check_trace; $abs_builddir/expr-test -W $abs_srcdir/expr-testsuite/test.e -k 'names.s&names.s=~".*: 3"' -f "dummy" || true -) >>"$at_stdout" 2>>"$at_stderr" +) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" @@ -3551,7 +3472,7 @@ $as_echo "$at_srcdir/EXPRTest.at:61: diff -b -B \$abs_srcdir/expr-testsuite/test.ea.base stdout || diff -b -B \$abs_srcdir/expr-testsuite/test.ea.base stderr" at_fn_check_prepare_dynamic "diff -b -B $abs_srcdir/expr-testsuite/test.ea.base stdout || diff -b -B $abs_srcdir/expr-testsuite/test.ea.base stderr" "EXPRTest.at:61" ( $at_check_trace; diff -b -B $abs_srcdir/expr-testsuite/test.ea.base stdout || diff -b -B $abs_srcdir/expr-testsuite/test.ea.base stderr -) >>"$at_stdout" 2>>"$at_stderr" +) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: @@ -3563,20 +3484,16 @@ set +x $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 | eval $at_tee_pipe +) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_28 #AT_START_29 -# 29. EXPRTest.at:62: expr-test -w $abs_srcdir/expr-testsuite/test.e -k 'names.s&names.s=~".*: 5"' (pass) -at_setup_line='EXPRTest.at:62' -at_desc="expr-test -w \$abs_srcdir/expr-testsuite/test.e -k 'names.s&names.s=~\".*: 5\"' (pass)" -at_desc_line=" 29: $at_desc" -$at_quiet $as_echo_n "$at_desc_line" +at_fn_group_banner 29 'EXPRTest.at:62' \ + "expr-test -w \$abs_srcdir/expr-testsuite/test.e -k 'names.s&names.s=~\".*: 5\"' (pass)" "" at_xfail=no test "pass" = "xfail" && at_xfail=yes -echo "# -*- compilation -*-" >> "$at_group_log" ( - $as_echo "29. EXPRTest.at:62: testing ..." + $as_echo "29. $at_setup_line: testing $at_desc ..." $at_traceon @@ -3592,7 +3509,7 @@ $as_echo "$at_srcdir/EXPRTest.at:62: \$abs_builddir/expr-test -w \$abs_srcdir/expr-testsuite/test.e -k 'names.s&names.s=~\".*: 5\"' -f \"dummy\" || true" at_fn_check_prepare_dynamic "$abs_builddir/expr-test -w $abs_srcdir/expr-testsuite/test.e -k 'names.s&names.s=~\".*: 5\"' -f \"dummy\" || true" "EXPRTest.at:62" ( $at_check_trace; $abs_builddir/expr-test -w $abs_srcdir/expr-testsuite/test.e -k 'names.s&names.s=~".*: 5"' -f "dummy" || true -) >>"$at_stdout" 2>>"$at_stderr" +) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" @@ -3605,7 +3522,7 @@ $as_echo "$at_srcdir/EXPRTest.at:62: diff -b -B \$abs_srcdir/expr-testsuite/test.eb.base stdout || diff -b -B \$abs_srcdir/expr-testsuite/test.eb.base stderr" at_fn_check_prepare_dynamic "diff -b -B $abs_srcdir/expr-testsuite/test.eb.base stdout || diff -b -B $abs_srcdir/expr-testsuite/test.eb.base stderr" "EXPRTest.at:62" ( $at_check_trace; diff -b -B $abs_srcdir/expr-testsuite/test.eb.base stdout || diff -b -B $abs_srcdir/expr-testsuite/test.eb.base stderr -) >>"$at_stdout" 2>>"$at_stderr" +) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: @@ -3617,20 +3534,16 @@ set +x $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 | eval $at_tee_pipe +) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_29 #AT_START_30 -# 30. EXPRTest.at:62: expr-test -W $abs_srcdir/expr-testsuite/test.e -k 'names.s&names.s=~".*: 5"' (pass) -at_setup_line='EXPRTest.at:62' -at_desc="expr-test -W \$abs_srcdir/expr-testsuite/test.e -k 'names.s&names.s=~\".*: 5\"' (pass)" -at_desc_line=" 30: $at_desc" -$at_quiet $as_echo_n "$at_desc_line" +at_fn_group_banner 30 'EXPRTest.at:62' \ + "expr-test -W \$abs_srcdir/expr-testsuite/test.e -k 'names.s&names.s=~\".*: 5\"' (pass)" "" at_xfail=no test "pass" = "xfail" && at_xfail=yes -echo "# -*- compilation -*-" >> "$at_group_log" ( - $as_echo "30. EXPRTest.at:62: testing ..." + $as_echo "30. $at_setup_line: testing $at_desc ..." $at_traceon @@ -3646,7 +3559,7 @@ $as_echo "$at_srcdir/EXPRTest.at:62: \$abs_builddir/expr-test -W \$abs_srcdir/expr-testsuite/test.e -k 'names.s&names.s=~\".*: 5\"' -f \"dummy\" || true" at_fn_check_prepare_dynamic "$abs_builddir/expr-test -W $abs_srcdir/expr-testsuite/test.e -k 'names.s&names.s=~\".*: 5\"' -f \"dummy\" || true" "EXPRTest.at:62" ( $at_check_trace; $abs_builddir/expr-test -W $abs_srcdir/expr-testsuite/test.e -k 'names.s&names.s=~".*: 5"' -f "dummy" || true -) >>"$at_stdout" 2>>"$at_stderr" +) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" @@ -3659,7 +3572,7 @@ $as_echo "$at_srcdir/EXPRTest.at:62: diff -b -B \$abs_srcdir/expr-testsuite/test.eb.base stdout || diff -b -B \$abs_srcdir/expr-testsuite/test.eb.base stderr" at_fn_check_prepare_dynamic "diff -b -B $abs_srcdir/expr-testsuite/test.eb.base stdout || diff -b -B $abs_srcdir/expr-testsuite/test.eb.base stderr" "EXPRTest.at:62" ( $at_check_trace; diff -b -B $abs_srcdir/expr-testsuite/test.eb.base stdout || diff -b -B $abs_srcdir/expr-testsuite/test.eb.base stderr -) >>"$at_stdout" 2>>"$at_stderr" +) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: @@ -3671,20 +3584,16 @@ set +x $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 | eval $at_tee_pipe +) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_30 #AT_START_31 -# 31. EXPRTest.at:63: expr-test -w $abs_srcdir/expr-testsuite/test.5 -k g[0:2:4][0][0] (pass) -at_setup_line='EXPRTest.at:63' -at_desc="expr-test -w \$abs_srcdir/expr-testsuite/test.5 -k g[0:2:4][0][0] (pass)" -at_desc_line=" 31: $at_desc" -$at_quiet $as_echo_n "$at_desc_line" +at_fn_group_banner 31 'EXPRTest.at:63' \ + "expr-test -w \$abs_srcdir/expr-testsuite/test.5 -k g[0:2:4][0][0] (pass)" "" at_xfail=no test "pass" = "xfail" && at_xfail=yes -echo "# -*- compilation -*-" >> "$at_group_log" ( - $as_echo "31. EXPRTest.at:63: testing ..." + $as_echo "31. $at_setup_line: testing $at_desc ..." $at_traceon @@ -3700,7 +3609,7 @@ $as_echo "$at_srcdir/EXPRTest.at:63: \$abs_builddir/expr-test -w \$abs_srcdir/expr-testsuite/test.5 -k g[0:2:4][0][0] -f \"dummy\" || true" at_fn_check_prepare_dynamic "$abs_builddir/expr-test -w $abs_srcdir/expr-testsuite/test.5 -k g[0:2:4][0][0] -f \"dummy\" || true" "EXPRTest.at:63" ( $at_check_trace; $abs_builddir/expr-test -w $abs_srcdir/expr-testsuite/test.5 -k g[0:2:4][0][0] -f "dummy" || true -) >>"$at_stdout" 2>>"$at_stderr" +) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" @@ -3713,7 +3622,7 @@ $as_echo "$at_srcdir/EXPRTest.at:63: diff -b -B \$abs_srcdir/expr-testsuite/test.5.base stdout || diff -b -B \$abs_srcdir/expr-testsuite/test.5.base stderr" at_fn_check_prepare_dynamic "diff -b -B $abs_srcdir/expr-testsuite/test.5.base stdout || diff -b -B $abs_srcdir/expr-testsuite/test.5.base stderr" "EXPRTest.at:63" ( $at_check_trace; diff -b -B $abs_srcdir/expr-testsuite/test.5.base stdout || diff -b -B $abs_srcdir/expr-testsuite/test.5.base stderr -) >>"$at_stdout" 2>>"$at_stderr" +) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: @@ -3725,20 +3634,16 @@ set +x $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 | eval $at_tee_pipe +) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_31 #AT_START_32 -# 32. EXPRTest.at:63: expr-test -W $abs_srcdir/expr-testsuite/test.5 -k g[0:2:4][0][0] (pass) -at_setup_line='EXPRTest.at:63' -at_desc="expr-test -W \$abs_srcdir/expr-testsuite/test.5 -k g[0:2:4][0][0] (pass)" -at_desc_line=" 32: $at_desc" -$at_quiet $as_echo_n "$at_desc_line" +at_fn_group_banner 32 'EXPRTest.at:63' \ + "expr-test -W \$abs_srcdir/expr-testsuite/test.5 -k g[0:2:4][0][0] (pass)" "" at_xfail=no test "pass" = "xfail" && at_xfail=yes -echo "# -*- compilation -*-" >> "$at_group_log" ( - $as_echo "32. EXPRTest.at:63: testing ..." + $as_echo "32. $at_setup_line: testing $at_desc ..." $at_traceon @@ -3754,7 +3659,7 @@ $as_echo "$at_srcdir/EXPRTest.at:63: \$abs_builddir/expr-test -W \$abs_srcdir/expr-testsuite/test.5 -k g[0:2:4][0][0] -f \"dummy\" || true" at_fn_check_prepare_dynamic "$abs_builddir/expr-test -W $abs_srcdir/expr-testsuite/test.5 -k g[0:2:4][0][0] -f \"dummy\" || true" "EXPRTest.at:63" ( $at_check_trace; $abs_builddir/expr-test -W $abs_srcdir/expr-testsuite/test.5 -k g[0:2:4][0][0] -f "dummy" || true -) >>"$at_stdout" 2>>"$at_stderr" +) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" @@ -3767,7 +3672,7 @@ $as_echo "$at_srcdir/EXPRTest.at:63: diff -b -B \$abs_srcdir/expr-testsuite/test.5.base stdout || diff -b -B \$abs_srcdir/expr-testsuite/test.5.base stderr" at_fn_check_prepare_dynamic "diff -b -B $abs_srcdir/expr-testsuite/test.5.base stdout || diff -b -B $abs_srcdir/expr-testsuite/test.5.base stderr" "EXPRTest.at:63" ( $at_check_trace; diff -b -B $abs_srcdir/expr-testsuite/test.5.base stdout || diff -b -B $abs_srcdir/expr-testsuite/test.5.base stderr -) >>"$at_stdout" 2>>"$at_stderr" +) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: @@ -3779,20 +3684,16 @@ set +x $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 | eval $at_tee_pipe +) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_32 #AT_START_33 -# 33. EXPRTest.at:64: expr-test -w $abs_srcdir/expr-testsuite/test.5 -k g[0:2:4][0:2:4][0:2:4] (pass) -at_setup_line='EXPRTest.at:64' -at_desc="expr-test -w \$abs_srcdir/expr-testsuite/test.5 -k g[0:2:4][0:2:4][0:2:4] (pass)" -at_desc_line=" 33: $at_desc" -$at_quiet $as_echo_n "$at_desc_line" +at_fn_group_banner 33 'EXPRTest.at:64' \ + "expr-test -w \$abs_srcdir/expr-testsuite/test.5 -k g[0:2:4][0:2:4][0:2:4] (pass)" "" at_xfail=no test "pass" = "xfail" && at_xfail=yes -echo "# -*- compilation -*-" >> "$at_group_log" ( - $as_echo "33. EXPRTest.at:64: testing ..." + $as_echo "33. $at_setup_line: testing $at_desc ..." $at_traceon @@ -3808,7 +3709,7 @@ $as_echo "$at_srcdir/EXPRTest.at:64: \$abs_builddir/expr-test -w \$abs_srcdir/expr-testsuite/test.5 -k g[0:2:4][0:2:4][0:2:4] -f \"dummy\" || true" at_fn_check_prepare_dynamic "$abs_builddir/expr-test -w $abs_srcdir/expr-testsuite/test.5 -k g[0:2:4][0:2:4][0:2:4] -f \"dummy\" || true" "EXPRTest.at:64" ( $at_check_trace; $abs_builddir/expr-test -w $abs_srcdir/expr-testsuite/test.5 -k g[0:2:4][0:2:4][0:2:4] -f "dummy" || true -) >>"$at_stdout" 2>>"$at_stderr" +) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" @@ -3821,7 +3722,7 @@ $as_echo "$at_srcdir/EXPRTest.at:64: diff -b -B \$abs_srcdir/expr-testsuite/test.5a.base stdout || diff -b -B \$abs_srcdir/expr-testsuite/test.5a.base stderr" at_fn_check_prepare_dynamic "diff -b -B $abs_srcdir/expr-testsuite/test.5a.base stdout || diff -b -B $abs_srcdir/expr-testsuite/test.5a.base stderr" "EXPRTest.at:64" ( $at_check_trace; diff -b -B $abs_srcdir/expr-testsuite/test.5a.base stdout || diff -b -B $abs_srcdir/expr-testsuite/test.5a.base stderr -) >>"$at_stdout" 2>>"$at_stderr" +) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: @@ -3833,20 +3734,16 @@ set +x $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 | eval $at_tee_pipe +) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_33 #AT_START_34 -# 34. EXPRTest.at:64: expr-test -W $abs_srcdir/expr-testsuite/test.5 -k g[0:2:4][0:2:4][0:2:4] (pass) -at_setup_line='EXPRTest.at:64' -at_desc="expr-test -W \$abs_srcdir/expr-testsuite/test.5 -k g[0:2:4][0:2:4][0:2:4] (pass)" -at_desc_line=" 34: $at_desc" -$at_quiet $as_echo_n "$at_desc_line" +at_fn_group_banner 34 'EXPRTest.at:64' \ + "expr-test -W \$abs_srcdir/expr-testsuite/test.5 -k g[0:2:4][0:2:4][0:2:4] (pass)" "" at_xfail=no test "pass" = "xfail" && at_xfail=yes -echo "# -*- compilation -*-" >> "$at_group_log" ( - $as_echo "34. EXPRTest.at:64: testing ..." + $as_echo "34. $at_setup_line: testing $at_desc ..." $at_traceon @@ -3862,7 +3759,7 @@ $as_echo "$at_srcdir/EXPRTest.at:64: \$abs_builddir/expr-test -W \$abs_srcdir/expr-testsuite/test.5 -k g[0:2:4][0:2:4][0:2:4] -f \"dummy\" || true" at_fn_check_prepare_dynamic "$abs_builddir/expr-test -W $abs_srcdir/expr-testsuite/test.5 -k g[0:2:4][0:2:4][0:2:4] -f \"dummy\" || true" "EXPRTest.at:64" ( $at_check_trace; $abs_builddir/expr-test -W $abs_srcdir/expr-testsuite/test.5 -k g[0:2:4][0:2:4][0:2:4] -f "dummy" || true -) >>"$at_stdout" 2>>"$at_stderr" +) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" @@ -3875,7 +3772,7 @@ $as_echo "$at_srcdir/EXPRTest.at:64: diff -b -B \$abs_srcdir/expr-testsuite/test.5a.base stdout || diff -b -B \$abs_srcdir/expr-testsuite/test.5a.base stderr" at_fn_check_prepare_dynamic "diff -b -B $abs_srcdir/expr-testsuite/test.5a.base stdout || diff -b -B $abs_srcdir/expr-testsuite/test.5a.base stderr" "EXPRTest.at:64" ( $at_check_trace; diff -b -B $abs_srcdir/expr-testsuite/test.5a.base stdout || diff -b -B $abs_srcdir/expr-testsuite/test.5a.base stderr -) >>"$at_stdout" 2>>"$at_stderr" +) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: @@ -3887,20 +3784,16 @@ set +x $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 | eval $at_tee_pipe +) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_34 #AT_START_35 -# 35. EXPRTest.at:65: expr-test -w $abs_srcdir/expr-testsuite/test.6 -k i (pass) -at_setup_line='EXPRTest.at:65' -at_desc="expr-test -w \$abs_srcdir/expr-testsuite/test.6 -k i (pass)" -at_desc_line=" 35: $at_desc" -$at_quiet $as_echo_n "$at_desc_line" +at_fn_group_banner 35 'EXPRTest.at:65' \ + "expr-test -w \$abs_srcdir/expr-testsuite/test.6 -k i (pass)" "" at_xfail=no test "pass" = "xfail" && at_xfail=yes -echo "# -*- compilation -*-" >> "$at_group_log" ( - $as_echo "35. EXPRTest.at:65: testing ..." + $as_echo "35. $at_setup_line: testing $at_desc ..." $at_traceon @@ -3916,7 +3809,7 @@ $as_echo "$at_srcdir/EXPRTest.at:65: \$abs_builddir/expr-test -w \$abs_srcdir/expr-testsuite/test.6 -k i -f \"dummy\" || true" at_fn_check_prepare_dynamic "$abs_builddir/expr-test -w $abs_srcdir/expr-testsuite/test.6 -k i -f \"dummy\" || true" "EXPRTest.at:65" ( $at_check_trace; $abs_builddir/expr-test -w $abs_srcdir/expr-testsuite/test.6 -k i -f "dummy" || true -) >>"$at_stdout" 2>>"$at_stderr" +) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" @@ -3929,7 +3822,7 @@ $as_echo "$at_srcdir/EXPRTest.at:65: diff -b -B \$abs_srcdir/expr-testsuite/test.6.base stdout || diff -b -B \$abs_srcdir/expr-testsuite/test.6.base stderr" at_fn_check_prepare_dynamic "diff -b -B $abs_srcdir/expr-testsuite/test.6.base stdout || diff -b -B $abs_srcdir/expr-testsuite/test.6.base stderr" "EXPRTest.at:65" ( $at_check_trace; diff -b -B $abs_srcdir/expr-testsuite/test.6.base stdout || diff -b -B $abs_srcdir/expr-testsuite/test.6.base stderr -) >>"$at_stdout" 2>>"$at_stderr" +) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: @@ -3941,20 +3834,16 @@ set +x $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 | eval $at_tee_pipe +) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_35 #AT_START_36 -# 36. EXPRTest.at:65: expr-test -W $abs_srcdir/expr-testsuite/test.6 -k i (pass) -at_setup_line='EXPRTest.at:65' -at_desc="expr-test -W \$abs_srcdir/expr-testsuite/test.6 -k i (pass)" -at_desc_line=" 36: $at_desc" -$at_quiet $as_echo_n "$at_desc_line" +at_fn_group_banner 36 'EXPRTest.at:65' \ + "expr-test -W \$abs_srcdir/expr-testsuite/test.6 -k i (pass)" "" at_xfail=no test "pass" = "xfail" && at_xfail=yes -echo "# -*- compilation -*-" >> "$at_group_log" ( - $as_echo "36. EXPRTest.at:65: testing ..." + $as_echo "36. $at_setup_line: testing $at_desc ..." $at_traceon @@ -3970,7 +3859,7 @@ $as_echo "$at_srcdir/EXPRTest.at:65: \$abs_builddir/expr-test -W \$abs_srcdir/expr-testsuite/test.6 -k i -f \"dummy\" || true" at_fn_check_prepare_dynamic "$abs_builddir/expr-test -W $abs_srcdir/expr-testsuite/test.6 -k i -f \"dummy\" || true" "EXPRTest.at:65" ( $at_check_trace; $abs_builddir/expr-test -W $abs_srcdir/expr-testsuite/test.6 -k i -f "dummy" || true -) >>"$at_stdout" 2>>"$at_stderr" +) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" @@ -3983,7 +3872,7 @@ $as_echo "$at_srcdir/EXPRTest.at:65: diff -b -B \$abs_srcdir/expr-testsuite/test.6.base stdout || diff -b -B \$abs_srcdir/expr-testsuite/test.6.base stderr" at_fn_check_prepare_dynamic "diff -b -B $abs_srcdir/expr-testsuite/test.6.base stdout || diff -b -B $abs_srcdir/expr-testsuite/test.6.base stderr" "EXPRTest.at:65" ( $at_check_trace; diff -b -B $abs_srcdir/expr-testsuite/test.6.base stdout || diff -b -B $abs_srcdir/expr-testsuite/test.6.base stderr -) >>"$at_stdout" 2>>"$at_stderr" +) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: @@ -3995,20 +3884,16 @@ set +x $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 | eval $at_tee_pipe +) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_36 #AT_START_37 -# 37. EXPRTest.at:66: expr-test -w $abs_srcdir/expr-testsuite/test.6 -k i[1:2][2:4] (pass) -at_setup_line='EXPRTest.at:66' -at_desc="expr-test -w \$abs_srcdir/expr-testsuite/test.6 -k i[1:2][2:4] (pass)" -at_desc_line=" 37: $at_desc" -$at_quiet $as_echo_n "$at_desc_line" +at_fn_group_banner 37 'EXPRTest.at:66' \ + "expr-test -w \$abs_srcdir/expr-testsuite/test.6 -k i[1:2][2:4] (pass)" "" at_xfail=no test "pass" = "xfail" && at_xfail=yes -echo "# -*- compilation -*-" >> "$at_group_log" ( - $as_echo "37. EXPRTest.at:66: testing ..." + $as_echo "37. $at_setup_line: testing $at_desc ..." $at_traceon @@ -4024,7 +3909,7 @@ $as_echo "$at_srcdir/EXPRTest.at:66: \$abs_builddir/expr-test -w \$abs_srcdir/expr-testsuite/test.6 -k i[1:2][2:4] -f \"dummy\" || true" at_fn_check_prepare_dynamic "$abs_builddir/expr-test -w $abs_srcdir/expr-testsuite/test.6 -k i[1:2][2:4] -f \"dummy\" || true" "EXPRTest.at:66" ( $at_check_trace; $abs_builddir/expr-test -w $abs_srcdir/expr-testsuite/test.6 -k i[1:2][2:4] -f "dummy" || true -) >>"$at_stdout" 2>>"$at_stderr" +) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" @@ -4037,7 +3922,7 @@ $as_echo "$at_srcdir/EXPRTest.at:66: diff -b -B \$abs_srcdir/expr-testsuite/test.6a.base stdout || diff -b -B \$abs_srcdir/expr-testsuite/test.6a.base stderr" at_fn_check_prepare_dynamic "diff -b -B $abs_srcdir/expr-testsuite/test.6a.base stdout || diff -b -B $abs_srcdir/expr-testsuite/test.6a.base stderr" "EXPRTest.at:66" ( $at_check_trace; diff -b -B $abs_srcdir/expr-testsuite/test.6a.base stdout || diff -b -B $abs_srcdir/expr-testsuite/test.6a.base stderr -) >>"$at_stdout" 2>>"$at_stderr" +) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: @@ -4049,20 +3934,16 @@ set +x $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 | eval $at_tee_pipe +) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_37 #AT_START_38 -# 38. EXPRTest.at:66: expr-test -W $abs_srcdir/expr-testsuite/test.6 -k i[1:2][2:4] (pass) -at_setup_line='EXPRTest.at:66' -at_desc="expr-test -W \$abs_srcdir/expr-testsuite/test.6 -k i[1:2][2:4] (pass)" -at_desc_line=" 38: $at_desc" -$at_quiet $as_echo_n "$at_desc_line" +at_fn_group_banner 38 'EXPRTest.at:66' \ + "expr-test -W \$abs_srcdir/expr-testsuite/test.6 -k i[1:2][2:4] (pass)" "" at_xfail=no test "pass" = "xfail" && at_xfail=yes -echo "# -*- compilation -*-" >> "$at_group_log" ( - $as_echo "38. EXPRTest.at:66: testing ..." + $as_echo "38. $at_setup_line: testing $at_desc ..." $at_traceon @@ -4078,7 +3959,7 @@ $as_echo "$at_srcdir/EXPRTest.at:66: \$abs_builddir/expr-test -W \$abs_srcdir/expr-testsuite/test.6 -k i[1:2][2:4] -f \"dummy\" || true" at_fn_check_prepare_dynamic "$abs_builddir/expr-test -W $abs_srcdir/expr-testsuite/test.6 -k i[1:2][2:4] -f \"dummy\" || true" "EXPRTest.at:66" ( $at_check_trace; $abs_builddir/expr-test -W $abs_srcdir/expr-testsuite/test.6 -k i[1:2][2:4] -f "dummy" || true -) >>"$at_stdout" 2>>"$at_stderr" +) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" @@ -4091,7 +3972,7 @@ $as_echo "$at_srcdir/EXPRTest.at:66: diff -b -B \$abs_srcdir/expr-testsuite/test.6a.base stdout || diff -b -B \$abs_srcdir/expr-testsuite/test.6a.base stderr" at_fn_check_prepare_dynamic "diff -b -B $abs_srcdir/expr-testsuite/test.6a.base stdout || diff -b -B $abs_srcdir/expr-testsuite/test.6a.base stderr" "EXPRTest.at:66" ( $at_check_trace; diff -b -B $abs_srcdir/expr-testsuite/test.6a.base stdout || diff -b -B $abs_srcdir/expr-testsuite/test.6a.base stderr -) >>"$at_stdout" 2>>"$at_stderr" +) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: @@ -4103,20 +3984,16 @@ set +x $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 | eval $at_tee_pipe +) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_38 #AT_START_39 -# 39. EXPRTest.at:67: expr-test -w $abs_srcdir/expr-testsuite/test.5 -k g.val[0:1][0:1][0:1] (pass) -at_setup_line='EXPRTest.at:67' -at_desc="expr-test -w \$abs_srcdir/expr-testsuite/test.5 -k g.val[0:1][0:1][0:1] (pass)" -at_desc_line=" 39: $at_desc" -$at_quiet $as_echo_n "$at_desc_line" +at_fn_group_banner 39 'EXPRTest.at:67' \ + "expr-test -w \$abs_srcdir/expr-testsuite/test.5 -k g.val[0:1][0:1][0:1] (pass)" "" at_xfail=no test "pass" = "xfail" && at_xfail=yes -echo "# -*- compilation -*-" >> "$at_group_log" ( - $as_echo "39. EXPRTest.at:67: testing ..." + $as_echo "39. $at_setup_line: testing $at_desc ..." $at_traceon @@ -4132,7 +4009,7 @@ $as_echo "$at_srcdir/EXPRTest.at:67: \$abs_builddir/expr-test -w \$abs_srcdir/expr-testsuite/test.5 -k g.val[0:1][0:1][0:1] -f \"dummy\" || true" at_fn_check_prepare_dynamic "$abs_builddir/expr-test -w $abs_srcdir/expr-testsuite/test.5 -k g.val[0:1][0:1][0:1] -f \"dummy\" || true" "EXPRTest.at:67" ( $at_check_trace; $abs_builddir/expr-test -w $abs_srcdir/expr-testsuite/test.5 -k g.val[0:1][0:1][0:1] -f "dummy" || true -) >>"$at_stdout" 2>>"$at_stderr" +) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" @@ -4145,7 +4022,7 @@ $as_echo "$at_srcdir/EXPRTest.at:67: diff -b -B \$abs_srcdir/expr-testsuite/test.5b.base stdout || diff -b -B \$abs_srcdir/expr-testsuite/test.5b.base stderr" at_fn_check_prepare_dynamic "diff -b -B $abs_srcdir/expr-testsuite/test.5b.base stdout || diff -b -B $abs_srcdir/expr-testsuite/test.5b.base stderr" "EXPRTest.at:67" ( $at_check_trace; diff -b -B $abs_srcdir/expr-testsuite/test.5b.base stdout || diff -b -B $abs_srcdir/expr-testsuite/test.5b.base stderr -) >>"$at_stdout" 2>>"$at_stderr" +) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: @@ -4157,20 +4034,16 @@ set +x $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 | eval $at_tee_pipe +) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_39 #AT_START_40 -# 40. EXPRTest.at:67: expr-test -W $abs_srcdir/expr-testsuite/test.5 -k g.val[0:1][0:1][0:1] (pass) -at_setup_line='EXPRTest.at:67' -at_desc="expr-test -W \$abs_srcdir/expr-testsuite/test.5 -k g.val[0:1][0:1][0:1] (pass)" -at_desc_line=" 40: $at_desc" -$at_quiet $as_echo_n "$at_desc_line" +at_fn_group_banner 40 'EXPRTest.at:67' \ + "expr-test -W \$abs_srcdir/expr-testsuite/test.5 -k g.val[0:1][0:1][0:1] (pass)" "" at_xfail=no test "pass" = "xfail" && at_xfail=yes -echo "# -*- compilation -*-" >> "$at_group_log" ( - $as_echo "40. EXPRTest.at:67: testing ..." + $as_echo "40. $at_setup_line: testing $at_desc ..." $at_traceon @@ -4186,7 +4059,7 @@ $as_echo "$at_srcdir/EXPRTest.at:67: \$abs_builddir/expr-test -W \$abs_srcdir/expr-testsuite/test.5 -k g.val[0:1][0:1][0:1] -f \"dummy\" || true" at_fn_check_prepare_dynamic "$abs_builddir/expr-test -W $abs_srcdir/expr-testsuite/test.5 -k g.val[0:1][0:1][0:1] -f \"dummy\" || true" "EXPRTest.at:67" ( $at_check_trace; $abs_builddir/expr-test -W $abs_srcdir/expr-testsuite/test.5 -k g.val[0:1][0:1][0:1] -f "dummy" || true -) >>"$at_stdout" 2>>"$at_stderr" +) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" @@ -4199,7 +4072,7 @@ $as_echo "$at_srcdir/EXPRTest.at:67: diff -b -B \$abs_srcdir/expr-testsuite/test.5b.base stdout || diff -b -B \$abs_srcdir/expr-testsuite/test.5b.base stderr" at_fn_check_prepare_dynamic "diff -b -B $abs_srcdir/expr-testsuite/test.5b.base stdout || diff -b -B $abs_srcdir/expr-testsuite/test.5b.base stderr" "EXPRTest.at:67" ( $at_check_trace; diff -b -B $abs_srcdir/expr-testsuite/test.5b.base stdout || diff -b -B $abs_srcdir/expr-testsuite/test.5b.base stderr -) >>"$at_stdout" 2>>"$at_stderr" +) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: @@ -4211,20 +4084,16 @@ set +x $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 | eval $at_tee_pipe +) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_40 #AT_START_41 -# 41. EXPRTest.at:68: expr-test -w $abs_srcdir/expr-testsuite/test.5 -k g.length (pass) -at_setup_line='EXPRTest.at:68' -at_desc="expr-test -w \$abs_srcdir/expr-testsuite/test.5 -k g.length (pass)" -at_desc_line=" 41: $at_desc" -$at_quiet $as_echo_n "$at_desc_line" +at_fn_group_banner 41 'EXPRTest.at:68' \ + "expr-test -w \$abs_srcdir/expr-testsuite/test.5 -k g.length (pass)" "" at_xfail=no test "pass" = "xfail" && at_xfail=yes -echo "# -*- compilation -*-" >> "$at_group_log" ( - $as_echo "41. EXPRTest.at:68: testing ..." + $as_echo "41. $at_setup_line: testing $at_desc ..." $at_traceon @@ -4240,7 +4109,7 @@ $as_echo "$at_srcdir/EXPRTest.at:68: \$abs_builddir/expr-test -w \$abs_srcdir/expr-testsuite/test.5 -k g.length -f \"dummy\" || true" at_fn_check_prepare_dynamic "$abs_builddir/expr-test -w $abs_srcdir/expr-testsuite/test.5 -k g.length -f \"dummy\" || true" "EXPRTest.at:68" ( $at_check_trace; $abs_builddir/expr-test -w $abs_srcdir/expr-testsuite/test.5 -k g.length -f "dummy" || true -) >>"$at_stdout" 2>>"$at_stderr" +) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" @@ -4253,7 +4122,7 @@ $as_echo "$at_srcdir/EXPRTest.at:68: diff -b -B \$abs_srcdir/expr-testsuite/test.5c.base stdout || diff -b -B \$abs_srcdir/expr-testsuite/test.5c.base stderr" at_fn_check_prepare_dynamic "diff -b -B $abs_srcdir/expr-testsuite/test.5c.base stdout || diff -b -B $abs_srcdir/expr-testsuite/test.5c.base stderr" "EXPRTest.at:68" ( $at_check_trace; diff -b -B $abs_srcdir/expr-testsuite/test.5c.base stdout || diff -b -B $abs_srcdir/expr-testsuite/test.5c.base stderr -) >>"$at_stdout" 2>>"$at_stderr" +) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: @@ -4265,20 +4134,16 @@ set +x $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 | eval $at_tee_pipe +) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_41 #AT_START_42 -# 42. EXPRTest.at:68: expr-test -W $abs_srcdir/expr-testsuite/test.5 -k g.length (pass) -at_setup_line='EXPRTest.at:68' -at_desc="expr-test -W \$abs_srcdir/expr-testsuite/test.5 -k g.length (pass)" -at_desc_line=" 42: $at_desc" -$at_quiet $as_echo_n "$at_desc_line" +at_fn_group_banner 42 'EXPRTest.at:68' \ + "expr-test -W \$abs_srcdir/expr-testsuite/test.5 -k g.length (pass)" "" at_xfail=no test "pass" = "xfail" && at_xfail=yes -echo "# -*- compilation -*-" >> "$at_group_log" ( - $as_echo "42. EXPRTest.at:68: testing ..." + $as_echo "42. $at_setup_line: testing $at_desc ..." $at_traceon @@ -4294,7 +4159,7 @@ $as_echo "$at_srcdir/EXPRTest.at:68: \$abs_builddir/expr-test -W \$abs_srcdir/expr-testsuite/test.5 -k g.length -f \"dummy\" || true" at_fn_check_prepare_dynamic "$abs_builddir/expr-test -W $abs_srcdir/expr-testsuite/test.5 -k g.length -f \"dummy\" || true" "EXPRTest.at:68" ( $at_check_trace; $abs_builddir/expr-test -W $abs_srcdir/expr-testsuite/test.5 -k g.length -f "dummy" || true -) >>"$at_stdout" 2>>"$at_stderr" +) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" @@ -4307,7 +4172,7 @@ $as_echo "$at_srcdir/EXPRTest.at:68: diff -b -B \$abs_srcdir/expr-testsuite/test.5c.base stdout || diff -b -B \$abs_srcdir/expr-testsuite/test.5c.base stderr" at_fn_check_prepare_dynamic "diff -b -B $abs_srcdir/expr-testsuite/test.5c.base stdout || diff -b -B $abs_srcdir/expr-testsuite/test.5c.base stderr" "EXPRTest.at:68" ( $at_check_trace; diff -b -B $abs_srcdir/expr-testsuite/test.5c.base stdout || diff -b -B $abs_srcdir/expr-testsuite/test.5c.base stderr -) >>"$at_stdout" 2>>"$at_stderr" +) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: @@ -4319,20 +4184,16 @@ set +x $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 | eval $at_tee_pipe +) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_42 #AT_START_43 -# 43. EXPRTest.at:69: expr-test -w $abs_srcdir/expr-testsuite/test.5 -k g.length,g.width (pass) -at_setup_line='EXPRTest.at:69' -at_desc="expr-test -w \$abs_srcdir/expr-testsuite/test.5 -k g.length,g.width (pass)" -at_desc_line=" 43: $at_desc" -$at_quiet $as_echo_n "$at_desc_line" +at_fn_group_banner 43 'EXPRTest.at:69' \ + "expr-test -w \$abs_srcdir/expr-testsuite/test.5 -k g.length,g.width (pass)" "" at_xfail=no test "pass" = "xfail" && at_xfail=yes -echo "# -*- compilation -*-" >> "$at_group_log" ( - $as_echo "43. EXPRTest.at:69: testing ..." + $as_echo "43. $at_setup_line: testing $at_desc ..." $at_traceon @@ -4348,7 +4209,7 @@ $as_echo "$at_srcdir/EXPRTest.at:69: \$abs_builddir/expr-test -w \$abs_srcdir/expr-testsuite/test.5 -k g.length,g.width -f \"dummy\" || true" at_fn_check_prepare_dynamic "$abs_builddir/expr-test -w $abs_srcdir/expr-testsuite/test.5 -k g.length,g.width -f \"dummy\" || true" "EXPRTest.at:69" ( $at_check_trace; $abs_builddir/expr-test -w $abs_srcdir/expr-testsuite/test.5 -k g.length,g.width -f "dummy" || true -) >>"$at_stdout" 2>>"$at_stderr" +) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" @@ -4361,7 +4222,7 @@ $as_echo "$at_srcdir/EXPRTest.at:69: diff -b -B \$abs_srcdir/expr-testsuite/test.5d.base stdout || diff -b -B \$abs_srcdir/expr-testsuite/test.5d.base stderr" at_fn_check_prepare_dynamic "diff -b -B $abs_srcdir/expr-testsuite/test.5d.base stdout || diff -b -B $abs_srcdir/expr-testsuite/test.5d.base stderr" "EXPRTest.at:69" ( $at_check_trace; diff -b -B $abs_srcdir/expr-testsuite/test.5d.base stdout || diff -b -B $abs_srcdir/expr-testsuite/test.5d.base stderr -) >>"$at_stdout" 2>>"$at_stderr" +) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: @@ -4373,20 +4234,16 @@ set +x $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 | eval $at_tee_pipe +) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_43 #AT_START_44 -# 44. EXPRTest.at:69: expr-test -W $abs_srcdir/expr-testsuite/test.5 -k g.length,g.width (pass) -at_setup_line='EXPRTest.at:69' -at_desc="expr-test -W \$abs_srcdir/expr-testsuite/test.5 -k g.length,g.width (pass)" -at_desc_line=" 44: $at_desc" -$at_quiet $as_echo_n "$at_desc_line" +at_fn_group_banner 44 'EXPRTest.at:69' \ + "expr-test -W \$abs_srcdir/expr-testsuite/test.5 -k g.length,g.width (pass)" "" at_xfail=no test "pass" = "xfail" && at_xfail=yes -echo "# -*- compilation -*-" >> "$at_group_log" ( - $as_echo "44. EXPRTest.at:69: testing ..." + $as_echo "44. $at_setup_line: testing $at_desc ..." $at_traceon @@ -4402,7 +4259,7 @@ $as_echo "$at_srcdir/EXPRTest.at:69: \$abs_builddir/expr-test -W \$abs_srcdir/expr-testsuite/test.5 -k g.length,g.width -f \"dummy\" || true" at_fn_check_prepare_dynamic "$abs_builddir/expr-test -W $abs_srcdir/expr-testsuite/test.5 -k g.length,g.width -f \"dummy\" || true" "EXPRTest.at:69" ( $at_check_trace; $abs_builddir/expr-test -W $abs_srcdir/expr-testsuite/test.5 -k g.length,g.width -f "dummy" || true -) >>"$at_stdout" 2>>"$at_stderr" +) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" @@ -4415,7 +4272,7 @@ $as_echo "$at_srcdir/EXPRTest.at:69: diff -b -B \$abs_srcdir/expr-testsuite/test.5d.base stdout || diff -b -B \$abs_srcdir/expr-testsuite/test.5d.base stderr" at_fn_check_prepare_dynamic "diff -b -B $abs_srcdir/expr-testsuite/test.5d.base stdout || diff -b -B $abs_srcdir/expr-testsuite/test.5d.base stderr" "EXPRTest.at:69" ( $at_check_trace; diff -b -B $abs_srcdir/expr-testsuite/test.5d.base stdout || diff -b -B $abs_srcdir/expr-testsuite/test.5d.base stderr -) >>"$at_stdout" 2>>"$at_stderr" +) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: @@ -4427,20 +4284,16 @@ set +x $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 | eval $at_tee_pipe +) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_44 #AT_START_45 -# 45. EXPRTest.at:70: expr-test -w $abs_srcdir/expr-testsuite/test.2 -k j,o (pass) -at_setup_line='EXPRTest.at:70' -at_desc="expr-test -w \$abs_srcdir/expr-testsuite/test.2 -k j,o (pass)" -at_desc_line=" 45: $at_desc" -$at_quiet $as_echo_n "$at_desc_line" +at_fn_group_banner 45 'EXPRTest.at:70' \ + "expr-test -w \$abs_srcdir/expr-testsuite/test.2 -k j,o (pass)" "" at_xfail=no test "pass" = "xfail" && at_xfail=yes -echo "# -*- compilation -*-" >> "$at_group_log" ( - $as_echo "45. EXPRTest.at:70: testing ..." + $as_echo "45. $at_setup_line: testing $at_desc ..." $at_traceon @@ -4456,7 +4309,7 @@ $as_echo "$at_srcdir/EXPRTest.at:70: \$abs_builddir/expr-test -w \$abs_srcdir/expr-testsuite/test.2 -k j,o -f \"dummy\" || true" at_fn_check_prepare_dynamic "$abs_builddir/expr-test -w $abs_srcdir/expr-testsuite/test.2 -k j,o -f \"dummy\" || true" "EXPRTest.at:70" ( $at_check_trace; $abs_builddir/expr-test -w $abs_srcdir/expr-testsuite/test.2 -k j,o -f "dummy" || true -) >>"$at_stdout" 2>>"$at_stderr" +) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" @@ -4469,7 +4322,7 @@ $as_echo "$at_srcdir/EXPRTest.at:70: diff -b -B \$abs_srcdir/expr-testsuite/test.2g.base stdout || diff -b -B \$abs_srcdir/expr-testsuite/test.2g.base stderr" at_fn_check_prepare_dynamic "diff -b -B $abs_srcdir/expr-testsuite/test.2g.base stdout || diff -b -B $abs_srcdir/expr-testsuite/test.2g.base stderr" "EXPRTest.at:70" ( $at_check_trace; diff -b -B $abs_srcdir/expr-testsuite/test.2g.base stdout || diff -b -B $abs_srcdir/expr-testsuite/test.2g.base stderr -) >>"$at_stdout" 2>>"$at_stderr" +) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: @@ -4481,20 +4334,16 @@ set +x $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 | eval $at_tee_pipe +) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_45 #AT_START_46 -# 46. EXPRTest.at:70: expr-test -W $abs_srcdir/expr-testsuite/test.2 -k j,o (pass) -at_setup_line='EXPRTest.at:70' -at_desc="expr-test -W \$abs_srcdir/expr-testsuite/test.2 -k j,o (pass)" -at_desc_line=" 46: $at_desc" -$at_quiet $as_echo_n "$at_desc_line" +at_fn_group_banner 46 'EXPRTest.at:70' \ + "expr-test -W \$abs_srcdir/expr-testsuite/test.2 -k j,o (pass)" "" at_xfail=no test "pass" = "xfail" && at_xfail=yes -echo "# -*- compilation -*-" >> "$at_group_log" ( - $as_echo "46. EXPRTest.at:70: testing ..." + $as_echo "46. $at_setup_line: testing $at_desc ..." $at_traceon @@ -4510,7 +4359,7 @@ $as_echo "$at_srcdir/EXPRTest.at:70: \$abs_builddir/expr-test -W \$abs_srcdir/expr-testsuite/test.2 -k j,o -f \"dummy\" || true" at_fn_check_prepare_dynamic "$abs_builddir/expr-test -W $abs_srcdir/expr-testsuite/test.2 -k j,o -f \"dummy\" || true" "EXPRTest.at:70" ( $at_check_trace; $abs_builddir/expr-test -W $abs_srcdir/expr-testsuite/test.2 -k j,o -f "dummy" || true -) >>"$at_stdout" 2>>"$at_stderr" +) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" @@ -4523,7 +4372,7 @@ $as_echo "$at_srcdir/EXPRTest.at:70: diff -b -B \$abs_srcdir/expr-testsuite/test.2g.base stdout || diff -b -B \$abs_srcdir/expr-testsuite/test.2g.base stderr" at_fn_check_prepare_dynamic "diff -b -B $abs_srcdir/expr-testsuite/test.2g.base stdout || diff -b -B $abs_srcdir/expr-testsuite/test.2g.base stderr" "EXPRTest.at:70" ( $at_check_trace; diff -b -B $abs_srcdir/expr-testsuite/test.2g.base stdout || diff -b -B $abs_srcdir/expr-testsuite/test.2g.base stderr -) >>"$at_stdout" 2>>"$at_stderr" +) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: @@ -4535,20 +4384,16 @@ set +x $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 | eval $at_tee_pipe +) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_46 #AT_START_47 -# 47. EXPRTest.at:71: expr-test -w $abs_srcdir/expr-testsuite/test.8 -k "data%23i[0:2:9][0:2]" (pass) -at_setup_line='EXPRTest.at:71' -at_desc="expr-test -w \$abs_srcdir/expr-testsuite/test.8 -k \"data%23i[0:2:9][0:2]\" (pass)" -at_desc_line=" 47: $at_desc" -$at_quiet $as_echo_n "$at_desc_line" +at_fn_group_banner 47 'EXPRTest.at:71' \ + "expr-test -w \$abs_srcdir/expr-testsuite/test.8 -k \"data%23i[0:2:9][0:2]\" (pass)" "" at_xfail=no test "pass" = "xfail" && at_xfail=yes -echo "# -*- compilation -*-" >> "$at_group_log" ( - $as_echo "47. EXPRTest.at:71: testing ..." + $as_echo "47. $at_setup_line: testing $at_desc ..." $at_traceon @@ -4564,7 +4409,7 @@ $as_echo "$at_srcdir/EXPRTest.at:71: \$abs_builddir/expr-test -w \$abs_srcdir/expr-testsuite/test.8 -k \"data%23i[0:2:9][0:2]\" -f \"dummy\" || true" at_fn_check_prepare_dynamic "$abs_builddir/expr-test -w $abs_srcdir/expr-testsuite/test.8 -k \"data%23i[0:2:9][0:2]\" -f \"dummy\" || true" "EXPRTest.at:71" ( $at_check_trace; $abs_builddir/expr-test -w $abs_srcdir/expr-testsuite/test.8 -k "data%23i[0:2:9][0:2]" -f "dummy" || true -) >>"$at_stdout" 2>>"$at_stderr" +) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" @@ -4577,7 +4422,7 @@ $as_echo "$at_srcdir/EXPRTest.at:71: diff -b -B \$abs_srcdir/expr-testsuite/test.8.base stdout || diff -b -B \$abs_srcdir/expr-testsuite/test.8.base stderr" at_fn_check_prepare_dynamic "diff -b -B $abs_srcdir/expr-testsuite/test.8.base stdout || diff -b -B $abs_srcdir/expr-testsuite/test.8.base stderr" "EXPRTest.at:71" ( $at_check_trace; diff -b -B $abs_srcdir/expr-testsuite/test.8.base stdout || diff -b -B $abs_srcdir/expr-testsuite/test.8.base stderr -) >>"$at_stdout" 2>>"$at_stderr" +) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: @@ -4589,20 +4434,16 @@ set +x $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 | eval $at_tee_pipe +) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_47 #AT_START_48 -# 48. EXPRTest.at:71: expr-test -W $abs_srcdir/expr-testsuite/test.8 -k "data%23i[0:2:9][0:2]" (pass) -at_setup_line='EXPRTest.at:71' -at_desc="expr-test -W \$abs_srcdir/expr-testsuite/test.8 -k \"data%23i[0:2:9][0:2]\" (pass)" -at_desc_line=" 48: $at_desc" -$at_quiet $as_echo_n "$at_desc_line" +at_fn_group_banner 48 'EXPRTest.at:71' \ + "expr-test -W \$abs_srcdir/expr-testsuite/test.8 -k \"data%23i[0:2:9][0:2]\" (pass)" "" at_xfail=no test "pass" = "xfail" && at_xfail=yes -echo "# -*- compilation -*-" >> "$at_group_log" ( - $as_echo "48. EXPRTest.at:71: testing ..." + $as_echo "48. $at_setup_line: testing $at_desc ..." $at_traceon @@ -4618,7 +4459,7 @@ $as_echo "$at_srcdir/EXPRTest.at:71: \$abs_builddir/expr-test -W \$abs_srcdir/expr-testsuite/test.8 -k \"data%23i[0:2:9][0:2]\" -f \"dummy\" || true" at_fn_check_prepare_dynamic "$abs_builddir/expr-test -W $abs_srcdir/expr-testsuite/test.8 -k \"data%23i[0:2:9][0:2]\" -f \"dummy\" || true" "EXPRTest.at:71" ( $at_check_trace; $abs_builddir/expr-test -W $abs_srcdir/expr-testsuite/test.8 -k "data%23i[0:2:9][0:2]" -f "dummy" || true -) >>"$at_stdout" 2>>"$at_stderr" +) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" @@ -4631,7 +4472,7 @@ $as_echo "$at_srcdir/EXPRTest.at:71: diff -b -B \$abs_srcdir/expr-testsuite/test.8.base stdout || diff -b -B \$abs_srcdir/expr-testsuite/test.8.base stderr" at_fn_check_prepare_dynamic "diff -b -B $abs_srcdir/expr-testsuite/test.8.base stdout || diff -b -B $abs_srcdir/expr-testsuite/test.8.base stderr" "EXPRTest.at:71" ( $at_check_trace; diff -b -B $abs_srcdir/expr-testsuite/test.8.base stdout || diff -b -B $abs_srcdir/expr-testsuite/test.8.base stderr -) >>"$at_stdout" 2>>"$at_stderr" +) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: @@ -4643,20 +4484,16 @@ set +x $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 | eval $at_tee_pipe +) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_48 #AT_START_49 -# 49. EXPRTest.at:72: expr-test -w $abs_srcdir/expr-testsuite/test.7 -k x,y,f (pass) -at_setup_line='EXPRTest.at:72' -at_desc="expr-test -w \$abs_srcdir/expr-testsuite/test.7 -k x,y,f (pass)" -at_desc_line=" 49: $at_desc" -$at_quiet $as_echo_n "$at_desc_line" +at_fn_group_banner 49 'EXPRTest.at:72' \ + "expr-test -w \$abs_srcdir/expr-testsuite/test.7 -k x,y,f (pass)" "" at_xfail=no test "pass" = "xfail" && at_xfail=yes -echo "# -*- compilation -*-" >> "$at_group_log" ( - $as_echo "49. EXPRTest.at:72: testing ..." + $as_echo "49. $at_setup_line: testing $at_desc ..." $at_traceon @@ -4672,7 +4509,7 @@ $as_echo "$at_srcdir/EXPRTest.at:72: \$abs_builddir/expr-test -w \$abs_srcdir/expr-testsuite/test.7 -k x,y,f -f \"dummy\" || true" at_fn_check_prepare_dynamic "$abs_builddir/expr-test -w $abs_srcdir/expr-testsuite/test.7 -k x,y,f -f \"dummy\" || true" "EXPRTest.at:72" ( $at_check_trace; $abs_builddir/expr-test -w $abs_srcdir/expr-testsuite/test.7 -k x,y,f -f "dummy" || true -) >>"$at_stdout" 2>>"$at_stderr" +) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" @@ -4685,7 +4522,7 @@ $as_echo "$at_srcdir/EXPRTest.at:72: diff -b -B \$abs_srcdir/expr-testsuite/test.7.base stdout || diff -b -B \$abs_srcdir/expr-testsuite/test.7.base stderr" at_fn_check_prepare_dynamic "diff -b -B $abs_srcdir/expr-testsuite/test.7.base stdout || diff -b -B $abs_srcdir/expr-testsuite/test.7.base stderr" "EXPRTest.at:72" ( $at_check_trace; diff -b -B $abs_srcdir/expr-testsuite/test.7.base stdout || diff -b -B $abs_srcdir/expr-testsuite/test.7.base stderr -) >>"$at_stdout" 2>>"$at_stderr" +) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: @@ -4697,20 +4534,16 @@ set +x $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 | eval $at_tee_pipe +) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_49 #AT_START_50 -# 50. EXPRTest.at:72: expr-test -W $abs_srcdir/expr-testsuite/test.7 -k x,y,f (pass) -at_setup_line='EXPRTest.at:72' -at_desc="expr-test -W \$abs_srcdir/expr-testsuite/test.7 -k x,y,f (pass)" -at_desc_line=" 50: $at_desc" -$at_quiet $as_echo_n "$at_desc_line" +at_fn_group_banner 50 'EXPRTest.at:72' \ + "expr-test -W \$abs_srcdir/expr-testsuite/test.7 -k x,y,f (pass)" "" at_xfail=no test "pass" = "xfail" && at_xfail=yes -echo "# -*- compilation -*-" >> "$at_group_log" ( - $as_echo "50. EXPRTest.at:72: testing ..." + $as_echo "50. $at_setup_line: testing $at_desc ..." $at_traceon @@ -4726,7 +4559,7 @@ $as_echo "$at_srcdir/EXPRTest.at:72: \$abs_builddir/expr-test -W \$abs_srcdir/expr-testsuite/test.7 -k x,y,f -f \"dummy\" || true" at_fn_check_prepare_dynamic "$abs_builddir/expr-test -W $abs_srcdir/expr-testsuite/test.7 -k x,y,f -f \"dummy\" || true" "EXPRTest.at:72" ( $at_check_trace; $abs_builddir/expr-test -W $abs_srcdir/expr-testsuite/test.7 -k x,y,f -f "dummy" || true -) >>"$at_stdout" 2>>"$at_stderr" +) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" @@ -4739,7 +4572,7 @@ $as_echo "$at_srcdir/EXPRTest.at:72: diff -b -B \$abs_srcdir/expr-testsuite/test.7.base stdout || diff -b -B \$abs_srcdir/expr-testsuite/test.7.base stderr" at_fn_check_prepare_dynamic "diff -b -B $abs_srcdir/expr-testsuite/test.7.base stdout || diff -b -B $abs_srcdir/expr-testsuite/test.7.base stderr" "EXPRTest.at:72" ( $at_check_trace; diff -b -B $abs_srcdir/expr-testsuite/test.7.base stdout || diff -b -B $abs_srcdir/expr-testsuite/test.7.base stderr -) >>"$at_stdout" 2>>"$at_stderr" +) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: @@ -4751,20 +4584,16 @@ set +x $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 | eval $at_tee_pipe +) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_50 #AT_START_51 -# 51. EXPRTest.at:73: expr-test -w $abs_srcdir/expr-testsuite/test.8 -k "x%23y,y" (pass) -at_setup_line='EXPRTest.at:73' -at_desc="expr-test -w \$abs_srcdir/expr-testsuite/test.8 -k \"x%23y,y\" (pass)" -at_desc_line=" 51: $at_desc" -$at_quiet $as_echo_n "$at_desc_line" +at_fn_group_banner 51 'EXPRTest.at:73' \ + "expr-test -w \$abs_srcdir/expr-testsuite/test.8 -k \"x%23y,y\" (pass)" "" at_xfail=no test "pass" = "xfail" && at_xfail=yes -echo "# -*- compilation -*-" >> "$at_group_log" ( - $as_echo "51. EXPRTest.at:73: testing ..." + $as_echo "51. $at_setup_line: testing $at_desc ..." $at_traceon @@ -4780,7 +4609,7 @@ $as_echo "$at_srcdir/EXPRTest.at:73: \$abs_builddir/expr-test -w \$abs_srcdir/expr-testsuite/test.8 -k \"x%23y,y\" -f \"dummy\" || true" at_fn_check_prepare_dynamic "$abs_builddir/expr-test -w $abs_srcdir/expr-testsuite/test.8 -k \"x%23y,y\" -f \"dummy\" || true" "EXPRTest.at:73" ( $at_check_trace; $abs_builddir/expr-test -w $abs_srcdir/expr-testsuite/test.8 -k "x%23y,y" -f "dummy" || true -) >>"$at_stdout" 2>>"$at_stderr" +) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" @@ -4793,7 +4622,7 @@ $as_echo "$at_srcdir/EXPRTest.at:73: diff -b -B \$abs_srcdir/expr-testsuite/test.8a.base stdout || diff -b -B \$abs_srcdir/expr-testsuite/test.8a.base stderr" at_fn_check_prepare_dynamic "diff -b -B $abs_srcdir/expr-testsuite/test.8a.base stdout || diff -b -B $abs_srcdir/expr-testsuite/test.8a.base stderr" "EXPRTest.at:73" ( $at_check_trace; diff -b -B $abs_srcdir/expr-testsuite/test.8a.base stdout || diff -b -B $abs_srcdir/expr-testsuite/test.8a.base stderr -) >>"$at_stdout" 2>>"$at_stderr" +) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: @@ -4805,20 +4634,16 @@ set +x $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 | eval $at_tee_pipe +) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_51 #AT_START_52 -# 52. EXPRTest.at:73: expr-test -W $abs_srcdir/expr-testsuite/test.8 -k "x%23y,y" (pass) -at_setup_line='EXPRTest.at:73' -at_desc="expr-test -W \$abs_srcdir/expr-testsuite/test.8 -k \"x%23y,y\" (pass)" -at_desc_line=" 52: $at_desc" -$at_quiet $as_echo_n "$at_desc_line" +at_fn_group_banner 52 'EXPRTest.at:73' \ + "expr-test -W \$abs_srcdir/expr-testsuite/test.8 -k \"x%23y,y\" (pass)" "" at_xfail=no test "pass" = "xfail" && at_xfail=yes -echo "# -*- compilation -*-" >> "$at_group_log" ( - $as_echo "52. EXPRTest.at:73: testing ..." + $as_echo "52. $at_setup_line: testing $at_desc ..." $at_traceon @@ -4834,7 +4659,7 @@ $as_echo "$at_srcdir/EXPRTest.at:73: \$abs_builddir/expr-test -W \$abs_srcdir/expr-testsuite/test.8 -k \"x%23y,y\" -f \"dummy\" || true" at_fn_check_prepare_dynamic "$abs_builddir/expr-test -W $abs_srcdir/expr-testsuite/test.8 -k \"x%23y,y\" -f \"dummy\" || true" "EXPRTest.at:73" ( $at_check_trace; $abs_builddir/expr-test -W $abs_srcdir/expr-testsuite/test.8 -k "x%23y,y" -f "dummy" || true -) >>"$at_stdout" 2>>"$at_stderr" +) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" @@ -4847,7 +4672,7 @@ $as_echo "$at_srcdir/EXPRTest.at:73: diff -b -B \$abs_srcdir/expr-testsuite/test.8a.base stdout || diff -b -B \$abs_srcdir/expr-testsuite/test.8a.base stderr" at_fn_check_prepare_dynamic "diff -b -B $abs_srcdir/expr-testsuite/test.8a.base stdout || diff -b -B $abs_srcdir/expr-testsuite/test.8a.base stderr" "EXPRTest.at:73" ( $at_check_trace; diff -b -B $abs_srcdir/expr-testsuite/test.8a.base stdout || diff -b -B $abs_srcdir/expr-testsuite/test.8a.base stderr -) >>"$at_stdout" 2>>"$at_stderr" +) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: @@ -4859,20 +4684,16 @@ set +x $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 | eval $at_tee_pipe +) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_52 #AT_START_53 -# 53. EXPRTest.at:74: expr-test -w $abs_srcdir/expr-testsuite/test.8 -k "data%20name,y" (pass) -at_setup_line='EXPRTest.at:74' -at_desc="expr-test -w \$abs_srcdir/expr-testsuite/test.8 -k \"data%20name,y\" (pass)" -at_desc_line=" 53: $at_desc" -$at_quiet $as_echo_n "$at_desc_line" +at_fn_group_banner 53 'EXPRTest.at:74' \ + "expr-test -w \$abs_srcdir/expr-testsuite/test.8 -k \"data%20name,y\" (pass)" "" at_xfail=no test "pass" = "xfail" && at_xfail=yes -echo "# -*- compilation -*-" >> "$at_group_log" ( - $as_echo "53. EXPRTest.at:74: testing ..." + $as_echo "53. $at_setup_line: testing $at_desc ..." $at_traceon @@ -4888,7 +4709,7 @@ $as_echo "$at_srcdir/EXPRTest.at:74: \$abs_builddir/expr-test -w \$abs_srcdir/expr-testsuite/test.8 -k \"data%20name,y\" -f \"dummy\" || true" at_fn_check_prepare_dynamic "$abs_builddir/expr-test -w $abs_srcdir/expr-testsuite/test.8 -k \"data%20name,y\" -f \"dummy\" || true" "EXPRTest.at:74" ( $at_check_trace; $abs_builddir/expr-test -w $abs_srcdir/expr-testsuite/test.8 -k "data%20name,y" -f "dummy" || true -) >>"$at_stdout" 2>>"$at_stderr" +) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" @@ -4901,7 +4722,7 @@ $as_echo "$at_srcdir/EXPRTest.at:74: diff -b -B \$abs_srcdir/expr-testsuite/test.8b.base stdout || diff -b -B \$abs_srcdir/expr-testsuite/test.8b.base stderr" at_fn_check_prepare_dynamic "diff -b -B $abs_srcdir/expr-testsuite/test.8b.base stdout || diff -b -B $abs_srcdir/expr-testsuite/test.8b.base stderr" "EXPRTest.at:74" ( $at_check_trace; diff -b -B $abs_srcdir/expr-testsuite/test.8b.base stdout || diff -b -B $abs_srcdir/expr-testsuite/test.8b.base stderr -) >>"$at_stdout" 2>>"$at_stderr" +) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: @@ -4913,20 +4734,16 @@ set +x $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 | eval $at_tee_pipe +) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_53 #AT_START_54 -# 54. EXPRTest.at:74: expr-test -W $abs_srcdir/expr-testsuite/test.8 -k "data%20name,y" (pass) -at_setup_line='EXPRTest.at:74' -at_desc="expr-test -W \$abs_srcdir/expr-testsuite/test.8 -k \"data%20name,y\" (pass)" -at_desc_line=" 54: $at_desc" -$at_quiet $as_echo_n "$at_desc_line" +at_fn_group_banner 54 'EXPRTest.at:74' \ + "expr-test -W \$abs_srcdir/expr-testsuite/test.8 -k \"data%20name,y\" (pass)" "" at_xfail=no test "pass" = "xfail" && at_xfail=yes -echo "# -*- compilation -*-" >> "$at_group_log" ( - $as_echo "54. EXPRTest.at:74: testing ..." + $as_echo "54. $at_setup_line: testing $at_desc ..." $at_traceon @@ -4942,7 +4759,7 @@ $as_echo "$at_srcdir/EXPRTest.at:74: \$abs_builddir/expr-test -W \$abs_srcdir/expr-testsuite/test.8 -k \"data%20name,y\" -f \"dummy\" || true" at_fn_check_prepare_dynamic "$abs_builddir/expr-test -W $abs_srcdir/expr-testsuite/test.8 -k \"data%20name,y\" -f \"dummy\" || true" "EXPRTest.at:74" ( $at_check_trace; $abs_builddir/expr-test -W $abs_srcdir/expr-testsuite/test.8 -k "data%20name,y" -f "dummy" || true -) >>"$at_stdout" 2>>"$at_stderr" +) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" @@ -4955,7 +4772,7 @@ $as_echo "$at_srcdir/EXPRTest.at:74: diff -b -B \$abs_srcdir/expr-testsuite/test.8b.base stdout || diff -b -B \$abs_srcdir/expr-testsuite/test.8b.base stderr" at_fn_check_prepare_dynamic "diff -b -B $abs_srcdir/expr-testsuite/test.8b.base stdout || diff -b -B $abs_srcdir/expr-testsuite/test.8b.base stderr" "EXPRTest.at:74" ( $at_check_trace; diff -b -B $abs_srcdir/expr-testsuite/test.8b.base stdout || diff -b -B $abs_srcdir/expr-testsuite/test.8b.base stderr -) >>"$at_stdout" 2>>"$at_stderr" +) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: @@ -4967,20 +4784,16 @@ set +x $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 | eval $at_tee_pipe +) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_54 #AT_START_55 -# 55. EXPRTest.at:75: expr-test -w $abs_srcdir/expr-testsuite/test.9 -k "Data-Set-2.fakeDim0[0:3],Data-Set-2.fakeDim1[0:3]" (pass) -at_setup_line='EXPRTest.at:75' -at_desc="expr-test -w \$abs_srcdir/expr-testsuite/test.9 -k \"Data-Set-2.fakeDim0[0:3],Data-Set-2.fakeDim1[0:3]\" (pass)" -at_desc_line=" 55: $at_desc" -$at_quiet $as_echo_n "$at_desc_line" +at_fn_group_banner 55 'EXPRTest.at:75' \ + "expr-test -w \$abs_srcdir/expr-testsuite/test.9 -k \"Data-Set-2.fakeDim0[0:3],Data-Set-2.fakeDim1[0:3]\" (pass)" "" at_xfail=no test "pass" = "xfail" && at_xfail=yes -echo "# -*- compilation -*-" >> "$at_group_log" ( - $as_echo "55. EXPRTest.at:75: testing ..." + $as_echo "55. $at_setup_line: testing $at_desc ..." $at_traceon @@ -4996,7 +4809,7 @@ $as_echo "$at_srcdir/EXPRTest.at:75: \$abs_builddir/expr-test -w \$abs_srcdir/expr-testsuite/test.9 -k \"Data-Set-2.fakeDim0[0:3],Data-Set-2.fakeDim1[0:3]\" -f \"dummy\" || true" at_fn_check_prepare_dynamic "$abs_builddir/expr-test -w $abs_srcdir/expr-testsuite/test.9 -k \"Data-Set-2.fakeDim0[0:3],Data-Set-2.fakeDim1[0:3]\" -f \"dummy\" || true" "EXPRTest.at:75" ( $at_check_trace; $abs_builddir/expr-test -w $abs_srcdir/expr-testsuite/test.9 -k "Data-Set-2.fakeDim0[0:3],Data-Set-2.fakeDim1[0:3]" -f "dummy" || true -) >>"$at_stdout" 2>>"$at_stderr" +) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" @@ -5009,7 +4822,7 @@ $as_echo "$at_srcdir/EXPRTest.at:75: diff -b -B \$abs_srcdir/expr-testsuite/test.9.base stdout || diff -b -B \$abs_srcdir/expr-testsuite/test.9.base stderr" at_fn_check_prepare_dynamic "diff -b -B $abs_srcdir/expr-testsuite/test.9.base stdout || diff -b -B $abs_srcdir/expr-testsuite/test.9.base stderr" "EXPRTest.at:75" ( $at_check_trace; diff -b -B $abs_srcdir/expr-testsuite/test.9.base stdout || diff -b -B $abs_srcdir/expr-testsuite/test.9.base stderr -) >>"$at_stdout" 2>>"$at_stderr" +) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: @@ -5021,20 +4834,16 @@ set +x $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 | eval $at_tee_pipe +) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_55 #AT_START_56 -# 56. EXPRTest.at:75: expr-test -W $abs_srcdir/expr-testsuite/test.9 -k "Data-Set-2.fakeDim0[0:3],Data-Set-2.fakeDim1[0:3]" (pass) -at_setup_line='EXPRTest.at:75' -at_desc="expr-test -W \$abs_srcdir/expr-testsuite/test.9 -k \"Data-Set-2.fakeDim0[0:3],Data-Set-2.fakeDim1[0:3]\" (pass)" -at_desc_line=" 56: $at_desc" -$at_quiet $as_echo_n "$at_desc_line" +at_fn_group_banner 56 'EXPRTest.at:75' \ + "expr-test -W \$abs_srcdir/expr-testsuite/test.9 -k \"Data-Set-2.fakeDim0[0:3],Data-Set-2.fakeDim1[0:3]\" (pass)" "" at_xfail=no test "pass" = "xfail" && at_xfail=yes -echo "# -*- compilation -*-" >> "$at_group_log" ( - $as_echo "56. EXPRTest.at:75: testing ..." + $as_echo "56. $at_setup_line: testing $at_desc ..." $at_traceon @@ -5050,7 +4859,7 @@ $as_echo "$at_srcdir/EXPRTest.at:75: \$abs_builddir/expr-test -W \$abs_srcdir/expr-testsuite/test.9 -k \"Data-Set-2.fakeDim0[0:3],Data-Set-2.fakeDim1[0:3]\" -f \"dummy\" || true" at_fn_check_prepare_dynamic "$abs_builddir/expr-test -W $abs_srcdir/expr-testsuite/test.9 -k \"Data-Set-2.fakeDim0[0:3],Data-Set-2.fakeDim1[0:3]\" -f \"dummy\" || true" "EXPRTest.at:75" ( $at_check_trace; $abs_builddir/expr-test -W $abs_srcdir/expr-testsuite/test.9 -k "Data-Set-2.fakeDim0[0:3],Data-Set-2.fakeDim1[0:3]" -f "dummy" || true -) >>"$at_stdout" 2>>"$at_stderr" +) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" @@ -5063,7 +4872,7 @@ $as_echo "$at_srcdir/EXPRTest.at:75: diff -b -B \$abs_srcdir/expr-testsuite/test.9.base stdout || diff -b -B \$abs_srcdir/expr-testsuite/test.9.base stderr" at_fn_check_prepare_dynamic "diff -b -B $abs_srcdir/expr-testsuite/test.9.base stdout || diff -b -B $abs_srcdir/expr-testsuite/test.9.base stderr" "EXPRTest.at:75" ( $at_check_trace; diff -b -B $abs_srcdir/expr-testsuite/test.9.base stdout || diff -b -B $abs_srcdir/expr-testsuite/test.9.base stderr -) >>"$at_stdout" 2>>"$at_stderr" +) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: @@ -5075,20 +4884,16 @@ set +x $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 | eval $at_tee_pipe +) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_56 #AT_START_57 -# 57. EXPRTest.at:76: expr-test -w $abs_srcdir/expr-testsuite/test.5 -k g[1:4:9] (pass) -at_setup_line='EXPRTest.at:76' -at_desc="expr-test -w \$abs_srcdir/expr-testsuite/test.5 -k g[1:4:9] (pass)" -at_desc_line=" 57: $at_desc" -$at_quiet $as_echo_n "$at_desc_line" +at_fn_group_banner 57 'EXPRTest.at:76' \ + "expr-test -w \$abs_srcdir/expr-testsuite/test.5 -k g[1:4:9] (pass)" "" at_xfail=no test "pass" = "xfail" && at_xfail=yes -echo "# -*- compilation -*-" >> "$at_group_log" ( - $as_echo "57. EXPRTest.at:76: testing ..." + $as_echo "57. $at_setup_line: testing $at_desc ..." $at_traceon @@ -5104,7 +4909,7 @@ $as_echo "$at_srcdir/EXPRTest.at:76: \$abs_builddir/expr-test -w \$abs_srcdir/expr-testsuite/test.5 -k g[1:4:9] -f \"dummy\" || true" at_fn_check_prepare_dynamic "$abs_builddir/expr-test -w $abs_srcdir/expr-testsuite/test.5 -k g[1:4:9] -f \"dummy\" || true" "EXPRTest.at:76" ( $at_check_trace; $abs_builddir/expr-test -w $abs_srcdir/expr-testsuite/test.5 -k g[1:4:9] -f "dummy" || true -) >>"$at_stdout" 2>>"$at_stderr" +) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" @@ -5117,7 +4922,7 @@ $as_echo "$at_srcdir/EXPRTest.at:76: diff -b -B \$abs_srcdir/expr-testsuite/test.5e.base stdout || diff -b -B \$abs_srcdir/expr-testsuite/test.5e.base stderr" at_fn_check_prepare_dynamic "diff -b -B $abs_srcdir/expr-testsuite/test.5e.base stdout || diff -b -B $abs_srcdir/expr-testsuite/test.5e.base stderr" "EXPRTest.at:76" ( $at_check_trace; diff -b -B $abs_srcdir/expr-testsuite/test.5e.base stdout || diff -b -B $abs_srcdir/expr-testsuite/test.5e.base stderr -) >>"$at_stdout" 2>>"$at_stderr" +) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: @@ -5129,20 +4934,16 @@ set +x $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 | eval $at_tee_pipe +) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_57 #AT_START_58 -# 58. EXPRTest.at:76: expr-test -W $abs_srcdir/expr-testsuite/test.5 -k g[1:4:9] (pass) -at_setup_line='EXPRTest.at:76' -at_desc="expr-test -W \$abs_srcdir/expr-testsuite/test.5 -k g[1:4:9] (pass)" -at_desc_line=" 58: $at_desc" -$at_quiet $as_echo_n "$at_desc_line" +at_fn_group_banner 58 'EXPRTest.at:76' \ + "expr-test -W \$abs_srcdir/expr-testsuite/test.5 -k g[1:4:9] (pass)" "" at_xfail=no test "pass" = "xfail" && at_xfail=yes -echo "# -*- compilation -*-" >> "$at_group_log" ( - $as_echo "58. EXPRTest.at:76: testing ..." + $as_echo "58. $at_setup_line: testing $at_desc ..." $at_traceon @@ -5158,7 +4959,7 @@ $as_echo "$at_srcdir/EXPRTest.at:76: \$abs_builddir/expr-test -W \$abs_srcdir/expr-testsuite/test.5 -k g[1:4:9] -f \"dummy\" || true" at_fn_check_prepare_dynamic "$abs_builddir/expr-test -W $abs_srcdir/expr-testsuite/test.5 -k g[1:4:9] -f \"dummy\" || true" "EXPRTest.at:76" ( $at_check_trace; $abs_builddir/expr-test -W $abs_srcdir/expr-testsuite/test.5 -k g[1:4:9] -f "dummy" || true -) >>"$at_stdout" 2>>"$at_stderr" +) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" @@ -5171,7 +4972,7 @@ $as_echo "$at_srcdir/EXPRTest.at:76: diff -b -B \$abs_srcdir/expr-testsuite/test.5e.base stdout || diff -b -B \$abs_srcdir/expr-testsuite/test.5e.base stderr" at_fn_check_prepare_dynamic "diff -b -B $abs_srcdir/expr-testsuite/test.5e.base stdout || diff -b -B $abs_srcdir/expr-testsuite/test.5e.base stderr" "EXPRTest.at:76" ( $at_check_trace; diff -b -B $abs_srcdir/expr-testsuite/test.5e.base stdout || diff -b -B $abs_srcdir/expr-testsuite/test.5e.base stderr -) >>"$at_stdout" 2>>"$at_stderr" +) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: @@ -5183,20 +4984,16 @@ set +x $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 | eval $at_tee_pipe +) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_58 #AT_START_59 -# 59. EXPRTest.at:77: expr-test -w $abs_srcdir/expr-testsuite/test.6 -k i[1:4:9] (pass) -at_setup_line='EXPRTest.at:77' -at_desc="expr-test -w \$abs_srcdir/expr-testsuite/test.6 -k i[1:4:9] (pass)" -at_desc_line=" 59: $at_desc" -$at_quiet $as_echo_n "$at_desc_line" +at_fn_group_banner 59 'EXPRTest.at:77' \ + "expr-test -w \$abs_srcdir/expr-testsuite/test.6 -k i[1:4:9] (pass)" "" at_xfail=no test "pass" = "xfail" && at_xfail=yes -echo "# -*- compilation -*-" >> "$at_group_log" ( - $as_echo "59. EXPRTest.at:77: testing ..." + $as_echo "59. $at_setup_line: testing $at_desc ..." $at_traceon @@ -5212,7 +5009,7 @@ $as_echo "$at_srcdir/EXPRTest.at:77: \$abs_builddir/expr-test -w \$abs_srcdir/expr-testsuite/test.6 -k i[1:4:9] -f \"dummy\" || true" at_fn_check_prepare_dynamic "$abs_builddir/expr-test -w $abs_srcdir/expr-testsuite/test.6 -k i[1:4:9] -f \"dummy\" || true" "EXPRTest.at:77" ( $at_check_trace; $abs_builddir/expr-test -w $abs_srcdir/expr-testsuite/test.6 -k i[1:4:9] -f "dummy" || true -) >>"$at_stdout" 2>>"$at_stderr" +) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" @@ -5225,7 +5022,7 @@ $as_echo "$at_srcdir/EXPRTest.at:77: diff -b -B \$abs_srcdir/expr-testsuite/test.6b.base stdout || diff -b -B \$abs_srcdir/expr-testsuite/test.6b.base stderr" at_fn_check_prepare_dynamic "diff -b -B $abs_srcdir/expr-testsuite/test.6b.base stdout || diff -b -B $abs_srcdir/expr-testsuite/test.6b.base stderr" "EXPRTest.at:77" ( $at_check_trace; diff -b -B $abs_srcdir/expr-testsuite/test.6b.base stdout || diff -b -B $abs_srcdir/expr-testsuite/test.6b.base stderr -) >>"$at_stdout" 2>>"$at_stderr" +) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: @@ -5237,20 +5034,16 @@ set +x $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 | eval $at_tee_pipe +) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_59 #AT_START_60 -# 60. EXPRTest.at:77: expr-test -W $abs_srcdir/expr-testsuite/test.6 -k i[1:4:9] (pass) -at_setup_line='EXPRTest.at:77' -at_desc="expr-test -W \$abs_srcdir/expr-testsuite/test.6 -k i[1:4:9] (pass)" -at_desc_line=" 60: $at_desc" -$at_quiet $as_echo_n "$at_desc_line" +at_fn_group_banner 60 'EXPRTest.at:77' \ + "expr-test -W \$abs_srcdir/expr-testsuite/test.6 -k i[1:4:9] (pass)" "" at_xfail=no test "pass" = "xfail" && at_xfail=yes -echo "# -*- compilation -*-" >> "$at_group_log" ( - $as_echo "60. EXPRTest.at:77: testing ..." + $as_echo "60. $at_setup_line: testing $at_desc ..." $at_traceon @@ -5266,7 +5059,7 @@ $as_echo "$at_srcdir/EXPRTest.at:77: \$abs_builddir/expr-test -W \$abs_srcdir/expr-testsuite/test.6 -k i[1:4:9] -f \"dummy\" || true" at_fn_check_prepare_dynamic "$abs_builddir/expr-test -W $abs_srcdir/expr-testsuite/test.6 -k i[1:4:9] -f \"dummy\" || true" "EXPRTest.at:77" ( $at_check_trace; $abs_builddir/expr-test -W $abs_srcdir/expr-testsuite/test.6 -k i[1:4:9] -f "dummy" || true -) >>"$at_stdout" 2>>"$at_stderr" +) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" @@ -5279,7 +5072,7 @@ $as_echo "$at_srcdir/EXPRTest.at:77: diff -b -B \$abs_srcdir/expr-testsuite/test.6b.base stdout || diff -b -B \$abs_srcdir/expr-testsuite/test.6b.base stderr" at_fn_check_prepare_dynamic "diff -b -B $abs_srcdir/expr-testsuite/test.6b.base stdout || diff -b -B $abs_srcdir/expr-testsuite/test.6b.base stderr" "EXPRTest.at:77" ( $at_check_trace; diff -b -B $abs_srcdir/expr-testsuite/test.6b.base stdout || diff -b -B $abs_srcdir/expr-testsuite/test.6b.base stderr -) >>"$at_stdout" 2>>"$at_stderr" +) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: @@ -5291,20 +5084,16 @@ set +x $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 | eval $at_tee_pipe +) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_60 #AT_START_61 -# 61. EXPRTest.at:78: expr-test -w $abs_srcdir/expr-testsuite/test.a -k "" -b (pass) -at_setup_line='EXPRTest.at:78' -at_desc="expr-test -w \$abs_srcdir/expr-testsuite/test.a -k \"\" -b (pass)" -at_desc_line=" 61: $at_desc" -$at_quiet $as_echo_n "$at_desc_line" +at_fn_group_banner 61 'EXPRTest.at:78' \ + "expr-test -w \$abs_srcdir/expr-testsuite/test.a -k \"\" -b (pass)" "" at_xfail=no test "pass" = "xfail" && at_xfail=yes -echo "# -*- compilation -*-" >> "$at_group_log" ( - $as_echo "61. EXPRTest.at:78: testing ..." + $as_echo "61. $at_setup_line: testing $at_desc ..." $at_traceon @@ -5320,7 +5109,7 @@ $as_echo "$at_srcdir/EXPRTest.at:78: \$abs_builddir/expr-test -w \$abs_srcdir/expr-testsuite/test.a -k \"\" -b -f \"dummy\" || true" at_fn_check_prepare_dynamic "$abs_builddir/expr-test -w $abs_srcdir/expr-testsuite/test.a -k \"\" -b -f \"dummy\" || true" "EXPRTest.at:78" ( $at_check_trace; $abs_builddir/expr-test -w $abs_srcdir/expr-testsuite/test.a -k "" -b -f "dummy" || true -) >>"$at_stdout" 2>>"$at_stderr" +) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" @@ -5333,7 +5122,7 @@ $as_echo "$at_srcdir/EXPRTest.at:78: diff -b -B \$abs_srcdir/expr-testsuite/test.a.base stdout || diff -b -B \$abs_srcdir/expr-testsuite/test.a.base stderr" at_fn_check_prepare_dynamic "diff -b -B $abs_srcdir/expr-testsuite/test.a.base stdout || diff -b -B $abs_srcdir/expr-testsuite/test.a.base stderr" "EXPRTest.at:78" ( $at_check_trace; diff -b -B $abs_srcdir/expr-testsuite/test.a.base stdout || diff -b -B $abs_srcdir/expr-testsuite/test.a.base stderr -) >>"$at_stdout" 2>>"$at_stderr" +) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: @@ -5345,20 +5134,16 @@ set +x $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 | eval $at_tee_pipe +) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_61 #AT_START_62 -# 62. EXPRTest.at:78: expr-test -W $abs_srcdir/expr-testsuite/test.a -k "" -b (pass) -at_setup_line='EXPRTest.at:78' -at_desc="expr-test -W \$abs_srcdir/expr-testsuite/test.a -k \"\" -b (pass)" -at_desc_line=" 62: $at_desc" -$at_quiet $as_echo_n "$at_desc_line" +at_fn_group_banner 62 'EXPRTest.at:78' \ + "expr-test -W \$abs_srcdir/expr-testsuite/test.a -k \"\" -b (pass)" "" at_xfail=no test "pass" = "xfail" && at_xfail=yes -echo "# -*- compilation -*-" >> "$at_group_log" ( - $as_echo "62. EXPRTest.at:78: testing ..." + $as_echo "62. $at_setup_line: testing $at_desc ..." $at_traceon @@ -5374,7 +5159,7 @@ $as_echo "$at_srcdir/EXPRTest.at:78: \$abs_builddir/expr-test -W \$abs_srcdir/expr-testsuite/test.a -k \"\" -b -f \"dummy\" || true" at_fn_check_prepare_dynamic "$abs_builddir/expr-test -W $abs_srcdir/expr-testsuite/test.a -k \"\" -b -f \"dummy\" || true" "EXPRTest.at:78" ( $at_check_trace; $abs_builddir/expr-test -W $abs_srcdir/expr-testsuite/test.a -k "" -b -f "dummy" || true -) >>"$at_stdout" 2>>"$at_stderr" +) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" @@ -5387,7 +5172,7 @@ $as_echo "$at_srcdir/EXPRTest.at:78: diff -b -B \$abs_srcdir/expr-testsuite/test.a.base stdout || diff -b -B \$abs_srcdir/expr-testsuite/test.a.base stderr" at_fn_check_prepare_dynamic "diff -b -B $abs_srcdir/expr-testsuite/test.a.base stdout || diff -b -B $abs_srcdir/expr-testsuite/test.a.base stderr" "EXPRTest.at:78" ( $at_check_trace; diff -b -B $abs_srcdir/expr-testsuite/test.a.base stdout || diff -b -B $abs_srcdir/expr-testsuite/test.a.base stderr -) >>"$at_stdout" 2>>"$at_stderr" +) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: @@ -5399,20 +5184,16 @@ set +x $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 | eval $at_tee_pipe +) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_62 #AT_START_63 -# 63. EXPRTest.at:79: expr-test -w $abs_srcdir/expr-testsuite/test.a -k "&i<2000" -b (pass) -at_setup_line='EXPRTest.at:79' -at_desc="expr-test -w \$abs_srcdir/expr-testsuite/test.a -k \"&i<2000\" -b (pass)" -at_desc_line=" 63: $at_desc" -$at_quiet $as_echo_n "$at_desc_line" +at_fn_group_banner 63 'EXPRTest.at:79' \ + "expr-test -w \$abs_srcdir/expr-testsuite/test.a -k \"&i<2000\" -b (pass)" "" at_xfail=no test "pass" = "xfail" && at_xfail=yes -echo "# -*- compilation -*-" >> "$at_group_log" ( - $as_echo "63. EXPRTest.at:79: testing ..." + $as_echo "63. $at_setup_line: testing $at_desc ..." $at_traceon @@ -5428,7 +5209,7 @@ $as_echo "$at_srcdir/EXPRTest.at:79: \$abs_builddir/expr-test -w \$abs_srcdir/expr-testsuite/test.a -k \"&i<2000\" -b -f \"dummy\" || true" at_fn_check_prepare_dynamic "$abs_builddir/expr-test -w $abs_srcdir/expr-testsuite/test.a -k \"&i<2000\" -b -f \"dummy\" || true" "EXPRTest.at:79" ( $at_check_trace; $abs_builddir/expr-test -w $abs_srcdir/expr-testsuite/test.a -k "&i<2000" -b -f "dummy" || true -) >>"$at_stdout" 2>>"$at_stderr" +) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" @@ -5441,7 +5222,7 @@ $as_echo "$at_srcdir/EXPRTest.at:79: diff -b -B \$abs_srcdir/expr-testsuite/test.aa.base stdout || diff -b -B \$abs_srcdir/expr-testsuite/test.aa.base stderr" at_fn_check_prepare_dynamic "diff -b -B $abs_srcdir/expr-testsuite/test.aa.base stdout || diff -b -B $abs_srcdir/expr-testsuite/test.aa.base stderr" "EXPRTest.at:79" ( $at_check_trace; diff -b -B $abs_srcdir/expr-testsuite/test.aa.base stdout || diff -b -B $abs_srcdir/expr-testsuite/test.aa.base stderr -) >>"$at_stdout" 2>>"$at_stderr" +) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: @@ -5453,20 +5234,16 @@ set +x $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 | eval $at_tee_pipe +) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_63 #AT_START_64 -# 64. EXPRTest.at:79: expr-test -W $abs_srcdir/expr-testsuite/test.a -k "&i<2000" -b (pass) -at_setup_line='EXPRTest.at:79' -at_desc="expr-test -W \$abs_srcdir/expr-testsuite/test.a -k \"&i<2000\" -b (pass)" -at_desc_line=" 64: $at_desc" -$at_quiet $as_echo_n "$at_desc_line" +at_fn_group_banner 64 'EXPRTest.at:79' \ + "expr-test -W \$abs_srcdir/expr-testsuite/test.a -k \"&i<2000\" -b (pass)" "" at_xfail=no test "pass" = "xfail" && at_xfail=yes -echo "# -*- compilation -*-" >> "$at_group_log" ( - $as_echo "64. EXPRTest.at:79: testing ..." + $as_echo "64. $at_setup_line: testing $at_desc ..." $at_traceon @@ -5482,7 +5259,7 @@ $as_echo "$at_srcdir/EXPRTest.at:79: \$abs_builddir/expr-test -W \$abs_srcdir/expr-testsuite/test.a -k \"&i<2000\" -b -f \"dummy\" || true" at_fn_check_prepare_dynamic "$abs_builddir/expr-test -W $abs_srcdir/expr-testsuite/test.a -k \"&i<2000\" -b -f \"dummy\" || true" "EXPRTest.at:79" ( $at_check_trace; $abs_builddir/expr-test -W $abs_srcdir/expr-testsuite/test.a -k "&i<2000" -b -f "dummy" || true -) >>"$at_stdout" 2>>"$at_stderr" +) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" @@ -5495,7 +5272,7 @@ $as_echo "$at_srcdir/EXPRTest.at:79: diff -b -B \$abs_srcdir/expr-testsuite/test.aa.base stdout || diff -b -B \$abs_srcdir/expr-testsuite/test.aa.base stderr" at_fn_check_prepare_dynamic "diff -b -B $abs_srcdir/expr-testsuite/test.aa.base stdout || diff -b -B $abs_srcdir/expr-testsuite/test.aa.base stderr" "EXPRTest.at:79" ( $at_check_trace; diff -b -B $abs_srcdir/expr-testsuite/test.aa.base stdout || diff -b -B $abs_srcdir/expr-testsuite/test.aa.base stderr -) >>"$at_stdout" 2>>"$at_stderr" +) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: @@ -5507,20 +5284,16 @@ set +x $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 | eval $at_tee_pipe +) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_64 #AT_START_65 -# 65. EXPRTest.at:80: expr-test -w $abs_srcdir/expr-testsuite/test.a -k "j&i>2000" -b (pass) -at_setup_line='EXPRTest.at:80' -at_desc="expr-test -w \$abs_srcdir/expr-testsuite/test.a -k \"j&i>2000\" -b (pass)" -at_desc_line=" 65: $at_desc" -$at_quiet $as_echo_n "$at_desc_line" +at_fn_group_banner 65 'EXPRTest.at:80' \ + "expr-test -w \$abs_srcdir/expr-testsuite/test.a -k \"j&i>2000\" -b (pass)" "" at_xfail=no test "pass" = "xfail" && at_xfail=yes -echo "# -*- compilation -*-" >> "$at_group_log" ( - $as_echo "65. EXPRTest.at:80: testing ..." + $as_echo "65. $at_setup_line: testing $at_desc ..." $at_traceon @@ -5536,7 +5309,7 @@ $as_echo "$at_srcdir/EXPRTest.at:80: \$abs_builddir/expr-test -w \$abs_srcdir/expr-testsuite/test.a -k \"j&i>2000\" -b -f \"dummy\" || true" at_fn_check_prepare_dynamic "$abs_builddir/expr-test -w $abs_srcdir/expr-testsuite/test.a -k \"j&i>2000\" -b -f \"dummy\" || true" "EXPRTest.at:80" ( $at_check_trace; $abs_builddir/expr-test -w $abs_srcdir/expr-testsuite/test.a -k "j&i>2000" -b -f "dummy" || true -) >>"$at_stdout" 2>>"$at_stderr" +) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" @@ -5549,7 +5322,7 @@ $as_echo "$at_srcdir/EXPRTest.at:80: diff -b -B \$abs_srcdir/expr-testsuite/test.ab.base stdout || diff -b -B \$abs_srcdir/expr-testsuite/test.ab.base stderr" at_fn_check_prepare_dynamic "diff -b -B $abs_srcdir/expr-testsuite/test.ab.base stdout || diff -b -B $abs_srcdir/expr-testsuite/test.ab.base stderr" "EXPRTest.at:80" ( $at_check_trace; diff -b -B $abs_srcdir/expr-testsuite/test.ab.base stdout || diff -b -B $abs_srcdir/expr-testsuite/test.ab.base stderr -) >>"$at_stdout" 2>>"$at_stderr" +) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: @@ -5561,20 +5334,16 @@ set +x $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 | eval $at_tee_pipe +) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_65 #AT_START_66 -# 66. EXPRTest.at:80: expr-test -W $abs_srcdir/expr-testsuite/test.a -k "j&i>2000" -b (pass) -at_setup_line='EXPRTest.at:80' -at_desc="expr-test -W \$abs_srcdir/expr-testsuite/test.a -k \"j&i>2000\" -b (pass)" -at_desc_line=" 66: $at_desc" -$at_quiet $as_echo_n "$at_desc_line" +at_fn_group_banner 66 'EXPRTest.at:80' \ + "expr-test -W \$abs_srcdir/expr-testsuite/test.a -k \"j&i>2000\" -b (pass)" "" at_xfail=no test "pass" = "xfail" && at_xfail=yes -echo "# -*- compilation -*-" >> "$at_group_log" ( - $as_echo "66. EXPRTest.at:80: testing ..." + $as_echo "66. $at_setup_line: testing $at_desc ..." $at_traceon @@ -5590,7 +5359,7 @@ $as_echo "$at_srcdir/EXPRTest.at:80: \$abs_builddir/expr-test -W \$abs_srcdir/expr-testsuite/test.a -k \"j&i>2000\" -b -f \"dummy\" || true" at_fn_check_prepare_dynamic "$abs_builddir/expr-test -W $abs_srcdir/expr-testsuite/test.a -k \"j&i>2000\" -b -f \"dummy\" || true" "EXPRTest.at:80" ( $at_check_trace; $abs_builddir/expr-test -W $abs_srcdir/expr-testsuite/test.a -k "j&i>2000" -b -f "dummy" || true -) >>"$at_stdout" 2>>"$at_stderr" +) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" @@ -5603,7 +5372,7 @@ $as_echo "$at_srcdir/EXPRTest.at:80: diff -b -B \$abs_srcdir/expr-testsuite/test.ab.base stdout || diff -b -B \$abs_srcdir/expr-testsuite/test.ab.base stderr" at_fn_check_prepare_dynamic "diff -b -B $abs_srcdir/expr-testsuite/test.ab.base stdout || diff -b -B $abs_srcdir/expr-testsuite/test.ab.base stderr" "EXPRTest.at:80" ( $at_check_trace; diff -b -B $abs_srcdir/expr-testsuite/test.ab.base stdout || diff -b -B $abs_srcdir/expr-testsuite/test.ab.base stderr -) >>"$at_stdout" 2>>"$at_stderr" +) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: @@ -5615,20 +5384,16 @@ set +x $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 | eval $at_tee_pipe +) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_66 #AT_START_67 -# 67. EXPRTest.at:81: expr-test -w $abs_srcdir/expr-testsuite/test.a -k "i,j&i<0" -b (pass) -at_setup_line='EXPRTest.at:81' -at_desc="expr-test -w \$abs_srcdir/expr-testsuite/test.a -k \"i,j&i<0\" -b (pass)" -at_desc_line=" 67: $at_desc" -$at_quiet $as_echo_n "$at_desc_line" +at_fn_group_banner 67 'EXPRTest.at:81' \ + "expr-test -w \$abs_srcdir/expr-testsuite/test.a -k \"i,j&i<0\" -b (pass)" "" at_xfail=no test "pass" = "xfail" && at_xfail=yes -echo "# -*- compilation -*-" >> "$at_group_log" ( - $as_echo "67. EXPRTest.at:81: testing ..." + $as_echo "67. $at_setup_line: testing $at_desc ..." $at_traceon @@ -5644,7 +5409,7 @@ $as_echo "$at_srcdir/EXPRTest.at:81: \$abs_builddir/expr-test -w \$abs_srcdir/expr-testsuite/test.a -k \"i,j&i<0\" -b -f \"dummy\" || true" at_fn_check_prepare_dynamic "$abs_builddir/expr-test -w $abs_srcdir/expr-testsuite/test.a -k \"i,j&i<0\" -b -f \"dummy\" || true" "EXPRTest.at:81" ( $at_check_trace; $abs_builddir/expr-test -w $abs_srcdir/expr-testsuite/test.a -k "i,j&i<0" -b -f "dummy" || true -) >>"$at_stdout" 2>>"$at_stderr" +) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" @@ -5657,7 +5422,7 @@ $as_echo "$at_srcdir/EXPRTest.at:81: diff -b -B \$abs_srcdir/expr-testsuite/test.ac.base stdout || diff -b -B \$abs_srcdir/expr-testsuite/test.ac.base stderr" at_fn_check_prepare_dynamic "diff -b -B $abs_srcdir/expr-testsuite/test.ac.base stdout || diff -b -B $abs_srcdir/expr-testsuite/test.ac.base stderr" "EXPRTest.at:81" ( $at_check_trace; diff -b -B $abs_srcdir/expr-testsuite/test.ac.base stdout || diff -b -B $abs_srcdir/expr-testsuite/test.ac.base stderr -) >>"$at_stdout" 2>>"$at_stderr" +) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: @@ -5669,20 +5434,16 @@ set +x $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 | eval $at_tee_pipe +) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_67 #AT_START_68 -# 68. EXPRTest.at:81: expr-test -W $abs_srcdir/expr-testsuite/test.a -k "i,j&i<0" -b (pass) -at_setup_line='EXPRTest.at:81' -at_desc="expr-test -W \$abs_srcdir/expr-testsuite/test.a -k \"i,j&i<0\" -b (pass)" -at_desc_line=" 68: $at_desc" -$at_quiet $as_echo_n "$at_desc_line" +at_fn_group_banner 68 'EXPRTest.at:81' \ + "expr-test -W \$abs_srcdir/expr-testsuite/test.a -k \"i,j&i<0\" -b (pass)" "" at_xfail=no test "pass" = "xfail" && at_xfail=yes -echo "# -*- compilation -*-" >> "$at_group_log" ( - $as_echo "68. EXPRTest.at:81: testing ..." + $as_echo "68. $at_setup_line: testing $at_desc ..." $at_traceon @@ -5698,7 +5459,7 @@ $as_echo "$at_srcdir/EXPRTest.at:81: \$abs_builddir/expr-test -W \$abs_srcdir/expr-testsuite/test.a -k \"i,j&i<0\" -b -f \"dummy\" || true" at_fn_check_prepare_dynamic "$abs_builddir/expr-test -W $abs_srcdir/expr-testsuite/test.a -k \"i,j&i<0\" -b -f \"dummy\" || true" "EXPRTest.at:81" ( $at_check_trace; $abs_builddir/expr-test -W $abs_srcdir/expr-testsuite/test.a -k "i,j&i<0" -b -f "dummy" || true -) >>"$at_stdout" 2>>"$at_stderr" +) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" @@ -5711,7 +5472,7 @@ $as_echo "$at_srcdir/EXPRTest.at:81: diff -b -B \$abs_srcdir/expr-testsuite/test.ac.base stdout || diff -b -B \$abs_srcdir/expr-testsuite/test.ac.base stderr" at_fn_check_prepare_dynamic "diff -b -B $abs_srcdir/expr-testsuite/test.ac.base stdout || diff -b -B $abs_srcdir/expr-testsuite/test.ac.base stderr" "EXPRTest.at:81" ( $at_check_trace; diff -b -B $abs_srcdir/expr-testsuite/test.ac.base stdout || diff -b -B $abs_srcdir/expr-testsuite/test.ac.base stderr -) >>"$at_stdout" 2>>"$at_stderr" +) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: @@ -5723,20 +5484,16 @@ set +x $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 | eval $at_tee_pipe +) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_68 #AT_START_69 -# 69. EXPRTest.at:82: expr-test -w $abs_srcdir/expr-testsuite/test.b -k "" -b (pass) -at_setup_line='EXPRTest.at:82' -at_desc="expr-test -w \$abs_srcdir/expr-testsuite/test.b -k \"\" -b (pass)" -at_desc_line=" 69: $at_desc" -$at_quiet $as_echo_n "$at_desc_line" +at_fn_group_banner 69 'EXPRTest.at:82' \ + "expr-test -w \$abs_srcdir/expr-testsuite/test.b -k \"\" -b (pass)" "" at_xfail=no test "pass" = "xfail" && at_xfail=yes -echo "# -*- compilation -*-" >> "$at_group_log" ( - $as_echo "69. EXPRTest.at:82: testing ..." + $as_echo "69. $at_setup_line: testing $at_desc ..." $at_traceon @@ -5752,7 +5509,7 @@ $as_echo "$at_srcdir/EXPRTest.at:82: \$abs_builddir/expr-test -w \$abs_srcdir/expr-testsuite/test.b -k \"\" -b -f \"dummy\" || true" at_fn_check_prepare_dynamic "$abs_builddir/expr-test -w $abs_srcdir/expr-testsuite/test.b -k \"\" -b -f \"dummy\" || true" "EXPRTest.at:82" ( $at_check_trace; $abs_builddir/expr-test -w $abs_srcdir/expr-testsuite/test.b -k "" -b -f "dummy" || true -) >>"$at_stdout" 2>>"$at_stderr" +) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" @@ -5765,7 +5522,7 @@ $as_echo "$at_srcdir/EXPRTest.at:82: diff -b -B \$abs_srcdir/expr-testsuite/test.b.base stdout || diff -b -B \$abs_srcdir/expr-testsuite/test.b.base stderr" at_fn_check_prepare_dynamic "diff -b -B $abs_srcdir/expr-testsuite/test.b.base stdout || diff -b -B $abs_srcdir/expr-testsuite/test.b.base stderr" "EXPRTest.at:82" ( $at_check_trace; diff -b -B $abs_srcdir/expr-testsuite/test.b.base stdout || diff -b -B $abs_srcdir/expr-testsuite/test.b.base stderr -) >>"$at_stdout" 2>>"$at_stderr" +) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: @@ -5777,20 +5534,16 @@ set +x $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 | eval $at_tee_pipe +) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_69 #AT_START_70 -# 70. EXPRTest.at:82: expr-test -W $abs_srcdir/expr-testsuite/test.b -k "" -b (pass) -at_setup_line='EXPRTest.at:82' -at_desc="expr-test -W \$abs_srcdir/expr-testsuite/test.b -k \"\" -b (pass)" -at_desc_line=" 70: $at_desc" -$at_quiet $as_echo_n "$at_desc_line" +at_fn_group_banner 70 'EXPRTest.at:82' \ + "expr-test -W \$abs_srcdir/expr-testsuite/test.b -k \"\" -b (pass)" "" at_xfail=no test "pass" = "xfail" && at_xfail=yes -echo "# -*- compilation -*-" >> "$at_group_log" ( - $as_echo "70. EXPRTest.at:82: testing ..." + $as_echo "70. $at_setup_line: testing $at_desc ..." $at_traceon @@ -5806,7 +5559,7 @@ $as_echo "$at_srcdir/EXPRTest.at:82: \$abs_builddir/expr-test -W \$abs_srcdir/expr-testsuite/test.b -k \"\" -b -f \"dummy\" || true" at_fn_check_prepare_dynamic "$abs_builddir/expr-test -W $abs_srcdir/expr-testsuite/test.b -k \"\" -b -f \"dummy\" || true" "EXPRTest.at:82" ( $at_check_trace; $abs_builddir/expr-test -W $abs_srcdir/expr-testsuite/test.b -k "" -b -f "dummy" || true -) >>"$at_stdout" 2>>"$at_stderr" +) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" @@ -5819,7 +5572,7 @@ $as_echo "$at_srcdir/EXPRTest.at:82: diff -b -B \$abs_srcdir/expr-testsuite/test.b.base stdout || diff -b -B \$abs_srcdir/expr-testsuite/test.b.base stderr" at_fn_check_prepare_dynamic "diff -b -B $abs_srcdir/expr-testsuite/test.b.base stdout || diff -b -B $abs_srcdir/expr-testsuite/test.b.base stderr" "EXPRTest.at:82" ( $at_check_trace; diff -b -B $abs_srcdir/expr-testsuite/test.b.base stdout || diff -b -B $abs_srcdir/expr-testsuite/test.b.base stderr -) >>"$at_stdout" 2>>"$at_stderr" +) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: @@ -5831,20 +5584,16 @@ set +x $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 | eval $at_tee_pipe +) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_70 #AT_START_71 -# 71. EXPRTest.at:83: expr-test -w $abs_srcdir/expr-testsuite/test.b -k "i,f" -b (pass) -at_setup_line='EXPRTest.at:83' -at_desc="expr-test -w \$abs_srcdir/expr-testsuite/test.b -k \"i,f\" -b (pass)" -at_desc_line=" 71: $at_desc" -$at_quiet $as_echo_n "$at_desc_line" +at_fn_group_banner 71 'EXPRTest.at:83' \ + "expr-test -w \$abs_srcdir/expr-testsuite/test.b -k \"i,f\" -b (pass)" "" at_xfail=no test "pass" = "xfail" && at_xfail=yes -echo "# -*- compilation -*-" >> "$at_group_log" ( - $as_echo "71. EXPRTest.at:83: testing ..." + $as_echo "71. $at_setup_line: testing $at_desc ..." $at_traceon @@ -5860,7 +5609,7 @@ $as_echo "$at_srcdir/EXPRTest.at:83: \$abs_builddir/expr-test -w \$abs_srcdir/expr-testsuite/test.b -k \"i,f\" -b -f \"dummy\" || true" at_fn_check_prepare_dynamic "$abs_builddir/expr-test -w $abs_srcdir/expr-testsuite/test.b -k \"i,f\" -b -f \"dummy\" || true" "EXPRTest.at:83" ( $at_check_trace; $abs_builddir/expr-test -w $abs_srcdir/expr-testsuite/test.b -k "i,f" -b -f "dummy" || true -) >>"$at_stdout" 2>>"$at_stderr" +) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" @@ -5873,7 +5622,7 @@ $as_echo "$at_srcdir/EXPRTest.at:83: diff -b -B \$abs_srcdir/expr-testsuite/test.ba.base stdout || diff -b -B \$abs_srcdir/expr-testsuite/test.ba.base stderr" at_fn_check_prepare_dynamic "diff -b -B $abs_srcdir/expr-testsuite/test.ba.base stdout || diff -b -B $abs_srcdir/expr-testsuite/test.ba.base stderr" "EXPRTest.at:83" ( $at_check_trace; diff -b -B $abs_srcdir/expr-testsuite/test.ba.base stdout || diff -b -B $abs_srcdir/expr-testsuite/test.ba.base stderr -) >>"$at_stdout" 2>>"$at_stderr" +) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: @@ -5885,20 +5634,16 @@ set +x $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 | eval $at_tee_pipe +) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_71 #AT_START_72 -# 72. EXPRTest.at:83: expr-test -W $abs_srcdir/expr-testsuite/test.b -k "i,f" -b (pass) -at_setup_line='EXPRTest.at:83' -at_desc="expr-test -W \$abs_srcdir/expr-testsuite/test.b -k \"i,f\" -b (pass)" -at_desc_line=" 72: $at_desc" -$at_quiet $as_echo_n "$at_desc_line" +at_fn_group_banner 72 'EXPRTest.at:83' \ + "expr-test -W \$abs_srcdir/expr-testsuite/test.b -k \"i,f\" -b (pass)" "" at_xfail=no test "pass" = "xfail" && at_xfail=yes -echo "# -*- compilation -*-" >> "$at_group_log" ( - $as_echo "72. EXPRTest.at:83: testing ..." + $as_echo "72. $at_setup_line: testing $at_desc ..." $at_traceon @@ -5914,7 +5659,7 @@ $as_echo "$at_srcdir/EXPRTest.at:83: \$abs_builddir/expr-test -W \$abs_srcdir/expr-testsuite/test.b -k \"i,f\" -b -f \"dummy\" || true" at_fn_check_prepare_dynamic "$abs_builddir/expr-test -W $abs_srcdir/expr-testsuite/test.b -k \"i,f\" -b -f \"dummy\" || true" "EXPRTest.at:83" ( $at_check_trace; $abs_builddir/expr-test -W $abs_srcdir/expr-testsuite/test.b -k "i,f" -b -f "dummy" || true -) >>"$at_stdout" 2>>"$at_stderr" +) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" @@ -5927,7 +5672,7 @@ $as_echo "$at_srcdir/EXPRTest.at:83: diff -b -B \$abs_srcdir/expr-testsuite/test.ba.base stdout || diff -b -B \$abs_srcdir/expr-testsuite/test.ba.base stderr" at_fn_check_prepare_dynamic "diff -b -B $abs_srcdir/expr-testsuite/test.ba.base stdout || diff -b -B $abs_srcdir/expr-testsuite/test.ba.base stderr" "EXPRTest.at:83" ( $at_check_trace; diff -b -B $abs_srcdir/expr-testsuite/test.ba.base stdout || diff -b -B $abs_srcdir/expr-testsuite/test.ba.base stderr -) >>"$at_stdout" 2>>"$at_stderr" +) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: @@ -5939,20 +5684,16 @@ set +x $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 | eval $at_tee_pipe +) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_72 #AT_START_73 -# 73. EXPRTest.at:84: expr-test -w $abs_srcdir/expr-testsuite/test.b -k "i,f&i<2000" -b (pass) -at_setup_line='EXPRTest.at:84' -at_desc="expr-test -w \$abs_srcdir/expr-testsuite/test.b -k \"i,f&i<2000\" -b (pass)" -at_desc_line=" 73: $at_desc" -$at_quiet $as_echo_n "$at_desc_line" +at_fn_group_banner 73 'EXPRTest.at:84' \ + "expr-test -w \$abs_srcdir/expr-testsuite/test.b -k \"i,f&i<2000\" -b (pass)" "" at_xfail=no test "pass" = "xfail" && at_xfail=yes -echo "# -*- compilation -*-" >> "$at_group_log" ( - $as_echo "73. EXPRTest.at:84: testing ..." + $as_echo "73. $at_setup_line: testing $at_desc ..." $at_traceon @@ -5968,7 +5709,7 @@ $as_echo "$at_srcdir/EXPRTest.at:84: \$abs_builddir/expr-test -w \$abs_srcdir/expr-testsuite/test.b -k \"i,f&i<2000\" -b -f \"dummy\" || true" at_fn_check_prepare_dynamic "$abs_builddir/expr-test -w $abs_srcdir/expr-testsuite/test.b -k \"i,f&i<2000\" -b -f \"dummy\" || true" "EXPRTest.at:84" ( $at_check_trace; $abs_builddir/expr-test -w $abs_srcdir/expr-testsuite/test.b -k "i,f&i<2000" -b -f "dummy" || true -) >>"$at_stdout" 2>>"$at_stderr" +) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" @@ -5981,7 +5722,7 @@ $as_echo "$at_srcdir/EXPRTest.at:84: diff -b -B \$abs_srcdir/expr-testsuite/test.bb.base stdout || diff -b -B \$abs_srcdir/expr-testsuite/test.bb.base stderr" at_fn_check_prepare_dynamic "diff -b -B $abs_srcdir/expr-testsuite/test.bb.base stdout || diff -b -B $abs_srcdir/expr-testsuite/test.bb.base stderr" "EXPRTest.at:84" ( $at_check_trace; diff -b -B $abs_srcdir/expr-testsuite/test.bb.base stdout || diff -b -B $abs_srcdir/expr-testsuite/test.bb.base stderr -) >>"$at_stdout" 2>>"$at_stderr" +) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: @@ -5993,20 +5734,16 @@ set +x $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 | eval $at_tee_pipe +) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_73 #AT_START_74 -# 74. EXPRTest.at:84: expr-test -W $abs_srcdir/expr-testsuite/test.b -k "i,f&i<2000" -b (pass) -at_setup_line='EXPRTest.at:84' -at_desc="expr-test -W \$abs_srcdir/expr-testsuite/test.b -k \"i,f&i<2000\" -b (pass)" -at_desc_line=" 74: $at_desc" -$at_quiet $as_echo_n "$at_desc_line" +at_fn_group_banner 74 'EXPRTest.at:84' \ + "expr-test -W \$abs_srcdir/expr-testsuite/test.b -k \"i,f&i<2000\" -b (pass)" "" at_xfail=no test "pass" = "xfail" && at_xfail=yes -echo "# -*- compilation -*-" >> "$at_group_log" ( - $as_echo "74. EXPRTest.at:84: testing ..." + $as_echo "74. $at_setup_line: testing $at_desc ..." $at_traceon @@ -6022,7 +5759,7 @@ $as_echo "$at_srcdir/EXPRTest.at:84: \$abs_builddir/expr-test -W \$abs_srcdir/expr-testsuite/test.b -k \"i,f&i<2000\" -b -f \"dummy\" || true" at_fn_check_prepare_dynamic "$abs_builddir/expr-test -W $abs_srcdir/expr-testsuite/test.b -k \"i,f&i<2000\" -b -f \"dummy\" || true" "EXPRTest.at:84" ( $at_check_trace; $abs_builddir/expr-test -W $abs_srcdir/expr-testsuite/test.b -k "i,f&i<2000" -b -f "dummy" || true -) >>"$at_stdout" 2>>"$at_stderr" +) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" @@ -6035,7 +5772,7 @@ $as_echo "$at_srcdir/EXPRTest.at:84: diff -b -B \$abs_srcdir/expr-testsuite/test.bb.base stdout || diff -b -B \$abs_srcdir/expr-testsuite/test.bb.base stderr" at_fn_check_prepare_dynamic "diff -b -B $abs_srcdir/expr-testsuite/test.bb.base stdout || diff -b -B $abs_srcdir/expr-testsuite/test.bb.base stderr" "EXPRTest.at:84" ( $at_check_trace; diff -b -B $abs_srcdir/expr-testsuite/test.bb.base stdout || diff -b -B $abs_srcdir/expr-testsuite/test.bb.base stderr -) >>"$at_stdout" 2>>"$at_stderr" +) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: @@ -6047,20 +5784,16 @@ set +x $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 | eval $at_tee_pipe +) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_74 #AT_START_75 -# 75. EXPRTest.at:85: expr-test -w $abs_srcdir/expr-testsuite/test.b -k "i,f&f<0" -b (pass) -at_setup_line='EXPRTest.at:85' -at_desc="expr-test -w \$abs_srcdir/expr-testsuite/test.b -k \"i,f&f<0\" -b (pass)" -at_desc_line=" 75: $at_desc" -$at_quiet $as_echo_n "$at_desc_line" +at_fn_group_banner 75 'EXPRTest.at:85' \ + "expr-test -w \$abs_srcdir/expr-testsuite/test.b -k \"i,f&f<0\" -b (pass)" "" at_xfail=no test "pass" = "xfail" && at_xfail=yes -echo "# -*- compilation -*-" >> "$at_group_log" ( - $as_echo "75. EXPRTest.at:85: testing ..." + $as_echo "75. $at_setup_line: testing $at_desc ..." $at_traceon @@ -6076,7 +5809,7 @@ $as_echo "$at_srcdir/EXPRTest.at:85: \$abs_builddir/expr-test -w \$abs_srcdir/expr-testsuite/test.b -k \"i,f&f<0\" -b -f \"dummy\" || true" at_fn_check_prepare_dynamic "$abs_builddir/expr-test -w $abs_srcdir/expr-testsuite/test.b -k \"i,f&f<0\" -b -f \"dummy\" || true" "EXPRTest.at:85" ( $at_check_trace; $abs_builddir/expr-test -w $abs_srcdir/expr-testsuite/test.b -k "i,f&f<0" -b -f "dummy" || true -) >>"$at_stdout" 2>>"$at_stderr" +) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" @@ -6089,7 +5822,7 @@ $as_echo "$at_srcdir/EXPRTest.at:85: diff -b -B \$abs_srcdir/expr-testsuite/test.bc.base stdout || diff -b -B \$abs_srcdir/expr-testsuite/test.bc.base stderr" at_fn_check_prepare_dynamic "diff -b -B $abs_srcdir/expr-testsuite/test.bc.base stdout || diff -b -B $abs_srcdir/expr-testsuite/test.bc.base stderr" "EXPRTest.at:85" ( $at_check_trace; diff -b -B $abs_srcdir/expr-testsuite/test.bc.base stdout || diff -b -B $abs_srcdir/expr-testsuite/test.bc.base stderr -) >>"$at_stdout" 2>>"$at_stderr" +) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: @@ -6101,20 +5834,16 @@ set +x $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 | eval $at_tee_pipe +) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_75 #AT_START_76 -# 76. EXPRTest.at:85: expr-test -W $abs_srcdir/expr-testsuite/test.b -k "i,f&f<0" -b (pass) -at_setup_line='EXPRTest.at:85' -at_desc="expr-test -W \$abs_srcdir/expr-testsuite/test.b -k \"i,f&f<0\" -b (pass)" -at_desc_line=" 76: $at_desc" -$at_quiet $as_echo_n "$at_desc_line" +at_fn_group_banner 76 'EXPRTest.at:85' \ + "expr-test -W \$abs_srcdir/expr-testsuite/test.b -k \"i,f&f<0\" -b (pass)" "" at_xfail=no test "pass" = "xfail" && at_xfail=yes -echo "# -*- compilation -*-" >> "$at_group_log" ( - $as_echo "76. EXPRTest.at:85: testing ..." + $as_echo "76. $at_setup_line: testing $at_desc ..." $at_traceon @@ -6130,7 +5859,7 @@ $as_echo "$at_srcdir/EXPRTest.at:85: \$abs_builddir/expr-test -W \$abs_srcdir/expr-testsuite/test.b -k \"i,f&f<0\" -b -f \"dummy\" || true" at_fn_check_prepare_dynamic "$abs_builddir/expr-test -W $abs_srcdir/expr-testsuite/test.b -k \"i,f&f<0\" -b -f \"dummy\" || true" "EXPRTest.at:85" ( $at_check_trace; $abs_builddir/expr-test -W $abs_srcdir/expr-testsuite/test.b -k "i,f&f<0" -b -f "dummy" || true -) >>"$at_stdout" 2>>"$at_stderr" +) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" @@ -6143,7 +5872,7 @@ $as_echo "$at_srcdir/EXPRTest.at:85: diff -b -B \$abs_srcdir/expr-testsuite/test.bc.base stdout || diff -b -B \$abs_srcdir/expr-testsuite/test.bc.base stderr" at_fn_check_prepare_dynamic "diff -b -B $abs_srcdir/expr-testsuite/test.bc.base stdout || diff -b -B $abs_srcdir/expr-testsuite/test.bc.base stderr" "EXPRTest.at:85" ( $at_check_trace; diff -b -B $abs_srcdir/expr-testsuite/test.bc.base stdout || diff -b -B $abs_srcdir/expr-testsuite/test.bc.base stderr -) >>"$at_stdout" 2>>"$at_stderr" +) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: @@ -6155,20 +5884,16 @@ set +x $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 | eval $at_tee_pipe +) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_76 #AT_START_77 -# 77. EXPRTest.at:86: expr-test -w $abs_srcdir/expr-testsuite/test.b -k "i,j&i<2000" -b (pass) -at_setup_line='EXPRTest.at:86' -at_desc="expr-test -w \$abs_srcdir/expr-testsuite/test.b -k \"i,j&i<2000\" -b (pass)" -at_desc_line=" 77: $at_desc" -$at_quiet $as_echo_n "$at_desc_line" +at_fn_group_banner 77 'EXPRTest.at:86' \ + "expr-test -w \$abs_srcdir/expr-testsuite/test.b -k \"i,j&i<2000\" -b (pass)" "" at_xfail=no test "pass" = "xfail" && at_xfail=yes -echo "# -*- compilation -*-" >> "$at_group_log" ( - $as_echo "77. EXPRTest.at:86: testing ..." + $as_echo "77. $at_setup_line: testing $at_desc ..." $at_traceon @@ -6184,7 +5909,7 @@ $as_echo "$at_srcdir/EXPRTest.at:86: \$abs_builddir/expr-test -w \$abs_srcdir/expr-testsuite/test.b -k \"i,j&i<2000\" -b -f \"dummy\" || true" at_fn_check_prepare_dynamic "$abs_builddir/expr-test -w $abs_srcdir/expr-testsuite/test.b -k \"i,j&i<2000\" -b -f \"dummy\" || true" "EXPRTest.at:86" ( $at_check_trace; $abs_builddir/expr-test -w $abs_srcdir/expr-testsuite/test.b -k "i,j&i<2000" -b -f "dummy" || true -) >>"$at_stdout" 2>>"$at_stderr" +) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" @@ -6197,7 +5922,7 @@ $as_echo "$at_srcdir/EXPRTest.at:86: diff -b -B \$abs_srcdir/expr-testsuite/test.bd.base stdout || diff -b -B \$abs_srcdir/expr-testsuite/test.bd.base stderr" at_fn_check_prepare_dynamic "diff -b -B $abs_srcdir/expr-testsuite/test.bd.base stdout || diff -b -B $abs_srcdir/expr-testsuite/test.bd.base stderr" "EXPRTest.at:86" ( $at_check_trace; diff -b -B $abs_srcdir/expr-testsuite/test.bd.base stdout || diff -b -B $abs_srcdir/expr-testsuite/test.bd.base stderr -) >>"$at_stdout" 2>>"$at_stderr" +) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: @@ -6209,20 +5934,16 @@ set +x $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 | eval $at_tee_pipe +) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_77 #AT_START_78 -# 78. EXPRTest.at:86: expr-test -W $abs_srcdir/expr-testsuite/test.b -k "i,j&i<2000" -b (pass) -at_setup_line='EXPRTest.at:86' -at_desc="expr-test -W \$abs_srcdir/expr-testsuite/test.b -k \"i,j&i<2000\" -b (pass)" -at_desc_line=" 78: $at_desc" -$at_quiet $as_echo_n "$at_desc_line" +at_fn_group_banner 78 'EXPRTest.at:86' \ + "expr-test -W \$abs_srcdir/expr-testsuite/test.b -k \"i,j&i<2000\" -b (pass)" "" at_xfail=no test "pass" = "xfail" && at_xfail=yes -echo "# -*- compilation -*-" >> "$at_group_log" ( - $as_echo "78. EXPRTest.at:86: testing ..." + $as_echo "78. $at_setup_line: testing $at_desc ..." $at_traceon @@ -6238,7 +5959,7 @@ $as_echo "$at_srcdir/EXPRTest.at:86: \$abs_builddir/expr-test -W \$abs_srcdir/expr-testsuite/test.b -k \"i,j&i<2000\" -b -f \"dummy\" || true" at_fn_check_prepare_dynamic "$abs_builddir/expr-test -W $abs_srcdir/expr-testsuite/test.b -k \"i,j&i<2000\" -b -f \"dummy\" || true" "EXPRTest.at:86" ( $at_check_trace; $abs_builddir/expr-test -W $abs_srcdir/expr-testsuite/test.b -k "i,j&i<2000" -b -f "dummy" || true -) >>"$at_stdout" 2>>"$at_stderr" +) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" @@ -6251,7 +5972,7 @@ $as_echo "$at_srcdir/EXPRTest.at:86: diff -b -B \$abs_srcdir/expr-testsuite/test.bd.base stdout || diff -b -B \$abs_srcdir/expr-testsuite/test.bd.base stderr" at_fn_check_prepare_dynamic "diff -b -B $abs_srcdir/expr-testsuite/test.bd.base stdout || diff -b -B $abs_srcdir/expr-testsuite/test.bd.base stderr" "EXPRTest.at:86" ( $at_check_trace; diff -b -B $abs_srcdir/expr-testsuite/test.bd.base stdout || diff -b -B $abs_srcdir/expr-testsuite/test.bd.base stderr -) >>"$at_stdout" 2>>"$at_stderr" +) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: @@ -6263,20 +5984,16 @@ set +x $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 | eval $at_tee_pipe +) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_78 #AT_START_79 -# 79. EXPRTest.at:87: expr-test -w $abs_srcdir/expr-testsuite/test.b -k "&i<0" -b (pass) -at_setup_line='EXPRTest.at:87' -at_desc="expr-test -w \$abs_srcdir/expr-testsuite/test.b -k \"&i<0\" -b (pass)" -at_desc_line=" 79: $at_desc" -$at_quiet $as_echo_n "$at_desc_line" +at_fn_group_banner 79 'EXPRTest.at:87' \ + "expr-test -w \$abs_srcdir/expr-testsuite/test.b -k \"&i<0\" -b (pass)" "" at_xfail=no test "pass" = "xfail" && at_xfail=yes -echo "# -*- compilation -*-" >> "$at_group_log" ( - $as_echo "79. EXPRTest.at:87: testing ..." + $as_echo "79. $at_setup_line: testing $at_desc ..." $at_traceon @@ -6292,7 +6009,7 @@ $as_echo "$at_srcdir/EXPRTest.at:87: \$abs_builddir/expr-test -w \$abs_srcdir/expr-testsuite/test.b -k \"&i<0\" -b -f \"dummy\" || true" at_fn_check_prepare_dynamic "$abs_builddir/expr-test -w $abs_srcdir/expr-testsuite/test.b -k \"&i<0\" -b -f \"dummy\" || true" "EXPRTest.at:87" ( $at_check_trace; $abs_builddir/expr-test -w $abs_srcdir/expr-testsuite/test.b -k "&i<0" -b -f "dummy" || true -) >>"$at_stdout" 2>>"$at_stderr" +) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" @@ -6305,7 +6022,7 @@ $as_echo "$at_srcdir/EXPRTest.at:87: diff -b -B \$abs_srcdir/expr-testsuite/test.be.base stdout || diff -b -B \$abs_srcdir/expr-testsuite/test.be.base stderr" at_fn_check_prepare_dynamic "diff -b -B $abs_srcdir/expr-testsuite/test.be.base stdout || diff -b -B $abs_srcdir/expr-testsuite/test.be.base stderr" "EXPRTest.at:87" ( $at_check_trace; diff -b -B $abs_srcdir/expr-testsuite/test.be.base stdout || diff -b -B $abs_srcdir/expr-testsuite/test.be.base stderr -) >>"$at_stdout" 2>>"$at_stderr" +) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: @@ -6317,20 +6034,16 @@ set +x $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 | eval $at_tee_pipe +) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_79 #AT_START_80 -# 80. EXPRTest.at:87: expr-test -W $abs_srcdir/expr-testsuite/test.b -k "&i<0" -b (pass) -at_setup_line='EXPRTest.at:87' -at_desc="expr-test -W \$abs_srcdir/expr-testsuite/test.b -k \"&i<0\" -b (pass)" -at_desc_line=" 80: $at_desc" -$at_quiet $as_echo_n "$at_desc_line" +at_fn_group_banner 80 'EXPRTest.at:87' \ + "expr-test -W \$abs_srcdir/expr-testsuite/test.b -k \"&i<0\" -b (pass)" "" at_xfail=no test "pass" = "xfail" && at_xfail=yes -echo "# -*- compilation -*-" >> "$at_group_log" ( - $as_echo "80. EXPRTest.at:87: testing ..." + $as_echo "80. $at_setup_line: testing $at_desc ..." $at_traceon @@ -6346,7 +6059,7 @@ $as_echo "$at_srcdir/EXPRTest.at:87: \$abs_builddir/expr-test -W \$abs_srcdir/expr-testsuite/test.b -k \"&i<0\" -b -f \"dummy\" || true" at_fn_check_prepare_dynamic "$abs_builddir/expr-test -W $abs_srcdir/expr-testsuite/test.b -k \"&i<0\" -b -f \"dummy\" || true" "EXPRTest.at:87" ( $at_check_trace; $abs_builddir/expr-test -W $abs_srcdir/expr-testsuite/test.b -k "&i<0" -b -f "dummy" || true -) >>"$at_stdout" 2>>"$at_stderr" +) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" @@ -6359,7 +6072,7 @@ $as_echo "$at_srcdir/EXPRTest.at:87: diff -b -B \$abs_srcdir/expr-testsuite/test.be.base stdout || diff -b -B \$abs_srcdir/expr-testsuite/test.be.base stderr" at_fn_check_prepare_dynamic "diff -b -B $abs_srcdir/expr-testsuite/test.be.base stdout || diff -b -B $abs_srcdir/expr-testsuite/test.be.base stderr" "EXPRTest.at:87" ( $at_check_trace; diff -b -B $abs_srcdir/expr-testsuite/test.be.base stdout || diff -b -B $abs_srcdir/expr-testsuite/test.be.base stderr -) >>"$at_stdout" 2>>"$at_stderr" +) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: @@ -6371,20 +6084,16 @@ set +x $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 | eval $at_tee_pipe +) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_80 #AT_START_81 -# 81. EXPRTest.at:88: expr-test -w $abs_srcdir/expr-testsuite/test.d -k "" -b (pass) -at_setup_line='EXPRTest.at:88' -at_desc="expr-test -w \$abs_srcdir/expr-testsuite/test.d -k \"\" -b (pass)" -at_desc_line=" 81: $at_desc" -$at_quiet $as_echo_n "$at_desc_line" +at_fn_group_banner 81 'EXPRTest.at:88' \ + "expr-test -w \$abs_srcdir/expr-testsuite/test.d -k \"\" -b (pass)" "" at_xfail=no test "pass" = "xfail" && at_xfail=yes -echo "# -*- compilation -*-" >> "$at_group_log" ( - $as_echo "81. EXPRTest.at:88: testing ..." + $as_echo "81. $at_setup_line: testing $at_desc ..." $at_traceon @@ -6400,7 +6109,7 @@ $as_echo "$at_srcdir/EXPRTest.at:88: \$abs_builddir/expr-test -w \$abs_srcdir/expr-testsuite/test.d -k \"\" -b -f \"dummy\" || true" at_fn_check_prepare_dynamic "$abs_builddir/expr-test -w $abs_srcdir/expr-testsuite/test.d -k \"\" -b -f \"dummy\" || true" "EXPRTest.at:88" ( $at_check_trace; $abs_builddir/expr-test -w $abs_srcdir/expr-testsuite/test.d -k "" -b -f "dummy" || true -) >>"$at_stdout" 2>>"$at_stderr" +) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" @@ -6413,7 +6122,7 @@ $as_echo "$at_srcdir/EXPRTest.at:88: diff -b -B \$abs_srcdir/expr-testsuite/test.d.base stdout || diff -b -B \$abs_srcdir/expr-testsuite/test.d.base stderr" at_fn_check_prepare_dynamic "diff -b -B $abs_srcdir/expr-testsuite/test.d.base stdout || diff -b -B $abs_srcdir/expr-testsuite/test.d.base stderr" "EXPRTest.at:88" ( $at_check_trace; diff -b -B $abs_srcdir/expr-testsuite/test.d.base stdout || diff -b -B $abs_srcdir/expr-testsuite/test.d.base stderr -) >>"$at_stdout" 2>>"$at_stderr" +) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: @@ -6425,20 +6134,16 @@ set +x $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 | eval $at_tee_pipe +) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_81 #AT_START_82 -# 82. EXPRTest.at:88: expr-test -W $abs_srcdir/expr-testsuite/test.d -k "" -b (pass) -at_setup_line='EXPRTest.at:88' -at_desc="expr-test -W \$abs_srcdir/expr-testsuite/test.d -k \"\" -b (pass)" -at_desc_line=" 82: $at_desc" -$at_quiet $as_echo_n "$at_desc_line" +at_fn_group_banner 82 'EXPRTest.at:88' \ + "expr-test -W \$abs_srcdir/expr-testsuite/test.d -k \"\" -b (pass)" "" at_xfail=no test "pass" = "xfail" && at_xfail=yes -echo "# -*- compilation -*-" >> "$at_group_log" ( - $as_echo "82. EXPRTest.at:88: testing ..." + $as_echo "82. $at_setup_line: testing $at_desc ..." $at_traceon @@ -6454,7 +6159,7 @@ $as_echo "$at_srcdir/EXPRTest.at:88: \$abs_builddir/expr-test -W \$abs_srcdir/expr-testsuite/test.d -k \"\" -b -f \"dummy\" || true" at_fn_check_prepare_dynamic "$abs_builddir/expr-test -W $abs_srcdir/expr-testsuite/test.d -k \"\" -b -f \"dummy\" || true" "EXPRTest.at:88" ( $at_check_trace; $abs_builddir/expr-test -W $abs_srcdir/expr-testsuite/test.d -k "" -b -f "dummy" || true -) >>"$at_stdout" 2>>"$at_stderr" +) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" @@ -6467,7 +6172,7 @@ $as_echo "$at_srcdir/EXPRTest.at:88: diff -b -B \$abs_srcdir/expr-testsuite/test.d.base stdout || diff -b -B \$abs_srcdir/expr-testsuite/test.d.base stderr" at_fn_check_prepare_dynamic "diff -b -B $abs_srcdir/expr-testsuite/test.d.base stdout || diff -b -B $abs_srcdir/expr-testsuite/test.d.base stderr" "EXPRTest.at:88" ( $at_check_trace; diff -b -B $abs_srcdir/expr-testsuite/test.d.base stdout || diff -b -B $abs_srcdir/expr-testsuite/test.d.base stderr -) >>"$at_stdout" 2>>"$at_stderr" +) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: @@ -6479,20 +6184,16 @@ set +x $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 | eval $at_tee_pipe +) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_82 #AT_START_83 -# 83. EXPRTest.at:89: expr-test -w $abs_srcdir/expr-testsuite/test.d -k "i,f,a" -b (pass) -at_setup_line='EXPRTest.at:89' -at_desc="expr-test -w \$abs_srcdir/expr-testsuite/test.d -k \"i,f,a\" -b (pass)" -at_desc_line=" 83: $at_desc" -$at_quiet $as_echo_n "$at_desc_line" +at_fn_group_banner 83 'EXPRTest.at:89' \ + "expr-test -w \$abs_srcdir/expr-testsuite/test.d -k \"i,f,a\" -b (pass)" "" at_xfail=no test "pass" = "xfail" && at_xfail=yes -echo "# -*- compilation -*-" >> "$at_group_log" ( - $as_echo "83. EXPRTest.at:89: testing ..." + $as_echo "83. $at_setup_line: testing $at_desc ..." $at_traceon @@ -6508,7 +6209,7 @@ $as_echo "$at_srcdir/EXPRTest.at:89: \$abs_builddir/expr-test -w \$abs_srcdir/expr-testsuite/test.d -k \"i,f,a\" -b -f \"dummy\" || true" at_fn_check_prepare_dynamic "$abs_builddir/expr-test -w $abs_srcdir/expr-testsuite/test.d -k \"i,f,a\" -b -f \"dummy\" || true" "EXPRTest.at:89" ( $at_check_trace; $abs_builddir/expr-test -w $abs_srcdir/expr-testsuite/test.d -k "i,f,a" -b -f "dummy" || true -) >>"$at_stdout" 2>>"$at_stderr" +) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" @@ -6521,7 +6222,7 @@ $as_echo "$at_srcdir/EXPRTest.at:89: diff -b -B \$abs_srcdir/expr-testsuite/test.da.base stdout || diff -b -B \$abs_srcdir/expr-testsuite/test.da.base stderr" at_fn_check_prepare_dynamic "diff -b -B $abs_srcdir/expr-testsuite/test.da.base stdout || diff -b -B $abs_srcdir/expr-testsuite/test.da.base stderr" "EXPRTest.at:89" ( $at_check_trace; diff -b -B $abs_srcdir/expr-testsuite/test.da.base stdout || diff -b -B $abs_srcdir/expr-testsuite/test.da.base stderr -) >>"$at_stdout" 2>>"$at_stderr" +) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: @@ -6533,20 +6234,16 @@ set +x $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 | eval $at_tee_pipe +) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_83 #AT_START_84 -# 84. EXPRTest.at:89: expr-test -W $abs_srcdir/expr-testsuite/test.d -k "i,f,a" -b (pass) -at_setup_line='EXPRTest.at:89' -at_desc="expr-test -W \$abs_srcdir/expr-testsuite/test.d -k \"i,f,a\" -b (pass)" -at_desc_line=" 84: $at_desc" -$at_quiet $as_echo_n "$at_desc_line" +at_fn_group_banner 84 'EXPRTest.at:89' \ + "expr-test -W \$abs_srcdir/expr-testsuite/test.d -k \"i,f,a\" -b (pass)" "" at_xfail=no test "pass" = "xfail" && at_xfail=yes -echo "# -*- compilation -*-" >> "$at_group_log" ( - $as_echo "84. EXPRTest.at:89: testing ..." + $as_echo "84. $at_setup_line: testing $at_desc ..." $at_traceon @@ -6562,7 +6259,7 @@ $as_echo "$at_srcdir/EXPRTest.at:89: \$abs_builddir/expr-test -W \$abs_srcdir/expr-testsuite/test.d -k \"i,f,a\" -b -f \"dummy\" || true" at_fn_check_prepare_dynamic "$abs_builddir/expr-test -W $abs_srcdir/expr-testsuite/test.d -k \"i,f,a\" -b -f \"dummy\" || true" "EXPRTest.at:89" ( $at_check_trace; $abs_builddir/expr-test -W $abs_srcdir/expr-testsuite/test.d -k "i,f,a" -b -f "dummy" || true -) >>"$at_stdout" 2>>"$at_stderr" +) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" @@ -6575,7 +6272,7 @@ $as_echo "$at_srcdir/EXPRTest.at:89: diff -b -B \$abs_srcdir/expr-testsuite/test.da.base stdout || diff -b -B \$abs_srcdir/expr-testsuite/test.da.base stderr" at_fn_check_prepare_dynamic "diff -b -B $abs_srcdir/expr-testsuite/test.da.base stdout || diff -b -B $abs_srcdir/expr-testsuite/test.da.base stderr" "EXPRTest.at:89" ( $at_check_trace; diff -b -B $abs_srcdir/expr-testsuite/test.da.base stdout || diff -b -B $abs_srcdir/expr-testsuite/test.da.base stderr -) >>"$at_stdout" 2>>"$at_stderr" +) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: @@ -6587,20 +6284,16 @@ set +x $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 | eval $at_tee_pipe +) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_84 #AT_START_85 -# 85. EXPRTest.at:90: expr-test -w $abs_srcdir/expr-testsuite/test.d -k "i,f,a&i<2000" -b (pass) -at_setup_line='EXPRTest.at:90' -at_desc="expr-test -w \$abs_srcdir/expr-testsuite/test.d -k \"i,f,a&i<2000\" -b (pass)" -at_desc_line=" 85: $at_desc" -$at_quiet $as_echo_n "$at_desc_line" +at_fn_group_banner 85 'EXPRTest.at:90' \ + "expr-test -w \$abs_srcdir/expr-testsuite/test.d -k \"i,f,a&i<2000\" -b (pass)" "" at_xfail=no test "pass" = "xfail" && at_xfail=yes -echo "# -*- compilation -*-" >> "$at_group_log" ( - $as_echo "85. EXPRTest.at:90: testing ..." + $as_echo "85. $at_setup_line: testing $at_desc ..." $at_traceon @@ -6616,7 +6309,7 @@ $as_echo "$at_srcdir/EXPRTest.at:90: \$abs_builddir/expr-test -w \$abs_srcdir/expr-testsuite/test.d -k \"i,f,a&i<2000\" -b -f \"dummy\" || true" at_fn_check_prepare_dynamic "$abs_builddir/expr-test -w $abs_srcdir/expr-testsuite/test.d -k \"i,f,a&i<2000\" -b -f \"dummy\" || true" "EXPRTest.at:90" ( $at_check_trace; $abs_builddir/expr-test -w $abs_srcdir/expr-testsuite/test.d -k "i,f,a&i<2000" -b -f "dummy" || true -) >>"$at_stdout" 2>>"$at_stderr" +) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" @@ -6629,7 +6322,7 @@ $as_echo "$at_srcdir/EXPRTest.at:90: diff -b -B \$abs_srcdir/expr-testsuite/test.db.base stdout || diff -b -B \$abs_srcdir/expr-testsuite/test.db.base stderr" at_fn_check_prepare_dynamic "diff -b -B $abs_srcdir/expr-testsuite/test.db.base stdout || diff -b -B $abs_srcdir/expr-testsuite/test.db.base stderr" "EXPRTest.at:90" ( $at_check_trace; diff -b -B $abs_srcdir/expr-testsuite/test.db.base stdout || diff -b -B $abs_srcdir/expr-testsuite/test.db.base stderr -) >>"$at_stdout" 2>>"$at_stderr" +) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: @@ -6641,20 +6334,16 @@ set +x $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 | eval $at_tee_pipe +) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_85 #AT_START_86 -# 86. EXPRTest.at:90: expr-test -W $abs_srcdir/expr-testsuite/test.d -k "i,f,a&i<2000" -b (pass) -at_setup_line='EXPRTest.at:90' -at_desc="expr-test -W \$abs_srcdir/expr-testsuite/test.d -k \"i,f,a&i<2000\" -b (pass)" -at_desc_line=" 86: $at_desc" -$at_quiet $as_echo_n "$at_desc_line" +at_fn_group_banner 86 'EXPRTest.at:90' \ + "expr-test -W \$abs_srcdir/expr-testsuite/test.d -k \"i,f,a&i<2000\" -b (pass)" "" at_xfail=no test "pass" = "xfail" && at_xfail=yes -echo "# -*- compilation -*-" >> "$at_group_log" ( - $as_echo "86. EXPRTest.at:90: testing ..." + $as_echo "86. $at_setup_line: testing $at_desc ..." $at_traceon @@ -6670,7 +6359,7 @@ $as_echo "$at_srcdir/EXPRTest.at:90: \$abs_builddir/expr-test -W \$abs_srcdir/expr-testsuite/test.d -k \"i,f,a&i<2000\" -b -f \"dummy\" || true" at_fn_check_prepare_dynamic "$abs_builddir/expr-test -W $abs_srcdir/expr-testsuite/test.d -k \"i,f,a&i<2000\" -b -f \"dummy\" || true" "EXPRTest.at:90" ( $at_check_trace; $abs_builddir/expr-test -W $abs_srcdir/expr-testsuite/test.d -k "i,f,a&i<2000" -b -f "dummy" || true -) >>"$at_stdout" 2>>"$at_stderr" +) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" @@ -6683,7 +6372,7 @@ $as_echo "$at_srcdir/EXPRTest.at:90: diff -b -B \$abs_srcdir/expr-testsuite/test.db.base stdout || diff -b -B \$abs_srcdir/expr-testsuite/test.db.base stderr" at_fn_check_prepare_dynamic "diff -b -B $abs_srcdir/expr-testsuite/test.db.base stdout || diff -b -B $abs_srcdir/expr-testsuite/test.db.base stderr" "EXPRTest.at:90" ( $at_check_trace; diff -b -B $abs_srcdir/expr-testsuite/test.db.base stdout || diff -b -B $abs_srcdir/expr-testsuite/test.db.base stderr -) >>"$at_stdout" 2>>"$at_stderr" +) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: @@ -6695,20 +6384,16 @@ set +x $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 | eval $at_tee_pipe +) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_86 #AT_START_87 -# 87. EXPRTest.at:91: expr-test -w $abs_srcdir/expr-testsuite/test.d -k "i,f,a&f<0" -b (pass) -at_setup_line='EXPRTest.at:91' -at_desc="expr-test -w \$abs_srcdir/expr-testsuite/test.d -k \"i,f,a&f<0\" -b (pass)" -at_desc_line=" 87: $at_desc" -$at_quiet $as_echo_n "$at_desc_line" +at_fn_group_banner 87 'EXPRTest.at:91' \ + "expr-test -w \$abs_srcdir/expr-testsuite/test.d -k \"i,f,a&f<0\" -b (pass)" "" at_xfail=no test "pass" = "xfail" && at_xfail=yes -echo "# -*- compilation -*-" >> "$at_group_log" ( - $as_echo "87. EXPRTest.at:91: testing ..." + $as_echo "87. $at_setup_line: testing $at_desc ..." $at_traceon @@ -6724,7 +6409,7 @@ $as_echo "$at_srcdir/EXPRTest.at:91: \$abs_builddir/expr-test -w \$abs_srcdir/expr-testsuite/test.d -k \"i,f,a&f<0\" -b -f \"dummy\" || true" at_fn_check_prepare_dynamic "$abs_builddir/expr-test -w $abs_srcdir/expr-testsuite/test.d -k \"i,f,a&f<0\" -b -f \"dummy\" || true" "EXPRTest.at:91" ( $at_check_trace; $abs_builddir/expr-test -w $abs_srcdir/expr-testsuite/test.d -k "i,f,a&f<0" -b -f "dummy" || true -) >>"$at_stdout" 2>>"$at_stderr" +) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" @@ -6737,7 +6422,7 @@ $as_echo "$at_srcdir/EXPRTest.at:91: diff -b -B \$abs_srcdir/expr-testsuite/test.dc.base stdout || diff -b -B \$abs_srcdir/expr-testsuite/test.dc.base stderr" at_fn_check_prepare_dynamic "diff -b -B $abs_srcdir/expr-testsuite/test.dc.base stdout || diff -b -B $abs_srcdir/expr-testsuite/test.dc.base stderr" "EXPRTest.at:91" ( $at_check_trace; diff -b -B $abs_srcdir/expr-testsuite/test.dc.base stdout || diff -b -B $abs_srcdir/expr-testsuite/test.dc.base stderr -) >>"$at_stdout" 2>>"$at_stderr" +) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: @@ -6749,20 +6434,16 @@ set +x $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 | eval $at_tee_pipe +) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_87 #AT_START_88 -# 88. EXPRTest.at:91: expr-test -W $abs_srcdir/expr-testsuite/test.d -k "i,f,a&f<0" -b (pass) -at_setup_line='EXPRTest.at:91' -at_desc="expr-test -W \$abs_srcdir/expr-testsuite/test.d -k \"i,f,a&f<0\" -b (pass)" -at_desc_line=" 88: $at_desc" -$at_quiet $as_echo_n "$at_desc_line" +at_fn_group_banner 88 'EXPRTest.at:91' \ + "expr-test -W \$abs_srcdir/expr-testsuite/test.d -k \"i,f,a&f<0\" -b (pass)" "" at_xfail=no test "pass" = "xfail" && at_xfail=yes -echo "# -*- compilation -*-" >> "$at_group_log" ( - $as_echo "88. EXPRTest.at:91: testing ..." + $as_echo "88. $at_setup_line: testing $at_desc ..." $at_traceon @@ -6778,7 +6459,7 @@ $as_echo "$at_srcdir/EXPRTest.at:91: \$abs_builddir/expr-test -W \$abs_srcdir/expr-testsuite/test.d -k \"i,f,a&f<0\" -b -f \"dummy\" || true" at_fn_check_prepare_dynamic "$abs_builddir/expr-test -W $abs_srcdir/expr-testsuite/test.d -k \"i,f,a&f<0\" -b -f \"dummy\" || true" "EXPRTest.at:91" ( $at_check_trace; $abs_builddir/expr-test -W $abs_srcdir/expr-testsuite/test.d -k "i,f,a&f<0" -b -f "dummy" || true -) >>"$at_stdout" 2>>"$at_stderr" +) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" @@ -6791,7 +6472,7 @@ $as_echo "$at_srcdir/EXPRTest.at:91: diff -b -B \$abs_srcdir/expr-testsuite/test.dc.base stdout || diff -b -B \$abs_srcdir/expr-testsuite/test.dc.base stderr" at_fn_check_prepare_dynamic "diff -b -B $abs_srcdir/expr-testsuite/test.dc.base stdout || diff -b -B $abs_srcdir/expr-testsuite/test.dc.base stderr" "EXPRTest.at:91" ( $at_check_trace; diff -b -B $abs_srcdir/expr-testsuite/test.dc.base stdout || diff -b -B $abs_srcdir/expr-testsuite/test.dc.base stderr -) >>"$at_stdout" 2>>"$at_stderr" +) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: @@ -6803,20 +6484,16 @@ set +x $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 | eval $at_tee_pipe +) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_88 #AT_START_89 -# 89. EXPRTest.at:92: expr-test -w $abs_srcdir/expr-testsuite/test.d -k "i,f,a&a<10" -b (pass) -at_setup_line='EXPRTest.at:92' -at_desc="expr-test -w \$abs_srcdir/expr-testsuite/test.d -k \"i,f,a&a<10\" -b (pass)" -at_desc_line=" 89: $at_desc" -$at_quiet $as_echo_n "$at_desc_line" +at_fn_group_banner 89 'EXPRTest.at:92' \ + "expr-test -w \$abs_srcdir/expr-testsuite/test.d -k \"i,f,a&a<10\" -b (pass)" "" at_xfail=no test "pass" = "xfail" && at_xfail=yes -echo "# -*- compilation -*-" >> "$at_group_log" ( - $as_echo "89. EXPRTest.at:92: testing ..." + $as_echo "89. $at_setup_line: testing $at_desc ..." $at_traceon @@ -6832,7 +6509,7 @@ $as_echo "$at_srcdir/EXPRTest.at:92: \$abs_builddir/expr-test -w \$abs_srcdir/expr-testsuite/test.d -k \"i,f,a&a<10\" -b -f \"dummy\" || true" at_fn_check_prepare_dynamic "$abs_builddir/expr-test -w $abs_srcdir/expr-testsuite/test.d -k \"i,f,a&a<10\" -b -f \"dummy\" || true" "EXPRTest.at:92" ( $at_check_trace; $abs_builddir/expr-test -w $abs_srcdir/expr-testsuite/test.d -k "i,f,a&a<10" -b -f "dummy" || true -) >>"$at_stdout" 2>>"$at_stderr" +) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" @@ -6845,7 +6522,7 @@ $as_echo "$at_srcdir/EXPRTest.at:92: diff -b -B \$abs_srcdir/expr-testsuite/test.dd.base stdout || diff -b -B \$abs_srcdir/expr-testsuite/test.dd.base stderr" at_fn_check_prepare_dynamic "diff -b -B $abs_srcdir/expr-testsuite/test.dd.base stdout || diff -b -B $abs_srcdir/expr-testsuite/test.dd.base stderr" "EXPRTest.at:92" ( $at_check_trace; diff -b -B $abs_srcdir/expr-testsuite/test.dd.base stdout || diff -b -B $abs_srcdir/expr-testsuite/test.dd.base stderr -) >>"$at_stdout" 2>>"$at_stderr" +) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: @@ -6857,20 +6534,16 @@ set +x $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 | eval $at_tee_pipe +) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_89 #AT_START_90 -# 90. EXPRTest.at:92: expr-test -W $abs_srcdir/expr-testsuite/test.d -k "i,f,a&a<10" -b (pass) -at_setup_line='EXPRTest.at:92' -at_desc="expr-test -W \$abs_srcdir/expr-testsuite/test.d -k \"i,f,a&a<10\" -b (pass)" -at_desc_line=" 90: $at_desc" -$at_quiet $as_echo_n "$at_desc_line" +at_fn_group_banner 90 'EXPRTest.at:92' \ + "expr-test -W \$abs_srcdir/expr-testsuite/test.d -k \"i,f,a&a<10\" -b (pass)" "" at_xfail=no test "pass" = "xfail" && at_xfail=yes -echo "# -*- compilation -*-" >> "$at_group_log" ( - $as_echo "90. EXPRTest.at:92: testing ..." + $as_echo "90. $at_setup_line: testing $at_desc ..." $at_traceon @@ -6886,7 +6559,7 @@ $as_echo "$at_srcdir/EXPRTest.at:92: \$abs_builddir/expr-test -W \$abs_srcdir/expr-testsuite/test.d -k \"i,f,a&a<10\" -b -f \"dummy\" || true" at_fn_check_prepare_dynamic "$abs_builddir/expr-test -W $abs_srcdir/expr-testsuite/test.d -k \"i,f,a&a<10\" -b -f \"dummy\" || true" "EXPRTest.at:92" ( $at_check_trace; $abs_builddir/expr-test -W $abs_srcdir/expr-testsuite/test.d -k "i,f,a&a<10" -b -f "dummy" || true -) >>"$at_stdout" 2>>"$at_stderr" +) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" @@ -6899,7 +6572,7 @@ $as_echo "$at_srcdir/EXPRTest.at:92: diff -b -B \$abs_srcdir/expr-testsuite/test.dd.base stdout || diff -b -B \$abs_srcdir/expr-testsuite/test.dd.base stderr" at_fn_check_prepare_dynamic "diff -b -B $abs_srcdir/expr-testsuite/test.dd.base stdout || diff -b -B $abs_srcdir/expr-testsuite/test.dd.base stderr" "EXPRTest.at:92" ( $at_check_trace; diff -b -B $abs_srcdir/expr-testsuite/test.dd.base stdout || diff -b -B $abs_srcdir/expr-testsuite/test.dd.base stderr -) >>"$at_stdout" 2>>"$at_stderr" +) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: @@ -6911,20 +6584,16 @@ set +x $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 | eval $at_tee_pipe +) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_90 #AT_START_91 -# 91. EXPRTest.at:93: expr-test -w $abs_srcdir/expr-testsuite/test.d -k "i,f&i<2000" -b (pass) -at_setup_line='EXPRTest.at:93' -at_desc="expr-test -w \$abs_srcdir/expr-testsuite/test.d -k \"i,f&i<2000\" -b (pass)" -at_desc_line=" 91: $at_desc" -$at_quiet $as_echo_n "$at_desc_line" +at_fn_group_banner 91 'EXPRTest.at:93' \ + "expr-test -w \$abs_srcdir/expr-testsuite/test.d -k \"i,f&i<2000\" -b (pass)" "" at_xfail=no test "pass" = "xfail" && at_xfail=yes -echo "# -*- compilation -*-" >> "$at_group_log" ( - $as_echo "91. EXPRTest.at:93: testing ..." + $as_echo "91. $at_setup_line: testing $at_desc ..." $at_traceon @@ -6940,7 +6609,7 @@ $as_echo "$at_srcdir/EXPRTest.at:93: \$abs_builddir/expr-test -w \$abs_srcdir/expr-testsuite/test.d -k \"i,f&i<2000\" -b -f \"dummy\" || true" at_fn_check_prepare_dynamic "$abs_builddir/expr-test -w $abs_srcdir/expr-testsuite/test.d -k \"i,f&i<2000\" -b -f \"dummy\" || true" "EXPRTest.at:93" ( $at_check_trace; $abs_builddir/expr-test -w $abs_srcdir/expr-testsuite/test.d -k "i,f&i<2000" -b -f "dummy" || true -) >>"$at_stdout" 2>>"$at_stderr" +) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" @@ -6953,7 +6622,7 @@ $as_echo "$at_srcdir/EXPRTest.at:93: diff -b -B \$abs_srcdir/expr-testsuite/test.de.base stdout || diff -b -B \$abs_srcdir/expr-testsuite/test.de.base stderr" at_fn_check_prepare_dynamic "diff -b -B $abs_srcdir/expr-testsuite/test.de.base stdout || diff -b -B $abs_srcdir/expr-testsuite/test.de.base stderr" "EXPRTest.at:93" ( $at_check_trace; diff -b -B $abs_srcdir/expr-testsuite/test.de.base stdout || diff -b -B $abs_srcdir/expr-testsuite/test.de.base stderr -) >>"$at_stdout" 2>>"$at_stderr" +) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: @@ -6965,20 +6634,16 @@ set +x $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 | eval $at_tee_pipe +) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_91 #AT_START_92 -# 92. EXPRTest.at:93: expr-test -W $abs_srcdir/expr-testsuite/test.d -k "i,f&i<2000" -b (pass) -at_setup_line='EXPRTest.at:93' -at_desc="expr-test -W \$abs_srcdir/expr-testsuite/test.d -k \"i,f&i<2000\" -b (pass)" -at_desc_line=" 92: $at_desc" -$at_quiet $as_echo_n "$at_desc_line" +at_fn_group_banner 92 'EXPRTest.at:93' \ + "expr-test -W \$abs_srcdir/expr-testsuite/test.d -k \"i,f&i<2000\" -b (pass)" "" at_xfail=no test "pass" = "xfail" && at_xfail=yes -echo "# -*- compilation -*-" >> "$at_group_log" ( - $as_echo "92. EXPRTest.at:93: testing ..." + $as_echo "92. $at_setup_line: testing $at_desc ..." $at_traceon @@ -6994,7 +6659,7 @@ $as_echo "$at_srcdir/EXPRTest.at:93: \$abs_builddir/expr-test -W \$abs_srcdir/expr-testsuite/test.d -k \"i,f&i<2000\" -b -f \"dummy\" || true" at_fn_check_prepare_dynamic "$abs_builddir/expr-test -W $abs_srcdir/expr-testsuite/test.d -k \"i,f&i<2000\" -b -f \"dummy\" || true" "EXPRTest.at:93" ( $at_check_trace; $abs_builddir/expr-test -W $abs_srcdir/expr-testsuite/test.d -k "i,f&i<2000" -b -f "dummy" || true -) >>"$at_stdout" 2>>"$at_stderr" +) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" @@ -7007,7 +6672,7 @@ $as_echo "$at_srcdir/EXPRTest.at:93: diff -b -B \$abs_srcdir/expr-testsuite/test.de.base stdout || diff -b -B \$abs_srcdir/expr-testsuite/test.de.base stderr" at_fn_check_prepare_dynamic "diff -b -B $abs_srcdir/expr-testsuite/test.de.base stdout || diff -b -B $abs_srcdir/expr-testsuite/test.de.base stderr" "EXPRTest.at:93" ( $at_check_trace; diff -b -B $abs_srcdir/expr-testsuite/test.de.base stdout || diff -b -B $abs_srcdir/expr-testsuite/test.de.base stderr -) >>"$at_stdout" 2>>"$at_stderr" +) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: @@ -7019,20 +6684,16 @@ set +x $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 | eval $at_tee_pipe +) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_92 #AT_START_93 -# 93. EXPRTest.at:94: expr-test -w $abs_srcdir/expr-testsuite/test.d -k "i&i<2000" -b (pass) -at_setup_line='EXPRTest.at:94' -at_desc="expr-test -w \$abs_srcdir/expr-testsuite/test.d -k \"i&i<2000\" -b (pass)" -at_desc_line=" 93: $at_desc" -$at_quiet $as_echo_n "$at_desc_line" +at_fn_group_banner 93 'EXPRTest.at:94' \ + "expr-test -w \$abs_srcdir/expr-testsuite/test.d -k \"i&i<2000\" -b (pass)" "" at_xfail=no test "pass" = "xfail" && at_xfail=yes -echo "# -*- compilation -*-" >> "$at_group_log" ( - $as_echo "93. EXPRTest.at:94: testing ..." + $as_echo "93. $at_setup_line: testing $at_desc ..." $at_traceon @@ -7048,7 +6709,7 @@ $as_echo "$at_srcdir/EXPRTest.at:94: \$abs_builddir/expr-test -w \$abs_srcdir/expr-testsuite/test.d -k \"i&i<2000\" -b -f \"dummy\" || true" at_fn_check_prepare_dynamic "$abs_builddir/expr-test -w $abs_srcdir/expr-testsuite/test.d -k \"i&i<2000\" -b -f \"dummy\" || true" "EXPRTest.at:94" ( $at_check_trace; $abs_builddir/expr-test -w $abs_srcdir/expr-testsuite/test.d -k "i&i<2000" -b -f "dummy" || true -) >>"$at_stdout" 2>>"$at_stderr" +) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" @@ -7061,7 +6722,7 @@ $as_echo "$at_srcdir/EXPRTest.at:94: diff -b -B \$abs_srcdir/expr-testsuite/test.df.base stdout || diff -b -B \$abs_srcdir/expr-testsuite/test.df.base stderr" at_fn_check_prepare_dynamic "diff -b -B $abs_srcdir/expr-testsuite/test.df.base stdout || diff -b -B $abs_srcdir/expr-testsuite/test.df.base stderr" "EXPRTest.at:94" ( $at_check_trace; diff -b -B $abs_srcdir/expr-testsuite/test.df.base stdout || diff -b -B $abs_srcdir/expr-testsuite/test.df.base stderr -) >>"$at_stdout" 2>>"$at_stderr" +) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: @@ -7073,20 +6734,16 @@ set +x $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 | eval $at_tee_pipe +) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_93 #AT_START_94 -# 94. EXPRTest.at:94: expr-test -W $abs_srcdir/expr-testsuite/test.d -k "i&i<2000" -b (pass) -at_setup_line='EXPRTest.at:94' -at_desc="expr-test -W \$abs_srcdir/expr-testsuite/test.d -k \"i&i<2000\" -b (pass)" -at_desc_line=" 94: $at_desc" -$at_quiet $as_echo_n "$at_desc_line" +at_fn_group_banner 94 'EXPRTest.at:94' \ + "expr-test -W \$abs_srcdir/expr-testsuite/test.d -k \"i&i<2000\" -b (pass)" "" at_xfail=no test "pass" = "xfail" && at_xfail=yes -echo "# -*- compilation -*-" >> "$at_group_log" ( - $as_echo "94. EXPRTest.at:94: testing ..." + $as_echo "94. $at_setup_line: testing $at_desc ..." $at_traceon @@ -7102,7 +6759,7 @@ $as_echo "$at_srcdir/EXPRTest.at:94: \$abs_builddir/expr-test -W \$abs_srcdir/expr-testsuite/test.d -k \"i&i<2000\" -b -f \"dummy\" || true" at_fn_check_prepare_dynamic "$abs_builddir/expr-test -W $abs_srcdir/expr-testsuite/test.d -k \"i&i<2000\" -b -f \"dummy\" || true" "EXPRTest.at:94" ( $at_check_trace; $abs_builddir/expr-test -W $abs_srcdir/expr-testsuite/test.d -k "i&i<2000" -b -f "dummy" || true -) >>"$at_stdout" 2>>"$at_stderr" +) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" @@ -7115,7 +6772,7 @@ $as_echo "$at_srcdir/EXPRTest.at:94: diff -b -B \$abs_srcdir/expr-testsuite/test.df.base stdout || diff -b -B \$abs_srcdir/expr-testsuite/test.df.base stderr" at_fn_check_prepare_dynamic "diff -b -B $abs_srcdir/expr-testsuite/test.df.base stdout || diff -b -B $abs_srcdir/expr-testsuite/test.df.base stderr" "EXPRTest.at:94" ( $at_check_trace; diff -b -B $abs_srcdir/expr-testsuite/test.df.base stdout || diff -b -B $abs_srcdir/expr-testsuite/test.df.base stderr -) >>"$at_stdout" 2>>"$at_stderr" +) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: @@ -7127,20 +6784,16 @@ set +x $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 | eval $at_tee_pipe +) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_94 #AT_START_95 -# 95. EXPRTest.at:95: expr-test -w $abs_srcdir/expr-testsuite/test.d -k "i,f,a&i<0" -b (pass) -at_setup_line='EXPRTest.at:95' -at_desc="expr-test -w \$abs_srcdir/expr-testsuite/test.d -k \"i,f,a&i<0\" -b (pass)" -at_desc_line=" 95: $at_desc" -$at_quiet $as_echo_n "$at_desc_line" +at_fn_group_banner 95 'EXPRTest.at:95' \ + "expr-test -w \$abs_srcdir/expr-testsuite/test.d -k \"i,f,a&i<0\" -b (pass)" "" at_xfail=no test "pass" = "xfail" && at_xfail=yes -echo "# -*- compilation -*-" >> "$at_group_log" ( - $as_echo "95. EXPRTest.at:95: testing ..." + $as_echo "95. $at_setup_line: testing $at_desc ..." $at_traceon @@ -7156,7 +6809,7 @@ $as_echo "$at_srcdir/EXPRTest.at:95: \$abs_builddir/expr-test -w \$abs_srcdir/expr-testsuite/test.d -k \"i,f,a&i<0\" -b -f \"dummy\" || true" at_fn_check_prepare_dynamic "$abs_builddir/expr-test -w $abs_srcdir/expr-testsuite/test.d -k \"i,f,a&i<0\" -b -f \"dummy\" || true" "EXPRTest.at:95" ( $at_check_trace; $abs_builddir/expr-test -w $abs_srcdir/expr-testsuite/test.d -k "i,f,a&i<0" -b -f "dummy" || true -) >>"$at_stdout" 2>>"$at_stderr" +) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" @@ -7169,7 +6822,7 @@ $as_echo "$at_srcdir/EXPRTest.at:95: diff -b -B \$abs_srcdir/expr-testsuite/test.dg.base stdout || diff -b -B \$abs_srcdir/expr-testsuite/test.dg.base stderr" at_fn_check_prepare_dynamic "diff -b -B $abs_srcdir/expr-testsuite/test.dg.base stdout || diff -b -B $abs_srcdir/expr-testsuite/test.dg.base stderr" "EXPRTest.at:95" ( $at_check_trace; diff -b -B $abs_srcdir/expr-testsuite/test.dg.base stdout || diff -b -B $abs_srcdir/expr-testsuite/test.dg.base stderr -) >>"$at_stdout" 2>>"$at_stderr" +) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: @@ -7181,20 +6834,16 @@ set +x $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 | eval $at_tee_pipe +) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_95 #AT_START_96 -# 96. EXPRTest.at:95: expr-test -W $abs_srcdir/expr-testsuite/test.d -k "i,f,a&i<0" -b (pass) -at_setup_line='EXPRTest.at:95' -at_desc="expr-test -W \$abs_srcdir/expr-testsuite/test.d -k \"i,f,a&i<0\" -b (pass)" -at_desc_line=" 96: $at_desc" -$at_quiet $as_echo_n "$at_desc_line" +at_fn_group_banner 96 'EXPRTest.at:95' \ + "expr-test -W \$abs_srcdir/expr-testsuite/test.d -k \"i,f,a&i<0\" -b (pass)" "" at_xfail=no test "pass" = "xfail" && at_xfail=yes -echo "# -*- compilation -*-" >> "$at_group_log" ( - $as_echo "96. EXPRTest.at:95: testing ..." + $as_echo "96. $at_setup_line: testing $at_desc ..." $at_traceon @@ -7210,7 +6859,7 @@ $as_echo "$at_srcdir/EXPRTest.at:95: \$abs_builddir/expr-test -W \$abs_srcdir/expr-testsuite/test.d -k \"i,f,a&i<0\" -b -f \"dummy\" || true" at_fn_check_prepare_dynamic "$abs_builddir/expr-test -W $abs_srcdir/expr-testsuite/test.d -k \"i,f,a&i<0\" -b -f \"dummy\" || true" "EXPRTest.at:95" ( $at_check_trace; $abs_builddir/expr-test -W $abs_srcdir/expr-testsuite/test.d -k "i,f,a&i<0" -b -f "dummy" || true -) >>"$at_stdout" 2>>"$at_stderr" +) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" @@ -7223,7 +6872,7 @@ $as_echo "$at_srcdir/EXPRTest.at:95: diff -b -B \$abs_srcdir/expr-testsuite/test.dg.base stdout || diff -b -B \$abs_srcdir/expr-testsuite/test.dg.base stderr" at_fn_check_prepare_dynamic "diff -b -B $abs_srcdir/expr-testsuite/test.dg.base stdout || diff -b -B $abs_srcdir/expr-testsuite/test.dg.base stderr" "EXPRTest.at:95" ( $at_check_trace; diff -b -B $abs_srcdir/expr-testsuite/test.dg.base stdout || diff -b -B $abs_srcdir/expr-testsuite/test.dg.base stderr -) >>"$at_stdout" 2>>"$at_stderr" +) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: @@ -7235,20 +6884,16 @@ set +x $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 | eval $at_tee_pipe +) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_96 #AT_START_97 -# 97. EXPRTest.at:97: expr-test -b -w $abs_srcdir/expr-testsuite/test.61 -k i (pass) -at_setup_line='EXPRTest.at:97' -at_desc="expr-test -b -w \$abs_srcdir/expr-testsuite/test.61 -k i (pass)" -at_desc_line=" 97: $at_desc" -$at_quiet $as_echo_n "$at_desc_line" +at_fn_group_banner 97 'EXPRTest.at:97' \ + "expr-test -b -w \$abs_srcdir/expr-testsuite/test.61 -k i (pass)" "" at_xfail=no test "pass" = "xfail" && at_xfail=yes -echo "# -*- compilation -*-" >> "$at_group_log" ( - $as_echo "97. EXPRTest.at:97: testing ..." + $as_echo "97. $at_setup_line: testing $at_desc ..." $at_traceon @@ -7264,7 +6909,7 @@ $as_echo "$at_srcdir/EXPRTest.at:97: \$abs_builddir/expr-test -b -w \$abs_srcdir/expr-testsuite/test.61 -k i -f \"dummy\" || true" at_fn_check_prepare_dynamic "$abs_builddir/expr-test -b -w $abs_srcdir/expr-testsuite/test.61 -k i -f \"dummy\" || true" "EXPRTest.at:97" ( $at_check_trace; $abs_builddir/expr-test -b -w $abs_srcdir/expr-testsuite/test.61 -k i -f "dummy" || true -) >>"$at_stdout" 2>>"$at_stderr" +) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" @@ -7277,7 +6922,7 @@ $as_echo "$at_srcdir/EXPRTest.at:97: diff -b -B \$abs_srcdir/expr-testsuite/data.61a.base stdout || diff -b -B \$abs_srcdir/expr-testsuite/data.61a.base stderr" at_fn_check_prepare_dynamic "diff -b -B $abs_srcdir/expr-testsuite/data.61a.base stdout || diff -b -B $abs_srcdir/expr-testsuite/data.61a.base stderr" "EXPRTest.at:97" ( $at_check_trace; diff -b -B $abs_srcdir/expr-testsuite/data.61a.base stdout || diff -b -B $abs_srcdir/expr-testsuite/data.61a.base stderr -) >>"$at_stdout" 2>>"$at_stderr" +) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: @@ -7289,20 +6934,16 @@ set +x $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 | eval $at_tee_pipe +) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_97 #AT_START_98 -# 98. EXPRTest.at:97: expr-test -b -W $abs_srcdir/expr-testsuite/test.61 -k i (pass) -at_setup_line='EXPRTest.at:97' -at_desc="expr-test -b -W \$abs_srcdir/expr-testsuite/test.61 -k i (pass)" -at_desc_line=" 98: $at_desc" -$at_quiet $as_echo_n "$at_desc_line" +at_fn_group_banner 98 'EXPRTest.at:97' \ + "expr-test -b -W \$abs_srcdir/expr-testsuite/test.61 -k i (pass)" "" at_xfail=no test "pass" = "xfail" && at_xfail=yes -echo "# -*- compilation -*-" >> "$at_group_log" ( - $as_echo "98. EXPRTest.at:97: testing ..." + $as_echo "98. $at_setup_line: testing $at_desc ..." $at_traceon @@ -7318,7 +6959,7 @@ $as_echo "$at_srcdir/EXPRTest.at:97: \$abs_builddir/expr-test -b -W \$abs_srcdir/expr-testsuite/test.61 -k i -f \"dummy\" || true" at_fn_check_prepare_dynamic "$abs_builddir/expr-test -b -W $abs_srcdir/expr-testsuite/test.61 -k i -f \"dummy\" || true" "EXPRTest.at:97" ( $at_check_trace; $abs_builddir/expr-test -b -W $abs_srcdir/expr-testsuite/test.61 -k i -f "dummy" || true -) >>"$at_stdout" 2>>"$at_stderr" +) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" @@ -7331,7 +6972,7 @@ $as_echo "$at_srcdir/EXPRTest.at:97: diff -b -B \$abs_srcdir/expr-testsuite/data.61a.base stdout || diff -b -B \$abs_srcdir/expr-testsuite/data.61a.base stderr" at_fn_check_prepare_dynamic "diff -b -B $abs_srcdir/expr-testsuite/data.61a.base stdout || diff -b -B $abs_srcdir/expr-testsuite/data.61a.base stderr" "EXPRTest.at:97" ( $at_check_trace; diff -b -B $abs_srcdir/expr-testsuite/data.61a.base stdout || diff -b -B $abs_srcdir/expr-testsuite/data.61a.base stderr -) >>"$at_stdout" 2>>"$at_stderr" +) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: @@ -7343,20 +6984,16 @@ set +x $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 | eval $at_tee_pipe +) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_98 #AT_START_99 -# 99. EXPRTest.at:98: expr-test -b -w $abs_srcdir/expr-testsuite/test.61 -k i[0:2][0:2] (pass) -at_setup_line='EXPRTest.at:98' -at_desc="expr-test -b -w \$abs_srcdir/expr-testsuite/test.61 -k i[0:2][0:2] (pass)" -at_desc_line=" 99: $at_desc" -$at_quiet $as_echo_n "$at_desc_line" +at_fn_group_banner 99 'EXPRTest.at:98' \ + "expr-test -b -w \$abs_srcdir/expr-testsuite/test.61 -k i[0:2][0:2] (pass)" "" at_xfail=no test "pass" = "xfail" && at_xfail=yes -echo "# -*- compilation -*-" >> "$at_group_log" ( - $as_echo "99. EXPRTest.at:98: testing ..." + $as_echo "99. $at_setup_line: testing $at_desc ..." $at_traceon @@ -7372,7 +7009,7 @@ $as_echo "$at_srcdir/EXPRTest.at:98: \$abs_builddir/expr-test -b -w \$abs_srcdir/expr-testsuite/test.61 -k i[0:2][0:2] -f \"dummy\" || true" at_fn_check_prepare_dynamic "$abs_builddir/expr-test -b -w $abs_srcdir/expr-testsuite/test.61 -k i[0:2][0:2] -f \"dummy\" || true" "EXPRTest.at:98" ( $at_check_trace; $abs_builddir/expr-test -b -w $abs_srcdir/expr-testsuite/test.61 -k i[0:2][0:2] -f "dummy" || true -) >>"$at_stdout" 2>>"$at_stderr" +) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" @@ -7385,7 +7022,7 @@ $as_echo "$at_srcdir/EXPRTest.at:98: diff -b -B \$abs_srcdir/expr-testsuite/data.61b.base stdout || diff -b -B \$abs_srcdir/expr-testsuite/data.61b.base stderr" at_fn_check_prepare_dynamic "diff -b -B $abs_srcdir/expr-testsuite/data.61b.base stdout || diff -b -B $abs_srcdir/expr-testsuite/data.61b.base stderr" "EXPRTest.at:98" ( $at_check_trace; diff -b -B $abs_srcdir/expr-testsuite/data.61b.base stdout || diff -b -B $abs_srcdir/expr-testsuite/data.61b.base stderr -) >>"$at_stdout" 2>>"$at_stderr" +) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: @@ -7397,20 +7034,16 @@ set +x $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 | eval $at_tee_pipe +) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_99 #AT_START_100 -# 100. EXPRTest.at:98: expr-test -b -W $abs_srcdir/expr-testsuite/test.61 -k i[0:2][0:2] (pass) -at_setup_line='EXPRTest.at:98' -at_desc="expr-test -b -W \$abs_srcdir/expr-testsuite/test.61 -k i[0:2][0:2] (pass)" -at_desc_line="100: $at_desc" -$at_quiet $as_echo_n "$at_desc_line" +at_fn_group_banner 100 'EXPRTest.at:98' \ + "expr-test -b -W \$abs_srcdir/expr-testsuite/test.61 -k i[0:2][0:2] (pass)" "" at_xfail=no test "pass" = "xfail" && at_xfail=yes -echo "# -*- compilation -*-" >> "$at_group_log" ( - $as_echo "100. EXPRTest.at:98: testing ..." + $as_echo "100. $at_setup_line: testing $at_desc ..." $at_traceon @@ -7426,7 +7059,7 @@ $as_echo "$at_srcdir/EXPRTest.at:98: \$abs_builddir/expr-test -b -W \$abs_srcdir/expr-testsuite/test.61 -k i[0:2][0:2] -f \"dummy\" || true" at_fn_check_prepare_dynamic "$abs_builddir/expr-test -b -W $abs_srcdir/expr-testsuite/test.61 -k i[0:2][0:2] -f \"dummy\" || true" "EXPRTest.at:98" ( $at_check_trace; $abs_builddir/expr-test -b -W $abs_srcdir/expr-testsuite/test.61 -k i[0:2][0:2] -f "dummy" || true -) >>"$at_stdout" 2>>"$at_stderr" +) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" @@ -7439,7 +7072,7 @@ $as_echo "$at_srcdir/EXPRTest.at:98: diff -b -B \$abs_srcdir/expr-testsuite/data.61b.base stdout || diff -b -B \$abs_srcdir/expr-testsuite/data.61b.base stderr" at_fn_check_prepare_dynamic "diff -b -B $abs_srcdir/expr-testsuite/data.61b.base stdout || diff -b -B $abs_srcdir/expr-testsuite/data.61b.base stderr" "EXPRTest.at:98" ( $at_check_trace; diff -b -B $abs_srcdir/expr-testsuite/data.61b.base stdout || diff -b -B $abs_srcdir/expr-testsuite/data.61b.base stderr -) >>"$at_stdout" 2>>"$at_stderr" +) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: @@ -7451,20 +7084,16 @@ set +x $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 | eval $at_tee_pipe +) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_100 #AT_START_101 -# 101. EXPRTest.at:99: expr-test -b -w $abs_srcdir/expr-testsuite/test.61 -k i[1:2][0:2] (pass) -at_setup_line='EXPRTest.at:99' -at_desc="expr-test -b -w \$abs_srcdir/expr-testsuite/test.61 -k i[1:2][0:2] (pass)" -at_desc_line="101: $at_desc" -$at_quiet $as_echo_n "$at_desc_line" +at_fn_group_banner 101 'EXPRTest.at:99' \ + "expr-test -b -w \$abs_srcdir/expr-testsuite/test.61 -k i[1:2][0:2] (pass)" "" at_xfail=no test "pass" = "xfail" && at_xfail=yes -echo "# -*- compilation -*-" >> "$at_group_log" ( - $as_echo "101. EXPRTest.at:99: testing ..." + $as_echo "101. $at_setup_line: testing $at_desc ..." $at_traceon @@ -7480,7 +7109,7 @@ $as_echo "$at_srcdir/EXPRTest.at:99: \$abs_builddir/expr-test -b -w \$abs_srcdir/expr-testsuite/test.61 -k i[1:2][0:2] -f \"dummy\" || true" at_fn_check_prepare_dynamic "$abs_builddir/expr-test -b -w $abs_srcdir/expr-testsuite/test.61 -k i[1:2][0:2] -f \"dummy\" || true" "EXPRTest.at:99" ( $at_check_trace; $abs_builddir/expr-test -b -w $abs_srcdir/expr-testsuite/test.61 -k i[1:2][0:2] -f "dummy" || true -) >>"$at_stdout" 2>>"$at_stderr" +) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" @@ -7493,7 +7122,7 @@ $as_echo "$at_srcdir/EXPRTest.at:99: diff -b -B \$abs_srcdir/expr-testsuite/data.61c.base stdout || diff -b -B \$abs_srcdir/expr-testsuite/data.61c.base stderr" at_fn_check_prepare_dynamic "diff -b -B $abs_srcdir/expr-testsuite/data.61c.base stdout || diff -b -B $abs_srcdir/expr-testsuite/data.61c.base stderr" "EXPRTest.at:99" ( $at_check_trace; diff -b -B $abs_srcdir/expr-testsuite/data.61c.base stdout || diff -b -B $abs_srcdir/expr-testsuite/data.61c.base stderr -) >>"$at_stdout" 2>>"$at_stderr" +) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: @@ -7505,20 +7134,16 @@ set +x $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 | eval $at_tee_pipe +) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_101 #AT_START_102 -# 102. EXPRTest.at:99: expr-test -b -W $abs_srcdir/expr-testsuite/test.61 -k i[1:2][0:2] (pass) -at_setup_line='EXPRTest.at:99' -at_desc="expr-test -b -W \$abs_srcdir/expr-testsuite/test.61 -k i[1:2][0:2] (pass)" -at_desc_line="102: $at_desc" -$at_quiet $as_echo_n "$at_desc_line" +at_fn_group_banner 102 'EXPRTest.at:99' \ + "expr-test -b -W \$abs_srcdir/expr-testsuite/test.61 -k i[1:2][0:2] (pass)" "" at_xfail=no test "pass" = "xfail" && at_xfail=yes -echo "# -*- compilation -*-" >> "$at_group_log" ( - $as_echo "102. EXPRTest.at:99: testing ..." + $as_echo "102. $at_setup_line: testing $at_desc ..." $at_traceon @@ -7534,7 +7159,7 @@ $as_echo "$at_srcdir/EXPRTest.at:99: \$abs_builddir/expr-test -b -W \$abs_srcdir/expr-testsuite/test.61 -k i[1:2][0:2] -f \"dummy\" || true" at_fn_check_prepare_dynamic "$abs_builddir/expr-test -b -W $abs_srcdir/expr-testsuite/test.61 -k i[1:2][0:2] -f \"dummy\" || true" "EXPRTest.at:99" ( $at_check_trace; $abs_builddir/expr-test -b -W $abs_srcdir/expr-testsuite/test.61 -k i[1:2][0:2] -f "dummy" || true -) >>"$at_stdout" 2>>"$at_stderr" +) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" @@ -7547,7 +7172,7 @@ $as_echo "$at_srcdir/EXPRTest.at:99: diff -b -B \$abs_srcdir/expr-testsuite/data.61c.base stdout || diff -b -B \$abs_srcdir/expr-testsuite/data.61c.base stderr" at_fn_check_prepare_dynamic "diff -b -B $abs_srcdir/expr-testsuite/data.61c.base stdout || diff -b -B $abs_srcdir/expr-testsuite/data.61c.base stderr" "EXPRTest.at:99" ( $at_check_trace; diff -b -B $abs_srcdir/expr-testsuite/data.61c.base stdout || diff -b -B $abs_srcdir/expr-testsuite/data.61c.base stderr -) >>"$at_stdout" 2>>"$at_stderr" +) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: @@ -7559,20 +7184,16 @@ set +x $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 | eval $at_tee_pipe +) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_102 #AT_START_103 -# 103. EXPRTest.at:100: expr-test -b -w $abs_srcdir/expr-testsuite/test.61 -k i[1:2][1:2] (pass) -at_setup_line='EXPRTest.at:100' -at_desc="expr-test -b -w \$abs_srcdir/expr-testsuite/test.61 -k i[1:2][1:2] (pass)" -at_desc_line="103: $at_desc" -$at_quiet $as_echo_n "$at_desc_line" +at_fn_group_banner 103 'EXPRTest.at:100' \ + "expr-test -b -w \$abs_srcdir/expr-testsuite/test.61 -k i[1:2][1:2] (pass)" "" at_xfail=no test "pass" = "xfail" && at_xfail=yes -echo "# -*- compilation -*-" >> "$at_group_log" ( - $as_echo "103. EXPRTest.at:100: testing ..." + $as_echo "103. $at_setup_line: testing $at_desc ..." $at_traceon @@ -7588,7 +7209,7 @@ $as_echo "$at_srcdir/EXPRTest.at:100: \$abs_builddir/expr-test -b -w \$abs_srcdir/expr-testsuite/test.61 -k i[1:2][1:2] -f \"dummy\" || true" at_fn_check_prepare_dynamic "$abs_builddir/expr-test -b -w $abs_srcdir/expr-testsuite/test.61 -k i[1:2][1:2] -f \"dummy\" || true" "EXPRTest.at:100" ( $at_check_trace; $abs_builddir/expr-test -b -w $abs_srcdir/expr-testsuite/test.61 -k i[1:2][1:2] -f "dummy" || true -) >>"$at_stdout" 2>>"$at_stderr" +) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" @@ -7601,7 +7222,7 @@ $as_echo "$at_srcdir/EXPRTest.at:100: diff -b -B \$abs_srcdir/expr-testsuite/data.61d.base stdout || diff -b -B \$abs_srcdir/expr-testsuite/data.61d.base stderr" at_fn_check_prepare_dynamic "diff -b -B $abs_srcdir/expr-testsuite/data.61d.base stdout || diff -b -B $abs_srcdir/expr-testsuite/data.61d.base stderr" "EXPRTest.at:100" ( $at_check_trace; diff -b -B $abs_srcdir/expr-testsuite/data.61d.base stdout || diff -b -B $abs_srcdir/expr-testsuite/data.61d.base stderr -) >>"$at_stdout" 2>>"$at_stderr" +) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: @@ -7613,20 +7234,16 @@ set +x $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 | eval $at_tee_pipe +) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_103 #AT_START_104 -# 104. EXPRTest.at:100: expr-test -b -W $abs_srcdir/expr-testsuite/test.61 -k i[1:2][1:2] (pass) -at_setup_line='EXPRTest.at:100' -at_desc="expr-test -b -W \$abs_srcdir/expr-testsuite/test.61 -k i[1:2][1:2] (pass)" -at_desc_line="104: $at_desc" -$at_quiet $as_echo_n "$at_desc_line" +at_fn_group_banner 104 'EXPRTest.at:100' \ + "expr-test -b -W \$abs_srcdir/expr-testsuite/test.61 -k i[1:2][1:2] (pass)" "" at_xfail=no test "pass" = "xfail" && at_xfail=yes -echo "# -*- compilation -*-" >> "$at_group_log" ( - $as_echo "104. EXPRTest.at:100: testing ..." + $as_echo "104. $at_setup_line: testing $at_desc ..." $at_traceon @@ -7642,7 +7259,7 @@ $as_echo "$at_srcdir/EXPRTest.at:100: \$abs_builddir/expr-test -b -W \$abs_srcdir/expr-testsuite/test.61 -k i[1:2][1:2] -f \"dummy\" || true" at_fn_check_prepare_dynamic "$abs_builddir/expr-test -b -W $abs_srcdir/expr-testsuite/test.61 -k i[1:2][1:2] -f \"dummy\" || true" "EXPRTest.at:100" ( $at_check_trace; $abs_builddir/expr-test -b -W $abs_srcdir/expr-testsuite/test.61 -k i[1:2][1:2] -f "dummy" || true -) >>"$at_stdout" 2>>"$at_stderr" +) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" @@ -7655,7 +7272,7 @@ $as_echo "$at_srcdir/EXPRTest.at:100: diff -b -B \$abs_srcdir/expr-testsuite/data.61d.base stdout || diff -b -B \$abs_srcdir/expr-testsuite/data.61d.base stderr" at_fn_check_prepare_dynamic "diff -b -B $abs_srcdir/expr-testsuite/data.61d.base stdout || diff -b -B $abs_srcdir/expr-testsuite/data.61d.base stderr" "EXPRTest.at:100" ( $at_check_trace; diff -b -B $abs_srcdir/expr-testsuite/data.61d.base stdout || diff -b -B $abs_srcdir/expr-testsuite/data.61d.base stderr -) >>"$at_stdout" 2>>"$at_stderr" +) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: @@ -7667,128 +7284,16 @@ set +x $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 | eval $at_tee_pipe +) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_104 #AT_START_105 -# 105. EXPRTest.at:101: expr-test -b -w $abs_srcdir/expr-testsuite/test.c0 -k "geogrid(SST)" (pass) -at_setup_line='EXPRTest.at:101' -at_desc="expr-test -b -w \$abs_srcdir/expr-testsuite/test.c0 -k \"geogrid(SST)\" (pass)" -at_desc_line="105: $at_desc" -$at_quiet $as_echo_n "$at_desc_line" -at_xfail=no - test "pass" = "xfail" && at_xfail=yes -echo "# -*- compilation -*-" >> "$at_group_log" -( - $as_echo "105. EXPRTest.at:101: testing ..." - $at_traceon - - - - # Added || true because expr-test returns 0 (failure) for some of - # these tests which is correct for the test - we expect some of - # the input to trigger an error response from the parser, et - # cetera. That's also why we capture both stdout and stderr - - # successful runs are sent to stdout while the errors are sent to - # stderr. - - { set +x -$as_echo "$at_srcdir/EXPRTest.at:101: \$abs_builddir/expr-test -b -w \$abs_srcdir/expr-testsuite/test.c0 -k \"geogrid(SST)\" -f \"dummy\" || true" -at_fn_check_prepare_dynamic "$abs_builddir/expr-test -b -w $abs_srcdir/expr-testsuite/test.c0 -k \"geogrid(SST)\" -f \"dummy\" || true" "EXPRTest.at:101" -( $at_check_trace; $abs_builddir/expr-test -b -w $abs_srcdir/expr-testsuite/test.c0 -k "geogrid(SST)" -f "dummy" || true -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; tee stderr <"$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/EXPRTest.at:101" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/EXPRTest.at:101: diff -b -B \$abs_srcdir/expr-testsuite/data.z0.base stdout || diff -b -B \$abs_srcdir/expr-testsuite/data.z0.base stderr" -at_fn_check_prepare_dynamic "diff -b -B $abs_srcdir/expr-testsuite/data.z0.base stdout || diff -b -B $abs_srcdir/expr-testsuite/data.z0.base stderr" "EXPRTest.at:101" -( $at_check_trace; diff -b -B $abs_srcdir/expr-testsuite/data.z0.base stdout || diff -b -B $abs_srcdir/expr-testsuite/data.z0.base stderr -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/EXPRTest.at:101" -$at_failed && at_fn_log_failure -$at_traceon; } - - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_105 -#AT_START_106 -# 106. EXPRTest.at:101: expr-test -b -W $abs_srcdir/expr-testsuite/test.c0 -k "geogrid(SST)" (pass) -at_setup_line='EXPRTest.at:101' -at_desc="expr-test -b -W \$abs_srcdir/expr-testsuite/test.c0 -k \"geogrid(SST)\" (pass)" -at_desc_line="106: $at_desc" -$at_quiet $as_echo_n "$at_desc_line" -at_xfail=no - test "pass" = "xfail" && at_xfail=yes -echo "# -*- compilation -*-" >> "$at_group_log" -( - $as_echo "106. EXPRTest.at:101: testing ..." - $at_traceon - - - - # Added || true because expr-test returns 0 (failure) for some of - # these tests which is correct for the test - we expect some of - # the input to trigger an error response from the parser, et - # cetera. That's also why we capture both stdout and stderr - - # successful runs are sent to stdout while the errors are sent to - # stderr. - - { set +x -$as_echo "$at_srcdir/EXPRTest.at:101: \$abs_builddir/expr-test -b -W \$abs_srcdir/expr-testsuite/test.c0 -k \"geogrid(SST)\" -f \"dummy\" || true" -at_fn_check_prepare_dynamic "$abs_builddir/expr-test -b -W $abs_srcdir/expr-testsuite/test.c0 -k \"geogrid(SST)\" -f \"dummy\" || true" "EXPRTest.at:101" -( $at_check_trace; $abs_builddir/expr-test -b -W $abs_srcdir/expr-testsuite/test.c0 -k "geogrid(SST)" -f "dummy" || true -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; tee stderr <"$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/EXPRTest.at:101" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/EXPRTest.at:101: diff -b -B \$abs_srcdir/expr-testsuite/data.z0.base stdout || diff -b -B \$abs_srcdir/expr-testsuite/data.z0.base stderr" -at_fn_check_prepare_dynamic "diff -b -B $abs_srcdir/expr-testsuite/data.z0.base stdout || diff -b -B $abs_srcdir/expr-testsuite/data.z0.base stderr" "EXPRTest.at:101" -( $at_check_trace; diff -b -B $abs_srcdir/expr-testsuite/data.z0.base stdout || diff -b -B $abs_srcdir/expr-testsuite/data.z0.base stderr -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/EXPRTest.at:101" -$at_failed && at_fn_log_failure -$at_traceon; } - - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_106 -#AT_START_107 -# 107. EXPRTest.at:102: expr-test -b -w $abs_srcdir/expr-testsuite/test.c0 -k SST (pass) -at_setup_line='EXPRTest.at:102' -at_desc="expr-test -b -w \$abs_srcdir/expr-testsuite/test.c0 -k SST (pass)" -at_desc_line="107: $at_desc" -$at_quiet $as_echo_n "$at_desc_line" +at_fn_group_banner 105 'EXPRTest.at:102' \ + "expr-test -b -w \$abs_srcdir/expr-testsuite/test.c0 -k SST (pass)" "" at_xfail=no test "pass" = "xfail" && at_xfail=yes -echo "# -*- compilation -*-" >> "$at_group_log" ( - $as_echo "107. EXPRTest.at:102: testing ..." + $as_echo "105. $at_setup_line: testing $at_desc ..." $at_traceon @@ -7804,7 +7309,7 @@ $as_echo "$at_srcdir/EXPRTest.at:102: \$abs_builddir/expr-test -b -w \$abs_srcdir/expr-testsuite/test.c0 -k SST -f \"dummy\" || true" at_fn_check_prepare_dynamic "$abs_builddir/expr-test -b -w $abs_srcdir/expr-testsuite/test.c0 -k SST -f \"dummy\" || true" "EXPRTest.at:102" ( $at_check_trace; $abs_builddir/expr-test -b -w $abs_srcdir/expr-testsuite/test.c0 -k SST -f "dummy" || true -) >>"$at_stdout" 2>>"$at_stderr" +) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" @@ -7817,7 +7322,7 @@ $as_echo "$at_srcdir/EXPRTest.at:102: diff -b -B \$abs_srcdir/expr-testsuite/data.z1.base stdout || diff -b -B \$abs_srcdir/expr-testsuite/data.z1.base stderr" at_fn_check_prepare_dynamic "diff -b -B $abs_srcdir/expr-testsuite/data.z1.base stdout || diff -b -B $abs_srcdir/expr-testsuite/data.z1.base stderr" "EXPRTest.at:102" ( $at_check_trace; diff -b -B $abs_srcdir/expr-testsuite/data.z1.base stdout || diff -b -B $abs_srcdir/expr-testsuite/data.z1.base stderr -) >>"$at_stdout" 2>>"$at_stderr" +) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: @@ -7829,20 +7334,16 @@ set +x $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 | eval $at_tee_pipe +) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" -#AT_STOP_107 -#AT_START_108 -# 108. EXPRTest.at:102: expr-test -b -W $abs_srcdir/expr-testsuite/test.c0 -k SST (pass) -at_setup_line='EXPRTest.at:102' -at_desc="expr-test -b -W \$abs_srcdir/expr-testsuite/test.c0 -k SST (pass)" -at_desc_line="108: $at_desc" -$at_quiet $as_echo_n "$at_desc_line" +#AT_STOP_105 +#AT_START_106 +at_fn_group_banner 106 'EXPRTest.at:102' \ + "expr-test -b -W \$abs_srcdir/expr-testsuite/test.c0 -k SST (pass)" "" at_xfail=no test "pass" = "xfail" && at_xfail=yes -echo "# -*- compilation -*-" >> "$at_group_log" ( - $as_echo "108. EXPRTest.at:102: testing ..." + $as_echo "106. $at_setup_line: testing $at_desc ..." $at_traceon @@ -7858,7 +7359,7 @@ $as_echo "$at_srcdir/EXPRTest.at:102: \$abs_builddir/expr-test -b -W \$abs_srcdir/expr-testsuite/test.c0 -k SST -f \"dummy\" || true" at_fn_check_prepare_dynamic "$abs_builddir/expr-test -b -W $abs_srcdir/expr-testsuite/test.c0 -k SST -f \"dummy\" || true" "EXPRTest.at:102" ( $at_check_trace; $abs_builddir/expr-test -b -W $abs_srcdir/expr-testsuite/test.c0 -k SST -f "dummy" || true -) >>"$at_stdout" 2>>"$at_stderr" +) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" @@ -7871,7 +7372,7 @@ $as_echo "$at_srcdir/EXPRTest.at:102: diff -b -B \$abs_srcdir/expr-testsuite/data.z1.base stdout || diff -b -B \$abs_srcdir/expr-testsuite/data.z1.base stderr" at_fn_check_prepare_dynamic "diff -b -B $abs_srcdir/expr-testsuite/data.z1.base stdout || diff -b -B $abs_srcdir/expr-testsuite/data.z1.base stderr" "EXPRTest.at:102" ( $at_check_trace; diff -b -B $abs_srcdir/expr-testsuite/data.z1.base stdout || diff -b -B $abs_srcdir/expr-testsuite/data.z1.base stderr -) >>"$at_stdout" 2>>"$at_stderr" +) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: @@ -7883,762 +7384,6 @@ set +x $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_108 -#AT_START_109 -# 109. EXPRTest.at:104: expr-test -b -w $abs_srcdir/expr-testsuite/test.c0 -k "geogrid(SST,61,97,38,160)" (pass) -at_setup_line='EXPRTest.at:104' -at_desc="expr-test -b -w \$abs_srcdir/expr-testsuite/test.c0 -k \"geogrid(SST,61,97,38,160)\" (pass)" -at_desc_line="109: $at_desc" -$at_quiet $as_echo_n "$at_desc_line" -at_xfail=no - test "pass" = "xfail" && at_xfail=yes -echo "# -*- compilation -*-" >> "$at_group_log" -( - $as_echo "109. EXPRTest.at:104: testing ..." - $at_traceon - - - - # Added || true because expr-test returns 0 (failure) for some of - # these tests which is correct for the test - we expect some of - # the input to trigger an error response from the parser, et - # cetera. That's also why we capture both stdout and stderr - - # successful runs are sent to stdout while the errors are sent to - # stderr. - - { set +x -$as_echo "$at_srcdir/EXPRTest.at:104: \$abs_builddir/expr-test -b -w \$abs_srcdir/expr-testsuite/test.c0 -k \"geogrid(SST,61,97,38,160)\" -f \"dummy\" || true" -at_fn_check_prepare_dynamic "$abs_builddir/expr-test -b -w $abs_srcdir/expr-testsuite/test.c0 -k \"geogrid(SST,61,97,38,160)\" -f \"dummy\" || true" "EXPRTest.at:104" -( $at_check_trace; $abs_builddir/expr-test -b -w $abs_srcdir/expr-testsuite/test.c0 -k "geogrid(SST,61,97,38,160)" -f "dummy" || true -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; tee stderr <"$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/EXPRTest.at:104" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/EXPRTest.at:104: diff -b -B \$abs_srcdir/expr-testsuite/data.z2.base stdout || diff -b -B \$abs_srcdir/expr-testsuite/data.z2.base stderr" -at_fn_check_prepare_dynamic "diff -b -B $abs_srcdir/expr-testsuite/data.z2.base stdout || diff -b -B $abs_srcdir/expr-testsuite/data.z2.base stderr" "EXPRTest.at:104" -( $at_check_trace; diff -b -B $abs_srcdir/expr-testsuite/data.z2.base stdout || diff -b -B $abs_srcdir/expr-testsuite/data.z2.base stderr -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/EXPRTest.at:104" -$at_failed && at_fn_log_failure -$at_traceon; } - - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_109 -#AT_START_110 -# 110. EXPRTest.at:104: expr-test -b -W $abs_srcdir/expr-testsuite/test.c0 -k "geogrid(SST,61,97,38,160)" (pass) -at_setup_line='EXPRTest.at:104' -at_desc="expr-test -b -W \$abs_srcdir/expr-testsuite/test.c0 -k \"geogrid(SST,61,97,38,160)\" (pass)" -at_desc_line="110: $at_desc" -$at_quiet $as_echo_n "$at_desc_line" -at_xfail=no - test "pass" = "xfail" && at_xfail=yes -echo "# -*- compilation -*-" >> "$at_group_log" -( - $as_echo "110. EXPRTest.at:104: testing ..." - $at_traceon - - - - # Added || true because expr-test returns 0 (failure) for some of - # these tests which is correct for the test - we expect some of - # the input to trigger an error response from the parser, et - # cetera. That's also why we capture both stdout and stderr - - # successful runs are sent to stdout while the errors are sent to - # stderr. - - { set +x -$as_echo "$at_srcdir/EXPRTest.at:104: \$abs_builddir/expr-test -b -W \$abs_srcdir/expr-testsuite/test.c0 -k \"geogrid(SST,61,97,38,160)\" -f \"dummy\" || true" -at_fn_check_prepare_dynamic "$abs_builddir/expr-test -b -W $abs_srcdir/expr-testsuite/test.c0 -k \"geogrid(SST,61,97,38,160)\" -f \"dummy\" || true" "EXPRTest.at:104" -( $at_check_trace; $abs_builddir/expr-test -b -W $abs_srcdir/expr-testsuite/test.c0 -k "geogrid(SST,61,97,38,160)" -f "dummy" || true -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; tee stderr <"$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/EXPRTest.at:104" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/EXPRTest.at:104: diff -b -B \$abs_srcdir/expr-testsuite/data.z2.base stdout || diff -b -B \$abs_srcdir/expr-testsuite/data.z2.base stderr" -at_fn_check_prepare_dynamic "diff -b -B $abs_srcdir/expr-testsuite/data.z2.base stdout || diff -b -B $abs_srcdir/expr-testsuite/data.z2.base stderr" "EXPRTest.at:104" -( $at_check_trace; diff -b -B $abs_srcdir/expr-testsuite/data.z2.base stdout || diff -b -B $abs_srcdir/expr-testsuite/data.z2.base stderr -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/EXPRTest.at:104" -$at_failed && at_fn_log_failure -$at_traceon; } - - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_110 -#AT_START_111 -# 111. EXPRTest.at:105: expr-test -b -w $abs_srcdir/expr-testsuite/test.c1 -k "geogrid(SST,61,97,38,160)" (pass) -at_setup_line='EXPRTest.at:105' -at_desc="expr-test -b -w \$abs_srcdir/expr-testsuite/test.c1 -k \"geogrid(SST,61,97,38,160)\" (pass)" -at_desc_line="111: $at_desc" -$at_quiet $as_echo_n "$at_desc_line" -at_xfail=no - test "pass" = "xfail" && at_xfail=yes -echo "# -*- compilation -*-" >> "$at_group_log" -( - $as_echo "111. EXPRTest.at:105: testing ..." - $at_traceon - - - - # Added || true because expr-test returns 0 (failure) for some of - # these tests which is correct for the test - we expect some of - # the input to trigger an error response from the parser, et - # cetera. That's also why we capture both stdout and stderr - - # successful runs are sent to stdout while the errors are sent to - # stderr. - - { set +x -$as_echo "$at_srcdir/EXPRTest.at:105: \$abs_builddir/expr-test -b -w \$abs_srcdir/expr-testsuite/test.c1 -k \"geogrid(SST,61,97,38,160)\" -f \"dummy\" || true" -at_fn_check_prepare_dynamic "$abs_builddir/expr-test -b -w $abs_srcdir/expr-testsuite/test.c1 -k \"geogrid(SST,61,97,38,160)\" -f \"dummy\" || true" "EXPRTest.at:105" -( $at_check_trace; $abs_builddir/expr-test -b -w $abs_srcdir/expr-testsuite/test.c1 -k "geogrid(SST,61,97,38,160)" -f "dummy" || true -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; tee stderr <"$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/EXPRTest.at:105" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/EXPRTest.at:105: diff -b -B \$abs_srcdir/expr-testsuite/data.z3.base stdout || diff -b -B \$abs_srcdir/expr-testsuite/data.z3.base stderr" -at_fn_check_prepare_dynamic "diff -b -B $abs_srcdir/expr-testsuite/data.z3.base stdout || diff -b -B $abs_srcdir/expr-testsuite/data.z3.base stderr" "EXPRTest.at:105" -( $at_check_trace; diff -b -B $abs_srcdir/expr-testsuite/data.z3.base stdout || diff -b -B $abs_srcdir/expr-testsuite/data.z3.base stderr -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/EXPRTest.at:105" -$at_failed && at_fn_log_failure -$at_traceon; } - - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 | eval $at_tee_pipe +) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" -#AT_STOP_111 -#AT_START_112 -# 112. EXPRTest.at:105: expr-test -b -W $abs_srcdir/expr-testsuite/test.c1 -k "geogrid(SST,61,97,38,160)" (pass) -at_setup_line='EXPRTest.at:105' -at_desc="expr-test -b -W \$abs_srcdir/expr-testsuite/test.c1 -k \"geogrid(SST,61,97,38,160)\" (pass)" -at_desc_line="112: $at_desc" -$at_quiet $as_echo_n "$at_desc_line" -at_xfail=no - test "pass" = "xfail" && at_xfail=yes -echo "# -*- compilation -*-" >> "$at_group_log" -( - $as_echo "112. EXPRTest.at:105: testing ..." - $at_traceon - - - - # Added || true because expr-test returns 0 (failure) for some of - # these tests which is correct for the test - we expect some of - # the input to trigger an error response from the parser, et - # cetera. That's also why we capture both stdout and stderr - - # successful runs are sent to stdout while the errors are sent to - # stderr. - - { set +x -$as_echo "$at_srcdir/EXPRTest.at:105: \$abs_builddir/expr-test -b -W \$abs_srcdir/expr-testsuite/test.c1 -k \"geogrid(SST,61,97,38,160)\" -f \"dummy\" || true" -at_fn_check_prepare_dynamic "$abs_builddir/expr-test -b -W $abs_srcdir/expr-testsuite/test.c1 -k \"geogrid(SST,61,97,38,160)\" -f \"dummy\" || true" "EXPRTest.at:105" -( $at_check_trace; $abs_builddir/expr-test -b -W $abs_srcdir/expr-testsuite/test.c1 -k "geogrid(SST,61,97,38,160)" -f "dummy" || true -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; tee stderr <"$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/EXPRTest.at:105" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/EXPRTest.at:105: diff -b -B \$abs_srcdir/expr-testsuite/data.z3.base stdout || diff -b -B \$abs_srcdir/expr-testsuite/data.z3.base stderr" -at_fn_check_prepare_dynamic "diff -b -B $abs_srcdir/expr-testsuite/data.z3.base stdout || diff -b -B $abs_srcdir/expr-testsuite/data.z3.base stderr" "EXPRTest.at:105" -( $at_check_trace; diff -b -B $abs_srcdir/expr-testsuite/data.z3.base stdout || diff -b -B $abs_srcdir/expr-testsuite/data.z3.base stderr -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/EXPRTest.at:105" -$at_failed && at_fn_log_failure -$at_traceon; } - - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_112 -#AT_START_113 -# 113. EXPRTest.at:106: expr-test -b -w $abs_srcdir/expr-testsuite/test.c2 -k "geogrid(SST,61,97,38,160)" (pass) -at_setup_line='EXPRTest.at:106' -at_desc="expr-test -b -w \$abs_srcdir/expr-testsuite/test.c2 -k \"geogrid(SST,61,97,38,160)\" (pass)" -at_desc_line="113: $at_desc" -$at_quiet $as_echo_n "$at_desc_line" -at_xfail=no - test "pass" = "xfail" && at_xfail=yes -echo "# -*- compilation -*-" >> "$at_group_log" -( - $as_echo "113. EXPRTest.at:106: testing ..." - $at_traceon - - - - # Added || true because expr-test returns 0 (failure) for some of - # these tests which is correct for the test - we expect some of - # the input to trigger an error response from the parser, et - # cetera. That's also why we capture both stdout and stderr - - # successful runs are sent to stdout while the errors are sent to - # stderr. - - { set +x -$as_echo "$at_srcdir/EXPRTest.at:106: \$abs_builddir/expr-test -b -w \$abs_srcdir/expr-testsuite/test.c2 -k \"geogrid(SST,61,97,38,160)\" -f \"dummy\" || true" -at_fn_check_prepare_dynamic "$abs_builddir/expr-test -b -w $abs_srcdir/expr-testsuite/test.c2 -k \"geogrid(SST,61,97,38,160)\" -f \"dummy\" || true" "EXPRTest.at:106" -( $at_check_trace; $abs_builddir/expr-test -b -w $abs_srcdir/expr-testsuite/test.c2 -k "geogrid(SST,61,97,38,160)" -f "dummy" || true -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; tee stderr <"$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/EXPRTest.at:106" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/EXPRTest.at:106: diff -b -B \$abs_srcdir/expr-testsuite/data.z4.base stdout || diff -b -B \$abs_srcdir/expr-testsuite/data.z4.base stderr" -at_fn_check_prepare_dynamic "diff -b -B $abs_srcdir/expr-testsuite/data.z4.base stdout || diff -b -B $abs_srcdir/expr-testsuite/data.z4.base stderr" "EXPRTest.at:106" -( $at_check_trace; diff -b -B $abs_srcdir/expr-testsuite/data.z4.base stdout || diff -b -B $abs_srcdir/expr-testsuite/data.z4.base stderr -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/EXPRTest.at:106" -$at_failed && at_fn_log_failure -$at_traceon; } - - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_113 -#AT_START_114 -# 114. EXPRTest.at:106: expr-test -b -W $abs_srcdir/expr-testsuite/test.c2 -k "geogrid(SST,61,97,38,160)" (pass) -at_setup_line='EXPRTest.at:106' -at_desc="expr-test -b -W \$abs_srcdir/expr-testsuite/test.c2 -k \"geogrid(SST,61,97,38,160)\" (pass)" -at_desc_line="114: $at_desc" -$at_quiet $as_echo_n "$at_desc_line" -at_xfail=no - test "pass" = "xfail" && at_xfail=yes -echo "# -*- compilation -*-" >> "$at_group_log" -( - $as_echo "114. EXPRTest.at:106: testing ..." - $at_traceon - - - - # Added || true because expr-test returns 0 (failure) for some of - # these tests which is correct for the test - we expect some of - # the input to trigger an error response from the parser, et - # cetera. That's also why we capture both stdout and stderr - - # successful runs are sent to stdout while the errors are sent to - # stderr. - - { set +x -$as_echo "$at_srcdir/EXPRTest.at:106: \$abs_builddir/expr-test -b -W \$abs_srcdir/expr-testsuite/test.c2 -k \"geogrid(SST,61,97,38,160)\" -f \"dummy\" || true" -at_fn_check_prepare_dynamic "$abs_builddir/expr-test -b -W $abs_srcdir/expr-testsuite/test.c2 -k \"geogrid(SST,61,97,38,160)\" -f \"dummy\" || true" "EXPRTest.at:106" -( $at_check_trace; $abs_builddir/expr-test -b -W $abs_srcdir/expr-testsuite/test.c2 -k "geogrid(SST,61,97,38,160)" -f "dummy" || true -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; tee stderr <"$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/EXPRTest.at:106" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/EXPRTest.at:106: diff -b -B \$abs_srcdir/expr-testsuite/data.z4.base stdout || diff -b -B \$abs_srcdir/expr-testsuite/data.z4.base stderr" -at_fn_check_prepare_dynamic "diff -b -B $abs_srcdir/expr-testsuite/data.z4.base stdout || diff -b -B $abs_srcdir/expr-testsuite/data.z4.base stderr" "EXPRTest.at:106" -( $at_check_trace; diff -b -B $abs_srcdir/expr-testsuite/data.z4.base stdout || diff -b -B $abs_srcdir/expr-testsuite/data.z4.base stderr -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/EXPRTest.at:106" -$at_failed && at_fn_log_failure -$at_traceon; } - - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_114 -#AT_START_115 -# 115. EXPRTest.at:107: expr-test -b -w $abs_srcdir/expr-testsuite/test.c2 -k "geogrid(SST,61,97,38,160,\"time=1024\")" (pass) -at_setup_line='EXPRTest.at:107' -at_desc="expr-test -b -w \$abs_srcdir/expr-testsuite/test.c2 -k \"geogrid(SST,61,97,38,160,\\\"time=1024\\\")\" (pass)" -at_desc_line="115: $at_desc" -$at_quiet $as_echo_n "$at_desc_line" -at_xfail=no - test "pass" = "xfail" && at_xfail=yes -echo "# -*- compilation -*-" >> "$at_group_log" -( - $as_echo "115. EXPRTest.at:107: testing ..." - $at_traceon - - - - # Added || true because expr-test returns 0 (failure) for some of - # these tests which is correct for the test - we expect some of - # the input to trigger an error response from the parser, et - # cetera. That's also why we capture both stdout and stderr - - # successful runs are sent to stdout while the errors are sent to - # stderr. - - { set +x -$as_echo "$at_srcdir/EXPRTest.at:107: \$abs_builddir/expr-test -b -w \$abs_srcdir/expr-testsuite/test.c2 -k \"geogrid(SST,61,97,38,160,\\\"time=1024\\\")\" -f \"dummy\" || true" -at_fn_check_prepare_dynamic "$abs_builddir/expr-test -b -w $abs_srcdir/expr-testsuite/test.c2 -k \"geogrid(SST,61,97,38,160,\\\"time=1024\\\")\" -f \"dummy\" || true" "EXPRTest.at:107" -( $at_check_trace; $abs_builddir/expr-test -b -w $abs_srcdir/expr-testsuite/test.c2 -k "geogrid(SST,61,97,38,160,\"time=1024\")" -f "dummy" || true -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; tee stderr <"$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/EXPRTest.at:107" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/EXPRTest.at:107: diff -b -B \$abs_srcdir/expr-testsuite/data.z5.base stdout || diff -b -B \$abs_srcdir/expr-testsuite/data.z5.base stderr" -at_fn_check_prepare_dynamic "diff -b -B $abs_srcdir/expr-testsuite/data.z5.base stdout || diff -b -B $abs_srcdir/expr-testsuite/data.z5.base stderr" "EXPRTest.at:107" -( $at_check_trace; diff -b -B $abs_srcdir/expr-testsuite/data.z5.base stdout || diff -b -B $abs_srcdir/expr-testsuite/data.z5.base stderr -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/EXPRTest.at:107" -$at_failed && at_fn_log_failure -$at_traceon; } - - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_115 -#AT_START_116 -# 116. EXPRTest.at:107: expr-test -b -W $abs_srcdir/expr-testsuite/test.c2 -k "geogrid(SST,61,97,38,160,\"time=1024\")" (pass) -at_setup_line='EXPRTest.at:107' -at_desc="expr-test -b -W \$abs_srcdir/expr-testsuite/test.c2 -k \"geogrid(SST,61,97,38,160,\\\"time=1024\\\")\" (pass)" -at_desc_line="116: $at_desc" -$at_quiet $as_echo_n "$at_desc_line" -at_xfail=no - test "pass" = "xfail" && at_xfail=yes -echo "# -*- compilation -*-" >> "$at_group_log" -( - $as_echo "116. EXPRTest.at:107: testing ..." - $at_traceon - - - - # Added || true because expr-test returns 0 (failure) for some of - # these tests which is correct for the test - we expect some of - # the input to trigger an error response from the parser, et - # cetera. That's also why we capture both stdout and stderr - - # successful runs are sent to stdout while the errors are sent to - # stderr. - - { set +x -$as_echo "$at_srcdir/EXPRTest.at:107: \$abs_builddir/expr-test -b -W \$abs_srcdir/expr-testsuite/test.c2 -k \"geogrid(SST,61,97,38,160,\\\"time=1024\\\")\" -f \"dummy\" || true" -at_fn_check_prepare_dynamic "$abs_builddir/expr-test -b -W $abs_srcdir/expr-testsuite/test.c2 -k \"geogrid(SST,61,97,38,160,\\\"time=1024\\\")\" -f \"dummy\" || true" "EXPRTest.at:107" -( $at_check_trace; $abs_builddir/expr-test -b -W $abs_srcdir/expr-testsuite/test.c2 -k "geogrid(SST,61,97,38,160,\"time=1024\")" -f "dummy" || true -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; tee stderr <"$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/EXPRTest.at:107" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/EXPRTest.at:107: diff -b -B \$abs_srcdir/expr-testsuite/data.z5.base stdout || diff -b -B \$abs_srcdir/expr-testsuite/data.z5.base stderr" -at_fn_check_prepare_dynamic "diff -b -B $abs_srcdir/expr-testsuite/data.z5.base stdout || diff -b -B $abs_srcdir/expr-testsuite/data.z5.base stderr" "EXPRTest.at:107" -( $at_check_trace; diff -b -B $abs_srcdir/expr-testsuite/data.z5.base stdout || diff -b -B $abs_srcdir/expr-testsuite/data.z5.base stderr -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/EXPRTest.at:107" -$at_failed && at_fn_log_failure -$at_traceon; } - - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_116 -#AT_START_117 -# 117. EXPRTest.at:108: expr-test -b -w $abs_srcdir/expr-testsuite/test.c3 -k "geogrid(SST,61,97,38,160)" (pass) -at_setup_line='EXPRTest.at:108' -at_desc="expr-test -b -w \$abs_srcdir/expr-testsuite/test.c3 -k \"geogrid(SST,61,97,38,160)\" (pass)" -at_desc_line="117: $at_desc" -$at_quiet $as_echo_n "$at_desc_line" -at_xfail=no - test "pass" = "xfail" && at_xfail=yes -echo "# -*- compilation -*-" >> "$at_group_log" -( - $as_echo "117. EXPRTest.at:108: testing ..." - $at_traceon - - - - # Added || true because expr-test returns 0 (failure) for some of - # these tests which is correct for the test - we expect some of - # the input to trigger an error response from the parser, et - # cetera. That's also why we capture both stdout and stderr - - # successful runs are sent to stdout while the errors are sent to - # stderr. - - { set +x -$as_echo "$at_srcdir/EXPRTest.at:108: \$abs_builddir/expr-test -b -w \$abs_srcdir/expr-testsuite/test.c3 -k \"geogrid(SST,61,97,38,160)\" -f \"dummy\" || true" -at_fn_check_prepare_dynamic "$abs_builddir/expr-test -b -w $abs_srcdir/expr-testsuite/test.c3 -k \"geogrid(SST,61,97,38,160)\" -f \"dummy\" || true" "EXPRTest.at:108" -( $at_check_trace; $abs_builddir/expr-test -b -w $abs_srcdir/expr-testsuite/test.c3 -k "geogrid(SST,61,97,38,160)" -f "dummy" || true -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; tee stderr <"$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/EXPRTest.at:108" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/EXPRTest.at:108: diff -b -B \$abs_srcdir/expr-testsuite/data.z6.base stdout || diff -b -B \$abs_srcdir/expr-testsuite/data.z6.base stderr" -at_fn_check_prepare_dynamic "diff -b -B $abs_srcdir/expr-testsuite/data.z6.base stdout || diff -b -B $abs_srcdir/expr-testsuite/data.z6.base stderr" "EXPRTest.at:108" -( $at_check_trace; diff -b -B $abs_srcdir/expr-testsuite/data.z6.base stdout || diff -b -B $abs_srcdir/expr-testsuite/data.z6.base stderr -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/EXPRTest.at:108" -$at_failed && at_fn_log_failure -$at_traceon; } - - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_117 -#AT_START_118 -# 118. EXPRTest.at:108: expr-test -b -W $abs_srcdir/expr-testsuite/test.c3 -k "geogrid(SST,61,97,38,160)" (pass) -at_setup_line='EXPRTest.at:108' -at_desc="expr-test -b -W \$abs_srcdir/expr-testsuite/test.c3 -k \"geogrid(SST,61,97,38,160)\" (pass)" -at_desc_line="118: $at_desc" -$at_quiet $as_echo_n "$at_desc_line" -at_xfail=no - test "pass" = "xfail" && at_xfail=yes -echo "# -*- compilation -*-" >> "$at_group_log" -( - $as_echo "118. EXPRTest.at:108: testing ..." - $at_traceon - - - - # Added || true because expr-test returns 0 (failure) for some of - # these tests which is correct for the test - we expect some of - # the input to trigger an error response from the parser, et - # cetera. That's also why we capture both stdout and stderr - - # successful runs are sent to stdout while the errors are sent to - # stderr. - - { set +x -$as_echo "$at_srcdir/EXPRTest.at:108: \$abs_builddir/expr-test -b -W \$abs_srcdir/expr-testsuite/test.c3 -k \"geogrid(SST,61,97,38,160)\" -f \"dummy\" || true" -at_fn_check_prepare_dynamic "$abs_builddir/expr-test -b -W $abs_srcdir/expr-testsuite/test.c3 -k \"geogrid(SST,61,97,38,160)\" -f \"dummy\" || true" "EXPRTest.at:108" -( $at_check_trace; $abs_builddir/expr-test -b -W $abs_srcdir/expr-testsuite/test.c3 -k "geogrid(SST,61,97,38,160)" -f "dummy" || true -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; tee stderr <"$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/EXPRTest.at:108" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/EXPRTest.at:108: diff -b -B \$abs_srcdir/expr-testsuite/data.z6.base stdout || diff -b -B \$abs_srcdir/expr-testsuite/data.z6.base stderr" -at_fn_check_prepare_dynamic "diff -b -B $abs_srcdir/expr-testsuite/data.z6.base stdout || diff -b -B $abs_srcdir/expr-testsuite/data.z6.base stderr" "EXPRTest.at:108" -( $at_check_trace; diff -b -B $abs_srcdir/expr-testsuite/data.z6.base stdout || diff -b -B $abs_srcdir/expr-testsuite/data.z6.base stderr -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/EXPRTest.at:108" -$at_failed && at_fn_log_failure -$at_traceon; } - - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_118 -#AT_START_119 -# 119. EXPRTest.at:109: expr-test -b -w $abs_srcdir/expr-testsuite/test.c4 -k "geogrid(SST,61,97,38,160,\"time=1024\")" (pass) -at_setup_line='EXPRTest.at:109' -at_desc="expr-test -b -w \$abs_srcdir/expr-testsuite/test.c4 -k \"geogrid(SST,61,97,38,160,\\\"time=1024\\\")\" (pass)" -at_desc_line="119: $at_desc" -$at_quiet $as_echo_n "$at_desc_line" -at_xfail=no - test "pass" = "xfail" && at_xfail=yes -echo "# -*- compilation -*-" >> "$at_group_log" -( - $as_echo "119. EXPRTest.at:109: testing ..." - $at_traceon - - - - # Added || true because expr-test returns 0 (failure) for some of - # these tests which is correct for the test - we expect some of - # the input to trigger an error response from the parser, et - # cetera. That's also why we capture both stdout and stderr - - # successful runs are sent to stdout while the errors are sent to - # stderr. - - { set +x -$as_echo "$at_srcdir/EXPRTest.at:109: \$abs_builddir/expr-test -b -w \$abs_srcdir/expr-testsuite/test.c4 -k \"geogrid(SST,61,97,38,160,\\\"time=1024\\\")\" -f \"dummy\" || true" -at_fn_check_prepare_dynamic "$abs_builddir/expr-test -b -w $abs_srcdir/expr-testsuite/test.c4 -k \"geogrid(SST,61,97,38,160,\\\"time=1024\\\")\" -f \"dummy\" || true" "EXPRTest.at:109" -( $at_check_trace; $abs_builddir/expr-test -b -w $abs_srcdir/expr-testsuite/test.c4 -k "geogrid(SST,61,97,38,160,\"time=1024\")" -f "dummy" || true -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; tee stderr <"$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/EXPRTest.at:109" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/EXPRTest.at:109: diff -b -B \$abs_srcdir/expr-testsuite/data.z7.base stdout || diff -b -B \$abs_srcdir/expr-testsuite/data.z7.base stderr" -at_fn_check_prepare_dynamic "diff -b -B $abs_srcdir/expr-testsuite/data.z7.base stdout || diff -b -B $abs_srcdir/expr-testsuite/data.z7.base stderr" "EXPRTest.at:109" -( $at_check_trace; diff -b -B $abs_srcdir/expr-testsuite/data.z7.base stdout || diff -b -B $abs_srcdir/expr-testsuite/data.z7.base stderr -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/EXPRTest.at:109" -$at_failed && at_fn_log_failure -$at_traceon; } - - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_119 -#AT_START_120 -# 120. EXPRTest.at:109: expr-test -b -W $abs_srcdir/expr-testsuite/test.c4 -k "geogrid(SST,61,97,38,160,\"time=1024\")" (pass) -at_setup_line='EXPRTest.at:109' -at_desc="expr-test -b -W \$abs_srcdir/expr-testsuite/test.c4 -k \"geogrid(SST,61,97,38,160,\\\"time=1024\\\")\" (pass)" -at_desc_line="120: $at_desc" -$at_quiet $as_echo_n "$at_desc_line" -at_xfail=no - test "pass" = "xfail" && at_xfail=yes -echo "# -*- compilation -*-" >> "$at_group_log" -( - $as_echo "120. EXPRTest.at:109: testing ..." - $at_traceon - - - - # Added || true because expr-test returns 0 (failure) for some of - # these tests which is correct for the test - we expect some of - # the input to trigger an error response from the parser, et - # cetera. That's also why we capture both stdout and stderr - - # successful runs are sent to stdout while the errors are sent to - # stderr. - - { set +x -$as_echo "$at_srcdir/EXPRTest.at:109: \$abs_builddir/expr-test -b -W \$abs_srcdir/expr-testsuite/test.c4 -k \"geogrid(SST,61,97,38,160,\\\"time=1024\\\")\" -f \"dummy\" || true" -at_fn_check_prepare_dynamic "$abs_builddir/expr-test -b -W $abs_srcdir/expr-testsuite/test.c4 -k \"geogrid(SST,61,97,38,160,\\\"time=1024\\\")\" -f \"dummy\" || true" "EXPRTest.at:109" -( $at_check_trace; $abs_builddir/expr-test -b -W $abs_srcdir/expr-testsuite/test.c4 -k "geogrid(SST,61,97,38,160,\"time=1024\")" -f "dummy" || true -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; tee stderr <"$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/EXPRTest.at:109" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/EXPRTest.at:109: diff -b -B \$abs_srcdir/expr-testsuite/data.z7.base stdout || diff -b -B \$abs_srcdir/expr-testsuite/data.z7.base stderr" -at_fn_check_prepare_dynamic "diff -b -B $abs_srcdir/expr-testsuite/data.z7.base stdout || diff -b -B $abs_srcdir/expr-testsuite/data.z7.base stderr" "EXPRTest.at:109" -( $at_check_trace; diff -b -B $abs_srcdir/expr-testsuite/data.z7.base stdout || diff -b -B $abs_srcdir/expr-testsuite/data.z7.base stderr -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/EXPRTest.at:109" -$at_failed && at_fn_log_failure -$at_traceon; } - - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_120 -#AT_START_121 -# 121. EXPRTest.at:110: expr-test -b -w $abs_srcdir/expr-testsuite/test.c5 -k "geogrid(SST,61,97,38,160),geogrid(AIRT,61,97,38,160)" (pass) -at_setup_line='EXPRTest.at:110' -at_desc="expr-test -b -w \$abs_srcdir/expr-testsuite/test.c5 -k \"geogrid(SST,61,97,38,160),geogrid(AIRT,61,97,38,160)\" (pass)" -at_desc_line="121: $at_desc" -$at_quiet $as_echo_n "$at_desc_line" -at_xfail=no - test "pass" = "xfail" && at_xfail=yes -echo "# -*- compilation -*-" >> "$at_group_log" -( - $as_echo "121. EXPRTest.at:110: testing ..." - $at_traceon - - - - # Added || true because expr-test returns 0 (failure) for some of - # these tests which is correct for the test - we expect some of - # the input to trigger an error response from the parser, et - # cetera. That's also why we capture both stdout and stderr - - # successful runs are sent to stdout while the errors are sent to - # stderr. - - { set +x -$as_echo "$at_srcdir/EXPRTest.at:110: \$abs_builddir/expr-test -b -w \$abs_srcdir/expr-testsuite/test.c5 -k \"geogrid(SST,61,97,38,160),geogrid(AIRT,61,97,38,160)\" -f \"dummy\" || true" -at_fn_check_prepare_dynamic "$abs_builddir/expr-test -b -w $abs_srcdir/expr-testsuite/test.c5 -k \"geogrid(SST,61,97,38,160),geogrid(AIRT,61,97,38,160)\" -f \"dummy\" || true" "EXPRTest.at:110" -( $at_check_trace; $abs_builddir/expr-test -b -w $abs_srcdir/expr-testsuite/test.c5 -k "geogrid(SST,61,97,38,160),geogrid(AIRT,61,97,38,160)" -f "dummy" || true -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; tee stderr <"$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/EXPRTest.at:110" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/EXPRTest.at:110: diff -b -B \$abs_srcdir/expr-testsuite/data.z8.base stdout || diff -b -B \$abs_srcdir/expr-testsuite/data.z8.base stderr" -at_fn_check_prepare_dynamic "diff -b -B $abs_srcdir/expr-testsuite/data.z8.base stdout || diff -b -B $abs_srcdir/expr-testsuite/data.z8.base stderr" "EXPRTest.at:110" -( $at_check_trace; diff -b -B $abs_srcdir/expr-testsuite/data.z8.base stdout || diff -b -B $abs_srcdir/expr-testsuite/data.z8.base stderr -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/EXPRTest.at:110" -$at_failed && at_fn_log_failure -$at_traceon; } - - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_121 -#AT_START_122 -# 122. EXPRTest.at:110: expr-test -b -W $abs_srcdir/expr-testsuite/test.c5 -k "geogrid(SST,61,97,38,160),geogrid(AIRT,61,97,38,160)" (pass) -at_setup_line='EXPRTest.at:110' -at_desc="expr-test -b -W \$abs_srcdir/expr-testsuite/test.c5 -k \"geogrid(SST,61,97,38,160),geogrid(AIRT,61,97,38,160)\" (pass)" -at_desc_line="122: $at_desc" -$at_quiet $as_echo_n "$at_desc_line" -at_xfail=no - test "pass" = "xfail" && at_xfail=yes -echo "# -*- compilation -*-" >> "$at_group_log" -( - $as_echo "122. EXPRTest.at:110: testing ..." - $at_traceon - - - - # Added || true because expr-test returns 0 (failure) for some of - # these tests which is correct for the test - we expect some of - # the input to trigger an error response from the parser, et - # cetera. That's also why we capture both stdout and stderr - - # successful runs are sent to stdout while the errors are sent to - # stderr. - - { set +x -$as_echo "$at_srcdir/EXPRTest.at:110: \$abs_builddir/expr-test -b -W \$abs_srcdir/expr-testsuite/test.c5 -k \"geogrid(SST,61,97,38,160),geogrid(AIRT,61,97,38,160)\" -f \"dummy\" || true" -at_fn_check_prepare_dynamic "$abs_builddir/expr-test -b -W $abs_srcdir/expr-testsuite/test.c5 -k \"geogrid(SST,61,97,38,160),geogrid(AIRT,61,97,38,160)\" -f \"dummy\" || true" "EXPRTest.at:110" -( $at_check_trace; $abs_builddir/expr-test -b -W $abs_srcdir/expr-testsuite/test.c5 -k "geogrid(SST,61,97,38,160),geogrid(AIRT,61,97,38,160)" -f "dummy" || true -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -echo stderr:; tee stderr <"$at_stderr" -echo stdout:; tee stdout <"$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/EXPRTest.at:110" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/EXPRTest.at:110: diff -b -B \$abs_srcdir/expr-testsuite/data.z8.base stdout || diff -b -B \$abs_srcdir/expr-testsuite/data.z8.base stderr" -at_fn_check_prepare_dynamic "diff -b -B $abs_srcdir/expr-testsuite/data.z8.base stdout || diff -b -B $abs_srcdir/expr-testsuite/data.z8.base stderr" "EXPRTest.at:110" -( $at_check_trace; diff -b -B $abs_srcdir/expr-testsuite/data.z8.base stdout || diff -b -B $abs_srcdir/expr-testsuite/data.z8.base stderr -) >>"$at_stdout" 2>>"$at_stderr" -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/EXPRTest.at:110" -$at_failed && at_fn_log_failure -$at_traceon; } - - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_122 +#AT_STOP_106 diff -Nru libdap-3.11.1/tests/EXPRTest.at libdap-3.12.0/tests/EXPRTest.at --- libdap-3.11.1/tests/EXPRTest.at 2011-04-29 13:19:29.000000000 +0000 +++ libdap-3.12.0/tests/EXPRTest.at 2013-10-17 21:27:40.000000000 +0000 @@ -98,16 +98,16 @@ EXPR_RESPONSE_B([test.61], [ i[[0:2]][[0:2]] ], [data.61b], [pass]) EXPR_RESPONSE_B([test.61], [ i[[1:2]][[0:2]] ], [data.61c], [pass]) EXPR_RESPONSE_B([test.61], [ i[[1:2]][[1:2]] ], [data.61d], [pass]) -EXPR_RESPONSE_B([test.c0], ["geogrid(SST)"], [data.z0], [pass]) +# EXPR_RESPONSE_B([test.c0], ["geogrid(SST)"], [data.z0], [pass]) EXPR_RESPONSE_B([test.c0], [SST], [data.z1], [pass]) -EXPR_RESPONSE_B([test.c0], ["geogrid(SST,61,97,38,160)"], [data.z2], [pass]) -EXPR_RESPONSE_B([test.c1], ["geogrid(SST,61,97,38,160)"], [data.z3], [pass]) -EXPR_RESPONSE_B([test.c2], ["geogrid(SST,61,97,38,160)"], [data.z4], [pass]) -EXPR_RESPONSE_B([test.c2], ["geogrid(SST,61,97,38,160,\"time=1024\")"], [data.z5], [pass]) -EXPR_RESPONSE_B([test.c3], ["geogrid(SST,61,97,38,160)"], [data.z6], [pass]) -EXPR_RESPONSE_B([test.c4], ["geogrid(SST,61,97,38,160,\"time=1024\")"], [data.z7], [pass]) -EXPR_RESPONSE_B([test.c5], ["geogrid(SST,61,97,38,160),geogrid(AIRT,61,97,38,160)"], [data.z8], [pass]) +#EXPR_RESPONSE_B([test.c0], ["geogrid(SST,61,97,38,160)"], [data.z2], [pass]) +#EXPR_RESPONSE_B([test.c1], ["geogrid(SST,61,97,38,160)"], [data.z3], [pass]) +#EXPR_RESPONSE_B([test.c2], ["geogrid(SST,61,97,38,160)"], [data.z4], [pass]) +#EXPR_RESPONSE_B([test.c2], ["geogrid(SST,61,97,38,160,\"time=1024\")"], [data.z5], [pass]) +#EXPR_RESPONSE_B([test.c3], ["geogrid(SST,61,97,38,160)"], [data.z6], [pass]) +#EXPR_RESPONSE_B([test.c4], ["geogrid(SST,61,97,38,160,\"time=1024\")"], [data.z7], [pass]) +#EXPR_RESPONSE_B([test.c5], ["geogrid(SST,61,97,38,160),geogrid(AIRT,61,97,38,160)"], [data.z8], [pass]) # EXPR_RESPONSE_B([test.c0], ["geogrid(SST,lat,lon,61,97,38,160)"], [data.z2], [pass]) # EXPR_RESPONSE_B([test.c1], ["geogrid(SST,lat_reversed,lon,61,97,38,160)"], [data.z3], [pass]) diff -Nru libdap-3.11.1/tests/Makefile.am libdap-3.12.0/tests/Makefile.am --- libdap-3.11.1/tests/Makefile.am 2011-04-29 13:19:30.000000000 +0000 +++ libdap-3.12.0/tests/Makefile.am 2013-10-17 21:27:40.000000000 +0000 @@ -3,31 +3,35 @@ AUTOMAKE_OPTIONS = foreign # Arrange to build with the backward compatibility mode enabled. -AM_CPPFLAGS = -I$(top_srcdir) -I$(top_srcdir)/GNU +AM_CPPFLAGS = -I$(top_srcdir) -I$(top_srcdir)/GNU $(XML2_CFLAGS) $(CURL_CFLAGS) AM_CXXFLAGS = +if COMPILER_IS_GCC +AM_CXXFLAGS += -Wall -W -Wcast-align +endif + # These are not used by automake but are often useful for certain types of # debugging. -CXXFLAGS_DEBUG = -g3 -O0 -fno-defer-pop -Wall -W -Wcast-align -Werror +CXXFLAGS_DEBUG = -g3 -O0 -Wall -W -Wcast-align TEST_COV_FLAGS = -ftest-coverage -fprofile-arcs check_PROGRAMS = das-test dds-test expr-test -# noinst_PROGRAMS = io_test TESTS = DASTest DDSTest EXPRTest -# EXPRTest dist_check_SCRIPTS = DASTest DDSTest EXPRTest atconfig atlocal -##CLEANFILES = *.log *.sum - # Build the test drivers. The drivers all use the # subclassed types in Test*.cc and the TestTypesFactory. -noinst_LIBRARIES = libtest-types.a +#noinst_LIBRARIES = libtest-types.a +lib_LIBRARIES = libtest-types.a libtest_types_a_SOURCES = $(TESTSRCS) $(TEST_HDR) +testheadersdir = $(pkgincludedir)/test +testheaders_HEADERS = $(TEST_HDR) + # io_test_SOURCES = io_test.cc # io_test_LDADD = ../libdap.la @@ -37,7 +41,7 @@ dds_test_SOURCES = dds-test.cc dds_test_LDADD = libtest-types.a ../libdapserver.la ../libdap.la -expr_test_SOURCES = expr-test.cc +expr_test_SOURCES = expr-test.cc ResponseBuilder.cc ResponseBuilder.h expr_test_LDADD = libtest-types.a ../libdapserver.la ../libdapclient.la ../libdap.la TESTSRCS = TestByte.cc TestInt32.cc TestFloat64.cc TestStr.cc TestUrl.cc \ @@ -51,10 +55,6 @@ DIRS_EXTRA = das-testsuite dds-testsuite expr-testsuite -# grid-func-testsuite cache-testsuite ais_testsuite rcreader-testsuite -# server-testsuite cgi-util-tests -# ddx-testsuite - EXTRA_DIST = DASTest.at $(DASTESTSUITE) DDSTest.at $(DDSTESTSUITE) \ EXPRTest.at $(EXPRTESTSUITE) atlocal.in $(srcdir)/package.m4 \ $(DIRS_EXTRA) diff -Nru libdap-3.11.1/tests/Makefile.in libdap-3.12.0/tests/Makefile.in --- libdap-3.11.1/tests/Makefile.in 2011-05-06 17:36:28.000000000 +0000 +++ libdap-3.12.0/tests/Makefile.in 2013-10-17 21:27:40.000000000 +0000 @@ -1,9 +1,9 @@ -# Makefile.in generated by automake 1.11 from Makefile.am. +# Makefile.in generated by automake 1.12 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, -# 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, -# Inc. +# 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software +# Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. @@ -17,7 +17,25 @@ # Tests + VPATH = @srcdir@ +am__make_dryrun = \ + { \ + am__dry=no; \ + case $$MAKEFLAGS in \ + *\\[\ \ ]*) \ + echo 'am--echo: ; @echo "AM" OK' | $(MAKE) -f - 2>/dev/null \ + | grep '^AM OK$$' >/dev/null || am__dry=yes;; \ + *) \ + for am__flg in $$MAKEFLAGS; do \ + case $$am__flg in \ + *=*|--*) ;; \ + *n*) am__dry=yes; break;; \ + esac; \ + done;; \ + esac; \ + test $$am__dry = yes; \ + } pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ @@ -35,15 +53,17 @@ POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ +@COMPILER_IS_GCC_TRUE@am__append_1 = -Wall -W -Wcast-align check_PROGRAMS = das-test$(EXEEXT) dds-test$(EXEEXT) \ expr-test$(EXEEXT) subdir = tests DIST_COMMON = README $(dist_check_SCRIPTS) $(srcdir)/Makefile.am \ - $(srcdir)/Makefile.in $(srcdir)/atlocal.in + $(srcdir)/Makefile.in $(srcdir)/atlocal.in \ + $(testheaders_HEADERS) $(top_srcdir)/conf/depcomp ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/gl/m4/00gnulib.m4 \ $(top_srcdir)/gl/m4/alloca.m4 $(top_srcdir)/gl/m4/btowc.m4 \ - $(top_srcdir)/gl/m4/codeset.m4 \ + $(top_srcdir)/gl/m4/byteswap.m4 $(top_srcdir)/gl/m4/codeset.m4 \ $(top_srcdir)/gl/m4/configmake.m4 \ $(top_srcdir)/gl/m4/extensions.m4 \ $(top_srcdir)/gl/m4/fcntl-o.m4 $(top_srcdir)/gl/m4/glibc21.m4 \ @@ -56,22 +76,27 @@ $(top_srcdir)/gl/m4/locale-fr.m4 \ $(top_srcdir)/gl/m4/locale-ja.m4 \ $(top_srcdir)/gl/m4/locale-zh.m4 \ + $(top_srcdir)/gl/m4/locale_h.m4 \ + $(top_srcdir)/gl/m4/localeconv.m4 \ $(top_srcdir)/gl/m4/longlong.m4 $(top_srcdir)/gl/m4/malloc.m4 \ $(top_srcdir)/gl/m4/mbrtowc.m4 $(top_srcdir)/gl/m4/mbsinit.m4 \ - $(top_srcdir)/gl/m4/mbstate_t.m4 \ + $(top_srcdir)/gl/m4/mbstate_t.m4 $(top_srcdir)/gl/m4/mbtowc.m4 \ $(top_srcdir)/gl/m4/multiarch.m4 \ $(top_srcdir)/gl/m4/nl_langinfo.m4 \ - $(top_srcdir)/gl/m4/regex.m4 $(top_srcdir)/gl/m4/ssize_t.m4 \ - $(top_srcdir)/gl/m4/stdbool.m4 $(top_srcdir)/gl/m4/stddef_h.m4 \ - $(top_srcdir)/gl/m4/stdint.m4 $(top_srcdir)/gl/m4/stdlib_h.m4 \ + $(top_srcdir)/gl/m4/off_t.m4 $(top_srcdir)/gl/m4/regex.m4 \ + $(top_srcdir)/gl/m4/ssize_t.m4 $(top_srcdir)/gl/m4/stdbool.m4 \ + $(top_srcdir)/gl/m4/stddef_h.m4 $(top_srcdir)/gl/m4/stdint.m4 \ + $(top_srcdir)/gl/m4/stdlib_h.m4 $(top_srcdir)/gl/m4/strcase.m4 \ + $(top_srcdir)/gl/m4/strings_h.m4 \ + $(top_srcdir)/gl/m4/sys_types_h.m4 \ $(top_srcdir)/gl/m4/unistd_h.m4 \ $(top_srcdir)/gl/m4/warn-on-use.m4 \ $(top_srcdir)/gl/m4/wchar_h.m4 $(top_srcdir)/gl/m4/wchar_t.m4 \ $(top_srcdir)/gl/m4/wcrtomb.m4 $(top_srcdir)/gl/m4/wctype_h.m4 \ $(top_srcdir)/gl/m4/wint_t.m4 $(top_srcdir)/conf/acinclude.m4 \ - $(top_srcdir)/conf/check_zlib.m4 $(top_srcdir)/conf/cppunit.m4 \ - $(top_srcdir)/conf/libtool.m4 $(top_srcdir)/conf/ltoptions.m4 \ - $(top_srcdir)/conf/ltsugar.m4 $(top_srcdir)/conf/ltversion.m4 \ + $(top_srcdir)/conf/cppunit.m4 $(top_srcdir)/conf/libtool.m4 \ + $(top_srcdir)/conf/ltoptions.m4 $(top_srcdir)/conf/ltsugar.m4 \ + $(top_srcdir)/conf/ltversion.m4 \ $(top_srcdir)/conf/lt~obsolete.m4 $(top_srcdir)/conf/pkg.m4 \ $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ @@ -82,8 +107,35 @@ $(top_builddir)/xdr-datatypes-config.h CONFIG_CLEAN_FILES = atlocal CONFIG_CLEAN_VPATH_FILES = -LIBRARIES = $(noinst_LIBRARIES) -ARFLAGS = cru +am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; +am__vpath_adj = case $$p in \ + $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ + *) f=$$p;; \ + esac; +am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; +am__install_max = 40 +am__nobase_strip_setup = \ + srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` +am__nobase_strip = \ + for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" +am__nobase_list = $(am__nobase_strip_setup); \ + for p in $$list; do echo "$$p $$p"; done | \ + sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ + $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ + if (++n[$$2] == $(am__install_max)) \ + { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ + END { for (dir in files) print dir, files[dir] }' +am__base_list = \ + sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ + sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' +am__uninstall_files_from_dir = { \ + test -z "$$files" \ + || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ + || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ + $(am__cd) "$$dir" && rm -f $$files; }; \ + } +am__installdirs = "$(DESTDIR)$(libdir)" "$(DESTDIR)$(testheadersdir)" +LIBRARIES = $(lib_LIBRARIES) libtest_types_a_AR = $(AR) $(ARFLAGS) libtest_types_a_LIBADD = am__objects_1 = TestByte.$(OBJEXT) TestInt32.$(OBJEXT) \ @@ -103,7 +155,7 @@ dds_test_OBJECTS = $(am_dds_test_OBJECTS) dds_test_DEPENDENCIES = libtest-types.a ../libdapserver.la \ ../libdap.la -am_expr_test_OBJECTS = expr-test.$(OBJEXT) +am_expr_test_OBJECTS = expr-test.$(OBJEXT) ResponseBuilder.$(OBJEXT) expr_test_OBJECTS = $(am_expr_test_OBJECTS) expr_test_DEPENDENCIES = libtest-types.a ../libdapserver.la \ ../libdapclient.la ../libdap.la @@ -133,10 +185,18 @@ $(dds_test_SOURCES) $(expr_test_SOURCES) DIST_SOURCES = $(libtest_types_a_SOURCES) $(das_test_SOURCES) \ $(dds_test_SOURCES) $(expr_test_SOURCES) +am__can_run_installinfo = \ + case $$AM_UPDATE_INFO_DIR in \ + n|no|NO) false;; \ + *) (install-info --version) >/dev/null 2>&1;; \ + esac +HEADERS = $(testheaders_HEADERS) ETAGS = etags CTAGS = ctags -am__tty_colors = \ -red=; grn=; lgn=; blu=; std= +am__tty_colors_dummy = \ + mgn= red= grn= lgn= blu= brg= std=; \ + am__color_tests=no +am__tty_colors = $(am__tty_colors_dummy) DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) pkglibexecdir = @pkglibexecdir@ ACLOCAL = @ACLOCAL@ @@ -145,6 +205,7 @@ AMTAR = @AMTAR@ APPLE_UNIVERSAL_BUILD = @APPLE_UNIVERSAL_BUILD@ AR = @AR@ +ARFLAGS = @ARFLAGS@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ @@ -154,6 +215,7 @@ BITSIZEOF_SIZE_T = @BITSIZEOF_SIZE_T@ BITSIZEOF_WCHAR_T = @BITSIZEOF_WCHAR_T@ BITSIZEOF_WINT_T = @BITSIZEOF_WINT_T@ +BYTESWAP_H = @BYTESWAP_H@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ @@ -180,6 +242,7 @@ DAP_PROTOCOL_VERSION = @DAP_PROTOCOL_VERSION@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ +DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ DVR = @DVR@ @@ -195,15 +258,20 @@ GNULIB_BTOWC = @GNULIB_BTOWC@ GNULIB_CALLOC_POSIX = @GNULIB_CALLOC_POSIX@ GNULIB_CANONICALIZE_FILE_NAME = @GNULIB_CANONICALIZE_FILE_NAME@ +GNULIB_CHDIR = @GNULIB_CHDIR@ GNULIB_CHOWN = @GNULIB_CHOWN@ GNULIB_CLOSE = @GNULIB_CLOSE@ +GNULIB_DUP = @GNULIB_DUP@ GNULIB_DUP2 = @GNULIB_DUP2@ GNULIB_DUP3 = @GNULIB_DUP3@ +GNULIB_DUPLOCALE = @GNULIB_DUPLOCALE@ GNULIB_ENVIRON = @GNULIB_ENVIRON@ GNULIB_EUIDACCESS = @GNULIB_EUIDACCESS@ GNULIB_FACCESSAT = @GNULIB_FACCESSAT@ GNULIB_FCHDIR = @GNULIB_FCHDIR@ GNULIB_FCHOWNAT = @GNULIB_FCHOWNAT@ +GNULIB_FDATASYNC = @GNULIB_FDATASYNC@ +GNULIB_FFS = @GNULIB_FFS@ GNULIB_FSYNC = @GNULIB_FSYNC@ GNULIB_FTRUNCATE = @GNULIB_FTRUNCATE@ GNULIB_GETCWD = @GNULIB_GETCWD@ @@ -218,9 +286,14 @@ GNULIB_GETSUBOPT = @GNULIB_GETSUBOPT@ GNULIB_GETUSERSHELL = @GNULIB_GETUSERSHELL@ GNULIB_GRANTPT = @GNULIB_GRANTPT@ +GNULIB_GROUP_MEMBER = @GNULIB_GROUP_MEMBER@ +GNULIB_ISATTY = @GNULIB_ISATTY@ +GNULIB_ISWBLANK = @GNULIB_ISWBLANK@ +GNULIB_ISWCTYPE = @GNULIB_ISWCTYPE@ GNULIB_LCHOWN = @GNULIB_LCHOWN@ GNULIB_LINK = @GNULIB_LINK@ GNULIB_LINKAT = @GNULIB_LINKAT@ +GNULIB_LOCALECONV = @GNULIB_LOCALECONV@ GNULIB_LSEEK = @GNULIB_LSEEK@ GNULIB_MALLOC_POSIX = @GNULIB_MALLOC_POSIX@ GNULIB_MBRLEN = @GNULIB_MBRLEN@ @@ -228,6 +301,7 @@ GNULIB_MBSINIT = @GNULIB_MBSINIT@ GNULIB_MBSNRTOWCS = @GNULIB_MBSNRTOWCS@ GNULIB_MBSRTOWCS = @GNULIB_MBSRTOWCS@ +GNULIB_MBTOWC = @GNULIB_MBTOWC@ GNULIB_MKDTEMP = @GNULIB_MKDTEMP@ GNULIB_MKOSTEMP = @GNULIB_MKOSTEMP@ GNULIB_MKOSTEMPS = @GNULIB_MKOSTEMPS@ @@ -236,11 +310,15 @@ GNULIB_NL_LANGINFO = @GNULIB_NL_LANGINFO@ GNULIB_PIPE = @GNULIB_PIPE@ GNULIB_PIPE2 = @GNULIB_PIPE2@ +GNULIB_POSIX_OPENPT = @GNULIB_POSIX_OPENPT@ GNULIB_PREAD = @GNULIB_PREAD@ GNULIB_PTSNAME = @GNULIB_PTSNAME@ +GNULIB_PTSNAME_R = @GNULIB_PTSNAME_R@ GNULIB_PUTENV = @GNULIB_PUTENV@ GNULIB_PWRITE = @GNULIB_PWRITE@ +GNULIB_RANDOM = @GNULIB_RANDOM@ GNULIB_RANDOM_R = @GNULIB_RANDOM_R@ +GNULIB_READ = @GNULIB_READ@ GNULIB_READLINK = @GNULIB_READLINK@ GNULIB_READLINKAT = @GNULIB_READLINKAT@ GNULIB_REALLOC_POSIX = @GNULIB_REALLOC_POSIX@ @@ -248,6 +326,8 @@ GNULIB_RMDIR = @GNULIB_RMDIR@ GNULIB_RPMATCH = @GNULIB_RPMATCH@ GNULIB_SETENV = @GNULIB_SETENV@ +GNULIB_SETHOSTNAME = @GNULIB_SETHOSTNAME@ +GNULIB_SETLOCALE = @GNULIB_SETLOCALE@ GNULIB_SLEEP = @GNULIB_SLEEP@ GNULIB_STRTOD = @GNULIB_STRTOD@ GNULIB_STRTOLL = @GNULIB_STRTOLL@ @@ -255,19 +335,51 @@ GNULIB_SYMLINK = @GNULIB_SYMLINK@ GNULIB_SYMLINKAT = @GNULIB_SYMLINKAT@ GNULIB_SYSTEM_POSIX = @GNULIB_SYSTEM_POSIX@ +GNULIB_TOWCTRANS = @GNULIB_TOWCTRANS@ GNULIB_TTYNAME_R = @GNULIB_TTYNAME_R@ -GNULIB_UNISTD_H_GETOPT = @GNULIB_UNISTD_H_GETOPT@ +GNULIB_UNISTD_H_NONBLOCKING = @GNULIB_UNISTD_H_NONBLOCKING@ GNULIB_UNISTD_H_SIGPIPE = @GNULIB_UNISTD_H_SIGPIPE@ GNULIB_UNLINK = @GNULIB_UNLINK@ GNULIB_UNLINKAT = @GNULIB_UNLINKAT@ GNULIB_UNLOCKPT = @GNULIB_UNLOCKPT@ GNULIB_UNSETENV = @GNULIB_UNSETENV@ GNULIB_USLEEP = @GNULIB_USLEEP@ +GNULIB_WCPCPY = @GNULIB_WCPCPY@ +GNULIB_WCPNCPY = @GNULIB_WCPNCPY@ GNULIB_WCRTOMB = @GNULIB_WCRTOMB@ +GNULIB_WCSCASECMP = @GNULIB_WCSCASECMP@ +GNULIB_WCSCAT = @GNULIB_WCSCAT@ +GNULIB_WCSCHR = @GNULIB_WCSCHR@ +GNULIB_WCSCMP = @GNULIB_WCSCMP@ +GNULIB_WCSCOLL = @GNULIB_WCSCOLL@ +GNULIB_WCSCPY = @GNULIB_WCSCPY@ +GNULIB_WCSCSPN = @GNULIB_WCSCSPN@ +GNULIB_WCSDUP = @GNULIB_WCSDUP@ +GNULIB_WCSLEN = @GNULIB_WCSLEN@ +GNULIB_WCSNCASECMP = @GNULIB_WCSNCASECMP@ +GNULIB_WCSNCAT = @GNULIB_WCSNCAT@ +GNULIB_WCSNCMP = @GNULIB_WCSNCMP@ +GNULIB_WCSNCPY = @GNULIB_WCSNCPY@ +GNULIB_WCSNLEN = @GNULIB_WCSNLEN@ GNULIB_WCSNRTOMBS = @GNULIB_WCSNRTOMBS@ +GNULIB_WCSPBRK = @GNULIB_WCSPBRK@ +GNULIB_WCSRCHR = @GNULIB_WCSRCHR@ GNULIB_WCSRTOMBS = @GNULIB_WCSRTOMBS@ +GNULIB_WCSSPN = @GNULIB_WCSSPN@ +GNULIB_WCSSTR = @GNULIB_WCSSTR@ +GNULIB_WCSTOK = @GNULIB_WCSTOK@ +GNULIB_WCSWIDTH = @GNULIB_WCSWIDTH@ +GNULIB_WCSXFRM = @GNULIB_WCSXFRM@ GNULIB_WCTOB = @GNULIB_WCTOB@ +GNULIB_WCTOMB = @GNULIB_WCTOMB@ +GNULIB_WCTRANS = @GNULIB_WCTRANS@ +GNULIB_WCTYPE = @GNULIB_WCTYPE@ GNULIB_WCWIDTH = @GNULIB_WCWIDTH@ +GNULIB_WMEMCHR = @GNULIB_WMEMCHR@ +GNULIB_WMEMCMP = @GNULIB_WMEMCMP@ +GNULIB_WMEMCPY = @GNULIB_WMEMCPY@ +GNULIB_WMEMMOVE = @GNULIB_WMEMMOVE@ +GNULIB_WMEMSET = @GNULIB_WMEMSET@ GNULIB_WRITE = @GNULIB_WRITE@ GNULIB__EXIT = @GNULIB__EXIT@ GREP = @GREP@ @@ -277,23 +389,29 @@ HAVE_CHOWN = @HAVE_CHOWN@ HAVE_DECL_ENVIRON = @HAVE_DECL_ENVIRON@ HAVE_DECL_FCHDIR = @HAVE_DECL_FCHDIR@ +HAVE_DECL_FDATASYNC = @HAVE_DECL_FDATASYNC@ HAVE_DECL_GETDOMAINNAME = @HAVE_DECL_GETDOMAINNAME@ HAVE_DECL_GETLOADAVG = @HAVE_DECL_GETLOADAVG@ HAVE_DECL_GETLOGIN_R = @HAVE_DECL_GETLOGIN_R@ HAVE_DECL_GETPAGESIZE = @HAVE_DECL_GETPAGESIZE@ HAVE_DECL_GETUSERSHELL = @HAVE_DECL_GETUSERSHELL@ HAVE_DECL_SETENV = @HAVE_DECL_SETENV@ +HAVE_DECL_SETHOSTNAME = @HAVE_DECL_SETHOSTNAME@ +HAVE_DECL_STRNCASECMP = @HAVE_DECL_STRNCASECMP@ HAVE_DECL_TTYNAME_R = @HAVE_DECL_TTYNAME_R@ HAVE_DECL_UNSETENV = @HAVE_DECL_UNSETENV@ HAVE_DECL_WCTOB = @HAVE_DECL_WCTOB@ HAVE_DECL_WCWIDTH = @HAVE_DECL_WCWIDTH@ HAVE_DUP2 = @HAVE_DUP2@ HAVE_DUP3 = @HAVE_DUP3@ +HAVE_DUPLOCALE = @HAVE_DUPLOCALE@ HAVE_EUIDACCESS = @HAVE_EUIDACCESS@ HAVE_FACCESSAT = @HAVE_FACCESSAT@ HAVE_FCHDIR = @HAVE_FCHDIR@ HAVE_FCHOWNAT = @HAVE_FCHOWNAT@ +HAVE_FDATASYNC = @HAVE_FDATASYNC@ HAVE_FEATURES_H = @HAVE_FEATURES_H@ +HAVE_FFS = @HAVE_FFS@ HAVE_FSYNC = @HAVE_FSYNC@ HAVE_FTRUNCATE = @HAVE_FTRUNCATE@ HAVE_GETDTABLESIZE = @HAVE_GETDTABLESIZE@ @@ -303,6 +421,7 @@ HAVE_GETPAGESIZE = @HAVE_GETPAGESIZE@ HAVE_GETSUBOPT = @HAVE_GETSUBOPT@ HAVE_GRANTPT = @HAVE_GRANTPT@ +HAVE_GROUP_MEMBER = @HAVE_GROUP_MEMBER@ HAVE_INTTYPES_H = @HAVE_INTTYPES_H@ HAVE_ISWBLANK = @HAVE_ISWBLANK@ HAVE_ISWCNTRL = @HAVE_ISWCNTRL@ @@ -329,9 +448,12 @@ HAVE_OS_H = @HAVE_OS_H@ HAVE_PIPE = @HAVE_PIPE@ HAVE_PIPE2 = @HAVE_PIPE2@ +HAVE_POSIX_OPENPT = @HAVE_POSIX_OPENPT@ HAVE_PREAD = @HAVE_PREAD@ HAVE_PTSNAME = @HAVE_PTSNAME@ +HAVE_PTSNAME_R = @HAVE_PTSNAME_R@ HAVE_PWRITE = @HAVE_PWRITE@ +HAVE_RANDOM = @HAVE_RANDOM@ HAVE_RANDOM_H = @HAVE_RANDOM_H@ HAVE_RANDOM_R = @HAVE_RANDOM_R@ HAVE_READLINK = @HAVE_READLINK@ @@ -339,11 +461,14 @@ HAVE_REALPATH = @HAVE_REALPATH@ HAVE_RPMATCH = @HAVE_RPMATCH@ HAVE_SETENV = @HAVE_SETENV@ +HAVE_SETHOSTNAME = @HAVE_SETHOSTNAME@ HAVE_SIGNED_SIG_ATOMIC_T = @HAVE_SIGNED_SIG_ATOMIC_T@ HAVE_SIGNED_WCHAR_T = @HAVE_SIGNED_WCHAR_T@ HAVE_SIGNED_WINT_T = @HAVE_SIGNED_WINT_T@ HAVE_SLEEP = @HAVE_SLEEP@ HAVE_STDINT_H = @HAVE_STDINT_H@ +HAVE_STRCASECMP = @HAVE_STRCASECMP@ +HAVE_STRINGS_H = @HAVE_STRINGS_H@ HAVE_STRTOD = @HAVE_STRTOD@ HAVE_STRTOLL = @HAVE_STRTOLL@ HAVE_STRTOULL = @HAVE_STRTOULL@ @@ -362,11 +487,42 @@ HAVE_USLEEP = @HAVE_USLEEP@ HAVE_WCHAR_H = @HAVE_WCHAR_H@ HAVE_WCHAR_T = @HAVE_WCHAR_T@ +HAVE_WCPCPY = @HAVE_WCPCPY@ +HAVE_WCPNCPY = @HAVE_WCPNCPY@ HAVE_WCRTOMB = @HAVE_WCRTOMB@ +HAVE_WCSCASECMP = @HAVE_WCSCASECMP@ +HAVE_WCSCAT = @HAVE_WCSCAT@ +HAVE_WCSCHR = @HAVE_WCSCHR@ +HAVE_WCSCMP = @HAVE_WCSCMP@ +HAVE_WCSCOLL = @HAVE_WCSCOLL@ +HAVE_WCSCPY = @HAVE_WCSCPY@ +HAVE_WCSCSPN = @HAVE_WCSCSPN@ +HAVE_WCSDUP = @HAVE_WCSDUP@ +HAVE_WCSLEN = @HAVE_WCSLEN@ +HAVE_WCSNCASECMP = @HAVE_WCSNCASECMP@ +HAVE_WCSNCAT = @HAVE_WCSNCAT@ +HAVE_WCSNCMP = @HAVE_WCSNCMP@ +HAVE_WCSNCPY = @HAVE_WCSNCPY@ +HAVE_WCSNLEN = @HAVE_WCSNLEN@ HAVE_WCSNRTOMBS = @HAVE_WCSNRTOMBS@ +HAVE_WCSPBRK = @HAVE_WCSPBRK@ +HAVE_WCSRCHR = @HAVE_WCSRCHR@ HAVE_WCSRTOMBS = @HAVE_WCSRTOMBS@ +HAVE_WCSSPN = @HAVE_WCSSPN@ +HAVE_WCSSTR = @HAVE_WCSSTR@ +HAVE_WCSTOK = @HAVE_WCSTOK@ +HAVE_WCSWIDTH = @HAVE_WCSWIDTH@ +HAVE_WCSXFRM = @HAVE_WCSXFRM@ +HAVE_WCTRANS_T = @HAVE_WCTRANS_T@ HAVE_WCTYPE_H = @HAVE_WCTYPE_H@ +HAVE_WCTYPE_T = @HAVE_WCTYPE_T@ HAVE_WINT_T = @HAVE_WINT_T@ +HAVE_WMEMCHR = @HAVE_WMEMCHR@ +HAVE_WMEMCMP = @HAVE_WMEMCMP@ +HAVE_WMEMCPY = @HAVE_WMEMCPY@ +HAVE_WMEMMOVE = @HAVE_WMEMMOVE@ +HAVE_WMEMSET = @HAVE_WMEMSET@ +HAVE_XLOCALE_H = @HAVE_XLOCALE_H@ HAVE__BOOL = @HAVE__BOOL@ HAVE__EXIT = @HAVE__EXIT@ INCLUDE_NEXT = @INCLUDE_NEXT@ @@ -396,18 +552,25 @@ LTLIBINTL = @LTLIBINTL@ LTLIBOBJS = @LTLIBOBJS@ MAKEINFO = @MAKEINFO@ +MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ NEXT_AS_FIRST_DIRECTIVE_LANGINFO_H = @NEXT_AS_FIRST_DIRECTIVE_LANGINFO_H@ +NEXT_AS_FIRST_DIRECTIVE_LOCALE_H = @NEXT_AS_FIRST_DIRECTIVE_LOCALE_H@ NEXT_AS_FIRST_DIRECTIVE_STDDEF_H = @NEXT_AS_FIRST_DIRECTIVE_STDDEF_H@ NEXT_AS_FIRST_DIRECTIVE_STDINT_H = @NEXT_AS_FIRST_DIRECTIVE_STDINT_H@ NEXT_AS_FIRST_DIRECTIVE_STDLIB_H = @NEXT_AS_FIRST_DIRECTIVE_STDLIB_H@ +NEXT_AS_FIRST_DIRECTIVE_STRINGS_H = @NEXT_AS_FIRST_DIRECTIVE_STRINGS_H@ +NEXT_AS_FIRST_DIRECTIVE_SYS_TYPES_H = @NEXT_AS_FIRST_DIRECTIVE_SYS_TYPES_H@ NEXT_AS_FIRST_DIRECTIVE_UNISTD_H = @NEXT_AS_FIRST_DIRECTIVE_UNISTD_H@ NEXT_AS_FIRST_DIRECTIVE_WCHAR_H = @NEXT_AS_FIRST_DIRECTIVE_WCHAR_H@ NEXT_AS_FIRST_DIRECTIVE_WCTYPE_H = @NEXT_AS_FIRST_DIRECTIVE_WCTYPE_H@ NEXT_LANGINFO_H = @NEXT_LANGINFO_H@ +NEXT_LOCALE_H = @NEXT_LOCALE_H@ NEXT_STDDEF_H = @NEXT_STDDEF_H@ NEXT_STDINT_H = @NEXT_STDINT_H@ NEXT_STDLIB_H = @NEXT_STDLIB_H@ +NEXT_STRINGS_H = @NEXT_STRINGS_H@ +NEXT_SYS_TYPES_H = @NEXT_SYS_TYPES_H@ NEXT_UNISTD_H = @NEXT_UNISTD_H@ NEXT_WCHAR_H = @NEXT_WCHAR_H@ NEXT_WCTYPE_H = @NEXT_WCTYPE_H@ @@ -441,17 +604,21 @@ REPLACE_CLOSE = @REPLACE_CLOSE@ REPLACE_DUP = @REPLACE_DUP@ REPLACE_DUP2 = @REPLACE_DUP2@ +REPLACE_DUPLOCALE = @REPLACE_DUPLOCALE@ REPLACE_FCHOWNAT = @REPLACE_FCHOWNAT@ +REPLACE_FTRUNCATE = @REPLACE_FTRUNCATE@ REPLACE_GETCWD = @REPLACE_GETCWD@ REPLACE_GETDOMAINNAME = @REPLACE_GETDOMAINNAME@ REPLACE_GETGROUPS = @REPLACE_GETGROUPS@ REPLACE_GETLOGIN_R = @REPLACE_GETLOGIN_R@ REPLACE_GETPAGESIZE = @REPLACE_GETPAGESIZE@ +REPLACE_ISATTY = @REPLACE_ISATTY@ REPLACE_ISWBLANK = @REPLACE_ISWBLANK@ REPLACE_ISWCNTRL = @REPLACE_ISWCNTRL@ REPLACE_LCHOWN = @REPLACE_LCHOWN@ REPLACE_LINK = @REPLACE_LINK@ REPLACE_LINKAT = @REPLACE_LINKAT@ +REPLACE_LOCALECONV = @REPLACE_LOCALECONV@ REPLACE_LSEEK = @REPLACE_LSEEK@ REPLACE_MALLOC = @REPLACE_MALLOC@ REPLACE_MBRLEN = @REPLACE_MBRLEN@ @@ -460,20 +627,27 @@ REPLACE_MBSNRTOWCS = @REPLACE_MBSNRTOWCS@ REPLACE_MBSRTOWCS = @REPLACE_MBSRTOWCS@ REPLACE_MBSTATE_T = @REPLACE_MBSTATE_T@ +REPLACE_MBTOWC = @REPLACE_MBTOWC@ REPLACE_MKSTEMP = @REPLACE_MKSTEMP@ REPLACE_NL_LANGINFO = @REPLACE_NL_LANGINFO@ REPLACE_NULL = @REPLACE_NULL@ REPLACE_PREAD = @REPLACE_PREAD@ +REPLACE_PTSNAME_R = @REPLACE_PTSNAME_R@ REPLACE_PUTENV = @REPLACE_PUTENV@ REPLACE_PWRITE = @REPLACE_PWRITE@ +REPLACE_RANDOM_R = @REPLACE_RANDOM_R@ +REPLACE_READ = @REPLACE_READ@ REPLACE_READLINK = @REPLACE_READLINK@ REPLACE_REALLOC = @REPLACE_REALLOC@ REPLACE_REALPATH = @REPLACE_REALPATH@ REPLACE_RMDIR = @REPLACE_RMDIR@ REPLACE_SETENV = @REPLACE_SETENV@ +REPLACE_SETLOCALE = @REPLACE_SETLOCALE@ REPLACE_SLEEP = @REPLACE_SLEEP@ REPLACE_STRTOD = @REPLACE_STRTOD@ +REPLACE_STRUCT_LCONV = @REPLACE_STRUCT_LCONV@ REPLACE_SYMLINK = @REPLACE_SYMLINK@ +REPLACE_TOWLOWER = @REPLACE_TOWLOWER@ REPLACE_TTYNAME_R = @REPLACE_TTYNAME_R@ REPLACE_UNLINK = @REPLACE_UNLINK@ REPLACE_UNLINKAT = @REPLACE_UNLINKAT@ @@ -482,7 +656,9 @@ REPLACE_WCRTOMB = @REPLACE_WCRTOMB@ REPLACE_WCSNRTOMBS = @REPLACE_WCSNRTOMBS@ REPLACE_WCSRTOMBS = @REPLACE_WCSRTOMBS@ +REPLACE_WCSWIDTH = @REPLACE_WCSWIDTH@ REPLACE_WCTOB = @REPLACE_WCTOB@ +REPLACE_WCTOMB = @REPLACE_WCTOMB@ REPLACE_WCWIDTH = @REPLACE_WCWIDTH@ REPLACE_WRITE = @REPLACE_WRITE@ SED = @SED@ @@ -503,18 +679,16 @@ UUID_LIBS = @UUID_LIBS@ VERSION = @VERSION@ WCHAR_T_SUFFIX = @WCHAR_T_SUFFIX@ +WINDOWS_64_BIT_OFF_T = @WINDOWS_64_BIT_OFF_T@ WINT_T_SUFFIX = @WINT_T_SUFFIX@ XML2_CFLAGS = @XML2_CFLAGS@ XML2_LIBS = @XML2_LIBS@ -XML2_STATIC_LIBS = @XML2_STATIC_LIBS@ YACC = @YACC@ -ZLIB_CFLAGS = @ZLIB_CFLAGS@ -ZLIB_LDFLAGS = @ZLIB_LDFLAGS@ -ZLIB_LIBS = @ZLIB_LIBS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ +ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ @@ -556,7 +730,6 @@ lispdir = @lispdir@ localedir = @localedir@ localstatedir = @localstatedir@ -lt_ECHO = @lt_ECHO@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ @@ -577,22 +750,24 @@ AUTOMAKE_OPTIONS = foreign # Arrange to build with the backward compatibility mode enabled. -AM_CPPFLAGS = -I$(top_srcdir) -I$(top_srcdir)/GNU -AM_CXXFLAGS = +AM_CPPFLAGS = -I$(top_srcdir) -I$(top_srcdir)/GNU $(XML2_CFLAGS) $(CURL_CFLAGS) +AM_CXXFLAGS = $(am__append_1) # These are not used by automake but are often useful for certain types of # debugging. -CXXFLAGS_DEBUG = -g3 -O0 -fno-defer-pop -Wall -W -Wcast-align -Werror +CXXFLAGS_DEBUG = -g3 -O0 -Wall -W -Wcast-align TEST_COV_FLAGS = -ftest-coverage -fprofile-arcs -# noinst_PROGRAMS = io_test TESTS = DASTest DDSTest EXPRTest -# EXPRTest dist_check_SCRIPTS = DASTest DDSTest EXPRTest atconfig atlocal # Build the test drivers. The drivers all use the # subclassed types in Test*.cc and the TestTypesFactory. -noinst_LIBRARIES = libtest-types.a + +#noinst_LIBRARIES = libtest-types.a +lib_LIBRARIES = libtest-types.a libtest_types_a_SOURCES = $(TESTSRCS) $(TEST_HDR) +testheadersdir = $(pkgincludedir)/test +testheaders_HEADERS = $(TEST_HDR) # io_test_SOURCES = io_test.cc # io_test_LDADD = ../libdap.la @@ -600,7 +775,7 @@ das_test_LDADD = libtest-types.a ../libdapserver.la ../libdap.la dds_test_SOURCES = dds-test.cc dds_test_LDADD = libtest-types.a ../libdapserver.la ../libdap.la -expr_test_SOURCES = expr-test.cc +expr_test_SOURCES = expr-test.cc ResponseBuilder.cc ResponseBuilder.h expr_test_LDADD = libtest-types.a ../libdapserver.la ../libdapclient.la ../libdap.la TESTSRCS = TestByte.cc TestInt32.cc TestFloat64.cc TestStr.cc TestUrl.cc \ TestArray.cc TestStructure.cc TestSequence.cc \ @@ -612,10 +787,6 @@ TestStructure.h TestTypeFactory.h TestUInt16.h TestUInt32.h TestUrl.h DIRS_EXTRA = das-testsuite dds-testsuite expr-testsuite - -# grid-func-testsuite cache-testsuite ais_testsuite rcreader-testsuite -# server-testsuite cgi-util-tests -# ddx-testsuite EXTRA_DIST = DASTest.at $(DASTESTSUITE) DDSTest.at $(DDSTESTSUITE) \ EXPRTest.at $(EXPRTESTSUITE) atlocal.in $(srcdir)/package.m4 \ $(DIRS_EXTRA) @@ -667,10 +838,38 @@ $(am__aclocal_m4_deps): atlocal: $(top_builddir)/config.status $(srcdir)/atlocal.in cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ +install-libLIBRARIES: $(lib_LIBRARIES) + @$(NORMAL_INSTALL) + @list='$(lib_LIBRARIES)'; test -n "$(libdir)" || list=; \ + list2=; for p in $$list; do \ + if test -f $$p; then \ + list2="$$list2 $$p"; \ + else :; fi; \ + done; \ + test -z "$$list2" || { \ + echo " $(MKDIR_P) '$(DESTDIR)$(libdir)'"; \ + $(MKDIR_P) "$(DESTDIR)$(libdir)" || exit 1; \ + echo " $(INSTALL_DATA) $$list2 '$(DESTDIR)$(libdir)'"; \ + $(INSTALL_DATA) $$list2 "$(DESTDIR)$(libdir)" || exit $$?; } + @$(POST_INSTALL) + @list='$(lib_LIBRARIES)'; test -n "$(libdir)" || list=; \ + for p in $$list; do \ + if test -f $$p; then \ + $(am__strip_dir) \ + echo " ( cd '$(DESTDIR)$(libdir)' && $(RANLIB) $$f )"; \ + ( cd "$(DESTDIR)$(libdir)" && $(RANLIB) $$f ) || exit $$?; \ + else :; fi; \ + done -clean-noinstLIBRARIES: - -test -z "$(noinst_LIBRARIES)" || rm -f $(noinst_LIBRARIES) -libtest-types.a: $(libtest_types_a_OBJECTS) $(libtest_types_a_DEPENDENCIES) +uninstall-libLIBRARIES: + @$(NORMAL_UNINSTALL) + @list='$(lib_LIBRARIES)'; test -n "$(libdir)" || list=; \ + files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ + dir='$(DESTDIR)$(libdir)'; $(am__uninstall_files_from_dir) + +clean-libLIBRARIES: + -test -z "$(lib_LIBRARIES)" || rm -f $(lib_LIBRARIES) +libtest-types.a: $(libtest_types_a_OBJECTS) $(libtest_types_a_DEPENDENCIES) $(EXTRA_libtest_types_a_DEPENDENCIES) -rm -f libtest-types.a $(libtest_types_a_AR) libtest-types.a $(libtest_types_a_OBJECTS) $(libtest_types_a_LIBADD) $(RANLIB) libtest-types.a @@ -683,13 +882,13 @@ list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \ echo " rm -f" $$list; \ rm -f $$list -das-test$(EXEEXT): $(das_test_OBJECTS) $(das_test_DEPENDENCIES) +das-test$(EXEEXT): $(das_test_OBJECTS) $(das_test_DEPENDENCIES) $(EXTRA_das_test_DEPENDENCIES) @rm -f das-test$(EXEEXT) $(CXXLINK) $(das_test_OBJECTS) $(das_test_LDADD) $(LIBS) -dds-test$(EXEEXT): $(dds_test_OBJECTS) $(dds_test_DEPENDENCIES) +dds-test$(EXEEXT): $(dds_test_OBJECTS) $(dds_test_DEPENDENCIES) $(EXTRA_dds_test_DEPENDENCIES) @rm -f dds-test$(EXEEXT) $(CXXLINK) $(dds_test_OBJECTS) $(dds_test_LDADD) $(LIBS) -expr-test$(EXEEXT): $(expr_test_OBJECTS) $(expr_test_DEPENDENCIES) +expr-test$(EXEEXT): $(expr_test_OBJECTS) $(expr_test_DEPENDENCIES) $(EXTRA_expr_test_DEPENDENCIES) @rm -f expr-test$(EXEEXT) $(CXXLINK) $(expr_test_OBJECTS) $(expr_test_LDADD) $(LIBS) @@ -699,6 +898,7 @@ distclean-compile: -rm -f *.tab.c +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ResponseBuilder.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/TestArray.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/TestByte.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/TestCommon.Po@am__quote@ @@ -744,6 +944,27 @@ clean-libtool: -rm -rf .libs _libs +install-testheadersHEADERS: $(testheaders_HEADERS) + @$(NORMAL_INSTALL) + @list='$(testheaders_HEADERS)'; test -n "$(testheadersdir)" || list=; \ + if test -n "$$list"; then \ + echo " $(MKDIR_P) '$(DESTDIR)$(testheadersdir)'"; \ + $(MKDIR_P) "$(DESTDIR)$(testheadersdir)" || exit 1; \ + fi; \ + for p in $$list; do \ + if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ + echo "$$d$$p"; \ + done | $(am__base_list) | \ + while read files; do \ + echo " $(INSTALL_HEADER) $$files '$(DESTDIR)$(testheadersdir)'"; \ + $(INSTALL_HEADER) $$files "$(DESTDIR)$(testheadersdir)" || exit $$?; \ + done + +uninstall-testheadersHEADERS: + @$(NORMAL_UNINSTALL) + @list='$(testheaders_HEADERS)'; test -n "$(testheadersdir)" || list=; \ + files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ + dir='$(DESTDIR)$(testheadersdir)'; $(am__uninstall_files_from_dir) ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ @@ -794,6 +1015,20 @@ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" +cscopelist: $(HEADERS) $(SOURCES) $(LISP) + list='$(SOURCES) $(HEADERS) $(LISP)'; \ + case "$(srcdir)" in \ + [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ + *) sdir=$(subdir)/$(srcdir) ;; \ + esac; \ + for i in $$list; do \ + if test -f "$$i"; then \ + echo "$(subdir)/$$i"; \ + else \ + echo "$$sdir/$$i"; \ + fi; \ + done >> $(top_builddir)/cscope.files + distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags @@ -807,7 +1042,7 @@ if test -f ./$$tst; then dir=./; \ elif test -f $$tst; then dir=; \ else dir="$(srcdir)/"; fi; \ - if $(TESTS_ENVIRONMENT) $${dir}$$tst; then \ + if $(TESTS_ENVIRONMENT) $${dir}$$tst $(AM_TESTS_FD_REDIRECT); then \ all=`expr $$all + 1`; \ case " $(XFAIL_TESTS) " in \ *[\ \ ]$$tst[\ \ ]*) \ @@ -878,14 +1113,15 @@ fi; \ dashes=`echo "$$dashes" | sed s/./=/g`; \ if test "$$failed" -eq 0; then \ - echo "$$grn$$dashes"; \ + col="$$grn"; \ else \ - echo "$$red$$dashes"; \ + col="$$red"; \ fi; \ - echo "$$banner"; \ - test -z "$$skipped" || echo "$$skipped"; \ - test -z "$$report" || echo "$$report"; \ - echo "$$dashes$$std"; \ + echo "$${col}$$dashes$${std}"; \ + echo "$${col}$$banner$${std}"; \ + test -z "$$skipped" || echo "$${col}$$skipped$${std}"; \ + test -z "$$report" || echo "$${col}$$report$${std}"; \ + echo "$${col}$$dashes$${std}"; \ test "$$failed" -eq 0; \ else :; fi @@ -924,8 +1160,11 @@ $(dist_check_SCRIPTS) $(MAKE) $(AM_MAKEFLAGS) check-TESTS check: check-am -all-am: Makefile $(LIBRARIES) +all-am: Makefile $(LIBRARIES) $(HEADERS) installdirs: + for dir in "$(DESTDIR)$(libdir)" "$(DESTDIR)$(testheadersdir)"; do \ + test -z "$$dir" || $(MKDIR_P) "$$dir"; \ + done install: install-am install-exec: install-exec-am install-data: install-data-am @@ -936,10 +1175,15 @@ installcheck: installcheck-am install-strip: - $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ - install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ - `test -z '$(STRIP)' || \ - echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install + if test -z '$(STRIP)'; then \ + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + install; \ + else \ + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ + fi mostlyclean-generic: clean-generic: @@ -954,8 +1198,8 @@ @echo "it deletes files that may require special tools to rebuild." clean: clean-am -clean-am: clean-checkPROGRAMS clean-generic clean-libtool clean-local \ - clean-noinstLIBRARIES mostlyclean-am +clean-am: clean-checkPROGRAMS clean-generic clean-libLIBRARIES \ + clean-libtool clean-local mostlyclean-am distclean: distclean-am -rm -rf ./$(DEPDIR) @@ -975,13 +1219,13 @@ info-am: -install-data-am: +install-data-am: install-testheadersHEADERS install-dvi: install-dvi-am install-dvi-am: -install-exec-am: +install-exec-am: install-libLIBRARIES install-html: install-html-am @@ -1021,23 +1265,26 @@ ps-am: -uninstall-am: +uninstall-am: uninstall-libLIBRARIES uninstall-testheadersHEADERS .MAKE: check-am install-am install-strip .PHONY: CTAGS GTAGS all all-am check check-TESTS check-am clean \ - clean-checkPROGRAMS clean-generic clean-libtool clean-local \ - clean-noinstLIBRARIES ctags distclean distclean-compile \ - distclean-generic distclean-libtool distclean-local \ - distclean-tags distdir dvi dvi-am html html-am info info-am \ - install install-am install-data install-data-am install-dvi \ - install-dvi-am install-exec install-exec-am install-html \ - install-html-am install-info install-info-am install-man \ - install-pdf install-pdf-am install-ps install-ps-am \ - install-strip installcheck installcheck-am installdirs \ - maintainer-clean maintainer-clean-generic mostlyclean \ - mostlyclean-compile mostlyclean-generic mostlyclean-libtool \ - pdf pdf-am ps ps-am tags uninstall uninstall-am + clean-checkPROGRAMS clean-generic clean-libLIBRARIES \ + clean-libtool clean-local cscopelist ctags distclean \ + distclean-compile distclean-generic distclean-libtool \ + distclean-local distclean-tags distdir dvi dvi-am html html-am \ + info info-am install install-am install-data install-data-am \ + install-dvi install-dvi-am install-exec install-exec-am \ + install-html install-html-am install-info install-info-am \ + install-libLIBRARIES install-man install-pdf install-pdf-am \ + install-ps install-ps-am install-strip \ + install-testheadersHEADERS installcheck installcheck-am \ + installdirs maintainer-clean maintainer-clean-generic \ + mostlyclean mostlyclean-compile mostlyclean-generic \ + mostlyclean-libtool pdf pdf-am ps ps-am tags uninstall \ + uninstall-am uninstall-libLIBRARIES \ + uninstall-testheadersHEADERS #check-local: check-das check-dds diff -Nru libdap-3.11.1/tests/ResponseBuilder.cc libdap-3.12.0/tests/ResponseBuilder.cc --- libdap-3.11.1/tests/ResponseBuilder.cc 1970-01-01 00:00:00.000000000 +0000 +++ libdap-3.12.0/tests/ResponseBuilder.cc 2013-10-17 21:27:40.000000000 +0000 @@ -0,0 +1,488 @@ +// -*- mode: c++; c-basic-offset:4 -*- + +// This file is part of libdap, A C++ implementation of the OPeNDAP Data +// Access Protocol. + +// Copyright (c) 2011 OPeNDAP, Inc. +// Author: James Gallagher +// +// This library is free software; you can redistribute it and/or +// modify it under the terms of the GNU Lesser General Public +// License as published by the Free Software Foundation; either +// version 2.1 of the License, or (at your option) any later version. +// +// This library 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 +// Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, write to the Free Software +// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA +// +// You can contact OPeNDAP, Inc. at PO Box 112, Saunderstown, RI. 02874-0112. + +#include "config.h" + +#include +#include +#include +#include // used to build CID header value for data ddx + +#ifndef WIN32 +#include +#else +#include +#include +#include +#endif + +#include +#include +#include +#include + +#include +#include + +//#define DODS_DEBUG + +#include "DAS.h" +#include "DDS.h" +#include "ConstraintEvaluator.h" +#include "DDXParserSAX2.h" +#include "Ancillary.h" +#include "ResponseBuilder.h" +#include "XDRStreamMarshaller.h" +#include "XDRFileUnMarshaller.h" + +//#include "DAPCache3.h" +//#include "ResponseCache.h" + +#include "debug.h" +#include "mime_util.h" // for last_modified_time() and rfc_822_date() +#include "escaping.h" +#include "util.h" + +#ifndef WIN32 +#include "SignalHandler.h" +#include "EventHandler.h" +#include "AlarmHandler.h" +#endif + +#define CRLF "\r\n" // Change here, expr-test.cc + +using namespace std; +using namespace libdap; + +/** Called when initializing a ResponseBuilder that's not going to be passed + command line arguments. */ +void ResponseBuilder::initialize() +{ + // Set default values. Don't use the C++ constructor initialization so + // that a subclass can have more control over this process. + d_dataset = ""; + d_ce = ""; + d_btp_func_ce = ""; + d_timeout = 0; + + d_default_protocol = DAP_PROTOCOL_VERSION; +} + +ResponseBuilder::~ResponseBuilder() +{ + // If an alarm was registered, delete it. The register code in SignalHandler + // always deletes the old alarm handler object, so only the one returned by + // remove_handler needs to be deleted at this point. + delete dynamic_cast(SignalHandler::instance()->remove_handler(SIGALRM)); +} + +/** Return the entire constraint expression in a string. This + includes both the projection and selection clauses, but not the + question mark. + + @brief Get the constraint expression. + @return A string object that contains the constraint expression. */ +string ResponseBuilder::get_ce() const +{ + return d_ce; +} + +/** Set the constraint expression. This will filter the CE text removing + * any 'WWW' escape characters except space. Spaces are left in the CE + * because the CE parser uses whitespace to delimit tokens while some + * datasets have identifiers that contain spaces. It's possible to use + * double quotes around identifiers too, but most client software doesn't + * know about that. + * + * @@brief Set the CE + * @param _ce The constraint expression + */ +void ResponseBuilder::set_ce(string _ce) +{ + d_ce = www2id(_ce, "%", "%20"); +} + +/** The ``dataset name'' is the filename or other string that the + filter program will use to access the data. In some cases this + will indicate a disk file containing the data. In others, it + may represent a database query or some other exotic data + access method. + + @brief Get the dataset name. + @return A string object that contains the name of the dataset. */ +string ResponseBuilder::get_dataset_name() const +{ + return d_dataset; +} + +/** Set the dataset name, which is a string used to access the dataset + * on the machine running the server. That is, this is typically a pathname + * to a data file, although it doesn't have to be. This is not + * echoed in error messages (because that would reveal server + * storage patterns that data providers might want to hide). All WWW-style + * escapes are replaced except for spaces. + * + * @brief Set the dataset pathname. + * @param ds The pathname (or equivalent) to the dataset. + */ +void ResponseBuilder::set_dataset_name(const string ds) +{ + d_dataset = www2id(ds, "%", "%20"); +} +#if 0 +/** Set the server's timeout value. A value of zero (the default) means no + timeout. + + @see To establish a timeout, call establish_timeout(ostream &) + @param t Server timeout in seconds. Default is zero (no timeout). */ +void ResponseBuilder::set_timeout(int t) +{ + d_timeout = t; +} + +/** Get the server's timeout value. */ +int ResponseBuilder::get_timeout() const +{ + return d_timeout; +} + +/** Use values of this instance to establish a timeout alarm for the server. + If the timeout value is zero, do nothing. +*/ +void ResponseBuilder::establish_timeout(ostream &stream) const +{ +#ifndef WIN32 + if (d_timeout > 0) { + SignalHandler *sh = SignalHandler::instance(); + EventHandler *old_eh = sh->register_handler(SIGALRM, new AlarmHandler(stream)); + delete old_eh; + alarm(d_timeout); + } +#endif +} + +/** + * Split the CE so that the server functions that compute new values are + * separated into their own string and can be evaluated separately from + * the rest of the CE (which can contain simple and slicing projection + * as well as other types of function calls). + */ +void +ResponseBuilder::split_ce(ConstraintEvaluator &eval, const string &expr) +{ + string ce; + if (!expr.empty()) + ce = expr; + else + ce = d_ce; + + string btp_function_ce = ""; + string::size_type pos = 0; + DBG(cerr << "ce: " << ce << endl); + + string::size_type first_paren = ce.find("(", pos); + string::size_type closing_paren = ce.find(")", pos); + while (first_paren != string::npos && closing_paren != string::npos) { + // Maybe a BTP function; get the name of the potential function + string name = ce.substr(pos, first_paren-pos); + DBG(cerr << "name: " << name << endl); + // is this a BTP function + btp_func f; + if (eval.find_function(name, &f)) { + // Found a BTP function + if (!btp_function_ce.empty()) + btp_function_ce += ","; + btp_function_ce += ce.substr(pos, closing_paren+1-pos); + ce.erase(pos, closing_paren+1-pos); + if (ce[pos] == ',') + ce.erase(pos, 1); + } + else { + pos = closing_paren + 1; + // exception? + if (pos < ce.length() && ce.at(pos) == ',') + ++pos; + } + + first_paren = ce.find("(", pos); + closing_paren = ce.find(")", pos); + } + + DBG(cerr << "Modified constraint: " << ce << endl); + DBG(cerr << "BTP Function part: " << btp_function_ce << endl); + + d_ce = ce; + d_btp_func_ce = btp_function_ce; +} + +/** This function formats and prints an ASCII representation of a + DAS on stdout. This has the effect of sending the DAS object + back to the client program. + + @note This is the DAP2 attribute response. + + @brief Send a DAS. + + @param out The output stream to which the DAS is to be sent. + @param das The DAS object to be sent. + @param with_mime_headers If true (the default) send MIME headers. + @return void + @see DAS + @deprecated */ +void ResponseBuilder::send_das(ostream &out, DAS &das, bool with_mime_headers) const +{ + if (with_mime_headers) + set_mime_text(out, dods_das, x_plain, last_modified_time(d_dataset), "2.0"); + + das.print(out); + + out << flush; +} + +/** Send the DAP2 DAS response to the given stream. This version of + * send_das() uses the DDS object, assuming that it contains attribute + * information. If there is a constraint expression associated with this + * instance of ResponseBuilder, then it will be applied. This means + * that CEs that contain server functions will populate the response cache + * even if the server's initial request is for a DAS. This is different + * from the older behavior of libdap where CEs were never evaluated for + * the DAS response. This does not actually change the resulting DAS, + * just the behavior 'under the covers'. + * + * @param out Send the response to this ostream + * @param dds Use this DDS object + * @param eval A Constraint Evaluator to use for any CE bound to this + * ResponseBuilder instance + * @param constrained Should the result be constrained + * @param with_mime_headers Should MIME headers be sent to out? + */ +void ResponseBuilder::send_das(ostream &out, DDS &dds, ConstraintEvaluator &eval, bool constrained, bool with_mime_headers) +{ + // Set up the alarm. + establish_timeout(out); + dds.set_timeout(d_timeout); + + if (!constrained) { + if (with_mime_headers) + set_mime_text(out, dods_das, x_plain, last_modified_time(d_dataset), "2.0"); + + dds.print_das(out); + out << flush; + + return; + } + + split_ce(eval); + + // If there are functions, parse them and eval. + // Use that DDS and parse the non-function ce + // Serialize using the second ce and the second dds + if (!d_btp_func_ce.empty()) { + DDS *fdds = 0; + string cache_token = ""; + + if (responseCache()) { + DBG(cerr << "Using the cache for the server function CE" << endl); + fdds = responseCache()->read_cached_dataset(dds, d_btp_func_ce, this, &eval, cache_token); + } + else { + DBG(cerr << "Cache not found; (re)calculating" << endl); + eval.parse_constraint(d_btp_func_ce, dds); + fdds = eval.eval_function_clauses(dds); + } + + if (with_mime_headers) + set_mime_text(out, dods_das, x_plain, last_modified_time(d_dataset), dds.get_dap_version()); + + fdds->print_das(out); + + if (responseCache()) + responseCache()->unlock_and_close(cache_token); + + delete fdds; + } + else { + DBG(cerr << "Simple constraint" << endl); + + eval.parse_constraint(d_ce, dds); // Throws Error if the ce doesn't parse. + + if (with_mime_headers) + set_mime_text(out, dods_das, x_plain, last_modified_time(d_dataset), dds.get_dap_version()); + + dds.print_das(out); + } + + out << flush; +} + +/** This function formats and prints an ASCII representation of a + DDS on stdout. Either an entire DDS or a constrained DDS may be sent. + This function looks in the local cache and uses a DDS object there + if it's valid. Otherwise, if the request CE contains server functions + that build data for the response, the resulting DDS will be cached. + + @brief Transmit a DDS. + @param out The output stream to which the DAS is to be sent. + @param dds The DDS to send back to a client. + @param eval A reference to the ConstraintEvaluator to use. + @param constrained If this argument is true, evaluate the + current constraint expression and send the `constrained DDS' + back to the client. + @param constrained If true, apply the constraint bound to this instance + of ResponseBuilder + @param with_mime_headers If true (default) send MIME headers. + @return void + @see DDS */ +void ResponseBuilder::send_dds(ostream &out, DDS &dds, ConstraintEvaluator &eval, bool constrained, + bool with_mime_headers) +{ + if (!constrained) { + if (with_mime_headers) + set_mime_text(out, dods_dds, x_plain, last_modified_time(d_dataset), dds.get_dap_version()); + + dds.print(out); + out << flush; + return; + } + + // Set up the alarm. + establish_timeout(out); + dds.set_timeout(d_timeout); + + // Split constraint into two halves + split_ce(eval); + + // If there are functions, parse them and eval. + // Use that DDS and parse the non-function ce + // Serialize using the second ce and the second dds + if (!d_btp_func_ce.empty()) { + string cache_token = ""; + DDS *fdds = 0; + + if (responseCache()) { + DBG(cerr << "Using the cache for the server function CE" << endl); + fdds = responseCache()->read_cached_dataset(dds, d_btp_func_ce, this, &eval, cache_token); + } + else { + DBG(cerr << "Cache not found; (re)calculating" << endl); + eval.parse_constraint(d_btp_func_ce, dds); + fdds = eval.eval_function_clauses(dds); + } + + // Server functions might mark variables to use their read() + // methods. Clear that so the CE in d_ce will control what is + // sent. If that is empty (there was only a function call) all + // of the variables in the intermediate DDS (i.e., the function + // result) will be sent. + fdds->mark_all(false); + + eval.parse_constraint(d_ce, *fdds); + + if (with_mime_headers) + set_mime_text(out, dods_dds, x_plain, last_modified_time(d_dataset), dds.get_dap_version()); + + fdds->print_constrained(out); + + if (responseCache()) + responseCache()->unlock_and_close(cache_token); + + delete fdds; + } + else { + DBG(cerr << "Simple constraint" << endl); + + eval.parse_constraint(d_ce, dds); // Throws Error if the ce doesn't parse. + + if (with_mime_headers) + set_mime_text(out, dods_dds, x_plain, last_modified_time(d_dataset), dds.get_dap_version()); + + dds.print_constrained(out); + } + + out << flush; +} +#endif +/** + * Build/return the BLOB part of the DAP2 data response. + */ +void ResponseBuilder::dataset_constraint(ostream &out, DDS & dds, ConstraintEvaluator & eval, bool ce_eval) +{ + // send constrained DDS + DBG(cerr << "Inside dataset_constraint" << endl); + + dds.print_constrained(out); + out << "Data:\n"; + out << flush; + + XDRStreamMarshaller m(out); + + try { + // Send all variables in the current projection (send_p()) + for (DDS::Vars_iter i = dds.var_begin(); i != dds.var_end(); i++) + if ((*i)->send_p()) { + (*i)->serialize(eval, dds, m, ce_eval); + } + } + catch (Error & e) { + throw; + } +} + +/** Send the data in the DDS object back to the client program. The data is + encoded using a Marshaller, and enclosed in a MIME document which is all sent + to \c data_stream. + + @note This is the DAP2 data response. + + @brief Transmit data. + @param dds A DDS object containing the data to be sent. + @param eval A reference to the ConstraintEvaluator to use. + @param data_stream Write the response to this stream. + @param anc_location A directory to search for ancillary files (in + addition to the CWD). This is used in a call to + get_data_last_modified_time(). + @param with_mime_headers If true, include the MIME headers in the response. + Defaults to true. + @return void */ +void ResponseBuilder::send_data(ostream &data_stream, DDS &dds, ConstraintEvaluator &eval, bool with_mime_headers) +{ + DBG(cerr << "Simple constraint" << endl); + + eval.parse_constraint(d_ce, dds); // Throws Error if the ce doesn't parse. + + dds.tag_nested_sequences(); // Tag Sequences as Parent or Leaf node. + + if (dds.get_response_limit() != 0 && dds.get_request_size(true) > dds.get_response_limit()) { + string msg = "The Request for " + long_to_string(dds.get_request_size(true) / 1024) + + "KB is too large; requests for this user are limited to " + + long_to_string(dds.get_response_limit() / 1024) + "KB."; + throw Error(msg); + } + + if (with_mime_headers) + set_mime_binary(data_stream, dods_data, x_plain, last_modified_time(d_dataset), dds.get_dap_version()); + + dataset_constraint(data_stream, dds, eval); + data_stream << flush; +} diff -Nru libdap-3.11.1/tests/ResponseBuilder.h libdap-3.12.0/tests/ResponseBuilder.h --- libdap-3.11.1/tests/ResponseBuilder.h 1970-01-01 00:00:00.000000000 +0000 +++ libdap-3.12.0/tests/ResponseBuilder.h 2013-10-17 21:27:40.000000000 +0000 @@ -0,0 +1,74 @@ + +// -*- mode: c++; c-basic-offset:4 -*- + +// This file is part of libdap, A C++ implementation of the OPeNDAP Data +// Access Protocol. + +// Copyright (c) 2011 OPeNDAP, Inc. +// Author: James Gallagher +// +// This library is free software; you can redistribute it and/or +// modify it under the terms of the GNU Lesser General Public +// License as published by the Free Software Foundation; either +// version 2.1 of the License, or (at your option) any later version. +// +// This library 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 +// Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, write to the Free Software +// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA +// +// You can contact OPeNDAP, Inc. at PO Box 112, Saunderstown, RI. 02874-0112. + +#ifndef _response_builder_h +#define _response_builder_h + +#include + +class libdap::ConstraintEvaluator; +class libdap::DDS; + +/** + * Used for testing only. This duplicates code in the bes/dap module. + * jhrg 6/11/13 + */ + +class ResponseBuilder +{ +public: + friend class ResponseBuilderTest; + +protected: + std::string d_dataset; /// Name of the dataset/database + std::string d_ce; /// Constraint expression + std::string d_btp_func_ce; /// The BTP functions, extracted from the CE + int d_timeout; /// Response timeout after N seconds + std::string d_default_protocol; /// Version std::string for the library's default protocol version + + void initialize(); + +public: + + /** Make an empty instance. Use the set_*() methods to load with needed + values. You must call at least set_dataset_name() or be requesting + version information. */ + ResponseBuilder() { + initialize(); + } + + virtual ~ResponseBuilder(); + + virtual std::string get_ce() const; + virtual void set_ce(std::string _ce); + + virtual std::string get_dataset_name() const; + virtual void set_dataset_name(const std::string _dataset); + + virtual void dataset_constraint(std::ostream &out, libdap::DDS &dds, libdap::ConstraintEvaluator &eval, bool ce_eval = true); + virtual void send_data(std::ostream &data_stream, libdap::DDS &dds, libdap::ConstraintEvaluator &eval, bool with_mime_headers = true); +}; + +#endif // _response_builder_h diff -Nru libdap-3.11.1/tests/TestArray.cc libdap-3.12.0/tests/TestArray.cc --- libdap-3.11.1/tests/TestArray.cc 2011-04-29 13:19:29.000000000 +0000 +++ libdap-3.12.0/tests/TestArray.cc 2013-10-17 21:27:40.000000000 +0000 @@ -1,4 +1,3 @@ - // -*- mode: c++; c-basic-offset:4 -*- // This file is part of libdap, A C++ implementation of the OPeNDAP Data @@ -19,7 +18,7 @@ // // You should have received a copy of the GNU Lesser General Public // License along with this library; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA // // You can contact OPeNDAP, Inc. at PO Box 112, Saunderstown, RI. 02874-0112. @@ -50,20 +49,19 @@ //#define DODS_DEBUG -#include "ce_functions.h" +//#include "ce_functions.h" +#include "util.h" #include "debug.h" #include "TestArray.h" #include "TestCommon.h" - using std::cerr; using std::endl; extern int test_variable_sleep_interval; -void -TestArray::_duplicate(const TestArray &ts) +void TestArray::_duplicate(const TestArray &ts) { d_series_values = ts.d_series_values; } @@ -74,18 +72,18 @@ return new TestArray(*this); } -TestArray::TestArray(const string &n, BaseType *v) : Array(n, v), - d_series_values(false) +TestArray::TestArray(const string &n, BaseType *v) : + Array(n, v), d_series_values(false) { } -TestArray::TestArray(const string &n, const string &d, BaseType *v) - : Array(n, d, v), - d_series_values(false) +TestArray::TestArray(const string &n, const string &d, BaseType *v) : + Array(n, d, v), d_series_values(false) { } -TestArray::TestArray(const TestArray &rhs) : Array(rhs), TestCommon(rhs) +TestArray::TestArray(const TestArray &rhs) : + Array(rhs), TestCommon(rhs) { _duplicate(rhs); } @@ -98,9 +96,9 @@ TestArray::operator=(const TestArray &rhs) { if (this == &rhs) - return *this; + return *this; - dynamic_cast(*this) = rhs; // run Constructor= + dynamic_cast (*this) = rhs; // run Constructor= _duplicate(rhs); @@ -108,30 +106,28 @@ } /** Special names are ones that start with 'lat' or 'lon'. These indicate - that the vector (this is only for vectors) is a vector of latitude or - longitude values. */ -bool -TestArray::name_is_special() + that the vector (this is only for vectors) is a vector of latitude or + longitude values. */ +bool TestArray::name_is_special() { - return ( name().find("lat") != string::npos - || name().find("lon") != string::npos ); + return (name().find("lat") != string::npos || name().find("lon") != string::npos); } -void -TestArray::build_special_values() +void TestArray::build_special_values() { if (name().find("lat_reversed") != string::npos) { int array_len = length(); double *lat_data = new double[array_len]; for (int i = 0; i < array_len; ++i) { - lat_data[i] = -89 + (180/array_len) * (i+1); + lat_data[i] = -89 + (180 / array_len) * (i + 1); } libdap::set_array_using_double(this, lat_data, array_len); - } else if (name().find("lat") != string::npos) { + } + else if (name().find("lat") != string::npos) { int array_len = length(); double *lat_data = new double[array_len]; for (int i = 0; i < array_len; ++i) { - lat_data[i] = 90 - (180/array_len) * (i+1); + lat_data[i] = 90 - (180 / array_len) * (i + 1); } libdap::set_array_using_double(this, lat_data, array_len); } @@ -139,7 +135,7 @@ int array_len = length(); double *lon_data = new double[array_len]; for (int i = 0; i < array_len; ++i) { - lon_data[i] = (360/array_len) * (i+1); + lon_data[i] = (360 / array_len) * (i + 1); } libdap::set_array_using_double(this, lon_data, array_len); } @@ -154,17 +150,16 @@ } /** Only call this method for a two dimensional array */ -void -TestArray::constrained_matrix(char *constrained_array) +void TestArray::constrained_matrix(char *constrained_array) { int unconstrained_size = 1; Dim_iter d = dim_begin(); while (d != dim_end()) unconstrained_size *= dimension_size(d++, false); - char *whole_array = new char[unconstrained_size * width()]; + char *whole_array = new char[unconstrained_size * width(true)]; DBG(cerr << "unconstrained size: " << unconstrained_size << endl); - int elem_width = var()->width(); // size of an element + int elem_width = var()->width(true); // size of an element char *elem_val = new char[elem_width]; for (int i = 0; i < unconstrained_size; ++i) { @@ -172,54 +167,48 @@ var()->buf2val((void **) &elem_val); memcpy(whole_array + i * elem_width, elem_val, elem_width); - var()->set_read_p(false); // pick up the next value + var()->set_read_p(false); // pick up the next value } DBG(cerr << "whole_array: "; - for (int i = 0; i < unconstrained_size; ++i) { - cerr << (int)*(dods_byte*)(whole_array + (i * elem_width)) << ", "; - } - cerr << endl); + for (int i = 0; i < unconstrained_size; ++i) { + cerr << (int)*(dods_byte*)(whole_array + (i * elem_width)) << ", "; + } + cerr << endl); Dim_iter Y = dim_begin(); - Dim_iter X = Y+1; + Dim_iter X = Y + 1; char *dest = constrained_array; - DBG(cerr << "dimension_start(Y): " << dimension_start(Y) << endl); - DBG(cerr << "dimension_stop(Y): " << dimension_stop(Y) << endl); - DBG(cerr << "dimension_start(X): " << dimension_start(X) << endl); - DBG(cerr << "dimension_stop(X): " << dimension_stop(X) << endl); + DBG(cerr << "dimension_start(Y): " << dimension_start(Y) << endl); DBG(cerr << "dimension_stop(Y): " << dimension_stop(Y) << endl); DBG(cerr << "dimension_start(X): " << dimension_start(X) << endl); DBG(cerr << "dimension_stop(X): " << dimension_stop(X) << endl); int constrained_size = 0; int y = dimension_start(Y); - while (y < dimension_stop(Y)+1) { + while (y < dimension_stop(Y) + 1) { - int x = dimension_start(X); - while (x < dimension_stop(X)+1) { + int x = dimension_start(X); + while (x < dimension_stop(X) + 1) { - DBG2(cerr << "whole[" << y << "][" << x << "]: (" - << m_offset(y, Y, x) << ") " - << *(dods_byte*)(whole_array + m_offset(y, X, x)*elem_width) - << endl); - - memcpy(dest, - whole_array + m_offset(y, X, x)*elem_width, - elem_width); - - dest += elem_width; - x += dimension_stride(X); - constrained_size++; - } + DBG2(cerr << "whole[" << y << "][" << x << "]: (" + << m_offset(y, Y, x) << ") " + << *(dods_byte*)(whole_array + m_offset(y, X, x)*elem_width) + << endl); - y += dimension_stride(Y); - } + memcpy(dest, whole_array + m_offset(y, X, x) * elem_width, elem_width); - DBG(cerr << "constrained size: " << constrained_size << endl); - DBG(cerr << "constrained_array: "; - for (int i = 0; i < constrained_size; ++i) { - cerr << (int)*(dods_byte*)(constrained_array + (i * elem_width)) << ", "; + dest += elem_width; + x += dimension_stride(X); + constrained_size++; } - cerr << endl); + + y += dimension_stride(Y); + } + + DBG(cerr << "constrained size: " << constrained_size << endl); DBG(cerr << "constrained_array: "; + for (int i = 0; i < constrained_size; ++i) { + cerr << (int)*(dods_byte*)(constrained_array + (i * elem_width)) << ", "; + } + cerr << endl); delete[] whole_array; delete[] elem_val; @@ -227,29 +216,27 @@ // This code calls 'output_values()' because print_val() does not test // the value of send_p(). We need to wrap a method around the calls to -//print_val() to ensure that only values for variables with send_p() set +// print_val() to ensure that only values for variables with send_p() set // are called. In the serialize/deserialize case, the 'client' DDS only -// has variables sent by the 'server' but int he intern_data() case, the +// has variables sent by the 'server' but in the intern_data() case, the // whole DDS is still present but only variables selected in the CE have // values. -unsigned int -TestArray::print_array(ostream &out, unsigned int index, unsigned int dims, - unsigned int shape[]) +unsigned int TestArray::print_array(ostream &out, unsigned int index, unsigned int dims, unsigned int shape[]) { if (dims == 1) { - out << "{" ; + out << "{"; for (unsigned i = 0; i < shape[0] - 1; ++i) { - dynamic_cast(*var(index++)).output_values(out); - out << ", " ; + dynamic_cast (*var(index++)).output_values(out); + out << ", "; } - dynamic_cast(*var(index++)).output_values(out); - out << "}" ; + dynamic_cast (*var(index++)).output_values(out); + out << "}"; return index; } else { - out << "{" ; + out << "{"; // Fixed an off-by-one error in the following loop. Since the array // length is shape[dims-1]-1 *and* since we want one less dimension // than that, the correct limit on this loop is shape[dims-2]-1. From @@ -258,17 +245,16 @@ // 9/12/96. for (unsigned i = 0; i < shape[0] - 1; ++i) { index = print_array(out, index, dims - 1, shape + 1); - out << "," ; + out << ","; } index = print_array(out, index, dims - 1, shape + 1); - out << "}" ; + out << "}"; return index; } } -void -TestArray::output_values(std::ostream &out) +void TestArray::output_values(std::ostream &out) { unsigned int *shape = new unsigned int[dimensions(true)]; unsigned int index = 0; @@ -277,140 +263,142 @@ print_array(out, 0, dimensions(true), shape); - delete [] shape; shape = 0; + delete[] shape; + shape = 0; } -bool -TestArray::read() +bool TestArray::read() { if (read_p()) - return true; + return true; if (test_variable_sleep_interval > 0) - sleep(test_variable_sleep_interval); + sleep(test_variable_sleep_interval); unsigned int array_len = length(); // elements in the array switch (var()->type()) { - case dods_byte_c: - case dods_int16_c: - case dods_uint16_c: - case dods_int32_c: - case dods_uint32_c: - case dods_float32_c: - case dods_float64_c: { - - //char *tmp = new char[width()]; - vector tmp(width()); - - unsigned int elem_wid = var()->width(); // size of an element - char *elem_val = 0; // Null forces buf2val to allocate memory - - if (get_series_values()) { - // Special case code for vectors that have specific names. - // This is used to test code that works with lat/lon data. - if (dimensions() == 1 && name_is_special()) { - build_special_values(); - } - else if (dimensions() == 2) { - constrained_matrix(&tmp[0]); - val2buf(&tmp[0]); + case dods_byte_c: + case dods_int16_c: + case dods_uint16_c: + case dods_int32_c: + case dods_uint32_c: + case dods_float32_c: + case dods_float64_c: { + + //char *tmp = new char[width()]; + vector tmp(width(true)); + + unsigned int elem_wid = var()->width(); // size of an element + char *elem_val = 0; // Null forces buf2val to allocate memory + + if (get_series_values()) { + // Special case code for vectors that have specific names. + // This is used to test code that works with lat/lon data. + if (dimensions() == 1 && name_is_special()) { + build_special_values(); + } + else if (dimensions() == 2) { + constrained_matrix(&tmp[0]); + val2buf(&tmp[0]); + } + else { + for (unsigned i = 0; i < array_len; ++i) { + var()->read(); + var()->buf2val((void **) &elem_val); // internal buffer to ELEM_VAL + memcpy(&tmp[0] + i * elem_wid, elem_val, elem_wid); + var()->set_read_p(false); // pick up the next value + } + val2buf(&tmp[0]); + } } else { + var()->read(); + var()->buf2val((void **) &elem_val); + for (unsigned i = 0; i < array_len; ++i) { - var()->read(); - var()->buf2val((void **)&elem_val); // internal buffer to ELEM_VAL memcpy(&tmp[0] + i * elem_wid, elem_val, elem_wid); - var()->set_read_p(false); // pick up the next value - } - val2buf(&tmp[0]); - } - } - else { - var()->read(); - var()->buf2val((void **)&elem_val); + } - for (unsigned i = 0; i < array_len; ++i) { - memcpy(&tmp[0] + i * elem_wid, elem_val, elem_wid); + val2buf(&tmp[0]); } - val2buf(&tmp[0]); - } - - delete elem_val; elem_val = 0; // alloced in buf2val() - // delete[] tmp; tmp = 0; // alloced above + delete elem_val; + elem_val = 0; // alloced in buf2val() + // delete[] tmp; tmp = 0; // alloced above - break; - } + break; + } - case dods_str_c: - case dods_url_c: { - // char *tmp = new char[width()]; - vector tmp(width()); - unsigned int elem_wid = var()->width(); // size of an element - char *elem_val = 0; // Null forces buf2val to allocate memory + case dods_str_c: + case dods_url_c: { + // char *tmp = new char[width()]; + vector tmp(width(true)); + unsigned int elem_wid = var()->width(); // size of an element + char *elem_val = 0; // Null forces buf2val to allocate memory - if (get_series_values()) { + if (get_series_values()) { for (unsigned i = 0; i < array_len; ++i) { var()->read(); - var()->buf2val((void **)&elem_val); // internal buffer to ELEM_VAL + var()->buf2val((void **) &elem_val); // internal buffer to ELEM_VAL memcpy(&tmp[0] + i * elem_wid, elem_val, elem_wid); var()->set_read_p(false); // pick up the next value - } - } - else { - var()->read(); - var()->buf2val((void **)&elem_val); + } + } + else { + var()->read(); + var()->buf2val((void **) &elem_val); - for (unsigned i = 0; i < array_len; ++i) { - memcpy(&tmp[0] + i * elem_wid, elem_val, elem_wid); + for (unsigned i = 0; i < array_len; ++i) { + memcpy(&tmp[0] + i * elem_wid, elem_val, elem_wid); + } } - } - val2buf(&tmp[0]); + val2buf(&tmp[0]); - delete elem_val; elem_val = 0; // alloced in buf2val() - // delete[] tmp; tmp = 0; // alloced above + delete elem_val; + elem_val = 0; // alloced in buf2val() + // delete[] tmp; tmp = 0; // alloced above - break; - } + break; + } - case dods_structure_c: + case dods_structure_c: - // Arrays of Structure, ... must load each element into the array - // manually. Because these are stored as C++/DODS objects, there is - // no need to manipulate blocks of memory by hand as in the above - // case. - // NB: Strings are handled like Byte, etc. because, even though they - // are represented using C++ objects they are *not* represented using - // objects defined by DODS, while Structure, etc. are. + // Arrays of Structure, ... must load each element into the array + // manually. Because these are stored as C++/DODS objects, there is + // no need to manipulate blocks of memory by hand as in the above + // case. + // NB: Strings are handled like Byte, etc. because, even though they + // are represented using C++ objects they are *not* represented using + // objects defined by DODS, while Structure, etc. are. - for (unsigned i = 0; i < array_len; ++i) { + for (unsigned i = 0; i < array_len; ++i) { - // Create a new object that is a copy of `var()' (whatever that - // is). The copy will have the value read in by the read() mfunc - // executed before this switch stmt. + // Create a new object that is a copy of `var()' (whatever that + // is). The copy will have the value read in by the read() mfunc + // executed before this switch stmt. - BaseType *elem = var()->ptr_duplicate(); + BaseType *elem = var()->ptr_duplicate(); - // read values into the new instance. + // read values into the new instance. - elem->read(); + elem->read(); - // now load the new instance in the array. + // now load the new instance in the array. - set_vec(i, elem); - } + set_vec(i, elem); + } - break; + break; - case dods_sequence_c: - case dods_grid_c: - case dods_array_c: - case dods_null_c: - default: - throw InternalErr(__FILE__, __LINE__, "Bad data type"); - break; + case dods_sequence_c: + case dods_grid_c: + case dods_array_c: + case dods_null_c: + default: + throw InternalErr(__FILE__, __LINE__, "Bad data type"); + break; } set_read_p(true); @@ -418,9 +406,8 @@ return true; } -void -TestArray::set_series_values(bool sv) +void TestArray::set_series_values(bool sv) { - dynamic_cast(*var()).set_series_values(sv); + dynamic_cast (*var()).set_series_values(sv); d_series_values = sv; } diff -Nru libdap-3.11.1/tests/TestArray.h libdap-3.12.0/tests/TestArray.h --- libdap-3.11.1/tests/TestArray.h 2011-04-29 13:19:30.000000000 +0000 +++ libdap-3.12.0/tests/TestArray.h 2013-10-17 21:27:40.000000000 +0000 @@ -19,7 +19,7 @@ // // You should have received a copy of the GNU Lesser General Public // License along with this library; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA // // You can contact OPeNDAP, Inc. at PO Box 112, Saunderstown, RI. 02874-0112. diff -Nru libdap-3.11.1/tests/TestByte.cc libdap-3.12.0/tests/TestByte.cc --- libdap-3.11.1/tests/TestByte.cc 2011-04-29 13:19:29.000000000 +0000 +++ libdap-3.12.0/tests/TestByte.cc 2013-10-17 21:27:40.000000000 +0000 @@ -19,7 +19,7 @@ // // You should have received a copy of the GNU Lesser General Public // License along with this library; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA // // You can contact OPeNDAP, Inc. at PO Box 112, Saunderstown, RI. 02874-0112. @@ -46,9 +46,11 @@ #include "config.h" -#ifndef WIN32 +#ifdef HAVE_UNISTD_H #include -#else +#endif + +#ifdef WIN32 #include #include #include @@ -82,13 +84,13 @@ TestByte::TestByte(const string &n) : Byte(n), d_series_values(false) { - _buf = 255; + d_buf = 255; } TestByte::TestByte(const string &n, const string &d) : Byte(n, d), d_series_values(false) { - _buf = 255; + d_buf = 255; } BaseType * @@ -136,15 +138,15 @@ sleep(test_variable_sleep_interval); if (get_series_values()) { - _buf++; + d_buf++; } else { - _buf = 255; + d_buf = 255; } set_read_p(true); - DBG(cerr << "In TestByte::read, _buf = " << (int)_buf << endl); + DBG(cerr << "In TestByte::read, _buf = " << (int)d_buf << endl); return true; } diff -Nru libdap-3.11.1/tests/TestByte.h libdap-3.12.0/tests/TestByte.h --- libdap-3.11.1/tests/TestByte.h 2011-04-29 13:19:29.000000000 +0000 +++ libdap-3.12.0/tests/TestByte.h 2013-10-17 21:27:40.000000000 +0000 @@ -19,7 +19,7 @@ // // You should have received a copy of the GNU Lesser General Public // License along with this library; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA // // You can contact OPeNDAP, Inc. at PO Box 112, Saunderstown, RI. 02874-0112. diff -Nru libdap-3.11.1/tests/TestCommon.h libdap-3.12.0/tests/TestCommon.h --- libdap-3.11.1/tests/TestCommon.h 2011-04-29 13:19:29.000000000 +0000 +++ libdap-3.12.0/tests/TestCommon.h 2013-10-17 21:27:40.000000000 +0000 @@ -19,7 +19,7 @@ // // You should have received a copy of the GNU Lesser General Public // License along with this library; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA // // You can contact OPeNDAP, Inc. at PO Box 112, Saunderstown, RI. 02874-0112. diff -Nru libdap-3.11.1/tests/TestFloat32.cc libdap-3.12.0/tests/TestFloat32.cc --- libdap-3.11.1/tests/TestFloat32.cc 2011-04-29 13:19:29.000000000 +0000 +++ libdap-3.12.0/tests/TestFloat32.cc 2013-10-17 21:27:40.000000000 +0000 @@ -19,7 +19,7 @@ // // You should have received a copy of the GNU Lesser General Public // License along with this library; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA // // You can contact OPeNDAP, Inc. at PO Box 112, Saunderstown, RI. 02874-0112. @@ -66,13 +66,13 @@ TestFloat32::TestFloat32(const string &n) : Float32(n), d_series_values(false) { - _buf = 0.0; + d_buf = 0.0; } TestFloat32::TestFloat32(const string &n, const string &d) : Float32(n, d), d_series_values(false) { - _buf = 0.0; + d_buf = 0.0; } TestFloat32::TestFloat32(const TestFloat32 &rhs) : Float32(rhs), TestCommon(rhs) @@ -116,19 +116,19 @@ sleep(test_variable_sleep_interval); if (get_series_values()) { - _buf += 10.0; - _buf = (float)(trunc(10000 * sin(trunc(_buf))) / 100); + d_buf += 10.0; + d_buf = (float)(trunc(10000 * sin(trunc(d_buf))) / 100); /* - _buf -= 0.11 ; + d_buf -= 0.11 ; */ } else { - _buf = (float)99.999; + d_buf = (float)99.999; } set_read_p(true); - DBG(cerr << "In TestFloat32::read, _buf = " << _buf << endl); + DBG(cerr << "In TestFloat32::read, _buf = " << d_buf << endl); return true; } diff -Nru libdap-3.11.1/tests/TestFloat32.h libdap-3.12.0/tests/TestFloat32.h --- libdap-3.11.1/tests/TestFloat32.h 2011-04-29 13:19:30.000000000 +0000 +++ libdap-3.12.0/tests/TestFloat32.h 2013-10-17 21:27:40.000000000 +0000 @@ -19,7 +19,7 @@ // // You should have received a copy of the GNU Lesser General Public // License along with this library; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA // // You can contact OPeNDAP, Inc. at PO Box 112, Saunderstown, RI. 02874-0112. diff -Nru libdap-3.11.1/tests/TestFloat64.cc libdap-3.12.0/tests/TestFloat64.cc --- libdap-3.11.1/tests/TestFloat64.cc 2011-04-29 13:19:29.000000000 +0000 +++ libdap-3.12.0/tests/TestFloat64.cc 2013-10-17 21:27:40.000000000 +0000 @@ -19,7 +19,7 @@ // // You should have received a copy of the GNU Lesser General Public // License along with this library; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA // // You can contact OPeNDAP, Inc. at PO Box 112, Saunderstown, RI. 02874-0112. @@ -65,13 +65,13 @@ TestFloat64::TestFloat64(const string &n) : Float64(n), d_series_values(false) { - _buf = 0.0; + d_buf = 0.0; } TestFloat64::TestFloat64(const string &n, const string &d) : Float64(n, d), d_series_values(false) { - _buf = 0.0; + d_buf = 0.0; } TestFloat64::TestFloat64(const TestFloat64 &rhs) : Float64(rhs) , TestCommon(rhs) @@ -114,11 +114,11 @@ sleep(test_variable_sleep_interval); if (get_series_values()) { - _buf += 10.0; - _buf = (float)(trunc(10000 * cos(trunc(_buf))) / 100); + d_buf += 10.0; + d_buf = (float)(trunc(10000 * cos(trunc(d_buf))) / 100); } else { - _buf = 99.999; + d_buf = 99.999; } set_read_p(true); diff -Nru libdap-3.11.1/tests/TestFloat64.h libdap-3.12.0/tests/TestFloat64.h --- libdap-3.11.1/tests/TestFloat64.h 2011-04-29 13:19:29.000000000 +0000 +++ libdap-3.12.0/tests/TestFloat64.h 2013-10-17 21:27:40.000000000 +0000 @@ -19,7 +19,7 @@ // // You should have received a copy of the GNU Lesser General Public // License along with this library; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA // // You can contact OPeNDAP, Inc. at PO Box 112, Saunderstown, RI. 02874-0112. diff -Nru libdap-3.11.1/tests/TestGrid.cc libdap-3.12.0/tests/TestGrid.cc --- libdap-3.11.1/tests/TestGrid.cc 2011-04-29 13:19:29.000000000 +0000 +++ libdap-3.12.0/tests/TestGrid.cc 2013-10-17 21:27:40.000000000 +0000 @@ -19,7 +19,7 @@ // // You should have received a copy of the GNU Lesser General Public // License along with this library; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA // // You can contact OPeNDAP, Inc. at PO Box 112, Saunderstown, RI. 02874-0112. @@ -130,20 +130,17 @@ { } -bool -TestGrid::read() +bool TestGrid::read() { if (read_p()) - return true; + return true; get_array()->read(); - for (Map_iter i = map_begin(); i != map_end(); i++) - { - if (!(*i)->read()) - { - return false; - } + for (Map_iter i = map_begin(); i != map_end(); i++) { + if (!(*i)->read()) { + return false; + } } set_read_p(true); diff -Nru libdap-3.11.1/tests/TestGrid.h libdap-3.12.0/tests/TestGrid.h --- libdap-3.11.1/tests/TestGrid.h 2011-04-29 13:19:29.000000000 +0000 +++ libdap-3.12.0/tests/TestGrid.h 2013-10-17 21:27:40.000000000 +0000 @@ -19,7 +19,7 @@ // // You should have received a copy of the GNU Lesser General Public // License along with this library; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA // // You can contact OPeNDAP, Inc. at PO Box 112, Saunderstown, RI. 02874-0112. diff -Nru libdap-3.11.1/tests/TestInt16.cc libdap-3.12.0/tests/TestInt16.cc --- libdap-3.11.1/tests/TestInt16.cc 2011-04-29 13:19:29.000000000 +0000 +++ libdap-3.12.0/tests/TestInt16.cc 2013-10-17 21:27:40.000000000 +0000 @@ -19,7 +19,7 @@ // // You should have received a copy of the GNU Lesser General Public // License along with this library; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA // // You can contact OPeNDAP, Inc. at PO Box 112, Saunderstown, RI. 02874-0112. @@ -56,13 +56,13 @@ TestInt16::TestInt16(const string &n) : Int16(n), d_series_values(false) { - _buf = 1; + d_buf = 1; } TestInt16::TestInt16(const string &n, const string &d) : Int16(n, d), d_series_values(false) { - _buf = 1; + d_buf = 1; } TestInt16::TestInt16(const TestInt16 &rhs) : Int16(rhs), TestCommon(rhs) @@ -106,10 +106,10 @@ sleep(test_variable_sleep_interval); if (get_series_values()) { - _buf = (short)(16 * _buf); + d_buf = (short)(16 * d_buf); } else { - _buf = 32000; + d_buf = 32000; } set_read_p(true); diff -Nru libdap-3.11.1/tests/TestInt16.h libdap-3.12.0/tests/TestInt16.h --- libdap-3.11.1/tests/TestInt16.h 2011-04-29 13:19:29.000000000 +0000 +++ libdap-3.12.0/tests/TestInt16.h 2013-10-17 21:27:40.000000000 +0000 @@ -19,7 +19,7 @@ // // You should have received a copy of the GNU Lesser General Public // License along with this library; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA // // You can contact OPeNDAP, Inc. at PO Box 112, Saunderstown, RI. 02874-0112. diff -Nru libdap-3.11.1/tests/TestInt32.cc libdap-3.12.0/tests/TestInt32.cc --- libdap-3.11.1/tests/TestInt32.cc 2011-04-29 13:19:29.000000000 +0000 +++ libdap-3.12.0/tests/TestInt32.cc 2013-10-17 21:27:40.000000000 +0000 @@ -19,7 +19,7 @@ // // You should have received a copy of the GNU Lesser General Public // License along with this library; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA // // You can contact OPeNDAP, Inc. at PO Box 112, Saunderstown, RI. 02874-0112. @@ -59,13 +59,13 @@ TestInt32::TestInt32(const string &n) : Int32(n), d_series_values(false) { - _buf = 1; + d_buf = 1; } TestInt32::TestInt32(const string &n, const string &) : Int32(n), d_series_values(false) { - _buf = 1; + d_buf = 1; } TestInt32::TestInt32(const TestInt32 &rhs) : Int32(rhs), TestCommon(rhs) @@ -109,17 +109,17 @@ sleep(test_variable_sleep_interval); if (get_series_values()) { - _buf = 32 * _buf; - if (!_buf) - _buf = 32; + d_buf = 32 * d_buf; + if (!d_buf) + d_buf = 32; } else { - _buf = 123456789; + d_buf = 123456789; } set_read_p(true); - DBG(cerr << "In TestInt32::read, _buf = " << _buf << endl); + DBG(cerr << "In TestInt32::read, _buf = " << d_buf << endl); return true; } diff -Nru libdap-3.11.1/tests/TestInt32.h libdap-3.12.0/tests/TestInt32.h --- libdap-3.11.1/tests/TestInt32.h 2011-04-29 13:19:29.000000000 +0000 +++ libdap-3.12.0/tests/TestInt32.h 2013-10-17 21:27:40.000000000 +0000 @@ -19,7 +19,7 @@ // // You should have received a copy of the GNU Lesser General Public // License along with this library; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA // // You can contact OPeNDAP, Inc. at PO Box 112, Saunderstown, RI. 02874-0112. diff -Nru libdap-3.11.1/tests/TestSequence.cc libdap-3.12.0/tests/TestSequence.cc --- libdap-3.11.1/tests/TestSequence.cc 2011-04-29 13:19:30.000000000 +0000 +++ libdap-3.12.0/tests/TestSequence.cc 2013-10-17 21:27:40.000000000 +0000 @@ -19,7 +19,7 @@ // // You should have received a copy of the GNU Lesser General Public // License along with this library; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA // // You can contact OPeNDAP, Inc. at PO Box 112, Saunderstown, RI. 02874-0112. diff -Nru libdap-3.11.1/tests/TestSequence.h libdap-3.12.0/tests/TestSequence.h --- libdap-3.11.1/tests/TestSequence.h 2011-04-29 13:19:29.000000000 +0000 +++ libdap-3.12.0/tests/TestSequence.h 2013-10-17 21:27:40.000000000 +0000 @@ -19,7 +19,7 @@ // // You should have received a copy of the GNU Lesser General Public // License along with this library; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA // // You can contact OPeNDAP, Inc. at PO Box 112, Saunderstown, RI. 02874-0112. diff -Nru libdap-3.11.1/tests/TestStr.cc libdap-3.12.0/tests/TestStr.cc --- libdap-3.11.1/tests/TestStr.cc 2011-04-29 13:19:30.000000000 +0000 +++ libdap-3.12.0/tests/TestStr.cc 2013-10-17 21:27:40.000000000 +0000 @@ -19,7 +19,7 @@ // // You should have received a copy of the GNU Lesser General Public // License along with this library; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA // // You can contact OPeNDAP, Inc. at PO Box 112, Saunderstown, RI. 02874-0112. diff -Nru libdap-3.11.1/tests/TestStr.h libdap-3.12.0/tests/TestStr.h --- libdap-3.11.1/tests/TestStr.h 2011-04-29 13:19:29.000000000 +0000 +++ libdap-3.12.0/tests/TestStr.h 2013-10-17 21:27:40.000000000 +0000 @@ -19,7 +19,7 @@ // // You should have received a copy of the GNU Lesser General Public // License along with this library; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA // // You can contact OPeNDAP, Inc. at PO Box 112, Saunderstown, RI. 02874-0112. diff -Nru libdap-3.11.1/tests/TestStructure.cc libdap-3.12.0/tests/TestStructure.cc --- libdap-3.11.1/tests/TestStructure.cc 2011-04-29 13:19:29.000000000 +0000 +++ libdap-3.12.0/tests/TestStructure.cc 2013-10-17 21:27:40.000000000 +0000 @@ -19,7 +19,7 @@ // // You should have received a copy of the GNU Lesser General Public // License along with this library; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA // // You can contact OPeNDAP, Inc. at PO Box 112, Saunderstown, RI. 02874-0112. @@ -33,7 +33,7 @@ // // jhrg 1/12/95 -#define DODS_DEBUG +//#define DODS_DEBUG #include "config.h" #include "TestStructure.h" diff -Nru libdap-3.11.1/tests/TestStructure.h libdap-3.12.0/tests/TestStructure.h --- libdap-3.11.1/tests/TestStructure.h 2011-04-29 13:19:29.000000000 +0000 +++ libdap-3.12.0/tests/TestStructure.h 2013-10-17 21:27:40.000000000 +0000 @@ -19,7 +19,7 @@ // // You should have received a copy of the GNU Lesser General Public // License along with this library; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA // // You can contact OPeNDAP, Inc. at PO Box 112, Saunderstown, RI. 02874-0112. diff -Nru libdap-3.11.1/tests/TestTypeFactory.cc libdap-3.12.0/tests/TestTypeFactory.cc --- libdap-3.11.1/tests/TestTypeFactory.cc 2011-04-29 13:19:30.000000000 +0000 +++ libdap-3.12.0/tests/TestTypeFactory.cc 2013-10-17 21:27:40.000000000 +0000 @@ -19,7 +19,7 @@ // // You should have received a copy of the GNU Lesser General Public // License along with this library; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA // // You can contact OPeNDAP, Inc. at PO Box 112, Saunderstown, RI. 02874-0112. diff -Nru libdap-3.11.1/tests/TestTypeFactory.h libdap-3.12.0/tests/TestTypeFactory.h --- libdap-3.11.1/tests/TestTypeFactory.h 2011-04-29 13:19:30.000000000 +0000 +++ libdap-3.12.0/tests/TestTypeFactory.h 2013-10-17 21:27:40.000000000 +0000 @@ -19,7 +19,7 @@ // // You should have received a copy of the GNU Lesser General Public // License along with this library; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA // // You can contact OPeNDAP, Inc. at PO Box 112, Saunderstown, RI. 02874-0112. diff -Nru libdap-3.11.1/tests/TestUInt16.cc libdap-3.12.0/tests/TestUInt16.cc --- libdap-3.11.1/tests/TestUInt16.cc 2011-04-29 13:19:29.000000000 +0000 +++ libdap-3.12.0/tests/TestUInt16.cc 2013-10-17 21:27:40.000000000 +0000 @@ -19,7 +19,7 @@ // // You should have received a copy of the GNU Lesser General Public // License along with this library; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA // // You can contact OPeNDAP, Inc. at PO Box 112, Saunderstown, RI. 02874-0112. @@ -57,13 +57,13 @@ TestUInt16::TestUInt16(const string &n) : UInt16(n), d_series_values(false) { - _buf = 1; + d_buf = 1; } TestUInt16::TestUInt16(const string &n, const string &d) : UInt16(n, d), d_series_values(false) { - _buf = 1; + d_buf = 1; } TestUInt16::TestUInt16(const TestUInt16 &rhs) : UInt16(rhs), TestCommon(rhs) @@ -107,10 +107,10 @@ sleep(test_variable_sleep_interval); if (get_series_values()) { - _buf = (short)(16 * _buf); + d_buf = (short)(16 * d_buf); } else { - _buf = 64000; + d_buf = 64000; } set_read_p(true); diff -Nru libdap-3.11.1/tests/TestUInt16.h libdap-3.12.0/tests/TestUInt16.h --- libdap-3.11.1/tests/TestUInt16.h 2011-04-29 13:19:30.000000000 +0000 +++ libdap-3.12.0/tests/TestUInt16.h 2013-10-17 21:27:40.000000000 +0000 @@ -19,7 +19,7 @@ // // You should have received a copy of the GNU Lesser General Public // License along with this library; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA // // You can contact OPeNDAP, Inc. at PO Box 112, Saunderstown, RI. 02874-0112. diff -Nru libdap-3.11.1/tests/TestUInt32.cc libdap-3.12.0/tests/TestUInt32.cc --- libdap-3.11.1/tests/TestUInt32.cc 2011-04-29 13:19:29.000000000 +0000 +++ libdap-3.12.0/tests/TestUInt32.cc 2013-10-17 21:27:40.000000000 +0000 @@ -19,7 +19,7 @@ // // You should have received a copy of the GNU Lesser General Public // License along with this library; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA // // You can contact OPeNDAP, Inc. at PO Box 112, Saunderstown, RI. 02874-0112. @@ -57,13 +57,13 @@ TestUInt32::TestUInt32(const string &n) : UInt32(n), d_series_values(false) { - _buf = 1; + d_buf = 1; } TestUInt32::TestUInt32(const string &n, const string &d) : UInt32(n, d), d_series_values(false) { - _buf = 1; + d_buf = 1; } TestUInt32::TestUInt32(const TestUInt32 &rhs) : UInt32(rhs), TestCommon(rhs) @@ -107,10 +107,10 @@ sleep(test_variable_sleep_interval); if (get_series_values()) { - _buf = 32 * _buf; + d_buf = 32 * d_buf; } else { - _buf = 0xf0000000; // about 4 billion + d_buf = 0xf0000000; // about 4 billion } set_read_p(true); diff -Nru libdap-3.11.1/tests/TestUInt32.h libdap-3.12.0/tests/TestUInt32.h --- libdap-3.11.1/tests/TestUInt32.h 2011-04-29 13:19:30.000000000 +0000 +++ libdap-3.12.0/tests/TestUInt32.h 2013-10-17 21:27:40.000000000 +0000 @@ -19,7 +19,7 @@ // // You should have received a copy of the GNU Lesser General Public // License along with this library; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA // // You can contact OPeNDAP, Inc. at PO Box 112, Saunderstown, RI. 02874-0112. diff -Nru libdap-3.11.1/tests/TestUrl.cc libdap-3.12.0/tests/TestUrl.cc --- libdap-3.11.1/tests/TestUrl.cc 2011-04-29 13:19:29.000000000 +0000 +++ libdap-3.12.0/tests/TestUrl.cc 2013-10-17 21:27:40.000000000 +0000 @@ -19,7 +19,7 @@ // // You should have received a copy of the GNU Lesser General Public // License along with this library; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA // // You can contact OPeNDAP, Inc. at PO Box 112, Saunderstown, RI. 02874-0112. @@ -60,7 +60,7 @@ { } -TestUrl::TestUrl(const string &n, const string &d) +TestUrl::TestUrl(const string &n, const string &) : Url(n), d_series_values(false) { } diff -Nru libdap-3.11.1/tests/TestUrl.h libdap-3.12.0/tests/TestUrl.h --- libdap-3.11.1/tests/TestUrl.h 2011-04-29 13:19:29.000000000 +0000 +++ libdap-3.12.0/tests/TestUrl.h 2013-10-17 21:27:40.000000000 +0000 @@ -19,7 +19,7 @@ // // You should have received a copy of the GNU Lesser General Public // License along with this library; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA // // You can contact OPeNDAP, Inc. at PO Box 112, Saunderstown, RI. 02874-0112. diff -Nru libdap-3.11.1/tests/atconfig libdap-3.12.0/tests/atconfig --- libdap-3.11.1/tests/atconfig 2011-05-06 17:50:24.000000000 +0000 +++ libdap-3.12.0/tests/atconfig 2013-10-17 21:27:40.000000000 +0000 @@ -1,16 +1,16 @@ # Configurable variable values for building test suites. # Generated by ./config.status. -# Copyright (C) 2009 Free Software Foundation, Inc. +# Copyright (C) 2012 Free Software Foundation, Inc. # The test suite will define top_srcdir=/../.. etc. at_testdir='tests' -abs_builddir='/Users/ndp/OPeNDAP/Projects/Hyrax/swdev/hyrax-1.7.0/src/libdap/tests' +abs_builddir='/home/jimg/src/hyrax_1.9_release/src/libdap/tests' at_srcdir='.' -abs_srcdir='/Users/ndp/OPeNDAP/Projects/Hyrax/swdev/hyrax-1.7.0/src/libdap/tests' +abs_srcdir='/home/jimg/src/hyrax_1.9_release/src/libdap/tests' at_top_srcdir='..' -abs_top_srcdir='/Users/ndp/OPeNDAP/Projects/Hyrax/swdev/hyrax-1.7.0/src/libdap' +abs_top_srcdir='/home/jimg/src/hyrax_1.9_release/src/libdap' at_top_build_prefix='../' -abs_top_builddir='/Users/ndp/OPeNDAP/Projects/Hyrax/swdev/hyrax-1.7.0/src/libdap' +abs_top_builddir='/home/jimg/src/hyrax_1.9_release/src/libdap' # Backward compatibility with Autotest <= 2.59b: at_top_builddir=$at_top_build_prefix diff -Nru libdap-3.11.1/tests/das-test.cc libdap-3.12.0/tests/das-test.cc --- libdap-3.11.1/tests/das-test.cc 2011-04-29 13:19:29.000000000 +0000 +++ libdap-3.12.0/tests/das-test.cc 2013-10-17 21:27:40.000000000 +0000 @@ -19,7 +19,7 @@ // // You should have received a copy of the GNU Lesser General Public // License along with this library; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA // // You can contact OPeNDAP, Inc. at PO Box 112, Saunderstown, RI. 02874-0112. @@ -38,8 +38,6 @@ #include "config.h" -static char rcsid[] not_used = {"$Id: das-test.cc 22703 2010-05-11 18:10:01Z jimg $"}; - #include #include #include @@ -213,6 +211,7 @@ default: fprintf( stdout, "Error: Unrecognized input\n" ) ; + break; } fprintf( stdout, "%s", prompt ) ; // print prompt after output fflush( stdout ) ; diff -Nru libdap-3.11.1/tests/das-testsuite/test.34.das.base libdap-3.12.0/tests/das-testsuite/test.34.das.base --- libdap-3.11.1/tests/das-testsuite/test.34.das.base 2011-04-29 13:19:28.000000000 +0000 +++ libdap-3.12.0/tests/das-testsuite/test.34.das.base 2013-10-17 21:27:40.000000000 +0000 @@ -1,6 +1,6 @@ Attributes { var1 { - Int32 y%23z 15; + Int32 y#z 15; component1 { inner%20component { String tag "xyz123"; diff -Nru libdap-3.11.1/tests/dds-test.cc libdap-3.12.0/tests/dds-test.cc --- libdap-3.11.1/tests/dds-test.cc 2011-04-29 13:19:30.000000000 +0000 +++ libdap-3.12.0/tests/dds-test.cc 2013-10-17 21:27:40.000000000 +0000 @@ -1,4 +1,3 @@ - // -*- mode: c++; c-basic-offset:4 -*- // This file is part of libdap, A C++ implementation of the OPeNDAP Data @@ -19,7 +18,7 @@ // // You should have received a copy of the GNU Lesser General Public // License along with this library; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA // // You can contact OPeNDAP, Inc. at PO Box 112, Saunderstown, RI. 02874-0112. @@ -35,7 +34,7 @@ #include "config.h" -static char rcsid[] not_used = {"$Id: dds-test.cc 22703 2010-05-11 18:10:01Z jimg $"}; +#include #include @@ -47,226 +46,277 @@ #include "util.h" #include "Error.h" -using namespace libdap ; +#ifdef DAP4 +#include "D4ParserSax2.h" +#include "D4BaseTypeFactory.h" +#endif + +using namespace libdap; void test_scanner(); -void test_parser(); +void test_parser(const string &name); void test_class(); +void test_dap4_parser(const string &name); int ddslex(); -int ddsparse(DDS &); +// int ddsparse(DDS &); extern YYSTYPE ddslval; extern int ddsdebug; +static bool print_ddx = false; + const char *prompt = "dds-test: "; -void -usage(string name) -{ - fprintf( stderr, "usage: %s %s\n %s\n %s\n %s\n %s\n %s\n %s\n %s\n", - name.c_str(), - "[s] [pd] [c]", - "s: Test the scanner.", - "p: Test the parser; reads from stdin and prints the", - " internal structure to stdout.", - "d: Turn on parser debugging. (only for the hard core.)", - "c: Test the C++ code for manipulating DDS objects.", - " Reads from stdin, parses and writes the modified DDS", - " to stdout." ) ; +void usage(string name) { + fprintf(stderr, "usage: %s %s\n %s\n %s\n %s\n %s\n %s\n %s\n %s\n", name.c_str(), "[s] [pd] [c]", + "s: Test the scanner.", "p: Test the parser; reads from stdin and prints the", + " internal structure to stdout.", "d: Turn on parser debugging. (only for the hard core.)", + "c: Test the C++ code for manipulating DDS objects.", + " Reads from stdin, parses and writes the modified DDS", " to stdout."); } -int -main(int argc, char *argv[]) -{ - GetOpt getopt (argc, argv, "spdc"); +int main(int argc, char *argv[]) { + GetOpt getopt(argc, argv, "spP:dfF:cx"); int option_char; int scanner_test = 0, parser_test = 0, class_test = 0; - + int dap4_parser_test = 0; + string name = ""; // process options - while ((option_char = getopt ()) != EOF) - switch (option_char) - { - case 'd': - ddsdebug = 1; - break; - case 's': - scanner_test = 1; - break; - case 'p': - parser_test = 1; - break; - case 'c': - class_test = 1; - break; - case '?': - default: - usage(argv[0]); - return 1; - } - - if (!scanner_test && !parser_test && !class_test) { - usage(argv[0]); - return 1; + while ((option_char = getopt()) != EOF) + switch (option_char) { + case 'd': + ddsdebug = 1; + break; + case 's': + scanner_test = 1; + break; + case 'p': + parser_test = 1; + break; + case 'P': + parser_test = 1; + name = getopt.optarg; + break; + + case 'f': + dap4_parser_test = 1; + break; + + case 'F': + dap4_parser_test = 1; + name = getopt.optarg; + break; + + case 'x': + print_ddx = true; + break; + case 'c': + class_test = 1; + break; + case '?': + default: + usage(argv[0]); + return 1; + } + + if (!scanner_test && !parser_test && !class_test && !dap4_parser_test) { + usage(argv[0]); + return 1; } try { - if (scanner_test) { - test_scanner(); - } - - if (parser_test) { - test_parser(); - } - - if (class_test) { - test_class(); - } + if (scanner_test) + test_scanner(); + + if (parser_test) + test_parser(name); + + if (dap4_parser_test) + test_dap4_parser(name); + + if (class_test) + test_class(); } catch (Error &e) { - cerr << e.get_error_message() << endl; + cerr << e.get_error_message() << endl; } } -void -test_scanner(void) -{ +void test_scanner(void) { int tok; cout << prompt << flush; // first prompt while ((tok = ddslex())) { - switch (tok) { - case SCAN_DATASET: - cout << "DATASET" << endl; - break; - case SCAN_LIST: - cout << "LIST" << endl; - break; - case SCAN_SEQUENCE: - cout << "SEQUENCE" << endl; - break; - case SCAN_STRUCTURE: - cout << "STRUCTURE" << endl; - break; - case SCAN_FUNCTION: - cout << "FUNCTION" << endl; - break; - case SCAN_GRID: - cout << "GRID" << endl; - break; - case SCAN_BYTE: - cout << "BYTE" << endl; - break; - case SCAN_INT16: - cout << "INT16" << endl; - break; - case SCAN_UINT16: - cout << "UINT16" << endl; - break; - case SCAN_INT32: - cout << "INT32" << endl; - break; - case SCAN_UINT32: - cout << "UINT32" << endl; - break; - case SCAN_FLOAT32: - cout << "FLOAT32" << endl; - break; - case SCAN_FLOAT64: - cout << "FLOAT64" << endl; - break; - case SCAN_STRING: - cout << "STRING" << endl; - break; - case SCAN_URL: - cout << "Url" << endl; - break; - case SCAN_WORD: - cout << "WORD: " << ddslval.word << endl; - break; - case '{': - cout << "Left Brace" << endl; - break; - case '}': - cout << "Right Brace" << endl; - break; - case '[': - cout << "Left Bracket" << endl; - break; - case ']': - cout << "Right Bracket" << endl; - break; - case ';': - cout << "Semicolon" << endl; - break; - case ':': - cout << "Colon" << endl; - break; - case '=': - cout << "Assignment" << endl; - break; - default: - cout << "Error: Unrecognized input" << endl; - } - cout << prompt << flush; // print prompt after output + switch (tok) { + case SCAN_DATASET: + cout << "DATASET" << endl; + break; + case SCAN_LIST: + cout << "LIST" << endl; + break; + case SCAN_SEQUENCE: + cout << "SEQUENCE" << endl; + break; + case SCAN_STRUCTURE: + cout << "STRUCTURE" << endl; + break; + case SCAN_FUNCTION: + cout << "FUNCTION" << endl; + break; + case SCAN_GRID: + cout << "GRID" << endl; + break; + case SCAN_BYTE: + cout << "BYTE" << endl; + break; + case SCAN_INT16: + cout << "INT16" << endl; + break; + case SCAN_UINT16: + cout << "UINT16" << endl; + break; + case SCAN_INT32: + cout << "INT32" << endl; + break; + case SCAN_UINT32: + cout << "UINT32" << endl; + break; + case SCAN_FLOAT32: + cout << "FLOAT32" << endl; + break; + case SCAN_FLOAT64: + cout << "FLOAT64" << endl; + break; + case SCAN_STRING: + cout << "STRING" << endl; + break; + case SCAN_URL: + cout << "Url" << endl; + break; + case SCAN_WORD: + cout << "WORD: " << ddslval.word << endl; + break; + case '{': + cout << "Left Brace" << endl; + break; + case '}': + cout << "Right Brace" << endl; + break; + case '[': + cout << "Left Bracket" << endl; + break; + case ']': + cout << "Right Bracket" << endl; + break; + case ';': + cout << "Semicolon" << endl; + break; + case ':': + cout << "Colon" << endl; + break; + case '=': + cout << "Assignment" << endl; + break; + default: + cout << "Error: Unrecognized input" << endl; + break; + } + cout << prompt << flush; // print prompt after output } } -void -test_parser(void) -{ +void test_parser(const string &name) { BaseTypeFactory *factory = new BaseTypeFactory; DDS table(factory); - table.parse(); + if (name.empty()) + table.parse(); + else + table.parse(name); if (table.check_semantics()) - cout << "DDS past semantic check" << endl ; + cout << "DDS past semantic check" << endl; else - cout << "DDS failed semantic check" << endl ; + cout << "DDS failed semantic check" << endl; if (table.check_semantics(true)) - cout << "DDS past full semantic check" << endl ; + cout << "DDS past full semantic check" << endl; + else + cout << "DDS failed full semantic check" << endl; + + if (print_ddx) + table.print_xml_writer(cout, false, ""); else - cout << "DDS failed full semantic check" << endl ; + table.print(cout); - table.print( cout ); + delete factory; + factory = 0; +} + +void test_dap4_parser(const string &/*name*/) { +#ifdef DAP4 + D4BaseTypeFactory factory; + + DDS table(&factory); + D4ParserSax2 parser; + if (name.empty()) { + parser.intern(cin, &table); + } + else { + fstream in(name.c_str(), ios_base::in); + parser.intern(in, &table); + } - delete factory; factory = 0; + if (table.check_semantics()) + cout << "DAP4 DDS past semantic check" << endl; + else + cout << "DAP4 DDS failed semantic check" << endl; + + if (table.check_semantics(true)) + cout << "DAP4 DDS past full semantic check" << endl; + else + cout << "DAP4 DDS failed full semantic check" << endl; + + if (print_ddx) + table.print_xml_writer(cout, false, ""); + else + table.print(cout); +#else + cerr << "DAP4 parsing not supported by this version of libdap" << endl; +#endif } -void -test_class(void) -{ +void test_class(void) { BaseTypeFactory *factory = new BaseTypeFactory; DDS table(factory); table.parse(); if (table.check_semantics()) - cout << "DDS past semantic check" << endl ; + cout << "DDS past semantic check" << endl; else - cout << "DDS filed semantic check" << endl ; + cout << "DDS filed semantic check" << endl; if (table.check_semantics(true)) - cout << "DDS past full semantic check" << endl ; + cout << "DDS past full semantic check" << endl; else - cout << "DDS filed full semantic check" << endl ; + cout << "DDS filed full semantic check" << endl; - table.print( cout ); + table.print(cout); - DDS table2 = table; // test copy ctor; - table2.print( cout ); + DDS table2 = table; // test copy ctor; + table2.print(cout); BaseTypeFactory *factory2 = new BaseTypeFactory; DDS table3(factory2); - table3 = table; // test operator= + table3 = table; // test operator= - cout << "Dataset name: " << table.get_dataset_name() << endl ; + cout << "Dataset name: " << table.get_dataset_name() << endl; string name = "goofy"; table.add_var(table.get_factory()->NewInt32(name)); // table dtor should delete this object - table.print( cout ); + table.print(cout); BaseType *btp = table.var(name); @@ -274,11 +324,11 @@ table.del_var(name); - table.print( cout ); + table.print(cout); table.add_var(table.get_factory()->NewInt32("goofy")); - table.print( cout ); + table.print(cout); btp = table.var("goofy"); @@ -286,12 +336,14 @@ table.del_var("goofy"); - table.print( cout ); + table.print(cout); for (DDS::Vars_iter p = table.var_begin(); p != table.var_end(); p++) - (*p)->print_decl(cout, "", true); // print them all w/semicolons + (*p)->print_decl(cout, "", true); // print them all w/semicolons - delete factory; factory = 0; - delete factory2; factory2 = 0; + delete factory; + factory = 0; + delete factory2; + factory2 = 0; } diff -Nru libdap-3.11.1/tests/expr-test.cc libdap-3.12.0/tests/expr-test.cc --- libdap-3.11.1/tests/expr-test.cc 2011-04-29 13:19:29.000000000 +0000 +++ libdap-3.12.0/tests/expr-test.cc 2013-10-17 21:27:40.000000000 +0000 @@ -19,7 +19,7 @@ // // You should have received a copy of the GNU Lesser General Public // License along with this library; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA // // You can contact OPeNDAP, Inc. at PO Box 112, Saunderstown, RI. 02874-0112. @@ -35,20 +35,16 @@ #include "config.h" -#define DODS_DEBUG - -static char rcsid[] not_used = - { "$Id: expr-test.cc 24082 2011-02-08 18:44:27Z jimg $" }; +//#define DODS_DEBUG #include #include -#ifndef WIN32 +#ifdef HAVE_UNISTD_H #include #endif #include #include - #include #include #include @@ -59,12 +55,8 @@ #include "DDS.h" #include "DataDDS.h" #include "ConstraintEvaluator.h" -#include "XDRFileUnMarshaller.h" #include "XDRStreamUnMarshaller.h" #include "XDRStreamMarshaller.h" -#if 0 -#include "DODSFilter.h" -#endif #include "ResponseBuilder.h" #include "Response.h" #include "Connect.h" @@ -104,7 +96,7 @@ const string & ce, const bool series_values); int ce_exprlex(); // exprlex() uses the global ce_exprlval -int ce_exprparse(void *arg); +// int ce_exprparse(void *arg); void ce_exprrestart(FILE * in); // Glue routines declared in expr.lex @@ -114,7 +106,9 @@ extern int ce_exprdebug; +#if 0 static int keep_temps = 0; // MT-safe; test code. +#endif const string version = "version 1.12"; const string prompt = "expr-test: "; @@ -277,7 +271,6 @@ // Instead of reading the tokens from stdin, read them from a string. - void test_scanner(const string & str) { ce_exprrestart(0); @@ -324,8 +317,8 @@ case SCAN_REGEXP: cout << "REGEXP: " << ce_exprlval.op << endl; break; - case '*': - cout << "Dereference" << endl; + case SCAN_STAR: + cout << "STAR: " << ce_exprlval.op << endl; break; case '.': cout << "Field Selector" << endl; @@ -357,8 +350,12 @@ case '&': cout << "Ampersand" << endl; break; + case SCAN_HASH_INT32: + cout << "Hash Int32" << endl; + break; default: cout << "Error: Unrecognized input" << endl; + break; } cout << prompt << flush; // print prompt after output @@ -511,37 +508,22 @@ ResponseBuilder df; df.set_ce(ce); df.set_dataset_name(dds_name); - // df.set_URL("test://test"); - // df.set_response("DataDDS"); ofstream out("expr-test-data.bin", ios::out|ios::trunc|ios::binary); -#if 0 - df.send_data(server, eval, out, "", false); -#endif df.send_data(out, server, eval, true); - //cout << "Server protocol version: " << server.get_dap_major() << "." << server.get_dap_minor() << endl; out.close(); // Now do what Connect::request_data() does: FILE *fp = fopen("expr-test-data.bin", "r"); Response r(fp, 400); -#if 0 - r.set_type(dods_data); - r.set_protocol("3.2"); -#endif Connect c("http://dummy_argument"); BaseTypeFactory factory; DataDDS dds(&factory, "Test_data", "DAP/3.2"); // Must use DataDDS on receiving end -#if 0 - c.read_data_no_mime(dds, &r); -#endif c.read_data(dds, &r); - //cout << "Protocol version: " << dds.get_protocol() << endl; - cout << "The data:" << endl; for (DDS::Vars_iter q = dds.var_begin(); q != dds.var_end(); q++) { (*q)->print_val(cout); @@ -595,19 +577,6 @@ server.tag_nested_sequences(); // Tag Sequences as Parent or Leaf node. -#if 0 - if (eval.functional_expression()) { - BaseType *var = eval.eval_function(server, dds_name); - if (!var) - throw Error(unknown_error, "Error calling the CE function."); - - var->intern_data(eval, server); - - var->set_send_p(true); - server.add_var(var); - } -#endif - if (eval.function_clauses()) { DDS *fdds = eval.eval_function_clauses(server); diff -Nru libdap-3.11.1/tests/expr-testsuite/test.5e.base libdap-3.12.0/tests/expr-testsuite/test.5e.base --- libdap-3.11.1/tests/expr-testsuite/test.5e.base 2011-04-29 13:19:29.000000000 +0000 +++ libdap-3.12.0/tests/expr-testsuite/test.5e.base 2013-10-17 21:27:40.000000000 +0000 @@ -1 +1 @@ -Error: The number of dimensions in the constraint for g must match the number in the grid. +Error: The number of dimensions in the constraint for g must match the number in the grid. \ No newline at end of file diff -Nru libdap-3.11.1/tests/expr-testsuite/test.6b.base libdap-3.12.0/tests/expr-testsuite/test.6b.base --- libdap-3.11.1/tests/expr-testsuite/test.6b.base 2011-04-29 13:19:29.000000000 +0000 +++ libdap-3.12.0/tests/expr-testsuite/test.6b.base 2013-10-17 21:27:40.000000000 +0000 @@ -1,2 +1 @@ -Error: The number of dimensions in the constraint for i must match the number in the array. - \ No newline at end of file +Error: The number of dimensions in the constraint for i must match the number in the array. \ No newline at end of file diff -Nru libdap-3.11.1/tests/package.m4 libdap-3.12.0/tests/package.m4 --- libdap-3.11.1/tests/package.m4 2011-05-06 15:28:45.000000000 +0000 +++ libdap-3.12.0/tests/package.m4 2013-10-17 21:27:40.000000000 +0000 @@ -1,6 +1,6 @@ # Signature of the current package. m4_define([AT_PACKAGE_NAME], [libdap]) m4_define([AT_PACKAGE_TARNAME], [libdap]) -m4_define([AT_PACKAGE_VERSION], [3.11.1]) -m4_define([AT_PACKAGE_STRING], [libdap 3.11.1]) +m4_define([AT_PACKAGE_VERSION], [3.12.0]) +m4_define([AT_PACKAGE_STRING], [libdap 3.12.0]) m4_define([AT_PACKAGE_BUGREPORT], [opendap-tech@opendap.org]) diff -Nru libdap-3.11.1/unit-tests/ArrayGeoConstraintTest.cc libdap-3.12.0/unit-tests/ArrayGeoConstraintTest.cc --- libdap-3.11.1/unit-tests/ArrayGeoConstraintTest.cc 2011-04-29 13:19:42.000000000 +0000 +++ libdap-3.12.0/unit-tests/ArrayGeoConstraintTest.cc 1970-01-01 00:00:00.000000000 +0000 @@ -1,231 +0,0 @@ - -// -*- mode: c++; c-basic-offset:4 -*- - -// This file is part of libdap, A C++ implementation of the OPeNDAP Data -// Access Protocol. - -// Copyright (c) 2006 OPeNDAP, Inc. -// Author: James Gallagher -// -// This library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Lesser General Public -// License as published by the Free Software Foundation; either -// version 2.1 of the License, or (at your option) any later version. -// -// This library 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 -// Lesser General Public License for more details. -// -// You should have received a copy of the GNU Lesser General Public -// License along with this library; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -// -// You can contact OPeNDAP, Inc. at PO Box 112, Saunderstown, RI. 02874-0112. - -// Tests for the AISResources class. - -#include -#include -#include - -//#define DODS_DEBUG - -#include "BaseType.h" - -#include "Byte.h" -#include "Int32.h" -#include "Float64.h" -#include "Str.h" -#include "Array.h" -#include "Grid.h" -#include "DDS.h" -#include "DAS.h" - -#include "../tests/TestArray.h" -#include "ArrayGeoConstraint.h" -#include "ce_functions.h" - -#include "../tests/TestTypeFactory.h" - -#include "debug.h" - -using namespace CppUnit; -using namespace libdap; -using namespace std; - -int test_variable_sleep_interval = 0; - -namespace libdap -{ - -class ArrayGeoConstraintTest:public TestFixture -{ -private: - TestTypeFactory btf; - ConstraintEvaluator ce; - - TestArray *a1, *a2, *a3; - -public: - ArrayGeoConstraintTest() - {} - ~ArrayGeoConstraintTest() - {} - - void setUp() - { - a1 = new TestArray("test1", new Int32("test1")); - a1->append_dim(21); // latitude - a1->append_dim(10); // longitude - - a2 = new TestArray("test2", new Int32("test2")); - a2->append_dim(21); // latitude - a2->append_dim(10); // longitude - - a3 = new TestArray("test3", new Byte("test3")); - a3->append_dim(10); // latitude - a3->append_dim(10); // longitude - dods_byte tmp_data[10][10] = - { { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9}, - { 10,11,12,13,14,15,16,17,18,19}, - { 20,21,22,23,24,25,26,27,28,29}, - { 30,31,32,33,34,35,36,37,38,39}, - { 40,41,42,43,44,45,46,47,48,49}, - { 50,51,52,53,54,55,56,57,58,59}, - { 60,61,62,63,64,65,66,67,68,69}, - { 70,71,72,73,74,75,76,77,78,79}, - { 80,81,82,83,84,85,86,87,88,89}, - { 90,91,92,93,94,95,96,97,98,99} }; - a3->val2buf((void*)tmp_data); - a3->set_read_p(true); - - - } - - void tearDown() - { - delete a1; a1 = 0; - delete a2; a2 = 0; - delete a3; a3 = 0; - } - - CPPUNIT_TEST_SUITE( ArrayGeoConstraintTest ); - - CPPUNIT_TEST(constructor_test); - CPPUNIT_TEST(build_lat_lon_maps_test); - CPPUNIT_TEST(set_bounding_box_test); - - CPPUNIT_TEST_SUITE_END(); - - void constructor_test() { - TestArray *ta = new TestArray("test", new Int32("test")); - ta->append_dim(10); - - try { - ArrayGeoConstraint agc(ta); - CPPUNIT_ASSERT(!"Constructor should throw"); - } - catch (Error &e) { - DBG(cerr << "Error: " << e.get_error_message() << endl); - CPPUNIT_ASSERT("Caught Error"); - } - - try { - ArrayGeoConstraint agc(ta, 10, 10, 89.9, 89); - CPPUNIT_ASSERT(!"Constructor should throw"); - } - catch (Error &e) { - DBG(cerr << "Error: " << e.get_error_message() << endl); - CPPUNIT_ASSERT("Caught Error"); - } - - ta->append_dim(20); - try { - ArrayGeoConstraint agc(ta, 10, 10, 89.9, 89); - CPPUNIT_ASSERT(agc.d_extent.d_left == 10 - && agc.d_extent.d_top == 10 - && agc.d_extent.d_right == 89 - && agc.d_extent.d_bottom == 89.9); - CPPUNIT_ASSERT(agc.d_projection.d_name == "plat-carre" - && agc.d_projection.d_datum == "wgs84"); - } - catch (Error &e) { - DBG(cerr << "Error: " << e.get_error_message() << endl); - CPPUNIT_ASSERT(!"Constructor should not throw"); - } - - try { - ArrayGeoConstraint agc(ta, 10, 10, 89.9, 89, - "plat-carre", "wgs84"); - CPPUNIT_ASSERT(agc.d_extent.d_left == 10 - && agc.d_extent.d_top == 10 - && agc.d_extent.d_right == 89 - && agc.d_extent.d_bottom == 89.9); - CPPUNIT_ASSERT(agc.d_projection.d_name == "plat-carre" - && agc.d_projection.d_datum == "wgs84"); - } - catch (Error &e) { - DBG(cerr << "Error: " << e.get_error_message() << endl); - CPPUNIT_ASSERT(!"Constructor should not throw"); - } - - try { - ArrayGeoConstraint agc(ta, 10, 10, 89.9, 89, - "plat-carre", "huh?"); - CPPUNIT_ASSERT(!"Constructor should throw Error"); - } - catch (Error &e) { - DBG(cerr << "Error: " << e.get_error_message() << endl); - CPPUNIT_ASSERT("Caught Error"); - } - } - - void build_lat_lon_maps_test() { - // build_lat_lon_maps() is called in the ctor - ArrayGeoConstraint agc(a1, 90, 10, -90, 89); - - CPPUNIT_ASSERT(agc.get_lon()[0] == 10.0); - DBG(cerr << "agc.get_lon()[9]: " << agc.get_lon()[9] << endl); - CPPUNIT_ASSERT(agc.get_lon()[9] == 89.0); - CPPUNIT_ASSERT(agc.get_lat()[0] == 90.0); - CPPUNIT_ASSERT(agc.get_lat()[20] == -90.0); - } - - void set_bounding_box_test() { - try { - ArrayGeoConstraint agc1(a1, 90, 10, -90, 89); - agc1.set_bounding_box(90, 10, -90, 89); - CPPUNIT_ASSERT(agc1.get_longitude_index_left() == 0); - CPPUNIT_ASSERT(agc1.get_longitude_index_right() == 9); - CPPUNIT_ASSERT(agc1.get_latitude_index_top() == 0); - CPPUNIT_ASSERT(agc1.get_latitude_index_bottom() == 20); - - ArrayGeoConstraint agc2(a2, 90, 0, -90, 359); - agc2.set_bounding_box(45, 10, -45, 89); - DBG(cerr << "agc2.get_longitude_index_left(): " << agc2.get_longitude_index_left() << endl); DBG(cerr << "agc2.get_longitude_index_right(): " << agc2.get_longitude_index_right() << endl); DBG(cerr << "agc2.get_latitude_index_top(): " << agc2.get_latitude_index_top() << endl); DBG(cerr << "agc2.get_latitude_index_bottom(): " << agc2.get_latitude_index_bottom() << endl); - CPPUNIT_ASSERT(agc2.get_longitude_index_left() == 0); - CPPUNIT_ASSERT(agc2.get_longitude_index_right() == 3); - CPPUNIT_ASSERT(agc2.get_latitude_index_top() == 5); - CPPUNIT_ASSERT(agc2.get_latitude_index_bottom() == 15); - } - catch (Error &e) { - CPPUNIT_FAIL(e.get_error_message()); - } - } -}; - -CPPUNIT_TEST_SUITE_REGISTRATION(ArrayGeoConstraintTest); - -} // namespace libdap - -int -main( int, char** ) -{ - CppUnit::TextTestRunner runner; - runner.addTest( CppUnit::TestFactoryRegistry::getRegistry().makeTest() ); - - bool wasSuccessful = runner.run( "", false ) ; - - return wasSuccessful ? 0 : 1; -} diff -Nru libdap-3.11.1/unit-tests/ArrayTest.cc libdap-3.12.0/unit-tests/ArrayTest.cc --- libdap-3.11.1/unit-tests/ArrayTest.cc 2011-04-29 13:19:42.000000000 +0000 +++ libdap-3.12.0/unit-tests/ArrayTest.cc 2013-10-17 21:27:40.000000000 +0000 @@ -19,7 +19,7 @@ // // You should have received a copy of the GNU Lesser General Public // License along with this library; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA // // You can contact OPeNDAP, Inc. at PO Box 112, Saunderstown, RI. 02874-0112. diff -Nru libdap-3.11.1/unit-tests/AttrTableTest.cc libdap-3.12.0/unit-tests/AttrTableTest.cc --- libdap-3.11.1/unit-tests/AttrTableTest.cc 2011-04-29 13:19:42.000000000 +0000 +++ libdap-3.12.0/unit-tests/AttrTableTest.cc 2013-10-17 21:27:40.000000000 +0000 @@ -18,7 +18,7 @@ // // You should have received a copy of the GNU Lesser General Public // License along with this library; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA // // You can contact OPeNDAP, Inc. at PO Box 112, Saunderstown, RI. 02874-0112. @@ -37,10 +37,10 @@ #endif #include "GNURegex.h" - #include "AttrTable.h" +#include "debug.h" -#include "testFile.cc" +#include "testFile.h" using namespace CppUnit; using namespace std; @@ -124,9 +124,9 @@ } CPPUNIT_TEST_SUITE( AttrTableTest ); +#if 1 CPPUNIT_TEST(clone_test); -#if 1 CPPUNIT_TEST(find_container_test); CPPUNIT_TEST(get_parent_test); CPPUNIT_TEST(recurrsive_find_test); @@ -135,7 +135,9 @@ CPPUNIT_TEST(assignment); CPPUNIT_TEST(erase_test); CPPUNIT_TEST(names_with_spaces_test); +#endif CPPUNIT_TEST(containers_with_spaces_test); +#if 1 CPPUNIT_TEST(get_attr_iter_test); CPPUNIT_TEST(del_attr_table_test); CPPUNIT_TEST(append_attr_vector_test); @@ -270,14 +272,21 @@ void names_with_spaces_test() { // Create an AttrTable where some names have spaces. The spaces // should be replaced by %20 escapes. + // Replacing the spaces with %20 was the bad, old, behavior. Now + // the spaces can stay. If someone is writing a DAS using the {} + // notation, they can use '%20' for the spaces. In the printed + // DAS using the {} notation, spaces will be represented by %20. AttrTable *t = new AttrTable; t->append_attr("long name", "String", "first"); t->append_attr("longer name", "String", "\"second test\""); - string sof; - FILE2string(sof, of, t->print(of, "")); + //string sof; + ostringstream oss; + t->print(oss, ""); + //FILE2string(sof, of, t->print(of, "")); string attrs = "String long%20name \"first\";\n\ String longer%20name \"second test\";"; - CPPUNIT_ASSERT(sof.find(attrs) != string::npos); + //CPPUNIT_ASSERT(sof.find(attrs) != string::npos); + CPPUNIT_ASSERT(oss.str().find(attrs) != string::npos); delete t; t = 0; } @@ -293,14 +302,18 @@ CPPUNIT_ASSERT("Caught Error exception!" && false); } try { +#if 0 string sof; FILE2string(sof, of, top->print(of, "")); - Regex r("Data%20Field \\{\n\ +#endif + ostringstream oss; + top->print(oss); + Regex r(".*Data%20Field \\{\n\ .*String long%20name \"first\";\n\ .*Alias an%20alias long%20name;\n\ -\\}\n\n"); - cout << sof << endl ; - CPPUNIT_ASSERT(re_match(r, sof.c_str())); +.*\\}\n"); + DBG(cout << ">" << oss.str() << "<" << endl); + CPPUNIT_ASSERT(re_match(r, oss.str().c_str())); delete top; top = 0; } catch (Error &e) { diff -Nru libdap-3.11.1/unit-tests/ByteTest.cc libdap-3.12.0/unit-tests/ByteTest.cc --- libdap-3.11.1/unit-tests/ByteTest.cc 2011-04-29 13:19:42.000000000 +0000 +++ libdap-3.12.0/unit-tests/ByteTest.cc 2013-10-17 21:27:40.000000000 +0000 @@ -19,7 +19,7 @@ // // You should have received a copy of the GNU Lesser General Public // License along with this library; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA // // You can contact OPeNDAP, Inc. at PO Box 112, Saunderstown, RI. 02874-0112. @@ -38,7 +38,7 @@ #include "Byte.h" -#include "testFile.cc" +#include "testFile.h" using namespace CppUnit; using namespace std; diff -Nru libdap-3.11.1/unit-tests/CEFunctionsTest.cc libdap-3.12.0/unit-tests/CEFunctionsTest.cc --- libdap-3.11.1/unit-tests/CEFunctionsTest.cc 2011-04-29 13:19:42.000000000 +0000 +++ libdap-3.12.0/unit-tests/CEFunctionsTest.cc 1970-01-01 00:00:00.000000000 +0000 @@ -1,582 +0,0 @@ - -// -*- mode: c++; c-basic-offset:4 -*- - -// This file is part of libdap, A C++ implementation of the OPeNDAP Data -// Access Protocol. - -// Copyright (c) 2006 OPeNDAP, Inc. -// Author: James Gallagher -// -// This library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Lesser General Public -// License as published by the Free Software Foundation; either -// version 2.1 of the License, or (at your option) any later version. -// -// This library 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 -// Lesser General Public License for more details. -// -// You should have received a copy of the GNU Lesser General Public -// License along with this library; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -// -// You can contact OPeNDAP, Inc. at PO Box 112, Saunderstown, RI. 02874-0112. - -// Tests for the AISResources class. - -#include -#include -#include - -//#define DODS_DEBUG - -#include "BaseType.h" -#include "Int32.h" -#include "Float64.h" -#include "Str.h" -#include "Array.h" -#include "Grid.h" -#include "DDS.h" -#include "DAS.h" -#include "ce_functions.h" -#include - -#include "../tests/TestTypeFactory.h" - -#include "debug.h" - -#if 1 -#define TWO_GRID_DDS "ce-functions-testsuite/two_grid.dds" -#define TWO_GRID_DAS "ce-functions-testsuite/two_grid.das" -#else -#define TWO_GRID_DDS "unit-tests/ce-functions-testsuite/two_grid.dds" -#define TWO_GRID_DAS "unit-tests/ce-functions-testsuite/two_grid.das" -#endif - -using namespace CppUnit; -using namespace libdap; -using namespace std; - -int test_variable_sleep_interval = 0; - -class CEFunctionsTest:public TestFixture -{ -private: - DDS * dds; - TestTypeFactory btf; - ConstraintEvaluator ce; -public: - CEFunctionsTest() - {} - ~CEFunctionsTest() - {} - - void setUp() - { - try { - dds = new DDS(&btf); - string dds_file = (string)TEST_SRC_DIR + "/" + TWO_GRID_DDS ; - dds->parse(dds_file); - DAS das; - string das_file = (string)TEST_SRC_DIR + "/" + TWO_GRID_DAS ; - das.parse(das_file); - dds->transfer_attributes(&das); - DBG(dds->print_xml(stderr, false, "noBlob")); - // Load values into the grid variables - Grid & a = dynamic_cast < Grid & >(*dds->var("a")); - Array & m1 = dynamic_cast < Array & >(**a.map_begin()); - - dods_float64 first_a[10] = { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 }; - m1.val2buf(first_a); - m1.set_read_p(true); - - dods_byte tmp_data[10] = { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 }; - a.get_array()->val2buf((void*)tmp_data); - a.get_array()->set_read_p(true); - - Grid & b = dynamic_cast < Grid & >(*dds->var("b")); - Array & m2 = dynamic_cast < Array & >(**b.map_begin()); - dods_float64 first_b[10] = { 9, 8, 7, 6, 5, 4, 3, 2, 1, 0 }; - - m2.val2buf(first_b); - m2.set_read_p(true); - } - - catch (Error & e) { - cerr << "SetUp: " << e.get_error_message() << endl; - throw; - } - } - - void tearDown() - { - delete dds; dds = 0; - } - - CPPUNIT_TEST_SUITE( CEFunctionsTest ); - - // Test void projection_function_grid(int argc, BaseType *argv[], DDS &dds) - - CPPUNIT_TEST(no_arguments_test); - CPPUNIT_TEST(one_argument_test); - CPPUNIT_TEST(one_argument_not_a_grid_test); - CPPUNIT_TEST(map_not_in_grid_test); - CPPUNIT_TEST(one_dim_grid_test); - CPPUNIT_TEST(one_dim_grid_two_expressions_test); - CPPUNIT_TEST(one_dim_grid_noninclusive_values_test); - CPPUNIT_TEST(one_dim_grid_descending_test); - CPPUNIT_TEST(one_dim_grid_two_expressions_descending_test); -#if 0 - // grid() is not required to handle this case. - CPPUNIT_TEST(values_outside_map_range_test); -#endif - - // Tests for linear_scale - CPPUNIT_TEST(linear_scale_args_test); - CPPUNIT_TEST(linear_scale_array_test); - CPPUNIT_TEST(linear_scale_grid_test); - CPPUNIT_TEST(linear_scale_grid_attributes_test); - CPPUNIT_TEST(linear_scale_grid_attributes_test2); - CPPUNIT_TEST(linear_scale_scalar_test); -#if 0 - // Not used and defined to throw by default. 2/23/11 jhrg - CPPUNIT_TEST(function_dap_1_test); - CPPUNIT_TEST(function_dap_2_test); - CPPUNIT_TEST(function_dap_3_test); -#endif - CPPUNIT_TEST_SUITE_END(); - - void no_arguments_test() - { - try { - BaseType *btp = 0; - function_grid(0, 0, *dds, &btp); - CPPUNIT_ASSERT(true); - } - catch (Error &e) { - DBG(cerr << e.get_error_message() << endl); - CPPUNIT_ASSERT(!"no_arguments_test() should not have failed"); - } - } - - void one_argument_test() - { - try { - BaseType *argv[1]; - argv[0] = dds->var("a"); - CPPUNIT_ASSERT(argv[0] && "dds->var should find this"); - BaseType *btp = 0; - function_grid(1, argv, *dds, &btp); - CPPUNIT_ASSERT("one_argument_not_a_grid_test() should work"); - } - catch (Error &e) { - DBG(cerr << e.get_error_message() << endl); - CPPUNIT_ASSERT(!"one_argument_test should not fail"); - } - } - - void one_argument_not_a_grid_test() - { - try { - BaseType *argv[1]; - argv[0] = dds->var("lat"); - CPPUNIT_ASSERT(argv[0] && "dds->var should find this, although it is not a grid"); - BaseType *btp = 0; - function_grid(1, argv, *dds, &btp); - CPPUNIT_ASSERT(!"one_argument_not_a_grid_test() should have failed"); - } - catch (Error &e) { - DBG(cerr << e.get_error_message() << endl); - CPPUNIT_ASSERT(true); - } - } - - void map_not_in_grid_test() - { - try { - BaseType *argv[2]; - argv[0] = dds->var("a"); - CPPUNIT_ASSERT(argv[0] && "dds->var should find this"); - argv[1] = new Str(""); - string expression = "3(argv[1])->val2buf(&expression); - dynamic_cast(argv[1])->set_read_p(true); - BaseType *btp = 0; - function_grid(2, argv, *dds, &btp); - CPPUNIT_ASSERT(!"map_not_in_grid_test() should have failed"); - } - catch (Error &e) { - DBG(cerr << e.get_error_message() << endl); - CPPUNIT_ASSERT(true); - } - } - - void one_dim_grid_test() - { - try { - BaseType *argv[2]; - argv[0] = dds->var("a"); - CPPUNIT_ASSERT(argv[0] && "dds->var should find this"); - argv[1] = new Str(""); - string expression = "3(argv[1])->val2buf(&expression); - dynamic_cast(argv[1])->set_read_p(true); - - BaseType *btp = 0; - function_grid(2, argv, *dds, &btp); - Grid &g = dynamic_cast(*btp); - - //Grid &g = dynamic_cast(*argv[0]); - Array &m = dynamic_cast(**g.map_begin()); - CPPUNIT_ASSERT(m.dimension_start(m.dim_begin(), true) == 4); - CPPUNIT_ASSERT(m.dimension_stop(m.dim_begin(), true) == 7); - } - catch (Error &e) { - DBG(cerr << e.get_error_message() << endl); - CPPUNIT_ASSERT(!"one_dim_grid_test() should have worked"); - } - } - - void one_dim_grid_two_expressions_test() - { - try { - BaseType *argv[3]; - argv[0] = dds->var("a"); - CPPUNIT_ASSERT(argv[0] && "dds->var should find this"); - - argv[1] = new Str(""); - string expression = "first>3"; - dynamic_cast(argv[1])->val2buf(&expression); - dynamic_cast(argv[1])->set_read_p(true); - - argv[2] = new Str(""); - expression = "first<=7"; - dynamic_cast(argv[2])->val2buf(&expression); - dynamic_cast(argv[2])->set_read_p(true); - - //function_grid(3, argv, *dds); - BaseType *btp = 0; - function_grid(3, argv, *dds, &btp); - Grid &g = dynamic_cast(*btp); - - //Grid &g = dynamic_cast(*function_grid(3, argv, *dds)); - //Grid &g = dynamic_cast(*argv[0]); - Array &m = dynamic_cast(**g.map_begin()); - CPPUNIT_ASSERT(m.dimension_start(m.dim_begin(), true) == 4); - CPPUNIT_ASSERT(m.dimension_stop(m.dim_begin(), true) == 7); - } - catch (Error &e) { - DBG(cerr << e.get_error_message() << endl); - CPPUNIT_ASSERT(!"one_dim_grid_two_expressions_test() should have worked"); - } - } - - void one_dim_grid_descending_test() - { - try { - BaseType *argv[2]; - argv[0] = dds->var("b"); - CPPUNIT_ASSERT(argv[0] && "dds->var should find this"); - argv[1] = new Str(""); - string expression = "3(argv[1])->val2buf(&expression); - dynamic_cast(argv[1])->set_read_p(true); - - BaseType *btp = 0; - function_grid(2, argv, *dds, &btp); - Grid &g = dynamic_cast(*btp); - - //function_grid(2, argv, *dds); - //Grid &g = dynamic_cast(*function_grid(2, argv, *dds)); - //Grid &g = dynamic_cast(*argv[0]); - Array &m = dynamic_cast(**g.map_begin()); - CPPUNIT_ASSERT(m.dimension_start(m.dim_begin(), true) == 2); - CPPUNIT_ASSERT(m.dimension_stop(m.dim_begin(), true) == 5); - } - catch (Error &e) { - DBG(cerr << e.get_error_message() << endl); - CPPUNIT_ASSERT(!"one_dim_grid_test() should have worked"); - } - } - - void one_dim_grid_two_expressions_descending_test() - { - try { - BaseType *argv[3]; - argv[0] = dds->var("b"); - CPPUNIT_ASSERT(argv[0] && "dds->var should find this"); - - argv[1] = new Str(""); - string expression = "first>3"; - dynamic_cast(argv[1])->val2buf(&expression); - dynamic_cast(argv[1])->set_read_p(true); - - argv[2] = new Str(""); - expression = "first<=7"; - dynamic_cast(argv[2])->val2buf(&expression); - dynamic_cast(argv[2])->set_read_p(true); - - BaseType *btp = 0; - function_grid(3, argv, *dds, &btp); - Grid &g = dynamic_cast(*btp); - - //function_grid(3, argv, *dds); - //Grid &g = dynamic_cast(*function_grid(3, argv, *dds)); - //Grid &g = dynamic_cast(*argv[0]); - Array &m = dynamic_cast(**g.map_begin()); - CPPUNIT_ASSERT(m.dimension_start(m.dim_begin(), true) == 2); - CPPUNIT_ASSERT(m.dimension_stop(m.dim_begin(), true) == 5); - } - catch (Error &e) { - DBG(cerr << e.get_error_message() << endl); - CPPUNIT_ASSERT(!"one_dim_grid_two_expressions_test() should have worked"); - } - } - - void one_dim_grid_noninclusive_values_test() - { - try { - BaseType *argv[2]; - argv[0] = dds->var("a"); - CPPUNIT_ASSERT(argv[0] && "dds->var should find this"); - argv[1] = new Str(""); - string expression = "7(argv[1])->val2buf(&expression); - dynamic_cast(argv[1])->set_read_p(true); - - BaseType *btp = 0; - function_grid(2, argv, *dds, &btp); - Grid &g = dynamic_cast(*btp); - - // function_grid(2, argv, *dds); - - CPPUNIT_ASSERT(!"one_dim_grid_noninclusive_values_test() should not have worked"); - } - catch (Error &e) { - DBG(cerr << e.get_error_message() << endl); - CPPUNIT_ASSERT(true); - } - } - - // grid() is not required to handle this case. This test is not used. - void values_outside_map_range_test() - { - try { - BaseType *argv[2]; - argv[0] = dds->var("a"); - CPPUNIT_ASSERT(argv[0] && "dds->var should find this"); - argv[1] = new Str(""); - string expression = "3<=first<20"; - dynamic_cast(argv[1])->val2buf(&expression); - dynamic_cast(argv[1])->set_read_p(true); - - BaseType *btp = 0; - function_grid(2, argv, *dds, &btp); - Grid &g = dynamic_cast(*btp); - - // function_grid(2, argv, *dds); - - CPPUNIT_ASSERT(!"values_outside_map_range_test() should not have worked"); - } - catch (Error &e) { - DBG(cerr << e.get_error_message() << endl); - CPPUNIT_ASSERT(true); - } - } - - // linear_scale tests - void linear_scale_args_test() { - try { - BaseType *btp = 0; - function_linear_scale(0, 0, *dds, &btp); - CPPUNIT_ASSERT(true); - } - catch (Error &e) { - DBG(cerr << e.get_error_message() << endl); - CPPUNIT_ASSERT(!"linear_scale_args_test: should not throw Error"); - } - } - - void linear_scale_array_test() { - try { - Array *a = dynamic_cast(*dds->var("a")).get_array(); - CPPUNIT_ASSERT(a); - BaseType *argv[3]; - argv[0] = a; - argv[1] = new Float64(""); - dynamic_cast(argv[1])->set_value(0.1);//m - argv[2] = new Float64(""); - dynamic_cast(argv[2])->set_value(10);//b - BaseType *scaled = 0; - function_linear_scale(3, argv, *dds, &scaled); - CPPUNIT_ASSERT(scaled->type() == dods_array_c - && scaled->var()->type() == dods_float64_c); - double *values = extract_double_array(dynamic_cast(scaled)); - CPPUNIT_ASSERT(values[0] == 10); - CPPUNIT_ASSERT(values[1] == 10.1); - CPPUNIT_ASSERT(values[9] == 10.9); - } - catch (Error &e) { - DBG(cerr << e.get_error_message() << endl); - CPPUNIT_ASSERT(!"Error in linear_scale_grid_test()"); - } - } - - void linear_scale_grid_test() { - try { - Grid *g = dynamic_cast(dds->var("a")); - CPPUNIT_ASSERT(g); - BaseType *argv[3]; - argv[0] = g; - argv[1] = new Float64(""); - dynamic_cast(argv[1])->set_value(0.1); - argv[2] = new Float64(""); - dynamic_cast(argv[2])->set_value(10); - BaseType *scaled = 0; - function_linear_scale(3, argv, *dds, &scaled); - CPPUNIT_ASSERT(scaled->type() == dods_grid_c); - Grid *g_s = dynamic_cast(scaled); - CPPUNIT_ASSERT(g_s->get_array()->var()->type() == dods_float64_c); - double *values = extract_double_array(g_s->get_array()); - CPPUNIT_ASSERT(values[0] == 10); - CPPUNIT_ASSERT(values[1] == 10.1); - CPPUNIT_ASSERT(values[9] == 10.9); - } - catch (Error &e) { - DBG(cerr << e.get_error_message() << endl); - CPPUNIT_ASSERT(!"Error in linear_scale_grid_test()"); - } - } - - void linear_scale_grid_attributes_test() { - try { - Grid *g = dynamic_cast(dds->var("a")); - CPPUNIT_ASSERT(g); - BaseType *argv[1]; - argv[0] = g; - BaseType *scaled = 0; - function_linear_scale(1, argv, *dds, &scaled); - CPPUNIT_ASSERT(scaled->type() == dods_grid_c); - Grid *g_s = dynamic_cast(scaled); - CPPUNIT_ASSERT(g_s->get_array()->var()->type() == dods_float64_c); - double *values = extract_double_array(g_s->get_array()); - CPPUNIT_ASSERT(values[0] == 10); - CPPUNIT_ASSERT(values[1] == 10.1); - CPPUNIT_ASSERT(values[9] == 10.9); - } - catch (Error &e) { - DBG(cerr << e.get_error_message() << endl); - CPPUNIT_ASSERT(!"Error in linear_scale_grid_test()"); - } - } - - // This tests the case where attributes are not found - void linear_scale_grid_attributes_test2() { - try { - Grid *g = dynamic_cast(dds->var("b")); - CPPUNIT_ASSERT(g); - BaseType *argv[1]; - argv[0] = g; - BaseType *btp = 0; - function_linear_scale(1, argv, *dds, &btp); - CPPUNIT_FAIL("Should not get here; no params passed and no attributes set for grid 'b'"); - } - catch (Error &e) { - DBG(cerr << e.get_error_message() << endl); - CPPUNIT_ASSERT("Caught exception"); - } - } - - void linear_scale_scalar_test() { - try { - Int32 *i = new Int32("linear_scale_test_int32"); - CPPUNIT_ASSERT(i); - i->set_value(1); - BaseType *argv[3]; - argv[0] = i; - argv[1] = new Float64(""); - dynamic_cast(argv[1])->set_value(0.1);//m - argv[2] = new Float64(""); - dynamic_cast(argv[2])->set_value(10);//b - BaseType *scaled = 0; - function_linear_scale(3, argv, *dds, &scaled); - CPPUNIT_ASSERT(scaled->type() == dods_float64_c); - - CPPUNIT_ASSERT(dynamic_cast(scaled)->value() == 10.1); - } - catch (Error &e) { - DBG(cerr << e.get_error_message() << endl); - CPPUNIT_ASSERT(!"Error in linear_scale_scalar_test()"); - } - } - - - void function_dap_1_test() { - try { - Int32 *i = new Int32("function_dap_1_test_int32"); - CPPUNIT_ASSERT(i); - i->set_value(2); - BaseType *argv[1]; - argv[0] = i; - - ConstraintEvaluator unused; - function_dap(1, argv, *dds, unused); - - CPPUNIT_ASSERT(dds->get_dap_major() == 2); - CPPUNIT_ASSERT(dds->get_dap_minor() == 0); - } - catch (Error &e) { - DBG(cerr << e.get_error_message() << endl); - CPPUNIT_FAIL("Error in function_dap_1_test(): " + e.get_error_message()); - } - } - - void function_dap_2_test() { - try { - Float64 *d = new Float64("function_dap_1_test_float64"); - CPPUNIT_ASSERT(d); - d->set_value(3.2); - BaseType *argv[1]; - argv[0] = d; - - ConstraintEvaluator unused; - function_dap(1, argv, *dds, unused); - - CPPUNIT_ASSERT(dds->get_dap_major() == 3); - CPPUNIT_ASSERT(dds->get_dap_minor() == 2); - } - catch (Error &e) { - DBG(cerr << e.get_error_message() << endl); - CPPUNIT_FAIL("Error in function_dap_2_test(): " + e.get_error_message()); - } - } - - void function_dap_3_test() { - try { - cerr <<"In function_dap_3_test" << endl; - ConstraintEvaluator unused; - function_dap(0, 0, *dds, unused); - - CPPUNIT_FAIL("Should have thrown an exception on no args"); - } - catch (Error &e) { - DBG(cerr << e.get_error_message() << endl); - CPPUNIT_ASSERT("Pass: Caught exception"); - } - } - -}; - -CPPUNIT_TEST_SUITE_REGISTRATION(CEFunctionsTest); - -int -main( int, char** ) -{ - CppUnit::TextTestRunner runner; - runner.addTest( CppUnit::TestFactoryRegistry::getRegistry().makeTest() ); - - bool wasSuccessful = runner.run( "", false ) ; - - return wasSuccessful ? 0 : 1; -} diff -Nru libdap-3.11.1/unit-tests/D4-xml/D4Dimensions_1.xml libdap-3.12.0/unit-tests/D4-xml/D4Dimensions_1.xml --- libdap-3.11.1/unit-tests/D4-xml/D4Dimensions_1.xml 1970-01-01 00:00:00.000000000 +0000 +++ libdap-3.12.0/unit-tests/D4-xml/D4Dimensions_1.xml 2013-10-17 21:27:40.000000000 +0000 @@ -0,0 +1,2 @@ + + diff -Nru libdap-3.11.1/unit-tests/D4-xml/D4Dimensions_2.xml libdap-3.12.0/unit-tests/D4-xml/D4Dimensions_2.xml --- libdap-3.11.1/unit-tests/D4-xml/D4Dimensions_2.xml 1970-01-01 00:00:00.000000000 +0000 +++ libdap-3.12.0/unit-tests/D4-xml/D4Dimensions_2.xml 2013-10-17 21:27:40.000000000 +0000 @@ -0,0 +1,3 @@ + + + diff -Nru libdap-3.11.1/unit-tests/D4-xml/D4Dimensions_3.xml libdap-3.12.0/unit-tests/D4-xml/D4Dimensions_3.xml --- libdap-3.11.1/unit-tests/D4-xml/D4Dimensions_3.xml 1970-01-01 00:00:00.000000000 +0000 +++ libdap-3.12.0/unit-tests/D4-xml/D4Dimensions_3.xml 2013-10-17 21:27:40.000000000 +0000 @@ -0,0 +1,4 @@ + + + + diff -Nru libdap-3.11.1/unit-tests/D4-xml/D4Dimensions_4.xml libdap-3.12.0/unit-tests/D4-xml/D4Dimensions_4.xml --- libdap-3.11.1/unit-tests/D4-xml/D4Dimensions_4.xml 1970-01-01 00:00:00.000000000 +0000 +++ libdap-3.12.0/unit-tests/D4-xml/D4Dimensions_4.xml 2013-10-17 21:27:40.000000000 +0000 @@ -0,0 +1,5 @@ + + + + + diff -Nru libdap-3.11.1/unit-tests/D4-xml/D4Dimensions_empty.xml libdap-3.12.0/unit-tests/D4-xml/D4Dimensions_empty.xml --- libdap-3.11.1/unit-tests/D4-xml/D4Dimensions_empty.xml 1970-01-01 00:00:00.000000000 +0000 +++ libdap-3.12.0/unit-tests/D4-xml/D4Dimensions_empty.xml 2013-10-17 21:27:40.000000000 +0000 @@ -0,0 +1 @@ + diff -Nru libdap-3.11.1/unit-tests/D4-xml/D4EnumDefs_1.xml libdap-3.12.0/unit-tests/D4-xml/D4EnumDefs_1.xml --- libdap-3.11.1/unit-tests/D4-xml/D4EnumDefs_1.xml 1970-01-01 00:00:00.000000000 +0000 +++ libdap-3.12.0/unit-tests/D4-xml/D4EnumDefs_1.xml 2013-10-17 21:27:40.000000000 +0000 @@ -0,0 +1,5 @@ + + + + + diff -Nru libdap-3.11.1/unit-tests/D4-xml/D4EnumDefs_2.xml libdap-3.12.0/unit-tests/D4-xml/D4EnumDefs_2.xml --- libdap-3.11.1/unit-tests/D4-xml/D4EnumDefs_2.xml 1970-01-01 00:00:00.000000000 +0000 +++ libdap-3.12.0/unit-tests/D4-xml/D4EnumDefs_2.xml 2013-10-17 21:27:40.000000000 +0000 @@ -0,0 +1,9 @@ + + + + + + + + + diff -Nru libdap-3.11.1/unit-tests/D4-xml/D4EnumDefs_3.xml libdap-3.12.0/unit-tests/D4-xml/D4EnumDefs_3.xml --- libdap-3.11.1/unit-tests/D4-xml/D4EnumDefs_3.xml 1970-01-01 00:00:00.000000000 +0000 +++ libdap-3.12.0/unit-tests/D4-xml/D4EnumDefs_3.xml 2013-10-17 21:27:40.000000000 +0000 @@ -0,0 +1,9 @@ + + + + + + + + + diff -Nru libdap-3.11.1/unit-tests/D4-xml/D4EnumDefs_empty.xml libdap-3.12.0/unit-tests/D4-xml/D4EnumDefs_empty.xml --- libdap-3.11.1/unit-tests/D4-xml/D4EnumDefs_empty.xml 1970-01-01 00:00:00.000000000 +0000 +++ libdap-3.12.0/unit-tests/D4-xml/D4EnumDefs_empty.xml 2013-10-17 21:27:40.000000000 +0000 @@ -0,0 +1 @@ + diff -Nru libdap-3.11.1/unit-tests/D4-xml/D4EnumDefs_values_1.xml libdap-3.12.0/unit-tests/D4-xml/D4EnumDefs_values_1.xml --- libdap-3.11.1/unit-tests/D4-xml/D4EnumDefs_values_1.xml 1970-01-01 00:00:00.000000000 +0000 +++ libdap-3.12.0/unit-tests/D4-xml/D4EnumDefs_values_1.xml 2013-10-17 21:27:40.000000000 +0000 @@ -0,0 +1,3 @@ + + + diff -Nru libdap-3.11.1/unit-tests/D4-xml/README libdap-3.12.0/unit-tests/D4-xml/README --- libdap-3.11.1/unit-tests/D4-xml/README 1970-01-01 00:00:00.000000000 +0000 +++ libdap-3.12.0/unit-tests/D4-xml/README 2013-10-17 21:27:40.000000000 +0000 @@ -0,0 +1,7 @@ +README + + Created on: Apr 1, 2013 + Author: jimg + +This directory holds xml files that are the baselines for various unit test +for the new DAP4 types and ancillary classes. diff -Nru libdap-3.11.1/unit-tests/D4DimensionsTest.cc libdap-3.12.0/unit-tests/D4DimensionsTest.cc --- libdap-3.11.1/unit-tests/D4DimensionsTest.cc 1970-01-01 00:00:00.000000000 +0000 +++ libdap-3.12.0/unit-tests/D4DimensionsTest.cc 2013-10-17 21:27:40.000000000 +0000 @@ -0,0 +1,183 @@ +// -*- mode: c++; c-basic-offset:4 -*- + +// This file is part of libdap, A C++ implementation of the OPeNDAP Data +// Access Protocol. + +// Copyright (c) 2002,2003 OPeNDAP, Inc. +// Author: James Gallagher +// +// This library is free software; you can redistribute it and/or +// modify it under the terms of the GNU Lesser General Public +// License as published by the Free Software Foundation; either +// version 2.1 of the License, or (at your option) any later version. +// +// This library 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 +// Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, write to the Free Software +// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA +// +// You can contact OPeNDAP, Inc. at PO Box 112, Saunderstown, RI. 02874-0112. + +#include "config.h" + +#include +#include +#include + +//#define DODS_DEBUG + +#include "D4Dimensions.h" +#include "XMLWriter.h" +#include "debug.h" + +#include "testFile.h" +#include "test_config.h" + +using namespace CppUnit; +using namespace std; +using namespace libdap; + +class D4DimensionsTest: public TestFixture { +private: + XMLWriter *xml; + D4Dimensions *d; + +public: + D4DimensionsTest() { + } + + ~D4DimensionsTest() { + } + + void setUp() { + d = new D4Dimensions; + xml = new XMLWriter; + } + + void tearDown() { + delete xml; + delete d; + } + + // An empty D4Dimensions object prints nothing; the XMLWriter class adds + // a xml doc preface. + void test_print_empty() { + d->print(*xml); + string doc = xml->get_doc(); + string baseline = readTestBaseline(string(TEST_SRC_DIR) + "/D4-xml/D4Dimensions_empty.xml"); + DBG(cerr << "test_print_empty: doc: " << doc << endl); + DBG(cerr << "test_print_empty: baseline: " << baseline << endl); + CPPUNIT_ASSERT(doc == baseline); + } + + void test_print_1() { + d->add_dim("first", 10); + + d->print(*xml); + string doc = xml->get_doc(); + string baseline = readTestBaseline(string(TEST_SRC_DIR) + "/D4-xml/D4Dimensions_1.xml"); + DBG(cerr << "test_print_1: doc: " << doc << endl); + DBG(cerr << "test_print_1: baseline: " << baseline << endl); + CPPUNIT_ASSERT(doc == baseline); + } + + void test_print_2() { + d->add_dim("first", 10); + d->add_dim("second", 100); + + d->print(*xml); + string doc = xml->get_doc(); + string baseline = readTestBaseline(string(TEST_SRC_DIR) + "/D4-xml/D4Dimensions_2.xml"); + DBG(cerr << "test_print_2: doc: " << doc << endl); + DBG(cerr << "test_print_2: baseline: " << baseline << endl); + CPPUNIT_ASSERT(doc == baseline); + } + + void test_print_varying() { + d->add_dim("first", 10); + d->add_dim("second", 100); + d->add_dim("third", 0, true); + + d->print(*xml); + string doc = xml->get_doc(); + string baseline = readTestBaseline(string(TEST_SRC_DIR) + "/D4-xml/D4Dimensions_3.xml"); + DBG(cerr << "test_print_varying: doc: " << doc << endl); + DBG(cerr << "test_print_varying: baseline: " << baseline << endl); + CPPUNIT_ASSERT(doc == baseline); + } + + void test_print_insert_dim() { + d->add_dim("first", 10); + d->add_dim("second", 100); + d->add_dim("third", 0, true); + + //vector::iterator i = d->dim_begin() + 1; + D4Dimensions::D4DimensionsIter i = d->dim_begin() + 1; + d->insert_dim("odd", 20, false /*varying*/, i); + + d->print(*xml); + string doc = xml->get_doc(); + string baseline = readTestBaseline(string(TEST_SRC_DIR) + "/D4-xml/D4Dimensions_4.xml"); + DBG(cerr << "test_print_insert_dim: doc: " << doc << endl); + DBG(cerr << "test_print_insert_dim: baseline: " << baseline << endl); + CPPUNIT_ASSERT(doc == baseline); + } + + void test_print_assignment() { + d->add_dim("first", 10); + d->add_dim("second", 100); + d->add_dim("third", 0, true); + + D4Dimensions lhs = *d; + + lhs.print(*xml); + string doc = xml->get_doc(); + string baseline = readTestBaseline(string(TEST_SRC_DIR) + "/D4-xml/D4Dimensions_3.xml"); + DBG(cerr << "test_print_assignment: doc: " << doc << endl); + DBG(cerr << "test_print_assignment: baseline: " << baseline << endl); + CPPUNIT_ASSERT(doc == baseline); + } + + void test_print_copy_ctor() { + d->add_dim("first", 10); + d->add_dim("second", 100); + d->add_dim("third", 0, true); + + D4Dimensions lhs(*d); + + lhs.print(*xml); + string doc = xml->get_doc(); + string baseline = readTestBaseline(string(TEST_SRC_DIR) + "/D4-xml/D4Dimensions_3.xml"); + DBG(cerr << "test_print_copy_ctor: doc: " << doc << endl); + DBG(cerr << "test_print_copy_ctor: baseline: " << baseline << endl); + CPPUNIT_ASSERT(doc == baseline); + } + + CPPUNIT_TEST_SUITE( D4DimensionsTest ); + + CPPUNIT_TEST(test_print_empty); + CPPUNIT_TEST(test_print_1); + CPPUNIT_TEST(test_print_2); + CPPUNIT_TEST(test_print_varying); + CPPUNIT_TEST(test_print_insert_dim); + CPPUNIT_TEST(test_print_assignment); + CPPUNIT_TEST(test_print_copy_ctor); + + CPPUNIT_TEST_SUITE_END(); +}; + +CPPUNIT_TEST_SUITE_REGISTRATION(D4DimensionsTest); + +int main(int, char**) { + CppUnit::TextTestRunner runner; + runner.addTest(CppUnit::TestFactoryRegistry::getRegistry().makeTest()); + + bool wasSuccessful = runner.run("", false); + + return wasSuccessful ? 0 : 1; +} + diff -Nru libdap-3.11.1/unit-tests/D4EnumDefsTest.cc libdap-3.12.0/unit-tests/D4EnumDefsTest.cc --- libdap-3.11.1/unit-tests/D4EnumDefsTest.cc 1970-01-01 00:00:00.000000000 +0000 +++ libdap-3.12.0/unit-tests/D4EnumDefsTest.cc 2013-10-17 21:27:40.000000000 +0000 @@ -0,0 +1,190 @@ +// -*- mode: c++; c-basic-offset:4 -*- + +// This file is part of libdap, A C++ implementation of the OPeNDAP Data +// Access Protocol. + +// Copyright (c) 2002,2003 OPeNDAP, Inc. +// Author: James Gallagher +// +// This library is free software; you can redistribute it and/or +// modify it under the terms of the GNU Lesser General Public +// License as published by the Free Software Foundation; either +// version 2.1 of the License, or (at your option) any later version. +// +// This library 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 +// Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, write to the Free Software +// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA +// +// You can contact OPeNDAP, Inc. at PO Box 112, Saunderstown, RI. 02874-0112. + +#include "config.h" + +#include +#include +#include + +//#define DODS_DEBUG + +#include "D4EnumDefs.h" +#include "XMLWriter.h" +#include "debug.h" + +#include "testFile.h" +#include "test_config.h" + +using namespace CppUnit; +using namespace std; +using namespace libdap; + +class D4EnumDefsTest: public TestFixture { +private: + XMLWriter *xml; + D4EnumDefs *d; + + enumValues e, e2; + +public: + D4EnumDefsTest() { + } + + ~D4EnumDefsTest() { + } + + void setUp() { + d = new D4EnumDefs; + xml = new XMLWriter; + + e.add_value("red", 1); + e.add_value("blue", 2); + + e2.add_value("snow", 0); + e2.add_value("ice", 10000); + } + + void tearDown() { + delete xml; + delete d; + } + + // An empty D4Dimensions object prints nothing; the XMLWriter class adds + // a xml doc preface. + void test_print_empty() { + d->print(*xml); + string doc = xml->get_doc(); + string baseline = readTestBaseline(string(TEST_SRC_DIR) + "/D4-xml/D4EnumDefs_empty.xml"); + DBG(cerr << "test_print_empty: doc: " << doc << endl); + DBG(cerr << "test_print_empty: baseline: " << baseline << endl); + CPPUNIT_ASSERT(doc == baseline); + } + + void test_print_enum_values_only() { + enumValues e; + e.add_value("red", 1); + e.add_value("blue", 2); + + e.print(*xml); + string doc = xml->get_doc(); + string baseline = readTestBaseline(string(TEST_SRC_DIR) + "/D4-xml/D4EnumDefs_values_1.xml"); + DBG(cerr << "test_print_enum_values_only: doc: " << doc << endl); + DBG(cerr << "test_print_enum_values_only: baseline: " << baseline << endl); + CPPUNIT_ASSERT(doc == baseline); + + } + + void test_print_1() { + d->add_enum("first", dods_byte_c, e); + + d->print(*xml); + string doc = xml->get_doc(); + string baseline = readTestBaseline(string(TEST_SRC_DIR) + "/D4-xml/D4EnumDefs_1.xml"); + DBG(cerr << "test_print_1: doc: " << doc << endl); + DBG(cerr << "test_print_1: baseline: " << baseline << endl); + CPPUNIT_ASSERT(doc == baseline); + } + + + void test_print_2() { + d->add_enum("first", dods_byte_c, e); + d->add_enum("second", dods_int32_c, e2); + + d->print(*xml); + string doc = xml->get_doc(); + string baseline = readTestBaseline(string(TEST_SRC_DIR) + "/D4-xml/D4EnumDefs_2.xml"); + DBG(cerr << "test_print_2: doc: " << doc << endl); + DBG(cerr << "test_print_2: baseline: " << baseline << endl); + CPPUNIT_ASSERT(doc == baseline); + } + + void test_print_insert_enum() { + d->add_enum("first", dods_byte_c, e); + + // "second' winds up before 'first' + D4EnumDefs::D4EnumIter i = d->enum_begin(); + d->insert_enum("second", dods_int32_c, e2, i); + + d->print(*xml); + string doc = xml->get_doc(); + string baseline = readTestBaseline(string(TEST_SRC_DIR) + "/D4-xml/D4EnumDefs_3.xml"); + DBG(cerr << "test_print_insert_enum: doc: " << doc << endl); + DBG(cerr << "test_print_insert_enum: baseline: " << baseline << endl); + CPPUNIT_ASSERT(doc == baseline); + } + + void test_print_assignment() { + d->add_enum("first", dods_byte_c, e); + d->add_enum("second", dods_int32_c, e2); + + D4EnumDefs lhs = *d; + + lhs.print(*xml); + string doc = xml->get_doc(); + string baseline = readTestBaseline(string(TEST_SRC_DIR) + "/D4-xml/D4EnumDefs_2.xml"); + DBG(cerr << "test_print_assignment: doc: " << doc << endl); + DBG(cerr << "test_print_assignment: baseline: " << baseline << endl); + CPPUNIT_ASSERT(doc == baseline); + } + + void test_print_copy_ctor() { + d->add_enum("first", dods_byte_c, e); + d->add_enum("second", dods_int32_c, e2); + + D4EnumDefs lhs(*d); + + lhs.print(*xml); + string doc = xml->get_doc(); + string baseline = readTestBaseline(string(TEST_SRC_DIR) + "/D4-xml/D4EnumDefs_2.xml"); + DBG(cerr << "test_print_copy_ctor: doc: " << doc << endl); + DBG(cerr << "test_print_copy_ctor: baseline: " << baseline << endl); + CPPUNIT_ASSERT(doc == baseline); + } + + CPPUNIT_TEST_SUITE( D4EnumDefsTest ); + + CPPUNIT_TEST(test_print_empty); + CPPUNIT_TEST(test_print_enum_values_only); + CPPUNIT_TEST(test_print_1); + CPPUNIT_TEST(test_print_2); + + CPPUNIT_TEST(test_print_insert_enum); + CPPUNIT_TEST(test_print_assignment); + CPPUNIT_TEST(test_print_copy_ctor); + + CPPUNIT_TEST_SUITE_END(); +}; + +CPPUNIT_TEST_SUITE_REGISTRATION(D4EnumDefsTest); + +int main(int, char**) { + CppUnit::TextTestRunner runner; + runner.addTest(CppUnit::TestFactoryRegistry::getRegistry().makeTest()); + + bool wasSuccessful = runner.run("", false); + + return wasSuccessful ? 0 : 1; +} + diff -Nru libdap-3.11.1/unit-tests/DAP4MarshallerTest.cc libdap-3.12.0/unit-tests/DAP4MarshallerTest.cc --- libdap-3.11.1/unit-tests/DAP4MarshallerTest.cc 1970-01-01 00:00:00.000000000 +0000 +++ libdap-3.12.0/unit-tests/DAP4MarshallerTest.cc 2013-10-17 21:27:40.000000000 +0000 @@ -0,0 +1,311 @@ +#include +#include +#include +#include +#include +#include + +#include "config.h" + +#ifdef HAVE_UNISTD_H +#include +#endif +#include +#include + +// #define DODS_DEBUG 1 + +#include +#include +#include +#include + +#include "DAP4StreamMarshaller.h" + +#include "debug.h" + +using namespace std; +using namespace libdap; + +class DAP4MarshallerTest: public CppUnit::TestFixture { + + CPPUNIT_TEST_SUITE( DAP4MarshallerTest ); + + CPPUNIT_TEST(test_cmp); + CPPUNIT_TEST(test_scalars); + CPPUNIT_TEST(test_real_scalars); + CPPUNIT_TEST(test_str); + CPPUNIT_TEST(test_opaque); + CPPUNIT_TEST(test_vector); + CPPUNIT_TEST(test_varying_vector); + + CPPUNIT_TEST_SUITE_END( ); + + /** + * Compare the contents of a file with a memory buffer + */ + bool cmp(const char *buf, unsigned int len, string file) { + fstream in; + in.open(file.c_str(), fstream::binary | fstream::in); + if (!in) { + cerr << "Could not open file: " << file << endl; + return false; + } + + vector fbuf(len); + in.read(&fbuf[0], len); + if (!in) { + cerr << "Could not read " << len << " bytes from file." << endl; + return false; + } + + for (unsigned int i = 0; i < len; ++i) + if (*buf++ != fbuf[i]) { + cerr << "Response differs from baseline at byte " << i << endl; + cerr << "Expected: " << setfill('0') << setw(2) << hex + << (unsigned int)fbuf[i] << "; got: " + << (unsigned int)buf[i] << dec << endl; + return false; + } + + return true; + } + + void write_binary_file(const char *buf, int len, string file) { + fstream out; + out.open(file.c_str(), fstream::binary | fstream::out); + if (!out) { + cerr << "Could not open file: " << file << endl; + return; + } + + out.write(buf, len); + } + +public: + DAP4MarshallerTest() { + } + + void setUp() { + } + + void tearDown() { + } + + void test_cmp() { + char buf[16] = { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15 }; + CPPUNIT_ASSERT(cmp(buf, 16, "test_cmp.dat")); + } + + void test_scalars() { + ostringstream oss; + // computes checksums and writes data + try { + DAP4StreamMarshaller dsm(oss); + + dsm.reset_checksum(); + + dsm.put_byte(17); + dsm.put_checksum(); + dsm.reset_checksum(); + + dsm.put_int16(17); + dsm.put_checksum(); + dsm.reset_checksum(); + + dsm.put_int32(17); + dsm.put_checksum(); + dsm.reset_checksum(); + + dsm.put_int64(17); + dsm.put_checksum(); + dsm.reset_checksum(); + + dsm.put_uint16(17); + dsm.put_checksum(); + dsm.reset_checksum(); + + dsm.put_uint32(17); + dsm.put_checksum(); + dsm.reset_checksum(); + + dsm.put_uint64(17); + dsm.put_checksum(); + dsm.reset_checksum(); + + //write_binary_file(oss.str().data(), oss.str().length(), "test_scalars_1_bin.dat"); + CPPUNIT_ASSERT(cmp(oss.str().data(), oss.str().length(), "test_scalars_1_bin.dat")); + } + catch (Error &e) { + cerr << "Error: " << e.get_error_message() << endl; + CPPUNIT_FAIL("Caught an exception."); + } + } + + void test_real_scalars() { + ostringstream oss; + // computes checksums and writes data + try { + DAP4StreamMarshaller dsm(oss); + + dsm.reset_checksum(); + + dsm.put_float32(17); + dsm.put_checksum(); + dsm.reset_checksum(); + + dsm.put_float64(17); + dsm.put_checksum(); + dsm.reset_checksum(); + + //write_binary_file(oss.str().data(), oss.str().length(), "test_scalars_2_bin.dat"); + CPPUNIT_ASSERT(cmp(oss.str().data(), oss.str().length(), "test_scalars_2_bin.dat")); + } + catch (Error &e) { + cerr << "Error: " << e.get_error_message() << endl; + CPPUNIT_FAIL("Caught an exception."); + } + } + + void test_str() { + ostringstream oss; + try { + DAP4StreamMarshaller dsm(oss); + + dsm.reset_checksum(); + + dsm.put_str("This is a test string with 40 characters"); + dsm.put_checksum(); + dsm.reset_checksum(); + + // 37 chars --> 0x25 --> 0x25 as a 128-bit varint + dsm.put_url("http://www.opendap.org/lame/unit/test"); + dsm.put_checksum(); + dsm.reset_checksum(); + + // True these are not really scalars... + //write_binary_file(oss.str().data(), oss.str().length(), "test_scalars_3_bin.dat"); + CPPUNIT_ASSERT(cmp(oss.str().data(), oss.str().length(), "test_scalars_3_bin.dat")); + } + catch (Error &e) { + cerr << "Error: " << e.get_error_message() << endl; + CPPUNIT_FAIL("Caught an exception."); + } + } + + void test_opaque() { + ostringstream oss; + try { + DAP4StreamMarshaller dsm(oss); + vector buf(32768); + for (int i = 0; i < 32768; ++i) + buf[i] = i % (1 << 7); + + dsm.reset_checksum(); + + dsm.put_opaque(reinterpret_cast(&buf[0]), 32768); + dsm.put_checksum(); + dsm.reset_checksum(); + + dsm.put_opaque(reinterpret_cast(&buf[0]), 32768); + dsm.put_checksum(); + + //write_binary_file(oss.str().data(), oss.str().length(), "test_opaque_1_bin.dat"); + CPPUNIT_ASSERT(cmp(oss.str().data(), oss.str().length(), "test_opaque_1_bin.dat")); + } + catch (Error &e) { + cerr << "Error: " << e.get_error_message() << endl; + CPPUNIT_FAIL("Caught an exception."); + } + } + + void test_vector() { + ostringstream oss; + try { + DAP4StreamMarshaller dsm(oss); + vector buf1(32768); + for (int i = 0; i < 32768; ++i) + buf1[i] = i % (1 << 7); + + dsm.reset_checksum(); + + dsm.put_vector(reinterpret_cast(&buf1[0]), 32768); + dsm.put_checksum(); + dsm.reset_checksum(); + + vector buf2(32768); + for (int i = 0; i < 32768; ++i) + buf2[i] = i % (1 << 9); + + dsm.put_vector(reinterpret_cast(&buf2[0]), 32768, sizeof(dods_int32), dods_int32_c); + dsm.put_checksum(); + dsm.reset_checksum(); + + vector buf3(32768); + for (int i = 0; i < 32768; ++i) + buf3[i] = i % (1 << 9); + + dsm.put_vector(reinterpret_cast(&buf3[0]), 32768, sizeof(dods_float64), dods_float64_c); + dsm.put_checksum(); + + //write_binary_file(oss.str().data(), oss.str().length(), "test_vector_1_bin.dat"); + CPPUNIT_ASSERT(cmp(oss.str().data(), oss.str().length(), "test_vector_1_bin.dat")); + } + catch (Error &e) { + cerr << "Error: " << e.get_error_message() << endl; + CPPUNIT_FAIL("Caught an exception."); + } + } + + void test_varying_vector() { + ostringstream oss; + try { + DAP4StreamMarshaller dsm(oss); + vector buf1(32768); + for (int i = 0; i < 32768; ++i) + buf1[i] = i % (1 << 7); + + dsm.reset_checksum(); + + dsm.put_varying_vector(reinterpret_cast(&buf1[0]), 32768); + dsm.put_checksum(); + dsm.reset_checksum(); + + vector buf2(32768); + for (int i = 0; i < 32768; ++i) + buf2[i] = i % (1 << 9); + + dsm.put_varying_vector(reinterpret_cast(&buf2[0]), 32768, sizeof(dods_int32), dods_int32_c); + dsm.put_checksum(); + dsm.reset_checksum(); + + vector buf3(32768); + for (int i = 0; i < 32768; ++i) + buf3[i] = i % (1 << 9); + + dsm.put_varying_vector(reinterpret_cast(&buf3[0]), 32768, sizeof(dods_float64), dods_float64_c); + dsm.put_checksum(); + + //write_binary_file(oss.str().data(), oss.str().length(), "test_vector_2_bin.dat"); + CPPUNIT_ASSERT(cmp(oss.str().data(), oss.str().length(), "test_vector_2_bin.dat")); + } + catch (Error &e) { + cerr << "Error: " << e.get_error_message() << endl; + CPPUNIT_FAIL("Caught an exception."); + } + } + +}; + +CPPUNIT_TEST_SUITE_REGISTRATION( DAP4MarshallerTest ) ; + +int main(int, char **) +{ + CppUnit::TextUi::TestRunner runner; + CppUnit::TestFactoryRegistry ®istry = CppUnit::TestFactoryRegistry::getRegistry(); + runner.addTest(registry.makeTest()); + runner.setOutputter(CppUnit::CompilerOutputter::defaultOutputter(&runner.result(), std::cerr)); + bool wasSuccessful = runner.run("", false); + return wasSuccessful ? 0 : 1; +} + diff -Nru libdap-3.11.1/unit-tests/DAP4UnMarshallerTest.cc libdap-3.12.0/unit-tests/DAP4UnMarshallerTest.cc --- libdap-3.11.1/unit-tests/DAP4UnMarshallerTest.cc 1970-01-01 00:00:00.000000000 +0000 +++ libdap-3.12.0/unit-tests/DAP4UnMarshallerTest.cc 2013-10-17 21:27:40.000000000 +0000 @@ -0,0 +1,362 @@ +#include +#include +#include +#include +#include +#include + +#include "config.h" + +#ifdef HAVE_UNISTD_H +#include +#endif +#include +#include + +//#define DODS_DEBUG2 1 + +#include +#include +#include +#include + +#include "DAP4StreamUnMarshaller.h" + +#include "debug.h" + +using namespace std; +using namespace libdap; + +class DAP4UnMarshallerTest: public CppUnit::TestFixture { + + CPPUNIT_TEST_SUITE( DAP4UnMarshallerTest ); + + CPPUNIT_TEST(test_scalars); + CPPUNIT_TEST(test_real_scalars); + CPPUNIT_TEST(test_str); + CPPUNIT_TEST(test_opaque); + CPPUNIT_TEST(test_vector); + CPPUNIT_TEST(test_varying_vector); + + CPPUNIT_TEST_SUITE_END( ); + + static inline bool is_host_big_endian() + { +#ifdef COMPUTE_ENDIAN_AT_RUNTIME + + dods_int16 i = 0x0100; + char *c = reinterpret_cast(&i); + return *c; + +#else + +#ifdef WORDS_BIGENDIAN + return true; +#else + return false; +#endif + +#endif + } + +public: + DAP4UnMarshallerTest() { + } + + void setUp() { + } + + void tearDown() { + } + + void test_scalars() + { + fstream in; + in.exceptions(ostream::failbit | ostream::badbit); + + // computes checksums and writes data + try { + in.open("test_scalars_1_bin.dat", fstream::binary | fstream::in); + DAP4StreamUnMarshaller dsm(in, is_host_big_endian()); + + dods_byte b; + dsm.get_byte(b); + CPPUNIT_ASSERT(b == 17); + string ck = dsm.get_checksum(dsm.get_checksum()); + DBG2(cerr << "ck: " << ck << endl); + CPPUNIT_ASSERT(ck == "47ed733b8d10be225eceba344d533586"); + + dods_int16 i1; + dsm.get_int16(i1); + CPPUNIT_ASSERT(i1 == 17); + ck = dsm.get_checksum(dsm.get_checksum()); + DBG2(cerr << "ck: " << ck << endl); + CPPUNIT_ASSERT(ck == "e2b50a7929c9fa04c82d9793b9fb710f"); + + dods_int32 i2; + dsm.get_int32(i2); + CPPUNIT_ASSERT(i2 == 17); + ck = dsm.get_checksum(dsm.get_checksum()); + DBG2(cerr << "ck: " << ck << endl); + CPPUNIT_ASSERT(ck == "9ef06d55906276f617c008036beaba81"); + + dods_int64 i3; + dsm.get_int64(i3); + CPPUNIT_ASSERT(i3 == 17); + ck = dsm.get_checksum(dsm.get_checksum()); + DBG2(cerr << "ck: " << ck << endl); + CPPUNIT_ASSERT(ck == "843fd2acf107350d495cae589a37913c"); + + dods_uint16 ui1; + dsm.get_uint16(ui1); + CPPUNIT_ASSERT(ui1 == 17); + ck = dsm.get_checksum(dsm.get_checksum()); + DBG2(cerr << "ck: " << ck << endl); + CPPUNIT_ASSERT(ck == "e2b50a7929c9fa04c82d9793b9fb710f"); + + dods_uint32 ui2; + dsm.get_uint32(ui2); + CPPUNIT_ASSERT(ui2 == 17); + ck = dsm.get_checksum(dsm.get_checksum()); + DBG2(cerr << "ck: " << ck << endl); + CPPUNIT_ASSERT(ck == "9ef06d55906276f617c008036beaba81"); + + dods_uint64 ui3; + dsm.get_uint64(ui3); + CPPUNIT_ASSERT(ui3 == 17); + ck = dsm.get_checksum(dsm.get_checksum()); + DBG2(cerr << "ck: " << ck << endl); + CPPUNIT_ASSERT(ck == "843fd2acf107350d495cae589a37913c"); + } + catch (Error &e) { + cerr << "Error: " << e.get_error_message() << endl; + CPPUNIT_FAIL("Caught an exception."); + } + catch (istream::failure &e) { + cerr << "File error: " << e.what() << endl; + CPPUNIT_FAIL("Caught an exception."); + } + } + + void test_real_scalars() + { + fstream in; + in.exceptions(ostream::failbit | ostream::badbit); + + // computes checksums and writes data + try { + in.open("test_scalars_2_bin.dat", fstream::binary | fstream::in); + DAP4StreamUnMarshaller dsm(in, is_host_big_endian()); + + dods_float32 r1; + dsm.get_float32(r1); + CPPUNIT_ASSERT(r1 == 17.0); + string ck = dsm.get_checksum(dsm.get_checksum()); + DBG2(cerr << "ck: " << ck << endl); + CPPUNIT_ASSERT(ck == "104e50b0d8d66fcc1ed3ff3f43b71018"); + + dods_float64 r2; + dsm.get_float64(r2); + CPPUNIT_ASSERT(r2 == 17.0); + ck = dsm.get_checksum(dsm.get_checksum()); + DBG2(cerr << "ck: " << ck << endl); + CPPUNIT_ASSERT(ck == "77a53e5b4de7c90741dcbe24b827e866"); + } + catch (Error &e) { + cerr << "Error: " << e.get_error_message() << endl; + CPPUNIT_FAIL("Caught an exception."); + } + catch (istream::failure &e) { + cerr << "File error: " << e.what() << endl; + CPPUNIT_FAIL("Caught an exception."); + } + } + + void test_str() { + fstream in; + in.exceptions(ostream::failbit | ostream::badbit); + + // computes checksums and writes data + try { + in.open("test_scalars_3_bin.dat", fstream::binary | fstream::in); + DAP4StreamUnMarshaller dsm(in, is_host_big_endian()); + + string s; + dsm.get_str(s); + CPPUNIT_ASSERT(s == "This is a test string with 40 characters"); + string ck = dsm.get_checksum(dsm.get_checksum()); + DBG2(cerr << "ck: " << ck << endl); + CPPUNIT_ASSERT(ck == "263c8416bf984a01145f31b9328e6e8b"); + + string u; + dsm.get_url(u); + CPPUNIT_ASSERT(u == "http://www.opendap.org/lame/unit/test"); + ck = dsm.get_checksum(dsm.get_checksum()); + DBG2(cerr << "ck: " << ck << endl); + CPPUNIT_ASSERT(ck == "e761355247b5b64889492373e1758107"); + } + catch (Error &e) { + cerr << "Error: " << e.get_error_message() << endl; + CPPUNIT_FAIL("Caught an exception."); + } + catch (istream::failure &e) { + cerr << "File error: " << e.what() << endl; + CPPUNIT_FAIL("Caught an exception."); + } + } + + void test_opaque() { + fstream in; + in.exceptions(ostream::failbit | ostream::badbit); + + // computes checksums and writes data + try { + in.open("test_opaque_1_bin.dat", fstream::binary | fstream::in); + DAP4StreamUnMarshaller dsm(in, is_host_big_endian()); + + // Test both get_opaque calls; this one that expects the caller + // to allocate memory. + vector buf(32768); + dsm.get_opaque(reinterpret_cast(&buf[0]), 32768); + for (int i = 0; i < 32768; ++i) + CPPUNIT_ASSERT(buf[i] == i % (1 << 7)); + string ck = dsm.get_checksum(dsm.get_checksum()); + DBG2(cerr << "ck: " << ck << endl); + CPPUNIT_ASSERT(ck == "4188b46ae4fcbaeee1b2cb74850a7c65"); + + char *buf2; + unsigned int len; + dsm.get_opaque(&buf2, len); + CPPUNIT_ASSERT(len == 32768); + for (int i = 0; i < 32768; ++i) + CPPUNIT_ASSERT(buf2[i] == i % (1 << 7)); + ck = dsm.get_checksum(dsm.get_checksum()); + DBG2(cerr << "ck: " << ck << endl); + CPPUNIT_ASSERT(ck == "4188b46ae4fcbaeee1b2cb74850a7c65"); + + delete buf2; + } + catch (Error &e) { + cerr << "Error: " << e.get_error_message() << endl; + CPPUNIT_FAIL("Caught an exception."); + } + catch (istream::failure &e) { + cerr << "File error: " << e.what() << endl; + CPPUNIT_FAIL("Caught an exception."); + } + } + + void test_vector() { + fstream in; + in.exceptions(ostream::failbit | ostream::badbit); + + // computes checksums and writes data + try { + in.open("test_vector_1_bin.dat", fstream::binary | fstream::in); + DAP4StreamUnMarshaller dsm(in, is_host_big_endian()); + + vector buf1(32768); + dsm.get_vector(reinterpret_cast(&buf1[0]), 32768); + for (int i = 0; i < 32768; ++i) + CPPUNIT_ASSERT(buf1[i] == i % (1 << 7)); + string ck = dsm.get_checksum(dsm.get_checksum()); + DBG2(cerr << "ck: " << ck << endl); + CPPUNIT_ASSERT(ck == "4188b46ae4fcbaeee1b2cb74850a7c65"); + + vector buf2(32768); + dsm.get_vector(reinterpret_cast(&buf2[0]), 32768, sizeof(dods_int32), dods_int32_c); + for (int i = 0; i < 32768; ++i) + CPPUNIT_ASSERT(buf2[i] == i % (1 << 9)); + ck = dsm.get_checksum(dsm.get_checksum()); + DBG2(cerr << "ck: " << ck << endl); + CPPUNIT_ASSERT(ck == "bde002389f9caa5c590d315ce1b6e34e"); + + vector buf3(32768); + dsm.get_vector(reinterpret_cast(&buf3[0]), 32768, sizeof(dods_float64), dods_float64_c); + for (int i = 0; i < 32768; ++i) { + if (buf3[i] != i % (1 << 9)) + cerr << "buf3[" << i << "]: " << buf3[i] << endl; + CPPUNIT_ASSERT(buf3[i] == i % (1 << 9)); + } + ck = dsm.get_checksum(dsm.get_checksum()); + DBG2(cerr << "ck: " << ck << endl); + CPPUNIT_ASSERT(ck == "f249b4d23ba0fd2afa290fe374a2556b"); + } + catch (Error &e) { + cerr << "Error: " << e.get_error_message() << endl; + CPPUNIT_FAIL("Caught an exception."); + } + catch (istream::failure &e) { + cerr << "File error: " << e.what() << endl; + CPPUNIT_FAIL("Caught an exception."); + } + } + + void test_varying_vector() { + fstream in; + in.exceptions(ostream::failbit | ostream::badbit); + + // computes checksums and writes data + try { + in.open("test_vector_2_bin.dat", fstream::binary | fstream::in); + DAP4StreamUnMarshaller dsm(in, is_host_big_endian()); + + // Reuse the same pointer for all of the data... + char *buf; + unsigned int len; + dsm.get_varying_vector(&buf, len); + CPPUNIT_ASSERT(len == 32768); + for (int i = 0; i < 32768; ++i) + CPPUNIT_ASSERT(buf[i] == i % (1 << 7)); + string ck = dsm.get_checksum(dsm.get_checksum()); + DBG2(cerr << "ck: " << ck << endl); + CPPUNIT_ASSERT(ck == "4188b46ae4fcbaeee1b2cb74850a7c65"); + delete buf; + + dods_int32 *i_buf; + dsm.get_varying_vector(reinterpret_cast(&i_buf), len, sizeof(dods_int32), dods_int32_c); + CPPUNIT_ASSERT(len == 32768); + for (int i = 0; i < 32768; ++i) { + if (i_buf[i] != i % (1 << 9)) + cerr << "i_buf[" << i << "]: " << i_buf[i] << endl; + CPPUNIT_ASSERT(i_buf[i] == i % (1 << 9)); + } + ck = dsm.get_checksum(dsm.get_checksum()); + DBG2(cerr << "ck: " << ck << endl); + CPPUNIT_ASSERT(ck == "bde002389f9caa5c590d315ce1b6e34e"); + delete i_buf; + + dods_float64 *f_buf; + dsm.get_varying_vector(reinterpret_cast(&f_buf), len, sizeof(dods_float64), dods_float64_c); + CPPUNIT_ASSERT(len == 32768); + for (int i = 0; i < 32768; ++i) + CPPUNIT_ASSERT(f_buf[i] == i % (1 << 9)); + ck = dsm.get_checksum(dsm.get_checksum()); + DBG2(cerr << "ck: " << ck << endl); + CPPUNIT_ASSERT(ck == "f249b4d23ba0fd2afa290fe374a2556b"); + delete f_buf; + } + catch (Error &e) { + cerr << "Error: " << e.get_error_message() << endl; + CPPUNIT_FAIL("Caught an exception."); + } + catch (istream::failure &e) { + cerr << "File error: " << e.what() << endl; + CPPUNIT_FAIL("Caught an exception."); + } + } + +}; + +CPPUNIT_TEST_SUITE_REGISTRATION( DAP4UnMarshallerTest ) ; + +int main(int, char **) +{ + CppUnit::TextUi::TestRunner runner; + CppUnit::TestFactoryRegistry ®istry = CppUnit::TestFactoryRegistry::getRegistry(); + runner.addTest(registry.makeTest()); + runner.setOutputter(CppUnit::CompilerOutputter::defaultOutputter(&runner.result(), std::cerr)); + bool wasSuccessful = runner.run("", false); + return wasSuccessful ? 0 : 1; +} + diff -Nru libdap-3.11.1/unit-tests/DASTest.cc libdap-3.12.0/unit-tests/DASTest.cc --- libdap-3.11.1/unit-tests/DASTest.cc 2011-04-29 13:19:42.000000000 +0000 +++ libdap-3.12.0/unit-tests/DASTest.cc 2013-10-17 21:27:40.000000000 +0000 @@ -19,7 +19,7 @@ // // You should have received a copy of the GNU Lesser General Public // License along with this library; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA // // You can contact OPeNDAP, Inc. at PO Box 112, Saunderstown, RI. 02874-0112. diff -Nru libdap-3.11.1/unit-tests/DDSTest.cc libdap-3.12.0/unit-tests/DDSTest.cc --- libdap-3.11.1/unit-tests/DDSTest.cc 2011-04-29 13:19:42.000000000 +0000 +++ libdap-3.12.0/unit-tests/DDSTest.cc 2013-10-17 21:27:40.000000000 +0000 @@ -18,7 +18,7 @@ // // You should have received a copy of the GNU Lesser General Public // License along with this library; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA // // You can contact OPeNDAP, Inc. at PO Box 112, Saunderstown, RI. 02874-0112. @@ -31,7 +31,7 @@ #include "config.h" //#define DODS_DEBUG2 -// #define DODS_DEBUG +//#define DODS_DEBUG #include "Byte.h" #include "Int16.h" @@ -52,6 +52,8 @@ #include "GNURegex.h" #include "util.h" #include "debug.h" + +#include "testFile.h" #include "test_config.h" using namespace CppUnit; @@ -60,546 +62,412 @@ namespace libdap { class DDSTest: public TestFixture { - private: - DDS *dds1, *dds2; - BaseTypeFactory factory; - - public: - DDSTest() - { - } - ~DDSTest() - { - } - - void setUp() - { - //factory = new BaseTypeFactory; - dds1 = new DDS(&factory, "test1"); - dds2 = new DDS(&factory, "test2"); - } - - void tearDown() - { - delete dds1; - dds1 = 0; - delete dds2; - dds2 = 0; - //delete factory; factory = 0; - } - - bool re_match(Regex &r, const string &s) - { - int match = r.match(s.c_str(), s.length()); - DBG(cerr << "Match: " << match << " should be: " << s.length() - << endl); - return match == static_cast (s.length()); - } - - // The tests commented exercise features no longer supported - // by libdap. In particular, a DAS must now be properly structured - // to work with transfer_attributes() - if a handler builds a malformed - // DAS, it will need to specialize the BaseType::transfer_attributes() - // method. - CPPUNIT_TEST_SUITE( DDSTest ); +private: + DDS *dds1, *dds2; + BaseTypeFactory factory; + + DDS *dds_dap4; + +public: + DDSTest() { + } + ~DDSTest() { + } + + void setUp() { + dds1 = new DDS(&factory, "test1"); + dds2 = new DDS(&factory, "test2"); + + dds_dap4 = new DDS(&factory, "test2", "4.0"); + } + + void tearDown() { + delete dds1; dds1 = 0; + delete dds2; dds2 = 0; + + delete dds_dap4; dds_dap4 = 0; + } + + bool re_match(Regex &r, const string &s) { + int match = r.match(s.c_str(), s.length()); + DBG(cerr << "Match: " << match << " should be: " << s.length() + << endl); + return match == static_cast (s.length()); + } + + // The tests commented exercise features no longer supported + // by libdap. In particular, a DAS must now be properly structured + // to work with transfer_attributes() - if a handler builds a malformed + // DAS, it will need to specialize the BaseType::transfer_attributes() + // method. + CPPUNIT_TEST_SUITE( DDSTest ); #if 1 CPPUNIT_TEST(transfer_attributes_test_1); CPPUNIT_TEST(transfer_attributes_test_2); CPPUNIT_TEST(symbol_name_test); +#endif // These test both transfer_attributes() and print_xml() CPPUNIT_TEST(print_xml_test); +#if 1 CPPUNIT_TEST(print_xml_test2); CPPUNIT_TEST(print_xml_test3); -#endif + + // The X_1 tests look at the proper merging of hdf4's _dim_n attributes. + // But that functionality was moved from libdap to the hdf4 handler. // CPPUNIT_TEST(print_xml_test3_1); -#if 1 - CPPUNIT_TEST(print_xml_test4); + CPPUNIT_TEST(print_xml_test4); CPPUNIT_TEST(print_xml_test5); -#endif // CPPUNIT_TEST(print_xml_test5_1); -#if 1 CPPUNIT_TEST(print_xml_test6); -#endif - // CPPUNIT_TEST(print_xml_test7); + // CPPUNIT_TEST(print_xml_test6_1); + CPPUNIT_TEST(print_dmr_test); - CPPUNIT_TEST_SUITE_END(); - - void transfer_attributes_test_1() { - try { - dds1->parse((string)TEST_SRC_DIR + "/dds-testsuite/fnoc1.nc.dds"); - DAS das; - das.parse((string)TEST_SRC_DIR + "/dds-testsuite/fnoc1.nc.das"); - dds1->transfer_attributes(&das); - - DBG2(dds1->print_xml(cerr, false, "")); - - AttrTable &at = dds1->get_attr_table(); - AttrTable::Attr_iter i = at.attr_begin(); - CPPUNIT_ASSERT(i != at.attr_end() && at.get_name(i) == "NC_GLOBAL"); - CPPUNIT_ASSERT(i != at.attr_end() && at.get_name(++i) == "DODS_EXTRA"); - } - catch (Error &e) { - cout << "Error: " << e.get_error_message() << endl; - CPPUNIT_FAIL("Error thrown!"); - } - } + CPPUNIT_TEST(get_response_size_test); + CPPUNIT_TEST(get_response_size_test_c); + CPPUNIT_TEST(get_response_size_test_c2); + CPPUNIT_TEST(get_response_size_test_c3); + CPPUNIT_TEST(get_response_size_test_seq); + CPPUNIT_TEST(get_response_size_test_seq_c); +#endif - void transfer_attributes_test_2() { - try { - dds2->parse((string)TEST_SRC_DIR + "/dds-testsuite/3B42.980909.5.HDF.dds"); - DAS das; - das.parse((string)TEST_SRC_DIR + "/dds-testsuite/3B42.980909.5.hacked.HDF.das"); - dds2->transfer_attributes(&das); - - DBG2(dds2->print_xml(cerr, false, "")); - - AttrTable &at = dds2->get_attr_table(); - AttrTable::Attr_iter i = at.attr_begin(); - CPPUNIT_ASSERT(i != at.attr_end() && at.get_name(i) == "HDF_GLOBAL"); - CPPUNIT_ASSERT(i != at.attr_end() && at.get_name(++i) == "CoreMetadata"); - } - catch (Error &e) { - cout << "Error: " << e.get_error_message() << endl; - CPPUNIT_FAIL("Error thrown!"); - } - } + CPPUNIT_TEST_SUITE_END(); - void symbol_name_test() { - try { - // read a DDS. - dds1->parse((string)TEST_SRC_DIR + "/dds-testsuite/test.18"); - CPPUNIT_ASSERT(dds1->var("oddTemp")); - - dds2->parse((string)TEST_SRC_DIR + "/dds-testsuite/test.19b"); - CPPUNIT_ASSERT(dds2->var("b#c")); - CPPUNIT_ASSERT(dds2->var("b%23c")); - CPPUNIT_ASSERT(dds2->var("huh.Image#data")); - CPPUNIT_ASSERT(dds2->var("c d")); - CPPUNIT_ASSERT(dds2->var("c%20d")); - } - catch (Error &e) { - cerr << e.get_error_message() << endl; - CPPUNIT_FAIL("Caught unexpected Error object"); - } - } + void transfer_attributes_test_1() { + try { + dds1->parse((string) TEST_SRC_DIR + "/dds-testsuite/fnoc1.nc.dds"); + DAS das; + das.parse((string) TEST_SRC_DIR + "/dds-testsuite/fnoc1.nc.das"); + dds1->transfer_attributes(&das); - void print_xml_test() { - dds2->parse((string)TEST_SRC_DIR + "/dds-testsuite/test.19b"); - ostringstream oss; - dds2->print_xml(oss, false, "http://localhost/dods/test.xyz"); - Regex r("<.xml version=\"1.0\" encoding=\"UTF-8\".>\n\ -\n\ - \n\ - \n\ - \n\ - \n\ - \n\ - \n\ - \n\ - \n\ - \n\ - \n\ - \n\ - \n\ - \n\ - \n\ - \n\ -\n\ - \n\ -\n"); - CPPUNIT_ASSERT(re_match(r, oss.str())); - } + DBG2(dds1->print_xml(cerr, false, "")); - void print_xml_test2() { - dds2->parse((string)TEST_SRC_DIR + "/dds-testsuite/test.19c"); + AttrTable &at = dds1->get_attr_table(); + AttrTable::Attr_iter i = at.attr_begin(); + CPPUNIT_ASSERT(i != at.attr_end() && at.get_name(i) == "NC_GLOBAL"); + CPPUNIT_ASSERT(i != at.attr_end() && at.get_name(++i) == "DODS_EXTRA"); + } catch (Error &e) { + cout << "Error: " << e.get_error_message() << endl; + CPPUNIT_FAIL("Error thrown!"); + } + } + + void transfer_attributes_test_2() { + try { + dds2->parse((string) TEST_SRC_DIR + "/dds-testsuite/3B42.980909.5.HDF.dds"); DAS das; - das.parse((string)TEST_SRC_DIR + "/dds-testsuite/test.19c.das"); - + das.parse((string) TEST_SRC_DIR + "/dds-testsuite/3B42.980909.5.hacked.HDF.das"); dds2->transfer_attributes(&das); - ostringstream oss; - dds2->print_xml(oss, false, "http://localhost/dods/test.xyz"); - - DBG2(cerr << oss.str() << endl); + DBG2(dds2->print_xml(cerr, false, "")); - Regex r("<.xml version=\"1.0\" encoding=\"UTF-8\".>\n\ -\n\ - \n\ - Attribute merge test\n\ - \n\ - \n\ - 2\n\ - 3\n\ - 5\n\ - 7\n\ - 11\n\ - \n\ - \n\ -\n\ - \n\ -\n\ - \n\ -\n"); + AttrTable &at = dds2->get_attr_table(); + AttrTable::Attr_iter i = at.attr_begin(); + CPPUNIT_ASSERT(i != at.attr_end() && at.get_name(i) == "HDF_GLOBAL"); + CPPUNIT_ASSERT(i != at.attr_end() && at.get_name(++i) == "CoreMetadata"); + } catch (Error &e) { + cout << "Error: " << e.get_error_message() << endl; + CPPUNIT_FAIL("Error thrown!"); + } + } + + void symbol_name_test() { + try { + // read a DDS. + dds1->parse((string) TEST_SRC_DIR + "/dds-testsuite/test.18"); + CPPUNIT_ASSERT(dds1->var("oddTemp")); + + dds2->parse((string) TEST_SRC_DIR + "/dds-testsuite/test.19b"); + CPPUNIT_ASSERT(dds2->var("b#c")); + CPPUNIT_ASSERT(dds2->var("b%23c")); + CPPUNIT_ASSERT(dds2->var("huh.Image#data")); + CPPUNIT_ASSERT(dds2->var("c d")); + CPPUNIT_ASSERT(dds2->var("c%20d")); + } catch (Error &e) { + cerr << e.get_error_message() << endl; + CPPUNIT_FAIL("Caught unexpected Error object"); + } + } + + void print_xml_test() { + try { + dds2->parse((string) TEST_SRC_DIR + "/dds-testsuite/test.19b"); + ostringstream oss; + dds2->print_xml_writer(oss, false, "http://localhost/dods/test.xyz"); + DBG2(cerr << "Printed DDX: " << oss.str() << endl); - CPPUNIT_ASSERT(re_match(r, oss.str())); + string baseline = readTestBaseline((string) TEST_SRC_DIR + "/dds-testsuite/test.19b.xml"); + DBG2(cerr << "The baseline: " << baseline << endl); + CPPUNIT_ASSERT(baseline == oss.str()); + } + catch (Error &e) { + cerr << e.get_error_message() << endl; + CPPUNIT_FAIL("Caught unexpected Error object"); } + } - void print_xml_test3() { - dds2->parse((string)TEST_SRC_DIR + "/dds-testsuite/test.19d"); - DAS das; - das.parse((string)TEST_SRC_DIR + "/dds-testsuite/test.19d.das"); + void print_xml_test2() { + dds2->parse((string) TEST_SRC_DIR + "/dds-testsuite/test.19c"); + DAS das; + das.parse((string) TEST_SRC_DIR + "/dds-testsuite/test.19c.das"); - dds2->transfer_attributes(&das); + dds2->transfer_attributes(&das); - ostringstream oss; - dds2->print_xml(oss, false, "http://localhost/dods/test.xyz"); + ostringstream oss; + dds2->print_xml_writer(oss, false, "http://localhost/dods/test.xyz"); - DBG2(cerr << oss.str() << endl); + DBG2(cerr << oss.str() << endl); - Regex r("<.xml version=\"1.0\" encoding=\"UTF-8\".>\n\ -\n\ - \n\ - b pound c\n\ - \n\ - \n\ - \n\ - \n\ -\n\ - \n\ -\n"); + string baseline = readTestBaseline((string) TEST_SRC_DIR + "/dds-testsuite/test.19c.xml"); + DBG2(cerr << baseline << endl); + CPPUNIT_ASSERT(baseline == oss.str()); + } - CPPUNIT_ASSERT(re_match(r, oss.str())); - } + void print_xml_test3() { + dds2->parse((string) TEST_SRC_DIR + "/dds-testsuite/test.19d"); + DAS das; + das.parse((string) TEST_SRC_DIR + "/dds-testsuite/test.19d.das"); - // This tests the HDF4 _dim_n attribute. support for that was - // moved to the handler itself. - void print_xml_test3_1() { - dds2->parse((string)TEST_SRC_DIR + "/dds-testsuite/test.19d"); - DAS das; - das.parse((string)TEST_SRC_DIR + "/dds-testsuite/test.19d1.das"); + dds2->transfer_attributes(&das); - dds2->transfer_attributes(&das); + ostringstream oss; + dds2->print_xml_writer(oss, false, "http://localhost/dods/test.xyz"); - ostringstream oss; - dds2->print_xml(oss, false, "http://localhost/dods/test.xyz"); + DBG2(cerr << oss.str() << endl); - DBG2(cerr << oss.str() << endl); + string baseline = readTestBaseline((string) TEST_SRC_DIR + "/dds-testsuite/test.19d.xml"); + DBG2(cerr << baseline << endl); + CPPUNIT_ASSERT(baseline == oss.str()); + } - Regex r("<.xml version=\"1.0\" encoding=\"UTF-8\".>\n\ -\n\ - \n\ - b pound c\n\ - \n\ - \n\ - \n\ - 0.125\n\ - \n\ - \n\ - \n\ - \n\ - \n\ -\n\ - \n\ -\n"); + // This tests the HDF4 _dim_n attribute. support for that was + // moved to the handler itself. + void print_xml_test3_1() { + dds2->parse((string) TEST_SRC_DIR + "/dds-testsuite/test.19d"); + DAS das; + das.parse((string) TEST_SRC_DIR + "/dds-testsuite/test.19d1.das"); - CPPUNIT_ASSERT(re_match(r, oss.str())); - } + dds2->transfer_attributes(&das); - void print_xml_test4() { - dds2->parse((string)TEST_SRC_DIR + "/dds-testsuite/test.19e"); - DAS das; - das.parse((string)TEST_SRC_DIR + "/dds-testsuite/test.19e.das"); + ostringstream oss; + dds2->print_xml_writer(oss, false, "http://localhost/dods/test.xyz"); - dds2->transfer_attributes(&das); + DBG2(cerr << oss.str() << endl); - DBG(AttrTable &at2 = dds2->var("c%20d")->get_attr_table()); - DBG(at2.print(stderr)); + string baseline = readTestBaseline((string) TEST_SRC_DIR + "/dds-testsuite/test.19d1.xml"); + DBG2(cerr << baseline << endl); + CPPUNIT_ASSERT(baseline == oss.str()); + } - ostringstream oss; - dds2->print_xml(oss, false, "http://localhost/dods/test.xyz"); + void print_xml_test4() { + dds2->parse((string) TEST_SRC_DIR + "/dds-testsuite/test.19e"); + DAS das; + das.parse((string) TEST_SRC_DIR + "/dds-testsuite/test.19e.das"); - DBG(cerr << oss.str() << endl); + dds2->transfer_attributes(&das); - Regex r("<.xml version=\"1.0\" encoding=\"UTF-8\".>\n\ -\n\ - \n\ - c d with a WWW escape sequence\n\ - \n\ - \n\ - \n\ - Attributes inside attributes\n\ - \n\ - \n\ - 3.1415\n\ - \n\ - \n\ -
    \n\ -\n\ - \n\ -\n"); + DBG(AttrTable &at2 = dds2->var("c%20d")->get_attr_table()); DBG(at2.print(stderr)); - CPPUNIT_ASSERT(re_match(r, oss.str())); - } + ostringstream oss; + dds2->print_xml_writer(oss, false, "http://localhost/dods/test.xyz"); - void print_xml_test5() { - dds2->parse((string)TEST_SRC_DIR + "/dds-testsuite/test.19f"); - DAS das; - das.parse((string)TEST_SRC_DIR + "/dds-testsuite/test.19f.das"); + DBG(cerr << oss.str() << endl); - try { - dds2->transfer_attributes(&das); - } - catch (Error &e) { - cerr << "Error: " << e.get_error_message() << endl; - CPPUNIT_FAIL("Error exception"); - } + string baseline = readTestBaseline((string) TEST_SRC_DIR + "/dds-testsuite/test.19e.xml"); + DBG2(cerr << baseline << endl); + CPPUNIT_ASSERT(baseline == oss.str()); + } - DBG(AttrTable &at2 = dds2->var("huh")->get_attr_table()); - DBG(at2.print(stderr)); + void print_xml_test5() { + dds2->parse((string) TEST_SRC_DIR + "/dds-testsuite/test.19f"); + DAS das; + das.parse((string) TEST_SRC_DIR + "/dds-testsuite/test.19f.das"); - ostringstream oss; - dds2->print_xml(oss, false, "http://localhost/dods/test.xyz"); + try { + dds2->transfer_attributes(&das); + } catch (Error &e) { + cerr << "Error: " << e.get_error_message() << endl; + CPPUNIT_FAIL("Error exception"); + } - DBG(cerr << oss.str() << endl); + DBG(AttrTable &at2 = dds2->var("huh")->get_attr_table()); DBG(at2.print(stderr)); - Regex r("<.xml version=\"1.0\" encoding=\"UTF-8\".>\n\ -\n\ - \n\ - The Grid huh\n\ - \n\ - \n\ - \n\ - \n\ - \n\ - \n\ - \n\ - The color map vector\n\ - \n\ - \n\ - \n\ - \n\ - \n\ -\n\ - \n\ -\n"); + ostringstream oss; + dds2->print_xml_writer(oss, false, "http://localhost/dods/test.xyz"); - CPPUNIT_ASSERT(re_match(r, oss.str())); - } + DBG(cerr << oss.str() << endl); - // Tests flat DAS into a DDS; no longer supported by libdap; specialize - // handlers if they make these malformed DAS objects - void print_xml_test5_1() { - dds2->parse((string)TEST_SRC_DIR + "/dds-testsuite/test.19f"); - DAS das; - das.parse((string)TEST_SRC_DIR + "/dds-testsuite/test.19f1.das"); + string baseline = readTestBaseline((string) TEST_SRC_DIR + "/dds-testsuite/test.19f.xml"); + DBG2(cerr << baseline << endl); + CPPUNIT_ASSERT(baseline == oss.str()); + } - try { - dds2->transfer_attributes(&das); - } - catch (Error &e) { - cerr << "Error: " << e.get_error_message() << endl; - CPPUNIT_FAIL("Error exception"); - } + // Tests flat DAS into a DDS; no longer supported by libdap; specialize + // handlers if they make these malformed DAS objects + void print_xml_test5_1() { + dds2->parse((string) TEST_SRC_DIR + "/dds-testsuite/test.19f"); + DAS das; + das.parse((string) TEST_SRC_DIR + "/dds-testsuite/test.19f1.das"); - DBG(AttrTable &at2 = dds2->var("huh")->get_attr_table()); - DBG(at2.print(stderr)); + try { + dds2->transfer_attributes(&das); + } catch (Error &e) { + cerr << "Error: " << e.get_error_message() << endl; + CPPUNIT_FAIL("Error exception"); + } - ostringstream oss; - dds2->print_xml(oss, false, "http://localhost/dods/test.xyz"); + DBG(AttrTable &at2 = dds2->var("huh")->get_attr_table()); DBG(at2.print(stderr)); - DBG(cerr << oss.str() << endl); + ostringstream oss; + dds2->print_xml_writer(oss, false, "http://localhost/dods/test.xyz"); - Regex r("<.xml version=\"1.0\" encoding=\"UTF-8\".>\n\ -\n\ - \n\ - The Grid huh\n\ - \n\ - \n\ - \n\ - \n\ - \n\ - \n\ - \n\ - The color map vector\n\ - \n\ - \n\ - m/s\n\ - \n\ - \n\ - \n\ - \n\ - \n\ -\n\ - \n\ -\n"); + DBG(cerr << oss.str() << endl); - CPPUNIT_ASSERT(re_match(r, oss.str())); - } + string baseline = readTestBaseline((string) TEST_SRC_DIR + "/dds-testsuite/test.19f1.xml"); + DBG2(cerr << baseline << endl); + CPPUNIT_ASSERT(baseline == oss.str()); + } - void print_xml_test6() { - dds2->parse((string)TEST_SRC_DIR + "/dds-testsuite/test.19b"); - DAS das; - das.parse((string)TEST_SRC_DIR + "/dds-testsuite/test.19b.das"); + void print_xml_test6() { + dds2->parse((string) TEST_SRC_DIR + "/dds-testsuite/test.19b"); + DAS das; + das.parse((string) TEST_SRC_DIR + "/dds-testsuite/test.19b.das"); - dds2->transfer_attributes(&das); + dds2->transfer_attributes(&das); - ostringstream oss; - dds2->print_xml(oss, false, "http://localhost/dods/test.xyz"); + ostringstream oss; + dds2->print_xml_writer(oss, false, "http://localhost/dods/test.xyz"); + + DBG(cerr << oss.str() << endl); - DBG(cerr << oss.str() << endl); + string baseline = readTestBaseline((string) TEST_SRC_DIR + "/dds-testsuite/test.19b6.xml"); + DBG2(cerr << baseline << endl); + CPPUNIT_ASSERT(baseline == oss.str()); + } - Regex r("<.xml version=\"1.0\" encoding=\"UTF-8\".>\n\ -\n\ - \n\ - Attribute merge test\n\ - \n\ - \n\ - 2\n\ - 3\n\ - 5\n\ - 7\n\ - 11\n\ - \n\ - \n\ -\n\ - \n\ - \n\ - \n\ - b pound c\n\ - \n\ - \n\ - \n\ - \n\ - \n\ - \n\ - c d with a WWW escape sequence\n\ - \n\ - \n\ - \n\ - Attributes inside attributes\n\ - \n\ - \n\ - 3.1415\n\ - \n\ - \n\ - \n\ - \n\ - \n\ - The Grid huh\n\ - \n\ - \n\ - \n\ - \n\ - \n\ - \n\ - \n\ - The color map vector\n\ - \n\ - \n\ - \n\ - \n\ - \n\ -\n\ - \n\ -\n"); + // Tests flat DAS into a DDS; no longer supported by libdap; specialize + // handlers if they make these malformed DAS objects + void print_xml_test6_1() { + dds2->parse((string) TEST_SRC_DIR + "/dds-testsuite/test.19g"); + DAS das; + das.parse((string) TEST_SRC_DIR + "/dds-testsuite/test.19g.das"); - CPPUNIT_ASSERT(re_match(r, oss.str())); + try { + dds2->transfer_attributes(&das); + } catch (Error &e) { + cerr << "Error: " << e.get_error_message() << endl; + CPPUNIT_FAIL("Error exception"); } - // Tests flat DAS into a DDS; no longer supported by libdap; specialize - // handlers if they make these malformed DAS objects - void print_xml_test7() { - dds2->parse((string)TEST_SRC_DIR + "/dds-testsuite/test.19g"); - DAS das; - das.parse((string)TEST_SRC_DIR + "/dds-testsuite/test.19g.das"); + DBG(AttrTable &at2 = dds2->var("huh")->get_attr_table()); DBG(at2.print(stderr)); - try { - dds2->transfer_attributes(&das); - } - catch (Error &e) { - cerr << "Error: " << e.get_error_message() << endl; - CPPUNIT_FAIL("Error exception"); - } + ostringstream oss; + dds2->print_xml_writer(oss, false, "http://localhost/dods/test.xyz"); - DBG(AttrTable &at2 = dds2->var("huh")->get_attr_table()); - DBG(at2.print(stderr)); + DBG(cerr << oss.str() << endl); + string baseline = readTestBaseline((string) TEST_SRC_DIR + "/dds-testsuite/test.19g.xml"); + DBG2(cerr << baseline << endl); + CPPUNIT_ASSERT(baseline == oss.str()); + } + + void print_dmr_test() + { + try { + dds_dap4->parse((string) TEST_SRC_DIR + "/dds-testsuite/fnoc1.nc.dds"); + DAS das; + das.parse((string) TEST_SRC_DIR + "/dds-testsuite/fnoc1.nc.das"); + dds_dap4->transfer_attributes(&das); +#if 0 + string file = (string) TEST_SRC_DIR + "/dds-testsuite/fnoc1.nc.dmr.xml"; + ofstream d(file.c_str()); + dds_dap4->print_dmr(d, false); + d.close(); +#endif ostringstream oss; - dds2->print_xml(oss, false, "http://localhost/dods/test.xyz"); + dds_dap4->print_dmr(oss, false); - DBG(cerr << oss.str() << endl); + string baseline = readTestBaseline((string) TEST_SRC_DIR + "/dds-testsuite/fnoc1.nc.dmr.xml"); - Regex r("<.xml version=\"1.0\" encoding=\"UTF-8\".>\n\ -\n\ - \n\ - \n\ - b pound c\n\ - \n\ - \n\ - \n\ - 0.125\n\ - \n\ - \n\ - \n\ - \n\ - \n\ - \n\ - \n\ - The Grid huh\n\ - \n\ - \n\ - \n\ - \n\ - \n\ - \n\ - \n\ - The color map vector\n\ - \n\ - \n\ - m/s\n\ - \n\ - \n\ - \n\ - \n\ - \n\ -
    \n\ -\n\ - \n\ -\n"); + DBG(cerr << "Baseline: -->" << baseline << "<--" << endl); + DBG(cerr << "DMR: -->" << oss.str() << "<--" << endl); - CPPUNIT_ASSERT(re_match(r, oss.str())); + CPPUNIT_ASSERT(baseline == oss.str()); } + catch (Error &e) { + CPPUNIT_FAIL(e.get_error_message()); + } + } + + void get_response_size_test() { + dds1->parse((string) TEST_SRC_DIR + "/dds-testsuite/3B42.980909.5.HDF.dds"); + CPPUNIT_ASSERT(dds1->get_request_size(false) == 230400); + DBG(cerr << "3B42.980909.5.HDF response size: " << dds1->get_request_size(false) << endl); + + dds2->parse((string) TEST_SRC_DIR + "/dds-testsuite/coads_climatology.nc.dds"); + CPPUNIT_ASSERT(dds2->get_request_size(false) == 3119424); + DBG(cerr << "coads_climatology.nc response size: " << dds2->get_request_size(false) << endl); + } + + void get_response_size_test_c() { + ConstraintEvaluator eval; + + dds1->parse((string) TEST_SRC_DIR + "/dds-testsuite/3B42.980909.5.HDF.dds"); + eval.parse_constraint("percipitate", *dds1); + DBG(cerr << "3B42.980909.5.HDF response size: " << dds1->get_request_size(true) << endl); + CPPUNIT_ASSERT(dds1->get_request_size(true) == 115200); + CPPUNIT_ASSERT(dds1->get_request_size(false) == 230400); + + dds2->parse((string) TEST_SRC_DIR + "/dds-testsuite/coads_climatology.nc.dds"); + eval.parse_constraint("SST", *dds2); + DBG(cerr << "coads_climatology.nc response size: " << dds2->get_request_size(true) << endl); + CPPUNIT_ASSERT(dds2->get_request_size(true) == 779856); + CPPUNIT_ASSERT(dds2->get_request_size(false) == 3119424); + } + + void get_response_size_test_c2() { + ConstraintEvaluator eval; + dds2->parse((string) TEST_SRC_DIR + "/dds-testsuite/coads_climatology.nc.dds"); + eval.parse_constraint("SST[0:5][0:44][0:89]", *dds2); + //cerr << "coads_climatology.nc response size: " << dds2->get_request_size(true) << endl; + CPPUNIT_ASSERT(dds2->get_request_size(true) == 98328); + } + + void get_response_size_test_c3() { + ConstraintEvaluator eval; + dds2->parse((string) TEST_SRC_DIR + "/dds-testsuite/coads_climatology.nc.dds"); + eval.parse_constraint("SST[0][0:44][0:89]", *dds2); + DBG(cerr << "coads_climatology.nc response size: " << dds2->get_request_size(true) << endl); + CPPUNIT_ASSERT(dds2->get_request_size(true) == 17288); + } + + void get_response_size_test_seq() { + ConstraintEvaluator eval; + dds2->parse((string) TEST_SRC_DIR + "/dds-testsuite/S2000415.HDF.dds"); + eval.parse_constraint("NSCAT%20Rev%2020.NSCAT%20L2", *dds2); + DBG(cerr << "S2000415.HDF response size: " << dds2->get_request_size(true) << endl); + DBG(dds2->print_constrained(cerr)); + CPPUNIT_ASSERT(dds2->get_request_size(true) == 16 + || dds2->get_request_size(true) == 12); + // sizeof(string) == 8 or 4 depending on the compiler version (?) + } + + void get_response_size_test_seq_c() { + ConstraintEvaluator eval; + dds2->parse((string) TEST_SRC_DIR + "/dds-testsuite/S2000415.HDF.dds"); + eval.parse_constraint("NSCAT%20Rev%2020.NSCAT%20L2.Low_Wind_Speed_Flag", *dds2); + DBG(cerr << "S2000415.HDF response size: " << dds2->get_request_size(true) << endl); + CPPUNIT_ASSERT(dds2->get_request_size(true) == 4); + } - }; - - CPPUNIT_TEST_SUITE_REGISTRATION(DDSTest); +}; +CPPUNIT_TEST_SUITE_REGISTRATION(DDSTest); } -int main(int, char**) -{ +int main(int, char *[]) { CppUnit::TextTestRunner runner; runner.addTest(CppUnit::TestFactoryRegistry::getRegistry().makeTest()); diff -Nru libdap-3.11.1/unit-tests/DDXParserTest.cc libdap-3.12.0/unit-tests/DDXParserTest.cc --- libdap-3.11.1/unit-tests/DDXParserTest.cc 2011-04-29 13:19:42.000000000 +0000 +++ libdap-3.12.0/unit-tests/DDXParserTest.cc 2013-10-17 21:27:40.000000000 +0000 @@ -1,4 +1,3 @@ - // -*- mode: c++; c-basic-offset:4 -*- // This file is part of libdap, A C++ implementation of the OPeNDAP Data @@ -19,7 +18,7 @@ // // You should have received a copy of the GNU Lesser General Public // License along with this library; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA // // You can contact OPeNDAP, Inc. at PO Box 112, Saunderstown, RI. 02874-0112. @@ -29,16 +28,21 @@ #include #include -//#define DODS_DEBUG 1 +#include #include "DDXParserSAX2.h" -//#include "DDXParser.h" #include "BaseTypeFactory.h" #include "ObjectType.h" #include "mime_util.h" +#include "GetOpt.h" #include "debug.h" -#include +#include "test_config.h" + +static bool debug = false; + +#undef DBG +#define DBG(x) do { if (debug) (x); } while(false); using namespace CppUnit; using namespace std; @@ -46,523 +50,629 @@ namespace libdap { -class DDXParserTest : public TestFixture { +class DDXParserTest: public TestFixture { private: - BaseTypeFactory *factory; - DDXParser *ddx_parser; - DDS *dds; + BaseTypeFactory *factory; + DDXParser *ddx_parser; + DDS *dds; public: - DDXParserTest() {} - ~DDXParserTest() {} - - void setUp() { - factory = new BaseTypeFactory; - ddx_parser = new DDXParser(factory); - dds = new DDS(factory); - } - - void tearDown() { - delete ddx_parser; ddx_parser = 0; - delete factory; factory = 0; - delete dds; dds = 0; - } - - CPPUNIT_TEST_SUITE( DDXParserTest ); - - CPPUNIT_TEST(other_xml_parse_test1); - CPPUNIT_TEST(other_xml_parse_test2); - CPPUNIT_TEST(other_xml_parse_test3); - CPPUNIT_TEST(dap_version_test); - CPPUNIT_TEST(no_blob_version_32_test); - CPPUNIT_TEST(blob_in_version_32_test); - CPPUNIT_TEST(parsing_ddx_from_dataddx_test); - CPPUNIT_TEST(top_level_attribute_test); - CPPUNIT_TEST(top_level_attribute_container_test); - CPPUNIT_TEST(top_level_simple_types_test); - CPPUNIT_TEST(top_level_simple_types_with_attributes_test); - CPPUNIT_TEST(simple_arrays_test); - CPPUNIT_TEST(simple_arrays_multi_dim_test); - CPPUNIT_TEST(simple_arrays_attributes_test); - CPPUNIT_TEST(structure_test); - CPPUNIT_TEST(sequence_test); - CPPUNIT_TEST(grid_test); - CPPUNIT_TEST(intern_stream_test); - CPPUNIT_TEST(intern_ddx_from_dataddx_test); - - // Error tests - CPPUNIT_TEST(unknown_tag_test); - CPPUNIT_TEST(bad_nesting_test); - CPPUNIT_TEST(unknown_end_tag_test); - CPPUNIT_TEST(variable_in_attribtue_container_test); - CPPUNIT_TEST(simple_type_missing_attribute_test); - CPPUNIT_TEST(array_missing_dimension_test); - CPPUNIT_TEST(array_missing_dimension_stream_read_test); - - CPPUNIT_TEST_SUITE_END(); - - void other_xml_parse_test1() { - try { - string cid; - ddx_parser->intern((string)TEST_SRC_DIR + "/ddx-testsuite/test.1.other_xml.ddx", dds, cid); - DBG(dds->print_xml(cout, false, " ")); - CPPUNIT_ASSERT(dds->get_dataset_name() == "200803061600_HFRadar_USEGC_6km_rtv_SIO.nc"); - CPPUNIT_ASSERT(dds->get_dap_major() == 3); - CPPUNIT_ASSERT(dds->get_dap_minor() == 3); - } - catch (DDXParseFailed &e) { - DBG(cerr << endl << "Error: " << e.get_error_message() << endl); - CPPUNIT_FAIL("test.00.ddx failed."); - } - } - - void other_xml_parse_test2() { - try { - string cid; - ddx_parser->intern((string)TEST_SRC_DIR + "/ddx-testsuite/test.2.other_xml.ddx", dds, cid); - DBG(dds->print_xml(cout, false, " ")); - CPPUNIT_ASSERT(dds->get_dataset_name() == "200803061600_HFRadar_USEGC_6km_rtv_SIO.nc"); - CPPUNIT_ASSERT(dds->get_dap_major() == 3); - CPPUNIT_ASSERT(dds->get_dap_minor() == 3); - } - catch (DDXParseFailed &e) { - DBG(cerr << endl << "Error: " << e.get_error_message() << endl); - CPPUNIT_FAIL("test.00.ddx failed."); - } - } - - void other_xml_parse_test3() { - try { - string cid; - ddx_parser->intern((string)TEST_SRC_DIR + "/ddx-testsuite/test.3.other_xml.ddx", dds, cid); - DBG(dds->print_xml(cout, false, " ")); - CPPUNIT_ASSERT(dds->get_dataset_name() == "200803061600_HFRadar_USEGC_6km_rtv_SIO.nc"); - CPPUNIT_ASSERT(dds->get_dap_major() == 3); - CPPUNIT_ASSERT(dds->get_dap_minor() == 3); - } - catch (DDXParseFailed &e) { - DBG(cerr << endl << "Error: " << e.get_error_message() << endl); - CPPUNIT_FAIL("test.00.ddx failed."); - } - } - - void dap_version_test() { - FILE *in; - try { - string blob; - ddx_parser->intern((string) TEST_SRC_DIR - + "/ddx-testsuite/test.00.ddx", dds, blob); - CPPUNIT_ASSERT(dds->get_dataset_name() == "SimpleTypes"); - CPPUNIT_ASSERT(dds->get_dap_major() == 3); - CPPUNIT_ASSERT(dds->get_dap_minor() == 2); - - DBG(dds->print_xml(cout, false)); - - string name = string(TEST_SRC_DIR) + "/ddx-testsuite/test.00.ddx"; - in = fopen(name.c_str(), "r"); - - ddx_parser->intern_stream(in, dds, blob); - - CPPUNIT_ASSERT(dds->get_dataset_name() == "SimpleTypes"); - CPPUNIT_ASSERT(dds->get_dap_major() == 3); - CPPUNIT_ASSERT(dds->get_dap_minor() == 2); - - DBG(dds->print_xml(cout, false)); - } - catch (DDXParseFailed &e) { - DBG(cerr << endl << "Error: " << e.get_error_message() << endl); - CPPUNIT_FAIL("test.00.ddx failed."); - } - - fclose(in); - } - - void no_blob_version_32_test() - { - try { - string blob; - ddx_parser->intern((string) TEST_SRC_DIR - + "/ddx-testsuite/test.0c.ddx", dds, blob); - CPPUNIT_ASSERT(dds->get_dataset_name() == "SimpleTypes"); - CPPUNIT_ASSERT(dds->get_dap_major() == 3); - CPPUNIT_ASSERT(dds->get_dap_minor() == 2); - - DBG(dds->print_xml(cout, false)) - ; - } - catch (DDXParseFailed &e) { - DBG(cerr << endl << "Error: " << e.get_error_message() << endl); - CPPUNIT_FAIL("test.0c.ddx failed."); - } - } - - void blob_in_version_32_test() - { - try { - string blob; - ddx_parser->intern((string) TEST_SRC_DIR - + "/ddx-testsuite/test.0d.ddx", dds, blob); - CPPUNIT_FAIL("Parsing test.0d.ddx should fail since it's a DAP 3.2 doc with a dataBLOB tag."); - - DBG(dds->print_xml(cout, false)) - ; - } - catch (DDXParseFailed &e) { - DBG(cerr << endl << "Error: " << e.get_error_message() << endl); - CPPUNIT_ASSERT("test.0d.ddx failed as expected."); - } - } - - void parsing_ddx_from_dataddx_test() - { - try { - string blob; - ddx_parser->intern((string) TEST_SRC_DIR - + "/ddx-testsuite/DDX_from_dataddx.xml", dds, blob); - CPPUNIT_ASSERT(true); - DBG(dds->print_xml(cout, false)); - } - catch (DDXParseFailed &e) { - CPPUNIT_FAIL(e.get_error_message()); - } - - } - - void top_level_attribute_test() - { - try { - string blob; - ddx_parser->intern((string) TEST_SRC_DIR - + "/ddx-testsuite/test.01.ddx", dds, blob); - CPPUNIT_ASSERT(dds->get_dataset_name() == "SimpleTypes"); - - DBG(dds->print_xml(cout, false)) - ; - } - catch (DDXParseFailed &e) { - DBG(cerr << endl << "Error: " << e.get_error_message() << endl); - CPPUNIT_FAIL("test.01.ddx failed."); - } - } - - void top_level_attribute_container_test() - { - try { - string blob; - ddx_parser->intern((string) TEST_SRC_DIR - + "/ddx-testsuite/test.02.ddx", dds, blob); - CPPUNIT_ASSERT(dds->get_dataset_name() == "SimpleTypes"); - DBG(dds->print_xml(cout, false)) - ; - } - catch (DDXParseFailed &e) { - DBG(cerr << endl << "Error: " << e.get_error_message() << endl); - CPPUNIT_FAIL("test.02.ddx failed."); - } - } - - // ALiases are broken *** 05/29/03 jhrg - void top_level_attribute_alias_test() - { - try { - string blob; - ddx_parser->intern((string) TEST_SRC_DIR - + "/ddx-testsuite/test.03.ddx", dds, blob); - CPPUNIT_ASSERT(dds->get_dataset_name() == "SimpleTypes"); - DBG(dds->print_xml(cout, false)) - ; - } - catch (DDXParseFailed &e) { - DBG(cerr << endl << "Error: " << e.get_error_message() << endl); - CPPUNIT_FAIL("test.03.ddx failed."); - } - } - - void top_level_simple_types_test() - { - try { - string blob; - ddx_parser->intern((string) TEST_SRC_DIR - + "/ddx-testsuite/test.04.ddx", dds, blob); - CPPUNIT_ASSERT(dds->get_dataset_name() == "SimpleTypes"); - DBG(dds->print_xml(cout, false)) - ; - } - catch (DDXParseFailed &e) { - DBG(cerr << endl << "DDXParseFailed: " << e.get_error_message() << endl); - CPPUNIT_FAIL("test.04.ddx failed."); - } - catch (Error &e) { - DBG(cerr << endl << "Error: " << e.get_error_message() << endl); - CPPUNIT_FAIL("test.04.ddx failed."); - } - } - - void top_level_simple_types_with_attributes_test() - { - try { - string blob; - ddx_parser->intern((string) TEST_SRC_DIR - + "/ddx-testsuite/test.05.ddx", dds, blob); - CPPUNIT_ASSERT(dds->get_dataset_name() == "SimpleTypes"); - DBG(dds->print_xml(cout, false)) - ; - } - catch (DDXParseFailed &e) { - DBG(cerr << endl << "Error: " << e.get_error_message() << endl); - CPPUNIT_FAIL("test.05.ddx failed."); - } - } - - void simple_arrays_test() - { - try { - string blob; - ddx_parser->intern((string) TEST_SRC_DIR - + "/ddx-testsuite/test.06.ddx", dds, blob); - CPPUNIT_ASSERT(dds->get_dataset_name() == "OneDimensionalSimpleArrays"); - DBG(dds->print_xml(cout, false)) - ; - } - catch (DDXParseFailed &e) { - DBG(cerr << endl << "Error: " << e.get_error_message() << endl); - CPPUNIT_FAIL("test.06.ddx failed."); - } - } - - void simple_arrays_multi_dim_test() - { - try { - string blob; - ddx_parser->intern((string) TEST_SRC_DIR - + "/ddx-testsuite/test.07.ddx", dds, blob); - CPPUNIT_ASSERT(dds->get_dataset_name() == "MultiDimensionalSimpleArrays"); - DBG(dds->print_xml(cout, false)) - ; - } - catch (DDXParseFailed &e) { - DBG(cerr << endl << "Error: " << e.get_error_message() << endl); - CPPUNIT_FAIL("test.07.ddx failed."); - } - } - - void simple_arrays_attributes_test() - { - try { - string blob; - ddx_parser->intern((string) TEST_SRC_DIR - + "/ddx-testsuite/test.08.ddx", dds, blob); - CPPUNIT_ASSERT(dds->get_dataset_name() == "testdata"); - DBG(dds->print_xml(cout, false)) - ; - } - catch (DDXParseFailed &e) { - DBG(cerr << endl << "Error: " << e.get_error_message() << endl); - CPPUNIT_FAIL("test.08.ddx failed."); - } - } - - void structure_test() - { - try { - string blob; - ddx_parser->intern((string) TEST_SRC_DIR - + "/ddx-testsuite/test.09.ddx", dds, blob); - CPPUNIT_ASSERT(dds->get_dataset_name() == "testdata"); - DBG(dds->print_xml(cout, false)) - ; - } - catch (DDXParseFailed &e) { - DBG(cerr << endl << "Error: " << e.get_error_message() << endl); - CPPUNIT_FAIL("test.09.ddx failed."); - } - } - - void sequence_test() - { - try { - string blob; - ddx_parser->intern((string) TEST_SRC_DIR - + "/ddx-testsuite/test.0a.ddx", dds, blob); - CPPUNIT_ASSERT(dds->get_dataset_name() == "testdata"); - DBG(dds->print_xml(cout, false)) - ; - } - catch (DDXParseFailed &e) { - DBG(cerr << endl << "Error: " << e.get_error_message() << endl); - CPPUNIT_FAIL("test.0a.ddx failed."); - } - } - - void grid_test() - { - try { - string blob; - ddx_parser->intern((string) TEST_SRC_DIR - + "/ddx-testsuite/test.0b.ddx", dds, blob); - CPPUNIT_ASSERT(dds->get_dataset_name() == "testdata"); - DBG(dds->print_xml(cout, false)) - ; - } - catch (DDXParseFailed &e) { - DBG(cerr << endl << "Error: " << e.get_error_message() << endl); - CPPUNIT_FAIL("test.0b.ddx failed."); - } - } - - void intern_stream_test() - { - try { - string file_name = (string) TEST_SRC_DIR - + "/ddx-testsuite/test.0b.ddx"; - FILE *in = fopen(file_name.c_str(), "r"); - string blob; - ddx_parser->intern_stream(in, dds, blob); - CPPUNIT_ASSERT(dds->get_dataset_name() == "testdata"); - DBG(dds->print_xml(cout, false)) - ; - } - catch (DDXParseFailed &e) { - DBG(cerr << endl << "Error: " << e.get_error_message() << endl); - CPPUNIT_FAIL("test.0b.ddx failed."); - } - } - - // Error tests start here. - - void unknown_tag_test() - { - try { - string blob; - ddx_parser->intern((string) TEST_SRC_DIR - + "/ddx-testsuite/error.01.ddx", dds, blob); - CPPUNIT_FAIL("error.01.ddx should fail!"); - } - catch (DDXParseFailed &e) { - DBG(cerr << "Error: " << e.get_error_message() << endl) - ; - } - } - - void bad_nesting_test() - { - try { - string blob; - ddx_parser->intern((string) TEST_SRC_DIR - + "/ddx-testsuite/error.02.ddx", dds, blob); - CPPUNIT_FAIL("error.02.ddx should fail!"); - } - catch (DDXParseFailed &e) { - DBG(cerr << "Error: " << e.get_error_message() << endl) - ; - } - } - - void unknown_end_tag_test() - { - try { - string blob; - ddx_parser->intern((string) TEST_SRC_DIR - + "/ddx-testsuite/error.03.ddx", dds, blob); - CPPUNIT_FAIL("error.03.ddx should fail!"); - } - catch (DDXParseFailed &e) { - DBG(cerr << "Error: " << e.get_error_message() << endl) - ; - } - } - - void variable_in_attribtue_container_test() - { - try { - string blob; - ddx_parser->intern((string) TEST_SRC_DIR - + "/ddx-testsuite/error.04.ddx", dds, blob); - CPPUNIT_FAIL("error.04.ddx should fail!"); - } - catch (DDXParseFailed &e) { - DBG(cerr << "Error: " << e.get_error_message() << endl) - ; - } - } - - void array_missing_dimension_test() - { - try { - string blob; - ddx_parser->intern((string) TEST_SRC_DIR - + "/ddx-testsuite/error.05.ddx", dds, blob); - CPPUNIT_FAIL("error.05.ddx should fail!"); - } - catch (DDXParseFailed &e) { - DBG(cerr << "Error: " << e.get_error_message() << endl) - ; - } - } - - void simple_type_missing_attribute_test() - { - try { - string blob; - ddx_parser->intern((string) TEST_SRC_DIR - + "/ddx-testsuite/error.06.ddx", dds, blob); - CPPUNIT_FAIL("error.06.ddx should fail!"); - } - catch (DDXParseFailed &e) { - DBG(cerr << "Error: " << e.get_error_message() << endl) - ; - } - } - - void array_missing_dimension_stream_read_test() - { - try { - string file_name = (string) TEST_SRC_DIR - + "/ddx-testsuite/error.05.ddx"; - FILE *in = fopen(file_name.c_str(), "r"); - string blob; - ddx_parser->intern_stream(in, dds, blob); - CPPUNIT_FAIL("error.05.ddx should fail!"); - } - catch (DDXParseFailed &e) { - DBG(cerr << "Error: " << e.get_error_message() << endl) - ; - } - } - - void intern_ddx_from_dataddx_test() - { - try { - string file_name = (string) TEST_SRC_DIR - + "/ddx-testsuite/dataddx_without_top_headers.dap"; - FILE *in = fopen(file_name.c_str(), "r"); - - // First read the initial set of 'part' headers for the DDX - read_multipart_headers(in, "text/xml", dap4_ddx); - - string blob; - ddx_parser->intern_stream(in, dds, blob, "--boundary-string-1"); - CPPUNIT_ASSERT(dds->get_dataset_name() == "fnoc1.nc"); - - DBG(dds->print_xml(cout, false)); + DDXParserTest() + { } - catch (Error &e) { - CPPUNIT_FAIL(e.get_error_message()); + ~DDXParserTest() + { + } + + void setUp() + { + factory = new BaseTypeFactory; + ddx_parser = new DDXParser(factory); + dds = new DDS(factory); + } + + void tearDown() + { + delete ddx_parser; + ddx_parser = 0; + delete factory; + factory = 0; + delete dds; + dds = 0; + } + +CPPUNIT_TEST_SUITE( DDXParserTest ) + ; + + CPPUNIT_TEST(other_xml_parse_test1); + CPPUNIT_TEST(other_xml_parse_test2); + CPPUNIT_TEST(other_xml_parse_test3); + CPPUNIT_TEST(dap_version_test); + CPPUNIT_TEST(no_blob_version_32_test); + CPPUNIT_TEST(blob_in_version_32_test); + CPPUNIT_TEST(parsing_ddx_from_dataddx_test); + CPPUNIT_TEST(top_level_attribute_test); + CPPUNIT_TEST(top_level_attribute_container_test); + CPPUNIT_TEST(top_level_simple_types_test); + CPPUNIT_TEST(top_level_simple_types_with_attributes_test); + CPPUNIT_TEST(simple_arrays_test); + CPPUNIT_TEST(simple_arrays_multi_dim_test); + CPPUNIT_TEST(simple_arrays_attributes_test); + CPPUNIT_TEST(structure_test); + CPPUNIT_TEST(sequence_test); + CPPUNIT_TEST(grid_test); + CPPUNIT_TEST(intern_stream_test); + CPPUNIT_TEST(intern_ddx_from_dataddx_test); + // FILE I/O tests + CPPUNIT_TEST(top_level_simple_types_test_file_stream); + CPPUNIT_TEST(structure_test_file_ptr); + // C++ Stream I/O tests + CPPUNIT_TEST(top_level_simple_types_test_cpp_stream); + CPPUNIT_TEST(structure_test_cpp_stream); + CPPUNIT_TEST(sequence_test_cpp_stream); + CPPUNIT_TEST(grid_test_cpp_stream); + + // Error tests + CPPUNIT_TEST(unknown_tag_test); + CPPUNIT_TEST(bad_nesting_test); + CPPUNIT_TEST(unknown_end_tag_test); + CPPUNIT_TEST(variable_in_attribtue_container_test); + CPPUNIT_TEST(simple_type_missing_attribute_test); + CPPUNIT_TEST(array_missing_dimension_test); + CPPUNIT_TEST(array_missing_dimension_stream_read_test); + + CPPUNIT_TEST_SUITE_END() + ; + + void other_xml_parse_test1() + { + try { + string cid; + ddx_parser->intern((string) TEST_SRC_DIR + "/ddx-testsuite/test.1.other_xml.ddx", dds, cid); + DBG(dds->print_xml(cout, false, " ")); + CPPUNIT_ASSERT(dds->get_dataset_name() == "200803061600_HFRadar_USEGC_6km_rtv_SIO.nc"); + CPPUNIT_ASSERT(dds->get_dap_major() == 3); + CPPUNIT_ASSERT(dds->get_dap_minor() == 3); + } + catch (DDXParseFailed &e) { + DBG(cerr << endl << "Error: " << e.get_error_message() << endl); + CPPUNIT_FAIL("test.00.ddx failed."); + } + } + + void other_xml_parse_test2() + { + try { + string cid; + ddx_parser->intern((string) TEST_SRC_DIR + "/ddx-testsuite/test.2.other_xml.ddx", dds, cid); + DBG(dds->print_xml(cout, false, " ")); + CPPUNIT_ASSERT(dds->get_dataset_name() == "200803061600_HFRadar_USEGC_6km_rtv_SIO.nc"); + CPPUNIT_ASSERT(dds->get_dap_major() == 3); + CPPUNIT_ASSERT(dds->get_dap_minor() == 3); + } + catch (DDXParseFailed &e) { + DBG(cerr << endl << "Error: " << e.get_error_message() << endl); + CPPUNIT_FAIL("test.00.ddx failed."); + } + } + + void other_xml_parse_test3() + { + try { + string cid; + ddx_parser->intern((string) TEST_SRC_DIR + "/ddx-testsuite/test.3.other_xml.ddx", dds, cid); + DBG(dds->print_xml(cout, false, " ")); + CPPUNIT_ASSERT(dds->get_dataset_name() == "200803061600_HFRadar_USEGC_6km_rtv_SIO.nc"); + CPPUNIT_ASSERT(dds->get_dap_major() == 3); + CPPUNIT_ASSERT(dds->get_dap_minor() == 3); + } + catch (DDXParseFailed &e) { + DBG(cerr << endl << "Error: " << e.get_error_message() << endl); + CPPUNIT_FAIL("test.00.ddx failed."); + } + } + + void dap_version_test() + { + FILE *in; + try { + string blob; + ddx_parser->intern((string) TEST_SRC_DIR + "/ddx-testsuite/test.00.ddx", dds, blob); + CPPUNIT_ASSERT(dds->get_dataset_name() == "SimpleTypes"); + CPPUNIT_ASSERT(dds->get_dap_major() == 3); + CPPUNIT_ASSERT(dds->get_dap_minor() == 2); + + DBG(dds->print_xml(cout, false)); + + string name = string(TEST_SRC_DIR) + "/ddx-testsuite/test.00.ddx"; + in = fopen(name.c_str(), "r"); + + ddx_parser->intern_stream(in, dds, blob); + + CPPUNIT_ASSERT(dds->get_dataset_name() == "SimpleTypes"); + CPPUNIT_ASSERT(dds->get_dap_major() == 3); + CPPUNIT_ASSERT(dds->get_dap_minor() == 2); + + DBG(dds->print_xml(cout, false)); + } + catch (DDXParseFailed &e) { + DBG(cerr << endl << "Error: " << e.get_error_message() << endl); + CPPUNIT_FAIL("test.00.ddx failed."); + } + + fclose(in); + } + + void no_blob_version_32_test() + { + try { + string blob; + ddx_parser->intern((string) TEST_SRC_DIR + "/ddx-testsuite/test.0c.ddx", dds, blob); + CPPUNIT_ASSERT(dds->get_dataset_name() == "SimpleTypes"); + CPPUNIT_ASSERT(dds->get_dap_major() == 3); + CPPUNIT_ASSERT(dds->get_dap_minor() == 2); + + DBG(dds->print_xml(cout, false)); + } + catch (DDXParseFailed &e) { + DBG(cerr << endl << "Error: " << e.get_error_message() << endl); + CPPUNIT_FAIL("test.0c.ddx failed."); + } + } + + void blob_in_version_32_test() + { + try { + string blob; + ddx_parser->intern((string) TEST_SRC_DIR + "/ddx-testsuite/test.0d.ddx", dds, blob); + CPPUNIT_FAIL("Parsing test.0d.ddx should fail since it's a DAP 3.2 doc with a dataBLOB tag."); + + DBG(dds->print_xml(cout, false)); + } + catch (DDXParseFailed &e) { + DBG(cerr << endl << "Error: " << e.get_error_message() << endl); + CPPUNIT_ASSERT("test.0d.ddx failed as expected."); + } + } + + void parsing_ddx_from_dataddx_test() + { + try { + string blob; + ddx_parser->intern((string) TEST_SRC_DIR + "/ddx-testsuite/DDX_from_dataddx.xml", dds, blob); + CPPUNIT_ASSERT(true); + DBG(dds->print_xml(cout, false)); + } + catch (DDXParseFailed &e) { + CPPUNIT_FAIL(e.get_error_message()); + } + + } + + void top_level_attribute_test() + { + try { + string blob; + ddx_parser->intern((string) TEST_SRC_DIR + "/ddx-testsuite/test.01.ddx", dds, blob); + CPPUNIT_ASSERT(dds->get_dataset_name() == "SimpleTypes"); + + DBG(dds->print_xml(cout, false)); + } + catch (DDXParseFailed &e) { + DBG(cerr << endl << "Error: " << e.get_error_message() << endl); + CPPUNIT_FAIL("test.01.ddx failed."); + } + } + + void top_level_attribute_container_test() + { + try { + string blob; + ddx_parser->intern((string) TEST_SRC_DIR + "/ddx-testsuite/test.02.ddx", dds, blob); + CPPUNIT_ASSERT(dds->get_dataset_name() == "SimpleTypes"); + DBG(dds->print_xml(cout, false)); + } + catch (DDXParseFailed &e) { + DBG(cerr << endl << "Error: " << e.get_error_message() << endl); + CPPUNIT_FAIL("test.02.ddx failed."); + } + } + + // ALiases are broken *** 05/29/03 jhrg + void top_level_attribute_alias_test() + { + try { + string blob; + ddx_parser->intern((string) TEST_SRC_DIR + "/ddx-testsuite/test.03.ddx", dds, blob); + CPPUNIT_ASSERT(dds->get_dataset_name() == "SimpleTypes"); + DBG(dds->print_xml(cout, false)); + } + catch (DDXParseFailed &e) { + DBG(cerr << endl << "Error: " << e.get_error_message() << endl); + CPPUNIT_FAIL("test.03.ddx failed."); + } + } + + void top_level_simple_types_test() + { + try { + string blob; + ddx_parser->intern((string) TEST_SRC_DIR + "/ddx-testsuite/test.04.ddx", dds, blob); + CPPUNIT_ASSERT(dds->get_dataset_name() == "SimpleTypes"); + DBG(dds->print_xml(cout, false)); + } + catch (DDXParseFailed &e) { + DBG(cerr << endl << "DDXParseFailed: " << e.get_error_message() << endl); + CPPUNIT_FAIL("test.04.ddx failed."); + } + catch (Error &e) { + DBG(cerr << endl << "Error: " << e.get_error_message() << endl); + CPPUNIT_FAIL("test.04.ddx failed."); + } + } + + void top_level_simple_types_test_file_stream() + { + FILE *in; + try { + string blob; + in = fopen(((string) TEST_SRC_DIR + "/ddx-testsuite/test.04.ddx").c_str(), "r"); + ddx_parser->intern_stream(in, dds, blob); + fclose(in); + CPPUNIT_ASSERT(dds->get_dataset_name() == "SimpleTypes"); + DBG(dds->print_xml(cout, false)); + } + catch (DDXParseFailed &e) { + fclose(in); + DBG(cerr << endl << "DDXParseFailed: " << e.get_error_message() << endl); + CPPUNIT_FAIL("test.04.ddx failed."); + } + catch (Error &e) { + fclose(in); + DBG(cerr << endl << "Error: " << e.get_error_message() << endl); + CPPUNIT_FAIL("test.04.ddx failed."); + } + } + + void top_level_simple_types_test_cpp_stream() + { + try { + string blob; + ifstream in(((string) TEST_SRC_DIR + "/ddx-testsuite/test.04.ddx").c_str()); + ddx_parser->intern_stream(in, dds, blob); + CPPUNIT_ASSERT(dds->get_dataset_name() == "SimpleTypes"); + DBG(dds->print_xml(cout, false)); + } + catch (DDXParseFailed &e) { + DBG(cerr << endl << "DDXParseFailed: " << e.get_error_message() << endl); + CPPUNIT_FAIL("test.04.ddx failed."); + } + catch (Error &e) { + DBG(cerr << endl << "Error: " << e.get_error_message() << endl); + CPPUNIT_FAIL("test.04.ddx failed."); + } + } + + void top_level_simple_types_with_attributes_test() + { + try { + string blob; + ddx_parser->intern((string) TEST_SRC_DIR + "/ddx-testsuite/test.05.ddx", dds, blob); + CPPUNIT_ASSERT(dds->get_dataset_name() == "SimpleTypes"); + DBG(dds->print_xml(cout, false)); + } + catch (DDXParseFailed &e) { + DBG(cerr << endl << "Error: " << e.get_error_message() << endl); + CPPUNIT_FAIL("test.05.ddx failed."); + } + } + + void simple_arrays_test() + { + try { + string blob; + ddx_parser->intern((string) TEST_SRC_DIR + "/ddx-testsuite/test.06.ddx", dds, blob); + CPPUNIT_ASSERT(dds->get_dataset_name() == "OneDimensionalSimpleArrays"); + DBG(dds->print_xml(cout, false)); + } + catch (DDXParseFailed &e) { + DBG(cerr << endl << "Error: " << e.get_error_message() << endl); + CPPUNIT_FAIL("test.06.ddx failed."); + } + } + + void simple_arrays_multi_dim_test() + { + try { + string blob; + ddx_parser->intern((string) TEST_SRC_DIR + "/ddx-testsuite/test.07.ddx", dds, blob); + CPPUNIT_ASSERT(dds->get_dataset_name() == "MultiDimensionalSimpleArrays"); + DBG(dds->print_xml(cout, false)); + } + catch (DDXParseFailed &e) { + DBG(cerr << endl << "Error: " << e.get_error_message() << endl); + CPPUNIT_FAIL("test.07.ddx failed."); + } + } + + void simple_arrays_attributes_test() + { + try { + string blob; + ddx_parser->intern((string) TEST_SRC_DIR + "/ddx-testsuite/test.08.ddx", dds, blob); + CPPUNIT_ASSERT(dds->get_dataset_name() == "testdata"); + DBG(dds->print_xml(cout, false)); + } + catch (DDXParseFailed &e) { + DBG(cerr << endl << "Error: " << e.get_error_message() << endl); + CPPUNIT_FAIL("test.08.ddx failed."); + } + } + + void structure_test() + { + try { + string blob; + ddx_parser->intern((string) TEST_SRC_DIR + "/ddx-testsuite/test.09.ddx", dds, blob); + CPPUNIT_ASSERT(dds->get_dataset_name() == "testdata"); + DBG(dds->print_xml(cout, false)); + } + catch (DDXParseFailed &e) { + DBG(cerr << endl << "Error: " << e.get_error_message() << endl); + CPPUNIT_FAIL("test.09.ddx failed."); + } + } + + void structure_test_file_ptr() + { + FILE *in; + try { + string blob; + in = fopen((string(TEST_SRC_DIR) + "/ddx-testsuite/test.09.ddx").c_str(), "r"); + ddx_parser->intern_stream(in, dds, blob); + fclose(in); + CPPUNIT_ASSERT(dds->get_dataset_name() == "testdata"); + DBG(dds->print_xml(cout, false)); + } + catch (DDXParseFailed &e) { + fclose(in); + DBG(cerr << endl << "Error: " << e.get_error_message() << endl); + CPPUNIT_FAIL("test.09.ddx failed."); + } + } + + void structure_test_cpp_stream() + { + try { + string blob; + ifstream input((string(TEST_SRC_DIR) + "/ddx-testsuite/test.09.ddx").c_str()); + ddx_parser->intern_stream(input, dds, blob); + CPPUNIT_ASSERT(dds->get_dataset_name() == "testdata"); + DBG(dds->print_xml(cout, false)); + } + catch (DDXParseFailed &e) { + DBG(cerr << endl << "Error: " << e.get_error_message() << endl); + CPPUNIT_FAIL("test.09.ddx failed."); + } + } + + void sequence_test() + { + try { + string blob; + ddx_parser->intern((string) TEST_SRC_DIR + "/ddx-testsuite/test.0a.ddx", dds, blob); + CPPUNIT_ASSERT(dds->get_dataset_name() == "testdata"); + DBG(dds->print_xml(cout, false)); + } + catch (DDXParseFailed &e) { + DBG(cerr << endl << "Error: " << e.get_error_message() << endl); + CPPUNIT_FAIL("test.0a.ddx failed."); + } + } + + void sequence_test_cpp_stream() + { + try { + string blob; + ifstream input((string(TEST_SRC_DIR) + "/ddx-testsuite/test.0a.ddx").c_str()); + ddx_parser->intern_stream(input, dds, blob); + CPPUNIT_ASSERT(dds->get_dataset_name() == "testdata"); + DBG(dds->print_xml(cout, false)); + } + catch (DDXParseFailed &e) { + DBG(cerr << endl << "Error: " << e.get_error_message() << endl); + CPPUNIT_FAIL("test.0a.ddx failed."); + } + } + + void grid_test() + { + try { + string blob; + ddx_parser->intern((string) TEST_SRC_DIR + "/ddx-testsuite/test.0b.ddx", dds, blob); + CPPUNIT_ASSERT(dds->get_dataset_name() == "testdata"); + DBG(dds->print_xml(cout, false)); + } + catch (DDXParseFailed &e) { + DBG(cerr << endl << "Error: " << e.get_error_message() << endl); + CPPUNIT_FAIL("test.0b.ddx failed."); + } + } + + void grid_test_cpp_stream() + { + try { + string blob; + ifstream input((string(TEST_SRC_DIR) + "/ddx-testsuite/test.0b.ddx").c_str()); + ddx_parser->intern_stream(input, dds, blob); + CPPUNIT_ASSERT(dds->get_dataset_name() == "testdata"); + DBG(dds->print_xml(cout, false)); + } + catch (DDXParseFailed &e) { + DBG(cerr << endl << "Error: " << e.get_error_message() << endl); + CPPUNIT_FAIL("test.0b.ddx failed."); + } + } + + void intern_stream_test() + { + try { + string file_name = (string) TEST_SRC_DIR + "/ddx-testsuite/test.0b.ddx"; + FILE *in = fopen(file_name.c_str(), "r"); + string blob; + ddx_parser->intern_stream(in, dds, blob); + CPPUNIT_ASSERT(dds->get_dataset_name() == "testdata"); + DBG(dds->print_xml(cout, false)); + } + catch (DDXParseFailed &e) { + DBG(cerr << endl << "Error: " << e.get_error_message() << endl); + CPPUNIT_FAIL("test.0b.ddx failed."); + } + } + + // Error tests start here. + + void unknown_tag_test() + { + try { + string blob; + ddx_parser->intern((string) TEST_SRC_DIR + "/ddx-testsuite/error.01.ddx", dds, blob); + CPPUNIT_FAIL("error.01.ddx should fail!"); + } + catch (DDXParseFailed &e) { + DBG(cerr << "Error: " << e.get_error_message() << endl); + } + } + + void bad_nesting_test() + { + try { + string blob; + ddx_parser->intern((string) TEST_SRC_DIR + "/ddx-testsuite/error.02.ddx", dds, blob); + CPPUNIT_FAIL("error.02.ddx should fail!"); + } + catch (DDXParseFailed &e) { + DBG(cerr << "Error: " << e.get_error_message() << endl); + } + } + + void unknown_end_tag_test() + { + try { + string blob; + ddx_parser->intern((string) TEST_SRC_DIR + "/ddx-testsuite/error.03.ddx", dds, blob); + CPPUNIT_FAIL("error.03.ddx should fail!"); + } + catch (DDXParseFailed &e) { + DBG(cerr << "Error: " << e.get_error_message() << endl); + } + } + + void variable_in_attribtue_container_test() + { + try { + string blob; + ddx_parser->intern((string) TEST_SRC_DIR + "/ddx-testsuite/error.04.ddx", dds, blob); + CPPUNIT_FAIL("error.04.ddx should fail!"); + } + catch (DDXParseFailed &e) { + DBG(cerr << "Error: " << e.get_error_message() << endl); + } + } + + void array_missing_dimension_test() + { + try { + string blob; + ddx_parser->intern((string) TEST_SRC_DIR + "/ddx-testsuite/error.05.ddx", dds, blob); + CPPUNIT_FAIL("error.05.ddx should fail!"); + } + catch (DDXParseFailed &e) { + DBG(cerr << "Error: " << e.get_error_message() << endl); + } + } + + void simple_type_missing_attribute_test() + { + try { + string blob; + ddx_parser->intern((string) TEST_SRC_DIR + "/ddx-testsuite/error.06.ddx", dds, blob); + CPPUNIT_FAIL("error.06.ddx should fail!"); + } + catch (DDXParseFailed &e) { + DBG(cerr << "Error: " << e.get_error_message() << endl); + } + } + + void array_missing_dimension_stream_read_test() + { + try { + string file_name = (string) TEST_SRC_DIR + "/ddx-testsuite/error.05.ddx"; + FILE *in = fopen(file_name.c_str(), "r"); + string blob; + ddx_parser->intern_stream(in, dds, blob); + CPPUNIT_FAIL("error.05.ddx should fail!"); + } + catch (DDXParseFailed &e) { + DBG(cerr << "Error: " << e.get_error_message() << endl); + } + } + + void intern_ddx_from_dataddx_test() + { + try { + string file_name = (string) TEST_SRC_DIR + "/ddx-testsuite/dataddx_without_top_headers.dap"; + FILE *in = fopen(file_name.c_str(), "r"); + + // First read the initial set of 'part' headers for the DDX + read_multipart_headers(in, "text/xml", dap4_ddx); + + string blob; + ddx_parser->intern_stream(in, dds, blob, "--boundary-string-1"); + CPPUNIT_ASSERT(dds->get_dataset_name() == "fnoc1.nc"); + + DBG(dds->print_xml(cout, false)); + } + catch (Error &e) { + CPPUNIT_FAIL(e.get_error_message()); + } } - } }; } -CPPUNIT_TEST_SUITE_REGISTRATION( DDXParserTest ); +CPPUNIT_TEST_SUITE_REGISTRATION( DDXParserTest); -int -main( int, char** ) +int main(int argc, char*argv[]) { - CppUnit::TextTestRunner runner; - runner.addTest( CppUnit::TestFactoryRegistry::getRegistry().makeTest() ); + CppUnit::TextTestRunner runner; + runner.addTest(CppUnit::TestFactoryRegistry::getRegistry().makeTest()); - bool wasSuccessful = runner.run( "", false ) ; + GetOpt getopt(argc, argv, "d"); + char option_char; + while ((option_char = getopt()) != EOF) + switch (option_char) { + case 'd': + debug = 1; // debug is a static global + break; + default: + break; + } + + bool wasSuccessful = true; + string test = ""; + int i = getopt.optind; + if (i == argc) { + // run them all + wasSuccessful = runner.run(""); + } + else { + while (i < argc) { + test = string("libdap::DDXParserTest::") + argv[i++]; + + wasSuccessful = wasSuccessful && runner.run(test); + } + } - return (wasSuccessful) ? 0 : 1; + return wasSuccessful ? 0 : 1; } diff -Nru libdap-3.11.1/unit-tests/DODSFilterTest.cc libdap-3.12.0/unit-tests/DODSFilterTest.cc --- libdap-3.11.1/unit-tests/DODSFilterTest.cc 2011-04-29 13:19:42.000000000 +0000 +++ libdap-3.12.0/unit-tests/DODSFilterTest.cc 1970-01-01 00:00:00.000000000 +0000 @@ -1,571 +0,0 @@ - -// -*- mode: c++; c-basic-offset:4 -*- - -// This file is part of libdap, A C++ implementation of the OPeNDAP Data -// Access Protocol. - -// Copyright (c) 2002,2003 OPeNDAP, Inc. -// Author: James Gallagher -// -// This library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Lesser General Public -// License as published by the Free Software Foundation; either -// version 2.1 of the License, or (at your option) any later version. -// -// This library 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 -// Lesser General Public License for more details. -// -// You should have received a copy of the GNU Lesser General Public -// License along with this library; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -// -// You can contact OPeNDAP, Inc. at PO Box 112, Saunderstown, RI. 02874-0112. - -#include -#include -#include - -#include -#include -#include // for stat - -#include -#include - -//#define DODS_DEBUG - -#include "DODSFilter.h" -#include "DAS.h" -#include "DDS.h" -#include "GNURegex.h" -#include "debug.h" - -#include "../tests/TestTypeFactory.h" -#include "../tests/TestByte.h" - -#include - - -using namespace CppUnit; -using namespace std; -using namespace libdap; - -int test_variable_sleep_interval = 0; - -namespace libdap { - -class DODSFilterTest : public TestFixture { -private: - DODSFilter *df, *df_conditional, *df1, *df2, *df3, *df4, *df5, *df6; - - AttrTable *cont_a; - DAS *das; - DDS *dds; - ostringstream oss; - time_t now; - char now_array[256]; - -public: - DODSFilterTest() { - now = time(0); - ostringstream time_string; - time_string << (int)now; - strncpy(now_array, time_string.str().c_str(), 255); - now_array[255] = '\0'; - } - - ~DODSFilterTest() {} - - void setUp() { - // Test pathname - string test_file = (string)TEST_SRC_DIR + "/server-testsuite/bears.data" ; - char *argv_1[] = {(char*)"test_case", (char *)test_file.c_str()}; - df = new DODSFilter(2, argv_1); - - char *argv_1_1[] = {(char*)"test_case", (char *)test_file.c_str(), (char*)"-l", &now_array[0]}; - df_conditional = new DODSFilter(4, argv_1_1); - - // Test missing file - argv_1[1] = (char*)"no-such-file"; - df1 = new DODSFilter(2, argv_1); - - // Test files in CWD. Note that the time is the GM time : Tue, 01 May - // 2001 01:08:14 -0700 - argv_1[1] = (char*)"test_config.h"; - df2 = new DODSFilter(2, argv_1); - - // This file has an ancillary DAS in the server-testsuite dir. - // df3 is also used to test escaping stuff in URLs. 5/4/2001 jhrg - char *argv_2[8]; - argv_2[0] = (char*)"test_case"; - test_file = (string)TEST_SRC_DIR + "/server-testsuite/coads.data"; - argv_2[1] = (char *)test_file.c_str(); - argv_2[2] = (char*)"-l"; - argv_2[3] = &now_array[0]; - argv_2[4] = (char*)"-e"; - argv_2[5] = (char*)"u,x,z[0]&grid(u,\"lat<10.0\")"; - argv_2[6] = (char*)"-t"; - argv_2[7] = (char*)"1"; - df3 = new DODSFilter(6, argv_2); - - // Go back to this data source to test w/o an ancillary DAS. - argv_2[0] = (char*)"test_case"; - test_file = (string)TEST_SRC_DIR + "/server-testsuite/bears.data"; - argv_2[1] = (char *)test_file.c_str(); - argv_2[2] = (char*)"-l"; - argv_2[3] = &now_array[0]; - argv_2[4] = (char*)"-e"; - argv_2[5] = (char*)"u,x,z[0]&grid(u,\"lat<10.0\")"; - argv_2[6] = (char*)"-t"; - argv_2[7] = (char*)"1"; - df4 = new DODSFilter(6, argv_2); - - // Test escaping stuff. 5/4/2001 jhrg - char *argv_3[]={(char*)"test_case", (char*)"nowhere%5Bmydisk%5Dmyfile", (char*)"-e", (char*)"u%5B0%5D"}; - df5 = new DODSFilter(4, argv_3); - - char *argv_4[]={(char*)"test_case", (char*)"nowhere%3a%5bmydisk%5dmyfile", (char*)"-e", (char*)"Grid%20field%3au%5b0%5d,Grid%20field%3av"}; - df6 = new DODSFilter(4, argv_4); - - cont_a = new AttrTable; - cont_a->append_attr("size", "Int32", "7"); - cont_a->append_attr("type", "String", "cars"); - das = new DAS; - das->add_table( "a", cont_a ) ; - - // This AttrTable looks like: - // Attributes { - // a { - // Int32 size 7; - // String type cars; - // } - // } - - TestTypeFactory ttf; - dds = new DDS(&ttf, "test"); - TestByte a("a"); - dds->add_var(&a); - - dds->transfer_attributes(das); - dds->set_dap_major(3); - dds->set_dap_minor(2); - } - - void tearDown() { - delete df; df = 0; - delete df_conditional; df_conditional = 0; - delete df1; df1 = 0; - delete df2; df2 = 0; - delete df3; df3 = 0; - delete df4; df4 = 0; - delete df5; df5 = 0; - delete df6; df6 = 0; - - delete das; das = 0; - } - - bool re_match(Regex &r, const string &s) { - DBG(cerr << "s.length(): " << s.length() << endl); - int pos = r.match(s.c_str(), s.length()); - DBG(cerr << "r.match(s): " << pos << endl); - return pos > 0 && static_cast(pos) == s.length(); - } - - bool re_match_binary(Regex &r, const string &s) { - DBG(cerr << "s.length(): " << s.length() << endl); - int pos = r.match(s.c_str(), s.length()); - DBG(cerr << "r.match(s): " << pos << endl); - return pos > 0; - } - -#if 0 - void add_keyword_test() { - DODSFilter tdf; - tdf.add_keyword("test"); - CPPUNIT_ASSERT(tdf.d_keywords.find("test") != tdf.d_keywords.end()); - CPPUNIT_ASSERT(tdf.d_keywords.find("test") == tdf.d_keywords.begin()); - CPPUNIT_ASSERT(*(tdf.d_keywords.find("test")) == string("test")); - tdf.add_keyword("dap3.3"); - CPPUNIT_ASSERT(tdf.d_keywords.size() == 2); - } - - void is_keyword_test() { - DODSFilter tdf; - tdf.add_keyword("test"); - tdf.add_keyword("dap3.3"); - CPPUNIT_ASSERT(tdf.is_keyword("test")); - CPPUNIT_ASSERT(!tdf.is_keyword("TEST")); - } - - void get_keywords() { - DODSFilter tdf; - tdf.add_keyword("test"); - tdf.add_keyword("dap2.0"); - tdf.add_keyword("dap4.0"); - CPPUNIT_ASSERT(tdf.d_keywords.size() == 3); - - ostringstream oss; - list kwds = tdf.get_keywords(); - list::iterator i = kwds.begin(); - while (i != kwds.end()) - oss << *i++; - //cerr << oss.str() << endl; - - CPPUNIT_ASSERT(oss.str().find("test") != string::npos); - CPPUNIT_ASSERT(oss.str().find("dap2.0") != string::npos); - CPPUNIT_ASSERT(oss.str().find("dap4.0") != string::npos); - } -#endif - - void get_dataset_last_modified_time_test() { - time_t t = time(0); - CPPUNIT_ASSERT(df1->get_dataset_last_modified_time() == t); - - struct stat st; - string test_file = (string)TEST_SRC_DIR - + "/server-testsuite/bears.data"; - stat(test_file.c_str(), &st); - CPPUNIT_ASSERT(df->get_dataset_last_modified_time() == st.st_mtime); - - stat("test_config.h", &st); - CPPUNIT_ASSERT(df2->get_dataset_last_modified_time() == st.st_mtime); - - test_file = (string)TEST_SRC_DIR + "/server-testsuite/coads.data"; - stat(test_file.c_str(), &st); - CPPUNIT_ASSERT(df3->get_dataset_last_modified_time() == st.st_mtime); - } - - void get_das_last_modified_time_test() { - // the dataset pointed to by df has no anc. DAS - struct stat st; - string test_file = (string)TEST_SRC_DIR - + "/server-testsuite/bears.data"; - stat(test_file.c_str(), &st); - CPPUNIT_ASSERT(df->get_das_last_modified_time() == st.st_mtime); - - // the dataset pointed by df3 has an anc. DAS - test_file = (string)TEST_SRC_DIR + "/server-testsuite/coads.data.das"; - stat(test_file.c_str(), &st); - CPPUNIT_ASSERT(df3->get_das_last_modified_time() == st.st_mtime); - } - - void send_das_test() { - Regex r1("HTTP/1.0 200 OK\r\n\ -XDODS-Server: .*\ -XOPeNDAP-Server: .*\ -XDAP: .*\ -Date: .*\ -Last-Modified: .*\ -Content-Type: text/plain\r\n\ -Content-Description: dods_das\r\n\ -\r\n\ -Attributes \\{\n\ - a \\{\n\ - Int32 size 7;\n\ - String type \"cars\";\n\ - \\}\n\ -\\}\n"); - - df->send_das(oss, *das); - - DBG(cerr << "DAS: " << oss.str() << endl); - - CPPUNIT_ASSERT(re_match(r1, oss.str())); - oss.str(""); - - Regex r2("HTTP/1.0 304 NOT MODIFIED\r\n\ -Date: .*\r\n\ -\r\n"); - - df_conditional->send_das(oss, *das); - CPPUNIT_ASSERT(re_match(r2, oss.str())); - } - - void send_dds_test() { - Regex r1("HTTP/1.0 200 OK\r\n\ -XDODS-Server: .*\ -XOPeNDAP-Server: .*\ -XDAP: .*\ -Date: .*\ -Last-Modified: .*\ -Content-Type: text/plain\r\n\ -Content-Description: dods_dds\r\n\ -\r\n\ -Dataset \\{\n\ - Byte a;\n\ -\\} test;\n"); - - ConstraintEvaluator ce; - - df->send_dds(oss, *dds, ce); - - DBG(cerr << "DDS: " << oss.str() << endl); - - CPPUNIT_ASSERT(re_match(r1, oss.str())); - oss.str(""); - - Regex r2("HTTP/1.0 304 NOT MODIFIED\r\n\ -Date: .*\r\n\ -\r\n"); - - df_conditional->send_dds(oss, *dds, ce); - CPPUNIT_ASSERT(re_match(r2, oss.str())); - } - - void send_ddx_test() { - Regex r1("HTTP/1.0 200 OK\r\n\ -XDODS-Server: .*\ -XOPeNDAP-Server: .*\ -XDAP: .*\ -Date: .*\ -Last-Modified: .*\ -Content-Type: text/xml\r\n\ -Content-Description: dap4-ddx\r\n\ -\r\n\ -<\\?xml version=\"1.0\" encoding=\"UTF-8\"\\?>.*\ -.*\ -.*\ -.*\ - .*\ - 7.*\ - .*\ - .*\ - cars.*\ - .*\ -.*\ -.*\ -.*"); - - ConstraintEvaluator ce; - - try { - df->send_ddx(*dds, ce, oss); - - DBG(cerr << "DDX: " << oss.str() << endl); - - CPPUNIT_ASSERT(re_match(r1, oss.str())); - oss.str(""); - - Regex r2("HTTP/1.0 304 NOT MODIFIED\r\n\ -Date: .*\r\n\ -\r\n"); - - df_conditional->send_ddx(*dds, ce, oss); - CPPUNIT_ASSERT(re_match(r2, oss.str())); - } - catch(Error &e) { - cerr << "Error (line 306): " << e.get_error_message() << endl; - } - } - - void send_data_ddx_test() { - Regex r1("HTTP/1.0 200 OK\r\n\ -.*\ -XDAP:.*\r\n\ -.*\ -Content-Type: Multipart/Related; boundary=boundary; start=\"\"; type=\"Text/xml\"\r\n\ -Content-Description: dap4-data-ddx\r\n\ -\r\n\ ---boundary\r\n\ -Content-Type: Text/xml; charset=iso-8859-1\r\n\ -Content-Id: \r\n\ -Content-Description: dap4-ddx\r\n\ -\r\n\ -<\\?xml version=\"1.0\" encoding=\"UTF-8\"\\?>.*\ -.*\ -.*\ - .*\ - .*\ - 7.*\ - .*\ - .*\ - cars.*\ - .*\ - .*\ -.*\ - .*\ -.*\ ---boundary\r\n\ -Content-Type: application/octet-stream\r\n\ -Content-Id: <.*@.*>\r\n\ -Content-Description: dap4-data\r\n\ -Content-Encoding: binary\r\n\ -\r\n\ -.*"); - - // I do not look for the closing '--boundary' because the binary - // data breaks the regex functions in the c library WRT subsequent - // pattern matches. jhrg - //--boundary--\r\n"); - - ConstraintEvaluator ce; - - try { - df->send_data_ddx(*dds, ce, oss, "start@opendap.org", "boundary", - "", true); - - DBG(cerr << "DataDDX: " << oss.str() << endl); - - CPPUNIT_ASSERT(re_match_binary(r1, oss.str())); - oss.str(""); - - Regex r2("HTTP/1.0 304 NOT MODIFIED\r\n\ -Date: .*\r\n\ -\r\n"); - - df_conditional->send_data_ddx(*dds, ce, oss, "start@opendap.org", - "boundary", "", true); - CPPUNIT_ASSERT(re_match(r2, oss.str())); - } - catch(Error &e) { - cerr << "Error (line 306): " << e.get_error_message() << endl; - } - } - - void send_data_ddx_test2() { - Regex r1("--boundary\r\n\ -Content-Type: Text/xml; charset=iso-8859-1\r\n\ -Content-Id: \r\n\ -Content-Description: dap4-ddx\r\n\ -\r\n\ -<\\?xml version=\"1.0\" encoding=\"UTF-8\"\\?>.*\ -.*\ -.*\ - .*\ - .*\ - 7.*\ - .*\ - .*\ - cars.*\ - .*\ - .*\ -.*\ - .*\ -.*\ ---boundary\r\n\ -Content-Type: application/octet-stream\r\n\ -Content-Id: <.*@.*>\r\n\ -Content-Description: dap4-data\r\n\ -Content-Encoding: binary\r\n\ -\r\n\ -.*"); - - ConstraintEvaluator ce; - - try { - df->send_data_ddx(*dds, ce, oss, "start@opendap.org", "boundary", - "", false); - DBG(cerr << "DataDDX: " << oss.str() << endl); - CPPUNIT_ASSERT(re_match_binary(r1, oss.str())); - - // Unlike the test where the full headers are generated, there's - // no check for a conditional response here because that feature - // of DODSFilter is only supported when MIME headers are built by - // the class. In order to return a '304' response, headers must be - // built. - } - catch(Error &e) { - cerr << "Error (line 306): " << e.get_error_message() << endl; - } - } - - void is_conditional_test() { - CPPUNIT_ASSERT(df->is_conditional() == false); - CPPUNIT_ASSERT(df3->is_conditional() == true); - } - - void get_request_if_modified_since_test() { - CPPUNIT_ASSERT(df->get_request_if_modified_since() == -1); - CPPUNIT_ASSERT(df3->get_request_if_modified_since() == now); - } - - void escape_code_test() { - // These should NOT be escaped. - - DBG(cerr << df3->get_dataset_name() << endl); - DBG(cerr << df3->get_ce() << endl); - - CPPUNIT_ASSERT(df3->get_dataset_name() == (string)TEST_SRC_DIR + "/server-testsuite/coads.data"); - CPPUNIT_ASSERT(df3->get_ce() == "u,x,z[0]&grid(u,\"lat<10.0\")"); - - // The DODSFIlter instance is feed escaped values; they should be - // unescaped by the ctor and the mutators. 5/4/2001 jhrg - - DBG(cerr << df5->get_dataset_name() << endl); - DBG(cerr << df5->get_ce() << endl); - - CPPUNIT_ASSERT(df5->get_dataset_name() == "nowhere[mydisk]myfile"); - CPPUNIT_ASSERT(df5->get_ce() == "u[0]"); - - df5->set_ce("u%5B0%5D"); - CPPUNIT_ASSERT(df5->get_ce() == "u[0]"); - - DBG(cerr << df6->get_dataset_name() << endl); - DBG(cerr << df6->get_ce() << endl); -#if 0 - CPPUNIT_ASSERT(df6->get_dataset_name() == "nowhere:[mydisk]myfile"); - CPPUNIT_ASSERT(df6->get_ce() == "Grid%20field:u[0],Grid%20field:v"); -#endif - df5->set_ce("Grid%20u%5B0%5D"); - CPPUNIT_ASSERT(df5->get_ce() == "Grid%20u[0]"); - } - - // This tests reading the timeout value from argv[]. - void timeout_test() { - CPPUNIT_ASSERT(df3->get_timeout() == 1); - CPPUNIT_ASSERT(df1->get_timeout() == 0); - } - - CPPUNIT_TEST_SUITE( DODSFilterTest ); -#if 0 - CPPUNIT_TEST(add_keyword_test); - CPPUNIT_TEST(is_keyword_test); - CPPUNIT_TEST(get_keywords); -#endif - - CPPUNIT_TEST(get_dataset_last_modified_time_test); - CPPUNIT_TEST(get_das_last_modified_time_test); - - CPPUNIT_TEST(send_das_test); - CPPUNIT_TEST(send_dds_test); - - CPPUNIT_TEST(send_ddx_test); - CPPUNIT_TEST(send_data_ddx_test); - CPPUNIT_TEST(send_data_ddx_test2); - - CPPUNIT_TEST(is_conditional_test); - CPPUNIT_TEST(get_request_if_modified_since_test); - CPPUNIT_TEST(escape_code_test); - - CPPUNIT_TEST_SUITE_END(); -}; - -CPPUNIT_TEST_SUITE_REGISTRATION(DODSFilterTest); -} - -int -main( int, char** ) -{ - CppUnit::TextTestRunner runner; - runner.addTest( CppUnit::TestFactoryRegistry::getRegistry().makeTest() ); - - bool wasSuccessful = runner.run( "", false ) ; - - return wasSuccessful ? 0 : 1; -} - - - diff -Nru libdap-3.11.1/unit-tests/GridGeoConstraintTest.cc libdap-3.12.0/unit-tests/GridGeoConstraintTest.cc --- libdap-3.11.1/unit-tests/GridGeoConstraintTest.cc 2011-04-29 13:19:42.000000000 +0000 +++ libdap-3.12.0/unit-tests/GridGeoConstraintTest.cc 1970-01-01 00:00:00.000000000 +0000 @@ -1,1312 +0,0 @@ - -// -*- mode: c++; c-basic-offset:4 -*- - -// This file is part of libdap, A C++ implementation of the OPeNDAP Data -// Access Protocol. - -// Copyright (c) 2006 OPeNDAP, Inc. -// Author: James Gallagher -// -// This library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Lesser General Public -// License as published by the Free Software Foundation; either -// version 2.1 of the License, or (at your option) any later version. -// -// This library 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 -// Lesser General Public License for more details. -// -// You should have received a copy of the GNU Lesser General Public -// License along with this library; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -// -// You can contact OPeNDAP, Inc. at PO Box 112, Saunderstown, RI. 02874-0112. - -// Tests for the AISResources class. - -#include -#include -#include - -// #define DODS_DEBUG - -#include "BaseType.h" -#include "Int32.h" -#include "Float64.h" -#include "Str.h" -#include "Array.h" -#include "Grid.h" -#include "DDS.h" -#include "DAS.h" -#include "GridGeoConstraint.h" -#include "ce_functions.h" - -#include "../tests/TestTypeFactory.h" - -#include "debug.h" -#include - -using namespace CppUnit; -using namespace libdap; -using namespace std; - -int test_variable_sleep_interval = 0; - -namespace libdap -{ - -class GridGeoConstraintTest:public TestFixture -{ -private: - TestTypeFactory btf; - ConstraintEvaluator ce; - - DDS *geo_dds; - DDS *geo_dds_3d; - DDS *geo_dds_coads_lon; - -public: - GridGeoConstraintTest() - {} - ~GridGeoConstraintTest() - {} - - void setUp() - { - // geo grid test data - try { - geo_dds = new DDS(&btf); - geo_dds->parse((string)TEST_SRC_DIR + "/ce-functions-testsuite/geo_grid.dds"); - DAS das; - das.parse((string)TEST_SRC_DIR + "/ce-functions-testsuite/geo_grid.das"); - geo_dds->transfer_attributes(&das); - - DBG2(geo_dds->print_xml(stderr, false, "No blob")); - - // Load values into the grid variables - Grid & sst1 = dynamic_cast < Grid & >(*geo_dds->var("SST1")); - - Array & lon1 = dynamic_cast < Array & >(**sst1.map_begin()); - dods_float64 tmp_lon1[10] = - { 0, 40, 80, 120, 160, 200, 240, 280, 320, 359 }; - lon1.val2buf(tmp_lon1); - lon1.set_read_p(true); - - Array & lat1 = dynamic_cast < Array & >(**(sst1.map_begin() + 1)); - dods_float64 tmp_lat1[10] = - { 40, 30, 20, 10, 0, -10, -20, -30, -40, -50 }; - lat1.val2buf(tmp_lat1); - lat1.set_read_p(true); - - dods_byte tmp_data[10][10] = - { { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9}, - { 10,11,12,13,14,15,16,17,18,19}, - { 20,21,22,23,24,25,26,27,28,29}, - { 30,31,32,33,34,35,36,37,38,39}, - { 40,41,42,43,44,45,46,47,48,49}, - { 50,51,52,53,54,55,56,57,58,59}, - { 60,61,62,63,64,65,66,67,68,69}, - { 70,71,72,73,74,75,76,77,78,79}, - { 80,81,82,83,84,85,86,87,88,89}, - { 90,91,92,93,94,95,96,97,98,99} }; - sst1.get_array()->val2buf((void*)tmp_data); - sst1.get_array()->set_read_p(true); - - // Load values into the grid variables - Grid & sst1_1 = dynamic_cast < Grid & >(*geo_dds->var("SST1_1")); - - Array & lat1_1 = dynamic_cast < Array & >(**sst1_1.map_begin()); - dods_float64 tmp_lat1_1[10] = - { 40, 30, 20, 10, 0, -10, -20, -30, -40, -50 }; - lat1_1.val2buf(tmp_lat1_1); - lat1_1.set_read_p(true); - - Array & lon1_1 = dynamic_cast < Array & >(**(sst1_1.map_begin() + 1)); - dods_float64 tmp_lon1_1[10] = - { 0, 40, 80, 120, 160, 200, 240, 280, 320, 359 }; - lon1_1.val2buf(tmp_lon1_1); - lon1_1.set_read_p(true); - - sst1_1.get_array()->val2buf((void*)tmp_data); - sst1_1.get_array()->set_read_p(true); - - // Load values into the grid variables - Grid & sst2 = dynamic_cast < Grid & >(*geo_dds->var("SST2")); - - Array & lon2 = dynamic_cast < Array & >(**sst2.map_begin()); - dods_float64 tmp_lon2[10] = - // { -180, -120, -80, -40, 0, 40, 80, 120, 160, 179 }; - { 0, 40, 80, 120, 160, -160, -120, -80, -40, -1}; - lon2.val2buf(tmp_lon2); - lon2.set_read_p(true); - //unused BaseType *btp = lon2.var(0); - DBG2(cerr << "lon2[0]: " << dynamic_cast(btp)->value() << endl); - - Array & lat2 = dynamic_cast < Array & >(**(sst2.map_begin() + 1)); - dods_float64 tmp_lat2[10] = - { 40, 30, 20, 10, 0, -10, -20, -30, -40, -50 }; - lat2.val2buf(tmp_lat2); - lat2.set_read_p(true); - - sst2.get_array()->val2buf((void*)tmp_data); - sst2.get_array()->set_read_p(true); - - // Load values into the grid variables - Grid & sst3 = dynamic_cast < Grid & >(*geo_dds->var("SST3")); - - Array & lat3 = dynamic_cast < Array & >(**sst3.map_begin()); - dods_float64 tmp_lat3[10] = - { -40, -30, -20, -10, 0, 10, 20, 30, 40, 50 }; - lat3.val2buf(tmp_lat3); - lat3.set_read_p(true); - - Array & lon3 = dynamic_cast < Array & >(**(sst3.map_begin() + 1)); - dods_float64 tmp_lon3[10] = - { 20, 60, 100, 140, 180, 220, 260, 300, 340, 379 }; - lon3.val2buf(tmp_lon3); - lon3.set_read_p(true); - - sst3.get_array()->val2buf((void*)tmp_data); - sst3.get_array()->set_read_p(true); - - - - // Build the three dimensional grid - geo_dds_3d = new DDS(&btf); - geo_dds_3d->parse((string)TEST_SRC_DIR + "/ce-functions-testsuite/geo_grid_3d.dds"); - // Load values into the grid variables - Grid & sst4 = dynamic_cast < Grid & >(*geo_dds_3d->var("SST4")); - - Array & time = dynamic_cast(**sst4.map_begin()); - dods_int32 tmp_time[3] = { 0, 1, 2 }; - time.val2buf(tmp_time); - time.set_read_p(true); - - Array & lon4 = dynamic_cast < Array & >(**(sst4.map_begin()+1)); - dods_float64 tmp_lon4[5] = { 160, 200, 240, 280, 320 }; - lon4.val2buf(tmp_lon4); - lon4.set_read_p(true); - - Array & lat4 = dynamic_cast < Array & >(**(sst4.map_begin()+2)); - dods_float64 tmp_lat4[5] = { 40, 30, 20, 10, 0 }; - lat4.val2buf(tmp_lat4); - lat4.set_read_p(true); - - dods_byte tmp_data4[3][5][5] = - { - { { 0, 1, 2, 3, 4}, - { 10,11,12,13,14}, - { 20,21,22,23,24}, - { 30,31,32,33,34}, - { 40,41,42,43,44} }, - { { 100, 101, 102, 103, 104}, - { 110, 111, 112, 113, 114}, - { 120, 121, 122, 123, 124}, - { 130, 131, 132, 133, 134}, - { 140, 141, 142, 143, 144} }, - { { 200, 201, 202, 203, 204}, - { 210, 211, 212, 213, 214}, - { 220, 221, 222, 223, 224}, - { 230, 231, 232, 233, 234}, - { 240, 241, 242, 243, 244} } - }; - sst4.get_array()->val2buf((void*)tmp_data4); - sst4.get_array()->set_read_p(true); - - DBG2(sst4.print_val(stderr)); - - geo_dds_coads_lon = new DDS(&btf); - geo_dds_coads_lon->parse((string)TEST_SRC_DIR + "/ce-functions-testsuite/geo_grid_coads_lon.dds"); - Grid & sst5 = dynamic_cast < Grid & >(*geo_dds_coads_lon->var("SST5")); - Array & lon5 = dynamic_cast < Array & >(**sst5.map_begin()); - dods_float64 tmp_lon5[15] = - { 41, 81, 121, 161, 201, 241, 281, 321, 361, 365, 370, 375, 380, 385, 390 }; - lon5.val2buf(tmp_lon5); - lon5.set_read_p(true); - - Array & lat5 = dynamic_cast < Array & >(**(sst5.map_begin() + 1)); - dods_float64 tmp_lat5[5] = { 20, 10, 0, -10, -20 }; - lat5.val2buf(tmp_lat5); - lat5.set_read_p(true); - - dods_byte tmp_data5[15][5] = - { { 0, 1, 2, 3, 4}, - { 10,11,12,13,14}, - { 20,21,22,23,24}, - { 30,31,32,33,34}, - { 40,41,42,43,44}, - { 100, 101, 102, 103, 104}, - { 110, 111, 112, 113, 114}, - { 120, 121, 122, 123, 124}, - { 130, 131, 132, 133, 134}, - { 140, 141, 142, 143, 144}, - { 200, 201, 202, 203, 204}, - { 210, 211, 212, 213, 214}, - { 220, 221, 222, 223, 224}, - { 230, 231, 232, 233, 234}, - { 240, 241, 242, 243, 244} } ; - sst5.get_array()->val2buf((void*)tmp_data5); - sst5.get_array()->set_read_p(true); - DBG2(sst5.print_val(stderr)); - } - - catch (Error & e) { - cerr << "SetUp: " << e.get_error_message() << endl; - throw; - } - } - - void tearDown() - { - delete geo_dds; - delete geo_dds_3d; - delete geo_dds_coads_lon; - - } - - CPPUNIT_TEST_SUITE( GridGeoConstraintTest ); - -#if 1 - CPPUNIT_TEST(geoconstraint_build_lat_lon_maps_test); - CPPUNIT_TEST(lat_lon_dimensions_ok_test); - CPPUNIT_TEST(transform_longitude_to_pos_notation_test); - CPPUNIT_TEST(find_longitude_indeces_test); - CPPUNIT_TEST(categorize_latitude_test); - CPPUNIT_TEST(find_latitude_indeces_test); - CPPUNIT_TEST(set_array_using_double_test); - CPPUNIT_TEST(reorder_longitude_map_test); - // See the comment at the function... - // CPPUNIT_TEST(reorder_data_longitude_axis_test); - CPPUNIT_TEST(set_bounding_box_test1); - CPPUNIT_TEST(set_bounding_box_test2); - CPPUNIT_TEST(set_bounding_box_test3); - CPPUNIT_TEST(set_bounding_box_test4); - CPPUNIT_TEST(set_bounding_box_test5); - CPPUNIT_TEST(set_bounding_box_test6); - CPPUNIT_TEST(set_bounding_box_test7); - CPPUNIT_TEST(apply_constriant_to_data_test); - CPPUNIT_TEST(apply_constriant_to_data_test2); - CPPUNIT_TEST(apply_constriant_to_data_test3); - CPPUNIT_TEST(apply_constriant_to_data_test4); -#endif - CPPUNIT_TEST(apply_constriant_to_data_test_three_arg); - CPPUNIT_TEST(apply_constriant_to_data_test2_three_arg); - CPPUNIT_TEST(apply_constriant_to_data_test3_three_arg); - CPPUNIT_TEST(apply_constriant_to_data_test4_three_arg); - - CPPUNIT_TEST_SUITE_END(); - - void geoconstraint_build_lat_lon_maps_test() - { - try { - Grid *g = dynamic_cast(geo_dds->var("SST1")); - CPPUNIT_ASSERT(g); - GridGeoConstraint gc1(g); - CPPUNIT_ASSERT(gc1.build_lat_lon_maps()); - - g = dynamic_cast(geo_dds->var("SST2")); - CPPUNIT_ASSERT(g); - GridGeoConstraint gc2(g); - CPPUNIT_ASSERT(gc2.build_lat_lon_maps()); - - g = dynamic_cast(geo_dds->var("SST3")); - CPPUNIT_ASSERT(g); - GridGeoConstraint gc3(g); - CPPUNIT_ASSERT(gc3.build_lat_lon_maps()); - - g = dynamic_cast(geo_dds_3d->var("SST4")); - CPPUNIT_ASSERT(g); - GridGeoConstraint gc4(g); - CPPUNIT_ASSERT(gc4.build_lat_lon_maps()); - CPPUNIT_ASSERT(gc4.d_latitude == *(g->map_begin()+2)); - CPPUNIT_ASSERT(gc4.d_longitude == *(g->map_begin()+1)); - } - catch (Error &e) { - cerr << "Error: " << e.get_error_message() << endl; - CPPUNIT_ASSERT(!"build_lat_lon_maps_test() failed"); - } - } - - void lat_lon_dimensions_ok_test() - { - try { - Grid *g = dynamic_cast(geo_dds->var("SST1")); - CPPUNIT_ASSERT(g); - GridGeoConstraint gc1(g); - CPPUNIT_ASSERT(gc1.build_lat_lon_maps()); - CPPUNIT_ASSERT(gc1.lat_lon_dimensions_ok()); - CPPUNIT_ASSERT(gc1.is_longitude_rightmost() == false); - - Grid *g3 = dynamic_cast(geo_dds->var("SST3")); - CPPUNIT_ASSERT(g3); - GridGeoConstraint gc3(g3); - CPPUNIT_ASSERT(gc3.build_lat_lon_maps()); - CPPUNIT_ASSERT(gc3.lat_lon_dimensions_ok()); - CPPUNIT_ASSERT(gc3.is_longitude_rightmost() == true); - } - catch (Error &e) { - cerr << "Error: " << e.get_error_message() << endl; - CPPUNIT_ASSERT(!"lat_lon_dimensions_ok_test() failed"); - } - } - - void transform_longitude_to_pos_notation_test() - { - try { - Grid *g = dynamic_cast(geo_dds->var("SST2")); - CPPUNIT_ASSERT(g); - GridGeoConstraint gc2(g); - CPPUNIT_ASSERT(gc2.build_lat_lon_maps()); - - CPPUNIT_ASSERT(gc2.d_lon[0] == 0); - CPPUNIT_ASSERT(gc2.d_lon[gc2.d_lon_length-1] == -1); - - GeoConstraint::Notation map_notation - = gc2.categorize_notation(gc2.d_lon[0], gc2.d_lon[gc2.d_lon_length-1]); - CPPUNIT_ASSERT(map_notation == GeoConstraint::neg_pos); - - gc2.transform_longitude_to_pos_notation(); - DBG(cerr << "gc2.d_lon[0]: " << gc2.d_lon[0] << endl); - CPPUNIT_ASSERT(gc2.d_lon[0] == 0); - DBG(cerr << "gc2.d_lon[gc2.d_lon_length-1]: " << gc2.d_lon[gc2.d_lon_length-1] << endl); - CPPUNIT_ASSERT(gc2.d_lon[gc2.d_lon_length-1] == 359); - - } - catch (Error &e) { - cerr << "Error: " << e.get_error_message() << endl; - CPPUNIT_ASSERT(!"transform_map_to_pos_notation_test() failed"); - } - } - - void find_longitude_indeces_test() - { - try { - // { 0, 40, 80, 120, 160, 200, 240, 280, 320, 359 }; - Grid *g = dynamic_cast(geo_dds->var("SST1")); - CPPUNIT_ASSERT(g); - GridGeoConstraint gc1(g); - - int left_i, right_i; - gc1.find_longitude_indeces(40.0, 200.0, left_i, right_i); - CPPUNIT_ASSERT(left_i == 1); - CPPUNIT_ASSERT(right_i == 5); - - g = dynamic_cast(geo_dds->var("SST1")); - CPPUNIT_ASSERT(g); - GridGeoConstraint gc2(g); - - gc2.find_longitude_indeces(200, 40.0, left_i, right_i); - CPPUNIT_ASSERT(left_i == 5); - CPPUNIT_ASSERT(right_i == 1); - - g = dynamic_cast(geo_dds->var("SST1")); - CPPUNIT_ASSERT(g); - GridGeoConstraint gc3(g); - - gc3.find_longitude_indeces(5.0, 81.0, left_i, right_i); - DBG(cerr << "left_i: " << left_i << endl); - DBG(cerr << "right_i: " << right_i << endl); - CPPUNIT_ASSERT(left_i == 0); - CPPUNIT_ASSERT(right_i == 3); - - g = dynamic_cast(geo_dds->var("SST1")); - CPPUNIT_ASSERT(g); - GridGeoConstraint gc4(g); - - gc4.find_longitude_indeces(81.0, 5.0, left_i, right_i); - DBG(cerr << "left_i: " << left_i << endl); - DBG(cerr << "right_i: " << right_i << endl); - CPPUNIT_ASSERT(left_i == 2); - CPPUNIT_ASSERT(right_i == 1); - - // lon: { 41, 81, 121, 161, 201, 241, 281, 321, 361, 365, 370, 375, 380, 385, 390 }; - g = dynamic_cast(geo_dds_coads_lon->var("SST5")); - CPPUNIT_ASSERT(g); - GridGeoConstraint gc5(g); - - gc5.find_longitude_indeces(5.0, 81.0, left_i, right_i); - DBG(cerr << "left_i: " << left_i << endl); - DBG(cerr << "right_i: " << right_i << endl); - CPPUNIT_ASSERT(left_i == 9); - CPPUNIT_ASSERT(right_i == 1); - - g = dynamic_cast(geo_dds_coads_lon->var("SST5")); - CPPUNIT_ASSERT(g); - GridGeoConstraint gc6(g); - - gc6.find_longitude_indeces(81.0, 5.0, left_i, right_i); - DBG(cerr << "left_i: " << left_i << endl); - DBG(cerr << "right_i: " << right_i << endl); - CPPUNIT_ASSERT(left_i == 1); - CPPUNIT_ASSERT(right_i == 9); - } - catch (Error &e) { - CPPUNIT_FAIL(e.get_error_message()); - } - } - - void categorize_latitude_test() - { - Grid *g = dynamic_cast(geo_dds->var("SST1")); - CPPUNIT_ASSERT(g); - GridGeoConstraint gc1(g); - - CPPUNIT_ASSERT(gc1.categorize_latitude() == GeoConstraint::normal); - - Grid *g3 = dynamic_cast(geo_dds->var("SST3")); - CPPUNIT_ASSERT(g3); - GridGeoConstraint gc3(g3); - - CPPUNIT_ASSERT(gc3.categorize_latitude() == GeoConstraint::inverted); - } - - void find_latitude_indeces_test() - { - // SST1 lat: { 40, 30, 20, 10, 0, -10, -20, -30, -40, -50 }; - Grid *g = dynamic_cast(geo_dds->var("SST1")); - int top_i, bottom_i; - - CPPUNIT_ASSERT(g); - - GridGeoConstraint gc0(g); - gc0.find_latitude_indeces(20, -20, GeoConstraint::normal, top_i, bottom_i); - DBG(cerr << "SST1, top: " << top_i << ", bottom: " << bottom_i << endl); - CPPUNIT_ASSERT(top_i == 2); - CPPUNIT_ASSERT(bottom_i == 6); - - // SST1 lat: { 40, 30, 20, 10, 0, -10, -20, -30, -40, -50 }; - GridGeoConstraint gc1(g); - gc1.find_latitude_indeces(35, 5, GeoConstraint::normal, top_i, bottom_i); - DBG(cerr << "SST1, top: " << top_i << ", bottom: " << bottom_i << endl); - CPPUNIT_ASSERT(top_i == 0); - CPPUNIT_ASSERT(bottom_i == 4); - - // SST1 lat: { 40, 30, 20, 10, 0, -10, -20, -30, -40, -50 }; - GridGeoConstraint gc2(g); - gc2.find_latitude_indeces(25, -25, GeoConstraint::normal, top_i, bottom_i); - DBG(cerr << "SST1, top: " << top_i << ", bottom: " << bottom_i << endl); - CPPUNIT_ASSERT(top_i == 1); - CPPUNIT_ASSERT(bottom_i == 7); - - // SST1 lat: { 40, 30, 20, 10, 0, -10, -20, -30, -40, -50 }; - GridGeoConstraint gc3(g); - gc3.find_latitude_indeces(-15, -35, GeoConstraint::normal, top_i, bottom_i); - DBG(cerr << "SST1, top: " << top_i << ", bottom: " << bottom_i << endl); - CPPUNIT_ASSERT(top_i == 5); - CPPUNIT_ASSERT(bottom_i == 8); - - // SST3 lat: { -40, -30, -20, -10, 0, 10, 20, 30, 40, 50 }; - g = dynamic_cast(geo_dds->var("SST3")); - CPPUNIT_ASSERT(g); - - GridGeoConstraint gc4(g); - gc4.find_latitude_indeces(20, -20, GeoConstraint::inverted, top_i, bottom_i); - DBG(cerr << "SST3, top: " << top_i << ", bottom: " << bottom_i << endl); - CPPUNIT_ASSERT(top_i == 6); - CPPUNIT_ASSERT(bottom_i == 2); - - // SST3 lat: { -40, -30, -20, -10, 0, 10, 20, 30, 40, 50 }; - GridGeoConstraint gc5(g); - gc5.find_latitude_indeces(35, 5, GeoConstraint::inverted, top_i, bottom_i); - DBG(cerr << "SST3, top: " << top_i << ", bottom: " << bottom_i << endl); - CPPUNIT_ASSERT(top_i == 8); - CPPUNIT_ASSERT(bottom_i == 4); - - // SST3 lat: { -40, -30, -20, -10, 0, 10, 20, 30, 40, 50 }; - GridGeoConstraint gc6(g); - gc6.find_latitude_indeces(-5, -35, GeoConstraint::inverted, top_i, bottom_i); - DBG(cerr << "SST3, top: " << top_i << ", bottom: " << bottom_i << endl); - CPPUNIT_ASSERT(top_i == 4); - CPPUNIT_ASSERT(bottom_i == 0); - - // SST3 lat: { -40, -30, -20, -10, 0, 10, 20, 30, 40, 50 }; - GridGeoConstraint gc7(g); - gc7.find_latitude_indeces(25, -25, GeoConstraint::inverted, top_i, bottom_i); - DBG(cerr << "SST3, top: " << top_i << ", bottom: " << bottom_i << endl); - CPPUNIT_ASSERT(top_i == 7); - CPPUNIT_ASSERT(bottom_i == 1); - } - - void set_array_using_double_test() - { - try { - Grid *g = dynamic_cast(geo_dds->var("SST1")); - Array *lon = dynamic_cast(*g->map_begin()); - double ten_values[10] = {-1,1,2,3,4,5,6,7,8,9}; - set_array_using_double(lon, ten_values, 10); - CPPUNIT_ASSERT(extract_double_value(lon->var(0)) == ten_values[0]); - CPPUNIT_ASSERT(extract_double_value(lon->var(9)) == ten_values[9]); - - Int32 *i = new Int32(""); - Array *a = new Array("", i); - a->append_dim(10); - int dummy_values[10] = {10,11,12,13,14,15,16,17,18,19}; - a->val2buf((void*)dummy_values); - a->set_read_p(true); - CPPUNIT_ASSERT(extract_double_value(a->var(0)) == 10.0); - CPPUNIT_ASSERT(extract_double_value(a->var(9)) == 19.0); - set_array_using_double(a, ten_values, 10); - CPPUNIT_ASSERT(extract_double_value(a->var(0)) == ten_values[0]); - CPPUNIT_ASSERT(extract_double_value(a->var(9)) == ten_values[9]); - } - catch (Error &e) { - cerr << "Error: " << e.get_error_message() << endl; - CPPUNIT_ASSERT(!"Error in set_array_using_double_test."); - } - } - - void reorder_longitude_map_test() - { - Grid *g = dynamic_cast(geo_dds->var("SST1")); - CPPUNIT_ASSERT(g); - GridGeoConstraint gc1(g); - // Longitude map: { 0, 40, 80, 120, 160, 200, 240, 280, 320, 359 } - - gc1.reorder_longitude_map(7); - - CPPUNIT_ASSERT(gc1.d_lon[0] == 280); - CPPUNIT_ASSERT(gc1.d_lon[2] == 359); - CPPUNIT_ASSERT(gc1.d_lon[3] == 0); - CPPUNIT_ASSERT(gc1.d_lon[6] == 120); - CPPUNIT_ASSERT(gc1.d_lon[9] == 240); - } -#if 0 - // This test is broken because reorder...() uses read and I haven't worked - // out how to get the data used here into the grid so that read() called - // elsewhere will return it. Might try using the series_values property to - // create a predictable set of values... - void reorder_data_longitude_axis_test() - { - try { - Grid *g = dynamic_cast(geo_dds->var("SST1")); - CPPUNIT_ASSERT(g); - GridGeoConstraint gc1(g); - /* Data values for Grid SST1: - { { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9}, - { 10,11,12,13,14,15,16,17,18,19}, - { 20,21,22,23,24,25,26,27,28,29}, - { 30,31,32,33,34,35,36,37,38,39}, - { 40,41,42,43,44,45,46,47,48,49}, - { 50,51,52,53,54,55,56,57,58,59}, - { 60,61,62,63,64,65,66,67,68,69}, - { 70,71,72,73,74,75,76,77,78,79}, - { 80,81,82,83,84,85,86,87,88,89}, - { 90,91,92,93,94,95,96,97,98,99} }; - */ - gc1.d_longitude_index_left = 5; - gc1.d_longitude_index_right = 1; - - cerr << "Before gc1.reorder_data_longitude_axis();" << endl; - gc1.reorder_data_longitude_axis(); - cerr << "past gc1.reorder_data_longitude_axis();" << endl; - - // Read the data out into local storage - dods_byte *tmp_data2=0; - dods_byte **tmp_data2_ptr = &tmp_data2; - int size = g->get_array()->buf2val((void**)tmp_data2_ptr); - cerr << "size = " << size << endl; - - cerr << "tmp_data2[0]: " << (int)tmp_data2[0] << endl; - CPPUNIT_ASSERT(tmp_data2[0] == 5); - CPPUNIT_ASSERT(tmp_data2[9] == 4); - CPPUNIT_ASSERT(tmp_data2[10] == 15); - CPPUNIT_ASSERT(tmp_data2[90] == 95); - CPPUNIT_ASSERT(tmp_data2[99] == 94); - } - catch (Error &e) { - cerr << "Error: " << e.get_error_message() << endl; - CPPUNIT_ASSERT(!"Error in reorder_data_longitude_axis_test."); - } - } -#endif - - void set_bounding_box_test1() - { - try { - // SST1 uses pos notation; constraint uses pos - Grid *g = dynamic_cast(geo_dds->var("SST1")); - CPPUNIT_ASSERT(g); - GridGeoConstraint gc1(g); - // lat: { 40, 30, 20, 10, 0, -10, -20, -30, -40, -50 }; - // This should be lon 1 to 5 and lat 0 to 3 - gc1.set_bounding_box(40.0, 40.0, 10.0, 200.0); - - CPPUNIT_ASSERT(gc1.d_longitude_index_left == 1); - CPPUNIT_ASSERT(gc1.d_longitude_index_right == 5); - - CPPUNIT_ASSERT(gc1.d_latitude_index_top == 0); - CPPUNIT_ASSERT(gc1.d_latitude_index_bottom == 3); - - } - catch (Error &e) { - cerr << "Error: " << e.get_error_message() << endl; - CPPUNIT_ASSERT(!"Error in set_bounding_box_test."); - } - } - - void set_bounding_box_test2() - { - try { - Grid *g2 = dynamic_cast(geo_dds->var("SST1")); - CPPUNIT_ASSERT(g2); - GridGeoConstraint gc2(g2); - // SST1 with a constraint that uses neg_pos notation for lon - gc2.set_bounding_box(40.0, 40.0, 10.0, -160.0); - CPPUNIT_ASSERT(gc2.d_longitude_index_left == 1); - CPPUNIT_ASSERT(gc2.d_longitude_index_right == 5); - - CPPUNIT_ASSERT(gc2.d_latitude_index_top == 0); - CPPUNIT_ASSERT(gc2.d_latitude_index_bottom == 3); - - } - catch (Error &e) { - cerr << "Error: " << e.get_error_message() << endl; - CPPUNIT_ASSERT(!"Error in set_bounding_box_test."); - } - } - - void set_bounding_box_test3() - { - try { - Grid *g3 = dynamic_cast(geo_dds_3d->var("SST4")); - CPPUNIT_ASSERT(g3); - GridGeoConstraint gc3(g3); - // SST1 with a constraint that uses neg_pos notation for lon - gc3.set_bounding_box(30.0, 200.0, 20.0, 280.0); - CPPUNIT_ASSERT(gc3.d_longitude_index_left == 1); - CPPUNIT_ASSERT(gc3.d_longitude_index_right == 3); - - CPPUNIT_ASSERT(gc3.d_latitude_index_top == 1); - CPPUNIT_ASSERT(gc3.d_latitude_index_bottom == 2); - - } - catch (Error &e) { - cerr << "Error: " << e.get_error_message() << endl; - CPPUNIT_ASSERT(!"Error in set_bounding_box_test."); - } - } - - void set_bounding_box_test4() - { - // lon: { 160, 200, 240, 280, 320 } - // lat: { 40, 30, 20, 10, 0 } - try { - Grid *g3 = dynamic_cast(geo_dds_3d->var("SST4")); - CPPUNIT_ASSERT(g3); - GridGeoConstraint gc3(g3); - // SST1 with a constraint that uses neg_pos notation for lon - gc3.set_bounding_box(30.0, 0, 20.0, 150); - CPPUNIT_ASSERT(!"Should fail since the BB box contains no data"); - - } - catch (Error &e) { - cerr << "Error: " << e.get_error_message() << endl; - CPPUNIT_ASSERT("Caught Error."); - } - } - - void set_bounding_box_test5() - { - // lon: { 160, 200, 240, 280, 320 } - // lat: { 40, 30, 20, 10, 0 } - try { - Grid *g3 = dynamic_cast(geo_dds_3d->var("SST4")); - CPPUNIT_ASSERT(g3); - GridGeoConstraint gc3(g3); - // SST1 with a constraint that uses neg_pos notation for lon - gc3.set_bounding_box(30.0, 0, 20.0, 170); - CPPUNIT_ASSERT("Should not fail since the BB box contains data"); - - } - catch (Error &e) { - cerr << "Error: " << e.get_error_message() << endl; - CPPUNIT_ASSERT(!"Should not throw Error."); - } - } - - void set_bounding_box_test6() - { - // lon: { 160, 200, 240, 280, 320 } - // lat: { 40, 30, 20, 10, 0 } - try { - Grid *g3 = dynamic_cast(geo_dds_3d->var("SST4")); - CPPUNIT_ASSERT(g3); - GridGeoConstraint gc3(g3); - // SST1 with a constraint that uses neg_pos notation for lon - gc3.set_bounding_box(60.0, 170, 50.0, 270); - CPPUNIT_FAIL("Should fail since the BB box contains no data"); - - } - catch (Error &e) { - DBG(cerr << "Error: " << e.get_error_message() << endl); - CPPUNIT_ASSERT("Cought Error."); - } - } - - void set_bounding_box_test7() - { - // lon: 20 --> 359 - // lat: { -40, -30, -20, -10, 0, 10, 20, 30, 40, 50 }; - try { - Grid *g3 = dynamic_cast(geo_dds->var("SST3")); - CPPUNIT_ASSERT(g3); - GridGeoConstraint gc3(g3); - // SST1 with a constraint that uses neg_pos notation for lon - gc3.set_bounding_box(70.0, 170, 60.0, 270); - CPPUNIT_ASSERT(!"Should fail since the BB box contains no data"); - - } - catch (Error &e) { - DBG(cerr << "Error: " << e.get_error_message() << endl); - CPPUNIT_ASSERT("Cought Error."); - } - } - - void apply_constriant_to_data_test() - { - try { - Grid *g2 = dynamic_cast(geo_dds->var("SST1")); - CPPUNIT_ASSERT(g2); - g2->set_send_p(true); - - DBG(g2->print_decl(cerr, " ", true, false, true)); - DBG(g2->print_val(cerr, " ", false)); - DBG(cerr << endl << endl); - - GridGeoConstraint gc2(g2); - // SST1 with a constraint that uses neg_pos notation for lon - // This should result in a constraint lat from 5 to 8 and - // from lon 1 to 5 - gc2.set_bounding_box(30, 40, 10, 120); - - /* lat: { 40, 30, 20, 10, 0, -10, -20, -30, -40, -50 }; - lon: { 0, 40, 80, 120, 160, 200, 240, 280, 320, 359 }; - - Data values for Grid SST1: - { { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9}, - { 10,11,12,13,14,15,16,17,18,19}, - { 20,21,22,23,24,25,26,27,28,29}, - { 30,31,32,33,34,35,36,37,38,39}, - { 40,41,42,43,44,45,46,47,48,49}, - { 50,51,52,53,54,55,56,57,58,59}, - { 60,61,62,63,64,65,66,67,68,69}, - { 70,71,72,73,74,75,76,77,78,79}, - { 80,81,82,83,84,85,86,87,88,89}, - { 90,91,92,93,94,95,96,97,98,99} }; - */ - - gc2.apply_constraint_to_data(); - - CPPUNIT_ASSERT(gc2.d_latitude->length() == 3); - CPPUNIT_ASSERT(gc2.d_longitude->length() == 3); - - double *lats = 0; - double **lats_ptr = &lats; - gc2.d_latitude->buf2val((void**)lats_ptr); - CPPUNIT_ASSERT(lats[0] == 30.0); - CPPUNIT_ASSERT(lats[2] == 10.0); - - double *lons = 0; - double **lons_ptr = &lons; - gc2.d_longitude->buf2val((void**)lons_ptr); - CPPUNIT_ASSERT(lons[0] == 40.0); - CPPUNIT_ASSERT(lons[2] == 120.0); - - DBG(gc2.get_constrained_grid()->print_decl(cerr, " ", true, false, true)); - DBG(gc2.get_constrained_grid()->print_val(cerr, " ", false)); - DBG(cerr << endl << endl); - } - catch (Error &e) { - CPPUNIT_FAIL(e.get_error_message()); - } - } - - void apply_constriant_to_data_test_three_arg() - { - try { - Grid *g2 = dynamic_cast(geo_dds->var("SST1")); - CPPUNIT_ASSERT(g2); - g2->set_send_p(true); - - DBG(g2->print_decl(cerr, " ", true, false, true)); - DBG(g2->print_val(cerr, " ", false)); - DBG(cerr << endl << endl); - - Array *lat2 = dynamic_cast(geo_dds->var("SST1.lat")); - CPPUNIT_ASSERT(lat2); - Array *lon2 = dynamic_cast(geo_dds->var("SST1.lon")); - CPPUNIT_ASSERT(lon2); - - GridGeoConstraint gc2(g2, lat2, lon2); - // SST1 with a constraint that uses neg_pos notation for lon - // This should result in a constraint lat from 5 to 8 and - // from lon 1 to 5 - gc2.set_bounding_box(30, 40, 10, 120); - - /* lat: { 40, 30, 20, 10, 0, -10, -20, -30, -40, -50 }; - lon: { 0, 40, 80, 120, 160, 200, 240, 280, 320, 359 }; - - Data values for Grid SST1: - { { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9}, - { 10,11,12,13,14,15,16,17,18,19}, - { 20,21,22,23,24,25,26,27,28,29}, - { 30,31,32,33,34,35,36,37,38,39}, - { 40,41,42,43,44,45,46,47,48,49}, - { 50,51,52,53,54,55,56,57,58,59}, - { 60,61,62,63,64,65,66,67,68,69}, - { 70,71,72,73,74,75,76,77,78,79}, - { 80,81,82,83,84,85,86,87,88,89}, - { 90,91,92,93,94,95,96,97,98,99} }; - */ - - gc2.apply_constraint_to_data(); - - CPPUNIT_ASSERT(gc2.d_latitude->length() == 3); - CPPUNIT_ASSERT(gc2.d_longitude->length() == 3); - - double *lats = 0; - double **lats_ptr = &lats; - gc2.d_latitude->buf2val((void**)lats_ptr); - CPPUNIT_ASSERT(lats[0] == 30.0); - CPPUNIT_ASSERT(lats[2] == 10.0); - - double *lons = 0; - double **lons_ptr = &lons; - gc2.d_longitude->buf2val((void**)lons_ptr); - CPPUNIT_ASSERT(lons[0] == 40.0); - CPPUNIT_ASSERT(lons[2] == 120.0); - - DBG(gc2.get_constrained_grid()->print_decl(cerr, " ", true, false, true)); - DBG(gc2.get_constrained_grid()->print_val(cerr, " ", false)); - DBG(cerr << endl << endl); - } - catch (Error &e) { - CPPUNIT_FAIL(e.get_error_message()); - } - } - - void apply_constriant_to_data_test2() - { - try { - Grid *g = dynamic_cast(geo_dds_3d->var("SST4")); - CPPUNIT_ASSERT(g); - g->set_send_p(true); - - GridGeoConstraint gc(g); - // SST1 with a constraint that uses neg_pos notation for lon - // This should result in a constraint from lon 1 to 5 and lat from - // 5 to 8 - gc.set_bounding_box(30.0, 200.0, 20.0, 280.0); - - /* time[3] = { 0, 1, 2 }; - lon4[5] = { 160, 200, 240, 280, 320 }; - lat4[5] = { 40, 30, 20, 10, 0 }; - dods_byte tmp_data4[3][5][5] = - { - { { 0, 1, 2, 3, 4}, - { 10,11,12,13,14}, - { 20,21,22,23,24}, - { 30,31,32,33,34}, - { 40,41,42,43,44} }, - { { 100, 101, 102, 103, 104}, - { 110, 111, 112, 113, 114}, - { 120, 121, 122, 123, 124}, - { 130, 131, 132, 133, 134}, - { 140, 141, 142, 143, 144} }, - { { 200, 201, 202, 203, 204}, - { 210, 211, 212, 213, 214}, - { 220, 221, 222, 223, 224}, - { 230, 231, 232, 233, 234}, - { 240, 241, 242, 243, 244} } - }; - */ - - gc.apply_constraint_to_data(); - - CPPUNIT_ASSERT(gc.d_latitude->length() == 2); - CPPUNIT_ASSERT(gc.d_longitude->length() == 3); - - double *lats = 0; - double **lats_ptr = &lats; - gc.d_latitude->buf2val((void**)lats_ptr); - CPPUNIT_ASSERT(lats[0] == 30.0); - CPPUNIT_ASSERT(lats[1] == 20.0); - - double *lons = 0; - double **lons_ptr = &lons; - gc.d_longitude->buf2val((void**)lons_ptr); - CPPUNIT_ASSERT(lons[0] == 200.0); - CPPUNIT_ASSERT(lons[2] == 280.0); -#ifdef DODS_DEBUG - gc.get_constrained_grid()->print_decl(cerr, " ", true, false, true); - gc.get_constrained_grid()->print_val(cerr, " ", false); - cerr << endl << endl; -#endif - } - catch (Error &e) { - cerr << "Error: " << e.get_error_message() << endl; - CPPUNIT_ASSERT(!"apply_constriant_to_data_test caught Error"); - } - } - - void apply_constriant_to_data_test2_three_arg() - { - try { - Grid *g = dynamic_cast(geo_dds_3d->var("SST4")); - CPPUNIT_ASSERT(g); - g->set_send_p(true); - - Array *lat = dynamic_cast(geo_dds_3d->var("SST4.lat")); - CPPUNIT_ASSERT(lat); - Array *lon = dynamic_cast(geo_dds_3d->var("SST4.lon")); - CPPUNIT_ASSERT(lon); - - GridGeoConstraint gc(g, lat, lon); - // SST1 with a constraint that uses neg_pos notation for lon - // This should result in a constraint from lon 1 to 5 and lat from - // 5 to 8 - gc.set_bounding_box(30.0, 200.0, 20.0, 280.0); - - /* time[3] = { 0, 1, 2 }; - lon4[5] = { 160, 200, 240, 280, 320 }; - lat4[5] = { 40, 30, 20, 10, 0 }; - dods_byte tmp_data4[3][5][5] = - { - { { 0, 1, 2, 3, 4}, - { 10,11,12,13,14}, - { 20,21,22,23,24}, - { 30,31,32,33,34}, - { 40,41,42,43,44} }, - { { 100, 101, 102, 103, 104}, - { 110, 111, 112, 113, 114}, - { 120, 121, 122, 123, 124}, - { 130, 131, 132, 133, 134}, - { 140, 141, 142, 143, 144} }, - { { 200, 201, 202, 203, 204}, - { 210, 211, 212, 213, 214}, - { 220, 221, 222, 223, 224}, - { 230, 231, 232, 233, 234}, - { 240, 241, 242, 243, 244} } - }; - */ - - gc.apply_constraint_to_data(); - - CPPUNIT_ASSERT(gc.d_latitude->length() == 2); - CPPUNIT_ASSERT(gc.d_longitude->length() == 3); - - double *lats = 0; - double **lats_ptr = &lats; - gc.d_latitude->buf2val((void**)lats_ptr); - CPPUNIT_ASSERT(lats[0] == 30.0); - CPPUNIT_ASSERT(lats[1] == 20.0); - - double *lons = 0; - double **lons_ptr = &lons; - gc.d_longitude->buf2val((void**)lons_ptr); - CPPUNIT_ASSERT(lons[0] == 200.0); - CPPUNIT_ASSERT(lons[2] == 280.0); -#ifdef DODS_DEBUG - gc.get_constrained_grid()->print_decl(cerr, " ", true, false, true); - gc.get_constrained_grid()->print_val(cerr, " ", false); - cerr << endl << endl; -#endif - } - catch (Error &e) { - cerr << "Error: " << e.get_error_message() << endl; - CPPUNIT_ASSERT(!"apply_constriant_to_data_test caught Error"); - } - } - - // This tests the 'stitch' feature of the GridGeoConstraint/GeoConstraint - void apply_constriant_to_data_test3() - { - try { - Grid *g2 = dynamic_cast(geo_dds->var("SST3")); - CPPUNIT_ASSERT(g2); - g2->set_send_p(true); - - GridGeoConstraint gc2(g2); - // SST1 with a constraint that uses neg_pos notation for lon - // This should result in a constraint lat from 5 to 8 and - // from lon 1 to 5 - gc2.set_bounding_box(30, 300, 30, 60); - - /* lat: { -40, -30, -20, -10, 0, 10, 20, 30, 40, 50 }; - lon: { 20, 60, 100, 140, 180, 220, 260, 300, 340, 379 }; - - Data values for Grid SST1: - { { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9}, - { 10,11,12,13,14,15,16,17,18,19}, - { 20,21,22,23,24,25,26,27,28,29}, - { 30,31,32,33,34,35,36,37,38,39}, - { 40,41,42,43,44,45,46,47,48,49}, - { 50,51,52,53,54,55,56,57,58,59}, - { 60,61,62,63,64,65,66,67,68,69}, - { 70,71,72,73,74,75,76,77,78,79}, - { 80,81,82,83,84,85,86,87,88,89}, - { 90,91,92,93,94,95,96,97,98,99} }; - */ - - gc2.apply_constraint_to_data(); - - DBG(cerr << "gc2.d_latitude->length(): " << gc2.d_latitude->length() << endl); - DBG(cerr << "gc2.d_longitude->length(): " << gc2.d_longitude->length() << endl); - - double *lats = 0; - double **lats_ptr = &lats; - gc2.d_latitude->buf2val((void**)lats_ptr); - DBG(cerr << "lats[0]: " << lats[0] << endl); - - double *lons = 0; - double **lons_ptr = &lons; - gc2.d_longitude->buf2val((void**)lons_ptr); - DBG(cerr << "lons[0]: " << lons[0] << endl); - DBG(cerr << "lons[gc2.d_longitude->length()-1]: " << lons[gc2.d_longitude->length()-1] << endl); - //CPPUNIT_ASSERT(lons[0] == 260.0); - //CPPUNIT_ASSERT(lons[4] == 20.0); - - CPPUNIT_ASSERT(gc2.d_latitude->length() == 1); - CPPUNIT_ASSERT(gc2.d_longitude->length() == 5); - - CPPUNIT_ASSERT(lats[0] == 30.0); - - CPPUNIT_ASSERT(lons[0] == 300.0); - CPPUNIT_ASSERT(lons[4] == 60.0); -#ifdef DODS_DEBUG - gc2.get_constrained_grid()->print_decl(cerr, " ", true, false, true); - gc2.get_constrained_grid()->print_val(cerr, " ", false); - cerr << endl << endl; -#endif - } - catch (Error &e) { - CPPUNIT_FAIL(e.get_error_message()); - } - } - - // This tests the 'stitch' feature of the GridGeoConstraint/GeoConstraint - void apply_constriant_to_data_test3_three_arg() - { - try { - Grid *g2 = dynamic_cast(geo_dds->var("SST3")); - CPPUNIT_ASSERT(g2); - g2->set_send_p(true); - - Array *lat2 = dynamic_cast(geo_dds->var("SST3.lat")); - CPPUNIT_ASSERT(lat2); - Array *lon2 = dynamic_cast(geo_dds->var("SST3.lon")); - CPPUNIT_ASSERT(lon2); - - GridGeoConstraint gc2(g2, lat2, lon2); - // SST1 with a constraint that uses neg_pos notation for lon - // This should result in a constraint lat from 5 to 8 and - // from lon 1 to 5 - gc2.set_bounding_box(30, 300, 30, 60); - - /* lat: { -40, -30, -20, -10, 0, 10, 20, 30, 40, 50 }; - lon: { 20, 60, 100, 140, 180, 220, 260, 300, 340, 379 }; - - Data values for Grid SST1: - { { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9}, - { 10,11,12,13,14,15,16,17,18,19}, - { 20,21,22,23,24,25,26,27,28,29}, - { 30,31,32,33,34,35,36,37,38,39}, - { 40,41,42,43,44,45,46,47,48,49}, - { 50,51,52,53,54,55,56,57,58,59}, - { 60,61,62,63,64,65,66,67,68,69}, - { 70,71,72,73,74,75,76,77,78,79}, - { 80,81,82,83,84,85,86,87,88,89}, - { 90,91,92,93,94,95,96,97,98,99} }; - */ - - gc2.apply_constraint_to_data(); - - DBG(cerr << "gc2.d_latitude->length(): " << gc2.d_latitude->length() << endl); - DBG(cerr << "gc2.d_longitude->length(): " << gc2.d_longitude->length() << endl); - - double *lats = 0; - double **lats_ptr = &lats; - gc2.d_latitude->buf2val((void**)lats_ptr); - DBG(cerr << "lats[0]: " << lats[0] << endl); - - double *lons = 0; - double **lons_ptr = &lons; - gc2.d_longitude->buf2val((void**)lons_ptr); - DBG(cerr << "lons[0]: " << lons[0] << endl); - DBG(cerr << "lons[gc2.d_longitude->length()-1]: " << lons[gc2.d_longitude->length()-1] << endl); - //CPPUNIT_ASSERT(lons[0] == 260.0); - //CPPUNIT_ASSERT(lons[4] == 20.0); - - CPPUNIT_ASSERT(gc2.d_latitude->length() == 1); - CPPUNIT_ASSERT(gc2.d_longitude->length() == 5); - - CPPUNIT_ASSERT(lats[0] == 30.0); - - CPPUNIT_ASSERT(lons[0] == 300.0); - CPPUNIT_ASSERT(lons[4] == 60.0); -#ifdef DODS_DEBUG - gc2.get_constrained_grid()->print_decl(cerr, " ", true, false, true); - gc2.get_constrained_grid()->print_val(cerr, " ", false); - cerr << endl << endl; -#endif - } - catch (Error &e) { - CPPUNIT_FAIL(e.get_error_message()); - } - } - - // This tests the 'stitch' feature of the GridGeoConstraint/GeoConstraint - void apply_constriant_to_data_test4() - { - try { - Grid *g2 = dynamic_cast(geo_dds->var("SST1_1")); - CPPUNIT_ASSERT(g2); - g2->set_send_p(true); - - GridGeoConstraint gc2(g2); - // SST1 with a constraint that uses neg_pos notation for lon - // This should result in a constraint lat from 5 to 8 and - // from lon 1 to 5 - gc2.set_bounding_box(30, 280, 30, 40); - - /* lat: { 40, 30, 20, 10, 0, -10, -20, -30, -40, -50 }; - lon: { 0, 40, 80, 120, 160, 200, 240, 280, 320, 359 }; - Data values for Grid SST1_1: - { { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9}, - { 10,11,12,13,14,15,16,17,18,19}, - { 20,21,22,23,24,25,26,27,28,29}, - { 30,31,32,33,34,35,36,37,38,39}, - { 40,41,42,43,44,45,46,47,48,49}, - { 50,51,52,53,54,55,56,57,58,59}, - { 60,61,62,63,64,65,66,67,68,69}, - { 70,71,72,73,74,75,76,77,78,79}, - { 80,81,82,83,84,85,86,87,88,89}, - { 90,91,92,93,94,95,96,97,98,99} }; - */ - - gc2.apply_constraint_to_data(); - - DBG(cerr << "gc2.d_latitude->length(): " << gc2.d_latitude->length() << endl); - DBG(cerr << "gc2.d_longitude->length(): " << gc2.d_longitude->length() << endl); - - double *lats = 0; - double **lats_ptr = &lats; - gc2.d_latitude->buf2val((void**)lats_ptr); - DBG(cerr << "lats[0]: " << lats[0] << endl); - //CPPUNIT_ASSERT(lats[3] == -40.0); - - double *lons = 0; - double **lons_ptr = &lons; - gc2.d_longitude->buf2val((void**)lons_ptr); - DBG(cerr << "lons[0]: " << lons[0] << endl); - DBG(cerr << "lons[3]: " << lons[4] << endl); - //CPPUNIT_ASSERT(lons[0] == 260.0); - //CPPUNIT_ASSERT(lons[4] == 20.0); - - CPPUNIT_ASSERT(gc2.d_latitude->length() == 1); - CPPUNIT_ASSERT(gc2.d_longitude->length() == 5); - - CPPUNIT_ASSERT(lats[0] == 30.0); - //CPPUNIT_ASSERT(lats[3] == -40.0); - - CPPUNIT_ASSERT(lons[0] == 280.0); - CPPUNIT_ASSERT(lons[4] == 40.0); -#ifdef DODS_DEBUG - gc2.get_constrained_grid()->print_decl(cerr, " ", true, false, true); - gc2.get_constrained_grid()->print_val(cerr, " ", false); - cerr << endl << endl; -#endif - } - catch (Error &e) { - CPPUNIT_FAIL(e.get_error_message()); - } - } - - void apply_constriant_to_data_test4_three_arg() - { - try { - Grid *g2 = dynamic_cast(geo_dds->var("SST1_1")); - CPPUNIT_ASSERT(g2); - g2->set_send_p(true); - - Array *lat2 = dynamic_cast(geo_dds->var("SST1_1.lat")); - CPPUNIT_ASSERT(lat2); - Array *lon2 = dynamic_cast(geo_dds->var("SST1_1.lon")); - CPPUNIT_ASSERT(lon2); - - GridGeoConstraint gc2(g2, lat2, lon2); - // SST1 with a constraint that uses neg_pos notation for lon - // This should result in a constraint lat from 5 to 8 and - // from lon 1 to 5 - gc2.set_bounding_box(30, 280, 30, 40); - - /* lat: { 40, 30, 20, 10, 0, -10, -20, -30, -40, -50 }; - lon: { 0, 40, 80, 120, 160, 200, 240, 280, 320, 359 }; - Data values for Grid SST1_1: - { { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9}, - { 10,11,12,13,14,15,16,17,18,19}, - { 20,21,22,23,24,25,26,27,28,29}, - { 30,31,32,33,34,35,36,37,38,39}, - { 40,41,42,43,44,45,46,47,48,49}, - { 50,51,52,53,54,55,56,57,58,59}, - { 60,61,62,63,64,65,66,67,68,69}, - { 70,71,72,73,74,75,76,77,78,79}, - { 80,81,82,83,84,85,86,87,88,89}, - { 90,91,92,93,94,95,96,97,98,99} }; - */ - - gc2.apply_constraint_to_data(); - - DBG(cerr << "gc2.d_latitude->length(): " << gc2.d_latitude->length() << endl); - DBG(cerr << "gc2.d_longitude->length(): " << gc2.d_longitude->length() << endl); - - double *lats = 0; - double **lats_ptr = &lats; - gc2.d_latitude->buf2val((void**)lats_ptr); - DBG(cerr << "lats[0]: " << lats[0] << endl); - //CPPUNIT_ASSERT(lats[3] == -40.0); - - double *lons = 0; - double **lons_ptr = &lons; - gc2.d_longitude->buf2val((void**)lons_ptr); - DBG(cerr << "lons[0]: " << lons[0] << endl); - DBG(cerr << "lons[3]: " << lons[4] << endl); - //CPPUNIT_ASSERT(lons[0] == 260.0); - //CPPUNIT_ASSERT(lons[4] == 20.0); - - CPPUNIT_ASSERT(gc2.d_latitude->length() == 1); - CPPUNIT_ASSERT(gc2.d_longitude->length() == 5); - - CPPUNIT_ASSERT(lats[0] == 30.0); - //CPPUNIT_ASSERT(lats[3] == -40.0); - - CPPUNIT_ASSERT(lons[0] == 280.0); - CPPUNIT_ASSERT(lons[4] == 40.0); -#ifdef DODS_DEBUG - gc2.get_constrained_grid()->print_decl(cerr, " ", true, false, true); - gc2.get_constrained_grid()->print_val(cerr, " ", false); - cerr << endl << endl; -#endif - } - catch (Error &e) { - CPPUNIT_FAIL(e.get_error_message()); - } - } - -}; - -CPPUNIT_TEST_SUITE_REGISTRATION(GridGeoConstraintTest); - -} // namespace libdap - -int -main( int, char** ) -{ - CppUnit::TextTestRunner runner; - runner.addTest( CppUnit::TestFactoryRegistry::getRegistry().makeTest() ); - - bool wasSuccessful = runner.run( "", false ) ; - - return wasSuccessful ? 0 : 1; -} diff -Nru libdap-3.11.1/unit-tests/HTTPCacheTest.cc libdap-3.12.0/unit-tests/HTTPCacheTest.cc --- libdap-3.11.1/unit-tests/HTTPCacheTest.cc 2011-04-29 13:19:42.000000000 +0000 +++ libdap-3.12.0/unit-tests/HTTPCacheTest.cc 2013-10-17 21:27:40.000000000 +0000 @@ -19,7 +19,7 @@ // // You should have received a copy of the GNU Lesser General Public // License along with this library; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA // // You can contact OPeNDAP, Inc. at PO Box 112, Saunderstown, RI. 02874-0112. @@ -45,6 +45,7 @@ #include "RCReader.h" // ditto //#define DODS_DEBUG 1 +//#define DODS_DEBUG2 2 #include "debug.h" #if defined(DODS_DEBUG) || defined(DODS_DEBUG2) @@ -70,11 +71,13 @@ return s.st_size; } +#if 0 inline static void print_entry(HTTPCache *, HTTPCacheTable::CacheEntry **e) { cerr << "Entry: " << (*e)->get_cachename() << endl; } +#endif // Note that because this test class uses the fixture 'hc' we must always // force access to the single user/process lock for the cache. This is @@ -99,7 +102,7 @@ putenv((char*)"DODS_CONF=./cache-testsuite/dodsrc"); http_conn = new HTTPConnect(RCReader::instance()); - DBG2(cerr << "Entring HTTPCacheTest ctor... "); + DBG2(cerr << "Entering HTTPCacheTest ctor... "); hash_value = 656; localhost_url = "http://test.opendap.org/test-304.html"; index_file_line = "http://test.opendap.org/test-304.html cache-testsuite/dods_cache/656/dodsKbcD0h \"3f62c-157-139c2680\" 1121283146 -1 343 0 656 1 7351 1121360379 3723 0"; @@ -152,9 +155,8 @@ CPPUNIT_TEST(cache_index_write_test); CPPUNIT_TEST(create_cache_root_test); CPPUNIT_TEST(set_cache_root_test); -#endif CPPUNIT_TEST(get_single_user_lock_test); -#if 1 + CPPUNIT_TEST(release_single_user_lock_test); CPPUNIT_TEST(create_hash_directory_test); CPPUNIT_TEST(create_location_test); @@ -163,8 +165,13 @@ CPPUNIT_TEST(calculate_time_test); CPPUNIT_TEST(write_metadata_test); CPPUNIT_TEST(cache_response_test); - +#endif +#if 0 + // This test does not seem to work in New Zealand - maybe because + // of the dateline??? jhrg 1/31/13 CPPUNIT_TEST(is_url_valid_test); +#endif +#if 1 CPPUNIT_TEST(get_cached_response_test); CPPUNIT_TEST(perform_garbage_collection_test); @@ -174,9 +181,6 @@ CPPUNIT_TEST(update_response_test); CPPUNIT_TEST(cache_gc_test); #endif -#if 0 - CPPUNIT_TEST(interrupt_test); -#endif CPPUNIT_TEST_SUITE_END(); @@ -264,27 +268,34 @@ } void cache_index_write_test() { - HTTPCache *hc_3 = new HTTPCache("cache-testsuite/dods_cache/", true); - hc_3->d_http_cache_table->add_entry_to_cache_table(hc->d_http_cache_table->cache_index_parse_line(index_file_line.c_str())); - - hc_3->d_http_cache_table->d_cache_index = hc->d_cache_root + "test_index"; - hc_3->d_http_cache_table->cache_index_write(); - - HTTPCache *hc_4 = new HTTPCache("cache-testsuite/dods_cache/", true); - hc_4->d_http_cache_table->d_cache_index = hc_3->d_cache_root + "test_index"; - hc_4->d_http_cache_table->cache_index_read(); - - HTTPCacheTable::CacheEntry *e = - hc_4->d_http_cache_table->get_locked_entry_from_cache_table(localhost_url); - CPPUNIT_ASSERT(e); - CPPUNIT_ASSERT(e->url == localhost_url); - e->unlock_read_response(); - - delete hc_3; - hc = 0; - delete hc_4; - hc = 0; - } + try { + HTTPCache * hc_3 = new HTTPCache("cache-testsuite/dods_cache/", true); + hc_3->d_http_cache_table->add_entry_to_cache_table( + hc->d_http_cache_table->cache_index_parse_line(index_file_line.c_str())); + + hc_3->d_http_cache_table->d_cache_index = hc->d_cache_root + "test_index"; + hc_3->d_http_cache_table->cache_index_write(); + + HTTPCache *hc_4 = new HTTPCache("cache-testsuite/dods_cache/", true); + hc_4->d_http_cache_table->d_cache_index = hc_3->d_cache_root + "test_index"; + hc_4->d_http_cache_table->cache_index_read(); + + HTTPCacheTable::CacheEntry *e = hc_4->d_http_cache_table->get_locked_entry_from_cache_table(localhost_url); + cerr << "Got locked entry" << endl; + CPPUNIT_ASSERT(e); + CPPUNIT_ASSERT(e->url == localhost_url); + e->unlock_read_response(); + + delete hc_3; + hc_3 = 0; + delete hc_4; + hc_4 = 0; + } + catch (Error &e) { + cerr << "Fail: " << e.get_error_message() << endl; + CPPUNIT_FAIL("Caugt exception."); + } + } void create_cache_root_test() { hc->create_cache_root("/tmp/silly/"); diff -Nru libdap-3.11.1/unit-tests/HTTPConnectTest.cc libdap-3.12.0/unit-tests/HTTPConnectTest.cc --- libdap-3.11.1/unit-tests/HTTPConnectTest.cc 2011-04-29 13:19:42.000000000 +0000 +++ libdap-3.12.0/unit-tests/HTTPConnectTest.cc 2013-10-17 21:27:40.000000000 +0000 @@ -19,7 +19,7 @@ // // You should have received a copy of the GNU Lesser General Public // License along with this library; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA // // You can contact OPeNDAP, Inc. at PO Box 112, Saunderstown, RI. 02874-0112. @@ -114,23 +114,21 @@ } CPPUNIT_TEST_SUITE(HTTPConnectTest); -#if 1 + CPPUNIT_TEST(read_url_test); CPPUNIT_TEST(fetch_url_test); CPPUNIT_TEST(get_response_headers_test); CPPUNIT_TEST(server_version_test); CPPUNIT_TEST(type_test); -#endif + CPPUNIT_TEST(cache_test); -#if 1 + CPPUNIT_TEST(set_accept_deflate_test); CPPUNIT_TEST(set_xdap_protocol_test); CPPUNIT_TEST(read_url_password_test); CPPUNIT_TEST(read_url_password_test2); -#endif -#if 0 - CPPUNIT_TEST(read_url_password_proxy_test); -#endif + + // CPPUNIT_TEST(read_url_password_proxy_test); CPPUNIT_TEST_SUITE_END(); @@ -188,10 +186,13 @@ } void fetch_url_test() { + DBG(cerr << "Entering fetch_url_test" << endl); HTTPResponse *stuff = 0; char c; try { + DBG(cerr << " First request..." << endl;) stuff = http->fetch_url(localhost_url); + DBG(cerr << " Back from first request." << endl); CPPUNIT_ASSERT(fread(&c, 1, 1, stuff->get_stream()) == 1 && !ferror(stuff->get_stream()) && !feof(stuff->get_stream())); @@ -214,6 +215,7 @@ // is not called, then a failed test can leave the cache with locked // entries catch (...) { + cerr << "Caught unknown exception" << endl; delete stuff; stuff = 0; throw; } diff -Nru libdap-3.11.1/unit-tests/Keywords2Test.cc libdap-3.12.0/unit-tests/Keywords2Test.cc --- libdap-3.11.1/unit-tests/Keywords2Test.cc 2011-04-29 13:19:42.000000000 +0000 +++ libdap-3.12.0/unit-tests/Keywords2Test.cc 1970-01-01 00:00:00.000000000 +0000 @@ -1,217 +0,0 @@ - -// -*- mode: c++; c-basic-offset:4 -*- - -// This file is part of libdap, A C++ implementation of the OPeNDAP Data -// Access Protocol. - -// Copyright (c) 2006 OPeNDAP, Inc. -// Author: James Gallagher -// -// This library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Lesser General Public -// License as published by the Free Software Foundation; either -// version 2.1 of the License, or (at your option) any later version. -// -// This library 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 -// Lesser General Public License for more details. -// -// You should have received a copy of the GNU Lesser General Public -// License along with this library; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -// -// You can contact OPeNDAP, Inc. at PO Box 112, Saunderstown, RI. 02874-0112. - -// Tests for the AISResources class. - -#include -#include -#include - -//#define DODS_DEBUG - -#include "BaseType.h" -#include "Int32.h" -#include "Float64.h" -#include "Str.h" -#include "Array.h" -#include "Grid.h" -#include "DDS.h" -#include "DAS.h" -#include "ce_functions.h" -#include "Keywords2.h" - -#include - -#include "../tests/TestTypeFactory.h" - -#include "debug.h" - -using namespace CppUnit; -using namespace libdap; -using namespace std; - -int test_variable_sleep_interval = 0; - -class KeywordsTest:public TestFixture -{ -private: - Keywords *k; -public: - KeywordsTest() - {} - - ~KeywordsTest() - {} - - void setUp() - { - k = new Keywords(); - } - - void tearDown() - { - delete k; k = 0; - } - - CPPUNIT_TEST_SUITE( KeywordsTest ); - - CPPUNIT_TEST(no_keywords_test_1); - CPPUNIT_TEST(no_keywords_test_2); - - CPPUNIT_TEST(one_keyword_test_1); - CPPUNIT_TEST(one_keyword_test_2); - - CPPUNIT_TEST(two_keyword_test_1); - CPPUNIT_TEST(two_keyword_test_2); - - CPPUNIT_TEST(bad_keyword_test_1); - CPPUNIT_TEST(bad_keyword_test_2); - CPPUNIT_TEST(bad_keyword_test_3); - CPPUNIT_TEST(bad_keyword_test_4); - - CPPUNIT_TEST_SUITE_END(); - - void no_keywords_test_1() - { - string ce = k->parse_keywords(""); - CPPUNIT_ASSERT(!k->has_keyword("dap")); - CPPUNIT_ASSERT(ce == ""); - CPPUNIT_ASSERT(k->get_keywords().size() == 0); - } - - void no_keywords_test_2() - { - string ce = k->parse_keywords("u,v"); - CPPUNIT_ASSERT(!k->has_keyword("dap")); - CPPUNIT_ASSERT(ce == "u,v"); - CPPUNIT_ASSERT(k->get_keywords().size() == 0); - } - - void one_keyword_test_1() - { - CPPUNIT_ASSERT(k->is_known_keyword("dap")); - - string ce = k->parse_keywords("dap(2)"); - CPPUNIT_ASSERT(ce == ""); - CPPUNIT_ASSERT(k->has_keyword("dap")); - CPPUNIT_ASSERT(k->get_keyword_value("dap") == "2"); - CPPUNIT_ASSERT(k->get_keywords().size() == 1); - } - - void one_keyword_test_2() - { - string ce = k->parse_keywords("dap(2),u,v&v<7"); - CPPUNIT_ASSERT(ce == "u,v&v<7"); - CPPUNIT_ASSERT(k->has_keyword("dap")); - CPPUNIT_ASSERT(k->get_keyword_value("dap") == "2"); - CPPUNIT_ASSERT(k->get_keywords().size() == 1); - } - - void two_keyword_test_1() - { - string ce = k->parse_keywords("dap(2),dap(3.2)"); - CPPUNIT_ASSERT(ce == ""); - CPPUNIT_ASSERT(k->has_keyword("dap")); - CPPUNIT_ASSERT(k->get_keyword_value("dap") == "3.2"); - CPPUNIT_ASSERT(k->get_keywords().size() == 1); - - CPPUNIT_ASSERT(k->is_known_keyword("dap")); - } - - void two_keyword_test_2() - { - string ce = k->parse_keywords("dap(2),dap(3.2),u,v&v<7"); - CPPUNIT_ASSERT(ce == "u,v&v<7"); - CPPUNIT_ASSERT(k->has_keyword("dap")); - CPPUNIT_ASSERT(k->get_keyword_value("dap") == "3.2"); - CPPUNIT_ASSERT(k->get_keywords().size() == 1); - } - - void bad_keyword_test_1() - { - try { - string ce = k->parse_keywords("dap7"); - // Even though this is pretty obviously wrong, we soldier on because - // The keyword processing code has no way of knowing what will be - // valid variable names. - CPPUNIT_ASSERT(ce == "dap7"); - } - catch (Error &e) { - CPPUNIT_FAIL("Should not get here"); - } - } - void bad_keyword_test_2() - { - try { - string ce = k->parse_keywords("dap(7"); - // Even though this is pretty obviously wrong, we soldier on because - // The keyword processing code has no way of knowing what will be - // valid variable names. - CPPUNIT_ASSERT(ce == "dap(7"); - } - catch (Error &e) { - CPPUNIT_FAIL("Should not get here"); - } - } - void bad_keyword_test_3() - { - try { - string ce = k->parse_keywords("dap7)"); - // Even though this is pretty obviously wrong, we soldier on because - // The keyword processing code has no way of knowing what will be - // valid variable names. - CPPUNIT_ASSERT(ce == "dap7)"); - } - catch (Error &e) { - CPPUNIT_FAIL("Should not get here"); - } - } - void bad_keyword_test_4() - { - try { - string ce = k->parse_keywords("dap(7)"); - // Even though this is pretty obviously wrong, we soldier on because - // The keyword processing code has no way of knowing what will be - // valid variable names. - CPPUNIT_FAIL("Should throw - bad value to keyword/function"); - } - catch (Error &e) { - CPPUNIT_ASSERT("Should throw - bad value to keyword/function"); - } - } -}; - -CPPUNIT_TEST_SUITE_REGISTRATION(KeywordsTest); - -int -main( int, char** ) -{ - CppUnit::TextTestRunner runner; - runner.addTest( CppUnit::TestFactoryRegistry::getRegistry().makeTest() ); - - bool wasSuccessful = runner.run( "", false ) ; - - return wasSuccessful ? 0 : 1; -} diff -Nru libdap-3.11.1/unit-tests/MIMEUtilTest.cc libdap-3.12.0/unit-tests/MIMEUtilTest.cc --- libdap-3.11.1/unit-tests/MIMEUtilTest.cc 2011-04-29 13:19:42.000000000 +0000 +++ libdap-3.12.0/unit-tests/MIMEUtilTest.cc 2013-10-17 21:27:40.000000000 +0000 @@ -18,7 +18,7 @@ // // You should have received a copy of the GNU Lesser General Public // License along with this library; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA // // You can contact OPeNDAP, Inc. at PO Box 112, Saunderstown, RI. 02874-0112. @@ -46,8 +46,6 @@ #include "debug.h" #include -//#include "testFile.cc" - using namespace CppUnit; using namespace std; using namespace libdap; @@ -148,13 +146,14 @@ XOPeNDAP-Server: dods-test/0.00\r\n\ XDAP: .*\r\n\ Date: .*\r\n\ -Last-Modified: Sat, 01 Jan 2000 ..:00:00 GMT\r\n\ +Last-Modified: (Sat, 01 Jan 2000 ..:00:00 GMT|Fri, 31 Dec 1999 ..:00:00 GMT)\r\n\ Content-Type: text/plain\r\n\ Content-Description: dods_dds\r\n\ \r\n.*"); oss.str(""); set_mime_text(oss, dods_dds, "dods-test/0.00", x_plain, t); + DBG(cerr << "set_mime_text_test: oss: " << oss.str() << endl); CPPUNIT_ASSERT(re_match(r3, oss.str())); } @@ -166,7 +165,7 @@ t = mktime(&tm); // This test may fail for some locations since mktime interprets t as // the local time and returns the corresponding GMT time. - Regex r1("Sat, 01 Jan 2000 ..:00:00 GMT"); + Regex r1("(Sat, 01 Jan 2000 ..:00:00 GMT|Fri, 31 Dec 1999 ..:00:00 GMT)"); CPPUNIT_ASSERT(re_match(r1, rfc822_date(t))); } diff -Nru libdap-3.11.1/unit-tests/Makefile.am libdap-3.12.0/unit-tests/Makefile.am --- libdap-3.11.1/unit-tests/Makefile.am 2011-04-29 13:19:42.000000000 +0000 +++ libdap-3.12.0/unit-tests/Makefile.am 2013-10-17 21:27:40.000000000 +0000 @@ -7,7 +7,7 @@ # Headers in 'tests' are used by the arrayT unit tests. -AM_CPPFLAGS = -I$(top_srcdir)/GNU -I$(top_srcdir) -I$(top_srcdir)/tests +AM_CPPFLAGS = -I$(top_srcdir)/GNU -I$(top_srcdir) -I$(top_srcdir)/tests $(CURL_CFLAGS) $(XML2_CFLAGS) AM_LDADD = if CPPUNIT AM_CPPFLAGS += $(CPPUNIT_CFLAGS) @@ -16,7 +16,7 @@ # These are not used by automake but are often useful for certain types of # debugging. Set CXXFLAGS to this in the nightly build using export ... -CXXFLAGS_DEBUG = -g3 -O0 -fno-defer-pop -Wall -W -Wcast-align -Werror +CXXFLAGS_DEBUG = -g3 -O0 -Wall -W -Wcast-align -Werror TEST_COV_FLAGS = -ftest-coverage -fprofile-arcs # This determines what gets built by make check @@ -28,10 +28,9 @@ noinst_HEADERS = test_config.h DIRS_EXTRA = das-testsuite dds-testsuite ddx-testsuite \ - rcreader-testsuite server-testsuite cgi-util-tests \ - ce-functions-testsuite + rcreader-testsuite server-testsuite cgi-util-tests D4-xml -EXTRA_DIST = $(DIRS_EXTRA) testFile.cc test_config.h.in +EXTRA_DIST = $(DIRS_EXTRA) testFile.cc testFile.h test_config.h.in CLEANFILES = testout .dodsrc *.gcda *.gcno @@ -48,13 +47,17 @@ UNIT_TESTS = marshT arrayT attrTableT structT sequenceT ddsT dasT \ RegexTest \ ArrayTest AttrTableTest ByteTest MIMEUtilTest ancT DASTest \ - DDSTest DDXParserTest DODSFilterTest generalUtilTest \ + DDSTest DDXParserTest generalUtilTest \ HTTPCacheTest HTTPConnectTest parserUtilTest RCReaderTest \ - SequenceTest SignalHandlerTest CEFunctionsTest \ - GridGeoConstraintTest ArrayGeoConstraintTest MarshallerTest \ - ResponseBuilderTest Keywords2Test - -# fdiostreamTest + SequenceTest SignalHandlerTest MarshallerTest \ + ServerFunctionsListUnitTest + +# ResponseBuilderTest ResponseCacheTest Keywords2Test DODSFilterTest + +if DAP4_DEFINED + UNIT_TESTS += DAP4MarshallerTest DAP4UnMarshallerTest \ + D4DimensionsTest D4EnumDefsTest +endif else UNIT_TESTS = @@ -66,19 +69,20 @@ @echo "check target in unit-tests directory *" @echo "**********************************************************" @echo "" - endif +TEST_SRC = testFile.cc testFile.h + RegexTest_SOURCES = RegexTest.cc RegexTest_LDADD = ../libdap.la $(AM_LDADD) ArrayTest_SOURCES = ArrayTest.cc ArrayTest_LDADD = ../libdap.la $(AM_LDADD) -AttrTableTest_SOURCES = AttrTableTest.cc +AttrTableTest_SOURCES = AttrTableTest.cc $(TEST_SRC) AttrTableTest_LDADD = ../libdap.la $(AM_LDADD) -ByteTest_SOURCES = ByteTest.cc +ByteTest_SOURCES = ByteTest.cc $(TEST_SRC) ByteTest_LDADD = ../libdap.la $(AM_LDADD) MIMEUtilTest_SOURCES = MIMEUtilTest.cc @@ -90,31 +94,33 @@ DASTest_SOURCES = DASTest.cc DASTest_LDADD = ../libdap.la $(AM_LDADD) -DDSTest_SOURCES = DDSTest.cc +DDSTest_SOURCES = DDSTest.cc $(TEST_SRC) DDSTest_LDADD = ../libdap.la $(AM_LDADD) DDXParserTest_SOURCES = DDXParserTest.cc DDXParserTest_CPPFLAGS = $(AM_CPPFLAGS) $(XML2_CFLAGS) DDXParserTest_LDADD = ../libdap.la $(AM_LDADD) -DODSFilterTest_SOURCES = DODSFilterTest.cc -DODSFilterTest_LDADD = ../libdapserver.la ../libdap.la \ - ../tests/libtest-types.a $(AM_LDADD) - -ResponseBuilderTest_SOURCES = ResponseBuilderTest.cc -ResponseBuilderTest_LDADD = ../libdapserver.la ../libdap.la \ - ../tests/libtest-types.a $(AM_LDADD) +# DODSFilterTest_SOURCES = DODSFilterTest.cc $(TEST_SRC) +# DODSFilterTest_LDADD = ../libdapserver.la ../libdap.la \ +# ../tests/libtest-types.a $(AM_LDADD) + +# ResponseBuilderTest_SOURCES = ResponseBuilderTest.cc $(TEST_SRC) +# ResponseBuilderTest_LDADD = ../libdapserver.la ../libdap.la \ +# ../tests/libtest-types.a $(AM_LDADD) -Keywords2Test_SOURCES = Keywords2Test.cc -Keywords2Test_LDADD = ../libdap.la $(AM_LDADD) +# Keywords2Test_SOURCES = Keywords2Test.cc +# Keywords2Test_LDADD = ../libdap.la $(AM_LDADD) generalUtilTest_SOURCES = generalUtilTest.cc generalUtilTest_LDADD = ../libdap.la $(AM_LDADD) HTTPCacheTest_SOURCES = HTTPCacheTest.cc +HTTPCacheTest_CPPFLAGS = $(AM_CPPFLAGS) $(CURL_CFLAGS) HTTPCacheTest_LDADD = ../libdapclient.la ../libdap.la $(AM_LDADD) HTTPConnectTest_SOURCES = HTTPConnectTest.cc +HTTPConnectTest_CPPFLAGS = $(AM_CPPFLAGS) $(CURL_CFLAGS) HTTPConnectTest_LDADD = ../libdapclient.la ../libdap.la $(AM_LDADD) parserUtilTest_SOURCES = parserUtilTest.cc @@ -147,20 +153,30 @@ sequenceT_SOURCES = sequenceT.cc sequenceT_LDADD = ../tests/libtest-types.a ../libdap.la $(AM_LDADD) -ddsT_SOURCES = ddsT.cc +ddsT_SOURCES = ddsT.cc $(TEST_SRC) ddsT_LDADD = ../tests/libtest-types.a ../libdap.la $(AM_LDADD) -dasT_SOURCES = dasT.cc +dasT_SOURCES = dasT.cc $(TEST_SRC) dasT_LDADD = ../tests/libtest-types.a ../libdap.la $(AM_LDADD) -CEFunctionsTest_SOURCES = CEFunctionsTest.cc -CEFunctionsTest_LDADD = ../tests/libtest-types.a ../libdap.la $(AM_LDADD) +ServerFunctionsListUnitTest_SOURCES = ServerFunctionsListUnitTest.cc +ServerFunctionsListUnitTest_LDADD = ../libdap.la $(AM_LDADD) -GridGeoConstraintTest_SOURCES = GridGeoConstraintTest.cc -GridGeoConstraintTest_LDADD = ../tests/libtest-types.a ../libdap.la $(AM_LDADD) +# ResponseCacheTest_SOURCES = ResponseCacheTest.cc +# ResponseCacheTest_LDADD = ../tests/libtest-types.a ../libdapserver.la ../libdap.la $(AM_LDADD) -ArrayGeoConstraintTest_SOURCES = ArrayGeoConstraintTest.cc -ArrayGeoConstraintTest_LDADD = ../tests/libtest-types.a ../libdap.la $(AM_LDADD) +if DAP4_DEFINED -# fdiostreamTest_SOURCES = fdiostreamTest.cc -# fdiostreamTest_LDADD = ../libdapclient.la ../libdap.la $(AM_LDADD) +DAP4MarshallerTest_SOURCES = DAP4MarshallerTest.cc +DAP4MarshallerTest_LDADD = ../libdap.la $(AM_LDADD) + +DAP4UnMarshallerTest_SOURCES = DAP4UnMarshallerTest.cc +DAP4UnMarshallerTest_LDADD = ../libdap.la $(AM_LDADD) + +D4DimensionsTest_SOURCES = D4DimensionsTest.cc $(TEST_SRC) +D4DimensionsTest_LDADD = ../libdap.la $(AM_LDADD) + +D4EnumDefsTest_SOURCES = D4EnumDefsTest.cc $(TEST_SRC) +D4EnumDefsTest_LDADD = ../libdap.la $(AM_LDADD) + +endif diff -Nru libdap-3.11.1/unit-tests/Makefile.in libdap-3.12.0/unit-tests/Makefile.in --- libdap-3.11.1/unit-tests/Makefile.in 2011-05-06 17:36:29.000000000 +0000 +++ libdap-3.12.0/unit-tests/Makefile.in 2013-10-17 21:27:40.000000000 +0000 @@ -1,9 +1,9 @@ -# Makefile.in generated by automake 1.11 from Makefile.am. +# Makefile.in generated by automake 1.12 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, -# 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, -# Inc. +# 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software +# Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. @@ -16,6 +16,23 @@ @SET_MAKE@ VPATH = @srcdir@ +am__make_dryrun = \ + { \ + am__dry=no; \ + case $$MAKEFLAGS in \ + *\\[\ \ ]*) \ + echo 'am--echo: ; @echo "AM" OK' | $(MAKE) -f - 2>/dev/null \ + | grep '^AM OK$$' >/dev/null || am__dry=yes;; \ + *) \ + for am__flg in $$MAKEFLAGS; do \ + case $$am__flg in \ + *=*|--*) ;; \ + *n*) am__dry=yes; break;; \ + esac; \ + done;; \ + esac; \ + test $$am__dry = yes; \ + } pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ @@ -35,15 +52,20 @@ host_triplet = @host@ @CPPUNIT_TRUE@am__append_1 = $(CPPUNIT_CFLAGS) @CPPUNIT_TRUE@am__append_2 = $(CPPUNIT_LIBS) -check_PROGRAMS = $(am__EXEEXT_1) -TESTS = $(am__EXEEXT_1) +check_PROGRAMS = $(am__EXEEXT_2) +TESTS = $(am__EXEEXT_2) + +# ResponseBuilderTest ResponseCacheTest Keywords2Test DODSFilterTest +@CPPUNIT_TRUE@@DAP4_DEFINED_TRUE@am__append_3 = DAP4MarshallerTest DAP4UnMarshallerTest \ +@CPPUNIT_TRUE@@DAP4_DEFINED_TRUE@ D4DimensionsTest D4EnumDefsTest + subdir = unit-tests DIST_COMMON = $(noinst_HEADERS) $(srcdir)/Makefile.am \ - $(srcdir)/Makefile.in + $(srcdir)/Makefile.in $(top_srcdir)/conf/depcomp ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/gl/m4/00gnulib.m4 \ $(top_srcdir)/gl/m4/alloca.m4 $(top_srcdir)/gl/m4/btowc.m4 \ - $(top_srcdir)/gl/m4/codeset.m4 \ + $(top_srcdir)/gl/m4/byteswap.m4 $(top_srcdir)/gl/m4/codeset.m4 \ $(top_srcdir)/gl/m4/configmake.m4 \ $(top_srcdir)/gl/m4/extensions.m4 \ $(top_srcdir)/gl/m4/fcntl-o.m4 $(top_srcdir)/gl/m4/glibc21.m4 \ @@ -56,22 +78,27 @@ $(top_srcdir)/gl/m4/locale-fr.m4 \ $(top_srcdir)/gl/m4/locale-ja.m4 \ $(top_srcdir)/gl/m4/locale-zh.m4 \ + $(top_srcdir)/gl/m4/locale_h.m4 \ + $(top_srcdir)/gl/m4/localeconv.m4 \ $(top_srcdir)/gl/m4/longlong.m4 $(top_srcdir)/gl/m4/malloc.m4 \ $(top_srcdir)/gl/m4/mbrtowc.m4 $(top_srcdir)/gl/m4/mbsinit.m4 \ - $(top_srcdir)/gl/m4/mbstate_t.m4 \ + $(top_srcdir)/gl/m4/mbstate_t.m4 $(top_srcdir)/gl/m4/mbtowc.m4 \ $(top_srcdir)/gl/m4/multiarch.m4 \ $(top_srcdir)/gl/m4/nl_langinfo.m4 \ - $(top_srcdir)/gl/m4/regex.m4 $(top_srcdir)/gl/m4/ssize_t.m4 \ - $(top_srcdir)/gl/m4/stdbool.m4 $(top_srcdir)/gl/m4/stddef_h.m4 \ - $(top_srcdir)/gl/m4/stdint.m4 $(top_srcdir)/gl/m4/stdlib_h.m4 \ + $(top_srcdir)/gl/m4/off_t.m4 $(top_srcdir)/gl/m4/regex.m4 \ + $(top_srcdir)/gl/m4/ssize_t.m4 $(top_srcdir)/gl/m4/stdbool.m4 \ + $(top_srcdir)/gl/m4/stddef_h.m4 $(top_srcdir)/gl/m4/stdint.m4 \ + $(top_srcdir)/gl/m4/stdlib_h.m4 $(top_srcdir)/gl/m4/strcase.m4 \ + $(top_srcdir)/gl/m4/strings_h.m4 \ + $(top_srcdir)/gl/m4/sys_types_h.m4 \ $(top_srcdir)/gl/m4/unistd_h.m4 \ $(top_srcdir)/gl/m4/warn-on-use.m4 \ $(top_srcdir)/gl/m4/wchar_h.m4 $(top_srcdir)/gl/m4/wchar_t.m4 \ $(top_srcdir)/gl/m4/wcrtomb.m4 $(top_srcdir)/gl/m4/wctype_h.m4 \ $(top_srcdir)/gl/m4/wint_t.m4 $(top_srcdir)/conf/acinclude.m4 \ - $(top_srcdir)/conf/check_zlib.m4 $(top_srcdir)/conf/cppunit.m4 \ - $(top_srcdir)/conf/libtool.m4 $(top_srcdir)/conf/ltoptions.m4 \ - $(top_srcdir)/conf/ltsugar.m4 $(top_srcdir)/conf/ltversion.m4 \ + $(top_srcdir)/conf/cppunit.m4 $(top_srcdir)/conf/libtool.m4 \ + $(top_srcdir)/conf/ltoptions.m4 $(top_srcdir)/conf/ltsugar.m4 \ + $(top_srcdir)/conf/ltversion.m4 \ $(top_srcdir)/conf/lt~obsolete.m4 $(top_srcdir)/conf/pkg.m4 \ $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ @@ -82,72 +109,82 @@ $(top_builddir)/xdr-datatypes-config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = -@CPPUNIT_TRUE@am__EXEEXT_1 = marshT$(EXEEXT) arrayT$(EXEEXT) \ +@CPPUNIT_TRUE@@DAP4_DEFINED_TRUE@am__EXEEXT_1 = \ +@CPPUNIT_TRUE@@DAP4_DEFINED_TRUE@ DAP4MarshallerTest$(EXEEXT) \ +@CPPUNIT_TRUE@@DAP4_DEFINED_TRUE@ DAP4UnMarshallerTest$(EXEEXT) \ +@CPPUNIT_TRUE@@DAP4_DEFINED_TRUE@ D4DimensionsTest$(EXEEXT) \ +@CPPUNIT_TRUE@@DAP4_DEFINED_TRUE@ D4EnumDefsTest$(EXEEXT) +@CPPUNIT_TRUE@am__EXEEXT_2 = marshT$(EXEEXT) arrayT$(EXEEXT) \ @CPPUNIT_TRUE@ attrTableT$(EXEEXT) structT$(EXEEXT) \ @CPPUNIT_TRUE@ sequenceT$(EXEEXT) ddsT$(EXEEXT) dasT$(EXEEXT) \ @CPPUNIT_TRUE@ RegexTest$(EXEEXT) ArrayTest$(EXEEXT) \ @CPPUNIT_TRUE@ AttrTableTest$(EXEEXT) ByteTest$(EXEEXT) \ @CPPUNIT_TRUE@ MIMEUtilTest$(EXEEXT) ancT$(EXEEXT) \ @CPPUNIT_TRUE@ DASTest$(EXEEXT) DDSTest$(EXEEXT) \ -@CPPUNIT_TRUE@ DDXParserTest$(EXEEXT) DODSFilterTest$(EXEEXT) \ -@CPPUNIT_TRUE@ generalUtilTest$(EXEEXT) HTTPCacheTest$(EXEEXT) \ -@CPPUNIT_TRUE@ HTTPConnectTest$(EXEEXT) parserUtilTest$(EXEEXT) \ -@CPPUNIT_TRUE@ RCReaderTest$(EXEEXT) SequenceTest$(EXEEXT) \ -@CPPUNIT_TRUE@ SignalHandlerTest$(EXEEXT) \ -@CPPUNIT_TRUE@ CEFunctionsTest$(EXEEXT) \ -@CPPUNIT_TRUE@ GridGeoConstraintTest$(EXEEXT) \ -@CPPUNIT_TRUE@ ArrayGeoConstraintTest$(EXEEXT) \ +@CPPUNIT_TRUE@ DDXParserTest$(EXEEXT) generalUtilTest$(EXEEXT) \ +@CPPUNIT_TRUE@ HTTPCacheTest$(EXEEXT) HTTPConnectTest$(EXEEXT) \ +@CPPUNIT_TRUE@ parserUtilTest$(EXEEXT) RCReaderTest$(EXEEXT) \ +@CPPUNIT_TRUE@ SequenceTest$(EXEEXT) SignalHandlerTest$(EXEEXT) \ @CPPUNIT_TRUE@ MarshallerTest$(EXEEXT) \ -@CPPUNIT_TRUE@ ResponseBuilderTest$(EXEEXT) \ -@CPPUNIT_TRUE@ Keywords2Test$(EXEEXT) -am_ArrayGeoConstraintTest_OBJECTS = ArrayGeoConstraintTest.$(OBJEXT) -ArrayGeoConstraintTest_OBJECTS = $(am_ArrayGeoConstraintTest_OBJECTS) +@CPPUNIT_TRUE@ ServerFunctionsListUnitTest$(EXEEXT) \ +@CPPUNIT_TRUE@ $(am__EXEEXT_1) +am_ArrayTest_OBJECTS = ArrayTest.$(OBJEXT) +ArrayTest_OBJECTS = $(am_ArrayTest_OBJECTS) am__DEPENDENCIES_1 = @CPPUNIT_TRUE@am__DEPENDENCIES_2 = $(am__DEPENDENCIES_1) am__DEPENDENCIES_3 = $(am__DEPENDENCIES_2) -ArrayGeoConstraintTest_DEPENDENCIES = ../tests/libtest-types.a \ - ../libdap.la $(am__DEPENDENCIES_3) -am_ArrayTest_OBJECTS = ArrayTest.$(OBJEXT) -ArrayTest_OBJECTS = $(am_ArrayTest_OBJECTS) ArrayTest_DEPENDENCIES = ../libdap.la $(am__DEPENDENCIES_3) -am_AttrTableTest_OBJECTS = AttrTableTest.$(OBJEXT) +am__objects_1 = testFile.$(OBJEXT) +am_AttrTableTest_OBJECTS = AttrTableTest.$(OBJEXT) $(am__objects_1) AttrTableTest_OBJECTS = $(am_AttrTableTest_OBJECTS) AttrTableTest_DEPENDENCIES = ../libdap.la $(am__DEPENDENCIES_3) -am_ByteTest_OBJECTS = ByteTest.$(OBJEXT) +am_ByteTest_OBJECTS = ByteTest.$(OBJEXT) $(am__objects_1) ByteTest_OBJECTS = $(am_ByteTest_OBJECTS) ByteTest_DEPENDENCIES = ../libdap.la $(am__DEPENDENCIES_3) -am_CEFunctionsTest_OBJECTS = CEFunctionsTest.$(OBJEXT) -CEFunctionsTest_OBJECTS = $(am_CEFunctionsTest_OBJECTS) -CEFunctionsTest_DEPENDENCIES = ../tests/libtest-types.a ../libdap.la \ - $(am__DEPENDENCIES_3) +am__D4DimensionsTest_SOURCES_DIST = D4DimensionsTest.cc testFile.cc \ + testFile.h +@DAP4_DEFINED_TRUE@am_D4DimensionsTest_OBJECTS = \ +@DAP4_DEFINED_TRUE@ D4DimensionsTest.$(OBJEXT) $(am__objects_1) +D4DimensionsTest_OBJECTS = $(am_D4DimensionsTest_OBJECTS) +@DAP4_DEFINED_TRUE@D4DimensionsTest_DEPENDENCIES = ../libdap.la \ +@DAP4_DEFINED_TRUE@ $(am__DEPENDENCIES_3) +am__D4EnumDefsTest_SOURCES_DIST = D4EnumDefsTest.cc testFile.cc \ + testFile.h +@DAP4_DEFINED_TRUE@am_D4EnumDefsTest_OBJECTS = \ +@DAP4_DEFINED_TRUE@ D4EnumDefsTest.$(OBJEXT) $(am__objects_1) +D4EnumDefsTest_OBJECTS = $(am_D4EnumDefsTest_OBJECTS) +@DAP4_DEFINED_TRUE@D4EnumDefsTest_DEPENDENCIES = ../libdap.la \ +@DAP4_DEFINED_TRUE@ $(am__DEPENDENCIES_3) +am__DAP4MarshallerTest_SOURCES_DIST = DAP4MarshallerTest.cc +@DAP4_DEFINED_TRUE@am_DAP4MarshallerTest_OBJECTS = \ +@DAP4_DEFINED_TRUE@ DAP4MarshallerTest.$(OBJEXT) +DAP4MarshallerTest_OBJECTS = $(am_DAP4MarshallerTest_OBJECTS) +@DAP4_DEFINED_TRUE@DAP4MarshallerTest_DEPENDENCIES = ../libdap.la \ +@DAP4_DEFINED_TRUE@ $(am__DEPENDENCIES_3) +am__DAP4UnMarshallerTest_SOURCES_DIST = DAP4UnMarshallerTest.cc +@DAP4_DEFINED_TRUE@am_DAP4UnMarshallerTest_OBJECTS = \ +@DAP4_DEFINED_TRUE@ DAP4UnMarshallerTest.$(OBJEXT) +DAP4UnMarshallerTest_OBJECTS = $(am_DAP4UnMarshallerTest_OBJECTS) +@DAP4_DEFINED_TRUE@DAP4UnMarshallerTest_DEPENDENCIES = ../libdap.la \ +@DAP4_DEFINED_TRUE@ $(am__DEPENDENCIES_3) am_DASTest_OBJECTS = DASTest.$(OBJEXT) DASTest_OBJECTS = $(am_DASTest_OBJECTS) DASTest_DEPENDENCIES = ../libdap.la $(am__DEPENDENCIES_3) -am_DDSTest_OBJECTS = DDSTest.$(OBJEXT) +am_DDSTest_OBJECTS = DDSTest.$(OBJEXT) $(am__objects_1) DDSTest_OBJECTS = $(am_DDSTest_OBJECTS) DDSTest_DEPENDENCIES = ../libdap.la $(am__DEPENDENCIES_3) am_DDXParserTest_OBJECTS = DDXParserTest-DDXParserTest.$(OBJEXT) DDXParserTest_OBJECTS = $(am_DDXParserTest_OBJECTS) DDXParserTest_DEPENDENCIES = ../libdap.la $(am__DEPENDENCIES_3) -am_DODSFilterTest_OBJECTS = DODSFilterTest.$(OBJEXT) -DODSFilterTest_OBJECTS = $(am_DODSFilterTest_OBJECTS) -DODSFilterTest_DEPENDENCIES = ../libdapserver.la ../libdap.la \ - ../tests/libtest-types.a $(am__DEPENDENCIES_3) -am_GridGeoConstraintTest_OBJECTS = GridGeoConstraintTest.$(OBJEXT) -GridGeoConstraintTest_OBJECTS = $(am_GridGeoConstraintTest_OBJECTS) -GridGeoConstraintTest_DEPENDENCIES = ../tests/libtest-types.a \ - ../libdap.la $(am__DEPENDENCIES_3) -am_HTTPCacheTest_OBJECTS = HTTPCacheTest.$(OBJEXT) +am_HTTPCacheTest_OBJECTS = HTTPCacheTest-HTTPCacheTest.$(OBJEXT) HTTPCacheTest_OBJECTS = $(am_HTTPCacheTest_OBJECTS) HTTPCacheTest_DEPENDENCIES = ../libdapclient.la ../libdap.la \ $(am__DEPENDENCIES_3) -am_HTTPConnectTest_OBJECTS = HTTPConnectTest.$(OBJEXT) +am_HTTPConnectTest_OBJECTS = \ + HTTPConnectTest-HTTPConnectTest.$(OBJEXT) HTTPConnectTest_OBJECTS = $(am_HTTPConnectTest_OBJECTS) HTTPConnectTest_DEPENDENCIES = ../libdapclient.la ../libdap.la \ $(am__DEPENDENCIES_3) -am_Keywords2Test_OBJECTS = Keywords2Test.$(OBJEXT) -Keywords2Test_OBJECTS = $(am_Keywords2Test_OBJECTS) -Keywords2Test_DEPENDENCIES = ../libdap.la $(am__DEPENDENCIES_3) am_MIMEUtilTest_OBJECTS = MIMEUtilTest.$(OBJEXT) MIMEUtilTest_OBJECTS = $(am_MIMEUtilTest_OBJECTS) MIMEUtilTest_DEPENDENCIES = ../libdap.la $(am__DEPENDENCIES_3) @@ -162,14 +199,16 @@ am_RegexTest_OBJECTS = RegexTest.$(OBJEXT) RegexTest_OBJECTS = $(am_RegexTest_OBJECTS) RegexTest_DEPENDENCIES = ../libdap.la $(am__DEPENDENCIES_3) -am_ResponseBuilderTest_OBJECTS = ResponseBuilderTest.$(OBJEXT) -ResponseBuilderTest_OBJECTS = $(am_ResponseBuilderTest_OBJECTS) -ResponseBuilderTest_DEPENDENCIES = ../libdapserver.la ../libdap.la \ - ../tests/libtest-types.a $(am__DEPENDENCIES_3) am_SequenceTest_OBJECTS = SequenceTest.$(OBJEXT) SequenceTest_OBJECTS = $(am_SequenceTest_OBJECTS) SequenceTest_DEPENDENCIES = ../tests/libtest-types.a ../libdap.la \ $(am__DEPENDENCIES_3) +am_ServerFunctionsListUnitTest_OBJECTS = \ + ServerFunctionsListUnitTest.$(OBJEXT) +ServerFunctionsListUnitTest_OBJECTS = \ + $(am_ServerFunctionsListUnitTest_OBJECTS) +ServerFunctionsListUnitTest_DEPENDENCIES = ../libdap.la \ + $(am__DEPENDENCIES_3) am_SignalHandlerTest_OBJECTS = SignalHandlerTest.$(OBJEXT) SignalHandlerTest_OBJECTS = $(am_SignalHandlerTest_OBJECTS) SignalHandlerTest_DEPENDENCIES = ../libdap.la $(am__DEPENDENCIES_3) @@ -185,11 +224,11 @@ attrTableT_OBJECTS = $(am_attrTableT_OBJECTS) attrTableT_DEPENDENCIES = ../tests/libtest-types.a ../libdap.la \ $(am__DEPENDENCIES_3) -am_dasT_OBJECTS = dasT.$(OBJEXT) +am_dasT_OBJECTS = dasT.$(OBJEXT) $(am__objects_1) dasT_OBJECTS = $(am_dasT_OBJECTS) dasT_DEPENDENCIES = ../tests/libtest-types.a ../libdap.la \ $(am__DEPENDENCIES_3) -am_ddsT_OBJECTS = ddsT.$(OBJEXT) +am_ddsT_OBJECTS = ddsT.$(OBJEXT) $(am__objects_1) ddsT_OBJECTS = $(am_ddsT_OBJECTS) ddsT_DEPENDENCIES = ../tests/libtest-types.a ../libdap.la \ $(am__DEPENDENCIES_3) @@ -224,34 +263,44 @@ CXXLINK = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=link $(CXXLD) $(AM_CXXFLAGS) $(CXXFLAGS) $(AM_LDFLAGS) \ $(LDFLAGS) -o $@ -SOURCES = $(ArrayGeoConstraintTest_SOURCES) $(ArrayTest_SOURCES) \ - $(AttrTableTest_SOURCES) $(ByteTest_SOURCES) \ - $(CEFunctionsTest_SOURCES) $(DASTest_SOURCES) \ +COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ + $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) +LTCOMPILE = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ + --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ + $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) +CCLD = $(CC) +LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ + --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \ + $(LDFLAGS) -o $@ +SOURCES = $(ArrayTest_SOURCES) $(AttrTableTest_SOURCES) \ + $(ByteTest_SOURCES) $(D4DimensionsTest_SOURCES) \ + $(D4EnumDefsTest_SOURCES) $(DAP4MarshallerTest_SOURCES) \ + $(DAP4UnMarshallerTest_SOURCES) $(DASTest_SOURCES) \ $(DDSTest_SOURCES) $(DDXParserTest_SOURCES) \ - $(DODSFilterTest_SOURCES) $(GridGeoConstraintTest_SOURCES) \ $(HTTPCacheTest_SOURCES) $(HTTPConnectTest_SOURCES) \ - $(Keywords2Test_SOURCES) $(MIMEUtilTest_SOURCES) \ - $(MarshallerTest_SOURCES) $(RCReaderTest_SOURCES) \ - $(RegexTest_SOURCES) $(ResponseBuilderTest_SOURCES) \ - $(SequenceTest_SOURCES) $(SignalHandlerTest_SOURCES) \ - $(ancT_SOURCES) $(arrayT_SOURCES) $(attrTableT_SOURCES) \ - $(dasT_SOURCES) $(ddsT_SOURCES) $(generalUtilTest_SOURCES) \ - $(marshT_SOURCES) $(parserUtilTest_SOURCES) \ - $(sequenceT_SOURCES) $(structT_SOURCES) -DIST_SOURCES = $(ArrayGeoConstraintTest_SOURCES) $(ArrayTest_SOURCES) \ - $(AttrTableTest_SOURCES) $(ByteTest_SOURCES) \ - $(CEFunctionsTest_SOURCES) $(DASTest_SOURCES) \ + $(MIMEUtilTest_SOURCES) $(MarshallerTest_SOURCES) \ + $(RCReaderTest_SOURCES) $(RegexTest_SOURCES) \ + $(SequenceTest_SOURCES) $(ServerFunctionsListUnitTest_SOURCES) \ + $(SignalHandlerTest_SOURCES) $(ancT_SOURCES) $(arrayT_SOURCES) \ + $(attrTableT_SOURCES) $(dasT_SOURCES) $(ddsT_SOURCES) \ + $(generalUtilTest_SOURCES) $(marshT_SOURCES) \ + $(parserUtilTest_SOURCES) $(sequenceT_SOURCES) \ + $(structT_SOURCES) +DIST_SOURCES = $(ArrayTest_SOURCES) $(AttrTableTest_SOURCES) \ + $(ByteTest_SOURCES) $(am__D4DimensionsTest_SOURCES_DIST) \ + $(am__D4EnumDefsTest_SOURCES_DIST) \ + $(am__DAP4MarshallerTest_SOURCES_DIST) \ + $(am__DAP4UnMarshallerTest_SOURCES_DIST) $(DASTest_SOURCES) \ $(DDSTest_SOURCES) $(DDXParserTest_SOURCES) \ - $(DODSFilterTest_SOURCES) $(GridGeoConstraintTest_SOURCES) \ $(HTTPCacheTest_SOURCES) $(HTTPConnectTest_SOURCES) \ - $(Keywords2Test_SOURCES) $(MIMEUtilTest_SOURCES) \ - $(MarshallerTest_SOURCES) $(RCReaderTest_SOURCES) \ - $(RegexTest_SOURCES) $(ResponseBuilderTest_SOURCES) \ - $(SequenceTest_SOURCES) $(SignalHandlerTest_SOURCES) \ - $(ancT_SOURCES) $(arrayT_SOURCES) $(attrTableT_SOURCES) \ - $(dasT_SOURCES) $(ddsT_SOURCES) $(generalUtilTest_SOURCES) \ - $(marshT_SOURCES) $(parserUtilTest_SOURCES) \ - $(sequenceT_SOURCES) $(structT_SOURCES) + $(MIMEUtilTest_SOURCES) $(MarshallerTest_SOURCES) \ + $(RCReaderTest_SOURCES) $(RegexTest_SOURCES) \ + $(SequenceTest_SOURCES) $(ServerFunctionsListUnitTest_SOURCES) \ + $(SignalHandlerTest_SOURCES) $(ancT_SOURCES) $(arrayT_SOURCES) \ + $(attrTableT_SOURCES) $(dasT_SOURCES) $(ddsT_SOURCES) \ + $(generalUtilTest_SOURCES) $(marshT_SOURCES) \ + $(parserUtilTest_SOURCES) $(sequenceT_SOURCES) \ + $(structT_SOURCES) RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \ html-recursive info-recursive install-data-recursive \ install-dvi-recursive install-exec-recursive \ @@ -259,6 +308,11 @@ install-pdf-recursive install-ps-recursive install-recursive \ installcheck-recursive installdirs-recursive pdf-recursive \ ps-recursive uninstall-recursive +am__can_run_installinfo = \ + case $$AM_UPDATE_INFO_DIR in \ + n|no|NO) false;; \ + *) (install-info --version) >/dev/null 2>&1;; \ + esac HEADERS = $(noinst_HEADERS) RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \ distclean-recursive maintainer-clean-recursive @@ -267,8 +321,10 @@ distdir ETAGS = etags CTAGS = ctags -am__tty_colors = \ -red=; grn=; lgn=; blu=; std= +am__tty_colors_dummy = \ + mgn= red= grn= lgn= blu= brg= std=; \ + am__color_tests=no +am__tty_colors = $(am__tty_colors_dummy) DIST_SUBDIRS = $(SUBDIRS) DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) am__relativize = \ @@ -303,6 +359,7 @@ AMTAR = @AMTAR@ APPLE_UNIVERSAL_BUILD = @APPLE_UNIVERSAL_BUILD@ AR = @AR@ +ARFLAGS = @ARFLAGS@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ @@ -312,6 +369,7 @@ BITSIZEOF_SIZE_T = @BITSIZEOF_SIZE_T@ BITSIZEOF_WCHAR_T = @BITSIZEOF_WCHAR_T@ BITSIZEOF_WINT_T = @BITSIZEOF_WINT_T@ +BYTESWAP_H = @BYTESWAP_H@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ @@ -338,6 +396,7 @@ DAP_PROTOCOL_VERSION = @DAP_PROTOCOL_VERSION@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ +DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ DVR = @DVR@ @@ -353,15 +412,20 @@ GNULIB_BTOWC = @GNULIB_BTOWC@ GNULIB_CALLOC_POSIX = @GNULIB_CALLOC_POSIX@ GNULIB_CANONICALIZE_FILE_NAME = @GNULIB_CANONICALIZE_FILE_NAME@ +GNULIB_CHDIR = @GNULIB_CHDIR@ GNULIB_CHOWN = @GNULIB_CHOWN@ GNULIB_CLOSE = @GNULIB_CLOSE@ +GNULIB_DUP = @GNULIB_DUP@ GNULIB_DUP2 = @GNULIB_DUP2@ GNULIB_DUP3 = @GNULIB_DUP3@ +GNULIB_DUPLOCALE = @GNULIB_DUPLOCALE@ GNULIB_ENVIRON = @GNULIB_ENVIRON@ GNULIB_EUIDACCESS = @GNULIB_EUIDACCESS@ GNULIB_FACCESSAT = @GNULIB_FACCESSAT@ GNULIB_FCHDIR = @GNULIB_FCHDIR@ GNULIB_FCHOWNAT = @GNULIB_FCHOWNAT@ +GNULIB_FDATASYNC = @GNULIB_FDATASYNC@ +GNULIB_FFS = @GNULIB_FFS@ GNULIB_FSYNC = @GNULIB_FSYNC@ GNULIB_FTRUNCATE = @GNULIB_FTRUNCATE@ GNULIB_GETCWD = @GNULIB_GETCWD@ @@ -376,9 +440,14 @@ GNULIB_GETSUBOPT = @GNULIB_GETSUBOPT@ GNULIB_GETUSERSHELL = @GNULIB_GETUSERSHELL@ GNULIB_GRANTPT = @GNULIB_GRANTPT@ +GNULIB_GROUP_MEMBER = @GNULIB_GROUP_MEMBER@ +GNULIB_ISATTY = @GNULIB_ISATTY@ +GNULIB_ISWBLANK = @GNULIB_ISWBLANK@ +GNULIB_ISWCTYPE = @GNULIB_ISWCTYPE@ GNULIB_LCHOWN = @GNULIB_LCHOWN@ GNULIB_LINK = @GNULIB_LINK@ GNULIB_LINKAT = @GNULIB_LINKAT@ +GNULIB_LOCALECONV = @GNULIB_LOCALECONV@ GNULIB_LSEEK = @GNULIB_LSEEK@ GNULIB_MALLOC_POSIX = @GNULIB_MALLOC_POSIX@ GNULIB_MBRLEN = @GNULIB_MBRLEN@ @@ -386,6 +455,7 @@ GNULIB_MBSINIT = @GNULIB_MBSINIT@ GNULIB_MBSNRTOWCS = @GNULIB_MBSNRTOWCS@ GNULIB_MBSRTOWCS = @GNULIB_MBSRTOWCS@ +GNULIB_MBTOWC = @GNULIB_MBTOWC@ GNULIB_MKDTEMP = @GNULIB_MKDTEMP@ GNULIB_MKOSTEMP = @GNULIB_MKOSTEMP@ GNULIB_MKOSTEMPS = @GNULIB_MKOSTEMPS@ @@ -394,11 +464,15 @@ GNULIB_NL_LANGINFO = @GNULIB_NL_LANGINFO@ GNULIB_PIPE = @GNULIB_PIPE@ GNULIB_PIPE2 = @GNULIB_PIPE2@ +GNULIB_POSIX_OPENPT = @GNULIB_POSIX_OPENPT@ GNULIB_PREAD = @GNULIB_PREAD@ GNULIB_PTSNAME = @GNULIB_PTSNAME@ +GNULIB_PTSNAME_R = @GNULIB_PTSNAME_R@ GNULIB_PUTENV = @GNULIB_PUTENV@ GNULIB_PWRITE = @GNULIB_PWRITE@ +GNULIB_RANDOM = @GNULIB_RANDOM@ GNULIB_RANDOM_R = @GNULIB_RANDOM_R@ +GNULIB_READ = @GNULIB_READ@ GNULIB_READLINK = @GNULIB_READLINK@ GNULIB_READLINKAT = @GNULIB_READLINKAT@ GNULIB_REALLOC_POSIX = @GNULIB_REALLOC_POSIX@ @@ -406,6 +480,8 @@ GNULIB_RMDIR = @GNULIB_RMDIR@ GNULIB_RPMATCH = @GNULIB_RPMATCH@ GNULIB_SETENV = @GNULIB_SETENV@ +GNULIB_SETHOSTNAME = @GNULIB_SETHOSTNAME@ +GNULIB_SETLOCALE = @GNULIB_SETLOCALE@ GNULIB_SLEEP = @GNULIB_SLEEP@ GNULIB_STRTOD = @GNULIB_STRTOD@ GNULIB_STRTOLL = @GNULIB_STRTOLL@ @@ -413,19 +489,51 @@ GNULIB_SYMLINK = @GNULIB_SYMLINK@ GNULIB_SYMLINKAT = @GNULIB_SYMLINKAT@ GNULIB_SYSTEM_POSIX = @GNULIB_SYSTEM_POSIX@ +GNULIB_TOWCTRANS = @GNULIB_TOWCTRANS@ GNULIB_TTYNAME_R = @GNULIB_TTYNAME_R@ -GNULIB_UNISTD_H_GETOPT = @GNULIB_UNISTD_H_GETOPT@ +GNULIB_UNISTD_H_NONBLOCKING = @GNULIB_UNISTD_H_NONBLOCKING@ GNULIB_UNISTD_H_SIGPIPE = @GNULIB_UNISTD_H_SIGPIPE@ GNULIB_UNLINK = @GNULIB_UNLINK@ GNULIB_UNLINKAT = @GNULIB_UNLINKAT@ GNULIB_UNLOCKPT = @GNULIB_UNLOCKPT@ GNULIB_UNSETENV = @GNULIB_UNSETENV@ GNULIB_USLEEP = @GNULIB_USLEEP@ +GNULIB_WCPCPY = @GNULIB_WCPCPY@ +GNULIB_WCPNCPY = @GNULIB_WCPNCPY@ GNULIB_WCRTOMB = @GNULIB_WCRTOMB@ +GNULIB_WCSCASECMP = @GNULIB_WCSCASECMP@ +GNULIB_WCSCAT = @GNULIB_WCSCAT@ +GNULIB_WCSCHR = @GNULIB_WCSCHR@ +GNULIB_WCSCMP = @GNULIB_WCSCMP@ +GNULIB_WCSCOLL = @GNULIB_WCSCOLL@ +GNULIB_WCSCPY = @GNULIB_WCSCPY@ +GNULIB_WCSCSPN = @GNULIB_WCSCSPN@ +GNULIB_WCSDUP = @GNULIB_WCSDUP@ +GNULIB_WCSLEN = @GNULIB_WCSLEN@ +GNULIB_WCSNCASECMP = @GNULIB_WCSNCASECMP@ +GNULIB_WCSNCAT = @GNULIB_WCSNCAT@ +GNULIB_WCSNCMP = @GNULIB_WCSNCMP@ +GNULIB_WCSNCPY = @GNULIB_WCSNCPY@ +GNULIB_WCSNLEN = @GNULIB_WCSNLEN@ GNULIB_WCSNRTOMBS = @GNULIB_WCSNRTOMBS@ +GNULIB_WCSPBRK = @GNULIB_WCSPBRK@ +GNULIB_WCSRCHR = @GNULIB_WCSRCHR@ GNULIB_WCSRTOMBS = @GNULIB_WCSRTOMBS@ +GNULIB_WCSSPN = @GNULIB_WCSSPN@ +GNULIB_WCSSTR = @GNULIB_WCSSTR@ +GNULIB_WCSTOK = @GNULIB_WCSTOK@ +GNULIB_WCSWIDTH = @GNULIB_WCSWIDTH@ +GNULIB_WCSXFRM = @GNULIB_WCSXFRM@ GNULIB_WCTOB = @GNULIB_WCTOB@ +GNULIB_WCTOMB = @GNULIB_WCTOMB@ +GNULIB_WCTRANS = @GNULIB_WCTRANS@ +GNULIB_WCTYPE = @GNULIB_WCTYPE@ GNULIB_WCWIDTH = @GNULIB_WCWIDTH@ +GNULIB_WMEMCHR = @GNULIB_WMEMCHR@ +GNULIB_WMEMCMP = @GNULIB_WMEMCMP@ +GNULIB_WMEMCPY = @GNULIB_WMEMCPY@ +GNULIB_WMEMMOVE = @GNULIB_WMEMMOVE@ +GNULIB_WMEMSET = @GNULIB_WMEMSET@ GNULIB_WRITE = @GNULIB_WRITE@ GNULIB__EXIT = @GNULIB__EXIT@ GREP = @GREP@ @@ -435,23 +543,29 @@ HAVE_CHOWN = @HAVE_CHOWN@ HAVE_DECL_ENVIRON = @HAVE_DECL_ENVIRON@ HAVE_DECL_FCHDIR = @HAVE_DECL_FCHDIR@ +HAVE_DECL_FDATASYNC = @HAVE_DECL_FDATASYNC@ HAVE_DECL_GETDOMAINNAME = @HAVE_DECL_GETDOMAINNAME@ HAVE_DECL_GETLOADAVG = @HAVE_DECL_GETLOADAVG@ HAVE_DECL_GETLOGIN_R = @HAVE_DECL_GETLOGIN_R@ HAVE_DECL_GETPAGESIZE = @HAVE_DECL_GETPAGESIZE@ HAVE_DECL_GETUSERSHELL = @HAVE_DECL_GETUSERSHELL@ HAVE_DECL_SETENV = @HAVE_DECL_SETENV@ +HAVE_DECL_SETHOSTNAME = @HAVE_DECL_SETHOSTNAME@ +HAVE_DECL_STRNCASECMP = @HAVE_DECL_STRNCASECMP@ HAVE_DECL_TTYNAME_R = @HAVE_DECL_TTYNAME_R@ HAVE_DECL_UNSETENV = @HAVE_DECL_UNSETENV@ HAVE_DECL_WCTOB = @HAVE_DECL_WCTOB@ HAVE_DECL_WCWIDTH = @HAVE_DECL_WCWIDTH@ HAVE_DUP2 = @HAVE_DUP2@ HAVE_DUP3 = @HAVE_DUP3@ +HAVE_DUPLOCALE = @HAVE_DUPLOCALE@ HAVE_EUIDACCESS = @HAVE_EUIDACCESS@ HAVE_FACCESSAT = @HAVE_FACCESSAT@ HAVE_FCHDIR = @HAVE_FCHDIR@ HAVE_FCHOWNAT = @HAVE_FCHOWNAT@ +HAVE_FDATASYNC = @HAVE_FDATASYNC@ HAVE_FEATURES_H = @HAVE_FEATURES_H@ +HAVE_FFS = @HAVE_FFS@ HAVE_FSYNC = @HAVE_FSYNC@ HAVE_FTRUNCATE = @HAVE_FTRUNCATE@ HAVE_GETDTABLESIZE = @HAVE_GETDTABLESIZE@ @@ -461,6 +575,7 @@ HAVE_GETPAGESIZE = @HAVE_GETPAGESIZE@ HAVE_GETSUBOPT = @HAVE_GETSUBOPT@ HAVE_GRANTPT = @HAVE_GRANTPT@ +HAVE_GROUP_MEMBER = @HAVE_GROUP_MEMBER@ HAVE_INTTYPES_H = @HAVE_INTTYPES_H@ HAVE_ISWBLANK = @HAVE_ISWBLANK@ HAVE_ISWCNTRL = @HAVE_ISWCNTRL@ @@ -487,9 +602,12 @@ HAVE_OS_H = @HAVE_OS_H@ HAVE_PIPE = @HAVE_PIPE@ HAVE_PIPE2 = @HAVE_PIPE2@ +HAVE_POSIX_OPENPT = @HAVE_POSIX_OPENPT@ HAVE_PREAD = @HAVE_PREAD@ HAVE_PTSNAME = @HAVE_PTSNAME@ +HAVE_PTSNAME_R = @HAVE_PTSNAME_R@ HAVE_PWRITE = @HAVE_PWRITE@ +HAVE_RANDOM = @HAVE_RANDOM@ HAVE_RANDOM_H = @HAVE_RANDOM_H@ HAVE_RANDOM_R = @HAVE_RANDOM_R@ HAVE_READLINK = @HAVE_READLINK@ @@ -497,11 +615,14 @@ HAVE_REALPATH = @HAVE_REALPATH@ HAVE_RPMATCH = @HAVE_RPMATCH@ HAVE_SETENV = @HAVE_SETENV@ +HAVE_SETHOSTNAME = @HAVE_SETHOSTNAME@ HAVE_SIGNED_SIG_ATOMIC_T = @HAVE_SIGNED_SIG_ATOMIC_T@ HAVE_SIGNED_WCHAR_T = @HAVE_SIGNED_WCHAR_T@ HAVE_SIGNED_WINT_T = @HAVE_SIGNED_WINT_T@ HAVE_SLEEP = @HAVE_SLEEP@ HAVE_STDINT_H = @HAVE_STDINT_H@ +HAVE_STRCASECMP = @HAVE_STRCASECMP@ +HAVE_STRINGS_H = @HAVE_STRINGS_H@ HAVE_STRTOD = @HAVE_STRTOD@ HAVE_STRTOLL = @HAVE_STRTOLL@ HAVE_STRTOULL = @HAVE_STRTOULL@ @@ -520,11 +641,42 @@ HAVE_USLEEP = @HAVE_USLEEP@ HAVE_WCHAR_H = @HAVE_WCHAR_H@ HAVE_WCHAR_T = @HAVE_WCHAR_T@ +HAVE_WCPCPY = @HAVE_WCPCPY@ +HAVE_WCPNCPY = @HAVE_WCPNCPY@ HAVE_WCRTOMB = @HAVE_WCRTOMB@ +HAVE_WCSCASECMP = @HAVE_WCSCASECMP@ +HAVE_WCSCAT = @HAVE_WCSCAT@ +HAVE_WCSCHR = @HAVE_WCSCHR@ +HAVE_WCSCMP = @HAVE_WCSCMP@ +HAVE_WCSCOLL = @HAVE_WCSCOLL@ +HAVE_WCSCPY = @HAVE_WCSCPY@ +HAVE_WCSCSPN = @HAVE_WCSCSPN@ +HAVE_WCSDUP = @HAVE_WCSDUP@ +HAVE_WCSLEN = @HAVE_WCSLEN@ +HAVE_WCSNCASECMP = @HAVE_WCSNCASECMP@ +HAVE_WCSNCAT = @HAVE_WCSNCAT@ +HAVE_WCSNCMP = @HAVE_WCSNCMP@ +HAVE_WCSNCPY = @HAVE_WCSNCPY@ +HAVE_WCSNLEN = @HAVE_WCSNLEN@ HAVE_WCSNRTOMBS = @HAVE_WCSNRTOMBS@ +HAVE_WCSPBRK = @HAVE_WCSPBRK@ +HAVE_WCSRCHR = @HAVE_WCSRCHR@ HAVE_WCSRTOMBS = @HAVE_WCSRTOMBS@ +HAVE_WCSSPN = @HAVE_WCSSPN@ +HAVE_WCSSTR = @HAVE_WCSSTR@ +HAVE_WCSTOK = @HAVE_WCSTOK@ +HAVE_WCSWIDTH = @HAVE_WCSWIDTH@ +HAVE_WCSXFRM = @HAVE_WCSXFRM@ +HAVE_WCTRANS_T = @HAVE_WCTRANS_T@ HAVE_WCTYPE_H = @HAVE_WCTYPE_H@ +HAVE_WCTYPE_T = @HAVE_WCTYPE_T@ HAVE_WINT_T = @HAVE_WINT_T@ +HAVE_WMEMCHR = @HAVE_WMEMCHR@ +HAVE_WMEMCMP = @HAVE_WMEMCMP@ +HAVE_WMEMCPY = @HAVE_WMEMCPY@ +HAVE_WMEMMOVE = @HAVE_WMEMMOVE@ +HAVE_WMEMSET = @HAVE_WMEMSET@ +HAVE_XLOCALE_H = @HAVE_XLOCALE_H@ HAVE__BOOL = @HAVE__BOOL@ HAVE__EXIT = @HAVE__EXIT@ INCLUDE_NEXT = @INCLUDE_NEXT@ @@ -554,18 +706,25 @@ LTLIBINTL = @LTLIBINTL@ LTLIBOBJS = @LTLIBOBJS@ MAKEINFO = @MAKEINFO@ +MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ NEXT_AS_FIRST_DIRECTIVE_LANGINFO_H = @NEXT_AS_FIRST_DIRECTIVE_LANGINFO_H@ +NEXT_AS_FIRST_DIRECTIVE_LOCALE_H = @NEXT_AS_FIRST_DIRECTIVE_LOCALE_H@ NEXT_AS_FIRST_DIRECTIVE_STDDEF_H = @NEXT_AS_FIRST_DIRECTIVE_STDDEF_H@ NEXT_AS_FIRST_DIRECTIVE_STDINT_H = @NEXT_AS_FIRST_DIRECTIVE_STDINT_H@ NEXT_AS_FIRST_DIRECTIVE_STDLIB_H = @NEXT_AS_FIRST_DIRECTIVE_STDLIB_H@ +NEXT_AS_FIRST_DIRECTIVE_STRINGS_H = @NEXT_AS_FIRST_DIRECTIVE_STRINGS_H@ +NEXT_AS_FIRST_DIRECTIVE_SYS_TYPES_H = @NEXT_AS_FIRST_DIRECTIVE_SYS_TYPES_H@ NEXT_AS_FIRST_DIRECTIVE_UNISTD_H = @NEXT_AS_FIRST_DIRECTIVE_UNISTD_H@ NEXT_AS_FIRST_DIRECTIVE_WCHAR_H = @NEXT_AS_FIRST_DIRECTIVE_WCHAR_H@ NEXT_AS_FIRST_DIRECTIVE_WCTYPE_H = @NEXT_AS_FIRST_DIRECTIVE_WCTYPE_H@ NEXT_LANGINFO_H = @NEXT_LANGINFO_H@ +NEXT_LOCALE_H = @NEXT_LOCALE_H@ NEXT_STDDEF_H = @NEXT_STDDEF_H@ NEXT_STDINT_H = @NEXT_STDINT_H@ NEXT_STDLIB_H = @NEXT_STDLIB_H@ +NEXT_STRINGS_H = @NEXT_STRINGS_H@ +NEXT_SYS_TYPES_H = @NEXT_SYS_TYPES_H@ NEXT_UNISTD_H = @NEXT_UNISTD_H@ NEXT_WCHAR_H = @NEXT_WCHAR_H@ NEXT_WCTYPE_H = @NEXT_WCTYPE_H@ @@ -599,17 +758,21 @@ REPLACE_CLOSE = @REPLACE_CLOSE@ REPLACE_DUP = @REPLACE_DUP@ REPLACE_DUP2 = @REPLACE_DUP2@ +REPLACE_DUPLOCALE = @REPLACE_DUPLOCALE@ REPLACE_FCHOWNAT = @REPLACE_FCHOWNAT@ +REPLACE_FTRUNCATE = @REPLACE_FTRUNCATE@ REPLACE_GETCWD = @REPLACE_GETCWD@ REPLACE_GETDOMAINNAME = @REPLACE_GETDOMAINNAME@ REPLACE_GETGROUPS = @REPLACE_GETGROUPS@ REPLACE_GETLOGIN_R = @REPLACE_GETLOGIN_R@ REPLACE_GETPAGESIZE = @REPLACE_GETPAGESIZE@ +REPLACE_ISATTY = @REPLACE_ISATTY@ REPLACE_ISWBLANK = @REPLACE_ISWBLANK@ REPLACE_ISWCNTRL = @REPLACE_ISWCNTRL@ REPLACE_LCHOWN = @REPLACE_LCHOWN@ REPLACE_LINK = @REPLACE_LINK@ REPLACE_LINKAT = @REPLACE_LINKAT@ +REPLACE_LOCALECONV = @REPLACE_LOCALECONV@ REPLACE_LSEEK = @REPLACE_LSEEK@ REPLACE_MALLOC = @REPLACE_MALLOC@ REPLACE_MBRLEN = @REPLACE_MBRLEN@ @@ -618,20 +781,27 @@ REPLACE_MBSNRTOWCS = @REPLACE_MBSNRTOWCS@ REPLACE_MBSRTOWCS = @REPLACE_MBSRTOWCS@ REPLACE_MBSTATE_T = @REPLACE_MBSTATE_T@ +REPLACE_MBTOWC = @REPLACE_MBTOWC@ REPLACE_MKSTEMP = @REPLACE_MKSTEMP@ REPLACE_NL_LANGINFO = @REPLACE_NL_LANGINFO@ REPLACE_NULL = @REPLACE_NULL@ REPLACE_PREAD = @REPLACE_PREAD@ +REPLACE_PTSNAME_R = @REPLACE_PTSNAME_R@ REPLACE_PUTENV = @REPLACE_PUTENV@ REPLACE_PWRITE = @REPLACE_PWRITE@ +REPLACE_RANDOM_R = @REPLACE_RANDOM_R@ +REPLACE_READ = @REPLACE_READ@ REPLACE_READLINK = @REPLACE_READLINK@ REPLACE_REALLOC = @REPLACE_REALLOC@ REPLACE_REALPATH = @REPLACE_REALPATH@ REPLACE_RMDIR = @REPLACE_RMDIR@ REPLACE_SETENV = @REPLACE_SETENV@ +REPLACE_SETLOCALE = @REPLACE_SETLOCALE@ REPLACE_SLEEP = @REPLACE_SLEEP@ REPLACE_STRTOD = @REPLACE_STRTOD@ +REPLACE_STRUCT_LCONV = @REPLACE_STRUCT_LCONV@ REPLACE_SYMLINK = @REPLACE_SYMLINK@ +REPLACE_TOWLOWER = @REPLACE_TOWLOWER@ REPLACE_TTYNAME_R = @REPLACE_TTYNAME_R@ REPLACE_UNLINK = @REPLACE_UNLINK@ REPLACE_UNLINKAT = @REPLACE_UNLINKAT@ @@ -640,7 +810,9 @@ REPLACE_WCRTOMB = @REPLACE_WCRTOMB@ REPLACE_WCSNRTOMBS = @REPLACE_WCSNRTOMBS@ REPLACE_WCSRTOMBS = @REPLACE_WCSRTOMBS@ +REPLACE_WCSWIDTH = @REPLACE_WCSWIDTH@ REPLACE_WCTOB = @REPLACE_WCTOB@ +REPLACE_WCTOMB = @REPLACE_WCTOMB@ REPLACE_WCWIDTH = @REPLACE_WCWIDTH@ REPLACE_WRITE = @REPLACE_WRITE@ SED = @SED@ @@ -661,18 +833,16 @@ UUID_LIBS = @UUID_LIBS@ VERSION = @VERSION@ WCHAR_T_SUFFIX = @WCHAR_T_SUFFIX@ +WINDOWS_64_BIT_OFF_T = @WINDOWS_64_BIT_OFF_T@ WINT_T_SUFFIX = @WINT_T_SUFFIX@ XML2_CFLAGS = @XML2_CFLAGS@ XML2_LIBS = @XML2_LIBS@ -XML2_STATIC_LIBS = @XML2_STATIC_LIBS@ YACC = @YACC@ -ZLIB_CFLAGS = @ZLIB_CFLAGS@ -ZLIB_LDFLAGS = @ZLIB_LDFLAGS@ -ZLIB_LIBS = @ZLIB_LIBS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ +ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ @@ -714,7 +884,6 @@ lispdir = @lispdir@ localedir = @localedir@ localstatedir = @localstatedir@ -lt_ECHO = @lt_ECHO@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ @@ -739,44 +908,41 @@ # Headers in 'tests' are used by the arrayT unit tests. AM_CPPFLAGS = -I$(top_srcdir)/GNU -I$(top_srcdir) \ - -I$(top_srcdir)/tests $(am__append_1) + -I$(top_srcdir)/tests $(CURL_CFLAGS) $(XML2_CFLAGS) \ + $(am__append_1) AM_LDADD = $(am__append_2) # These are not used by automake but are often useful for certain types of # debugging. Set CXXFLAGS to this in the nightly build using export ... -CXXFLAGS_DEBUG = -g3 -O0 -fno-defer-pop -Wall -W -Wcast-align -Werror +CXXFLAGS_DEBUG = -g3 -O0 -Wall -W -Wcast-align -Werror TEST_COV_FLAGS = -ftest-coverage -fprofile-arcs noinst_HEADERS = test_config.h DIRS_EXTRA = das-testsuite dds-testsuite ddx-testsuite \ - rcreader-testsuite server-testsuite cgi-util-tests \ - ce-functions-testsuite + rcreader-testsuite server-testsuite cgi-util-tests D4-xml -EXTRA_DIST = $(DIRS_EXTRA) testFile.cc test_config.h.in +EXTRA_DIST = $(DIRS_EXTRA) testFile.cc testFile.h test_config.h.in CLEANFILES = testout .dodsrc *.gcda *.gcno DISTCLEANFILES = test_config.h *.strm *.file tmp.txt - -# fdiostreamTest @CPPUNIT_FALSE@UNIT_TESTS = ############################################################################ # Unit Tests # -@CPPUNIT_TRUE@UNIT_TESTS = marshT arrayT attrTableT structT sequenceT ddsT dasT \ -@CPPUNIT_TRUE@ RegexTest \ -@CPPUNIT_TRUE@ ArrayTest AttrTableTest ByteTest MIMEUtilTest ancT DASTest \ -@CPPUNIT_TRUE@ DDSTest DDXParserTest DODSFilterTest generalUtilTest \ -@CPPUNIT_TRUE@ HTTPCacheTest HTTPConnectTest parserUtilTest RCReaderTest \ -@CPPUNIT_TRUE@ SequenceTest SignalHandlerTest CEFunctionsTest \ -@CPPUNIT_TRUE@ GridGeoConstraintTest ArrayGeoConstraintTest MarshallerTest \ -@CPPUNIT_TRUE@ ResponseBuilderTest Keywords2Test - +@CPPUNIT_TRUE@UNIT_TESTS = marshT arrayT attrTableT structT sequenceT \ +@CPPUNIT_TRUE@ ddsT dasT RegexTest ArrayTest AttrTableTest \ +@CPPUNIT_TRUE@ ByteTest MIMEUtilTest ancT DASTest DDSTest \ +@CPPUNIT_TRUE@ DDXParserTest generalUtilTest HTTPCacheTest \ +@CPPUNIT_TRUE@ HTTPConnectTest parserUtilTest RCReaderTest \ +@CPPUNIT_TRUE@ SequenceTest SignalHandlerTest MarshallerTest \ +@CPPUNIT_TRUE@ ServerFunctionsListUnitTest $(am__append_3) +TEST_SRC = testFile.cc testFile.h RegexTest_SOURCES = RegexTest.cc RegexTest_LDADD = ../libdap.la $(AM_LDADD) ArrayTest_SOURCES = ArrayTest.cc ArrayTest_LDADD = ../libdap.la $(AM_LDADD) -AttrTableTest_SOURCES = AttrTableTest.cc +AttrTableTest_SOURCES = AttrTableTest.cc $(TEST_SRC) AttrTableTest_LDADD = ../libdap.la $(AM_LDADD) -ByteTest_SOURCES = ByteTest.cc +ByteTest_SOURCES = ByteTest.cc $(TEST_SRC) ByteTest_LDADD = ../libdap.la $(AM_LDADD) MIMEUtilTest_SOURCES = MIMEUtilTest.cc MIMEUtilTest_LDADD = ../libdap.la $(AM_LDADD) @@ -784,26 +950,29 @@ ancT_LDADD = ../libdapserver.la ../libdap.la $(AM_LDADD) DASTest_SOURCES = DASTest.cc DASTest_LDADD = ../libdap.la $(AM_LDADD) -DDSTest_SOURCES = DDSTest.cc +DDSTest_SOURCES = DDSTest.cc $(TEST_SRC) DDSTest_LDADD = ../libdap.la $(AM_LDADD) DDXParserTest_SOURCES = DDXParserTest.cc DDXParserTest_CPPFLAGS = $(AM_CPPFLAGS) $(XML2_CFLAGS) DDXParserTest_LDADD = ../libdap.la $(AM_LDADD) -DODSFilterTest_SOURCES = DODSFilterTest.cc -DODSFilterTest_LDADD = ../libdapserver.la ../libdap.la \ - ../tests/libtest-types.a $(AM_LDADD) - -ResponseBuilderTest_SOURCES = ResponseBuilderTest.cc -ResponseBuilderTest_LDADD = ../libdapserver.la ../libdap.la \ - ../tests/libtest-types.a $(AM_LDADD) -Keywords2Test_SOURCES = Keywords2Test.cc -Keywords2Test_LDADD = ../libdap.la $(AM_LDADD) +# DODSFilterTest_SOURCES = DODSFilterTest.cc $(TEST_SRC) +# DODSFilterTest_LDADD = ../libdapserver.la ../libdap.la \ +# ../tests/libtest-types.a $(AM_LDADD) + +# ResponseBuilderTest_SOURCES = ResponseBuilderTest.cc $(TEST_SRC) +# ResponseBuilderTest_LDADD = ../libdapserver.la ../libdap.la \ +# ../tests/libtest-types.a $(AM_LDADD) + +# Keywords2Test_SOURCES = Keywords2Test.cc +# Keywords2Test_LDADD = ../libdap.la $(AM_LDADD) generalUtilTest_SOURCES = generalUtilTest.cc generalUtilTest_LDADD = ../libdap.la $(AM_LDADD) HTTPCacheTest_SOURCES = HTTPCacheTest.cc +HTTPCacheTest_CPPFLAGS = $(AM_CPPFLAGS) $(CURL_CFLAGS) HTTPCacheTest_LDADD = ../libdapclient.la ../libdap.la $(AM_LDADD) HTTPConnectTest_SOURCES = HTTPConnectTest.cc +HTTPConnectTest_CPPFLAGS = $(AM_CPPFLAGS) $(CURL_CFLAGS) HTTPConnectTest_LDADD = ../libdapclient.la ../libdap.la $(AM_LDADD) parserUtilTest_SOURCES = parserUtilTest.cc parserUtilTest_LDADD = ../libdap.la $(AM_LDADD) @@ -825,16 +994,23 @@ structT_LDADD = ../tests/libtest-types.a ../libdap.la $(AM_LDADD) sequenceT_SOURCES = sequenceT.cc sequenceT_LDADD = ../tests/libtest-types.a ../libdap.la $(AM_LDADD) -ddsT_SOURCES = ddsT.cc +ddsT_SOURCES = ddsT.cc $(TEST_SRC) ddsT_LDADD = ../tests/libtest-types.a ../libdap.la $(AM_LDADD) -dasT_SOURCES = dasT.cc +dasT_SOURCES = dasT.cc $(TEST_SRC) dasT_LDADD = ../tests/libtest-types.a ../libdap.la $(AM_LDADD) -CEFunctionsTest_SOURCES = CEFunctionsTest.cc -CEFunctionsTest_LDADD = ../tests/libtest-types.a ../libdap.la $(AM_LDADD) -GridGeoConstraintTest_SOURCES = GridGeoConstraintTest.cc -GridGeoConstraintTest_LDADD = ../tests/libtest-types.a ../libdap.la $(AM_LDADD) -ArrayGeoConstraintTest_SOURCES = ArrayGeoConstraintTest.cc -ArrayGeoConstraintTest_LDADD = ../tests/libtest-types.a ../libdap.la $(AM_LDADD) +ServerFunctionsListUnitTest_SOURCES = ServerFunctionsListUnitTest.cc +ServerFunctionsListUnitTest_LDADD = ../libdap.la $(AM_LDADD) + +# ResponseCacheTest_SOURCES = ResponseCacheTest.cc +# ResponseCacheTest_LDADD = ../tests/libtest-types.a ../libdapserver.la ../libdap.la $(AM_LDADD) +@DAP4_DEFINED_TRUE@DAP4MarshallerTest_SOURCES = DAP4MarshallerTest.cc +@DAP4_DEFINED_TRUE@DAP4MarshallerTest_LDADD = ../libdap.la $(AM_LDADD) +@DAP4_DEFINED_TRUE@DAP4UnMarshallerTest_SOURCES = DAP4UnMarshallerTest.cc +@DAP4_DEFINED_TRUE@DAP4UnMarshallerTest_LDADD = ../libdap.la $(AM_LDADD) +@DAP4_DEFINED_TRUE@D4DimensionsTest_SOURCES = D4DimensionsTest.cc $(TEST_SRC) +@DAP4_DEFINED_TRUE@D4DimensionsTest_LDADD = ../libdap.la $(AM_LDADD) +@DAP4_DEFINED_TRUE@D4EnumDefsTest_SOURCES = D4EnumDefsTest.cc $(TEST_SRC) +@DAP4_DEFINED_TRUE@D4EnumDefsTest_LDADD = ../libdap.la $(AM_LDADD) all: all-recursive .SUFFIXES: @@ -878,94 +1054,91 @@ list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \ echo " rm -f" $$list; \ rm -f $$list -ArrayGeoConstraintTest$(EXEEXT): $(ArrayGeoConstraintTest_OBJECTS) $(ArrayGeoConstraintTest_DEPENDENCIES) - @rm -f ArrayGeoConstraintTest$(EXEEXT) - $(CXXLINK) $(ArrayGeoConstraintTest_OBJECTS) $(ArrayGeoConstraintTest_LDADD) $(LIBS) -ArrayTest$(EXEEXT): $(ArrayTest_OBJECTS) $(ArrayTest_DEPENDENCIES) +ArrayTest$(EXEEXT): $(ArrayTest_OBJECTS) $(ArrayTest_DEPENDENCIES) $(EXTRA_ArrayTest_DEPENDENCIES) @rm -f ArrayTest$(EXEEXT) $(CXXLINK) $(ArrayTest_OBJECTS) $(ArrayTest_LDADD) $(LIBS) -AttrTableTest$(EXEEXT): $(AttrTableTest_OBJECTS) $(AttrTableTest_DEPENDENCIES) +AttrTableTest$(EXEEXT): $(AttrTableTest_OBJECTS) $(AttrTableTest_DEPENDENCIES) $(EXTRA_AttrTableTest_DEPENDENCIES) @rm -f AttrTableTest$(EXEEXT) $(CXXLINK) $(AttrTableTest_OBJECTS) $(AttrTableTest_LDADD) $(LIBS) -ByteTest$(EXEEXT): $(ByteTest_OBJECTS) $(ByteTest_DEPENDENCIES) +ByteTest$(EXEEXT): $(ByteTest_OBJECTS) $(ByteTest_DEPENDENCIES) $(EXTRA_ByteTest_DEPENDENCIES) @rm -f ByteTest$(EXEEXT) $(CXXLINK) $(ByteTest_OBJECTS) $(ByteTest_LDADD) $(LIBS) -CEFunctionsTest$(EXEEXT): $(CEFunctionsTest_OBJECTS) $(CEFunctionsTest_DEPENDENCIES) - @rm -f CEFunctionsTest$(EXEEXT) - $(CXXLINK) $(CEFunctionsTest_OBJECTS) $(CEFunctionsTest_LDADD) $(LIBS) -DASTest$(EXEEXT): $(DASTest_OBJECTS) $(DASTest_DEPENDENCIES) +D4DimensionsTest$(EXEEXT): $(D4DimensionsTest_OBJECTS) $(D4DimensionsTest_DEPENDENCIES) $(EXTRA_D4DimensionsTest_DEPENDENCIES) + @rm -f D4DimensionsTest$(EXEEXT) + $(CXXLINK) $(D4DimensionsTest_OBJECTS) $(D4DimensionsTest_LDADD) $(LIBS) +D4EnumDefsTest$(EXEEXT): $(D4EnumDefsTest_OBJECTS) $(D4EnumDefsTest_DEPENDENCIES) $(EXTRA_D4EnumDefsTest_DEPENDENCIES) + @rm -f D4EnumDefsTest$(EXEEXT) + $(CXXLINK) $(D4EnumDefsTest_OBJECTS) $(D4EnumDefsTest_LDADD) $(LIBS) +DAP4MarshallerTest$(EXEEXT): $(DAP4MarshallerTest_OBJECTS) $(DAP4MarshallerTest_DEPENDENCIES) $(EXTRA_DAP4MarshallerTest_DEPENDENCIES) + @rm -f DAP4MarshallerTest$(EXEEXT) + $(CXXLINK) $(DAP4MarshallerTest_OBJECTS) $(DAP4MarshallerTest_LDADD) $(LIBS) +DAP4UnMarshallerTest$(EXEEXT): $(DAP4UnMarshallerTest_OBJECTS) $(DAP4UnMarshallerTest_DEPENDENCIES) $(EXTRA_DAP4UnMarshallerTest_DEPENDENCIES) + @rm -f DAP4UnMarshallerTest$(EXEEXT) + $(CXXLINK) $(DAP4UnMarshallerTest_OBJECTS) $(DAP4UnMarshallerTest_LDADD) $(LIBS) +DASTest$(EXEEXT): $(DASTest_OBJECTS) $(DASTest_DEPENDENCIES) $(EXTRA_DASTest_DEPENDENCIES) @rm -f DASTest$(EXEEXT) $(CXXLINK) $(DASTest_OBJECTS) $(DASTest_LDADD) $(LIBS) -DDSTest$(EXEEXT): $(DDSTest_OBJECTS) $(DDSTest_DEPENDENCIES) +DDSTest$(EXEEXT): $(DDSTest_OBJECTS) $(DDSTest_DEPENDENCIES) $(EXTRA_DDSTest_DEPENDENCIES) @rm -f DDSTest$(EXEEXT) $(CXXLINK) $(DDSTest_OBJECTS) $(DDSTest_LDADD) $(LIBS) -DDXParserTest$(EXEEXT): $(DDXParserTest_OBJECTS) $(DDXParserTest_DEPENDENCIES) +DDXParserTest$(EXEEXT): $(DDXParserTest_OBJECTS) $(DDXParserTest_DEPENDENCIES) $(EXTRA_DDXParserTest_DEPENDENCIES) @rm -f DDXParserTest$(EXEEXT) $(CXXLINK) $(DDXParserTest_OBJECTS) $(DDXParserTest_LDADD) $(LIBS) -DODSFilterTest$(EXEEXT): $(DODSFilterTest_OBJECTS) $(DODSFilterTest_DEPENDENCIES) - @rm -f DODSFilterTest$(EXEEXT) - $(CXXLINK) $(DODSFilterTest_OBJECTS) $(DODSFilterTest_LDADD) $(LIBS) -GridGeoConstraintTest$(EXEEXT): $(GridGeoConstraintTest_OBJECTS) $(GridGeoConstraintTest_DEPENDENCIES) - @rm -f GridGeoConstraintTest$(EXEEXT) - $(CXXLINK) $(GridGeoConstraintTest_OBJECTS) $(GridGeoConstraintTest_LDADD) $(LIBS) -HTTPCacheTest$(EXEEXT): $(HTTPCacheTest_OBJECTS) $(HTTPCacheTest_DEPENDENCIES) +HTTPCacheTest$(EXEEXT): $(HTTPCacheTest_OBJECTS) $(HTTPCacheTest_DEPENDENCIES) $(EXTRA_HTTPCacheTest_DEPENDENCIES) @rm -f HTTPCacheTest$(EXEEXT) $(CXXLINK) $(HTTPCacheTest_OBJECTS) $(HTTPCacheTest_LDADD) $(LIBS) -HTTPConnectTest$(EXEEXT): $(HTTPConnectTest_OBJECTS) $(HTTPConnectTest_DEPENDENCIES) +HTTPConnectTest$(EXEEXT): $(HTTPConnectTest_OBJECTS) $(HTTPConnectTest_DEPENDENCIES) $(EXTRA_HTTPConnectTest_DEPENDENCIES) @rm -f HTTPConnectTest$(EXEEXT) $(CXXLINK) $(HTTPConnectTest_OBJECTS) $(HTTPConnectTest_LDADD) $(LIBS) -Keywords2Test$(EXEEXT): $(Keywords2Test_OBJECTS) $(Keywords2Test_DEPENDENCIES) - @rm -f Keywords2Test$(EXEEXT) - $(CXXLINK) $(Keywords2Test_OBJECTS) $(Keywords2Test_LDADD) $(LIBS) -MIMEUtilTest$(EXEEXT): $(MIMEUtilTest_OBJECTS) $(MIMEUtilTest_DEPENDENCIES) +MIMEUtilTest$(EXEEXT): $(MIMEUtilTest_OBJECTS) $(MIMEUtilTest_DEPENDENCIES) $(EXTRA_MIMEUtilTest_DEPENDENCIES) @rm -f MIMEUtilTest$(EXEEXT) $(CXXLINK) $(MIMEUtilTest_OBJECTS) $(MIMEUtilTest_LDADD) $(LIBS) -MarshallerTest$(EXEEXT): $(MarshallerTest_OBJECTS) $(MarshallerTest_DEPENDENCIES) +MarshallerTest$(EXEEXT): $(MarshallerTest_OBJECTS) $(MarshallerTest_DEPENDENCIES) $(EXTRA_MarshallerTest_DEPENDENCIES) @rm -f MarshallerTest$(EXEEXT) $(CXXLINK) $(MarshallerTest_OBJECTS) $(MarshallerTest_LDADD) $(LIBS) -RCReaderTest$(EXEEXT): $(RCReaderTest_OBJECTS) $(RCReaderTest_DEPENDENCIES) +RCReaderTest$(EXEEXT): $(RCReaderTest_OBJECTS) $(RCReaderTest_DEPENDENCIES) $(EXTRA_RCReaderTest_DEPENDENCIES) @rm -f RCReaderTest$(EXEEXT) $(CXXLINK) $(RCReaderTest_OBJECTS) $(RCReaderTest_LDADD) $(LIBS) -RegexTest$(EXEEXT): $(RegexTest_OBJECTS) $(RegexTest_DEPENDENCIES) +RegexTest$(EXEEXT): $(RegexTest_OBJECTS) $(RegexTest_DEPENDENCIES) $(EXTRA_RegexTest_DEPENDENCIES) @rm -f RegexTest$(EXEEXT) $(CXXLINK) $(RegexTest_OBJECTS) $(RegexTest_LDADD) $(LIBS) -ResponseBuilderTest$(EXEEXT): $(ResponseBuilderTest_OBJECTS) $(ResponseBuilderTest_DEPENDENCIES) - @rm -f ResponseBuilderTest$(EXEEXT) - $(CXXLINK) $(ResponseBuilderTest_OBJECTS) $(ResponseBuilderTest_LDADD) $(LIBS) -SequenceTest$(EXEEXT): $(SequenceTest_OBJECTS) $(SequenceTest_DEPENDENCIES) +SequenceTest$(EXEEXT): $(SequenceTest_OBJECTS) $(SequenceTest_DEPENDENCIES) $(EXTRA_SequenceTest_DEPENDENCIES) @rm -f SequenceTest$(EXEEXT) $(CXXLINK) $(SequenceTest_OBJECTS) $(SequenceTest_LDADD) $(LIBS) -SignalHandlerTest$(EXEEXT): $(SignalHandlerTest_OBJECTS) $(SignalHandlerTest_DEPENDENCIES) +ServerFunctionsListUnitTest$(EXEEXT): $(ServerFunctionsListUnitTest_OBJECTS) $(ServerFunctionsListUnitTest_DEPENDENCIES) $(EXTRA_ServerFunctionsListUnitTest_DEPENDENCIES) + @rm -f ServerFunctionsListUnitTest$(EXEEXT) + $(CXXLINK) $(ServerFunctionsListUnitTest_OBJECTS) $(ServerFunctionsListUnitTest_LDADD) $(LIBS) +SignalHandlerTest$(EXEEXT): $(SignalHandlerTest_OBJECTS) $(SignalHandlerTest_DEPENDENCIES) $(EXTRA_SignalHandlerTest_DEPENDENCIES) @rm -f SignalHandlerTest$(EXEEXT) $(CXXLINK) $(SignalHandlerTest_OBJECTS) $(SignalHandlerTest_LDADD) $(LIBS) -ancT$(EXEEXT): $(ancT_OBJECTS) $(ancT_DEPENDENCIES) +ancT$(EXEEXT): $(ancT_OBJECTS) $(ancT_DEPENDENCIES) $(EXTRA_ancT_DEPENDENCIES) @rm -f ancT$(EXEEXT) $(CXXLINK) $(ancT_OBJECTS) $(ancT_LDADD) $(LIBS) -arrayT$(EXEEXT): $(arrayT_OBJECTS) $(arrayT_DEPENDENCIES) +arrayT$(EXEEXT): $(arrayT_OBJECTS) $(arrayT_DEPENDENCIES) $(EXTRA_arrayT_DEPENDENCIES) @rm -f arrayT$(EXEEXT) $(CXXLINK) $(arrayT_OBJECTS) $(arrayT_LDADD) $(LIBS) -attrTableT$(EXEEXT): $(attrTableT_OBJECTS) $(attrTableT_DEPENDENCIES) +attrTableT$(EXEEXT): $(attrTableT_OBJECTS) $(attrTableT_DEPENDENCIES) $(EXTRA_attrTableT_DEPENDENCIES) @rm -f attrTableT$(EXEEXT) $(CXXLINK) $(attrTableT_OBJECTS) $(attrTableT_LDADD) $(LIBS) -dasT$(EXEEXT): $(dasT_OBJECTS) $(dasT_DEPENDENCIES) +dasT$(EXEEXT): $(dasT_OBJECTS) $(dasT_DEPENDENCIES) $(EXTRA_dasT_DEPENDENCIES) @rm -f dasT$(EXEEXT) $(CXXLINK) $(dasT_OBJECTS) $(dasT_LDADD) $(LIBS) -ddsT$(EXEEXT): $(ddsT_OBJECTS) $(ddsT_DEPENDENCIES) +ddsT$(EXEEXT): $(ddsT_OBJECTS) $(ddsT_DEPENDENCIES) $(EXTRA_ddsT_DEPENDENCIES) @rm -f ddsT$(EXEEXT) $(CXXLINK) $(ddsT_OBJECTS) $(ddsT_LDADD) $(LIBS) -generalUtilTest$(EXEEXT): $(generalUtilTest_OBJECTS) $(generalUtilTest_DEPENDENCIES) +generalUtilTest$(EXEEXT): $(generalUtilTest_OBJECTS) $(generalUtilTest_DEPENDENCIES) $(EXTRA_generalUtilTest_DEPENDENCIES) @rm -f generalUtilTest$(EXEEXT) $(CXXLINK) $(generalUtilTest_OBJECTS) $(generalUtilTest_LDADD) $(LIBS) -marshT$(EXEEXT): $(marshT_OBJECTS) $(marshT_DEPENDENCIES) +marshT$(EXEEXT): $(marshT_OBJECTS) $(marshT_DEPENDENCIES) $(EXTRA_marshT_DEPENDENCIES) @rm -f marshT$(EXEEXT) $(CXXLINK) $(marshT_OBJECTS) $(marshT_LDADD) $(LIBS) -parserUtilTest$(EXEEXT): $(parserUtilTest_OBJECTS) $(parserUtilTest_DEPENDENCIES) +parserUtilTest$(EXEEXT): $(parserUtilTest_OBJECTS) $(parserUtilTest_DEPENDENCIES) $(EXTRA_parserUtilTest_DEPENDENCIES) @rm -f parserUtilTest$(EXEEXT) $(CXXLINK) $(parserUtilTest_OBJECTS) $(parserUtilTest_LDADD) $(LIBS) -sequenceT$(EXEEXT): $(sequenceT_OBJECTS) $(sequenceT_DEPENDENCIES) +sequenceT$(EXEEXT): $(sequenceT_OBJECTS) $(sequenceT_DEPENDENCIES) $(EXTRA_sequenceT_DEPENDENCIES) @rm -f sequenceT$(EXEEXT) $(CXXLINK) $(sequenceT_OBJECTS) $(sequenceT_LDADD) $(LIBS) -structT$(EXEEXT): $(structT_OBJECTS) $(structT_DEPENDENCIES) +structT$(EXEEXT): $(structT_OBJECTS) $(structT_DEPENDENCIES) $(EXTRA_structT_DEPENDENCIES) @rm -f structT$(EXEEXT) $(CXXLINK) $(structT_OBJECTS) $(structT_LDADD) $(LIBS) @@ -975,25 +1148,24 @@ distclean-compile: -rm -f *.tab.c -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ArrayGeoConstraintTest.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ArrayTest.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/AttrTableTest.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ByteTest.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/CEFunctionsTest.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/D4DimensionsTest.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/D4EnumDefsTest.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/DAP4MarshallerTest.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/DAP4UnMarshallerTest.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/DASTest.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/DDSTest.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/DDXParserTest-DDXParserTest.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/DODSFilterTest.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/GridGeoConstraintTest.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/HTTPCacheTest.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/HTTPConnectTest.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/Keywords2Test.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/HTTPCacheTest-HTTPCacheTest.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/HTTPConnectTest-HTTPConnectTest.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/MIMEUtilTest.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/MarshallerTest.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/RCReaderTest.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/RegexTest.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ResponseBuilderTest.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/SequenceTest.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ServerFunctionsListUnitTest.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/SignalHandlerTest.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ancT.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/arrayT.Po@am__quote@ @@ -1005,6 +1177,7 @@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/parserUtilTest.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sequenceT.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/structT.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/testFile.Po@am__quote@ .cc.o: @am__fastdepCXX_TRUE@ $(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @@ -1041,6 +1214,34 @@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(DDXParserTest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o DDXParserTest-DDXParserTest.obj `if test -f 'DDXParserTest.cc'; then $(CYGPATH_W) 'DDXParserTest.cc'; else $(CYGPATH_W) '$(srcdir)/DDXParserTest.cc'; fi` +HTTPCacheTest-HTTPCacheTest.o: HTTPCacheTest.cc +@am__fastdepCXX_TRUE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(HTTPCacheTest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT HTTPCacheTest-HTTPCacheTest.o -MD -MP -MF $(DEPDIR)/HTTPCacheTest-HTTPCacheTest.Tpo -c -o HTTPCacheTest-HTTPCacheTest.o `test -f 'HTTPCacheTest.cc' || echo '$(srcdir)/'`HTTPCacheTest.cc +@am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/HTTPCacheTest-HTTPCacheTest.Tpo $(DEPDIR)/HTTPCacheTest-HTTPCacheTest.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='HTTPCacheTest.cc' object='HTTPCacheTest-HTTPCacheTest.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(HTTPCacheTest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o HTTPCacheTest-HTTPCacheTest.o `test -f 'HTTPCacheTest.cc' || echo '$(srcdir)/'`HTTPCacheTest.cc + +HTTPCacheTest-HTTPCacheTest.obj: HTTPCacheTest.cc +@am__fastdepCXX_TRUE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(HTTPCacheTest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT HTTPCacheTest-HTTPCacheTest.obj -MD -MP -MF $(DEPDIR)/HTTPCacheTest-HTTPCacheTest.Tpo -c -o HTTPCacheTest-HTTPCacheTest.obj `if test -f 'HTTPCacheTest.cc'; then $(CYGPATH_W) 'HTTPCacheTest.cc'; else $(CYGPATH_W) '$(srcdir)/HTTPCacheTest.cc'; fi` +@am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/HTTPCacheTest-HTTPCacheTest.Tpo $(DEPDIR)/HTTPCacheTest-HTTPCacheTest.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='HTTPCacheTest.cc' object='HTTPCacheTest-HTTPCacheTest.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(HTTPCacheTest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o HTTPCacheTest-HTTPCacheTest.obj `if test -f 'HTTPCacheTest.cc'; then $(CYGPATH_W) 'HTTPCacheTest.cc'; else $(CYGPATH_W) '$(srcdir)/HTTPCacheTest.cc'; fi` + +HTTPConnectTest-HTTPConnectTest.o: HTTPConnectTest.cc +@am__fastdepCXX_TRUE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(HTTPConnectTest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT HTTPConnectTest-HTTPConnectTest.o -MD -MP -MF $(DEPDIR)/HTTPConnectTest-HTTPConnectTest.Tpo -c -o HTTPConnectTest-HTTPConnectTest.o `test -f 'HTTPConnectTest.cc' || echo '$(srcdir)/'`HTTPConnectTest.cc +@am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/HTTPConnectTest-HTTPConnectTest.Tpo $(DEPDIR)/HTTPConnectTest-HTTPConnectTest.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='HTTPConnectTest.cc' object='HTTPConnectTest-HTTPConnectTest.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(HTTPConnectTest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o HTTPConnectTest-HTTPConnectTest.o `test -f 'HTTPConnectTest.cc' || echo '$(srcdir)/'`HTTPConnectTest.cc + +HTTPConnectTest-HTTPConnectTest.obj: HTTPConnectTest.cc +@am__fastdepCXX_TRUE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(HTTPConnectTest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT HTTPConnectTest-HTTPConnectTest.obj -MD -MP -MF $(DEPDIR)/HTTPConnectTest-HTTPConnectTest.Tpo -c -o HTTPConnectTest-HTTPConnectTest.obj `if test -f 'HTTPConnectTest.cc'; then $(CYGPATH_W) 'HTTPConnectTest.cc'; else $(CYGPATH_W) '$(srcdir)/HTTPConnectTest.cc'; fi` +@am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/HTTPConnectTest-HTTPConnectTest.Tpo $(DEPDIR)/HTTPConnectTest-HTTPConnectTest.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='HTTPConnectTest.cc' object='HTTPConnectTest-HTTPConnectTest.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(HTTPConnectTest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o HTTPConnectTest-HTTPConnectTest.obj `if test -f 'HTTPConnectTest.cc'; then $(CYGPATH_W) 'HTTPConnectTest.cc'; else $(CYGPATH_W) '$(srcdir)/HTTPConnectTest.cc'; fi` + mostlyclean-libtool: -rm -f *.lo @@ -1048,13 +1249,13 @@ -rm -rf .libs _libs # This directory's subdirectories are mostly independent; you can cd -# into them and run `make' without going through this Makefile. -# To change the values of `make' variables: instead of editing Makefiles, -# (1) if the variable is set in `config.status', edit `config.status' -# (which will cause the Makefiles to be regenerated when you run `make'); -# (2) otherwise, pass the desired values on the `make' command line. +# into them and run 'make' without going through this Makefile. +# To change the values of 'make' variables: instead of editing Makefiles, +# (1) if the variable is set in 'config.status', edit 'config.status' +# (which will cause the Makefiles to be regenerated when you run 'make'); +# (2) otherwise, pass the desired values on the 'make' command line. $(RECURSIVE_TARGETS): - @failcom='exit 1'; \ + @fail= failcom='exit 1'; \ for f in x $$MAKEFLAGS; do \ case $$f in \ *=* | --[!k]*);; \ @@ -1079,7 +1280,7 @@ fi; test -z "$$fail" $(RECURSIVE_CLEAN_TARGETS): - @failcom='exit 1'; \ + @fail= failcom='exit 1'; \ for f in x $$MAKEFLAGS; do \ case $$f in \ *=* | --[!k]*);; \ @@ -1116,6 +1317,10 @@ list='$(SUBDIRS)'; for subdir in $$list; do \ test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \ done +cscopelist-recursive: + list='$(SUBDIRS)'; for subdir in $$list; do \ + test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) cscopelist); \ + done ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ @@ -1179,6 +1384,20 @@ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" +cscopelist: cscopelist-recursive $(HEADERS) $(SOURCES) $(LISP) + list='$(SOURCES) $(HEADERS) $(LISP)'; \ + case "$(srcdir)" in \ + [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ + *) sdir=$(subdir)/$(srcdir) ;; \ + esac; \ + for i in $$list; do \ + if test -f "$$i"; then \ + echo "$(subdir)/$$i"; \ + else \ + echo "$$sdir/$$i"; \ + fi; \ + done >> $(top_builddir)/cscope.files + distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags @@ -1192,7 +1411,7 @@ if test -f ./$$tst; then dir=./; \ elif test -f $$tst; then dir=; \ else dir="$(srcdir)/"; fi; \ - if $(TESTS_ENVIRONMENT) $${dir}$$tst; then \ + if $(TESTS_ENVIRONMENT) $${dir}$$tst $(AM_TESTS_FD_REDIRECT); then \ all=`expr $$all + 1`; \ case " $(XFAIL_TESTS) " in \ *[\ \ ]$$tst[\ \ ]*) \ @@ -1263,14 +1482,15 @@ fi; \ dashes=`echo "$$dashes" | sed s/./=/g`; \ if test "$$failed" -eq 0; then \ - echo "$$grn$$dashes"; \ + col="$$grn"; \ else \ - echo "$$red$$dashes"; \ + col="$$red"; \ fi; \ - echo "$$banner"; \ - test -z "$$skipped" || echo "$$skipped"; \ - test -z "$$report" || echo "$$report"; \ - echo "$$dashes$$std"; \ + echo "$${col}$$dashes$${std}"; \ + echo "$${col}$$banner$${std}"; \ + test -z "$$skipped" || echo "$${col}$$skipped$${std}"; \ + test -z "$$report" || echo "$${col}$$report$${std}"; \ + echo "$${col}$$dashes$${std}"; \ test "$$failed" -eq 0; \ else :; fi @@ -1306,13 +1526,10 @@ done @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ - test -d "$(distdir)/$$subdir" \ - || $(MKDIR_P) "$(distdir)/$$subdir" \ - || exit 1; \ - fi; \ - done - @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ - if test "$$subdir" = .; then :; else \ + $(am__make_dryrun) \ + || test -d "$(distdir)/$$subdir" \ + || $(MKDIR_P) "$(distdir)/$$subdir" \ + || exit 1; \ dir1=$$subdir; dir2="$(distdir)/$$subdir"; \ $(am__relativize); \ new_distdir=$$reldir; \ @@ -1350,10 +1567,15 @@ installcheck: installcheck-recursive install-strip: - $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ - install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ - `test -z '$(STRIP)' || \ - echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install + if test -z '$(STRIP)'; then \ + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + install; \ + else \ + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ + fi mostlyclean-generic: clean-generic: @@ -1439,22 +1661,24 @@ uninstall-am: .MAKE: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) check-am \ - ctags-recursive install-am install-strip tags-recursive + cscopelist-recursive ctags-recursive install-am install-strip \ + tags-recursive .PHONY: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) CTAGS GTAGS \ all all-am check check-TESTS check-am check-local clean \ - clean-checkPROGRAMS clean-generic clean-libtool ctags \ - ctags-recursive distclean distclean-compile distclean-generic \ - distclean-libtool distclean-tags distdir dvi dvi-am html \ - html-am info info-am install install-am install-data \ - install-data-am install-dvi install-dvi-am install-exec \ - install-exec-am install-html install-html-am install-info \ - install-info-am install-man install-pdf install-pdf-am \ - install-ps install-ps-am install-strip installcheck \ - installcheck-am installdirs installdirs-am maintainer-clean \ - maintainer-clean-generic mostlyclean mostlyclean-compile \ - mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ - tags tags-recursive uninstall uninstall-am + clean-checkPROGRAMS clean-generic clean-libtool cscopelist \ + cscopelist-recursive ctags ctags-recursive distclean \ + distclean-compile distclean-generic distclean-libtool \ + distclean-tags distdir dvi dvi-am html html-am info info-am \ + install install-am install-data install-data-am install-dvi \ + install-dvi-am install-exec install-exec-am install-html \ + install-html-am install-info install-info-am install-man \ + install-pdf install-pdf-am install-ps install-ps-am \ + install-strip installcheck installcheck-am installdirs \ + installdirs-am maintainer-clean maintainer-clean-generic \ + mostlyclean mostlyclean-compile mostlyclean-generic \ + mostlyclean-libtool pdf pdf-am ps ps-am tags tags-recursive \ + uninstall uninstall-am test_config.h: test_config.h.in Makefile @@ -1468,9 +1692,6 @@ @CPPUNIT_FALSE@ @echo "**********************************************************" @CPPUNIT_FALSE@ @echo "" -# fdiostreamTest_SOURCES = fdiostreamTest.cc -# fdiostreamTest_LDADD = ../libdapclient.la ../libdap.la $(AM_LDADD) - # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: diff -Nru libdap-3.11.1/unit-tests/MarshallerTest.cc libdap-3.12.0/unit-tests/MarshallerTest.cc --- libdap-3.11.1/unit-tests/MarshallerTest.cc 2011-04-29 13:19:42.000000000 +0000 +++ libdap-3.12.0/unit-tests/MarshallerTest.cc 2013-10-17 21:27:40.000000000 +0000 @@ -6,12 +6,13 @@ #include #include "config.h" + #ifdef HAVE_UNISTD_H #include #endif #include -//#define DODS_DEBUG 1 +// #define DODS_DEBUG 1 #include #include @@ -43,953 +44,1100 @@ #endif #include "debug.h" -using std::cerr ; -using std::cout ; -using std::endl ; -using std::ofstream ; -using std::ifstream ; +using std::cerr; +using std::cout; +using std::endl; +using std::ofstream; +using std::ifstream; int test_variable_sleep_interval = 0; // Used in Test* classes for testing - // timeouts. +// timeouts. -class MarshallerTest : public CppUnit::TestFixture { +class MarshallerTest: public CppUnit::TestFixture { - CPPUNIT_TEST_SUITE( MarshallerTest ) ; -#if 1 - CPPUNIT_TEST( simple_types_file_serialize_test ) ; - CPPUNIT_TEST( array_file_serialize_test ) ; - CPPUNIT_TEST( structure_file_serialize_test ) ; - CPPUNIT_TEST( grid_file_serialize_test ) ; - CPPUNIT_TEST( sequence_file_serialize_test ) ; - - CPPUNIT_TEST( simple_types_file_deserialize_test ) ; - CPPUNIT_TEST( array_file_deserialize_test ) ; - CPPUNIT_TEST( structure_file_deserialize_test ) ; - CPPUNIT_TEST( grid_file_deserialize_test ) ; - CPPUNIT_TEST( sequence_file_deserialize_test ) ; - - CPPUNIT_TEST( simple_types_stream_serialize_test ) ; - CPPUNIT_TEST( array_stream_serialize_test ) ; - CPPUNIT_TEST( structure_stream_serialize_test ) ; - CPPUNIT_TEST( grid_stream_serialize_test ) ; - CPPUNIT_TEST( sequence_stream_serialize_test ) ; -#endif +CPPUNIT_TEST_SUITE( MarshallerTest ); + + CPPUNIT_TEST( simple_types_file_serialize_test ); + + CPPUNIT_TEST( array_file_serialize_test ); + CPPUNIT_TEST( structure_file_serialize_test ); + CPPUNIT_TEST( grid_file_serialize_test ); + CPPUNIT_TEST( sequence_file_serialize_test ); + + CPPUNIT_TEST( simple_types_file_deserialize_test ); + CPPUNIT_TEST( array_file_deserialize_test ); + CPPUNIT_TEST( structure_file_deserialize_test ); + CPPUNIT_TEST( grid_file_deserialize_test ); + CPPUNIT_TEST( sequence_file_deserialize_test ); + + CPPUNIT_TEST( simple_types_stream_serialize_test ); + CPPUNIT_TEST( array_stream_serialize_test ); + CPPUNIT_TEST( structure_stream_serialize_test ); + CPPUNIT_TEST( grid_stream_serialize_test ); + CPPUNIT_TEST( sequence_stream_serialize_test ); + + CPPUNIT_TEST( simple_types_stream_deserialize_test ); + CPPUNIT_TEST( array_stream_deserialize_test ); + CPPUNIT_TEST( structure_stream_deserialize_test ); + CPPUNIT_TEST( grid_stream_deserialize_test ); + CPPUNIT_TEST( sequence_stream_deserialize_test ); + +#if CHECKSUMS + CPPUNIT_TEST( simple_types_stream_serialize_checksum_test ); + CPPUNIT_TEST( array_stream_serialize_checksum_test ); + CPPUNIT_TEST( structure_stream_serialize_checksum_test ); + CPPUNIT_TEST( grid_stream_serialize_checksum_test ); #if 0 - CPPUNIT_TEST( simple_types_fdistream_deserialize_test ) ; + CPPUNIT_TEST( sequence_stream_serialize_checksum_test ); #endif -#if 1 - CPPUNIT_TEST( simple_types_stream_deserialize_test ) ; - CPPUNIT_TEST( array_stream_deserialize_test ) ; - CPPUNIT_TEST( structure_stream_deserialize_test ) ; - CPPUNIT_TEST( grid_stream_deserialize_test ) ; - CPPUNIT_TEST( sequence_stream_deserialize_test ) ; -#endif - CPPUNIT_TEST_SUITE_END( ) ; - - TestByte b; - TestInt16 i16 ; - TestInt32 i32 ; - TestUInt16 ui16 ; - TestUInt32 ui32 ; - TestFloat32 f32 ; - TestFloat64 f64 ; - TestStr str ; - TestUrl url ; - TestByte ab ; - - TestArray arr ; - - TestStructure s ; - - ConstraintEvaluator eval ; - TestTypeFactory ttf ; - DataDDS dds ; +#endif + CPPUNIT_TEST_SUITE_END( ); + + TestByte *b; + TestInt16 *i16; + TestInt32 *i32; + TestUInt16 *ui16; + TestUInt32 *ui32; + TestFloat32 *f32; + TestFloat64 *f64; + TestStr *str; + TestUrl *url; + + TestByte *ab; + + TestArray *arr; + + TestStructure *s; + + ConstraintEvaluator eval; + TestTypeFactory ttf; + DataDDS dds; string str_value, str2_value; string url_value; dods_byte *db; public: - MarshallerTest() : b( "byte" ), - i16( "i16" ) , - i32( "i32" ) , - ui16( "ui16" ) , - ui32( "ui32" ) , - f32( "f32" ) , - f64( "f64" ) , - str( "str" ) , - url( "url" ) , - ab( "ab" ) , - arr( "arr", &ab ) , - s( "s" ) , - dds( &ttf, "dds" ) - { - b.read(); - i16.read(); - i32.read(); - ui16.read(); - ui32.read(); - f32.read(); - f64.read(); - str.read(); - url.read(); - - ab.read(); - - arr.append_dim( 5, "dim1" ) ; - arr.append_dim( 3, "dim2" ) ; - arr.read(); - arr.set_read_p( true ) ; - db = new dods_byte[arr.length() * sizeof(dods_byte)] ; - arr.value( db ) ; - - s.add_var( &i32 ) ; - s.add_var( &str ) ; - s.add_var( &arr ) ; - s.set_send_p( true ) ; + MarshallerTest() : + b(0), i16(0), i32(0), ui16(0), ui32(0), f32(0), f64(0), str(0), url(0), ab(0), arr(0), s(0), dds(&ttf, "dds") + { - url_value = "http://dcz.gso.uri.edu/avhrr-archive/archive.html"; + url_value = "http://dcz.gso.uri.edu/avhrr-archive/archive.html"; } void setUp() { + b = new TestByte("byte"); + b->read(); + + i16 = new TestInt16("i16"); + i16->read(); + + i32 = new TestInt32("i32"); + i32->read(); + + ui16 = new TestUInt16("ui16"); + ui16->read(); + + ui32 = new TestUInt32("ui32"); + ui32->read(); + + f32 = new TestFloat32("f32"); + f32->read(); + + f64 = new TestFloat64("f64"); + f64->read(); + + str = new TestStr("str"); + str->read(); + + url = new TestUrl("url"); + url->read(); + + ab = new TestByte("ab"); + ab->read(); + arr = new TestArray("arr", ab); + arr->append_dim(5, "dim1"); + arr->append_dim(3, "dim2"); + arr->read(); + arr->set_read_p(true); + + db = new dods_byte[arr->length() * sizeof(dods_byte)]; + for (int i = 0; i < arr->length(); ++i) + db[i] = 126; + arr->value(db); + + s = new TestStructure("s"); + s->add_var(i32); + s->add_var(str); + s->add_var(arr); + s->set_send_p(true); } void tearDown() { + delete b; + b = 0; + delete i16; + i16 = 0; + delete i32; + i32 = 0; + delete ui16; + ui16 = 0; + delete ui32; + ui32 = 0; + delete f32; + f32 = 0; + delete f64; + f64 = 0; + delete str; + str = 0; + delete url; + url = 0; + + delete ab; + ab = 0; + + delete arr; + arr = 0; + + delete s; + s = 0; } - void simple_types_file_serialize_test() { - try - { - FILE *f = fopen( "st_test.file", "w" ) ; - XDRFileMarshaller fm( f ) ; - - b.serialize( eval, dds, fm, false ) ; - i16.serialize( eval, dds, fm, false ) ; - i32.serialize( eval, dds, fm, false ) ; - ui16.serialize( eval, dds, fm, false ) ; - ui32.serialize( eval, dds, fm, false ) ; - f32.serialize( eval, dds, fm, false ) ; - f64.serialize( eval, dds, fm, false ) ; - str.serialize( eval, dds, fm, false ) ; - url.serialize( eval, dds, fm, false ) ; - - // fclose( f ) ; - } - catch( Error &e ) - { - string err = "failed:" + e.get_error_message() ; - CPPUNIT_FAIL( err.c_str() ) ; - } - } - - void simple_types_file_deserialize_test() { - try - { - FILE *ff = fopen( "st_test.file", "r" ) ; - XDRFileUnMarshaller um( ff ) ; - - Byte fb( "fb" ) ; - fb.deserialize( um, &dds, false ) ; - CPPUNIT_ASSERT( fb.value() == b.value() ) ; - - Int16 fi16( "i16" ) ; - fi16.deserialize( um, &dds, false ) ; - CPPUNIT_ASSERT( fi16.value() == i16.value() ) ; - - Int32 fi32( "i32" ) ; - fi32.deserialize( um, &dds, false ) ; - CPPUNIT_ASSERT( fi32.value() == i32.value() ) ; - - UInt16 fui16( "ui16" ) ; - fui16.deserialize( um, &dds, false ) ; - CPPUNIT_ASSERT( fui16.value() == ui16.value() ) ; - - UInt32 fui32( "ui32" ) ; - fui32.deserialize( um, &dds, false ) ; - CPPUNIT_ASSERT( fui32.value() == ui32.value() ) ; - - Float32 ff32( "f32" ) ; - ff32.deserialize( um, &dds, false ) ; - CPPUNIT_ASSERT( ff32.value() == f32.value() ) ; - - Float64 ff64( "f64" ) ; - ff64.deserialize( um, &dds, false ) ; - CPPUNIT_ASSERT( ff64.value() == f64.value() ) ; - - Str fstr( "str" ) ; - fstr.deserialize( um, &dds, false ) ; - // Test for the string value like this because the digit after - // the colon changes each time the read() method is called. - CPPUNIT_ASSERT( fstr.value().find("Silly test string:") != string::npos ) ; - - Url furl( "url" ) ; - furl.deserialize( um, &dds, false ) ; - CPPUNIT_ASSERT( furl.value() == url_value ) ; - - // fclose( ff ) ; - } - catch( Error &e ) - { - string err = "failed:" + e.get_error_message() ; - CPPUNIT_FAIL( err.c_str() ) ; - } - } - - void array_file_serialize_test() { - try - { - FILE *f = fopen( "a_test.file", "w" ) ; - XDRFileMarshaller fm( f ) ; - - arr.serialize( eval, dds, fm, false ) ; - - // fclose( f ) ; - } - catch( Error &e ) - { - string err = "failed:" + e.get_error_message() ; - CPPUNIT_FAIL( err.c_str() ) ; - } - } - - void array_file_deserialize_test() { - try - { - FILE *ff = fopen( "a_test.file", "r" ) ; - XDRFileUnMarshaller um( ff ) ; - - TestByte fab( "ab" ) ; - TestArray farr( "arr", &fab ) ; - farr.append_dim( 5, "dim1" ) ; - farr.append_dim( 3, "dim2" ) ; - farr.deserialize( um, &dds, false ) ; - - CPPUNIT_ASSERT( farr.length() == arr.length() ) ; - - dods_byte fdb[farr.length() * sizeof(dods_byte)] ; - farr.value( fdb ) ; - CPPUNIT_ASSERT( !memcmp( (void *)fdb, (void *)db, farr.length() * sizeof( dods_byte ) ) ) ; - - // fclose( ff ) ; - } - catch( Error &e ) - { - string err = "failed:" + e.get_error_message() ; - CPPUNIT_FAIL( err.c_str() ) ; - } - } - - void structure_file_serialize_test() { - try - { - FILE *f = fopen( "struct_test.file", "w" ) ; - XDRFileMarshaller fm( f ) ; - - TestStructure s( "s" ) ; - s.add_var( &i32 ) ; - s.add_var( &str ) ; - s.add_var( &arr ) ; - s.set_send_p( true ) ; - - s.serialize( eval, dds, fm, false ) ; - - // fclose( f ) ; - } - catch( Error &e ) - { - string err = "failed:" + e.get_error_message() ; - CPPUNIT_FAIL( err.c_str() ) ; - } - } - - void structure_file_deserialize_test() { - try - { - FILE *ff = fopen( "struct_test.file", "r" ) ; - XDRFileUnMarshaller um( ff ) ; - - TestStructure fs( "fs" ) ; - - TestInt32 fsi32( "fsi32" ) ; - fs.add_var( &fsi32 ) ; - - TestStr fsstr( "fsstr" ) ; - fs.add_var( &fsstr ) ; - - TestByte fsab( "fsab" ) ; - TestArray fsarr( "fsarr", &fsab ) ; - fsarr.append_dim( 5, "dim1" ) ; - fsarr.append_dim( 3, "dim2" ) ; - fs.add_var( &fsarr ) ; - - fs.deserialize( um, &dds, false ) ; - - Int32 *fsi32_p = dynamic_cast(fs.var( "fsi32" )) ; - CPPUNIT_ASSERT( fsi32_p ) ; - CPPUNIT_ASSERT( fsi32_p->value() == i32.value() ) ; - - Str *fsstr_p = dynamic_cast(fs.var( "fsstr" )) ; - CPPUNIT_ASSERT( fsstr_p ) ; - DBG2(cerr << "fsstr_p->value(): " << fsstr_p->value() << endl); - CPPUNIT_ASSERT( fsstr_p->value().find("Silly test string:") != string::npos ) ; - - BaseType *bt = fs.var( "fsab" ) ; - CPPUNIT_ASSERT( bt ) ; - Array *fsarr_p = dynamic_cast(bt) ; - CPPUNIT_ASSERT( fsarr_p ) ; - dods_byte fdb[fsarr_p->length() * sizeof(dods_byte)] ; - fsarr_p->value( fdb ) ; - - CPPUNIT_ASSERT( fsarr_p->length() == arr.length() ) ; - CPPUNIT_ASSERT( !memcmp( (void *)fdb, (void *)db, fsarr_p->length() * sizeof( dods_byte ) ) ) ; - - // fclose( ff ) ; - } - catch( Error &e ) - { - string err = "failed:" + e.get_error_message() ; - CPPUNIT_FAIL( err.c_str() ) ; - } - } - - void grid_file_serialize_test() { - try - { - FILE *f = fopen( "g_test.file", "w" ) ; - XDRFileMarshaller fm( f ) ; - - TestGrid tg( "grid1" ); - TestArray arr2( "arr2", &ab ) ; - arr2.append_dim( 5, "dim1" ) ; - arr2.append_dim( 3, "dim2" ) ; - tg.add_var( &arr2, array ); - - TestArray map1( "map1", &f32 ) ; - map1.append_dim( 5, "dim1" ) ; - tg.add_var( &map1, maps ); - - TestArray map2( "map2", &f32 ) ; - map2.append_dim( 3, "dim2" ) ; - tg.add_var( &map2, maps ); - - tg.set_send_p(true); - tg.read(); - tg.set_read_p(true); - - tg.serialize( eval, dds, fm, false ) ; - - // fclose( f ) ; - } - catch( Error &e ) - { - string err = "failed:" + e.get_error_message() ; - CPPUNIT_FAIL( err.c_str() ) ; - } - } - - void grid_file_deserialize_test() { - try - { - FILE *ff = fopen( "g_test.file", "r" ) ; - XDRFileUnMarshaller um( ff ) ; - - TestGrid tg( "grid1" ); - TestArray arr2( "arr2", &ab ) ; - arr2.append_dim( 5, "dim1" ) ; - arr2.append_dim( 3, "dim2" ) ; - tg.add_var(&arr2, array); - - TestArray map1( "map1", &f32 ) ; - map1.append_dim( 5, "dim1" ) ; - tg.add_var(&map1, maps); - - TestArray map2( "map2", &f32 ) ; - map2.append_dim( 3, "dim2" ) ; - tg.add_var(&map2, maps); - - tg.deserialize( um, &dds, false ) ; - - // Check the values in the array - CPPUNIT_ASSERT( tg.get_array()->length() == arr.length() ) ; - - dods_byte fdb[tg.get_array()->length() * sizeof(dods_byte)] ; - tg.get_array()->value( fdb ) ; - CPPUNIT_ASSERT( !memcmp( (void *)fdb, (void *)db, tg.get_array()->length() * sizeof( dods_byte ) ) ) ; - - // Should test the map values here, but skip that for now... - - // fclose( ff ) ; - } - catch( Error &e ) - { - string err = "failed:" + e.get_error_message() ; - CPPUNIT_FAIL( err.c_str() ) ; - } - } - - void sequence_file_serialize_test() { - try - { - FILE *f = fopen( "seq_test.file", "w" ) ; - XDRFileMarshaller fm( f ) ; - - TestSequence seq( "seq" ) ; - seq.add_var( &f64 ) ; - seq.add_var( &arr ) ; - - TestSequence seq2( "seq2" ) ; - seq2.add_var( &ui16 ) ; - seq2.add_var( &url ) ; - - seq.add_var( &seq2 ) ; - - seq.set_send_p( true ) ; - seq.set_leaf_sequence() ; - - seq.serialize( eval, dds, fm, false ) ; - - // fclose( f ) ; - } - catch( Error &e ) - { - string err = "failed:" + e.get_error_message() ; - CPPUNIT_FAIL( err.c_str() ) ; - } - } - - void sequence_file_deserialize_test() { - try - { - FILE *ff = fopen( "seq_test.file", "r" ) ; - XDRFileUnMarshaller um( ff ) ; - - dods_byte fdb[arr.length() * sizeof(dods_byte)] ; - - TestSequence seq( "seq" ) ; - seq.add_var( &f64 ) ; - seq.add_var( &arr ) ; - - TestSequence seq2( "seq2" ) ; - seq2.add_var( &ui16 ) ; - seq2.add_var( &url ) ; - seq2.set_send_p( true ) ; - seq.add_var( &seq2 ) ; - seq.set_leaf_sequence() ; - - seq.deserialize( um, &dds, false ) ; - unsigned int num_rows = seq.number_of_rows() ; - CPPUNIT_ASSERT( num_rows == 4 ) ; - for( unsigned int i = 0; i < num_rows; i++ ) - { - BaseTypeRow *row = seq.row_value( i ) ; - CPPUNIT_ASSERT( row ) ; - CPPUNIT_ASSERT( row->size() == 3 ) ; - Float64 *f64_p = dynamic_cast((*row)[0]) ; - CPPUNIT_ASSERT( f64_p ) ; - CPPUNIT_ASSERT( f64_p->value() == f64.value() ) ; - - Array *arr_p = dynamic_cast((*row)[1]) ; - CPPUNIT_ASSERT( arr_p ) ; - arr_p->value( fdb ) ; - CPPUNIT_ASSERT( arr_p->length() == arr.length() ) ; - CPPUNIT_ASSERT( !memcmp( (void *)fdb, (void *)db, - arr_p->length() * sizeof( dods_byte ) ) ) ; - Sequence *seq_p = dynamic_cast((*row)[2]) ; - CPPUNIT_ASSERT( seq_p ) ; - unsigned int num_rows_sub = seq_p->number_of_rows() ; - CPPUNIT_ASSERT( num_rows == 4 ) ; - for( unsigned int j = 0; j < num_rows_sub; j++ ) - { - BaseTypeRow *row_sub = seq_p->row_value( j ) ; - CPPUNIT_ASSERT( row_sub ) ; - CPPUNIT_ASSERT( row_sub->size() == 2 ) ; - UInt16 *ui16_p = dynamic_cast((*row_sub)[0]) ; - CPPUNIT_ASSERT( ui16_p ) ; - CPPUNIT_ASSERT( ui16_p->value() == ui16.value() ) ; - Url *url_p = dynamic_cast((*row_sub)[1]) ; - CPPUNIT_ASSERT( url_p ) ; - CPPUNIT_ASSERT( url_p->value() == url.value() ) ; - } - } - - // fclose( ff ) ; - } - catch( Error &e ) - { - string err = "failed:" + e.get_error_message() ; - CPPUNIT_FAIL( err.c_str() ) ; - } + void simple_types_file_serialize_test() + { + try { + FILE *f = fopen("st_test.file", "w"); + XDRFileMarshaller fm(f); + + b->serialize(eval, dds, fm, false); + i16->serialize(eval, dds, fm, false); + i32->serialize(eval, dds, fm, false); + ui16->serialize(eval, dds, fm, false); + ui32->serialize(eval, dds, fm, false); + f32->serialize(eval, dds, fm, false); + f64->serialize(eval, dds, fm, false); + str->serialize(eval, dds, fm, false); + url->serialize(eval, dds, fm, false); + } + catch( Error &e ) { + string err = "failed:" + e.get_error_message(); + CPPUNIT_FAIL( err.c_str() ); + } } - // Stream tests from here on + void simple_types_file_deserialize_test() + { + try { + FILE *ff = fopen("st_test.file", "r"); + XDRFileUnMarshaller um(ff); + + Byte fb("fb"); + fb.deserialize(um, &dds, false); + CPPUNIT_ASSERT( fb.value() == b->value() ); + + Int16 fi16("i16"); + fi16.deserialize(um, &dds, false); + CPPUNIT_ASSERT( fi16.value() == i16->value() ); + + Int32 fi32("i32"); + fi32.deserialize(um, &dds, false); + CPPUNIT_ASSERT( fi32.value() == i32->value() ); + + UInt16 fui16("ui16"); + fui16.deserialize(um, &dds, false); + CPPUNIT_ASSERT( fui16.value() == ui16->value() ); + + UInt32 fui32("ui32"); + fui32.deserialize(um, &dds, false); + CPPUNIT_ASSERT( fui32.value() == ui32->value() ); + + Float32 ff32("f32"); + ff32.deserialize(um, &dds, false); + CPPUNIT_ASSERT( ff32.value() == f32->value() ); + + Float64 ff64("f64"); + ff64.deserialize(um, &dds, false); + CPPUNIT_ASSERT( ff64.value() == f64->value() ); + + Str fstr("str"); + fstr.deserialize(um, &dds, false); + // Test for the string value like this because the digit after + // the colon changes each time the read() method is called. + CPPUNIT_ASSERT( fstr.value().find("Silly test string:") != string::npos ); + + Url furl("url"); + furl.deserialize(um, &dds, false); + CPPUNIT_ASSERT( furl.value() == url_value ); + } + catch( Error &e ) { + string err = "failed:" + e.get_error_message(); + CPPUNIT_FAIL( err.c_str() ); + } + } + + void array_file_serialize_test() + { + try { + FILE *f = fopen("a_test.file", "w"); + XDRFileMarshaller fm(f); + + arr->serialize(eval, dds, fm, false); + + } + catch( Error &e ) { + string err = "failed:" + e.get_error_message(); + CPPUNIT_FAIL( err.c_str() ); + } + } + + void array_file_deserialize_test() + { + try { + FILE *ff = fopen("a_test.file", "r"); + XDRFileUnMarshaller um(ff); + + TestByte fab("ab"); + TestArray farr("arr", &fab); + farr.append_dim(5, "dim1"); + farr.append_dim(3, "dim2"); + farr.deserialize(um, &dds, false); + + CPPUNIT_ASSERT( farr.length() == arr->length() ); + + dods_byte fdb[farr.length() * sizeof(dods_byte)]; + farr.value(fdb); + CPPUNIT_ASSERT( !memcmp( (void *)fdb, (void *)db, farr.length() * sizeof( dods_byte ) ) ); + } + catch( Error &e ) { + string err = "failed:" + e.get_error_message(); + CPPUNIT_FAIL( err.c_str() ); + } + } + + void structure_file_serialize_test() + { + try { + FILE *f = fopen("struct_test.file", "w"); + XDRFileMarshaller fm(f); + s->serialize(eval, dds, fm, false); + } + catch( Error &e ) { + string err = "failed:" + e.get_error_message(); + CPPUNIT_FAIL( err.c_str() ); + } + } - void simple_types_stream_serialize_test() { - try - { - ofstream strm( "st_test.strm", ios::out|ios::trunc ) ; - XDRStreamMarshaller sm( strm ) ; + void structure_file_deserialize_test() + { + try { + FILE *ff = fopen("struct_test.file", "r"); + XDRFileUnMarshaller um(ff); + + TestStructure fs("fs"); + + TestInt32 fsi32("fsi32"); + fs.add_var(&fsi32); + + TestStr fsstr("fsstr"); + fs.add_var(&fsstr); + + TestByte fsab("fsab"); + TestArray fsarr("fsarr", &fsab); + fsarr.append_dim(5, "dim1"); + fsarr.append_dim(3, "dim2"); + fs.add_var(&fsarr); + + fs.deserialize(um, &dds, false); + + Int32 *fsi32_p = dynamic_cast (fs.var("fsi32")); + CPPUNIT_ASSERT( fsi32_p ); + CPPUNIT_ASSERT( fsi32_p->value() == i32->value() ); + + Str *fsstr_p = dynamic_cast (fs.var("fsstr")); + CPPUNIT_ASSERT( fsstr_p ); + DBG2(cerr << "fsstr_p->value(): " << fsstr_p->value() << endl); + CPPUNIT_ASSERT( fsstr_p->value().find("Silly test string:") != string::npos ); + + BaseType *bt = fs.var("fsab"); + CPPUNIT_ASSERT( bt ); + Array *fsarr_p = dynamic_cast (bt); + CPPUNIT_ASSERT( fsarr_p ); + dods_byte fdb[fsarr_p->length() * sizeof(dods_byte)]; + fsarr_p->value(fdb); + + CPPUNIT_ASSERT( fsarr_p->length() == arr->length() ); + CPPUNIT_ASSERT( !memcmp( (void *)fdb, (void *)db, fsarr_p->length() * sizeof( dods_byte ) ) ); + } + catch( Error &e ) { + string err = "failed:" + e.get_error_message(); + CPPUNIT_FAIL( err.c_str() ); + } + } + + void grid_file_serialize_test() + { + try { + FILE *f = fopen("g_test.file", "w"); + XDRFileMarshaller fm(f); + + TestGrid tg("grid1"); + TestArray arr2("arr2", ab); + arr2.append_dim(5, "dim1"); + arr2.append_dim(3, "dim2"); + tg.add_var(&arr2, array); + + TestArray map1("map1", f32); + map1.append_dim(5, "dim1"); + tg.add_var(&map1, maps); + + TestArray map2("map2", f32); + map2.append_dim(3, "dim2"); + tg.add_var(&map2, maps); + + tg.set_send_p(true); + tg.read(); + tg.set_read_p(true); + + tg.serialize(eval, dds, fm, false); + } + catch( Error &e ) { + string err = "failed:" + e.get_error_message(); + CPPUNIT_FAIL( err.c_str() ); + } + } - b.serialize( eval, dds, sm, false ) ; + void grid_file_deserialize_test() + { + try { + FILE *ff = fopen("g_test.file", "r"); + XDRFileUnMarshaller um(ff); + + TestGrid tg("grid1"); + TestArray arr2("arr2", ab); + arr2.append_dim(5, "dim1"); + arr2.append_dim(3, "dim2"); + tg.add_var(&arr2, array); + + TestArray map1("map1", f32); + map1.append_dim(5, "dim1"); + tg.add_var(&map1, maps); + + TestArray map2("map2", f32); + map2.append_dim(3, "dim2"); + tg.add_var(&map2, maps); + + tg.deserialize(um, &dds, false); + + // Check the values in the array + CPPUNIT_ASSERT( tg.get_array()->length() == arr->length() ); + + dods_byte fdb[tg.get_array()->length() * sizeof(dods_byte)]; + tg.get_array()->value(fdb); + CPPUNIT_ASSERT( !memcmp( (void *)fdb, (void *)db, tg.get_array()->length() * sizeof( dods_byte ) ) ); + + // Should test the map values here, but skip that for now... + } + catch( Error &e ) { + string err = "failed:" + e.get_error_message(); + CPPUNIT_FAIL( err.c_str() ); + } + } - i16.serialize( eval, dds, sm, false ) ; + void sequence_file_serialize_test() + { + try { + FILE *f = fopen("seq_test.file", "w"); + XDRFileMarshaller fm(f); - i32.serialize( eval, dds, sm, false ) ; + TestSequence seq("seq"); + seq.add_var(f64); + seq.add_var(arr); - ui16.serialize( eval, dds, sm, false ) ; + TestSequence seq2("seq2"); + seq2.add_var(ui16); + seq2.add_var(url); - ui32.serialize( eval, dds, sm, false ) ; + seq.add_var(&seq2); - f32.serialize( eval, dds, sm, false ) ; + seq.set_send_p(true); + seq.set_leaf_sequence(); - f64.serialize( eval, dds, sm, false ) ; + seq.serialize(eval, dds, fm, false); + } + catch( Error &e ) { + string err = "failed:" + e.get_error_message(); + CPPUNIT_FAIL( err.c_str() ); + } + } - str.serialize( eval, dds, sm, false ) ; + void sequence_file_deserialize_test() + { + try { + FILE *ff = fopen("seq_test.file", "r"); + XDRFileUnMarshaller um(ff); + + dods_byte fdb[arr->length() * sizeof(dods_byte)]; + + TestSequence seq("seq"); + seq.add_var(f64); + seq.add_var(arr); + + TestSequence seq2("seq2"); + seq2.add_var(ui16); + seq2.add_var(url); + seq2.set_send_p(true); + seq.add_var(&seq2); + seq.set_leaf_sequence(); + + seq.deserialize(um, &dds, false); + unsigned int num_rows = seq.number_of_rows(); + CPPUNIT_ASSERT( num_rows == 4 ); + for (unsigned int i = 0; i < num_rows; i++) { + BaseTypeRow *row = seq.row_value(i); + CPPUNIT_ASSERT( row ); + CPPUNIT_ASSERT( row->size() == 3 ); + Float64 *f64_p = dynamic_cast ((*row)[0]); + CPPUNIT_ASSERT( f64_p ); + CPPUNIT_ASSERT( f64_p->value() == f64->value() ); + + Array *arr_p = dynamic_cast ((*row)[1]); + CPPUNIT_ASSERT( arr_p ); + arr_p->value(fdb); + CPPUNIT_ASSERT( arr_p->length() == arr->length() ); + CPPUNIT_ASSERT( !memcmp( (void *)fdb, (void *)db, + arr_p->length() * sizeof( dods_byte ) ) ); + Sequence *seq_p = dynamic_cast ((*row)[2]); + CPPUNIT_ASSERT( seq_p ); + unsigned int num_rows_sub = seq_p->number_of_rows(); + CPPUNIT_ASSERT( num_rows == 4 ); + for (unsigned int j = 0; j < num_rows_sub; j++) { + BaseTypeRow *row_sub = seq_p->row_value(j); + CPPUNIT_ASSERT( row_sub ); + CPPUNIT_ASSERT( row_sub->size() == 2 ); + UInt16 *ui16_p = dynamic_cast ((*row_sub)[0]); + CPPUNIT_ASSERT( ui16_p ); + CPPUNIT_ASSERT( ui16_p->value() == ui16->value() ); + Url *url_p = dynamic_cast ((*row_sub)[1]); + CPPUNIT_ASSERT( url_p ); + CPPUNIT_ASSERT( url_p->value() == url->value() ); + } + } + } + catch( Error &e ) { + string err = "failed:" + e.get_error_message(); + CPPUNIT_FAIL( err.c_str() ); + } + } - url.serialize( eval, dds, sm, false ) ; + // Stream tests from here on - // strm.close() ; - } - catch( Error &e ) - { - string err = "failed:" + e.get_error_message() ; - CPPUNIT_FAIL( err.c_str() ) ; - } + void simple_types_stream_serialize_test() + { + try { + ofstream strm("st_test.strm", ios::out | ios::trunc); + XDRStreamMarshaller sm(strm); + + b->serialize(eval, dds, sm, false); + + i16->serialize(eval, dds, sm, false); + + i32->serialize(eval, dds, sm, false); + + ui16->serialize(eval, dds, sm, false); + + ui32->serialize(eval, dds, sm, false); + + f32->serialize(eval, dds, sm, false); + + f64->serialize(eval, dds, sm, false); + + str->serialize(eval, dds, sm, false); + + url->serialize(eval, dds, sm, false); + } + catch( Error &e ) { + string err = "failed:" + e.get_error_message(); + CPPUNIT_FAIL( err.c_str() ); + } } - void simple_types_stream_deserialize_test() { - try - { + void simple_types_stream_deserialize_test() + { + try { #if 0 - ifstream strm( "st_test.strm", ios::in ) ; - XDRStreamUnMarshaller um( strm ) ; + ifstream strm( "st_test.strm", ios::in ); + XDRStreamUnMarshaller um( strm ); #else - FILE *sf = fopen( "st_test.strm", "r" ) ; - XDRFileUnMarshaller um( sf ) ; + FILE *sf = fopen("st_test.strm", "r"); + XDRFileUnMarshaller um(sf); #endif - Byte fb( "fb" ) ; - fb.deserialize( um, &dds, false ) ; - CPPUNIT_ASSERT( fb.value() == b.value() ) ; - - Int16 fi16( "i16" ) ; - fi16.deserialize( um, &dds, false ) ; - CPPUNIT_ASSERT( fi16.value() == i16.value() ) ; - - Int32 fi32( "i32" ) ; - fi32.deserialize( um, &dds, false ) ; - CPPUNIT_ASSERT( fi32.value() == i32.value() ) ; - - UInt16 fui16( "ui16" ) ; - fui16.deserialize( um, &dds, false ) ; - CPPUNIT_ASSERT( fui16.value() == ui16.value() ) ; - - UInt32 fui32( "ui32" ) ; - fui32.deserialize( um, &dds, false ) ; - CPPUNIT_ASSERT( fui32.value() == ui32.value() ) ; - - Float32 ff32( "f32" ) ; - ff32.deserialize( um, &dds, false ) ; - CPPUNIT_ASSERT( ff32.value() == f32.value() ) ; - - Float64 ff64( "f64" ) ; - ff64.deserialize( um, &dds, false ) ; - CPPUNIT_ASSERT( ff64.value() == f64.value() ) ; - - Str fstr( "str" ) ; - fstr.deserialize( um, &dds, false ) ; - DBG(cerr << "fstr.value(): " << fstr.value() << endl); - CPPUNIT_ASSERT( fstr.value().find("Silly test string:") != string::npos ) ; - - Url furl( "url" ) ; - furl.deserialize( um, &dds, false ) ; - CPPUNIT_ASSERT( furl.value() == url_value ) ; - } - catch( Error &e ) - { - string err = "failed:" + e.get_error_message() ; - CPPUNIT_FAIL( err.c_str() ) ; - } + Byte fb("fb"); + fb.deserialize(um, &dds, false); + CPPUNIT_ASSERT( fb.value() == b->value() ); + + Int16 fi16("i16"); + fi16.deserialize(um, &dds, false); + CPPUNIT_ASSERT( fi16.value() == i16->value() ); + + Int32 fi32("i32"); + fi32.deserialize(um, &dds, false); + CPPUNIT_ASSERT( fi32.value() == i32->value() ); + + UInt16 fui16("ui16"); + fui16.deserialize(um, &dds, false); + CPPUNIT_ASSERT( fui16.value() == ui16->value() ); + + UInt32 fui32("ui32"); + fui32.deserialize(um, &dds, false); + CPPUNIT_ASSERT( fui32.value() == ui32->value() ); + + Float32 ff32("f32"); + ff32.deserialize(um, &dds, false); + CPPUNIT_ASSERT( ff32.value() == f32->value() ); + + Float64 ff64("f64"); + ff64.deserialize(um, &dds, false); + CPPUNIT_ASSERT( ff64.value() == f64->value() ); + + Str fstr("str"); + fstr.deserialize(um, &dds, false); + DBG(cerr << "fstr.value(): " << fstr.value() << endl); + CPPUNIT_ASSERT( fstr.value().find("Silly test string:") != string::npos ); + + Url furl("url"); + furl.deserialize(um, &dds, false); + CPPUNIT_ASSERT( furl.value() == url_value ); + } + catch( Error &e ) { + string err = "failed:" + e.get_error_message(); + CPPUNIT_FAIL( err.c_str() ); + } } #if 0 // Not currently run... void simple_types_fdistream_deserialize_test() { - try - { + try + { #if 1 - int in = open( "st_test.strm", O_RDONLY ); - if (in < 0) - throw Error("Could not open file."); - fdistream sin( in ); + int in = open( "st_test.strm", O_RDONLY ); + if (in < 0) + throw Error("Could not open file."); + fdistream sin( in ); #else - FILE *in = fopen("st_test.strm", "r"); - if (!in) - throw Error("Could not open the file"); - fpistream sin(in); -#endif - XDRStreamUnMarshaller um( sin ) ; - - Byte fb( "fb" ) ; - fb.deserialize( um, &dds, false ) ; - DBG(std::cerr << "expected: '" << b.value() << "' ; actual: '" << fb.value() << "'" << std::endl); - CPPUNIT_ASSERT( fb.value() == b.value() ) ; - - Int16 fi16( "i16" ) ; - fi16.deserialize( um, &dds, false ) ; - CPPUNIT_ASSERT( fi16.value() == i16.value() ) ; - - Int32 fi32( "i32" ) ; - fi32.deserialize( um, &dds, false ) ; - CPPUNIT_ASSERT( fi32.value() == i32.value() ) ; - - UInt16 fui16( "ui16" ) ; - fui16.deserialize( um, &dds, false ) ; - CPPUNIT_ASSERT( fui16.value() == ui16.value() ) ; - - UInt32 fui32( "ui32" ) ; - fui32.deserialize( um, &dds, false ) ; - CPPUNIT_ASSERT( fui32.value() == ui32.value() ) ; - - Float32 ff32( "f32" ) ; - ff32.deserialize( um, &dds, false ) ; - CPPUNIT_ASSERT( ff32.value() == f32.value() ) ; - - Float64 ff64( "f64" ) ; - ff64.deserialize( um, &dds, false ) ; - CPPUNIT_ASSERT( ff64.value() == f64.value() ) ; - - Str fstr( "str" ) ; - fstr.deserialize( um, &dds, false ) ; - DBG(cerr << "fstr.value(): " << fstr.value() << endl); - CPPUNIT_ASSERT( fstr.value().find("Silly test string:") != string::npos ) ; - - Url furl( "url" ) ; - furl.deserialize( um, &dds, false ) ; - CPPUNIT_ASSERT( furl.value() == url_value ) ; - } - catch( Error &e ) - { - string err = "failed:" + e.get_error_message() ; - CPPUNIT_FAIL( err.c_str() ) ; - } - } -#endif - - void array_stream_serialize_test() { - try - { - ofstream strm( "a_test.strm", ios::out|ios::trunc ) ; - XDRStreamMarshaller sm( strm ) ; - - arr.serialize( eval, dds, sm, false ) ; - - // strm.close() ; - } - catch( Error &e ) - { - string err = "failed:" + e.get_error_message() ; - CPPUNIT_FAIL( err.c_str() ) ; - } - } - - void array_stream_deserialize_test() { - try - { + FILE *in = fopen("st_test.strm", "r"); + if (!in) + throw Error("Could not open the file"); + fpistream sin(in); +#endif + XDRStreamUnMarshaller um( sin ); + + Byte fb( "fb" ); + fb.deserialize( um, &dds, false ); + DBG(std::cerr << "expected: '" << b.value() << "' ; actual: '" << fb.value() << "'" << std::endl); + CPPUNIT_ASSERT( fb.value() == b->value() ); + + Int16 fi16( "i16" ); + fi16.deserialize( um, &dds, false ); + CPPUNIT_ASSERT( fi16.value() == i16->value() ); + + Int32 fi32( "i32" ); + fi32.deserialize( um, &dds, false ); + CPPUNIT_ASSERT( fi32.value() == i32->value() ); + + UInt16 fui16( "ui16" ); + fui16.deserialize( um, &dds, false ); + CPPUNIT_ASSERT( fui16.value() == ui16->value() ); + + UInt32 fui32( "ui32" ); + fui32.deserialize( um, &dds, false ); + CPPUNIT_ASSERT( fui32.value() == ui32->value() ); + + Float32 ff32( "f32" ); + ff32.deserialize( um, &dds, false ); + CPPUNIT_ASSERT( ff32.value() == f32->value() ); + + Float64 ff64( "f64" ); + ff64.deserialize( um, &dds, false ); + CPPUNIT_ASSERT( ff64.value() == f64->value() ); + + Str fstr( "str" ); + fstr.deserialize( um, &dds, false ); + DBG(cerr << "fstr.value(): " << fstr.value() << endl); + CPPUNIT_ASSERT( fstr.value().find("Silly test string:") != string::npos ); + + Url furl( "url" ); + furl.deserialize( um, &dds, false ); + CPPUNIT_ASSERT( furl.value() == url_value ); + } + catch( Error &e ) + { + string err = "failed:" + e.get_error_message(); + CPPUNIT_FAIL( err.c_str() ); + } + } +#endif + + void array_stream_serialize_test() + { + try { + ofstream strm("a_test.strm", ios::out | ios::trunc); + XDRStreamMarshaller sm(strm); + + arr->serialize(eval, dds, sm, false); + } + catch( Error &e ) { + string err = "failed:" + e.get_error_message(); + CPPUNIT_FAIL( err.c_str() ); + } + } + + void array_stream_deserialize_test() + { + try { #if 0 - ifstream strm( "a_test.strm", ios::in ) ; - XDRStreamUnMarshaller um( strm ) ; + ifstream strm( "a_test.strm", ios::in ); + XDRStreamUnMarshaller um( strm ); #else - FILE *sf = fopen( "a_test.strm", "r" ) ; - XDRFileUnMarshaller um( sf ) ; + FILE *sf = fopen("a_test.strm", "r"); + XDRFileUnMarshaller um(sf); #endif - TestByte fab( "ab" ) ; - TestArray farr( "arr", &fab ) ; - farr.append_dim( 5, "dim1" ) ; - farr.append_dim( 3, "dim2" ) ; - farr.deserialize( um, &dds, false ) ; - - CPPUNIT_ASSERT( farr.length() == arr.length() ) ; - - dods_byte fdb[arr.length() * sizeof(dods_byte)] ; - farr.value( fdb ) ; - CPPUNIT_ASSERT( !memcmp( (void *)fdb, (void *)db, farr.length() * sizeof( dods_byte ) ) ) ; - - // fclose( sf ) ; - } - catch( Error &e ) - { - string err = "failed:" + e.get_error_message() ; - CPPUNIT_FAIL( err.c_str() ) ; - } - } - - void structure_stream_serialize_test() { - try - { - ofstream strm( "struct_test.strm", ios::out|ios::trunc ) ; - XDRStreamMarshaller sm( strm ) ; - - TestStructure s( "s" ) ; - s.add_var( &i32 ) ; - s.add_var( &str ) ; - s.add_var( &arr ) ; - s.set_send_p( true ) ; - - s.serialize( eval, dds, sm, false ) ; - - // strm.close() ; - } - catch( Error &e ) - { - string err = "failed:" + e.get_error_message() ; - CPPUNIT_FAIL( err.c_str() ) ; - } - } - - void structure_stream_deserialize_test() { - try - { + TestByte fab("ab"); + TestArray farr("arr", &fab); + farr.append_dim(5, "dim1"); + farr.append_dim(3, "dim2"); + farr.deserialize(um, &dds, false); + + CPPUNIT_ASSERT( farr.length() == arr->length() ); + + dods_byte fdb[arr->length() * sizeof(dods_byte)]; + farr.value(fdb); + CPPUNIT_ASSERT( !memcmp( (void *)fdb, (void *)db, farr.length() * sizeof( dods_byte ) ) ); + } + catch( Error &e ) { + string err = "failed:" + e.get_error_message(); + CPPUNIT_FAIL( err.c_str() ); + } + } + + void structure_stream_serialize_test() + { + try { + ofstream strm("struct_test.strm", ios::out | ios::trunc); + XDRStreamMarshaller sm(strm); + s->serialize(eval, dds, sm, false); + } + catch( Error &e ) { + string err = "failed:" + e.get_error_message(); + CPPUNIT_FAIL( err.c_str() ); + } + } + + void structure_stream_deserialize_test() + { + try { #if 0 - ifstream strm( "struct_test.strm", ios::in ) ; - XDRStreamUnMarshaller um( strm ) ; + ifstream strm( "struct_test.strm", ios::in ); + XDRStreamUnMarshaller um( strm ); #else - FILE *sf = fopen( "struct_test.strm", "r" ) ; - XDRFileUnMarshaller um( sf ) ; + FILE *sf = fopen("struct_test.strm", "r"); + XDRFileUnMarshaller um(sf); #endif - TestStructure fs( "fs" ) ; - TestInt32 fsi32( "fsi32" ) ; - fs.add_var( &fsi32 ) ; - - TestStr fsstr( "fsstr" ) ; - fs.add_var( &fsstr ) ; - - TestByte fsab( "fsab" ) ; - TestArray fsarr( "fsarr", &fsab ) ; - fsarr.append_dim( 5, "dim1" ) ; - fsarr.append_dim( 3, "dim2" ) ; - fs.add_var( &fsarr ) ; - - fs.deserialize( um, &dds, false ) ; - - Int32 *fsi32_p = dynamic_cast(fs.var( "fsi32" )) ; - CPPUNIT_ASSERT( fsi32_p ) ; - CPPUNIT_ASSERT( fsi32_p->value() == i32.value() ) ; - - Str *fsstr_p = dynamic_cast(fs.var( "fsstr" )) ; - CPPUNIT_ASSERT( fsstr_p ) ; - DBG(cerr << "fsstr_p->value(): " << fsstr_p->value() << endl); - CPPUNIT_ASSERT( fsstr_p->value().find("Silly test string:") != string::npos ) ; - - BaseType *bt = fs.var( "fsab" ) ; - CPPUNIT_ASSERT( bt ) ; - Array *fsarr_p = dynamic_cast(bt) ; - CPPUNIT_ASSERT( fsarr_p ) ; - CPPUNIT_ASSERT( fsarr_p->length() == arr.length() ) ; - dods_byte fdb[fsarr_p->length() * sizeof(dods_byte)] ; - fsarr_p->value( fdb ) ; - CPPUNIT_ASSERT( !memcmp( (void *)fdb, (void *)db, fsarr_p->length() * sizeof( dods_byte ) ) ) ; - - // fclose( sf ) ; - } - catch( Error &e ) - { - string err = "failed:" + e.get_error_message() ; - CPPUNIT_FAIL( err.c_str() ) ; - } - } - - void grid_stream_serialize_test() { - try - { - ofstream strm( "g_test.strm", ios::out|ios::trunc ) ; - XDRStreamMarshaller sm( strm ) ; - - TestGrid tg( "grid1" ); - TestArray arr2( "arr2", &ab ) ; - arr2.append_dim( 5, "dim1" ) ; - arr2.append_dim( 3, "dim2" ) ; - tg.add_var( &arr2, array ); - - TestArray map1( "map1", &f32 ) ; - map1.append_dim( 5, "dim1" ) ; - tg.add_var( &map1, maps ); - - TestArray map2( "map2", &f32 ) ; - map2.append_dim( 3, "dim2" ) ; - tg.add_var( &map2, maps ); - - tg.set_send_p(true); - tg.read(); - tg.set_read_p(true); - - tg.serialize( eval, dds, sm, false ) ; - - // strm.close() ; - } - catch( Error &e ) - { - string err = "failed:" + e.get_error_message() ; - CPPUNIT_FAIL( err.c_str() ) ; - } - } - - void grid_stream_deserialize_test() { - try - { + TestStructure fs("fs"); + TestInt32 fsi32("fsi32"); + fs.add_var(&fsi32); + + TestStr fsstr("fsstr"); + fs.add_var(&fsstr); + + TestByte fsab("fsab"); + TestArray fsarr("fsarr", &fsab); + fsarr.append_dim(5, "dim1"); + fsarr.append_dim(3, "dim2"); + fs.add_var(&fsarr); + + fs.deserialize(um, &dds, false); + + Int32 *fsi32_p = dynamic_cast (fs.var("fsi32")); + CPPUNIT_ASSERT( fsi32_p ); + CPPUNIT_ASSERT( fsi32_p->value() == i32->value() ); + + Str *fsstr_p = dynamic_cast (fs.var("fsstr")); + CPPUNIT_ASSERT( fsstr_p ); + DBG(cerr << "fsstr_p->value(): " << fsstr_p->value() << endl); + CPPUNIT_ASSERT( fsstr_p->value().find("Silly test string:") != string::npos ); + + BaseType *bt = fs.var("fsab"); + CPPUNIT_ASSERT( bt ); + Array *fsarr_p = dynamic_cast (bt); + CPPUNIT_ASSERT( fsarr_p ); + CPPUNIT_ASSERT( fsarr_p->length() == arr->length() ); + dods_byte fdb[fsarr_p->length() * sizeof(dods_byte)]; + fsarr_p->value(fdb); + CPPUNIT_ASSERT( !memcmp( (void *)fdb, (void *)db, fsarr_p->length() * sizeof( dods_byte ) ) ); + } + catch( Error &e ) { + string err = "failed:" + e.get_error_message(); + CPPUNIT_FAIL( err.c_str() ); + } + } + + void grid_stream_serialize_test() + { + try { + ofstream strm("g_test.strm", ios::out | ios::trunc); + XDRStreamMarshaller sm(strm); + + TestGrid tg("grid1"); + TestArray arr2("arr2", ab); + arr2.append_dim(5, "dim1"); + arr2.append_dim(3, "dim2"); + tg.add_var(&arr2, array); + + TestArray map1("map1", f32); + map1.append_dim(5, "dim1"); + tg.add_var(&map1, maps); + + TestArray map2("map2", f32); + map2.append_dim(3, "dim2"); + tg.add_var(&map2, maps); + + tg.set_send_p(true); + tg.read(); + tg.set_read_p(true); + + tg.serialize(eval, dds, sm, false); + + // strm.close() ; + } + catch( Error &e ) { + string err = "failed:" + e.get_error_message(); + CPPUNIT_FAIL( err.c_str() ); + } + } + + void grid_stream_deserialize_test() + { + try { #if 0 - ifstream strm( "g_test.strm", ios::in ) ; - XDRStreamUnMarshaller um( strm ) ; + ifstream strm( "g_test.strm", ios::in ); + XDRStreamUnMarshaller um( strm ); #else - FILE *sf = fopen( "g_test.strm", "r" ) ; - XDRFileUnMarshaller um( sf ) ; + FILE *sf = fopen("g_test.strm", "r"); + XDRFileUnMarshaller um(sf); #endif - TestGrid tg( "grid1" ); - TestArray arr2( "arr2", &ab ) ; - arr2.append_dim( 5, "dim1" ) ; - arr2.append_dim( 3, "dim2" ) ; - tg.add_var(&arr2, array); - - TestArray map1( "map1", &f32 ) ; - map1.append_dim( 5, "dim1" ) ; - tg.add_var(&map1, maps); - - TestArray map2( "map2", &f32 ) ; - map2.append_dim( 3, "dim2" ) ; - tg.add_var(&map2, maps); - - tg.deserialize( um, &dds, false ) ; - - // Check the values in the array - CPPUNIT_ASSERT( tg.get_array()->length() == arr.length() ) ; - - dods_byte fdb[tg.get_array()->length() * sizeof(dods_byte)] ; - tg.get_array()->value( fdb ) ; - CPPUNIT_ASSERT( !memcmp( (void *)fdb, (void *)db, tg.get_array()->length() * sizeof( dods_byte ) ) ) ; - - // Should test the map values here, but skip that for now... - - // fclose( sf ) ; - } - catch( Error &e ) - { - string err = "failed:" + e.get_error_message() ; - CPPUNIT_FAIL( err.c_str() ) ; - } - } - - void sequence_stream_serialize_test() { - try - { - ofstream strm( "seq_test.strm", ios::out|ios::trunc ) ; - XDRStreamMarshaller sm( strm ) ; - - TestSequence seq( "seq" ) ; - seq.add_var( &f64 ) ; - seq.add_var( &arr ) ; - - TestSequence seq2( "seq2" ) ; - seq2.add_var( &ui16 ) ; - seq2.add_var( &url ) ; - seq.add_var( &seq2 ) ; - - seq.set_send_p( true ) ; - seq.set_leaf_sequence() ; - - seq.serialize( eval, dds, sm, false ) ; - - // strm.close() ; - } - catch( Error &e ) - { - string err = "failed:" + e.get_error_message() ; - CPPUNIT_FAIL( err.c_str() ) ; - } - } - - void sequence_stream_deserialize_test() { - try - { + TestGrid tg("grid1"); + TestArray arr2("arr2", ab); + arr2.append_dim(5, "dim1"); + arr2.append_dim(3, "dim2"); + tg.add_var(&arr2, array); + + TestArray map1("map1", f32); + map1.append_dim(5, "dim1"); + tg.add_var(&map1, maps); + + TestArray map2("map2", f32); + map2.append_dim(3, "dim2"); + tg.add_var(&map2, maps); + + tg.deserialize(um, &dds, false); + + // Check the values in the array + CPPUNIT_ASSERT( tg.get_array()->length() == arr->length() ); + + dods_byte fdb[tg.get_array()->length() * sizeof(dods_byte)]; + tg.get_array()->value(fdb); + CPPUNIT_ASSERT( !memcmp( (void *)fdb, (void *)db, tg.get_array()->length() * sizeof( dods_byte ) ) ); + + // Should test the map values here, but skip that for now... + + // fclose( sf ) ; + } + catch( Error &e ) { + string err = "failed:" + e.get_error_message(); + CPPUNIT_FAIL( err.c_str() ); + } + } + + void sequence_stream_serialize_test() + { + try { + ofstream strm("seq_test.strm", ios::out | ios::trunc); + XDRStreamMarshaller sm(strm); + + TestSequence seq("seq"); + seq.add_var(f64); + seq.add_var(arr); + + TestSequence seq2("seq2"); + seq2.add_var(ui16); + seq2.add_var(url); + seq.add_var(&seq2); + + seq.set_send_p(true); + seq.set_leaf_sequence(); + + seq.serialize(eval, dds, sm, false); + + // strm.close() ; + } + catch( Error &e ) { + string err = "failed:" + e.get_error_message(); + CPPUNIT_FAIL( err.c_str() ); + } + } + + void sequence_stream_deserialize_test() + { + try { #if 0 - ifstream strm( "seq_test.strm", ios::in ) ; - XDRStreamUnMarshaller um( strm ) ; + ifstream strm( "seq_test.strm", ios::in ); + XDRStreamUnMarshaller um( strm ); #else - FILE *sf = fopen( "seq_test.strm", "r" ) ; - XDRFileUnMarshaller um( sf ) ; + FILE *sf = fopen("seq_test.strm", "r"); + XDRFileUnMarshaller um(sf); #endif - dods_byte fdb[arr.length() * sizeof(dods_byte)] ; + dods_byte fdb[arr->length() * sizeof(dods_byte)]; + + TestSequence seq("seq"); + seq.add_var(f64); + seq.add_var(arr); + + TestSequence seq2("seq2"); + seq2.add_var(ui16); + seq2.add_var(url); + + seq.add_var(&seq2); + + seq.set_leaf_sequence(); + + seq.deserialize(um, &dds, false); + + unsigned int num_rows = seq.number_of_rows(); + CPPUNIT_ASSERT( num_rows == 4 ); + for (unsigned int i = 0; i < num_rows; i++) { + BaseTypeRow *row = seq.row_value(i); + CPPUNIT_ASSERT( row ); + CPPUNIT_ASSERT( row->size() == 3 ); + Float64 *f64_p = dynamic_cast ((*row)[0]); + CPPUNIT_ASSERT( f64_p ); + CPPUNIT_ASSERT( f64_p->value() == f64->value() ); + Array *arr_p = dynamic_cast ((*row)[1]); + CPPUNIT_ASSERT( arr_p ); + arr_p->value(fdb); + CPPUNIT_ASSERT( arr_p->length() == arr->length() ); + CPPUNIT_ASSERT( !memcmp( (void *)fdb, (void *)db, + arr_p->length() * sizeof( dods_byte ) ) ); + Sequence *seq_p = dynamic_cast ((*row)[2]); + CPPUNIT_ASSERT( seq_p ); + unsigned int num_rows_sub = seq_p->number_of_rows(); + CPPUNIT_ASSERT( num_rows == 4 ); + for (unsigned int j = 0; j < num_rows_sub; j++) { + BaseTypeRow *row_sub = seq_p->row_value(j); + CPPUNIT_ASSERT( row_sub ); + CPPUNIT_ASSERT( row_sub->size() == 2 ); + UInt16 *ui16_p = dynamic_cast ((*row_sub)[0]); + CPPUNIT_ASSERT( ui16_p ); + CPPUNIT_ASSERT( ui16_p->value() == ui16->value() ); + Url *url_p = dynamic_cast ((*row_sub)[1]); + CPPUNIT_ASSERT( url_p ); + CPPUNIT_ASSERT( url_p->value() == url->value() ); + } + } + + // fclose( sf ) ; + } + catch( Error &e ) { + string err = "failed:" + e.get_error_message(); + CPPUNIT_FAIL( err.c_str() ); + } + } + +#if CHECKSUMS + // Check sum tests - TestSequence seq( "seq" ) ; - seq.add_var( &f64 ) ; - seq.add_var( &arr ) ; - - TestSequence seq2( "seq2" ) ; - seq2.add_var( &ui16 ) ; - seq2.add_var( &url ) ; - - seq.add_var( &seq2 ) ; - - seq.set_leaf_sequence() ; - - seq.deserialize( um, &dds, false ) ; - - unsigned int num_rows = seq.number_of_rows() ; - CPPUNIT_ASSERT( num_rows == 4 ) ; - for( unsigned int i = 0; i < num_rows; i++ ) - { - BaseTypeRow *row = seq.row_value( i ) ; - CPPUNIT_ASSERT( row ) ; - CPPUNIT_ASSERT( row->size() == 3 ) ; - Float64 *f64_p = dynamic_cast((*row)[0]) ; - CPPUNIT_ASSERT( f64_p ) ; - CPPUNIT_ASSERT( f64_p->value() == f64.value() ) ; - Array *arr_p = dynamic_cast((*row)[1]) ; - CPPUNIT_ASSERT( arr_p ) ; - arr_p->value( fdb ) ; - CPPUNIT_ASSERT( arr_p->length() == arr.length() ) ; - CPPUNIT_ASSERT( !memcmp( (void *)fdb, (void *)db, - arr_p->length() * sizeof( dods_byte ) ) ) ; - Sequence *seq_p = dynamic_cast((*row)[2]) ; - CPPUNIT_ASSERT( seq_p ) ; - unsigned int num_rows_sub = seq_p->number_of_rows() ; - CPPUNIT_ASSERT( num_rows == 4 ) ; - for( unsigned int j = 0; j < num_rows_sub; j++ ) - { - BaseTypeRow *row_sub = seq_p->row_value( j ) ; - CPPUNIT_ASSERT( row_sub ) ; - CPPUNIT_ASSERT( row_sub->size() == 2 ) ; - UInt16 *ui16_p = dynamic_cast((*row_sub)[0]) ; - CPPUNIT_ASSERT( ui16_p ) ; - CPPUNIT_ASSERT( ui16_p->value() == ui16.value() ) ; - Url *url_p = dynamic_cast((*row_sub)[1]) ; - CPPUNIT_ASSERT( url_p ) ; - CPPUNIT_ASSERT( url_p->value() == url.value() ) ; - } - } - - // fclose( sf ) ; - } - catch( Error &e ) - { - string err = "failed:" + e.get_error_message() ; - CPPUNIT_FAIL( err.c_str() ) ; - } + void simple_types_stream_serialize_checksum_test() + { + try { + ofstream strm("st_test.strm", ios::out | ios::trunc); + XDRStreamMarshaller sm(strm, true); + + sm.reset_checksum(); + b->serialize(eval, dds, sm, false); + DBG(cerr << sm.get_checksum() << endl); + CPPUNIT_ASSERT(sm.get_checksum() == "85e53271e14006f0265921d02d4d736cdc580b0b"); + + sm.reset_checksum(); + i16->serialize(eval, dds, sm, false); + DBG(cerr << sm.get_checksum() << endl); + CPPUNIT_ASSERT(sm.get_checksum() == "fb7cc6f64453ad5a9926a1ba40955198004f6b31"); + + sm.reset_checksum(); + i32->serialize(eval, dds, sm, false); + DBG(cerr << sm.get_checksum() << endl); + CPPUNIT_ASSERT(sm.get_checksum() == "d245351a7b5cf9244f146fa0763b4dd036245666"); + + sm.reset_checksum(); + ui16->serialize(eval, dds, sm, false); + DBG(cerr << sm.get_checksum() << endl); + CPPUNIT_ASSERT(sm.get_checksum() == "f1e39479b3f84f40a6dca061ace8c910036cb867"); + + sm.reset_checksum(); + ui32->serialize(eval, dds, sm, false); + DBG(cerr << sm.get_checksum() << endl); + CPPUNIT_ASSERT(sm.get_checksum() == "0d75307097b3f51d5b327f59e775165d4b1bfefa"); + + sm.reset_checksum(); + f32->serialize(eval, dds, sm, false); + DBG(cerr << sm.get_checksum() << endl); + CPPUNIT_ASSERT(sm.get_checksum() == "16b84e7d293b3a53ceb97b9e50999b7ca2d17204"); + + sm.reset_checksum(); + f64->serialize(eval, dds, sm, false); + DBG(cerr << sm.get_checksum() << endl); + CPPUNIT_ASSERT(sm.get_checksum() == "e8f339d9807f4998d8dc11e4c9d6f2ed05ca50cb"); + + sm.reset_checksum(); + str->serialize(eval, dds, sm, false); + string cs = sm.get_checksum(); + DBG(cerr << "cs: " << cs << endl); + // This value changes with the number of times str is serialized + // since the TestStr class returns different values for each call + // to read(). + CPPUNIT_ASSERT(cs == "77b52cf559aec21b5bb06785693c915cdd7983c3"); + + sm.reset_checksum(); + url->serialize(eval, dds, sm, false); + cs = sm.get_checksum(); + DBG(cerr << "cs: " << cs << endl); + CPPUNIT_ASSERT(cs == "18c61893206349dfc1ee4d030cfa18f924d44571"); + } + catch( Error &e ) { + string err = "failed:" + e.get_error_message(); + CPPUNIT_FAIL( err.c_str() ); + } + } + + void array_stream_serialize_checksum_test() + { + try { + ofstream strm("a_test.strm", ios::out | ios::trunc); + XDRStreamMarshaller sm(strm, true); + + sm.reset_checksum(); + arr->serialize(eval, dds, sm, false); + string cs = sm.get_checksum(); + + DBG(cerr << cs << endl); + CPPUNIT_ASSERT(cs == "9f39fdfeaf3d34181b346e2eec26abe9d9cdde3a"); + } + catch( Error &e ) { + string err = "failed:" + e.get_error_message(); + CPPUNIT_FAIL( err.c_str() ); + } + } + + void structure_stream_serialize_checksum_test() + { + try { + ofstream strm("struct_test.strm", ios::out | ios::trunc); + XDRStreamMarshaller sm(strm, true); + sm.reset_checksum(); + s->serialize(eval, dds, sm, false); + string cs = sm.get_checksum(); + + DBG(cerr << cs << endl); + CPPUNIT_ASSERT(cs == "9f39fdfeaf3d34181b346e2eec26abe9d9cdde3a"); + } + catch( Error &e ) { + string err = "failed:" + e.get_error_message(); + CPPUNIT_FAIL( err.c_str() ); + } } + + void grid_stream_serialize_checksum_test() + { + try { + ofstream strm("g_test.strm", ios::out | ios::trunc); + XDRStreamMarshaller sm(strm, true); + + TestGrid tg("grid1"); + TestArray arr2("arr2", ab); + arr2.append_dim(5, "dim1"); + arr2.append_dim(3, "dim2"); + tg.add_var(&arr2, array); + + TestArray map1("map1", f32); + map1.append_dim(5, "dim1"); + tg.add_var(&map1, maps); + + TestArray map2("map2", f32); + map2.append_dim(3, "dim2"); + tg.add_var(&map2, maps); + + tg.set_send_p(true); + tg.read(); + tg.set_read_p(true); + + sm.reset_checksum(); + tg.serialize(eval, dds, sm, false); + string cs = sm.get_checksum(); + + DBG(cerr << cs << endl); + CPPUNIT_ASSERT(cs == "ed67de94237ec33d220d8fb75734c195d64d4794"); + } + catch( Error &e ) { + string err = "failed:" + e.get_error_message(); + CPPUNIT_FAIL( err.c_str() ); + } + } + + // This test is broken because Sequence::serialize() does not + // properly call the checksum methods. + void sequence_stream_serialize_checksum_test() + { + try { + ofstream strm("seq_test.strm", ios::out | ios::trunc); + XDRStreamMarshaller sm(strm, true); + + TestSequence seq("seq"); + seq.add_var(f64); + seq.add_var(arr); + + TestSequence seq2("seq2"); + seq2.add_var(ui16); + seq2.add_var(url); + seq.add_var(&seq2); + + seq.set_send_p(true); + seq.set_leaf_sequence(); + + sm.reset_checksum(); + seq.serialize(eval, dds, sm, false); + string cs = sm.get_checksum(); + + DBG(cerr << cs << endl); + CPPUNIT_ASSERT(cs == "7b99e35c2fb361eb27f51aec30fc2a17ac8cda50"); + } + catch( Error &e ) { + string err = "failed:" + e.get_error_message(); + CPPUNIT_FAIL( err.c_str() ); + } + } +#endif }; CPPUNIT_TEST_SUITE_REGISTRATION( MarshallerTest ) ; int main(int, char **) { - CppUnit::TextUi::TestRunner runner ; - CppUnit::TestFactoryRegistry ®istry = - CppUnit::TestFactoryRegistry::getRegistry() ; - runner.addTest( registry.makeTest() ) ; - runner.setOutputter( CppUnit::CompilerOutputter::defaultOutputter( - &runner.result(), - std::cerr ) ); - bool wasSuccessful = runner.run( "", false ) ; + CppUnit::TextUi::TestRunner runner; + CppUnit::TestFactoryRegistry ®istry = CppUnit::TestFactoryRegistry::getRegistry(); + runner.addTest(registry.makeTest()); + runner.setOutputter(CppUnit::CompilerOutputter::defaultOutputter(&runner.result(), std::cerr)); + bool wasSuccessful = runner.run("", false); return wasSuccessful ? 0 : 1; } - diff -Nru libdap-3.11.1/unit-tests/RCReaderTest.cc libdap-3.12.0/unit-tests/RCReaderTest.cc --- libdap-3.11.1/unit-tests/RCReaderTest.cc 2011-04-29 13:19:42.000000000 +0000 +++ libdap-3.12.0/unit-tests/RCReaderTest.cc 2013-10-17 21:27:40.000000000 +0000 @@ -19,7 +19,7 @@ // // You should have received a copy of the GNU Lesser General Public // License along with this library; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA // // You can contact OPeNDAP, Inc. at PO Box 112, Saunderstown, RI. 02874-0112. @@ -31,6 +31,7 @@ #include #endif +#include #include #include diff -Nru libdap-3.11.1/unit-tests/RegexTest.cc libdap-3.12.0/unit-tests/RegexTest.cc --- libdap-3.11.1/unit-tests/RegexTest.cc 2011-04-29 13:19:42.000000000 +0000 +++ libdap-3.12.0/unit-tests/RegexTest.cc 2013-10-17 21:27:40.000000000 +0000 @@ -19,7 +19,7 @@ // // You should have received a copy of the GNU Lesser General Public // License along with this library; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA // // You can contact OPeNDAP, Inc. at PO Box 112, Saunderstown, RI. 02874-0112. diff -Nru libdap-3.11.1/unit-tests/ResponseBuilderTest.cc libdap-3.12.0/unit-tests/ResponseBuilderTest.cc --- libdap-3.11.1/unit-tests/ResponseBuilderTest.cc 2011-04-29 13:19:42.000000000 +0000 +++ libdap-3.12.0/unit-tests/ResponseBuilderTest.cc 1970-01-01 00:00:00.000000000 +0000 @@ -1,494 +0,0 @@ -// -*- mode: c++; c-basic-offset:4 -*- - -// This file is part of libdap, A C++ implementation of the OPeNDAP Data -// Access Protocol. - -// Copyright (c) 2002,2003 OPeNDAP, Inc. -// Author: James Gallagher -// -// This library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Lesser General Public -// License as published by the Free Software Foundation; either -// version 2.1 of the License, or (at your option) any later version. -// -// This library 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 -// Lesser General Public License for more details. -// -// You should have received a copy of the GNU Lesser General Public -// License along with this library; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -// -// You can contact OPeNDAP, Inc. at PO Box 112, Saunderstown, RI. 02874-0112. - -#include "config.h" - -#include -#include -#include - -#include -#include -#include // for stat -#include -#include - -//#define DODS_DEBUG - -#include "ObjectType.h" -#include "EncodingType.h" -#include "ResponseBuilder.h" -#include "DAS.h" -#include "DDS.h" -#include "GNURegex.h" -#include "debug.h" - -#include "../tests/TestTypeFactory.h" -#include "../tests/TestByte.h" - -#include - -using namespace CppUnit; -using namespace std; -using namespace libdap; - -int test_variable_sleep_interval = 0; - -namespace libdap { - -class ResponseBuilderTest: public TestFixture { -private: - ResponseBuilder *df, *df1, *df2, *df3, *df4, *df5; - - AttrTable *cont_a; - DAS *das; - DDS *dds; - ostringstream oss; - time_t now; - char now_array[256]; - -public: - ResponseBuilderTest() - { - now = time(0); - ostringstream time_string; - time_string << (int) now; - strncpy(now_array, time_string.str().c_str(), 255); - now_array[255] = '\0'; - } - - ~ResponseBuilderTest() - { - } - - void setUp() - { - // Test pathname - df = new ResponseBuilder(); -#if 0 - df->d_url = (string) TEST_SRC_DIR + "/server-testsuite/bears.data"; -#endif - // Test missing file - df1 = new ResponseBuilder(); - df1->set_dataset_name("no-such-file"); - - // Test files in CWD. Note that the time is the GM time : Tue, 01 May - // 2001 01:08:14 -0700 - df2 = new ResponseBuilder(); - df2->set_dataset_name("test_config.h"); - - // This file has an ancillary DAS in the server-testsuite dir. - // df3 is also used to test escaping stuff in URLs. 5/4/2001 jhrg - df3 = new ResponseBuilder(); - df3->set_dataset_name((string) TEST_SRC_DIR + "/server-testsuite/coads.data"); - df3->set_ce("u,x,z[0]&grid(u,\"lat<10.0\")"); - df3->set_timeout(1); - - // Go back to this data source to test w/o an ancillary DAS. - df4 = new ResponseBuilder(); - df4->set_dataset_name((string) TEST_SRC_DIR + "/server-testsuite/bears.data"); - df4->set_ce("u,x,z[0]&grid(u,\"lat<10.0\")"); - df4->set_timeout(1); - - // Test escaping stuff. 5/4/2001 jhrg - df5 = new ResponseBuilder(); - df5->set_dataset_name("nowhere%5Bmydisk%5Dmyfile"); - df5->set_ce("u%5B0%5D"); - - cont_a = new AttrTable; - cont_a->append_attr("size", "Int32", "7"); - cont_a->append_attr("type", "String", "cars"); - das = new DAS; - das->add_table("a", cont_a); - - // This AttrTable looks like: - // Attributes { - // a { - // Int32 size 7; - // String type cars; - // } - // } - - TestTypeFactory ttf; - dds = new DDS(&ttf, "test"); - TestByte a("a"); - dds->add_var(&a); - - dds->transfer_attributes(das); - dds->set_dap_major(3); - dds->set_dap_minor(2); - } - - void tearDown() - { - delete df; - df = 0; - delete df1; - df1 = 0; - delete df2; - df2 = 0; - delete df3; - df3 = 0; - delete df4; - df4 = 0; - delete df5; - df5 = 0; - - delete das; - das = 0; - } - - bool re_match(Regex &r, const string &s) - { - DBG(cerr << "s.length(): " << s.length() << endl); - int pos = r.match(s.c_str(), s.length()); - DBG(cerr << "r.match(s): " << pos << endl); - return pos > 0 && static_cast (pos) == s.length(); - } - - bool re_match_binary(Regex &r, const string &s) - { - DBG(cerr << "s.length(): " << s.length() << endl); - int pos = r.match(s.c_str(), s.length()); - DBG(cerr << "r.match(s): " << pos << endl); - return pos > 0; - } -#if 0 - void add_keyword_test() - { - ResponseBuilder tdf; - tdf.add_keyword("test"); - CPPUNIT_ASSERT(tdf.d_keywords.find("test") != tdf.d_keywords.end()); - CPPUNIT_ASSERT(tdf.d_keywords.find("test") == tdf.d_keywords.begin()); - CPPUNIT_ASSERT(*(tdf.d_keywords.find("test")) == string("test")); - tdf.add_keyword("dap3.3"); - CPPUNIT_ASSERT(tdf.d_keywords.size() == 2); - } - - void is_keyword_test() - { - ResponseBuilder tdf; - tdf.add_keyword("test"); - tdf.add_keyword("dap3.3"); - CPPUNIT_ASSERT(tdf.is_keyword("test")); - CPPUNIT_ASSERT(!tdf.is_keyword("TEST")); - } - - void get_keywords() - { - ResponseBuilder tdf; - tdf.add_keyword("test"); - tdf.add_keyword("dap2.0"); - tdf.add_keyword("dap4.0"); - CPPUNIT_ASSERT(tdf.d_keywords.size() == 3); - - ostringstream oss; - list kwds = tdf.get_keywords(); - list::iterator i = kwds.begin(); - while (i != kwds.end()) - oss << *i++; - - CPPUNIT_ASSERT(oss.str().find("test") != string::npos); - CPPUNIT_ASSERT(oss.str().find("dap2.0") != string::npos); - CPPUNIT_ASSERT(oss.str().find("dap4.0") != string::npos); - } -#endif - void send_das_test() - { - Regex - r1( - "HTTP/1.0 200 OK\r\n\ -XDODS-Server: .*\ -XOPeNDAP-Server: .*\ -XDAP: .*\ -Date: .*\ -Last-Modified: .*\ -Content-Type: text/plain\r\n\ -Content-Description: dods_das\r\n\ -\r\n\ -Attributes \\{\n\ - a \\{\n\ - Int32 size 7;\n\ - String type \"cars\";\n\ - \\}\n\ -\\}\n"); - - df->send_das(oss, *das); - - DBG(cerr << "DAS: " << oss.str() << endl); - - CPPUNIT_ASSERT(re_match(r1, oss.str())); - oss.str(""); - } - - void send_dds_test() - { - Regex - r1( - "HTTP/1.0 200 OK\r\n\ -XDODS-Server: .*\ -XOPeNDAP-Server: .*\ -XDAP: .*\ -Date: .*\ -Last-Modified: .*\ -Content-Type: text/plain\r\n\ -Content-Description: dods_dds\r\n\ -\r\n\ -Dataset \\{\n\ - Byte a;\n\ -\\} test;\n"); - - ConstraintEvaluator ce; - - df->send_dds(oss, *dds, ce); - - DBG(cerr << "DDS: " << oss.str() << endl); - - CPPUNIT_ASSERT(re_match(r1, oss.str())); - oss.str(""); - } - - void send_ddx_test() - { - Regex - r1( - "HTTP/1.0 200 OK\r\n\ -XDODS-Server: .*\ -XOPeNDAP-Server: .*\ -XDAP: .*\ -Date: .*\ -Last-Modified: .*\ -Content-Type: text/xml\r\n\ -Content-Description: dap4-ddx\r\n\ -\r\n\ -<\\?xml version=\"1.0\" encoding=\"UTF-8\"\\?>.*\ -.*\ -.*\ -.*\ - .*\ - 7.*\ - .*\ - .*\ - cars.*\ - .*\ -.*\ -.*\ -.*"); - - ConstraintEvaluator ce; - - try { - df->send_ddx(oss, *dds, ce); - - DBG(cerr << "DDX: " << oss.str() << endl); - - CPPUNIT_ASSERT(re_match(r1, oss.str())); - oss.str(""); - } - catch (Error &e) { - CPPUNIT_FAIL("Error: " + e.get_error_message()); - } - } - - void send_data_ddx_test() - { - Regex - r1( - "HTTP/1.0 200 OK\r\n\ -.*\ -XDAP:.*\r\n\ -.*\ -Content-Type: Multipart/Related; boundary=boundary; start=\"\"; type=\"Text/xml\"\r\n\ -Content-Description: dap4-data-ddx\r\n\ -\r\n\ ---boundary\r\n\ -Content-Type: Text/xml; charset=iso-8859-1\r\n\ -Content-Id: \r\n\ -Content-Description: dap4-ddx\r\n\ -\r\n\ -<\\?xml version=\"1.0\" encoding=\"UTF-8\"\\?>.*\ -.*\ -.*\ - .*\ - .*\ - 7.*\ - .*\ - .*\ - cars.*\ - .*\ - .*\ -.*\ - .*\ -.*\ ---boundary\r\n\ -Content-Type: application/octet-stream\r\n\ -Content-Id: <.*@.*>\r\n\ -Content-Description: dap4-data\r\n\ -Content-Encoding: binary\r\n\ -\r\n\ -.*"); - - // I do not look for the closing '--boundary' because the binary - // data breaks the regex functions in the c library WRT subsequent - // pattern matches. jhrg - //--boundary--\r\n"); - - ConstraintEvaluator ce; - - try { - df->send_data_ddx(oss, *dds, ce, "start@opendap.org", "boundary", true); - - DBG(cerr << "DataDDX: " << oss.str() << endl); - - CPPUNIT_ASSERT(re_match_binary(r1, oss.str())); - oss.str(""); - } - catch (Error &e) { - CPPUNIT_FAIL("Error: " + e.get_error_message()); - } - } - - void send_data_ddx_test2() - { - Regex - r1( - "--boundary\r\n\ -Content-Type: Text/xml; charset=iso-8859-1\r\n\ -Content-Id: \r\n\ -Content-Description: dap4-ddx\r\n\ -\r\n\ -<\\?xml version=\"1.0\" encoding=\"UTF-8\"\\?>.*\ -.*\ -.*\ - .*\ - .*\ - 7.*\ - .*\ - .*\ - cars.*\ - .*\ - .*\ -.*\ - .*\ -.*\ ---boundary\r\n\ -Content-Type: application/octet-stream\r\n\ -Content-Id: <.*@.*>\r\n\ -Content-Description: dap4-data\r\n\ -Content-Encoding: binary\r\n\ -\r\n\ -.*"); - - ConstraintEvaluator ce; - - try { - df->send_data_ddx(oss, *dds, ce, "start@opendap.org", "boundary", false); - DBG(cerr << "DataDDX: " << oss.str() << endl); - CPPUNIT_ASSERT(re_match_binary(r1, oss.str())); - - // Unlike the test where the full headers are generated, there's - // no check for a conditional response here because that feature - // of ResponseBuilder is only supported when MIME headers are built by - // the class. In order to return a '304' response, headers must be - // built. - } - catch (Error &e) { - CPPUNIT_FAIL("Error: " + e.get_error_message()); - } - } - - void escape_code_test() - { - // These should NOT be escaped. - - DBG(cerr << df3->get_dataset_name() << endl); - DBG(cerr << df3->get_ce() << endl); - - CPPUNIT_ASSERT(df3->get_dataset_name() == (string)TEST_SRC_DIR + "/server-testsuite/coads.data"); - CPPUNIT_ASSERT(df3->get_ce() == "u,x,z[0]&grid(u,\"lat<10.0\")"); - - // The ResponseBuilder instance is feed escaped values; they should be - // unescaped by the ctor and the mutators. 5/4/2001 jhrg - - DBG(cerr << df5->get_dataset_name() << endl); - DBG(cerr << df5->get_ce() << endl); - - CPPUNIT_ASSERT(df5->get_dataset_name() == "nowhere[mydisk]myfile"); - CPPUNIT_ASSERT(df5->get_ce() == "u[0]"); - - df5->set_ce("u%5B0%5D"); - CPPUNIT_ASSERT(df5->get_ce() == "u[0]"); - - df5->set_ce("Grid%20u%5B0%5D"); - CPPUNIT_ASSERT(df5->get_ce() == "Grid%20u[0]"); - } - - // This tests reading the timeout value from argv[]. - void timeout_test() - { - CPPUNIT_ASSERT(df3->get_timeout() == 1); - CPPUNIT_ASSERT(df1->get_timeout() == 0); - } - -CPPUNIT_TEST_SUITE( ResponseBuilderTest ); -#if 0 - CPPUNIT_TEST(add_keyword_test); - CPPUNIT_TEST(is_keyword_test); - CPPUNIT_TEST(get_keywords); -#endif - CPPUNIT_TEST(send_das_test); - CPPUNIT_TEST(send_dds_test); - - CPPUNIT_TEST(send_ddx_test); - CPPUNIT_TEST(send_data_ddx_test); - CPPUNIT_TEST(send_data_ddx_test2); - - CPPUNIT_TEST(escape_code_test); - - CPPUNIT_TEST_SUITE_END(); -}; -CPPUNIT_TEST_SUITE_REGISTRATION(ResponseBuilderTest); -} - -int main(int, char**) -{ - CppUnit::TextTestRunner runner; - runner.addTest(CppUnit::TestFactoryRegistry::getRegistry().makeTest()); - - bool wasSuccessful = runner.run("", false); - - return wasSuccessful ? 0 : 1; -} - diff -Nru libdap-3.11.1/unit-tests/SequenceTest.cc libdap-3.12.0/unit-tests/SequenceTest.cc --- libdap-3.11.1/unit-tests/SequenceTest.cc 2011-04-29 13:19:42.000000000 +0000 +++ libdap-3.12.0/unit-tests/SequenceTest.cc 2013-10-17 21:27:40.000000000 +0000 @@ -19,7 +19,7 @@ // // You should have received a copy of the GNU Lesser General Public // License along with this library; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA // // You can contact OPeNDAP, Inc. at PO Box 112, Saunderstown, RI. 02874-0112. diff -Nru libdap-3.11.1/unit-tests/ServerFunctionsListUnitTest.cc libdap-3.12.0/unit-tests/ServerFunctionsListUnitTest.cc --- libdap-3.11.1/unit-tests/ServerFunctionsListUnitTest.cc 1970-01-01 00:00:00.000000000 +0000 +++ libdap-3.12.0/unit-tests/ServerFunctionsListUnitTest.cc 2013-10-17 21:27:40.000000000 +0000 @@ -0,0 +1,213 @@ +// -*- mode: c++; c-basic-offset:4 -*- + +// This file is part of libdap, A C++ implementation of the OPeNDAP Data +// Access Protocol. + +// Copyright (c) 2013 OPeNDAP, Inc. +// Author: Nathan David Potter +// +// This library is free software; you can redistribute it and/or +// modify it under the terms of the GNU Lesser General Public +// License as published by the Free Software Foundation; either +// version 2.1 of the License, or (at your option) any later version. +// +// This library 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 +// Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, write to the Free Software +// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA +// +// You can contact OPeNDAP, Inc. at PO Box 112, Saunderstown, RI. 02874-0112. + +//#include + +#include + +#include +#include +#include + +#include "debug.h" +#include "util.h" + +#include "GetOpt.h" +#include "BaseType.h" +#include "Str.h" +#include "DDS.h" +#include "ServerFunction.h" +#include "ServerFunctionsList.h" + +static bool debug = false; + +#undef DBG +#define DBG(x) do { if (debug) (x); } while(false); + + +void sflut(int argc, libdap::BaseType *argv[], libdap::DDS &dds, libdap::BaseType **btpp) +{ + string info = string("\n") + + "\n" + + "ServeFunctionsList Unit Test.\n" + "usage: sflut()" + + "\n"+""; + + libdap::Str *response = new libdap::Str("info"); + response->set_value(info); + *btpp = response; + return; + +} + +class SFLUT : public libdap::ServerFunction { +public : + SFLUT() { + setName("sflut"); + setDescriptionString("This is a unit test to test the ServerFunctionList class."); + setUsageString("sflut()"); + setRole("http://services.opendap.org/dap4/unit-tests/ServerFunctionList"); + setDocUrl("http://docs.opendap.org/index.php/unit-tests"); + setFunction(sflut); + setVersion("1.0"); + + } +}; + + +namespace libdap { +class ServerFunctionsListUnitTest: public CppUnit::TestFixture { + +public: + + // Called once before everything gets tested + ServerFunctionsListUnitTest() { + // DBG(cerr << " BindTest - Constructor" << endl); + + } + + // Called at the end of the test + ~ServerFunctionsListUnitTest() { + // DBG(cerr << " BindTest - Destructor" << endl); + } + + // Called before each test + void setup() { + // DBG(cerr << " BindTest - setup()" << endl); + } + + // Called after each test + void tearDown() { + // DBG(cerr << " tearDown()" << endl); + } + + CPPUNIT_TEST_SUITE( libdap::ServerFunctionsListUnitTest ); + + CPPUNIT_TEST(sflut_test); + //CPPUNIT_TEST(always_pass); + + CPPUNIT_TEST_SUITE_END(); + + void printFunctionNames(){ + vector *names = new vector(); + printFunctionNames(names); + delete names; + } + + + void printFunctionNames(vector *names){ + DBG(cerr << "Server_Function_List_Unit_Test::printFunctionNames() - ServerFunctionList::getFunctionNames(): " << endl); + if(names->empty()){ + DBG(cerr << " Function list is empty." << endl); + return; + } + + for(int i=0; isize() ;i++){ + DBG(cerr << " name["<< i << "]: "<< (*names)[i] << endl); + } + } + void always_pass(){ + CPPUNIT_ASSERT(true); + } + + + void sflut_test(){ + DBG(cerr << endl); + + SFLUT *ssf = new SFLUT(); + ssf->setName("Server_Function_List_Unit_Test"); + + vector names; + libdap::ServerFunctionsList::TheList()->getFunctionNames(&names); + printFunctionNames(&names); + + CPPUNIT_ASSERT(names.size()==0); + + + DBG(cerr << "ServerFunctionsListUnitTest::sflut_test() - Adding function(): " << ssf->getName() << endl); + libdap::ServerFunctionsList::TheList()->add_function(ssf); + + names.clear(); + libdap::ServerFunctionsList::TheList()->getFunctionNames(&names); + printFunctionNames(&names); + CPPUNIT_ASSERT(names.size()==1); + +#if 0 + DBG(cerr << "ServerFunctionsListUnitTest::sflut_test() - Deleting the List." << endl); + libdap::ServerFunctionsList::delete_instance(); + + // This is needed because we used pthread_once to ensure that + // initialize_instance() is called at most once. We manually call + // the delete method, so the object must be remade. This would never + // be done by non-test code. jhrg 5/2/13 + libdap::ServerFunctionsList::initialize_instance(); + + names.clear(); + libdap::ServerFunctionsList::TheList()->getFunctionNames(&names); + printFunctionNames(&names); + CPPUNIT_ASSERT(names.size()==0); +#endif + + } + +}; +} // libdap namespace + +// BindTest + +CPPUNIT_TEST_SUITE_REGISTRATION(libdap::ServerFunctionsListUnitTest); + + +int main(int argc, char*argv[]) { + CppUnit::TextTestRunner runner; + runner.addTest(CppUnit::TestFactoryRegistry::getRegistry().makeTest()); + + GetOpt getopt(argc, argv, "d"); + char option_char; + while ((option_char = getopt()) != EOF) + switch (option_char) { + case 'd': + debug = 1; // debug is a static global + break; + default: + break; + } + + bool wasSuccessful = true; + string test = ""; + int i = getopt.optind; + if (i == argc) { + // run them all + wasSuccessful = runner.run(""); + } + else { + while (i < argc) { + test = string("libdap::ServerFunctionsListUnitTest::") + argv[i++]; + + wasSuccessful = wasSuccessful && runner.run(test); + } + } + + return wasSuccessful ? 0 : 1; +} + diff -Nru libdap-3.11.1/unit-tests/SignalHandlerTest.cc libdap-3.12.0/unit-tests/SignalHandlerTest.cc --- libdap-3.11.1/unit-tests/SignalHandlerTest.cc 2011-04-29 13:19:42.000000000 +0000 +++ libdap-3.12.0/unit-tests/SignalHandlerTest.cc 2013-10-17 21:27:40.000000000 +0000 @@ -1,4 +1,3 @@ - // -*- mode: c++; c-basic-offset:4 -*- // This file is part of libdap, A C++ implementation of the OPeNDAP Data @@ -19,10 +18,10 @@ // // You should have received a copy of the GNU Lesser General Public // License along with this library; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA // // You can contact OPeNDAP, Inc. at PO Box 112, Saunderstown, RI. 02874-0112. - + #include #include #include @@ -34,79 +33,87 @@ #include #include #endif - + #include "SignalHandler.h" #include "debug.h" using namespace CppUnit; using namespace std; -namespace libdap -{ +namespace libdap { -class SignalHandlerTest : public TestFixture { +class SignalHandlerTest: public TestFixture { private: - SignalHandler *sh; - TestHandler *th; + SignalHandler *sh; + TestHandler *th; -public: - SignalHandlerTest() {} - ~SignalHandlerTest() {} - - void setUp() { - sh = SignalHandler::instance(); - th = new TestHandler; - } - - void tearDown() { - delete th; th = 0; - } - - // Tests for methods - void register_handler_test() { - sh->register_handler(SIGALRM, th); - CPPUNIT_ASSERT(sh->d_signal_handlers[SIGALRM] == th); - } - - void remove_handler_test() { - CPPUNIT_ASSERT(sh->remove_handler(SIGALRM) == th); - } - - void alarm_test() { - // Ignore the alarm signal and then register our handler. Without - // setting alram to ignore first the SignalHandler will call our - // EventHandler and then perform the default action for the signal, - // which is call exit() with EXIT_FAILURE. - signal(SIGALRM, SIG_IGN); - sh->register_handler(SIGALRM, th); - alarm(1); - sleep(10); - CPPUNIT_ASSERT(th->flag == 1); - } - - CPPUNIT_TEST_SUITE( SignalHandlerTest ); - - CPPUNIT_TEST(register_handler_test); - CPPUNIT_TEST(remove_handler_test); - CPPUNIT_TEST(alarm_test); +public: + SignalHandlerTest() + { + } + ~SignalHandlerTest() + { + } + + void setUp() + { + sh = SignalHandler::instance(); + th = new TestHandler; + } + + void tearDown() + { + delete th; + th = 0; + } + + // Tests for methods + void register_handler_test() + { + sh->register_handler(SIGALRM, th); + CPPUNIT_ASSERT(sh->d_signal_handlers[SIGALRM] == th); + } + + void remove_handler_test() + { + CPPUNIT_ASSERT(sh->remove_handler(SIGALRM) == th); + } + + void alarm_test() + { + // Ignore the alarm signal and then register our handler. Without + // setting alram to ignore first the SignalHandler will call our + // EventHandler and then perform the default action for the signal, + // which is call exit() with EXIT_FAILURE. + signal(SIGALRM, SIG_IGN); + sh->register_handler(SIGALRM, th); + alarm(1); + sleep(10); + CPPUNIT_ASSERT(th->flag == 1); + } + +CPPUNIT_TEST_SUITE( SignalHandlerTest ) + ; + + CPPUNIT_TEST(register_handler_test); + CPPUNIT_TEST(remove_handler_test); + CPPUNIT_TEST(alarm_test); - CPPUNIT_TEST_SUITE_END(); + CPPUNIT_TEST_SUITE_END() + ; }; CPPUNIT_TEST_SUITE_REGISTRATION(SignalHandlerTest); } -int -main( int, char** ) +int main(int, char**) { - CppUnit::TextTestRunner runner; - runner.addTest( CppUnit::TestFactoryRegistry::getRegistry().makeTest() ); + CppUnit::TextTestRunner runner; + runner.addTest(CppUnit::TestFactoryRegistry::getRegistry().makeTest()); - bool wasSuccessful = runner.run( "", false ) ; + bool wasSuccessful = runner.run("", false); - return wasSuccessful ? 0 : 1; + return wasSuccessful ? 0 : 1; } - - diff -Nru libdap-3.11.1/unit-tests/ancT.cc libdap-3.12.0/unit-tests/ancT.cc --- libdap-3.11.1/unit-tests/ancT.cc 2011-04-29 13:19:42.000000000 +0000 +++ libdap-3.12.0/unit-tests/ancT.cc 2013-10-17 21:27:40.000000000 +0000 @@ -19,7 +19,7 @@ // // You should have received a copy of the GNU Lesser General Public // License along with this library; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA // // You can contact OPeNDAP, Inc. at PO Box 112, Saunderstown, RI. 02874-0112. diff -Nru libdap-3.11.1/unit-tests/arrayT.cc libdap-3.12.0/unit-tests/arrayT.cc --- libdap-3.11.1/unit-tests/arrayT.cc 2011-04-29 13:19:42.000000000 +0000 +++ libdap-3.12.0/unit-tests/arrayT.cc 2013-10-17 21:27:40.000000000 +0000 @@ -17,7 +17,7 @@ using std::endl ; int test_variable_sleep_interval = 0; // Used in Test* classes for testing - // timeouts. + // timeouts. class arrayT : public CppUnit::TestFixture { @@ -28,14 +28,14 @@ private: /* TEST PRIVATE DATA */ TestTypeFactory *factory; - + public: void setUp() { factory = new TestTypeFactory; } - void tearDown() + void tearDown() { delete factory; factory = 0; } @@ -51,7 +51,10 @@ try { - int w = ar.width() ; + int w = ar.width(true) ; + cerr << "w = " << w << endl; + cerr << "(int)bt->width() " << (int)bt->width() << endl; + cerr << "L " << l << endl; CPPUNIT_ASSERT( w == ( l * (int)bt->width() ) ) ; } catch( InternalErr &e ) @@ -181,7 +184,7 @@ CppUnit::TestFactoryRegistry ®istry = CppUnit::TestFactoryRegistry::getRegistry() ; runner.addTest( registry.makeTest() ) ; - runner.setOutputter( CppUnit::CompilerOutputter::defaultOutputter( + runner.setOutputter( CppUnit::CompilerOutputter::defaultOutputter( &runner.result(), std::cerr ) ); bool wasSuccessful = runner.run( "", false ) ; diff -Nru libdap-3.11.1/unit-tests/cache-testsuite/Makefile.am libdap-3.12.0/unit-tests/cache-testsuite/Makefile.am --- libdap-3.11.1/unit-tests/cache-testsuite/Makefile.am 2011-04-29 13:19:38.000000000 +0000 +++ libdap-3.12.0/unit-tests/cache-testsuite/Makefile.am 2013-10-17 21:27:40.000000000 +0000 @@ -10,6 +10,4 @@ clean-local: cleanup.sh sh ./cleanup.sh - -distclean-local: rm -rf dods_cache diff -Nru libdap-3.11.1/unit-tests/cache-testsuite/Makefile.in libdap-3.12.0/unit-tests/cache-testsuite/Makefile.in --- libdap-3.11.1/unit-tests/cache-testsuite/Makefile.in 2011-05-06 17:36:29.000000000 +0000 +++ libdap-3.12.0/unit-tests/cache-testsuite/Makefile.in 2013-10-17 21:27:40.000000000 +0000 @@ -1,9 +1,9 @@ -# Makefile.in generated by automake 1.11 from Makefile.am. +# Makefile.in generated by automake 1.12 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, -# 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, -# Inc. +# 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software +# Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. @@ -16,6 +16,23 @@ @SET_MAKE@ VPATH = @srcdir@ +am__make_dryrun = \ + { \ + am__dry=no; \ + case $$MAKEFLAGS in \ + *\\[\ \ ]*) \ + echo 'am--echo: ; @echo "AM" OK' | $(MAKE) -f - 2>/dev/null \ + | grep '^AM OK$$' >/dev/null || am__dry=yes;; \ + *) \ + for am__flg in $$MAKEFLAGS; do \ + case $$am__flg in \ + *=*|--*) ;; \ + *n*) am__dry=yes; break;; \ + esac; \ + done;; \ + esac; \ + test $$am__dry = yes; \ + } pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ @@ -38,7 +55,7 @@ ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/gl/m4/00gnulib.m4 \ $(top_srcdir)/gl/m4/alloca.m4 $(top_srcdir)/gl/m4/btowc.m4 \ - $(top_srcdir)/gl/m4/codeset.m4 \ + $(top_srcdir)/gl/m4/byteswap.m4 $(top_srcdir)/gl/m4/codeset.m4 \ $(top_srcdir)/gl/m4/configmake.m4 \ $(top_srcdir)/gl/m4/extensions.m4 \ $(top_srcdir)/gl/m4/fcntl-o.m4 $(top_srcdir)/gl/m4/glibc21.m4 \ @@ -51,22 +68,27 @@ $(top_srcdir)/gl/m4/locale-fr.m4 \ $(top_srcdir)/gl/m4/locale-ja.m4 \ $(top_srcdir)/gl/m4/locale-zh.m4 \ + $(top_srcdir)/gl/m4/locale_h.m4 \ + $(top_srcdir)/gl/m4/localeconv.m4 \ $(top_srcdir)/gl/m4/longlong.m4 $(top_srcdir)/gl/m4/malloc.m4 \ $(top_srcdir)/gl/m4/mbrtowc.m4 $(top_srcdir)/gl/m4/mbsinit.m4 \ - $(top_srcdir)/gl/m4/mbstate_t.m4 \ + $(top_srcdir)/gl/m4/mbstate_t.m4 $(top_srcdir)/gl/m4/mbtowc.m4 \ $(top_srcdir)/gl/m4/multiarch.m4 \ $(top_srcdir)/gl/m4/nl_langinfo.m4 \ - $(top_srcdir)/gl/m4/regex.m4 $(top_srcdir)/gl/m4/ssize_t.m4 \ - $(top_srcdir)/gl/m4/stdbool.m4 $(top_srcdir)/gl/m4/stddef_h.m4 \ - $(top_srcdir)/gl/m4/stdint.m4 $(top_srcdir)/gl/m4/stdlib_h.m4 \ + $(top_srcdir)/gl/m4/off_t.m4 $(top_srcdir)/gl/m4/regex.m4 \ + $(top_srcdir)/gl/m4/ssize_t.m4 $(top_srcdir)/gl/m4/stdbool.m4 \ + $(top_srcdir)/gl/m4/stddef_h.m4 $(top_srcdir)/gl/m4/stdint.m4 \ + $(top_srcdir)/gl/m4/stdlib_h.m4 $(top_srcdir)/gl/m4/strcase.m4 \ + $(top_srcdir)/gl/m4/strings_h.m4 \ + $(top_srcdir)/gl/m4/sys_types_h.m4 \ $(top_srcdir)/gl/m4/unistd_h.m4 \ $(top_srcdir)/gl/m4/warn-on-use.m4 \ $(top_srcdir)/gl/m4/wchar_h.m4 $(top_srcdir)/gl/m4/wchar_t.m4 \ $(top_srcdir)/gl/m4/wcrtomb.m4 $(top_srcdir)/gl/m4/wctype_h.m4 \ $(top_srcdir)/gl/m4/wint_t.m4 $(top_srcdir)/conf/acinclude.m4 \ - $(top_srcdir)/conf/check_zlib.m4 $(top_srcdir)/conf/cppunit.m4 \ - $(top_srcdir)/conf/libtool.m4 $(top_srcdir)/conf/ltoptions.m4 \ - $(top_srcdir)/conf/ltsugar.m4 $(top_srcdir)/conf/ltversion.m4 \ + $(top_srcdir)/conf/cppunit.m4 $(top_srcdir)/conf/libtool.m4 \ + $(top_srcdir)/conf/ltoptions.m4 $(top_srcdir)/conf/ltsugar.m4 \ + $(top_srcdir)/conf/ltversion.m4 \ $(top_srcdir)/conf/lt~obsolete.m4 $(top_srcdir)/conf/pkg.m4 \ $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ @@ -80,6 +102,11 @@ SCRIPTS = $(noinst_SCRIPTS) SOURCES = DIST_SOURCES = +am__can_run_installinfo = \ + case $$AM_UPDATE_INFO_DIR in \ + n|no|NO) false;; \ + *) (install-info --version) >/dev/null 2>&1;; \ + esac DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) pkglibexecdir = @pkglibexecdir@ ACLOCAL = @ACLOCAL@ @@ -88,6 +115,7 @@ AMTAR = @AMTAR@ APPLE_UNIVERSAL_BUILD = @APPLE_UNIVERSAL_BUILD@ AR = @AR@ +ARFLAGS = @ARFLAGS@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ @@ -97,6 +125,7 @@ BITSIZEOF_SIZE_T = @BITSIZEOF_SIZE_T@ BITSIZEOF_WCHAR_T = @BITSIZEOF_WCHAR_T@ BITSIZEOF_WINT_T = @BITSIZEOF_WINT_T@ +BYTESWAP_H = @BYTESWAP_H@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ @@ -123,6 +152,7 @@ DAP_PROTOCOL_VERSION = @DAP_PROTOCOL_VERSION@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ +DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ DVR = @DVR@ @@ -138,15 +168,20 @@ GNULIB_BTOWC = @GNULIB_BTOWC@ GNULIB_CALLOC_POSIX = @GNULIB_CALLOC_POSIX@ GNULIB_CANONICALIZE_FILE_NAME = @GNULIB_CANONICALIZE_FILE_NAME@ +GNULIB_CHDIR = @GNULIB_CHDIR@ GNULIB_CHOWN = @GNULIB_CHOWN@ GNULIB_CLOSE = @GNULIB_CLOSE@ +GNULIB_DUP = @GNULIB_DUP@ GNULIB_DUP2 = @GNULIB_DUP2@ GNULIB_DUP3 = @GNULIB_DUP3@ +GNULIB_DUPLOCALE = @GNULIB_DUPLOCALE@ GNULIB_ENVIRON = @GNULIB_ENVIRON@ GNULIB_EUIDACCESS = @GNULIB_EUIDACCESS@ GNULIB_FACCESSAT = @GNULIB_FACCESSAT@ GNULIB_FCHDIR = @GNULIB_FCHDIR@ GNULIB_FCHOWNAT = @GNULIB_FCHOWNAT@ +GNULIB_FDATASYNC = @GNULIB_FDATASYNC@ +GNULIB_FFS = @GNULIB_FFS@ GNULIB_FSYNC = @GNULIB_FSYNC@ GNULIB_FTRUNCATE = @GNULIB_FTRUNCATE@ GNULIB_GETCWD = @GNULIB_GETCWD@ @@ -161,9 +196,14 @@ GNULIB_GETSUBOPT = @GNULIB_GETSUBOPT@ GNULIB_GETUSERSHELL = @GNULIB_GETUSERSHELL@ GNULIB_GRANTPT = @GNULIB_GRANTPT@ +GNULIB_GROUP_MEMBER = @GNULIB_GROUP_MEMBER@ +GNULIB_ISATTY = @GNULIB_ISATTY@ +GNULIB_ISWBLANK = @GNULIB_ISWBLANK@ +GNULIB_ISWCTYPE = @GNULIB_ISWCTYPE@ GNULIB_LCHOWN = @GNULIB_LCHOWN@ GNULIB_LINK = @GNULIB_LINK@ GNULIB_LINKAT = @GNULIB_LINKAT@ +GNULIB_LOCALECONV = @GNULIB_LOCALECONV@ GNULIB_LSEEK = @GNULIB_LSEEK@ GNULIB_MALLOC_POSIX = @GNULIB_MALLOC_POSIX@ GNULIB_MBRLEN = @GNULIB_MBRLEN@ @@ -171,6 +211,7 @@ GNULIB_MBSINIT = @GNULIB_MBSINIT@ GNULIB_MBSNRTOWCS = @GNULIB_MBSNRTOWCS@ GNULIB_MBSRTOWCS = @GNULIB_MBSRTOWCS@ +GNULIB_MBTOWC = @GNULIB_MBTOWC@ GNULIB_MKDTEMP = @GNULIB_MKDTEMP@ GNULIB_MKOSTEMP = @GNULIB_MKOSTEMP@ GNULIB_MKOSTEMPS = @GNULIB_MKOSTEMPS@ @@ -179,11 +220,15 @@ GNULIB_NL_LANGINFO = @GNULIB_NL_LANGINFO@ GNULIB_PIPE = @GNULIB_PIPE@ GNULIB_PIPE2 = @GNULIB_PIPE2@ +GNULIB_POSIX_OPENPT = @GNULIB_POSIX_OPENPT@ GNULIB_PREAD = @GNULIB_PREAD@ GNULIB_PTSNAME = @GNULIB_PTSNAME@ +GNULIB_PTSNAME_R = @GNULIB_PTSNAME_R@ GNULIB_PUTENV = @GNULIB_PUTENV@ GNULIB_PWRITE = @GNULIB_PWRITE@ +GNULIB_RANDOM = @GNULIB_RANDOM@ GNULIB_RANDOM_R = @GNULIB_RANDOM_R@ +GNULIB_READ = @GNULIB_READ@ GNULIB_READLINK = @GNULIB_READLINK@ GNULIB_READLINKAT = @GNULIB_READLINKAT@ GNULIB_REALLOC_POSIX = @GNULIB_REALLOC_POSIX@ @@ -191,6 +236,8 @@ GNULIB_RMDIR = @GNULIB_RMDIR@ GNULIB_RPMATCH = @GNULIB_RPMATCH@ GNULIB_SETENV = @GNULIB_SETENV@ +GNULIB_SETHOSTNAME = @GNULIB_SETHOSTNAME@ +GNULIB_SETLOCALE = @GNULIB_SETLOCALE@ GNULIB_SLEEP = @GNULIB_SLEEP@ GNULIB_STRTOD = @GNULIB_STRTOD@ GNULIB_STRTOLL = @GNULIB_STRTOLL@ @@ -198,19 +245,51 @@ GNULIB_SYMLINK = @GNULIB_SYMLINK@ GNULIB_SYMLINKAT = @GNULIB_SYMLINKAT@ GNULIB_SYSTEM_POSIX = @GNULIB_SYSTEM_POSIX@ +GNULIB_TOWCTRANS = @GNULIB_TOWCTRANS@ GNULIB_TTYNAME_R = @GNULIB_TTYNAME_R@ -GNULIB_UNISTD_H_GETOPT = @GNULIB_UNISTD_H_GETOPT@ +GNULIB_UNISTD_H_NONBLOCKING = @GNULIB_UNISTD_H_NONBLOCKING@ GNULIB_UNISTD_H_SIGPIPE = @GNULIB_UNISTD_H_SIGPIPE@ GNULIB_UNLINK = @GNULIB_UNLINK@ GNULIB_UNLINKAT = @GNULIB_UNLINKAT@ GNULIB_UNLOCKPT = @GNULIB_UNLOCKPT@ GNULIB_UNSETENV = @GNULIB_UNSETENV@ GNULIB_USLEEP = @GNULIB_USLEEP@ +GNULIB_WCPCPY = @GNULIB_WCPCPY@ +GNULIB_WCPNCPY = @GNULIB_WCPNCPY@ GNULIB_WCRTOMB = @GNULIB_WCRTOMB@ +GNULIB_WCSCASECMP = @GNULIB_WCSCASECMP@ +GNULIB_WCSCAT = @GNULIB_WCSCAT@ +GNULIB_WCSCHR = @GNULIB_WCSCHR@ +GNULIB_WCSCMP = @GNULIB_WCSCMP@ +GNULIB_WCSCOLL = @GNULIB_WCSCOLL@ +GNULIB_WCSCPY = @GNULIB_WCSCPY@ +GNULIB_WCSCSPN = @GNULIB_WCSCSPN@ +GNULIB_WCSDUP = @GNULIB_WCSDUP@ +GNULIB_WCSLEN = @GNULIB_WCSLEN@ +GNULIB_WCSNCASECMP = @GNULIB_WCSNCASECMP@ +GNULIB_WCSNCAT = @GNULIB_WCSNCAT@ +GNULIB_WCSNCMP = @GNULIB_WCSNCMP@ +GNULIB_WCSNCPY = @GNULIB_WCSNCPY@ +GNULIB_WCSNLEN = @GNULIB_WCSNLEN@ GNULIB_WCSNRTOMBS = @GNULIB_WCSNRTOMBS@ +GNULIB_WCSPBRK = @GNULIB_WCSPBRK@ +GNULIB_WCSRCHR = @GNULIB_WCSRCHR@ GNULIB_WCSRTOMBS = @GNULIB_WCSRTOMBS@ +GNULIB_WCSSPN = @GNULIB_WCSSPN@ +GNULIB_WCSSTR = @GNULIB_WCSSTR@ +GNULIB_WCSTOK = @GNULIB_WCSTOK@ +GNULIB_WCSWIDTH = @GNULIB_WCSWIDTH@ +GNULIB_WCSXFRM = @GNULIB_WCSXFRM@ GNULIB_WCTOB = @GNULIB_WCTOB@ +GNULIB_WCTOMB = @GNULIB_WCTOMB@ +GNULIB_WCTRANS = @GNULIB_WCTRANS@ +GNULIB_WCTYPE = @GNULIB_WCTYPE@ GNULIB_WCWIDTH = @GNULIB_WCWIDTH@ +GNULIB_WMEMCHR = @GNULIB_WMEMCHR@ +GNULIB_WMEMCMP = @GNULIB_WMEMCMP@ +GNULIB_WMEMCPY = @GNULIB_WMEMCPY@ +GNULIB_WMEMMOVE = @GNULIB_WMEMMOVE@ +GNULIB_WMEMSET = @GNULIB_WMEMSET@ GNULIB_WRITE = @GNULIB_WRITE@ GNULIB__EXIT = @GNULIB__EXIT@ GREP = @GREP@ @@ -220,23 +299,29 @@ HAVE_CHOWN = @HAVE_CHOWN@ HAVE_DECL_ENVIRON = @HAVE_DECL_ENVIRON@ HAVE_DECL_FCHDIR = @HAVE_DECL_FCHDIR@ +HAVE_DECL_FDATASYNC = @HAVE_DECL_FDATASYNC@ HAVE_DECL_GETDOMAINNAME = @HAVE_DECL_GETDOMAINNAME@ HAVE_DECL_GETLOADAVG = @HAVE_DECL_GETLOADAVG@ HAVE_DECL_GETLOGIN_R = @HAVE_DECL_GETLOGIN_R@ HAVE_DECL_GETPAGESIZE = @HAVE_DECL_GETPAGESIZE@ HAVE_DECL_GETUSERSHELL = @HAVE_DECL_GETUSERSHELL@ HAVE_DECL_SETENV = @HAVE_DECL_SETENV@ +HAVE_DECL_SETHOSTNAME = @HAVE_DECL_SETHOSTNAME@ +HAVE_DECL_STRNCASECMP = @HAVE_DECL_STRNCASECMP@ HAVE_DECL_TTYNAME_R = @HAVE_DECL_TTYNAME_R@ HAVE_DECL_UNSETENV = @HAVE_DECL_UNSETENV@ HAVE_DECL_WCTOB = @HAVE_DECL_WCTOB@ HAVE_DECL_WCWIDTH = @HAVE_DECL_WCWIDTH@ HAVE_DUP2 = @HAVE_DUP2@ HAVE_DUP3 = @HAVE_DUP3@ +HAVE_DUPLOCALE = @HAVE_DUPLOCALE@ HAVE_EUIDACCESS = @HAVE_EUIDACCESS@ HAVE_FACCESSAT = @HAVE_FACCESSAT@ HAVE_FCHDIR = @HAVE_FCHDIR@ HAVE_FCHOWNAT = @HAVE_FCHOWNAT@ +HAVE_FDATASYNC = @HAVE_FDATASYNC@ HAVE_FEATURES_H = @HAVE_FEATURES_H@ +HAVE_FFS = @HAVE_FFS@ HAVE_FSYNC = @HAVE_FSYNC@ HAVE_FTRUNCATE = @HAVE_FTRUNCATE@ HAVE_GETDTABLESIZE = @HAVE_GETDTABLESIZE@ @@ -246,6 +331,7 @@ HAVE_GETPAGESIZE = @HAVE_GETPAGESIZE@ HAVE_GETSUBOPT = @HAVE_GETSUBOPT@ HAVE_GRANTPT = @HAVE_GRANTPT@ +HAVE_GROUP_MEMBER = @HAVE_GROUP_MEMBER@ HAVE_INTTYPES_H = @HAVE_INTTYPES_H@ HAVE_ISWBLANK = @HAVE_ISWBLANK@ HAVE_ISWCNTRL = @HAVE_ISWCNTRL@ @@ -272,9 +358,12 @@ HAVE_OS_H = @HAVE_OS_H@ HAVE_PIPE = @HAVE_PIPE@ HAVE_PIPE2 = @HAVE_PIPE2@ +HAVE_POSIX_OPENPT = @HAVE_POSIX_OPENPT@ HAVE_PREAD = @HAVE_PREAD@ HAVE_PTSNAME = @HAVE_PTSNAME@ +HAVE_PTSNAME_R = @HAVE_PTSNAME_R@ HAVE_PWRITE = @HAVE_PWRITE@ +HAVE_RANDOM = @HAVE_RANDOM@ HAVE_RANDOM_H = @HAVE_RANDOM_H@ HAVE_RANDOM_R = @HAVE_RANDOM_R@ HAVE_READLINK = @HAVE_READLINK@ @@ -282,11 +371,14 @@ HAVE_REALPATH = @HAVE_REALPATH@ HAVE_RPMATCH = @HAVE_RPMATCH@ HAVE_SETENV = @HAVE_SETENV@ +HAVE_SETHOSTNAME = @HAVE_SETHOSTNAME@ HAVE_SIGNED_SIG_ATOMIC_T = @HAVE_SIGNED_SIG_ATOMIC_T@ HAVE_SIGNED_WCHAR_T = @HAVE_SIGNED_WCHAR_T@ HAVE_SIGNED_WINT_T = @HAVE_SIGNED_WINT_T@ HAVE_SLEEP = @HAVE_SLEEP@ HAVE_STDINT_H = @HAVE_STDINT_H@ +HAVE_STRCASECMP = @HAVE_STRCASECMP@ +HAVE_STRINGS_H = @HAVE_STRINGS_H@ HAVE_STRTOD = @HAVE_STRTOD@ HAVE_STRTOLL = @HAVE_STRTOLL@ HAVE_STRTOULL = @HAVE_STRTOULL@ @@ -305,11 +397,42 @@ HAVE_USLEEP = @HAVE_USLEEP@ HAVE_WCHAR_H = @HAVE_WCHAR_H@ HAVE_WCHAR_T = @HAVE_WCHAR_T@ +HAVE_WCPCPY = @HAVE_WCPCPY@ +HAVE_WCPNCPY = @HAVE_WCPNCPY@ HAVE_WCRTOMB = @HAVE_WCRTOMB@ +HAVE_WCSCASECMP = @HAVE_WCSCASECMP@ +HAVE_WCSCAT = @HAVE_WCSCAT@ +HAVE_WCSCHR = @HAVE_WCSCHR@ +HAVE_WCSCMP = @HAVE_WCSCMP@ +HAVE_WCSCOLL = @HAVE_WCSCOLL@ +HAVE_WCSCPY = @HAVE_WCSCPY@ +HAVE_WCSCSPN = @HAVE_WCSCSPN@ +HAVE_WCSDUP = @HAVE_WCSDUP@ +HAVE_WCSLEN = @HAVE_WCSLEN@ +HAVE_WCSNCASECMP = @HAVE_WCSNCASECMP@ +HAVE_WCSNCAT = @HAVE_WCSNCAT@ +HAVE_WCSNCMP = @HAVE_WCSNCMP@ +HAVE_WCSNCPY = @HAVE_WCSNCPY@ +HAVE_WCSNLEN = @HAVE_WCSNLEN@ HAVE_WCSNRTOMBS = @HAVE_WCSNRTOMBS@ +HAVE_WCSPBRK = @HAVE_WCSPBRK@ +HAVE_WCSRCHR = @HAVE_WCSRCHR@ HAVE_WCSRTOMBS = @HAVE_WCSRTOMBS@ +HAVE_WCSSPN = @HAVE_WCSSPN@ +HAVE_WCSSTR = @HAVE_WCSSTR@ +HAVE_WCSTOK = @HAVE_WCSTOK@ +HAVE_WCSWIDTH = @HAVE_WCSWIDTH@ +HAVE_WCSXFRM = @HAVE_WCSXFRM@ +HAVE_WCTRANS_T = @HAVE_WCTRANS_T@ HAVE_WCTYPE_H = @HAVE_WCTYPE_H@ +HAVE_WCTYPE_T = @HAVE_WCTYPE_T@ HAVE_WINT_T = @HAVE_WINT_T@ +HAVE_WMEMCHR = @HAVE_WMEMCHR@ +HAVE_WMEMCMP = @HAVE_WMEMCMP@ +HAVE_WMEMCPY = @HAVE_WMEMCPY@ +HAVE_WMEMMOVE = @HAVE_WMEMMOVE@ +HAVE_WMEMSET = @HAVE_WMEMSET@ +HAVE_XLOCALE_H = @HAVE_XLOCALE_H@ HAVE__BOOL = @HAVE__BOOL@ HAVE__EXIT = @HAVE__EXIT@ INCLUDE_NEXT = @INCLUDE_NEXT@ @@ -339,18 +462,25 @@ LTLIBINTL = @LTLIBINTL@ LTLIBOBJS = @LTLIBOBJS@ MAKEINFO = @MAKEINFO@ +MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ NEXT_AS_FIRST_DIRECTIVE_LANGINFO_H = @NEXT_AS_FIRST_DIRECTIVE_LANGINFO_H@ +NEXT_AS_FIRST_DIRECTIVE_LOCALE_H = @NEXT_AS_FIRST_DIRECTIVE_LOCALE_H@ NEXT_AS_FIRST_DIRECTIVE_STDDEF_H = @NEXT_AS_FIRST_DIRECTIVE_STDDEF_H@ NEXT_AS_FIRST_DIRECTIVE_STDINT_H = @NEXT_AS_FIRST_DIRECTIVE_STDINT_H@ NEXT_AS_FIRST_DIRECTIVE_STDLIB_H = @NEXT_AS_FIRST_DIRECTIVE_STDLIB_H@ +NEXT_AS_FIRST_DIRECTIVE_STRINGS_H = @NEXT_AS_FIRST_DIRECTIVE_STRINGS_H@ +NEXT_AS_FIRST_DIRECTIVE_SYS_TYPES_H = @NEXT_AS_FIRST_DIRECTIVE_SYS_TYPES_H@ NEXT_AS_FIRST_DIRECTIVE_UNISTD_H = @NEXT_AS_FIRST_DIRECTIVE_UNISTD_H@ NEXT_AS_FIRST_DIRECTIVE_WCHAR_H = @NEXT_AS_FIRST_DIRECTIVE_WCHAR_H@ NEXT_AS_FIRST_DIRECTIVE_WCTYPE_H = @NEXT_AS_FIRST_DIRECTIVE_WCTYPE_H@ NEXT_LANGINFO_H = @NEXT_LANGINFO_H@ +NEXT_LOCALE_H = @NEXT_LOCALE_H@ NEXT_STDDEF_H = @NEXT_STDDEF_H@ NEXT_STDINT_H = @NEXT_STDINT_H@ NEXT_STDLIB_H = @NEXT_STDLIB_H@ +NEXT_STRINGS_H = @NEXT_STRINGS_H@ +NEXT_SYS_TYPES_H = @NEXT_SYS_TYPES_H@ NEXT_UNISTD_H = @NEXT_UNISTD_H@ NEXT_WCHAR_H = @NEXT_WCHAR_H@ NEXT_WCTYPE_H = @NEXT_WCTYPE_H@ @@ -384,17 +514,21 @@ REPLACE_CLOSE = @REPLACE_CLOSE@ REPLACE_DUP = @REPLACE_DUP@ REPLACE_DUP2 = @REPLACE_DUP2@ +REPLACE_DUPLOCALE = @REPLACE_DUPLOCALE@ REPLACE_FCHOWNAT = @REPLACE_FCHOWNAT@ +REPLACE_FTRUNCATE = @REPLACE_FTRUNCATE@ REPLACE_GETCWD = @REPLACE_GETCWD@ REPLACE_GETDOMAINNAME = @REPLACE_GETDOMAINNAME@ REPLACE_GETGROUPS = @REPLACE_GETGROUPS@ REPLACE_GETLOGIN_R = @REPLACE_GETLOGIN_R@ REPLACE_GETPAGESIZE = @REPLACE_GETPAGESIZE@ +REPLACE_ISATTY = @REPLACE_ISATTY@ REPLACE_ISWBLANK = @REPLACE_ISWBLANK@ REPLACE_ISWCNTRL = @REPLACE_ISWCNTRL@ REPLACE_LCHOWN = @REPLACE_LCHOWN@ REPLACE_LINK = @REPLACE_LINK@ REPLACE_LINKAT = @REPLACE_LINKAT@ +REPLACE_LOCALECONV = @REPLACE_LOCALECONV@ REPLACE_LSEEK = @REPLACE_LSEEK@ REPLACE_MALLOC = @REPLACE_MALLOC@ REPLACE_MBRLEN = @REPLACE_MBRLEN@ @@ -403,20 +537,27 @@ REPLACE_MBSNRTOWCS = @REPLACE_MBSNRTOWCS@ REPLACE_MBSRTOWCS = @REPLACE_MBSRTOWCS@ REPLACE_MBSTATE_T = @REPLACE_MBSTATE_T@ +REPLACE_MBTOWC = @REPLACE_MBTOWC@ REPLACE_MKSTEMP = @REPLACE_MKSTEMP@ REPLACE_NL_LANGINFO = @REPLACE_NL_LANGINFO@ REPLACE_NULL = @REPLACE_NULL@ REPLACE_PREAD = @REPLACE_PREAD@ +REPLACE_PTSNAME_R = @REPLACE_PTSNAME_R@ REPLACE_PUTENV = @REPLACE_PUTENV@ REPLACE_PWRITE = @REPLACE_PWRITE@ +REPLACE_RANDOM_R = @REPLACE_RANDOM_R@ +REPLACE_READ = @REPLACE_READ@ REPLACE_READLINK = @REPLACE_READLINK@ REPLACE_REALLOC = @REPLACE_REALLOC@ REPLACE_REALPATH = @REPLACE_REALPATH@ REPLACE_RMDIR = @REPLACE_RMDIR@ REPLACE_SETENV = @REPLACE_SETENV@ +REPLACE_SETLOCALE = @REPLACE_SETLOCALE@ REPLACE_SLEEP = @REPLACE_SLEEP@ REPLACE_STRTOD = @REPLACE_STRTOD@ +REPLACE_STRUCT_LCONV = @REPLACE_STRUCT_LCONV@ REPLACE_SYMLINK = @REPLACE_SYMLINK@ +REPLACE_TOWLOWER = @REPLACE_TOWLOWER@ REPLACE_TTYNAME_R = @REPLACE_TTYNAME_R@ REPLACE_UNLINK = @REPLACE_UNLINK@ REPLACE_UNLINKAT = @REPLACE_UNLINKAT@ @@ -425,7 +566,9 @@ REPLACE_WCRTOMB = @REPLACE_WCRTOMB@ REPLACE_WCSNRTOMBS = @REPLACE_WCSNRTOMBS@ REPLACE_WCSRTOMBS = @REPLACE_WCSRTOMBS@ +REPLACE_WCSWIDTH = @REPLACE_WCSWIDTH@ REPLACE_WCTOB = @REPLACE_WCTOB@ +REPLACE_WCTOMB = @REPLACE_WCTOMB@ REPLACE_WCWIDTH = @REPLACE_WCWIDTH@ REPLACE_WRITE = @REPLACE_WRITE@ SED = @SED@ @@ -446,18 +589,16 @@ UUID_LIBS = @UUID_LIBS@ VERSION = @VERSION@ WCHAR_T_SUFFIX = @WCHAR_T_SUFFIX@ +WINDOWS_64_BIT_OFF_T = @WINDOWS_64_BIT_OFF_T@ WINT_T_SUFFIX = @WINT_T_SUFFIX@ XML2_CFLAGS = @XML2_CFLAGS@ XML2_LIBS = @XML2_LIBS@ -XML2_STATIC_LIBS = @XML2_STATIC_LIBS@ YACC = @YACC@ -ZLIB_CFLAGS = @ZLIB_CFLAGS@ -ZLIB_LDFLAGS = @ZLIB_LDFLAGS@ -ZLIB_LIBS = @ZLIB_LIBS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ +ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ @@ -499,7 +640,6 @@ lispdir = @lispdir@ localedir = @localedir@ localstatedir = @localstatedir@ -lt_ECHO = @lt_ECHO@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ @@ -565,6 +705,8 @@ ctags: CTAGS CTAGS: +cscope cscopelist: + distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ @@ -610,10 +752,15 @@ installcheck: installcheck-am install-strip: - $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ - install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ - `test -z '$(STRIP)' || \ - echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install + if test -z '$(STRIP)'; then \ + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + install; \ + else \ + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ + fi mostlyclean-generic: clean-generic: @@ -632,7 +779,7 @@ distclean: distclean-am -rm -f Makefile -distclean-am: clean-am distclean-generic distclean-local +distclean-am: clean-am distclean-generic dvi: dvi-am @@ -696,8 +843,8 @@ .PHONY: all all-am check check-am clean clean-generic clean-libtool \ clean-local distclean distclean-generic distclean-libtool \ - distclean-local distdir dvi dvi-am html html-am info info-am \ - install install-am install-data install-data-am install-dvi \ + distdir dvi dvi-am html html-am info info-am install \ + install-am install-data install-data-am install-dvi \ install-dvi-am install-exec install-exec-am install-html \ install-html-am install-info install-info-am install-man \ install-pdf install-pdf-am install-ps install-ps-am \ @@ -713,8 +860,6 @@ clean-local: cleanup.sh sh ./cleanup.sh - -distclean-local: rm -rf dods_cache # Tell versions [3.59,3.63) of GNU make to not export all variables. diff -Nru libdap-3.11.1/unit-tests/ce-functions-testsuite/geo_grid.das libdap-3.12.0/unit-tests/ce-functions-testsuite/geo_grid.das --- libdap-3.11.1/unit-tests/ce-functions-testsuite/geo_grid.das 2011-04-29 13:19:40.000000000 +0000 +++ libdap-3.12.0/unit-tests/ce-functions-testsuite/geo_grid.das 1970-01-01 00:00:00.000000000 +0000 @@ -1,35 +0,0 @@ -Attributes { - SST1 { - lon { - String units "degrees_east"; - String long_name "longitude"; - } - lat{ - String units "degrees_north"; - String long_name "latitude"; - } - } - - SST2 { - lon { - String units "degrees_E"; - String long_name "longitude"; - } - lat{ - String units "degrees_N"; - String long_name "latitude"; - } - } - - SST3 { - lon { - String units "degree_east"; - String long_name "longitude"; - } - lat{ - String units "degree_N"; - String long_name "latitude"; - } - } -} - \ No newline at end of file diff -Nru libdap-3.11.1/unit-tests/ce-functions-testsuite/geo_grid.dds libdap-3.12.0/unit-tests/ce-functions-testsuite/geo_grid.dds --- libdap-3.11.1/unit-tests/ce-functions-testsuite/geo_grid.dds 2011-04-29 13:19:40.000000000 +0000 +++ libdap-3.12.0/unit-tests/ce-functions-testsuite/geo_grid.dds 1970-01-01 00:00:00.000000000 +0000 @@ -1,38 +0,0 @@ -Dataset { - # SST1 will have a lon map that uses 0/360 notation - Grid { - Array: - Byte SST[lon=10][lat=10]; - Maps: - Float64 lon[10]; - Float64 lat[10]; - } SST1; - - # SST1_1 will have a lon map that uses 0/360 notation; this has lon as its - # rightmost dimension so it can be used with a CE that requires 'stitching' - Grid { - Array: - Byte SST[lat=10][lon=10]; - Maps: - Float64 lat[10]; - Float64 lon[10]; - } SST1_1; - - # SST2 will have a lon map that uses -180/180 notation - Grid { - Array: - Byte SST[lon=10][lat=10]; - Maps: - Float64 lon[10]; - Float64 lat[10]; - } SST2; - - # SST3 will have a lon map that uses 0/360 notation and runs from 20 to 379 - Grid { - Array: - Byte SST[lat=10][lon=10]; - Maps: - Float64 lat[10]; - Float64 lon[10]; - } SST3; -} geo_grid; diff -Nru libdap-3.11.1/unit-tests/ce-functions-testsuite/geo_grid_3d.dds libdap-3.12.0/unit-tests/ce-functions-testsuite/geo_grid_3d.dds --- libdap-3.11.1/unit-tests/ce-functions-testsuite/geo_grid_3d.dds 2011-04-29 13:19:40.000000000 +0000 +++ libdap-3.12.0/unit-tests/ce-functions-testsuite/geo_grid_3d.dds 1970-01-01 00:00:00.000000000 +0000 @@ -1,11 +0,0 @@ -Dataset { - # SST4 will be a three dimensional Grid - Grid { - Array: - Byte SST4[time=3][lon=5][lat=5]; - Maps: - Int32 time[3]; - Float64 lon[5]; - Float64 lat[5]; - } SST4; -} geo_grid_3d; diff -Nru libdap-3.11.1/unit-tests/ce-functions-testsuite/geo_grid_coads_lon.dds libdap-3.12.0/unit-tests/ce-functions-testsuite/geo_grid_coads_lon.dds --- libdap-3.11.1/unit-tests/ce-functions-testsuite/geo_grid_coads_lon.dds 2011-04-29 13:19:40.000000000 +0000 +++ libdap-3.12.0/unit-tests/ce-functions-testsuite/geo_grid_coads_lon.dds 1970-01-01 00:00:00.000000000 +0000 @@ -1,10 +0,0 @@ -Dataset { - # SST4 will be a three dimensional Grid - Grid { - Array: - Byte SST5[lon=15][lat=5]; - Maps: - Float64 lon[15]; - Float64 lat[5]; - } SST5; -} geo_grid_coads_lon; diff -Nru libdap-3.11.1/unit-tests/ce-functions-testsuite/two_grid.das libdap-3.12.0/unit-tests/ce-functions-testsuite/two_grid.das --- libdap-3.11.1/unit-tests/ce-functions-testsuite/two_grid.das 2011-04-29 13:19:40.000000000 +0000 +++ libdap-3.12.0/unit-tests/ce-functions-testsuite/two_grid.das 1970-01-01 00:00:00.000000000 +0000 @@ -1,8 +0,0 @@ -Attributes { - a { - a { - string scale_factor 0.1; - string add_offset 10; - } - } -} \ No newline at end of file diff -Nru libdap-3.11.1/unit-tests/ce-functions-testsuite/two_grid.dds libdap-3.12.0/unit-tests/ce-functions-testsuite/two_grid.dds --- libdap-3.11.1/unit-tests/ce-functions-testsuite/two_grid.dds 2011-04-29 13:19:40.000000000 +0000 +++ libdap-3.12.0/unit-tests/ce-functions-testsuite/two_grid.dds 1970-01-01 00:00:00.000000000 +0000 @@ -1,28 +0,0 @@ -Dataset { - Grid { - Array: - Byte a[first=10]; - Maps: - Float64 first[10]; - } a; - - # Use this grid to look at Maps with values that go from big to small, - # which should not be an issue, but... - Grid { - Array: - Byte b[first=10]; - Maps: - Float64 first[10]; - } b; - - Grid { - Array: - Byte val[lon=14][lat=14]; - Maps: - Float32 lon[14]; - Float32 lat[14]; - } values; - - Float32 lat[14]; - Float32 lon[14]; -} two_grids; diff -Nru libdap-3.11.1/unit-tests/dasT.cc libdap-3.12.0/unit-tests/dasT.cc --- libdap-3.11.1/unit-tests/dasT.cc 2011-04-29 13:19:42.000000000 +0000 +++ libdap-3.12.0/unit-tests/dasT.cc 2013-10-17 21:27:40.000000000 +0000 @@ -14,7 +14,7 @@ #include "DAS.h" -#include "testFile.cc" +#include "testFile.h" using namespace std; using namespace libdap; diff -Nru libdap-3.11.1/unit-tests/dds-testsuite/fnoc1.nc.dmr.xml libdap-3.12.0/unit-tests/dds-testsuite/fnoc1.nc.dmr.xml --- libdap-3.11.1/unit-tests/dds-testsuite/fnoc1.nc.dmr.xml 1970-01-01 00:00:00.000000000 +0000 +++ libdap-3.12.0/unit-tests/dds-testsuite/fnoc1.nc.dmr.xml 2013-10-17 21:27:40.000000000 +0000 @@ -0,0 +1,79 @@ + + + + + 88- 10-00:00:00 + + + FNOC UV wind components from 1988- 10 to 1988- 13. + + + + + time_a + + + + + meter per second + + + Vector wind eastward component + + + -32767 + + + 0.005 + + + UWind + + + + + + + + + meter per second + + + Vector wind northward component + + + -32767 + + + 0.005 + + + VWind + + + + + + + + + degree North + + + + + + + degree East + + + + + + + hours from base_time + + + + + diff -Nru libdap-3.11.1/unit-tests/dds-testsuite/test.19b.xml libdap-3.12.0/unit-tests/dds-testsuite/test.19b.xml --- libdap-3.11.1/unit-tests/dds-testsuite/test.19b.xml 1970-01-01 00:00:00.000000000 +0000 +++ libdap-3.12.0/unit-tests/dds-testsuite/test.19b.xml 2013-10-17 21:27:40.000000000 +0000 @@ -0,0 +1,20 @@ + + + + + + + + + + + + + + + + + + + + diff -Nru libdap-3.11.1/unit-tests/dds-testsuite/test.19b6.xml libdap-3.12.0/unit-tests/dds-testsuite/test.19b6.xml --- libdap-3.11.1/unit-tests/dds-testsuite/test.19b6.xml 1970-01-01 00:00:00.000000000 +0000 +++ libdap-3.12.0/unit-tests/dds-testsuite/test.19b6.xml 2013-10-17 21:27:40.000000000 +0000 @@ -0,0 +1,53 @@ + + + + + Attribute merge test + + + 2 + 3 + 5 + 7 + 11 + + + + + + b pound c + + + + + + + c d with a WWW escape sequence + + + + Attributes inside attributes + + + 3.1415 + + + + + + The Grid huh + + + + + + + + The color map vector + + + + + + + diff -Nru libdap-3.11.1/unit-tests/dds-testsuite/test.19c.xml libdap-3.12.0/unit-tests/dds-testsuite/test.19c.xml --- libdap-3.11.1/unit-tests/dds-testsuite/test.19c.xml 1970-01-01 00:00:00.000000000 +0000 +++ libdap-3.12.0/unit-tests/dds-testsuite/test.19c.xml 2013-10-17 21:27:40.000000000 +0000 @@ -0,0 +1,17 @@ + + + + + Attribute merge test + + + 2 + 3 + 5 + 7 + 11 + + + + + diff -Nru libdap-3.11.1/unit-tests/dds-testsuite/test.19d.xml libdap-3.12.0/unit-tests/dds-testsuite/test.19d.xml --- libdap-3.11.1/unit-tests/dds-testsuite/test.19d.xml 1970-01-01 00:00:00.000000000 +0000 +++ libdap-3.12.0/unit-tests/dds-testsuite/test.19d.xml 2013-10-17 21:27:40.000000000 +0000 @@ -0,0 +1,11 @@ + + + + + b pound c + + + + + + diff -Nru libdap-3.11.1/unit-tests/dds-testsuite/test.19d1.xml libdap-3.12.0/unit-tests/dds-testsuite/test.19d1.xml --- libdap-3.11.1/unit-tests/dds-testsuite/test.19d1.xml 1970-01-01 00:00:00.000000000 +0000 +++ libdap-3.12.0/unit-tests/dds-testsuite/test.19d1.xml 2013-10-17 21:27:40.000000000 +0000 @@ -0,0 +1,16 @@ + + + + + b pound c + + + + 0.125 + + + + + + + \ No newline at end of file diff -Nru libdap-3.11.1/unit-tests/dds-testsuite/test.19e.xml libdap-3.12.0/unit-tests/dds-testsuite/test.19e.xml --- libdap-3.11.1/unit-tests/dds-testsuite/test.19e.xml 1970-01-01 00:00:00.000000000 +0000 +++ libdap-3.12.0/unit-tests/dds-testsuite/test.19e.xml 2013-10-17 21:27:40.000000000 +0000 @@ -0,0 +1,17 @@ + + + + + c d with a WWW escape sequence + + + + Attributes inside attributes + + + 3.1415 + + + + + diff -Nru libdap-3.11.1/unit-tests/dds-testsuite/test.19f.xml libdap-3.12.0/unit-tests/dds-testsuite/test.19f.xml --- libdap-3.11.1/unit-tests/dds-testsuite/test.19f.xml 1970-01-01 00:00:00.000000000 +0000 +++ libdap-3.12.0/unit-tests/dds-testsuite/test.19f.xml 2013-10-17 21:27:40.000000000 +0000 @@ -0,0 +1,20 @@ + + + + + The Grid huh + + + + + + + + The color map vector + + + + + + + diff -Nru libdap-3.11.1/unit-tests/dds-testsuite/test.19g.xml libdap-3.12.0/unit-tests/dds-testsuite/test.19g.xml --- libdap-3.11.1/unit-tests/dds-testsuite/test.19g.xml 1970-01-01 00:00:00.000000000 +0000 +++ libdap-3.12.0/unit-tests/dds-testsuite/test.19g.xml 2013-10-17 21:27:40.000000000 +0000 @@ -0,0 +1,46 @@ + + + + + b pound c + + + + + 0.125 + + + + + The Grid huh + + + + The color map vector + + + + + + + m/s + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff -Nru libdap-3.11.1/unit-tests/ddsT.cc libdap-3.12.0/unit-tests/ddsT.cc --- libdap-3.11.1/unit-tests/ddsT.cc 2011-04-29 13:19:42.000000000 +0000 +++ libdap-3.12.0/unit-tests/ddsT.cc 2013-10-17 21:27:40.000000000 +0000 @@ -32,11 +32,11 @@ #include "TestInt16.h" #include "TestStr.h" #include "TestTypeFactory.h" -#include "ce_functions.h" +//#include "ce_functions.h" #include "util.h" #include "debug.h" -#include "testFile.cc" +#include "testFile.h" using namespace std; using namespace libdap; diff -Nru libdap-3.11.1/unit-tests/ddx-testsuite/response_builder_send_data_ddx_test.xml libdap-3.12.0/unit-tests/ddx-testsuite/response_builder_send_data_ddx_test.xml --- libdap-3.11.1/unit-tests/ddx-testsuite/response_builder_send_data_ddx_test.xml 1970-01-01 00:00:00.000000000 +0000 +++ libdap-3.12.0/unit-tests/ddx-testsuite/response_builder_send_data_ddx_test.xml 2013-10-17 21:27:40.000000000 +0000 @@ -0,0 +1,35 @@ +HTTP/1.0 200 OK +XDODS-Server: .* +XOPeNDAP-Server: .* +XDAP: .* +Date: .* +Last-Modified: .* +Content-Type: Multipart/Related; boundary=boundary; start=""; type="Text/xml" +Content-Description: dap4-data-ddx + +--boundary +Content-Type: Text/xml; charset=iso-8859-1 +Content-Id: +Content-Description: dap4-ddx + + + + + 7 + + + cars + +
    + + + +--boundary +Content-Type: application/octet-stream +Content-Id: <.*@opendap.org> +Content-Description: dap4-data +Content-Encoding: binary + +.* +--boundary-- \ No newline at end of file diff -Nru libdap-3.11.1/unit-tests/ddx-testsuite/response_builder_send_data_ddx_test_3.xml libdap-3.12.0/unit-tests/ddx-testsuite/response_builder_send_data_ddx_test_3.xml --- libdap-3.11.1/unit-tests/ddx-testsuite/response_builder_send_data_ddx_test_3.xml 1970-01-01 00:00:00.000000000 +0000 +++ libdap-3.12.0/unit-tests/ddx-testsuite/response_builder_send_data_ddx_test_3.xml 2013-10-17 21:27:40.000000000 +0000 @@ -0,0 +1,35 @@ +HTTP/1.0 200 OK\r +XDODS-Server: * +XOPeNDAP-Server: * +XDAP: * +Date: * +Last-Modified: * +Content-Type: Multipart/Related; boundary=boundary; start=""; type="Text/xml"\r +Content-Description: dap4-data-ddx\r +\r +--boundary\r +Content-Type: Text/xml; charset=iso-8859-1\r +Content-Id: \r +Content-Description: dap4-ddx\r +\r +<.xml version="1.0" encoding="ISO-8859-1".> + + + 7 + + + cars + +
    + + + +--boundary\r +Content-Type: application/octet-stream\r +Content-Id: <*@opendap.org>\r +Content-Description: dap4-data\r +Content-Encoding: binary\r +\r +* +--boundary--\r diff -Nru libdap-3.11.1/unit-tests/ddx-testsuite/response_builder_send_ddx_test.xml libdap-3.12.0/unit-tests/ddx-testsuite/response_builder_send_ddx_test.xml --- libdap-3.11.1/unit-tests/ddx-testsuite/response_builder_send_ddx_test.xml 1970-01-01 00:00:00.000000000 +0000 +++ libdap-3.12.0/unit-tests/ddx-testsuite/response_builder_send_ddx_test.xml 2013-10-17 21:27:40.000000000 +0000 @@ -0,0 +1,20 @@ +HTTP/1.0 200 OK +XDODS-Server: .* +XOPeNDAP-Server: .* +XDAP: 3.2 +Date: .* +Last-Modified: .* +Content-Type: text/xml +Content-Description: dap4-ddx + +<.xml version="1.0" encoding="ISO-8859-1".> + + + + 7 + + + cars + + + \ No newline at end of file diff -Nru libdap-3.11.1/unit-tests/ddx-testsuite/test.09.ddx libdap-3.12.0/unit-tests/ddx-testsuite/test.09.ddx --- libdap-3.11.1/unit-tests/ddx-testsuite/test.09.ddx 2011-04-29 13:19:42.000000000 +0000 +++ libdap-3.12.0/unit-tests/ddx-testsuite/test.09.ddx 2013-10-17 21:27:40.000000000 +0000 @@ -13,7 +13,7 @@
    - + 1451.87567 diff -Nru libdap-3.11.1/unit-tests/generalUtilTest.cc libdap-3.12.0/unit-tests/generalUtilTest.cc --- libdap-3.11.1/unit-tests/generalUtilTest.cc 2011-04-29 13:19:42.000000000 +0000 +++ libdap-3.12.0/unit-tests/generalUtilTest.cc 2013-10-17 21:27:40.000000000 +0000 @@ -19,7 +19,7 @@ // // You should have received a copy of the GNU Lesser General Public // License along with this library; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA // // You can contact OPeNDAP, Inc. at PO Box 112, Saunderstown, RI. 02874-0112. @@ -74,9 +74,29 @@ CPPUNIT_TEST(id2xml_test); CPPUNIT_TEST(xml2id_test); + CPPUNIT_TEST(glob_test_1); + CPPUNIT_TEST(glob_test_2); + CPPUNIT_TEST(glob_test_3); + CPPUNIT_TEST_SUITE_END(); // Tests for methods + void glob_test_1() { + string t = "This is a test"; + int status = glob("This is a test", t.c_str()); + CPPUNIT_ASSERT(status == 0); + } + void glob_test_2() { + string t = "This is a test"; + int status = glob("This * test", t.c_str()); + CPPUNIT_ASSERT(status == 0); + } + void glob_test_3() { + string t = "This is a test"; + int status = glob("* is * test", t.c_str()); + CPPUNIT_ASSERT(status == 0); + } + void octal_to_hex_test() { string hex; hex = octal_to_hex("000"); @@ -164,9 +184,10 @@ CPPUNIT_ASSERT(www2id("Grid%20Data%26Fields[20][20]", "%", "%20%26") == "Grid%20Data%26Fields[20][20]"); - cerr << "www2id(\"%25This%26is\"): " << www2id("%25This%26is") << endl; + //cerr << "www2id(\"%25This%26is\"): " << www2id("%25This%26is") << endl; CPPUNIT_ASSERT(www2id("%25This%26is") == "%This&is"); - + //cerr << "www2id(\"OPF_MaxSpectralPixelsMissing%d4\"): " << www2id("OPF_MaxSpectralPixelsMissing%d4") << endl; + //CPPUNIT_ASSERT(www2id("OPF_MaxSpectralPixelsMissing%d4") == "OPF_MaxSpectralPixelsMissing?"); } // This is the code in expr.lex that removes enclosing double quotes and diff -Nru libdap-3.11.1/unit-tests/parserUtilTest.cc libdap-3.12.0/unit-tests/parserUtilTest.cc --- libdap-3.11.1/unit-tests/parserUtilTest.cc 2011-04-29 13:19:42.000000000 +0000 +++ libdap-3.12.0/unit-tests/parserUtilTest.cc 2013-10-17 21:27:40.000000000 +0000 @@ -19,7 +19,7 @@ // // You should have received a copy of the GNU Lesser General Public // License along with this library; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA // // You can contact OPeNDAP, Inc. at PO Box 112, Saunderstown, RI. 02874-0112. diff -Nru libdap-3.11.1/unit-tests/server-testsuite/config/unix.exp libdap-3.12.0/unit-tests/server-testsuite/config/unix.exp --- libdap-3.11.1/unit-tests/server-testsuite/config/unix.exp 2011-04-29 13:19:38.000000000 +0000 +++ libdap-3.12.0/unit-tests/server-testsuite/config/unix.exp 1970-01-01 00:00:00.000000000 +0000 @@ -1,48 +0,0 @@ - -# Tcl/Expect code for the geturl test. This really is designed to test the -# various servers (hdf, dsp, netcdf, matlab, ...) on serveral different -# platforms. -# -# $Id: unix.exp 11906 2005-08-08 19:51:43Z root $ - -# Make sure the global var GETURL is set correctly. - -global GETURL -if ![info exists GETURL] then { - set GETURL [transform ./geturl] -} - -# The four `required' procs are _start, _load, _exit and _version. - -proc geturl_start { {switches ""} {urls ""} {file ""}} { - global verbose - global GETURL - global comp_output - global spawn_id - - if ![string compare $file ""] { - if {$verbose >= 1} { - send_user "Testing geturl $switches $urls ...\n" - exp_internal 1 - } - catch "exec $GETURL $switches $urls" comp_output - } else { - if {$verbose >= 1} { - send_user "Testing geturl $switches $urls >& $file ...\n" - exp_internal 1 - } - catch "exec $GETURL $switches $urls > $file" comp_output - } -} - -proc geturl_load {} { -} - -proc geturl_exit {} { - send -raw "" -} - -proc geturl_version {} { - send_user "geturl test suite 1.0\n" -} - diff -Nru libdap-3.11.1/unit-tests/server-testsuite/geturl.0/dodsdev.exp libdap-3.12.0/unit-tests/server-testsuite/geturl.0/dodsdev.exp --- libdap-3.11.1/unit-tests/server-testsuite/geturl.0/dodsdev.exp 2011-04-29 13:19:38.000000000 +0000 +++ libdap-3.12.0/unit-tests/server-testsuite/geturl.0/dodsdev.exp 1970-01-01 00:00:00.000000000 +0000 @@ -1,102 +0,0 @@ - -# Copy this file and change the host name and/or the test_dir names to test -# servers on other hosts or other versions of the servers. - -# $Log: dodsdev.exp,v $ -# Revision 1.6 2005/05/23 16:07:06 jimg -# Now uses local common-tests.exp and test.opendap.org. -# -# Revision 1.5 2005/03/30 23:12:02 jimg -# Modified to use the new factory class. -# -# Revision 1.4 2003/12/11 01:08:38 jimg -# More fixes after resolving conflicts. This code still fails some tests. -# -# Revision 1.3.2.1 2003/11/19 18:56:30 jimg -# Switched back to dodsdev & remote access. -# -# Revision 1.3 2003/04/22 19:40:30 jimg -# Merged with 3.3.1. -# -# Revision 1.2.2.1 2003/04/18 03:37:30 jimg -# Set the host to localhost and the test dir to dods-test (the current -# release). -# -# Revision 1.2 2002/06/03 22:21:17 jimg -# Merged with release-3-2-9 -# -# Revision 1.1.2.1 2002/04/16 17:07:20 jimg -# Added/Fixed tests so that they use the client test data collection on -# dodsdev. This data collection will form the basis for all the client -# testing. -# -# Revision 1.2.46.2 2001/07/28 01:12:29 jimg -# Updated to work with the new escaping code. Some of our tests assumed -# that dashes (-) were not OK in symbol names. However, changes in the -# DAP parsers along with changes in the escaping functions now make this -# possible. -# -# Revision 1.2.46.1 2001/05/03 20:26:43 jimg -# These are now more configurable. -# -# Revision 1.2 1997/09/22 23:14:45 jimg -# *** empty log message *** -# - -global comp_output # contains output from das-test_start -global verbose # this and srcdir are set by runtest.exp -global srcdir -global host - -source common_tests.exp - -# Server machine name -set host "test.opendap.org" -# set host "localhost" -# CGI directory on $host -set test_dir "dods-3.4" - -source "server-testsuite/geturl.0/urls.tcl" - -set test_name "dodedev" - -# The `1' in compare_stdout means call xfail if the test fails. - -geturl_start "-D" "${bears}?${bears_ce}" -compare_stdout "server-testsuite/bears.data" "${test_name}: NetCDF/bears" - -geturl_start "-D" "${fnoc1}?${fnoc1_ce}" -compare_stdout "server-testsuite/fnoc1.data" "$test_name: NetCDF/fnoc1" - -geturl_start "-D" "${dsp_1}?${dsp_1_ce}" -compare_stdout "server-testsuite/dsp_1.data" "$test_name: DSP" - -geturl_start "-D" "${nscat_s2}?${nscat_s2_ce}" -compare_stdout "server-testsuite/nscat_s2.data" "$test_name: Matlab" - -geturl_start "-D" "${nscat_hdf}?${nscat_hdf_ce}" -compare_stdout "server-testsuite/nscat_hdf.data" "$test_name: HDF" - -geturl_start "-D" "${jg_test}?${jg_test_ce}" -compare_stdout "server-testsuite/jg_test.data" "$test_name: JGOFS" - -geturl_start "-d" "${ff_test1}" -compare_stdout $ff_test1_dds "$test_name: FF DDS check" - -geturl_start "-D" "${ff_test1}?${ff_test1_ce1}" -compare_stdout "server-testsuite/ff_test1_ce1.data" "$test_name: FF" - -geturl_start "-D" "${ff_test1}?${ff_test1_ce2}" -compare_stdout "server-testsuite/ff_test1_ce2.data" "$test_name: FF, compund name" - -geturl_start "-d" "${ff_test2}" -compare_stdout $ff_test2_dds "$test_name: FF DDS check" - -geturl_start "-D" "${ff_test2}?${ff_test2_ce1}" -compare_stdout "server-testsuite/ff_test2_ce1.data" "$test_name: FF" - -geturl_start "-D" "${ff_test2}?${ff_test2_ce2}" -compare_stdout "server-testsuite/ff_test2_ce2.data" "$test_name: FF, compund name, with escaped space" - -geturl_start "-D" "\"${ff_test2}?${ff_test2_ce3}\"" -compare_stdout "server-testsuite/ff_test2_ce3.data" "$test_name: FF, compund name, with unescaped space" diff -Nru libdap-3.11.1/unit-tests/server-testsuite/geturl.0/urls.tcl libdap-3.12.0/unit-tests/server-testsuite/geturl.0/urls.tcl --- libdap-3.11.1/unit-tests/server-testsuite/geturl.0/urls.tcl 2011-04-29 13:19:38.000000000 +0000 +++ libdap-3.12.0/unit-tests/server-testsuite/geturl.0/urls.tcl 1970-01-01 00:00:00.000000000 +0000 @@ -1,275 +0,0 @@ - -# $Id: urls.tcl 11906 2005-08-08 19:51:43Z root $ - -# Datasets and their expected output (the information that writeval sends to -# stdout - not the stuff that should be going into the file). - -# URI/BEARS: -set bears "http://$host/$test_dir/nph-dods/data/nc/bears.nc" -set bears_ce "bears" -set bears_dds "Dataset { - Grid { - ARRAY: - String bears\[i = 2\]\[j = 3\]\[l = 3\]; - MAPS: - Int32 i\[i = 2\]; - Float64 j\[j = 3\]; - Int32 l\[l = 3\]; - } bears; - Grid { - ARRAY: - Int32 order\[i = 2\]\[j = 3\]; - MAPS: - Int32 i\[i = 2\]; - Float64 j\[j = 3\]; - } order; - Grid { - ARRAY: - Int32 shot\[i = 2\]\[j = 3\]; - MAPS: - Int32 i\[i = 2\]; - Float64 j\[j = 3\]; - } shot; - Grid { - ARRAY: - Float64 aloan\[i = 2\]\[j = 3\]; - MAPS: - Int32 i\[i = 2\]; - Float64 j\[j = 3\]; - } aloan; - Grid { - ARRAY: - Float64 cross\[i = 2\]\[j = 3\]; - MAPS: - Int32 i\[i = 2\]; - Float64 j\[j = 3\]; - } cross; - Int32 i\[i = 2\]; - Float64 j\[j = 3\]; - Int32 l\[l = 3\]; -} bears;" - -# URI/FNOC -set fnoc1 "http://$host/$test_dir/nph-dods/data/nc/fnoc1.nc" -set fnoc1_ce "u\\\[0:0\\\]\\\[0:9\\\]\\\[0:9\\\]" -set fnoc1_dds "Dataset { - Int32 u\[time_a = 16\]\[lat = 17\]\[lon = 21\]; - Int32 v\[time_a = 16\]\[lat = 17\]\[lon = 21\]; - Float64 lat\[lat = 17\]; - Float64 lon\[lon = 21\]; - Float64 time\[time = 16\]; -} fnoc1;" - -# URI/DSP: -set dsp_1 "http://$host/$test_dir/nph-dods/data/dsp/east.coast.pvu" -set dsp_1_ce "dsp_band_1\\\[20:30\\\]\\\[20:30\\\]" -set dsp_1_dds "Dataset { - Byte dsp_band_1\\\[line = 512\\\]\\\[pixel = 512\\\]; -} east.coast.pvu;" - -# URI/MatLab: -set nscat_s2 "http://$host/$test_dir/nph-dods/data/mat/NSCAT_S2.mat" -set nscat_s2_ce "NSCAT_S2\\\[75:75\\\]\\\[0:5\\\]" -set nscat_s2_dds "Dataset { - Float64 NSCAT_S2\[NSCAT_S2_row = 153\]\[NSCAT_S2_column = 843\]; -} NSCAT_S2;" - -# URI/NSCAT: -set nscat_hdf "http://$host/$test_dir/nph-dods/data/hdf/S2000415.HDF" -set nscat_hdf_ce "WVC_Lat\\\[200:201\\\]\\\[20:21\\\]" -set nscat_hdf_dds "Dataset { - Int32 WVC_Lat\[row = 458\]\[WVC = 24\]; - UInt32 WVC_Lon\[row = 458\]\[WVC = 24\]; - UInt32 Num_Sigma0\[row = 458\]\[WVC = 24\]; - UInt32 Num_Beam_12\[row = 458\]\[WVC = 24\]; - UInt32 Num_Beam_34\[row = 458\]\[WVC = 24\]; - UInt32 Num_Beam_56\[row = 458\]\[WVC = 24\]; - UInt32 Num_Beam_78\[row = 458\]\[WVC = 24\]; - UInt32 WVC_Quality_Flag\[row = 458\]\[WVC = 24\]; - UInt32 Mean_Wind\[row = 458\]\[WVC = 24\]; - UInt32 Wind_Speed\[row = 458\]\[WVC = 24\]\[position = 4\]; - UInt32 Wind_Dir\[row = 458\]\[WVC = 24\]\[position = 4\]; - UInt32 Error_Speed\[row = 458\]\[WVC = 24\]\[position = 4\]; - UInt32 Error_Dir\[row = 458\]\[WVC = 24\]\[position = 4\]; - Int32 MLE_Likelihood\[row = 458\]\[WVC = 24\]\[position = 4\]; - UInt32 Num_Ambigs\[row = 458\]\[WVC = 24\]; - Sequence { - Structure { - Int32 begin__0; - } begin; - } SwathIndex; - Sequence { - Structure { - String Mean_Time__0; - } Mean_Time; - Structure { - UInt32 Low_Wind_Speed_Flag__0; - } Low_Wind_Speed_Flag; - Structure { - UInt32 High_Wind_Speed_Flag__0; - } High_Wind_Speed_Flag; - } NSCAT%20L2; -} S2000415%2eHDF;" - -# URI/NSCAT Level 3 - here to test grids with the hdf server. -set nscat_l3 "http://$host/$test_dir/nph-dods/data/hdf/S3097057.HDF" -set nscat_l3_ce1 "WVC_Count\\\[200:201\\\]\\\[20:119\\\]" -set nscat_l3_ce2 "Avg_Wind_Vel_U\\\[200:201\\\]\\\[20:119\\\]" -set nscat_l3_dds "Dataset { - Grid { - ARRAY: - UInt32 WVC_Count\[row = 300\]\[column = 720\]; - MAPS: - Float64 row\[300\]; - Float64 column\[720\]; - } WVC_Count; - Grid { - ARRAY: - UInt32 Map_Day_Fraction\[row = 300\]\[column = 720\]; - MAPS: - Float64 row\[300\]; - Float64 column\[720\]; - } Map_Day_Fraction; - Grid { - ARRAY: - UInt32 Avg_Sigma0_Count\[row = 300\]\[column = 720\]; - MAPS: - Float64 row\[300\]; - Float64 column\[720\]; - } Avg_Sigma0_Count; - Grid { - ARRAY: - Int32 Avg_Wind_Vel_U\[row = 300\]\[column = 720\]; - MAPS: - Float64 row\[300\]; - Float64 column\[720\]; - } Avg_Wind_Vel_U; - Grid { - ARRAY: - Int32 Avg_Wind_Vel_V\[row = 300\]\[column = 720\]; - MAPS: - Float64 row\[300\]; - Float64 column\[720\]; - } Avg_Wind_Vel_V; - Grid { - ARRAY: - UInt32 Avg_Wind_Speed\[row = 300\]\[column = 720\]; - MAPS: - Float64 row\[300\]; - Float64 column\[720\]; - } Avg_Wind_Speed; - Grid { - ARRAY: - UInt32 RMS_Wind_Speed\[row = 300\]\[column = 720\]; - MAPS: - Float64 row\[300\]; - Float64 column\[720\]; - } RMS_Wind_Speed; - Grid { - ARRAY: - UInt32 Map_Day_Fraction_StdDev\[row = 300\]\[column = 720\]; - MAPS: - Float64 row\[300\]; - Float64 column\[720\]; - } Map_Day_Fraction_StdDev; - Grid { - ARRAY: - UInt32 Wind_Vel_U_StdDev\[row = 300\]\[column = 720\]; - MAPS: - Float64 row\[300\]; - Float64 column\[720\]; - } Wind_Vel_U_StdDev; - Grid { - ARRAY: - UInt32 Wind_Vel_V_StdDev\[row = 300\]\[column = 720\]; - MAPS: - Float64 row\[300\]; - Float64 column\[720\]; - } Wind_Vel_V_StdDev; - Sequence { - Structure { - String bin_meth__0; - } bin_meth; - Structure { - String grid_origin__0; - } grid_origin; - Structure { - Float64 hsize__0; - } hsize; - Structure { - Int32 max_east__0; - } max_east; - Structure { - Int32 max_north__0; - } max_north; - Structure { - Int32 max_south__0; - } max_south; - Structure { - Int32 max_west__0; - } max_west; - Structure { - String registration__0; - } registration; - Structure { - Float64 vsize__0; - } vsize; - } Lat%2fLon; -} S3097057%2eHDF;" - -# URI/JGOFS: -set jg_test "http://$host/$test_dir/nph-dods/test" -set jg_test_ce "year,month,lat,lon,sal&lat>37.5&lat<38.0" -set jg_test_dds "Dataset { - Sequence { - String leg; - String year; - String month; - Sequence { - String station; - String lat; - String lon; - Sequence { - String press; - String temp; - String sal; - String o2; - String sigth; - } Level_2; - } Level_1; - } Level_0; -} test;" - -# FF server tests. These also test asking for stuff when the variable names -# contain spaces. 7/26/2001 jhrg - -set ff_test1 "http://$host/$test_dir/nph-dods/data/ff/jplpath.dat" -set ff_test1_ce1 "year" -set ff_test1_ce2 "JPL_Pathfinder.year" -set ff_test1_dds "Dataset { - Sequence { - Int32 year; - Int32 day; - Int32 hours; - Int32 minutes; - Int32 seconds; - String DODS_URL; - } JPL_Pathfinder; -} jplpath.dat; -" - -set ff_test2 "http://$host/$test_dir/nph-dods/data/ff/jplpath_space.dat" -set ff_test2_ce1 "year" -set ff_test2_ce2 "JPL%20Pathfinder.year" -set ff_test2_ce3 "JPL Pathfinder.year" -set ff_test2_dds "Dataset { - Sequence { - Int32 year; - Int32 day; - Int32 hours; - Int32 minutes; - Int32 seconds; - String DODS_URL; - } JPL%20Pathfinder; -} jplpath_space.dat; -" \ No newline at end of file diff -Nru libdap-3.11.1/unit-tests/server-testsuite/response_builder_invoke_server_side_function_test.txt libdap-3.12.0/unit-tests/server-testsuite/response_builder_invoke_server_side_function_test.txt --- libdap-3.11.1/unit-tests/server-testsuite/response_builder_invoke_server_side_function_test.txt 1970-01-01 00:00:00.000000000 +0000 +++ libdap-3.12.0/unit-tests/server-testsuite/response_builder_invoke_server_side_function_test.txt 2013-10-17 21:27:40.000000000 +0000 @@ -0,0 +1,19 @@ +HTTP/1.0 200 OK +XDODS-Server: .* +XOPeNDAP-Server: .* +XDAP: .* +Date: .* +Last-Modified: .* +Content-Type: application/octet-stream +Content-Description: dods_data + +Dataset . + String version; +. function_result_test; +Data: +.<.xml version="1.0" encoding="UTF-8".> + + + Returns a list of the functions held in the ServerFunctionsList object + + diff -Nru libdap-3.11.1/unit-tests/server-testsuite/send_das_baseline.txt libdap-3.12.0/unit-tests/server-testsuite/send_das_baseline.txt --- libdap-3.11.1/unit-tests/server-testsuite/send_das_baseline.txt 1970-01-01 00:00:00.000000000 +0000 +++ libdap-3.12.0/unit-tests/server-testsuite/send_das_baseline.txt 2013-10-17 21:27:40.000000000 +0000 @@ -0,0 +1,15 @@ +HTTP/1.0 200 OK.* +XDODS-Server:.* +XOPeNDAP-Server:.* +XDAP:.* +Date:.* +Last-Modified:.* +Content-Type: text/plain.* +Content-Description: dods_das.* +.* +Attributes \{ + a \{ + Int32 size 7; + String type "cars"; + \} +\}.* \ No newline at end of file diff -Nru libdap-3.11.1/unit-tests/server-testsuite/send_dds_baseline.txt libdap-3.12.0/unit-tests/server-testsuite/send_dds_baseline.txt --- libdap-3.11.1/unit-tests/server-testsuite/send_dds_baseline.txt 1970-01-01 00:00:00.000000000 +0000 +++ libdap-3.12.0/unit-tests/server-testsuite/send_dds_baseline.txt 2013-10-17 21:27:40.000000000 +0000 @@ -0,0 +1,12 @@ +HTTP/1.0 200 OK.* +XDODS-Server:.* +XOPeNDAP-Server:.* +XDAP:.* +Date:.* +Last-Modified:.* +Content-Type: text/plain.* +Content-Description: dods_dds.* +.* +Dataset \{ + Byte a; +\} test;.* \ No newline at end of file diff -Nru libdap-3.11.1/unit-tests/server-testsuite/simple_function_baseline.txt libdap-3.12.0/unit-tests/server-testsuite/simple_function_baseline.txt --- libdap-3.11.1/unit-tests/server-testsuite/simple_function_baseline.txt 1970-01-01 00:00:00.000000000 +0000 +++ libdap-3.12.0/unit-tests/server-testsuite/simple_function_baseline.txt 2013-10-17 21:27:40.000000000 +0000 @@ -0,0 +1,13 @@ +HTTP/1.0 200 OK.* +XDODS-Server:.* +XOPeNDAP-Server:.* +XDAP:.* +Date:.* +Last-Modified:.* +Content-Type: application/octet-stream.* +Content-Description: dods_data.* +.* +Dataset \{ + String result; +\} function_result_test; +.* \ No newline at end of file diff -Nru libdap-3.11.1/unit-tests/structT.cc libdap-3.12.0/unit-tests/structT.cc --- libdap-3.11.1/unit-tests/structT.cc 2011-04-29 13:19:42.000000000 +0000 +++ libdap-3.12.0/unit-tests/structT.cc 2013-10-17 21:27:40.000000000 +0000 @@ -1,4 +1,3 @@ - #include #include #include @@ -16,139 +15,140 @@ #include "util.h" //#include "Pix.h" -using std::cerr ; -using std::endl ; -using std::ostringstream ; +using std::cerr; +using std::endl; +using std::ostringstream; int test_variable_sleep_interval = 0; // Used in Test* classes for testing - // timeouts. -string ExpectedPrint1( "Structure {\n\ +// timeouts. +string ExpectedPrint1( + "Structure {\n\ Int16 name_int16;\n\ String name_str;\n\ Int16 array_int[dim1 = 4][dim2 = 3][dim3 = 2];\n\ -} my_structure = { 32000, \"Silly test string: 1\", {{{32000, 32000},{32000, 32000},{32000, 32000}},{{32000, 32000},{32000, 32000},{32000, 32000}},{{32000, 32000},{32000, 32000},{32000, 32000}},{{32000, 32000},{32000, 32000},{32000, 32000}}} };\n") ; +} my_structure = { 32000, \"Silly test string: 1\", {{{32000, 32000},{32000, 32000},{32000, 32000}},{{32000, 32000},{32000, 32000},{32000, 32000}},{{32000, 32000},{32000, 32000},{32000, 32000}},{{32000, 32000},{32000, 32000},{32000, 32000}}} };\n"); -string ExpectedPrint2( "Structure {\n\ +string ExpectedPrint2( + "Structure {\n\ Int16 name_int16;\n\ Int16 array_int[dim1 = 4][dim2 = 3][dim3 = 2];\n\ -} my_structure = { 32000, {{{32000, 32000},{32000, 32000},{32000, 32000}},{{32000, 32000},{32000, 32000},{32000, 32000}},{{32000, 32000},{32000, 32000},{32000, 32000}},{{32000, 32000},{32000, 32000},{32000, 32000}}} };\n") ; +} my_structure = { 32000, {{{32000, 32000},{32000, 32000},{32000, 32000}},{{32000, 32000},{32000, 32000},{32000, 32000}},{{32000, 32000},{32000, 32000},{32000, 32000}},{{32000, 32000},{32000, 32000},{32000, 32000}}} };\n"); -class structT : public CppUnit::TestFixture { +class structT: public CppUnit::TestFixture { -CPPUNIT_TEST_SUITE( structT ) ; -CPPUNIT_TEST( structT_test ) ; -CPPUNIT_TEST_SUITE_END( ) ; +CPPUNIT_TEST_SUITE( structT ); + CPPUNIT_TEST( structT_test ); + CPPUNIT_TEST_SUITE_END( ) + ; private: - /* TEST PRIVATE DATA */ - TestTypeFactory *factory; - + /* TEST PRIVATE DATA */ + TestTypeFactory *factory; + public: - void setUp() - { - factory = new TestTypeFactory; - } - - void tearDown() - { - delete factory; factory = 0; - } - - void structT_test() - { - TestStructure s( "my_structure" ) ; - - BaseType *bt = factory->NewInt16( "name_int16" ) ; - s.add_var( bt ) ; - delete bt ; bt = 0 ; - - bt = factory->NewStr( "name_str" ) ; - s.add_var( bt ) ; - delete bt ; bt = 0 ; - - Array *abt = factory->NewArray( "name_array", factory->NewInt16( "array_int" ) ) ; - abt->append_dim( 4, "dim1" ) ; - abt->append_dim( 3, "dim2" ) ; - abt->append_dim( 2, "dim3" ) ; - s.add_var( abt ) ; - delete abt ; abt = 0 ; - - bt = 0 ; - bt = s.var( "name_str", true ) ; - CPPUNIT_ASSERT( bt && bt->name() == "name_str" ) ; - - bt = 0 ; - bt = s.var( "name_str", false ) ; - CPPUNIT_ASSERT( bt && bt->name() == "name_str" ) ; - - vector varnames ; - varnames.push_back( "name_int16" ) ; - varnames.push_back( "name_str" ) ; - varnames.push_back( "array_int" ) ; - typedef vector::const_iterator niter ; - - Structure::Vars_iter viter = s.var_begin() ; - niter n = varnames.begin() ; - for( ; viter != s.var_end() && n != varnames.end(); viter++, n++ ) - { - CPPUNIT_ASSERT( (*viter)->name() == *n ) ; - } - CPPUNIT_ASSERT( viter == s.var_end() && n == varnames.end() ) ; - if( viter != s.var_end() && n == varnames.end() ) + void setUp() { - CPPUNIT_FAIL( "Too many variables" ) ; + factory = new TestTypeFactory; } - else if( viter == s.var_end() && n != varnames.end() ) + + void tearDown() { - CPPUNIT_FAIL( "Too few varialbes" ) ; + delete factory; + factory = 0; } - int num_elems = s.element_count( ) ; - CPPUNIT_ASSERT( num_elems == 3 ) ; + void structT_test() + { + TestStructure s("my_structure"); - unsigned int w = s.width() ; - unsigned int wsb = sizeof(string) - + sizeof(dods_int16) - + 24*sizeof(dods_int16) ; - CPPUNIT_ASSERT( w == wsb ) ; - - bool is_read = s.read() ; - CPPUNIT_ASSERT( is_read == true ) ; - - ostringstream sstrm1 ; - s.print_val( sstrm1 ) ; - CPPUNIT_ASSERT( sstrm1.str() == ExpectedPrint1 ) ; - - s.del_var( "name_str" ) ; - - bt = 0 ; - bt = s.var( "name_str", false ) ; - CPPUNIT_ASSERT( bt == 0 ) ; - - w = s.width() ; - wsb = + sizeof(dods_int16) + 24*sizeof(dods_int16) ; - CPPUNIT_ASSERT( w == wsb ) ; - - ostringstream sstrm2 ; - s.print_val( sstrm2 ) ; - CPPUNIT_ASSERT( sstrm2.str() == ExpectedPrint2 ) ; - } + BaseType *bt = factory->NewInt16("name_int16"); + s.add_var(bt); + delete bt; + bt = 0; + + bt = factory->NewStr("name_str"); + s.add_var(bt); + delete bt; + bt = 0; + + Array *abt = factory->NewArray("name_array", factory->NewInt16("array_int")); + abt->append_dim(4, "dim1"); + abt->append_dim(3, "dim2"); + abt->append_dim(2, "dim3"); + s.add_var(abt); + delete abt; + abt = 0; + + bt = 0; + bt = s.var("name_str", true); + CPPUNIT_ASSERT( bt && bt->name() == "name_str" ); + + bt = 0; + bt = s.var("name_str", false); + CPPUNIT_ASSERT( bt && bt->name() == "name_str" ); + + vector varnames; + varnames.push_back("name_int16"); + varnames.push_back("name_str"); + varnames.push_back("array_int"); + typedef vector::const_iterator niter; + + Structure::Vars_iter viter = s.var_begin(); + niter n = varnames.begin(); + for (; viter != s.var_end() && n != varnames.end(); viter++, n++) { + CPPUNIT_ASSERT( (*viter)->name() == *n ); + } + CPPUNIT_ASSERT( viter == s.var_end() && n == varnames.end() ); + if (viter != s.var_end() && n == varnames.end()) { + CPPUNIT_FAIL( "Too many variables" ); + } + else if( viter == s.var_end() && n != varnames.end() ) + { + CPPUNIT_FAIL( "Too few varialbes" ); + } + + int num_elems = s.element_count(); + CPPUNIT_ASSERT( num_elems == 3 ); + + unsigned int w = s.width(); + unsigned int wsb = sizeof(string) + sizeof(dods_int16) + 24 * sizeof(dods_int16); + cerr << "s.width(): " << s.width() << endl; + CPPUNIT_ASSERT( w == wsb ); + + bool is_read = s.read(); + CPPUNIT_ASSERT( is_read == true ); + + ostringstream sstrm1; + s.print_val(sstrm1); + CPPUNIT_ASSERT( sstrm1.str() == ExpectedPrint1 ); + + s.del_var("name_str"); + + bt = 0; + bt = s.var("name_str", false); + CPPUNIT_ASSERT( bt == 0 ); + + w = s.width(); + wsb = +sizeof(dods_int16) + 24 * sizeof(dods_int16); + CPPUNIT_ASSERT( w == wsb ); + + ostringstream sstrm2; + s.print_val(sstrm2); + CPPUNIT_ASSERT( sstrm2.str() == ExpectedPrint2 ); + } }; -CPPUNIT_TEST_SUITE_REGISTRATION( structT ) ; +CPPUNIT_TEST_SUITE_REGISTRATION( structT ); /* NOTHING NEEDS TO BE CHANGED BELOW HERE */ -int main( int, char ** ) +int main(int, char **) { - CppUnit::TextUi::TestRunner runner ; - CppUnit::TestFactoryRegistry ®istry = - CppUnit::TestFactoryRegistry::getRegistry() ; - runner.addTest( registry.makeTest() ) ; - runner.setOutputter( CppUnit::CompilerOutputter::defaultOutputter( - &runner.result(), - std::cerr ) ); - bool wasSuccessful = runner.run( "", false ) ; - return wasSuccessful ? 0 : 1; + CppUnit::TextUi::TestRunner runner; + CppUnit::TestFactoryRegistry ®istry = CppUnit::TestFactoryRegistry::getRegistry(); + runner.addTest(registry.makeTest()); + runner.setOutputter(CppUnit::CompilerOutputter::defaultOutputter(&runner.result(), std::cerr)); + bool wasSuccessful = runner.run("", false); + return wasSuccessful ? 0 : 1; } diff -Nru libdap-3.11.1/unit-tests/testFile.cc libdap-3.12.0/unit-tests/testFile.cc --- libdap-3.11.1/unit-tests/testFile.cc 2011-04-29 13:19:42.000000000 +0000 +++ libdap-3.12.0/unit-tests/testFile.cc 2013-10-17 21:27:40.000000000 +0000 @@ -1,36 +1,35 @@ #include "config.h" -#ifdef HAVE_UNISTD_H -#include -#endif - #include -#include -#include +#include +#include -using namespace std; +#include "testFile.h" -#define FILE2string(s,f,c) do {\ - FILE *(f) = fopen("testout", "w");\ - c;\ - fclose(f);\ - s = testFile("testout");\ - unlink("testout");\ -} while(0); +using namespace std; -// It's evil to include code like this, but for the unit tests, such is -// the way... jhrg 1/20/06 string -testFile(char *fn) +readTestBaseline(const string &fn) { - ifstream ifs(fn); - ostringstream strm; - char line[1024]; - while (!ifs.eof()) { - ifs.getline(line, 1024); - strm << line << endl; - } - ifs.close(); - - return strm.str(); + int length; + + ifstream is; + is.open (fn.c_str(), ios::binary ); + + // get length of file: + is.seekg (0, ios::end); + length = is.tellg(); + + // back to start + is.seekg (0, ios::beg); + + // allocate memory: + vector buffer(length+1); + + // read data as a block: + is.read (&buffer[0], length); + is.close(); + buffer[length] = '\0'; + + return string(&buffer[0]); } diff -Nru libdap-3.11.1/unit-tests/testFile.h libdap-3.12.0/unit-tests/testFile.h --- libdap-3.11.1/unit-tests/testFile.h 1970-01-01 00:00:00.000000000 +0000 +++ libdap-3.12.0/unit-tests/testFile.h 2013-10-17 21:27:40.000000000 +0000 @@ -0,0 +1,21 @@ + +#ifdef HAVE_UNISTD_H +#include +#endif + +#include + +using namespace std; + +#if 0 +// Never use this! +#define FILE2string(s,f,c) do {\ + FILE *(f) = fopen("testout", "w");\ + c;\ + fclose(f);\ + s = readTestBaseline("testout");\ + unlink("testout");\ +} while(0); +#endif + +string readTestBaseline(const string &fn); diff -Nru libdap-3.11.1/unit-tests/test_config.h libdap-3.12.0/unit-tests/test_config.h --- libdap-3.11.1/unit-tests/test_config.h 2011-05-06 17:52:43.000000000 +0000 +++ libdap-3.12.0/unit-tests/test_config.h 2013-10-17 21:27:40.000000000 +0000 @@ -1,7 +1,7 @@ #ifndef E_test_config_h #define E_test_config_h -#define TEST_SRC_DIR "/Users/ndp/OPeNDAP/Projects/Hyrax/swdev/hyrax-1.7.0/src/libdap/unit-tests" +#define TEST_SRC_DIR "/home/jimg/src/hyrax_1.9_release/src/libdap/unit-tests" #endif diff -Nru libdap-3.11.1/util.cc libdap-3.12.0/util.cc --- libdap-3.11.1/util.cc 2011-04-29 13:19:43.000000000 +0000 +++ libdap-3.12.0/util.cc 2013-10-17 21:27:40.000000000 +0000 @@ -19,7 +19,7 @@ // // You should have received a copy of the GNU Lesser General Public // License along with this library; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA // // You can contact OPeNDAP, Inc. at PO Box 112, Saunderstown, RI. 02874-0112. @@ -35,12 +35,11 @@ #include "config.h" -static char rcsid[] not_used = - {"$Id: util.cc 21699 2009-11-05 00:06:01Z jimg $" - }; +#include #include #include +#include #include #ifndef TM_IN_SYS_TIME @@ -67,20 +66,242 @@ #include #include "BaseType.h" +#include "Byte.h" +#include "Int16.h" +#include "Int32.h" +#include "UInt16.h" +#include "UInt32.h" +#include "Float32.h" +#include "Float64.h" #include "Str.h" -#include "Url.h" -#include "Sequence.h" +#include "Array.h" + #include "Error.h" -#include "parser.h" + #include "util.h" #include "GNURegex.h" #include "debug.h" - using namespace std; namespace libdap { +/** Given a BaseType pointer, extract the string value it contains and return + it. + + @param arg The BaseType pointer + @return A C++ string + @exception Error thrown if the referenced BaseType object does not contain + a DAP String. */ +string extract_string_argument(BaseType * arg) +{ + assert(arg); + + if (arg->type() != dods_str_c) + throw Error(malformed_expr, + "The function requires a DAP string argument."); + + if (!arg->read_p()) + throw InternalErr(__FILE__, __LINE__, + "The CE Evaluator built an argument list where some constants held no values."); + + string s = static_cast(arg)->value(); + + DBG(cerr << "s: " << s << endl); + + return s; +} + +template static void set_array_using_double_helper(Array * a, double *src, int src_len) +{ + T *values = new T[src_len]; + // TODO Replace new with vector (vector values(src_len);) + for (int i = 0; i < src_len; ++i) + values[i] = (T) src[i]; + +#ifdef VAL2BUF + a->val2buf(values, true); +#else + a->set_value(values, src_len); +#endif + + delete[]values; +} + +/** Given an array that holds some sort of numeric data, load it with values + using an array of doubles. This function makes several assumptions. First, + it assumes the caller really wants to put the doubles into whatever types + the array holds! Caveat emptor. Second, it assumes that if the size of + source (\e src) array is different than the destination (\e dest) the + caller has made a mistake. In that case it will throw an Error object. + + After setting the values, this method sets the \c read_p property for + \e dest. Setting \e read_p tells the serialization methods in libdap + that this variable already holds data values and, given that, the + serialization code will not try to read the values. + + @param dest An Array. The values are written to this array, reusing + its storage. Existing values are lost. + @param src The source data. + @param src_len The number of elements in the \e src array. + @exception Error Thrown if \e dest is not a numeric-type array (Byte, ..., + Float64) or if the number of elements in \e src does not match the number + is \e dest. */ +void set_array_using_double(Array * dest, double *src, int src_len) +{ + // Simple types are Byte, ..., Float64, String and Url. + if ((dest->type() == dods_array_c && !dest->var()->is_simple_type()) + || dest->var()->type() == dods_str_c + || dest->var()->type() == dods_url_c) + throw InternalErr(__FILE__, __LINE__, + "The function requires a DAP numeric-type array argument."); + + // Test sizes. Note that Array::length() takes any constraint into account + // when it returns the length. Even if this was removed, the 'helper' + // function this uses calls Vector::val2buf() which uses Vector::width() + // which in turn uses length(). + if (dest->length() != src_len) + throw InternalErr(__FILE__, __LINE__, + "The source and destination array sizes don't match (" + + long_to_string(src_len) + " versus " + + long_to_string(dest->length()) + ")."); + + // The types of arguments that the CE Parser will build for numeric + // constants are limited to Uint32, Int32 and Float64. See ce_expr.y. + // Expanded to work for any numeric type so it can be used for more than + // just arguments. + switch (dest->var()->type()) { + case dods_byte_c: + set_array_using_double_helper(dest, src, src_len); + break; + case dods_uint16_c: + set_array_using_double_helper(dest, src, src_len); + break; + case dods_int16_c: + set_array_using_double_helper(dest, src, src_len); + break; + case dods_uint32_c: + set_array_using_double_helper(dest, src, src_len); + break; + case dods_int32_c: + set_array_using_double_helper(dest, src, src_len); + break; + case dods_float32_c: + set_array_using_double_helper(dest, src, src_len); + break; + case dods_float64_c: + set_array_using_double_helper(dest, src, src_len); + break; + default: + throw InternalErr(__FILE__, __LINE__, + "The argument list built by the CE parser contained an unsupported numeric type."); + } + + // Set the read_p property. + dest->set_read_p(true); +} + +template static double *extract_double_array_helper(Array * a) +{ + int length = a->length(); + // Could improve this using vector. jhrg + T *b = new T[length]; + a->value(b); + + double *dest = new double[length]; + for (int i = 0; i < length; ++i) + dest[i] = (double) b[i]; + delete[]b; + + return dest; +} + +/** Given a pointer to an Array which holds a numeric type, extract the + values and return in an array of doubles. This function allocates the + array using 'new double[n]' so delete[] MUST be used when you are done + the data. */ +double *extract_double_array(Array * a) +{ + // Simple types are Byte, ..., Float64, String and Url. + if ((a->type() == dods_array_c && !a->var()->is_simple_type()) + || a->var()->type() == dods_str_c || a->var()->type() == dods_url_c) + throw Error(malformed_expr, + "The function requires a DAP numeric-type array argument."); + + if (!a->read_p()) + throw InternalErr(__FILE__, __LINE__, + string("The Array '") + a->name() + + "'does not contain values."); + + // The types of arguments that the CE Parser will build for numeric + // constants are limited to Uint32, Int32 and Float64. See ce_expr.y. + // Expanded to work for any numeric type so it can be used for more than + // just arguments. + switch (a->var()->type()) { + case dods_byte_c: + return extract_double_array_helper(a); + case dods_uint16_c: + return extract_double_array_helper(a); + case dods_int16_c: + return extract_double_array_helper(a); + case dods_uint32_c: + return extract_double_array_helper(a); + case dods_int32_c: + return extract_double_array_helper(a); + case dods_float32_c: + return extract_double_array_helper(a); + case dods_float64_c: + return extract_double_array_helper(a); + default: + throw InternalErr(__FILE__, __LINE__, + "The argument list built by the CE parser contained an unsupported numeric type."); + } +} + +/** Given a BaseType pointer, extract the numeric value it contains and return + it in a C++ double. + + @param arg The BaseType pointer + @return A C++ double + @exception Error thrown if the referenced BaseType object does not contain + a DAP numeric value. */ +double extract_double_value(BaseType * arg) +{ + // Simple types are Byte, ..., Float64, String and Url. + if (!arg->is_simple_type() || arg->type() == dods_str_c || arg->type() + == dods_url_c) + throw Error(malformed_expr, + "The function requires a DAP numeric-type argument."); + + if (!arg->read_p()) + throw InternalErr(__FILE__, __LINE__, + "The CE Evaluator built an argument list where some constants held no values."); + + // The types of arguments that the CE Parser will build for numeric + // constants are limited to Uint32, Int32 and Float64. See ce_expr.y. + // Expanded to work for any numeric type so it can be used for more than + // just arguments. + switch (arg->type()) { + case dods_byte_c: + return (double)(static_cast(arg)->value()); + case dods_uint16_c: + return (double)(static_cast(arg)->value()); + case dods_int16_c: + return (double)(static_cast(arg)->value()); + case dods_uint32_c: + return (double)(static_cast(arg)->value()); + case dods_int32_c: + return (double)(static_cast(arg)->value()); + case dods_float32_c: + return (double)(static_cast(arg)->value()); + case dods_float64_c: + return static_cast(arg)->value(); + default: + throw InternalErr(__FILE__, __LINE__, + "The argument list built by the CE parser contained an unsupported numeric type."); + } +} + // Remove spaces from the start of a URL and from the start of any constraint // expression it contains. 4/7/98 jhrg @@ -88,8 +309,6 @@ This function assumes that there are no holes in both the URL and the CE. It will remove \e leading space, but not other spaces. - @todo Is this still needed? This function may predate the switch from - libwww to libcurl and the latter may not need to have spaces removed. @param name The URL to process @return Returns a new string object that contains the pruned URL. */ string @@ -133,21 +352,9 @@ // sort the array of names sort(names.begin(), names.end()); -#ifdef DODS_DEBUG2 - cout << "unique:" << endl; - for (int ii = 0; ii < nelem; ++ii) - cout << "NAMES[" << ii << "]=" << names[ii] << endl; -#endif - // sort the array of names sort(names.begin(), names.end()); -#ifdef DODS_DEBUG2 - cout << "unique:" << endl; - for (int ii = 0; ii < nelem; ++ii) - cout << "NAMES[" << ii << "]=" << names[ii] << endl; -#endif - // look for any instance of consecutive names that are == for (int j = 1; j < nelem; ++j) { if (names[j-1] == names[j]) { @@ -170,9 +377,12 @@ return LIBDAP_ROOT; } -extern "C" - const char * - libdap_version() +/** Return the version string for this package. + @note This function has C linkage so that it can be found using autoconf + tests. + @return The version string. */ +extern "C" const char * +libdap_version() { return PACKAGE_VERSION; } @@ -184,227 +394,350 @@ return PACKAGE_NAME; } -// Since Server4 can get compressed responses using Tomcat, bail on this -// software (which complicates building under Win32). It can be turned on -// for use with Server3 in configure.ac. - -#if COMPRESSION_FOR_SERVER3 - -// Return true if the program deflate exists and is executable by user, group -// and world. If this returns false the caller should assume that server -// filter programs won't be able to find the deflate program and thus won't -// be able to compress the return document. -// NB: this works because this function uses the same rules as compressor() -// (which follows) to look for deflate. 2/11/98 jhrg - -bool -deflate_exists() +/** + * Use the system time() function to get the current time. Return a string, + * removing the trailing newline that time() includes in its response. + * @return A C++ string with the current system time as formatted by time() + */ +string +systime() { - DBG(cerr << "Entering deflate_exists..."); - - int status = false; - struct stat buf; + time_t TimBin; -#ifdef WIN32 - string deflate = (string)libdap_root() + "\\bin\\deflate"; -#else - string deflate = (string)libdap_root() + "/sbin/deflate"; + if (time(&TimBin) == (time_t) - 1) + return string("time() error"); + else { +#if 0 + string TimStr = ctime(&TimBin); #endif + char *ctime_value = ctime(&TimBin); + if (ctime_value) { + string TimStr = ctime_value; + return TimStr.substr(0, TimStr.size() - 2); // remove the \n + } + else + return "Unknown"; + } +} - // Check that the file exists... - // First look for deflate using DODS_ROOT (compile-time constant subsumed - // by an environment variable) and if that fails in the CWD which finds - // the program when it is in the same directory as the dispatch script - // and other server components. 2/11/98 jhrg - status = (stat(deflate.c_str(), &buf) == 0) -#ifdef WIN32 - || (stat(".\\deflate", &buf) == 0); -#else - || (stat("./deflate", &buf) == 0); -#endif +/** + * Downcase the source string. This function modifies its argument. + * @param The string to modify + */ +void +downcase(string &s) +{ + for (unsigned int i = 0; i < s.length(); i++) + s[i] = tolower(s[i]); +} - // and that it can be executed. -#ifdef WIN32 - status &= (buf.st_mode & _S_IEXEC); -#else - status &= buf.st_mode & (S_IXUSR | S_IXGRP | S_IXOTH); -#endif - DBG(cerr << " returning " << (status ? "true." : "false.") << endl); - return (status != 0); +/** + * Is the string surrounded by double quotes? + * @param s The source string + * @reurn True if the string is quoted, false otherwise. + */ +bool +is_quoted(const string &s) +{ + return (!s.empty() && s[0] == '\"' && s[s.length()-1] == '\"'); } -FILE * -compressor(FILE *output, int &childpid) +/** + * Return a new string that is not quoted. This will return a new string + * regardless of whether the source string is actualy quoted. + * @param s The source string + * @return A new string without quotes + */ +string +remove_quotes(const string &s) { -#ifdef WIN32 - // There is no such thing as a "fork" under win32. This makes it so that - // we have to juggle handles more aggressively. This code hasn't been - // tested and shown to work as of 07/2000. - int pid, data[2]; - int hStdIn, hStdOut; - - if (_pipe(data, 512, O_BINARY | O_NOINHERIT) < 0) { - cerr << "Could not create IPC channel for compressor process" - << endl; - return NULL; - } + if (is_quoted(s)) + return s.substr(1, s.length() - 2); + else + return s; +} +/** Get the Type enumeration value which matches the given name. */ +Type get_type(const char *name) +{ + if (strcmp(name, "Byte") == 0) + return dods_byte_c; - // This sets up for the child process, but it has to be reversed for the - // parent after the spawn takes place. - - // Store stdin, stdout so we have something to restore to - hStdIn = _dup(_fileno(stdin)); - hStdOut = _dup(_fileno(stdout)); - - // Child is to read from read end of pipe - if (_dup2(data[0], _fileno(stdin)) != 0) { - cerr << "dup of child stdin failed" << endl; - return NULL; - } - // Child is to write its's stdout to file - if (_dup2(_fileno(output), _fileno(stdout)) != 0) { - cerr << "dup of child stdout failed" << endl; - return NULL; - } - - // Spawn child process - string deflate = "deflate.exe"; - if ((pid = _spawnlp(_P_NOWAIT, deflate.c_str(), deflate.c_str(), - "-c", "5", "-s", NULL)) < 0) { - cerr << "Could not spawn to create compressor process" << endl; - return NULL; - } - - // Restore stdin, stdout for parent and close duplicate copies - if (_dup2(hStdIn, _fileno(stdin)) != 0) { - cerr << "dup of stdin failed" << endl; - return NULL; - } - if (_dup2(hStdOut, _fileno(stdout)) != 0) { - cerr << "dup of stdout failed" << endl; - return NULL; - } - close(hStdIn); - close(hStdOut); - - // Tell the parent that it reads from the opposite end of the - // place where the child writes. - close(data[0]); - FILE *input = fdopen(data[1], "w"); - setbuf(input, 0); - childpid = pid; - return input; + if (strcmp(name, "Int8") == 0) + return dods_int8_c; -#else - FILE *ret_file = NULL ; + if (strcmp(name, "UInt8") == 0) + return dods_uint8_c; - int pid, data[2]; + if (strcmp(name, "Int16") == 0) + return dods_int16_c; - if (pipe(data) < 0) { - cerr << "Could not create IPC channel for compressor process" - << endl; - return NULL; - } + if (strcmp(name, "UInt16") == 0) + return dods_uint16_c; - if ((pid = fork()) < 0) { - cerr << "Could not fork to create compressor process" << endl; - return NULL; - } + if (strcmp(name, "Int32") == 0) + return dods_int32_c; - // The parent process closes the write end of the Pipe, and creates a - // FILE * using fdopen(). The FILE * is used by the calling program to - // access the read end of the Pipe. + if (strcmp(name, "UInt32") == 0) + return dods_uint32_c; - if (pid > 0) { // Parent, pid is that of the child - close(data[0]); - ret_file = fdopen(data[1], "w"); - setbuf(ret_file, 0); - childpid = pid; - } - else { // Child - close(data[1]); - dup2(data[0], 0); // Read from the pipe... - dup2(fileno(output), 1); // Write to the FILE *output. + if (strcmp(name, "Int64") == 0) + return dods_int64_c; - DBG(cerr << "Opening compression stream." << endl); + if (strcmp(name, "UInt64") == 0) + return dods_uint64_c; - // First try to run deflate using DODS_ROOT (the value read from the - // DODS_ROOT environment variable takes precedence over the value set - // at build time. If that fails, try the CWD. - string deflate = (string)libdap_root() + "/sbin/deflate"; - (void) execl(deflate.c_str(), "deflate", "-c", "5", "-s", NULL); - (void) execl("./deflate", "deflate", "-c", "5", "-s", NULL); - cerr << "Warning: Could not start compressor!" << endl; - cerr << "defalte should be in DODS_ROOT/etc or in the CWD!" - << endl; - _exit(127); // Only here if an error occurred. - } + if (strcmp(name, "Float32") == 0) + return dods_float32_c; - return ret_file ; -#endif -} + if (strcmp(name, "Float64") == 0) + return dods_float64_c; + + if (strcmp(name, "String") == 0) + return dods_str_c; + + if (strcmp(name, "URL") == 0) + return dods_url4_c; -#endif // COMPRESSION_FOR_SERVER3 + if (strcmp(name, "Url") == 0) + return dods_url_c; -// This function returns a pointer to the system time formated for an httpd -// log file. + if (strcmp(name, "Array") == 0) + return dods_array_c; + if (strcmp(name, "Structure") == 0) + return dods_structure_c; + + if (strcmp(name, "Sequence") == 0) + return dods_sequence_c; + + if (strcmp(name, "Grid") == 0) + return dods_grid_c; + + return dods_null_c; +} + +/** @brief Returns the type of the class instance as a string. */ string -systime() +type_name(Type t) { - time_t TimBin; - - if (time(&TimBin) == (time_t) - 1) - return string("time() error"); - else { - string TimStr = ctime(&TimBin); - return TimStr.substr(0, TimStr.size() - 2); // remove the \n + switch (t) { + case dods_null_c: + return string("Null"); + case dods_byte_c: + return string("Byte"); + case dods_int16_c: + return string("Int16"); + case dods_uint16_c: + return string("UInt16"); + case dods_int32_c: + return string("Int32"); + case dods_uint32_c: + return string("UInt32"); + case dods_float32_c: + return string("Float32"); + case dods_float64_c: + return string("Float64"); + case dods_str_c: + return string("String"); + case dods_url_c: + return string("Url"); + case dods_array_c: + return string("Array"); + case dods_structure_c: + return string("Structure"); + case dods_sequence_c: + return string("Sequence"); + case dods_grid_c: + return string("Grid"); + + case dods_int8_c: + return string("Int8"); + case dods_uint8_c: + return string("UInt8"); + case dods_int64_c: + return string("Int64"); + case dods_uint64_c: + return string("UInt64"); + case dods_url4_c: + return string("URL"); + case dods_group_c: + return string("Group"); + case dods_enum_c: + return string("Enum"); + + default: + throw InternalErr(__FILE__, __LINE__, "Unknown type."); } } -void -downcase(string &s) +/** @brief Returns true if the instance is a numeric, string or URL + type variable. + @return True if the instance is a scalar numeric, String or URL variable, + False otherwise. Arrays (even of simple types) return False. + @see is_vector_type() */ +bool +is_simple_type(Type t) { - for (unsigned int i = 0; i < s.length(); i++) - s[i] = tolower(s[i]); + switch (t) { + + case dods_byte_c: + + case dods_int8_c: + case dods_uint8_c: + + case dods_int16_c: + case dods_uint16_c: + case dods_int32_c: + case dods_uint32_c: + + case dods_int64_c: + case dods_uint64_c: + + case dods_float32_c: + case dods_float64_c: + case dods_str_c: + case dods_url_c: + + case dods_url4_c: + case dods_enum_c: + return true; + + case dods_null_c: + case dods_array_c: + case dods_structure_c: + case dods_sequence_c: + case dods_grid_c: + case dods_group_c: + return false; + } + + return false; } +/** @brief Returns true if the instance is a vector (i.e., array) type + variable. + @return True if the instance is an Array, False otherwise. */ bool -is_quoted(const string &s) +is_vector_type(Type t) { - return (!s.empty() && s[0] == '\"' && s[s.length()-1] == '\"'); + switch (t) { + case dods_null_c: + case dods_byte_c: + + case dods_int8_c: + case dods_uint8_c: + + case dods_int16_c: + case dods_uint16_c: + + case dods_int32_c: + case dods_uint32_c: + + case dods_int64_c: + case dods_uint64_c: + + case dods_float32_c: + case dods_float64_c: + + case dods_str_c: + case dods_url_c: + + case dods_url4_c: + case dods_enum_c: + return false; + + case dods_array_c: + return true; + + case dods_structure_c: + case dods_sequence_c: + case dods_grid_c: + case dods_group_c: + return false; + } + + return false; } -string -remove_quotes(const string &s) +/** @brief Returns true if the instance is a constructor (i.e., Structure, + Sequence or Grid) type variable. + @return True if the instance is a Structure, Sequence or Grid, False + otherwise. */ +bool +is_constructor_type(Type t) { - if (is_quoted(s)) - return s.substr(1, s.length() - 2); - else - return s; -} + switch (t) { + case dods_null_c: + case dods_byte_c: -#ifdef WIN32 -// Sometimes need to buffer within an iostream under win32 when -// we want the output to go to a FILE *. This is because -// it's not possible to associate an ofstream with a FILE * -// under the Standard ANSI C++ Library spec. Unix systems -// don't follow the spec in this regard. -void flush_stream(iostream ios, FILE *out) -{ - int nbytes; - char buffer[512]; - - ios.get(buffer, 512, NULL); - while ((nbytes = ios.gcount()) > 0) { - fwrite(buffer, 1, nbytes, out); - ios.get(buffer, 512, NULL); + case dods_int8_c: + case dods_uint8_c: + + case dods_int16_c: + case dods_uint16_c: + case dods_int32_c: + case dods_uint32_c: + + case dods_int64_c: + case dods_uint64_c: + + case dods_float32_c: + case dods_float64_c: + case dods_str_c: + case dods_url_c: + + case dods_url4_c: + case dods_enum_c: + + case dods_array_c: + return false; + + case dods_structure_c: + case dods_sequence_c: + case dods_grid_c: + case dods_group_c: + return true; + } + + return false; +} + +/** + * Is this an integer type? + * @return True if the type holds an integer value, false otherwise. + */ +bool is_integer_type(Type t) +{ + switch (t) { + case dods_byte_c: + case dods_int8_c: + case dods_uint8_c: + case dods_int16_c: + case dods_uint16_c: + case dods_int32_c: + case dods_uint32_c: + case dods_int64_c: + case dods_uint64_c: + return true; + default: + return false; } +} + +/** + * Does the directory exist? + * + * @param dir The pathname to test. + * @return True if the directory exists, false otherwise + */ +bool +dir_exists(const string &dir) +{ + struct stat buf; - return; + return (stat(dir.c_str(), &buf) == 0) && (buf.st_mode & S_IFDIR); } -#endif // Jose Garcia void @@ -463,15 +796,6 @@ return s; } -// Get the version number of the core software. Defining this means that -// clients of the DAP don't have to rely on config.h for the version -// number. -string -dap_version() -{ - return (string)"OPeNDAP DAP/" + libdap_version() + ": compiled on " + __DATE__ + ":" + __TIME__ ; -} - // Given a pathname, return the file at the end of the path. This is used // when reporting errors (maybe other times, too) to keep the server from // revealing too much about its organization when sending error responses @@ -488,6 +812,14 @@ }; #endif +/** Get the filename part from a path. This function can be used to return a + string that has the directory components stripped from a path. This is + useful when building error message strings. + + If WIN32 is defined, use '\' as the path separator, otherwise use '/' as + the path separator. + + @return A string containing only the filename given a path. */ string path_to_filename(string path) { @@ -496,19 +828,142 @@ return (pos == string::npos) ? path : path.substr(++pos); } -/** Read stuff from a file and dump it into a string. This assumes the file - holds character data only. Intended for testing... - @param fp Read from this file - @return Returns a string which holds the character data. */ -string -file_to_string(FILE *fp) -{ - rewind(fp); - ostringstream oss; - char c; - while (fread(&c, 1, 1, fp)) - oss << c; - return oss.str(); +#define CHECK_BIT( tab, bit ) ( tab[ (bit)/8 ] & (1<<( (bit)%8 )) ) +#define BITLISTSIZE 16 /* bytes used for [chars] in compiled expr */ + +/* + * globchars() - build a bitlist to check for character group match + */ + +static void globchars(const char *s, const char *e, char *b) { + int neg = 0; + + memset(b, '\0', BITLISTSIZE); + + if (*s == '^') + neg++, s++; + + while (s < e) { + int c; + + if (s + 2 < e && s[1] == '-') { + for (c = s[0]; c <= s[2]; c++) + b[c / 8] |= (1 << (c % 8)); + s += 3; + } + else { + c = *s++; + b[c / 8] |= (1 << (c % 8)); + } + } + + if (neg) { + int i; + for (i = 0; i < BITLISTSIZE; i++) + b[i] ^= 0377; + } + + /* Don't include \0 in either $[chars] or $[^chars] */ + + b[0] &= 0376; +} + +/** + * glob: match a string against a simple pattern + * + * Understands the following patterns: + * + * * any number of characters + * ? any single character + * [a-z] any single character in the range a-z + * [^a-z] any single character not in the range a-z + * \x match x + * + * @param c The pattern + * @param s The string + * @return 0 on success, -1 if the pattern is exhausted but there are + * characters remaining in the string and 1 if the pattern does not match + */ +int +glob(const char *c, const char *s) +{ + if (!c || !s) + return 1; + + char bitlist[BITLISTSIZE]; + int i = 0; + for (;;) { + ++i; + switch (*c++) { + case '\0': + return *s ? -1 : 0; + + case '?': + if (!*s++) + return i/*1*/; + break; + + case '[': { + /* scan for matching ] */ + + const char *here = c; + do { + if (!*c++) + return i/*1*/; + } while (here == c || *c != ']'); + c++; + + /* build character class bitlist */ + + globchars(here, c, bitlist); + + if (!CHECK_BIT( bitlist, *(unsigned char *)s )) + return i/*1*/; + s++; + break; + } + + case '*': { + const char *here = s; + + while (*s) + s++; + + /* Try to match the rest of the pattern in a recursive */ + /* call. If the match fails we'll back up chars, retrying. */ + + while (s != here) { + int r; + + /* A fast path for the last token in a pattern */ + + r = *c ? glob(c, s) : *s ? -1 : 0; + + if (!r) + return 0; + else if (r < 0) + return i/*1*/; + + --s; + } + break; + } + + case '\\': + /* Force literal match of next char. */ + + if (!*c || *s++ != *c++) + return i/*1*/; + break; + + default: + if (*s++ != c[-1]) + return i/*1*/; + break; + } + } + + return 1; // Should never get here; this quiets gcc's warning } /** @name Security functions */ @@ -525,14 +980,14 @@ return (sz > 0 && nelem < UINT_MAX / sz); } -/** @brief Does the string name a potentailly valid pathname? - Test the given pathname to verfiy that it is a valid name. We define this +/** @brief Does the string name a potentially valid pathname? + Test the given pathname to verify that it is a valid name. We define this as: Contains only printable characters; and Is less then 256 characters. If \e strict is true, test that the pathname consists of only letters, digits, and underscore, dash and dot characters instead of the more general case where a pathname can be composed of any printable characters. - @note Using this function does not guarentee that the path is valid, only + @note Using this function does not guarantee that the path is valid, only that the path \e could be valid. The intent is foil attacks where an exploit is encoded in a string then passed to a library function. This code does not address whether the pathname references a valid resource. @@ -563,5 +1018,15 @@ //@} +/** + * Get the version of the DAP library. + * @deprecated + */ +string +dap_version() +{ + return (string)"OPeNDAP DAP/" + libdap_version() + ": compiled on " + __DATE__ + ":" + __TIME__ ; +} + } // namespace libdap diff -Nru libdap-3.11.1/util.h libdap-3.12.0/util.h --- libdap-3.11.1/util.h 2011-04-29 13:19:43.000000000 +0000 +++ libdap-3.12.0/util.h 2013-10-17 21:27:40.000000000 +0000 @@ -19,7 +19,7 @@ // // You should have received a copy of the GNU Lesser General Public // License along with this library; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA // // You can contact OPeNDAP, Inc. at PO Box 112, Saunderstown, RI. 02874-0112. @@ -37,6 +37,7 @@ #define _util_h 1 #include +#include #include #ifndef _basetype_h @@ -48,21 +49,28 @@ namespace libdap { +class Array; + +/** Is \e lhs equal to \e rhs? Use epsilon to determine equality. */ +inline bool double_eq(double lhs, double rhs, double epsilon = 1.0e-5) +{ + return fabs(lhs - rhs) < epsilon; +} + +string extract_string_argument(BaseType *arg) ; +double extract_double_value(BaseType *arg) ; +double *extract_double_array(Array *a) ; +void set_array_using_double(Array *dest, double *src, int src_len) ; + string prune_spaces(const string &); -bool unique_names(vector l, const string &var, const string &type, - string &msg); -FILE *text_to_temp(string text); +bool unique_names(vector l, const string &var, const string &type, string &msg); string systime(); -FILE *compressor(FILE *output, int &childpid); -bool deflate_exists(); +//FILE *compressor(FILE *output, int &childpid); +//bool deflate_exists(); const char *libdap_root(); -/** Return the version string for this package. - @note This function has C linkage so that it can be found using autoconf - tests. - @return The version string. */ extern "C" const char *libdap_version(); extern "C" const char *libdap_name(); -const char *dods_progress(); + #ifdef WIN32 void flush_stream(iostream ios, FILE *out); #endif @@ -71,6 +79,15 @@ bool is_quoted(const string &s); string remove_quotes(const string &s); +Type get_type(const char *name); +string type_name(Type t); +bool is_simple_type(Type t); +bool is_vector_type(Type t); +bool is_constructor_type(Type t); +bool is_integer_type(Type t); + +bool dir_exists(const string &dir); + // Jose Garcia /** @name Integer to string conversion functions Fast, safe conversions from long to a character representation which gets @@ -124,25 +141,33 @@ string double_to_string(const double &num); //@} -/** Get the version of the DAP library. */ +string path_to_filename(string path); +int glob( const char *c, const char *s ); +time_t parse_time(const char * str, bool expand); +bool size_ok(unsigned int sz, unsigned int nelem); +bool pathname_ok(const string &path, bool strict = true); string dap_version(); -/** Get the filename part from a path. This function can be used to return a - string that has the directory components stripped from a path. This is - useful when building error message strings. - - If WIN32 is defined, use '\' as the path separator, otherwise use '/' as - the path separator. - - @return A string containing only the filename given a path. */ -string path_to_filename(string path); +#if COMPRESSION_FOR_SERVER3 +FILE *compressor(FILE *output, int &childpid); +bool deflate_exists(); +#endif +#if 0 +FILE *text_to_temp(string text); +#endif +#if 0 +int wmatch(const char *pat, const char *s); +#endif +#if 0 string file_to_string(FILE *fp); -time_t parse_time(const char * str, bool expand); +int wildcmp(const char *wild, const char *string); +#endif +#if 0 +const char *dods_progress(); +#endif -bool size_ok(unsigned int sz, unsigned int nelem); -bool pathname_ok(const string &path, bool strict = true); } // namespace libdap diff -Nru libdap-3.11.1/util_mit.cc libdap-3.12.0/util_mit.cc --- libdap-3.11.1/util_mit.cc 2011-04-29 13:19:43.000000000 +0000 +++ libdap-3.12.0/util_mit.cc 2013-10-17 21:27:40.000000000 +0000 @@ -18,7 +18,7 @@ // // You should have received a copy of the GNU Lesser General Public // License along with this library; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA // // You can contact OPeNDAP, Inc. at PO Box 112, Saunderstown, RI. 02874-0112 @@ -29,10 +29,6 @@ #include "config.h" -static char rcsid[] not_used = - {"$Id: util_mit.cc 24370 2011-03-28 16:21:32Z jimg $" - }; - #include #include #include @@ -76,7 +72,7 @@ The problem here is that toupper(x) is not defined officially unless isupper(x) is. These macros are CERTAINLY needed on #if defined(pyr) || - define(mips) or BDSI platforms. For safefy, we make them mandatory. + define(mips) or BDSI platforms. For safety, we make them mandatory. */ #ifndef TOLOWER @@ -98,6 +94,7 @@ if (diff) return diff; } /*NOTREACHED*/ + return -1; // silence gcc } static int @@ -327,6 +324,8 @@ loctime.tm_sec); #else struct tm *loctime = localtime(calendar); + if (!loctime) + return ""; snprintf(buf, 40, "%s, %02d %s %04d %02d:%02d:%02d", wkdays[loctime->tm_wday], loctime->tm_mday, @@ -351,6 +350,8 @@ gmt.tm_sec); #else struct tm *gmt = gmtime(calendar); + if (!gmt) + return ""; snprintf(buf, 40, "%s, %02d %s %04d %02d:%02d:%02d GMT", wkdays[gmt->tm_wday], gmt->tm_mday, diff -Nru libdap-3.11.1/util_mit.h libdap-3.12.0/util_mit.h --- libdap-3.11.1/util_mit.h 2011-04-29 13:19:43.000000000 +0000 +++ libdap-3.12.0/util_mit.h 2013-10-17 21:27:40.000000000 +0000 @@ -19,7 +19,7 @@ // // You should have received a copy of the GNU Lesser General Public // License along with this library; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA // // You can contact OPeNDAP, Inc. at PO Box 112, Saunderstown, RI. 02874-0112. diff -Nru libdap-3.11.1/xdr-datatypes.h libdap-3.12.0/xdr-datatypes.h --- libdap-3.11.1/xdr-datatypes.h 2011-04-29 13:44:57.000000000 +0000 +++ libdap-3.12.0/xdr-datatypes.h 2013-10-17 21:27:40.000000000 +0000 @@ -20,10 +20,10 @@ #define XDR_INT32 xdr_int32_t -#define XDR_UINT32 xdr_u_int32_t +#define XDR_UINT32 xdr_uint32_t #define XDR_INT16 xdr_int16_t -#define XDR_UINT16 xdr_u_int16_t +#define XDR_UINT16 xdr_uint16_t #define XDR_FLOAT64 xdr_double #define XDR_FLOAT32 xdr_float