Fix parsing of floating point numbers
[com/gs-lite.git] / src / ftacmp / translate_fta.cc
index b6855ff..2176d2f 100644 (file)
@@ -55,6 +55,8 @@ Copyright 2014 AT&T Intellectual Property
 #include"xml_t.h"
 #include"field_list.h"
 
+#include "gsconfig.h"
+
 extern int xmlParserparse(void);
 extern FILE *xmlParserin;
 extern int xmlParserdebug;
@@ -1351,6 +1353,7 @@ fprintf(stderr,"Parsing file %s\n",qpathname.c_str());
        }
        if(dangling_ospecs!=""){
                fprintf(stderr,"WARNING, the following entries in output_spec.cfg don't have a matching query: %s\n",dangling_ospecs.c_str());
+               exit(1);
        }
 
        string dangling_par = "";
@@ -1907,7 +1910,11 @@ for(q=0;q<hfta_sets.size();++q){
                string lmach = hostname;
                if(tvec.size()>0){
                        liface = tvec[0]->get_interface();      // iface queries have been resolved
-                       lmach = tvec[0]->get_machine();
+                       if(tvec[0]->get_machine() != ""){
+                               lmach = tvec[0]->get_machine();
+                       }else{
+                               fprintf(stderr,"WARNING, lfta %s has empty machine name, using %s\n",  split_queries[l]->query_plan[0]->node_name.c_str(), hostname.c_str());
+                       }
                } // else{
                        interface_names.push_back(liface);
                        machine_names.push_back(lmach);
@@ -2311,7 +2318,6 @@ for(i=0;i<hfta_list.size();++i){          // query also has an HFTA component
 //                     if(hfta_namespace == "")
 //                             warning_str += "\tnamespace not found.\n";
 
-// STOPPED HERE
 //     There is a get_tbl_keys method implemented for qp_nodes,
 //     integrate it into steam_query, then call it to find keys,
 //     and annotate feidls with their key-ness.
@@ -3078,19 +3084,34 @@ void generate_makefile(vector<string> &input_file_names, int nfiles,
                vector<string> ift = ifdb->get_iface_vals(ifmachines[ifnm],ifnm, "InterfaceType", erri, err_str);
                for(int ift_i=0;ift_i<ift.size();ift_i++){
                        if(ift[ift_i]=="PROTO"){
+#ifdef PROTO_ENABLED                           
                                use_proto = true;
+#else
+                               fprintf(stderr,"Runtime libraries built without PROTO support. Rebuild with PROTO_ENABLED defined in gsoptions.h\n");
+                               exit(0);
+#endif
                        }
                }
                ift = ifdb->get_iface_vals(ifmachines[ifnm],ifnm, "BSA", erri, err_str);
                for(int ift_i=0;ift_i<ift.size();ift_i++){
                        if(ift[ift_i] == "TRUE" || ift[ift_i] == "True" || ift[ift_i] == "true"){       
+#ifdef BSA_ENABLED                             
                                use_bsa = true;
+#else
+                               fprintf(stderr,"Runtime libraries built without BSA support. Rebuild with BSA_ENABLED defined in gsoptions.h\n");
+                               exit(0);
+#endif                                 
                        }
                }
                ift = ifdb->get_iface_vals(ifmachines[ifnm],ifnm, "KAFKA", erri, err_str);
                for(int ift_i=0;ift_i<ift.size();ift_i++){
                        if(ift[ift_i] == "TRUE" || ift[ift_i] == "True" || ift[ift_i] == "true"){       
+#ifdef KAFKA_ENABLED                           
                                use_kafka = true;
+#else
+                               fprintf(stderr,"Runtime libraries built without KAFKA support. Rebuild with KAFKA_ENABLED defined in gsoptions.h\n");
+                               exit(0);
+#endif 
                        }
                }
        }
@@ -3120,12 +3141,16 @@ void generate_makefile(vector<string> &input_file_names, int nfiles,
                fprintf(outfl," -last ");
        if(use_pads)
                fprintf(outfl, " -ldll -ldl ");
-       if(use_proto)
-               fprintf(outfl, " -L/usr/local/lib/ -lprotobuf-c ");
-       if(use_bsa)
-               fprintf(outfl, " -lbsa_stream ");
-       if(use_kafka)
-               fprintf(outfl, " -lrdkafka ");
+
+#ifdef PROTO_ENABLED   
+       fprintf(outfl, " -L/usr/local/lib/ -lprotobuf-c ");
+#endif
+#ifdef BSA_ENABLED     
+       fprintf(outfl, " -lbsa_stream ");
+#endif
+#ifdef KAFKA_ENABLED   
+       fprintf(outfl, " -lrdkafka ");
+#endif
        fprintf(outfl," -lgscpaux");
 #ifdef GCOV
        fprintf(outfl," -fprofile-arcs");