tango-8.1.2c+dfsg.orig/0000755000175000017500000000000012205375305013575 5ustar piccapiccatango-8.1.2c+dfsg.orig/utils/0000755000175000017500000000000012205375306014736 5ustar piccapiccatango-8.1.2c+dfsg.orig/utils/tango_admin/0000755000175000017500000000000012205375306017216 5ustar piccapiccatango-8.1.2c+dfsg.orig/utils/tango_admin/tango_admin.cpp0000644000175000017500000007167012205375172022216 0ustar piccapiccastatic const char *RcsId = "$Id: tango_admin.cpp 22469 2013-04-18 11:10:26Z taurel $"; //+============================================================================ // // file : tango_admin.cpp // // description : C++ source code for the tango_admin utility // This utility is a Tango database command line interface // Obviously, not all the database features are interfaced // by this tool. Only the features needed for the Debian // packaging have been implemented. This means: // - ping the database server // - check if a device is defined in DB // - check if a server is defined in DB // - create a server in DB // - delete a server from the DB // - create a property in DB // - delete a property from DB // // project : TANGO // // author(s) : E.Taurel // // Copyright (C) : 2004,2005,2006,2007,2008,2009,2010 // European Synchrotron Radiation Facility // BP 220, Grenoble 38043 // FRANCE // // This file is part of Tango. // // Tango 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. // // Tango 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 Tango. If not, see . // // $Revision: 22469 $ // //-============================================================================ #if HAVE_CONFIG_H #include #endif #include #include #include #include #include #include #include #include using namespace std; int ping_database(int); int check_device(char *); int add_server(char *,char *,char *); void list2vect(string &,vector &); int check_server(char *); int delete_server(char *,bool); int add_property(char *,char *,char *); int delete_property(char *,char *); int ping_network(int,bool); int check_net(bool); int tac_enabled(void); int ping_device(char *,int); int check_dev(char *); int main(int argc,char *argv[]) { AnyOption *opt = new AnyOption(); // // Add usage menu // opt->addUsage("Usage: " ); opt->addUsage(" --help Prints this help " ); opt->addUsage(" --ping-database [max_time (s)] Ping database " ); opt->addUsage(" --check-device Check if the device is defined in DB"); opt->addUsage(" --add-server Add a server in DB" ); opt->addUsage(" --delete-server [--with-properties] Delete a server from DB" ); opt->addUsage(" --check-server Check if a device server is defined in DB"); opt->addUsage(" --add-property Add a device property in DB" ); opt->addUsage(" --delete-property Delete a device property from DB "); opt->addUsage(" --tac-enabled Check if the TAC (Tango Access Control) is enabled"); opt->addUsage(" --ping-device [max_time (s)] Check if the device is running"); opt->addUsage(" --ping-network [max_time (s)] [-v] Ping network "); // // Define the command line options // opt->setFlag("help",'h'); opt->setFlag("ping-database"); opt->setOption("add-server"); opt->setOption("delete-server"); opt->setFlag("with-properties"); opt->setOption("add-property"); opt->setOption("delete-property"); opt->setOption("check-device"); opt->setOption("check-server"); opt->setOption("ping-device"); opt->setFlag("ping-network"); opt->setFlag("tac-enabled"); // // Process cmd line // opt->processCommandArgs( argc, argv ); if (!opt->hasOptions()) { opt->printUsage(); delete opt; return 0; } // // --help option // if (opt->getFlag("help") || opt->getFlag('h')) { opt->printUsage(); delete opt; return 0; } // // --ping-database option // if (opt->getFlag("ping-database") == true) { if (opt->getValue("add-server") != NULL || opt->getValue("delete-server") != NULL || opt->getValue("add-property") != NULL || opt->getValue("delete-property") != NULL || opt->getValue("check-device") != NULL || opt->getValue("check-server") != NULL || opt->getFlag("ping-network") == true || opt->getFlag("tac-enabled") == true || opt->getFlag("with-properties") == true) cout << "Can't mix option --ping-database with other option(s)" << endl; if (argc > 3) { cout << "Bad argument number for option --ping-database" << endl; opt->printUsage(); delete opt; return 0; } int ret; if (argc == 2) ret = ping_database(0); else { int sec = atoi(argv[2]); ret = ping_database(sec); } delete opt; return ret; } // // --check-device option // else if (opt->getValue("check-device") != NULL) { if (opt->getValue("delete-server") != NULL || opt->getValue("add-property") != NULL || opt->getValue("delete-property") != NULL || opt->getValue("add-server") != NULL || opt->getValue("check-server") != NULL || opt->getFlag("ping-network") == true || opt->getFlag("tac-enabled") == true || opt->getFlag("with-properties") == true) cout << "Can't mix option --add-server with other option(s)" << endl; else { if (argc != 3) { cout << "Bad argument number for option --check_device" << endl; opt->printUsage(); delete opt; return 0; } int ret; ret = check_device(opt->getValue("check-device")); delete opt; return ret; } } // // --add-server option // else if (opt->getValue("add-server") != NULL) { if (opt->getValue("delete-server") != NULL || opt->getValue("add-property") != NULL || opt->getValue("delete-property") != NULL || opt->getValue("check-device") != NULL || opt->getValue("check-server") != NULL || opt->getFlag("ping-network") == true || opt->getFlag("tac-enabled") == true || opt->getFlag("with-properties") == true) cout << "Can't mix option --add-server with other option(s)" << endl; else { if (argc != 5) { cout << "Bad argument number for option --add-server" << endl; opt->printUsage(); delete opt; return 0; } int ret; ret = add_server(opt->getValue("add-server"),opt->getArgv(0),opt->getArgv(1)); delete opt; return ret; } } // // --check-server option // else if (opt->getValue("check-server") != NULL) { if (opt->getValue("delete-server") != NULL || opt->getValue("add-property") != NULL || opt->getValue("delete-property") != NULL || opt->getValue("add-server") != NULL || opt->getValue("check-device") != NULL || opt->getFlag("ping-network") == true || opt->getFlag("tac-enabled") == true || opt->getFlag("with-properties") == true) cout << "Can't mix option --check-server with other option(s)" << endl; else { if (argc != 3) { cout << "Bad argument number for option --check_server" << endl; opt->printUsage(); delete opt; return 0; } int ret; ret = check_server(opt->getValue("check-server")); delete opt; return ret; } } // // --delete-server option // else if (opt->getValue("delete-server") != NULL) { if (opt->getValue("add-server") != NULL || opt->getValue("add-property") != NULL || opt->getValue("check-server") != NULL || opt->getValue("check-device") != NULL || opt->getFlag("ping-network") == true || opt->getFlag("tac-enabled") == true || opt->getValue("delete-property") != NULL) cout << "Can't mix option --delete-server with other option(s)" << endl; else { if ((argc < 3 || argc > 4) || (argc == 3 && strcmp(argv[2],"--with-properties") == 0) || (strcmp(opt->getValue("delete-server"),"--with-properties") == 0)) { cout << "Bad option delete-server usage" << endl; opt->printUsage(); delete opt; return 0; } int ret; if (opt->getFlag("with-properties") == true) ret = delete_server(opt->getValue("delete-server"),true); else ret = delete_server(opt->getValue("delete-server"),false); delete opt; return ret; } } // // --add-property option // else if (opt->getValue("add-property") != NULL) { if (opt->getValue("delete-server") != NULL || opt->getValue("delete-property") != NULL || opt->getValue("add-server") != NULL || opt->getValue("check-device") != NULL || opt->getValue("check-server") != NULL || opt->getFlag("with-properties") == true || opt->getFlag("tac-enabled") == true || opt->getFlag("ping-network") == true || opt->getFlag("ping-database") == true) cout << "Can't mix option --add-property with other option(s)" << endl; else { if (argc != 5) { cout << "Bag argument number for option --add-property" << endl; opt->printUsage(); delete opt; return 0; } int ret; ret = add_property(opt->getValue("add-property"),opt->getArgv(0),opt->getArgv(1)); delete opt; return ret; } } // // --delete-property option // else if (opt->getValue("delete-property") != NULL) { if (opt->getValue("delete-server") != NULL || opt->getValue("add-property") != NULL || opt->getValue("add-server") != NULL || opt->getValue("check-device") != NULL || opt->getValue("check-server") != NULL || opt->getFlag("with-properties") == true || opt->getFlag("ping-network") == true || opt->getFlag("tac-enabled") == true || opt->getFlag("ping-database") == true) cout << "Can't mix option --delete-property with other option(s)" << endl; else { if (argc != 4) { cout << "Bag argument number for option --add-property" << endl; opt->printUsage(); delete opt; return 0; } int ret; ret = delete_property(opt->getValue("delete-property"),opt->getArgv(0)); delete opt; return ret; } } // // --ping-network option // if (opt->getFlag("ping-network") == true) { bool verbose = false; if (opt->getValue("add-server") != NULL || opt->getValue("delete-server") != NULL || opt->getValue("add-property") != NULL || opt->getValue("delete-property") != NULL || opt->getValue("check-device") != NULL || opt->getValue("check-server") != NULL || opt->getFlag("ping-database") == true || opt->getFlag("tac-enabled") == true || opt->getFlag("with-properties") == true) cout << "Can't mix option --ping-network with other option(s)" << endl; if (argc > 4) { cout << "Bad argument number for option --ping-network" << endl; opt->printUsage(); delete opt; return 0; } else if (argc == 4) { if (strcmp(argv[3],"-v") != 0) { cout << "Bad argument for option --ping-network" << endl; opt->printUsage(); delete opt; return 0; } else verbose = true; } else if (argc == 3) { if (strcmp(argv[2],"-v") == 0) { verbose = true; } } int ret; if (argc == 2) ret = ping_network(0,verbose); else { int sec = 0; sec = atoi(argv[2]); if ((verbose == false) && (sec == 0)) { cout << "Bad argument for option --ping-network" << endl; opt->printUsage(); delete opt; return 0; } ret = ping_network(sec,verbose); } delete opt; return ret; } // // --tac-enabled option // if (opt->getFlag("tac-enabled") == true) { if (opt->getValue("add-server") != NULL || opt->getValue("delete-server") != NULL || opt->getValue("add-property") != NULL || opt->getValue("delete-property") != NULL || opt->getValue("check-device") != NULL || opt->getValue("check-server") != NULL || opt->getFlag("ping-network") == true || opt->getFlag("with-properties") == true) cout << "Can't mix option --tac-enabled with other option(s)" << endl; if (argc > 2) { cout << "Bad argument number for option --tac-enabled" << endl; opt->printUsage(); delete opt; return 0; } int ret; ret = tac_enabled(); delete opt; return ret; } // // --ping-device option // if (opt->getValue("ping-device") != NULL) { if (opt->getValue("delete-server") != NULL || opt->getValue("add-property") != NULL || opt->getValue("delete-property") != NULL || opt->getValue("add-server") != NULL || opt->getValue("check-server") != NULL || opt->getFlag("ping-network") == true || opt->getFlag("tac-enabled") == true || opt->getFlag("with-properties") == true) cout << "Can't mix option --ping-device with other option(s)" << endl; else { int ret; int sec = 0; if (argc < 3 || argc > 4) { cout << "Bad argument number for option --ping_device" << endl; opt->printUsage(); delete opt; return 0; } else if (argc == 4) { sec = atoi(argv[3]); } ret = ping_device(opt->getValue("ping-device"),sec); delete opt; return ret; } } // // Unknown choice // else { cout << "Wrong usage" << endl; opt->printUsage(); } delete opt; } //+------------------------------------------------------------------------- // // method : ping_database // // description : This function connect to the database and executes // one of its command in order to check the database // connectivity. // // argument : in : - nb_sec : Max time (in sec) to do re-try in case of failure // // The function returns 0 is everything is fine. Otherwise, it returns -1 // //-------------------------------------------------------------------------- int ping_database(int nb_sec) { int ret = 0; setenv("SUPER_TANGO","true",1); int nb_loop; bool infinite = false; if (nb_sec == 0) nb_loop = 1; else if (nb_sec < 0) { infinite = true; nb_loop = 2; } else nb_loop = nb_sec << 1; struct timespec ts; ts.tv_sec = 0; ts.tv_nsec = 500000000; // // First sleep for 1 sec before trying to access the db // This was needed when ported to Natty (Ubuntu 11.04) in the // tango-db startup script. Db process did not start if tango // admin starts pinging db device too early !! // if (nb_loop != 1) { ts.tv_sec = 1; ts.tv_nsec = 0; nanosleep(&ts,NULL); } // // re-try the call every 500 mS // ts.tv_sec = 0; ts.tv_nsec = 500000000; while(nb_loop > 0) { try { Tango::Database db; string db_info; db_info = db.get_info(); ret = 0; nb_loop = 0; } catch (Tango::DevFailed &e) { ret = -1; if (infinite == false) --nb_loop; } if (nb_loop != 0) nanosleep(&ts,NULL); } return ret; } //+------------------------------------------------------------------------- // // method : check_device // // description : This function checks if a device is defined in the DB // // argument : in : - name : The device name // // The function returns 0 is the device is defined. Otherwise, it returns -1 // //-------------------------------------------------------------------------- int check_device(char *name) { int ret = 0; try { Tango::Database db; string d_name(name); Tango::DbDevImportInfo dii = db.import_device(d_name); } catch (Tango::DevFailed &e) { ret = -1; } return ret; } //+------------------------------------------------------------------------- // // method : add_server // // description : This function adds a server definition in the DB // // argument : in : - d_name : The device server name (exec/inst) // - c_name : The class name // - d_list : The device list // // The function returns 0 is everything is fine. Otherwise, it returns -1 // //-------------------------------------------------------------------------- int add_server(char *d_name,char *c_name,char *d_list) { int ret = 0; // // Check ds name syntax // string ds_name(d_name); string::size_type pos; pos = ds_name.find('/'); #ifdef __SUNPRO_CC int n1 = 0; count(ds_name.begin(),ds_name.end(),'/',n1); if ((n1 != 1) || pos == 0 || pos == (ds_name.size() - 1)) { #else if ((count(ds_name.begin(),ds_name.end(),'/') != 1) || pos == 0 || pos == (ds_name.size() - 1)) { #endif cout << "Wrong syntax for ds name" << endl; ret = -1; return ret; } // // Check class name syntax // string class_name(c_name); #ifdef __SUNPRO_CC count(class_name.begin(),class_name.end(),'/',n1); if (n1 != 0) { #else if (count(class_name.begin(),class_name.end(),'/') != 0) { #endif cout << "Wrong syntax for class name" << endl; ret = -1; return ret; } // // Check device list and device syntax // string dev_list(d_list); vector dev_names; list2vect(dev_list,dev_names); for (unsigned int loop = 0;loop < dev_names.size();++loop) { #ifdef __SUNPRO_CC count(dev_names[loop].begin(),dev_names[loop].end(),'/',n1); if (n1 != 2) { #else if (count(dev_names[loop].begin(),dev_names[loop].end(),'/') != 2) { #endif cout << "Wrong syntax for device " << dev_names[loop] << endl; ret = -1; return ret; } string::size_type pos1,pos2; pos1 = dev_names[loop].find('/'); pos2 = dev_names[loop].rfind('/'); if (pos1 == 0 || pos2 == dev_names[loop].length() - 1 || pos2 == pos1 + 1) { cout << "Wrong syntax for device " << dev_names[loop] << endl; ret = -1; return ret; } } // // Create server in DB // Dont forget to add the admin device // setenv("SUPER_TANGO","true",1); try { Tango::Database db; Tango::DbDevInfos ddi; Tango::DbDevInfo tmp_dbi; for (unsigned int loop = 0;loop < dev_names.size();++loop) { tmp_dbi.name = dev_names[loop]; tmp_dbi._class = class_name; tmp_dbi.server = ds_name; ddi.push_back(tmp_dbi); } tmp_dbi.name = "dserver/" + ds_name; tmp_dbi._class = "DServer"; tmp_dbi.server = ds_name; ddi.push_back(tmp_dbi); db.add_server(ds_name,ddi); } catch (Tango::DevFailed &e) { ret = -1; } return ret; } //+------------------------------------------------------------------------- // // method : check_server // // description : This function checks if a device server is defined in the DB // // argument : in : - d_name : The device server name // // The function returns 0 is the device is defined. Otherwise, it returns -1 // //-------------------------------------------------------------------------- int check_server(char *d_name) { int ret = 0; string dev_name = "dserver/"; string ds_name = d_name; dev_name = dev_name + ds_name; ret = check_device((char *)dev_name.c_str()); return ret; } //+------------------------------------------------------------------------- // // method : delete_server // // description : This function deletes a device server from the DB // // argument : in : - d_name : The device server name // - with_res : If true, also delte device properties // // The function returns 0 is everything is fine. Otherwise, it returns -1 // //-------------------------------------------------------------------------- int delete_server(char *d_name,bool with_res) { int ret = 0; string ds_name(d_name); // // Check device server name syntax // string::size_type pos; pos = ds_name.find('/'); #ifdef __SUNPRO_CC int n1 = 0; count(ds_name.begin(),ds_name.end(),'/',n1); if (pos == 0 || pos == ds_name.size() - 1 || n1 != 1) { #else if (pos == 0 || pos == ds_name.size() - 1 || count(ds_name.begin(),ds_name.end(),'/') != 1) { #endif ret = -1; return ret; } ret = check_server(d_name); if (ret != 0) return ret; try { Tango::Database db; // // If we need to remove prop // if (with_res == true) { // // First get the ds class list // Tango::DbDatum db_res = db.get_device_class_list(ds_name); vector dev_list; db_res >> dev_list; // // Get device property name for each device // for (unsigned int loop = 0;loop < dev_list.size();++loop) { vector prop_list; db.get_device_property_list(dev_list[loop],"*",prop_list); // // Delete all device properties // if (prop_list.empty() == false) { Tango::DbData dbd; for (unsigned int ctr = 0;ctr < prop_list.size();++ctr) dbd.push_back(Tango::DbDatum(prop_list[ctr])); db.delete_device_property(dev_list[loop],dbd); } ++loop; } } // // Delete device server from db // db.delete_server(ds_name); } catch (Tango::DevFailed &e) { ret = -1; } return ret; } //+------------------------------------------------------------------------- // // method : add_property // // description : This function adds a device property in the DB // // argument : in : - d_name : The device name // - p_name : The property name // - p_val : The property value // // The function returns 0 is everything is fine. Otherwise, it returns -1 // //-------------------------------------------------------------------------- int add_property(char *d_name,char *p_name,char *p_val) { int ret = 0; // // Check dev name syntax // string dev_name(d_name); string::size_type pos1,pos2; pos1 = dev_name.find('/'); pos2 = dev_name.rfind('/'); #ifdef __SUNPRO_CC int n1 = 0; count(dev_name.begin(),dev_name.end(),'/',n1); if ((n1 != 2) || pos1 == 0 || pos2 == (dev_name.size() - 1) || pos2 == pos1 + 1) { #else if ((count(dev_name.begin(),dev_name.end(),'/') != 2) || pos1 == 0 || pos2 == (dev_name.size() - 1) || pos2 == pos1 + 1) { #endif cout << "Wrong syntax for device name" << endl; ret = -1; return ret; } // // Check if the device is defined // if (check_device(d_name) != 0) return -1; // // Convert prop value(s) into a vector // string prop_val(p_val); vector prop_val_list; list2vect(prop_val,prop_val_list); // // Create server in DB // Dont forget to add the admin device // try { Tango::Database db; Tango::DbData dbd; Tango::DbDatum db_s(p_name); db_s << prop_val_list; dbd.push_back(db_s); db.put_device_property(dev_name,dbd); } catch (Tango::DevFailed &e) { ret = -1; } return ret; } //+------------------------------------------------------------------------- // // method : delete_property // // description : This function deletes a device property from the DB // // argument : in : - d_name : The device name // - p_name : The property name // // The function returns 0 is everything is fine. Otherwise, it returns -1 // //-------------------------------------------------------------------------- int delete_property(char *d_name,char *p_name) { int ret = 0; // // Check dev name syntax // string dev_name(d_name); string::size_type pos1,pos2; pos1 = dev_name.find('/'); pos2 = dev_name.rfind('/'); #ifdef __SUNPRO_CC int n1 = 0; count(dev_name.begin(),dev_name.end(),'/',n1); if ((n1 != 2) || pos2 == (dev_name.size() - 1) || pos2 == pos1 + 1) { #else if ((count(dev_name.begin(),dev_name.end(),'/') != 2) || pos1 == 0 || pos2 == (dev_name.size() - 1) || pos2 == pos1 + 1) { #endif cout << "Wrong syntax for device name" << endl; ret = -1; return ret; } // // Check if the device is defined // if (check_device(d_name) != 0) return -1; // // Create server in DB // Dont forget to add the admin device // try { Tango::Database db; Tango::DbData dbd; dbd.push_back(Tango::DbDatum(p_name)); db.delete_device_property(dev_name,dbd); } catch (Tango::DevFailed &e) { ret = -1; } return ret; } //+------------------------------------------------------------------------- // // method : list2vect // // description : This function converts a comma separated // device list into a vector of strings with one // element for each device // // argument : in : - dev_list : The device list // - dev_names : The device vector // //-------------------------------------------------------------------------- void list2vect(string &dev_list,vector &dev_names) { string::size_type beg,end; bool end_loop = false; beg = 0; while (end_loop == false) { end = dev_list.find(',',beg); if (end == beg) { ++beg; continue; } if (end == string::npos) { end = dev_list.length(); end_loop = true; } string one_dev; one_dev = dev_list.substr(beg,end - beg); dev_names.push_back(one_dev); beg = end + 1; if (beg == dev_list.size()) end_loop = true; } } //+------------------------------------------------------------------------- // // method : ping_network // // description : This function periodically chechs the network avaibility // // argument : in : - nb_sec : Max time (in sec) to do re-try in case of failure // - verbose : Boolean flag set to true if some printing is required // // The function returns 0 is everything is fine. Otherwise, it returns -1 // //-------------------------------------------------------------------------- int ping_network(int nb_sec,bool verbose) { int ret = 0; int nb_loop; bool infinite = false; if (nb_sec == 0) nb_loop = 1; else if (nb_sec < 0) { infinite = true; nb_loop = 2; } else nb_loop = nb_sec << 1; // // re-try the call every 500 mS // struct timespec ts; ts.tv_sec = 0; ts.tv_nsec = 500000000; while(nb_loop > 0) { int res = check_net(verbose); if (res == 0) { ret = 0; nb_loop = 0; } else { ret = -1; if (infinite == false) --nb_loop; } if (nb_loop != 0) nanosleep(&ts,NULL); } return ret; } //+------------------------------------------------------------------------- // // method : check_net // // description : This function connect to the network and check if it is // fully ready. // // argument : in : - verbose : Flag set to true if some printing is required // // The function returns 0 is everything is fine. Otherwise, it returns -1 // //-------------------------------------------------------------------------- int check_net(bool verbose) { int ret = 0; char buffer[80]; string hostname; if (gethostname(buffer,80) == 0) { hostname = buffer; if (verbose == true) cout << "Host name returned by gethostname function: " << hostname << endl; struct addrinfo hints; memset(&hints,0,sizeof(struct addrinfo)); hints.ai_flags = AI_ADDRCONFIG; hints.ai_family = AF_INET; hints.ai_socktype = SOCK_STREAM; struct addrinfo *info; struct addrinfo *ptr; char tmp_host[512]; int result; result = getaddrinfo(buffer, NULL, &hints, &info); if (result == 0) { ptr = info; if (verbose == true) cout << "getaddrinfo() is a success" << endl; while (ptr != NULL) { if (getnameinfo(ptr->ai_addr,ptr->ai_addrlen,tmp_host,512,0,0,0) != 0) { if (verbose == true) cout << "getnameinfo() call failed" << endl; ret = -1; break; } if (verbose == true) cout << "Host name as returned by getnameinfo call: " << tmp_host << endl; ptr = ptr->ai_next; } freeaddrinfo(info); } else { if (verbose == true) cout << "getaddrinfo() call failed with returned value = " << result << endl; ret = -1; } } else { cout << "Cant retrieve server host name" << endl; ret = -1; } return ret; } //+------------------------------------------------------------------------- // // method : tac_enabled // // description : This function check in DB if the TAC is enabled // // The function returns 0 if the TAC is disabled. Otherwise, it returns 1 // //-------------------------------------------------------------------------- int tac_enabled(void) { int ret = 1; setenv("SUPER_TANGO","true",1); try { Tango::Database db; string servicename("AccessControl"); string instname("tango"); Tango::DbDatum db_datum = db.get_services(servicename,instname); vector service_list; db_datum >> service_list; if (service_list.empty() == true) ret = 0; } catch (Tango::DevFailed &e) { ret = 0; } return ret; } //+------------------------------------------------------------------------- // // method : ping_device // // description : This function periodically chechs a device avaibility // // argument : in : - nb_sec : Max time (in sec) to do re-try in case of failure // - dev_name : The device name // // The function returns 0 is everything is fine. Otherwise, it returns -1 // //-------------------------------------------------------------------------- int ping_device(char *dev_name,int nb_sec) { int ret = 0; int nb_loop; bool infinite = false; if (nb_sec == 0) nb_loop = 1; else if (nb_sec < 0) { infinite = true; nb_loop = 2; } else nb_loop = nb_sec << 1; // // re-try the call every 500 mS // struct timespec ts; ts.tv_sec = 0; ts.tv_nsec = 500000000; while(nb_loop > 0) { int res = check_dev(dev_name); if (res == 0) { ret = 0; nb_loop = 0; } else { ret = -1; if (infinite == false) --nb_loop; } if (nb_loop != 0) nanosleep(&ts,NULL); } return ret; } //+------------------------------------------------------------------------- // // method : check_dev // // description : This function connect to a device and try to ping it // // argument : in : - dev_name : The device name // // The function returns 0 is everything is fine. Otherwise, it returns -1 // //-------------------------------------------------------------------------- int check_dev(char *dev_name) { int ret = 0; try { Tango::DeviceProxy dev(dev_name); dev.ping(); } catch (Tango::DevFailed &e) { ret = -1; } return ret; } tango-8.1.2c+dfsg.orig/utils/tango_admin/Makefile.in0000644000175000017500000004713412205375243021274 0ustar piccapicca# Makefile.in generated by automake 1.11.3 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 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. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ bin_PROGRAMS = tango_admin$(EXEEXT) subdir = utils/tango_admin DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/RSSH_CHECK_OMNIORB.m4 \ $(top_srcdir)/m4/RSSH_CHECK_PTHREADS.m4 \ $(top_srcdir)/m4/RSSH_CHECK_SUNPRO_CC.m4 \ $(top_srcdir)/m4/RSSH_ENABLE_PTHREADS.m4 \ $(top_srcdir)/m4/ac_cxx_have_class_strstream.m4 \ $(top_srcdir)/m4/ac_cxx_have_sstream.m4 \ $(top_srcdir)/m4/ac_cxx_namespaces.m4 \ $(top_srcdir)/m4/ac_path_mysqlclient.m4 \ $(top_srcdir)/m4/ac_prog_mysql.m4 \ $(top_srcdir)/m4/ax_cxx_compile_stdcxx_11.m4 \ $(top_srcdir)/m4/ax_jni_include_dir.m4 \ $(top_srcdir)/m4/check_zlib.m4 $(top_srcdir)/m4/gcc_release.m4 \ $(top_srcdir)/m4/java_release.m4 $(top_srcdir)/m4/libtool.m4 \ $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ $(top_srcdir)/m4/mysql_release.m4 $(top_srcdir)/configure.in am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/ac_config.h.tmp CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = am__installdirs = "$(DESTDIR)$(bindir)" PROGRAMS = $(bin_PROGRAMS) am_tango_admin_OBJECTS = tango_admin.$(OBJEXT) anyoption.$(OBJEXT) tango_admin_OBJECTS = $(am_tango_admin_OBJECTS) tango_admin_LDADD = $(LDADD) am__DEPENDENCIES_1 = tango_admin_DEPENDENCIES = $(am__DEPENDENCIES_1) DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) depcomp = $(SHELL) $(top_srcdir)/config/depcomp am__depfiles_maybe = depfiles am__mv = mv -f CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) LTCXXCOMPILE = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) CXXLD = $(CXX) CXXLINK = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=link $(CXXLD) $(AM_CXXFLAGS) $(CXXFLAGS) $(AM_LDFLAGS) \ $(LDFLAGS) -o $@ 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 = $(tango_admin_SOURCES) DIST_SOURCES = $(tango_admin_SOURCES) ETAGS = etags CTAGS = ctags DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ ALLOCA = @ALLOCA@ AMTAR = @AMTAR@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CORBA_INCLUDES = @CORBA_INCLUDES@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CPP_ELEVEN = @CPP_ELEVEN@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DATADIR = @DATADIR@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DOXYGEN = @DOXYGEN@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ GREP = @GREP@ HAVE_CXX11 = @HAVE_CXX11@ HAVE_ORB_IDL = @HAVE_ORB_IDL@ IDL = @IDL@ IDLCXX = @IDLCXX@ IDLCXXFLAGS = @IDLCXXFLAGS@ IDLFLAGS = @IDLFLAGS@ IDL_CLN_CPP = @IDL_CLN_CPP@ IDL_CLN_CPP_SUFFIX = @IDL_CLN_CPP_SUFFIX@ IDL_CLN_H = @IDL_CLN_H@ IDL_CLN_H1_SUFFIX = @IDL_CLN_H1_SUFFIX@ IDL_CLN_H_SUFFIX = @IDL_CLN_H_SUFFIX@ IDL_CLN_O = @IDL_CLN_O@ IDL_CLN_OBJ_SUFFIX = @IDL_CLN_OBJ_SUFFIX@ IDL_H1_SUFFIX = @IDL_H1_SUFFIX@ IDL_H_SUFFIX = @IDL_H_SUFFIX@ IDL_SRV_CPP = @IDL_SRV_CPP@ IDL_SRV_CPP_SUFFIX = @IDL_SRV_CPP_SUFFIX@ IDL_SRV_H = @IDL_SRV_H@ IDL_SRV_H1_SUFFIX = @IDL_SRV_H1_SUFFIX@ IDL_SRV_H_SUFFIX = @IDL_SRV_H_SUFFIX@ IDL_SRV_O = @IDL_SRV_O@ IDL_SRV_OBJ_SUFFIX = @IDL_SRV_OBJ_SUFFIX@ IDL_TIE_CPP_SUFFIX = @IDL_TIE_CPP_SUFFIX@ IDL_TIE_H1_SUFFIX = @IDL_TIE_H1_SUFFIX@ IDL_TIE_H_SUFFIX = @IDL_TIE_H_SUFFIX@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ JAVA = @JAVA@ JAVAC = @JAVAC@ JAVAH = @JAVAH@ JNI_INCL_DIRS = @JNI_INCL_DIRS@ JPEG_LIB_CXXFLAGS = @JPEG_LIB_CXXFLAGS@ JPEG_MMX_LIB_CXXFLAGS = @JPEG_MMX_LIB_CXXFLAGS@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIBZMQ_CFLAGS = @LIBZMQ_CFLAGS@ LIBZMQ_LIBS = @LIBZMQ_LIBS@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ LYX = @LYX@ MAINT = @MAINT@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ MYSQL = @MYSQL@ MYSQLCLIENT_CFLAGS = @MYSQLCLIENT_CFLAGS@ MYSQLCLIENT_LDFLAGS = @MYSQLCLIENT_LDFLAGS@ MYSQLCLIENT_LIBS = @MYSQLCLIENT_LIBS@ MYSQL_ADMIN = @MYSQL_ADMIN@ MYSQL_ADMIN_PASSWD = @MYSQL_ADMIN_PASSWD@ MYSQL_HOST = @MYSQL_HOST@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ ORB = @ORB@ ORB_COSNAMING_LIB = @ORB_COSNAMING_LIB@ ORB_INCLUDE_PREFIX = @ORB_INCLUDE_PREFIX@ ORB_PREFIX = @ORB_PREFIX@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ TANGO_DB_NAME = @TANGO_DB_NAME@ TANGO_RC_FILE = @TANGO_RC_FILE@ VERSION = @VERSION@ VERSION_INFO = @VERSION_INFO@ ZLIB_CPPFLAGS = @ZLIB_CPPFLAGS@ ZLIB_LDFLAGS = @ZLIB_LDFLAGS@ ZLIB_LIBS = @ZLIB_LIBS@ ZMQ_PREFIX = @ZMQ_PREFIX@ _ACJNI_JAVAC = @_ACJNI_JAVAC@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_aux_dir = @ac_aux_dir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ omniCOS4_CFLAGS = @omniCOS4_CFLAGS@ omniCOS4_LIBS = @omniCOS4_LIBS@ omniORB4_CFLAGS = @omniORB4_CFLAGS@ omniORB4_LIBS = @omniORB4_LIBS@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ subdirs = @subdirs@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ INCLUDES = -I$(top_srcdir)/lib/cpp/client \ -I$(top_srcdir)/lib/cpp/server $(ORB_INCLUDE_PREFIX) \ -I$(top_srcdir)/lib/cpp/log4tango/include \ -I$(top_builddir)/lib/cpp/log4tango/include $(LIBZMQ_CFLAGS) LDADD = -L$(top_builddir)/lib/cpp/server -ltango \ -L$(top_builddir)/lib/cpp/log4tango/src -llog4tango \ $(LIBZMQ_LIBS) tango_admin_SOURCES = tango_admin.cpp \ anyoption.cpp \ anyoption.h all: all-am .SUFFIXES: .SUFFIXES: .cpp .lo .o .obj $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu utils/tango_admin/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu utils/tango_admin/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): install-binPROGRAMS: $(bin_PROGRAMS) @$(NORMAL_INSTALL) test -z "$(bindir)" || $(MKDIR_P) "$(DESTDIR)$(bindir)" @list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \ for p in $$list; do echo "$$p $$p"; done | \ sed 's/$(EXEEXT)$$//' | \ while read p p1; do if test -f $$p || test -f $$p1; \ then echo "$$p"; echo "$$p"; else :; fi; \ done | \ sed -e 'p;s,.*/,,;n;h' -e 's|.*|.|' \ -e 'p;x;s,.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/' | \ sed 'N;N;N;s,\n, ,g' | \ $(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1 } \ { d=$$3; if (dirs[d] != 1) { print "d", d; dirs[d] = 1 } \ if ($$2 == $$4) files[d] = files[d] " " $$1; \ else { print "f", $$3 "/" $$4, $$1; } } \ END { for (d in files) print "f", d, files[d] }' | \ while read type dir files; do \ if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \ test -z "$$files" || { \ echo " $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files '$(DESTDIR)$(bindir)$$dir'"; \ $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files "$(DESTDIR)$(bindir)$$dir" || exit $$?; \ } \ ; done uninstall-binPROGRAMS: @$(NORMAL_UNINSTALL) @list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \ files=`for p in $$list; do echo "$$p"; done | \ sed -e 'h;s,^.*/,,;s/$(EXEEXT)$$//;$(transform)' \ -e 's/$$/$(EXEEXT)/' `; \ test -n "$$list" || exit 0; \ echo " ( cd '$(DESTDIR)$(bindir)' && rm -f" $$files ")"; \ cd "$(DESTDIR)$(bindir)" && rm -f $$files clean-binPROGRAMS: @list='$(bin_PROGRAMS)'; test -n "$$list" || exit 0; \ echo " rm -f" $$list; \ rm -f $$list || exit $$?; \ test -n "$(EXEEXT)" || exit 0; \ list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \ echo " rm -f" $$list; \ rm -f $$list tango_admin$(EXEEXT): $(tango_admin_OBJECTS) $(tango_admin_DEPENDENCIES) $(EXTRA_tango_admin_DEPENDENCIES) @rm -f tango_admin$(EXEEXT) $(CXXLINK) $(tango_admin_OBJECTS) $(tango_admin_LDADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/anyoption.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tango_admin.Po@am__quote@ .cpp.o: @am__fastdepCXX_TRUE@ $(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(CXXCOMPILE) -c -o $@ $< .cpp.obj: @am__fastdepCXX_TRUE@ $(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` @am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'` .cpp.lo: @am__fastdepCXX_TRUE@ $(LTCXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(LTCXXCOMPILE) -c -o $@ $< mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ mkid -fID $$unique tags: TAGS TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) set x; \ here=`pwd`; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: CTAGS CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(PROGRAMS) installdirs: for dir in "$(DESTDIR)$(bindir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: 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: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-binPROGRAMS clean-generic clean-libtool mostlyclean-am distclean: distclean-am -rm -rf ./$(DEPDIR) -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-binPROGRAMS install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -rf ./$(DEPDIR) -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-binPROGRAMS .MAKE: install-am install-strip .PHONY: CTAGS GTAGS all all-am check check-am clean clean-binPROGRAMS \ clean-generic clean-libtool ctags distclean distclean-compile \ distclean-generic distclean-libtool distclean-tags distdir dvi \ dvi-am html html-am info info-am install install-am \ install-binPROGRAMS 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 \ uninstall-binPROGRAMS # 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: tango-8.1.2c+dfsg.orig/utils/tango_admin/anyoption.h0000644000175000017500000002106212205375172021411 0ustar piccapicca// // anyoption.h - include file for command line options management // // // Copyright (C) : 2004,2005,2006,2007,2008,2009,2010 // European Synchrotron Radiation Facility // BP 220, Grenoble 38043 // FRANCE // // This file is part of Tango. // // Tango 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. // // Tango 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 Tango. If not, see . #ifndef _ANYOPTION_H #define _ANYOPTION_H #include #include #include #include #define COMMON_OPT 1 #define COMMAND_OPT 2 #define FILE_OPT 3 #define COMMON_FLAG 4 #define COMMAND_FLAG 5 #define FILE_FLAG 6 #define COMMAND_OPTION_TYPE 1 #define COMMAND_FLAG_TYPE 2 #define FILE_OPTION_TYPE 3 #define FILE_FLAG_TYPE 4 #define UNKNOWN_TYPE 5 #define DEFAULT_MAXOPTS 10 #define MAX_LONG_PREFIX_LENGTH 3 #define DEFAULT_MAXUSAGE 3 #define DEFAULT_MAXHELP 10 #define TRUE_FLAG "true" using namespace std; class AnyOption { public: /* the public interface */ AnyOption(); AnyOption(int maxoptions ); AnyOption(int maxoptions , int maxcharoptions); ~AnyOption(); /* * following set methods specifies the * special characters and delimiters * if not set traditional defaults will be used */ void setCommandPrefixChar( char _prefix ); /* '-' in "-w" */ void setCommandLongPrefix( char *_prefix ); /* '--' in "--width" */ void setFileCommentChar( char _comment ); /* '#' in shellscripts */ void setFileDelimiterChar( char _delimiter );/* ':' in "width : 100" */ /* * provide the input for the options * like argv[] for commndline and the * option file name to use; */ void useCommandArgs( int _argc, char **_argv ); void useFiileName( const char *_filename ); /* * turn off the POSIX style options * this means anything starting with a '-' or "--" * will be considered a valid option * which alo means you cannot add a bunch of * POIX options chars together like "-lr" for "-l -r" * */ void noPOSIX(); /* * prints warning verbose if you set anything wrong */ void setVerbose(); /* * there are two types of options * * Option - has an associated value ( -w 100 ) * Flag - no value, just a boolean flag ( -nogui ) * * the options can be either a string ( GNU style ) * or a character ( traditional POSIX style ) * or both ( --width, -w ) * * the options can be common to the commandline and * the optionfile, or can belong only to either of * commandline and optionfile * * following set methods, handle all the aboove * cases of options. */ /* options comman to command line and option file */ void setOption( const char *opt_string ); void setOption( char opt_char ); void setOption( const char *opt_string , char opt_char ); void setFlag( const char *opt_string ); void setFlag( char opt_char ); void setFlag( const char *opt_string , char opt_char ); /* options read from commandline only */ void setCommandOption( const char *opt_string ); void setCommandOption( char opt_char ); void setCommandOption( const char *opt_string , char opt_char ); void setCommandFlag( const char *opt_string ); void setCommandFlag( char opt_char ); void setCommandFlag( const char *opt_string , char opt_char ); /* options read from an option file only */ void setFileOption( const char *opt_string ); void setFileOption( char opt_char ); void setFileOption( const char *opt_string , char opt_char ); void setFileFlag( const char *opt_string ); void setFileFlag( char opt_char ); void setFileFlag( const char *opt_string , char opt_char ); /* * process the options, registerd using * useCommandArgs() and useFileName(); */ void processOptions(); void processCommandArgs(); void processCommandArgs( int max_args ); bool processFile(); /* * process the specified options */ void processCommandArgs( int _argc, char **_argv ); void processCommandArgs( int _argc, char **_argv, int max_args ); bool processFile( const char *_filename ); /* * get the value of the options * will return NULL if no value is set */ char *getValue( const char *_option ); bool getFlag( const char *_option ); char *getValue( char _optchar ); bool getFlag( char _optchar ); /* * Print Usage */ void printUsage(); void printAutoUsage(); void addUsage( const char *line ); void printHelp(); /* print auto usage printing for unknown options or flag */ void autoUsagePrint(bool flag); /* * get the argument count and arguments sans the options */ int getArgc(); char* getArgv( int index ); bool hasOptions(); private: /* the hidden data structure */ int argc; /* commandline arg count */ char **argv; /* commndline args */ const char* filename; /* the option file */ char* appname; /* the application name from argv[0] */ int *new_argv; /* arguments sans options (index to argv) */ int new_argc; /* argument count sans the options */ int max_legal_args; /* ignore extra arguments */ /* option strings storage + indexing */ int max_options; /* maximum number of options */ const char **options; /* storage */ int *optiontype; /* type - common, command, file */ int *optionindex; /* index into value storage */ int option_counter; /* counter for added options */ /* option chars storage + indexing */ int max_char_options; /* maximum number options */ char *optionchars; /* storage */ int *optchartype; /* type - common, command, file */ int *optcharindex; /* index into value storage */ int optchar_counter; /* counter for added options */ /* values */ char **values; /* common value storage */ int g_value_counter; /* globally updated value index LAME! */ /* help and usage */ const char **usage; /* usage */ int max_usage_lines; /* max usage lines reseverd */ int usage_lines; /* number of usage lines */ bool command_set; /* if argc/argv were provided */ bool file_set; /* if a filename was provided */ bool mem_allocated; /* if memory allocated in init() */ bool posix_style; /* enables to turn off POSIX style options */ bool verbose; /* silent|verbose */ bool print_usage; /* usage verbose */ bool print_help; /* help verbose */ char opt_prefix_char; /* '-' in "-w" */ char long_opt_prefix[MAX_LONG_PREFIX_LENGTH]; /* '--' in "--width" */ char file_delimiter_char; /* ':' in width : 100 */ char file_comment_char; /* '#' in "#this is a comment" */ char equalsign; char comment; char delimiter; char endofline; char whitespace; char nullterminate; bool set; //was static member bool once; //was static member bool hasoptions; bool autousage; private: /* the hidden utils */ void init(); void init(int maxopt, int maxcharopt ); bool alloc(); void cleanup(); bool valueStoreOK(); /* grow storage arrays as required */ bool doubleOptStorage(); bool doubleCharStorage(); bool doubleUsageStorage(); bool setValue( const char *option , char *value ); bool setFlagOn( const char *option ); bool setValue( char optchar , char *value); bool setFlagOn( char optchar ); void addOption( const char* option , int type ); void addOption( char optchar , int type ); void addOptionError( const char *opt); void addOptionError( char opt); bool findFlag( char* value ); void addUsageError( const char *line ); bool CommandSet(); bool FileSet(); bool POSIX(); char parsePOSIX( char* arg ); int parseGNU( char *arg ); bool matchChar( char c ); int matchOpt( char *opt ); /* dot file methods */ char *readFile(); char *readFile( const char* fname ); bool consumeFile( char *buffer ); void processLine( char *theline, int length ); char *chomp( char *str ); void valuePairs( char *type, char *value ); void justValue( char *value ); void printVerbose( const char *msg ); void printVerbose( char *msg ); void printVerbose( char ch ); void printVerbose( ); }; #endif /* ! _ANYOPTION_H */ tango-8.1.2c+dfsg.orig/utils/tango_admin/anyoption.cpp0000644000175000017500000006174112205375172021754 0ustar piccapiccastatic const char *RcsId = "$Id: anyoption.cpp 20288 2012-05-23 11:01:15Z taurel $"; //+============================================================================ // // file : anyoption.cpp // // description : C++ source code for the AnyOption // class. This class is used to manage the command line // line arguments. This code comes from the // http://www.hackorama.com/anyoption. // // project : TANGO // // author(s) : Kishan Thomas (E.Taurel) // // Copyright (C) : 2004,2005,2006,2007,2008,2009,2010 // European Synchrotron Radiation Facility // BP 220, Grenoble 38043 // FRANCE // // This code (and the associated include file) comes from the following // web page: http://www.hackorama.com/anyoption/ // // It is available there without any licensing informations. // // This file is part of Tango. // // Tango 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. // // Tango 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 Tango. If not, see . // // $Revision: 20288 $ // //-============================================================================ #include "anyoption.h" AnyOption::AnyOption() { init(); } AnyOption::AnyOption(int maxopt) { init( maxopt , maxopt ); } AnyOption::AnyOption(int maxopt, int maxcharopt) { init( maxopt , maxcharopt ); } AnyOption::~AnyOption() { if( mem_allocated ) cleanup(); } void AnyOption::init() { init( DEFAULT_MAXOPTS , DEFAULT_MAXOPTS ); } void AnyOption::init(int maxopt, int maxcharopt ) { max_options = maxopt; max_char_options = maxcharopt; max_usage_lines = DEFAULT_MAXUSAGE; usage_lines = 0 ; argc = 0; argv = NULL; posix_style = true; verbose = false; filename = NULL; appname = NULL; option_counter = 0; optchar_counter = 0; new_argv = NULL; new_argc = 0 ; max_legal_args = 0 ; command_set = false; file_set = false; values = NULL; g_value_counter = 0; mem_allocated = false; command_set = false; file_set = false; opt_prefix_char = '-'; file_delimiter_char = ':'; file_comment_char = '#'; equalsign = '='; comment = '#' ; delimiter = ':' ; endofline = '\n'; whitespace = ' ' ; nullterminate = '\0'; set = false; once = true; hasoptions = false; autousage = false; ::strcpy( long_opt_prefix , "--" ); if( alloc() == false ){ cout << endl << "OPTIONS ERROR : Failed allocating memory" ; cout << endl ; cout << "Exiting." << endl ; exit (0); } } bool AnyOption::alloc() { int i = 0 ; int size = 0 ; if( mem_allocated ) return true; size = (max_options+1) * sizeof(const char*); options = (const char**)malloc( size ); optiontype = (int*) malloc( (max_options+1)*sizeof(int) ); optionindex = (int*) malloc( (max_options+1)*sizeof(int) ); if( options == NULL || optiontype == NULL || optionindex == NULL ) return false; else mem_allocated = true; for( i = 0 ; i < max_options ; i++ ){ options[i] = NULL; optiontype[i] = 0 ; optionindex[i] = -1 ; } optionchars = (char*) malloc( (max_char_options+1)*sizeof(char) ); optchartype = (int*) malloc( (max_char_options+1)*sizeof(int) ); optcharindex = (int*) malloc( (max_char_options+1)*sizeof(int) ); if( optionchars == NULL || optchartype == NULL || optcharindex == NULL ) { mem_allocated = false; return false; } for( i = 0 ; i < max_char_options ; i++ ){ optionchars[i] = '0'; optchartype[i] = 0 ; optcharindex[i] = -1 ; } size = (max_usage_lines+1) * sizeof(const char*) ; usage = (const char**) malloc( size ); if( usage == NULL ){ mem_allocated = false; return false; } for( i = 0 ; i < max_usage_lines ; i++ ) usage[i] = NULL; return true; } bool AnyOption::doubleOptStorage() { const char **tmp_ptr; int *tmp_ptr_int; tmp_ptr = options; options = (const char**)realloc( tmp_ptr, ((2*max_options)+1) * sizeof( const char*) ); if( options == NULL) { free(tmp_ptr); return false; } tmp_ptr_int = optiontype; optiontype = (int*) realloc( tmp_ptr_int , ((2 * max_options)+1)* sizeof(int) ); if( optiontype == NULL) { free(tmp_ptr_int); return false; } tmp_ptr_int = optionindex; optionindex = (int*) realloc( tmp_ptr_int, ((2 * max_options)+1) * sizeof(int) ); if (optionindex == NULL) { free(tmp_ptr_int); return false; } /* init new storage */ for( int i = max_options ; i < 2*max_options ; i++ ){ options[i] = NULL; optiontype[i] = 0 ; optionindex[i] = -1 ; } max_options = 2 * max_options ; return true; } bool AnyOption::doubleCharStorage() { char *tmp_ptr; int *tmp_ptr_int; tmp_ptr = optionchars; optionchars = (char*) realloc( tmp_ptr, ((2*max_char_options)+1)*sizeof(char) ); if( optionchars == NULL) { free(tmp_ptr); return false; } tmp_ptr_int = optchartype; optchartype = (int*) realloc( tmp_ptr_int, ((2*max_char_options)+1)*sizeof(int) ); if (optchartype == NULL) { free(tmp_ptr_int); return false; } tmp_ptr_int = optcharindex; optcharindex = (int*) realloc( tmp_ptr_int, ((2*max_char_options)+1)*sizeof(int) ); if (optcharindex == NULL) { free(tmp_ptr_int); return false; } /* init new storage */ for( int i = max_char_options ; i < 2*max_char_options ; i++ ){ optionchars[i] = '0'; optchartype[i] = 0 ; optcharindex[i] = -1 ; } max_char_options = 2 * max_char_options; return true; } bool AnyOption::doubleUsageStorage() { const char **new_usage = (const char**)realloc( usage, ((2*max_usage_lines)+1) * sizeof( const char*) ); if ( new_usage == NULL ) { free(usage); return false; } usage = new_usage; for( int i = max_usage_lines ; i < 2*max_usage_lines ; i++ ) usage[i] = NULL; max_usage_lines = 2 * max_usage_lines ; return true; } void AnyOption::cleanup() { if (options != NULL) free (options); if (optiontype != NULL) free (optiontype); if (optionindex != NULL) free (optionindex); if (optionchars != NULL) free (optionchars); if (optchartype != NULL) free (optchartype); if (optcharindex != NULL) free (optcharindex); if (usage != NULL) free (usage); if( values != NULL ) free (values); if( new_argv != NULL ) free (new_argv); } void AnyOption::setCommandPrefixChar( char _prefix ) { opt_prefix_char = _prefix; } void AnyOption::setCommandLongPrefix( char *_prefix ) { if( strlen( _prefix ) > MAX_LONG_PREFIX_LENGTH ){ *( _prefix + MAX_LONG_PREFIX_LENGTH ) = '\0'; } strcpy (long_opt_prefix, _prefix); } void AnyOption::setFileCommentChar( char _comment ) { file_delimiter_char = _comment; } void AnyOption::setFileDelimiterChar( char _delimiter ) { file_comment_char = _delimiter ; } bool AnyOption::CommandSet() { return( command_set ); } bool AnyOption::FileSet() { return( file_set ); } void AnyOption::noPOSIX() { posix_style = false; } bool AnyOption::POSIX() { return posix_style; } void AnyOption::setVerbose() { verbose = true ; } void AnyOption::printVerbose() { if( verbose ) cout << endl ; } void AnyOption::printVerbose( const char *msg ) { if( verbose ) cout << msg ; } void AnyOption::printVerbose( char *msg ) { if( verbose ) cout << msg ; } void AnyOption::printVerbose( char ch ) { if( verbose ) cout << ch ; } bool AnyOption::hasOptions() { return hasoptions; } void AnyOption::autoUsagePrint(bool _autousage) { autousage = _autousage; } void AnyOption::useCommandArgs( int _argc, char **_argv ) { argc = _argc; argv = _argv; command_set = true; appname = argv[0]; if(argc > 1) hasoptions = true; } void AnyOption::useFiileName( const char *_filename ) { filename = _filename; file_set = true; } /* * set methods for options */ void AnyOption::setCommandOption( const char *opt ) { addOption( opt , COMMAND_OPT ); g_value_counter++; } void AnyOption::setCommandOption( char opt ) { addOption( opt , COMMAND_OPT ); g_value_counter++; } void AnyOption::setCommandOption( const char *opt , char optchar ) { addOption( opt , COMMAND_OPT ); addOption( optchar , COMMAND_OPT ); g_value_counter++; } void AnyOption::setCommandFlag( const char *opt ) { addOption( opt , COMMAND_FLAG ); g_value_counter++; } void AnyOption::setCommandFlag( char opt ) { addOption( opt , COMMAND_FLAG ); g_value_counter++; } void AnyOption::setCommandFlag( const char *opt , char optchar ) { addOption( opt , COMMAND_FLAG ); addOption( optchar , COMMAND_FLAG ); g_value_counter++; } void AnyOption::setFileOption( const char *opt ) { addOption( opt , FILE_OPT ); g_value_counter++; } void AnyOption::setFileOption( char opt ) { addOption( opt , FILE_OPT ); g_value_counter++; } void AnyOption::setFileOption( const char *opt , char optchar ) { addOption( opt , FILE_OPT ); addOption( optchar, FILE_OPT ); g_value_counter++; } void AnyOption::setFileFlag( const char *opt ) { addOption( opt , FILE_FLAG ); g_value_counter++; } void AnyOption::setFileFlag( char opt ) { addOption( opt , FILE_FLAG ); g_value_counter++; } void AnyOption::setFileFlag( const char *opt , char optchar ) { addOption( opt , FILE_FLAG ); addOption( optchar , FILE_FLAG ); g_value_counter++; } void AnyOption::setOption( const char *opt ) { addOption( opt , COMMON_OPT ); g_value_counter++; } void AnyOption::setOption( char opt ) { addOption( opt , COMMON_OPT ); g_value_counter++; } void AnyOption::setOption( const char *opt , char optchar ) { addOption( opt , COMMON_OPT ); addOption( optchar , COMMON_OPT ); g_value_counter++; } void AnyOption::setFlag( const char *opt ) { addOption( opt , COMMON_FLAG ); g_value_counter++; } void AnyOption::setFlag( const char opt ) { addOption( opt , COMMON_FLAG ); g_value_counter++; } void AnyOption::setFlag( const char *opt , char optchar ) { addOption( opt , COMMON_FLAG ); addOption( optchar , COMMON_FLAG ); g_value_counter++; } void AnyOption::addOption( const char *opt, int type ) { if( option_counter >= max_options ){ if( doubleOptStorage() == false ){ addOptionError( opt ); return; } } options[ option_counter ] = opt ; optiontype[ option_counter ] = type ; optionindex[ option_counter ] = g_value_counter; option_counter++; } void AnyOption::addOption( char opt, int type ) { if( !POSIX() ){ printVerbose("Ignoring the option character \""); printVerbose( opt ); printVerbose( "\" ( POSIX options are turned off )" ); printVerbose(); return; } if( optchar_counter >= max_char_options ){ if( doubleCharStorage() == false ){ addOptionError( opt ); return; } } optionchars[ optchar_counter ] = opt ; optchartype[ optchar_counter ] = type ; optcharindex[ optchar_counter ] = g_value_counter; optchar_counter++; } void AnyOption::addOptionError( const char *opt ) { cout << endl ; cout << "OPTIONS ERROR : Failed allocating extra memory " << endl ; cout << "While adding the option : \""<< opt << "\"" << endl; cout << "Exiting." << endl ; cout << endl ; exit(0); } void AnyOption::addOptionError( char opt ) { cout << endl ; cout << "OPTIONS ERROR : Failed allocating extra memory " << endl ; cout << "While adding the option: \""<< opt << "\"" << endl; cout << "Exiting." << endl ; cout << endl ; exit(0); } void AnyOption::processOptions() { if( ! valueStoreOK() ) return; } void AnyOption::processCommandArgs(int max_args) { max_legal_args = max_args; processCommandArgs(); } void AnyOption::processCommandArgs( int _argc, char **_argv, int max_args ) { max_legal_args = max_args; processCommandArgs( _argc, _argv ); } void AnyOption::processCommandArgs( int _argc, char **_argv ) { useCommandArgs( _argc, _argv ); processCommandArgs(); } void AnyOption::processCommandArgs() { if( ! ( valueStoreOK() && CommandSet() ) ) return; if( max_legal_args == 0 ) max_legal_args = argc; new_argv = (int*) malloc( (max_legal_args+1) * sizeof(int) ); for( int i = 1 ; i < argc ; i++ ){/* ignore first argv */ if( argv[i][0] == long_opt_prefix[0] && argv[i][1] == long_opt_prefix[1] ) { /* long GNU option */ int match_at = parseGNU( argv[i]+2 ); /* skip -- */ if( match_at >= 0 && i < argc-1 ) /* found match */ setValue( options[match_at] , argv[++i] ); }else if( argv[i][0] == opt_prefix_char ) { /* POSIX char */ if( POSIX() ){ char ch = parsePOSIX( argv[i]+1 );/* skip - */ if( ch != '0' && i < argc-1 ) /* matching char */ setValue( ch , argv[++i] ); } else { /* treat it as GNU option with a - */ int match_at = parseGNU( argv[i]+1 ); /* skip - */ if( match_at >= 0 && i < argc-1 ) /* found match */ setValue( options[match_at] , argv[++i] ); } }else { /* not option but an argument keep index */ if( new_argc < max_legal_args ){ new_argv[ new_argc ] = i ; new_argc++; }else{ /* ignore extra arguments */ printVerbose( "Ignoring extra argument: " ); printVerbose( argv[i] ); printVerbose( ); printAutoUsage(); } printVerbose( "Unknown command argument option : " ); printVerbose( argv[i] ); printVerbose( ); printAutoUsage(); } } } char AnyOption::parsePOSIX( char* arg ) { for( unsigned int i = 0 ; i < strlen(arg) ; i++ ){ char ch = arg[i] ; if( matchChar(ch) ) { /* keep matching flags till an option */ /*if last char argv[++i] is the value */ if( i == strlen(arg)-1 ){ return ch; }else{/* else the rest of arg is the value */ i++; /* skip any '=' and ' ' */ while( arg[i] == whitespace || arg[i] == equalsign ) i++; setValue( ch , arg+i ); return '0'; } } } printVerbose( "Unknown command argument option : " ); printVerbose( arg ); printVerbose( ); printAutoUsage(); return '0'; } int AnyOption::parseGNU( char *arg ) { int split_at = 0; /* if has a '=' sign get value */ for( unsigned int i = 0 ; i < strlen(arg) ; i++ ){ if(arg[i] == equalsign ){ split_at = i ; /* store index */ i = strlen(arg); /* get out of loop */ } } if( split_at > 0 ){ /* it is an option value pair */ char* tmp = (char*) malloc( (split_at+1)*sizeof(char) ); for( int i = 0 ; i < split_at ; i++ ) tmp[i] = arg[i]; tmp[split_at] = '\0'; if ( matchOpt( tmp ) >= 0 ){ setValue( options[matchOpt(tmp)] , arg+split_at+1 ); free (tmp); }else{ printVerbose( "Unknown command argument option : " ); printVerbose( arg ); printVerbose( ); printAutoUsage(); free (tmp); return -1; } }else{ /* regular options with no '=' sign */ return matchOpt(arg); } return -1; } int AnyOption::matchOpt( char *opt ) { for( int i = 0 ; i < option_counter ; i++ ){ if( strcmp( options[i], opt ) == 0 ){ if( optiontype[i] == COMMON_OPT || optiontype[i] == COMMAND_OPT ) { /* found option return index */ return i; }else if( optiontype[i] == COMMON_FLAG || optiontype[i] == COMMAND_FLAG ) { /* found flag, set it */ setFlagOn( opt ); return -1; } } } printVerbose( "Unknown command argument option : " ); printVerbose( opt ) ; printVerbose( ); printAutoUsage(); return -1; } bool AnyOption::matchChar( char c ) { for( int i = 0 ; i < optchar_counter ; i++ ){ if( optionchars[i] == c ) { /* found match */ if(optchartype[i] == COMMON_OPT || optchartype[i] == COMMAND_OPT ) { /* an option store and stop scanning */ return true; }else if( optchartype[i] == COMMON_FLAG || optchartype[i] == COMMAND_FLAG ) { /* a flag store and keep scanning */ setFlagOn( c ); return false; } } } printVerbose( "Unknown command argument option : " ); printVerbose( c ) ; printVerbose( ); printAutoUsage(); return false; } bool AnyOption::valueStoreOK( ) { if( !set ){ if( g_value_counter > 0 ){ int size = 0; size = g_value_counter * sizeof(char*); values = (char**)malloc( size ); for( int i = 0 ; i < g_value_counter ; i++) values[i] = NULL; set = true; } } return set; } /* * public get methods */ char* AnyOption::getValue( const char *option ) { if( !valueStoreOK() ) return NULL; for( int i = 0 ; i < option_counter ; i++ ){ if( strcmp( options[i], option ) == 0 ) return values[ optionindex[i] ]; } return NULL; } bool AnyOption::getFlag( const char *option ) { if( !valueStoreOK() ) return false; for( int i = 0 ; i < option_counter ; i++ ){ if( strcmp( options[i], option ) == 0 ) return findFlag( values[ optionindex[i] ] ); } return false; } char* AnyOption::getValue( char option ) { if( !valueStoreOK() ) return NULL; for( int i = 0 ; i < optchar_counter ; i++ ){ if( optionchars[i] == option ) return values[ optcharindex[i] ]; } return NULL; } bool AnyOption::getFlag( char option ) { if( !valueStoreOK() ) return false; for( int i = 0 ; i < optchar_counter ; i++ ){ if( optionchars[i] == option ) return findFlag( values[ optcharindex[i] ] ) ; } return false; } bool AnyOption::findFlag( char* val ) { if( val == NULL ) return false; if( strcmp( TRUE_FLAG , val ) == 0 ) return true; return false; } /* * private set methods */ bool AnyOption::setValue( const char *option , char *value ) { if( !valueStoreOK() ) return false; for( int i = 0 ; i < option_counter ; i++ ){ if( strcmp( options[i], option ) == 0 ){ values[ optionindex[i] ] = (char*) malloc((strlen(value)+1)*sizeof(char)); strcpy( values[ optionindex[i] ], value ); return true; } } return false; } bool AnyOption::setFlagOn( const char *option ) { if( !valueStoreOK() ) return false; for( int i = 0 ; i < option_counter ; i++ ){ if( strcmp( options[i], option ) == 0 ){ values[ optionindex[i] ] = (char*) malloc((strlen(TRUE_FLAG)+1)*sizeof(char)); strcpy( values[ optionindex[i] ] , TRUE_FLAG ); return true; } } return false; } bool AnyOption::setValue( char option , char *value ) { if( !valueStoreOK() ) return false; for( int i = 0 ; i < optchar_counter ; i++ ){ if( optionchars[i] == option ){ values[ optcharindex[i] ] = (char*) malloc((strlen(value)+1)*sizeof(char)); strcpy( values[ optcharindex[i] ], value ); return true; } } return false; } bool AnyOption::setFlagOn( char option ) { if( !valueStoreOK() ) return false; for( int i = 0 ; i < optchar_counter ; i++ ){ if( optionchars[i] == option ){ values[ optcharindex[i] ] = (char*) malloc((strlen(TRUE_FLAG)+1)*sizeof(char)); strcpy( values[ optcharindex[i] ] , TRUE_FLAG ); return true; } } return false; } int AnyOption::getArgc( ) { return new_argc; } char* AnyOption::getArgv( int index ) { if( index < new_argc ){ return ( argv[ new_argv[ index ] ] ); } return NULL; } /* dotfile sub routines */ bool AnyOption::processFile() { if( ! (valueStoreOK() && FileSet()) ) return false; return ( consumeFile(readFile()) ); } bool AnyOption::processFile( const char *filename ) { useFiileName(filename ); return ( processFile() ); } char* AnyOption::readFile() { return ( readFile(filename) ); } /* * read the file contents to a character buffer */ char* AnyOption::readFile( const char* fname ) { int length; char *buffer; ifstream is; is.open ( fname , ifstream::in ); if( ! is.good() ){ is.close(); return NULL; } is.seekg (0, ios::end); length = is.tellg(); is.seekg (0, ios::beg); buffer = (char*) malloc(length*sizeof(char)); is.read (buffer,length); is.close(); return buffer; } /* * scans a char* buffer for lines that does not * start with the specified comment character. */ bool AnyOption::consumeFile( char *buffer ) { if( buffer == NULL ) return false; char *cursor = buffer;/* preserve the ptr */ char *pline = NULL ; int linelength = 0; bool newline = true; for( unsigned int i = 0 ; i < strlen( buffer ) ; i++ ){ if( *cursor == endofline ) { /* end of line */ if( pline != NULL ) /* valid line */ processLine( pline, linelength ); pline = NULL; newline = true; }else if( newline ){ /* start of line */ newline = false; if( (*cursor != comment ) ){ /* not a comment */ pline = cursor ; linelength = 0 ; } } cursor++; /* keep moving */ linelength++; } free (buffer); return true; } /* * find a valid type value pair separated by a delimiter * character and pass it to valuePairs() * any line which is not valid will be considered a value * and will get passed on to justValue() * * assuming delimiter is ':' the behaviour will be, * * width:10 - valid pair valuePairs( width, 10 ); * width : 10 - valid pair valuepairs( width, 10 ); * * :::: - not valid * width - not valid * :10 - not valid * width: - not valid * :: - not valid * : - not valid * */ void AnyOption::processLine( char *theline, int length ) { bool found = false; char *pline = (char*) malloc( (length+1)*sizeof(char) ); for( int i = 0 ; i < length ; i ++ ) pline[i]= *(theline++); pline[length] = nullterminate; char *cursor = pline ; /* preserve the ptr */ if( *cursor == delimiter || *(cursor+length-1) == delimiter ){ justValue( pline );/* line with start/end delimiter */ }else{ for( int i = 1 ; i < length-1 && !found ; i++){/* delimiter */ if( *cursor == delimiter ){ *(cursor-1) = nullterminate; /* two strings */ found = true; valuePairs( pline , cursor+1 ); } cursor++; } cursor++; if( !found ) /* not a pair */ justValue( pline ); } free (pline); } /* * removes trailing and preceeding whitespaces from a string */ char* AnyOption::chomp( char *str ) { while( *str == whitespace ) str++; char *end = str+strlen(str)-1; while( *end == whitespace ) end--; *(end+1) = nullterminate; return str; } void AnyOption::valuePairs( char *type, char *value ) { if ( strlen(chomp(type)) == 1 ){ /* this is a char option */ for( int i = 0 ; i < optchar_counter ; i++ ){ if( optionchars[i] == type[0] ){ /* match */ if( optchartype[i] == COMMON_OPT || optchartype[i] == FILE_OPT ) { setValue( type[0] , chomp(value) ); return; } } } } /* if no char options matched */ for( int i = 0 ; i < option_counter ; i++ ){ if( strcmp( options[i], type ) == 0 ){ /* match */ if( optiontype[i] == COMMON_OPT || optiontype[i] == FILE_OPT ) { setValue( type , chomp(value) ); return; } } } printVerbose( "Unknown option in resourcefile : " ); printVerbose( type ); printVerbose( ); } void AnyOption::justValue( char *type ) { if ( strlen(chomp(type)) == 1 ){ /* this is a char option */ for( int i = 0 ; i < optchar_counter ; i++ ){ if( optionchars[i] == type[0] ){ /* match */ if( optchartype[i] == COMMON_FLAG || optchartype[i] == FILE_FLAG ) { setFlagOn( type[0] ); return; } } } } /* if no char options matched */ for( int i = 0 ; i < option_counter ; i++ ){ if( strcmp( options[i], type ) == 0 ){ /* match */ if( optiontype[i] == COMMON_FLAG || optiontype[i] == FILE_FLAG ) { setFlagOn( type ); return; } } } printVerbose( "Unknown option in resourcefile : " ); printVerbose( type ); printVerbose( ); } /* * usage and help */ void AnyOption::printAutoUsage() { if( autousage ) printUsage(); } void AnyOption::printUsage() { if( once ) { once = false ; cout << endl ; for( int i = 0 ; i < usage_lines ; i++ ) cout << usage[i] << endl ; cout << endl ; } } void AnyOption::addUsage( const char *line ) { if( usage_lines >= max_usage_lines ){ if( doubleUsageStorage() == false ){ addUsageError( line ); exit(1); } } usage[ usage_lines ] = line ; usage_lines++; } void AnyOption::addUsageError( const char *line ) { cout << endl ; cout << "OPTIONS ERROR : Failed allocating extra memory " << endl ; cout << "While adding the usage/help : \""<< line << "\"" << endl; cout << "Exiting." << endl ; cout << endl ; exit(0); } tango-8.1.2c+dfsg.orig/utils/tango_admin/Makefile.am0000644000175000017500000000072312205375172021255 0ustar piccapicca INCLUDES = -I$(top_srcdir)/lib/cpp/client \ -I$(top_srcdir)/lib/cpp/server $(ORB_INCLUDE_PREFIX) \ -I$(top_srcdir)/lib/cpp/log4tango/include \ -I$(top_builddir)/lib/cpp/log4tango/include $(LIBZMQ_CFLAGS) LDADD = -L$(top_builddir)/lib/cpp/server -ltango \ -L$(top_builddir)/lib/cpp/log4tango/src -llog4tango \ $(LIBZMQ_LIBS) bin_PROGRAMS=tango_admin tango_admin_SOURCES=tango_admin.cpp \ anyoption.cpp \ anyoption.h tango-8.1.2c+dfsg.orig/utils/Makefile.in0000644000175000017500000004647012205375243017016 0ustar piccapicca# Makefile.in generated by automake 1.11.3 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 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. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ subdir = utils DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/RSSH_CHECK_OMNIORB.m4 \ $(top_srcdir)/m4/RSSH_CHECK_PTHREADS.m4 \ $(top_srcdir)/m4/RSSH_CHECK_SUNPRO_CC.m4 \ $(top_srcdir)/m4/RSSH_ENABLE_PTHREADS.m4 \ $(top_srcdir)/m4/ac_cxx_have_class_strstream.m4 \ $(top_srcdir)/m4/ac_cxx_have_sstream.m4 \ $(top_srcdir)/m4/ac_cxx_namespaces.m4 \ $(top_srcdir)/m4/ac_path_mysqlclient.m4 \ $(top_srcdir)/m4/ac_prog_mysql.m4 \ $(top_srcdir)/m4/ax_cxx_compile_stdcxx_11.m4 \ $(top_srcdir)/m4/ax_jni_include_dir.m4 \ $(top_srcdir)/m4/check_zlib.m4 $(top_srcdir)/m4/gcc_release.m4 \ $(top_srcdir)/m4/java_release.m4 $(top_srcdir)/m4/libtool.m4 \ $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ $(top_srcdir)/m4/mysql_release.m4 $(top_srcdir)/configure.in am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/ac_config.h.tmp CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = SOURCES = DIST_SOURCES = RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \ html-recursive info-recursive install-data-recursive \ install-dvi-recursive install-exec-recursive \ install-html-recursive install-info-recursive \ install-pdf-recursive install-ps-recursive install-recursive \ installcheck-recursive installdirs-recursive pdf-recursive \ ps-recursive uninstall-recursive 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 ETAGS = etags CTAGS = ctags DIST_SUBDIRS = $(SUBDIRS) DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) am__relativize = \ dir0=`pwd`; \ sed_first='s,^\([^/]*\)/.*$$,\1,'; \ sed_rest='s,^[^/]*/*,,'; \ sed_last='s,^.*/\([^/]*\)$$,\1,'; \ sed_butlast='s,/*[^/]*$$,,'; \ while test -n "$$dir1"; do \ first=`echo "$$dir1" | sed -e "$$sed_first"`; \ if test "$$first" != "."; then \ if test "$$first" = ".."; then \ dir2=`echo "$$dir0" | sed -e "$$sed_last"`/"$$dir2"; \ dir0=`echo "$$dir0" | sed -e "$$sed_butlast"`; \ else \ first2=`echo "$$dir2" | sed -e "$$sed_first"`; \ if test "$$first2" = "$$first"; then \ dir2=`echo "$$dir2" | sed -e "$$sed_rest"`; \ else \ dir2="../$$dir2"; \ fi; \ dir0="$$dir0"/"$$first"; \ fi; \ fi; \ dir1=`echo "$$dir1" | sed -e "$$sed_rest"`; \ done; \ reldir="$$dir2" ACLOCAL = @ACLOCAL@ ALLOCA = @ALLOCA@ AMTAR = @AMTAR@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CORBA_INCLUDES = @CORBA_INCLUDES@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CPP_ELEVEN = @CPP_ELEVEN@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DATADIR = @DATADIR@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DOXYGEN = @DOXYGEN@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ GREP = @GREP@ HAVE_CXX11 = @HAVE_CXX11@ HAVE_ORB_IDL = @HAVE_ORB_IDL@ IDL = @IDL@ IDLCXX = @IDLCXX@ IDLCXXFLAGS = @IDLCXXFLAGS@ IDLFLAGS = @IDLFLAGS@ IDL_CLN_CPP = @IDL_CLN_CPP@ IDL_CLN_CPP_SUFFIX = @IDL_CLN_CPP_SUFFIX@ IDL_CLN_H = @IDL_CLN_H@ IDL_CLN_H1_SUFFIX = @IDL_CLN_H1_SUFFIX@ IDL_CLN_H_SUFFIX = @IDL_CLN_H_SUFFIX@ IDL_CLN_O = @IDL_CLN_O@ IDL_CLN_OBJ_SUFFIX = @IDL_CLN_OBJ_SUFFIX@ IDL_H1_SUFFIX = @IDL_H1_SUFFIX@ IDL_H_SUFFIX = @IDL_H_SUFFIX@ IDL_SRV_CPP = @IDL_SRV_CPP@ IDL_SRV_CPP_SUFFIX = @IDL_SRV_CPP_SUFFIX@ IDL_SRV_H = @IDL_SRV_H@ IDL_SRV_H1_SUFFIX = @IDL_SRV_H1_SUFFIX@ IDL_SRV_H_SUFFIX = @IDL_SRV_H_SUFFIX@ IDL_SRV_O = @IDL_SRV_O@ IDL_SRV_OBJ_SUFFIX = @IDL_SRV_OBJ_SUFFIX@ IDL_TIE_CPP_SUFFIX = @IDL_TIE_CPP_SUFFIX@ IDL_TIE_H1_SUFFIX = @IDL_TIE_H1_SUFFIX@ IDL_TIE_H_SUFFIX = @IDL_TIE_H_SUFFIX@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ JAVA = @JAVA@ JAVAC = @JAVAC@ JAVAH = @JAVAH@ JNI_INCL_DIRS = @JNI_INCL_DIRS@ JPEG_LIB_CXXFLAGS = @JPEG_LIB_CXXFLAGS@ JPEG_MMX_LIB_CXXFLAGS = @JPEG_MMX_LIB_CXXFLAGS@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIBZMQ_CFLAGS = @LIBZMQ_CFLAGS@ LIBZMQ_LIBS = @LIBZMQ_LIBS@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ LYX = @LYX@ MAINT = @MAINT@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ MYSQL = @MYSQL@ MYSQLCLIENT_CFLAGS = @MYSQLCLIENT_CFLAGS@ MYSQLCLIENT_LDFLAGS = @MYSQLCLIENT_LDFLAGS@ MYSQLCLIENT_LIBS = @MYSQLCLIENT_LIBS@ MYSQL_ADMIN = @MYSQL_ADMIN@ MYSQL_ADMIN_PASSWD = @MYSQL_ADMIN_PASSWD@ MYSQL_HOST = @MYSQL_HOST@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ ORB = @ORB@ ORB_COSNAMING_LIB = @ORB_COSNAMING_LIB@ ORB_INCLUDE_PREFIX = @ORB_INCLUDE_PREFIX@ ORB_PREFIX = @ORB_PREFIX@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ TANGO_DB_NAME = @TANGO_DB_NAME@ TANGO_RC_FILE = @TANGO_RC_FILE@ VERSION = @VERSION@ VERSION_INFO = @VERSION_INFO@ ZLIB_CPPFLAGS = @ZLIB_CPPFLAGS@ ZLIB_LDFLAGS = @ZLIB_LDFLAGS@ ZLIB_LIBS = @ZLIB_LIBS@ ZMQ_PREFIX = @ZMQ_PREFIX@ _ACJNI_JAVAC = @_ACJNI_JAVAC@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_aux_dir = @ac_aux_dir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ omniCOS4_CFLAGS = @omniCOS4_CFLAGS@ omniCOS4_LIBS = @omniCOS4_LIBS@ omniORB4_CFLAGS = @omniORB4_CFLAGS@ omniORB4_LIBS = @omniORB4_LIBS@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ subdirs = @subdirs@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ SUBDIRS = notifd2db tango_admin all: all-recursive .SUFFIXES: $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu utils/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu utils/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): mostlyclean-libtool: -rm -f *.lo clean-libtool: -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. $(RECURSIVE_TARGETS): @fail= failcom='exit 1'; \ for f in x $$MAKEFLAGS; do \ case $$f in \ *=* | --[!k]*);; \ *k*) failcom='fail=yes';; \ esac; \ done; \ dot_seen=no; \ target=`echo $@ | sed s/-recursive//`; \ list='$(SUBDIRS)'; for subdir in $$list; do \ echo "Making $$target in $$subdir"; \ if test "$$subdir" = "."; then \ dot_seen=yes; \ local_target="$$target-am"; \ else \ local_target="$$target"; \ fi; \ ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ || eval $$failcom; \ done; \ if test "$$dot_seen" = "no"; then \ $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \ fi; test -z "$$fail" $(RECURSIVE_CLEAN_TARGETS): @fail= failcom='exit 1'; \ for f in x $$MAKEFLAGS; do \ case $$f in \ *=* | --[!k]*);; \ *k*) failcom='fail=yes';; \ esac; \ done; \ dot_seen=no; \ case "$@" in \ distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \ *) list='$(SUBDIRS)' ;; \ esac; \ rev=''; for subdir in $$list; do \ if test "$$subdir" = "."; then :; else \ rev="$$subdir $$rev"; \ fi; \ done; \ rev="$$rev ."; \ target=`echo $@ | sed s/-recursive//`; \ for subdir in $$rev; do \ echo "Making $$target in $$subdir"; \ if test "$$subdir" = "."; then \ local_target="$$target-am"; \ else \ local_target="$$target"; \ fi; \ ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ || eval $$failcom; \ done && test -z "$$fail" tags-recursive: list='$(SUBDIRS)'; for subdir in $$list; do \ test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \ done ctags-recursive: list='$(SUBDIRS)'; for subdir in $$list; do \ test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \ done ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ mkid -fID $$unique tags: TAGS TAGS: tags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) set x; \ here=`pwd`; \ if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \ include_option=--etags-include; \ empty_fix=.; \ else \ include_option=--include; \ empty_fix=; \ fi; \ list='$(SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ test ! -f $$subdir/TAGS || \ set "$$@" "$$include_option=$$here/$$subdir/TAGS"; \ fi; \ done; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: CTAGS CTAGS: ctags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ 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 \ dir1=$$subdir; dir2="$(distdir)/$$subdir"; \ $(am__relativize); \ new_distdir=$$reldir; \ dir1=$$subdir; dir2="$(top_distdir)"; \ $(am__relativize); \ new_top_distdir=$$reldir; \ echo " (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir="$$new_top_distdir" distdir="$$new_distdir" \\"; \ echo " am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)"; \ ($(am__cd) $$subdir && \ $(MAKE) $(AM_MAKEFLAGS) \ top_distdir="$$new_top_distdir" \ distdir="$$new_distdir" \ am__remove_distdir=: \ am__skip_length_check=: \ am__skip_mode_fix=: \ distdir) \ || exit 1; \ fi; \ done check-am: all-am check: check-recursive all-am: Makefile installdirs: installdirs-recursive installdirs-am: install: install-recursive install-exec: install-exec-recursive install-data: install-data-recursive uninstall: uninstall-recursive install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-recursive install-strip: 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: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-recursive clean-am: clean-generic clean-libtool mostlyclean-am distclean: distclean-recursive -rm -f Makefile distclean-am: clean-am distclean-generic distclean-tags dvi: dvi-recursive dvi-am: html: html-recursive html-am: info: info-recursive info-am: install-data-am: install-dvi: install-dvi-recursive install-dvi-am: install-exec-am: install-html: install-html-recursive install-html-am: install-info: install-info-recursive install-info-am: install-man: install-pdf: install-pdf-recursive install-pdf-am: install-ps: install-ps-recursive install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-recursive -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-recursive mostlyclean-am: mostlyclean-generic mostlyclean-libtool pdf: pdf-recursive pdf-am: ps: ps-recursive ps-am: uninstall-am: .MAKE: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) ctags-recursive \ install-am install-strip tags-recursive .PHONY: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) CTAGS GTAGS \ all all-am check check-am clean clean-generic clean-libtool \ ctags ctags-recursive distclean 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-generic \ mostlyclean-libtool pdf pdf-am ps ps-am tags tags-recursive \ uninstall uninstall-am # 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: tango-8.1.2c+dfsg.orig/utils/Makefile.am0000644000175000017500000000004112205375076016771 0ustar piccapicca SUBDIRS = notifd2db tango_admin tango-8.1.2c+dfsg.orig/utils/notifd2db/0000755000175000017500000000000012205375306016611 5ustar piccapiccatango-8.1.2c+dfsg.orig/utils/notifd2db/notifd2db.cpp0000644000175000017500000002243612205375167021204 0ustar piccapicca static const char *RcsId = "$Id: notifd2db.cpp 19335 2012-02-21 13:39:11Z taurel $"; /* * this program will export the Notification Factory to the TANGO database * * - andy 30nov03 * * Copyright (C) : 2004,2005,2006,2007,2008,2009,2010,2011,2012 * European Synchrotron Radiation Facility * BP 220, Grenoble 38043 * FRANCE * * This file is part of Tango. * * Tango 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. * * Tango 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 Tango. If not, see . * * $Revision: 19335 $ * */ #include #include #include #ifdef WIN32 #include #include #else #include #endif #define DEFAULT_FACT_IOR_FILE "/tmp/rdifact.ior" #define BASE_LINE "notifd" #define END_NOTIFD_LINE "/DEVICE/notifd:" void check_args(int,char *[],vector &,string &,string &); void print_usage(); void append_to_file(string &,string &); int main(int argc, char **argv) { bool def = false; vector file_names; string file; string host_name; char host[128]; sprintf(host,"Hello world\n"); check_args(argc,argv,file_names,file,host_name); ifstream ior_file; if (file.size() == 0) { ior_file.open(DEFAULT_FACT_IOR_FILE); def = true; } else { ior_file.open(file.c_str()); if (!ior_file) { if (def == true) cerr << "cannot open default file (/tmp/rdifact.ior). Please check it exists !\n"; else cerr << "cannot open file " << file << " please check if it exists !\n"; exit(-1); } } string ior_string; ior_file >> ior_string; // cout << ior_string << endl; unsigned long nb_files = file_names.size(); if (nb_files == 0) { cout << "Going to export notification service event factory to Tango database ...\n"; Tango::Database *tango_db; int num_retries = 3; bool failed = false; while (num_retries > 0) { try { tango_db = new Tango::Database(); tango_db->set_timeout_millis(10000); num_retries = 0; } catch (Tango::DevFailed &e) { num_retries--; if (num_retries == 0) { cerr << "Can't create Tango database object" << endl; Tango::Except::print_exception(e); return(-1); } cout << "Can't create Tango database object, retrying...." << endl; } } string notifd_factory_name; char buffer[256]; Tango::DevVarStringArray *dev_export_list = new Tango::DevVarStringArray; CORBA::Any send; dev_export_list->length(5); if (host_name.size() == 0) { gethostname(buffer,256); host_name = buffer; Tango::DeviceProxy::get_fqdn(host_name); } notifd_factory_name = "notifd/factory/"+host_name; (*dev_export_list)[0] = CORBA::string_dup(notifd_factory_name.c_str()); (*dev_export_list)[1] = CORBA::string_dup(ior_string.c_str()); (*dev_export_list)[2] = CORBA::string_dup(host_name.c_str()); #ifdef STRSTREAM ostrstream ostream; #else ostringstream ostream; #endif /* STRSTREAM */ #ifndef WIN32 ostream << getpid() << ends; #else ostream << _getpid() << ends; #endif /* WIN32 */ #ifdef STRSTREAM (*dev_export_list)[3] = CORBA::string_dup(ostream.str()); delete [] (ostream.str()); #else (*dev_export_list)[3] = CORBA::string_dup(ostream.str().c_str()); #endif /* STRSTREAM */ (*dev_export_list)[4] = CORBA::string_dup("1"); send <<= dev_export_list; // // Call db server with retries in case of Timeout (massive crates re-start after power cut) // num_retries = 3; failed = false; while (num_retries > 0) { try { CORBA::Any_var received = tango_db->command_inout("DbExportEvent",send); cout << "Successfully exported notification service event factory for host " << host_name << " to Tango database !\n"; num_retries = 0; } catch (Tango::CommunicationFailed &e) { if (e.errors.length() >= 2) { if (::strcmp(e.errors[1].reason.in(),"API_DeviceTimedOut") == 0) { if (num_retries != 0) { num_retries--; if (num_retries == 0) { failed = true; } } } else { failed = true; num_retries = 0; } } else { failed = true; num_retries = 0; } } catch (...) { failed = true; num_retries = 0; } } if (failed == true) { cerr << "Failed to export notification service event factory to Tango database\n"; return(-1); } } else { for (unsigned loop = 0;loop < nb_files;loop++) append_to_file(file_names[loop],ior_string); cout << "Successfully exported notification service event factory to device server file(s) !\n"; } return(0); } void check_args(int argc,char *argv[], vector &file_names, string &file,string &host) { int ind = 1; while (ind < argc) { if (argv[ind][0] == '-') { switch (argv[ind][1]) { case 'h': print_usage(); break; case 'o': if (strlen(argv[ind]) != 2) { print_usage(); } else { if (ind == (argc - 1)) { print_usage(); } ind++; file_names.push_back(argv[ind]); ind++; } break; default : print_usage(); break; } } else { if ((file.empty() == true) && (ind == 1)) file = argv[ind]; else { if (ind == 2) host = argv[ind]; else { print_usage(); } } ind++; } } /* unsigned long l; for (l = 0;l < file_names.size();l++) cout << "DS File name = " << file_names[l] << endl; if (file.empty() == false) cout << "Notifd file = " << file << endl; if (host.empty() == false) cout << "Notifd host = " << host << endl;*/ } void print_usage() { cerr << "notifd usage: notifd [notifd_ior_file] [host] [-h] [-o DS file]\nDefault notifd_ior_file=/tmp/rdifact.ior" << endl; exit(-1); } void append_to_file(string &file_name,string &ior_string) { cout << "going to export notification service event factory to device server property file(s) ...\n"; fstream ds_file; ds_file.open(file_name.c_str(),ios::in); if (!ds_file) { cout << "Can't open file " << file_name << endl; exit(-1); } vector file_lines; // // Read all file // char tmp[4096]; while(ds_file.getline(tmp,4096)) { string tmp_str(tmp); file_lines.push_back(tmp); } // // Close file // ds_file.close(); unsigned long nb_lines = file_lines.size(); unsigned long loop; bool found = false; // // Find device server instance name // string instance_name; for (loop = 0;loop < nb_lines;loop++) { string line(file_lines[loop]); if (line[0] == '#') continue; string::size_type pos; if ((pos = line.find(':')) != string::npos) { string bef; bef = line.substr(0,pos); if ((pos = bef.find("DEVICE")) != string::npos) { string::size_type first,second; if ((first = bef.find('/')) == string::npos) { cerr << "Wrong syntax in file " << file_name << " at line " << loop << endl; exit(-1); } first++; if ((second = bef.find('/',first)) == string::npos) { cerr << "Wrong syntax in file " << file_name << " at line " << loop << endl; exit(-1); } instance_name = bef.substr(first,second - first); break; } } } if (instance_name.empty() == true) { cerr << "Can't find device server instance in file " << file_name << "!!!" << endl; exit(-1); } // cout << "Instance name = " << instance_name << endl; for (loop = 0;loop < nb_lines;loop++) { string line(file_lines[loop]); if (line.find(BASE_LINE) != string::npos) { // // Remove all spaces or tab characters // string::size_type pos,idx; idx = 0; while((pos = line.find(" ",idx)) != string::npos) { line.erase(pos,1); idx = pos; } idx = 0; while((pos = line.find('\t',idx)) != string::npos) { line.erase(pos,1); idx = pos; } // // Replace IOR // pos = line.find("/DEVICE/notifd:"); if (pos == string::npos) { cerr << "Wrong syntax in file " << file_name << ", line " << loop+1 << endl; exit(-1); } string::iterator ite = line.begin(); ite = ite + pos + 15; ior_string = ior_string + '"'; ior_string.insert(0," \""); line.replace(ite,line.end(),ior_string); file_lines[loop] = line; found = true; break; } } // // If IOR does not exist, add it // if (found == false) { string new_line(BASE_LINE); new_line = new_line + '/' + instance_name + END_NOTIFD_LINE + ' ' + '"' + ior_string + '"'; file_lines.push_back(new_line); } nb_lines = file_lines.size(); // // Re-write file // ofstream new_ds_file; new_ds_file.open(file_name.c_str(),ios::out|ios::trunc); if (!new_ds_file) { cerr << "Can't re-open file " << file_name << " for writing" << endl; exit(-1); } nb_lines = file_lines.size(); for (loop = 0;loop < nb_lines;loop++) { new_ds_file.write(file_lines[loop].c_str(),file_lines[loop].size()); new_ds_file.put('\n'); } ds_file.close(); } tango-8.1.2c+dfsg.orig/utils/notifd2db/Makefile.in0000644000175000017500000004575212205375243020673 0ustar piccapicca# Makefile.in generated by automake 1.11.3 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 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. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ bin_PROGRAMS = notifd2db$(EXEEXT) subdir = utils/notifd2db DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/RSSH_CHECK_OMNIORB.m4 \ $(top_srcdir)/m4/RSSH_CHECK_PTHREADS.m4 \ $(top_srcdir)/m4/RSSH_CHECK_SUNPRO_CC.m4 \ $(top_srcdir)/m4/RSSH_ENABLE_PTHREADS.m4 \ $(top_srcdir)/m4/ac_cxx_have_class_strstream.m4 \ $(top_srcdir)/m4/ac_cxx_have_sstream.m4 \ $(top_srcdir)/m4/ac_cxx_namespaces.m4 \ $(top_srcdir)/m4/ac_path_mysqlclient.m4 \ $(top_srcdir)/m4/ac_prog_mysql.m4 \ $(top_srcdir)/m4/ax_cxx_compile_stdcxx_11.m4 \ $(top_srcdir)/m4/ax_jni_include_dir.m4 \ $(top_srcdir)/m4/check_zlib.m4 $(top_srcdir)/m4/gcc_release.m4 \ $(top_srcdir)/m4/java_release.m4 $(top_srcdir)/m4/libtool.m4 \ $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ $(top_srcdir)/m4/mysql_release.m4 $(top_srcdir)/configure.in am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/ac_config.h.tmp CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = am__installdirs = "$(DESTDIR)$(bindir)" PROGRAMS = $(bin_PROGRAMS) am_notifd2db_OBJECTS = notifd2db.$(OBJEXT) notifd2db_OBJECTS = $(am_notifd2db_OBJECTS) notifd2db_LDADD = $(LDADD) am__DEPENDENCIES_1 = notifd2db_DEPENDENCIES = $(am__DEPENDENCIES_1) DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) depcomp = $(SHELL) $(top_srcdir)/config/depcomp am__depfiles_maybe = depfiles am__mv = mv -f CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) LTCXXCOMPILE = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) CXXLD = $(CXX) CXXLINK = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=link $(CXXLD) $(AM_CXXFLAGS) $(CXXFLAGS) $(AM_LDFLAGS) \ $(LDFLAGS) -o $@ SOURCES = $(notifd2db_SOURCES) DIST_SOURCES = $(notifd2db_SOURCES) ETAGS = etags CTAGS = ctags DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ ALLOCA = @ALLOCA@ AMTAR = @AMTAR@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CORBA_INCLUDES = @CORBA_INCLUDES@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CPP_ELEVEN = @CPP_ELEVEN@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DATADIR = @DATADIR@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DOXYGEN = @DOXYGEN@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ GREP = @GREP@ HAVE_CXX11 = @HAVE_CXX11@ HAVE_ORB_IDL = @HAVE_ORB_IDL@ IDL = @IDL@ IDLCXX = @IDLCXX@ IDLCXXFLAGS = @IDLCXXFLAGS@ IDLFLAGS = @IDLFLAGS@ IDL_CLN_CPP = @IDL_CLN_CPP@ IDL_CLN_CPP_SUFFIX = @IDL_CLN_CPP_SUFFIX@ IDL_CLN_H = @IDL_CLN_H@ IDL_CLN_H1_SUFFIX = @IDL_CLN_H1_SUFFIX@ IDL_CLN_H_SUFFIX = @IDL_CLN_H_SUFFIX@ IDL_CLN_O = @IDL_CLN_O@ IDL_CLN_OBJ_SUFFIX = @IDL_CLN_OBJ_SUFFIX@ IDL_H1_SUFFIX = @IDL_H1_SUFFIX@ IDL_H_SUFFIX = @IDL_H_SUFFIX@ IDL_SRV_CPP = @IDL_SRV_CPP@ IDL_SRV_CPP_SUFFIX = @IDL_SRV_CPP_SUFFIX@ IDL_SRV_H = @IDL_SRV_H@ IDL_SRV_H1_SUFFIX = @IDL_SRV_H1_SUFFIX@ IDL_SRV_H_SUFFIX = @IDL_SRV_H_SUFFIX@ IDL_SRV_O = @IDL_SRV_O@ IDL_SRV_OBJ_SUFFIX = @IDL_SRV_OBJ_SUFFIX@ IDL_TIE_CPP_SUFFIX = @IDL_TIE_CPP_SUFFIX@ IDL_TIE_H1_SUFFIX = @IDL_TIE_H1_SUFFIX@ IDL_TIE_H_SUFFIX = @IDL_TIE_H_SUFFIX@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ JAVA = @JAVA@ JAVAC = @JAVAC@ JAVAH = @JAVAH@ JNI_INCL_DIRS = @JNI_INCL_DIRS@ JPEG_LIB_CXXFLAGS = @JPEG_LIB_CXXFLAGS@ JPEG_MMX_LIB_CXXFLAGS = @JPEG_MMX_LIB_CXXFLAGS@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIBZMQ_CFLAGS = @LIBZMQ_CFLAGS@ LIBZMQ_LIBS = @LIBZMQ_LIBS@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ LYX = @LYX@ MAINT = @MAINT@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ MYSQL = @MYSQL@ MYSQLCLIENT_CFLAGS = @MYSQLCLIENT_CFLAGS@ MYSQLCLIENT_LDFLAGS = @MYSQLCLIENT_LDFLAGS@ MYSQLCLIENT_LIBS = @MYSQLCLIENT_LIBS@ MYSQL_ADMIN = @MYSQL_ADMIN@ MYSQL_ADMIN_PASSWD = @MYSQL_ADMIN_PASSWD@ MYSQL_HOST = @MYSQL_HOST@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ ORB = @ORB@ ORB_COSNAMING_LIB = @ORB_COSNAMING_LIB@ ORB_INCLUDE_PREFIX = @ORB_INCLUDE_PREFIX@ ORB_PREFIX = @ORB_PREFIX@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ TANGO_DB_NAME = @TANGO_DB_NAME@ TANGO_RC_FILE = @TANGO_RC_FILE@ VERSION = @VERSION@ VERSION_INFO = @VERSION_INFO@ ZLIB_CPPFLAGS = @ZLIB_CPPFLAGS@ ZLIB_LDFLAGS = @ZLIB_LDFLAGS@ ZLIB_LIBS = @ZLIB_LIBS@ ZMQ_PREFIX = @ZMQ_PREFIX@ _ACJNI_JAVAC = @_ACJNI_JAVAC@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_aux_dir = @ac_aux_dir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ omniCOS4_CFLAGS = @omniCOS4_CFLAGS@ omniCOS4_LIBS = @omniCOS4_LIBS@ omniORB4_CFLAGS = @omniORB4_CFLAGS@ omniORB4_LIBS = @omniORB4_LIBS@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ subdirs = @subdirs@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ INCLUDES = -I$(top_srcdir)/lib/cpp/client \ -I$(top_srcdir)/lib/cpp/server $(ORB_INCLUDE_PREFIX) \ -I$(top_srcdir)/lib/cpp/log4tango/include \ -I$(top_builddir)/lib/cpp/log4tango/include $(LIBZMQ_CFLAGS) LDADD = -L$(top_builddir)/lib/cpp/server -ltango \ -L$(top_builddir)/lib/cpp/log4tango/src -llog4tango \ $(LIBZMQ_LIBS) notifd2db_SOURCES = notifd2db.cpp all: all-am .SUFFIXES: .SUFFIXES: .cpp .lo .o .obj $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu utils/notifd2db/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu utils/notifd2db/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): install-binPROGRAMS: $(bin_PROGRAMS) @$(NORMAL_INSTALL) test -z "$(bindir)" || $(MKDIR_P) "$(DESTDIR)$(bindir)" @list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \ for p in $$list; do echo "$$p $$p"; done | \ sed 's/$(EXEEXT)$$//' | \ while read p p1; do if test -f $$p || test -f $$p1; \ then echo "$$p"; echo "$$p"; else :; fi; \ done | \ sed -e 'p;s,.*/,,;n;h' -e 's|.*|.|' \ -e 'p;x;s,.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/' | \ sed 'N;N;N;s,\n, ,g' | \ $(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1 } \ { d=$$3; if (dirs[d] != 1) { print "d", d; dirs[d] = 1 } \ if ($$2 == $$4) files[d] = files[d] " " $$1; \ else { print "f", $$3 "/" $$4, $$1; } } \ END { for (d in files) print "f", d, files[d] }' | \ while read type dir files; do \ if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \ test -z "$$files" || { \ echo " $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files '$(DESTDIR)$(bindir)$$dir'"; \ $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files "$(DESTDIR)$(bindir)$$dir" || exit $$?; \ } \ ; done uninstall-binPROGRAMS: @$(NORMAL_UNINSTALL) @list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \ files=`for p in $$list; do echo "$$p"; done | \ sed -e 'h;s,^.*/,,;s/$(EXEEXT)$$//;$(transform)' \ -e 's/$$/$(EXEEXT)/' `; \ test -n "$$list" || exit 0; \ echo " ( cd '$(DESTDIR)$(bindir)' && rm -f" $$files ")"; \ cd "$(DESTDIR)$(bindir)" && rm -f $$files clean-binPROGRAMS: @list='$(bin_PROGRAMS)'; test -n "$$list" || exit 0; \ echo " rm -f" $$list; \ rm -f $$list || exit $$?; \ test -n "$(EXEEXT)" || exit 0; \ list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \ echo " rm -f" $$list; \ rm -f $$list notifd2db$(EXEEXT): $(notifd2db_OBJECTS) $(notifd2db_DEPENDENCIES) $(EXTRA_notifd2db_DEPENDENCIES) @rm -f notifd2db$(EXEEXT) $(CXXLINK) $(notifd2db_OBJECTS) $(notifd2db_LDADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/notifd2db.Po@am__quote@ .cpp.o: @am__fastdepCXX_TRUE@ $(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(CXXCOMPILE) -c -o $@ $< .cpp.obj: @am__fastdepCXX_TRUE@ $(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` @am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'` .cpp.lo: @am__fastdepCXX_TRUE@ $(LTCXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(LTCXXCOMPILE) -c -o $@ $< mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ mkid -fID $$unique tags: TAGS TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) set x; \ here=`pwd`; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: CTAGS CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(PROGRAMS) installdirs: for dir in "$(DESTDIR)$(bindir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: 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: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-binPROGRAMS clean-generic clean-libtool mostlyclean-am distclean: distclean-am -rm -rf ./$(DEPDIR) -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-binPROGRAMS install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -rf ./$(DEPDIR) -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-binPROGRAMS .MAKE: install-am install-strip .PHONY: CTAGS GTAGS all all-am check check-am clean clean-binPROGRAMS \ clean-generic clean-libtool ctags distclean distclean-compile \ distclean-generic distclean-libtool distclean-tags distdir dvi \ dvi-am html html-am info info-am install install-am \ install-binPROGRAMS 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 \ uninstall-binPROGRAMS # 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: tango-8.1.2c+dfsg.orig/utils/notifd2db/Makefile.am0000644000175000017500000000064512205375167020657 0ustar piccapicca INCLUDES = -I$(top_srcdir)/lib/cpp/client \ -I$(top_srcdir)/lib/cpp/server $(ORB_INCLUDE_PREFIX) \ -I$(top_srcdir)/lib/cpp/log4tango/include \ -I$(top_builddir)/lib/cpp/log4tango/include $(LIBZMQ_CFLAGS) LDADD = -L$(top_builddir)/lib/cpp/server -ltango \ -L$(top_builddir)/lib/cpp/log4tango/src -llog4tango \ $(LIBZMQ_LIBS) bin_PROGRAMS=notifd2db notifd2db_SOURCES=notifd2db.cpp tango-8.1.2c+dfsg.orig/NEWS0000644000175000017500000000000012205375106014261 0ustar piccapiccatango-8.1.2c+dfsg.orig/install-sh0000755000175000017500000001273612205375106015611 0ustar piccapicca#!/bin/sh # # install - install a program, script, or datafile # This comes from X11R5 (mit/util/scripts/install.sh). # # Copyright 1991 by the Massachusetts Institute of Technology # # Permission to use, copy, modify, distribute, and sell this software and its # documentation for any purpose is hereby granted without fee, provided that # the above copyright notice appear in all copies and that both that # copyright notice and this permission notice appear in supporting # documentation, and that the name of M.I.T. not be used in advertising or # publicity pertaining to distribution of the software without specific, # written prior permission. M.I.T. makes no representations about the # suitability of this software for any purpose. It is provided "as is" # without express or implied warranty. # # Calling this script install-sh is preferred over install.sh, to prevent # `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 # from scratch. It can only install one file at a time, a restriction # shared with many OS's install programs. # set DOITPROG to echo to test this script # Don't use :- since 4.3BSD and earlier shells don't like it. doit="${DOITPROG-}" # put in absolute paths if you don't have them in your path; or use env. vars. mvprog="${MVPROG-mv}" cpprog="${CPPROG-cp}" chmodprog="${CHMODPROG-chmod}" chownprog="${CHOWNPROG-chown}" chgrpprog="${CHGRPPROG-chgrp}" stripprog="${STRIPPROG-strip}" rmprog="${RMPROG-rm}" mkdirprog="${MKDIRPROG-mkdir}" transformbasename="" transform_arg="" instcmd="$mvprog" chmodcmd="$chmodprog 0755" chowncmd="" chgrpcmd="" stripcmd="" rmcmd="$rmprog -f" mvcmd="$mvprog" src="" dst="" dir_arg="" while [ x"$1" != x ]; do case $1 in -c) instcmd="$cpprog" shift continue;; -d) dir_arg=true shift continue;; -m) chmodcmd="$chmodprog $2" shift shift continue;; -o) chowncmd="$chownprog $2" shift shift continue;; -g) chgrpcmd="$chgrpprog $2" shift shift continue;; -s) stripcmd="$stripprog" shift continue;; -t=*) transformarg=`echo $1 | sed 's/-t=//'` shift continue;; -b=*) transformbasename=`echo $1 | sed 's/-b=//'` shift continue;; *) if [ x"$src" = x ] then src=$1 else # this colon is to work around a 386BSD /bin/sh bug : dst=$1 fi shift continue;; esac done if [ x"$src" = x ] then echo "install: no input file specified" exit 1 else true fi if [ x"$dir_arg" != x ]; then dst=$src src="" if [ -d $dst ]; then instcmd=: chmodcmd="" else instcmd=mkdir fi else # Waiting for this to be detected by the "$instcmd $src $dsttmp" command # might cause directories to be created, which would be especially bad # if $src (and thus $dsttmp) contains '*'. if [ -f $src -o -d $src ] then true else echo "install: $src does not exist" exit 1 fi if [ x"$dst" = x ] then echo "install: no destination specified" exit 1 else true fi # If destination is a directory, append the input filename; if your system # does not like double slashes in filenames, you may need to add some logic if [ -d $dst ] then dst="$dst"/`basename $src` else true fi fi ## this sed command emulates the dirname command dstdir=`echo $dst | sed -e 's,[^/]*$,,;s,/$,,;s,^$,.,'` # Make sure that the destination directory exists. # this part is taken from Noah Friedman's mkinstalldirs script # Skip lots of stat calls in the usual case. if [ ! -d "$dstdir" ]; then defaultIFS=' ' IFS="${IFS-${defaultIFS}}" oIFS="${IFS}" # Some sh's can't handle IFS=/ for some reason. IFS='%' set - `echo ${dstdir} | sed -e 's@/@%@g' -e 's@^%@/@'` IFS="${oIFS}" pathcomp='' while [ $# -ne 0 ] ; do pathcomp="${pathcomp}${1}" shift if [ ! -d "${pathcomp}" ] ; then $mkdirprog "${pathcomp}" else true fi pathcomp="${pathcomp}/" done fi if [ x"$dir_arg" != x ] then $doit $instcmd $dst && if [ x"$chowncmd" != x ]; then $doit $chowncmd $dst; else true ; fi && if [ x"$chgrpcmd" != x ]; then $doit $chgrpcmd $dst; else true ; fi && if [ x"$stripcmd" != x ]; then $doit $stripcmd $dst; else true ; fi && if [ x"$chmodcmd" != x ]; then $doit $chmodcmd $dst; else true ; fi else # If we're going to rename the final executable, determine the name now. if [ x"$transformarg" = x ] then dstfile=`basename $dst` else dstfile=`basename $dst $transformbasename | sed $transformarg`$transformbasename fi # don't allow the sed command to completely eliminate the filename if [ x"$dstfile" = x ] then dstfile=`basename $dst` else true fi # Make a temp file name in the proper directory. dsttmp=$dstdir/#inst.$$# # Move or copy the file name to the temp name $doit $instcmd $src $dsttmp && trap "rm -f ${dsttmp}" 0 && # and set any options; do chmod last to preserve setuid bits # If any of these fail, we abort the whole thing. If we want to # ignore errors from any of these, just make sure not to ignore # errors from the above "$doit $instcmd $src $dsttmp" command. if [ x"$chowncmd" != x ]; then $doit $chowncmd $dsttmp; else true;fi && if [ x"$chgrpcmd" != x ]; then $doit $chgrpcmd $dsttmp; else true;fi && if [ x"$stripcmd" != x ]; then $doit $stripcmd $dsttmp; else true;fi && if [ x"$chmodcmd" != x ]; then $doit $chmodcmd $dsttmp; else true;fi && # Now rename the file to the real destination. $doit $rmcmd -f $dstdir/$dstfile && $doit $mvcmd $dsttmp $dstdir/$dstfile fi && exit 0 tango-8.1.2c+dfsg.orig/ChangeLog0000644000175000017500000000000012205375106015334 0ustar piccapiccatango-8.1.2c+dfsg.orig/AUTHORS0000644000175000017500000000003712205375106014644 0ustar piccapiccaThe Tango team (tango@esrf.fr) tango-8.1.2c+dfsg.orig/config/0000755000175000017500000000000012205375305015042 5ustar piccapiccatango-8.1.2c+dfsg.orig/config/depcomp0000755000175000017500000003554512205375077016441 0ustar piccapicca#! /bin/sh # depcomp - compile a program generating dependencies as side-effects scriptversion=2004-05-31.23 # Copyright (C) 1999, 2000, 2003, 2004 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., 59 Temple Place - Suite 330, Boston, MA # 02111-1307, USA. # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that program. # Originally written by Alexandre Oliva . case $1 in '') echo "$0: No command. Try \`$0 --help' for more information." 1>&2 exit 1; ;; -h | --h*) cat <<\EOF Usage: depcomp [--help] [--version] PROGRAM [ARGS] Run PROGRAMS ARGS to compile a file, generating dependencies as side-effects. Environment variables: depmode Dependency tracking mode. 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. libtool Whether libtool is used (yes/no). Report bugs to . EOF exit 0 ;; -v | --v*) echo "depcomp $scriptversion" exit 0 ;; esac 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 fi # Dependencies for sub/bar.o or sub/bar.obj go into sub/.deps/bar.Po. depfile=${depfile-`echo "$object" | sed 's|[^\\/]*$|'${DEPDIR-.deps}'/&|;s|\.\([^.]*\)$|.P\1|;s|Pobj$|Po|'`} tmpdepfile=${tmpdepfile-`echo "$depfile" | sed 's/\.\([^.]*\)$/.T\1/'`} rm -f "$tmpdepfile" # Some modes work just like other modes, but use different flags. We # parameterize here, but still list the modes in the big case below, # to make depend.m4 easier to write. Note that we *cannot* use a case # here, because this file can only contain one case statement. if test "$depmode" = hp; then # HP compiler uses -M and no extra arg. gccflag=-M depmode=gcc fi if test "$depmode" = dashXmstdout; then # This is just like dashmstdout with a different argument. dashmflag=-xM depmode=dashmstdout fi case "$depmode" in gcc3) ## gcc 3 implements dependency tracking that does exactly what ## we want. Yay! Note: for some reason libtool 1.4 doesn't like ## it if -MD -MP comes after the -MF stuff. Hmm. "$@" -MT "$object" -MD -MP -MF "$tmpdepfile" stat=$? if test $stat -eq 0; then : else rm -f "$tmpdepfile" exit $stat fi mv "$tmpdepfile" "$depfile" ;; gcc) ## There are various ways to get dependency output from gcc. Here's ## why we pick this rather obscure method: ## - Don't want to use -MD because we'd like the dependencies to end ## up in a subdir. Having to rename by hand is ugly. ## (We might end up doing this anyway to support other compilers.) ## - The DEPENDENCIES_OUTPUT environment variable makes gcc act like ## -MM, not -M (despite what the docs say). ## - Using -M directly means running the compiler twice (even worse ## than renaming). if test -z "$gccflag"; then gccflag=-MD, fi "$@" -Wp,"$gccflag$tmpdepfile" stat=$? if test $stat -eq 0; then : else rm -f "$tmpdepfile" exit $stat fi rm -f "$depfile" echo "$object : \\" > "$depfile" alpha=ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz ## 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. ## 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 ## that the space means something, we add a space to the output as ## well. ## 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" rm -f "$tmpdepfile" ;; hp) # 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 ;; sgi) if test "$libtool" = yes; then "$@" "-Wp,-MDupdate,$tmpdepfile" else "$@" -MDupdate "$tmpdepfile" fi stat=$? if test $stat -eq 0; then : else rm -f "$tmpdepfile" exit $stat fi rm -f "$depfile" if test -f "$tmpdepfile"; then # yes, the sourcefile depend on other files echo "$object : \\" > "$depfile" # Clip off the initial element (the dependent). Don't try to be # 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 # dependency line. tr ' ' ' ' < "$tmpdepfile" \ | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' | \ tr ' ' ' ' >> $depfile echo >> $depfile # The second pass generates a dummy entry for each header file. tr ' ' ' ' < "$tmpdepfile" \ | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' -e 's/$/:/' \ >> $depfile else # The sourcefile does not contain any dependencies, so just # store a dummy comment line, to avoid errors with the Makefile # "include basename.Plo" scheme. echo "#dummy" > "$depfile" fi rm -f "$tmpdepfile" ;; 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 # start of each line; $object doesn't have directory information. # Version 6 uses the directory in both cases. stripped=`echo "$object" | sed 's/\(.*\)\..*$/\1/'` tmpdepfile="$stripped.u" if test "$libtool" = yes; then "$@" -Wc,-M else "$@" -M fi stat=$? if test -f "$tmpdepfile"; then : else stripped=`echo "$stripped" | sed 's,^.*/,,'` tmpdepfile="$stripped.u" fi if test $stat -eq 0; then : else rm -f "$tmpdepfile" exit $stat fi if test -f "$tmpdepfile"; then outname="$stripped.o" # 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:'. sed -e "s,^$outname:,$object :," < "$tmpdepfile" > "$depfile" sed -e "s,^$outname: \(.*\)$,\1:," < "$tmpdepfile" >> "$depfile" else # The sourcefile does not contain any dependencies, so just # store a dummy comment line, to avoid errors with the Makefile # "include basename.Plo" scheme. echo "#dummy" > "$depfile" fi rm -f "$tmpdepfile" ;; icc) # Intel's C compiler understands `-MD -MF file'. However on # icc -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: # 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 \ : # foo.o: sub/foo.c ... \ # sub/foo.h ... \ # ... "$@" -MD -MF "$tmpdepfile" stat=$? if test $stat -eq 0; then : else rm -f "$tmpdepfile" 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 \'. # 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" rm -f "$tmpdepfile" ;; 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'. # 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. # Subdirectories are respected. dir=`echo "$object" | sed -e 's|/[^/]*$|/|'` test "x$dir" = "x$object" && dir= base=`echo "$object" | sed -e 's|^.*/||' -e 's/\.o$//' -e 's/\.lo$//'` if test "$libtool" = yes; then # Dependencies are output in .lo.d with libtool 1.4. # With libtool 1.5 they are output both in $dir.libs/$base.o.d # and in $dir.libs/$base.o.d and $dir$base.o.d. We process the # latter, because the former will be cleaned when $dir.libs is # erased. tmpdepfile1="$dir.libs/$base.lo.d" tmpdepfile2="$dir$base.o.d" tmpdepfile3="$dir.libs/$base.d" "$@" -Wc,-MD else tmpdepfile1="$dir$base.o.d" tmpdepfile2="$dir$base.d" tmpdepfile3="$dir$base.d" "$@" -MD fi stat=$? if test $stat -eq 0; then : else rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" exit $stat fi if test -f "$tmpdepfile1"; then tmpdepfile="$tmpdepfile1" elif test -f "$tmpdepfile2"; then tmpdepfile="$tmpdepfile2" else tmpdepfile="$tmpdepfile3" fi 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" else echo "#dummy" > "$depfile" fi rm -f "$tmpdepfile" ;; #nosideeffect) # This comment above is used by automake to tell side-effect # dependency tracking mechanisms from slower ones. dashmstdout) # Important note: in order to support this mode, a compiler *must* # always write the preprocessed file to stdout, regardless of -o. "$@" || exit $? # Remove the call to Libtool. if test "$libtool" = yes; then while test $1 != '--mode=compile'; do shift done shift fi # Remove `-o $object'. IFS=" " for arg do case $arg in -o) shift ;; $object) shift ;; *) set fnord "$@" "$arg" shift # fnord shift # $arg ;; esac done test -z "$dashmflag" && dashmflag=-M # 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. "$@" $dashmflag | sed 's:^[ ]*[^: ][^:][^:]*\:[ ]*:'"$object"'\: :' > "$tmpdepfile" rm -f "$depfile" cat < "$tmpdepfile" > "$depfile" tr ' ' ' ' < "$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" rm -f "$tmpdepfile" ;; dashXmstdout) # This case only exists to satisfy depend.m4. It is never actually # run, as this mode is specially recognized in the preamble. exit 1 ;; makedepend) "$@" || exit $? # Remove any Libtool call if test "$libtool" = yes; then while test $1 != '--mode=compile'; do shift done shift fi # X makedepend shift cleared=no for arg in "$@"; do case $cleared in no) set ""; shift cleared=yes ;; esac case "$arg" in -D*|-I*) set fnord "$@" "$arg"; shift ;; # Strip any option that makedepend may not understand. Remove # the object too, otherwise makedepend will parse it as a source file. -*|$object) ;; *) set fnord "$@" "$arg"; shift ;; esac done obj_suffix="`echo $object | sed 's/^.*\././'`" touch "$tmpdepfile" ${MAKEDEPEND-makedepend} -o"$obj_suffix" -f"$tmpdepfile" "$@" rm -f "$depfile" cat < "$tmpdepfile" > "$depfile" sed '1,2d' "$tmpdepfile" | tr ' ' ' ' | \ ## 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" rm -f "$tmpdepfile" "$tmpdepfile".bak ;; cpp) # Important note: in order to support this mode, a compiler *must* # always write the preprocessed file to stdout. "$@" || exit $? # Remove the call to Libtool. if test "$libtool" = yes; then while test $1 != '--mode=compile'; do shift done shift fi # Remove `-o $object'. IFS=" " for arg do case $arg in -o) shift ;; $object) shift ;; *) set fnord "$@" "$arg" shift # fnord shift # $arg ;; esac done "$@" -E | sed -n '/^# [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' | sed '$ s: \\$::' > "$tmpdepfile" rm -f "$depfile" echo "$object : \\" > "$depfile" cat < "$tmpdepfile" >> "$depfile" sed < "$tmpdepfile" '/^$/d;s/^ //;s/ \\$//;s/$/ :/' >> "$depfile" rm -f "$tmpdepfile" ;; msvisualcpp) # Important note: in order to support this mode, a compiler *must* # always write the preprocessed file to stdout, regardless of -o, # because we must use -o when running libtool. "$@" || exit $? IFS=" " for arg do case "$arg" in "-Gm"|"/Gm"|"-Gi"|"/Gi"|"-ZI"|"/ZI") set fnord "$@" shift shift ;; *) set fnord "$@" "$arg" shift shift ;; esac done "$@" -E | sed -n '/^#line [0-9][0-9]* "\([^"]*\)"/ s::echo "`cygpath -u \\"\1\\"`":p' | sort | uniq > "$tmpdepfile" rm -f "$depfile" echo "$object : \\" > "$depfile" . "$tmpdepfile" | sed 's% %\\ %g' | sed -n '/^\(.*\)$/ s:: \1 \\:p' >> "$depfile" echo " " >> "$depfile" . "$tmpdepfile" | sed 's% %\\ %g' | sed -n '/^\(.*\)$/ s::\1\::p' >> "$depfile" rm -f "$tmpdepfile" ;; none) exec "$@" ;; *) echo "Unknown depmode $depmode" 1>&2 exit 1 ;; esac exit 0 # Local Variables: # mode: shell-script # sh-indentation: 2 # eval: (add-hook 'write-file-hooks 'time-stamp) # time-stamp-start: "scriptversion=" # time-stamp-format: "%:y-%02m-%02d.%02H" # time-stamp-end: "$" # End: tango-8.1.2c+dfsg.orig/config/install-sh0000755000175000017500000002176612205375077017070 0ustar piccapicca#!/bin/sh # install - install a program, script, or datafile scriptversion=2004-09-10.20 # This originates from X11R5 (mit/util/scripts/install.sh), which was # later released in X11R6 (xc/config/util/install.sh) with the # following copyright and license. # # Copyright (C) 1994 X Consortium # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to # deal in the Software without restriction, including without limitation the # rights to use, copy, modify, merge, publish, distribute, sublicense, and/or # sell copies of the Software, and to permit persons to whom the Software is # furnished to do so, subject to the following conditions: # # The above copyright notice and this permission notice shall be included in # all copies or substantial portions of the Software. # # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE # X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN # AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNEC- # TION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # # Except as contained in this notice, the name of the X Consortium shall not # be used in advertising or otherwise to promote the sale, use or other deal- # ings in this Software without prior written authorization from the X Consor- # tium. # # # 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 # when there is no Makefile. # # This script is compatible with the BSD install script, but was written # from scratch. It can only install one file at a time, a restriction # shared with many OS's install programs. # set DOITPROG to echo to test this script # Don't use :- since 4.3BSD and earlier shells don't like it. doit="${DOITPROG-}" # put in absolute paths if you don't have them in your path; or use env. vars. mvprog="${MVPROG-mv}" cpprog="${CPPROG-cp}" chmodprog="${CHMODPROG-chmod}" chownprog="${CHOWNPROG-chown}" chgrpprog="${CHGRPPROG-chgrp}" stripprog="${STRIPPROG-strip}" rmprog="${RMPROG-rm}" mkdirprog="${MKDIRPROG-mkdir}" chmodcmd="$chmodprog 0755" chowncmd= chgrpcmd= stripcmd= rmcmd="$rmprog -f" mvcmd="$mvprog" src= dst= dir_arg= dstarg= no_target_directory= usage="Usage: $0 [OPTION]... [-T] SRCFILE DSTFILE or: $0 [OPTION]... SRCFILES... DIRECTORY or: $0 [OPTION]... -t DIRECTORY SRCFILES... or: $0 [OPTION]... -d DIRECTORIES... In the 1st form, copy SRCFILE to DSTFILE. In the 2nd and 3rd, copy all SRCFILES to DIRECTORY. In the 4th, create DIRECTORIES. Options: -c (ignored) -d create directories instead of installing files. -g GROUP $chgrpprog installed files to GROUP. -m MODE $chmodprog installed files to MODE. -o USER $chownprog installed files to USER. -s $stripprog installed files. -t DIRECTORY install into DIRECTORY. -T report an error if DSTFILE is a directory. --help display this help and exit. --version display version info and exit. Environment variables override the default commands: CHGRPPROG CHMODPROG CHOWNPROG CPPROG MKDIRPROG MVPROG RMPROG STRIPPROG " while test -n "$1"; do case $1 in -c) shift continue;; -d) dir_arg=true shift continue;; -g) chgrpcmd="$chgrpprog $2" shift shift continue;; --help) echo "$usage"; exit 0;; -m) chmodcmd="$chmodprog $2" shift shift continue;; -o) chowncmd="$chownprog $2" shift shift continue;; -s) stripcmd=$stripprog shift continue;; -t) dstarg=$2 shift shift continue;; -T) no_target_directory=true shift continue;; --version) echo "$0 $scriptversion"; exit 0;; *) # When -d is used, all remaining arguments are directories to create. # When -t is used, the destination is already specified. test -n "$dir_arg$dstarg" && break # Otherwise, the last argument is the destination. Remove it from $@. for arg do if test -n "$dstarg"; then # $@ is not empty: it contains at least $arg. set fnord "$@" "$dstarg" shift # fnord fi shift # arg dstarg=$arg done break;; esac done if test -z "$1"; then if test -z "$dir_arg"; then echo "$0: no input file specified." >&2 exit 1 fi # It's OK to call `install-sh -d' without argument. # This can happen when creating conditional directories. exit 0 fi for src do # Protect names starting with `-'. case $src in -*) src=./$src ;; esac if test -n "$dir_arg"; then dst=$src src= if test -d "$dst"; then mkdircmd=: chmodcmd= else mkdircmd=$mkdirprog fi else # Waiting for this to be detected by the "$cpprog $src $dsttmp" command # might cause directories to be created, which would be especially bad # if $src (and thus $dsttmp) contains '*'. if test ! -f "$src" && test ! -d "$src"; then echo "$0: $src does not exist." >&2 exit 1 fi if test -z "$dstarg"; then echo "$0: no destination specified." >&2 exit 1 fi dst=$dstarg # 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. if test -d "$dst"; then if test -n "$no_target_directory"; then echo "$0: $dstarg: Is a directory" >&2 exit 1 fi dst=$dst/`basename "$src"` fi fi # This sed command emulates the dirname command. dstdir=`echo "$dst" | sed -e 's,[^/]*$,,;s,/$,,;s,^$,.,'` # Make sure that the destination directory exists. # Skip lots of stat calls in the usual case. if test ! -d "$dstdir"; then defaultIFS=' ' IFS="${IFS-$defaultIFS}" oIFS=$IFS # Some sh's can't handle IFS=/ for some reason. IFS='%' set - `echo "$dstdir" | sed -e 's@/@%@g' -e 's@^%@/@'` IFS=$oIFS pathcomp= while test $# -ne 0 ; do pathcomp=$pathcomp$1 shift if test ! -d "$pathcomp"; then $mkdirprog "$pathcomp" # mkdir can fail with a `File exist' error in case several # install-sh are creating the directory concurrently. This # is OK. test -d "$pathcomp" || exit fi pathcomp=$pathcomp/ done fi if test -n "$dir_arg"; then $doit $mkdircmd "$dst" \ && { test -z "$chowncmd" || $doit $chowncmd "$dst"; } \ && { test -z "$chgrpcmd" || $doit $chgrpcmd "$dst"; } \ && { test -z "$stripcmd" || $doit $stripcmd "$dst"; } \ && { test -z "$chmodcmd" || $doit $chmodcmd "$dst"; } else dstfile=`basename "$dst"` # Make a couple of temp file names in the proper directory. dsttmp=$dstdir/_inst.$$_ rmtmp=$dstdir/_rm.$$_ # Trap to clean up those temp files at exit. trap 'ret=$?; rm -f "$dsttmp" "$rmtmp" && exit $ret' 0 trap '(exit $?); exit' 1 2 13 15 # Copy the file name to the temp name. $doit $cpprog "$src" "$dsttmp" && # and set any options; do chmod last to preserve setuid bits. # # If any of these fail, we abort the whole thing. If we want to # ignore errors from any of these, just make sure not to ignore # errors from the above "$doit $cpprog $src $dsttmp" command. # { test -z "$chowncmd" || $doit $chowncmd "$dsttmp"; } \ && { test -z "$chgrpcmd" || $doit $chgrpcmd "$dsttmp"; } \ && { test -z "$stripcmd" || $doit $stripcmd "$dsttmp"; } \ && { test -z "$chmodcmd" || $doit $chmodcmd "$dsttmp"; } && # Now rename the file to the real destination. { $doit $mvcmd -f "$dsttmp" "$dstdir/$dstfile" 2>/dev/null \ || { # The rename failed, perhaps because mv can't rename something else # to itself, or perhaps because mv is so ancient that it does not # support -f. # Now remove or move aside any old file at destination location. # We try this two ways since rm can't unlink itself on some # systems and the destination file might be busy for other # reasons. In this case, the final cleanup might fail but the new # file should still install successfully. { if test -f "$dstdir/$dstfile"; then $doit $rmcmd -f "$dstdir/$dstfile" 2>/dev/null \ || $doit $mvcmd -f "$dstdir/$dstfile" "$rmtmp" 2>/dev/null \ || { echo "$0: cannot unlink or rename $dstdir/$dstfile" >&2 (exit 1); exit } else : fi } && # Now rename the file to the real destination. $doit $mvcmd "$dsttmp" "$dstdir/$dstfile" } } fi || { (exit 1); exit; } done # The final little trick to "correctly" pass the exit status to the exit trap. { (exit 0); exit } # Local variables: # eval: (add-hook 'write-file-hooks 'time-stamp) # time-stamp-start: "scriptversion=" # time-stamp-format: "%:y-%02m-%02d.%02H" # time-stamp-end: "$" # End: tango-8.1.2c+dfsg.orig/config/config.guess0000755000175000017500000012753412205375077017404 0ustar piccapicca#! /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. timestamp='2008-01-23' # This file is free software; you can redistribute it and/or modify it # under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, but # WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA # 02110-1301, USA. # # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that program. # Originally written by Per Bothner . # Please send patches to . Submit a context # diff and a properly formatted ChangeLog entry. # # This script attempts to guess a canonical system name similar to # config.sub. If it succeeds, it prints the system name on stdout, and # exits with 0. Otherwise, it exits with 1. # # The plan is that this can be called by configure scripts if you # don't specify an explicit build system type. me=`echo "$0" | sed -e 's,.*/,,'` usage="\ Usage: $0 [OPTION] Output the configuration name of the system \`$me' is run on. Operation modes: -h, --help print this help, then exit -t, --time-stamp print date of last modification, then exit -v, --version print version number, then exit Report bugs and patches to ." version="\ 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. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." help=" Try \`$me --help' for more information." # Parse command line while test $# -gt 0 ; do case $1 in --time-stamp | --time* | -t ) echo "$timestamp" ; exit ;; --version | -v ) echo "$version" ; exit ;; --help | --h* | -h ) echo "$usage"; exit ;; -- ) # Stop option processing shift; break ;; - ) # Use stdin as input. break ;; -* ) echo "$me: invalid option $1$help" >&2 exit 1 ;; * ) break ;; esac done if test $# != 0; then echo "$me: too many arguments$help" >&2 exit 1 fi trap 'exit 1' 1 2 15 # CC_FOR_BUILD -- compiler used by this script. Note that the use of a # compiler to aid in system detection is discouraged as it requires # temporary files to be created and, as you can see below, it is a # headache to deal with in a portable fashion. # Historically, `CC_FOR_BUILD' used to be named `HOST_CC'. We still # use `HOST_CC' if defined, but it is deprecated. # Portable tmp directory creation inspired by the Autoconf team. set_cc_for_build=' trap "exitcode=\$?; (rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null) && exit \$exitcode" 0 ; trap "rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null; exit 1" 1 2 13 15 ; : ${TMPDIR=/tmp} ; { tmp=`(umask 077 && mktemp -d "$TMPDIR/cgXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" ; } || { test -n "$RANDOM" && tmp=$TMPDIR/cg$$-$RANDOM && (umask 077 && mkdir $tmp) ; } || { tmp=$TMPDIR/cg-$$ && (umask 077 && mkdir $tmp) && echo "Warning: creating insecure temp directory" >&2 ; } || { echo "$me: cannot create a temporary directory in $TMPDIR" >&2 ; exit 1 ; } ; dummy=$tmp/dummy ; tmpfiles="$dummy.c $dummy.o $dummy.rel $dummy" ; case $CC_FOR_BUILD,$HOST_CC,$CC in ,,) echo "int x;" > $dummy.c ; for c in cc gcc c89 c99 ; do if ($c -c -o $dummy.o $dummy.c) >/dev/null 2>&1 ; then CC_FOR_BUILD="$c"; break ; fi ; done ; if test x"$CC_FOR_BUILD" = x ; then CC_FOR_BUILD=no_compiler_found ; fi ;; ,,*) CC_FOR_BUILD=$CC ;; ,*,*) CC_FOR_BUILD=$HOST_CC ;; esac ; set_cc_for_build= ;' # This is needed to find uname on a Pyramid OSx when run in the BSD universe. # (ghazi@noc.rutgers.edu 1994-08-24) if (test -f /.attbin/uname) >/dev/null 2>&1 ; then PATH=$PATH:/.attbin ; export PATH fi UNAME_MACHINE=`(uname -m) 2>/dev/null` || UNAME_MACHINE=unknown UNAME_RELEASE=`(uname -r) 2>/dev/null` || UNAME_RELEASE=unknown UNAME_SYSTEM=`(uname -s) 2>/dev/null` || UNAME_SYSTEM=unknown UNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown # Note: order is significant - the case branches are not exclusive. case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in *:NetBSD:*:*) # NetBSD (nbsd) targets should (where applicable) match one or # more of the tupples: *-*-netbsdelf*, *-*-netbsdaout*, # *-*-netbsdecoff* and *-*-netbsd*. For targets that recently # switched to ELF, *-*-netbsd* would select the old # object file format. This provides both forward # compatibility and a consistent mechanism for selecting the # object file format. # # Note: NetBSD doesn't particularly care about the vendor # portion of the name. We always set it to "unknown". sysctl="sysctl -n hw.machine_arch" UNAME_MACHINE_ARCH=`(/sbin/$sysctl 2>/dev/null || \ /usr/sbin/$sysctl 2>/dev/null || echo unknown)` case "${UNAME_MACHINE_ARCH}" in armeb) machine=armeb-unknown ;; arm*) machine=arm-unknown ;; sh3el) machine=shl-unknown ;; sh3eb) machine=sh-unknown ;; sh5el) machine=sh5le-unknown ;; *) machine=${UNAME_MACHINE_ARCH}-unknown ;; esac # The Operating System including object format, if it has switched # to ELF recently, or will in the future. case "${UNAME_MACHINE_ARCH}" in arm*|i386|m68k|ns32k|sh3*|sparc|vax) eval $set_cc_for_build if echo __ELF__ | $CC_FOR_BUILD -E - 2>/dev/null \ | grep __ELF__ >/dev/null then # Once all utilities can be ECOFF (netbsdecoff) or a.out (netbsdaout). # Return netbsd for either. FIX? os=netbsd else os=netbsdelf fi ;; *) os=netbsd ;; esac # The OS release # Debian GNU/NetBSD machines have a different userland, and # thus, need a distinct triplet. However, they do not need # kernel version information, so it can be replaced with a # suitable tag, in the style of linux-gnu. case "${UNAME_VERSION}" in Debian*) release='-gnu' ;; *) release=`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'` ;; esac # Since CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM: # contains redundant information, the shorter form: # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used. echo "${machine}-${os}${release}" exit ;; *:OpenBSD:*:*) UNAME_MACHINE_ARCH=`arch | sed 's/OpenBSD.//'` echo ${UNAME_MACHINE_ARCH}-unknown-openbsd${UNAME_RELEASE} exit ;; *:ekkoBSD:*:*) echo ${UNAME_MACHINE}-unknown-ekkobsd${UNAME_RELEASE} exit ;; *:SolidBSD:*:*) echo ${UNAME_MACHINE}-unknown-solidbsd${UNAME_RELEASE} exit ;; macppc:MirBSD:*:*) echo powerpc-unknown-mirbsd${UNAME_RELEASE} exit ;; *:MirBSD:*:*) echo ${UNAME_MACHINE}-unknown-mirbsd${UNAME_RELEASE} exit ;; alpha:OSF1:*:*) case $UNAME_RELEASE in *4.0) UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $3}'` ;; *5.*) UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $4}'` ;; esac # According to Compaq, /usr/sbin/psrinfo has been available on # OSF/1 and Tru64 systems produced since 1995. I hope that # covers most systems running today. This code pipes the CPU # types through head -n 1, so we only detect the type of CPU 0. ALPHA_CPU_TYPE=`/usr/sbin/psrinfo -v | sed -n -e 's/^ The alpha \(.*\) processor.*$/\1/p' | head -n 1` case "$ALPHA_CPU_TYPE" in "EV4 (21064)") UNAME_MACHINE="alpha" ;; "EV4.5 (21064)") UNAME_MACHINE="alpha" ;; "LCA4 (21066/21068)") UNAME_MACHINE="alpha" ;; "EV5 (21164)") UNAME_MACHINE="alphaev5" ;; "EV5.6 (21164A)") UNAME_MACHINE="alphaev56" ;; "EV5.6 (21164PC)") UNAME_MACHINE="alphapca56" ;; "EV5.7 (21164PC)") UNAME_MACHINE="alphapca57" ;; "EV6 (21264)") UNAME_MACHINE="alphaev6" ;; "EV6.7 (21264A)") UNAME_MACHINE="alphaev67" ;; "EV6.8CB (21264C)") UNAME_MACHINE="alphaev68" ;; "EV6.8AL (21264B)") UNAME_MACHINE="alphaev68" ;; "EV6.8CX (21264D)") UNAME_MACHINE="alphaev68" ;; "EV6.9A (21264/EV69A)") UNAME_MACHINE="alphaev69" ;; "EV7 (21364)") UNAME_MACHINE="alphaev7" ;; "EV7.9 (21364A)") UNAME_MACHINE="alphaev79" ;; esac # A Pn.n version is a patched version. # A Vn.n version is a released version. # A Tn.n version is a released field test version. # A Xn.n version is an unreleased experimental baselevel. # 1.2 uses "1.2" for uname -r. echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[PVTX]//' | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` exit ;; Alpha\ *:Windows_NT*:*) # How do we know it's Interix rather than the generic POSIX subsystem? # Should we change UNAME_MACHINE based on the output of uname instead # of the specific Alpha model? echo alpha-pc-interix exit ;; 21064:Windows_NT:50:3) echo alpha-dec-winnt3.5 exit ;; Amiga*:UNIX_System_V:4.0:*) echo m68k-unknown-sysv4 exit ;; *:[Aa]miga[Oo][Ss]:*:*) echo ${UNAME_MACHINE}-unknown-amigaos exit ;; *:[Mm]orph[Oo][Ss]:*:*) echo ${UNAME_MACHINE}-unknown-morphos exit ;; *:OS/390:*:*) echo i370-ibm-openedition exit ;; *:z/VM:*:*) echo s390-ibm-zvmoe exit ;; *:OS400:*:*) echo powerpc-ibm-os400 exit ;; arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*) echo arm-acorn-riscix${UNAME_RELEASE} exit ;; arm:riscos:*:*|arm:RISCOS:*:*) echo arm-unknown-riscos exit ;; SR2?01:HI-UX/MPP:*:* | SR8000:HI-UX/MPP:*:*) echo hppa1.1-hitachi-hiuxmpp exit ;; Pyramid*:OSx*:*:* | MIS*:OSx*:*:* | MIS*:SMP_DC-OSx*:*:*) # akee@wpdis03.wpafb.af.mil (Earle F. Ake) contributed MIS and NILE. if test "`(/bin/universe) 2>/dev/null`" = att ; then echo pyramid-pyramid-sysv3 else echo pyramid-pyramid-bsd fi exit ;; NILE*:*:*:dcosx) echo pyramid-pyramid-svr4 exit ;; DRS?6000:unix:4.0:6*) echo sparc-icl-nx6 exit ;; DRS?6000:UNIX_SV:4.2*:7* | DRS?6000:isis:4.2*:7*) case `/usr/bin/uname -p` in sparc) echo sparc-icl-nx7; exit ;; esac ;; sun4H:SunOS:5.*:*) echo sparc-hal-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit ;; sun4*:SunOS:5.*:* | tadpole*:SunOS:5.*:*) echo sparc-sun-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit ;; i86pc:SunOS:5.*:* | i86xen:SunOS:5.*:*) echo i386-pc-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit ;; sun4*:SunOS:6*:*) # According to config.sub, this is the proper way to canonicalize # SunOS6. Hard to guess exactly what SunOS6 will be like, but # it's likely to be more like Solaris than SunOS4. echo sparc-sun-solaris3`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit ;; sun4*:SunOS:*:*) case "`/usr/bin/arch -k`" in Series*|S4*) UNAME_RELEASE=`uname -v` ;; esac # Japanese Language versions have a version number like `4.1.3-JL'. echo sparc-sun-sunos`echo ${UNAME_RELEASE}|sed -e 's/-/_/'` exit ;; sun3*:SunOS:*:*) echo m68k-sun-sunos${UNAME_RELEASE} exit ;; sun*:*:4.2BSD:*) UNAME_RELEASE=`(sed 1q /etc/motd | awk '{print substr($5,1,3)}') 2>/dev/null` test "x${UNAME_RELEASE}" = "x" && UNAME_RELEASE=3 case "`/bin/arch`" in sun3) echo m68k-sun-sunos${UNAME_RELEASE} ;; sun4) echo sparc-sun-sunos${UNAME_RELEASE} ;; esac exit ;; aushp:SunOS:*:*) echo sparc-auspex-sunos${UNAME_RELEASE} exit ;; # The situation for MiNT is a little confusing. The machine name # can be virtually everything (everything which is not # "atarist" or "atariste" at least should have a processor # > m68000). The system name ranges from "MiNT" over "FreeMiNT" # to the lowercase version "mint" (or "freemint"). Finally # the system name "TOS" denotes a system which is actually not # MiNT. But MiNT is downward compatible to TOS, so this should # be no problem. atarist[e]:*MiNT:*:* | atarist[e]:*mint:*:* | atarist[e]:*TOS:*:*) echo m68k-atari-mint${UNAME_RELEASE} exit ;; atari*:*MiNT:*:* | atari*:*mint:*:* | atarist[e]:*TOS:*:*) echo m68k-atari-mint${UNAME_RELEASE} exit ;; *falcon*:*MiNT:*:* | *falcon*:*mint:*:* | *falcon*:*TOS:*:*) echo m68k-atari-mint${UNAME_RELEASE} exit ;; milan*:*MiNT:*:* | milan*:*mint:*:* | *milan*:*TOS:*:*) echo m68k-milan-mint${UNAME_RELEASE} exit ;; hades*:*MiNT:*:* | hades*:*mint:*:* | *hades*:*TOS:*:*) echo m68k-hades-mint${UNAME_RELEASE} exit ;; *:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*) echo m68k-unknown-mint${UNAME_RELEASE} exit ;; m68k:machten:*:*) echo m68k-apple-machten${UNAME_RELEASE} exit ;; powerpc:machten:*:*) echo powerpc-apple-machten${UNAME_RELEASE} exit ;; RISC*:Mach:*:*) echo mips-dec-mach_bsd4.3 exit ;; RISC*:ULTRIX:*:*) echo mips-dec-ultrix${UNAME_RELEASE} exit ;; VAX*:ULTRIX*:*:*) echo vax-dec-ultrix${UNAME_RELEASE} exit ;; 2020:CLIX:*:* | 2430:CLIX:*:*) echo clipper-intergraph-clix${UNAME_RELEASE} exit ;; mips:*:*:UMIPS | mips:*:*:RISCos) eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #ifdef __cplusplus #include /* for printf() prototype */ int main (int argc, char *argv[]) { #else int main (argc, argv) int argc; char *argv[]; { #endif #if defined (host_mips) && defined (MIPSEB) #if defined (SYSTYPE_SYSV) printf ("mips-mips-riscos%ssysv\n", argv[1]); exit (0); #endif #if defined (SYSTYPE_SVR4) printf ("mips-mips-riscos%ssvr4\n", argv[1]); exit (0); #endif #if defined (SYSTYPE_BSD43) || defined(SYSTYPE_BSD) printf ("mips-mips-riscos%sbsd\n", argv[1]); exit (0); #endif #endif exit (-1); } EOF $CC_FOR_BUILD -o $dummy $dummy.c && dummyarg=`echo "${UNAME_RELEASE}" | sed -n 's/\([0-9]*\).*/\1/p'` && SYSTEM_NAME=`$dummy $dummyarg` && { echo "$SYSTEM_NAME"; exit; } echo mips-mips-riscos${UNAME_RELEASE} exit ;; Motorola:PowerMAX_OS:*:*) echo powerpc-motorola-powermax exit ;; Motorola:*:4.3:PL8-*) echo powerpc-harris-powermax exit ;; Night_Hawk:*:*:PowerMAX_OS | Synergy:PowerMAX_OS:*:*) echo powerpc-harris-powermax exit ;; Night_Hawk:Power_UNIX:*:*) echo powerpc-harris-powerunix exit ;; m88k:CX/UX:7*:*) echo m88k-harris-cxux7 exit ;; m88k:*:4*:R4*) echo m88k-motorola-sysv4 exit ;; m88k:*:3*:R3*) echo m88k-motorola-sysv3 exit ;; AViiON:dgux:*:*) # DG/UX returns AViiON for all architectures UNAME_PROCESSOR=`/usr/bin/uname -p` if [ $UNAME_PROCESSOR = mc88100 ] || [ $UNAME_PROCESSOR = mc88110 ] then if [ ${TARGET_BINARY_INTERFACE}x = m88kdguxelfx ] || \ [ ${TARGET_BINARY_INTERFACE}x = x ] then echo m88k-dg-dgux${UNAME_RELEASE} else echo m88k-dg-dguxbcs${UNAME_RELEASE} fi else echo i586-dg-dgux${UNAME_RELEASE} fi exit ;; M88*:DolphinOS:*:*) # DolphinOS (SVR3) echo m88k-dolphin-sysv3 exit ;; M88*:*:R3*:*) # Delta 88k system running SVR3 echo m88k-motorola-sysv3 exit ;; XD88*:*:*:*) # Tektronix XD88 system running UTekV (SVR3) echo m88k-tektronix-sysv3 exit ;; Tek43[0-9][0-9]:UTek:*:*) # Tektronix 4300 system running UTek (BSD) echo m68k-tektronix-bsd exit ;; *:IRIX*:*:*) echo mips-sgi-irix`echo ${UNAME_RELEASE}|sed -e 's/-/_/g'` exit ;; ????????:AIX?:[12].1:2) # AIX 2.2.1 or AIX 2.1.1 is RT/PC AIX. echo romp-ibm-aix # uname -m gives an 8 hex-code CPU id exit ;; # Note that: echo "'`uname -s`'" gives 'AIX ' i*86:AIX:*:*) echo i386-ibm-aix exit ;; ia64:AIX:*:*) if [ -x /usr/bin/oslevel ] ; then IBM_REV=`/usr/bin/oslevel` else IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE} fi echo ${UNAME_MACHINE}-ibm-aix${IBM_REV} exit ;; *:AIX:2:3) if grep bos325 /usr/include/stdio.h >/dev/null 2>&1; then eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #include main() { if (!__power_pc()) exit(1); puts("powerpc-ibm-aix3.2.5"); exit(0); } EOF if $CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy` then echo "$SYSTEM_NAME" else echo rs6000-ibm-aix3.2.5 fi elif grep bos324 /usr/include/stdio.h >/dev/null 2>&1; then echo rs6000-ibm-aix3.2.4 else echo rs6000-ibm-aix3.2 fi exit ;; *:AIX:*:[456]) IBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | sed 1q | awk '{ print $1 }'` if /usr/sbin/lsattr -El ${IBM_CPU_ID} | grep ' POWER' >/dev/null 2>&1; then IBM_ARCH=rs6000 else IBM_ARCH=powerpc fi if [ -x /usr/bin/oslevel ] ; then IBM_REV=`/usr/bin/oslevel` else IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE} fi echo ${IBM_ARCH}-ibm-aix${IBM_REV} exit ;; *:AIX:*:*) echo rs6000-ibm-aix exit ;; ibmrt:4.4BSD:*|romp-ibm:BSD:*) echo romp-ibm-bsd4.4 exit ;; ibmrt:*BSD:*|romp-ibm:BSD:*) # covers RT/PC BSD and echo romp-ibm-bsd${UNAME_RELEASE} # 4.3 with uname added to exit ;; # report: romp-ibm BSD 4.3 *:BOSX:*:*) echo rs6000-bull-bosx exit ;; DPX/2?00:B.O.S.:*:*) echo m68k-bull-sysv3 exit ;; 9000/[34]??:4.3bsd:1.*:*) echo m68k-hp-bsd exit ;; hp300:4.4BSD:*:* | 9000/[34]??:4.3bsd:2.*:*) echo m68k-hp-bsd4.4 exit ;; 9000/[34678]??:HP-UX:*:*) HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'` case "${UNAME_MACHINE}" in 9000/31? ) HP_ARCH=m68000 ;; 9000/[34]?? ) HP_ARCH=m68k ;; 9000/[678][0-9][0-9]) if [ -x /usr/bin/getconf ]; then sc_cpu_version=`/usr/bin/getconf SC_CPU_VERSION 2>/dev/null` sc_kernel_bits=`/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null` case "${sc_cpu_version}" in 523) HP_ARCH="hppa1.0" ;; # CPU_PA_RISC1_0 528) HP_ARCH="hppa1.1" ;; # CPU_PA_RISC1_1 532) # CPU_PA_RISC2_0 case "${sc_kernel_bits}" in 32) HP_ARCH="hppa2.0n" ;; 64) HP_ARCH="hppa2.0w" ;; '') HP_ARCH="hppa2.0" ;; # HP-UX 10.20 esac ;; esac fi if [ "${HP_ARCH}" = "" ]; then eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #define _HPUX_SOURCE #include #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 fi ;; esac if [ ${HP_ARCH} = "hppa2.0w" ] then eval $set_cc_for_build # hppa2.0w-hp-hpux* has a 64-bit kernel and a compiler generating # 32-bit code. hppa64-hp-hpux* has the same kernel and a compiler # generating 64-bit code. GNU and HP use different nomenclature: # # $ CC_FOR_BUILD=cc ./config.guess # => hppa2.0w-hp-hpux11.23 # $ CC_FOR_BUILD="cc +DA2.0w" ./config.guess # => hppa64-hp-hpux11.23 if echo __LP64__ | (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | grep __LP64__ >/dev/null then HP_ARCH="hppa2.0w" else HP_ARCH="hppa64" fi fi echo ${HP_ARCH}-hp-hpux${HPUX_REV} exit ;; ia64:HP-UX:*:*) HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'` echo ia64-hp-hpux${HPUX_REV} exit ;; 3050*:HI-UX:*:*) eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #include int main () { long cpu = sysconf (_SC_CPU_VERSION); /* The order matters, because CPU_IS_HP_MC68K erroneously returns true for CPU_PA_RISC1_0. CPU_IS_PA_RISC returns correct results, however. */ if (CPU_IS_PA_RISC (cpu)) { switch (cpu) { case CPU_PA_RISC1_0: puts ("hppa1.0-hitachi-hiuxwe2"); break; case CPU_PA_RISC1_1: puts ("hppa1.1-hitachi-hiuxwe2"); break; case CPU_PA_RISC2_0: puts ("hppa2.0-hitachi-hiuxwe2"); break; default: puts ("hppa-hitachi-hiuxwe2"); break; } } else if (CPU_IS_HP_MC68K (cpu)) puts ("m68k-hitachi-hiuxwe2"); else puts ("unknown-hitachi-hiuxwe2"); exit (0); } EOF $CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy` && { echo "$SYSTEM_NAME"; exit; } echo unknown-hitachi-hiuxwe2 exit ;; 9000/7??:4.3bsd:*:* | 9000/8?[79]:4.3bsd:*:* ) echo hppa1.1-hp-bsd exit ;; 9000/8??:4.3bsd:*:*) echo hppa1.0-hp-bsd exit ;; *9??*:MPE/iX:*:* | *3000*:MPE/iX:*:*) echo hppa1.0-hp-mpeix exit ;; hp7??:OSF1:*:* | hp8?[79]:OSF1:*:* ) echo hppa1.1-hp-osf exit ;; hp8??:OSF1:*:*) echo hppa1.0-hp-osf exit ;; i*86:OSF1:*:*) if [ -x /usr/sbin/sysversion ] ; then echo ${UNAME_MACHINE}-unknown-osf1mk else echo ${UNAME_MACHINE}-unknown-osf1 fi exit ;; parisc*:Lites*:*:*) echo hppa1.1-hp-lites exit ;; C1*:ConvexOS:*:* | convex:ConvexOS:C1*:*) echo c1-convex-bsd exit ;; C2*:ConvexOS:*:* | convex:ConvexOS:C2*:*) if getsysinfo -f scalar_acc then echo c32-convex-bsd else echo c2-convex-bsd fi exit ;; C34*:ConvexOS:*:* | convex:ConvexOS:C34*:*) echo c34-convex-bsd exit ;; C38*:ConvexOS:*:* | convex:ConvexOS:C38*:*) echo c38-convex-bsd exit ;; C4*:ConvexOS:*:* | convex:ConvexOS:C4*:*) echo c4-convex-bsd exit ;; CRAY*Y-MP:*:*:*) echo ymp-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit ;; CRAY*[A-Z]90:*:*:*) echo ${UNAME_MACHINE}-cray-unicos${UNAME_RELEASE} \ | sed -e 's/CRAY.*\([A-Z]90\)/\1/' \ -e y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/ \ -e 's/\.[^.]*$/.X/' exit ;; CRAY*TS:*:*:*) echo t90-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit ;; CRAY*T3E:*:*:*) echo alphaev5-cray-unicosmk${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit ;; CRAY*SV1:*:*:*) echo sv1-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit ;; *:UNICOS/mp:*:*) echo craynv-cray-unicosmp${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' 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 ;; 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}" exit ;; i*86:BSD/386:*:* | i*86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*) echo ${UNAME_MACHINE}-pc-bsdi${UNAME_RELEASE} exit ;; sparc*:BSD/OS:*:*) echo sparc-unknown-bsdi${UNAME_RELEASE} exit ;; *:BSD/OS:*:*) echo ${UNAME_MACHINE}-unknown-bsdi${UNAME_RELEASE} exit ;; *:FreeBSD:*:*) case ${UNAME_MACHINE} in pc98) echo i386-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;; amd64) echo x86_64-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;; *) echo ${UNAME_MACHINE}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;; esac exit ;; i*:CYGWIN*:*) echo ${UNAME_MACHINE}-pc-cygwin exit ;; *:MINGW*:*) echo ${UNAME_MACHINE}-pc-mingw32 exit ;; i*:windows32*:*) # 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 x86) echo i586-pc-interix${UNAME_RELEASE} exit ;; EM64T | authenticamd) echo x86_64-unknown-interix${UNAME_RELEASE} exit ;; IA64) echo ia64-unknown-interix${UNAME_RELEASE} exit ;; esac ;; [345]86:Windows_95:* | [345]86:Windows_98:* | [345]86:Windows_NT:*) echo i${UNAME_MACHINE}-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 # UNAME_MACHINE based on the output of uname instead of i386? echo i586-pc-interix exit ;; i*:UWIN*:*) echo ${UNAME_MACHINE}-pc-uwin exit ;; amd64:CYGWIN*:*:* | x86_64:CYGWIN*:*:*) echo x86_64-unknown-cygwin exit ;; p*:CYGWIN*:*) echo powerpcle-unknown-cygwin exit ;; prep*:SunOS:5.*:*) echo powerpcle-unknown-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit ;; *:GNU:*:*) # the GNU system echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-gnu`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'` exit ;; *:GNU/*:*:*) # other systems with GNU libc and userland echo ${UNAME_MACHINE}-unknown-`echo ${UNAME_SYSTEM} | sed 's,^[^/]*/,,' | tr '[A-Z]' '[a-z]'``echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`-gnu exit ;; i*86:Minix:*:*) echo ${UNAME_MACHINE}-pc-minix exit ;; arm*:Linux:*:*) eval $set_cc_for_build if echo __ARM_EABI__ | $CC_FOR_BUILD -E - 2>/dev/null \ | grep -q __ARM_EABI__ then echo ${UNAME_MACHINE}-unknown-linux-gnu else echo ${UNAME_MACHINE}-unknown-linux-gnueabi fi exit ;; avr32*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; cris:Linux:*:*) echo cris-axis-linux-gnu exit ;; crisv32:Linux:*:*) echo crisv32-axis-linux-gnu exit ;; frv:Linux:*:*) echo frv-unknown-linux-gnu exit ;; ia64:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; m32r*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; m68*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; mips:Linux:*:*) eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #undef CPU #undef mips #undef mipsel #if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL) CPU=mipsel #else #if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB) CPU=mips #else CPU= #endif #endif EOF eval "`$CC_FOR_BUILD -E $dummy.c 2>/dev/null | 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 }'`" 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} exit ;; parisc:Linux:*:* | hppa:Linux:*:*) # Look for CPU level case `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in PA7*) echo hppa1.1-unknown-linux-gnu ;; PA8*) echo hppa2.0-unknown-linux-gnu ;; *) echo hppa-unknown-linux-gnu ;; esac exit ;; parisc64:Linux:*:* | hppa64:Linux:*:*) echo hppa64-unknown-linux-gnu exit ;; s390:Linux:*:* | s390x:Linux:*:*) echo ${UNAME_MACHINE}-ibm-linux exit ;; sh64*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; sh*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; sparc:Linux:*:* | sparc64: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 exit ;; xtensa*:Linux:*:*) 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 ;; coff-i386) echo "${UNAME_MACHINE}-pc-linux-gnucoff" 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 # sysname and nodename. 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, # I just have to hope. -- rms. # Use sysv4.2uw... so that sysv4* matches it. echo ${UNAME_MACHINE}-pc-sysv4.2uw${UNAME_VERSION} exit ;; i*86:OS/2:*:*) # If we were able to find `uname', then EMX Unix compatibility # is probably installed. echo ${UNAME_MACHINE}-pc-os2-emx exit ;; i*86:XTS-300:*:STOP) echo ${UNAME_MACHINE}-unknown-stop exit ;; i*86:atheos:*:*) echo ${UNAME_MACHINE}-unknown-atheos exit ;; i*86:syllable:*:*) echo ${UNAME_MACHINE}-pc-syllable exit ;; i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.0*:*) echo i386-unknown-lynxos${UNAME_RELEASE} exit ;; i*86:*DOS:*:*) echo ${UNAME_MACHINE}-pc-msdosdjgpp exit ;; i*86:*:4.*:* | i*86:SYSTEM_V:4.*:*) UNAME_REL=`echo ${UNAME_RELEASE} | sed 's/\/MP$//'` if grep Novell /usr/include/link.h >/dev/null 2>/dev/null; then echo ${UNAME_MACHINE}-univel-sysv${UNAME_REL} else echo ${UNAME_MACHINE}-pc-sysv${UNAME_REL} fi exit ;; i*86:*:5:[678]*) # UnixWare 7.x, OpenUNIX and OpenServer 6. case `/bin/uname -X | grep "^Machine"` in *486*) UNAME_MACHINE=i486 ;; *Pentium) UNAME_MACHINE=i586 ;; *Pent*|*Celeron) UNAME_MACHINE=i686 ;; esac echo ${UNAME_MACHINE}-unknown-sysv${UNAME_RELEASE}${UNAME_SYSTEM}${UNAME_VERSION} exit ;; i*86:*:3.2:*) if test -f /usr/options/cb.name; then UNAME_REL=`sed -n 's/.*Version //p' /dev/null >/dev/null ; then UNAME_REL=`(/bin/uname -X|grep Release|sed -e 's/.*= //')` (/bin/uname -X|grep i80486 >/dev/null) && UNAME_MACHINE=i486 (/bin/uname -X|grep '^Machine.*Pentium' >/dev/null) \ && UNAME_MACHINE=i586 (/bin/uname -X|grep '^Machine.*Pent *II' >/dev/null) \ && UNAME_MACHINE=i686 (/bin/uname -X|grep '^Machine.*Pentium Pro' >/dev/null) \ && UNAME_MACHINE=i686 echo ${UNAME_MACHINE}-pc-sco$UNAME_REL else echo ${UNAME_MACHINE}-pc-sysv32 fi 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 i386. echo i386-pc-msdosdjgpp exit ;; Intel:Mach:3*:*) echo i386-pc-mach3 exit ;; paragon:*:*:*) echo i860-intel-osf1 exit ;; i860:*:4.*:*) # i860-SVR4 if grep Stardent /usr/include/sys/uadmin.h >/dev/null 2>&1 ; then echo i860-stardent-sysv${UNAME_RELEASE} # Stardent Vistra i860-SVR4 else # Add other i860-SVR4 vendors below as they are discovered. echo i860-unknown-sysv${UNAME_RELEASE} # Unknown i860-SVR4 fi exit ;; mini*:CTIX:SYS*5:*) # "miniframe" echo m68010-convergent-sysv exit ;; mc68k:UNIX:SYSTEM5:3.51m) echo m68k-convergent-sysv exit ;; M680?0:D-NIX:5.3:*) echo m68k-diab-dnix exit ;; M68*:*:R3V[5678]*:*) test -r /sysV68 && { echo 'm68k-motorola-sysv'; exit; } ;; 3[345]??:*:4.0:3.0 | 3[34]??A:*:4.0:3.0 | 3[34]??,*:*:4.0:3.0 | 3[34]??/*:*:4.0:3.0 | 4400:*:4.0:3.0 | 4850:*:4.0:3.0 | SKA40:*:4.0:3.0 | SDS2:*:4.0:3.0 | SHG2:*:4.0:3.0 | S7501*:*:4.0:3.0) OS_REL='' test -r /etc/.relid \ && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid` /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ && { echo i486-ncr-sysv4.3${OS_REL}; exit; } /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; } ;; m68*:LynxOS:2.*:* | m68*:LynxOS:3.0*:*) echo m68k-unknown-lynxos${UNAME_RELEASE} exit ;; mc68030:UNIX_System_V:4.*:*) echo m68k-atari-sysv4 exit ;; TSUNAMI:LynxOS:2.*:*) echo sparc-unknown-lynxos${UNAME_RELEASE} exit ;; rs6000:LynxOS:2.*:*) echo rs6000-unknown-lynxos${UNAME_RELEASE} exit ;; PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:* | PowerPC:LynxOS:4.0*:*) echo powerpc-unknown-lynxos${UNAME_RELEASE} exit ;; SM[BE]S:UNIX_SV:*:*) echo mips-dde-sysv${UNAME_RELEASE} exit ;; RM*:ReliantUNIX-*:*:*) echo mips-sni-sysv4 exit ;; RM*:SINIX-*:*:*) echo mips-sni-sysv4 exit ;; *:SINIX-*:*:*) if uname -p 2>/dev/null >/dev/null ; then UNAME_MACHINE=`(uname -p) 2>/dev/null` echo ${UNAME_MACHINE}-sni-sysv4 else echo ns32k-sni-sysv fi exit ;; 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 echo hppa1.1-stratus-sysv4 exit ;; *:*:*:FTX*) # From seanf@swdc.stratus.com. echo i860-stratus-sysv4 exit ;; i*86:VOS:*:*) # From Paul.Green@stratus.com. echo ${UNAME_MACHINE}-stratus-vos exit ;; *:VOS:*:*) # From Paul.Green@stratus.com. echo hppa1.1-stratus-vos exit ;; mc68*:A/UX:*:*) echo m68k-apple-aux${UNAME_RELEASE} exit ;; news*:NEWS-OS:6*:*) echo mips-sony-newsos6 exit ;; R[34]000:*System_V*:*:* | R4000:UNIX_SYSV:*:* | R*000:UNIX_SV:*:*) if [ -d /usr/nec ]; then echo mips-nec-sysv${UNAME_RELEASE} else echo mips-unknown-sysv${UNAME_RELEASE} fi exit ;; BeBox:BeOS:*:*) # BeOS running on hardware made by Be, PPC only. echo powerpc-be-beos exit ;; BeMac:BeOS:*:*) # BeOS running on Mac or Mac clone, PPC only. echo powerpc-apple-beos exit ;; BePC:BeOS:*:*) # BeOS running on Intel PC compatible. echo i586-pc-beos exit ;; SX-4:SUPER-UX:*:*) echo sx4-nec-superux${UNAME_RELEASE} exit ;; SX-5:SUPER-UX:*:*) echo sx5-nec-superux${UNAME_RELEASE} exit ;; SX-6:SUPER-UX:*:*) echo sx6-nec-superux${UNAME_RELEASE} exit ;; SX-7:SUPER-UX:*:*) echo sx7-nec-superux${UNAME_RELEASE} exit ;; SX-8:SUPER-UX:*:*) echo sx8-nec-superux${UNAME_RELEASE} exit ;; SX-8R:SUPER-UX:*:*) echo sx8r-nec-superux${UNAME_RELEASE} exit ;; Power*:Rhapsody:*:*) echo powerpc-apple-rhapsody${UNAME_RELEASE} exit ;; *:Rhapsody:*:*) echo ${UNAME_MACHINE}-apple-rhapsody${UNAME_RELEASE} exit ;; *:Darwin:*:*) UNAME_PROCESSOR=`uname -p` || UNAME_PROCESSOR=unknown case $UNAME_PROCESSOR in unknown) UNAME_PROCESSOR=powerpc ;; esac echo ${UNAME_PROCESSOR}-apple-darwin${UNAME_RELEASE} exit ;; *:procnto*:*:* | *:QNX:[0123456789]*:*) UNAME_PROCESSOR=`uname -p` if test "$UNAME_PROCESSOR" = "x86"; then UNAME_PROCESSOR=i386 UNAME_MACHINE=pc fi echo ${UNAME_PROCESSOR}-${UNAME_MACHINE}-nto-qnx${UNAME_RELEASE} exit ;; *:QNX:*:4*) echo i386-pc-qnx exit ;; NSE-?:NONSTOP_KERNEL:*:*) echo nse-tandem-nsk${UNAME_RELEASE} exit ;; NSR-?:NONSTOP_KERNEL:*:*) echo nsr-tandem-nsk${UNAME_RELEASE} exit ;; *:NonStop-UX:*:*) echo mips-compaq-nonstopux exit ;; BS2000:POSIX*:*:*) echo bs2000-siemens-sysv exit ;; DS/*:UNIX_System_V:*:*) echo ${UNAME_MACHINE}-${UNAME_SYSTEM}-${UNAME_RELEASE} exit ;; *:Plan9:*:*) # "uname -m" is not consistent, so use $cputype instead. 386 # is converted to i386 for consistency with other x86 # operating systems. if test "$cputype" = "386"; then UNAME_MACHINE=i386 else UNAME_MACHINE="$cputype" fi echo ${UNAME_MACHINE}-unknown-plan9 exit ;; *:TOPS-10:*:*) echo pdp10-unknown-tops10 exit ;; *:TENEX:*:*) echo pdp10-unknown-tenex exit ;; KS10:TOPS-20:*:* | KL10:TOPS-20:*:* | TYPE4:TOPS-20:*:*) echo pdp10-dec-tops20 exit ;; XKL-1:TOPS-20:*:* | TYPE5:TOPS-20:*:*) echo pdp10-xkl-tops20 exit ;; *:TOPS-20:*:*) echo pdp10-unknown-tops20 exit ;; *:ITS:*:*) echo pdp10-unknown-its exit ;; SEI:*:*:SEIUX) 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` case "${UNAME_MACHINE}" in A*) echo alpha-dec-vms ; exit ;; I*) echo ia64-dec-vms ; exit ;; V*) echo vax-dec-vms ; exit ;; esac ;; *:XENIX:*:SysV) echo i386-pc-xenix exit ;; i*86:skyos:*:*) echo ${UNAME_MACHINE}-pc-skyos`echo ${UNAME_RELEASE}` | sed -e 's/ .*$//' exit ;; i*86:rdos:*:*) echo ${UNAME_MACHINE}-pc-rdos exit ;; esac #echo '(No uname command or uname output not recognized.)' 1>&2 #echo "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" 1>&2 eval $set_cc_for_build cat >$dummy.c < # include #endif main () { #if defined (sony) #if defined (MIPSEB) /* BFD wants "bsd" instead of "newsos". Perhaps BFD should be changed, I don't know.... */ printf ("mips-sony-bsd\n"); exit (0); #else #include printf ("m68k-sony-newsos%s\n", #ifdef NEWSOS4 "4" #else "" #endif ); exit (0); #endif #endif #if defined (__arm) && defined (__acorn) && defined (__unix) printf ("arm-acorn-riscix\n"); exit (0); #endif #if defined (hp300) && !defined (hpux) printf ("m68k-hp-bsd\n"); exit (0); #endif #if defined (NeXT) #if !defined (__ARCHITECTURE__) #define __ARCHITECTURE__ "m68k" #endif int version; version=`(hostinfo | sed -n 's/.*NeXT Mach \([0-9]*\).*/\1/p') 2>/dev/null`; if (version < 4) printf ("%s-next-nextstep%d\n", __ARCHITECTURE__, version); else printf ("%s-next-openstep%d\n", __ARCHITECTURE__, version); exit (0); #endif #if defined (MULTIMAX) || defined (n16) #if defined (UMAXV) printf ("ns32k-encore-sysv\n"); exit (0); #else #if defined (CMU) printf ("ns32k-encore-mach\n"); exit (0); #else printf ("ns32k-encore-bsd\n"); exit (0); #endif #endif #endif #if defined (__386BSD__) printf ("i386-pc-bsd\n"); exit (0); #endif #if defined (sequent) #if defined (i386) printf ("i386-sequent-dynix\n"); exit (0); #endif #if defined (ns32000) printf ("ns32k-sequent-dynix\n"); exit (0); #endif #endif #if defined (_SEQUENT_) struct utsname un; uname(&un); if (strncmp(un.version, "V2", 2) == 0) { printf ("i386-sequent-ptx2\n"); exit (0); } if (strncmp(un.version, "V1", 2) == 0) { /* XXX is V1 correct? */ printf ("i386-sequent-ptx1\n"); exit (0); } printf ("i386-sequent-ptx\n"); exit (0); #endif #if defined (vax) # if !defined (ultrix) # include # if defined (BSD) # if BSD == 43 printf ("vax-dec-bsd4.3\n"); exit (0); # else # if BSD == 199006 printf ("vax-dec-bsd4.3reno\n"); exit (0); # else printf ("vax-dec-bsd\n"); exit (0); # endif # endif # else printf ("vax-dec-bsd\n"); exit (0); # endif # else printf ("vax-dec-ultrix\n"); exit (0); # endif #endif #if defined (alliant) && defined (i860) printf ("i860-alliant-bsd\n"); exit (0); #endif exit (1); } EOF $CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null && SYSTEM_NAME=`$dummy` && { echo "$SYSTEM_NAME"; exit; } # Apollos put the system type in the environment. test -d /usr/apollo && { echo ${ISP}-apollo-${SYSTYPE}; exit; } # Convex versions that predate uname can use getsysinfo(1) if [ -x /usr/convex/getsysinfo ] then case `getsysinfo -f cpu_type` in c1*) echo c1-convex-bsd exit ;; c2*) if getsysinfo -f scalar_acc then echo c32-convex-bsd else echo c2-convex-bsd fi exit ;; c34*) echo c34-convex-bsd exit ;; c38*) echo c38-convex-bsd exit ;; c4*) echo c4-convex-bsd exit ;; esac fi cat >&2 < in order to provide the needed information to handle your system. config.guess timestamp = $timestamp uname -m = `(uname -m) 2>/dev/null || echo unknown` uname -r = `(uname -r) 2>/dev/null || echo unknown` uname -s = `(uname -s) 2>/dev/null || echo unknown` uname -v = `(uname -v) 2>/dev/null || echo unknown` /usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null` /bin/uname -X = `(/bin/uname -X) 2>/dev/null` hostinfo = `(hostinfo) 2>/dev/null` /bin/universe = `(/bin/universe) 2>/dev/null` /usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null` /bin/arch = `(/bin/arch) 2>/dev/null` /usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null` /usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null` UNAME_MACHINE = ${UNAME_MACHINE} UNAME_RELEASE = ${UNAME_RELEASE} UNAME_SYSTEM = ${UNAME_SYSTEM} UNAME_VERSION = ${UNAME_VERSION} EOF exit 1 # Local variables: # eval: (add-hook 'write-file-hooks 'time-stamp) # time-stamp-start: "timestamp='" # time-stamp-format: "%:y-%02m-%02d" # time-stamp-end: "'" # End: tango-8.1.2c+dfsg.orig/config/config.sub0000755000175000017500000010115312205375077017034 0ustar piccapicca#! /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. timestamp='2008-01-16' # This file is (in principle) common to ALL GNU software. # The presence of a machine in this file suggests that SOME GNU software # can handle that machine. It does not imply ALL GNU software can. # # This file is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA # 02110-1301, USA. # # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that program. # Please send patches to . Submit a context # diff and a properly formatted ChangeLog entry. # # Configuration subroutine to validate and canonicalize a configuration type. # Supply the specified configuration type as an argument. # If it is invalid, we print an error message on stderr and exit with code 1. # Otherwise, we print the canonical config type on stdout and succeed. # This file is supposed to be the same for all GNU packages # and recognize all the CPU types, system types and aliases # that are meaningful with *any* GNU software. # Each package is responsible for reporting which valid configurations # it does not support. The user should be able to distinguish # a failure to support a valid configuration from a meaningless # configuration. # The goal of this file is to map all the various variations of a given # machine specification into a single specification in the form: # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM # or in some cases, the newer four-part form: # CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM # It is wrong to echo any other type of specification. me=`echo "$0" | sed -e 's,.*/,,'` usage="\ Usage: $0 [OPTION] CPU-MFR-OPSYS $0 [OPTION] ALIAS Canonicalize a configuration name. Operation modes: -h, --help print this help, then exit -t, --time-stamp print date of last modification, then exit -v, --version print version number, then exit Report bugs and patches to ." 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. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." help=" Try \`$me --help' for more information." # Parse command line while test $# -gt 0 ; do case $1 in --time-stamp | --time* | -t ) echo "$timestamp" ; exit ;; --version | -v ) echo "$version" ; exit ;; --help | --h* | -h ) echo "$usage"; exit ;; -- ) # Stop option processing shift; break ;; - ) # Use stdin as input. break ;; -* ) echo "$me: invalid option $1$help" exit 1 ;; *local*) # First pass through any local machine types. echo $1 exit ;; * ) break ;; esac done case $# in 0) echo "$me: missing argument$help" >&2 exit 1;; 1) ;; *) echo "$me: too many arguments$help" >&2 exit 1;; esac # Separate what the user gave into CPU-COMPANY and OS or KERNEL-OS (if any). # Here we must recognize all the valid KERNEL-OS combinations. maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'` case $maybe_os in nto-qnx* | linux-gnu* | linux-dietlibc | linux-newlib* | linux-uclibc* | \ uclinux-uclibc* | uclinux-gnu* | kfreebsd*-gnu* | knetbsd*-gnu* | netbsd*-gnu* | \ storm-chaos* | os2-emx* | rtmk-nova*) os=-$maybe_os basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'` ;; *) basic_machine=`echo $1 | sed 's/-[^-]*$//'` if [ $basic_machine != $1 ] then os=`echo $1 | sed 's/.*-/-/'` else os=; fi ;; esac ### Let's recognize common machines as not being operating systems so ### that things like config.sub decstation-3100 work. We also ### recognize some manufacturers as not being operating systems, so we ### can provide default operating systems below. case $os in -sun*os*) # Prevent following clause from handling this invalid input. ;; -dec* | -mips* | -sequent* | -encore* | -pc532* | -sgi* | -sony* | \ -att* | -7300* | -3300* | -delta* | -motorola* | -sun[234]* | \ -unicom* | -ibm* | -next | -hp | -isi* | -apollo | -altos* | \ -convergent* | -ncr* | -news | -32* | -3600* | -3100* | -hitachi* |\ -c[123]* | -convex* | -sun | -crds | -omron* | -dg | -ultra | -tti* | \ -harris | -dolphin | -highlevel | -gould | -cbm | -ns | -masscomp | \ -apple | -axis | -knuth | -cray) os= basic_machine=$1 ;; -sim | -cisco | -oki | -wec | -winbond) os= basic_machine=$1 ;; -scout) ;; -wrs) os=-vxworks basic_machine=$1 ;; -chorusos*) os=-chorusos basic_machine=$1 ;; -chorusrdb) os=-chorusrdb basic_machine=$1 ;; -hiux*) os=-hiuxwe2 ;; -sco6) os=-sco5v6 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -sco5) os=-sco3.2v5 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -sco4) os=-sco3.2v4 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -sco3.2.[4-9]*) os=`echo $os | sed -e 's/sco3.2./sco3.2v/'` basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -sco3.2v[4-9]*) # Don't forget version if it is 3.2v4 or newer. basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -sco5v6*) # Don't forget version if it is 3.2v4 or newer. basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -sco*) os=-sco3.2v2 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -udk*) basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -isc) os=-isc2.2 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -clix*) basic_machine=clipper-intergraph ;; -isc*) basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -lynx*) os=-lynxos ;; -ptx*) basic_machine=`echo $1 | sed -e 's/86-.*/86-sequent/'` ;; -windowsnt*) os=`echo $os | sed -e 's/windowsnt/winnt/'` ;; -psos*) os=-psos ;; -mint | -mint[0-9]*) basic_machine=m68k-atari os=-mint ;; esac # Decode aliases for certain CPU-COMPANY combinations. case $basic_machine in # Recognize the basic CPU types without company name. # Some are omitted here because they have special meanings below. 1750a | 580 \ | a29k \ | alpha | alphaev[4-8] | alphaev56 | alphaev6[78] | alphapca5[67] \ | alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] | alpha64pca5[67] \ | am33_2.0 \ | arc | arm | arm[bl]e | arme[lb] | armv[2345] | armv[345][lb] | avr | avr32 \ | bfin \ | c4x | clipper \ | d10v | d30v | dlx | dsp16xx \ | fido | fr30 | frv \ | h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \ | i370 | i860 | i960 | ia64 \ | ip2k | iq2000 \ | m32c | m32r | m32rle | m68000 | m68k | m88k \ | maxq | mb | microblaze | mcore | mep \ | mips | mipsbe | mipseb | mipsel | mipsle \ | mips16 \ | mips64 | mips64el \ | mips64vr | mips64vrel \ | mips64orion | mips64orionel \ | mips64vr4100 | mips64vr4100el \ | mips64vr4300 | mips64vr4300el \ | mips64vr5000 | mips64vr5000el \ | mips64vr5900 | mips64vr5900el \ | mipsisa32 | mipsisa32el \ | mipsisa32r2 | mipsisa32r2el \ | mipsisa64 | mipsisa64el \ | mipsisa64r2 | mipsisa64r2el \ | mipsisa64sb1 | mipsisa64sb1el \ | mipsisa64sr71k | mipsisa64sr71kel \ | mipstx39 | mipstx39el \ | mn10200 | mn10300 \ | mt \ | msp430 \ | nios | nios2 \ | ns16k | ns32k \ | or32 \ | pdp10 | pdp11 | pj | pjl \ | powerpc | powerpc64 | powerpc64le | powerpcle | ppcbe \ | pyramid \ | score \ | sh | sh[1234] | sh[24]a | 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 \ | we32k \ | x86 | xc16x | xscale | xscalee[bl] | xstormy16 | xtensa \ | z8k) basic_machine=$basic_machine-unknown ;; m6811 | m68hc11 | m6812 | m68hc12) # Motorola 68HC11/12. basic_machine=$basic_machine-unknown os=-none ;; m88110 | m680[12346]0 | m683?2 | m68360 | m5200 | v70 | w65 | z8k) ;; ms1) basic_machine=mt-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. i*86 | x86_64) basic_machine=$basic_machine-pc ;; # Object if more than one company name word. *-*-*) echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2 exit 1 ;; # Recognize the basic CPU types with company name. 580-* \ | a29k-* \ | alpha-* | alphaev[4-8]-* | alphaev56-* | alphaev6[78]-* \ | alpha64-* | alpha64ev[4-8]-* | alpha64ev56-* | alpha64ev6[78]-* \ | alphapca5[67]-* | alpha64pca5[67]-* | arc-* \ | arm-* | armbe-* | armle-* | armeb-* | armv*-* \ | avr-* | avr32-* \ | bfin-* | bs2000-* \ | c[123]* | c30-* | [cjt]90-* | c4x-* | c54x-* | c55x-* | c6x-* \ | 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-* \ | i*86-* | i860-* | i960-* | ia64-* \ | ip2k-* | iq2000-* \ | m32c-* | m32r-* | m32rle-* \ | m68000-* | m680[012346]0-* | m68360-* | m683?2-* | m68k-* \ | m88110-* | m88k-* | maxq-* | mcore-* \ | mips-* | mipsbe-* | mipseb-* | mipsel-* | mipsle-* \ | mips16-* \ | mips64-* | mips64el-* \ | mips64vr-* | mips64vrel-* \ | mips64orion-* | mips64orionel-* \ | mips64vr4100-* | mips64vr4100el-* \ | mips64vr4300-* | mips64vr4300el-* \ | mips64vr5000-* | mips64vr5000el-* \ | mips64vr5900-* | mips64vr5900el-* \ | mipsisa32-* | mipsisa32el-* \ | mipsisa32r2-* | mipsisa32r2el-* \ | mipsisa64-* | mipsisa64el-* \ | mipsisa64r2-* | mipsisa64r2el-* \ | mipsisa64sb1-* | mipsisa64sb1el-* \ | mipsisa64sr71k-* | mipsisa64sr71kel-* \ | mipstx39-* | mipstx39el-* \ | mmix-* \ | mt-* \ | msp430-* \ | nios-* | nios2-* \ | none-* | np1-* | ns16k-* | ns32k-* \ | orion-* \ | pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \ | powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* | ppcbe-* \ | pyramid-* \ | romp-* | rs6000-* \ | sh-* | sh[1234]-* | sh[24]a-* | 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-* \ | tron-* \ | v850-* | v850e-* | vax-* \ | we32k-* \ | x86-* | x86_64-* | xc16x-* | xps100-* | xscale-* | xscalee[bl]-* \ | xstormy16-* | xtensa*-* \ | ymp-* \ | z8k-*) ;; # Recognize the basic CPU types without company name, with glob match. xtensa*) basic_machine=$basic_machine-unknown ;; # Recognize the various machine names and aliases which stand # for a CPU type and a company and sometimes even an OS. 386bsd) basic_machine=i386-unknown os=-bsd ;; 3b1 | 7300 | 7300-att | att-7300 | pc7300 | safari | unixpc) basic_machine=m68000-att ;; 3b*) basic_machine=we32k-att ;; a29khif) basic_machine=a29k-amd os=-udi ;; abacus) basic_machine=abacus-unknown ;; adobe68k) basic_machine=m68010-adobe os=-scout ;; alliant | fx80) basic_machine=fx80-alliant ;; altos | altos3068) basic_machine=m68k-altos ;; am29k) basic_machine=a29k-none os=-bsd ;; amd64) basic_machine=x86_64-pc ;; amd64-*) basic_machine=x86_64-`echo $basic_machine | sed 's/^[^-]*-//'` ;; amdahl) basic_machine=580-amdahl os=-sysv ;; amiga | amiga-*) basic_machine=m68k-unknown ;; amigaos | amigados) basic_machine=m68k-unknown os=-amigaos ;; amigaunix | amix) basic_machine=m68k-unknown os=-sysv4 ;; apollo68) basic_machine=m68k-apollo os=-sysv ;; apollo68bsd) basic_machine=m68k-apollo os=-bsd ;; aux) basic_machine=m68k-apple os=-aux ;; balance) basic_machine=ns32k-sequent os=-dynix ;; blackfin) basic_machine=bfin-unknown os=-linux ;; blackfin-*) basic_machine=bfin-`echo $basic_machine | sed 's/^[^-]*-//'` os=-linux ;; c90) basic_machine=c90-cray os=-unicos ;; convex-c1) basic_machine=c1-convex os=-bsd ;; convex-c2) basic_machine=c2-convex os=-bsd ;; convex-c32) basic_machine=c32-convex os=-bsd ;; convex-c34) basic_machine=c34-convex os=-bsd ;; convex-c38) basic_machine=c38-convex os=-bsd ;; cray | j90) basic_machine=j90-cray os=-unicos ;; craynv) basic_machine=craynv-cray os=-unicosmp ;; cr16) basic_machine=cr16-unknown os=-elf ;; crds | unos) basic_machine=m68k-crds ;; crisv32 | crisv32-* | etraxfs*) basic_machine=crisv32-axis ;; cris | cris-* | etrax*) basic_machine=cris-axis ;; crx) basic_machine=crx-unknown os=-elf ;; da30 | da30-*) basic_machine=m68k-da30 ;; decstation | decstation-3100 | pmax | pmax-* | pmin | dec3100 | decstatn) basic_machine=mips-dec ;; decsystem10* | dec10*) basic_machine=pdp10-dec os=-tops10 ;; decsystem20* | dec20*) basic_machine=pdp10-dec os=-tops20 ;; delta | 3300 | motorola-3300 | motorola-delta \ | 3300-motorola | delta-motorola) basic_machine=m68k-motorola ;; delta88) basic_machine=m88k-motorola os=-sysv3 ;; djgpp) basic_machine=i586-pc os=-msdosdjgpp ;; dpx20 | dpx20-*) basic_machine=rs6000-bull os=-bosx ;; dpx2* | dpx2*-bull) basic_machine=m68k-bull os=-sysv3 ;; ebmon29k) basic_machine=a29k-amd os=-ebmon ;; elxsi) basic_machine=elxsi-elxsi os=-bsd ;; encore | umax | mmax) basic_machine=ns32k-encore ;; es1800 | OSE68k | ose68k | ose | OSE) basic_machine=m68k-ericsson os=-ose ;; fx2800) basic_machine=i860-alliant ;; genix) basic_machine=ns32k-ns ;; gmicro) basic_machine=tron-gmicro os=-sysv ;; go32) basic_machine=i386-pc os=-go32 ;; h3050r* | hiux*) basic_machine=hppa1.1-hitachi os=-hiuxwe2 ;; h8300hms) basic_machine=h8300-hitachi os=-hms ;; h8300xray) basic_machine=h8300-hitachi os=-xray ;; h8500hms) basic_machine=h8500-hitachi os=-hms ;; harris) basic_machine=m88k-harris os=-sysv3 ;; hp300-*) basic_machine=m68k-hp ;; hp300bsd) basic_machine=m68k-hp os=-bsd ;; hp300hpux) basic_machine=m68k-hp os=-hpux ;; hp3k9[0-9][0-9] | hp9[0-9][0-9]) basic_machine=hppa1.0-hp ;; hp9k2[0-9][0-9] | hp9k31[0-9]) basic_machine=m68000-hp ;; hp9k3[2-9][0-9]) basic_machine=m68k-hp ;; hp9k6[0-9][0-9] | hp6[0-9][0-9]) basic_machine=hppa1.0-hp ;; hp9k7[0-79][0-9] | hp7[0-79][0-9]) basic_machine=hppa1.1-hp ;; hp9k78[0-9] | hp78[0-9]) # FIXME: really hppa2.0-hp basic_machine=hppa1.1-hp ;; hp9k8[67]1 | hp8[67]1 | hp9k80[24] | hp80[24] | hp9k8[78]9 | hp8[78]9 | hp9k893 | hp893) # FIXME: really hppa2.0-hp basic_machine=hppa1.1-hp ;; hp9k8[0-9][13679] | hp8[0-9][13679]) basic_machine=hppa1.1-hp ;; hp9k8[0-9][0-9] | hp8[0-9][0-9]) basic_machine=hppa1.0-hp ;; hppa-next) os=-nextstep3 ;; hppaosf) basic_machine=hppa1.1-hp os=-osf ;; hppro) basic_machine=hppa1.1-hp os=-proelf ;; i370-ibm* | ibm*) basic_machine=i370-ibm ;; # I'm not sure what "Sysv32" means. Should this be sysv3.2? i*86v32) basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` os=-sysv32 ;; i*86v4*) basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` os=-sysv4 ;; i*86v) basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` os=-sysv ;; i*86sol2) basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` os=-solaris2 ;; i386mach) basic_machine=i386-mach os=-mach ;; i386-vsta | vsta) basic_machine=i386-unknown os=-vsta ;; iris | iris4d) basic_machine=mips-sgi case $os in -irix*) ;; *) os=-irix4 ;; esac ;; isi68 | isi) basic_machine=m68k-isi os=-sysv ;; m68knommu) basic_machine=m68k-unknown os=-linux ;; m68knommu-*) basic_machine=m68k-`echo $basic_machine | sed 's/^[^-]*-//'` os=-linux ;; m88k-omron*) basic_machine=m88k-omron ;; magnum | m3230) basic_machine=mips-mips os=-sysv ;; merlin) basic_machine=ns32k-utek os=-sysv ;; mingw32) basic_machine=i386-pc os=-mingw32 ;; mingw32ce) basic_machine=arm-unknown os=-mingw32ce ;; miniframe) basic_machine=m68000-convergent ;; *mint | -mint[0-9]* | *MiNT | *MiNT[0-9]*) basic_machine=m68k-atari os=-mint ;; mips3*-*) basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'` ;; mips3*) basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`-unknown ;; monitor) basic_machine=m68k-rom68k os=-coff ;; morphos) basic_machine=powerpc-unknown os=-morphos ;; msdos) basic_machine=i386-pc os=-msdos ;; ms1-*) basic_machine=`echo $basic_machine | sed -e 's/ms1-/mt-/'` ;; mvs) basic_machine=i370-ibm os=-mvs ;; ncr3000) basic_machine=i486-ncr os=-sysv4 ;; netbsd386) basic_machine=i386-unknown os=-netbsd ;; netwinder) basic_machine=armv4l-rebel os=-linux ;; news | news700 | news800 | news900) basic_machine=m68k-sony os=-newsos ;; news1000) basic_machine=m68030-sony os=-newsos ;; news-3600 | risc-news) basic_machine=mips-sony os=-newsos ;; necv70) basic_machine=v70-nec os=-sysv ;; next | m*-next ) basic_machine=m68k-next case $os in -nextstep* ) ;; -ns2*) os=-nextstep2 ;; *) os=-nextstep3 ;; esac ;; nh3000) basic_machine=m68k-harris os=-cxux ;; nh[45]000) basic_machine=m88k-harris os=-cxux ;; nindy960) basic_machine=i960-intel os=-nindy ;; mon960) basic_machine=i960-intel os=-mon960 ;; nonstopux) basic_machine=mips-compaq os=-nonstopux ;; np1) basic_machine=np1-gould ;; nsr-tandem) basic_machine=nsr-tandem ;; op50n-* | op60c-*) basic_machine=hppa1.1-oki os=-proelf ;; openrisc | openrisc-*) basic_machine=or32-unknown ;; os400) basic_machine=powerpc-ibm os=-os400 ;; OSE68000 | ose68000) basic_machine=m68000-ericsson os=-ose ;; os68k) basic_machine=m68k-none os=-os68k ;; pa-hitachi) basic_machine=hppa1.1-hitachi os=-hiuxwe2 ;; paragon) basic_machine=i860-intel os=-osf ;; parisc) basic_machine=hppa-unknown os=-linux ;; parisc-*) basic_machine=hppa-`echo $basic_machine | sed 's/^[^-]*-//'` os=-linux ;; pbd) basic_machine=sparc-tti ;; pbb) basic_machine=m68k-tti ;; pc532 | pc532-*) basic_machine=ns32k-pc532 ;; pc98) basic_machine=i386-pc ;; pc98-*) basic_machine=i386-`echo $basic_machine | sed 's/^[^-]*-//'` ;; pentium | p5 | k5 | k6 | nexgen | viac3) basic_machine=i586-pc ;; pentiumpro | p6 | 6x86 | athlon | athlon_*) basic_machine=i686-pc ;; pentiumii | pentium2 | pentiumiii | pentium3) basic_machine=i686-pc ;; pentium4) basic_machine=i786-pc ;; pentium-* | p5-* | k5-* | k6-* | nexgen-* | viac3-*) basic_machine=i586-`echo $basic_machine | sed 's/^[^-]*-//'` ;; pentiumpro-* | p6-* | 6x86-* | athlon-*) basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'` ;; pentiumii-* | pentium2-* | pentiumiii-* | pentium3-*) basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'` ;; pentium4-*) basic_machine=i786-`echo $basic_machine | sed 's/^[^-]*-//'` ;; pn) basic_machine=pn-gould ;; power) basic_machine=power-ibm ;; ppc) basic_machine=powerpc-unknown ;; ppc-*) basic_machine=powerpc-`echo $basic_machine | sed 's/^[^-]*-//'` ;; ppcle | powerpclittle | ppc-le | powerpc-little) basic_machine=powerpcle-unknown ;; ppcle-* | powerpclittle-*) basic_machine=powerpcle-`echo $basic_machine | sed 's/^[^-]*-//'` ;; ppc64) basic_machine=powerpc64-unknown ;; ppc64-*) basic_machine=powerpc64-`echo $basic_machine | sed 's/^[^-]*-//'` ;; ppc64le | powerpc64little | ppc64-le | powerpc64-little) basic_machine=powerpc64le-unknown ;; ppc64le-* | powerpc64little-*) basic_machine=powerpc64le-`echo $basic_machine | sed 's/^[^-]*-//'` ;; ps2) basic_machine=i386-ibm ;; pw32) basic_machine=i586-unknown os=-pw32 ;; rdos) basic_machine=i386-pc os=-rdos ;; rom68k) basic_machine=m68k-rom68k os=-coff ;; rm[46]00) basic_machine=mips-siemens ;; rtpc | rtpc-*) basic_machine=romp-ibm ;; s390 | s390-*) basic_machine=s390-ibm ;; s390x | s390x-*) basic_machine=s390x-ibm ;; sa29200) basic_machine=a29k-amd os=-udi ;; sb1) basic_machine=mipsisa64sb1-unknown ;; sb1el) basic_machine=mipsisa64sb1el-unknown ;; sde) basic_machine=mipsisa32-sde os=-elf ;; sei) basic_machine=mips-sei os=-seiux ;; sequent) basic_machine=i386-sequent ;; sh) basic_machine=sh-hitachi os=-hms ;; sh5el) basic_machine=sh5le-unknown ;; sh64) basic_machine=sh64-unknown ;; sparclite-wrs | simso-wrs) basic_machine=sparclite-wrs os=-vxworks ;; sps7) basic_machine=m68k-bull os=-sysv2 ;; spur) basic_machine=spur-unknown ;; st2000) basic_machine=m68k-tandem ;; stratus) basic_machine=i860-stratus os=-sysv4 ;; sun2) basic_machine=m68000-sun ;; sun2os3) basic_machine=m68000-sun os=-sunos3 ;; sun2os4) basic_machine=m68000-sun os=-sunos4 ;; sun3os3) basic_machine=m68k-sun os=-sunos3 ;; sun3os4) basic_machine=m68k-sun os=-sunos4 ;; sun4os3) basic_machine=sparc-sun os=-sunos3 ;; sun4os4) basic_machine=sparc-sun os=-sunos4 ;; sun4sol2) basic_machine=sparc-sun os=-solaris2 ;; sun3 | sun3-*) basic_machine=m68k-sun ;; sun4) basic_machine=sparc-sun ;; sun386 | sun386i | roadrunner) basic_machine=i386-sun ;; sv1) basic_machine=sv1-cray os=-unicos ;; symmetry) basic_machine=i386-sequent os=-dynix ;; t3e) basic_machine=alphaev5-cray os=-unicos ;; t90) 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 os=-linux-gnu ;; tx39) basic_machine=mipstx39-unknown ;; tx39el) basic_machine=mipstx39el-unknown ;; toad1) basic_machine=pdp10-xkl os=-tops20 ;; tower | tower-32) basic_machine=m68k-ncr ;; tpf) basic_machine=s390x-ibm os=-tpf ;; udi29k) basic_machine=a29k-amd os=-udi ;; ultra3) basic_machine=a29k-nyu os=-sym1 ;; v810 | necv810) basic_machine=v810-nec os=-none ;; vaxv) basic_machine=vax-dec os=-sysv ;; vms) basic_machine=vax-dec os=-vms ;; vpp*|vx|vx-*) basic_machine=f301-fujitsu ;; vxworks960) basic_machine=i960-wrs os=-vxworks ;; vxworks68) basic_machine=m68k-wrs os=-vxworks ;; vxworks29k) basic_machine=a29k-wrs os=-vxworks ;; w65*) basic_machine=w65-wdc os=-none ;; w89k-*) basic_machine=hppa1.1-winbond os=-proelf ;; xbox) basic_machine=i686-pc os=-mingw32 ;; xps | xps100) basic_machine=xps100-honeywell ;; ymp) basic_machine=ymp-cray os=-unicos ;; z8k-*-coff) basic_machine=z8k-unknown os=-sim ;; none) basic_machine=none-none os=-none ;; # Here we handle the default manufacturer of certain CPU types. It is in # some cases the only manufacturer, in others, it is the most popular. w89k) basic_machine=hppa1.1-winbond ;; op50n) basic_machine=hppa1.1-oki ;; op60c) basic_machine=hppa1.1-oki ;; romp) basic_machine=romp-ibm ;; mmix) basic_machine=mmix-knuth ;; rs6000) basic_machine=rs6000-ibm ;; vax) basic_machine=vax-dec ;; pdp10) # there are many clones, so DEC is not a safe bet basic_machine=pdp10-unknown ;; pdp11) basic_machine=pdp11-dec ;; we32k) basic_machine=we32k-att ;; sh[1234] | sh[24]a | sh[34]eb | sh[1234]le | sh[23]ele) basic_machine=sh-unknown ;; sparc | sparcv8 | sparcv9 | sparcv9b | sparcv9v) basic_machine=sparc-sun ;; cydra) basic_machine=cydra-cydrome ;; orion) basic_machine=orion-highlevel ;; orion105) basic_machine=clipper-highlevel ;; mac | mpw | mac-mpw) basic_machine=m68k-apple ;; pmac | pmac-mpw) basic_machine=powerpc-apple ;; *-unknown) # Make sure to match an already-canonicalized machine name. ;; *) echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2 exit 1 ;; esac # Here we canonicalize certain aliases for manufacturers. case $basic_machine in *-digital*) basic_machine=`echo $basic_machine | sed 's/digital.*/dec/'` ;; *-commodore*) basic_machine=`echo $basic_machine | sed 's/commodore.*/cbm/'` ;; *) ;; esac # Decode manufacturer-specific aliases for certain operating systems. if [ x"$os" != x"" ] then case $os in # First match some system type aliases # that might get confused with valid system types. # -solaris* is a basic system type, with this one exception. -solaris1 | -solaris1.*) os=`echo $os | sed -e 's|solaris1|sunos4|'` ;; -solaris) os=-solaris2 ;; -svr4*) os=-sysv4 ;; -unixware*) os=-sysv4.2uw ;; -gnu/linux*) os=`echo $os | sed -e 's|gnu/linux|linux-gnu|'` ;; # First accept the basic system types. # The portable systems comes first. # Each alternative MUST END IN A *, to match a version number. # -sysv* is not here because it comes later, after sysvr4. -gnu* | -bsd* | -mach* | -minix* | -genix* | -ultrix* | -irix* \ | -*vms* | -sco* | -esix* | -isc* | -aix* | -sunos | -sunos[34]*\ | -hpux* | -unos* | -osf* | -luna* | -dgux* | -solaris* | -sym* \ | -amigaos* | -amigados* | -msdos* | -newsos* | -unicos* | -aof* \ | -aos* \ | -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \ | -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \ | -hiux* | -386bsd* | -knetbsd* | -mirbsd* | -netbsd* \ | -openbsd* | -solidbsd* \ | -ekkobsd* | -kfreebsd* | -freebsd* | -riscix* | -lynxos* \ | -bosx* | -nextstep* | -cxux* | -aout* | -elf* | -oabi* \ | -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \ | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \ | -chorusos* | -chorusrdb* \ | -cygwin* | -pe* | -psos* | -moss* | -proelf* | -rtems* \ | -mingw32* | -linux-gnu* | -linux-newlib* | -linux-uclibc* \ | -uxpv* | -beos* | -mpeix* | -udk* \ | -interix* | -uwin* | -mks* | -rhapsody* | -darwin* | -opened* \ | -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \ | -storm-chaos* | -tops10* | -tenex* | -tops20* | -its* \ | -os2* | -vos* | -palmos* | -uclinux* | -nucleus* \ | -morphos* | -superux* | -rtmk* | -rtmk-nova* | -windiss* \ | -powermax* | -dnix* | -nx6 | -nx7 | -sei* | -dragonfly* \ | -skyos* | -haiku* | -rdos* | -toppers* | -drops*) # Remember, each alternative MUST END IN *, to match a version number. ;; -qnx*) case $basic_machine in x86-* | i*86-*) ;; *) os=-nto$os ;; esac ;; -nto-qnx*) ;; -nto*) os=`echo $os | sed -e 's|nto|nto-qnx|'` ;; -sim | -es1800* | -hms* | -xray | -os68k* | -none* | -v88r* \ | -windows* | -osx | -abug | -netware* | -os9* | -beos* | -haiku* \ | -macos* | -mpw* | -magic* | -mmixware* | -mon960* | -lnews*) ;; -mac*) os=`echo $os | sed -e 's|mac|macos|'` ;; -linux-dietlibc) os=-linux-dietlibc ;; -linux*) os=`echo $os | sed -e 's|linux|linux-gnu|'` ;; -sunos5*) os=`echo $os | sed -e 's|sunos5|solaris2|'` ;; -sunos6*) os=`echo $os | sed -e 's|sunos6|solaris3|'` ;; -opened*) os=-openedition ;; -os400*) os=-os400 ;; -wince*) os=-wince ;; -osfrose*) os=-osfrose ;; -osf*) os=-osf ;; -utek*) os=-bsd ;; -dynix*) os=-bsd ;; -acis*) os=-aos ;; -atheos*) os=-atheos ;; -syllable*) os=-syllable ;; -386bsd) os=-bsd ;; -ctix* | -uts*) os=-sysv ;; -nova*) os=-rtmk-nova ;; -ns2 ) os=-nextstep2 ;; -nsk*) os=-nsk ;; # Preserve the version number of sinix5. -sinix5.*) os=`echo $os | sed -e 's|sinix|sysv|'` ;; -sinix*) os=-sysv4 ;; -tpf*) os=-tpf ;; -triton*) os=-sysv3 ;; -oss*) os=-sysv3 ;; -svr4) os=-sysv4 ;; -svr3) os=-sysv3 ;; -sysvr4) os=-sysv4 ;; # This must come after -sysvr4. -sysv*) ;; -ose*) os=-ose ;; -es1800*) os=-ose ;; -xenix) os=-xenix ;; -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*) os=-mint ;; -aros*) os=-aros ;; -kaos*) os=-kaos ;; -zvmoe) os=-zvmoe ;; -none) ;; *) # Get rid of the `-' at the beginning of $os. os=`echo $os | sed 's/[^-]*-//'` echo Invalid configuration \`$1\': system \`$os\' not recognized 1>&2 exit 1 ;; esac else # Here we handle the default operating systems that come with various machines. # The value should be what the vendor currently ships out the door with their # machine or put another way, the most popular os provided with the machine. # Note that if you're going to try to match "-MANUFACTURER" here (say, # "-sun"), then you have to tell the case statement up towards the top # that MANUFACTURER isn't an operating system. Otherwise, code above # will signal an error saying that MANUFACTURER isn't an operating # system, and we'll never get to this point. case $basic_machine in score-*) os=-elf ;; spu-*) os=-elf ;; *-acorn) os=-riscix1.2 ;; arm*-rebel) os=-linux ;; arm*-semi) os=-aout ;; c4x-* | tic4x-*) os=-coff ;; # This must come before the *-dec entry. pdp10-*) os=-tops20 ;; pdp11-*) os=-none ;; *-dec | vax-*) os=-ultrix4.2 ;; m68*-apollo) os=-domain ;; i386-sun) os=-sunos4.0.2 ;; m68000-sun) os=-sunos3 # This also exists in the configure program, but was not the # default. # os=-sunos4 ;; m68*-cisco) os=-aout ;; mep-*) os=-elf ;; mips*-cisco) os=-elf ;; mips*-*) os=-elf ;; or32-*) os=-coff ;; *-tti) # must be before sparc entry or we get the wrong os. os=-sysv3 ;; sparc-* | *-sun) os=-sunos4.1.1 ;; *-be) os=-beos ;; *-haiku) os=-haiku ;; *-ibm) os=-aix ;; *-knuth) os=-mmixware ;; *-wec) os=-proelf ;; *-winbond) os=-proelf ;; *-oki) os=-proelf ;; *-hp) os=-hpux ;; *-hitachi) os=-hiux ;; i860-* | *-att | *-ncr | *-altos | *-motorola | *-convergent) os=-sysv ;; *-cbm) os=-amigaos ;; *-dg) os=-dgux ;; *-dolphin) os=-sysv3 ;; m68k-ccur) os=-rtu ;; m88k-omron*) os=-luna ;; *-next ) os=-nextstep ;; *-sequent) os=-ptx ;; *-crds) os=-unos ;; *-ns) os=-genix ;; i370-*) os=-mvs ;; *-next) os=-nextstep3 ;; *-gould) os=-sysv ;; *-highlevel) os=-bsd ;; *-encore) os=-bsd ;; *-sgi) os=-irix ;; *-siemens) os=-sysv4 ;; *-masscomp) os=-rtu ;; f30[01]-fujitsu | f700-fujitsu) os=-uxpv ;; *-rom68k) os=-coff ;; *-*bug) os=-coff ;; *-apple) os=-macos ;; *-atari*) os=-mint ;; *) os=-none ;; esac fi # Here we handle the case where we know the os, and the CPU type, but not the # manufacturer. We pick the logical manufacturer. vendor=unknown case $basic_machine in *-unknown) case $os in -riscix*) vendor=acorn ;; -sunos*) vendor=sun ;; -aix*) vendor=ibm ;; -beos*) vendor=be ;; -hpux*) vendor=hp ;; -mpeix*) vendor=hp ;; -hiux*) vendor=hitachi ;; -unos*) vendor=crds ;; -dgux*) vendor=dg ;; -luna*) vendor=omron ;; -genix*) vendor=ns ;; -mvs* | -opened*) vendor=ibm ;; -os400*) vendor=ibm ;; -ptx*) vendor=sequent ;; -tpf*) vendor=ibm ;; -vxsim* | -vxworks* | -windiss*) vendor=wrs ;; -aux*) vendor=apple ;; -hms*) vendor=hitachi ;; -mpw* | -macos*) vendor=apple ;; -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*) vendor=atari ;; -vos*) vendor=stratus ;; esac basic_machine=`echo $basic_machine | sed "s/unknown/$vendor/"` ;; esac echo $basic_machine$os exit # Local variables: # eval: (add-hook 'write-file-hooks 'time-stamp) # time-stamp-start: "timestamp='" # time-stamp-format: "%:y-%02m-%02d" # time-stamp-end: "'" # End: tango-8.1.2c+dfsg.orig/config/ltmain.sh0000644000175000017500000105204012205375241016663 0ustar piccapicca # 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, 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. # GNU Libtool 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. # # As a special exception to the GNU General Public License, # if you distribute this file as part of a program or library that # is built using GNU Libtool, you may include this file under the # same distribution terms that you use for the rest of that program. # # GNU Libtool 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 GNU Libtool; see the file COPYING. If not, a copy # can be downloaded from http://www.gnu.org/licenses/gpl.html, # or obtained by writing to the Free Software Foundation, Inc., # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. # Usage: $progname [OPTION]... [MODE-ARG]... # # 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 # --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 # # 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.4.2 Debian-2.4.2-1ubuntu1 # automake: $automake_version # autoconf: $autoconf_version # # Report bugs to . # GNU libtool home page: . # General help using GNU software: . PROGRAM=libtool PACKAGE=libtool VERSION="2.4.2 Debian-2.4.2-1ubuntu1" TIMESTAMP="" package_revision=1.3337 # Be Bourne compatible if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then emulate sh NULLCMD=: # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' setopt NO_GLOB_SUBST else case `(set -o) 2>/dev/null` in *posix*) set -o posix;; esac fi 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. lt_user_locale= lt_safe_locale= for lt_var in LANG LANGUAGE LC_ALL LC_CTYPE LC_COLLATE LC_MESSAGES do eval "if test \"\${$lt_var+set}\" = set; then save_$lt_var=\$$lt_var $lt_var=C export $lt_var lt_user_locale=\"$lt_var=\\\$save_\$lt_var; \$lt_user_locale\" 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"} test "${ECHO+set}" = set || ECHO=${as_echo-'printf %s\n'} : ${MAKE="make"} : ${MKDIR="mkdir"} : ${MV="mv -f"} : ${RM="rm -f"} : ${SHELL="${CONFIG_SHELL-/bin/sh}"} : ${Xsed="$SED -e 1s/^X//"} # Global variables: EXIT_SUCCESS=0 EXIT_FAILURE=1 EXIT_MISMATCH=63 # $? = 63 is used to indicate version mismatch to missing. EXIT_SKIP=77 # $? = 77 is used to indicate a skipped test to automake. exit_status=$EXIT_SUCCESS # Make sure IFS has a sensible default lt_nl=' ' IFS=" $lt_nl" 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: # 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 () { # 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 } # 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 # 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: func_dirname_and_basename "$progpath" progname=$func_basename_result # Make sure we have an absolute path for reexecution: case $progpath in [\\/]*|[A-Za-z]:\\*) ;; *[\\/]*) progdir=$func_dirname_result progdir=`cd "$progdir" && pwd` progpath="$progdir/$progname" ;; *) save_IFS="$IFS" IFS=${PATH_SEPARATOR-:} for progdir in $PATH; do IFS="$save_IFS" test -x "$progdir/$progname" && break done IFS="$save_IFS" test -n "$progdir" || progdir=`pwd` progpath="$progdir/$progname" ;; esac # 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='s/\([`"$\\]\)/\\\1/g' # 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. # Since each input `\' is now two `\'s, look for any number of runs of # four `\'s followed by two `\'s and then a '$'. `\' that '$'. bs='\\' bs2='\\\\' bs4='\\\\\\\\' dollar='\$' sed_double_backslash="\ s/$bs4/&\\ /g s/^$bs2$dollar/$bs&/ s/\\([^$bs]\\)$bs2$dollar/\\1$bs2$bs$dollar/g s/\n//g" # Standard options: opt_dry_run=false opt_help=false opt_quiet=false opt_verbose=false opt_warning=: # func_echo arg... # Echo program name prefixed message, along with the current mode # name if it has been set yet. func_echo () { $ECHO "$progname: ${opt_mode+$opt_mode: }$*" } # func_verbose arg... # Echo program name prefixed message in verbose mode only. func_verbose () { $opt_verbose && func_echo ${1+"$@"} # A bug in bash halts the script if the last line of a function # fails when set -e is in force, so we need another command to # work around that: : } # 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: ${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: ${opt_mode+$opt_mode: }warning: "${1+"$@"} 1>&2 # bash bug again: : } # func_fatal_error arg... # Echo program name prefixed message to standard error, and exit. func_fatal_error () { func_error ${1+"$@"} exit $EXIT_FAILURE } # func_fatal_help arg... # Echo program name prefixed message to standard error, followed by # a help hint, and exit. func_fatal_help () { func_error ${1+"$@"} func_fatal_error "$help" } help="Try \`$progname --help' for more information." ## default # func_grep expression filename # Check whether EXPRESSION matches any line of FILENAME, without output. func_grep () { $GREP "$1" "$2" >/dev/null 2>&1 } # func_mkdir_p directory-path # Make sure the entire path to DIRECTORY-PATH is available. func_mkdir_p () { my_directory_path="$1" my_dir_list= if test -n "$my_directory_path" && test "$opt_dry_run" != ":"; then # Protect directory names starting with `-' case $my_directory_path in -*) my_directory_path="./$my_directory_path" ;; esac # While some portion of DIR does not yet exist... while test ! -d "$my_directory_path"; do # ...make a list in topmost first order. Use a colon delimited # list incase some portion of path contains whitespace. my_dir_list="$my_directory_path:$my_dir_list" # If the last portion added has no slash in it, the list is done case $my_directory_path in */*) ;; *) break ;; esac # ...otherwise throw away the child directory and loop my_directory_path=`$ECHO "$my_directory_path" | $SED -e "$dirname"` done my_dir_list=`$ECHO "$my_dir_list" | $SED 's,:*$,,'` save_mkdir_p_IFS="$IFS"; IFS=':' for my_dir in $my_dir_list; do IFS="$save_mkdir_p_IFS" # mkdir can fail with a `File exist' error if two processes # try to create one of the directories concurrently. Don't # stop in that case! $MKDIR "$my_dir" 2>/dev/null || : done IFS="$save_mkdir_p_IFS" # Bail out if we (or some other process) failed to create a directory. test -d "$my_directory_path" || \ func_fatal_error "Failed to create \`$1'" fi } # func_mktempdir [string] # Make a temporary directory that won't clash with other running # libtool processes, and avoids race conditions if possible. If # given, STRING is the basename for that directory. func_mktempdir () { my_template="${TMPDIR-/tmp}/${1-$progname}" if test "$opt_dry_run" = ":"; then # Return a directory name, but don't create it in dry-run mode my_tmpdir="${my_template}-$$" else # If mktemp works, use that first and foremost my_tmpdir=`mktemp -d "${my_template}-XXXXXXXX" 2>/dev/null` if test ! -d "$my_tmpdir"; then # Failing that, at least try and use $RANDOM to avoid a race my_tmpdir="${my_template}-${RANDOM-0}$$" save_mktempdir_umask=`umask` umask 0077 $MKDIR "$my_tmpdir" umask $save_mktempdir_umask fi # If we're not in dry-run mode, bomb out on failure test -d "$my_tmpdir" || \ func_fatal_error "cannot create temporary directory \`$my_tmpdir'" fi $ECHO "$my_tmpdir" } # func_quote_for_eval arg # Aesthetically quote ARG to be evaled later. # This function returns two values: FUNC_QUOTE_FOR_EVAL_RESULT # is double-quoted, suitable for a subsequent eval, whereas # FUNC_QUOTE_FOR_EVAL_UNQUOTED_RESULT has merely all characters # which are still active within double quotes backslashified. func_quote_for_eval () { case $1 in *[\\\`\"\$]*) func_quote_for_eval_unquoted_result=`$ECHO "$1" | $SED "$sed_quote_subst"` ;; *) func_quote_for_eval_unquoted_result="$1" ;; esac case $func_quote_for_eval_unquoted_result in # Double-quote args containing shell metacharacters to delay # word splitting, command substitution and and variable # expansion for a subsequent eval. # Many Bourne shells cannot handle close brackets correctly # in scan sets, so we specify it separately. *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") func_quote_for_eval_result="\"$func_quote_for_eval_unquoted_result\"" ;; *) func_quote_for_eval_result="$func_quote_for_eval_unquoted_result" esac } # func_quote_for_expand arg # Aesthetically quote ARG to be evaled later; same as above, # but do not quote variable references. func_quote_for_expand () { case $1 in *[\\\`\"]*) my_arg=`$ECHO "$1" | $SED \ -e "$double_quote_subst" -e "$sed_double_backslash"` ;; *) my_arg="$1" ;; esac case $my_arg in # Double-quote args containing shell metacharacters to delay # word splitting and command substitution for a subsequent eval. # Many Bourne shells cannot handle close brackets correctly # in scan sets, so we specify it separately. *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") my_arg="\"$my_arg\"" ;; esac func_quote_for_expand_result="$my_arg" } # func_show_eval cmd [fail_exp] # Unless opt_silent is true, then output CMD. Then, if opt_dryrun is # not true, evaluate CMD. If the evaluation of CMD fails, and FAIL_EXP # is given, then evaluate it. func_show_eval () { my_cmd="$1" my_fail_exp="${2-:}" ${opt_silent-false} || { func_quote_for_expand "$my_cmd" eval "func_echo $func_quote_for_expand_result" } if ${opt_dry_run-false}; then :; else eval "$my_cmd" my_status=$? if test "$my_status" -eq 0; then :; else eval "(exit $my_status); $my_fail_exp" fi fi } # func_show_eval_locale cmd [fail_exp] # Unless opt_silent is true, then output CMD. Then, if opt_dryrun is # not true, evaluate CMD. If the evaluation of CMD fails, and FAIL_EXP # is given, then evaluate it. Use the saved locale for evaluation. func_show_eval_locale () { my_cmd="$1" my_fail_exp="${2-:}" ${opt_silent-false} || { func_quote_for_expand "$my_cmd" eval "func_echo $func_quote_for_expand_result" } if ${opt_dry_run-false}; then :; else eval "$lt_user_locale $my_cmd" my_status=$? eval "$lt_safe_locale" if test "$my_status" -eq 0; then :; else eval "(exit $my_status); $my_fail_exp" fi 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 () { $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/ p }' < "$progpath" exit $? } # func_usage # Echo short help message to standard output and exit. func_usage () { $opt_debug $SED -n '/^# Usage:/,/^# *.*--help/ { s/^# // s/^# *$// s/\$progname/'$progname'/ p }' < "$progpath" echo $ECHO "run \`$progname --help | more' for full usage" 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'* s*\$host*'"$host"'* s*\$SHELL*'"$SHELL"'* s*\$LTCC*'"$LTCC"'* s*\$LTCFLAGS*'"$LTCFLAGS"'* s*\$LD*'"$LD"'* s/\$with_gnu_ld/'"$with_gnu_ld"'/ s/\$automake_version/'"`(${AUTOMAKE-automake} --version) 2>/dev/null |$SED 1q`"'/ s/\$autoconf_version/'"`(${AUTOCONF-autoconf} --version) 2>/dev/null |$SED 1q`"'/ p d } /^# .* home page:/b print /^# General help using/b print ' < "$progpath" ret=$? if test -z "$1"; then exit $ret fi } # func_missing_arg argname # Echo program name prefixed message to standard error and set global # exit_cmd. func_missing_arg () { $opt_debug func_error "missing argument for $1." exit_cmd=exit } # 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=: magic="%%%MAGIC variable%%%" magic_exe="%%%MAGIC EXE variable%%%" # Global variables. nonopt= preserve_args= lo2o="s/\\.lo\$/.${objext}/" o2lo="s/\\.${objext}\$/.lo/" extracted_archives= extracted_serial=0 # If this variable is set in any of the actions, the command in it # will be execed at the end. This prevents here-documents from being # left over by shells. exec_cmd= # func_append var value # Append VALUE to the end of shell variable VAR. func_append () { eval "${1}=\$${1}\${2}" } # func_append may be replaced by extended shell implementation # func_append_quoted var value # Quote VALUE and append to the end of shell variable VAR, separated # by a space. func_append_quoted () { func_quote_for_eval "${2}" eval "${1}=\$${1}\\ \$func_quote_for_eval_result" } # func_append_quoted may be replaced by extended shell implementation # func_arith arithmetic-term... func_arith () { func_arith_result=`expr "${@}"` } # func_arith may be replaced by extended shell implementation # func_len string # STRING may not start with a hyphen. func_len () { func_len_result=`expr "${1}" : ".*" 2>/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. func_fatal_configuration () { func_error ${1+"$@"} func_error "See the $PACKAGE documentation for more information." func_fatal_error "Fatal configuration error." } # func_config # Display the configuration for all the tags in this script. func_config () { re_begincf='^# ### BEGIN LIBTOOL' re_endcf='^# ### END LIBTOOL' # Default configuration. $SED "1,/$re_begincf CONFIG/d;/$re_endcf CONFIG/,\$d" < "$progpath" # Now print the configurations for the tags. for tagname in $taglist; do $SED -n "/$re_begincf TAG CONFIG: $tagname\$/,/$re_endcf TAG CONFIG: $tagname\$/p" < "$progpath" done exit $? } # func_features # Display the features supported by this script. func_features () { echo "host: $host" if test "$build_libtool_libs" = yes; then echo "enable shared libraries" else echo "disable shared libraries" fi if test "$build_old_libs" = yes; then echo "enable static libraries" else echo "disable static libraries" fi exit $? } # func_enable_tag tagname # Verify that TAGNAME is valid, and either flag an error and exit, or # enable the TAGNAME tag. We also add TAGNAME to the global $taglist # variable here. func_enable_tag () { # Global variable: tagname="$1" re_begincf="^# ### BEGIN LIBTOOL TAG CONFIG: $tagname\$" re_endcf="^# ### END LIBTOOL TAG CONFIG: $tagname\$" sed_extractcf="/$re_begincf/,/$re_endcf/p" # Validate tagname. case $tagname in *[!-_A-Za-z0-9,/]*) func_fatal_error "invalid tag name: $tagname" ;; esac # Don't test for the "default" C tag, as we know it's # there but not specially marked. case $tagname in CC) ;; *) if $GREP "$re_begincf" "$progpath" >/dev/null 2>&1; then taglist="$taglist $tagname" # Evaluate the configuration. Be careful to quote the path # and the sed script, to avoid splitting on whitespace, but # also don't use non-portable quotes within backquotes within # quotes we have to do it in 2 steps: extractedcf=`$SED -n -e "$sed_extractcf" < "$progpath"` eval "$extractedcf" else func_error "ignoring unknown tag $tagname" fi ;; esac } # 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 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 # 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 --debug|-x) opt_debug='set -x' func_echo "enabling shell trace mode" $opt_debug ;; --dry-run|--dryrun|-n) opt_dry_run=: ;; --config) opt_config=: func_config ;; --dlopen|-dlopen) optarg="$1" opt_dlopen="${opt_dlopen+$opt_dlopen }$optarg" shift ;; --preserve-dup-deps) opt_preserve_dup_deps=: ;; --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" ;; --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: --*=*) func_split_long_opt "$opt" set dummy "$func_split_long_opt_name" "$func_split_long_opt_arg" ${1+"$@"} shift ;; # 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*) # don't eliminate duplications in $postdeps and $predeps opt_duplicate_compiler_generated_deps=: ;; *) opt_duplicate_compiler_generated_deps=$opt_preserve_dup_deps ;; esac $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 # Darwin sucks eval std_shrext=\"$shrext_cmds\" # 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 # Change the help message to a mode-specific one. generic_help="$help" help="Try \`$progname --help --mode=$opt_mode' for more information." } # Bail if the options were screwed $exit_cmd $EXIT_FAILURE } ## ----------- ## ## Main. ## ## ----------- ## # func_lalib_p file # True iff FILE is a libtool `.la' library or `.lo' object file. # This function is only a basic sanity check; it will hardly flush out # determined imposters. func_lalib_p () { test -f "$1" && $SED -e 4q "$1" 2>/dev/null \ | $GREP "^# Generated by .*$PACKAGE" > /dev/null 2>&1 } # func_lalib_unsafe_p file # True iff FILE is a libtool `.la' library or `.lo' object file. # This function implements the same check as func_lalib_p without # resorting to external programs. To this end, it redirects stdin and # closes it afterwards, without saving the original file descriptor. # As a safety measure, use it only where a negative result would be # fatal anyway. Works if `file' does not exist. func_lalib_unsafe_p () { lalib_p=no if test -f "$1" && test -r "$1" && exec 5<&0 <"$1"; then for lalib_p_l in 1 2 3 4 do read lalib_p_line case "$lalib_p_line" in \#\ Generated\ by\ *$PACKAGE* ) lalib_p=yes; break;; esac done exec 0<&5 5<&- fi test "$lalib_p" = yes } # func_ltwrapper_script_p file # True iff FILE is a libtool wrapper script # This function is only a basic sanity check; it will hardly flush out # determined imposters. func_ltwrapper_script_p () { func_lalib_p "$1" } # func_ltwrapper_executable_p file # True iff FILE is a libtool wrapper executable # This function is only a basic sanity check; it will hardly flush out # determined imposters. func_ltwrapper_executable_p () { func_ltwrapper_exec_suffix= case $1 in *.exe) ;; *) func_ltwrapper_exec_suffix=.exe ;; esac $GREP "$magic_exe" "$1$func_ltwrapper_exec_suffix" >/dev/null 2>&1 } # func_ltwrapper_scriptname file # Assumes file is an ltwrapper_executable # uses $file to determine the appropriate filename for a # temporary ltwrapper_script. func_ltwrapper_scriptname () { 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 # True iff FILE is a libtool wrapper script or wrapper executable # This function is only a basic sanity check; it will hardly flush out # determined imposters. func_ltwrapper_p () { func_ltwrapper_script_p "$1" || func_ltwrapper_executable_p "$1" } # func_execute_cmds commands fail_cmd # Execute tilde-delimited COMMANDS. # If FAIL_CMD is given, eval that upon failure. # FAIL_CMD may read-access the current command in variable CMD! func_execute_cmds () { $opt_debug save_ifs=$IFS; IFS='~' for cmd in $1; do IFS=$save_ifs eval cmd=\"$cmd\" func_show_eval "$cmd" "${2-:}" done IFS=$save_ifs } # func_source file # Source FILE, adding directory component if necessary. # Note that it is not necessary on cygwin/mingw to append a dot to # FILE even if both FILE and FILE.exe exist: automatic-append-.exe # behavior happens only for exec(3), not for open(2)! Also, sourcing # `FILE.' does not work on cygwin managed mounts. func_source () { $opt_debug case $1 in */* | *\\*) . "$1" ;; *) . "./$1" ;; esac } # 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. # Only attempt this if the compiler in the base compile # command doesn't match the default compiler. # arg is usually of the form 'gcc ...' func_infer_tag () { $opt_debug if test -n "$available_tags" && test -z "$tagname"; then CC_quoted= for arg in $CC; do 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 "* | " $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. *) for z in $available_tags; do if $GREP "^# ### BEGIN LIBTOOL TAG CONFIG: $z$" < "$progpath" > /dev/null; then # Evaluate the configuration. eval "`${SED} -n -e '/^# ### BEGIN LIBTOOL TAG CONFIG: '$z'$/,/^# ### END LIBTOOL TAG CONFIG: '$z'$/p' < $progpath`" CC_quoted= for arg in $CC; do # Double-quote args containing other shell metacharacters. 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 "* | " $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. tagname=$z break ;; esac fi done # If $tagname still isn't set, then no tagged configuration # was found and let the user know that the "--tag" command # line option must be used. if test -z "$tagname"; then func_echo "unable to infer tagged configuration" func_fatal_error "specify a tag with \`--tag'" # else # func_verbose "using $tagname tagged configuration" fi ;; esac fi } # func_write_libtool_object output_name pic_name nonpic_name # Create a libtool object file (analogous to a ".la" file), # but don't create it if we're doing a dry run. func_write_libtool_object () { write_libobj=${1} if test "$build_libtool_libs" = yes; then write_lobj=\'${2}\' else write_lobj=none fi if test "$build_old_libs" = yes; then write_oldobj=\'${3}\' else write_oldobj=none fi $opt_dry_run || { cat >${write_libobj}T </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 () { $opt_debug # Get the compilation command and the source file. base_compile= srcfile="$nonopt" # always keep a non-empty value in "srcfile" suppress_opt=yes suppress_output= arg_mode=normal libobj= later= pie_flag= for arg do case $arg_mode in arg ) # do not "continue". Instead, add this to base_compile lastarg="$arg" arg_mode=normal ;; target ) libobj="$arg" arg_mode=normal continue ;; normal ) # Accept any command-line options. case $arg in -o) test -n "$libobj" && \ func_fatal_error "you cannot specify \`-o' more than once" arg_mode=target continue ;; -pie | -fpie | -fPIE) func_append pie_flag " $arg" continue ;; -shared | -static | -prefer-pic | -prefer-non-pic) func_append later " $arg" continue ;; -no-suppress) suppress_opt=no continue ;; -Xcompiler) arg_mode=arg # the next one goes into the "base_compile" arg list continue # The current "srcfile" will either be retained or ;; # replaced later. I would guess that would be a bug. -Wc,*) func_stripname '-Wc,' '' "$arg" args=$func_stripname_result lastarg= save_ifs="$IFS"; IFS=',' for arg in $args; do IFS="$save_ifs" func_append_quoted lastarg "$arg" done IFS="$save_ifs" func_stripname ' ' '' "$lastarg" lastarg=$func_stripname_result # Add the arguments to base_compile. func_append base_compile " $lastarg" continue ;; *) # Accept the current argument as the source file. # The previous "srcfile" becomes the current argument. # lastarg="$srcfile" srcfile="$arg" ;; esac # case $arg ;; esac # case $arg_mode # Aesthetically quote the previous argument. func_append_quoted base_compile "$lastarg" done # for arg case $arg_mode in arg) func_fatal_error "you must specify an argument for -Xcompile" ;; target) func_fatal_error "you must specify a target with \`-o'" ;; *) # Get the name of the library object. test -z "$libobj" && { func_basename "$srcfile" libobj="$func_basename_result" } ;; esac # Recognize several different file suffixes. # If the user specifies -o file.o, it is replaced with file.lo case $libobj in *.[cCFSifmso] | \ *.ada | *.adb | *.ads | *.asm | \ *.c++ | *.cc | *.ii | *.class | *.cpp | *.cxx | \ *.[fF][09]? | *.for | *.java | *.go | *.obj | *.sx | *.cu | *.cup) func_xform "$libobj" libobj=$func_xform_result ;; esac case $libobj in *.lo) func_lo2o "$libobj"; obj=$func_lo2o_result ;; *) func_fatal_error "cannot determine name of library object from \`$libobj'" ;; esac func_infer_tag $base_compile for arg in $later; do case $arg in -shared) test "$build_libtool_libs" != yes && \ func_fatal_configuration "can not build a shared library" build_old_libs=no continue ;; -static) build_libtool_libs=no build_old_libs=yes continue ;; -prefer-pic) pic_mode=yes continue ;; -prefer-non-pic) pic_mode=no continue ;; esac done func_quote_for_eval "$libobj" test "X$libobj" != "X$func_quote_for_eval_result" \ && $ECHO "X$libobj" | $GREP '[]~#^*{};<>?"'"'"' &()|`$[]' \ && func_warning "libobj name \`$libobj' may not contain shell special characters." func_dirname_and_basename "$obj" "/" "" objname="$func_basename_result" xdir="$func_dirname_result" lobj=${xdir}$objdir/$objname test -z "$base_compile" && \ func_fatal_help "you must specify a compilation command" # Delete any leftover library objects. if test "$build_old_libs" = yes; then removelist="$obj $lobj $libobj ${libobj}T" else removelist="$lobj $libobj ${libobj}T" fi # On Cygwin there's no "real" PIC flag so we must build both object types case $host_os in cygwin* | mingw* | pw32* | os2* | cegcc*) pic_mode=default ;; esac if test "$pic_mode" = no && test "$deplibs_check_method" != pass_all; then # non-PIC code in shared libraries is not supported pic_mode=default fi # 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 "$srcfile" | $SED 's%^.*/%%; s%\.[^.]*$%%'`.${objext} lockfile="$output_obj.lock" else output_obj= need_locks=no lockfile= fi # Lock this critical section if it is needed # We use this script file to make the link, it avoids creating a new file if test "$need_locks" = yes; then until $opt_dry_run || ln "$progpath" "$lockfile" 2>/dev/null; do func_echo "Waiting for $lockfile to be removed" sleep 2 done elif test "$need_locks" = warn; then if test -f "$lockfile"; then $ECHO "\ *** ERROR, $lockfile exists and contains: `cat $lockfile 2>/dev/null` This indicates that another process is trying to use the same temporary object file, and libtool could not work around it because your compiler does not support \`-c' and \`-o' together. If you repeat this compilation, it may succeed, by chance, but you had better avoid parallel builds (make -j) in this platform, or get a better compiler." $opt_dry_run || $RM $removelist exit $EXIT_FAILURE fi func_append removelist " $output_obj" $ECHO "$srcfile" > "$lockfile" fi $opt_dry_run || $RM $removelist func_append removelist " $lockfile" trap '$opt_dry_run || $RM $removelist; exit $EXIT_FAILURE' 1 2 15 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 # Only build a PIC object if we are building libtool libraries. if test "$build_libtool_libs" = yes; then # Without this assignment, base_compile gets emptied. fbsd_hideous_sh_bug=$base_compile if test "$pic_mode" != no; then command="$base_compile $qsrcfile $pic_flag" else # Don't build PIC code command="$base_compile $qsrcfile" fi func_mkdir_p "$xdir$objdir" if test -z "$output_obj"; then # Place PIC objects in $objdir func_append command " -o $lobj" fi func_show_eval_locale "$command" \ 'test -n "$output_obj" && $RM $removelist; exit $EXIT_FAILURE' if test "$need_locks" = warn && test "X`cat $lockfile 2>/dev/null`" != "X$srcfile"; then $ECHO "\ *** ERROR, $lockfile contains: `cat $lockfile 2>/dev/null` but it should contain: $srcfile This indicates that another process is trying to use the same temporary object file, and libtool could not work around it because your compiler does not support \`-c' and \`-o' together. If you repeat this compilation, it may succeed, by chance, but you had better avoid parallel builds (make -j) in this platform, or get a better compiler." $opt_dry_run || $RM $removelist exit $EXIT_FAILURE fi # Just move the object if needed, then go on to compile the next one if test -n "$output_obj" && test "X$output_obj" != "X$lobj"; then func_show_eval '$MV "$output_obj" "$lobj"' \ 'error=$?; $opt_dry_run || $RM $removelist; exit $error' fi # Allow error messages only from the first compilation. if test "$suppress_opt" = yes; then suppress_output=' >/dev/null 2>&1' fi fi # Only build a position-dependent object if we build old libraries. if test "$build_old_libs" = yes; then if test "$pic_mode" != yes; then # Don't build PIC code command="$base_compile $qsrcfile$pie_flag" else command="$base_compile $qsrcfile $pic_flag" fi if test "$compiler_c_o" = yes; then func_append command " -o $obj" fi # Suppress compiler output if we already did a PIC compilation. func_append command "$suppress_output" func_show_eval_locale "$command" \ '$opt_dry_run || $RM $removelist; exit $EXIT_FAILURE' if test "$need_locks" = warn && test "X`cat $lockfile 2>/dev/null`" != "X$srcfile"; then $ECHO "\ *** ERROR, $lockfile contains: `cat $lockfile 2>/dev/null` but it should contain: $srcfile This indicates that another process is trying to use the same temporary object file, and libtool could not work around it because your compiler does not support \`-c' and \`-o' together. If you repeat this compilation, it may succeed, by chance, but you had better avoid parallel builds (make -j) in this platform, or get a better compiler." $opt_dry_run || $RM $removelist exit $EXIT_FAILURE fi # Just move the object if needed if test -n "$output_obj" && test "X$output_obj" != "X$obj"; then func_show_eval '$MV "$output_obj" "$obj"' \ 'error=$?; $opt_dry_run || $RM $removelist; exit $error' fi fi $opt_dry_run || { func_write_libtool_object "$libobj" "$objdir/$objname" "$objname" # Unlock the critical section if it was locked if test "$need_locks" != no; then removelist=$lockfile $RM "$lockfile" fi } exit $EXIT_SUCCESS } $opt_help || { test "$opt_mode" = compile && func_mode_compile ${1+"$@"} } func_mode_help () { # We need to display help for each of the modes. case $opt_mode in "") # Generic help is extracted from the usage comments # at the start of this file. func_help ;; clean) $ECHO \ "Usage: $progname [OPTION]... --mode=clean RM [RM-OPTION]... FILE... Remove files from the build directory. RM is the name of the program to use to delete files associated with each FILE (typically \`/bin/rm'). RM-OPTIONS are options (such as \`-f') to be passed to RM. If FILE is a libtool library, object or program, all the files associated with it are deleted. Otherwise, only FILE itself is deleted using RM." ;; compile) $ECHO \ "Usage: $progname [OPTION]... --mode=compile COMPILE-COMMAND... SOURCEFILE Compile a source file into a libtool library object. This mode accepts the following additional options: -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 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. The output file name is determined by removing the directory component from SOURCEFILE, then substituting the C source code suffix \`.c' with the library object suffix, \`.lo'." ;; execute) $ECHO \ "Usage: $progname [OPTION]... --mode=execute COMMAND [ARGS]... Automatically set library path, then run a program. This mode accepts the following additional options: -dlopen FILE add the directory containing FILE to the library path This mode sets the library path environment variable according to \`-dlopen' flags. If any of the ARGS are libtool executable wrappers, then they are translated into their corresponding uninstalled binary, and any of their required library directories are added to the library path. Then, COMMAND is executed, with ARGS as arguments." ;; finish) $ECHO \ "Usage: $progname [OPTION]... --mode=finish [LIBDIR]... Complete the installation of libtool libraries. Each LIBDIR is a directory that contains libtool libraries. The commands that this mode executes may require superuser privileges. Use the \`--dry-run' option if you just want to see what would be executed." ;; install) $ECHO \ "Usage: $progname [OPTION]... --mode=install INSTALL-COMMAND... Install executables or libraries. INSTALL-COMMAND is the installation command. The first component should be either the \`install' or \`cp' program. The following components of INSTALL-COMMAND are treated specially: -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)." ;; link) $ECHO \ "Usage: $progname [OPTION]... --mode=link LINK-COMMAND... Link object files or libraries together to form another library, or to create an executable program. LINK-COMMAND is a command using the C compiler that you would use to create a program from several object files. The following components of LINK-COMMAND are treated specially: -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) -export-symbols SYMFILE try to export only the symbols listed in SYMFILE -export-symbols-regex REGEX try to export only the symbols matching REGEX -LLIBDIR search LIBDIR for required installed libraries -lNAME OUTPUT-FILE requires the installed library libNAME -module build a library that can dlopened -no-fast-install disable the fast-install mode -no-install link a not-installable executable -no-undefined declare that a library does not refer to external symbols -o OUTPUT-FILE create OUTPUT-FILE from the specified objects -objectlist FILE Use a list of object files found in FILE to specify objects -precious-files-regex REGEX don't remove output files matching REGEX -release RELEASE specify package release information -rpath LIBDIR the created library will eventually be installed in LIBDIR -R[ ]LIBDIR add LIBDIR to the runtime path of programs and libraries -shared only do dynamic linking of libtool libraries -shrext SUFFIX override the standard shared library file extension -static do not do any dynamic linking of uninstalled libtool libraries -static-libtool-libs do not do any dynamic linking of libtool libraries -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. Every other argument is treated as a filename. Files ending in \`.la' are treated as uninstalled libtool libraries, other files are standard or library object files. If the OUTPUT-FILE ends in \`.la', then a libtool library is created, only library objects (\`.lo' files) may be specified, and \`-rpath' is required, except when creating a convenience library. If OUTPUT-FILE ends in \`.a' or \`.lib', then a standard library is created using \`ar' and \`ranlib', or on Windows using \`lib'. If OUTPUT-FILE ends in \`.lo' or \`.${objext}', then a reloadable object file is created, otherwise an executable program is created." ;; uninstall) $ECHO \ "Usage: $progname [OPTION]... --mode=uninstall RM [RM-OPTION]... FILE... Remove libraries from an installation directory. RM is the name of the program to use to delete files associated with each FILE (typically \`/bin/rm'). RM-OPTIONS are options (such as \`-f') to be passed to RM. If FILE is a libtool library, all the files associated with it are deleted. Otherwise, only FILE itself is deleted using RM." ;; *) func_fatal_help "invalid operation mode \`$opt_mode'" ;; esac echo $ECHO "Try \`$progname --help' for more information about other modes." } # 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... func_mode_execute () { $opt_debug # The first argument is the command name. cmd="$nonopt" test -z "$cmd" && \ func_fatal_help "you must specify a COMMAND" # Handle -dlopen flags immediately. 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" # Read the libtool library. dlname= library_names= func_source "$file" # Skip this library if it cannot be dlopened. if test -z "$dlname"; then # Warn if it was a shared library. test -n "$library_names" && \ func_warning "\`$file' was not linked with \`-export-dynamic'" continue fi func_dirname "$file" "" "." dir="$func_dirname_result" if test -f "$dir/$objdir/$dlname"; then func_append dir "/$objdir" else if test ! -f "$dir/$dlname"; then func_fatal_error "cannot find \`$dlname' in \`$dir' or \`$dir/$objdir'" fi fi ;; *.lo) # Just add the directory containing the .lo file. func_dirname "$file" "" "." dir="$func_dirname_result" ;; *) func_warning "\`-dlopen' is ignored for non-libtool libraries and objects" continue ;; esac # Get the absolute pathname. absdir=`cd "$dir" && pwd` test -n "$absdir" && dir="$absdir" # Now add the directory to shlibpath_var. if eval "test -z \"\$$shlibpath_var\""; then eval "$shlibpath_var=\"\$dir\"" else eval "$shlibpath_var=\"\$dir:\$$shlibpath_var\"" fi done # This variable tells wrapper scripts just to set shlibpath_var # rather than running their programs. libtool_execute_magic="$magic" # Check if any of the arguments is a wrapper script. args= 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 func_source "$file" # Transform arg to wrapped name. file="$progdir/$program" elif func_ltwrapper_executable_p "$file"; then func_ltwrapper_scriptname "$file" func_source "$func_ltwrapper_scriptname_result" # Transform arg to wrapped name. file="$progdir/$program" fi ;; esac # Quote arguments (to preserve shell metacharacters). func_append_quoted args "$file" done if test "X$opt_dry_run" = Xfalse; then if test -n "$shlibpath_var"; then # Export the shlibpath_var. eval "export $shlibpath_var" fi # Restore saved environment variables for lt_var in LANG LANGUAGE LC_ALL LC_CTYPE LC_COLLATE LC_MESSAGES do eval "if test \"\${save_$lt_var+set}\" = set; then $lt_var=\$save_$lt_var; export $lt_var else $lt_unset $lt_var fi" done # Now prepare to actually exec the command. exec_cmd="\$cmd$args" else # Display what would be done. if test -n "$shlibpath_var"; then eval "\$ECHO \"\$shlibpath_var=\$$shlibpath_var\"" echo "export $shlibpath_var" fi $ECHO "$cmd$args" exit $EXIT_SUCCESS fi } 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 # 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 libdir in $libdirs; do if test -n "$finish_cmds"; then # Do each command in the finish commands. func_execute_cmds "$finish_cmds" 'admincmds="$admincmds '"$cmd"'"' fi if test -n "$finish_eval"; then # Do the single finish_eval. eval cmds=\"$finish_eval\" $opt_dry_run || eval "$cmds" || func_append admincmds " $cmds" fi done fi # Exit here if they wanted silent mode. $opt_silent && exit $EXIT_SUCCESS 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 "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 "$opt_mode" = finish && func_mode_finish ${1+"$@"} # func_mode_install arg... func_mode_install () { $opt_debug # There may be an optional sh(1) argument at the beginning of # install_prog (especially on Windows NT). if test "$nonopt" = "$SHELL" || test "$nonopt" = /bin/sh || # Allow the use of GNU shtool's install command. case $nonopt in *shtool*) :;; *) false;; esac; then # Aesthetically quote it. func_quote_for_eval "$nonopt" install_prog="$func_quote_for_eval_result " arg=$1 shift else install_prog= arg=$nonopt fi # The real first argument should be the name of the installation program. # Aesthetically quote it. func_quote_for_eval "$arg" 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= files= opts= prev= install_type= isdir=no stripme= no_mode=: for arg do arg2= if test -n "$dest"; then func_append files " $dest" dest=$arg continue fi case $arg in -d) isdir=yes ;; -f) if $install_cp; then :; else prev=$arg fi ;; -g | -m | -o) prev=$arg ;; -s) stripme=" -s" continue ;; -*) ;; *) # 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 continue fi ;; esac # Aesthetically quote the argument. func_quote_for_eval "$arg" 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" && \ func_fatal_help "you must specify an install program" 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" else func_fatal_help "you must specify a destination" fi fi # Strip any trailing slash from the destination. func_stripname '' '/' "$dest" dest=$func_stripname_result # Check to see that the destination is a directory. test -d "$dest" && isdir=yes if test "$isdir" = yes; then destdir="$dest" destname= else func_dirname_and_basename "$dest" "" "." destdir="$func_dirname_result" destname="$func_basename_result" # Not a directory, so check to see that there is only one file specified. set dummy $files; shift test "$#" -gt 1 && \ func_fatal_help "\`$dest' is not a directory" fi case $destdir in [\\/]* | [A-Za-z]:[\\/]*) ;; *) for file in $files; do case $file in *.lo) ;; *) func_fatal_help "\`$destdir' must be an absolute directory name" ;; esac done ;; esac # This variable tells wrapper scripts just to set variables rather # than running their programs. libtool_install_magic="$magic" staticlibs= future_libdirs= current_libdirs= for file in $files; do # Do each installation. case $file in *.$libext) # Do the static libraries later. 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" library_names= old_library= relink_command= func_source "$file" # Add the libdir to current_libdirs if it is the destination. if test "X$destdir" = "X$libdir"; then case "$current_libdirs " in *" $libdir "*) ;; *) func_append current_libdirs " $libdir" ;; esac else # Note the libdir as a future libdir. case "$future_libdirs " in *" $libdir "*) ;; *) func_append future_libdirs " $libdir" ;; esac fi func_dirname "$file" "/" "" dir="$func_dirname_result" 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 "$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 # are installed to the same prefix. # At present, this check doesn't affect windows .dll's that # are installed into $libdir/../bin (currently, that works fine) # but it's something to keep an eye on. test "$inst_prefix_dir" = "$destdir" && \ func_fatal_error "error: cannot install \`$file' to a directory not ending in $libdir" if test -n "$inst_prefix_dir"; then # Stick the inst_prefix_dir data into the link command. relink_command=`$ECHO "$relink_command" | $SED "s%@inst_prefix_dir@%-inst-prefix-dir $inst_prefix_dir%"` else relink_command=`$ECHO "$relink_command" | $SED "s%@inst_prefix_dir@%%"` fi func_warning "relinking \`$file'" func_show_eval "$relink_command" \ 'func_fatal_error "error: relink \`$file'\'' with the above command before installing it"' fi # See the names of the shared library. set dummy $library_names; shift if test -n "$1"; then realname="$1" shift srcname="$realname" test -n "$relink_command" && srcname="$realname"T # Install the shared library and build the symlinks. func_show_eval "$install_shared_prog $dir/$srcname $destdir/$realname" \ 'exit $?' tstripme="$stripme" case $host_os in cygwin* | mingw* | pw32* | cegcc*) case $realname in *.dll.a) tstripme="" ;; esac ;; esac if test -n "$tstripme" && test -n "$striplib"; then func_show_eval "$striplib $destdir/$realname" 'exit $?' fi if test "$#" -gt 0; then # Delete the old symlinks, and create new ones. # Try `ln -sf' first, because the `ln' binary might depend on # the symlink we replace! Solaris /bin/ln does not understand -f, # so we also need to try rm && ln -s. for linkname do test "$linkname" != "$realname" \ && func_show_eval "(cd $destdir && { $LN_S -f $realname $linkname || { $RM $linkname && $LN_S $realname $linkname; }; })" done fi # Do each command in the postinstall commands. lib="$destdir/$realname" func_execute_cmds "$postinstall_cmds" 'exit $?' fi # Install the pseudo-library for information purposes. func_basename "$file" name="$func_basename_result" instname="$dir/$name"i func_show_eval "$install_prog $instname $destdir/$name" 'exit $?' # Maybe install the static library, too. test -n "$old_library" && func_append staticlibs " $dir/$old_library" ;; *.lo) # Install (i.e. copy) a libtool object. # Figure out destination file name, if it wasn't already specified. if test -n "$destname"; then destfile="$destdir/$destname" else func_basename "$file" destfile="$func_basename_result" destfile="$destdir/$destfile" fi # Deduce the name of the destination old-style object file. case $destfile in *.lo) func_lo2o "$destfile" staticdest=$func_lo2o_result ;; *.$objext) staticdest="$destfile" destfile= ;; *) func_fatal_help "cannot copy a libtool object to \`$destfile'" ;; esac # Install the libtool object if requested. test -n "$destfile" && \ func_show_eval "$install_prog $file $destfile" 'exit $?' # Install the old object if enabled. if test "$build_old_libs" = yes; then # Deduce the name of the old-style object file. func_lo2o "$file" staticobj=$func_lo2o_result func_show_eval "$install_prog \$staticobj \$staticdest" 'exit $?' fi exit $EXIT_SUCCESS ;; *) # Figure out destination file name, if it wasn't already specified. if test -n "$destname"; then destfile="$destdir/$destname" else func_basename "$file" destfile="$func_basename_result" destfile="$destdir/$destfile" fi # If the file is missing, and there is a .exe on the end, strip it # because it is most likely a libtool script we actually want to # install stripped_ext="" case $file in *.exe) if test ! -f "$file"; then func_stripname '' '.exe' "$file" file=$func_stripname_result stripped_ext=".exe" fi ;; esac # Do a test to see if this is really a libtool program. case $host in *cygwin* | *mingw*) if func_ltwrapper_executable_p "$file"; then func_ltwrapper_scriptname "$file" wrapper=$func_ltwrapper_scriptname_result else func_stripname '' '.exe' "$file" wrapper=$func_stripname_result fi ;; *) wrapper=$file ;; esac if func_ltwrapper_script_p "$wrapper"; then notinst_deplibs= relink_command= func_source "$wrapper" # Check the variables that should have been set. test -z "$generated_by_libtool_version" && \ func_fatal_error "invalid libtool wrapper script \`$wrapper'" finalize=yes for lib in $notinst_deplibs; do # Check to see that each library is installed. libdir= if test -f "$lib"; then func_source "$lib" fi 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 fi done relink_command= func_source "$wrapper" outputname= if test "$fast_install" = no && test -n "$relink_command"; then $opt_dry_run || { if test "$finalize" = yes; then tmpdir=`func_mktempdir` func_basename "$file$stripped_ext" file="$func_basename_result" outputname="$tmpdir/$file" # Replace the output file specification. relink_command=`$ECHO "$relink_command" | $SED 's%@OUTPUT@%'"$outputname"'%g'` $opt_silent || { func_quote_for_expand "$relink_command" eval "func_echo $func_quote_for_expand_result" } if eval "$relink_command"; then : else func_error "error: relink \`$file' with the above command before installing it" $opt_dry_run || ${RM}r "$tmpdir" continue fi file="$outputname" else func_warning "cannot relink \`$file'" fi } else # Install the binary that we compiled earlier. file=`$ECHO "$file$stripped_ext" | $SED "s%\([^/]*\)$%$objdir/\1%"` fi fi # remove .exe since cygwin /usr/bin/install will append another # one anyway case $install_prog,$host in */usr/bin/install*,*cygwin*) case $file:$destfile in *.exe:*.exe) # this is ok ;; *.exe:*) destfile=$destfile.exe ;; *:*.exe) func_stripname '' '.exe' "$destfile" destfile=$func_stripname_result ;; esac ;; esac func_show_eval "$install_prog\$stripme \$file \$destfile" 'exit $?' $opt_dry_run || if test -n "$outputname"; then ${RM}r "$tmpdir" fi ;; esac done for file in $staticlibs; do func_basename "$file" name="$func_basename_result" # 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 $tool_oldlib" 'exit $?' fi # Do each command in the postinstall commands. func_execute_cmds "$old_postinstall_cmds" 'exit $?' done test -n "$future_libdirs" && \ func_warning "remember to run \`$progname --finish$future_libdirs'" if test -n "$current_libdirs"; then # Maybe just do a dry run. $opt_dry_run && current_libdirs=" -n$current_libdirs" exec_cmd='$SHELL $progpath $preserve_args --finish$current_libdirs' else exit $EXIT_SUCCESS fi } test "$opt_mode" = install && func_mode_install ${1+"$@"} # func_generate_dlsyms outputname originator pic_p # Extract symbols from dlprefiles and create ${outputname}S.o with # a dlpreopen symbol table. func_generate_dlsyms () { $opt_debug my_outputname="$1" my_originator="$2" my_pic_p="${3-no}" my_prefix=`$ECHO "$my_originator" | sed 's%[^a-zA-Z0-9]%_%g'` my_dlsyms= if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then if test -n "$NM" && test -n "$global_symbol_pipe"; then my_dlsyms="${my_outputname}S.c" else func_error "not configured to extract global symbols from dlpreopened files" fi fi if test -n "$my_dlsyms"; then case $my_dlsyms in "") ;; *.c) # Discover the nlist of each of the dlfiles. nlist="$output_objdir/${my_outputname}.nm" func_show_eval "$RM $nlist ${nlist}S ${nlist}T" # Parse the name list into a source file. func_verbose "creating $output_objdir/$my_dlsyms" $opt_dry_run || $ECHO > "$output_objdir/$my_dlsyms" "\ /* $my_dlsyms - symbol resolution table for \`$my_outputname' dlsym emulation. */ /* Generated by $PROGRAM (GNU $PACKAGE$TIMESTAMP) $VERSION */ #ifdef __cplusplus 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. */\ " if test "$dlself" = yes; then func_verbose "generating symbol list for \`$output'" $opt_dry_run || echo ': @PROGRAM@ ' > "$nlist" # Add our own program objects to the symbol list. progfiles=`$ECHO "$objs$old_deplibs" | $SP2NL | $SED "$lo2o" | $NL2SP` for progfile in $progfiles; do 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 $opt_dry_run || { eval '$EGREP -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T' eval '$MV "$nlist"T "$nlist"' } fi if test -n "$export_symbols_regex"; then $opt_dry_run || { eval '$EGREP -e "$export_symbols_regex" "$nlist" > "$nlist"T' eval '$MV "$nlist"T "$nlist"' } fi # Prepare the list of exported symbols if test -z "$export_symbols"; then export_symbols="$output_objdir/$outputname.exp" $opt_dry_run || { $RM $export_symbols eval "${SED} -n -e '/^: @PROGRAM@ $/d' -e 's/^.* \(.*\)$/\1/p' "'< "$nlist" > "$export_symbols"' case $host in *cygwin* | *mingw* | *cegcc* ) eval "echo EXPORTS "'> "$output_objdir/$outputname.def"' eval 'cat "$export_symbols" >> "$output_objdir/$outputname.def"' ;; esac } else $opt_dry_run || { eval "${SED} -e 's/\([].[*^$]\)/\\\\\1/g' -e 's/^/ /' -e 's/$/$/'"' < "$export_symbols" > "$output_objdir/$outputname.exp"' eval '$GREP -f "$output_objdir/$outputname.exp" < "$nlist" > "$nlist"T' eval '$MV "$nlist"T "$nlist"' case $host in *cygwin* | *mingw* | *cegcc* ) eval "echo EXPORTS "'> "$output_objdir/$outputname.def"' eval 'cat "$nlist" >> "$output_objdir/$outputname.def"' ;; esac } fi fi for dlprefile in $dlprefiles; do func_verbose "extracting global C symbols from \`$dlprefile'" func_basename "$dlprefile" name="$func_basename_result" 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 || { # Make sure we have at least an empty file. test -f "$nlist" || : > "$nlist" if test -n "$exclude_expsyms"; then $EGREP -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T $MV "$nlist"T "$nlist" fi # Try sorting and uniquifying the output. if $GREP -v "^: " < "$nlist" | if sort -k 3 /dev/null 2>&1; then sort -k 3 else sort +2 fi | uniq > "$nlist"S; then : else $GREP -v "^: " < "$nlist" > "$nlist"S fi if test -f "$nlist"S; then eval "$global_symbol_to_cdecl"' < "$nlist"S >> "$output_objdir/$my_dlsyms"' else echo '/* NONE */' >> "$output_objdir/$my_dlsyms" fi echo >> "$output_objdir/$my_dlsyms" "\ /* The mapping between symbol names and symbols. */ typedef struct { const char *name; void *address; } lt_dlsymlist; extern LT_DLSYM_CONST lt_dlsymlist lt_${my_prefix}_LTX_preloaded_symbols[]; LT_DLSYM_CONST lt_dlsymlist lt_${my_prefix}_LTX_preloaded_symbols[] = {\ { \"$my_originator\", (void *) 0 }," case $need_lib_prefix in no) eval "$global_symbol_to_c_name_address" < "$nlist" >> "$output_objdir/$my_dlsyms" ;; *) eval "$global_symbol_to_c_name_address_lib_prefix" < "$nlist" >> "$output_objdir/$my_dlsyms" ;; esac echo >> "$output_objdir/$my_dlsyms" "\ {0, (void *) 0} }; /* This works around a problem in FreeBSD linker */ #ifdef FREEBSD_WORKAROUND static const void *lt_preloaded_setup() { return lt_${my_prefix}_LTX_preloaded_symbols; } #endif #ifdef __cplusplus } #endif\ " } # !$opt_dry_run pic_flag_for_symtable= case "$compile_command " in *" -static "*) ;; *) case $host in # compiling the symbol table file with pic_flag works around # a FreeBSD bug that causes programs to crash when -lm is # 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*) pic_flag_for_symtable=" $pic_flag -DFREEBSD_WORKAROUND" ;; *-*-hpux*) pic_flag_for_symtable=" $pic_flag" ;; *) if test "X$my_pic_p" != Xno; then pic_flag_for_symtable=" $pic_flag" fi ;; esac ;; esac symtab_cflags= for arg in $LTCFLAGS; do case $arg in -pie | -fpie | -fPIE) ;; *) func_append symtab_cflags " $arg" ;; esac done # Now compile the dynamic symbol file. func_show_eval '(cd $output_objdir && $LTCC$symtab_cflags -c$no_builtin_flag$pic_flag_for_symtable "$my_dlsyms")' 'exit $?' # Clean up the generated files. func_show_eval '$RM "$output_objdir/$my_dlsyms" "$nlist" "${nlist}S" "${nlist}T"' # Transform the symbol file into the correct name. symfileobj="$output_objdir/${my_outputname}S.$objext" case $host in *cygwin* | *mingw* | *cegcc* ) if test -f "$output_objdir/$my_outputname.def"; then 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 "$compile_command" | $SED "s%@SYMFILE@%$symfileobj%"` finalize_command=`$ECHO "$finalize_command" | $SED "s%@SYMFILE@%$symfileobj%"` fi ;; *) compile_command=`$ECHO "$compile_command" | $SED "s%@SYMFILE@%$symfileobj%"` finalize_command=`$ECHO "$finalize_command" | $SED "s%@SYMFILE@%$symfileobj%"` ;; esac ;; *) func_fatal_error "unknown suffix for \`$my_dlsyms'" ;; esac else # We keep going just in case the user didn't refer to # lt_preloaded_symbols. The linker will fail if global_symbol_pipe # really was required. # Nullify the symbol file. compile_command=`$ECHO "$compile_command" | $SED "s% @SYMFILE@%%"` finalize_command=`$ECHO "$finalize_command" | $SED "s% @SYMFILE@%%"` fi } # func_win32_libid arg # return the library type of file 'arg' # # 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 win32_libid_type="unknown" win32_fileres=`file -L $1 2>/dev/null` case $win32_fileres in *ar\ archive\ import\ library*) # definitely import 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 (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 /{ s,.*,import, p q } }'` case $win32_nmres in import*) win32_libid_type="x86 archive import";; *) win32_libid_type="x86 archive static";; esac fi ;; *DLL*) win32_libid_type="x86 DLL" ;; *executable*) # but shell scripts are "executable" too... case $win32_fileres in *MS\ Windows\ PE\ Intel*) win32_libid_type="x86 DLL" ;; esac ;; esac $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 func_extract_an_archive () { $opt_debug f_ex_an_ar_dir="$1"; shift f_ex_an_ar_oldlib="$1" 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 func_fatal_error "object name conflicts in archive: $f_ex_an_ar_dir/$f_ex_an_ar_oldlib" fi } # func_extract_archives gentop oldlib ... func_extract_archives () { $opt_debug my_gentop="$1"; shift my_oldlibs=${1+"$@"} my_oldobjs="" my_xlib="" my_xabs="" my_xdir="" for my_xlib in $my_oldlibs; do # Extract the objects. case $my_xlib in [\\/]* | [A-Za-z]:[\\/]*) my_xabs="$my_xlib" ;; *) my_xabs=`pwd`"/$my_xlib" ;; esac func_basename "$my_xlib" my_xlib="$func_basename_result" my_xlib_u=$my_xlib while :; do case " $extracted_archives " in *" $my_xlib_u "*) func_arith $extracted_serial + 1 extracted_serial=$func_arith_result my_xlib_u=lt$extracted_serial-$my_xlib ;; *) break ;; esac done extracted_archives="$extracted_archives $my_xlib_u" my_xdir="$my_gentop/$my_xlib_u" func_mkdir_p "$my_xdir" case $host in *-darwin*) func_verbose "Extracting $my_xabs" # Do not bother doing anything if just a dry run $opt_dry_run || { darwin_orig_dir=`pwd` cd $my_xdir || exit $? darwin_archive=$my_xabs darwin_curdir=`pwd` darwin_base_archive=`basename "$darwin_archive"` darwin_arches=`$LIPO -info "$darwin_archive" 2>/dev/null | $GREP Architectures 2>/dev/null || true` if test -n "$darwin_arches"; then darwin_arches=`$ECHO "$darwin_arches" | $SED -e 's/.*are://'` darwin_arch= func_verbose "$darwin_base_archive has multiple architectures $darwin_arches" for darwin_arch in $darwin_arches ; do func_mkdir_p "unfat-$$/${darwin_base_archive}-${darwin_arch}" $LIPO -thin $darwin_arch -output "unfat-$$/${darwin_base_archive}-${darwin_arch}/${darwin_base_archive}" "${darwin_archive}" cd "unfat-$$/${darwin_base_archive}-${darwin_arch}" func_extract_an_archive "`pwd`" "${darwin_base_archive}" cd "$darwin_curdir" $RM "unfat-$$/${darwin_base_archive}-${darwin_arch}/${darwin_base_archive}" done # $darwin_arches ## Okay now we've a bunch of thin objects, gotta fatten them up :) darwin_filelist=`find unfat-$$ -type f -name \*.o -print -o -name \*.lo -print | $SED -e "$basename" | sort -u` darwin_file= darwin_files= for darwin_file in $darwin_filelist; do darwin_files=`find unfat-$$ -name $darwin_file -print | sort | $NL2SP` $LIPO -create -output "$darwin_file" $darwin_files done # $darwin_filelist $RM -rf unfat-$$ cd "$darwin_orig_dir" else cd $darwin_orig_dir func_extract_an_archive "$my_xdir" "$my_xabs" fi # $darwin_arches } # !$opt_dry_run ;; *) func_extract_an_archive "$my_xdir" "$my_xabs" ;; esac 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 [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=${1-no} $ECHO "\ #! $SHELL # $output - temporary wrapper script for $objdir/$outputname # Generated by $PROGRAM (GNU $PACKAGE$TIMESTAMP) $VERSION # # The $output program cannot be directly executed until all the libtool # libraries that it depends on are installed. # # This wrapper script should never be moved out of the build directory. # If it is, it will not operate correctly. # Sed substitution that helps us do robust quoting. It backslashifies # metacharacters that are still active within double-quoted strings. sed_quote_subst='$sed_quote_subst' # Be Bourne compatible if test -n \"\${ZSH_VERSION+set}\" && (emulate sh) >/dev/null 2>&1; then emulate sh NULLCMD=: # Zsh 3.x and 4.x performs word splitting on \${1+\"\$@\"}, which # is contrary to our usage. Disable this feature. alias -g '\${1+\"\$@\"}'='\"\$@\"' setopt NO_GLOB_SUBST else case \`(set -o) 2>/dev/null\` in *posix*) set -o posix;; esac fi BIN_SH=xpg4; export BIN_SH # for Tru64 DUALCASE=1; export DUALCASE # for MKS sh # 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 relink_command=\"$relink_command\" # This environment variable determines our operation mode. if test \"\$libtool_install_magic\" = \"$magic\"; then # install mode needs the following variables: generated_by_libtool_version='$macro_version' notinst_deplibs='$notinst_deplibs' else # When we are sourced in execute mode, \$file and \$ECHO are already set. if test \"\$libtool_execute_magic\" != \"$magic\"; then 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 () { " 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 \"\$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'\` while test -n \"\$file\"; do destdir=\`\$ECHO \"\$file\" | $SED 's%/[^/]*\$%%'\` # If there was a directory component, then change thisdir. if test \"x\$destdir\" != \"x\$file\"; then case \"\$destdir\" in [\\\\/]* | [A-Za-z]:[\\\\/]*) thisdir=\"\$destdir\" ;; *) thisdir=\"\$thisdir/\$destdir\" ;; esac fi file=\`\$ECHO \"\$file\" | $SED 's%^.*/%%'\` file=\`ls -ld \"\$thisdir/\$file\" | $SED -n 's/.*-> //p'\` done # Usually 'no', except on cygwin/mingw when embedded into # the cwrapper. 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 thisdir=\`pwd\` fi # remove .libs from thisdir case \"\$thisdir\" in *[\\\\/]$objdir ) thisdir=\`\$ECHO \"\$thisdir\" | $SED 's%[\\\\/][^\\\\/]*$%%'\` ;; $objdir ) thisdir=. ;; esac fi # Try to get the absolute directory name. absdir=\`cd \"\$thisdir\" && pwd\` test -n \"\$absdir\" && thisdir=\"\$absdir\" " if test "$fast_install" = yes; then $ECHO "\ program=lt-'$outputname'$exeext progdir=\"\$thisdir/$objdir\" if test ! -f \"\$progdir/\$program\" || { file=\`ls -1dt \"\$progdir/\$program\" \"\$progdir/../\$program\" 2>/dev/null | ${SED} 1q\`; \\ test \"X\$file\" != \"X\$progdir/\$program\"; }; then file=\"\$\$-\$program\" if test ! -d \"\$progdir\"; then $MKDIR \"\$progdir\" else $RM \"\$progdir/\$file\" fi" $ECHO "\ # relink executable if necessary if test -n \"\$relink_command\"; then if relink_command_output=\`eval \$relink_command 2>&1\`; then : else $ECHO \"\$relink_command_output\" >&2 $RM \"\$progdir/\$file\" exit 1 fi fi $MV \"\$progdir/\$file\" \"\$progdir/\$program\" 2>/dev/null || { $RM \"\$progdir/\$program\"; $MV \"\$progdir/\$file\" \"\$progdir/\$program\"; } $RM \"\$progdir/\$file\" fi" else $ECHO "\ program='$outputname' progdir=\"\$thisdir/$objdir\" " fi $ECHO "\ 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 "\ # Add our own library path to $shlibpath_var $shlibpath_var=\"$temp_rpath\$$shlibpath_var\" # 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 \"\$$shlibpath_var\" | $SED 's/::*\$//'\` export $shlibpath_var " fi $ECHO "\ if test \"\$libtool_execute_magic\" != \"$magic\"; then # Run the actual program with our arguments. 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 exit 1 fi fi\ " } # func_emit_cwrapperexe_src # emit the source code for a wrapper executable on stdout # Must ONLY be called from within func_mode_link because # it depends on a number of variable set therein. func_emit_cwrapperexe_src () { cat < #include #ifdef _MSC_VER # include # include # include #else # include # include # ifdef __CYGWIN__ # include # endif #endif #include #include #include #include #include #include #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) # define LT_PATHMAX MAXPATHLEN #else # define LT_PATHMAX 1024 #endif #ifndef S_IXOTH # define S_IXOTH 0 #endif #ifndef S_IXGRP # define S_IXGRP 0 #endif /* path handling portability macros */ #ifndef DIR_SEPARATOR # define DIR_SEPARATOR '/' # define PATH_SEPARATOR ':' #endif #if defined (_WIN32) || defined (__MSDOS__) || defined (__DJGPP__) || \ defined (__OS2__) # define HAVE_DOS_BASED_FILE_SYSTEM # define FOPEN_WB "wb" # ifndef DIR_SEPARATOR_2 # define DIR_SEPARATOR_2 '\\' # endif # ifndef PATH_SEPARATOR_2 # define PATH_SEPARATOR_2 ';' # endif #endif #ifndef DIR_SEPARATOR_2 # define IS_DIR_SEPARATOR(ch) ((ch) == DIR_SEPARATOR) #else /* DIR_SEPARATOR_2 */ # define IS_DIR_SEPARATOR(ch) \ (((ch) == DIR_SEPARATOR) || ((ch) == DIR_SEPARATOR_2)) #endif /* DIR_SEPARATOR_2 */ #ifndef PATH_SEPARATOR_2 # define IS_PATH_SEPARATOR(ch) ((ch) == PATH_SEPARATOR) #else /* PATH_SEPARATOR_2 */ # define IS_PATH_SEPARATOR(ch) ((ch) == PATH_SEPARATOR_2) #endif /* PATH_SEPARATOR_2 */ #ifndef FOPEN_WB # define FOPEN_WB "w" #endif #ifndef _O_BINARY # define _O_BINARY 0 #endif #define XMALLOC(type, num) ((type *) xmalloc ((num) * sizeof(type))) #define XFREE(stale) do { \ if (stale) { free ((void *) stale); stale = 0; } \ } while (0) #if defined(LT_DEBUGWRAPPER) static int lt_debug = 1; #else static int lt_debug = 0; #endif const char *program_name = "libtool-wrapper"; /* in case xstrdup fails */ void *xmalloc (size_t num); char *xstrdup (const char *string); const char *base_name (const char *name); char *find_executable (const char *wrapper); char *chase_symlinks (const char *pathspec); int make_executable (const char *path); int check_executable (const char *path); char *strendzap (char *str, const char *pat); 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_update_exe_path (const char *name, const char *value); void lt_update_lib_path (const char *name, const char *value); char **prepare_spawn (char **argv); void lt_dump_script (FILE *f); EOF cat <= 0) && (st.st_mode & (S_IXUSR | S_IXGRP | S_IXOTH))) return 1; else return 0; } int make_executable (const char *path) { int rval = 0; struct stat st; lt_debugprintf (__FILE__, __LINE__, "(make_executable): %s\n", nonempty (path)); if ((!path) || (!*path)) return 0; if (stat (path, &st) >= 0) { rval = chmod (path, st.st_mode | S_IXOTH | S_IXGRP | S_IXUSR); } return rval; } /* Searches for the full path of the wrapper. Returns newly allocated full path name if found, NULL otherwise Does not chase symlinks, even on platforms that support them. */ char * find_executable (const char *wrapper) { int has_slash = 0; const char *p; const char *p_next; /* static buffer for getcwd */ char tmp[LT_PATHMAX + 1]; int tmp_len; char *concat_name; lt_debugprintf (__FILE__, __LINE__, "(find_executable): %s\n", nonempty (wrapper)); if ((wrapper == NULL) || (*wrapper == '\0')) return NULL; /* Absolute path? */ #if defined (HAVE_DOS_BASED_FILE_SYSTEM) if (isalpha ((unsigned char) wrapper[0]) && wrapper[1] == ':') { concat_name = xstrdup (wrapper); if (check_executable (concat_name)) return concat_name; XFREE (concat_name); } else { #endif if (IS_DIR_SEPARATOR (wrapper[0])) { concat_name = xstrdup (wrapper); if (check_executable (concat_name)) return concat_name; XFREE (concat_name); } #if defined (HAVE_DOS_BASED_FILE_SYSTEM) } #endif for (p = wrapper; *p; p++) if (*p == '/') { has_slash = 1; break; } if (!has_slash) { /* no slashes; search PATH */ const char *path = getenv ("PATH"); if (path != NULL) { for (p = path; *p; p = p_next) { const char *q; size_t p_len; for (q = p; *q; q++) if (IS_PATH_SEPARATOR (*q)) break; p_len = q - p; p_next = (*q == '\0' ? q : q + 1); if (p_len == 0) { /* empty path: current directory */ if (getcwd (tmp, LT_PATHMAX) == NULL) 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); concat_name[tmp_len] = '/'; strcpy (concat_name + tmp_len + 1, wrapper); } else { concat_name = XMALLOC (char, p_len + 1 + strlen (wrapper) + 1); memcpy (concat_name, p, p_len); concat_name[p_len] = '/'; strcpy (concat_name + p_len + 1, wrapper); } if (check_executable (concat_name)) return concat_name; XFREE (concat_name); } } /* not found in PATH; assume curdir */ } /* Relative path | not found in path: prepend cwd */ if (getcwd (tmp, LT_PATHMAX) == NULL) 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); concat_name[tmp_len] = '/'; strcpy (concat_name + tmp_len + 1, wrapper); if (check_executable (concat_name)) return concat_name; XFREE (concat_name); return NULL; } char * chase_symlinks (const char *pathspec) { #ifndef S_ISLNK return xstrdup (pathspec); #else char buf[LT_PATHMAX]; struct stat s; char *tmp_pathspec = xstrdup (pathspec); char *p; int has_symlinks = 0; while (strlen (tmp_pathspec) && !has_symlinks) { 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) { has_symlinks = 1; break; } /* search backwards for last DIR_SEPARATOR */ p = tmp_pathspec + strlen (tmp_pathspec) - 1; while ((p > tmp_pathspec) && (!IS_DIR_SEPARATOR (*p))) p--; if ((p == tmp_pathspec) && (!IS_DIR_SEPARATOR (*p))) { /* no more DIR_SEPARATORS left */ break; } *p = '\0'; } else { lt_fatal (__FILE__, __LINE__, "error accessing file \"%s\": %s", tmp_pathspec, nonnull (strerror (errno))); } } XFREE (tmp_pathspec); if (!has_symlinks) { return xstrdup (pathspec); } tmp_pathspec = realpath (pathspec, buf); if (tmp_pathspec == 0) { lt_fatal (__FILE__, __LINE__, "could not follow symlinks for %s", pathspec); } return xstrdup (tmp_pathspec); #endif } char * strendzap (char *str, const char *pat) { size_t len, patlen; assert (str != NULL); assert (pat != NULL); len = strlen (str); patlen = strlen (pat); if (patlen <= len) { str += len - patlen; if (strcmp (str, pat) == 0) *str = '\0'; } 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 *file, int line, const char *mode, const char *message, va_list ap) { fprintf (stderr, "%s:%s:%d: %s: ", program_name, file, line, mode); vfprintf (stderr, message, ap); fprintf (stderr, ".\n"); if (exit_status >= 0) exit (exit_status); } void lt_fatal (const char *file, int line, const char *message, ...) { va_list ap; va_start (ap, message); 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) { 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 */ char *str = xstrdup (value); setenv (name, str, 1); #else int len = strlen (name) + 1 + strlen (value) + 1; char *str = XMALLOC (char, len); sprintf (str, "%s=%s", name, value); if (putenv (str) != EXIT_SUCCESS) { XFREE (str); } #endif } } char * lt_extend_str (const char *orig_value, const char *add, int to_end) { char *new_value; if (orig_value && *orig_value) { int orig_value_len = strlen (orig_value); int add_len = strlen (add); new_value = XMALLOC (char, add_len + orig_value_len + 1); if (to_end) { strcpy (new_value, orig_value); strcpy (new_value + orig_value_len, add); } else { strcpy (new_value, add); strcpy (new_value + add_len, orig_value); } } else { new_value = xstrdup (add); } return new_value; } void lt_update_exe_path (const char *name, const char *value) { lt_debugprintf (__FILE__, __LINE__, "(lt_update_exe_path) modifying '%s' by prepending '%s'\n", nonnull (name), nonnull (value)); if (name && *name && value && *value) { char *new_value = lt_extend_str (getenv (name), value, 0); /* some systems can't cope with a ':'-terminated path #' */ int len = strlen (new_value); while (((len = strlen (new_value)) > 0) && IS_PATH_SEPARATOR (new_value[len-1])) { new_value[len-1] = '\0'; } lt_setenv (name, new_value); XFREE (new_value); } } void lt_update_lib_path (const char *name, const char *value) { lt_debugprintf (__FILE__, __LINE__, "(lt_update_lib_path) modifying '%s' by prepending '%s'\n", nonnull (name), nonnull (value)); if (name && *name && value && *value) { char *new_value = lt_extend_str (getenv (name), value, 0); lt_setenv (name, new_value); XFREE (new_value); } } 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 () { $opt_debug case $host in *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-cegcc*) # It is impossible to link a dll without this setting, and # we shouldn't force the makefile maintainer to figure out # which system we are compiling for in order to pass an extra # flag for every libtool invocation. # allow_undefined=no # FIXME: Unfortunately, there are problems with the above when trying # to make a dll which has undefined symbols, in which case not # even a static library is built. For now, we need to specify # -no-undefined on the libtool link line when we can be certain # that all symbols are satisfied, otherwise we get a static library. allow_undefined=yes ;; *) allow_undefined=yes ;; esac libtool_args=$nonopt base_compile="$nonopt $@" compile_command=$nonopt finalize_command=$nonopt compile_rpath= finalize_rpath= compile_shlibpath= finalize_shlibpath= convenience= old_convenience= deplibs= old_deplibs= compiler_flags= linker_flags= dllsearchpath= lib_search_path=`pwd` inst_prefix_dir= new_inherited_linker_flags= avoid_version=no bindir= dlfiles= dlprefiles= dlself=no export_dynamic=no export_symbols= export_symbols_regex= generated= libobjs= ltlibs= module=no no_install=no objs= non_pic_objects= precious_files_regex= prefer_static_libs=no preload=no prev= prevarg= release= rpath= xrpath= perm_rpath= temp_rpath= thread_safe=no vinfo= vinfo_number=no weak_libs= single_module="${wl}-single_module" func_infer_tag $base_compile # We need to know -static, to get the right output filenames. for arg do case $arg in -shared) test "$build_libtool_libs" != yes && \ func_fatal_configuration "can not build a shared library" build_old_libs=no break ;; -all-static | -static | -static-libtool-libs) case $arg in -all-static) if test "$build_libtool_libs" = yes && test -z "$link_static_flag"; then func_warning "complete static linking is impossible in this configuration" fi if test -n "$link_static_flag"; then dlopen_self=$dlopen_self_static fi prefer_static_libs=yes ;; -static) if test -z "$pic_flag" && test -n "$link_static_flag"; then dlopen_self=$dlopen_self_static fi prefer_static_libs=built ;; -static-libtool-libs) if test -z "$pic_flag" && test -n "$link_static_flag"; then dlopen_self=$dlopen_self_static fi prefer_static_libs=yes ;; esac build_libtool_libs=no build_old_libs=yes break ;; esac done # See if our shared archives depend on static archives. test -n "$old_archive_from_new_cmds" && build_old_libs=yes # Go through the arguments, transforming them on the way. while test "$#" -gt 0; do arg="$1" shift func_quote_for_eval "$arg" qarg=$func_quote_for_eval_unquoted_result func_append libtool_args " $func_quote_for_eval_result" # If the previous option needs an argument, assign it. if test -n "$prev"; then case $prev in output) func_append compile_command " @OUTPUT@" func_append finalize_command " @OUTPUT@" ;; esac case $prev in bindir) bindir="$arg" prev= continue ;; dlfiles|dlprefiles) if test "$preload" = no; then # Add the symbol object into the linking commands. func_append compile_command " @SYMFILE@" func_append finalize_command " @SYMFILE@" preload=yes fi case $arg in *.la | *.lo) ;; # We handle these cases below. force) if test "$dlself" = no; then dlself=needless export_dynamic=yes fi prev= continue ;; self) if test "$prev" = dlprefiles; then dlself=yes elif test "$prev" = dlfiles && test "$dlopen_self" != yes; then dlself=yes else dlself=needless export_dynamic=yes fi prev= continue ;; *) if test "$prev" = dlfiles; then func_append dlfiles " $arg" else func_append dlprefiles " $arg" fi prev= continue ;; esac ;; expsyms) export_symbols="$arg" test -f "$arg" \ || func_fatal_error "symbol file \`$arg' does not exist" prev= continue ;; expsyms_regex) export_symbols_regex="$arg" prev= continue ;; framework) case $host in *-*-darwin*) case "$deplibs " in *" $qarg.ltframework "*) ;; *) func_append deplibs " $qarg.ltframework" # this is fixed later ;; esac ;; esac prev= continue ;; inst_prefix) inst_prefix_dir="$arg" prev= continue ;; objectlist) if test -f "$arg"; then save_arg=$arg moreargs= for fil in `cat "$save_arg"` do # func_append moreargs " $fil" arg=$fil # A libtool-controlled object. # Check to see that this really is a libtool object. if func_lalib_unsafe_p "$arg"; then pic_object= non_pic_object= # Read the .lo file func_source "$arg" if test -z "$pic_object" || test -z "$non_pic_object" || test "$pic_object" = none && test "$non_pic_object" = none; then func_fatal_error "cannot find name of object for \`$arg'" fi # Extract subdirectory from the argument. func_dirname "$arg" "/" "" xdir="$func_dirname_result" if test "$pic_object" != none; then # Prepend the subdirectory the object is found in. pic_object="$xdir$pic_object" if test "$prev" = dlfiles; then if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then func_append dlfiles " $pic_object" prev= continue else # If libtool objects are unsupported, then we need to preload. prev=dlprefiles fi fi # CHECK ME: I think I busted this. -Ossama if test "$prev" = dlprefiles; then # Preload the old-style object. func_append dlprefiles " $pic_object" prev= fi # A PIC object. func_append libobjs " $pic_object" arg="$pic_object" fi # Non-PIC object. if test "$non_pic_object" != none; then # Prepend the subdirectory the object is found in. non_pic_object="$xdir$non_pic_object" # A standard non-PIC object func_append non_pic_objects " $non_pic_object" if test -z "$pic_object" || test "$pic_object" = none ; then arg="$non_pic_object" fi else # If the PIC object exists, use it instead. # $xdir was prepended to $pic_object above. non_pic_object="$pic_object" func_append non_pic_objects " $non_pic_object" fi else # Only an error if not doing a dry-run. if $opt_dry_run; then # Extract subdirectory from the argument. func_dirname "$arg" "/" "" xdir="$func_dirname_result" func_lo2o "$arg" pic_object=$xdir$objdir/$func_lo2o_result non_pic_object=$xdir$func_lo2o_result func_append libobjs " $pic_object" func_append non_pic_objects " $non_pic_object" else func_fatal_error "\`$arg' is not a valid libtool object" fi fi done else func_fatal_error "link input file \`$arg' does not exist" fi arg=$save_arg prev= continue ;; precious_regex) precious_files_regex="$arg" prev= continue ;; release) release="-$arg" prev= continue ;; rpath | xrpath) # We need an absolute path. case $arg in [\\/]* | [A-Za-z]:[\\/]*) ;; *) func_fatal_error "only absolute run-paths are allowed" ;; esac if test "$prev" = rpath; then case "$rpath " in *" $arg "*) ;; *) func_append rpath " $arg" ;; esac else case "$xrpath " in *" $arg "*) ;; *) func_append xrpath " $arg" ;; esac fi prev= continue ;; shrext) shrext_cmds="$arg" prev= continue ;; weak) func_append weak_libs " $arg" prev= continue ;; xcclinker) func_append linker_flags " $qarg" func_append compiler_flags " $qarg" prev= func_append compile_command " $qarg" func_append finalize_command " $qarg" continue ;; xcompiler) func_append compiler_flags " $qarg" prev= func_append compile_command " $qarg" func_append finalize_command " $qarg" continue ;; xlinker) func_append linker_flags " $qarg" func_append compiler_flags " $wl$qarg" prev= func_append compile_command " $wl$qarg" func_append finalize_command " $wl$qarg" continue ;; *) eval "$prev=\"\$arg\"" prev= continue ;; esac fi # test -n "$prev" prevarg="$arg" case $arg in -all-static) if test -n "$link_static_flag"; then # See comment for -static flag below, for more details. func_append compile_command " $link_static_flag" func_append finalize_command " $link_static_flag" fi continue ;; -allow-undefined) # FIXME: remove this flag sometime in the future. func_fatal_error "\`-allow-undefined' must not be used because it is the default" ;; -avoid-version) avoid_version=yes continue ;; -bindir) prev=bindir continue ;; -dlopen) prev=dlfiles continue ;; -dlpreopen) prev=dlprefiles continue ;; -export-dynamic) export_dynamic=yes continue ;; -export-symbols | -export-symbols-regex) if test -n "$export_symbols" || test -n "$export_symbols_regex"; then func_fatal_error "more than one -exported-symbols argument is not allowed" fi if test "X$arg" = "X-export-symbols"; then prev=expsyms else prev=expsyms_regex fi continue ;; -framework) prev=framework continue ;; -inst-prefix-dir) prev=inst_prefix continue ;; # The native IRIX linker understands -LANG:*, -LIST:* and -LNO:* # so, if we see these flags be careful not to treat them like -L -L[A-Z][A-Z]*:*) case $with_gcc/$host in no/*-*-irix* | /*-*-irix*) func_append compile_command " $arg" func_append finalize_command " $arg" ;; esac continue ;; -L*) 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]:[\\/]*) ;; *) absdir=`cd "$dir" && pwd` test -z "$absdir" && \ func_fatal_error "cannot determine absolute directory name of \`$dir'" dir="$absdir" ;; esac case "$deplibs " in *" -L$dir "* | *" $arg "*) # Will only happen for absolute or sysroot arguments ;; *) # 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 "$dir" | $SED 's*/lib$*/bin*'` case :$dllsearchpath: in *":$dir:"*) ;; ::) dllsearchpath=$dir;; *) func_append dllsearchpath ":$dir";; esac case :$dllsearchpath: in *":$testbindir:"*) ;; ::) dllsearchpath=$testbindir;; *) func_append dllsearchpath ":$testbindir";; esac ;; esac continue ;; -l*) if test "X$arg" = "X-lc" || test "X$arg" = "X-lm"; then case $host in *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-beos* | *-cegcc* | *-*-haiku*) # These systems don't actually have a C or math library (as such) continue ;; *-*-os2*) # These systems don't actually have a C library (as such) test "X$arg" = "X-lc" && continue ;; *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*) # Do not include libc due to us having libc/libc_r. test "X$arg" = "X-lc" && continue ;; *-*-rhapsody* | *-*-darwin1.[012]) # Rhapsody C and math libraries are in the System framework func_append deplibs " System.ltframework" continue ;; *-*-sco3.2v5* | *-*-sco5v6*) # Causes problems with __ctype test "X$arg" = "X-lc" && continue ;; *-*-sysv4.2uw2* | *-*-sysv5* | *-*-unixware* | *-*-OpenUNIX*) # Compiler inserts libc in the correct place for threads to work test "X$arg" = "X-lc" && continue ;; esac elif test "X$arg" = "X-lc_r"; then case $host in *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*) # Do not include libc_r directly, use -pthread flag. continue ;; esac fi func_append deplibs " $arg" continue ;; -module) module=yes continue ;; # 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|--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|-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 "*) ;; * ) func_append new_inherited_linker_flags " $arg" ;; esac continue ;; -multi_module) single_module="${wl}-multi_module" continue ;; -no-fast-install) fast_install=no continue ;; -no-install) case $host in *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-darwin* | *-cegcc*) # The PATH hackery in wrapper scripts is required on Windows # and Darwin in order for the loader to find any dlls it needs. func_warning "\`-no-install' is ignored for $host" func_warning "assuming \`-no-fast-install' instead" fast_install=no ;; *) no_install=yes ;; esac continue ;; -no-undefined) allow_undefined=no continue ;; -objectlist) prev=objectlist continue ;; -o) prev=output ;; -precious-files-regex) prev=precious_regex continue ;; -release) prev=release continue ;; -rpath) prev=rpath continue ;; -R) prev=xrpath continue ;; -R*) func_stripname '-R' '' "$arg" dir=$func_stripname_result # 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 "*) ;; *) func_append xrpath " $dir" ;; esac continue ;; -shared) # The effects of -shared are defined in a previous loop. continue ;; -shrext) prev=shrext continue ;; -static | -static-libtool-libs) # The effects of -static are defined in a previous loop. # We used to do the same as -all-static on platforms that # didn't have a PIC flag, but the assumption that the effects # would be equivalent was wrong. It would break on at least # Digital Unix and AIX. continue ;; -thread-safe) thread_safe=yes continue ;; -version-info) prev=vinfo continue ;; -version-number) prev=vinfo vinfo_number=yes continue ;; -weak) prev=weak continue ;; -Wc,*) func_stripname '-Wc,' '' "$arg" args=$func_stripname_result arg= save_ifs="$IFS"; IFS=',' for flag in $args; do IFS="$save_ifs" func_quote_for_eval "$flag" func_append arg " $func_quote_for_eval_result" func_append compiler_flags " $func_quote_for_eval_result" done IFS="$save_ifs" func_stripname ' ' '' "$arg" arg=$func_stripname_result ;; -Wl,*) func_stripname '-Wl,' '' "$arg" args=$func_stripname_result arg= save_ifs="$IFS"; IFS=',' for flag in $args; do IFS="$save_ifs" func_quote_for_eval "$flag" 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" arg=$func_stripname_result ;; -Xcompiler) prev=xcompiler continue ;; -Xlinker) prev=xlinker continue ;; -XCClinker) prev=xcclinker continue ;; # -msg_* for osf cc -msg_*) func_quote_for_eval "$arg" arg="$func_quote_for_eval_result" ;; # 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*|@*|-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" func_append compiler_flags " $arg" continue ;; # Some other compiler flag. -* | +*) func_quote_for_eval "$arg" arg="$func_quote_for_eval_result" ;; *.$objext) # A standard object. func_append objs " $arg" ;; *.lo) # A libtool-controlled object. # Check to see that this really is a libtool object. if func_lalib_unsafe_p "$arg"; then pic_object= non_pic_object= # Read the .lo file func_source "$arg" if test -z "$pic_object" || test -z "$non_pic_object" || test "$pic_object" = none && test "$non_pic_object" = none; then func_fatal_error "cannot find name of object for \`$arg'" fi # Extract subdirectory from the argument. func_dirname "$arg" "/" "" xdir="$func_dirname_result" if test "$pic_object" != none; then # Prepend the subdirectory the object is found in. pic_object="$xdir$pic_object" if test "$prev" = dlfiles; then if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then func_append dlfiles " $pic_object" prev= continue else # If libtool objects are unsupported, then we need to preload. prev=dlprefiles fi fi # CHECK ME: I think I busted this. -Ossama if test "$prev" = dlprefiles; then # Preload the old-style object. func_append dlprefiles " $pic_object" prev= fi # A PIC object. func_append libobjs " $pic_object" arg="$pic_object" fi # Non-PIC object. if test "$non_pic_object" != none; then # Prepend the subdirectory the object is found in. non_pic_object="$xdir$non_pic_object" # A standard non-PIC object func_append non_pic_objects " $non_pic_object" if test -z "$pic_object" || test "$pic_object" = none ; then arg="$non_pic_object" fi else # If the PIC object exists, use it instead. # $xdir was prepended to $pic_object above. non_pic_object="$pic_object" func_append non_pic_objects " $non_pic_object" fi else # Only an error if not doing a dry-run. if $opt_dry_run; then # Extract subdirectory from the argument. func_dirname "$arg" "/" "" xdir="$func_dirname_result" func_lo2o "$arg" pic_object=$xdir$objdir/$func_lo2o_result non_pic_object=$xdir$func_lo2o_result func_append libobjs " $pic_object" func_append non_pic_objects " $non_pic_object" else func_fatal_error "\`$arg' is not a valid libtool object" fi fi ;; *.$libext) # An archive. 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. func_append dlfiles " $func_resolve_sysroot_result" prev= elif test "$prev" = dlprefiles; then # The library was specified with -dlpreopen. func_append dlprefiles " $func_resolve_sysroot_result" prev= else func_append deplibs " $func_resolve_sysroot_result" fi continue ;; # Some other compiler argument. *) # Unknown arguments in both finalize_command and compile_command need # to be aesthetically quoted because they are evaled later. func_quote_for_eval "$arg" arg="$func_quote_for_eval_result" ;; esac # arg # Now actually substitute the argument into the commands. if test -n "$arg"; then func_append compile_command " $arg" func_append finalize_command " $arg" fi done # argument parsing loop test -n "$prev" && \ func_fatal_help "the \`$prevarg' option requires an argument" if test "$export_dynamic" = yes && test -n "$export_dynamic_flag_spec"; then eval arg=\"$export_dynamic_flag_spec\" func_append compile_command " $arg" func_append finalize_command " $arg" fi oldlibs= # calculate the name of the file, without its directory func_basename "$output" outputname="$func_basename_result" libobjs_save="$libobjs" if test -n "$shlibpath_var"; then # get the directories listed in $shlibpath_var eval shlib_search_path=\`\$ECHO \"\${$shlibpath_var}\" \| \$SED \'s/:/ /g\'\` else shlib_search_path= fi eval sys_lib_search_path=\"$sys_lib_search_path_spec\" eval sys_lib_dlsearch_path=\"$sys_lib_dlsearch_path_spec\" 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" # Determine the type of output case $output in "") func_fatal_help "you must specify an output file" ;; *.$libext) linkmode=oldlib ;; *.lo | *.$objext) linkmode=obj ;; *.la) linkmode=lib ;; *) linkmode=prog ;; # Anything else should be a program. esac specialdeplibs= libs= # 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_preserve_dup_deps ; then case "$libs " in *" $deplib "*) func_append specialdeplibs " $deplib" ;; esac fi func_append libs " $deplib" done if test "$linkmode" = lib; then libs="$predeps $libs $compiler_lib_search_path $postdeps" # Compute libraries that are listed more than once in $predeps # $postdeps and mark them as special (i.e., whose duplicates are # not to be eliminated). pre_post_deps= if $opt_duplicate_compiler_generated_deps; then for pre_post_dep in $predeps $postdeps; do case "$pre_post_deps " in *" $pre_post_dep "*) func_append specialdeplibs " $pre_post_deps" ;; esac func_append pre_post_deps " $pre_post_dep" done fi pre_post_deps= fi deplibs= newdependency_libs= newlib_search_path= need_relink=no # whether we're linking any uninstalled libtool libraries notinst_deplibs= # not-installed libtool libraries notinst_path= # paths that contain not-installed libtool libraries case $linkmode in lib) passes="conv dlpreopen link" for file in $dlfiles $dlprefiles; do case $file in *.la) ;; *) func_fatal_help "libraries can \`-dlopen' only libtool libraries: $file" ;; esac done ;; prog) compile_deplibs= finalize_deplibs= alldeplibs=no newdlfiles= newdlprefiles= passes="conv scan dlopen dlpreopen link" ;; *) passes="conv" ;; esac for pass in $passes; do # The preopen pass in lib mode reverses $deplibs; put it back here # so that -L comes before libs that need it for instance... if test "$linkmode,$pass" = "lib,link"; then ## FIXME: Find the place where the list is rebuilt in the wrong ## order, and fix it there properly tmp_deplibs= for deplib in $deplibs; do tmp_deplibs="$deplib $tmp_deplibs" done deplibs="$tmp_deplibs" fi if test "$linkmode,$pass" = "lib,link" || test "$linkmode,$pass" = "prog,scan"; then libs="$deplibs" deplibs= fi if test "$linkmode" = prog; then case $pass in dlopen) libs="$dlfiles" ;; dlpreopen) libs="$dlprefiles" ;; link) libs="$deplibs %DEPLIBS%" test "X$link_all_deplibs" != Xno && libs="$libs $dependency_libs" ;; esac fi if test "$linkmode,$pass" = "lib,dlpreopen"; then # Collect and forward deplibs of preopened libtool libs for lib in $dlprefiles; do # Ignore non-libtool-libs dependency_libs= func_resolve_sysroot "$lib" case $lib in *.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 func_basename "$deplib" deplib_base=$func_basename_result case " $weak_libs " in *" $deplib_base "*) ;; *) func_append deplibs " $deplib" ;; esac done done libs="$dlprefiles" fi if test "$pass" = dlopen; then # Collect dlpreopened libraries save_deplibs="$deplibs" deplibs= fi for deplib in $libs; do lib= found=no case $deplib in -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 func_append compiler_flags " $deplib" if test "$linkmode" = lib ; then case "$new_inherited_linker_flags " in *" $deplib "*) ;; * ) func_append new_inherited_linker_flags " $deplib" ;; esac fi fi continue ;; -l*) if test "$linkmode" != lib && test "$linkmode" != prog; then func_warning "\`-l' is ignored for archives/objects" continue fi func_stripname '-l' '' "$deplib" name=$func_stripname_result if test "$linkmode" = lib; then searchdirs="$newlib_search_path $lib_search_path $compiler_lib_search_dirs $sys_lib_search_path $shlib_search_path" else searchdirs="$newlib_search_path $lib_search_path $sys_lib_search_path $shlib_search_path" fi for searchdir in $searchdirs; do for search_ext in .la $std_shrext .so .a; do # Search the libtool library lib="$searchdir/lib${name}${search_ext}" if test -f "$lib"; then if test "$search_ext" = ".la"; then found=yes else found=no fi break 2 fi done done if test "$found" != yes; then # deplib doesn't seem to be a libtool library if test "$linkmode,$pass" = "prog,link"; then compile_deplibs="$deplib $compile_deplibs" finalize_deplibs="$deplib $finalize_deplibs" else deplibs="$deplib $deplibs" test "$linkmode" = lib && newdependency_libs="$deplib $newdependency_libs" fi continue else # deplib is a libtool library # If $allow_libtool_libs_with_static_runtimes && $deplib is a stdlib, # We need to do some special things here, and not later. if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then case " $predeps $postdeps " in *" $deplib "*) if func_lalib_p "$lib"; then library_names= old_library= func_source "$lib" for l in $old_library $library_names; do ll="$l" done if test "X$ll" = "X$old_library" ; then # only static version available found=no func_dirname "$lib" "" "." ladir="$func_dirname_result" lib=$ladir/$old_library if test "$linkmode,$pass" = "prog,link"; then compile_deplibs="$deplib $compile_deplibs" finalize_deplibs="$deplib $finalize_deplibs" else deplibs="$deplib $deplibs" test "$linkmode" = lib && newdependency_libs="$deplib $newdependency_libs" fi continue fi fi ;; *) ;; esac fi fi ;; # -l *.ltframework) if test "$linkmode,$pass" = "prog,link"; then compile_deplibs="$deplib $compile_deplibs" finalize_deplibs="$deplib $finalize_deplibs" else deplibs="$deplib $deplibs" if test "$linkmode" = lib ; then case "$new_inherited_linker_flags " in *" $deplib "*) ;; * ) func_append new_inherited_linker_flags " $deplib" ;; esac fi fi continue ;; -L*) case $linkmode in lib) deplibs="$deplib $deplibs" test "$pass" = conv && continue newdependency_libs="$deplib $newdependency_libs" func_stripname '-L' '' "$deplib" func_resolve_sysroot "$func_stripname_result" func_append newlib_search_path " $func_resolve_sysroot_result" ;; prog) if test "$pass" = conv; then deplibs="$deplib $deplibs" continue fi if test "$pass" = scan; then deplibs="$deplib $deplibs" else compile_deplibs="$deplib $compile_deplibs" finalize_deplibs="$deplib $finalize_deplibs" fi func_stripname '-L' '' "$deplib" func_resolve_sysroot "$func_stripname_result" func_append newlib_search_path " $func_resolve_sysroot_result" ;; *) func_warning "\`-L' is ignored for archives/objects" ;; esac # linkmode continue ;; # -L -R*) if test "$pass" = link; then func_stripname '-R' '' "$deplib" func_resolve_sysroot "$func_stripname_result" dir=$func_resolve_sysroot_result # Make sure the xrpath contains only unique directories. case "$xrpath " in *" $dir "*) ;; *) func_append xrpath " $dir" ;; esac fi deplibs="$deplib $deplibs" continue ;; *.la) func_resolve_sysroot "$deplib" lib=$func_resolve_sysroot_result ;; *.$libext) if test "$pass" = conv; then deplibs="$deplib $deplibs" continue fi case $linkmode in lib) # Linking convenience modules into shared libraries is allowed, # but linking other static libraries is non-portable. case " $dlpreconveniencelibs " in *" $deplib "*) ;; *) valid_a_lib=no case $deplibs_check_method in match_pattern*) set dummy $deplibs_check_method; shift match_pattern_regex=`expr "$deplibs_check_method" : "$1 \(.*\)"` if eval "\$ECHO \"$deplib\"" 2>/dev/null | $SED 10q \ | $EGREP "$match_pattern_regex" > /dev/null; then valid_a_lib=yes fi ;; pass_all) valid_a_lib=yes ;; esac if test "$valid_a_lib" != yes; then 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." else echo $ECHO "*** Warning: Linking the shared library $output against the" $ECHO "*** static library $deplib is not portable!" deplibs="$deplib $deplibs" fi ;; esac continue ;; prog) if test "$pass" != link; then deplibs="$deplib $deplibs" else compile_deplibs="$deplib $compile_deplibs" finalize_deplibs="$deplib $finalize_deplibs" fi continue ;; esac # linkmode ;; # *.$libext *.lo | *.$objext) if test "$pass" = conv; then deplibs="$deplib $deplibs" elif test "$linkmode" = prog; then 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. func_append newdlprefiles " $deplib" compile_deplibs="$deplib $compile_deplibs" finalize_deplibs="$deplib $finalize_deplibs" else func_append newdlfiles " $deplib" fi fi continue ;; %DEPLIBS%) alldeplibs=yes continue ;; esac # case $deplib if test "$found" = yes || test -f "$lib"; then : else func_fatal_error "cannot find the library \`$lib' or unhandled argument \`$deplib'" fi # Check to see that this really is a libtool archive. func_lalib_unsafe_p "$lib" \ || func_fatal_error "\`$lib' is not a valid libtool archive" func_dirname "$lib" "" "." ladir="$func_dirname_result" dlname= dlopen= dlpreopen= libdir= library_names= old_library= inherited_linker_flags= # If the library was installed with an old release of libtool, # it will not redefine variables installed, or shouldnotlink installed=yes shouldnotlink=no avoidtemprpath= # Read the .la file func_source "$lib" # Convert "-framework foo" to "foo.ltframework" if test -n "$inherited_linker_flags"; then 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 "*) ;; *) func_append new_inherited_linker_flags " $tmp_inherited_linker_flag";; esac done fi 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" && func_append dlfiles " $dlopen" test -n "$dlpreopen" && func_append dlprefiles " $dlpreopen" fi if test "$pass" = conv; then # Only check for convenience libraries deplibs="$lib $deplibs" if test -z "$libdir"; then if test -z "$old_library"; then func_fatal_error "cannot find name of link library for \`$lib'" fi # It is a libtool convenience library, so add in its objects. func_append convenience " $ladir/$objdir/$old_library" func_append old_convenience " $ladir/$objdir/$old_library" tmp_libs= for deplib in $dependency_libs; do deplibs="$deplib $deplibs" if $opt_preserve_dup_deps ; then case "$tmp_libs " in *" $deplib "*) func_append specialdeplibs " $deplib" ;; esac fi func_append tmp_libs " $deplib" done elif test "$linkmode" != prog && test "$linkmode" != lib; then func_fatal_error "\`$lib' is not a convenience library" fi continue fi # $pass = conv # Get the name of the library we link against. linklib= 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 # This library was specified with -dlopen. if test "$pass" = dlopen; then if test -z "$libdir"; then func_fatal_error "cannot -dlopen a convenience library: \`$lib'" fi if test -z "$dlname" || test "$dlopen_support" != yes || test "$build_libtool_libs" = no; then # If there is no dlname, no dlopen support or we're linking # 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. func_append dlprefiles " $lib $dependency_libs" else func_append newdlfiles " $lib" fi continue fi # $pass = dlopen # We need an absolute path. case $ladir in [\\/]* | [A-Za-z]:[\\/]*) abs_ladir="$ladir" ;; *) abs_ladir=`cd "$ladir" && pwd` if test -z "$abs_ladir"; then func_warning "cannot determine absolute directory name of \`$ladir'" func_warning "passing it literally to the linker, although it might fail" abs_ladir="$ladir" fi ;; esac func_basename "$lib" laname="$func_basename_result" # Find the relevant object directory and library name. if test "X$installed" = Xyes; 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="$lt_sysroot$libdir" absdir="$lt_sysroot$libdir" fi test "X$hardcode_automatic" = Xyes && avoidtemprpath=yes else if test ! -f "$ladir/$objdir/$linklib" && test -f "$abs_ladir/$linklib"; then dir="$ladir" absdir="$abs_ladir" # Remove this search path later func_append notinst_path " $abs_ladir" else dir="$ladir/$objdir" absdir="$abs_ladir/$objdir" # Remove this search path later func_append notinst_path " $abs_ladir" fi fi # $installed = yes func_stripname 'lib' '.la' "$laname" name=$func_stripname_result # This library was specified with -dlpreopen. if test "$pass" = dlpreopen; then if test -z "$libdir" && test "$linkmode" = prog; then func_fatal_error "only libraries may -dlpreopen a convenience library: \`$lib'" 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 # Link the convenience library if test "$linkmode" = lib; then deplibs="$dir/$old_library $deplibs" elif test "$linkmode,$pass" = "prog,link"; then compile_deplibs="$dir/$old_library $compile_deplibs" finalize_deplibs="$dir/$old_library $finalize_deplibs" else deplibs="$lib $deplibs" # used for prog,scan pass fi continue fi if test "$linkmode" = prog && test "$pass" != link; then func_append newlib_search_path " $ladir" deplibs="$lib $deplibs" linkalldeplibs=no if test "$link_all_deplibs" != no || test -z "$library_names" || test "$build_libtool_libs" = no; then linkalldeplibs=yes fi tmp_libs= for deplib in $dependency_libs; do case $deplib in -L*) func_stripname '-L' '' "$deplib" func_resolve_sysroot "$func_stripname_result" func_append newlib_search_path " $func_resolve_sysroot_result" ;; esac # Need to link against all dependency_libs? if test "$linkalldeplibs" = yes; then deplibs="$deplib $deplibs" else # Need to hardcode shared library paths # or/and link against static libraries newdependency_libs="$deplib $newdependency_libs" fi if $opt_preserve_dup_deps ; then case "$tmp_libs " in *" $deplib "*) func_append specialdeplibs " $deplib" ;; esac fi func_append tmp_libs " $deplib" done # for deplib continue fi # $linkmode = prog... if test "$linkmode,$pass" = "prog,link"; then if test -n "$library_names" && { { test "$prefer_static_libs" = no || test "$prefer_static_libs,$installed" = "built,yes"; } || test -z "$old_library"; }; then # We need to hardcode the library path if test -n "$shlibpath_var" && test -z "$avoidtemprpath" ; then # Make sure the rpath contains only unique directories. case "$temp_rpath:" in *"$absdir:"*) ;; *) func_append temp_rpath "$absdir:" ;; esac fi # Hardcode the library path. # Skip directories that are in the system default run-time # search path. case " $sys_lib_dlsearch_path " in *" $absdir "*) ;; *) case "$compile_rpath " in *" $absdir "*) ;; *) func_append compile_rpath " $absdir" ;; esac ;; esac case " $sys_lib_dlsearch_path " in *" $libdir "*) ;; *) case "$finalize_rpath " in *" $libdir "*) ;; *) func_append finalize_rpath " $libdir" ;; esac ;; esac fi # $linkmode,$pass = prog,link... if test "$alldeplibs" = yes && { test "$deplibs_check_method" = pass_all || { test "$build_libtool_libs" = yes && test -n "$library_names"; }; }; then # We only need to search for static libraries continue fi fi link_static=no # Whether the deplib will be linked statically use_static_libs=$prefer_static_libs if test "$use_static_libs" = built && test "$installed" = yes; then use_static_libs=no fi if test -n "$library_names" && { test "$use_static_libs" = no || test -z "$old_library"; }; then case $host in *cygwin* | *mingw* | *cegcc*) # No point in relinking DLLs because paths are not encoded func_append notinst_deplibs " $lib" need_relink=no ;; *) if test "$installed" = no; then func_append notinst_deplibs " $lib" need_relink=yes fi ;; esac # This is a shared library # Warn about portability, can't link against -module's on some # systems (darwin). Don't bleat about dlopened modules though! dlopenmodule="" for dlpremoduletest in $dlprefiles; do if test "X$dlpremoduletest" = "X$lib"; then dlopenmodule="$dlpremoduletest" break fi done if test -z "$dlopenmodule" && test "$shouldnotlink" = yes && test "$pass" = link; then echo if test "$linkmode" = prog; then $ECHO "*** Warning: Linking the executable $output against the loadable module" else $ECHO "*** Warning: Linking the shared library $output against the loadable module" fi $ECHO "*** $linklib is not portable!" fi if test "$linkmode" = lib && test "$hardcode_into_libs" = yes; then # Hardcode the library path. # Skip directories that are in the system default run-time # search path. case " $sys_lib_dlsearch_path " in *" $absdir "*) ;; *) case "$compile_rpath " in *" $absdir "*) ;; *) func_append compile_rpath " $absdir" ;; esac ;; esac case " $sys_lib_dlsearch_path " in *" $libdir "*) ;; *) case "$finalize_rpath " in *" $libdir "*) ;; *) func_append finalize_rpath " $libdir" ;; esac ;; esac fi if test -n "$old_archive_from_expsyms_cmds"; then # figure out the soname set dummy $library_names shift realname="$1" shift libname=`eval "\\$ECHO \"$libname_spec\""` # use dlname if we got it. it's perfectly good, no? if test -n "$dlname"; then soname="$dlname" elif test -n "$soname_spec"; then # bleh windows case $host in *cygwin* | mingw* | *cegcc*) func_arith $current - $age major=$func_arith_result versuffix="-$major" ;; esac eval soname=\"$soname_spec\" else soname="$realname" fi # Make a new name for the extract_expsyms_cmds to use soroot="$soname" func_basename "$soroot" soname="$func_basename_result" func_stripname 'lib' '.dll' "$soname" newlib=libimp-$func_stripname_result.a # If the library has no export list, then create one now if test -f "$output_objdir/$soname-def"; then : else func_verbose "extracting exported symbol list from \`$soname'" func_execute_cmds "$extract_expsyms_cmds" 'exit $?' fi # Create $newlib if test -f "$output_objdir/$newlib"; then :; else func_verbose "generating import library for \`$soname'" func_execute_cmds "$old_archive_from_expsyms_cmds" 'exit $?' fi # make sure the library variables are pointing to the new library dir=$output_objdir linklib=$newlib fi # test -n "$old_archive_from_expsyms_cmds" if test "$linkmode" = prog || test "$opt_mode" != relink; then add_shlibpath= add_dir= add= lib_linked=yes case $hardcode_action in immediate | unsupported) if test "$hardcode_direct" = no; then add="$dir/$linklib" case $host in *-*-sco3.2v5.0.[024]*) add_dir="-L$dir" ;; *-*-sysv4*uw2*) add_dir="-L$dir" ;; *-*-sysv5OpenUNIX* | *-*-sysv5UnixWare7.[01].[10]* | \ *-*-unixware7*) add_dir="-L$dir" ;; *-*-darwin* ) # if the lib is a (non-dlopened) module then we can not # link against it, someone is ignoring the earlier warnings if /usr/bin/file -L $add 2> /dev/null | $GREP ": [^:]* bundle" >/dev/null ; then 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" else add="$dir/$old_library" fi elif test -n "$old_library"; then add="$dir/$old_library" fi fi esac elif test "$hardcode_minus_L" = no; then case $host in *-*-sunos*) add_shlibpath="$dir" ;; esac add_dir="-L$dir" add="-l$name" elif test "$hardcode_shlibpath_var" = no; then add_shlibpath="$dir" add="-l$name" else lib_linked=no fi ;; relink) if test "$hardcode_direct" = yes && test "$hardcode_direct_absolute" = no; then add="$dir/$linklib" elif test "$hardcode_minus_L" = yes; then 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 [\\/]*) func_append add_dir " -L$inst_prefix_dir$libdir" ;; esac fi add="-l$name" elif test "$hardcode_shlibpath_var" = yes; then add_shlibpath="$dir" add="-l$name" else lib_linked=no fi ;; *) lib_linked=no ;; esac if test "$lib_linked" != yes; then func_fatal_configuration "unsupported hardcode properties" fi if test -n "$add_shlibpath"; then case :$compile_shlibpath: in *":$add_shlibpath:"*) ;; *) func_append compile_shlibpath "$add_shlibpath:" ;; esac fi if test "$linkmode" = prog; then test -n "$add_dir" && compile_deplibs="$add_dir $compile_deplibs" test -n "$add" && compile_deplibs="$add $compile_deplibs" else test -n "$add_dir" && deplibs="$add_dir $deplibs" test -n "$add" && deplibs="$add $deplibs" if test "$hardcode_direct" != yes && test "$hardcode_minus_L" != yes && test "$hardcode_shlibpath_var" = yes; then case :$finalize_shlibpath: in *":$libdir:"*) ;; *) func_append finalize_shlibpath "$libdir:" ;; esac fi fi fi if test "$linkmode" = prog || test "$opt_mode" = relink; then add_shlibpath= add_dir= add= # Finalize command for both is simple: just hardcode it. if test "$hardcode_direct" = yes && test "$hardcode_direct_absolute" = no; then add="$libdir/$linklib" elif test "$hardcode_minus_L" = yes; then add_dir="-L$libdir" add="-l$name" elif test "$hardcode_shlibpath_var" = yes; then case :$finalize_shlibpath: in *":$libdir:"*) ;; *) func_append finalize_shlibpath "$libdir:" ;; esac add="-l$name" elif test "$hardcode_automatic" = yes; then if test -n "$inst_prefix_dir" && test -f "$inst_prefix_dir$libdir/$linklib" ; then add="$inst_prefix_dir$libdir/$linklib" else add="$libdir/$linklib" fi else # We cannot seem to hardcode it, guess we'll fake it. add_dir="-L$libdir" # Try looking first in the location we're being installed to. if test -n "$inst_prefix_dir"; then case $libdir in [\\/]*) func_append add_dir " -L$inst_prefix_dir$libdir" ;; esac fi add="-l$name" fi if test "$linkmode" = prog; then test -n "$add_dir" && finalize_deplibs="$add_dir $finalize_deplibs" test -n "$add" && finalize_deplibs="$add $finalize_deplibs" else test -n "$add_dir" && deplibs="$add_dir $deplibs" test -n "$add" && deplibs="$add $deplibs" fi fi elif test "$linkmode" = prog; then # Here we assume that one of hardcode_direct or hardcode_minus_L # is not unsupported. This is valid on all known static and # shared platforms. if test "$hardcode_direct" != unsupported; then test -n "$old_library" && linklib="$old_library" compile_deplibs="$dir/$linklib $compile_deplibs" finalize_deplibs="$dir/$linklib $finalize_deplibs" else compile_deplibs="-l$name -L$dir $compile_deplibs" finalize_deplibs="-l$name -L$dir $finalize_deplibs" fi elif test "$build_libtool_libs" = yes; then # Not a shared library if test "$deplibs_check_method" != pass_all; then # We're trying link a shared library against a static one # but the system doesn't support it. # Just print a warning and add the library to dependency_libs so # that the program can be linked against the static library. 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." 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." 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." fi if test "$build_old_libs" = no; then build_libtool_libs=module build_old_libs=yes else build_libtool_libs=no fi fi else deplibs="$dir/$old_library $deplibs" link_static=yes fi fi # link shared/static library? if test "$linkmode" = lib; then if test -n "$dependency_libs" && { test "$hardcode_into_libs" != yes || test "$build_old_libs" = yes || test "$link_static" = yes; }; then # Extract -R from dependency_libs temp_deplibs= for libdir in $dependency_libs; do case $libdir in -R*) func_stripname '-R' '' "$libdir" temp_xrpath=$func_stripname_result case " $xrpath " in *" $temp_xrpath "*) ;; *) func_append xrpath " $temp_xrpath";; esac;; *) func_append temp_deplibs " $libdir";; esac done dependency_libs="$temp_deplibs" fi 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" 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 *" $func_resolve_sysroot_result "*) func_append specialdeplibs " $func_resolve_sysroot_result" ;; esac fi 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 # We need an absolute path. case $dir in [\\/]* | [A-Za-z]:[\\/]*) absdir="$dir" ;; *) absdir=`cd "$dir" && pwd` if test -z "$absdir"; then func_warning "cannot determine absolute directory name of \`$dir'" absdir="$dir" fi ;; esac if $GREP "^installed=no" $deplib > /dev/null; then case $host in *-*-darwin*) depdepl= eval deplibrary_names=`${SED} -n -e 's/^library_names=\(.*\)$/\1/p' $deplib` if test -n "$deplibrary_names" ; then for tmp in $deplibrary_names ; do depdepl=$tmp done if test -f "$absdir/$objdir/$depdepl" ; then depdepl="$absdir/$objdir/$depdepl" darwin_install_name=`${OTOOL} -L $depdepl | awk '{if (NR == 2) {print $1;exit}}'` if test -z "$darwin_install_name"; then darwin_install_name=`${OTOOL64} -L $depdepl | awk '{if (NR == 2) {print $1;exit}}'` fi 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 ;; *) path="-L$absdir/$objdir" ;; esac else eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $deplib` test -z "$libdir" && \ func_fatal_error "\`$deplib' is not a valid libtool archive" test "$absdir" != "$libdir" && \ func_warning "\`$deplib' seems to be moved" path="-L$absdir" fi ;; esac case " $deplibs " in *" $path "*) ;; *) deplibs="$path $deplibs" ;; esac done fi # link_all_deplibs != no fi # linkmode = lib done # for deplib in $libs if test "$pass" = link; then if test "$linkmode" = "prog"; then compile_deplibs="$new_inherited_linker_flags $compile_deplibs" finalize_deplibs="$new_inherited_linker_flags $finalize_deplibs" else compiler_flags="$compiler_flags "`$ECHO " $new_inherited_linker_flags" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` fi fi dependency_libs="$newdependency_libs" if test "$pass" = dlpreopen; then # Link the dlpreopened libraries before other libraries for deplib in $save_deplibs; do deplibs="$deplib $deplibs" done fi if test "$pass" != dlopen; then if test "$pass" != conv; then # Make sure lib_search_path contains only unique directories. lib_search_path= for dir in $newlib_search_path; do case "$lib_search_path " in *" $dir "*) ;; *) func_append lib_search_path " $dir" ;; esac done newlib_search_path= fi if test "$linkmode,$pass" != "prog,link"; then vars="deplibs" else vars="compile_deplibs finalize_deplibs" fi for var in $vars dependency_libs; do # Add libraries to $var in reverse order eval tmp_libs=\"\$$var\" new_libs= for deplib in $tmp_libs; do # FIXME: Pedantically, this is the right thing to do, so # that some nasty dependency loop isn't accidentally # broken: #new_libs="$deplib $new_libs" # Pragmatically, this seems to cause very few problems in # practice: case $deplib in -L*) new_libs="$deplib $new_libs" ;; -R*) ;; *) # And here is the reason: when a library appears more # than once as an explicit dependence of a library, or # is implicitly linked in more than once by the # compiler, it is considered special, and multiple # occurrences thereof are not removed. Compare this # with having the same library being listed as a # dependency of multiple other libraries: in this case, # we know (pedantically, we assume) the library does not # need to be listed more than once, so we keep only the # last copy. This is not always right, but it is rare # enough that we require users that really mean to play # such unportable linking tricks to link the library # using -Wl,-lname, so that libtool does not consider it # for duplicate removal. case " $specialdeplibs " in *" $deplib "*) new_libs="$deplib $new_libs" ;; *) case " $new_libs " in *" $deplib "*) ;; *) new_libs="$deplib $new_libs" ;; esac ;; esac ;; esac done tmp_libs= for deplib in $new_libs; do case $deplib in -L*) case " $tmp_libs " in *" $deplib "*) ;; *) func_append tmp_libs " $deplib" ;; esac ;; *) func_append tmp_libs " $deplib" ;; esac done eval $var=\"$tmp_libs\" done # for var fi # Last step: remove runtime libs from dependency_libs # (they stay in deplibs) tmp_libs= for i in $dependency_libs ; do case " $predeps $postdeps $compiler_lib_search_path " in *" $i "*) i="" ;; esac if test -n "$i" ; then func_append tmp_libs " $i" fi done dependency_libs=$tmp_libs done # for pass if test "$linkmode" = prog; then dlfiles="$newdlfiles" fi if test "$linkmode" = prog || test "$linkmode" = lib; then dlprefiles="$newdlprefiles" fi case $linkmode in oldlib) if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then func_warning "\`-dlopen' is ignored for archives" fi case " $deplibs" in *\ -l* | *\ -L*) func_warning "\`-l' and \`-L' are ignored for archives" ;; esac test -n "$rpath" && \ func_warning "\`-rpath' is ignored for archives" test -n "$xrpath" && \ func_warning "\`-R' is ignored for archives" test -n "$vinfo" && \ func_warning "\`-version-info/-version-number' is ignored for archives" test -n "$release" && \ func_warning "\`-release' is ignored for archives" test -n "$export_symbols$export_symbols_regex" && \ func_warning "\`-export-symbols' is ignored for archives" # Now set the variables for building old libraries. build_libtool_libs=no oldlibs="$output" func_append objs "$old_deplibs" ;; lib) # Make sure we only generate libraries of the form `libNAME.la'. case $outputname in lib*) func_stripname 'lib' '.la' "$outputname" name=$func_stripname_result eval shared_ext=\"$shrext_cmds\" eval libname=\"$libname_spec\" ;; *) test "$module" = no && \ func_fatal_help "libtool library \`$output' must begin with \`lib'" if test "$need_lib_prefix" != no; then # Add the "lib" prefix for modules if required func_stripname '' '.la' "$outputname" name=$func_stripname_result eval shared_ext=\"$shrext_cmds\" eval libname=\"$libname_spec\" else func_stripname '' '.la' "$outputname" libname=$func_stripname_result fi ;; esac if test -n "$objs"; then 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 "*** Warning: Linking the shared library $output against the non-libtool" $ECHO "*** objects $objs is not portable!" func_append libobjs " $objs" fi fi test "$dlself" != no && \ func_warning "\`-dlopen self' is ignored for libtool libraries" set dummy $rpath shift test "$#" -gt 1 && \ func_warning "ignoring multiple \`-rpath's for a libtool library" install_libdir="$1" oldlibs= if test -z "$rpath"; then if test "$build_libtool_libs" = yes; then # Building a libtool convenience library. # Some compilers have problems with a `.al' extension so # convenience libraries should have the same extension an # archive normally would. oldlibs="$output_objdir/$libname.$libext $oldlibs" build_libtool_libs=convenience build_old_libs=yes fi test -n "$vinfo" && \ func_warning "\`-version-info/-version-number' is ignored for convenience libraries" test -n "$release" && \ func_warning "\`-release' is ignored for convenience libraries" else # Parse the version information argument. save_ifs="$IFS"; IFS=':' set dummy $vinfo 0 0 0 shift IFS="$save_ifs" test -n "$7" && \ func_fatal_help "too many parameters to \`-version-info'" # convert absolute version numbers to libtool ages # this retains compatibility with .la files and attempts # to make the code below a bit more comprehensible case $vinfo_number in yes) number_major="$1" number_minor="$2" number_revision="$3" # # There are really only two kinds -- those that # use the current revision as the major version # and those that subtract age and use age as # a minor version. But, then there is irix # 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|qnx|sunos) current="$number_major" revision="$number_minor" age="0" ;; irix|nonstopux) func_arith $number_major + $number_minor current=$func_arith_result age="$number_minor" revision="$number_minor" lt_irix_increment=no ;; *) func_fatal_configuration "$modename: unknown library version type \`$version_type'" ;; esac ;; no) current="$1" revision="$2" age="$3" ;; esac # Check that each of the things are valid numbers. case $current in 0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;; *) func_error "CURRENT \`$current' must be a nonnegative integer" func_fatal_error "\`$vinfo' is not valid version information" ;; esac case $revision in 0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;; *) func_error "REVISION \`$revision' must be a nonnegative integer" func_fatal_error "\`$vinfo' is not valid version information" ;; esac case $age in 0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;; *) func_error "AGE \`$age' must be a nonnegative integer" func_fatal_error "\`$vinfo' is not valid version information" ;; esac if test "$age" -gt "$current"; then func_error "AGE \`$age' is greater than the current interface number \`$current'" func_fatal_error "\`$vinfo' is not valid version information" fi # Calculate the version variables. major= versuffix= verstring= case $version_type in none) ;; darwin) # Like Linux, but with the current version available in # verstring for coding it into the library header func_arith $current - $age major=.$func_arith_result versuffix="$major.$age.$revision" # Darwin ld doesn't like 0 for these options... func_arith $current + 1 minor_current=$func_arith_result xlcverstring="${wl}-compatibility_version ${wl}$minor_current ${wl}-current_version ${wl}$minor_current.$revision" verstring="-compatibility_version $minor_current -current_version $minor_current.$revision" ;; freebsd-aout) major=".$current" versuffix=".$current.$revision"; ;; freebsd-elf) major=".$current" versuffix=".$current" ;; irix | nonstopux) if test "X$lt_irix_increment" = "Xno"; then func_arith $current - $age else func_arith $current - $age + 1 fi major=$func_arith_result case $version_type in nonstopux) verstring_prefix=nonstopux ;; *) verstring_prefix=sgi ;; esac verstring="$verstring_prefix$major.$revision" # Add in all the interfaces that we are compatible with. loop=$revision while test "$loop" -ne 0; do func_arith $revision - $loop iface=$func_arith_result func_arith $loop - 1 loop=$func_arith_result verstring="$verstring_prefix$major.$iface:$verstring" done # Before this point, $major must not contain `.'. major=.$major versuffix="$major.$revision" ;; linux) # correct to gnu/linux during the next big refactor func_arith $current - $age major=.$func_arith_result versuffix="$major.$age.$revision" ;; osf) func_arith $current - $age major=.$func_arith_result versuffix=".$current.$age.$revision" verstring="$current.$age.$revision" # Add in all the interfaces that we are compatible with. loop=$age while test "$loop" -ne 0; do func_arith $current - $loop iface=$func_arith_result func_arith $loop - 1 loop=$func_arith_result verstring="$verstring:${iface}.0" done # Make executables depend on our current version. func_append verstring ":${current}.0" ;; qnx) major=".$current" versuffix=".$current" ;; sunos) major=".$current" versuffix=".$current.$revision" ;; windows) # Use '-' rather than '.', since we only want one # extension on DOS 8.3 filesystems. func_arith $current - $age major=$func_arith_result versuffix="-$major" ;; *) func_fatal_configuration "unknown library version type \`$version_type'" ;; esac # Clear the version info if we defaulted, and they specified a release. if test -z "$vinfo" && test -n "$release"; then major= case $version_type in darwin) # we can't check for "0.0" in archive_cmds due to quoting # problems, so we reset it completely verstring= ;; *) verstring="0.0" ;; esac if test "$need_version" = no; then versuffix= else versuffix=".0.0" fi fi # Remove version info from name if versioning should be avoided if test "$avoid_version" = yes && test "$need_version" = no; then major= versuffix= verstring="" fi # Check to see if the archive will have undefined symbols. if test "$allow_undefined" = yes; then if test "$allow_undefined_flag" = unsupported; then func_warning "undefined symbols not allowed in $host shared libraries" build_libtool_libs=no build_old_libs=yes fi else # Don't allow undefined symbols. allow_undefined_flag="$no_undefined_flag" fi fi func_generate_dlsyms "$libname" "$libname" "yes" func_append libobjs " $symfileobj" test "X$libobjs" = "X " && libobjs= 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= tempremovelist=`$ECHO "$output_objdir/*"` for p in $tempremovelist; do case $p in *.$objext | *.gcno) ;; $output_objdir/$outputname | $output_objdir/$libname.* | $output_objdir/${libname}${release}.*) if test "X$precious_files_regex" != "X"; then if $ECHO "$p" | $EGREP -e "$precious_files_regex" >/dev/null 2>&1 then continue fi fi func_append removelist " $p" ;; *) ;; esac done test -n "$removelist" && \ func_show_eval "${RM}r \$removelist" fi # Now set the variables for building old libraries. if test "$build_old_libs" = yes && test "$build_libtool_libs" != convenience ; then func_append oldlibs " $output_objdir/$libname.$libext" # Transform .lo files to .o files. 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 "$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 func_replace_sysroot "$libdir" func_append temp_xrpath " -R$func_replace_sysroot_result" case "$finalize_rpath " in *" $libdir "*) ;; *) func_append finalize_rpath " $libdir" ;; esac done if test "$hardcode_into_libs" != yes || test "$build_old_libs" = yes; then dependency_libs="$temp_xrpath $dependency_libs" fi fi # Make sure dlfiles contains only unique files that won't be dlpreopened old_dlfiles="$dlfiles" dlfiles= for lib in $old_dlfiles; do case " $dlprefiles $dlfiles " in *" $lib "*) ;; *) func_append dlfiles " $lib" ;; esac done # Make sure dlprefiles contains only unique files old_dlprefiles="$dlprefiles" dlprefiles= for lib in $old_dlprefiles; do case "$dlprefiles " in *" $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* | *-*-haiku*) # these systems don't actually have a c library (as such)! ;; *-*-rhapsody* | *-*-darwin1.[012]) # Rhapsody C library is in the System framework func_append deplibs " System.ltframework" ;; *-*-netbsd*) # Don't link with libc until the a.out ld.so is fixed. ;; *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*) # Do not include libc due to us having libc/libc_r. ;; *-*-sco3.2v5* | *-*-sco5v6*) # Causes problems with __ctype ;; *-*-sysv4.2uw2* | *-*-sysv5* | *-*-unixware* | *-*-OpenUNIX*) # Compiler inserts libc in the correct place for threads to work ;; *) # Add libc to deplibs on all other systems if necessary. if test "$build_libtool_need_lc" = "yes"; then func_append deplibs " -lc" fi ;; esac fi # Transform deplibs into only deplibs that can be linked in shared. name_save=$name libname_save=$libname release_save=$release versuffix_save=$versuffix major_save=$major # I'm not sure if I'm treating the release correctly. I think # release should show up in the -l (ie -lgmp5) so we don't want to # add it in twice. Is that correct? release="" versuffix="" major="" newdeplibs= droppeddeps=no case $deplibs_check_method in pass_all) # Don't check for shared/static. Everything works. # This might be a little naive. We might want to check # whether the library exists or not. But this is on # osf3 & osf4 and I'm not really sure... Just # implementing what was already the behavior. newdeplibs=$deplibs ;; test_compile) # This code stresses the "libraries are programs" paradigm to its # limits. Maybe even breaks it. We compile a program, linking it # against the deplibs as a proxy for the library. Then we can check # whether they linked in statically or dynamically with ldd. $opt_dry_run || $RM conftest.c cat > conftest.c </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 | $GREP " -> " >/dev/null; then continue fi # The statement above tries to avoid entering an # endless loop below, in case of cyclic links. # We might still enter an endless loop, since a link # loop can be closed while we follow links, # but so what? potlib="$potent_lib" while test -h "$potlib" 2>/dev/null; do potliblink=`ls -ld $potlib | ${SED} 's/.* -> //'` case $potliblink in [\\/]* | [A-Za-z]:[\\/]*) potlib="$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 func_append newdeplibs " $a_deplib" a_deplib="" break 2 fi done done fi if test -n "$a_deplib" ; then droppeddeps=yes 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" if test -z "$potlib" ; then $ECHO "*** with $libname but no candidates were found. (...for file magic test)" else $ECHO "*** with $libname and none of the candidates passed a file format test" $ECHO "*** using a file magic. Last file checked: $potlib" fi fi ;; *) # Add a -L argument. func_append newdeplibs " $a_deplib" ;; esac done # Gone through all deplibs. ;; match_pattern*) set dummy $deplibs_check_method; shift match_pattern_regex=`expr "$deplibs_check_method" : "$1 \(.*\)"` for a_deplib in $deplibs; do case $a_deplib in -l*) func_stripname -l '' "$a_deplib" name=$func_stripname_result if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then case " $predeps $postdeps " in *" $a_deplib "*) func_append newdeplibs " $a_deplib" a_deplib="" ;; esac fi if test -n "$a_deplib" ; then libname=`eval "\\$ECHO \"$libname_spec\""` for i in $lib_search_path $sys_lib_search_path $shlib_search_path; do 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 \"$potent_lib\"" 2>/dev/null | $SED 10q | \ $EGREP "$match_pattern_regex" > /dev/null; then func_append newdeplibs " $a_deplib" a_deplib="" break 2 fi done done fi if test -n "$a_deplib" ; then droppeddeps=yes 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" if test -z "$potlib" ; then $ECHO "*** with $libname but no candidates were found. (...for regex pattern test)" else $ECHO "*** with $libname and none of the candidates passed a file format test" $ECHO "*** using a regex pattern. Last file checked: $potlib" fi fi ;; *) # Add a -L argument. func_append newdeplibs " $a_deplib" ;; esac done # Gone through all deplibs. ;; none | unknown | *) newdeplibs="" 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 " $tmp_deplibs" | $SED "s,$i,,"` done fi case $tmp_deplibs in *[!\ \ ]*) echo if test "X$deplibs_check_method" = "Xnone"; then echo "*** Warning: inter-library dependencies are not supported in this platform." else echo "*** Warning: inter-library dependencies are not known to be supported." fi echo "*** All declared inter-library dependencies are being dropped." droppeddeps=yes ;; esac ;; esac versuffix=$versuffix_save major=$major_save release=$release_save libname=$libname_save name=$name_save case $host in *-*-rhapsody* | *-*-darwin1.[012]) # On Rhapsody replace the C library with the System framework 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 "*** 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." 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." fi if test "$build_old_libs" = no; then oldlibs="$output_objdir/$libname.$libext" build_libtool_libs=module build_old_libs=yes else 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." 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." if test "$build_old_libs" = no; then oldlibs="$output_objdir/$libname.$libext" build_libtool_libs=module build_old_libs=yes else build_libtool_libs=no fi fi fi fi # Done checking deplibs! deplibs=$newdeplibs fi # Time to change all our "foo.ltframework" stuff back to "-framework foo" case $host in *-*-darwin*) 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 # move library search paths that coincide with paths to not yet # installed libraries to the beginning of the library search list new_libs= for path in $notinst_path; do case " $new_libs " in *" -L$path/$objdir "*) ;; *) case " $deplibs " in *" -L$path/$objdir "*) func_append new_libs " -L$path/$objdir" ;; esac ;; esac done for deplib in $deplibs; do case $deplib in -L*) case " $new_libs " in *" $deplib "*) ;; *) func_append new_libs " $deplib" ;; esac ;; *) func_append new_libs " $deplib" ;; esac done deplibs="$new_libs" # All the library-specific variables (install_libdir is set above). library_names= old_library= dlname= # 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 "$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 # Just accumulate the unique libdirs. case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*) ;; *) func_append hardcode_libdirs "$hardcode_libdir_separator$libdir" ;; esac fi else eval flag=\"$hardcode_libdir_flag_spec\" func_append dep_rpath " $flag" fi elif test -n "$runpath_var"; then case "$perm_rpath " in *" $libdir "*) ;; *) func_append perm_rpath " $libdir" ;; esac fi done # Substitute the hardcoded libdirs into the rpath. if test -n "$hardcode_libdir_separator" && test -n "$hardcode_libdirs"; then libdir="$hardcode_libdirs" 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 func_append rpath "$dir:" done eval "$runpath_var='$rpath\$$runpath_var'; export $runpath_var" fi test -n "$dep_rpath" && deplibs="$dep_rpath $deplibs" fi shlibpath="$finalize_shlibpath" test "$opt_mode" != relink && shlibpath="$compile_shlibpath$shlibpath" if test -n "$shlibpath"; then eval "$shlibpath_var='$shlibpath\$$shlibpath_var'; export $shlibpath_var" fi # Get the real and link names of the library. eval shared_ext=\"$shrext_cmds\" eval library_names=\"$library_names_spec\" set dummy $library_names shift realname="$1" shift if test -n "$soname_spec"; then eval soname=\"$soname_spec\" else soname="$realname" fi if test -z "$dlname"; then dlname=$soname fi lib="$output_objdir/$realname" linknames= for link do func_append linknames " $link" done # Use standard objects if they are pic 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" func_append delfiles " $export_symbols" fi orig_export_symbols= case $host_os in cygwin* | mingw* | cegcc*) if test -n "$export_symbols" && test -z "$export_symbols_regex"; then # exporting using user supplied symfile if test "x`$SED 1q $export_symbols`" != xEXPORTS; then # and it's NOT already a .def file. Must figure out # which of the given symbols are data symbols and tag # them as such. So, trigger use of export_symbols_cmds. # export_symbols gets reassigned inside the "prepare # the list of exported symbols" if statement, so the # include_expsyms logic still works. orig_export_symbols="$export_symbols" export_symbols= always_export_symbols=yes fi fi ;; esac # Prepare the list of exported symbols if test -z "$export_symbols"; then if test "$always_export_symbols" = yes || test -n "$export_symbols_regex"; then func_verbose "generating symbol list for \`$libname.la'" export_symbols="$output_objdir/$libname.exp" $opt_dry_run || $RM $export_symbols cmds=$export_symbols_cmds save_ifs="$IFS"; IFS='~' for cmd1 in $cmds; do IFS="$save_ifs" # 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. func_verbose "using reloadable object file for export list..." skipped_export=: # Break out early, otherwise skipped_export may be # set to false by a later but shorter cmd. break fi done IFS="$save_ifs" if test -n "$export_symbols_regex" && test "X$skipped_export" != "X:"; then func_show_eval '$EGREP -e "$export_symbols_regex" "$export_symbols" > "${export_symbols}T"' func_show_eval '$MV "${export_symbols}T" "$export_symbols"' fi fi fi 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 "$include_expsyms" | $SP2NL >> "$tmp_export_symbols"' fi if test "X$skipped_export" != "X:" && test -n "$orig_export_symbols"; then # The given exports_symbols file has to be filtered, so filter it. func_verbose "filter symbol list for \`$libname.la' to tag DATA exports" # FIXME: $output_objdir/$libname.filter potentially contains lots of # 's' commands which not all seds can handle. GNU sed should be fine # though. Also, the filter scales superlinearly with the number of # 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 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 tmp_deplibs= for test_deplib in $deplibs; do case " $convenience " in *" $test_deplib "*) ;; *) func_append tmp_deplibs " $test_deplib" ;; esac done deplibs="$tmp_deplibs" if test -n "$convenience"; then if test -n "$whole_archive_flag_spec" && test "$compiler_needs_object" = yes && test -z "$libobjs"; then # extract the archives, so we have objects to list. # TODO: could optimize this to just extract one archive. whole_archive_flag_spec= fi if test -n "$whole_archive_flag_spec"; then save_libobjs=$libobjs eval libobjs=\"\$libobjs $whole_archive_flag_spec\" test "X$libobjs" = "X " && libobjs= else gentop="$output_objdir/${outputname}x" func_append generated " $gentop" func_extract_archives $gentop $convenience 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\" func_append linker_flags " $flag" fi # Make a backup of the uninstalled library when relinking if test "$opt_mode" = relink; then $opt_dry_run || eval '(cd $output_objdir && $RM ${realname}U && $MV $realname ${realname}U)' || exit $? fi # Do each of the archive commands. if test "$module" = yes && test -n "$module_cmds" ; then if test -n "$export_symbols" && test -n "$module_expsym_cmds"; then eval test_cmds=\"$module_expsym_cmds\" cmds=$module_expsym_cmds else eval test_cmds=\"$module_cmds\" cmds=$module_cmds fi else if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then eval test_cmds=\"$archive_expsym_cmds\" cmds=$archive_expsym_cmds else eval test_cmds=\"$archive_cmds\" cmds=$archive_cmds fi fi if test "X$skipped_export" != "X:" && func_len " $test_cmds" && len=$func_len_result && test "$len" -lt "$max_cmd_len" || test "$max_cmd_len" -le -1; then : else # The command line is too long to link in one step, link piecewise # or, if using GNU ld and skipped_export is not :, use a linker # script. # Save the value of $output and $libobjs because we want to # use them later. If we have whole_archive_flag_spec, we # want to use save_libobjs as it was before # whole_archive_flag_spec was expanded, because we can't # assume the linker understands whole_archive_flag_spec. # This may have to be revisited, in case too many # convenience libraries get linked in and end up exceeding # the spec. if test -z "$convenience" || test -z "$whole_archive_flag_spec"; then save_libobjs=$libobjs fi save_output=$output func_basename "$output" output_la=$func_basename_result # Clear the reloadable object creation command queue and # initialize k to one. test_cmds= concat_cmds= objlist= last_robj= k=1 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 for obj in $save_libobjs do func_to_tool_file "$obj" $ECHO "$func_to_tool_file_result" >> $output done 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" : > $output set x $save_libobjs shift firstobj= if test "$compiler_needs_object" = yes; then firstobj="$1 " shift fi for obj do func_to_tool_file "$obj" $ECHO "$func_to_tool_file_result" >> $output done 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..." output=$output_objdir/$output_la-${k}.$objext eval test_cmds=\"$reload_cmds\" func_len " $test_cmds" len0=$func_len_result len=$len0 # Loop over the list of objects to be linked. for obj in $save_libobjs do func_len " $obj" func_arith $len + $func_len_result len=$func_arith_result if test "X$objlist" = X || test "$len" -lt "$max_cmd_len"; then func_append objlist " $obj" else # The command $test_cmds is almost too long, add a # command to the queue. if test "$k" -eq 1 ; then # The first file doesn't have a previous command to add. reload_objs=$objlist eval concat_cmds=\"$reload_cmds\" else # All subsequent reloadable object files will link in # the last one created. 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" func_len " $last_robj" func_arith $len0 + $func_len_result len=$func_arith_result fi done # Handle the remaining objects by creating one last # reloadable object file. All subsequent reloadable object # files will link in the last one created. test -z "$concat_cmds" || concat_cmds=$concat_cmds~ 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 func_append delfiles " $output" else output= fi if ${skipped_export-false}; then func_verbose "generating symbol list for \`$libname.la'" export_symbols="$output_objdir/$libname.exp" $opt_dry_run || $RM $export_symbols libobjs=$output # Append the command to create the export file. test -z "$concat_cmds" || concat_cmds=$concat_cmds~ eval concat_cmds=\"\$concat_cmds$export_symbols_cmds\" if test -n "$last_robj"; then eval concat_cmds=\"\$concat_cmds~\$RM $last_robj\" fi fi test -n "$save_libobjs" && func_verbose "creating a temporary reloadable object file: $output" # Loop through the commands generated above and execute them. save_ifs="$IFS"; IFS='~' for cmd in $concat_cmds; do IFS="$save_ifs" $opt_silent || { func_quote_for_expand "$cmd" eval "func_echo $func_quote_for_expand_result" } $opt_dry_run || eval "$cmd" || { lt_exit=$? # Restore the uninstalled library and exit if test "$opt_mode" = relink; then ( cd "$output_objdir" && \ $RM "${realname}T" && \ $MV "${realname}U" "$realname" ) fi exit $lt_exit } done IFS="$save_ifs" if test -n "$export_symbols_regex" && ${skipped_export-false}; then func_show_eval '$EGREP -e "$export_symbols_regex" "$export_symbols" > "${export_symbols}T"' func_show_eval '$MV "${export_symbols}T" "$export_symbols"' fi fi if ${skipped_export-false}; then 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 "$include_expsyms" | $SP2NL >> "$tmp_export_symbols"' fi if test -n "$orig_export_symbols"; then # The given exports_symbols file has to be filtered, so filter it. func_verbose "filter symbol list for \`$libname.la' to tag DATA exports" # FIXME: $output_objdir/$libname.filter potentially contains lots of # 's' commands which not all seds can handle. GNU sed should be fine # though. Also, the filter scales superlinearly with the number of # 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 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 fi libobjs=$output # Restore the value of output. output=$save_output if test -n "$convenience" && test -n "$whole_archive_flag_spec"; then eval libobjs=\"\$libobjs $whole_archive_flag_spec\" test "X$libobjs" = "X " && libobjs= fi # Expand the library linking commands again to reset the # value of $libobjs for piecewise linking. # Do each of the archive commands. if test "$module" = yes && test -n "$module_cmds" ; then if test -n "$export_symbols" && test -n "$module_expsym_cmds"; then cmds=$module_expsym_cmds else cmds=$module_cmds fi else if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then cmds=$archive_expsym_cmds else cmds=$archive_cmds fi fi fi if test -n "$delfiles"; then # Append the command to remove temporary files to $cmds. eval cmds=\"\$cmds~\$RM $delfiles\" fi # Add any objects from preloaded convenience libraries if test -n "$dlprefiles"; then gentop="$output_objdir/${outputname}x" func_append generated " $gentop" func_extract_archives $gentop $dlprefiles func_append libobjs " $func_extract_archives_result" test "X$libobjs" = "X " && libobjs= fi save_ifs="$IFS"; IFS='~' for cmd in $cmds; do IFS="$save_ifs" eval cmd=\"$cmd\" $opt_silent || { func_quote_for_expand "$cmd" eval "func_echo $func_quote_for_expand_result" } $opt_dry_run || eval "$cmd" || { lt_exit=$? # Restore the uninstalled library and exit if test "$opt_mode" = relink; then ( cd "$output_objdir" && \ $RM "${realname}T" && \ $MV "${realname}U" "$realname" ) fi exit $lt_exit } done IFS="$save_ifs" # Restore the uninstalled library and exit 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 if test -z "$whole_archive_flag_spec"; then func_show_eval '${RM}r "$gentop"' fi fi exit $EXIT_SUCCESS fi # Create links to the real library. for linkname in $linknames; do if test "$realname" != "$linkname"; then func_show_eval '(cd "$output_objdir" && $RM "$linkname" && $LN_S "$realname" "$linkname")' 'exit $?' fi done # If -module or -export-dynamic was specified, set the dlname. if test "$module" = yes || test "$export_dynamic" = yes; then # On all known operating systems, these are identical. dlname="$soname" fi fi ;; obj) if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then func_warning "\`-dlopen' is ignored for objects" fi case " $deplibs" in *\ -l* | *\ -L*) func_warning "\`-l' and \`-L' are ignored for objects" ;; esac test -n "$rpath" && \ func_warning "\`-rpath' is ignored for objects" test -n "$xrpath" && \ func_warning "\`-R' is ignored for objects" test -n "$vinfo" && \ func_warning "\`-version-info' is ignored for objects" test -n "$release" && \ func_warning "\`-release' is ignored for objects" case $output in *.lo) test -n "$objs$old_deplibs" && \ func_fatal_error "cannot build library object \`$output' from non-libtool objects" libobj=$output func_lo2o "$libobj" obj=$func_lo2o_result ;; *) libobj= obj="$output" ;; esac # Delete the old objects. $opt_dry_run || $RM $obj $libobj # Objects from convenience libraries. This assumes # single-version convenience libraries. Whenever we create # different ones for PIC/non-PIC, this we'll have to duplicate # the extraction. reload_conv_objs= gentop= # reload_cmds runs $LD directly, so let us get rid of # -Wl from whole_archive_flag_spec and hope we can get by with # turning comma into space.. wl= 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 "$tmp_whole_archive_flags" | $SED 's|,| |g'` else gentop="$output_objdir/${obj}x" 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 "$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 $?' # Exit if we aren't doing a library object file. if test -z "$libobj"; then if test -n "$gentop"; then func_show_eval '${RM}r "$gentop"' fi exit $EXIT_SUCCESS fi if test "$build_libtool_libs" != yes; then if test -n "$gentop"; then func_show_eval '${RM}r "$gentop"' fi # Create an invalid libtool object if no PIC, so that we don't # accidentally link it into a program. # $show "echo timestamp > $libobj" # $opt_dry_run || eval "echo timestamp > $libobj" || exit $? exit $EXIT_SUCCESS fi if test -n "$pic_flag" || test "$pic_mode" != default; then # Only do commands if we really have different PIC objects. reload_objs="$libobjs $reload_conv_objs" output="$libobj" func_execute_cmds "$reload_cmds" 'exit $?' fi if test -n "$gentop"; then func_show_eval '${RM}r "$gentop"' fi exit $EXIT_SUCCESS ;; prog) case $host in *cygwin*) func_stripname '' '.exe' "$output" output=$func_stripname_result.exe;; esac test -n "$vinfo" && \ func_warning "\`-version-info' is ignored for programs" test -n "$release" && \ func_warning "\`-release' is ignored for programs" test "$preload" = yes \ && test "$dlopen_support" = unknown \ && test "$dlopen_self" = unknown \ && test "$dlopen_self_static" = unknown && \ func_warning "\`LT_INIT([dlopen])' not used. Assuming no dlopen support." case $host in *-*-rhapsody* | *-*-darwin1.[012]) # On Rhapsody replace the C library is the System framework compile_deplibs=`$ECHO " $compile_deplibs" | $SED 's/ -lc / System.ltframework /'` finalize_deplibs=`$ECHO " $finalize_deplibs" | $SED 's/ -lc / System.ltframework /'` ;; esac case $host in *-*-darwin*) # Don't allow lazy linking, it breaks C++ global constructors # But is supposedly fixed on 10.4 or later (yay!). if test "$tagname" = CXX ; then case ${MACOSX_DEPLOYMENT_TARGET-10.0} in 10.[0123]) 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 " $compile_deplibs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` finalize_deplibs=`$ECHO " $finalize_deplibs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` ;; esac # move library search paths that coincide with paths to not yet # installed libraries to the beginning of the library search list new_libs= for path in $notinst_path; do case " $new_libs " in *" -L$path/$objdir "*) ;; *) case " $compile_deplibs " in *" -L$path/$objdir "*) func_append new_libs " -L$path/$objdir" ;; esac ;; esac done for deplib in $compile_deplibs; do case $deplib in -L*) case " $new_libs " in *" $deplib "*) ;; *) func_append new_libs " $deplib" ;; esac ;; *) func_append new_libs " $deplib" ;; esac done compile_deplibs="$new_libs" 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. for libdir in $rpath $xrpath; do # This is the magic to use -rpath. case "$finalize_rpath " in *" $libdir "*) ;; *) func_append finalize_rpath " $libdir" ;; esac done fi # Now hardcode the library paths rpath= hardcode_libdirs= for libdir in $compile_rpath $finalize_rpath; do if test -n "$hardcode_libdir_flag_spec"; then if test -n "$hardcode_libdir_separator"; then if test -z "$hardcode_libdirs"; then hardcode_libdirs="$libdir" else # Just accumulate the unique libdirs. case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*) ;; *) func_append hardcode_libdirs "$hardcode_libdir_separator$libdir" ;; esac fi else eval flag=\"$hardcode_libdir_flag_spec\" func_append rpath " $flag" fi elif test -n "$runpath_var"; then case "$perm_rpath " in *" $libdir "*) ;; *) func_append perm_rpath " $libdir" ;; esac fi case $host in *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-cegcc*) testbindir=`${ECHO} "$libdir" | ${SED} -e 's*/lib$*/bin*'` case :$dllsearchpath: in *":$libdir:"*) ;; ::) dllsearchpath=$libdir;; *) func_append dllsearchpath ":$libdir";; esac case :$dllsearchpath: in *":$testbindir:"*) ;; ::) dllsearchpath=$testbindir;; *) func_append dllsearchpath ":$testbindir";; esac ;; esac done # Substitute the hardcoded libdirs into the rpath. if test -n "$hardcode_libdir_separator" && test -n "$hardcode_libdirs"; then libdir="$hardcode_libdirs" eval rpath=\" $hardcode_libdir_flag_spec\" fi compile_rpath="$rpath" rpath= hardcode_libdirs= for libdir in $finalize_rpath; do if test -n "$hardcode_libdir_flag_spec"; then if test -n "$hardcode_libdir_separator"; then if test -z "$hardcode_libdirs"; then hardcode_libdirs="$libdir" else # Just accumulate the unique libdirs. case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*) ;; *) func_append hardcode_libdirs "$hardcode_libdir_separator$libdir" ;; esac fi else eval flag=\"$hardcode_libdir_flag_spec\" func_append rpath " $flag" fi elif test -n "$runpath_var"; then case "$finalize_perm_rpath " in *" $libdir "*) ;; *) func_append finalize_perm_rpath " $libdir" ;; esac fi done # Substitute the hardcoded libdirs into the rpath. if test -n "$hardcode_libdir_separator" && test -n "$hardcode_libdirs"; then libdir="$hardcode_libdirs" eval rpath=\" $hardcode_libdir_flag_spec\" fi finalize_rpath="$rpath" if test -n "$libobjs" && test "$build_old_libs" = yes; then # Transform all the library objects into standard objects. 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" # template prelinking step if test -n "$prelink_cmds"; then func_execute_cmds "$prelink_cmds" 'exit $?' fi 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 ;; *) if test "$need_relink" = no || test "$build_libtool_libs" != yes; then wrappers_required=no fi ;; esac if test "$wrappers_required" = no; then # Replace the output file specification. 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}"' fi exit $exit_status fi if test -n "$compile_shlibpath$finalize_shlibpath"; then compile_command="$shlibpath_var=\"$compile_shlibpath$finalize_shlibpath\$$shlibpath_var\" $compile_command" fi if test -n "$finalize_shlibpath"; then finalize_command="$shlibpath_var=\"$finalize_shlibpath\$$shlibpath_var\" $finalize_command" fi compile_var= finalize_var= if test -n "$runpath_var"; then if test -n "$perm_rpath"; then # We should set the runpath_var. rpath= for dir in $perm_rpath; do func_append rpath "$dir:" done compile_var="$runpath_var=\"$rpath\$$runpath_var\" " fi if test -n "$finalize_perm_rpath"; then # We should set the runpath_var. rpath= for dir in $finalize_perm_rpath; do func_append rpath "$dir:" done finalize_var="$runpath_var=\"$rpath\$$runpath_var\" " fi fi if test "$no_install" = yes; then # 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 "$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 if test "$hardcode_action" = relink; then # Fast installation is not supported link_command="$compile_var$compile_command$compile_rpath" relink_command="$finalize_var$finalize_command$finalize_rpath" func_warning "this platform does not like uninstalled shared libraries" func_warning "\`$output' will be relinked during installation" else if test "$fast_install" != no; then link_command="$finalize_var$compile_command$finalize_rpath" if test "$fast_install" = yes; then relink_command=`$ECHO "$compile_var$compile_command$compile_rpath" | $SED 's%@OUTPUT@%\$progdir/\$file%g'` else # fast_install is set to needless relink_command= fi else link_command="$compile_var$compile_command$compile_rpath" relink_command="$finalize_var$finalize_command$finalize_rpath" fi fi # Replace the output file specification. 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" # Quote the relink command for shipping. if test -n "$relink_command"; then # Preserve any variables that may affect compiler behavior for var in $variables_saved_for_relink; do if eval test -z \"\${$var+set}\"; then relink_command="{ test -z \"\${$var+set}\" || $lt_unset $var || { $var=; export $var; }; }; $relink_command" elif eval var_value=\$$var; test -z "$var_value"; then relink_command="$var=; export $var; $relink_command" else func_quote_for_eval "$var_value" relink_command="$var=$func_quote_for_eval_result; export $var; $relink_command" fi done relink_command="(cd `pwd`; $relink_command)" relink_command=`$ECHO "$relink_command" | $SED "$sed_quote_subst"` fi # Only actually do things if not in dry run mode. $opt_dry_run || { # win32 will think the script is a binary if it has # a .exe suffix, so we strip it off here. case $output in *.exe) func_stripname '' '.exe' "$output" output=$func_stripname_result ;; esac # test for cygwin because mv fails w/o .exe extensions case $host in *cygwin*) exeext=.exe func_stripname '' '.exe' "$outputname" outputname=$func_stripname_result ;; *) exeext= ;; esac case $host in *cygwin* | *mingw* ) func_dirname_and_basename "$output" "" "." output_name=$func_basename_result output_path=$func_dirname_result cwrappersource="$output_path/$objdir/lt-$output_name.c" cwrapper="$output_path/$output_name.exe" $RM $cwrappersource $cwrapper trap "$RM $cwrappersource $cwrapper; exit $EXIT_FAILURE" 1 2 15 func_emit_cwrapperexe_src > $cwrappersource # The wrapper executable is built using the $host compiler, # because it contains $host paths and files. If cross- # compiling, it, like the target executable, must be # executed on the $host or under an emulation environment. $opt_dry_run || { $LTCC $LTCFLAGS -o $cwrapper $cwrappersource $STRIP $cwrapper } # Now, create the wrapper script for func_source use: func_ltwrapper_scriptname $cwrapper $RM $func_ltwrapper_scriptname_result trap "$RM $func_ltwrapper_scriptname_result; exit $EXIT_FAILURE" 1 2 15 $opt_dry_run || { # note: this script will not be executed, so do not chmod. if test "x$build" = "x$host" ; then $cwrapper --lt-dump-script > $func_ltwrapper_scriptname_result else func_emit_wrapper no > $func_ltwrapper_scriptname_result fi } ;; * ) $RM $output trap "$RM $output; exit $EXIT_FAILURE" 1 2 15 func_emit_wrapper no > $output chmod +x $output ;; esac } exit $EXIT_SUCCESS ;; esac # See if we need to build an old-fashioned archive. for oldlib in $oldlibs; do if test "$build_libtool_libs" = convenience; then oldobjs="$libobjs_save $symfileobj" addlibs="$convenience" build_libtool_libs=no else if test "$build_libtool_libs" = module; then oldobjs="$libobjs_save" build_libtool_libs=no else oldobjs="$old_deplibs $non_pic_objects" if test "$preload" = yes && test -f "$symfileobj"; then func_append oldobjs " $symfileobj" fi fi addlibs="$old_convenience" fi if test -n "$addlibs"; then gentop="$output_objdir/${outputname}x" func_append generated " $gentop" func_extract_archives $gentop $addlibs func_append oldobjs " $func_extract_archives_result" fi # Do each command in the archive commands. if test -n "$old_archive_from_new_cmds" && test "$build_libtool_libs" = yes; then cmds=$old_archive_from_new_cmds else # Add any objects from preloaded convenience libraries if test -n "$dlprefiles"; then gentop="$output_objdir/${outputname}x" func_append generated " $gentop" func_extract_archives $gentop $dlprefiles func_append oldobjs " $func_extract_archives_result" fi # POSIX demands no paths to be encoded in archives. We have # to avoid creating archives with duplicate basenames if we # might have to extract them afterwards, e.g., when creating a # static archive out of a convenience library, or when linking # the entirety of a libtool archive into another (currently # not supported by libtool). if (for obj in $oldobjs do func_basename "$obj" $ECHO "$func_basename_result" done | sort | sort -uc >/dev/null 2>&1); then : else echo "copying selected object files to avoid basename conflicts..." gentop="$output_objdir/${outputname}x" func_append generated " $gentop" func_mkdir_p "$gentop" save_oldobjs=$oldobjs oldobjs= counter=1 for obj in $save_oldobjs do func_basename "$obj" objbase="$func_basename_result" case " $oldobjs " in " ") oldobjs=$obj ;; *[\ /]"$objbase "*) while :; do # Make sure we don't pick an alternate name that also # overlaps. newobj=lt$counter-$objbase func_arith $counter + 1 counter=$func_arith_result case " $oldobjs " in *[\ /]"$newobj "*) ;; *) if test ! -f "$gentop/$newobj"; then break; fi ;; esac done func_show_eval "ln $obj $gentop/$newobj || cp $obj $gentop/$newobj" func_append oldobjs " $gentop/$newobj" ;; *) 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..." save_RANLIB=$RANLIB RANLIB=: objlist= concat_cmds= save_oldobjs=$oldobjs oldobjs= # Is there a better way of finding the last object in the list? for obj in $save_oldobjs do last_oldobj=$obj done eval test_cmds=\"$old_archive_cmds\" func_len " $test_cmds" len0=$func_len_result len=$len0 for obj in $save_oldobjs do func_len " $obj" func_arith $len + $func_len_result len=$func_arith_result func_append objlist " $obj" if test "$len" -lt "$max_cmd_len"; then : else # the above command should be used before it gets too long oldobjs=$objlist if test "$obj" = "$last_oldobj" ; then RANLIB=$save_RANLIB fi test -z "$concat_cmds" || concat_cmds=$concat_cmds~ eval concat_cmds=\"\${concat_cmds}$old_archive_cmds\" objlist= len=$len0 fi done RANLIB=$save_RANLIB oldobjs=$objlist if test "X$oldobjs" = "X" ; then eval cmds=\"\$concat_cmds\" else eval cmds=\"\$concat_cmds~\$old_archive_cmds\" fi fi fi func_execute_cmds "$cmds" 'exit $?' done test -n "$generated" && \ func_show_eval "${RM}r$generated" # Now create the libtool archive. case $output in *.la) old_library= test "$build_old_libs" = yes && old_library="$libname.$libext" func_verbose "creating $output" # Preserve any variables that may affect compiler behavior for var in $variables_saved_for_relink; do if eval test -z \"\${$var+set}\"; then relink_command="{ test -z \"\${$var+set}\" || $lt_unset $var || { $var=; export $var; }; }; $relink_command" elif eval var_value=\$$var; test -z "$var_value"; then relink_command="$var=; export $var; $relink_command" else func_quote_for_eval "$var_value" relink_command="$var=$func_quote_for_eval_result; export $var; $relink_command" fi 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 "$relink_command" | $SED "$sed_quote_subst"` if test "$hardcode_automatic" = yes ; then relink_command= fi # Only create the output if not a dry run. $opt_dry_run || { for installed in no yes; do if test "$installed" = yes; then if test -z "$install_libdir"; then break fi output="$output_objdir/$outputname"i # Replace all uninstalled libtool libraries with the installed ones newdependency_libs= for deplib in $dependency_libs; do case $deplib in *.la) func_basename "$deplib" name="$func_basename_result" 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" 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" ;; -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" newdlfiles= for lib in $dlfiles; do case $lib in *.la) func_basename "$lib" name="$func_basename_result" eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $lib` test -z "$libdir" && \ func_fatal_error "\`$lib' is not a valid libtool archive" func_append newdlfiles " ${lt_sysroot:+=}$libdir/$name" ;; *) func_append newdlfiles " $lib" ;; esac done dlfiles="$newdlfiles" newdlprefiles= for lib in $dlprefiles; do case $lib in *.la) # Only pass preopened files to the pseudo-archive (for # eventual linking with the app. that links it) if we # didn't already link the preopened objects directly into # the library: func_basename "$lib" name="$func_basename_result" eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $lib` test -z "$libdir" && \ func_fatal_error "\`$lib' is not a valid libtool archive" func_append newdlprefiles " ${lt_sysroot:+=}$libdir/$name" ;; esac done dlprefiles="$newdlprefiles" else newdlfiles= for lib in $dlfiles; do case $lib in [\\/]* | [A-Za-z]:[\\/]*) abs="$lib" ;; *) abs=`pwd`"/$lib" ;; esac func_append newdlfiles " $abs" done dlfiles="$newdlfiles" newdlprefiles= for lib in $dlprefiles; do case $lib in [\\/]* | [A-Za-z]:[\\/]*) abs="$lib" ;; *) abs=`pwd`"/$lib" ;; esac 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) # 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 # Generated by $PROGRAM (GNU $PACKAGE$TIMESTAMP) $VERSION # # Please DO NOT delete this file! # It is necessary for linking the library. # The name that we can dlopen(3). dlname='$tdlname' # Names of this library. library_names='$library_names' # The name of the static archive. old_library='$old_library' # Linker flags that can not go in dependency_libs. inherited_linker_flags='$new_inherited_linker_flags' # Libraries that this one depends upon. dependency_libs='$dependency_libs' # Names of additional weak libraries provided by this library weak_library_names='$weak_libs' # Version information for $libname. current=$current age=$age revision=$revision # Is this an already installed library? installed=$installed # Should we warn about portability when linking against -modules? shouldnotlink=$module # Files to dlopen/dlpreopen dlopen='$dlfiles' dlpreopen='$dlprefiles' # Directory that this library needs to be installed in: libdir='$install_libdir'" if test "$installed" = no && test "$need_relink" = yes; then $ECHO >> $output "\ relink_command=\"$relink_command\"" fi done } # Do a symbolic link so that the libtool archive can be found in # LD_LIBRARY_PATH before the program is installed. func_show_eval '( cd "$output_objdir" && $RM "$outputname" && $LN_S "../$outputname" "$outputname" )' 'exit $?' ;; esac exit $EXIT_SUCCESS } { test "$opt_mode" = link || test "$opt_mode" = relink; } && func_mode_link ${1+"$@"} # func_mode_uninstall arg... func_mode_uninstall () { $opt_debug RM="$nonopt" files= rmforce= exit_status=0 # This variable tells wrapper scripts just to set variables rather # than running their programs. libtool_install_magic="$magic" for arg do case $arg in -f) func_append RM " $arg"; rmforce=yes ;; -*) func_append RM " $arg" ;; *) func_append files " $arg" ;; esac done test -z "$RM" && \ func_fatal_help "you must specify an RM program" rmdirs= for file in $files; do func_dirname "$file" "" "." dir="$func_dirname_result" if test "X$dir" = X.; then odir="$objdir" else odir="$dir/$objdir" fi func_basename "$file" name="$func_basename_result" test "$opt_mode" = uninstall && odir="$dir" # Remember odir for removal later, being careful to avoid duplicates if test "$opt_mode" = clean; then case " $rmdirs " in *" $odir "*) ;; *) func_append rmdirs " $odir" ;; esac fi # Don't error if the file doesn't exist and rm -f was used. if { test -L "$file"; } >/dev/null 2>&1 || { test -h "$file"; } >/dev/null 2>&1 || test -f "$file"; then : elif test -d "$file"; then exit_status=1 continue elif test "$rmforce" = yes; then continue fi rmfiles="$file" case $name in *.la) # Possibly a libtool archive, so verify it. if func_lalib_p "$file"; then func_source $dir/$name # Delete the libtool libraries and symlinks. for n in $library_names; do func_append rmfiles " $odir/$n" done test -n "$old_library" && func_append rmfiles " $odir/$old_library" case "$opt_mode" in clean) case " $library_names " in *" $dlname "*) ;; *) test -n "$dlname" && func_append rmfiles " $odir/$dlname" ;; esac test -n "$libdir" && func_append rmfiles " $odir/$name $odir/${name}i" ;; uninstall) if test -n "$library_names"; then # Do each command in the postuninstall commands. func_execute_cmds "$postuninstall_cmds" 'test "$rmforce" = yes || exit_status=1' fi if test -n "$old_library"; then # Do each command in the old_postuninstall commands. func_execute_cmds "$old_postuninstall_cmds" 'test "$rmforce" = yes || exit_status=1' fi # FIXME: should reinstall the best remaining shared library. ;; esac fi ;; *.lo) # Possibly a libtool object, so verify it. if func_lalib_p "$file"; then # Read the .lo file func_source $dir/$name # Add PIC object to the list of files to remove. if test -n "$pic_object" && test "$pic_object" != none; then 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 func_append rmfiles " $dir/$non_pic_object" fi fi ;; *) if test "$opt_mode" = clean ; then noexename=$name case $file in *.exe) func_stripname '' '.exe' "$file" file=$func_stripname_result func_stripname '' '.exe' "$name" noexename=$func_stripname_result # $file with .exe has already been added to rmfiles, # add $file without .exe func_append rmfiles " $file" ;; esac # Do a test to see if this is a libtool program. if func_ltwrapper_p "$file"; then if func_ltwrapper_executable_p "$file"; then func_ltwrapper_scriptname "$file" relink_command= func_source $func_ltwrapper_scriptname_result func_append rmfiles " $func_ltwrapper_scriptname_result" else relink_command= func_source $dir/$noexename fi # note $name still contains .exe if it was in $file originally # as does the version of $file that was added into $rmfiles func_append rmfiles " $odir/$name $odir/${name}S.${objext}" if test "$fast_install" = yes && test -n "$relink_command"; then func_append rmfiles " $odir/lt-$name" fi if test "X$noexename" != "X$name" ; then func_append rmfiles " $odir/lt-${noexename}.c" fi fi fi ;; esac func_show_eval "$RM $rmfiles" 'exit_status=1' done # Try to remove the ${objdir}s in the directories where we deleted files for dir in $rmdirs; do if test -d "$dir"; then func_show_eval "rmdir $dir >/dev/null 2>&1" fi done exit $exit_status } { test "$opt_mode" = uninstall || test "$opt_mode" = clean; } && func_mode_uninstall ${1+"$@"} 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 \`$opt_mode'" if test -n "$exec_cmd"; then eval exec "$exec_cmd" exit $EXIT_FAILURE fi exit $exit_status # The TAGs below are defined such that we never get into a situation # in which we disable both kinds of libraries. Given conflicting # choices, we go for a static library, that is the most portable, # since we can't tell whether shared libraries were disabled because # the user asked for that or because the platform doesn't support # them. This is particularly important on AIX, because we don't # support having both static and shared libraries enabled at the same # time on that platform, so we default to a shared-only configuration. # If a disable-shared tag is given, we'll fallback to a static-only # configuration. But we'll never go from static-only to shared-only. # ### BEGIN LIBTOOL TAG CONFIG: disable-shared build_libtool_libs=no build_old_libs=yes # ### END LIBTOOL TAG CONFIG: disable-shared # ### BEGIN LIBTOOL TAG CONFIG: disable-static build_old_libs=`case $build_libtool_libs in yes) echo no;; *) echo yes;; esac` # ### END LIBTOOL TAG CONFIG: disable-static # Local Variables: # mode:shell-script # sh-indentation:2 # End: # vi:sw=2 tango-8.1.2c+dfsg.orig/config/missing0000755000175000017500000002453312205375077016456 0ustar piccapicca#! /bin/sh # Common stub for a few missing GNU programs while installing. scriptversion=2004-09-07.08 # Copyright (C) 1996, 1997, 1999, 2000, 2002, 2003, 2004 # Free Software Foundation, Inc. # Originally by Fran,cois Pinard , 1996. # 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., 59 Temple Place - Suite 330, Boston, MA # 02111-1307, USA. # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that program. if test $# -eq 0; then echo 1>&2 "Try \`$0 --help' for more information" exit 1 fi run=: # In the cases where this matters, `missing' is being run in the # srcdir already. if test -f configure.ac; then configure_ac=configure.ac else configure_ac=configure.in fi msg="missing on your system" case "$1" in --run) # Try to run requested program, and just exit if it succeeds. run= shift "$@" && exit 0 # Exit code 63 means version mismatch. This often happens # when the user try to use an ancient version of a tool on # a file that requires a minimum version. In this case we # we should proceed has if the program had been absent, or # if --run hadn't been passed. if test $? = 63; then run=: msg="probably too old" fi ;; -h|--h|--he|--hel|--help) echo "\ $0 [OPTION]... PROGRAM [ARGUMENT]... Handle \`PROGRAM [ARGUMENT]...' for when PROGRAM is missing, or return an error status if there is no known handling for PROGRAM. Options: -h, --help display this help and exit -v, --version output version information and exit --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' 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 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] Send bug reports to ." exit 0 ;; -v|--v|--ve|--ver|--vers|--versi|--versio|--version) echo "missing $scriptversion (GNU Automake)" exit 0 ;; -*) echo 1>&2 "$0: Unknown \`$1' option" echo 1>&2 "Try \`$0 --help' for more information" exit 1 ;; esac # Now exit if we have it, but it failed. Also exit now if we # don't have it and --version was passed (most likely to detect # the program). case "$1" in lex|yacc) # 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 # $TOOL exists and not knowing $TOOL uses missing. exit 1 fi ;; esac # If it does not exist, or fails to run (possibly an outdated version), # try to emulate it. case "$1" 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 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 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 from any GNU archive site." files=`sed -n 's/^[ ]*A[CM]_CONFIG_HEADER(\([^)]*\)).*/\1/p' ${configure_ac}` test -z "$files" && files="config.h" touch_files= for f in $files; do case "$f" in *:*) touch_files="$touch_files "`echo "$f" | sed -e 's/^[^:]*://' -e 's/:.*//'`;; *) touch_files="$touch_files $f.in";; esac done touch $touch_files ;; 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. Grab them from any GNU archive site." find . -type f -name Makefile.am -print | sed 's/\.am$/.in/' | while read f; do touch "$f"; done ;; autom4te) echo 1>&2 "\ 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 archive site." file=`echo "$*" | sed -n 's/.*--output[ =]*\([^ ]*\).*/\1/p'` test -z "$file" && file=`echo "$*" | sed -n 's/.*-o[ ]*\([^ ]*\).*/\1/p'` if test -f "$file"; then touch $file else test -z "$file" || exec >$file echo "#! /bin/sh" echo "# Created by GNU Automake missing as a replacement of" echo "# $ $@" echo "exit 0" chmod +x $file exit 1 fi ;; 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 in order for those modifications to take effect. You can get \`Bison' from any GNU archive site." rm -f y.tab.c y.tab.h if [ $# -ne 1 ]; then eval LASTARG="\${$#}" case "$LASTARG" in *.y) SRCFILE=`echo "$LASTARG" | sed 's/y$/c/'` if [ -f "$SRCFILE" ]; then cp "$SRCFILE" y.tab.c fi SRCFILE=`echo "$LASTARG" | sed 's/y$/h/'` if [ -f "$SRCFILE" ]; then cp "$SRCFILE" y.tab.h fi ;; esac fi if [ ! -f y.tab.h ]; then echo >y.tab.h fi if [ ! -f y.tab.c ]; then echo 'main() { return 0; }' >y.tab.c fi ;; 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 in order for those modifications to take effect. You can get \`Flex' from any GNU archive site." rm -f lex.yy.c if [ $# -ne 1 ]; then eval LASTARG="\${$#}" case "$LASTARG" in *.l) SRCFILE=`echo "$LASTARG" | sed 's/l$/c/'` if [ -f "$SRCFILE" ]; then cp "$SRCFILE" lex.yy.c fi ;; esac fi if [ ! -f lex.yy.c ]; then echo 'main() { return 0; }' >lex.yy.c fi ;; help2man) echo 1>&2 "\ 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." file=`echo "$*" | sed -n 's/.*-o \([^ ]*\).*/\1/p'` if test -z "$file"; then file=`echo "$*" | sed -n 's/.*--output=\([^ ]*\).*/\1/p'` fi if [ -f "$file" ]; then touch $file else test -z "$file" || exec >$file echo ".ab help2man is required to generate this page" exit 1 fi ;; 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 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." file=`echo "$*" | sed -n 's/.*-o \([^ ]*\).*/\1/p'` if test -z "$file"; then file=`echo "$*" | sed 's/.* \([^ ]*\) *$/\1/'` file=`sed -n '/^@setfilename/ { s/.* \([^ ]*\) *$/\1/; p; q; }' $file` fi 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. You might have modified some files without having the 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." exit 1 ;; esac exit 0 # Local variables: # eval: (add-hook 'write-file-hooks 'time-stamp) # time-stamp-start: "scriptversion=" # time-stamp-format: "%:y-%02m-%02d.%02H" # time-stamp-end: "$" # End: tango-8.1.2c+dfsg.orig/m4/0000755000175000017500000000000012205375305014115 5ustar piccapiccatango-8.1.2c+dfsg.orig/m4/check_zlib.m40000644000175000017500000000552012205375075016462 0ustar piccapiccadnl @synopsis CHECK_ZLIB() dnl dnl This macro searches for an installed zlib library. If nothing dnl was specified when calling configure, it searches first in /usr/local dnl and then in /usr. If the --with-zlib=DIR is specified, it will try dnl to find it in DIR/include/zlib.h and DIR/lib/libz.a. If --without-zlib dnl is specified, the library is not searched at all. dnl dnl If either the header file (zlib.h) or the library (libz) is not dnl found, the configuration exits on error, asking for a valid dnl zlib installation directory or --without-zlib. dnl dnl The macro defines the symbol HAVE_LIBZ if the library is found. You should dnl use autoheader to include a definition for this symbol in a config.h dnl file. Sample usage in a C/C++ source is as follows: dnl dnl #ifdef HAVE_LIBZ dnl #include dnl #endif /* HAVE_LIBZ */ dnl dnl @version $Id: check_zlib.m4,v 1.2 2000/07/19 13:03:32 simons Exp $ dnl @author Loic Dachary dnl AC_DEFUN([CHECK_ZLIB], # # Handle user hints # [AC_MSG_CHECKING(if zlib is wanted) AC_ARG_WITH(zlib, AC_HELP_STRING([--with-zlib=DIR],[root directory path of zlib installation defaults to /usr/local or /usr if not found in /usr/local]), [if test "$withval" != no ; then AC_MSG_RESULT(yes) ZLIB_HOME="$withval" else AC_MSG_RESULT(no) fi], [ AC_MSG_RESULT(yes) ZLIB_HOME=/usr/local if test ! -f "${ZLIB_HOME}/include/zlib.h" then ZLIB_HOME=/usr fi ]) # # Locate zlib, if wanted # if test -n "${ZLIB_HOME}" then ZLIB_OLD_LDFLAGS=$LDFLAGS ZLIB_OLD_LIBS=$LIBS ZLIB_OLD_CPPFLAGS=$LDFLAGS LDFLAGS="$LDFLAGS -L${ZLIB_HOME}/lib" CPPFLAGS="$CPPFLAGS -I${ZLIB_HOME}/include" CPPFLAGS="$CPPFLAGS -I${ZLIB_HOME}/include" 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 # # AC_CHECK_LIB(z, inflateEnd) # AC_MSG_CHECKING(zlib in ${ZLIB_HOME}) # AC_MSG_RESULT(ok) ZLIB_CPPFLAGS="-I${ZLIB_HOME}/include" ZLIB_LDFLAGS="-L${ZLIB_HOME}/lib" ZLIB_LIBS="-lz" AC_SUBST(ZLIB_LDFLAGS) AC_SUBST(ZLIB_LIBS) AC_SUBST(ZLIB_CPPFLAGS) else # # If either header or library was not found, revert and bomb # AC_MSG_ERROR(either specify a valid zlib installation with --with-zlib=DIR or disable zlib usage with --without-zlib) fi LDFLAGS="$ZLIB_OLD_LDFLAGS" CPPFLAGS="$ZLIB_OLD_CPPFLAGS" LIBS="$ZLIB_OLD_LIBS" fi ]) tango-8.1.2c+dfsg.orig/m4/ltoptions.m40000644000175000017500000003007312205375241016414 0ustar piccapicca# Helper functions for option handling. -*- Autoconf -*- # # 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 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])]) # _LT_MANGLE_OPTION(MACRO-NAME, OPTION-NAME) # ------------------------------------------ m4_define([_LT_MANGLE_OPTION], [[_LT_OPTION_]m4_bpatsubst($1__$2, [[^a-zA-Z0-9_]], [_])]) # _LT_SET_OPTION(MACRO-NAME, OPTION-NAME) # --------------------------------------- # Set option OPTION-NAME for macro MACRO-NAME, and if there is a # matching handler defined, dispatch to it. Other OPTION-NAMEs are # saved as a flag. m4_define([_LT_SET_OPTION], [m4_define(_LT_MANGLE_OPTION([$1], [$2]))dnl m4_ifdef(_LT_MANGLE_DEFUN([$1], [$2]), _LT_MANGLE_DEFUN([$1], [$2]), [m4_warning([Unknown $1 option `$2'])])[]dnl ]) # _LT_IF_OPTION(MACRO-NAME, OPTION-NAME, IF-SET, [IF-NOT-SET]) # ------------------------------------------------------------ # Execute IF-SET if OPTION is set, IF-NOT-SET otherwise. m4_define([_LT_IF_OPTION], [m4_ifdef(_LT_MANGLE_OPTION([$1], [$2]), [$3], [$4])]) # _LT_UNLESS_OPTIONS(MACRO-NAME, OPTION-LIST, IF-NOT-SET) # ------------------------------------------------------- # Execute IF-NOT-SET unless all options in OPTION-LIST for MACRO-NAME # are set. m4_define([_LT_UNLESS_OPTIONS], [m4_foreach([_LT_Option], m4_split(m4_normalize([$2])), [m4_ifdef(_LT_MANGLE_OPTION([$1], _LT_Option), [m4_define([$0_found])])])[]dnl m4_ifdef([$0_found], [m4_undefine([$0_found])], [$3 ])[]dnl ]) # _LT_SET_OPTIONS(MACRO-NAME, OPTION-LIST) # ---------------------------------------- # OPTION-LIST is a space-separated list of Libtool options associated # with MACRO-NAME. If any OPTION has a matching handler declared with # LT_OPTION_DEFINE, dispatch to that macro; otherwise complain about # the unknown option and exit. m4_defun([_LT_SET_OPTIONS], [# Set options m4_foreach([_LT_Option], m4_split(m4_normalize([$2])), [_LT_SET_OPTION([$1], _LT_Option)]) m4_if([$1],[LT_INIT],[ dnl dnl Simply set some default values (i.e off) if boolean options were not dnl specified: _LT_UNLESS_OPTIONS([LT_INIT], [dlopen], [enable_dlopen=no ]) _LT_UNLESS_OPTIONS([LT_INIT], [win32-dll], [enable_win32_dll=no ]) dnl dnl If no reference was made to various pairs of opposing options, then dnl we run the default mode handler for the pair. For example, if neither dnl `shared' nor `disable-shared' was passed, we enable building of shared dnl archives by default: _LT_UNLESS_OPTIONS([LT_INIT], [shared disable-shared], [_LT_ENABLE_SHARED]) _LT_UNLESS_OPTIONS([LT_INIT], [static disable-static], [_LT_ENABLE_STATIC]) _LT_UNLESS_OPTIONS([LT_INIT], [pic-only no-pic], [_LT_WITH_PIC]) _LT_UNLESS_OPTIONS([LT_INIT], [fast-install disable-fast-install], [_LT_ENABLE_FAST_INSTALL]) ]) ])# _LT_SET_OPTIONS ## --------------------------------- ## ## Macros to handle LT_INIT options. ## ## --------------------------------- ## # _LT_MANGLE_DEFUN(MACRO-NAME, OPTION-NAME) # ----------------------------------------- m4_define([_LT_MANGLE_DEFUN], [[_LT_OPTION_DEFUN_]m4_bpatsubst(m4_toupper([$1__$2]), [[^A-Z0-9_]], [_])]) # LT_OPTION_DEFINE(MACRO-NAME, OPTION-NAME, CODE) # ----------------------------------------------- m4_define([LT_OPTION_DEFINE], [m4_define(_LT_MANGLE_DEFUN([$1], [$2]), [$3])[]dnl ])# LT_OPTION_DEFINE # dlopen # ------ LT_OPTION_DEFINE([LT_INIT], [dlopen], [enable_dlopen=yes ]) AU_DEFUN([AC_LIBTOOL_DLOPEN], [_LT_SET_OPTION([LT_INIT], [dlopen]) AC_DIAGNOSE([obsolete], [$0: Remove this warning and the call to _LT_SET_OPTION when you put the `dlopen' option into LT_INIT's first parameter.]) ]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_LIBTOOL_DLOPEN], []) # win32-dll # --------- # Declare package support for building win32 dll's. LT_OPTION_DEFINE([LT_INIT], [win32-dll], [enable_win32_dll=yes case $host in *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-cegcc*) AC_CHECK_TOOL(AS, as, false) AC_CHECK_TOOL(DLLTOOL, dlltool, false) AC_CHECK_TOOL(OBJDUMP, objdump, false) ;; esac test -z "$AS" && AS=as _LT_DECL([], [AS], [1], [Assembler program])dnl test -z "$DLLTOOL" && DLLTOOL=dlltool _LT_DECL([], [DLLTOOL], [1], [DLL creation program])dnl test -z "$OBJDUMP" && OBJDUMP=objdump _LT_DECL([], [OBJDUMP], [1], [Object dumper program])dnl ])# win32-dll AU_DEFUN([AC_LIBTOOL_WIN32_DLL], [AC_REQUIRE([AC_CANONICAL_HOST])dnl _LT_SET_OPTION([LT_INIT], [win32-dll]) AC_DIAGNOSE([obsolete], [$0: Remove this warning and the call to _LT_SET_OPTION when you put the `win32-dll' option into LT_INIT's first parameter.]) ]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_LIBTOOL_WIN32_DLL], []) # _LT_ENABLE_SHARED([DEFAULT]) # ---------------------------- # implement the --enable-shared flag, and supports the `shared' and # `disable-shared' LT_INIT options. # DEFAULT is either `yes' or `no'. If omitted, it defaults to `yes'. m4_define([_LT_ENABLE_SHARED], [m4_define([_LT_ENABLE_SHARED_DEFAULT], [m4_if($1, no, no, yes)])dnl AC_ARG_ENABLE([shared], [AS_HELP_STRING([--enable-shared@<:@=PKGS@:>@], [build shared libraries @<:@default=]_LT_ENABLE_SHARED_DEFAULT[@:>@])], [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], [enable_shared=]_LT_ENABLE_SHARED_DEFAULT) _LT_DECL([build_libtool_libs], [enable_shared], [0], [Whether or not to build shared libraries]) ])# _LT_ENABLE_SHARED LT_OPTION_DEFINE([LT_INIT], [shared], [_LT_ENABLE_SHARED([yes])]) LT_OPTION_DEFINE([LT_INIT], [disable-shared], [_LT_ENABLE_SHARED([no])]) # Old names: AC_DEFUN([AC_ENABLE_SHARED], [_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[shared]) ]) AC_DEFUN([AC_DISABLE_SHARED], [_LT_SET_OPTION([LT_INIT], [disable-shared]) ]) AU_DEFUN([AM_ENABLE_SHARED], [AC_ENABLE_SHARED($@)]) AU_DEFUN([AM_DISABLE_SHARED], [AC_DISABLE_SHARED($@)]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AM_ENABLE_SHARED], []) dnl AC_DEFUN([AM_DISABLE_SHARED], []) # _LT_ENABLE_STATIC([DEFAULT]) # ---------------------------- # implement the --enable-static flag, and support the `static' and # `disable-static' LT_INIT options. # DEFAULT is either `yes' or `no'. If omitted, it defaults to `yes'. m4_define([_LT_ENABLE_STATIC], [m4_define([_LT_ENABLE_STATIC_DEFAULT], [m4_if($1, no, no, yes)])dnl AC_ARG_ENABLE([static], [AS_HELP_STRING([--enable-static@<:@=PKGS@:>@], [build static libraries @<:@default=]_LT_ENABLE_STATIC_DEFAULT[@:>@])], [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], [enable_static=]_LT_ENABLE_STATIC_DEFAULT) _LT_DECL([build_old_libs], [enable_static], [0], [Whether or not to build static libraries]) ])# _LT_ENABLE_STATIC LT_OPTION_DEFINE([LT_INIT], [static], [_LT_ENABLE_STATIC([yes])]) LT_OPTION_DEFINE([LT_INIT], [disable-static], [_LT_ENABLE_STATIC([no])]) # Old names: AC_DEFUN([AC_ENABLE_STATIC], [_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[static]) ]) AC_DEFUN([AC_DISABLE_STATIC], [_LT_SET_OPTION([LT_INIT], [disable-static]) ]) AU_DEFUN([AM_ENABLE_STATIC], [AC_ENABLE_STATIC($@)]) AU_DEFUN([AM_DISABLE_STATIC], [AC_DISABLE_STATIC($@)]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AM_ENABLE_STATIC], []) dnl AC_DEFUN([AM_DISABLE_STATIC], []) # _LT_ENABLE_FAST_INSTALL([DEFAULT]) # ---------------------------------- # implement the --enable-fast-install flag, and support the `fast-install' # and `disable-fast-install' LT_INIT options. # DEFAULT is either `yes' or `no'. If omitted, it defaults to `yes'. m4_define([_LT_ENABLE_FAST_INSTALL], [m4_define([_LT_ENABLE_FAST_INSTALL_DEFAULT], [m4_if($1, no, no, yes)])dnl AC_ARG_ENABLE([fast-install], [AS_HELP_STRING([--enable-fast-install@<:@=PKGS@:>@], [optimize for fast installation @<:@default=]_LT_ENABLE_FAST_INSTALL_DEFAULT[@:>@])], [p=${PACKAGE-default} case $enableval in yes) enable_fast_install=yes ;; no) enable_fast_install=no ;; *) enable_fast_install=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_fast_install=yes fi done IFS="$lt_save_ifs" ;; esac], [enable_fast_install=]_LT_ENABLE_FAST_INSTALL_DEFAULT) _LT_DECL([fast_install], [enable_fast_install], [0], [Whether or not to optimize for fast installation])dnl ])# _LT_ENABLE_FAST_INSTALL LT_OPTION_DEFINE([LT_INIT], [fast-install], [_LT_ENABLE_FAST_INSTALL([yes])]) LT_OPTION_DEFINE([LT_INIT], [disable-fast-install], [_LT_ENABLE_FAST_INSTALL([no])]) # Old names: AU_DEFUN([AC_ENABLE_FAST_INSTALL], [_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[fast-install]) AC_DIAGNOSE([obsolete], [$0: Remove this warning and the call to _LT_SET_OPTION when you put the `fast-install' option into LT_INIT's first parameter.]) ]) AU_DEFUN([AC_DISABLE_FAST_INSTALL], [_LT_SET_OPTION([LT_INIT], [disable-fast-install]) AC_DIAGNOSE([obsolete], [$0: Remove this warning and the call to _LT_SET_OPTION when you put the `disable-fast-install' option into LT_INIT's first parameter.]) ]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_ENABLE_FAST_INSTALL], []) dnl AC_DEFUN([AM_DISABLE_FAST_INSTALL], []) # _LT_WITH_PIC([MODE]) # -------------------- # implement the --with-pic flag, and support the `pic-only' and `no-pic' # LT_INIT options. # 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@<:@=PKGS@:>@], [try to use only PIC/non-PIC objects @<:@default=use both@:>@])], [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]) _LT_DECL([], [pic_mode], [0], [What type of objects to build])dnl ])# _LT_WITH_PIC LT_OPTION_DEFINE([LT_INIT], [pic-only], [_LT_WITH_PIC([yes])]) LT_OPTION_DEFINE([LT_INIT], [no-pic], [_LT_WITH_PIC([no])]) # Old name: AU_DEFUN([AC_LIBTOOL_PICMODE], [_LT_SET_OPTION([LT_INIT], [pic-only]) AC_DIAGNOSE([obsolete], [$0: Remove this warning and the call to _LT_SET_OPTION when you put the `pic-only' option into LT_INIT's first parameter.]) ]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_LIBTOOL_PICMODE], []) ## ----------------- ## ## LTDL_INIT Options ## ## ----------------- ## m4_define([_LTDL_MODE], []) LT_OPTION_DEFINE([LTDL_INIT], [nonrecursive], [m4_define([_LTDL_MODE], [nonrecursive])]) LT_OPTION_DEFINE([LTDL_INIT], [recursive], [m4_define([_LTDL_MODE], [recursive])]) LT_OPTION_DEFINE([LTDL_INIT], [subproject], [m4_define([_LTDL_MODE], [subproject])]) m4_define([_LTDL_TYPE], []) LT_OPTION_DEFINE([LTDL_INIT], [installable], [m4_define([_LTDL_TYPE], [installable])]) LT_OPTION_DEFINE([LTDL_INIT], [convenience], [m4_define([_LTDL_TYPE], [convenience])]) tango-8.1.2c+dfsg.orig/m4/java_release.m40000644000175000017500000000216212205375075017005 0ustar piccapiccadnl Determine whether we have java of a particular version or later, dnl based on major, minor, patchlevel versions and date. dnl dnl java_AC_HAVE_JAVA_VERSION(JAVA_PATH, dnl MAJOR_VERSION, dnl MINOR_VERSION) dnl AC_DEFUN([java_AC_HAVE_JAVA_VERSION], [AC_CACHE_CHECK([for java release (at least version $2.$3)], ac_cv_java_version_$2_$3, [ if test -x $1 -a -f $1; then VERS=`$1 -version 2>&1 | grep version | cut -d '"' -f 2` JAVA_VERSION=$VERS JAVA_MAJOR=`echo $VERS | cut -d '.' -f 1` JAVA_MINOR=`echo $VERS | cut -d '.' -f 2` JAVA_MICRO=`echo $VERS | cut -d '.' -f 3` dnl echo "JAVA MAJOR = $JAVA_MAJOR" dnl echo "JAVA MINOR = $JAVA_MINOR" dnl echo "JAVA MICRO = $JAVA_MICRO" if test $JAVA_MAJOR -lt $2; then ac_cv_java_version_$2_$3=no else if test $JAVA_MINOR -lt $3; then ac_cv_java_version_$2_$3=no else ac_cv_java_version_$2_$3=yes fi fi else ac_cv_java_version_$2_$3=no fi ]) ]) tango-8.1.2c+dfsg.orig/m4/ac_cxx_namespaces.m40000644000175000017500000000113412205375075020026 0ustar piccapiccadnl Available from the GNU Autoconf Macro Archive at: dnl http://www.gnu.org/software/ac-archive/htmldoc/ac_cxx_namespaces.html dnl AC_DEFUN([AC_CXX_NAMESPACES], [AC_CACHE_CHECK(whether the compiler implements namespaces, ac_cv_cxx_namespaces, [AC_LANG_SAVE AC_LANG_CPLUSPLUS AC_TRY_COMPILE([namespace Outer { namespace Inner { int i = 0; }}], [using namespace Outer::Inner; return i;], ac_cv_cxx_namespaces=yes, ac_cv_cxx_namespaces=no) AC_LANG_RESTORE ]) if test "$ac_cv_cxx_namespaces" = yes; then AC_DEFINE(HAVE_NAMESPACES,,[define if the compiler implements namespaces]) fi ]) tango-8.1.2c+dfsg.orig/m4/RSSH_CHECK_SUNPRO_CC.m40000644000175000017500000000162412205375075017515 0ustar piccapicca# RSSH_CHECK_SUNPROC_CC([ACTION-IF-YES], [ACTION-IF-NOT]) # ------------------------------------------------------ # check : are we using SUN workshop C++ compiler. # Corresponding cache value: rssh_cv_check_sunpro_cc is set to yes or no # #@author Ruslan Shevchenko , 1998, 2000 #@version $Id: RSSH_CHECK_SUNPRO_CC.m4,v 1.3 2000/07/12 08:06:52 rssh Exp $ # # RSSH_CHECK_SUNPRO_CC([ACTION-IF-YES],[ACTION-IF-NOT]) # AC_DEFUN([RSSH_CHECK_SUNPRO_CC], [AC_CACHE_CHECK([whether using Sun Worckshop C++ compiler], [rssh_cv_check_sunpro_cc], [AC_LANG_SAVE AC_LANG_CPLUSPLUS AC_TRY_COMPILE([], [#ifndef __SUNPRO_CC # include "error: this is not Sun Workshop." #endif ], rssh_cv_check_sunpro_cc=yes, rssh_cv_check_sunpro_cc=no) AC_LANG_RESTORE]) if test ${rssh_cv_check_sunpro_cc} = yes then $2 : else $3 : fi ])# RSSH_CHECK_SUNPROC_CC tango-8.1.2c+dfsg.orig/m4/ac_path_mysqlclient.m40000644000175000017500000001124412205375075020410 0ustar piccapicca# Markus Fischer <>, 23.9.1999 # URL : http://josefine.ben.tuwien.ac.at/~mfischer/m4/mysql-client.m4 # Last Modified : Thu Sep 23 14:24:15 CEST 1999 # # written from scratch dnl Test for libmysqlclient and dnl define MYSQLCLIENT_CFLAGS, MYSQLCLIENT_LDFLAGS and MYSQLCLIENT_LIBS dnl usage: dnl AM_PATH_MYSQLCLIENT( dnl [MINIMUM-VERSION, dnl [ACTION-IF-FOUND [, dnl ACTION-IF-NOT-FOUND ]]]) dnl AC_DEFUN([AM_PATH_MYSQLCLIENT], [ AC_ARG_WITH(mysqlclient-prefix, AC_HELP_STRING([--with-mysqlclient-prefix=PFX],[Prefix where mysqlclient is installed]), mysqlclient_prefix="$withval", mysqlclient_prefix="") AC_ARG_WITH(mysqlclient-include, AC_HELP_STRING([--with-mysqlclient-include=DIR],[Directory pointing to mysqlclient include files]), mysqlclient_include="$withval", mysqlclient_include="") AC_ARG_WITH(mysqlclient-lib,AC_HELP_STRING([--with-mysqlclient-lib=LIB],[Directory pointing to mysqlclient library (Note: -include and -lib do override paths found with -prefix)]), mysqlclient_lib="$withval", mysqlclient_lib="") AC_MSG_CHECKING([for mysqlclient ifelse([$1], , ,[>= v$1])]) MYSQLCLIENT_LDFLAGS="" MYSQLCLIENT_CFLAGS="" MYSQLCLIENT_LIBS="-lmysqlclient_r" mysqlclient_fail="" dnl test --with-mysqlclient-prefix for tryprefix in /usr /usr/local /usr/mysql /usr/local/mysql /usr/pkg $mysqlclient_prefix ; do for hloc in lib/mysql lib ; do if test -f "$tryprefix/$hloc/libmysqlclient_r.so"; then MYSQLCLIENT_LDFLAGS="-L$tryprefix/$hloc" elif test -f "$tryprefix/$hloc/libmysqlclient_r.a"; then MYSQLCLIENT_LDFLAGS="-L$tryprefix/$hloc" fi done for iloc in include/mysql include; do if test -f "$tryprefix/$iloc/mysql.h"; then MYSQLCLIENT_CFLAGS="-I$tryprefix/$iloc" fi done # testloop done dnl test --with-mysqlclient-include if test "x$mysqlclient_include" != "x" ; then echo "checking for mysql includes... " if test -d "$mysqlclient_include/mysql" ; then MYSQLCLIENT_CFLAGS="-I$mysqlclient_include" echo " found $MYSQLCLIENT_CFLAGS" elif test -d "$mysqlclient_include/include/mysql" ; then MYSQLCLIENT_CFLAGS="-I$mysqlclient_include/include" echo " found $MYSQLCLIENT_CFLAGS" elif test -d "$mysqlclient_include" ; then MYSQLCLIENT_CFLAGS="-I$mysqlclient_include" echo "found $MYSQLCLIENT_CFLAGS" else echo "not found! no include dir found in $mysqlclient_include" fi fi dnl test --with-mysqlclient-lib if test "x$mysqlclient_lib" != "x" ; then echo "checking for mysql libx... " if test -d "$mysqlclient_lib/lib/mysql" ; then MYSQLCLIENT_LDFLAGS="-L$mysqlclient_lib/lib/mysql" echo "found $MYSQLCLIENT_LDFLAGS" elif test -d "$mysqlclient_lib/lin" ; then MYSQLCLIENT_LDFLAGS="-L$mysqlclient_lib/lib" echo "found $MYSQLCLIENT_LDFLAGS" else MYSQLCLIENT_LDFLAGS="-L$mysqlclient_lib" echo "defaultd to $MYSQLCLIENT_LDFLAGS" fi fi ac_save_CFLAGS="$CFLAGS" ac_save_LDFLAGS="$LDFLAGS" ac_save_LIBS="$LIBS" CFLAGS="-v $CFLAGS $MYSQLCLIENT_CFLAGS" LDFLAGS="$LDFLAGS $MYSQLCLIENT_LDFLAGS" LIBS="$LIBS $MYSQLCLIENT_LIBS" dnl if no minimum version is given, just try to compile dnl else try to compile AND run AC_TRY_LINK([ #include #include ],[ mysql_init( 0 ); ], [AC_MSG_RESULT(yes $MYSQLCLIENT_CFLAGS $MYSQLCLIENT_LDFLAGS) CFLAGS="$ac_save_CFLAGS" LDFLAGS="$ac_save_LDFLAGS" LIBS="$ac_save_LIBS" ifelse([$2], ,:,[$2]) ],[ echo "no" echo "can't compile a simple app with mysql_connnect in it. bad." mysqlclient_fail="yes" ]) if test "x$mysqlclient_fail" != "x" ; then dnl AC_MSG_RESULT(no) echo echo "***" echo "*** mysqlclient test source had problems, check your config.log ." echo "*** Also try one of the following switches :" echo "*** --with-mysqlclient-prefix=PFX" echo "*** --with-mysqlclient-include=DIR" echo "*** --with-mysqlclient-lib=DIR" echo "***" CFLAGS="$ac_save_CFLAGS" LDFLAGS="$ac_save_LDFLAGS" LIBS="$ac_save_LIBS" MYSQLCLIENT_LIBS="" MYSQLCLIENT_CFLAGS="" ifelse([$3], ,:,[$3]) fi CFLAGS="$ac_save_CFLAGS" LDFLAGS="$ac_save_LDFLAGS" LIBS="$ac_save_LIBS" AC_SUBST(MYSQLCLIENT_LDFLAGS) AC_SUBST(MYSQLCLIENT_CFLAGS) AC_SUBST(MYSQLCLIENT_LIBS) ]) tango-8.1.2c+dfsg.orig/m4/RSSH_ENABLE_PTHREADS.m40000644000175000017500000000112412205375075017440 0ustar piccapiccadnl@synopsis RSSH_ENABLE_PTHREADS dnl dnl modify CFLAGS, CXXFLAGS and LIBS for compiling pthread-based programs. dnl dnl@author (C) Ruslan Shevchenko , 1998, 2000 dnl@id $Id: RSSH_ENABLE_PTHREADS.m4,v 1.7 2001/03/28 12:20:12 rssh Exp $ dnl dnl AC_DEFUN([RSSH_ENABLE_PTHREADS],[ AC_REQUIRE([RSSH_CHECK_PTHREADS]) if test -z "$rssh_enable_pthreads_done" then CFLAGS="$CFLAGS $CFLAGS_PTHREADS" CXXFLAGS="$CXXFLAGS $CXXFLAGS_PTHREADS" LIBS="$LIBS $LIBS_PTHREADS" fi rssh_enable_pthreads_done=yes rssh_rollback="$rssh_rollback; rssh_enable_pthreads_done=" ])dnl dnl tango-8.1.2c+dfsg.orig/m4/RSSH_CHECK_OMNINOTIFY.m40000644000175000017500000000664412205375075017624 0ustar piccapiccadnl@synposis RSSH_CHECK_CORBA_NOTIFICATION_SERVICE dnl dnl set CORBA support for omniORB v3-pr2 or highter dnl ( http://www.uk.research.att.com/omniORB/omniORB.html) dnl dnl@author Emmanuel Taurel 2003 dnl@id $Id$ dnl AC_DEFUN([RSSH_CHECK_OMNINOTIFY],[ AC_REQUIRE([AC_PROG_CC])dnl AC_REQUIRE([AC_PROG_CXX])dnl AC_REQUIRE([AC_PROG_CPP])dnl AC_REQUIRE([AC_PROG_CXXCPP])dnl AC_REQUIRE([RSSH_CHECK_OMNIORB])dnl AC_ARG_WITH(omninotify, AC_HELP_STRING([--with-omniNotify],[prefix to omniNotify installation (default: $OMNI_ROOT)]) ,\ OMNINOTIFY_PREFIX=${with_omninotify} , OMNINOTIFY_PREFIX=/usr/local ) if test "x$OMNI_ROOT" = "x" then if test "x$OMNINOTIFY_PREFIX" = "x" then OMNI_ROOT="/usr/local" else OMNI_ROOT="$OMNINOTIFY_PREFIX" fi fi if test "x$OMNINOTIFY_PREFIX" = "xno" then dnl OMNINOTIFY NOT SET AC_MSG_RESULT(omniNotify is disabled) omninotify=no else AC_LANG_SAVE AC_LANG_CPLUSPLUS svCXXCPPFLAGS=$CXXCPPFLAGS svCXXFLAGS=$CXXFLAGS svCPPFLAGS=$CPPFLAGS svLIBS=$LIBS svLDFLAGS=$LDFLAGS svRSSH_ROLLBACK=$rssh_rollback rssh_rollback="true" ORB_INCLUDES="-I$OMNI_ROOT/include" CXXCPPFLAGS="$CXXCPPFLAGS -I$OMNI_ROOT/include " CPPFLAGS="$CPPFLAGS -I$OMNI_ROOT/include " RSSH_ENABLE_PTHREADS case $build_cpu in sparc*) AC_DEFINE(__sparc__,1,Needed by omniorb) IDLCXXFLAGS="$IDLCXXFLAGS -D__sparc__" ;; "i686"|"i586"|"i486"|"i386") AC_DEFINE(__x86__,1,Needed by omniorb") IDLCXXFLAGS="$IDLCXXFLAGS -D__x86__" ;; esac case $build_os in solaris*) AC_DEFINE(__sunos__,1,If we're running on solaris) IDLCXXFLAGS="$IDLCXXFLAGS -D__sunos__" __OSVERSION__=5 AC_DEFINE_UNQUOTED(__OSVERSION__, $__OSVERSION__,Needed by omniorb) IDLCXXFLAGS="$IDLCXXFLAGS -D__OSVERSION__=5" ;; freebsd*) AC_DEFINE(__freebsd__,1,If we're running on freebsd) IDLCXXFLAGS="$IDLCXXFLAGS -D__freebsd__" ;; esac AC_SUBST(IDLCXXFLAGS) CXXCPPFLAGS="$CXXCPPFLAGS $IDLCXXFLAGS" AC_CHECK_HEADER( omniNotify/omniNotify.h, omninotify=yes , omninotify=no, ) if test "x$omninotify" = "xyes" then OMNI_LIBDIR="$OMNI_ROOT/lib" if test ! -r "$ORB_LIBDIR/libCOSNotify4.so" then for i in $OMNI_ROOT/lib/*/lib*.so do OMNI_LIBDIR=`dirname $i` break; done fi LIBS="$LIBS -lomnithread" svLIBS=$LIBS LIBS="-L$OMNI_LIBDIR $LIBS" AC_CACHE_CHECK([for omnithreads], rssh_cv_check_omnithreads, rssh_enable_pthreads_done="" RSSH_ENABLE_PTHREADS AC_LANG_SAVE AC_LANG_CPLUSPLUS AC_TRY_LINK( #include ,omni_mutex my_mutex, rssh_cv_check_omnithreads=yes,rssh_cv_check_omnithreads=no) AC_LANG_RESTORE ) if test ! $rssh_cv_check_omnithreads = yes then AC_MSG_RESULT("omnithreads not found") omninotify_lib=no fi AC_CHECK_LIB(socket,socket, LIBS="-lsocket $LIBS",,) AC_CHECK_LIB(nsl,gethostbyname, LIBS="-lnsl $LIBS",,) OMNI_LDFLAGS="-L$OMNI_LIBDIR" LIBS="$OMNI_LDFLAGS -lomniORB4 -lomniDynamic4 $svLIBS $LIBS" AC_CACHE_CHECK([whether we can link with omniNotify], rssh_cv_check_omniNotifylib, AC_TRY_LINK( #include ,CosNotifyChannelAdmin::EventChannelFactory_var eventChannelFactory, rssh_cv_check_omniNotifylib=yes,rssh_cv_check_omniNotifylib=no ) ) if test ! $rssh_cv_check_omniNotifylib = yes then AC_MSG_RESULT("omniNotify libs not found") omninotify_lib=no fi OMNI_LIBS="$OMNI_LDFLAGS -lomniORB4 -lomnithread" fi fi AC_LANG_RESTORE ])dnl dnl tango-8.1.2c+dfsg.orig/m4/RSSH_CHECK_PTHREADS.m40000644000175000017500000000212312205375075017327 0ustar piccapicca#@synonpsis RSSH_CHECK_PTHREADS # check for pthreads system interfaces. # set CFLAGS_PTHREADS, CXXFLAGS_PTHREADS and LIBS_PTHREADS to # flags to compiler option, which denote multithread program compilation # (if one exists), # and multithread library, if one required. # #@author (C) Ruslan Shevchenko , 1998 #@id $Id: RSSH_CHECK_PTHREADS.m4,v 1.6 2001/05/07 19:21:22 rssh Exp $ # AC_DEFUN([RSSH_CHECK_PTHREADS],[ dnl AC_REQUIRE([RSSH_CHECK_SUNPRO_C])dnl AC_REQUIRE([RSSH_CHECK_SUNPRO_CC])dnl AC_CHECK_HEADER(pthread.h,AC_DEFINE(HAVE_PTHREAD_H,1,If pthreads are present)) if test x$rssh_cv_check_sunpro_c = xyes then CFLAGS_PTHREADS="-mt" fi if test x$rssh_cv_check_sunpro_cc = xyes then CXXFLAGS_PTHREADS="-mt" fi case $build_os in freebsd*) CFLAGS_PTHREADS="-pthread" CXXFLAGS_PTHREADS="-pthread" freebsd_pthreads=yes ;; *) freebsd_pthreads=no ;; esac if test x$freebsd_pthreads = xno then AC_CHECK_LIB(pthread,pthread_create, LIBS_PTHREADS="-lpthread") fi AC_CHECK_LIB(posix4,nanosleep, LIBS_PTHREADS="$LIBS_PTHREADS -lposix4") ])dnl tango-8.1.2c+dfsg.orig/m4/ac_prog_mysql.m40000644000175000017500000000476112205375075017232 0ustar piccapiccadnl @synopsis AC_PROG_MYSQL dnl dnl Check for the program 'mysql' dnl let script continue if exists & works dnl pops up error message if not. dnl dnl Testing of functionality is by invoking it with root password '' dnl and a 'SELECT * FROM user' SQL statement. dnl The user and passwd can be controlled with the --with-mysql-admin and dnl the --with-mysql-admin-passwd dnl We can also control the host with the --with-mysql-host switch. dnl That SQL statement will select all user information from the 'user' dnl privileges table, dnl and should work on every proper MySQL server. dnl dnl Besides checking mysql, this macro also set these environmentb dnl variables upon completion: dnl dnl MYSQL = which mysql dnl dnl @version $Id: ac_prog_mysql.m4,v 1.2 2002/04/11 14:20:17 simons Exp $ dnl @author Gleen Salmon dnl AC_DEFUN([AC_PROG_MYSQL],[ AC_REQUIRE([AC_EXEEXT])dnl AC_PATH_PROG(MYSQL, mysql$EXEEXT, nocommand) if test "$MYSQL" = nocommand; then AC_MSG_WARN([mysql not found in $PATH]) enable_db_schema_create=no else AC_ARG_WITH(mysql-ho, AC_HELP_STRING([--with-mysql-ho],[the host of the mysql database (default: )]), MYSQL_HOST=${with_mysql_ho}, MYSQL_HOST="") AC_ARG_WITH(mysql-admin,AC_HELP_STRING([--with-mysql-admin],[super user of your mysql database (default: )]), MYSQL_ADMIN=${with_mysql_admin}, MYSQL_ADMIN="") AC_ARG_WITH(mysql-admin-passwd, AC_HELP_STRING([--with-mysql-admin-passwd],[super user password of your mysql database (default: )]), MYSQL_ADMIN_PASSWD=${with_mysql_admin_passwd}, MYSQL_ADMIN_PASSWD="") if test "x$MYSQL_ADMIN" = "x"; then user_switch=""; else user_switch="-u$MYSQL_ADMIN"; fi if test "x$MYSQL_ADMIN_PASSWD" = "x"; then passwd_switch=""; else passwd_switch="-p$MYSQL_ADMIN_PASSWD"; fi if test "x$MYSQL_HOST" = "x"; then host_switch=""; else host_switch="-h$MYSQL_HOST"; fi AC_MSG_CHECKING([if mysql works]) if echo 'SELECT * FROM user' | $MYSQL $user_switch $passwd_switch $host_switch mysql> /dev/null; then AC_MSG_RESULT([yes]) AC_SUBST(MYSQL_ADMIN) AC_SUBST(MYSQL_ADMIN_PASSWD) AC_SUBST(MYSQL) AC_SUBST(MYSQL_HOST) MYSQL_CONNECTION=OK else AC_MSG_WARN([mysql cannot execute SELECT with user=$MYSQL_ADMIN, passwd=$MYSQL_ADMIN_PASSWD, and host=$MYSQL_HOST. Please check your my.cnf file or configure options!]) MYSQL_CONNECTION=failed enable_db_schema_create=no fi;dnl AC_DEFINE_UNQUOTED(MYSQL_HOST,"$MYSQL_HOST", "the host running mysql") fi ]) tango-8.1.2c+dfsg.orig/m4/ac_cxx_have_sstream.m40000644000175000017500000000134312205375075020372 0ustar piccapiccadnl @synopsis AC_CXX_HAVE_SSTREAM dnl dnl If the C++ library has a working stringstream, define HAVE_SSTREAM. dnl dnl @author Ben Stanley dnl @version $Id: ac_cxx_have_sstream.m4,v 1.1 2001/03/16 13:47:06 simons Exp $ dnl AC_DEFUN([AC_CXX_HAVE_SSTREAM], [AC_CACHE_CHECK(whether the compiler has stringstream, ac_cv_cxx_have_sstream, [AC_REQUIRE([AC_CXX_NAMESPACES]) AC_LANG_SAVE AC_LANG_CPLUSPLUS AC_TRY_COMPILE([#include #ifdef HAVE_NAMESPACES using namespace std; #endif],[stringstream message; message << "Hello"; return 0;], ac_cv_cxx_have_sstream=yes, ac_cv_cxx_have_sstream=no) AC_LANG_RESTORE ]) if test "$ac_cv_cxx_have_sstream" = yes; then AC_DEFINE(HAVE_SSTREAM,,[define if the compiler has stringstream]) fi ]) tango-8.1.2c+dfsg.orig/m4/ltversion.m40000644000175000017500000000126212205375241016404 0ustar piccapicca# ltversion.m4 -- version numbers -*- Autoconf -*- # # Copyright (C) 2004 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. # @configure_input@ # serial 3337 ltversion.m4 # This file is part of GNU Libtool m4_define([LT_PACKAGE_VERSION], [2.4.2]) m4_define([LT_PACKAGE_REVISION], [1.3337]) AC_DEFUN([LTVERSION_VERSION], [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) ]) tango-8.1.2c+dfsg.orig/m4/lt~obsolete.m40000644000175000017500000001375612205375241016744 0ustar piccapicca# lt~obsolete.m4 -- aclocal satisfying obsolete definitions. -*-Autoconf-*- # # 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 5 lt~obsolete.m4 # These exist entirely to fool aclocal when bootstrapping libtool. # # In the past libtool.m4 has provided macros via AC_DEFUN (or AU_DEFUN) # which have later been changed to m4_define as they aren't part of the # exported API, or moved to Autoconf or Automake where they belong. # # The trouble is, aclocal is a bit thick. It'll see the old AC_DEFUN # in /usr/share/aclocal/libtool.m4 and remember it, then when it sees us # using a macro with the same name in our local m4/libtool.m4 it'll # pull the old libtool.m4 in (it doesn't see our shiny new m4_define # and doesn't know about Autoconf macros at all.) # # So we provide this file, which has a silly filename so it's always # included after everything else. This provides aclocal with the # AC_DEFUNs it wants, but when m4 processes it, it doesn't do anything # because those macros already exist, or will be overwritten later. # We use AC_DEFUN over AU_DEFUN for compatibility with aclocal-1.6. # # Anytime we withdraw an AC_DEFUN or AU_DEFUN, remember to add it here. # Yes, that means every name once taken will need to remain here until # we give up compatibility with versions before 1.7, at which point # we need to keep only those names which we still refer to. # This is to help aclocal find these macros, as it can't see m4_define. AC_DEFUN([LTOBSOLETE_VERSION], [m4_if([1])]) m4_ifndef([AC_LIBTOOL_LINKER_OPTION], [AC_DEFUN([AC_LIBTOOL_LINKER_OPTION])]) m4_ifndef([AC_PROG_EGREP], [AC_DEFUN([AC_PROG_EGREP])]) m4_ifndef([_LT_AC_PROG_ECHO_BACKSLASH], [AC_DEFUN([_LT_AC_PROG_ECHO_BACKSLASH])]) m4_ifndef([_LT_AC_SHELL_INIT], [AC_DEFUN([_LT_AC_SHELL_INIT])]) m4_ifndef([_LT_AC_SYS_LIBPATH_AIX], [AC_DEFUN([_LT_AC_SYS_LIBPATH_AIX])]) m4_ifndef([_LT_PROG_LTMAIN], [AC_DEFUN([_LT_PROG_LTMAIN])]) m4_ifndef([_LT_AC_TAGVAR], [AC_DEFUN([_LT_AC_TAGVAR])]) m4_ifndef([AC_LTDL_ENABLE_INSTALL], [AC_DEFUN([AC_LTDL_ENABLE_INSTALL])]) m4_ifndef([AC_LTDL_PREOPEN], [AC_DEFUN([AC_LTDL_PREOPEN])]) m4_ifndef([_LT_AC_SYS_COMPILER], [AC_DEFUN([_LT_AC_SYS_COMPILER])]) m4_ifndef([_LT_AC_LOCK], [AC_DEFUN([_LT_AC_LOCK])]) m4_ifndef([AC_LIBTOOL_SYS_OLD_ARCHIVE], [AC_DEFUN([AC_LIBTOOL_SYS_OLD_ARCHIVE])]) m4_ifndef([_LT_AC_TRY_DLOPEN_SELF], [AC_DEFUN([_LT_AC_TRY_DLOPEN_SELF])]) m4_ifndef([AC_LIBTOOL_PROG_CC_C_O], [AC_DEFUN([AC_LIBTOOL_PROG_CC_C_O])]) m4_ifndef([AC_LIBTOOL_SYS_HARD_LINK_LOCKS], [AC_DEFUN([AC_LIBTOOL_SYS_HARD_LINK_LOCKS])]) m4_ifndef([AC_LIBTOOL_OBJDIR], [AC_DEFUN([AC_LIBTOOL_OBJDIR])]) m4_ifndef([AC_LTDL_OBJDIR], [AC_DEFUN([AC_LTDL_OBJDIR])]) m4_ifndef([AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH], [AC_DEFUN([AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH])]) m4_ifndef([AC_LIBTOOL_SYS_LIB_STRIP], [AC_DEFUN([AC_LIBTOOL_SYS_LIB_STRIP])]) m4_ifndef([AC_PATH_MAGIC], [AC_DEFUN([AC_PATH_MAGIC])]) m4_ifndef([AC_PROG_LD_GNU], [AC_DEFUN([AC_PROG_LD_GNU])]) m4_ifndef([AC_PROG_LD_RELOAD_FLAG], [AC_DEFUN([AC_PROG_LD_RELOAD_FLAG])]) m4_ifndef([AC_DEPLIBS_CHECK_METHOD], [AC_DEFUN([AC_DEPLIBS_CHECK_METHOD])]) m4_ifndef([AC_LIBTOOL_PROG_COMPILER_NO_RTTI], [AC_DEFUN([AC_LIBTOOL_PROG_COMPILER_NO_RTTI])]) m4_ifndef([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE], [AC_DEFUN([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE])]) m4_ifndef([AC_LIBTOOL_PROG_COMPILER_PIC], [AC_DEFUN([AC_LIBTOOL_PROG_COMPILER_PIC])]) m4_ifndef([AC_LIBTOOL_PROG_LD_SHLIBS], [AC_DEFUN([AC_LIBTOOL_PROG_LD_SHLIBS])]) m4_ifndef([AC_LIBTOOL_POSTDEP_PREDEP], [AC_DEFUN([AC_LIBTOOL_POSTDEP_PREDEP])]) m4_ifndef([LT_AC_PROG_EGREP], [AC_DEFUN([LT_AC_PROG_EGREP])]) m4_ifndef([LT_AC_PROG_SED], [AC_DEFUN([LT_AC_PROG_SED])]) m4_ifndef([_LT_CC_BASENAME], [AC_DEFUN([_LT_CC_BASENAME])]) m4_ifndef([_LT_COMPILER_BOILERPLATE], [AC_DEFUN([_LT_COMPILER_BOILERPLATE])]) m4_ifndef([_LT_LINKER_BOILERPLATE], [AC_DEFUN([_LT_LINKER_BOILERPLATE])]) m4_ifndef([_AC_PROG_LIBTOOL], [AC_DEFUN([_AC_PROG_LIBTOOL])]) m4_ifndef([AC_LIBTOOL_SETUP], [AC_DEFUN([AC_LIBTOOL_SETUP])]) m4_ifndef([_LT_AC_CHECK_DLFCN], [AC_DEFUN([_LT_AC_CHECK_DLFCN])]) m4_ifndef([AC_LIBTOOL_SYS_DYNAMIC_LINKER], [AC_DEFUN([AC_LIBTOOL_SYS_DYNAMIC_LINKER])]) m4_ifndef([_LT_AC_TAGCONFIG], [AC_DEFUN([_LT_AC_TAGCONFIG])]) m4_ifndef([AC_DISABLE_FAST_INSTALL], [AC_DEFUN([AC_DISABLE_FAST_INSTALL])]) 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_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])]) m4_ifndef([_LT_AC_LANG_CXX_CONFIG], [AC_DEFUN([_LT_AC_LANG_CXX_CONFIG])]) m4_ifndef([AC_LIBTOOL_LANG_F77_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_F77_CONFIG])]) m4_ifndef([_LT_AC_LANG_F77_CONFIG], [AC_DEFUN([_LT_AC_LANG_F77_CONFIG])]) m4_ifndef([AC_LIBTOOL_LANG_GCJ_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_GCJ_CONFIG])]) m4_ifndef([_LT_AC_LANG_GCJ_CONFIG], [AC_DEFUN([_LT_AC_LANG_GCJ_CONFIG])]) m4_ifndef([AC_LIBTOOL_LANG_RC_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_RC_CONFIG])]) 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])]) tango-8.1.2c+dfsg.orig/m4/ax_cxx_compile_stdcxx_11.m40000644000175000017500000001104512205375075021264 0ustar piccapicca# ============================================================================ # http://www.gnu.org/software/autoconf-archive/ax_cxx_compile_stdcxx_11.html # ============================================================================ # # SYNOPSIS # # AX_CXX_COMPILE_STDCXX_11([ext|noext],[mandatory|optional]) # # DESCRIPTION # # Check for baseline language coverage in the compiler for the C++11 # standard; if necessary, add switches to CXXFLAGS to enable support. # # The first argument, if specified, indicates whether you insist on an # extended mode (e.g. -std=gnu++11) or a strict conformance mode (e.g. # -std=c++11). If neither is specified, you get whatever works, with # preference for an extended mode. # # The second argument, if specified 'mandatory' or if left unspecified, # indicates that baseline C++11 support is required and that the macro # should error out if no mode with that support is found. If specified # 'optional', then configuration proceeds regardless, after defining # HAVE_CXX11 if and only if a supporting mode is found. # # LICENSE # # Copyright (c) 2008 Benjamin Kosnik # Copyright (c) 2012 Zack Weinberg # Copyright (c) 2013 Roy Stogner # # Copying and distribution of this file, with or without modification, are # permitted in any medium without royalty provided the copyright notice # and this notice are preserved. This file is offered as-is, without any # warranty. #serial 3 m4_define([_AX_CXX_COMPILE_STDCXX_11_testbody], [ template struct check { static_assert(sizeof(int) <= sizeof(T), "not big enough"); }; typedef check> right_angle_brackets; int a; decltype(a) b; typedef check check_type; check_type c; check_type&& cr = static_cast(c); auto d = a; ]) AC_DEFUN([AX_CXX_COMPILE_STDCXX_11], [dnl m4_if([$1], [], [], [$1], [ext], [], [$1], [noext], [], [m4_fatal([invalid argument `$1' to AX_CXX_COMPILE_STDCXX_11])])dnl m4_if([$2], [], [ax_cxx_compile_cxx11_required=true], [$2], [mandatory], [ax_cxx_compile_cxx11_required=true], [$2], [optional], [ax_cxx_compile_cxx11_required=false], [m4_fatal([invalid second argument `$2' to AX_CXX_COMPILE_STDCXX_11])])dnl AC_LANG_PUSH([C++])dnl ac_success=no AC_CACHE_CHECK(whether $CXX supports C++11 features by default, ax_cv_cxx_compile_cxx11, [AC_COMPILE_IFELSE([AC_LANG_SOURCE([_AX_CXX_COMPILE_STDCXX_11_testbody])], [ax_cv_cxx_compile_cxx11=yes], [ax_cv_cxx_compile_cxx11=no])]) if test x$ax_cv_cxx_compile_cxx11 = xyes; then ac_success=yes fi m4_if([$1], [noext], [], [dnl if test x$ac_success = xno; then for switch in -std=gnu++11 -std=gnu++0x; do cachevar=AS_TR_SH([ax_cv_cxx_compile_cxx11_$switch]) AC_CACHE_CHECK(whether $CXX supports C++11 features with $switch, $cachevar, [ac_save_CXXFLAGS="$CXXFLAGS" CXXFLAGS="$CXXFLAGS $switch" AC_COMPILE_IFELSE([AC_LANG_SOURCE([_AX_CXX_COMPILE_STDCXX_11_testbody])], [eval $cachevar=yes], [eval $cachevar=no]) CXXFLAGS="$ac_save_CXXFLAGS"]) if eval test x\$$cachevar = xyes; then CXXFLAGS="$CXXFLAGS $switch" ac_success=yes break fi done fi]) m4_if([$1], [ext], [], [dnl if test x$ac_success = xno; then for switch in -std=c++11 -std=c++0x; do cachevar=AS_TR_SH([ax_cv_cxx_compile_cxx11_$switch]) AC_CACHE_CHECK(whether $CXX supports C++11 features with $switch, $cachevar, [ac_save_CXXFLAGS="$CXXFLAGS" CXXFLAGS="$CXXFLAGS $switch" AC_COMPILE_IFELSE([AC_LANG_SOURCE([_AX_CXX_COMPILE_STDCXX_11_testbody])], [eval $cachevar=yes], [eval $cachevar=no]) CXXFLAGS="$ac_save_CXXFLAGS"]) if eval test x\$$cachevar = xyes; then CXXFLAGS="$CXXFLAGS $switch" ac_success=yes break fi done fi]) AC_LANG_POP([C++]) if test x$ax_cxx_compile_cxx11_required = xtrue; then if test x$ac_success = xno; then AC_MSG_ERROR([*** A compiler with support for C++11 language features is required.]) fi else if test x$ac_success = xno; then HAVE_CXX11=0 AC_MSG_NOTICE([No compiler with C++11 support was found]) else HAVE_CXX11=1 CPP_ELEVEN=$switch AC_DEFINE(HAVE_CXX11,1, [define if the compiler supports basic C++11 syntax]) fi AC_SUBST(HAVE_CXX11) AC_SUBST(CPP_ELEVEN) fi ]) tango-8.1.2c+dfsg.orig/m4/mysql_release.m40000644000175000017500000000224612205375075017234 0ustar piccapiccadnl Determine whether we have mysql of a particular version or later, dnl based on major, minor, patchlevel versions and date. dnl dnl mysql_AC_HAVE_MYSQL_VERSION(MYSQL_PATH, dnl MAJOR_VERSION, dnl MINOR_VERSION) dnl AC_DEFUN([mysql_AC_HAVE_MYSQL_VERSION], [AC_CACHE_CHECK([for mysql release (at least version $2.$3)], ac_cv_mysql_version_$2_$3, [ if test -x $1; then VERS=`$1 --version 2>&1 | cut -d ' ' -f 6 | cut -d ',' -f 1` MYSQL_VERSION=$VERS MYSQL_MAJOR=`echo $VERS | cut -d '.' -f 1` MYSQL_MINOR=`echo $VERS | cut -d '.' -f 2` MYSQL_MICRO=`echo $VERS | cut -d '.' -f 3` dnl echo "MYSQL MAJOR = $MYSQL_MAJOR" dnl echo "MYSQL MINOR = $MYSQL_MINOR" dnl echo "MYSQL MICRO = $MYSQL_MICRO" if test $MYSQL_MAJOR -lt $2; then ac_cv_mysql_version_$2_$3=no else if test $MYSQL_MINOR -lt $3; then ac_cv_mysql_version_$2_$3=no else ac_cv_mysql_version_$2_$3=yes fi fi else ac_cv_mysql_version_$2_$3=no fi ]) ]) tango-8.1.2c+dfsg.orig/m4/ax_jni_include_dir.m40000644000175000017500000000763712205375075020211 0ustar piccapicca# =========================================================================== # http://www.gnu.org/software/autoconf-archive/ax_jni_include_dir.html # =========================================================================== # # SYNOPSIS # # AX_JNI_INCLUDE_DIR # # DESCRIPTION # # AX_JNI_INCLUDE_DIR finds include directories needed for compiling # programs using the JNI interface. # # JNI include directories are usually in the java distribution This is # deduced from the value of JAVAC. When this macro completes, a list of # directories is left in the variable JNI_INCLUDE_DIRS. # # Example usage follows: # # AX_JNI_INCLUDE_DIR # # for JNI_INCLUDE_DIR in $JNI_INCLUDE_DIRS # do # CPPFLAGS="$CPPFLAGS -I$JNI_INCLUDE_DIR" # done # # If you want to force a specific compiler: # # - at the configure.in level, set JAVAC=yourcompiler before calling # AX_JNI_INCLUDE_DIR # # - at the configure level, setenv JAVAC # # Note: This macro can work with the autoconf M4 macros for Java programs. # This particular macro is not part of the original set of macros. # # LICENSE # # Copyright (c) 2008 Don Anderson # # Copying and distribution of this file, with or without modification, are # permitted in any medium without royalty provided the copyright notice # and this notice are preserved. This file is offered as-is, without any # warranty. #serial 7 AU_ALIAS([AC_JNI_INCLUDE_DIR], [AX_JNI_INCLUDE_DIR]) AC_DEFUN([AX_JNI_INCLUDE_DIR],[ JNI_INCLUDE_DIRS="" test "x$JAVAC" = x && AC_MSG_ERROR(['\$JAVAC' undefined]) AC_PATH_PROG([_ACJNI_JAVAC], [$JAVAC], [no], [$PATH$PATH_SEPARATOR/]) test "x$_ACJNI_JAVAC" = xno && AC_MSG_ERROR([$JAVAC could not be found in path]) _ACJNI_FOLLOW_SYMLINKS("$_ACJNI_JAVAC") _JTOPDIR=`echo "$_ACJNI_FOLLOWED" | sed -e 's://*:/:g' -e 's:/[[^/]]*$::'` case "$host_os" in darwin*) _JTOPDIR=`echo "$_JTOPDIR" | sed -e 's:/[[^/]]*$::'` _JINC="$_JTOPDIR/Headers";; *) _JINC="$_JTOPDIR/include";; esac #_AS_ECHO_LOG([_JTOPDIR=$_JTOPDIR]) #_AS_ECHO_LOG([_JINC=$_JINC]) # On Mac OS X 10.6.4, jni.h is a symlink: # /System/Library/Frameworks/JavaVM.framework/Versions/Current/Headers/jni.h # -> ../../CurrentJDK/Headers/jni.h. if test -f "$_JINC/jni.h" || test -L "$_JINC/jni.h"; then JNI_INCLUDE_DIRS="$JNI_INCLUDE_DIRS $_JINC" else _JTOPDIR=`echo "$_JTOPDIR" | sed -e 's:/[[^/]]*$::'` if test -f "$_JTOPDIR/include/jni.h"; then JNI_INCLUDE_DIRS="$JNI_INCLUDE_DIRS $_JTOPDIR/include" else AC_MSG_ERROR([cannot find java include files]) fi fi # get the likely subdirectories for system specific java includes case "$host_os" in bsdi*) _JNI_INC_SUBDIRS="bsdos";; linux*) _JNI_INC_SUBDIRS="linux genunix";; osf*) _JNI_INC_SUBDIRS="alpha";; solaris*) _JNI_INC_SUBDIRS="solaris";; mingw*) _JNI_INC_SUBDIRS="win32";; cygwin*) _JNI_INC_SUBDIRS="win32";; *) _JNI_INC_SUBDIRS="genunix";; esac # add any subdirectories that are present for JINCSUBDIR in $_JNI_INC_SUBDIRS do if test -d "$_JTOPDIR/include/$JINCSUBDIR"; then JNI_INCLUDE_DIRS="$JNI_INCLUDE_DIRS $_JTOPDIR/include/$JINCSUBDIR" fi done ]) # _ACJNI_FOLLOW_SYMLINKS # Follows symbolic links on , # finally setting variable _ACJNI_FOLLOWED # ---------------------------------------- AC_DEFUN([_ACJNI_FOLLOW_SYMLINKS],[ # find the include directory relative to the javac executable _cur="$1" while ls -ld "$_cur" 2>/dev/null | grep " -> " >/dev/null; do AC_MSG_CHECKING([symlink for $_cur]) _slink=`ls -ld "$_cur" | sed 's/.* -> //'` case "$_slink" in /*) _cur="$_slink";; # 'X' avoids triggering unwanted echo options. *) _cur=`echo "X$_cur" | sed -e 's/^X//' -e 's:[[^/]]*$::'`"$_slink";; esac AC_MSG_RESULT([$_cur]) done _ACJNI_FOLLOWED="$_cur" ])# _ACJNI tango-8.1.2c+dfsg.orig/m4/RSSH_CHECK_OMNIORB.m40000644000175000017500000002032612205375075017227 0ustar piccapiccadnl@synposis RSSH_CHECK_CORBA_ORB dnl dnl set CORBA support for omniORB v3-pr2 or highter dnl ( http://www.uk.research.att.com/omniORB/omniORB.html) dnl dnl@author (C) Ruslan Shevchenko , 1999, 2000 dnl@id $Id: RSSH_CHECK_OMNIORB.m4,v 1.20 2002/01/16 16:33:28 yad Exp $ dnl AC_DEFUN([RSSH_CHECK_OMNIORB],[ AC_REQUIRE([AC_PROG_CC]) AC_REQUIRE([AC_PROG_CXX]) AC_REQUIRE([AC_PROG_CPP]) AC_REQUIRE([AC_PROG_CXXCPP]) AC_ARG_WITH(omni, AC_HELP_STRING([--with-omni],[prefix to omniORB installation (default: $OMNI_ROOT)]) ,\ OMNI_PREFIX=${with_omni} , OMNI_PREFIX=/usr/local ) if test "x$OMNI_ROOT" = "x" then if test "x$OMNI_PREFIX" = "x" then OMNI_ROOT="/usr/local" else OMNI_ROOT="$OMNI_PREFIX" fi fi if test "x$OMNI_PREFIX" = "xno" then dnl OMNI NOT SET AC_MSG_RESULT(omniORB is disabled) omni=no else AC_LANG_SAVE AC_LANG_CPLUSPLUS svCXXCPPFLAGS=$CXXCPPFLAGS svCXXFLAGS=$CXXFLAGS svCPPFLAGS=$CPPFLAGS svLIBS=$LIBS svLDFLAGS=$LDFLAGS svRSSH_ROLLBACK=$rssh_rollback rssh_rollback="true" ORB_INCLUDES="-I$OMNI_ROOT/include" CXXCPPFLAGS="$CXXCPPFLAGS -I$OMNI_ROOT/include " CPPFLAGS="$CPPFLAGS -I$OMNI_ROOT/include " RSSH_ENABLE_PTHREADS case $build_cpu in sparc*) AC_DEFINE(__sparc__,1,Needed by omniorb) IDLCXXFLAGS="$IDLCXXFLAGS -D__sparc__" ;; "i686"|"i586"|"i486"|"i386") AC_DEFINE(__x86__,1,Needed by omniorb") IDLCXXFLAGS="$IDLCXXFLAGS -D__x86__" ;; esac SL_SUFFIX=so case $build_os in darwin*) AC_DEFINE(__darwin__,1,If we're running on darwin/MacOsX) IDLCXXFLAGS="$IDLCXXFLAGS -D__darwin__" SL_SUFFIX=dylib ;; solaris*) AC_DEFINE(__sunos__,1,If we're running on solaris) IDLCXXFLAGS="$IDLCXXFLAGS -D__sunos__" __OSVERSION__=5 AC_DEFINE_UNQUOTED(__OSVERSION__, $__OSVERSION__,Needed by omniorb) IDLCXXFLAGS="$IDLCXXFLAGS -D__OSVERSION__=5" ;; freebsd*) AC_DEFINE(__freebsd__,1,If we're running on freebsd) IDLCXXFLAGS="$IDLCXXFLAGS -D__freebsd__" ;; hpux*) AC_DEFINE(__hpux__,1,If we're running on hpux) IDLCXXFLAGS="$IDLCXXFLAGS -AA -mt -D__hpux__ -D__hppa__ -D__OMNIORB4__" __OSVERSION__=11 AC_DEFINE_UNQUOTED(__OSVERSION__, $__OSVERSION__,Needed by omniorb) IDLCXXFLAGS="$IDLCXXFLAGS -D__OSVERSION__=11" SL_SUFFIX=sl ;; esac AC_SUBST(IDLCXXFLAGS) CXXCPPFLAGS="$CXXCPPFLAGS $IDLCXXFLAGS" AC_CHECK_HEADER( omniORB4/CORBA.h, omni=yes , omni=no, ) if test "x$omni" = "xyes" then ORB_LIBDIR="$OMNI_ROOT/lib" if test ! -r "$ORB_LIBDIR/libomniORB4.$SL_SUFFIX" then for i in $OMNI_ROOT/lib/*/lib*.$SL_SUFFIX do ORB_LIBDIR=`dirname $i` break; done fi LIBS="$LIBS -lomnithread" svLIBS=$LIBS LIBS="-L$ORB_LIBDIR $LIBS" AC_CACHE_CHECK([for omnithreads], rssh_cv_check_omnithreads, rssh_enable_pthreads_done="" RSSH_ENABLE_PTHREADS AC_LANG_SAVE AC_LANG_CPLUSPLUS AC_TRY_LINK( #include ,omni_mutex my_mutex, rssh_cv_check_omnithreads=yes,rssh_cv_check_omnithreads=no) AC_LANG_RESTORE ) if test ! $rssh_cv_check_omnithreads = yes then AC_MSG_RESULT("omnithreads not found") omni_lib=no fi AC_CHECK_LIB(socket,socket, LIBS="-lsocket $LIBS",,) AC_CHECK_LIB(nsl,gethostbyname, LIBS="-lnsl $LIBS",,) ORB_LDFLAGS="-L$ORB_LIBDIR" LIBS="$ORB_LDFLAGS -lomniORB4 -lomniDynamic4 -lCOS4 $svLIBS $LIBS" AC_CACHE_CHECK([whether we can link with omniORB4], rssh_cv_check_omniORBlib, AC_TRY_LINK( #include ,CORBA::ORB_var orb, rssh_cv_check_omniORBlib=yes,rssh_cv_check_omniORBlib=no ) ) if test ! $rssh_cv_check_omniORBlib = yes then AC_MSG_RESULT("omniORB libs not found") omni_lib=no fi ORB_LIBS="$ORB_LDFLAGS -lomniORB4 -lomnithread" fi if test "x$omni_lib" = "xno" then AC_MSG_RESULT(omniORB library linking failed) omni="no" fi fi dnl omniorb_AC_HAVE_OMNIORB_VERSION($OMNI_ROOT/include/omniORB4,4,1,0) dnl if test "x$ac_cv_omniorb_version_4_1_0" = "xno"; then dnl AC_MSG_ERROR([Not supported omniORB release. Should be 4.1.0 or above. Please update !],-1) dnl fi dnl dnl The following tests are only to reject omniORB release 4.1.1 dnl which has some annoying bugs fixed in omniORB 4.1.2 dnl export PKG_CONFIG_PATH=$PKG_CONFIG_PATH:$OMNI_ROOT/lib/pkgconfig PKG_CHECK_MODULES([omniORB4], [omniORB4 >= 4.1.2]) PKG_CHECK_MODULES([omniCOS4], [omniCOS4 >= 4.1.2]) dnl omniorb_AC_HAVE_OMNIORB_VERSION($OMNI_ROOT/include/omniORB4,4,1,1) dnl omniorb_AC_HAVE_OMNIORB_VERSION($OMNI_ROOT/include/omniORB4,4,1,2) dnl if test "x$ac_cv_omniorb_version_4_1_1" = "xyes"; then dnl if test "x$ac_cv_omniorb_version_4_1_2" = "xno"; then dnl AC_MSG_ERROR([omniORB release 4.1.1 is not supported. Should be 4.1.0 or 4.1.2 and above. Please update !],-1) dnl fi dnl fi if test -x $OMNI_ROOT/include/omniORB4 then VERS=`grep VERSION $OMNI_ROOT/include/omniORB4/acconfig.h 2>&1 | cut -d ' ' -f 3` OMNI_VERSION=$VERS fi if test "x$omni" = "x" -o "x$omni" = "xno" then CXXCPPFLAGS=$svCXXCPPFLAGS CPPFLAGS=$svCPPFLAGS LIBS=$svLIBS LDFLAGS=$svLDFLAGS ORB=unknown omni=no eval "$rssh_rollback" rssh_rollback=$svRSSH_ROLLBACK else AC_SUBST(CORBA_INCLUDES) ORB_PREFIX=$OMNI_ROOT AC_SUBST(ORB_PREFIX) ORB=omniORB AC_SUBST(ORB) IDL=omniidl if test -x $OMNI_ROOT/bin/omniidl then IDL=$OMNI_ROOT/bin/omniidl else for i in $OMNI_ROOT/bin/*/omniidl do if test "$i" != $OMNI_ROOT'/bin/*/omniidl' then IDL=$i break fi done fi AC_SUBST(IDL) IDLCXX=$IDL AC_SUBST(IDLCXX) IDLFLAGS="$IDLFLAGS -bcxx -I$OMNI_ROOT/idl" AC_SUBST(IDLFLAGS) ORB_INCLUDE_PREFIX=$ORB_INCLUDES AC_SUBST(ORB_INCLUDE_PREFIX) IDL_H_SUFFIX=.hh AC_SUBST(IDL_H_SUFFIX) IDL_H1_SUFFIX=no AC_SUBST(IDL_H1_SUFFIX) IDL_CLN_H=.hh IDL_CLN_H_SUFFIX=.hh IDL_CLN_H1_SUFFIX=no AC_SUBST(IDL_CLN_H,$IDL_CLN_H) AC_SUBST(IDL_CLN_H_SUFFIX,$IDL_CLN_H_SUFFIX) AC_SUBST(IDL_CLN_H1_SUFFIX,$IDL_CLN_H1_SUFFIX) AC_DEFINE_UNQUOTED(IDL_CLN_H_SUFFIX,$IDL_CLN_H_SUFFIX,1,"") IDL_CLN_CPP=SK.cc IDL_CLN_CPP_SUFFIX=SK.cc AC_SUBST(IDL_CLN_CPP,$IDL_CLN_CPP) AC_SUBST(IDL_CLN_CPP_SUFFIX,$IDL_CLN_CPP_SUFFIX) AC_DEFINE_UNQUOTED(IDL_CLN_CPP_SUFFIX,$IDL_CLN_CPP,1,"") IDL_CLN_O=SK.o IDL_CLN_OBJ_SUFFIX=SK.o AC_SUBST(IDL_CLN_O,$IDL_CLN_O) AC_SUBST(IDL_CLN_OBJ_SUFFIX,$IDL_CLN_OBJ_SUFFIX) IDL_SRV_H=.hh IDL_SRV_H_SUFFIX=.hh IDL_SRV_H1_SUFFIX=no AC_SUBST(IDL_SRV_H,$IDL_SRV_H) AC_SUBST(IDL_SRV_H_SUFFIX,$IDL_SRV_H_SUFFIX) AC_SUBST(IDL_SRV_H1_SUFFIX,$IDL_SRV_H1_SUFFIX) AC_DEFINE_UNQUOTED(IDL_SRV_H_SUFFIX,$IDL_SRV_H_SUFFIX,1,"") IDL_SRV_CPP=SK.cc IDL_SRV_CPP_SUFFIX=SK.cc AC_SUBST(IDL_SRV_CPP,$IDL_SRV_CPP) AC_SUBST(IDL_SRV_CPP_SUFFIX,$IDL_SRV_CPP_SUFFIX) AC_DEFINE_UNQUOTED(IDL_SRV_H_SUFFIX,$IDL_SRV_H_SUFFIX,1,"") IDL_SRV_O=SK.o IDL_SRV_OBJ_SUFFIX=SK.o AC_SUBST(IDL_SRV_O,$IDL_SRV_O) AC_SUBST(IDL_SRV_OBJ_SUFFIX,$IDL_SRV_OBJ_SUFFIX) IDL_TIE_H_SUFFIX=no IDL_TIE_H1_SUFFIX=no IDL_TIE_CPP_SUFFIX=no AC_SUBST(IDL_TIE_H_SUFFIX,$IDL_TIE_H_SUFFIX) AC_SUBST(IDL_TIE_H1_SUFFIX,$IDL_TIE_H1_SUFFIX) AC_SUBST(IDL_TIE_CPP_SUFFIX,$IDL_TIE_CPP_SUFFIX) CORBA_H='omniORB4/CORBA.h' AC_DEFINE_UNQUOTED(CORBA_H,<$CORBA_H>, "") COSNAMING_H='omniORB4/Naming.hh' AC_DEFINE_UNQUOTED(COSNAMING_H,<$COSNAMING_H>, "") ORB_COSNAMING_LIB= AC_SUBST(ORB_COSNAMING_LIB) dnl i. e. it's build into ORB lib HAVE_ORB_IDL=1 AC_SUBST(HAVE_ORB_IDL) AC_CACHE_CHECK([whether CORBA modules mapped to namespaces], rssh_cv_corba_namespaces, AC_TRY_COMPILE(#include <$CORBA_H> , [ #ifndef HAS_Cplusplus_Namespace #error "we have no namespaces" we have no namespaces -- $$$$ #else return 0; #endif ], rssh_cv_corba_namespaces=yes, rssh_cv_corba_namespaces=no) ) if test "$rssh_cv_corba_namespaces" = "yes" then AC_DEFINE(CORBA_MODULE_NAMESPACE_MAPPING,1, "") else AC_DEFINE(CORBA_MODULE_CLASS_MAPPING,1,"") fi AC_DEFINE(OMNIORB,1,"if we're working with omniorb") CORBA_HAVE_POA=1 AC_DEFINE(CORBA_HAVE_POA,1, "if our orb has a poa") CORBA_ORB_INIT_HAVE_3_ARGS=1 AC_DEFINE(CORBA_ORB_INIT_HAVE_3_ARGS,1,"if our orb-init has 3 args") CORBA_ORB_INIT_THIRD_ARG='"omniORB4"' AC_DEFINE(CORBA_ORB_INIT_THIRD_ARG, "omniORB4", "what the third argument is") AC_DEFINE(CORBA_ORB_HAVE_DESTROY,1,"") fi AC_LANG_RESTORE ])dnl dnl tango-8.1.2c+dfsg.orig/m4/libtool.m40000644000175000017500000106043412205375241016032 0ustar piccapicca# libtool.m4 - Configure libtool for the host system. -*-Autoconf-*- # # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005, # 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 # unlimited permission to copy and/or distribute it, with or without # modifications, as long as this notice is preserved. m4_define([_LT_COPYING], [dnl # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005, # 2006, 2007, 2008, 2009, 2010, 2011 Free Software # Foundation, Inc. # Written by Gordon Matzigkeit, 1996 # # This file is part of GNU Libtool. # # GNU Libtool 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. # # As a special exception to the GNU General Public License, # if you distribute this file as part of a program or library that # is built using GNU Libtool, you may include this file under the # same distribution terms that you use for the rest of that program. # # GNU Libtool 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 GNU Libtool; see the file COPYING. If not, a copy # can be downloaded from http://www.gnu.org/licenses/gpl.html, or # obtained by writing to the Free Software Foundation, Inc., # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ]) # serial 57 LT_INIT # LT_PREREQ(VERSION) # ------------------ # Complain and exit if this libtool version is less that VERSION. m4_defun([LT_PREREQ], [m4_if(m4_version_compare(m4_defn([LT_PACKAGE_VERSION]), [$1]), -1, [m4_default([$3], [m4_fatal([Libtool version $1 or higher is required], 63)])], [$2])]) # _LT_CHECK_BUILDDIR # ------------------ # Complain if the absolute build directory name contains unusual characters m4_defun([_LT_CHECK_BUILDDIR], [case `pwd` in *\ * | *\ *) AC_MSG_WARN([Libtool does not cope well with whitespace in `pwd`]) ;; esac ]) # LT_INIT([OPTIONS]) # ------------------ 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 m4_require([_LT_CHECK_BUILDDIR])dnl dnl Autoconf doesn't catch unexpanded LT_ macros by default: m4_pattern_forbid([^_?LT_[A-Z_]+$])dnl m4_pattern_allow([^(_LT_EOF|LT_DLGLOBAL|LT_DLLAZY_OR_NOW|LT_MULTI_MODULE)$])dnl dnl aclocal doesn't pull ltoptions.m4, ltsugar.m4, or ltversion.m4 dnl unless we require an AC_DEFUNed macro: AC_REQUIRE([LTOPTIONS_VERSION])dnl AC_REQUIRE([LTSUGAR_VERSION])dnl AC_REQUIRE([LTVERSION_VERSION])dnl 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]) # This can be used to rebuild libtool when needed LIBTOOL_DEPS="$ltmain" # Always use our own libtool. LIBTOOL='$(SHELL) $(top_builddir)/libtool' AC_SUBST(LIBTOOL)dnl _LT_SETUP # Only expand once: m4_define([LT_INIT]) ])# LT_INIT # Old names: AU_ALIAS([AC_PROG_LIBTOOL], [LT_INIT]) AU_ALIAS([AM_PROG_LIBTOOL], [LT_INIT]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_PROG_LIBTOOL], []) dnl AC_DEFUN([AM_PROG_LIBTOOL], []) # _LT_CC_BASENAME(CC) # ------------------- # Calculate cc_basename. Skip known compiler wrappers and cross-prefix. m4_defun([_LT_CC_BASENAME], [for cc_temp in $1""; do case $cc_temp in compile | *[[\\/]]compile | ccache | *[[\\/]]ccache ) ;; distcc | *[[\\/]]distcc | purify | *[[\\/]]purify ) ;; \-*) ;; *) break;; esac done cc_basename=`$ECHO "$cc_temp" | $SED "s%.*/%%; s%^$host_alias-%%"` ]) # _LT_FILEUTILS_DEFAULTS # ---------------------- # It is okay to use these file commands and assume they have been set # sensibly after `m4_require([_LT_FILEUTILS_DEFAULTS])'. m4_defun([_LT_FILEUTILS_DEFAULTS], [: ${CP="cp -f"} : ${MV="mv -f"} : ${RM="rm -f"} ])# _LT_FILEUTILS_DEFAULTS # _LT_SETUP # --------- 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 dnl _LT_DECL([], [build_alias], [0], [The build system])dnl _LT_DECL([], [build], [0])dnl _LT_DECL([], [build_os], [0])dnl dnl AC_REQUIRE([AC_PROG_CC])dnl AC_REQUIRE([LT_PATH_LD])dnl AC_REQUIRE([LT_PATH_NM])dnl dnl AC_REQUIRE([AC_PROG_LN_S])dnl test -z "$LN_S" && LN_S="ln -s" _LT_DECL([], [LN_S], [1], [Whether we need soft or hard links])dnl dnl AC_REQUIRE([LT_CMD_MAX_LEN])dnl _LT_DECL([objext], [ac_objext], [0], [Object file suffix (normally "o")])dnl _LT_DECL([], [exeext], [0], [Executable file suffix (normally "")])dnl 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 # commands through without removal of \ escapes INIT. if test -n "\${ZSH_VERSION+set}" ; then setopt NO_GLOB_SUBST fi ]) if test -n "${ZSH_VERSION+set}" ; then setopt NO_GLOB_SUBST fi _LT_CHECK_OBJDIR m4_require([_LT_TAG_COMPILER])dnl case $host_os in aix3*) # AIX sometimes has problems with the GCC collect2 program. For some # reason, if we set the COLLECT_NAMES environment variable, the problems # vanish in a puff of smoke. if test "X${COLLECT_NAMES+set}" != Xset; then COLLECT_NAMES= export COLLECT_NAMES fi ;; esac # Global variables: ofile=libtool can_build_shared=yes # All known linkers require a `.a' archive for static linking (except MSVC, # which needs '.lib'). libext=a with_gnu_ld="$lt_cv_prog_gnu_ld" old_CC="$CC" old_CFLAGS="$CFLAGS" # Set sane defaults for various variables test -z "$CC" && CC=cc test -z "$LTCC" && LTCC=$CC test -z "$LTCFLAGS" && LTCFLAGS=$CFLAGS test -z "$LD" && LD=ld test -z "$ac_objext" && ac_objext=o _LT_CC_BASENAME([$compiler]) # Only perform the check for file, if the check method requires it test -z "$MAGIC_CMD" && MAGIC_CMD=file case $deplibs_check_method in file_magic*) if test "$file_magic_cmd" = '$MAGIC_CMD'; then _LT_PATH_MAGIC fi ;; esac # Use C for the default configuration in the libtool script LT_SUPPORTED_TAG([CC]) _LT_LANG_C_CONFIG _LT_LANG_DEFAULT_CONFIG _LT_CONFIG_COMMANDS ])# _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' # now that we use AC_CONFIG_COMMANDS to generate libtool. Notably, # `config.status' has no value for ac_aux_dir unless we are using Automake, # so we pass a copy along to make sure it has a sensible value anyway. m4_defun([_LT_PROG_LTMAIN], [m4_ifdef([AC_REQUIRE_AUX_FILE], [AC_REQUIRE_AUX_FILE([ltmain.sh])])dnl _LT_CONFIG_LIBTOOL_INIT([ac_aux_dir='$ac_aux_dir']) ltmain="$ac_aux_dir/ltmain.sh" ])# _LT_PROG_LTMAIN ## ------------------------------------- ## ## Accumulate code for creating libtool. ## ## ------------------------------------- ## # So that we can recreate a full libtool script including additional # tags, we accumulate the chunks of code to send to AC_CONFIG_COMMANDS # in macros and then make a single call at the end using the `libtool' # label. # _LT_CONFIG_LIBTOOL_INIT([INIT-COMMANDS]) # ---------------------------------------- # Register INIT-COMMANDS to be passed to AC_CONFIG_COMMANDS later. m4_define([_LT_CONFIG_LIBTOOL_INIT], [m4_ifval([$1], [m4_append([_LT_OUTPUT_LIBTOOL_INIT], [$1 ])])]) # Initialize. m4_define([_LT_OUTPUT_LIBTOOL_INIT]) # _LT_CONFIG_LIBTOOL([COMMANDS]) # ------------------------------ # Register COMMANDS to be passed to AC_CONFIG_COMMANDS later. m4_define([_LT_CONFIG_LIBTOOL], [m4_ifval([$1], [m4_append([_LT_OUTPUT_LIBTOOL_COMMANDS], [$1 ])])]) # Initialize. m4_define([_LT_OUTPUT_LIBTOOL_COMMANDS]) # _LT_CONFIG_SAVE_COMMANDS([COMMANDS], [INIT_COMMANDS]) # ----------------------------------------------------- m4_defun([_LT_CONFIG_SAVE_COMMANDS], [_LT_CONFIG_LIBTOOL([$1]) _LT_CONFIG_LIBTOOL_INIT([$2]) ]) # _LT_FORMAT_COMMENT([COMMENT]) # ----------------------------- # Add leading comment marks to the start of each line, and a trailing # full-stop to the whole comment if one is not present already. m4_define([_LT_FORMAT_COMMENT], [m4_ifval([$1], [ m4_bpatsubst([m4_bpatsubst([$1], [^ *], [# ])], [['`$\]], [\\\&])]m4_bmatch([$1], [[!?.]$], [], [.]) )]) ## ------------------------ ## ## FIXME: Eliminate VARNAME ## ## ------------------------ ## # _LT_DECL([CONFIGNAME], VARNAME, VALUE, [DESCRIPTION], [IS-TAGGED?]) # ------------------------------------------------------------------- # CONFIGNAME is the name given to the value in the libtool script. # VARNAME is the (base) name used in the configure script. # VALUE may be 0, 1 or 2 for a computed quote escaped value based on # VARNAME. Any other value will be used directly. m4_define([_LT_DECL], [lt_if_append_uniq([lt_decl_varnames], [$2], [, ], [lt_dict_add_subkey([lt_decl_dict], [$2], [libtool_name], [m4_ifval([$1], [$1], [$2])]) lt_dict_add_subkey([lt_decl_dict], [$2], [value], [$3]) m4_ifval([$4], [lt_dict_add_subkey([lt_decl_dict], [$2], [description], [$4])]) lt_dict_add_subkey([lt_decl_dict], [$2], [tagged?], [m4_ifval([$5], [yes], [no])])]) ]) # _LT_TAGDECL([CONFIGNAME], VARNAME, VALUE, [DESCRIPTION]) # -------------------------------------------------------- m4_define([_LT_TAGDECL], [_LT_DECL([$1], [$2], [$3], [$4], [yes])]) # lt_decl_tag_varnames([SEPARATOR], [VARNAME1...]) # ------------------------------------------------ m4_define([lt_decl_tag_varnames], [_lt_decl_filter([tagged?], [yes], $@)]) # _lt_decl_filter(SUBKEY, VALUE, [SEPARATOR], [VARNAME1..]) # --------------------------------------------------------- m4_define([_lt_decl_filter], [m4_case([$#], [0], [m4_fatal([$0: too few arguments: $#])], [1], [m4_fatal([$0: too few arguments: $#: $1])], [2], [lt_dict_filter([lt_decl_dict], [$1], [$2], [], lt_decl_varnames)], [3], [lt_dict_filter([lt_decl_dict], [$1], [$2], [$3], lt_decl_varnames)], [lt_dict_filter([lt_decl_dict], $@)])[]dnl ]) # lt_decl_quote_varnames([SEPARATOR], [VARNAME1...]) # -------------------------------------------------- m4_define([lt_decl_quote_varnames], [_lt_decl_filter([value], [1], $@)]) # lt_decl_dquote_varnames([SEPARATOR], [VARNAME1...]) # --------------------------------------------------- m4_define([lt_decl_dquote_varnames], [_lt_decl_filter([value], [2], $@)]) # lt_decl_varnames_tagged([SEPARATOR], [VARNAME1...]) # --------------------------------------------------- m4_define([lt_decl_varnames_tagged], [m4_assert([$# <= 2])dnl _$0(m4_quote(m4_default([$1], [[, ]])), m4_ifval([$2], [[$2]], [m4_dquote(lt_decl_tag_varnames)]), m4_split(m4_normalize(m4_quote(_LT_TAGS)), [ ]))]) m4_define([_lt_decl_varnames_tagged], [m4_ifval([$3], [lt_combine([$1], [$2], [_], $3)])]) # lt_decl_all_varnames([SEPARATOR], [VARNAME1...]) # ------------------------------------------------ m4_define([lt_decl_all_varnames], [_$0(m4_quote(m4_default([$1], [[, ]])), m4_if([$2], [], m4_quote(lt_decl_varnames), m4_quote(m4_shift($@))))[]dnl ]) m4_define([_lt_decl_all_varnames], [lt_join($@, lt_decl_varnames_tagged([$1], lt_decl_tag_varnames([[, ]], m4_shift($@))))dnl ]) # _LT_CONFIG_STATUS_DECLARE([VARNAME]) # ------------------------------------ # Quote a variable value, and forward it to `config.status' so that its # 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 "$][$1" | $SED "$delay_single_quote_subst"`']) # _LT_CONFIG_STATUS_DECLARATIONS # ------------------------------ # We delimit libtool config variables with single quotes, so when # we write them to config.status, we have to be sure to quote all # embedded single quotes properly. In configure, this macro expands # each variable declared with _LT_DECL (and _LT_TAGDECL) into: # # ='`$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)])])]) # _LT_LIBTOOL_TAGS # ---------------- # Output comment and list of tags supported by the script m4_defun([_LT_LIBTOOL_TAGS], [_LT_FORMAT_COMMENT([The names of the tagged configurations supported by this script])dnl available_tags="_LT_TAGS"dnl ]) # _LT_LIBTOOL_DECLARE(VARNAME, [TAG]) # ----------------------------------- # Extract the dictionary values for VARNAME (optionally with TAG) and # expand to a commented shell variable setting: # # # Some comment about what VAR is for. # visible_name=$lt_internal_name m4_define([_LT_LIBTOOL_DECLARE], [_LT_FORMAT_COMMENT(m4_quote(lt_dict_fetch([lt_decl_dict], [$1], [description])))[]dnl m4_pushdef([_libtool_name], m4_quote(lt_dict_fetch([lt_decl_dict], [$1], [libtool_name])))[]dnl m4_case(m4_quote(lt_dict_fetch([lt_decl_dict], [$1], [value])), [0], [_libtool_name=[$]$1], [1], [_libtool_name=$lt_[]$1], [2], [_libtool_name=$lt_[]$1], [_libtool_name=lt_dict_fetch([lt_decl_dict], [$1], [value])])[]dnl m4_ifval([$2], [_$2])[]m4_popdef([_libtool_name])[]dnl ]) # _LT_LIBTOOL_CONFIG_VARS # ----------------------- # Produce commented declarations of non-tagged libtool config variables # suitable for insertion in the LIBTOOL CONFIG section of the `libtool' # script. Tagged libtool config variables (even for the LIBTOOL CONFIG # section) are produced by _LT_LIBTOOL_TAG_VARS. m4_defun([_LT_LIBTOOL_CONFIG_VARS], [m4_foreach([_lt_var], m4_quote(_lt_decl_filter([tagged?], [no], [], lt_decl_varnames)), [m4_n([_LT_LIBTOOL_DECLARE(_lt_var)])])]) # _LT_LIBTOOL_TAG_VARS(TAG) # ------------------------- m4_define([_LT_LIBTOOL_TAG_VARS], [m4_foreach([_lt_var], m4_quote(lt_decl_tag_varnames), [m4_n([_LT_LIBTOOL_DECLARE(_lt_var, [$1])])])]) # _LT_TAGVAR(VARNAME, [TAGNAME]) # ------------------------------ m4_define([_LT_TAGVAR], [m4_ifval([$2], [$1_$2], [$1])]) # _LT_CONFIG_COMMANDS # ------------------- # Send accumulated output to $CONFIG_STATUS. Thanks to the lists of # variables for single and double quote escaping we saved from calls # to _LT_DECL, we can put quote escaped variables declarations # into `config.status', and then the shell code to quote escape them in # for loops in `config.status'. Finally, any additional code accumulated # from calls to _LT_CONFIG_LIBTOOL_INIT is expanded. m4_defun([_LT_CONFIG_COMMANDS], [AC_PROVIDE_IFELSE([LT_OUTPUT], dnl If the libtool generation code has been placed in $CONFIG_LT, dnl instead of duplicating it all over again into config.status, dnl then we will have config.status run $CONFIG_LT later, so it dnl needs to know what name is stored there: [AC_CONFIG_COMMANDS([libtool], [$SHELL $CONFIG_LT || AS_EXIT(1)], [CONFIG_LT='$CONFIG_LT'])], dnl If the libtool generation code is destined for config.status, dnl expand the accumulated commands and init code now: [AC_CONFIG_COMMANDS([libtool], [_LT_OUTPUT_LIBTOOL_COMMANDS], [_LT_OUTPUT_LIBTOOL_COMMANDS_INIT])]) ])#_LT_CONFIG_COMMANDS # Initialize. m4_define([_LT_OUTPUT_LIBTOOL_COMMANDS_INIT], [ # 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 sed_quote_subst='$sed_quote_subst' double_quote_subst='$double_quote_subst' delay_variable_subst='$delay_variable_subst' _LT_CONFIG_STATUS_DECLARATIONS 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 lt_decl_all_varnames([[ \ ]], lt_decl_quote_varnames); do case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in *[[\\\\\\\`\\"\\\$]]*) eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED \\"\\\$sed_quote_subst\\"\\\`\\\\\\"" ;; *) eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\"" ;; esac done # Double-quote double-evaled strings. for var in lt_decl_all_varnames([[ \ ]], lt_decl_dquote_varnames); do case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in *[[\\\\\\\`\\"\\\$]]*) eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED -e \\"\\\$double_quote_subst\\" -e \\"\\\$sed_quote_subst\\" -e \\"\\\$delay_variable_subst\\"\\\`\\\\\\"" ;; *) eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\"" ;; esac done _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 # --------- # This macro allows early generation of the libtool script (before # AC_OUTPUT is called), incase it is used in configure for compilation # tests. AC_DEFUN([LT_OUTPUT], [: ${CONFIG_LT=./config.lt} AC_MSG_NOTICE([creating $CONFIG_LT]) _LT_GENERATED_FILE_INIT(["$CONFIG_LT"], [# Run this file to recreate a libtool stub with the current configuration.]) cat >>"$CONFIG_LT" <<\_LTEOF lt_cl_silent=false exec AS_MESSAGE_LOG_FD>>config.log { echo AS_BOX([Running $as_me.]) } >&AS_MESSAGE_LOG_FD lt_cl_help="\ \`$as_me' creates a local libtool stub from the current configuration, for use in further configure time tests before the real libtool is generated. Usage: $[0] [[OPTIONS]] -h, --help print this help, then exit -V, --version print version number, then exit -q, --quiet do not print progress messages -d, --debug don't remove temporary files Report bugs to ." lt_cl_version="\ m4_ifset([AC_PACKAGE_NAME], [AC_PACKAGE_NAME ])config.lt[]dnl m4_ifset([AC_PACKAGE_VERSION], [ AC_PACKAGE_VERSION]) configured by $[0], generated by m4_PACKAGE_STRING. 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." while test $[#] != 0 do case $[1] in --version | --v* | -V ) echo "$lt_cl_version"; exit 0 ;; --help | --h* | -h ) echo "$lt_cl_help"; exit 0 ;; --debug | --d* | -d ) debug=: ;; --quiet | --q* | --silent | --s* | -q ) lt_cl_silent=: ;; -*) AC_MSG_ERROR([unrecognized option: $[1] Try \`$[0] --help' for more information.]) ;; *) AC_MSG_ERROR([unrecognized argument: $[1] Try \`$[0] --help' for more information.]) ;; esac shift done if $lt_cl_silent; then exec AS_MESSAGE_FD>/dev/null fi _LTEOF cat >>"$CONFIG_LT" <<_LTEOF _LT_OUTPUT_LIBTOOL_COMMANDS_INIT _LTEOF cat >>"$CONFIG_LT" <<\_LTEOF AC_MSG_NOTICE([creating $ofile]) _LT_OUTPUT_LIBTOOL_COMMANDS AS_EXIT(0) _LTEOF chmod +x "$CONFIG_LT" # configure is writing to config.log, but config.lt does its own redirection, # 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. 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 # _LT_CONFIG(TAG) # --------------- # If TAG is the built-in tag, create an initial libtool script with a # default configuration from the untagged config vars. Otherwise add code # to config.status for appending the configuration named by TAG from the # matching tagged config vars. m4_defun([_LT_CONFIG], [m4_require([_LT_FILEUTILS_DEFAULTS])dnl _LT_CONFIG_SAVE_COMMANDS([ m4_define([_LT_TAG], m4_if([$1], [], [C], [$1]))dnl m4_if(_LT_TAG, [C], [ # See if we are running on zsh, and set the options which allow our # commands through without removal of \ escapes. if test -n "${ZSH_VERSION+set}" ; then setopt NO_GLOB_SUBST fi cfgfile="${ofile}T" trap "$RM \"$cfgfile\"; exit 1" 1 2 15 $RM "$cfgfile" cat <<_LT_EOF >> "$cfgfile" #! $SHELL # `$ECHO "$ofile" | sed 's%^.*/%%'` - Provide generalized library-building support services. # Generated automatically by $as_me ($PACKAGE$TIMESTAMP) $VERSION # Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`: # NOTE: Changes made to this file will be lost: look at ltmain.sh. # _LT_COPYING _LT_LIBTOOL_TAGS # ### BEGIN LIBTOOL CONFIG _LT_LIBTOOL_CONFIG_VARS _LT_LIBTOOL_TAG_VARS # ### END LIBTOOL CONFIG _LT_EOF case $host_os in aix3*) cat <<\_LT_EOF >> "$cfgfile" # AIX sometimes has problems with the GCC collect2 program. For some # reason, if we set the COLLECT_NAMES environment variable, the problems # vanish in a puff of smoke. if test "X${COLLECT_NAMES+set}" != Xset; then COLLECT_NAMES= export COLLECT_NAMES fi _LT_EOF ;; esac _LT_PROG_LTMAIN # We use sed instead of cat because bash on DJGPP gets confused if # 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 '$q' "$ltmain" >> "$cfgfile" \ || (rm -f "$cfgfile"; exit 1) _LT_PROG_REPLACE_SHELLFNS mv -f "$cfgfile" "$ofile" || (rm -f "$ofile" && cp "$cfgfile" "$ofile" && rm -f "$cfgfile") chmod +x "$ofile" ], [cat <<_LT_EOF >> "$ofile" dnl Unfortunately we have to use $1 here, since _LT_TAG is not expanded dnl in a comment (ie after a #). # ### BEGIN LIBTOOL TAG CONFIG: $1 _LT_LIBTOOL_TAG_VARS(_LT_TAG) # ### END LIBTOOL TAG CONFIG: $1 _LT_EOF ])dnl /m4_if ], [m4_if([$1], [], [ PACKAGE='$PACKAGE' VERSION='$VERSION' TIMESTAMP='$TIMESTAMP' RM='$RM' ofile='$ofile'], []) ])dnl /_LT_CONFIG_SAVE_COMMANDS ])# _LT_CONFIG # LT_SUPPORTED_TAG(TAG) # --------------------- # Trace this macro to discover what tags are supported by the libtool # --tag option, using: # autoconf --trace 'LT_SUPPORTED_TAG:$1' AC_DEFUN([LT_SUPPORTED_TAG], []) # C support is built-in for now m4_define([_LT_LANG_C_enabled], []) m4_define([_LT_TAGS], []) # LT_LANG(LANG) # ------------- # Enable libtool support for the given language if not already enabled. AC_DEFUN([LT_LANG], [AC_BEFORE([$0], [LT_OUTPUT])dnl 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)], [Windows Resource], [_LT_LANG(RC)], [m4_ifdef([_LT_LANG_]$1[_CONFIG], [_LT_LANG($1)], [m4_fatal([$0: unsupported language: "$1"])])])dnl ])# LT_LANG # _LT_LANG(LANGNAME) # ------------------ m4_defun([_LT_LANG], [m4_ifdef([_LT_LANG_]$1[_enabled], [], [LT_SUPPORTED_TAG([$1])dnl m4_append([_LT_TAGS], [$1 ])dnl m4_define([_LT_LANG_]$1[_enabled], [])dnl _LT_LANG_$1_CONFIG($1)])dnl ])# _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], [AC_PROVIDE_IFELSE([AC_PROG_CXX], [LT_LANG(CXX)], [m4_define([AC_PROG_CXX], defn([AC_PROG_CXX])[LT_LANG(CXX)])]) AC_PROVIDE_IFELSE([AC_PROG_F77], [LT_LANG(F77)], [m4_define([AC_PROG_F77], defn([AC_PROG_F77])[LT_LANG(F77)])]) AC_PROVIDE_IFELSE([AC_PROG_FC], [LT_LANG(FC)], [m4_define([AC_PROG_FC], defn([AC_PROG_FC])[LT_LANG(FC)])]) dnl The call to [A][M_PROG_GCJ] is quoted like that to stop aclocal dnl pulling things in needlessly. AC_PROVIDE_IFELSE([AC_PROG_GCJ], [LT_LANG(GCJ)], [AC_PROVIDE_IFELSE([A][M_PROG_GCJ], [LT_LANG(GCJ)], [AC_PROVIDE_IFELSE([LT_PROG_GCJ], [LT_LANG(GCJ)], [m4_ifdef([AC_PROG_GCJ], [m4_define([AC_PROG_GCJ], defn([AC_PROG_GCJ])[LT_LANG(GCJ)])]) m4_ifdef([A][M_PROG_GCJ], [m4_define([A][M_PROG_GCJ], defn([A][M_PROG_GCJ])[LT_LANG(GCJ)])]) 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)])]) ])# _LT_LANG_DEFAULT_CONFIG # Obsolete macros: AU_DEFUN([AC_LIBTOOL_CXX], [LT_LANG(C++)]) 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 # ---------------- m4_defun([_LT_TAG_COMPILER], [AC_REQUIRE([AC_PROG_CC])dnl _LT_DECL([LTCC], [CC], [1], [A C compiler])dnl _LT_DECL([LTCFLAGS], [CFLAGS], [1], [LTCC compiler flags])dnl _LT_TAGDECL([CC], [compiler], [1], [A language specific compiler])dnl _LT_TAGDECL([with_gcc], [GCC], [0], [Is the compiler the GNU compiler?])dnl # If no C compiler was specified, use CC. LTCC=${LTCC-"$CC"} # If no C compiler flags were specified, use CFLAGS. LTCFLAGS=${LTCFLAGS-"$CFLAGS"} # Allow CC to be a program name with arguments. compiler=$CC ])# _LT_TAG_COMPILER # _LT_COMPILER_BOILERPLATE # ------------------------ # Check for compiler boilerplate output or warnings with # the simple compiler test code. m4_defun([_LT_COMPILER_BOILERPLATE], [m4_require([_LT_DECL_SED])dnl ac_outfile=conftest.$ac_objext echo "$lt_simple_compile_test_code" >conftest.$ac_ext eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err _lt_compiler_boilerplate=`cat conftest.err` $RM conftest* ])# _LT_COMPILER_BOILERPLATE # _LT_LINKER_BOILERPLATE # ---------------------- # Check for linker boilerplate output or warnings with # the simple link test code. m4_defun([_LT_LINKER_BOILERPLATE], [m4_require([_LT_DECL_SED])dnl ac_outfile=conftest.$ac_objext echo "$lt_simple_link_test_code" >conftest.$ac_ext eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err _lt_linker_boilerplate=`cat conftest.err` $RM -r conftest* ])# _LT_LINKER_BOILERPLATE # _LT_REQUIRED_DARWIN_CHECKS # ------------------------- m4_defun_once([_LT_REQUIRED_DARWIN_CHECKS],[ case $host_os in rhapsody* | darwin*) AC_CHECK_TOOL([DSYMUTIL], [dsymutil], [:]) AC_CHECK_TOOL([NMEDIT], [nmedit], [:]) AC_CHECK_TOOL([LIPO], [lipo], [:]) AC_CHECK_TOOL([OTOOL], [otool], [:]) AC_CHECK_TOOL([OTOOL64], [otool64], [:]) _LT_DECL([], [DSYMUTIL], [1], [Tool to manipulate archived DWARF debug symbol files on Mac OS X]) _LT_DECL([], [NMEDIT], [1], [Tool to change global to local symbols on Mac OS X]) _LT_DECL([], [LIPO], [1], [Tool to manipulate fat objects and archives on Mac OS X]) _LT_DECL([], [OTOOL], [1], [ldd/readelf like tool for Mach-O binaries on Mac OS X]) _LT_DECL([], [OTOOL64], [1], [ldd/readelf like tool for 64 bit Mach-O binaries on Mac OS X 10.4]) AC_CACHE_CHECK([for -single_module linker flag],[lt_cv_apple_cc_single_mod], [lt_cv_apple_cc_single_mod=no if test -z "${LT_MULTI_MODULE}"; then # By default we will add the -single_module flag. You can override # by either setting the environment variable LT_MULTI_MODULE # non-empty at configure time, or by adding -multi_module to the # link flags. rm -rf libconftest.dylib* echo "int foo(void){return 1;}" > conftest.c echo "$LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \ -dynamiclib -Wl,-single_module conftest.c" >&AS_MESSAGE_LOG_FD $LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \ -dynamiclib -Wl,-single_module conftest.c 2>conftest.err _lt_result=$? # 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 fi 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 save_LDFLAGS=$LDFLAGS echo "_main" > conftest.sym LDFLAGS="$LDFLAGS -Wl,-exported_symbols_list,conftest.sym" AC_LINK_IFELSE([AC_LANG_PROGRAM([],[])], [lt_cv_ld_exported_symbols_list=yes], [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' ;; darwin1.*) _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;; darwin*) # darwin 5.x on # if running on 10.5 or later, the deployment target defaults # to the OS version, if on x86, and 10.4, the deployment # target defaults to 10.4. Don't you love it? case ${MACOSX_DEPLOYMENT_TARGET-10.0},$host in 10.0,*86*-darwin8*|10.0,*-darwin[[91]]*) _lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;; 10.[[012]]*) _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;; 10.*) _lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;; esac ;; esac if test "$lt_cv_apple_cc_single_mod" = "yes"; then _lt_dar_single_mod='$single_module' fi if test "$lt_cv_ld_exported_symbols_list" = "yes"; then _lt_dar_export_syms=' ${wl}-exported_symbols_list,$output_objdir/${libname}-symbols.expsym' else _lt_dar_export_syms='~$NMEDIT -s $output_objdir/${libname}-symbols.expsym ${lib}' fi if test "$DSYMUTIL" != ":" && test "$lt_cv_ld_force_load" = "no"; then _lt_dsymutil='~$DSYMUTIL $lib || :' else _lt_dsymutil= fi ;; esac ]) # _LT_DARWIN_LINKER_FEATURES([TAG]) # --------------------------------- # Checks for linker and compiler features on darwin m4_defun([_LT_DARWIN_LINKER_FEATURES], [ m4_require([_LT_REQUIRED_DARWIN_CHECKS]) _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_automatic, $1)=yes _LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported 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 ifort*) _lt_dar_can_shared=yes ;; *) _lt_dar_can_shared=$GCC ;; esac if test "$_lt_dar_can_shared" = "yes"; then 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}" _LT_TAGVAR(module_expsym_cmds, $1)="sed -e 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dar_export_syms}${_lt_dsymutil}" m4_if([$1], [CXX], [ if test "$lt_cv_apple_cc_single_mod" != "yes"; then _LT_TAGVAR(archive_cmds, $1)="\$CC -r -keep_private_externs -nostdlib -o \${lib}-master.o \$libobjs~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \${lib}-master.o \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring${_lt_dsymutil}" _LT_TAGVAR(archive_expsym_cmds, $1)="sed 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC -r -keep_private_externs -nostdlib -o \${lib}-master.o \$libobjs~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \${lib}-master.o \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring${_lt_dar_export_syms}${_lt_dsymutil}" fi ],[]) else _LT_TAGVAR(ld_shlibs, $1)=no fi ]) # _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 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], [m4_divert_text([M4SH-INIT], [$1 ])])# _LT_SHELL_INIT # _LT_PROG_ECHO_BACKSLASH # ----------------------- # 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], [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 # 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*) AC_MSG_RESULT([printf]) ;; print*) AC_MSG_RESULT([print -r]) ;; *) AC_MSG_RESULT([cat]) ;; esac 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" )])]) _LT_DECL([], [SHELL], [1], [Shell to use when invoking shell scripts]) _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], [AC_ARG_ENABLE([libtool-lock], [AS_HELP_STRING([--disable-libtool-lock], [avoid locking (might break parallel builds)])]) test "x$enable_libtool_lock" != xno && enable_libtool_lock=yes # Some flags need to be propagated to the compiler or linker for good # libtool support. case $host in ia64-*-hpux*) # 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.$ac_objext` in *ELF-32*) HPUX_IA64_MODE="32" ;; *ELF-64*) HPUX_IA64_MODE="64" ;; esac fi rm -rf conftest* ;; *-*-irix6*) # Find out which ABI we are using. 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 *32-bit*) LD="${LD-ld} -melf32bsmip" ;; *N32*) LD="${LD-ld} -melf32bmipn32" ;; *64-bit*) LD="${LD-ld} -melf64bmip" ;; esac else case `/usr/bin/file conftest.$ac_objext` in *32-bit*) LD="${LD-ld} -32" ;; *N32*) LD="${LD-ld} -n32" ;; *64-bit*) LD="${LD-ld} -64" ;; esac fi fi rm -rf conftest* ;; x86_64-*kfreebsd*-gnu|x86_64-*linux*|ppc*-*linux*|powerpc*-*linux*| \ s390*-*linux*|s390*-*tpf*|sparc*-*linux*) # 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 *32-bit*) case $host in x86_64-*kfreebsd*-gnu) LD="${LD-ld} -m elf_i386_fbsd" ;; x86_64-*linux*) LD="${LD-ld} -m elf_i386" ;; ppc64-*linux*|powerpc64-*linux*) LD="${LD-ld} -m elf32ppclinux" ;; s390x-*linux*) LD="${LD-ld} -m elf_s390" ;; sparc64-*linux*) LD="${LD-ld} -m elf32_sparc" ;; esac ;; *64-bit*) case $host in x86_64-*kfreebsd*-gnu) LD="${LD-ld} -m elf_x86_64_fbsd" ;; x86_64-*linux*) LD="${LD-ld} -m elf_x86_64" ;; ppc*-*linux*|powerpc*-*linux*) LD="${LD-ld} -m elf64ppc" ;; s390*-*linux*|s390*-*tpf*) LD="${LD-ld} -m elf64_s390" ;; sparc*-*linux*) LD="${LD-ld} -m elf64_sparc" ;; esac ;; esac fi rm -rf conftest* ;; *-*-sco3.2v5*) # On SCO OpenServer 5, we need -belf to get full-featured binaries. SAVE_CFLAGS="$CFLAGS" CFLAGS="$CFLAGS -belf" AC_CACHE_CHECK([whether the C compiler needs -belf], lt_cv_cc_needs_belf, [AC_LANG_PUSH(C) AC_LINK_IFELSE([AC_LANG_PROGRAM([[]],[[]])],[lt_cv_cc_needs_belf=yes],[lt_cv_cc_needs_belf=no]) AC_LANG_POP]) if test x"$lt_cv_cc_needs_belf" != x"yes"; then # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf CFLAGS="$SAVE_CFLAGS" fi ;; *-*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*) 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" fi ;; esac ;; esac fi rm -rf conftest* ;; esac need_locks="$enable_libtool_lock" ])# _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], [_LT_PROG_AR AC_CHECK_TOOL(STRIP, strip, :) test -z "$STRIP" && STRIP=: _LT_DECL([], [STRIP], [1], [A symbol stripping program]) AC_CHECK_TOOL(RANLIB, ranlib, :) test -z "$RANLIB" && RANLIB=: _LT_DECL([], [RANLIB], [1], [Commands used to install an old-style archive]) # Determine commands to create old-style static archives. old_archive_cmds='$AR $AR_FLAGS $oldlib$oldobjs' old_postinstall_cmds='chmod 644 $oldlib' old_postuninstall_cmds= if test -n "$RANLIB"; then case $host_os in openbsd*) old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB -t \$tool_oldlib" ;; *) old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB \$tool_oldlib" ;; esac 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 # _LT_COMPILER_OPTION(MESSAGE, VARIABLE-NAME, FLAGS, # [OUTPUT-FILE], [ACTION-SUCCESS], [ACTION-FAILURE]) # ---------------------------------------------------------------- # Check whether the given compiler option works AC_DEFUN([_LT_COMPILER_OPTION], [m4_require([_LT_FILEUTILS_DEFAULTS])dnl m4_require([_LT_DECL_SED])dnl AC_CACHE_CHECK([$1], [$2], [$2=no m4_if([$4], , [ac_outfile=conftest.$ac_objext], [ac_outfile=$4]) echo "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="$3" # Insert the option either (1) after the last *FLAGS variable, or # (2) before a word containing "conftest.", or (3) at the end. # Note that $ac_compile itself does not contain backslashes and begins # with a dollar sign (not a hyphen), so the echo should work correctly. # The option is referenced via a variable to avoid confusing sed. lt_compile=`echo "$ac_compile" | $SED \ -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:$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:$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 "$_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 fi fi $RM conftest* ]) if test x"[$]$2" = xyes; then m4_if([$5], , :, [$5]) else m4_if([$6], , :, [$6]) fi ])# _LT_COMPILER_OPTION # Old name: AU_ALIAS([AC_LIBTOOL_COMPILER_OPTION], [_LT_COMPILER_OPTION]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_LIBTOOL_COMPILER_OPTION], []) # _LT_LINKER_OPTION(MESSAGE, VARIABLE-NAME, FLAGS, # [ACTION-SUCCESS], [ACTION-FAILURE]) # ---------------------------------------------------- # Check whether the given linker option works AC_DEFUN([_LT_LINKER_OPTION], [m4_require([_LT_FILEUTILS_DEFAULTS])dnl m4_require([_LT_DECL_SED])dnl AC_CACHE_CHECK([$1], [$2], [$2=no save_LDFLAGS="$LDFLAGS" LDFLAGS="$LDFLAGS $3" 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>&AS_MESSAGE_LOG_FD $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 fi else $2=yes fi fi $RM -r conftest* LDFLAGS="$save_LDFLAGS" ]) if test x"[$]$2" = xyes; then m4_if([$4], , :, [$4]) else m4_if([$5], , :, [$5]) fi ])# _LT_LINKER_OPTION # Old name: AU_ALIAS([AC_LIBTOOL_LINKER_OPTION], [_LT_LINKER_OPTION]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_LIBTOOL_LINKER_OPTION], []) # LT_CMD_MAX_LEN #--------------- AC_DEFUN([LT_CMD_MAX_LEN], [AC_REQUIRE([AC_CANONICAL_HOST])dnl # find the maximum length of command line arguments AC_MSG_CHECKING([the maximum length of command line arguments]) AC_CACHE_VAL([lt_cv_sys_max_cmd_len], [dnl i=0 teststring="ABCD" case $build_os in msdosdjgpp*) # On DJGPP, this test can blow up pretty badly due to problems in libc # (any single argument exceeding 2000 bytes causes a buffer overrun # during glob expansion). Even if it were fixed, the result of this # check would be larger than it should be. lt_cv_sys_max_cmd_len=12288; # 12K is about right ;; gnu*) # Under GNU Hurd, this test is not required because there is # no limit to the length of command line arguments. # Libtool will interpret -1 as no limit whatsoever lt_cv_sys_max_cmd_len=-1; ;; cygwin* | mingw* | cegcc*) # On Win9x/ME, this test blows up -- it succeeds, but takes # about 5 minutes as the teststring grows exponentially. # Worse, since 9x/ME are not pre-emptively multitasking, # you end up with a "frozen" computer, even though with patience # the test eventually succeeds (with a max line length of 256k). # Instead, let's just punt: use the minimum linelength reported by # all of the supported platforms: 8192 (on NT/2K/XP). 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. lt_cv_sys_max_cmd_len=8192; ;; netbsd* | freebsd* | openbsd* | darwin* | dragonfly*) # This has been around since 386BSD, at least. Likely further. if test -x /sbin/sysctl; then lt_cv_sys_max_cmd_len=`/sbin/sysctl -n kern.argmax` elif test -x /usr/sbin/sysctl; then lt_cv_sys_max_cmd_len=`/usr/sbin/sysctl -n kern.argmax` else lt_cv_sys_max_cmd_len=65536 # usable default for all BSDs fi # And add a safety zone lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4` lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3` ;; interix*) # We know the value 262144 and hardcode it with a safety zone (like BSD) 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 # nice to cause kernel panics so lets avoid the loop below. # First set a reasonable default. lt_cv_sys_max_cmd_len=16384 # if test -x /sbin/sysconfig; then case `/sbin/sysconfig -q proc exec_disable_arg_limit` in *1*) lt_cv_sys_max_cmd_len=-1 ;; esac fi ;; sco3.2v5*) lt_cv_sys_max_cmd_len=102400 ;; sysv5* | sco5v6* | sysv4.2uw2*) kargmax=`grep ARG_MAX /etc/conf/cf.d/stune 2>/dev/null` if test -n "$kargmax"; then lt_cv_sys_max_cmd_len=`echo $kargmax | sed 's/.*[[ ]]//'` else lt_cv_sys_max_cmd_len=32768 fi ;; *) lt_cv_sys_max_cmd_len=`(getconf ARG_MAX) 2> /dev/null` if test -n "$lt_cv_sys_max_cmd_len"; then lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4` lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3` else # Make teststring a little bigger before we do anything with it. # a 1K string should be a reasonable start. for i in 1 2 3 4 5 6 7 8 ; do teststring=$teststring$teststring done SHELL=${SHELL-${CONFIG_SHELL-/bin/sh}} # 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"`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` teststring=$teststring$teststring done # Only check the string length outside the loop. lt_cv_sys_max_cmd_len=`expr "X$teststring" : ".*" 2>&1` teststring= # Add a significant safety factor because C++ compilers can tack on # massive amounts of additional arguments before passing them to the # linker. It appears as though 1/2 is a usable value. lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 2` fi ;; esac ]) if test -n $lt_cv_sys_max_cmd_len ; then AC_MSG_RESULT($lt_cv_sys_max_cmd_len) else AC_MSG_RESULT(none) fi max_cmd_len=$lt_cv_sys_max_cmd_len _LT_DECL([], [max_cmd_len], [0], [What is the maximum length of a command?]) ])# LT_CMD_MAX_LEN # Old name: AU_ALIAS([AC_LIBTOOL_SYS_MAX_CMD_LEN], [LT_CMD_MAX_LEN]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_LIBTOOL_SYS_MAX_CMD_LEN], []) # _LT_HEADER_DLFCN # ---------------- m4_defun([_LT_HEADER_DLFCN], [AC_CHECK_HEADERS([dlfcn.h], [], [], [AC_INCLUDES_DEFAULT])dnl ])# _LT_HEADER_DLFCN # _LT_TRY_DLOPEN_SELF (ACTION-IF-TRUE, ACTION-IF-TRUE-W-USCORE, # ACTION-IF-FALSE, ACTION-IF-CROSS-COMPILING) # ---------------------------------------------------------------- m4_defun([_LT_TRY_DLOPEN_SELF], [m4_require([_LT_HEADER_DLFCN])dnl if test "$cross_compiling" = yes; then : [$4] else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<_LT_EOF [#line $LINENO "configure" #include "confdefs.h" #if HAVE_DLFCN_H #include #endif #include #ifdef RTLD_GLOBAL # define LT_DLGLOBAL RTLD_GLOBAL #else # ifdef DL_GLOBAL # define LT_DLGLOBAL DL_GLOBAL # else # define LT_DLGLOBAL 0 # endif #endif /* We may have to define LT_DLLAZY_OR_NOW in the command line if we find out it does not work in some platform. */ #ifndef LT_DLLAZY_OR_NOW # ifdef RTLD_LAZY # define LT_DLLAZY_OR_NOW RTLD_LAZY # else # ifdef DL_LAZY # define LT_DLLAZY_OR_NOW DL_LAZY # else # ifdef RTLD_NOW # define LT_DLLAZY_OR_NOW RTLD_NOW # else # ifdef DL_NOW # define LT_DLLAZY_OR_NOW DL_NOW # else # define LT_DLLAZY_OR_NOW 0 # endif # endif # endif # endif #endif /* 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); int status = $lt_dlunknown; if (self) { if (dlsym (self,"fnord")) status = $lt_dlno_uscore; else { if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore; else puts (dlerror ()); } /* dlclose (self); */ } else puts (dlerror ()); return status; }] _LT_EOF if AC_TRY_EVAL(ac_link) && test -s conftest${ac_exeext} 2>/dev/null; then (./conftest; exit; ) >&AS_MESSAGE_LOG_FD 2>/dev/null lt_status=$? case x$lt_status in x$lt_dlno_uscore) $1 ;; x$lt_dlneed_uscore) $2 ;; x$lt_dlunknown|x*) $3 ;; esac else : # compilation failed $3 fi fi rm -fr conftest* ])# _LT_TRY_DLOPEN_SELF # LT_SYS_DLOPEN_SELF # ------------------ AC_DEFUN([LT_SYS_DLOPEN_SELF], [m4_require([_LT_HEADER_DLFCN])dnl if test "x$enable_dlopen" != xyes; then enable_dlopen=unknown enable_dlopen_self=unknown enable_dlopen_self_static=unknown else lt_cv_dlopen=no lt_cv_dlopen_libs= case $host_os in beos*) lt_cv_dlopen="load_add_on" lt_cv_dlopen_libs= lt_cv_dlopen_self=yes ;; mingw* | pw32* | cegcc*) lt_cv_dlopen="LoadLibrary" lt_cv_dlopen_libs= ;; cygwin*) lt_cv_dlopen="dlopen" lt_cv_dlopen_libs= ;; darwin*) # if libdl is installed we need to link against it AC_CHECK_LIB([dl], [dlopen], [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"],[ lt_cv_dlopen="dyld" lt_cv_dlopen_libs= lt_cv_dlopen_self=yes ]) ;; *) AC_CHECK_FUNC([shl_load], [lt_cv_dlopen="shl_load"], [AC_CHECK_LIB([dld], [shl_load], [lt_cv_dlopen="shl_load" lt_cv_dlopen_libs="-ldld"], [AC_CHECK_FUNC([dlopen], [lt_cv_dlopen="dlopen"], [AC_CHECK_LIB([dl], [dlopen], [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"], [AC_CHECK_LIB([svld], [dlopen], [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-lsvld"], [AC_CHECK_LIB([dld], [dld_link], [lt_cv_dlopen="dld_link" lt_cv_dlopen_libs="-ldld"]) ]) ]) ]) ]) ]) ;; esac if test "x$lt_cv_dlopen" != xno; then enable_dlopen=yes else enable_dlopen=no fi case $lt_cv_dlopen in dlopen) save_CPPFLAGS="$CPPFLAGS" test "x$ac_cv_header_dlfcn_h" = xyes && CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H" save_LDFLAGS="$LDFLAGS" wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\" save_LIBS="$LIBS" LIBS="$lt_cv_dlopen_libs $LIBS" AC_CACHE_CHECK([whether a program can dlopen itself], lt_cv_dlopen_self, [dnl _LT_TRY_DLOPEN_SELF( lt_cv_dlopen_self=yes, lt_cv_dlopen_self=yes, lt_cv_dlopen_self=no, lt_cv_dlopen_self=cross) ]) if test "x$lt_cv_dlopen_self" = xyes; then wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $lt_prog_compiler_static\" AC_CACHE_CHECK([whether a statically linked program can dlopen itself], lt_cv_dlopen_self_static, [dnl _LT_TRY_DLOPEN_SELF( lt_cv_dlopen_self_static=yes, lt_cv_dlopen_self_static=yes, lt_cv_dlopen_self_static=no, lt_cv_dlopen_self_static=cross) ]) fi CPPFLAGS="$save_CPPFLAGS" LDFLAGS="$save_LDFLAGS" LIBS="$save_LIBS" ;; esac case $lt_cv_dlopen_self in yes|no) enable_dlopen_self=$lt_cv_dlopen_self ;; *) enable_dlopen_self=unknown ;; esac case $lt_cv_dlopen_self_static in yes|no) enable_dlopen_self_static=$lt_cv_dlopen_self_static ;; *) enable_dlopen_self_static=unknown ;; esac fi _LT_DECL([dlopen_support], [enable_dlopen], [0], [Whether dlopen is supported]) _LT_DECL([dlopen_self], [enable_dlopen_self], [0], [Whether dlopen of programs is supported]) _LT_DECL([dlopen_self_static], [enable_dlopen_self_static], [0], [Whether dlopen of statically linked programs is supported]) ])# LT_SYS_DLOPEN_SELF # Old name: AU_ALIAS([AC_LIBTOOL_DLOPEN_SELF], [LT_SYS_DLOPEN_SELF]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_LIBTOOL_DLOPEN_SELF], []) # _LT_COMPILER_C_O([TAGNAME]) # --------------------------- # Check to see if options -c and -o are simultaneously supported by compiler. # This macro does not hard code the compiler like AC_PROG_CC_C_O. m4_defun([_LT_COMPILER_C_O], [m4_require([_LT_DECL_SED])dnl m4_require([_LT_FILEUTILS_DEFAULTS])dnl m4_require([_LT_TAG_COMPILER])dnl AC_CACHE_CHECK([if $compiler supports -c -o file.$ac_objext], [_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)], [_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)=no $RM -r conftest 2>/dev/null mkdir conftest cd conftest mkdir out echo "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="-o out/conftest2.$ac_objext" # Insert the option either (1) after the last *FLAGS variable, or # (2) before a word containing "conftest.", or (3) at the end. # Note that $ac_compile itself does not contain backslashes and begins # with a dollar sign (not a hyphen), so the echo should work correctly. lt_compile=`echo "$ac_compile" | $SED \ -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:$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:$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 "$_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 fi fi chmod u+w . 2>&AS_MESSAGE_LOG_FD $RM conftest* # SGI C++ compiler will create directory out/ii_files/ for # template instantiation test -d out/ii_files && $RM out/ii_files/* && rmdir out/ii_files $RM out/* && rmdir out cd .. $RM -r conftest $RM conftest* ]) _LT_TAGDECL([compiler_c_o], [lt_cv_prog_compiler_c_o], [1], [Does compiler simultaneously support -c and -o options?]) ])# _LT_COMPILER_C_O # _LT_COMPILER_FILE_LOCKS([TAGNAME]) # ---------------------------------- # Check to see if we can do hard links to lock some files if needed m4_defun([_LT_COMPILER_FILE_LOCKS], [m4_require([_LT_ENABLE_LOCK])dnl m4_require([_LT_FILEUTILS_DEFAULTS])dnl _LT_COMPILER_C_O([$1]) hard_links="nottested" if test "$_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)" = no && test "$need_locks" != no; then # do not overwrite the value of need_locks provided by the user AC_MSG_CHECKING([if we can lock with hard links]) hard_links=yes $RM conftest* ln conftest.a conftest.b 2>/dev/null && hard_links=no touch conftest.a ln conftest.a conftest.b 2>&5 || hard_links=no ln conftest.a conftest.b 2>/dev/null && hard_links=no AC_MSG_RESULT([$hard_links]) if test "$hard_links" = no; then AC_MSG_WARN([`$CC' does not support `-c -o', so `make -j' may be unsafe]) need_locks=warn fi else need_locks=no fi _LT_DECL([], [need_locks], [1], [Must we lock files when doing compilation?]) ])# _LT_COMPILER_FILE_LOCKS # _LT_CHECK_OBJDIR # ---------------- m4_defun([_LT_CHECK_OBJDIR], [AC_CACHE_CHECK([for objdir], [lt_cv_objdir], [rm -f .libs 2>/dev/null mkdir .libs 2>/dev/null if test -d .libs; then lt_cv_objdir=.libs else # MS-DOS does not allow filenames that begin with a dot. lt_cv_objdir=_libs fi rmdir .libs 2>/dev/null]) objdir=$lt_cv_objdir _LT_DECL([], [objdir], [0], [The name of the directory that contains temporary libtool files])dnl m4_pattern_allow([LT_OBJDIR])dnl AC_DEFINE_UNQUOTED(LT_OBJDIR, "$lt_cv_objdir/", [Define to the sub-directory in which libtool stores uninstalled libraries.]) ])# _LT_CHECK_OBJDIR # _LT_LINKER_HARDCODE_LIBPATH([TAGNAME]) # -------------------------------------- # Check hardcoding attributes. m4_defun([_LT_LINKER_HARDCODE_LIBPATH], [AC_MSG_CHECKING([how to hardcode library paths into programs]) _LT_TAGVAR(hardcode_action, $1)= if test -n "$_LT_TAGVAR(hardcode_libdir_flag_spec, $1)" || test -n "$_LT_TAGVAR(runpath_var, $1)" || test "X$_LT_TAGVAR(hardcode_automatic, $1)" = "Xyes" ; then # We can hardcode non-existent directories. if test "$_LT_TAGVAR(hardcode_direct, $1)" != no && # If the only mechanism to avoid hardcoding is shlibpath_var, we # have to relink, otherwise we might link with an installed library # when we should be linking with a yet-to-be-installed one ## test "$_LT_TAGVAR(hardcode_shlibpath_var, $1)" != no && test "$_LT_TAGVAR(hardcode_minus_L, $1)" != no; then # Linking always hardcodes the temporary library directory. _LT_TAGVAR(hardcode_action, $1)=relink else # We can link without hardcoding, and we can hardcode nonexisting dirs. _LT_TAGVAR(hardcode_action, $1)=immediate fi else # We cannot hardcode anything, or else we can only hardcode existing # directories. _LT_TAGVAR(hardcode_action, $1)=unsupported fi AC_MSG_RESULT([$_LT_TAGVAR(hardcode_action, $1)]) if test "$_LT_TAGVAR(hardcode_action, $1)" = relink || test "$_LT_TAGVAR(inherit_rpath, $1)" = yes; then # Fast installation is not supported enable_fast_install=no elif test "$shlibpath_overrides_runpath" = yes || test "$enable_shared" = no; then # Fast installation is not necessary enable_fast_install=needless fi _LT_TAGDECL([], [hardcode_action], [0], [How to hardcode a shared library path into an executable]) ])# _LT_LINKER_HARDCODE_LIBPATH # _LT_CMD_STRIPLIB # ---------------- m4_defun([_LT_CMD_STRIPLIB], [m4_require([_LT_DECL_EGREP]) striplib= old_striplib= AC_MSG_CHECKING([whether stripping libraries is possible]) if test -n "$STRIP" && $STRIP -V 2>&1 | $GREP "GNU strip" >/dev/null; then test -z "$old_striplib" && old_striplib="$STRIP --strip-debug" test -z "$striplib" && striplib="$STRIP --strip-unneeded" AC_MSG_RESULT([yes]) else # FIXME - insert some real tests, host_os isn't really good enough case $host_os in darwin*) if test -n "$STRIP" ; then striplib="$STRIP -x" old_striplib="$STRIP -S" AC_MSG_RESULT([yes]) else AC_MSG_RESULT([no]) fi ;; *) AC_MSG_RESULT([no]) ;; esac fi _LT_DECL([], [old_striplib], [1], [Commands to strip libraries]) _LT_DECL([], [striplib], [1]) ])# _LT_CMD_STRIPLIB # _LT_SYS_DYNAMIC_LINKER([TAG]) # ----------------------------- # PORTME Fill in your ld.so characteristics m4_defun([_LT_SYS_DYNAMIC_LINKER], [AC_REQUIRE([AC_CANONICAL_HOST])dnl m4_require([_LT_DECL_EGREP])dnl 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], [], [ if test "$GCC" = yes; then case $host_os in darwin*) lt_awk_arg="/^libraries:/,/LR/" ;; *) lt_awk_arg="/^libraries:/" ;; esac 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 '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= lt_multi_os_dir=`$CC $CPPFLAGS $CFLAGS $LDFLAGS -print-multi-os-directory 2>/dev/null` for lt_sys_path in $lt_search_path_spec; do if test -d "$lt_sys_path/$lt_multi_os_dir"; then lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path/$lt_multi_os_dir" else test -d "$lt_sys_path" && \ 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 ' BEGIN {RS=" "; FS="/|\n";} { lt_foo=""; lt_count=0; for (lt_i = NF; lt_i > 0; lt_i--) { if ($lt_i != "" && $lt_i != ".") { if ($lt_i == "..") { lt_count++; } else { if (lt_count == 0) { lt_foo="/" $lt_i lt_foo; } else { lt_count--; } } } } if (lt_foo != "") { lt_freq[[lt_foo]]++; } if (lt_freq[[lt_foo]] == 1) { print lt_foo; } }'` # 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]) library_names_spec= libname_spec='lib$name' soname_spec= shrext_cmds=".so" postinstall_cmds= postuninstall_cmds= finish_cmds= finish_eval= shlibpath_var= shlibpath_overrides_runpath=unknown version_type=none dynamic_linker="$host_os ld.so" sys_lib_dlsearch_path_spec="/lib /usr/lib" need_lib_prefix=unknown hardcode_into_libs=no # when you set need_version to no, make sure it does not cause -set_version # flags to be left without arguments need_version=unknown case $host_os in aix3*) 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 # AIX 3 has no versioning support, so we append a major version to the name. soname_spec='${libname}${release}${shared_ext}$major' ;; aix[[4-9]]*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no hardcode_into_libs=yes if test "$host_cpu" = ia64; then # AIX 5 supports IA64 library_names_spec='${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext}$versuffix $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH else # With GCC up to 2.95.x, collect2 would create an import file # for dependence libraries. The import file would start with # the line `#! .'. This would cause the generated library to # depend on `.', always an invalid library. This was fixed in # development snapshots of GCC prior to 3.0. case $host_os in aix4 | aix4.[[01]] | aix4.[[01]].*) if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)' echo ' yes ' echo '#endif'; } | ${CC} -E - | $GREP yes > /dev/null; then : else can_build_shared=no fi ;; esac # AIX (on Power*) has no versioning support, so currently we can not hardcode correct # soname into executable. Probably we can add versioning support to # collect2, so additional links can be useful in future. if test "$aix_use_runtimelinking" = yes; then # If using run time linking (on AIX 4.2 or later) use lib.so # instead of lib.a to let people know that these are not # typical AIX shared libraries. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' else # We preserve .a as extension for shared libraries through AIX4.2 # and later when we are not doing run time linking. library_names_spec='${libname}${release}.a $libname.a' soname_spec='${libname}${release}${shared_ext}$major' fi shlibpath_var=LIBPATH fi ;; amigaos*) case $host_cpu in powerpc) # Since July 2007 AmigaOS4 officially supports .so libraries. # When compiling the executable, add -use-dynld -Lsobjs: to the compileline. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' ;; 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=`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 ;; beos*) library_names_spec='${libname}${shared_ext}' dynamic_linker="$host_os ld.so" shlibpath_var=LIBRARY_PATH ;; bsdi[[45]]*) 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' finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir' shlibpath_var=LD_LIBRARY_PATH sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib" sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib" # the default ld.so.conf also contains /usr/contrib/lib and # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow # libtool to hard-code these into programs ;; cygwin* | mingw* | pw32* | cegcc*) version_type=windows shrext_cmds=".dll" need_version=no need_lib_prefix=no 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}`~ 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~ chmod a+x \$dldir/$dlname~ if test -n '\''$stripme'\'' && test -n '\''$striplib'\''; then eval '\''$striplib \$dldir/$dlname'\'' || exit \$?; fi' postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ dlpath=$dir/\$dldll~ $RM \$dlpath' shlibpath_overrides_runpath=yes case $host_os in 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}' 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}' ;; 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 # FIXME: first we should search . and the directory the executable is in shlibpath_var=PATH ;; darwin* | rhapsody*) dynamic_linker="$host_os dyld" version_type=darwin need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${major}$shared_ext ${libname}$shared_ext' soname_spec='${libname}${release}${major}$shared_ext' shlibpath_overrides_runpath=yes shlibpath_var=DYLD_LIBRARY_PATH shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`' m4_if([$1], [],[ sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/local/lib"]) sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib' ;; dgux*) 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 ;; freebsd* | dragonfly*) # DragonFly does not have aout. When/if they implement a new # versioning mechanism, adjust this. if test -x /usr/bin/objformat; then objformat=`/usr/bin/objformat` else case $host_os in freebsd[[23]].*) objformat=aout ;; *) objformat=elf ;; esac fi version_type=freebsd-$objformat case $version_type in freebsd-elf*) library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}' need_version=no need_lib_prefix=no ;; freebsd-*) library_names_spec='${libname}${release}${shared_ext}$versuffix $libname${shared_ext}$versuffix' need_version=yes ;; esac shlibpath_var=LD_LIBRARY_PATH case $host_os in freebsd2.*) shlibpath_overrides_runpath=yes ;; freebsd3.[[01]]* | freebsdelf3.[[01]]*) shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; freebsd3.[[2-9]]* | freebsdelf3.[[2-9]]* | \ freebsd4.[[0-5]] | freebsdelf4.[[0-5]] | freebsd4.1.1 | freebsdelf4.1.1) shlibpath_overrides_runpath=no hardcode_into_libs=yes ;; *) # from 4.6 on, and DragonFly shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; esac ;; 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}' 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 ;; hpux9* | hpux10* | hpux11*) # Give a soname corresponding to the major version so that dld.sl refuses to # link against other versions. version_type=sunos need_lib_prefix=no need_version=no case $host_cpu in ia64*) shrext_cmds='.so' hardcode_into_libs=yes dynamic_linker="$host_os dld.so" shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' if test "X$HPUX_IA64_MODE" = X32; then sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib" else sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64" fi sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec ;; hppa*64*) shrext_cmds='.sl' hardcode_into_libs=yes dynamic_linker="$host_os dld.sl" shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64" sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec ;; *) shrext_cmds='.sl' dynamic_linker="$host_os dld.sl" shlibpath_var=SHLIB_PATH shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' ;; esac # 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 # 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' dynamic_linker='Interix 3.x ld.so.1 (PE, like ELF)' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes ;; irix5* | irix6* | nonstopux*) case $host_os in nonstopux*) version_type=nonstopux ;; *) if test "$lt_cv_prog_gnu_ld" = yes; then version_type=linux # correct to gnu/linux during the next big refactor else version_type=irix fi ;; esac need_lib_prefix=no need_version=no soname_spec='${libname}${release}${shared_ext}$major' library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext} $libname${shared_ext}' case $host_os in irix5* | nonstopux*) libsuff= shlibsuff= ;; *) case $LD in # libtool.m4 will add one of these switches to LD *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ") libsuff= shlibsuff= libmagic=32-bit;; *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ") libsuff=32 shlibsuff=N32 libmagic=N32;; *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ") libsuff=64 shlibsuff=64 libmagic=64-bit;; *) libsuff= shlibsuff= libmagic=never-match;; esac ;; esac shlibpath_var=LD_LIBRARY${shlibsuff}_PATH shlibpath_overrides_runpath=no sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}" sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}" hardcode_into_libs=yes ;; # No shared lib support for Linux oldld, aout, or coff. linux*oldld* | linux*aout* | linux*coff*) dynamic_linker=no ;; # 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}' soname_spec='${libname}${release}${shared_ext}$major' 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 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 # 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;s/"//g;/^$/d' | tr '\n' ' '` sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra" fi # We used to test for /lib/ld.so.1 and disable shared libraries on # powerpc, because MkLinux only supported shared libraries with the # GNU dynamic linker. Since this was broken with cross compilers, # most powerpc-linux boxes support dynamic linking these days and # people can always --disable-shared, the test was removed, and we # assume the GNU/Linux dynamic linker is in use. dynamic_linker='GNU/Linux ld.so' ;; netbsdelf*-gnu) version_type=linux 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 dynamic_linker='NetBSD ld.elf_so' ;; netbsd*) version_type=sunos need_lib_prefix=no need_version=no if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' dynamic_linker='NetBSD (a.out) ld.so' else library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' dynamic_linker='NetBSD ld.elf_so' fi shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; newsos6) 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 ;; *nto* | *qnx*) version_type=qnx 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 dynamic_linker='ldqnx.so' ;; openbsd*) version_type=sunos sys_lib_dlsearch_path_spec="/usr/lib" need_lib_prefix=no # Some older versions of OpenBSD (3.3 at least) *do* need versioned libs. case $host_os in openbsd3.3 | openbsd3.3.*) need_version=yes ;; *) need_version=no ;; esac library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' shlibpath_var=LD_LIBRARY_PATH if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then case $host_os in openbsd2.[[89]] | openbsd2.[[89]].*) shlibpath_overrides_runpath=no ;; *) shlibpath_overrides_runpath=yes ;; esac else shlibpath_overrides_runpath=yes fi ;; os2*) libname_spec='$name' shrext_cmds=".dll" need_lib_prefix=no library_names_spec='$libname${shared_ext} $libname.a' dynamic_linker='OS/2 ld.exe' shlibpath_var=LIBPATH ;; osf3* | osf4* | osf5*) version_type=osf need_lib_prefix=no need_version=no soname_spec='${libname}${release}${shared_ext}$major' library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib" sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec" ;; rdos*) dynamic_linker=no ;; solaris*) 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=yes hardcode_into_libs=yes # ldd complains unless libraries are executable postinstall_cmds='chmod +x $lib' ;; sunos4*) version_type=sunos library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes if test "$with_gnu_ld" = yes; then need_lib_prefix=no fi need_version=yes ;; sysv4 | sysv4.3*) 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 case $host_vendor in sni) shlibpath_overrides_runpath=no need_lib_prefix=no runpath_var=LD_RUN_PATH ;; siemens) need_lib_prefix=no ;; motorola) need_lib_prefix=no need_version=no shlibpath_overrides_runpath=no sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib' ;; esac ;; sysv4*MP*) if test -d /usr/nec ;then 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 fi ;; sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) version_type=freebsd-elf need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes hardcode_into_libs=yes if test "$with_gnu_ld" = yes; then sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib' else sys_lib_search_path_spec='/usr/ccs/lib /usr/lib' case $host_os in sco3.2v5*) sys_lib_search_path_spec="$sys_lib_search_path_spec /lib" ;; esac fi sys_lib_dlsearch_path_spec='/usr/lib' ;; tpf*) # TPF is a cross-target only. Preferred cross-host = GNU/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}' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes ;; uts4*) 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 ;; *) dynamic_linker=no ;; esac AC_MSG_RESULT([$dynamic_linker]) test "$dynamic_linker" = no && can_build_shared=no variables_saved_for_relink="PATH $shlibpath_var $runpath_var" if test "$GCC" = yes; then variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH" fi if test "${lt_cv_sys_lib_search_path_spec+set}" = set; then sys_lib_search_path_spec="$lt_cv_sys_lib_search_path_spec" fi if test "${lt_cv_sys_lib_dlsearch_path_spec+set}" = set; then sys_lib_dlsearch_path_spec="$lt_cv_sys_lib_dlsearch_path_spec" fi _LT_DECL([], [variables_saved_for_relink], [1], [Variables whose values should be saved in libtool wrapper scripts and restored at link time]) _LT_DECL([], [need_lib_prefix], [0], [Do we need the "lib" prefix for modules?]) _LT_DECL([], [need_version], [0], [Do we need a version for libraries?]) _LT_DECL([], [version_type], [0], [Library versioning type]) _LT_DECL([], [runpath_var], [0], [Shared library runtime path variable]) _LT_DECL([], [shlibpath_var], [0],[Shared library path variable]) _LT_DECL([], [shlibpath_overrides_runpath], [0], [Is shlibpath searched before the hard-coded library search path?]) _LT_DECL([], [libname_spec], [1], [Format of library name prefix]) _LT_DECL([], [library_names_spec], [1], [[List of archive names. First name is the real one, the rest are links. 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], [Command to use after uninstallation of a shared archive]) _LT_DECL([], [finish_cmds], [2], [Commands used to finish a libtool library installation in a directory]) _LT_DECL([], [finish_eval], [1], [[As "finish_cmds", except a single script fragment to be evaled but not shown]]) _LT_DECL([], [hardcode_into_libs], [0], [Whether we should hardcode library paths into libraries]) _LT_DECL([], [sys_lib_search_path_spec], [2], [Compile-time system search path for libraries]) _LT_DECL([], [sys_lib_dlsearch_path_spec], [2], [Run-time system search path for libraries]) ])# _LT_SYS_DYNAMIC_LINKER # _LT_PATH_TOOL_PREFIX(TOOL) # -------------------------- # find a file program which can recognize shared library AC_DEFUN([_LT_PATH_TOOL_PREFIX], [m4_require([_LT_DECL_EGREP])dnl AC_MSG_CHECKING([for $1]) AC_CACHE_VAL(lt_cv_path_MAGIC_CMD, [case $MAGIC_CMD in [[\\/*] | ?:[\\/]*]) lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path. ;; *) lt_save_MAGIC_CMD="$MAGIC_CMD" lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR dnl $ac_dummy forces splitting on constant user-supplied paths. dnl POSIX.2 word splitting is done only on the output of word expansions, dnl not every word. This closes a longstanding sh security hole. ac_dummy="m4_if([$2], , $PATH, [$2])" for ac_dir in $ac_dummy; do IFS="$lt_save_ifs" test -z "$ac_dir" && ac_dir=. if test -f $ac_dir/$1; then lt_cv_path_MAGIC_CMD="$ac_dir/$1" if test -n "$file_magic_test_file"; then case $deplibs_check_method in "file_magic "*) file_magic_regex=`expr "$deplibs_check_method" : "file_magic \(.*\)"` MAGIC_CMD="$lt_cv_path_MAGIC_CMD" if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null | $EGREP "$file_magic_regex" > /dev/null; then : else cat <<_LT_EOF 1>&2 *** Warning: the command libtool uses to detect shared libraries, *** $file_magic_cmd, produces output that libtool cannot recognize. *** The result is that libtool may fail to recognize shared libraries *** as such. This will affect the creation of libtool libraries that *** depend on shared libraries, but programs linked with such libtool *** libraries will work regardless of this problem. Nevertheless, you *** may want to report the problem to your system manager and/or to *** bug-libtool@gnu.org _LT_EOF fi ;; esac fi break fi done IFS="$lt_save_ifs" MAGIC_CMD="$lt_save_MAGIC_CMD" ;; esac]) MAGIC_CMD="$lt_cv_path_MAGIC_CMD" if test -n "$MAGIC_CMD"; then AC_MSG_RESULT($MAGIC_CMD) else AC_MSG_RESULT(no) fi _LT_DECL([], [MAGIC_CMD], [0], [Used to examine libraries when file_magic_cmd begins with "file"])dnl ])# _LT_PATH_TOOL_PREFIX # Old name: AU_ALIAS([AC_PATH_TOOL_PREFIX], [_LT_PATH_TOOL_PREFIX]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_PATH_TOOL_PREFIX], []) # _LT_PATH_MAGIC # -------------- # find a file program which can recognize a shared library m4_defun([_LT_PATH_MAGIC], [_LT_PATH_TOOL_PREFIX(${ac_tool_prefix}file, /usr/bin$PATH_SEPARATOR$PATH) if test -z "$lt_cv_path_MAGIC_CMD"; then if test -n "$ac_tool_prefix"; then _LT_PATH_TOOL_PREFIX(file, /usr/bin$PATH_SEPARATOR$PATH) else MAGIC_CMD=: fi fi ])# _LT_PATH_MAGIC # LT_PATH_LD # ---------- # find the pathname to the GNU or non-GNU linker AC_DEFUN([LT_PATH_LD], [AC_REQUIRE([AC_PROG_CC])dnl AC_REQUIRE([AC_CANONICAL_HOST])dnl 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], [assume the C compiler uses GNU ld @<:@default=no@:>@])], [test "$withval" = no || with_gnu_ld=yes], [with_gnu_ld=no])dnl ac_prog=ld if test "$GCC" = yes; then # Check if gcc -print-prog-name=ld gives a path. AC_MSG_CHECKING([for ld used by $CC]) case $host in *-*-mingw*) # gcc leaves a trailing carriage return which upsets mingw ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;; *) ac_prog=`($CC -print-prog-name=ld) 2>&5` ;; esac case $ac_prog in # Accept absolute paths. [[\\/]]* | ?:[[\\/]]*) re_direlt='/[[^/]][[^/]]*/\.\./' # Canonicalize the pathname of ld ac_prog=`$ECHO "$ac_prog"| $SED 's%\\\\%/%g'` while $ECHO "$ac_prog" | $GREP "$re_direlt" > /dev/null 2>&1; do ac_prog=`$ECHO $ac_prog| $SED "s%$re_direlt%/%"` done test -z "$LD" && LD="$ac_prog" ;; "") # If it fails, then pretend we aren't using GCC. ac_prog=ld ;; *) # If it is relative, then search for the first ld in PATH. with_gnu_ld=unknown ;; esac elif test "$with_gnu_ld" = yes; then AC_MSG_CHECKING([for GNU ld]) else AC_MSG_CHECKING([for non-GNU ld]) fi AC_CACHE_VAL(lt_cv_path_LD, [if test -z "$LD"; then lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR for ac_dir in $PATH; do IFS="$lt_save_ifs" test -z "$ac_dir" && ac_dir=. if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then lt_cv_path_LD="$ac_dir/$ac_prog" # Check to see if the program is GNU ld. I'd rather use --version, # but apparently some variants of GNU ld only accept -v. # Break only if it was the GNU/non-GNU ld that we prefer. case `"$lt_cv_path_LD" -v 2>&1 &1 /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 # 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*) # 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' ;; darwin* | rhapsody*) lt_cv_deplibs_check_method=pass_all ;; freebsd* | dragonfly*) if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then case $host_cpu in i*86 ) # Not sure whether the presence of OpenBSD here was a mistake. # Let's accept both of them until this is cleared up. lt_cv_deplibs_check_method='file_magic (FreeBSD|OpenBSD|DragonFly)/i[[3-9]]86 (compact )?demand paged shared library' lt_cv_file_magic_cmd=/usr/bin/file lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*` ;; esac else lt_cv_deplibs_check_method=pass_all fi ;; gnu*) 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 ia64*) lt_cv_deplibs_check_method='file_magic (s[[0-9]][[0-9]][[0-9]]|ELF-[[0-9]][[0-9]]) shared object file - IA64' 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])(-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_file_magic_test_file=/usr/lib/libc.sl ;; esac ;; interix[[3-9]]*) # PIC code is broken on Interix 3.x, that's why |\.a not |_pic\.a here lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so|\.a)$' ;; irix5* | irix6* | nonstopux*) case $LD in *-32|*"-32 ") libmagic=32-bit;; *-n32|*"-n32 ") libmagic=N32;; *-64|*"-64 ") libmagic=64-bit;; *) libmagic=never-match;; esac lt_cv_deplibs_check_method=pass_all ;; # This must be glibc/ELF. linux* | k*bsd*-gnu | kopensolaris*-gnu) lt_cv_deplibs_check_method=pass_all ;; netbsd* | netbsdelf*-gnu) if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|_pic\.a)$' else lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so|_pic\.a)$' fi ;; newos6*) lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (executable|dynamic lib)' lt_cv_file_magic_cmd=/usr/bin/file lt_cv_file_magic_test_file=/usr/lib/libnls.so ;; *nto* | *qnx*) lt_cv_deplibs_check_method=pass_all ;; openbsd*) if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|\.so|_pic\.a)$' else lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|_pic\.a)$' fi ;; osf3* | osf4* | osf5*) lt_cv_deplibs_check_method=pass_all ;; rdos*) lt_cv_deplibs_check_method=pass_all ;; solaris*) lt_cv_deplibs_check_method=pass_all ;; sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) lt_cv_deplibs_check_method=pass_all ;; sysv4 | sysv4.3*) case $host_vendor in motorola) lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (shared object|dynamic lib) M[[0-9]][[0-9]]* Version [[0-9]]' lt_cv_file_magic_test_file=`echo /usr/lib/libc.so*` ;; ncr) lt_cv_deplibs_check_method=pass_all ;; sequent) lt_cv_file_magic_cmd='/bin/file' lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB (shared object|dynamic lib )' ;; sni) lt_cv_file_magic_cmd='/bin/file' lt_cv_deplibs_check_method="file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB dynamic lib" lt_cv_file_magic_test_file=/lib/libc.so ;; siemens) lt_cv_deplibs_check_method=pass_all ;; pc) lt_cv_deplibs_check_method=pass_all ;; esac ;; tpf*) lt_cv_deplibs_check_method=pass_all ;; 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 _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"]) _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 # LT_PATH_NM # ---------- # find the pathname to a BSD- or MS-compatible name lister AC_DEFUN([LT_PATH_NM], [AC_REQUIRE([AC_PROG_CC])dnl AC_CACHE_CHECK([for BSD- or MS-compatible name lister (nm)], lt_cv_path_NM, [if test -n "$NM"; then # Let the user override the test. lt_cv_path_NM="$NM" else lt_nm_to_check="${ac_tool_prefix}nm" if test -n "$ac_tool_prefix" && test "$build" = "$host"; then lt_nm_to_check="$lt_nm_to_check nm" fi for lt_tmp_nm in $lt_nm_to_check; do lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR for ac_dir in $PATH /usr/ccs/bin/elf /usr/ccs/bin /usr/ucb /bin; do IFS="$lt_save_ifs" test -z "$ac_dir" && ac_dir=. tmp_nm="$ac_dir/$lt_tmp_nm" if test -f "$tmp_nm" || test -f "$tmp_nm$ac_exeext" ; then # Check to see if the nm accepts a BSD-compat flag. # Adding the `sed 1q' prevents false positives on HP-UX, which says: # nm: unknown option "B" ignored # Tru64's nm complains that /dev/null is an invalid object file case `"$tmp_nm" -B /dev/null 2>&1 | sed '1q'` in */dev/null* | *'Invalid file or object type'*) lt_cv_path_NM="$tmp_nm -B" break ;; *) case `"$tmp_nm" -p /dev/null 2>&1 | sed '1q'` in */dev/null*) lt_cv_path_NM="$tmp_nm -p" break ;; *) lt_cv_path_NM=${lt_cv_path_NM="$tmp_nm"} # keep the first match, but continue # so that we can try to find one that supports BSD flags ;; esac ;; esac fi done IFS="$lt_save_ifs" done : ${lt_cv_path_NM=no} fi]) if test "$lt_cv_path_NM" != "no"; then NM="$lt_cv_path_NM" else # Didn't find any BSD compatible name lister, look for dumpbin. 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" fi fi test -z "$NM" && NM=nm AC_SUBST([NM]) _LT_DECL([], [NM], [1], [A BSD- or MS-compatible name lister])dnl 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:$LINENO: $ac_compile\"" >&AS_MESSAGE_LOG_FD) (eval "$ac_compile" 2>conftest.err) cat conftest.err >&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:$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" fi rm -f conftest*]) ])# LT_PATH_NM # Old names: AU_ALIAS([AM_PROG_NM], [LT_PATH_NM]) AU_ALIAS([AC_PROG_NM], [LT_PATH_NM]) dnl aclocal-1.4 backwards compatibility: 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' 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* | *-*-cegcc* | *-*-cygwin* | *-*-haiku* | *-*-pw32* | *-*-darwin*) # These system don't have libm, or don't need it ;; *-ncr-sysv4.3*) AC_CHECK_LIB(mw, _mwvalidcheckl, LIBM="-lmw") AC_CHECK_LIB(m, cos, LIBM="$LIBM -lm") ;; *) AC_CHECK_LIB(m, cos, LIBM="-lm") ;; esac AC_SUBST([LIBM]) ])# LT_LIB_M # Old name: AU_ALIAS([AC_CHECK_LIBM], [LT_LIB_M]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_CHECK_LIBM], []) # _LT_COMPILER_NO_RTTI([TAGNAME]) # ------------------------------- m4_defun([_LT_COMPILER_NO_RTTI], [m4_require([_LT_TAG_COMPILER])dnl _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)= if test "$GCC" = yes; then 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, [-fno-rtti -fno-exceptions], [], [_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)="$_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1) -fno-rtti -fno-exceptions"]) fi _LT_TAGDECL([no_builtin_flag], [lt_prog_compiler_no_builtin_flag], [1], [Compiler flag to turn off builtin functions]) ])# _LT_COMPILER_NO_RTTI # _LT_CMD_GLOBAL_SYMBOLS # ---------------------- 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 m4_require([_LT_DECL_EGREP])dnl m4_require([_LT_TAG_COMPILER])dnl # Check for command to grab the raw symbol name followed by C symbol from nm. AC_MSG_CHECKING([command to parse $NM output from $compiler object]) AC_CACHE_VAL([lt_cv_sys_global_symbol_pipe], [ # These are sane defaults that work on at least a few old systems. # [They come from Ultrix. What could be older than Ultrix?!! ;)] # Character class describing NM global symbol codes. symcode='[[BCDEGRST]]' # Regexp to match symbols that can be accessed directly from C. sympat='\([[_A-Za-z]][[_A-Za-z0-9]]*\)' # Define system-specific variables. case $host_os in aix*) symcode='[[BCDT]]' ;; cygwin* | mingw* | pw32* | cegcc*) symcode='[[ABCDGISTW]]' ;; hpux*) if test "$host_cpu" = ia64; then symcode='[[ABCDEGRST]]' fi ;; irix* | nonstopux*) symcode='[[BCDEGRST]]' ;; osf*) symcode='[[BCDEGQRST]]' ;; solaris*) symcode='[[BDRT]]' ;; sco3.2v5*) symcode='[[DT]]' ;; sysv4.2uw2*) symcode='[[DT]]' ;; sysv5* | sco5v6* | unixware* | OpenUNIX*) symcode='[[ABDT]]' ;; sysv4) symcode='[[DFNSTU]]' ;; esac # If we're using GNU nm, then use its standard symbol codes. case `$NM -V 2>&1` in *GNU* | *'with BFD'*) symcode='[[ABCDGIRSTW]]' ;; esac # Transform an extracted symbol line into a proper C declaration. # Some systems (esp. on ia64) link data and code symbols differently, # so use this general approach. 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'" # Handle CRLF in mingw tool chain opt_cr= case $build_os in mingw*) opt_cr=`$ECHO 'x\{0,1\}' | tr x '\015'` # option cr in regexp ;; esac # Try without a prefix underscore, then with it. for ac_symprfx in "" "_"; do # Transform symcode, sympat, and symprfx into a raw symbol and a C symbol. symxfrm="\\1 $ac_symprfx\\2 \\2" # Write the raw and C identifiers. if test "$lt_cv_nm_interface" = "MS dumpbin"; then # Fake it for dumpbin and say T for any non-static function # and D for any global variable. # Also find C++ and __fastcall symbols from MSVC++, # 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};"\ " {if(hide[section]) next};"\ " {f=0}; \$ 0~/\(\).*\|/{f=1}; {printf f ? \"T \" : \"D \"};"\ " {split(\$ 0, a, /\||\r/); split(a[2], s)};"\ " s[1]~/^[@?]/{print s[1], s[1]; next};"\ " s[1]~prfx {split(s[1],t,\"@\"); print t[1], substr(t[1],length(prfx))}"\ " ' prfx=^$ac_symprfx]" 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 rm -f conftest* cat > conftest.$ac_ext <<_LT_EOF #ifdef __cplusplus extern "C" { #endif char nm_test_var; void nm_test_func(void); void nm_test_func(void){} #ifdef __cplusplus } #endif int main(){nm_test_var='a';nm_test_func();return(0);} _LT_EOF 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 # Try sorting and uniquifying the output. if sort "$nlist" | uniq > "$nlist"T; then mv -f "$nlist"T "$nlist" else rm -f "$nlist"T fi # Make sure that we snagged all the symbols we need. 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 _LT_EOF # Now generate the symbol file. eval "$lt_cv_sys_global_symbol_to_cdecl"' < "$nlist" | $GREP -v main >> conftest.$ac_ext' cat <<_LT_EOF >> conftest.$ac_ext /* The mapping between symbol names and symbols. */ LT@&t@_DLSYM_CONST struct { const char *name; void *address; } lt__PROGRAM__LTX_preloaded_symbols[[]] = { { "@PROGRAM@", (void *) 0 }, _LT_EOF $SED "s/^$symcode$symcode* \(.*\) \(.*\)$/ {\"\2\", (void *) \&\2},/" < "$nlist" | $GREP -v main >> conftest.$ac_ext cat <<\_LT_EOF >> conftest.$ac_ext {0, (void *) 0} }; /* This works around a problem in FreeBSD linker */ #ifdef FREEBSD_WORKAROUND static const void *lt_preloaded_setup() { return lt__PROGRAM__LTX_preloaded_symbols; } #endif #ifdef __cplusplus } #endif _LT_EOF # Now try linking the two files. mv conftest.$ac_objext conftstm.$ac_objext 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_globsym_save_LIBS CFLAGS=$lt_globsym_save_CFLAGS else echo "cannot find nm_test_func in $nlist" >&AS_MESSAGE_LOG_FD fi else echo "cannot find nm_test_var in $nlist" >&AS_MESSAGE_LOG_FD fi else echo "cannot run $lt_cv_sys_global_symbol_pipe" >&AS_MESSAGE_LOG_FD fi else echo "$progname: failed program was:" >&AS_MESSAGE_LOG_FD cat conftest.$ac_ext >&5 fi rm -rf conftest* conftst* # Do not use the global_symbol_pipe unless it works. if test "$pipe_works" = yes; then break else lt_cv_sys_global_symbol_pipe= fi done ]) if test -z "$lt_cv_sys_global_symbol_pipe"; then lt_cv_sys_global_symbol_to_cdecl= fi if test -z "$lt_cv_sys_global_symbol_pipe$lt_cv_sys_global_symbol_to_cdecl"; then AC_MSG_RESULT(failed) else 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], [Transform the output of nm in a proper C declaration]) _LT_DECL([global_symbol_to_c_name_address], [lt_cv_sys_global_symbol_to_c_name_address], [1], [Transform the output of nm in a C name address pair]) _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 # _LT_COMPILER_PIC([TAGNAME]) # --------------------------- m4_defun([_LT_COMPILER_PIC], [m4_require([_LT_TAG_COMPILER])dnl _LT_TAGVAR(lt_prog_compiler_wl, $1)= _LT_TAGVAR(lt_prog_compiler_pic, $1)= _LT_TAGVAR(lt_prog_compiler_static, $1)= m4_if([$1], [CXX], [ # C++ specific cases for pic, static, wl, etc. if test "$GXX" = yes; then _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' case $host_os in aix*) # All AIX code is PIC. if test "$host_cpu" = ia64; then # AIX 5 now supports IA64 processor _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' fi ;; amigaos*) case $host_cpu in powerpc) # see comment about AmigaOS4 .so support _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' ;; m68k) # FIXME: we need at least 68020 code to build shared libraries, but # adding the `-m68020' flag to GCC prevents building anything better, # like `-m68040'. _LT_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4' ;; esac ;; beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) # PIC is the default for these OSes. ;; 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). # Although the cygwin gcc ignores -fPIC, still need this for old-style # (--disable-auto-import) libraries m4_if([$1], [GCJ], [], [_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT']) ;; darwin* | rhapsody*) # PIC is the default on this platform # Common symbols not allowed in MH_DYLIB files _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common' ;; *djgpp*) # 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. ;; sysv4*MP*) if test -d /usr/nec; then _LT_TAGVAR(lt_prog_compiler_pic, $1)=-Kconform_pic fi ;; 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 # sets the default TLS model and affects inlining. case $host_cpu in hppa*64*) ;; *) _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' ;; esac ;; *qnx* | *nto*) # QNX uses GNU C++, but need to define -shared option too, otherwise # it will coredump. _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared' ;; *) _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' ;; esac else case $host_os in aix[[4-9]]*) # All AIX code is PIC. if test "$host_cpu" = ia64; then # AIX 5 now supports IA64 processor _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' else _LT_TAGVAR(lt_prog_compiler_static, $1)='-bnso -bI:/lib/syscalls.exp' fi ;; chorus*) case $cc_basename in cxch68*) # Green Hills C++ Compiler # _LT_TAGVAR(lt_prog_compiler_static, $1)="--no_auto_instantiation -u __main -u __premain -u _abort -r $COOL_DIR/lib/libOrb.a $MVME_DIR/lib/CC/libC.a $MVME_DIR/lib/classix/libcx.s.a" ;; 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++*) _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' ;; ghcx*) # Green Hills C++ Compiler _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic' ;; *) ;; esac ;; freebsd* | dragonfly*) # FreeBSD uses GNU C++ ;; hpux9* | hpux10* | hpux11*) case $cc_basename in CC*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive' if test "$host_cpu" != ia64; then _LT_TAGVAR(lt_prog_compiler_pic, $1)='+Z' fi ;; aCC*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive' case $host_cpu in hppa*64*|ia64*) # +Z the default ;; *) _LT_TAGVAR(lt_prog_compiler_pic, $1)='+Z' ;; esac ;; *) ;; esac ;; interix*) # This is c89, which is MS Visual C++ (no shared libs) # Anyone wants to do a port? ;; irix5* | irix6* | nonstopux*) case $cc_basename in CC*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' # CC pic flag -KPIC is the default. ;; *) ;; esac ;; linux* | k*bsd*-gnu | kopensolaris*-gnu) case $cc_basename in KCC*) # KAI C++ Compiler _LT_TAGVAR(lt_prog_compiler_wl, $1)='--backend -Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' ;; ecpc* ) # old Intel C++ for x86_64 which still supported -KPIC. _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' ;; icpc* ) # Intel C++, used to be incompatible with GCC. # ICC 10 doesn't accept -KPIC any more. _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' ;; pgCC* | pgcpp*) # Portland Group C++ compiler _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fpic' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; cxx*) # Compaq C++ # Make sure the PIC flag is empty. It appears that all Alpha # Linux and Compaq Tru64 Unix objects are PIC. _LT_TAGVAR(lt_prog_compiler_pic, $1)= _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' ;; 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' ;; *) case `$CC -V 2>&1 | sed 5q` in *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)='-Qoption ld ' ;; esac ;; esac ;; lynxos*) ;; m88k*) ;; mvs*) case $cc_basename in cxx*) _LT_TAGVAR(lt_prog_compiler_pic, $1)='-W c,exportall' ;; *) ;; esac ;; netbsd* | netbsdelf*-gnu) ;; *qnx* | *nto*) # QNX uses GNU C++, but need to define -shared option too, otherwise # it will coredump. _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared' ;; osf3* | osf4* | osf5*) case $cc_basename in KCC*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='--backend -Wl,' ;; RCC*) # Rational C++ 2.4.1 _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic' ;; cxx*) # Digital/Compaq C++ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' # Make sure the PIC flag is empty. It appears that all Alpha # Linux and Compaq Tru64 Unix objects are PIC. _LT_TAGVAR(lt_prog_compiler_pic, $1)= _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' ;; *) ;; esac ;; psos*) ;; solaris*) case $cc_basename in 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' _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ' ;; gcx*) # Green Hills C++ Compiler _LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC' ;; *) ;; esac ;; sunos4*) case $cc_basename in CC*) # Sun C++ 4.x _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; lcc*) # Lucid _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic' ;; *) ;; esac ;; sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*) case $cc_basename in CC*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; esac ;; tandem*) case $cc_basename in NCC*) # NonStop-UX NCC 3.20 _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' ;; *) ;; esac ;; vxworks*) ;; *) _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no ;; esac fi ], [ if test "$GCC" = yes; then _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' case $host_os in aix*) # All AIX code is PIC. if test "$host_cpu" = ia64; then # AIX 5 now supports IA64 processor _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' fi ;; amigaos*) case $host_cpu in powerpc) # see comment about AmigaOS4 .so support _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' ;; m68k) # FIXME: we need at least 68020 code to build shared libraries, but # adding the `-m68020' flag to GCC prevents building anything better, # like `-m68040'. _LT_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4' ;; esac ;; beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) # PIC is the default for these OSes. ;; mingw* | cygwin* | pw32* | os2* | 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). # Although the cygwin gcc ignores -fPIC, still need this for old-style # (--disable-auto-import) libraries m4_if([$1], [GCJ], [], [_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT']) ;; darwin* | rhapsody*) # PIC is the default on this platform # Common symbols not allowed in MH_DYLIB files _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 # sets the default TLS model and affects inlining. case $host_cpu in hppa*64*) # +Z the default ;; *) _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' ;; esac ;; interix[[3-9]]*) # Interix 3.x gcc -fpic/-fPIC options generate broken code. # Instead, we relocate shared libraries at runtime. ;; msdosdjgpp*) # Just because we use GCC doesn't mean we suddenly get shared libraries # on systems that don't support them. _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no enable_shared=no ;; *nto* | *qnx*) # QNX uses GNU C++, but need to define -shared option too, otherwise # it will coredump. _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared' ;; sysv4*MP*) if test -d /usr/nec; then _LT_TAGVAR(lt_prog_compiler_pic, $1)=-Kconform_pic fi ;; *) _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 aix*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' if test "$host_cpu" = ia64; then # AIX 5 now supports IA64 processor _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' else _LT_TAGVAR(lt_prog_compiler_static, $1)='-bnso -bI:/lib/syscalls.exp' fi ;; mingw* | cygwin* | pw32* | os2* | 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']) ;; hpux9* | hpux10* | hpux11*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but # not for PA HP-UX. case $host_cpu in hppa*64*|ia64*) # +Z the default ;; *) _LT_TAGVAR(lt_prog_compiler_pic, $1)='+Z' ;; esac # Is there a better lt_prog_compiler_static that works with the bundled CC? _LT_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive' ;; irix5* | irix6* | nonstopux*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' # PIC (with -KPIC) is the default. _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' ;; linux* | k*bsd*-gnu | kopensolaris*-gnu) case $cc_basename in # old Intel for x86_64 which still supported -KPIC. ecc*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' ;; # icc used to be incompatible with GCC. # ICC 10 doesn't accept -KPIC any more. icc* | ifort*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' ;; # Lahey Fortran 8.1. lf95*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='--shared' _LT_TAGVAR(lt_prog_compiler_static, $1)='--static' ;; 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,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fpic' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; ccc*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' # All Alpha code is PIC. _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' ;; 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,' ;; *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' ;; esac ;; esac ;; newsos6) _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; *nto* | *qnx*) # QNX uses GNU C++, but need to define -shared option too, otherwise # it will coredump. _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared' ;; osf3* | osf4* | osf5*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' # All OSF/1 code is PIC. _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' ;; rdos*) _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' ;; solaris*) _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' case $cc_basename in f77* | f90* | f95* | sunf77* | sunf90* | sunf95*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ';; *) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,';; esac ;; sunos4*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; sysv4 | sysv4.2uw2* | sysv4.3*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; sysv4*MP*) if test -d /usr/nec ;then _LT_TAGVAR(lt_prog_compiler_pic, $1)='-Kconform_pic' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' fi ;; sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; unicos*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no ;; uts4*) _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; *) _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no ;; esac fi ]) case $host_os in # For platforms which do not support PIC, -DPIC is meaningless: *djgpp*) _LT_TAGVAR(lt_prog_compiler_pic, $1)= ;; *) _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_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. # if test -n "$_LT_TAGVAR(lt_prog_compiler_pic, $1)"; then _LT_COMPILER_OPTION([if $compiler PIC flag $_LT_TAGVAR(lt_prog_compiler_pic, $1) works], [_LT_TAGVAR(lt_cv_prog_compiler_pic_works, $1)], [$_LT_TAGVAR(lt_prog_compiler_pic, $1)@&t@m4_if([$1],[],[ -DPIC],[m4_if([$1],[CXX],[ -DPIC],[])])], [], [case $_LT_TAGVAR(lt_prog_compiler_pic, $1) in "" | " "*) ;; *) _LT_TAGVAR(lt_prog_compiler_pic, $1)=" $_LT_TAGVAR(lt_prog_compiler_pic, $1)" ;; esac], [_LT_TAGVAR(lt_prog_compiler_pic, $1)= _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no]) fi _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. # wl=$_LT_TAGVAR(lt_prog_compiler_wl, $1) eval lt_tmp_static_flag=\"$_LT_TAGVAR(lt_prog_compiler_static, $1)\" _LT_LINKER_OPTION([if $compiler static flag $lt_tmp_static_flag works], _LT_TAGVAR(lt_cv_prog_compiler_static_works, $1), $lt_tmp_static_flag, [], [_LT_TAGVAR(lt_prog_compiler_static, $1)=]) _LT_TAGDECL([link_static_flag], [lt_prog_compiler_static], [1], [Compiler flag to prevent dynamic linking]) ])# _LT_COMPILER_PIC # _LT_LINKER_SHLIBS([TAGNAME]) # ---------------------------- # See if the linker supports building shared libraries. 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 m4_require([_LT_CMD_GLOBAL_SYMBOLS])dnl m4_require([_LT_TAG_COMPILER])dnl 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") || (\$ 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*) 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 ;; linux* | k*bsd*-gnu | gnu*) _LT_TAGVAR(link_all_deplibs, $1)=no ;; *) _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' ;; esac ], [ runpath_var= _LT_TAGVAR(allow_undefined_flag, $1)= _LT_TAGVAR(always_export_symbols, $1)=no _LT_TAGVAR(archive_cmds, $1)= _LT_TAGVAR(archive_expsym_cmds, $1)= _LT_TAGVAR(compiler_needs_object, $1)=no _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no _LT_TAGVAR(export_dynamic_flag_spec, $1)= _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' _LT_TAGVAR(hardcode_automatic, $1)=no _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_direct_absolute, $1)=no _LT_TAGVAR(hardcode_libdir_flag_spec, $1)= _LT_TAGVAR(hardcode_libdir_separator, $1)= _LT_TAGVAR(hardcode_minus_L, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported _LT_TAGVAR(inherit_rpath, $1)=no _LT_TAGVAR(link_all_deplibs, $1)=unknown _LT_TAGVAR(module_cmds, $1)= _LT_TAGVAR(module_expsym_cmds, $1)= _LT_TAGVAR(old_archive_from_new_cmds, $1)= _LT_TAGVAR(old_archive_from_expsyms_cmds, $1)= _LT_TAGVAR(thread_safe_flag_spec, $1)= _LT_TAGVAR(whole_archive_flag_spec, $1)= # include_expsyms should be a list of space-separated symbols to be *always* # included in the symbol list _LT_TAGVAR(include_expsyms, $1)= # exclude_expsyms can be an extended regexp of symbols to exclude # it will be wrapped by ` (' and `)$', so one must not match beginning or # end of line. Example: `a|bc|.*d.*' will exclude the symbols `a' and `bc', # as well as any symbol that contains `d'. _LT_TAGVAR(exclude_expsyms, $1)=['_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*'] # Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out # platforms (ab)use it in PIC code, but their linkers get confused if # the symbol is explicitly referenced. Since portable code cannot # rely on this symbol name, it's probably fine to never include it in # preloaded symbol tables. # Exclude shared library initialization/finalization symbols. dnl Note also adjust exclude_expsyms for C++ above. extract_expsyms_cmds= case $host_os in cygwin* | mingw* | pw32* | cegcc*) # FIXME: the MSVC++ port hasn't been tested in a loooong time # When not using gcc, we currently assume that we are using # Microsoft Visual C++. if test "$GCC" != yes; then with_gnu_ld=no fi ;; interix*) # we just hope/assume this is gcc and not c89 (= MSVC++) with_gnu_ld=yes ;; openbsd*) with_gnu_ld=no ;; linux* | k*bsd*-gnu | gnu*) _LT_TAGVAR(link_all_deplibs, $1)=no ;; 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}' # Set some defaults for GNU ld with shared library support. These # are reset later if shared libraries are not supported. Putting them # here allows them to be overridden if necessary. runpath_var=LD_RUN_PATH _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' # ancient GNU ld didn't support --whole-archive et. al. if $LD --help 2>&1 | $GREP 'no-whole-archive' > /dev/null; then _LT_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' else _LT_TAGVAR(whole_archive_flag_spec, $1)= 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 ... *\ 2.11.*) ;; # other 2.11 versions *) supports_anon_versioning=yes ;; esac # See if GNU ld supports shared libraries. case $host_os in aix[[3-9]]*) # On AIX/PPC, the GNU linker is very broken if test "$host_cpu" != ia64; then _LT_TAGVAR(ld_shlibs, $1)=no cat <<_LT_EOF 1>&2 *** 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 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 ;; amigaos*) case $host_cpu in powerpc) # see comment about AmigaOS4 .so support _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='' ;; m68k) _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/a2ixlibrary.data~$ECHO "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$ECHO "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$ECHO "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$ECHO "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(hardcode_minus_L, $1)=yes ;; esac ;; beos*) if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then _LT_TAGVAR(allow_undefined_flag, $1)=unsupported # Joseph Beckenbach says some releases of gcc # support --undefined. This deserves some investigation. FIXME _LT_TAGVAR(archive_cmds, $1)='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' else _LT_TAGVAR(ld_shlibs, $1)=no fi ;; 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(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/;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' # 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 $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' else _LT_TAGVAR(ld_shlibs, $1)=no 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 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc. # Instead, shared libraries are loaded at an image base (0x10000000 by # default) and relocated if they conflict, which is a slow very memory # consuming and fragmenting process. To avoid this, we pick a random, # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link # time. Moving up from 0x10000000 also allows more sbrk(2) space. _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' _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 | kopensolaris*-gnu) tmp_diet=no if test "$host_os" = linux-dietlibc; then case $cc_basename in diet\ *) tmp_diet=yes;; # linux-dietlibc with static linking (!diet-dyn) esac fi if $LD --help 2>&1 | $EGREP ': supported targets:.* elf' > /dev/null \ && test "$tmp_diet" = no then 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; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' tmp_addflag=' $pic_flag' ;; 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' ;; efc*,ia64* | ifort*,ia64*) # Intel Fortran compiler on ia64 tmp_addflag=' -i_dynamic -nofor_main' ;; ifc* | ifort*) # Intel Fortran compiler tmp_addflag=' -nofor_main' ;; lf95*) # Lahey Fortran 8.1 _LT_TAGVAR(whole_archive_flag_spec, $1)= tmp_sharedflag='--shared' ;; 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; 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 tmp_sharedflag='-G' ;; esac _LT_TAGVAR(archive_cmds, $1)='$CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$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~ $CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib' fi case $cc_basename in 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)='${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 $linker_flags -soname $soname -version-script $output_objdir/$libname.ver -o $lib' fi ;; esac else _LT_TAGVAR(ld_shlibs, $1)=no fi ;; netbsd* | netbsdelf*-gnu) if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib' wlarc= else _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 ;; solaris*) if $LD -v 2>&1 | $GREP 'BFD 2\.8' > /dev/null; then _LT_TAGVAR(ld_shlibs, $1)=no cat <<_LT_EOF 1>&2 *** Warning: The releases 2.8.* of the GNU linker cannot reliably *** create shared libraries on Solaris systems. Therefore, libtool *** is disabling shared libraries support. We urge you to upgrade GNU *** binutils to release 2.9.1 or newer. Another option is to modify *** your PATH or compiler configuration so that the native linker is *** used, and then restart. _LT_EOF elif $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then _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 ;; sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX*) case `$LD -v 2>&1` in *\ [[01]].* | *\ 2.[[0-9]].* | *\ 2.1[[0-5]].*) _LT_TAGVAR(ld_shlibs, $1)=no cat <<_LT_EOF 1>&2 *** Warning: Releases of the GNU linker prior to 2.16.91.0.3 can not *** reliably create shared libraries on SCO systems. Therefore, libtool *** is disabling shared libraries support. We urge you to upgrade GNU *** binutils to release 2.16.91.0.3 or newer. Another option is to modify *** your PATH or compiler configuration so that the native linker is *** used, and then restart. _LT_EOF ;; *) # For security reasons, it is highly recommended that you always # use absolute paths for naming shared libraries, and exclude the # DT_RUNPATH tag from executables and libraries. But doing so # requires that you compile everything twice, which is a pain. if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' _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' else _LT_TAGVAR(ld_shlibs, $1)=no fi ;; esac ;; sunos4*) _LT_TAGVAR(archive_cmds, $1)='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags' wlarc= _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; *) if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then _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 ;; esac if test "$_LT_TAGVAR(ld_shlibs, $1)" = no; then runpath_var= _LT_TAGVAR(hardcode_libdir_flag_spec, $1)= _LT_TAGVAR(export_dynamic_flag_spec, $1)= _LT_TAGVAR(whole_archive_flag_spec, $1)= fi else # PORTME fill in a description of your system's linker (not GNU ld) case $host_os in aix3*) _LT_TAGVAR(allow_undefined_flag, $1)=unsupported _LT_TAGVAR(always_export_symbols, $1)=yes _LT_TAGVAR(archive_expsym_cmds, $1)='$LD -o $output_objdir/$soname $libobjs $deplibs $linker_flags -bE:$export_symbols -T512 -H512 -bM:SRE~$AR $AR_FLAGS $lib $output_objdir/$soname' # Note: this linker hardcodes the directories in LIBPATH if there # are no directories specified by -L. _LT_TAGVAR(hardcode_minus_L, $1)=yes if test "$GCC" = yes && test -z "$lt_prog_compiler_static"; then # Neither direct hardcoding nor static linking is supported with a # broken collect2. _LT_TAGVAR(hardcode_direct, $1)=unsupported fi ;; aix[[4-9]]*) if test "$host_cpu" = ia64; then # On IA64, the linker does run time linking by default, so we don't # have to do anything special. aix_use_runtimelinking=no exp_sym_flag='-Bexport' no_entry_flag="" 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") || (\$ 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 aix_use_runtimelinking=no # Test if we are trying to use run time linking or normal # AIX style linking. If -brtl is somewhere in LDFLAGS, we # need to do runtime linking. case $host_os in aix4.[[23]]|aix4.[[23]].*|aix[[5-9]]*) for ld_flag in $LDFLAGS; do if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); then aix_use_runtimelinking=yes break fi done ;; esac exp_sym_flag='-bexport' no_entry_flag='-bnoentry' fi # When large executables or shared objects are built, AIX ld can # have problems creating the table of contents. If linking a library # or program results in "error TOC overflow" add -mminimal-toc to # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS. _LT_TAGVAR(archive_cmds, $1)='' _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_direct_absolute, $1)=yes _LT_TAGVAR(hardcode_libdir_separator, $1)=':' _LT_TAGVAR(link_all_deplibs, $1)=yes _LT_TAGVAR(file_list_spec, $1)='${wl}-f,' if test "$GCC" = yes; then case $host_os in aix4.[[012]]|aix4.[[012]].*) # We only want to do this on AIX 4.2 and lower, the check # below for broken collect2 doesn't work under 4.3+ collect2name=`${CC} -print-prog-name=collect2` if test -f "$collect2name" && strings "$collect2name" | $GREP resolve_lib_name >/dev/null then # We have reworked collect2 : else # We have old collect2 _LT_TAGVAR(hardcode_direct, $1)=unsupported # It fails to find uninstalled libraries when the uninstalled # path is not listed in the libpath. Setting hardcode_minus_L # to unsupported forces relinking _LT_TAGVAR(hardcode_minus_L, $1)=yes _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)= fi ;; esac shared_flag='-shared' if test "$aix_use_runtimelinking" = yes; then shared_flag="$shared_flag "'${wl}-G' fi _LT_TAGVAR(link_all_deplibs, $1)=no else # not using gcc if test "$host_cpu" = ia64; then # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release # chokes on -Wl,-G. The following line is correct: shared_flag='-G' else if test "$aix_use_runtimelinking" = yes; then shared_flag='${wl}-G' else shared_flag='${wl}-bM:SRE' fi fi fi _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-bexpall' # It seems that -bexpall does not export symbols beginning with # underscore (_), so it is better to generate a list of symbols to export. _LT_TAGVAR(always_export_symbols, $1)=yes if test "$aix_use_runtimelinking" = yes; then # Warning - without using the other runtime loading flags (-brtl), # -berok will link without error, but may produce a broken library. _LT_TAGVAR(allow_undefined_flag, $1)='-berok' # Determine the default libpath from the value encoded in an # empty executable. _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 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' _LT_TAGVAR(allow_undefined_flag, $1)="-z nodefs" _LT_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$exp_sym_flag:\$export_symbols" else # Determine the default libpath from the value encoded in an # empty executable. _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' 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' fi fi ;; amigaos*) case $host_cpu in powerpc) # see comment about AmigaOS4 .so support _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='' ;; m68k) _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/a2ixlibrary.data~$ECHO "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$ECHO "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$ECHO "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$ECHO "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(hardcode_minus_L, $1)=yes ;; esac ;; bsdi[[45]]*) _LT_TAGVAR(export_dynamic_flag_spec, $1)=-rdynamic ;; cygwin* | mingw* | pw32* | cegcc*) # When not using gcc, we currently assume that we are using # Microsoft Visual C++. # hardcode_libdir_flag_spec is actually meaningless, as there is # no search path for DLLs. 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*) _LT_DARWIN_LINKER_FEATURES($1) ;; dgux*) _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(hardcode_shlibpath_var, $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 # extra space). freebsd2.2*) _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; # Unfortunately, older versions of FreeBSD 2 do not have this feature. 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 _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; # FreeBSD 3 and greater uses gcc -shared to do shared libraries. freebsd* | dragonfly*) _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 ;; hpux9*) if test "$GCC" = yes; then _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 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: _LT_TAGVAR(hardcode_direct, $1)=yes # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. _LT_TAGVAR(hardcode_minus_L, $1)=yes _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' ;; hpux10*) 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_separator, $1)=: _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_direct_absolute, $1)=yes _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. _LT_TAGVAR(hardcode_minus_L, $1)=yes fi ;; hpux11*) 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 $pic_flag ${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}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' ;; esac else case $host_cpu in hppa*64*) _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' ;; ia64*) _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -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 if test "$with_gnu_ld" = no; then _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: case $host_cpu in hppa*64*|ia64*) _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; *) _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_direct_absolute, $1)=yes _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. _LT_TAGVAR(hardcode_minus_L, $1)=yes ;; esac fi ;; irix5* | irix6* | nonstopux*) if test "$GCC" = yes; then _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. # 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" && 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' _LT_TAGVAR(hardcode_libdir_separator, $1)=: _LT_TAGVAR(inherit_rpath, $1)=yes _LT_TAGVAR(link_all_deplibs, $1)=yes ;; netbsd* | netbsdelf*-gnu) if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' # a.out else _LT_TAGVAR(archive_cmds, $1)='$LD -shared -o $lib $libobjs $deplibs $linker_flags' # ELF fi _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; newsos6) _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; *nto* | *qnx*) ;; openbsd*) if test -f /usr/libexec/ld.so; then _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_shlibpath_var, $1)=no _LT_TAGVAR(hardcode_direct_absolute, $1)=yes if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-retain-symbols-file,$export_symbols' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' else case $host_os in openbsd[[01]].* | openbsd2.[[0-7]] | openbsd2.[[0-7]].*) _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' ;; *) _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' ;; esac fi else _LT_TAGVAR(ld_shlibs, $1)=no fi ;; os2*) _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(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" && 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" && 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' _LT_TAGVAR(hardcode_libdir_separator, $1)=: ;; 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} $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" && 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 "-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' fi _LT_TAGVAR(archive_cmds_need_lc, $1)='no' _LT_TAGVAR(hardcode_libdir_separator, $1)=: ;; solaris*) _LT_TAGVAR(no_undefined_flag, $1)=' -z defs' if test "$GCC" = yes; then wlarc='${wl}' _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 $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"*) wlarc='' _LT_TAGVAR(archive_cmds, $1)='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$RM $lib.exp' ;; *) wlarc='${wl}' _LT_TAGVAR(archive_cmds, $1)='$CC -G${allow_undefined_flag} -h $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 -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp' ;; esac fi _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' _LT_TAGVAR(hardcode_shlibpath_var, $1)=no case $host_os in solaris2.[[0-5]] | solaris2.[[0-5]].*) ;; *) # The compiler driver will combine and reorder linker options, # but understands `-z linker_flag'. GCC discards it without `$wl', # but is careful enough not to reorder. # Supported since Solaris 2.6 (maybe 2.5.1?) if test "$GCC" = yes; then _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract' else _LT_TAGVAR(whole_archive_flag_spec, $1)='-z allextract$convenience -z defaultextract' fi ;; esac _LT_TAGVAR(link_all_deplibs, $1)=yes ;; sunos4*) if test "x$host_vendor" = xsequent; then # Use $CC to link under sequent, because it throws in some extra .o # files that make .init and .fini sections work. _LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h $soname -o $lib $libobjs $deplibs $compiler_flags' else _LT_TAGVAR(archive_cmds, $1)='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags' fi _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_minus_L, $1)=yes _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; sysv4) case $host_vendor in sni) _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(hardcode_direct, $1)=yes # is this really true??? ;; siemens) ## LD is ld it makes a PLAMLIB ## CC just makes a GrossModule. _LT_TAGVAR(archive_cmds, $1)='$LD -G -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(reload_cmds, $1)='$CC -r -o $output$reload_objs' _LT_TAGVAR(hardcode_direct, $1)=no ;; motorola) _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(hardcode_direct, $1)=no #Motorola manual says yes, but my tests say they lie ;; esac runpath_var='LD_RUN_PATH' _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; sysv4.3*) _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(hardcode_shlibpath_var, $1)=no _LT_TAGVAR(export_dynamic_flag_spec, $1)='-Bexport' ;; sysv4*MP*) if test -d /usr/nec; then _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(hardcode_shlibpath_var, $1)=no runpath_var=LD_RUN_PATH hardcode_runpath_var=yes _LT_TAGVAR(ld_shlibs, $1)=yes fi ;; sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[[01]].[[10]]* | unixware7* | sco3.2v5.0.[[024]]*) _LT_TAGVAR(no_undefined_flag, $1)='${wl}-z,text' _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=no runpath_var='LD_RUN_PATH' if test "$GCC" = yes; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' else _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' fi ;; sysv5* | sco3.2v5* | sco5v6*) # Note: We can NOT use -z defs as we might desire, because we do not # link with -lc, and that would cause any symbols used from libc to # always be unresolved, which means just about no library would # ever link correctly. If we're not using GNU ld we use -z text # though, which does catch some bad symbols but isn't as heavy-handed # as -z defs. _LT_TAGVAR(no_undefined_flag, $1)='${wl}-z,text' _LT_TAGVAR(allow_undefined_flag, $1)='${wl}-z,nodefs' _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=no _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R,$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=':' _LT_TAGVAR(link_all_deplibs, $1)=yes _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Bexport' runpath_var='LD_RUN_PATH' if test "$GCC" = yes; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' else _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' fi ;; uts4*) _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; *) _LT_TAGVAR(ld_shlibs, $1)=no ;; esac if test x$host_vendor = xsni; then case $host in sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*) _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Blargedynsym' ;; esac fi fi ]) AC_MSG_RESULT([$_LT_TAGVAR(ld_shlibs, $1)]) test "$_LT_TAGVAR(ld_shlibs, $1)" = no && can_build_shared=no _LT_TAGVAR(with_gnu_ld, $1)=$with_gnu_ld _LT_DECL([], [libext], [0], [Old archive suffix (normally "a")])dnl _LT_DECL([], [shrext_cmds], [1], [Shared library suffix (normally ".so")])dnl _LT_DECL([], [extract_expsyms_cmds], [2], [The commands to extract the exported symbol list from a shared archive]) # # Do we need to explicitly link libc? # case "x$_LT_TAGVAR(archive_cmds_need_lc, $1)" in x|xyes) # Assume -lc should be added _LT_TAGVAR(archive_cmds_need_lc, $1)=yes if test "$enable_shared" = yes && test "$GCC" = yes; then case $_LT_TAGVAR(archive_cmds, $1) in *'~'*) # FIXME: we may have to deal with multi-command sequences. ;; '$CC '*) # 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_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 ;; esac _LT_TAGDECL([build_libtool_need_lc], [archive_cmds_need_lc], [0], [Whether or not to add -lc for building shared libraries]) _LT_TAGDECL([allow_libtool_libs_with_static_runtimes], [enable_shared_with_static_runtimes], [0], [Whether or not to disallow shared libs when runtime libs are static]) _LT_TAGDECL([], [export_dynamic_flag_spec], [1], [Compiler flag to allow reflexive dlopens]) _LT_TAGDECL([], [whole_archive_flag_spec], [1], [Compiler flag to generate shared objects directly from archives]) _LT_TAGDECL([], [compiler_needs_object], [1], [Whether the compiler copes with passing no objects directly]) _LT_TAGDECL([], [old_archive_from_new_cmds], [2], [Create an old-style archive from a shared archive]) _LT_TAGDECL([], [old_archive_from_expsyms_cmds], [2], [Create a temporary old-style archive to link instead of a shared archive]) _LT_TAGDECL([], [archive_cmds], [2], [Commands used to build a shared archive]) _LT_TAGDECL([], [archive_expsym_cmds], [2]) _LT_TAGDECL([], [module_cmds], [2], [Commands used to build a loadable module if different from building a shared archive.]) _LT_TAGDECL([], [module_expsym_cmds], [2]) _LT_TAGDECL([], [with_gnu_ld], [1], [Whether we are building with GNU ld or not]) _LT_TAGDECL([], [allow_undefined_flag], [1], [Flag that allows shared libraries with undefined symbols to be built]) _LT_TAGDECL([], [no_undefined_flag], [1], [Flag that enforces no undefined symbols]) _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_separator], [1], [Whether we need a single "-rpath" flag with a separated argument]) _LT_TAGDECL([], [hardcode_direct], [0], [Set to "yes" if using DIR/libNAME${shared_ext} during linking hardcodes DIR into the resulting binary]) _LT_TAGDECL([], [hardcode_direct_absolute], [0], [Set to "yes" if using DIR/libNAME${shared_ext} during linking hardcodes DIR into the resulting binary and the resulting library dependency is "absolute", i.e impossible to change by setting ${shlibpath_var} if the library is relocated]) _LT_TAGDECL([], [hardcode_minus_L], [0], [Set to "yes" if using the -LDIR flag during linking hardcodes DIR into the resulting binary]) _LT_TAGDECL([], [hardcode_shlibpath_var], [0], [Set to "yes" if using SHLIBPATH_VAR=DIR during linking hardcodes DIR into the resulting binary]) _LT_TAGDECL([], [hardcode_automatic], [0], [Set to "yes" if building a shared library automatically hardcodes DIR into the library and all subsequent libraries and executables linked against it]) _LT_TAGDECL([], [inherit_rpath], [0], [Set to yes if linker adds runtime paths of dependent libraries to runtime path list]) _LT_TAGDECL([], [link_all_deplibs], [0], [Whether libtool must link a program against all its dependency libraries]) _LT_TAGDECL([], [always_export_symbols], [0], [Set to "yes" if exported symbols are required]) _LT_TAGDECL([], [export_symbols_cmds], [2], [The commands to list exported symbols]) _LT_TAGDECL([], [exclude_expsyms], [1], [Symbols that should not be listed in the preloaded symbols]) _LT_TAGDECL([], [include_expsyms], [1], [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 dnl _LT_TAGDECL([], [thread_safe_flag_spec], [1], dnl [Compiler flag to generate thread safe objects]) ])# _LT_LINKER_SHLIBS # _LT_LANG_C_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_C_CONFIG], [m4_require([_LT_DECL_EGREP])dnl lt_save_CC="$CC" AC_LANG_PUSH(C) # Source file extension for C test sources. ac_ext=c # Object file extension for compiled C test sources. objext=o _LT_TAGVAR(objext, $1)=$objext # Code to be used in simple compile tests lt_simple_compile_test_code="int some_variable = 0;" # Code to be used in simple link tests lt_simple_link_test_code='int main(){return(0);}' _LT_TAG_COMPILER # Save the default compiler, since it gets overwritten when the other # tags are being tested, and _LT_TAGVAR(compiler, []) is a NOP. compiler_DEFAULT=$CC # save warnings/boilerplate of simple test code _LT_COMPILER_BOILERPLATE _LT_LINKER_BOILERPLATE ## 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_SYS_DYNAMIC_LINKER($1) _LT_LINKER_HARDCODE_LIBPATH($1) LT_SYS_DLOPEN_SELF _LT_CMD_STRIPLIB # Report which library types will actually be built AC_MSG_CHECKING([if libtool supports shared libraries]) AC_MSG_RESULT([$can_build_shared]) AC_MSG_CHECKING([whether to build shared libraries]) test "$can_build_shared" = "no" && enable_shared=no # On AIX, shared libraries and static libraries use the same namespace, and # are all built from PIC. case $host_os in aix3*) test "$enable_shared" = yes && enable_static=no if test -n "$RANLIB"; then archive_cmds="$archive_cmds~\$RANLIB \$lib" postinstall_cmds='$RANLIB $lib' fi ;; aix[[4-9]]*) if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then test "$enable_shared" = yes && enable_static=no fi ;; esac AC_MSG_RESULT([$enable_shared]) AC_MSG_CHECKING([whether to build static libraries]) # Make sure either enable_shared or enable_static is yes. test "$enable_shared" = yes || enable_static=yes AC_MSG_RESULT([$enable_static]) _LT_CONFIG($1) fi AC_LANG_POP CC="$lt_save_CC" ])# _LT_LANG_C_CONFIG # _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], [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 _LT_TAGVAR(allow_undefined_flag, $1)= _LT_TAGVAR(always_export_symbols, $1)=no _LT_TAGVAR(archive_expsym_cmds, $1)= _LT_TAGVAR(compiler_needs_object, $1)=no _LT_TAGVAR(export_dynamic_flag_spec, $1)= _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_direct_absolute, $1)=no _LT_TAGVAR(hardcode_libdir_flag_spec, $1)= _LT_TAGVAR(hardcode_libdir_separator, $1)= _LT_TAGVAR(hardcode_minus_L, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported _LT_TAGVAR(hardcode_automatic, $1)=no _LT_TAGVAR(inherit_rpath, $1)=no _LT_TAGVAR(module_cmds, $1)= _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 # Source file extension for C++ test sources. ac_ext=cpp # Object file extension for compiled C++ test sources. objext=o _LT_TAGVAR(objext, $1)=$objext # No sense in running all these tests if we already determined that # the CXX compiler isn't working. Some variables (like enable_shared) # are currently assumed to apply to all compilers on this platform, # and will be corrupted by setting them based on a non-working compiler. if test "$_lt_caught_CXX_error" != yes; then # Code to be used in simple compile tests lt_simple_compile_test_code="int some_variable = 0;" # Code to be used in simple link tests lt_simple_link_test_code='int main(int, char *[[]]) { return(0); }' # 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_LD=$LD lt_save_GCC=$GCC GCC=$GXX lt_save_with_gnu_ld=$with_gnu_ld lt_save_path_LD=$lt_cv_path_LD if test -n "${lt_cv_prog_gnu_ldcxx+set}"; then lt_cv_prog_gnu_ld=$lt_cv_prog_gnu_ldcxx else $as_unset lt_cv_prog_gnu_ld fi if test -n "${lt_cv_path_LDCXX+set}"; then lt_cv_path_LD=$lt_cv_path_LDCXX else $as_unset lt_cv_path_LD fi test -z "${LDCXX+set}" || LD=$LDCXX CC=${CXX-"c++"} CFLAGS=$CXXFLAGS compiler=$CC _LT_TAGVAR(compiler, $1)=$CC _LT_CC_BASENAME([$compiler]) if test -n "$compiler"; then # We don't want -fno-exception when compiling C++ code, so set the # no_builtin_flag separately if test "$GXX" = yes; then _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin' else _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)= fi if test "$GXX" = yes; then # Set up default GNU C++ configuration LT_PATH_LD # 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 $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' # If archive_cmds runs LD, not CC, wlarc should be empty # XXX I think wlarc can be eliminated in ltcf-cxx, but I need to # investigate it a little bit more. (MM) wlarc='${wl}' # ancient GNU ld didn't support --whole-archive et. al. if eval "`$CC -print-prog-name=ld` --help 2>&1" | $GREP 'no-whole-archive' > /dev/null; then _LT_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' else _LT_TAGVAR(whole_archive_flag_spec, $1)= fi else with_gnu_ld=no wlarc= # A generic and very simple default shared library creation # command for GNU C++ for the case where it uses the native # linker, instead of GNU ld. If possible, this setting should # overridden to take advantage of the native linker features on # the platform it is being used on. _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib' fi # 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 -v "^Configured with:" | $GREP "\-L"' else GXX=no with_gnu_ld=no wlarc= fi # PORTME: fill in a description of your system's C++ link characteristics AC_MSG_CHECKING([whether the $compiler linker ($LD) supports shared libraries]) _LT_TAGVAR(ld_shlibs, $1)=yes case $host_os in aix3*) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; aix[[4-9]]*) if test "$host_cpu" = ia64; then # On IA64, the linker does run time linking by default, so we don't # have to do anything special. aix_use_runtimelinking=no exp_sym_flag='-Bexport' no_entry_flag="" else aix_use_runtimelinking=no # Test if we are trying to use run time linking or normal # AIX style linking. If -brtl is somewhere in LDFLAGS, we # need to do runtime linking. case $host_os in aix4.[[23]]|aix4.[[23]].*|aix[[5-9]]*) for ld_flag in $LDFLAGS; do case $ld_flag in *-brtl*) aix_use_runtimelinking=yes break ;; esac done ;; esac exp_sym_flag='-bexport' no_entry_flag='-bnoentry' fi # When large executables or shared objects are built, AIX ld can # have problems creating the table of contents. If linking a library # or program results in "error TOC overflow" add -mminimal-toc to # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS. _LT_TAGVAR(archive_cmds, $1)='' _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_direct_absolute, $1)=yes _LT_TAGVAR(hardcode_libdir_separator, $1)=':' _LT_TAGVAR(link_all_deplibs, $1)=yes _LT_TAGVAR(file_list_spec, $1)='${wl}-f,' if test "$GXX" = yes; then case $host_os in aix4.[[012]]|aix4.[[012]].*) # We only want to do this on AIX 4.2 and lower, the check # below for broken collect2 doesn't work under 4.3+ collect2name=`${CC} -print-prog-name=collect2` if test -f "$collect2name" && strings "$collect2name" | $GREP resolve_lib_name >/dev/null then # We have reworked collect2 : else # We have old collect2 _LT_TAGVAR(hardcode_direct, $1)=unsupported # It fails to find uninstalled libraries when the uninstalled # path is not listed in the libpath. Setting hardcode_minus_L # to unsupported forces relinking _LT_TAGVAR(hardcode_minus_L, $1)=yes _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)= fi esac shared_flag='-shared' if test "$aix_use_runtimelinking" = yes; then shared_flag="$shared_flag "'${wl}-G' fi else # not using gcc if test "$host_cpu" = ia64; then # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release # chokes on -Wl,-G. The following line is correct: shared_flag='-G' else if test "$aix_use_runtimelinking" = yes; then shared_flag='${wl}-G' else shared_flag='${wl}-bM:SRE' fi fi fi _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-bexpall' # It seems that -bexpall does not export symbols beginning with # underscore (_), so it is better to generate a list of symbols to # export. _LT_TAGVAR(always_export_symbols, $1)=yes if test "$aix_use_runtimelinking" = yes; then # Warning - without using the other runtime loading flags (-brtl), # -berok will link without error, but may produce a broken library. _LT_TAGVAR(allow_undefined_flag, $1)='-berok' # Determine the default libpath from the value encoded in an empty # executable. _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 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' _LT_TAGVAR(allow_undefined_flag, $1)="-z nodefs" _LT_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$exp_sym_flag:\$export_symbols" else # Determine the default libpath from the value encoded in an # empty executable. _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' 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' fi fi ;; beos*) if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then _LT_TAGVAR(allow_undefined_flag, $1)=unsupported # Joseph Beckenbach says some releases of gcc # support --undefined. This deserves some investigation. FIXME _LT_TAGVAR(archive_cmds, $1)='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' else _LT_TAGVAR(ld_shlibs, $1)=no fi ;; chorus*) case $cc_basename in *) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; esac ;; cygwin* | mingw* | pw32* | cegcc*) 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) ;; dgux*) case $cc_basename in ec++*) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; ghcx*) # Green Hills C++ Compiler # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; *) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; esac ;; freebsd2.*) # C++ shared libraries reported to be fairly broken before # switch to ELF _LT_TAGVAR(ld_shlibs, $1)=no ;; freebsd-elf*) _LT_TAGVAR(archive_cmds_need_lc, $1)=no ;; freebsd* | dragonfly*) # FreeBSD 3 and later use GNU C++ and GNU ld with standard ELF # conventions _LT_TAGVAR(ld_shlibs, $1)=yes ;; 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)=: _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_minus_L, $1)=yes # Not in the search PATH, # but as the default # location of the library. case $cc_basename in CC*) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; aCC*) _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$CC -b ${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' # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. # # There doesn't appear to be a way to prevent this compiler from # 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; func_echo_all "$list"' ;; *) if test "$GXX" = yes; then _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 fi ;; esac ;; hpux10*|hpux11*) if test $with_gnu_ld = no; then _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: case $host_cpu in hppa*64*|ia64*) ;; *) _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' ;; esac fi case $host_cpu in hppa*64*|ia64*) _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; *) _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_direct_absolute, $1)=yes _LT_TAGVAR(hardcode_minus_L, $1)=yes # Not in the search PATH, # but as the default # location of the library. ;; esac case $cc_basename in CC*) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; aCC*) case $host_cpu in hppa*64*) _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; ia64*) _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; *) _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; esac # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. # # There doesn't appear to be a way to prevent this compiler from # 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; func_echo_all "$list"' ;; *) if test "$GXX" = yes; then if test $with_gnu_ld = no; then case $host_cpu in hppa*64*) _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 $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 $pic_flag ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; esac fi else # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no fi ;; esac ;; interix[[3-9]]*) _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=no _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc. # Instead, shared libraries are loaded at an image base (0x10000000 by # default) and relocated if they conflict, which is a slow very memory # consuming and fragmenting process. To avoid this, we pick a random, # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link # time. Moving up from 0x10000000 also allows more sbrk(2) space. _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' _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' ;; irix5* | irix6*) 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" && 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 # necessary to make sure instantiated templates are included # in the archive. _LT_TAGVAR(old_archive_cmds, $1)='$CC -ar -WR,-u -o $oldlib $oldobjs' ;; *) if test "$GXX" = yes; then if test "$with_gnu_ld" = no; then _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 $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 ;; esac _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: _LT_TAGVAR(inherit_rpath, $1)=yes ;; linux* | k*bsd*-gnu | kopensolaris*-gnu) case $cc_basename in KCC*) # Kuck and Associates, Inc. (KAI) C++ Compiler # KCC will only create a shared library if the output file # ends with ".so" (or ".sl" for HP-UX), so rename the library # to its proper name (with version) after linking. _LT_TAGVAR(archive_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib ${wl}-retain-symbols-file,$export_symbols; mv \$templib $lib' # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. # # There doesn't appear to be a way to prevent this compiler from # 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; func_echo_all "$list"' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' # Archives containing C++ object files must be created using # "CC -Bstatic", where "CC" is the KAI C++ compiler. _LT_TAGVAR(old_archive_cmds, $1)='$CC -Bstatic -o $oldlib $oldobjs' ;; icpc* | ecpc* ) # Intel C++ with_gnu_ld=yes # version 8.0 and above of icpc choke on multiply defined symbols # if we add $predep_objects and $postdep_objects, however 7.1 and # earlier do not add the objects themselves. case `$CC -V 2>&1` in *"Version 7."*) _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' ;; *) # Version 8.0 or newer tmp_idyn= case $host_cpu in ia64*) tmp_idyn=' -i_dynamic';; esac _LT_TAGVAR(archive_cmds, $1)='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' ;; esac _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive$convenience ${wl}--no-whole-archive' ;; pgCC* | pgcpp*) # Portland Group C++ compiler case `$CC -V` in *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 | 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 | 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 | 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 | sort | $NL2SP` $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname ${wl}-retain-symbols-file ${wl}$export_symbols -o $lib' ;; *) # 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' ;; esac _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; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' ;; cxx*) # Compaq C++ _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib ${wl}-retain-symbols-file $wl$export_symbols' runpath_var=LD_RUN_PATH _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. # # There doesn't appear to be a way to prevent this compiler from # 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=`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* | 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' _LT_TAGVAR(archive_cmds, $1)='$CC -qmkshrobj $libobjs $deplibs $compiler_flags ${wl}-soname $wl$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~ $CC -qmkshrobj $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib' fi ;; *) case `$CC -V 2>&1 | sed 5q` in *Sun\ C*) # Sun C++ 5.9 _LT_TAGVAR(no_undefined_flag, $1)=' -zdefs' _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; 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='func_echo_all' # Archives containing C++ object files must be created using # "CC -xar", where "CC" is the Sun C++ compiler. This is # necessary to make sure instantiated templates are included # in the archive. _LT_TAGVAR(old_archive_cmds, $1)='$CC -xar -o $oldlib $oldobjs' ;; esac ;; esac ;; lynxos*) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; m88k*) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; mvs*) case $cc_basename in cxx*) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; *) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; esac ;; netbsd*) if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $predep_objects $libobjs $deplibs $postdep_objects $linker_flags' wlarc= _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_shlibpath_var, $1)=no fi # Workaround some broken pre-1.5 toolchains output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP conftest.$objext | $SED -e "s:-lgcc -lc -lgcc::"' ;; *nto* | *qnx*) _LT_TAGVAR(ld_shlibs, $1)=yes ;; openbsd2*) # C++ shared libraries are fairly broken _LT_TAGVAR(ld_shlibs, $1)=no ;; openbsd*) if test -f /usr/libexec/ld.so; then _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_shlibpath_var, $1)=no _LT_TAGVAR(hardcode_direct_absolute, $1)=yes _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-retain-symbols-file,$export_symbols -o $lib' _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=func_echo_all else _LT_TAGVAR(ld_shlibs, $1)=no fi ;; osf3* | osf4* | osf5*) case $cc_basename in KCC*) # Kuck and Associates, Inc. (KAI) C++ Compiler # KCC will only create a shared library if the output file # ends with ".so" (or ".sl" for HP-UX), so rename the library # to its proper name (with version) after linking. _LT_TAGVAR(archive_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo "$lib" | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: # Archives containing C++ object files must be created using # the KAI C++ compiler. case $host in osf3*) _LT_TAGVAR(old_archive_cmds, $1)='$CC -Bstatic -o $oldlib $oldobjs' ;; *) _LT_TAGVAR(old_archive_cmds, $1)='$CC -o $oldlib $oldobjs' ;; esac ;; RCC*) # Rational C++ 2.4.1 # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; cxx*) 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" && 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" && 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 "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib~ $RM $lib.exp' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir' ;; esac _LT_TAGVAR(hardcode_libdir_separator, $1)=: # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. # # There doesn't appear to be a way to prevent this compiler from # 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=`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" && 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 $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 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: # 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 -v "^Configured with:" | $GREP "\-L"' else # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no fi ;; esac ;; psos*) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; sunos4*) case $cc_basename in CC*) # Sun C++ 4.x # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; lcc*) # Lucid # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; *) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; esac ;; solaris*) case $cc_basename in 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' _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)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ $CC -G${allow_undefined_flag} ${wl}-M ${wl}$lib.exp -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' _LT_TAGVAR(hardcode_shlibpath_var, $1)=no case $host_os in solaris2.[[0-5]] | solaris2.[[0-5]].*) ;; *) # The compiler driver will combine and reorder linker options, # but understands `-z linker_flag'. # Supported since Solaris 2.6 (maybe 2.5.1?) _LT_TAGVAR(whole_archive_flag_spec, $1)='-z allextract$convenience -z defaultextract' ;; esac _LT_TAGVAR(link_all_deplibs, $1)=yes 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 # necessary to make sure instantiated templates are included # in the archive. _LT_TAGVAR(old_archive_cmds, $1)='$CC -xar -o $oldlib $oldobjs' ;; gcx*) # Green Hills C++ Compiler _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib' # The C++ compiler must be used to create the archive. _LT_TAGVAR(old_archive_cmds, $1)='$CC $LDFLAGS -archive -o $oldlib $oldobjs' ;; *) # GNU C++ compiler with Solaris linker 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 $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 $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 -v "^Configured with:" | $GREP "\-L"' else # g++ 2.7 appears to require `-G' NOT `-shared' on this # platform. _LT_TAGVAR(archive_cmds, $1)='$CC -G -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 -G -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 -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' case $host_os in solaris2.[[0-5]] | solaris2.[[0-5]].*) ;; *) _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract' ;; esac fi ;; esac ;; sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[[01]].[[10]]* | unixware7* | sco3.2v5.0.[[024]]*) _LT_TAGVAR(no_undefined_flag, $1)='${wl}-z,text' _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=no runpath_var='LD_RUN_PATH' case $cc_basename in 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(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' ;; esac ;; sysv5* | sco3.2v5* | sco5v6*) # Note: We can NOT use -z defs as we might desire, because we do not # link with -lc, and that would cause any symbols used from libc to # always be unresolved, which means just about no library would # ever link correctly. If we're not using GNU ld we use -z text # though, which does catch some bad symbols but isn't as heavy-handed # as -z defs. _LT_TAGVAR(no_undefined_flag, $1)='${wl}-z,text' _LT_TAGVAR(allow_undefined_flag, $1)='${wl}-z,nodefs' _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=no _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R,$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=':' _LT_TAGVAR(link_all_deplibs, $1)=yes _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Bexport' runpath_var='LD_RUN_PATH' case $cc_basename in 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' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' ;; esac ;; tandem*) case $cc_basename in NCC*) # NonStop-UX NCC 3.20 # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; *) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; esac ;; vxworks*) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; *) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; esac AC_MSG_RESULT([$_LT_TAGVAR(ld_shlibs, $1)]) test "$_LT_TAGVAR(ld_shlibs, $1)" = no && can_build_shared=no _LT_TAGVAR(GCC, $1)="$GXX" _LT_TAGVAR(LD, $1)="$LD" ## 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... _LT_SYS_HIDDEN_LIBDEPS($1) _LT_COMPILER_PIC($1) _LT_COMPILER_C_O($1) _LT_COMPILER_FILE_LOCKS($1) _LT_LINKER_SHLIBS($1) _LT_SYS_DYNAMIC_LINKER($1) _LT_LINKER_HARDCODE_LIBPATH($1) _LT_CONFIG($1) fi # test -n "$compiler" CC=$lt_save_CC CFLAGS=$lt_save_CFLAGS LDCXX=$LD LD=$lt_save_LD GCC=$lt_save_GCC with_gnu_ld=$lt_save_with_gnu_ld lt_cv_path_LDCXX=$lt_cv_path_LD lt_cv_path_LD=$lt_save_path_LD lt_cv_prog_gnu_ldcxx=$lt_cv_prog_gnu_ld lt_cv_prog_gnu_ld=$lt_save_with_gnu_ld fi # test "$_lt_caught_CXX_error" != yes AC_LANG_POP ])# _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 # compiler output when linking a shared library. # Parse the compiler output and extract the necessary # 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)= _LT_TAGVAR(predeps, $1)= _LT_TAGVAR(postdeps, $1)= _LT_TAGVAR(compiler_lib_search_path, $1)= dnl we can't use the lt_simple_compile_test_code here, dnl because it contains code intended for an executable, dnl not a library. It's possible we should let each dnl tag define a new lt_????_link_test_code variable, dnl but it's only used here... m4_if([$1], [], [cat > conftest.$ac_ext <<_LT_EOF int a; void foo (void) { a = 0; } _LT_EOF ], [$1], [CXX], [cat > conftest.$ac_ext <<_LT_EOF class Foo { public: Foo (void) { a = 0; } private: int a; }; _LT_EOF ], [$1], [F77], [cat > conftest.$ac_ext <<_LT_EOF subroutine foo implicit none integer*4 a a=0 return end _LT_EOF ], [$1], [FC], [cat > conftest.$ac_ext <<_LT_EOF subroutine foo implicit none integer a a=0 return end _LT_EOF ], [$1], [GCJ], [cat > conftest.$ac_ext <<_LT_EOF public class foo { private int a; public void bar (void) { a = 0; } }; _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 # Parse the compiler output and extract the necessary # objects, libraries and library flags. # Sentinel used to keep track of whether or not we are before # the conftest object file. pre_test_object_deps_done=no for p in `eval "$output_verbose_link_cmd"`; do case ${prev}${p} in -L* | -R* | -l*) # Some compilers place space between "-{L,R}" and the path. # Remove the space. if test $p = "-L" || test $p = "-R"; then prev=$p continue 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 ${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. if test -z "$_LT_TAGVAR(compiler_lib_search_path, $1)"; then _LT_TAGVAR(compiler_lib_search_path, $1)="${prev}${p}" else _LT_TAGVAR(compiler_lib_search_path, $1)="${_LT_TAGVAR(compiler_lib_search_path, $1)} ${prev}${p}" fi ;; # The "-l" case would never come before the object being # linked, so don't bother handling this case. esac else if test -z "$_LT_TAGVAR(postdeps, $1)"; then _LT_TAGVAR(postdeps, $1)="${prev}${p}" else _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. if test "$p" = "conftest.$objext"; then pre_test_object_deps_done=yes continue fi if test "$pre_test_object_deps_done" = no; then if test -z "$_LT_TAGVAR(predep_objects, $1)"; then _LT_TAGVAR(predep_objects, $1)="$p" else _LT_TAGVAR(predep_objects, $1)="$_LT_TAGVAR(predep_objects, $1) $p" fi else if test -z "$_LT_TAGVAR(postdep_objects, $1)"; then _LT_TAGVAR(postdep_objects, $1)="$p" else _LT_TAGVAR(postdep_objects, $1)="$_LT_TAGVAR(postdep_objects, $1) $p" fi fi ;; *) ;; # Ignore the rest. esac done # Clean up. rm -f a.out a.exe else echo "libtool.m4: error: problem compiling $1 test program" fi $RM -f confest.$objext CFLAGS=$_lt_libdeps_save_CFLAGS # PORTME: override above test on systems where it is broken m4_if([$1], [CXX], [case $host_os in interix[[3-9]]*) # Interix 3.5 installs completely hosed .la files for C++, so rather than # hack all around it, let's just trust "g++" to DTRT. _LT_TAGVAR(predep_objects,$1)= _LT_TAGVAR(postdep_objects,$1)= _LT_TAGVAR(postdeps,$1)= ;; linux*) case `$CC -V 2>&1 | sed 5q` in *Sun\ C*) # Sun C++ 5.9 # The more standards-conforming stlport4 library is # incompatible with the Cstd library. Avoid specifying # it if it's in CXXFLAGS. Ignore libCrun as # -library=stlport4 depends on it. case " $CXX $CXXFLAGS " in *" -library=stlport4 "*) solaris_use_stlport4=yes ;; esac if test "$solaris_use_stlport4" != yes; then _LT_TAGVAR(postdeps,$1)='-library=Cstd -library=Crun' fi ;; esac ;; solaris*) case $cc_basename in 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 # -library=stlport4 depends on it. case " $CXX $CXXFLAGS " in *" -library=stlport4 "*) solaris_use_stlport4=yes ;; esac # Adding this requires a known-good setup of shared libraries for # Sun compiler versions before 5.6, else PIC objects from an old # archive will be linked into the output, leading to subtle bugs. if test "$solaris_use_stlport4" != yes; then _LT_TAGVAR(postdeps,$1)='-library=Cstd -library=Crun' fi ;; esac ;; esac ]) case " $_LT_TAGVAR(postdeps, $1) " in *" -lc "*) _LT_TAGVAR(archive_cmds_need_lc, $1)=no ;; esac _LT_TAGVAR(compiler_lib_search_dirs, $1)= if test -n "${_LT_TAGVAR(compiler_lib_search_path, $1)}"; then _LT_TAGVAR(compiler_lib_search_dirs, $1)=`echo " ${_LT_TAGVAR(compiler_lib_search_path, $1)}" | ${SED} -e 's! -L! !g' -e 's!^ !!'` fi _LT_TAGDECL([], [compiler_lib_search_dirs], [1], [The directories searched by this compiler when creating a shared library]) _LT_TAGDECL([], [predep_objects], [1], [Dependencies to place before and after the objects being linked to create a shared library]) _LT_TAGDECL([], [postdep_objects], [1]) _LT_TAGDECL([], [predeps], [1]) _LT_TAGDECL([], [postdeps], [1]) _LT_TAGDECL([], [compiler_lib_search_path], [1], [The library search path used internally by the compiler when linking a shared library]) ])# _LT_SYS_HIDDEN_LIBDEPS # _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_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)= _LT_TAGVAR(always_export_symbols, $1)=no _LT_TAGVAR(archive_expsym_cmds, $1)= _LT_TAGVAR(export_dynamic_flag_spec, $1)= _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_direct_absolute, $1)=no _LT_TAGVAR(hardcode_libdir_flag_spec, $1)= _LT_TAGVAR(hardcode_libdir_separator, $1)= _LT_TAGVAR(hardcode_minus_L, $1)=no _LT_TAGVAR(hardcode_automatic, $1)=no _LT_TAGVAR(inherit_rpath, $1)=no _LT_TAGVAR(module_cmds, $1)= _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 # Source file extension for f77 test sources. ac_ext=f # Object file extension for compiled f77 test sources. objext=o _LT_TAGVAR(objext, $1)=$objext # No sense in running all these tests if we already determined that # the F77 compiler isn't working. Some variables (like enable_shared) # are currently assumed to apply to all compilers on this platform, # and will be corrupted by setting them based on a non-working compiler. if test "$_lt_disable_F77" != yes; then # Code to be used in simple compile tests lt_simple_compile_test_code="\ subroutine t return end " # Code to be used in simple link tests lt_simple_link_test_code="\ program t end " # 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_GCC=$GCC lt_save_CFLAGS=$CFLAGS CC=${F77-"f77"} CFLAGS=$FFLAGS compiler=$CC _LT_TAGVAR(compiler, $1)=$CC _LT_CC_BASENAME([$compiler]) GCC=$G77 if test -n "$compiler"; then AC_MSG_CHECKING([if libtool supports shared libraries]) AC_MSG_RESULT([$can_build_shared]) AC_MSG_CHECKING([whether to build shared libraries]) test "$can_build_shared" = "no" && enable_shared=no # On AIX, shared libraries and static libraries use the same namespace, and # are all built from PIC. case $host_os in aix3*) test "$enable_shared" = yes && enable_static=no if test -n "$RANLIB"; then archive_cmds="$archive_cmds~\$RANLIB \$lib" postinstall_cmds='$RANLIB $lib' fi ;; aix[[4-9]]*) if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then test "$enable_shared" = yes && enable_static=no fi ;; esac AC_MSG_RESULT([$enable_shared]) AC_MSG_CHECKING([whether to build static libraries]) # Make sure either enable_shared or enable_static is yes. test "$enable_shared" = yes || enable_static=yes AC_MSG_RESULT([$enable_static]) _LT_TAGVAR(GCC, $1)="$G77" _LT_TAGVAR(LD, $1)="$LD" ## 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... _LT_COMPILER_PIC($1) _LT_COMPILER_C_O($1) _LT_COMPILER_FILE_LOCKS($1) _LT_LINKER_SHLIBS($1) _LT_SYS_DYNAMIC_LINKER($1) _LT_LINKER_HARDCODE_LIBPATH($1) _LT_CONFIG($1) fi # test -n "$compiler" 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_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_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)= _LT_TAGVAR(always_export_symbols, $1)=no _LT_TAGVAR(archive_expsym_cmds, $1)= _LT_TAGVAR(export_dynamic_flag_spec, $1)= _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_direct_absolute, $1)=no _LT_TAGVAR(hardcode_libdir_flag_spec, $1)= _LT_TAGVAR(hardcode_libdir_separator, $1)= _LT_TAGVAR(hardcode_minus_L, $1)=no _LT_TAGVAR(hardcode_automatic, $1)=no _LT_TAGVAR(inherit_rpath, $1)=no _LT_TAGVAR(module_cmds, $1)= _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 # Source file extension for fc test sources. ac_ext=${ac_fc_srcext-f} # Object file extension for compiled fc test sources. objext=o _LT_TAGVAR(objext, $1)=$objext # No sense in running all these tests if we already determined that # the FC compiler isn't working. Some variables (like enable_shared) # are currently assumed to apply to all compilers on this platform, # and will be corrupted by setting them based on a non-working compiler. if test "$_lt_disable_FC" != yes; then # Code to be used in simple compile tests lt_simple_compile_test_code="\ subroutine t return end " # Code to be used in simple link tests lt_simple_link_test_code="\ program t end " # 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_GCC=$GCC lt_save_CFLAGS=$CFLAGS CC=${FC-"f95"} CFLAGS=$FCFLAGS compiler=$CC GCC=$ac_cv_fc_compiler_gnu _LT_TAGVAR(compiler, $1)=$CC _LT_CC_BASENAME([$compiler]) if test -n "$compiler"; then AC_MSG_CHECKING([if libtool supports shared libraries]) AC_MSG_RESULT([$can_build_shared]) AC_MSG_CHECKING([whether to build shared libraries]) test "$can_build_shared" = "no" && enable_shared=no # On AIX, shared libraries and static libraries use the same namespace, and # are all built from PIC. case $host_os in aix3*) test "$enable_shared" = yes && enable_static=no if test -n "$RANLIB"; then archive_cmds="$archive_cmds~\$RANLIB \$lib" postinstall_cmds='$RANLIB $lib' fi ;; aix[[4-9]]*) if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then test "$enable_shared" = yes && enable_static=no fi ;; esac AC_MSG_RESULT([$enable_shared]) AC_MSG_CHECKING([whether to build static libraries]) # Make sure either enable_shared or enable_static is yes. test "$enable_shared" = yes || enable_static=yes AC_MSG_RESULT([$enable_static]) _LT_TAGVAR(GCC, $1)="$ac_cv_fc_compiler_gnu" _LT_TAGVAR(LD, $1)="$LD" ## 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... _LT_SYS_HIDDEN_LIBDEPS($1) _LT_COMPILER_PIC($1) _LT_COMPILER_C_O($1) _LT_COMPILER_FILE_LOCKS($1) _LT_LINKER_SHLIBS($1) _LT_SYS_DYNAMIC_LINKER($1) _LT_LINKER_HARDCODE_LIBPATH($1) _LT_CONFIG($1) fi # test -n "$compiler" GCC=$lt_save_GCC CC=$lt_save_CC CFLAGS=$lt_save_CFLAGS fi # test "$_lt_disable_FC" != yes AC_LANG_POP ])# _LT_LANG_FC_CONFIG # _LT_LANG_GCJ_CONFIG([TAG]) # -------------------------- # Ensure that the configuration variables for the GNU Java Compiler compiler # are suitably defined. These variables are subsequently used by _LT_CONFIG # to write the compiler configuration to `libtool'. m4_defun([_LT_LANG_GCJ_CONFIG], [AC_REQUIRE([LT_PROG_GCJ])dnl AC_LANG_SAVE # Source file extension for Java test sources. ac_ext=java # Object file extension for compiled Java test sources. objext=o _LT_TAGVAR(objext, $1)=$objext # Code to be used in simple compile tests lt_simple_compile_test_code="class foo {}" # Code to be used in simple link tests lt_simple_link_test_code='public class conftest { public static void main(String[[]] argv) {}; }' # 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=${GCJ-"gcj"} CFLAGS=$GCJFLAGS compiler=$CC _LT_TAGVAR(compiler, $1)=$CC _LT_TAGVAR(LD, $1)="$LD" _LT_CC_BASENAME([$compiler]) # GCJ 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_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 # are suitably defined. These variables are subsequently used by _LT_CONFIG # to write the compiler configuration to `libtool'. m4_defun([_LT_LANG_RC_CONFIG], [AC_REQUIRE([LT_PROG_RC])dnl AC_LANG_SAVE # Source file extension for RC test sources. ac_ext=rc # Object file extension for compiled RC test sources. objext=o _LT_TAGVAR(objext, $1)=$objext # Code to be used in simple compile tests lt_simple_compile_test_code='sample MENU { MENUITEM "&Soup", 100, CHECKED }' # Code to be used in simple link tests lt_simple_link_test_code="$lt_simple_compile_test_code" # 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= CC=${RC-"windres"} CFLAGS= compiler=$CC _LT_TAGVAR(compiler, $1)=$CC _LT_CC_BASENAME([$compiler]) _LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)=yes if test -n "$compiler"; then : _LT_CONFIG($1) fi GCC=$lt_save_GCC AC_LANG_RESTORE CC=$lt_save_CC CFLAGS=$lt_save_CFLAGS ])# _LT_LANG_RC_CONFIG # LT_PROG_GCJ # ----------- AC_DEFUN([LT_PROG_GCJ], [m4_ifdef([AC_PROG_GCJ], [AC_PROG_GCJ], [m4_ifdef([A][M_PROG_GCJ], [A][M_PROG_GCJ], [AC_CHECK_TOOL(GCJ, gcj,) test "x${GCJFLAGS+set}" = xset || GCJFLAGS="-g -O2" AC_SUBST(GCJFLAGS)])])[]dnl ]) # Old name: AU_ALIAS([LT_AC_PROG_GCJ], [LT_PROG_GCJ]) dnl aclocal-1.4 backwards compatibility: 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], [AC_CHECK_TOOL(RC, windres,) ]) # Old name: AU_ALIAS([LT_AC_PROG_RC], [LT_PROG_RC]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([LT_AC_PROG_RC], []) # _LT_DECL_EGREP # -------------- # If we don't have a new enough Autoconf to choose the best grep # available, choose the one first in the user's PATH. m4_defun([_LT_DECL_EGREP], [AC_REQUIRE([AC_PROG_EGREP])dnl AC_REQUIRE([AC_PROG_FGREP])dnl test -z "$GREP" && GREP=grep _LT_DECL([], [GREP], [1], [A grep program that handles long lines]) _LT_DECL([], [EGREP], [1], [An ERE matcher]) _LT_DECL([], [FGREP], [1], [A literal string matcher]) dnl Non-bleeding-edge autoconf doesn't subst GREP, so do it here too AC_SUBST([GREP]) ]) # _LT_DECL_OBJDUMP # -------------- # If we don't have a new enough Autoconf to choose the best objdump # available, choose the one first in the user's PATH. m4_defun([_LT_DECL_OBJDUMP], [AC_CHECK_TOOL(OBJDUMP, objdump, false) test -z "$OBJDUMP" && OBJDUMP=objdump _LT_DECL([], [OBJDUMP], [1], [An object symbol dumper]) 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 # ------------ # Check for a fully-functional sed program, that truncates # as few characters as possible. Prefer GNU sed if found. m4_defun([_LT_DECL_SED], [AC_PROG_SED test -z "$SED" && SED=sed Xsed="$SED -e 1s/^X//" _LT_DECL([], [SED], [1], [A sed program that does not truncate output]) _LT_DECL([], [Xsed], ["\$SED -e 1s/^X//"], [Sed that helps us avoid accidentally triggering echo(1) options like -n]) ])# _LT_DECL_SED m4_ifndef([AC_PROG_SED], [ ############################################################ # NOTE: This macro has been submitted for inclusion into # # GNU Autoconf as AC_PROG_SED. When it is available in # # a released version of Autoconf we should remove this # # macro and use it instead. # ############################################################ m4_defun([AC_PROG_SED], [AC_MSG_CHECKING([for a sed that does not truncate output]) AC_CACHE_VAL(lt_cv_path_SED, [# Loop through the user's path and test for sed and gsed. # Then use that list of sed's as ones to test for truncation. as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for lt_ac_prog in sed gsed; do for ac_exec_ext in '' $ac_executable_extensions; do if $as_executable_p "$as_dir/$lt_ac_prog$ac_exec_ext"; then lt_ac_sed_list="$lt_ac_sed_list $as_dir/$lt_ac_prog$ac_exec_ext" fi done done done IFS=$as_save_IFS lt_ac_max=0 lt_ac_count=0 # Add /usr/xpg4/bin/sed as it is typically found on Solaris # along with /bin/sed that truncates output. for lt_ac_sed in $lt_ac_sed_list /usr/xpg4/bin/sed; do test ! -f $lt_ac_sed && continue cat /dev/null > conftest.in lt_ac_count=0 echo $ECHO_N "0123456789$ECHO_C" >conftest.in # Check for GNU sed and select it if it is found. if "$lt_ac_sed" --version 2>&1 < /dev/null | grep 'GNU' > /dev/null; then lt_cv_path_SED=$lt_ac_sed break fi while true; do cat conftest.in conftest.in >conftest.tmp mv conftest.tmp conftest.in cp conftest.in conftest.nl echo >>conftest.nl $lt_ac_sed -e 's/a$//' < conftest.nl >conftest.out || break cmp -s conftest.out conftest.nl || break # 10000 chars as input seems more than enough test $lt_ac_count -gt 10 && break lt_ac_count=`expr $lt_ac_count + 1` if test $lt_ac_count -gt $lt_ac_max; then lt_ac_max=$lt_ac_count lt_cv_path_SED=$lt_ac_sed fi done done ]) SED=$lt_cv_path_SED AC_SUBST([SED]) AC_MSG_RESULT([$SED]) ])#AC_PROG_SED ])#m4_ifndef # Old name: AU_ALIAS([LT_AC_PROG_SED], [AC_PROG_SED]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([LT_AC_PROG_SED], []) # _LT_CHECK_SHELL_FEATURES # ------------------------ # Find out whether the shell is Bourne or XSI compatible, # or has some other useful features. m4_defun([_LT_CHECK_SHELL_FEATURES], [AC_MSG_CHECKING([whether the shell understands some XSI constructs]) # Try some XSI features xsi_shell=no ( _lt_dummy="a/b/c" 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 AC_MSG_RESULT([$xsi_shell]) _LT_CONFIG_LIBTOOL_INIT([xsi_shell='$xsi_shell']) AC_MSG_CHECKING([whether the shell understands "+="]) lt_shell_append=no ( foo=bar; set foo baz; eval "$[1]+=\$[2]" && test "$foo" = barbaz ) \ >/dev/null 2>&1 \ && lt_shell_append=yes AC_MSG_RESULT([$lt_shell_append]) _LT_CONFIG_LIBTOOL_INIT([lt_shell_append='$lt_shell_append']) if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then lt_unset=unset else lt_unset=false fi _LT_DECL([], [lt_unset], [0], [whether the shell understands "unset"])dnl # test EBCDIC or ASCII case `echo X|tr X '\101'` in A) # ASCII based system # \n is not interpreted correctly by Solaris 8 /usr/ucb/tr lt_SP2NL='tr \040 \012' lt_NL2SP='tr \015\012 \040\040' ;; *) # EBCDIC based system lt_SP2NL='tr \100 \n' lt_NL2SP='tr \r\n \100\100' ;; esac _LT_DECL([SP2NL], [lt_SP2NL], [1], [turn spaces into newlines])dnl _LT_DECL([NL2SP], [lt_NL2SP], [1], [turn newlines into spaces])dnl ])# _LT_CHECK_SHELL_FEATURES # _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=: ]) # _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_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}"}]) _LT_PROG_FUNCTION_REPLACE([func_split_long_opt], [dnl func_split_long_opt_name=${1%%=*} func_split_long_opt_arg=${1#*=}]) _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"}]) _LT_PROG_FUNCTION_REPLACE([func_lo2o], [dnl case ${1} in *.lo) func_lo2o_result=${1%.lo}.${objext} ;; *) func_lo2o_result=${1} ;; esac]) _LT_PROG_FUNCTION_REPLACE([func_xform], [ func_xform_result=${1%.*}.lo]) _LT_PROG_FUNCTION_REPLACE([func_arith], [ func_arith_result=$(( $[*] ))]) _LT_PROG_FUNCTION_REPLACE([func_len], [ func_len_result=${#1}]) fi if test x"$lt_shell_append" = xyes; then _LT_PROG_FUNCTION_REPLACE([func_append], [ eval "${1}+=\\${2}"]) _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"]) # 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 AC_MSG_WARN([Unable to substitute extended shell functions in $ofile]) fi ]) # _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 ;; *-*-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 ]) 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 tango-8.1.2c+dfsg.orig/m4/ac_cxx_have_strstream.m40000644000175000017500000000112512205375075020736 0ustar piccapiccadnl @synopsis AC_CXX_HAVE_STRSTREAM dnl dnl If the C++ library has a working strstream, define HAVE_CLASS_STRSTREAM. dnl dnl Adapted from ac_cxx_have_sstream.m4 by Steve Robbins dnl AC_DEFUN([AC_CXX_HAVE_STRSTREAM], [AC_CACHE_CHECK(whether the library defines strstream, ac_cv_cxx_have_strstream, [AC_REQUIRE([AC_CXX_NAMESPACES])] AC_LANG_SAVE AC_LANG_CPLUSPLUS AC_CHECK_HEADER(strstream, ac_cv_cxx_have_strstream=yes, ac_cv_cxx_have_strstream=no) AC_LANG_RESTORE if test "$ac_cv_cxx_have_strstream" = yes; then AC_DEFINE(HAVE_STRSTREAM,1,[define if the library defines strstream]) fi ])tango-8.1.2c+dfsg.orig/m4/ltsugar.m40000644000175000017500000001042412205375241016040 0ustar piccapicca# ltsugar.m4 -- libtool m4 base layer. -*-Autoconf-*- # # Copyright (C) 2004, 2005, 2007, 2008 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 ltsugar.m4 # This is to help aclocal find these macros, as it can't see m4_define. AC_DEFUN([LTSUGAR_VERSION], [m4_if([0.1])]) # lt_join(SEP, ARG1, [ARG2...]) # ----------------------------- # Produce ARG1SEPARG2...SEPARGn, omitting [] arguments and their # associated separator. # Needed until we can rely on m4_join from Autoconf 2.62, since all earlier # versions in m4sugar had bugs. m4_define([lt_join], [m4_if([$#], [1], [], [$#], [2], [[$2]], [m4_if([$2], [], [], [[$2]_])$0([$1], m4_shift(m4_shift($@)))])]) m4_define([_lt_join], [m4_if([$#$2], [2], [], [m4_if([$2], [], [], [[$1$2]])$0([$1], m4_shift(m4_shift($@)))])]) # lt_car(LIST) # lt_cdr(LIST) # ------------ # Manipulate m4 lists. # These macros are necessary as long as will still need to support # Autoconf-2.59 which quotes differently. m4_define([lt_car], [[$1]]) m4_define([lt_cdr], [m4_if([$#], 0, [m4_fatal([$0: cannot be called without arguments])], [$#], 1, [], [m4_dquote(m4_shift($@))])]) m4_define([lt_unquote], $1) # lt_append(MACRO-NAME, STRING, [SEPARATOR]) # ------------------------------------------ # Redefine MACRO-NAME to hold its former content plus `SEPARATOR'`STRING'. # Note that neither SEPARATOR nor STRING are expanded; they are appended # to MACRO-NAME as is (leaving the expansion for when MACRO-NAME is invoked). # No SEPARATOR is output if MACRO-NAME was previously undefined (different # than defined and empty). # # This macro is needed until we can rely on Autoconf 2.62, since earlier # versions of m4sugar mistakenly expanded SEPARATOR but not STRING. m4_define([lt_append], [m4_define([$1], m4_ifdef([$1], [m4_defn([$1])[$3]])[$2])]) # lt_combine(SEP, PREFIX-LIST, INFIX, SUFFIX1, [SUFFIX2...]) # ---------------------------------------------------------- # Produce a SEP delimited list of all paired combinations of elements of # PREFIX-LIST with SUFFIX1 through SUFFIXn. Each element of the list # has the form PREFIXmINFIXSUFFIXn. # Needed until we can rely on m4_combine added in Autoconf 2.62. m4_define([lt_combine], [m4_if(m4_eval([$# > 3]), [1], [m4_pushdef([_Lt_sep], [m4_define([_Lt_sep], m4_defn([lt_car]))])]]dnl [[m4_foreach([_Lt_prefix], [$2], [m4_foreach([_Lt_suffix], ]m4_dquote(m4_dquote(m4_shift(m4_shift(m4_shift($@)))))[, [_Lt_sep([$1])[]m4_defn([_Lt_prefix])[$3]m4_defn([_Lt_suffix])])])])]) # lt_if_append_uniq(MACRO-NAME, VARNAME, [SEPARATOR], [UNIQ], [NOT-UNIQ]) # ----------------------------------------------------------------------- # Iff MACRO-NAME does not yet contain VARNAME, then append it (delimited # by SEPARATOR if supplied) and expand UNIQ, else NOT-UNIQ. m4_define([lt_if_append_uniq], [m4_ifdef([$1], [m4_if(m4_index([$3]m4_defn([$1])[$3], [$3$2$3]), [-1], [lt_append([$1], [$2], [$3])$4], [$5])], [lt_append([$1], [$2], [$3])$4])]) # lt_dict_add(DICT, KEY, VALUE) # ----------------------------- m4_define([lt_dict_add], [m4_define([$1($2)], [$3])]) # lt_dict_add_subkey(DICT, KEY, SUBKEY, VALUE) # -------------------------------------------- m4_define([lt_dict_add_subkey], [m4_define([$1($2:$3)], [$4])]) # lt_dict_fetch(DICT, KEY, [SUBKEY]) # ---------------------------------- m4_define([lt_dict_fetch], [m4_ifval([$3], m4_ifdef([$1($2:$3)], [m4_defn([$1($2:$3)])]), m4_ifdef([$1($2)], [m4_defn([$1($2)])]))]) # lt_if_dict_fetch(DICT, KEY, [SUBKEY], VALUE, IF-TRUE, [IF-FALSE]) # ----------------------------------------------------------------- m4_define([lt_if_dict_fetch], [m4_if(lt_dict_fetch([$1], [$2], [$3]), [$4], [$5], [$6])]) # lt_dict_filter(DICT, [SUBKEY], VALUE, [SEPARATOR], KEY, [...]) # -------------------------------------------------------------- m4_define([lt_dict_filter], [m4_if([$5], [], [], [lt_join(m4_quote(m4_default([$4], [[, ]])), lt_unquote(m4_split(m4_normalize(m4_foreach(_Lt_key, lt_car([m4_shiftn(4, $@)]), [lt_if_dict_fetch([$1], _Lt_key, [$2], [$3], [_Lt_key ])])))))])[]dnl ]) tango-8.1.2c+dfsg.orig/m4/ac_cxx_have_class_strstream.m40000644000175000017500000000150412205375075022124 0ustar piccapiccadnl @synopsis AC_CXX_HAVE_CLASS STRSTREAM dnl If the C++ library has a working s strstream, dnl define HAVE_CLASS_STRSTREAM dnl @author Unknown dnl @version $Id$ AC_DEFUN([AC_CXX_HAVE_CLASS_STRSTREAM], [AC_CACHE_CHECK(whether the library defines class strstream, ac_cv_cxx_have_class_strstream, [AC_REQUIRE([AC_CXX_NAMESPACES]) AC_LANG_SAVE AC_LANG_CPLUSPLUS AC_TRY_COMPILE([ #if HAVE_STRSTREAM # include #else # include #endif #ifdef HAVE_NAMESPACES using namespace std; #endif],[ostrstream message; message << "Hello"; return 0;], ac_cv_cxx_have_class_strstream=yes, ac_cv_cxx_have_class_strstream=no) AC_LANG_RESTORE ]) if test "$ac_cv_cxx_have_class_strstream" = yes; then AC_DEFINE(HAVE_CLASS_STRSTREAM,1,[define if the library defines strstream]) fi ])tango-8.1.2c+dfsg.orig/m4/omniorb_release.m40000644000175000017500000000251012205375075017526 0ustar piccapiccadnl Determine whether we have omniORB of a particular version or later, dnl based on major, minor, patchlevel versions and date. dnl dnl omniorb_AC_HAVE_OMNIORB_VERSION(OMNI_INCL_PATH, dnl MAJOR_VERSION, dnl MINOR_VERSION, dnl MICRO_VERSION) dnl AC_DEFUN([omniorb_AC_HAVE_OMNIORB_VERSION], [AC_CACHE_CHECK([for omniORB release (at least version $2.$3.$4)], ac_cv_omniorb_version_$2_$3_$4, [ if test -x $1; then VERS=`grep VERSION $1/acconfig.h 2>&1 | cut -d ' ' -f 3` OMNI_VERSION=$VERS OMNIORB_MAJOR=`echo $VERS | cut -b 2` OMNIORB_MINOR=`echo $VERS | cut -b 4` OMNIORB_MICRO=`echo $VERS | cut -b 6` dnl echo "OMNIORB MAJOR = $OMNIORB_MAJOR" dnl echo "OMNIORB MINOR = $OMNIORB_MINOR" dnl echo "OMNIORB MICRO = $OMNIORB_MICRO" if test $OMNIORB_MAJOR -lt $2; then ac_cv_omniorb_version_$2_$3_$4=no else if test $OMNIORB_MINOR -lt $3; then ac_cv_omniorb_version_$2_$3_$4=no else if test $OMNIORB_MICRO -lt $4; then ac_cv_omniorb_version_$2_$3_$4=no else ac_cv_omniorb_version_$2_$3_$4=yes fi fi fi else ac_cv_omniorb_version_$2_$3_$4=no fi ]) ]) tango-8.1.2c+dfsg.orig/m4/gcc_release.m40000644000175000017500000000267212205375075016626 0ustar piccapiccadnl Determine whether we have gcc of a particular version or later, dnl based on major, minor, patchlevel versions and date. dnl dnl gcc_AC_HAVE_GCC_VERSION(MAJOR_VERSION, MINOR_VERSION, PATCH_LEVEL) dnl AC_DEFUN([gcc_AC_HAVE_GCC_VERSION], [AC_CACHE_CHECK([for gcc compiler release (at least version $1.$2.$3)], ac_cv_gcc_version_$1_$2_$3, [if test x$GCC = x ; then ac_cv_gcc_version_$1_$2_$3=no else ac_gcc_date=0 ; AC_EGREP_CPP(yes, [#define HAVE_GCC_VERSION(MAJOR, MINOR, MICRO, DATE) \ (__GNUC__ > (MAJOR) \ || (__GNUC__ == (MAJOR) && __GNUC_MINOR__ > (MINOR)) \ || (__GNUC__ == (MAJOR) && __GNUC_MINOR__ == (MINOR) \ && __GNUC_PATCHLEVEL__ > (MICRO)) \ || (__GNUC__ == (MAJOR) && __GNUC_MINOR__ == (MINOR) \ && __GNUC_PATCHLEVEL__ == (MICRO) && ${ac_gcc_date}L >= (DATE))) #if HAVE_GCC_VERSION($1,$2,$3,0) yes #endif], ac_cv_gcc_version_$1_$2_$3=yes, ac_cv_gcc_version_$1_$2_$3=no) fi ]) if test x$ac_cv_gcc_version_$1_$2_$3 = xyes; then AC_DEFINE_UNQUOTED(HAVE_GCC_VERSION_$1_$2_$3, 1, [Define to 1 if we have gcc $1.$2.$3 ]) fi ]) tango-8.1.2c+dfsg.orig/lib/0000755000175000017500000000000012205375305014343 5ustar piccapiccatango-8.1.2c+dfsg.orig/lib/idl/0000755000175000017500000000000012205375306015114 5ustar piccapiccatango-8.1.2c+dfsg.orig/lib/idl/tango.idl0000644000175000017500000005514312205375123016723 0ustar piccapicca /** * This is the TANGO interface defined in IDL. * TANGO is an extension of old TACO. * The fundamental idea of a device as a network object which * has methods and data has been retained. However * in TANGO objects will be real C++/Java objects which can be instantiated * and accessed via their methods and data by the client as if they were local * objects. * Certain aspects of the old DSAPI application programmer's * interface have been suppressed in order to simplify the client (e.g. import, * free, data collector api). * Features which have been considered missing in old TACO have been added * e.g. signals, events and groups. * Asynchronism and groups have been foreseen right from the beginning * this time. * This interface is defined in CORBA IDL. * The fundamental interface is Device. * All TANGO control objects will be of this type i.e. they will implement and * offer the Device interface. * New classes of control objects e.g. PowerSupply, will be created by * wrapping the Device class appropriately. * The wrapper class will hide the calls to the Device interface from * the client so that the client will only see the wrapper class. * All CORBA details will be hidden from the client as far as possible. **/ module Tango { //------------------------------------------------------------------------- // // Basic types to transport command data // //------------------------------------------------------------------------- typedef boolean DevBoolean; typedef double DevDouble; typedef float DevFloat; typedef short DevShort; typedef long DevLong; typedef long long DevLong64; typedef string DevString; typedef octet DevUChar; typedef unsigned short DevUShort; typedef unsigned long DevULong; typedef unsigned long long DevULong64; typedef sequence DevVarBooleanArray; typedef sequence DevVarDoubleArray; typedef sequence DevVarFloatArray; typedef sequence DevVarShortArray; typedef sequence DevVarLongArray; typedef sequence DevVarLong64Array; typedef sequence DevVarCharArray; typedef sequence DevVarStringArray; typedef sequence DevVarUShortArray; typedef sequence DevVarULongArray; typedef sequence DevVarULong64Array; struct DevVarLongStringArray { DevVarLongArray lvalue; DevVarStringArray svalue; }; struct DevVarDoubleStringArray { DevVarDoubleArray dvalue; DevVarStringArray svalue; }; struct DevEncoded { DevString encoded_format; DevVarCharArray encoded_data; }; typedef sequence DevVarEncodedArray; //------------------------------------------------------------------------- // // Data types for client identification // //------------------------------------------------------------------------- typedef unsigned long long JavaUUID[2]; typedef unsigned long CppClntIdent; struct JavaClntIdent { string MainClass; JavaUUID uuid; }; enum LockerLanguage { CPP, JAVA }; union ClntIdent switch (LockerLanguage) { case CPP: CppClntIdent cpp_clnt; case JAVA: JavaClntIdent java_clnt; }; //------------------------------------------------------------------------- // // Some enumerations // //------------------------------------------------------------------------- enum AttrQuality { ATTR_VALID, ATTR_INVALID, ATTR_ALARM, ATTR_CHANGING, ATTR_WARNING }; enum AttrWriteType { READ, READ_WITH_WRITE, WRITE, READ_WRITE }; enum AttrDataFormat { SCALAR, SPECTRUM, IMAGE, FMT_UNKNOWN }; enum DevSource { DEV, CACHE, CACHE_DEV }; enum ErrSeverity { WARN, ERR, PANIC }; enum DevState { ON, OFF, CLOSE, OPEN, INSERT, EXTRACT, MOVING, STANDBY, FAULT, INIT, RUNNING, ALARM, DISABLE, UNKNOWN }; enum DispLevel { OPERATOR, EXPERT }; typedef sequence DevVarStateArray; //------------------------------------------------------------------------- // // Some miscellaneous structures definitions // //------------------------------------------------------------------------- struct TimeVal { long tv_sec; long tv_usec; long tv_nsec; }; //------------------------------------------------------------------------- // // For the command query device operation // //------------------------------------------------------------------------- struct DevCmdInfo { string cmd_name; long cmd_tag; long in_type; long out_type; string in_type_desc; string out_type_desc; }; struct DevCmdInfo_2 { string cmd_name; DispLevel level; long cmd_tag; long in_type; long out_type; string in_type_desc; string out_type_desc; }; typedef sequence DevCmdInfoList; typedef sequence DevCmdInfoList_2; //------------------------------------------------------------------------- // // For the DevFailed exceptions // //------------------------------------------------------------------------- struct DevError { string reason; ErrSeverity severity; string desc; string origin; }; typedef sequence DevErrorList; struct NamedDevError { string name; long index_in_call; DevErrorList err_list; }; typedef sequence NamedDevErrorList; exception DevFailed { DevErrorList errors; }; exception MultiDevFailed { NamedDevErrorList errors; }; //------------------------------------------------------------------------- // // For attribute management // //------------------------------------------------------------------------- struct AttributeConfig { string name; AttrWriteType writable; AttrDataFormat data_format; long data_type; long max_dim_x; long max_dim_y; string description; string label; string unit; string standard_unit; string display_unit; string format; string min_value; string max_value; string min_alarm; string max_alarm; string writable_attr_name; DevVarStringArray extensions; }; struct AttributeConfig_2 { string name; AttrWriteType writable; AttrDataFormat data_format; long data_type; long max_dim_x; long max_dim_y; string description; string label; string unit; string standard_unit; string display_unit; string format; string min_value; string max_value; string min_alarm; string max_alarm; string writable_attr_name; DispLevel level; DevVarStringArray extensions; }; struct AttributeValue { any value; AttrQuality quality; TimeVal time; string name; long dim_x; long dim_y; }; struct AttributeDim { long dim_x; long dim_y; }; struct AttributeValue_3 { any value; AttrQuality quality; TimeVal time; string name; AttributeDim r_dim; AttributeDim w_dim; DevErrorList err_list; }; enum AttributeDataType { ATT_BOOL, ATT_SHORT, ATT_LONG, ATT_LONG64, ATT_FLOAT, ATT_DOUBLE, ATT_UCHAR, ATT_USHORT, ATT_ULONG, ATT_ULONG64, ATT_STRING, ATT_STATE, DEVICE_STATE, ATT_ENCODED, NO_DATA }; union AttrValUnion switch (AttributeDataType) { case ATT_BOOL: DevVarBooleanArray bool_att_value; case ATT_SHORT: DevVarShortArray short_att_value; case ATT_LONG: DevVarLongArray long_att_value; case ATT_LONG64: DevVarLong64Array long64_att_value; case ATT_FLOAT: DevVarFloatArray float_att_value; case ATT_DOUBLE: DevVarDoubleArray double_att_value; case ATT_UCHAR: DevVarCharArray uchar_att_value; case ATT_USHORT: DevVarUShortArray ushort_att_value; case ATT_ULONG: DevVarULongArray ulong_att_value; case ATT_ULONG64: DevVarULong64Array ulong64_att_value; case ATT_STRING: DevVarStringArray string_att_value; case ATT_STATE: DevVarStateArray state_att_value; case DEVICE_STATE: DevState dev_state_att; case ATT_ENCODED: DevVarEncodedArray encoded_att_value; case NO_DATA: DevBoolean union_no_data; }; struct AttributeValue_4 { AttrValUnion value; AttrQuality quality; AttrDataFormat data_format; TimeVal time; string name; AttributeDim r_dim; AttributeDim w_dim; DevErrorList err_list; }; struct ChangeEventProp { string rel_change; string abs_change; DevVarStringArray extensions; }; struct PeriodicEventProp { string period; DevVarStringArray extensions; }; struct ArchiveEventProp { string rel_change; string abs_change; string period; DevVarStringArray extensions; }; struct EventProperties { ChangeEventProp ch_event; PeriodicEventProp per_event; ArchiveEventProp arch_event; }; struct AttributeAlarm { string min_alarm; string max_alarm; string min_warning; string max_warning; string delta_t; string delta_val; DevVarStringArray extensions; }; struct AttributeConfig_3 { string name; AttrWriteType writable; AttrDataFormat data_format; long data_type; long max_dim_x; long max_dim_y; string description; string label; string unit; string standard_unit; string display_unit; string format; string min_value; string max_value; string writable_attr_name; DispLevel level; AttributeAlarm att_alarm; EventProperties event_prop; DevVarStringArray extensions; DevVarStringArray sys_extensions; }; typedef sequence AttributeConfigList; typedef sequence AttributeConfigList_2; typedef sequence AttributeConfigList_3; typedef sequence AttributeValueList; typedef sequence AttributeValueList_3; typedef sequence AttributeValueList_4; //------------------------------------------------------------------------- // // For data ready event // //------------------------------------------------------------------------- struct AttDataReady { string name; long data_type; long ctr; }; //------------------------------------------------------------------------- // // For device interface info operation // //------------------------------------------------------------------------- struct DevInfo { string dev_class; string server_id; string server_host; long server_version; string doc_url; }; struct DevInfo_3 { string dev_class; string server_id; string server_host; long server_version; string doc_url; string dev_type; }; //------------------------------------------------------------------------- // // For command and attribute history // //------------------------------------------------------------------------- struct DevCmdHistory { TimeVal time; boolean cmd_failed; any value; DevErrorList errors; }; typedef sequence DevCmdHistoryList; struct DevAttrHistory { boolean attr_failed; AttributeValue value; DevErrorList errors; }; struct DevAttrHistory_3 { boolean attr_failed; AttributeValue_3 value; }; struct EltInArray { long start; long nb_elt; }; typedef sequence EltInArrayList; typedef sequence TimeValList; typedef sequence AttrQualityList; typedef sequence AttributeDimList; typedef sequence DevErrorListList; struct DevAttrHistory_4 { string name; TimeValList dates; any value; AttrQualityList quals; EltInArrayList quals_array; AttributeDimList r_dims; EltInArrayList r_dims_array; AttributeDimList w_dims; EltInArrayList w_dims_array; DevErrorListList errors; EltInArrayList errors_array; }; struct DevCmdHistory_4 { TimeValList dates; any value; AttributeDimList dims; EltInArrayList dims_array; DevErrorListList errors; EltInArrayList errors_array; long cmd_type; }; typedef sequence DevAttrHistoryList; typedef sequence DevAttrHistoryList_3; //------------------------------------------------------------------------- // // For ZMQ event system // //------------------------------------------------------------------------- struct ZmqCallInfo { long version; unsigned long ctr; string method_name; DevVarCharArray oid; boolean call_is_except; }; //------------------------------------------------------------------------- // // Include the device interface // //------------------------------------------------------------------------- /** * The fundamental interface for all TANGO objects. * Each Device is a network object which can be accessed locally or via * network. * The network protocol on the wire will be IIOP. * The Device interface implements all the basic functions needed for doing * generic synchronous and asynchronous I/O on a device. * A Device object has data and actions. * Data are represented in the form of Attributes. * Actions are represented in the form of Commands. * The CORBA Device interface offers attributes and methods to access * the attributes and commands. * A client will either use these methods directly from C++ or Java or access * them via a wrapper class. * The Device interface describes only the remote network interface. * Implementation features like threads, command security, priority * etc. are dealt with in server side of the device server model. **/ interface Device { /** * name (readonly) - unique ascii identifier **/ readonly attribute string name; /** * description (readonly) - general description of device **/ readonly attribute string description; /** * state (readonly) - device state **/ readonly attribute DevState state; /** * status (readonly) - device state as ascii string **/ readonly attribute string status; /** * adm_name (readonly) - administrator device unique ascii identifier **/ readonly attribute string adm_name; /** * execute a command on a device synchronously with * one input parameter and one output parameter @param command ascii string e.g. "On" @param argin command input parameter e.g. float @return command result. **/ any command_inout(in string command, in any argin) raises(DevFailed); /** * read the configuration for a variable list of attributes from a device @param name list of attribute names to read @return list of attribute configurations read **/ AttributeConfigList get_attribute_config(in DevVarStringArray names) raises(DevFailed); /** * set the configuration for a variable list of attributes from the device @param new_conf list of attribute configuration to be set @return nothing **/ void set_attribute_config(in AttributeConfigList new_conf) raises(DevFailed); /** * read a variable list of attributes from a device @param name list of attribute names to read @return list of attribute values read **/ AttributeValueList read_attributes(in DevVarStringArray names) raises(DevFailed); /** * write a variable list of attributes to a device @param values list of attribute values to write @return nothing **/ void write_attributes(in AttributeValueList values) raises(DevFailed); /** * ping a device to see if it alive **/ void ping() raises(DevFailed); /** * read list of last N commands executed by clients @param number of commands to return @return list of command and clients **/ DevVarStringArray black_box(in long n) raises(DevFailed); /** * return general information about object e.g. class, type, ... @return device info **/ DevInfo info() raises(DevFailed); /** * query device to see what commands it supports @return list of commands and their types **/ DevCmdInfoList command_list_query() raises(DevFailed); /** * query device to see command argument @return command and its types @param command name **/ DevCmdInfo command_query(in string command) raises(DevFailed); }; //------------------------------------------------------------------------- // // The Device_2 interface // //------------------------------------------------------------------------- /** * A new release of the basic Device interface. * This new release has been introduced mainly to support Tango device server * internal polling. Inheritance is used between this new release and the * old one. This release mainly defines a new release of the command_inout and * read_attributes calls with a new parameter. It also add a new call to read * command or attributes result history. **/ interface Device_2: Device { /** * Execute a command on a device synchronously with * one input parameter and one output parameter @param command ascii string e.g. "On" @param argin command input parameter e.g. float @param source The data source. Used to specify if the command result must be read from the polling cache buffer or from the device itself @return command result. **/ any command_inout_2(in string command, in any argin, in DevSource source) raises(DevFailed); /** * Read a variable list of attributes from a device @param name list of attribute names to read @param source The data source. Used to specify if the command result must be read from the polling cache buffer or from the device itself @return list of attribute values read **/ AttributeValueList read_attributes_2(in DevVarStringArray names, in DevSource source) raises(DevFailed); /** * Read the configuration for a variable list of attributes from a device. * Compared to the Device interface, the attribute configuration has one more * field (The display level) @param name list of attribute names to read @return list of attribute configurations read **/ AttributeConfigList_2 get_attribute_config_2(in DevVarStringArray names) raises(DevFailed); /** * Query device to see what commands it supports. * Compared to the Device interface, the command configuration has one more * field (The display level) @return list of commands and their types **/ DevCmdInfoList_2 command_list_query_2() raises(DevFailed); /** * Query device to see command argument. * Compared to the Device interface, the command configuration has one more * field (The display level) @return command and its types @param command name **/ DevCmdInfo_2 command_query_2(in string command) raises(DevFailed); /** * Get command history buffer. * Return command result history for polled command @param command ascii string e.g. "On" @param n The history depth @return command history. **/ DevCmdHistoryList command_inout_history_2(in string command, in long n) raises (DevFailed); /** * Get attribute value history buffer. * Return attribute value history for polled attribute @param name ascii string @param n The history depth @return attribute value history. **/ DevAttrHistoryList read_attribute_history_2(in string name, in long n) raises (DevFailed); }; //------------------------------------------------------------------------- // // The Device_3 interface (corresponding to Tango V5) // //------------------------------------------------------------------------- interface Device_3: Device_2 { /** * Read a variable list of attributes from a device @param name list of attribute names to read @param source The data source. Used to specify if the command result must be read from the polling cache buffer or from the device itself @return list of attribute values read **/ AttributeValueList_3 read_attributes_3(in DevVarStringArray names, in DevSource source) raises(DevFailed); /** * write a variable list of attributes to a device @param values list of attribute values to write @return nothing **/ void write_attributes_3(in AttributeValueList values) raises(DevFailed,MultiDevFailed); /** * Get attribute value history buffer. * Return attribute value history for polled attribute @param name ascii string @param n The history depth @return attribute value history. **/ DevAttrHistoryList_3 read_attribute_history_3(in string name, in long n) raises (DevFailed); /** * return general information about object e.g. class, type, ... @return device info **/ DevInfo_3 info_3() raises(DevFailed); /** * Read the configuration for a variable list of attributes from a device. * Compared to the Device interface, the attribute configuration has one more * field (The display level) @param name list of attribute names to read @return list of attribute configurations read **/ AttributeConfigList_3 get_attribute_config_3(in DevVarStringArray names) raises(DevFailed); /** * set the configuration for a variable list of attributes from the device @param new_conf list of attribute configuration to be set @return nothing **/ void set_attribute_config_3(in AttributeConfigList_3 new_conf) raises(DevFailed); }; //------------------------------------------------------------------------- // // The Device_4 interface (corresponding to Tango V7) // //------------------------------------------------------------------------- interface Device_4: Device_3 { /** * Get attribute value history buffer. * Return attribute value history for polled attribute @param name ascii string @param n The history depth @return attribute value history. **/ DevAttrHistory_4 read_attribute_history_4(in string name, in long n) raises (DevFailed); /** * Get command history buffer. * Return command result history for polled command @param command ascii string e.g. "On" @param n The history depth @return command history. **/ DevCmdHistory_4 command_inout_history_4(in string command, in long n) raises (DevFailed); /** * Execute a command on a device synchronously with * one input parameter and one output parameter @param command ascii string e.g. "On" @param argin command input parameter e.g. float @param source The data source. Used to specify if the command result must be read from the polling cache buffer or from the device itself @param cl_ident The client identificator @return command result. **/ any command_inout_4(in string command, in any argin, in DevSource source, in ClntIdent cl_ident) raises(DevFailed); /** * Read a variable list of attributes from a device @param name list of attribute names to read @param source The data source. Used to specify if the command result must be read from the polling cache buffer or from the device itself @return list of attribute values read **/ AttributeValueList_4 read_attributes_4(in DevVarStringArray names, in DevSource source,in ClntIdent cl_ident) raises(DevFailed); /** * write a variable list of attributes to a device @param values list of attribute values to write @return nothing **/ void write_attributes_4(in AttributeValueList_4 values,in ClntIdent cl_ident) raises(DevFailed,MultiDevFailed); /** * set the configuration for a variable list of attributes from the device @param new_conf list of attribute configuration to be set @return nothing **/ void set_attribute_config_4(in AttributeConfigList_3 new_conf,in ClntIdent cl_ident) raises(DevFailed); /** * Write then Read device attribute(s) @param values List of attribute values to be written @param cl_ident The client identificator @return Attributes value read **/ AttributeValueList_4 write_read_attributes_4(in AttributeValueList_4 values,in ClntIdent cl_ident) raises(DevFailed,MultiDevFailed); }; }; /* module tango */ tango-8.1.2c+dfsg.orig/lib/idl/Makefile.in0000644000175000017500000003453112205375243017167 0ustar piccapicca# Makefile.in generated by automake 1.11.3 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 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. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ subdir = lib/idl DIST_COMMON = README $(srcdir)/Makefile.am $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/RSSH_CHECK_OMNIORB.m4 \ $(top_srcdir)/m4/RSSH_CHECK_PTHREADS.m4 \ $(top_srcdir)/m4/RSSH_CHECK_SUNPRO_CC.m4 \ $(top_srcdir)/m4/RSSH_ENABLE_PTHREADS.m4 \ $(top_srcdir)/m4/ac_cxx_have_class_strstream.m4 \ $(top_srcdir)/m4/ac_cxx_have_sstream.m4 \ $(top_srcdir)/m4/ac_cxx_namespaces.m4 \ $(top_srcdir)/m4/ac_path_mysqlclient.m4 \ $(top_srcdir)/m4/ac_prog_mysql.m4 \ $(top_srcdir)/m4/ax_cxx_compile_stdcxx_11.m4 \ $(top_srcdir)/m4/ax_jni_include_dir.m4 \ $(top_srcdir)/m4/check_zlib.m4 $(top_srcdir)/m4/gcc_release.m4 \ $(top_srcdir)/m4/java_release.m4 $(top_srcdir)/m4/libtool.m4 \ $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ $(top_srcdir)/m4/mysql_release.m4 $(top_srcdir)/configure.in am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/ac_config.h.tmp CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = SOURCES = DIST_SOURCES = 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)$(idldir)" DATA = $(idl_DATA) DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ ALLOCA = @ALLOCA@ AMTAR = @AMTAR@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CORBA_INCLUDES = @CORBA_INCLUDES@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CPP_ELEVEN = @CPP_ELEVEN@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DATADIR = @DATADIR@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DOXYGEN = @DOXYGEN@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ GREP = @GREP@ HAVE_CXX11 = @HAVE_CXX11@ HAVE_ORB_IDL = @HAVE_ORB_IDL@ IDL = @IDL@ IDLCXX = @IDLCXX@ IDLCXXFLAGS = @IDLCXXFLAGS@ IDLFLAGS = @IDLFLAGS@ IDL_CLN_CPP = @IDL_CLN_CPP@ IDL_CLN_CPP_SUFFIX = @IDL_CLN_CPP_SUFFIX@ IDL_CLN_H = @IDL_CLN_H@ IDL_CLN_H1_SUFFIX = @IDL_CLN_H1_SUFFIX@ IDL_CLN_H_SUFFIX = @IDL_CLN_H_SUFFIX@ IDL_CLN_O = @IDL_CLN_O@ IDL_CLN_OBJ_SUFFIX = @IDL_CLN_OBJ_SUFFIX@ IDL_H1_SUFFIX = @IDL_H1_SUFFIX@ IDL_H_SUFFIX = @IDL_H_SUFFIX@ IDL_SRV_CPP = @IDL_SRV_CPP@ IDL_SRV_CPP_SUFFIX = @IDL_SRV_CPP_SUFFIX@ IDL_SRV_H = @IDL_SRV_H@ IDL_SRV_H1_SUFFIX = @IDL_SRV_H1_SUFFIX@ IDL_SRV_H_SUFFIX = @IDL_SRV_H_SUFFIX@ IDL_SRV_O = @IDL_SRV_O@ IDL_SRV_OBJ_SUFFIX = @IDL_SRV_OBJ_SUFFIX@ IDL_TIE_CPP_SUFFIX = @IDL_TIE_CPP_SUFFIX@ IDL_TIE_H1_SUFFIX = @IDL_TIE_H1_SUFFIX@ IDL_TIE_H_SUFFIX = @IDL_TIE_H_SUFFIX@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ JAVA = @JAVA@ JAVAC = @JAVAC@ JAVAH = @JAVAH@ JNI_INCL_DIRS = @JNI_INCL_DIRS@ JPEG_LIB_CXXFLAGS = @JPEG_LIB_CXXFLAGS@ JPEG_MMX_LIB_CXXFLAGS = @JPEG_MMX_LIB_CXXFLAGS@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIBZMQ_CFLAGS = @LIBZMQ_CFLAGS@ LIBZMQ_LIBS = @LIBZMQ_LIBS@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ LYX = @LYX@ MAINT = @MAINT@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ MYSQL = @MYSQL@ MYSQLCLIENT_CFLAGS = @MYSQLCLIENT_CFLAGS@ MYSQLCLIENT_LDFLAGS = @MYSQLCLIENT_LDFLAGS@ MYSQLCLIENT_LIBS = @MYSQLCLIENT_LIBS@ MYSQL_ADMIN = @MYSQL_ADMIN@ MYSQL_ADMIN_PASSWD = @MYSQL_ADMIN_PASSWD@ MYSQL_HOST = @MYSQL_HOST@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ ORB = @ORB@ ORB_COSNAMING_LIB = @ORB_COSNAMING_LIB@ ORB_INCLUDE_PREFIX = @ORB_INCLUDE_PREFIX@ ORB_PREFIX = @ORB_PREFIX@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ TANGO_DB_NAME = @TANGO_DB_NAME@ TANGO_RC_FILE = @TANGO_RC_FILE@ VERSION = @VERSION@ VERSION_INFO = @VERSION_INFO@ ZLIB_CPPFLAGS = @ZLIB_CPPFLAGS@ ZLIB_LDFLAGS = @ZLIB_LDFLAGS@ ZLIB_LIBS = @ZLIB_LIBS@ ZMQ_PREFIX = @ZMQ_PREFIX@ _ACJNI_JAVAC = @_ACJNI_JAVAC@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_aux_dir = @ac_aux_dir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ omniCOS4_CFLAGS = @omniCOS4_CFLAGS@ omniCOS4_LIBS = @omniCOS4_LIBS@ omniORB4_CFLAGS = @omniORB4_CFLAGS@ omniORB4_LIBS = @omniORB4_LIBS@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ subdirs = @subdirs@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ idldir = ${pkgdatadir}/idl idl_DATA = tango.idl \ README EXTRA_DIST = $(idl_DATA) all: all-am .SUFFIXES: $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu lib/idl/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu lib/idl/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs install-idlDATA: $(idl_DATA) @$(NORMAL_INSTALL) test -z "$(idldir)" || $(MKDIR_P) "$(DESTDIR)$(idldir)" @list='$(idl_DATA)'; test -n "$(idldir)" || list=; \ 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_DATA) $$files '$(DESTDIR)$(idldir)'"; \ $(INSTALL_DATA) $$files "$(DESTDIR)$(idldir)" || exit $$?; \ done uninstall-idlDATA: @$(NORMAL_UNINSTALL) @list='$(idl_DATA)'; test -n "$(idldir)" || list=; \ files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ dir='$(DESTDIR)$(idldir)'; $(am__uninstall_files_from_dir) tags: TAGS TAGS: ctags: CTAGS CTAGS: distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(DATA) installdirs: for dir in "$(DESTDIR)$(idldir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: 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: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-generic clean-libtool mostlyclean-am distclean: distclean-am -rm -f Makefile distclean-am: clean-am distclean-generic dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-idlDATA install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-generic mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-idlDATA .MAKE: install-am install-strip .PHONY: all all-am check check-am clean clean-generic clean-libtool \ distclean distclean-generic distclean-libtool 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-idlDATA 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-generic mostlyclean-libtool pdf pdf-am ps ps-am \ uninstall uninstall-am uninstall-idlDATA # 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: tango-8.1.2c+dfsg.orig/lib/idl/README0000644000175000017500000000006412205375123015771 0ustar piccapiccaThis is the Tango CORBA IDL file. The Tango team tango-8.1.2c+dfsg.orig/lib/idl/Makefile.am0000644000175000017500000000012612205375123017144 0ustar piccapicca idldir = ${pkgdatadir}/idl idl_DATA = tango.idl \ README EXTRA_DIST=$(idl_DATA) tango-8.1.2c+dfsg.orig/lib/Makefile.in0000644000175000017500000004662612205375243016427 0ustar piccapicca# Makefile.in generated by automake 1.11.3 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 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. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ @TANGO_JAVA_ENABLED_TRUE@am__append_1 = java subdir = lib DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/RSSH_CHECK_OMNIORB.m4 \ $(top_srcdir)/m4/RSSH_CHECK_PTHREADS.m4 \ $(top_srcdir)/m4/RSSH_CHECK_SUNPRO_CC.m4 \ $(top_srcdir)/m4/RSSH_ENABLE_PTHREADS.m4 \ $(top_srcdir)/m4/ac_cxx_have_class_strstream.m4 \ $(top_srcdir)/m4/ac_cxx_have_sstream.m4 \ $(top_srcdir)/m4/ac_cxx_namespaces.m4 \ $(top_srcdir)/m4/ac_path_mysqlclient.m4 \ $(top_srcdir)/m4/ac_prog_mysql.m4 \ $(top_srcdir)/m4/ax_cxx_compile_stdcxx_11.m4 \ $(top_srcdir)/m4/ax_jni_include_dir.m4 \ $(top_srcdir)/m4/check_zlib.m4 $(top_srcdir)/m4/gcc_release.m4 \ $(top_srcdir)/m4/java_release.m4 $(top_srcdir)/m4/libtool.m4 \ $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ $(top_srcdir)/m4/mysql_release.m4 $(top_srcdir)/configure.in am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/ac_config.h.tmp CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = SOURCES = DIST_SOURCES = RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \ html-recursive info-recursive install-data-recursive \ install-dvi-recursive install-exec-recursive \ install-html-recursive install-info-recursive \ install-pdf-recursive install-ps-recursive install-recursive \ installcheck-recursive installdirs-recursive pdf-recursive \ ps-recursive uninstall-recursive 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 ETAGS = etags CTAGS = ctags DIST_SUBDIRS = cpp idl java DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) am__relativize = \ dir0=`pwd`; \ sed_first='s,^\([^/]*\)/.*$$,\1,'; \ sed_rest='s,^[^/]*/*,,'; \ sed_last='s,^.*/\([^/]*\)$$,\1,'; \ sed_butlast='s,/*[^/]*$$,,'; \ while test -n "$$dir1"; do \ first=`echo "$$dir1" | sed -e "$$sed_first"`; \ if test "$$first" != "."; then \ if test "$$first" = ".."; then \ dir2=`echo "$$dir0" | sed -e "$$sed_last"`/"$$dir2"; \ dir0=`echo "$$dir0" | sed -e "$$sed_butlast"`; \ else \ first2=`echo "$$dir2" | sed -e "$$sed_first"`; \ if test "$$first2" = "$$first"; then \ dir2=`echo "$$dir2" | sed -e "$$sed_rest"`; \ else \ dir2="../$$dir2"; \ fi; \ dir0="$$dir0"/"$$first"; \ fi; \ fi; \ dir1=`echo "$$dir1" | sed -e "$$sed_rest"`; \ done; \ reldir="$$dir2" ACLOCAL = @ACLOCAL@ ALLOCA = @ALLOCA@ AMTAR = @AMTAR@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CORBA_INCLUDES = @CORBA_INCLUDES@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CPP_ELEVEN = @CPP_ELEVEN@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DATADIR = @DATADIR@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DOXYGEN = @DOXYGEN@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ GREP = @GREP@ HAVE_CXX11 = @HAVE_CXX11@ HAVE_ORB_IDL = @HAVE_ORB_IDL@ IDL = @IDL@ IDLCXX = @IDLCXX@ IDLCXXFLAGS = @IDLCXXFLAGS@ IDLFLAGS = @IDLFLAGS@ IDL_CLN_CPP = @IDL_CLN_CPP@ IDL_CLN_CPP_SUFFIX = @IDL_CLN_CPP_SUFFIX@ IDL_CLN_H = @IDL_CLN_H@ IDL_CLN_H1_SUFFIX = @IDL_CLN_H1_SUFFIX@ IDL_CLN_H_SUFFIX = @IDL_CLN_H_SUFFIX@ IDL_CLN_O = @IDL_CLN_O@ IDL_CLN_OBJ_SUFFIX = @IDL_CLN_OBJ_SUFFIX@ IDL_H1_SUFFIX = @IDL_H1_SUFFIX@ IDL_H_SUFFIX = @IDL_H_SUFFIX@ IDL_SRV_CPP = @IDL_SRV_CPP@ IDL_SRV_CPP_SUFFIX = @IDL_SRV_CPP_SUFFIX@ IDL_SRV_H = @IDL_SRV_H@ IDL_SRV_H1_SUFFIX = @IDL_SRV_H1_SUFFIX@ IDL_SRV_H_SUFFIX = @IDL_SRV_H_SUFFIX@ IDL_SRV_O = @IDL_SRV_O@ IDL_SRV_OBJ_SUFFIX = @IDL_SRV_OBJ_SUFFIX@ IDL_TIE_CPP_SUFFIX = @IDL_TIE_CPP_SUFFIX@ IDL_TIE_H1_SUFFIX = @IDL_TIE_H1_SUFFIX@ IDL_TIE_H_SUFFIX = @IDL_TIE_H_SUFFIX@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ JAVA = @JAVA@ JAVAC = @JAVAC@ JAVAH = @JAVAH@ JNI_INCL_DIRS = @JNI_INCL_DIRS@ JPEG_LIB_CXXFLAGS = @JPEG_LIB_CXXFLAGS@ JPEG_MMX_LIB_CXXFLAGS = @JPEG_MMX_LIB_CXXFLAGS@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIBZMQ_CFLAGS = @LIBZMQ_CFLAGS@ LIBZMQ_LIBS = @LIBZMQ_LIBS@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ LYX = @LYX@ MAINT = @MAINT@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ MYSQL = @MYSQL@ MYSQLCLIENT_CFLAGS = @MYSQLCLIENT_CFLAGS@ MYSQLCLIENT_LDFLAGS = @MYSQLCLIENT_LDFLAGS@ MYSQLCLIENT_LIBS = @MYSQLCLIENT_LIBS@ MYSQL_ADMIN = @MYSQL_ADMIN@ MYSQL_ADMIN_PASSWD = @MYSQL_ADMIN_PASSWD@ MYSQL_HOST = @MYSQL_HOST@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ ORB = @ORB@ ORB_COSNAMING_LIB = @ORB_COSNAMING_LIB@ ORB_INCLUDE_PREFIX = @ORB_INCLUDE_PREFIX@ ORB_PREFIX = @ORB_PREFIX@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ TANGO_DB_NAME = @TANGO_DB_NAME@ TANGO_RC_FILE = @TANGO_RC_FILE@ VERSION = @VERSION@ VERSION_INFO = @VERSION_INFO@ ZLIB_CPPFLAGS = @ZLIB_CPPFLAGS@ ZLIB_LDFLAGS = @ZLIB_LDFLAGS@ ZLIB_LIBS = @ZLIB_LIBS@ ZMQ_PREFIX = @ZMQ_PREFIX@ _ACJNI_JAVAC = @_ACJNI_JAVAC@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_aux_dir = @ac_aux_dir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ omniCOS4_CFLAGS = @omniCOS4_CFLAGS@ omniCOS4_LIBS = @omniCOS4_LIBS@ omniORB4_CFLAGS = @omniORB4_CFLAGS@ omniORB4_LIBS = @omniORB4_LIBS@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ subdirs = @subdirs@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ # We want to continue traversing into cpp and idl SUBDIRS = cpp idl $(am__append_1) all: all-recursive .SUFFIXES: $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu lib/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu lib/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): mostlyclean-libtool: -rm -f *.lo clean-libtool: -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. $(RECURSIVE_TARGETS): @fail= failcom='exit 1'; \ for f in x $$MAKEFLAGS; do \ case $$f in \ *=* | --[!k]*);; \ *k*) failcom='fail=yes';; \ esac; \ done; \ dot_seen=no; \ target=`echo $@ | sed s/-recursive//`; \ list='$(SUBDIRS)'; for subdir in $$list; do \ echo "Making $$target in $$subdir"; \ if test "$$subdir" = "."; then \ dot_seen=yes; \ local_target="$$target-am"; \ else \ local_target="$$target"; \ fi; \ ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ || eval $$failcom; \ done; \ if test "$$dot_seen" = "no"; then \ $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \ fi; test -z "$$fail" $(RECURSIVE_CLEAN_TARGETS): @fail= failcom='exit 1'; \ for f in x $$MAKEFLAGS; do \ case $$f in \ *=* | --[!k]*);; \ *k*) failcom='fail=yes';; \ esac; \ done; \ dot_seen=no; \ case "$@" in \ distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \ *) list='$(SUBDIRS)' ;; \ esac; \ rev=''; for subdir in $$list; do \ if test "$$subdir" = "."; then :; else \ rev="$$subdir $$rev"; \ fi; \ done; \ rev="$$rev ."; \ target=`echo $@ | sed s/-recursive//`; \ for subdir in $$rev; do \ echo "Making $$target in $$subdir"; \ if test "$$subdir" = "."; then \ local_target="$$target-am"; \ else \ local_target="$$target"; \ fi; \ ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ || eval $$failcom; \ done && test -z "$$fail" tags-recursive: list='$(SUBDIRS)'; for subdir in $$list; do \ test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \ done ctags-recursive: list='$(SUBDIRS)'; for subdir in $$list; do \ test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \ done ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ mkid -fID $$unique tags: TAGS TAGS: tags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) set x; \ here=`pwd`; \ if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \ include_option=--etags-include; \ empty_fix=.; \ else \ include_option=--include; \ empty_fix=; \ fi; \ list='$(SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ test ! -f $$subdir/TAGS || \ set "$$@" "$$include_option=$$here/$$subdir/TAGS"; \ fi; \ done; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: CTAGS CTAGS: ctags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ 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 \ dir1=$$subdir; dir2="$(distdir)/$$subdir"; \ $(am__relativize); \ new_distdir=$$reldir; \ dir1=$$subdir; dir2="$(top_distdir)"; \ $(am__relativize); \ new_top_distdir=$$reldir; \ echo " (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir="$$new_top_distdir" distdir="$$new_distdir" \\"; \ echo " am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)"; \ ($(am__cd) $$subdir && \ $(MAKE) $(AM_MAKEFLAGS) \ top_distdir="$$new_top_distdir" \ distdir="$$new_distdir" \ am__remove_distdir=: \ am__skip_length_check=: \ am__skip_mode_fix=: \ distdir) \ || exit 1; \ fi; \ done check-am: all-am check: check-recursive all-am: Makefile installdirs: installdirs-recursive installdirs-am: install: install-recursive install-exec: install-exec-recursive install-data: install-data-recursive uninstall: uninstall-recursive install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-recursive install-strip: 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: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-recursive clean-am: clean-generic clean-libtool mostlyclean-am distclean: distclean-recursive -rm -f Makefile distclean-am: clean-am distclean-generic distclean-tags dvi: dvi-recursive dvi-am: html: html-recursive html-am: info: info-recursive info-am: install-data-am: install-dvi: install-dvi-recursive install-dvi-am: install-exec-am: install-html: install-html-recursive install-html-am: install-info: install-info-recursive install-info-am: install-man: install-pdf: install-pdf-recursive install-pdf-am: install-ps: install-ps-recursive install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-recursive -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-recursive mostlyclean-am: mostlyclean-generic mostlyclean-libtool pdf: pdf-recursive pdf-am: ps: ps-recursive ps-am: uninstall-am: .MAKE: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) ctags-recursive \ install-am install-strip tags-recursive .PHONY: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) CTAGS GTAGS \ all all-am check check-am clean clean-generic clean-libtool \ ctags ctags-recursive distclean 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-generic \ mostlyclean-libtool pdf pdf-am ps ps-am tags tags-recursive \ uninstall uninstall-am # 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: tango-8.1.2c+dfsg.orig/lib/cpp/0000755000175000017500000000000012205375305015125 5ustar piccapiccatango-8.1.2c+dfsg.orig/lib/cpp/server/0000755000175000017500000000000012205375306016434 5ustar piccapiccatango-8.1.2c+dfsg.orig/lib/cpp/server/blackbox.h0000644000175000017500000001375212205375142020400 0ustar piccapicca//============================================================================= // // file : BlackBox.h // // description : Include for the BlackBox object. This class implements // the black box objects which keep tracks of all // operation invoke on a device or attribute retrieved. // This black box is managed as a circular buffer // // project : TANGO // // author(s) : A.Gotz + E.Taurel // // Copyright (C) : 2004,2005,2006,2007,2008,2009,2010,2011,2012,2013 // European Synchrotron Radiation Facility // BP 220, Grenoble 38043 // FRANCE // // This file is part of Tango. // // Tango 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. // // Tango 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 Tango. If not, see . // // $Revision: 22213 $ // //============================================================================= #ifndef _BLACKBOX_H #define _BLACKBOX_H #include #ifdef _TG_WINDOWS_ #include #endif #include #include namespace Tango { #define IP_ADDR_BUFFER_SIZE 80 CORBA::Boolean get_client_addr(omni::omniInterceptors::serverReceiveRequest_T::info_T &); class client_addr: public omni_thread::value_t { public: client_addr():client_ident(false),client_pid(0) {client_ip[0]='\0';::memset(java_ident,0,sizeof(DevULong64)<<1);} client_addr(const char *addr):client_ident(false),client_pid(0) {strcpy(client_ip,addr);} ~client_addr() {}; client_addr(const client_addr &); client_addr & operator=(const client_addr &); bool operator==(const client_addr &); bool operator!=(const client_addr &); bool client_ident; char client_ip[IP_ADDR_BUFFER_SIZE]; LockerLanguage client_lang; TangoSys_Pid client_pid; string java_main_class; DevULong64 java_ident[2]; int client_ip_2_client_name(string &) const; friend ostream &operator<<(ostream &o_str,const client_addr &ca); }; //============================================================================= // // The BlackBoxElt class // // description : Class to store all the necessary information which will // be stored and returned to client on request // //============================================================================= #define DEFAULT_ATTR_NB 10 enum BlackBoxElt_ReqType { Req_Unknown, Req_Operation, Req_Attribute }; enum BlackBoxElt_AttrType { Attr_Unknown, Attr_Name, Attr_Description, Attr_State, Attr_Status, Attr_AdmName }; enum BlackBoxElt_OpType { Op_Unknown, Op_Command_inout, Op_BlackBox, Op_Ping, Op_Info, Op_Command_list, Op_Command, Op_Get_Attr_Config, Op_Set_Attr_Config, Op_Read_Attr, Op_Write_Attr, Op_Command_inout_2, Op_Command_list_2, Op_Command_2, Op_Get_Attr_Config_2, Op_Read_Attr_2, Op_Command_inout_history_2, Op_Read_Attr_history_2, Op_Read_Attr_3, Op_Write_Attr_3, Op_Read_Attr_history_3, Op_Info_3, Op_Get_Attr_Config_3, Op_Set_Attr_Config_3, Op_Read_Attr_history_4, Op_Command_inout_history_4, Op_Command_inout_4, Op_Write_Attr_4, Op_Read_Attr_4, Op_Set_Attr_Config_4, Op_Write_Read_Attributes_4 }; class BlackBoxElt { public: BlackBoxElt(); ~BlackBoxElt(); BlackBoxElt_ReqType req_type; BlackBoxElt_AttrType attr_type; BlackBoxElt_OpType op_type; string cmd_name; vector attr_names; struct timeval when; char host_ip_str[IP_ADDR_BUFFER_SIZE]; DevSource source; bool client_ident; LockerLanguage client_lang; TangoSys_Pid client_pid; string java_main_class; }; inline bool operator<(const BlackBoxElt &,const BlackBoxElt &) { return true; } inline bool operator==(const BlackBoxElt &,const BlackBoxElt &) { return true; } //============================================================================= // // The BlackBox class // // description : Class to implement the black box itself. This is mainly // a vector of BlackBoxElt managed as a circular vector // //============================================================================= class BlackBox { public: BlackBox(); BlackBox(long); void insert_corba_attr(BlackBoxElt_AttrType); void insert_cmd(const char *,long vers=1,DevSource=Tango::DEV); void insert_attr(const Tango::DevVarStringArray &,long vers=1,DevSource=Tango::DEV); void insert_attr(const Tango::DevVarStringArray &,const ClntIdent &,long vers=1,DevSource=Tango::DEV); void insert_attr(const Tango::AttributeValueList &,long vers=1); void insert_attr(const Tango::AttributeValueList_4 &,const ClntIdent &,long vers); void insert_wr_attr(const Tango::AttributeValueList_4 &,const ClntIdent &,long vers); void insert_op(BlackBoxElt_OpType); void insert_op(BlackBoxElt_OpType,const ClntIdent &); void insert_cmd_nl(const char *,long,DevSource); void insert_cmd_cl_ident(const char *,const ClntIdent &,long vers=1,DevSource=Tango::DEV); void add_cl_ident(const ClntIdent &,client_addr *); void update_client_host(client_addr *); Tango::DevVarStringArray *read(long); private: void inc_indexes(); void get_client_host(); void build_info_as_str(long); void date_ux_to_str(struct timeval &,char *); void add_source(long); void insert_op_nl(BlackBoxElt_OpType); void insert_attr_nl(const Tango::AttributeValueList &,long); void insert_attr_nl_4(const Tango::AttributeValueList_4 &); void insert_attr_wr_nl(const Tango::AttributeValueList_4 &,long); vector box; long insert_elt; long nb_elt; long max_elt; omni_mutex sync; string elt_str; }; } // End of Tango namespace #endif /* _BLACKBOX_ */ tango-8.1.2c+dfsg.orig/lib/cpp/server/utils.h0000644000175000017500000011050312205375142017743 0ustar piccapicca//============================================================================= // // file : utils.h // // description : Include for utility functions or classes // // project : TANGO // // author(s) : A.Gotz + E.Taurel // // Copyright (C) : 2004,2005,2006,2007,2008,2009,2010,2011,2012,2013 // European Synchrotron Radiation Facility // BP 220, Grenoble 38043 // FRANCE // // This file is part of Tango. // // Tango 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. // // Tango 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 Tango. If not, see . // // $Revision: 22511 $ // //============================================================================= #ifndef _UTILS_H #define _UTILS_H #include #include #include #include #include #ifndef _TG_WINDOWS_ #include #else #include #include #endif /* _TG_WINDOWS_ */ // // For debug purpose // #ifndef TANGO_HAS_LOG4TANGO #define cout1 if ((Tango::Util::_tracelevel >= 1) && \ (Tango::Util::_tracelevel < 5)) cout #define cout2 if ((Tango::Util::_tracelevel >= 2) && \ (Tango::Util::_tracelevel < 5)) cout #define cout3 if ((Tango::Util::_tracelevel >= 3) && \ (Tango::Util::_tracelevel < 5)) cout #define cout4 if ((Tango::Util::_tracelevel >= 4) && \ (Tango::Util::_tracelevel < 5)) cout #define cout5 if (Tango::Util::_tracelevel >= 5) cout #endif //TANGO_HAS_LOG4TANGO namespace Tango { class DeviceImpl; class DeviceClass; class DServer; class AutoTangoMonitor; class Util; class NotifdEventSupplier; class ZmqEventSupplier; class PyLock; class CreatePyLock; class DbServerCache; class SubDevDiag; struct PollingThreadInfo; struct DevDbUpd; #ifdef _TG_WINDOWS_ class CoutBuf; class W32Win; #endif class PyLock { public: PyLock() {} virtual ~PyLock() {} virtual void Get() {} virtual void Release() {} }; class CreatePyLock { public: CreatePyLock() {} virtual ~CreatePyLock() {} virtual PyLock *create() {return new PyLock();} }; class Interceptors { public: Interceptors() {} virtual ~Interceptors() {} virtual void create_thread() {} virtual void delete_thread() {} }; //============================================================================= // // The Util class // // description : This class contains all properties and methods // which a device server process requires only once e.g. // the orb and boa pointers.... // This class is a singleton ( The constructor is // protected and the _instance data member is static) // // This class must be created at the beginning of each // device server process // //============================================================================= /** * This class is a used to store TANGO device server process data and to provide * the user with a set of utilities method. This class is implemented using * the singleton design pattern. Therefore a device server process can have only * one instance of this class and its constructor is not public. * * $Author: taurel $ * $Revision: 22511 $ * * @headerfile tango.h * @ingroup Server */ class Util { friend class Tango::AutoTangoMonitor; friend class Tango::ApiUtil; public: /**@name Singleton related methods * These methods follow the singleton design pattern (only one instance * of a class) */ //@{ /** * Create and get the singleton object reference. * * This method returns a reference to the object of the Util class. * If the class singleton object has not been created, it will be * instanciated * * @param argc The process command line argument number * @param argv The process commandline arguments * @return The Util object reference */ static Util *init(int argc,char *argv[]); #ifdef _TG_WINDOWS_ /** * Create and get the singleton object reference. * * This method returns a reference to the object of the Util class. * If the class singleton object has not been created, it will be * instanciated. This method must be used only for non-console mode windows * device server * * @param AppInst The application instance * @param CmdShow The display window flag * @return The Util object reference */ TANGO_IMP_EXP static Util *init(HINSTANCE AppInst,int CmdShow); #endif /** * Get the singleton object reference. * * This method returns a reference to the object of the Util class. * If the class has not been initialised with it's init method, this method * print a message and abort the device server process * * @return The Util object reference */ TANGO_IMP_EXP static Util *instance(bool exit = true); //@} /**@name Destructor * Only one destructor is defined for this class */ //@{ /** * The class destructor. */ ~Util(); //@} /**@name Get/Set instance data */ //@{ /** * Get a reference to the CORBA ORB * * This is a CORBA _duplicate of the original reference * * @return The CORBA ORB */ CORBA::ORB_ptr get_orb() {return CORBA::ORB::_duplicate(orb);} /** * Get a reference to the CORBA Portable Object Adapter (POA) * * This is a CORBA _dupilcate of the original reference to the object POA. * For classical device server, thisis the root POA. For no database device * server, this is a specific POA with the USER_ID policy. * * @return The CORBA root POA */ PortableServer::POA_ptr get_poa() {return PortableServer::POA::_duplicate(_poa);} /** * Set the process trace level. * * @param level The new process level */ void set_trace_level(int level) {_tracelevel = level;} /** * Get the process trace level. * * @return The process trace level */ int get_trace_level() {return _tracelevel;} #ifndef TANGO_HAS_LOG4TANGO /** * Set the process trace output . * * @param level The new process output */ void set_trace_output(string &trace) {trace_output = trace;} /** * Get the process trace output. * * @return The process trace output */ string &get_trace_output() {return trace_output;} /** * Get the temporary process output print stream * * @return The process output print stream */ TangoSys_Cout &get_out() {return cout_tmp;} /** * Set the process trace output stream. * * @param in The new process output stream */ void set_trace_output_stream(ofstream *in) {file_stream = in;} /** * Get the process output print stream * * @return The process output print stream */ ofstream *get_trace_output_stream() {return file_stream;} #endif //TANGO_HAS_LOG4TANGO /** * Get the device server instance name. * * @return The device server instance name */ string &get_ds_inst_name() {return ds_instance_name;} /** * Get the device server executable name. * * @return The device server executable name */ string &get_ds_exec_name() {return ds_exec_name;} /** * Get the device server name. * * The device server name is the device server executable name/the device * server instance name * @return The device server name */ string &get_ds_name() {return ds_name;} /** * Get the host name where the device server process is running. * * @return The host name */ string &get_host_name() {return hostname;} /** * Get the device server process identifier as a String * * @return The device server process identifier as a string */ string &get_pid_str() {return pid_str;} /** * Get the device server process identifier * * @return The device server process identifier */ TangoSys_Pid get_pid() {return pid;} /** * Get the TANGO library version number. * * @return The Tango library release number coded in 3 digits * (for instance 550,551,552,600,....) */ long get_tango_lib_release(); /** * Get the IDL TANGO version. * * @return The device server version */ string &get_version_str() {return version_str;} /** * Get the device server version. * * @return The device server version */ string &get_server_version() {return server_version;} /** * Set the device server version. * * @param vers The device server version */ void set_server_version(const char *vers) {server_version = vers;} /** * Set the DeviceClass list pointer * * @param list The DeviceClass ptr vector address */ void set_class_list(vector *list) {cl_list_ptr = list;cl_list = *list;} /** * Add a DeviceClass to the DeviceClass list pointer * * @param cl The DeviceClass ptr */ void add_class_to_list(DeviceClass * cl) {cl_list.push_back(cl);} /** * Get the DeviceClass list pointer * * @return The DeviceClass ptr vector address */ const vector *get_class_list() {return &cl_list;} /** * Set the serialization model * * @param ser The new serialization model. The serialization model must be one * of BY_DEVICE, BY_CLASS, BY_PROCESS or NO_SYNC */ void set_serial_model(SerialModel ser) {ext->ser_model = ser;} /** * Get the serialization model * * @return The serialization model. This serialization model is one of * BY_DEVICE, BY_CLASS, BY_PROCESS or NO_SYNC */ SerialModel get_serial_model() {return ext->ser_model;} /** * Get a reference to the notifd TANGO EventSupplier object * * @return The notifd EventSupplier object */ NotifdEventSupplier *get_notifd_event_supplier() {return ext->nd_event_supplier;} /** * Get a reference to the ZMQ TANGO EventSupplier object * * @return The zmq EventSupplier object */ ZmqEventSupplier *get_zmq_event_supplier() {return ext->zmq_event_supplier;} /** * Set device server process event buffer high water mark (HWM) * * @param val The new event buffer high water mark in number of events */ void set_ds_event_buffer_hwm(DevLong val) {if (ext->user_pub_hwm == -1)ext->user_pub_hwm = val;} //@} /** @name Polling related methods */ //@{ /** * Trigger polling for polled command. * * This method send the order to the polling thread to poll one object * registered with an update period defined as "externally triggerred" * * @param dev The TANGO device * @param name The command name which must be polled * @exception DevFailed If the call failed * Click here to read * DevFailed exception specification */ void trigger_cmd_polling(DeviceImpl *dev,const string &name); /** * Trigger polling for polled attribute. * * This method send the order to the polling thread to poll one object * registered with an update period defined as "externally triggerred" * * @param dev The TANGO device * @param name The attribute name which must be polled * @exception DevFailed If the call failed * Click here to read * DevFailed exception specification */ void trigger_attr_polling(DeviceImpl *dev,const string &name); /** * Fill polling buffer for polled attribute. * * This method fills the polling buffer for one polled attribute * registered with an update period defined as "externally triggerred" * (polling period set to 0) * * @param dev The TANGO device * @param att_name The attribute name which must be polled * @param data The data stack with one element for each history element * @exception DevFailed If the call failed * Click here to read * DevFailed exception specification */ template void fill_attr_polling_buffer(DeviceImpl *dev, string &att_name, AttrHistoryStack &data); /** * Fill polling buffer for polled command. * * This method fills the polling buffer for one polled command * registered with an update period defined as "externally triggerred" * (polling period set to 0) * * @param dev The TANGO device * @param cmd_name The command name which must be polled * @param data The data stack with one element for each history element * @exception DevFailed If the call failed * Click here to read * DevFailed exception specification */ template void fill_cmd_polling_buffer(DeviceImpl *dev, string &cmd_name, CmdHistoryStack &data); /** * Set the polling threads pool size * * @param thread_nb The maximun number of threads in the polling threads pool */ void set_polling_threads_pool_size(unsigned long thread_nb) {ext->poll_pool_size = thread_nb;} /** * Get the polling threads pool size * * @return The maximun number of threads in the polling threads pool */ unsigned long get_polling_threads_pool_size() {return ext->poll_pool_size;} //@} /**@name Miscellaneous methods */ //@{ /** * Check if the device server process is in its starting phase * * @return A boolean set to true if the server is in its starting phase. */ bool is_svr_starting() {return ext->svr_starting;} /** * Check if the device server process is in its shutting down sequence * * @return A boolean set to true if the server is in its shutting down phase. */ bool is_svr_shutting_down() {return ext->svr_stopping;} /** * Check if the device is actually restarted by the device server * process admin device with its DevRestart command * * @return A boolean set to true if the device is restarting. */ bool is_device_restarting(string &d_name); //@} /**@name Database related methods */ //@{ /** * Connect the process to the TANGO database. * * If the connection to the database failed, a message is displayed on the * screen and the process is aborted */ void connect_db(); /** * Reread the file database */ void reset_filedatabase(); /** * Get a reference to the TANGO database object * * @return The database object */ Database *get_database() {return db;} /** * Unregister a device server process from the TANGO database. * * If the database call fails, a message is displayed on the screen and the * process is aborted */ void unregister_server(); //@} /** @name Device reference related methods */ //@{ /** * Get the list of device references for a given TANGO class. * * Return the list of references for all devices served by one implementation * of the TANGO device pattern implemented in the process * * @param class_name The TANGO device class name * @return The device reference list * @exception DevFailed If in the device server process there is no TANGO * device pattern implemented the TANGO device class given as parameter * Click here to read * DevFailed exception specification */ vector &get_device_list_by_class(const string &class_name); /** * Get the list of device references for a given TANGO class. * * Return the list of references for all devices served by one implementation * of the TANGO device pattern implemented in the process * * @param class_name The TANGO device class name * @return The device reference list * @exception DevFailed If in the device server process there is no TANGO * device pattern implemented the TANGO device class given as parameter * Click here to read * DevFailed exception specification */ vector &get_device_list_by_class(const char *class_name); /** * Get a device reference from its name * * @param dev_name The TANGO device name * @return The device reference * @exception DevFailed If in the device is not served by one device pattern * implemented in this process. * Click here to read * DevFailed exception specification */ DeviceImpl *get_device_by_name(const string &dev_name); /** * Get a device reference from its name * * @param dev_name The TANGO device name * @return The device reference * @exception DevFailed If in the device is not served by one device pattern * implemented in this process. * Click here to read * DevFailed exception specification */ DeviceImpl *get_device_by_name(const char *dev_name); /** * Get a reference to the dserver device attached to the device server process * * @return A reference to the dserver device */ DServer *get_dserver_device(); /** * Get DeviceList from name. * * It is possible to use a wild card ('*') in the name parameter * (e.g. "*", "/tango/tangotest/n*", ...) * * @param name The device name * @return The DeviceClass ptr vector address */ vector get_device_list(const string &name); //@} /** @name Device pattern related methods */ //@{ /** * Initialise all the device server pattern(s) embedded in a device server * process. * * @exception DevFailed If the device pattern initialisation failed * Click here to read * DevFailed exception specification */ void server_init(bool with_window = false); /** * Run the CORBA event loop * * This method runs the CORBA event loop. For UNIX or Linux operating system, * this method does not return. For Windows in a non-console mode, * this method start a thread which enter the CORBA event loop. */ void server_run(); /** * Cleanup a Tango device server process before exit * * This method cleanup a Tango device server and relinquish all computer * resources before the process exit */ void server_cleanup(); /** * Set the server event loop * * This method registers an event loop function in a Tango server. * This function will be called by the process main thread in an infinite loop * The process will not use the classical ORB blocking event loop. * It is the user responsability to code this function in a way that it implements * some kind of blocking in order not to load the computer CPU * * @param f_ptr The event loop function pointer. This function will not receive * any argument. It returns a boolean value. If this boolean is set to true, * the device server process exit. */ void server_set_event_loop(bool (*f_ptr)()) {ext->ev_loop_func = f_ptr;} //@} /**@name Class data members */ //@{ /** * The process trace level */ static int _tracelevel; /** * The database use flag (Use with extreme care). Implemented for device * server started without database usage. */ TANGO_IMP static bool _UseDb; /** * A daemon process flag. If this flag is set to true, the server * process will not exit if it not able to connect to the database. * Instead, it will loop until the connection suceeds. The default * value is false. */ TANGO_IMP static bool _daemon; /** * The loop sleeping time in case of the _daemon flag set to true. * This sleeping time is the number of seconds the process will * sleep before it tries again to connect to the database. The default * value is 60 seconds. */ TANGO_IMP static long _sleep_between_connect; //@} /// @privatesection TANGO_IMP static bool _FileDb; /// @publicsection #ifdef _TG_WINDOWS_ /**@name Windows specific methods */ //@{ /** * Get the console window instance * * @return The device server graphical interface console window instance */ HWND get_console_window(); /** * Get the main window instance * * @return The device server graphical interface main window instance */ HWND get_ds_main_window(); /** * Get a pointer to the debug object * * @return A pointer to the debug object */ CoutBuf *get_debug_object(); TANGO_IMP static bool _service; /** * Get the text displayed on main server window. * * @return The text to be displayed */ string &get_main_window_text() {return main_win_text;} /** * Set the text displayed on main server window. * * @param txt The new text to be displayed at the bottom of the * main window */ void set_main_window_text(string &txt) {main_win_text = txt;} //@} #endif protected: /** * Constructs a newly allocated Util object. * * This constructor is protected following the singleton pattern * * @param argc The process command line argument number * @param argv The process commandline arguments * */ Util(int argc,char *argv[]); #ifdef _TG_WINDOWS_ /** * Constructs a newly allocated Util object for Windows non-console * device server. * * This constructor is protected following the singleton pattern * * @param AppInst The applicationinstance * @param CmdShow The display window flag * */ Util(HINSTANCE AppInst,int CmdShow); #endif // // The extension class // private: class UtilExt { public: UtilExt():heartbeat_th(NULL),heartbeat_th_id(0), poll_mon("utils_poll"),poll_on(false),ser_model(BY_DEVICE),only_one("process"), nd_event_supplier(NULL),py_interp(NULL),py_ds(false),py_dbg(false),db_cache(NULL), inter(NULL),svr_starting(true),svr_stopping(false),poll_pool_size(ULONG_MAX), conf_needs_db_upd(false),ev_loop_func(NULL),shutdown_server(false),_dummy_thread(false), zmq_event_supplier(NULL),endpoint_specified(false),user_pub_hwm(-1),wattr_nan_allowed(false) {shared_data.cmd_pending=false;shared_data.trigger=false; cr_py_lock = new CreatePyLock();} ~UtilExt() {delete cr_py_lock;} vector cmd_line_name_list; PollThread *heartbeat_th; // The heartbeat thread object int heartbeat_th_id; // The heartbeat thread identifier PollThCmd shared_data; // The shared buffer TangoMonitor poll_mon; // The monitor bool poll_on; // Polling on flag SerialModel ser_model; // The serialization model TangoMonitor only_one; // Serialization monitor NotifdEventSupplier *nd_event_supplier; // The notifd event supplier object void *py_interp; // The Python interpreter bool py_ds; // The Python DS flag CreatePyLock *cr_py_lock; // The python lock creator pointer bool py_dbg; // Badly written Python dbg flag DbServerCache *db_cache; // The db cache Interceptors *inter; // The user interceptors bool svr_starting; // Server is starting flag bool svr_stopping; // Server is shutting down flag vector polled_dyn_attr_names; // Dynamic att. names (used for polling clean-up) vector polled_att_list; // Full polled att list vector all_dyn_attr; // All dynamic attr name list string dyn_att_dev_name; // Device name (use for dyn att clean-up) unsigned long poll_pool_size; // Polling threads pool size vector poll_pool_conf; // Polling threads pool conf. map dev_poll_th_map; // Link between device name and polling thread id vector poll_ths; // Polling threads bool conf_needs_db_upd; // Polling conf needs to be udated in db bool (*ev_loop_func)(void); // Ptr to user event loop bool shutdown_server; // Flag to exit the manual event loop SubDevDiag sub_dev_diag; // Object to handle sub device diagnostics bool _dummy_thread; // The main DS thread is not the process main thread string svr_port_num; // Server port when using file as database ZmqEventSupplier *zmq_event_supplier; // The zmq event supplier object bool endpoint_specified; // Endpoint specified on cmd line string specified_ip; // IP address specified in the endpoint DevLong user_pub_hwm; // User defined pub HWM vector restarting_devices; // Restarting devices name bool wattr_nan_allowed; // NaN allowed when writing attribute }; public: /// @privatesection void set_interceptors(Interceptors *in) {ext->inter = in;} Interceptors *get_interceptors() {return ext->inter;} vector &get_cmd_line_name_list() {return ext->cmd_line_name_list;} TangoMonitor &get_heartbeat_monitor() {return ext->poll_mon;} PollThCmd &get_heartbeat_shared_cmd() {return ext->shared_data;} bool poll_status() {return ext->poll_on;} void poll_status(bool status) {ext->poll_on = status;} // // Some methods are duplicated here (with different names). It is for compatibility reason // void polling_configure(); PollThread *get_polling_thread_object() {return ext->heartbeat_th;} PollThread *get_heartbeat_thread_object() {return ext->heartbeat_th;} void clr_poll_th_ptr() {ext->heartbeat_th = NULL;} void clr_heartbeat_th_ptr() {ext->heartbeat_th = NULL;} int get_polling_thread_id() {return ext->heartbeat_th_id;} int get_heartbeat_thread_id() {return ext->heartbeat_th_id;} void stop_heartbeat_thread(); string &get_svr_port_num() {return ext->svr_port_num;} void create_notifd_event_supplier(); void create_zmq_event_supplier(); void *get_py_interp() {return ext->py_interp;} void set_py_interp(void *ptr) {ext->py_interp = ptr;} bool is_py_ds() {return ext->py_ds;} void set_py_ds() {ext->py_ds=true;} bool is_py_dbg() {return ext->py_dbg;} void set_py_dbg() {ext->py_dbg=true;} void set_py_lock_creator(CreatePyLock *py) {ext->cr_py_lock = py;} CreatePyLock *get_py_lock_creator() {return ext->cr_py_lock;} DbServerCache *get_db_cache() {return ext->db_cache;} void unvalidate_db_cache() {if (ext->db_cache!=NULL){delete ext->db_cache;ext->db_cache = NULL;}} void set_svr_starting(bool val) {ext->svr_starting = val;} void set_svr_shutting_down(bool val) {ext->svr_stopping = val;} vector &get_polled_dyn_attr_names() {return ext->polled_dyn_attr_names;} vector &get_full_polled_att_list() {return ext->polled_att_list;} string &get_dyn_att_dev_name() {return ext->dyn_att_dev_name;} vector &get_all_dyn_attr_names() {return ext->all_dyn_attr;} void clean_attr_polled_prop(); void clean_dyn_attr_prop(); int create_poll_thread(const char *dev_name,bool startup,int smallest_upd = -1); void stop_all_polling_threads(); vector &get_polling_threads_info() {return ext->poll_ths;} PollingThreadInfo *get_polling_thread_info_by_id(int); int get_polling_thread_id_by_name(const char *); void check_pool_conf(DServer *,unsigned long); int check_dev_poll(vector &,vector &,DeviceImpl *); void split_string(string &,char,vector &); void upd_polling_prop(vector &,DServer *); int get_th_polled_devs(string &,vector &); void get_th_polled_devs(long,vector &); void build_first_pool_conf(vector &); bool is_dev_already_in_pool_conf(string &,vector&,int); vector &get_poll_pool_conf() {return ext->poll_pool_conf;} int get_dev_entry_in_pool_conf(string &); void remove_dev_from_polling_map(string &dev_name); void remove_polling_thread_info_by_id(int); bool is_server_event_loop_set() {if (ext->ev_loop_func != NULL)return true;else return false;} void set_shutdown_server(bool val) {ext->shutdown_server = val;} void shutdown_server(); SubDevDiag &get_sub_dev_diag() {return ext->sub_dev_diag;} bool get_endpoint_specified() {return ext->endpoint_specified;} void set_endpoint_specified(bool val) {ext->endpoint_specified = val;} string &get_specified_ip() {return ext->specified_ip;} void set_specified_ip(string &val) {ext->specified_ip = val;} DevLong get_user_pub_hwm() {return ext->user_pub_hwm;} void add_restarting_device(string &d_name) {ext->restarting_devices.push_back(d_name);} void delete_restarting_device(string &d_name); bool is_wattr_nan_allowed() {return ext->wattr_nan_allowed;} void set_wattr_nan_allowed(bool val) {ext->wattr_nan_allowed=val;} private: TANGO_IMP static Util *_instance; static bool _constructed; #ifdef _TG_WINDOWS_ static bool _win; int argc; char **argv; int nCmd; CoutBuf *pcb; W32Win *ds_window; string main_win_text; bool go; TangoMonitor mon; void build_argc_argv(); void install_cons_handler(); class ORBWin32Loop: public omni_thread { Util *util; public: ORBWin32Loop(Util *u):util(u) {} virtual ~ORBWin32Loop() {} void *run_undetached(void *); void start() {start_undetached();} private: void wait_for_go(); }; friend class ORBWin32Loop; ORBWin32Loop *loop_th; #endif CORBA::ORB_var orb; PortableServer::POA_var _poa; string ds_instance_name; // The instance name string ds_exec_name; // The server exec. name string ds_name; // The server name string hostname; // The host name string pid_str; // The process PID (as string) TangoSys_Pid pid; // The process PID string version_str; // Tango version string server_version; // Device server version string database_file_name; #ifndef TANGO_HAS_LOG4TANGO string trace_output; TangoSys_Cout cout_tmp; ofstream *file_stream; #endif //TANGO_HAS_LOG4TANGO Database *db; // The db proxy void effective_job(int,char *[]); void create_CORBA_objects(); void misc_init(); void init_host_name(); void server_already_running(); void print_usage(char *); static void print_err_message(const char *,Tango::MessBoxType type = Tango::STOP); void print_err_message(const string &mess,Tango::MessBoxType type = Tango::STOP) { print_err_message(mess.c_str(),type); } void check_args(int, char *[]); void display_help_message(); DeviceImpl *find_device_name_core(string &); void check_orb_endpoint(int,char **); bool display_help; // display help message flag const vector *cl_list_ptr; // Ptr to server device class list #ifdef HAS_UNIQUE_PTR unique_ptr ext; // Class extension #else Util::UtilExt *ext; // Class extension #endif vector cl_list; // Full class list ptr }; // Add template methods definitions #include //*************************************************************************** // // Some inline methods // //*************************************************************************** //----------------------------------------------------------------------------- // // method : Util::is_device_restarting() // // description : Return a boolean if the device with name given as parameter // is actually executing a RestartDevice command // // args: - d_name : - The device name // // Returns true if the devce is restarting. False otherwise // //----------------------------------------------------------------------------- inline bool Util::is_device_restarting(string &d_name) { bool ret = false; if (ext->restarting_devices.empty() == false) { vector::iterator pos; pos = find(ext->restarting_devices.begin(),ext->restarting_devices.end(),d_name); if (pos != ext->restarting_devices.end()) ret = true; } return ret; } //----------------------------------------------------------------------------- // // method : Util::is_device_restarting() // // description : Return a boolean if the device with name given as parameter // is actually executing a RestartDevice command // // args: - d_name : - The device name // // Returns true if the devce is restarting. False otherwise // //----------------------------------------------------------------------------- inline void Util::check_orb_endpoint(int argc, char *argv[]) { long arg_nb; for (arg_nb = 2;arg_nb < argc;arg_nb++) { if (::strcmp(argv[arg_nb],"-ORBendPoint") == 0) { arg_nb++; string endpoint = argv[arg_nb]; string::size_type pos; if ((pos = endpoint.rfind(':')) == string::npos) { cerr << "Strange ORB endPoint specification" << endl; print_usage(argv[0]); } ext->svr_port_num = endpoint.substr(++pos); break; } } if (arg_nb == argc) { cerr << "Missing ORB endPoint specification" << endl; print_usage(argv[0]); } } //+------------------------------------------------------------------------- // // function : return_empty_any // // description : Return from a command when the command does not have // any output argument // // arguments : in : - cmd : The command name // //-------------------------------------------------------------------------- /** * Create and return an empty CORBA Any object. * * Create an empty CORBA Any object. Could be used by command which does * not return anything to the client. This method also prints a message on * screen (level 4) before it returns * * @param cmd The cmd name which use this empty Any. Only used to create the * thrown exception (in case of) and in the displayed message * @return The empty CORBA Any * @exception DevFailed If the Any object creation failed. * Click here to read * DevFailed exception specification */ inline CORBA::Any *return_empty_any(const char *cmd) { CORBA::Any *out_any = NULL; try { out_any = new CORBA::Any(); } catch (bad_alloc) { TangoSys_MemStream o; o << cmd << "::execute"; Tango::Except::throw_exception((const char *)API_MemoryAllocation, (const char *)"Can't allocate memory in server", o.str()); } return(out_any); } inline DbDevice *DeviceImpl::get_db_device() { if (Tango::Util::_UseDb == false) { TangoSys_OMemStream desc_mess; desc_mess << "Method not available for device "; desc_mess << device_name; desc_mess << " which is a non database device"; Except::throw_exception((const char *)API_NonDatabaseDevice, desc_mess.str(), (const char *)"DeviceImpl::get_db_device"); } return db_dev; } void clear_att_dim(Tango::AttributeValue_3 &att_val); void clear_att_dim(Tango::AttributeValue_4 &att_val); //----------------------------------------------------------------------- // // Polling threads pool related class/struct // //----------------------------------------------------------------------- struct PollingThreadInfo { int thread_id; // The polling thread identifier PollThread *poll_th; // The polling thread object PollThCmd shared_data; // The shared buffer TangoMonitor poll_mon; // The monitor vector polled_devices; // Polled devices for this thread int nb_polled_objects; // Polled objects number in this thread int smallest_upd; // Smallest thread update period vector v_poll_cmd; // Command(s) to send PollingThreadInfo():thread_id(0),poll_th(NULL),poll_mon("Polling_thread_mon"),nb_polled_objects(0),smallest_upd(0) {shared_data.cmd_pending = false;shared_data.trigger=false;} }; struct DevDbUpd { unsigned long class_ind; unsigned long dev_ind; int mod_prop; }; //------------------------------------------------------------------------ // // Python device server classes // //----------------------------------------------------------------------- // // For thread creation interceptor (Python device servers) // void create_PyPerThData(omni::omniInterceptors::createThread_T::info_T &); class PyData: public omni_thread::value_t { public: PyData():rec_state(false),rec_status(false) { device_name = "No associated device name!"; try { Util *tg = Util::instance(false); CreatePyLock *Creator = tg->get_py_lock_creator(); PerTh_py_lock = Creator->create(); } catch(Tango::DevFailed &) {PerTh_py_lock=NULL;} } ~PyData() { if (PerTh_py_lock != NULL) delete PerTh_py_lock; } DevVarCharArray PerTh_dvca; DevVarShortArray PerTh_dvsha; DevVarLongArray PerTh_dvla; DevVarFloatArray PerTh_dvfa; DevVarDoubleArray PerTh_dvda; DevVarUShortArray PerTh_dvusa; DevVarULongArray PerTh_dvula; DevVarStringArray PerTh_dvsa; DevVarLongStringArray PerTh_dvlsa; DevVarDoubleStringArray PerTh_dvdsa; DevVarLong64Array PerTh_dvl64a; DevVarULong64Array PerTh_dvul64a; DevVarEncodedArray PerTh_dvea; string PerTh_string; DevFailed PerTh_df; vector PerTh_vec_str; vector PerTh_vec_db; DevErrorList PerTh_del; bool rec_state; bool rec_status; // name of the associated device to a thread // used to sub device referencing string device_name; PyLock *PerTh_py_lock; }; class AutoPyLock { public: AutoPyLock(); ~AutoPyLock(); }; long _convert_tango_lib_release(); } // End of Tango namespace #endif /* UTILS */ tango-8.1.2c+dfsg.orig/lib/cpp/server/device.cpp0000644000175000017500000042141512205375142020404 0ustar piccapiccastatic const char *RcsId = "$Id: device.cpp 22616 2013-05-05 08:56:58Z taurel $"; //+============================================================================ // // file : Device.cpp // // description : C++ source code for the DeviceImpl // class. This class // is the root class for all derived Device classes. // It is an abstract class. The DeviceImpl class is the // CORBA servant which is "exported" onto the network and // accessed by the client. // // project : TANGO // // author(s) : A.Gotz + E.Taurel // // Copyright (C) : 2004,2005,2006,2007,2008,2009,2010,2011,2012,2013 // European Synchrotron Radiation Facility // BP 220, Grenoble 38043 // FRANCE // // This file is part of Tango. // // Tango 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. // // Tango 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 Tango. If not, see . // // $Revision: 22616 $ // //-============================================================================ #if HAVE_CONFIG_H #include #endif #include #include #include #include #include #include #include #include #ifdef TANGO_HAS_LOG4TANGO #include #endif namespace Tango { // // The per thread data storage key (The client identification is stored in thread specific storage) // defined in utils.cpp // extern omni_thread::key_t key; //+------------------------------------------------------------------------- // // method : DeviceImpl::DeviceImpl // // description : constructors for the device_impl class from the class object // pointer, the device name, the description field, // the =aqmz and the status. // // argument : in : - cl_ptr : The class object pointer // - d_name : The device name // - de : The device description (default to "A TANGO device") // - st : The device state (default to UNKNOWN) // - sta : The device status (default to "Not initialised") // //-------------------------------------------------------------------------- DeviceImpl::DeviceImpl(DeviceClass *cl_ptr,const char *d_name, const char *de,Tango::DevState st,const char *sta) :device_name(d_name),desc(de),device_status(sta), device_state(st),device_class(cl_ptr),ext(new DeviceImplExt(d_name)) { real_ctor(); } DeviceImpl::DeviceImpl(DeviceClass *cl_ptr,string &d_name,string &de, Tango::DevState st,string &sta) :device_name(d_name),desc(de),device_status(sta), device_state(st),device_class(cl_ptr),ext(new DeviceImplExt(d_name.c_str())) { real_ctor(); } DeviceImpl::DeviceImpl(DeviceClass *cl_ptr,string &d_name) :device_name(d_name),device_class(cl_ptr),ext(new DeviceImplExt(d_name.c_str())) { desc = "A Tango device"; device_state = Tango::UNKNOWN; device_status = StatusNotSet; real_ctor(); } DeviceImpl::DeviceImpl(DeviceClass *cl_ptr,string &d_name,string &description) :device_name(d_name),device_class(cl_ptr),ext(new DeviceImplExt(d_name.c_str())) { desc = description; device_state = Tango::UNKNOWN; device_status = StatusNotSet; real_ctor(); } void DeviceImpl::real_ctor() { version = DevVersion; blackbox_depth = 0; ext->device_prev_state = device_state; // // Init lower case device name // ext->device_name_lower = device_name; transform(ext->device_name_lower.begin(),ext->device_name_lower.end(), ext->device_name_lower.begin(),::tolower); // // Write the device name into the per thread data for // sub device diagnostics // Tango::Util *tg = Tango::Util::instance(); tg->get_sub_dev_diag().set_associated_device(ext->device_name_lower); // // Create the DbDevice object // try { db_dev = new DbDevice(device_name,Tango::Util::instance()->get_database()); } catch (Tango::DevFailed) { throw; } get_dev_system_resource(); black_box_create(); ext->idl_version = 1; // // Create the multi attribute object // try { dev_attr = new MultiAttribute(device_name,device_class); } catch (Tango::DevFailed) { throw; } // // Build adm device name // adm_device_name = "dserver/"; adm_device_name = adm_device_name + Util::instance()->get_ds_name(); // // Init logging // #ifdef TANGO_HAS_LOG4TANGO init_logger(); #endif // // write the polling // // This code has been moved to Device_3Impl class ctor. // This is this ctor which make state and status available // as attributes. This is needed in case, state or status // is polled. /* init_cmd_poll_period(); init_attr_poll_period(); if (tg->_UseDb == false) { init_poll_no_db(); }*/ } //+------------------------------------------------------------------------- // // method : DeviceImpl::stop_polling // // description : Stop all polling for a device. if the device is // polled, call this method before deleting it. // // argin(s) : - with_db_upd : Is it necessary to update db ? // //-------------------------------------------------------------------------- void DeviceImpl::stop_polling(bool with_db_upd) { Tango::Util *tg = Tango::Util::instance(); // // If the vector of polling info is empty, no need to do anything (polling // already stopped for all devices) // vector &v_th_info = tg->get_polling_threads_info(); if (v_th_info.empty() == true) return; // // Find out which thread is in charge of the device. // PollingThreadInfo *th_info; int poll_th_id = tg->get_polling_thread_id_by_name(device_name.c_str()); if (poll_th_id == 0) { TangoSys_OMemStream o; o << "Can't find a polling thread for device " << device_name << ends; Except::throw_exception((const char *)API_PollingThreadNotFound,o.str(), (const char *)"DeviImpl::stop_polling"); } th_info = tg->get_polling_thread_info_by_id(poll_th_id); TangoMonitor &mon = th_info->poll_mon; PollThCmd &shared_cmd = th_info->shared_data; { omni_mutex_lock sync(mon); if (shared_cmd.cmd_pending == true) { mon.wait(); } shared_cmd.cmd_pending = true; shared_cmd.cmd_code = POLL_REM_DEV; shared_cmd.dev = this; mon.signal(); // // Wait for thread to execute command // while (shared_cmd.cmd_pending == true) { int interupted = mon.wait(DEFAULT_TIMEOUT); if ((shared_cmd.cmd_pending == true) && (interupted == false)) { cout4 << "TIME OUT" << endl; Except::throw_exception((const char *)API_CommandTimedOut, (const char *)"Polling thread blocked !!", (const char *)"DeviceImpl::stop_polling"); } } } is_polled(false); // // Update the pool conf first locally. // Also update the map // If this device was the only one for a polling thread, kill the thread // Then in Db if possible // bool kill_thread = false; int ind; if ((ind = tg->get_dev_entry_in_pool_conf(ext->device_name_lower)) == -1) { TangoSys_OMemStream o; o << "Can't find entry for device " << device_name << " in polling threads pool configuration !"<< ends; Except::throw_exception((const char *)API_PolledDeviceNotInPoolConf,o.str(), (const char *)"DeviceImpl::stop_polling"); } vector &pool_conf = tg->get_poll_pool_conf(); string &conf_entry = pool_conf[ind]; string::size_type pos; if ((pos = conf_entry.find(',')) != string::npos) { pos = conf_entry.find(ext->device_name_lower); if ((pos + ext->device_name_lower.size()) != conf_entry.size()) conf_entry.erase(pos,ext->device_name_lower.size() + 1); else conf_entry.erase(pos - 1); } else { vector::iterator iter = pool_conf.begin() + ind; pool_conf.erase(iter); kill_thread = true; } tg->remove_dev_from_polling_map(ext->device_name_lower); // // Kill the thread if needed and join // if (kill_thread == true) { TangoMonitor &mon = th_info->poll_mon; PollThCmd &shared_cmd = th_info->shared_data; { omni_mutex_lock sync(mon); shared_cmd.cmd_pending = true; shared_cmd.cmd_code = POLL_EXIT; mon.signal(); } void *dummy_ptr; cout4 << "POLLING: Joining with one polling thread" << endl; th_info->poll_th->join(&dummy_ptr); tg->remove_polling_thread_info_by_id(poll_th_id); } // // Update db // if ((with_db_upd == true) && (Tango::Util::_UseDb == true)) { DbData send_data; send_data.push_back(DbDatum("polling_threads_pool_conf")); send_data[0] << tg->get_poll_pool_conf(); tg->get_dserver_device()->get_db_device()->put_property(send_data); } } //+------------------------------------------------------------------------- // // method : DeviceImpl::~DeviceImpl // // description : Destructor for the device class. It simply frees // the memory allocated for the black box object // //-------------------------------------------------------------------------- DeviceImpl::~DeviceImpl() { cout4 << "Entering DeviceImpl destructor for device " << device_name << endl; // // Call user delete_device method // delete_device(); // // Delete the black box // delete blackbox_ptr; // // Delete the DbDevice object // delete db_dev; // // Unregister the signal from signal handler // DServerSignal::instance()->unregister_dev_signal(this); // // Delete the multi attribute object // delete dev_attr; // // Delete the extension class instance // #ifndef HAS_UNIQUE_PTR delete ext; #endif // // Clear our ptr in the device class vector // vector &dev_vect = get_device_class()->get_device_list(); vector::iterator ite = find(dev_vect.begin(),dev_vect.end(),this); if (ite != dev_vect.end()) *ite = NULL; cout4 << "Leaving DeviceImpl destructor for device " << device_name << endl; } //+------------------------------------------------------------------------- // // method : DeviceImpl::black_box_create // // description : Private method to create the device black box. // The black box depth is a resource with a default // value if the resource is not defined // //-------------------------------------------------------------------------- void DeviceImpl::black_box_create() { // // If the black box depth object attribute is null, create one with the // default depth // try { if (blackbox_depth == 0) blackbox_ptr = new BlackBox(); else blackbox_ptr = new BlackBox(blackbox_depth); } catch (bad_alloc) { throw; } } //+---------------------------------------------------------------------------- // // method : DeviceImpl::get_dev_system_resource() // // description : Method to retrieve some basic device resources // The resources to be retrived are : // - The black box depth // - The device description // - The polling ring buffer depth // - The polled command(s) // - The polled attribute(s) // - The non automatic polled command list // - The non automatic polled attribute list // - The polling too old factor // - The command polling ring depth (if any) // - The attribute polling ring depth (if any) // //----------------------------------------------------------------------------- void DeviceImpl::get_dev_system_resource() { // // Try to retrieve resources for device black box depth and device // description // Tango::Util *tg = Tango::Util::instance(); if (tg->_UseDb == true) { DbData db_data; db_data.push_back(DbDatum("blackbox_depth")); db_data.push_back(DbDatum("description")); db_data.push_back(DbDatum("poll_ring_depth")); db_data.push_back(DbDatum("polled_cmd")); db_data.push_back(DbDatum("polled_attr")); db_data.push_back(DbDatum("non_auto_polled_cmd")); db_data.push_back(DbDatum("non_auto_polled_attr")); db_data.push_back(DbDatum("poll_old_factor")); db_data.push_back(DbDatum("cmd_poll_ring_depth")); db_data.push_back(DbDatum("attr_poll_ring_depth")); db_data.push_back(DbDatum("min_poll_period")); db_data.push_back(DbDatum("cmd_min_poll_period")); db_data.push_back(DbDatum("attr_min_poll_period")); try { db_dev->get_property(db_data); } catch (Tango::DevFailed &) { TangoSys_OMemStream o; o << "Database error while trying to retrieve device prperties for device " << device_name.c_str() << ends; Except::throw_exception((const char *)API_DatabaseAccess, o.str(), (const char *)"DeviceImpl::get_dev_system_resource"); } if (db_data[0].is_empty() == false) db_data[0] >> blackbox_depth; if (db_data[1].is_empty() == false) db_data[1] >> desc; if (db_data[2].is_empty() == false) { long tmp_depth; db_data[2] >> tmp_depth; set_poll_ring_depth(tmp_depth); } if (db_data[3].is_empty() == false) db_data[3] >> get_polled_cmd(); if (db_data[4].is_empty() == false) db_data[4] >> get_polled_attr(); if (db_data[5].is_empty() == false) db_data[5] >> get_non_auto_polled_cmd(); if (db_data[6].is_empty() == false) db_data[6] >> get_non_auto_polled_attr(); if (db_data[7].is_empty() == false) { long tmp_poll; db_data[7] >> tmp_poll; set_poll_old_factor(tmp_poll); } else set_poll_old_factor(DEFAULT_POLL_OLD_FACTOR); if (db_data[8].is_empty() == false) { db_data[8] >> ext->cmd_poll_ring_depth; unsigned long nb_prop = ext->cmd_poll_ring_depth.size(); if ((nb_prop % 2) == 1) { ext->cmd_poll_ring_depth.clear(); TangoSys_OMemStream o; o << "System property cmd_poll_ring_depth for device " << device_name << " has wrong syntax" << ends; Except::throw_exception((const char *)API_BadConfigurationProperty, o.str(), (const char *)"DeviceImpl::get_dev_system_resource()"); } for (unsigned int i = 0;i < nb_prop;i = i + 2) transform(ext->cmd_poll_ring_depth[i].begin(), ext->cmd_poll_ring_depth[i].end(), ext->cmd_poll_ring_depth[i].begin(), ::tolower); } if (db_data[9].is_empty() == false) { db_data[9] >> ext->attr_poll_ring_depth; unsigned long nb_prop = ext->attr_poll_ring_depth.size(); if ((ext->attr_poll_ring_depth.size() % 2) == 1) { ext->attr_poll_ring_depth.clear(); TangoSys_OMemStream o; o << "System property attr_poll_ring_depth for device " << device_name << " has wrong syntax" << ends; Except::throw_exception((const char *)API_BadConfigurationProperty, o.str(), (const char *)"DeviceImpl::get_dev_system_resource()"); } for (unsigned int i = 0;i < nb_prop;i = i + 2) transform(ext->attr_poll_ring_depth[i].begin(), ext->attr_poll_ring_depth[i].end(), ext->attr_poll_ring_depth[i].begin(), ::tolower); } // // The min. period related properties // if (db_data[10].is_empty() == false) db_data[10] >> ext->min_poll_period; if (db_data[11].is_empty() == false) { db_data[11] >> ext->cmd_min_poll_period; unsigned long nb_prop = ext->cmd_min_poll_period.size(); if ((ext->cmd_min_poll_period.size() % 2) == 1) { ext->cmd_min_poll_period.clear(); TangoSys_OMemStream o; o << "System property cmd_min_poll_period for device " << device_name << " has wrong syntax" << ends; Except::throw_exception((const char *)API_BadConfigurationProperty, o.str(), (const char *)"DeviceImpl::get_dev_system_resource()"); } for (unsigned int i = 0;i < nb_prop;i = i + 2) transform(ext->cmd_min_poll_period[i].begin(), ext->cmd_min_poll_period[i].end(), ext->cmd_min_poll_period[i].begin(), ::tolower); } if (db_data[12].is_empty() == false) { db_data[12] >> ext->attr_min_poll_period; unsigned long nb_prop = ext->attr_min_poll_period.size(); if ((ext->attr_min_poll_period.size() % 2) == 1) { ext->attr_min_poll_period.clear(); TangoSys_OMemStream o; o << "System property attr_min_poll_period for device " << device_name << " has wrong syntax" << ends; Except::throw_exception((const char *)API_BadConfigurationProperty, o.str(), (const char *)"DeviceImpl::get_dev_system_resource()"); } for (unsigned int i = 0;i < nb_prop;i = i + 2) transform(ext->attr_min_poll_period[i].begin(), ext->attr_min_poll_period[i].end(), ext->attr_min_poll_period[i].begin(), ::tolower); } // // Since Tango V5 (IDL V3), State and Status are now polled as attributes // Change properties if necessary // if ((get_polled_cmd()).size() != 0) poll_lists_2_v5(); } } //+------------------------------------------------------------------------- // // method : DeviceImpl::_default_POA // // description : Return a pointer to the POA on which the device should // be activated. This method is required by CORBA to // create a POA with the IMPLICIT_ACTIVATION policy // //-------------------------------------------------------------------------- PortableServer::POA_ptr DeviceImpl::_default_POA() { return Util::instance()->get_poa(); } //+------------------------------------------------------------------------- // // method : DeviceImpl::register_signal // // description : Method to register a device on a signal. When the // signal is sent to the process, the signal_handler // method of this class will be executed // // in : signo : The signal number // //-------------------------------------------------------------------------- #ifndef _TG_WINDOWS_ void DeviceImpl::register_signal(long signo,bool hand) { cout4 << "DeviceImpl::register_signal() arrived for signal " << signo << endl; DServerSignal::instance()->register_dev_signal(signo,hand,this); cout4 << "Leaving DeviceImpl::register_signal method()" << endl; } #else void DeviceImpl::register_signal(long signo) { cout4 << "DeviceImpl::register_signal() arrived for signal " << signo << endl; DServerSignal::instance()->register_dev_signal(signo,this); cout4 << "Leaving DeviceImpl::register_signal method()" << endl; } #endif //+------------------------------------------------------------------------- // // method : DeviceImpl::unregister_signal // // description : Method to unregister a device on a signal. // // in : signo : The signal number // //-------------------------------------------------------------------------- void DeviceImpl::unregister_signal(long signo) { cout4 << "DeviceImpl::unregister_signal() arrived for signal " << signo << endl; DServerSignal::instance()->unregister_dev_signal(signo,this); cout4 << "Leaving DeviceImpl::unregister_signal method()" << endl; } //+------------------------------------------------------------------------- // // method : DeviceImpl::signal_handler // // description : This is the signal handler for the device. This method // is defined as virtual and therefore, can be redefined // by DS programmers in their own classes derived from // DeviceImpl // // in : signo : The signal number // //-------------------------------------------------------------------------- void DeviceImpl::signal_handler(long signo) { cout4 << "DeviceImpl::signal_handler() arrived for signal " << signo << endl; cout4 << "Leaving DeviceImpl::signal_handler method()" << endl; } //+------------------------------------------------------------------------- // // method : DeviceImpl::check_command_exist // // description : This method check that a comamnd is supported by // the device and does not need input value. // The method throws an exception if the // command is not defined or needs an input value // // in : cmd_name : The command name // //-------------------------------------------------------------------------- void DeviceImpl::check_command_exists(const string &cmd_name) { vector &cmd_list = device_class->get_command_list(); unsigned long i; for (i = 0;i < cmd_list.size();i++) { if (cmd_list[i]->get_lower_name() == cmd_name) { if (cmd_list[i]->get_in_type() != Tango::DEV_VOID) { TangoSys_OMemStream o; o << "Command " << cmd_name << " cannot be polled because it needs input value" << ends; Except::throw_exception((const char *)API_IncompatibleCmdArgumentType, o.str(),(const char *)"DeviceImpl::check_command_exists"); } return; } } TangoSys_OMemStream o; o << "Command " << cmd_name << " not found" << ends; Except::throw_exception((const char *)API_CommandNotFound,o.str(), (const char *)"DeviceImpl::check_command_exists"); } //+------------------------------------------------------------------------- // // method : DeviceImpl::get_command // // description : This method returns a pointer to command object. // The method throws an exception if the // command is not defined // // in : cmd_name : The command name // //-------------------------------------------------------------------------- Command *DeviceImpl::get_command(const string &cmd_name) { vector cmd_list = device_class->get_command_list(); unsigned long i; for (i = 0;i < cmd_list.size();i++) { if (cmd_list[i]->get_lower_name() == cmd_name) { return cmd_list[i]; } } TangoSys_OMemStream o; o << "Command " << cmd_name << " not found" << ends; Except::throw_exception((const char *)API_CommandNotFound,o.str(), (const char *)"DeviceImpl::get_command"); // // This piece of code is added for VC++ compiler. As they advice, I have try to // use the __decspec(noreturn) for the throw_exception method, but it seems // that it does not work ! // return NULL; } //+------------------------------------------------------------------------- // // method : DeviceImpl::get_polled_obj_by_type_name // // description : This method check that a comamnd is supported by // the device and does not need input value. // The method throws an exception if the // command is not defined or needs an input value // // in : cmd_name : The command name // //-------------------------------------------------------------------------- vector::iterator DeviceImpl::get_polled_obj_by_type_name( Tango::PollObjType obj_type, const string &obj_name) { vector &po_list = get_poll_obj_list(); vector::iterator ite; for (ite = po_list.begin();ite < po_list.end();++ite) { omni_mutex_lock sync(**ite); { if ((*ite)->get_type_i() == obj_type) { if ((*ite)->get_name_i() == obj_name) { return ite; } } } } TangoSys_OMemStream o; o << obj_name << " not found in list of polled object" << ends; Except::throw_exception((const char *)API_PollObjNotFound,o.str(), (const char *)"DeviceImpl::get_polled_obj_by_type_name"); // // Only to make compiler quiet. Should never pass here // // exclude the return value for VC8+ #if !defined(_TG_WINDOWS_) || (defined(_MSC_VER) && _MSC_VER < 1400) return (vector::iterator)NULL; #endif } //+------------------------------------------------------------------------- // // method : DeviceImpl::get_cmd_poll_ring_depth // // description : This method returns the polling buffer depth. // Most of the times, this is defined at device level // via the device "poll_ring_depth" property. // nevertheless, in some cases, this value cab be // overwritten via the device "cmd_poll_ring_depth" // property. // // in : cmd_name : The command name // // This method returns the polling buffer depth // //-------------------------------------------------------------------------- long DeviceImpl::get_cmd_poll_ring_depth(string &cmd_name) { long ret; if (ext->cmd_poll_ring_depth.size() == 0) { // // No specific depth defined // if (ext->poll_ring_depth == 0) ret = DefaultPollRingDepth; else ret = ext->poll_ring_depth; } else { unsigned long k; // // Try to find command in list of specific polling buffer depth // for (k = 0; k < ext->cmd_poll_ring_depth.size();k = k + 2) { if (ext->cmd_poll_ring_depth[k] == cmd_name) { TangoSys_MemStream s; s << ext->cmd_poll_ring_depth[k + 1]; if (!(s >> ret)) { TangoSys_OMemStream o; o << "System property cmd_poll_ring_depth for device " << device_name << " has wrong syntax" << ends; Except::throw_exception((const char *)API_BadConfigurationProperty, o.str(), (const char *)"DeviceImpl::get_poll_ring_depth()"); } break; } } if (k >= ext->cmd_poll_ring_depth.size()) { // // Not found // if (ext->poll_ring_depth == 0) ret = DefaultPollRingDepth; else ret = ext->poll_ring_depth; } } return ret; } //+------------------------------------------------------------------------- // // method : DeviceImpl::get_attr_poll_ring_depth // // description : This method returns the polling buffer depth. // Most of the times, this is defined at device level // via the device "poll_ring_depth" property. // Nevertheless, in some cases, this value can be // overwritten via the device "attr_poll_ring_depth" // property. // // in : attr_name : The attribute name // // This method returns the polling buffer depth // //-------------------------------------------------------------------------- long DeviceImpl::get_attr_poll_ring_depth(string &attr_name) { long ret; if (ext->attr_poll_ring_depth.size() == 0) { if ((attr_name == "state") || (attr_name == "status")) { ret = get_cmd_poll_ring_depth(attr_name); } else { // // No specific depth defined // if (ext->poll_ring_depth == 0) ret = DefaultPollRingDepth; else ret = ext->poll_ring_depth; } } else { unsigned long k; // // Try to find command in list of specific polling buffer depth // for (k = 0; k < ext->attr_poll_ring_depth.size();k = k + 2) { if (ext->attr_poll_ring_depth[k] == attr_name) { TangoSys_MemStream s; s << ext->attr_poll_ring_depth[k + 1]; if (!(s >> ret)) { TangoSys_OMemStream o; o << "System property attr_poll_ring_depth for device " << device_name << " has wrong syntax" << ends; Except::throw_exception((const char *)API_BadConfigurationProperty, o.str(), (const char *)"DeviceImpl::get_poll_ring_depth()"); } break; } } if (k >= ext->attr_poll_ring_depth.size()) { if ((attr_name == "state") || (attr_name == "status")) { ret = get_cmd_poll_ring_depth(attr_name); } else { // // Not found // if (ext->poll_ring_depth == 0) ret = DefaultPollRingDepth; else ret = ext->poll_ring_depth; } } } return ret; } //-------------------------------------------------------------------------------------------------------------------- // // method : // DeviceImpl::dev_state // // description : // The default method called by the DevState command. If the device is ON, this method checks attribute // with a defined alarm and set the state to ALARM if one of these attribute is in alarm. Otherwise, simply // returns device state // //-------------------------------------------------------------------------------------------------------------------- Tango::DevState DeviceImpl::dev_state() { NoSyncModelTangoMonitor mon(this); // // If we need to run att. conf loop, do it. // If the flag to force state is true, do not call state computation method, simply set it to ALARM // if (ext->run_att_conf_loop == true) att_conf_loop(); if (device_state != Tango::FAULT && ext->force_alarm_state == true) { return Tango::ALARM; } else { if ((device_state == Tango::ON) || (device_state == Tango::ALARM)) { // // Build attribute lists // long vers = get_dev_idl_version(); bool set_alrm = false; vector attr_list = dev_attr->get_alarm_list(); vector attr_list_2 = get_alarmed_not_read(); vector attr_polled_list; long nb_wanted_attr; if (vers >= 3) { if (ext->state_from_read == true) { vector::iterator ite = attr_list_2.begin(); while (ite != attr_list_2.end()) { Attribute &att = dev_attr->get_attr_by_ind(*ite); if (att.is_polled() == true) { ite = attr_list_2.erase(ite); } else ++ite; } nb_wanted_attr = attr_list_2.size(); } else { vector::iterator ite = attr_list.begin(); while (ite != attr_list.end()) { Attribute &att = dev_attr->get_attr_by_ind(*ite); if (att.is_polled() == true) ite = attr_list.erase(ite); else ++ite; } nb_wanted_attr = attr_list.size(); } } else { nb_wanted_attr = attr_list.size(); } cout4 << "State: Number of attribute(s) to read: " << nb_wanted_attr << endl; if (nb_wanted_attr != 0) { // // Read the hardware // if (ext->state_from_read == false) { read_attr_hardware(attr_list); } // // Set attr value // long i,j; vector &attr_vect = device_class->get_class_attr()->get_attr_list(); for (i = 0;i < nb_wanted_attr;i++) { // // Starting with IDl 3, it is possible that some of the alarmed attribute have already been read. // long idx; if ((vers >= 3) && (ext->state_from_read == true)) idx = attr_list_2[i]; else idx = attr_list[i]; Attribute &att = dev_attr->get_attr_by_ind(idx); att.save_alarm_quality(); try { if (vers < 3) read_attr(att); else { // // Otherwise, get it from device // att.wanted_date(false); att.set_value_flag(false); if (attr_vect[att.get_attr_idx()]->is_allowed(this,Tango::READ_REQ) == false) { att.wanted_date(true); continue; } attr_vect[att.get_attr_idx()]->read(this,att); Tango::AttrQuality qua = att.get_quality(); if ((qua != Tango::ATTR_INVALID) && (att.get_value_flag() == false)) { TangoSys_OMemStream o; o << "Read value for attribute "; o << att.get_name(); o << " has not been updated"; o << "Hint: Did the server follow Tango V5 attribute reading framework ?" << ends; Except::throw_exception((const char *)API_AttrValueNotSet,o.str(), (const char *)"DeviceImpl::dev_state"); } } } catch (Tango::DevFailed) { for (j = 0;j < i;j++) { long idx; if ((vers >= 3) && (ext->state_from_read == true)) idx = attr_list_2[j]; else idx = attr_list[j]; Tango::Attribute &tmp_att = dev_attr->get_attr_by_ind(idx); if (att.get_wanted_date() == false) { if (tmp_att.get_quality() != Tango::ATTR_INVALID) tmp_att.delete_seq(); tmp_att.wanted_date(true); } } att.wanted_date(true); throw; } } // // Check alarm level // if (dev_attr->check_alarm() == true) { set_alrm = true; device_state = Tango::ALARM; } else device_state = Tango::ON; // // Free the sequence created to store the attribute value // for (long i = 0;i < nb_wanted_attr;i++) { long idx; if ((vers >= 3) && (ext->state_from_read == true)) idx = attr_list_2[i]; else idx = attr_list[i]; Tango::Attribute &att = dev_attr->get_attr_by_ind(idx); if (att.get_wanted_date() == false) { if (att.get_quality() != Tango::ATTR_INVALID) att.delete_seq(); att.wanted_date(true); } } } // // Check if one of the remaining attributes has its quality factor set to ALARM or WARNING. It is not necessary to do // this if we have already detected that the state must switch to ALARM // if ((set_alrm == false) && (device_state != Tango::ALARM)) { if (dev_attr->is_att_quality_alarmed(false) == true) device_state = Tango::ALARM; else device_state = Tango::ON; } } } return device_state; } //---------------------------------------------------------------------------------------------------------------------- // // method : // DeviceImpl::dev_status // // description : // The default method called by the DevStatus command. If the device is ON, this method add Attribute status // for all device attribute in alarm state. // //--------------------------------------------------------------------------------------------------------------------- Tango::ConstDevString DeviceImpl::dev_status() { NoSyncModelTangoMonitor mon(this); const char *returned_str; if (ext->run_att_conf_loop == true) att_conf_loop(); if (device_state != Tango::FAULT && ext->force_alarm_state == true) { alarm_status = "The device is in ALARM state."; // // First add message for attribute with wrong conf. in db // size_t nb_wrong_att = ext->att_wrong_db_conf.size(); if (nb_wrong_att != 0) { alarm_status = alarm_status + "\nAttribute"; build_att_list_in_status_mess(nb_wrong_att,DeviceImpl::CONF); alarm_status = alarm_status + "wrong configuration in database"; } // // Add message for memorized attributes which failed during device startup // nb_wrong_att = ext->att_mem_failed.size(); if (nb_wrong_att != 0) { alarm_status = alarm_status + "\nMemorized attribute"; build_att_list_in_status_mess(nb_wrong_att,DeviceImpl::MEM); alarm_status = alarm_status + "failed during device startup sequence"; } returned_str = alarm_status.c_str(); } else { if (device_status == StatusNotSet) { alarm_status = "The device is in "; alarm_status = alarm_status + DevStateName[device_state] + " state."; if (device_state == Tango::ALARM) { dev_attr->read_alarm(alarm_status); dev_attr->add_alarmed_quality_factor(alarm_status); } returned_str = alarm_status.c_str(); } else { if (device_state == Tango::ALARM) { alarm_status = device_status; dev_attr->read_alarm(alarm_status); dev_attr->add_alarmed_quality_factor(alarm_status); returned_str = alarm_status.c_str(); } else returned_str = device_status.c_str(); } } return returned_str; } //+------------------------------------------------------------------------- // // method : DeviceImpl::command_inout // // description : Method called for each command_inout operation executed // from any client // The call to this method is in a try bloc for the // Tango::DevFailed exception (generated by the idl // compiler in the tango_skel.cpp file). Therefore, it // is not necessary to propagate by re-throw the exceptions // thrown by the underlying functions/methods. // //-------------------------------------------------------------------------- CORBA::Any *DeviceImpl::command_inout(const char *in_cmd, const CORBA::Any &in_any) { AutoTangoMonitor sync(this); string command(in_cmd); CORBA::Any *out_any; cout4 << "DeviceImpl::command_inout(): command received : " << command << endl; // // Write the device name into the per thread data for // sub device diagnostics. // Keep the old name, to put it back at the end! // During device access inside the same server, // the thread stays the same! // SubDevDiag &sub = (Tango::Util::instance())->get_sub_dev_diag(); string last_associated_device = sub.get_associated_device(); sub.set_associated_device(get_name()); // Catch all exceptions to set back the associated device after // execution try { // // Record operation request in black box // if (ext->store_in_bb == true) blackbox_ptr->insert_cmd(in_cmd); ext->store_in_bb = true; // // Execute command // out_any = device_class->command_handler(this,command,in_any); } catch (...) { // set back the device attribution for the thread // and rethrow the exception. sub.set_associated_device(last_associated_device); throw; } // set back the device attribution for the thread sub.set_associated_device(last_associated_device); // // Return value to the caller // cout4 << "DeviceImpl::command_inout(): leaving method for command " << in_cmd << endl; return(out_any); } //+------------------------------------------------------------------------- // // method : DeviceImpl::name // // description : Method called when a client request the name attribute // This method is called for a IDL attribute which can // not throw exception to client ==> There is no point // to check if the allocation done by the string_dup // function failed. // //-------------------------------------------------------------------------- char *DeviceImpl::name() { try { cout4 << "DeviceImpl::name arrived" << endl; // // Record attribute request in black box // blackbox_ptr->insert_corba_attr(Attr_Name); } catch (Tango::DevFailed &e) { CORBA::IMP_LIMIT lim; if (strcmp(e.errors[0].reason,API_CommandTimedOut) == 0) lim.minor(TG_IMP_MINOR_TO); else lim.minor(TG_IMP_MINOR_DEVFAILED); cout4 << "Leaving DeviceImpl::name throwing IMP_LIMIT" << endl; throw lim; } catch (...) { CORBA::IMP_LIMIT lim; lim.minor(TG_IMP_MINOR_NON_DEVFAILED); cout4 << "Leaving DeviceImpl::name throwing IMP_LIMIT" << endl; throw lim; } // // Return data to caller // cout4 << "Leaving DeviceImpl::name" << endl; return CORBA::string_dup(device_name.c_str()); } //+------------------------------------------------------------------------- // // method : DeviceImpl::adm_name // // description : Method called when a client request the adm_name attribute // This method is called for a IDL attribute which can // not throw exception to client ==> There is no point // to check if the allocation done by the string_dup // function failed. // //-------------------------------------------------------------------------- char *DeviceImpl::adm_name() { try { cout4 << "DeviceImpl::adm_name arrived" << endl; // // Record attribute request in black box // blackbox_ptr->insert_corba_attr(Attr_AdmName); } catch (Tango::DevFailed &e) { CORBA::IMP_LIMIT lim; if (strcmp(e.errors[0].reason,API_CommandTimedOut) == 0) lim.minor(TG_IMP_MINOR_TO); else lim.minor(TG_IMP_MINOR_DEVFAILED); cout4 << "Leaving DeviceImpl::adm_name throwing IMP_LIMIT" << endl; throw lim; } catch (...) { CORBA::IMP_LIMIT lim; lim.minor(TG_IMP_MINOR_NON_DEVFAILED); cout4 << "Leaving DeviceImpl::adm_name throwing IMP_LIMIT" << endl; throw lim; } // // Return data to caller // cout4 << "Leaving DeviceImpl::adm_name" << endl; return CORBA::string_dup(adm_device_name.c_str()); } //+------------------------------------------------------------------------- // // method : DeviceImpl::description // // description : Method called when a client request the description // attribute // This method is called for a IDL attribute which can // not throw exception to client ==> There is no point // to check if the allocation done by the string_dup // function failed. // //-------------------------------------------------------------------------- char *DeviceImpl::description() { try { cout4 << "DeviceImpl::description arrived" << endl; // // Record attribute request in black box // blackbox_ptr->insert_corba_attr(Attr_Description); } catch (Tango::DevFailed &e) { CORBA::IMP_LIMIT lim; if (strcmp(e.errors[0].reason,API_CommandTimedOut) == 0) lim.minor(TG_IMP_MINOR_TO); else lim.minor(TG_IMP_MINOR_DEVFAILED); cout4 << "Leaving DeviceImpl::description throwing IMP_LIMIT" << endl; throw lim; } catch (...) { CORBA::IMP_LIMIT lim; lim.minor(TG_IMP_MINOR_NON_DEVFAILED); cout4 << "Leaving DeviceImpl::description throwing IMP_LIMIT" << endl; throw lim; } // // Return data to caller // cout4 << "Leaving DeviceImpl::description" << endl; return CORBA::string_dup(desc.c_str()); } //+------------------------------------------------------------------------- // // method : DeviceImpl::state // // description : Method called when a client request the state // attribute // //-------------------------------------------------------------------------- Tango::DevState DeviceImpl::state() { Tango::DevState tmp; string last_associated_device; try { AutoTangoMonitor sync(this); cout4 << "DeviceImpl::state (attribute) arrived" << endl; // // Write the device name into the per thread data for // sub device diagnostics. // Keep the old name, to put it back at the end! // During device access inside the same server, // the thread stays the same! // SubDevDiag &sub = (Tango::Util::instance())->get_sub_dev_diag(); last_associated_device = sub.get_associated_device(); sub.set_associated_device(get_name()); // // Record attribute request in black box // blackbox_ptr->insert_corba_attr(Attr_State); always_executed_hook(); // // Return data to caller. If the state_cmd throw an exception, catch it and do // not re-throw it because we are in a CORBA attribute implementation tmp = dev_state(); } catch (Tango::DevFailed &e) { if (last_associated_device.size() > 0) { // set back the device attribution for the thread (Tango::Util::instance())->get_sub_dev_diag().set_associated_device(last_associated_device); } CORBA::IMP_LIMIT lim; if (strcmp(e.errors[0].reason,API_CommandTimedOut) == 0) lim.minor(TG_IMP_MINOR_TO); else lim.minor(TG_IMP_MINOR_DEVFAILED); cout4 << "Leaving DeviceImpl::state (attribute) throwing IMP_LIMIT" << endl; throw lim; } catch (...) { if (last_associated_device.size() > 0) { // set back the device attribution for the thread (Tango::Util::instance())->get_sub_dev_diag().set_associated_device(last_associated_device); } CORBA::IMP_LIMIT lim; lim.minor(TG_IMP_MINOR_NON_DEVFAILED); cout4 << "Leaving DeviceImpl::state (attribute) throwing IMP_LIMIT" << endl; throw lim; } if (last_associated_device.size() > 0) { // set back the device attribution for the thread (Tango::Util::instance())->get_sub_dev_diag().set_associated_device(last_associated_device); } cout4 << "Leaving DeviceImpl::state (attribute)" << endl; return tmp; } //+------------------------------------------------------------------------- // // method : DeviceImpl::status // // description : Method called when a client request the description // status // This method is called for a IDL attribute which can // not throw exception to client ==> There is no point // to check if the allocation done by the string_dup // function failed. // //-------------------------------------------------------------------------- char *DeviceImpl::status() { char *tmp; string last_associated_device; try { AutoTangoMonitor sync(this); cout4 << "DeviceImpl::status (attibute) arrived" << endl; // // Write the device name into the per thread data for // sub device diagnostics. // Keep the old name, to put it back at the end! // During device access inside the same server, // the thread stays the same! // SubDevDiag &sub = (Tango::Util::instance())->get_sub_dev_diag(); last_associated_device = sub.get_associated_device(); sub.set_associated_device(get_name()); // // Record attribute request in black box // blackbox_ptr->insert_corba_attr(Attr_Status); // // Return data to caller. If the status_cmd method throw exception, catch it // and forget it because we are in a CORBA attribute implementation // always_executed_hook(); tmp = CORBA::string_dup(dev_status()); } catch (Tango::DevFailed &e) { if (last_associated_device.size() > 0) { // set back the device attribution for the thread (Tango::Util::instance())->get_sub_dev_diag().set_associated_device(last_associated_device); } if (strcmp(e.errors[0].reason,API_CommandTimedOut) == 0) tmp = CORBA::string_dup("Not able to acquire device monitor"); else tmp = CORBA::string_dup("Got exception when trying to build device status"); } catch (...) { if (last_associated_device.size() > 0) { // set back the device attribution for the thread (Tango::Util::instance())->get_sub_dev_diag().set_associated_device(last_associated_device); } CORBA::IMP_LIMIT lim; lim.minor(TG_IMP_MINOR_NON_DEVFAILED); throw lim; } if (last_associated_device.size() > 0) { // set back the device attribution for the thread (Tango::Util::instance())->get_sub_dev_diag().set_associated_device(last_associated_device); } cout4 << "Leaving DeviceImpl::status (attribute)" << endl; return tmp; } //+------------------------------------------------------------------------- // // method : DeviceImpl::black_box // // description : CORBA operation to read n element(s) of the black-box. // This method returns black box element as strings // // argument: in : - n : Number of elt to read // //-------------------------------------------------------------------------- Tango::DevVarStringArray* DeviceImpl::black_box(CORBA::Long n) { cout4 << "DeviceImpl::black_box arrived" << endl; Tango::DevVarStringArray *ret = blackbox_ptr->read((long)n); // // Record operation request in black box // blackbox_ptr->insert_op(Op_BlackBox); cout4 << "Leaving DeviceImpl::black_box" << endl; return ret; } //+------------------------------------------------------------------------- // // method : DeviceImpl::command_list_query // // description : CORBA operation to read the device command list. // This method returns command info in a sequence of // DevCmdInfo // //-------------------------------------------------------------------------- Tango::DevCmdInfoList* DeviceImpl::command_list_query() { cout4 << "DeviceImpl::command_list_query arrived" << endl; // // Retrieve number of command and allocate memory to send back info // long nb_cmd = device_class->get_command_list().size(); cout4 << nb_cmd << " command(s) for device" << endl; Tango::DevCmdInfoList *back = NULL; try { back = new Tango::DevCmdInfoList(nb_cmd); back->length(nb_cmd); // // Populate the vector // for (long i = 0;i < nb_cmd;i++) { Tango::DevCmdInfo tmp; tmp.cmd_name = CORBA::string_dup(((device_class->get_command_list())[i]->get_name()).c_str()); tmp.cmd_tag = (long)((device_class->get_command_list())[i]->get_disp_level()); tmp.in_type = (long)((device_class->get_command_list())[i]->get_in_type()); tmp.out_type = (long)((device_class->get_command_list())[i]->get_out_type()); string &str_in = (device_class->get_command_list())[i]->get_in_type_desc(); if (str_in.size() != 0) tmp.in_type_desc = CORBA::string_dup(str_in.c_str()); else tmp.in_type_desc = CORBA::string_dup(NotSet); string &str_out = (device_class->get_command_list())[i]->get_out_type_desc(); if (str_out.size() != 0) tmp.out_type_desc = CORBA::string_dup(str_out.c_str()); else tmp.out_type_desc = CORBA::string_dup(NotSet); (*back)[i] = tmp; } } catch (bad_alloc) { Except::throw_exception((const char *)API_MemoryAllocation, (const char *)"Can't allocate memory in server", (const char *)"DeviceImpl::command_list_query"); } // // Record operation request in black box // blackbox_ptr->insert_op(Op_Command_list); // // Return to caller // cout4 << "Leaving DeviceImpl::command_list_query" << endl; return back; } //+------------------------------------------------------------------------- // // method : DeviceImpl::command_query // // description : CORBA operation to read a device command info. // This method returns command info for a specific // command. // // //-------------------------------------------------------------------------- Tango::DevCmdInfo *DeviceImpl::command_query(const char *command) { cout4 << "DeviceImpl::command_query arrived" << endl; Tango::DevCmdInfo *back = NULL; string cmd(command); transform(cmd.begin(),cmd.end(),cmd.begin(),::tolower); // // Allocate memory for the stucture sent back to caller. The ORB will free it // try { back = new Tango::DevCmdInfo(); } catch (bad_alloc) { Except::throw_exception((const char *)API_MemoryAllocation, (const char *)"Can't allocate memory in server", (const char *)"DeviceImpl::command_query"); } // // Try to retrieve the command in the command list // long i; long nb_cmd = device_class->get_command_list().size(); for (i = 0;i < nb_cmd;i++) { if (device_class->get_command_list()[i]->get_lower_name() == cmd) { back->cmd_name = CORBA::string_dup(((device_class->get_command_list())[i]->get_name()).c_str()); back->cmd_tag = (long)((device_class->get_command_list())[i]->get_disp_level()); back->in_type = (long)((device_class->get_command_list())[i]->get_in_type()); back->out_type = (long)((device_class->get_command_list())[i]->get_out_type()); string &str_in = (device_class->get_command_list())[i]->get_in_type_desc(); if (str_in.size() != 0) back->in_type_desc = CORBA::string_dup(str_in.c_str()); else back->in_type_desc = CORBA::string_dup(NotSet); string &str_out = (device_class->get_command_list())[i]->get_out_type_desc(); if (str_out.size() != 0) back->out_type_desc = CORBA::string_dup(str_out.c_str()); else back->out_type_desc = CORBA::string_dup(NotSet); break; } } if (i == nb_cmd) { delete back; cout3 << "DeviceImpl::command_query(): command " << command << " not found" << endl; // // throw an exception to client // TangoSys_OMemStream o; o << "Command " << command << " not found" << ends; Except::throw_exception((const char *)API_CommandNotFound, o.str(), (const char *)"DeviceImpl::command_query"); } // // Record operation request in black box // blackbox_ptr->insert_op(Op_Command); // // Return to caller // cout4 << "Leaving DeviceImpl::command_query" << endl; return back; } //+------------------------------------------------------------------------- // // method : DeviceImpl::info // // description : CORBA operation to get device info // //-------------------------------------------------------------------------- Tango::DevInfo *DeviceImpl::info() { cout4 << "DeviceImpl::info arrived" << endl; Tango::DevInfo *back = NULL; // // Allocate memory for the stucture sent back to caller. The ORB will free it // try { back = new Tango::DevInfo(); } catch (bad_alloc) { Except::throw_exception((const char *)API_MemoryAllocation, (const char *)"Can't allocate memory in server", (const char *)"DeviceImpl::info"); } // // Retrieve server host // Tango::Util *tango_ptr = Tango::Util::instance(); back->server_host = CORBA::string_dup(tango_ptr->get_host_name().c_str()); // // Fill-in remaining structure fields // back->dev_class = CORBA::string_dup(device_class->get_name().c_str()); back->server_id = CORBA::string_dup(tango_ptr->get_ds_name().c_str()); back->server_version = DevVersion; // // Build the complete info sent in the doc_url string // string doc_url("Doc URL = "); doc_url = doc_url + device_class->get_doc_url(); // // Add TAG if it exist // string &svn_tag = device_class->get_svn_tag(); if (svn_tag.size() != 0) { doc_url = doc_url + "\nSVN Tag = "; doc_url = doc_url + svn_tag; } else { string &cvs_tag = device_class->get_cvs_tag(); if (cvs_tag.size() != 0) { doc_url = doc_url + "\nCVS Tag = "; doc_url = doc_url + cvs_tag; } } // // Add SCM location if defined // string &svn_location = device_class->get_svn_location(); if (svn_location.size() != 0) { doc_url = doc_url + "\nSVN Location = "; doc_url = doc_url + svn_location; } else { string &cvs_location = device_class->get_cvs_location(); if (cvs_location.size() != 0) { doc_url = doc_url + "\nCVS Location = "; doc_url = doc_url + cvs_location; } } back->doc_url = CORBA::string_dup(doc_url.c_str()); // // Record operation request in black box // blackbox_ptr->insert_op(Op_Info); // // Return to caller // cout4 << "Leaving DeviceImpl::info" << endl; return back; } //+------------------------------------------------------------------------- // // method : DeviceImpl::ping // // description : CORBA operation to ping if a device to see it is alive // //-------------------------------------------------------------------------- void DeviceImpl::ping() { cout4 << "DeviceImpl::ping arrived" << endl; // // Record operation request in black box // blackbox_ptr->insert_op(Op_Ping); // // Return to caller // cout4 << "Leaving DeviceImpl::ping" << endl; } //+------------------------------------------------------------------------- // // method : DeviceImpl::get_attribute_config // // description : CORBA operation to get attribute configuration. // // argument: in : - names: name of attribute(s) // // This method returns a pointer to a AttributeConfigList with one AttributeConfig // structure for each atribute // //-------------------------------------------------------------------------- Tango::AttributeConfigList *DeviceImpl::get_attribute_config(const Tango::DevVarStringArray& names) { cout4 << "DeviceImpl::get_attribute_config arrived" << endl; TangoMonitor &mon = get_att_conf_monitor(); AutoTangoMonitor sync(&mon); long nb_attr = names.length(); Tango::AttributeConfigList *back = NULL; bool all_attr = false; // // Record operation request in black box // blackbox_ptr->insert_op(Op_Get_Attr_Config); // // Get attribute number and device version // long nb_dev_attr = dev_attr->get_attr_nb(); long vers = get_dev_idl_version(); // // Check if the caller want to get config for all attribute // If the device implements IDL 3 (State and status as attributes) // and the client is an old one (not able to read state/status as // attribute), decrement attribute number // string in_name(names[0]); if (nb_attr == 1) { if (in_name == AllAttr) { all_attr = true; if (vers < 3) nb_attr = nb_dev_attr; else nb_attr = nb_dev_attr - 2; } else if (in_name == AllAttr_3) { all_attr = true; nb_attr = nb_dev_attr; } } // // Allocate memory for the AttributeConfig structures // try { back = new Tango::AttributeConfigList(nb_attr); back->length(nb_attr); } catch (bad_alloc) { Except::throw_exception((const char *)API_MemoryAllocation, (const char *)"Can't allocate memory in server", (const char *)"DeviceImpl::get_attribute_config"); } // // Fill in these structures // for (long i = 0;i < nb_attr;i++) { try { if (all_attr == true) { Attribute &attr = dev_attr->get_attr_by_ind(i); attr.get_properties((*back)[i]); } else { Attribute &attr = dev_attr->get_attr_by_name(names[i]); attr.get_properties((*back)[i]); } } catch (Tango::DevFailed &e) { delete back; throw; } } // // Return to caller // cout4 << "Leaving DeviceImpl::get_attribute_config" << endl; return back; } //+------------------------------------------------------------------------- // // method : DeviceImpl::set_attribute_config // // description : CORBA operation to set attribute configuration locally // and in the Tango database // // argument: in : - new_conf: The new attribute(s) configuration. One // AttributeConfig structure is needed for each // attribute to update // //-------------------------------------------------------------------------- void DeviceImpl::set_attribute_config(const Tango::AttributeConfigList& new_conf) { AutoTangoMonitor sync(this,true); cout4 << "DeviceImpl::set_attribute_config arrived" << endl; // // The attribute conf. is protected by two monitors. One protects access between // get and set attribute conf. The second one protects access between set and // usage. This is the classical device monitor // TangoMonitor &mon1 = get_att_conf_monitor(); AutoTangoMonitor sync1(&mon1); // // Record operation request in black box // blackbox_ptr->insert_op(Op_Set_Attr_Config); // // Check if device is locked // check_lock("set_attribute_config"); // // Return exception if the device does not have any attribute // long nb_dev_attr = dev_attr->get_attr_nb(); if (nb_dev_attr == 0) { Except::throw_exception((const char *)API_AttrNotFound, (const char *)"The device does not have any attribute", (const char *)"DeviceImpl::set_attribute_config"); } // // Get some event related data // Tango::Util *tg = Tango::Util::instance(); EventSupplier *event_supplier_nd = NULL; EventSupplier *event_supplier_zmq = NULL; // // Update attribute config first in database, then locally // Finally send attr conf. event // long nb_attr = new_conf.length(); long i; try { for (i = 0;i < nb_attr;i++) { string tmp_name(new_conf[i].name); transform(tmp_name.begin(),tmp_name.end(),tmp_name.begin(),::tolower); if ((tmp_name == "state") || (tmp_name == "status")) { Except::throw_exception((const char *)API_AttrNotFound, (const char *)"Cannot set config for attribute state or status", (const char *)"DeviceImpl::set_attribute_config"); } Attribute &attr = dev_attr->get_attr_by_name(new_conf[i].name); bool old_alarm = attr.is_alarmed().any(); attr.set_properties(new_conf[i],device_name); if (Tango::Util::_UseDb == true) attr.upd_database(new_conf[i],device_name); // // In case the attribute quality factor was set to ALARM, reset it to VALID // if ((attr.get_quality() == Tango::ATTR_ALARM) && (old_alarm == true) && (attr.is_alarmed().any() == false)) attr.set_quality(Tango::ATTR_VALID); // // Send the event // if (attr.use_notifd_event() == true) event_supplier_nd = tg->get_notifd_event_supplier(); else event_supplier_nd = NULL; if (attr.use_zmq_event() == true) event_supplier_zmq = tg->get_zmq_event_supplier(); else event_supplier_zmq = NULL; if ((event_supplier_nd != NULL) || (event_supplier_zmq != NULL)) { string tmp_name(new_conf[i].name); EventSupplier::AttributeData ad; ::memset(&ad,0,sizeof(ad)); if (get_dev_idl_version() <= 2) { Tango::AttributeConfig_2 attr_conf_2; attr.get_properties_2(attr_conf_2); ad.attr_conf_2 = &attr_conf_2; if (event_supplier_nd != NULL) event_supplier_nd->push_att_conf_events(this,ad,(Tango::DevFailed *)NULL,tmp_name); if (event_supplier_zmq != NULL) event_supplier_zmq->push_att_conf_events(this,ad,(Tango::DevFailed *)NULL,tmp_name); } else { Tango::AttributeConfig_3 attr_conf_3; attr.get_properties_3(attr_conf_3); ad.attr_conf_3 = &attr_conf_3; if (event_supplier_nd != NULL) event_supplier_nd->push_att_conf_events(this,ad,(Tango::DevFailed *)NULL,tmp_name); if (event_supplier_zmq != NULL) event_supplier_zmq->push_att_conf_events(this,ad,(Tango::DevFailed *)NULL,tmp_name); } } } } catch (Tango::DevFailed &e) { // // Re build the list of "alarmable" attribute // dev_attr->get_alarm_list().clear(); for (long j = 0;j < nb_dev_attr;j++) { Attribute &att = dev_attr->get_attr_by_ind(j); if (att.is_alarmed().any() == true) { if (att.get_writable() != Tango::WRITE) dev_attr->get_alarm_list().push_back(j); } } // // Change the exception reason flag // TangoSys_OMemStream o; o << e.errors[0].reason; if (i != 0) o << "\nAll previous attribute(s) have been successfully updated"; if (i != (nb_attr - 1)) o << "\nAll remaining attribute(s) have not been updated"; o << ends; string s = o.str(); e.errors[0].reason = CORBA::string_dup(s.c_str()); throw; } // // Re build the list of "alarmable" attribute // dev_attr->get_alarm_list().clear(); for (i = 0;i < nb_dev_attr;i++) { Tango::Attribute &attr = dev_attr->get_attr_by_ind(i); Tango::AttrWriteType w_type = attr.get_writable(); if (attr.is_alarmed().any() == true) { if (w_type != Tango::WRITE) dev_attr->get_alarm_list().push_back(i); } } // // Return to caller // cout4 << "Leaving DeviceImpl::set_attribute_config" << endl; } //+------------------------------------------------------------------------- // // method : DeviceImpl::read_attributes // // description : CORBA operation to read attribute(s) value. // // argument: in : - names: name of attribute(s) to be read // // This method returns a pointer to a AttributeConfigList with one AttributeValue // structure for each atribute. This structure contains the attribute value, the // value quality and the date. // //-------------------------------------------------------------------------- Tango::AttributeValueList *DeviceImpl::read_attributes(const Tango::DevVarStringArray& names) { AutoTangoMonitor sync(this,true); Tango::AttributeValueList *back = NULL; cout4 << "DeviceImpl::read_attributes arrived" << endl; // // Write the device name into the per thread data for // sub device diagnostics. // Keep the old name, to put it back at the end! // During device access inside the same server, // the thread stays the same! // SubDevDiag &sub = (Tango::Util::instance())->get_sub_dev_diag(); string last_associated_device = sub.get_associated_device(); sub.set_associated_device(get_name()); // Catch all execeptions to set back the associated device after // execution try { // // Record operation request in black box // if (ext->store_in_bb == true) blackbox_ptr->insert_attr(names); ext->store_in_bb = true; // // Return exception if the device does not have any attribute // For device implementing IDL 3, substract 2 to the attributes // number for state and status which could be read only by // a "new" client // long vers = get_dev_idl_version(); long nb_dev_attr = dev_attr->get_attr_nb(); if (nb_dev_attr == 0) { Except::throw_exception((const char *)API_AttrNotFound, (const char *)"The device does not have any attribute", (const char *)"DeviceImpl::read_attributes"); } if (vers >= 3) nb_dev_attr = nb_dev_attr - 2; // // Build a sequence with the names of the attribute to be read. // This is necessary in case of the "AllAttr" shortcut is used // If all attributes are wanted, build this list // long i; Tango::DevVarStringArray real_names(nb_dev_attr); long nb_names = names.length(); if (nb_names == 1) { string att_name(names[0]); if (att_name == AllAttr) { real_names.length(nb_dev_attr); for (i = 0;i < nb_dev_attr;i++) real_names[i] = dev_attr->get_attr_by_ind(i).get_name().c_str(); } else { real_names = names; } } else { real_names = names; } // // Retrieve index of wanted attributes in the device attribute list and clear // their value set flag // // In IDL release 3, possibility to write spectrum and // images attributes have been added. This implies some // changes in the struture returned for a read_attributes // Throw exception if users want to use these new features // through an old interface // // nb_names = real_names.length(); vector wanted_attr; vector wanted_w_attr; for (i = 0;i < nb_names;i++) { long j = dev_attr->get_attr_ind_by_name(real_names[i]); if ((dev_attr->get_attr_by_ind(j).get_writable() == Tango::READ_WRITE) || (dev_attr->get_attr_by_ind(j).get_writable() == Tango::READ_WITH_WRITE)) { wanted_w_attr.push_back(j); wanted_attr.push_back(j); Attribute &att = dev_attr->get_attr_by_ind(wanted_attr.back()); Tango::AttrDataFormat format_type = att.get_data_format(); if ((format_type == Tango::SPECTRUM) || (format_type == Tango::IMAGE)) { TangoSys_OMemStream o; o << "Client too old to get data for attribute " << real_names[i].in(); o << ".\nPlease, use a client linked with Tango V5"; o << " and a device inheriting from Device_3Impl" << ends; Except::throw_exception((const char *)API_NotSupportedFeature, o.str(), (const char *)"DeviceImpl::read_attributes"); } att.set_value_flag(false); att.get_when().tv_sec = 0; } else { if (dev_attr->get_attr_by_ind(j).get_writable() == Tango::WRITE) { wanted_w_attr.push_back(j); Attribute &att = dev_attr->get_attr_by_ind(wanted_w_attr.back()); Tango::AttrDataFormat format_type = att.get_data_format(); if ((format_type == Tango::SPECTRUM) || (format_type == Tango::IMAGE)) { TangoSys_OMemStream o; o << "Client too old to get data for attribute " << real_names[i].in(); o << ".\nPlease, use a client linked with Tango V5"; o << " and a device inheriting from Device_3Impl" << ends; Except::throw_exception((const char *)API_NotSupportedFeature, o.str(), (const char *)"DeviceImpl::read_attributes"); } } else { wanted_attr.push_back(j); Attribute &att = dev_attr->get_attr_by_ind(wanted_attr.back()); att.set_value_flag(false); att.get_when().tv_sec = 0; } } } long nb_wanted_attr = wanted_attr.size(); long nb_wanted_w_attr = wanted_w_attr.size(); // // Call the always_executed_hook // always_executed_hook(); // // Read the hardware for readable attribute // if (nb_wanted_attr != 0) read_attr_hardware(wanted_attr); // // Set attr value (for readable attribute) // vector &attr_vect = device_class->get_class_attr()->get_attr_list(); for (i = 0;i < nb_wanted_attr;i++) { if (vers < 3) read_attr(dev_attr->get_attr_by_ind(wanted_attr[i])); else { Attribute &att = dev_attr->get_attr_by_ind(wanted_attr[i]); long idx = att.get_attr_idx(); if (idx == -1) { TangoSys_OMemStream o; o << "It is not possible to read state/status as attributes with your\n"; o << "Tango software release. Please, re-link with Tango V5." << ends; Except::throw_exception((const char *)API_NotSupportedFeature, o.str(), (const char *)"Device_Impl::read_attributes"); } if (attr_vect[idx]->is_allowed(this,Tango::READ_REQ) == false) { TangoSys_OMemStream o; o << "It is currently not allowed to read attribute "; o << att.get_name() << ends; Except::throw_exception((const char *)API_AttrNotAllowed, o.str(), (const char *)"Device_Impl::read_attributes"); } attr_vect[idx]->read(this,att); } } // // Set attr value for writable attribute // for (i = 0;i < nb_wanted_w_attr;i++) { Tango::AttrWriteType w_type = dev_attr->get_attr_by_ind(wanted_w_attr[i]).get_writable(); if ((w_type == Tango::READ_WITH_WRITE) || (w_type == Tango::WRITE)) dev_attr->get_attr_by_ind(wanted_w_attr[i]).set_rvalue(); } // // Allocate memory for the AttributeValue structures // try { back = new Tango::AttributeValueList(nb_names); back->length(nb_names); } catch (bad_alloc) { Except::throw_exception((const char *)API_MemoryAllocation, (const char *)"Can't allocate memory in server", (const char *)"DeviceImpl::read_attributes"); } // // Build the sequence returned to caller for readable attributes and check // that all the wanted attributes set value has been updated // for (i = 0;i < nb_names;i++) { Attribute &att = dev_attr->get_attr_by_name(real_names[i]); Tango::AttrQuality qual = att.get_quality(); if (qual != Tango::ATTR_INVALID) { if (att.get_value_flag() == false) { TangoSys_OMemStream o; delete back; for (long j = 0;j < i;j++) { att = dev_attr->get_attr_by_name(real_names[j]); att.delete_seq(); } try { string att_name(real_names[i]); transform(att_name.begin(),att_name.end(),att_name.begin(),::tolower); vector::iterator ite = get_polled_obj_by_type_name(Tango::POLL_ATTR,att_name); long upd = (*ite)->get_upd(); if (upd == 0) { o << "Attribute "; o << att.get_name(); o << " value is available only by CACHE.\n"; o << "Attribute values are set by external polling buffer filling" << ends; } else { o << "Read value for attribute "; o << att.get_name(); o << " has not been updated" << ends; } } catch (Tango::DevFailed &) { o << "Read value for attribute "; o << att.get_name(); o << " has not been updated" << ends; } Except::throw_exception((const char *)API_AttrValueNotSet, o.str(), (const char *)"DeviceImpl::read_attributes"); } else { Tango::AttrWriteType w_type = att.get_writable(); if ((w_type == Tango::READ) || (w_type == Tango::READ_WRITE) || (w_type == Tango::READ_WITH_WRITE)) { if ((w_type == Tango::READ_WRITE) || (w_type == Tango::READ_WITH_WRITE)) dev_attr->add_write_value(att); if ((att.is_alarmed().any() == true) && (qual != Tango::ATTR_INVALID)) att.check_alarm(); } CORBA::Any &a = (*back)[i].value; switch (att.get_data_type()) { case Tango::DEV_SHORT : { Tango::DevVarShortArray *ptr = att.get_short_value(); a <<= *ptr; delete ptr; break; } case Tango::DEV_LONG : { Tango::DevVarLongArray *ptr = att.get_long_value(); a <<= *ptr; delete ptr; break; } case Tango::DEV_LONG64 : { Tango::DevVarLong64Array *ptr = att.get_long64_value(); a <<= *ptr; delete ptr; break; } case Tango::DEV_DOUBLE : { Tango::DevVarDoubleArray *ptr = att.get_double_value(); a <<= *ptr; delete ptr; break; } case Tango::DEV_STRING : { Tango::DevVarStringArray *ptr = att.get_string_value(); a <<= *ptr; delete ptr; break; } case Tango::DEV_FLOAT : { Tango::DevVarFloatArray *ptr = att.get_float_value(); a <<= *ptr; delete ptr; break; } case Tango::DEV_BOOLEAN : { Tango::DevVarBooleanArray *ptr = att.get_boolean_value(); a <<= *ptr; delete ptr; break; } case Tango::DEV_USHORT : { Tango::DevVarUShortArray *ptr = att.get_ushort_value(); a <<= *ptr; delete ptr; break; } case Tango::DEV_UCHAR : { Tango::DevVarUCharArray *ptr = att.get_uchar_value(); a <<= *ptr; delete ptr; break; } case Tango::DEV_ULONG : { Tango::DevVarULongArray *ptr = att.get_ulong_value(); a <<= *ptr; delete ptr; break; } case Tango::DEV_ULONG64 : { Tango::DevVarULong64Array *ptr = att.get_ulong64_value(); a <<= *ptr; delete ptr; break; } case Tango::DEV_STATE : { Tango::DevVarStateArray *ptr = att.get_state_value(); a <<= *ptr; delete ptr; break; } } } } if (att.get_when().tv_sec == 0) att.set_time(); (*back)[i].time = att.get_when(); (*back)[i].quality = att.get_quality(); (*back)[i].name = CORBA::string_dup(att.get_name().c_str()); (*back)[i].dim_x = att.get_x(); (*back)[i].dim_y = att.get_y(); } } catch (...) { // set back the device attribution for the thread // and rethrow the exception. sub.set_associated_device(last_associated_device); throw; } // set back the device attribution for the thread sub.set_associated_device(last_associated_device); // // Return to caller // cout4 << "Leaving DeviceImpl::read_attributes" << endl; return back; } //+------------------------------------------------------------------------- // // method : DeviceImpl::write_attributes // // description : CORBA operation to write attribute(s) value // // argument: in : - values: The new attribute(s) value to be set. // //-------------------------------------------------------------------------- void DeviceImpl::write_attributes(const Tango::AttributeValueList& values) { AutoTangoMonitor sync(this,true); cout4 << "DeviceImpl::write_attributes arrived" << endl; // // Write the device name into the per thread data for // sub device diagnostics. // Keep the old name, to put it back at the end! // During device access inside the same server, // the thread stays the same! // SubDevDiag &sub = (Tango::Util::instance())->get_sub_dev_diag(); string last_associated_device = sub.get_associated_device(); sub.set_associated_device(get_name()); // Catch all execeptions to set back the associated device after // execution try { // // Record operation request in black box // blackbox_ptr->insert_attr(values); // // Check if the device is locked // check_lock("write_attributes"); // // Return exception if the device does not have any attribute // long nb_dev_attr = dev_attr->get_attr_nb(); if (nb_dev_attr == 0) { Except::throw_exception((const char *)API_AttrNotFound, (const char *)"The device does not have any attribute", (const char *)"DeviceImpl::write_attributes"); } // // Retrieve index of wanted attributes in the device attribute list // long nb_updated_attr = values.length(); vector updated_attr; long i; for (i = 0;i < nb_updated_attr;i++) { updated_attr.push_back(dev_attr->get_attr_ind_by_name(values[i].name)); } // // Check that these attributes are writable // for (i = 0;i < nb_updated_attr;i++) { if ((dev_attr->get_attr_by_ind(updated_attr[i]).get_writable() == Tango::READ) || (dev_attr->get_attr_by_ind(updated_attr[i]).get_writable() == Tango::READ_WITH_WRITE)) { TangoSys_OMemStream o; o << "Attribute "; o << dev_attr->get_attr_by_ind(updated_attr[i]).get_name(); o << " is not writable" << ends; Except::throw_exception((const char *)API_AttrNotWritable, o.str(), (const char *)"DeviceImpl::write_attributes"); } } // // Call the always_executed_hook // always_executed_hook(); // // Set attribute internal value // for (i = 0;i < nb_updated_attr;i++) { try { dev_attr->get_w_attr_by_ind(updated_attr[i]).check_written_value(values[i].value,(unsigned long)1,(unsigned long)0); } catch (Tango::DevFailed) { for (long j = 0;j < i;j++) dev_attr->get_w_attr_by_ind(updated_attr[j]).rollback(); throw; } } // // Write the hardware // long vers = get_dev_idl_version(); if (vers < 3) { write_attr_hardware(updated_attr); for (i = 0;i < nb_updated_attr;i++) { WAttribute &att = dev_attr->get_w_attr_by_ind(updated_attr[i]); att.copy_data(values[i].value); } } else { vector att_in_db; for (i = 0;i < nb_updated_attr;i++) { WAttribute &att = dev_attr->get_w_attr_by_ind(updated_attr[i]); vector &attr_vect = device_class->get_class_attr()->get_attr_list(); if (attr_vect[att.get_attr_idx()]->is_allowed(this,Tango::WRITE_REQ) == false) { TangoSys_OMemStream o; o << "It is currently not allowed to write attribute "; o << att.get_name(); o << ". The device state is " << Tango::DevStateName[get_state()] << ends; Except::throw_exception((const char *)API_AttrNotAllowed, o.str(), (const char *)"Device_Impl::write_attributes"); } attr_vect[att.get_attr_idx()]->write(this,att); att.copy_data(values[i].value); if (att.is_memorized() == true) att_in_db.push_back(i); if (att.is_alarmed().test(Attribute::rds) == true) att.set_written_date(); } if ((Tango::Util::_UseDb == true) && (att_in_db.empty() == false)) { try { static_cast(this)->write_attributes_in_db(att_in_db,updated_attr); } catch (Tango::DevFailed &e) { Except::re_throw_exception(e,(const char *)API_AttrNotAllowed, (const char *)"Failed to store memorized attribute value in db", (const char *)"Device_Impl::write_attributes"); } } } } catch (...) { // set back the device attribution for the thread // and rethrow the exception. sub.set_associated_device(last_associated_device); throw; } // set back the device attribution for the thread sub.set_associated_device(last_associated_device); // // Return to caller. // cout4 << "Leaving DeviceImpl::write_attributes" << endl; } //+------------------------------------------------------------------------- // // method : DeviceImpl::add_attribute // // description : Add attribute to the device attribute(s) list // // argument: in : - new_attr: The new attribute to be added. // //-------------------------------------------------------------------------- void DeviceImpl::add_attribute(Tango::Attr *new_attr) { // // Take the device monitor in order to protect the attribute list // AutoTangoMonitor sync(this,true); vector &attr_list = device_class->get_class_attr()->get_attr_list(); long old_attr_nb = attr_list.size(); // // Check that this attribute is not already defined for this device. // If it is already there, immediately returns. // Trick : If you add an attribute to a device, this attribute will be // inserted in the device class attribute list. Therefore, all devices // created after this attribute addition will also have this attribute. // string &attr_name = new_attr->get_name(); bool already_there = true; bool throw_ex = false; try { Tango::Attribute &al_attr = dev_attr->get_attr_by_name(attr_name.c_str()); if ((al_attr.get_data_type() != new_attr->get_type()) || (al_attr.get_data_format() != new_attr->get_format()) || (al_attr.get_writable() != new_attr->get_writable())) { throw_ex = true; } } catch (Tango::DevFailed) { already_there = false; } // // Throw exception if the device already have an attribute with the same name // but with a different definition // if (throw_ex == true) { TangoSys_OMemStream o; o << "Device " << get_name() << " -> Attribute " << attr_name << " already exists for your device but with other definition"; o << "\n(data type, data format or data write type)" << ends; Except::throw_exception((const char *)API_AttrNotFound, o.str(), (const char *)"Device_Impl::add_attribute"); } if (already_there == true) { delete new_attr; return; } // // Add this attribute in the MultiClassAttribute attr_list vector if it does not // already exist // bool need_free = false; long i; for (i = 0;i < old_attr_nb;i++) { if ((attr_list[i]->get_name() == attr_name) && (attr_list[i]->get_cl_name() == new_attr->get_cl_name())) { need_free = true; break; } } if (i == old_attr_nb) { attr_list.push_back(new_attr); // // Get all the properties defined for this attribute at class level // device_class->get_class_attr()->init_class_attribute( device_class->get_name(), old_attr_nb); } else { // // An attribute with the same name is already defined within the class // Check if the data type, data format and write type are the same // if ((attr_list[i]->get_type() != new_attr->get_type()) || (attr_list[i]->get_format() != new_attr->get_format()) || (attr_list[i]->get_writable() != new_attr->get_writable())) { TangoSys_OMemStream o; o << "Device " << get_name() << " -> Attribute " << attr_name << " already exists for your device class but with other definition"; o << "\n(data type, data format or data write type)" << ends; Except::throw_exception((const char *)API_AttrNotFound, o.str(), (const char *)"Device_Impl::add_attribute"); } } // // Add the attribute to the MultiAttribute object // dev_attr->add_attribute(device_name,device_class,i); // // Free memory if needed // if (need_free == true) delete new_attr; } //+------------------------------------------------------------------------- // // method : DeviceImpl::remove_attribute // // description : Remove attribute to the device attribute(s) list // // argument: in : - rem_attr: The attribute to be deleted. // - free_it : Free Attr object flag // - clean_db : Clean attribute related info in db // //-------------------------------------------------------------------------- void DeviceImpl::remove_attribute(Tango::Attr *rem_attr, bool free_it,bool clean_db) { // // Take the device monitor in order to protect the attribute list // AutoTangoMonitor sync(this,true); // // Check that the class support this attribute // string &attr_name = rem_attr->get_name(); try { dev_attr->get_attr_by_name(attr_name.c_str()); } catch (Tango::DevFailed) { TangoSys_OMemStream o; o << "Attribute " << attr_name << " is not defined as attribute for your device."; o << "\nCan't remove it" << ends; Except::throw_exception((const char *)API_AttrNotFound, o.str(), (const char *)"Device_Impl::remove_attribute"); } // // stop any configured polling for this attribute first! // vector &poll_attr = get_polled_attr(); vector::iterator ite_attr; string attr_name_low(attr_name); transform(attr_name_low.begin(),attr_name_low.end(),attr_name_low.begin(),::tolower); // // try to find the attribute in the list of polled attributes // Tango::Util *tg = Tango::Util::instance(); ite_attr = find(poll_attr.begin(),poll_attr.end(), attr_name_low); if (ite_attr != poll_attr.end()) { // stop the polling and clean-up the database DServer *adm_dev = tg->get_dserver_device(); DevVarStringArray send; send.length(3); send[0] = CORBA::string_dup(device_name.c_str()); send[1] = CORBA::string_dup("attribute"); send[2] = CORBA::string_dup(attr_name.c_str()); if (tg->is_svr_shutting_down() == true) { // // There is no need to stop the polling because we are // in the server shutdown sequence and the polling is // already stopped. // if (clean_db == true && Tango::Util::_UseDb == true) { // // Memorize the fact that the dynamic polling properties has to be removed from // db. The classical attribute properties as well // tg->get_polled_dyn_attr_names().push_back(attr_name_low); if (tg->get_full_polled_att_list().size() == 0) { tg->get_full_polled_att_list() = poll_attr; tg->get_dyn_att_dev_name() = device_name; } } } else { adm_dev->rem_obj_polling(&send, clean_db); } } // // Now remove all configured attribute properties from the database // Do it in one go if the Db server support this // if (clean_db == true) { if ((tg->is_svr_shutting_down() == false) || (tg->get_database()->get_server_release() < 400)) { Tango::Attribute &att_obj = dev_attr->get_attr_by_name(attr_name.c_str()); att_obj.remove_configuration(); } else { tg->get_all_dyn_attr_names().push_back(attr_name); if (tg->get_dyn_att_dev_name().size() == 0) tg->get_dyn_att_dev_name() = device_name; } } // // Remove attribute in MultiClassAttribute in case there is // only one device in the class or it is the last device // in this class with this attribute // bool update_idx = false; unsigned long nb_dev = device_class->get_device_list().size(); if (nb_dev <= 1) { device_class->get_class_attr()->remove_attr(attr_name,rem_attr->get_cl_name()); update_idx = true; } else { vector dev_list = device_class->get_device_list(); unsigned long nb_except = 0; for (unsigned long i = 0;i < nb_dev;i++) { try { Attribute &att = dev_list[i]->get_device_attr()->get_attr_by_name(attr_name.c_str()); vector &attr_list = device_class->get_class_attr()->get_attr_list(); if (attr_list[att.get_attr_idx()]->get_cl_name() != rem_attr->get_cl_name()) nb_except++; } catch (Tango::DevFailed) { nb_except++; } } if (nb_except == (nb_dev - 1)) { device_class->get_class_attr()->remove_attr(attr_name,rem_attr->get_cl_name()); update_idx = true; } } // // Now, remove the attribute from the MultiAttribute object // dev_attr->remove_attribute(attr_name,update_idx); // // Delete Attr object if wanted // if ((free_it == true) && (update_idx == true)) delete rem_attr; } //+------------------------------------------------------------------------- // // method : DeviceImpl::remove_attribute // // description : Remove attribute to the device attribute(s) list // // argument: in : - rem_attr: The name of the attribute to be deleted. // - free_it : Free Attr object flag // - clean_db : Clean attribute related info in db // //-------------------------------------------------------------------------- void DeviceImpl::remove_attribute(string &rem_attr_name, bool free_it,bool clean_db) { try { Attr &att = device_class->get_class_attr()->get_attr(rem_attr_name); remove_attribute(&att,free_it,clean_db); } catch (Tango::DevFailed &e) { TangoSys_OMemStream o; o << "Attribute " << rem_attr_name << " is not defined as attribute for your device."; o << "\nCan't remove it" << ends; Except::re_throw_exception(e,(const char *)API_AttrNotFound, o.str(), (const char *)"Device_Impl::remove_attribute"); } } //+------------------------------------------------------------------------- // // method : DeviceImpl::poll_lists_2_v5 // // description : Started from Tango V5, state and status are polled // as attributes. Previously, they were polled as commands. // If state or status are polled as commands, move them // to the list of polled attributes // //-------------------------------------------------------------------------- void DeviceImpl::poll_lists_2_v5() { bool db_update = false; vector &poll_cmd = get_polled_cmd(); vector &poll_attr = get_polled_attr(); vector::iterator ite_state; vector::iterator ite_status; // // Try to find state in list of polled command(s). If found, // remove it from poll cmd and move it to poll attr // ite_state = find(poll_cmd.begin(),poll_cmd.end(),"state"); if (ite_state != poll_cmd.end()) { poll_attr.push_back(*ite_state); poll_attr.push_back(*(ite_state + 1)); poll_cmd.erase(ite_state,ite_state + 2); db_update = true; } // // The same for status // ite_status = find(poll_cmd.begin(),poll_cmd.end(),"status"); if (ite_status != poll_cmd.end()) { poll_attr.push_back(*ite_status); poll_attr.push_back(*(ite_status + 1)); poll_cmd.erase(ite_status,ite_status + 2); db_update = true; } // // Now update database if needed // if (db_update == true) { DbDatum p_cmd("polled_cmd"); DbDatum p_attr("polled_attr"); p_cmd << poll_cmd; p_attr << poll_attr; DbData db_data; db_data.push_back(p_cmd); db_data.push_back(p_attr); get_db_device()->put_property(db_data); } } //+---------------------------------------------------------------------------- // // method : DeviceImplExt::~DeviceImplExt // // description : DeviceImpl extension class destructor. This destructor // delete memory for ring buffer used for polling. // //----------------------------------------------------------------------------- DeviceImpl::DeviceImplExt::~DeviceImplExt() { for (unsigned long i = 0;i < poll_obj_list.size();i++) { delete (poll_obj_list[i]); } #ifdef TANGO_HAS_LOG4TANGO if (logger && logger != Logging::get_core_logger()) { logger->remove_all_appenders(); delete logger; logger = 0; } #endif delete locker_client; delete old_locker_client; } //+------------------------------------------------------------------------- // // method : Attribute::init_cmd_poll_ext_trig // // description : Write the command name to the list of polled commands in the database. // The polling period is set to 0 to indicate that the polling buffer // is filled externally from the device server code. // //-------------------------------------------------------------------------- void DeviceImpl::init_cmd_poll_ext_trig(string cmd_name) { string cmd_lowercase(cmd_name); transform(cmd_lowercase.begin(),cmd_lowercase.end(),cmd_lowercase.begin(),::tolower); // never do the for the state or status commands, they are // handled as attributes! if ( cmd_name == "state" || cmd_name == "status" ) { TangoSys_OMemStream o; o << "State and status are handled as attributes for the polling" << ends; Except::throw_exception((const char *)API_CommandNotFound, o.str(), (const char *)"DeviceImpl::init_poll_ext_trig"); } // check whether the command exists for the device and can be polled check_command_exists (cmd_lowercase); // check wether the database is used Tango::Util *tg = Tango::Util::instance(); if ( tg->_UseDb == true ) { vector &poll_list = get_polled_cmd(); Tango::DbData poll_data; bool found = false; poll_data.push_back(Tango::DbDatum("polled_cmd")); // read the polling configuration from the database // tg->get_database()->get_device_property(device_name, poll_data); // if (poll_data[0].is_empty()==false) if (poll_list.empty() == false) { //poll_data[0] >> poll_list; // search the attribute in the list of polled attributes for (unsigned int i = 0;i < poll_list.size();i = i+2) { // Convert to lower case before comparison string name_lowercase(poll_list[i]); transform(name_lowercase.begin(),name_lowercase.end(),name_lowercase.begin(),::tolower); if ( name_lowercase == cmd_lowercase) { poll_list[i+1] = "0"; found = true; } } } if ( found == false ) { poll_list.push_back (cmd_lowercase); poll_list.push_back ("0"); } poll_data[0] << poll_list; tg->get_database()->put_device_property(device_name, poll_data); } } //+------------------------------------------------------------------------- // // method : Attribute::init_cmd_poll_period // // description : Checks the specified polling period for all commands of the device. // If a polling period is specified for a command the // command name and the period are written to the list of polled // commands in the database. // This happens only if the command is not yet in the list of polled commands. // //-------------------------------------------------------------------------- void DeviceImpl::init_cmd_poll_period() { // check wether the database is used Tango::Util *tg = Tango::Util::instance(); if ( tg->_UseDb == true ) { vector &poll_list = get_polled_cmd(); Tango::DbData poll_data; poll_data.push_back(Tango::DbDatum("polled_cmd")); // read the polling configuration from the database // tg->get_database()->get_device_property(device_name, poll_data); // if (poll_data[0].is_empty()==false) // { // poll_data[0] >> poll_list; // } // get the command list vector &cmd_list = device_class->get_command_list(); // loop over the command list unsigned long added_cmd = 0; unsigned long i; for (i = 0;i < cmd_list.size();i++) { long poll_period; poll_period = cmd_list[i]->get_polling_period(); //check the validity of the polling period. // must be longer than 20ms if ( poll_period < MIN_POLL_PERIOD ) { continue; } // never do the for the state or status commands, they are // handled as attributes! string cmd_name = cmd_list[i]->get_lower_name(); if ( cmd_name == "state" || cmd_name == "status" ) { continue; } // Can only handle commands without input argument if (cmd_list[i]->get_in_type() != Tango::DEV_VOID) { continue; } // search the command in the list of polled commands bool found = false; for (unsigned int i = 0;i < poll_list.size();i = i+2) { // Convert to lower case before comparison string name_lowercase(poll_list[i]); transform(name_lowercase.begin(),name_lowercase.end(),name_lowercase.begin(),::tolower); if ( name_lowercase == cmd_name) { found = true; break; } } if ( found == false ) { string period_str; stringstream str; str << poll_period << ends; str >> period_str; poll_list.push_back (cmd_name); poll_list.push_back (period_str); added_cmd++; } } // only write to the database when a polling need to be added if ( added_cmd > 0 ) { poll_data[0] << poll_list; tg->get_database()->put_device_property(device_name, poll_data); } } } //+------------------------------------------------------------------------- // // method : Attribute::init_attr_poll_ext_trig // // description : Write the attribute name to the list of polled attributes in the database. // The polling period is set to 0 to indicate that the polling buffer // is filled externally from the device server code. // //-------------------------------------------------------------------------- void DeviceImpl::init_attr_poll_ext_trig(string attr_name) { string attr_lowercase(attr_name); transform(attr_lowercase.begin(),attr_lowercase.end(),attr_lowercase.begin(),::tolower); // check whether the attribute exists for the device and can be polled dev_attr->get_attr_by_name (attr_lowercase.c_str()); // check wether the database is used Tango::Util *tg = Tango::Util::instance(); if ( tg->_UseDb == true ) { vector &poll_list = get_polled_attr(); Tango::DbData poll_data; bool found = false; poll_data.push_back(Tango::DbDatum("polled_attr")); // read the polling configuration from the database if (poll_list.empty() == false) { // search the attribute in the list of polled attributes for (unsigned int i = 0;i < poll_list.size();i = i+2) { // Convert to lower case before comparison string name_lowercase(poll_list[i]); transform(name_lowercase.begin(),name_lowercase.end(),name_lowercase.begin(),::tolower); if ( name_lowercase == attr_lowercase) { if ( poll_list[i+1] == "0" ) { // The configuration is already correct, no need for further action return; } else { poll_list[i+1] = "0"; found = true; } } } } if ( found == false ) { poll_list.push_back (attr_lowercase); poll_list.push_back ("0"); } poll_data[0] << poll_list; tg->get_database()->put_device_property(device_name, poll_data); } } //+------------------------------------------------------------------------- // // method : DeviceImpl::init_attr_poll_period // // description : Checks the specified polling period for all attributes of the device. // If a polling period is specified for an attribute the // attribute name and the period are written to the list of polled // attributes in the database. // This happens only if the attribute is not yet in the list of polled attributes. // //-------------------------------------------------------------------------- void DeviceImpl::init_attr_poll_period() { // // check wether the database is used // Tango::Util *tg = Tango::Util::instance(); if ( tg->_UseDb == true ) { vector &poll_list = get_polled_attr(); Tango::DbData poll_data; poll_data.push_back(Tango::DbDatum("polled_attr")); // // get the multi attribute object // vector &attr_list = dev_attr->get_attribute_list(); // // loop over the attribute list // unsigned long added_attr = 0; unsigned long i; for (i = 0;i < attr_list.size();i++) { string &attr_name = attr_list[i]->get_name_lower(); // // Special case for state and status attributes // They are polled as attribute but they are managed by Pogo as // commands (historical reasons). If the polling is set in the // state or status defined as command, report this info when they // are defined as attributes // if (attr_name == "state") { Command &state_cmd = device_class->get_cmd_by_name("state"); long state_poll_period = state_cmd.get_polling_period(); if (state_poll_period != 0) { attr_list[i]->set_polling_period(state_poll_period); } } if (attr_name == "status") { Command &status_cmd = device_class->get_cmd_by_name("status"); long status_poll_period = status_cmd.get_polling_period(); if (status_poll_period != 0) { attr_list[i]->set_polling_period(status_poll_period); } } long poll_period; poll_period = attr_list[i]->get_polling_period(); // //check the validity of the polling period. // must be longer than 20ms // if ( poll_period < MIN_POLL_PERIOD ) { continue; } // // search the attribute in the list of polled attributes // bool found = false; for (unsigned int i = 0;i < poll_list.size();i = i+2) { // // Convert to lower case before comparison // string name_lowercase(poll_list[i]); transform(name_lowercase.begin(),name_lowercase.end(),name_lowercase.begin(),::tolower); if ( name_lowercase == attr_name) { found = true; break; } } if ( found == false ) { string period_str; stringstream str; str << poll_period << ends; str >> period_str; poll_list.push_back (attr_name); poll_list.push_back (period_str); added_attr++; } } // // only write to the database when a polling need to be added // if ( added_attr > 0 ) { poll_data[0] << poll_list; tg->get_database()->put_device_property(device_name, poll_data); } // // Another loop to correctly initialize polling period data in Attribute instance // for (unsigned int i = 0;i < poll_list.size();i = i+2) { try { Attribute &att = dev_attr->get_attr_by_name(poll_list[i].c_str()); stringstream ss; long per; ss << poll_list[i + 1]; ss >> per; if (ss) att.set_polling_period(per); } catch (Tango::DevFailed &) {} } } } //+------------------------------------------------------------------------- // // method : DeviceImpl::push_att_conf_event // // description : Push an attribute configuration event // // args : in : - attr : The attribute // //-------------------------------------------------------------------------- void DeviceImpl::push_att_conf_event(Attribute *attr) { EventSupplier *event_supplier_nd = NULL; EventSupplier *event_supplier_zmq = NULL; Tango::Util *tg = Tango::Util::instance(); if (attr->use_notifd_event() == true) event_supplier_nd = tg->get_notifd_event_supplier(); if (attr->use_zmq_event() == true) event_supplier_zmq = tg->get_zmq_event_supplier(); if ((event_supplier_nd != NULL) || (event_supplier_zmq != NULL)) { EventSupplier::AttributeData ad; ::memset(&ad,0,sizeof(ad)); if (get_dev_idl_version() <= 2) { Tango::AttributeConfig_2 attr_conf_2; attr->get_properties_2(attr_conf_2); ad.attr_conf_2 = &attr_conf_2; if (event_supplier_nd != NULL) event_supplier_nd->push_att_conf_events(this,ad,(Tango::DevFailed *)NULL,attr->get_name()); if (event_supplier_zmq != NULL) event_supplier_zmq->push_att_conf_events(this,ad,(Tango::DevFailed *)NULL,attr->get_name()); } else { Tango::AttributeConfig_3 attr_conf_3; attr->get_properties_3(attr_conf_3); ad.attr_conf_3 = &attr_conf_3; if (event_supplier_nd != NULL) event_supplier_nd->push_att_conf_events(this,ad,(Tango::DevFailed *)NULL,attr->get_name()); if (event_supplier_zmq != NULL) event_supplier_zmq->push_att_conf_events(this,ad,(Tango::DevFailed *)NULL,attr->get_name()); } } } //+------------------------------------------------------------------------- // // method : DeviceImpl::get_client_ident() // // description : Get client identification // // This method returns a pointer to the client identification // //-------------------------------------------------------------------------- Tango::client_addr *DeviceImpl::get_client_ident() { omni_thread::value_t *ip = omni_thread::self()->get_value(key); return (client_addr *)ip; } //+------------------------------------------------------------------------- // // method : DeviceImpl::lock // // description : Lock the device // // args : in : - cl : The client identification // - validity : The lock validity // //-------------------------------------------------------------------------- void DeviceImpl::lock(client_addr *cl,int validity) { // // Check if the device is already locked and if it is a valid lock // If the lock is not valid any more, clear it // if (ext->device_locked == true) { if (valid_lock() == true) { if (*cl != *(ext->locker_client)) { TangoSys_OMemStream o; o << "Device " << get_name() << " is already locked by another client" << ends; Except::throw_exception((const char *)API_DeviceLocked,o.str(), (const char *)"Device_Impl::lock"); } } else { basic_unlock(); } } // // Lock the device // ext->device_locked = true; if (ext->locker_client == NULL) { ext->locker_client = new client_addr(*cl); } ext->locking_date = time(NULL); ext->lock_validity = validity; ext->lock_ctr++; } //+------------------------------------------------------------------------- // // method : DeviceImpl::relock // // description : ReLock the device // // args : in : - cl : The client identification // - th_period : The lock validity time // //-------------------------------------------------------------------------- void DeviceImpl::relock(client_addr *cl) { // // Check if the device is already locked and if it is a valid lock // A ReLock is valid only if the device is already locked by the same client // and if this lock is valid // if (ext->device_locked == true) { if (valid_lock() == true) { if (*cl != *(ext->locker_client)) { TangoSys_OMemStream o; o << get_name() << ": "; o << "Device " << get_name() << " is already locked by another client" << ends; Except::throw_exception((const char *)API_DeviceLocked,o.str(), (const char *)"Device_Impl::relock"); } ext->device_locked = true; ext->locking_date = time(NULL); } else { TangoSys_OMemStream o; o << get_name() << ": "; o << "Device " << get_name() << " is not locked. Can't re-lock it" << ends; Except::throw_exception((const char *)API_DeviceNotLocked,o.str(), (const char *)"Device_Impl::relock"); } } else { TangoSys_OMemStream o; o << get_name() << ": "; o << "Device " << get_name() << " is not locked. Can't re-lock it" << ends; Except::throw_exception((const char *)API_DeviceNotLocked,o.str(), (const char *)"Device_Impl::relock"); } } //+------------------------------------------------------------------------- // // method : DeviceImpl::unlock // // description : Unlock the device // //-------------------------------------------------------------------------- Tango::DevLong DeviceImpl::unlock(bool forced) { // // Check if the device is already locked and if it is a valid lock // If the lock is not valid any more, clear it // if (ext->device_locked == true) { if (valid_lock() == true) { client_addr *cl = get_client_ident(); if (forced == false) { if (*cl != *(ext->locker_client)) { TangoSys_OMemStream o; o << "Device " << get_name() << " is locked by another client, can't unlock it" << ends; Except::throw_exception((const char *)API_DeviceLocked,o.str(), (const char *)"Device_Impl::unlock"); } } } } if (ext->lock_ctr > 0) ext->lock_ctr--; if ((ext->lock_ctr <= 0) || (forced == true)) basic_unlock(forced); return ext->lock_ctr; } //+------------------------------------------------------------------------- // // method : DeviceImpl::basic_unlock // // description : Mark the device as unlocked // //-------------------------------------------------------------------------- void DeviceImpl::basic_unlock(bool forced) { ext->device_locked = false; if (forced == true) ext->old_locker_client = ext->locker_client; else delete ext->locker_client; ext->locker_client = NULL; ext->lock_ctr = 0; } //+------------------------------------------------------------------------- // // method : DeviceImpl::valid_lock // // description : Check lock validity (according to lock validity time) // // This method returns true if the lock is still valid. Otherwise, returns // false // //-------------------------------------------------------------------------- bool DeviceImpl::valid_lock() { time_t now = time(NULL); if (now > (ext->locking_date + ext->lock_validity)) return false; else return true; } //+------------------------------------------------------------------------- // // method : DeviceImpl::lock_status // // description : Build a device locking status // // This method returns a sequence with longs and strings // // The strings contain: // 1 - The locker process hostname // 2 - The java main class (in case of Java locker) // 3 - A string which summarizes the locking status // The longs contain: // 1 - A locked flag (0 means not locked, 1 means locked) // 2 - The locker process PID (C++ client) // 3 - The locker UUID (Java client) which needs 4 longs // //-------------------------------------------------------------------------- Tango::DevVarLongStringArray *DeviceImpl::lock_status() { Tango::DevVarLongStringArray *dvlsa = new Tango::DevVarLongStringArray(); dvlsa->lvalue.length(6); dvlsa->svalue.length(3); // // Check if the device is already locked and if it is a valid lock // If the lock is not valid any more, clear it // if (ext->device_locked == true) { if (valid_lock() == true) { ext->lock_status = "Device " + device_name + " is locked by "; ostringstream ostr; ostr << *(ext->locker_client) << ends; ext->lock_status = ext->lock_status + ostr.str(); dvlsa->lvalue[0] = 1; dvlsa->lvalue[1] = ext->locker_client->client_pid; const char *tmp = ext->locker_client->client_ip; dvlsa->svalue[1] = CORBA::string_dup(tmp); if (ext->locker_client->client_lang == Tango::JAVA) { dvlsa->svalue[2] = CORBA::string_dup(ext->locker_client->java_main_class.c_str()); Tango::DevULong64 tmp_data = ext->locker_client->java_ident[0]; dvlsa->lvalue[2] = (DevLong)((tmp_data & 0xFFFFFFFF00000000LL) >> 32); dvlsa->lvalue[3] = (DevLong)(tmp_data & 0xFFFFFFFF); tmp_data = ext->locker_client->java_ident[1]; dvlsa->lvalue[4] = (DevLong)((tmp_data & 0xFFFFFFFF00000000LL) >> 32); dvlsa->lvalue[5] = (DevLong)(tmp_data & 0xFFFFFFFF); } else { dvlsa->svalue[2] = CORBA::string_dup("Not defined"); for (long loop = 2;loop < 6;loop++) dvlsa->lvalue[loop] = 0; } } else { basic_unlock(); ext->lock_status = "Device " + device_name + " is not locked"; dvlsa->svalue[1] = CORBA::string_dup("Not defined"); dvlsa->svalue[2] = CORBA::string_dup("Not defined"); for (long loop = 0;loop < 6;loop++) dvlsa->lvalue[loop] = 0; } } else { ext->lock_status = "Device " + device_name + " is not locked"; dvlsa->svalue[1] = CORBA::string_dup("Not defined"); dvlsa->svalue[2] = CORBA::string_dup("Not defined"); for (long loop = 0;loop < 6;loop++) dvlsa->lvalue[loop] = 0; } dvlsa->svalue[0] = CORBA::string_dup(ext->lock_status.c_str()); return dvlsa; } //+------------------------------------------------------------------------- // // method : DeviceImpl::set_locking_param // // description : Restore device locking parameter // // args : - cl : Locker // - old_cl : Previous locker // - date : Locking date // - ctr : Locking counter // - valid : Locking validity // //-------------------------------------------------------------------------- void DeviceImpl::set_locking_param(client_addr *cl,client_addr *old_cl,time_t date,DevLong ctr,DevLong valid) { ext->locker_client = cl; ext->old_locker_client = old_cl; ext->locking_date = date; ext->lock_ctr = ctr; ext->device_locked = true; ext->lock_validity = valid; } //+------------------------------------------------------------------------- // // method : DeviceImpl::check_lock // // description : Method called for each command_inout operation executed // from any client on a Tango device. // //-------------------------------------------------------------------------- void DeviceImpl::check_lock(const char *meth,const char *cmd) { if (ext->device_locked == true) { if (valid_lock() == true) { client_addr *cl = get_client_ident(); if (cl->client_ident == false) { // // Old client, before throwing the exception, in case the CORBA operation is // a command_inout, checks if the command is an "allowed" one // if (cmd != NULL) { if (device_class->is_command_allowed(cmd) == false) { throw_locked_exception(meth); } } else throw_locked_exception(meth); } if (*cl != *(ext->locker_client)) { // // Wrong client, before throwing the exception, in case the CORBA operation is // a command_inout, checks if the command is an "allowed" one // if (cmd != NULL) { if (device_class->is_command_allowed(cmd) == false) { throw_locked_exception(meth); } } else throw_locked_exception(meth); } } else { basic_unlock(); } } else { client_addr *cl = get_client_ident(); if (ext->old_locker_client != NULL) { if (*cl == (*ext->old_locker_client)) { TangoSys_OMemStream o; TangoSys_OMemStream o2; o << "Device " << get_name() << " has been unlocked by an administrative client!!!" << ends; o2 << "Device_Impl::" << meth << ends; Except::throw_exception((const char *)DEVICE_UNLOCKED_REASON,o.str(),o2.str()); } delete ext->old_locker_client; ext->old_locker_client = NULL; } } } //+------------------------------------------------------------------------- // // method : DeviceImpl::throw_locked_exception() // // description : Throw a DeviceLocked exception // //-------------------------------------------------------------------------- void DeviceImpl::throw_locked_exception(const char *meth) { TangoSys_OMemStream o; TangoSys_OMemStream o2; o << "Device " << get_name() << " is locked by another client" << ends; o2 << "Device_Impl::" << meth << ends; Except::throw_exception((const char *)API_DeviceLocked,o.str(),o2.str()); } //+------------------------------------------------------------------------- // // method : DeviceImpl::data_into_net_obj // // description : Put the attribute data within the object used on the // wire to transfer the attribute. For IDL release <= 3, // it's an Any object. Then, it is an IDL union // // argument: in : // //-------------------------------------------------------------------------- void DeviceImpl::data_into_net_object(Attribute &att,AttributeValueList_3 *back, AttributeValueList_4 *back4, long index,AttrWriteType w_type,bool del_seq) { // // A big switch according to attribute data type // switch (att.get_data_type()) { case Tango::DEV_SHORT : { Tango::DevVarShortArray *ptr = att.get_short_value(); if (back != NULL) { (*back)[index].value <<= *ptr; } else { (*back4)[index].value.short_att_value(dummy_short_att_value); DevVarShortArray &the_seq = (*back4)[index].value.short_att_value(); the_seq.replace(ptr->length(),ptr->length(),ptr->get_buffer(),ptr->release()); if (ptr->release() == true) ptr->get_buffer(true); } if (del_seq == true) delete ptr; break; } case Tango::DEV_LONG : { Tango::DevVarLongArray *ptr = att.get_long_value(); if (back != NULL) { (*back)[index].value <<= *ptr; } else { (*back4)[index].value.long_att_value(dummy_long_att_value); DevVarLongArray &the_seq = (*back4)[index].value.long_att_value(); the_seq.replace(ptr->length(),ptr->length(),ptr->get_buffer(),ptr->release()); if (ptr->release() == true) ptr->get_buffer(true); } if (del_seq == true) delete ptr; break; } case Tango::DEV_LONG64 : { Tango::DevVarLong64Array *ptr = att.get_long64_value(); if (back != NULL) { (*back)[index].value <<= *ptr; } else { (*back4)[index].value.long64_att_value(dummy_long64_att_value); DevVarLong64Array &the_seq = (*back4)[index].value.long64_att_value(); the_seq.replace(ptr->length(),ptr->length(),ptr->get_buffer(),ptr->release()); if (ptr->release() == true) ptr->get_buffer(true); } if (del_seq == true) delete ptr; break; } case Tango::DEV_DOUBLE : { Tango::DevVarDoubleArray *ptr = att.get_double_value(); if (back != NULL) { (*back)[index].value <<= *ptr; } else { (*back4)[index].value.double_att_value(dummy_double_att_value); DevVarDoubleArray &the_seq = (*back4)[index].value.double_att_value(); the_seq.replace(ptr->length(),ptr->length(),ptr->get_buffer(),ptr->release()); if (ptr->release() == true) ptr->get_buffer(true); } if (del_seq == true) delete ptr; break; } case Tango::DEV_STRING : { Tango::DevVarStringArray *ptr = att.get_string_value(); if (back != NULL) { (*back)[index].value <<= *ptr; } else { (*back4)[index].value.string_att_value(dummy_string_att_value); DevVarStringArray &the_seq = (*back4)[index].value.string_att_value(); the_seq.replace(ptr->length(),ptr->length(),ptr->get_buffer(),ptr->release()); if (ptr->release() == true) ptr->get_buffer(true); } if (del_seq == true) delete ptr; break; } case Tango::DEV_FLOAT : { Tango::DevVarFloatArray *ptr = att.get_float_value(); if (back != NULL) { (*back)[index].value <<= *ptr; } else { (*back4)[index].value.float_att_value(dummy_float_att_value); DevVarFloatArray &the_seq = (*back4)[index].value.float_att_value(); the_seq.replace(ptr->length(),ptr->length(),ptr->get_buffer(),ptr->release()); if (ptr->release() == true) ptr->get_buffer(true); } if (del_seq == true) delete ptr; break; } case Tango::DEV_BOOLEAN : { Tango::DevVarBooleanArray *ptr = att.get_boolean_value(); if (back != NULL) { (*back)[index].value <<= *ptr; } else { (*back4)[index].value.bool_att_value(dummy_boolean_att_value); DevVarBooleanArray &the_seq = (*back4)[index].value.bool_att_value(); the_seq.replace(ptr->length(),ptr->length(),ptr->get_buffer(),ptr->release()); if (ptr->release() == true) ptr->get_buffer(true); } if (del_seq == true) delete ptr; break; } case Tango::DEV_USHORT : { Tango::DevVarUShortArray *ptr = att.get_ushort_value(); if (back != NULL) { (*back)[index].value <<= *ptr; } else { (*back4)[index].value.ushort_att_value(dummy_ushort_att_value); DevVarUShortArray &the_seq = (*back4)[index].value.ushort_att_value(); the_seq.replace(ptr->length(),ptr->length(),ptr->get_buffer(),ptr->release()); if (ptr->release() == true) ptr->get_buffer(true); } if (del_seq == true) delete ptr; break; } case Tango::DEV_UCHAR : { Tango::DevVarCharArray *ptr = att.get_uchar_value(); if (back != NULL) { (*back)[index].value <<= *ptr; } else { (*back4)[index].value.uchar_att_value(dummy_uchar_att_value); DevVarCharArray &the_seq = (*back4)[index].value.uchar_att_value(); the_seq.replace(ptr->length(),ptr->length(),ptr->get_buffer(),ptr->release()); if (ptr->release() == true) ptr->get_buffer(true); } if (del_seq == true) delete ptr; break; } case Tango::DEV_ULONG : { Tango::DevVarULongArray *ptr = att.get_ulong_value(); if (back != NULL) { (*back)[index].value <<= *ptr; } else { (*back4)[index].value.ulong_att_value(dummy_ulong_att_value); DevVarULongArray &the_seq = (*back4)[index].value.ulong_att_value(); the_seq.replace(ptr->length(),ptr->length(),ptr->get_buffer(),ptr->release()); if (ptr->release() == true) ptr->get_buffer(true); } if (del_seq == true) delete ptr; break; } case Tango::DEV_ULONG64 : { Tango::DevVarULong64Array *ptr = att.get_ulong64_value(); if (back != NULL) { (*back)[index].value <<= *ptr; } else { (*back4)[index].value.ulong64_att_value(dummy_ulong64_att_value); DevVarULong64Array &the_seq = (*back4)[index].value.ulong64_att_value(); the_seq.replace(ptr->length(),ptr->length(),ptr->get_buffer(),ptr->release()); if (ptr->release() == true) ptr->get_buffer(true); } if (del_seq == true) delete ptr; break; } case Tango::DEV_STATE : { Tango::DevVarStateArray *ptr = att.get_state_value(); if (back != NULL) { (*back)[index].value <<= *ptr; } else { (*back4)[index].value.state_att_value(dummy_state_att_value); DevVarStateArray &the_seq = (*back4)[index].value.state_att_value(); the_seq.replace(ptr->length(),ptr->length(),ptr->get_buffer(),ptr->release()); if (ptr->release() == true) ptr->get_buffer(true); } if (del_seq == true) delete ptr; break; } case Tango::DEV_ENCODED : { if (back4 == NULL) { (*back)[index].err_list.length(1); (*back)[index].err_list[0].severity = Tango::ERR; (*back)[index].err_list[0].reason = CORBA::string_dup(API_NotSupportedFeature); (*back)[index].err_list[0].origin = CORBA::string_dup("Device_3Impl::read_attributes_no_except"); (*back)[index].err_list[0].desc = CORBA::string_dup("The DevEncoded data type is available only for device implementing IDL 4 and above"); (*back)[index].quality = Tango::ATTR_INVALID; (*back)[index].name = CORBA::string_dup(att.get_name().c_str()); clear_att_dim((*back)[index]); } else { (*back4)[index].value.encoded_att_value(dummy_encoded_att_value); DevVarEncodedArray &the_seq = (*back4)[index].value.encoded_att_value(); Tango::DevVarEncodedArray *ptr = att.get_encoded_value(); if ((w_type == Tango::READ) || (w_type == Tango::WRITE)) the_seq.length(1); else the_seq.length(2); the_seq[0].encoded_format = CORBA::string_dup((*ptr)[0].encoded_format); if (ptr->release() == true) { unsigned long nb_data = (*ptr)[0].encoded_data.length(); the_seq[0].encoded_data.replace(nb_data,nb_data,(*ptr)[0].encoded_data.get_buffer(true),true); (*ptr)[0].encoded_data.replace(0,0,NULL,false); } else the_seq[0].encoded_data.replace((*ptr)[0].encoded_data.length(),(*ptr)[0].encoded_data.length(),(*ptr)[0].encoded_data.get_buffer()); if ((w_type == Tango::READ_WRITE) || (w_type == Tango::READ_WITH_WRITE)) { the_seq[1].encoded_format = CORBA::string_dup((*ptr)[1].encoded_format); the_seq[1].encoded_data.replace((*ptr)[1].encoded_data.length(),(*ptr)[1].encoded_data.length(),(*ptr)[1].encoded_data.get_buffer()); } if (del_seq == true) delete ptr; } break; } } } //+------------------------------------------------------------------------- // // method : DeviceImpl::polled_data_into_net_obj // // description : Put the attribute data within the object used on the // wire to transfer the attribute. For IDL release <= 3, // it's an Any object. Then, it is an IDL union // // argument: in : // //-------------------------------------------------------------------------- void DeviceImpl::polled_data_into_net_object(AttributeValueList_3 *back, AttributeValueList_4 *back4, long index,long type,long vers,PollObj *polled_attr, const DevVarStringArray &names) { const Tango::DevVarDoubleArray *tmp_db; Tango::DevVarDoubleArray *new_tmp_db; const Tango::DevVarShortArray *tmp_sh; Tango::DevVarShortArray *new_tmp_sh; const Tango::DevVarLongArray *tmp_lg; Tango::DevVarLongArray *new_tmp_lg; const Tango::DevVarLong64Array *tmp_lg64; Tango::DevVarLong64Array *new_tmp_lg64; const Tango::DevVarStringArray *tmp_str; Tango::DevVarStringArray *new_tmp_str; const Tango::DevVarFloatArray *tmp_fl; Tango::DevVarFloatArray *new_tmp_fl; const Tango::DevVarBooleanArray *tmp_boo; Tango::DevVarBooleanArray *new_tmp_boo; const Tango::DevVarUShortArray *tmp_ush; Tango::DevVarUShortArray *new_tmp_ush; const Tango::DevVarCharArray *tmp_uch; Tango::DevVarCharArray *new_tmp_uch; const Tango::DevVarULongArray *tmp_ulg; Tango::DevVarULongArray *new_tmp_ulg; const Tango::DevVarULong64Array *tmp_ulg64; Tango::DevVarULong64Array *new_tmp_ulg64; const Tango::DevVarStateArray *tmp_state; Tango::DevVarStateArray *new_tmp_state; Tango::DevState sta; switch (type) { case Tango::DEV_SHORT : if (back != NULL) { if (vers >= 4) { AttributeValue_4 &att_val = polled_attr->get_last_attr_value_4(false); DevVarShortArray &union_seq = att_val.value.short_att_value(); new_tmp_sh = new DevVarShortArray(union_seq.length(), union_seq.length(), const_cast(union_seq.get_buffer()), false); } else { AttributeValue_3 &att_val = polled_attr->get_last_attr_value_3(false); att_val.value >>= tmp_sh; new_tmp_sh = new DevVarShortArray(tmp_sh->length(), tmp_sh->length(), const_cast(tmp_sh->get_buffer()), false); } (*back)[index].value <<= new_tmp_sh; } else { AttributeValue_4 &att_val = polled_attr->get_last_attr_value_4(false); (*back4)[index].value.short_att_value(att_val.value.short_att_value()); } break; case Tango::DEV_DOUBLE : if (back != NULL) { if (vers >= 4) { AttributeValue_4 &att_val = polled_attr->get_last_attr_value_4(false); DevVarDoubleArray &union_seq = att_val.value.double_att_value(); new_tmp_db = new DevVarDoubleArray(union_seq.length(), union_seq.length(), const_cast(union_seq.get_buffer()), false); } else { AttributeValue_3 &att_val = polled_attr->get_last_attr_value_3(false); att_val.value >>= tmp_db; new_tmp_db = new DevVarDoubleArray(tmp_db->length(), tmp_db->length(), const_cast(tmp_db->get_buffer()), false); } (*back)[index].value <<= new_tmp_db; } else { AttributeValue_4 &att_val = polled_attr->get_last_attr_value_4(false); (*back4)[index].value.double_att_value(att_val.value.double_att_value()); } break; case Tango::DEV_LONG : if (back != NULL) { if (vers >= 4) { AttributeValue_4 &att_val = polled_attr->get_last_attr_value_4(false); DevVarLongArray &union_seq = att_val.value.long_att_value(); new_tmp_lg = new DevVarLongArray(union_seq.length(), union_seq.length(), const_cast(union_seq.get_buffer()), false); } else { AttributeValue_3 &att_val = polled_attr->get_last_attr_value_3(false); att_val.value >>= tmp_lg; new_tmp_lg = new DevVarLongArray(tmp_lg->length(), tmp_lg->length(), const_cast(tmp_lg->get_buffer()), false); } (*back)[index].value <<= new_tmp_lg; } else { AttributeValue_4 &att_val = polled_attr->get_last_attr_value_4(false); (*back4)[index].value.long_att_value(att_val.value.long_att_value()); } break; case Tango::DEV_LONG64 : if (back != NULL) { if (vers >= 4) { AttributeValue_4 &att_val = polled_attr->get_last_attr_value_4(false); DevVarLong64Array &union_seq = att_val.value.long64_att_value(); new_tmp_lg64 = new DevVarLong64Array(union_seq.length(), union_seq.length(), const_cast(union_seq.get_buffer()), false); } else { AttributeValue_3 &att_val = polled_attr->get_last_attr_value_3(false); att_val.value >>= tmp_lg64; new_tmp_lg64 = new DevVarLong64Array(tmp_lg64->length(),tmp_lg64->length(), const_cast(tmp_lg64->get_buffer()),false); } (*back)[index].value <<= new_tmp_lg64; } else { AttributeValue_4 &att_val = polled_attr->get_last_attr_value_4(false); (*back4)[index].value.long64_att_value(att_val.value.long64_att_value()); } break; case Tango::DEV_STRING : if (back != NULL) { if (vers >= 4) { AttributeValue_4 &att_val = polled_attr->get_last_attr_value_4(false); DevVarStringArray &union_seq = att_val.value.string_att_value(); new_tmp_str = new DevVarStringArray(union_seq.length(), union_seq.length(), const_cast(union_seq.get_buffer()), false); } else { AttributeValue_3 &att_val = polled_attr->get_last_attr_value_3(false); att_val.value >>= tmp_str; new_tmp_str = new DevVarStringArray(tmp_str->length(), tmp_str->length(), const_cast(tmp_str->get_buffer()), false); } (*back)[index].value <<= new_tmp_str; } else { AttributeValue_4 &att_val = polled_attr->get_last_attr_value_4(false); (*back4)[index].value.string_att_value(att_val.value.string_att_value()); } break; case Tango::DEV_FLOAT : if (back != NULL) { if (vers >= 4) { AttributeValue_4 &att_val = polled_attr->get_last_attr_value_4(false); DevVarFloatArray &union_seq = att_val.value.float_att_value(); new_tmp_fl = new DevVarFloatArray(union_seq.length(), union_seq.length(), const_cast(union_seq.get_buffer()), false); } else { AttributeValue_3 &att_val = polled_attr->get_last_attr_value_3(false); att_val.value >>= tmp_fl; new_tmp_fl = new DevVarFloatArray(tmp_fl->length(), tmp_fl->length(), const_cast(tmp_fl->get_buffer()), false); } (*back)[index].value <<= new_tmp_fl; } else { AttributeValue_4 &att_val = polled_attr->get_last_attr_value_4(false); (*back4)[index].value.float_att_value(att_val.value.float_att_value()); } break; case Tango::DEV_BOOLEAN : if (back != NULL) { if (vers >= 4) { AttributeValue_4 &att_val = polled_attr->get_last_attr_value_4(false); DevVarBooleanArray &union_seq = att_val.value.bool_att_value(); new_tmp_boo = new DevVarBooleanArray(union_seq.length(), union_seq.length(), const_cast(union_seq.get_buffer()), false); } else { AttributeValue_3 &att_val = polled_attr->get_last_attr_value_3(false); att_val.value >>= tmp_boo; new_tmp_boo = new DevVarBooleanArray(tmp_boo->length(), tmp_boo->length(), const_cast(tmp_boo->get_buffer()), false); } (*back)[index].value <<= new_tmp_boo; } else { AttributeValue_4 &att_val = polled_attr->get_last_attr_value_4(false); (*back4)[index].value.bool_att_value(att_val.value.bool_att_value()); } break; case Tango::DEV_USHORT : if (back != NULL) { if (vers >= 4) { AttributeValue_4 &att_val = polled_attr->get_last_attr_value_4(false); DevVarUShortArray &union_seq = att_val.value.ushort_att_value(); new_tmp_ush = new DevVarUShortArray(union_seq.length(), union_seq.length(), const_cast(union_seq.get_buffer()), false); } else { AttributeValue_3 &att_val = polled_attr->get_last_attr_value_3(false); att_val.value >>= tmp_ush; new_tmp_ush = new DevVarUShortArray(tmp_ush->length(), tmp_ush->length(), const_cast(tmp_ush->get_buffer()), false); } (*back)[index].value <<= new_tmp_ush; } else { AttributeValue_4 &att_val = polled_attr->get_last_attr_value_4(false); (*back4)[index].value.ushort_att_value(att_val.value.ushort_att_value()); } break; case Tango::DEV_UCHAR : if (back != NULL) { if (vers >= 4) { AttributeValue_4 &att_val = polled_attr->get_last_attr_value_4(false); DevVarCharArray &union_seq = att_val.value.uchar_att_value(); new_tmp_uch = new DevVarUCharArray(union_seq.length(), union_seq.length(), const_cast(union_seq.get_buffer()), false); } else { AttributeValue_3 &att_val = polled_attr->get_last_attr_value_3(false); att_val.value >>= tmp_uch; new_tmp_uch = new DevVarCharArray(tmp_uch->length(), tmp_uch->length(), const_cast(tmp_uch->get_buffer()), false); } (*back)[index].value <<= new_tmp_uch; } else { AttributeValue_4 &att_val = polled_attr->get_last_attr_value_4(false); (*back4)[index].value.uchar_att_value(att_val.value.uchar_att_value()); } break; case Tango::DEV_ULONG : if (back != NULL) { if (vers >= 4) { AttributeValue_4 &att_val = polled_attr->get_last_attr_value_4(false); DevVarULongArray &union_seq = att_val.value.ulong_att_value(); new_tmp_ulg = new DevVarULongArray(union_seq.length(), union_seq.length(), const_cast(union_seq.get_buffer()), false); } else { AttributeValue_3 &att_val = polled_attr->get_last_attr_value_3(false); att_val.value >>= tmp_ulg; new_tmp_ulg = new DevVarULongArray(tmp_ulg->length(),tmp_ulg->length(), const_cast(tmp_ulg->get_buffer()),false); } (*back)[index].value <<= new_tmp_ulg; } else { AttributeValue_4 &att_val = polled_attr->get_last_attr_value_4(false); (*back4)[index].value.ulong_att_value(att_val.value.ulong_att_value()); } break; case Tango::DEV_ULONG64 : if (back != NULL) { if (vers >= 4) { AttributeValue_4 &att_val = polled_attr->get_last_attr_value_4(false); DevVarULong64Array &union_seq = att_val.value.ulong64_att_value(); new_tmp_ulg64 = new DevVarULong64Array(union_seq.length(), union_seq.length(), const_cast(union_seq.get_buffer()), false); } else { AttributeValue_3 &att_val = polled_attr->get_last_attr_value_3(false); att_val.value >>= tmp_ulg64; new_tmp_ulg64 = new DevVarULong64Array(tmp_ulg64->length(),tmp_ulg64->length(), const_cast(tmp_ulg64->get_buffer()),false); } (*back)[index].value <<= new_tmp_ulg64; } else { AttributeValue_4 &att_val = polled_attr->get_last_attr_value_4(false); (*back4)[index].value.ulong64_att_value(att_val.value.ulong64_att_value()); } break; case Tango::DEV_STATE : if (back != NULL) { if (vers >= 4) { AttributeValue_4 &att_val = polled_attr->get_last_attr_value_4(false); if (att_val.value._d() == DEVICE_STATE) { sta = att_val.value.dev_state_att(); (*back)[index].value <<= sta; } else if (att_val.value._d() == ATT_STATE) { DevVarStateArray &union_seq = att_val.value.state_att_value(); new_tmp_state = new DevVarStateArray(union_seq.length(), union_seq.length(), const_cast(union_seq.get_buffer()), false); (*back)[index].value <<= new_tmp_state; } } else { AttributeValue_3 &att_val = polled_attr->get_last_attr_value_3(false); CORBA::TypeCode_var ty; ty = att_val.value.type(); if (ty->kind() == CORBA::tk_enum) { att_val.value >>= sta; (*back)[index].value <<= sta; } else { att_val.value >>= tmp_state; new_tmp_state = new DevVarStateArray(tmp_state->length(),tmp_state->length(), const_cast(tmp_state->get_buffer()),false); (*back)[index].value <<= new_tmp_state; } } } else { AttributeValue_4 &att_val = polled_attr->get_last_attr_value_4(false); if (att_val.value._d() == DEVICE_STATE) { sta = att_val.value.dev_state_att(); (*back4)[index].value.dev_state_att(sta); } else if (att_val.value._d() == ATT_STATE) { DevVarStateArray &union_seq = att_val.value.state_att_value(); (*back4)[index].value.state_att_value(union_seq); } } break; case Tango::DEV_ENCODED: if (back != NULL) { TangoSys_OMemStream o; o << "Data type for attribute " << names[index] << " is DEV_ENCODED."; o << " It's not possible to retrieve this data type through the interface you are using (IDL V3)" << ends; (*back)[index].err_list.length(1); (*back)[index].err_list[0].severity = Tango::ERR; (*back)[index].err_list[0].reason = CORBA::string_dup(API_NotSupportedFeature); (*back)[index].err_list[0].origin = CORBA::string_dup("Device_3Impl::read_attributes_from_cache"); string s = o.str(); (*back)[index].err_list[0].desc = CORBA::string_dup(s.c_str()); (*back)[index].quality = Tango::ATTR_INVALID; (*back)[index].name = CORBA::string_dup(names[index]); clear_att_dim((*back)[index]); } else { AttributeValue_4 &att_val = polled_attr->get_last_attr_value_4(false); DevVarEncodedArray &polled_seq = att_val.value.encoded_att_value(); unsigned int nb_encoded = polled_seq.length(); (*back4)[index].value.encoded_att_value(dummy_encoded_att_value); DevVarEncodedArray &the_seq = (*back4)[index].value.encoded_att_value(); the_seq.length(nb_encoded); for (unsigned int loop = 0;loop < nb_encoded;loop++) { the_seq[loop].encoded_format = CORBA::string_dup(polled_seq[loop].encoded_format); unsigned char *tmp_enc = polled_seq[loop].encoded_data.get_buffer(); unsigned int nb_data = polled_seq[loop].encoded_data.length(); the_seq[loop].encoded_data.replace(nb_data,nb_data,tmp_enc); } } } } //+------------------------------------------------------------------------------------------------------------------ // // method : // DeviceImpl::att_conf_loop // // description : // Set flags in DeviceImpl if any of the device attributes has some wrong configuration in DB generating // startup exception when the server started. // In DeviceImpl class, this method set the force_alarm_state flag and fills in the // att_wrong_db_conf vector with attribute name(s) (for device status) // //-------------------------------------------------------------------------------------------------------------------- void DeviceImpl::att_conf_loop() { vector &att_list = get_device_attr()->get_attribute_list(); // // Reset data before the new loop // vector &wrong_conf_att_list = get_att_wrong_db_conf(); wrong_conf_att_list.clear(); vector &mem_att_list = get_att_mem_failed(); mem_att_list.clear(); ext->force_alarm_state = false; // // Run the loop for wrong attribute conf. or memorized att which failed at startup // for (size_t i = 0;i < att_list.size();++i) { if (att_list[i]->is_startup_exception() == true || att_list[i]->is_mem_exception() == true) { ext->force_alarm_state = true; if (att_list[i]->is_startup_exception() == true) wrong_conf_att_list.push_back(att_list[i]->get_name()); else mem_att_list.push_back(att_list[i]->get_name()); } } ext->run_att_conf_loop = false; } //-------------------------------------------------------------------------------------------------------------------- // // method : // DeviceImpl::check_att_conf // // description : // //-------------------------------------------------------------------------------------------------------------------- void DeviceImpl::check_att_conf() { if (ext->run_att_conf_loop == true) att_conf_loop(); } //---------------------------------------------------------------------------------------------------------------------- // // method : // DeviceImpl::build_att_list_in_status_mess // // description : // Build device status message in case of device with some att with wrong conf. in db or if some memorized // attribute failed during the startup phase // // argument: // in : // - nb_att : Number of attributes in error // - att_type : Type of attribute error (conf or mem) // //--------------------------------------------------------------------------------------------------------------------- void DeviceImpl::build_att_list_in_status_mess(size_t nb_att,AttErrorType att_type) { if (nb_att > 1) alarm_status = alarm_status + "s"; alarm_status = alarm_status + " "; for (size_t i = 0;i < nb_att;++i) { if (att_type == Tango::DeviceImpl::CONF) alarm_status = alarm_status + ext->att_wrong_db_conf[i]; else alarm_status = alarm_status + ext->att_mem_failed[i]; if ((nb_att > 1) && (i <= nb_att - 2)) alarm_status = alarm_status + ", "; } if (nb_att == 1) alarm_status = alarm_status + " has "; else alarm_status = alarm_status + " have "; } } // End of Tango namespace tango-8.1.2c+dfsg.orig/lib/cpp/server/dserverclass.cpp0000644000175000017500000014452212205375142021646 0ustar piccapiccastatic const char *RcsId = "$Id: dserverclass.cpp 22833 2013-06-12 14:49:35Z taurel $\n$Name$"; //+============================================================================= // // file : DServerClass.cpp // // description : C++ source for the DServerClass and for the // command class defined for this class. The singleton // class derived from DeviceClass. It implements the // command list and all properties and methods required // by the DServer once per process. // // project : TANGO // // author(s) : A.Gotz + E.Taurel // // Copyright (C) : 2004,2005,2006,2007,2008,2009,2010,2011,2012,2013 // European Synchrotron Radiation Facility // BP 220, Grenoble 38043 // FRANCE // // This file is part of Tango. // // Tango 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. // // Tango 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 Tango. If not, see . // // $Revision: 22833 $ // //-============================================================================= #if HAVE_CONFIG_H #include #endif #include #include #include #include #ifdef TANGO_HAS_LOG4TANGO #include #endif #include namespace Tango { //+------------------------------------------------------------------------- // // method : DevRestartCmd::DevRestartCmd // // description : constructors for Command class Restart // //-------------------------------------------------------------------------- DevRestartCmd::DevRestartCmd(const char *name, Tango::CmdArgType in, Tango::CmdArgType out, const char *in_desc):Command(name,in,out) { set_in_type_desc(in_desc); } //+------------------------------------------------------------------------- // // method : DevRestartCmd::execute // // description : restart a device // //-------------------------------------------------------------------------- CORBA::Any *DevRestartCmd::execute(DeviceImpl *device, const CORBA::Any &in_any) { cout4 << "DevRestart::execute(): arrived " << endl; // // Extract the input string // const char *tmp_name; if ((in_any >>= tmp_name) == false) { Except::throw_exception((const char *)API_IncompatibleCmdArgumentType, (const char *)"Imcompatible command argument type, expected type is : string", (const char *)"DevRestartCmd::execute"); } string d_name(tmp_name); cout4 << "Received string = " << d_name << endl; // // call DServer method which implements this command // (static_cast(device))->restart(d_name); // // return to the caller // CORBA::Any *ret = return_empty_any("DevRestartCmd"); return ret; } //+---------------------------------------------------------------------------- // // method : DevRestartServerCmd::DevRestartServerCmd() // // description : constructor for the DevRestartServerCmd command of the // DServer. // //----------------------------------------------------------------------------- DevRestartServerCmd::DevRestartServerCmd(const char *name, Tango::CmdArgType in, Tango::CmdArgType out):Command(name,in,out) { } //+---------------------------------------------------------------------------- // // method : DevRestartServerCmd::execute(string &s) // // description : method to trigger the execution of the DevRestartServer // command // //----------------------------------------------------------------------------- CORBA::Any *DevRestartServerCmd::execute(DeviceImpl *device,TANGO_UNUSED(const CORBA::Any &in_any)) { cout4 << "DevRestartServerCmd::execute(): arrived" << endl; // // call DServer method which implements this command // (static_cast(device))->restart_server(); // // return to the caller // CORBA::Any *ret = return_empty_any("DevRestartServerCmd"); return ret; } //+---------------------------------------------------------------------------- // // method : DevQueryClassCmd::DevQueryClassCmd() // // description : constructor for the DevQueryClass command of the // DServer. // //----------------------------------------------------------------------------- DevQueryClassCmd::DevQueryClassCmd(const char *name, Tango::CmdArgType in, Tango::CmdArgType out, const char *out_desc):Command(name,in,out) { set_out_type_desc(out_desc); } //+---------------------------------------------------------------------------- // // method : DevQueryClassCmd::execute(string &s) // // description : method to trigger the execution of the "QueryClass" // command // //----------------------------------------------------------------------------- CORBA::Any *DevQueryClassCmd::execute(DeviceImpl *device,TANGO_UNUSED(const CORBA::Any &in_any)) { cout4 << "DevQueryClassCmd::execute(): arrived" << endl; // // call DServer method which implements this command // Tango::DevVarStringArray *ret = (static_cast(device))->query_class(); // // return data to the caller // CORBA::Any *out_any = NULL; try { out_any = new CORBA::Any(); } catch (bad_alloc) { cout3 << "Bad allocation while in DevQueryClassCmd::execute()" << endl; delete ret; Except::throw_exception((const char *)API_MemoryAllocation, (const char *)"Can't allocate memory in server", (const char *)"DevQueryClassCmd::execute"); } (*out_any) <<= ret; cout4 << "Leaving DevQueryClassCmd::execute()" << endl; return(out_any); } //+---------------------------------------------------------------------------- // // method : DevQueryDeviceCmd::DevQueryDeviceCmd() // // description : constructor for the DevQueryDevice command of the // DServer. // //----------------------------------------------------------------------------- DevQueryDeviceCmd::DevQueryDeviceCmd(const char *name, Tango::CmdArgType in, Tango::CmdArgType out, const char *out_desc):Command(name,in,out) { set_out_type_desc(out_desc); } //+---------------------------------------------------------------------------- // // method : DevQueryDeviceCmd::execute(string &s) // // description : method to trigger the execution of the "QueryDevice" // command // //----------------------------------------------------------------------------- CORBA::Any *DevQueryDeviceCmd::execute(DeviceImpl *device,TANGO_UNUSED(const CORBA::Any &in_any)) { cout4 << "DevQueryDeviceCmd::execute(): arrived" << endl; // // call DServer method which implements this command // Tango::DevVarStringArray *ret = (static_cast(device))->query_device(); // // return data to the caller // CORBA::Any *out_any = NULL; try { out_any = new CORBA::Any(); } catch (bad_alloc) { cout3 << "Bad allocation while in DevQueryDeviceCmd::execute()" << endl; delete ret; Except::throw_exception((const char *)API_MemoryAllocation, (const char *)"Can't allocate memory in server", (const char *)"DevQueryDeviceCmd::execute"); } (*out_any) <<= ret; cout4 << "Leaving DevQueryDeviceCmd::execute()" << endl; return(out_any); } //+---------------------------------------------------------------------------- // // method : DevQuerySubDeviceCmd::DevQuerySubDeviceCmd() // // description : constructor for the DevQuerySubDevice command of the // DServer. // //----------------------------------------------------------------------------- DevQuerySubDeviceCmd::DevQuerySubDeviceCmd(const char *name, Tango::CmdArgType in, Tango::CmdArgType out, const char *out_desc):Command(name,in,out) { set_out_type_desc(out_desc); } //+---------------------------------------------------------------------------- // // method : DevQuerySubDeviceCmd::execute(string &s) // // description : method to trigger the execution of the "QuerySubDevice" // command // //----------------------------------------------------------------------------- CORBA::Any *DevQuerySubDeviceCmd::execute(DeviceImpl *device,TANGO_UNUSED(const CORBA::Any &in_any)) { cout4 << "DevQuerySubDeviceCmd::execute(): arrived" << endl; // // call DServer method which implements this command // Tango::DevVarStringArray *ret = (static_cast(device))->query_sub_device(); // // return data to the caller // CORBA::Any *out_any = NULL; try { out_any = new CORBA::Any(); } catch (bad_alloc) { cout3 << "Bad allocation while in DevQuerySubDeviceCmd::execute()" << endl; delete ret; Except::throw_exception((const char *)API_MemoryAllocation, (const char *)"Can't allocate memory in server", (const char *)"DevQuerySubDeviceCmd::execute"); } (*out_any) <<= ret; cout4 << "Leaving DevQuerySubDeviceCmd::execute()" << endl; return(out_any); } //+---------------------------------------------------------------------------- // // method : DevKillCmd::DevKillCmd() // // description : constructor for the DevKill command of the // DServer. // //----------------------------------------------------------------------------- DevKillCmd::DevKillCmd(const char *name, Tango::CmdArgType in, Tango::CmdArgType out):Command(name,in,out) { } //+---------------------------------------------------------------------------- // // method : DevKillCmd::execute(string &s) // // description : method to trigger the execution of the "Kill" // command // //----------------------------------------------------------------------------- CORBA::Any *DevKillCmd::execute(DeviceImpl *device,TANGO_UNUSED(const CORBA::Any &in_any)) { cout4 << "DevKillCmd::execute(): arrived" << endl; // // call DServer method which implements this command // (static_cast(device))->kill(); // // return to the caller // CORBA::Any *ret = return_empty_any("DevKillCmd"); return ret; } //+---------------------------------------------------------------------------- // // method : DevSetTraceLevelCmd::DevSetTraceLevelCmd() // // description : constructor for the DevSetTraceLevel command of the // DServer. // //----------------------------------------------------------------------------- DevSetTraceLevelCmd::DevSetTraceLevelCmd(const char *name, Tango::CmdArgType in, Tango::CmdArgType out, const char *in_desc):Command(name,in,out) { set_in_type_desc(in_desc); } //+---------------------------------------------------------------------------- // // method : DevSetTraceLevelCmd::execute(string &s) // // description : method to trigger the execution of the "SetTraceLevel" // command // //----------------------------------------------------------------------------- CORBA::Any *DevSetTraceLevelCmd::execute(TANGO_UNUSED(DeviceImpl *device),TANGO_UNUSED(const CORBA::Any &in_any)) { cout4 << "DevSetTraceLevelCmd::execute(): arrived" << endl; #ifdef TANGO_HAS_LOG4TANGO Except::throw_exception((const char *)API_DeprecatedCommand, (const char *)"SetTraceLevel is no more supported, please use SetLoggingLevel", (const char *)"DevSetTraceLevelCmd::execute"); // // Make the compiler happy // CORBA::Any *ret = return_empty_any("DevSetTraceLevelCmd"); return ret; #else // TANGO_HAS_LOG4TANGO // // Get new level // int new_level; if ((in_any >>= new_level) == false) { cout3 << "DevSetTraceLevelCmd::execute() --> Wrong argument type" << endl; Except::throw_exception((const char *)API_IncompatibleCmdArgumentType, (const char *)"Imcompatible command argument type, expected type is : long", (const char *)"DevSetTraceLevelCmd::execute"); } // // Set new level // Tango::Util::instance()->set_trace_level(new_level); // // Return to the caller // CORBA::Any *ret = return_empty_any("DevSetTraceLevelCmd"); return ret; #endif } //+---------------------------------------------------------------------------- // // method : DevGetTraceLevelCmd::DevGetTraceLevelCmd() // // description : constructor for the DevGetTraceLevel command of the // DServer. // //----------------------------------------------------------------------------- DevGetTraceLevelCmd::DevGetTraceLevelCmd(const char *name, Tango::CmdArgType in, Tango::CmdArgType out, const char *out_desc):Command(name,in,out) { set_out_type_desc(out_desc); } //+---------------------------------------------------------------------------- // // method : DevGetTraceLevelCmd::execute(string &s) // // description : method to trigger the execution of the "DevGetTraceLevel" // command // //----------------------------------------------------------------------------- CORBA::Any *DevGetTraceLevelCmd::execute(TANGO_UNUSED(DeviceImpl *device),TANGO_UNUSED(const CORBA::Any &in_any)) { cout4 << "DevGetTraceLevelCmd::execute(): arrived" << endl; #ifdef TANGO_HAS_LOG4TANGO Except::throw_exception((const char *)API_DeprecatedCommand, (const char *)"GetTraceLevel is no more supported, please use GetLoggingLevel", (const char *)"DevGetTraceLevelCmd::execute"); // // Make the compiler happy // CORBA::Any *ret = return_empty_any("DevGetTraceLevelCmd"); return ret; #else // TANGO_HAS_LOG4TANGO // // Get level // int level = Tango::Util::instance()->get_trace_level(); // // return data to the caller // CORBA::Any *out_any = new CORBA::Any(); (*out_any) <<= level; cout4 << "Leaving DevGetTraceLevelCmd::execute()" << endl; return(out_any); #endif } //+---------------------------------------------------------------------------- // // method : DevGetTraceOutputCmd::DevGetTraceOutputCmd() // // description : constructor for the DevGetTraceoutput command of the // DServer. // //----------------------------------------------------------------------------- DevGetTraceOutputCmd::DevGetTraceOutputCmd(const char *name, Tango::CmdArgType in, Tango::CmdArgType out, const char *out_desc):Command(name,in,out) { set_out_type_desc(out_desc); } //+---------------------------------------------------------------------------- // // method : DevGetTraceOutputCmd::execute(string &s) // // description : method to trigger the execution of the "DevGetTraceOutput" // command // //----------------------------------------------------------------------------- CORBA::Any *DevGetTraceOutputCmd::execute(TANGO_UNUSED(DeviceImpl *device),TANGO_UNUSED(const CORBA::Any &in_any)) { cout4 << "DevGetTraceOutputCmd::execute(): arrived" << endl; #ifdef TANGO_HAS_LOG4TANGO Except::throw_exception((const char *)API_DeprecatedCommand, (const char *)"GetTraceOutput is no more supported, please use GetLoggingTarget", (const char *)"DevGetTraceOutputCmd::execute"); // // Make the compiler happy // CORBA::Any *ret = return_empty_any("DevGetTraceOutputCmd"); return ret; #else // // Get Trace output // string st = Tango::Util::instance()->get_trace_output(); // // return data to the caller // CORBA::Any *out_any = new CORBA::Any(); (*out_any) <<= st.c_str(); cout4 << "Leaving DevGetTraceOutputCmd::execute()" << endl; return(out_any); #endif } //+---------------------------------------------------------------------------- // // method : DevSetTraceOutputCmd::DevSetTraceOutputCmd() // // description : constructor for the DevSetTraceoutput command of the // DServer. // //----------------------------------------------------------------------------- DevSetTraceOutputCmd::DevSetTraceOutputCmd(const char *name, Tango::CmdArgType in, Tango::CmdArgType out, const char *in_desc):Command(name,in,out) { set_in_type_desc(in_desc); } //+---------------------------------------------------------------------------- // // method : DevSetTraceOutputCmd::execute(string &s) // // description : method to trigger the execution of the "Kill" // command // //----------------------------------------------------------------------------- CORBA::Any *DevSetTraceOutputCmd::execute(TANGO_UNUSED(DeviceImpl *device),TANGO_UNUSED(const CORBA::Any &in_any)) { cout4 << "DevSetTraceOutputCmd::execute(): arrived" << endl; #ifdef TANGO_HAS_LOG4TANGO Except::throw_exception((const char *)API_DeprecatedCommand, (const char *)"SetTraceOutput is no more supported, please use AddLoggingTarget", (const char *)"DevSetTraceOutputCmd::execute"); // // Make the compiler happy // CORBA::Any *ret = return_empty_any("DevSetTraceOutputCmd"); return ret; #else // // Extract the input string and try to create a output file stream from it // const char *in_file_ptr; if ((in_any >>= in_file_ptr) == false) { Except::throw_exception((const char *)API_IncompatibleCmdArgumentType, (const char *)"Imcompatible command argument type, expected type is : string", (const char *)"DevSetTraceOutputCmd::execute"); } string in_file(in_file_ptr); cout4 << "Received string = " << in_file << endl; if (in_file == InitialOutput) { delete(Tango::Util::instance()->get_trace_output_stream()); Tango::Util::instance()->set_trace_output_stream((ofstream *)NULL); ostream &tmp_stream = Tango::Util::instance()->get_out(); // // For windows, the stdc++ library also implements the new IOstreams where the // xx_with_assign classes do not exist. To copy stream, I have used the advice // from the C++ report of June 1997 // cout.copyfmt(tmp_stream); cout.clear(tmp_stream.rdstate()); cout.rdbuf(tmp_stream.rdbuf()); Tango::Util::instance()->set_trace_output(in_file); } else { ofstream *ofp = new ofstream(in_file_ptr); if (ofp->good()) { cout.copyfmt(*ofp); cout.clear(ofp->rdstate()); cout.rdbuf(ofp->rdbuf()); delete(Tango::Util::instance()->get_trace_output_stream()); Tango::Util::instance()->set_trace_output(in_file); Tango::Util::instance()->set_trace_output_stream(ofp); } else { cout3 << "Cannot open ofstream" << endl; TangoSys_OMemStream o; o << "Impossible to open file " << in_file << ends; Except::throw_exception((const char *)API_CannotOpenFile, o.str(), (const char *)"DevSetTraceoutput::execute"); } } // // return to the caller // CORBA::Any *ret = return_empty_any("DevSetTraceOutputCmd"); return ret; #endif } //+---------------------------------------------------------------------------- // // method : QueryWizardClassPropertyCmd::QueryWizardClassPropertyCmd // // description : constructor for the QueryWizardClassProperty command of the // DServer. // //----------------------------------------------------------------------------- QueryWizardClassPropertyCmd::QueryWizardClassPropertyCmd(const char *name, Tango::CmdArgType in, Tango::CmdArgType out, const char *in_desc, const char *out_desc):Command(name,in,out) { set_in_type_desc(in_desc); set_out_type_desc(out_desc); } //+---------------------------------------------------------------------------- // // method : QueryWizardClassPropertyCmd::execute(string &s) // // description : method to trigger the execution of the "QueryWizardClassProperty" // command // //----------------------------------------------------------------------------- CORBA::Any *QueryWizardClassPropertyCmd::execute(DeviceImpl *device,const CORBA::Any &in_any) { cout4 << "QueryWizardClassPropertyCmd::execute(): arrived" << endl; // // Extract the input string // const char *tmp_name; if ((in_any >>= tmp_name) == false) { Except::throw_exception((const char *)API_IncompatibleCmdArgumentType, (const char *)"Imcompatible command argument type, expected type is : string", (const char *)"QueryWizardClassPropertyCmd::execute"); } string class_name(tmp_name); // // call DServer method which implements this command // Tango::DevVarStringArray *ret = (static_cast(device))->query_class_prop(class_name); // // return data to the caller // CORBA::Any *out_any = NULL; try { out_any = new CORBA::Any(); } catch (bad_alloc) { cout3 << "Bad allocation while in QueryWizardClassPropertyCmd::execute()" << endl; delete ret; Except::throw_exception((const char *)API_MemoryAllocation, (const char *)"Can't allocate memory in server", (const char *)"QueryWizardClassPropertyCmd::execute"); } (*out_any) <<= ret; cout4 << "Leaving QueryWizardClassPropertyCmd::execute()" << endl; return(out_any); } //+---------------------------------------------------------------------------- // // method : QueryWizardDevPropertyCmd::QueryWizardDevPropertyCmd // // description : constructor for the QueryWizardDevProperty command of the // DServer. // //----------------------------------------------------------------------------- QueryWizardDevPropertyCmd::QueryWizardDevPropertyCmd(const char *name, Tango::CmdArgType in, Tango::CmdArgType out, const char *in_desc, const char *out_desc):Command(name,in,out) { set_in_type_desc(in_desc); set_out_type_desc(out_desc); } //+---------------------------------------------------------------------------- // // method : QueryWizardDevPropertyCmd::execute() // // description : method to trigger the execution of the "QueryWizardDevProperty" // command // //----------------------------------------------------------------------------- CORBA::Any *QueryWizardDevPropertyCmd::execute(DeviceImpl *device,const CORBA::Any &in_any) { cout4 << "QueryWizardDevPropertyCmd::execute(): arrived" << endl; // // Extract the input string // const char *tmp_name; if ((in_any >>= tmp_name) == false) { Except::throw_exception((const char *)API_IncompatibleCmdArgumentType, (const char *)"Imcompatible command argument type, expected type is : string", (const char *)"QueryWizardDevPropertyCmd::execute"); } string class_name(tmp_name); // // call DServer method which implements this command // Tango::DevVarStringArray *ret = (static_cast(device))->query_dev_prop(class_name); // // return data to the caller // CORBA::Any *out_any = NULL; try { out_any = new CORBA::Any(); } catch (bad_alloc) { cout3 << "Bad allocation while in QueryWizardDevPropertyCmd::execute()" << endl; delete ret; Except::throw_exception((const char *)API_MemoryAllocation, (const char *)"Can't allocate memory in server", (const char *)"QueryWizardDevPropertyCmd::execute"); } (*out_any) <<= ret; cout4 << "Leaving QueryWizardDevPropertyCmd::execute()" << endl; return(out_any); } //+---------------------------------------------------------------------------- // // method : QueryEventChannelIORCmd::QueryEventChannelIORCmd // // description : constructor for the QueryEventChannelIOR command of the // DServer. // //----------------------------------------------------------------------------- QueryEventChannelIORCmd::QueryEventChannelIORCmd(const char *name, Tango::CmdArgType in, Tango::CmdArgType out, const char *out_desc):Command(name,in,out) { set_out_type_desc(out_desc); } //+---------------------------------------------------------------------------- // // method : QueryEventChannelIORCmd::execute() // // description : method to trigger the execution of the "QueryEventChannelIOR" // command // //----------------------------------------------------------------------------- CORBA::Any *QueryEventChannelIORCmd::execute(TANGO_UNUSED(DeviceImpl *device),TANGO_UNUSED(const CORBA::Any &in_any)) { cout4 << "QueryEventChannelIORCmd::execute(): arrived" << endl; // // Get DS event channel IOR which is stored in the EventSupplier object // CORBA::Any *out_any = NULL; NotifdEventSupplier *nd_event_supplier; nd_event_supplier = Util::instance()->get_notifd_event_supplier(); if (nd_event_supplier == NULL) { cout3 << "Try to retrieve DS event channel while NotifdEventSupplier object is not yet created" << endl; Except::throw_exception((const char *)API_EventSupplierNotConstructed, (const char *)"Try to retrieve DS event channel while EventSupplier object is not created", (const char *)"QueryEventChannelIORCmd::execute"); } else { string &ior = nd_event_supplier->get_event_channel_ior(); // // return data to the caller // try { out_any = new CORBA::Any(); } catch (bad_alloc) { cout3 << "Bad allocation while in QueryEventChannelIORCmd::execute()" << endl; Except::throw_exception((const char *)API_MemoryAllocation, (const char *)"Can't allocate memory in server", (const char *)"QueryEventChannelIORCmd::execute"); } (*out_any) <<= ior.c_str(); } cout4 << "Leaving QueryEventChannelIORCmd::execute()" << endl; return(out_any); } //+---------------------------------------------------------------------------- // // method : LockDeviceCmd::LockDeviceCmd // // description : constructor for the LockDevice command of the DServer. // //----------------------------------------------------------------------------- LockDeviceCmd::LockDeviceCmd(const char *name, Tango::CmdArgType in, Tango::CmdArgType out, const char *in_desc):Command(name,in,out) { set_in_type_desc(in_desc); } //+---------------------------------------------------------------------------- // // method : LockDeviceCmd::execute() // // description : method to trigger the execution of the "LockDevice" command // //----------------------------------------------------------------------------- CORBA::Any *LockDeviceCmd::execute(DeviceImpl *device,const CORBA::Any &in_any) { cout4 << "LockDeviceCmd::execute(): arrived" << endl; // // Extract the input argument // const Tango::DevVarLongStringArray *in_data; extract(in_any,in_data); // // call DServer method which implements this command // (static_cast(device))->lock_device(in_data); // // return data to the caller // CORBA::Any *ret = return_empty_any("LockDeviceCmd"); return ret; } //+---------------------------------------------------------------------------- // // method : ReLockDevicesCmd::ReLockDeviceCmd // // description : constructor for the ReLockDevices command of the DServer. // //----------------------------------------------------------------------------- ReLockDevicesCmd::ReLockDevicesCmd(const char *name, Tango::CmdArgType in, Tango::CmdArgType out, const char *in_desc):Command(name,in,out) { set_in_type_desc(in_desc); } //+---------------------------------------------------------------------------- // // method : ReLockDevicesCmd::execute() // // description : method to trigger the execution of the "ReLockDevices" command // //----------------------------------------------------------------------------- CORBA::Any *ReLockDevicesCmd::execute(DeviceImpl *device,const CORBA::Any &in_any) { cout4 << "ReLockDevicesCmd::execute(): arrived" << endl; // // Extract the input argument // const Tango::DevVarStringArray *in_data; extract(in_any,in_data); // // call DServer method which implements this command // (static_cast(device))->re_lock_devices(in_data); // // return data to the caller // CORBA::Any *ret = return_empty_any("ReLockDevicesCmd"); return ret; } //+---------------------------------------------------------------------------- // // method : UnLockDeviceCmd::UnLockDeviceCmd // // description : constructor for the UnLockDevice command of the DServer. // //----------------------------------------------------------------------------- UnLockDeviceCmd::UnLockDeviceCmd(const char *name, Tango::CmdArgType in, Tango::CmdArgType out, const char *in_desc, const char *out_desc):Command(name,in,out) { set_in_type_desc(in_desc); set_out_type_desc(out_desc); } //+---------------------------------------------------------------------------- // // method : UnLockDeviceCmd::execute() // // description : method to trigger the execution of the "UnLockDevice" command // //----------------------------------------------------------------------------- CORBA::Any *UnLockDeviceCmd::execute(DeviceImpl *device,const CORBA::Any &in_any) { cout4 << "UnLockDeviceCmd::execute(): arrived" << endl; // // Extract the input string // const Tango::DevVarLongStringArray *in_data; extract(in_any,in_data); // // call DServer method which implements this command // Tango::DevLong ret = (static_cast(device))->un_lock_device(in_data); // // return data to the caller // CORBA::Any *out_any = NULL; try { out_any = new CORBA::Any(); } catch (bad_alloc) { cout3 << "Bad allocation while in UnLockDeviceCmd::execute()" << endl; Except::throw_exception((const char *)API_MemoryAllocation, (const char *)"Can't allocate memory in server", (const char *)"UnLockDeviceCmd::execute"); } (*out_any) <<= ret; cout4 << "Leaving UnLockDeviceCmd::execute()" << endl; return(out_any); } //+---------------------------------------------------------------------------- // // method : DevLockStatusCmd::DevLockStatusCmd // // description : constructor for the DevLockStatus command of the DServer. // //----------------------------------------------------------------------------- DevLockStatusCmd::DevLockStatusCmd(const char *name, Tango::CmdArgType in, Tango::CmdArgType out, const char *in_desc, const char *out_desc):Command(name,in,out) { set_in_type_desc(in_desc); set_out_type_desc(out_desc); } //+---------------------------------------------------------------------------- // // method : DevLockStatusCmd::execute() // // description : method to trigger the execution of the "DevLockStatus" command // //----------------------------------------------------------------------------- CORBA::Any *DevLockStatusCmd::execute(DeviceImpl *device,const CORBA::Any &in_any) { cout4 << "DevLockStatusCmd::execute(): arrived" << endl; // // Extract the input string // Tango::ConstDevString in_data; extract(in_any,in_data); // // call DServer method which implements this command // Tango::DevVarLongStringArray *ret = (static_cast(device))->dev_lock_status(in_data); // // return to the caller // CORBA::Any *out_any = NULL; try { out_any = new CORBA::Any(); } catch (bad_alloc) { cout3 << "Bad allocation while in DevLockStatusCmd::execute()" << endl; Except::throw_exception((const char *)API_MemoryAllocation, (const char *)"Can't allocate memory in server", (const char *)"DevLockStatusCmd::execute"); } (*out_any) <<= ret; cout4 << "Leaving DevLockStatusCmd::execute()" << endl; return(out_any); } //+---------------------------------------------------------------------------- // // method : EventSubscriptionChangeCmd::EventSubscriptionChangeCmd() // // description : constructor for the command of the EventTester. // // In : - name : The command name // - in : The input parameter type // - out : The output parameter type // - in_desc : The input parameter description // - out_desc : The output parameter description // //----------------------------------------------------------------------------- EventSubscriptionChangeCmd::EventSubscriptionChangeCmd(const char *name, Tango::CmdArgType in, Tango::CmdArgType out, const char *in_desc, const char *out_desc) :Command(name,in,out,in_desc,out_desc) { } // // Constructor without in/out parameters description // EventSubscriptionChangeCmd::EventSubscriptionChangeCmd(const char *name,Tango::CmdArgType in,Tango::CmdArgType out) :Command(name,in,out) { } //+---------------------------------------------------------------------------- // // method : EventSubscriptionChangeCmd::is_allowed() // // description : method to test whether command is allowed or not in this // state. In this case, the command is allowed only if // the device is in ON state // // in : - device : The device on which the command must be excuted // - in_any : The command input data // // returns : boolean - true == is allowed , false == not allowed // //----------------------------------------------------------------------------- bool EventSubscriptionChangeCmd::is_allowed(TANGO_UNUSED(Tango::DeviceImpl *device), TANGO_UNUSED(const CORBA::Any &in_any)) { // End of Generated Code // Re-Start of Generated Code return true; } //+---------------------------------------------------------------------------- // // method : EventSubscriptionChangeCmd::execute() // // description : method to trigger the execution of the command. // PLEASE DO NOT MODIFY this method core without pogo // // in : - device : The device on which the command must be excuted // - in_any : The command input data // // returns : The command output data (packed in the Any object) // //----------------------------------------------------------------------------- CORBA::Any *EventSubscriptionChangeCmd::execute(Tango::DeviceImpl *device,const CORBA::Any &in_any) { cout4 << "EventSubscriptionChangeCmd::execute(): arrived" << endl; // // Extract the input string array // const Tango::DevVarStringArray *in_data; extract(in_any,in_data); // // call DServer method which implements this command // Tango::DevLong ret = (static_cast(device))->event_subscription_change(in_data); // // return to the caller // CORBA::Any *out_any = NULL; try { out_any = new CORBA::Any(); } catch (bad_alloc) { cout3 << "Bad allocation while in EventSubscriptionChangeCmd::execute()" << endl; Except::throw_exception((const char *)API_MemoryAllocation, (const char *)"Can't allocate memory in server", (const char *)"EventSubscriptionChangeCmd::execute"); } (*out_any) <<= ret; cout4 << "Leaving EventSubscriptionChangeCmd::execute()" << endl; return(out_any); } //+---------------------------------------------------------------------------- // // method : ZmqEventSubscriptionChangeCmd::EventSubscriptionChangeCmd() // // description : constructor for the command of the . // // In : - name : The command name // - in : The input parameter type // - out : The output parameter type // - in_desc : The input parameter description // - out_desc : The output parameter description // //----------------------------------------------------------------------------- ZmqEventSubscriptionChangeCmd::ZmqEventSubscriptionChangeCmd(const char *name, Tango::CmdArgType in, Tango::CmdArgType out, const char *in_desc, const char *out_desc) :Command(name,in,out,in_desc,out_desc) { } // // Constructor without in/out parameters description // ZmqEventSubscriptionChangeCmd::ZmqEventSubscriptionChangeCmd(const char *name,Tango::CmdArgType in,Tango::CmdArgType out) :Command(name,in,out) { } //+---------------------------------------------------------------------------- // // method : ZmqEventSubscriptionChangeCmd::is_allowed() // // description : method to test whether command is allowed or not in this // state. In this case, the command is allowed only if // the device is in ON state // // in : - device : The device on which the command must be excuted // - in_any : The command input data // // returns : boolean - true == is allowed , false == not allowed // //----------------------------------------------------------------------------- bool ZmqEventSubscriptionChangeCmd::is_allowed(TANGO_UNUSED(Tango::DeviceImpl *device), TANGO_UNUSED(const CORBA::Any &in_any)) { // End of Generated Code // Re-Start of Generated Code return true; } //+---------------------------------------------------------------------------- // // method : ZmqEventSubscriptionChangeCmd::execute() // // description : method to trigger the execution of the command. // // in : - device : The device on which the command must be excuted // - in_any : The command input data // // returns : The command output data (packed in the Any object) // //----------------------------------------------------------------------------- CORBA::Any *ZmqEventSubscriptionChangeCmd::execute(Tango::DeviceImpl *device,const CORBA::Any &in_any) { cout4 << "ZmqEventSubscriptionChangeCmd::execute(): arrived" << endl; // // Extract the input string array // const Tango::DevVarStringArray *in_data; extract(in_any,in_data); // // call DServer method which implements this command // Tango::DevVarLongStringArray *ret = (static_cast(device))->zmq_event_subscription_change(in_data); // // return to the caller // CORBA::Any *out_any = NULL; try { out_any = new CORBA::Any(); } catch (bad_alloc) { cout3 << "Bad allocation while in ZmqEventSubscriptionChangeCmd::execute()" << endl; Except::throw_exception((const char *)API_MemoryAllocation, (const char *)"Can't allocate memory in server", (const char *)"ZmqEventSubscriptionChangeCmd::execute"); } (*out_any) <<= ret; cout4 << "Leaving ZmqEventSubscriptionChangeCmd::execute()" << endl; return(out_any); } //+---------------------------------------------------------------------------- // // method : EventConfirmSubscriptionCmd::EventSubscriptionChangeCmd() // // description : constructor for the command of the . // // In : - name : The command name // - in : The input parameter type // - out : The output parameter type // - in_desc : The input parameter description // - out_desc : The output parameter description // //----------------------------------------------------------------------------- EventConfirmSubscriptionCmd::EventConfirmSubscriptionCmd(const char *name, Tango::CmdArgType in, Tango::CmdArgType out, const char *in_desc) :Command(name,in,out) { set_in_type_desc(in_desc); } // // Constructor without in/out parameters description // EventConfirmSubscriptionCmd::EventConfirmSubscriptionCmd(const char *name,Tango::CmdArgType in,Tango::CmdArgType out) :Command(name,in,out) { } //+---------------------------------------------------------------------------- // // method : EventConfirmSubscriptionCmd::is_allowed() // // description : method to test whether command is allowed or not in this // state. In this case, the command is allowed only if // the device is in ON state // // in : - device : The device on which the command must be excuted // - in_any : The command input data // // returns : boolean - true == is allowed , false == not allowed // //----------------------------------------------------------------------------- bool EventConfirmSubscriptionCmd::is_allowed(TANGO_UNUSED(Tango::DeviceImpl *device), TANGO_UNUSED(const CORBA::Any &in_any)) { // End of Generated Code // Re-Start of Generated Code return true; } //+---------------------------------------------------------------------------- // // method : EventConfirmSubscriptionCmd::execute() // // description : method to trigger the execution of the command. // // in : - device : The device on which the command must be excuted // - in_any : The command input data // // returns : The command output data (packed in the Any object) // //----------------------------------------------------------------------------- CORBA::Any *EventConfirmSubscriptionCmd::execute(Tango::DeviceImpl *device,const CORBA::Any &in_any) { cout4 << "EventConfirmSubscriptionCmd::execute(): arrived" << endl; // // Extract the input string array // const Tango::DevVarStringArray *in_data; extract(in_any,in_data); // // call DServer method which implements this command // (static_cast(device))->event_confirm_subscription(in_data); // // return data to the caller // CORBA::Any *ret = return_empty_any("EventConfirmSubscriptionCmd"); return ret; } DServerClass *DServerClass::_instance = NULL; //+---------------------------------------------------------------------------- // // method : DServerClass::DServerClass() // // description : constructor for the DServerClass class // The constructor add specific class commands to the // command list, create a device of the DServer class // retrieve all classes which must be created within the // server and finally, creates these classes // // argument : in : - s : The class name // //----------------------------------------------------------------------------- bool less_than_dserver (Command *a,Command *b) { if (a->get_name() < b->get_name()) return true; else return false; } DServerClass::DServerClass(string &s):DeviceClass(s) { try { // // Add class command(s) to the command_list // command_factory(); // // Sort commands // sort(get_command_list().begin(),get_command_list().end(),less_than_dserver); // // Create device name from device server name // string dev_name(DSDeviceDomain); dev_name.append(1,'/'); dev_name.append(Tango::Util::instance()->get_ds_exec_name()); dev_name.append(1,'/'); dev_name.append(Tango::Util::instance()->get_ds_inst_name()); Tango::DevVarStringArray dev_list(1); dev_list.length(1); dev_list[0] = dev_name.c_str(); // // Create the device server device // device_factory(&dev_list); } catch (bad_alloc) { for (unsigned long i = 0;i < command_list.size();i++) delete command_list[i]; command_list.clear(); if (device_list.empty() == false) { for (unsigned long i = 0;i < device_list.size();i++) delete device_list[i]; device_list.clear(); } cerr << "Can't allocate memory while building the DServerClass object" << endl; throw; } } //+---------------------------------------------------------------------------- // // method : DServerClass::Instance // // description : Create the object if not already done. Otherwise, just // return a pointer to the object // //----------------------------------------------------------------------------- DServerClass *DServerClass::instance() { if (_instance == NULL) { cerr << "Class DServer is not initialised!" << endl; Except::throw_exception((const char *)API_DServerClassNotInitialised, (const char *)"The DServerClass is not yet initialised, please wait!", (const char *)"DServerClass::instance"); //exit(-1); } return _instance; } DServerClass *DServerClass::init() { if (_instance == NULL) { try { string s("DServer"); _instance = new DServerClass(s); } catch (bad_alloc) { throw; } } return _instance; } //+---------------------------------------------------------------------------- // // method : DServerClass::command_factory // // description : Create the command object(s) and store them in the // command list // //----------------------------------------------------------------------------- void DServerClass::command_factory() { command_list.push_back(new DevRestartCmd("DevRestart", Tango::DEV_STRING, Tango::DEV_VOID, "Device name")); command_list.push_back(new DevRestartServerCmd("RestartServer", Tango::DEV_VOID, Tango::DEV_VOID)); command_list.push_back(new DevQueryClassCmd("QueryClass", Tango::DEV_VOID, Tango::DEVVAR_STRINGARRAY, "Device server class(es) list")); command_list.push_back(new DevQueryDeviceCmd("QueryDevice", Tango::DEV_VOID, Tango::DEVVAR_STRINGARRAY, "Device server device(s) list")); command_list.push_back(new DevQuerySubDeviceCmd("QuerySubDevice", Tango::DEV_VOID, Tango::DEVVAR_STRINGARRAY, "Device server sub device(s) list")); command_list.push_back(new DevKillCmd("Kill", Tango::DEV_VOID, Tango::DEV_VOID)); // // Now, commands related to polling // command_list.push_back(new PolledDeviceCmd("PolledDevice", Tango::DEV_VOID, Tango::DEVVAR_STRINGARRAY, "Polled device name list")); command_list.push_back(new DevPollStatusCmd("DevPollStatus", Tango::DEV_STRING, Tango::DEVVAR_STRINGARRAY, "Device name", "Device polling status")); string msg("Lg[0]=Upd period."); msg = msg + (" Str[0]=Device name"); msg = msg + (". Str[1]=Object type"); msg = msg + (". Str[2]=Object name"); command_list.push_back(new AddObjPollingCmd("AddObjPolling", Tango::DEVVAR_LONGSTRINGARRAY, Tango::DEV_VOID, msg)); command_list.push_back(new UpdObjPollingPeriodCmd("UpdObjPollingPeriod", Tango::DEVVAR_LONGSTRINGARRAY, Tango::DEV_VOID, msg)); msg = "Str[0]=Device name. Str[1]=Object type. Str[2]=Object name"; command_list.push_back(new RemObjPollingCmd("RemObjPolling", Tango::DEVVAR_STRINGARRAY, Tango::DEV_VOID, msg)); command_list.push_back(new StopPollingCmd("StopPolling", Tango::DEV_VOID, Tango::DEV_VOID)); command_list.push_back(new StartPollingCmd("StartPolling", Tango::DEV_VOID, Tango::DEV_VOID)); #ifdef TANGO_HAS_LOG4TANGO msg = "Str[i]=Device-name. Str[i+1]=Target-type::Target-name"; command_list.push_back(new AddLoggingTarget("AddLoggingTarget", Tango::DEVVAR_STRINGARRAY, Tango::DEV_VOID, msg)); command_list.push_back(new RemoveLoggingTarget("RemoveLoggingTarget", Tango::DEVVAR_STRINGARRAY, Tango::DEV_VOID, msg)); command_list.push_back(new GetLoggingTarget("GetLoggingTarget", Tango::DEV_STRING, Tango::DEVVAR_STRINGARRAY, std::string("Device name"), std::string("Logging target list"))); command_list.push_back(new SetLoggingLevel("SetLoggingLevel", Tango::DEVVAR_LONGSTRINGARRAY, Tango::DEV_VOID, std::string("Lg[i]=Logging Level. Str[i]=Device name."))); command_list.push_back(new GetLoggingLevel("GetLoggingLevel", Tango::DEVVAR_STRINGARRAY, Tango::DEVVAR_LONGSTRINGARRAY, std::string("Device list"), std::string("Lg[i]=Logging Level. Str[i]=Device name."))); command_list.push_back(new StopLogging("StopLogging", Tango::DEV_VOID, Tango::DEV_VOID)); command_list.push_back(new StartLogging("StartLogging", Tango::DEV_VOID, Tango::DEV_VOID)); #else command_list.push_back(new DevSetTraceLevelCmd("SetTraceLevel", Tango::DEV_LONG, Tango::DEV_VOID, "New trace level")); command_list.push_back(new DevGetTraceLevelCmd("GetTraceLevel", Tango::DEV_VOID, Tango::DEV_LONG, "Device server trace level")); command_list.push_back(new DevSetTraceOutputCmd("SetTraceOutput", Tango::DEV_STRING, Tango::DEV_VOID, "New device server output file")); command_list.push_back(new DevGetTraceOutputCmd("GetTraceOutput", Tango::DEV_VOID, Tango::DEV_STRING, "Device server output file")); #endif // TANGO_HAS_LOG4TANGO command_list.push_back(new EventSubscriptionChangeCmd("EventSubscriptionChange", Tango::DEVVAR_STRINGARRAY, Tango::DEV_LONG, "Event consumer wants to subscribe to", "Tango lib release")); command_list.push_back(new ZmqEventSubscriptionChangeCmd("ZmqEventSubscriptionChange", Tango::DEVVAR_STRINGARRAY, Tango::DEVVAR_LONGSTRINGARRAY, "Events consumer wants to subscribe to", "Str[0] = Heartbeat pub endpoint - Str[1] = Event pub endpoint\nLg[0] = Tango lib release - Lg[1] = Device IDL release\nLg[2] = Subscriber HWM - Lg[3] = Multicast rate\nLg[4] = Multicast IVL - Lg[5] = ZMQ release")); command_list.push_back(new EventConfirmSubscriptionCmd("EventConfirmSubscription", Tango::DEVVAR_STRINGARRAY, Tango::DEV_VOID, "Str[0] = dev1 name, Str[1] = att1 name, Str[2] = event name, Str[3] = dev2 name, Str[4] = att2 name, Str[5] = event name,...")); command_list.push_back(new QueryWizardClassPropertyCmd("QueryWizardClassProperty", Tango::DEV_STRING, Tango::DEVVAR_STRINGARRAY, "Class name", "Class property list (name - description and default value)")); command_list.push_back(new QueryWizardDevPropertyCmd("QueryWizardDevProperty", Tango::DEV_STRING, Tango::DEVVAR_STRINGARRAY, "Class name", "Device property list (name - description and default value)")); // // Locking device commands // command_list.push_back(new LockDeviceCmd("LockDevice", Tango::DEVVAR_LONGSTRINGARRAY, Tango::DEV_VOID, "Str[0] = Device name. Lg[0] = Lock validity")); command_list.push_back(new UnLockDeviceCmd("UnLockDevice", Tango::DEVVAR_LONGSTRINGARRAY, Tango::DEV_LONG, "Str[x] = Device name(s). Lg[0] = Force flag", "Device global lock counter")); command_list.push_back(new ReLockDevicesCmd("ReLockDevices", Tango::DEVVAR_STRINGARRAY, Tango::DEV_VOID, "Device(s) name")); command_list.push_back(new DevLockStatusCmd("DevLockStatus", Tango::DEV_STRING, Tango::DEVVAR_LONGSTRINGARRAY, "Device name", "Device locking status")); if (Util::_FileDb == true) { command_list.push_back(new QueryEventChannelIORCmd("QueryEventChannelIOR", Tango::DEV_VOID, Tango::DEV_STRING, "Device server event channel IOR")); } } //+---------------------------------------------------------------------------- // // method : DServerClass::device_factory // // description : Create the device object(s) and store them in the // device list // // in : Tango::DevVarStringArray *devlist_ptr : // The device name list // //----------------------------------------------------------------------------- void DServerClass::device_factory(const Tango::DevVarStringArray *devlist_ptr) { Tango::Util *tg = Tango::Util::instance(); for (unsigned long i = 0;i < devlist_ptr->length();i++) { cout4 << "Device name : " << (*devlist_ptr)[i].in() << endl; // // Create device and add it into the device list // device_list.push_back(new DServer(this, (*devlist_ptr)[i], "A device server device !!", Tango::ON, "The device is ON")); // // Export device to the outside world // if ((Tango::Util::_UseDb == true) && (Tango::Util::_FileDb == false)) export_device(device_list.back()); else export_device(device_list.back(),(*devlist_ptr)[i]); // // After the export of the admin device, the server is marked as started // and the database server connection timeout is set to the classical // timeout value (Except for db server itself) // tg->set_svr_starting(false); Database *db = tg->get_database(); if ((db != NULL) && (Util::_FileDb == false)) db->set_timeout_millis(CLNT_TIMEOUT); } } } // End of Tango namespace tango-8.1.2c+dfsg.orig/lib/cpp/server/encoded_attribute.h0000644000175000017500000001477212205375142022302 0ustar piccapicca///============================================================================= // // file : encoded_attribute.h // // description : Include file for the management of Tango::DevEncoded format // // project : TANGO // // author(s) : JL Pons // // Copyright (C) : 2004,2005,2006,2007,2008,2009,2010,2011,2012,2013 // European Synchrotron Radiation Facility // BP 220, Grenoble 38043 // FRANCE // // This file is part of Tango. // // Tango 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. // // Tango 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 Tango. If not, see . // // $Revision: 22213 $ // // //============================================================================= #include #ifndef _ENCODED_ATT_H #define _ENCODED_ATT_H #include namespace Tango { /** * This class provides method to deal with Tango::DevEncoded attribute format. * * @headerfile tango.h * @ingroup Server */ class EncodedAttribute { public: /**@name Constructors * Miscellaneous constructors */ //@{ /** * Create a new EncodedAttribute object. * */ EncodedAttribute(); /** * Create a new EncodedAttribute object with a user defined buffer pool. * * This constructor allows the user to define the size of the buffer pool used to * store the encoded images. This buffer pool is managed as a circular pool. * A different buffer is used each time an image is encoded. The last used buffer is then * passed to the attribute with the attribute::set_value() method * * @param buf_pool_size Buffer pool size * @param serialization Set to true if the instance manage the data buffer serialization * */ EncodedAttribute(int buf_pool_size,bool serialization = false); //@} /**@name Destructor * Only one desctructor is defined for this class */ //@{ /** * The attribute desctructor. */ ~EncodedAttribute(); //@} /**@name Image Encoding Methods */ //@{ /** * Encode a 8 bit grayscale image as JPEG format * * @param gray8 Array of 8bit gray sample * @param width The image width * @param height The image height * @param quality Quality of JPEG (0=poor quality 100=max quality) * */ void encode_jpeg_gray8(unsigned char *gray8,int width,int height,double quality); /** * Encode a 32 bit rgb color image as JPEG format * * @param rgb32 Array of 32bit RGB sample (RGB0RGB0...) * @param width The image width * @param height The image height * @param quality Quality of JPEG (0=poor quality 100=max quality) * */ void encode_jpeg_rgb32(unsigned char *rgb32,int width,int height,double quality); /** * Encode a 24 bit rgb color image as JPEG format * * @param rgb24 Array of 32bit RGB sample (RGBRGB...) * @param width The image width * @param height The image height * @param quality Quality of JPEG (0=poor quality 100=max quality) * */ void encode_jpeg_rgb24(unsigned char *rgb24,int width,int height,double quality); /** * Encode a 8 bit grayscale image (no compression) * * @param gray8 Array of 8bit gray sample * @param width The image width * @param height The image height * */ void encode_gray8(unsigned char *gray8,int width,int height); /** * Encode a 16 bit grayscale image (no compression) * * @param gray16 Array of 16bit gray sample * @param width The image width * @param height The image height * */ void encode_gray16(unsigned short *gray16,int width,int height); /** * Encode a 24 bit color image (no compression) * * @param rgb24 Array of 24bit RGB sample * @param width The image width * @param height The image height * */ void encode_rgb24(unsigned char *rgb24,int width,int height); //@} /**@name Image Decoding Methods */ //@{ /** * Decode a color image (JPEG_RGB or RGB24) and returns a 32 bits RGB image. * Throws DevFailed in case of failure. * * @param attr DeviceAttribute that contains the image * @param width Width of the image * @param height Height of the image * @param rgb32 Image (memory allocated by the function) */ void decode_rgb32(DeviceAttribute *attr,int *width,int *height,unsigned char **rgb32); /** * Decode a 8 bits grayscale image (JPEG_GRAY8 or GRAY8) and returns a 8 bits gray scale image. * Throws DevFailed in case of failure. * * @param attr DeviceAttribute that contains the image * @param width Width of the image * @param height Height of the image * @param gray8 Image (memory allocated by the function) */ void decode_gray8(DeviceAttribute *attr,int *width,int *height,unsigned char **gray8); /** * Decode a 16 bits grayscale image (GRAY16) and returns a 16 bits gray scale image. * Throws DevFailed in case of failure. * * @param attr DeviceAttribute that contains the image * @param width Width of the image * @param height Height of the image * @param gray16 Image (memory allocated by the function) */ void decode_gray16(DeviceAttribute *attr,int *width,int *height,unsigned short **gray16); //@} /// @privatesection DevUChar *get_data() {if (index==0) return (DevUChar *)buffer_array[buf_elt_nb-1]; else return (DevUChar *)buffer_array[index-1];} long get_size() {if (index==0) return (long)buffSize_array[buf_elt_nb-1]; else return (long)buffSize_array[index-1];} DevString *get_format() {return &format;} bool get_exclusion() {return manage_exclusion;} omni_mutex *get_mutex() {if (index==0) return &(mutex_array[buf_elt_nb-1]); else return &(mutex_array[index-1]);} private: class EncodedAttributeExt { }; unsigned char **buffer_array; int *buffSize_array; omni_mutex *mutex_array; char *format; int index; int buf_elt_nb; bool manage_exclusion; #ifdef HAS_UNIQUE_PTR unique_ptr ext; // Class extension #else EncodedAttributeExt *ext; #endif }; #define INC_INDEX() \ index++; \ if (index == buf_elt_nb) \ index = 0; } // End of Tango namespace #endif // _ENCODED_ATT_H tango-8.1.2c+dfsg.orig/lib/cpp/server/w_attribute.h0000644000175000017500000007537212205375142021152 0ustar piccapicca//============================================================================= // // file : w_attribute.h // // description : Include file for the WAttribute classes. // // project : TANGO // // author(s) : A.Gotz + E.Taurel // // Copyright (C) : 2004,2005,2006,2007,2008,2009,2010,2011,2012,2013 // European Synchrotron Radiation Facility // BP 220, Grenoble 38043 // FRANCE // // This file is part of Tango. // // Tango 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. // // Tango 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 Tango. If not, see . // // $Revision: 22213 $ // //============================================================================= #ifndef _WATTRIBUTE_H #define _WATTRIBUTE_H #include #include #include #include namespace Tango { //============================================================================= // // The WAttribute class // // // description : This class inherits the Attribute class. There is one // instance of this class for each writable attribute // //============================================================================= /** * This class represents a writable attribute. It inherits from the Attribute * class and only add what is specific to writable attribute. * * $Author: taurel $ * $Revision: 22213 $ * * @headerfile tango.h * @ingroup Server */ class WAttribute:public Attribute { public: /**@name Constructors * Miscellaneous constructors */ //@{ /** * Create a new Writable Attribute object. * * @param prop_list The attribute properties list. Each property is an object * of the AttrProperty class * @param tmp_attr The temporary attribute object built from user parameters * @param dev_name The device name * @param idx The index of the related Attr object in the MultiClassAttribute * vector of Attr object */ WAttribute(vector &prop_list,Attr &tmp_attr,string &dev_name,long idx); //@} /**@name Destructor * Only one desctructor is defined for this class */ //@{ /** * The WAttribute desctructor. */ ~WAttribute(); //@} /**@name Attribute configuration methods * Miscellaneous methods dealing with attribute min and max value property */ //@{ /** * Check if the attribute has a minimum value. * * @return A boolean set to true if the attribute has a minimum value * defined */ bool is_min_value() {return check_min_value;} /** * Set attribute minimum value * * @param min_value Reference to a variable which represents the new min value */ template void set_min_value(const T &min_value); void set_min_value(char *min_value); void set_min_value(const char *min_value); /** * Gets attribute minimum value or throws an exception if the * attribute does not have a minimum value * * @param min_value Reference to a variable which value will be set to the attribute's * minimum value */ template void get_min_value(T &min_value); /** * Check if the attribute has a maximum value. * * @return check_max_value A boolean set to true if the attribute has a maximum value * defined */ bool is_max_value() {return check_max_value;} /** * Set attribute maximum value * * @param max_value Reference to a variable which represents the new max value */ template void set_max_value(const T &max_value); void set_max_value(char *max_value); void set_max_value(const char *max_value); /** * Get attribute maximum value or throws an exception if the * attribute does not have a maximum value * * @param max_value Reference to a variable which value will be set to the attribute's * maximum value */ template void get_max_value(T &max_value); //@} /**@name Get new value for attribute * Miscellaneous method to retrieve from the WAttribute object the new value * for the attribute. */ //@{ /** * Retrieve the new value length (data number) for writable attribute. * * @return The new value data length */ long get_write_value_length(); /** * Retrieve the date of the last attribute writing. This is set only * if the attribute has a read different than set alarm. Otherwise, * date is set to 0. * * @return The written date */ struct timeval &get_write_date() {return write_date;} /** * Retrieve the new value for writable attribute when attribute data type is * Tango::DevShort. * * @param val A reference to a Tango::DevShort data which will be initialised * with the new value */ void get_write_value(Tango::DevShort &val) {val = short_val;} /** * Retrieve the new value for writable attribute when attribute data type is * Tango::DevShort and the attribute is SPECTRUM or IMAGE. * * @param ptr Reference to a pointer wich will be set to point to the data * to be written into the attribute. This pointer points into attribute * internal memory which must not be freed. */ void get_write_value(const Tango::DevShort *&ptr) {ptr = short_ptr;} /** * Retrieve the new value for writable attribute when attribute data type is * Tango::DevLong. * * @param val A reference to a Tango::DevLong data which will be initialised * with the new value */ void get_write_value(Tango::DevLong &val) {val = long_val;} /** * Retrieve the new value for writable attribute when attribute data type is * Tango::DevLong and the attribute is SPECTRUM or IMAGE. * * @param ptr Reference to a pointer which will be set to point to the data * to be written into the attribute. This pointer points into attribute * internal memory which must not be freed. */ void get_write_value(const Tango::DevLong *&ptr) {ptr = long_ptr;} /** * Retrieve the new value for writable attribute when attribute data type is * Tango::DevLong64. * * @param val A reference to a Tango::DevLong64 data which will be initialised * with the new value */ void get_write_value(Tango::DevLong64 &val) {val = w_ext->long64_val;} /** * Retrieve the new value for writable attribute when attribute data type is * Tango::DevLong64 and the attribute is SPECTRUM or IMAGE. * * @param ptr Reference to a pointer which will be set to point to the data * to be written into the attribute. This pointer points into attribute * internal memory which must not be freed. */ void get_write_value(const Tango::DevLong64 *&ptr) {ptr = w_ext->long64_ptr;} /** * Retrieve the new value for writable attribute when attribute data type is * Tango::DevFloat. * * @param val A reference to a Tango::DevFloat data which will be initialised * with the new value */ void get_write_value(Tango::DevFloat &val) {val = float_val;} /** * Retrieve the new value for writable attribute when attribute data type is * Tango::DevFloat and the attribute is SPECTRUM or IMAGE. * * @param ptr Reference to a pointer which will be set to point to the data * to be written into the attribute. This pointer points into attribute * internal memory which must not be freed. */ void get_write_value(const Tango::DevFloat *&ptr) {ptr = float_ptr;} /** * Retrieve the new value for writable attribute when attribute data type is * Tango::DevDouble. * * @param val A reference to a Tango::DevDouble data which will be initialised * with the new value */ void get_write_value(Tango::DevDouble &val) {val = double_val;} /** * Retrieve the new value for writable attribute when attribute data type is * Tango::DevDouble and the attribute is SPECTRUM or IMAGE. * * @param ptr Reference to a pointer which will be set to point to the data * to be written into the attribute. This pointer points into attribute * internal memory which must not be freed. */ void get_write_value(const Tango::DevDouble *&ptr) {ptr = double_ptr;} /** * Retrieve the new value for writable attribute when attribute data type is * Tango::DevString. * * @param val A reference to a Tango::DevString data which will be initialised * with the new value */ void get_write_value(Tango::DevString &val) {val = str_val;} /** * Retrieve the new value for writable attribute when attribute data type is * Tango::DevString and the attribute is SPECTRUM or IMAGE. * * @param ptr Reference to a pointer which will be set to point to the data * to be written into the attribute. This pointer points into attribute * internal memory which must not be freed. */ void get_write_value(const Tango::ConstDevString *&ptr) {ptr = str_ptr;} /** * Retrieve the new value for writable attribute when attribute data type is * Tango::DevBoolean. * * @param val A reference to a Tango::DevBoolean data which will be initialised * with the new value */ void get_write_value(Tango::DevBoolean &val) {val = boolean_val;} /** * Retrieve the new value for writable attribute when attribute data type is * Tango::DevBoolean and the attribute is SPECTRUM or IMAGE. * * @param ptr Reference to a pointer which will be set to point to the data * to be written into the attribute. This pointer points into attribute * internal memory which must not be freed. */ void get_write_value(const Tango::DevBoolean *&ptr) {ptr = boolean_ptr;} /** * Retrieve the new value for writable attribute when attribute data type is * Tango::DevUShort. * * @param val A reference to a Tango::DevUShort data which will be initialised * with the new value */ void get_write_value(Tango::DevUShort &val) {val = ushort_val;} /** * Retrieve the new value for writable attribute when attribute data type is * Tango::DevUShort and the attribute is SPECTRUM or IMAGE. * * @param ptr Reference to a pointer which will be set to point to the data * to be written into the attribute. This pointer points into attribute * internal memory which must not be freed. */ void get_write_value(const Tango::DevUShort *&ptr) {ptr = ushort_ptr;} /** * Retrieve the new value for writable attribute when attribute data type is * Tango::DevUChar. * * @param val A reference to a Tango::DevUChar data which will be initialised * with the new value */ void get_write_value(Tango::DevUChar &val) {val = uchar_val;} /** * Retrieve the new value for writable attribute when attribute data type is * Tango::DevUChar and the attribute is SPECTRUM or IMAGE. * * @param ptr Reference to a pointer which will be set to point to the data * to be written into the attribute. This pointer points into attribute * internal memory which must not be freed. */ void get_write_value(const Tango::DevUChar *&ptr) {ptr = uchar_ptr;} /** * Retrieve the new value for writable attribute when attribute data type is * Tango::DevULong. * * @param val A reference to a Tango::DevULong data which will be initialised * with the new value */ void get_write_value(Tango::DevULong &val) {val = w_ext->ulong_val;} /** * Retrieve the new value for writable attribute when attribute data type is * Tango::DevULong and the attribute is SPECTRUM or IMAGE. * * @param ptr Reference to a pointer which will be set to point to the data * to be written into the attribute. This pointer points into attribute * internal memory which must not be freed. */ void get_write_value(const Tango::DevULong *&ptr) {ptr = w_ext->ulong_ptr;} /** * Retrieve the new value for writable attribute when attribute data type is * Tango::DevULong64. * * @param val A reference to a Tango::DevULong64 data which will be initialised * with the new value */ void get_write_value(Tango::DevULong64 &val) {val = w_ext->ulong64_val;} /** * Retrieve the new value for writable attribute when attribute data type is * Tango::DevLong64 and the attribute is SPECTRUM or IMAGE. * * @param ptr Reference to a pointer which will be set to point to the data * to be written into the attribute. This pointer points into attribute * internal memory which must not be freed. */ void get_write_value(const Tango::DevULong64 *&ptr) {ptr = w_ext->ulong64_ptr;} /** * Retrieve the new value for writable attribute when attribute data type is * Tango::DevState. * * @param val A reference to a Tango::DevState data which will be initialised * with the new value */ void get_write_value(Tango::DevState &val) {val = w_ext->dev_state_val;} /** * Retrieve the new value for writable attribute when attribute data type is * Tango::DevLong64 and the attribute is SPECTRUM or IMAGE. * * @param ptr Reference to a pointer which will be set to point to the data * to be written into the attribute. This pointer points into attribute * internal memory which must not be freed. */ void get_write_value(const Tango::DevState *&ptr) {ptr = w_ext->state_ptr;} /** * Retrieve the new value for writable attribute when attribute data type is * Tango::DevEncoded. * * @param val A reference to a Tango::DevEncoded data which will be initialised * with the new value */ void get_write_value(Tango::DevEncoded &val) {val = encoded_val;} /** * Retrieve the new value for writable attribute when attribute data type is * Tango::DevEncoded and the attribute is SPECTRUM or IMAGE. * * @param ptr Reference to a pointer which will be set to point to the data * to be written into the attribute. This pointer points into attribute * internal memory which must not be freed. */ void get_write_value(const Tango::DevEncoded *&ptr) {ptr = encoded_ptr;} //@} /**@name Set new value for attribute * Miscellaneous method to set a WAttribute value */ //@{ /** * Set the writable scalar attribute value when the attribute data type is * Tango::DevShort. * * @param val A reference to a Tango::DevShort data */ void set_write_value(Tango::DevShort val); /** * Set the writable spectrum or image attribute value when the attribute * data type is Tango::DevShort. * * @param val A reference to the attribute set value * @param x The attribute set value x length. Default value is 1 * @param y The attribute set value y length. Default value is 0 */ void set_write_value(Tango::DevShort *val, long x = 1, long y = 0); /** * Set the writable spectrum or image attribute value when the attribute * data type is Tango::DevShort. * * @param val A vector containing the attribute set value * @param x The attribute set value x length. Default value is 1 * @param y The attribute set value y length. Default value is 0 */ void set_write_value(vector &val, long x = 1, long y = 0); /** * Set the writable scalar attribute value when the attribute data type is * Tango::DevLong. * * @param val A reference to a Tango::DevLong data */ void set_write_value(Tango::DevLong val); /** * Set the writable spectrum or image attribute value when the attribute * data type is Tango::DevLong. * * @param val A reference to the attribute set value * @param x The attribute set value x length. Default value is 1 * @param y The attribute set value y length. Default value is 0 */ void set_write_value(Tango::DevLong *val, long x = 1, long y = 0); /** * Set the writable spectrum or image attribute value when the attribute * data type is Tango::DevLong. * * @param val A vector containing the attribute set value * @param x The attribute set value x length. Default value is 1 * @param y The attribute set value y length. Default value is 0 */ void set_write_value(vector &val, long x = 1, long y = 0); /** * Set the writable scalar attribute value when the attribute data type is * Tango::DevLong64. * * @param val A reference to a Tango::DevLong64 data */ void set_write_value(Tango::DevLong64 val); /** * Set the writable spectrum or image attribute value when the attribute * data type is Tango::DevLong64. * * @param val A reference to the attribute set value * @param x The attribute set value x length. Default value is 1 * @param y The attribute set value y length. Default value is 0 */ void set_write_value(Tango::DevLong64 *val, long x = 1, long y = 0); /** * Set the writable spectrum or image attribute value when the attribute * data type is Tango::DevLong64. * * @param val A vector containing the attribute set value * @param x The attribute set value x length. Default value is 1 * @param y The attribute set value y length. Default value is 0 */ void set_write_value(vector &val, long x = 1, long y = 0); /** * Set the writable scalar attribute value when the attribute data type is * Tango::DevDouble. * * @param val A reference to a Tango::DevDouble */ void set_write_value(Tango::DevDouble val); /** * Set the writable spectrum or image attribute value when the attribute * data type is Tango::DevDouble. * * @param val A reference to the attribute set value * @param x The attribute set value x length. Default value is 1 * @param y The attribute set value y length. Default value is 0 */ void set_write_value(Tango::DevDouble *val, long x = 1, long y = 0); /** * Set the writable spectrum or image attribute value when the attribute * data type is Tango::DevDouble. * * @param val A vector containing the attribute set value * @param x The attribute set value x length. Default value is 1 * @param y The attribute set value y length. Default value is 0 */ void set_write_value(vector &val, long x = 1, long y = 0); /** * Set the writable scalar attribute value when the attribute data type is * Tango::DevString. * * @param val A reference to a Tango::DevString */ void set_write_value(Tango::DevString val); /** * Set the writable scalar attribute value when the attribute data type is * Tango::DevString. * * @param val A reference to a std::string */ void set_write_value(string &val); /** * Set the writable spectrum or image attribute value when the attribute * data type is Tango::DevString. * * @param val A reference to the attribute set value * @param x The attribute set value x length. Default value is 1 * @param y The attribute set value y length. Default value is 0 */ void set_write_value(Tango::DevString *val, long x = 1, long y = 0); /** * Set the writable spectrum or image attribute value when the attribute * data type is Tango::DevString. * * @param val A vector of string containing the attribute set value * @param x The attribute set value x length. Default value is 1 * @param y The attribute set value y length. Default value is 0 */ void set_write_value(vector &val, long x = 1, long y = 0); /** * Set the writable scalar attribute value when the attribute data type is * Tango::DevFloat. * * @param val A reference to a Tango::DevFloat */ void set_write_value(Tango::DevFloat val); /** * Set the writable spectrum or image attribute value when the attribute * data type is Tango::DevFloat. * * @param val A reference to the attribute set value * @param x The attribute set value x length. Default value is 1 * @param y The attribute set value y length. Default value is 0 */ void set_write_value(Tango::DevFloat *val, long x = 1, long y = 0); /** * Set the writable spectrum or image attribute value when the attribute * data type is Tango::DevFloat. * * @param val A vector containing the attribute set value * @param x The attribute set value x length. Default value is 1 * @param y The attribute set value y length. Default value is 0 */ void set_write_value(vector &val, long x = 1, long y = 0); /** * Set the writable scalar attribute value when the attribute data type is * Tango::DevBoolean. * * @param val A reference to a Tango::DevBoolean */ void set_write_value(Tango::DevBoolean val); /** * Set the writable spectrum or image attribute value when the attribute * data type is Tango::DevBoolean. * * @param val A reference to the attribute set value * @param x The attribute set value x length. Default value is 1 * @param y The attribute set value y length. Default value is 0 */ void set_write_value(Tango::DevBoolean *val, long x = 1, long y = 0); /** * Set the writable spectrum or image attribute value when the attribute * data type is Tango::DevBoolean. * * @param val A vector containing the attribute set value * @param x The attribute set value x length. Default value is 1 * @param y The attribute set value y length. Default value is 0 */ void set_write_value(vector &val, long x = 1, long y = 0); /** * Set the writable scalar attribute value when the attribute data type is * Tango::DevUShort. * * @param val A reference to a Tango::DevUShort */ void set_write_value(Tango::DevUShort val); /** * Set the writable spectrum or image attribute value when the attribute * data type is Tango::DevUShort. * * @param val A reference to the attribute set value * @param x The attribute set value x length. Default value is 1 * @param y The attribute set value y length. Default value is 0 */ void set_write_value(Tango::DevUShort *val, long x = 1, long y = 0); /** * Set the writable spectrum or image attribute value when the attribute * data type is Tango::DevUShort. * * @param val A vector containing the attribute set value * @param x The attribute set value x length. Default value is 1 * @param y The attribute set value y length. Default value is 0 */ void set_write_value(vector &val, long x = 1, long y = 0); /** * Set the writable scalar attribute value when the attribute data type is * Tango::DevUChar. * * @param val A reference to a Tango::DevUChar */ void set_write_value(Tango::DevUChar val); /** * Set the writable spectrum or image attribute value when the attribute * data type is Tango::DevUChar. * * @param val A reference to the attribute set value * @param x The attribute set value x length. Default value is 1 * @param y The attribute set value y length. Default value is 0 */ void set_write_value(Tango::DevUChar *val, long x = 1, long y = 0); /** * Set the writable spectrum or image attribute value when the attribute * data type is Tango::DevUChar. * * @param val A vector containing the attribute set value * @param x The attribute set value x length. Default value is 1 * @param y The attribute set value y length. Default value is 0 */ void set_write_value(vector &val, long x = 1, long y = 0); /** * Set the writable scalar attribute value when the attribute data type is * Tango::DevULong. * * @param val A reference to a Tango::DevULong data */ void set_write_value(Tango::DevULong val); /** * Set the writable spectrum or image attribute value when the attribute * data type is Tango::DevULong. * * @param val A reference to the attribute set value * @param x The attribute set value x length. Default value is 1 * @param y The attribute set value y length. Default value is 0 */ void set_write_value(Tango::DevULong *val, long x = 1, long y = 0); /** * Set the writable spectrum or image attribute value when the attribute * data type is Tango::DevULong. * * @param val A vector containing the attribute set value * @param x The attribute set value x length. Default value is 1 * @param y The attribute set value y length. Default value is 0 */ void set_write_value(vector &val, long x = 1, long y = 0); /** * Set the writable scalar attribute value when the attribute data type is * Tango::DevULong64. * * @param val A reference to a Tango::DevULong64 data */ void set_write_value(Tango::DevULong64 val); /** * Set the writable spectrum or image attribute value when the attribute * data type is Tango::DevULong64. * * @param val A reference to the attribute set value * @param x The attribute set value x length. Default value is 1 * @param y The attribute set value y length. Default value is 0 */ void set_write_value(Tango::DevULong64 *val, long x = 1, long y = 0); /** * Set the writable spectrum or image attribute value when the attribute * data type is Tango::DevULong64. * * @param val A vector containing the attribute set value * @param x The attribute set value x length. Default value is 1 * @param y The attribute set value y length. Default value is 0 */ void set_write_value(vector &val, long x = 1, long y = 0); /** * Set the writable scalar attribute value when the attribute data type is * Tango::DevState. * * @param val A reference to a Tango::DevState data */ void set_write_value(Tango::DevState val); /** * Set the writable spectrum or image attribute value when the attribute * data type is Tango::DevState. * * @param val A reference to the attribute set value * @param x The attribute set value x length. Default value is 1 * @param y The attribute set value y length. Default value is 0 */ void set_write_value(Tango::DevState *val, long x = 1, long y = 0); /** * Set the writable spectrum or image attribute value when the attribute * data type is Tango::DevState. * * @param val A vector containing the attribute set value * @param x The attribute set value x length. Default value is 1 * @param y The attribute set value y length. Default value is 0 */ void set_write_value(vector &val, long x = 1, long y = 0); //@} /// @privatesection void set_write_value(Tango::DevEncoded *, long x = 1,long y = 0); // Dummy method for compiler virtual void set_rvalue(); void rollback(); void check_written_value(const CORBA::Any &,unsigned long,unsigned long); void check_written_value(const DevVarEncodedArray &,unsigned long,unsigned long); void check_written_value(const AttrValUnion &,unsigned long,unsigned long); void copy_data(const CORBA::Any &); void copy_data(const Tango::AttrValUnion &); long get_w_dim_x() {return w_dim_x;} long get_w_dim_y() {return w_dim_y;} void set_user_set_write_value(bool val) {w_ext->uswv = val;} bool get_user_set_write_value() {return w_ext->uswv;} Tango::DevVarShortArray *get_last_written_sh() {return &short_array_val;} Tango::DevVarLongArray *get_last_written_lg() {return &long_array_val;} Tango::DevVarDoubleArray *get_last_written_db() {return &double_array_val;} Tango::DevVarStringArray *get_last_written_str() {return &str_array_val;} Tango::DevVarFloatArray *get_last_written_fl() {return &float_array_val;} Tango::DevVarBooleanArray *get_last_written_boo() {return &boolean_array_val;} Tango::DevVarUShortArray *get_last_written_ush() {return &ushort_array_val;} Tango::DevVarCharArray *get_last_written_uch() {return &uchar_array_val;} Tango::DevVarLong64Array *get_last_written_lg64() {return &w_ext->long64_array_val;} Tango::DevVarULong64Array *get_last_written_ulg64() {return &w_ext->ulong64_array_val;} Tango::DevVarULongArray *get_last_written_ulg() {return &w_ext->ulong_array_val;} Tango::DevVarStateArray *get_last_written_state() {return &w_ext->state_array_val;} Tango::DevEncoded &get_last_written_encoded() {return encoded_val;} bool is_memorized() {return memorized;} void set_memorized(bool mem) {memorized = mem;} bool is_memorized_init() {return memorized_init;} void set_memorized_init(bool mem_init) {memorized_init = mem_init;} string &get_mem_value() {return mem_value;} void set_mem_value(const string &new_val) {mem_value = new_val;} void set_written_date(); bool mem_value_below_above(MinMaxValueCheck,string &); void set_mem_exception(const DevErrorList &df) { w_ext->mem_exception = df; w_ext->mem_write_failed = true; ext->mem_exception = true; } DevErrorList &get_mem_exception() {return w_ext->mem_exception;} void clear_mem_exception() { w_ext->mem_exception.length(0); w_ext->mem_write_failed = false; ext->mem_exception = false; } void set_mem_write_failed(bool bo) {w_ext->mem_write_failed=bo;} bool get_mem_write_failed() {return w_ext->mem_write_failed;} protected: /// @privatesection virtual bool check_rds_alarm(); private: // // The extension class // class WAttributeExt { public: WAttributeExt():long64_ptr(NULL),ulong_ptr(NULL), ulong64_ptr(NULL),state_ptr(NULL), uswv(false),mem_write_failed(false) {} Tango::DevLong64 long64_val; Tango::DevLong64 old_long64_val; Tango::DevULong ulong_val; Tango::DevULong old_ulong_val; Tango::DevULong64 ulong64_val; Tango::DevULong64 old_ulong64_val; Tango::DevState dev_state_val; Tango::DevState old_dev_state_val; Tango::DevVarLong64Array long64_array_val; Tango::DevVarULongArray ulong_array_val; Tango::DevVarULong64Array ulong64_array_val; Tango::DevVarStateArray state_array_val; const Tango::DevLong64 *long64_ptr; const Tango::DevULong *ulong_ptr; const Tango::DevULong64 *ulong64_ptr; const Tango::DevState *state_ptr; bool uswv; // User set_write_value DevErrorList mem_exception; // Exception received at start-up in case writing the // memorized att. failed bool mem_write_failed; // Flag set to true if the memorized att setting failed }; // Defined prior to Tango IDL release 3 Tango::DevShort short_val; Tango::DevShort old_short_val; Tango::DevLong long_val; Tango::DevLong old_long_val; Tango::DevDouble double_val; Tango::DevDouble old_double_val; Tango::DevString str_val; Tango::DevString old_str_val; Tango::DevFloat float_val; Tango::DevFloat old_float_val; Tango::DevBoolean boolean_val; Tango::DevBoolean old_boolean_val; Tango::DevUShort ushort_val; Tango::DevUShort old_ushort_val; Tango::DevUChar uchar_val; Tango::DevUChar old_uchar_val; Tango::DevEncoded encoded_val; Tango::DevEncoded old_encoded_val; // Added for Tango IDL release 3 long w_dim_y; long w_dim_x; Tango::DevVarShortArray short_array_val; Tango::DevVarLongArray long_array_val; Tango::DevVarDoubleArray double_array_val; Tango::DevVarStringArray str_array_val; Tango::DevVarFloatArray float_array_val; Tango::DevVarBooleanArray boolean_array_val; Tango::DevVarUShortArray ushort_array_val; Tango::DevVarCharArray uchar_array_val; const Tango::DevShort *short_ptr; const Tango::DevLong *long_ptr; const Tango::DevDouble *double_ptr; const Tango::ConstDevString *str_ptr; const Tango::DevFloat *float_ptr; const Tango::DevBoolean *boolean_ptr; const Tango::DevUShort *ushort_ptr; const Tango::DevUChar *uchar_ptr; const Tango::DevEncoded *encoded_ptr; bool string_allocated; bool memorized; bool memorized_init; string mem_value; struct timeval write_date; #ifdef HAS_UNIQUE_PTR unique_ptr w_ext; // Class extension #else WAttributeExt *w_ext; #endif }; #define COMPUTE_TIME_DIFF(RESULT,BEFORE,AFTER) \ long bef = ((BEFORE.tv_sec - 1095000000) * 1000) + (BEFORE.tv_usec / 1000); \ long after = ((AFTER.tv_sec - 1095000000) * 1000) + (AFTER.tv_usec / 1000); \ RESULT = after - bef; } // End of Tango namespace #endif // _WATTRIBUTE_H tango-8.1.2c+dfsg.orig/lib/cpp/server/coutappender.h0000644000175000017500000000303612205375142021276 0ustar piccapicca/* * Copyright (C) : 2004,2005,2006,2007,2008,2009,2010,2011,2012,2013 * European Synchrotron Radiation Facility * BP 220, Grenoble 38043 * FRANCE * * This file is part of Tango. * * Tango 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. * * Tango 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 Tango. If not, see . * * coutappender.h * * by NL - SOLEIL - 01/2003. * * $Revision: 22213 $ * */ #ifndef _COUT_APPENDER_H_ #define _COUT_APPENDER_H_ #if defined(TANGO_HAS_LOG4TANGO) namespace Tango { class CoutAppender : public log4tango::LayoutAppender { public: /** * **/ CoutAppender (const std::string& name); /** * **/ virtual ~CoutAppender (); /** * **/ inline virtual bool reopen() { return true; } /** * **/ inline virtual void close() { //no-op } protected: /** * **/ virtual int _append (const log4tango::LoggingEvent& event); }; } // namespace tango #endif // _COUT_APPENDER_H_ #endif // TANGO_HAS_LOG4TANGO tango-8.1.2c+dfsg.orig/lib/cpp/server/pollcmds.h0000644000175000017500000001363012205375142020423 0ustar piccapicca//============================================================================= // // file : PollCmds.h // // description : Include for the DServerClass class. This class is a // singleton class i.e only one object of this class // can be created. // It contains all properties and methods // which the DServer requires only once e.g. the // commands. // This file also includes class declaration for all the // commands available on device of the DServer class // // project : TANGO // // author(s) : E.Taurel // // Copyright (C) : 2004,2005,2006,2007,2008,2009,2010,2011,2012,2013 // European Synchrotron Radiation Facility // BP 220, Grenoble 38043 // FRANCE // // This file is part of Tango. // // Tango 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. // // Tango 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 Tango. If not, see . // // $Revision: 22213 $ // // //============================================================================= #ifndef _POLLCMDS_H #define _POLLCMDS_H #include namespace Tango { //============================================================================= // // The PolledDevice class // // description : Class to implement the PolledDevice command. // This class returns the name list of device actually // polled // //============================================================================= class PolledDeviceCmd : public Command { public: PolledDeviceCmd(const char *cmd_name, Tango::CmdArgType in, Tango::CmdArgType out, const char *desc); ~PolledDeviceCmd() {}; virtual CORBA::Any *execute(DeviceImpl *device, const CORBA::Any &in_any); }; //============================================================================= // // The DevPollStatus class // // description : Class to implement the DevPollStatus command. // This class returns status of all commands and/or // attribute polled for a device // //============================================================================= class DevPollStatusCmd : public Command { public: DevPollStatusCmd(const char *cmd_name, Tango::CmdArgType in, Tango::CmdArgType out, const char *in_desc, const char *out_desc); ~DevPollStatusCmd() {}; virtual CORBA::Any *execute(DeviceImpl *device, const CORBA::Any &in_any); }; //============================================================================= // // The AddObjPolling class // // description : Class to implement the AddObjPolling command. // This command add a new command/attribute in the list // of command/attribute to be polled // //============================================================================= class AddObjPollingCmd : public Command { public: AddObjPollingCmd(const char *cmd_name, Tango::CmdArgType in, Tango::CmdArgType out, string &in_desc); ~AddObjPollingCmd() {}; virtual CORBA::Any *execute(DeviceImpl *device, const CORBA::Any &in_any); }; //============================================================================= // // The UpdObjPollingPeriod class // // description : Class to implement the UpdObjPollingPeriod command. // This command updates an object update period // //============================================================================= class UpdObjPollingPeriodCmd : public Command { public: UpdObjPollingPeriodCmd(const char *cmd_name, Tango::CmdArgType in, Tango::CmdArgType out, string &in_desc); ~UpdObjPollingPeriodCmd() {}; virtual CORBA::Any *execute(DeviceImpl *device, const CORBA::Any &in_any); }; //============================================================================= // // The RemObjPolling class // // description : Class to implement the RemObjPolling command. // This command removes one object of the device polling // list // //============================================================================= class RemObjPollingCmd : public Command { public: RemObjPollingCmd(const char *cmd_name, Tango::CmdArgType in, Tango::CmdArgType out, string &in_desc); ~RemObjPollingCmd() {}; virtual CORBA::Any *execute(DeviceImpl *device, const CORBA::Any &in_any); }; //============================================================================= // // The StopPolling class // // description : Class to implement the StopPolling command. // This command stops the polling thread // //============================================================================= class StopPollingCmd : public Command { public: StopPollingCmd(const char *cmd_name, Tango::CmdArgType in, Tango::CmdArgType out); ~StopPollingCmd() {}; virtual CORBA::Any *execute(DeviceImpl *device, const CORBA::Any &in_any); }; //============================================================================= // // The StartPolling class // // description : Class to implement the StartPolling command. // This command starts the polling thread // //============================================================================= class StartPollingCmd : public Command { public: StartPollingCmd(const char *cmd_name, Tango::CmdArgType in, Tango::CmdArgType out); ~StartPollingCmd() {}; virtual CORBA::Any *execute(DeviceImpl *device, const CORBA::Any &in_any); }; } // End of Tango namespace #endif // _POLLCMDS_H tango-8.1.2c+dfsg.orig/lib/cpp/server/device_3.h0000644000175000017500000002724012205375142020271 0ustar piccapicca//============================================================================= // // file : Device.h // // description : Include for the Device root classes. // Three classes are declared in this file : // The Device class // The DeviceClass class // // project : TANGO // // author(s) : A.Gotz + E.Taurel // // Copyright (C) : 2004,2005,2006,2007,2008,2009,2010,2011,2012,2013 // European Synchrotron Radiation Facility // BP 220, Grenoble 38043 // FRANCE // // This file is part of Tango. // // Tango 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. // // Tango 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 Tango. If not, see . // // $Revision: 18607 // //============================================================================= #ifndef _DEVICE_3_H #define _DEVICE_3_H #include namespace Tango { class DeviceClass; class AttributeValueList_4; //============================================================================= // // The Device_3Impl class // // // description : This class is derived directly from the Tango::Device_skel // class generated by CORBA. It represents the CORBA // servant which will be accessed by the client. // It implements all the methods // and attributes defined in the IDL interface for Device. // //============================================================================= struct AttIdx { long idx_in_names; long idx_in_multi_attr; bool failed; }; /** * Base class for all TANGO device since version 3. * * This class inherits from DeviceImpl class which itself inherits from * CORBA classes where all the network layer is implemented. * This class has been created since release 3 of Tango library where the IDL * Tango module has been modified in order to create a Device_3 interface * which inherits from the original Device interface * * $Author: taurel $ * $Revision: 22460 $ * * @headerfile tango.h * @ingroup Server */ class Device_3Impl : public virtual POA_Tango::Device_3, public Device_2Impl { public: /**@name Constructors * Miscellaneous constructors */ //@{ /** * Constructs a newly allocated Device_3Impl object from its name. * * The device description field is set to A Tango device. The device * state is set to unknown and the device status is set to * Not Initialised * * @param device_class Pointer to the device class object * @param dev_name The device name * */ Device_3Impl(DeviceClass *device_class,string &dev_name); /** * Constructs a newly allocated Device_3Impl object from its name and its description. * * The device * state is set to unknown and the device status is set to * Not Initialised * * @param device_class Pointer to the device class object * @param dev_name The device name * @param desc The device description * */ Device_3Impl(DeviceClass *device_class,string &dev_name,string &desc); /** * Constructs a newly allocated Device_3Impl object from all its creation * parameters. * * The device is constructed from its name, its description, an original state * and status * * @param device_class Pointer to the device class object * @param dev_name The device name * @param desc The device description * @param dev_state The device initial state * @param dev_status The device initial status * */ Device_3Impl(DeviceClass *device_class, string &dev_name,string &desc, Tango::DevState dev_state,string &dev_status); /** * Constructs a newly allocated Device_3Impl object from all its creation * parameters with some default values. * * The device is constructed from its name, its description, an original state * and status. This constructor defined default values for the description, * state and status parameters. The default device description is A TANGO device. * The default device state is UNKNOWN and the default device status * is Not initialised. * * @param device_class Pointer to the device class object * @param dev_name The device name * @param desc The device desc * @param dev_state The device initial state * @param dev_status The device initial status * */ Device_3Impl(DeviceClass *device_class, const char *dev_name,const char *desc = "A TANGO device", Tango::DevState dev_state = Tango::UNKNOWN, const char *dev_status = StatusNotSet); //@} /**@name Destructor * Only one desctructor is defined for this class */ //@{ /** * The device desctructor. */ #ifdef HAS_UNIQUE_PTR virtual ~Device_3Impl() {} #else virtual ~Device_3Impl() {delete ext_3;} #endif //@} /**@name CORBA operation methods * Method defined to implement TANGO device CORBA operation */ //@{ /** * Read attribute(s) value. * * Invoked when the client request the read_attributes_2 CORBA operation. * It returns to the client one AttributeValue structure for each wanted * attribute. * * @param names The attribute(s) name list * @param source The data source. This parameter is new in Tango release 2. It * allows a client to choose the data source between the device itself or the * data cache for polled attribute. * @return A sequence of AttributeValue structure. One structure is initialised * for each wanted attribute with the attribute value, the date and the attribute * value quality. Click here * to read AttributeValue_3 structure definition. * @exception DevFailed Thrown if the attribute does not exist. * Click here to read * DevFailed exception specification */ virtual Tango::AttributeValueList_3 *read_attributes_3(const Tango::DevVarStringArray& names, Tango::DevSource source); /** * Write attribute(s) value. * * Invoked when the client request the write_attributes CORBA operation. * It sets the attribute(s) with the new value(s) passed as parameter. * * @param values The attribute(s) new value(s). One structure is initialised * for each wanted attribute with the attribute value. The attribute quality and * date are not used by this method. * Click here * to read AttributeValue structure definition. * @exception DevFailed Thrown if the command does not exist. * Click here to read * DevFailed exception specification */ virtual void write_attributes_3(const Tango::AttributeValueList& values); /** * Read attribute value history. * * Invoked when the client request the read_attribute_history_3 CORBA operation. * This operation allows a client to retrieve attribute value history for * polled attribute. The depth of the history is limited to the depth of * the device server internal polling buffer. * It returns to the client one DevAttrHistory structure for each record. * * @param name The attribute name * @param n The record number. * @return A sequence of DevAttrHistory structure. One structure is initialised * for each record with the attribute value, the date and in case of the attribute * returns an error when it was read, the DevErrors data. * Click here * to read DevAttrHistory_3 structure definition. * @exception DevFailed Thrown if the attribute does not exist or is not polled. * Click here to read * DevFailed exception specification */ virtual Tango::DevAttrHistoryList_3 *read_attribute_history_3(const char* name, CORBA::Long n); /** * Get device info. * * Invoked when the client request the info CORBA operation. * It updates the black box and returns a DevInfo object * with miscellaneous device info * * @return A DevInfo object */ virtual Tango::DevInfo_3 *info_3(); /** * Get attribute(s) configuration. * * Invoked when the client request the get_attribute_config_3 CORBA operation. * It returns to the client one AttributeConfig_3 structure for each wanted * attribute. All the attribute properties value are returned in this * AttributeConfig_3 structure. Since Tango release 3, the attribute event * related, the attribute warning alarm and attribute rds alarm properties * have been added to the returned structures. * * @param names The attribute(s) name list * @return A sequence of AttributeConfig_3 structure. One structure is initialised * for each wanted attribute. Click here * to read AttributeConfig_3 structure specification. * * @exception DevFailed Thrown if the attribute does not exist. * Click here to read * DevFailed exception specification */ virtual Tango::AttributeConfigList_3 *get_attribute_config_3(const Tango::DevVarStringArray& names); /** * Set attribute(s) configuration. * * Invoked when the client request the set_attribute_config_3 CORBA operation. * It updates the device attribute configuration actually used by the device but * this method also updates the Tango database. One structure of the * AttributeConfig_3 type is needed for each attribute to update configuration. * Click here * to read AttributeConfig_3 structure specification. * * @param new_conf The attribute(s) new configuration structure sequence * @exception DevFailed Thrown if the command does not exist. * Click here to read * DevFailed exception specification */ virtual void set_attribute_config_3(const Tango::AttributeConfigList_3& new_conf); //@} /// @privatesection void write_attributes_in_db(vector &,vector &); void add_state_status_attrs(); void read_attributes_from_cache(const Tango::DevVarStringArray&,Tango::AttributeValueList_3 *&,Tango::AttributeValueList_4 *&); void delete_dev() {ext_3->delete_dev();} void get_attr_props(const char *,vector &); protected: /// @privatesection void read_attributes_no_except(const Tango::DevVarStringArray&,Tango::AttributeValueList_3 *&,Tango::AttributeValueList_4 *&,bool,vector &); void write_attributes_in_db(vector &,vector &); void add_alarmed(vector &); long reading_state_necessary(vector &); void state2attr(Tango::DevState,Tango::AttributeValue_3 &); void state2attr(Tango::DevState,Tango::AttributeValue_4 &); void status2attr(Tango::ConstDevString,Tango::AttributeValue_3 &); void status2attr(Tango::ConstDevString,Tango::AttributeValue_4 &); void alarmed_not_read(vector &); void write_attributes_34(const Tango::AttributeValueList *,const Tango::AttributeValueList_4 *); private: class Device_3ImplExt { public: Device_3ImplExt() {} virtual ~Device_3ImplExt() {} virtual void delete_dev() {} }; void real_ctor(); #ifdef HAS_UNIQUE_PTR unique_ptr ext_3; // Class extension #else Device_3ImplExt *ext_3; #endif }; } // End of Tango namespace #endif // _DEVICE_H tango-8.1.2c+dfsg.orig/lib/cpp/server/classattribute.cpp0000644000175000017500000002550412205375142022175 0ustar piccapicca static const char *RcsId = "$Id: classattribute.cpp 22213 2013-03-07 14:32:56Z taurel $\n$Name$"; //+============================================================================ // // file : ClassAttribute.cpp // // description : C++ source code for the // AttrProperty // ClassAttribute and // MultiClassAttribute // classes. These classes // are used to manage attribute properties defined at the // class level. A Tango DeviceClass class instance has one // MultiClassAttribute object which is an aggregate of // ClassAttribute objects // // project : TANGO // // author(s) : E.Taurel // // Copyright (C) : 2004,2005,2006,2007,2008,2009,2010,2011,2012,2013 // European Synchrotron Radiation Facility // BP 220, Grenoble 38043 // FRANCE // // This file is part of Tango. // // Tango 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. // // Tango 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 Tango. If not, see . // // $Revision: 22213 $ // //-============================================================================ #if HAVE_CONFIG_H #include #endif #include #include #include namespace Tango { //+------------------------------------------------------------------------- // // method : AttrProperty::AttrProperty // // description : Constructors for the AttrProperty class. // These constructor change the property name to // lowercase letters and also change the property // value to lowercase letters for the data_format and // data_type property // // argument : in : - name : The property name // - value : The property value // //-------------------------------------------------------------------------- AttrProperty::AttrProperty(string &name,string &value):attr_name(name), attr_value(value) { attr_lg = 0; // // Property name in lower case letters // transform(attr_name.begin(),attr_name.end(),attr_name.begin(),::tolower); // // For data_type or data_format properties, also change property value to // lowercase letters // if ((attr_name == "data_type") || (attr_name == "data_format")) { transform(attr_value.begin(),attr_value.end(), attr_value.begin(),::tolower); } } AttrProperty::AttrProperty(const char *name,const char *value):attr_name(name), attr_value(value) { attr_lg = 0; // // Property name in lower case letters // transform(attr_name.begin(),attr_name.end(),attr_name.begin(),::tolower); // // For data_type or data_format properties, also change property value to // lowercase letters // if ((attr_name == "data_type") || (attr_name == "data_format")) { transform(attr_value.begin(),attr_value.end(), attr_value.begin(),::tolower); } } AttrProperty::AttrProperty(const char *name,long value):attr_name(name),attr_lg(value) { } AttrProperty::AttrProperty(const char *name,string &value):attr_name(name),attr_value(value),attr_lg(0) { } //+------------------------------------------------------------------------- // // method : AttrProperty::convert // // description : Convert the property value into a long. The long data // is also stored in the AttrProperty class // //-------------------------------------------------------------------------- void AttrProperty::convert() { TangoSys_MemStream o; o << attr_value; if (!(o >> attr_lg && o.eof())) { Except::throw_exception((const char *)API_AttrOptProp, (const char *)"Can't convert property value", (const char *)"AttrProperty::convert"); } } //+------------------------------------------------------------------------- // // operator overloading : << // // description : Friend function to ease printing instance of the // AttrProperty class // //-------------------------------------------------------------------------- #ifndef TANGO_HAS_LOG4TANGO ostream &operator<<(ostream &o_str,const AttrProperty &p) { o_str << "Property name = " << p.attr_name << ", Property value = " << p.attr_value; return o_str; } #endif // TANGO_HAS_LOG4TANGO //+------------------------------------------------------------------------- // // method : MultiClassAttribute::MultiClassAttribute // // description : constructor for the MultiClassAttribute class from the // device class name // //-------------------------------------------------------------------------- MultiClassAttribute::~MultiClassAttribute() { long nb_attr = attr_list.size(); for (int i = 0;i < nb_attr;i++) delete attr_list[i]; } //+------------------------------------------------------------------------- // // method : MultiClassAttribute::MultiClassAttribute // // description : constructor for the MultiClassAttribute class from the // device class name // //-------------------------------------------------------------------------- MultiClassAttribute::MultiClassAttribute() { cout4 << "Entering MultiClassAttribute constructor" << endl; } //+------------------------------------------------------------------------- // // method : MultiClassAttribute::init_class_attribute // // description : Ask the database for prperties defined at class // level and build the ClassAttribute object for // each attribute with defined properties // // argument : in : - class_name : The device class name // //-------------------------------------------------------------------------- void MultiClassAttribute::init_class_attribute(string &class_name,long base) { cout4 << "Entering MultiClassAttribute::init_class_attribute" << endl; long i; Tango::Util *tg = Tango::Util::instance(); CORBA::Any send; long nb_attr; if (base == 0) nb_attr = attr_list.size(); else nb_attr = 1; // // Get class attribute(s) properties stored in DB // No need to implement // a retry here (in case of db server restart) because the db reconnection // is forced by the get_property call executed during xxxClass construction // before we reach this code. // if ((nb_attr != 0) && (Tango::Util::_UseDb == true)) { Tango::DbData db_list; for(i = 0;i < nb_attr;i++) db_list.push_back(DbDatum(attr_list[i + base]->get_name())); try { tg->get_database()->get_class_attribute_property(class_name,db_list,tg->get_db_cache()); } catch (Tango::DevFailed &e) { TangoSys_OMemStream o; o << "Can't get class attribute properties for class " << class_name << ends; Except::re_throw_exception(e,(const char *)API_DatabaseAccess, o.str(), (const char *)"MultiClassAttribute::init_class_attribute"); } // // Sort property for each attribute and create a ClassAttribute object for each // of them // long ind = 0; for (i = 0;i < nb_attr;i++) { vector prop_list; string attr_name = db_list[ind].name; long nb_prop = 0; db_list[ind] >> nb_prop; ind++; for (long j = 0;j < nb_prop;j++) { if (db_list[ind].size() > 1) { string tmp(db_list[ind].value_string[0]); long nb = db_list[ind].size(); for (int k = 1;k < nb;k++) { tmp = tmp + " "; tmp = tmp + db_list[ind].value_string[k]; } prop_list.push_back(AttrProperty(db_list[ind].name,tmp)); } else prop_list.push_back(AttrProperty(db_list[ind].name,db_list[ind].value_string[0])); ind++; } if (nb_prop != 0) { // // Find this attribute in the attribute list // unsigned int k; for (k = 0;k < attr_list.size();k++) { if (attr_name == attr_list[k]->get_name()) break; } if (k == attr_list.size()) { TangoSys_OMemStream o; o << "Attribute " << attr_name << " not found in class attribute(s)" << ends; Except::throw_exception((const char *)API_AttrNotFound, o.str(), (const char *)"MultiClassAttribute::init_class_attribute"); } // // Add its class property list // attr_list[k]->set_class_properties(prop_list); } } } for (i = 0;i < nb_attr;i++) { cout4 << *(attr_list[i + base]) << endl; } cout4 << "Leaving MultiClassAttribute::init_class_attribute" << endl; } //+------------------------------------------------------------------------- // // method : MultiClassAttribute::get_attr // // description : Get the Attr object for the attribute with // name passed as parameter // // in : attr_name : The attribute name // // This method returns a reference to the ClassAttribute object or throw // an exceptionif the attribute is not found // //-------------------------------------------------------------------------- Attr &MultiClassAttribute::get_attr(string &attr_name) { // // Search for the wanted attribute in the attr_list vector from its name // vector::iterator pos; pos = find_if(attr_list.begin(),attr_list.end(), bind2nd(WantedClassAttr(),attr_name)); if (pos == attr_list.end()) { TangoSys_OMemStream o; o << "Attribute " << attr_name << " not found in class attribute(s)" << ends; Except::throw_exception((const char *)API_AttrOptProp,o.str(), (const char *)"MultiClassAttribute::get_attr"); } return *(*pos); } //+------------------------------------------------------------------------- // // method : MultiClassAttribute::remove_attr // // description : Remove the Attr object for the attribute with // name passed as parameter // // in : attr_name : The attribute name // cl_name : The attribute class name // //-------------------------------------------------------------------------- void MultiClassAttribute::remove_attr(string &attr_name,const string &cl_name) { vector::iterator ite; for (ite = attr_list.begin();ite != attr_list.end();++ite) { if (((*ite)->get_name() == attr_name) && ((*ite)->get_cl_name() == cl_name)) { attr_list.erase(ite); break; } } } //+------------------------------------------------------------------------- // // operator overloading : << // // description : Friend function to ease printing instance of the // Attr class. It prints all the attribute // property(ies) name and value defined in DB // //-------------------------------------------------------------------------- #ifndef TANGO_HAS_LOG4TANGO ostream &operator<<(ostream &o_str,const Attr &c) { long nb_prop = c.class_properties.size(); for (long i = 0;i < nb_prop;i++) { o_str << c.class_properties[i]; if (i <= (nb_prop - 2)) o_str << endl; } return o_str; } #endif // TANGO_HAS_LOG4TANGO } // End of Tango namespace tango-8.1.2c+dfsg.orig/lib/cpp/server/classattribute.h0000644000175000017500000001037512205375142021642 0ustar piccapicca//============================================================================= // // file : ClassAttribute.h // // description : Include file for the Tango attribute. // Three classes are declared in this file : // // AttrProperty : A helper class. This class stored a couple // property name, property value as strings // ClassAttribute : A class for each attribute with all // its properties defined at the class // level. The properties are still stored // as string // MultiClassAttribute : A class to manage all the class // level definition of attributes. // There is one instance of this class // for each tango device pattern // // project : TANGO // // author(s) : E.Taurel // // Copyright (C) : 2004,2005,2006,2007,2008,2009,2010,2011,2012,2013 // European Synchrotron Radiation Facility // BP 220, Grenoble 38043 // FRANCE // // This file is part of Tango. // // Tango 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. // // Tango 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 Tango. If not, see . // // $Revision: 22213 $ // //============================================================================= #ifndef _CLASS_ATTRIBUTE_H #define _CLASS_ATTRIBUTE_H #include //#include #include namespace Tango { //============================================================================= // // The AttrProperty class // // // description : This class is used to store a pair of attribute name, // attribute value. Both name and value are stored as // string // //============================================================================= class AttrProperty { public: AttrProperty(const char *name,const char *value); AttrProperty(string &name,string &value); AttrProperty(const char *name,long value); AttrProperty(const char *name,string &value); ~AttrProperty() {}; string &get_value() {return attr_value;} long get_lg_value() {return attr_lg;} string &get_name() {return attr_name;} void convert(); #ifndef TANGO_HAS_LOG4TANGO friend ostream &operator<<(ostream &,const AttrProperty &); #endif private: string attr_name; string attr_value; long attr_lg; }; //============================================================================= // // The MultiClassAttribute class // // // description : This class is a holder for all the ClassAttribute // instance. There is one instance of this class for each // Tango device pattern implementation. This instance is // stored in the DeviceClass object of the pattern // //============================================================================= class MultiClassAttribute { public: MultiClassAttribute(); ~MultiClassAttribute(); void init_class_attribute(string &class_name,long base = 0); vector &get_attr_list() {return attr_list;} Attr &get_attr(string &attr_name); void remove_attr(string &,const string &); protected: vector attr_list; }; //============================================================================= // // A binary function object // // // description : This binary function object is used by the find_if // std C++ find_if algorithm. It checks if the // ClassAttribute object passed as argument (A1) stored // all the properties for the atribute name passed as // second argument (A2). // This function object is a predicate and therefore // returns a boolean (R) // //============================================================================= template struct WantedClassAttr : public binary_function { R operator() (A1 att,A2 name_str) const { return att->get_name() == name_str; } }; } // End of Tango namespace #endif // _CLASS_ATTRIBUTE_H tango-8.1.2c+dfsg.orig/lib/cpp/server/devicelog.cpp0000644000175000017500000002300612205375142021100 0ustar piccapicca//+============================================================================= // // file : DeviceLog.cpp // // description : Logging oriented methods of the DeviceImpl class // // project : TANGO // // author(s) : N.Leclercq - SOLEIL // // Copyright (C) : 2004,2005,2006,2007,2008,2009,2010,2011,2012,2013 // European Synchrotron Radiation Facility // BP 220, Grenoble 38043 // FRANCE // // This file is part of Tango. // // Tango 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. // // Tango 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 Tango. If not, see . // // $Revision: 22213 $ // // $Log$ // Revision 3.14 2010/09/09 13:45:22 taurel // - Add year 2010 in Copyright notice // // Revision 3.13 2009/01/21 12:49:04 taurel // - Change CopyRights for 2009 // // Revision 3.12 2008/10/06 15:00:36 taurel // - Changed the licensing info from GPL to LGPL // // Revision 3.11 2008/10/03 06:51:36 taurel // - Add some licensing info in each files // // Revision 3.10 2008/03/11 14:38:25 taurel // - Apply patches from Frederic Picca about compilation with gcc 4.2 // // Revision 3.9 2007/10/26 11:30:35 taurel // - Set admin device logging level if command line -v > 4 // // Revision 3.8 2007/10/17 13:43:24 taurel // - Admin device default logging level set to OFF // // Revision 3.7 2006/03/27 17:00:46 jensmeyer // moved Makefile up // // Revision 3.6 2006/03/02 08:53:45 taurel // - Reset the changes made between 3.4 and 3.5 for VC7 because it makes library // logging messages invisible // // Revision 3.5 2006/02/17 16:54:11 jensmeyer // Corrections when porting to VC7 under windows // // Revision 3.4 2005/07/28 07:34:41 taurel // - Fix some incompatibility between 5.1 and 5.2 // // Revision 3.3 2005/07/04 15:33:30 nleclercq // Added command line logging level 5 for TANGO core debugging // // Revision 3.2 2005/02/25 13:28:51 nleclercq // Added logging support in 'const' methods // // Revision 3.1 2003/05/28 14:55:09 taurel // Add the include (conditionally) of the include files generated by autoconf // // Revision 3.0 2003/03/25 16:42:00 taurel // Many changes for Tango release 3.0 including // - Added full logging features // - Added asynchronous calls // - Host name of clients now stored in black-box // - Three serialization model in DS // - Fix miscellaneous bugs // - Ported to gcc 3.2 // - Added ApiUtil::cleanup() and destructor methods // - Some internal cleanups // - Change the way how TangoMonitor class is implemented. It's a recursive // mutex // // Revision 2.3 2003/03/13 15:17:50 nleclercq // Minor modifications on logging implementation // // Revision 2.2 2003/03/11 17:55:52 nleclercq // Switch from log4cpp to log4tango // // Revision 2.1 2003/02/17 14:57:40 taurel // Added the new Tango logging stuff (Thanks Nicolas from Soleil) // //-============================================================================= #if HAVE_CONFIG_H #include #endif #include #ifdef TANGO_HAS_LOG4TANGO #include namespace Tango { //+------------------------------------------------------------------------- // method : DeviceImpl::get_logger_i //-------------------------------------------------------------------------- log4tango::Logger* DeviceImpl::get_logger_i (void) { try { // trace cout4 << "Entering DeviceImpl::get_logger_i" << endl; // instanciate the logger ( // shame on me for a such huggly impl. but polymorphism // can't be used here ! if (ext->logger == 0) { if (device_class->get_name() == "DServer") { ext->logger = Logging::get_core_logger(); } else { // get device name std::string dev_name(device_name); // avoid case sensitive troubles std::transform(dev_name.begin(), dev_name.end(), dev_name.begin(), ::tolower); // instanciate the logger using device name ext->logger = new log4tango::Logger(dev_name); if (ext->logger == 0) { ext->logger = Logging::get_core_logger(); } // set default level ext->logger->set_level(log4tango::Level::WARN); // save current level ext->saved_log_level = log4tango::Level::WARN; } } // trace cout4 << "Leaving DeviceImpl::get_logger_i" << endl; } catch (...) { // save our souls... ext->logger = Logging::get_core_logger(); } return ext->logger; } //+------------------------------------------------------------------------- // method : DeviceImpl::init_logger //-------------------------------------------------------------------------- void DeviceImpl::init_logger (void) { try { // trace cout4 << "Entering DeviceImpl::init_logger" << endl; // get Tango::Util instance Tango::Util *tg = Tango::Util::instance(); // get cmd line logging level then ... int trace_level = tg->get_trace_level(); // ... convert it to log4tango level log4tango::Level::Value cmd_line_level = log4tango::Level::OFF; if (trace_level > 4) cmd_line_level = log4tango::Level::DEBUG; bool level_set_from_cmd_line = true; // are we initializing the dserver's logger log4tango::Logger* the_logger = get_logger(); if (the_logger != Logging::get_core_logger()) { // does the logging level set from cmd line? if (trace_level <= 0) { level_set_from_cmd_line = false; cmd_line_level = log4tango::Level::OFF; } else if (trace_level <= 2) { cmd_line_level = log4tango::Level::INFO; } else { cmd_line_level = log4tango::Level::DEBUG; } // add a console target if logging level set from cmd line if (level_set_from_cmd_line) { // add a console target if logging level set from cmd line Logging::add_logging_target(the_logger, kLogTargetConsole, 0); } } if (tg->_UseDb == false) { // done if we are not using the database if (level_set_from_cmd_line) the_logger->set_level(cmd_line_level); cout4 << "Leaving DeviceImpl::init_logger" << endl; return; } // get both logging level and targets from database DbData db_data; db_data.push_back(DbDatum("logging_level")); db_data.push_back(DbDatum("logging_target")); db_data.push_back(DbDatum("logging_rft")); try { db_dev->get_property(db_data); } catch (...) { // error: set logging level then return the_logger->set_level(cmd_line_level); return; } // set logging level (if not set from cmd line) std::string log_level_property; if (!level_set_from_cmd_line && db_data[0].is_empty() == false) { db_data[0] >> log_level_property; // avoid case sensitive troubles std::transform(log_level_property.begin(), log_level_property.end(), log_level_property.begin(), ::toupper); cout4 << "Initial logging level set to [" << log_level_property << "]" << endl; // convert from string to log4tango level log4tango::Level::Value log4tango_level = log4tango::Level::WARN; try { log4tango_level = Logging::tango_to_log4tango_level(log_level_property, false); } catch (...) { // ignore exception } // set logger's level (from property) the_logger->set_level(log4tango_level); } else { // set logger's level (from cmd line) if (the_logger != Logging::get_core_logger()) the_logger->set_level(cmd_line_level); } // save current logging level ext->saved_log_level = the_logger->get_level(); // get rolling threshold for file targets long rft_property = static_cast(kDefaultRollingThreshold); if (db_data[2].is_empty() == false) { db_data[2] >> rft_property; } // save current rolling threshold ext->rft = static_cast(rft_property); // set logging targets std::vector log_target_property; if (db_data[1].is_empty() == false) { db_data[1] >> log_target_property; // attach targets to logger for (unsigned int i = 0; i < log_target_property.size(); i++) { Logging::add_logging_target(the_logger, log_target_property[i], 0); } } // set rolling file threshold for file targets Logging::set_rolling_file_threshold(the_logger, ext->rft); // trace cout4 << "Leaving DeviceImpl::init_logger" << endl; } catch (...) { // igore any exception } } //+------------------------------------------------------------------------- // method : DeviceImpl::start_logging //-------------------------------------------------------------------------- void DeviceImpl::start_logging (void) { get_logger()->set_level(ext->saved_log_level); } //+------------------------------------------------------------------------- // method : DeviceImpl::stop_logging //-------------------------------------------------------------------------- void DeviceImpl::stop_logging (void) { ext->saved_log_level = get_logger()->get_level(); get_logger()->set_level(log4tango::Level::OFF); } } // namespace Tango #endif // TANGO_HAS_LOG4TANGO tango-8.1.2c+dfsg.orig/lib/cpp/server/subdev_diag.cpp0000644000175000017500000003426612205375142021425 0ustar piccapiccastatic const char *RcsId = "$Id: subdev_diag.cpp 22213 2013-03-07 14:32:56Z taurel $\n$Name$"; //+============================================================================= // // file : subdev_diag.cpp // // description : Collect information on all used sub devices // in a device server. // // project : TANGO // // author(s) : J.Meyer // // Copyright (C) : 2004,2005,2006,2007,2008,2009,2010,2011,2012,2013 // European Synchrotron Radiation Facility // BP 220, Grenoble 38043 // FRANCE // // This file is part of Tango. // // Tango 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. // // Tango 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 Tango. If not, see . // // $Revision: 22213 $ // //-============================================================================= #if HAVE_CONFIG_H #include #endif #include extern omni_thread::key_t key_py_data; namespace Tango { //+---------------------------------------------------------------------------- // // method : SubDevDiag::~SubDevDiag() // // description : Destructor to free the map data // //----------------------------------------------------------------------------- SubDevDiag::~SubDevDiag() { cout4 << "SubDevDiag::~SubDevDiag() entering ... " << endl; // lock the sub device map omni_mutex_lock l(sub_dev_map_mutex); // remove all sub devices sub_device_map.clear(); sub_device_startup_map.clear(); } //+---------------------------------------------------------------------------- // // method : SubDevDiag::set_associated_device() // // description : Set the device name that should be asscociated // to a thread in the device server // // in : dev_name - device name // //----------------------------------------------------------------------------- void SubDevDiag::set_associated_device(string dev_name) { cout4 << "SubDevDiag::set_associated_device() entering ... "; // get thread omni_thread *th = omni_thread::self(); if ( th != NULL ) { // write the device name to the per thread data structure omni_thread::value_t *tmp_py_data = th->get_value(key_py_data); if ( tmp_py_data != NULL ) (static_cast(tmp_py_data))->device_name = dev_name; } } //+---------------------------------------------------------------------------- // // method : SubDevDiag::get_associated_device() // // description : Get the device name that is asscociated // with the current thread of the device server // // return : associated device name // //----------------------------------------------------------------------------- string SubDevDiag::get_associated_device() { cout4 << "SubDevDiag::get_associated_device() entering ... " << endl; string dev_name = ""; // get thread omni_thread *th = omni_thread::self(); if ( th != NULL ) { // read the device name from the per thread data structure omni_thread::value_t *tmp_py_data = th->get_value(key_py_data); if ( tmp_py_data != NULL ) dev_name = (static_cast(tmp_py_data))->device_name; } cout4 << "SubDevDiag::get_associated_device() found : " << dev_name << endl; return dev_name; } //+---------------------------------------------------------------------------- // // method : SubDevDiag::register_sub_device() // // description : Register a sub device for an associated device // in the list of sub devices of the device server // // in : dev_name = associated device name // sub_dev_name = sub device name // //----------------------------------------------------------------------------- void SubDevDiag::register_sub_device (string dev_name, string sub_dev_name) { cout4 << "SubDevDiag::register_sub_device() dev_name = " << dev_name << " sub_dev_name = "<< sub_dev_name << endl; bool found = false; // be sure that all names are lower case letters std::transform(dev_name.begin(), dev_name.end(), dev_name.begin(), ::tolower); std::transform(sub_dev_name.begin(), sub_dev_name.end(), sub_dev_name.begin(), ::tolower); // lock the sub device map omni_mutex_lock l(sub_dev_map_mutex); // Find whether a sub device list for the device is already available std::map::iterator ipos; ipos = sub_device_map.find(dev_name); if (ipos == sub_device_map.end()) { // device not known, add a new sub device sub_device_map[dev_name].sub_devices.push_back(sub_dev_name); sub_device_map[dev_name].modified = true; } else { // Check whether the sub device name is alreay in the list for (unsigned int i=0; isecond.sub_devices.size(); i++ ) { if (ipos->second.sub_devices[i] == sub_dev_name) { // Name is already in the list found = true; break; } } if ( found == false) { // name is not in the list, add the sub device ipos->second.sub_devices.push_back(sub_dev_name); ipos->second.modified = true; } } } //+---------------------------------------------------------------------------- // // method : SubDevDiag::remove_sub_devices() // // description : Remove all sub devices for a device of the server // // in : dev_name = device name // //----------------------------------------------------------------------------- void SubDevDiag::remove_sub_devices (string dev_name) { cout4 << "SubDevDiag::remove_sub_device() dev_name = " << dev_name << endl; // be sure that all names are lower case letters std::transform(dev_name.begin(), dev_name.end(), dev_name.begin(), ::tolower); // lock the sub device map omni_mutex_lock l(sub_dev_map_mutex); // remove the list of sub devices for a device std::map::iterator ipos; ipos = sub_device_map.find(dev_name); if (ipos != sub_device_map.end()) { sub_device_map.erase(ipos); } } //+---------------------------------------------------------------------------- // // method : SubDevDiag::remove_sub_devices() // // description : Remove all sub devices of the server // // in : dev_name = device name // //----------------------------------------------------------------------------- void SubDevDiag::remove_sub_devices() { cout4 << "SubDevDiag::remove_sub_devices() remove ALL " << endl; // lock the sub device map omni_mutex_lock l(sub_dev_map_mutex); // remove all sub devices sub_device_map.clear(); } //+---------------------------------------------------------------------------- // // method : SubDevDiag::get_sub_devices() // // description : Read the list of sub devices for the device server // The returned strings are formated as: // "device_name sub_device_name" // or // sub_device_name // when no associated device could be identified. // // return : An array of formated strings // //----------------------------------------------------------------------------- Tango::DevVarStringArray *SubDevDiag::get_sub_devices() { cout4 << "SubDevDiag::get_sub_devices() entering ... " << endl; Tango::DevVarStringArray *ret; vector sub_dev_list; string tmp; // lock the sub device map omni_mutex_lock l(sub_dev_map_mutex); try { std::map::iterator ipos; for (ipos = sub_device_map.begin(); ipos != sub_device_map.end(); ++ipos) { for (unsigned int i=0; isecond.sub_devices.size(); i++) { if ( ipos->first.empty() ) tmp = ipos->second.sub_devices[i]; else tmp = ipos->first + " " + ipos->second.sub_devices[i]; sub_dev_list.push_back (tmp); } } ret = new Tango::DevVarStringArray(DefaultMaxSeq); ret->length(sub_dev_list.size()); for (unsigned int k = 0; k::iterator ipos; for (ipos = sub_device_map.begin(); ipos != sub_device_map.end(); ++ipos) { // Check whether the list was modified if ( ipos->second.modified == true ) { // Check whether for modifications compared to // the list read into db_cache during startup // check the number of sub devices if ( ipos->second.sub_devices.size() == sub_device_startup_map[ipos->first].sub_devices.size() ) { // find sub device names in the start-up list bool is_equal = true; for ( unsigned int i=0; isecond.sub_devices.size(); i++ ) { bool found = false; for ( unsigned int k=0; kfirst].sub_devices.size(); k++ ) { if (ipos->second.sub_devices[i] == sub_device_startup_map[ipos->first].sub_devices[k]) { found = true; break; } } if ( found == false ) { is_equal = false; break; } } if ( is_equal == true ) { // sub device names are equal to the names // read from the database at server start-up. // Clear the modification flag ipos->second.modified = false; continue; } } // write the sub device list as device property try { DbDatum list ("__SubDevices"); DbData db_data; list << ipos->second.sub_devices; db_data.push_back(list); // Check for a valid database object. // In the database server itself or any server // running without a database the database object is // not initialised. if ( Tango::Util::_UseDb == true ) { // cout << "Storing sub device list for " << ipos->first << endl; if ( ipos->first.empty() ) { DServer *adm_dev = tg->get_dserver_device(); tg->get_database()->put_device_property (adm_dev->get_name(), db_data); } else { tg->get_database()->put_device_property (ipos->first, db_data); } } // clear the modification flag ipos->second.modified = false; } catch (Tango::DevFailed &) {} } } } //+---------------------------------------------------------------------------- // // method : SubDevDiag::get_sub_devices_from_cache() // // description : Read the list of sub devices from the // database cache. The cache is filled at // server sart-up. // //----------------------------------------------------------------------------- void SubDevDiag::get_sub_devices_from_cache() { cout4 << "SubDevDiag::get_sub_devices_from_cache() entering ... " << endl; DbServerCache *db_cache; Tango::Util *tg = Tango::Util::instance(); try { db_cache = tg->get_db_cache(); } catch (Tango::DevFailed &e) { Except::print_exception(e); db_cache = NULL; } if (db_cache != NULL) { // get the name of the admin device DServer *adm_dev = tg->get_dserver_device(); string adm_name = adm_dev->get_name(); // be sure that all names are lower case letters std::transform(adm_name.begin(), adm_name.end(), adm_name.begin(), ::tolower); // get all devices served vector dev_list = tg->get_device_list("*"); //cout << "devices served :" << endl; for (unsigned int k=0; kget_name(); // be sure that all names are lower case letters std::transform(dev_name.begin(), dev_name.end(), dev_name.begin(), ::tolower); //cout << dev_name << endl; DevVarStringArray *property_names = new DevVarStringArray; property_names->length(2); (*property_names)[0] = string_dup(dev_name.c_str()); (*property_names)[1] = string_dup("__SubDevices"); try { const DevVarStringArray *property_values = db_cache->get_dev_property(property_names); if ( atol((*property_values)[3]) > 0 ) { // if the device is the admin device, set dev_name to "" // to have the same syntax as in the dynamically created // sub device map. if ( dev_name == adm_name ) dev_name = ""; for (unsigned int i=4; ilength(); i++) { //cout << "sub_dev = " << (*property_values)[i].in() << endl; sub_device_startup_map[dev_name].sub_devices.push_back((*property_values)[i].in()); } } } catch(Tango::DevFailed &) { cerr << "Sub device not found in DB cache for " << dev_name << endl; } delete property_names; } } else cerr << "No database cache found to initialise sub device map!" << endl; } } // End of Tango namespace tango-8.1.2c+dfsg.orig/lib/cpp/server/logstream.cpp0000644000175000017500000004342212205375142021140 0ustar piccapicca//+============================================================================= // // file : LogStream.cpp // // description : A TLS helper class // // project : TANGO // // author(s) : N.Leclercq - SOLEIL // // // Copyright (C) : 2004,2005,2006,2007,2008,2009,2010,2011,2012,2013 // European Synchrotron Radiation Facility // BP 220, Grenoble 38043 // FRANCE // // This file is part of Tango. // // Tango 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. // // Tango 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 Tango. If not, see . // //-============================================================================= #if HAVE_CONFIG_H #include #endif #include #ifdef TANGO_HAS_LOG4TANGO namespace Tango { //+---------------------------------------------------------------------------- // // method : LoggerStream::operator<< // //----------------------------------------------------------------------------- log4tango::LoggerStream& operator<< (log4tango::LoggerStream& ls, const DevFailed &e) { //split exception stack into several logs [use a tag to identify the exception] static unsigned long exception_tag = 0; unsigned long num_errors = e.errors.length(); for (unsigned long i = 0; i < num_errors; i++) { TangoSys_OMemStream msg; msg << "[Ex:" << exception_tag << "-Err:" << i << "] " << "Rsn: " << e.errors[i].reason.in() << " " << "Dsc: " << e.errors[i].desc.in() << " " << "Org: " << e.errors[i].origin.in(); ls << msg.str(); if (i != num_errors - 1) { ls << endl; } } exception_tag++; return ls; } //+---------------------------------------------------------------------------- // // method : LoggerStream::operator<< // //----------------------------------------------------------------------------- log4tango::LoggerStream& operator<< (log4tango::LoggerStream& ls, const DevVarCharArray &v) { long nb_elt = v.length(); for (long i = 0;i < nb_elt;i++) { ls << "Element number [" << i << "]: " << v[i]; if (i < (nb_elt - 1)) ls << endl; } return ls; } //+---------------------------------------------------------------------------- // // method : LoggerStream::operator<< // //----------------------------------------------------------------------------- log4tango::LoggerStream& operator<< (log4tango::LoggerStream& ls, const DevVarShortArray &v) { long nb_elt = v.length(); for (long i = 0;i < nb_elt;i++) { ls << "Element number [" << i << "]: " << v[i]; if (i < (nb_elt - 1)) ls << endl; } return ls; } //+---------------------------------------------------------------------------- // // method : LoggerStream::operator<< // //----------------------------------------------------------------------------- log4tango::LoggerStream& operator<< (log4tango::LoggerStream& ls, const DevVarLongArray &v) { long nb_elt = v.length(); for (long i = 0;i < nb_elt;i++) { ls << "Element number [" << i << "]: " << v[i]; if (i < (nb_elt - 1)) ls << endl; } return ls; } //+---------------------------------------------------------------------------- // // method : LoggerStream::operator<< // //----------------------------------------------------------------------------- log4tango::LoggerStream& operator<< (log4tango::LoggerStream& ls, const DevVarFloatArray &v) { long nb_elt = v.length(); for (long i = 0;i < nb_elt;i++) { ls << "Element number [" << i << "]: " << v[i]; if (i < (nb_elt - 1)) ls << endl; } return ls; } //+---------------------------------------------------------------------------- // // method : LoggerStream::operator<< // //----------------------------------------------------------------------------- log4tango::LoggerStream& operator<< (log4tango::LoggerStream& ls, const DevVarDoubleArray &v) { long nb_elt = v.length(); for (long i = 0;i < nb_elt;i++) { ls << "Element number [" << i << "]: " << v[i]; if (i < (nb_elt - 1)) ls << endl; } return ls; } //+---------------------------------------------------------------------------- // // method : LoggerStream::operator<< // //----------------------------------------------------------------------------- log4tango::LoggerStream& operator<< (log4tango::LoggerStream& ls, const DevVarUShortArray &v) { long nb_elt = v.length(); for (long i = 0;i < nb_elt;i++) { ls << "Element number [" << i << "]: " << v[i]; if (i < (nb_elt - 1)) ls << endl; } return ls; } //+---------------------------------------------------------------------------- // // method : LoggerStream::operator<< // //----------------------------------------------------------------------------- log4tango::LoggerStream& operator<< (log4tango::LoggerStream& ls, const DevVarULongArray &v) { long nb_elt = v.length(); for (long i = 0;i < nb_elt;i++) { ls << "Element number [" << i << "]: " << v[i]; if (i < (nb_elt - 1)) ls << endl; } return ls; } //+---------------------------------------------------------------------------- // // method : LoggerStream::operator<< // //----------------------------------------------------------------------------- log4tango::LoggerStream& operator<< (log4tango::LoggerStream& ls, const DevVarStringArray &v) { long nb_elt = v.length(); for (long i = 0;i < nb_elt;i++) { ls << "Element number [" << i << "]: " << v[i].in(); if (i < (nb_elt - 1)) ls << endl; } return ls; } //+---------------------------------------------------------------------------- // // method : LoggerStream::operator<< // //----------------------------------------------------------------------------- log4tango::LoggerStream& operator<< (log4tango::LoggerStream& ls, const Attribute &a) { Tango::AttributeConfig conf; (const_cast(a)).get_properties(conf); ls << "Attribute name: " << conf.name.in() << endl; ls << "Attribute data_type: "; switch (conf.data_type) { case Tango::DEV_SHORT : ls << "Tango::DevShort" << endl; break; case Tango::DEV_LONG : ls << "Tango::DevLong" << endl; break; case Tango::DEV_DOUBLE : ls << "Tango::DevDouble" << endl; break; case Tango::DEV_STRING : ls << "Tango::DevString" << endl; break; case Tango::DEV_FLOAT : ls << "Tango::DevFloat" << endl; break; case Tango::DEV_BOOLEAN : ls << "Tango::DevBoolean" << endl; break; case Tango::DEV_USHORT : ls << "Tango::DevUShort" << endl; break; case Tango::DEV_UCHAR : ls << "Tango::DevUChar" << endl; break; case Tango::DEV_STATE : ls << "Tango::DevState" << endl; break; } ls << "Attribute data_format: "; switch (conf.data_format) { case Tango::FMT_UNKNOWN: break; case Tango::SCALAR : ls << "scalar" << endl; break; case Tango::SPECTRUM : ls << "spectrum, max_dim_x: " << conf.max_dim_x << endl; break; case Tango::IMAGE : ls << "image, max_dim_x: " << conf.max_dim_x << ", max_dim_y: " << conf.max_dim_y << endl; break; } if (conf.writable == static_cast(true)) ls << "Attribute is writable" << endl; else ls << "Attribute is not writable" << endl; ls << "Attribute label: " << conf.label.in() << endl; ls << "Attribute description: " << conf.description.in() << endl; ls << "Attribute unit: " << conf.unit.in() << endl; ls << "Attribute standard unit: " << conf.standard_unit.in() << endl; ls << "Attribute display unit: " << conf.display_unit.in() << endl; ls << "Attribute format: " << conf.format.in() << endl; ls << "Attribute min alarm: " << conf.min_alarm.in() << endl; ls << "Attribute max alarm: " << conf.max_alarm.in() << endl; ls << "Attribute min value: " << conf.min_value.in() << endl; ls << "Attribute max value: " << conf.max_value.in() << endl; ls << "Attribute writable_attr_name: " << conf.writable_attr_name.in() << endl; return ls; } //+---------------------------------------------------------------------------- // // method : LoggerStream::operator<< // //----------------------------------------------------------------------------- log4tango::LoggerStream& operator<< (log4tango::LoggerStream& ls, const AttrProperty& ap) { AttrProperty& ap_ = const_cast(ap); ls << "Attr.Property: name:" << ap_.get_name() << " - value:" << ap_.get_value() << endl; return ls; } //+---------------------------------------------------------------------------- // // method : LoggerStream::operator<< // //----------------------------------------------------------------------------- log4tango::LoggerStream& operator<< (log4tango::LoggerStream& ls, const Attr& a) { vector v = (const_cast(a)).get_class_properties(); unsigned int n = v.size(); if (n) { for (unsigned i = 0; i < n; i++) { ls << "Attr: " << const_cast(a).get_name() << " Property: name:" << v[i].get_name() << " - value:" << v[i].get_value(); if (i <= (n - 2)) ls << endl; } } else { ls << "Attr. " << const_cast(a).get_name() << " has no class properties"; } return ls; } //+---------------------------------------------------------------------------- // // method : LoggerStream::operator<< // //----------------------------------------------------------------------------- log4tango::LoggerStream& operator<< (log4tango::LoggerStream& ls, const AttrManip& m) { ls << m.to_string(); return ls; } /* //+---------------------------------------------------------------------------- // // method : LogStream::operator<< // //----------------------------------------------------------------------------- log4tango::LogStream& operator<< (log4tango::LogStream& ls, const Devfailed &e) { static unsigned long exception_tag = 0; //split exception stack into several logs (with the same timestamp) unsigned long num_errors = e.errors.length(); for (unsigned long i = 0; i < num_errors; i++) { TangoSys_OMemStream msg; msg << "[Ex: " << ++exception_tag << "-" << i << "] " << "Rsn: " << e.errors[i].reason.in() << " - " << "Dsc: " << e.errors[i].desc.in() << " - " << "Org: " << e.errors[i].origin.in() << ends; ls << msg.str(); if (i != num_errors - 1) { ls << endl; } } return ls; } //+---------------------------------------------------------------------------- // // method : LogStream::operator<< // //----------------------------------------------------------------------------- log4tango::LogStream& operator<< (log4tango::LogStream& ls, const DevVarCharArray &v) { long nb_elt = v.length(); for (long i = 0;i < nb_elt;i++) { ls << "Element number [" << i << "]: " << v[i]; if (i < (nb_elt - 1)) ls << endl; } return ls; } //+---------------------------------------------------------------------------- // // method : LogStream::operator<< // //----------------------------------------------------------------------------- log4tango::LogStream& operator<< (log4tango::LogStream& ls, const DevVarShortArray &v) { long nb_elt = v.length(); for (long i = 0;i < nb_elt;i++) { ls << "Element number [" << i << "]: " << v[i]; if (i < (nb_elt - 1)) ls << endl; } return ls; } //+---------------------------------------------------------------------------- // // method : LogStream::operator<< // //----------------------------------------------------------------------------- log4tango::LogStream& operator<< (log4tango::LogStream& ls, const DevVarLongArray &v) { long nb_elt = v.length(); for (long i = 0;i < nb_elt;i++) { ls << "Element number [" << i << "]: " << v[i]; if (i < (nb_elt - 1)) ls << endl; } return ls; } //+---------------------------------------------------------------------------- // // method : LogStream::operator<< // //----------------------------------------------------------------------------- log4tango::LogStream& operator<< (log4tango::LogStream& ls, const DevVarFloatArray &v) { long nb_elt = v.length(); for (long i = 0;i < nb_elt;i++) { ls << "Element number [" << i << "]: " << v[i]; if (i < (nb_elt - 1)) ls << endl; } return ls; } //+---------------------------------------------------------------------------- // // method : LogStream::operator<< // //----------------------------------------------------------------------------- log4tango::LogStream& operator<< (log4tango::LogStream& ls, const DevVarDoubleArray &v) { long nb_elt = v.length(); for (long i = 0;i < nb_elt;i++) { ls << "Element number [" << i << "]: " << v[i]; if (i < (nb_elt - 1)) ls << endl; } return ls; } //+---------------------------------------------------------------------------- // // method : LogStream::operator<< // //----------------------------------------------------------------------------- log4tango::LogStream& operator<< (log4tango::LogStream& ls, const DevVarUShortArray &v) { long nb_elt = v.length(); for (long i = 0;i < nb_elt;i++) { ls << "Element number [" << i << "]: " << v[i]; if (i < (nb_elt - 1)) ls << endl; } return ls; } //+---------------------------------------------------------------------------- // // method : LogStream::operator<< // //----------------------------------------------------------------------------- log4tango::LogStream& operator<< (log4tango::LogStream& ls, const DevVarULongArray &v) { long nb_elt = v.length(); for (long i = 0;i < nb_elt;i++) { ls << "Element number [" << i << "]: " << v[i]; if (i < (nb_elt - 1)) ls << endl; } return ls; } //+---------------------------------------------------------------------------- // // method : LogStream::operator<< // //----------------------------------------------------------------------------- log4tango::LogStream& operator<< (log4tango::LogStream& ls, const DevVarStringArray &v) { long nb_elt = v.length(); for (long i = 0;i < nb_elt;i++) { ls << "Element number [" << i << "]: " << v[i].in(); if (i < (nb_elt - 1)) ls << endl; } return ls; } //+---------------------------------------------------------------------------- // // method : LogStream::operator<< // //----------------------------------------------------------------------------- log4tango::LogStream& operator<< (log4tango::LogStream& ls, const Attribute &a) { Tango::AttributeConfig conf; (const_cast(a)).get_properties(conf); ls << "Attribute name: " << conf.name.in() << endl; ls << "Attribute data_type: "; switch (conf.data_type) { case Tango::DEV_SHORT: ls << "Tango::DevShort" << endl; break; case Tango::DEV_LONG: ls << "Tango::DevLong" << endl; break; case Tango::DEV_DOUBLE: ls << "Tango::DevDouble" << endl; break; case Tango::DEV_STRING: ls << "Tango::DevString" << endl; break; } ls << "Attribute data_format: "; switch (conf.data_format) { case Tango::SCALAR: ls << "scalar" << endl; break; case Tango::SPECTRUM: ls << "spectrum, max_dim_x: " << conf.max_dim_x << endl; break; case Tango::IMAGE: ls << "image, max_dim_x: " << conf.max_dim_x << ", max_dim_y: " << conf.max_dim_y << endl; break; } if (conf.writable == static_cast(true)) ls << "Attribute is writable" << endl; else ls << "Attribute is not writable" << endl; ls << "Attribute label: " << conf.label.in() << endl; ls << "Attribute description: " << conf.description.in() << endl; ls << "Attribute unit: " << conf.unit.in() << endl; ls << "Attribute standard unit: " << conf.standard_unit.in() << endl; ls << "Attribute display unit: " << conf.display_unit.in() << endl; ls << "Attribute format: " << conf.format.in() << endl; ls << "Attribute min alarm: " << conf.min_alarm.in() << endl; ls << "Attribute max alarm: " << conf.max_alarm.in() << endl; ls << "Attribute min value: " << conf.min_value.in() << endl; ls << "Attribute max value: " << conf.max_value.in() << endl; ls << "Attribute writable_attr_name: " << conf.writable_attr_name.in() << endl; return ls; } //+---------------------------------------------------------------------------- // // method : LogStream::operator<< // //----------------------------------------------------------------------------- log4tango::LogStream& operator<< (log4tango::LogStream& ls, const AttrProperty &p) { AttrProperty &ap = const_cast(p); ls << "Attr.Property: name:" << ap.get_name() << " - Property value:" << ap.get_value(); return ls; } //+---------------------------------------------------------------------------- // // method : LogStream::operator<< // //----------------------------------------------------------------------------- log4tango::LogStream& operator<< (log4tango::LogStream& ls, const Attr& a) { vector v = (const_cast(a)).get_class_properties(); unsigned int n = v.size(); if (n) { for (unsigned i = 0; i < n; i++) { ls << "Attr: " << const_cast(a).get_name() << " Property: name:" << v[i].get_name() << " - value:" << v[i].get_value(); if (i <= (n - 2)) ls << endl; } } else { ls << "Attr. " << const_cast(a).get_name() << " has no class properties"; } return ls; } //+---------------------------------------------------------------------------- // // method : LogStream::operator<< // //----------------------------------------------------------------------------- log4tango::LogStream& operator<< (log4tango::LogStream& ls, const AttrManip& m) { ls << m.to_string(); return ls; } */ } // Tango namespace #endif // TANGO_HAS_LOG4TANGO tango-8.1.2c+dfsg.orig/lib/cpp/server/coutbuf.h0000644000175000017500000000466312205375142020263 0ustar piccapicca//============================================================================= // // file : coutbuf.h // // description : Include for Windows NT debug output class // // project : TANGO // // author(s) : A.Gotz + E.Taurel // // Copyright (C) : 2004,2005,2006,2007,2008,2009,2010,2011,2012,2013 // European Synchrotron Radiation Facility // BP 220, Grenoble 38043 // FRANCE // // This file is part of Tango. // // Tango 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. // // Tango 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 Tango. If not, see . // // $Revision: 22213 $ // //============================================================================= #ifndef _COUTBUF_H #define _COUTBUF_H #include #ifndef TANGO_HAS_LOG4TANGO # include #endif namespace Tango { // // Some defines // #define IDC_LIST -777 #define MAXLISTLINES 200 #ifndef TANGO_HAS_LOG4TANGO #define bufferSize 512 #endif #ifndef TANGO_HAS_LOG4TANGO class CoutBuf: public streambuf #else class CoutBuf #endif { public: CoutBuf(HINSTANCE,int,HWND,LPCSTR); virtual ~CoutBuf(); HWND get_debug_window() {return DbgWin;} void clear_debug_window() {DbgWin = NULL;} void CreateWin(LPCSTR); #ifdef TANGO_HAS_LOG4TANGO int dbg_out (LPCSTR); #endif protected: #ifndef TANGO_HAS_LOG4TANGO char buffer[bufferSize]; long nb_critical; #endif HWND DbgWin; HWND parent_window; #ifndef TANGO_HAS_LOG4TANGO int dbg_out(LPCSTR); virtual int_type overflow(int_type); int flushBuffer(); virtual int sync(); virtual streamsize xsputn(const char_type *,streamsize); #endif }; // // Some functions for windows window management!!! // LRESULT CALLBACK DebugWndProc(HWND, UINT, WPARAM, LPARAM ); void DrawDebugItem(HWND, LPDRAWITEMSTRUCT ); void MeasureDebugItem(HWND, LPMEASUREITEMSTRUCT); } // End of Tango namespace #endif /* _COUTBUF_H */ tango-8.1.2c+dfsg.orig/lib/cpp/server/pollcmds.cpp0000644000175000017500000002561612205375142020765 0ustar piccapiccastatic const char *RcsId = "$Id: pollcmds.cpp 22213 2013-03-07 14:32:56Z taurel $\n$Name$"; //+============================================================================= // // file : PollCmds.cpp // // description : C++ source for the DServerClass and for the // command class defined for this class. The singleton // class derived from DeviceClass. It implements the // command list and all properties and methods required // by the DServer once per process. // // project : TANGO // // author(s) : E.Taurel // // Copyright (C) : 2004,2005,2006,2007,2008,2009,2010,2011,2012,2013 // European Synchrotron Radiation Facility // BP 220, Grenoble 38043 // FRANCE // // This file is part of Tango. // // Tango 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. // // Tango 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 Tango. If not, see . // // $Revision: 22213 $ // //-============================================================================= #if HAVE_CONFIG_H #include #endif #include #include #include namespace Tango { //+------------------------------------------------------------------------- // // method : PolledDeviceCmd::PolledDeviceCmd // // description : constructors for Command class PolledDevice // //-------------------------------------------------------------------------- PolledDeviceCmd::PolledDeviceCmd(const char *name, Tango::CmdArgType in, Tango::CmdArgType out, const char *out_desc):Command(name,in,out) { set_out_type_desc(out_desc); } //+------------------------------------------------------------------------- // // method : PolledDeviceCmd::execute // // description : Trigger the execution of the method really implemented // the command in the DServer class // //-------------------------------------------------------------------------- CORBA::Any *PolledDeviceCmd::execute(DeviceImpl *device, TANGO_UNUSED(const CORBA::Any &in_any)) { cout4 << "PolledDevice::execute(): arrived " << endl; // // Call the device method and return to caller // return insert((static_cast(device))->polled_device()); } //+------------------------------------------------------------------------- // // method : DevPollStatusCmd::DevPollStatusCmd // // description : constructors for Command class DevPollStatus // //-------------------------------------------------------------------------- DevPollStatusCmd::DevPollStatusCmd(const char *name, Tango::CmdArgType in, Tango::CmdArgType out, const char *in_desc, const char *out_desc):Command(name,in,out) { set_in_type_desc(in_desc); set_out_type_desc(out_desc); } //+------------------------------------------------------------------------- // // method : DevPollStatusCmd::execute // // description : Trigger the execution of the method really implemented // the command in the DServer class // //-------------------------------------------------------------------------- CORBA::Any *DevPollStatusCmd::execute(DeviceImpl *device, const CORBA::Any &in_any) { cout4 << "DevPollStatus::execute(): arrived " << endl; // // Extract the input string // const char *tmp_name; if ((in_any >>= tmp_name) == false) { Except::throw_exception((const char *)API_IncompatibleCmdArgumentType, (const char *)"Imcompatible command argument type, expected type is : string", (const char *)"DevPollStatusCmd::execute"); } string d_name(tmp_name); cout4 << "Received string = " << d_name << endl; // // Call the device method and return to caller // return insert((static_cast(device))->dev_poll_status(d_name)); } //+------------------------------------------------------------------------- // // method : AddObjPollingCmd::AddObjPollingCmd // // description : constructors for Command class DevPollStatus // //-------------------------------------------------------------------------- AddObjPollingCmd::AddObjPollingCmd(const char *name, Tango::CmdArgType in, Tango::CmdArgType out, string &in_desc):Command(name,in,out) { set_in_type_desc(in_desc); } //+------------------------------------------------------------------------- // // method : AddObjPollingCmd::execute // // description : Trigger the execution of the method really implemented // the command in the DServer class // //-------------------------------------------------------------------------- CORBA::Any *AddObjPollingCmd::execute(DeviceImpl *device, const CORBA::Any &in_any) { cout4 << "AddObjPolling::execute(): arrived " << endl; // // Extract the input structure // const DevVarLongStringArray *tmp_data; if ((in_any >>= tmp_data) == false) { Except::throw_exception((const char *)API_IncompatibleCmdArgumentType, (const char *)"Imcompatible command argument type, expected type is : DevVarLongStringArray", (const char *)"AddObjPollingCmd::execute"); } // // Call the device method and return to caller // (static_cast(device))->add_obj_polling(tmp_data); // // Return to caller // CORBA::Any *ret = return_empty_any("AddObjPolling"); return ret; } //+------------------------------------------------------------------------- // // method : UpdObjPollingPeriodCmd::UpdObjPollingPeriodCmd // // description : constructors for Command class UpdObjPolledPeriod // //-------------------------------------------------------------------------- UpdObjPollingPeriodCmd::UpdObjPollingPeriodCmd(const char *name, Tango::CmdArgType in, Tango::CmdArgType out, string &in_desc):Command(name,in,out) { set_in_type_desc(in_desc); } //+------------------------------------------------------------------------- // // method : UpdObjPollingPeriodCmd::execute // // description : Trigger the execution of the method really implemented // the command in the DServer class // //-------------------------------------------------------------------------- CORBA::Any *UpdObjPollingPeriodCmd::execute(DeviceImpl *device, const CORBA::Any &in_any) { cout4 << "UpdObjPollingPeriod::execute(): arrived " << endl; // // Extract the input structure // const DevVarLongStringArray *tmp_data; if ((in_any >>= tmp_data) == false) { Except::throw_exception((const char *)API_IncompatibleCmdArgumentType, (const char *)"Imcompatible command argument type, expected type is : DevVarLongStringArray", (const char *)"UpdObjPollingPeriodCmd::execute"); } // // Call the device method and return to caller // (static_cast(device))->upd_obj_polling_period(tmp_data); // // Return to caller // CORBA::Any *ret = return_empty_any("UpdObjPollingPeriod"); return ret; } //+------------------------------------------------------------------------- // // method : RemObjPollingCmd::RemObjPollingCmd // // description : constructors for Command class RemObjPolled // //-------------------------------------------------------------------------- RemObjPollingCmd::RemObjPollingCmd(const char *name, Tango::CmdArgType in, Tango::CmdArgType out, string &in_desc):Command(name,in,out) { set_in_type_desc(in_desc); } //+------------------------------------------------------------------------- // // method : RemObjPollingCmd::execute // // description : Trigger the execution of the method really implemented // the command in the DServer class // //-------------------------------------------------------------------------- CORBA::Any *RemObjPollingCmd::execute(DeviceImpl *device, const CORBA::Any &in_any) { cout4 << "RemObjPolling::execute(): arrived " << endl; // // Extract the input structure // const DevVarStringArray *tmp_data; if ((in_any >>= tmp_data) == false) { Except::throw_exception((const char *)API_IncompatibleCmdArgumentType, (const char *)"Imcompatible command argument type, expected type is : DevVarStringArray", (const char *)"RemObjPollingCmd::execute"); } // // Call the device method and return to caller // (static_cast(device))->rem_obj_polling(tmp_data); // // Return to caller // CORBA::Any *ret = return_empty_any("RemObjPolling"); return ret; } //+------------------------------------------------------------------------- // // method : StartPollingCmd::StartPollingCmd // // description : constructors for Command class RemObjPolled // //-------------------------------------------------------------------------- StopPollingCmd::StopPollingCmd(const char *name, Tango::CmdArgType in, Tango::CmdArgType out):Command(name,in,out) { } //+------------------------------------------------------------------------- // // method : StartPollingCmd::execute // // description : Trigger the execution of the method really implemented // the command in the DServer class // //-------------------------------------------------------------------------- CORBA::Any *StopPollingCmd::execute(DeviceImpl *device, TANGO_UNUSED(const CORBA::Any &in_any)) { cout4 << "StopPolling::execute(): arrived " << endl; // // Call the device method and return to caller // (static_cast(device))->stop_polling(); // // Return to caller // CORBA::Any *ret = return_empty_any("StopPolling"); return ret; } //+------------------------------------------------------------------------- // // method : StartPollingCmd::StartPollingCmd // // description : constructors for Command class RemObjPolled // //-------------------------------------------------------------------------- StartPollingCmd::StartPollingCmd(const char *name, Tango::CmdArgType in, Tango::CmdArgType out):Command(name,in,out) { } //+------------------------------------------------------------------------- // // method : StartPollingCmd::execute // // description : Trigger the execution of the method really implemented // the command in the DServer class // //-------------------------------------------------------------------------- CORBA::Any *StartPollingCmd::execute(DeviceImpl *device, TANGO_UNUSED(const CORBA::Any &in_any)) { cout4 << "StartPolling::execute(): arrived " << endl; // // Call the device method and return to caller // (static_cast(device))->start_polling(); // // Return to caller // CORBA::Any *ret = return_empty_any("StartPolling"); return ret; } } // End of Tango namespace tango-8.1.2c+dfsg.orig/lib/cpp/server/subdev_diag.h0000644000175000017500000000602212205375142021057 0ustar piccapicca//============================================================================= // // file : subdev_diag.h // // description : Collect information on all used sub devices // in a device server. // // project : TANGO // // author(s) : J.Meyer // // Copyright (C) : 2004,2005,2006,2007,2008,2009,2010,2011,2012,2013 // European Synchrotron Radiation Facility // BP 220, Grenoble 38043 // FRANCE // // This file is part of Tango. // // Tango 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. // // Tango 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 Tango. If not, see . // // $Revision: 22213 $ // //============================================================================= #ifndef _SUBDEV_DIAG_H #define _SUBDEV_DIAG_H #include namespace Tango { class SubDevDiag { private: // Type definition and map to keep the // list of accessed sub devices in a device server. // List structure to store every device // and its sub devices. typedef struct sub_dev_list { bool modified; // was the list modified? vector sub_devices; // list of sub devices } SubDeviceList; // map and mutex to keep a list of sub devices per device map sub_device_map; omni_mutex sub_dev_map_mutex; // map to keep a list of sub devices per device as read from // the database cache map sub_device_startup_map; public: // Constructor SubDevDiag() {}; // destructor to free map data ~SubDevDiag(); // Set the device name that should be asscociated to a thread // in the device server void set_associated_device(string dev_name); // Get the device name that is asscociated // with the current thread of the device server string get_associated_device(); // Register a sub device for an associated device // in the list of sub devices of the device server void register_sub_device (string dev_name, string sub_dev_name); // Remove all sub devices for a device of the server void remove_sub_devices (string dev_name); // Remove all sub devices void remove_sub_devices(); // Read the list of registered sub devices Tango::DevVarStringArray *get_sub_devices(); // Store the list of sub devices when modified into the database void store_sub_devices(); // Store the list sub devices at server start-up from the DB cache. void get_sub_devices_from_cache(); }; } // End of Tango namespace #endif /* SUBDEV_DIAG */ tango-8.1.2c+dfsg.orig/lib/cpp/server/except.cpp0000644000175000017500000004201712205375142020432 0ustar piccapiccastatic const char *RcsId = "$Id: except.cpp 22616 2013-05-05 08:56:58Z taurel $\n$Name$"; //+============================================================================= // // file : except.cpp // // description : C++ source for all the utilities used by Tango device // server and mainly for the Tango class // // project : TANGO // // author(s) : A.Gotz + E.Taurel // // Copyright (C) : 2004,2005,2006,2007,2008,2009,2010,2011,2012,2013 // European Synchrotron Radiation Facility // BP 220, Grenoble 38043 // FRANCE // // This file is part of Tango. // // Tango 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. // // Tango 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 Tango. If not, see . // // $Revision: 22616 $ // //-============================================================================= #if HAVE_CONFIG_H #include #endif #include namespace Tango { char Except::mess[256]; omni_mutex Except::the_mutex; //+---------------------------------------------------------------------------- // // method : print_exception // // description : This method prints the information embedded in // a Tango exception. // // in : e : Reference to the exception object // //----------------------------------------------------------------------------- void Except::print_exception(const CORBA::Exception &e) { const CORBA::SystemException *se; // // For a CORBA::SystemException, use the OB function // if ((se = dynamic_cast(&e)) != NULL) { cerr << print_CORBA_SystemException(se) << endl; } // // If it is a CORBA::UserException // else if (dynamic_cast(&e) != NULL) { const Tango::DevFailed *te; const Tango::NamedDevFailedList *mdf; // // Print the Tango::NamedDevFailedList exception contents // if ((mdf = dynamic_cast(&e)) != NULL) { cerr << "Tango NamedDevFailedList exception" << endl; for (unsigned long i = 0;i < mdf->err_list.size();i++) { cerr << " Exception for object " << mdf->err_list[i].name << endl; cerr << " Index of object in call (starting at 0) = " << mdf->err_list[i].idx_in_call << endl; for (unsigned long j =0;j < mdf->err_list[i].err_stack.length();j++) { cerr << " Severity = "; switch (mdf->err_list[i].err_stack[j].severity) { case Tango::WARN : cerr << "WARNING "; break; case Tango::ERR : cerr << "ERROR "; break; case Tango::PANIC : cerr << "PANIC "; break; default : cerr << "Unknown severity code"; break; } cerr << endl; cerr << " Error reason = " << mdf->err_list[i].err_stack[j].reason.in() << endl; cerr << " Desc : " << mdf->err_list[i].err_stack[j].desc.in() << endl; cerr << " Origin : " << mdf->err_list[i].err_stack[j].origin.in() << endl; } } cerr << " Summary exception" << endl; for (unsigned long j =0;j < mdf->errors.length();j++) { cerr << " Severity = "; switch (mdf->errors[j].severity) { case Tango::WARN : cerr << "WARNING "; break; case Tango::ERR : cerr << "ERROR "; break; case Tango::PANIC : cerr << "PANIC "; break; default : cerr << "Unknown severity code"; break; } cerr << endl; cerr << " Error reason = " << mdf->errors[j].reason.in() << endl; cerr << " Desc : " << mdf->errors[j].desc.in() << endl; cerr << " Origin : " << mdf->errors[j].origin.in() << endl; cerr << endl; } } // // Print the Tango::DevFailed exception contents // else if ((te = dynamic_cast(&e)) != NULL) { for (unsigned long i =0;i < te->errors.length();i++) { cerr << "Tango exception" << endl; cerr << "Severity = "; switch (te->errors[i].severity) { case Tango::WARN : cerr << "WARNING "; break; case Tango::ERR : cerr << "ERROR "; break; case Tango::PANIC : cerr << "PANIC "; break; default : cerr << "Unknown severity code"; break; } cerr << endl; cerr << "Error reason = " << te->errors[i].reason.in() << endl; cerr << "Desc : " << te->errors[i].desc.in() << endl; cerr << "Origin : " << te->errors[i].origin.in() << endl; cerr << endl; } } // // For an unknown CORBA::UserException // else { cerr << "Unknown CORBA user exception" << endl; } } // // For an unknown exception type // else { cerr << "Unknown exception type !!!!!!" << endl; } } //+---------------------------------------------------------------------------- // // method : print_CORBA_SystemException // // description : This method prints the information embedded in // a CORBA system exception. // // in : e : Pointer to the exception object // //----------------------------------------------------------------------------- char *Except::print_CORBA_SystemException(const CORBA::SystemException *e) { const CORBA::BAD_PARAM *bad; const CORBA::NO_MEMORY *mem; const CORBA::IMP_LIMIT *lim; const CORBA::COMM_FAILURE *comm; const CORBA::INV_OBJREF *inv; const CORBA::NO_PERMISSION *perm; const CORBA::INTERNAL *inter; const CORBA::MARSHAL *mar; const CORBA::INITIALIZE *ini; const CORBA::NO_IMPLEMENT *impl; const CORBA::BAD_TYPECODE *type; const CORBA::BAD_OPERATION *op; const CORBA::NO_RESOURCES *res; const CORBA::NO_RESPONSE *resp; const CORBA::BAD_INV_ORDER *inv_ord; const CORBA::TRANSIENT *tra; const CORBA::OBJ_ADAPTER *adap; const CORBA::OBJECT_NOT_EXIST *not_ex; const CORBA::INV_POLICY *pol; // // It seems that omniORB for Win32 is not compiled with the RTTI enabled // (/GR option). We can't use dynamic_casting here. // We are using CORBA _downcast() method !!! // if (CORBA::UNKNOWN::_downcast(e) != 0) { ::strcpy(mess,"UNKNOWN CORBA system exception"); } else if ((bad = CORBA::BAD_PARAM::_downcast(e)) != 0) { ::strcpy(mess,"BAD_PARAM CORBA system exception: "); const char *err_msg = bad->NP_minorString(); if ( err_msg == NULL ) ::strcat(mess,"ORB has returned NULL pointer !"); else ::strcat(mess,err_msg); } else if ((mem = CORBA::NO_MEMORY::_downcast(e)) != 0) { ::strcpy(mess,"NO_MEMORY CORBA system exception: "); const char *err_msg = mem->NP_minorString(); if ( err_msg == NULL ) ::strcat(mess,"ORB has returned NULL pointer !"); else ::strcat(mess,err_msg); } else if ((lim = CORBA::IMP_LIMIT::_downcast(e)) != 0) { ::strcpy(mess,"IMP_LIMIT CORBA system exception: "); const char *tmp = lim->NP_minorString(); if (tmp == NULL) { ::strcat(mess,"Unknown minor code: "); TangoSys_MemStream st; st << hex << lim->minor() << dec << ends; string s = st.str(); ::strcat(mess,s.c_str()); } else ::strcat(mess,tmp); } else if ((comm = CORBA::COMM_FAILURE::_downcast(e)) != NULL) { ::strcpy(mess,"COMM_FAILURE CORBA system exception: "); const char *tmp = comm->NP_minorString(); if (tmp == NULL) { ::strcat(mess,"Unknown minor code: "); TangoSys_MemStream st; st << hex << comm->minor() << dec << ends; string s = st.str(); ::strcat(mess,s.c_str()); } else ::strcat(mess,tmp); } else if ((inv = CORBA::INV_OBJREF::_downcast(e)) != NULL) { ::strcpy(mess,"INV_OBJREF CORBA system exception: "); const char *err_msg = inv->NP_minorString(); if ( err_msg == NULL ) ::strcat(mess,"ORB has returned NULL pointer !"); else ::strcat(mess,err_msg); } else if ((perm = CORBA::NO_PERMISSION::_downcast(e)) != NULL) { ::strcpy(mess,"NO_PERMISSION CORBA system exception: "); const char *err_msg = perm->NP_minorString(); if ( err_msg == NULL ) ::strcat(mess,"ORB has returned NULL pointer !"); else ::strcat(mess,err_msg); } else if ((inter = CORBA::INTERNAL::_downcast(e)) != NULL) { ::strcpy(mess,"INTERNAL CORBA system exception: "); const char *err_msg = inter->NP_minorString(); if ( err_msg == NULL ) ::strcat(mess,"ORB has returned NULL pointer !"); else ::strcat(mess,err_msg); } else if ((mar = CORBA::MARSHAL::_downcast(e)) != NULL) { ::strcpy(mess,"MARSHAL CORBA system exception: "); const char *err_msg = mar->NP_minorString(); if ( err_msg == NULL ) ::strcat(mess,"ORB has returned NULL pointer !"); else ::strcat(mess,err_msg); } else if ((ini = CORBA::INITIALIZE::_downcast(e)) != NULL) { ::strcpy(mess,"INITIALIZE CORBA system exception: "); const char *err_msg = ini->NP_minorString(); if ( err_msg == NULL ) ::strcat(mess,"ORB has returned NULL pointer !"); else ::strcat(mess,err_msg); } else if ((impl = CORBA::NO_IMPLEMENT::_downcast(e)) != NULL) { ::strcpy(mess,"NO_IMPLEMENT CORBA system exception: "); const char *err_msg = impl->NP_minorString(); if ( err_msg == NULL ) ::strcat(mess,"ORB has returned NULL pointer !"); else ::strcat(mess,err_msg); } else if ((type = CORBA::BAD_TYPECODE::_downcast(e)) != NULL) { ::strcpy(mess,"BAD_TYPECODE CORBA system exception: "); const char *err_msg = type->NP_minorString(); if ( err_msg == NULL ) ::strcat(mess,"ORB has returned NULL pointer !"); else ::strcat(mess,err_msg); } else if ((op = CORBA::BAD_OPERATION::_downcast(e)) != NULL) { ::strcpy(mess,"BAD_OPERATION CORBA system exception: "); const char *err_msg = op->NP_minorString(); if ( err_msg == NULL ) ::strcat(mess,"ORB has returned NULL pointer !"); else ::strcat(mess,err_msg); } else if ((res = CORBA::NO_RESOURCES::_downcast(e)) != NULL) { ::strcpy(mess,"NO_RESOURCES CORBA system exception: "); const char *err_msg = res->NP_minorString(); if ( err_msg == NULL ) ::strcat(mess,"ORB has returned NULL pointer !"); else ::strcat(mess,err_msg); } else if ((resp = CORBA::NO_RESPONSE::_downcast(e)) != NULL) { ::strcpy(mess,"NO_RESPONSE CORBA system exception: "); const char *err_msg = resp->NP_minorString(); if ( err_msg == NULL ) ::strcat(mess,"ORB has returned NULL pointer !"); else ::strcat(mess,err_msg); } else if ((inv_ord = CORBA::BAD_INV_ORDER::_downcast(e)) != NULL) { ::strcpy(mess,"BAD_INV_ORDER CORBA system exception: "); const char *err_msg = inv_ord->NP_minorString(); if ( err_msg == NULL ) ::strcat(mess,"ORB has returned NULL pointer !"); else ::strcat(mess,err_msg); } else if ((tra = CORBA::TRANSIENT::_downcast(e)) != NULL) { ::strcpy(mess,"TRANSIENT CORBA system exception: "); const char *tmp = tra->NP_minorString(); if (tmp == NULL) { ::strcat(mess,"Unknown minor code: "); TangoSys_MemStream st; st << hex << tra->minor() << dec << ends; string s = st.str(); ::strcat(mess,s.c_str()); } else ::strcat(mess,tmp); } else if ((adap = CORBA::OBJ_ADAPTER::_downcast(e)) != NULL) { ::strcpy(mess,"OBJ_ADAPTER CORBA system exception: "); const char *err_msg = adap->NP_minorString(); if ( err_msg == NULL ) ::strcat(mess,"ORB has returned NULL pointer !"); else ::strcat(mess,err_msg); } else if ((not_ex = CORBA::OBJECT_NOT_EXIST::_downcast(e)) != NULL) { ::strcpy(mess,"OBJECT_NOT_EXIST CORBA system exception: "); const char *err_msg = not_ex->NP_minorString(); if ( err_msg == NULL ) ::strcat(mess,"ORB has returned NULL pointer !"); else ::strcat(mess,err_msg); } else if ((pol = CORBA::INV_POLICY::_downcast(e)) != NULL) { ::strcpy(mess,"INV_POLICY CORBA system exception: "); const char *err_msg = pol->NP_minorString(); if ( err_msg == NULL ) ::strcat(mess,"ORB has returned NULL pointer !"); else ::strcat(mess,err_msg); } else ::strcpy(mess,"CORBA unknown system exception !!!!!!!!"); return mess; } //+---------------------------------------------------------------------------- // // method : print_error_stack // // description : This method prints the a Tango error stack // // in : e : Reference to the error stack // //----------------------------------------------------------------------------- void Except::print_error_stack(const Tango::DevErrorList &e) { for (unsigned long i = 0;i < e.length();i++) { cerr << "Tango error stack" << endl; cerr << "Severity = "; switch (e[i].severity) { case Tango::WARN : cerr << "WARNING "; break; case Tango::ERR : cerr << "ERROR "; break; case Tango::PANIC : cerr << "PANIC "; break; default : cerr << "Unknown severity code"; break; } cerr << endl; cerr << "Error reason = " << e[i].reason.in() << endl; cerr << "Desc : " << e[i].desc.in() << endl; cerr << "Origin : " << e[i].origin.in() << endl; cerr << endl; } } //+---------------------------------------------------------------------------- // // method : throw_exception // // description : These methods throws a Tango DevFailed exception from // a CORBA system exception. // Note that there is no CORBA::string_dup memory // for the reason field because it it is returned by // the print_CORBA_SystemException which in turn is // using an OB method (_OB_defaultToString) which // internally used a CORBA::String_var and its method // _retn() to return the string. Therefore, its // memory is allocated using CORBA::string_alloc. // // in : e : Pointer to the exception object // //----------------------------------------------------------------------------- void Except::throw_exception(const CORBA::SystemException &c_ex,const char *origin) { Tango::DevErrorList errors(1); errors.length(1); errors[0].severity = Tango::ERR; errors[0].origin = CORBA::string_dup(origin); errors[0].reason = CORBA::string_dup(API_CorbaSysException); errors[0].desc = print_CORBA_SystemException(&c_ex); throw Tango::DevFailed(errors); } void Except::throw_exception(const CORBA::SystemException &c_ex,char *origin) { Tango::DevErrorList errors(1); errors.length(1); errors[0].severity = Tango::ERR; errors[0].origin = CORBA::string_dup(origin); delete [] origin; errors[0].reason = CORBA::string_dup(API_CorbaSysException); errors[0].desc = print_CORBA_SystemException(&c_ex); throw Tango::DevFailed(errors); } void Except::throw_exception(const CORBA::SystemException &c_ex,const string &origin) { Tango::DevErrorList errors(1); errors.length(1); errors[0].severity = Tango::ERR; errors[0].origin = CORBA::string_dup(origin.c_str()); errors[0].reason = CORBA::string_dup(API_CorbaSysException); errors[0].desc = print_CORBA_SystemException(&c_ex); throw Tango::DevFailed(errors); } void Except::throw_named_exception(Tango::DeviceImpl *d,long ind,const char *reason, const char *desc,const char *origin,Tango::ErrSeverity sever) { throw_named_exception(d->get_device_attr()->get_attr_by_ind(ind).get_name().c_str(), reason,desc,origin,sever); } void Except::throw_named_exception(Tango::DeviceImpl *d,vector &ind_atts,const char *reason, const char *desc,const char *origin,Tango::ErrSeverity sever) { vector vs; vector::iterator ite; for (ite = ind_atts.begin();ite != ind_atts.end();++ite) { vs.push_back(d->get_device_attr()->get_attr_by_ind(*ite).get_name()); } throw_named_exception(vs,reason,desc,origin,sever); } //+---------------------------------------------------------------------------- // // method : Compare two Tango DevFailed exceptions for equality // // description : The two DevFailed exceptions are verified by comparing the // reason, origin, description and severity of all exceptions in the error stack. // The strings reason, origin and description are compared literally. // // in : ex1 The first DevFailed exception // ex1 The first DevFailed exception // // return: a boolean set to true if the two exceptions are equal //----------------------------------------------------------------------------- bool Except::compare_exception(Tango::DevFailed &ex1, Tango::DevFailed &ex2) { // check the length of the exception stack unsigned long nb_err = ex1.errors.length(); if ( nb_err != ex2.errors.length() ) { return false; } // check all exceptions in the stack for (unsigned long i=0; i. // // $Revision: 22213 $ // //-============================================================================= #if HAVE_CONFIG_H #include #endif #include namespace Tango { //+---------------------------------------------------------------------------- // // method : DServer::lock_device() // // description : command to lock device // // args: - in_data : Pointer to a structure with: // 1 - Name of the device(s) to be locked // 2 - Lock validity // //----------------------------------------------------------------------------- void DServer::lock_device(const Tango::DevVarLongStringArray *in_data) { NoSyncModelTangoMonitor mon(this); string dev_name(in_data->svalue[0]); int lock_validity = in_data->lvalue[0]; cout4 << "In lock_device command for device " << dev_name << ", lock validity = " << lock_validity << endl; // // Get client identification // Tango::client_addr *cl = get_client_ident(); if (cl == NULL) { Except::throw_exception((const char*)API_CantGetClientIdent, (const char*)"Cannot retrieve client identification", (const char*)"DServer::lock_device"); } cout4 << "Client identification = " << *cl << endl; if (cl->client_ident == false) { Except::throw_exception((const char*)"API_ClientTooOld", (const char*)"Your client cannot lock devices. You are using a too old Tango release. Please, update to tango V7 or more", (const char*)"DServer::lock_device"); } // // Transform device name to lower case // Tango::Util *tg = Tango::Util::instance(); string local_dev_name(get_name()); transform(local_dev_name.begin(),local_dev_name.end(),local_dev_name.begin(),::tolower); string d_name_lower(dev_name); transform(d_name_lower.begin(),d_name_lower.end(),d_name_lower.begin(),::tolower); // // Refuse to lock the admin device // if (d_name_lower == local_dev_name) { Except::throw_exception((const char *)API_DeviceUnlockable, (const char *)"Impossible to lock device server administration device", (const char *)"DServer::lock_device"); } // // Get device ptr // DeviceImpl *the_dev; the_dev = tg->get_device_by_name(dev_name); // // Refuse to lock database device // string &cl_name = the_dev->get_device_class()->get_name(); if (::strcmp(cl_name.c_str(),DATABASE_CLASS) == 0) { Except::throw_exception((const char *)API_DeviceUnlockable, (const char *)"Impossible to lock database device", (const char *)"DServer::lock_device"); } // // Mark the device as locked // the_dev->lock(cl,lock_validity); } //+---------------------------------------------------------------------------- // // method : DServer::un_lock_device() // // description : command to un lock a device // // args: - dev_name : The device name // //----------------------------------------------------------------------------- Tango::DevLong DServer::un_lock_device(const Tango::DevVarLongStringArray *in_data) { NoSyncModelTangoMonitor mon(this); cout4 << "In un_lock_device command for device " << in_data->svalue[0] << endl; // // Get client identification // Tango::client_addr *cl = get_client_ident(); if (cl == NULL) { Except::throw_exception((const char*)API_CantGetClientIdent, (const char*)"Cannot retrieve client identification", (const char*)"DServer::un_lock_device"); } cout4 << "Client identification = " << *cl << endl; if ((cl->client_ident == false) && (in_data->lvalue[0] == 0)) { Except::throw_exception((const char*)"API_ClientTooOld", (const char*)"Your client cannot un-lock devices. You are using a too old Tango release. Please, update to tango V7 or more", (const char*)"DServer::un_lock_device"); } // // Get the device and unlock it // DevLong ctr = 0; Tango::Util *tg = Tango::Util::instance(); for (unsigned int loop = 0;loop < in_data->svalue.length();++loop) { string d_name(in_data->svalue[loop]); if (d_name == get_name()) ctr = ext->lock_ctr; else { DeviceImpl *the_dev = tg->get_device_by_name(d_name); ctr = the_dev->unlock((bool)in_data->lvalue[0]); } if (loop > 0) ctr = 0; } return ctr; } //+---------------------------------------------------------------------------- // // method : DServer::re_lock_devices() // // description : command to re-lock devices // // args: - dev_name_list : Name of the device(s) to be re-locked // //----------------------------------------------------------------------------- void DServer::re_lock_devices(const Tango::DevVarStringArray *dev_name_list) { NoSyncModelTangoMonitor mon(this); cout4 << "In re_lock_devices command" << endl; CORBA::ULong loop; CORBA::ULong nb_dev = dev_name_list->length(); for (loop = 0;loop < nb_dev;loop++) cout4 << "Device to re-lock: " << (*dev_name_list)[loop] << endl; // // Get client identification // Tango::client_addr *cl = get_client_ident(); if (cl == NULL) { Except::throw_exception((const char*)API_CantGetClientIdent, (const char*)"Cannot retrieve client identification", (const char*)"DServer::re_lock_devices"); } cout4 << "Client identification = " << *cl << endl; if (cl->client_ident == false) { Except::throw_exception((const char*)"API_ClientTooOld", (const char*)"Your client cannot re_lock devices. You are using a too old Tango release. Please, update to tango V7 or more", (const char*)"DServer::re_lock_devices"); } // // ReLock the devices // If we have an error in this loop, memorize it and throw the exception at the // end of the loop // Tango::Util *tg = Tango::Util::instance(); DevErrorList errors; long nb_error = 0; for (loop = 0;loop < nb_dev;loop++) { string d_name((*dev_name_list)[loop]); // // Get device ptr // DeviceImpl *the_dev = NULL; try { the_dev = tg->get_device_by_name(d_name); } catch (Tango::DevFailed &e) { errors.length(nb_error + 1); errors[nb_error].desc = CORBA::string_dup(e.errors[0].desc.in()); errors[nb_error].reason = CORBA::string_dup(e.errors[0].reason.in()); errors[nb_error].origin = CORBA::string_dup(e.errors[0].origin.in()); errors[nb_error].severity = e.errors[0].severity; nb_error++; } // // ReLock the device // try { the_dev->relock(cl); } catch (Tango::DevFailed &e) { errors.length(nb_error + 1); errors[nb_error].desc = CORBA::string_dup(e.errors[0].desc.in()); errors[nb_error].reason = CORBA::string_dup(e.errors[0].reason.in()); errors[nb_error].origin = CORBA::string_dup(e.errors[0].origin.in()); errors[nb_error].severity = e.errors[0].severity; nb_error++; } } // // Throw the exception if we had one during the loop // if (nb_error != 0) { throw Tango::DevFailed(errors); } } //+---------------------------------------------------------------------------- // // method : DServer::dev_lock_status() // // description : command to get device lock status // // args: - dev_name : The device name // //----------------------------------------------------------------------------- Tango::DevVarLongStringArray *DServer::dev_lock_status(Tango::ConstDevString dev_name) { NoSyncModelTangoMonitor mon(this); cout4 << "In dev_lock_status command for device " << dev_name << endl; // // Get the device and get its lock status // string d_name(dev_name); Tango::Util *tg = Tango::Util::instance(); DeviceImpl *the_dev = tg->get_device_by_name(d_name); return the_dev->lock_status(); } } // End of Tango namespace tango-8.1.2c+dfsg.orig/lib/cpp/server/attrmanip.h0000644000175000017500000000347712205375142020615 0ustar piccapicca//============================================================================= // // file : attrmanip.h // // description : Include for the Tango attribute manipulator // // project : TANGO // // author(s) : E.Taurel // // Copyright (C) : 2004,2005,2006,2007,2008,2009,2010,2011,2012,2013 // European Synchrotron Radiation Facility // BP 220, Grenoble 38043 // FRANCE // // This file is part of Tango. // // Tango 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. // // Tango 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 Tango. If not, see . // // $Revision: 22213 $ // //============================================================================= #ifndef _ATTRMANIP_H #define _ATTRMANIP_H #include #include namespace Tango { class AttrManip { //#ifndef TANGO_HAS_LOG4TANGO friend ostream &operator<<(ostream &,const AttrManip&); friend void execute_manip(ostream &,string &str); //#endif public: AttrManip(const char *f):format(f) { transform(format.begin(),format.end(),format.begin(),::tolower); } AttrManip(const string &str):format(str) { transform(format.begin(),format.end(),format.begin(),::tolower); } inline const string& to_string (void) const { return format; } private: string format; }; } // End of Tango namespace #endif tango-8.1.2c+dfsg.orig/lib/cpp/server/encoded_attribute.cpp0000644000175000017500000003347212205375142022633 0ustar piccapicca///============================================================================= // // file : encoded_attribute.cpp // // description : Management of Tango::DevEncoded format // // project : TANGO // // author(s) : JL Pons // // Copyright (C) : 2004,2005,2006,2007,2008,2009,2010,2011,2012,2013 // European Synchrotron Radiation Facility // BP 220, Grenoble 38043 // FRANCE // // This file is part of Tango. // // Tango 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. // // Tango 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 Tango. If not, see . // // $Revision: 22616 $ // // //============================================================================= #include #include using namespace Tango; #define SAFE_FREE(x) if(x) {free(x);x=NULL;} // ---------------------------------------------------------------------------- EncodedAttribute::EncodedAttribute():manage_exclusion(false),ext(Tango_NullPtr) { buffer_array = (unsigned char **)calloc(1,sizeof(unsigned char *)); buffer_array[0] = NULL; buffSize_array = (int *)calloc(1,sizeof(int)); buffSize_array[0] = 0; format = NULL; mutex_array = NULL; index = 0; buf_elt_nb = 1; } EncodedAttribute::EncodedAttribute(int si,bool excl):manage_exclusion(excl),ext(Tango_NullPtr) { buffer_array = (unsigned char **)calloc(si,sizeof(unsigned char *)); buffSize_array = (int *)calloc(si,sizeof(int)); for (int i = 0;i < si;i++) { buffer_array[i] = NULL; buffSize_array[i] = 0; } format = NULL; index = 0; buf_elt_nb = si; if (manage_exclusion == true) mutex_array = new omni_mutex[si]; } // ---------------------------------------------------------------------------- EncodedAttribute::~EncodedAttribute() { for (int i = 0;i < buf_elt_nb;i++) SAFE_FREE(buffer_array[i]); SAFE_FREE(buffer_array); SAFE_FREE(buffSize_array); if (mutex_array != NULL) delete [] mutex_array; } // ---------------------------------------------------------------------------- void EncodedAttribute::encode_jpeg_gray8(unsigned char *gray8,int width,int height,double quality) { if (manage_exclusion == true) mutex_array[index].lock(); SAFE_FREE(buffer_array[index]); buffSize_array[index] = 0; format = (char *)JPEG_GRAY_8; jpeg_encode_gray8(width,height,gray8,quality,&(buffSize_array[index]),&(buffer_array[index])); INC_INDEX() } // ---------------------------------------------------------------------------- void EncodedAttribute::encode_jpeg_rgb32(unsigned char *rgb32,int width,int height,double quality) { if (manage_exclusion == true) mutex_array[index].lock(); SAFE_FREE(buffer_array[index]); buffSize_array[index] = 0; format = (char *)JPEG_RGB; jpeg_encode_rgb32(width,height,rgb32,quality,&(buffSize_array[index]),&(buffer_array[index])); INC_INDEX() } // ---------------------------------------------------------------------------- void EncodedAttribute::encode_jpeg_rgb24(unsigned char *rgb24,int width,int height,double quality) { if (manage_exclusion == true) mutex_array[index].lock(); SAFE_FREE(buffer_array[index]); buffSize_array[index] = 0; format = (char *)JPEG_RGB; jpeg_encode_rgb24(width,height,rgb24,quality,&(buffSize_array[index]),&(buffer_array[index])); INC_INDEX() } // ---------------------------------------------------------------------------- void EncodedAttribute::encode_gray8(unsigned char *gray8,int width,int height) { int newSize = width*height + 4; if (manage_exclusion == true) mutex_array[index].lock(); if( newSize!=buffSize_array[index] ) { SAFE_FREE(buffer_array[index]); buffer_array[index] = (unsigned char *)malloc(newSize); buffSize_array[index] = newSize; } format = (char *)GRAY_8; // Store image dimension (big endian) unsigned char *tmp_ptr = buffer_array[index]; tmp_ptr[0] = (unsigned char)( (width>>8) & 0xFF ); tmp_ptr[1] = (unsigned char)( width & 0xFF ); tmp_ptr[2] = (unsigned char)( (height>>8) & 0xFF ); tmp_ptr[3] = (unsigned char)( height & 0xFF ); // Copy image memcpy(tmp_ptr+4,gray8,newSize-4); INC_INDEX() } // ---------------------------------------------------------------------------- void EncodedAttribute::encode_gray16(unsigned short *gray16,int width,int height) { int newSize = width*height*2 + 4; if (manage_exclusion == true) mutex_array[index].lock(); if( newSize!=buffSize_array[index] ) { SAFE_FREE(buffer_array[index]); buffer_array[index] = (unsigned char *)malloc(newSize); buffSize_array[index] = newSize; } format = (char *)GRAY_16; // Store image dimension (big endian) unsigned char *tmp_ptr = buffer_array[index]; tmp_ptr[0] = (unsigned char)( (width>>8) & 0xFF ); tmp_ptr[1] = (unsigned char)( width & 0xFF ); tmp_ptr[2] = (unsigned char)( (height>>8) & 0xFF ); tmp_ptr[3] = (unsigned char)( height & 0xFF ); // Store image (big endian) int srcIdx = 0; int dstIdx = 4; for(int j=0;j> 8); tmp_ptr[dstIdx++] = (unsigned char)(s & 0xFF); } } INC_INDEX() } // ---------------------------------------------------------------------------- void EncodedAttribute::encode_rgb24(unsigned char *rgb24,int width,int height) { int newSize = width*height*3 + 4; if (manage_exclusion == true) mutex_array[index].lock(); if( newSize!=buffSize_array[index] ) { SAFE_FREE(buffer_array[index]); buffer_array[index] = (unsigned char *)malloc(newSize); buffSize_array[index] = newSize; } format = (char *)RGB_24; // Store image dimension (big endian) unsigned char *tmp_ptr = buffer_array[index]; tmp_ptr[0] = (unsigned char)( (width>>8) & 0xFF ); tmp_ptr[1] = (unsigned char)( width & 0xFF ); tmp_ptr[2] = (unsigned char)( (height>>8) & 0xFF ); tmp_ptr[3] = (unsigned char)( height & 0xFF ); // Copy image memcpy(tmp_ptr+4,rgb24,newSize-4); } // ---------------------------------------------------------------------------- void EncodedAttribute::decode_rgb32(DeviceAttribute *attr,int *width,int *height,unsigned char **rgb32) { if (attr->is_empty()) { Except::throw_exception((const char *)API_WrongFormat, (const char *)"Attribute contains no data", (const char *)"EncodedAttribute::decode_gray8"); } DevVarEncodedArray_var &encDataSeq = attr->get_Encoded_data(); if (encDataSeq.operator->() == NULL) { ApiDataExcept::throw_exception((const char*)"API_IncompatibleAttrArgumentType", (const char*)"Cannot extract, data in DeviceAttribute object is not DevEncoded", (const char*)"EncodedAttribute::decode_gray8"); } string local_format(encDataSeq.in()[0].encoded_format); int isRGB = (strcmp(local_format.c_str() ,RGB_24 ) == 0); int isJPEG = (strcmp(local_format.c_str() ,JPEG_RGB ) == 0); if( !isRGB && !isJPEG ) { Except::throw_exception((const char *)API_WrongFormat, (const char *)"Not a color format", (const char *)"EncodedAttribute::decode_rgb32"); } unsigned char *rawBuff = NULL; DevVarEncodedArray &encData = encDataSeq.inout(); DevVarCharArray &encBuff = encData[0].encoded_data; int size = encBuff.length(); rawBuff = encBuff.get_buffer(false); if( isRGB ) { // Get width and height int wh = ((int)rawBuff[0] & 0xFF); int wl = ((int)rawBuff[1] & 0xFF); wh = wh << 8; int iWidth = wh | wl; int hh = ((int)rawBuff[2] & 0xFF); int hl = ((int)rawBuff[3] & 0xFF); hh = hh << 8; int iHeight = hh | hl; unsigned char *data = new unsigned char[iWidth*iHeight*4]; // Convert to RGB32 int srcIdx = 4; int dstIdx = 0; for(int j=0;jis_empty()) { Except::throw_exception((const char *)API_WrongFormat, (const char *)"Attribute contains no data", (const char *)"EncodedAttribute::decode_gray8"); } DevVarEncodedArray_var &encDataSeq = attr->get_Encoded_data(); if (encDataSeq.operator->() == NULL) { ApiDataExcept::throw_exception((const char*)"API_IncompatibleAttrArgumentType", (const char*)"Cannot extract, data in DeviceAttribute object is not DevEncoded", (const char*)"EncodedAttribute::decode_gray8"); } string local_format(encDataSeq.in()[0].encoded_format); int isGrey = (strcmp(local_format.c_str() ,GRAY_8 ) == 0); int isJPEG = (strcmp(local_format.c_str() ,JPEG_GRAY_8 ) == 0); if( !isGrey && !isJPEG ) { Except::throw_exception((const char *)API_WrongFormat, (const char *)"Not a grayscale 8bit format", (const char *)"EncodedAttribute::decode_gray8"); } unsigned char *rawBuff = NULL; DevVarEncodedArray &encData = encDataSeq.inout(); DevVarCharArray &encBuff = encData[0].encoded_data; int size = encBuff.length(); rawBuff = encBuff.get_buffer(false); if( isGrey ) { // Get width and height int wh = ((int)rawBuff[0] & 0xFF); int wl = ((int)rawBuff[1] & 0xFF); wh = wh << 8; int iWidth = wh | wl; int hh = ((int)rawBuff[2] & 0xFF); int hl = ((int)rawBuff[3] & 0xFF); hh = hh << 8; int iHeight = hh | hl; unsigned char *data = new unsigned char[iWidth*iHeight]; memcpy(data,&(rawBuff[4]),iWidth*iHeight); *gray8 = data; *width = iWidth; *height = iHeight; return; } if( isJPEG ) { int jFormat; int err = jpeg_decode(size,&(rawBuff[0]),width,height,&jFormat,gray8); if(err) { TangoSys_OMemStream o; o << jpeg_get_error_msg(err); Except::throw_exception((const char *)API_DecodeErr, o.str(), (const char *)"EncodedAttribute::decode_gray8"); } if( jFormat!=JPEG_GRAY_FORMAT ) { // Should not happen Except::throw_exception((const char *)API_WrongFormat, (const char *)"Not a grayscale 8bit format", (const char *)"EncodedAttribute::decode_gray8"); } return; } } // ---------------------------------------------------------------------------- void EncodedAttribute::decode_gray16(DeviceAttribute *attr,int *width,int *height,unsigned short **gray16) { if (attr->is_empty()) { Except::throw_exception((const char *)API_WrongFormat, (const char *)"Attribute contains no data", (const char *)"EncodedAttribute::decode_gray16"); } DevVarEncodedArray_var &encDataSeq = attr->get_Encoded_data(); if (encDataSeq.operator->() == NULL) { ApiDataExcept::throw_exception((const char*)"API_IncompatibleAttrArgumentType", (const char*)"Cannot extract, data in DeviceAttribute object is not DevEncoded", (const char*)"EncodedAttribute::decode_gray16"); } string local_format(encDataSeq.in()[0].encoded_format); int isGrey = (strcmp(local_format.c_str() ,GRAY_16 ) == 0); if( !isGrey ) { Except::throw_exception((const char *)API_WrongFormat, (const char *)"Not a grayscale 16 bits format", (const char *)"EncodedAttribute::decode_gray16"); } unsigned char *rawBuff = NULL; DevVarEncodedArray &encData = encDataSeq.inout(); DevVarCharArray &encBuff = encData[0].encoded_data; rawBuff = encBuff.get_buffer(false); if( isGrey ) { // Get width and height int wh = ((int)rawBuff[0] & 0xFF); int wl = ((int)rawBuff[1] & 0xFF); wh = wh << 8; int iWidth = wh | wl; int hh = ((int)rawBuff[2] & 0xFF); int hl = ((int)rawBuff[3] & 0xFF); hh = hh << 8; int iHeight = hh | hl; unsigned short *data = new unsigned short[ iWidth*iHeight*2 ]; int srcIdx = 4; int dstIdx = 0; for(int j=0;j. // // $Revision: 22213 $ // //============================================================================= #ifndef _DEVICE_2_H #define _DEVICE_2_H #include namespace Tango { class DeviceClass; //============================================================================= // // The Device_2Impl class // // // description : This class is derived directly from the Tango::Device_skel // class generated by CORBA. It represents the CORBA // servant which will be accessed by the client. // It implements all the methods // and attributes defined in the IDL interface for Device. // //============================================================================= /** * Base class for all TANGO device since version 2. * * This class inherits from DeviceImpl class which itself inherits from * CORBA classes where all the network layer is implemented. * This class has been created since release 2 of Tango library where the IDL * Tango module has been modified in order to create a Device_2 interface * which inherits from the original Device interface * * $Author: taurel $ * $Revision: 22213 $ * * @headerfile tango.h * @ingroup Server */ class Device_2Impl : public virtual POA_Tango::Device_2, public DeviceImpl { public: /**@name Constructors * Miscellaneous constructors */ //@{ /** * Constructs a newly allocated Device_2Impl object from its name. * * The device description field is set to A Tango device. The device * state is set to unknown and the device status is set to * Not Initialised * * @param device_class Pointer to the device class object * @param dev_name The device name * */ Device_2Impl(DeviceClass *device_class,string &dev_name); /** * Constructs a newly allocated Device_2Impl object from its name and its description. * * The device * state is set to unknown and the device status is set to * Not Initialised * * @param device_class Pointer to the device class object * @param dev_name The device name * @param desc The device description * */ Device_2Impl(DeviceClass *device_class,string &dev_name,string &desc); /** * Constructs a newly allocated Device_2Impl object from all its creation * parameters. * * The device is constructed from its name, its description, an original state * and status * * @param device_class Pointer to the device class object * @param dev_name The device name * @param desc The device description * @param dev_state The device initial state * @param dev_status The device initial status * */ Device_2Impl(DeviceClass *device_class, string &dev_name,string &desc, Tango::DevState dev_state,string &dev_status); /** * Constructs a newly allocated Device_2Impl object from all its creation * parameters with some default values. * * The device is constructed from its name, its description, an original state * and status. This constructor defined default values for the description, * state and status parameters. The default device description is A TANGO device. * The default device state is UNKNOWN and the default device status * is Not initialised. * * @param device_class Pointer to the device class object * @param dev_name The device name * @param desc The device desc * @param dev_state The device initial state * @param dev_status The device initial status * */ Device_2Impl(DeviceClass *device_class, const char *dev_name,const char *desc = "A TANGO device", Tango::DevState dev_state = Tango::UNKNOWN, const char *dev_status = StatusNotSet); //@} /**@name Destructor * Only one desctructor is defined for this class */ //@{ /** * The device desctructor. */ virtual ~Device_2Impl() {} //@} /**@name CORBA operation methods * Method defined to implement TANGO device CORBA operation */ //@{ /** * Execute a command. * * It's the master method executed when a "command_inout_2" CORBA operation is * requested by a client. It updates the device black-box, call the * TANGO command handler and returned the output Any * * @param in_cmd The command name * @param in_data The command input data packed in a CORBA Any * @param source The data source. This parameter is new in Tango release 2. It * allows a client to choose the data source between the device itself or the * data cache for polled command. * @return The command output data packed in a CORBA Any object * @exception DevFailed Re-throw of the exception thrown by the command_handler * method. * Click here to read * DevFailed exception specification */ virtual CORBA::Any *command_inout_2(const char *in_cmd, const CORBA::Any &in_data, Tango::DevSource source); /** * Get device command list. * * Invoked when the client request the command_list_query_2 CORBA operation. * It updates the device black box and returns an array of DevCmdInfo_2 object * with one object for each command. * * @return The device command list. One DevCmdInfo_2 is initialised for each * device command. Since Tango release 2, the command display level field has * been added to this structure */ virtual Tango::DevCmdInfoList_2 *command_list_query_2(); /** * Get command info. * * Invoked when the client request the command_query_2 CORBA operation. * It updates the device black box and returns a DevCmdInfo_2 object for the * command with name passed * to the method as parameter. * * @param command The command name * @return A DevCmdInfo_2 initialised for the wanted command. * @exception DevFailed Thrown if the command does not exist. * Since Tango release 2, the command display level field has * been added to this structure. * Click here to read * DevFailed exception specification */ virtual Tango::DevCmdInfo_2 *command_query_2(const char *command); /** * Read attribute(s) value. * * Invoked when the client request the read_attributes_2 CORBA operation. * It returns to the client one AttributeValue structure for each wanted * attribute. * * @param names The attribute(s) name list * @param source The data source. This parameter is new in Tango release 2. It * allows a client to choose the data source between the device itself or the * data cache for polled attribute. * @return A sequence of AttributeValue structure. One structure is initialised * for each wanted attribute with the attribute value, the date and the attribute * value quality. Click here * to read AttributeValue structure definition. * @exception DevFailed Thrown if the attribute does not exist. * Click here to read * DevFailed exception specification */ virtual Tango::AttributeValueList *read_attributes_2(const Tango::DevVarStringArray& names, Tango::DevSource source); /** * Get attribute(s) configuration. * * Invoked when the client request the get_attribute_config_2 CORBA operation. * It returns to the client one AttributeConfig_2 structure for each wanted * attribute. All the attribute properties value are returned in this * AttributeConfig_2 structure. Since Tango release 2, the attribute display * level field has been added to this structure. * * @param names The attribute(s) name list * @return A sequence of AttributeConfig_2 structure. One structure is initialised * for each wanted attribute. Click here * to read AttributeConfig_2 structure specification. * * @exception DevFailed Thrown if the attribute does not exist. * Click here to read * DevFailed exception specification */ virtual Tango::AttributeConfigList_2 *get_attribute_config_2(const Tango::DevVarStringArray& names) throw(Tango::DevFailed, CORBA::SystemException); /** * Read attribute value history. * * Invoked when the client request the read_attribute_history_2 CORBA operation. * This operation allows a client to retrieve attribute value history for * polled attribute. The depth of the history is limited to the depth of * the device server internal polling buffer. * It returns to the client one DevAttrHistory structure for each record. * * @param name The attribute name * @param n The record number. * @return A sequence of DevAttrHistory structure. One structure is initialised * for each record with the attribute value, the date and in case of the attribute * returns an error when it was read, the DevErrors data. * Click here * to read DevAttrHistory structure definition. * @exception DevFailed Thrown if the attribute does not exist or is not polled. * Click here to read * DevFailed exception specification */ virtual Tango::DevAttrHistoryList *read_attribute_history_2(const char* name, CORBA::Long n) throw(Tango::DevFailed, CORBA::SystemException); /** * Read command value history. * * Invoked when the client request the command_inout_history_2 CORBA operation. * This operation allows a client to retrieve command return value history for * polled command. The depth of the history is limited to the depth of * the device server internal polling buffer. * It returns to the client one DevCmdHistory structure for each record. * * @param command The command name * @param n The record number. * @return A sequence of DevCmdHistory structure. One structure is initialised * for each record with the command return value (in an Any), the date * and in case of the command returns an error when it was read, the * DevErrors data. * Click here * to read DevCmdHistory structure definition. * @exception DevFailed Thrown if the attribute does not exist or is not polled. * Click here to read * DevFailed exception specification */ virtual Tango::DevCmdHistoryList *command_inout_history_2(const char* command, CORBA::Long n) throw(Tango::DevFailed, CORBA::SystemException); //@} private: CORBA::Any *attr2cmd(AttributeValue_3 &,bool,bool); CORBA::Any *attr2cmd(AttributeValue_4 &,bool,bool); void Hist_32Hist(DevAttrHistoryList_3 *,DevAttrHistoryList *); void Polled_2_Live(long,Tango::AttrValUnion &,CORBA::Any &); void Polled_2_Live(long,CORBA::Any &,CORBA::Any &); class Device_2ImplExt { }; #ifdef HAS_UNIQUE_PTR unique_ptr ext_2; // Class extension #else Device_2ImplExt *ext_2; #endif }; } // End of Tango namespace #endif // _DEVICE_H tango-8.1.2c+dfsg.orig/lib/cpp/server/dserver.h0000644000175000017500000001577712205375142020276 0ustar piccapicca//============================================================================= // // file : DServer.h // // description : Include for the DServer class. This class implements // all the commands which are available for device // of the DServer class. There is one device of the // DServer class for each device server process // // project : TANGO // // author(s) : A.Gotz + E.Taurel // // Copyright (C) : 2004,2005,2006,2007,2008,2009,2010,2011,2012,2013 // European Synchrotron Radiation Facility // BP 220, Grenoble 38043 // FRANCE // // This file is part of Tango. // // Tango 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. // // Tango 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 Tango. If not, see . // // $Revision: 22732 $ // //============================================================================= #ifndef _DSERVER_H #define _DSERVER_H #include namespace Tango { //============================================================================= // // The DServer class // // description : Class to implement all data members and commands for // device of the DServer class // //============================================================================= typedef Tango::DeviceClass *(*Cpp_creator_ptr)(const char *); typedef void (*ClassFactoryFuncPtr)(DServer *); class DServer: public TANGO_BASE_CLASS { public : DServer(DeviceClass *,const char *,const char *,Tango::DevState,const char *); ~DServer(); Tango::DevVarStringArray *query_class(); Tango::DevVarStringArray *query_device(); Tango::DevVarStringArray *query_sub_device(); void kill(); void restart(string &); void restart_server(); Tango::DevVarStringArray *query_class_prop(string &); Tango::DevVarStringArray *query_dev_prop(string &); Tango::DevVarStringArray *polled_device(); Tango::DevVarStringArray *dev_poll_status(string &); void add_obj_polling(const Tango::DevVarLongStringArray *,bool with_db_upd = true,int delta_ms = 0); void upd_obj_polling_period(const Tango::DevVarLongStringArray *,bool with_db_upd = true); void rem_obj_polling(const Tango::DevVarStringArray *,bool with_db_upd = true); void stop_polling(); void start_polling(); void start_polling(PollingThreadInfo *); void add_event_heartbeat(); void rem_event_heartbeat(); void lock_device(const Tango::DevVarLongStringArray *); Tango::DevLong un_lock_device(const Tango::DevVarLongStringArray *); void re_lock_devices(const Tango::DevVarStringArray *); Tango::DevVarLongStringArray *dev_lock_status(Tango::ConstDevString); Tango::DevLong event_subscription_change(const Tango::DevVarStringArray *); Tango::DevVarLongStringArray *zmq_event_subscription_change(const Tango::DevVarStringArray *); void event_confirm_subscription(const Tango::DevVarStringArray *); void delete_devices(); #ifdef TANGO_HAS_LOG4TANGO void add_logging_target (const Tango::DevVarStringArray *argin); void remove_logging_target (const Tango::DevVarStringArray *argin); Tango::DevVarStringArray* get_logging_target (const std::string& dev_name); void set_logging_level (const Tango::DevVarLongStringArray *argin); Tango::DevVarLongStringArray* get_logging_level (const Tango::DevVarStringArray *argin); void stop_logging (void); void start_logging (void); #endif string &get_process_name() {return process_name;} string &get_personal_name() {return instance_name;} string &get_instance_name() {return instance_name;} string &get_full_name() {return full_name;} string &get_fqdn() {return fqdn;} bool get_heartbeat_started() {return heartbeat_started;} void set_heartbeat_started(bool val) {heartbeat_started = val;} vector &get_class_list() {return class_list;} virtual void init_device(); unsigned long get_poll_th_pool_size() {return polling_th_pool_size;} void set_poll_th_pool_size(unsigned long val) {polling_th_pool_size = val;} bool get_opt_pool_usage() {return optimize_pool_usage;} vector get_poll_th_conf() {return polling_th_pool_conf;} void check_lock_owner(DeviceImpl *,const char *,const char *); void check_upd_authorized(DeviceImpl *,int,PollObjType,string &); TANGO_IMP_EXP static void register_class_factory(ClassFactoryFuncPtr f_ptr) {class_factory_func_ptr = f_ptr;} void _add_class(DeviceClass *dc) {this->add_class(dc);} void _create_cpp_class(const char *c1,const char *c2) {this->create_cpp_class(c1,c2);} void mcast_event_for_att(string &,string &,vector &); friend class NotifdEventSupplier; friend class ZmqEventSupplier; protected : string process_name; string instance_name; string full_name; string fqdn; vector class_list; time_t last_heartbeat; time_t last_heartbeat_zmq; bool heartbeat_started; unsigned long polling_th_pool_size; vector polling_th_pool_conf; bool optimize_pool_usage; static ClassFactoryFuncPtr class_factory_func_ptr; private: #if ((defined _TG_WINDOWS_) && (defined TANGO_HAS_DLL) && !(defined _TANGO_LIB)) __declspec(dllexport) void class_factory(); #else void class_factory(); #endif void add_class(DeviceClass *); void create_cpp_class(const char *,const char *); void get_dev_prop(Tango::Util *); void event_subscription(string &,string &,string &,string &,string &,ChannelType,string &,int &,int &,DeviceImpl *); void get_event_misc_prop(Tango::Util *); bool is_event_name(string &); bool is_ip_address(string &); bool from_constructor; vector mcast_event_prop; DevLong mcast_hops; DevLong mcast_rate; DevLong mcast_ivl; DevLong zmq_pub_event_hwm; DevLong zmq_sub_event_hwm; }; class KillThread: public omni_thread { public: void *run_undetached(void *); void start() {start_undetached();} }; class ServRestartThread: public omni_thread { public: ServRestartThread(DServer *dev):omni_thread(dev) {} void run(void *); }; struct Pol { PollObjType type; long upd; string name; }; /****************************************************************************** * * Some inline methods * ******************************************************************************/ inline bool DServer::is_event_name(string &str) { if (count(str.begin(),str.end(),'/') != 3) return false; if (count(str.begin(),str.end(),'.') != 1) return false; return true; } inline bool DServer::is_ip_address(string &str) { if (count(str.begin(),str.end(),'.') != 3) return false; return true; } } // End of namespace Tango #endif tango-8.1.2c+dfsg.orig/lib/cpp/server/tango_const.h0000644000175000017500000014132012205375142021122 0ustar piccapicca//============================================================================= // // file : Tango_const.h // // description : Include for Tango system constant definition // // project : TANGO // // author(s) : A.Gotz + E.Taurel // // Copyright (C) : 2004,2005,2006,2007,2008,2009,2010,2011,2012,2013 // European Synchrotron Radiation Facility // BP 220, Grenoble 38043 // FRANCE // // This file is part of Tango. // // Tango 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. // // Tango 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 Tango. If not, see . // // $Revision: 22732 $ // //============================================================================= #ifndef _TANGO_CONST_H #define _TANGO_CONST_H namespace Tango { // // Some general interest define // #define TANGO_VERSION_MAJOR 8 #define TANGO_VERSION_MINOR 1 #define TANGO_VERSION_PATCH 2 #define TANGO_BASE_CLASS Tango::Device_4Impl #define build_string(s) #s #define xbuild_string(s) build_string(s) #define TgLibVers xbuild_string(TANGO_VERSION_MAJOR.TANGO_VERSION_MINOR.TANGO_VERSION_PATCH) #define TgLibVersNb (TANGO_VERSION_MAJOR*10000 + TANGO_VERSION_MINOR*100 + TANGO_VERSION_MINOR) #define DevVersion 4 // IDL version number #define DefaultMaxSeq 20 #define DefaultBlackBoxDepth 50 #define DefaultPollRingDepth 10 #define InitialOutput "Initial Output" #define DSDeviceDomain "dserver" #define DefaultDocUrl "http://www.tango-controls.org" #define EnvVariable "TANGO_HOST" #define WindowsEnvVariable "TANGO_ROOT" #define DbObjName "database" #define NotSet "Uninitialised" #define ResNotDefined "0" #define MessBoxTitle "Tango Device Server" #define StatusNotSet "Not initialised" #define TangoHostNotSet "Undef" #define DefaultWritAttrProp false #define AllAttr "All attributes" #define AllAttr_3 "All attributes_3" #define PollCommand "command" #define PollAttribute "attribute" #define MIN_POLL_PERIOD 5 #define DELTA_T 1002000000 #define MIN_DELTA_WORK 20000 #define TIME_HEARTBEAT 2000 #define POLL_LOOP_NB 500 #define ONE_SECOND 1000000 #define DISCARD_THRESHOLD 0.02 #define DEFAULT_TIMEOUT 3200 #define DEFAULT_POLL_OLD_FACTOR 4 #define TG_IMP_MINOR_TO 10 #define TG_IMP_MINOR_DEVFAILED 11 #define TG_IMP_MINOR_NON_DEVFAILED 12 #define TANGO_PY_MOD_NAME "_PyTango.pyd" #define DATABASE_CLASS "DataBase" #define TANGO_FLOAT_PRECISION 15 // // Event related define // #define EVENT_HEARTBEAT_PERIOD 10 #define EVENT_RESUBSCRIBE_PERIOD 600 #define DEFAULT_EVENT_PERIOD 1000 #define DELTA_PERIODIC 0.98 // Using a delta of 2% only for times < 5000 ms #define DELTA_PERIODIC_LONG 100 // For times > 5000ms only keep a delta of 100ms #define HEARTBEAT "Event heartbeat" // // ZMQ event system related define // #define EPHEMERAL_PORT_BEGIN 55555 #define EPHEMERAL_PORT_END 65535 #define ZMQ_EVENT_PROT_VERSION 1 #define HEARTBEAT_METHOD_NAME "push_heartbeat_event" #define EVENT_METHOD_NAME "push_zmq_event" #define HEARTBEAT_EVENT_NAME "heartbeat" #define CTRL_SOCK_ENDPOINT "inproc://control" #define MCAST_PROT "epgm://" #define MCAST_HOPS 5 #define PGM_RATE 80 * 1024 #define PGM_IVL 20 * 1000 #define MAX_SOCKET_SUB 10 #define PUB_HWM 1000 #define SUB_HWM 1000 #define SUB_SEND_HWM 10000 #define ZMQ_END 0 #define ZMQ_CONNECT_HEARTBEAT 1 #define ZMQ_DISCONNECT_HEARTBEAT 2 #define ZMQ_CONNECT_EVENT 3 #define ZMQ_DISCONNECT_EVENT 4 #define ZMQ_CONNECT_MCAST_EVENT 5 #define ZMQ_DELAY_EVENT 6 #define ZMQ_RELEASE_EVENT 7 // // Event when using a file as database stuff // #define NOTIFD_CHANNEL "notifd_channel" // // Locking feature related defines // #define DEFAULT_LOCK_VALIDITY 10 #define DEVICE_UNLOCKED_REASON API_DeviceUnlocked #define MIN_LOCK_VALIDITY 2 #define LOCAL_HOST "localhost" // // Client timeout as defined by omniORB4.0.0 // #define CLNT_TIMEOUT_STR "3000" #define CLNT_TIMEOUT 3000 #define NARROW_CLNT_TIMEOUT 100 // // Connection and call timeout for database device // #define DB_CONNECT_TIMEOUT 25000 #define DB_RECONNECT_TIMEOUT 20000 #define DB_TIMEOUT 13000 #define DB_START_PHASE_RETRIES 3 // // Time to wait before trying to reconnect after // a connevtion failure // #define RECONNECTION_DELAY 1000 //ms. Only try to reconnect every second // // Access Control related defines // WARNING: these string are also used within the Db stored procedure // introduced in Tango V6.1. If you chang eit here, don't forget to // also update the stored procedure // #define CONTROL_SYSTEM "CtrlSystem" #define SERVICE_PROP_NAME "Services" #define ACCESS_SERVICE "AccessControl" // // Polling threads pool related defines // #define DEFAULT_POLLING_THREADS_POOL_SIZE 1 // // Max transfer size 256 MBytes (in byte). Needed by omniORB // #define MAX_TRANSFER_SIZE "268435456" // // Tango name length // #define MaxServerNameLength 255 #define MaxDevPropLength 255 // // Files used to retrieve env. variables // #define USER_ENV_VAR_FILE ".tangorc" #ifndef HAVE_CONFIG_H #define TANGO_RC_FILE "/etc/tangorc" #endif #define WINDOWS_ENV_VAR_FILE "tangorc" // // A short inline function to hide the CORBA::string_dup function // inline char * string_dup(char *s) {return CORBA::string_dup(s);} inline char * string_dup(const char *s) {return CORBA::string_dup(s);} // // Many, many typedef // typedef const char * ConstDevString; // Pseudo Tango type to ease POGO job typedef DevVarCharArray DevVarUCharArray; class DeviceImpl; typedef bool (DeviceImpl::*StateMethPtr)(const CORBA::Any &); typedef void (DeviceImpl::*CmdMethPtr)(); typedef void (DeviceImpl::*CmdMethPtr_Bo)(DevBoolean); typedef void (DeviceImpl::*CmdMethPtr_Sh)(DevShort); typedef void (DeviceImpl::*CmdMethPtr_Lg)(DevLong); typedef void (DeviceImpl::*CmdMethPtr_Fl)(DevFloat); typedef void (DeviceImpl::*CmdMethPtr_Db)(DevDouble); typedef void (DeviceImpl::*CmdMethPtr_US)(DevUShort); typedef void (DeviceImpl::*CmdMethPtr_UL)(DevULong); typedef void (DeviceImpl::*CmdMethPtr_Str)(DevString); typedef void (DeviceImpl::*CmdMethPtr_ChA)(const DevVarCharArray *); typedef void (DeviceImpl::*CmdMethPtr_ShA)(const DevVarShortArray *); typedef void (DeviceImpl::*CmdMethPtr_LgA)(const DevVarLongArray *); typedef void (DeviceImpl::*CmdMethPtr_FlA)(const DevVarFloatArray *); typedef void (DeviceImpl::*CmdMethPtr_DbA)(const DevVarDoubleArray *); typedef void (DeviceImpl::*CmdMethPtr_USA)(const DevVarUShortArray *); typedef void (DeviceImpl::*CmdMethPtr_ULA)(const DevVarULongArray *); typedef void (DeviceImpl::*CmdMethPtr_StrA)(const DevVarStringArray *); typedef void (DeviceImpl::*CmdMethPtr_LSA)(const DevVarLongStringArray *); typedef void (DeviceImpl::*CmdMethPtr_DSA)(const DevVarDoubleStringArray *); typedef void (DeviceImpl::*CmdMethPtr_Sta)(DevState); typedef DevBoolean (DeviceImpl::*Bo_CmdMethPtr)(); typedef DevShort (DeviceImpl::*Sh_CmdMethPtr)(); typedef DevLong (DeviceImpl::*Lg_CmdMethPtr)(); typedef DevFloat (DeviceImpl::*Fl_CmdMethPtr)(); typedef DevDouble (DeviceImpl::*Db_CmdMethPtr)(); typedef DevUShort (DeviceImpl::*US_CmdMethPtr)(); typedef DevULong (DeviceImpl::*UL_CmdMethPtr)(); typedef DevString (DeviceImpl::*Str_CmdMethPtr)(); typedef DevVarCharArray *(DeviceImpl::*ChA_CmdMethPtr)(); typedef DevVarShortArray *(DeviceImpl::*ShA_CmdMethPtr)(); typedef DevVarLongArray *(DeviceImpl::*LgA_CmdMethPtr)(); typedef DevVarFloatArray *(DeviceImpl::*FlA_CmdMethPtr)(); typedef DevVarDoubleArray *(DeviceImpl::*DbA_CmdMethPtr)(); typedef DevVarUShortArray *(DeviceImpl::*USA_CmdMethPtr)(); typedef DevVarULongArray *(DeviceImpl::*ULA_CmdMethPtr)(); typedef DevVarStringArray *(DeviceImpl::*StrA_CmdMethPtr)(); typedef DevVarLongStringArray *(DeviceImpl::*LSA_CmdMethPtr)(); typedef DevVarDoubleStringArray *(DeviceImpl::*DSA_CmdMethPtr)(); typedef DevState (DeviceImpl::*Sta_CmdMethPtr)(); typedef DevBoolean (DeviceImpl::*Bo_CmdMethPtr_Bo)(DevBoolean); typedef DevBoolean (DeviceImpl::*Bo_CmdMethPtr_Sh)(DevShort); typedef DevBoolean (DeviceImpl::*Bo_CmdMethPtr_Lg)(DevLong); typedef DevBoolean (DeviceImpl::*Bo_CmdMethPtr_Fl)(DevFloat); typedef DevBoolean (DeviceImpl::*Bo_CmdMethPtr_Db)(DevDouble); typedef DevBoolean (DeviceImpl::*Bo_CmdMethPtr_US)(DevUShort); typedef DevBoolean (DeviceImpl::*Bo_CmdMethPtr_UL)(DevULong); typedef DevBoolean (DeviceImpl::*Bo_CmdMethPtr_Str)(DevString); typedef DevBoolean (DeviceImpl::*Bo_CmdMethPtr_ChA)(const DevVarCharArray *); typedef DevBoolean (DeviceImpl::*Bo_CmdMethPtr_ShA)(const DevVarShortArray *); typedef DevBoolean (DeviceImpl::*Bo_CmdMethPtr_LgA)(const DevVarLongArray *); typedef DevBoolean (DeviceImpl::*Bo_CmdMethPtr_FlA)(const DevVarFloatArray *); typedef DevBoolean (DeviceImpl::*Bo_CmdMethPtr_DbA)(const DevVarDoubleArray *); typedef DevBoolean (DeviceImpl::*Bo_CmdMethPtr_USA)(const DevVarUShortArray *); typedef DevBoolean (DeviceImpl::*Bo_CmdMethPtr_ULA)(const DevVarULongArray *); typedef DevBoolean (DeviceImpl::*Bo_CmdMethPtr_StrA)(const DevVarStringArray *); typedef DevBoolean (DeviceImpl::*Bo_CmdMethPtr_LSA)(const DevVarLongStringArray *); typedef DevBoolean (DeviceImpl::*Bo_CmdMethPtr_DSA)(const DevVarDoubleStringArray *); typedef DevBoolean (DeviceImpl::*Bo_CmdMethPtr_Sta)(DevState); typedef DevShort (DeviceImpl::*Sh_CmdMethPtr_Bo)(DevBoolean); typedef DevShort (DeviceImpl::*Sh_CmdMethPtr_Sh)(DevShort); typedef DevShort (DeviceImpl::*Sh_CmdMethPtr_Lg)(DevLong); typedef DevShort (DeviceImpl::*Sh_CmdMethPtr_Fl)(DevFloat); typedef DevShort (DeviceImpl::*Sh_CmdMethPtr_Db)(DevDouble); typedef DevShort (DeviceImpl::*Sh_CmdMethPtr_US)(DevUShort); typedef DevShort (DeviceImpl::*Sh_CmdMethPtr_UL)(DevULong); typedef DevShort (DeviceImpl::*Sh_CmdMethPtr_Str)(DevString); typedef DevShort (DeviceImpl::*Sh_CmdMethPtr_ChA)(const DevVarCharArray *); typedef DevShort (DeviceImpl::*Sh_CmdMethPtr_ShA)(const DevVarShortArray *); typedef DevShort (DeviceImpl::*Sh_CmdMethPtr_LgA)(const DevVarLongArray *); typedef DevShort (DeviceImpl::*Sh_CmdMethPtr_FlA)(const DevVarFloatArray *); typedef DevShort (DeviceImpl::*Sh_CmdMethPtr_DbA)(const DevVarDoubleArray *); typedef DevShort (DeviceImpl::*Sh_CmdMethPtr_USA)(const DevVarUShortArray *); typedef DevShort (DeviceImpl::*Sh_CmdMethPtr_ULA)(const DevVarULongArray *); typedef DevShort (DeviceImpl::*Sh_CmdMethPtr_StrA)(const DevVarStringArray *); typedef DevShort (DeviceImpl::*Sh_CmdMethPtr_LSA)(const DevVarLongStringArray *); typedef DevShort (DeviceImpl::*Sh_CmdMethPtr_DSA)(const DevVarDoubleStringArray *); typedef DevShort (DeviceImpl::*Sh_CmdMethPtr_Sta)(DevState); typedef DevLong (DeviceImpl::*Lg_CmdMethPtr_Bo)(DevBoolean); typedef DevLong (DeviceImpl::*Lg_CmdMethPtr_Sh)(DevShort); typedef DevLong (DeviceImpl::*Lg_CmdMethPtr_Lg)(DevLong); typedef DevLong (DeviceImpl::*Lg_CmdMethPtr_Fl)(DevFloat); typedef DevLong (DeviceImpl::*Lg_CmdMethPtr_Db)(DevDouble); typedef DevLong (DeviceImpl::*Lg_CmdMethPtr_US)(DevUShort); typedef DevLong (DeviceImpl::*Lg_CmdMethPtr_UL)(DevULong); typedef DevLong (DeviceImpl::*Lg_CmdMethPtr_Str)(DevString); typedef DevLong (DeviceImpl::*Lg_CmdMethPtr_ChA)(const DevVarCharArray *); typedef DevLong (DeviceImpl::*Lg_CmdMethPtr_ShA)(const DevVarShortArray *); typedef DevLong (DeviceImpl::*Lg_CmdMethPtr_LgA)(const DevVarLongArray *); typedef DevLong (DeviceImpl::*Lg_CmdMethPtr_FlA)(const DevVarFloatArray *); typedef DevLong (DeviceImpl::*Lg_CmdMethPtr_DbA)(const DevVarDoubleArray *); typedef DevLong (DeviceImpl::*Lg_CmdMethPtr_USA)(const DevVarUShortArray *); typedef DevLong (DeviceImpl::*Lg_CmdMethPtr_ULA)(const DevVarULongArray *); typedef DevLong (DeviceImpl::*Lg_CmdMethPtr_StrA)(const DevVarStringArray *); typedef DevLong (DeviceImpl::*Lg_CmdMethPtr_LSA)(const DevVarLongStringArray *); typedef DevLong (DeviceImpl::*Lg_CmdMethPtr_DSA)(const DevVarDoubleStringArray *); typedef DevLong (DeviceImpl::*Lg_CmdMethPtr_Sta)(DevState); typedef DevFloat (DeviceImpl::*Fl_CmdMethPtr_Bo)(DevBoolean); typedef DevFloat (DeviceImpl::*Fl_CmdMethPtr_Sh)(DevShort); typedef DevFloat (DeviceImpl::*Fl_CmdMethPtr_Lg)(DevLong); typedef DevFloat (DeviceImpl::*Fl_CmdMethPtr_Fl)(DevFloat); typedef DevFloat (DeviceImpl::*Fl_CmdMethPtr_Db)(DevDouble); typedef DevFloat (DeviceImpl::*Fl_CmdMethPtr_US)(DevUShort); typedef DevFloat (DeviceImpl::*Fl_CmdMethPtr_UL)(DevULong); typedef DevFloat (DeviceImpl::*Fl_CmdMethPtr_Str)(DevString); typedef DevFloat (DeviceImpl::*Fl_CmdMethPtr_ChA)(const DevVarCharArray *); typedef DevFloat (DeviceImpl::*Fl_CmdMethPtr_ShA)(const DevVarShortArray *); typedef DevFloat (DeviceImpl::*Fl_CmdMethPtr_LgA)(const DevVarLongArray *); typedef DevFloat (DeviceImpl::*Fl_CmdMethPtr_FlA)(const DevVarFloatArray *); typedef DevFloat (DeviceImpl::*Fl_CmdMethPtr_DbA)(const DevVarDoubleArray *); typedef DevFloat (DeviceImpl::*Fl_CmdMethPtr_USA)(const DevVarUShortArray *); typedef DevFloat (DeviceImpl::*Fl_CmdMethPtr_ULA)(const DevVarULongArray *); typedef DevFloat (DeviceImpl::*Fl_CmdMethPtr_StrA)(const DevVarStringArray *); typedef DevFloat (DeviceImpl::*Fl_CmdMethPtr_LSA)(const DevVarLongStringArray *); typedef DevFloat (DeviceImpl::*Fl_CmdMethPtr_DSA)(const DevVarDoubleStringArray *); typedef DevFloat (DeviceImpl::*Fl_CmdMethPtr_Sta)(DevState); typedef DevDouble (DeviceImpl::*Db_CmdMethPtr_Bo)(DevBoolean); typedef DevDouble (DeviceImpl::*Db_CmdMethPtr_Sh)(DevShort); typedef DevDouble (DeviceImpl::*Db_CmdMethPtr_Lg)(DevLong); typedef DevDouble (DeviceImpl::*Db_CmdMethPtr_Fl)(DevFloat); typedef DevDouble (DeviceImpl::*Db_CmdMethPtr_Db)(DevDouble); typedef DevDouble (DeviceImpl::*Db_CmdMethPtr_US)(DevUShort); typedef DevDouble (DeviceImpl::*Db_CmdMethPtr_UL)(DevULong); typedef DevDouble (DeviceImpl::*Db_CmdMethPtr_Str)(DevString); typedef DevDouble (DeviceImpl::*Db_CmdMethPtr_ChA)(const DevVarCharArray *); typedef DevDouble (DeviceImpl::*Db_CmdMethPtr_ShA)(const DevVarShortArray *); typedef DevDouble (DeviceImpl::*Db_CmdMethPtr_LgA)(const DevVarLongArray *); typedef DevDouble (DeviceImpl::*Db_CmdMethPtr_FlA)(const DevVarFloatArray *); typedef DevDouble (DeviceImpl::*Db_CmdMethPtr_DbA)(const DevVarDoubleArray *); typedef DevDouble (DeviceImpl::*Db_CmdMethPtr_USA)(const DevVarUShortArray *); typedef DevDouble (DeviceImpl::*Db_CmdMethPtr_ULA)(const DevVarULongArray *); typedef DevDouble (DeviceImpl::*Db_CmdMethPtr_StrA)(const DevVarStringArray *); typedef DevDouble (DeviceImpl::*Db_CmdMethPtr_LSA)(const DevVarLongStringArray *); typedef DevDouble (DeviceImpl::*Db_CmdMethPtr_DSA)(const DevVarDoubleStringArray *); typedef DevDouble (DeviceImpl::*Db_CmdMethPtr_Sta)(DevState); typedef DevUShort (DeviceImpl::*US_CmdMethPtr_Bo)(DevBoolean); typedef DevUShort (DeviceImpl::*US_CmdMethPtr_Sh)(DevShort); typedef DevUShort (DeviceImpl::*US_CmdMethPtr_Lg)(DevLong); typedef DevUShort (DeviceImpl::*US_CmdMethPtr_Fl)(DevFloat); typedef DevUShort (DeviceImpl::*US_CmdMethPtr_Db)(DevDouble); typedef DevUShort (DeviceImpl::*US_CmdMethPtr_US)(DevUShort); typedef DevUShort (DeviceImpl::*US_CmdMethPtr_UL)(DevULong); typedef DevUShort (DeviceImpl::*US_CmdMethPtr_Str)(DevString); typedef DevUShort (DeviceImpl::*US_CmdMethPtr_ChA)(const DevVarCharArray *); typedef DevUShort (DeviceImpl::*US_CmdMethPtr_ShA)(const DevVarShortArray *); typedef DevUShort (DeviceImpl::*US_CmdMethPtr_LgA)(const DevVarLongArray *); typedef DevUShort (DeviceImpl::*US_CmdMethPtr_FlA)(const DevVarFloatArray *); typedef DevUShort (DeviceImpl::*US_CmdMethPtr_DbA)(const DevVarDoubleArray *); typedef DevUShort (DeviceImpl::*US_CmdMethPtr_USA)(const DevVarUShortArray *); typedef DevUShort (DeviceImpl::*US_CmdMethPtr_ULA)(const DevVarULongArray *); typedef DevUShort (DeviceImpl::*US_CmdMethPtr_StrA)(const DevVarStringArray *); typedef DevUShort (DeviceImpl::*US_CmdMethPtr_LSA)(const DevVarLongStringArray *); typedef DevUShort (DeviceImpl::*US_CmdMethPtr_DSA)(const DevVarDoubleStringArray *); typedef DevUShort (DeviceImpl::*US_CmdMethPtr_Sta)(DevState); typedef DevULong (DeviceImpl::*UL_CmdMethPtr_Bo)(DevBoolean); typedef DevULong (DeviceImpl::*UL_CmdMethPtr_Sh)(DevShort); typedef DevULong (DeviceImpl::*UL_CmdMethPtr_Lg)(DevLong); typedef DevULong (DeviceImpl::*UL_CmdMethPtr_Fl)(DevFloat); typedef DevULong (DeviceImpl::*UL_CmdMethPtr_Db)(DevDouble); typedef DevULong (DeviceImpl::*UL_CmdMethPtr_US)(DevUShort); typedef DevULong (DeviceImpl::*UL_CmdMethPtr_UL)(DevULong); typedef DevULong (DeviceImpl::*UL_CmdMethPtr_Str)(DevString); typedef DevULong (DeviceImpl::*UL_CmdMethPtr_ChA)(const DevVarCharArray *); typedef DevULong (DeviceImpl::*UL_CmdMethPtr_ShA)(const DevVarShortArray *); typedef DevULong (DeviceImpl::*UL_CmdMethPtr_LgA)(const DevVarLongArray *); typedef DevULong (DeviceImpl::*UL_CmdMethPtr_FlA)(const DevVarFloatArray *); typedef DevULong (DeviceImpl::*UL_CmdMethPtr_DbA)(const DevVarDoubleArray *); typedef DevULong (DeviceImpl::*UL_CmdMethPtr_USA)(const DevVarUShortArray *); typedef DevULong (DeviceImpl::*UL_CmdMethPtr_ULA)(const DevVarULongArray *); typedef DevULong (DeviceImpl::*UL_CmdMethPtr_StrA)(const DevVarStringArray *); typedef DevULong (DeviceImpl::*UL_CmdMethPtr_LSA)(const DevVarLongStringArray *); typedef DevULong (DeviceImpl::*UL_CmdMethPtr_DSA)(const DevVarDoubleStringArray *); typedef DevULong (DeviceImpl::*UL_CmdMethPtr_Sta)(DevState); typedef DevString (DeviceImpl::*Str_CmdMethPtr_Bo)(DevBoolean); typedef DevString (DeviceImpl::*Str_CmdMethPtr_Sh)(DevShort); typedef DevString (DeviceImpl::*Str_CmdMethPtr_Lg)(DevLong); typedef DevString (DeviceImpl::*Str_CmdMethPtr_Fl)(DevFloat); typedef DevString (DeviceImpl::*Str_CmdMethPtr_Db)(DevDouble); typedef DevString (DeviceImpl::*Str_CmdMethPtr_US)(DevUShort); typedef DevString (DeviceImpl::*Str_CmdMethPtr_UL)(DevULong); typedef DevString (DeviceImpl::*Str_CmdMethPtr_Str)(DevString); typedef DevString (DeviceImpl::*Str_CmdMethPtr_ChA)(const DevVarCharArray *); typedef DevString (DeviceImpl::*Str_CmdMethPtr_ShA)(const DevVarShortArray *); typedef DevString (DeviceImpl::*Str_CmdMethPtr_LgA)(const DevVarLongArray *); typedef DevString (DeviceImpl::*Str_CmdMethPtr_FlA)(const DevVarFloatArray *); typedef DevString (DeviceImpl::*Str_CmdMethPtr_DbA)(const DevVarDoubleArray *); typedef DevString (DeviceImpl::*Str_CmdMethPtr_USA)(const DevVarUShortArray *); typedef DevString (DeviceImpl::*Str_CmdMethPtr_ULA)(const DevVarULongArray *); typedef DevString (DeviceImpl::*Str_CmdMethPtr_StrA)(const DevVarStringArray *); typedef DevString (DeviceImpl::*Str_CmdMethPtr_LSA)(const DevVarLongStringArray *); typedef DevString (DeviceImpl::*Str_CmdMethPtr_DSA)(const DevVarDoubleStringArray *); typedef DevString (DeviceImpl::*Str_CmdMethPtr_Sta)(DevState); typedef DevVarCharArray *(DeviceImpl::*ChA_CmdMethPtr_Bo)(DevBoolean); typedef DevVarCharArray *(DeviceImpl::*ChA_CmdMethPtr_Sh)(DevShort); typedef DevVarCharArray *(DeviceImpl::*ChA_CmdMethPtr_Lg)(DevLong); typedef DevVarCharArray *(DeviceImpl::*ChA_CmdMethPtr_Fl)(DevFloat); typedef DevVarCharArray *(DeviceImpl::*ChA_CmdMethPtr_Db)(DevDouble); typedef DevVarCharArray *(DeviceImpl::*ChA_CmdMethPtr_US)(DevUShort); typedef DevVarCharArray *(DeviceImpl::*ChA_CmdMethPtr_UL)(DevULong); typedef DevVarCharArray *(DeviceImpl::*ChA_CmdMethPtr_Str)(DevString); typedef DevVarCharArray *(DeviceImpl::*ChA_CmdMethPtr_ChA)(const DevVarCharArray *); typedef DevVarCharArray *(DeviceImpl::*ChA_CmdMethPtr_ShA)(const DevVarShortArray *); typedef DevVarCharArray *(DeviceImpl::*ChA_CmdMethPtr_LgA)(const DevVarLongArray *); typedef DevVarCharArray *(DeviceImpl::*ChA_CmdMethPtr_FlA)(const DevVarFloatArray *); typedef DevVarCharArray *(DeviceImpl::*ChA_CmdMethPtr_DbA)(const DevVarDoubleArray *); typedef DevVarCharArray *(DeviceImpl::*ChA_CmdMethPtr_USA)(const DevVarUShortArray *); typedef DevVarCharArray *(DeviceImpl::*ChA_CmdMethPtr_ULA)(const DevVarULongArray *); typedef DevVarCharArray *(DeviceImpl::*ChA_CmdMethPtr_StrA)(const DevVarStringArray *); typedef DevVarCharArray *(DeviceImpl::*ChA_CmdMethPtr_LSA)(const DevVarLongStringArray *); typedef DevVarCharArray *(DeviceImpl::*ChA_CmdMethPtr_DSA)(const DevVarDoubleStringArray *); typedef DevVarCharArray *(DeviceImpl::*ChA_CmdMethPtr_Sta)(DevState); typedef DevVarShortArray *(DeviceImpl::*ShA_CmdMethPtr_Bo)(DevBoolean); typedef DevVarShortArray *(DeviceImpl::*ShA_CmdMethPtr_Sh)(DevShort); typedef DevVarShortArray *(DeviceImpl::*ShA_CmdMethPtr_Lg)(DevLong); typedef DevVarShortArray *(DeviceImpl::*ShA_CmdMethPtr_Fl)(DevFloat); typedef DevVarShortArray *(DeviceImpl::*ShA_CmdMethPtr_Db)(DevDouble); typedef DevVarShortArray *(DeviceImpl::*ShA_CmdMethPtr_US)(DevUShort); typedef DevVarShortArray *(DeviceImpl::*ShA_CmdMethPtr_UL)(DevULong); typedef DevVarShortArray *(DeviceImpl::*ShA_CmdMethPtr_Str)(DevString); typedef DevVarShortArray *(DeviceImpl::*ShA_CmdMethPtr_ChA)(const DevVarCharArray *); typedef DevVarShortArray *(DeviceImpl::*ShA_CmdMethPtr_ShA)(const DevVarShortArray *); typedef DevVarShortArray *(DeviceImpl::*ShA_CmdMethPtr_LgA)(const DevVarLongArray *); typedef DevVarShortArray *(DeviceImpl::*ShA_CmdMethPtr_FlA)(const DevVarFloatArray *); typedef DevVarShortArray *(DeviceImpl::*ShA_CmdMethPtr_DbA)(const DevVarDoubleArray *); typedef DevVarShortArray *(DeviceImpl::*ShA_CmdMethPtr_USA)(const DevVarUShortArray *); typedef DevVarShortArray *(DeviceImpl::*ShA_CmdMethPtr_ULA)(const DevVarULongArray *); typedef DevVarShortArray *(DeviceImpl::*ShA_CmdMethPtr_StrA)(const DevVarStringArray *); typedef DevVarShortArray *(DeviceImpl::*ShA_CmdMethPtr_LSA)(const DevVarLongStringArray *); typedef DevVarShortArray *(DeviceImpl::*ShA_CmdMethPtr_DSA)(const DevVarDoubleStringArray *); typedef DevVarShortArray *(DeviceImpl::*ShA_CmdMethPtr_Sta)(DevState); typedef DevVarLongArray *(DeviceImpl::*LgA_CmdMethPtr_Bo)(DevBoolean); typedef DevVarLongArray *(DeviceImpl::*LgA_CmdMethPtr_Sh)(DevShort); typedef DevVarLongArray *(DeviceImpl::*LgA_CmdMethPtr_Lg)(DevLong); typedef DevVarLongArray *(DeviceImpl::*LgA_CmdMethPtr_Fl)(DevFloat); typedef DevVarLongArray *(DeviceImpl::*LgA_CmdMethPtr_Db)(DevDouble); typedef DevVarLongArray *(DeviceImpl::*LgA_CmdMethPtr_US)(DevUShort); typedef DevVarLongArray *(DeviceImpl::*LgA_CmdMethPtr_UL)(DevULong); typedef DevVarLongArray *(DeviceImpl::*LgA_CmdMethPtr_Str)(DevString); typedef DevVarLongArray *(DeviceImpl::*LgA_CmdMethPtr_ChA)(const DevVarCharArray *); typedef DevVarLongArray *(DeviceImpl::*LgA_CmdMethPtr_ShA)(const DevVarShortArray *); typedef DevVarLongArray *(DeviceImpl::*LgA_CmdMethPtr_LgA)(const DevVarLongArray *); typedef DevVarLongArray *(DeviceImpl::*LgA_CmdMethPtr_FlA)(const DevVarFloatArray *); typedef DevVarLongArray *(DeviceImpl::*LgA_CmdMethPtr_DbA)(const DevVarDoubleArray *); typedef DevVarLongArray *(DeviceImpl::*LgA_CmdMethPtr_USA)(const DevVarUShortArray *); typedef DevVarLongArray *(DeviceImpl::*LgA_CmdMethPtr_ULA)(const DevVarULongArray *); typedef DevVarLongArray *(DeviceImpl::*LgA_CmdMethPtr_StrA)(const DevVarStringArray *); typedef DevVarLongArray *(DeviceImpl::*LgA_CmdMethPtr_LSA)(const DevVarLongStringArray *); typedef DevVarLongArray *(DeviceImpl::*LgA_CmdMethPtr_DSA)(const DevVarDoubleStringArray *); typedef DevVarLongArray *(DeviceImpl::*LgA_CmdMethPtr_Sta)(DevState); typedef DevVarFloatArray *(DeviceImpl::*FlA_CmdMethPtr_Bo)(DevBoolean); typedef DevVarFloatArray *(DeviceImpl::*FlA_CmdMethPtr_Sh)(DevShort); typedef DevVarFloatArray *(DeviceImpl::*FlA_CmdMethPtr_Lg)(DevLong); typedef DevVarFloatArray *(DeviceImpl::*FlA_CmdMethPtr_Fl)(DevFloat); typedef DevVarFloatArray *(DeviceImpl::*FlA_CmdMethPtr_Db)(DevDouble); typedef DevVarFloatArray *(DeviceImpl::*FlA_CmdMethPtr_US)(DevUShort); typedef DevVarFloatArray *(DeviceImpl::*FlA_CmdMethPtr_UL)(DevULong); typedef DevVarFloatArray *(DeviceImpl::*FlA_CmdMethPtr_Str)(DevString); typedef DevVarFloatArray *(DeviceImpl::*FlA_CmdMethPtr_ChA)(const DevVarCharArray *); typedef DevVarFloatArray *(DeviceImpl::*FlA_CmdMethPtr_ShA)(const DevVarShortArray *); typedef DevVarFloatArray *(DeviceImpl::*FlA_CmdMethPtr_LgA)(const DevVarLongArray *); typedef DevVarFloatArray *(DeviceImpl::*FlA_CmdMethPtr_FlA)(const DevVarFloatArray *); typedef DevVarFloatArray *(DeviceImpl::*FlA_CmdMethPtr_DbA)(const DevVarDoubleArray *); typedef DevVarFloatArray *(DeviceImpl::*FlA_CmdMethPtr_USA)(const DevVarUShortArray *); typedef DevVarFloatArray *(DeviceImpl::*FlA_CmdMethPtr_ULA)(const DevVarULongArray *); typedef DevVarFloatArray *(DeviceImpl::*FlA_CmdMethPtr_StrA)(const DevVarStringArray *); typedef DevVarFloatArray *(DeviceImpl::*FlA_CmdMethPtr_LSA)(const DevVarLongStringArray *); typedef DevVarFloatArray *(DeviceImpl::*FlA_CmdMethPtr_DSA)(const DevVarDoubleStringArray *); typedef DevVarFloatArray *(DeviceImpl::*FlA_CmdMethPtr_Sta)(DevState); typedef DevVarDoubleArray *(DeviceImpl::*DbA_CmdMethPtr_Bo)(DevBoolean); typedef DevVarDoubleArray *(DeviceImpl::*DbA_CmdMethPtr_Sh)(DevShort); typedef DevVarDoubleArray *(DeviceImpl::*DbA_CmdMethPtr_Lg)(DevLong); typedef DevVarDoubleArray *(DeviceImpl::*DbA_CmdMethPtr_Fl)(DevFloat); typedef DevVarDoubleArray *(DeviceImpl::*DbA_CmdMethPtr_Db)(DevDouble); typedef DevVarDoubleArray *(DeviceImpl::*DbA_CmdMethPtr_US)(DevUShort); typedef DevVarDoubleArray *(DeviceImpl::*DbA_CmdMethPtr_UL)(DevULong); typedef DevVarDoubleArray *(DeviceImpl::*DbA_CmdMethPtr_Str)(DevString); typedef DevVarDoubleArray *(DeviceImpl::*DbA_CmdMethPtr_ChA)(const DevVarCharArray *); typedef DevVarDoubleArray *(DeviceImpl::*DbA_CmdMethPtr_ShA)(const DevVarShortArray *); typedef DevVarDoubleArray *(DeviceImpl::*DbA_CmdMethPtr_LgA)(const DevVarLongArray *); typedef DevVarDoubleArray *(DeviceImpl::*DbA_CmdMethPtr_FlA)(const DevVarFloatArray *); typedef DevVarDoubleArray *(DeviceImpl::*DbA_CmdMethPtr_DbA)(const DevVarDoubleArray *); typedef DevVarDoubleArray *(DeviceImpl::*DbA_CmdMethPtr_USA)(const DevVarUShortArray *); typedef DevVarDoubleArray *(DeviceImpl::*DbA_CmdMethPtr_ULA)(const DevVarULongArray *); typedef DevVarDoubleArray *(DeviceImpl::*DbA_CmdMethPtr_StrA)(const DevVarStringArray *); typedef DevVarDoubleArray *(DeviceImpl::*DbA_CmdMethPtr_LSA)(const DevVarLongStringArray *); typedef DevVarDoubleArray *(DeviceImpl::*DbA_CmdMethPtr_DSA)(const DevVarDoubleStringArray *); typedef DevVarDoubleArray *(DeviceImpl::*DbA_CmdMethPtr_Sta)(DevState); typedef DevVarUShortArray *(DeviceImpl::*USA_CmdMethPtr_Bo)(DevBoolean); typedef DevVarUShortArray *(DeviceImpl::*USA_CmdMethPtr_Sh)(DevShort); typedef DevVarUShortArray *(DeviceImpl::*USA_CmdMethPtr_Lg)(DevLong); typedef DevVarUShortArray *(DeviceImpl::*USA_CmdMethPtr_Fl)(DevFloat); typedef DevVarUShortArray *(DeviceImpl::*USA_CmdMethPtr_Db)(DevDouble); typedef DevVarUShortArray *(DeviceImpl::*USA_CmdMethPtr_US)(DevUShort); typedef DevVarUShortArray *(DeviceImpl::*USA_CmdMethPtr_UL)(DevULong); typedef DevVarUShortArray *(DeviceImpl::*USA_CmdMethPtr_Str)(DevString); typedef DevVarUShortArray *(DeviceImpl::*USA_CmdMethPtr_ChA)(const DevVarCharArray *); typedef DevVarUShortArray *(DeviceImpl::*USA_CmdMethPtr_ShA)(const DevVarShortArray *); typedef DevVarUShortArray *(DeviceImpl::*USA_CmdMethPtr_LgA)(const DevVarLongArray *); typedef DevVarUShortArray *(DeviceImpl::*USA_CmdMethPtr_FlA)(const DevVarFloatArray *); typedef DevVarUShortArray *(DeviceImpl::*USA_CmdMethPtr_DbA)(const DevVarDoubleArray *); typedef DevVarUShortArray *(DeviceImpl::*USA_CmdMethPtr_USA)(const DevVarUShortArray *); typedef DevVarUShortArray *(DeviceImpl::*USA_CmdMethPtr_ULA)(const DevVarULongArray *); typedef DevVarUShortArray *(DeviceImpl::*USA_CmdMethPtr_StrA)(const DevVarStringArray *); typedef DevVarUShortArray *(DeviceImpl::*USA_CmdMethPtr_LSA)(const DevVarLongStringArray *); typedef DevVarUShortArray *(DeviceImpl::*USA_CmdMethPtr_DSA)(const DevVarDoubleStringArray *); typedef DevVarUShortArray *(DeviceImpl::*USA_CmdMethPtr_Sta)(DevState); typedef DevVarULongArray *(DeviceImpl::*ULA_CmdMethPtr_Bo)(DevBoolean); typedef DevVarULongArray *(DeviceImpl::*ULA_CmdMethPtr_Sh)(DevShort); typedef DevVarULongArray *(DeviceImpl::*ULA_CmdMethPtr_Lg)(DevLong); typedef DevVarULongArray *(DeviceImpl::*ULA_CmdMethPtr_Fl)(DevFloat); typedef DevVarULongArray *(DeviceImpl::*ULA_CmdMethPtr_Db)(DevDouble); typedef DevVarULongArray *(DeviceImpl::*ULA_CmdMethPtr_US)(DevUShort); typedef DevVarULongArray *(DeviceImpl::*ULA_CmdMethPtr_UL)(DevULong); typedef DevVarULongArray *(DeviceImpl::*ULA_CmdMethPtr_Str)(DevString); typedef DevVarULongArray *(DeviceImpl::*ULA_CmdMethPtr_ChA)(const DevVarCharArray *); typedef DevVarULongArray *(DeviceImpl::*ULA_CmdMethPtr_ShA)(const DevVarShortArray *); typedef DevVarULongArray *(DeviceImpl::*ULA_CmdMethPtr_LgA)(const DevVarLongArray *); typedef DevVarULongArray *(DeviceImpl::*ULA_CmdMethPtr_FlA)(const DevVarFloatArray *); typedef DevVarULongArray *(DeviceImpl::*ULA_CmdMethPtr_DbA)(const DevVarDoubleArray *); typedef DevVarULongArray *(DeviceImpl::*ULA_CmdMethPtr_USA)(const DevVarUShortArray *); typedef DevVarULongArray *(DeviceImpl::*ULA_CmdMethPtr_ULA)(const DevVarULongArray *); typedef DevVarULongArray *(DeviceImpl::*ULA_CmdMethPtr_StrA)(const DevVarStringArray *); typedef DevVarULongArray *(DeviceImpl::*ULA_CmdMethPtr_LSA)(const DevVarLongStringArray *); typedef DevVarULongArray *(DeviceImpl::*ULA_CmdMethPtr_DSA)(const DevVarDoubleStringArray *); typedef DevVarULongArray *(DeviceImpl::*ULA_CmdMethPtr_Sta)(DevState); typedef DevVarStringArray *(DeviceImpl::*StrA_CmdMethPtr_Bo)(DevBoolean); typedef DevVarStringArray *(DeviceImpl::*StrA_CmdMethPtr_Sh)(DevShort); typedef DevVarStringArray *(DeviceImpl::*StrA_CmdMethPtr_Lg)(DevLong); typedef DevVarStringArray *(DeviceImpl::*StrA_CmdMethPtr_Fl)(DevFloat); typedef DevVarStringArray *(DeviceImpl::*StrA_CmdMethPtr_Db)(DevDouble); typedef DevVarStringArray *(DeviceImpl::*StrA_CmdMethPtr_US)(DevUShort); typedef DevVarStringArray *(DeviceImpl::*StrA_CmdMethPtr_UL)(DevULong); typedef DevVarStringArray *(DeviceImpl::*StrA_CmdMethPtr_Str)(DevString); typedef DevVarStringArray *(DeviceImpl::*StrA_CmdMethPtr_ChA)(const DevVarCharArray *); typedef DevVarStringArray *(DeviceImpl::*StrA_CmdMethPtr_ShA)(const DevVarShortArray *); typedef DevVarStringArray *(DeviceImpl::*StrA_CmdMethPtr_LgA)(const DevVarLongArray *); typedef DevVarStringArray *(DeviceImpl::*StrA_CmdMethPtr_FlA)(const DevVarFloatArray *); typedef DevVarStringArray *(DeviceImpl::*StrA_CmdMethPtr_DbA)(const DevVarDoubleArray *); typedef DevVarStringArray *(DeviceImpl::*StrA_CmdMethPtr_USA)(const DevVarUShortArray *); typedef DevVarStringArray *(DeviceImpl::*StrA_CmdMethPtr_ULA)(const DevVarULongArray *); typedef DevVarStringArray *(DeviceImpl::*StrA_CmdMethPtr_StrA)(const DevVarStringArray *); typedef DevVarStringArray *(DeviceImpl::*StrA_CmdMethPtr_LSA)(const DevVarLongStringArray *); typedef DevVarStringArray *(DeviceImpl::*StrA_CmdMethPtr_DSA)(const DevVarDoubleStringArray *); typedef DevVarStringArray *(DeviceImpl::*StrA_CmdMethPtr_Sta)(DevState); typedef DevVarLongStringArray *(DeviceImpl::*LSA_CmdMethPtr_Bo)(DevBoolean); typedef DevVarLongStringArray *(DeviceImpl::*LSA_CmdMethPtr_Sh)(DevShort); typedef DevVarLongStringArray *(DeviceImpl::*LSA_CmdMethPtr_Lg)(DevLong); typedef DevVarLongStringArray *(DeviceImpl::*LSA_CmdMethPtr_Fl)(DevFloat); typedef DevVarLongStringArray *(DeviceImpl::*LSA_CmdMethPtr_Db)(DevDouble); typedef DevVarLongStringArray *(DeviceImpl::*LSA_CmdMethPtr_US)(DevUShort); typedef DevVarLongStringArray *(DeviceImpl::*LSA_CmdMethPtr_UL)(DevULong); typedef DevVarLongStringArray *(DeviceImpl::*LSA_CmdMethPtr_Str)(DevString); typedef DevVarLongStringArray *(DeviceImpl::*LSA_CmdMethPtr_ChA)(const DevVarCharArray *); typedef DevVarLongStringArray *(DeviceImpl::*LSA_CmdMethPtr_ShA)(const DevVarShortArray *); typedef DevVarLongStringArray *(DeviceImpl::*LSA_CmdMethPtr_LgA)(const DevVarLongArray *); typedef DevVarLongStringArray *(DeviceImpl::*LSA_CmdMethPtr_FlA)(const DevVarFloatArray *); typedef DevVarLongStringArray *(DeviceImpl::*LSA_CmdMethPtr_DbA)(const DevVarDoubleArray *); typedef DevVarLongStringArray *(DeviceImpl::*LSA_CmdMethPtr_USA)(const DevVarUShortArray *); typedef DevVarLongStringArray *(DeviceImpl::*LSA_CmdMethPtr_ULA)(const DevVarULongArray *); typedef DevVarLongStringArray *(DeviceImpl::*LSA_CmdMethPtr_StrA)(const DevVarStringArray *); typedef DevVarLongStringArray *(DeviceImpl::*LSA_CmdMethPtr_LSA)(const DevVarLongStringArray *); typedef DevVarLongStringArray *(DeviceImpl::*LSA_CmdMethPtr_DSA)(const DevVarDoubleStringArray *); typedef DevVarLongStringArray *(DeviceImpl::*LSA_CmdMethPtr_Sta)(DevState); typedef DevVarDoubleStringArray *(DeviceImpl::*DSA_CmdMethPtr_Bo)(DevBoolean); typedef DevVarDoubleStringArray *(DeviceImpl::*DSA_CmdMethPtr_Sh)(DevShort); typedef DevVarDoubleStringArray *(DeviceImpl::*DSA_CmdMethPtr_Lg)(DevLong); typedef DevVarDoubleStringArray *(DeviceImpl::*DSA_CmdMethPtr_Fl)(DevFloat); typedef DevVarDoubleStringArray *(DeviceImpl::*DSA_CmdMethPtr_Db)(DevDouble); typedef DevVarDoubleStringArray *(DeviceImpl::*DSA_CmdMethPtr_US)(DevUShort); typedef DevVarDoubleStringArray *(DeviceImpl::*DSA_CmdMethPtr_UL)(DevULong); typedef DevVarDoubleStringArray *(DeviceImpl::*DSA_CmdMethPtr_Str)(DevString); typedef DevVarDoubleStringArray *(DeviceImpl::*DSA_CmdMethPtr_ChA)(const DevVarCharArray *); typedef DevVarDoubleStringArray *(DeviceImpl::*DSA_CmdMethPtr_ShA)(const DevVarShortArray *); typedef DevVarDoubleStringArray *(DeviceImpl::*DSA_CmdMethPtr_LgA)(const DevVarLongArray *); typedef DevVarDoubleStringArray *(DeviceImpl::*DSA_CmdMethPtr_FlA)(const DevVarFloatArray *); typedef DevVarDoubleStringArray *(DeviceImpl::*DSA_CmdMethPtr_DbA)(const DevVarDoubleArray *); typedef DevVarDoubleStringArray *(DeviceImpl::*DSA_CmdMethPtr_USA)(const DevVarUShortArray *); typedef DevVarDoubleStringArray *(DeviceImpl::*DSA_CmdMethPtr_ULA)(const DevVarULongArray *); typedef DevVarDoubleStringArray *(DeviceImpl::*DSA_CmdMethPtr_StrA)(const DevVarStringArray *); typedef DevVarDoubleStringArray *(DeviceImpl::*DSA_CmdMethPtr_LSA)(const DevVarLongStringArray *); typedef DevVarDoubleStringArray *(DeviceImpl::*DSA_CmdMethPtr_DSA)(const DevVarDoubleStringArray *); typedef DevVarDoubleStringArray *(DeviceImpl::*DSA_CmdMethPtr_Sta)(DevState); typedef DevState *(DeviceImpl::*Sta_CmdMethPtr_Bo)(DevBoolean); typedef DevState *(DeviceImpl::*Sta_CmdMethPtr_Sh)(DevShort); typedef DevState *(DeviceImpl::*Sta_CmdMethPtr_Lg)(DevLong); typedef DevState *(DeviceImpl::*Sta_CmdMethPtr_Fl)(DevFloat); typedef DevState *(DeviceImpl::*Sta_CmdMethPtr_Db)(DevDouble); typedef DevState *(DeviceImpl::*Sta_CmdMethPtr_US)(DevUShort); typedef DevState *(DeviceImpl::*Sta_CmdMethPtr_UL)(DevULong); typedef DevState *(DeviceImpl::*Sta_CmdMethPtr_Str)(DevString); typedef DevState *(DeviceImpl::*Sta_CmdMethPtr_ChA)(const DevVarCharArray *); typedef DevState *(DeviceImpl::*Sta_CmdMethPtr_ShA)(const DevVarShortArray *); typedef DevState *(DeviceImpl::*Sta_CmdMethPtr_LgA)(const DevVarLongArray *); typedef DevState *(DeviceImpl::*Sta_CmdMethPtr_FlA)(const DevVarFloatArray *); typedef DevState *(DeviceImpl::*Sta_CmdMethPtr_DbA)(const DevVarDoubleArray *); typedef DevState *(DeviceImpl::*Sta_CmdMethPtr_USA)(const DevVarUShortArray *); typedef DevState *(DeviceImpl::*Sta_CmdMethPtr_ULA)(const DevVarULongArray *); typedef DevState *(DeviceImpl::*Sta_CmdMethPtr_StrA)(const DevVarStringArray *); typedef DevState *(DeviceImpl::*Sta_CmdMethPtr_LSA)(const DevVarLongStringArray *); typedef DevState *(DeviceImpl::*Sta_CmdMethPtr_DSA)(const DevVarDoubleStringArray *); typedef DevState *(DeviceImpl::*Sta_CmdMethPtr_Sta)(DevState); // // Some enum // enum CmdArgType { DEV_VOID = 0, DEV_BOOLEAN, DEV_SHORT, DEV_LONG, DEV_FLOAT, DEV_DOUBLE, DEV_USHORT, DEV_ULONG, DEV_STRING, DEVVAR_CHARARRAY, DEVVAR_SHORTARRAY, DEVVAR_LONGARRAY, DEVVAR_FLOATARRAY, DEVVAR_DOUBLEARRAY, DEVVAR_USHORTARRAY, DEVVAR_ULONGARRAY, DEVVAR_STRINGARRAY, DEVVAR_LONGSTRINGARRAY, DEVVAR_DOUBLESTRINGARRAY, DEV_STATE, CONST_DEV_STRING, DEVVAR_BOOLEANARRAY, DEV_UCHAR, DEV_LONG64, DEV_ULONG64, DEVVAR_LONG64ARRAY, DEVVAR_ULONG64ARRAY, DEV_INT, DEV_ENCODED }; enum MessBoxType { STOP = 0, INFO }; enum PollObjType { POLL_CMD = 0, POLL_ATTR, EVENT_HEARTBEAT, STORE_SUBDEV }; enum PollCmdCode { POLL_ADD_OBJ = 0, POLL_REM_OBJ, POLL_START, POLL_STOP, POLL_UPD_PERIOD, POLL_REM_DEV, POLL_EXIT, POLL_REM_EXT_TRIG_OBJ, POLL_ADD_HEARTBEAT, POLL_REM_HEARTBEAT }; enum SerialModel { BY_DEVICE = 0, BY_CLASS, BY_PROCESS, NO_SYNC }; enum AttReqType { READ_REQ = 0, WRITE_REQ }; enum LockCmdCode { LOCK_ADD_DEV = 0, LOCK_REM_DEV, LOCK_UNLOCK_ALL_EXIT, LOCK_EXIT }; // // The polled device structure // typedef struct _PollDevice { string dev_name; vector ind_list; }PollDevice; #ifdef TANGO_HAS_LOG4TANGO // // Logging levels // enum LogLevel { LOG_OFF = 0, LOG_FATAL, LOG_ERROR, LOG_WARN, LOG_INFO, LOG_DEBUG } ; // // Logging targets // enum LogTarget { LOG_CONSOLE = 0, LOG_FILE, LOG_DEVICE }; // // Logging targets (as string) // #define kLogTargetConsole "console" #define kLogTargetFile "file" #define kLogTargetDevice "device" // // Logging target [type/name] separator // #define kLogTargetSep "::" // // TANGO threshold // // Min RollingFileAppender threshold (~500kB) const size_t kMinRollingThreshold = 500; // Default RollingFileAppender threshold (~2MB) const size_t kDefaultRollingThreshold = 2 * 1024; // Max RollingFileAppender threshold (~20MB) const size_t kMaxRollingThreshold = 20 * 1024; #endif // TANGO_HAS_LOG4TANGO // // The command argument name // const char * const CmdArgTypeName[] = { "DevVoid", "DevBoolean", "DevShort", "DevLong", "DevFloat", "DevDouble", "DevUShort", "DevULong", "DevString", "DevVarCharArray", "DevVarShortArray", "DevVarLongArray", "DevVarFloatArray", "DevVarDoubleArray", "DevVarUShortArray", "DevVarULongArray", "DevVarStringArray", "DevVarLongStringArray", "DevVarDoubleStringArray", "DevState", "ConstDevString", "DevVarBooleanArray", "DevUChar", "DevLong64", "DevULong64", "DevVarLong64Array", "DevVarULong64Array", "DevInt", "DevEncoded" }; // // The state name // const char * const DevStateName[] = { "ON", "OFF", "CLOSE", "OPEN", "INSERT", "EXTRACT", "MOVING", "STANDBY", "FAULT", "INIT", "RUNNING", "ALARM", "DISABLE", "UNKNOWN" }; /** * Possible event type * * @ingroup Client * @headerfile tango.h */ enum EventType { CHANGE_EVENT=0, ///< Change event QUALITY_EVENT, ///< Quality change event (deprecated - do not use) PERIODIC_EVENT, ///< Periodic event ARCHIVE_EVENT, ///< Archive event USER_EVENT, ///< User event ATTR_CONF_EVENT, ///< attribute configuration change event DATA_READY_EVENT, ///< Data ready event numEventType }; const char * const EventName[] = { "change", "quality", "periodic", "archive", "user_event", "attr_conf", "data_ready" }; enum AttrSerialModel { ATTR_NO_SYNC=0, ATTR_BY_KERNEL, ATTR_BY_USER }; enum KeepAliveCmdCode { EXIT_TH = 0 }; enum AccessControlType { ACCESS_READ = 0, ACCESS_WRITE }; enum MinMaxValueCheck { MIN = 0, MAX }; enum ChannelType { ZMQ = 0, NOTIFD }; typedef struct _SendEventType { _SendEventType() : change(false), archive(false), periodic(false) { }; bool change; bool archive; bool periodic; }SendEventType; // // The optional attribute properties // #define AlrmValueNotSpec "Not specified" #define AssocWritNotSpec "None" #define LabelNotSpec "No label" #define DescNotSpec "No description" #define UnitNotSpec "No unit" #define StdUnitNotSpec "No standard unit" #define DispUnitNotSpec "No display unit" #define FormatNotSpec_FL "%6.2f" #define FormatNotSpec_INT "%d" #define FormatNotSpec_STR "%s" #define FormatNotSpec FormatNotSpec_FL #define NotANumber "NaN" #define MemNotUsed "Not used yet" #define MemAttrPropName "__value" typedef struct _OptAttrProp { const char *name; const char *default_value; }OptAttrProp; // Ranges type-enum-string conversions template struct ranges_type2const { static CmdArgType enu; static string str; }; template struct ranges_const2type { static string str; }; #define RANGES_TYPE2CONST(type,constant) \ template <> \ struct ranges_type2const \ { \ static CmdArgType enu; \ static string str; \ }; \ CmdArgType ranges_type2const::enu = constant; \ string ranges_type2const::str = #type; \ template<> \ struct ranges_const2type \ { \ typedef type Type; \ static string str; \ }; \ string ranges_const2type::str = #type; /* * List of strings used by the API as the DevError reason field. * This list is given here only for API writers to re-use (if possible) * strings already used. * */ #define API_AlreadyPolled "API_AlreadyPolled" #define API_AsynReplyNotArrived "API_AsynReplyNotArrived" #define API_AttrConfig "API_AttrConfig" #define API_AttrEventProp "API_AttrEventProp" #define API_AttributePollingNotStarted "API_AttributePollingNotStarted" #define API_AttrIncorrectDataNumber "API_AttrIncorrectDataNumber" #define API_AttrNoAlarm "API_AttrNoAlarm" #define API_AttrNotAllowed "API_AttrNotAllowed" #define API_AttrNotFound "API_AttrNotFound" #define API_AttrNotPolled "API_AttrNotPolled" #define API_AttrNotWritable "API_AttrNotWritable" #define API_AttrOptProp "API_AttrOptProp" #define API_AttrPropValueNotSet "API_AttrPropValueNotSet" #define API_AttrValueNotSet "API_AttrValueNotSet" #define API_AttrWrongDefined "API_AttrWrongDefined" #define API_AttrWrongMemValue "API_AttrWrongMemValue" #define API_BadAsynReqType "API_BadAsynReqType" #define API_BadConfigurationProperty "API_BadConfigurationProperty" #define API_BlackBoxArgument "API_BlackBoxArgument" #define API_BlackBoxEmpty "API_BlackBoxEmpty" #define API_CannotCheckAccessControl "API_CannotCheckAccessControl" #define API_CannotOpenFile "API_CannotOpenFile" #define API_CantActivatePOAManager "API_CantActivatePOAManager" #define API_CantCreateClassPoa "API_CantCreateClassPoa" #define API_CantCreateLockingThread "API_CantCreateLockingThread" #define API_CantDestroyDevice "API_CantDestroyDevice" #define API_CantFindLockingThread "API_CantFindLockingThread" #define API_CantGetClientIdent "API_CantGetClientIdent" #define API_CantGetDevObjectId "API_CantGetDevObjectId" #define API_CantInstallSignal "API_CantInstallSignal" #define API_CantRetrieveClass "API_CantRetrieveClass" #define API_CantRetrieveClassList "API_CantRetrieveClassList" #define API_CantStoreDeviceClass "API_CantStoreDeviceClass" #define API_ClassNotFound "API_ClassNotFound" #define API_CmdArgumentTypeNotSupported "API_CmdArgumentTypeNotSupported" #define API_CmdNotPolled "API_CmdNotPolled" #define API_CommandNotAllowed "API_CommandNotAllowed" #define API_CommandNotFound "API_CommandNotFound" #define API_CommandTimedOut "API_CommandTimedOut" #define API_ConnectionFailed "API_ConnectionFailed" #define API_CorbaSysException "API_CorbaSysException" #define API_CorruptedDatabase "API_CorruptedDatabase" #define API_DatabaseAccess "API_DatabaseAccess" #define API_DatabaseCacheAccess "API_DatabaseCacheAccess" #define API_DatabaseFileError "API_DatabaseFileError" #define API_DecodeErr "API_DecodeErr" #define API_DeprecatedCommand "API_DeprecatedCommand" #define API_DeviceLocked "API_DeviceLocked" #define API_DeviceNotFound "API_DeviceNotFound" #define API_DeviceNotLocked "API_DeviceNotLocked" #define API_DeviceNotPolled "API_DeviceNotPolled" #define API_DeviceUnlockable "API_DeviceUnlockable" #define API_DeviceUnlocked "API_DeviceUnlocked" #define API_DServerClassNotInitialised "API_DServerClassNotInitialised" #define API_EventPropertiesNotSet "API_EventPropertiesNotSet" #define API_EventQueues "API_EventQueues" #define API_EventSupplierNotConstructed "API_EventSupplierNotConstructed" #define API_IncoherentDbData "API_IncoherentDbData" #define API_IncoherentDevData "API_IncoherentDevData" #define API_IncoherentValues "API_IncoherentValues" #define API_IncompatibleArgumentType "API_IncompatibleArgumentType" #define API_IncompatibleAttrDataType "API_IncompatibleAttrDataType" #define API_IncompatibleCmdArgumentType "API_IncompatibleCmdArgumentType" #define API_InitMethodNotFound "API_InitMethodNotFound" #define API_InitNotPublic "API_InitNotPublic" #define API_InitThrowsException "API_InitThrowsException" #define API_InternalError "API_InternalError" #define API_JavaRuntimeSecurityException "API_JavaRuntimeSecurityException" #define API_MemAttFailedDuringInit "API_MemAttFailedDuringInit" #define API_MemoryAllocation "API_MemoryAllocation" #define API_MethodArgument "API_MethodArgument" #define API_MethodNotFound "API_MethodNotFound" #define API_MissedEvents "API_MissedEvents" #define API_NoDataYet "API_NoDataYet" #define API_NonDatabaseDevice "API_NonDatabaseDevice" #define API_NotificationServiceFailed "API_NotificationServiceFailed" #define API_NotSupported "API_NotSupported" #define API_NotSupportedFeature "API_NotSupportedFeature" #define API_NotUpdatedAnyMore "API_NotUpdatedAnyMore" #define API_NtDebugWindowError "API_NtDebugWindowError" #define API_OverloadingNotSupported "API_OverloadingNotSupported" #define API_PolledDeviceNotInPoolConf "API_PolledDeviceNotInPoolConf" #define API_PolledDeviceNotInPoolMap "API_PolledDeviceNotInPoolMap" #define API_PollingThreadNotFound "API_PollingThreadNotFound" #define API_PollObjNotFound "API_PollObjNotFound" #define API_PollRingBufferEmpty "API_PollRingBufferEmpty" #define API_ReadOnlyMode "API_ReadOnlyMode" #define API_ShutdownInProgress "API_ShutdownInProgress" #define API_SignalOutOfRange "API_SignalOutOfRange" #define API_StartupSequence "API_StartupSequence" #define API_StdException "API_StdException" #define API_SystemCallFailed "API_SystemCallFailed" #define API_TangoHostNotSet "API_TangoHostNotSet" #define API_UnsupportedFeature "API_UnsupportedFeature" #define API_WAttrOutsideLimit "API_WAttrOutsideLimit" #define API_WizardConfError "API_WizardConfError" #define API_WrongAttributeNameSyntax "API_WrongAttributeNameSyntax" #define API_WrongDeviceNameSyntax "API_WrongDeviceNameSyntax" #define API_WrongEventData "API_WrongEventData" #define API_WrongFormat "API_WrongFormat" #define API_WrongHistoryDataBuffer "API_WrongHistoryDataBuffer" #define API_WrongLockingStatus "API_WrongLockingStatus" #define API_WrongNumberOfArgs "API_WrongNumberOfArgs" #define API_ZmqFailed "API_ZmqFailed" #define API_ZmqInitFailed "API_ZmqInitFailed" /* * Formerly maintained list of DevError reason fields, kept for reference. * * API_AttrConfig * API_AttrEventProp * API_AttrIncorrectDataNumber * API_AttrNoAlarm * API_AttrNotAllowed * API_AttrNotFound * API_AttrNotWritable * API_AttrOptProp * API_AttrPropValueNotSet * API_AttrValueNotSet * API_AttrWrongDefined * API_AttrWrongMemValue * API_BadConfigurationProperty * API_BlackBoxArgument * API_BlackBoxEmpty * API_CannotCheckAccessControl * API_CannotOpenFile * API_CantActivatePOAManager * API_CantCreateClassPoa * API_CantCreateLockingThread * API_CantFindLockingThread * API_CantGetClientIdent * API_CantGetDevObjectId * API_CantInstallSignal * API_CantRetrieveClass * API_CantRetrieveClassList * API_CantStoreDeviceClass * API_ClassNotFound * API_CmdArgumentTypeNotSupported * API_CommandNotAllowed * API_CommandNotFound * API_CorbaSysException * API_CorruptedDatabase * API_DatabaseAccess * API_DeviceLocked * API_DeviceNotFound * API_DeviceNotLocked * API_DeviceUnlockable * API_DeviceUnlocked * API_EventSupplierNotConstructed * API_IncoherentDbData * API_IncoherentDevData * API_IncoherentValues * API_IncompatibleAttrDataType * API_IncompatibleCmdArgumentType * API_InitMethodNotFound * API_InitNotPublic * API_InitThrowsException * API_JavaRuntimeSecurityException * API_MemAttFailedDuringInit * API_MemoryAllocation * API_MethodArgument * API_MethodNotFound * API_MissedEvents * API_NotSupportedFeature * API_NtDebugWindowError * API_OverloadingNotSupported * API_PolledDeviceNotInPoolConf * API_PolledDeviceNotInPoolMap * API_PollingThreadNotFound * API_ReadOnlyMode * API_SignalOutOfRange * API_SystemCallFailed * API_WAttrOutsideLimit * API_WizardConfError * API_WrongEventData * API_WrongHistoryDataBuffer * API_WrongLockingStatus * API_ZmqInitFailed */ } // End of Tango namespace #endif /* TANGO_CONST_H */ tango-8.1.2c+dfsg.orig/lib/cpp/server/jpeg/0000755000175000017500000000000012205375306017361 5ustar piccapiccatango-8.1.2c+dfsg.orig/lib/cpp/server/jpeg/jpeg_color.cpp0000644000175000017500000004610712205375140022214 0ustar piccapicca///============================================================================= // // file : jpeg_color.cpp // // description : Simple jpeg coding/decoding library // Color space conversion // // project : TANGO // // author(s) : JL Pons // // Copyright (C) : 2004,2005,2006,2007,2008,2009,2010,2011,2012,2013 // European Synchrotron Radiation Facility // BP 220, Grenoble 38043 // FRANCE // // This file is part of Tango. // // Tango 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. // // Tango 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 Tango. If not, see . // // $Revision: 22213 $ // // $Log$ // Revision 1.3 2009/04/20 14:55:58 jlpons // Added GPL header, changed memory allocation to C++ fashion. // //============================================================================= //------------------------------------------------------------------------------ // // (YCbCr to RGB) Y,Cb and Cr range in [0,255] // R = Y + 1.402 * (Cr-128) // G = Y - 0.34414 * (Cb-128) - 0.71414*(Cr-128) // B = Y + 1.772 * (Cb-128) // // (RGB to YCbCr) R,G,B range in [0,255] // Y = 0.299 * R + 0.587 * G + 0.114 * B // Cb = -0.16874 * R - 0.33126 * G + 0.5 * B + 128 // Cr = 0.5 * R - 0.41869 * G - 0.08131 * B + 128 // //------------------------------------------------------------------------------ #include "jpeg_memory.h" #include "jpeg_lib.h" #include #define TRUNC(i) ((i) & 0xFFFFFF00)?(unsigned char)(((~(i)) >> 31) & 0xFF):(unsigned char)(i) static long *ry = NULL; static long *gy = NULL; static long *by = NULL; static long *rcb = NULL; static long *gcb = NULL; static long *bcb = NULL; static long *rcr = NULL; static long *gcr = NULL; static long *bcr = NULL; static long *crr = NULL; static long *cbb = NULL; static long *crg = NULL; static long *cbg = NULL; // ------------------------------------------------------------------------------ void jpeg_init_color() { // Conversion table to speed up RGB <-> YCbCr conversion (fixed point) if( !ry ) { ry = (long *)malloc(256 * sizeof(long)); for(long i=0;i<256;i++) ry[i] = (long)(0.299*65536.0+0.5) * i; gy = (long *)malloc(256 * sizeof(long)); for(long i=0;i<256;i++) gy[i] = (long)(0.587*65536.0+0.5) * i; by = (long *)malloc(256 * sizeof(long)); for(long i=0;i<256;i++) by[i] = (long)(0.114*65536.0+0.5) * i + 32767L; rcb = (long *)malloc(256 * sizeof(long)); for(long i=0;i<256;i++) rcb[i] = (long)(0.16874*65536.0+0.5) * (-i); gcb = (long *)malloc(256 * sizeof(long)); for(long i=0;i<256;i++) gcb[i] = (long)(0.33126*65536.0+0.5) * (-i); bcb = (long *)malloc(256 * sizeof(long)); for(long i=0;i<256;i++) bcb[i] = (long)(0.5*65536.0+0.5) * (i) + 32767L; rcr = (long *)malloc(256 * sizeof(long)); for(long i=0;i<256;i++) rcr[i] = (long)(0.5*65536.0+0.5) * (i); gcr = (long *)malloc(256 * sizeof(long)); for(long i=0;i<256;i++) gcr[i] = (long)(0.41869*65536.0+0.5) * (-i); bcr = (long *)malloc(256 * sizeof(long)); for(long i=0;i<256;i++) bcr[i] = (long)(0.08131*65536.0+0.5) * (-i) + 32767L; crr = (long *)malloc(256 * sizeof(long)); cbb = (long *)malloc(256 * sizeof(long)); crg = (long *)malloc(256 * sizeof(long)); cbg = (long *)malloc(256 * sizeof(long)); for(long i=0;i<256;i++) { double k = (double)((i * 2) - 256); crr[i] = (long)( 1.402*32768.0*k + 32767.0 ) >> 16; cbb[i] = (long)( 1.772*32768.0*k + 32767.0 ) >> 16; crg[i] = (long)( -0.71414*32768.0*k ); cbg[i] = (long)( -0.34414*32768.0*k + 32767.0 ); } } } //------------------------------------------------------------------------------ // MCU16x16 YCbCr H2V2 (2x2:1:1, 6 blocks per MCU) to 32-bit RGB //------------------------------------------------------------------------------ void jpeg_yh2v2_to_rgb32(unsigned char *block,int width,unsigned char *rgb) { unsigned char *y = block; unsigned char *cb = block+64*4; unsigned char *cr = block+64*5; int pitch = width*4; unsigned char *row; unsigned char *yP; long y0,yy,rc,gc,bc; for(int j=0;j<8;j++) { row = rgb; y0 = ((j&4)<<5) + ((j&3)<<4); for(int i=0;i<8;i++) { yP = y + (y0 + ((i&4)<<4) + ((i&3)<<1)); rc = crr[*cr]; gc = ((crg[*cr] + cbg[*cb]) >> 16); bc = cbb[*cb]; yy = yP[0]; row[0] = TRUNC(yy+rc); row[1] = TRUNC(yy+gc); row[2] = TRUNC(yy+bc); yy = yP[1]; row[4] = TRUNC(yy+rc); row[5] = TRUNC(yy+gc); row[6] = TRUNC(yy+bc); yy = yP[8]; row[0+pitch] = TRUNC(yy+rc); row[1+pitch] = TRUNC(yy+gc); row[2+pitch] = TRUNC(yy+bc); yy = yP[9]; row[4+pitch] = TRUNC(yy+rc); row[5+pitch] = TRUNC(yy+gc); row[6+pitch] = TRUNC(yy+bc); row+=8; cr++; cb++; } rgb+=2*pitch; } } //------------------------------------------------------------------------------ // MCU8x8 YCbCr H1V1 (1x1:1:1, 3 blocks per MCU) to 32-bit RGB //------------------------------------------------------------------------------ void jpeg_yh1v1_to_rgb32(unsigned char *block,int width,unsigned char *rgb) { int pitch = width*4; unsigned char *row; unsigned char *ycc = block; for (int i=0; i<8 ; i++) { row = rgb; for (int j=0; j<8; j++) { int y = ycc[0]; int cb = ycc[64]; int cr = ycc[128]; row[0] = TRUNC(y + crr[cr]); row[1] = TRUNC(y + ((crg[cr] + cbg[cb]) >> 16)); row[2] = TRUNC(y + cbb[cb]); row += 4; ycc++; } rgb+=pitch; } } //------------------------------------------------------------------------------ // MCU8x8 Y (1 block per MCU) to 8-bit grayscale //------------------------------------------------------------------------------ void jpeg_y_to_gray(unsigned char *block,int width,unsigned char *rgb) { unsigned char *s = block; unsigned char *d = rgb; for (int i=0;i<8;i++) { *(unsigned long *)d = *(unsigned long *)s; *(unsigned long *)(&d[4]) = *(unsigned long *)(&s[4]); s += 8; d += width; } } #ifdef JPG_USE_ASM extern void conv_block_RGB32H2V2_mmx(long width,unsigned char *rgb,short *y,short *cb,short *cr); extern void conv_block_RGB24H2V2_mmx(long width,unsigned char *rgb,short *y,short *cb,short *cr); extern void conv_block_GRAY8Y_mmx(long width,unsigned char *g,short *y); #endif // -------------------------------------------------------------------------------------- // Convert 16x16 RGB32 pixel map to (4xY 1xCb 1xCr) block (4:2:0) // -------------------------------------------------------------------------------------- void conv_block_RGB32H2V2(int width,unsigned char *rgb,short *y,short *cb,short *cr) { short r00,g00,b00,r10,g10,b10,r01,g01,b01,r11,g11,b11; int y0,yIdx; short rd,gd,bd; for(int j=0;j<8;j++) { y0 = ((j&4)<<5) + ((j&3)<<4); for(int i=0;i<8;i++) { yIdx = y0 + ((i&4)<<4) + ((i&3)<<1); r00 = (short)rgb[0]; g00 = (short)rgb[1]; b00 = (short)rgb[2]; r10 = (short)rgb[4]; g10 = (short)rgb[5]; b10 = (short)rgb[6]; r01 = (short)rgb[0+width*4]; g01 = (short)rgb[1+width*4]; b01 = (short)rgb[2+width*4]; r11 = (short)rgb[4+width*4]; g11 = (short)rgb[5+width*4]; b11 = (short)rgb[6+width*4]; y[0+yIdx] = (short)( (ry[r00] + gy[g00] + by[b00]) >> 16 ) - 128; y[1+yIdx] = (short)( (ry[r10] + gy[g10] + by[b10]) >> 16 ) - 128; y[8+yIdx] = (short)( (ry[r01] + gy[g01] + by[b01]) >> 16 ) - 128; y[9+yIdx] = (short)( (ry[r11] + gy[g11] + by[b11]) >> 16 ) - 128; rd = (r00 + r10 + r01 + r11) >> 2; gd = (g00 + g10 + g01 + g11) >> 2; bd = (b00 + b10 + b01 + b11) >> 2; *cb = (short)( (rcb[rd] + gcb[gd] + bcb[bd]) >> 16 ); *cr = (short)( (rcr[rd] + gcr[gd] + bcr[bd]) >> 16 ); rgb+=8; cb++; cr++; } rgb += 8*width-64; } } void jpeg_rgb32_to_ycc(int width,int height,int outWidth,int outHeight,unsigned char *rgb32,short *ycc) { // outWidth and outHeight must be multiple of 16 // ycc map is stored as jpeg 8x8 block order (4xY 1xCb 1xCr) // ycc must reference a buffer of at least (outWidth*outHeight*3) bytes short *y = ycc; unsigned char *rgb = rgb32; short *cb = ycc + 64*4; short *cr = ycc + 64*5; int k,l,yp,scr; unsigned char rgbScrath[16*16*4]; int w16 = (width >>4) * 16; int h16 = (height>>4) * 16; int paddWidth = (w16> 16 ) - 128; y[1+yIdx] = (short)( (ry[r10] + gy[g10] + by[b10]) >> 16 ) - 128; y[8+yIdx] = (short)( (ry[r01] + gy[g01] + by[b01]) >> 16 ) - 128; y[9+yIdx] = (short)( (ry[r11] + gy[g11] + by[b11]) >> 16 ) - 128; rd = (r00 + r10 + r01 + r11) >> 2; gd = (g00 + g10 + g01 + g11) >> 2; bd = (b00 + b10 + b01 + b11) >> 2; *cb = (short)( (rcb[rd] + gcb[gd] + bcb[bd]) >> 16 ); *cr = (short)( (rcr[rd] + gcr[gd] + bcr[bd]) >> 16 ); rgb+=6; cb++; cr++; } rgb += 6*width-48; } } void jpeg_rgb24_to_ycc(int width,int height,int outWidth,int outHeight,unsigned char *rgb24,short *ycc) { // outWidth and outHeight must be multiple of 16 // ycc map is stored as jpeg 8x8 block order (4xY 1xCb 1xCr) // ycc must reference a buffer of at least (outWidth*outHeight*3) bytes short *y = ycc; unsigned char *rgb = rgb24; short *cb = ycc + 64*4; short *cr = ycc + 64*5; int k,l,yp,scr; unsigned char rgbScrath[16*16*3]; int w16 = (width >>4) * 16; int h16 = (height>>4) * 16; int paddWidth = (w16>3) * 8; int h8 = (height>>3) * 8; int paddWidth = (w8. // // $Revision: 22213 $ // // $Log$ // Revision 1.4 2009/04/20 14:55:58 jlpons // Added GPL header, changed memory allocation to C++ fashion. // //============================================================================= #include "jpeg_memory.h" #include #include #define MAX_BUFFER 50 typedef struct { void *buff; void *buff16; size_t size; } MEMORY_HEADER; static int nb_allocated = 0; static MEMORY_HEADER MemTable[MAX_BUFFER]; // Allocate a buffer (always 16 bytes aligned) void *malloc_16(size_t size) { void *mptr; void *mptr16; if( nb_allocated == MAX_BUFFER ) { printf("Warning: jpeg_memory number of buffer exeeded\n"); return NULL; } mptr = malloc(size+16); if( !mptr ) { printf("Warning: jpeg_memory not enough free memory\n"); return NULL; } MemTable[nb_allocated].buff=mptr; MemTable[nb_allocated].size=size; // Aligns memory block on 16byte mptr16 = ((void *)(((size_t)mptr + 15) & ~15)); MemTable[nb_allocated].buff16=mptr16; nb_allocated++; return mptr16; } // Allocate a buffer (always 16 bytes aligned) void *calloc_16(size_t count,size_t size) { void *mptr; void *mptr16; if( nb_allocated == MAX_BUFFER ) return NULL; mptr = malloc(size*count+16); if( !mptr ) return NULL; MemTable[nb_allocated].buff=mptr; MemTable[nb_allocated].size=size; // Aligns memory block on 16byte mptr16 = ((void *)(((size_t)mptr + 15) & ~15)); MemTable[nb_allocated].buff16=mptr16; nb_allocated++; return mptr16; } // Free a buffer void free_16( void *ptr ) { int i,found; if( ptr==NULL ) return; i=0;found=0; while(!found && i. // // $Revision: 22617 $ // // $Log$ // Revision 1.4 2009/11/02 08:36:17 taurel // - Fix warnings reported when compiling using the option -Wall // // Revision 1.3 2009/04/20 14:55:58 jlpons // Added GPL header, changed memory allocation to C++ fashion. // //============================================================================= #include #include #include #include "jpeg_lib.h" #include "jpeg_const.h" #include "jpeg_memory.h" #include "jpeg_bitstream.h" // color conversion declaration (jpeg_color.cpp) void jpeg_init_color(); void jpeg_yh2v2_to_rgb32(unsigned char *block,int width,unsigned char *rgb); void jpeg_yh1v1_to_rgb32(unsigned char *block,int width,unsigned char *rgb); void jpeg_y_to_gray(unsigned char *block,int width,unsigned char *rgb); #ifdef JPG_USE_ASM void jpeg_yh2v2_to_rgb32_mmx(unsigned char *block,long width,unsigned char *rgb); void jpeg_yh1v1_to_rgb32_mmx(unsigned char *block,long width,unsigned char *rgb); #endif extern int jpgZag[]; // ------------------------------------------------------------------ char *jpeg_get_error_msg(int code) { static char retMsg[1024]; switch(-code) { case 0: sprintf(retMsg,"No error");break; case 1: sprintf(retMsg,"Can't find start of image (SOI), may be not a jpeg stream");break; case 2: sprintf(retMsg,"Not supported jpeg format");break; case 3: sprintf(retMsg,"Unexpected jpeg marker found");break; case 4: sprintf(retMsg,"Unexpected end of stream or marker not found");break; case 5: sprintf(retMsg,"Bad DQT marker");break; case 6: sprintf(retMsg,"Invalid quantization table index");break; case 7: sprintf(retMsg,"Invalid quantization table size");break; case 8: sprintf(retMsg,"Invalid variable marker length");break; case 9: sprintf(retMsg,"Bad DHT marker");break; case 10: sprintf(retMsg,"Bad DHT count");break; case 11: sprintf(retMsg,"Bad DHT index");break; case 12: sprintf(retMsg,"Bad SOS marker");break; case 13: sprintf(retMsg,"Bad component id");break; case 14: sprintf(retMsg,"Only 8 bit precission supported");break; case 15: sprintf(retMsg,"Invalid image size (8192x8192 max)");break; case 16: sprintf(retMsg,"Too many components in frame");break; case 17: sprintf(retMsg,"Bad SOF marker");break; case 18: sprintf(retMsg,"Bad DRI marker");break; case 19: sprintf(retMsg,"One or more quantisation table(s) are missing");break; case 20: sprintf(retMsg,"One or more huffman table(s) are missing");break; case 21: sprintf(retMsg,"Downsampling factor not supported");break; case 22: sprintf(retMsg,"Not enough memory");break; case 23: sprintf(retMsg,"Bad restart marker");break; case 24: sprintf(retMsg,"Decoding error");break; case 25: sprintf(retMsg,"Component info missing");break; case 26: sprintf(retMsg,"Progressive format not supported");break; case 27: sprintf(retMsg,"YH2V1 format not supported");break; case 28: sprintf(retMsg,"YH1V2 format not supported");break; } return retMsg; } #define ERROR(code) if(code<0) {jpeg_decoder_free(&decoder);if(bs) delete bs;return code;} #define CHECK_ERR(code) if(code<0) return code; // ------------------------------------------------------------------ static int jpeg_read_soi_marker(InputBitStream *bs) { int lastchar, thischar; int bytesleft; lastchar = bs->get_byte(); thischar = bs->get_byte(); if ((lastchar == 0xFF) && (thischar == M_SOI)) return 0; bytesleft = 512; while(1) { if (--bytesleft == 0) return -1; lastchar = thischar; thischar = bs->get_byte(); if ((lastchar == 0xFF) && (thischar == M_SOI)) break; } return 0; } // ------------------------------------------------------------------ int jpeg_next_marker(InputBitStream *bs) { int c,count=0; do { do { c = bs->get_byte(); count++; } while ( (c!=0xFF) && (count<1024) ); if( count>=1024 ) return 0; do { c = bs->get_byte(); } while (c == 0xFF); } while (c==0); return c; } // ------------------------------------------------------------------ int jpeg_skip_marker(InputBitStream *bs) { int left; left = (bs->get_byte() << 8) | bs->get_byte(); if (left < 2) return -8; left -= 2; while (left) { bs->get_byte(); left--; } return 0; } // ------------------------------------------------------------------ int jpeg_read_dqt_marker(JPGDECODER *decoder,InputBitStream *bs) { int n, i, prec; int left; int temp; left = (bs->get_byte() << 8) | bs->get_byte(); if (left < 2) return -5; left -= 2; while (left) { n = bs->get_byte(); prec = n >> 4; n &= 0x0F; if (n >= 4) return -6; if( !decoder->qTables[n] ) decoder->qTables[n] = (short *)malloc_16(64*2); // read quantization entries, in zag order for (i = 0; i < 64; i++) { temp = bs->get_byte(); if (prec) temp = (temp << 8) + bs->get_byte(); decoder->qTables[n][i] = (short)temp; } i = 64 + 1; if (prec) i += 64; if (left < i) return -7; left -= i; } return 0; } // ------------------------------------------------------------------ int jpeg_read_dht_marker(JPGDECODER *decoder,InputBitStream *bs) { int i, index, count, p, l, si; int left; int huff_num[17]; int huff_val[256]; int huffsize[257]; int huffcode[257]; int code; int subtree; int code_size; int lastp; int nextfreeentry; int currententry; left = (bs->get_byte() << 8) | bs->get_byte(); if (left < 2) return -9; left -= 2; while (left) { memset(huff_num,0,17*sizeof(int)); memset(huff_val,0,256*sizeof(int)); memset(huffsize,0,257*sizeof(int)); memset(huffcode,0,257*sizeof(int)); // Read a Huffman table index = bs->get_byte(); huff_num[0] = 0; count = 0; for (i = 1; i <= 16; i++) { huff_num[i] = bs->get_byte(); count += huff_num[i]; } if (count > 255) return -10; for (i = 0; i < count; i++) huff_val[i] = bs->get_byte(); i = 1 + 16 + count; if (left < i) return -9; left -= i; if ((index & 0x10) > 0x10) return -11; index = (index & 0x0F) + ((index & 0x10) >> 4) * 4; if (index >= 8) return -11; // Initialise huffman tree (fast decoding) HUFFMANTABLE *hs = &(decoder->hTables[index]); p = 0; for (l = 1; l <= 16; l++) { for (i = 1; i <= huff_num[l]; i++) huffsize[p++] = l; } lastp = p; code = 0; si = huffsize[0]; p = 0; while (huffsize[p]) { while (huffsize[p] == si) { huffcode[p++] = code; code++; } code <<= 1; si++; } nextfreeentry = -1; p = 0; while (p < lastp) { i = huff_val[p]; code = huffcode[p]; code_size = huffsize[p]; hs->huffSize[i] = code_size; if (code_size <= 8) { code <<= (8 - code_size); for (l = 1 << (8 - code_size); l > 0; l--) { hs->lookUp[code] = i; code++; } } else { subtree = (code >> (code_size - 8)) & 0xFF; currententry = hs->lookUp[subtree]; if (currententry == 0) { hs->lookUp[subtree] = currententry = nextfreeentry; nextfreeentry -= 2; } code <<= (16 - (code_size - 8)); for (l = code_size; l > 9; l--) { if ((code & 0x8000) == 0) currententry--; if (hs->tree[-currententry - 1] == 0) { hs->tree[-currententry - 1] = nextfreeentry; currententry = nextfreeentry; nextfreeentry -= 2; } else { currententry = hs->tree[-currententry - 1]; } code <<= 1; } if ((code & 0x8000) == 0) currententry--; hs->tree[-currententry - 1] = i; } p++; } hs->inited = 1; } return 0; } // ------------------------------------------------------------------ int jpeg_read_sos_marker(JPGDECODER *decoder,InputBitStream *bs) { int left; int i,cId,hId,n; left = (bs->get_byte() << 8) | bs->get_byte(); n = bs->get_byte(); decoder->compInScan = n; left -= 3; if ((left != (n*2 + 3)) || (n < 1) || (n > 4) ) return -12; for (i = 0; i < n; i++) { cId = bs->get_byte(); hId = bs->get_byte(); left -= 2; if (cId > 4) return -13; decoder->comps[cId].dcIdx = (hId >> 4) & 15; decoder->comps[cId].acIdx = (hId & 15) + 4; } bs->get_byte(); // spectral_start bs->get_byte(); // spectral_end bs->get_byte(); // successive app. low,high left -= 3; while (left) { bs->get_byte(); left--; } return 0; } // ------------------------------------------------------------------ int jpeg_read_sof_marker(JPGDECODER *decoder,InputBitStream *bs) { int i; int left; left = (bs->get_byte() << 8) | bs->get_byte(); if (bs->get_byte() != 8) return -14; decoder->height = (bs->get_byte() << 8) | bs->get_byte(); decoder->width = (bs->get_byte() << 8) | bs->get_byte(); if ((decoder->height < 1) || (decoder->height > 8192)) return -15; if ((decoder->width < 1) || (decoder->width > 8192)) return -15; decoder->compNb = bs->get_byte(); if (decoder->compNb > 4) return -16; if (left != (decoder->compNb * 3 + 8)) return -17; for (i = 0; i < decoder->compNb; i++) { int compId = bs->get_byte(); if( compId>4 ) return -13; decoder->comps[compId].id = compId; int samp = bs->get_byte(); decoder->comps[compId].horzSampling = samp >> 4; decoder->comps[compId].vertSampling = samp & 0xF; decoder->comps[compId].quantIdx = bs->get_byte(); } return 0; } // ------------------------------------------------------------------ int jpeg_read_dri_marker(JPGDECODER *decoder,InputBitStream *bs) { int left = (bs->get_byte() << 8) | bs->get_byte(); if (left != 4) return -18; decoder->restartInterval = (bs->get_byte() << 8) | bs->get_byte(); if (decoder->restartInterval) { decoder->restartsLeft = decoder->restartInterval; decoder->nextRestart = 0; } return 0; } // ------------------------------------------------------------------ int jpeg_process_marker(JPGDECODER *decoder,InputBitStream *bs) { int m,err; while(1) { m = jpeg_next_marker(bs); switch (m) { case 0: return -4; // Marker not found case M_SOF0: case M_SOF1: err=jpeg_read_sof_marker(decoder,bs);CHECK_ERR(err); break; case M_SOS: err=jpeg_read_sos_marker(decoder,bs);CHECK_ERR(err); return 0; case M_DHT: err=jpeg_read_dht_marker(decoder,bs);CHECK_ERR(err); break; case M_DQT: err=jpeg_read_dqt_marker(decoder,bs);CHECK_ERR(err); break; case M_DRI: err=jpeg_read_dri_marker(decoder,bs);CHECK_ERR(err); break; case M_JPG: case M_RST0: case M_RST1: case M_RST2: case M_RST3: case M_RST4: case M_RST5: case M_RST6: case M_RST7: case M_SOI: return -3; case M_SOF2: return -26; case M_TEM: case M_SOF3: case M_SOF5: case M_SOF6: case M_SOF7: case M_SOF9: case M_SOF10: case M_SOF11: case M_SOF13: case M_SOF14: case M_SOF15: return -2; case M_EOI: break; default: { err=jpeg_skip_marker(bs);CHECK_ERR(err); break; } } } } // ------------------------------------------------------------------ int jpeg_read_restart_marker(JPGDECODER *decoder,InputBitStream *bs) { unsigned char c; bs->align(); // Is it the expected marker? If not, something bad happened. c=bs->get_bits(8); if( c!=0xFF ) return -23; c=bs->get_bits(8); if (c != (decoder->nextRestart + M_RST0)) return -23; // Reset each component's DC prediction values. for(int i=0;i<4;i++) decoder->comps[i].lastDc = 0; decoder->restartsLeft = decoder->restartInterval; decoder->nextRestart = (decoder->nextRestart + 1) & 7; return 0; } // ------------------------------------------------------------------ int jpeg_decoder_init(JPGDECODER *decoder) { if( decoder->compNb!=3 && decoder->compNb!=1 ) return -2; if( decoder->compInScan != decoder->compNb ) return -2; // Check tables for(int i=0;i<4;i++) { int id = decoder->comps[i].id; if(id>=0) { int qIx = decoder->comps[i].quantIdx; if( !decoder->qTables[qIx] ) return -19; int dcIdx = decoder->comps[i].dcIdx; if( !decoder->hTables[dcIdx].inited ) return -20; int acIdx = decoder->comps[i].acIdx; if( !decoder->hTables[acIdx].inited ) return -20; } } // Check comp int found=0;int fComp=0; while(!found && fComp<4) { found = (decoder->comps[fComp].id!=-100); if(!found) fComp++; } if(!found) return -25; // Init scan type if (decoder->compNb == 1) { decoder->scanType = JPG_SCAN_GRAYSCALE; decoder->outFormat = JPEG_GRAY_FORMAT; // Output format decoder->mcuNbBlock = 1; decoder->compList[0] = fComp; decoder->mcuWidth = 8; decoder->mcuHeight = 8; } else if (decoder->compNb == 3) { if ( ((decoder->comps[2].horzSampling != 1) || (decoder->comps[2].vertSampling != 1)) || ((decoder->comps[3].horzSampling != 1) || (decoder->comps[3].vertSampling != 1)) ) return -21; if ((decoder->comps[1].horzSampling == 1) && (decoder->comps[1].vertSampling == 1)) { decoder->scanType = JPG_SCAN_YH1V1; decoder->outFormat = JPEG_RGB32_FORMAT; // Output format decoder->mcuNbBlock = 3; decoder->compList[0] = fComp; decoder->compList[1] = fComp+1; decoder->compList[2] = fComp+2; decoder->mcuWidth = 8; decoder->mcuHeight = 8; } else if ((decoder->comps[1].horzSampling == 2) && (decoder->comps[1].vertSampling == 1)) { //decoder->scanType = JPG_SCAN_YH2V1; //decoder->mcuNbBlock = 4; //decoder->compList[0] = fComp; //decoder->compList[1] = fComp; //decoder->compList[2] = fComp+1; //decoder->compList[3] = fComp+2; //decoder->mcuWidth = 16; //decoder->mcuHeight = 8; return -27; } else if ((decoder->comps[1].horzSampling == 1) && (decoder->comps[1].vertSampling == 2)) { //decoder->scanType = JPG_SCAN_YH1V2; //decoder->mcuNbBlock = 4; //decoder->compList[0] = fComp; //decoder->compList[1] = fComp; //decoder->compList[2] = fComp+1; //decoder->compList[3] = fComp+2; //decoder->mcuWidth = 8; //decoder->mcuHeight = 16; return -28; } else if ((decoder->comps[1].horzSampling == 2) && (decoder->comps[1].vertSampling == 2)) { decoder->scanType = JPG_SCAN_YH2V2; decoder->outFormat = JPEG_RGB32_FORMAT; // Output format decoder->mcuNbBlock = 6; decoder->compList[0] = fComp; decoder->compList[1] = fComp; decoder->compList[2] = fComp; decoder->compList[3] = fComp; decoder->compList[4] = fComp+1; decoder->compList[5] = fComp+2; decoder->mcuWidth = 16; decoder->mcuHeight = 16; } else return -21; } decoder->mcuNbRow = (decoder->width + (decoder->mcuWidth - 1)) / decoder->mcuWidth; decoder->mcuNbCol = (decoder->height + (decoder->mcuHeight - 1)) / decoder->mcuHeight; return 0; } // ------------------------------------------------------------------ void jpeg_decoder_free(JPGDECODER *decoder) { for(int i=0;i<4;i++) if( decoder->qTables[i] ) free_16(decoder->qTables[i]); if( decoder->blocks ) free_16( decoder->blocks ); if( decoder->yccFrame ) free_16( decoder->yccFrame ); if( decoder->rgbFrame ) free_16( decoder->rgbFrame ); } // ------------------------------------------------------------------ int jpeg_decode(int jpegSize,unsigned char *jpegData, int *width,int *height,int *format,unsigned char **frame) { int errCode = 0; JPGDECODER decoder; memset(&decoder,0,sizeof(JPGDECODER)); for(int i=0;i<4;i++) decoder.comps[i].id = -100; InputBitStream *bs = new InputBitStream(jpegData,jpegSize); jpeg_init_color(); // Header errCode = jpeg_read_soi_marker(bs);ERROR(errCode); errCode = jpeg_process_marker(&decoder,bs);ERROR(errCode); errCode = jpeg_decoder_init(&decoder);ERROR(errCode); // int nbMCU = decoder.mcuNbCol * decoder.mcuNbRow; int rWidth = decoder.mcuNbRow * decoder.mcuWidth; int rHeight = decoder.mcuNbCol * decoder.mcuHeight; int mcuSize = decoder.mcuNbBlock*64; decoder.blocks = (short *)malloc_16(mcuSize*2); decoder.yccFrame = (unsigned char *)malloc_16(mcuSize); if( decoder.scanType==JPG_SCAN_GRAYSCALE ) decoder.rgbFrame = (unsigned char *)malloc_16(rWidth*rHeight); else decoder.rgbFrame = (unsigned char *)malloc_16(rWidth*rHeight*4); if(!decoder.rgbFrame) ERROR(-22); // Decode blocks bs->init(); for(int j=0;jdecode_mcu(&decoder); ERROR(errCode); // Convert to RGB int rgbOffset; switch( decoder.scanType ) { case JPG_SCAN_YH2V2: rgbOffset = (i*decoder.mcuWidth + j*decoder.mcuHeight*rWidth) << 2; #ifdef JPG_USE_ASM jpeg_yh2v2_to_rgb32_mmx(decoder.yccFrame,(long)rWidth,decoder.rgbFrame+rgbOffset); #else jpeg_yh2v2_to_rgb32(decoder.yccFrame,rWidth,decoder.rgbFrame+rgbOffset); #endif break; case JPG_SCAN_YH1V1: rgbOffset = (i*decoder.mcuWidth + j*decoder.mcuHeight*rWidth) << 2; #ifdef JPG_USE_ASM jpeg_yh1v1_to_rgb32_mmx(decoder.yccFrame,(long)rWidth,decoder.rgbFrame+rgbOffset); #else jpeg_yh1v1_to_rgb32(decoder.yccFrame,rWidth,decoder.rgbFrame+rgbOffset); #endif break; case JPG_SCAN_GRAYSCALE: rgbOffset = (i*decoder.mcuWidth + j*decoder.mcuHeight*rWidth); jpeg_y_to_gray(decoder.yccFrame,rWidth,decoder.rgbFrame+rgbOffset); break; } } } bs->flush(); #ifdef JPG_USE_ASM #ifdef _WINDOWS __asm emms; #else __asm__ ("emms\n"::); #endif #endif // Clip and Copy frame int rPitch; int rowSize; *width = decoder.width; *height = decoder.height; *format = decoder.outFormat; if( decoder.scanType==JPG_SCAN_GRAYSCALE ) { *frame = new unsigned char[decoder.width*decoder.height]; rPitch = rWidth; rowSize = decoder.width; } else { *frame = new unsigned char[decoder.width*decoder.height*4]; rPitch = rWidth * 4; rowSize = decoder.width * 4; } if(!*frame) ERROR(-22); unsigned char *src = decoder.rgbFrame; unsigned char *dest = *frame; for(int y=0;y. // // $Revision: 22617 $ // // $Log$ // Revision 1.3 2009/09/08 14:23:16 taurel // - No real change, just to make CVS quiet // // Revision 1.2 2009/04/20 14:55:58 jlpons // Added GPL header, changed memory allocation to C++ fashion. // //============================================================================= // // File: jpeg_encoder.cpp // Description: Main encoding functions // Program: Simple jpeg coding/decoding library // Author: JL Pons 2009 // #include #include #include #include "jpeg_lib.h" #include "jpeg_const.h" #include "jpeg_memory.h" #include "jpeg_bitstream.h" /* These are the sample quantization tables given in JPEG spec section K.1. * The spec says that the values given produce "good" quality, and * when divided by 2, "very good" quality. */ static double std_luminance_quant_tbl[] = { 16.0, 11.0, 10.0, 16.0, 24.0, 40.0, 51.0, 61.0, 12.0, 12.0, 14.0, 19.0, 26.0, 58.0, 60.0, 55.0, 14.0, 13.0, 16.0, 24.0, 40.0, 57.0, 69.0, 56.0, 14.0, 17.0, 22.0, 29.0, 51.0, 87.0, 80.0, 62.0, 18.0, 22.0, 37.0, 56.0, 68.0, 109.0, 103.0, 77.0, 24.0, 35.0, 55.0, 64.0, 81.0, 104.0, 113.0, 92.0, 49.0, 64.0, 78.0, 87.0, 103.0, 121.0, 120.0, 101.0, 72.0, 92.0, 95.0, 98.0, 112.0, 100.0, 103.0, 99.0 }; static double std_chrominance_quant_tbl[] = { 17.0, 18.0, 24.0, 47.0, 99.0, 99.0, 99.0, 99.0, 18.0, 21.0, 26.0, 66.0, 99.0, 99.0, 99.0, 99.0, 24.0, 26.0, 56.0, 99.0, 99.0, 99.0, 99.0, 99.0, 47.0, 66.0, 99.0, 99.0, 99.0, 99.0, 99.0, 99.0, 99.0, 99.0, 99.0, 99.0, 99.0, 99.0, 99.0, 99.0, 99.0, 99.0, 99.0, 99.0, 99.0, 99.0, 99.0, 99.0, 99.0, 99.0, 99.0, 99.0, 99.0, 99.0, 99.0, 99.0, 99.0, 99.0, 99.0, 99.0, 99.0, 99.0, 99.0, 99.0 }; // Zig zag order int jpgZag[64] = { 0, 1, 8, 16, 9, 2, 3, 10, 17, 24, 32, 25, 18, 11, 4, 5, 12, 19, 26, 33, 40, 48, 41, 34, 27, 20, 13, 6, 7, 14, 21, 28, 35, 42, 49, 56, 57, 50, 43, 36, 29, 22, 15, 23, 30, 37, 44, 51, 58, 59, 52, 45, 38, 31, 39, 46, 53, 60, 61, 54, 47, 55, 62, 63, }; // Default Huffman table static unsigned char bits_dc_luminance[17] = { 0, 0, 1, 5, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0 }; static unsigned char val_dc_luminance[] = { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11 }; static unsigned char bits_dc_chrominance[17] = { 0, 0, 3, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0 }; //static unsigned char val_dc_chrominance[] = // { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11 }; static unsigned char bits_ac_luminance[17] = { 0, 0, 2, 1, 3, 3, 2, 4, 3, 5, 5, 4, 4, 0, 0, 1, 0x7d }; static unsigned char val_ac_luminance[] = { 0x01, 0x02, 0x03, 0x00, 0x04, 0x11, 0x05, 0x12, 0x21, 0x31, 0x41, 0x06, 0x13, 0x51, 0x61, 0x07, 0x22, 0x71, 0x14, 0x32, 0x81, 0x91, 0xa1, 0x08, 0x23, 0x42, 0xb1, 0xc1, 0x15, 0x52, 0xd1, 0xf0, 0x24, 0x33, 0x62, 0x72, 0x82, 0x09, 0x0a, 0x16, 0x17, 0x18, 0x19, 0x1a, 0x25, 0x26, 0x27, 0x28, 0x29, 0x2a, 0x34, 0x35, 0x36, 0x37, 0x38, 0x39, 0x3a, 0x43, 0x44, 0x45, 0x46, 0x47, 0x48, 0x49, 0x4a, 0x53, 0x54, 0x55, 0x56, 0x57, 0x58, 0x59, 0x5a, 0x63, 0x64, 0x65, 0x66, 0x67, 0x68, 0x69, 0x6a, 0x73, 0x74, 0x75, 0x76, 0x77, 0x78, 0x79, 0x7a, 0x83, 0x84, 0x85, 0x86, 0x87, 0x88, 0x89, 0x8a, 0x92, 0x93, 0x94, 0x95, 0x96, 0x97, 0x98, 0x99, 0x9a, 0xa2, 0xa3, 0xa4, 0xa5, 0xa6, 0xa7, 0xa8, 0xa9, 0xaa, 0xb2, 0xb3, 0xb4, 0xb5, 0xb6, 0xb7, 0xb8, 0xb9, 0xba, 0xc2, 0xc3, 0xc4, 0xc5, 0xc6, 0xc7, 0xc8, 0xc9, 0xca, 0xd2, 0xd3, 0xd4, 0xd5, 0xd6, 0xd7, 0xd8, 0xd9, 0xda, 0xe1, 0xe2, 0xe3, 0xe4, 0xe5, 0xe6, 0xe7, 0xe8, 0xe9, 0xea, 0xf1, 0xf2, 0xf3, 0xf4, 0xf5, 0xf6, 0xf7, 0xf8, 0xf9, 0xfa }; static unsigned char bits_ac_chrominance[17] = { 0, 0, 2, 1, 2, 4, 4, 3, 4, 7, 5, 4, 4, 0, 1, 2, 0x77 }; /*static unsigned char val_ac_chrominance[] = { 0x00, 0x01, 0x02, 0x03, 0x11, 0x04, 0x05, 0x21, 0x31, 0x06, 0x12, 0x41, 0x51, 0x07, 0x61, 0x71, 0x13, 0x22, 0x32, 0x81, 0x08, 0x14, 0x42, 0x91, 0xa1, 0xb1, 0xc1, 0x09, 0x23, 0x33, 0x52, 0xf0, 0x15, 0x62, 0x72, 0xd1, 0x0a, 0x16, 0x24, 0x34, 0xe1, 0x25, 0xf1, 0x17, 0x18, 0x19, 0x1a, 0x26, 0x27, 0x28, 0x29, 0x2a, 0x35, 0x36, 0x37, 0x38, 0x39, 0x3a, 0x43, 0x44, 0x45, 0x46, 0x47, 0x48, 0x49, 0x4a, 0x53, 0x54, 0x55, 0x56, 0x57, 0x58, 0x59, 0x5a, 0x63, 0x64, 0x65, 0x66, 0x67, 0x68, 0x69, 0x6a, 0x73, 0x74, 0x75, 0x76, 0x77, 0x78, 0x79, 0x7a, 0x82, 0x83, 0x84, 0x85, 0x86, 0x87, 0x88, 0x89, 0x8a, 0x92, 0x93, 0x94, 0x95, 0x96, 0x97, 0x98, 0x99, 0x9a, 0xa2, 0xa3, 0xa4, 0xa5, 0xa6, 0xa7, 0xa8, 0xa9, 0xaa, 0xb2, 0xb3, 0xb4, 0xb5, 0xb6, 0xb7, 0xb8, 0xb9, 0xba, 0xc2, 0xc3, 0xc4, 0xc5, 0xc6, 0xc7, 0xc8, 0xc9, 0xca, 0xd2, 0xd3, 0xd4, 0xd5, 0xd6, 0xd7, 0xd8, 0xd9, 0xda, 0xe2, 0xe3, 0xe4, 0xe5, 0xe6, 0xe7, 0xe8, 0xe9, 0xea, 0xf2, 0xf3, 0xf4, 0xf5, 0xf6, 0xf7, 0xf8, 0xf9, 0xfa };*/ // color conversion declaration (jpeg_color.cpp) void jpeg_init_color(); void jpeg_rgb32_to_ycc(int width,int height,int outWidth,int outHeight,unsigned char *rgb32,short *ycc); void jpeg_rgb24_to_ycc(int width,int height,int outWidth,int outHeight,unsigned char *rgb32,short *ycc); void jpeg_gray8_to_y(int width,int height,int outWidth,int outHeight,unsigned char *gray8,short *y); // Forward dct (jpeg_dct.cpp) void jpeg_fdct(short *block); void jpeg_fdct_mmx(short *block); // ---------------------------------------------------------------- // Start of Image marker static void jpeg_write_SOI(OutputBitStream *bs) { bs->put_byte(0xFF); bs->put_byte(M_SOI); } static void jpeg_write_EOI(OutputBitStream *bs) { bs->put_byte(0xFF); bs->put_byte(M_EOI); } // ---------------------------------------------------------------- // Quantization table static void jpeg_write_DQT(OutputBitStream *bs,short *qTable,int tableId,int prec) { int mSize; bs->put_byte(0xFF); bs->put_byte(M_DQT); if( prec ) mSize = 64*2 + 1 + 2; else mSize = 64 + 1 + 2; bs->put_short( mSize ); bs->put_byte( (prec<<4) + tableId ); for (int i=0;i<64;i++) { unsigned short val = (qTable[jpgZag[i]] >> 3); if (prec) bs->put_byte( val>>8 ); bs->put_byte( val & 0xFF ); } } // ---------------------------------------------------------------- static void jpeg_scale_qtable(double quality,double *qTable,short *out,int *prec) { // Set up quality 1->poor, 100->max // This model gives approximately a linear increase of the file size // according to the quality value. When quality is set to 100.0, all // quatization values are set to 1 => No loss due to quatization. double qualityFactor = 0.01; if( quality<1.0 ) quality=1.0; if( quality>100.0 ) quality=100.0; if( quality<100.0 ) qualityFactor = - 0.1/log( 1.0 - (quality/100.0) ); *prec = 0; for(int i=0;i<64;i++) { short val = (short)( qTable[i]*qualityFactor + 0.5 ); if( val<1 ) val = 1; if( val>255 ) *prec=1; out[i] = val << 3; // *8 for DCT scaling } } // ---------------------------------------------------------------- static void jpeg_init_htable(HUFFMANTABLE *table,unsigned char *bits,unsigned char *vals) { int p, i, l, lastp, si; char huffsize[257]; unsigned int huffcode[257]; unsigned int code; // Does not perform checks (encoding phase with valid tables) table->huffBits = bits; table->huffVal = vals; p = 0; for (l = 1; l <= 16; l++) { i = (int) bits[l]; while (i--) huffsize[p++] = (char) l; } huffsize[p] = 0; lastp = p; code = 0; si = huffsize[0]; p = 0; while (huffsize[p]) { while (((int) huffsize[p]) == si) { huffcode[p++] = code; code++; } code <<= 1; si++; } memset(table->huffSize,0,256); for (p = 0; p < lastp; p++) { i = vals[p]; table->huffCode[i] = huffcode[p]; table->huffSize[i] = huffsize[p]; } } // ---------------------------------------------------------------- static void jpeg_write_DHT(OutputBitStream *bs,HUFFMANTABLE *table,int tableId) { int mSize; int lgth = 0; bs->put_byte(0xFF); bs->put_byte(M_DHT); for (int i=1;i<=16;i++) lgth += table->huffBits[i]; mSize = lgth + 2 + 1 + 16; bs->put_short( mSize ); bs->put_byte( tableId ); for (int i=1;i<=16;i++) bs->put_byte(table->huffBits[i]); for (int i=0;iput_byte(table->huffVal[i]); } // ---------------------------------------------------------------- static void jpeg_write_SOF(OutputBitStream *bs,int width,int height,JPGCOMPONENT *comps,int nbComp) { int mSize = 3 * nbComp + 2 + 5 + 1; bs->put_byte(0xFF); bs->put_byte(M_SOF1); bs->put_short( mSize ); bs->put_byte( 8 ); // Precision bs->put_short(height); bs->put_short(width); bs->put_byte(nbComp); for (int i=0;iput_byte(comps[i].id); bs->put_byte((comps[i].horzSampling << 4) + comps[i].vertSampling); bs->put_byte(comps[i].quantIdx); } } // ---------------------------------------------------------------- static void jpeg_write_SOS(OutputBitStream *bs,JPGCOMPONENT *comps,int nbComp) { int mSize = 2 * nbComp + 2 + 1 + 3; bs->put_byte(0xFF); bs->put_byte(M_SOS); bs->put_short( mSize ); bs->put_byte(nbComp); for (int i=0;iput_byte(comps[i].id); bs->put_byte((comps[i].dcIdx << 4) + comps[i].acIdx); } bs->put_byte(0); // Spectral start (progressive only) bs->put_byte(63); // Spectral end (progressive only) bs->put_byte(0); // Successive approx. high,low (progressive only) } // ---------------------------------------------------------------- static void jpeg_quantize_block(short *blocks,unsigned short *qDiv) { //#ifdef JPG_USE_ASM #if 0 short mmRound[] = { 0x7FFF,0x7FFF,0,0 }; short mmOne[] = { 1,1,0,0 }; _asm { mov edi,blocks mov esi,qDiv movq mm0,mmRound movq mm1,mmOne mov ecx,8 _sseqrows: movd mm2,[edi] movd mm4,[edi+4] movd mm3,[esi] movd mm5,[esi+4] punpcklwd mm2,mm0 punpcklwd mm3,mm1 punpcklwd mm4,mm0 punpcklwd mm5,mm1 pmaddwd mm2,mm3 pmaddwd mm4,mm5 pshufw mm6,mm2,141 pshufw mm7,mm4,141 movd [edi],mm6 movd [edi+4],mm7 movd mm2,[edi+8] movd mm4,[edi+12] movd mm3,[esi+8] movd mm5,[esi+12] punpcklwd mm2,mm0 punpcklwd mm3,mm1 punpcklwd mm4,mm0 punpcklwd mm5,mm1 pmaddwd mm2,mm3 pmaddwd mm4,mm5 pshufw mm6,mm2,141 pshufw mm7,mm4,141 movd [edi+8],mm6 movd [edi+12],mm7 add edi,16 add esi,16 dec ecx jnz _sseqrows emms } #else int val; for(int i=0;i<64;i++) { val = (int)blocks[i]; val *= (int)qDiv[i]; val += 32767; // round val >>= 16; blocks[i] = val; } #endif } // ---------------------------------------------------------------- static void jpeg_encode_rgb(int width,int height,unsigned char *rgb,double quality, int *jpegSize,unsigned char **jpegData,int rgbW) { short lumQuant[64]; // Luminance quantization table short chrQuant[64]; // Chrominance quantization table unsigned short *lumDiv; // Luminance quantization table divisor unsigned short *chrDiv; // Chrominance quantization table divisor JPGCOMPONENT comps[3]; // Components YCbCr HUFFMANTABLE hTables[4]; // Huffman tables int prec; int rWidth = ((width +15)>>4) * 16; int rHeight = ((height+15)>>4) * 16; OutputBitStream *bs = new OutputBitStream(); // Header jpeg_write_SOI(bs); // Quatization tables jpeg_scale_qtable(quality,std_luminance_quant_tbl,lumQuant,&prec); jpeg_scale_qtable(quality,std_chrominance_quant_tbl,chrQuant,&prec); jpeg_write_DQT(bs,lumQuant,0,prec); jpeg_write_DQT(bs,chrQuant,1,prec); // Huffman tables jpeg_init_htable(hTables+0,bits_dc_luminance,val_dc_luminance); jpeg_init_htable(hTables+1,bits_ac_luminance,val_ac_luminance); jpeg_init_htable(hTables+2,bits_dc_chrominance,val_dc_luminance); jpeg_init_htable(hTables+3,bits_ac_chrominance,val_ac_luminance); jpeg_write_DHT(bs,hTables+0,0); jpeg_write_DHT(bs,hTables+1,0+0x10); jpeg_write_DHT(bs,hTables+2,1); jpeg_write_DHT(bs,hTables+3,1+0x10); // Luminance component (Y) comps[0].horzSampling = 2; comps[0].vertSampling = 2; comps[0].id = 1; comps[0].quantIdx = 0; comps[0].dcIdx = 0; comps[0].acIdx = 0; comps[0].lastDc = 0; // Chrominance component (Cb) comps[1].horzSampling = 1; comps[1].vertSampling = 1; comps[1].id = 2; comps[1].quantIdx = 1; comps[1].dcIdx = 1; comps[1].acIdx = 1; comps[1].lastDc = 0; // Chrominance component (Cr) comps[2].horzSampling = 1; comps[2].vertSampling = 1; comps[2].id = 3; comps[2].quantIdx = 1; comps[2].dcIdx = 1; comps[2].acIdx = 1; comps[2].lastDc = 0; jpeg_write_SOF(bs,width,height,comps,3); jpeg_write_SOS(bs,comps,3); // Initialise quantization divisor lumDiv = (unsigned short *)malloc_16(64*2); chrDiv = (unsigned short *)malloc_16(64*2); for(int i=0;i<64;i++) { lumDiv[i] = (unsigned short)( 65536.0/(double)lumQuant[i] + 0.5 ); chrDiv[i] = (unsigned short)( 65536.0/(double)chrQuant[i] + 0.5 ); } // Convert to YUV jpeg_init_color(); short *ycc = (short *)malloc_16(rWidth*rHeight*3); if( rgbW==24 ) jpeg_rgb24_to_ycc(width,height,rWidth,rHeight,rgb,ycc); else jpeg_rgb32_to_ycc(width,height,rWidth,rHeight,rgb,ycc); // Encode blocks (downsampling :2 for Cb and Cr) int nbMCU = rWidth/16 * rHeight/16; short *block = ycc; for(int i=0;iinit(); for(int i=0;iencode_block(block+0 ,hTables+0,hTables+1,&(comps[0].lastDc)); bs->encode_block(block+64 ,hTables+0,hTables+1,&(comps[0].lastDc)); bs->encode_block(block+128,hTables+0,hTables+1,&(comps[0].lastDc)); bs->encode_block(block+192,hTables+0,hTables+1,&(comps[0].lastDc)); // Chrominance bs->encode_block(block+256,hTables+2,hTables+3,&(comps[1].lastDc)); bs->encode_block(block+320,hTables+2,hTables+3,&(comps[2].lastDc)); block+=384; } bs->flush(); jpeg_write_EOI(bs); free_16(ycc); free_16(lumDiv); free_16(chrDiv); *jpegData = (unsigned char *)malloc(bs->get_size()); *jpegSize = bs->get_size(); memcpy(*jpegData,bs->get_data(),bs->get_size()); delete bs; } // -------------------------------------------------------------------------- void jpeg_encode_rgb32(int width,int height,unsigned char *rgb32,double quality, int *jpegSize,unsigned char **jpegData) { jpeg_encode_rgb(width,height,rgb32,quality,jpegSize,jpegData,32); } void jpeg_encode_rgb24(int width,int height,unsigned char *rgb24,double quality, int *jpegSize,unsigned char **jpegData) { jpeg_encode_rgb(width,height,rgb24,quality,jpegSize,jpegData,24); } // -------------------------------------------------------------------------- void jpeg_encode_gray8(int width,int height,unsigned char *gray8,double quality, int *jpegSize,unsigned char **jpegData) { short lumQuant[64]; // Luminance quantization table unsigned short *lumDiv; // Luminance quantization table divisor JPGCOMPONENT comps[1]; // Component Y HUFFMANTABLE hTables[2]; // Huffman tables int prec; int rWidth = ((width +7)>>3) * 8; int rHeight = ((height+7)>>3) * 8; OutputBitStream *bs = new OutputBitStream(); // Header jpeg_write_SOI(bs); // Quatization tables jpeg_scale_qtable(quality,std_luminance_quant_tbl,lumQuant,&prec); jpeg_write_DQT(bs,lumQuant,0,prec); // Huffman tables jpeg_init_htable(hTables+0,bits_dc_luminance,val_dc_luminance); jpeg_init_htable(hTables+1,bits_ac_luminance,val_ac_luminance); jpeg_write_DHT(bs,hTables+0,0); jpeg_write_DHT(bs,hTables+1,0+0x10); // Luminance component (Y) comps[0].horzSampling = 1; comps[0].vertSampling = 1; comps[0].id = 1; comps[0].quantIdx = 0; comps[0].dcIdx = 0; comps[0].acIdx = 0; comps[0].lastDc = 0; jpeg_write_SOF(bs,width,height,comps,1); jpeg_write_SOS(bs,comps,1); // Initialise quantization divisor lumDiv = (unsigned short *)malloc_16(64*2); for(int i=0;i<64;i++) { lumDiv[i] = (unsigned short)( 65536.0/(double)lumQuant[i] + 0.5 ); } // Convert to YUV jpeg_init_color(); short *ycc = (short *)malloc_16(rWidth*rHeight*2); jpeg_gray8_to_y(width,height,rWidth,rHeight,gray8,ycc); // Encode blocks (downsampling :2 for Cb and Cr) int nbMCU = rWidth/8 * rHeight/8; short *block = ycc; for(int i=0;iinit(); for(int i=0;iencode_block(block,hTables+0,hTables+1,&(comps[0].lastDc)); block+=64; } bs->flush(); jpeg_write_EOI(bs); free_16(ycc); free_16(lumDiv); *jpegData = (unsigned char *)malloc(bs->get_size()); *jpegSize = bs->get_size(); memcpy(*jpegData,bs->get_data(),bs->get_size()); delete bs; } tango-8.1.2c+dfsg.orig/lib/cpp/server/jpeg/jpeg_lib.h0000644000175000017500000000560212205375140021304 0ustar piccapicca///============================================================================= // // file : jpeg_lib.h // // description : Simple jpeg coding/decoding library // MMX optimisation supported for both Visual C++ and gcc // Main library header file // // project : TANGO // // author(s) : JL Pons // // Copyright (C) : 2004,2005,2006,2007,2008,2009,2010,2011,2012,2013 // European Synchrotron Radiation Facility // BP 220, Grenoble 38043 // FRANCE // // This file is part of Tango. // // Tango 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. // // Tango 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 Tango. If not, see . // // $Revision: 22213 $ // // $Log$ // Revision 1.2 2009/04/20 14:55:58 jlpons // Added GPL header, changed memory allocation to C++ fashion. // //============================================================================= #ifndef _JPEGLIBH_ #define _JPEGLIBH_ // ---------------------------------------------------------------------------- // Encode a RGB image to a buffer // quality ranges in 0(poor), 100(max) // jpegData is allocated by the function and must be freed by the caller. // ---------------------------------------------------------------------------- void jpeg_encode_rgb32(int width,int height,unsigned char *rgb32, double quality,int *jpegSize,unsigned char **jpegData); void jpeg_encode_rgb24(int width,int height,unsigned char *rgb24, double quality,int *jpegSize,unsigned char **jpegData); void jpeg_encode_gray8(int width,int height,unsigned char *gray8, double quality,int *jpegSize,unsigned char **jpegData); // ---------------------------------------------------------------------------- // Decode a JPEG image and return error code in case of failure, 0 is returned // otherwise. frame is a pointer to a set of 8bit sample (8bit gray scale or // 32bit rgb format) which is allocated by the function and must be freed by // the caller. // ---------------------------------------------------------------------------- #define JPEG_GRAY_FORMAT 0 #define JPEG_RGB32_FORMAT 1 int jpeg_decode(int jpegSize,unsigned char *jpegData, int *width,int *height,int *format,unsigned char **frame); // Return error message char *jpeg_get_error_msg(int code); #endif /* _JPEGLIBH_ */ tango-8.1.2c+dfsg.orig/lib/cpp/server/jpeg/jpeg_bitstream.h0000644000175000017500000000567412205375140022541 0ustar piccapicca///============================================================================= // // file : jpeg_bitstream.h // // description : Simple jpeg coding/decoding library // Bitstream management and huffman coding // // project : TANGO // // author(s) : JL Pons // // Copyright (C) : 2004,2005,2006,2007,2008,2009,2010,2011,2012,2013 // European Synchrotron Radiation Facility // BP 220, Grenoble 38043 // FRANCE // // This file is part of Tango. // // Tango 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. // // Tango 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 Tango. If not, see . // // $Revision: 22213 $ // // $Log$ // Revision 1.3 2009/04/20 14:55:58 jlpons // Added GPL header, changed memory allocation to C++ fashion. // //============================================================================= #ifndef _JPEGBITSTREAMH_ #define _JPEGBITSTREAMH_ #include "jpeg_lib.h" #include "jpeg_const.h" #define BUFFER_SIZE 524288 // ------------------------------------------------------------ class OutputBitStream { public: OutputBitStream(); ~OutputBitStream(); void align(); void flush(); void init(); unsigned char *get_data(); unsigned long get_size(); void put_bits(int code,int _size); void put_byte(unsigned char code); void put_byteI(unsigned char code); void put_short(unsigned short code); void encode_block(short *block,HUFFMANTABLE *hDC,HUFFMANTABLE *hAC,short *lastDc); private: void more_byte(); void load_mm(); unsigned char *buffer; int nbByte; int buffSize; int nbBits; #ifdef _WINDOWS unsigned long bits; #else unsigned int bits; #endif unsigned char *bufferPtr; unsigned char *numbits; unsigned char bScratch[4]; }; // ------------------------------------------------------------ class InputBitStream { public: InputBitStream(unsigned char *buff,int buffSize); ~InputBitStream(); void align(); void flush(); void init(); int get_byte(); int backward(int l); int get_bits(int numbits); int decode_mcu(JPGDECODER *decoder); private: unsigned char *_buffer; int _buffSize; int _byteRead; int _nbBits; #ifdef _WINDOWS unsigned long _bits; #else unsigned int _bits; #endif unsigned char *_bufferPtr; }; #endif /* _JPEGBITSTREAMH_ */ tango-8.1.2c+dfsg.orig/lib/cpp/server/jpeg/Makefile.in0000644000175000017500000004465412205375243021443 0ustar piccapicca# Makefile.in generated by automake 1.11.3 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 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. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ subdir = lib/cpp/server/jpeg DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/RSSH_CHECK_OMNIORB.m4 \ $(top_srcdir)/m4/RSSH_CHECK_PTHREADS.m4 \ $(top_srcdir)/m4/RSSH_CHECK_SUNPRO_CC.m4 \ $(top_srcdir)/m4/RSSH_ENABLE_PTHREADS.m4 \ $(top_srcdir)/m4/ac_cxx_have_class_strstream.m4 \ $(top_srcdir)/m4/ac_cxx_have_sstream.m4 \ $(top_srcdir)/m4/ac_cxx_namespaces.m4 \ $(top_srcdir)/m4/ac_path_mysqlclient.m4 \ $(top_srcdir)/m4/ac_prog_mysql.m4 \ $(top_srcdir)/m4/ax_cxx_compile_stdcxx_11.m4 \ $(top_srcdir)/m4/ax_jni_include_dir.m4 \ $(top_srcdir)/m4/check_zlib.m4 $(top_srcdir)/m4/gcc_release.m4 \ $(top_srcdir)/m4/java_release.m4 $(top_srcdir)/m4/libtool.m4 \ $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ $(top_srcdir)/m4/mysql_release.m4 $(top_srcdir)/configure.in am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/ac_config.h.tmp CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = LTLIBRARIES = $(noinst_LTLIBRARIES) libjpeg_la_LIBADD = am_libjpeg_la_OBJECTS = jpeg_bitstream.lo jpeg_color.lo jpeg_dct.lo \ jpeg_decoder.lo jpeg_encoder.lo jpeg_memory.lo libjpeg_la_OBJECTS = $(am_libjpeg_la_OBJECTS) DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) depcomp = $(SHELL) $(top_srcdir)/config/depcomp am__depfiles_maybe = depfiles am__mv = mv -f CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) LTCXXCOMPILE = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) CXXLD = $(CXX) CXXLINK = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=link $(CXXLD) $(AM_CXXFLAGS) $(CXXFLAGS) $(AM_LDFLAGS) \ $(LDFLAGS) -o $@ 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 = $(libjpeg_la_SOURCES) DIST_SOURCES = $(libjpeg_la_SOURCES) ETAGS = etags CTAGS = ctags DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ ALLOCA = @ALLOCA@ AMTAR = @AMTAR@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CORBA_INCLUDES = @CORBA_INCLUDES@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CPP_ELEVEN = @CPP_ELEVEN@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DATADIR = @DATADIR@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DOXYGEN = @DOXYGEN@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ GREP = @GREP@ HAVE_CXX11 = @HAVE_CXX11@ HAVE_ORB_IDL = @HAVE_ORB_IDL@ IDL = @IDL@ IDLCXX = @IDLCXX@ IDLCXXFLAGS = @IDLCXXFLAGS@ IDLFLAGS = @IDLFLAGS@ IDL_CLN_CPP = @IDL_CLN_CPP@ IDL_CLN_CPP_SUFFIX = @IDL_CLN_CPP_SUFFIX@ IDL_CLN_H = @IDL_CLN_H@ IDL_CLN_H1_SUFFIX = @IDL_CLN_H1_SUFFIX@ IDL_CLN_H_SUFFIX = @IDL_CLN_H_SUFFIX@ IDL_CLN_O = @IDL_CLN_O@ IDL_CLN_OBJ_SUFFIX = @IDL_CLN_OBJ_SUFFIX@ IDL_H1_SUFFIX = @IDL_H1_SUFFIX@ IDL_H_SUFFIX = @IDL_H_SUFFIX@ IDL_SRV_CPP = @IDL_SRV_CPP@ IDL_SRV_CPP_SUFFIX = @IDL_SRV_CPP_SUFFIX@ IDL_SRV_H = @IDL_SRV_H@ IDL_SRV_H1_SUFFIX = @IDL_SRV_H1_SUFFIX@ IDL_SRV_H_SUFFIX = @IDL_SRV_H_SUFFIX@ IDL_SRV_O = @IDL_SRV_O@ IDL_SRV_OBJ_SUFFIX = @IDL_SRV_OBJ_SUFFIX@ IDL_TIE_CPP_SUFFIX = @IDL_TIE_CPP_SUFFIX@ IDL_TIE_H1_SUFFIX = @IDL_TIE_H1_SUFFIX@ IDL_TIE_H_SUFFIX = @IDL_TIE_H_SUFFIX@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ JAVA = @JAVA@ JAVAC = @JAVAC@ JAVAH = @JAVAH@ JNI_INCL_DIRS = @JNI_INCL_DIRS@ JPEG_LIB_CXXFLAGS = @JPEG_LIB_CXXFLAGS@ JPEG_MMX_LIB_CXXFLAGS = @JPEG_MMX_LIB_CXXFLAGS@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIBZMQ_CFLAGS = @LIBZMQ_CFLAGS@ LIBZMQ_LIBS = @LIBZMQ_LIBS@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ LYX = @LYX@ MAINT = @MAINT@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ MYSQL = @MYSQL@ MYSQLCLIENT_CFLAGS = @MYSQLCLIENT_CFLAGS@ MYSQLCLIENT_LDFLAGS = @MYSQLCLIENT_LDFLAGS@ MYSQLCLIENT_LIBS = @MYSQLCLIENT_LIBS@ MYSQL_ADMIN = @MYSQL_ADMIN@ MYSQL_ADMIN_PASSWD = @MYSQL_ADMIN_PASSWD@ MYSQL_HOST = @MYSQL_HOST@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ ORB = @ORB@ ORB_COSNAMING_LIB = @ORB_COSNAMING_LIB@ ORB_INCLUDE_PREFIX = @ORB_INCLUDE_PREFIX@ ORB_PREFIX = @ORB_PREFIX@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ TANGO_DB_NAME = @TANGO_DB_NAME@ TANGO_RC_FILE = @TANGO_RC_FILE@ VERSION = @VERSION@ VERSION_INFO = @VERSION_INFO@ ZLIB_CPPFLAGS = @ZLIB_CPPFLAGS@ ZLIB_LDFLAGS = @ZLIB_LDFLAGS@ ZLIB_LIBS = @ZLIB_LIBS@ ZMQ_PREFIX = @ZMQ_PREFIX@ _ACJNI_JAVAC = @_ACJNI_JAVAC@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_aux_dir = @ac_aux_dir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ omniCOS4_CFLAGS = @omniCOS4_CFLAGS@ omniCOS4_LIBS = @omniCOS4_LIBS@ omniORB4_CFLAGS = @omniORB4_CFLAGS@ omniORB4_LIBS = @omniORB4_LIBS@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ subdirs = @subdirs@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ # We need the ORB to compile and the tango header files to compile INCLUDES = -I$(top_srcdir)/lib/cpp/server \ -I$(top_srcdir)/lib/cpp/log4tango/include \ -I$(top_builddir)/lib/cpp/log4tango/include \ $(ORB_INCLUDE_PREFIX) $(LIBZMQ_CFLAGS) # We're making a libtool convenience library which is not to be installed, # therefore the automake noinst variable noinst_LTLIBRARIES = libjpeg.la AM_CXXFLAGS = @JPEG_LIB_CXXFLAGS@ # These are the sources for the library. libjpeg_la_SOURCES = jpeg_bitstream.cpp \ jpeg_color.cpp \ jpeg_dct.cpp \ jpeg_decoder.cpp \ jpeg_encoder.cpp \ jpeg_memory.cpp \ jpeg_bitstream.h \ jpeg_const.h \ jpeg_lib.h \ jpeg_memory.h all: all-am .SUFFIXES: .SUFFIXES: .cpp .lo .o .obj $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu lib/cpp/server/jpeg/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu lib/cpp/server/jpeg/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): 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 libjpeg.la: $(libjpeg_la_OBJECTS) $(libjpeg_la_DEPENDENCIES) $(EXTRA_libjpeg_la_DEPENDENCIES) $(CXXLINK) $(libjpeg_la_OBJECTS) $(libjpeg_la_LIBADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/jpeg_bitstream.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/jpeg_color.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/jpeg_dct.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/jpeg_decoder.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/jpeg_encoder.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/jpeg_memory.Plo@am__quote@ .cpp.o: @am__fastdepCXX_TRUE@ $(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(CXXCOMPILE) -c -o $@ $< .cpp.obj: @am__fastdepCXX_TRUE@ $(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` @am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'` .cpp.lo: @am__fastdepCXX_TRUE@ $(LTCXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(LTCXXCOMPILE) -c -o $@ $< mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ mkid -fID $$unique tags: TAGS TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) set x; \ here=`pwd`; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: CTAGS CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(LTLIBRARIES) installdirs: install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: 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: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-generic clean-libtool clean-noinstLTLIBRARIES \ mostlyclean-am distclean: distclean-am -rm -rf ./$(DEPDIR) -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -rf ./$(DEPDIR) -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: .MAKE: install-am install-strip .PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \ clean-libtool clean-noinstLTLIBRARIES ctags 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 \ maintainer-clean maintainer-clean-generic mostlyclean \ mostlyclean-compile mostlyclean-generic mostlyclean-libtool \ pdf pdf-am ps ps-am tags uninstall uninstall-am # 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: tango-8.1.2c+dfsg.orig/lib/cpp/server/jpeg/jpeg_dct.cpp0000644000175000017500000002430212205375140021641 0ustar piccapicca///============================================================================= // // file : jpeg_dct.cpp // // description : Simple jpeg coding/decoding library // Discrete Cosine Transform (8x8) // // project : TANGO // // author(s) : JL Pons // // Copyright (C) : 2004,2005,2006,2007,2008,2009,2010,2011,2012,2013 // European Synchrotron Radiation Facility // BP 220, Grenoble 38043 // FRANCE // // This file is part of Tango. // // Tango 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. // // Tango 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 Tango. If not, see . // // $Revision: 22213 $ // // $Log$ // Revision 1.2 2009/04/20 14:55:58 jlpons // Added GPL header, changed memory allocation to C++ fashion. // //============================================================================= // C implementation comes from JPEG library by Thomas G. Lane #include "jpeg_lib.h" #define SHIFT2(x) (((x) + 2) >> 2 ) #define SHIFT11(x) (((x) + 2048) >> 11) #define SHIFT15(x) (((x) + 32768) >> 15) #define FIXPOINT 13 #define _1 ((long)1) #define SCALE (_1 << FIXPOINT) #define CLIP(x) if (x & 0xFF00) x = (((~x) >> 15) & 0xFF) #define ROUND(x,n) (((x) + (_1 << ((n)-1))) >> (n)) #define FIX_0_298631336 ((long) 2446) /* 0.298631336 -c1+c3+c5-c7 */ #define FIX_0_390180644 ((long) 3196) /* 0.390180644 c5-c3 (neg) */ #define FIX_0_541196100 ((long) 4433) /* 0.541196100 c6 */ #define FIX_0_765366865 ((long) 6270) /* 0.765366865 c2-c6 */ #define FIX_0_899976223 ((long) 7373) /* 0.899976223 c7-c3 (neg) */ #define FIX_1_175875602 ((long) 9633) /* 1.175875602 c3 */ #define FIX_1_501321110 ((long) 12299) /* 1.501321110 c1+c3-c5-c7 */ #define FIX_1_847759065 ((long) 15137) /* 1.847759065 -c2-c6 (neg) */ #define FIX_1_961570560 ((long) 16069) /* 1.961570560 -c5-c3 (neg) */ #define FIX_2_053119869 ((long) 16819) /* 2.053119869 c1+c3-c5+c7 */ #define FIX_2_562915447 ((long) 20995) /* 2.562915447 -c1-c3 (neg) */ #define FIX_3_072711026 ((long) 25172) /* 3.072711026 c1+c3+c5-c7 */ void jpeg_fdct( short *block ) { long tmp0, tmp1, tmp2, tmp3, tmp4, tmp5, tmp6, tmp7; long tmp10, tmp11, tmp12, tmp13; long z1, z2, z3, z4, z5; short *dataptr; int ctr; // Process rows dataptr = block; for (ctr = 7; ctr >= 0; ctr--) { tmp0 = (long)dataptr[0] + (long)dataptr[7]; tmp7 = (long)dataptr[0] - (long)dataptr[7]; tmp1 = (long)dataptr[1] + (long)dataptr[6]; tmp6 = (long)dataptr[1] - (long)dataptr[6]; tmp2 = (long)dataptr[2] + (long)dataptr[5]; tmp5 = (long)dataptr[2] - (long)dataptr[5]; tmp3 = (long)dataptr[3] + (long)dataptr[4]; tmp4 = (long)dataptr[3] - (long)dataptr[4]; tmp10 = tmp0 + tmp3; tmp13 = tmp0 - tmp3; tmp11 = tmp1 + tmp2; tmp12 = tmp1 - tmp2; dataptr[0] = (short) ((tmp10 + tmp11) << 2); dataptr[4] = (short) ((tmp10 - tmp11) << 2); z1 = (tmp12 + tmp13)*FIX_0_541196100; dataptr[2] = (short) SHIFT11(z1 + tmp13*FIX_0_765366865); dataptr[6] = (short) SHIFT11(z1 - tmp12*FIX_1_847759065); z1 = tmp4 + tmp7; z2 = tmp5 + tmp6; z3 = tmp4 + tmp6; z4 = tmp5 + tmp7; z5 = (z3 + z4)*FIX_1_175875602; tmp4 *= FIX_0_298631336; tmp5 *= FIX_2_053119869; tmp6 *= FIX_3_072711026; tmp7 *= FIX_1_501321110; z1 *= - FIX_0_899976223; z2 *= - FIX_2_562915447; z3 *= - FIX_1_961570560; z4 *= - FIX_0_390180644; z3 += z5; z4 += z5; dataptr[7] = (short) SHIFT11(tmp4 + z1 + z3); dataptr[5] = (short) SHIFT11(tmp5 + z2 + z4); dataptr[3] = (short) SHIFT11(tmp6 + z2 + z3); dataptr[1] = (short) SHIFT11(tmp7 + z1 + z4); dataptr += 8; } // Process columns dataptr = block; for (ctr = 7; ctr >= 0; ctr--) { tmp0 = (long)dataptr[8*0] + (long)dataptr[8*7]; tmp7 = (long)dataptr[8*0] - (long)dataptr[8*7]; tmp1 = (long)dataptr[8*1] + (long)dataptr[8*6]; tmp6 = (long)dataptr[8*1] - (long)dataptr[8*6]; tmp2 = (long)dataptr[8*2] + (long)dataptr[8*5]; tmp5 = (long)dataptr[8*2] - (long)dataptr[8*5]; tmp3 = (long)dataptr[8*3] + (long)dataptr[8*4]; tmp4 = (long)dataptr[8*3] - (long)dataptr[8*4]; tmp10 = tmp0 + tmp3; tmp13 = tmp0 - tmp3; tmp11 = tmp1 + tmp2; tmp12 = tmp1 - tmp2; dataptr[8*0] = (short) SHIFT2(tmp10 + tmp11); dataptr[8*4] = (short) SHIFT2(tmp10 - tmp11); z1 = (tmp12 + tmp13)*FIX_0_541196100; dataptr[8*2] = (short) SHIFT15(z1 + tmp13*FIX_0_765366865); dataptr[8*6] = (short) SHIFT15(z1 - tmp12*FIX_1_847759065); z1 = tmp4 + tmp7; z2 = tmp5 + tmp6; z3 = tmp4 + tmp6; z4 = tmp5 + tmp7; z5 = (z3 + z4)*FIX_1_175875602; tmp4 *= FIX_0_298631336; tmp5 *= FIX_2_053119869; tmp6 *= FIX_3_072711026; tmp7 *= FIX_1_501321110; z1 *= -FIX_0_899976223; z2 *= -FIX_2_562915447; z3 *= -FIX_1_961570560; z4 *= -FIX_0_390180644; z3 += z5; z4 += z5; dataptr[8*7] = (short) SHIFT15(tmp4 + z1 + z3); dataptr[8*5] = (short) SHIFT15(tmp5 + z2 + z4); dataptr[8*3] = (short) SHIFT15(tmp6 + z2 + z3); dataptr[8*1] = (short) SHIFT15(tmp7 + z1 + z4); dataptr++; } } // ------------------------------------------------------------- void jpeg_idct(short *block, unsigned char *dest) { short innerBuff[64]; long tmp0, tmp1, tmp2, tmp3; long tmp10, tmp11, tmp12, tmp13; long z1, z2, z3, z4, z5; short *in,*inner; int i; short v; // Rows in = block; inner = innerBuff; for (i=0;i<8;i++) { if ((in[1] | in[2] | in[3] | in[4] | in[5] | in[6] | in[7]) == 0) { short dc = in[0] << 3; inner[0] = dc; inner[1] = dc; inner[2] = dc; inner[3] = dc; inner[4] = dc; inner[5] = dc; inner[6] = dc; inner[7] = dc; in += 8; inner += 8; continue; } z2 = (long) in[2]; z3 = (long) in[6]; z1 = (z2 + z3)*FIX_0_541196100; tmp2 = z1 + z3*(- FIX_1_847759065); tmp3 = z1 + z2*FIX_0_765366865; tmp0 = ((long) in[0] + (long) in[4]) << FIXPOINT; tmp1 = ((long) in[0] - (long) in[4]) << FIXPOINT; tmp10 = tmp0 + tmp3; tmp13 = tmp0 - tmp3; tmp11 = tmp1 + tmp2; tmp12 = tmp1 - tmp2; tmp0 = (long) in[7]; tmp1 = (long) in[5]; tmp2 = (long) in[3]; tmp3 = (long) in[1]; z1 = tmp0 + tmp3; z2 = tmp1 + tmp2; z3 = tmp0 + tmp2; z4 = tmp1 + tmp3; z5 = (z3 + z4)*FIX_1_175875602; tmp0 = tmp0 * FIX_0_298631336; tmp1 = tmp1 * FIX_2_053119869; tmp2 = tmp2 * FIX_3_072711026; tmp3 = tmp3 * FIX_1_501321110; z1 = z1 * (-FIX_0_899976223); z2 = z2 * (-FIX_2_562915447); z3 = z3 * (-FIX_1_961570560); z4 = z4 * (-FIX_0_390180644); z3 += z5; z4 += z5; tmp0 += z1 + z3; tmp1 += z2 + z4; tmp2 += z2 + z3; tmp3 += z1 + z4; inner[0] = (short) ROUND(tmp10 + tmp3, FIXPOINT-3); inner[1] = (short) ROUND(tmp11 + tmp2, FIXPOINT-3); inner[2] = (short) ROUND(tmp12 + tmp1, FIXPOINT-3); inner[3] = (short) ROUND(tmp13 + tmp0, FIXPOINT-3); inner[4] = (short) ROUND(tmp13 - tmp0, FIXPOINT-3); inner[5] = (short) ROUND(tmp12 - tmp1, FIXPOINT-3); inner[6] = (short) ROUND(tmp11 - tmp2, FIXPOINT-3); inner[7] = (short) ROUND(tmp10 - tmp3, FIXPOINT-3); in += 8; inner += 8; } // Columns in = innerBuff; for(i=0;i<8;i++) { if ((in[8*1] | in[8*2] | in[8*3] | in[8*4]| in[8*5] | in[8*6] | in[8*7]) == 0) { short dc = (short) ROUND((long)in[0], 6) + 128; CLIP(dc); dest[8*0] = (unsigned char)dc; dest[8*1] = (unsigned char)dc; dest[8*2] = (unsigned char)dc; dest[8*3] = (unsigned char)dc; dest[8*4] = (unsigned char)dc; dest[8*5] = (unsigned char)dc; dest[8*6] = (unsigned char)dc; dest[8*7] = (unsigned char)dc; in++; dest++; continue; } z2 = (long) in[8*2]; z3 = (long) in[8*6]; z1 = (z2 + z3)*FIX_0_541196100; tmp2 = z1 + z3 * (-FIX_1_847759065); tmp3 = z1 + z2 * FIX_0_765366865; tmp0 = ((long) in[8*0] + (long) in[8*4]) << FIXPOINT; tmp1 = ((long) in[8*0] - (long) in[8*4]) << FIXPOINT; tmp10 = tmp0 + tmp3; tmp13 = tmp0 - tmp3; tmp11 = tmp1 + tmp2; tmp12 = tmp1 - tmp2; tmp0 = (long) in[8*7]; tmp1 = (long) in[8*5]; tmp2 = (long) in[8*3]; tmp3 = (long) in[8*1]; z1 = tmp0 + tmp3; z2 = tmp1 + tmp2; z3 = tmp0 + tmp2; z4 = tmp1 + tmp3; z5 = (z3 + z4)*FIX_1_175875602; tmp0 = tmp0*FIX_0_298631336; tmp1 = tmp1*FIX_2_053119869; tmp2 = tmp2*FIX_3_072711026; tmp3 = tmp3*FIX_1_501321110; z1 = z1 * (-FIX_0_899976223); z2 = z2 * (-FIX_2_562915447); z3 = z3 * (-FIX_1_961570560); z4 = z4 * (-FIX_0_390180644); z3 += z5; z4 += z5; tmp0 += z1 + z3; tmp1 += z2 + z4; tmp2 += z2 + z3; tmp3 += z1 + z4; v = (short) ROUND(tmp10 + tmp3, FIXPOINT+6) + 128; CLIP(v);dest[8*0] = (unsigned char)v; v = (short) ROUND(tmp11 + tmp2, FIXPOINT+6) + 128; CLIP(v);dest[8*1] = (unsigned char)v; v = (short) ROUND(tmp12 + tmp1, FIXPOINT+6) + 128; CLIP(v);dest[8*2] = (unsigned char)v; v = (short) ROUND(tmp13 + tmp0, FIXPOINT+6) + 128; CLIP(v);dest[8*3] = (unsigned char)v; v = (short) ROUND(tmp13 - tmp0, FIXPOINT+6) + 128; CLIP(v);dest[8*4] = (unsigned char)v; v = (short) ROUND(tmp12 - tmp1, FIXPOINT+6) + 128; CLIP(v);dest[8*5] = (unsigned char)v; v = (short) ROUND(tmp11 - tmp2, FIXPOINT+6) + 128; CLIP(v);dest[8*6] = (unsigned char)v; v = (short) ROUND(tmp10 - tmp3, FIXPOINT+6) + 128; CLIP(v);dest[8*7] = (unsigned char)v; dest++; in++; } } tango-8.1.2c+dfsg.orig/lib/cpp/server/jpeg/Makefile.am0000644000175000017500000000141312205375140021410 0ustar piccapicca # We need the ORB to compile and the tango header files to compile INCLUDES = -I$(top_srcdir)/lib/cpp/server \ -I$(top_srcdir)/lib/cpp/log4tango/include \ -I$(top_builddir)/lib/cpp/log4tango/include \ $(ORB_INCLUDE_PREFIX) $(LIBZMQ_CFLAGS) # We're making a libtool convenience library which is not to be installed, # therefore the automake noinst variable noinst_LTLIBRARIES = libjpeg.la AM_CXXFLAGS=@JPEG_LIB_CXXFLAGS@ # These are the sources for the library. libjpeg_la_SOURCES = jpeg_bitstream.cpp \ jpeg_color.cpp \ jpeg_dct.cpp \ jpeg_decoder.cpp \ jpeg_encoder.cpp \ jpeg_memory.cpp \ jpeg_bitstream.h \ jpeg_const.h \ jpeg_lib.h \ jpeg_memory.h tango-8.1.2c+dfsg.orig/lib/cpp/server/jpeg/jpeg_bitstream.cpp0000644000175000017500000003214412205375140023064 0ustar piccapicca///============================================================================= // // file : jpeg_bitstream.cpp // // description : Simple jpeg coding/decoding library // Bitstream management and huffman coding // // project : TANGO // // author(s) : JL Pons // // Copyright (C) : 2004,2005,2006,2007,2008,2009,2010,2011,2012,2013 // European Synchrotron Radiation Facility // BP 220, Grenoble 38043 // FRANCE // // This file is part of Tango. // // Tango 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. // // Tango 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 Tango. If not, see . // // $Revision: 22213 $ // // $Log$ // Revision 1.3 2009/11/02 08:36:17 taurel // - Fix warnings reported when compiling using the option -Wall // // Revision 1.2 2009/04/20 14:55:58 jlpons // Added GPL header, changed memory allocation to C++ fashion. // //============================================================================= #include "jpeg_bitstream.h" #include #include #include #ifdef _WINDOWS // Disable "has no EMMS instruction" warning #pragma warning( disable : 4799 ) #endif #ifdef _WINDOWS #ifdef JPG_USE_ASM // MMX putbits only for Windows #define JPG_USE_ASM_PB static unsigned short mmComp[] = { 0xFFFF , 0xFFFF , 0xFFFF , 0xFFFF }; #endif #endif extern int jpgZag[]; // --------------------------------------------------------------------- // Output bitstream // ---------------------------------------------------------------- OutputBitStream::OutputBitStream() { buffer = (unsigned char *)malloc(BUFFER_SIZE); buffSize = BUFFER_SIZE; nbByte = 0; nbBits = 0; bits = 0; bufferPtr = buffer; // numbits table (speed up huffman coding) numbits = (unsigned char *)malloc(2048); numbits[0]=0; numbits[1]=1; for(int i=2;i<12;i++) { int s = (1L<<(i-1)); int e = (1L<<(i)); memset(numbits+s,i,e-s); } } // ---------------------------------------------------------------- OutputBitStream::~OutputBitStream() { if(buffer) free(buffer); if(numbits) free(numbits); } // ---------------------------------------------------------------- void OutputBitStream::init() { #ifdef JPG_USE_ASM_PB __asm { pxor mm1,mm1 movq mm5,mmComp } #endif } void OutputBitStream::flush() { align(); #ifdef JPG_USE_ASM_PB // Flush mm buffer _asm { mov edi,this psrlq mm1,32 movd ebx,mm1 mov dword ptr [edi].bScratch,ebx emms } if(nbBits>=8) { put_byte(bScratch[3]);if(bScratch[3]==0xFF) put_byte(0);nbBits-=8; } if(nbBits>=8) { put_byte(bScratch[2]);if(bScratch[2]==0xFF) put_byte(0);nbBits-=8; } if(nbBits>=8) { put_byte(bScratch[1]);if(bScratch[1]==0xFF) put_byte(0);nbBits-=8; } if(nbBits>=8) { put_byte(bScratch[0]);if(bScratch[0]==0xFF) put_byte(0);nbBits-=8; } #endif } void OutputBitStream::load_mm() { #ifdef JPG_USE_ASM_PB __asm { mov edi,this movq mm2,mm1 psllq mm1,32 psrlq mm2,32 movd ebx,mm2 // Enough free bytes ? mov eax,[edi].buffSize sub eax,[edi].nbByte cmp eax,4 jle _pbload8 // Any 0xFF in the stream ? pcmpeqb mm2,mm5 movd eax,mm2 or eax,eax jz _pbload32 _pbload8: mov dword ptr [edi].bScratch,ebx } put_byte(bScratch[3]);if(bScratch[3]==0xFF) put_byte(0); put_byte(bScratch[2]);if(bScratch[2]==0xFF) put_byte(0); put_byte(bScratch[1]);if(bScratch[1]==0xFF) put_byte(0); put_byte(bScratch[0]);if(bScratch[0]==0xFF) put_byte(0); nbBits -= 32; return; _pbload32: _asm { mov esi,[edi].bufferPtr bswap ebx mov [esi],ebx } bufferPtr += 4; nbByte += 4; nbBits -= 32; #endif } // ---------------------------------------------------------------- #ifdef _WINDOWS __forceinline void OutputBitStream::put_bits(int code,int _size) { #else inline void OutputBitStream::put_bits(int code,int _size) { #endif #ifdef JPG_USE_ASM_PB _asm { mov edi,this movd mm2,code mov edx,[edi].nbBits add edx,_size mov ebx,64 mov [edi].nbBits,edx sub ebx,edx movd mm3,ebx psllq mm2,mm3 por mm1,mm2 } if( nbBits>=32 ) load_mm(); #else nbBits += _size; code <<= 32 - nbBits; bits |= code; while( nbBits>=8 ) { unsigned char c = (unsigned char)(bits >> 24); put_byteI(c); if( c==0xFF ) put_byteI(0); bits <<= 8; nbBits-=8; } #endif } // ---------------------------------------------------------------- void OutputBitStream::align() { int s = 8-(nbBits&7); int val ((1L << s) - 1); put_bits(val,s); } // ---------------------------------------------------------------- #ifdef _WINDOWS __forceinline void OutputBitStream::put_byteI(unsigned char code) { #else inline void OutputBitStream::put_byteI(unsigned char code) { #endif if( nbByte==buffSize ) more_byte(); buffer[nbByte]=code; nbByte++; bufferPtr++; } // ---------------------------------------------------------------- void OutputBitStream::put_byte(unsigned char code) { put_byteI(code); } // ---------------------------------------------------------------- void OutputBitStream::put_short(unsigned short code) { put_byte( code>>8 ); put_byte( code&0xFF ); } // ---------------------------------------------------------------- unsigned char *OutputBitStream::get_data() { return buffer; } // ---------------------------------------------------------------- unsigned long OutputBitStream::get_size() { return nbByte; } // ---------------------------------------------------------------- void OutputBitStream::more_byte() { unsigned char *newBuffer = (unsigned char *)malloc(nbByte + BUFFER_SIZE); memcpy(newBuffer,buffer,nbByte); free(buffer); buffer = newBuffer; buffSize += BUFFER_SIZE; bufferPtr = buffer + nbByte; } // ---------------------------------------------------------------- #define NUMBITS11() \ \ if (val < 0) { \ if( val<-2047 ) val=-2047; \ numBits = numbits[-val]; \ val--; \ val &= ((1L << numBits) - 1); \ } else { \ if( val>2047 ) val=2047; \ numBits = numbits[val]; \ } #define NUMBITS10() \ \ if (val < 0) { \ if( val<-1023 ) val=-1023; \ numBits = numbits[-val]; \ val--; \ val &= ((1L << numBits) - 1); \ } else { \ if( val>1023 ) val=1023; \ numBits = numbits[val]; \ } void OutputBitStream::encode_block(short *block,HUFFMANTABLE *hDC,HUFFMANTABLE *hAC,short *lastDc) { int numBits; int i, zero, sym; short val; #ifdef JPG_USE_ASM_PB int codeV,codeS; #endif // DC difference (10+1 bits interval) val = block[0] - (*lastDc); *lastDc = block[0]; NUMBITS11(); put_bits(hDC->huffCode[numBits], hDC->huffSize[numBits]); if (numBits) put_bits(val, numBits); // AC values zero = 0; for (i=1;i<64;i++) { val = block[jpgZag[i]]; if (val==0) { zero++; } else { // If number of zero >= 16, put run-length-16 code (0xF0) while (zero >= 16) { put_bits(hAC->huffCode[0xF0],hAC->huffSize[0xF0]); zero -= 16; } NUMBITS10(); #ifdef JPG_USE_ASM_PB // MMX put_bits allows up to 32 bit code sym = (zero << 4) + numBits; codeS = hAC->huffSize[sym] + numBits; codeV = hAC->huffCode[sym] << numBits; codeV |= ((unsigned int)val); put_bits(codeV, codeS); #else sym = (zero << 4) + numBits; put_bits(hAC->huffCode[sym], hAC->huffSize[sym]); put_bits(val, numBits); #endif zero=0; } } // EOB if (zero > 0) put_bits(hAC->huffCode[0], hAC->huffSize[0]); } // --------------------------------------------------------------------- // Input bitstream // --------------------------------------------------------------------- //------------------------------------------------------------------------------ // Sign extension static const int extend_test[16] = /* entry n is 2**(n-1) */ { 0, 0x0001, 0x0002, 0x0004, 0x0008, 0x0010, 0x0020, 0x0040, 0x0080, 0x0100, 0x0200, 0x0400, 0x0800, 0x1000, 0x2000, 0x4000 }; static const int extend_offset[16] = /* entry n is (-1 << n) + 1 */ { 0, ((-1)<<1) + 1, ((-1)<<2) + 1, ((-1)<<3) + 1, ((-1)<<4) + 1, ((-1)<<5) + 1, ((-1)<<6) + 1, ((-1)<<7) + 1, ((-1)<<8) + 1, ((-1)<<9) + 1, ((-1)<<10) + 1, ((-1)<<11) + 1, ((-1)<<12) + 1, ((-1)<<13) + 1, ((-1)<<14) + 1, ((-1)<<15) + 1 }; // Tables are slightly faster with Visual C++ #ifdef _WINDOWS #define HUFF_EXTEND(x,s) s = ((x) < extend_test[s] ? (x) + extend_offset[s] : (x)) #else #define HUFF_EXTEND(x,s) s = ((x) < (1<<((s)-1)) ? (x) + (((-1)<<(s)) + 1) : (x)) #endif //------------------------------------------------------------------------------ // Retrieve n first bits from the input stream. #define SHOWBITS(n) (_bits >> (32 - (n))) //------------------------------------------------------------------------------ // Remove n bits from the input stream. #define DROPBITS(n) { \ _nbBits -= (n); \ _bits <<= (n); \ while( _nbBits<=16 ) { \ int c1 = get_byte(); \ /*Remove stuffed 0 (following 0xFF)*/ \ if (c1 == 0xFF) { \ int c2 = get_byte(); \ if (c2!=0) {_bufferPtr--;_byteRead--;}\ } \ _bits |= c1 << (24 - _nbBits); \ _nbBits+=8; \ }} InputBitStream::InputBitStream(unsigned char *buff,int buffSize) { _buffer = buff; _buffSize = buffSize; _nbBits = 0; _bits = 0; _byteRead = 0; _bufferPtr = buff; } InputBitStream::~InputBitStream() { } void InputBitStream::align() { get_bits(_nbBits & 7); } void InputBitStream::flush() { align(); // Make stream ready for get_byte() if( _nbBits>0 ) { if(_nbBits==32) {_bufferPtr-=4;_byteRead-=4;} if(_nbBits==24) {_bufferPtr-=3;_byteRead-=3;} if(_nbBits==16) {_bufferPtr-=2;_byteRead-=2;} if(_nbBits==8) {_bufferPtr-=1;_byteRead-=1;} _nbBits = 0; } } void InputBitStream::init() { get_bits(0); } int InputBitStream::get_byte() { if( _byteRead<_buffSize ) { _byteRead++; return *_bufferPtr++; } else { return 0; } } int InputBitStream::get_bits(int numbits) { int i = SHOWBITS(numbits); DROPBITS(numbits); return i; } // Inverse dct (jpeg_dct.cpp) void jpeg_idct(short *block,unsigned char *dst); void jpeg_idct_mmx(short *block,unsigned char *dst); int InputBitStream::decode_mcu(JPGDECODER *decoder) { int r, s, k, c; int *clist = decoder->compList; short *block = decoder->blocks; unsigned char *ycc = decoder->yccFrame; for(int i=0;imcuNbBlock;i++) { HUFFMANTABLE *hDC = decoder->hTables + decoder->comps[clist[i]].dcIdx; HUFFMANTABLE *hAC = decoder->hTables + decoder->comps[clist[i]].acIdx; short *qTable = decoder->qTables[decoder->comps[clist[i]].quantIdx]; // -- DC value -------------------------------- // Use a tree traversal to find symbol. c = SHOWBITS(8); if ((s = hDC->lookUp[c]) < 0) { DROPBITS(8); int drop = 0; c = ~SHOWBITS(8); do { drop++; s = hAC->tree[~s + ((c&0x80)>>7)]; c <<= 1; } while (s < 0); DROPBITS(drop); } else DROPBITS(hDC->huffSize[s]); // Decode if (s!= 0) { r = get_bits(s); HUFF_EXTEND(r, s); } decoder->comps[clist[i]].lastDc += s; s = decoder->comps[clist[i]].lastDc; block[0] = (short)s * qTable[0]; // -- AC values ------------------------------- for (k = 1; k < 64; k++) { // Use a tree traversal to find symbol. c = SHOWBITS(8); if ((s = hAC->lookUp[c]) < 0) { DROPBITS(8); int drop = 0; c = ~SHOWBITS(8); do { drop++; s = hAC->tree[~s + ((c&0x80)>>7)]; c <<= 1; } while (s < 0); DROPBITS(drop); } else DROPBITS(hAC->huffSize[s]); // Decode r = s >> 4; s &= 15; if (s) { k += r; if (k>63) return -24; // Decode error r = SHOWBITS(s); DROPBITS(s); HUFF_EXTEND(r, s); block[jpgZag[k]] = (short)s * qTable[k]; } else { if (r == 15) { k += 15; } else { break; } } } // end block loop #ifdef JPG_USE_ASM jpeg_idct_mmx(block,ycc); #else jpeg_idct(block,ycc); #endif block += 64; ycc += 64; } return 0; } tango-8.1.2c+dfsg.orig/lib/cpp/server/jpeg/jpeg_const.h0000644000175000017500000001122312205375140021660 0ustar piccapicca///============================================================================= // // file : jpeg_const.h // // description : Simple jpeg coding/decoding library // Various constants and internal type definitions // // project : TANGO // // author(s) : JL Pons // // Copyright (C) : 2004,2005,2006,2007,2008,2009,2010,2011,2012,2013 // European Synchrotron Radiation Facility // BP 220, Grenoble 38043 // FRANCE // // This file is part of Tango. // // Tango 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. // // Tango 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 Tango. If not, see . // // $Revision: 22213 $ // // $Log$ // Revision 1.2 2009/04/20 14:55:58 jlpons // Added GPL header, changed memory allocation to C++ fashion. // //============================================================================= #ifndef _JPEGCONSTH_ #define _JPEGCONSTH_ // Huffman table structure typedef struct { unsigned char *huffBits; // Number of Huffman codes per bit size unsigned char *huffVal; // Huffman codes per bit size unsigned char huffSize[256]; // Huffman codes size unsigned int huffCode[256]; // Huffman codes unsigned int lookUp[256]; // look up table (decoding purpose) unsigned int tree[512]; // Huffman tree (decoding purpose) int inited; // Initialisation flag (decoding purpose) } HUFFMANTABLE; // Components structure typedef struct { int id; // Identifier int horzSampling; // Horizontal sampling factor int vertSampling; // Vertical sampling factor int quantIdx; // Quantization table index int dcIdx; // Huffman table DC index int acIdx; // Huffman table AC index short lastDc; // Last DC value } JPGCOMPONENT; // Decoder structure typedef struct { int width; // Image width int height; // Image height int scanType; // Type of scan int outFormat; // Output format int compNb; // Number of component (frame) int compInScan; // Number of component (scan) int mcuWidth; // MCU width int mcuHeight; // MCU height int mcuNbBlock; // Number of block per MCU (total) int mcuNbRow; // Number of MCU per row int mcuNbCol; // Number of MCU per col int restartInterval; // Restart interval int restartsLeft; // Number of MCU between DRI marker int nextRestart; // Next RST marker code int compList[6]; // List of component (scan) HUFFMANTABLE hTables[8]; // Huffman tables short *qTables[4]; // Quantization tables JPGCOMPONENT comps[4]; // Components short *blocks; // Blocks unsigned char *yccFrame; // Decoded frame (RGB24 or GRAY8) unsigned char *rgbFrame; // Decoded frame (RGB24 or GRAY8) } JPGDECODER; // JPEG scan type #define JPG_SCAN_GRAYSCALE 0 #define JPG_SCAN_YH1V1 1 #define JPG_SCAN_YH2V1 2 #define JPG_SCAN_YH1V2 3 #define JPG_SCAN_YH2V2 4 // JPEG marker codes #define M_SOF0 0xc0 #define M_SOF1 0xc1 #define M_SOF2 0xc2 #define M_SOF3 0xc3 #define M_SOF5 0xc5 #define M_SOF6 0xc6 #define M_SOF7 0xc7 #define M_JPG 0xc8 #define M_SOF9 0xc9 #define M_SOF10 0xca #define M_SOF11 0xcb #define M_SOF13 0xcd #define M_SOF14 0xce #define M_SOF15 0xcf #define M_DHT 0xc4 #define M_DAC 0xcc #define M_RST0 0xd0 #define M_RST1 0xd1 #define M_RST2 0xd2 #define M_RST3 0xd3 #define M_RST4 0xd4 #define M_RST5 0xd5 #define M_RST6 0xd6 #define M_RST7 0xd7 #define M_SOI 0xd8 #define M_EOI 0xd9 #define M_SOS 0xda #define M_DQT 0xdb #define M_DNL 0xdc #define M_DRI 0xdd #define M_DHP 0xde #define M_EXP 0xdf #define M_APP0 0xe0 #define M_APP1 0xe1 #define M_APP2 0xe2 #define M_APP3 0xe3 #define M_APP4 0xe4 #define M_APP5 0xe5 #define M_APP6 0xe6 #define M_APP7 0xe7 #define M_APP8 0xe8 #define M_APP9 0xe9 #define M_APP10 0xea #define M_APP11 0xeb #define M_APP12 0xec #define M_APP13 0xed #define M_APP14 0xee #define M_APP15 0xef #define M_JPG0 0xf0 #define M_JPG13 0xfd #define M_COM 0xfe #define M_TEM 0x01 #endif /* _JPEGCONSTH_ */ tango-8.1.2c+dfsg.orig/lib/cpp/server/jpeg/jpeg_memory.h0000644000175000017500000000355012205375140022046 0ustar piccapicca///============================================================================= // // file : jpeg_memory.h // // description : Simple jpeg coding/decoding library // Small memory manager (16 bytes aligned for MMX/SSE code) // // project : TANGO // // author(s) : JL Pons // // Copyright (C) : 2004,2005,2006,2007,2008,2009,2010,2011,2012,2013 // European Synchrotron Radiation Facility // BP 220, Grenoble 38043 // FRANCE // // This file is part of Tango. // // Tango 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. // // Tango 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 Tango. If not, see . // // $Revision: 22213 $ // // $Log$ // Revision 1.2 2009/04/20 14:55:58 jlpons // Added GPL header, changed memory allocation to C++ fashion. // //============================================================================= #ifndef _JPEGMEMORYH_ #define _JPEGMEMORYH_ #include // Allocate a buffer (aligned on 16 bytes boundary) void *malloc_16(size_t size); // Allocate a buffer (aligned on 16 bytes boundary) void *calloc_16(size_t count,size_t size); // Free a buffer void free_16(void *ptr); // Free all allocated buffer void free_all_16(); //Return the size of a buffer previoulsy allocated by malloc_16 size_t _msize_16( void *ptr ); #endif /* _JPEGMEMORYH_ */ tango-8.1.2c+dfsg.orig/lib/cpp/server/zmqeventsupplier.cpp0000644000175000017500000011122012205375142022570 0ustar piccapiccastatic const char *RcsId = "$Id$"; //////////////////////////////////////////////////////////////////////////////// // // file zmqeventsupplier.cpp // // C++ classes for implementing the event server and client // singleton classes - ZmqEventSupplier. // This class is used to send events from the server // to the client(s) when zmq is used to transport the events // // author(s) : E.Taurel (taurel@esrf.fr) // // original : August 2011 // // Copyright (C) : 2011,2012 // European Synchrotron Radiation Facility // BP 220, Grenoble 38043 // FRANCE // // This file is part of Tango. // // Tango 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. // // Tango 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 Tango. If not, see . // // $Revision: 17240 $ // // //////////////////////////////////////////////////////////////////////////////// #include #include #include #include using namespace CORBA; namespace Tango { ZmqEventSupplier *ZmqEventSupplier::_instance = NULL; /************************************************************************/ /* */ /* ZmqEventSupplier class */ /* ---------------- */ /* */ /************************************************************************/ ZmqEventSupplier::ZmqEventSupplier(Util *tg):EventSupplier(tg),zmq_context(1),event_pub_sock(NULL),double_send(false),double_send_heartbeat(false) { _instance = this; // // Create zmq release number // int zmq_major,zmq_minor,zmq_patch; zmq_version(&zmq_major,&zmq_minor,&zmq_patch); zmq_release = (zmq_major * 100) + (zmq_minor * 10) + zmq_patch; // // Create the Publisher socket for heartbeat event and bind it // If the user has specified one IP address on the command line, // re-use it in the endpoint // heartbeat_pub_sock = new zmq::socket_t(zmq_context,ZMQ_PUB); int linger = 0; int reconnect_ivl = -1; heartbeat_pub_sock->setsockopt(ZMQ_LINGER,&linger,sizeof(linger)); try { heartbeat_pub_sock->setsockopt(ZMQ_RECONNECT_IVL,&reconnect_ivl,sizeof(reconnect_ivl)); } catch (zmq::error_t &) { reconnect_ivl = 30000; heartbeat_pub_sock->setsockopt(ZMQ_RECONNECT_IVL,&reconnect_ivl,sizeof(reconnect_ivl)); } heartbeat_endpoint = "tcp://"; string &specified_ip = tg->get_specified_ip(); string &h_name = tg->get_host_name(); string canon_name; string::size_type pos = h_name.find('.'); if (pos != string::npos) canon_name = h_name.substr(0,pos); if (specified_ip.empty() == false && (canon_name != specified_ip)) { heartbeat_endpoint = heartbeat_endpoint + specified_ip + ':'; ip_specified = true; user_ip = specified_ip; } else { heartbeat_endpoint = heartbeat_endpoint + "*:"; ip_specified = false; } // // Bind the publisher socket to one ephemeral port // tango_bind(heartbeat_pub_sock,heartbeat_endpoint); // // If needed, replace * by host IP address in endpoint string // if (specified_ip.empty() == true) { ApiUtil *au = ApiUtil::instance(); vector adrs; au->get_ip_from_if(adrs); string::size_type pos = heartbeat_endpoint.find('*'); if (adrs.size() > 1) { for (unsigned int i = 0;i < adrs.size();++i) { string::size_type start; if ((start = adrs[i].find("127.")) == 0) continue; heartbeat_endpoint.replace(pos,1,adrs[i]); host_ip = adrs[i]; break; } } else { heartbeat_endpoint.replace(pos,1,adrs[0]); host_ip = adrs[0]; } } // // Find out the host endianness and // create the zmq message used to pass it // host_endian = test_endian(); endian_mess.rebuild(1); memcpy(endian_mess.data(),&host_endian,1); endian_mess_2.copy(&endian_mess); endian_mess_heartbeat.rebuild(1); memcpy(endian_mess_heartbeat.data(),&host_endian,1); endian_mess_heartbeat_2.copy(&endian_mess_heartbeat); // // Init heartbeat call info // Leave the OID and method name un-initialized // Marshall the structure into CORBA CDR // heartbeat_call.version = ZMQ_EVENT_PROT_VERSION; heartbeat_call.call_is_except = false; heartbeat_call >>= heartbeat_call_cdr; // // Create some ZMQ messages from the already created memory buffer in CDR // heartbeat_call_mess.rebuild(heartbeat_call_cdr.bufSize()); memcpy(heartbeat_call_mess.data(),heartbeat_call_cdr.bufPtr(),heartbeat_call_cdr.bufSize()); heartbeat_call_mess_2.copy(&heartbeat_call_mess); // // Start to init the event name used for the DS heartbeat event // heartbeat_event_name = fqdn_prefix; heartbeat_event_name = heartbeat_event_name + "dserver/"; heartbeat_name_init = false; } ZmqEventSupplier *ZmqEventSupplier::create(Util *tg) { cout4 << "calling Tango::ZmqEventSupplier::create() \n"; // // Does the ZmqEventSupplier singleton exist already ? if so simply return it // if (_instance != NULL) { return _instance; } // // ZmqEventSupplier singleton does not exist, create it // ZmqEventSupplier *_event_supplier = new ZmqEventSupplier(tg); return _event_supplier; } //+---------------------------------------------------------------------------- // // method : ZmqEventSupplier::~ZmqEventSupplier() // // description : ZmqEventSupplier destructor. // This dtor delete the zmq socket. The ZMQ context will be // deleted (then calling zmq_term) when the object is // destroyed // //----------------------------------------------------------------------------- ZmqEventSupplier::~ZmqEventSupplier() { // // Delete zmq sockets // delete heartbeat_pub_sock; delete event_pub_sock; if (event_mcast.empty() == false) { map::iterator ite,ite_stop; ite = event_mcast.begin(); ite_stop = event_mcast.end(); for (ite = event_mcast.begin(); ite != ite_stop;++ite) delete ite->second.pub_socket; } } //+---------------------------------------------------------------------------- // // method : ZmqEventSupplier::tango_bind() // // description : Choose a free port to bind ZMQ socket // // argument : in : - sock : The ZMQ socket // - endpoint : The beginning of the ZMQ endpoint // //----------------------------------------------------------------------------- void ZmqEventSupplier::tango_bind(zmq::socket_t *sock,string &endpoint) { stringstream ss; string base_endpoint(endpoint); string tmp_endpoint; int port; for (port = EPHEMERAL_PORT_BEGIN; port < EPHEMERAL_PORT_END; port++) { ss << port; tmp_endpoint = base_endpoint + ss.str(); if (zmq_bind(*sock, tmp_endpoint.c_str()) == 0) { break; } ss.str(""); } if (port == EPHEMERAL_PORT_END) { EventSystemExcept::throw_exception((const char*)API_ZmqInitFailed, (const char*)"Can't bind the ZMQ socket. All port used!", (const char*)"ZmqEventSupplier::tango_bind()"); } endpoint = tmp_endpoint; } //+---------------------------------------------------------------------------- // // method : ZmqEventSupplier::test_endian() // // description : Get the host endianness // // This method returns the host endianness // 0 -> Big endian // 1 -> Little endian // //----------------------------------------------------------------------------- unsigned char ZmqEventSupplier::test_endian() { int test_var = 1; unsigned char *cptr = (unsigned char*)&test_var; return (!(cptr[0] == 0)); } //+---------------------------------------------------------------------------- // // method : ZmqEventSupplier::create_event_socket() // // description : Create and bind the publisher socket used to publish the // real events // //----------------------------------------------------------------------------- void ZmqEventSupplier::create_event_socket() { if (event_pub_sock == NULL) { // // Create the Publisher socket for real events and bind it // If the user has specified one IP address on the command line, // re-use it in the endpoint // event_pub_sock = new zmq::socket_t(zmq_context,ZMQ_PUB); int linger = 0; int reconnect_ivl = -1; event_pub_sock->setsockopt(ZMQ_LINGER,&linger,sizeof(linger)); try { event_pub_sock->setsockopt(ZMQ_RECONNECT_IVL,&reconnect_ivl,sizeof(reconnect_ivl)); } catch (zmq::error_t &) { reconnect_ivl = 30000; event_pub_sock->setsockopt(ZMQ_RECONNECT_IVL,&reconnect_ivl,sizeof(reconnect_ivl)); } event_endpoint = "tcp://"; if (ip_specified == true) { event_endpoint = event_endpoint + user_ip + ':'; } else { event_endpoint = event_endpoint + "*:"; } // // Set a publisher HWM // Tango::Util *tg = Tango::Util::instance(); DServer *admin_dev = tg->get_dserver_device(); int hwm = tg->get_user_pub_hwm(); if (hwm == -1) hwm = admin_dev->zmq_pub_event_hwm; event_pub_sock->setsockopt(ZMQ_SNDHWM,&hwm,sizeof(hwm)); // // Bind the publisher socket to one ephemeral port // tango_bind(event_pub_sock,event_endpoint); // // If needed, replace * by host IP address in endpoint string // if (ip_specified == false) { event_endpoint.replace(6,1,host_ip); } } } //+---------------------------------------------------------------------------- // // method : ZmqEventSupplier::create_mcast_event_socket() // // description : Create and bind the publisher socket used to publish the // real events when multicast transport is required // // argument : in : mcast_data : The multicast addr and port (mcast_adr:port) // ev_name : The event name (dev_name/attr_name.event_type) // rate: The user defined PGM rate (O if undefined) // local_call: True if the caller is on the same host // //----------------------------------------------------------------------------- void ZmqEventSupplier::create_mcast_event_socket(string &mcast_data,string &ev_name,int rate,bool local_call) { map::iterator ite; // // If the event is already in the mcast event map, check if it is // already used by local clients // if ((ite = event_mcast.find(ev_name)) != event_mcast.end()) { if (local_call == true) { if (ite->second.local_client == false) { create_event_socket(); ite->second.local_client = true; } } else { if (ite->second.local_client == true && ite->second.pub_socket == NULL) { create_mcast_socket(mcast_data,rate,ite->second); } } ite->second.double_send = true; } else { // // New mcast event // McastSocketPub ms; ms.double_send = true; if (local_call == true) { create_event_socket(); ms.pub_socket = NULL; ms.local_client = true; } else { create_mcast_socket(mcast_data,rate,ms); ms.local_client = false; } // // Insert element in map // if (event_mcast.insert(make_pair(ev_name,ms)).second == false) { TangoSys_OMemStream o; o << "Can't insert multicast transport parameter for event "; o << ev_name << " in EventSupplier instance" << ends; Except::throw_exception((const char *)API_InternalError, o.str(), (const char *)"ZmqEventSupplier::create_mcast_event_socket"); } } } //+---------------------------------------------------------------------------- // // method : ZmqEventSupplier::create_mcast_socket() // // description : Create and bind the publisher socket used to publish the // real events when multicast transport is required // // argument : in : mcast_data : The multicast addr and port (mcast_adr:port) // rate: The user defined PGM rate (O if undefined) // ms: Reference to the structure to be stored in the macst map // //----------------------------------------------------------------------------- void ZmqEventSupplier::create_mcast_socket(string &mcast_data,int rate,McastSocketPub &ms) { // // Create the Publisher socket for real events and bind it // If the user has specified one IP address on the command line, // re-use it in the endpoint // ms.pub_socket = new zmq::socket_t(zmq_context,ZMQ_PUB); ms.endpoint = MCAST_PROT; if (ip_specified == true) { ms.endpoint = ms.endpoint + user_ip + ';'; } else { ApiUtil *au = ApiUtil::instance(); vector adrs; au->get_ip_from_if(adrs); for (unsigned int i = 0;i < adrs.size();++i) { if (adrs[i].find("127.") == 0) continue; ms.endpoint = ms.endpoint + adrs[i] + ';'; break; } } ms.endpoint = ms.endpoint + mcast_data; int linger = 0; ms.pub_socket->setsockopt(ZMQ_LINGER,&linger,sizeof(linger)); // // Change multicast hops // Tango::Util *tg = Tango::Util::instance(); DServer *admin_dev = tg->get_dserver_device(); int nb_hops = admin_dev->mcast_hops; ms.pub_socket->setsockopt(ZMQ_MULTICAST_HOPS,&nb_hops,sizeof(nb_hops)); // // Change PGM rate to default value (80 Mbits/sec) or to user defined value // int local_rate = rate; ms.pub_socket->setsockopt(ZMQ_RATE,&local_rate,sizeof(local_rate)); // // Bind the publisher socket to the specified port // if (zmq_bind(*(ms.pub_socket),ms.endpoint.c_str()) != 0) { TangoSys_OMemStream o; o << "Can't bind ZMQ socket with endpoint "; o << ms.endpoint; o << "\nZmq error: " << zmq_strerror(zmq_errno()) << ends; Except::throw_exception((const char *)API_ZmqFailed, o.str(), (const char *)"ZmqEventSupplier::create_mcast_event_socket"); } // // The connection string returned to client does not need the host IP at all // ms.endpoint = MCAST_PROT + mcast_data; } //+---------------------------------------------------------------------------- // // method : ZmqEventSupplier::is_event_mcast() // // description : This method checks if the event is already defined // in the map of multicast event. // // argument : in : ev_name : The event name (device/attr.event_type) // // This method returns true if the event is in the map and false otherwise //----------------------------------------------------------------------------- bool ZmqEventSupplier::is_event_mcast(string &ev_name) { bool ret = false; if (event_mcast.find(ev_name) != event_mcast.end()) ret = true; return ret; } //+---------------------------------------------------------------------------- // // method : ZmqEventSupplier::get_mcast_event_endpoint() // // description : This method returns the multicast socket endpoint for the // event passed as parameter // // argument : in : event_name : The event name (device/attr.event_type) // // This method returns a reference to the enpoint string //----------------------------------------------------------------------------- string &ZmqEventSupplier::get_mcast_event_endpoint(string &ev_name) { return event_mcast.find(ev_name)->second.endpoint; } //+---------------------------------------------------------------------------- // // method : ZmqEventSupplier::init_event_cptr() // // description : Method to initialize event counter for a specific event // // argument : in : event_name : The event name (device/attr.event_type) // //----------------------------------------------------------------------------- void ZmqEventSupplier::init_event_cptr(string &event_name) { map::iterator pos; pos = event_cptr.find(event_name); if (pos == event_cptr.end()) { if (event_cptr.insert(make_pair(event_name,1)).second == false) { TangoSys_OMemStream o; o << "Can't insert event counter for event "; o << event_name << " in EventSupplier instance" << ends; Except::throw_exception((const char *)API_InternalError, o.str(), (const char *)"ZmqEventSupplier::init_event_cptr"); } } } //+---------------------------------------------------------------------------- // // method : ZmqEventSupplier::push_heartbeat_event() // // description : Method to push the hearbeat event // //----------------------------------------------------------------------------- void ZmqEventSupplier::push_heartbeat_event() { time_t delta_time; time_t now_time; // // Heartbeat - check wether a heartbeat event has been sent recently // if not then send it. A heartbeat contains no data, it is used by the // consumer to know that the supplier is still alive. // Tango::Util *tg = Tango::Util::instance(); DServer *adm_dev = tg->get_dserver_device(); now_time = time(NULL); delta_time = now_time - adm_dev->last_heartbeat_zmq; cout3 << "ZmqEventSupplier::push_heartbeat_event(): delta time since last heartbeat " << delta_time << endl; if (heartbeat_name_init == false) { // // Build heartbeat name // This is something like // tango://host:port/dserver/exec_name/inst_name.heartbeat when using DB // tango://host:port/dserver/exec_name/inst_name#dbase=no.heartbeat when using file as database // heartbeat_event_name = heartbeat_event_name + adm_dev->get_full_name(); if (Util::_FileDb == true || Util::_UseDb == false) heartbeat_event_name = heartbeat_event_name + MODIFIER_DBASE_NO; heartbeat_event_name = heartbeat_event_name + ".heartbeat"; transform(heartbeat_event_name.begin(),heartbeat_event_name.end(),heartbeat_event_name.begin(),::tolower); heartbeat_name_init = true; } // // We here compare delta_time to 8 and not to 10. // This is necessary because, sometimes the polling thread is some // milli second in advance. The computation here is done in seconds // So, if the polling thread is in advance, delta_time computed in // seconds will be 9 even if in reality it is 9,9 // if (delta_time >= 8) { int nb_event = 1; cout3 << "ZmqEventSupplier::push_heartbeat_event(): detected heartbeat event for " << heartbeat_event_name << endl; cout3 << "ZmqEventSupplier::push_heartbeat_event(): delta _time " << delta_time << endl; if (double_send_heartbeat == true) { nb_event = 2; double_send_heartbeat = false; } cout3 << "ZmqEventSupplier::push_heartbeat_event(): nb_event = " << nb_event << endl; while (nb_event != 0) { // // Create zmq message // zmq::message_t name_mess(heartbeat_event_name.size()); memcpy(name_mess.data(),(void *)heartbeat_event_name.data(),heartbeat_event_name.size()); bool endian_mess_sent = false; bool call_mess_sent = false; try { // // For debug and logging purposes // if (nb_event == 1) { if (omniORB::trace(20)) { omniORB::logger log; log << "ZMQ: Pushing some data" << '\n'; } if (omniORB::trace(30)) { { omniORB::logger log; log << "ZMQ: Event name" << '\n'; } omni::giopStream::dumpbuf((unsigned char *)name_mess.data(),name_mess.size()); { omniORB::logger log; log << "ZMQ: Endianess" << '\n'; } omni::giopStream::dumpbuf((unsigned char *)endian_mess_heartbeat.data(),endian_mess_heartbeat.size()); { omniORB::logger log; log << "ZMQ: Call info" << '\n'; } omni::giopStream::dumpbuf((unsigned char *)heartbeat_call_mess.data(),heartbeat_call_mess.size()); } } // // Push the event // adm_dev->last_heartbeat_zmq = now_time; heartbeat_pub_sock->send(name_mess,ZMQ_SNDMORE); heartbeat_pub_sock->send(endian_mess_heartbeat,ZMQ_SNDMORE); endian_mess_sent = true; heartbeat_pub_sock->send(heartbeat_call_mess,0); call_mess_sent = true; // // For reference counting on zmq messages which do not have a local scope // endian_mess_heartbeat.copy(&endian_mess_heartbeat_2); heartbeat_call_mess.copy(&heartbeat_call_mess_2); nb_event--; } catch(...) { cout3 << "ZmqEventSupplier::push_heartbeat_event() failed !\n"; if (endian_mess_sent == true) endian_mess_heartbeat.copy(&endian_mess_heartbeat_2); if (call_mess_sent == true) heartbeat_call_mess.copy(&heartbeat_call_mess_2); TangoSys_OMemStream o; o << "Can't push ZMQ heartbeat event for event "; o << heartbeat_event_name; if (zmq_errno() != 0) o << "\nZmq error: " << zmq_strerror(zmq_errno()) << ends; else o << ends; Except::throw_exception((const char *)API_ZmqFailed, o.str(), (const char *)"ZmqEventSupplier::push_heartbeat_event"); } } } } //+---------------------------------------------------------------------------- // // method : ZmqEventSupplier::push_event() // // description : Method to send the event to the event channel // // argument : in : device_impl : The device // event_type : The event type (change, periodic....) // filterable_names : // filterable_data : // attr_value : The attribute value // except : The exception thrown during the last // attribute reading. NULL if no exception // //----------------------------------------------------------------------------- void tg_unlock(TANGO_UNUSED(void *data),void *hint) { EventSupplier *ev = (EventSupplier *)hint; omni_mutex &the_mutex = ev->get_push_mutex(); the_mutex.unlock(); } void ZmqEventSupplier::push_event(DeviceImpl *device_impl,string event_type, TANGO_UNUSED(vector &filterable_names),TANGO_UNUSED(vector &filterable_data), TANGO_UNUSED(vector &filterable_names_lg),TANGO_UNUSED(vector &filterable_data_lg), struct AttributeData &attr_value,string &attr_name,DevFailed *except) { cout3 << "ZmqEventSupplier::push_event(): called for attribute " << attr_name << endl; // // Get the mutex to synchronize the sending of events // This method may be called by several threads in case they are several // user threads doing dev.push_xxxx_event() on several devices. // On top of that, zmq socket can be used by several threads // only if they are memory barriers between their use in these different // threads. The mutex used here is also a memory barrier // push_mutex.lock(); // // Create full event name // Don't forget case where we have notifd client (thus with a fqdn_prefix modified) // string loc_attr_name(attr_name); transform(loc_attr_name.begin(),loc_attr_name.end(),loc_attr_name.begin(),::tolower); event_name = fqdn_prefix; int size = event_name.size(); if (event_name[size - 1] == '#') event_name.erase(size - 1); event_name = event_name + device_impl->get_name_lower() + '/' + loc_attr_name; if (Util::_FileDb == true || Util::_UseDb == false) event_name = event_name + MODIFIER_DBASE_NO; event_name = event_name + '.' + event_type; // // Create zmq messages // Use memcpy here. Don't use message with no-copy option because // it does not give any performance improvement in this case // (too small amount of data) // zmq::message_t name_mess(event_name.size()); memcpy(name_mess.data(),event_name.data(),event_name.size()); // // Get event cptr and create the event call zmq message // map::iterator ev_cptr_ite; unsigned int ev_ctr = 0; ev_cptr_ite = event_cptr.find(event_name); if (ev_cptr_ite != event_cptr.end()) ev_ctr = ev_cptr_ite->second; else { Attribute &att = device_impl->get_device_attr()->get_attr_by_name(attr_name.c_str()); bool print = false; if (event_type == "data_ready") { if (att.ext->event_data_ready_subscription != 0) print = true; } else if (event_type == "attr_conf") { if (att.ext->event_attr_conf_subscription != 0) print = true; } else if (event_type == "user_event") { if (att.ext->event_user_subscription != 0) print = true; } else if (event_type == "change") { if (att.ext->event_change_subscription != 0) print = true; } else if (event_type == "periodic") { if (att.ext->event_periodic_subscription != 0) print = true; } else if (event_type == "archive") { if (att.ext->event_archive_subscription != 0) print = true; } if (print == true) cout3 << "-----> Can't find event counter for event " << event_name << " in map!!!!!!!!!!" << endl; } ZmqCallInfo event_call; event_call.version = ZMQ_EVENT_PROT_VERSION; if (except == NULL) event_call.call_is_except = false; else event_call.call_is_except = true; event_call.ctr = ev_ctr; cdrMemoryStream event_call_cdr; event_call >>= event_call_cdr; zmq::message_t event_call_mess(event_call_cdr.bufSize()); memcpy(event_call_mess.data(),event_call_cdr.bufPtr(),event_call_cdr.bufSize()); // // Marshall the event data // size_t mess_size; void *mess_ptr; CORBA::Long padding = 0XDEC0DEC0; data_call_cdr.rewindPtrs(); padding >>= data_call_cdr; padding >>= data_call_cdr; bool large_data = false; bool large_message_created = false; if (except == NULL) { if (attr_value.attr_val != NULL) { *(attr_value.attr_val) >>= data_call_cdr; } else if (attr_value.attr_val_3 != NULL) { *(attr_value.attr_val_3) >>= data_call_cdr; } else if (attr_value.attr_val_4 != NULL) { // // Get number of data exchanged by this event // If this value is greater than a threashold, set a flag // In such a case, we will use ZMQ no-copy message call // *(attr_value.attr_val_4) >>= data_call_cdr; mess_ptr = data_call_cdr.bufPtr(); mess_ptr = (char *)mess_ptr + (sizeof(CORBA::Long) << 1); int nb_data; int data_discr = ((int *)mess_ptr)[0]; if (data_discr == ATT_ENCODED) { const DevVarEncodedArray &dvea = attr_value.attr_val_4->value.encoded_att_value(); nb_data = dvea.length(); if (nb_data > LARGE_DATA_THRESHOLD_ENCODED) large_data = true; } else { nb_data = ((int *)mess_ptr)[1]; if (nb_data >= LARGE_DATA_THRESHOLD) large_data = true; } } else if (attr_value.attr_conf_2 != NULL) { *(attr_value.attr_conf_2) >>= data_call_cdr; } else if (attr_value.attr_conf_3 != NULL) { *(attr_value.attr_conf_3) >>= data_call_cdr; } else { *(attr_value.attr_dat_ready) >>= data_call_cdr; } } else { except->errors >>= data_call_cdr; } mess_size = data_call_cdr.bufSize() - sizeof(CORBA::Long); mess_ptr = (char *)data_call_cdr.bufPtr() + sizeof(CORBA::Long); // // For event with small amount of data, use memcpy to initialize // the zmq message. For large amount of data, use zmq message // with no-copy option // zmq::message_t data_mess; if (large_data == true) { data_mess.rebuild(mess_ptr,mess_size,tg_unlock,(void *)this); large_message_created = true; } else { data_mess.rebuild(mess_size); memcpy(data_mess.data(),mess_ptr,mess_size); } // // Send the data // bool endian_mess_sent = false; try { // // For debug and logging purposes // if (omniORB::trace(20)) { omniORB::logger log; log << "ZMQ: Pushing some data" << '\n'; } if (omniORB::trace(30)) { { omniORB::logger log; log << "ZMQ: Event name" << '\n'; } omni::giopStream::dumpbuf((unsigned char *)name_mess.data(),name_mess.size()); { omniORB::logger log; log << "ZMQ: Endianess" << '\n'; } omni::giopStream::dumpbuf((unsigned char *)endian_mess.data(),endian_mess.size()); { omniORB::logger log; log << "ZMQ: Call info" << '\n'; } omni::giopStream::dumpbuf((unsigned char *)event_call_mess.data(),event_call_mess.size()); { omniORB::logger log; log << "ZMQ: Event data" << '\n'; } omni::giopStream::dumpbuf((unsigned char *)data_mess.data(),data_mess.size()); } // // Get publisher socket (multicast case) // int send_nb = 1; zmq::socket_t *pub; pub = event_pub_sock; zmq::message_t *name_mess_ptr = &name_mess; zmq::message_t *endian_mess_ptr = &endian_mess; zmq::message_t *event_call_mess_ptr = &event_call_mess; zmq::message_t *data_mess_ptr = &data_mess; map::iterator mcast_ite; map::iterator mcast_ite_end = event_mcast.end(); bool local_double_send = double_send; bool mcast_event = false; if (event_mcast.empty() == false) { if ((mcast_ite = event_mcast.find(event_name)) != mcast_ite_end) { if (mcast_ite->second.local_client == false) { pub = mcast_ite->second.pub_socket; } else { if (mcast_ite->second.pub_socket != NULL) { send_nb = 2; pub = mcast_ite->second.pub_socket; } } local_double_send = mcast_ite->second.double_send; mcast_ite->second.double_send = false; mcast_event = true; } } if (local_double_send == true) { send_nb = 2; if (mcast_event == false) double_send = false; } // // If we have a multicast socket with also a local client // we are obliged to send two times the messages. // ZMQ does not support local client with PGM socket // zmq::message_t name_mess_cpy; zmq::message_t event_call_mess_cpy; zmq::message_t data_mess_cpy; if (send_nb == 2) { name_mess_cpy.copy(&name_mess); event_call_mess_cpy.copy(&event_call_mess); data_mess_cpy.copy(&data_mess); } while(send_nb > 0) { // // Push the event // bool ret; ret = pub->send(*name_mess_ptr,ZMQ_SNDMORE); if (ret == false) { cerr << "Name message returned false, assertion!!!!" << endl; assert(false); } ret = pub->send(*endian_mess_ptr,ZMQ_SNDMORE); if (ret == false) { cerr << "Endian message returned false, assertion!!!!" << endl; assert(false); } endian_mess_sent = true; ret = pub->send(*event_call_mess_ptr,ZMQ_SNDMORE); if (ret == false) { cerr << "Call message returned false, assertion!!!!" << endl; assert(false); } ret = pub->send(*data_mess_ptr,0); if (ret == false) { cerr << "Data message returned false, assertion!!!!" << endl; assert(false); } send_nb--; if (send_nb == 1) { if ((event_mcast.empty() == false) && (mcast_ite != mcast_ite_end)) { // // Case of multicast socket with a local client // Send the event also on the local socket // if (mcast_ite->second.local_client == true) { zmq::socket_t *old_pub = pub; pub = event_pub_sock; name_mess.copy(&name_mess_cpy); endian_mess.copy(&endian_mess_2); event_call_mess.copy(&event_call_mess_cpy); data_mess.copy(&data_mess_cpy); pub->send(*name_mess_ptr,ZMQ_SNDMORE); pub->send(*endian_mess_ptr,ZMQ_SNDMORE); endian_mess_sent = true; pub->send(*event_call_mess_ptr,ZMQ_SNDMORE); pub->send(*data_mess_ptr,0); pub = old_pub; name_mess_ptr = &name_mess_cpy; endian_mess.copy(&endian_mess_2); event_call_mess_ptr = &event_call_mess_cpy; data_mess_ptr = &data_mess_cpy; } else { name_mess_ptr = &name_mess_cpy; endian_mess.copy(&endian_mess_2); event_call_mess_ptr = &event_call_mess_cpy; data_mess_ptr = &data_mess_cpy; } } name_mess_ptr = &name_mess_cpy; endian_mess.copy(&endian_mess_2); event_call_mess_ptr = &event_call_mess_cpy; data_mess_ptr = &data_mess_cpy; } } // // Increment event counter // if (ev_cptr_ite != event_cptr.end()) ev_cptr_ite->second++; // // release mutex if we haven't use ZMQ no copy mode // if (large_data == false) push_mutex.unlock(); // // For reference counting on zmq messages which do not have a local scope // endian_mess.copy(&endian_mess_2); } catch(...) { cout3 << "ZmqEventSupplier::push_event() failed !!!!!!!!!!!\n"; if (endian_mess_sent == true) endian_mess.copy(&endian_mess_2); if (large_message_created == false) push_mutex.unlock(); TangoSys_OMemStream o; o << "Can't push ZMQ event for event "; o << event_name; if (zmq_errno() != 0) o << "\nZmq error: " << zmq_strerror(zmq_errno()) << ends; else o << ends; Except::throw_exception((const char *)API_ZmqFailed, o.str(), (const char *)"ZmqEventSupplier::push_event"); } } //+---------------------------------------------------------------------------- // // method : ZmqEventSupplier::update_connected_client // // description : // //----------------------------------------------------------------------------- bool ZmqEventSupplier::update_connected_client(client_addr *cl) { bool ret = false; // // Immediately return if client identification not possible // (Very old client....) // if (cl == NULL) return ret; // // First try to find the client in list // struct timeval now; #ifdef _TG_WINDOWS_ struct _timeb after_win; _ftime(&after_win); now.tv_sec = (time_t)after_win.time; #else gettimeofday(&now,NULL); #endif list::iterator pos; #ifdef HAS_LAMBDA_FUNC pos = find_if(con_client.begin(),con_client.end(), [&] (ConnectedClient &cc) -> bool { return (cc.clnt == *cl); }); #else pos = find_if(con_client.begin(),con_client.end(), bind2nd(WantedClient(),*cl)); #endif // // Update date if client in list. Otherwise add client to list // if (pos != con_client.end()) { pos->date = now.tv_sec; } else { ConnectedClient new_cc; new_cc.clnt = *cl; new_cc.date = now.tv_sec; con_client.push_back(new_cc); ret = true; } // // Remove presumly dead client // #ifdef HAS_LAMBDA_FUNC con_client.remove_if([&] (ConnectedClient &cc) -> bool { if (now.tv_sec > (cc.date + 500)) return true; else return false; }); #else con_client.remove_if(bind2nd(OldClient(),now.tv_sec)); #endif return ret; } } /* End of Tango namespace */ tango-8.1.2c+dfsg.orig/lib/cpp/server/pollthread.h0000644000175000017500000001166512205375142020752 0ustar piccapicca//============================================================================= // // file : PollThread.h // // description : Include for the PollThread object. This class implements // the polling thread // // project : TANGO // // author(s) : E.Taurel // // Copyright (C) : 2004,2005,2006,2007,2008,2009,2010,2011,2012,2013 // European Synchrotron Radiation Facility // BP 220, Grenoble 38043 // FRANCE // // This file is part of Tango. // // Tango 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. // // Tango 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 Tango. If not, see . // // $Revision: 22213 $ // //============================================================================= #ifndef _POLLTHREAD_H #define _POLLTHREAD_H #include #include #include #ifdef _TG_WINDOWS_ #include #include #endif namespace Tango { //============================================================================= // // The PollThCmd structure // // description : This structure is used to shared data between the polling // thread and the main thread. // //============================================================================= struct PollThCmd { bool cmd_pending; // The new command flag bool trigger; // The external trigger flag PollCmdCode cmd_code; // The command code DeviceImpl *dev; // The device pointer (servant) long index; // Index in the device poll_list string name; // Object name PollObjType type; // Object type (cmd/attr) int new_upd; // New update period (For upd period com.) }; struct WorkItem { DeviceImpl *dev; // The device pointer (servant) vector *poll_list; // The device poll list struct timeval wake_up_date; // The next wake up date int update; // The update period (mS) PollObjType type; // Object type (command/attr) string name; // Object name struct timeval needed_time; // Time needed to execute action }; enum PollCmdType { POLL_TIME_OUT, POLL_COMMAND, POLL_TRIGGER }; //============================================================================= // // The PollThread class // // description : Class to store all the necessary information for the // polling thread. It's run() method is the thread code // //============================================================================= class TangoMonitor; class PollThread: public omni_thread { public: PollThread(PollThCmd &,TangoMonitor &,bool); void *run_undetached(void *); void start() {start_undetached();} void execute_cmd(); void set_local_cmd(PollThCmd &cmd) {local_cmd = cmd;} protected: PollCmdType get_command(long); void one_more_poll(); void one_more_trigg(); void compute_new_date(struct timeval &,int); void compute_sleep_time(); void time_diff(struct timeval &,struct timeval &,struct timeval &); void poll_cmd(WorkItem &); void poll_attr(WorkItem &); void eve_heartbeat(); void store_subdev(); void print_list(); void insert_in_list(WorkItem &); void add_random_delay(struct timeval &); void tune_list(bool,long); void err_out_of_sync(WorkItem &); PollThCmd &shared_cmd; TangoMonitor &p_mon; list works; vector ext_trig_works; PollThCmd local_cmd; #ifdef _TG_WINDOWS_ struct _timeb now_win; struct _timeb after_win; double ctr_frequency; #endif struct timeval now; struct timeval after; long sleep; bool polling_stop; private: CORBA::Any in_any; DevVarStringArray attr_names; AttributeValue dummy_att; AttributeValue_3 dummy_att3; AttributeValue_4 dummy_att4; long tune_ctr; bool need_two_tuning; long auto_upd; bool send_heartbeat; ClntIdent dummy_cl_id; CppClntIdent cci; public: static DeviceImpl *dev_to_del; static string name_to_del; static PollObjType type_to_del; }; // // Three macros // #define T_DIFF(A,B,C) \ long delta_sec = B.tv_sec - A.tv_sec; \ if (delta_sec == 0) \ C = B.tv_usec - A.tv_usec; \ else \ { \ C = ((delta_sec - 1) * 1000000) + (1000000 - A.tv_usec) + B.tv_usec; \ } #define T_ADD(A,B) \ A.tv_usec = A.tv_usec + B; \ while (A.tv_usec > 1000000) \ { \ A.tv_sec++; \ A.tv_usec = A.tv_usec - 1000000; \ } #define T_DEC(A,B) \ A.tv_usec = A.tv_usec - B; \ if (A.tv_usec < 0) \ { \ A.tv_sec--; \ A.tv_usec = 1000000 + A.tv_usec; \ } } // End of Tango namespace #endif /* _POLLTHREAD_ */ tango-8.1.2c+dfsg.orig/lib/cpp/server/utils_shut.cpp0000644000175000017500000001071612205375142021346 0ustar piccapiccastatic const char *RcsId = "$Id: utils_shut.cpp 22213 2013-03-07 14:32:56Z taurel $"; //+============================================================================= // // file : utils_shut.cpp // // description : C++ source for some methods of the Util class related // to server shutdown // // project : TANGO // // author(s) : E.Taurel // // Copyright (C) : 2004,2005,2006,2007,2008,2009,2010,2011,2012,2013 // European Synchrotron Radiation Facility // BP 220, Grenoble 38043 // FRANCE // // This file is part of Tango. // // Tango 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. // // Tango 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 Tango. If not, see . // // $Revision: 22213 $ // //-============================================================================= #if HAVE_CONFIG_H #include #endif #include #include #include extern omni_thread::key_t key_py_data; namespace Tango { //+---------------------------------------------------------------------------- // // method : Util::shutdown_server() // // description : This method sends command to the polling thread for // all cmd/attr with polling configuration stored in db. // This is done in separate thread in order to equally // spread all the polled objects polling time on the // smallest polling period. // //----------------------------------------------------------------------------- void Util::shutdown_server() { // // Stopping a device server means : // - Mark the server as shutting down // - Send kill command to the polling thread // - Join with this polling thread // - Unregister server in database // - Delete devices (except the admin one) // - Stop the KeepAliveThread and the EventConsumer Thread when // they have been started to receive events // - Force writing file database in case of // - Shutdown the ORB // - Cleanup Logging // set_svr_shutting_down(true); // // send the exit command to all the polling threads in the pool // stop_all_polling_threads(); stop_heartbeat_thread(); clr_heartbeat_th_ptr(); // // Unregister the server in the database // try { unregister_server(); } catch(...) {} // // Delete the devices (except the admin one) // Protect python data // omni_thread::value_t *tmp_py_data = omni_thread::self()->get_value(key_py_data); PyLock *lock_ptr = (static_cast(tmp_py_data))->PerTh_py_lock; lock_ptr->Get(); get_dserver_device()->delete_devices(); lock_ptr->Release(); // // Stop the KeepAliveThread and the EventConsumer thread when // they have been started to receive events. // ApiUtil *au = ApiUtil::instance(); if (au->is_notifd_event_consumer_created() == true) { NotifdEventConsumer *ec = ApiUtil::instance()->get_notifd_event_consumer(); if (ec != NULL) ec->shutdown(); } if (au->is_zmq_event_consumer_created() == true) { ZmqEventConsumer *ec = ApiUtil::instance()->get_zmq_event_consumer(); if (ec != NULL) ec->shutdown(); } // // Disconnect the server from the notifd, when it was connected // NotifdEventSupplier *ev = get_notifd_event_supplier(); if (ev != NULL) ev->disconnect_from_notifd(); // // Delete ZmqEventSupplier // ZmqEventSupplier *zev = get_zmq_event_supplier(); delete zev; // // Close access to file database when used // if (_FileDb == true) { Database *db_ptr = get_database(); db_ptr->write_filedatabase(); delete db_ptr; cout4 << "Database object deleted" << endl; } // // If the server uses its own event loop, do not call it any more // if (is_server_event_loop_set()) set_shutdown_server(true); // // Shutdown the ORB // cout4 << "Going to shutdown ORB" << endl; CORBA::ORB_ptr loc_orb = get_orb(); loc_orb->shutdown(true); cout4 << "ORB shutdown" << endl; #ifdef TANGO_HAS_LOG4TANGO // clean-up the logging system Logging::cleanup(); cout4 << "Logging cleaned-up" << endl; #endif } } // End of Tango namespace tango-8.1.2c+dfsg.orig/lib/cpp/server/notifdeventsupplier.cpp0000644000175000017500000007076412205375142023265 0ustar piccapiccastatic const char *RcsId = "$Id$"; //////////////////////////////////////////////////////////////////////////////// // // file notifdeventsupplier.cpp // // C++ class for implementing the event server // singleton class - NotifdEventSupplier. // This class is used to send events from the server // to the notification service. // // author(s) : E.Taurel (taurel@esrf.fr) // // original : August 2011 // // Copyright (C) : 2011,2012 // European Synchrotron Radiation Facility // BP 220, Grenoble 38043 // FRANCE // // This file is part of Tango. // // Tango 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. // // Tango 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 Tango. If not, see . // // $Revision: 17240 $ // // //////////////////////////////////////////////////////////////////////////////// #include #include #include #include #include #include #ifdef _TG_WINDOWS_ #include #include #else #include #include #endif using namespace CORBA; namespace Tango { NotifdEventSupplier *NotifdEventSupplier::_instance = NULL; /************************************************************************/ /* */ /* NotifdEventSupplier class */ /* ------------------- */ /* */ /************************************************************************/ NotifdEventSupplier::NotifdEventSupplier(CORBA::ORB_var _orb, CosNotifyChannelAdmin::SupplierAdmin_var _supplierAdmin, CosNotifyChannelAdmin::ProxyID _proxId, CosNotifyChannelAdmin::ProxyConsumer_var _proxyConsumer, CosNotifyChannelAdmin::StructuredProxyPushConsumer_var _structuredProxyPushConsumer, CosNotifyChannelAdmin::EventChannelFactory_var _eventChannelFactory, CosNotifyChannelAdmin::EventChannel_var _eventChannel, string &event_ior, Util *tg): EventSupplier(tg) { orb_ = _orb; supplierAdmin = _supplierAdmin; proxyId = _proxId; proxyConsumer = _proxyConsumer; structuredProxyPushConsumer = _structuredProxyPushConsumer; eventChannelFactory = _eventChannelFactory; eventChannel = _eventChannel; event_channel_ior = event_ior; _instance = this; } NotifdEventSupplier *NotifdEventSupplier::create(CORBA::ORB_var _orb, string server_name, Util *tg) { cout4 << "calling Tango::NotifdEventSupplier::create() \n"; // // does the NotifdEventSupplier singleton exist already ? if so simply return it // if (_instance != NULL) { return _instance; } // // Connect process to the notifd service // NotifService ns; connect_to_notifd(ns,_orb,server_name,tg); // // NotifdEventSupplier singleton does not exist, create it // NotifdEventSupplier *_event_supplier = new NotifdEventSupplier(_orb,ns.SupAdm,ns.pID,ns.ProCon,ns.StrProPush,ns.EveChaFac,ns.EveCha,ns.ec_ior,tg); return _event_supplier; } void NotifdEventSupplier::connect() { // // Connect to the Proxy Consumer // try { structuredProxyPushConsumer -> connect_structured_push_supplier(_this()); } catch(const CosEventChannelAdmin::AlreadyConnected&) { cerr << "Tango::NotifdEventSupplier::connect() caught AlreadyConnected exception" << endl; } } void NotifdEventSupplier::disconnect_structured_push_supplier() { cout4 << "calling Tango::NotifdEventSupplier::disconnect_structured_push_supplier() \n"; } void NotifdEventSupplier::subscription_change(TANGO_UNUSED(const CosNotification::EventTypeSeq& added), TANGO_UNUSED(const CosNotification::EventTypeSeq& deled)) { cout4 << "calling Tango::NotifdEventSupplier::subscription_change() \n"; } //+---------------------------------------------------------------------------- // // method : NotifdEventSupplier::connect_to_notifd() // // description : Method to connect the process to the notifd // // argument : in : ns : Ref. to a struct with notifd connection parameters // //----------------------------------------------------------------------------- void NotifdEventSupplier::connect_to_notifd(NotifService &ns,CORBA::ORB_var &_orb, string &server_name, Util *tg) { CosNotifyChannelAdmin::EventChannelFactory_var _eventChannelFactory; CosNotifyChannelAdmin::EventChannel_var _eventChannel; // // Get a reference to the Notification Service EventChannelFactory from // the TANGO database or from the server itself in case of server // started with the -file option // string &host_name = tg->get_host_name(); string factory_ior; string factory_name; factory_name = "notifd/factory/" + host_name; CORBA::Any_var received; string d_name = "DServer/"; d_name = d_name + server_name; const DevVarLongStringArray *dev_import_list; Database *db = tg->get_database(); // // For compatibility reason, search in database first with a fqdn name // If nothing is found in DB and if the provided name is a FQDN, redo the // search with a canonical name. In case the DbCache, is used, this algo // is implemented in the stored procedure // if (Util::_FileDb == false) { try { if (tg->get_db_cache() != NULL) { dev_import_list = tg->get_db_cache()->import_notifd_event(); } else { try { received = db->import_event(factory_name); } catch (Tango::DevFailed &e) { string reason(e.errors[0].reason.in()); if (reason == "DB_DeviceNotDefined") { string::size_type pos = factory_name.find('.'); if (pos != string::npos) { string factory_name_canon = factory_name.substr(0,pos); received = db->import_event(factory_name_canon); } else throw; } else throw; } } } catch (...) { // // Impossible to connect to notifd. In case there is already an entry in the db // for this server event channel, clear it. // if (tg->is_svr_starting() == true) { try { db->unexport_event(d_name); } catch (...) {} // // There is a cout and a cerr here to have the message displayed on the console // AND sent to the logging system (cout is redirected to the logging when // compiled with -D_TANGO_LIB) // cerr << "Failed to import EventChannelFactory " << factory_name << " from the Tango database" << endl; cout << "Failed to import EventChannelFactory " << factory_name << " from the Tango database" << endl; } EventSystemExcept::throw_exception((const char*)API_NotificationServiceFailed, (const char*)"Failed to import the EventChannelFactory from the Tango database", (const char*)"NotifdEventSupplier::create()"); } if (tg->get_db_cache() == NULL) received.inout() >>= dev_import_list; factory_ior = string((dev_import_list->svalue)[1]); } else { Tango::DbDatum na; string cl_name("notifd"); try { na = db->get_device_name(server_name,cl_name); } catch (Tango::DevFailed &) { if (tg->is_svr_starting() == true) { cerr << "Failed to import EventChannelFactory from the Device Server property file" << endl; cerr << "Notifd event will not be generated" << endl; cout << "Failed to import EventChannelFactory from the Device Server property file" << endl; cout << "Notifd event will not be generated" << endl; } EventSystemExcept::throw_exception((const char*)API_NotificationServiceFailed, (const char*)"Failed to import the EventChannelFactory from the Device Server property file", (const char*)"NotifdEventSupplier::create()"); } factory_ior = na.value_string[0]; } try { CORBA::Object *event_factory_obj; event_factory_obj = _orb -> string_to_object(factory_ior.c_str()); #ifndef _TG_WINDOWS_ if (event_factory_obj -> _non_existent()) event_factory_obj = CORBA::Object::_nil(); #endif /* _TG_WINDOWS_ */ // // Narrow the CORBA_Object reference to an EventChannelFactory // reference so we can invoke its methods // omniORB::setClientConnectTimeout(NARROW_CLNT_TIMEOUT); _eventChannelFactory = CosNotifyChannelAdmin::EventChannelFactory::_narrow(event_factory_obj); omniORB::setClientConnectTimeout(0); // // Make sure the CORBA object was really an EventChannelFactory // if(CORBA::is_nil(_eventChannelFactory)) { cerr << factory_name << " is not an EventChannelFactory " << endl; EventSystemExcept::throw_exception((const char*)API_NotificationServiceFailed, (const char*)"Failed to import the EventChannelFactory from the Tango database", (const char*)"NotifdEventSupplier::create()"); } } catch (...) { omniORB::setClientConnectTimeout(0); // // Impossible to connect to notifd. In case there is already an entry in the db // for this server event channel, clear it. // if ((Util::_FileDb == false) && (tg->is_svr_starting() == true)) { try { db->unexport_event(d_name); } catch (...) {} } // // There is a cout and a cerr here to have the message displayed on the console // AND sent to the logging system (cout is redirected to the logging when // compiled with -D_TANGO_LIB) // Print these messages only during DS startup sequence // if (tg->is_svr_starting() == true) { cerr << "Failed to narrow the EventChannelFactory - Notifd events will not be generated (hint: start the notifd daemon on this host)" << endl; cout << "Failed to narrow the EventChannelFactory - Notifd events will not be generated (hint: start the notifd daemon on this host)" << endl; } EventSystemExcept::throw_exception((const char*)API_NotificationServiceFailed, (const char*)"Failed to narrow the EventChannelFactory, make sure the notifd process is running on this host", (const char*)"NotifdEventSupplier::create()"); } // // Get a reference to an EventChannel for this device server from the // TANGO database // int channel_exported=-1; string channel_ior, channel_host; if (Util::_FileDb == false) { try { if (tg->get_db_cache() != NULL) { dev_import_list = tg->get_db_cache()->DbServerCache::import_adm_event(); } else { received = db->import_event(d_name); } } catch (...) { // // There is a cout and a cerr here to have the message displayed on the console // AND sent to the logging system (cout is redirected to the logging when // compiled with -D_TANGO_LIB) // cerr << d_name << " has no event channel defined in the database - creating it " << endl; cout << d_name << " has no event channel defined in the database - creating it " << endl; channel_exported = 0; } if (channel_exported != 0) { if (tg->get_db_cache() == NULL) received.inout() >>= dev_import_list; channel_ior = string((dev_import_list->svalue)[1]); channel_exported = dev_import_list->lvalue[0]; // // check if the channel is exported on this host, if not assume it // is an old channel and we need to recreate it on the local host // channel_host = string((dev_import_list->svalue)[3]); if (channel_host != host_name) channel_exported = 0; } } else { try { Tango::DbDatum na; string cl_name(NOTIFD_CHANNEL); na = db->get_device_name(server_name,cl_name); channel_ior = na.value_string[0]; channel_exported = 1; } catch (Tango::DevFailed &) { channel_exported = 0; } } if (channel_exported) { CORBA::Object *event_channel_obj; event_channel_obj = _orb -> string_to_object(channel_ior.c_str()); try { if (event_channel_obj -> _non_existent()) event_channel_obj = CORBA::Object::_nil(); _eventChannel = CosNotifyChannelAdmin::EventChannel::_nil(); _eventChannel = CosNotifyChannelAdmin::EventChannel::_narrow(event_channel_obj); if(CORBA::is_nil(_eventChannel)) { channel_exported = 0; } } catch (...) { cout4 << "caught exception while trying to test event_channel object\n"; channel_exported = 0; } } // // The device server event channel does not exist, let's create a new one // if (!channel_exported) { CosNotification::QoSProperties initialQoS; CosNotification::AdminProperties initialAdmin; CosNotifyChannelAdmin::ChannelID channelId; try { _eventChannel = _eventChannelFactory -> create_channel(initialQoS, initialAdmin, channelId); cout4 << "Tango::NotifdEventSupplier::create() channel for server " << d_name << " created\n"; char *_ior = _orb->object_to_string(_eventChannel); string ior_string(_ior); if (Util::_FileDb == false) { Tango::DevVarStringArray *eve_export_list = new Tango::DevVarStringArray; eve_export_list->length(5); (*eve_export_list)[0] = CORBA::string_dup(d_name.c_str()); (*eve_export_list)[1] = CORBA::string_dup(ior_string.c_str()); (*eve_export_list)[2] = CORBA::string_dup(host_name.c_str()); ostringstream ostream; ostream << getpid() << ends; (*eve_export_list)[3] = CORBA::string_dup(ostream.str().c_str()); (*eve_export_list)[4] = CORBA::string_dup("1"); bool retry = true; int ctr = 0; int db_to = db->get_timeout_millis(); db->set_timeout_millis(db_to * 2); while ((retry == true) && (ctr < 4)) { try { db->export_event(eve_export_list); retry = false; } catch (Tango::CommunicationFailed &) {ctr++;} } db->set_timeout_millis(db_to); cout4 << "successfully exported event channel to Tango database !\n"; } else { // // In case of DS started with -file option, store the // event channel within the event supplier object and in the file // ns.ec_ior = ior_string; try { db->write_event_channel_ior_filedatabase(ior_string); } catch (Tango::DevFailed &e) {} } CORBA::string_free(_ior); } catch(const CosNotification::UnsupportedQoS&) { cerr << "Failed to create event channel - events will not be generated (hint: start the notifd daemon on this host)" << endl; EventSystemExcept::throw_exception((const char*)API_NotificationServiceFailed, (const char*)"Failed to create a new EventChannel, make sure the notifd process is running on this host", (const char*)"NotifdEventSupplier::create()"); } catch(const CosNotification::UnsupportedAdmin&) { cerr << "Failed to create event channel - events will not be generated (hint: start the notifd daemon on this host)" << endl; EventSystemExcept::throw_exception((const char*)API_NotificationServiceFailed, (const char*)"Failed to create a new EventChannel, make sure the notifd process is running on this host", (const char*)"NotifdEventSupplier::create()"); } } else { cout4 << "Tango::NotifdEventSupplier::create(): _narrow worked, use this event channel\n"; if (Util::_FileDb == true) ns.ec_ior = channel_ior; } // // Obtain a Supplier Admin // // // We'll use the channel's default Supplier admin // CosNotifyChannelAdmin::SupplierAdmin_var _supplierAdmin = _eventChannel -> default_supplier_admin(); if (CORBA::is_nil(_supplierAdmin)) { cerr << "Could not get CosNotifyChannelAdmin::SupplierAdmin" << endl; EventSystemExcept::throw_exception((const char*)API_NotificationServiceFailed, (const char*)"Failed to get the default supplier admin from the notification daemon (hint: make sure the notifd process is running on this host)", (const char*)"NotifdEventSupplier::create()"); } // // If necessary, clean up remaining proxies left by previous run of the DS // which did a core dump (or similar) // if (tg->is_svr_starting() == true) { CosNotifyChannelAdmin::ProxyIDSeq_var proxies; proxies = _supplierAdmin->push_consumers(); if (proxies->length() >= 1) { for (unsigned int loop = 0;loop < proxies->length();loop++) { CosNotifyChannelAdmin::ProxyConsumer_var _tmp_proxyConsumer; _tmp_proxyConsumer = _supplierAdmin->get_proxy_consumer(proxies[loop]); CosNotifyChannelAdmin::StructuredProxyPushConsumer_var _tmp_structuredProxyPushConsumer; _tmp_structuredProxyPushConsumer = CosNotifyChannelAdmin::StructuredProxyPushConsumer::_narrow(_tmp_proxyConsumer); if (CORBA::is_nil(_tmp_structuredProxyPushConsumer)) { continue; } try { _tmp_structuredProxyPushConsumer->disconnect_structured_push_consumer(); } catch(CORBA::Exception &) {} } } } // // Obtain a Proxy Consumer // // // We are using the "Push" model and Structured data // CosNotifyChannelAdmin::ProxyID _proxyId; CosNotifyChannelAdmin::ProxyConsumer_var _proxyConsumer; try { _proxyConsumer = _supplierAdmin -> obtain_notification_push_consumer(CosNotifyChannelAdmin::STRUCTURED_EVENT, _proxyId); if (CORBA::is_nil(_proxyConsumer)) { cerr << "Could not get CosNotifyChannelAdmin::ProxyConsumer" << endl; EventSystemExcept::throw_exception((const char*)API_NotificationServiceFailed, (const char*)"Failed to obtain a Notification push consumer, make sure the notifd process is running on this host", (const char*)"NotifdEventSupplier::create()"); } } catch(const CosNotifyChannelAdmin::AdminLimitExceeded&) { cerr << "Failed to get push consumer from notification daemon - events will not be generated (hint: start the notifd daemon on this host)" << endl; EventSystemExcept::throw_exception((const char*)API_NotificationServiceFailed, (const char*)"Failed to get push consumer from notification daemon (hint: make sure the notifd process is running on this host)", (const char*)"NotifdEventSupplier::create()"); } CosNotifyChannelAdmin::StructuredProxyPushConsumer_var _structuredProxyPushConsumer = CosNotifyChannelAdmin::StructuredProxyPushConsumer::_narrow(_proxyConsumer); if (CORBA::is_nil(_structuredProxyPushConsumer)) { cerr << "Tango::NotifdEventSupplier::create() could not get CosNotifyChannelAdmin::StructuredProxyPushConsumer" << endl; } // // Init returned value // ns.SupAdm = _supplierAdmin; ns.pID = _proxyId; ns.ProCon = _proxyConsumer; ns.StrProPush = _structuredProxyPushConsumer; ns.EveChaFac = _eventChannelFactory; ns.EveCha = _eventChannel; } //+---------------------------------------------------------------------------- // // method : NotifdEventSupplier::push_heartbeat_event() // // description : Method to send the hearbeat event // // argument : in : // //----------------------------------------------------------------------------- void NotifdEventSupplier::push_heartbeat_event() { CosNotification::StructuredEvent struct_event; string event, domain_name; time_t delta_time; time_t now_time; static int heartbeat_counter=0; // // Heartbeat - check wether a heartbeat event has been sent recently // if not then send it. A heartbeat contains no data, it is used by the // consumer to know that the supplier is still alive. // Tango::Util *tg = Tango::Util::instance(); DServer *adm_dev = tg->get_dserver_device(); now_time = time(NULL); delta_time = now_time - adm_dev->last_heartbeat; cout3 << "NotifdEventSupplier::push_heartbeat_event(): delta time since last heartbeat " << delta_time << endl; // // We here compare delta_time to 8 and not to 10. // This is necessary because, sometimes the polling thread is some // milli second in advance. The computation here is done in seconds // So, if the polling thread is in advance, delta_time computed in // seconds will be 9 even if in reality it is 9,9 // if (delta_time >= 8) { domain_name = "dserver/" + adm_dev->get_full_name(); struct_event.header.fixed_header.event_type.domain_name = CORBA::string_dup(domain_name.c_str()); struct_event.header.fixed_header.event_type.type_name = CORBA::string_dup(fqdn_prefix.c_str()); struct_event.header.variable_header.length( 0 ); cout3 << "NotifdEventSupplier::push_heartbeat_event(): detected heartbeat event for " << domain_name << endl; cout3 << "NotifdEventSupplier::push_heartbeat_event(): delta _time " << delta_time << endl; struct_event.header.fixed_header.event_name = CORBA::string_dup("heartbeat"); struct_event.filterable_data.length(1); struct_event.filterable_data[0].name = CORBA::string_dup("heartbeat_counter"); struct_event.filterable_data[0].value <<= (CORBA::Long) heartbeat_counter++; adm_dev->last_heartbeat = now_time; struct_event.remainder_of_body <<= (CORBA::Long)adm_dev->last_heartbeat; // // Push the event // bool fail = false; try { structuredProxyPushConsumer -> push_structured_event(struct_event); } catch(const CosEventComm::Disconnected&) { cout3 << "NotifdEventSupplier::push_heartbeat_event() event channel disconnected !\n"; fail = true; } catch(const CORBA::TRANSIENT &) { cout3 << "NotifdEventSupplier::push_heartbeat_event() caught a CORBA::TRANSIENT ! " << endl; fail = true; } catch(const CORBA::COMM_FAILURE &) { cout3 << "NotifdEventSupplier::push_heartbeat_event() caught a CORBA::COMM_FAILURE ! " << endl; fail = true; } catch(const CORBA::SystemException &) { cout3 << "NotifdEventSupplier::push_heartbeat_event() caught a CORBA::SystemException ! " << endl; fail = true; } // // If it was not possible to communicate with notifd, // try a reconnection // if (fail == true) { try { reconnect_notifd(); } catch (...) {} } } } //+---------------------------------------------------------------------------- // // method : NotifdEventSupplier::reconnect_notifd() // // description : Method to reconnect to the notifd // // argument : in : // //----------------------------------------------------------------------------- void NotifdEventSupplier::reconnect_notifd() { // // Check notifd but trying to read an attribute of the event channel // If it works, we immediately return // try { CosNotifyChannelAdmin::EventChannelFactory_var ecf = eventChannel->MyFactory(); return; } catch (...) { cout3 << "Notifd dead !!!!!!" << endl; } // // Reconnect process to notifd after forcing // process to re-read the file database // in case it is used // try { NotifService ns; Tango::Util *tg = Tango::Util::instance(); Database *db = tg->get_database(); if (Util::_FileDb == true) db->reread_filedatabase(); connect_to_notifd(ns,orb_,tg->get_ds_name(),tg); supplierAdmin = ns.SupAdm; proxyId = ns.pID; proxyConsumer = ns.ProCon; structuredProxyPushConsumer = ns.StrProPush; eventChannelFactory = ns.EveChaFac; eventChannel = ns.EveCha; event_channel_ior = ns.ec_ior; } catch (...) { cout3 << "Can't reconnect.............." << endl; } connect(); } //+---------------------------------------------------------------------------- // // method : NotifdEventSupplier::disconnect_from_notifd() // // description : Method to disconnect the DS from the notifd event channel // //----------------------------------------------------------------------------- void NotifdEventSupplier::disconnect_from_notifd() { try { structuredProxyPushConsumer->disconnect_structured_push_consumer(); } catch(CORBA::Exception &) {} } //+---------------------------------------------------------------------------- // // method : NotifdEventSupplier::push_event() // // description : Method to send the event to the event channel // // argument : in : device_impl : The device // event_type : The event type (change, periodic....) // filterable_names : // filterable_data : // attr_value : The attribute value // except : The exception thrown during the last // attribute reading. NULL if no exception // //----------------------------------------------------------------------------- void NotifdEventSupplier::push_event(DeviceImpl *device_impl,string event_type, vector &filterable_names,vector &filterable_data,vector &filterable_names_lg,vector &filterable_data_lg, struct AttributeData &attr_value,string &attr_name,DevFailed *except) { CosNotification::StructuredEvent struct_event; string domain_name; cout3 << "EventSupplier::push_event(): called for attribute " << attr_name << endl; // get the mutex to synchronize the sending of events omni_mutex_lock l(push_mutex); string loc_attr_name = attr_name; transform(loc_attr_name.begin(),loc_attr_name.end(),loc_attr_name.begin(),::tolower); domain_name = device_impl->get_name_lower() + "/" + loc_attr_name; struct_event.header.fixed_header.event_type.domain_name = CORBA::string_dup(domain_name.c_str()); struct_event.header.fixed_header.event_type.type_name = CORBA::string_dup(fqdn_prefix.c_str()); struct_event.header.variable_header.length( 0 ); unsigned long nb_filter = filterable_names.size(); unsigned long nb_filter_lg = filterable_names_lg.size(); struct_event.filterable_data.length(nb_filter + nb_filter_lg); if (nb_filter != 0) { if (nb_filter == filterable_data.size()) { for (unsigned long i = 0; i < nb_filter; i++) { struct_event.filterable_data[i].name = CORBA::string_dup(filterable_names[i].c_str()); struct_event.filterable_data[i].value <<= (CORBA::Double) filterable_data[i]; } } } if (nb_filter_lg != 0) { if (nb_filter_lg == filterable_data_lg.size()) { for (unsigned long i = 0; i < nb_filter_lg; i++) { struct_event.filterable_data[i + nb_filter].name = CORBA::string_dup(filterable_names_lg[i].c_str()); struct_event.filterable_data[i + nb_filter].value <<= (CORBA::Long) filterable_data_lg[i]; } } } if (except == NULL) { if (attr_value.attr_val != NULL) struct_event.remainder_of_body <<= (*attr_value.attr_val); else if (attr_value.attr_val_3 != NULL) struct_event.remainder_of_body <<= (*attr_value.attr_val_3); else if (attr_value.attr_val_4 != NULL) { struct_event.remainder_of_body <<= (*attr_value.attr_val_4); // // Insertion in the event structure Any also copy the mutex ptr. // When this event structure will be deleted (at the end of this method), // the struct inserted into the Any will also be deleted. // This will unlock the mutex.... // Clean the mutex ptr in the structure inserted in the Any to prevent this // bad behavior // const Tango::AttributeValue_4 *tmp_ptr; struct_event.remainder_of_body >>= tmp_ptr; const_cast(tmp_ptr)->mut_ptr = NULL; } else if (attr_value.attr_conf_2 != NULL) struct_event.remainder_of_body <<= (*attr_value.attr_conf_2); else if (attr_value.attr_conf_3 != NULL) struct_event.remainder_of_body <<= (*attr_value.attr_conf_3); else struct_event.remainder_of_body <<= (*attr_value.attr_dat_ready); } else struct_event.remainder_of_body <<= except->errors; struct_event.header.fixed_header.event_name = CORBA::string_dup(event_type.c_str()); cout3 << "EventSupplier::push_event(): push event " << event_type << " for " << device_impl->get_name() + "/" + attr_name << endl; // // Push the event // bool fail = false; try { structuredProxyPushConsumer -> push_structured_event(struct_event); } catch(const CosEventComm::Disconnected&) { cout3 << "EventSupplier::push_event() event channel disconnected !\n"; fail = true; } catch(const CORBA::TRANSIENT &) { cout3 << "EventSupplier::push_event() caught a CORBA::TRANSIENT ! " << endl; fail = true; } catch(const CORBA::COMM_FAILURE &) { cout3 << "EventSupplier::push_event() caught a CORBA::COMM_FAILURE ! " << endl; fail = true; } catch(const CORBA::SystemException &) { cout3 << "EventSupplier::push_event() caught a CORBA::SystemException ! " << endl; fail = true; } // // If it was not possible to communicate with notifd, // try a reconnection // if (fail == true) { try { reconnect_notifd(); } catch (...) {} } } //+---------------------------------------------------------------------------- // // method : NotifdEventSupplier::file_db_svr() // // description : In case of DS using file as database, set a marker in the // fqdn_prefix // //----------------------------------------------------------------------------- void NotifdEventSupplier::file_db_svr() { fqdn_prefix = fqdn_prefix + '#'; } } /* End of Tango namespace */ tango-8.1.2c+dfsg.orig/lib/cpp/server/logcmds.h0000644000175000017500000001332512205375142020237 0ustar piccapicca//============================================================================= // // file : LogCmds.h // // description : Logging oriented commands of the DServerClass. // // project : TANGO // // author(s) : N.Leclercq // // Copyright (C) : 2004,2005,2006,2007,2008,2009,2010,2011,2012,2013 // European Synchrotron Radiation Facility // BP 220, Grenoble 38043 // FRANCE // // This file is part of Tango. // // Tango 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. // // Tango 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 Tango. If not, see . // // $Revision: 22213 $ // //============================================================================= #ifdef TANGO_HAS_LOG4TANGO #ifndef _LOG_CMDS_H #define _LOG_CMDS_H #include namespace Tango { //============================================================================= // // The AddLoggingTarget class // // description : Class implementing the AddLoggingTarget command. // This command adds one (or more) logging target to one (or more) // device(s) running within the same Device server. // //============================================================================= class AddLoggingTarget : public Command { public: AddLoggingTarget (const char *cmd_name, Tango::CmdArgType in, Tango::CmdArgType out, const std::string &in_desc); ~AddLoggingTarget() {}; virtual CORBA::Any *execute(DeviceImpl *device, const CORBA::Any &in_any); }; //============================================================================= // // The RemoveLoggingTarget class // // description : Class implementing the RemoveLoggingTarget command. // This command removes one (or more) logging target to one (or more) // device(s) running within the same Device server. // //============================================================================= class RemoveLoggingTarget : public Command { public: RemoveLoggingTarget (const char *cmd_name, Tango::CmdArgType in, Tango::CmdArgType out, const std::string &in_desc); ~RemoveLoggingTarget() {}; virtual CORBA::Any *execute(DeviceImpl *device, const CORBA::Any &in_any); }; //============================================================================= // // The GetLoggingTarget class // // description : Class implementing the GetLoggingTarget command. // This command returns the logging target list of a device. // //============================================================================= class GetLoggingTarget : public Command { public: GetLoggingTarget (const char *cmd_name, Tango::CmdArgType in, Tango::CmdArgType out, const std::string &in_desc, const std::string &out_desc); ~GetLoggingTarget() {}; virtual CORBA::Any *execute(DeviceImpl *device, const CORBA::Any &in_any); }; //============================================================================= // // The SetLoggingLevel class // // description : Class implementing the SetLoggingLevel command. // This command set the logging level of one or more device(s). // //============================================================================= class SetLoggingLevel : public Command { public: SetLoggingLevel (const char *cmd_name, Tango::CmdArgType in, Tango::CmdArgType out, const std::string &in_desc); ~SetLoggingLevel() {}; virtual CORBA::Any *execute(DeviceImpl *device, const CORBA::Any &in_any); }; //============================================================================= // // The GetLoggingLevel class // // description : Class implementing the GetLoggingLevel command. // This command returns the logging level of one or more device(s). // //============================================================================= class GetLoggingLevel : public Command { public: GetLoggingLevel (const char *cmd_name, Tango::CmdArgType in, Tango::CmdArgType out, const std::string &in_desc, const std::string &out_desc); ~GetLoggingLevel() {}; virtual CORBA::Any *execute(DeviceImpl *device, const CORBA::Any &in_any); }; //============================================================================= // // The StopLogging class // // description : Class implementing the StopLogging command. // This command disable the logging for all the devices. // //============================================================================= class StopLogging : public Command { public: StopLogging (const char *cmd_name, Tango::CmdArgType in, Tango::CmdArgType out); ~StopLogging() {}; virtual CORBA::Any *execute(DeviceImpl *device, const CORBA::Any &in_any); }; //============================================================================= // // The StartLogging class // // description : Class implementing the StartLogging command. // This command enable the logging for all the devices. // //============================================================================= class StartLogging : public Command { public: StartLogging (const char *cmd_name, Tango::CmdArgType in, Tango::CmdArgType out); ~StartLogging() {}; virtual CORBA::Any *execute(DeviceImpl *device, const CORBA::Any &in_any); }; } // End of Tango namespace #endif // _LOG_CMDS_H #endif // TANGO_HAS_LOG4TANGO tango-8.1.2c+dfsg.orig/lib/cpp/server/attrprop.tpp0000644000175000017500000001420012205375142021027 0ustar piccapicca//+============================================================================ // // file : AttrProp.tpp // // description : C++ source code for the MultiAttrProp class template // methods // // project : TANGO // // author(s) : E.Taurel // // Copyright (C) : 2011,2012 // European Synchrotron Radiation Facility // BP 220, Grenoble 38043 // FRANCE // // This file is part of Tango. // // Tango 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. // // Tango 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 Tango. If not, see . // // $Revision: 17240 $ // //-============================================================================ #ifndef _ATTRPROP_TPP #define _ATTRPROP_TPP namespace Tango { // // AttrProp template specialisation for DevUChar // template<> inline AttrProp::AttrProp(const DevUChar &value) : val(value), is_value(true), ext(Tango_NullPtr) { TangoSys_MemStream st; st.precision(TANGO_FLOAT_PRECISION); st << (short)value; // to represent the numeric value str = st.str(); } template<> inline AttrProp& AttrProp::operator=(const DevUChar &value) { TangoSys_MemStream st; st.precision(TANGO_FLOAT_PRECISION); st << (short)value; // to represent the numeric value str = st.str(); val = value; is_value = true; return *this; } template<> inline void AttrProp::set_val(const DevUChar &value) { TangoSys_MemStream st; st.precision(TANGO_FLOAT_PRECISION); st << (short)value; // to represent the numeric value str = st.str(); val = value; is_value = true; } // // DoubleAttrProp template specialisation for DevUChar // template<> inline DoubleAttrProp::DoubleAttrProp(const vector &values) : val(values), is_value(true) { TangoSys_MemStream st; st.precision(TANGO_FLOAT_PRECISION); for(size_t i = 0; i < values.size(); i++) { if(i > 0) st << ","; st << (short)values[i]; // to represent the numeric value } str = st.str(); } template<> inline DoubleAttrProp::DoubleAttrProp(const DevUChar &value) : is_value(true) { TangoSys_MemStream st; st.precision(TANGO_FLOAT_PRECISION); st << (short)value; // to represent the numeric value str = st.str(); val.push_back(value); } template<> inline DoubleAttrProp& DoubleAttrProp::operator=(const vector &values) { TangoSys_MemStream st; st.precision(TANGO_FLOAT_PRECISION); for(size_t i = 0; i < values.size(); i++) { if(i > 0) st << ","; st << (short)values[i]; // to represent the numeric value } str = st.str(); val = values; is_value = true; return *this; } template<> inline DoubleAttrProp& DoubleAttrProp::operator=(const DevUChar &value) { TangoSys_MemStream st; st.precision(TANGO_FLOAT_PRECISION); st << (short)value; // to represent the numeric value str = st.str(); val.push_back(value); is_value = true; return *this; } template<> inline void DoubleAttrProp::set_val(const vector &values) { TangoSys_MemStream st; st.precision(TANGO_FLOAT_PRECISION); for(size_t i = 0; i < values.size(); i++) { if(i > 0) st << ","; st << (short)values[i]; // to represent the numeric value } str = st.str(); val = values; is_value = true; } template<> inline void DoubleAttrProp::set_val(const DevUChar &value) { TangoSys_MemStream st; st.precision(TANGO_FLOAT_PRECISION); st << (short)value; // to represent the numeric value str = st.str(); val.push_back(value); is_value = true; } // // MultiAttrProp template specialisation for DevEncoded // template <> class MultiAttrProp { public: /**@name Constructors * Miscellaneous constructors */ //@{ /** * Default constructor. */ MultiAttrProp() {} //@} /**@name Class data members */ //@{ /** * Attribute label */ string label; /** * Attribute description */ string description; /** * Attribute unit */ string unit; /** * Attribute standard_unit */ string standard_unit; /** * Attribute display_unit */ string display_unit; /** * Attribute format */ string format; /** * Attribute min_value */ AttrProp min_value; /** * Attribute max_value */ AttrProp max_value; /** * Attribute min_alarm */ AttrProp min_alarm; /** * Attribute max_alarm */ AttrProp max_alarm; /** * Attribute min_warning */ AttrProp min_warning; /** * Attribute max_warning */ AttrProp max_warning; /** * Attribute delta_t */ AttrProp delta_t; /** * Attribute delta_val */ AttrProp delta_val; /** * Attribute event_period */ AttrProp event_period; /** * Attribute archive_period */ AttrProp archive_period; /** * Attribute rel_change */ DoubleAttrProp rel_change; /** * Attribute abs_change */ DoubleAttrProp abs_change; /** * Attribute archive_rel_change */ DoubleAttrProp archive_rel_change; /** * Attribute archive_abs_change */ DoubleAttrProp archive_abs_change; //@} private: // // The extension class // class MultiAttrPropExt {}; #ifdef HAS_UNIQUE_PTR unique_ptr ext; // Class extension #else MultiAttrPropExt *ext; #endif }; } // End of Tango namespace #endif // _ATTRPROP_TPP tango-8.1.2c+dfsg.orig/lib/cpp/server/utils.tpp0000644000175000017500000004322012205375142020320 0ustar piccapicca//============================================================================= // // file : utils.tpp // // description : C++ source code for the Attribute class template // methods // // project : TANGO // // author(s) : E.Taurel // // Copyright (C) : 2011,2012 // European Synchrotron Radiation Facility // BP 220, Grenoble 38043 // FRANCE // // This file is part of Tango. // // Tango 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. // // Tango 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 Tango. If not, see . // // $Revision$ // //============================================================================= #ifndef _UTILS_TPP #define _UTILS_TPP template void Util::fill_attr_polling_buffer(DeviceImpl *dev, string &att_name, AttrHistoryStack &data) { // // Check that the device is polled // if (dev->is_polled() == false) { TangoSys_OMemStream o; o << "Device " << dev->get_name() << " is not polled" << ends; Except::throw_exception((const char *)API_DeviceNotPolled,o.str(), (const char *)"Util::fill_attr_polling_buffer"); } // // Attribute name in lower case letters and check that it is marked as polled // string obj_name(att_name); transform(obj_name.begin(),obj_name.end(),obj_name.begin(),::tolower); dev->get_polled_obj_by_type_name(Tango::POLL_ATTR,obj_name); // // Get a reference on the Attribute object // Tango::Attribute &att = dev->get_device_attr()->get_attr_by_name(att_name.c_str()); Tango::WAttribute *w_att_ptr = NULL; Tango::AttrWriteType w_type = att.get_writable(); if (w_type == Tango::READ_WRITE) w_att_ptr = &(dev->get_device_attr()->get_w_attr_by_name(att_name.c_str())); // // Check that it is not a WRITE only attribute // if (w_type == Tango::WRITE) { TangoSys_OMemStream o; o << "Attribute " << att_name; o << " of device " << dev->get_name() << " is WRITE only" << ends; Except::throw_exception((const char *)API_DeviceNotPolled,o.str(), (const char *)"Util::fill_attr_polling_buffer"); } // // If the attribute is not READ_WRITE, the ptr to written part should always be NULL // size_t nb_elt = data.length(); if (w_type != READ_WRITE) { for (size_t i = 0;i < nb_elt;i++) { if ((data.get_data())[i].wr_ptr != NULL) { TangoSys_OMemStream o; o << "The attribute " << att_name; o << " for device " << dev->get_name(); o << " is not a READ_WRITE attribute. You can't set the attribute written part."; o << "It is defined for record number " << i + 1 << ends; Except::throw_exception((const char *)API_NotSupportedFeature,o.str(), (const char *)"Util::fill_attr_polling_buffer"); } } } // // For device implementing IDL 3, DevEncoded data type is not supported // long idl_vers = dev->get_dev_idl_version(); if ((att.get_data_type() == DEV_ENCODED) && (idl_vers == 3)) { TangoSys_OMemStream o; o << "The attribute " << att_name; o << " for device " << dev->get_name(); o << " is of type DEV_ENCODED. Your device supports only IDL V3."; o << " DEV_ENCODED data type is supported starting with IDL V4" << ends; Except::throw_exception((const char *)API_NotSupportedFeature,o.str(), (const char *)"Util::fill_attr_polling_buffer"); } // // DevEncoded data type is not supported for spectrum or image attribute // Paranoid code? This case should never happens! // if ((att.get_data_type() == DEV_ENCODED) && (att.get_data_format() != Tango::SCALAR) && (w_type == Tango::READ_WRITE)) { for (size_t i = 0;i < nb_elt;i++) { if ((data.get_data())[i].wr_ptr != NULL) { TangoSys_OMemStream o; o << "The attribute " << att_name; o << " for device " << dev->get_name(); o << " is of type DEV_ENCODED. Only Scalar attribute are supported for DEV_ENCODED"; o << "It is defined for record number " << i + 1 << ends; Except::throw_exception((const char *)API_NotSupportedFeature,o.str(), (const char *)"Util::fill_attr_polling_buffer"); } } } // // Check that the device IDL is at least 3 // if (idl_vers <= 2) { TangoSys_OMemStream o; o << "The device " << dev->get_name() << " is too old to support this feature. "; o << "Please update your device to IDL 3 or more" << ends; Except::throw_exception((const char *)API_NotSupportedFeature,o.str(), (const char *)"Util::fill_attr_polling_buffer"); } // // Check that history is not larger than polling buffer // unsigned long nb_poll = dev->get_attr_poll_ring_depth(att_name); if (nb_elt > nb_poll) { TangoSys_OMemStream o; o << "The polling buffer depth for attribute " << att_name; o << " for device " << dev->get_name(); o << " is only " << nb_poll; o << " which is less than " << nb_elt << "!" << ends; Except::throw_exception((const char *)API_DeviceNotPolled,o.str(), (const char *)"Util::fill_attr_polling_buffer"); } // // A loop on each record // unsigned long i; Tango::DevFailed *save_except; Tango::AttributeValueList_3 *back_3; Tango::AttributeValueList_4 *back_4; bool attr_failed; struct timeval zero,when; zero.tv_sec = zero.tv_usec = 0; // // Take the device monitor before the loop // In case of large element number, it is time cousuming to take/release // the monitor in the loop // dev->get_poll_monitor().get_monitor(); // // The loop for each element // for (i = 0;i < nb_elt;i++) { save_except = NULL; back_3 = NULL; back_4 = NULL; attr_failed = false; if ((data.get_data())[i].err.length() != 0) { attr_failed = true; try { save_except = new Tango::DevFailed((data.get_data())[i].err); } catch (bad_alloc) { dev->get_poll_monitor().rel_monitor(); Except::throw_exception((const char *)API_MemoryAllocation, (const char *)"Can't allocate memory in server", (const char *)"Util::fill_attr_polling_buffer"); } } else { // // Allocate memory for the AttributeValueList sequence // try { if (idl_vers == 4) { back_4 = new Tango::AttributeValueList_4(1); back_4->length(1); (*back_4)[0].value.union_no_data(true); } else { back_3 = new Tango::AttributeValueList_3(1); back_3->length(1); } } catch (bad_alloc) { dev->get_poll_monitor().rel_monitor(); Except::throw_exception((const char *)API_MemoryAllocation, (const char *)"Can't allocate memory in server", (const char *)"Util::fill_attr_polling_buffer"); } // // Init name,date and quality factor // Tango::AttrQuality qu = (data.get_data())[i].qual; if (idl_vers==4) { (*back_4)[0].time.tv_sec = (data.get_data())[i].t_val.tv_sec; (*back_4)[0].time.tv_usec = (data.get_data())[i].t_val.tv_usec; (*back_4)[0].time.tv_nsec = 0; (*back_4)[0].quality = qu; (*back_4)[0].name = CORBA::string_dup(att_name.c_str()); (*back_4)[0].w_dim.dim_x = 0; (*back_4)[0].w_dim.dim_y = 0; (*back_4)[0].r_dim.dim_x = 0; (*back_4)[0].r_dim.dim_y = 0; (*back_4)[0].data_format = att.get_data_format(); } else { (*back_3)[0].time.tv_sec = (data.get_data())[i].t_val.tv_sec; (*back_3)[0].time.tv_usec = (data.get_data())[i].t_val.tv_usec; (*back_3)[0].time.tv_nsec = 0; (*back_3)[0].quality = qu; (*back_3)[0].name = CORBA::string_dup(att_name.c_str()); (*back_3)[0].w_dim.dim_x = 0; (*back_3)[0].w_dim.dim_y = 0; (*back_3)[0].r_dim.dim_x = 0; (*back_3)[0].r_dim.dim_y = 0; } if ((qu == Tango::ATTR_VALID) || (qu == Tango::ATTR_ALARM) || (qu == Tango::ATTR_WARNING) || (qu == Tango::ATTR_CHANGING)) { // // Set Attribute object value // att.set_value((T *)(data.get_data())[i].ptr, (data.get_data())[i].x, (data.get_data())[i].y, (data.get_data())[i].release); att.set_date((data.get_data())[i].t_val); att.set_quality(qu,false); // // Init remaining fields in AttributeValueList // if (w_type == Tango::READ_WITH_WRITE) dev->get_device_attr()->add_write_value(att); else if (w_type == Tango::READ_WRITE) { if ((data.get_data())[i].wr_ptr != NULL) { w_att_ptr->set_write_value((T *)(data.get_data())[i].wr_ptr, (data.get_data())[i].wr_x, (data.get_data())[i].wr_y); dev->get_device_attr()->add_write_value(att); if ((data.get_data())[i].release == true) { if (att.get_data_format() == Tango::SCALAR) delete (data.get_data())[i].wr_ptr; else delete [] (data.get_data())[i].wr_ptr; } } else { dev->get_device_attr()->add_write_value(att); } } // // Insert data into the AttributeValue object // dev->data_into_net_object(att,back_3,back_4,0,w_type,true); // // Init remaining fields // if (idl_vers == 4) { (*back_4)[0].r_dim.dim_x = (data.get_data())[i].x; (*back_4)[0].r_dim.dim_y = (data.get_data())[i].y; if ((w_type == Tango::READ_WRITE) || (w_type == Tango::READ_WITH_WRITE)) { WAttribute &assoc_att = dev->get_device_attr()->get_w_attr_by_ind(att.get_assoc_ind()); (*back_4)[0].w_dim.dim_x = assoc_att.get_w_dim_x(); (*back_4)[0].w_dim.dim_y = assoc_att.get_w_dim_y(); } } else { (*back_3)[0].r_dim.dim_x = (data.get_data())[i].x; (*back_3)[0].r_dim.dim_y = (data.get_data())[i].y; if ((w_type == Tango::READ_WRITE) || (w_type == Tango::READ_WITH_WRITE)) { WAttribute &assoc_att = dev->get_device_attr()->get_w_attr_by_ind(att.get_assoc_ind()); (*back_3)[0].w_dim.dim_x = assoc_att.get_w_dim_x(); (*back_3)[0].w_dim.dim_y = assoc_att.get_w_dim_y(); } } } } // // Fill one slot of polling buffer // try { vector::iterator ite = dev->get_polled_obj_by_type_name(Tango::POLL_ATTR,obj_name); if (attr_failed == false) { if (idl_vers == 4) { when.tv_sec = (*back_4)[0].time.tv_sec - DELTA_T; when.tv_usec = (*back_4)[0].time.tv_usec; (*ite)->insert_data(back_4,when,zero); } else { when.tv_sec = (*back_3)[0].time.tv_sec - DELTA_T; when.tv_usec = (*back_3)[0].time.tv_usec; (*ite)->insert_data(back_3,when,zero); } } else { when = (data.get_data())[i].t_val; when.tv_sec = when.tv_sec - DELTA_T; (*ite)->insert_except(save_except,when,zero); } } catch (Tango::DevFailed &) { if (attr_failed == false) if (idl_vers == 4) delete back_4; else delete back_3; else delete save_except; } } dev->get_poll_monitor().rel_monitor(); } template void Util::fill_cmd_polling_buffer(DeviceImpl *dev, string &cmd_name, CmdHistoryStack &data) { // // Check that the device is polled // if (dev->is_polled() == false) { TangoSys_OMemStream o; o << "Device " << dev->get_name() << " is not polled" << ends; Except::throw_exception((const char *)API_DeviceNotPolled,o.str(), (const char *)"Util::fill_cmd_polling_buffer"); } // // Command name in lower case letters and check that it is marked as polled // string obj_name(cmd_name); transform(obj_name.begin(),obj_name.end(),obj_name.begin(),::tolower); dev->get_polled_obj_by_type_name(Tango::POLL_CMD,obj_name); // // Check that history is not larger than polling buffer // size_t nb_elt = data.length(); long nb_poll = dev->get_cmd_poll_ring_depth(cmd_name); if (nb_elt > (size_t)nb_poll) { TangoSys_OMemStream o; o << "The polling buffer depth for command " << cmd_name; o << " for device " << dev->get_name(); o << " is only " << nb_poll; o << " which is less than " << nb_elt << "!" << ends; Except::throw_exception((const char *)API_DeviceNotPolled,o.str(), (const char *)"Util::fill_cmd_polling_buffer"); } // // Take the device monitor before the loop // In case of large element number, it is time cousuming to take/release // the monitor in the loop // dev->get_poll_monitor().get_monitor(); // // A loop on each record // size_t i; Tango::DevFailed *save_except; bool cmd_failed; CORBA::Any *any_ptr; struct timeval zero,when; zero.tv_sec = zero.tv_usec = 0; for (i = 0;i < nb_elt;i++) { save_except = NULL; cmd_failed = false; if ((data.get_data())[i].err.length() != 0) { cmd_failed = true; try { save_except = new Tango::DevFailed((data.get_data())[i].err); } catch (bad_alloc) { dev->get_poll_monitor().rel_monitor(); Except::throw_exception((const char *)API_MemoryAllocation, (const char *)"Can't allocate memory in server", (const char *)"Util::fill_cmd_polling_buffer"); } } else { // // Allocate memory for the Any object // try { any_ptr = new CORBA::Any(); } catch (bad_alloc) { dev->get_poll_monitor().rel_monitor(); Except::throw_exception((const char *)API_MemoryAllocation, (const char *)"Can't allocate memory in server", (const char *)"Util::fill_cmd_polling_buffer"); } // // Set command value in Any object // If the Any insertion is by pointer, with omniORB, it copy data into the Any // and delete memory. Therefore, no need to delete memory if release is // true. If release is false, uses the insertion by reference which only // copy data. // T *tmp_ptr = (data.get_data())[i].ptr; if ((data.get_data())[i].release == true) (*any_ptr) <<= tmp_ptr; else (*any_ptr) <<= (*tmp_ptr); } // // Fill one slot of polling buffer // try { vector::iterator ite = dev->get_polled_obj_by_type_name(Tango::POLL_CMD,obj_name); when.tv_sec = (data.get_data())[i].t_val.tv_sec - DELTA_T; when.tv_usec = (data.get_data())[i].t_val.tv_usec; if (cmd_failed == false) (*ite)->insert_data(any_ptr,when,zero); else (*ite)->insert_except(save_except,when,zero); } catch (Tango::DevFailed &) { if (cmd_failed == false) delete any_ptr; else delete save_except; } } dev->get_poll_monitor().rel_monitor(); } #endif /* UTILS_TPP */ tango-8.1.2c+dfsg.orig/lib/cpp/server/pollring.cpp0000644000175000017500000021243312205375142020771 0ustar piccapiccastatic const char *RcsId = "$Id: pollring.cpp 22213 2013-03-07 14:32:56Z taurel $\n$Name$"; //+============================================================================ // // file : PollRing.cpp // // description : C++ source code for the RingElt and PollRing // classes. These classes are used to implement the // tango polling ring buffer. There is one // polling ring for each Tango command or attribute // polled. // // project : TANGO // // author(s) : E.Taurel // // Copyright (C) : 2004,2005,2006,2007,2008,2009,2010,2011,2012,2013 // European Synchrotron Radiation Facility // BP 220, Grenoble 38043 // FRANCE // // This file is part of Tango. // // Tango 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. // // Tango 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 Tango. If not, see . // // $Revision: 22213 $ // //-============================================================================ #if HAVE_CONFIG_H #include #endif #include #include #ifdef _TG_WINDOWS_ #include #include #else #include #endif /* _TG_WINDOWS_ */ namespace Tango { //+------------------------------------------------------------------------- // // method : RingElt::RingElt // // description : Constructor for the RingElt class. // This constructor simply set the internal value to their // default // //-------------------------------------------------------------------------- RingElt::RingElt() { when.tv_sec = when.tv_usec = 0; cmd_result = NULL; attr_value = NULL; attr_value_3 = NULL; attr_value_4 = NULL; except = NULL; } //+------------------------------------------------------------------------- // // method : PollRing::PollRing // // description : Two constructors for the PollRing class. The first one // does not take any argument and construct a black box // with the default depth. // The second one create a black box with a depth defined // by the argument. // // argument : in : - max_size : The black box depth // //-------------------------------------------------------------------------- PollRing::PollRing():ring(DefaultPollRingDepth) { insert_elt = 0; nb_elt = 0; max_elt = DefaultPollRingDepth; } PollRing::PollRing(long max_size):ring(max_size) { insert_elt = 0; nb_elt = 0; max_elt = max_size; } //+------------------------------------------------------------------------- // // method : PollRing::~PollRing // // description : The class destructor. It frees all the memory allocated // to store command/attribute result // //-------------------------------------------------------------------------- PollRing::~PollRing() { cout4 << "In PollRing destructor" << endl; long nb = ring.size(); for (long i = 0;i < nb;i++) { delete ring[i].cmd_result; delete ring[i].except; delete ring[i].attr_value; delete ring[i].attr_value_3; delete ring[i].attr_value_4; } } //+------------------------------------------------------------------------- // // method : PollRing::insert_data // // description : These methods insert a new element in the ring buffer // when its real data // // argument : in : - any_ptr : The Any returned by the command // - t : The date // //-------------------------------------------------------------------------- void PollRing::insert_data(CORBA::Any *any_ptr,struct timeval &t) { // // Insert data in the ring // delete(ring[insert_elt].cmd_result); delete(ring[insert_elt].except); ring[insert_elt].except = NULL; ring[insert_elt].cmd_result = any_ptr; ring[insert_elt].when = t; // // Manage insert and read indexes // inc_indexes(); } void PollRing::insert_data(Tango::AttributeValueList *attr_val,struct timeval &t) { // // Insert data in the ring // delete(ring[insert_elt].attr_value); delete(ring[insert_elt].except); ring[insert_elt].except = NULL; ring[insert_elt].attr_value = attr_val; ring[insert_elt].when = t; // // Manage insert and read indexes // inc_indexes(); } void PollRing::insert_data(Tango::AttributeValueList_3 *attr_val,struct timeval &t) { // // Insert data in the ring // delete(ring[insert_elt].attr_value_3); delete(ring[insert_elt].except); ring[insert_elt].except = NULL; ring[insert_elt].attr_value_3 = attr_val; ring[insert_elt].when = t; // // Manage insert and read indexes // inc_indexes(); } void PollRing::insert_data(Tango::AttributeValueList_4 *attr_val,struct timeval &t,bool unlock) { // // Insert data in the ring // delete(ring[insert_elt].attr_value_4); delete(ring[insert_elt].except); ring[insert_elt].except = NULL; ring[insert_elt].attr_value_4 = attr_val; ring[insert_elt].when = t; force_copy_data(ring[insert_elt].attr_value_4); // // Release attribute mutexes because the data are now copied // if (unlock == true) { for (unsigned int loop = 0;loop < attr_val->length();loop++) { Tango::AttributeValue_4 *tmp_ptr = &((*attr_val)[loop]); (tmp_ptr)->rel_attr_mutex(); } } // // Manage insert and read indexes // inc_indexes(); } //------------------------------------------------------------------------- // // method : PollRing::force_copy_data // // description : Since IDL 4, attributes are transferred on the net using // a IDL union. In some cases, the sequence within the union simply // points to the user data (no copy), therefore, this method // force the user data to be copied // // To do this copy we: // 1 - Really copy the data within a temporary sequence // 2 - Force memory freeing (if required by user) using the // union sequence replace call // 3 - Transfer the data from the temporary sequence within the // union sequence using again the sequence replace call // in order not to trigger a real data copy // // argument : in : - attr_value_4 : The exception to be stored // //-------------------------------------------------------------------------- void PollRing::force_copy_data(Tango::AttributeValueList_4 *attr_value_4) { for (unsigned long loop = 0;loop < attr_value_4->length();loop++) { switch ((*attr_value_4)[loop].value._d()) { case ATT_BOOL: { DevVarBooleanArray &union_seq = (*attr_value_4)[loop].value.bool_att_value(); DevVarBooleanArray tmp_seq(union_seq); union_seq.replace(0,0,NULL,true); unsigned long len = tmp_seq.length(); union_seq.replace(len,len,tmp_seq.get_buffer(true),true); } break; case ATT_SHORT: { DevVarShortArray &union_seq = (*attr_value_4)[loop].value.short_att_value(); DevVarShortArray tmp_seq(union_seq); union_seq.replace(0,0,NULL,true); unsigned long len = tmp_seq.length(); union_seq.replace(len,len,tmp_seq.get_buffer(true),true); } break; case ATT_LONG: { DevVarLongArray &union_seq = (*attr_value_4)[loop].value.long_att_value(); DevVarLongArray tmp_seq(union_seq); union_seq.replace(0,0,NULL,true); unsigned long len = tmp_seq.length(); union_seq.replace(len,len,tmp_seq.get_buffer(true),true); } break; case ATT_LONG64: { DevVarLong64Array &union_seq = (*attr_value_4)[loop].value.long64_att_value(); DevVarLong64Array tmp_seq(union_seq); union_seq.replace(0,0,NULL,true); unsigned long len = tmp_seq.length(); union_seq.replace(len,len,tmp_seq.get_buffer(true),true); } break; case ATT_FLOAT: { DevVarFloatArray &union_seq = (*attr_value_4)[loop].value.float_att_value(); DevVarFloatArray tmp_seq(union_seq); union_seq.replace(0,0,NULL,true); unsigned long len = tmp_seq.length(); union_seq.replace(len,len,tmp_seq.get_buffer(true),true); } break; case ATT_DOUBLE: { DevVarDoubleArray &union_seq = (*attr_value_4)[loop].value.double_att_value(); DevVarDoubleArray tmp_seq(union_seq); union_seq.replace(0,0,NULL,true); unsigned long len = tmp_seq.length(); union_seq.replace(len,len,tmp_seq.get_buffer(true),true); } break; case ATT_UCHAR: { DevVarCharArray &union_seq = (*attr_value_4)[loop].value.uchar_att_value(); DevVarCharArray tmp_seq(union_seq); union_seq.replace(0,0,NULL,true); unsigned long len = tmp_seq.length(); union_seq.replace(len,len,tmp_seq.get_buffer(true),true); } break; case ATT_USHORT: { DevVarUShortArray &union_seq = (*attr_value_4)[loop].value.ushort_att_value(); DevVarUShortArray tmp_seq(union_seq); union_seq.replace(0,0,NULL,true); unsigned long len = tmp_seq.length(); union_seq.replace(len,len,tmp_seq.get_buffer(true),true); } break; case ATT_ULONG: { DevVarULongArray &union_seq = (*attr_value_4)[loop].value.ulong_att_value(); DevVarULongArray tmp_seq(union_seq); union_seq.replace(0,0,NULL,true); unsigned long len = tmp_seq.length(); union_seq.replace(len,len,tmp_seq.get_buffer(true),true); } break; case ATT_ULONG64: { DevVarULong64Array &union_seq = (*attr_value_4)[loop].value.ulong64_att_value(); DevVarULong64Array tmp_seq(union_seq); union_seq.replace(0,0,NULL,true); unsigned long len = tmp_seq.length(); union_seq.replace(len,len,tmp_seq.get_buffer(true),true); } break; case ATT_STRING: { const DevVarStringArray &union_seq = (*attr_value_4)[loop].value.string_att_value(); DevVarStringArray tmp_seq = union_seq; (const_cast(union_seq)).replace(0,0,NULL,true); (*attr_value_4)[loop].value.string_att_value(tmp_seq); } break; case ATT_STATE: { DevVarStateArray &union_seq = (*attr_value_4)[loop].value.state_att_value(); DevVarStateArray tmp_seq(union_seq); union_seq.replace(0,0,NULL,true); unsigned long len = tmp_seq.length(); union_seq.replace(len,len,tmp_seq.get_buffer(true),true); } break; case DEVICE_STATE: case NO_DATA: break; case ATT_ENCODED: { DevVarEncodedArray &union_seq = (*attr_value_4)[loop].value.encoded_att_value(); DevVarEncodedArray tmp_seq(union_seq); union_seq.replace(0,0,NULL,true); union_seq.length(tmp_seq.length()); union_seq[0].encoded_format = CORBA::string_dup(tmp_seq[0].encoded_format); unsigned long nb_data = tmp_seq[0].encoded_data.length(); union_seq[0].encoded_data.replace(nb_data,nb_data,tmp_seq[0].encoded_data.get_buffer(true),true); if (tmp_seq.length() == 2) { union_seq[1].encoded_format = CORBA::string_dup(tmp_seq[1].encoded_format); unsigned long nb_data = tmp_seq[1].encoded_data.length(); union_seq[1].encoded_data.replace(nb_data,nb_data,tmp_seq[1].encoded_data.get_buffer(true),true); } } break; } } } //------------------------------------------------------------------------- // // method : PollRing::insert_except // // description : This method insert a new element in the ring buffer // when this element is an exception // // argument : in : - ex : The exception to be stored // - t : The date // //-------------------------------------------------------------------------- void PollRing::insert_except(Tango::DevFailed *ex,struct timeval &t) { // // Insert data in the ring // delete(ring[insert_elt].except); if (ring[insert_elt].attr_value != NULL) { delete(ring[insert_elt].attr_value); ring[insert_elt].attr_value = NULL; } if (ring[insert_elt].cmd_result != NULL) { delete(ring[insert_elt].cmd_result); ring[insert_elt].cmd_result = NULL; } ring[insert_elt].except = ex; ring[insert_elt].when = t; // // Manage insert and read indexes // inc_indexes(); } //+------------------------------------------------------------------------- // // method : PollRing::inc_indexes // // description : This private method increment the indexes used to acces // the box itself. This is necessary because the box must // be managed as a circular buffer // //-------------------------------------------------------------------------- void PollRing::inc_indexes() { insert_elt++; if (insert_elt == max_elt) insert_elt = 0; if (nb_elt != max_elt) nb_elt++; } //+------------------------------------------------------------------------- // // method : PollRing::get_delta_t // // description : This method computes the delta time between records // in the ring buffer // // argument : in : - nb : The number of delta t to be computed // out : - res : A reference to the vector where result should // be stored // //-------------------------------------------------------------------------- void PollRing::get_delta_t(vector &res,long nb) { // // Throw exception if nothing in ring // if (nb_elt < 2) { Except::throw_exception((const char *)API_PollRingBufferEmpty, (const char *)"Not enough data stored yet in polling ring buffer", (const char *)"PollRing::get_delta_t"); } // // Get the buffer starting point // long read_index,prev_read; if (insert_elt == 0) { read_index = max_elt - 1; prev_read = read_index - 1; } else { read_index = insert_elt - 1; if (read_index == 0) prev_read = max_elt - 1; else prev_read = read_index - 1; } // // Clear the result vector // res.clear(); // // Compute how many delta can be computed // if (nb_elt <= nb) nb = nb_elt - 1; // // The delta t computing loop // long i; for (i = 0;i < nb;i++) { double t_ref = (double)ring[read_index].when.tv_sec + ((double)ring[read_index].when.tv_usec / 1000000); double t_prev = (double)ring[prev_read].when.tv_sec + ((double)ring[prev_read].when.tv_usec / 1000000); res.push_back(t_ref - t_prev); prev_read--; if (prev_read < 0) prev_read = max_elt - 1; read_index--; if (read_index < 0) read_index = max_elt - 1; } } //+------------------------------------------------------------------------- // // method : PollRing::get_last_insert_date // // description : This method returns the date of the last insert in the // ring buffer // //-------------------------------------------------------------------------- struct timeval PollRing::get_last_insert_date() { if (insert_elt == 0) return ring[max_elt - 1].when; else return ring[insert_elt - 1].when; } //+------------------------------------------------------------------------- // // method : PollRing::is_last_an_error // // description : This method returns a boolean set to true if the last // data recorded into the ring buffer was an exception // //-------------------------------------------------------------------------- bool PollRing::is_last_an_error() { if (insert_elt == 0) { if (ring[max_elt - 1].except == NULL) return false; else return true; } else { if (ring[insert_elt - 1].except == NULL) return false; else return true; } } bool PollRing::is_last_cmd_an_error() { if (insert_elt == 0) { if (ring[max_elt - 1].except != NULL) return true; else return false; } else { if (ring[insert_elt - 1].except != NULL) return true; else return false; } } bool PollRing::is_last_attr_an_error() { if (insert_elt == 0) { if (ring[max_elt - 1].except != NULL) return true; else { if (ring[max_elt - 1].attr_value_3 != NULL) { if ((*(ring[max_elt - 1].attr_value_3))[0].err_list.length() != 0) return true; else return false; } else { if ((*(ring[max_elt - 1].attr_value_4))[0].err_list.length() != 0) return true; else return false; } } } else { if (ring[insert_elt - 1].except != NULL) return true; else { if (ring[insert_elt - 1].attr_value_3 != NULL) { if ((*(ring[insert_elt - 1].attr_value_3))[0].err_list.length() != 0) return true; else return false; } else { if ((*(ring[insert_elt - 1].attr_value_4))[0].err_list.length() != 0) return true; else return false; } } } } //+------------------------------------------------------------------------- // // method : PollRing::get_last_except // // description : This method returns the exception recently stored in // the ring buffer. // //-------------------------------------------------------------------------- Tango::DevFailed *PollRing::get_last_except() { if (insert_elt == 0) return ring[max_elt - 1].except; else return ring[insert_elt - 1].except; } //+------------------------------------------------------------------------- // // method : PollRing::get_last_attr_error // // description : This method returns the error stack for polled // attribute belonging to device implementing IDL // release 3 and more. // //-------------------------------------------------------------------------- Tango::DevErrorList &PollRing::get_last_attr_error() { if (insert_elt == 0) { if (ring[max_elt - 1].attr_value_3 != NULL) return (*(ring[max_elt - 1].attr_value_3))[0].err_list; else return (*(ring[max_elt - 1].attr_value_4))[0].err_list; } else { if(ring[insert_elt - 1].attr_value_3 != NULL) return (*(ring[insert_elt - 1].attr_value_3))[0].err_list; else return (*(ring[insert_elt - 1].attr_value_4))[0].err_list; } } //+------------------------------------------------------------------------- // // method : PollRing::get_last_cmd_result // // description : This method returns the exception recently stored in // the ring buffer. // //-------------------------------------------------------------------------- CORBA::Any *PollRing::get_last_cmd_result() { CORBA::Any *tmp_any; if (insert_elt == 0) { if (ring[max_elt - 1].except == NULL) { tmp_any = ring[max_elt - 1].cmd_result; return new CORBA::Any(tmp_any->type(), const_cast(tmp_any->value()), false); } else throw Tango::DevFailed(*(ring[max_elt - 1].except)); } else { if (ring[insert_elt - 1].except == NULL) { tmp_any = ring[insert_elt - 1].cmd_result; return new CORBA::Any(tmp_any->type(), const_cast(tmp_any->value()), false); } else throw Tango::DevFailed(*(ring[insert_elt - 1].except)); } } //+------------------------------------------------------------------------- // // method : PollRing::get_last_attr_value // // description : This method returns the exception recently stored in // the ring buffer. // //-------------------------------------------------------------------------- Tango::AttributeValue &PollRing::get_last_attr_value() { if (insert_elt == 0) { if (ring[max_elt - 1].except == NULL) { return (*(ring[max_elt - 1].attr_value))[0]; } else throw Tango::DevFailed(*(ring[max_elt - 1].except)); } else { if (ring[insert_elt - 1].except == NULL) { return (*(ring[insert_elt - 1].attr_value))[0]; } else throw Tango::DevFailed(*(ring[insert_elt - 1].except)); } } Tango::AttributeValue_3 &PollRing::get_last_attr_value_3() { if (insert_elt == 0) { if (ring[max_elt - 1].except == NULL) { return (*(ring[max_elt - 1].attr_value_3))[0]; } else throw Tango::DevFailed(*(ring[max_elt - 1].except)); } else { if (ring[insert_elt - 1].except == NULL) { return (*(ring[insert_elt - 1].attr_value_3))[0]; } else throw Tango::DevFailed(*(ring[insert_elt - 1].except)); } } Tango::AttributeValue_4 &PollRing::get_last_attr_value_4() { if (insert_elt == 0) { if (ring[max_elt - 1].except == NULL) { return (*(ring[max_elt - 1].attr_value_4))[0]; } else throw Tango::DevFailed(*(ring[max_elt - 1].except)); } else { if (ring[insert_elt - 1].except == NULL) { return (*(ring[insert_elt - 1].attr_value_4))[0]; } else throw Tango::DevFailed(*(ring[insert_elt - 1].except)); } } //------------------------------------------------------------------------- // // method : PollObj::get_cmd_history // // description : This method get command history from the ring buffer // // argument : in : - n : record number // - ptr : Pointer to the sequence where command result // should be stored // //-------------------------------------------------------------------------- void PollRing::get_cmd_history(long n,Tango::DevCmdHistoryList *ptr) { long i; // // Set index to read ring and to initialised returned sequence // In the returned sequence , indice 0 is the oldest data // long index = insert_elt; if (index == 0) index = max_elt; index--; long seq_index = n - 1; // // Read buffer // for (i = 0;i < n;i++) { (*ptr)[seq_index].time.tv_sec = ring[index].when.tv_sec + DELTA_T; (*ptr)[seq_index].time.tv_usec = ring[index].when.tv_usec; (*ptr)[seq_index].time.tv_nsec = 0; if (ring[index].except == NULL) { (*ptr)[seq_index].cmd_failed = false; (*ptr)[seq_index].value = *(ring[index].cmd_result); (*ptr)[seq_index].errors.length(0); } else { (*ptr)[seq_index].cmd_failed = true; (*ptr)[seq_index].errors = ring[index].except->errors; } if (index == 0) index = max_elt; index--; seq_index--; } } void PollRing::get_cmd_history(long n,Tango::DevCmdHistory_4 *ptr,Tango::CmdArgType &cmd_type) { long i; // // Set index to read ring and to initialised returned sequence // In the returned sequence , indice 0 is the oldest data // long index = insert_elt; if (index == 0) index = max_elt; index--; long seq_index = n - 1; const Tango::DevVarCharArray *tmp_uch; const Tango::DevVarShortArray *tmp_sh; const Tango::DevVarLongArray *tmp_lg; const Tango::DevVarFloatArray *tmp_fl; const Tango::DevVarDoubleArray *tmp_db; const Tango::DevVarUShortArray *tmp_ush; const Tango::DevVarULongArray *tmp_ulg; const Tango::DevVarStringArray *tmp_str; const Tango::DevVarBooleanArray *tmp_boo; const Tango::DevVarLong64Array *tmp_lg64; const Tango::DevVarULong64Array *tmp_ulg64; const Tango::DevVarLongStringArray *tmp_lg_str; const Tango::DevVarDoubleStringArray *tmp_db_str; // // Compute the size of the global sequence // We have two cases: // 1 - For simple types where each record has a constant size // 2 - For array types where each record may have different size // long seq_size = 0; long seq_str_size = 0; long seq_number_size = 0; long error_nb = 0; if ((cmd_type <= DEV_STRING) || (cmd_type == DEV_STATE) || (cmd_type == CONST_DEV_STRING) || (cmd_type == DEV_UCHAR) || (cmd_type == DEV_LONG64) || (cmd_type == DEV_ULONG64) || (cmd_type == DEV_ENCODED)) { for (i = 0;i < n;i++) { if (ring[index].except != NULL) error_nb++; if (index == 0) index = max_elt; index--; } seq_size = n - error_nb; } else { for (i = 0;i < n;i++) { if (ring[index].except == NULL) { int data_length = 0; switch(cmd_type) { case DEVVAR_CHARARRAY: (*ring[index].cmd_result) >>= tmp_uch; data_length = tmp_uch->length(); break; case DEVVAR_SHORTARRAY: (*ring[index].cmd_result) >>= tmp_sh; data_length = tmp_sh->length(); break; case DEVVAR_LONGARRAY: (*ring[index].cmd_result) >>= tmp_lg; data_length = tmp_lg->length(); break; case DEVVAR_FLOATARRAY: (*ring[index].cmd_result) >>= tmp_fl; data_length = tmp_fl->length(); break; case DEVVAR_DOUBLEARRAY: (*ring[index].cmd_result) >>= tmp_db; data_length = tmp_db->length(); break; case DEVVAR_USHORTARRAY: (*ring[index].cmd_result) >>= tmp_ush; data_length = tmp_ush->length(); break; case DEVVAR_ULONGARRAY: (*ring[index].cmd_result) >>= tmp_ulg; data_length = tmp_ulg->length(); break; case DEVVAR_STRINGARRAY: (*ring[index].cmd_result) >>= tmp_str; data_length = tmp_str->length(); break; case DEVVAR_BOOLEANARRAY: (*ring[index].cmd_result) >>= tmp_boo; data_length = tmp_boo->length(); break; case DEVVAR_LONG64ARRAY: (*ring[index].cmd_result) >>= tmp_lg64; data_length = tmp_lg64->length(); break; case DEVVAR_ULONG64ARRAY: (*ring[index].cmd_result) >>= tmp_ulg64; data_length = tmp_ulg64->length(); break; case DEVVAR_LONGSTRINGARRAY: (*ring[index].cmd_result) >>= tmp_lg_str; seq_str_size = seq_str_size + tmp_lg_str->svalue.length(); seq_number_size = seq_number_size + tmp_lg_str->lvalue.length(); break; case DEVVAR_DOUBLESTRINGARRAY: (*ring[index].cmd_result) >>= tmp_db_str; seq_str_size = seq_str_size + tmp_db_str->svalue.length(); seq_number_size = seq_number_size + tmp_db_str->dvalue.length(); break; default: break; } seq_size = seq_size + data_length; } else error_nb++; if (index == 0) index = max_elt; index--; } } // // First, copy command output data type // ptr->cmd_type = cmd_type; // // Read buffer // Tango::DevVarCharArray *new_tmp_uch = NULL; Tango::DevVarShortArray *new_tmp_sh = NULL; Tango::DevVarLongArray *new_tmp_lg = NULL; Tango::DevVarFloatArray *new_tmp_fl = NULL; Tango::DevVarDoubleArray *new_tmp_db = NULL; Tango::DevVarUShortArray *new_tmp_ush = NULL; Tango::DevVarULongArray *new_tmp_ulg = NULL; Tango::DevVarStringArray *new_tmp_str = NULL; Tango::DevVarBooleanArray *new_tmp_boo = NULL; Tango::DevVarLong64Array *new_tmp_lg64 = NULL; Tango::DevVarULong64Array *new_tmp_ulg64 = NULL; Tango::DevVarLongStringArray *new_tmp_lg_str = NULL; Tango::DevVarDoubleStringArray *new_tmp_db_str = NULL; Tango::DevVarEncodedArray *new_tmp_enc = NULL; Tango::DevShort sh; Tango::DevBoolean boo; Tango::DevLong lg; Tango::DevLong64 lg64; Tango::DevFloat fl; Tango::DevDouble db; Tango::DevUShort ush; Tango::DevULong ulg; Tango::DevULong64 ulg64; Tango::ConstDevString str; const Tango::DevEncoded *enc; DevErrorList last_err_list; int errors_length = 1; AttributeDim last_dim; int dims_length = 1; last_dim.dim_x = -1; last_dim.dim_y = -1; bool previous_no_data = true; bool no_data = true; unsigned int ind_in_seq = 0; unsigned int ind_str_in_seq = 0; unsigned int ind_num_in_seq = 0; index = insert_elt; if (index == 0) index = max_elt; index--; for (i = 0;i < n;i++) { previous_no_data = no_data; no_data = false; // // Copy dates // ptr->dates[seq_index].tv_sec = ring[index].when.tv_sec + DELTA_T; ptr->dates[seq_index].tv_usec = ring[index].when.tv_usec; ptr->dates[seq_index].tv_nsec = 0; // // Error treatement // if (ring[index].except != NULL) { bool new_err = false; if (previous_no_data == true) { if (ring[index].except->errors.length() != last_err_list.length()) new_err = true; else { for (unsigned int k = 0;k < last_err_list.length();k++) { if (::strcmp(ring[index].except->errors[k].reason.in(),last_err_list[k].reason.in()) != 0) { new_err = true; break; } if (::strcmp(ring[index].except->errors[k].desc.in(),last_err_list[k].desc.in()) != 0) { new_err = true; break; } if (::strcmp(ring[index].except->errors[k].origin.in(),last_err_list[k].origin.in()) != 0) { new_err = true; break; } if (ring[index].except->errors[k].severity != last_err_list[k].severity) { new_err = true; break; } } } } else new_err = true; if (new_err == true) { if (ptr->errors.length() == 0) ptr->errors.length(error_nb); if (ptr->errors_array.length() == 0) ptr->errors_array.length(error_nb); last_err_list = ring[index].except->errors; ptr->errors[errors_length - 1] = last_err_list; ptr->errors_array[errors_length - 1].start = n - (i + 1); ptr->errors_array[errors_length - 1].nb_elt = 1; errors_length++; previous_no_data = no_data; no_data = true; } else { ptr->errors_array[errors_length - 2].nb_elt++; previous_no_data = no_data; no_data = true; } if ((last_dim.dim_x == 0) && (last_dim.dim_y == 0)) { ptr->dims_array[dims_length - 2].nb_elt++; } else { last_dim.dim_x = last_dim.dim_y = 0; ptr->dims.length(dims_length); ptr->dims[dims_length - 1] = last_dim; ptr->dims_array.length(dims_length); ptr->dims_array[dims_length - 1].start = n - (i + 1); ptr->dims_array[dims_length - 1].nb_elt = 1; dims_length++; } } // // The data // if (ring[index].except == NULL) { switch(cmd_type) { case DEVVAR_CHARARRAY: if (new_tmp_uch == NULL) { new_tmp_uch = new DevVarCharArray(); new_tmp_uch->length(seq_size); } (*ring[index].cmd_result) >>= tmp_uch; ADD_ELT_DATA_TO_GLOBAL_SEQ(new_tmp_uch,tmp_uch,ind_in_seq); MANAGE_DIM_ARRAY((long)tmp_uch->length()); break; case DEV_SHORT: if (new_tmp_sh == NULL) { new_tmp_sh = new DevVarShortArray(); new_tmp_sh->length(seq_size); } (*ring[index].cmd_result) >>= sh; ADD_SIMPLE_DATA_TO_GLOBAL_SEQ(new_tmp_sh,sh,ind_in_seq); MANAGE_DIM_SIMPLE(); break; case DEVVAR_SHORTARRAY: if (new_tmp_sh == NULL) { new_tmp_sh = new DevVarShortArray(); new_tmp_sh->length(seq_size); } (*ring[index].cmd_result) >>= tmp_sh; ADD_ELT_DATA_TO_GLOBAL_SEQ(new_tmp_sh,tmp_sh,ind_in_seq); MANAGE_DIM_ARRAY((long)tmp_sh->length()); break; case DEV_LONG: if (new_tmp_lg == NULL) { new_tmp_lg = new DevVarLongArray(); new_tmp_lg->length(seq_size); } (*ring[index].cmd_result) >>= lg; ADD_SIMPLE_DATA_TO_GLOBAL_SEQ(new_tmp_lg,lg,ind_in_seq); MANAGE_DIM_SIMPLE(); break; case DEVVAR_LONGARRAY: if (new_tmp_lg == NULL) { new_tmp_lg = new DevVarLongArray(); new_tmp_lg->length(seq_size); } (*ring[index].cmd_result) >>= tmp_lg; ADD_ELT_DATA_TO_GLOBAL_SEQ(new_tmp_lg,tmp_lg,ind_in_seq); MANAGE_DIM_ARRAY((long)tmp_lg->length()); break; case DEV_FLOAT: if (new_tmp_fl == NULL) { new_tmp_fl = new DevVarFloatArray(); new_tmp_fl->length(seq_size); } (*ring[index].cmd_result) >>= fl; ADD_SIMPLE_DATA_TO_GLOBAL_SEQ(new_tmp_fl,fl,ind_in_seq); MANAGE_DIM_SIMPLE(); break; case DEVVAR_FLOATARRAY: if (new_tmp_fl == NULL) { new_tmp_fl = new DevVarFloatArray(); new_tmp_fl->length(seq_size); } (*ring[index].cmd_result) >>= tmp_fl; ADD_ELT_DATA_TO_GLOBAL_SEQ(new_tmp_fl,tmp_fl,ind_in_seq); MANAGE_DIM_ARRAY((long)tmp_fl->length()); break; case DEV_DOUBLE: if (new_tmp_db == NULL) { new_tmp_db = new DevVarDoubleArray(); new_tmp_db->length(seq_size); } (*ring[index].cmd_result) >>= db; ADD_SIMPLE_DATA_TO_GLOBAL_SEQ(new_tmp_db,db,ind_in_seq); MANAGE_DIM_SIMPLE(); break; case DEVVAR_DOUBLEARRAY: if (new_tmp_db == NULL) { new_tmp_db = new DevVarDoubleArray(); new_tmp_db->length(seq_size); } (*ring[index].cmd_result) >>= tmp_db; ADD_ELT_DATA_TO_GLOBAL_SEQ(new_tmp_db,tmp_db,ind_in_seq); MANAGE_DIM_ARRAY((long)tmp_db->length()); break; case DEV_USHORT: if (new_tmp_ush == NULL) { new_tmp_ush = new DevVarUShortArray(); new_tmp_ush->length(seq_size); } (*ring[index].cmd_result) >>= ush; ADD_SIMPLE_DATA_TO_GLOBAL_SEQ(new_tmp_ush,ush,ind_in_seq); MANAGE_DIM_SIMPLE(); break; case DEVVAR_USHORTARRAY: if (new_tmp_ush == NULL) { new_tmp_ush = new DevVarUShortArray(); new_tmp_ush->length(seq_size); } (*ring[index].cmd_result) >>= tmp_ush; ADD_ELT_DATA_TO_GLOBAL_SEQ(new_tmp_ush,tmp_ush,ind_in_seq); MANAGE_DIM_ARRAY((long)tmp_ush->length()); break; case DEV_ULONG: if (new_tmp_ulg == NULL) { new_tmp_ulg = new DevVarULongArray(); new_tmp_ulg->length(seq_size); } (*ring[index].cmd_result) >>= ulg; ADD_SIMPLE_DATA_TO_GLOBAL_SEQ(new_tmp_ulg,ulg,ind_in_seq); MANAGE_DIM_SIMPLE(); break; case DEVVAR_ULONGARRAY: if (new_tmp_ulg == NULL) { new_tmp_ulg = new DevVarULongArray(); new_tmp_ulg->length(seq_size); } (*ring[index].cmd_result) >>= tmp_ulg; ADD_ELT_DATA_TO_GLOBAL_SEQ(new_tmp_ulg,tmp_ulg,ind_in_seq); MANAGE_DIM_ARRAY((long)tmp_ulg->length()); break; case DEV_STRING: if (new_tmp_str == NULL) { new_tmp_str = new DevVarStringArray(); new_tmp_str->length(seq_size); } (*ring[index].cmd_result) >>= str; ADD_SIMPLE_DATA_TO_GLOBAL_SEQ(new_tmp_str,str,ind_in_seq); MANAGE_DIM_SIMPLE(); break; case DEVVAR_STRINGARRAY: if (new_tmp_str == NULL) { new_tmp_str = new DevVarStringArray(); new_tmp_str->length(seq_size); } (*ring[index].cmd_result) >>= tmp_str; ADD_ELT_DATA_TO_GLOBAL_SEQ(new_tmp_str,tmp_str,ind_in_seq); MANAGE_DIM_ARRAY((long)tmp_str->length()); break; case DEV_BOOLEAN: if (new_tmp_boo == NULL) { new_tmp_boo = new DevVarBooleanArray(); new_tmp_boo->length(seq_size); } (*ring[index].cmd_result) >>= boo; ADD_SIMPLE_DATA_TO_GLOBAL_SEQ(new_tmp_boo,boo,ind_in_seq); MANAGE_DIM_SIMPLE(); break; case DEVVAR_BOOLEANARRAY: if (new_tmp_boo == NULL) { new_tmp_boo = new DevVarBooleanArray(); new_tmp_boo->length(seq_size); } (*ring[index].cmd_result) >>= tmp_boo; ADD_ELT_DATA_TO_GLOBAL_SEQ(new_tmp_boo,tmp_boo,ind_in_seq); MANAGE_DIM_ARRAY((long)tmp_boo->length()); break; case DEV_LONG64: if (new_tmp_lg64 == NULL) { new_tmp_lg64 = new DevVarLong64Array(); new_tmp_lg64->length(seq_size); } (*ring[index].cmd_result) >>= lg64; ADD_SIMPLE_DATA_TO_GLOBAL_SEQ(new_tmp_lg64,lg64,ind_in_seq); MANAGE_DIM_SIMPLE(); break; case DEVVAR_LONG64ARRAY: if (new_tmp_lg64 == NULL) { new_tmp_lg64 = new DevVarLong64Array(); new_tmp_lg64->length(seq_size); } (*ring[index].cmd_result) >>= tmp_lg64; ADD_ELT_DATA_TO_GLOBAL_SEQ(new_tmp_lg64,tmp_lg64,ind_in_seq); MANAGE_DIM_ARRAY((long)tmp_lg64->length()); break; case DEV_ULONG64: if (new_tmp_ulg64 == NULL) { new_tmp_ulg64 = new DevVarULong64Array(); new_tmp_ulg64->length(seq_size); } (*ring[index].cmd_result) >>= ulg64; ADD_SIMPLE_DATA_TO_GLOBAL_SEQ(new_tmp_ulg64,ulg64,ind_in_seq); MANAGE_DIM_SIMPLE(); break; case DEVVAR_ULONG64ARRAY: if (new_tmp_ulg64 == NULL) { new_tmp_ulg64 = new DevVarULong64Array(); new_tmp_ulg64->length(seq_size); } (*ring[index].cmd_result) >>= tmp_ulg64; ADD_ELT_DATA_TO_GLOBAL_SEQ(new_tmp_ulg64,tmp_ulg64,ind_in_seq); MANAGE_DIM_ARRAY((long)tmp_ulg64->length()); break; case DEVVAR_LONGSTRINGARRAY: if (new_tmp_lg_str == NULL) { new_tmp_lg_str = new DevVarLongStringArray(); new_tmp_lg_str->svalue.length(seq_str_size); new_tmp_lg_str->lvalue.length(seq_number_size); } (*ring[index].cmd_result) >>= tmp_lg_str; ADD_ELT_DATA_TO_GLOBAL_SEQ_BY_REF(new_tmp_lg_str->svalue,tmp_lg_str->svalue,ind_str_in_seq); ADD_ELT_DATA_TO_GLOBAL_SEQ_BY_REF(new_tmp_lg_str->lvalue,tmp_lg_str->lvalue,ind_num_in_seq); MANAGE_DIM_ARRAY_SEQ((long)tmp_lg_str->svalue.length(),(long)tmp_lg_str->lvalue.length()); break; case DEVVAR_DOUBLESTRINGARRAY: if (new_tmp_db_str == NULL) { new_tmp_db_str = new DevVarDoubleStringArray(); new_tmp_db_str->svalue.length(seq_str_size); new_tmp_db_str->dvalue.length(seq_number_size); } (*ring[index].cmd_result) >>= tmp_db_str; ADD_ELT_DATA_TO_GLOBAL_SEQ_BY_REF(new_tmp_db_str->svalue,tmp_db_str->svalue,ind_str_in_seq); ADD_ELT_DATA_TO_GLOBAL_SEQ_BY_REF(new_tmp_db_str->dvalue,tmp_db_str->dvalue,ind_num_in_seq); MANAGE_DIM_ARRAY_SEQ((long)tmp_db_str->svalue.length(),(long)tmp_db_str->dvalue.length()); break; case DEV_ENCODED: if (new_tmp_enc == NULL) { new_tmp_enc = new DevVarEncodedArray(); new_tmp_enc->length(seq_size); } (*ring[index].cmd_result) >>= enc; { unsigned int buffer_data_length = enc->encoded_data.length(); Tango::DevVarCharArray &tmp_buffer = (*new_tmp_enc)[ind_in_seq].encoded_data; tmp_buffer.length(buffer_data_length); for (unsigned int k = 0;k < buffer_data_length;k++) tmp_buffer[k] = enc->encoded_data[k]; (*new_tmp_enc)[ind_in_seq].encoded_format = CORBA::string_dup(enc->encoded_format); ind_in_seq = ind_in_seq + 1; } MANAGE_DIM_SIMPLE(); break; default: break; } } // // If it is the last point, insert the global sequence into the Any // if (i == (n - 1)) { if (errors_length != (error_nb + 1)) { ptr->errors.length(errors_length - 1); ptr->errors_array.length(errors_length - 1); } switch(cmd_type) { case Tango::DEVVAR_CHARARRAY: if (new_tmp_uch != NULL) ptr->value <<= new_tmp_uch; break; case Tango::DEVVAR_SHORTARRAY: case Tango::DEV_SHORT: if (new_tmp_sh != NULL) ptr->value <<= new_tmp_sh; break; case Tango::DEVVAR_LONGARRAY: case Tango::DEV_LONG: if (new_tmp_lg != NULL) ptr->value <<= new_tmp_lg; break; case Tango::DEVVAR_FLOATARRAY: case Tango::DEV_FLOAT: if (new_tmp_fl != NULL) ptr->value <<= new_tmp_fl; break; case Tango::DEVVAR_DOUBLEARRAY: case Tango::DEV_DOUBLE: if (new_tmp_db != NULL) ptr->value <<= new_tmp_db; break; case Tango::DEVVAR_USHORTARRAY: case Tango::DEV_USHORT: if (new_tmp_db != NULL) ptr->value <<= new_tmp_db; break; case Tango::DEVVAR_ULONGARRAY: case Tango::DEV_ULONG: if (new_tmp_db != NULL) ptr->value <<= new_tmp_db; break; case Tango::DEVVAR_STRINGARRAY: case Tango::DEV_STRING: if (new_tmp_str != NULL) ptr->value <<= new_tmp_str; break; case Tango::DEVVAR_BOOLEANARRAY: case Tango::DEV_BOOLEAN: if (new_tmp_boo != NULL) ptr->value <<= new_tmp_boo; break; case Tango::DEVVAR_LONG64ARRAY: case Tango::DEV_LONG64: if (new_tmp_lg64 != NULL) ptr->value <<= new_tmp_lg64; break; case Tango::DEVVAR_ULONG64ARRAY: case Tango::DEV_ULONG64: if (new_tmp_ulg64 != NULL) ptr->value <<= new_tmp_ulg64; break; case Tango::DEVVAR_LONGSTRINGARRAY: if (new_tmp_lg_str != NULL) ptr->value <<= new_tmp_lg_str; break; case Tango::DEVVAR_DOUBLESTRINGARRAY: if (new_tmp_db_str != NULL) ptr->value <<= new_tmp_db_str; break; case Tango::DEV_ENCODED: if (new_tmp_enc != NULL) ptr->value <<= new_tmp_enc; break; default: break; } } // // Manage index in buffer // if (index == 0) index = max_elt; index--; seq_index--; } } //------------------------------------------------------------------------- // // method : PollObj::get_attr_history // // description : This method get attribute history from the ring buffer // // argument : in : - n : record number // - ptr : Pointer to the sequence where attribute result // should be stored // - type : The attribute data type // //-------------------------------------------------------------------------- void PollRing::get_attr_history(long n,Tango::DevAttrHistoryList *ptr,long type) { long i; // // Set index to read ring and to initialised returned sequence // In the returned sequence , indice 0 is the oldest data // long index = insert_elt; if (index == 0) index = max_elt; index--; long seq_index = n - 1; // // Read buffer // for (i = 0;i < n;i++) { (*ptr)[seq_index].value.time.tv_sec = ring[index].when.tv_sec + DELTA_T; (*ptr)[seq_index].value.time.tv_usec = ring[index].when.tv_usec; (*ptr)[seq_index].value.time.tv_nsec = 0; if (ring[index].except == NULL) { (*ptr)[seq_index].attr_failed = false; (*ptr)[seq_index].value.quality = (*ring[index].attr_value)[0].quality; (*ptr)[seq_index].value.dim_x = (*ring[index].attr_value)[0].dim_x; (*ptr)[seq_index].value.dim_y = (*ring[index].attr_value)[0].dim_y; (*ptr)[seq_index].value.name = CORBA::string_dup((*ring[index].attr_value)[0].name); if ((*ptr)[seq_index].value.quality != Tango::ATTR_INVALID) { const Tango::DevVarDoubleArray *tmp_db; Tango::DevVarDoubleArray *new_tmp_db; const Tango::DevVarShortArray *tmp_sh; Tango::DevVarShortArray *new_tmp_sh; const Tango::DevVarLongArray *tmp_lg; Tango::DevVarLongArray *new_tmp_lg; const Tango::DevVarLong64Array *tmp_lg64; Tango::DevVarLong64Array *new_tmp_lg64; const Tango::DevVarStringArray *tmp_str; Tango::DevVarStringArray *new_tmp_str; const Tango::DevVarFloatArray *tmp_fl; Tango::DevVarFloatArray *new_tmp_fl; const Tango::DevVarBooleanArray *tmp_boo; Tango::DevVarBooleanArray *new_tmp_boo; const Tango::DevVarUShortArray *tmp_ush; Tango::DevVarUShortArray *new_tmp_ush; const Tango::DevVarCharArray *tmp_uch; Tango::DevVarCharArray *new_tmp_uch; const Tango::DevVarULongArray *tmp_ulg; Tango::DevVarULongArray *new_tmp_ulg; const Tango::DevVarULong64Array *tmp_ulg64; Tango::DevVarULong64Array *new_tmp_ulg64; const Tango::DevVarStateArray *tmp_state; Tango::DevVarStateArray *new_tmp_state; switch (type) { case Tango::DEV_SHORT : (*ring[index].attr_value)[0].value >>= tmp_sh; new_tmp_sh = new DevVarShortArray( tmp_sh->length(), tmp_sh->length(), const_cast(tmp_sh->get_buffer()), false); (*ptr)[seq_index].value.value <<= new_tmp_sh; break; case Tango::DEV_DOUBLE : (*ring[index].attr_value)[0].value >>= tmp_db; new_tmp_db = new DevVarDoubleArray( tmp_db->length(), tmp_db->length(), const_cast(tmp_db->get_buffer()), false); (*ptr)[seq_index].value.value <<= new_tmp_db; break; case Tango::DEV_LONG : (*ring[index].attr_value)[0].value >>= tmp_lg; new_tmp_lg = new DevVarLongArray(tmp_lg->length(),tmp_lg->length(), const_cast(tmp_lg->get_buffer()),false); (*ptr)[seq_index].value.value <<= new_tmp_lg; break; case Tango::DEV_LONG64 : (*ring[index].attr_value)[0].value >>= tmp_lg64; new_tmp_lg64 = new DevVarLong64Array(tmp_lg64->length(),tmp_lg64->length(), const_cast(tmp_lg64->get_buffer()),false); (*ptr)[seq_index].value.value <<= new_tmp_lg64; break; case Tango::DEV_STRING : (*ring[index].attr_value)[0].value >>= tmp_str; new_tmp_str = new DevVarStringArray( tmp_str->length(), tmp_str->length(), const_cast(tmp_str->get_buffer()), false); (*ptr)[seq_index].value.value <<= new_tmp_str; break; case Tango::DEV_FLOAT : (*ring[index].attr_value)[0].value >>= tmp_fl; new_tmp_fl = new DevVarFloatArray( tmp_fl->length(), tmp_fl->length(), const_cast(tmp_fl->get_buffer()), false); (*ptr)[seq_index].value.value <<= new_tmp_fl; break; case Tango::DEV_BOOLEAN : (*ring[index].attr_value)[0].value >>= tmp_boo; new_tmp_boo = new DevVarBooleanArray( tmp_boo->length(), tmp_boo->length(), const_cast(tmp_boo->get_buffer()), false); (*ptr)[seq_index].value.value <<= new_tmp_boo; break; case Tango::DEV_USHORT : (*ring[index].attr_value)[0].value >>= tmp_ush; new_tmp_ush = new DevVarUShortArray( tmp_ush->length(), tmp_ush->length(), const_cast(tmp_ush->get_buffer()), false); (*ptr)[seq_index].value.value <<= new_tmp_ush; break; case Tango::DEV_UCHAR : (*ring[index].attr_value)[0].value >>= tmp_uch; new_tmp_uch = new DevVarCharArray( tmp_uch->length(), tmp_uch->length(), const_cast(tmp_uch->get_buffer()), false); (*ptr)[seq_index].value.value <<= new_tmp_uch; break; case Tango::DEV_ULONG : (*ring[index].attr_value)[0].value >>= tmp_ulg; new_tmp_ulg = new DevVarULongArray(tmp_ulg->length(),tmp_ulg->length(), const_cast(tmp_ulg->get_buffer()),false); (*ptr)[seq_index].value.value <<= new_tmp_ulg; break; case Tango::DEV_ULONG64 : (*ring[index].attr_value)[0].value >>= tmp_ulg64; new_tmp_ulg64 = new DevVarULong64Array(tmp_ulg64->length(),tmp_ulg64->length(), const_cast(tmp_ulg64->get_buffer()),false); (*ptr)[seq_index].value.value <<= new_tmp_ulg64; break; case Tango::DEV_STATE : (*ring[index].attr_value)[0].value >>= tmp_state; new_tmp_state = new DevVarStateArray(tmp_state->length(),tmp_state->length(), const_cast(tmp_state->get_buffer()),false); (*ptr)[seq_index].value.value <<= new_tmp_state; break; } } (*ptr)[seq_index].errors.length(0); } else { (*ptr)[seq_index].attr_failed = true; (*ptr)[seq_index].errors = ring[index].except->errors; (*ptr)[seq_index].value.quality = Tango::ATTR_INVALID; (*ptr)[seq_index].value.dim_x = 0; (*ptr)[seq_index].value.dim_y = 0; } if (index == 0) index = max_elt; index--; seq_index--; } } void PollRing::get_attr_history(long n,Tango::DevAttrHistoryList_3 *ptr,long type) { long i; // // Set index to read ring and to initialised returned sequence // In the returned sequence , indice 0 is the oldest data // long index = insert_elt; if (index == 0) index = max_elt; index--; long seq_index = n - 1; // // Read buffer // for (i = 0;i < n;i++) { (*ptr)[seq_index].value.time.tv_sec = ring[index].when.tv_sec + DELTA_T; (*ptr)[seq_index].value.time.tv_usec = ring[index].when.tv_usec; (*ptr)[seq_index].value.time.tv_nsec = 0; if (ring[index].except == NULL) { (*ptr)[seq_index].value.err_list = (*ring[index].attr_value_3)[0].err_list; (*ptr)[seq_index].value.quality = (*ring[index].attr_value_3)[0].quality; (*ptr)[seq_index].value.r_dim = (*ring[index].attr_value_3)[0].r_dim; (*ptr)[seq_index].value.w_dim = (*ring[index].attr_value_3)[0].w_dim; (*ptr)[seq_index].value.name = CORBA::string_dup((*ring[index].attr_value_3)[0].name); (*ptr)[seq_index].attr_failed = false; if ((*ptr)[seq_index].value.quality != Tango::ATTR_INVALID) { const Tango::DevVarDoubleArray *tmp_db; Tango::DevVarDoubleArray *new_tmp_db; const Tango::DevVarShortArray *tmp_sh; Tango::DevVarShortArray *new_tmp_sh; const Tango::DevVarLongArray *tmp_lg; Tango::DevVarLongArray *new_tmp_lg; const Tango::DevVarLong64Array *tmp_lg64; Tango::DevVarLong64Array *new_tmp_lg64; const Tango::DevVarStringArray *tmp_str; Tango::DevVarStringArray *new_tmp_str; const Tango::DevVarFloatArray *tmp_fl; Tango::DevVarFloatArray *new_tmp_fl; const Tango::DevVarBooleanArray *tmp_boo; Tango::DevVarBooleanArray *new_tmp_boo; const Tango::DevVarUShortArray *tmp_ush; Tango::DevVarUShortArray *new_tmp_ush; const Tango::DevVarCharArray *tmp_uch; Tango::DevVarCharArray *new_tmp_uch; const Tango::DevVarULongArray *tmp_ulg; Tango::DevVarULongArray *new_tmp_ulg; const Tango::DevVarULong64Array *tmp_ulg64; Tango::DevVarULong64Array *new_tmp_ulg64; const Tango::DevVarStateArray *tmp_state; Tango::DevVarStateArray *new_tmp_state; switch (type) { case Tango::DEV_SHORT : (*ring[index].attr_value_3)[0].value >>= tmp_sh; new_tmp_sh = new DevVarShortArray( tmp_sh->length(), tmp_sh->length(), const_cast(tmp_sh->get_buffer()), false); (*ptr)[seq_index].value.value <<= new_tmp_sh; break; case Tango::DEV_DOUBLE : (*ring[index].attr_value_3)[0].value >>= tmp_db; new_tmp_db = new DevVarDoubleArray( tmp_db->length(), tmp_db->length(), const_cast(tmp_db->get_buffer()), false); (*ptr)[seq_index].value.value <<= new_tmp_db; break; case Tango::DEV_LONG : (*ring[index].attr_value_3)[0].value >>= tmp_lg; new_tmp_lg = new DevVarLongArray(tmp_lg->length(),tmp_lg->length(), const_cast(tmp_lg->get_buffer()),false); (*ptr)[seq_index].value.value <<= new_tmp_lg; break; case Tango::DEV_LONG64 : (*ring[index].attr_value_3)[0].value >>= tmp_lg64; new_tmp_lg64 = new DevVarLong64Array(tmp_lg64->length(),tmp_lg64->length(), const_cast(tmp_lg64->get_buffer()),false); (*ptr)[seq_index].value.value <<= new_tmp_lg64; break; case Tango::DEV_STRING : (*ring[index].attr_value_3)[0].value >>= tmp_str; new_tmp_str = new DevVarStringArray( tmp_str->length(), tmp_str->length(), const_cast(tmp_str->get_buffer()), false); (*ptr)[seq_index].value.value <<= new_tmp_str; break; case Tango::DEV_FLOAT : (*ring[index].attr_value_3)[0].value >>= tmp_fl; new_tmp_fl = new DevVarFloatArray( tmp_fl->length(), tmp_fl->length(), const_cast(tmp_fl->get_buffer()), false); (*ptr)[seq_index].value.value <<= new_tmp_fl; break; case Tango::DEV_BOOLEAN : (*ring[index].attr_value_3)[0].value >>= tmp_boo; new_tmp_boo = new DevVarBooleanArray( tmp_boo->length(), tmp_boo->length(), const_cast(tmp_boo->get_buffer()), false); (*ptr)[seq_index].value.value <<= new_tmp_boo; break; case Tango::DEV_USHORT : (*ring[index].attr_value_3)[0].value >>= tmp_ush; new_tmp_ush = new DevVarUShortArray( tmp_ush->length(), tmp_ush->length(), const_cast(tmp_ush->get_buffer()), false); (*ptr)[seq_index].value.value <<= new_tmp_ush; break; case Tango::DEV_UCHAR : (*ring[index].attr_value_3)[0].value >>= tmp_uch; new_tmp_uch = new DevVarCharArray( tmp_uch->length(), tmp_uch->length(), const_cast(tmp_uch->get_buffer()), false); (*ptr)[seq_index].value.value <<= new_tmp_uch; break; case Tango::DEV_ULONG : (*ring[index].attr_value_3)[0].value >>= tmp_ulg; new_tmp_ulg = new DevVarULongArray(tmp_ulg->length(),tmp_ulg->length(), const_cast(tmp_ulg->get_buffer()),false); (*ptr)[seq_index].value.value <<= new_tmp_ulg; break; case Tango::DEV_ULONG64 : (*ring[index].attr_value_3)[0].value >>= tmp_ulg64; new_tmp_ulg64 = new DevVarULong64Array(tmp_ulg64->length(),tmp_ulg64->length(), const_cast(tmp_ulg64->get_buffer()),false); (*ptr)[seq_index].value.value <<= new_tmp_ulg64; break; case Tango::DEV_STATE : { CORBA::TypeCode_var ty; ty = (*ring[index].attr_value_3)[0].value.type(); if (ty->kind() == CORBA::tk_enum) { Tango::DevState tmp_ds; (*ring[index].attr_value_3)[0].value >>= tmp_ds; (*ptr)[seq_index].value.value <<= tmp_ds; } else { (*ring[index].attr_value_3)[0].value >>= tmp_state; new_tmp_state = new DevVarStateArray(tmp_state->length(),tmp_state->length(), const_cast(tmp_state->get_buffer()),false); (*ptr)[seq_index].value.value <<= new_tmp_state; } break; } } } } else { (*ptr)[seq_index].attr_failed = true; (*ptr)[seq_index].value.err_list = ring[index].except->errors; (*ptr)[seq_index].value.quality = Tango::ATTR_INVALID; clear_att_dim((*ptr)[seq_index].value); } if (index == 0) index = max_elt; index--; seq_index--; } } void PollRing::get_attr_history(long n,Tango::DevAttrHistory_4 *ptr,long type) { long i; // // Set index to read ring and to initialised returned sequence // In the returned sequence , indice 0 is the oldest data // long index = insert_elt; if (index == 0) index = max_elt; index--; long seq_index = n - 1; // // Compute the size of the global sequence and the error numbers // long seq_size = 0; long error_nb = 0; for (i = 0;i < n;i++) { if (ring[index].except == NULL) { int r_dim_x = (*ring[index].attr_value_4)[0].r_dim.dim_x; int r_dim_y = (*ring[index].attr_value_4)[0].r_dim.dim_y; int w_dim_x = (*ring[index].attr_value_4)[0].w_dim.dim_x; int w_dim_y = (*ring[index].attr_value_4)[0].w_dim.dim_y; int data_length; (r_dim_y == 0) ? data_length = r_dim_x : data_length = r_dim_x * r_dim_y; (w_dim_y == 0) ? data_length += w_dim_x : data_length += (w_dim_x * w_dim_y); seq_size = seq_size + data_length; } else error_nb++; if (index == 0) index = max_elt; index--; } // // Now, we need to build the data transfer structure // AttrQuality last_quality; int quals_length = 1; AttributeDim last_dim_read; int read_dims_length = 1; AttributeDim last_dim_write; int write_dims_length = 1; DevErrorList last_err_list; int errors_length = 1; last_dim_read.dim_x = -1; last_dim_read.dim_y = -1; last_dim_write.dim_x = -1; last_dim_write.dim_y = -1; unsigned int ind_in_seq = 0; Tango::DevVarDoubleArray *new_tmp_db = NULL; Tango::DevVarShortArray *new_tmp_sh = NULL; Tango::DevVarLongArray *new_tmp_lg = NULL; Tango::DevVarLong64Array *new_tmp_lg64 = NULL; Tango::DevVarStringArray *new_tmp_str = NULL; Tango::DevVarFloatArray *new_tmp_fl = NULL; Tango::DevVarBooleanArray *new_tmp_boo = NULL; Tango::DevVarUShortArray *new_tmp_ush = NULL; Tango::DevVarCharArray *new_tmp_uch = NULL; Tango::DevVarULongArray *new_tmp_ulg = NULL; Tango::DevVarULong64Array *new_tmp_ulg64 = NULL; Tango::DevVarStateArray *new_tmp_state = NULL; Tango::DevVarEncodedArray *new_tmp_enc = NULL; // // Read buffer // bool previous_no_data = true; bool no_data = true; last_quality = Tango::ATTR_VALID; index = insert_elt; if (index == 0) index = max_elt; index--; for (i = 0;i < n;i++) { previous_no_data = no_data; no_data = false; // // Copy date in output structure // ptr->dates[seq_index].tv_sec = ring[index].when.tv_sec + DELTA_T; ptr->dates[seq_index].tv_usec = ring[index].when.tv_usec; ptr->dates[seq_index].tv_nsec = 0; // // Copy element only if they are different than the previous one // First, for quality factor // if (ring[index].except == NULL) { if ((quals_length == 1) || ((*ring[index].attr_value_4)[0].quality != last_quality)) { last_quality = (*ring[index].attr_value_4)[0].quality; ptr->quals.length(quals_length); ptr->quals[quals_length - 1] = last_quality; ptr->quals_array.length(quals_length); ptr->quals_array[quals_length - 1].start = n - (i + 1); ptr->quals_array[quals_length - 1].nb_elt = 1; quals_length++; if (last_quality == Tango::ATTR_INVALID) { previous_no_data = no_data; no_data = true; } } else { ptr->quals_array[quals_length - 2].nb_elt++; if (last_quality == Tango::ATTR_INVALID) { previous_no_data = no_data; no_data = true; } } // // The read dimension // if (((*ring[index].attr_value_4)[0].r_dim.dim_x == last_dim_read.dim_x) && ((*ring[index].attr_value_4)[0].r_dim.dim_y == last_dim_read.dim_y)) { ptr->r_dims_array[read_dims_length - 2].nb_elt++; } else { last_dim_read = (*ring[index].attr_value_4)[0].r_dim; ptr->r_dims.length(read_dims_length); ptr->r_dims[read_dims_length - 1] = last_dim_read; ptr->r_dims_array.length(read_dims_length); ptr->r_dims_array[read_dims_length - 1].start = n - (i + 1); ptr->r_dims_array[read_dims_length - 1].nb_elt = 1; read_dims_length++; } // // The write dimension // if (((*ring[index].attr_value_4)[0].w_dim.dim_x == last_dim_write.dim_x) && ((*ring[index].attr_value_4)[0].w_dim.dim_y == last_dim_write.dim_y)) { ptr->w_dims_array[write_dims_length - 2].nb_elt++; } else { last_dim_write = (*ring[index].attr_value_4)[0].w_dim; ptr->w_dims.length(write_dims_length); ptr->w_dims[write_dims_length - 1] = last_dim_write; ptr->w_dims_array.length(write_dims_length); ptr->w_dims_array[write_dims_length - 1].start = n - (i + 1); ptr->w_dims_array[write_dims_length - 1].nb_elt = 1; write_dims_length++; } } else no_data = true; // // Error treatement // if (ring[index].except != NULL) { bool new_err = false; if (previous_no_data == true) { if (ring[index].except->errors.length() != last_err_list.length()) new_err = true; else { for (unsigned int k = 0;k < last_err_list.length();k++) { if (::strcmp(ring[index].except->errors[k].reason.in(),last_err_list[k].reason.in()) != 0) { new_err = true; break; } if (::strcmp(ring[index].except->errors[k].desc.in(),last_err_list[k].desc.in()) != 0) { new_err = true; break; } if (::strcmp(ring[index].except->errors[k].origin.in(),last_err_list[k].origin.in()) != 0) { new_err = true; break; } if (ring[index].except->errors[k].severity != last_err_list[k].severity) { new_err = true; break; } } } } else new_err = true; if (new_err == true) { if (ptr->errors.length() == 0) ptr->errors.length(error_nb); if (ptr->errors_array.length() == 0) ptr->errors_array.length(error_nb); last_err_list = ring[index].except->errors; ptr->errors[errors_length - 1] = last_err_list; ptr->errors_array[errors_length - 1].start = n - (i + 1); ptr->errors_array[errors_length - 1].nb_elt = 1; errors_length++; previous_no_data = no_data; no_data = true; } else { ptr->errors_array[errors_length - 2].nb_elt++; previous_no_data = no_data; no_data = true; } // // Due to compatibility with the old release, the polling thread stores the error // got when reading the attribute as an exception (same behaviour that what we had before IDL3) // This means that we have to manually add entry for the management of quality factor (set to INVALID), // r_dim and w_dim (set to 0) // if ((quals_length == 1) || (last_quality != Tango::ATTR_INVALID)) { last_quality = Tango::ATTR_INVALID; ptr->quals.length(quals_length); ptr->quals[quals_length - 1] = last_quality; ptr->quals_array.length(quals_length); ptr->quals_array[quals_length - 1].start = n - (i + 1); ptr->quals_array[quals_length - 1].nb_elt = 1; quals_length++; } else { ptr->quals_array[quals_length - 2].nb_elt++; } if ((last_dim_read.dim_x == 0) && (last_dim_read.dim_y == 0)) { ptr->r_dims_array[read_dims_length - 2].nb_elt++; } else { last_dim_read.dim_x = last_dim_read.dim_y = 0; ptr->r_dims.length(read_dims_length); ptr->r_dims[read_dims_length - 1] = last_dim_read; ptr->r_dims_array.length(read_dims_length); ptr->r_dims_array[read_dims_length - 1].start = n - (i + 1); ptr->r_dims_array[read_dims_length - 1].nb_elt = 1; read_dims_length++; } if ((last_dim_write.dim_x == 0) && (last_dim_write.dim_y == 0)) { ptr->w_dims_array[write_dims_length - 2].nb_elt++; } else { last_dim_write.dim_x = last_dim_write.dim_y = 0; ptr->w_dims.length(write_dims_length); ptr->w_dims[write_dims_length - 1] = last_dim_write; ptr->w_dims_array.length(write_dims_length); ptr->w_dims_array[write_dims_length - 1].start = n - (i + 1); ptr->w_dims_array[write_dims_length - 1].nb_elt = 1; write_dims_length++; } } // // Now, the data themselves // if (no_data == false) { // // Trick: The state when read as an attribute is not store within the Any as a sequence // To cover this case, we use the "type" data set to DEV_VOID when we are dealing with // the state as an attribute // switch (type) { case Tango::DEV_SHORT : { DevVarShortArray &tmp_seq = (*ring[index].attr_value_4)[0].value.short_att_value(); if (new_tmp_sh == NULL) { new_tmp_sh = new DevVarShortArray(); new_tmp_sh->length(seq_size); } ADD_ELT_DATA_TO_GLOBAL_SEQ_BY_PTR_REF(new_tmp_sh,tmp_seq,ind_in_seq); break; } case Tango::DEV_DOUBLE : { DevVarDoubleArray &tmp_seq = (*ring[index].attr_value_4)[0].value.double_att_value(); if (new_tmp_db == NULL) { new_tmp_db = new DevVarDoubleArray(); new_tmp_db->length(seq_size); } ADD_ELT_DATA_TO_GLOBAL_SEQ_BY_PTR_REF(new_tmp_db,tmp_seq,ind_in_seq); break; } case Tango::DEV_LONG : { DevVarLongArray &tmp_seq = (*ring[index].attr_value_4)[0].value.long_att_value(); if (new_tmp_lg == NULL) { new_tmp_lg = new DevVarLongArray(); new_tmp_lg->length(seq_size); } ADD_ELT_DATA_TO_GLOBAL_SEQ_BY_PTR_REF(new_tmp_lg,tmp_seq,ind_in_seq); break; } case Tango::DEV_LONG64 : { DevVarLong64Array &tmp_seq = (*ring[index].attr_value_4)[0].value.long64_att_value(); if (new_tmp_lg64 == NULL) { new_tmp_lg64 = new DevVarLong64Array(); new_tmp_lg64->length(seq_size); } ADD_ELT_DATA_TO_GLOBAL_SEQ_BY_PTR_REF(new_tmp_lg64,tmp_seq,ind_in_seq); break; } case Tango::DEV_STRING : { DevVarStringArray &tmp_seq = (*ring[index].attr_value_4)[0].value.string_att_value(); if (new_tmp_str == NULL) { new_tmp_str = new DevVarStringArray(); new_tmp_str->length(seq_size); } ADD_ELT_DATA_TO_GLOBAL_SEQ_BY_PTR_REF(new_tmp_str,tmp_seq,ind_in_seq); break; } case Tango::DEV_FLOAT : { DevVarFloatArray &tmp_seq = (*ring[index].attr_value_4)[0].value.float_att_value(); if (new_tmp_fl == NULL) { new_tmp_fl = new DevVarFloatArray(); new_tmp_fl->length(seq_size); } ADD_ELT_DATA_TO_GLOBAL_SEQ_BY_PTR_REF(new_tmp_fl,tmp_seq,ind_in_seq); break; } case Tango::DEV_BOOLEAN : { DevVarBooleanArray &tmp_seq = (*ring[index].attr_value_4)[0].value.bool_att_value(); if (new_tmp_boo == NULL) { new_tmp_boo = new DevVarBooleanArray(); new_tmp_boo->length(seq_size); } ADD_ELT_DATA_TO_GLOBAL_SEQ_BY_PTR_REF(new_tmp_boo,tmp_seq,ind_in_seq); break; } case Tango::DEV_USHORT : { DevVarUShortArray &tmp_seq = (*ring[index].attr_value_4)[0].value.ushort_att_value(); if (new_tmp_ush == NULL) { new_tmp_ush = new DevVarUShortArray(); new_tmp_ush->length(seq_size); } ADD_ELT_DATA_TO_GLOBAL_SEQ_BY_PTR_REF(new_tmp_ush,tmp_seq,ind_in_seq); break; } case Tango::DEV_UCHAR : { DevVarCharArray &tmp_seq = (*ring[index].attr_value_4)[0].value.uchar_att_value(); if (new_tmp_uch == NULL) { new_tmp_uch = new DevVarUCharArray(); new_tmp_uch->length(seq_size); } ADD_ELT_DATA_TO_GLOBAL_SEQ_BY_PTR_REF(new_tmp_uch,tmp_seq,ind_in_seq); break; } case Tango::DEV_ULONG : { DevVarULongArray &tmp_seq = (*ring[index].attr_value_4)[0].value.ulong_att_value(); if (new_tmp_ulg == NULL) { new_tmp_ulg = new DevVarULongArray(); new_tmp_ulg->length(seq_size); } ADD_ELT_DATA_TO_GLOBAL_SEQ_BY_PTR_REF(new_tmp_ulg,tmp_seq,ind_in_seq); break; } case Tango::DEV_ULONG64 : { DevVarULong64Array &tmp_seq = (*ring[index].attr_value_4)[0].value.ulong64_att_value(); if (new_tmp_ulg64 == NULL) { new_tmp_ulg64 = new DevVarULong64Array(); new_tmp_ulg64->length(seq_size); } ADD_ELT_DATA_TO_GLOBAL_SEQ_BY_PTR_REF(new_tmp_ulg64,tmp_seq,ind_in_seq); break; } case Tango::DEV_STATE : { DevVarStateArray &tmp_seq = (*ring[index].attr_value_4)[0].value.state_att_value(); if (new_tmp_state == NULL) { new_tmp_state = new DevVarStateArray(); new_tmp_state->length(seq_size); } ADD_ELT_DATA_TO_GLOBAL_SEQ_BY_PTR_REF(new_tmp_state,tmp_seq,ind_in_seq); break; } case Tango::DEV_VOID : { DevState tmp_state = (*ring[index].attr_value_4)[0].value.dev_state_att(); if (new_tmp_state == NULL) { new_tmp_state = new DevVarStateArray(); new_tmp_state->length(seq_size); } ADD_SIMPLE_DATA_TO_GLOBAL_SEQ(new_tmp_state,tmp_state,ind_in_seq); break; } case Tango::DEV_ENCODED : { DevVarEncodedArray &tmp_seq = (*ring[index].attr_value_4)[0].value.encoded_att_value(); if (new_tmp_enc == NULL) { new_tmp_enc = new DevVarEncodedArray(); new_tmp_enc->length(seq_size); } ADD_ELT_DATA_TO_GLOBAL_SEQ_BY_PTR_REF(new_tmp_enc,tmp_seq,ind_in_seq); break; } } } // // If it is the last point, insert the global sequence into the Any // if (i == (n - 1)) { if (errors_length != (error_nb + 1)) { ptr->errors.length(errors_length - 1); ptr->errors_array.length(errors_length - 1); } switch(type) { case Tango::DEV_SHORT: if (new_tmp_sh != NULL) ptr->value <<= new_tmp_sh; break; case Tango::DEV_DOUBLE: if (new_tmp_db != NULL) ptr->value <<= new_tmp_db; break; case Tango::DEV_LONG: if (new_tmp_lg != NULL) ptr->value <<= new_tmp_lg; break; case Tango::DEV_LONG64: if (new_tmp_lg64 != NULL) ptr->value <<= new_tmp_lg64; break; case Tango::DEV_STRING: if (new_tmp_str != NULL) ptr->value <<= new_tmp_str; break; case Tango::DEV_FLOAT: if (new_tmp_fl != NULL) ptr->value <<= new_tmp_fl; break; case Tango::DEV_BOOLEAN: if (new_tmp_boo != NULL) ptr->value <<= new_tmp_boo; break; case Tango::DEV_USHORT: if (new_tmp_ush != NULL) ptr->value <<= new_tmp_ush; break; case Tango::DEV_UCHAR: if (new_tmp_uch != NULL) ptr->value <<= new_tmp_uch; break; case Tango::DEV_ULONG: if (new_tmp_ulg != NULL) ptr->value <<= new_tmp_ulg; break; case Tango::DEV_ULONG64: if (new_tmp_ulg64 != NULL) ptr->value <<= new_tmp_ulg64; break; case Tango::DEV_ENCODED: if (new_tmp_enc != NULL) ptr->value <<= new_tmp_enc; break; case Tango::DEV_STATE: case Tango::DEV_VOID: if (new_tmp_state != NULL) ptr->value <<= new_tmp_state; break; } } // // Manage indexes // if (index == 0) index = max_elt; index--; seq_index--; } } void PollRing::get_attr_history_43(long n,Tango::DevAttrHistoryList_3 *ptr,long type) { long i; // // Set index to read ring and to initialised returned sequence // In the returned sequence , indice 0 is the oldest data // long index = insert_elt; if (index == 0) index = max_elt; index--; long seq_index = n - 1; // // Read buffer // for (i = 0;i < n;i++) { (*ptr)[seq_index].value.time.tv_sec = ring[index].when.tv_sec + DELTA_T; (*ptr)[seq_index].value.time.tv_usec = ring[index].when.tv_usec; (*ptr)[seq_index].value.time.tv_nsec = 0; if (ring[index].except == NULL) { (*ptr)[seq_index].value.err_list = (*ring[index].attr_value_4)[0].err_list; (*ptr)[seq_index].value.quality = (*ring[index].attr_value_4)[0].quality; (*ptr)[seq_index].value.r_dim = (*ring[index].attr_value_4)[0].r_dim; (*ptr)[seq_index].value.w_dim = (*ring[index].attr_value_4)[0].w_dim; (*ptr)[seq_index].value.name = CORBA::string_dup((*ring[index].attr_value_4)[0].name); (*ptr)[seq_index].attr_failed = false; if ((*ptr)[seq_index].value.quality != Tango::ATTR_INVALID) { switch (type) { case Tango::DEV_SHORT : { const DevVarShortArray &tmp_seq = (*ring[index].attr_value_4)[0].value.short_att_value(); (*ptr)[seq_index].value.value <<= tmp_seq; } break; case Tango::DEV_DOUBLE : { const DevVarDoubleArray &tmp_seq = (*ring[index].attr_value_4)[0].value.double_att_value(); (*ptr)[seq_index].value.value <<= tmp_seq; } break; case Tango::DEV_LONG : { const DevVarLongArray &tmp_seq = (*ring[index].attr_value_4)[0].value.long_att_value(); (*ptr)[seq_index].value.value <<= tmp_seq; } break; case Tango::DEV_LONG64 : { const DevVarLong64Array &tmp_seq = (*ring[index].attr_value_4)[0].value.long64_att_value(); (*ptr)[seq_index].value.value <<= tmp_seq; } break; case Tango::DEV_STRING : { const DevVarStringArray &tmp_seq = (*ring[index].attr_value_4)[0].value.string_att_value(); (*ptr)[seq_index].value.value <<= tmp_seq; } break; case Tango::DEV_FLOAT : { const DevVarFloatArray &tmp_seq = (*ring[index].attr_value_4)[0].value.float_att_value(); (*ptr)[seq_index].value.value <<= tmp_seq; } break; case Tango::DEV_BOOLEAN : { const DevVarBooleanArray &tmp_seq = (*ring[index].attr_value_4)[0].value.bool_att_value(); (*ptr)[seq_index].value.value <<= tmp_seq; } break; case Tango::DEV_USHORT : { const DevVarUShortArray &tmp_seq = (*ring[index].attr_value_4)[0].value.ushort_att_value(); (*ptr)[seq_index].value.value <<= tmp_seq; } break; case Tango::DEV_UCHAR : { const DevVarCharArray &tmp_seq = (*ring[index].attr_value_4)[0].value.uchar_att_value(); (*ptr)[seq_index].value.value <<= tmp_seq; } break; case Tango::DEV_ULONG : { const DevVarULongArray &tmp_seq = (*ring[index].attr_value_4)[0].value.ulong_att_value(); (*ptr)[seq_index].value.value <<= tmp_seq; } break; case Tango::DEV_ULONG64 : { const DevVarULong64Array &tmp_seq = (*ring[index].attr_value_4)[0].value.ulong64_att_value(); (*ptr)[seq_index].value.value <<= tmp_seq; } break; case Tango::DEV_STATE : { if ((*ring[index].attr_value_4)[0].value._d() == DEVICE_STATE) { DevState tmp_ds = (*ring[index].attr_value_4)[0].value.dev_state_att(); (*ptr)[seq_index].value.value <<= tmp_ds; } else { DevVarStateArray &tmp_seq = (*ring[index].attr_value_4)[0].value.state_att_value(); (*ptr)[seq_index].value.value <<= tmp_seq; } } break; } } } else { (*ptr)[seq_index].attr_failed = true; (*ptr)[seq_index].value.err_list = ring[index].except->errors; (*ptr)[seq_index].value.quality = Tango::ATTR_INVALID; clear_att_dim((*ptr)[seq_index].value); } if (index == 0) index = max_elt; index--; seq_index--; } } } // End of Tango namespace tango-8.1.2c+dfsg.orig/lib/cpp/server/tangoDynSK.cpp0000644000175000017500000056320112205375142021166 0ustar piccapicca// This file is generated by omniidl (C++ backend) - omniORB_4_1. Do not edit. // // Copyright (C) : 2004,2005,2006,2007,2008,2009,2010,2011,2012,2013 // European Synchrotron Radiation Facility // BP 220, Grenoble 38043 // FRANCE // // This file is part of Tango. // // Tango 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. // // Tango 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 Tango. If not, see . // #include "tango.h" OMNI_USING_NAMESPACE(omni) static const char* _0RL_dyn_library_version = omniORB_4_1_dyn; static ::CORBA::TypeCode::_Tracker _0RL_tcTrack(__FILE__); static CORBA::TypeCode_ptr _0RL_tc_Tango_mDevBoolean = CORBA::TypeCode::PR_alias_tc("IDL:Tango/DevBoolean:1.0", "DevBoolean", CORBA::TypeCode::PR_boolean_tc(), &_0RL_tcTrack); #if defined(HAS_Cplusplus_Namespace) && defined(_MSC_VER) // MSVC++ does not give the constant external linkage otherwise. namespace Tango { const ::CORBA::TypeCode_ptr _tc_DevBoolean = _0RL_tc_Tango_mDevBoolean; } #else const ::CORBA::TypeCode_ptr Tango::_tc_DevBoolean = _0RL_tc_Tango_mDevBoolean; #endif static CORBA::TypeCode_ptr _0RL_tc_Tango_mDevDouble = CORBA::TypeCode::PR_alias_tc("IDL:Tango/DevDouble:1.0", "DevDouble", CORBA::TypeCode::PR_double_tc(), &_0RL_tcTrack); #if defined(HAS_Cplusplus_Namespace) && defined(_MSC_VER) // MSVC++ does not give the constant external linkage otherwise. namespace Tango { const ::CORBA::TypeCode_ptr _tc_DevDouble = _0RL_tc_Tango_mDevDouble; } #else const ::CORBA::TypeCode_ptr Tango::_tc_DevDouble = _0RL_tc_Tango_mDevDouble; #endif static CORBA::TypeCode_ptr _0RL_tc_Tango_mDevFloat = CORBA::TypeCode::PR_alias_tc("IDL:Tango/DevFloat:1.0", "DevFloat", CORBA::TypeCode::PR_float_tc(), &_0RL_tcTrack); #if defined(HAS_Cplusplus_Namespace) && defined(_MSC_VER) // MSVC++ does not give the constant external linkage otherwise. namespace Tango { const ::CORBA::TypeCode_ptr _tc_DevFloat = _0RL_tc_Tango_mDevFloat; } #else const ::CORBA::TypeCode_ptr Tango::_tc_DevFloat = _0RL_tc_Tango_mDevFloat; #endif static CORBA::TypeCode_ptr _0RL_tc_Tango_mDevShort = CORBA::TypeCode::PR_alias_tc("IDL:Tango/DevShort:1.0", "DevShort", CORBA::TypeCode::PR_short_tc(), &_0RL_tcTrack); #if defined(HAS_Cplusplus_Namespace) && defined(_MSC_VER) // MSVC++ does not give the constant external linkage otherwise. namespace Tango { const ::CORBA::TypeCode_ptr _tc_DevShort = _0RL_tc_Tango_mDevShort; } #else const ::CORBA::TypeCode_ptr Tango::_tc_DevShort = _0RL_tc_Tango_mDevShort; #endif static CORBA::TypeCode_ptr _0RL_tc_Tango_mDevLong = CORBA::TypeCode::PR_alias_tc("IDL:Tango/DevLong:1.0", "DevLong", CORBA::TypeCode::PR_long_tc(), &_0RL_tcTrack); #if defined(HAS_Cplusplus_Namespace) && defined(_MSC_VER) // MSVC++ does not give the constant external linkage otherwise. namespace Tango { const ::CORBA::TypeCode_ptr _tc_DevLong = _0RL_tc_Tango_mDevLong; } #else const ::CORBA::TypeCode_ptr Tango::_tc_DevLong = _0RL_tc_Tango_mDevLong; #endif static CORBA::TypeCode_ptr _0RL_tc_Tango_mDevLong64 = CORBA::TypeCode::PR_alias_tc("IDL:Tango/DevLong64:1.0", "DevLong64", CORBA::TypeCode::PR_longlong_tc(), &_0RL_tcTrack); #if defined(HAS_Cplusplus_Namespace) && defined(_MSC_VER) // MSVC++ does not give the constant external linkage otherwise. namespace Tango { const ::CORBA::TypeCode_ptr _tc_DevLong64 = _0RL_tc_Tango_mDevLong64; } #else const ::CORBA::TypeCode_ptr Tango::_tc_DevLong64 = _0RL_tc_Tango_mDevLong64; #endif static CORBA::TypeCode_ptr _0RL_tc_Tango_mDevString = CORBA::TypeCode::PR_alias_tc("IDL:Tango/DevString:1.0", "DevString", CORBA::TypeCode::PR_string_tc(0, &_0RL_tcTrack), &_0RL_tcTrack); #if defined(HAS_Cplusplus_Namespace) && defined(_MSC_VER) // MSVC++ does not give the constant external linkage otherwise. namespace Tango { const ::CORBA::TypeCode_ptr _tc_DevString = _0RL_tc_Tango_mDevString; } #else const ::CORBA::TypeCode_ptr Tango::_tc_DevString = _0RL_tc_Tango_mDevString; #endif static CORBA::TypeCode_ptr _0RL_tc_Tango_mDevUChar = CORBA::TypeCode::PR_alias_tc("IDL:Tango/DevUChar:1.0", "DevUChar", CORBA::TypeCode::PR_octet_tc(), &_0RL_tcTrack); #if defined(HAS_Cplusplus_Namespace) && defined(_MSC_VER) // MSVC++ does not give the constant external linkage otherwise. namespace Tango { const ::CORBA::TypeCode_ptr _tc_DevUChar = _0RL_tc_Tango_mDevUChar; } #else const ::CORBA::TypeCode_ptr Tango::_tc_DevUChar = _0RL_tc_Tango_mDevUChar; #endif static CORBA::TypeCode_ptr _0RL_tc_Tango_mDevUShort = CORBA::TypeCode::PR_alias_tc("IDL:Tango/DevUShort:1.0", "DevUShort", CORBA::TypeCode::PR_ushort_tc(), &_0RL_tcTrack); #if defined(HAS_Cplusplus_Namespace) && defined(_MSC_VER) // MSVC++ does not give the constant external linkage otherwise. namespace Tango { const ::CORBA::TypeCode_ptr _tc_DevUShort = _0RL_tc_Tango_mDevUShort; } #else const ::CORBA::TypeCode_ptr Tango::_tc_DevUShort = _0RL_tc_Tango_mDevUShort; #endif static CORBA::TypeCode_ptr _0RL_tc_Tango_mDevULong = CORBA::TypeCode::PR_alias_tc("IDL:Tango/DevULong:1.0", "DevULong", CORBA::TypeCode::PR_ulong_tc(), &_0RL_tcTrack); #if defined(HAS_Cplusplus_Namespace) && defined(_MSC_VER) // MSVC++ does not give the constant external linkage otherwise. namespace Tango { const ::CORBA::TypeCode_ptr _tc_DevULong = _0RL_tc_Tango_mDevULong; } #else const ::CORBA::TypeCode_ptr Tango::_tc_DevULong = _0RL_tc_Tango_mDevULong; #endif static CORBA::TypeCode_ptr _0RL_tc_Tango_mDevULong64 = CORBA::TypeCode::PR_alias_tc("IDL:Tango/DevULong64:1.0", "DevULong64", CORBA::TypeCode::PR_ulonglong_tc(), &_0RL_tcTrack); #if defined(HAS_Cplusplus_Namespace) && defined(_MSC_VER) // MSVC++ does not give the constant external linkage otherwise. namespace Tango { const ::CORBA::TypeCode_ptr _tc_DevULong64 = _0RL_tc_Tango_mDevULong64; } #else const ::CORBA::TypeCode_ptr Tango::_tc_DevULong64 = _0RL_tc_Tango_mDevULong64; #endif static CORBA::TypeCode_ptr _0RL_tc_Tango_mDevVarBooleanArray = CORBA::TypeCode::PR_alias_tc("IDL:Tango/DevVarBooleanArray:1.0", "DevVarBooleanArray", CORBA::TypeCode::PR_sequence_tc(0, CORBA::TypeCode::PR_boolean_tc(), &_0RL_tcTrack), &_0RL_tcTrack); #if defined(HAS_Cplusplus_Namespace) && defined(_MSC_VER) // MSVC++ does not give the constant external linkage otherwise. namespace Tango { const ::CORBA::TypeCode_ptr _tc_DevVarBooleanArray = _0RL_tc_Tango_mDevVarBooleanArray; } #else const ::CORBA::TypeCode_ptr Tango::_tc_DevVarBooleanArray = _0RL_tc_Tango_mDevVarBooleanArray; #endif static CORBA::TypeCode_ptr _0RL_tc_Tango_mDevVarDoubleArray = CORBA::TypeCode::PR_alias_tc("IDL:Tango/DevVarDoubleArray:1.0", "DevVarDoubleArray", CORBA::TypeCode::PR_sequence_tc(0, CORBA::TypeCode::PR_double_tc(), &_0RL_tcTrack), &_0RL_tcTrack); #if defined(HAS_Cplusplus_Namespace) && defined(_MSC_VER) // MSVC++ does not give the constant external linkage otherwise. namespace Tango { const ::CORBA::TypeCode_ptr _tc_DevVarDoubleArray = _0RL_tc_Tango_mDevVarDoubleArray; } #else const ::CORBA::TypeCode_ptr Tango::_tc_DevVarDoubleArray = _0RL_tc_Tango_mDevVarDoubleArray; #endif static CORBA::TypeCode_ptr _0RL_tc_Tango_mDevVarFloatArray = CORBA::TypeCode::PR_alias_tc("IDL:Tango/DevVarFloatArray:1.0", "DevVarFloatArray", CORBA::TypeCode::PR_sequence_tc(0, CORBA::TypeCode::PR_float_tc(), &_0RL_tcTrack), &_0RL_tcTrack); #if defined(HAS_Cplusplus_Namespace) && defined(_MSC_VER) // MSVC++ does not give the constant external linkage otherwise. namespace Tango { const ::CORBA::TypeCode_ptr _tc_DevVarFloatArray = _0RL_tc_Tango_mDevVarFloatArray; } #else const ::CORBA::TypeCode_ptr Tango::_tc_DevVarFloatArray = _0RL_tc_Tango_mDevVarFloatArray; #endif static CORBA::TypeCode_ptr _0RL_tc_Tango_mDevVarShortArray = CORBA::TypeCode::PR_alias_tc("IDL:Tango/DevVarShortArray:1.0", "DevVarShortArray", CORBA::TypeCode::PR_sequence_tc(0, CORBA::TypeCode::PR_short_tc(), &_0RL_tcTrack), &_0RL_tcTrack); #if defined(HAS_Cplusplus_Namespace) && defined(_MSC_VER) // MSVC++ does not give the constant external linkage otherwise. namespace Tango { const ::CORBA::TypeCode_ptr _tc_DevVarShortArray = _0RL_tc_Tango_mDevVarShortArray; } #else const ::CORBA::TypeCode_ptr Tango::_tc_DevVarShortArray = _0RL_tc_Tango_mDevVarShortArray; #endif static CORBA::TypeCode_ptr _0RL_tc_Tango_mDevVarLongArray = CORBA::TypeCode::PR_alias_tc("IDL:Tango/DevVarLongArray:1.0", "DevVarLongArray", CORBA::TypeCode::PR_sequence_tc(0, CORBA::TypeCode::PR_long_tc(), &_0RL_tcTrack), &_0RL_tcTrack); #if defined(HAS_Cplusplus_Namespace) && defined(_MSC_VER) // MSVC++ does not give the constant external linkage otherwise. namespace Tango { const ::CORBA::TypeCode_ptr _tc_DevVarLongArray = _0RL_tc_Tango_mDevVarLongArray; } #else const ::CORBA::TypeCode_ptr Tango::_tc_DevVarLongArray = _0RL_tc_Tango_mDevVarLongArray; #endif static CORBA::TypeCode_ptr _0RL_tc_Tango_mDevVarLong64Array = CORBA::TypeCode::PR_alias_tc("IDL:Tango/DevVarLong64Array:1.0", "DevVarLong64Array", CORBA::TypeCode::PR_sequence_tc(0, CORBA::TypeCode::PR_longlong_tc(), &_0RL_tcTrack), &_0RL_tcTrack); #if defined(HAS_Cplusplus_Namespace) && defined(_MSC_VER) // MSVC++ does not give the constant external linkage otherwise. namespace Tango { const ::CORBA::TypeCode_ptr _tc_DevVarLong64Array = _0RL_tc_Tango_mDevVarLong64Array; } #else const ::CORBA::TypeCode_ptr Tango::_tc_DevVarLong64Array = _0RL_tc_Tango_mDevVarLong64Array; #endif static CORBA::TypeCode_ptr _0RL_tc_Tango_mDevVarCharArray = CORBA::TypeCode::PR_alias_tc("IDL:Tango/DevVarCharArray:1.0", "DevVarCharArray", CORBA::TypeCode::PR_sequence_tc(0, CORBA::TypeCode::PR_octet_tc(), &_0RL_tcTrack), &_0RL_tcTrack); #if defined(HAS_Cplusplus_Namespace) && defined(_MSC_VER) // MSVC++ does not give the constant external linkage otherwise. namespace Tango { const ::CORBA::TypeCode_ptr _tc_DevVarCharArray = _0RL_tc_Tango_mDevVarCharArray; } #else const ::CORBA::TypeCode_ptr Tango::_tc_DevVarCharArray = _0RL_tc_Tango_mDevVarCharArray; #endif static CORBA::TypeCode_ptr _0RL_tc_Tango_mDevVarStringArray = CORBA::TypeCode::PR_alias_tc("IDL:Tango/DevVarStringArray:1.0", "DevVarStringArray", CORBA::TypeCode::PR_sequence_tc(0, CORBA::TypeCode::PR_string_tc(0, &_0RL_tcTrack), &_0RL_tcTrack), &_0RL_tcTrack); #if defined(HAS_Cplusplus_Namespace) && defined(_MSC_VER) // MSVC++ does not give the constant external linkage otherwise. namespace Tango { const ::CORBA::TypeCode_ptr _tc_DevVarStringArray = _0RL_tc_Tango_mDevVarStringArray; } #else const ::CORBA::TypeCode_ptr Tango::_tc_DevVarStringArray = _0RL_tc_Tango_mDevVarStringArray; #endif static CORBA::TypeCode_ptr _0RL_tc_Tango_mDevVarUShortArray = CORBA::TypeCode::PR_alias_tc("IDL:Tango/DevVarUShortArray:1.0", "DevVarUShortArray", CORBA::TypeCode::PR_sequence_tc(0, CORBA::TypeCode::PR_ushort_tc(), &_0RL_tcTrack), &_0RL_tcTrack); #if defined(HAS_Cplusplus_Namespace) && defined(_MSC_VER) // MSVC++ does not give the constant external linkage otherwise. namespace Tango { const ::CORBA::TypeCode_ptr _tc_DevVarUShortArray = _0RL_tc_Tango_mDevVarUShortArray; } #else const ::CORBA::TypeCode_ptr Tango::_tc_DevVarUShortArray = _0RL_tc_Tango_mDevVarUShortArray; #endif static CORBA::TypeCode_ptr _0RL_tc_Tango_mDevVarULongArray = CORBA::TypeCode::PR_alias_tc("IDL:Tango/DevVarULongArray:1.0", "DevVarULongArray", CORBA::TypeCode::PR_sequence_tc(0, CORBA::TypeCode::PR_ulong_tc(), &_0RL_tcTrack), &_0RL_tcTrack); #if defined(HAS_Cplusplus_Namespace) && defined(_MSC_VER) // MSVC++ does not give the constant external linkage otherwise. namespace Tango { const ::CORBA::TypeCode_ptr _tc_DevVarULongArray = _0RL_tc_Tango_mDevVarULongArray; } #else const ::CORBA::TypeCode_ptr Tango::_tc_DevVarULongArray = _0RL_tc_Tango_mDevVarULongArray; #endif static CORBA::TypeCode_ptr _0RL_tc_Tango_mDevVarULong64Array = CORBA::TypeCode::PR_alias_tc("IDL:Tango/DevVarULong64Array:1.0", "DevVarULong64Array", CORBA::TypeCode::PR_sequence_tc(0, CORBA::TypeCode::PR_ulonglong_tc(), &_0RL_tcTrack), &_0RL_tcTrack); #if defined(HAS_Cplusplus_Namespace) && defined(_MSC_VER) // MSVC++ does not give the constant external linkage otherwise. namespace Tango { const ::CORBA::TypeCode_ptr _tc_DevVarULong64Array = _0RL_tc_Tango_mDevVarULong64Array; } #else const ::CORBA::TypeCode_ptr Tango::_tc_DevVarULong64Array = _0RL_tc_Tango_mDevVarULong64Array; #endif static CORBA::PR_structMember _0RL_structmember_Tango_mDevVarLongStringArray[] = { {"lvalue", _0RL_tc_Tango_mDevVarLongArray}, {"svalue", _0RL_tc_Tango_mDevVarStringArray} }; #ifdef _0RL_tc_Tango_mDevVarLongStringArray # undef _0RL_tc_Tango_mDevVarLongStringArray #endif static CORBA::TypeCode_ptr _0RL_tc_Tango_mDevVarLongStringArray = CORBA::TypeCode::PR_struct_tc("IDL:Tango/DevVarLongStringArray:1.0", "DevVarLongStringArray", _0RL_structmember_Tango_mDevVarLongStringArray, 2, &_0RL_tcTrack); #if defined(HAS_Cplusplus_Namespace) && defined(_MSC_VER) // MSVC++ does not give the constant external linkage otherwise. namespace Tango { const ::CORBA::TypeCode_ptr _tc_DevVarLongStringArray = _0RL_tc_Tango_mDevVarLongStringArray; } #else const ::CORBA::TypeCode_ptr Tango::_tc_DevVarLongStringArray = _0RL_tc_Tango_mDevVarLongStringArray; #endif static CORBA::PR_structMember _0RL_structmember_Tango_mDevVarDoubleStringArray[] = { {"dvalue", _0RL_tc_Tango_mDevVarDoubleArray}, {"svalue", _0RL_tc_Tango_mDevVarStringArray} }; #ifdef _0RL_tc_Tango_mDevVarDoubleStringArray # undef _0RL_tc_Tango_mDevVarDoubleStringArray #endif static CORBA::TypeCode_ptr _0RL_tc_Tango_mDevVarDoubleStringArray = CORBA::TypeCode::PR_struct_tc("IDL:Tango/DevVarDoubleStringArray:1.0", "DevVarDoubleStringArray", _0RL_structmember_Tango_mDevVarDoubleStringArray, 2, &_0RL_tcTrack); #if defined(HAS_Cplusplus_Namespace) && defined(_MSC_VER) // MSVC++ does not give the constant external linkage otherwise. namespace Tango { const ::CORBA::TypeCode_ptr _tc_DevVarDoubleStringArray = _0RL_tc_Tango_mDevVarDoubleStringArray; } #else const ::CORBA::TypeCode_ptr Tango::_tc_DevVarDoubleStringArray = _0RL_tc_Tango_mDevVarDoubleStringArray; #endif static CORBA::PR_structMember _0RL_structmember_Tango_mDevEncoded[] = { {"encoded_format", _0RL_tc_Tango_mDevString}, {"encoded_data", _0RL_tc_Tango_mDevVarCharArray} }; #ifdef _0RL_tc_Tango_mDevEncoded # undef _0RL_tc_Tango_mDevEncoded #endif static CORBA::TypeCode_ptr _0RL_tc_Tango_mDevEncoded = CORBA::TypeCode::PR_struct_tc("IDL:Tango/DevEncoded:1.0", "DevEncoded", _0RL_structmember_Tango_mDevEncoded, 2, &_0RL_tcTrack); #if defined(HAS_Cplusplus_Namespace) && defined(_MSC_VER) // MSVC++ does not give the constant external linkage otherwise. namespace Tango { const ::CORBA::TypeCode_ptr _tc_DevEncoded = _0RL_tc_Tango_mDevEncoded; } #else const ::CORBA::TypeCode_ptr Tango::_tc_DevEncoded = _0RL_tc_Tango_mDevEncoded; #endif static CORBA::TypeCode_ptr _0RL_tc_Tango_mDevVarEncodedArray = CORBA::TypeCode::PR_alias_tc("IDL:Tango/DevVarEncodedArray:1.0", "DevVarEncodedArray", CORBA::TypeCode::PR_sequence_tc(0, _0RL_tc_Tango_mDevEncoded, &_0RL_tcTrack), &_0RL_tcTrack); #if defined(HAS_Cplusplus_Namespace) && defined(_MSC_VER) // MSVC++ does not give the constant external linkage otherwise. namespace Tango { const ::CORBA::TypeCode_ptr _tc_DevVarEncodedArray = _0RL_tc_Tango_mDevVarEncodedArray; } #else const ::CORBA::TypeCode_ptr Tango::_tc_DevVarEncodedArray = _0RL_tc_Tango_mDevVarEncodedArray; #endif static CORBA::TypeCode_ptr _0RL_tc_Tango_mJavaUUID = CORBA::TypeCode::PR_alias_tc("IDL:Tango/JavaUUID:1.0", "JavaUUID", CORBA::TypeCode::PR_array_tc(2, CORBA::TypeCode::PR_ulonglong_tc(), &_0RL_tcTrack), &_0RL_tcTrack); #if defined(HAS_Cplusplus_Namespace) && defined(_MSC_VER) // MSVC++ does not give the constant external linkage otherwise. namespace Tango { const ::CORBA::TypeCode_ptr _tc_JavaUUID = _0RL_tc_Tango_mJavaUUID; } #else const ::CORBA::TypeCode_ptr Tango::_tc_JavaUUID = _0RL_tc_Tango_mJavaUUID; #endif static CORBA::TypeCode_ptr _0RL_tc_Tango_mCppClntIdent = CORBA::TypeCode::PR_alias_tc("IDL:Tango/CppClntIdent:1.0", "CppClntIdent", CORBA::TypeCode::PR_ulong_tc(), &_0RL_tcTrack); #if defined(HAS_Cplusplus_Namespace) && defined(_MSC_VER) // MSVC++ does not give the constant external linkage otherwise. namespace Tango { const ::CORBA::TypeCode_ptr _tc_CppClntIdent = _0RL_tc_Tango_mCppClntIdent; } #else const ::CORBA::TypeCode_ptr Tango::_tc_CppClntIdent = _0RL_tc_Tango_mCppClntIdent; #endif static CORBA::PR_structMember _0RL_structmember_Tango_mJavaClntIdent[] = { {"MainClass", CORBA::TypeCode::PR_string_tc(0, &_0RL_tcTrack)}, {"uuid", _0RL_tc_Tango_mJavaUUID} }; #ifdef _0RL_tc_Tango_mJavaClntIdent # undef _0RL_tc_Tango_mJavaClntIdent #endif static CORBA::TypeCode_ptr _0RL_tc_Tango_mJavaClntIdent = CORBA::TypeCode::PR_struct_tc("IDL:Tango/JavaClntIdent:1.0", "JavaClntIdent", _0RL_structmember_Tango_mJavaClntIdent, 2, &_0RL_tcTrack); #if defined(HAS_Cplusplus_Namespace) && defined(_MSC_VER) // MSVC++ does not give the constant external linkage otherwise. namespace Tango { const ::CORBA::TypeCode_ptr _tc_JavaClntIdent = _0RL_tc_Tango_mJavaClntIdent; } #else const ::CORBA::TypeCode_ptr Tango::_tc_JavaClntIdent = _0RL_tc_Tango_mJavaClntIdent; #endif static const char* _0RL_enumMember_Tango_mLockerLanguage[] = { "CPP", "JAVA" }; static CORBA::TypeCode_ptr _0RL_tc_Tango_mLockerLanguage = CORBA::TypeCode::PR_enum_tc("IDL:Tango/LockerLanguage:1.0", "LockerLanguage", _0RL_enumMember_Tango_mLockerLanguage, 2, &_0RL_tcTrack); #if defined(HAS_Cplusplus_Namespace) && defined(_MSC_VER) // MSVC++ does not give the constant external linkage otherwise. namespace Tango { const ::CORBA::TypeCode_ptr _tc_LockerLanguage = _0RL_tc_Tango_mLockerLanguage; } #else const ::CORBA::TypeCode_ptr Tango::_tc_LockerLanguage = _0RL_tc_Tango_mLockerLanguage; #endif static CORBA::PR_unionMember _0RL_unionMember_Tango_mClntIdent[] = { {"cpp_clnt", _0RL_tc_Tango_mCppClntIdent, Tango::CPP}, {"java_clnt", _0RL_tc_Tango_mJavaClntIdent, Tango::JAVA} }; #ifdef _0RL_tc_Tango_mClntIdent # undef _0RL_tc_Tango_mClntIdent #endif static CORBA::TypeCode_ptr _0RL_tc_Tango_mClntIdent = CORBA::TypeCode::PR_union_tc("IDL:Tango/ClntIdent:1.0", "ClntIdent", _0RL_tc_Tango_mLockerLanguage, _0RL_unionMember_Tango_mClntIdent, 2, -1, &_0RL_tcTrack); #if defined(HAS_Cplusplus_Namespace) && defined(_MSC_VER) // MSVC++ does not give the constant external linkage otherwise. namespace Tango { const ::CORBA::TypeCode_ptr _tc_ClntIdent = _0RL_tc_Tango_mClntIdent; } #else const ::CORBA::TypeCode_ptr Tango::_tc_ClntIdent = _0RL_tc_Tango_mClntIdent; #endif static const char* _0RL_enumMember_Tango_mAttrQuality[] = { "ATTR_VALID", "ATTR_INVALID", "ATTR_ALARM", "ATTR_CHANGING", "ATTR_WARNING" }; static CORBA::TypeCode_ptr _0RL_tc_Tango_mAttrQuality = CORBA::TypeCode::PR_enum_tc("IDL:Tango/AttrQuality:1.0", "AttrQuality", _0RL_enumMember_Tango_mAttrQuality, 5, &_0RL_tcTrack); #if defined(HAS_Cplusplus_Namespace) && defined(_MSC_VER) // MSVC++ does not give the constant external linkage otherwise. namespace Tango { const ::CORBA::TypeCode_ptr _tc_AttrQuality = _0RL_tc_Tango_mAttrQuality; } #else const ::CORBA::TypeCode_ptr Tango::_tc_AttrQuality = _0RL_tc_Tango_mAttrQuality; #endif static const char* _0RL_enumMember_Tango_mAttrWriteType[] = { "READ", "READ_WITH_WRITE", "WRITE", "READ_WRITE" }; static CORBA::TypeCode_ptr _0RL_tc_Tango_mAttrWriteType = CORBA::TypeCode::PR_enum_tc("IDL:Tango/AttrWriteType:1.0", "AttrWriteType", _0RL_enumMember_Tango_mAttrWriteType, 4, &_0RL_tcTrack); #if defined(HAS_Cplusplus_Namespace) && defined(_MSC_VER) // MSVC++ does not give the constant external linkage otherwise. namespace Tango { const ::CORBA::TypeCode_ptr _tc_AttrWriteType = _0RL_tc_Tango_mAttrWriteType; } #else const ::CORBA::TypeCode_ptr Tango::_tc_AttrWriteType = _0RL_tc_Tango_mAttrWriteType; #endif static const char* _0RL_enumMember_Tango_mAttrDataFormat[] = { "SCALAR", "SPECTRUM", "IMAGE", "FMT_UNKNOWN" }; static CORBA::TypeCode_ptr _0RL_tc_Tango_mAttrDataFormat = CORBA::TypeCode::PR_enum_tc("IDL:Tango/AttrDataFormat:1.0", "AttrDataFormat", _0RL_enumMember_Tango_mAttrDataFormat, 4, &_0RL_tcTrack); #if defined(HAS_Cplusplus_Namespace) && defined(_MSC_VER) // MSVC++ does not give the constant external linkage otherwise. namespace Tango { const ::CORBA::TypeCode_ptr _tc_AttrDataFormat = _0RL_tc_Tango_mAttrDataFormat; } #else const ::CORBA::TypeCode_ptr Tango::_tc_AttrDataFormat = _0RL_tc_Tango_mAttrDataFormat; #endif static const char* _0RL_enumMember_Tango_mDevSource[] = { "DEV", "CACHE", "CACHE_DEV" }; static CORBA::TypeCode_ptr _0RL_tc_Tango_mDevSource = CORBA::TypeCode::PR_enum_tc("IDL:Tango/DevSource:1.0", "DevSource", _0RL_enumMember_Tango_mDevSource, 3, &_0RL_tcTrack); #if defined(HAS_Cplusplus_Namespace) && defined(_MSC_VER) // MSVC++ does not give the constant external linkage otherwise. namespace Tango { const ::CORBA::TypeCode_ptr _tc_DevSource = _0RL_tc_Tango_mDevSource; } #else const ::CORBA::TypeCode_ptr Tango::_tc_DevSource = _0RL_tc_Tango_mDevSource; #endif static const char* _0RL_enumMember_Tango_mErrSeverity[] = { "WARN", "ERR", "PANIC" }; static CORBA::TypeCode_ptr _0RL_tc_Tango_mErrSeverity = CORBA::TypeCode::PR_enum_tc("IDL:Tango/ErrSeverity:1.0", "ErrSeverity", _0RL_enumMember_Tango_mErrSeverity, 3, &_0RL_tcTrack); #if defined(HAS_Cplusplus_Namespace) && defined(_MSC_VER) // MSVC++ does not give the constant external linkage otherwise. namespace Tango { const ::CORBA::TypeCode_ptr _tc_ErrSeverity = _0RL_tc_Tango_mErrSeverity; } #else const ::CORBA::TypeCode_ptr Tango::_tc_ErrSeverity = _0RL_tc_Tango_mErrSeverity; #endif static const char* _0RL_enumMember_Tango_mDevState[] = { "ON", "OFF", "CLOSE", "OPEN", "INSERT", "EXTRACT", "MOVING", "STANDBY", "FAULT", "INIT", "RUNNING", "ALARM", "DISABLE", "UNKNOWN" }; static CORBA::TypeCode_ptr _0RL_tc_Tango_mDevState = CORBA::TypeCode::PR_enum_tc("IDL:Tango/DevState:1.0", "DevState", _0RL_enumMember_Tango_mDevState, 14, &_0RL_tcTrack); #if defined(HAS_Cplusplus_Namespace) && defined(_MSC_VER) // MSVC++ does not give the constant external linkage otherwise. namespace Tango { const ::CORBA::TypeCode_ptr _tc_DevState = _0RL_tc_Tango_mDevState; } #else const ::CORBA::TypeCode_ptr Tango::_tc_DevState = _0RL_tc_Tango_mDevState; #endif static const char* _0RL_enumMember_Tango_mDispLevel[] = { "OPERATOR", "EXPERT" }; static CORBA::TypeCode_ptr _0RL_tc_Tango_mDispLevel = CORBA::TypeCode::PR_enum_tc("IDL:Tango/DispLevel:1.0", "DispLevel", _0RL_enumMember_Tango_mDispLevel, 2, &_0RL_tcTrack); #if defined(HAS_Cplusplus_Namespace) && defined(_MSC_VER) // MSVC++ does not give the constant external linkage otherwise. namespace Tango { const ::CORBA::TypeCode_ptr _tc_DispLevel = _0RL_tc_Tango_mDispLevel; } #else const ::CORBA::TypeCode_ptr Tango::_tc_DispLevel = _0RL_tc_Tango_mDispLevel; #endif static CORBA::TypeCode_ptr _0RL_tc_Tango_mDevVarStateArray = CORBA::TypeCode::PR_alias_tc("IDL:Tango/DevVarStateArray:1.0", "DevVarStateArray", CORBA::TypeCode::PR_sequence_tc(0, _0RL_tc_Tango_mDevState, &_0RL_tcTrack), &_0RL_tcTrack); #if defined(HAS_Cplusplus_Namespace) && defined(_MSC_VER) // MSVC++ does not give the constant external linkage otherwise. namespace Tango { const ::CORBA::TypeCode_ptr _tc_DevVarStateArray = _0RL_tc_Tango_mDevVarStateArray; } #else const ::CORBA::TypeCode_ptr Tango::_tc_DevVarStateArray = _0RL_tc_Tango_mDevVarStateArray; #endif static CORBA::PR_structMember _0RL_structmember_Tango_mTimeVal[] = { {"tv_sec", CORBA::TypeCode::PR_long_tc()}, {"tv_usec", CORBA::TypeCode::PR_long_tc()}, {"tv_nsec", CORBA::TypeCode::PR_long_tc()} }; #ifdef _0RL_tc_Tango_mTimeVal # undef _0RL_tc_Tango_mTimeVal #endif static CORBA::TypeCode_ptr _0RL_tc_Tango_mTimeVal = CORBA::TypeCode::PR_struct_tc("IDL:Tango/TimeVal:1.0", "TimeVal", _0RL_structmember_Tango_mTimeVal, 3, &_0RL_tcTrack); #if defined(HAS_Cplusplus_Namespace) && defined(_MSC_VER) // MSVC++ does not give the constant external linkage otherwise. namespace Tango { const ::CORBA::TypeCode_ptr _tc_TimeVal = _0RL_tc_Tango_mTimeVal; } #else const ::CORBA::TypeCode_ptr Tango::_tc_TimeVal = _0RL_tc_Tango_mTimeVal; #endif static CORBA::PR_structMember _0RL_structmember_Tango_mDevCmdInfo[] = { {"cmd_name", CORBA::TypeCode::PR_string_tc(0, &_0RL_tcTrack)}, {"cmd_tag", CORBA::TypeCode::PR_long_tc()}, {"in_type", CORBA::TypeCode::PR_long_tc()}, {"out_type", CORBA::TypeCode::PR_long_tc()}, {"in_type_desc", CORBA::TypeCode::PR_string_tc(0, &_0RL_tcTrack)}, {"out_type_desc", CORBA::TypeCode::PR_string_tc(0, &_0RL_tcTrack)} }; #ifdef _0RL_tc_Tango_mDevCmdInfo # undef _0RL_tc_Tango_mDevCmdInfo #endif static CORBA::TypeCode_ptr _0RL_tc_Tango_mDevCmdInfo = CORBA::TypeCode::PR_struct_tc("IDL:Tango/DevCmdInfo:1.0", "DevCmdInfo", _0RL_structmember_Tango_mDevCmdInfo, 6, &_0RL_tcTrack); #if defined(HAS_Cplusplus_Namespace) && defined(_MSC_VER) // MSVC++ does not give the constant external linkage otherwise. namespace Tango { const ::CORBA::TypeCode_ptr _tc_DevCmdInfo = _0RL_tc_Tango_mDevCmdInfo; } #else const ::CORBA::TypeCode_ptr Tango::_tc_DevCmdInfo = _0RL_tc_Tango_mDevCmdInfo; #endif static CORBA::PR_structMember _0RL_structmember_Tango_mDevCmdInfo__2[] = { {"cmd_name", CORBA::TypeCode::PR_string_tc(0, &_0RL_tcTrack)}, {"level", _0RL_tc_Tango_mDispLevel}, {"cmd_tag", CORBA::TypeCode::PR_long_tc()}, {"in_type", CORBA::TypeCode::PR_long_tc()}, {"out_type", CORBA::TypeCode::PR_long_tc()}, {"in_type_desc", CORBA::TypeCode::PR_string_tc(0, &_0RL_tcTrack)}, {"out_type_desc", CORBA::TypeCode::PR_string_tc(0, &_0RL_tcTrack)} }; #ifdef _0RL_tc_Tango_mDevCmdInfo__2 # undef _0RL_tc_Tango_mDevCmdInfo__2 #endif static CORBA::TypeCode_ptr _0RL_tc_Tango_mDevCmdInfo__2 = CORBA::TypeCode::PR_struct_tc("IDL:Tango/DevCmdInfo_2:1.0", "DevCmdInfo_2", _0RL_structmember_Tango_mDevCmdInfo__2, 7, &_0RL_tcTrack); #if defined(HAS_Cplusplus_Namespace) && defined(_MSC_VER) // MSVC++ does not give the constant external linkage otherwise. namespace Tango { const ::CORBA::TypeCode_ptr _tc_DevCmdInfo_2 = _0RL_tc_Tango_mDevCmdInfo__2; } #else const ::CORBA::TypeCode_ptr Tango::_tc_DevCmdInfo_2 = _0RL_tc_Tango_mDevCmdInfo__2; #endif static CORBA::TypeCode_ptr _0RL_tc_Tango_mDevCmdInfoList = CORBA::TypeCode::PR_alias_tc("IDL:Tango/DevCmdInfoList:1.0", "DevCmdInfoList", CORBA::TypeCode::PR_sequence_tc(0, _0RL_tc_Tango_mDevCmdInfo, &_0RL_tcTrack), &_0RL_tcTrack); #if defined(HAS_Cplusplus_Namespace) && defined(_MSC_VER) // MSVC++ does not give the constant external linkage otherwise. namespace Tango { const ::CORBA::TypeCode_ptr _tc_DevCmdInfoList = _0RL_tc_Tango_mDevCmdInfoList; } #else const ::CORBA::TypeCode_ptr Tango::_tc_DevCmdInfoList = _0RL_tc_Tango_mDevCmdInfoList; #endif static CORBA::TypeCode_ptr _0RL_tc_Tango_mDevCmdInfoList__2 = CORBA::TypeCode::PR_alias_tc("IDL:Tango/DevCmdInfoList_2:1.0", "DevCmdInfoList_2", CORBA::TypeCode::PR_sequence_tc(0, _0RL_tc_Tango_mDevCmdInfo__2, &_0RL_tcTrack), &_0RL_tcTrack); #if defined(HAS_Cplusplus_Namespace) && defined(_MSC_VER) // MSVC++ does not give the constant external linkage otherwise. namespace Tango { const ::CORBA::TypeCode_ptr _tc_DevCmdInfoList_2 = _0RL_tc_Tango_mDevCmdInfoList__2; } #else const ::CORBA::TypeCode_ptr Tango::_tc_DevCmdInfoList_2 = _0RL_tc_Tango_mDevCmdInfoList__2; #endif static CORBA::PR_structMember _0RL_structmember_Tango_mDevError[] = { {"reason", CORBA::TypeCode::PR_string_tc(0, &_0RL_tcTrack)}, {"severity", _0RL_tc_Tango_mErrSeverity}, {"desc", CORBA::TypeCode::PR_string_tc(0, &_0RL_tcTrack)}, {"origin", CORBA::TypeCode::PR_string_tc(0, &_0RL_tcTrack)} }; #ifdef _0RL_tc_Tango_mDevError # undef _0RL_tc_Tango_mDevError #endif static CORBA::TypeCode_ptr _0RL_tc_Tango_mDevError = CORBA::TypeCode::PR_struct_tc("IDL:Tango/DevError:1.0", "DevError", _0RL_structmember_Tango_mDevError, 4, &_0RL_tcTrack); #if defined(HAS_Cplusplus_Namespace) && defined(_MSC_VER) // MSVC++ does not give the constant external linkage otherwise. namespace Tango { const ::CORBA::TypeCode_ptr _tc_DevError = _0RL_tc_Tango_mDevError; } #else const ::CORBA::TypeCode_ptr Tango::_tc_DevError = _0RL_tc_Tango_mDevError; #endif static CORBA::TypeCode_ptr _0RL_tc_Tango_mDevErrorList = CORBA::TypeCode::PR_alias_tc("IDL:Tango/DevErrorList:1.0", "DevErrorList", CORBA::TypeCode::PR_sequence_tc(0, _0RL_tc_Tango_mDevError, &_0RL_tcTrack), &_0RL_tcTrack); #if defined(HAS_Cplusplus_Namespace) && defined(_MSC_VER) // MSVC++ does not give the constant external linkage otherwise. namespace Tango { const ::CORBA::TypeCode_ptr _tc_DevErrorList = _0RL_tc_Tango_mDevErrorList; } #else const ::CORBA::TypeCode_ptr Tango::_tc_DevErrorList = _0RL_tc_Tango_mDevErrorList; #endif static CORBA::PR_structMember _0RL_structmember_Tango_mNamedDevError[] = { {"name", CORBA::TypeCode::PR_string_tc(0, &_0RL_tcTrack)}, {"index_in_call", CORBA::TypeCode::PR_long_tc()}, {"err_list", _0RL_tc_Tango_mDevErrorList} }; #ifdef _0RL_tc_Tango_mNamedDevError # undef _0RL_tc_Tango_mNamedDevError #endif static CORBA::TypeCode_ptr _0RL_tc_Tango_mNamedDevError = CORBA::TypeCode::PR_struct_tc("IDL:Tango/NamedDevError:1.0", "NamedDevError", _0RL_structmember_Tango_mNamedDevError, 3, &_0RL_tcTrack); #if defined(HAS_Cplusplus_Namespace) && defined(_MSC_VER) // MSVC++ does not give the constant external linkage otherwise. namespace Tango { const ::CORBA::TypeCode_ptr _tc_NamedDevError = _0RL_tc_Tango_mNamedDevError; } #else const ::CORBA::TypeCode_ptr Tango::_tc_NamedDevError = _0RL_tc_Tango_mNamedDevError; #endif static CORBA::TypeCode_ptr _0RL_tc_Tango_mNamedDevErrorList = CORBA::TypeCode::PR_alias_tc("IDL:Tango/NamedDevErrorList:1.0", "NamedDevErrorList", CORBA::TypeCode::PR_sequence_tc(0, _0RL_tc_Tango_mNamedDevError, &_0RL_tcTrack), &_0RL_tcTrack); #if defined(HAS_Cplusplus_Namespace) && defined(_MSC_VER) // MSVC++ does not give the constant external linkage otherwise. namespace Tango { const ::CORBA::TypeCode_ptr _tc_NamedDevErrorList = _0RL_tc_Tango_mNamedDevErrorList; } #else const ::CORBA::TypeCode_ptr Tango::_tc_NamedDevErrorList = _0RL_tc_Tango_mNamedDevErrorList; #endif static CORBA::PR_structMember _0RL_structmember_Tango_mDevFailed[] = { {"errors", _0RL_tc_Tango_mDevErrorList} }; static CORBA::TypeCode_ptr _0RL_tc_Tango_mDevFailed = CORBA::TypeCode::PR_exception_tc("IDL:Tango/DevFailed:1.0", "DevFailed", _0RL_structmember_Tango_mDevFailed, 1, &_0RL_tcTrack); #if defined(HAS_Cplusplus_Namespace) && defined(_MSC_VER) // MSVC++ does not give the constant external linkage otherwise. namespace Tango { const ::CORBA::TypeCode_ptr _tc_DevFailed = _0RL_tc_Tango_mDevFailed; } #else const ::CORBA::TypeCode_ptr Tango::_tc_DevFailed = _0RL_tc_Tango_mDevFailed; #endif static CORBA::PR_structMember _0RL_structmember_Tango_mMultiDevFailed[] = { {"errors", _0RL_tc_Tango_mNamedDevErrorList} }; static CORBA::TypeCode_ptr _0RL_tc_Tango_mMultiDevFailed = CORBA::TypeCode::PR_exception_tc("IDL:Tango/MultiDevFailed:1.0", "MultiDevFailed", _0RL_structmember_Tango_mMultiDevFailed, 1, &_0RL_tcTrack); #if defined(HAS_Cplusplus_Namespace) && defined(_MSC_VER) // MSVC++ does not give the constant external linkage otherwise. namespace Tango { const ::CORBA::TypeCode_ptr _tc_MultiDevFailed = _0RL_tc_Tango_mMultiDevFailed; } #else const ::CORBA::TypeCode_ptr Tango::_tc_MultiDevFailed = _0RL_tc_Tango_mMultiDevFailed; #endif static CORBA::PR_structMember _0RL_structmember_Tango_mAttributeConfig[] = { {"name", CORBA::TypeCode::PR_string_tc(0, &_0RL_tcTrack)}, {"writable", _0RL_tc_Tango_mAttrWriteType}, {"data_format", _0RL_tc_Tango_mAttrDataFormat}, {"data_type", CORBA::TypeCode::PR_long_tc()}, {"max_dim_x", CORBA::TypeCode::PR_long_tc()}, {"max_dim_y", CORBA::TypeCode::PR_long_tc()}, {"description", CORBA::TypeCode::PR_string_tc(0, &_0RL_tcTrack)}, {"label", CORBA::TypeCode::PR_string_tc(0, &_0RL_tcTrack)}, {"unit", CORBA::TypeCode::PR_string_tc(0, &_0RL_tcTrack)}, {"standard_unit", CORBA::TypeCode::PR_string_tc(0, &_0RL_tcTrack)}, {"display_unit", CORBA::TypeCode::PR_string_tc(0, &_0RL_tcTrack)}, {"format", CORBA::TypeCode::PR_string_tc(0, &_0RL_tcTrack)}, {"min_value", CORBA::TypeCode::PR_string_tc(0, &_0RL_tcTrack)}, {"max_value", CORBA::TypeCode::PR_string_tc(0, &_0RL_tcTrack)}, {"min_alarm", CORBA::TypeCode::PR_string_tc(0, &_0RL_tcTrack)}, {"max_alarm", CORBA::TypeCode::PR_string_tc(0, &_0RL_tcTrack)}, {"writable_attr_name", CORBA::TypeCode::PR_string_tc(0, &_0RL_tcTrack)}, {"extensions", _0RL_tc_Tango_mDevVarStringArray} }; #ifdef _0RL_tc_Tango_mAttributeConfig # undef _0RL_tc_Tango_mAttributeConfig #endif static CORBA::TypeCode_ptr _0RL_tc_Tango_mAttributeConfig = CORBA::TypeCode::PR_struct_tc("IDL:Tango/AttributeConfig:1.0", "AttributeConfig", _0RL_structmember_Tango_mAttributeConfig, 18, &_0RL_tcTrack); #if defined(HAS_Cplusplus_Namespace) && defined(_MSC_VER) // MSVC++ does not give the constant external linkage otherwise. namespace Tango { const ::CORBA::TypeCode_ptr _tc_AttributeConfig = _0RL_tc_Tango_mAttributeConfig; } #else const ::CORBA::TypeCode_ptr Tango::_tc_AttributeConfig = _0RL_tc_Tango_mAttributeConfig; #endif static CORBA::PR_structMember _0RL_structmember_Tango_mAttributeConfig__2[] = { {"name", CORBA::TypeCode::PR_string_tc(0, &_0RL_tcTrack)}, {"writable", _0RL_tc_Tango_mAttrWriteType}, {"data_format", _0RL_tc_Tango_mAttrDataFormat}, {"data_type", CORBA::TypeCode::PR_long_tc()}, {"max_dim_x", CORBA::TypeCode::PR_long_tc()}, {"max_dim_y", CORBA::TypeCode::PR_long_tc()}, {"description", CORBA::TypeCode::PR_string_tc(0, &_0RL_tcTrack)}, {"label", CORBA::TypeCode::PR_string_tc(0, &_0RL_tcTrack)}, {"unit", CORBA::TypeCode::PR_string_tc(0, &_0RL_tcTrack)}, {"standard_unit", CORBA::TypeCode::PR_string_tc(0, &_0RL_tcTrack)}, {"display_unit", CORBA::TypeCode::PR_string_tc(0, &_0RL_tcTrack)}, {"format", CORBA::TypeCode::PR_string_tc(0, &_0RL_tcTrack)}, {"min_value", CORBA::TypeCode::PR_string_tc(0, &_0RL_tcTrack)}, {"max_value", CORBA::TypeCode::PR_string_tc(0, &_0RL_tcTrack)}, {"min_alarm", CORBA::TypeCode::PR_string_tc(0, &_0RL_tcTrack)}, {"max_alarm", CORBA::TypeCode::PR_string_tc(0, &_0RL_tcTrack)}, {"writable_attr_name", CORBA::TypeCode::PR_string_tc(0, &_0RL_tcTrack)}, {"level", _0RL_tc_Tango_mDispLevel}, {"extensions", _0RL_tc_Tango_mDevVarStringArray} }; #ifdef _0RL_tc_Tango_mAttributeConfig__2 # undef _0RL_tc_Tango_mAttributeConfig__2 #endif static CORBA::TypeCode_ptr _0RL_tc_Tango_mAttributeConfig__2 = CORBA::TypeCode::PR_struct_tc("IDL:Tango/AttributeConfig_2:1.0", "AttributeConfig_2", _0RL_structmember_Tango_mAttributeConfig__2, 19, &_0RL_tcTrack); #if defined(HAS_Cplusplus_Namespace) && defined(_MSC_VER) // MSVC++ does not give the constant external linkage otherwise. namespace Tango { const ::CORBA::TypeCode_ptr _tc_AttributeConfig_2 = _0RL_tc_Tango_mAttributeConfig__2; } #else const ::CORBA::TypeCode_ptr Tango::_tc_AttributeConfig_2 = _0RL_tc_Tango_mAttributeConfig__2; #endif static CORBA::PR_structMember _0RL_structmember_Tango_mAttributeValue[] = { {"value", CORBA::TypeCode::PR_any_tc()}, {"quality", _0RL_tc_Tango_mAttrQuality}, {"time", _0RL_tc_Tango_mTimeVal}, {"name", CORBA::TypeCode::PR_string_tc(0, &_0RL_tcTrack)}, {"dim_x", CORBA::TypeCode::PR_long_tc()}, {"dim_y", CORBA::TypeCode::PR_long_tc()} }; #ifdef _0RL_tc_Tango_mAttributeValue # undef _0RL_tc_Tango_mAttributeValue #endif static CORBA::TypeCode_ptr _0RL_tc_Tango_mAttributeValue = CORBA::TypeCode::PR_struct_tc("IDL:Tango/AttributeValue:1.0", "AttributeValue", _0RL_structmember_Tango_mAttributeValue, 6, &_0RL_tcTrack); #if defined(HAS_Cplusplus_Namespace) && defined(_MSC_VER) // MSVC++ does not give the constant external linkage otherwise. namespace Tango { const ::CORBA::TypeCode_ptr _tc_AttributeValue = _0RL_tc_Tango_mAttributeValue; } #else const ::CORBA::TypeCode_ptr Tango::_tc_AttributeValue = _0RL_tc_Tango_mAttributeValue; #endif static CORBA::PR_structMember _0RL_structmember_Tango_mAttributeDim[] = { {"dim_x", CORBA::TypeCode::PR_long_tc()}, {"dim_y", CORBA::TypeCode::PR_long_tc()} }; #ifdef _0RL_tc_Tango_mAttributeDim # undef _0RL_tc_Tango_mAttributeDim #endif static CORBA::TypeCode_ptr _0RL_tc_Tango_mAttributeDim = CORBA::TypeCode::PR_struct_tc("IDL:Tango/AttributeDim:1.0", "AttributeDim", _0RL_structmember_Tango_mAttributeDim, 2, &_0RL_tcTrack); #if defined(HAS_Cplusplus_Namespace) && defined(_MSC_VER) // MSVC++ does not give the constant external linkage otherwise. namespace Tango { const ::CORBA::TypeCode_ptr _tc_AttributeDim = _0RL_tc_Tango_mAttributeDim; } #else const ::CORBA::TypeCode_ptr Tango::_tc_AttributeDim = _0RL_tc_Tango_mAttributeDim; #endif static CORBA::PR_structMember _0RL_structmember_Tango_mAttributeValue__3[] = { {"value", CORBA::TypeCode::PR_any_tc()}, {"quality", _0RL_tc_Tango_mAttrQuality}, {"time", _0RL_tc_Tango_mTimeVal}, {"name", CORBA::TypeCode::PR_string_tc(0, &_0RL_tcTrack)}, {"r_dim", _0RL_tc_Tango_mAttributeDim}, {"w_dim", _0RL_tc_Tango_mAttributeDim}, {"err_list", _0RL_tc_Tango_mDevErrorList} }; #ifdef _0RL_tc_Tango_mAttributeValue__3 # undef _0RL_tc_Tango_mAttributeValue__3 #endif static CORBA::TypeCode_ptr _0RL_tc_Tango_mAttributeValue__3 = CORBA::TypeCode::PR_struct_tc("IDL:Tango/AttributeValue_3:1.0", "AttributeValue_3", _0RL_structmember_Tango_mAttributeValue__3, 7, &_0RL_tcTrack); #if defined(HAS_Cplusplus_Namespace) && defined(_MSC_VER) // MSVC++ does not give the constant external linkage otherwise. namespace Tango { const ::CORBA::TypeCode_ptr _tc_AttributeValue_3 = _0RL_tc_Tango_mAttributeValue__3; } #else const ::CORBA::TypeCode_ptr Tango::_tc_AttributeValue_3 = _0RL_tc_Tango_mAttributeValue__3; #endif static const char* _0RL_enumMember_Tango_mAttributeDataType[] = { "ATT_BOOL", "ATT_SHORT", "ATT_LONG", "ATT_LONG64", "ATT_FLOAT", "ATT_DOUBLE", "ATT_UCHAR", "ATT_USHORT", "ATT_ULONG", "ATT_ULONG64", "ATT_STRING", "ATT_STATE", "DEVICE_STATE", "ATT_ENCODED", "NO_DATA" }; static CORBA::TypeCode_ptr _0RL_tc_Tango_mAttributeDataType = CORBA::TypeCode::PR_enum_tc("IDL:Tango/AttributeDataType:1.0", "AttributeDataType", _0RL_enumMember_Tango_mAttributeDataType, 15, &_0RL_tcTrack); #if defined(HAS_Cplusplus_Namespace) && defined(_MSC_VER) // MSVC++ does not give the constant external linkage otherwise. namespace Tango { const ::CORBA::TypeCode_ptr _tc_AttributeDataType = _0RL_tc_Tango_mAttributeDataType; } #else const ::CORBA::TypeCode_ptr Tango::_tc_AttributeDataType = _0RL_tc_Tango_mAttributeDataType; #endif static CORBA::PR_unionMember _0RL_unionMember_Tango_mAttrValUnion[] = { {"bool_att_value", _0RL_tc_Tango_mDevVarBooleanArray, Tango::ATT_BOOL}, {"short_att_value", _0RL_tc_Tango_mDevVarShortArray, Tango::ATT_SHORT}, {"long_att_value", _0RL_tc_Tango_mDevVarLongArray, Tango::ATT_LONG}, {"long64_att_value", _0RL_tc_Tango_mDevVarLong64Array, Tango::ATT_LONG64}, {"float_att_value", _0RL_tc_Tango_mDevVarFloatArray, Tango::ATT_FLOAT}, {"double_att_value", _0RL_tc_Tango_mDevVarDoubleArray, Tango::ATT_DOUBLE}, {"uchar_att_value", _0RL_tc_Tango_mDevVarCharArray, Tango::ATT_UCHAR}, {"ushort_att_value", _0RL_tc_Tango_mDevVarUShortArray, Tango::ATT_USHORT}, {"ulong_att_value", _0RL_tc_Tango_mDevVarULongArray, Tango::ATT_ULONG}, {"ulong64_att_value", _0RL_tc_Tango_mDevVarULong64Array, Tango::ATT_ULONG64}, {"string_att_value", _0RL_tc_Tango_mDevVarStringArray, Tango::ATT_STRING}, {"state_att_value", _0RL_tc_Tango_mDevVarStateArray, Tango::ATT_STATE}, {"dev_state_att", _0RL_tc_Tango_mDevState, Tango::DEVICE_STATE}, {"encoded_att_value", _0RL_tc_Tango_mDevVarEncodedArray, Tango::ATT_ENCODED}, {"union_no_data", _0RL_tc_Tango_mDevBoolean, Tango::NO_DATA} }; #ifdef _0RL_tc_Tango_mAttrValUnion # undef _0RL_tc_Tango_mAttrValUnion #endif static CORBA::TypeCode_ptr _0RL_tc_Tango_mAttrValUnion = CORBA::TypeCode::PR_union_tc("IDL:Tango/AttrValUnion:1.0", "AttrValUnion", _0RL_tc_Tango_mAttributeDataType, _0RL_unionMember_Tango_mAttrValUnion, 15, -1, &_0RL_tcTrack); #if defined(HAS_Cplusplus_Namespace) && defined(_MSC_VER) // MSVC++ does not give the constant external linkage otherwise. namespace Tango { const ::CORBA::TypeCode_ptr _tc_AttrValUnion = _0RL_tc_Tango_mAttrValUnion; } #else const ::CORBA::TypeCode_ptr Tango::_tc_AttrValUnion = _0RL_tc_Tango_mAttrValUnion; #endif static CORBA::PR_structMember _0RL_structmember_Tango_mAttributeValue__4[] = { {"value", _0RL_tc_Tango_mAttrValUnion}, {"quality", _0RL_tc_Tango_mAttrQuality}, {"data_format", _0RL_tc_Tango_mAttrDataFormat}, {"time", _0RL_tc_Tango_mTimeVal}, {"name", CORBA::TypeCode::PR_string_tc(0, &_0RL_tcTrack)}, {"r_dim", _0RL_tc_Tango_mAttributeDim}, {"w_dim", _0RL_tc_Tango_mAttributeDim}, {"err_list", _0RL_tc_Tango_mDevErrorList} }; #ifdef _0RL_tc_Tango_mAttributeValue__4 # undef _0RL_tc_Tango_mAttributeValue__4 #endif static CORBA::TypeCode_ptr _0RL_tc_Tango_mAttributeValue__4 = CORBA::TypeCode::PR_struct_tc("IDL:Tango/AttributeValue_4:1.0", "AttributeValue_4", _0RL_structmember_Tango_mAttributeValue__4, 8, &_0RL_tcTrack); #if defined(HAS_Cplusplus_Namespace) && defined(_MSC_VER) // MSVC++ does not give the constant external linkage otherwise. namespace Tango { const ::CORBA::TypeCode_ptr _tc_AttributeValue_4 = _0RL_tc_Tango_mAttributeValue__4; } #else const ::CORBA::TypeCode_ptr Tango::_tc_AttributeValue_4 = _0RL_tc_Tango_mAttributeValue__4; #endif static CORBA::PR_structMember _0RL_structmember_Tango_mChangeEventProp[] = { {"rel_change", CORBA::TypeCode::PR_string_tc(0, &_0RL_tcTrack)}, {"abs_change", CORBA::TypeCode::PR_string_tc(0, &_0RL_tcTrack)}, {"extensions", _0RL_tc_Tango_mDevVarStringArray} }; #ifdef _0RL_tc_Tango_mChangeEventProp # undef _0RL_tc_Tango_mChangeEventProp #endif static CORBA::TypeCode_ptr _0RL_tc_Tango_mChangeEventProp = CORBA::TypeCode::PR_struct_tc("IDL:Tango/ChangeEventProp:1.0", "ChangeEventProp", _0RL_structmember_Tango_mChangeEventProp, 3, &_0RL_tcTrack); #if defined(HAS_Cplusplus_Namespace) && defined(_MSC_VER) // MSVC++ does not give the constant external linkage otherwise. namespace Tango { const ::CORBA::TypeCode_ptr _tc_ChangeEventProp = _0RL_tc_Tango_mChangeEventProp; } #else const ::CORBA::TypeCode_ptr Tango::_tc_ChangeEventProp = _0RL_tc_Tango_mChangeEventProp; #endif static CORBA::PR_structMember _0RL_structmember_Tango_mPeriodicEventProp[] = { {"period", CORBA::TypeCode::PR_string_tc(0, &_0RL_tcTrack)}, {"extensions", _0RL_tc_Tango_mDevVarStringArray} }; #ifdef _0RL_tc_Tango_mPeriodicEventProp # undef _0RL_tc_Tango_mPeriodicEventProp #endif static CORBA::TypeCode_ptr _0RL_tc_Tango_mPeriodicEventProp = CORBA::TypeCode::PR_struct_tc("IDL:Tango/PeriodicEventProp:1.0", "PeriodicEventProp", _0RL_structmember_Tango_mPeriodicEventProp, 2, &_0RL_tcTrack); #if defined(HAS_Cplusplus_Namespace) && defined(_MSC_VER) // MSVC++ does not give the constant external linkage otherwise. namespace Tango { const ::CORBA::TypeCode_ptr _tc_PeriodicEventProp = _0RL_tc_Tango_mPeriodicEventProp; } #else const ::CORBA::TypeCode_ptr Tango::_tc_PeriodicEventProp = _0RL_tc_Tango_mPeriodicEventProp; #endif static CORBA::PR_structMember _0RL_structmember_Tango_mArchiveEventProp[] = { {"rel_change", CORBA::TypeCode::PR_string_tc(0, &_0RL_tcTrack)}, {"abs_change", CORBA::TypeCode::PR_string_tc(0, &_0RL_tcTrack)}, {"period", CORBA::TypeCode::PR_string_tc(0, &_0RL_tcTrack)}, {"extensions", _0RL_tc_Tango_mDevVarStringArray} }; #ifdef _0RL_tc_Tango_mArchiveEventProp # undef _0RL_tc_Tango_mArchiveEventProp #endif static CORBA::TypeCode_ptr _0RL_tc_Tango_mArchiveEventProp = CORBA::TypeCode::PR_struct_tc("IDL:Tango/ArchiveEventProp:1.0", "ArchiveEventProp", _0RL_structmember_Tango_mArchiveEventProp, 4, &_0RL_tcTrack); #if defined(HAS_Cplusplus_Namespace) && defined(_MSC_VER) // MSVC++ does not give the constant external linkage otherwise. namespace Tango { const ::CORBA::TypeCode_ptr _tc_ArchiveEventProp = _0RL_tc_Tango_mArchiveEventProp; } #else const ::CORBA::TypeCode_ptr Tango::_tc_ArchiveEventProp = _0RL_tc_Tango_mArchiveEventProp; #endif static CORBA::PR_structMember _0RL_structmember_Tango_mEventProperties[] = { {"ch_event", _0RL_tc_Tango_mChangeEventProp}, {"per_event", _0RL_tc_Tango_mPeriodicEventProp}, {"arch_event", _0RL_tc_Tango_mArchiveEventProp} }; #ifdef _0RL_tc_Tango_mEventProperties # undef _0RL_tc_Tango_mEventProperties #endif static CORBA::TypeCode_ptr _0RL_tc_Tango_mEventProperties = CORBA::TypeCode::PR_struct_tc("IDL:Tango/EventProperties:1.0", "EventProperties", _0RL_structmember_Tango_mEventProperties, 3, &_0RL_tcTrack); #if defined(HAS_Cplusplus_Namespace) && defined(_MSC_VER) // MSVC++ does not give the constant external linkage otherwise. namespace Tango { const ::CORBA::TypeCode_ptr _tc_EventProperties = _0RL_tc_Tango_mEventProperties; } #else const ::CORBA::TypeCode_ptr Tango::_tc_EventProperties = _0RL_tc_Tango_mEventProperties; #endif static CORBA::PR_structMember _0RL_structmember_Tango_mAttributeAlarm[] = { {"min_alarm", CORBA::TypeCode::PR_string_tc(0, &_0RL_tcTrack)}, {"max_alarm", CORBA::TypeCode::PR_string_tc(0, &_0RL_tcTrack)}, {"min_warning", CORBA::TypeCode::PR_string_tc(0, &_0RL_tcTrack)}, {"max_warning", CORBA::TypeCode::PR_string_tc(0, &_0RL_tcTrack)}, {"delta_t", CORBA::TypeCode::PR_string_tc(0, &_0RL_tcTrack)}, {"delta_val", CORBA::TypeCode::PR_string_tc(0, &_0RL_tcTrack)}, {"extensions", _0RL_tc_Tango_mDevVarStringArray} }; #ifdef _0RL_tc_Tango_mAttributeAlarm # undef _0RL_tc_Tango_mAttributeAlarm #endif static CORBA::TypeCode_ptr _0RL_tc_Tango_mAttributeAlarm = CORBA::TypeCode::PR_struct_tc("IDL:Tango/AttributeAlarm:1.0", "AttributeAlarm", _0RL_structmember_Tango_mAttributeAlarm, 7, &_0RL_tcTrack); #if defined(HAS_Cplusplus_Namespace) && defined(_MSC_VER) // MSVC++ does not give the constant external linkage otherwise. namespace Tango { const ::CORBA::TypeCode_ptr _tc_AttributeAlarm = _0RL_tc_Tango_mAttributeAlarm; } #else const ::CORBA::TypeCode_ptr Tango::_tc_AttributeAlarm = _0RL_tc_Tango_mAttributeAlarm; #endif static CORBA::PR_structMember _0RL_structmember_Tango_mAttributeConfig__3[] = { {"name", CORBA::TypeCode::PR_string_tc(0, &_0RL_tcTrack)}, {"writable", _0RL_tc_Tango_mAttrWriteType}, {"data_format", _0RL_tc_Tango_mAttrDataFormat}, {"data_type", CORBA::TypeCode::PR_long_tc()}, {"max_dim_x", CORBA::TypeCode::PR_long_tc()}, {"max_dim_y", CORBA::TypeCode::PR_long_tc()}, {"description", CORBA::TypeCode::PR_string_tc(0, &_0RL_tcTrack)}, {"label", CORBA::TypeCode::PR_string_tc(0, &_0RL_tcTrack)}, {"unit", CORBA::TypeCode::PR_string_tc(0, &_0RL_tcTrack)}, {"standard_unit", CORBA::TypeCode::PR_string_tc(0, &_0RL_tcTrack)}, {"display_unit", CORBA::TypeCode::PR_string_tc(0, &_0RL_tcTrack)}, {"format", CORBA::TypeCode::PR_string_tc(0, &_0RL_tcTrack)}, {"min_value", CORBA::TypeCode::PR_string_tc(0, &_0RL_tcTrack)}, {"max_value", CORBA::TypeCode::PR_string_tc(0, &_0RL_tcTrack)}, {"writable_attr_name", CORBA::TypeCode::PR_string_tc(0, &_0RL_tcTrack)}, {"level", _0RL_tc_Tango_mDispLevel}, {"att_alarm", _0RL_tc_Tango_mAttributeAlarm}, {"event_prop", _0RL_tc_Tango_mEventProperties}, {"extensions", _0RL_tc_Tango_mDevVarStringArray}, {"sys_extensions", _0RL_tc_Tango_mDevVarStringArray} }; #ifdef _0RL_tc_Tango_mAttributeConfig__3 # undef _0RL_tc_Tango_mAttributeConfig__3 #endif static CORBA::TypeCode_ptr _0RL_tc_Tango_mAttributeConfig__3 = CORBA::TypeCode::PR_struct_tc("IDL:Tango/AttributeConfig_3:1.0", "AttributeConfig_3", _0RL_structmember_Tango_mAttributeConfig__3, 20, &_0RL_tcTrack); #if defined(HAS_Cplusplus_Namespace) && defined(_MSC_VER) // MSVC++ does not give the constant external linkage otherwise. namespace Tango { const ::CORBA::TypeCode_ptr _tc_AttributeConfig_3 = _0RL_tc_Tango_mAttributeConfig__3; } #else const ::CORBA::TypeCode_ptr Tango::_tc_AttributeConfig_3 = _0RL_tc_Tango_mAttributeConfig__3; #endif static CORBA::TypeCode_ptr _0RL_tc_Tango_mAttributeConfigList = CORBA::TypeCode::PR_alias_tc("IDL:Tango/AttributeConfigList:1.0", "AttributeConfigList", CORBA::TypeCode::PR_sequence_tc(0, _0RL_tc_Tango_mAttributeConfig, &_0RL_tcTrack), &_0RL_tcTrack); #if defined(HAS_Cplusplus_Namespace) && defined(_MSC_VER) // MSVC++ does not give the constant external linkage otherwise. namespace Tango { const ::CORBA::TypeCode_ptr _tc_AttributeConfigList = _0RL_tc_Tango_mAttributeConfigList; } #else const ::CORBA::TypeCode_ptr Tango::_tc_AttributeConfigList = _0RL_tc_Tango_mAttributeConfigList; #endif static CORBA::TypeCode_ptr _0RL_tc_Tango_mAttributeConfigList__2 = CORBA::TypeCode::PR_alias_tc("IDL:Tango/AttributeConfigList_2:1.0", "AttributeConfigList_2", CORBA::TypeCode::PR_sequence_tc(0, _0RL_tc_Tango_mAttributeConfig__2, &_0RL_tcTrack), &_0RL_tcTrack); #if defined(HAS_Cplusplus_Namespace) && defined(_MSC_VER) // MSVC++ does not give the constant external linkage otherwise. namespace Tango { const ::CORBA::TypeCode_ptr _tc_AttributeConfigList_2 = _0RL_tc_Tango_mAttributeConfigList__2; } #else const ::CORBA::TypeCode_ptr Tango::_tc_AttributeConfigList_2 = _0RL_tc_Tango_mAttributeConfigList__2; #endif static CORBA::TypeCode_ptr _0RL_tc_Tango_mAttributeConfigList__3 = CORBA::TypeCode::PR_alias_tc("IDL:Tango/AttributeConfigList_3:1.0", "AttributeConfigList_3", CORBA::TypeCode::PR_sequence_tc(0, _0RL_tc_Tango_mAttributeConfig__3, &_0RL_tcTrack), &_0RL_tcTrack); #if defined(HAS_Cplusplus_Namespace) && defined(_MSC_VER) // MSVC++ does not give the constant external linkage otherwise. namespace Tango { const ::CORBA::TypeCode_ptr _tc_AttributeConfigList_3 = _0RL_tc_Tango_mAttributeConfigList__3; } #else const ::CORBA::TypeCode_ptr Tango::_tc_AttributeConfigList_3 = _0RL_tc_Tango_mAttributeConfigList__3; #endif static CORBA::TypeCode_ptr _0RL_tc_Tango_mAttributeValueList = CORBA::TypeCode::PR_alias_tc("IDL:Tango/AttributeValueList:1.0", "AttributeValueList", CORBA::TypeCode::PR_sequence_tc(0, _0RL_tc_Tango_mAttributeValue, &_0RL_tcTrack), &_0RL_tcTrack); #if defined(HAS_Cplusplus_Namespace) && defined(_MSC_VER) // MSVC++ does not give the constant external linkage otherwise. namespace Tango { const ::CORBA::TypeCode_ptr _tc_AttributeValueList = _0RL_tc_Tango_mAttributeValueList; } #else const ::CORBA::TypeCode_ptr Tango::_tc_AttributeValueList = _0RL_tc_Tango_mAttributeValueList; #endif static CORBA::TypeCode_ptr _0RL_tc_Tango_mAttributeValueList__3 = CORBA::TypeCode::PR_alias_tc("IDL:Tango/AttributeValueList_3:1.0", "AttributeValueList_3", CORBA::TypeCode::PR_sequence_tc(0, _0RL_tc_Tango_mAttributeValue__3, &_0RL_tcTrack), &_0RL_tcTrack); #if defined(HAS_Cplusplus_Namespace) && defined(_MSC_VER) // MSVC++ does not give the constant external linkage otherwise. namespace Tango { const ::CORBA::TypeCode_ptr _tc_AttributeValueList_3 = _0RL_tc_Tango_mAttributeValueList__3; } #else const ::CORBA::TypeCode_ptr Tango::_tc_AttributeValueList_3 = _0RL_tc_Tango_mAttributeValueList__3; #endif static CORBA::TypeCode_ptr _0RL_tc_Tango_mAttributeValueList__4 = CORBA::TypeCode::PR_alias_tc("IDL:Tango/AttributeValueList_4:1.0", "AttributeValueList_4", CORBA::TypeCode::PR_sequence_tc(0, _0RL_tc_Tango_mAttributeValue__4, &_0RL_tcTrack), &_0RL_tcTrack); #if defined(HAS_Cplusplus_Namespace) && defined(_MSC_VER) // MSVC++ does not give the constant external linkage otherwise. namespace Tango { const ::CORBA::TypeCode_ptr _tc_AttributeValueList_4 = _0RL_tc_Tango_mAttributeValueList__4; } #else const ::CORBA::TypeCode_ptr Tango::_tc_AttributeValueList_4 = _0RL_tc_Tango_mAttributeValueList__4; #endif static CORBA::PR_structMember _0RL_structmember_Tango_mAttDataReady[] = { {"name", CORBA::TypeCode::PR_string_tc(0, &_0RL_tcTrack)}, {"data_type", CORBA::TypeCode::PR_long_tc()}, {"ctr", CORBA::TypeCode::PR_long_tc()} }; #ifdef _0RL_tc_Tango_mAttDataReady # undef _0RL_tc_Tango_mAttDataReady #endif static CORBA::TypeCode_ptr _0RL_tc_Tango_mAttDataReady = CORBA::TypeCode::PR_struct_tc("IDL:Tango/AttDataReady:1.0", "AttDataReady", _0RL_structmember_Tango_mAttDataReady, 3, &_0RL_tcTrack); #if defined(HAS_Cplusplus_Namespace) && defined(_MSC_VER) // MSVC++ does not give the constant external linkage otherwise. namespace Tango { const ::CORBA::TypeCode_ptr _tc_AttDataReady = _0RL_tc_Tango_mAttDataReady; } #else const ::CORBA::TypeCode_ptr Tango::_tc_AttDataReady = _0RL_tc_Tango_mAttDataReady; #endif static CORBA::PR_structMember _0RL_structmember_Tango_mDevInfo[] = { {"dev_class", CORBA::TypeCode::PR_string_tc(0, &_0RL_tcTrack)}, {"server_id", CORBA::TypeCode::PR_string_tc(0, &_0RL_tcTrack)}, {"server_host", CORBA::TypeCode::PR_string_tc(0, &_0RL_tcTrack)}, {"server_version", CORBA::TypeCode::PR_long_tc()}, {"doc_url", CORBA::TypeCode::PR_string_tc(0, &_0RL_tcTrack)} }; #ifdef _0RL_tc_Tango_mDevInfo # undef _0RL_tc_Tango_mDevInfo #endif static CORBA::TypeCode_ptr _0RL_tc_Tango_mDevInfo = CORBA::TypeCode::PR_struct_tc("IDL:Tango/DevInfo:1.0", "DevInfo", _0RL_structmember_Tango_mDevInfo, 5, &_0RL_tcTrack); #if defined(HAS_Cplusplus_Namespace) && defined(_MSC_VER) // MSVC++ does not give the constant external linkage otherwise. namespace Tango { const ::CORBA::TypeCode_ptr _tc_DevInfo = _0RL_tc_Tango_mDevInfo; } #else const ::CORBA::TypeCode_ptr Tango::_tc_DevInfo = _0RL_tc_Tango_mDevInfo; #endif static CORBA::PR_structMember _0RL_structmember_Tango_mDevInfo__3[] = { {"dev_class", CORBA::TypeCode::PR_string_tc(0, &_0RL_tcTrack)}, {"server_id", CORBA::TypeCode::PR_string_tc(0, &_0RL_tcTrack)}, {"server_host", CORBA::TypeCode::PR_string_tc(0, &_0RL_tcTrack)}, {"server_version", CORBA::TypeCode::PR_long_tc()}, {"doc_url", CORBA::TypeCode::PR_string_tc(0, &_0RL_tcTrack)}, {"dev_type", CORBA::TypeCode::PR_string_tc(0, &_0RL_tcTrack)} }; #ifdef _0RL_tc_Tango_mDevInfo__3 # undef _0RL_tc_Tango_mDevInfo__3 #endif static CORBA::TypeCode_ptr _0RL_tc_Tango_mDevInfo__3 = CORBA::TypeCode::PR_struct_tc("IDL:Tango/DevInfo_3:1.0", "DevInfo_3", _0RL_structmember_Tango_mDevInfo__3, 6, &_0RL_tcTrack); #if defined(HAS_Cplusplus_Namespace) && defined(_MSC_VER) // MSVC++ does not give the constant external linkage otherwise. namespace Tango { const ::CORBA::TypeCode_ptr _tc_DevInfo_3 = _0RL_tc_Tango_mDevInfo__3; } #else const ::CORBA::TypeCode_ptr Tango::_tc_DevInfo_3 = _0RL_tc_Tango_mDevInfo__3; #endif static CORBA::PR_structMember _0RL_structmember_Tango_mDevCmdHistory[] = { {"time", _0RL_tc_Tango_mTimeVal}, {"cmd_failed", CORBA::TypeCode::PR_boolean_tc()}, {"value", CORBA::TypeCode::PR_any_tc()}, {"errors", _0RL_tc_Tango_mDevErrorList} }; #ifdef _0RL_tc_Tango_mDevCmdHistory # undef _0RL_tc_Tango_mDevCmdHistory #endif static CORBA::TypeCode_ptr _0RL_tc_Tango_mDevCmdHistory = CORBA::TypeCode::PR_struct_tc("IDL:Tango/DevCmdHistory:1.0", "DevCmdHistory", _0RL_structmember_Tango_mDevCmdHistory, 4, &_0RL_tcTrack); #if defined(HAS_Cplusplus_Namespace) && defined(_MSC_VER) // MSVC++ does not give the constant external linkage otherwise. namespace Tango { const ::CORBA::TypeCode_ptr _tc_DevCmdHistory = _0RL_tc_Tango_mDevCmdHistory; } #else const ::CORBA::TypeCode_ptr Tango::_tc_DevCmdHistory = _0RL_tc_Tango_mDevCmdHistory; #endif static CORBA::TypeCode_ptr _0RL_tc_Tango_mDevCmdHistoryList = CORBA::TypeCode::PR_alias_tc("IDL:Tango/DevCmdHistoryList:1.0", "DevCmdHistoryList", CORBA::TypeCode::PR_sequence_tc(0, _0RL_tc_Tango_mDevCmdHistory, &_0RL_tcTrack), &_0RL_tcTrack); #if defined(HAS_Cplusplus_Namespace) && defined(_MSC_VER) // MSVC++ does not give the constant external linkage otherwise. namespace Tango { const ::CORBA::TypeCode_ptr _tc_DevCmdHistoryList = _0RL_tc_Tango_mDevCmdHistoryList; } #else const ::CORBA::TypeCode_ptr Tango::_tc_DevCmdHistoryList = _0RL_tc_Tango_mDevCmdHistoryList; #endif static CORBA::PR_structMember _0RL_structmember_Tango_mDevAttrHistory[] = { {"attr_failed", CORBA::TypeCode::PR_boolean_tc()}, {"value", _0RL_tc_Tango_mAttributeValue}, {"errors", _0RL_tc_Tango_mDevErrorList} }; #ifdef _0RL_tc_Tango_mDevAttrHistory # undef _0RL_tc_Tango_mDevAttrHistory #endif static CORBA::TypeCode_ptr _0RL_tc_Tango_mDevAttrHistory = CORBA::TypeCode::PR_struct_tc("IDL:Tango/DevAttrHistory:1.0", "DevAttrHistory", _0RL_structmember_Tango_mDevAttrHistory, 3, &_0RL_tcTrack); #if defined(HAS_Cplusplus_Namespace) && defined(_MSC_VER) // MSVC++ does not give the constant external linkage otherwise. namespace Tango { const ::CORBA::TypeCode_ptr _tc_DevAttrHistory = _0RL_tc_Tango_mDevAttrHistory; } #else const ::CORBA::TypeCode_ptr Tango::_tc_DevAttrHistory = _0RL_tc_Tango_mDevAttrHistory; #endif static CORBA::PR_structMember _0RL_structmember_Tango_mDevAttrHistory__3[] = { {"attr_failed", CORBA::TypeCode::PR_boolean_tc()}, {"value", _0RL_tc_Tango_mAttributeValue__3} }; #ifdef _0RL_tc_Tango_mDevAttrHistory__3 # undef _0RL_tc_Tango_mDevAttrHistory__3 #endif static CORBA::TypeCode_ptr _0RL_tc_Tango_mDevAttrHistory__3 = CORBA::TypeCode::PR_struct_tc("IDL:Tango/DevAttrHistory_3:1.0", "DevAttrHistory_3", _0RL_structmember_Tango_mDevAttrHistory__3, 2, &_0RL_tcTrack); #if defined(HAS_Cplusplus_Namespace) && defined(_MSC_VER) // MSVC++ does not give the constant external linkage otherwise. namespace Tango { const ::CORBA::TypeCode_ptr _tc_DevAttrHistory_3 = _0RL_tc_Tango_mDevAttrHistory__3; } #else const ::CORBA::TypeCode_ptr Tango::_tc_DevAttrHistory_3 = _0RL_tc_Tango_mDevAttrHistory__3; #endif static CORBA::PR_structMember _0RL_structmember_Tango_mEltInArray[] = { {"start", CORBA::TypeCode::PR_long_tc()}, {"nb_elt", CORBA::TypeCode::PR_long_tc()} }; #ifdef _0RL_tc_Tango_mEltInArray # undef _0RL_tc_Tango_mEltInArray #endif static CORBA::TypeCode_ptr _0RL_tc_Tango_mEltInArray = CORBA::TypeCode::PR_struct_tc("IDL:Tango/EltInArray:1.0", "EltInArray", _0RL_structmember_Tango_mEltInArray, 2, &_0RL_tcTrack); #if defined(HAS_Cplusplus_Namespace) && defined(_MSC_VER) // MSVC++ does not give the constant external linkage otherwise. namespace Tango { const ::CORBA::TypeCode_ptr _tc_EltInArray = _0RL_tc_Tango_mEltInArray; } #else const ::CORBA::TypeCode_ptr Tango::_tc_EltInArray = _0RL_tc_Tango_mEltInArray; #endif static CORBA::TypeCode_ptr _0RL_tc_Tango_mEltInArrayList = CORBA::TypeCode::PR_alias_tc("IDL:Tango/EltInArrayList:1.0", "EltInArrayList", CORBA::TypeCode::PR_sequence_tc(0, _0RL_tc_Tango_mEltInArray, &_0RL_tcTrack), &_0RL_tcTrack); #if defined(HAS_Cplusplus_Namespace) && defined(_MSC_VER) // MSVC++ does not give the constant external linkage otherwise. namespace Tango { const ::CORBA::TypeCode_ptr _tc_EltInArrayList = _0RL_tc_Tango_mEltInArrayList; } #else const ::CORBA::TypeCode_ptr Tango::_tc_EltInArrayList = _0RL_tc_Tango_mEltInArrayList; #endif static CORBA::TypeCode_ptr _0RL_tc_Tango_mTimeValList = CORBA::TypeCode::PR_alias_tc("IDL:Tango/TimeValList:1.0", "TimeValList", CORBA::TypeCode::PR_sequence_tc(0, _0RL_tc_Tango_mTimeVal, &_0RL_tcTrack), &_0RL_tcTrack); #if defined(HAS_Cplusplus_Namespace) && defined(_MSC_VER) // MSVC++ does not give the constant external linkage otherwise. namespace Tango { const ::CORBA::TypeCode_ptr _tc_TimeValList = _0RL_tc_Tango_mTimeValList; } #else const ::CORBA::TypeCode_ptr Tango::_tc_TimeValList = _0RL_tc_Tango_mTimeValList; #endif static CORBA::TypeCode_ptr _0RL_tc_Tango_mAttrQualityList = CORBA::TypeCode::PR_alias_tc("IDL:Tango/AttrQualityList:1.0", "AttrQualityList", CORBA::TypeCode::PR_sequence_tc(0, _0RL_tc_Tango_mAttrQuality, &_0RL_tcTrack), &_0RL_tcTrack); #if defined(HAS_Cplusplus_Namespace) && defined(_MSC_VER) // MSVC++ does not give the constant external linkage otherwise. namespace Tango { const ::CORBA::TypeCode_ptr _tc_AttrQualityList = _0RL_tc_Tango_mAttrQualityList; } #else const ::CORBA::TypeCode_ptr Tango::_tc_AttrQualityList = _0RL_tc_Tango_mAttrQualityList; #endif static CORBA::TypeCode_ptr _0RL_tc_Tango_mAttributeDimList = CORBA::TypeCode::PR_alias_tc("IDL:Tango/AttributeDimList:1.0", "AttributeDimList", CORBA::TypeCode::PR_sequence_tc(0, _0RL_tc_Tango_mAttributeDim, &_0RL_tcTrack), &_0RL_tcTrack); #if defined(HAS_Cplusplus_Namespace) && defined(_MSC_VER) // MSVC++ does not give the constant external linkage otherwise. namespace Tango { const ::CORBA::TypeCode_ptr _tc_AttributeDimList = _0RL_tc_Tango_mAttributeDimList; } #else const ::CORBA::TypeCode_ptr Tango::_tc_AttributeDimList = _0RL_tc_Tango_mAttributeDimList; #endif static CORBA::TypeCode_ptr _0RL_tc_Tango_mDevErrorListList = CORBA::TypeCode::PR_alias_tc("IDL:Tango/DevErrorListList:1.0", "DevErrorListList", CORBA::TypeCode::PR_sequence_tc(0, _0RL_tc_Tango_mDevErrorList, &_0RL_tcTrack), &_0RL_tcTrack); #if defined(HAS_Cplusplus_Namespace) && defined(_MSC_VER) // MSVC++ does not give the constant external linkage otherwise. namespace Tango { const ::CORBA::TypeCode_ptr _tc_DevErrorListList = _0RL_tc_Tango_mDevErrorListList; } #else const ::CORBA::TypeCode_ptr Tango::_tc_DevErrorListList = _0RL_tc_Tango_mDevErrorListList; #endif static CORBA::PR_structMember _0RL_structmember_Tango_mDevAttrHistory__4[] = { {"name", CORBA::TypeCode::PR_string_tc(0, &_0RL_tcTrack)}, {"dates", _0RL_tc_Tango_mTimeValList}, {"value", CORBA::TypeCode::PR_any_tc()}, {"quals", _0RL_tc_Tango_mAttrQualityList}, {"quals_array", _0RL_tc_Tango_mEltInArrayList}, {"r_dims", _0RL_tc_Tango_mAttributeDimList}, {"r_dims_array", _0RL_tc_Tango_mEltInArrayList}, {"w_dims", _0RL_tc_Tango_mAttributeDimList}, {"w_dims_array", _0RL_tc_Tango_mEltInArrayList}, {"errors", _0RL_tc_Tango_mDevErrorListList}, {"errors_array", _0RL_tc_Tango_mEltInArrayList} }; #ifdef _0RL_tc_Tango_mDevAttrHistory__4 # undef _0RL_tc_Tango_mDevAttrHistory__4 #endif static CORBA::TypeCode_ptr _0RL_tc_Tango_mDevAttrHistory__4 = CORBA::TypeCode::PR_struct_tc("IDL:Tango/DevAttrHistory_4:1.0", "DevAttrHistory_4", _0RL_structmember_Tango_mDevAttrHistory__4, 11, &_0RL_tcTrack); #if defined(HAS_Cplusplus_Namespace) && defined(_MSC_VER) // MSVC++ does not give the constant external linkage otherwise. namespace Tango { const ::CORBA::TypeCode_ptr _tc_DevAttrHistory_4 = _0RL_tc_Tango_mDevAttrHistory__4; } #else const ::CORBA::TypeCode_ptr Tango::_tc_DevAttrHistory_4 = _0RL_tc_Tango_mDevAttrHistory__4; #endif static CORBA::PR_structMember _0RL_structmember_Tango_mDevCmdHistory__4[] = { {"dates", _0RL_tc_Tango_mTimeValList}, {"value", CORBA::TypeCode::PR_any_tc()}, {"dims", _0RL_tc_Tango_mAttributeDimList}, {"dims_array", _0RL_tc_Tango_mEltInArrayList}, {"errors", _0RL_tc_Tango_mDevErrorListList}, {"errors_array", _0RL_tc_Tango_mEltInArrayList}, {"cmd_type", CORBA::TypeCode::PR_long_tc()} }; #ifdef _0RL_tc_Tango_mDevCmdHistory__4 # undef _0RL_tc_Tango_mDevCmdHistory__4 #endif static CORBA::TypeCode_ptr _0RL_tc_Tango_mDevCmdHistory__4 = CORBA::TypeCode::PR_struct_tc("IDL:Tango/DevCmdHistory_4:1.0", "DevCmdHistory_4", _0RL_structmember_Tango_mDevCmdHistory__4, 7, &_0RL_tcTrack); #if defined(HAS_Cplusplus_Namespace) && defined(_MSC_VER) // MSVC++ does not give the constant external linkage otherwise. namespace Tango { const ::CORBA::TypeCode_ptr _tc_DevCmdHistory_4 = _0RL_tc_Tango_mDevCmdHistory__4; } #else const ::CORBA::TypeCode_ptr Tango::_tc_DevCmdHistory_4 = _0RL_tc_Tango_mDevCmdHistory__4; #endif static CORBA::TypeCode_ptr _0RL_tc_Tango_mDevAttrHistoryList = CORBA::TypeCode::PR_alias_tc("IDL:Tango/DevAttrHistoryList:1.0", "DevAttrHistoryList", CORBA::TypeCode::PR_sequence_tc(0, _0RL_tc_Tango_mDevAttrHistory, &_0RL_tcTrack), &_0RL_tcTrack); #if defined(HAS_Cplusplus_Namespace) && defined(_MSC_VER) // MSVC++ does not give the constant external linkage otherwise. namespace Tango { const ::CORBA::TypeCode_ptr _tc_DevAttrHistoryList = _0RL_tc_Tango_mDevAttrHistoryList; } #else const ::CORBA::TypeCode_ptr Tango::_tc_DevAttrHistoryList = _0RL_tc_Tango_mDevAttrHistoryList; #endif static CORBA::TypeCode_ptr _0RL_tc_Tango_mDevAttrHistoryList__3 = CORBA::TypeCode::PR_alias_tc("IDL:Tango/DevAttrHistoryList_3:1.0", "DevAttrHistoryList_3", CORBA::TypeCode::PR_sequence_tc(0, _0RL_tc_Tango_mDevAttrHistory__3, &_0RL_tcTrack), &_0RL_tcTrack); #if defined(HAS_Cplusplus_Namespace) && defined(_MSC_VER) // MSVC++ does not give the constant external linkage otherwise. namespace Tango { const ::CORBA::TypeCode_ptr _tc_DevAttrHistoryList_3 = _0RL_tc_Tango_mDevAttrHistoryList__3; } #else const ::CORBA::TypeCode_ptr Tango::_tc_DevAttrHistoryList_3 = _0RL_tc_Tango_mDevAttrHistoryList__3; #endif static CORBA::PR_structMember _0RL_structmember_Tango_mZmqCallInfo[] = { {"version", CORBA::TypeCode::PR_long_tc()}, {"ctr", CORBA::TypeCode::PR_ulong_tc()}, {"method_name", CORBA::TypeCode::PR_string_tc(0, &_0RL_tcTrack)}, {"oid", _0RL_tc_Tango_mDevVarCharArray}, {"call_is_except", CORBA::TypeCode::PR_boolean_tc()} }; #ifdef _0RL_tc_Tango_mZmqCallInfo # undef _0RL_tc_Tango_mZmqCallInfo #endif static CORBA::TypeCode_ptr _0RL_tc_Tango_mZmqCallInfo = CORBA::TypeCode::PR_struct_tc("IDL:Tango/ZmqCallInfo:1.0", "ZmqCallInfo", _0RL_structmember_Tango_mZmqCallInfo, 5, &_0RL_tcTrack); #if defined(HAS_Cplusplus_Namespace) && defined(_MSC_VER) // MSVC++ does not give the constant external linkage otherwise. namespace Tango { const ::CORBA::TypeCode_ptr _tc_ZmqCallInfo = _0RL_tc_Tango_mZmqCallInfo; } #else const ::CORBA::TypeCode_ptr Tango::_tc_ZmqCallInfo = _0RL_tc_Tango_mZmqCallInfo; #endif #if defined(HAS_Cplusplus_Namespace) && defined(_MSC_VER) // MSVC++ does not give the constant external linkage otherwise. namespace Tango { const ::CORBA::TypeCode_ptr _tc_Device = CORBA::TypeCode::PR_interface_tc("IDL:Tango/Device:1.0", "Device", &_0RL_tcTrack); } #else const ::CORBA::TypeCode_ptr Tango::_tc_Device = CORBA::TypeCode::PR_interface_tc("IDL:Tango/Device:1.0", "Device", &_0RL_tcTrack); #endif #if defined(HAS_Cplusplus_Namespace) && defined(_MSC_VER) // MSVC++ does not give the constant external linkage otherwise. namespace Tango { const ::CORBA::TypeCode_ptr _tc_Device_2 = CORBA::TypeCode::PR_interface_tc("IDL:Tango/Device_2:1.0", "Device_2", &_0RL_tcTrack); } #else const ::CORBA::TypeCode_ptr Tango::_tc_Device_2 = CORBA::TypeCode::PR_interface_tc("IDL:Tango/Device_2:1.0", "Device_2", &_0RL_tcTrack); #endif #if defined(HAS_Cplusplus_Namespace) && defined(_MSC_VER) // MSVC++ does not give the constant external linkage otherwise. namespace Tango { const ::CORBA::TypeCode_ptr _tc_Device_3 = CORBA::TypeCode::PR_interface_tc("IDL:Tango/Device_3:1.0", "Device_3", &_0RL_tcTrack); } #else const ::CORBA::TypeCode_ptr Tango::_tc_Device_3 = CORBA::TypeCode::PR_interface_tc("IDL:Tango/Device_3:1.0", "Device_3", &_0RL_tcTrack); #endif #if defined(HAS_Cplusplus_Namespace) && defined(_MSC_VER) // MSVC++ does not give the constant external linkage otherwise. namespace Tango { const ::CORBA::TypeCode_ptr _tc_Device_4 = CORBA::TypeCode::PR_interface_tc("IDL:Tango/Device_4:1.0", "Device_4", &_0RL_tcTrack); } #else const ::CORBA::TypeCode_ptr Tango::_tc_Device_4 = CORBA::TypeCode::PR_interface_tc("IDL:Tango/Device_4:1.0", "Device_4", &_0RL_tcTrack); #endif static void _0RL_Tango_mDevVarBooleanArray_marshal_fn(cdrStream& _s, void* _v) { Tango::DevVarBooleanArray* _p = (Tango::DevVarBooleanArray*)_v; *_p >>= _s; } static void _0RL_Tango_mDevVarBooleanArray_unmarshal_fn(cdrStream& _s, void*& _v) { Tango::DevVarBooleanArray* _p = new Tango::DevVarBooleanArray; *_p <<= _s; _v = _p; } static void _0RL_Tango_mDevVarBooleanArray_destructor_fn(void* _v) { Tango::DevVarBooleanArray* _p = (Tango::DevVarBooleanArray*)_v; delete _p; } void operator<<=(::CORBA::Any& _a, const Tango::DevVarBooleanArray& _s) { Tango::DevVarBooleanArray* _p = new Tango::DevVarBooleanArray(_s); _a.PR_insert(_0RL_tc_Tango_mDevVarBooleanArray, _0RL_Tango_mDevVarBooleanArray_marshal_fn, _0RL_Tango_mDevVarBooleanArray_destructor_fn, _p); } void operator<<=(::CORBA::Any& _a, Tango::DevVarBooleanArray* _sp) { _a.PR_insert(_0RL_tc_Tango_mDevVarBooleanArray, _0RL_Tango_mDevVarBooleanArray_marshal_fn, _0RL_Tango_mDevVarBooleanArray_destructor_fn, _sp); } ::CORBA::Boolean operator>>=(const ::CORBA::Any& _a, Tango::DevVarBooleanArray*& _sp) { return _a >>= (const Tango::DevVarBooleanArray*&) _sp; } ::CORBA::Boolean operator>>=(const ::CORBA::Any& _a, const Tango::DevVarBooleanArray*& _sp) { void* _v; if (_a.PR_extract(_0RL_tc_Tango_mDevVarBooleanArray, _0RL_Tango_mDevVarBooleanArray_unmarshal_fn, _0RL_Tango_mDevVarBooleanArray_marshal_fn, _0RL_Tango_mDevVarBooleanArray_destructor_fn, _v)) { _sp = (const Tango::DevVarBooleanArray*)_v; return 1; } return 0; } static void _0RL_Tango_mDevVarDoubleArray_marshal_fn(cdrStream& _s, void* _v) { Tango::DevVarDoubleArray* _p = (Tango::DevVarDoubleArray*)_v; *_p >>= _s; } static void _0RL_Tango_mDevVarDoubleArray_unmarshal_fn(cdrStream& _s, void*& _v) { Tango::DevVarDoubleArray* _p = new Tango::DevVarDoubleArray; *_p <<= _s; _v = _p; } static void _0RL_Tango_mDevVarDoubleArray_destructor_fn(void* _v) { Tango::DevVarDoubleArray* _p = (Tango::DevVarDoubleArray*)_v; delete _p; } void operator<<=(::CORBA::Any& _a, const Tango::DevVarDoubleArray& _s) { Tango::DevVarDoubleArray* _p = new Tango::DevVarDoubleArray(_s); _a.PR_insert(_0RL_tc_Tango_mDevVarDoubleArray, _0RL_Tango_mDevVarDoubleArray_marshal_fn, _0RL_Tango_mDevVarDoubleArray_destructor_fn, _p); } void operator<<=(::CORBA::Any& _a, Tango::DevVarDoubleArray* _sp) { _a.PR_insert(_0RL_tc_Tango_mDevVarDoubleArray, _0RL_Tango_mDevVarDoubleArray_marshal_fn, _0RL_Tango_mDevVarDoubleArray_destructor_fn, _sp); } ::CORBA::Boolean operator>>=(const ::CORBA::Any& _a, Tango::DevVarDoubleArray*& _sp) { return _a >>= (const Tango::DevVarDoubleArray*&) _sp; } ::CORBA::Boolean operator>>=(const ::CORBA::Any& _a, const Tango::DevVarDoubleArray*& _sp) { void* _v; if (_a.PR_extract(_0RL_tc_Tango_mDevVarDoubleArray, _0RL_Tango_mDevVarDoubleArray_unmarshal_fn, _0RL_Tango_mDevVarDoubleArray_marshal_fn, _0RL_Tango_mDevVarDoubleArray_destructor_fn, _v)) { _sp = (const Tango::DevVarDoubleArray*)_v; return 1; } return 0; } static void _0RL_Tango_mDevVarFloatArray_marshal_fn(cdrStream& _s, void* _v) { Tango::DevVarFloatArray* _p = (Tango::DevVarFloatArray*)_v; *_p >>= _s; } static void _0RL_Tango_mDevVarFloatArray_unmarshal_fn(cdrStream& _s, void*& _v) { Tango::DevVarFloatArray* _p = new Tango::DevVarFloatArray; *_p <<= _s; _v = _p; } static void _0RL_Tango_mDevVarFloatArray_destructor_fn(void* _v) { Tango::DevVarFloatArray* _p = (Tango::DevVarFloatArray*)_v; delete _p; } void operator<<=(::CORBA::Any& _a, const Tango::DevVarFloatArray& _s) { Tango::DevVarFloatArray* _p = new Tango::DevVarFloatArray(_s); _a.PR_insert(_0RL_tc_Tango_mDevVarFloatArray, _0RL_Tango_mDevVarFloatArray_marshal_fn, _0RL_Tango_mDevVarFloatArray_destructor_fn, _p); } void operator<<=(::CORBA::Any& _a, Tango::DevVarFloatArray* _sp) { _a.PR_insert(_0RL_tc_Tango_mDevVarFloatArray, _0RL_Tango_mDevVarFloatArray_marshal_fn, _0RL_Tango_mDevVarFloatArray_destructor_fn, _sp); } ::CORBA::Boolean operator>>=(const ::CORBA::Any& _a, Tango::DevVarFloatArray*& _sp) { return _a >>= (const Tango::DevVarFloatArray*&) _sp; } ::CORBA::Boolean operator>>=(const ::CORBA::Any& _a, const Tango::DevVarFloatArray*& _sp) { void* _v; if (_a.PR_extract(_0RL_tc_Tango_mDevVarFloatArray, _0RL_Tango_mDevVarFloatArray_unmarshal_fn, _0RL_Tango_mDevVarFloatArray_marshal_fn, _0RL_Tango_mDevVarFloatArray_destructor_fn, _v)) { _sp = (const Tango::DevVarFloatArray*)_v; return 1; } return 0; } static void _0RL_Tango_mDevVarShortArray_marshal_fn(cdrStream& _s, void* _v) { Tango::DevVarShortArray* _p = (Tango::DevVarShortArray*)_v; *_p >>= _s; } static void _0RL_Tango_mDevVarShortArray_unmarshal_fn(cdrStream& _s, void*& _v) { Tango::DevVarShortArray* _p = new Tango::DevVarShortArray; *_p <<= _s; _v = _p; } static void _0RL_Tango_mDevVarShortArray_destructor_fn(void* _v) { Tango::DevVarShortArray* _p = (Tango::DevVarShortArray*)_v; delete _p; } void operator<<=(::CORBA::Any& _a, const Tango::DevVarShortArray& _s) { Tango::DevVarShortArray* _p = new Tango::DevVarShortArray(_s); _a.PR_insert(_0RL_tc_Tango_mDevVarShortArray, _0RL_Tango_mDevVarShortArray_marshal_fn, _0RL_Tango_mDevVarShortArray_destructor_fn, _p); } void operator<<=(::CORBA::Any& _a, Tango::DevVarShortArray* _sp) { _a.PR_insert(_0RL_tc_Tango_mDevVarShortArray, _0RL_Tango_mDevVarShortArray_marshal_fn, _0RL_Tango_mDevVarShortArray_destructor_fn, _sp); } ::CORBA::Boolean operator>>=(const ::CORBA::Any& _a, Tango::DevVarShortArray*& _sp) { return _a >>= (const Tango::DevVarShortArray*&) _sp; } ::CORBA::Boolean operator>>=(const ::CORBA::Any& _a, const Tango::DevVarShortArray*& _sp) { void* _v; if (_a.PR_extract(_0RL_tc_Tango_mDevVarShortArray, _0RL_Tango_mDevVarShortArray_unmarshal_fn, _0RL_Tango_mDevVarShortArray_marshal_fn, _0RL_Tango_mDevVarShortArray_destructor_fn, _v)) { _sp = (const Tango::DevVarShortArray*)_v; return 1; } return 0; } static void _0RL_Tango_mDevVarLongArray_marshal_fn(cdrStream& _s, void* _v) { Tango::DevVarLongArray* _p = (Tango::DevVarLongArray*)_v; *_p >>= _s; } static void _0RL_Tango_mDevVarLongArray_unmarshal_fn(cdrStream& _s, void*& _v) { Tango::DevVarLongArray* _p = new Tango::DevVarLongArray; *_p <<= _s; _v = _p; } static void _0RL_Tango_mDevVarLongArray_destructor_fn(void* _v) { Tango::DevVarLongArray* _p = (Tango::DevVarLongArray*)_v; delete _p; } void operator<<=(::CORBA::Any& _a, const Tango::DevVarLongArray& _s) { Tango::DevVarLongArray* _p = new Tango::DevVarLongArray(_s); _a.PR_insert(_0RL_tc_Tango_mDevVarLongArray, _0RL_Tango_mDevVarLongArray_marshal_fn, _0RL_Tango_mDevVarLongArray_destructor_fn, _p); } void operator<<=(::CORBA::Any& _a, Tango::DevVarLongArray* _sp) { _a.PR_insert(_0RL_tc_Tango_mDevVarLongArray, _0RL_Tango_mDevVarLongArray_marshal_fn, _0RL_Tango_mDevVarLongArray_destructor_fn, _sp); } ::CORBA::Boolean operator>>=(const ::CORBA::Any& _a, Tango::DevVarLongArray*& _sp) { return _a >>= (const Tango::DevVarLongArray*&) _sp; } ::CORBA::Boolean operator>>=(const ::CORBA::Any& _a, const Tango::DevVarLongArray*& _sp) { void* _v; if (_a.PR_extract(_0RL_tc_Tango_mDevVarLongArray, _0RL_Tango_mDevVarLongArray_unmarshal_fn, _0RL_Tango_mDevVarLongArray_marshal_fn, _0RL_Tango_mDevVarLongArray_destructor_fn, _v)) { _sp = (const Tango::DevVarLongArray*)_v; return 1; } return 0; } static void _0RL_Tango_mDevVarLong64Array_marshal_fn(cdrStream& _s, void* _v) { Tango::DevVarLong64Array* _p = (Tango::DevVarLong64Array*)_v; *_p >>= _s; } static void _0RL_Tango_mDevVarLong64Array_unmarshal_fn(cdrStream& _s, void*& _v) { Tango::DevVarLong64Array* _p = new Tango::DevVarLong64Array; *_p <<= _s; _v = _p; } static void _0RL_Tango_mDevVarLong64Array_destructor_fn(void* _v) { Tango::DevVarLong64Array* _p = (Tango::DevVarLong64Array*)_v; delete _p; } void operator<<=(::CORBA::Any& _a, const Tango::DevVarLong64Array& _s) { Tango::DevVarLong64Array* _p = new Tango::DevVarLong64Array(_s); _a.PR_insert(_0RL_tc_Tango_mDevVarLong64Array, _0RL_Tango_mDevVarLong64Array_marshal_fn, _0RL_Tango_mDevVarLong64Array_destructor_fn, _p); } void operator<<=(::CORBA::Any& _a, Tango::DevVarLong64Array* _sp) { _a.PR_insert(_0RL_tc_Tango_mDevVarLong64Array, _0RL_Tango_mDevVarLong64Array_marshal_fn, _0RL_Tango_mDevVarLong64Array_destructor_fn, _sp); } ::CORBA::Boolean operator>>=(const ::CORBA::Any& _a, Tango::DevVarLong64Array*& _sp) { return _a >>= (const Tango::DevVarLong64Array*&) _sp; } ::CORBA::Boolean operator>>=(const ::CORBA::Any& _a, const Tango::DevVarLong64Array*& _sp) { void* _v; if (_a.PR_extract(_0RL_tc_Tango_mDevVarLong64Array, _0RL_Tango_mDevVarLong64Array_unmarshal_fn, _0RL_Tango_mDevVarLong64Array_marshal_fn, _0RL_Tango_mDevVarLong64Array_destructor_fn, _v)) { _sp = (const Tango::DevVarLong64Array*)_v; return 1; } return 0; } static void _0RL_Tango_mDevVarCharArray_marshal_fn(cdrStream& _s, void* _v) { Tango::DevVarCharArray* _p = (Tango::DevVarCharArray*)_v; *_p >>= _s; } static void _0RL_Tango_mDevVarCharArray_unmarshal_fn(cdrStream& _s, void*& _v) { Tango::DevVarCharArray* _p = new Tango::DevVarCharArray; *_p <<= _s; _v = _p; } static void _0RL_Tango_mDevVarCharArray_destructor_fn(void* _v) { Tango::DevVarCharArray* _p = (Tango::DevVarCharArray*)_v; delete _p; } void operator<<=(::CORBA::Any& _a, const Tango::DevVarCharArray& _s) { Tango::DevVarCharArray* _p = new Tango::DevVarCharArray(_s); _a.PR_insert(_0RL_tc_Tango_mDevVarCharArray, _0RL_Tango_mDevVarCharArray_marshal_fn, _0RL_Tango_mDevVarCharArray_destructor_fn, _p); } void operator<<=(::CORBA::Any& _a, Tango::DevVarCharArray* _sp) { _a.PR_insert(_0RL_tc_Tango_mDevVarCharArray, _0RL_Tango_mDevVarCharArray_marshal_fn, _0RL_Tango_mDevVarCharArray_destructor_fn, _sp); } ::CORBA::Boolean operator>>=(const ::CORBA::Any& _a, Tango::DevVarCharArray*& _sp) { return _a >>= (const Tango::DevVarCharArray*&) _sp; } ::CORBA::Boolean operator>>=(const ::CORBA::Any& _a, const Tango::DevVarCharArray*& _sp) { void* _v; if (_a.PR_extract(_0RL_tc_Tango_mDevVarCharArray, _0RL_Tango_mDevVarCharArray_unmarshal_fn, _0RL_Tango_mDevVarCharArray_marshal_fn, _0RL_Tango_mDevVarCharArray_destructor_fn, _v)) { _sp = (const Tango::DevVarCharArray*)_v; return 1; } return 0; } static void _0RL_Tango_mDevVarStringArray_marshal_fn(cdrStream& _s, void* _v) { Tango::DevVarStringArray* _p = (Tango::DevVarStringArray*)_v; *_p >>= _s; } static void _0RL_Tango_mDevVarStringArray_unmarshal_fn(cdrStream& _s, void*& _v) { Tango::DevVarStringArray* _p = new Tango::DevVarStringArray; *_p <<= _s; _v = _p; } static void _0RL_Tango_mDevVarStringArray_destructor_fn(void* _v) { Tango::DevVarStringArray* _p = (Tango::DevVarStringArray*)_v; delete _p; } void operator<<=(::CORBA::Any& _a, const Tango::DevVarStringArray& _s) { Tango::DevVarStringArray* _p = new Tango::DevVarStringArray(_s); _a.PR_insert(_0RL_tc_Tango_mDevVarStringArray, _0RL_Tango_mDevVarStringArray_marshal_fn, _0RL_Tango_mDevVarStringArray_destructor_fn, _p); } void operator<<=(::CORBA::Any& _a, Tango::DevVarStringArray* _sp) { _a.PR_insert(_0RL_tc_Tango_mDevVarStringArray, _0RL_Tango_mDevVarStringArray_marshal_fn, _0RL_Tango_mDevVarStringArray_destructor_fn, _sp); } ::CORBA::Boolean operator>>=(const ::CORBA::Any& _a, Tango::DevVarStringArray*& _sp) { return _a >>= (const Tango::DevVarStringArray*&) _sp; } ::CORBA::Boolean operator>>=(const ::CORBA::Any& _a, const Tango::DevVarStringArray*& _sp) { void* _v; if (_a.PR_extract(_0RL_tc_Tango_mDevVarStringArray, _0RL_Tango_mDevVarStringArray_unmarshal_fn, _0RL_Tango_mDevVarStringArray_marshal_fn, _0RL_Tango_mDevVarStringArray_destructor_fn, _v)) { _sp = (const Tango::DevVarStringArray*)_v; return 1; } return 0; } static void _0RL_Tango_mDevVarUShortArray_marshal_fn(cdrStream& _s, void* _v) { Tango::DevVarUShortArray* _p = (Tango::DevVarUShortArray*)_v; *_p >>= _s; } static void _0RL_Tango_mDevVarUShortArray_unmarshal_fn(cdrStream& _s, void*& _v) { Tango::DevVarUShortArray* _p = new Tango::DevVarUShortArray; *_p <<= _s; _v = _p; } static void _0RL_Tango_mDevVarUShortArray_destructor_fn(void* _v) { Tango::DevVarUShortArray* _p = (Tango::DevVarUShortArray*)_v; delete _p; } void operator<<=(::CORBA::Any& _a, const Tango::DevVarUShortArray& _s) { Tango::DevVarUShortArray* _p = new Tango::DevVarUShortArray(_s); _a.PR_insert(_0RL_tc_Tango_mDevVarUShortArray, _0RL_Tango_mDevVarUShortArray_marshal_fn, _0RL_Tango_mDevVarUShortArray_destructor_fn, _p); } void operator<<=(::CORBA::Any& _a, Tango::DevVarUShortArray* _sp) { _a.PR_insert(_0RL_tc_Tango_mDevVarUShortArray, _0RL_Tango_mDevVarUShortArray_marshal_fn, _0RL_Tango_mDevVarUShortArray_destructor_fn, _sp); } ::CORBA::Boolean operator>>=(const ::CORBA::Any& _a, Tango::DevVarUShortArray*& _sp) { return _a >>= (const Tango::DevVarUShortArray*&) _sp; } ::CORBA::Boolean operator>>=(const ::CORBA::Any& _a, const Tango::DevVarUShortArray*& _sp) { void* _v; if (_a.PR_extract(_0RL_tc_Tango_mDevVarUShortArray, _0RL_Tango_mDevVarUShortArray_unmarshal_fn, _0RL_Tango_mDevVarUShortArray_marshal_fn, _0RL_Tango_mDevVarUShortArray_destructor_fn, _v)) { _sp = (const Tango::DevVarUShortArray*)_v; return 1; } return 0; } static void _0RL_Tango_mDevVarULongArray_marshal_fn(cdrStream& _s, void* _v) { Tango::DevVarULongArray* _p = (Tango::DevVarULongArray*)_v; *_p >>= _s; } static void _0RL_Tango_mDevVarULongArray_unmarshal_fn(cdrStream& _s, void*& _v) { Tango::DevVarULongArray* _p = new Tango::DevVarULongArray; *_p <<= _s; _v = _p; } static void _0RL_Tango_mDevVarULongArray_destructor_fn(void* _v) { Tango::DevVarULongArray* _p = (Tango::DevVarULongArray*)_v; delete _p; } void operator<<=(::CORBA::Any& _a, const Tango::DevVarULongArray& _s) { Tango::DevVarULongArray* _p = new Tango::DevVarULongArray(_s); _a.PR_insert(_0RL_tc_Tango_mDevVarULongArray, _0RL_Tango_mDevVarULongArray_marshal_fn, _0RL_Tango_mDevVarULongArray_destructor_fn, _p); } void operator<<=(::CORBA::Any& _a, Tango::DevVarULongArray* _sp) { _a.PR_insert(_0RL_tc_Tango_mDevVarULongArray, _0RL_Tango_mDevVarULongArray_marshal_fn, _0RL_Tango_mDevVarULongArray_destructor_fn, _sp); } ::CORBA::Boolean operator>>=(const ::CORBA::Any& _a, Tango::DevVarULongArray*& _sp) { return _a >>= (const Tango::DevVarULongArray*&) _sp; } ::CORBA::Boolean operator>>=(const ::CORBA::Any& _a, const Tango::DevVarULongArray*& _sp) { void* _v; if (_a.PR_extract(_0RL_tc_Tango_mDevVarULongArray, _0RL_Tango_mDevVarULongArray_unmarshal_fn, _0RL_Tango_mDevVarULongArray_marshal_fn, _0RL_Tango_mDevVarULongArray_destructor_fn, _v)) { _sp = (const Tango::DevVarULongArray*)_v; return 1; } return 0; } static void _0RL_Tango_mDevVarULong64Array_marshal_fn(cdrStream& _s, void* _v) { Tango::DevVarULong64Array* _p = (Tango::DevVarULong64Array*)_v; *_p >>= _s; } static void _0RL_Tango_mDevVarULong64Array_unmarshal_fn(cdrStream& _s, void*& _v) { Tango::DevVarULong64Array* _p = new Tango::DevVarULong64Array; *_p <<= _s; _v = _p; } static void _0RL_Tango_mDevVarULong64Array_destructor_fn(void* _v) { Tango::DevVarULong64Array* _p = (Tango::DevVarULong64Array*)_v; delete _p; } void operator<<=(::CORBA::Any& _a, const Tango::DevVarULong64Array& _s) { Tango::DevVarULong64Array* _p = new Tango::DevVarULong64Array(_s); _a.PR_insert(_0RL_tc_Tango_mDevVarULong64Array, _0RL_Tango_mDevVarULong64Array_marshal_fn, _0RL_Tango_mDevVarULong64Array_destructor_fn, _p); } void operator<<=(::CORBA::Any& _a, Tango::DevVarULong64Array* _sp) { _a.PR_insert(_0RL_tc_Tango_mDevVarULong64Array, _0RL_Tango_mDevVarULong64Array_marshal_fn, _0RL_Tango_mDevVarULong64Array_destructor_fn, _sp); } ::CORBA::Boolean operator>>=(const ::CORBA::Any& _a, Tango::DevVarULong64Array*& _sp) { return _a >>= (const Tango::DevVarULong64Array*&) _sp; } ::CORBA::Boolean operator>>=(const ::CORBA::Any& _a, const Tango::DevVarULong64Array*& _sp) { void* _v; if (_a.PR_extract(_0RL_tc_Tango_mDevVarULong64Array, _0RL_Tango_mDevVarULong64Array_unmarshal_fn, _0RL_Tango_mDevVarULong64Array_marshal_fn, _0RL_Tango_mDevVarULong64Array_destructor_fn, _v)) { _sp = (const Tango::DevVarULong64Array*)_v; return 1; } return 0; } static void _0RL_Tango_mDevVarLongStringArray_marshal_fn(cdrStream& _s, void* _v) { Tango::DevVarLongStringArray* _p = (Tango::DevVarLongStringArray*)_v; *_p >>= _s; } static void _0RL_Tango_mDevVarLongStringArray_unmarshal_fn(cdrStream& _s, void*& _v) { Tango::DevVarLongStringArray* _p = new Tango::DevVarLongStringArray; *_p <<= _s; _v = _p; } static void _0RL_Tango_mDevVarLongStringArray_destructor_fn(void* _v) { Tango::DevVarLongStringArray* _p = (Tango::DevVarLongStringArray*)_v; delete _p; } void operator<<=(::CORBA::Any& _a, const Tango::DevVarLongStringArray& _s) { Tango::DevVarLongStringArray* _p = new Tango::DevVarLongStringArray(_s); _a.PR_insert(_0RL_tc_Tango_mDevVarLongStringArray, _0RL_Tango_mDevVarLongStringArray_marshal_fn, _0RL_Tango_mDevVarLongStringArray_destructor_fn, _p); } void operator<<=(::CORBA::Any& _a, Tango::DevVarLongStringArray* _sp) { _a.PR_insert(_0RL_tc_Tango_mDevVarLongStringArray, _0RL_Tango_mDevVarLongStringArray_marshal_fn, _0RL_Tango_mDevVarLongStringArray_destructor_fn, _sp); } ::CORBA::Boolean operator>>=(const ::CORBA::Any& _a, Tango::DevVarLongStringArray*& _sp) { return _a >>= (const Tango::DevVarLongStringArray*&) _sp; } ::CORBA::Boolean operator>>=(const ::CORBA::Any& _a, const Tango::DevVarLongStringArray*& _sp) { void* _v; if (_a.PR_extract(_0RL_tc_Tango_mDevVarLongStringArray, _0RL_Tango_mDevVarLongStringArray_unmarshal_fn, _0RL_Tango_mDevVarLongStringArray_marshal_fn, _0RL_Tango_mDevVarLongStringArray_destructor_fn, _v)) { _sp = (const Tango::DevVarLongStringArray*)_v; return 1; } return 0; } static void _0RL_Tango_mDevVarDoubleStringArray_marshal_fn(cdrStream& _s, void* _v) { Tango::DevVarDoubleStringArray* _p = (Tango::DevVarDoubleStringArray*)_v; *_p >>= _s; } static void _0RL_Tango_mDevVarDoubleStringArray_unmarshal_fn(cdrStream& _s, void*& _v) { Tango::DevVarDoubleStringArray* _p = new Tango::DevVarDoubleStringArray; *_p <<= _s; _v = _p; } static void _0RL_Tango_mDevVarDoubleStringArray_destructor_fn(void* _v) { Tango::DevVarDoubleStringArray* _p = (Tango::DevVarDoubleStringArray*)_v; delete _p; } void operator<<=(::CORBA::Any& _a, const Tango::DevVarDoubleStringArray& _s) { Tango::DevVarDoubleStringArray* _p = new Tango::DevVarDoubleStringArray(_s); _a.PR_insert(_0RL_tc_Tango_mDevVarDoubleStringArray, _0RL_Tango_mDevVarDoubleStringArray_marshal_fn, _0RL_Tango_mDevVarDoubleStringArray_destructor_fn, _p); } void operator<<=(::CORBA::Any& _a, Tango::DevVarDoubleStringArray* _sp) { _a.PR_insert(_0RL_tc_Tango_mDevVarDoubleStringArray, _0RL_Tango_mDevVarDoubleStringArray_marshal_fn, _0RL_Tango_mDevVarDoubleStringArray_destructor_fn, _sp); } ::CORBA::Boolean operator>>=(const ::CORBA::Any& _a, Tango::DevVarDoubleStringArray*& _sp) { return _a >>= (const Tango::DevVarDoubleStringArray*&) _sp; } ::CORBA::Boolean operator>>=(const ::CORBA::Any& _a, const Tango::DevVarDoubleStringArray*& _sp) { void* _v; if (_a.PR_extract(_0RL_tc_Tango_mDevVarDoubleStringArray, _0RL_Tango_mDevVarDoubleStringArray_unmarshal_fn, _0RL_Tango_mDevVarDoubleStringArray_marshal_fn, _0RL_Tango_mDevVarDoubleStringArray_destructor_fn, _v)) { _sp = (const Tango::DevVarDoubleStringArray*)_v; return 1; } return 0; } static void _0RL_Tango_mDevEncoded_marshal_fn(cdrStream& _s, void* _v) { Tango::DevEncoded* _p = (Tango::DevEncoded*)_v; *_p >>= _s; } static void _0RL_Tango_mDevEncoded_unmarshal_fn(cdrStream& _s, void*& _v) { Tango::DevEncoded* _p = new Tango::DevEncoded; *_p <<= _s; _v = _p; } static void _0RL_Tango_mDevEncoded_destructor_fn(void* _v) { Tango::DevEncoded* _p = (Tango::DevEncoded*)_v; delete _p; } void operator<<=(::CORBA::Any& _a, const Tango::DevEncoded& _s) { Tango::DevEncoded* _p = new Tango::DevEncoded(_s); _a.PR_insert(_0RL_tc_Tango_mDevEncoded, _0RL_Tango_mDevEncoded_marshal_fn, _0RL_Tango_mDevEncoded_destructor_fn, _p); } void operator<<=(::CORBA::Any& _a, Tango::DevEncoded* _sp) { _a.PR_insert(_0RL_tc_Tango_mDevEncoded, _0RL_Tango_mDevEncoded_marshal_fn, _0RL_Tango_mDevEncoded_destructor_fn, _sp); } ::CORBA::Boolean operator>>=(const ::CORBA::Any& _a, Tango::DevEncoded*& _sp) { return _a >>= (const Tango::DevEncoded*&) _sp; } ::CORBA::Boolean operator>>=(const ::CORBA::Any& _a, const Tango::DevEncoded*& _sp) { void* _v; if (_a.PR_extract(_0RL_tc_Tango_mDevEncoded, _0RL_Tango_mDevEncoded_unmarshal_fn, _0RL_Tango_mDevEncoded_marshal_fn, _0RL_Tango_mDevEncoded_destructor_fn, _v)) { _sp = (const Tango::DevEncoded*)_v; return 1; } return 0; } static void _0RL_Tango_mDevVarEncodedArray_marshal_fn(cdrStream& _s, void* _v) { Tango::DevVarEncodedArray* _p = (Tango::DevVarEncodedArray*)_v; *_p >>= _s; } static void _0RL_Tango_mDevVarEncodedArray_unmarshal_fn(cdrStream& _s, void*& _v) { Tango::DevVarEncodedArray* _p = new Tango::DevVarEncodedArray; *_p <<= _s; _v = _p; } static void _0RL_Tango_mDevVarEncodedArray_destructor_fn(void* _v) { Tango::DevVarEncodedArray* _p = (Tango::DevVarEncodedArray*)_v; delete _p; } void operator<<=(::CORBA::Any& _a, const Tango::DevVarEncodedArray& _s) { Tango::DevVarEncodedArray* _p = new Tango::DevVarEncodedArray(_s); _a.PR_insert(_0RL_tc_Tango_mDevVarEncodedArray, _0RL_Tango_mDevVarEncodedArray_marshal_fn, _0RL_Tango_mDevVarEncodedArray_destructor_fn, _p); } void operator<<=(::CORBA::Any& _a, Tango::DevVarEncodedArray* _sp) { _a.PR_insert(_0RL_tc_Tango_mDevVarEncodedArray, _0RL_Tango_mDevVarEncodedArray_marshal_fn, _0RL_Tango_mDevVarEncodedArray_destructor_fn, _sp); } ::CORBA::Boolean operator>>=(const ::CORBA::Any& _a, Tango::DevVarEncodedArray*& _sp) { return _a >>= (const Tango::DevVarEncodedArray*&) _sp; } ::CORBA::Boolean operator>>=(const ::CORBA::Any& _a, const Tango::DevVarEncodedArray*& _sp) { void* _v; if (_a.PR_extract(_0RL_tc_Tango_mDevVarEncodedArray, _0RL_Tango_mDevVarEncodedArray_unmarshal_fn, _0RL_Tango_mDevVarEncodedArray_marshal_fn, _0RL_Tango_mDevVarEncodedArray_destructor_fn, _v)) { _sp = (const Tango::DevVarEncodedArray*)_v; return 1; } return 0; } static void _0RL_Tango_mJavaUUID_marshal_fn(cdrStream& _s, void* _v) { Tango::JavaUUID_slice* _a = (Tango::JavaUUID_slice*)_v; if (! _s.marshal_byte_swap()) { _s.put_octet_array((_CORBA_Octet*)(_a),16,omni::ALIGN_8); } else { _s.declareArrayLength(omni::ALIGN_8, 16); for (_CORBA_ULong _0i0 = 0; _0i0 < 2; _0i0++){ _a[_0i0] >>= _s; } } } static void _0RL_Tango_mJavaUUID_unmarshal_fn(cdrStream& _s, void*& _v) { Tango::JavaUUID_slice* _a = Tango::JavaUUID_alloc(); _s.unmarshalArrayULongLong((_CORBA_ULongLong*)(_a), 2); _v = _a; } static void _0RL_Tango_mJavaUUID_destructor_fn(void* _v) { Tango::JavaUUID_slice* _a = (Tango::JavaUUID_slice*)_v; Tango::JavaUUID_free(_a); } void operator<<=(::CORBA::Any& _a, const Tango::JavaUUID_forany& _s) { Tango::JavaUUID_slice* _v; if (!_s.NP_nocopy()) _v = Tango::JavaUUID_dup(_s); else _v = _s.NP_getSlice(); _a.PR_insert(_0RL_tc_Tango_mJavaUUID, _0RL_Tango_mJavaUUID_marshal_fn, _0RL_Tango_mJavaUUID_destructor_fn, _v); } ::CORBA::Boolean operator>>=(const ::CORBA::Any& _a, Tango::JavaUUID_forany& _s) { void* _v; if (_a.PR_extract(_0RL_tc_Tango_mJavaUUID, _0RL_Tango_mJavaUUID_unmarshal_fn, _0RL_Tango_mJavaUUID_marshal_fn, _0RL_Tango_mJavaUUID_destructor_fn, _v)) { _s = (Tango::JavaUUID_slice*)_v; return 1; } return 0; } static void _0RL_Tango_mJavaClntIdent_marshal_fn(cdrStream& _s, void* _v) { Tango::JavaClntIdent* _p = (Tango::JavaClntIdent*)_v; *_p >>= _s; } static void _0RL_Tango_mJavaClntIdent_unmarshal_fn(cdrStream& _s, void*& _v) { Tango::JavaClntIdent* _p = new Tango::JavaClntIdent; *_p <<= _s; _v = _p; } static void _0RL_Tango_mJavaClntIdent_destructor_fn(void* _v) { Tango::JavaClntIdent* _p = (Tango::JavaClntIdent*)_v; delete _p; } void operator<<=(::CORBA::Any& _a, const Tango::JavaClntIdent& _s) { Tango::JavaClntIdent* _p = new Tango::JavaClntIdent(_s); _a.PR_insert(_0RL_tc_Tango_mJavaClntIdent, _0RL_Tango_mJavaClntIdent_marshal_fn, _0RL_Tango_mJavaClntIdent_destructor_fn, _p); } void operator<<=(::CORBA::Any& _a, Tango::JavaClntIdent* _sp) { _a.PR_insert(_0RL_tc_Tango_mJavaClntIdent, _0RL_Tango_mJavaClntIdent_marshal_fn, _0RL_Tango_mJavaClntIdent_destructor_fn, _sp); } ::CORBA::Boolean operator>>=(const ::CORBA::Any& _a, Tango::JavaClntIdent*& _sp) { return _a >>= (const Tango::JavaClntIdent*&) _sp; } ::CORBA::Boolean operator>>=(const ::CORBA::Any& _a, const Tango::JavaClntIdent*& _sp) { void* _v; if (_a.PR_extract(_0RL_tc_Tango_mJavaClntIdent, _0RL_Tango_mJavaClntIdent_unmarshal_fn, _0RL_Tango_mJavaClntIdent_marshal_fn, _0RL_Tango_mJavaClntIdent_destructor_fn, _v)) { _sp = (const Tango::JavaClntIdent*)_v; return 1; } return 0; } static void _0RL_Tango_mLockerLanguage_marshal_fn(cdrStream& _s, void* _v) { Tango::LockerLanguage* _p = (Tango::LockerLanguage*)_v; *_p >>= _s; } static void _0RL_Tango_mLockerLanguage_unmarshal_fn(cdrStream& _s, void*& _v) { Tango::LockerLanguage* _p = (Tango::LockerLanguage*)_v; *_p <<= _s; } void operator<<=(::CORBA::Any& _a, Tango::LockerLanguage _s) { _a.PR_insert(_0RL_tc_Tango_mLockerLanguage, _0RL_Tango_mLockerLanguage_marshal_fn, &_s); } ::CORBA::Boolean operator>>=(const ::CORBA::Any& _a, Tango::LockerLanguage& _s) { return _a.PR_extract(_0RL_tc_Tango_mLockerLanguage, _0RL_Tango_mLockerLanguage_unmarshal_fn, &_s); } static void _0RL_Tango_mClntIdent_marshal_fn(cdrStream& _s, void* _v) { Tango::ClntIdent* _p = (Tango::ClntIdent*)_v; *_p >>= _s; } static void _0RL_Tango_mClntIdent_unmarshal_fn(cdrStream& _s, void*& _v) { Tango::ClntIdent* _p = new Tango::ClntIdent; *_p <<= _s; _v = _p; } static void _0RL_Tango_mClntIdent_destructor_fn(void* _v) { Tango::ClntIdent* _p = (Tango::ClntIdent*)_v; delete _p; } void operator<<=(::CORBA::Any& _a, const Tango::ClntIdent& _s) { Tango::ClntIdent* _p = new Tango::ClntIdent(_s); _a.PR_insert(_0RL_tc_Tango_mClntIdent, _0RL_Tango_mClntIdent_marshal_fn, _0RL_Tango_mClntIdent_destructor_fn, _p); } void operator<<=(::CORBA::Any& _a, Tango::ClntIdent* _sp) { _a.PR_insert(_0RL_tc_Tango_mClntIdent, _0RL_Tango_mClntIdent_marshal_fn, _0RL_Tango_mClntIdent_destructor_fn, _sp); } ::CORBA::Boolean operator>>=(const ::CORBA::Any& _a, Tango::ClntIdent*& _sp) { return _a >>= (const Tango::ClntIdent*&) _sp; } ::CORBA::Boolean operator>>=(const ::CORBA::Any& _a, const Tango::ClntIdent*& _sp) { void* _v; if (_a.PR_extract(_0RL_tc_Tango_mClntIdent, _0RL_Tango_mClntIdent_unmarshal_fn, _0RL_Tango_mClntIdent_marshal_fn, _0RL_Tango_mClntIdent_destructor_fn, _v)) { _sp = (const Tango::ClntIdent*)_v; return 1; } return 0; } static void _0RL_Tango_mAttrQuality_marshal_fn(cdrStream& _s, void* _v) { Tango::AttrQuality* _p = (Tango::AttrQuality*)_v; *_p >>= _s; } static void _0RL_Tango_mAttrQuality_unmarshal_fn(cdrStream& _s, void*& _v) { Tango::AttrQuality* _p = (Tango::AttrQuality*)_v; *_p <<= _s; } void operator<<=(::CORBA::Any& _a, Tango::AttrQuality _s) { _a.PR_insert(_0RL_tc_Tango_mAttrQuality, _0RL_Tango_mAttrQuality_marshal_fn, &_s); } ::CORBA::Boolean operator>>=(const ::CORBA::Any& _a, Tango::AttrQuality& _s) { return _a.PR_extract(_0RL_tc_Tango_mAttrQuality, _0RL_Tango_mAttrQuality_unmarshal_fn, &_s); } static void _0RL_Tango_mAttrWriteType_marshal_fn(cdrStream& _s, void* _v) { Tango::AttrWriteType* _p = (Tango::AttrWriteType*)_v; *_p >>= _s; } static void _0RL_Tango_mAttrWriteType_unmarshal_fn(cdrStream& _s, void*& _v) { Tango::AttrWriteType* _p = (Tango::AttrWriteType*)_v; *_p <<= _s; } void operator<<=(::CORBA::Any& _a, Tango::AttrWriteType _s) { _a.PR_insert(_0RL_tc_Tango_mAttrWriteType, _0RL_Tango_mAttrWriteType_marshal_fn, &_s); } ::CORBA::Boolean operator>>=(const ::CORBA::Any& _a, Tango::AttrWriteType& _s) { return _a.PR_extract(_0RL_tc_Tango_mAttrWriteType, _0RL_Tango_mAttrWriteType_unmarshal_fn, &_s); } static void _0RL_Tango_mAttrDataFormat_marshal_fn(cdrStream& _s, void* _v) { Tango::AttrDataFormat* _p = (Tango::AttrDataFormat*)_v; *_p >>= _s; } static void _0RL_Tango_mAttrDataFormat_unmarshal_fn(cdrStream& _s, void*& _v) { Tango::AttrDataFormat* _p = (Tango::AttrDataFormat*)_v; *_p <<= _s; } void operator<<=(::CORBA::Any& _a, Tango::AttrDataFormat _s) { _a.PR_insert(_0RL_tc_Tango_mAttrDataFormat, _0RL_Tango_mAttrDataFormat_marshal_fn, &_s); } ::CORBA::Boolean operator>>=(const ::CORBA::Any& _a, Tango::AttrDataFormat& _s) { return _a.PR_extract(_0RL_tc_Tango_mAttrDataFormat, _0RL_Tango_mAttrDataFormat_unmarshal_fn, &_s); } static void _0RL_Tango_mDevSource_marshal_fn(cdrStream& _s, void* _v) { Tango::DevSource* _p = (Tango::DevSource*)_v; *_p >>= _s; } static void _0RL_Tango_mDevSource_unmarshal_fn(cdrStream& _s, void*& _v) { Tango::DevSource* _p = (Tango::DevSource*)_v; *_p <<= _s; } void operator<<=(::CORBA::Any& _a, Tango::DevSource _s) { _a.PR_insert(_0RL_tc_Tango_mDevSource, _0RL_Tango_mDevSource_marshal_fn, &_s); } ::CORBA::Boolean operator>>=(const ::CORBA::Any& _a, Tango::DevSource& _s) { return _a.PR_extract(_0RL_tc_Tango_mDevSource, _0RL_Tango_mDevSource_unmarshal_fn, &_s); } static void _0RL_Tango_mErrSeverity_marshal_fn(cdrStream& _s, void* _v) { Tango::ErrSeverity* _p = (Tango::ErrSeverity*)_v; *_p >>= _s; } static void _0RL_Tango_mErrSeverity_unmarshal_fn(cdrStream& _s, void*& _v) { Tango::ErrSeverity* _p = (Tango::ErrSeverity*)_v; *_p <<= _s; } void operator<<=(::CORBA::Any& _a, Tango::ErrSeverity _s) { _a.PR_insert(_0RL_tc_Tango_mErrSeverity, _0RL_Tango_mErrSeverity_marshal_fn, &_s); } ::CORBA::Boolean operator>>=(const ::CORBA::Any& _a, Tango::ErrSeverity& _s) { return _a.PR_extract(_0RL_tc_Tango_mErrSeverity, _0RL_Tango_mErrSeverity_unmarshal_fn, &_s); } static void _0RL_Tango_mDevState_marshal_fn(cdrStream& _s, void* _v) { Tango::DevState* _p = (Tango::DevState*)_v; *_p >>= _s; } static void _0RL_Tango_mDevState_unmarshal_fn(cdrStream& _s, void*& _v) { Tango::DevState* _p = (Tango::DevState*)_v; *_p <<= _s; } void operator<<=(::CORBA::Any& _a, Tango::DevState _s) { _a.PR_insert(_0RL_tc_Tango_mDevState, _0RL_Tango_mDevState_marshal_fn, &_s); } ::CORBA::Boolean operator>>=(const ::CORBA::Any& _a, Tango::DevState& _s) { return _a.PR_extract(_0RL_tc_Tango_mDevState, _0RL_Tango_mDevState_unmarshal_fn, &_s); } static void _0RL_Tango_mDispLevel_marshal_fn(cdrStream& _s, void* _v) { Tango::DispLevel* _p = (Tango::DispLevel*)_v; *_p >>= _s; } static void _0RL_Tango_mDispLevel_unmarshal_fn(cdrStream& _s, void*& _v) { Tango::DispLevel* _p = (Tango::DispLevel*)_v; *_p <<= _s; } void operator<<=(::CORBA::Any& _a, Tango::DispLevel _s) { _a.PR_insert(_0RL_tc_Tango_mDispLevel, _0RL_Tango_mDispLevel_marshal_fn, &_s); } ::CORBA::Boolean operator>>=(const ::CORBA::Any& _a, Tango::DispLevel& _s) { return _a.PR_extract(_0RL_tc_Tango_mDispLevel, _0RL_Tango_mDispLevel_unmarshal_fn, &_s); } static void _0RL_Tango_mDevVarStateArray_marshal_fn(cdrStream& _s, void* _v) { Tango::DevVarStateArray* _p = (Tango::DevVarStateArray*)_v; *_p >>= _s; } static void _0RL_Tango_mDevVarStateArray_unmarshal_fn(cdrStream& _s, void*& _v) { Tango::DevVarStateArray* _p = new Tango::DevVarStateArray; *_p <<= _s; _v = _p; } static void _0RL_Tango_mDevVarStateArray_destructor_fn(void* _v) { Tango::DevVarStateArray* _p = (Tango::DevVarStateArray*)_v; delete _p; } void operator<<=(::CORBA::Any& _a, const Tango::DevVarStateArray& _s) { Tango::DevVarStateArray* _p = new Tango::DevVarStateArray(_s); _a.PR_insert(_0RL_tc_Tango_mDevVarStateArray, _0RL_Tango_mDevVarStateArray_marshal_fn, _0RL_Tango_mDevVarStateArray_destructor_fn, _p); } void operator<<=(::CORBA::Any& _a, Tango::DevVarStateArray* _sp) { _a.PR_insert(_0RL_tc_Tango_mDevVarStateArray, _0RL_Tango_mDevVarStateArray_marshal_fn, _0RL_Tango_mDevVarStateArray_destructor_fn, _sp); } ::CORBA::Boolean operator>>=(const ::CORBA::Any& _a, Tango::DevVarStateArray*& _sp) { return _a >>= (const Tango::DevVarStateArray*&) _sp; } ::CORBA::Boolean operator>>=(const ::CORBA::Any& _a, const Tango::DevVarStateArray*& _sp) { void* _v; if (_a.PR_extract(_0RL_tc_Tango_mDevVarStateArray, _0RL_Tango_mDevVarStateArray_unmarshal_fn, _0RL_Tango_mDevVarStateArray_marshal_fn, _0RL_Tango_mDevVarStateArray_destructor_fn, _v)) { _sp = (const Tango::DevVarStateArray*)_v; return 1; } return 0; } static void _0RL_Tango_mTimeVal_marshal_fn(cdrStream& _s, void* _v) { Tango::TimeVal* _p = (Tango::TimeVal*)_v; *_p >>= _s; } static void _0RL_Tango_mTimeVal_unmarshal_fn(cdrStream& _s, void*& _v) { Tango::TimeVal* _p = new Tango::TimeVal; *_p <<= _s; _v = _p; } static void _0RL_Tango_mTimeVal_destructor_fn(void* _v) { Tango::TimeVal* _p = (Tango::TimeVal*)_v; delete _p; } void operator<<=(::CORBA::Any& _a, const Tango::TimeVal& _s) { Tango::TimeVal* _p = new Tango::TimeVal(_s); _a.PR_insert(_0RL_tc_Tango_mTimeVal, _0RL_Tango_mTimeVal_marshal_fn, _0RL_Tango_mTimeVal_destructor_fn, _p); } void operator<<=(::CORBA::Any& _a, Tango::TimeVal* _sp) { _a.PR_insert(_0RL_tc_Tango_mTimeVal, _0RL_Tango_mTimeVal_marshal_fn, _0RL_Tango_mTimeVal_destructor_fn, _sp); } ::CORBA::Boolean operator>>=(const ::CORBA::Any& _a, Tango::TimeVal*& _sp) { return _a >>= (const Tango::TimeVal*&) _sp; } ::CORBA::Boolean operator>>=(const ::CORBA::Any& _a, const Tango::TimeVal*& _sp) { void* _v; if (_a.PR_extract(_0RL_tc_Tango_mTimeVal, _0RL_Tango_mTimeVal_unmarshal_fn, _0RL_Tango_mTimeVal_marshal_fn, _0RL_Tango_mTimeVal_destructor_fn, _v)) { _sp = (const Tango::TimeVal*)_v; return 1; } return 0; } static void _0RL_Tango_mDevCmdInfo_marshal_fn(cdrStream& _s, void* _v) { Tango::DevCmdInfo* _p = (Tango::DevCmdInfo*)_v; *_p >>= _s; } static void _0RL_Tango_mDevCmdInfo_unmarshal_fn(cdrStream& _s, void*& _v) { Tango::DevCmdInfo* _p = new Tango::DevCmdInfo; *_p <<= _s; _v = _p; } static void _0RL_Tango_mDevCmdInfo_destructor_fn(void* _v) { Tango::DevCmdInfo* _p = (Tango::DevCmdInfo*)_v; delete _p; } void operator<<=(::CORBA::Any& _a, const Tango::DevCmdInfo& _s) { Tango::DevCmdInfo* _p = new Tango::DevCmdInfo(_s); _a.PR_insert(_0RL_tc_Tango_mDevCmdInfo, _0RL_Tango_mDevCmdInfo_marshal_fn, _0RL_Tango_mDevCmdInfo_destructor_fn, _p); } void operator<<=(::CORBA::Any& _a, Tango::DevCmdInfo* _sp) { _a.PR_insert(_0RL_tc_Tango_mDevCmdInfo, _0RL_Tango_mDevCmdInfo_marshal_fn, _0RL_Tango_mDevCmdInfo_destructor_fn, _sp); } ::CORBA::Boolean operator>>=(const ::CORBA::Any& _a, Tango::DevCmdInfo*& _sp) { return _a >>= (const Tango::DevCmdInfo*&) _sp; } ::CORBA::Boolean operator>>=(const ::CORBA::Any& _a, const Tango::DevCmdInfo*& _sp) { void* _v; if (_a.PR_extract(_0RL_tc_Tango_mDevCmdInfo, _0RL_Tango_mDevCmdInfo_unmarshal_fn, _0RL_Tango_mDevCmdInfo_marshal_fn, _0RL_Tango_mDevCmdInfo_destructor_fn, _v)) { _sp = (const Tango::DevCmdInfo*)_v; return 1; } return 0; } static void _0RL_Tango_mDevCmdInfo__2_marshal_fn(cdrStream& _s, void* _v) { Tango::DevCmdInfo_2* _p = (Tango::DevCmdInfo_2*)_v; *_p >>= _s; } static void _0RL_Tango_mDevCmdInfo__2_unmarshal_fn(cdrStream& _s, void*& _v) { Tango::DevCmdInfo_2* _p = new Tango::DevCmdInfo_2; *_p <<= _s; _v = _p; } static void _0RL_Tango_mDevCmdInfo__2_destructor_fn(void* _v) { Tango::DevCmdInfo_2* _p = (Tango::DevCmdInfo_2*)_v; delete _p; } void operator<<=(::CORBA::Any& _a, const Tango::DevCmdInfo_2& _s) { Tango::DevCmdInfo_2* _p = new Tango::DevCmdInfo_2(_s); _a.PR_insert(_0RL_tc_Tango_mDevCmdInfo__2, _0RL_Tango_mDevCmdInfo__2_marshal_fn, _0RL_Tango_mDevCmdInfo__2_destructor_fn, _p); } void operator<<=(::CORBA::Any& _a, Tango::DevCmdInfo_2* _sp) { _a.PR_insert(_0RL_tc_Tango_mDevCmdInfo__2, _0RL_Tango_mDevCmdInfo__2_marshal_fn, _0RL_Tango_mDevCmdInfo__2_destructor_fn, _sp); } ::CORBA::Boolean operator>>=(const ::CORBA::Any& _a, Tango::DevCmdInfo_2*& _sp) { return _a >>= (const Tango::DevCmdInfo_2*&) _sp; } ::CORBA::Boolean operator>>=(const ::CORBA::Any& _a, const Tango::DevCmdInfo_2*& _sp) { void* _v; if (_a.PR_extract(_0RL_tc_Tango_mDevCmdInfo__2, _0RL_Tango_mDevCmdInfo__2_unmarshal_fn, _0RL_Tango_mDevCmdInfo__2_marshal_fn, _0RL_Tango_mDevCmdInfo__2_destructor_fn, _v)) { _sp = (const Tango::DevCmdInfo_2*)_v; return 1; } return 0; } static void _0RL_Tango_mDevCmdInfoList_marshal_fn(cdrStream& _s, void* _v) { Tango::DevCmdInfoList* _p = (Tango::DevCmdInfoList*)_v; *_p >>= _s; } static void _0RL_Tango_mDevCmdInfoList_unmarshal_fn(cdrStream& _s, void*& _v) { Tango::DevCmdInfoList* _p = new Tango::DevCmdInfoList; *_p <<= _s; _v = _p; } static void _0RL_Tango_mDevCmdInfoList_destructor_fn(void* _v) { Tango::DevCmdInfoList* _p = (Tango::DevCmdInfoList*)_v; delete _p; } void operator<<=(::CORBA::Any& _a, const Tango::DevCmdInfoList& _s) { Tango::DevCmdInfoList* _p = new Tango::DevCmdInfoList(_s); _a.PR_insert(_0RL_tc_Tango_mDevCmdInfoList, _0RL_Tango_mDevCmdInfoList_marshal_fn, _0RL_Tango_mDevCmdInfoList_destructor_fn, _p); } void operator<<=(::CORBA::Any& _a, Tango::DevCmdInfoList* _sp) { _a.PR_insert(_0RL_tc_Tango_mDevCmdInfoList, _0RL_Tango_mDevCmdInfoList_marshal_fn, _0RL_Tango_mDevCmdInfoList_destructor_fn, _sp); } ::CORBA::Boolean operator>>=(const ::CORBA::Any& _a, Tango::DevCmdInfoList*& _sp) { return _a >>= (const Tango::DevCmdInfoList*&) _sp; } ::CORBA::Boolean operator>>=(const ::CORBA::Any& _a, const Tango::DevCmdInfoList*& _sp) { void* _v; if (_a.PR_extract(_0RL_tc_Tango_mDevCmdInfoList, _0RL_Tango_mDevCmdInfoList_unmarshal_fn, _0RL_Tango_mDevCmdInfoList_marshal_fn, _0RL_Tango_mDevCmdInfoList_destructor_fn, _v)) { _sp = (const Tango::DevCmdInfoList*)_v; return 1; } return 0; } static void _0RL_Tango_mDevCmdInfoList__2_marshal_fn(cdrStream& _s, void* _v) { Tango::DevCmdInfoList_2* _p = (Tango::DevCmdInfoList_2*)_v; *_p >>= _s; } static void _0RL_Tango_mDevCmdInfoList__2_unmarshal_fn(cdrStream& _s, void*& _v) { Tango::DevCmdInfoList_2* _p = new Tango::DevCmdInfoList_2; *_p <<= _s; _v = _p; } static void _0RL_Tango_mDevCmdInfoList__2_destructor_fn(void* _v) { Tango::DevCmdInfoList_2* _p = (Tango::DevCmdInfoList_2*)_v; delete _p; } void operator<<=(::CORBA::Any& _a, const Tango::DevCmdInfoList_2& _s) { Tango::DevCmdInfoList_2* _p = new Tango::DevCmdInfoList_2(_s); _a.PR_insert(_0RL_tc_Tango_mDevCmdInfoList__2, _0RL_Tango_mDevCmdInfoList__2_marshal_fn, _0RL_Tango_mDevCmdInfoList__2_destructor_fn, _p); } void operator<<=(::CORBA::Any& _a, Tango::DevCmdInfoList_2* _sp) { _a.PR_insert(_0RL_tc_Tango_mDevCmdInfoList__2, _0RL_Tango_mDevCmdInfoList__2_marshal_fn, _0RL_Tango_mDevCmdInfoList__2_destructor_fn, _sp); } ::CORBA::Boolean operator>>=(const ::CORBA::Any& _a, Tango::DevCmdInfoList_2*& _sp) { return _a >>= (const Tango::DevCmdInfoList_2*&) _sp; } ::CORBA::Boolean operator>>=(const ::CORBA::Any& _a, const Tango::DevCmdInfoList_2*& _sp) { void* _v; if (_a.PR_extract(_0RL_tc_Tango_mDevCmdInfoList__2, _0RL_Tango_mDevCmdInfoList__2_unmarshal_fn, _0RL_Tango_mDevCmdInfoList__2_marshal_fn, _0RL_Tango_mDevCmdInfoList__2_destructor_fn, _v)) { _sp = (const Tango::DevCmdInfoList_2*)_v; return 1; } return 0; } static void _0RL_Tango_mDevError_marshal_fn(cdrStream& _s, void* _v) { Tango::DevError* _p = (Tango::DevError*)_v; *_p >>= _s; } static void _0RL_Tango_mDevError_unmarshal_fn(cdrStream& _s, void*& _v) { Tango::DevError* _p = new Tango::DevError; *_p <<= _s; _v = _p; } static void _0RL_Tango_mDevError_destructor_fn(void* _v) { Tango::DevError* _p = (Tango::DevError*)_v; delete _p; } void operator<<=(::CORBA::Any& _a, const Tango::DevError& _s) { Tango::DevError* _p = new Tango::DevError(_s); _a.PR_insert(_0RL_tc_Tango_mDevError, _0RL_Tango_mDevError_marshal_fn, _0RL_Tango_mDevError_destructor_fn, _p); } void operator<<=(::CORBA::Any& _a, Tango::DevError* _sp) { _a.PR_insert(_0RL_tc_Tango_mDevError, _0RL_Tango_mDevError_marshal_fn, _0RL_Tango_mDevError_destructor_fn, _sp); } ::CORBA::Boolean operator>>=(const ::CORBA::Any& _a, Tango::DevError*& _sp) { return _a >>= (const Tango::DevError*&) _sp; } ::CORBA::Boolean operator>>=(const ::CORBA::Any& _a, const Tango::DevError*& _sp) { void* _v; if (_a.PR_extract(_0RL_tc_Tango_mDevError, _0RL_Tango_mDevError_unmarshal_fn, _0RL_Tango_mDevError_marshal_fn, _0RL_Tango_mDevError_destructor_fn, _v)) { _sp = (const Tango::DevError*)_v; return 1; } return 0; } static void _0RL_Tango_mDevErrorList_marshal_fn(cdrStream& _s, void* _v) { Tango::DevErrorList* _p = (Tango::DevErrorList*)_v; *_p >>= _s; } static void _0RL_Tango_mDevErrorList_unmarshal_fn(cdrStream& _s, void*& _v) { Tango::DevErrorList* _p = new Tango::DevErrorList; *_p <<= _s; _v = _p; } static void _0RL_Tango_mDevErrorList_destructor_fn(void* _v) { Tango::DevErrorList* _p = (Tango::DevErrorList*)_v; delete _p; } void operator<<=(::CORBA::Any& _a, const Tango::DevErrorList& _s) { Tango::DevErrorList* _p = new Tango::DevErrorList(_s); _a.PR_insert(_0RL_tc_Tango_mDevErrorList, _0RL_Tango_mDevErrorList_marshal_fn, _0RL_Tango_mDevErrorList_destructor_fn, _p); } void operator<<=(::CORBA::Any& _a, Tango::DevErrorList* _sp) { _a.PR_insert(_0RL_tc_Tango_mDevErrorList, _0RL_Tango_mDevErrorList_marshal_fn, _0RL_Tango_mDevErrorList_destructor_fn, _sp); } ::CORBA::Boolean operator>>=(const ::CORBA::Any& _a, Tango::DevErrorList*& _sp) { return _a >>= (const Tango::DevErrorList*&) _sp; } ::CORBA::Boolean operator>>=(const ::CORBA::Any& _a, const Tango::DevErrorList*& _sp) { void* _v; if (_a.PR_extract(_0RL_tc_Tango_mDevErrorList, _0RL_Tango_mDevErrorList_unmarshal_fn, _0RL_Tango_mDevErrorList_marshal_fn, _0RL_Tango_mDevErrorList_destructor_fn, _v)) { _sp = (const Tango::DevErrorList*)_v; return 1; } return 0; } static void _0RL_Tango_mNamedDevError_marshal_fn(cdrStream& _s, void* _v) { Tango::NamedDevError* _p = (Tango::NamedDevError*)_v; *_p >>= _s; } static void _0RL_Tango_mNamedDevError_unmarshal_fn(cdrStream& _s, void*& _v) { Tango::NamedDevError* _p = new Tango::NamedDevError; *_p <<= _s; _v = _p; } static void _0RL_Tango_mNamedDevError_destructor_fn(void* _v) { Tango::NamedDevError* _p = (Tango::NamedDevError*)_v; delete _p; } void operator<<=(::CORBA::Any& _a, const Tango::NamedDevError& _s) { Tango::NamedDevError* _p = new Tango::NamedDevError(_s); _a.PR_insert(_0RL_tc_Tango_mNamedDevError, _0RL_Tango_mNamedDevError_marshal_fn, _0RL_Tango_mNamedDevError_destructor_fn, _p); } void operator<<=(::CORBA::Any& _a, Tango::NamedDevError* _sp) { _a.PR_insert(_0RL_tc_Tango_mNamedDevError, _0RL_Tango_mNamedDevError_marshal_fn, _0RL_Tango_mNamedDevError_destructor_fn, _sp); } ::CORBA::Boolean operator>>=(const ::CORBA::Any& _a, Tango::NamedDevError*& _sp) { return _a >>= (const Tango::NamedDevError*&) _sp; } ::CORBA::Boolean operator>>=(const ::CORBA::Any& _a, const Tango::NamedDevError*& _sp) { void* _v; if (_a.PR_extract(_0RL_tc_Tango_mNamedDevError, _0RL_Tango_mNamedDevError_unmarshal_fn, _0RL_Tango_mNamedDevError_marshal_fn, _0RL_Tango_mNamedDevError_destructor_fn, _v)) { _sp = (const Tango::NamedDevError*)_v; return 1; } return 0; } static void _0RL_Tango_mNamedDevErrorList_marshal_fn(cdrStream& _s, void* _v) { Tango::NamedDevErrorList* _p = (Tango::NamedDevErrorList*)_v; *_p >>= _s; } static void _0RL_Tango_mNamedDevErrorList_unmarshal_fn(cdrStream& _s, void*& _v) { Tango::NamedDevErrorList* _p = new Tango::NamedDevErrorList; *_p <<= _s; _v = _p; } static void _0RL_Tango_mNamedDevErrorList_destructor_fn(void* _v) { Tango::NamedDevErrorList* _p = (Tango::NamedDevErrorList*)_v; delete _p; } void operator<<=(::CORBA::Any& _a, const Tango::NamedDevErrorList& _s) { Tango::NamedDevErrorList* _p = new Tango::NamedDevErrorList(_s); _a.PR_insert(_0RL_tc_Tango_mNamedDevErrorList, _0RL_Tango_mNamedDevErrorList_marshal_fn, _0RL_Tango_mNamedDevErrorList_destructor_fn, _p); } void operator<<=(::CORBA::Any& _a, Tango::NamedDevErrorList* _sp) { _a.PR_insert(_0RL_tc_Tango_mNamedDevErrorList, _0RL_Tango_mNamedDevErrorList_marshal_fn, _0RL_Tango_mNamedDevErrorList_destructor_fn, _sp); } ::CORBA::Boolean operator>>=(const ::CORBA::Any& _a, Tango::NamedDevErrorList*& _sp) { return _a >>= (const Tango::NamedDevErrorList*&) _sp; } ::CORBA::Boolean operator>>=(const ::CORBA::Any& _a, const Tango::NamedDevErrorList*& _sp) { void* _v; if (_a.PR_extract(_0RL_tc_Tango_mNamedDevErrorList, _0RL_Tango_mNamedDevErrorList_unmarshal_fn, _0RL_Tango_mNamedDevErrorList_marshal_fn, _0RL_Tango_mNamedDevErrorList_destructor_fn, _v)) { _sp = (const Tango::NamedDevErrorList*)_v; return 1; } return 0; } static void _0RL_Tango_mDevFailed_marshal_fn(cdrStream& _s, void* _v) { const Tango::DevFailed* _p = (const Tango::DevFailed*)_v; *_p >>= _s; } static void _0RL_Tango_mDevFailed_unmarshal_fn(cdrStream& _s, void*& _v) { Tango::DevFailed* _p = new Tango::DevFailed; *_p <<= _s; _v = _p; } static void _0RL_Tango_mDevFailed_destructor_fn(void* _v) { Tango::DevFailed* _p = (Tango::DevFailed*)_v; delete _p; } void operator<<=(::CORBA::Any& _a, const Tango::DevFailed& _s) { Tango::DevFailed* _p = new Tango::DevFailed(_s); _a.PR_insert(_0RL_tc_Tango_mDevFailed, _0RL_Tango_mDevFailed_marshal_fn, _0RL_Tango_mDevFailed_destructor_fn, _p); } void operator<<=(::CORBA::Any& _a, const Tango::DevFailed* _sp) { _a.PR_insert(_0RL_tc_Tango_mDevFailed, _0RL_Tango_mDevFailed_marshal_fn, _0RL_Tango_mDevFailed_destructor_fn, (Tango::DevFailed*)_sp); } ::CORBA::Boolean operator>>=(const ::CORBA::Any& _a, const Tango::DevFailed*& _sp) { void* _v; if (_a.PR_extract(_0RL_tc_Tango_mDevFailed, _0RL_Tango_mDevFailed_unmarshal_fn, _0RL_Tango_mDevFailed_marshal_fn, _0RL_Tango_mDevFailed_destructor_fn, _v)) { _sp = (const Tango::DevFailed*)_v; return 1; } return 0; } static void _0RL_insertToAny__cTango_mDevFailed(::CORBA::Any& _a, const ::CORBA::Exception& _e) { const Tango::DevFailed & _ex = (const Tango::DevFailed &) _e; operator<<=(_a,_ex); } static void _0RL_insertToAnyNCP__cTango_mDevFailed (::CORBA::Any& _a, const ::CORBA::Exception* _e) { const Tango::DevFailed* _ex = (const Tango::DevFailed*) _e; operator<<=(_a,_ex); } class _0RL_insertToAny_Singleton__cTango_mDevFailed { public: _0RL_insertToAny_Singleton__cTango_mDevFailed() { Tango::DevFailed::insertToAnyFn = _0RL_insertToAny__cTango_mDevFailed; Tango::DevFailed::insertToAnyFnNCP = _0RL_insertToAnyNCP__cTango_mDevFailed; } }; static _0RL_insertToAny_Singleton__cTango_mDevFailed _0RL_insertToAny_Singleton__cTango_mDevFailed_; static void _0RL_Tango_mMultiDevFailed_marshal_fn(cdrStream& _s, void* _v) { const Tango::MultiDevFailed* _p = (const Tango::MultiDevFailed*)_v; *_p >>= _s; } static void _0RL_Tango_mMultiDevFailed_unmarshal_fn(cdrStream& _s, void*& _v) { Tango::MultiDevFailed* _p = new Tango::MultiDevFailed; *_p <<= _s; _v = _p; } static void _0RL_Tango_mMultiDevFailed_destructor_fn(void* _v) { Tango::MultiDevFailed* _p = (Tango::MultiDevFailed*)_v; delete _p; } void operator<<=(::CORBA::Any& _a, const Tango::MultiDevFailed& _s) { Tango::MultiDevFailed* _p = new Tango::MultiDevFailed(_s); _a.PR_insert(_0RL_tc_Tango_mMultiDevFailed, _0RL_Tango_mMultiDevFailed_marshal_fn, _0RL_Tango_mMultiDevFailed_destructor_fn, _p); } void operator<<=(::CORBA::Any& _a, const Tango::MultiDevFailed* _sp) { _a.PR_insert(_0RL_tc_Tango_mMultiDevFailed, _0RL_Tango_mMultiDevFailed_marshal_fn, _0RL_Tango_mMultiDevFailed_destructor_fn, (Tango::MultiDevFailed*)_sp); } ::CORBA::Boolean operator>>=(const ::CORBA::Any& _a, const Tango::MultiDevFailed*& _sp) { void* _v; if (_a.PR_extract(_0RL_tc_Tango_mMultiDevFailed, _0RL_Tango_mMultiDevFailed_unmarshal_fn, _0RL_Tango_mMultiDevFailed_marshal_fn, _0RL_Tango_mMultiDevFailed_destructor_fn, _v)) { _sp = (const Tango::MultiDevFailed*)_v; return 1; } return 0; } static void _0RL_insertToAny__cTango_mMultiDevFailed(::CORBA::Any& _a, const ::CORBA::Exception& _e) { const Tango::MultiDevFailed & _ex = (const Tango::MultiDevFailed &) _e; operator<<=(_a,_ex); } static void _0RL_insertToAnyNCP__cTango_mMultiDevFailed (::CORBA::Any& _a, const ::CORBA::Exception* _e) { const Tango::MultiDevFailed* _ex = (const Tango::MultiDevFailed*) _e; operator<<=(_a,_ex); } class _0RL_insertToAny_Singleton__cTango_mMultiDevFailed { public: _0RL_insertToAny_Singleton__cTango_mMultiDevFailed() { Tango::MultiDevFailed::insertToAnyFn = _0RL_insertToAny__cTango_mMultiDevFailed; Tango::MultiDevFailed::insertToAnyFnNCP = _0RL_insertToAnyNCP__cTango_mMultiDevFailed; } }; static _0RL_insertToAny_Singleton__cTango_mMultiDevFailed _0RL_insertToAny_Singleton__cTango_mMultiDevFailed_; static void _0RL_Tango_mAttributeConfig_marshal_fn(cdrStream& _s, void* _v) { Tango::AttributeConfig* _p = (Tango::AttributeConfig*)_v; *_p >>= _s; } static void _0RL_Tango_mAttributeConfig_unmarshal_fn(cdrStream& _s, void*& _v) { Tango::AttributeConfig* _p = new Tango::AttributeConfig; *_p <<= _s; _v = _p; } static void _0RL_Tango_mAttributeConfig_destructor_fn(void* _v) { Tango::AttributeConfig* _p = (Tango::AttributeConfig*)_v; delete _p; } void operator<<=(::CORBA::Any& _a, const Tango::AttributeConfig& _s) { Tango::AttributeConfig* _p = new Tango::AttributeConfig(_s); _a.PR_insert(_0RL_tc_Tango_mAttributeConfig, _0RL_Tango_mAttributeConfig_marshal_fn, _0RL_Tango_mAttributeConfig_destructor_fn, _p); } void operator<<=(::CORBA::Any& _a, Tango::AttributeConfig* _sp) { _a.PR_insert(_0RL_tc_Tango_mAttributeConfig, _0RL_Tango_mAttributeConfig_marshal_fn, _0RL_Tango_mAttributeConfig_destructor_fn, _sp); } ::CORBA::Boolean operator>>=(const ::CORBA::Any& _a, Tango::AttributeConfig*& _sp) { return _a >>= (const Tango::AttributeConfig*&) _sp; } ::CORBA::Boolean operator>>=(const ::CORBA::Any& _a, const Tango::AttributeConfig*& _sp) { void* _v; if (_a.PR_extract(_0RL_tc_Tango_mAttributeConfig, _0RL_Tango_mAttributeConfig_unmarshal_fn, _0RL_Tango_mAttributeConfig_marshal_fn, _0RL_Tango_mAttributeConfig_destructor_fn, _v)) { _sp = (const Tango::AttributeConfig*)_v; return 1; } return 0; } static void _0RL_Tango_mAttributeConfig__2_marshal_fn(cdrStream& _s, void* _v) { Tango::AttributeConfig_2* _p = (Tango::AttributeConfig_2*)_v; *_p >>= _s; } static void _0RL_Tango_mAttributeConfig__2_unmarshal_fn(cdrStream& _s, void*& _v) { Tango::AttributeConfig_2* _p = new Tango::AttributeConfig_2; *_p <<= _s; _v = _p; } static void _0RL_Tango_mAttributeConfig__2_destructor_fn(void* _v) { Tango::AttributeConfig_2* _p = (Tango::AttributeConfig_2*)_v; delete _p; } void operator<<=(::CORBA::Any& _a, const Tango::AttributeConfig_2& _s) { Tango::AttributeConfig_2* _p = new Tango::AttributeConfig_2(_s); _a.PR_insert(_0RL_tc_Tango_mAttributeConfig__2, _0RL_Tango_mAttributeConfig__2_marshal_fn, _0RL_Tango_mAttributeConfig__2_destructor_fn, _p); } void operator<<=(::CORBA::Any& _a, Tango::AttributeConfig_2* _sp) { _a.PR_insert(_0RL_tc_Tango_mAttributeConfig__2, _0RL_Tango_mAttributeConfig__2_marshal_fn, _0RL_Tango_mAttributeConfig__2_destructor_fn, _sp); } ::CORBA::Boolean operator>>=(const ::CORBA::Any& _a, Tango::AttributeConfig_2*& _sp) { return _a >>= (const Tango::AttributeConfig_2*&) _sp; } ::CORBA::Boolean operator>>=(const ::CORBA::Any& _a, const Tango::AttributeConfig_2*& _sp) { void* _v; if (_a.PR_extract(_0RL_tc_Tango_mAttributeConfig__2, _0RL_Tango_mAttributeConfig__2_unmarshal_fn, _0RL_Tango_mAttributeConfig__2_marshal_fn, _0RL_Tango_mAttributeConfig__2_destructor_fn, _v)) { _sp = (const Tango::AttributeConfig_2*)_v; return 1; } return 0; } static void _0RL_Tango_mAttributeValue_marshal_fn(cdrStream& _s, void* _v) { Tango::AttributeValue* _p = (Tango::AttributeValue*)_v; *_p >>= _s; } static void _0RL_Tango_mAttributeValue_unmarshal_fn(cdrStream& _s, void*& _v) { Tango::AttributeValue* _p = new Tango::AttributeValue; *_p <<= _s; _v = _p; } static void _0RL_Tango_mAttributeValue_destructor_fn(void* _v) { Tango::AttributeValue* _p = (Tango::AttributeValue*)_v; delete _p; } void operator<<=(::CORBA::Any& _a, const Tango::AttributeValue& _s) { Tango::AttributeValue* _p = new Tango::AttributeValue(_s); _a.PR_insert(_0RL_tc_Tango_mAttributeValue, _0RL_Tango_mAttributeValue_marshal_fn, _0RL_Tango_mAttributeValue_destructor_fn, _p); } void operator<<=(::CORBA::Any& _a, Tango::AttributeValue* _sp) { _a.PR_insert(_0RL_tc_Tango_mAttributeValue, _0RL_Tango_mAttributeValue_marshal_fn, _0RL_Tango_mAttributeValue_destructor_fn, _sp); } ::CORBA::Boolean operator>>=(const ::CORBA::Any& _a, Tango::AttributeValue*& _sp) { return _a >>= (const Tango::AttributeValue*&) _sp; } ::CORBA::Boolean operator>>=(const ::CORBA::Any& _a, const Tango::AttributeValue*& _sp) { void* _v; if (_a.PR_extract(_0RL_tc_Tango_mAttributeValue, _0RL_Tango_mAttributeValue_unmarshal_fn, _0RL_Tango_mAttributeValue_marshal_fn, _0RL_Tango_mAttributeValue_destructor_fn, _v)) { _sp = (const Tango::AttributeValue*)_v; return 1; } return 0; } static void _0RL_Tango_mAttributeDim_marshal_fn(cdrStream& _s, void* _v) { Tango::AttributeDim* _p = (Tango::AttributeDim*)_v; *_p >>= _s; } static void _0RL_Tango_mAttributeDim_unmarshal_fn(cdrStream& _s, void*& _v) { Tango::AttributeDim* _p = new Tango::AttributeDim; *_p <<= _s; _v = _p; } static void _0RL_Tango_mAttributeDim_destructor_fn(void* _v) { Tango::AttributeDim* _p = (Tango::AttributeDim*)_v; delete _p; } void operator<<=(::CORBA::Any& _a, const Tango::AttributeDim& _s) { Tango::AttributeDim* _p = new Tango::AttributeDim(_s); _a.PR_insert(_0RL_tc_Tango_mAttributeDim, _0RL_Tango_mAttributeDim_marshal_fn, _0RL_Tango_mAttributeDim_destructor_fn, _p); } void operator<<=(::CORBA::Any& _a, Tango::AttributeDim* _sp) { _a.PR_insert(_0RL_tc_Tango_mAttributeDim, _0RL_Tango_mAttributeDim_marshal_fn, _0RL_Tango_mAttributeDim_destructor_fn, _sp); } ::CORBA::Boolean operator>>=(const ::CORBA::Any& _a, Tango::AttributeDim*& _sp) { return _a >>= (const Tango::AttributeDim*&) _sp; } ::CORBA::Boolean operator>>=(const ::CORBA::Any& _a, const Tango::AttributeDim*& _sp) { void* _v; if (_a.PR_extract(_0RL_tc_Tango_mAttributeDim, _0RL_Tango_mAttributeDim_unmarshal_fn, _0RL_Tango_mAttributeDim_marshal_fn, _0RL_Tango_mAttributeDim_destructor_fn, _v)) { _sp = (const Tango::AttributeDim*)_v; return 1; } return 0; } static void _0RL_Tango_mAttributeValue__3_marshal_fn(cdrStream& _s, void* _v) { Tango::AttributeValue_3* _p = (Tango::AttributeValue_3*)_v; *_p >>= _s; } static void _0RL_Tango_mAttributeValue__3_unmarshal_fn(cdrStream& _s, void*& _v) { Tango::AttributeValue_3* _p = new Tango::AttributeValue_3; *_p <<= _s; _v = _p; } static void _0RL_Tango_mAttributeValue__3_destructor_fn(void* _v) { Tango::AttributeValue_3* _p = (Tango::AttributeValue_3*)_v; delete _p; } void operator<<=(::CORBA::Any& _a, const Tango::AttributeValue_3& _s) { Tango::AttributeValue_3* _p = new Tango::AttributeValue_3(_s); _a.PR_insert(_0RL_tc_Tango_mAttributeValue__3, _0RL_Tango_mAttributeValue__3_marshal_fn, _0RL_Tango_mAttributeValue__3_destructor_fn, _p); } void operator<<=(::CORBA::Any& _a, Tango::AttributeValue_3* _sp) { _a.PR_insert(_0RL_tc_Tango_mAttributeValue__3, _0RL_Tango_mAttributeValue__3_marshal_fn, _0RL_Tango_mAttributeValue__3_destructor_fn, _sp); } ::CORBA::Boolean operator>>=(const ::CORBA::Any& _a, Tango::AttributeValue_3*& _sp) { return _a >>= (const Tango::AttributeValue_3*&) _sp; } ::CORBA::Boolean operator>>=(const ::CORBA::Any& _a, const Tango::AttributeValue_3*& _sp) { void* _v; if (_a.PR_extract(_0RL_tc_Tango_mAttributeValue__3, _0RL_Tango_mAttributeValue__3_unmarshal_fn, _0RL_Tango_mAttributeValue__3_marshal_fn, _0RL_Tango_mAttributeValue__3_destructor_fn, _v)) { _sp = (const Tango::AttributeValue_3*)_v; return 1; } return 0; } static void _0RL_Tango_mAttributeDataType_marshal_fn(cdrStream& _s, void* _v) { Tango::AttributeDataType* _p = (Tango::AttributeDataType*)_v; *_p >>= _s; } static void _0RL_Tango_mAttributeDataType_unmarshal_fn(cdrStream& _s, void*& _v) { Tango::AttributeDataType* _p = (Tango::AttributeDataType*)_v; *_p <<= _s; } void operator<<=(::CORBA::Any& _a, Tango::AttributeDataType _s) { _a.PR_insert(_0RL_tc_Tango_mAttributeDataType, _0RL_Tango_mAttributeDataType_marshal_fn, &_s); } ::CORBA::Boolean operator>>=(const ::CORBA::Any& _a, Tango::AttributeDataType& _s) { return _a.PR_extract(_0RL_tc_Tango_mAttributeDataType, _0RL_Tango_mAttributeDataType_unmarshal_fn, &_s); } static void _0RL_Tango_mAttrValUnion_marshal_fn(cdrStream& _s, void* _v) { Tango::AttrValUnion* _p = (Tango::AttrValUnion*)_v; *_p >>= _s; } static void _0RL_Tango_mAttrValUnion_unmarshal_fn(cdrStream& _s, void*& _v) { Tango::AttrValUnion* _p = new Tango::AttrValUnion; *_p <<= _s; _v = _p; } static void _0RL_Tango_mAttrValUnion_destructor_fn(void* _v) { Tango::AttrValUnion* _p = (Tango::AttrValUnion*)_v; delete _p; } void operator<<=(::CORBA::Any& _a, const Tango::AttrValUnion& _s) { Tango::AttrValUnion* _p = new Tango::AttrValUnion(_s); _a.PR_insert(_0RL_tc_Tango_mAttrValUnion, _0RL_Tango_mAttrValUnion_marshal_fn, _0RL_Tango_mAttrValUnion_destructor_fn, _p); } void operator<<=(::CORBA::Any& _a, Tango::AttrValUnion* _sp) { _a.PR_insert(_0RL_tc_Tango_mAttrValUnion, _0RL_Tango_mAttrValUnion_marshal_fn, _0RL_Tango_mAttrValUnion_destructor_fn, _sp); } ::CORBA::Boolean operator>>=(const ::CORBA::Any& _a, Tango::AttrValUnion*& _sp) { return _a >>= (const Tango::AttrValUnion*&) _sp; } ::CORBA::Boolean operator>>=(const ::CORBA::Any& _a, const Tango::AttrValUnion*& _sp) { void* _v; if (_a.PR_extract(_0RL_tc_Tango_mAttrValUnion, _0RL_Tango_mAttrValUnion_unmarshal_fn, _0RL_Tango_mAttrValUnion_marshal_fn, _0RL_Tango_mAttrValUnion_destructor_fn, _v)) { _sp = (const Tango::AttrValUnion*)_v; return 1; } return 0; } static void _0RL_Tango_mAttributeValue__4_marshal_fn(cdrStream& _s, void* _v) { Tango::AttributeValue_4* _p = (Tango::AttributeValue_4*)_v; *_p >>= _s; } static void _0RL_Tango_mAttributeValue__4_unmarshal_fn(cdrStream& _s, void*& _v) { Tango::AttributeValue_4* _p = new Tango::AttributeValue_4; *_p <<= _s; _v = _p; } static void _0RL_Tango_mAttributeValue__4_destructor_fn(void* _v) { Tango::AttributeValue_4* _p = (Tango::AttributeValue_4*)_v; delete _p; } void operator<<=(::CORBA::Any& _a, const Tango::AttributeValue_4& _s) { Tango::AttributeValue_4* _p = new Tango::AttributeValue_4(_s); _a.PR_insert(_0RL_tc_Tango_mAttributeValue__4, _0RL_Tango_mAttributeValue__4_marshal_fn, _0RL_Tango_mAttributeValue__4_destructor_fn, _p); } void operator<<=(::CORBA::Any& _a, Tango::AttributeValue_4* _sp) { _a.PR_insert(_0RL_tc_Tango_mAttributeValue__4, _0RL_Tango_mAttributeValue__4_marshal_fn, _0RL_Tango_mAttributeValue__4_destructor_fn, _sp); } ::CORBA::Boolean operator>>=(const ::CORBA::Any& _a, Tango::AttributeValue_4*& _sp) { return _a >>= (const Tango::AttributeValue_4*&) _sp; } ::CORBA::Boolean operator>>=(const ::CORBA::Any& _a, const Tango::AttributeValue_4*& _sp) { void* _v; if (_a.PR_extract(_0RL_tc_Tango_mAttributeValue__4, _0RL_Tango_mAttributeValue__4_unmarshal_fn, _0RL_Tango_mAttributeValue__4_marshal_fn, _0RL_Tango_mAttributeValue__4_destructor_fn, _v)) { _sp = (const Tango::AttributeValue_4*)_v; return 1; } return 0; } static void _0RL_Tango_mChangeEventProp_marshal_fn(cdrStream& _s, void* _v) { Tango::ChangeEventProp* _p = (Tango::ChangeEventProp*)_v; *_p >>= _s; } static void _0RL_Tango_mChangeEventProp_unmarshal_fn(cdrStream& _s, void*& _v) { Tango::ChangeEventProp* _p = new Tango::ChangeEventProp; *_p <<= _s; _v = _p; } static void _0RL_Tango_mChangeEventProp_destructor_fn(void* _v) { Tango::ChangeEventProp* _p = (Tango::ChangeEventProp*)_v; delete _p; } void operator<<=(::CORBA::Any& _a, const Tango::ChangeEventProp& _s) { Tango::ChangeEventProp* _p = new Tango::ChangeEventProp(_s); _a.PR_insert(_0RL_tc_Tango_mChangeEventProp, _0RL_Tango_mChangeEventProp_marshal_fn, _0RL_Tango_mChangeEventProp_destructor_fn, _p); } void operator<<=(::CORBA::Any& _a, Tango::ChangeEventProp* _sp) { _a.PR_insert(_0RL_tc_Tango_mChangeEventProp, _0RL_Tango_mChangeEventProp_marshal_fn, _0RL_Tango_mChangeEventProp_destructor_fn, _sp); } ::CORBA::Boolean operator>>=(const ::CORBA::Any& _a, Tango::ChangeEventProp*& _sp) { return _a >>= (const Tango::ChangeEventProp*&) _sp; } ::CORBA::Boolean operator>>=(const ::CORBA::Any& _a, const Tango::ChangeEventProp*& _sp) { void* _v; if (_a.PR_extract(_0RL_tc_Tango_mChangeEventProp, _0RL_Tango_mChangeEventProp_unmarshal_fn, _0RL_Tango_mChangeEventProp_marshal_fn, _0RL_Tango_mChangeEventProp_destructor_fn, _v)) { _sp = (const Tango::ChangeEventProp*)_v; return 1; } return 0; } static void _0RL_Tango_mPeriodicEventProp_marshal_fn(cdrStream& _s, void* _v) { Tango::PeriodicEventProp* _p = (Tango::PeriodicEventProp*)_v; *_p >>= _s; } static void _0RL_Tango_mPeriodicEventProp_unmarshal_fn(cdrStream& _s, void*& _v) { Tango::PeriodicEventProp* _p = new Tango::PeriodicEventProp; *_p <<= _s; _v = _p; } static void _0RL_Tango_mPeriodicEventProp_destructor_fn(void* _v) { Tango::PeriodicEventProp* _p = (Tango::PeriodicEventProp*)_v; delete _p; } void operator<<=(::CORBA::Any& _a, const Tango::PeriodicEventProp& _s) { Tango::PeriodicEventProp* _p = new Tango::PeriodicEventProp(_s); _a.PR_insert(_0RL_tc_Tango_mPeriodicEventProp, _0RL_Tango_mPeriodicEventProp_marshal_fn, _0RL_Tango_mPeriodicEventProp_destructor_fn, _p); } void operator<<=(::CORBA::Any& _a, Tango::PeriodicEventProp* _sp) { _a.PR_insert(_0RL_tc_Tango_mPeriodicEventProp, _0RL_Tango_mPeriodicEventProp_marshal_fn, _0RL_Tango_mPeriodicEventProp_destructor_fn, _sp); } ::CORBA::Boolean operator>>=(const ::CORBA::Any& _a, Tango::PeriodicEventProp*& _sp) { return _a >>= (const Tango::PeriodicEventProp*&) _sp; } ::CORBA::Boolean operator>>=(const ::CORBA::Any& _a, const Tango::PeriodicEventProp*& _sp) { void* _v; if (_a.PR_extract(_0RL_tc_Tango_mPeriodicEventProp, _0RL_Tango_mPeriodicEventProp_unmarshal_fn, _0RL_Tango_mPeriodicEventProp_marshal_fn, _0RL_Tango_mPeriodicEventProp_destructor_fn, _v)) { _sp = (const Tango::PeriodicEventProp*)_v; return 1; } return 0; } static void _0RL_Tango_mArchiveEventProp_marshal_fn(cdrStream& _s, void* _v) { Tango::ArchiveEventProp* _p = (Tango::ArchiveEventProp*)_v; *_p >>= _s; } static void _0RL_Tango_mArchiveEventProp_unmarshal_fn(cdrStream& _s, void*& _v) { Tango::ArchiveEventProp* _p = new Tango::ArchiveEventProp; *_p <<= _s; _v = _p; } static void _0RL_Tango_mArchiveEventProp_destructor_fn(void* _v) { Tango::ArchiveEventProp* _p = (Tango::ArchiveEventProp*)_v; delete _p; } void operator<<=(::CORBA::Any& _a, const Tango::ArchiveEventProp& _s) { Tango::ArchiveEventProp* _p = new Tango::ArchiveEventProp(_s); _a.PR_insert(_0RL_tc_Tango_mArchiveEventProp, _0RL_Tango_mArchiveEventProp_marshal_fn, _0RL_Tango_mArchiveEventProp_destructor_fn, _p); } void operator<<=(::CORBA::Any& _a, Tango::ArchiveEventProp* _sp) { _a.PR_insert(_0RL_tc_Tango_mArchiveEventProp, _0RL_Tango_mArchiveEventProp_marshal_fn, _0RL_Tango_mArchiveEventProp_destructor_fn, _sp); } ::CORBA::Boolean operator>>=(const ::CORBA::Any& _a, Tango::ArchiveEventProp*& _sp) { return _a >>= (const Tango::ArchiveEventProp*&) _sp; } ::CORBA::Boolean operator>>=(const ::CORBA::Any& _a, const Tango::ArchiveEventProp*& _sp) { void* _v; if (_a.PR_extract(_0RL_tc_Tango_mArchiveEventProp, _0RL_Tango_mArchiveEventProp_unmarshal_fn, _0RL_Tango_mArchiveEventProp_marshal_fn, _0RL_Tango_mArchiveEventProp_destructor_fn, _v)) { _sp = (const Tango::ArchiveEventProp*)_v; return 1; } return 0; } static void _0RL_Tango_mEventProperties_marshal_fn(cdrStream& _s, void* _v) { Tango::EventProperties* _p = (Tango::EventProperties*)_v; *_p >>= _s; } static void _0RL_Tango_mEventProperties_unmarshal_fn(cdrStream& _s, void*& _v) { Tango::EventProperties* _p = new Tango::EventProperties; *_p <<= _s; _v = _p; } static void _0RL_Tango_mEventProperties_destructor_fn(void* _v) { Tango::EventProperties* _p = (Tango::EventProperties*)_v; delete _p; } void operator<<=(::CORBA::Any& _a, const Tango::EventProperties& _s) { Tango::EventProperties* _p = new Tango::EventProperties(_s); _a.PR_insert(_0RL_tc_Tango_mEventProperties, _0RL_Tango_mEventProperties_marshal_fn, _0RL_Tango_mEventProperties_destructor_fn, _p); } void operator<<=(::CORBA::Any& _a, Tango::EventProperties* _sp) { _a.PR_insert(_0RL_tc_Tango_mEventProperties, _0RL_Tango_mEventProperties_marshal_fn, _0RL_Tango_mEventProperties_destructor_fn, _sp); } ::CORBA::Boolean operator>>=(const ::CORBA::Any& _a, Tango::EventProperties*& _sp) { return _a >>= (const Tango::EventProperties*&) _sp; } ::CORBA::Boolean operator>>=(const ::CORBA::Any& _a, const Tango::EventProperties*& _sp) { void* _v; if (_a.PR_extract(_0RL_tc_Tango_mEventProperties, _0RL_Tango_mEventProperties_unmarshal_fn, _0RL_Tango_mEventProperties_marshal_fn, _0RL_Tango_mEventProperties_destructor_fn, _v)) { _sp = (const Tango::EventProperties*)_v; return 1; } return 0; } static void _0RL_Tango_mAttributeAlarm_marshal_fn(cdrStream& _s, void* _v) { Tango::AttributeAlarm* _p = (Tango::AttributeAlarm*)_v; *_p >>= _s; } static void _0RL_Tango_mAttributeAlarm_unmarshal_fn(cdrStream& _s, void*& _v) { Tango::AttributeAlarm* _p = new Tango::AttributeAlarm; *_p <<= _s; _v = _p; } static void _0RL_Tango_mAttributeAlarm_destructor_fn(void* _v) { Tango::AttributeAlarm* _p = (Tango::AttributeAlarm*)_v; delete _p; } void operator<<=(::CORBA::Any& _a, const Tango::AttributeAlarm& _s) { Tango::AttributeAlarm* _p = new Tango::AttributeAlarm(_s); _a.PR_insert(_0RL_tc_Tango_mAttributeAlarm, _0RL_Tango_mAttributeAlarm_marshal_fn, _0RL_Tango_mAttributeAlarm_destructor_fn, _p); } void operator<<=(::CORBA::Any& _a, Tango::AttributeAlarm* _sp) { _a.PR_insert(_0RL_tc_Tango_mAttributeAlarm, _0RL_Tango_mAttributeAlarm_marshal_fn, _0RL_Tango_mAttributeAlarm_destructor_fn, _sp); } ::CORBA::Boolean operator>>=(const ::CORBA::Any& _a, Tango::AttributeAlarm*& _sp) { return _a >>= (const Tango::AttributeAlarm*&) _sp; } ::CORBA::Boolean operator>>=(const ::CORBA::Any& _a, const Tango::AttributeAlarm*& _sp) { void* _v; if (_a.PR_extract(_0RL_tc_Tango_mAttributeAlarm, _0RL_Tango_mAttributeAlarm_unmarshal_fn, _0RL_Tango_mAttributeAlarm_marshal_fn, _0RL_Tango_mAttributeAlarm_destructor_fn, _v)) { _sp = (const Tango::AttributeAlarm*)_v; return 1; } return 0; } static void _0RL_Tango_mAttributeConfig__3_marshal_fn(cdrStream& _s, void* _v) { Tango::AttributeConfig_3* _p = (Tango::AttributeConfig_3*)_v; *_p >>= _s; } static void _0RL_Tango_mAttributeConfig__3_unmarshal_fn(cdrStream& _s, void*& _v) { Tango::AttributeConfig_3* _p = new Tango::AttributeConfig_3; *_p <<= _s; _v = _p; } static void _0RL_Tango_mAttributeConfig__3_destructor_fn(void* _v) { Tango::AttributeConfig_3* _p = (Tango::AttributeConfig_3*)_v; delete _p; } void operator<<=(::CORBA::Any& _a, const Tango::AttributeConfig_3& _s) { Tango::AttributeConfig_3* _p = new Tango::AttributeConfig_3(_s); _a.PR_insert(_0RL_tc_Tango_mAttributeConfig__3, _0RL_Tango_mAttributeConfig__3_marshal_fn, _0RL_Tango_mAttributeConfig__3_destructor_fn, _p); } void operator<<=(::CORBA::Any& _a, Tango::AttributeConfig_3* _sp) { _a.PR_insert(_0RL_tc_Tango_mAttributeConfig__3, _0RL_Tango_mAttributeConfig__3_marshal_fn, _0RL_Tango_mAttributeConfig__3_destructor_fn, _sp); } ::CORBA::Boolean operator>>=(const ::CORBA::Any& _a, Tango::AttributeConfig_3*& _sp) { return _a >>= (const Tango::AttributeConfig_3*&) _sp; } ::CORBA::Boolean operator>>=(const ::CORBA::Any& _a, const Tango::AttributeConfig_3*& _sp) { void* _v; if (_a.PR_extract(_0RL_tc_Tango_mAttributeConfig__3, _0RL_Tango_mAttributeConfig__3_unmarshal_fn, _0RL_Tango_mAttributeConfig__3_marshal_fn, _0RL_Tango_mAttributeConfig__3_destructor_fn, _v)) { _sp = (const Tango::AttributeConfig_3*)_v; return 1; } return 0; } static void _0RL_Tango_mAttributeConfigList_marshal_fn(cdrStream& _s, void* _v) { Tango::AttributeConfigList* _p = (Tango::AttributeConfigList*)_v; *_p >>= _s; } static void _0RL_Tango_mAttributeConfigList_unmarshal_fn(cdrStream& _s, void*& _v) { Tango::AttributeConfigList* _p = new Tango::AttributeConfigList; *_p <<= _s; _v = _p; } static void _0RL_Tango_mAttributeConfigList_destructor_fn(void* _v) { Tango::AttributeConfigList* _p = (Tango::AttributeConfigList*)_v; delete _p; } void operator<<=(::CORBA::Any& _a, const Tango::AttributeConfigList& _s) { Tango::AttributeConfigList* _p = new Tango::AttributeConfigList(_s); _a.PR_insert(_0RL_tc_Tango_mAttributeConfigList, _0RL_Tango_mAttributeConfigList_marshal_fn, _0RL_Tango_mAttributeConfigList_destructor_fn, _p); } void operator<<=(::CORBA::Any& _a, Tango::AttributeConfigList* _sp) { _a.PR_insert(_0RL_tc_Tango_mAttributeConfigList, _0RL_Tango_mAttributeConfigList_marshal_fn, _0RL_Tango_mAttributeConfigList_destructor_fn, _sp); } ::CORBA::Boolean operator>>=(const ::CORBA::Any& _a, Tango::AttributeConfigList*& _sp) { return _a >>= (const Tango::AttributeConfigList*&) _sp; } ::CORBA::Boolean operator>>=(const ::CORBA::Any& _a, const Tango::AttributeConfigList*& _sp) { void* _v; if (_a.PR_extract(_0RL_tc_Tango_mAttributeConfigList, _0RL_Tango_mAttributeConfigList_unmarshal_fn, _0RL_Tango_mAttributeConfigList_marshal_fn, _0RL_Tango_mAttributeConfigList_destructor_fn, _v)) { _sp = (const Tango::AttributeConfigList*)_v; return 1; } return 0; } static void _0RL_Tango_mAttributeConfigList__2_marshal_fn(cdrStream& _s, void* _v) { Tango::AttributeConfigList_2* _p = (Tango::AttributeConfigList_2*)_v; *_p >>= _s; } static void _0RL_Tango_mAttributeConfigList__2_unmarshal_fn(cdrStream& _s, void*& _v) { Tango::AttributeConfigList_2* _p = new Tango::AttributeConfigList_2; *_p <<= _s; _v = _p; } static void _0RL_Tango_mAttributeConfigList__2_destructor_fn(void* _v) { Tango::AttributeConfigList_2* _p = (Tango::AttributeConfigList_2*)_v; delete _p; } void operator<<=(::CORBA::Any& _a, const Tango::AttributeConfigList_2& _s) { Tango::AttributeConfigList_2* _p = new Tango::AttributeConfigList_2(_s); _a.PR_insert(_0RL_tc_Tango_mAttributeConfigList__2, _0RL_Tango_mAttributeConfigList__2_marshal_fn, _0RL_Tango_mAttributeConfigList__2_destructor_fn, _p); } void operator<<=(::CORBA::Any& _a, Tango::AttributeConfigList_2* _sp) { _a.PR_insert(_0RL_tc_Tango_mAttributeConfigList__2, _0RL_Tango_mAttributeConfigList__2_marshal_fn, _0RL_Tango_mAttributeConfigList__2_destructor_fn, _sp); } ::CORBA::Boolean operator>>=(const ::CORBA::Any& _a, Tango::AttributeConfigList_2*& _sp) { return _a >>= (const Tango::AttributeConfigList_2*&) _sp; } ::CORBA::Boolean operator>>=(const ::CORBA::Any& _a, const Tango::AttributeConfigList_2*& _sp) { void* _v; if (_a.PR_extract(_0RL_tc_Tango_mAttributeConfigList__2, _0RL_Tango_mAttributeConfigList__2_unmarshal_fn, _0RL_Tango_mAttributeConfigList__2_marshal_fn, _0RL_Tango_mAttributeConfigList__2_destructor_fn, _v)) { _sp = (const Tango::AttributeConfigList_2*)_v; return 1; } return 0; } static void _0RL_Tango_mAttributeConfigList__3_marshal_fn(cdrStream& _s, void* _v) { Tango::AttributeConfigList_3* _p = (Tango::AttributeConfigList_3*)_v; *_p >>= _s; } static void _0RL_Tango_mAttributeConfigList__3_unmarshal_fn(cdrStream& _s, void*& _v) { Tango::AttributeConfigList_3* _p = new Tango::AttributeConfigList_3; *_p <<= _s; _v = _p; } static void _0RL_Tango_mAttributeConfigList__3_destructor_fn(void* _v) { Tango::AttributeConfigList_3* _p = (Tango::AttributeConfigList_3*)_v; delete _p; } void operator<<=(::CORBA::Any& _a, const Tango::AttributeConfigList_3& _s) { Tango::AttributeConfigList_3* _p = new Tango::AttributeConfigList_3(_s); _a.PR_insert(_0RL_tc_Tango_mAttributeConfigList__3, _0RL_Tango_mAttributeConfigList__3_marshal_fn, _0RL_Tango_mAttributeConfigList__3_destructor_fn, _p); } void operator<<=(::CORBA::Any& _a, Tango::AttributeConfigList_3* _sp) { _a.PR_insert(_0RL_tc_Tango_mAttributeConfigList__3, _0RL_Tango_mAttributeConfigList__3_marshal_fn, _0RL_Tango_mAttributeConfigList__3_destructor_fn, _sp); } ::CORBA::Boolean operator>>=(const ::CORBA::Any& _a, Tango::AttributeConfigList_3*& _sp) { return _a >>= (const Tango::AttributeConfigList_3*&) _sp; } ::CORBA::Boolean operator>>=(const ::CORBA::Any& _a, const Tango::AttributeConfigList_3*& _sp) { void* _v; if (_a.PR_extract(_0RL_tc_Tango_mAttributeConfigList__3, _0RL_Tango_mAttributeConfigList__3_unmarshal_fn, _0RL_Tango_mAttributeConfigList__3_marshal_fn, _0RL_Tango_mAttributeConfigList__3_destructor_fn, _v)) { _sp = (const Tango::AttributeConfigList_3*)_v; return 1; } return 0; } static void _0RL_Tango_mAttributeValueList_marshal_fn(cdrStream& _s, void* _v) { Tango::AttributeValueList* _p = (Tango::AttributeValueList*)_v; *_p >>= _s; } static void _0RL_Tango_mAttributeValueList_unmarshal_fn(cdrStream& _s, void*& _v) { Tango::AttributeValueList* _p = new Tango::AttributeValueList; *_p <<= _s; _v = _p; } static void _0RL_Tango_mAttributeValueList_destructor_fn(void* _v) { Tango::AttributeValueList* _p = (Tango::AttributeValueList*)_v; delete _p; } void operator<<=(::CORBA::Any& _a, const Tango::AttributeValueList& _s) { Tango::AttributeValueList* _p = new Tango::AttributeValueList(_s); _a.PR_insert(_0RL_tc_Tango_mAttributeValueList, _0RL_Tango_mAttributeValueList_marshal_fn, _0RL_Tango_mAttributeValueList_destructor_fn, _p); } void operator<<=(::CORBA::Any& _a, Tango::AttributeValueList* _sp) { _a.PR_insert(_0RL_tc_Tango_mAttributeValueList, _0RL_Tango_mAttributeValueList_marshal_fn, _0RL_Tango_mAttributeValueList_destructor_fn, _sp); } ::CORBA::Boolean operator>>=(const ::CORBA::Any& _a, Tango::AttributeValueList*& _sp) { return _a >>= (const Tango::AttributeValueList*&) _sp; } ::CORBA::Boolean operator>>=(const ::CORBA::Any& _a, const Tango::AttributeValueList*& _sp) { void* _v; if (_a.PR_extract(_0RL_tc_Tango_mAttributeValueList, _0RL_Tango_mAttributeValueList_unmarshal_fn, _0RL_Tango_mAttributeValueList_marshal_fn, _0RL_Tango_mAttributeValueList_destructor_fn, _v)) { _sp = (const Tango::AttributeValueList*)_v; return 1; } return 0; } static void _0RL_Tango_mAttributeValueList__3_marshal_fn(cdrStream& _s, void* _v) { Tango::AttributeValueList_3* _p = (Tango::AttributeValueList_3*)_v; *_p >>= _s; } static void _0RL_Tango_mAttributeValueList__3_unmarshal_fn(cdrStream& _s, void*& _v) { Tango::AttributeValueList_3* _p = new Tango::AttributeValueList_3; *_p <<= _s; _v = _p; } static void _0RL_Tango_mAttributeValueList__3_destructor_fn(void* _v) { Tango::AttributeValueList_3* _p = (Tango::AttributeValueList_3*)_v; delete _p; } void operator<<=(::CORBA::Any& _a, const Tango::AttributeValueList_3& _s) { Tango::AttributeValueList_3* _p = new Tango::AttributeValueList_3(_s); _a.PR_insert(_0RL_tc_Tango_mAttributeValueList__3, _0RL_Tango_mAttributeValueList__3_marshal_fn, _0RL_Tango_mAttributeValueList__3_destructor_fn, _p); } void operator<<=(::CORBA::Any& _a, Tango::AttributeValueList_3* _sp) { _a.PR_insert(_0RL_tc_Tango_mAttributeValueList__3, _0RL_Tango_mAttributeValueList__3_marshal_fn, _0RL_Tango_mAttributeValueList__3_destructor_fn, _sp); } ::CORBA::Boolean operator>>=(const ::CORBA::Any& _a, Tango::AttributeValueList_3*& _sp) { return _a >>= (const Tango::AttributeValueList_3*&) _sp; } ::CORBA::Boolean operator>>=(const ::CORBA::Any& _a, const Tango::AttributeValueList_3*& _sp) { void* _v; if (_a.PR_extract(_0RL_tc_Tango_mAttributeValueList__3, _0RL_Tango_mAttributeValueList__3_unmarshal_fn, _0RL_Tango_mAttributeValueList__3_marshal_fn, _0RL_Tango_mAttributeValueList__3_destructor_fn, _v)) { _sp = (const Tango::AttributeValueList_3*)_v; return 1; } return 0; } static void _0RL_Tango_mAttributeValueList__4_marshal_fn(cdrStream& _s, void* _v) { Tango::AttributeValueList_4* _p = (Tango::AttributeValueList_4*)_v; *_p >>= _s; } static void _0RL_Tango_mAttributeValueList__4_unmarshal_fn(cdrStream& _s, void*& _v) { Tango::AttributeValueList_4* _p = new Tango::AttributeValueList_4; *_p <<= _s; _v = _p; } static void _0RL_Tango_mAttributeValueList__4_destructor_fn(void* _v) { Tango::AttributeValueList_4* _p = (Tango::AttributeValueList_4*)_v; delete _p; } void operator<<=(::CORBA::Any& _a, const Tango::AttributeValueList_4& _s) { Tango::AttributeValueList_4* _p = new Tango::AttributeValueList_4(_s); _a.PR_insert(_0RL_tc_Tango_mAttributeValueList__4, _0RL_Tango_mAttributeValueList__4_marshal_fn, _0RL_Tango_mAttributeValueList__4_destructor_fn, _p); } void operator<<=(::CORBA::Any& _a, Tango::AttributeValueList_4* _sp) { _a.PR_insert(_0RL_tc_Tango_mAttributeValueList__4, _0RL_Tango_mAttributeValueList__4_marshal_fn, _0RL_Tango_mAttributeValueList__4_destructor_fn, _sp); } ::CORBA::Boolean operator>>=(const ::CORBA::Any& _a, Tango::AttributeValueList_4*& _sp) { return _a >>= (const Tango::AttributeValueList_4*&) _sp; } ::CORBA::Boolean operator>>=(const ::CORBA::Any& _a, const Tango::AttributeValueList_4*& _sp) { void* _v; if (_a.PR_extract(_0RL_tc_Tango_mAttributeValueList__4, _0RL_Tango_mAttributeValueList__4_unmarshal_fn, _0RL_Tango_mAttributeValueList__4_marshal_fn, _0RL_Tango_mAttributeValueList__4_destructor_fn, _v)) { _sp = (const Tango::AttributeValueList_4*)_v; return 1; } return 0; } static void _0RL_Tango_mAttDataReady_marshal_fn(cdrStream& _s, void* _v) { Tango::AttDataReady* _p = (Tango::AttDataReady*)_v; *_p >>= _s; } static void _0RL_Tango_mAttDataReady_unmarshal_fn(cdrStream& _s, void*& _v) { Tango::AttDataReady* _p = new Tango::AttDataReady; *_p <<= _s; _v = _p; } static void _0RL_Tango_mAttDataReady_destructor_fn(void* _v) { Tango::AttDataReady* _p = (Tango::AttDataReady*)_v; delete _p; } void operator<<=(::CORBA::Any& _a, const Tango::AttDataReady& _s) { Tango::AttDataReady* _p = new Tango::AttDataReady(_s); _a.PR_insert(_0RL_tc_Tango_mAttDataReady, _0RL_Tango_mAttDataReady_marshal_fn, _0RL_Tango_mAttDataReady_destructor_fn, _p); } void operator<<=(::CORBA::Any& _a, Tango::AttDataReady* _sp) { _a.PR_insert(_0RL_tc_Tango_mAttDataReady, _0RL_Tango_mAttDataReady_marshal_fn, _0RL_Tango_mAttDataReady_destructor_fn, _sp); } ::CORBA::Boolean operator>>=(const ::CORBA::Any& _a, Tango::AttDataReady*& _sp) { return _a >>= (const Tango::AttDataReady*&) _sp; } ::CORBA::Boolean operator>>=(const ::CORBA::Any& _a, const Tango::AttDataReady*& _sp) { void* _v; if (_a.PR_extract(_0RL_tc_Tango_mAttDataReady, _0RL_Tango_mAttDataReady_unmarshal_fn, _0RL_Tango_mAttDataReady_marshal_fn, _0RL_Tango_mAttDataReady_destructor_fn, _v)) { _sp = (const Tango::AttDataReady*)_v; return 1; } return 0; } static void _0RL_Tango_mDevInfo_marshal_fn(cdrStream& _s, void* _v) { Tango::DevInfo* _p = (Tango::DevInfo*)_v; *_p >>= _s; } static void _0RL_Tango_mDevInfo_unmarshal_fn(cdrStream& _s, void*& _v) { Tango::DevInfo* _p = new Tango::DevInfo; *_p <<= _s; _v = _p; } static void _0RL_Tango_mDevInfo_destructor_fn(void* _v) { Tango::DevInfo* _p = (Tango::DevInfo*)_v; delete _p; } void operator<<=(::CORBA::Any& _a, const Tango::DevInfo& _s) { Tango::DevInfo* _p = new Tango::DevInfo(_s); _a.PR_insert(_0RL_tc_Tango_mDevInfo, _0RL_Tango_mDevInfo_marshal_fn, _0RL_Tango_mDevInfo_destructor_fn, _p); } void operator<<=(::CORBA::Any& _a, Tango::DevInfo* _sp) { _a.PR_insert(_0RL_tc_Tango_mDevInfo, _0RL_Tango_mDevInfo_marshal_fn, _0RL_Tango_mDevInfo_destructor_fn, _sp); } ::CORBA::Boolean operator>>=(const ::CORBA::Any& _a, Tango::DevInfo*& _sp) { return _a >>= (const Tango::DevInfo*&) _sp; } ::CORBA::Boolean operator>>=(const ::CORBA::Any& _a, const Tango::DevInfo*& _sp) { void* _v; if (_a.PR_extract(_0RL_tc_Tango_mDevInfo, _0RL_Tango_mDevInfo_unmarshal_fn, _0RL_Tango_mDevInfo_marshal_fn, _0RL_Tango_mDevInfo_destructor_fn, _v)) { _sp = (const Tango::DevInfo*)_v; return 1; } return 0; } static void _0RL_Tango_mDevInfo__3_marshal_fn(cdrStream& _s, void* _v) { Tango::DevInfo_3* _p = (Tango::DevInfo_3*)_v; *_p >>= _s; } static void _0RL_Tango_mDevInfo__3_unmarshal_fn(cdrStream& _s, void*& _v) { Tango::DevInfo_3* _p = new Tango::DevInfo_3; *_p <<= _s; _v = _p; } static void _0RL_Tango_mDevInfo__3_destructor_fn(void* _v) { Tango::DevInfo_3* _p = (Tango::DevInfo_3*)_v; delete _p; } void operator<<=(::CORBA::Any& _a, const Tango::DevInfo_3& _s) { Tango::DevInfo_3* _p = new Tango::DevInfo_3(_s); _a.PR_insert(_0RL_tc_Tango_mDevInfo__3, _0RL_Tango_mDevInfo__3_marshal_fn, _0RL_Tango_mDevInfo__3_destructor_fn, _p); } void operator<<=(::CORBA::Any& _a, Tango::DevInfo_3* _sp) { _a.PR_insert(_0RL_tc_Tango_mDevInfo__3, _0RL_Tango_mDevInfo__3_marshal_fn, _0RL_Tango_mDevInfo__3_destructor_fn, _sp); } ::CORBA::Boolean operator>>=(const ::CORBA::Any& _a, Tango::DevInfo_3*& _sp) { return _a >>= (const Tango::DevInfo_3*&) _sp; } ::CORBA::Boolean operator>>=(const ::CORBA::Any& _a, const Tango::DevInfo_3*& _sp) { void* _v; if (_a.PR_extract(_0RL_tc_Tango_mDevInfo__3, _0RL_Tango_mDevInfo__3_unmarshal_fn, _0RL_Tango_mDevInfo__3_marshal_fn, _0RL_Tango_mDevInfo__3_destructor_fn, _v)) { _sp = (const Tango::DevInfo_3*)_v; return 1; } return 0; } static void _0RL_Tango_mDevCmdHistory_marshal_fn(cdrStream& _s, void* _v) { Tango::DevCmdHistory* _p = (Tango::DevCmdHistory*)_v; *_p >>= _s; } static void _0RL_Tango_mDevCmdHistory_unmarshal_fn(cdrStream& _s, void*& _v) { Tango::DevCmdHistory* _p = new Tango::DevCmdHistory; *_p <<= _s; _v = _p; } static void _0RL_Tango_mDevCmdHistory_destructor_fn(void* _v) { Tango::DevCmdHistory* _p = (Tango::DevCmdHistory*)_v; delete _p; } void operator<<=(::CORBA::Any& _a, const Tango::DevCmdHistory& _s) { Tango::DevCmdHistory* _p = new Tango::DevCmdHistory(_s); _a.PR_insert(_0RL_tc_Tango_mDevCmdHistory, _0RL_Tango_mDevCmdHistory_marshal_fn, _0RL_Tango_mDevCmdHistory_destructor_fn, _p); } void operator<<=(::CORBA::Any& _a, Tango::DevCmdHistory* _sp) { _a.PR_insert(_0RL_tc_Tango_mDevCmdHistory, _0RL_Tango_mDevCmdHistory_marshal_fn, _0RL_Tango_mDevCmdHistory_destructor_fn, _sp); } ::CORBA::Boolean operator>>=(const ::CORBA::Any& _a, Tango::DevCmdHistory*& _sp) { return _a >>= (const Tango::DevCmdHistory*&) _sp; } ::CORBA::Boolean operator>>=(const ::CORBA::Any& _a, const Tango::DevCmdHistory*& _sp) { void* _v; if (_a.PR_extract(_0RL_tc_Tango_mDevCmdHistory, _0RL_Tango_mDevCmdHistory_unmarshal_fn, _0RL_Tango_mDevCmdHistory_marshal_fn, _0RL_Tango_mDevCmdHistory_destructor_fn, _v)) { _sp = (const Tango::DevCmdHistory*)_v; return 1; } return 0; } static void _0RL_Tango_mDevCmdHistoryList_marshal_fn(cdrStream& _s, void* _v) { Tango::DevCmdHistoryList* _p = (Tango::DevCmdHistoryList*)_v; *_p >>= _s; } static void _0RL_Tango_mDevCmdHistoryList_unmarshal_fn(cdrStream& _s, void*& _v) { Tango::DevCmdHistoryList* _p = new Tango::DevCmdHistoryList; *_p <<= _s; _v = _p; } static void _0RL_Tango_mDevCmdHistoryList_destructor_fn(void* _v) { Tango::DevCmdHistoryList* _p = (Tango::DevCmdHistoryList*)_v; delete _p; } void operator<<=(::CORBA::Any& _a, const Tango::DevCmdHistoryList& _s) { Tango::DevCmdHistoryList* _p = new Tango::DevCmdHistoryList(_s); _a.PR_insert(_0RL_tc_Tango_mDevCmdHistoryList, _0RL_Tango_mDevCmdHistoryList_marshal_fn, _0RL_Tango_mDevCmdHistoryList_destructor_fn, _p); } void operator<<=(::CORBA::Any& _a, Tango::DevCmdHistoryList* _sp) { _a.PR_insert(_0RL_tc_Tango_mDevCmdHistoryList, _0RL_Tango_mDevCmdHistoryList_marshal_fn, _0RL_Tango_mDevCmdHistoryList_destructor_fn, _sp); } ::CORBA::Boolean operator>>=(const ::CORBA::Any& _a, Tango::DevCmdHistoryList*& _sp) { return _a >>= (const Tango::DevCmdHistoryList*&) _sp; } ::CORBA::Boolean operator>>=(const ::CORBA::Any& _a, const Tango::DevCmdHistoryList*& _sp) { void* _v; if (_a.PR_extract(_0RL_tc_Tango_mDevCmdHistoryList, _0RL_Tango_mDevCmdHistoryList_unmarshal_fn, _0RL_Tango_mDevCmdHistoryList_marshal_fn, _0RL_Tango_mDevCmdHistoryList_destructor_fn, _v)) { _sp = (const Tango::DevCmdHistoryList*)_v; return 1; } return 0; } static void _0RL_Tango_mDevAttrHistory_marshal_fn(cdrStream& _s, void* _v) { Tango::DevAttrHistory* _p = (Tango::DevAttrHistory*)_v; *_p >>= _s; } static void _0RL_Tango_mDevAttrHistory_unmarshal_fn(cdrStream& _s, void*& _v) { Tango::DevAttrHistory* _p = new Tango::DevAttrHistory; *_p <<= _s; _v = _p; } static void _0RL_Tango_mDevAttrHistory_destructor_fn(void* _v) { Tango::DevAttrHistory* _p = (Tango::DevAttrHistory*)_v; delete _p; } void operator<<=(::CORBA::Any& _a, const Tango::DevAttrHistory& _s) { Tango::DevAttrHistory* _p = new Tango::DevAttrHistory(_s); _a.PR_insert(_0RL_tc_Tango_mDevAttrHistory, _0RL_Tango_mDevAttrHistory_marshal_fn, _0RL_Tango_mDevAttrHistory_destructor_fn, _p); } void operator<<=(::CORBA::Any& _a, Tango::DevAttrHistory* _sp) { _a.PR_insert(_0RL_tc_Tango_mDevAttrHistory, _0RL_Tango_mDevAttrHistory_marshal_fn, _0RL_Tango_mDevAttrHistory_destructor_fn, _sp); } ::CORBA::Boolean operator>>=(const ::CORBA::Any& _a, Tango::DevAttrHistory*& _sp) { return _a >>= (const Tango::DevAttrHistory*&) _sp; } ::CORBA::Boolean operator>>=(const ::CORBA::Any& _a, const Tango::DevAttrHistory*& _sp) { void* _v; if (_a.PR_extract(_0RL_tc_Tango_mDevAttrHistory, _0RL_Tango_mDevAttrHistory_unmarshal_fn, _0RL_Tango_mDevAttrHistory_marshal_fn, _0RL_Tango_mDevAttrHistory_destructor_fn, _v)) { _sp = (const Tango::DevAttrHistory*)_v; return 1; } return 0; } static void _0RL_Tango_mDevAttrHistory__3_marshal_fn(cdrStream& _s, void* _v) { Tango::DevAttrHistory_3* _p = (Tango::DevAttrHistory_3*)_v; *_p >>= _s; } static void _0RL_Tango_mDevAttrHistory__3_unmarshal_fn(cdrStream& _s, void*& _v) { Tango::DevAttrHistory_3* _p = new Tango::DevAttrHistory_3; *_p <<= _s; _v = _p; } static void _0RL_Tango_mDevAttrHistory__3_destructor_fn(void* _v) { Tango::DevAttrHistory_3* _p = (Tango::DevAttrHistory_3*)_v; delete _p; } void operator<<=(::CORBA::Any& _a, const Tango::DevAttrHistory_3& _s) { Tango::DevAttrHistory_3* _p = new Tango::DevAttrHistory_3(_s); _a.PR_insert(_0RL_tc_Tango_mDevAttrHistory__3, _0RL_Tango_mDevAttrHistory__3_marshal_fn, _0RL_Tango_mDevAttrHistory__3_destructor_fn, _p); } void operator<<=(::CORBA::Any& _a, Tango::DevAttrHistory_3* _sp) { _a.PR_insert(_0RL_tc_Tango_mDevAttrHistory__3, _0RL_Tango_mDevAttrHistory__3_marshal_fn, _0RL_Tango_mDevAttrHistory__3_destructor_fn, _sp); } ::CORBA::Boolean operator>>=(const ::CORBA::Any& _a, Tango::DevAttrHistory_3*& _sp) { return _a >>= (const Tango::DevAttrHistory_3*&) _sp; } ::CORBA::Boolean operator>>=(const ::CORBA::Any& _a, const Tango::DevAttrHistory_3*& _sp) { void* _v; if (_a.PR_extract(_0RL_tc_Tango_mDevAttrHistory__3, _0RL_Tango_mDevAttrHistory__3_unmarshal_fn, _0RL_Tango_mDevAttrHistory__3_marshal_fn, _0RL_Tango_mDevAttrHistory__3_destructor_fn, _v)) { _sp = (const Tango::DevAttrHistory_3*)_v; return 1; } return 0; } static void _0RL_Tango_mEltInArray_marshal_fn(cdrStream& _s, void* _v) { Tango::EltInArray* _p = (Tango::EltInArray*)_v; *_p >>= _s; } static void _0RL_Tango_mEltInArray_unmarshal_fn(cdrStream& _s, void*& _v) { Tango::EltInArray* _p = new Tango::EltInArray; *_p <<= _s; _v = _p; } static void _0RL_Tango_mEltInArray_destructor_fn(void* _v) { Tango::EltInArray* _p = (Tango::EltInArray*)_v; delete _p; } void operator<<=(::CORBA::Any& _a, const Tango::EltInArray& _s) { Tango::EltInArray* _p = new Tango::EltInArray(_s); _a.PR_insert(_0RL_tc_Tango_mEltInArray, _0RL_Tango_mEltInArray_marshal_fn, _0RL_Tango_mEltInArray_destructor_fn, _p); } void operator<<=(::CORBA::Any& _a, Tango::EltInArray* _sp) { _a.PR_insert(_0RL_tc_Tango_mEltInArray, _0RL_Tango_mEltInArray_marshal_fn, _0RL_Tango_mEltInArray_destructor_fn, _sp); } ::CORBA::Boolean operator>>=(const ::CORBA::Any& _a, Tango::EltInArray*& _sp) { return _a >>= (const Tango::EltInArray*&) _sp; } ::CORBA::Boolean operator>>=(const ::CORBA::Any& _a, const Tango::EltInArray*& _sp) { void* _v; if (_a.PR_extract(_0RL_tc_Tango_mEltInArray, _0RL_Tango_mEltInArray_unmarshal_fn, _0RL_Tango_mEltInArray_marshal_fn, _0RL_Tango_mEltInArray_destructor_fn, _v)) { _sp = (const Tango::EltInArray*)_v; return 1; } return 0; } static void _0RL_Tango_mEltInArrayList_marshal_fn(cdrStream& _s, void* _v) { Tango::EltInArrayList* _p = (Tango::EltInArrayList*)_v; *_p >>= _s; } static void _0RL_Tango_mEltInArrayList_unmarshal_fn(cdrStream& _s, void*& _v) { Tango::EltInArrayList* _p = new Tango::EltInArrayList; *_p <<= _s; _v = _p; } static void _0RL_Tango_mEltInArrayList_destructor_fn(void* _v) { Tango::EltInArrayList* _p = (Tango::EltInArrayList*)_v; delete _p; } void operator<<=(::CORBA::Any& _a, const Tango::EltInArrayList& _s) { Tango::EltInArrayList* _p = new Tango::EltInArrayList(_s); _a.PR_insert(_0RL_tc_Tango_mEltInArrayList, _0RL_Tango_mEltInArrayList_marshal_fn, _0RL_Tango_mEltInArrayList_destructor_fn, _p); } void operator<<=(::CORBA::Any& _a, Tango::EltInArrayList* _sp) { _a.PR_insert(_0RL_tc_Tango_mEltInArrayList, _0RL_Tango_mEltInArrayList_marshal_fn, _0RL_Tango_mEltInArrayList_destructor_fn, _sp); } ::CORBA::Boolean operator>>=(const ::CORBA::Any& _a, Tango::EltInArrayList*& _sp) { return _a >>= (const Tango::EltInArrayList*&) _sp; } ::CORBA::Boolean operator>>=(const ::CORBA::Any& _a, const Tango::EltInArrayList*& _sp) { void* _v; if (_a.PR_extract(_0RL_tc_Tango_mEltInArrayList, _0RL_Tango_mEltInArrayList_unmarshal_fn, _0RL_Tango_mEltInArrayList_marshal_fn, _0RL_Tango_mEltInArrayList_destructor_fn, _v)) { _sp = (const Tango::EltInArrayList*)_v; return 1; } return 0; } static void _0RL_Tango_mTimeValList_marshal_fn(cdrStream& _s, void* _v) { Tango::TimeValList* _p = (Tango::TimeValList*)_v; *_p >>= _s; } static void _0RL_Tango_mTimeValList_unmarshal_fn(cdrStream& _s, void*& _v) { Tango::TimeValList* _p = new Tango::TimeValList; *_p <<= _s; _v = _p; } static void _0RL_Tango_mTimeValList_destructor_fn(void* _v) { Tango::TimeValList* _p = (Tango::TimeValList*)_v; delete _p; } void operator<<=(::CORBA::Any& _a, const Tango::TimeValList& _s) { Tango::TimeValList* _p = new Tango::TimeValList(_s); _a.PR_insert(_0RL_tc_Tango_mTimeValList, _0RL_Tango_mTimeValList_marshal_fn, _0RL_Tango_mTimeValList_destructor_fn, _p); } void operator<<=(::CORBA::Any& _a, Tango::TimeValList* _sp) { _a.PR_insert(_0RL_tc_Tango_mTimeValList, _0RL_Tango_mTimeValList_marshal_fn, _0RL_Tango_mTimeValList_destructor_fn, _sp); } ::CORBA::Boolean operator>>=(const ::CORBA::Any& _a, Tango::TimeValList*& _sp) { return _a >>= (const Tango::TimeValList*&) _sp; } ::CORBA::Boolean operator>>=(const ::CORBA::Any& _a, const Tango::TimeValList*& _sp) { void* _v; if (_a.PR_extract(_0RL_tc_Tango_mTimeValList, _0RL_Tango_mTimeValList_unmarshal_fn, _0RL_Tango_mTimeValList_marshal_fn, _0RL_Tango_mTimeValList_destructor_fn, _v)) { _sp = (const Tango::TimeValList*)_v; return 1; } return 0; } static void _0RL_Tango_mAttrQualityList_marshal_fn(cdrStream& _s, void* _v) { Tango::AttrQualityList* _p = (Tango::AttrQualityList*)_v; *_p >>= _s; } static void _0RL_Tango_mAttrQualityList_unmarshal_fn(cdrStream& _s, void*& _v) { Tango::AttrQualityList* _p = new Tango::AttrQualityList; *_p <<= _s; _v = _p; } static void _0RL_Tango_mAttrQualityList_destructor_fn(void* _v) { Tango::AttrQualityList* _p = (Tango::AttrQualityList*)_v; delete _p; } void operator<<=(::CORBA::Any& _a, const Tango::AttrQualityList& _s) { Tango::AttrQualityList* _p = new Tango::AttrQualityList(_s); _a.PR_insert(_0RL_tc_Tango_mAttrQualityList, _0RL_Tango_mAttrQualityList_marshal_fn, _0RL_Tango_mAttrQualityList_destructor_fn, _p); } void operator<<=(::CORBA::Any& _a, Tango::AttrQualityList* _sp) { _a.PR_insert(_0RL_tc_Tango_mAttrQualityList, _0RL_Tango_mAttrQualityList_marshal_fn, _0RL_Tango_mAttrQualityList_destructor_fn, _sp); } ::CORBA::Boolean operator>>=(const ::CORBA::Any& _a, Tango::AttrQualityList*& _sp) { return _a >>= (const Tango::AttrQualityList*&) _sp; } ::CORBA::Boolean operator>>=(const ::CORBA::Any& _a, const Tango::AttrQualityList*& _sp) { void* _v; if (_a.PR_extract(_0RL_tc_Tango_mAttrQualityList, _0RL_Tango_mAttrQualityList_unmarshal_fn, _0RL_Tango_mAttrQualityList_marshal_fn, _0RL_Tango_mAttrQualityList_destructor_fn, _v)) { _sp = (const Tango::AttrQualityList*)_v; return 1; } return 0; } static void _0RL_Tango_mAttributeDimList_marshal_fn(cdrStream& _s, void* _v) { Tango::AttributeDimList* _p = (Tango::AttributeDimList*)_v; *_p >>= _s; } static void _0RL_Tango_mAttributeDimList_unmarshal_fn(cdrStream& _s, void*& _v) { Tango::AttributeDimList* _p = new Tango::AttributeDimList; *_p <<= _s; _v = _p; } static void _0RL_Tango_mAttributeDimList_destructor_fn(void* _v) { Tango::AttributeDimList* _p = (Tango::AttributeDimList*)_v; delete _p; } void operator<<=(::CORBA::Any& _a, const Tango::AttributeDimList& _s) { Tango::AttributeDimList* _p = new Tango::AttributeDimList(_s); _a.PR_insert(_0RL_tc_Tango_mAttributeDimList, _0RL_Tango_mAttributeDimList_marshal_fn, _0RL_Tango_mAttributeDimList_destructor_fn, _p); } void operator<<=(::CORBA::Any& _a, Tango::AttributeDimList* _sp) { _a.PR_insert(_0RL_tc_Tango_mAttributeDimList, _0RL_Tango_mAttributeDimList_marshal_fn, _0RL_Tango_mAttributeDimList_destructor_fn, _sp); } ::CORBA::Boolean operator>>=(const ::CORBA::Any& _a, Tango::AttributeDimList*& _sp) { return _a >>= (const Tango::AttributeDimList*&) _sp; } ::CORBA::Boolean operator>>=(const ::CORBA::Any& _a, const Tango::AttributeDimList*& _sp) { void* _v; if (_a.PR_extract(_0RL_tc_Tango_mAttributeDimList, _0RL_Tango_mAttributeDimList_unmarshal_fn, _0RL_Tango_mAttributeDimList_marshal_fn, _0RL_Tango_mAttributeDimList_destructor_fn, _v)) { _sp = (const Tango::AttributeDimList*)_v; return 1; } return 0; } static void _0RL_Tango_mDevErrorListList_marshal_fn(cdrStream& _s, void* _v) { Tango::DevErrorListList* _p = (Tango::DevErrorListList*)_v; *_p >>= _s; } static void _0RL_Tango_mDevErrorListList_unmarshal_fn(cdrStream& _s, void*& _v) { Tango::DevErrorListList* _p = new Tango::DevErrorListList; *_p <<= _s; _v = _p; } static void _0RL_Tango_mDevErrorListList_destructor_fn(void* _v) { Tango::DevErrorListList* _p = (Tango::DevErrorListList*)_v; delete _p; } void operator<<=(::CORBA::Any& _a, const Tango::DevErrorListList& _s) { Tango::DevErrorListList* _p = new Tango::DevErrorListList(_s); _a.PR_insert(_0RL_tc_Tango_mDevErrorListList, _0RL_Tango_mDevErrorListList_marshal_fn, _0RL_Tango_mDevErrorListList_destructor_fn, _p); } void operator<<=(::CORBA::Any& _a, Tango::DevErrorListList* _sp) { _a.PR_insert(_0RL_tc_Tango_mDevErrorListList, _0RL_Tango_mDevErrorListList_marshal_fn, _0RL_Tango_mDevErrorListList_destructor_fn, _sp); } ::CORBA::Boolean operator>>=(const ::CORBA::Any& _a, Tango::DevErrorListList*& _sp) { return _a >>= (const Tango::DevErrorListList*&) _sp; } ::CORBA::Boolean operator>>=(const ::CORBA::Any& _a, const Tango::DevErrorListList*& _sp) { void* _v; if (_a.PR_extract(_0RL_tc_Tango_mDevErrorListList, _0RL_Tango_mDevErrorListList_unmarshal_fn, _0RL_Tango_mDevErrorListList_marshal_fn, _0RL_Tango_mDevErrorListList_destructor_fn, _v)) { _sp = (const Tango::DevErrorListList*)_v; return 1; } return 0; } static void _0RL_Tango_mDevAttrHistory__4_marshal_fn(cdrStream& _s, void* _v) { Tango::DevAttrHistory_4* _p = (Tango::DevAttrHistory_4*)_v; *_p >>= _s; } static void _0RL_Tango_mDevAttrHistory__4_unmarshal_fn(cdrStream& _s, void*& _v) { Tango::DevAttrHistory_4* _p = new Tango::DevAttrHistory_4; *_p <<= _s; _v = _p; } static void _0RL_Tango_mDevAttrHistory__4_destructor_fn(void* _v) { Tango::DevAttrHistory_4* _p = (Tango::DevAttrHistory_4*)_v; delete _p; } void operator<<=(::CORBA::Any& _a, const Tango::DevAttrHistory_4& _s) { Tango::DevAttrHistory_4* _p = new Tango::DevAttrHistory_4(_s); _a.PR_insert(_0RL_tc_Tango_mDevAttrHistory__4, _0RL_Tango_mDevAttrHistory__4_marshal_fn, _0RL_Tango_mDevAttrHistory__4_destructor_fn, _p); } void operator<<=(::CORBA::Any& _a, Tango::DevAttrHistory_4* _sp) { _a.PR_insert(_0RL_tc_Tango_mDevAttrHistory__4, _0RL_Tango_mDevAttrHistory__4_marshal_fn, _0RL_Tango_mDevAttrHistory__4_destructor_fn, _sp); } ::CORBA::Boolean operator>>=(const ::CORBA::Any& _a, Tango::DevAttrHistory_4*& _sp) { return _a >>= (const Tango::DevAttrHistory_4*&) _sp; } ::CORBA::Boolean operator>>=(const ::CORBA::Any& _a, const Tango::DevAttrHistory_4*& _sp) { void* _v; if (_a.PR_extract(_0RL_tc_Tango_mDevAttrHistory__4, _0RL_Tango_mDevAttrHistory__4_unmarshal_fn, _0RL_Tango_mDevAttrHistory__4_marshal_fn, _0RL_Tango_mDevAttrHistory__4_destructor_fn, _v)) { _sp = (const Tango::DevAttrHistory_4*)_v; return 1; } return 0; } static void _0RL_Tango_mDevCmdHistory__4_marshal_fn(cdrStream& _s, void* _v) { Tango::DevCmdHistory_4* _p = (Tango::DevCmdHistory_4*)_v; *_p >>= _s; } static void _0RL_Tango_mDevCmdHistory__4_unmarshal_fn(cdrStream& _s, void*& _v) { Tango::DevCmdHistory_4* _p = new Tango::DevCmdHistory_4; *_p <<= _s; _v = _p; } static void _0RL_Tango_mDevCmdHistory__4_destructor_fn(void* _v) { Tango::DevCmdHistory_4* _p = (Tango::DevCmdHistory_4*)_v; delete _p; } void operator<<=(::CORBA::Any& _a, const Tango::DevCmdHistory_4& _s) { Tango::DevCmdHistory_4* _p = new Tango::DevCmdHistory_4(_s); _a.PR_insert(_0RL_tc_Tango_mDevCmdHistory__4, _0RL_Tango_mDevCmdHistory__4_marshal_fn, _0RL_Tango_mDevCmdHistory__4_destructor_fn, _p); } void operator<<=(::CORBA::Any& _a, Tango::DevCmdHistory_4* _sp) { _a.PR_insert(_0RL_tc_Tango_mDevCmdHistory__4, _0RL_Tango_mDevCmdHistory__4_marshal_fn, _0RL_Tango_mDevCmdHistory__4_destructor_fn, _sp); } ::CORBA::Boolean operator>>=(const ::CORBA::Any& _a, Tango::DevCmdHistory_4*& _sp) { return _a >>= (const Tango::DevCmdHistory_4*&) _sp; } ::CORBA::Boolean operator>>=(const ::CORBA::Any& _a, const Tango::DevCmdHistory_4*& _sp) { void* _v; if (_a.PR_extract(_0RL_tc_Tango_mDevCmdHistory__4, _0RL_Tango_mDevCmdHistory__4_unmarshal_fn, _0RL_Tango_mDevCmdHistory__4_marshal_fn, _0RL_Tango_mDevCmdHistory__4_destructor_fn, _v)) { _sp = (const Tango::DevCmdHistory_4*)_v; return 1; } return 0; } static void _0RL_Tango_mDevAttrHistoryList_marshal_fn(cdrStream& _s, void* _v) { Tango::DevAttrHistoryList* _p = (Tango::DevAttrHistoryList*)_v; *_p >>= _s; } static void _0RL_Tango_mDevAttrHistoryList_unmarshal_fn(cdrStream& _s, void*& _v) { Tango::DevAttrHistoryList* _p = new Tango::DevAttrHistoryList; *_p <<= _s; _v = _p; } static void _0RL_Tango_mDevAttrHistoryList_destructor_fn(void* _v) { Tango::DevAttrHistoryList* _p = (Tango::DevAttrHistoryList*)_v; delete _p; } void operator<<=(::CORBA::Any& _a, const Tango::DevAttrHistoryList& _s) { Tango::DevAttrHistoryList* _p = new Tango::DevAttrHistoryList(_s); _a.PR_insert(_0RL_tc_Tango_mDevAttrHistoryList, _0RL_Tango_mDevAttrHistoryList_marshal_fn, _0RL_Tango_mDevAttrHistoryList_destructor_fn, _p); } void operator<<=(::CORBA::Any& _a, Tango::DevAttrHistoryList* _sp) { _a.PR_insert(_0RL_tc_Tango_mDevAttrHistoryList, _0RL_Tango_mDevAttrHistoryList_marshal_fn, _0RL_Tango_mDevAttrHistoryList_destructor_fn, _sp); } ::CORBA::Boolean operator>>=(const ::CORBA::Any& _a, Tango::DevAttrHistoryList*& _sp) { return _a >>= (const Tango::DevAttrHistoryList*&) _sp; } ::CORBA::Boolean operator>>=(const ::CORBA::Any& _a, const Tango::DevAttrHistoryList*& _sp) { void* _v; if (_a.PR_extract(_0RL_tc_Tango_mDevAttrHistoryList, _0RL_Tango_mDevAttrHistoryList_unmarshal_fn, _0RL_Tango_mDevAttrHistoryList_marshal_fn, _0RL_Tango_mDevAttrHistoryList_destructor_fn, _v)) { _sp = (const Tango::DevAttrHistoryList*)_v; return 1; } return 0; } static void _0RL_Tango_mDevAttrHistoryList__3_marshal_fn(cdrStream& _s, void* _v) { Tango::DevAttrHistoryList_3* _p = (Tango::DevAttrHistoryList_3*)_v; *_p >>= _s; } static void _0RL_Tango_mDevAttrHistoryList__3_unmarshal_fn(cdrStream& _s, void*& _v) { Tango::DevAttrHistoryList_3* _p = new Tango::DevAttrHistoryList_3; *_p <<= _s; _v = _p; } static void _0RL_Tango_mDevAttrHistoryList__3_destructor_fn(void* _v) { Tango::DevAttrHistoryList_3* _p = (Tango::DevAttrHistoryList_3*)_v; delete _p; } void operator<<=(::CORBA::Any& _a, const Tango::DevAttrHistoryList_3& _s) { Tango::DevAttrHistoryList_3* _p = new Tango::DevAttrHistoryList_3(_s); _a.PR_insert(_0RL_tc_Tango_mDevAttrHistoryList__3, _0RL_Tango_mDevAttrHistoryList__3_marshal_fn, _0RL_Tango_mDevAttrHistoryList__3_destructor_fn, _p); } void operator<<=(::CORBA::Any& _a, Tango::DevAttrHistoryList_3* _sp) { _a.PR_insert(_0RL_tc_Tango_mDevAttrHistoryList__3, _0RL_Tango_mDevAttrHistoryList__3_marshal_fn, _0RL_Tango_mDevAttrHistoryList__3_destructor_fn, _sp); } ::CORBA::Boolean operator>>=(const ::CORBA::Any& _a, Tango::DevAttrHistoryList_3*& _sp) { return _a >>= (const Tango::DevAttrHistoryList_3*&) _sp; } ::CORBA::Boolean operator>>=(const ::CORBA::Any& _a, const Tango::DevAttrHistoryList_3*& _sp) { void* _v; if (_a.PR_extract(_0RL_tc_Tango_mDevAttrHistoryList__3, _0RL_Tango_mDevAttrHistoryList__3_unmarshal_fn, _0RL_Tango_mDevAttrHistoryList__3_marshal_fn, _0RL_Tango_mDevAttrHistoryList__3_destructor_fn, _v)) { _sp = (const Tango::DevAttrHistoryList_3*)_v; return 1; } return 0; } static void _0RL_Tango_mZmqCallInfo_marshal_fn(cdrStream& _s, void* _v) { Tango::ZmqCallInfo* _p = (Tango::ZmqCallInfo*)_v; *_p >>= _s; } static void _0RL_Tango_mZmqCallInfo_unmarshal_fn(cdrStream& _s, void*& _v) { Tango::ZmqCallInfo* _p = new Tango::ZmqCallInfo; *_p <<= _s; _v = _p; } static void _0RL_Tango_mZmqCallInfo_destructor_fn(void* _v) { Tango::ZmqCallInfo* _p = (Tango::ZmqCallInfo*)_v; delete _p; } void operator<<=(::CORBA::Any& _a, const Tango::ZmqCallInfo& _s) { Tango::ZmqCallInfo* _p = new Tango::ZmqCallInfo(_s); _a.PR_insert(_0RL_tc_Tango_mZmqCallInfo, _0RL_Tango_mZmqCallInfo_marshal_fn, _0RL_Tango_mZmqCallInfo_destructor_fn, _p); } void operator<<=(::CORBA::Any& _a, Tango::ZmqCallInfo* _sp) { _a.PR_insert(_0RL_tc_Tango_mZmqCallInfo, _0RL_Tango_mZmqCallInfo_marshal_fn, _0RL_Tango_mZmqCallInfo_destructor_fn, _sp); } ::CORBA::Boolean operator>>=(const ::CORBA::Any& _a, Tango::ZmqCallInfo*& _sp) { return _a >>= (const Tango::ZmqCallInfo*&) _sp; } ::CORBA::Boolean operator>>=(const ::CORBA::Any& _a, const Tango::ZmqCallInfo*& _sp) { void* _v; if (_a.PR_extract(_0RL_tc_Tango_mZmqCallInfo, _0RL_Tango_mZmqCallInfo_unmarshal_fn, _0RL_Tango_mZmqCallInfo_marshal_fn, _0RL_Tango_mZmqCallInfo_destructor_fn, _v)) { _sp = (const Tango::ZmqCallInfo*)_v; return 1; } return 0; } static void _0RL_Tango_mDevice_marshal_fn(cdrStream& _s, void* _v) { omniObjRef* _o = (omniObjRef*)_v; omniObjRef::_marshal(_o, _s); } static void _0RL_Tango_mDevice_unmarshal_fn(cdrStream& _s, void*& _v) { omniObjRef* _o = omniObjRef::_unMarshal(Tango::Device::_PD_repoId, _s); _v = _o; } static void _0RL_Tango_mDevice_destructor_fn(void* _v) { omniObjRef* _o = (omniObjRef*)_v; if (_o) omni::releaseObjRef(_o); } void operator<<=(::CORBA::Any& _a, Tango::Device_ptr _o) { Tango::Device_ptr _no = Tango::Device::_duplicate(_o); _a.PR_insert(Tango::_tc_Device, _0RL_Tango_mDevice_marshal_fn, _0RL_Tango_mDevice_destructor_fn, _no->_PR_getobj()); } void operator<<=(::CORBA::Any& _a, Tango::Device_ptr* _op) { _a.PR_insert(Tango::_tc_Device, _0RL_Tango_mDevice_marshal_fn, _0RL_Tango_mDevice_destructor_fn, (*_op)->_PR_getobj()); *_op = Tango::Device::_nil(); } ::CORBA::Boolean operator>>=(const ::CORBA::Any& _a, Tango::Device_ptr& _o) { void* _v; if (_a.PR_extract(Tango::_tc_Device, _0RL_Tango_mDevice_unmarshal_fn, _0RL_Tango_mDevice_marshal_fn, _0RL_Tango_mDevice_destructor_fn, _v)) { omniObjRef* _r = (omniObjRef*)_v; if (_r) _o = (Tango::Device_ptr)_r->_ptrToObjRef(Tango::Device::_PD_repoId); else _o = Tango::Device::_nil(); return 1; } return 0; } static void _0RL_Tango_mDevice__2_marshal_fn(cdrStream& _s, void* _v) { omniObjRef* _o = (omniObjRef*)_v; omniObjRef::_marshal(_o, _s); } static void _0RL_Tango_mDevice__2_unmarshal_fn(cdrStream& _s, void*& _v) { omniObjRef* _o = omniObjRef::_unMarshal(Tango::Device_2::_PD_repoId, _s); _v = _o; } static void _0RL_Tango_mDevice__2_destructor_fn(void* _v) { omniObjRef* _o = (omniObjRef*)_v; if (_o) omni::releaseObjRef(_o); } void operator<<=(::CORBA::Any& _a, Tango::Device_2_ptr _o) { Tango::Device_2_ptr _no = Tango::Device_2::_duplicate(_o); _a.PR_insert(Tango::_tc_Device_2, _0RL_Tango_mDevice__2_marshal_fn, _0RL_Tango_mDevice__2_destructor_fn, _no->_PR_getobj()); } void operator<<=(::CORBA::Any& _a, Tango::Device_2_ptr* _op) { _a.PR_insert(Tango::_tc_Device_2, _0RL_Tango_mDevice__2_marshal_fn, _0RL_Tango_mDevice__2_destructor_fn, (*_op)->_PR_getobj()); *_op = Tango::Device_2::_nil(); } ::CORBA::Boolean operator>>=(const ::CORBA::Any& _a, Tango::Device_2_ptr& _o) { void* _v; if (_a.PR_extract(Tango::_tc_Device_2, _0RL_Tango_mDevice__2_unmarshal_fn, _0RL_Tango_mDevice__2_marshal_fn, _0RL_Tango_mDevice__2_destructor_fn, _v)) { omniObjRef* _r = (omniObjRef*)_v; if (_r) _o = (Tango::Device_2_ptr)_r->_ptrToObjRef(Tango::Device_2::_PD_repoId); else _o = Tango::Device_2::_nil(); return 1; } return 0; } static void _0RL_Tango_mDevice__3_marshal_fn(cdrStream& _s, void* _v) { omniObjRef* _o = (omniObjRef*)_v; omniObjRef::_marshal(_o, _s); } static void _0RL_Tango_mDevice__3_unmarshal_fn(cdrStream& _s, void*& _v) { omniObjRef* _o = omniObjRef::_unMarshal(Tango::Device_3::_PD_repoId, _s); _v = _o; } static void _0RL_Tango_mDevice__3_destructor_fn(void* _v) { omniObjRef* _o = (omniObjRef*)_v; if (_o) omni::releaseObjRef(_o); } void operator<<=(::CORBA::Any& _a, Tango::Device_3_ptr _o) { Tango::Device_3_ptr _no = Tango::Device_3::_duplicate(_o); _a.PR_insert(Tango::_tc_Device_3, _0RL_Tango_mDevice__3_marshal_fn, _0RL_Tango_mDevice__3_destructor_fn, _no->_PR_getobj()); } void operator<<=(::CORBA::Any& _a, Tango::Device_3_ptr* _op) { _a.PR_insert(Tango::_tc_Device_3, _0RL_Tango_mDevice__3_marshal_fn, _0RL_Tango_mDevice__3_destructor_fn, (*_op)->_PR_getobj()); *_op = Tango::Device_3::_nil(); } ::CORBA::Boolean operator>>=(const ::CORBA::Any& _a, Tango::Device_3_ptr& _o) { void* _v; if (_a.PR_extract(Tango::_tc_Device_3, _0RL_Tango_mDevice__3_unmarshal_fn, _0RL_Tango_mDevice__3_marshal_fn, _0RL_Tango_mDevice__3_destructor_fn, _v)) { omniObjRef* _r = (omniObjRef*)_v; if (_r) _o = (Tango::Device_3_ptr)_r->_ptrToObjRef(Tango::Device_3::_PD_repoId); else _o = Tango::Device_3::_nil(); return 1; } return 0; } static void _0RL_Tango_mDevice__4_marshal_fn(cdrStream& _s, void* _v) { omniObjRef* _o = (omniObjRef*)_v; omniObjRef::_marshal(_o, _s); } static void _0RL_Tango_mDevice__4_unmarshal_fn(cdrStream& _s, void*& _v) { omniObjRef* _o = omniObjRef::_unMarshal(Tango::Device_4::_PD_repoId, _s); _v = _o; } static void _0RL_Tango_mDevice__4_destructor_fn(void* _v) { omniObjRef* _o = (omniObjRef*)_v; if (_o) omni::releaseObjRef(_o); } void operator<<=(::CORBA::Any& _a, Tango::Device_4_ptr _o) { Tango::Device_4_ptr _no = Tango::Device_4::_duplicate(_o); _a.PR_insert(Tango::_tc_Device_4, _0RL_Tango_mDevice__4_marshal_fn, _0RL_Tango_mDevice__4_destructor_fn, _no->_PR_getobj()); } void operator<<=(::CORBA::Any& _a, Tango::Device_4_ptr* _op) { _a.PR_insert(Tango::_tc_Device_4, _0RL_Tango_mDevice__4_marshal_fn, _0RL_Tango_mDevice__4_destructor_fn, (*_op)->_PR_getobj()); *_op = Tango::Device_4::_nil(); } ::CORBA::Boolean operator>>=(const ::CORBA::Any& _a, Tango::Device_4_ptr& _o) { void* _v; if (_a.PR_extract(Tango::_tc_Device_4, _0RL_Tango_mDevice__4_unmarshal_fn, _0RL_Tango_mDevice__4_marshal_fn, _0RL_Tango_mDevice__4_destructor_fn, _v)) { omniObjRef* _r = (omniObjRef*)_v; if (_r) _o = (Tango::Device_4_ptr)_r->_ptrToObjRef(Tango::Device_4::_PD_repoId); else _o = Tango::Device_4::_nil(); return 1; } return 0; } tango-8.1.2c+dfsg.orig/lib/cpp/server/attrprop.h0000644000175000017500000003751512205375142020471 0ustar piccapicca///============================================================================= // // file : AttrProp.h // // description : Include file for the AttrProp, DoubleAttrProp and MultiAttrProp classes. // Three classes are declared in this file : // The AttrProp class // The DoubleAttrProp class // The MultiAttrProp class // // project : TANGO // // author(s) : A.Gotz + E.Taurel // // Copyright (C) : 2004,2005,2006,2007,2008,2009,2010,2011,2012,2013 // European Synchrotron Radiation Facility // BP 220, Grenoble 38043 // FRANCE // // This file is part of Tango. // // Tango 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. // // Tango 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 Tango. If not, see . // // $Revision: 19431 $ // //============================================================================= #ifndef _ATTRPROP_H #define _ATTRPROP_H #include namespace Tango { //============================================================================= // // The AttrProp class // // // description : This is a template class which holds a value of attribute // property and its string representation. // //============================================================================= /** * This class represents a Tango attribute property. * * $Author: trogucki $ * $Revision: 19431 $ * * @headerfile tango.h * @ingroup Server */ template class AttrProp { public: /**@name Constructors * Miscellaneous constructors */ //@{ /** * Default constructor. */ AttrProp() : is_value(false),ext(Tango_NullPtr) {} /** * Create a new AttrProp object. * * @param value The attribute property value. */ AttrProp(const T &value) : val(value), is_value(true), ext(Tango_NullPtr) { TangoSys_MemStream st; st.precision(TANGO_FLOAT_PRECISION); st << value; str = st.str(); } /** * Create a new AttrProp object. * * @param value_str The 'C string' representation of attribute property. */ AttrProp(const char *value_str) : str(string(value_str)), is_value(false), ext(Tango_NullPtr) {} /** * Create a new AttrProp object. * * @param value_str The string representation of attribute property value. */ AttrProp(const string &value_str) : str(value_str), is_value(false), ext(Tango_NullPtr) {} //@} /**@name Assignment operators * These operators allow to assign the value of the property by providing * the value or its string representation. */ //@{ /** * Assign the value of the attribute property. * * @param value A value of the attribute property. * * @return AttrProp object with both value and its string representation set. */ AttrProp &operator=(const T &value) { TangoSys_MemStream st; st.precision(TANGO_FLOAT_PRECISION); st << value; str = st.str(); val = value; is_value = true; return *this; } /** * Assign the string representation of the attribute property value. * * @param value_str A 'C string' representation of the attribute property value. * * @return AttrProp object with the string representation of its value set. */ AttrProp &operator=(const char *value_str) { str = value_str; is_value = false; return *this; } /** * Assign the string representation of the attribute property value. * * @param value_str A string representation of the attribute property value. * * @return AttrProp object with the string representation of its value set. */ AttrProp &operator=(const string &value_str) { str = value_str; is_value = false; return *this; } //@} /**@name Get/Set object members. * These methods allow the external world to get/set AttrProp instance * data members */ //@{ /** * Get the attribute property value. * * @return The attribute property value. */ T get_val() { if(is_value == false) { string err_msg = "Numeric representation of the property's value (" + str + ") has not been set"; Tango::Except::throw_exception(API_AttrPropValueNotSet,err_msg,"AttrProp::get_val",Tango::ERR); } return val; } /** * Get string representation of the attribute property value. * * @return The string representation of the attribute property value. */ string &get_str() {return str;} /** * Set the attribute property value. * * The value is automatically converted to its string representation. * * @param value The value of the attribute property. */ void set_val(const T &value) { TangoSys_MemStream st; st.precision(TANGO_FLOAT_PRECISION); st << value; str = st.str(); val = value; is_value = true; } /** * Set string representation of the attribute property value. * * @param value_str The the 'C string' representation of the attribute property value. */ void set_str(const char *value_str) {str = string(value_str); is_value = false;} /** * Set string representation of the attribute property value. * * @param value_str The the string representation of the attribute property value. */ void set_str(const string &value_str) {str = value_str; is_value = false;} //@} /**@name Check method * A method returning a boolean flag set to true if * the attribute property value has been assigned. */ //@{ /** * Check if the attribute property value has been assigned. * * This method returns a boolean set to true if the attribute property value has been assigned. * * @return A boolean set to true if the attribute property value has been assigned */ bool is_val() {return is_value;} //@} /// @privatesection operator string() { return str; } operator const char *() { return str.c_str(); } private: T val; string str; bool is_value; // // The extension class // class AttrPropExt {}; #ifdef HAS_UNIQUE_PTR unique_ptr ext; // Class extension #else AttrPropExt *ext; #endif }; //============================================================================= // // The DoubleAttrProp class // // // description : This is a template class which holds values of a compound // attribute property (like rel_change, abs_change, archive_rel_change, // archive_abs_change) which consists of two values, and its string // representation. // //============================================================================= /** * This class represents a Tango compound attribute property which consists of * two values. * * $Author: trogucki $ * $Revision: 19431 $ * * @headerfile tango.h * @ingroup Server */ template class DoubleAttrProp { public: /**@name Constructors * Miscellaneous constructors */ //@{ /** * Default constructor. */ DoubleAttrProp() : is_value(false) {} /** * Create a new DoubleAttrProp object. * * @param values A vector containing two values of * the compound attribute property. */ DoubleAttrProp(const vector &values) : val(values), is_value(true) { TangoSys_MemStream st; st.precision(TANGO_FLOAT_PRECISION); for(size_t i = 0; i < values.size(); i++) { if(i > 0) st << ","; st << values[i]; } str = st.str(); } /** * Create a new DoubleAttrProp object. * * @param value The figure assigned to both values of the compound attribute property. */ DoubleAttrProp(const T &value) : is_value(true) { TangoSys_MemStream st; st.precision(TANGO_FLOAT_PRECISION); st << value; str = st.str(); val.push_back(value); } /** * Create a new DoubleAttrProp object. * * @param value_str The 'C string' representation of values of the compound attribute property. */ DoubleAttrProp(const char *value_str) : str(string(value_str)), is_value(false) {} /** * Create a new DoubleAttrProp object. * * @param value_str The string representation of values of the compound attribute property. */ DoubleAttrProp(const string &value_str) : str(value_str), is_value(false) {} //@} /**@name Assignment operators * These operators allow to assign the values of the compound attribute property * by providing the values or their string representations. */ //@{ /** * Assign the values of the compound attribute property. * * @param values A vector containing compound attribute property values. * * @return DoubleAttrProp object with both values of the compound attribute property * and their string representation set. */ DoubleAttrProp & operator=(const vector &values) { TangoSys_MemStream st; st.precision(TANGO_FLOAT_PRECISION); for(size_t i = 0; i < values.size(); i++) { if(i > 0) st << ","; st << values[i]; } str = st.str(); val = values; is_value = true; return *this; } /** * Assign the values of the compound attribute property. * * @param value A figure representing both values of the compound attribute property. * * @return DoubleAttrProp object with both values of the compound attribute property * and their string representation set. */ DoubleAttrProp & operator=(const T &value) { TangoSys_MemStream st; st.precision(TANGO_FLOAT_PRECISION); if(ranges_type2const::enu == Tango::DEV_UCHAR) st << (short)value; // to represent the numeric value else st << value; str = st.str(); val.push_back(value); is_value = true; return *this; } /** * Assign the values of the compound attribute property. * * @param value_str A 'C string' representation of values of the compound attribute property. * * @return DoubleAttrProp object with string representation of values of * the compound attribute property set. */ DoubleAttrProp & operator=(const char *value_str) { str = value_str; is_value = false; return *this; } /** * Assign the values of the compound attribute property. * * @param value_str A string representation of values of the compound attribute property. * * @return DoubleAttrProp object with string representation of values of * the compound attribute property set. */ DoubleAttrProp & operator=(const string &value_str) { str = value_str; is_value = false; return *this; } //@} /**@name Get/Set object members. * These methods allow the external world to get/set DoubleAttrProp instance * data members */ //@{ /** * Get the vector containing the compound attribute property values. * * @return The vector containing the compound attribute property values. */ vector get_val() { if(is_value == false) { string err_msg = "Numeric representation of the property's value (" + str + ") has not been set"; Tango::Except::throw_exception(API_AttrPropValueNotSet,err_msg,"AttrProp::get_val",Tango::ERR); } return val; } /** * Get string representation of the compound attribute property values. * * @return The string representation of the compound attribute property values. */ string &get_str() {return str;} /** * Set the compound attribute property values. * * The values are automatically converted to their string representation. * * @param values The vector containing the compound attribute property values. */ void set_val(const vector &values) { TangoSys_MemStream st; st.precision(TANGO_FLOAT_PRECISION); for(size_t i = 0; i < values.size(); i++) { if(i > 0) st << ","; st << values[i]; } str = st.str(); val = values; is_value = true; } /** * Set the compound attribute property values. * * The figure provided is set for both values of the compound attribute property * and is automatically converted to its string representation. * * @param value The figure representing both values of the compound attribute property. */ void set_val(const T &value) { TangoSys_MemStream st; st.precision(TANGO_FLOAT_PRECISION); st << value; str = st.str(); val.push_back(value); is_value = true; } /** * Set string representation of the compound attribute property values. * * @param value_str The 'C string' representation of the compound attribute property values. */ void set_str(const char *value_str) {str = string(value_str); is_value = false;} /** * Set string representation of the compound attribute property values. * * @param value_str The string representation of the compound attribute property values. */ void set_str(const string &value_str) {str = value_str; is_value = false;} //@} /**@name Check method * A method returning a boolean flag set to true if * the compound attribute property values have been assigned. */ //@{ /** * Check if the compound attribute property values have been assigned. * * This method returns a boolean set to true if the compound attribute property values * have been assigned. * * @return A boolean set to true if the compound attribute property values have been assigned */ bool is_val() {return is_value;} //@} /// @privatesection operator string() { return str; } operator const char *() { return str.c_str(); } private: vector val; string str; bool is_value; // // The extension class // class DoubleAttrPropExt {}; #ifdef HAS_UNIQUE_PTR unique_ptr ext; // Class extension #else DoubleAttrPropExt *ext; #endif }; //============================================================================= // // The MultiAttrProp class // // // description : This is a template class which holds values of modifiable // attribute properties. // //============================================================================= /** * This class represents Tango modifiable attribute properties grouped in * one object to facilitate setting and getting attribute properties in one go. * * $Author: trogucki $ * $Revision: 19431 $ * * @headerfile tango.h * @ingroup Server */ template class MultiAttrProp { public: /**@name Constructors * Miscellaneous constructors */ //@{ /** * Default constructor. */ MultiAttrProp() { CmdArgType type = ranges_type2const::enu; // restricts template initialisation to supported types if(type){}; // prevents compiler warning about unused variable type } //@} /**@name Class data members */ //@{ /** * Attribute label */ string label; /** * Attribute description */ string description; /** * Attribute unit */ string unit; /** * Attribute standard_unit */ string standard_unit; /** * Attribute display_unit */ string display_unit; /** * Attribute format */ string format; /** * Attribute min_value */ AttrProp min_value; /** * Attribute max_value */ AttrProp max_value; /** * Attribute min_alarm */ AttrProp min_alarm; /** * Attribute max_alarm */ AttrProp max_alarm; /** * Attribute min_warning */ AttrProp min_warning; /** * Attribute max_warning */ AttrProp max_warning; /** * Attribute delta_t */ AttrProp delta_t; /** * Attribute delta_val */ AttrProp delta_val; /** * Attribute event_period */ AttrProp event_period; /** * Attribute archive_period */ AttrProp archive_period; /** * Attribute rel_change */ DoubleAttrProp rel_change; /** * Attribute abs_change */ DoubleAttrProp abs_change; /** * Attribute archive_rel_change */ DoubleAttrProp archive_rel_change; /** * Attribute archive_abs_change */ DoubleAttrProp archive_abs_change; //@} private: // // The extension class // class MultiAttrPropExt {}; #ifdef HAS_UNIQUE_PTR unique_ptr ext; // Class extension #else MultiAttrPropExt *ext; #endif }; } // End of Tango namespace #endif // _ATTRPROP_H tango-8.1.2c+dfsg.orig/lib/cpp/server/device_4.h0000644000175000017500000003246612205375142020300 0ustar piccapicca//============================================================================= // // file : Device.h // // description : Include for the Device root classes. // Three classes are declared in this file : // The Device class // The DeviceClass class // // project : TANGO // // author(s) : E.Taurel // // Copyright (C) : 2004,2005,2006,2007,2008,2009,2010,2011,2012,2013 // European Synchrotron Radiation Facility // BP 220, Grenoble 38043 // FRANCE // // This file is part of Tango. // // Tango 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. // // Tango 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 Tango. If not, see . // // $Revision: 22213 $ // // //============================================================================= #ifndef _DEVICE_4_H #define _DEVICE_4_H #include namespace Tango { //============================================================================= // // The Device_4Impl class // // // description : This class is derived directly from the Tango::Device_skel // class generated by CORBA. It represents the CORBA // servant which will be accessed by the client. // It implements all the methods // and attributes defined in the IDL interface for Device. // //============================================================================= /** * Base class for all TANGO device since version 4. * * This class inherits from DeviceImpl class which itself inherits from * CORBA classes where all the network layer is implemented. * This class has been created since release 7 of Tango library where the IDL * Tango module has been modified in order to create a Device_4 interface * which inherits from the original Device interface * * $Author: taurel $ * $Revision: 22213 $ * * @headerfile tango.h * @ingroup Server */ class Device_4Impl : public virtual POA_Tango::Device_4, public Device_3Impl { public: /**@name Constructors * Miscellaneous constructors */ //@{ /** * Constructs a newly allocated Device_4Impl object from its name. * * The device description field is set to A Tango device. The device * state is set to unknown and the device status is set to * Not Initialised * * @param device_class Pointer to the device class object * @param dev_name The device name * */ Device_4Impl(DeviceClass *device_class,string &dev_name); /** * Constructs a newly allocated Device_4Impl object from its name and its description. * * The device * state is set to unknown and the device status is set to * Not Initialised * * @param device_class Pointer to the device class object * @param dev_name The device name * @param desc The device description * */ Device_4Impl(DeviceClass *device_class,string &dev_name,string &desc); /** * Constructs a newly allocated Device_4Impl object from all its creation * parameters. * * The device is constructed from its name, its description, an original state * and status * * @param device_class Pointer to the device class object * @param dev_name The device name * @param desc The device description * @param dev_state The device initial state * @param dev_status The device initial status * */ Device_4Impl(DeviceClass *device_class, string &dev_name,string &desc, Tango::DevState dev_state,string &dev_status); /** * Constructs a newly allocated Device_4Impl object from all its creation * parameters with some default values. * * The device is constructed from its name, its description, an original state * and status. This constructor defined default values for the description, * state and status parameters. The default device description is A TANGO device. * The default device state is UNKNOWN and the default device status * is Not initialised. * * @param device_class Pointer to the device class object * @param dev_name The device name * @param desc The device desc * @param dev_state The device initial state * @param dev_status The device initial status * */ Device_4Impl(DeviceClass *device_class, const char *dev_name,const char *desc = "A TANGO device", Tango::DevState dev_state = Tango::UNKNOWN, const char *dev_status = StatusNotSet); //@} /**@name Destructor * Only one desctructor is defined for this class */ //@{ /** * The device desctructor. */ virtual ~Device_4Impl() {} //@} /**@name CORBA operation methods * Method defined to implement TANGO device CORBA operation */ //@{ /** * Read attribute value history. * * Invoked when the client request the read_attribute_history_3 CORBA operation. * This operation allows a client to retrieve attribute value history for * polled attribute. The depth of the history is limited to the depth of * the device server internal polling buffer. * It returns to the client one DevAttrHistory structure for each record. * * @param name The attribute name * @param n The record number. * @return A DevAttrHistory_4 structure. This strucure contains all the element * allowing a client to retrieve for each history record the attribute value, * the date and in case of the attribute * returns an error when it was read, the DevErrors data. * Click here * to read DevAttrHistory structure definition. * @exception DevFailed Thrown if the attribute does not exist or is not polled. * Click here to read * DevFailed exception specification */ virtual Tango::DevAttrHistory_4 *read_attribute_history_4(const char* name, CORBA::Long n); /** * Read command value history. * * Invoked when the client request the command_inout_history_2 CORBA operation. * This operation allows a client to retrieve command return value history for * polled command. The depth of the history is limited to the depth of * the device server internal polling buffer. * It returns to the client one DevCmdHistory structure for each record. * * @param command The command name * @param n The record number. * @return A DevCmdHistory_4 structure. This strucure contains all the element * allowing a client to retrieve for each history record the command return value * (in an Any), the date and in case of the command returns an error when it was read, the * DevErrors data. * Click here * to read DevCmdHistory structure definition. * @exception DevFailed Thrown if the attribute does not exist or is not polled. * Click here to read * DevFailed exception specification */ virtual Tango::DevCmdHistory_4 *command_inout_history_4(const char* command, CORBA::Long n); /** * Execute a command. * * It's the master method executed when a "command_inout_4" CORBA operation is * requested by a client. It checks the device lock, updates the device black-box, call the * TANGO command handler and returned the output Any * * @param in_cmd The command name * @param in_data The command input data packed in a CORBA Any * @param source The data source. This parameter is new in Tango release 2. It * allows a client to choose the data source between the device itself or the * data cache for polled command. * @param cl_ident The client identificator. This parameter is new in release 4. * It allows device locking feature implemented in Tango V7 * @return The command output data packed in a CORBA Any object * @exception DevFailed Re-throw of the exception thrown by the command_handler * method. * Click here to read * DevFailed exception specification */ virtual CORBA::Any *command_inout_4(const char *in_cmd, const CORBA::Any &in_data, Tango::DevSource source, const Tango::ClntIdent &cl_ident); /** * Read attribute(s) value. * * Invoked when the client request the read_attributes_2 CORBA operation. * It returns to the client one AttributeValue structure for each wanted * attribute. * * @param names The attribute(s) name list * @param source The data source. This parameter is new in Tango release 2. It * allows a client to choose the data source between the device itself or the * data cache for polled attribute. * @param cl_ident The client identificator. This parameter is new in release 4. * It allows device locking feature implemented in Tango V7 * @return A sequence of AttributeValue_4 structure. One structure is initialised * for each wanted attribute with the attribute value, the date and the attribute * value quality. Click here * to read AttributeValue structure definition. * @exception DevFailed Thrown if the attribute does not exist. * Click here to read * DevFailed exception specification */ virtual Tango::AttributeValueList_4 *read_attributes_4(const Tango::DevVarStringArray& names, Tango::DevSource source, const Tango::ClntIdent &cl_ident); /** * Write attribute(s) value. * * Invoked when the client request the write_attributes CORBA operation. * It sets the attribute(s) with the new value(s) passed as parameter. * * @param values The attribute(s) new value(s). One structure is initialised * for each wanted attribute with the attribute value. The attribute quality and * date are not used by this method. * Click here * to read AttributeValue_4 structure definition. * @param cl_ident The client identificator. This parameter is new in release 4. * It allows device locking feature implemented in Tango V7 * @exception DevFailed Thrown if the command does not exist. * Click here to read * DevFailed exception specification */ virtual void write_attributes_4(const Tango::AttributeValueList_4 &values, const Tango::ClntIdent &cl_ident); /** * Set attribute(s) configuration. * * Invoked when the client request the set_attribute_config_3 CORBA operation. * It updates the device attribute configuration actually used by the device but * this method also updates the Tango database. One structure of the * AttributeConfig_3 type is needed for each attribute to update configuration. * Click here * to read AttributeConfig_3 structure specification. * * @param new_conf The attribute(s) new configuration structure sequence * @param cl_ident The client identificator. This parameter is new in release 4. * It allows device locking feature implemented in Tango V7 * @exception DevFailed Thrown if the command does not exist. * Click here to read * DevFailed exception specification */ virtual void set_attribute_config_4(const Tango::AttributeConfigList_3& new_conf, const Tango::ClntIdent &cl_ident); /** * Write then read attribute(s) value. * * Invoked when the client request the write_read_attributes CORBA operation. * It sets the attribute(s) with the new value(s) passed as parameter * and then read the attribute(s) and return the read value to the caller. * * @param values The attribute(s) new value(s). One structure is initialised * for each wanted attribute with the attribute value. The attribute quality and * date are not used by this method. * Click here * to read AttributeValue structure definition. * @param cl_ident The client identificator. This parameter is new in release 4. * It allows device locking feature implemented in Tango V7 * @return A sequence of AttributeValue_4 structure. One structure is initialised * for each wanted attribute with the attribute value, the date and the attribute * value quality. Click here * to read AttributeValue_4 structure definition. * @exception DevFailed Thrown if the command does not exist. * Click here to read * DevFailed exception specification */ virtual Tango::AttributeValueList_4* write_read_attributes_4(const Tango::AttributeValueList_4 &values, const Tango::ClntIdent &cl_ident); //@} private: class Device_4ImplExt { public: Device_4ImplExt() {} ~Device_4ImplExt() {} }; #ifdef HAS_UNIQUE_PTR unique_ptr ext_4; // Class extension #else Device_4ImplExt *ext_4; #endif }; } // End of Tango namespace #endif // _DEVICE_4_H tango-8.1.2c+dfsg.orig/lib/cpp/server/attribute.h0000644000175000017500000031060412205375142020612 0ustar piccapicca///============================================================================= // // file : Attribute.h // // description : Include file for the Attribute classes. // Two classes are declared in this file : // The Attribute class // The WAttribute class // // project : TANGO // // author(s) : A.Gotz + E.Taurel // // Copyright (C) : 2004,2005,2006,2007,2008,2009,2010,2011,2012,2013 // European Synchrotron Radiation Facility // BP 220, Grenoble 38043 // FRANCE // // This file is part of Tango. // // Tango 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. // // Tango 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 Tango. If not, see . // // $Revision: 22370 $ // //============================================================================= #ifndef _ATTRIBUTE_H #define _ATTRIBUTE_H #include #include #include #include #include #include #ifdef _TG_WINDOWS_ #include #include #endif namespace Tango { // // Binary function objects to be used by the find_if algorithm. // The find_if algo. want to have a predicate, this means that the return value // must be a boolean (R is its name). // The test is done between a AttrProperty object (name A1) and a string (name A2) // The find_if algo. needs a unary predicate. This function object is a binary // function object. It must be used with the bind2nd function adapter // template struct WantedProp : public binary_function { R operator() (A1 att,A2 name_str) const { return att.get_name() == name_str; } }; template struct WantedAttr : public binary_function { R operator() (A1 attr_ptr, A2 name) const { string st(name); if (st.size() != attr_ptr->get_name_size()) return false; transform(st.begin(),st.end(),st.begin(),::tolower); return attr_ptr->get_name_lower() == st; } }; class AttrProperty; class DeviceClass; typedef union _Attr_CheckVal { short sh; DevLong lg; double db; float fl; unsigned short ush; unsigned char uch; DevLong64 lg64; DevULong ulg; DevULong64 ulg64; DevState d_sta; }Attr_CheckVal; typedef union _Attr_Value { DevVarShortArray *sh_seq; DevVarLongArray *lg_seq; DevVarFloatArray *fl_seq; DevVarDoubleArray *db_seq; DevVarStringArray *str_seq; DevVarUShortArray *ush_seq; DevVarBooleanArray *boo_seq; DevVarCharArray *cha_seq; DevVarLong64Array *lg64_seq; DevVarULongArray *ulg_seq; DevVarULong64Array *ulg64_seq; DevVarStateArray *state_seq; DevVarEncodedArray *enc_seq; }Attr_Value; typedef struct last_attr_value { bool inited; Tango::AttrQuality quality; CORBA::Any value; bool err; DevFailed except; AttrValUnion value_4; } LastAttrValue; typedef enum prop_type { MIN_VALUE = 0, MAX_VALUE, MIN_WARNING, MAX_WARNING, MIN_ALARM, MAX_ALARM } PropType; class EventSupplier; //============================================================================= // // The Attribute class // // // description : There is one instance of this class for each attribute // for each device. This class stores the attribute // properties and the attribute value. // //============================================================================= /** * This class represents a Tango attribute. * * $Author: taurel $ * $Revision: 22370 $ * * @headerfile tango.h * @ingroup Server */ class Attribute { public: /// @privatesection enum alarm_flags { min_level, max_level, rds, min_warn, max_warn, numFlags }; /// @publicsection /**@name Constructors * Miscellaneous constructors */ //@{ /** * Create a new Attribute object. * * @param prop_list The attribute properties list. Each property is an object * of the AttrProperty class * @param tmp_attr Temporary attribute object built from user parameters * @param dev_name The device name * @param idx The index of the related Attr object in the MultiClassAttribute * vector of Attr object */ Attribute(vector &prop_list,Attr &tmp_attr,string &dev_name,long idx); //@} /**@name Destructor * Only one desctructor is defined for this class */ //@{ /** * The attribute desctructor. */ virtual ~Attribute() {try{delete ext;}catch(omni_thread_fatal &){}} //@} /**@name Check attribute methods * Miscellaneous method returning boolean flag according to attribute state */ //@{ /** * Check if the attribute has an associated writable attribute. * * This method returns a boolean set to true if the attribute has a writable * attribute associated to it. * * @return A boolean set to true if there is an associated writable attribute */ bool is_writ_associated(); /** * Check if the attribute is in minimum alarm condition . * * @return A boolean set to true if the attribute is in alarm condition (read * value below the min. alarm). */ bool is_min_alarm() {return alarm.test(min_level);} /** * Check if the attribute is in maximum alarm condition . * * @return A boolean set to true if the attribute is in alarm condition (read * value above the max. alarm). */ bool is_max_alarm() {return alarm.test(max_level);} /** * Check if the attribute is in minimum warning condition . * * @return A boolean set to true if the attribute is in warning condition (read * value below the min. warning). */ bool is_min_warning() {return alarm.test(min_warn);} /** * Check if the attribute is in maximum warning condition . * * @return A boolean set to true if the attribute is in warning condition (read * value above the max. warning). */ bool is_max_warning() {return alarm.test(max_warn);} /** * Check if the attribute is in RDS alarm condition . * * @return A boolean set to true if the attribute is in RDS condition (Read * Different than Set). */ bool is_rds_alarm() {return alarm.test(rds);} /** * Check if the attribute has an alarm defined. * * This method returns a set of bits. Each alarm type is defined by one * bit. * * @return A bitset. Each bit is set if the coresponding alarm is on */ bitset &is_alarmed() {return alarm_conf;} /** * Check if the attribute is polled . * * @return A boolean set to true if the attribute is polled. */ bool is_polled(); /** * Check if the attribute read value is below/above the alarm level. * * @return A boolean set to true if the attribute is in alarm condition. * @exception DevFailed If no alarm level is defined. * Click here to read * DevFailed exception specification */ bool check_alarm(); //@} /**@name Get/Set object members. * These methods allow the external world to get/set DeviceImpl instance * data members */ //@{ /** * Get the attribute writable type (RO/WO/RW). * * @return The attribute write type. */ Tango::AttrWriteType get_writable() {return writable;} /** * Get attribute name * * @return The attribute name */ string &get_name() {return name;} /** * Get attribute data type * * @return The attribute data type */ long get_data_type() {return data_type;} /** * Get attribute data format * * @return The attribute data format */ Tango::AttrDataFormat get_data_format() {return data_format;} /** * Get name of the associated writable attribute * * @return The associated writable attribute name */ string &get_assoc_name() {return writable_attr_name;} /** * Get index of the associated writable attribute * * @return The index in the main attribute vector of the associated writable * attribute */ long get_assoc_ind() {return assoc_ind;} /** * Set index of the associated writable attribute * * @param val The new index in the main attribute vector of the associated writable * attribute */ void set_assoc_ind(long val) {assoc_ind = val;} /** * Get attribute date * * @return The attribute date */ Tango::TimeVal &get_date() {return when;} /** * Set attribute date * * @param new_date The attribute date */ void set_date(Tango::TimeVal &new_date) {when = new_date;} #ifdef _TG_WINDOWS_ /** * Set attribute date * * @param The attribute date */ void set_date(struct _timeb &t) {when.tv_sec=(long)t.time;when.tv_usec=(t.millitm*1000);when.tv_nsec=0;} #endif /** * Set attribute date * * @param t The attribute date */ void set_date(struct timeval &t) {when.tv_sec=t.tv_sec;when.tv_usec=t.tv_usec;when.tv_nsec=0;} /** * Set attribute date * * @param new_date The attribute date */ void set_date(time_t new_date) {when.tv_sec=(long)new_date;when.tv_usec=0;when.tv_nsec=0;} /** * Get attribute label property * * @return The attribute label */ string &get_label() {return label;} /** * Get attribute data quality * * @return The attribute data quality */ Tango::AttrQuality &get_quality() {return quality;} /** * Set attribute data quality * * @param qua The new attribute data quality * @param send_event Boolean set to true if a change event should be sent */ void set_quality(Tango::AttrQuality qua, bool send_event=false); /** * Get attribute data size * * @return The attribute data size */ long get_data_size() {return data_size;} /** * Get attribute data size in x dimension * * @return The attribute data size in x dimension. Set to 1 for scalar attribute */ long get_x() {return dim_x;} /** * Get attribute maximum data size in x dimension * * @return The attribute maximum data size in x dimension. Set to 1 for scalar attribute */ long get_max_dim_x() {return max_x;} /** * Get attribute data size in y dimension * * @return The attribute data size in y dimension. Set to 0 for scalar and * spectrum attribute */ long get_y() {return dim_y;} /** * Get attribute maximum data size in y dimension * * @return The attribute maximum data size in y dimension. Set to 0 for scalar and * spectrum attribute */ long get_max_dim_y() {return max_y;} /** * Get attribute polling period * * @return The attribute polling period in mS. Set to 0 when the attribute is * not polled */ long get_polling_period() {return ext->poll_period;} /** * Get all modifiable attribute properties in one call * * This method initializes the members of a MultiAttrProp object with the modifiable * attribute properties values * * @param props A MultiAttrProp object. */ template void get_properties(Tango::MultiAttrProp &props); /** * Set all modifiable attribute properties in one call * * This method sets the modifiable attribute properties with the values * provided as members of MultiAttrProps object * * @param props A MultiAttrProp object. */ template void set_properties(Tango::MultiAttrProp &props); /** * Set attribute serialization model * * This method allows the user to choose the attribute serialization * model. * * @param ser_model The new serialisation model. The serialization model must be * one of ATTR_BY_KERNEL, ATTR_BY_USER or ATTR_NO_SYNC */ void set_attr_serial_model(AttrSerialModel ser_model); /** * Get attribute serialization model * * Get the attribute serialization model * * @return The attribute serialization model */ AttrSerialModel get_attr_serial_model() {return ext->attr_serial_model;} /** * Set attribute user mutex * * This method allows the user to give to the attribute object the pointer to * the omni_mutex used to protect its buffer. The mutex has to be locked when passed * to this method. The Tango kernel will unlock it when the data will be transferred * to the client. * * @param mut_ptr The user mutex pointer */ void set_user_attr_mutex(omni_mutex *mut_ptr) {ext->user_attr_mutex = mut_ptr;} //@} /**@name Set attribute value methods. * These methods allows the external world to set attribute object internal * value */ //@{ /** * Set internal attribute value (for Tango::DevShort attribute data type). * * This method stores the attribute read value inside the object. This data will be * returned to the caller. This method also stores the date when it is called * and initialise the attribute quality factor. * * @param p_data The attribute read value * @param x The attribute x length. Default value is 1 * @param y The attribute y length. Default value is 0 * @param release The release flag. If true, memory pointed to by p_data will be * freed after being send to the client. Default value is false. * @exception DevFailed If the attribute data type is not coherent. * Click here to read * DevFailed exception specification */ void set_value(Tango::DevShort *p_data,long x = 1,long y = 0,bool release = false); /** * Set internal attribute value (for Tango::DevLong attribute data type). * * This method stores the attribute read value inside the object. This data will be * returned to the caller. This method also stores the date when it is called * and initialise the attribute quality factor. * * @param p_data The attribute read value * @param x The attribute x length. Default value is 1 * @param y The attribute y length. Default value is 0 * @param release The release flag. If true, memory pointed to by p_data will be * freed after being send to the client. Default value is false. * @exception DevFailed If the attribute data type is not coherent. * Click here to read * DevFailed exception specification */ void set_value(Tango::DevLong *p_data,long x = 1, long y = 0,bool release = false); /** * Set internal attribute value (for Tango::DevLong64 attribute data type). * * This method stores the attribute read value inside the object. This data will be * returned to the caller. This method also stores the date when it is called * and initialise the attribute quality factor. * * @param p_data The attribute read value * @param x The attribute x length. Default value is 1 * @param y The attribute y length. Default value is 0 * @param release The release flag. If true, memory pointed to by p_data will be * freed after being send to the client. Default value is false. * @exception DevFailed If the attribute data type is not coherent. * Click here to read * DevFailed exception specification */ void set_value(Tango::DevLong64 *p_data,long x = 1,long y = 0,bool release = false); /** * Set internal attribute value (for Tango::DevFloat attribute data type). * * This method stores the attribute read value inside the object. This data will be * returned to the caller. This method also stores the date when it is called * and initialise the attribute quality factor. * * @param p_data The attribute read value * @param x The attribute x length. Default value is 1 * @param y The attribute y length. Default value is 0 * @param release The release flag. If true, memory pointed to by p_data will be * freed after being send to the client. Default value is false. * @exception DevFailed If the attribute data type is not coherent. * Click here to read * DevFailed exception specification */ void set_value(Tango::DevFloat *p_data,long x = 1,long y = 0,bool release = false); /** * Set internal attribute value (for Tango::DevDouble attribute data type). * * This method stores the attribute read value inside the object. This data will be * returned to the caller. This method also stores the date when it is called * and initialise the attribute quality factor. * * @param p_data The attribute read value * @param x The attribute x length. Default value is 1 * @param y The attribute y length. Default value is 0 * @param release The release flag. If true, memory pointed to by p_data will be * freed after being send to the client. Default value is false. * @exception DevFailed If the attribute data type is not coherent. * Click here to read * DevFailed exception specification */ void set_value(Tango::DevDouble *p_data,long x = 1,long y = 0,bool release = false); /** * Set internal attribute value (for Tango::DevString attribute data type). * * This method stores the attribute read value inside the object. This data will be * returned to the caller. This method also stores the date when it is called * and initialise the attribute quality factor. * * @param p_data The attribute read value * @param x The attribute x length. Default value is 1 * @param y The attribute y length. Default value is 0 * @param release The release flag. If true, memory pointed to by p_data will be * freed after being send to the client. Default value is false. * @exception DevFailed If the attribute data type is not coherent. * Click here to read * DevFailed exception specification */ void set_value(Tango::DevString *p_data,long x = 1,long y = 0,bool release = false); /** * Set internal attribute value (for Tango::DevBoolean attribute data type). * * This method stores the attribute read value inside the object. This data will be * returned to the caller. This method also stores the date when it is called * and initialise the attribute quality factor. * * @param p_data The attribute read value * @param x The attribute x length. Default value is 1 * @param y The attribute y length. Default value is 0 * @param release The release flag. If true, memory pointed to by p_data will be * freed after being send to the client. Default value is false. * @exception DevFailed If the attribute data type is not coherent. * Click here to read * DevFailed exception specification */ void set_value(Tango::DevBoolean *p_data,long x = 1,long y = 0,bool release = false); /** * Set internal attribute value (for Tango::DevUShort attribute data type). * * This method stores the attribute read value inside the object. This data will be * returned to the caller. This method also stores the date when it is called * and initialise the attribute quality factor. * * @param p_data The attribute read value * @param x The attribute x length. Default value is 1 * @param y The attribute y length. Default value is 0 * @param release The release flag. If true, memory pointed to by p_data will be * freed after being send to the client. Default value is false. * @exception DevFailed If the attribute data type is not coherent. * Click here to read * DevFailed exception specification */ void set_value(Tango::DevUShort *p_data,long x = 1,long y = 0,bool release = false); /** * Set internal attribute value (for Tango::DevUChar attribute data type). * * This method stores the attribute read value inside the object. This data will be * returned to the caller. This method also stores the date when it is called * and initialise the attribute quality factor. * * @param p_data The attribute read value * @param x The attribute x length. Default value is 1 * @param y The attribute y length. Default value is 0 * @param release The release flag. If true, memory pointed to by p_data will be * freed after being send to the client. Default value is false. * @exception DevFailed If the attribute data type is not coherent. * Click here to read * DevFailed exception specification */ void set_value(Tango::DevUChar *p_data,long x = 1,long y = 0,bool release = false); /** * Set internal attribute value (for Tango::DevULong attribute data type). * * This method stores the attribute read value inside the object. This data will be * returned to the caller. This method also stores the date when it is called * and initialise the attribute quality factor. * * @param p_data The attribute read value * @param x The attribute x length. Default value is 1 * @param y The attribute y length. Default value is 0 * @param release The release flag. If true, memory pointed to by p_data will be * freed after being send to the client. Default value is false. * @exception DevFailed If the attribute data type is not coherent. * Click here to read * DevFailed exception specification */ void set_value(Tango::DevULong *p_data,long x = 1,long y = 0,bool release = false); /** * Set internal attribute value (for Tango::DevULong64 attribute data type). * * This method stores the attribute read value inside the object. This data will be * returned to the caller. This method also stores the date when it is called * and initialise the attribute quality factor. * * @param p_data The attribute read value * @param x The attribute x length. Default value is 1 * @param y The attribute y length. Default value is 0 * @param release The release flag. If true, memory pointed to by p_data will be * freed after being send to the client. Default value is false. * @exception DevFailed If the attribute data type is not coherent. * Click here to read * DevFailed exception specification */ void set_value(Tango::DevULong64 *p_data,long x = 1,long y = 0,bool release = false); /** * Set internal attribute value (for Tango::DevState attribute data type). * * This method stores the attribute read value inside the object. This data will be * returned to the caller. This method also stores the date when it is called * and initialise the attribute quality factor. * * @param p_data The attribute read value * @param x The attribute x length. Default value is 1 * @param y The attribute y length. Default value is 0 * @param release The release flag. If true, memory pointed to by p_data will be * freed after being send to the client. Default value is false. * @exception DevFailed If the attribute data type is not coherent. * Click here to read * DevFailed exception specification */ void set_value(Tango::DevState *p_data,long x = 1,long y = 0,bool release = false); /** * Set internal attribute value (for Tango::DevEncoded attribute data type). * * This method stores the attribute read value inside the object. This data will be * returned to the caller. This method also stores the date when it is called * and initialise the attribute quality factor. * * @param p_data The attribute read value * @param x The attribute x length. Default value is 1 * @param y The attribute y length. Default value is 0 * @param release The release flag. If true, memory pointed to by p_data will be * freed after being send to the client. Default value is false. * @exception DevFailed If the attribute data type is not coherent. * Click here to read * DevFailed exception specification */ void set_value(Tango::DevEncoded *p_data,long x = 1, long y = 0,bool release = false); /** * Set internal attribute value (for Tango::DevEncoded attribute data type). * * This method stores the attribute read value inside the object. This data will be * returned to the caller. This method also stores the date when it is called * and initialise the attribute quality factor. * * @param p_data_str The attribute string part read value * @param p_data The attribute raw data part read value * @param size Size of the attribute raw data part * @param release The release flag. If true, memory pointed to by p_data will be * freed after being send to the client. Default value is false. * @exception DevFailed If the attribute data type is not coherent. * Click here to read * DevFailed exception specification */ void set_value(Tango::DevString *p_data_str,Tango::DevUChar *p_data,long size,bool release = false); /** * Set internal attribute value (for Tango::DevEncoded attribute data type). * * This method stores the attribute read value inside the object. This data will be * returned to the caller. This method also stores the date when it is called * and initialise the attribute quality factor. * * @param attr Handle to EncodedAttribute object * @exception DevFailed If the attribute data type is not coherent. * Click here to read * DevFailed exception specification */ void set_value(Tango::EncodedAttribute *attr); //--------------------------------------------------------------------------- /** * Set internal attribute value, date and quality factor (for Tango::DevShort attribute data type). * * This method stores the attribute read value, the date and the attribute * quality factor inside the object. This data will be * returned to the caller. * * @param p_data The attribute read value * @param t The date * @param qual The attribute quality factor * @param x The attribute x length. Default value is 1 * @param y The attribute y length. Default value is 0 * @param release The release flag. If true, memory pointed to by p_data will be * freed after being send to the client. Default value is false. * @exception DevFailed If the attribute data type is not coherent. * Click here to read * DevFailed exception specification */ void set_value_date_quality(Tango::DevShort *p_data, time_t t, Tango::AttrQuality qual, long x = 1,long y = 0, bool release = false); #ifdef _TG_WINDOWS_ void set_value_date_quality(Tango::DevShort *p_data, struct _timeb &t, Tango::AttrQuality qual, long x = 1,long y = 0, bool release = false); #else /** * Set internal attribute value, date and quality factor (for Tango::DevShort attribute data type). * * This method stores the attribute read value, the date and the attribute * quality factor inside the object. This data will be * returned to the caller. * * Please note that for Win32 user, the same method is defined using a * "_timeb" structure instead of a "timeval" structure to set date. * * @param p_data The attribute read value * @param t The date * @param qual The attribute quality factor * @param x The attribute x length. Default value is 1 * @param y The attribute y length. Default value is 0 * @param release The release flag. If true, memory pointed to by p_data will be * freed after being send to the client. Default value is false. * @exception DevFailed If the attribute data type is not coherent. * Click here to read * DevFailed exception specification */ void set_value_date_quality(Tango::DevShort *p_data, struct timeval &t, Tango::AttrQuality qual, long x = 1,long y = 0, bool release = false); #endif //----------------------------------------------------------------------- /** * Set internal attribute value, date and quality factor (for Tango::DevLong attribute data type). * * This method stores the attribute read value, the date and the attribute * quality factor inside the object. This data will be * returned to the caller. * * @param p_data The attribute read value * @param t The date * @param qual The attribute quality factor * @param x The attribute x length. Default value is 1 * @param y The attribute y length. Default value is 0 * @param release The release flag. If true, memory pointed to by p_data will be * freed after being send to the client. Default value is false. * @exception DevFailed If the attribute data type is not coherent. * Click here to read * DevFailed exception specification */ void set_value_date_quality(Tango::DevLong *p_data, time_t t, Tango::AttrQuality qual, long x = 1,long y = 0, bool release = false); #ifdef _TG_WINDOWS_ void set_value_date_quality(Tango::DevLong *p_data, struct _timeb &t, Tango::AttrQuality qual, long x = 1,long y = 0, bool release = false); #else /** * Set internal attribute value, date and quality factor (for Tango::DevLong attribute data type). * * This method stores the attribute read value, the date and the attribute * quality factor inside the object. This data will be * returned to the caller. * * Please note that for Win32 user, the same method is defined using a * "_timeb" structure instead of a "timeval" structure to set date. * * @param p_data The attribute read value * @param t The date * @param qual The attribute quality factor * @param x The attribute x length. Default value is 1 * @param y The attribute y length. Default value is 0 * @param release The release flag. If true, memory pointed to by p_data will be * freed after being send to the client. Default value is false. * @exception DevFailed If the attribute data type is not coherent. * Click here to read * DevFailed exception specification */ void set_value_date_quality(Tango::DevLong *p_data, struct timeval &t, Tango::AttrQuality qual, long x = 1,long y = 0, bool release = false); #endif //----------------------------------------------------------------------- /** * Set internal attribute value, date and quality factor (for Tango::DevLong64 attribute data type). * * This method stores the attribute read value, the date and the attribute * quality factor inside the object. This data will be * returned to the caller. * * @param p_data The attribute read value * @param t The date * @param qual The attribute quality factor * @param x The attribute x length. Default value is 1 * @param y The attribute y length. Default value is 0 * @param release The release flag. If true, memory pointed to by p_data will be * freed after being send to the client. Default value is false. * @exception DevFailed If the attribute data type is not coherent. * Click here to read * DevFailed exception specification */ void set_value_date_quality(Tango::DevLong64 *p_data, time_t t, Tango::AttrQuality qual, long x = 1,long y = 0, bool release = false); #ifdef _TG_WINDOWS_ void set_value_date_quality(Tango::DevLong64 *p_data, struct _timeb &t, Tango::AttrQuality qual, long x = 1,long y = 0, bool release = false); #else /** * Set internal attribute value, date and quality factor (for Tango::DevLong64 attribute data type). * * This method stores the attribute read value, the date and the attribute * quality factor inside the object. This data will be * returned to the caller. * * Please note that for Win32 user, the same method is defined using a * "_timeb" structure instead of a "timeval" structure to set date. * * @param p_data The attribute read value * @param t The date * @param qual The attribute quality factor * @param x The attribute x length. Default value is 1 * @param y The attribute y length. Default value is 0 * @param release The release flag. If true, memory pointed to by p_data will be * freed after being send to the client. Default value is false. * @exception DevFailed If the attribute data type is not coherent. * Click here to read * DevFailed exception specification */ void set_value_date_quality(Tango::DevLong64 *p_data, struct timeval &t, Tango::AttrQuality qual, long x = 1,long y = 0, bool release = false); #endif //----------------------------------------------------------------------- /** * Set internal attribute value, date and quality factor (for Tango::DevFloat attribute data type). * * This method stores the attribute read value, the date and the attribute * quality factor inside the object. This data will be * returned to the caller. * * @param p_data The attribute read value * @param t The date * @param qual The attribute quality factor * @param x The attribute x length. Default value is 1 * @param y The attribute y length. Default value is 0 * @param release The release flag. If true, memory pointed to by p_data will be * freed after being send to the client. Default value is false. * @exception DevFailed If the attribute data type is not coherent. * Click here to read * DevFailed exception specification */ void set_value_date_quality(Tango::DevFloat *p_data, time_t t, Tango::AttrQuality qual, long x = 1,long y = 0, bool release = false); #ifdef _TG_WINDOWS_ void set_value_date_quality(Tango::DevFloat *p_data, struct _timeb &t, Tango::AttrQuality qual, long x = 1,long y = 0, bool release = false); #else /** * Set internal attribute value, date and quality factor (for Tango::DevFloat attribute data type). * * This method stores the attribute read value, the date and the attribute * quality factor inside the object. This data will be * returned to the caller. * * Please note that for Win32 user, the same method is defined using a * "_timeb" structure instead of a "timeval" structure to set date. * * @param p_data The attribute read value * @param t The date * @param qual The attribute quality factor * @param x The attribute x length. Default value is 1 * @param y The attribute y length. Default value is 0 * @param release The release flag. If true, memory pointed to by p_data will be * freed after being send to the client. Default value is false. * @exception DevFailed If the attribute data type is not coherent. * Click here to read * DevFailed exception specification */ void set_value_date_quality(Tango::DevFloat *p_data, struct timeval &t, Tango::AttrQuality qual, long x = 1,long y = 0, bool release = false); #endif //----------------------------------------------------------------------- /** * Set internal attribute value, date and quality factor (for Tango::DevDouble attribute data type). * * This method stores the attribute read value, the date and the attribute * quality factor inside the object. This data will be * returned to the caller. * * @param p_data The attribute read value * @param t The date * @param qual The attribute quality factor * @param x The attribute x length. Default value is 1 * @param y The attribute y length. Default value is 0 * @param release The release flag. If true, memory pointed to by p_data will be * freed after being send to the client. Default value is false. * @exception DevFailed If the attribute data type is not coherent. * Click here to read * DevFailed exception specification */ void set_value_date_quality(Tango::DevDouble *p_data, time_t t, Tango::AttrQuality qual, long x = 1,long y = 0, bool release = false); #ifdef _TG_WINDOWS_ void set_value_date_quality(Tango::DevDouble *p_data, struct _timeb &t, Tango::AttrQuality qual, long x = 1,long y = 0, bool release = false); #else /** * Set internal attribute value, date and quality factor (for Tango::DevDouble attribute data type). * * This method stores the attribute read value, the date and the attribute * quality factor inside the object. This data will be * returned to the caller. * * Please note that for Win32 user, the same method is defined using a * "_timeb" structure instead of a "timeval" structure to set date. * * @param p_data The attribute read value * @param t The date * @param qual The attribute quality factor * @param x The attribute x length. Default value is 1 * @param y The attribute y length. Default value is 0 * @param release The release flag. If true, memory pointed to by p_data will be * freed after being send to the client. Default value is false. * @exception DevFailed If the attribute data type is not coherent. * Click here to read * DevFailed exception specification */ void set_value_date_quality(Tango::DevDouble *p_data, struct timeval &t, Tango::AttrQuality qual, long x = 1,long y = 0, bool release = false); #endif //----------------------------------------------------------------------- /** * Set internal attribute value, date and quality factor (for Tango::DevString attribute data type). * * This method stores the attribute read value, the date and the attribute * quality factor inside the object. This data will be * returned to the caller. * * @param p_data The attribute read value * @param t The date * @param qual The attribute quality factor * @param x The attribute x length. Default value is 1 * @param y The attribute y length. Default value is 0 * @param release The release flag. If true, memory pointed to by p_data will be * freed after being send to the client. Default value is false. * @exception DevFailed If the attribute data type is not coherent. * Click here to read * DevFailed exception specification */ void set_value_date_quality(Tango::DevString *p_data, time_t t, Tango::AttrQuality qual, long x = 1,long y = 0, bool release = false); #ifdef _TG_WINDOWS_ void set_value_date_quality(Tango::DevString *p_data, struct _timeb &t, Tango::AttrQuality qual, long x = 1,long y = 0, bool release = false); #else /** * Set internal attribute value, date and quality factor (for Tango::DevString attribute data type). * * This method stores the attribute read value, the date and the attribute * quality factor inside the object. This data will be * returned to the caller. * * Please note that for Win32 user, the same method is defined using a * "_timeb" structure instead of a "timeval" structure to set date. * * @param p_data The attribute read value * @param t The date * @param qual The attribute quality factor * @param x The attribute x length. Default value is 1 * @param y The attribute y length. Default value is 0 * @param release The release flag. If true, memory pointed to by p_data will be * freed after being send to the client. Default value is false. * @exception DevFailed If the attribute data type is not coherent. * Click here to read * DevFailed exception specification */ void set_value_date_quality(Tango::DevString *p_data, struct timeval &t, Tango::AttrQuality qual, long x = 1,long y = 0, bool release = false); #endif //----------------------------------------------------------------------- /** * Set internal attribute value, date and quality factor (for Tango::DevBoolean attribute data type). * * This method stores the attribute read value, the date and the attribute * quality factor inside the object. This data will be * returned to the caller. * * @param p_data The attribute read value * @param t The date * @param qual The attribute quality factor * @param x The attribute x length. Default value is 1 * @param y The attribute y length. Default value is 0 * @param release The release flag. If true, memory pointed to by p_data will be * freed after being send to the client. Default value is false. * @exception DevFailed If the attribute data type is not coherent. * Click here to read * DevFailed exception specification */ void set_value_date_quality(Tango::DevBoolean *p_data, time_t t, Tango::AttrQuality qual, long x = 1,long y = 0, bool release = false); #ifdef _TG_WINDOWS_ void set_value_date_quality(Tango::DevBoolean *p_data, struct _timeb &t, Tango::AttrQuality qual, long x = 1,long y = 0, bool release = false); #else /** * Set internal attribute value, date and quality factor (for Tango::DevBoolean attribute data type). * * This method stores the attribute read value, the date and the attribute * quality factor inside the object. This data will be * returned to the caller. * * Please note that for Win32 user, the same method is defined using a * "_timeb" structure instead of a "timeval" structure to set date. * * @param p_data The attribute read value * @param t The date * @param qual The attribute quality factor * @param x The attribute x length. Default value is 1 * @param y The attribute y length. Default value is 0 * @param release The release flag. If true, memory pointed to by p_data will be * freed after being send to the client. Default value is false. * @exception DevFailed If the attribute data type is not coherent. * Click here to read * DevFailed exception specification */ void set_value_date_quality(Tango::DevBoolean *p_data, struct timeval &t, Tango::AttrQuality qual, long x = 1,long y = 0, bool release = false); #endif //----------------------------------------------------------------------- /** * Set internal attribute value, date and quality factor (for Tango::DevUShort attribute data type). * * This method stores the attribute read value, the date and the attribute * quality factor inside the object. This data will be * returned to the caller. * * @param p_data The attribute read value * @param t The date * @param qual The attribute quality factor * @param x The attribute x length. Default value is 1 * @param y The attribute y length. Default value is 0 * @param release The release flag. If true, memory pointed to by p_data will be * freed after being send to the client. Default value is false. * @exception DevFailed If the attribute data type is not coherent. * Click here to read * DevFailed exception specification */ void set_value_date_quality(Tango::DevUShort *p_data, time_t t, Tango::AttrQuality qual, long x = 1,long y = 0, bool release = false); #ifdef _TG_WINDOWS_ void set_value_date_quality(Tango::DevUShort *p_data, struct _timeb &t, Tango::AttrQuality qual, long x = 1,long y = 0, bool release = false); #else /** * Set internal attribute value, date and quality factor (for Tango::DevUShort attribute data type). * * This method stores the attribute read value, the date and the attribute * quality factor inside the object. This data will be * returned to the caller. * * Please note that for Win32 user, the same method is defined using a * "_timeb" structure instead of a "timeval" structure to set date. * * @param p_data The attribute read value * @param t The date * @param qual The attribute quality factor * @param x The attribute x length. Default value is 1 * @param y The attribute y length. Default value is 0 * @param release The release flag. If true, memory pointed to by p_data will be * freed after being send to the client. Default value is false. * @exception DevFailed If the attribute data type is not coherent. * Click here to read * DevFailed exception specification */ void set_value_date_quality(Tango::DevUShort *p_data, struct timeval &t, Tango::AttrQuality qual, long x = 1,long y = 0, bool release = false); #endif //----------------------------------------------------------------------- /** * Set internal attribute value, date and quality factor (for Tango::DevUChar attribute data type). * * This method stores the attribute read value, the date and the attribute * quality factor inside the object. This data will be * returned to the caller. * * @param p_data The attribute read value * @param t The date * @param qual The attribute quality factor * @param x The attribute x length. Default value is 1 * @param y The attribute y length. Default value is 0 * @param release The release flag. If true, memory pointed to by p_data will be * freed after being send to the client. Default value is false. * @exception DevFailed If the attribute data type is not coherent. * Click here to read * DevFailed exception specification */ void set_value_date_quality(Tango::DevUChar *p_data, time_t t, Tango::AttrQuality qual, long x = 1,long y = 0, bool release = false); #ifdef _TG_WINDOWS_ void set_value_date_quality(Tango::DevUChar *p_data, struct _timeb &t, Tango::AttrQuality qual, long x = 1,long y = 0, bool release = false); #else /** * Set internal attribute value, date and quality factor (for Tango::DevUChar attribute data type). * * This method stores the attribute read value, the date and the attribute * quality factor inside the object. This data will be * returned to the caller. * * Please note that for Win32 user, the same method is defined using a * "_timeb" structure instead of a "timeval" structure to set date. * * @param p_data The attribute read value * @param t The date * @param qual The attribute quality factor * @param x The attribute x length. Default value is 1 * @param y The attribute y length. Default value is 0 * @param release The release flag. If true, memory pointed to by p_data will be * freed after being send to the client. Default value is false. * @exception DevFailed If the attribute data type is not coherent. * Click here to read * DevFailed exception specification */ void set_value_date_quality(Tango::DevUChar *p_data, struct timeval &t, Tango::AttrQuality qual, long x = 1,long y = 0, bool release = false); #endif //----------------------------------------------------------------------- /** * Set internal attribute value, date and quality factor (for Tango::DevULong attribute data type). * * This method stores the attribute read value, the date and the attribute * quality factor inside the object. This data will be * returned to the caller. * * @param p_data The attribute read value * @param t The date * @param qual The attribute quality factor * @param x The attribute x length. Default value is 1 * @param y The attribute y length. Default value is 0 * @param release The release flag. If true, memory pointed to by p_data will be * freed after being send to the client. Default value is false. * @exception DevFailed If the attribute data type is not coherent. * Click here to read * DevFailed exception specification */ void set_value_date_quality(Tango::DevULong *p_data, time_t t, Tango::AttrQuality qual, long x = 1,long y = 0, bool release = false); #ifdef _TG_WINDOWS_ void set_value_date_quality(Tango::DevULong *p_data, struct _timeb &t, Tango::AttrQuality qual, long x = 1,long y = 0, bool release = false); #else /** * Set internal attribute value, date and quality factor (for Tango::DevULong attribute data type). * * This method stores the attribute read value, the date and the attribute * quality factor inside the object. This data will be * returned to the caller. * * Please note that for Win32 user, the same method is defined using a * "_timeb" structure instead of a "timeval" structure to set date. * * @param p_data The attribute read value * @param t The date * @param qual The attribute quality factor * @param x The attribute x length. Default value is 1 * @param y The attribute y length. Default value is 0 * @param release The release flag. If true, memory pointed to by p_data will be * freed after being send to the client. Default value is false. * @exception DevFailed If the attribute data type is not coherent. * Click here to read * DevFailed exception specification */ void set_value_date_quality(Tango::DevULong *p_data, struct timeval &t, Tango::AttrQuality qual, long x = 1,long y = 0, bool release = false); #endif //----------------------------------------------------------------------- /** * Set internal attribute value, date and quality factor (for Tango::DevULong64 attribute data type). * * This method stores the attribute read value, the date and the attribute * quality factor inside the object. This data will be * returned to the caller. * * @param p_data The attribute read value * @param t The date * @param qual The attribute quality factor * @param x The attribute x length. Default value is 1 * @param y The attribute y length. Default value is 0 * @param release The release flag. If true, memory pointed to by p_data will be * freed after being send to the client. Default value is false. * @exception DevFailed If the attribute data type is not coherent. * Click here to read * DevFailed exception specification */ void set_value_date_quality(Tango::DevULong64 *p_data, time_t t, Tango::AttrQuality qual, long x = 1,long y = 0, bool release = false); #ifdef _TG_WINDOWS_ void set_value_date_quality(Tango::DevULong64 *p_data, struct _timeb &t, Tango::AttrQuality qual, long x = 1,long y = 0, bool release = false); #else /** * Set internal attribute value, date and quality factor (for Tango::DevULong64 attribute data type). * * This method stores the attribute read value, the date and the attribute * quality factor inside the object. This data will be * returned to the caller. * * Please note that for Win32 user, the same method is defined using a * "_timeb" structure instead of a "timeval" structure to set date. * * @param p_data The attribute read value * @param t The date * @param qual The attribute quality factor * @param x The attribute x length. Default value is 1 * @param y The attribute y length. Default value is 0 * @param release The release flag. If true, memory pointed to by p_data will be * freed after being send to the client. Default value is false. * @exception DevFailed If the attribute data type is not coherent. * Click here to read * DevFailed exception specification */ void set_value_date_quality(Tango::DevULong64 *p_data, struct timeval &t, Tango::AttrQuality qual, long x = 1,long y = 0, bool release = false); #endif //----------------------------------------------------------------------- /** * Set internal attribute value, date and quality factor (for Tango::DevState attribute data type). * * This method stores the attribute read value, the date and the attribute * quality factor inside the object. This data will be * returned to the caller. * * @param p_data The attribute read value * @param t The date * @param qual The attribute quality factor * @param x The attribute x length. Default value is 1 * @param y The attribute y length. Default value is 0 * @param release The release flag. If true, memory pointed to by p_data will be * freed after being send to the client. Default value is false. * @exception DevFailed If the attribute data type is not coherent. * Click here to read * DevFailed exception specification */ void set_value_date_quality(Tango::DevState *p_data, time_t t, Tango::AttrQuality qual, long x = 1,long y = 0, bool release = false); #ifdef _TG_WINDOWS_ void set_value_date_quality(Tango::DevState *p_data, struct _timeb &t, Tango::AttrQuality qual, long x = 1,long y = 0, bool release = false); #else /** * Set internal attribute value, date and quality factor (for Tango::DevState attribute data type). * * This method stores the attribute read value, the date and the attribute * quality factor inside the object. This data will be * returned to the caller. * * Please note that for Win32 user, the same method is defined using a * "_timeb" structure instead of a "timeval" structure to set date. * * @param p_data The attribute read value * @param t The date * @param qual The attribute quality factor * @param x The attribute x length. Default value is 1 * @param y The attribute y length. Default value is 0 * @param release The release flag. If true, memory pointed to by p_data will be * freed after being send to the client. Default value is false. * @exception DevFailed If the attribute data type is not coherent. * Click here to read * DevFailed exception specification */ void set_value_date_quality(Tango::DevState *p_data, struct timeval &t, Tango::AttrQuality qual, long x = 1,long y = 0, bool release = false); #endif //----------------------------------------------------------------------- /** * Set internal attribute value, date and quality factor (for Tango::DevEncoded attribute data type). * * This method stores the attribute read value, the date and the attribute * quality factor inside the object. This data will be * returned to the caller. * * @param p_data The attribute read value * @param t The date * @param qual The attribute quality factor * @param x The attribute x length. Default value is 1 * @param y The attribute y length. Default value is 0 * @param release The release flag. If true, memory pointed to by p_data will be * freed after being send to the client. Default value is false. * @exception DevFailed If the attribute data type is not coherent. * Click here to read * DevFailed exception specification */ void set_value_date_quality(Tango::DevEncoded *p_data, time_t t, Tango::AttrQuality qual, long x = 1,long y = 0, bool release = false); /** * Set internal attribute value, date and quality factor (for Tango::DevEncoded attribute data type * when splitted in format and data). * * This method stores the attribute read value, the date and the attribute * quality factor inside the object. This data will be * returned to the caller. * * @param p_data_str The attribute coded format string * @param p_data The attribute raw data * @param size Size of the attribute raw data part * @param t The date * @param qual The attribute quality factor * @param release The release flag. If true, memory pointed to by p_data will be * freed after being send to the client. Default value is false. * @exception DevFailed If the attribute data type is not coherent. * Click here to read * DevFailed exception specification */ void set_value_date_quality(Tango::DevString *p_data_str, Tango::DevUChar *p_data, long size, time_t t, Tango::AttrQuality qual, bool release = false); #ifdef _TG_WINDOWS_ void set_value_date_quality(Tango::DevEncoded *p_data, struct _timeb &t, Tango::AttrQuality qual, long x = 1,long y = 0, bool release = false); void set_value_date_quality(Tango::DevString *p_data_str, Tango::DevUChar *p_data, long size, struct _timeb &t, Tango::AttrQuality qual, bool release = false); #else /** * Set internal attribute value, date and quality factor (for Tango::DevEncoded attribute data type). * * This method stores the attribute read value, the date and the attribute * quality factor inside the object. This data will be * returned to the caller. * * Please note that for Win32 user, the same method is defined using a * "_timeb" structure instead of a "timeval" structure to set date. * * @param p_data The attribute read value * @param t The date * @param qual The attribute quality factor * @param x The attribute x length. Default value is 1 * @param y The attribute y length. Default value is 0 * @param release The release flag. If true, memory pointed to by p_data will be * freed after being send to the client. Default value is false. * @exception DevFailed If the attribute data type is not coherent. * Click here to read * DevFailed exception specification */ void set_value_date_quality(Tango::DevEncoded *p_data, struct timeval &t, Tango::AttrQuality qual, long x = 1,long y = 0, bool release = false); /** * Set internal attribute value, date and quality factor (for Tango::DevEncoded attribute data type * when splitted in data format and data themselves). * * This method stores the attribute read value, the date and the attribute * quality factor inside the object. This data will be * returned to the caller. * * Please note that for Win32 user, the same method is defined using a * "_timeb" structure instead of a "timeval" structure to set date. * * @param p_data_str The attribute format string * @param p_data The attribute raw data * @param size Size of the attribute raw data part * @param t The date * @param qual The attribute quality factor * @param release The release flag. If true, memory pointed to by p_data will be * freed after being send to the client. Default value is false. * @exception DevFailed If the attribute data type is not coherent. * Click here to read * DevFailed exception specification */ void set_value_date_quality(Tango::DevString *p_data_str, Tango::DevUChar *p_data, long size, struct timeval &t, Tango::AttrQuality qual, bool release = false); #endif /** * Fire a change event for the attribute value. The event is pushed to the notification * daemon. * The attibute data must be set with one of the Attribute::set_value or * Attribute::setvalue_date_quality methods before fireing the event. * The event is triggered with or without the change event criteria depending * on the configuration choosen with set_change_event(). * ATTENTION: The couple set_value() and fire_change_event() needs to be protected * against concurrent accesses to the same attribute. Such an access might happen during * a synchronous read or by a reading from the polling thread. * Inside all methods reading or writing commands and attributes this protection is * automatically done by the Tango serialisation monitor. * When fireing change events in your own code, you should use the push_change_event * methods of the DeviceImpl class or protect your code with the * Tango::AutoTangoMonitor on your device. * Example: * * { * Tango::AutoTangoMonitor synch(this); * att_temp_seq.set_value (temp_seq, 100); * att_temp_seq.fire_archive_event (); * } * * @param except A pointer to a DevFailed exception to be thrown as archive event. */ void fire_change_event(DevFailed *except = NULL); /** * Set a flag to indicate that the server fires change events manually, without * the polling to be started for the attribute. * If the detect parameter is set to true, the criteria specified for the change * event are verified and the event is only pushed if they are fullfilled. * If detect is set to false the event is fired without any value checking! * * @param implemented True when the server fires change events manually. * @param detect Triggers the verification of the change event properties when set to true. */ void set_change_event(bool implemented, bool detect = true) { ext->change_event_implmented = implemented; ext->check_change_event_criteria = detect; if(detect==false){ ext->prev_change_event.err=false; ext->prev_change_event.quality=Tango::ATTR_VALID;}} /** * Check if the change event is fired manually (without polling) for this attribute. * * @return A boolean set to true if a manual fire change event is implemented. */ bool is_change_event() {return ext->change_event_implmented;} /** * Check if the change event criteria should be checked when firing * the event manually. * * @return A boolean set to true if a change event criteria will be checked. */ bool is_check_change_criteria() {return ext->check_change_event_criteria;} /** * Fire an archive event for the attribute value. The event is pushed to the notification * daemon. * The attibute data must be set with one of the Attribute::set_value or * Attribute::setvalue_date_quality methods before fireing the event. * The event is triggered with or without the archive event criteria depending * on the configuration choosen with set_archive_event(). * ATTENTION: The couple set_value() and fire_archive_event() needs to be protected * against concurrent accesses to the same attribute. Such an access might happen during * a synchronous read or by a reading from the polling thread. * Inside all methods reading or writing commands and attributes this protection is * automatically done by the Tango serialisation monitor. * When fireing archive events in your own code, you should use the push_archive_event * methods of the DeviceImpl class or protect your code with the * Tango::AutoTangoMonitor on your device. * Example: * * { * Tango::AutoTangoMonitor synch(this); * att_temp_seq.set_value (temp_seq, 100); * att_temp_seq.fire_archive_event (); * } * * @param except A pointer to a DevFailed exception to be thrown as archive event. */ void fire_archive_event(DevFailed *except = NULL); /** * Set a flag to indicate that the server fires archive events manually, without * the polling to be started for the attribute * If the detect parameter is set to true, the criteria specified for the archive * event are verified and the event is only pushed if they are fullfilled. * If detect is set to false the event is fired without any value checking! * * @param implemented True when the server fires archive events manually. * @param detect Triggers the verification of the archive event properties when set to true. */ void set_archive_event(bool implemented, bool detect = true) {ext->archive_event_implmented = implemented; ext->check_archive_event_criteria = detect;} /** * Check if the archive event is fired manually for this attribute. * * @return A boolean set to true if a manual fire archive event is implemented. */ bool is_archive_event() {return ext->archive_event_implmented;} /** * Check if the archive event criteria should be checked when firing * the event manually. * * @return A boolean set to true if a archive event criteria will be checked. */ bool is_check_archive_criteria() {return ext->check_archive_event_criteria;} /** * Set a flag to indicate that the server fires data ready events * * @param implemented True when the server fires change events manually. */ void set_data_ready_event(bool implemented) {ext->dr_event_implmented = implemented;} /** * Check if the data ready event is fired for this attribute. * * @return A boolean set to true if a fire data ready event is implemented. */ bool is_data_ready_event() {return ext->dr_event_implmented;} /** * Fire a user event for the attribute value. The event is pushed to the notification * daemon. * The attibute data must be set with one of the Attribute::set_value or * Attribute::setvalue_date_quality methods before fireing the event. * ATTENTION: The couple set_value() and fire_event() needs to be protected * against concurrent accesses to the same attribute. Such an access might happen during * a synchronous read or by a reading from the polling thread. * Inside all methods reading or writing commands and attributes this protection is * automatically done by the Tango serialisation monitor. * When fireing archive events in your own code, you should use the push_event * methods of the DeviceImpl class or protect your code with the * Tango::AutoTangoMonitor on your device. * Example: * * { * Tango::AutoTangoMonitor synch(this); * att_temp_seq.set_value (temp_seq, 100); * att_temp_seq.fire_event (); * } * * @param filt_names The filterable fields name * @param filt_vals The filterable fields value (as double) * @param except A pointer to a DevFailed exception to be thrown as archive event. */ void fire_event(vector &filt_names,vector &filt_vals,DevFailed *except = NULL); /** * Remove the attribute configuration from the database. * This method can be used to clean-up all the configuration of an attribute to come back to * its default values or the remove all configuration of a dynamic attribute before deleting it. * * The method removes all configured attribute properties and removes the attribute from the * list of polled attributes. * * @exception DevFailed In case of database access problems. * Click here to read * DevFailed exception specification */ void remove_configuration(); //@} /**@name Set/Get attribute ranges (min_alarm, min_warning, max_warning, max_alarm) methods. * These methods allow the external world to set attribute object min_alarm, min_warning, * max_warning and max_alarm values */ //@{ /** * Set attribute minimum alarm. * * This method sets the attribute minimum alarm. * * @param new_min_alarm The new attribute minimum alarm value * @exception DevFailed If the attribute data type is not coherent. * Click here to read * DevFailed exception specification */ template void set_min_alarm(const T &new_min_alarm); void set_min_alarm(char *new_min_alarm); void set_min_alarm(const char *new_min_alarm); /** * Get attribute minimum alarm or throw an exception if the attribute * does not have the minimum alarm * * @param min_al Reference to a variable which value will be set to the attribute's * minimum alarm */ template void get_min_alarm(T &min_al); /** * Set attribute maximum alarm. * * This method sets the attribute maximum alarm. * * @param new_max_alarm The new attribute maximum alarm value * @exception DevFailed If the attribute data type is not coherent. * Click here to read * DevFailed exception specification */ template void set_max_alarm(const T &new_max_alarm); void set_max_alarm(char *new_max_alarm); void set_max_alarm(const char *new_max_alarm); /** * Get attribute maximum alarm or throw an exception if the attribute * does not have the maximum alarm set * * @param max_al Reference to a variable which value will be set to the attribute's * maximum alarm */ template void get_max_alarm(T &max_al); /** * Set attribute minimum warning. * * This method sets the attribute minimum warning. * * @param new_min_warning The new attribute minimum warning value * @exception DevFailed If the attribute data type is not coherent. * Click here to read * DevFailed exception specification */ template void set_min_warning(const T &new_min_warning); void set_min_warning(char *new_min_warning); void set_min_warning(const char *new_min_warning); /** * Get attribute minimum warning or throw an exception if the attribute * does not have the minimum warning set * * @param min_war Reference to a variable which value will be set to the attribute's * minimum warning */ template void get_min_warning(T &min_war); /** * Set attribute maximum warning. * * This method sets the attribute maximum warning. * * @param new_max_warning The new attribute maximum warning value * @exception DevFailed If the attribute data type is not coherent. * Click here to read * DevFailed exception specification */ template void set_max_warning(const T &new_max_warning); void set_max_warning(char *new_max_warning); void set_max_warning(const char *new_max_warning); /** * Get attribute maximum warning or throw an exception if the attribute * does not have the maximum warning set * * @param max_war Reference to a variable which value will be set to the attribute's * maximum warning */ template void get_max_warning(T &max_war); //@} protected: /**@name Class data members */ //@{ /** * A flag set to true if the attribute value has been updated */ bool value_flag; /** * The date when attribute was read */ Tango::TimeVal when; /** * Flag set to true if the date must be set */ bool date; /** * The attribute quality factor */ Tango::AttrQuality quality; /** * The attribute name */ string name; /** * The attribute writable flag */ Tango::AttrWriteType writable; /** * The attribute data type. * * Eight types are suported. They are Tango::DevShort, Tango::DevLong, * Tango::DevDouble, Tango::DevString, Tango::DevUShort, Tango::DevUChar, * Tango::DevFloat and Tango::DevBoolean */ long data_type; /** * The attribute data format. * * Three data formats are supported. They are SCALAR, SPECTRUM and IMAGE */ Tango::AttrDataFormat data_format; /** * The attribute maximum x dimension. * * It is needed for SPECTRUM or IMAGE data format */ long max_x; /** * The attribute maximum y dimension. * * It is necessary only for IMAGE data format */ long max_y; /** * The attribute label */ string label; /** * The attribute description */ string description; /** * The attribute unit */ string unit; /** * The attribute standard unit */ string standard_unit; /** * The attribute display unit */ string display_unit; /** * The attribute format. * * This string specifies how an attribute value must be printed */ string format; /** * The name of the associated writable attribute */ string writable_attr_name; /** * The attribute minimum alarm level */ string min_alarm_str; /** * The attribute maximun alarm level */ string max_alarm_str; /** * The attribute minimum value */ string min_value_str; /** * The attribute maximum value */ string max_value_str; /** * The attribute minimun warning */ string min_warning_str; /** * The attribute maximum warning */ string max_warning_str; /** * The attribute delta value RDS alarm */ string delta_val_str; /** * The attribute delta time RDS alarm */ string delta_t_str; /** * Index in the main attribute vector of the associated writable attribute (if any) */ long assoc_ind; /** * The attribute minimum alarm in binary format */ Tango::Attr_CheckVal min_alarm; /** * The attribute maximum alarm in binary format */ Tango::Attr_CheckVal max_alarm; /** * The attribute minimum warning in binary format */ Tango::Attr_CheckVal min_warning; /** * The attribute maximum warning in binary format */ Tango::Attr_CheckVal max_warning; /** * The attribute minimum value in binary format */ Tango::Attr_CheckVal min_value; /** * The attribute maximum value in binary format */ Tango::Attr_CheckVal max_value; /** * The attribute value */ Tango::Attr_Value value; /** * The attribute data size */ long data_size; /** * Flag set to true if a minimum value is defined */ bool check_min_value; /** * Flag set to true if a maximum alarm is defined */ bool check_max_value; /** * Authorized delta between the last written value and the * actual read. Used if the attribute has an alarm on * Read Different Than Set (RDS) */ Tango::Attr_CheckVal delta_val; /** * Delta time after which the read value must be checked again the * last written value if the attribute has an alarm on * Read Different Than Set (RDS) */ long delta_t; //@} public: /// @privatesection // // methods not usable for the external world (outside the lib) // void get_properties(Tango::AttributeConfig &conf); void get_properties_2(Tango::AttributeConfig_2 &conf); void get_properties_3(Tango::AttributeConfig_3 &conf); void set_properties(const Tango::AttributeConfig_3 &conf); void set_properties(const Tango::AttributeConfig &conf,Tango::DeviceImpl *dev); void set_properties(const Tango::AttributeConfig_3 &conf,Tango::DeviceImpl *dev); virtual void set_rvalue() {}; void delete_seq(); bool check_scalar_wattribute(); void wanted_date(bool flag) {date = flag;} bool get_wanted_date() {return date;} Tango::TimeVal &get_when() {return when;} void set_time(); Tango::DevVarShortArray *get_short_value() {return value.sh_seq;} Tango::DevVarLongArray *get_long_value() {return value.lg_seq;} Tango::DevVarDoubleArray *get_double_value() {return value.db_seq;} Tango::DevVarStringArray *get_string_value() {return value.str_seq;} Tango::DevVarFloatArray *get_float_value() {return value.fl_seq;} Tango::DevVarBooleanArray *get_boolean_value() {return value.boo_seq;} Tango::DevVarUShortArray *get_ushort_value() {return value.ush_seq;} Tango::DevVarCharArray *get_uchar_value() {return value.cha_seq;} Tango::DevVarLong64Array *get_long64_value() {return value.lg64_seq;} Tango::DevVarULongArray *get_ulong_value() {return value.ulg_seq;} Tango::DevVarULong64Array *get_ulong64_value() {return value.ulg64_seq;} Tango::DevVarStateArray *get_state_value() {return value.state_seq;} Tango::DevVarEncodedArray *get_encoded_value() {return value.enc_seq;} Tango::DevLong64 *get_tmp_scalar_long64() {return ext->tmp_lo64;} Tango::DevULong *get_tmp_scalar_ulong() {return ext->tmp_ulo;} Tango::DevULong64 *get_tmp_scalar_ulong64() {return ext->tmp_ulo64;} Tango::DevState *get_tmp_scalar_state() {return ext->tmp_state;} void add_write_value(Tango::DevVarShortArray *); void add_write_value(Tango::DevVarLongArray *); void add_write_value(Tango::DevVarDoubleArray *); void add_write_value(Tango::DevVarStringArray *); void add_write_value(Tango::DevVarFloatArray *); void add_write_value(Tango::DevVarBooleanArray *); void add_write_value(Tango::DevVarUShortArray *); void add_write_value(Tango::DevVarCharArray *); void add_write_value(Tango::DevVarLong64Array *); void add_write_value(Tango::DevVarULongArray *); void add_write_value(Tango::DevVarULong64Array *); void add_write_value(Tango::DevVarStateArray *); void add_write_value(Tango::DevEncoded &); unsigned long get_name_size() {return name_size;} string &get_name_lower() {return name_lower;} void set_value_flag(bool val) {value_flag = val;} bool get_value_flag() {return value_flag;} DispLevel get_disp_level() {return ext->disp_level;} omni_mutex *get_attr_mutex() {return &(ext->attr_mutex);} omni_mutex *get_user_attr_mutex() {return ext->user_attr_mutex;} void set_properties(const Tango::AttributeConfig &,string &); void set_properties(const Tango::AttributeConfig_3 &,string &); void upd_database(const Tango::AttributeConfig &,string &); void upd_database(const Tango::AttributeConfig_3 &,string &); void set_upd_properties(const Tango::AttributeConfig_3 &); void set_upd_properties(const Tango::AttributeConfig_3 &,string &); bool change_event_subscribed() {if (ext->event_change_subscription != 0)return true;else return false;} bool periodic_event_subscribed() {if (ext->event_periodic_subscription != 0)return true;else return false;} bool archive_event_subscribed() {if (ext->event_archive_subscription != 0)return true;else return false;} bool quality_event_subscribed() {if (ext->event_quality_subscription != 0)return true;else return false;} bool user_event_subscribed() {if (ext->event_user_subscription != 0)return true;else return false;} bool use_notifd_event() {return ext->notifd_event;} bool use_zmq_event() {return ext->zmq_event;} void set_change_event_sub() {ext->event_change_subscription=time(NULL);} void set_periodic_event_sub() {ext->event_periodic_subscription=time(NULL);} void set_archive_event_sub() {ext->event_archive_subscription=time(NULL);} void set_quality_event_sub() {ext->event_quality_subscription=time(NULL);} void set_user_event_sub() {ext->event_user_subscription=time(NULL);} void set_use_notifd_event() {ext->notifd_event = true;} void set_use_zmq_event() {ext->zmq_event = true;} long get_attr_idx() {return ext->idx_in_attr;} void set_attr_idx(long new_idx) {ext->idx_in_attr=new_idx;} DeviceImpl *get_att_device(); void Attribute_2_AttributeValue(Tango::AttributeValue_3 *,DeviceImpl *); void Attribute_2_AttributeValue(Tango::AttributeValue_4 *,DeviceImpl *); void AttributeValue_4_2_AttributeValue_3(const Tango::AttributeValue_4 *,Tango::AttributeValue_3 *); void set_mcast_event(vector &vs) {ext->mcast_event.clear();copy(vs.begin(),vs.end(),back_inserter(ext->mcast_event));} bool is_polled(DeviceImpl *); void set_polling_period(long per) {ext->poll_period = per;} void save_alarm_quality() {ext->old_quality=quality;ext->old_alarm=alarm;} bool is_startup_exception() {return ext->check_startup_exceptions;} void throw_startup_exception(const char*); bool is_mem_exception() {return ext->mem_exception;} #ifndef TANGO_HAS_LOG4TANGO friend ostream &operator<<(ostream &,Attribute &); #endif // TANGO_HAS_LOG4TANGO friend class EventSupplier; friend class ZmqEventSupplier; friend class DServer; private: void set_data_size(); void throw_min_max_value(string &,string &,MinMaxValueCheck); void check_str_prop(const AttributeConfig &,DbData &,long &,DbData &,long &,vector &,vector &); void log_quality(); void event_prop_db(const char *,vector &,vector &,DbData &,long &,DbData &,long &); unsigned long name_size; string name_lower; DevEncoded enc_help; protected: /// @privatesection // // The extension class // class AttributeExt { public: AttributeExt() : poll_period(0),event_period(0),archive_period(0), last_periodic(0.0),archive_last_periodic(0.0),periodic_counter(0), archive_periodic_counter(0),archive_last_event(0.0), dev(NULL),change_event_implmented(false),archive_event_implmented(false), check_change_event_criteria(true),check_archive_event_criteria(true), event_periodic_client_3(false),event_change_client_3(false),event_archive_client_3(false), event_user_client_3(false),user_attr_mutex(NULL),dr_event_implmented(false), scalar_str_attr_release(false),notifd_event(false),zmq_event(false), check_startup_exceptions(false), startup_exceptions_clear(true), mem_exception(false) {} Tango::DispLevel disp_level; // Display level long poll_period; // Polling period double rel_change[2]; // Delta for relative change events in % double abs_change[2]; // Delta for absolute change events double archive_rel_change[2]; // Delta for relative archive change events in % double archive_abs_change[2]; // Delta for absolute change events int event_period; // Delta for periodic events in ms int archive_period; // Delta for archive periodic events in ms double last_periodic; // Last time a periodic event was detected double archive_last_periodic; // Last time an archive periodic event was detected long periodic_counter; // Number of periodic events sent so far long archive_periodic_counter; // Number of periodic events sent so far LastAttrValue prev_change_event; // Last change attribute LastAttrValue prev_quality_event; // Last quality attribute LastAttrValue prev_archive_event; // Last archive attribute time_t event_change_subscription; // Last time() a subscription was made time_t event_quality_subscription; // Last time() a subscription was made time_t event_periodic_subscription; // Last time() a subscription was made time_t event_archive_subscription; // Last time() a subscription was made time_t event_user_subscription; // Last time() a subscription was made time_t event_attr_conf_subscription; // Last time() a subscription was made time_t event_data_ready_subscription; // Last time() a subscription was made double archive_last_event; // Last time an archive event was detected (periodic or not) long idx_in_attr; // Index in MultiClassAttribute vector string d_name; // The device name DeviceImpl *dev; // The device object bool change_event_implmented; // Flag true if a manual fire change event is implemented. bool archive_event_implmented; // Flag true if a manual fire archive event is implemented. bool check_change_event_criteria; // True if change event criteria should be checked when sending the event bool check_archive_event_criteria; // True if archive event criteria should be checked when sending the event bool event_periodic_client_3; // True if at least one periodic event client is using IDL 3 bool event_change_client_3; // True if at least one periodic event client is using IDL 3 bool event_archive_client_3; // True if at least one periodic event client is using IDL 3 bool event_user_client_3; // True if at least one periodic event client is using IDL 3 Tango::DevLong64 tmp_lo64[2]; Tango::DevULong tmp_ulo[2]; Tango::DevULong64 tmp_ulo64[2]; Tango::DevState tmp_state[2]; omni_mutex attr_mutex; // Mutex to protect the attributes shared data buffer omni_mutex *user_attr_mutex; // Ptr for user mutex in case he manages exclusion AttrSerialModel attr_serial_model; // Flag for attribute serialization model bool dr_event_implmented; // Flag true if fire data ready event is implemented bool scalar_str_attr_release; // Need memory freeing (scalar string attr, R/W att) bool notifd_event; // Set to true if event required using notifd bool zmq_event; // Set to true if event required using ZMQ vector mcast_event; // In case of multicasting used for event transport AttrQuality old_quality; // Previous attribute quality bitset old_alarm; // Previous attribute alarm map startup_exceptions; // Map containing exceptions related to attribute configuration raised during the server startup sequence bool check_startup_exceptions; // Flag set to true if there is at least one exception in startup_exceptions map bool startup_exceptions_clear; // Flag set to true when the cause for the device startup exceptions has been fixed bool mem_exception; // Flag set to true if the attribute is writable and // memorized and if it failed at init }; AttributeExt *ext; virtual void init_opt_prop(vector &prop_list,string &dev_name); virtual void init_event_prop(vector &prop_list,const string &dev_name,Attr &att); string &get_attr_value(vector &prop_list,const char *name); long get_lg_attr_value(vector &prop_list,const char *name); virtual bool check_rds_alarm() {return false;} bool check_level_alarm(); bool check_warn_alarm(); void upd_att_prop_db(Tango::Attr_CheckVal &,const char *); DeviceClass *get_att_device_class(string &); template void check_hard_coded_properties(const T &); void add_startup_exception(string,const DevFailed &); void delete_startup_exception(string); void throw_hard_coded_prop(const char *); void throw_err_format(const char *,const string &,const char *); void throw_incoherent_val_err(const char *,const char *,const string &,const char *); void throw_err_data_type(const char *,const string &,const char *); void validate_change_properties(const string &,const char *,string &,vector &,vector &,vector &); void validate_change_properties(const string &,const char *,string &,vector &); bool prop_in_list(const char *,string &,size_t,vector &); void set_format_notspec(); bool is_format_notspec(const char *); void def_format_in_dbdatum(DbDatum &); void avns_in_db(const char *,string &); void avns_in_att(prop_type); bitset alarm_conf; bitset alarm; long dim_x; long dim_y; Tango::DevShort tmp_sh[2]; Tango::DevLong tmp_lo[2]; Tango::DevFloat tmp_fl[2]; Tango::DevDouble tmp_db[2]; Tango::DevString tmp_str[2]; Tango::DevUShort tmp_ush[2]; Tango::DevBoolean tmp_boo[2]; Tango::DevUChar tmp_cha[2]; Tango::DevEncoded tmp_enc[2]; vector::iterator pos_end; }; // // Some inline methods // //+------------------------------------------------------------------------- // // method : Attribute::throw_hard_coded_prop // // description : Throw a "Hard coded properties can't be changed" exception // // args: in : - prop_name : The name of the property which should be modified // //-------------------------------------------------------------------------- inline void Attribute::throw_hard_coded_prop(const char *prop_name) { TangoSys_OMemStream desc; desc << "Attribute property " << prop_name << " is not changeable at run time" << ends; Except::throw_exception((const char *)API_AttrNotAllowed,desc.str(), (const char *)"Attribute::check_hard_coded_properties()"); } //+------------------------------------------------------------------------- // // method : Attribute::throw_startup_exception // // description : Throw a startup exception // // args: in : - origin : The method name where this method is called from // //-------------------------------------------------------------------------- inline void Attribute::throw_startup_exception(const char* origin) { if(ext->check_startup_exceptions) { string err_msg; vector event_exceptions; vector opt_exceptions; for(map::iterator it = ext->startup_exceptions.begin(); it != ext->startup_exceptions.end(); ++it) { if(it->first == "event_period" || it->first == "archive_period" || it->first == "rel_change" || it->first == "abs_change" || it->first == "archive_rel_change" || it->first == "archive_abs_change") event_exceptions.push_back(it->first); else opt_exceptions.push_back(it->first); for(CORBA::ULong i = 0 ; i < it->second.errors.length(); i++) { string tmp_msg = string(it->second.errors[i].desc); size_t pos = tmp_msg.rfind('\n'); if(pos != string::npos) tmp_msg.erase(0,pos+1); err_msg += "\n" + tmp_msg; } } err_msg = "\nDevice " + ext->d_name + "-> Attribute : " + name + err_msg; if(event_exceptions.size() == ext->startup_exceptions.size()) { if(event_exceptions.size() == 1) err_msg += "\nSetting a valid value (also 'NaN', 'Not specified' and '' - empty string) for any property for this attribute will automatically bring the above-mentioned property to its library defaults"; else err_msg += "\nSetting a valid value (also 'NaN', 'Not specified' and '' - empty string) for any property for this attribute will automatically bring the above-listed properties to their library defaults"; } else if(event_exceptions.empty() == false) { if(opt_exceptions.size() == 1) err_msg += "\nSetting valid value (also 'NaN', 'Not specified' and '' - empty string) for " + opt_exceptions[0] + " "; else { err_msg += "\nSetting valid values (also 'NaN', 'Not specified' and '' - empty string) for "; for(size_t i = 0; i < opt_exceptions.size(); i++) err_msg += ((i == (opt_exceptions.size() - 1) && i != 0) ? "and " : "") + opt_exceptions[i] + ((i != (opt_exceptions.size() - 1) && i != (opt_exceptions.size() - 2)) ? "," : "") + " "; } err_msg += "will automatically bring "; for(size_t i = 0; i < event_exceptions.size(); i++) err_msg += ((i == (event_exceptions.size() - 1) && i != 0) ? "and " : "") + event_exceptions[i] + ((i != (event_exceptions.size() - 1) && i != (event_exceptions.size() - 2)) ? "," : "") + " "; if(event_exceptions.size() == 1) err_msg += "to its library defaults"; else err_msg += "to their library defaults"; } err_msg += "\nHint : Check also class level attribute properties"; Except::throw_exception(API_AttrConfig,err_msg,origin); } } //+------------------------------------------------------------------------- // // method : Attribute::prop_in_list // // description : Search for a property in a list // // args: in : - prop_name : The property name // - list_size : The size list // - list : The list // out : - prop_str : String initialized with prop. value (if found) // //-------------------------------------------------------------------------- inline bool Attribute::prop_in_list(const char *prop_name,string &prop_str,size_t list_size,vector &list) { bool ret = false; if (list_size != 0) { size_t i; for (i = 0;i < list_size;i++) { if (list[i].get_name() == prop_name) break; } if (i != list_size) { prop_str = list[i].get_value(); ret = true; } } return ret; } // // Macro to help coding // #define MEM_STREAM_2_CORBA(A,B) \ if (true) \ { \ string s = B.str(); \ A = CORBA::string_dup(s.c_str()); \ B.str(""); \ B.clear(); \ } \ else \ (void)0 // // Throw exception if pointer is null // #define CHECK_PTR(A,B) \ if (A == NULL) \ { \ TangoSys_OMemStream o; \ o << "Data pointer for attribute " << B << " is NULL!" << ends; \ Except::throw_exception((const char *)API_AttrOptProp,o.str(), \ (const char *)"Attribute::set_value()"); \ } \ else \ (void)0 // // Define one macro to make code more readable // but this macro is nearly unreadable !!! // // Arg list : // A : property as a string // B : stream // C : device name // D : DbData for db update // E : DbData for db delete // F : Number of prop to update // G : Number of prop to delete // H : Property name // I : Default user properties vector ref // J : Default class properties vector ref // // Too many parameters ? // // Comment 1: If the user input value is equal to user default value do not store it in // the database. // // Comment 2: User default value (if defined) has to be converted to double before it is // compared with the user input to determine if to store the new value in the database. // String comparison is not appropriate in case of floating point numbers, // e.g. "5.0" is numerically equal to "5.00" but the strings differ. // // Comment 3: If user defaults are defined - at first place the input string is converted // to double to determine if it is a number. If so, the double value is cast to the type // corresponding with the type of the attribute and further compared with the double // representation of the user default value. // The purpose of casting is as follows. // Lets take an example of an attribute of DevShort data type with user default value for // min_alarm set to 5. Now, if the user inputs "5.678" as a new value for min_alarm // it would normally be cast to DevShort and stored in the database as "5" (this is the // standard behaviour if the user inputs a floating point value for a property of // non-floating point type). But now the outcome "5" is equal to the user default value 5 // and should not be stored in the database. This is why there is the cast of the user // input value to the attribute data type before comparison with the user default value. // #define CHECK_PROP(A,B,C,D,E,F,G,H,I,J) \ { \ size_t nb_user = I.size(); \ size_t nb_class = J.size(); \ string usr_def_val; \ string class_def_val; \ bool user_defaults = false; \ bool class_defaults = false; \ bool store_in_db = true; \ bool avns = false; \ bool user_val = false; \ double user_def_val_db; \ double class_def_val_db; \ bool equal_user_def = false; \ bool equal_class_def = false; \ \ user_defaults = prop_in_list(H,usr_def_val,nb_user,I); \ if (user_defaults) \ { \ B.str(""); \ B.clear(); \ B << usr_def_val; \ B >> user_def_val_db; \ } \ class_defaults = prop_in_list(H,class_def_val,nb_class,J); \ if (class_defaults) \ { \ B.str(""); \ B.clear(); \ B << class_def_val; \ B >> class_def_val_db; \ } \ \ if(user_defaults) \ { \ double db; \ B.str(""); \ B.clear(); \ B << A; \ if (B >> db && B.eof()) \ { \ switch (data_type) \ { \ case Tango::DEV_SHORT: \ if((DevShort)db == user_def_val_db) \ equal_user_def = true; \ break; \ \ case Tango::DEV_LONG: \ if((DevLong)db == user_def_val_db) \ equal_user_def = true; \ break;\ \ case Tango::DEV_LONG64: \ if((DevLong64)db == user_def_val_db) \ equal_user_def = true; \ break;\ \ case Tango::DEV_DOUBLE: \ if(db == user_def_val_db) \ equal_user_def = true; \ break; \ \ case Tango::DEV_FLOAT: \ if(db == user_def_val_db) \ equal_user_def = true; \ break; \ \ case Tango::DEV_USHORT: \ if((DevUShort)db == user_def_val_db) \ equal_user_def = true; \ break; \ \ case Tango::DEV_UCHAR: \ if((DevUChar)db == user_def_val_db) \ equal_user_def = true; \ break; \ \ case Tango::DEV_ULONG: \ if((DevULong)db == user_def_val_db) \ equal_user_def = true; \ break; \ \ case Tango::DEV_ULONG64: \ if((DevULong64)db == user_def_val_db) \ equal_user_def = true; \ break; \ \ case Tango::DEV_ENCODED: \ if((DevUChar)db == user_def_val_db) \ equal_user_def = true; \ break; \ } \ }\ }\ \ if(class_defaults) \ { \ double db; \ B.str(""); \ B.clear(); \ B << A; \ if (B >> db && B.eof()) \ { \ switch (data_type) \ { \ case Tango::DEV_SHORT: \ if((DevShort)db == class_def_val_db) \ equal_class_def = true; \ break; \ \ case Tango::DEV_LONG: \ if((DevLong)db == class_def_val_db) \ equal_class_def = true; \ break;\ \ case Tango::DEV_LONG64: \ if((DevLong64)db == class_def_val_db) \ equal_class_def = true; \ break;\ \ case Tango::DEV_DOUBLE: \ if(db == class_def_val_db) \ equal_class_def = true; \ break; \ \ case Tango::DEV_FLOAT: \ if(db == class_def_val_db) \ equal_class_def = true; \ break; \ \ case Tango::DEV_USHORT: \ if((DevUShort)db == class_def_val_db) \ equal_class_def = true; \ break; \ \ case Tango::DEV_UCHAR: \ if((DevUChar)db == class_def_val_db) \ equal_class_def = true; \ break; \ \ case Tango::DEV_ULONG: \ if((DevULong)db == class_def_val_db) \ equal_class_def = true; \ break; \ \ case Tango::DEV_ULONG64: \ if((DevULong64)db == class_def_val_db) \ equal_class_def = true; \ break; \ \ case Tango::DEV_ENCODED: \ if((DevUChar)db == class_def_val_db) \ equal_class_def = true; \ break; \ } \ }\ }\ \ if (TG_strcasecmp(A,AlrmValueNotSpec) == 0) \ { \ if (user_defaults == true || class_defaults == true) \ { \ store_in_db = true; \ avns = true; \ } \ else \ { \ store_in_db = false; \ } \ } \ else if (strlen(A) == 0) \ { \ if (class_defaults == true) \ { \ store_in_db = true; \ if (user_defaults) \ user_val = true; \ else \ avns = true; \ } \ else \ { \ store_in_db = false; \ } \ } \ else if (TG_strcasecmp(A,NotANumber) == 0) \ { \ store_in_db = false; \ } \ else if (user_defaults == true && equal_user_def == true) \ { \ if (class_defaults == true) \ { \ store_in_db = true; \ user_val = true; \ } \ else \ { \ store_in_db = false; \ } \ } \ else if (class_defaults == true && equal_class_def == true) \ { \ store_in_db = false; \ } \ else \ { \ store_in_db = true; \ } \ \ if(store_in_db) \ { \ string tmp = A.in(); \ if(user_val == true) \ tmp = usr_def_val.c_str(); \ else if(avns == true) \ tmp = AlrmValueNotSpec; \ else \ { \ if ((data_type != Tango::DEV_STRING) && \ (data_type != Tango::DEV_BOOLEAN) && \ (data_type != Tango::DEV_STATE)) \ { \ double db; \ \ B.str(""); \ B.clear(); \ B << A; \ if (!(B >> db && B.eof())) \ { \ throw_err_format(H,C,"Attribute::upd_database"); \ }\ switch (data_type) \ { \ case Tango::DEV_SHORT: \ B.str(""); \ B.clear(); \ B << (DevShort)db; \ break; \ \ case Tango::DEV_LONG: \ B.str(""); \ B.clear(); \ B << (DevLong)db; \ break;\ \ case Tango::DEV_LONG64: \ B.str(""); \ B.clear(); \ B << (DevLong64)db; \ break;\ \ case Tango::DEV_DOUBLE: \ break; \ \ case Tango::DEV_FLOAT: \ break; \ \ case Tango::DEV_USHORT: \ B.str(""); \ B.clear(); \ (db < 0.0) ? B << (DevUShort)(-db) : B << (DevUShort)db; \ break; \ \ case Tango::DEV_UCHAR: \ B.str(""); \ B.clear(); \ (db < 0.0) ? B << (short)((DevUChar)(-db)) : B << (short)((DevUChar)db); \ break; \ \ case Tango::DEV_ULONG: \ B.str(""); \ B.clear(); \ (db < 0.0) ? B << (DevULong)(-db) : B << (DevULong)db; \ break; \ \ case Tango::DEV_ULONG64: \ B.str(""); \ B.clear(); \ (db < 0.0) ? B << (DevULong64)(-db) : B << (DevULong64)db; \ break; \ } \ if (data_type != Tango::DEV_FLOAT && data_type != Tango::DEV_DOUBLE) \ tmp = B.str(); \ } \ else \ { \ throw_err_data_type(H,C,"Attribute::upd_database"); \ } \ } \ \ DbDatum dd(H); \ dd << tmp.c_str(); \ D.push_back(dd); \ F++; \ } \ else \ { \ DbDatum del_dd(H); \ E.push_back(del_dd); \ G++; \ } \ } \ // // Yet another macros !! // Arg list : A : The sequence pointer // B : Index in sequence // C : Attribute reference // #define GIVE_ATT_MUTEX(A,B,C) \ if (true) \ {\ Tango::AttributeValue_4 *tmp_ptr = &((*A)[B]); \ (tmp_ptr)->set_attr_mutex(C.get_attr_mutex()); \ } \ else \ (void)0 #define GIVE_USER_ATT_MUTEX(A,B,C) \ if (true) \ { \ Tango::AttributeValue_4 *tmp_ptr = &((*A)[B]); \ (tmp_ptr)->set_attr_mutex(C.get_user_attr_mutex()); \ } \ else \ (void)0 // // Yet another macro !! // Arg list : A : The sequence pointer // B : Index in sequence // C : Attribute reference // #define REL_ATT_MUTEX(A,B,C) \ if (C.get_attr_serial_model() != ATTR_NO_SYNC) \ { \ Tango::AttributeValue_4 *tmp_ptr = &((*A)[B]); \ (tmp_ptr)->rel_attr_mutex(); \ } \ else \ (void)0 // Add template methods definitions } // End of Tango namespace #endif // _ATTRIBUTE_H tango-8.1.2c+dfsg.orig/lib/cpp/server/idl/0000755000175000017500000000000012205375306017204 5ustar piccapiccatango-8.1.2c+dfsg.orig/lib/cpp/server/idl/Makefile.in0000644000175000017500000004020512205375243021252 0ustar piccapicca# Makefile.in generated by automake 1.11.3 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 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. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ subdir = lib/cpp/server/idl DIST_COMMON = $(idl_HEADERS) $(srcdir)/Makefile.am \ $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/RSSH_CHECK_OMNIORB.m4 \ $(top_srcdir)/m4/RSSH_CHECK_PTHREADS.m4 \ $(top_srcdir)/m4/RSSH_CHECK_SUNPRO_CC.m4 \ $(top_srcdir)/m4/RSSH_ENABLE_PTHREADS.m4 \ $(top_srcdir)/m4/ac_cxx_have_class_strstream.m4 \ $(top_srcdir)/m4/ac_cxx_have_sstream.m4 \ $(top_srcdir)/m4/ac_cxx_namespaces.m4 \ $(top_srcdir)/m4/ac_path_mysqlclient.m4 \ $(top_srcdir)/m4/ac_prog_mysql.m4 \ $(top_srcdir)/m4/ax_cxx_compile_stdcxx_11.m4 \ $(top_srcdir)/m4/ax_jni_include_dir.m4 \ $(top_srcdir)/m4/check_zlib.m4 $(top_srcdir)/m4/gcc_release.m4 \ $(top_srcdir)/m4/java_release.m4 $(top_srcdir)/m4/libtool.m4 \ $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ $(top_srcdir)/m4/mysql_release.m4 $(top_srcdir)/configure.in am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/ac_config.h.tmp CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = SOURCES = DIST_SOURCES = 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)$(idldir)" HEADERS = $(idl_HEADERS) ETAGS = etags CTAGS = ctags DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ ALLOCA = @ALLOCA@ AMTAR = @AMTAR@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CORBA_INCLUDES = @CORBA_INCLUDES@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CPP_ELEVEN = @CPP_ELEVEN@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DATADIR = @DATADIR@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DOXYGEN = @DOXYGEN@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ GREP = @GREP@ HAVE_CXX11 = @HAVE_CXX11@ HAVE_ORB_IDL = @HAVE_ORB_IDL@ IDL = @IDL@ IDLCXX = @IDLCXX@ IDLCXXFLAGS = @IDLCXXFLAGS@ IDLFLAGS = @IDLFLAGS@ IDL_CLN_CPP = @IDL_CLN_CPP@ IDL_CLN_CPP_SUFFIX = @IDL_CLN_CPP_SUFFIX@ IDL_CLN_H = @IDL_CLN_H@ IDL_CLN_H1_SUFFIX = @IDL_CLN_H1_SUFFIX@ IDL_CLN_H_SUFFIX = @IDL_CLN_H_SUFFIX@ IDL_CLN_O = @IDL_CLN_O@ IDL_CLN_OBJ_SUFFIX = @IDL_CLN_OBJ_SUFFIX@ IDL_H1_SUFFIX = @IDL_H1_SUFFIX@ IDL_H_SUFFIX = @IDL_H_SUFFIX@ IDL_SRV_CPP = @IDL_SRV_CPP@ IDL_SRV_CPP_SUFFIX = @IDL_SRV_CPP_SUFFIX@ IDL_SRV_H = @IDL_SRV_H@ IDL_SRV_H1_SUFFIX = @IDL_SRV_H1_SUFFIX@ IDL_SRV_H_SUFFIX = @IDL_SRV_H_SUFFIX@ IDL_SRV_O = @IDL_SRV_O@ IDL_SRV_OBJ_SUFFIX = @IDL_SRV_OBJ_SUFFIX@ IDL_TIE_CPP_SUFFIX = @IDL_TIE_CPP_SUFFIX@ IDL_TIE_H1_SUFFIX = @IDL_TIE_H1_SUFFIX@ IDL_TIE_H_SUFFIX = @IDL_TIE_H_SUFFIX@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ JAVA = @JAVA@ JAVAC = @JAVAC@ JAVAH = @JAVAH@ JNI_INCL_DIRS = @JNI_INCL_DIRS@ JPEG_LIB_CXXFLAGS = @JPEG_LIB_CXXFLAGS@ JPEG_MMX_LIB_CXXFLAGS = @JPEG_MMX_LIB_CXXFLAGS@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIBZMQ_CFLAGS = @LIBZMQ_CFLAGS@ LIBZMQ_LIBS = @LIBZMQ_LIBS@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ LYX = @LYX@ MAINT = @MAINT@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ MYSQL = @MYSQL@ MYSQLCLIENT_CFLAGS = @MYSQLCLIENT_CFLAGS@ MYSQLCLIENT_LDFLAGS = @MYSQLCLIENT_LDFLAGS@ MYSQLCLIENT_LIBS = @MYSQLCLIENT_LIBS@ MYSQL_ADMIN = @MYSQL_ADMIN@ MYSQL_ADMIN_PASSWD = @MYSQL_ADMIN_PASSWD@ MYSQL_HOST = @MYSQL_HOST@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ ORB = @ORB@ ORB_COSNAMING_LIB = @ORB_COSNAMING_LIB@ ORB_INCLUDE_PREFIX = @ORB_INCLUDE_PREFIX@ ORB_PREFIX = @ORB_PREFIX@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ TANGO_DB_NAME = @TANGO_DB_NAME@ TANGO_RC_FILE = @TANGO_RC_FILE@ VERSION = @VERSION@ VERSION_INFO = @VERSION_INFO@ ZLIB_CPPFLAGS = @ZLIB_CPPFLAGS@ ZLIB_LDFLAGS = @ZLIB_LDFLAGS@ ZLIB_LIBS = @ZLIB_LIBS@ ZMQ_PREFIX = @ZMQ_PREFIX@ _ACJNI_JAVAC = @_ACJNI_JAVAC@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_aux_dir = @ac_aux_dir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ omniCOS4_CFLAGS = @omniCOS4_CFLAGS@ omniCOS4_LIBS = @omniCOS4_LIBS@ omniORB4_CFLAGS = @omniORB4_CFLAGS@ omniORB4_LIBS = @omniORB4_LIBS@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ subdirs = @subdirs@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ idldir = ${includedir}/tango/idl idl_HEADERS = tango.h all: all-am .SUFFIXES: $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu lib/cpp/server/idl/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu lib/cpp/server/idl/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs install-idlHEADERS: $(idl_HEADERS) @$(NORMAL_INSTALL) test -z "$(idldir)" || $(MKDIR_P) "$(DESTDIR)$(idldir)" @list='$(idl_HEADERS)'; test -n "$(idldir)" || list=; \ 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)$(idldir)'"; \ $(INSTALL_HEADER) $$files "$(DESTDIR)$(idldir)" || exit $$?; \ done uninstall-idlHEADERS: @$(NORMAL_UNINSTALL) @list='$(idl_HEADERS)'; test -n "$(idldir)" || list=; \ files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ dir='$(DESTDIR)$(idldir)'; $(am__uninstall_files_from_dir) ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ mkid -fID $$unique tags: TAGS TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) set x; \ here=`pwd`; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: CTAGS CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(HEADERS) installdirs: for dir in "$(DESTDIR)$(idldir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: 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: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-generic clean-libtool mostlyclean-am distclean: distclean-am -rm -f Makefile distclean-am: clean-am distclean-generic distclean-tags dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-idlHEADERS install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-generic mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-idlHEADERS .MAKE: install-am install-strip .PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \ clean-libtool ctags distclean 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-idlHEADERS 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-generic mostlyclean-libtool pdf pdf-am ps ps-am \ tags uninstall uninstall-am uninstall-idlHEADERS # 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: tango-8.1.2c+dfsg.orig/lib/cpp/server/idl/tango.h0000644000175000017500000061452012205375142020473 0ustar piccapicca// This file is generated by omniidl (C++ backend)- omniORB_4_1. Do not edit. // // Copyright (C) : 2004,2005,2006,2007,2008,2009,2010,2011,2012,2013 // European Synchrotron Radiation Facility // BP 220, Grenoble 38043 // FRANCE // // This file is part of Tango. // // Tango 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. // // Tango 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 Tango. If not, see . // #ifndef __tango_hh__ #define __tango_hh__ #ifndef __CORBA_H_EXTERNAL_GUARD__ #include #endif #ifndef USE_stub_in_nt_dll # define USE_stub_in_nt_dll_NOT_DEFINED_tango #endif #ifndef USE_core_stub_in_nt_dll # define USE_core_stub_in_nt_dll_NOT_DEFINED_tango #endif #ifndef USE_dyn_stub_in_nt_dll # define USE_dyn_stub_in_nt_dll_NOT_DEFINED_tango #endif #ifdef USE_stub_in_nt_dll # ifndef USE_core_stub_in_nt_dll # define USE_core_stub_in_nt_dll # endif # ifndef USE_dyn_stub_in_nt_dll # define USE_dyn_stub_in_nt_dll # endif #endif #ifdef _core_attr # error "A local CPP macro _core_attr has already been defined." #else # ifdef USE_core_stub_in_nt_dll # define _core_attr _OMNIORB_NTDLL_IMPORT # else # define _core_attr # endif #endif #ifdef _dyn_attr # error "A local CPP macro _dyn_attr has already been defined." #else # ifdef USE_dyn_stub_in_nt_dll # define _dyn_attr _OMNIORB_NTDLL_IMPORT # else # define _dyn_attr # endif #endif _CORBA_MODULE Tango _CORBA_MODULE_BEG _CORBA_MODULE_VAR _dyn_attr const ::CORBA::TypeCode_ptr _tc_DevBoolean; typedef ::CORBA::Boolean DevBoolean; typedef ::CORBA::Boolean_out DevBoolean_out; _CORBA_MODULE_VAR _dyn_attr const ::CORBA::TypeCode_ptr _tc_DevDouble; typedef ::CORBA::Double DevDouble; typedef ::CORBA::Double_out DevDouble_out; _CORBA_MODULE_VAR _dyn_attr const ::CORBA::TypeCode_ptr _tc_DevFloat; typedef ::CORBA::Float DevFloat; typedef ::CORBA::Float_out DevFloat_out; _CORBA_MODULE_VAR _dyn_attr const ::CORBA::TypeCode_ptr _tc_DevShort; typedef ::CORBA::Short DevShort; typedef ::CORBA::Short_out DevShort_out; _CORBA_MODULE_VAR _dyn_attr const ::CORBA::TypeCode_ptr _tc_DevLong; typedef ::CORBA::Long DevLong; typedef ::CORBA::Long_out DevLong_out; _CORBA_MODULE_VAR _dyn_attr const ::CORBA::TypeCode_ptr _tc_DevLong64; typedef ::CORBA::LongLong DevLong64; typedef ::CORBA::LongLong_out DevLong64_out; _CORBA_MODULE_VAR _dyn_attr const ::CORBA::TypeCode_ptr _tc_DevString; typedef char* DevString; typedef ::CORBA::String_var DevString_var; typedef ::CORBA::String_out DevString_out; _CORBA_MODULE_VAR _dyn_attr const ::CORBA::TypeCode_ptr _tc_DevUChar; typedef ::CORBA::Octet DevUChar; typedef ::CORBA::Octet_out DevUChar_out; _CORBA_MODULE_VAR _dyn_attr const ::CORBA::TypeCode_ptr _tc_DevUShort; typedef ::CORBA::UShort DevUShort; typedef ::CORBA::UShort_out DevUShort_out; _CORBA_MODULE_VAR _dyn_attr const ::CORBA::TypeCode_ptr _tc_DevULong; typedef ::CORBA::ULong DevULong; typedef ::CORBA::ULong_out DevULong_out; _CORBA_MODULE_VAR _dyn_attr const ::CORBA::TypeCode_ptr _tc_DevULong64; typedef ::CORBA::ULongLong DevULong64; typedef ::CORBA::ULongLong_out DevULong64_out; _CORBA_MODULE_VAR _dyn_attr const ::CORBA::TypeCode_ptr _tc_DevVarBooleanArray; class DevVarBooleanArray_var; class DevVarBooleanArray : public _CORBA_Unbounded_Sequence_Boolean { public: typedef DevVarBooleanArray_var _var_type; inline DevVarBooleanArray() {} inline DevVarBooleanArray(const DevVarBooleanArray& _s) : _CORBA_Unbounded_Sequence_Boolean(_s) {} inline DevVarBooleanArray(_CORBA_ULong _max) : _CORBA_Unbounded_Sequence_Boolean(_max) {} inline DevVarBooleanArray(_CORBA_ULong _max, _CORBA_ULong _len, ::CORBA::Boolean* _val, _CORBA_Boolean _rel=0) : _CORBA_Unbounded_Sequence_Boolean(_max, _len, _val, _rel) {} inline DevVarBooleanArray& operator = (const DevVarBooleanArray& _s) { _CORBA_Unbounded_Sequence_Boolean::operator=(_s); return *this; } }; class DevVarBooleanArray_out; class DevVarBooleanArray_var { public: inline DevVarBooleanArray_var() : _pd_seq(0) {} inline DevVarBooleanArray_var(DevVarBooleanArray* _s) : _pd_seq(_s) {} inline DevVarBooleanArray_var(const DevVarBooleanArray_var& _s) { if( _s._pd_seq ) _pd_seq = new DevVarBooleanArray(*_s._pd_seq); else _pd_seq = 0; } inline ~DevVarBooleanArray_var() { if( _pd_seq ) delete _pd_seq; } inline DevVarBooleanArray_var& operator = (DevVarBooleanArray* _s) { if( _pd_seq ) delete _pd_seq; _pd_seq = _s; return *this; } inline DevVarBooleanArray_var& operator = (const DevVarBooleanArray_var& _s) { if( _s._pd_seq ) { if( !_pd_seq ) _pd_seq = new DevVarBooleanArray; *_pd_seq = *_s._pd_seq; } else if( _pd_seq ) { delete _pd_seq; _pd_seq = 0; } return *this; } inline ::CORBA::Boolean& operator [] (_CORBA_ULong _s) { return (*_pd_seq)[_s]; } inline DevVarBooleanArray* operator -> () { return _pd_seq; } inline const DevVarBooleanArray* operator -> () const { return _pd_seq; } #if defined(__GNUG__) inline operator DevVarBooleanArray& () const { return *_pd_seq; } #else inline operator const DevVarBooleanArray& () const { return *_pd_seq; } inline operator DevVarBooleanArray& () { return *_pd_seq; } #endif inline const DevVarBooleanArray& in() const { return *_pd_seq; } inline DevVarBooleanArray& inout() { return *_pd_seq; } inline DevVarBooleanArray*& out() { if( _pd_seq ) { delete _pd_seq; _pd_seq = 0; } return _pd_seq; } inline DevVarBooleanArray* _retn() { DevVarBooleanArray* tmp = _pd_seq; _pd_seq = 0; return tmp; } friend class DevVarBooleanArray_out; private: DevVarBooleanArray* _pd_seq; }; class DevVarBooleanArray_out { public: inline DevVarBooleanArray_out(DevVarBooleanArray*& _s) : _data(_s) { _data = 0; } inline DevVarBooleanArray_out(DevVarBooleanArray_var& _s) : _data(_s._pd_seq) { _s = (DevVarBooleanArray*) 0; } inline DevVarBooleanArray_out(const DevVarBooleanArray_out& _s) : _data(_s._data) {} inline DevVarBooleanArray_out& operator = (const DevVarBooleanArray_out& _s) { _data = _s._data; return *this; } inline DevVarBooleanArray_out& operator = (DevVarBooleanArray* _s) { _data = _s; return *this; } inline operator DevVarBooleanArray*&() { return _data; } inline DevVarBooleanArray*& ptr() { return _data; } inline DevVarBooleanArray* operator->() { return _data; } inline ::CORBA::Boolean& operator [] (_CORBA_ULong _i) { return (*_data)[_i]; } DevVarBooleanArray*& _data; private: DevVarBooleanArray_out(); DevVarBooleanArray_out& operator=(const DevVarBooleanArray_var&); }; _CORBA_MODULE_VAR _dyn_attr const ::CORBA::TypeCode_ptr _tc_DevVarDoubleArray; class DevVarDoubleArray_var; class DevVarDoubleArray : public _CORBA_Unbounded_Sequence_w_FixSizeElement< ::CORBA::Double, 8, 8 > { public: typedef DevVarDoubleArray_var _var_type; inline DevVarDoubleArray() {} inline DevVarDoubleArray(const DevVarDoubleArray& _s) : _CORBA_Unbounded_Sequence_w_FixSizeElement< ::CORBA::Double, 8, 8 > (_s) {} inline DevVarDoubleArray(_CORBA_ULong _max) : _CORBA_Unbounded_Sequence_w_FixSizeElement< ::CORBA::Double, 8, 8 > (_max) {} inline DevVarDoubleArray(_CORBA_ULong _max, _CORBA_ULong _len, ::CORBA::Double* _val, _CORBA_Boolean _rel=0) : _CORBA_Unbounded_Sequence_w_FixSizeElement< ::CORBA::Double, 8, 8 > (_max, _len, _val, _rel) {} inline DevVarDoubleArray& operator = (const DevVarDoubleArray& _s) { _CORBA_Unbounded_Sequence_w_FixSizeElement< ::CORBA::Double, 8, 8 > ::operator=(_s); return *this; } }; class DevVarDoubleArray_out; class DevVarDoubleArray_var { public: inline DevVarDoubleArray_var() : _pd_seq(0) {} inline DevVarDoubleArray_var(DevVarDoubleArray* _s) : _pd_seq(_s) {} inline DevVarDoubleArray_var(const DevVarDoubleArray_var& _s) { if( _s._pd_seq ) _pd_seq = new DevVarDoubleArray(*_s._pd_seq); else _pd_seq = 0; } inline ~DevVarDoubleArray_var() { if( _pd_seq ) delete _pd_seq; } inline DevVarDoubleArray_var& operator = (DevVarDoubleArray* _s) { if( _pd_seq ) delete _pd_seq; _pd_seq = _s; return *this; } inline DevVarDoubleArray_var& operator = (const DevVarDoubleArray_var& _s) { if( _s._pd_seq ) { if( !_pd_seq ) _pd_seq = new DevVarDoubleArray; *_pd_seq = *_s._pd_seq; } else if( _pd_seq ) { delete _pd_seq; _pd_seq = 0; } return *this; } inline ::CORBA::Double& operator [] (_CORBA_ULong _s) { return (*_pd_seq)[_s]; } inline DevVarDoubleArray* operator -> () { return _pd_seq; } inline const DevVarDoubleArray* operator -> () const { return _pd_seq; } #if defined(__GNUG__) inline operator DevVarDoubleArray& () const { return *_pd_seq; } #else inline operator const DevVarDoubleArray& () const { return *_pd_seq; } inline operator DevVarDoubleArray& () { return *_pd_seq; } #endif inline const DevVarDoubleArray& in() const { return *_pd_seq; } inline DevVarDoubleArray& inout() { return *_pd_seq; } inline DevVarDoubleArray*& out() { if( _pd_seq ) { delete _pd_seq; _pd_seq = 0; } return _pd_seq; } inline DevVarDoubleArray* _retn() { DevVarDoubleArray* tmp = _pd_seq; _pd_seq = 0; return tmp; } friend class DevVarDoubleArray_out; private: DevVarDoubleArray* _pd_seq; }; class DevVarDoubleArray_out { public: inline DevVarDoubleArray_out(DevVarDoubleArray*& _s) : _data(_s) { _data = 0; } inline DevVarDoubleArray_out(DevVarDoubleArray_var& _s) : _data(_s._pd_seq) { _s = (DevVarDoubleArray*) 0; } inline DevVarDoubleArray_out(const DevVarDoubleArray_out& _s) : _data(_s._data) {} inline DevVarDoubleArray_out& operator = (const DevVarDoubleArray_out& _s) { _data = _s._data; return *this; } inline DevVarDoubleArray_out& operator = (DevVarDoubleArray* _s) { _data = _s; return *this; } inline operator DevVarDoubleArray*&() { return _data; } inline DevVarDoubleArray*& ptr() { return _data; } inline DevVarDoubleArray* operator->() { return _data; } inline ::CORBA::Double& operator [] (_CORBA_ULong _i) { return (*_data)[_i]; } DevVarDoubleArray*& _data; private: DevVarDoubleArray_out(); DevVarDoubleArray_out& operator=(const DevVarDoubleArray_var&); }; _CORBA_MODULE_VAR _dyn_attr const ::CORBA::TypeCode_ptr _tc_DevVarFloatArray; class DevVarFloatArray_var; class DevVarFloatArray : public _CORBA_Unbounded_Sequence_w_FixSizeElement< ::CORBA::Float, 4, 4 > { public: typedef DevVarFloatArray_var _var_type; inline DevVarFloatArray() {} inline DevVarFloatArray(const DevVarFloatArray& _s) : _CORBA_Unbounded_Sequence_w_FixSizeElement< ::CORBA::Float, 4, 4 > (_s) {} inline DevVarFloatArray(_CORBA_ULong _max) : _CORBA_Unbounded_Sequence_w_FixSizeElement< ::CORBA::Float, 4, 4 > (_max) {} inline DevVarFloatArray(_CORBA_ULong _max, _CORBA_ULong _len, ::CORBA::Float* _val, _CORBA_Boolean _rel=0) : _CORBA_Unbounded_Sequence_w_FixSizeElement< ::CORBA::Float, 4, 4 > (_max, _len, _val, _rel) {} inline DevVarFloatArray& operator = (const DevVarFloatArray& _s) { _CORBA_Unbounded_Sequence_w_FixSizeElement< ::CORBA::Float, 4, 4 > ::operator=(_s); return *this; } }; class DevVarFloatArray_out; class DevVarFloatArray_var { public: inline DevVarFloatArray_var() : _pd_seq(0) {} inline DevVarFloatArray_var(DevVarFloatArray* _s) : _pd_seq(_s) {} inline DevVarFloatArray_var(const DevVarFloatArray_var& _s) { if( _s._pd_seq ) _pd_seq = new DevVarFloatArray(*_s._pd_seq); else _pd_seq = 0; } inline ~DevVarFloatArray_var() { if( _pd_seq ) delete _pd_seq; } inline DevVarFloatArray_var& operator = (DevVarFloatArray* _s) { if( _pd_seq ) delete _pd_seq; _pd_seq = _s; return *this; } inline DevVarFloatArray_var& operator = (const DevVarFloatArray_var& _s) { if( _s._pd_seq ) { if( !_pd_seq ) _pd_seq = new DevVarFloatArray; *_pd_seq = *_s._pd_seq; } else if( _pd_seq ) { delete _pd_seq; _pd_seq = 0; } return *this; } inline ::CORBA::Float& operator [] (_CORBA_ULong _s) { return (*_pd_seq)[_s]; } inline DevVarFloatArray* operator -> () { return _pd_seq; } inline const DevVarFloatArray* operator -> () const { return _pd_seq; } #if defined(__GNUG__) inline operator DevVarFloatArray& () const { return *_pd_seq; } #else inline operator const DevVarFloatArray& () const { return *_pd_seq; } inline operator DevVarFloatArray& () { return *_pd_seq; } #endif inline const DevVarFloatArray& in() const { return *_pd_seq; } inline DevVarFloatArray& inout() { return *_pd_seq; } inline DevVarFloatArray*& out() { if( _pd_seq ) { delete _pd_seq; _pd_seq = 0; } return _pd_seq; } inline DevVarFloatArray* _retn() { DevVarFloatArray* tmp = _pd_seq; _pd_seq = 0; return tmp; } friend class DevVarFloatArray_out; private: DevVarFloatArray* _pd_seq; }; class DevVarFloatArray_out { public: inline DevVarFloatArray_out(DevVarFloatArray*& _s) : _data(_s) { _data = 0; } inline DevVarFloatArray_out(DevVarFloatArray_var& _s) : _data(_s._pd_seq) { _s = (DevVarFloatArray*) 0; } inline DevVarFloatArray_out(const DevVarFloatArray_out& _s) : _data(_s._data) {} inline DevVarFloatArray_out& operator = (const DevVarFloatArray_out& _s) { _data = _s._data; return *this; } inline DevVarFloatArray_out& operator = (DevVarFloatArray* _s) { _data = _s; return *this; } inline operator DevVarFloatArray*&() { return _data; } inline DevVarFloatArray*& ptr() { return _data; } inline DevVarFloatArray* operator->() { return _data; } inline ::CORBA::Float& operator [] (_CORBA_ULong _i) { return (*_data)[_i]; } DevVarFloatArray*& _data; private: DevVarFloatArray_out(); DevVarFloatArray_out& operator=(const DevVarFloatArray_var&); }; _CORBA_MODULE_VAR _dyn_attr const ::CORBA::TypeCode_ptr _tc_DevVarShortArray; class DevVarShortArray_var; class DevVarShortArray : public _CORBA_Unbounded_Sequence_w_FixSizeElement< ::CORBA::Short, 2, 2 > { public: typedef DevVarShortArray_var _var_type; inline DevVarShortArray() {} inline DevVarShortArray(const DevVarShortArray& _s) : _CORBA_Unbounded_Sequence_w_FixSizeElement< ::CORBA::Short, 2, 2 > (_s) {} inline DevVarShortArray(_CORBA_ULong _max) : _CORBA_Unbounded_Sequence_w_FixSizeElement< ::CORBA::Short, 2, 2 > (_max) {} inline DevVarShortArray(_CORBA_ULong _max, _CORBA_ULong _len, ::CORBA::Short* _val, _CORBA_Boolean _rel=0) : _CORBA_Unbounded_Sequence_w_FixSizeElement< ::CORBA::Short, 2, 2 > (_max, _len, _val, _rel) {} inline DevVarShortArray& operator = (const DevVarShortArray& _s) { _CORBA_Unbounded_Sequence_w_FixSizeElement< ::CORBA::Short, 2, 2 > ::operator=(_s); return *this; } }; class DevVarShortArray_out; class DevVarShortArray_var { public: inline DevVarShortArray_var() : _pd_seq(0) {} inline DevVarShortArray_var(DevVarShortArray* _s) : _pd_seq(_s) {} inline DevVarShortArray_var(const DevVarShortArray_var& _s) { if( _s._pd_seq ) _pd_seq = new DevVarShortArray(*_s._pd_seq); else _pd_seq = 0; } inline ~DevVarShortArray_var() { if( _pd_seq ) delete _pd_seq; } inline DevVarShortArray_var& operator = (DevVarShortArray* _s) { if( _pd_seq ) delete _pd_seq; _pd_seq = _s; return *this; } inline DevVarShortArray_var& operator = (const DevVarShortArray_var& _s) { if( _s._pd_seq ) { if( !_pd_seq ) _pd_seq = new DevVarShortArray; *_pd_seq = *_s._pd_seq; } else if( _pd_seq ) { delete _pd_seq; _pd_seq = 0; } return *this; } inline ::CORBA::Short& operator [] (_CORBA_ULong _s) { return (*_pd_seq)[_s]; } inline DevVarShortArray* operator -> () { return _pd_seq; } inline const DevVarShortArray* operator -> () const { return _pd_seq; } #if defined(__GNUG__) inline operator DevVarShortArray& () const { return *_pd_seq; } #else inline operator const DevVarShortArray& () const { return *_pd_seq; } inline operator DevVarShortArray& () { return *_pd_seq; } #endif inline const DevVarShortArray& in() const { return *_pd_seq; } inline DevVarShortArray& inout() { return *_pd_seq; } inline DevVarShortArray*& out() { if( _pd_seq ) { delete _pd_seq; _pd_seq = 0; } return _pd_seq; } inline DevVarShortArray* _retn() { DevVarShortArray* tmp = _pd_seq; _pd_seq = 0; return tmp; } friend class DevVarShortArray_out; private: DevVarShortArray* _pd_seq; }; class DevVarShortArray_out { public: inline DevVarShortArray_out(DevVarShortArray*& _s) : _data(_s) { _data = 0; } inline DevVarShortArray_out(DevVarShortArray_var& _s) : _data(_s._pd_seq) { _s = (DevVarShortArray*) 0; } inline DevVarShortArray_out(const DevVarShortArray_out& _s) : _data(_s._data) {} inline DevVarShortArray_out& operator = (const DevVarShortArray_out& _s) { _data = _s._data; return *this; } inline DevVarShortArray_out& operator = (DevVarShortArray* _s) { _data = _s; return *this; } inline operator DevVarShortArray*&() { return _data; } inline DevVarShortArray*& ptr() { return _data; } inline DevVarShortArray* operator->() { return _data; } inline ::CORBA::Short& operator [] (_CORBA_ULong _i) { return (*_data)[_i]; } DevVarShortArray*& _data; private: DevVarShortArray_out(); DevVarShortArray_out& operator=(const DevVarShortArray_var&); }; _CORBA_MODULE_VAR _dyn_attr const ::CORBA::TypeCode_ptr _tc_DevVarLongArray; class DevVarLongArray_var; class DevVarLongArray : public _CORBA_Unbounded_Sequence_w_FixSizeElement< ::CORBA::Long, 4, 4 > { public: typedef DevVarLongArray_var _var_type; inline DevVarLongArray() {} inline DevVarLongArray(const DevVarLongArray& _s) : _CORBA_Unbounded_Sequence_w_FixSizeElement< ::CORBA::Long, 4, 4 > (_s) {} inline DevVarLongArray(_CORBA_ULong _max) : _CORBA_Unbounded_Sequence_w_FixSizeElement< ::CORBA::Long, 4, 4 > (_max) {} inline DevVarLongArray(_CORBA_ULong _max, _CORBA_ULong _len, ::CORBA::Long* _val, _CORBA_Boolean _rel=0) : _CORBA_Unbounded_Sequence_w_FixSizeElement< ::CORBA::Long, 4, 4 > (_max, _len, _val, _rel) {} inline DevVarLongArray& operator = (const DevVarLongArray& _s) { _CORBA_Unbounded_Sequence_w_FixSizeElement< ::CORBA::Long, 4, 4 > ::operator=(_s); return *this; } }; class DevVarLongArray_out; class DevVarLongArray_var { public: inline DevVarLongArray_var() : _pd_seq(0) {} inline DevVarLongArray_var(DevVarLongArray* _s) : _pd_seq(_s) {} inline DevVarLongArray_var(const DevVarLongArray_var& _s) { if( _s._pd_seq ) _pd_seq = new DevVarLongArray(*_s._pd_seq); else _pd_seq = 0; } inline ~DevVarLongArray_var() { if( _pd_seq ) delete _pd_seq; } inline DevVarLongArray_var& operator = (DevVarLongArray* _s) { if( _pd_seq ) delete _pd_seq; _pd_seq = _s; return *this; } inline DevVarLongArray_var& operator = (const DevVarLongArray_var& _s) { if( _s._pd_seq ) { if( !_pd_seq ) _pd_seq = new DevVarLongArray; *_pd_seq = *_s._pd_seq; } else if( _pd_seq ) { delete _pd_seq; _pd_seq = 0; } return *this; } inline ::CORBA::Long& operator [] (_CORBA_ULong _s) { return (*_pd_seq)[_s]; } inline DevVarLongArray* operator -> () { return _pd_seq; } inline const DevVarLongArray* operator -> () const { return _pd_seq; } #if defined(__GNUG__) inline operator DevVarLongArray& () const { return *_pd_seq; } #else inline operator const DevVarLongArray& () const { return *_pd_seq; } inline operator DevVarLongArray& () { return *_pd_seq; } #endif inline const DevVarLongArray& in() const { return *_pd_seq; } inline DevVarLongArray& inout() { return *_pd_seq; } inline DevVarLongArray*& out() { if( _pd_seq ) { delete _pd_seq; _pd_seq = 0; } return _pd_seq; } inline DevVarLongArray* _retn() { DevVarLongArray* tmp = _pd_seq; _pd_seq = 0; return tmp; } friend class DevVarLongArray_out; private: DevVarLongArray* _pd_seq; }; class DevVarLongArray_out { public: inline DevVarLongArray_out(DevVarLongArray*& _s) : _data(_s) { _data = 0; } inline DevVarLongArray_out(DevVarLongArray_var& _s) : _data(_s._pd_seq) { _s = (DevVarLongArray*) 0; } inline DevVarLongArray_out(const DevVarLongArray_out& _s) : _data(_s._data) {} inline DevVarLongArray_out& operator = (const DevVarLongArray_out& _s) { _data = _s._data; return *this; } inline DevVarLongArray_out& operator = (DevVarLongArray* _s) { _data = _s; return *this; } inline operator DevVarLongArray*&() { return _data; } inline DevVarLongArray*& ptr() { return _data; } inline DevVarLongArray* operator->() { return _data; } inline ::CORBA::Long& operator [] (_CORBA_ULong _i) { return (*_data)[_i]; } DevVarLongArray*& _data; private: DevVarLongArray_out(); DevVarLongArray_out& operator=(const DevVarLongArray_var&); }; _CORBA_MODULE_VAR _dyn_attr const ::CORBA::TypeCode_ptr _tc_DevVarLong64Array; class DevVarLong64Array_var; class DevVarLong64Array : public _CORBA_Unbounded_Sequence_w_FixSizeElement< ::CORBA::LongLong, 8, 8 > { public: typedef DevVarLong64Array_var _var_type; inline DevVarLong64Array() {} inline DevVarLong64Array(const DevVarLong64Array& _s) : _CORBA_Unbounded_Sequence_w_FixSizeElement< ::CORBA::LongLong, 8, 8 > (_s) {} inline DevVarLong64Array(_CORBA_ULong _max) : _CORBA_Unbounded_Sequence_w_FixSizeElement< ::CORBA::LongLong, 8, 8 > (_max) {} inline DevVarLong64Array(_CORBA_ULong _max, _CORBA_ULong _len, ::CORBA::LongLong* _val, _CORBA_Boolean _rel=0) : _CORBA_Unbounded_Sequence_w_FixSizeElement< ::CORBA::LongLong, 8, 8 > (_max, _len, _val, _rel) {} inline DevVarLong64Array& operator = (const DevVarLong64Array& _s) { _CORBA_Unbounded_Sequence_w_FixSizeElement< ::CORBA::LongLong, 8, 8 > ::operator=(_s); return *this; } }; class DevVarLong64Array_out; class DevVarLong64Array_var { public: inline DevVarLong64Array_var() : _pd_seq(0) {} inline DevVarLong64Array_var(DevVarLong64Array* _s) : _pd_seq(_s) {} inline DevVarLong64Array_var(const DevVarLong64Array_var& _s) { if( _s._pd_seq ) _pd_seq = new DevVarLong64Array(*_s._pd_seq); else _pd_seq = 0; } inline ~DevVarLong64Array_var() { if( _pd_seq ) delete _pd_seq; } inline DevVarLong64Array_var& operator = (DevVarLong64Array* _s) { if( _pd_seq ) delete _pd_seq; _pd_seq = _s; return *this; } inline DevVarLong64Array_var& operator = (const DevVarLong64Array_var& _s) { if( _s._pd_seq ) { if( !_pd_seq ) _pd_seq = new DevVarLong64Array; *_pd_seq = *_s._pd_seq; } else if( _pd_seq ) { delete _pd_seq; _pd_seq = 0; } return *this; } inline ::CORBA::LongLong& operator [] (_CORBA_ULong _s) { return (*_pd_seq)[_s]; } inline DevVarLong64Array* operator -> () { return _pd_seq; } inline const DevVarLong64Array* operator -> () const { return _pd_seq; } #if defined(__GNUG__) inline operator DevVarLong64Array& () const { return *_pd_seq; } #else inline operator const DevVarLong64Array& () const { return *_pd_seq; } inline operator DevVarLong64Array& () { return *_pd_seq; } #endif inline const DevVarLong64Array& in() const { return *_pd_seq; } inline DevVarLong64Array& inout() { return *_pd_seq; } inline DevVarLong64Array*& out() { if( _pd_seq ) { delete _pd_seq; _pd_seq = 0; } return _pd_seq; } inline DevVarLong64Array* _retn() { DevVarLong64Array* tmp = _pd_seq; _pd_seq = 0; return tmp; } friend class DevVarLong64Array_out; private: DevVarLong64Array* _pd_seq; }; class DevVarLong64Array_out { public: inline DevVarLong64Array_out(DevVarLong64Array*& _s) : _data(_s) { _data = 0; } inline DevVarLong64Array_out(DevVarLong64Array_var& _s) : _data(_s._pd_seq) { _s = (DevVarLong64Array*) 0; } inline DevVarLong64Array_out(const DevVarLong64Array_out& _s) : _data(_s._data) {} inline DevVarLong64Array_out& operator = (const DevVarLong64Array_out& _s) { _data = _s._data; return *this; } inline DevVarLong64Array_out& operator = (DevVarLong64Array* _s) { _data = _s; return *this; } inline operator DevVarLong64Array*&() { return _data; } inline DevVarLong64Array*& ptr() { return _data; } inline DevVarLong64Array* operator->() { return _data; } inline ::CORBA::LongLong& operator [] (_CORBA_ULong _i) { return (*_data)[_i]; } DevVarLong64Array*& _data; private: DevVarLong64Array_out(); DevVarLong64Array_out& operator=(const DevVarLong64Array_var&); }; _CORBA_MODULE_VAR _dyn_attr const ::CORBA::TypeCode_ptr _tc_DevVarCharArray; class DevVarCharArray_var; class DevVarCharArray : public _CORBA_Unbounded_Sequence_Octet { public: typedef DevVarCharArray_var _var_type; inline DevVarCharArray() {} inline DevVarCharArray(const DevVarCharArray& _s) : _CORBA_Unbounded_Sequence_Octet(_s) {} inline DevVarCharArray(_CORBA_ULong _max) : _CORBA_Unbounded_Sequence_Octet(_max) {} inline DevVarCharArray(_CORBA_ULong _max, _CORBA_ULong _len, ::CORBA::Octet* _val, _CORBA_Boolean _rel=0) : _CORBA_Unbounded_Sequence_Octet(_max, _len, _val, _rel) {} inline DevVarCharArray& operator = (const DevVarCharArray& _s) { _CORBA_Unbounded_Sequence_Octet::operator=(_s); return *this; } }; class DevVarCharArray_out; class DevVarCharArray_var { public: inline DevVarCharArray_var() : _pd_seq(0) {} inline DevVarCharArray_var(DevVarCharArray* _s) : _pd_seq(_s) {} inline DevVarCharArray_var(const DevVarCharArray_var& _s) { if( _s._pd_seq ) _pd_seq = new DevVarCharArray(*_s._pd_seq); else _pd_seq = 0; } inline ~DevVarCharArray_var() { if( _pd_seq ) delete _pd_seq; } inline DevVarCharArray_var& operator = (DevVarCharArray* _s) { if( _pd_seq ) delete _pd_seq; _pd_seq = _s; return *this; } inline DevVarCharArray_var& operator = (const DevVarCharArray_var& _s) { if( _s._pd_seq ) { if( !_pd_seq ) _pd_seq = new DevVarCharArray; *_pd_seq = *_s._pd_seq; } else if( _pd_seq ) { delete _pd_seq; _pd_seq = 0; } return *this; } inline ::CORBA::Octet& operator [] (_CORBA_ULong _s) { return (*_pd_seq)[_s]; } inline DevVarCharArray* operator -> () { return _pd_seq; } inline const DevVarCharArray* operator -> () const { return _pd_seq; } #if defined(__GNUG__) inline operator DevVarCharArray& () const { return *_pd_seq; } #else inline operator const DevVarCharArray& () const { return *_pd_seq; } inline operator DevVarCharArray& () { return *_pd_seq; } #endif inline const DevVarCharArray& in() const { return *_pd_seq; } inline DevVarCharArray& inout() { return *_pd_seq; } inline DevVarCharArray*& out() { if( _pd_seq ) { delete _pd_seq; _pd_seq = 0; } return _pd_seq; } inline DevVarCharArray* _retn() { DevVarCharArray* tmp = _pd_seq; _pd_seq = 0; return tmp; } friend class DevVarCharArray_out; private: DevVarCharArray* _pd_seq; }; class DevVarCharArray_out { public: inline DevVarCharArray_out(DevVarCharArray*& _s) : _data(_s) { _data = 0; } inline DevVarCharArray_out(DevVarCharArray_var& _s) : _data(_s._pd_seq) { _s = (DevVarCharArray*) 0; } inline DevVarCharArray_out(const DevVarCharArray_out& _s) : _data(_s._data) {} inline DevVarCharArray_out& operator = (const DevVarCharArray_out& _s) { _data = _s._data; return *this; } inline DevVarCharArray_out& operator = (DevVarCharArray* _s) { _data = _s; return *this; } inline operator DevVarCharArray*&() { return _data; } inline DevVarCharArray*& ptr() { return _data; } inline DevVarCharArray* operator->() { return _data; } inline ::CORBA::Octet& operator [] (_CORBA_ULong _i) { return (*_data)[_i]; } DevVarCharArray*& _data; private: DevVarCharArray_out(); DevVarCharArray_out& operator=(const DevVarCharArray_var&); }; _CORBA_MODULE_VAR _dyn_attr const ::CORBA::TypeCode_ptr _tc_DevVarStringArray; class DevVarStringArray_var; class DevVarStringArray : public _CORBA_Unbounded_Sequence_String { public: typedef DevVarStringArray_var _var_type; inline DevVarStringArray() {} inline DevVarStringArray(const DevVarStringArray& _s) : _CORBA_Unbounded_Sequence_String(_s) {} inline DevVarStringArray(_CORBA_ULong _max) : _CORBA_Unbounded_Sequence_String(_max) {} inline DevVarStringArray(_CORBA_ULong _max, _CORBA_ULong _len, char** _val, _CORBA_Boolean _rel=0) : _CORBA_Unbounded_Sequence_String(_max, _len, _val, _rel) {} inline DevVarStringArray& operator = (const DevVarStringArray& _s) { _CORBA_Unbounded_Sequence_String::operator=(_s); return *this; } }; class DevVarStringArray_out; class DevVarStringArray_var { public: inline DevVarStringArray_var() : _pd_seq(0) {} inline DevVarStringArray_var(DevVarStringArray* _s) : _pd_seq(_s) {} inline DevVarStringArray_var(const DevVarStringArray_var& _s) { if( _s._pd_seq ) _pd_seq = new DevVarStringArray(*_s._pd_seq); else _pd_seq = 0; } inline ~DevVarStringArray_var() { if( _pd_seq ) delete _pd_seq; } inline DevVarStringArray_var& operator = (DevVarStringArray* _s) { if( _pd_seq ) delete _pd_seq; _pd_seq = _s; return *this; } inline DevVarStringArray_var& operator = (const DevVarStringArray_var& _s) { if( _s._pd_seq ) { if( !_pd_seq ) _pd_seq = new DevVarStringArray; *_pd_seq = *_s._pd_seq; } else if( _pd_seq ) { delete _pd_seq; _pd_seq = 0; } return *this; } inline _CORBA_String_element operator [] (_CORBA_ULong _s) { return (*_pd_seq)[_s]; } inline DevVarStringArray* operator -> () { return _pd_seq; } inline const DevVarStringArray* operator -> () const { return _pd_seq; } #if defined(__GNUG__) inline operator DevVarStringArray& () const { return *_pd_seq; } #else inline operator const DevVarStringArray& () const { return *_pd_seq; } inline operator DevVarStringArray& () { return *_pd_seq; } #endif inline const DevVarStringArray& in() const { return *_pd_seq; } inline DevVarStringArray& inout() { return *_pd_seq; } inline DevVarStringArray*& out() { if( _pd_seq ) { delete _pd_seq; _pd_seq = 0; } return _pd_seq; } inline DevVarStringArray* _retn() { DevVarStringArray* tmp = _pd_seq; _pd_seq = 0; return tmp; } friend class DevVarStringArray_out; private: DevVarStringArray* _pd_seq; }; class DevVarStringArray_out { public: inline DevVarStringArray_out(DevVarStringArray*& _s) : _data(_s) { _data = 0; } inline DevVarStringArray_out(DevVarStringArray_var& _s) : _data(_s._pd_seq) { _s = (DevVarStringArray*) 0; } inline DevVarStringArray_out(const DevVarStringArray_out& _s) : _data(_s._data) {} inline DevVarStringArray_out& operator = (const DevVarStringArray_out& _s) { _data = _s._data; return *this; } inline DevVarStringArray_out& operator = (DevVarStringArray* _s) { _data = _s; return *this; } inline operator DevVarStringArray*&() { return _data; } inline DevVarStringArray*& ptr() { return _data; } inline DevVarStringArray* operator->() { return _data; } inline _CORBA_String_element operator [] (_CORBA_ULong _i) { return (*_data)[_i]; } DevVarStringArray*& _data; private: DevVarStringArray_out(); DevVarStringArray_out& operator=(const DevVarStringArray_var&); }; _CORBA_MODULE_VAR _dyn_attr const ::CORBA::TypeCode_ptr _tc_DevVarUShortArray; class DevVarUShortArray_var; class DevVarUShortArray : public _CORBA_Unbounded_Sequence_w_FixSizeElement< ::CORBA::UShort, 2, 2 > { public: typedef DevVarUShortArray_var _var_type; inline DevVarUShortArray() {} inline DevVarUShortArray(const DevVarUShortArray& _s) : _CORBA_Unbounded_Sequence_w_FixSizeElement< ::CORBA::UShort, 2, 2 > (_s) {} inline DevVarUShortArray(_CORBA_ULong _max) : _CORBA_Unbounded_Sequence_w_FixSizeElement< ::CORBA::UShort, 2, 2 > (_max) {} inline DevVarUShortArray(_CORBA_ULong _max, _CORBA_ULong _len, ::CORBA::UShort* _val, _CORBA_Boolean _rel=0) : _CORBA_Unbounded_Sequence_w_FixSizeElement< ::CORBA::UShort, 2, 2 > (_max, _len, _val, _rel) {} inline DevVarUShortArray& operator = (const DevVarUShortArray& _s) { _CORBA_Unbounded_Sequence_w_FixSizeElement< ::CORBA::UShort, 2, 2 > ::operator=(_s); return *this; } }; class DevVarUShortArray_out; class DevVarUShortArray_var { public: inline DevVarUShortArray_var() : _pd_seq(0) {} inline DevVarUShortArray_var(DevVarUShortArray* _s) : _pd_seq(_s) {} inline DevVarUShortArray_var(const DevVarUShortArray_var& _s) { if( _s._pd_seq ) _pd_seq = new DevVarUShortArray(*_s._pd_seq); else _pd_seq = 0; } inline ~DevVarUShortArray_var() { if( _pd_seq ) delete _pd_seq; } inline DevVarUShortArray_var& operator = (DevVarUShortArray* _s) { if( _pd_seq ) delete _pd_seq; _pd_seq = _s; return *this; } inline DevVarUShortArray_var& operator = (const DevVarUShortArray_var& _s) { if( _s._pd_seq ) { if( !_pd_seq ) _pd_seq = new DevVarUShortArray; *_pd_seq = *_s._pd_seq; } else if( _pd_seq ) { delete _pd_seq; _pd_seq = 0; } return *this; } inline ::CORBA::UShort& operator [] (_CORBA_ULong _s) { return (*_pd_seq)[_s]; } inline DevVarUShortArray* operator -> () { return _pd_seq; } inline const DevVarUShortArray* operator -> () const { return _pd_seq; } #if defined(__GNUG__) inline operator DevVarUShortArray& () const { return *_pd_seq; } #else inline operator const DevVarUShortArray& () const { return *_pd_seq; } inline operator DevVarUShortArray& () { return *_pd_seq; } #endif inline const DevVarUShortArray& in() const { return *_pd_seq; } inline DevVarUShortArray& inout() { return *_pd_seq; } inline DevVarUShortArray*& out() { if( _pd_seq ) { delete _pd_seq; _pd_seq = 0; } return _pd_seq; } inline DevVarUShortArray* _retn() { DevVarUShortArray* tmp = _pd_seq; _pd_seq = 0; return tmp; } friend class DevVarUShortArray_out; private: DevVarUShortArray* _pd_seq; }; class DevVarUShortArray_out { public: inline DevVarUShortArray_out(DevVarUShortArray*& _s) : _data(_s) { _data = 0; } inline DevVarUShortArray_out(DevVarUShortArray_var& _s) : _data(_s._pd_seq) { _s = (DevVarUShortArray*) 0; } inline DevVarUShortArray_out(const DevVarUShortArray_out& _s) : _data(_s._data) {} inline DevVarUShortArray_out& operator = (const DevVarUShortArray_out& _s) { _data = _s._data; return *this; } inline DevVarUShortArray_out& operator = (DevVarUShortArray* _s) { _data = _s; return *this; } inline operator DevVarUShortArray*&() { return _data; } inline DevVarUShortArray*& ptr() { return _data; } inline DevVarUShortArray* operator->() { return _data; } inline ::CORBA::UShort& operator [] (_CORBA_ULong _i) { return (*_data)[_i]; } DevVarUShortArray*& _data; private: DevVarUShortArray_out(); DevVarUShortArray_out& operator=(const DevVarUShortArray_var&); }; _CORBA_MODULE_VAR _dyn_attr const ::CORBA::TypeCode_ptr _tc_DevVarULongArray; class DevVarULongArray_var; class DevVarULongArray : public _CORBA_Unbounded_Sequence_w_FixSizeElement< ::CORBA::ULong, 4, 4 > { public: typedef DevVarULongArray_var _var_type; inline DevVarULongArray() {} inline DevVarULongArray(const DevVarULongArray& _s) : _CORBA_Unbounded_Sequence_w_FixSizeElement< ::CORBA::ULong, 4, 4 > (_s) {} inline DevVarULongArray(_CORBA_ULong _max) : _CORBA_Unbounded_Sequence_w_FixSizeElement< ::CORBA::ULong, 4, 4 > (_max) {} inline DevVarULongArray(_CORBA_ULong _max, _CORBA_ULong _len, ::CORBA::ULong* _val, _CORBA_Boolean _rel=0) : _CORBA_Unbounded_Sequence_w_FixSizeElement< ::CORBA::ULong, 4, 4 > (_max, _len, _val, _rel) {} inline DevVarULongArray& operator = (const DevVarULongArray& _s) { _CORBA_Unbounded_Sequence_w_FixSizeElement< ::CORBA::ULong, 4, 4 > ::operator=(_s); return *this; } }; class DevVarULongArray_out; class DevVarULongArray_var { public: inline DevVarULongArray_var() : _pd_seq(0) {} inline DevVarULongArray_var(DevVarULongArray* _s) : _pd_seq(_s) {} inline DevVarULongArray_var(const DevVarULongArray_var& _s) { if( _s._pd_seq ) _pd_seq = new DevVarULongArray(*_s._pd_seq); else _pd_seq = 0; } inline ~DevVarULongArray_var() { if( _pd_seq ) delete _pd_seq; } inline DevVarULongArray_var& operator = (DevVarULongArray* _s) { if( _pd_seq ) delete _pd_seq; _pd_seq = _s; return *this; } inline DevVarULongArray_var& operator = (const DevVarULongArray_var& _s) { if( _s._pd_seq ) { if( !_pd_seq ) _pd_seq = new DevVarULongArray; *_pd_seq = *_s._pd_seq; } else if( _pd_seq ) { delete _pd_seq; _pd_seq = 0; } return *this; } inline ::CORBA::ULong& operator [] (_CORBA_ULong _s) { return (*_pd_seq)[_s]; } inline DevVarULongArray* operator -> () { return _pd_seq; } inline const DevVarULongArray* operator -> () const { return _pd_seq; } #if defined(__GNUG__) inline operator DevVarULongArray& () const { return *_pd_seq; } #else inline operator const DevVarULongArray& () const { return *_pd_seq; } inline operator DevVarULongArray& () { return *_pd_seq; } #endif inline const DevVarULongArray& in() const { return *_pd_seq; } inline DevVarULongArray& inout() { return *_pd_seq; } inline DevVarULongArray*& out() { if( _pd_seq ) { delete _pd_seq; _pd_seq = 0; } return _pd_seq; } inline DevVarULongArray* _retn() { DevVarULongArray* tmp = _pd_seq; _pd_seq = 0; return tmp; } friend class DevVarULongArray_out; private: DevVarULongArray* _pd_seq; }; class DevVarULongArray_out { public: inline DevVarULongArray_out(DevVarULongArray*& _s) : _data(_s) { _data = 0; } inline DevVarULongArray_out(DevVarULongArray_var& _s) : _data(_s._pd_seq) { _s = (DevVarULongArray*) 0; } inline DevVarULongArray_out(const DevVarULongArray_out& _s) : _data(_s._data) {} inline DevVarULongArray_out& operator = (const DevVarULongArray_out& _s) { _data = _s._data; return *this; } inline DevVarULongArray_out& operator = (DevVarULongArray* _s) { _data = _s; return *this; } inline operator DevVarULongArray*&() { return _data; } inline DevVarULongArray*& ptr() { return _data; } inline DevVarULongArray* operator->() { return _data; } inline ::CORBA::ULong& operator [] (_CORBA_ULong _i) { return (*_data)[_i]; } DevVarULongArray*& _data; private: DevVarULongArray_out(); DevVarULongArray_out& operator=(const DevVarULongArray_var&); }; _CORBA_MODULE_VAR _dyn_attr const ::CORBA::TypeCode_ptr _tc_DevVarULong64Array; class DevVarULong64Array_var; class DevVarULong64Array : public _CORBA_Unbounded_Sequence_w_FixSizeElement< ::CORBA::ULongLong, 8, 8 > { public: typedef DevVarULong64Array_var _var_type; inline DevVarULong64Array() {} inline DevVarULong64Array(const DevVarULong64Array& _s) : _CORBA_Unbounded_Sequence_w_FixSizeElement< ::CORBA::ULongLong, 8, 8 > (_s) {} inline DevVarULong64Array(_CORBA_ULong _max) : _CORBA_Unbounded_Sequence_w_FixSizeElement< ::CORBA::ULongLong, 8, 8 > (_max) {} inline DevVarULong64Array(_CORBA_ULong _max, _CORBA_ULong _len, ::CORBA::ULongLong* _val, _CORBA_Boolean _rel=0) : _CORBA_Unbounded_Sequence_w_FixSizeElement< ::CORBA::ULongLong, 8, 8 > (_max, _len, _val, _rel) {} inline DevVarULong64Array& operator = (const DevVarULong64Array& _s) { _CORBA_Unbounded_Sequence_w_FixSizeElement< ::CORBA::ULongLong, 8, 8 > ::operator=(_s); return *this; } }; class DevVarULong64Array_out; class DevVarULong64Array_var { public: inline DevVarULong64Array_var() : _pd_seq(0) {} inline DevVarULong64Array_var(DevVarULong64Array* _s) : _pd_seq(_s) {} inline DevVarULong64Array_var(const DevVarULong64Array_var& _s) { if( _s._pd_seq ) _pd_seq = new DevVarULong64Array(*_s._pd_seq); else _pd_seq = 0; } inline ~DevVarULong64Array_var() { if( _pd_seq ) delete _pd_seq; } inline DevVarULong64Array_var& operator = (DevVarULong64Array* _s) { if( _pd_seq ) delete _pd_seq; _pd_seq = _s; return *this; } inline DevVarULong64Array_var& operator = (const DevVarULong64Array_var& _s) { if( _s._pd_seq ) { if( !_pd_seq ) _pd_seq = new DevVarULong64Array; *_pd_seq = *_s._pd_seq; } else if( _pd_seq ) { delete _pd_seq; _pd_seq = 0; } return *this; } inline ::CORBA::ULongLong& operator [] (_CORBA_ULong _s) { return (*_pd_seq)[_s]; } inline DevVarULong64Array* operator -> () { return _pd_seq; } inline const DevVarULong64Array* operator -> () const { return _pd_seq; } #if defined(__GNUG__) inline operator DevVarULong64Array& () const { return *_pd_seq; } #else inline operator const DevVarULong64Array& () const { return *_pd_seq; } inline operator DevVarULong64Array& () { return *_pd_seq; } #endif inline const DevVarULong64Array& in() const { return *_pd_seq; } inline DevVarULong64Array& inout() { return *_pd_seq; } inline DevVarULong64Array*& out() { if( _pd_seq ) { delete _pd_seq; _pd_seq = 0; } return _pd_seq; } inline DevVarULong64Array* _retn() { DevVarULong64Array* tmp = _pd_seq; _pd_seq = 0; return tmp; } friend class DevVarULong64Array_out; private: DevVarULong64Array* _pd_seq; }; class DevVarULong64Array_out { public: inline DevVarULong64Array_out(DevVarULong64Array*& _s) : _data(_s) { _data = 0; } inline DevVarULong64Array_out(DevVarULong64Array_var& _s) : _data(_s._pd_seq) { _s = (DevVarULong64Array*) 0; } inline DevVarULong64Array_out(const DevVarULong64Array_out& _s) : _data(_s._data) {} inline DevVarULong64Array_out& operator = (const DevVarULong64Array_out& _s) { _data = _s._data; return *this; } inline DevVarULong64Array_out& operator = (DevVarULong64Array* _s) { _data = _s; return *this; } inline operator DevVarULong64Array*&() { return _data; } inline DevVarULong64Array*& ptr() { return _data; } inline DevVarULong64Array* operator->() { return _data; } inline ::CORBA::ULongLong& operator [] (_CORBA_ULong _i) { return (*_data)[_i]; } DevVarULong64Array*& _data; private: DevVarULong64Array_out(); DevVarULong64Array_out& operator=(const DevVarULong64Array_var&); }; struct DevVarLongStringArray { typedef _CORBA_ConstrType_Variable_Var _var_type; DevVarLongArray lvalue; DevVarStringArray svalue; void operator>>= (cdrStream &) const; void operator<<= (cdrStream &); }; typedef DevVarLongStringArray::_var_type DevVarLongStringArray_var; typedef _CORBA_ConstrType_Variable_OUT_arg< DevVarLongStringArray,DevVarLongStringArray_var > DevVarLongStringArray_out; _CORBA_MODULE_VAR _dyn_attr const ::CORBA::TypeCode_ptr _tc_DevVarLongStringArray; struct DevVarDoubleStringArray { typedef _CORBA_ConstrType_Variable_Var _var_type; DevVarDoubleArray dvalue; DevVarStringArray svalue; void operator>>= (cdrStream &) const; void operator<<= (cdrStream &); }; typedef DevVarDoubleStringArray::_var_type DevVarDoubleStringArray_var; typedef _CORBA_ConstrType_Variable_OUT_arg< DevVarDoubleStringArray,DevVarDoubleStringArray_var > DevVarDoubleStringArray_out; _CORBA_MODULE_VAR _dyn_attr const ::CORBA::TypeCode_ptr _tc_DevVarDoubleStringArray; struct DevEncoded { typedef _CORBA_ConstrType_Variable_Var _var_type; ::CORBA::String_member encoded_format; DevVarCharArray encoded_data; void operator>>= (cdrStream &) const; void operator<<= (cdrStream &); }; typedef DevEncoded::_var_type DevEncoded_var; typedef _CORBA_ConstrType_Variable_OUT_arg< DevEncoded,DevEncoded_var > DevEncoded_out; _CORBA_MODULE_VAR _dyn_attr const ::CORBA::TypeCode_ptr _tc_DevEncoded; _CORBA_MODULE_VAR _dyn_attr const ::CORBA::TypeCode_ptr _tc_DevVarEncodedArray; class DevVarEncodedArray_var; class DevVarEncodedArray : public _CORBA_Unbounded_Sequence< DevEncoded > { public: typedef DevVarEncodedArray_var _var_type; inline DevVarEncodedArray() {} inline DevVarEncodedArray(const DevVarEncodedArray& _s) : _CORBA_Unbounded_Sequence< DevEncoded > (_s) {} inline DevVarEncodedArray(_CORBA_ULong _max) : _CORBA_Unbounded_Sequence< DevEncoded > (_max) {} inline DevVarEncodedArray(_CORBA_ULong _max, _CORBA_ULong _len, DevEncoded* _val, _CORBA_Boolean _rel=0) : _CORBA_Unbounded_Sequence< DevEncoded > (_max, _len, _val, _rel) {} inline DevVarEncodedArray& operator = (const DevVarEncodedArray& _s) { _CORBA_Unbounded_Sequence< DevEncoded > ::operator=(_s); return *this; } }; class DevVarEncodedArray_out; class DevVarEncodedArray_var { public: inline DevVarEncodedArray_var() : _pd_seq(0) {} inline DevVarEncodedArray_var(DevVarEncodedArray* _s) : _pd_seq(_s) {} inline DevVarEncodedArray_var(const DevVarEncodedArray_var& _s) { if( _s._pd_seq ) _pd_seq = new DevVarEncodedArray(*_s._pd_seq); else _pd_seq = 0; } inline ~DevVarEncodedArray_var() { if( _pd_seq ) delete _pd_seq; } inline DevVarEncodedArray_var& operator = (DevVarEncodedArray* _s) { if( _pd_seq ) delete _pd_seq; _pd_seq = _s; return *this; } inline DevVarEncodedArray_var& operator = (const DevVarEncodedArray_var& _s) { if( _s._pd_seq ) { if( !_pd_seq ) _pd_seq = new DevVarEncodedArray; *_pd_seq = *_s._pd_seq; } else if( _pd_seq ) { delete _pd_seq; _pd_seq = 0; } return *this; } inline DevEncoded& operator [] (_CORBA_ULong _s) { return (*_pd_seq)[_s]; } inline DevVarEncodedArray* operator -> () { return _pd_seq; } inline const DevVarEncodedArray* operator -> () const { return _pd_seq; } #if defined(__GNUG__) inline operator DevVarEncodedArray& () const { return *_pd_seq; } #else inline operator const DevVarEncodedArray& () const { return *_pd_seq; } inline operator DevVarEncodedArray& () { return *_pd_seq; } #endif inline const DevVarEncodedArray& in() const { return *_pd_seq; } inline DevVarEncodedArray& inout() { return *_pd_seq; } inline DevVarEncodedArray*& out() { if( _pd_seq ) { delete _pd_seq; _pd_seq = 0; } return _pd_seq; } inline DevVarEncodedArray* _retn() { DevVarEncodedArray* tmp = _pd_seq; _pd_seq = 0; return tmp; } friend class DevVarEncodedArray_out; private: DevVarEncodedArray* _pd_seq; }; class DevVarEncodedArray_out { public: inline DevVarEncodedArray_out(DevVarEncodedArray*& _s) : _data(_s) { _data = 0; } inline DevVarEncodedArray_out(DevVarEncodedArray_var& _s) : _data(_s._pd_seq) { _s = (DevVarEncodedArray*) 0; } inline DevVarEncodedArray_out(const DevVarEncodedArray_out& _s) : _data(_s._data) {} inline DevVarEncodedArray_out& operator = (const DevVarEncodedArray_out& _s) { _data = _s._data; return *this; } inline DevVarEncodedArray_out& operator = (DevVarEncodedArray* _s) { _data = _s; return *this; } inline operator DevVarEncodedArray*&() { return _data; } inline DevVarEncodedArray*& ptr() { return _data; } inline DevVarEncodedArray* operator->() { return _data; } inline DevEncoded& operator [] (_CORBA_ULong _i) { return (*_data)[_i]; } DevVarEncodedArray*& _data; private: DevVarEncodedArray_out(); DevVarEncodedArray_out& operator=(const DevVarEncodedArray_var&); }; _CORBA_MODULE_VAR _dyn_attr const ::CORBA::TypeCode_ptr _tc_JavaUUID; typedef ::CORBA::ULongLong JavaUUID[2]; typedef ::CORBA::ULongLong JavaUUID_slice; _CORBA_MODULE_INLINE JavaUUID_slice* JavaUUID_alloc() { return new JavaUUID_slice[2]; } _CORBA_MODULE_INLINE JavaUUID_slice* JavaUUID_dup(const JavaUUID_slice* _s) { if (!_s) return 0; JavaUUID_slice* _data = JavaUUID_alloc(); if (_data) { for (_CORBA_ULong _0i0 = 0; _0i0 < 2; _0i0++){ _data[_0i0] = _s[_0i0]; } } return _data; } _CORBA_MODULE_INLINE void JavaUUID_copy(JavaUUID_slice* _to, const JavaUUID_slice* _from){ for (_CORBA_ULong _0i0 = 0; _0i0 < 2; _0i0++){ _to[_0i0] = _from[_0i0]; } } _CORBA_MODULE_INLINE void JavaUUID_free(JavaUUID_slice* _s) { delete [] _s; } class JavaUUID_copyHelper { public: static inline JavaUUID_slice* alloc() { return ::Tango::JavaUUID_alloc(); } static inline JavaUUID_slice* dup(const JavaUUID_slice* p) { return ::Tango::JavaUUID_dup(p); } static inline void free(JavaUUID_slice* p) { ::Tango::JavaUUID_free(p); } }; typedef _CORBA_Array_Fix_Var JavaUUID_var; typedef _CORBA_Array_Fix_Forany JavaUUID_forany; typedef JavaUUID_slice* JavaUUID_out; _CORBA_MODULE_VAR _dyn_attr const ::CORBA::TypeCode_ptr _tc_CppClntIdent; typedef ::CORBA::ULong CppClntIdent; typedef ::CORBA::ULong_out CppClntIdent_out; struct JavaClntIdent { typedef _CORBA_ConstrType_Variable_Var _var_type; ::CORBA::String_member MainClass; JavaUUID uuid; void operator>>= (cdrStream &) const; void operator<<= (cdrStream &); }; typedef JavaClntIdent::_var_type JavaClntIdent_var; typedef _CORBA_ConstrType_Variable_OUT_arg< JavaClntIdent,JavaClntIdent_var > JavaClntIdent_out; _CORBA_MODULE_VAR _dyn_attr const ::CORBA::TypeCode_ptr _tc_JavaClntIdent; enum LockerLanguage { CPP, JAVA /*, __max_LockerLanguage=0xffffffff */ }; typedef LockerLanguage& LockerLanguage_out; _CORBA_MODULE_VAR _dyn_attr const ::CORBA::TypeCode_ptr _tc_LockerLanguage; class ClntIdent { public: typedef _CORBA_ConstrType_Variable_Var _var_type; ClntIdent(): _pd__initialised(0) { } ClntIdent(const ClntIdent& _value) { _pd__initialised = _value._pd__initialised; switch(_value._pd__d) { case CPP: cpp_clnt(_value._pd_cpp_clnt); break; case JAVA: java_clnt(_value._pd_java_clnt); break; default: break; } _pd__d = _value._pd__d; } ~ClntIdent() {} ClntIdent& operator=(const ClntIdent& _value) { _pd__initialised = _value._pd__initialised; switch(_value._pd__d) { case CPP: cpp_clnt(_value._pd_cpp_clnt); break; case JAVA: java_clnt(_value._pd_java_clnt); break; default: break; } _pd__d = _value._pd__d; return *this; } LockerLanguage _d() const { return _pd__d;} void _d(LockerLanguage _value){ // illegal to set discriminator before making a member active if (!_pd__initialised) OMNIORB_THROW(BAD_PARAM,_OMNI_NS(BAD_PARAM_InvalidUnionDiscValue),::CORBA::COMPLETED_NO); if (_value == _pd__d) return; // no change switch (_pd__d){ case CPP: goto fail; case JAVA: goto fail; default: goto fail; }; fail: OMNIORB_THROW(BAD_PARAM,_OMNI_NS(BAD_PARAM_InvalidUnionDiscValue),::CORBA::COMPLETED_NO); } CppClntIdent cpp_clnt () const { return _pd_cpp_clnt; } void cpp_clnt (CppClntIdent _value) { _pd__initialised = 1; _pd__d = CPP; _pd__default = 0; _pd_cpp_clnt = _value; } const JavaClntIdent &java_clnt () const { return _pd_java_clnt; } JavaClntIdent &java_clnt () { return _pd_java_clnt; } void java_clnt (const JavaClntIdent& _value) { _pd__initialised = 1; _pd__d = JAVA; _pd__default = 0; _pd_java_clnt = _value; } void operator>>= (cdrStream&) const; void operator<<= (cdrStream&); private: LockerLanguage _pd__d; _CORBA_Boolean _pd__default; _CORBA_Boolean _pd__initialised; union { CppClntIdent _pd_cpp_clnt; }; JavaClntIdent _pd_java_clnt; }; typedef ClntIdent::_var_type ClntIdent_var; typedef _CORBA_ConstrType_Variable_OUT_arg< ClntIdent,ClntIdent_var > ClntIdent_out; _CORBA_MODULE_VAR _dyn_attr const ::CORBA::TypeCode_ptr _tc_ClntIdent; enum AttrQuality { ATTR_VALID, ATTR_INVALID, ATTR_ALARM, ATTR_CHANGING, ATTR_WARNING /*, __max_AttrQuality=0xffffffff */ }; typedef AttrQuality& AttrQuality_out; _CORBA_MODULE_VAR _dyn_attr const ::CORBA::TypeCode_ptr _tc_AttrQuality; enum AttrWriteType { READ, READ_WITH_WRITE, WRITE, READ_WRITE /*, __max_AttrWriteType=0xffffffff */ }; typedef AttrWriteType& AttrWriteType_out; _CORBA_MODULE_VAR _dyn_attr const ::CORBA::TypeCode_ptr _tc_AttrWriteType; enum AttrDataFormat { SCALAR, SPECTRUM, IMAGE, FMT_UNKNOWN /*, __max_AttrDataFormat=0xffffffff */ }; typedef AttrDataFormat& AttrDataFormat_out; _CORBA_MODULE_VAR _dyn_attr const ::CORBA::TypeCode_ptr _tc_AttrDataFormat; enum DevSource { DEV, CACHE, CACHE_DEV /*, __max_DevSource=0xffffffff */ }; typedef DevSource& DevSource_out; _CORBA_MODULE_VAR _dyn_attr const ::CORBA::TypeCode_ptr _tc_DevSource; enum ErrSeverity { WARN, ERR, PANIC /*, __max_ErrSeverity=0xffffffff */ }; typedef ErrSeverity& ErrSeverity_out; _CORBA_MODULE_VAR _dyn_attr const ::CORBA::TypeCode_ptr _tc_ErrSeverity; enum DevState { ON, OFF, CLOSE, OPEN, INSERT, EXTRACT, MOVING, STANDBY, FAULT, INIT, RUNNING, ALARM, DISABLE, UNKNOWN /*, __max_DevState=0xffffffff */ }; typedef DevState& DevState_out; _CORBA_MODULE_VAR _dyn_attr const ::CORBA::TypeCode_ptr _tc_DevState; enum DispLevel { OPERATOR, EXPERT /*, __max_DispLevel=0xffffffff */ }; typedef DispLevel& DispLevel_out; _CORBA_MODULE_VAR _dyn_attr const ::CORBA::TypeCode_ptr _tc_DispLevel; _CORBA_MODULE_VAR _dyn_attr const ::CORBA::TypeCode_ptr _tc_DevVarStateArray; // Need to declare <<= for elem type, as GCC expands templates early #if defined(__GNUG__) && __GNUG__ == 2 && __GNUC_MINOR__ == 7 friend inline void operator >>= (DevState, cdrStream&); friend inline void operator <<= (DevState&, cdrStream&); #endif class DevVarStateArray_var; class DevVarStateArray : public _CORBA_Unbounded_Sequence_w_FixSizeElement< DevState, 4, 4 > { public: typedef DevVarStateArray_var _var_type; inline DevVarStateArray() {} inline DevVarStateArray(const DevVarStateArray& _s) : _CORBA_Unbounded_Sequence_w_FixSizeElement< DevState, 4, 4 > (_s) {} inline DevVarStateArray(_CORBA_ULong _max) : _CORBA_Unbounded_Sequence_w_FixSizeElement< DevState, 4, 4 > (_max) {} inline DevVarStateArray(_CORBA_ULong _max, _CORBA_ULong _len, DevState* _val, _CORBA_Boolean _rel=0) : _CORBA_Unbounded_Sequence_w_FixSizeElement< DevState, 4, 4 > (_max, _len, _val, _rel) {} inline DevVarStateArray& operator = (const DevVarStateArray& _s) { _CORBA_Unbounded_Sequence_w_FixSizeElement< DevState, 4, 4 > ::operator=(_s); return *this; } }; class DevVarStateArray_out; class DevVarStateArray_var { public: inline DevVarStateArray_var() : _pd_seq(0) {} inline DevVarStateArray_var(DevVarStateArray* _s) : _pd_seq(_s) {} inline DevVarStateArray_var(const DevVarStateArray_var& _s) { if( _s._pd_seq ) _pd_seq = new DevVarStateArray(*_s._pd_seq); else _pd_seq = 0; } inline ~DevVarStateArray_var() { if( _pd_seq ) delete _pd_seq; } inline DevVarStateArray_var& operator = (DevVarStateArray* _s) { if( _pd_seq ) delete _pd_seq; _pd_seq = _s; return *this; } inline DevVarStateArray_var& operator = (const DevVarStateArray_var& _s) { if( _s._pd_seq ) { if( !_pd_seq ) _pd_seq = new DevVarStateArray; *_pd_seq = *_s._pd_seq; } else if( _pd_seq ) { delete _pd_seq; _pd_seq = 0; } return *this; } inline DevState& operator [] (_CORBA_ULong _s) { return (*_pd_seq)[_s]; } inline DevVarStateArray* operator -> () { return _pd_seq; } inline const DevVarStateArray* operator -> () const { return _pd_seq; } #if defined(__GNUG__) inline operator DevVarStateArray& () const { return *_pd_seq; } #else inline operator const DevVarStateArray& () const { return *_pd_seq; } inline operator DevVarStateArray& () { return *_pd_seq; } #endif inline const DevVarStateArray& in() const { return *_pd_seq; } inline DevVarStateArray& inout() { return *_pd_seq; } inline DevVarStateArray*& out() { if( _pd_seq ) { delete _pd_seq; _pd_seq = 0; } return _pd_seq; } inline DevVarStateArray* _retn() { DevVarStateArray* tmp = _pd_seq; _pd_seq = 0; return tmp; } friend class DevVarStateArray_out; private: DevVarStateArray* _pd_seq; }; class DevVarStateArray_out { public: inline DevVarStateArray_out(DevVarStateArray*& _s) : _data(_s) { _data = 0; } inline DevVarStateArray_out(DevVarStateArray_var& _s) : _data(_s._pd_seq) { _s = (DevVarStateArray*) 0; } inline DevVarStateArray_out(const DevVarStateArray_out& _s) : _data(_s._data) {} inline DevVarStateArray_out& operator = (const DevVarStateArray_out& _s) { _data = _s._data; return *this; } inline DevVarStateArray_out& operator = (DevVarStateArray* _s) { _data = _s; return *this; } inline operator DevVarStateArray*&() { return _data; } inline DevVarStateArray*& ptr() { return _data; } inline DevVarStateArray* operator->() { return _data; } inline DevState& operator [] (_CORBA_ULong _i) { return (*_data)[_i]; } DevVarStateArray*& _data; private: DevVarStateArray_out(); DevVarStateArray_out& operator=(const DevVarStateArray_var&); }; struct TimeVal { typedef _CORBA_ConstrType_Fix_Var _var_type; ::CORBA::Long tv_sec; ::CORBA::Long tv_usec; ::CORBA::Long tv_nsec; void operator>>= (cdrStream &) const; void operator<<= (cdrStream &); }; typedef TimeVal::_var_type TimeVal_var; typedef TimeVal& TimeVal_out; _CORBA_MODULE_VAR _dyn_attr const ::CORBA::TypeCode_ptr _tc_TimeVal; struct DevCmdInfo { typedef _CORBA_ConstrType_Variable_Var _var_type; ::CORBA::String_member cmd_name; ::CORBA::Long cmd_tag; ::CORBA::Long in_type; ::CORBA::Long out_type; ::CORBA::String_member in_type_desc; ::CORBA::String_member out_type_desc; void operator>>= (cdrStream &) const; void operator<<= (cdrStream &); }; typedef DevCmdInfo::_var_type DevCmdInfo_var; typedef _CORBA_ConstrType_Variable_OUT_arg< DevCmdInfo,DevCmdInfo_var > DevCmdInfo_out; _CORBA_MODULE_VAR _dyn_attr const ::CORBA::TypeCode_ptr _tc_DevCmdInfo; struct DevCmdInfo_2 { typedef _CORBA_ConstrType_Variable_Var _var_type; ::CORBA::String_member cmd_name; DispLevel level; ::CORBA::Long cmd_tag; ::CORBA::Long in_type; ::CORBA::Long out_type; ::CORBA::String_member in_type_desc; ::CORBA::String_member out_type_desc; void operator>>= (cdrStream &) const; void operator<<= (cdrStream &); }; typedef DevCmdInfo_2::_var_type DevCmdInfo_2_var; typedef _CORBA_ConstrType_Variable_OUT_arg< DevCmdInfo_2,DevCmdInfo_2_var > DevCmdInfo_2_out; _CORBA_MODULE_VAR _dyn_attr const ::CORBA::TypeCode_ptr _tc_DevCmdInfo_2; _CORBA_MODULE_VAR _dyn_attr const ::CORBA::TypeCode_ptr _tc_DevCmdInfoList; class DevCmdInfoList_var; class DevCmdInfoList : public _CORBA_Unbounded_Sequence< DevCmdInfo > { public: typedef DevCmdInfoList_var _var_type; inline DevCmdInfoList() {} inline DevCmdInfoList(const DevCmdInfoList& _s) : _CORBA_Unbounded_Sequence< DevCmdInfo > (_s) {} inline DevCmdInfoList(_CORBA_ULong _max) : _CORBA_Unbounded_Sequence< DevCmdInfo > (_max) {} inline DevCmdInfoList(_CORBA_ULong _max, _CORBA_ULong _len, DevCmdInfo* _val, _CORBA_Boolean _rel=0) : _CORBA_Unbounded_Sequence< DevCmdInfo > (_max, _len, _val, _rel) {} inline DevCmdInfoList& operator = (const DevCmdInfoList& _s) { _CORBA_Unbounded_Sequence< DevCmdInfo > ::operator=(_s); return *this; } }; class DevCmdInfoList_out; class DevCmdInfoList_var { public: inline DevCmdInfoList_var() : _pd_seq(0) {} inline DevCmdInfoList_var(DevCmdInfoList* _s) : _pd_seq(_s) {} inline DevCmdInfoList_var(const DevCmdInfoList_var& _s) { if( _s._pd_seq ) _pd_seq = new DevCmdInfoList(*_s._pd_seq); else _pd_seq = 0; } inline ~DevCmdInfoList_var() { if( _pd_seq ) delete _pd_seq; } inline DevCmdInfoList_var& operator = (DevCmdInfoList* _s) { if( _pd_seq ) delete _pd_seq; _pd_seq = _s; return *this; } inline DevCmdInfoList_var& operator = (const DevCmdInfoList_var& _s) { if( _s._pd_seq ) { if( !_pd_seq ) _pd_seq = new DevCmdInfoList; *_pd_seq = *_s._pd_seq; } else if( _pd_seq ) { delete _pd_seq; _pd_seq = 0; } return *this; } inline DevCmdInfo& operator [] (_CORBA_ULong _s) { return (*_pd_seq)[_s]; } inline DevCmdInfoList* operator -> () { return _pd_seq; } inline const DevCmdInfoList* operator -> () const { return _pd_seq; } #if defined(__GNUG__) inline operator DevCmdInfoList& () const { return *_pd_seq; } #else inline operator const DevCmdInfoList& () const { return *_pd_seq; } inline operator DevCmdInfoList& () { return *_pd_seq; } #endif inline const DevCmdInfoList& in() const { return *_pd_seq; } inline DevCmdInfoList& inout() { return *_pd_seq; } inline DevCmdInfoList*& out() { if( _pd_seq ) { delete _pd_seq; _pd_seq = 0; } return _pd_seq; } inline DevCmdInfoList* _retn() { DevCmdInfoList* tmp = _pd_seq; _pd_seq = 0; return tmp; } friend class DevCmdInfoList_out; private: DevCmdInfoList* _pd_seq; }; class DevCmdInfoList_out { public: inline DevCmdInfoList_out(DevCmdInfoList*& _s) : _data(_s) { _data = 0; } inline DevCmdInfoList_out(DevCmdInfoList_var& _s) : _data(_s._pd_seq) { _s = (DevCmdInfoList*) 0; } inline DevCmdInfoList_out(const DevCmdInfoList_out& _s) : _data(_s._data) {} inline DevCmdInfoList_out& operator = (const DevCmdInfoList_out& _s) { _data = _s._data; return *this; } inline DevCmdInfoList_out& operator = (DevCmdInfoList* _s) { _data = _s; return *this; } inline operator DevCmdInfoList*&() { return _data; } inline DevCmdInfoList*& ptr() { return _data; } inline DevCmdInfoList* operator->() { return _data; } inline DevCmdInfo& operator [] (_CORBA_ULong _i) { return (*_data)[_i]; } DevCmdInfoList*& _data; private: DevCmdInfoList_out(); DevCmdInfoList_out& operator=(const DevCmdInfoList_var&); }; _CORBA_MODULE_VAR _dyn_attr const ::CORBA::TypeCode_ptr _tc_DevCmdInfoList_2; class DevCmdInfoList_2_var; class DevCmdInfoList_2 : public _CORBA_Unbounded_Sequence< DevCmdInfo_2 > { public: typedef DevCmdInfoList_2_var _var_type; inline DevCmdInfoList_2() {} inline DevCmdInfoList_2(const DevCmdInfoList_2& _s) : _CORBA_Unbounded_Sequence< DevCmdInfo_2 > (_s) {} inline DevCmdInfoList_2(_CORBA_ULong _max) : _CORBA_Unbounded_Sequence< DevCmdInfo_2 > (_max) {} inline DevCmdInfoList_2(_CORBA_ULong _max, _CORBA_ULong _len, DevCmdInfo_2* _val, _CORBA_Boolean _rel=0) : _CORBA_Unbounded_Sequence< DevCmdInfo_2 > (_max, _len, _val, _rel) {} inline DevCmdInfoList_2& operator = (const DevCmdInfoList_2& _s) { _CORBA_Unbounded_Sequence< DevCmdInfo_2 > ::operator=(_s); return *this; } }; class DevCmdInfoList_2_out; class DevCmdInfoList_2_var { public: inline DevCmdInfoList_2_var() : _pd_seq(0) {} inline DevCmdInfoList_2_var(DevCmdInfoList_2* _s) : _pd_seq(_s) {} inline DevCmdInfoList_2_var(const DevCmdInfoList_2_var& _s) { if( _s._pd_seq ) _pd_seq = new DevCmdInfoList_2(*_s._pd_seq); else _pd_seq = 0; } inline ~DevCmdInfoList_2_var() { if( _pd_seq ) delete _pd_seq; } inline DevCmdInfoList_2_var& operator = (DevCmdInfoList_2* _s) { if( _pd_seq ) delete _pd_seq; _pd_seq = _s; return *this; } inline DevCmdInfoList_2_var& operator = (const DevCmdInfoList_2_var& _s) { if( _s._pd_seq ) { if( !_pd_seq ) _pd_seq = new DevCmdInfoList_2; *_pd_seq = *_s._pd_seq; } else if( _pd_seq ) { delete _pd_seq; _pd_seq = 0; } return *this; } inline DevCmdInfo_2& operator [] (_CORBA_ULong _s) { return (*_pd_seq)[_s]; } inline DevCmdInfoList_2* operator -> () { return _pd_seq; } inline const DevCmdInfoList_2* operator -> () const { return _pd_seq; } #if defined(__GNUG__) inline operator DevCmdInfoList_2& () const { return *_pd_seq; } #else inline operator const DevCmdInfoList_2& () const { return *_pd_seq; } inline operator DevCmdInfoList_2& () { return *_pd_seq; } #endif inline const DevCmdInfoList_2& in() const { return *_pd_seq; } inline DevCmdInfoList_2& inout() { return *_pd_seq; } inline DevCmdInfoList_2*& out() { if( _pd_seq ) { delete _pd_seq; _pd_seq = 0; } return _pd_seq; } inline DevCmdInfoList_2* _retn() { DevCmdInfoList_2* tmp = _pd_seq; _pd_seq = 0; return tmp; } friend class DevCmdInfoList_2_out; private: DevCmdInfoList_2* _pd_seq; }; class DevCmdInfoList_2_out { public: inline DevCmdInfoList_2_out(DevCmdInfoList_2*& _s) : _data(_s) { _data = 0; } inline DevCmdInfoList_2_out(DevCmdInfoList_2_var& _s) : _data(_s._pd_seq) { _s = (DevCmdInfoList_2*) 0; } inline DevCmdInfoList_2_out(const DevCmdInfoList_2_out& _s) : _data(_s._data) {} inline DevCmdInfoList_2_out& operator = (const DevCmdInfoList_2_out& _s) { _data = _s._data; return *this; } inline DevCmdInfoList_2_out& operator = (DevCmdInfoList_2* _s) { _data = _s; return *this; } inline operator DevCmdInfoList_2*&() { return _data; } inline DevCmdInfoList_2*& ptr() { return _data; } inline DevCmdInfoList_2* operator->() { return _data; } inline DevCmdInfo_2& operator [] (_CORBA_ULong _i) { return (*_data)[_i]; } DevCmdInfoList_2*& _data; private: DevCmdInfoList_2_out(); DevCmdInfoList_2_out& operator=(const DevCmdInfoList_2_var&); }; struct DevError { typedef _CORBA_ConstrType_Variable_Var _var_type; ::CORBA::String_member reason; ErrSeverity severity; ::CORBA::String_member desc; ::CORBA::String_member origin; void operator>>= (cdrStream &) const; void operator<<= (cdrStream &); }; typedef DevError::_var_type DevError_var; typedef _CORBA_ConstrType_Variable_OUT_arg< DevError,DevError_var > DevError_out; _CORBA_MODULE_VAR _dyn_attr const ::CORBA::TypeCode_ptr _tc_DevError; _CORBA_MODULE_VAR _dyn_attr const ::CORBA::TypeCode_ptr _tc_DevErrorList; class DevErrorList_var; class DevErrorList : public _CORBA_Unbounded_Sequence< DevError > { public: typedef DevErrorList_var _var_type; inline DevErrorList() {} inline DevErrorList(const DevErrorList& _s) : _CORBA_Unbounded_Sequence< DevError > (_s) {} inline DevErrorList(_CORBA_ULong _max) : _CORBA_Unbounded_Sequence< DevError > (_max) {} inline DevErrorList(_CORBA_ULong _max, _CORBA_ULong _len, DevError* _val, _CORBA_Boolean _rel=0) : _CORBA_Unbounded_Sequence< DevError > (_max, _len, _val, _rel) {} inline DevErrorList& operator = (const DevErrorList& _s) { _CORBA_Unbounded_Sequence< DevError > ::operator=(_s); return *this; } }; class DevErrorList_out; class DevErrorList_var { public: inline DevErrorList_var() : _pd_seq(0) {} inline DevErrorList_var(DevErrorList* _s) : _pd_seq(_s) {} inline DevErrorList_var(const DevErrorList_var& _s) { if( _s._pd_seq ) _pd_seq = new DevErrorList(*_s._pd_seq); else _pd_seq = 0; } inline ~DevErrorList_var() { if( _pd_seq ) delete _pd_seq; } inline DevErrorList_var& operator = (DevErrorList* _s) { if( _pd_seq ) delete _pd_seq; _pd_seq = _s; return *this; } inline DevErrorList_var& operator = (const DevErrorList_var& _s) { if( _s._pd_seq ) { if( !_pd_seq ) _pd_seq = new DevErrorList; *_pd_seq = *_s._pd_seq; } else if( _pd_seq ) { delete _pd_seq; _pd_seq = 0; } return *this; } inline DevError& operator [] (_CORBA_ULong _s) { return (*_pd_seq)[_s]; } inline DevErrorList* operator -> () { return _pd_seq; } inline const DevErrorList* operator -> () const { return _pd_seq; } #if defined(__GNUG__) inline operator DevErrorList& () const { return *_pd_seq; } #else inline operator const DevErrorList& () const { return *_pd_seq; } inline operator DevErrorList& () { return *_pd_seq; } #endif inline const DevErrorList& in() const { return *_pd_seq; } inline DevErrorList& inout() { return *_pd_seq; } inline DevErrorList*& out() { if( _pd_seq ) { delete _pd_seq; _pd_seq = 0; } return _pd_seq; } inline DevErrorList* _retn() { DevErrorList* tmp = _pd_seq; _pd_seq = 0; return tmp; } friend class DevErrorList_out; private: DevErrorList* _pd_seq; }; class DevErrorList_out { public: inline DevErrorList_out(DevErrorList*& _s) : _data(_s) { _data = 0; } inline DevErrorList_out(DevErrorList_var& _s) : _data(_s._pd_seq) { _s = (DevErrorList*) 0; } inline DevErrorList_out(const DevErrorList_out& _s) : _data(_s._data) {} inline DevErrorList_out& operator = (const DevErrorList_out& _s) { _data = _s._data; return *this; } inline DevErrorList_out& operator = (DevErrorList* _s) { _data = _s; return *this; } inline operator DevErrorList*&() { return _data; } inline DevErrorList*& ptr() { return _data; } inline DevErrorList* operator->() { return _data; } inline DevError& operator [] (_CORBA_ULong _i) { return (*_data)[_i]; } DevErrorList*& _data; private: DevErrorList_out(); DevErrorList_out& operator=(const DevErrorList_var&); }; struct NamedDevError { typedef _CORBA_ConstrType_Variable_Var _var_type; ::CORBA::String_member name; ::CORBA::Long index_in_call; DevErrorList err_list; void operator>>= (cdrStream &) const; void operator<<= (cdrStream &); }; typedef NamedDevError::_var_type NamedDevError_var; typedef _CORBA_ConstrType_Variable_OUT_arg< NamedDevError,NamedDevError_var > NamedDevError_out; _CORBA_MODULE_VAR _dyn_attr const ::CORBA::TypeCode_ptr _tc_NamedDevError; _CORBA_MODULE_VAR _dyn_attr const ::CORBA::TypeCode_ptr _tc_NamedDevErrorList; class NamedDevErrorList_var; class NamedDevErrorList : public _CORBA_Unbounded_Sequence< NamedDevError > { public: typedef NamedDevErrorList_var _var_type; inline NamedDevErrorList() {} inline NamedDevErrorList(const NamedDevErrorList& _s) : _CORBA_Unbounded_Sequence< NamedDevError > (_s) {} inline NamedDevErrorList(_CORBA_ULong _max) : _CORBA_Unbounded_Sequence< NamedDevError > (_max) {} inline NamedDevErrorList(_CORBA_ULong _max, _CORBA_ULong _len, NamedDevError* _val, _CORBA_Boolean _rel=0) : _CORBA_Unbounded_Sequence< NamedDevError > (_max, _len, _val, _rel) {} inline NamedDevErrorList& operator = (const NamedDevErrorList& _s) { _CORBA_Unbounded_Sequence< NamedDevError > ::operator=(_s); return *this; } }; class NamedDevErrorList_out; class NamedDevErrorList_var { public: inline NamedDevErrorList_var() : _pd_seq(0) {} inline NamedDevErrorList_var(NamedDevErrorList* _s) : _pd_seq(_s) {} inline NamedDevErrorList_var(const NamedDevErrorList_var& _s) { if( _s._pd_seq ) _pd_seq = new NamedDevErrorList(*_s._pd_seq); else _pd_seq = 0; } inline ~NamedDevErrorList_var() { if( _pd_seq ) delete _pd_seq; } inline NamedDevErrorList_var& operator = (NamedDevErrorList* _s) { if( _pd_seq ) delete _pd_seq; _pd_seq = _s; return *this; } inline NamedDevErrorList_var& operator = (const NamedDevErrorList_var& _s) { if( _s._pd_seq ) { if( !_pd_seq ) _pd_seq = new NamedDevErrorList; *_pd_seq = *_s._pd_seq; } else if( _pd_seq ) { delete _pd_seq; _pd_seq = 0; } return *this; } inline NamedDevError& operator [] (_CORBA_ULong _s) { return (*_pd_seq)[_s]; } inline NamedDevErrorList* operator -> () { return _pd_seq; } inline const NamedDevErrorList* operator -> () const { return _pd_seq; } #if defined(__GNUG__) inline operator NamedDevErrorList& () const { return *_pd_seq; } #else inline operator const NamedDevErrorList& () const { return *_pd_seq; } inline operator NamedDevErrorList& () { return *_pd_seq; } #endif inline const NamedDevErrorList& in() const { return *_pd_seq; } inline NamedDevErrorList& inout() { return *_pd_seq; } inline NamedDevErrorList*& out() { if( _pd_seq ) { delete _pd_seq; _pd_seq = 0; } return _pd_seq; } inline NamedDevErrorList* _retn() { NamedDevErrorList* tmp = _pd_seq; _pd_seq = 0; return tmp; } friend class NamedDevErrorList_out; private: NamedDevErrorList* _pd_seq; }; class NamedDevErrorList_out { public: inline NamedDevErrorList_out(NamedDevErrorList*& _s) : _data(_s) { _data = 0; } inline NamedDevErrorList_out(NamedDevErrorList_var& _s) : _data(_s._pd_seq) { _s = (NamedDevErrorList*) 0; } inline NamedDevErrorList_out(const NamedDevErrorList_out& _s) : _data(_s._data) {} inline NamedDevErrorList_out& operator = (const NamedDevErrorList_out& _s) { _data = _s._data; return *this; } inline NamedDevErrorList_out& operator = (NamedDevErrorList* _s) { _data = _s; return *this; } inline operator NamedDevErrorList*&() { return _data; } inline NamedDevErrorList*& ptr() { return _data; } inline NamedDevErrorList* operator->() { return _data; } inline NamedDevError& operator [] (_CORBA_ULong _i) { return (*_data)[_i]; } NamedDevErrorList*& _data; private: NamedDevErrorList_out(); NamedDevErrorList_out& operator=(const NamedDevErrorList_var&); }; class DevFailed : public ::CORBA::UserException { public: DevErrorList errors; inline DevFailed() { pd_insertToAnyFn = insertToAnyFn; pd_insertToAnyFnNCP = insertToAnyFnNCP; } DevFailed(const DevFailed&); DevFailed(const DevErrorList i_errors); DevFailed& operator=(const DevFailed&); virtual ~DevFailed(); virtual void _raise() const; static DevFailed* _downcast(::CORBA::Exception*); static const DevFailed* _downcast(const ::CORBA::Exception*); static inline DevFailed* _narrow(::CORBA::Exception* _e) { return _downcast(_e); } void operator>>=(cdrStream&) const ; void operator<<=(cdrStream&) ; static _core_attr insertExceptionToAny insertToAnyFn; static _core_attr insertExceptionToAnyNCP insertToAnyFnNCP; virtual ::CORBA::Exception* _NP_duplicate() const; static _core_attr const char* _PD_repoId; static _core_attr const char* _PD_typeId; private: virtual const char* _NP_typeId() const; virtual const char* _NP_repoId(int*) const; virtual void _NP_marshal(cdrStream&) const; }; _CORBA_MODULE_VAR _dyn_attr const ::CORBA::TypeCode_ptr _tc_DevFailed; class MultiDevFailed : public ::CORBA::UserException { public: NamedDevErrorList errors; inline MultiDevFailed() { pd_insertToAnyFn = insertToAnyFn; pd_insertToAnyFnNCP = insertToAnyFnNCP; } MultiDevFailed(const MultiDevFailed&); MultiDevFailed(const NamedDevErrorList i_errors); MultiDevFailed& operator=(const MultiDevFailed&); virtual ~MultiDevFailed(); virtual void _raise() const; static MultiDevFailed* _downcast(::CORBA::Exception*); static const MultiDevFailed* _downcast(const ::CORBA::Exception*); static inline MultiDevFailed* _narrow(::CORBA::Exception* _e) { return _downcast(_e); } void operator>>=(cdrStream&) const ; void operator<<=(cdrStream&) ; static _core_attr insertExceptionToAny insertToAnyFn; static _core_attr insertExceptionToAnyNCP insertToAnyFnNCP; virtual ::CORBA::Exception* _NP_duplicate() const; static _core_attr const char* _PD_repoId; static _core_attr const char* _PD_typeId; private: virtual const char* _NP_typeId() const; virtual const char* _NP_repoId(int*) const; virtual void _NP_marshal(cdrStream&) const; }; _CORBA_MODULE_VAR _dyn_attr const ::CORBA::TypeCode_ptr _tc_MultiDevFailed; struct AttributeConfig { typedef _CORBA_ConstrType_Variable_Var _var_type; ::CORBA::String_member name; AttrWriteType writable; AttrDataFormat data_format; ::CORBA::Long data_type; ::CORBA::Long max_dim_x; ::CORBA::Long max_dim_y; ::CORBA::String_member description; ::CORBA::String_member label; ::CORBA::String_member unit; ::CORBA::String_member standard_unit; ::CORBA::String_member display_unit; ::CORBA::String_member format; ::CORBA::String_member min_value; ::CORBA::String_member max_value; ::CORBA::String_member min_alarm; ::CORBA::String_member max_alarm; ::CORBA::String_member writable_attr_name; DevVarStringArray extensions; void operator>>= (cdrStream &) const; void operator<<= (cdrStream &); }; typedef AttributeConfig::_var_type AttributeConfig_var; typedef _CORBA_ConstrType_Variable_OUT_arg< AttributeConfig,AttributeConfig_var > AttributeConfig_out; _CORBA_MODULE_VAR _dyn_attr const ::CORBA::TypeCode_ptr _tc_AttributeConfig; struct AttributeConfig_2 { typedef _CORBA_ConstrType_Variable_Var _var_type; ::CORBA::String_member name; AttrWriteType writable; AttrDataFormat data_format; ::CORBA::Long data_type; ::CORBA::Long max_dim_x; ::CORBA::Long max_dim_y; ::CORBA::String_member description; ::CORBA::String_member label; ::CORBA::String_member unit; ::CORBA::String_member standard_unit; ::CORBA::String_member display_unit; ::CORBA::String_member format; ::CORBA::String_member min_value; ::CORBA::String_member max_value; ::CORBA::String_member min_alarm; ::CORBA::String_member max_alarm; ::CORBA::String_member writable_attr_name; DispLevel level; DevVarStringArray extensions; void operator>>= (cdrStream &) const; void operator<<= (cdrStream &); }; typedef AttributeConfig_2::_var_type AttributeConfig_2_var; typedef _CORBA_ConstrType_Variable_OUT_arg< AttributeConfig_2,AttributeConfig_2_var > AttributeConfig_2_out; _CORBA_MODULE_VAR _dyn_attr const ::CORBA::TypeCode_ptr _tc_AttributeConfig_2; struct AttributeValue { typedef _CORBA_ConstrType_Variable_Var _var_type; ::CORBA::Any value; AttrQuality quality; TimeVal time; ::CORBA::String_member name; ::CORBA::Long dim_x; ::CORBA::Long dim_y; void operator>>= (cdrStream &) const; void operator<<= (cdrStream &); }; typedef AttributeValue::_var_type AttributeValue_var; typedef _CORBA_ConstrType_Variable_OUT_arg< AttributeValue,AttributeValue_var > AttributeValue_out; _CORBA_MODULE_VAR _dyn_attr const ::CORBA::TypeCode_ptr _tc_AttributeValue; struct AttributeDim { typedef _CORBA_ConstrType_Fix_Var _var_type; ::CORBA::Long dim_x; ::CORBA::Long dim_y; void operator>>= (cdrStream &) const; void operator<<= (cdrStream &); }; typedef AttributeDim::_var_type AttributeDim_var; typedef AttributeDim& AttributeDim_out; _CORBA_MODULE_VAR _dyn_attr const ::CORBA::TypeCode_ptr _tc_AttributeDim; struct AttributeValue_3 { typedef _CORBA_ConstrType_Variable_Var _var_type; ::CORBA::Any value; AttrQuality quality; TimeVal time; ::CORBA::String_member name; AttributeDim r_dim; AttributeDim w_dim; DevErrorList err_list; void operator>>= (cdrStream &) const; void operator<<= (cdrStream &); }; typedef AttributeValue_3::_var_type AttributeValue_3_var; typedef _CORBA_ConstrType_Variable_OUT_arg< AttributeValue_3,AttributeValue_3_var > AttributeValue_3_out; _CORBA_MODULE_VAR _dyn_attr const ::CORBA::TypeCode_ptr _tc_AttributeValue_3; enum AttributeDataType { ATT_BOOL, ATT_SHORT, ATT_LONG, ATT_LONG64, ATT_FLOAT, ATT_DOUBLE, ATT_UCHAR, ATT_USHORT, ATT_ULONG, ATT_ULONG64, ATT_STRING, ATT_STATE, DEVICE_STATE, ATT_ENCODED, NO_DATA /*, __max_AttributeDataType=0xffffffff */ }; typedef AttributeDataType& AttributeDataType_out; _CORBA_MODULE_VAR _dyn_attr const ::CORBA::TypeCode_ptr _tc_AttributeDataType; class AttrValUnion { public: typedef _CORBA_ConstrType_Variable_Var _var_type; AttrValUnion(): _pd__initialised(0) { } AttrValUnion(const AttrValUnion& _value) { _pd__initialised = _value._pd__initialised; switch(_value._pd__d) { case ATT_BOOL: bool_att_value(_value._pd_bool_att_value); break; case ATT_SHORT: short_att_value(_value._pd_short_att_value); break; case ATT_LONG: long_att_value(_value._pd_long_att_value); break; case ATT_LONG64: long64_att_value(_value._pd_long64_att_value); break; case ATT_FLOAT: float_att_value(_value._pd_float_att_value); break; case ATT_DOUBLE: double_att_value(_value._pd_double_att_value); break; case ATT_UCHAR: uchar_att_value(_value._pd_uchar_att_value); break; case ATT_USHORT: ushort_att_value(_value._pd_ushort_att_value); break; case ATT_ULONG: ulong_att_value(_value._pd_ulong_att_value); break; case ATT_ULONG64: ulong64_att_value(_value._pd_ulong64_att_value); break; case ATT_STRING: string_att_value(_value._pd_string_att_value); break; case ATT_STATE: state_att_value(_value._pd_state_att_value); break; case DEVICE_STATE: dev_state_att(_value._pd_dev_state_att); break; case ATT_ENCODED: encoded_att_value(_value._pd_encoded_att_value); break; case NO_DATA: union_no_data(_value._pd_union_no_data); break; default: break; } _pd__d = _value._pd__d; } ~AttrValUnion() {} AttrValUnion& operator=(const AttrValUnion& _value) { _pd__initialised = _value._pd__initialised; switch(_value._pd__d) { case ATT_BOOL: bool_att_value(_value._pd_bool_att_value); break; case ATT_SHORT: short_att_value(_value._pd_short_att_value); break; case ATT_LONG: long_att_value(_value._pd_long_att_value); break; case ATT_LONG64: long64_att_value(_value._pd_long64_att_value); break; case ATT_FLOAT: float_att_value(_value._pd_float_att_value); break; case ATT_DOUBLE: double_att_value(_value._pd_double_att_value); break; case ATT_UCHAR: uchar_att_value(_value._pd_uchar_att_value); break; case ATT_USHORT: ushort_att_value(_value._pd_ushort_att_value); break; case ATT_ULONG: ulong_att_value(_value._pd_ulong_att_value); break; case ATT_ULONG64: ulong64_att_value(_value._pd_ulong64_att_value); break; case ATT_STRING: string_att_value(_value._pd_string_att_value); break; case ATT_STATE: state_att_value(_value._pd_state_att_value); break; case DEVICE_STATE: dev_state_att(_value._pd_dev_state_att); break; case ATT_ENCODED: encoded_att_value(_value._pd_encoded_att_value); break; case NO_DATA: union_no_data(_value._pd_union_no_data); break; default: break; } _pd__d = _value._pd__d; return *this; } AttributeDataType _d() const { return _pd__d;} void _d(AttributeDataType _value){ // illegal to set discriminator before making a member active if (!_pd__initialised) OMNIORB_THROW(BAD_PARAM,_OMNI_NS(BAD_PARAM_InvalidUnionDiscValue),::CORBA::COMPLETED_NO); if (_value == _pd__d) return; // no change switch (_pd__d){ case ATT_BOOL: goto fail; case ATT_SHORT: goto fail; case ATT_LONG: goto fail; case ATT_LONG64: goto fail; case ATT_FLOAT: goto fail; case ATT_DOUBLE: goto fail; case ATT_UCHAR: goto fail; case ATT_USHORT: goto fail; case ATT_ULONG: goto fail; case ATT_ULONG64: goto fail; case ATT_STRING: goto fail; case ATT_STATE: goto fail; case DEVICE_STATE: goto fail; case ATT_ENCODED: goto fail; case NO_DATA: goto fail; default: goto fail; }; fail: OMNIORB_THROW(BAD_PARAM,_OMNI_NS(BAD_PARAM_InvalidUnionDiscValue),::CORBA::COMPLETED_NO); } const DevVarBooleanArray &bool_att_value () const { return _pd_bool_att_value; } DevVarBooleanArray &bool_att_value () { return _pd_bool_att_value; } void bool_att_value (const DevVarBooleanArray& _value) { _pd__initialised = 1; _pd__d = ATT_BOOL; _pd__default = 0; _pd_bool_att_value = _value; } const DevVarShortArray &short_att_value () const { return _pd_short_att_value; } DevVarShortArray &short_att_value () { return _pd_short_att_value; } void short_att_value (const DevVarShortArray& _value) { _pd__initialised = 1; _pd__d = ATT_SHORT; _pd__default = 0; _pd_short_att_value = _value; } const DevVarLongArray &long_att_value () const { return _pd_long_att_value; } DevVarLongArray &long_att_value () { return _pd_long_att_value; } void long_att_value (const DevVarLongArray& _value) { _pd__initialised = 1; _pd__d = ATT_LONG; _pd__default = 0; _pd_long_att_value = _value; } const DevVarLong64Array &long64_att_value () const { return _pd_long64_att_value; } DevVarLong64Array &long64_att_value () { return _pd_long64_att_value; } void long64_att_value (const DevVarLong64Array& _value) { _pd__initialised = 1; _pd__d = ATT_LONG64; _pd__default = 0; _pd_long64_att_value = _value; } const DevVarFloatArray &float_att_value () const { return _pd_float_att_value; } DevVarFloatArray &float_att_value () { return _pd_float_att_value; } void float_att_value (const DevVarFloatArray& _value) { _pd__initialised = 1; _pd__d = ATT_FLOAT; _pd__default = 0; _pd_float_att_value = _value; } const DevVarDoubleArray &double_att_value () const { return _pd_double_att_value; } DevVarDoubleArray &double_att_value () { return _pd_double_att_value; } void double_att_value (const DevVarDoubleArray& _value) { _pd__initialised = 1; _pd__d = ATT_DOUBLE; _pd__default = 0; _pd_double_att_value = _value; } const DevVarCharArray &uchar_att_value () const { return _pd_uchar_att_value; } DevVarCharArray &uchar_att_value () { return _pd_uchar_att_value; } void uchar_att_value (const DevVarCharArray& _value) { _pd__initialised = 1; _pd__d = ATT_UCHAR; _pd__default = 0; _pd_uchar_att_value = _value; } const DevVarUShortArray &ushort_att_value () const { return _pd_ushort_att_value; } DevVarUShortArray &ushort_att_value () { return _pd_ushort_att_value; } void ushort_att_value (const DevVarUShortArray& _value) { _pd__initialised = 1; _pd__d = ATT_USHORT; _pd__default = 0; _pd_ushort_att_value = _value; } const DevVarULongArray &ulong_att_value () const { return _pd_ulong_att_value; } DevVarULongArray &ulong_att_value () { return _pd_ulong_att_value; } void ulong_att_value (const DevVarULongArray& _value) { _pd__initialised = 1; _pd__d = ATT_ULONG; _pd__default = 0; _pd_ulong_att_value = _value; } const DevVarULong64Array &ulong64_att_value () const { return _pd_ulong64_att_value; } DevVarULong64Array &ulong64_att_value () { return _pd_ulong64_att_value; } void ulong64_att_value (const DevVarULong64Array& _value) { _pd__initialised = 1; _pd__d = ATT_ULONG64; _pd__default = 0; _pd_ulong64_att_value = _value; } const DevVarStringArray &string_att_value () const { return _pd_string_att_value; } DevVarStringArray &string_att_value () { return _pd_string_att_value; } void string_att_value (const DevVarStringArray& _value) { _pd__initialised = 1; _pd__d = ATT_STRING; _pd__default = 0; _pd_string_att_value = _value; } const DevVarStateArray &state_att_value () const { return _pd_state_att_value; } DevVarStateArray &state_att_value () { return _pd_state_att_value; } void state_att_value (const DevVarStateArray& _value) { _pd__initialised = 1; _pd__d = ATT_STATE; _pd__default = 0; _pd_state_att_value = _value; } DevState dev_state_att () const { return _pd_dev_state_att; } void dev_state_att (DevState _value) { _pd__initialised = 1; _pd__d = DEVICE_STATE; _pd__default = 0; _pd_dev_state_att = _value; } const DevVarEncodedArray &encoded_att_value () const { return _pd_encoded_att_value; } DevVarEncodedArray &encoded_att_value () { return _pd_encoded_att_value; } void encoded_att_value (const DevVarEncodedArray& _value) { _pd__initialised = 1; _pd__d = ATT_ENCODED; _pd__default = 0; _pd_encoded_att_value = _value; } DevBoolean union_no_data () const { return _pd_union_no_data; } void union_no_data (DevBoolean _value) { _pd__initialised = 1; _pd__d = NO_DATA; _pd__default = 0; _pd_union_no_data = _value; } void operator>>= (cdrStream&) const; void operator<<= (cdrStream&); private: AttributeDataType _pd__d; _CORBA_Boolean _pd__default; _CORBA_Boolean _pd__initialised; union { DevState _pd_dev_state_att; DevBoolean _pd_union_no_data; }; DevVarBooleanArray _pd_bool_att_value; DevVarShortArray _pd_short_att_value; DevVarLongArray _pd_long_att_value; DevVarLong64Array _pd_long64_att_value; DevVarFloatArray _pd_float_att_value; DevVarDoubleArray _pd_double_att_value; DevVarCharArray _pd_uchar_att_value; DevVarUShortArray _pd_ushort_att_value; DevVarULongArray _pd_ulong_att_value; DevVarULong64Array _pd_ulong64_att_value; DevVarStringArray _pd_string_att_value; DevVarStateArray _pd_state_att_value; DevVarEncodedArray _pd_encoded_att_value; }; typedef AttrValUnion::_var_type AttrValUnion_var; typedef _CORBA_ConstrType_Variable_OUT_arg< AttrValUnion,AttrValUnion_var > AttrValUnion_out; _CORBA_MODULE_VAR _dyn_attr const ::CORBA::TypeCode_ptr _tc_AttrValUnion; struct AttributeValue_4 { typedef _CORBA_ConstrType_Variable_Var _var_type; // Added by ET for LockedAttributeValue_4 class virtual ~AttributeValue_4() {if (mut_ptr != NULL)mut_ptr->unlock();} AttributeValue_4() {mut_ptr=NULL;} void set_attr_mutex(omni_mutex *ptr) {mut_ptr=ptr;} void rel_attr_mutex() {if (mut_ptr != NULL){mut_ptr->unlock();mut_ptr=NULL;}} AttrValUnion value; AttrQuality quality; AttrDataFormat data_format; TimeVal time; ::CORBA::String_member name; AttributeDim r_dim; AttributeDim w_dim; DevErrorList err_list; // Added by ET for LockedAttributeValue_4 class omni_mutex *mut_ptr; void operator>>= (cdrStream &) const; void operator<<= (cdrStream &); }; typedef AttributeValue_4::_var_type AttributeValue_4_var; typedef _CORBA_ConstrType_Variable_OUT_arg< AttributeValue_4,AttributeValue_4_var > AttributeValue_4_out; _CORBA_MODULE_VAR _dyn_attr const ::CORBA::TypeCode_ptr _tc_AttributeValue_4; struct ChangeEventProp { typedef _CORBA_ConstrType_Variable_Var _var_type; ::CORBA::String_member rel_change; ::CORBA::String_member abs_change; DevVarStringArray extensions; void operator>>= (cdrStream &) const; void operator<<= (cdrStream &); }; typedef ChangeEventProp::_var_type ChangeEventProp_var; typedef _CORBA_ConstrType_Variable_OUT_arg< ChangeEventProp,ChangeEventProp_var > ChangeEventProp_out; _CORBA_MODULE_VAR _dyn_attr const ::CORBA::TypeCode_ptr _tc_ChangeEventProp; struct PeriodicEventProp { typedef _CORBA_ConstrType_Variable_Var _var_type; ::CORBA::String_member period; DevVarStringArray extensions; void operator>>= (cdrStream &) const; void operator<<= (cdrStream &); }; typedef PeriodicEventProp::_var_type PeriodicEventProp_var; typedef _CORBA_ConstrType_Variable_OUT_arg< PeriodicEventProp,PeriodicEventProp_var > PeriodicEventProp_out; _CORBA_MODULE_VAR _dyn_attr const ::CORBA::TypeCode_ptr _tc_PeriodicEventProp; struct ArchiveEventProp { typedef _CORBA_ConstrType_Variable_Var _var_type; ::CORBA::String_member rel_change; ::CORBA::String_member abs_change; ::CORBA::String_member period; DevVarStringArray extensions; void operator>>= (cdrStream &) const; void operator<<= (cdrStream &); }; typedef ArchiveEventProp::_var_type ArchiveEventProp_var; typedef _CORBA_ConstrType_Variable_OUT_arg< ArchiveEventProp,ArchiveEventProp_var > ArchiveEventProp_out; _CORBA_MODULE_VAR _dyn_attr const ::CORBA::TypeCode_ptr _tc_ArchiveEventProp; struct EventProperties { typedef _CORBA_ConstrType_Variable_Var _var_type; ChangeEventProp ch_event; PeriodicEventProp per_event; ArchiveEventProp arch_event; void operator>>= (cdrStream &) const; void operator<<= (cdrStream &); }; typedef EventProperties::_var_type EventProperties_var; typedef _CORBA_ConstrType_Variable_OUT_arg< EventProperties,EventProperties_var > EventProperties_out; _CORBA_MODULE_VAR _dyn_attr const ::CORBA::TypeCode_ptr _tc_EventProperties; struct AttributeAlarm { typedef _CORBA_ConstrType_Variable_Var _var_type; ::CORBA::String_member min_alarm; ::CORBA::String_member max_alarm; ::CORBA::String_member min_warning; ::CORBA::String_member max_warning; ::CORBA::String_member delta_t; ::CORBA::String_member delta_val; DevVarStringArray extensions; void operator>>= (cdrStream &) const; void operator<<= (cdrStream &); }; typedef AttributeAlarm::_var_type AttributeAlarm_var; typedef _CORBA_ConstrType_Variable_OUT_arg< AttributeAlarm,AttributeAlarm_var > AttributeAlarm_out; _CORBA_MODULE_VAR _dyn_attr const ::CORBA::TypeCode_ptr _tc_AttributeAlarm; struct AttributeConfig_3 { typedef _CORBA_ConstrType_Variable_Var _var_type; ::CORBA::String_member name; AttrWriteType writable; AttrDataFormat data_format; ::CORBA::Long data_type; ::CORBA::Long max_dim_x; ::CORBA::Long max_dim_y; ::CORBA::String_member description; ::CORBA::String_member label; ::CORBA::String_member unit; ::CORBA::String_member standard_unit; ::CORBA::String_member display_unit; ::CORBA::String_member format; ::CORBA::String_member min_value; ::CORBA::String_member max_value; ::CORBA::String_member writable_attr_name; DispLevel level; AttributeAlarm att_alarm; EventProperties event_prop; DevVarStringArray extensions; DevVarStringArray sys_extensions; void operator>>= (cdrStream &) const; void operator<<= (cdrStream &); }; typedef AttributeConfig_3::_var_type AttributeConfig_3_var; typedef _CORBA_ConstrType_Variable_OUT_arg< AttributeConfig_3,AttributeConfig_3_var > AttributeConfig_3_out; _CORBA_MODULE_VAR _dyn_attr const ::CORBA::TypeCode_ptr _tc_AttributeConfig_3; _CORBA_MODULE_VAR _dyn_attr const ::CORBA::TypeCode_ptr _tc_AttributeConfigList; class AttributeConfigList_var; class AttributeConfigList : public _CORBA_Unbounded_Sequence< AttributeConfig > { public: typedef AttributeConfigList_var _var_type; inline AttributeConfigList() {} inline AttributeConfigList(const AttributeConfigList& _s) : _CORBA_Unbounded_Sequence< AttributeConfig > (_s) {} inline AttributeConfigList(_CORBA_ULong _max) : _CORBA_Unbounded_Sequence< AttributeConfig > (_max) {} inline AttributeConfigList(_CORBA_ULong _max, _CORBA_ULong _len, AttributeConfig* _val, _CORBA_Boolean _rel=0) : _CORBA_Unbounded_Sequence< AttributeConfig > (_max, _len, _val, _rel) {} inline AttributeConfigList& operator = (const AttributeConfigList& _s) { _CORBA_Unbounded_Sequence< AttributeConfig > ::operator=(_s); return *this; } }; class AttributeConfigList_out; class AttributeConfigList_var { public: inline AttributeConfigList_var() : _pd_seq(0) {} inline AttributeConfigList_var(AttributeConfigList* _s) : _pd_seq(_s) {} inline AttributeConfigList_var(const AttributeConfigList_var& _s) { if( _s._pd_seq ) _pd_seq = new AttributeConfigList(*_s._pd_seq); else _pd_seq = 0; } inline ~AttributeConfigList_var() { if( _pd_seq ) delete _pd_seq; } inline AttributeConfigList_var& operator = (AttributeConfigList* _s) { if( _pd_seq ) delete _pd_seq; _pd_seq = _s; return *this; } inline AttributeConfigList_var& operator = (const AttributeConfigList_var& _s) { if( _s._pd_seq ) { if( !_pd_seq ) _pd_seq = new AttributeConfigList; *_pd_seq = *_s._pd_seq; } else if( _pd_seq ) { delete _pd_seq; _pd_seq = 0; } return *this; } inline AttributeConfig& operator [] (_CORBA_ULong _s) { return (*_pd_seq)[_s]; } inline AttributeConfigList* operator -> () { return _pd_seq; } inline const AttributeConfigList* operator -> () const { return _pd_seq; } #if defined(__GNUG__) inline operator AttributeConfigList& () const { return *_pd_seq; } #else inline operator const AttributeConfigList& () const { return *_pd_seq; } inline operator AttributeConfigList& () { return *_pd_seq; } #endif inline const AttributeConfigList& in() const { return *_pd_seq; } inline AttributeConfigList& inout() { return *_pd_seq; } inline AttributeConfigList*& out() { if( _pd_seq ) { delete _pd_seq; _pd_seq = 0; } return _pd_seq; } inline AttributeConfigList* _retn() { AttributeConfigList* tmp = _pd_seq; _pd_seq = 0; return tmp; } friend class AttributeConfigList_out; private: AttributeConfigList* _pd_seq; }; class AttributeConfigList_out { public: inline AttributeConfigList_out(AttributeConfigList*& _s) : _data(_s) { _data = 0; } inline AttributeConfigList_out(AttributeConfigList_var& _s) : _data(_s._pd_seq) { _s = (AttributeConfigList*) 0; } inline AttributeConfigList_out(const AttributeConfigList_out& _s) : _data(_s._data) {} inline AttributeConfigList_out& operator = (const AttributeConfigList_out& _s) { _data = _s._data; return *this; } inline AttributeConfigList_out& operator = (AttributeConfigList* _s) { _data = _s; return *this; } inline operator AttributeConfigList*&() { return _data; } inline AttributeConfigList*& ptr() { return _data; } inline AttributeConfigList* operator->() { return _data; } inline AttributeConfig& operator [] (_CORBA_ULong _i) { return (*_data)[_i]; } AttributeConfigList*& _data; private: AttributeConfigList_out(); AttributeConfigList_out& operator=(const AttributeConfigList_var&); }; _CORBA_MODULE_VAR _dyn_attr const ::CORBA::TypeCode_ptr _tc_AttributeConfigList_2; class AttributeConfigList_2_var; class AttributeConfigList_2 : public _CORBA_Unbounded_Sequence< AttributeConfig_2 > { public: typedef AttributeConfigList_2_var _var_type; inline AttributeConfigList_2() {} inline AttributeConfigList_2(const AttributeConfigList_2& _s) : _CORBA_Unbounded_Sequence< AttributeConfig_2 > (_s) {} inline AttributeConfigList_2(_CORBA_ULong _max) : _CORBA_Unbounded_Sequence< AttributeConfig_2 > (_max) {} inline AttributeConfigList_2(_CORBA_ULong _max, _CORBA_ULong _len, AttributeConfig_2* _val, _CORBA_Boolean _rel=0) : _CORBA_Unbounded_Sequence< AttributeConfig_2 > (_max, _len, _val, _rel) {} inline AttributeConfigList_2& operator = (const AttributeConfigList_2& _s) { _CORBA_Unbounded_Sequence< AttributeConfig_2 > ::operator=(_s); return *this; } }; class AttributeConfigList_2_out; class AttributeConfigList_2_var { public: inline AttributeConfigList_2_var() : _pd_seq(0) {} inline AttributeConfigList_2_var(AttributeConfigList_2* _s) : _pd_seq(_s) {} inline AttributeConfigList_2_var(const AttributeConfigList_2_var& _s) { if( _s._pd_seq ) _pd_seq = new AttributeConfigList_2(*_s._pd_seq); else _pd_seq = 0; } inline ~AttributeConfigList_2_var() { if( _pd_seq ) delete _pd_seq; } inline AttributeConfigList_2_var& operator = (AttributeConfigList_2* _s) { if( _pd_seq ) delete _pd_seq; _pd_seq = _s; return *this; } inline AttributeConfigList_2_var& operator = (const AttributeConfigList_2_var& _s) { if( _s._pd_seq ) { if( !_pd_seq ) _pd_seq = new AttributeConfigList_2; *_pd_seq = *_s._pd_seq; } else if( _pd_seq ) { delete _pd_seq; _pd_seq = 0; } return *this; } inline AttributeConfig_2& operator [] (_CORBA_ULong _s) { return (*_pd_seq)[_s]; } inline AttributeConfigList_2* operator -> () { return _pd_seq; } inline const AttributeConfigList_2* operator -> () const { return _pd_seq; } #if defined(__GNUG__) inline operator AttributeConfigList_2& () const { return *_pd_seq; } #else inline operator const AttributeConfigList_2& () const { return *_pd_seq; } inline operator AttributeConfigList_2& () { return *_pd_seq; } #endif inline const AttributeConfigList_2& in() const { return *_pd_seq; } inline AttributeConfigList_2& inout() { return *_pd_seq; } inline AttributeConfigList_2*& out() { if( _pd_seq ) { delete _pd_seq; _pd_seq = 0; } return _pd_seq; } inline AttributeConfigList_2* _retn() { AttributeConfigList_2* tmp = _pd_seq; _pd_seq = 0; return tmp; } friend class AttributeConfigList_2_out; private: AttributeConfigList_2* _pd_seq; }; class AttributeConfigList_2_out { public: inline AttributeConfigList_2_out(AttributeConfigList_2*& _s) : _data(_s) { _data = 0; } inline AttributeConfigList_2_out(AttributeConfigList_2_var& _s) : _data(_s._pd_seq) { _s = (AttributeConfigList_2*) 0; } inline AttributeConfigList_2_out(const AttributeConfigList_2_out& _s) : _data(_s._data) {} inline AttributeConfigList_2_out& operator = (const AttributeConfigList_2_out& _s) { _data = _s._data; return *this; } inline AttributeConfigList_2_out& operator = (AttributeConfigList_2* _s) { _data = _s; return *this; } inline operator AttributeConfigList_2*&() { return _data; } inline AttributeConfigList_2*& ptr() { return _data; } inline AttributeConfigList_2* operator->() { return _data; } inline AttributeConfig_2& operator [] (_CORBA_ULong _i) { return (*_data)[_i]; } AttributeConfigList_2*& _data; private: AttributeConfigList_2_out(); AttributeConfigList_2_out& operator=(const AttributeConfigList_2_var&); }; _CORBA_MODULE_VAR _dyn_attr const ::CORBA::TypeCode_ptr _tc_AttributeConfigList_3; class AttributeConfigList_3_var; class AttributeConfigList_3 : public _CORBA_Unbounded_Sequence< AttributeConfig_3 > { public: typedef AttributeConfigList_3_var _var_type; inline AttributeConfigList_3() {} inline AttributeConfigList_3(const AttributeConfigList_3& _s) : _CORBA_Unbounded_Sequence< AttributeConfig_3 > (_s) {} inline AttributeConfigList_3(_CORBA_ULong _max) : _CORBA_Unbounded_Sequence< AttributeConfig_3 > (_max) {} inline AttributeConfigList_3(_CORBA_ULong _max, _CORBA_ULong _len, AttributeConfig_3* _val, _CORBA_Boolean _rel=0) : _CORBA_Unbounded_Sequence< AttributeConfig_3 > (_max, _len, _val, _rel) {} inline AttributeConfigList_3& operator = (const AttributeConfigList_3& _s) { _CORBA_Unbounded_Sequence< AttributeConfig_3 > ::operator=(_s); return *this; } }; class AttributeConfigList_3_out; class AttributeConfigList_3_var { public: inline AttributeConfigList_3_var() : _pd_seq(0) {} inline AttributeConfigList_3_var(AttributeConfigList_3* _s) : _pd_seq(_s) {} inline AttributeConfigList_3_var(const AttributeConfigList_3_var& _s) { if( _s._pd_seq ) _pd_seq = new AttributeConfigList_3(*_s._pd_seq); else _pd_seq = 0; } inline ~AttributeConfigList_3_var() { if( _pd_seq ) delete _pd_seq; } inline AttributeConfigList_3_var& operator = (AttributeConfigList_3* _s) { if( _pd_seq ) delete _pd_seq; _pd_seq = _s; return *this; } inline AttributeConfigList_3_var& operator = (const AttributeConfigList_3_var& _s) { if( _s._pd_seq ) { if( !_pd_seq ) _pd_seq = new AttributeConfigList_3; *_pd_seq = *_s._pd_seq; } else if( _pd_seq ) { delete _pd_seq; _pd_seq = 0; } return *this; } inline AttributeConfig_3& operator [] (_CORBA_ULong _s) { return (*_pd_seq)[_s]; } inline AttributeConfigList_3* operator -> () { return _pd_seq; } inline const AttributeConfigList_3* operator -> () const { return _pd_seq; } #if defined(__GNUG__) inline operator AttributeConfigList_3& () const { return *_pd_seq; } #else inline operator const AttributeConfigList_3& () const { return *_pd_seq; } inline operator AttributeConfigList_3& () { return *_pd_seq; } #endif inline const AttributeConfigList_3& in() const { return *_pd_seq; } inline AttributeConfigList_3& inout() { return *_pd_seq; } inline AttributeConfigList_3*& out() { if( _pd_seq ) { delete _pd_seq; _pd_seq = 0; } return _pd_seq; } inline AttributeConfigList_3* _retn() { AttributeConfigList_3* tmp = _pd_seq; _pd_seq = 0; return tmp; } friend class AttributeConfigList_3_out; private: AttributeConfigList_3* _pd_seq; }; class AttributeConfigList_3_out { public: inline AttributeConfigList_3_out(AttributeConfigList_3*& _s) : _data(_s) { _data = 0; } inline AttributeConfigList_3_out(AttributeConfigList_3_var& _s) : _data(_s._pd_seq) { _s = (AttributeConfigList_3*) 0; } inline AttributeConfigList_3_out(const AttributeConfigList_3_out& _s) : _data(_s._data) {} inline AttributeConfigList_3_out& operator = (const AttributeConfigList_3_out& _s) { _data = _s._data; return *this; } inline AttributeConfigList_3_out& operator = (AttributeConfigList_3* _s) { _data = _s; return *this; } inline operator AttributeConfigList_3*&() { return _data; } inline AttributeConfigList_3*& ptr() { return _data; } inline AttributeConfigList_3* operator->() { return _data; } inline AttributeConfig_3& operator [] (_CORBA_ULong _i) { return (*_data)[_i]; } AttributeConfigList_3*& _data; private: AttributeConfigList_3_out(); AttributeConfigList_3_out& operator=(const AttributeConfigList_3_var&); }; _CORBA_MODULE_VAR _dyn_attr const ::CORBA::TypeCode_ptr _tc_AttributeValueList; class AttributeValueList_var; class AttributeValueList : public _CORBA_Unbounded_Sequence< AttributeValue > { public: typedef AttributeValueList_var _var_type; inline AttributeValueList() {} inline AttributeValueList(const AttributeValueList& _s) : _CORBA_Unbounded_Sequence< AttributeValue > (_s) {} inline AttributeValueList(_CORBA_ULong _max) : _CORBA_Unbounded_Sequence< AttributeValue > (_max) {} inline AttributeValueList(_CORBA_ULong _max, _CORBA_ULong _len, AttributeValue* _val, _CORBA_Boolean _rel=0) : _CORBA_Unbounded_Sequence< AttributeValue > (_max, _len, _val, _rel) {} inline AttributeValueList& operator = (const AttributeValueList& _s) { _CORBA_Unbounded_Sequence< AttributeValue > ::operator=(_s); return *this; } }; class AttributeValueList_out; class AttributeValueList_var { public: inline AttributeValueList_var() : _pd_seq(0) {} inline AttributeValueList_var(AttributeValueList* _s) : _pd_seq(_s) {} inline AttributeValueList_var(const AttributeValueList_var& _s) { if( _s._pd_seq ) _pd_seq = new AttributeValueList(*_s._pd_seq); else _pd_seq = 0; } inline ~AttributeValueList_var() { if( _pd_seq ) delete _pd_seq; } inline AttributeValueList_var& operator = (AttributeValueList* _s) { if( _pd_seq ) delete _pd_seq; _pd_seq = _s; return *this; } inline AttributeValueList_var& operator = (const AttributeValueList_var& _s) { if( _s._pd_seq ) { if( !_pd_seq ) _pd_seq = new AttributeValueList; *_pd_seq = *_s._pd_seq; } else if( _pd_seq ) { delete _pd_seq; _pd_seq = 0; } return *this; } inline AttributeValue& operator [] (_CORBA_ULong _s) { return (*_pd_seq)[_s]; } inline AttributeValueList* operator -> () { return _pd_seq; } inline const AttributeValueList* operator -> () const { return _pd_seq; } #if defined(__GNUG__) inline operator AttributeValueList& () const { return *_pd_seq; } #else inline operator const AttributeValueList& () const { return *_pd_seq; } inline operator AttributeValueList& () { return *_pd_seq; } #endif inline const AttributeValueList& in() const { return *_pd_seq; } inline AttributeValueList& inout() { return *_pd_seq; } inline AttributeValueList*& out() { if( _pd_seq ) { delete _pd_seq; _pd_seq = 0; } return _pd_seq; } inline AttributeValueList* _retn() { AttributeValueList* tmp = _pd_seq; _pd_seq = 0; return tmp; } friend class AttributeValueList_out; private: AttributeValueList* _pd_seq; }; class AttributeValueList_out { public: inline AttributeValueList_out(AttributeValueList*& _s) : _data(_s) { _data = 0; } inline AttributeValueList_out(AttributeValueList_var& _s) : _data(_s._pd_seq) { _s = (AttributeValueList*) 0; } inline AttributeValueList_out(const AttributeValueList_out& _s) : _data(_s._data) {} inline AttributeValueList_out& operator = (const AttributeValueList_out& _s) { _data = _s._data; return *this; } inline AttributeValueList_out& operator = (AttributeValueList* _s) { _data = _s; return *this; } inline operator AttributeValueList*&() { return _data; } inline AttributeValueList*& ptr() { return _data; } inline AttributeValueList* operator->() { return _data; } inline AttributeValue& operator [] (_CORBA_ULong _i) { return (*_data)[_i]; } AttributeValueList*& _data; private: AttributeValueList_out(); AttributeValueList_out& operator=(const AttributeValueList_var&); }; _CORBA_MODULE_VAR _dyn_attr const ::CORBA::TypeCode_ptr _tc_AttributeValueList_3; class AttributeValueList_3_var; class AttributeValueList_3 : public _CORBA_Unbounded_Sequence< AttributeValue_3 > { public: typedef AttributeValueList_3_var _var_type; inline AttributeValueList_3() {} inline AttributeValueList_3(const AttributeValueList_3& _s) : _CORBA_Unbounded_Sequence< AttributeValue_3 > (_s) {} inline AttributeValueList_3(_CORBA_ULong _max) : _CORBA_Unbounded_Sequence< AttributeValue_3 > (_max) {} inline AttributeValueList_3(_CORBA_ULong _max, _CORBA_ULong _len, AttributeValue_3* _val, _CORBA_Boolean _rel=0) : _CORBA_Unbounded_Sequence< AttributeValue_3 > (_max, _len, _val, _rel) {} inline AttributeValueList_3& operator = (const AttributeValueList_3& _s) { _CORBA_Unbounded_Sequence< AttributeValue_3 > ::operator=(_s); return *this; } }; class AttributeValueList_3_out; class AttributeValueList_3_var { public: inline AttributeValueList_3_var() : _pd_seq(0) {} inline AttributeValueList_3_var(AttributeValueList_3* _s) : _pd_seq(_s) {} inline AttributeValueList_3_var(const AttributeValueList_3_var& _s) { if( _s._pd_seq ) _pd_seq = new AttributeValueList_3(*_s._pd_seq); else _pd_seq = 0; } inline ~AttributeValueList_3_var() { if( _pd_seq ) delete _pd_seq; } inline AttributeValueList_3_var& operator = (AttributeValueList_3* _s) { if( _pd_seq ) delete _pd_seq; _pd_seq = _s; return *this; } inline AttributeValueList_3_var& operator = (const AttributeValueList_3_var& _s) { if( _s._pd_seq ) { if( !_pd_seq ) _pd_seq = new AttributeValueList_3; *_pd_seq = *_s._pd_seq; } else if( _pd_seq ) { delete _pd_seq; _pd_seq = 0; } return *this; } inline AttributeValue_3& operator [] (_CORBA_ULong _s) { return (*_pd_seq)[_s]; } inline AttributeValueList_3* operator -> () { return _pd_seq; } inline const AttributeValueList_3* operator -> () const { return _pd_seq; } #if defined(__GNUG__) inline operator AttributeValueList_3& () const { return *_pd_seq; } #else inline operator const AttributeValueList_3& () const { return *_pd_seq; } inline operator AttributeValueList_3& () { return *_pd_seq; } #endif inline const AttributeValueList_3& in() const { return *_pd_seq; } inline AttributeValueList_3& inout() { return *_pd_seq; } inline AttributeValueList_3*& out() { if( _pd_seq ) { delete _pd_seq; _pd_seq = 0; } return _pd_seq; } inline AttributeValueList_3* _retn() { AttributeValueList_3* tmp = _pd_seq; _pd_seq = 0; return tmp; } friend class AttributeValueList_3_out; private: AttributeValueList_3* _pd_seq; }; class AttributeValueList_3_out { public: inline AttributeValueList_3_out(AttributeValueList_3*& _s) : _data(_s) { _data = 0; } inline AttributeValueList_3_out(AttributeValueList_3_var& _s) : _data(_s._pd_seq) { _s = (AttributeValueList_3*) 0; } inline AttributeValueList_3_out(const AttributeValueList_3_out& _s) : _data(_s._data) {} inline AttributeValueList_3_out& operator = (const AttributeValueList_3_out& _s) { _data = _s._data; return *this; } inline AttributeValueList_3_out& operator = (AttributeValueList_3* _s) { _data = _s; return *this; } inline operator AttributeValueList_3*&() { return _data; } inline AttributeValueList_3*& ptr() { return _data; } inline AttributeValueList_3* operator->() { return _data; } inline AttributeValue_3& operator [] (_CORBA_ULong _i) { return (*_data)[_i]; } AttributeValueList_3*& _data; private: AttributeValueList_3_out(); AttributeValueList_3_out& operator=(const AttributeValueList_3_var&); }; _CORBA_MODULE_VAR _dyn_attr const ::CORBA::TypeCode_ptr _tc_AttributeValueList_4; class AttributeValueList_4_var; class AttributeValueList_4 : public _CORBA_Unbounded_Sequence< AttributeValue_4 > { public: typedef AttributeValueList_4_var _var_type; inline AttributeValueList_4() {} inline AttributeValueList_4(const AttributeValueList_4& _s) : _CORBA_Unbounded_Sequence< AttributeValue_4 > (_s) {} inline AttributeValueList_4(_CORBA_ULong _max) : _CORBA_Unbounded_Sequence< AttributeValue_4 > (_max) {} inline AttributeValueList_4(_CORBA_ULong _max, _CORBA_ULong _len, AttributeValue_4* _val, _CORBA_Boolean _rel=0) : _CORBA_Unbounded_Sequence< AttributeValue_4 > (_max, _len, _val, _rel) {} inline AttributeValueList_4& operator = (const AttributeValueList_4& _s) { _CORBA_Unbounded_Sequence< AttributeValue_4 > ::operator=(_s); return *this; } }; class AttributeValueList_4_out; class AttributeValueList_4_var { public: inline AttributeValueList_4_var() : _pd_seq(0) {} inline AttributeValueList_4_var(AttributeValueList_4* _s) : _pd_seq(_s) {} inline AttributeValueList_4_var(const AttributeValueList_4_var& _s) { if( _s._pd_seq ) _pd_seq = new AttributeValueList_4(*_s._pd_seq); else _pd_seq = 0; } inline ~AttributeValueList_4_var() { if( _pd_seq ) delete _pd_seq; } inline AttributeValueList_4_var& operator = (AttributeValueList_4* _s) { if( _pd_seq ) delete _pd_seq; _pd_seq = _s; return *this; } inline AttributeValueList_4_var& operator = (const AttributeValueList_4_var& _s) { if( _s._pd_seq ) { if( !_pd_seq ) _pd_seq = new AttributeValueList_4; *_pd_seq = *_s._pd_seq; } else if( _pd_seq ) { delete _pd_seq; _pd_seq = 0; } return *this; } inline AttributeValue_4& operator [] (_CORBA_ULong _s) { return (*_pd_seq)[_s]; } inline AttributeValueList_4* operator -> () { return _pd_seq; } inline const AttributeValueList_4* operator -> () const { return _pd_seq; } #if defined(__GNUG__) inline operator AttributeValueList_4& () const { return *_pd_seq; } #else inline operator const AttributeValueList_4& () const { return *_pd_seq; } inline operator AttributeValueList_4& () { return *_pd_seq; } #endif inline const AttributeValueList_4& in() const { return *_pd_seq; } inline AttributeValueList_4& inout() { return *_pd_seq; } inline AttributeValueList_4*& out() { if( _pd_seq ) { delete _pd_seq; _pd_seq = 0; } return _pd_seq; } inline AttributeValueList_4* _retn() { AttributeValueList_4* tmp = _pd_seq; _pd_seq = 0; return tmp; } friend class AttributeValueList_4_out; private: AttributeValueList_4* _pd_seq; }; class AttributeValueList_4_out { public: inline AttributeValueList_4_out(AttributeValueList_4*& _s) : _data(_s) { _data = 0; } inline AttributeValueList_4_out(AttributeValueList_4_var& _s) : _data(_s._pd_seq) { _s = (AttributeValueList_4*) 0; } inline AttributeValueList_4_out(const AttributeValueList_4_out& _s) : _data(_s._data) {} inline AttributeValueList_4_out& operator = (const AttributeValueList_4_out& _s) { _data = _s._data; return *this; } inline AttributeValueList_4_out& operator = (AttributeValueList_4* _s) { _data = _s; return *this; } inline operator AttributeValueList_4*&() { return _data; } inline AttributeValueList_4*& ptr() { return _data; } inline AttributeValueList_4* operator->() { return _data; } inline AttributeValue_4& operator [] (_CORBA_ULong _i) { return (*_data)[_i]; } AttributeValueList_4*& _data; private: AttributeValueList_4_out(); AttributeValueList_4_out& operator=(const AttributeValueList_4_var&); }; struct AttDataReady { typedef _CORBA_ConstrType_Variable_Var _var_type; ::CORBA::String_member name; ::CORBA::Long data_type; ::CORBA::Long ctr; void operator>>= (cdrStream &) const; void operator<<= (cdrStream &); }; typedef AttDataReady::_var_type AttDataReady_var; typedef _CORBA_ConstrType_Variable_OUT_arg< AttDataReady,AttDataReady_var > AttDataReady_out; _CORBA_MODULE_VAR _dyn_attr const ::CORBA::TypeCode_ptr _tc_AttDataReady; struct DevInfo { typedef _CORBA_ConstrType_Variable_Var _var_type; ::CORBA::String_member dev_class; ::CORBA::String_member server_id; ::CORBA::String_member server_host; ::CORBA::Long server_version; ::CORBA::String_member doc_url; void operator>>= (cdrStream &) const; void operator<<= (cdrStream &); }; typedef DevInfo::_var_type DevInfo_var; typedef _CORBA_ConstrType_Variable_OUT_arg< DevInfo,DevInfo_var > DevInfo_out; _CORBA_MODULE_VAR _dyn_attr const ::CORBA::TypeCode_ptr _tc_DevInfo; struct DevInfo_3 { typedef _CORBA_ConstrType_Variable_Var _var_type; ::CORBA::String_member dev_class; ::CORBA::String_member server_id; ::CORBA::String_member server_host; ::CORBA::Long server_version; ::CORBA::String_member doc_url; ::CORBA::String_member dev_type; void operator>>= (cdrStream &) const; void operator<<= (cdrStream &); }; typedef DevInfo_3::_var_type DevInfo_3_var; typedef _CORBA_ConstrType_Variable_OUT_arg< DevInfo_3,DevInfo_3_var > DevInfo_3_out; _CORBA_MODULE_VAR _dyn_attr const ::CORBA::TypeCode_ptr _tc_DevInfo_3; struct DevCmdHistory { typedef _CORBA_ConstrType_Variable_Var _var_type; TimeVal time; ::CORBA::Boolean cmd_failed; ::CORBA::Any value; DevErrorList errors; void operator>>= (cdrStream &) const; void operator<<= (cdrStream &); }; typedef DevCmdHistory::_var_type DevCmdHistory_var; typedef _CORBA_ConstrType_Variable_OUT_arg< DevCmdHistory,DevCmdHistory_var > DevCmdHistory_out; _CORBA_MODULE_VAR _dyn_attr const ::CORBA::TypeCode_ptr _tc_DevCmdHistory; _CORBA_MODULE_VAR _dyn_attr const ::CORBA::TypeCode_ptr _tc_DevCmdHistoryList; class DevCmdHistoryList_var; class DevCmdHistoryList : public _CORBA_Unbounded_Sequence< DevCmdHistory > { public: typedef DevCmdHistoryList_var _var_type; inline DevCmdHistoryList() {} inline DevCmdHistoryList(const DevCmdHistoryList& _s) : _CORBA_Unbounded_Sequence< DevCmdHistory > (_s) {} inline DevCmdHistoryList(_CORBA_ULong _max) : _CORBA_Unbounded_Sequence< DevCmdHistory > (_max) {} inline DevCmdHistoryList(_CORBA_ULong _max, _CORBA_ULong _len, DevCmdHistory* _val, _CORBA_Boolean _rel=0) : _CORBA_Unbounded_Sequence< DevCmdHistory > (_max, _len, _val, _rel) {} inline DevCmdHistoryList& operator = (const DevCmdHistoryList& _s) { _CORBA_Unbounded_Sequence< DevCmdHistory > ::operator=(_s); return *this; } }; class DevCmdHistoryList_out; class DevCmdHistoryList_var { public: inline DevCmdHistoryList_var() : _pd_seq(0) {} inline DevCmdHistoryList_var(DevCmdHistoryList* _s) : _pd_seq(_s) {} inline DevCmdHistoryList_var(const DevCmdHistoryList_var& _s) { if( _s._pd_seq ) _pd_seq = new DevCmdHistoryList(*_s._pd_seq); else _pd_seq = 0; } inline ~DevCmdHistoryList_var() { if( _pd_seq ) delete _pd_seq; } inline DevCmdHistoryList_var& operator = (DevCmdHistoryList* _s) { if( _pd_seq ) delete _pd_seq; _pd_seq = _s; return *this; } inline DevCmdHistoryList_var& operator = (const DevCmdHistoryList_var& _s) { if( _s._pd_seq ) { if( !_pd_seq ) _pd_seq = new DevCmdHistoryList; *_pd_seq = *_s._pd_seq; } else if( _pd_seq ) { delete _pd_seq; _pd_seq = 0; } return *this; } inline DevCmdHistory& operator [] (_CORBA_ULong _s) { return (*_pd_seq)[_s]; } inline DevCmdHistoryList* operator -> () { return _pd_seq; } inline const DevCmdHistoryList* operator -> () const { return _pd_seq; } #if defined(__GNUG__) inline operator DevCmdHistoryList& () const { return *_pd_seq; } #else inline operator const DevCmdHistoryList& () const { return *_pd_seq; } inline operator DevCmdHistoryList& () { return *_pd_seq; } #endif inline const DevCmdHistoryList& in() const { return *_pd_seq; } inline DevCmdHistoryList& inout() { return *_pd_seq; } inline DevCmdHistoryList*& out() { if( _pd_seq ) { delete _pd_seq; _pd_seq = 0; } return _pd_seq; } inline DevCmdHistoryList* _retn() { DevCmdHistoryList* tmp = _pd_seq; _pd_seq = 0; return tmp; } friend class DevCmdHistoryList_out; private: DevCmdHistoryList* _pd_seq; }; class DevCmdHistoryList_out { public: inline DevCmdHistoryList_out(DevCmdHistoryList*& _s) : _data(_s) { _data = 0; } inline DevCmdHistoryList_out(DevCmdHistoryList_var& _s) : _data(_s._pd_seq) { _s = (DevCmdHistoryList*) 0; } inline DevCmdHistoryList_out(const DevCmdHistoryList_out& _s) : _data(_s._data) {} inline DevCmdHistoryList_out& operator = (const DevCmdHistoryList_out& _s) { _data = _s._data; return *this; } inline DevCmdHistoryList_out& operator = (DevCmdHistoryList* _s) { _data = _s; return *this; } inline operator DevCmdHistoryList*&() { return _data; } inline DevCmdHistoryList*& ptr() { return _data; } inline DevCmdHistoryList* operator->() { return _data; } inline DevCmdHistory& operator [] (_CORBA_ULong _i) { return (*_data)[_i]; } DevCmdHistoryList*& _data; private: DevCmdHistoryList_out(); DevCmdHistoryList_out& operator=(const DevCmdHistoryList_var&); }; struct DevAttrHistory { typedef _CORBA_ConstrType_Variable_Var _var_type; ::CORBA::Boolean attr_failed; AttributeValue value; DevErrorList errors; void operator>>= (cdrStream &) const; void operator<<= (cdrStream &); }; typedef DevAttrHistory::_var_type DevAttrHistory_var; typedef _CORBA_ConstrType_Variable_OUT_arg< DevAttrHistory,DevAttrHistory_var > DevAttrHistory_out; _CORBA_MODULE_VAR _dyn_attr const ::CORBA::TypeCode_ptr _tc_DevAttrHistory; struct DevAttrHistory_3 { typedef _CORBA_ConstrType_Variable_Var _var_type; ::CORBA::Boolean attr_failed; AttributeValue_3 value; void operator>>= (cdrStream &) const; void operator<<= (cdrStream &); }; typedef DevAttrHistory_3::_var_type DevAttrHistory_3_var; typedef _CORBA_ConstrType_Variable_OUT_arg< DevAttrHistory_3,DevAttrHistory_3_var > DevAttrHistory_3_out; _CORBA_MODULE_VAR _dyn_attr const ::CORBA::TypeCode_ptr _tc_DevAttrHistory_3; struct EltInArray { typedef _CORBA_ConstrType_Fix_Var _var_type; ::CORBA::Long start; ::CORBA::Long nb_elt; void operator>>= (cdrStream &) const; void operator<<= (cdrStream &); }; typedef EltInArray::_var_type EltInArray_var; typedef EltInArray& EltInArray_out; _CORBA_MODULE_VAR _dyn_attr const ::CORBA::TypeCode_ptr _tc_EltInArray; _CORBA_MODULE_VAR _dyn_attr const ::CORBA::TypeCode_ptr _tc_EltInArrayList; class EltInArrayList_var; class EltInArrayList : public _CORBA_Unbounded_Sequence< EltInArray > { public: typedef EltInArrayList_var _var_type; inline EltInArrayList() {} inline EltInArrayList(const EltInArrayList& _s) : _CORBA_Unbounded_Sequence< EltInArray > (_s) {} inline EltInArrayList(_CORBA_ULong _max) : _CORBA_Unbounded_Sequence< EltInArray > (_max) {} inline EltInArrayList(_CORBA_ULong _max, _CORBA_ULong _len, EltInArray* _val, _CORBA_Boolean _rel=0) : _CORBA_Unbounded_Sequence< EltInArray > (_max, _len, _val, _rel) {} inline EltInArrayList& operator = (const EltInArrayList& _s) { _CORBA_Unbounded_Sequence< EltInArray > ::operator=(_s); return *this; } }; class EltInArrayList_out; class EltInArrayList_var { public: inline EltInArrayList_var() : _pd_seq(0) {} inline EltInArrayList_var(EltInArrayList* _s) : _pd_seq(_s) {} inline EltInArrayList_var(const EltInArrayList_var& _s) { if( _s._pd_seq ) _pd_seq = new EltInArrayList(*_s._pd_seq); else _pd_seq = 0; } inline ~EltInArrayList_var() { if( _pd_seq ) delete _pd_seq; } inline EltInArrayList_var& operator = (EltInArrayList* _s) { if( _pd_seq ) delete _pd_seq; _pd_seq = _s; return *this; } inline EltInArrayList_var& operator = (const EltInArrayList_var& _s) { if( _s._pd_seq ) { if( !_pd_seq ) _pd_seq = new EltInArrayList; *_pd_seq = *_s._pd_seq; } else if( _pd_seq ) { delete _pd_seq; _pd_seq = 0; } return *this; } inline EltInArray& operator [] (_CORBA_ULong _s) { return (*_pd_seq)[_s]; } inline EltInArrayList* operator -> () { return _pd_seq; } inline const EltInArrayList* operator -> () const { return _pd_seq; } #if defined(__GNUG__) inline operator EltInArrayList& () const { return *_pd_seq; } #else inline operator const EltInArrayList& () const { return *_pd_seq; } inline operator EltInArrayList& () { return *_pd_seq; } #endif inline const EltInArrayList& in() const { return *_pd_seq; } inline EltInArrayList& inout() { return *_pd_seq; } inline EltInArrayList*& out() { if( _pd_seq ) { delete _pd_seq; _pd_seq = 0; } return _pd_seq; } inline EltInArrayList* _retn() { EltInArrayList* tmp = _pd_seq; _pd_seq = 0; return tmp; } friend class EltInArrayList_out; private: EltInArrayList* _pd_seq; }; class EltInArrayList_out { public: inline EltInArrayList_out(EltInArrayList*& _s) : _data(_s) { _data = 0; } inline EltInArrayList_out(EltInArrayList_var& _s) : _data(_s._pd_seq) { _s = (EltInArrayList*) 0; } inline EltInArrayList_out(const EltInArrayList_out& _s) : _data(_s._data) {} inline EltInArrayList_out& operator = (const EltInArrayList_out& _s) { _data = _s._data; return *this; } inline EltInArrayList_out& operator = (EltInArrayList* _s) { _data = _s; return *this; } inline operator EltInArrayList*&() { return _data; } inline EltInArrayList*& ptr() { return _data; } inline EltInArrayList* operator->() { return _data; } inline EltInArray& operator [] (_CORBA_ULong _i) { return (*_data)[_i]; } EltInArrayList*& _data; private: EltInArrayList_out(); EltInArrayList_out& operator=(const EltInArrayList_var&); }; _CORBA_MODULE_VAR _dyn_attr const ::CORBA::TypeCode_ptr _tc_TimeValList; class TimeValList_var; class TimeValList : public _CORBA_Unbounded_Sequence< TimeVal > { public: typedef TimeValList_var _var_type; inline TimeValList() {} inline TimeValList(const TimeValList& _s) : _CORBA_Unbounded_Sequence< TimeVal > (_s) {} inline TimeValList(_CORBA_ULong _max) : _CORBA_Unbounded_Sequence< TimeVal > (_max) {} inline TimeValList(_CORBA_ULong _max, _CORBA_ULong _len, TimeVal* _val, _CORBA_Boolean _rel=0) : _CORBA_Unbounded_Sequence< TimeVal > (_max, _len, _val, _rel) {} inline TimeValList& operator = (const TimeValList& _s) { _CORBA_Unbounded_Sequence< TimeVal > ::operator=(_s); return *this; } }; class TimeValList_out; class TimeValList_var { public: inline TimeValList_var() : _pd_seq(0) {} inline TimeValList_var(TimeValList* _s) : _pd_seq(_s) {} inline TimeValList_var(const TimeValList_var& _s) { if( _s._pd_seq ) _pd_seq = new TimeValList(*_s._pd_seq); else _pd_seq = 0; } inline ~TimeValList_var() { if( _pd_seq ) delete _pd_seq; } inline TimeValList_var& operator = (TimeValList* _s) { if( _pd_seq ) delete _pd_seq; _pd_seq = _s; return *this; } inline TimeValList_var& operator = (const TimeValList_var& _s) { if( _s._pd_seq ) { if( !_pd_seq ) _pd_seq = new TimeValList; *_pd_seq = *_s._pd_seq; } else if( _pd_seq ) { delete _pd_seq; _pd_seq = 0; } return *this; } inline TimeVal& operator [] (_CORBA_ULong _s) { return (*_pd_seq)[_s]; } inline TimeValList* operator -> () { return _pd_seq; } inline const TimeValList* operator -> () const { return _pd_seq; } #if defined(__GNUG__) inline operator TimeValList& () const { return *_pd_seq; } #else inline operator const TimeValList& () const { return *_pd_seq; } inline operator TimeValList& () { return *_pd_seq; } #endif inline const TimeValList& in() const { return *_pd_seq; } inline TimeValList& inout() { return *_pd_seq; } inline TimeValList*& out() { if( _pd_seq ) { delete _pd_seq; _pd_seq = 0; } return _pd_seq; } inline TimeValList* _retn() { TimeValList* tmp = _pd_seq; _pd_seq = 0; return tmp; } friend class TimeValList_out; private: TimeValList* _pd_seq; }; class TimeValList_out { public: inline TimeValList_out(TimeValList*& _s) : _data(_s) { _data = 0; } inline TimeValList_out(TimeValList_var& _s) : _data(_s._pd_seq) { _s = (TimeValList*) 0; } inline TimeValList_out(const TimeValList_out& _s) : _data(_s._data) {} inline TimeValList_out& operator = (const TimeValList_out& _s) { _data = _s._data; return *this; } inline TimeValList_out& operator = (TimeValList* _s) { _data = _s; return *this; } inline operator TimeValList*&() { return _data; } inline TimeValList*& ptr() { return _data; } inline TimeValList* operator->() { return _data; } inline TimeVal& operator [] (_CORBA_ULong _i) { return (*_data)[_i]; } TimeValList*& _data; private: TimeValList_out(); TimeValList_out& operator=(const TimeValList_var&); }; _CORBA_MODULE_VAR _dyn_attr const ::CORBA::TypeCode_ptr _tc_AttrQualityList; // Need to declare <<= for elem type, as GCC expands templates early #if defined(__GNUG__) && __GNUG__ == 2 && __GNUC_MINOR__ == 7 friend inline void operator >>= (AttrQuality, cdrStream&); friend inline void operator <<= (AttrQuality&, cdrStream&); #endif class AttrQualityList_var; class AttrQualityList : public _CORBA_Unbounded_Sequence_w_FixSizeElement< AttrQuality, 4, 4 > { public: typedef AttrQualityList_var _var_type; inline AttrQualityList() {} inline AttrQualityList(const AttrQualityList& _s) : _CORBA_Unbounded_Sequence_w_FixSizeElement< AttrQuality, 4, 4 > (_s) {} inline AttrQualityList(_CORBA_ULong _max) : _CORBA_Unbounded_Sequence_w_FixSizeElement< AttrQuality, 4, 4 > (_max) {} inline AttrQualityList(_CORBA_ULong _max, _CORBA_ULong _len, AttrQuality* _val, _CORBA_Boolean _rel=0) : _CORBA_Unbounded_Sequence_w_FixSizeElement< AttrQuality, 4, 4 > (_max, _len, _val, _rel) {} inline AttrQualityList& operator = (const AttrQualityList& _s) { _CORBA_Unbounded_Sequence_w_FixSizeElement< AttrQuality, 4, 4 > ::operator=(_s); return *this; } }; class AttrQualityList_out; class AttrQualityList_var { public: inline AttrQualityList_var() : _pd_seq(0) {} inline AttrQualityList_var(AttrQualityList* _s) : _pd_seq(_s) {} inline AttrQualityList_var(const AttrQualityList_var& _s) { if( _s._pd_seq ) _pd_seq = new AttrQualityList(*_s._pd_seq); else _pd_seq = 0; } inline ~AttrQualityList_var() { if( _pd_seq ) delete _pd_seq; } inline AttrQualityList_var& operator = (AttrQualityList* _s) { if( _pd_seq ) delete _pd_seq; _pd_seq = _s; return *this; } inline AttrQualityList_var& operator = (const AttrQualityList_var& _s) { if( _s._pd_seq ) { if( !_pd_seq ) _pd_seq = new AttrQualityList; *_pd_seq = *_s._pd_seq; } else if( _pd_seq ) { delete _pd_seq; _pd_seq = 0; } return *this; } inline AttrQuality& operator [] (_CORBA_ULong _s) { return (*_pd_seq)[_s]; } inline AttrQualityList* operator -> () { return _pd_seq; } inline const AttrQualityList* operator -> () const { return _pd_seq; } #if defined(__GNUG__) inline operator AttrQualityList& () const { return *_pd_seq; } #else inline operator const AttrQualityList& () const { return *_pd_seq; } inline operator AttrQualityList& () { return *_pd_seq; } #endif inline const AttrQualityList& in() const { return *_pd_seq; } inline AttrQualityList& inout() { return *_pd_seq; } inline AttrQualityList*& out() { if( _pd_seq ) { delete _pd_seq; _pd_seq = 0; } return _pd_seq; } inline AttrQualityList* _retn() { AttrQualityList* tmp = _pd_seq; _pd_seq = 0; return tmp; } friend class AttrQualityList_out; private: AttrQualityList* _pd_seq; }; class AttrQualityList_out { public: inline AttrQualityList_out(AttrQualityList*& _s) : _data(_s) { _data = 0; } inline AttrQualityList_out(AttrQualityList_var& _s) : _data(_s._pd_seq) { _s = (AttrQualityList*) 0; } inline AttrQualityList_out(const AttrQualityList_out& _s) : _data(_s._data) {} inline AttrQualityList_out& operator = (const AttrQualityList_out& _s) { _data = _s._data; return *this; } inline AttrQualityList_out& operator = (AttrQualityList* _s) { _data = _s; return *this; } inline operator AttrQualityList*&() { return _data; } inline AttrQualityList*& ptr() { return _data; } inline AttrQualityList* operator->() { return _data; } inline AttrQuality& operator [] (_CORBA_ULong _i) { return (*_data)[_i]; } AttrQualityList*& _data; private: AttrQualityList_out(); AttrQualityList_out& operator=(const AttrQualityList_var&); }; _CORBA_MODULE_VAR _dyn_attr const ::CORBA::TypeCode_ptr _tc_AttributeDimList; class AttributeDimList_var; class AttributeDimList : public _CORBA_Unbounded_Sequence< AttributeDim > { public: typedef AttributeDimList_var _var_type; inline AttributeDimList() {} inline AttributeDimList(const AttributeDimList& _s) : _CORBA_Unbounded_Sequence< AttributeDim > (_s) {} inline AttributeDimList(_CORBA_ULong _max) : _CORBA_Unbounded_Sequence< AttributeDim > (_max) {} inline AttributeDimList(_CORBA_ULong _max, _CORBA_ULong _len, AttributeDim* _val, _CORBA_Boolean _rel=0) : _CORBA_Unbounded_Sequence< AttributeDim > (_max, _len, _val, _rel) {} inline AttributeDimList& operator = (const AttributeDimList& _s) { _CORBA_Unbounded_Sequence< AttributeDim > ::operator=(_s); return *this; } }; class AttributeDimList_out; class AttributeDimList_var { public: inline AttributeDimList_var() : _pd_seq(0) {} inline AttributeDimList_var(AttributeDimList* _s) : _pd_seq(_s) {} inline AttributeDimList_var(const AttributeDimList_var& _s) { if( _s._pd_seq ) _pd_seq = new AttributeDimList(*_s._pd_seq); else _pd_seq = 0; } inline ~AttributeDimList_var() { if( _pd_seq ) delete _pd_seq; } inline AttributeDimList_var& operator = (AttributeDimList* _s) { if( _pd_seq ) delete _pd_seq; _pd_seq = _s; return *this; } inline AttributeDimList_var& operator = (const AttributeDimList_var& _s) { if( _s._pd_seq ) { if( !_pd_seq ) _pd_seq = new AttributeDimList; *_pd_seq = *_s._pd_seq; } else if( _pd_seq ) { delete _pd_seq; _pd_seq = 0; } return *this; } inline AttributeDim& operator [] (_CORBA_ULong _s) { return (*_pd_seq)[_s]; } inline AttributeDimList* operator -> () { return _pd_seq; } inline const AttributeDimList* operator -> () const { return _pd_seq; } #if defined(__GNUG__) inline operator AttributeDimList& () const { return *_pd_seq; } #else inline operator const AttributeDimList& () const { return *_pd_seq; } inline operator AttributeDimList& () { return *_pd_seq; } #endif inline const AttributeDimList& in() const { return *_pd_seq; } inline AttributeDimList& inout() { return *_pd_seq; } inline AttributeDimList*& out() { if( _pd_seq ) { delete _pd_seq; _pd_seq = 0; } return _pd_seq; } inline AttributeDimList* _retn() { AttributeDimList* tmp = _pd_seq; _pd_seq = 0; return tmp; } friend class AttributeDimList_out; private: AttributeDimList* _pd_seq; }; class AttributeDimList_out { public: inline AttributeDimList_out(AttributeDimList*& _s) : _data(_s) { _data = 0; } inline AttributeDimList_out(AttributeDimList_var& _s) : _data(_s._pd_seq) { _s = (AttributeDimList*) 0; } inline AttributeDimList_out(const AttributeDimList_out& _s) : _data(_s._data) {} inline AttributeDimList_out& operator = (const AttributeDimList_out& _s) { _data = _s._data; return *this; } inline AttributeDimList_out& operator = (AttributeDimList* _s) { _data = _s; return *this; } inline operator AttributeDimList*&() { return _data; } inline AttributeDimList*& ptr() { return _data; } inline AttributeDimList* operator->() { return _data; } inline AttributeDim& operator [] (_CORBA_ULong _i) { return (*_data)[_i]; } AttributeDimList*& _data; private: AttributeDimList_out(); AttributeDimList_out& operator=(const AttributeDimList_var&); }; _CORBA_MODULE_VAR _dyn_attr const ::CORBA::TypeCode_ptr _tc_DevErrorListList; class DevErrorListList_var; class DevErrorListList : public _CORBA_Unbounded_Sequence< DevErrorList > { public: typedef DevErrorListList_var _var_type; inline DevErrorListList() {} inline DevErrorListList(const DevErrorListList& _s) : _CORBA_Unbounded_Sequence< DevErrorList > (_s) {} inline DevErrorListList(_CORBA_ULong _max) : _CORBA_Unbounded_Sequence< DevErrorList > (_max) {} inline DevErrorListList(_CORBA_ULong _max, _CORBA_ULong _len, DevErrorList* _val, _CORBA_Boolean _rel=0) : _CORBA_Unbounded_Sequence< DevErrorList > (_max, _len, _val, _rel) {} inline DevErrorListList& operator = (const DevErrorListList& _s) { _CORBA_Unbounded_Sequence< DevErrorList > ::operator=(_s); return *this; } }; class DevErrorListList_out; class DevErrorListList_var { public: inline DevErrorListList_var() : _pd_seq(0) {} inline DevErrorListList_var(DevErrorListList* _s) : _pd_seq(_s) {} inline DevErrorListList_var(const DevErrorListList_var& _s) { if( _s._pd_seq ) _pd_seq = new DevErrorListList(*_s._pd_seq); else _pd_seq = 0; } inline ~DevErrorListList_var() { if( _pd_seq ) delete _pd_seq; } inline DevErrorListList_var& operator = (DevErrorListList* _s) { if( _pd_seq ) delete _pd_seq; _pd_seq = _s; return *this; } inline DevErrorListList_var& operator = (const DevErrorListList_var& _s) { if( _s._pd_seq ) { if( !_pd_seq ) _pd_seq = new DevErrorListList; *_pd_seq = *_s._pd_seq; } else if( _pd_seq ) { delete _pd_seq; _pd_seq = 0; } return *this; } inline DevErrorList& operator [] (_CORBA_ULong _s) { return (*_pd_seq)[_s]; } inline DevErrorListList* operator -> () { return _pd_seq; } inline const DevErrorListList* operator -> () const { return _pd_seq; } #if defined(__GNUG__) inline operator DevErrorListList& () const { return *_pd_seq; } #else inline operator const DevErrorListList& () const { return *_pd_seq; } inline operator DevErrorListList& () { return *_pd_seq; } #endif inline const DevErrorListList& in() const { return *_pd_seq; } inline DevErrorListList& inout() { return *_pd_seq; } inline DevErrorListList*& out() { if( _pd_seq ) { delete _pd_seq; _pd_seq = 0; } return _pd_seq; } inline DevErrorListList* _retn() { DevErrorListList* tmp = _pd_seq; _pd_seq = 0; return tmp; } friend class DevErrorListList_out; private: DevErrorListList* _pd_seq; }; class DevErrorListList_out { public: inline DevErrorListList_out(DevErrorListList*& _s) : _data(_s) { _data = 0; } inline DevErrorListList_out(DevErrorListList_var& _s) : _data(_s._pd_seq) { _s = (DevErrorListList*) 0; } inline DevErrorListList_out(const DevErrorListList_out& _s) : _data(_s._data) {} inline DevErrorListList_out& operator = (const DevErrorListList_out& _s) { _data = _s._data; return *this; } inline DevErrorListList_out& operator = (DevErrorListList* _s) { _data = _s; return *this; } inline operator DevErrorListList*&() { return _data; } inline DevErrorListList*& ptr() { return _data; } inline DevErrorListList* operator->() { return _data; } inline DevErrorList& operator [] (_CORBA_ULong _i) { return (*_data)[_i]; } DevErrorListList*& _data; private: DevErrorListList_out(); DevErrorListList_out& operator=(const DevErrorListList_var&); }; struct DevAttrHistory_4 { typedef _CORBA_ConstrType_Variable_Var _var_type; ::CORBA::String_member name; TimeValList dates; ::CORBA::Any value; AttrQualityList quals; EltInArrayList quals_array; AttributeDimList r_dims; EltInArrayList r_dims_array; AttributeDimList w_dims; EltInArrayList w_dims_array; DevErrorListList errors; EltInArrayList errors_array; void operator>>= (cdrStream &) const; void operator<<= (cdrStream &); }; typedef DevAttrHistory_4::_var_type DevAttrHistory_4_var; typedef _CORBA_ConstrType_Variable_OUT_arg< DevAttrHistory_4,DevAttrHistory_4_var > DevAttrHistory_4_out; _CORBA_MODULE_VAR _dyn_attr const ::CORBA::TypeCode_ptr _tc_DevAttrHistory_4; struct DevCmdHistory_4 { typedef _CORBA_ConstrType_Variable_Var _var_type; TimeValList dates; ::CORBA::Any value; AttributeDimList dims; EltInArrayList dims_array; DevErrorListList errors; EltInArrayList errors_array; ::CORBA::Long cmd_type; void operator>>= (cdrStream &) const; void operator<<= (cdrStream &); }; typedef DevCmdHistory_4::_var_type DevCmdHistory_4_var; typedef _CORBA_ConstrType_Variable_OUT_arg< DevCmdHistory_4,DevCmdHistory_4_var > DevCmdHistory_4_out; _CORBA_MODULE_VAR _dyn_attr const ::CORBA::TypeCode_ptr _tc_DevCmdHistory_4; _CORBA_MODULE_VAR _dyn_attr const ::CORBA::TypeCode_ptr _tc_DevAttrHistoryList; class DevAttrHistoryList_var; class DevAttrHistoryList : public _CORBA_Unbounded_Sequence< DevAttrHistory > { public: typedef DevAttrHistoryList_var _var_type; inline DevAttrHistoryList() {} inline DevAttrHistoryList(const DevAttrHistoryList& _s) : _CORBA_Unbounded_Sequence< DevAttrHistory > (_s) {} inline DevAttrHistoryList(_CORBA_ULong _max) : _CORBA_Unbounded_Sequence< DevAttrHistory > (_max) {} inline DevAttrHistoryList(_CORBA_ULong _max, _CORBA_ULong _len, DevAttrHistory* _val, _CORBA_Boolean _rel=0) : _CORBA_Unbounded_Sequence< DevAttrHistory > (_max, _len, _val, _rel) {} inline DevAttrHistoryList& operator = (const DevAttrHistoryList& _s) { _CORBA_Unbounded_Sequence< DevAttrHistory > ::operator=(_s); return *this; } }; class DevAttrHistoryList_out; class DevAttrHistoryList_var { public: inline DevAttrHistoryList_var() : _pd_seq(0) {} inline DevAttrHistoryList_var(DevAttrHistoryList* _s) : _pd_seq(_s) {} inline DevAttrHistoryList_var(const DevAttrHistoryList_var& _s) { if( _s._pd_seq ) _pd_seq = new DevAttrHistoryList(*_s._pd_seq); else _pd_seq = 0; } inline ~DevAttrHistoryList_var() { if( _pd_seq ) delete _pd_seq; } inline DevAttrHistoryList_var& operator = (DevAttrHistoryList* _s) { if( _pd_seq ) delete _pd_seq; _pd_seq = _s; return *this; } inline DevAttrHistoryList_var& operator = (const DevAttrHistoryList_var& _s) { if( _s._pd_seq ) { if( !_pd_seq ) _pd_seq = new DevAttrHistoryList; *_pd_seq = *_s._pd_seq; } else if( _pd_seq ) { delete _pd_seq; _pd_seq = 0; } return *this; } inline DevAttrHistory& operator [] (_CORBA_ULong _s) { return (*_pd_seq)[_s]; } inline DevAttrHistoryList* operator -> () { return _pd_seq; } inline const DevAttrHistoryList* operator -> () const { return _pd_seq; } #if defined(__GNUG__) inline operator DevAttrHistoryList& () const { return *_pd_seq; } #else inline operator const DevAttrHistoryList& () const { return *_pd_seq; } inline operator DevAttrHistoryList& () { return *_pd_seq; } #endif inline const DevAttrHistoryList& in() const { return *_pd_seq; } inline DevAttrHistoryList& inout() { return *_pd_seq; } inline DevAttrHistoryList*& out() { if( _pd_seq ) { delete _pd_seq; _pd_seq = 0; } return _pd_seq; } inline DevAttrHistoryList* _retn() { DevAttrHistoryList* tmp = _pd_seq; _pd_seq = 0; return tmp; } friend class DevAttrHistoryList_out; private: DevAttrHistoryList* _pd_seq; }; class DevAttrHistoryList_out { public: inline DevAttrHistoryList_out(DevAttrHistoryList*& _s) : _data(_s) { _data = 0; } inline DevAttrHistoryList_out(DevAttrHistoryList_var& _s) : _data(_s._pd_seq) { _s = (DevAttrHistoryList*) 0; } inline DevAttrHistoryList_out(const DevAttrHistoryList_out& _s) : _data(_s._data) {} inline DevAttrHistoryList_out& operator = (const DevAttrHistoryList_out& _s) { _data = _s._data; return *this; } inline DevAttrHistoryList_out& operator = (DevAttrHistoryList* _s) { _data = _s; return *this; } inline operator DevAttrHistoryList*&() { return _data; } inline DevAttrHistoryList*& ptr() { return _data; } inline DevAttrHistoryList* operator->() { return _data; } inline DevAttrHistory& operator [] (_CORBA_ULong _i) { return (*_data)[_i]; } DevAttrHistoryList*& _data; private: DevAttrHistoryList_out(); DevAttrHistoryList_out& operator=(const DevAttrHistoryList_var&); }; _CORBA_MODULE_VAR _dyn_attr const ::CORBA::TypeCode_ptr _tc_DevAttrHistoryList_3; class DevAttrHistoryList_3_var; class DevAttrHistoryList_3 : public _CORBA_Unbounded_Sequence< DevAttrHistory_3 > { public: typedef DevAttrHistoryList_3_var _var_type; inline DevAttrHistoryList_3() {} inline DevAttrHistoryList_3(const DevAttrHistoryList_3& _s) : _CORBA_Unbounded_Sequence< DevAttrHistory_3 > (_s) {} inline DevAttrHistoryList_3(_CORBA_ULong _max) : _CORBA_Unbounded_Sequence< DevAttrHistory_3 > (_max) {} inline DevAttrHistoryList_3(_CORBA_ULong _max, _CORBA_ULong _len, DevAttrHistory_3* _val, _CORBA_Boolean _rel=0) : _CORBA_Unbounded_Sequence< DevAttrHistory_3 > (_max, _len, _val, _rel) {} inline DevAttrHistoryList_3& operator = (const DevAttrHistoryList_3& _s) { _CORBA_Unbounded_Sequence< DevAttrHistory_3 > ::operator=(_s); return *this; } }; class DevAttrHistoryList_3_out; class DevAttrHistoryList_3_var { public: inline DevAttrHistoryList_3_var() : _pd_seq(0) {} inline DevAttrHistoryList_3_var(DevAttrHistoryList_3* _s) : _pd_seq(_s) {} inline DevAttrHistoryList_3_var(const DevAttrHistoryList_3_var& _s) { if( _s._pd_seq ) _pd_seq = new DevAttrHistoryList_3(*_s._pd_seq); else _pd_seq = 0; } inline ~DevAttrHistoryList_3_var() { if( _pd_seq ) delete _pd_seq; } inline DevAttrHistoryList_3_var& operator = (DevAttrHistoryList_3* _s) { if( _pd_seq ) delete _pd_seq; _pd_seq = _s; return *this; } inline DevAttrHistoryList_3_var& operator = (const DevAttrHistoryList_3_var& _s) { if( _s._pd_seq ) { if( !_pd_seq ) _pd_seq = new DevAttrHistoryList_3; *_pd_seq = *_s._pd_seq; } else if( _pd_seq ) { delete _pd_seq; _pd_seq = 0; } return *this; } inline DevAttrHistory_3& operator [] (_CORBA_ULong _s) { return (*_pd_seq)[_s]; } inline DevAttrHistoryList_3* operator -> () { return _pd_seq; } inline const DevAttrHistoryList_3* operator -> () const { return _pd_seq; } #if defined(__GNUG__) inline operator DevAttrHistoryList_3& () const { return *_pd_seq; } #else inline operator const DevAttrHistoryList_3& () const { return *_pd_seq; } inline operator DevAttrHistoryList_3& () { return *_pd_seq; } #endif inline const DevAttrHistoryList_3& in() const { return *_pd_seq; } inline DevAttrHistoryList_3& inout() { return *_pd_seq; } inline DevAttrHistoryList_3*& out() { if( _pd_seq ) { delete _pd_seq; _pd_seq = 0; } return _pd_seq; } inline DevAttrHistoryList_3* _retn() { DevAttrHistoryList_3* tmp = _pd_seq; _pd_seq = 0; return tmp; } friend class DevAttrHistoryList_3_out; private: DevAttrHistoryList_3* _pd_seq; }; class DevAttrHistoryList_3_out { public: inline DevAttrHistoryList_3_out(DevAttrHistoryList_3*& _s) : _data(_s) { _data = 0; } inline DevAttrHistoryList_3_out(DevAttrHistoryList_3_var& _s) : _data(_s._pd_seq) { _s = (DevAttrHistoryList_3*) 0; } inline DevAttrHistoryList_3_out(const DevAttrHistoryList_3_out& _s) : _data(_s._data) {} inline DevAttrHistoryList_3_out& operator = (const DevAttrHistoryList_3_out& _s) { _data = _s._data; return *this; } inline DevAttrHistoryList_3_out& operator = (DevAttrHistoryList_3* _s) { _data = _s; return *this; } inline operator DevAttrHistoryList_3*&() { return _data; } inline DevAttrHistoryList_3*& ptr() { return _data; } inline DevAttrHistoryList_3* operator->() { return _data; } inline DevAttrHistory_3& operator [] (_CORBA_ULong _i) { return (*_data)[_i]; } DevAttrHistoryList_3*& _data; private: DevAttrHistoryList_3_out(); DevAttrHistoryList_3_out& operator=(const DevAttrHistoryList_3_var&); }; struct ZmqCallInfo { typedef _CORBA_ConstrType_Variable_Var _var_type; ::CORBA::Long version; ::CORBA::ULong ctr; ::CORBA::String_member method_name; DevVarCharArray oid; ::CORBA::Boolean call_is_except; void operator>>= (cdrStream &) const; void operator<<= (cdrStream &); }; typedef ZmqCallInfo::_var_type ZmqCallInfo_var; typedef _CORBA_ConstrType_Variable_OUT_arg< ZmqCallInfo,ZmqCallInfo_var > ZmqCallInfo_out; _CORBA_MODULE_VAR _dyn_attr const ::CORBA::TypeCode_ptr _tc_ZmqCallInfo; #ifndef __Tango_mDevice__ #define __Tango_mDevice__ class Device; class _objref_Device; class _impl_Device; typedef _objref_Device* Device_ptr; typedef Device_ptr DeviceRef; class Device_Helper { public: typedef Device_ptr _ptr_type; static _ptr_type _nil(); static _CORBA_Boolean is_nil(_ptr_type); static void release(_ptr_type); static void duplicate(_ptr_type); static void marshalObjRef(_ptr_type, cdrStream&); static _ptr_type unmarshalObjRef(cdrStream&); }; typedef _CORBA_ObjRef_Var<_objref_Device, Device_Helper> Device_var; typedef _CORBA_ObjRef_OUT_arg<_objref_Device,Device_Helper > Device_out; #endif // interface Device class Device { public: // Declarations for this interface type. typedef Device_ptr _ptr_type; typedef Device_var _var_type; static _ptr_type _duplicate(_ptr_type); static _ptr_type _narrow(::CORBA::Object_ptr); static _ptr_type _unchecked_narrow(::CORBA::Object_ptr); static _ptr_type _nil(); static inline void _marshalObjRef(_ptr_type, cdrStream&); static inline _ptr_type _unmarshalObjRef(cdrStream& s) { omniObjRef* o = omniObjRef::_unMarshal(_PD_repoId,s); if (o) return (_ptr_type) o->_ptrToObjRef(_PD_repoId); else return _nil(); } static _core_attr const char* _PD_repoId; // Other IDL defined within this scope. }; class _objref_Device : public virtual ::CORBA::Object, public virtual omniObjRef { public: ::CORBA::Any* command_inout(const char* command, const ::CORBA::Any& argin); AttributeConfigList* get_attribute_config(const ::Tango::DevVarStringArray& names); void set_attribute_config(const ::Tango::AttributeConfigList& new_conf); AttributeValueList* read_attributes(const ::Tango::DevVarStringArray& names); void write_attributes(const ::Tango::AttributeValueList& values); void ping(); DevVarStringArray* black_box(::CORBA::Long n); DevInfo* info(); DevCmdInfoList* command_list_query(); DevCmdInfo* command_query(const char* command); char* name(); char* description(); DevState state(); char* status(); char* adm_name(); inline _objref_Device() { _PR_setobj(0); } // nil _objref_Device(omniIOR*, omniIdentity*); protected: virtual ~_objref_Device(); private: virtual void* _ptrToObjRef(const char*); _objref_Device(const _objref_Device&); _objref_Device& operator = (const _objref_Device&); // not implemented friend class Device; }; class _pof_Device : public _OMNI_NS(proxyObjectFactory) { public: inline _pof_Device() : _OMNI_NS(proxyObjectFactory)(Device::_PD_repoId) {} virtual ~_pof_Device(); virtual omniObjRef* newObjRef(omniIOR*,omniIdentity*); virtual _CORBA_Boolean is_a(const char*) const; }; class _impl_Device : public virtual omniServant { public: virtual ~_impl_Device(); virtual ::CORBA::Any* command_inout(const char* command, const ::CORBA::Any& argin) = 0; virtual AttributeConfigList* get_attribute_config(const ::Tango::DevVarStringArray& names) = 0; virtual void set_attribute_config(const ::Tango::AttributeConfigList& new_conf) = 0; virtual AttributeValueList* read_attributes(const ::Tango::DevVarStringArray& names) = 0; virtual void write_attributes(const ::Tango::AttributeValueList& values) = 0; virtual void ping() = 0; virtual DevVarStringArray* black_box(::CORBA::Long n) = 0; virtual DevInfo* info() = 0; virtual DevCmdInfoList* command_list_query() = 0; virtual DevCmdInfo* command_query(const char* command) = 0; virtual char* name() = 0; virtual char* description() = 0; virtual DevState state() = 0; virtual char* status() = 0; virtual char* adm_name() = 0; public: // Really protected, workaround for xlC virtual _CORBA_Boolean _dispatch(omniCallHandle&); private: virtual void* _ptrToInterface(const char*); virtual const char* _mostDerivedRepoId(); }; _CORBA_MODULE_VAR _dyn_attr const ::CORBA::TypeCode_ptr _tc_Device; #ifndef __Tango_mDevice__2__ #define __Tango_mDevice__2__ class Device_2; class _objref_Device_2; class _impl_Device_2; typedef _objref_Device_2* Device_2_ptr; typedef Device_2_ptr Device_2Ref; class Device_2_Helper { public: typedef Device_2_ptr _ptr_type; static _ptr_type _nil(); static _CORBA_Boolean is_nil(_ptr_type); static void release(_ptr_type); static void duplicate(_ptr_type); static void marshalObjRef(_ptr_type, cdrStream&); static _ptr_type unmarshalObjRef(cdrStream&); }; typedef _CORBA_ObjRef_Var<_objref_Device_2, Device_2_Helper> Device_2_var; typedef _CORBA_ObjRef_OUT_arg<_objref_Device_2,Device_2_Helper > Device_2_out; #endif // interface Device_2 class Device_2 { public: // Declarations for this interface type. typedef Device_2_ptr _ptr_type; typedef Device_2_var _var_type; static _ptr_type _duplicate(_ptr_type); static _ptr_type _narrow(::CORBA::Object_ptr); static _ptr_type _unchecked_narrow(::CORBA::Object_ptr); static _ptr_type _nil(); static inline void _marshalObjRef(_ptr_type, cdrStream&); static inline _ptr_type _unmarshalObjRef(cdrStream& s) { omniObjRef* o = omniObjRef::_unMarshal(_PD_repoId,s); if (o) return (_ptr_type) o->_ptrToObjRef(_PD_repoId); else return _nil(); } static _core_attr const char* _PD_repoId; // Other IDL defined within this scope. }; class _objref_Device_2 : public virtual _objref_Device { public: ::CORBA::Any* command_inout_2(const char* command, const ::CORBA::Any& argin, ::Tango::DevSource source); AttributeValueList* read_attributes_2(const ::Tango::DevVarStringArray& names, ::Tango::DevSource source); AttributeConfigList_2* get_attribute_config_2(const ::Tango::DevVarStringArray& names); DevCmdInfoList_2* command_list_query_2(); DevCmdInfo_2* command_query_2(const char* command); DevCmdHistoryList* command_inout_history_2(const char* command, ::CORBA::Long n); DevAttrHistoryList* read_attribute_history_2(const char* name, ::CORBA::Long n); inline _objref_Device_2() { _PR_setobj(0); } // nil _objref_Device_2(omniIOR*, omniIdentity*); protected: virtual ~_objref_Device_2(); private: virtual void* _ptrToObjRef(const char*); _objref_Device_2(const _objref_Device_2&); _objref_Device_2& operator = (const _objref_Device_2&); // not implemented friend class Device_2; }; class _pof_Device_2 : public _OMNI_NS(proxyObjectFactory) { public: inline _pof_Device_2() : _OMNI_NS(proxyObjectFactory)(Device_2::_PD_repoId) {} virtual ~_pof_Device_2(); virtual omniObjRef* newObjRef(omniIOR*,omniIdentity*); virtual _CORBA_Boolean is_a(const char*) const; }; class _impl_Device_2 : public virtual _impl_Device { public: virtual ~_impl_Device_2(); virtual ::CORBA::Any* command_inout_2(const char* command, const ::CORBA::Any& argin, ::Tango::DevSource source) = 0; virtual AttributeValueList* read_attributes_2(const ::Tango::DevVarStringArray& names, ::Tango::DevSource source) = 0; virtual AttributeConfigList_2* get_attribute_config_2(const ::Tango::DevVarStringArray& names) = 0; virtual DevCmdInfoList_2* command_list_query_2() = 0; virtual DevCmdInfo_2* command_query_2(const char* command) = 0; virtual DevCmdHistoryList* command_inout_history_2(const char* command, ::CORBA::Long n) = 0; virtual DevAttrHistoryList* read_attribute_history_2(const char* name, ::CORBA::Long n) = 0; public: // Really protected, workaround for xlC virtual _CORBA_Boolean _dispatch(omniCallHandle&); private: virtual void* _ptrToInterface(const char*); virtual const char* _mostDerivedRepoId(); }; _CORBA_MODULE_VAR _dyn_attr const ::CORBA::TypeCode_ptr _tc_Device_2; #ifndef __Tango_mDevice__3__ #define __Tango_mDevice__3__ class Device_3; class _objref_Device_3; class _impl_Device_3; typedef _objref_Device_3* Device_3_ptr; typedef Device_3_ptr Device_3Ref; class Device_3_Helper { public: typedef Device_3_ptr _ptr_type; static _ptr_type _nil(); static _CORBA_Boolean is_nil(_ptr_type); static void release(_ptr_type); static void duplicate(_ptr_type); static void marshalObjRef(_ptr_type, cdrStream&); static _ptr_type unmarshalObjRef(cdrStream&); }; typedef _CORBA_ObjRef_Var<_objref_Device_3, Device_3_Helper> Device_3_var; typedef _CORBA_ObjRef_OUT_arg<_objref_Device_3,Device_3_Helper > Device_3_out; #endif // interface Device_3 class Device_3 { public: // Declarations for this interface type. typedef Device_3_ptr _ptr_type; typedef Device_3_var _var_type; static _ptr_type _duplicate(_ptr_type); static _ptr_type _narrow(::CORBA::Object_ptr); static _ptr_type _unchecked_narrow(::CORBA::Object_ptr); static _ptr_type _nil(); static inline void _marshalObjRef(_ptr_type, cdrStream&); static inline _ptr_type _unmarshalObjRef(cdrStream& s) { omniObjRef* o = omniObjRef::_unMarshal(_PD_repoId,s); if (o) return (_ptr_type) o->_ptrToObjRef(_PD_repoId); else return _nil(); } static _core_attr const char* _PD_repoId; // Other IDL defined within this scope. }; class _objref_Device_3 : public virtual _objref_Device_2 { public: AttributeValueList_3* read_attributes_3(const ::Tango::DevVarStringArray& names, ::Tango::DevSource source); void write_attributes_3(const ::Tango::AttributeValueList& values); DevAttrHistoryList_3* read_attribute_history_3(const char* name, ::CORBA::Long n); DevInfo_3* info_3(); AttributeConfigList_3* get_attribute_config_3(const ::Tango::DevVarStringArray& names); void set_attribute_config_3(const ::Tango::AttributeConfigList_3& new_conf); inline _objref_Device_3() { _PR_setobj(0); } // nil _objref_Device_3(omniIOR*, omniIdentity*); protected: virtual ~_objref_Device_3(); private: virtual void* _ptrToObjRef(const char*); _objref_Device_3(const _objref_Device_3&); _objref_Device_3& operator = (const _objref_Device_3&); // not implemented friend class Device_3; }; class _pof_Device_3 : public _OMNI_NS(proxyObjectFactory) { public: inline _pof_Device_3() : _OMNI_NS(proxyObjectFactory)(Device_3::_PD_repoId) {} virtual ~_pof_Device_3(); virtual omniObjRef* newObjRef(omniIOR*,omniIdentity*); virtual _CORBA_Boolean is_a(const char*) const; }; class _impl_Device_3 : public virtual _impl_Device_2 { public: virtual ~_impl_Device_3(); virtual AttributeValueList_3* read_attributes_3(const ::Tango::DevVarStringArray& names, ::Tango::DevSource source) = 0; virtual void write_attributes_3(const ::Tango::AttributeValueList& values) = 0; virtual DevAttrHistoryList_3* read_attribute_history_3(const char* name, ::CORBA::Long n) = 0; virtual DevInfo_3* info_3() = 0; virtual AttributeConfigList_3* get_attribute_config_3(const ::Tango::DevVarStringArray& names) = 0; virtual void set_attribute_config_3(const ::Tango::AttributeConfigList_3& new_conf) = 0; public: // Really protected, workaround for xlC virtual _CORBA_Boolean _dispatch(omniCallHandle&); private: virtual void* _ptrToInterface(const char*); virtual const char* _mostDerivedRepoId(); }; _CORBA_MODULE_VAR _dyn_attr const ::CORBA::TypeCode_ptr _tc_Device_3; #ifndef __Tango_mDevice__4__ #define __Tango_mDevice__4__ class Device_4; class _objref_Device_4; class _impl_Device_4; typedef _objref_Device_4* Device_4_ptr; typedef Device_4_ptr Device_4Ref; class Device_4_Helper { public: typedef Device_4_ptr _ptr_type; static _ptr_type _nil(); static _CORBA_Boolean is_nil(_ptr_type); static void release(_ptr_type); static void duplicate(_ptr_type); static void marshalObjRef(_ptr_type, cdrStream&); static _ptr_type unmarshalObjRef(cdrStream&); }; typedef _CORBA_ObjRef_Var<_objref_Device_4, Device_4_Helper> Device_4_var; typedef _CORBA_ObjRef_OUT_arg<_objref_Device_4,Device_4_Helper > Device_4_out; #endif // interface Device_4 class Device_4 { public: // Declarations for this interface type. typedef Device_4_ptr _ptr_type; typedef Device_4_var _var_type; static _ptr_type _duplicate(_ptr_type); static _ptr_type _narrow(::CORBA::Object_ptr); static _ptr_type _unchecked_narrow(::CORBA::Object_ptr); static _ptr_type _nil(); static inline void _marshalObjRef(_ptr_type, cdrStream&); static inline _ptr_type _unmarshalObjRef(cdrStream& s) { omniObjRef* o = omniObjRef::_unMarshal(_PD_repoId,s); if (o) return (_ptr_type) o->_ptrToObjRef(_PD_repoId); else return _nil(); } static _core_attr const char* _PD_repoId; // Other IDL defined within this scope. }; class _objref_Device_4 : public virtual _objref_Device_3 { public: DevAttrHistory_4* read_attribute_history_4(const char* name, ::CORBA::Long n); DevCmdHistory_4* command_inout_history_4(const char* command, ::CORBA::Long n); ::CORBA::Any* command_inout_4(const char* command, const ::CORBA::Any& argin, ::Tango::DevSource source, const ::Tango::ClntIdent& cl_ident); AttributeValueList_4* read_attributes_4(const ::Tango::DevVarStringArray& names, ::Tango::DevSource source, const ::Tango::ClntIdent& cl_ident); void write_attributes_4(const ::Tango::AttributeValueList_4& values, const ::Tango::ClntIdent& cl_ident); void set_attribute_config_4(const ::Tango::AttributeConfigList_3& new_conf, const ::Tango::ClntIdent& cl_ident); AttributeValueList_4* write_read_attributes_4(const ::Tango::AttributeValueList_4& values, const ::Tango::ClntIdent& cl_ident); inline _objref_Device_4() { _PR_setobj(0); } // nil _objref_Device_4(omniIOR*, omniIdentity*); protected: virtual ~_objref_Device_4(); private: virtual void* _ptrToObjRef(const char*); _objref_Device_4(const _objref_Device_4&); _objref_Device_4& operator = (const _objref_Device_4&); // not implemented friend class Device_4; }; class _pof_Device_4 : public _OMNI_NS(proxyObjectFactory) { public: inline _pof_Device_4() : _OMNI_NS(proxyObjectFactory)(Device_4::_PD_repoId) {} virtual ~_pof_Device_4(); virtual omniObjRef* newObjRef(omniIOR*,omniIdentity*); virtual _CORBA_Boolean is_a(const char*) const; }; class _impl_Device_4 : public virtual _impl_Device_3 { public: virtual ~_impl_Device_4(); virtual DevAttrHistory_4* read_attribute_history_4(const char* name, ::CORBA::Long n) = 0; virtual DevCmdHistory_4* command_inout_history_4(const char* command, ::CORBA::Long n) = 0; virtual ::CORBA::Any* command_inout_4(const char* command, const ::CORBA::Any& argin, ::Tango::DevSource source, const ::Tango::ClntIdent& cl_ident) = 0; virtual AttributeValueList_4* read_attributes_4(const ::Tango::DevVarStringArray& names, ::Tango::DevSource source, const ::Tango::ClntIdent& cl_ident) = 0; virtual void write_attributes_4(const ::Tango::AttributeValueList_4& values, const ::Tango::ClntIdent& cl_ident) = 0; virtual void set_attribute_config_4(const ::Tango::AttributeConfigList_3& new_conf, const ::Tango::ClntIdent& cl_ident) = 0; virtual AttributeValueList_4* write_read_attributes_4(const ::Tango::AttributeValueList_4& values, const ::Tango::ClntIdent& cl_ident) = 0; public: // Really protected, workaround for xlC virtual _CORBA_Boolean _dispatch(omniCallHandle&); private: virtual void* _ptrToInterface(const char*); virtual const char* _mostDerivedRepoId(); }; _CORBA_MODULE_VAR _dyn_attr const ::CORBA::TypeCode_ptr _tc_Device_4; _CORBA_MODULE_END _CORBA_MODULE POA_Tango _CORBA_MODULE_BEG class Device : public virtual Tango::_impl_Device, public virtual ::PortableServer::ServantBase { public: virtual ~Device(); inline ::Tango::Device_ptr _this() { return (::Tango::Device_ptr) _do_this(::Tango::Device::_PD_repoId); } }; class Device_2 : public virtual Tango::_impl_Device_2, public virtual Device { public: virtual ~Device_2(); inline ::Tango::Device_2_ptr _this() { return (::Tango::Device_2_ptr) _do_this(::Tango::Device_2::_PD_repoId); } }; class Device_3 : public virtual Tango::_impl_Device_3, public virtual Device_2 { public: virtual ~Device_3(); inline ::Tango::Device_3_ptr _this() { return (::Tango::Device_3_ptr) _do_this(::Tango::Device_3::_PD_repoId); } }; class Device_4 : public virtual Tango::_impl_Device_4, public virtual Device_3 { public: virtual ~Device_4(); inline ::Tango::Device_4_ptr _this() { return (::Tango::Device_4_ptr) _do_this(::Tango::Device_4::_PD_repoId); } }; _CORBA_MODULE_END _CORBA_MODULE OBV_Tango _CORBA_MODULE_BEG _CORBA_MODULE_END #undef _core_attr #undef _dyn_attr void operator<<=(::CORBA::Any& _a, const Tango::DevVarBooleanArray& _s); void operator<<=(::CORBA::Any& _a, Tango::DevVarBooleanArray* _sp); _CORBA_Boolean operator>>=(const ::CORBA::Any& _a, Tango::DevVarBooleanArray*& _sp); _CORBA_Boolean operator>>=(const ::CORBA::Any& _a, const Tango::DevVarBooleanArray*& _sp); void operator<<=(::CORBA::Any& _a, const Tango::DevVarDoubleArray& _s); void operator<<=(::CORBA::Any& _a, Tango::DevVarDoubleArray* _sp); _CORBA_Boolean operator>>=(const ::CORBA::Any& _a, Tango::DevVarDoubleArray*& _sp); _CORBA_Boolean operator>>=(const ::CORBA::Any& _a, const Tango::DevVarDoubleArray*& _sp); void operator<<=(::CORBA::Any& _a, const Tango::DevVarFloatArray& _s); void operator<<=(::CORBA::Any& _a, Tango::DevVarFloatArray* _sp); _CORBA_Boolean operator>>=(const ::CORBA::Any& _a, Tango::DevVarFloatArray*& _sp); _CORBA_Boolean operator>>=(const ::CORBA::Any& _a, const Tango::DevVarFloatArray*& _sp); void operator<<=(::CORBA::Any& _a, const Tango::DevVarShortArray& _s); void operator<<=(::CORBA::Any& _a, Tango::DevVarShortArray* _sp); _CORBA_Boolean operator>>=(const ::CORBA::Any& _a, Tango::DevVarShortArray*& _sp); _CORBA_Boolean operator>>=(const ::CORBA::Any& _a, const Tango::DevVarShortArray*& _sp); void operator<<=(::CORBA::Any& _a, const Tango::DevVarLongArray& _s); void operator<<=(::CORBA::Any& _a, Tango::DevVarLongArray* _sp); _CORBA_Boolean operator>>=(const ::CORBA::Any& _a, Tango::DevVarLongArray*& _sp); _CORBA_Boolean operator>>=(const ::CORBA::Any& _a, const Tango::DevVarLongArray*& _sp); void operator<<=(::CORBA::Any& _a, const Tango::DevVarLong64Array& _s); void operator<<=(::CORBA::Any& _a, Tango::DevVarLong64Array* _sp); _CORBA_Boolean operator>>=(const ::CORBA::Any& _a, Tango::DevVarLong64Array*& _sp); _CORBA_Boolean operator>>=(const ::CORBA::Any& _a, const Tango::DevVarLong64Array*& _sp); void operator<<=(::CORBA::Any& _a, const Tango::DevVarCharArray& _s); void operator<<=(::CORBA::Any& _a, Tango::DevVarCharArray* _sp); _CORBA_Boolean operator>>=(const ::CORBA::Any& _a, Tango::DevVarCharArray*& _sp); _CORBA_Boolean operator>>=(const ::CORBA::Any& _a, const Tango::DevVarCharArray*& _sp); void operator<<=(::CORBA::Any& _a, const Tango::DevVarStringArray& _s); void operator<<=(::CORBA::Any& _a, Tango::DevVarStringArray* _sp); _CORBA_Boolean operator>>=(const ::CORBA::Any& _a, Tango::DevVarStringArray*& _sp); _CORBA_Boolean operator>>=(const ::CORBA::Any& _a, const Tango::DevVarStringArray*& _sp); void operator<<=(::CORBA::Any& _a, const Tango::DevVarUShortArray& _s); void operator<<=(::CORBA::Any& _a, Tango::DevVarUShortArray* _sp); _CORBA_Boolean operator>>=(const ::CORBA::Any& _a, Tango::DevVarUShortArray*& _sp); _CORBA_Boolean operator>>=(const ::CORBA::Any& _a, const Tango::DevVarUShortArray*& _sp); void operator<<=(::CORBA::Any& _a, const Tango::DevVarULongArray& _s); void operator<<=(::CORBA::Any& _a, Tango::DevVarULongArray* _sp); _CORBA_Boolean operator>>=(const ::CORBA::Any& _a, Tango::DevVarULongArray*& _sp); _CORBA_Boolean operator>>=(const ::CORBA::Any& _a, const Tango::DevVarULongArray*& _sp); void operator<<=(::CORBA::Any& _a, const Tango::DevVarULong64Array& _s); void operator<<=(::CORBA::Any& _a, Tango::DevVarULong64Array* _sp); _CORBA_Boolean operator>>=(const ::CORBA::Any& _a, Tango::DevVarULong64Array*& _sp); _CORBA_Boolean operator>>=(const ::CORBA::Any& _a, const Tango::DevVarULong64Array*& _sp); extern void operator<<=(::CORBA::Any& _a, const Tango::DevVarLongStringArray& _s); extern void operator<<=(::CORBA::Any& _a, Tango::DevVarLongStringArray* _sp); extern _CORBA_Boolean operator>>=(const ::CORBA::Any& _a, Tango::DevVarLongStringArray*& _sp); extern _CORBA_Boolean operator>>=(const ::CORBA::Any& _a, const Tango::DevVarLongStringArray*& _sp); extern void operator<<=(::CORBA::Any& _a, const Tango::DevVarDoubleStringArray& _s); extern void operator<<=(::CORBA::Any& _a, Tango::DevVarDoubleStringArray* _sp); extern _CORBA_Boolean operator>>=(const ::CORBA::Any& _a, Tango::DevVarDoubleStringArray*& _sp); extern _CORBA_Boolean operator>>=(const ::CORBA::Any& _a, const Tango::DevVarDoubleStringArray*& _sp); extern void operator<<=(::CORBA::Any& _a, const Tango::DevEncoded& _s); extern void operator<<=(::CORBA::Any& _a, Tango::DevEncoded* _sp); extern _CORBA_Boolean operator>>=(const ::CORBA::Any& _a, Tango::DevEncoded*& _sp); extern _CORBA_Boolean operator>>=(const ::CORBA::Any& _a, const Tango::DevEncoded*& _sp); void operator<<=(::CORBA::Any& _a, const Tango::DevVarEncodedArray& _s); void operator<<=(::CORBA::Any& _a, Tango::DevVarEncodedArray* _sp); _CORBA_Boolean operator>>=(const ::CORBA::Any& _a, Tango::DevVarEncodedArray*& _sp); _CORBA_Boolean operator>>=(const ::CORBA::Any& _a, const Tango::DevVarEncodedArray*& _sp); void operator<<=(::CORBA::Any& _a, const Tango::JavaUUID_forany& _s); _CORBA_Boolean operator>>=(const ::CORBA::Any& _a, Tango::JavaUUID_forany& _s); extern void operator<<=(::CORBA::Any& _a, const Tango::JavaClntIdent& _s); extern void operator<<=(::CORBA::Any& _a, Tango::JavaClntIdent* _sp); extern _CORBA_Boolean operator>>=(const ::CORBA::Any& _a, Tango::JavaClntIdent*& _sp); extern _CORBA_Boolean operator>>=(const ::CORBA::Any& _a, const Tango::JavaClntIdent*& _sp); inline void operator >>=(Tango::LockerLanguage _e, cdrStream& s) { ::operator>>=((::CORBA::ULong)_e, s); } inline void operator <<= (Tango::LockerLanguage& _e, cdrStream& s) { ::CORBA::ULong _0RL_e; ::operator<<=(_0RL_e,s); if (_0RL_e <= Tango::JAVA) { _e = (Tango::LockerLanguage) _0RL_e; } else { OMNIORB_THROW(MARSHAL,_OMNI_NS(MARSHAL_InvalidEnumValue), (::CORBA::CompletionStatus)s.completion()); } } void operator<<=(::CORBA::Any& _a, Tango::LockerLanguage _s); _CORBA_Boolean operator>>=(const ::CORBA::Any& _a, Tango::LockerLanguage& _s); void operator<<=(::CORBA::Any& _a, const Tango::ClntIdent& _s); void operator<<=(::CORBA::Any& _a, Tango::ClntIdent* _sp); _CORBA_Boolean operator>>=(const ::CORBA::Any& _a, const Tango::ClntIdent*& _sp); _CORBA_Boolean operator>>=(const ::CORBA::Any& _a, Tango::ClntIdent*& _sp); inline void operator >>=(Tango::AttrQuality _e, cdrStream& s) { ::operator>>=((::CORBA::ULong)_e, s); } inline void operator <<= (Tango::AttrQuality& _e, cdrStream& s) { ::CORBA::ULong _0RL_e; ::operator<<=(_0RL_e,s); if (_0RL_e <= Tango::ATTR_WARNING) { _e = (Tango::AttrQuality) _0RL_e; } else { OMNIORB_THROW(MARSHAL,_OMNI_NS(MARSHAL_InvalidEnumValue), (::CORBA::CompletionStatus)s.completion()); } } void operator<<=(::CORBA::Any& _a, Tango::AttrQuality _s); _CORBA_Boolean operator>>=(const ::CORBA::Any& _a, Tango::AttrQuality& _s); inline void operator >>=(Tango::AttrWriteType _e, cdrStream& s) { ::operator>>=((::CORBA::ULong)_e, s); } inline void operator <<= (Tango::AttrWriteType& _e, cdrStream& s) { ::CORBA::ULong _0RL_e; ::operator<<=(_0RL_e,s); if (_0RL_e <= Tango::READ_WRITE) { _e = (Tango::AttrWriteType) _0RL_e; } else { OMNIORB_THROW(MARSHAL,_OMNI_NS(MARSHAL_InvalidEnumValue), (::CORBA::CompletionStatus)s.completion()); } } void operator<<=(::CORBA::Any& _a, Tango::AttrWriteType _s); _CORBA_Boolean operator>>=(const ::CORBA::Any& _a, Tango::AttrWriteType& _s); inline void operator >>=(Tango::AttrDataFormat _e, cdrStream& s) { ::operator>>=((::CORBA::ULong)_e, s); } inline void operator <<= (Tango::AttrDataFormat& _e, cdrStream& s) { ::CORBA::ULong _0RL_e; ::operator<<=(_0RL_e,s); if (_0RL_e <= Tango::FMT_UNKNOWN) { _e = (Tango::AttrDataFormat) _0RL_e; } else { OMNIORB_THROW(MARSHAL,_OMNI_NS(MARSHAL_InvalidEnumValue), (::CORBA::CompletionStatus)s.completion()); } } void operator<<=(::CORBA::Any& _a, Tango::AttrDataFormat _s); _CORBA_Boolean operator>>=(const ::CORBA::Any& _a, Tango::AttrDataFormat& _s); inline void operator >>=(Tango::DevSource _e, cdrStream& s) { ::operator>>=((::CORBA::ULong)_e, s); } inline void operator <<= (Tango::DevSource& _e, cdrStream& s) { ::CORBA::ULong _0RL_e; ::operator<<=(_0RL_e,s); if (_0RL_e <= Tango::CACHE_DEV) { _e = (Tango::DevSource) _0RL_e; } else { OMNIORB_THROW(MARSHAL,_OMNI_NS(MARSHAL_InvalidEnumValue), (::CORBA::CompletionStatus)s.completion()); } } void operator<<=(::CORBA::Any& _a, Tango::DevSource _s); _CORBA_Boolean operator>>=(const ::CORBA::Any& _a, Tango::DevSource& _s); inline void operator >>=(Tango::ErrSeverity _e, cdrStream& s) { ::operator>>=((::CORBA::ULong)_e, s); } inline void operator <<= (Tango::ErrSeverity& _e, cdrStream& s) { ::CORBA::ULong _0RL_e; ::operator<<=(_0RL_e,s); if (_0RL_e <= Tango::PANIC) { _e = (Tango::ErrSeverity) _0RL_e; } else { OMNIORB_THROW(MARSHAL,_OMNI_NS(MARSHAL_InvalidEnumValue), (::CORBA::CompletionStatus)s.completion()); } } void operator<<=(::CORBA::Any& _a, Tango::ErrSeverity _s); _CORBA_Boolean operator>>=(const ::CORBA::Any& _a, Tango::ErrSeverity& _s); inline void operator >>=(Tango::DevState _e, cdrStream& s) { ::operator>>=((::CORBA::ULong)_e, s); } inline void operator <<= (Tango::DevState& _e, cdrStream& s) { ::CORBA::ULong _0RL_e; ::operator<<=(_0RL_e,s); if (_0RL_e <= Tango::UNKNOWN) { _e = (Tango::DevState) _0RL_e; } else { OMNIORB_THROW(MARSHAL,_OMNI_NS(MARSHAL_InvalidEnumValue), (::CORBA::CompletionStatus)s.completion()); } } void operator<<=(::CORBA::Any& _a, Tango::DevState _s); _CORBA_Boolean operator>>=(const ::CORBA::Any& _a, Tango::DevState& _s); inline void operator >>=(Tango::DispLevel _e, cdrStream& s) { ::operator>>=((::CORBA::ULong)_e, s); } inline void operator <<= (Tango::DispLevel& _e, cdrStream& s) { ::CORBA::ULong _0RL_e; ::operator<<=(_0RL_e,s); if (_0RL_e <= Tango::EXPERT) { _e = (Tango::DispLevel) _0RL_e; } else { OMNIORB_THROW(MARSHAL,_OMNI_NS(MARSHAL_InvalidEnumValue), (::CORBA::CompletionStatus)s.completion()); } } void operator<<=(::CORBA::Any& _a, Tango::DispLevel _s); _CORBA_Boolean operator>>=(const ::CORBA::Any& _a, Tango::DispLevel& _s); void operator<<=(::CORBA::Any& _a, const Tango::DevVarStateArray& _s); void operator<<=(::CORBA::Any& _a, Tango::DevVarStateArray* _sp); _CORBA_Boolean operator>>=(const ::CORBA::Any& _a, Tango::DevVarStateArray*& _sp); _CORBA_Boolean operator>>=(const ::CORBA::Any& _a, const Tango::DevVarStateArray*& _sp); extern void operator<<=(::CORBA::Any& _a, const Tango::TimeVal& _s); extern void operator<<=(::CORBA::Any& _a, Tango::TimeVal* _sp); extern _CORBA_Boolean operator>>=(const ::CORBA::Any& _a, Tango::TimeVal*& _sp); extern _CORBA_Boolean operator>>=(const ::CORBA::Any& _a, const Tango::TimeVal*& _sp); extern void operator<<=(::CORBA::Any& _a, const Tango::DevCmdInfo& _s); extern void operator<<=(::CORBA::Any& _a, Tango::DevCmdInfo* _sp); extern _CORBA_Boolean operator>>=(const ::CORBA::Any& _a, Tango::DevCmdInfo*& _sp); extern _CORBA_Boolean operator>>=(const ::CORBA::Any& _a, const Tango::DevCmdInfo*& _sp); extern void operator<<=(::CORBA::Any& _a, const Tango::DevCmdInfo_2& _s); extern void operator<<=(::CORBA::Any& _a, Tango::DevCmdInfo_2* _sp); extern _CORBA_Boolean operator>>=(const ::CORBA::Any& _a, Tango::DevCmdInfo_2*& _sp); extern _CORBA_Boolean operator>>=(const ::CORBA::Any& _a, const Tango::DevCmdInfo_2*& _sp); void operator<<=(::CORBA::Any& _a, const Tango::DevCmdInfoList& _s); void operator<<=(::CORBA::Any& _a, Tango::DevCmdInfoList* _sp); _CORBA_Boolean operator>>=(const ::CORBA::Any& _a, Tango::DevCmdInfoList*& _sp); _CORBA_Boolean operator>>=(const ::CORBA::Any& _a, const Tango::DevCmdInfoList*& _sp); void operator<<=(::CORBA::Any& _a, const Tango::DevCmdInfoList_2& _s); void operator<<=(::CORBA::Any& _a, Tango::DevCmdInfoList_2* _sp); _CORBA_Boolean operator>>=(const ::CORBA::Any& _a, Tango::DevCmdInfoList_2*& _sp); _CORBA_Boolean operator>>=(const ::CORBA::Any& _a, const Tango::DevCmdInfoList_2*& _sp); extern void operator<<=(::CORBA::Any& _a, const Tango::DevError& _s); extern void operator<<=(::CORBA::Any& _a, Tango::DevError* _sp); extern _CORBA_Boolean operator>>=(const ::CORBA::Any& _a, Tango::DevError*& _sp); extern _CORBA_Boolean operator>>=(const ::CORBA::Any& _a, const Tango::DevError*& _sp); void operator<<=(::CORBA::Any& _a, const Tango::DevErrorList& _s); void operator<<=(::CORBA::Any& _a, Tango::DevErrorList* _sp); _CORBA_Boolean operator>>=(const ::CORBA::Any& _a, Tango::DevErrorList*& _sp); _CORBA_Boolean operator>>=(const ::CORBA::Any& _a, const Tango::DevErrorList*& _sp); extern void operator<<=(::CORBA::Any& _a, const Tango::NamedDevError& _s); extern void operator<<=(::CORBA::Any& _a, Tango::NamedDevError* _sp); extern _CORBA_Boolean operator>>=(const ::CORBA::Any& _a, Tango::NamedDevError*& _sp); extern _CORBA_Boolean operator>>=(const ::CORBA::Any& _a, const Tango::NamedDevError*& _sp); void operator<<=(::CORBA::Any& _a, const Tango::NamedDevErrorList& _s); void operator<<=(::CORBA::Any& _a, Tango::NamedDevErrorList* _sp); _CORBA_Boolean operator>>=(const ::CORBA::Any& _a, Tango::NamedDevErrorList*& _sp); _CORBA_Boolean operator>>=(const ::CORBA::Any& _a, const Tango::NamedDevErrorList*& _sp); void operator<<=(::CORBA::Any& _a, const Tango::DevFailed& _s); void operator<<=(::CORBA::Any& _a, const Tango::DevFailed* _sp); _CORBA_Boolean operator>>=(const ::CORBA::Any& _a, const Tango::DevFailed*& _sp); void operator<<=(::CORBA::Any& _a, const Tango::MultiDevFailed& _s); void operator<<=(::CORBA::Any& _a, const Tango::MultiDevFailed* _sp); _CORBA_Boolean operator>>=(const ::CORBA::Any& _a, const Tango::MultiDevFailed*& _sp); extern void operator<<=(::CORBA::Any& _a, const Tango::AttributeConfig& _s); extern void operator<<=(::CORBA::Any& _a, Tango::AttributeConfig* _sp); extern _CORBA_Boolean operator>>=(const ::CORBA::Any& _a, Tango::AttributeConfig*& _sp); extern _CORBA_Boolean operator>>=(const ::CORBA::Any& _a, const Tango::AttributeConfig*& _sp); extern void operator<<=(::CORBA::Any& _a, const Tango::AttributeConfig_2& _s); extern void operator<<=(::CORBA::Any& _a, Tango::AttributeConfig_2* _sp); extern _CORBA_Boolean operator>>=(const ::CORBA::Any& _a, Tango::AttributeConfig_2*& _sp); extern _CORBA_Boolean operator>>=(const ::CORBA::Any& _a, const Tango::AttributeConfig_2*& _sp); extern void operator<<=(::CORBA::Any& _a, const Tango::AttributeValue& _s); extern void operator<<=(::CORBA::Any& _a, Tango::AttributeValue* _sp); extern _CORBA_Boolean operator>>=(const ::CORBA::Any& _a, Tango::AttributeValue*& _sp); extern _CORBA_Boolean operator>>=(const ::CORBA::Any& _a, const Tango::AttributeValue*& _sp); extern void operator<<=(::CORBA::Any& _a, const Tango::AttributeDim& _s); extern void operator<<=(::CORBA::Any& _a, Tango::AttributeDim* _sp); extern _CORBA_Boolean operator>>=(const ::CORBA::Any& _a, Tango::AttributeDim*& _sp); extern _CORBA_Boolean operator>>=(const ::CORBA::Any& _a, const Tango::AttributeDim*& _sp); extern void operator<<=(::CORBA::Any& _a, const Tango::AttributeValue_3& _s); extern void operator<<=(::CORBA::Any& _a, Tango::AttributeValue_3* _sp); extern _CORBA_Boolean operator>>=(const ::CORBA::Any& _a, Tango::AttributeValue_3*& _sp); extern _CORBA_Boolean operator>>=(const ::CORBA::Any& _a, const Tango::AttributeValue_3*& _sp); inline void operator >>=(Tango::AttributeDataType _e, cdrStream& s) { ::operator>>=((::CORBA::ULong)_e, s); } inline void operator <<= (Tango::AttributeDataType& _e, cdrStream& s) { ::CORBA::ULong _0RL_e; ::operator<<=(_0RL_e,s); if (_0RL_e <= Tango::NO_DATA) { _e = (Tango::AttributeDataType) _0RL_e; } else { OMNIORB_THROW(MARSHAL,_OMNI_NS(MARSHAL_InvalidEnumValue), (::CORBA::CompletionStatus)s.completion()); } } void operator<<=(::CORBA::Any& _a, Tango::AttributeDataType _s); _CORBA_Boolean operator>>=(const ::CORBA::Any& _a, Tango::AttributeDataType& _s); void operator<<=(::CORBA::Any& _a, const Tango::AttrValUnion& _s); void operator<<=(::CORBA::Any& _a, Tango::AttrValUnion* _sp); _CORBA_Boolean operator>>=(const ::CORBA::Any& _a, const Tango::AttrValUnion*& _sp); _CORBA_Boolean operator>>=(const ::CORBA::Any& _a, Tango::AttrValUnion*& _sp); extern void operator<<=(::CORBA::Any& _a, const Tango::AttributeValue_4& _s); extern void operator<<=(::CORBA::Any& _a, Tango::AttributeValue_4* _sp); extern _CORBA_Boolean operator>>=(const ::CORBA::Any& _a, Tango::AttributeValue_4*& _sp); extern _CORBA_Boolean operator>>=(const ::CORBA::Any& _a, const Tango::AttributeValue_4*& _sp); extern void operator<<=(::CORBA::Any& _a, const Tango::ChangeEventProp& _s); extern void operator<<=(::CORBA::Any& _a, Tango::ChangeEventProp* _sp); extern _CORBA_Boolean operator>>=(const ::CORBA::Any& _a, Tango::ChangeEventProp*& _sp); extern _CORBA_Boolean operator>>=(const ::CORBA::Any& _a, const Tango::ChangeEventProp*& _sp); extern void operator<<=(::CORBA::Any& _a, const Tango::PeriodicEventProp& _s); extern void operator<<=(::CORBA::Any& _a, Tango::PeriodicEventProp* _sp); extern _CORBA_Boolean operator>>=(const ::CORBA::Any& _a, Tango::PeriodicEventProp*& _sp); extern _CORBA_Boolean operator>>=(const ::CORBA::Any& _a, const Tango::PeriodicEventProp*& _sp); extern void operator<<=(::CORBA::Any& _a, const Tango::ArchiveEventProp& _s); extern void operator<<=(::CORBA::Any& _a, Tango::ArchiveEventProp* _sp); extern _CORBA_Boolean operator>>=(const ::CORBA::Any& _a, Tango::ArchiveEventProp*& _sp); extern _CORBA_Boolean operator>>=(const ::CORBA::Any& _a, const Tango::ArchiveEventProp*& _sp); extern void operator<<=(::CORBA::Any& _a, const Tango::EventProperties& _s); extern void operator<<=(::CORBA::Any& _a, Tango::EventProperties* _sp); extern _CORBA_Boolean operator>>=(const ::CORBA::Any& _a, Tango::EventProperties*& _sp); extern _CORBA_Boolean operator>>=(const ::CORBA::Any& _a, const Tango::EventProperties*& _sp); extern void operator<<=(::CORBA::Any& _a, const Tango::AttributeAlarm& _s); extern void operator<<=(::CORBA::Any& _a, Tango::AttributeAlarm* _sp); extern _CORBA_Boolean operator>>=(const ::CORBA::Any& _a, Tango::AttributeAlarm*& _sp); extern _CORBA_Boolean operator>>=(const ::CORBA::Any& _a, const Tango::AttributeAlarm*& _sp); extern void operator<<=(::CORBA::Any& _a, const Tango::AttributeConfig_3& _s); extern void operator<<=(::CORBA::Any& _a, Tango::AttributeConfig_3* _sp); extern _CORBA_Boolean operator>>=(const ::CORBA::Any& _a, Tango::AttributeConfig_3*& _sp); extern _CORBA_Boolean operator>>=(const ::CORBA::Any& _a, const Tango::AttributeConfig_3*& _sp); void operator<<=(::CORBA::Any& _a, const Tango::AttributeConfigList& _s); void operator<<=(::CORBA::Any& _a, Tango::AttributeConfigList* _sp); _CORBA_Boolean operator>>=(const ::CORBA::Any& _a, Tango::AttributeConfigList*& _sp); _CORBA_Boolean operator>>=(const ::CORBA::Any& _a, const Tango::AttributeConfigList*& _sp); void operator<<=(::CORBA::Any& _a, const Tango::AttributeConfigList_2& _s); void operator<<=(::CORBA::Any& _a, Tango::AttributeConfigList_2* _sp); _CORBA_Boolean operator>>=(const ::CORBA::Any& _a, Tango::AttributeConfigList_2*& _sp); _CORBA_Boolean operator>>=(const ::CORBA::Any& _a, const Tango::AttributeConfigList_2*& _sp); void operator<<=(::CORBA::Any& _a, const Tango::AttributeConfigList_3& _s); void operator<<=(::CORBA::Any& _a, Tango::AttributeConfigList_3* _sp); _CORBA_Boolean operator>>=(const ::CORBA::Any& _a, Tango::AttributeConfigList_3*& _sp); _CORBA_Boolean operator>>=(const ::CORBA::Any& _a, const Tango::AttributeConfigList_3*& _sp); void operator<<=(::CORBA::Any& _a, const Tango::AttributeValueList& _s); void operator<<=(::CORBA::Any& _a, Tango::AttributeValueList* _sp); _CORBA_Boolean operator>>=(const ::CORBA::Any& _a, Tango::AttributeValueList*& _sp); _CORBA_Boolean operator>>=(const ::CORBA::Any& _a, const Tango::AttributeValueList*& _sp); void operator<<=(::CORBA::Any& _a, const Tango::AttributeValueList_3& _s); void operator<<=(::CORBA::Any& _a, Tango::AttributeValueList_3* _sp); _CORBA_Boolean operator>>=(const ::CORBA::Any& _a, Tango::AttributeValueList_3*& _sp); _CORBA_Boolean operator>>=(const ::CORBA::Any& _a, const Tango::AttributeValueList_3*& _sp); void operator<<=(::CORBA::Any& _a, const Tango::AttributeValueList_4& _s); void operator<<=(::CORBA::Any& _a, Tango::AttributeValueList_4* _sp); _CORBA_Boolean operator>>=(const ::CORBA::Any& _a, Tango::AttributeValueList_4*& _sp); _CORBA_Boolean operator>>=(const ::CORBA::Any& _a, const Tango::AttributeValueList_4*& _sp); extern void operator<<=(::CORBA::Any& _a, const Tango::AttDataReady& _s); extern void operator<<=(::CORBA::Any& _a, Tango::AttDataReady* _sp); extern _CORBA_Boolean operator>>=(const ::CORBA::Any& _a, Tango::AttDataReady*& _sp); extern _CORBA_Boolean operator>>=(const ::CORBA::Any& _a, const Tango::AttDataReady*& _sp); extern void operator<<=(::CORBA::Any& _a, const Tango::DevInfo& _s); extern void operator<<=(::CORBA::Any& _a, Tango::DevInfo* _sp); extern _CORBA_Boolean operator>>=(const ::CORBA::Any& _a, Tango::DevInfo*& _sp); extern _CORBA_Boolean operator>>=(const ::CORBA::Any& _a, const Tango::DevInfo*& _sp); extern void operator<<=(::CORBA::Any& _a, const Tango::DevInfo_3& _s); extern void operator<<=(::CORBA::Any& _a, Tango::DevInfo_3* _sp); extern _CORBA_Boolean operator>>=(const ::CORBA::Any& _a, Tango::DevInfo_3*& _sp); extern _CORBA_Boolean operator>>=(const ::CORBA::Any& _a, const Tango::DevInfo_3*& _sp); extern void operator<<=(::CORBA::Any& _a, const Tango::DevCmdHistory& _s); extern void operator<<=(::CORBA::Any& _a, Tango::DevCmdHistory* _sp); extern _CORBA_Boolean operator>>=(const ::CORBA::Any& _a, Tango::DevCmdHistory*& _sp); extern _CORBA_Boolean operator>>=(const ::CORBA::Any& _a, const Tango::DevCmdHistory*& _sp); void operator<<=(::CORBA::Any& _a, const Tango::DevCmdHistoryList& _s); void operator<<=(::CORBA::Any& _a, Tango::DevCmdHistoryList* _sp); _CORBA_Boolean operator>>=(const ::CORBA::Any& _a, Tango::DevCmdHistoryList*& _sp); _CORBA_Boolean operator>>=(const ::CORBA::Any& _a, const Tango::DevCmdHistoryList*& _sp); extern void operator<<=(::CORBA::Any& _a, const Tango::DevAttrHistory& _s); extern void operator<<=(::CORBA::Any& _a, Tango::DevAttrHistory* _sp); extern _CORBA_Boolean operator>>=(const ::CORBA::Any& _a, Tango::DevAttrHistory*& _sp); extern _CORBA_Boolean operator>>=(const ::CORBA::Any& _a, const Tango::DevAttrHistory*& _sp); extern void operator<<=(::CORBA::Any& _a, const Tango::DevAttrHistory_3& _s); extern void operator<<=(::CORBA::Any& _a, Tango::DevAttrHistory_3* _sp); extern _CORBA_Boolean operator>>=(const ::CORBA::Any& _a, Tango::DevAttrHistory_3*& _sp); extern _CORBA_Boolean operator>>=(const ::CORBA::Any& _a, const Tango::DevAttrHistory_3*& _sp); extern void operator<<=(::CORBA::Any& _a, const Tango::EltInArray& _s); extern void operator<<=(::CORBA::Any& _a, Tango::EltInArray* _sp); extern _CORBA_Boolean operator>>=(const ::CORBA::Any& _a, Tango::EltInArray*& _sp); extern _CORBA_Boolean operator>>=(const ::CORBA::Any& _a, const Tango::EltInArray*& _sp); void operator<<=(::CORBA::Any& _a, const Tango::EltInArrayList& _s); void operator<<=(::CORBA::Any& _a, Tango::EltInArrayList* _sp); _CORBA_Boolean operator>>=(const ::CORBA::Any& _a, Tango::EltInArrayList*& _sp); _CORBA_Boolean operator>>=(const ::CORBA::Any& _a, const Tango::EltInArrayList*& _sp); void operator<<=(::CORBA::Any& _a, const Tango::TimeValList& _s); void operator<<=(::CORBA::Any& _a, Tango::TimeValList* _sp); _CORBA_Boolean operator>>=(const ::CORBA::Any& _a, Tango::TimeValList*& _sp); _CORBA_Boolean operator>>=(const ::CORBA::Any& _a, const Tango::TimeValList*& _sp); void operator<<=(::CORBA::Any& _a, const Tango::AttrQualityList& _s); void operator<<=(::CORBA::Any& _a, Tango::AttrQualityList* _sp); _CORBA_Boolean operator>>=(const ::CORBA::Any& _a, Tango::AttrQualityList*& _sp); _CORBA_Boolean operator>>=(const ::CORBA::Any& _a, const Tango::AttrQualityList*& _sp); void operator<<=(::CORBA::Any& _a, const Tango::AttributeDimList& _s); void operator<<=(::CORBA::Any& _a, Tango::AttributeDimList* _sp); _CORBA_Boolean operator>>=(const ::CORBA::Any& _a, Tango::AttributeDimList*& _sp); _CORBA_Boolean operator>>=(const ::CORBA::Any& _a, const Tango::AttributeDimList*& _sp); void operator<<=(::CORBA::Any& _a, const Tango::DevErrorListList& _s); void operator<<=(::CORBA::Any& _a, Tango::DevErrorListList* _sp); _CORBA_Boolean operator>>=(const ::CORBA::Any& _a, Tango::DevErrorListList*& _sp); _CORBA_Boolean operator>>=(const ::CORBA::Any& _a, const Tango::DevErrorListList*& _sp); extern void operator<<=(::CORBA::Any& _a, const Tango::DevAttrHistory_4& _s); extern void operator<<=(::CORBA::Any& _a, Tango::DevAttrHistory_4* _sp); extern _CORBA_Boolean operator>>=(const ::CORBA::Any& _a, Tango::DevAttrHistory_4*& _sp); extern _CORBA_Boolean operator>>=(const ::CORBA::Any& _a, const Tango::DevAttrHistory_4*& _sp); extern void operator<<=(::CORBA::Any& _a, const Tango::DevCmdHistory_4& _s); extern void operator<<=(::CORBA::Any& _a, Tango::DevCmdHistory_4* _sp); extern _CORBA_Boolean operator>>=(const ::CORBA::Any& _a, Tango::DevCmdHistory_4*& _sp); extern _CORBA_Boolean operator>>=(const ::CORBA::Any& _a, const Tango::DevCmdHistory_4*& _sp); void operator<<=(::CORBA::Any& _a, const Tango::DevAttrHistoryList& _s); void operator<<=(::CORBA::Any& _a, Tango::DevAttrHistoryList* _sp); _CORBA_Boolean operator>>=(const ::CORBA::Any& _a, Tango::DevAttrHistoryList*& _sp); _CORBA_Boolean operator>>=(const ::CORBA::Any& _a, const Tango::DevAttrHistoryList*& _sp); void operator<<=(::CORBA::Any& _a, const Tango::DevAttrHistoryList_3& _s); void operator<<=(::CORBA::Any& _a, Tango::DevAttrHistoryList_3* _sp); _CORBA_Boolean operator>>=(const ::CORBA::Any& _a, Tango::DevAttrHistoryList_3*& _sp); _CORBA_Boolean operator>>=(const ::CORBA::Any& _a, const Tango::DevAttrHistoryList_3*& _sp); extern void operator<<=(::CORBA::Any& _a, const Tango::ZmqCallInfo& _s); extern void operator<<=(::CORBA::Any& _a, Tango::ZmqCallInfo* _sp); extern _CORBA_Boolean operator>>=(const ::CORBA::Any& _a, Tango::ZmqCallInfo*& _sp); extern _CORBA_Boolean operator>>=(const ::CORBA::Any& _a, const Tango::ZmqCallInfo*& _sp); void operator<<=(::CORBA::Any& _a, Tango::Device_ptr _s); void operator<<=(::CORBA::Any& _a, Tango::Device_ptr* _s); _CORBA_Boolean operator>>=(const ::CORBA::Any& _a, Tango::Device_ptr& _s); void operator<<=(::CORBA::Any& _a, Tango::Device_2_ptr _s); void operator<<=(::CORBA::Any& _a, Tango::Device_2_ptr* _s); _CORBA_Boolean operator>>=(const ::CORBA::Any& _a, Tango::Device_2_ptr& _s); void operator<<=(::CORBA::Any& _a, Tango::Device_3_ptr _s); void operator<<=(::CORBA::Any& _a, Tango::Device_3_ptr* _s); _CORBA_Boolean operator>>=(const ::CORBA::Any& _a, Tango::Device_3_ptr& _s); void operator<<=(::CORBA::Any& _a, Tango::Device_4_ptr _s); void operator<<=(::CORBA::Any& _a, Tango::Device_4_ptr* _s); _CORBA_Boolean operator>>=(const ::CORBA::Any& _a, Tango::Device_4_ptr& _s); inline void Tango::Device::_marshalObjRef(::Tango::Device_ptr obj, cdrStream& s) { omniObjRef::_marshal(obj->_PR_getobj(),s); } inline void Tango::Device_2::_marshalObjRef(::Tango::Device_2_ptr obj, cdrStream& s) { omniObjRef::_marshal(obj->_PR_getobj(),s); } inline void Tango::Device_3::_marshalObjRef(::Tango::Device_3_ptr obj, cdrStream& s) { omniObjRef::_marshal(obj->_PR_getobj(),s); } inline void Tango::Device_4::_marshalObjRef(::Tango::Device_4_ptr obj, cdrStream& s) { omniObjRef::_marshal(obj->_PR_getobj(),s); } #ifdef USE_stub_in_nt_dll_NOT_DEFINED_tango # undef USE_stub_in_nt_dll # undef USE_stub_in_nt_dll_NOT_DEFINED_tango #endif #ifdef USE_core_stub_in_nt_dll_NOT_DEFINED_tango # undef USE_core_stub_in_nt_dll # undef USE_core_stub_in_nt_dll_NOT_DEFINED_tango #endif #ifdef USE_dyn_stub_in_nt_dll_NOT_DEFINED_tango # undef USE_dyn_stub_in_nt_dll # undef USE_dyn_stub_in_nt_dll_NOT_DEFINED_tango #endif #endif // __tango_hh__ tango-8.1.2c+dfsg.orig/lib/cpp/server/idl/Makefile.am0000644000175000017500000000006512205375142021237 0ustar piccapicca idldir=${includedir}/tango/idl idl_HEADERS=tango.h tango-8.1.2c+dfsg.orig/lib/cpp/server/device.h0000644000175000017500000050160712205375142020053 0ustar piccapicca//============================================================================= // // file : Device.h // // description : Include for the Device root classes called DeviceImpl // // project : TANGO // // author(s) : A.Gotz + E.Taurel // // Copyright (C) : 2004,2005,2006,2007,2008,2009,2010,2011,2012,2013 // European Synchrotron Radiation Facility // BP 220, Grenoble 38043 // FRANCE // // This file is part of Tango. // // Tango 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. // // Tango 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 Tango. If not, see . // // $Revision: 22502 $ // //============================================================================= #ifndef _DEVICE_H #define _DEVICE_H #include #include #include #include #include #include #include #include #include namespace Tango { class Command; class DeviceClass; class AutoTangoMonitor; class NoSyncModelTangoMonitor; class EventSupplier; class EventSubscriptionChangeCmd; class Util; /** @defgroup Server Server classes */ //============================================================================= // // The DeviceImpl class // // // description : This class is derived directly from the Tango::Device_skel // class generated by CORBA. It represents the CORBA // servant which will be accessed by the client. // It implements all the methods // and attributes defined in the IDL interface for Device. // //============================================================================= /** * Base class for all TANGO device. * * This class inherits from CORBA classes where all the network layer is * implemented. * * $Author: taurel $ * $Revision: 22502 $ * * @headerfile tango.h * @ingroup Server */ class DeviceImpl : public virtual POA_Tango::Device { public: friend class Tango::AutoTangoMonitor; friend class Tango::NoSyncModelTangoMonitor; friend class Tango::EventSupplier; friend class Tango::EventSubscriptionChangeCmd; /**@name Constructors * Miscellaneous constructors */ //@{ /** * Constructs a newly allocated DeviceImpl object from its name. * * The device description field is set to A Tango device. The device * state is set to unknown and the device status is set to * Not Initialised * * @param device_class Pointer to the device class object * @param dev_name The device name * */ DeviceImpl(DeviceClass *device_class,string &dev_name); /** * Constructs a newly allocated DeviceImpl object from its name and its description. * * The device * state is set to unknown and the device status is set to * Not Initialised * * @param device_class Pointer to the device class object * @param dev_name The device name * @param desc The device description * */ DeviceImpl(DeviceClass *device_class,string &dev_name,string &desc); /** * Constructs a newly allocated DeviceImpl object from all its creation * parameters. * * The device is constructed from its name, its description, an original state * and status * * @param device_class Pointer to the device class object * @param dev_name The device name * @param desc The device description * @param dev_state The device initial state * @param dev_status The device initial status * */ DeviceImpl(DeviceClass *device_class, string &dev_name,string &desc, Tango::DevState dev_state,string &dev_status); /** * Constructs a newly allocated DeviceImpl object from all its creation * parameters with some default values. * * The device is constructed from its name, its description, an original state * and status. This constructor defined default values for the description, * state and status parameters. The default device description is A TANGO device. * The default device state is UNKNOWN and the default device status * is Not initialised. * * @param device_class Pointer to the device class object * @param dev_name The device name * @param desc The device desc * @param dev_state The device initial state * @param dev_status The device initial status * */ DeviceImpl(DeviceClass *device_class, const char *dev_name,const char *desc = "A TANGO device", Tango::DevState dev_state = Tango::UNKNOWN, const char *dev_status = StatusNotSet); //@} /**@name Destructor * Only one desctructor is defined for this class */ //@{ /** * The device desctructor. */ virtual ~DeviceImpl(); //@} /**@name Get/Set object members. * These methods allows the external world to get/set DeviceImpl instance * data members */ //@{ /** * Get device status. * * Return the device dev_status field. This method does the same thing than the * default status_cmd method. * * @return Device status */ string &get_status() {return device_status;} /** * Set device status. * * @param new_status The new device status */ void set_status(const string &new_status) {device_status = new_status;} /** * Appends a string to the device status. * * @param stat The string to be appened to the device status * @param new_line If true, appends a new line character before the string */ void append_status(const string &stat,bool new_line=false) {if(new_line==true)device_status.append(1,'\n');device_status.append(stat);} /** * Get device state. * * Return the device dev_state field. This method does the same thing than the * default state_cmd method. * * @return Device state */ Tango::DevState &get_state() {return device_state;} /** * Get device's previous state. * * Return the device dev_prev_state field. This method is used for the on_state_change event * * @return Device previous state */ Tango::DevState &get_prev_state() {return ext->device_prev_state;} /** * Set device state. * * @param new_state The new device state */ void set_state (const Tango::DevState &new_state) {ext->device_prev_state = device_state; device_state = new_state;} /** * Get device name. * * Return the device name (dev_name field) * * @return Device name */ string &get_name() {return device_name;} /** * Get device class singleton. * * Return the device class singleton (device_class field) * * @return Pointer to the device class singleton */ DeviceClass *get_device_class() {return device_class;} /** * Get device multi attribute object. * * Return a pointer to the device multi attribute object * * @return Pointer to the device multi attribute object */ MultiAttribute *get_device_attr() {return dev_attr;} /** * Set device multi attribute object. * * Set the pointer to the device multi attribute object * * @return Pointer to the device multi attribute object */ void set_device_attr(MultiAttribute *ptr) {dev_attr = ptr;} /** * Get a pointer to the associated DbDevice object. * * Return a pointer to DbDevice object associated with the device * * @return Pointer to the DbDevice object */ DbDevice *get_db_device(); /** * Set the associated CORBA object reference. * * Set the associated CORBA object reference. Tango supports only a one to * one servant-CORBA object link. * * @param d The CORBA object reference */ void set_d_var(Tango::Device_ptr d) {d_var = d;} /** * Get the associated CORBA object reference. * * Get the associated CORBA object reference. Tango supports only a one to * one servant-CORBA object link. * * @return The CORBA object reference */ Tango::Device_var get_d_var() {return d_var;} /** * Set the associated CORBA object identifier. * * Set the associated CORBA object identifier. * * @param o The CORBA object identifier */ void set_obj_id(PortableServer::ObjectId_var o) {obj_id = o;} /** * Get the associated CORBA object identifier. * * Return the CORBA object identifier as a _var type variable * * @return The CORBA object identifier */ PortableServer::ObjectId_var &get_obj_id() {return obj_id;} /** * Return device POA. * * Return a pointer to the device POA. This method is necessary for the * CORBA object implicit activation by the _this() method. * * @return Pointer to the device POA */ virtual PortableServer::POA_ptr _default_POA(); //@} protected: /**@name Polling related methods */ //@{ /** * Check if attribute is polled. * * Returns true if attribute with name given as parameter is polled. * * @param att_name The attribute name * @return Boolean set to true if attribute is polled */ bool is_attribute_polled(const string &att_name); /** * Check if command is polled. * * Returns true if command with name given as parameter is polled. * * @param cmd_name The command name * @return Boolean set to true if command is polled */ bool is_command_polled(const string &cmd_name); /** * Get attribute polling period. * * Returns attribute polling period (in mS) or 0 if the attribute is not polled * * @param att_name The attribute name * @return The attribute polling period in mS */ int get_attribute_poll_period(const string &att_name); /** * Get command polling period. * * Returns command polling period (in mS) or 0 if the command is not polled * * @param cmd_name The command name * @return The command polling period in mS */ int get_command_poll_period(const string &cmd_name); /** * Start polling one attribute. * * Ask Tango polling system to poll one attribute * * @param att_name The attribute name * @param period The polling period (mS) */ void poll_attribute(const string &att_name,int period); /** * Start polling a command. * * Ask Tango polling system to poll a command * * @param cmd_name The command name * @param period The polling period (mS) */ void poll_command(const string &cmd_name,int period); /** * Stop polling one attribute. * * Ask Tango polling system to stop polling one attribute * * @param att_name The attribute name */ void stop_poll_attribute(const string &att_name); /** * Stop polling one command. * * Ask Tango polling system to stop polling one command * * @param cmd_name The command name */ void stop_poll_command(const string &cmd_name); //@} public: /**@name Miscellaneous methods */ //@{ /** * Intialise a device. * * In the DeviceImpl class, this method is pure abstract and must be defined * in sub-class. Its rule is to initialise a device. This method is called * during device creation by the device constructor. * * @exception DevFailed This method does not throw exception but a * redefined method can. * Click here to read * DevFailed exception specification */ virtual void init_device() = 0; /** * Delete a device. * * In the DeviceImpl class, this method is virtual and can be defined * in sub-class. Its rule is to delete memory allocated in the init_device * method. This method is called by the device destructor and by the * device Init command. * * @exception DevFailed This method does not throw exception but a * redefined method can. * Click here to read * DevFailed exception specification */ virtual void delete_device() {}; /** * Hook method. * * Default method to implement an action necessary on a device before any * command is executed. This method can be redefined in * sub-classes in case of the default behaviour does not fullfill the needs * * @exception DevFailed This method does not throw exception but a * redefined method can. * Click here to read * DevFailed exception specification */ virtual void always_executed_hook(void) {}; /** * Read the hardware to return attribute value(s). * * Default method to implement an action necessary on a device to read the * hardware involved in a a read attribute CORBA call. * This method must be redefined in sub-classes in order to support attribute * reading * * @param attr_list Reference to a vector with Integer object. Each element in * this vector * is the index in the device object attribute vector of an attribute to be read. * @exception DevFailed This method does not throw exception but a * redefined method can. * Click here to read * DevFailed exception specification */ virtual void read_attr_hardware(vector &attr_list) {(void)attr_list;}; /** * Set the attribute read value. * * Default method to set an attribute read value. * This method must be redefined in sub-classes when attributes are needed * * @param attr The attribute object * @exception DevFailed This method does not throw exception but a * redefined method can. * Click here to read * DevFailed exception specification */ virtual void read_attr(Attribute &attr) {(void)attr;}; /** * Write the hardware for attributes. * * Default method to implement an action necessary on a device to write the * hardware involved in a a write attribute. * This method must be redefined in sub-classes in order to support writable * attribute * * @param attr_list Reference to a vector of Integer objects. Each element in * this vector * is the index in the main attribute vector of an attribute to be written. * @exception DevFailed This method does not throw exception but a * redefined method can. * Click here to read * DevFailed exception specification */ virtual void write_attr_hardware(vector &attr_list) {(void)attr_list;}; /** * Get device state. * * Default method to get device state. The behaviour of this method depends * on the device state. If the device state is ON or ALARM, it reads * the attribute(s) with an alarm level defined, check if the read value is * above/below the alarm and eventually change the state to ALARM, return the * device state. For all th eother device state, ti smethod simply returns * the state * This method can be redefined in * sub-classes in case of the default behaviour does not fullfill the needs * * @return The device state * @exception DevFailed If it is necessary to read attribute(s) and a problem * occurs during the reading. * Click here to read * DevFailed exception specification */ virtual Tango::DevState dev_state(); /** * Get device status. * * Default method to get device status. It returns the contents of the device * dev_status field. If the device state is ALARM, alarm messages are * added to the device status. This method can be redefined in * sub-classes in case of the default behaviour does not fullfill the needs * * @return The device status * @exception DevFailed This method does not throw exception but a * redefined method can. * Click here to read * DevFailed exception specification */ virtual Tango::ConstDevString dev_status(); /** * Add a new attribute to the device attribute list. * * Attributes are normally * constructed in the DeviceClass::attribute_factory() method. Nevertheless, it * is still possible to add a new attribute to a device with this method. * Please, note that if you add an attribute to a device at device creation * time, this attribute will * be added to the device class attribute list. Therefore, all devices * belonging to the same class created after this attribute addition * will also have this attribute. * * @param new_attr Pointer to the new attribute to be added to the list. This pointer * must point to "heap" allocated memory (or to static memory) and not to "stack" * allocated memory * @exception DevFailed * Click here to read * DevFailed exception specification */ void add_attribute(Attr *new_attr); /** * Remove one attribute from the device attribute list. * * Attributes are normally * constructed in the DeviceClass::attribute_factory() method. Nevertheless, it * is still possible to add a new attribute to a device with the DeviceImpl::add_attribute method. * This remove_Attribute method delete the attribute from the * device attribute list. * * @param rem_attr Pointer to the attribute to be removed * @param free_it Boolean set to true if the object passed as first argument * must be freed. Default value is false. * @param clean_db Clean all attributes related information (included polling * info if the attribute is polled) from database. Default value is true * @exception DevFailed * Click here to read * DevFailed exception specification */ void remove_attribute(Attr *rem_attr,bool free_it = false, bool clean_db = true); /** * Remove one attribute from the device attribute list. * * Attributes are normally * constructed in the DeviceClass::attribute_factory() method. Nevertheless, it * is still possible to add a new attribute to a device with the DeviceImpl::add_attribute method. * This remove_Attribute method delete the attribute from the * device attribute list. * * @param rem_attr_name The name of the attribute to be removed * @param free_it Boolean set to true if the object passed as first argument * must be freed. Default value is false. * @param clean_db Clean all attributes related information (included polling * info if the attribute is polled) from database. Default value is true * @exception DevFailed * Click here to read * DevFailed exception specification */ void remove_attribute(string &rem_attr_name,bool free_it = false,bool clean_db = true); /** * Retrieve a polled object from the polled object list. * * Retrieve in the device polled object list, the specified polled object * (command or attribute). * * @param obj_type The object type (command or attribute) * @param obj_name The object name * @return An iterator pointing to the polled object in the polled object list * @exception DevFailed Thrown if the object is not found. * Click here to read * DevFailed exception specification */ vector::iterator get_polled_obj_by_type_name(Tango::PollObjType obj_type,const string &obj_name); //@} /**@name Methods to build Tango array types. * These methods are helper methods to build Tango array types from an already * existing buffer (Tango array types are CORBA sequences) */ //@{ /** * Create a DevVarCharArray type. * * Create a DevVarCharArray type data and return a pointer to it. The array is * build using the input pointer with the given length * * @param ptr Pointer to the basic type data buffer * @param length Number of element in the previous buffer * * @return Pointer to the created DevVarCharArray type data */ inline Tango::DevVarCharArray *create_DevVarCharArray(unsigned char *ptr,long length) { return new Tango::DevVarCharArray(length,length,ptr,false); } /** * Create a DevVarShortArray type. * * Create a DevVarShortArray type data and return a pointer to it. The array is * build using the input pointer with the given length * * @param ptr Pointer to the basic type data buffer * @param length Number of element in the previous buffer * * @return Pointer to the created DevVarShortArray type data */ inline Tango::DevVarShortArray *create_DevVarShortArray(short *ptr,long length) { return new Tango::DevVarShortArray(length,length,ptr,false); } /** * Create a DevVarLongArray type. * * Create a DevVarLongArray type data and return a pointer to it. The array is * build using the input pointer with the given length * * @param ptr Pointer to the basic type data buffer * @param length Number of element in the previous buffer * * @return Pointer to the created DevVarLongArray type data */ inline Tango::DevVarLongArray *create_DevVarLongArray(DevLong *ptr,long length) { return new Tango::DevVarLongArray(length,length,ptr,false); } /** * Create a DevVarLong64Array type. * * Create a DevVarLong64Array type data and return a pointer to it. The array is * build using the input pointer with the given length * * @param ptr Pointer to the basic type data buffer * @param length Number of element in the previous buffer * * @return Pointer to the created DevVarLong64Array type data */ inline Tango::DevVarLong64Array *create_DevVarLong64Array(DevLong64 *ptr,long length) { return new Tango::DevVarLong64Array(length,length,ptr,false); } /** * Create a DevVarFloatArray type. * * Create a DevVarFloatArray type data and return a pointer to it. The array is * build using the input pointer with the given length * * @param ptr Pointer to the basic type data buffer * @param length Number of element in the previous buffer * * @return Pointer to the created DevVarFloatArray type data */ inline Tango::DevVarFloatArray *create_DevVarFloatArray(float *ptr,long length) { return new Tango::DevVarFloatArray(length,length,ptr,false); } /** * Create a DevVarDoubleArray type. * * Create a DevVarDoubleArray type data and return a pointer to it. The array is * build using the input pointer with the given length * * @param ptr Pointer to the basic type data buffer * @param length Number of element in the previous buffer * * @return Pointer to the created DevVarDoubleArray type data */ inline Tango::DevVarDoubleArray *create_DevVarDoubleArray(double *ptr,long length) { return new Tango::DevVarDoubleArray(length,length,ptr,false); } /** * Create a DevVarUShortArray type. * * Create a DevVarUShortArray type data and return a pointer to it. The array is * build using the input pointer with the given length * * @param ptr Pointer to the basic type data buffer * @param length Number of element in the previous buffer * * @return Pointer to the created DevVarUShortArray type data */ inline Tango::DevVarUShortArray *create_DevVarUShortArray(unsigned short *ptr,long length) { return new Tango::DevVarUShortArray(length,length,ptr,false); } /** * Create a DevVarULongArray type. * * Create a DevVarULongArray type data and return a pointer to it. The array is * build using the input pointer with the given length * * @param ptr Pointer to the basic type data buffer * @param length Number of element in the previous buffer * * @return Pointer to the created DevVarULongArray type data */ inline Tango::DevVarULongArray *create_DevVarULongArray(DevULong *ptr,long length) { return new Tango::DevVarULongArray(length,length,ptr,false); } /** * Create a DevVarULong64Array type. * * Create a DevVarULong64Array type data and return a pointer to it. The array is * build using the input pointer with the given length * * @param ptr Pointer to the basic type data buffer * @param length Number of element in the previous buffer * * @return Pointer to the created DevVarULong64Array type data */ inline Tango::DevVarULong64Array *create_DevVarULong64Array(DevULong64 *ptr,long length) { return new Tango::DevVarULong64Array(length,length,ptr,false); } /** * Create a DevVarStringArray type. * * Create a DevVarStringArray type data and return a pointer to it. The array is * build using the input pointer with the given length * * @param ptr Pointer to the basic type data buffer * @param length Number of element in the previous buffer * * @return Pointer to the created DevVarStringArray type data */ inline Tango::DevVarStringArray *create_DevVarStringArray(char **ptr,long length) { return new Tango::DevVarStringArray(length,length,ptr,false); } //@} /**@name CORBA attribute methods * Method defined to implement TANGO device CORBA attribute */ //@{ /** * Get device name. * * It's the master method executed when the device name is requested * via a CORBA attribute. It updates the device black-box and return the * device name * * @return The device name */ virtual char *name(); /** * Get administrator device name. * * It's the master method executed when the administrator device name is requested * via a CORBA attribute. It updates the device black-box and return the * administrator device name * * @return The device name */ virtual char *adm_name(); /** * Get device description. * * It's the master method executed when the device description is requested * via a CORBA attribute. It updates the device black-box and return the * device description field * * @return The device description */ virtual char *description(); /** * Get device status. * * It's the master method executed when the device status is requested * via a CORBA attribute. It updates the device black-box and return the * device state. This method calls the status_cmd device method but * catch all the execption and does not re-throw them because exception can't * be thrown to a client for CORBA attribute * * @return The device status */ virtual char *status(); /** * Get device state. * * It's the master method executed when the device state is requested * via a CORBA attribute. It updates the device black-box and return the * device state. This method calls the state_cmd device method but * catch all the execption and does not re-throw them because exception can't * be thrown to a client for CORBA attribute * * @return The device state */ virtual Tango::DevState state(); //@} /**@name CORBA operation methods * Method defined to implement TANGO device CORBA operation */ //@{ /** * Execute a command. * * It's the master method executed when a "command_inout" CORBA operation is * requested by a client. It updates the device black-box, call the * TANGO command handler and returned the output Any * * @param in_cmd The command name * @param in_data The command input data packed in a CORBA Any * @return The command output data packed in a CORBA Any object * @exception DevFailed Re-throw of the exception thrown by the command_handler * method. * Click here to read * DevFailed exception specification */ virtual CORBA::Any *command_inout(const char *in_cmd, const CORBA::Any &in_data); /** * Get device black box. * * It's the master method executed when the device black box is requested. * It reads the device black box, update it and return black-box data to the * client * * @param n The number of actions description which must be returned to the * client. The number of returned element is limited to the number of elements * stored in the black-box or to the complete black-box depth if it is full. * @return The device black box with one String for each action requested on * the device * @exception DevFailed If it is not possible to read the device black box. * Click here to read * DevFailed exception specification */ virtual Tango::DevVarStringArray *black_box(CORBA::Long n); /** * Get device command list. * * Invoked when the client request the command_list_query CORBA operation. * It updates the device black box and returns an array of DevCmdInfo object * with one object for each command. * * @return The device command list. One DevCmdInfo is initialised for each * device command */ virtual Tango::DevCmdInfoList *command_list_query(); /** * Get command info. * * Invoked when the client request the command_query CORBA operation. * It updates the device black box and returns a DevCmdInfo object for the * command with name passed * to the method as parameter. * * @param command The command name * @return A DevCmdInfo initialised for the wanted command * @exception DevFailed Thrown if the command does not exist. * Click here to read * DevFailed exception specification */ virtual Tango::DevCmdInfo *command_query(const char *command); /** * Get device info. * * Invoked when the client request the info CORBA operation. * It updates the black box and returns a DevInfo object * with miscellaneous device info * * @return A DevInfo object */ virtual Tango::DevInfo *info(); /** * Ping the device to check if it is still alive. * * Invoked when the client request the ping CORBA operation. * It updates the device black box and simply returns * */ virtual void ping(); /** * Get attribute(s) configuration. * * Invoked when the client request the get_attribute_config CORBA operation. * It returns to the client one AttributeConfig structure for each wanted * attribute. All the attribute properties value are returned in this * AttributeConfig structure. * * @param names The attribute(s) name list * @return A sequence of AttributeConfig structure. One structure is initialised * for each wanted attribute. Click here * to read AttributeConfig structure specification. * * @exception DevFailed Thrown if the command does not exist. * Click here to read * DevFailed exception specification */ virtual Tango::AttributeConfigList* get_attribute_config(const Tango::DevVarStringArray& names); /** * Set attribute(s) configuration. * * Invoked when the client request the set_attribute_config CORBA operation. * It updates the device attribute configuration actually used by the device but * this method also updates the Tango database. One structure of the * AttributeConfig type is needed for each attribute to update configuration. * Click here * to read AttributeConfig structure specification. * * @param new_conf The attribute(s) new configuration structure sequence * @exception DevFailed Thrown if the command does not exist. * Click here to read * DevFailed exception specification */ virtual void set_attribute_config(const Tango::AttributeConfigList& new_conf); /** * Read attribute(s) value. * * Invoked when the client request the read_attributes CORBA operation. * It returns to the client one AttributeValue structure for each wanted * attribute. * * @param names The attribute(s) name list * @return A sequence of AttributeValue structure. One structure is initialised * for each wanted attribute with the attribute value, the date and the attribute * value quality. Click here * to read AttributeValue structure definition. * @exception DevFailed Thrown if the command does not exist. * Click here to read * DevFailed exception specification */ virtual Tango::AttributeValueList* read_attributes(const Tango::DevVarStringArray& names); /** * Write attribute(s) value. * * Invoked when the client request the write_attributes CORBA operation. * It sets the attribute(s) with the new value(s) passed as parameter. * * @param values The attribute(s) new value(s). One structure is initialised * for each wanted attribute with the attribute value. The attribute quality and * date are not used by this method. * Click here * to read AttributeValue structure definition. * @exception DevFailed Thrown if the command does not exist. * Click here to read * DevFailed exception specification */ virtual void write_attributes(const Tango::AttributeValueList& values); //@} /**@name Push change event methods. * These methods allow to fire change events for attributes manually, * without the polling to be started. */ //@{ /** * Set an implemented flag for the attribute to indicate that the server fires change events manually, * without the polling to be started. * If the detect parameter is set to true, the criteria specified for the change * event are verified and the event is only pushed if they are fullfilled. * If detect is set to false the event is fired without any value checking! * * @param attr_name The name of the attribute * @param implemented True when the server fires change events manually. * @param detect Triggers the verification of the change event properties when set to true. Default value is true. */ void set_change_event (string attr_name, bool implemented, bool detect = true); /** * Push a change event for a state or status attribute or return an exception as change * event for any attribute. * The event is pushed to the notification daemon. * * The method needs the attribue name as input. * For the state and status attributes the actual state and status values are pushed. * In case of an exception, the exception is pushed as a change event for the attribute. * * @param attr_name The name of the attribute * @param except Pointer to a Tango::DevFailed exception. Default value is NULL. */ void push_change_event (string attr_name, DevFailed *except = NULL); /** * Push a change event for an attribute with Tango::DevShort attribute data type. * The event is pushed to the notification daemon. * * The method needs the attribue name and a pointer to the data to be pushed as input. * Depending on the attribute type the dimensions x and why need to be given. * The time stamp of the event is set to the actual time and the attribute quality * is set to valid. * The event is triggered with or without checking of the change event criteria depending * on the configuration choosen with set_change_event(). * * @param attr_name The name of the attribute * @param p_data Pointer to the data to be pushed * @param x The attribute x length. Default value is 1 * @param y The attribute y length. Default value is 0 * @param release The release flag. If true, memory pointed to by p_data will be * freed after being send to the client. Default value is false. * @exception DevFailed If the attribute data type is not coherent. * Click here to read * DevFailed exception specification */ void push_change_event (string attr_name, Tango::DevShort *p_data, long x = 1,long y = 0,bool release = false); /** * Push a change event for an attribute with Tango::DevLong attribute data type. * The event is pushed to the notification daemon. * * The method needs the attribue name and a pointer to the data to be pushed as input. * Depending on the attribute type the dimensions x and why need to be given. * The time stamp of the event is set to the actual time and the attribute quality * is set to valid. * The event is triggered with or without checking of the change event criteria depending * on the configuration choosen with set_change_event(). * * @param attr_name The name of the attribute * @param p_data Pointer to the data to be pushed * @param x The attribute x length. Default value is 1 * @param y The attribute y length. Default value is 0 * @param release The release flag. If true, memory pointed to by p_data will be * freed after being send to the client. Default value is false. * @exception DevFailed If the attribute data type is not coherent. * Click here to read * DevFailed exception specification */ void push_change_event (string attr_name, Tango::DevLong *p_data, long x = 1,long y = 0,bool release = false); /** * Push a change event for an attribute with Tango::DevLong64 attribute data type. * The event is pushed to the notification daemon. * * The method needs the attribue name and a pointer to the data to be pushed as input. * Depending on the attribute type the dimensions x and why need to be given. * The time stamp of the event is set to the actual time and the attribute quality * is set to valid. * The event is triggered with or without checking of the change event criteria depending * on the configuration choosen with set_change_event(). * * @param attr_name The name of the attribute * @param p_data Pointer to the data to be pushed * @param x The attribute x length. Default value is 1 * @param y The attribute y length. Default value is 0 * @param release The release flag. If true, memory pointed to by p_data will be * freed after being send to the client. Default value is false. * @exception DevFailed If the attribute data type is not coherent. * Click here to read * DevFailed exception specification */ void push_change_event (string attr_name, Tango::DevLong64 *p_data, long x = 1,long y = 0,bool release = false); /** * Push a change event for an attribute with Tango::DevFloat attribute data type. * The event is pushed to the notification daemon. * * The method needs the attribue name and a pointer to the data to be pushed as input. * Depending on the attribute type the dimensions x and why need to be given. * The time stamp of the event is set to the actual time and the attribute quality * is set to valid. * The event is triggered with or without checking of the change event criteria depending * on the configuration choosen with set_change_event(). * * @param attr_name The name of the attribute * @param p_data Pointer to the data to be pushed * @param x The attribute x length. Default value is 1 * @param y The attribute y length. Default value is 0 * @param release The release flag. If true, memory pointed to by p_data will be * freed after being send to the client. Default value is false. * @exception DevFailed If the attribute data type is not coherent. * Click here to read * DevFailed exception specification */ void push_change_event (string attr_name, Tango::DevFloat *p_data, long x = 1,long y = 0,bool release = false); /** * Push a change event for an attribute with Tango::DevDouble attribute data type. * The event is pushed to the notification daemon. * * The method needs the attribue name and a pointer to the data to be pushed as input. * Depending on the attribute type the dimensions x and why need to be given. * The time stamp of the event is set to the actual time and the attribute quality * is set to valid. * The event is triggered with or without checking of the change event criteria depending * on the configuration choosen with set_change_event(). * * @param attr_name The name of the attribute * @param p_data Pointer to the data to be pushed * @param x The attribute x length. Default value is 1 * @param y The attribute y length. Default value is 0 * @param release The release flag. If true, memory pointed to by p_data will be * freed after being send to the client. Default value is false. * @exception DevFailed If the attribute data type is not coherent. * Click here to read * DevFailed exception specification */ void push_change_event (string attr_name, Tango::DevDouble *p_data, long x = 1,long y = 0,bool release = false); /** * Push a change event for an attribute with Tango::DevString attribute data type. * The event is pushed to the notification daemon. * * The method needs the attribue name and a pointer to the data to be pushed as input. * Depending on the attribute type the dimensions x and why need to be given. * The time stamp of the event is set to the actual time and the attribute quality * is set to valid. * The event is triggered with or without checking of the change event criteria depending * on the configuration choosen with set_change_event(). * * @param attr_name The name of the attribute * @param p_data Pointer to the data to be pushed * @param x The attribute x length. Default value is 1 * @param y The attribute y length. Default value is 0 * @param release The release flag. If true, memory pointed to by p_data will be * freed after being send to the client. Default value is false. * @exception DevFailed If the attribute data type is not coherent. * Click here to read * DevFailed exception specification */ void push_change_event (string attr_name, Tango::DevString *p_data, long x = 1,long y = 0,bool release = false); /** * Push a change event for an attribute with Tango::DevBoolean attribute data type. * The event is pushed to the notification daemon. * * The method needs the attribue name and a pointer to the data to be pushed as input. * Depending on the attribute type the dimensions x and why need to be given. * The time stamp of the event is set to the actual time and the attribute quality * is set to valid. * The event is triggered with or without checking of the change event criteria depending * on the configuration choosen with set_change_event(). * * @param attr_name The name of the attribute * @param p_data Pointer to the data to be pushed * @param x The attribute x length. Default value is 1 * @param y The attribute y length. Default value is 0 * @param release The release flag. If true, memory pointed to by p_data will be * freed after being send to the client. Default value is false. * @exception DevFailed If the attribute data type is not coherent. * Click here to read * DevFailed exception specification */ void push_change_event (string attr_name, Tango::DevBoolean *p_data, long x = 1,long y = 0,bool release = false); /**void push_change_event (string attr_name, Tango::DevBoolea * Push a change event for an attribute with Tango::DevUShort attribute data type. * The event is pushed to the notification daemon. * * The method needs the attribue name and a pointer to the data to be pushed as input. * Depending on the attribute type the dimensions x and why need to be given. * The time stamp of the event is set to the actual time and the attribute quality * is set to valid. * The event is triggered with or without checking of the change event criteria depending * on the configuration choosen with set_change_event(). * * @param attr_name The name of the attribute * @param p_data Pointer to the data to be pushed * @param x The attribute x length. Default value is 1 * @param y The attribute y length. Default value is 0 * @param release The release flag. If true, memory pointed to by p_data will be * freed after being send to the client. Default value is false. * @exception DevFailed If the attribute data type is not coherent. * Click here to read * DevFailed exception specification */ void push_change_event (string attr_name, Tango::DevUShort *p_data, long x = 1,long y = 0,bool release = false); /** * Push a change event for an attribute with Tango::DevUChar attribute data type. * The event is pushed to the notification daemon. * * The method needs the attribue name and a pointer to the data to be pushed as input. * Depending on the attribute type the dimensions x and why need to be given. * The time stamp of the event is set to the actual time and the attribute quality * is set to valid. * The event is triggered with or without checking of the change event criteria depending * on the configuration choosen with set_change_event(). * * @param attr_name The name of the attribute * @param p_data Pointer to the data to be pushed * @param x The attribute x length. Default value is 1 * @param y The attribute y length. Default value is 0 * @param release The release flag. If true, memory pointed to by p_data will be * freed after being send to the client. Default value is false. * @exception DevFailed If the attribute data type is not coherent. * Click here to read * DevFailed exception specification */ void push_change_event (string attr_name, Tango::DevUChar *p_data, long x = 1,long y = 0,bool release = false); /** * Push a change event for an attribute with Tango::DevULong attribute data type. * The event is pushed to the notification daemon. * * The method needs the attribue name and a pointer to the data to be pushed as input. * Depending on the attribute type the dimensions x and why need to be given. * The time stamp of the event is set to the actual time and the attribute quality * is set to valid. * The event is triggered with or without checking of the change event criteria depending * on the configuration choosen with set_change_event(). * * @param attr_name The name of the attribute * @param p_data Pointer to the data to be pushed * @param x The attribute x length. Default value is 1 * @param y The attribute y length. Default value is 0 * @param release The release flag. If true, memory pointed to by p_data will be * freed after being send to the client. Default value is false. * @exception DevFailed If the attribute data type is not coherent. * Click here to read * DevFailed exception specification */ void push_change_event (string attr_name, Tango::DevULong *p_data, long x = 1,long y = 0,bool release = false); /** * Push a change event for an attribute with Tango::DevULong64 attribute data type. * The event is pushed to the notification daemon. * * The method needs the attribue name and a pointer to the data to be pushed as input. * Depending on the attribute type the dimensions x and why need to be given. * The time stamp of the event is set to the actual time and the attribute quality * is set to valid. * The event is triggered with or without checking of the change event criteria depending * on the configuration choosen with set_change_event(). * * @param attr_name The name of the attribute * @param p_data Pointer to the data to be pushed * @param x The attribute x length. Default value is 1 * @param y The attribute y length. Default value is 0 * @param release The release flag. If true, memory pointed to by p_data will be * freed after being send to the client. Default value is false. * @exception DevFailed If the attribute data type is not coherent. * Click here to read * DevFailed exception specification */ void push_change_event (string attr_name, Tango::DevULong64 *p_data, long x = 1,long y = 0,bool release = false); /** * Push a change event for an attribute with Tango::DevState attribute data type. * The event is pushed to the notification daemon. * * The method needs the attribue name and a pointer to the data to be pushed as input. * Depending on the attribute type the dimensions x and why need to be given. * The time stamp of the event is set to the actual time and the attribute quality * is set to valid. * The event is triggered with or without checking of the change event criteria depending * on the configuration choosen with set_change_event(). * * @param attr_name The name of the attribute * @param p_data Pointer to the data to be pushed * @param x The attribute x length. Default value is 1 * @param y The attribute y length. Default value is 0 * @param release The release flag. If true, memory pointed to by p_data will be * freed after being send to the client. Default value is false. * @exception DevFailed If the attribute data type is not coherent. * Click here to read * DevFailed exception specification */ void push_change_event (string attr_name, Tango::DevState *p_data, long x = 1,long y = 0,bool release = false); /** * Push a change event for an attribute with Tango::DevEncoded attribute data type. * The event is pushed to the notification daemon. * * The method needs the attribue name and a pointer to the data to be pushed as input. * Depending on the attribute type the dimensions x and why need to be given. * The time stamp of the event is set to the actual time and the attribute quality * is set to valid. * The event is triggered with or without checking of the change event criteria depending * on the configuration choosen with set_change_event(). * * @param attr_name The name of the attribute * @param p_data Pointer to the data to be pushed * @param x The attribute x length. Default value is 1 * @param y The attribute y length. Default value is 0 * @param release The release flag. If true, memory pointed to by p_data will be * freed after being send to the client. Default value is false. * @exception DevFailed If the attribute data type is not coherent. * Click here to read * DevFailed exception specification */ void push_change_event (string attr_name, Tango::DevEncoded *p_data, long x = 1,long y = 0,bool release = false); /** * Push a change event for an attribute with Tango::DevEncoded attribute data type * when the DevEncoded data are specified by two pointers. * The event is pushed to the notification daemon. * * The method needs the attribue name and a pointer to the data to be pushed as input. * Depending on the attribute type the dimensions x and why need to be given. * The time stamp of the event is set to the actual time and the attribute quality * is set to valid. * The event is triggered with or without checking of the change event criteria depending * on the configuration choosen with set_change_event(). * * @param attr_name The name of the attribute * @param p_str_data Pointer to the data string part to be pushed * @param p_data Pointer to the data to be pushed * @param size The data number (pointed to by p_data) * @param release The release flag. If true, memory pointed to by p_data will be * freed after being send to the client. Default value is false. * @exception DevFailed If the attribute data type is not coherent. * Click here to read * DevFailed exception specification */ void push_change_event (string attr_name, Tango::DevString *p_str_data, Tango::DevUChar *p_data, long size,bool release = false); /** * Push a change event for an attribute with Tango::DevShort attribute data type. * The event is pushed to the notification daemon. * * The method needs the attribue name, a pointer to the data to be pushed, the time stamp * for the data and the attribute quality factor as input. * Depending on the attribute type the dimensions x and why need to be given. * The event is triggered with or without checking of the change event criteria depending * on the configuration choosen with set_change_event(). * * @param attr_name The name of the attribute * @param p_data Pointer to the data to be pushed * @param t The time stamp * @param qual The attribute quality factor * @param x The attribute x length. Default value is 1 * @param y The attribute y length. Default value is 0 * @param release The release flag. If true, memory pointed to by p_data will be * freed after being send to the client. Default value is false. * @exception DevFailed If the attribute data type is not coherent. * Click here to read * DevFailed exception specification */ #ifdef _TG_WINDOWS_ void push_change_event (string attr_name, Tango::DevShort *p_data, struct _timeb &t, Tango::AttrQuality qual, long x = 1,long y = 0,bool release = false); #else void push_change_event (string attr_name, Tango::DevShort *p_data, struct timeval &t, Tango::AttrQuality qual, long x = 1,long y = 0,bool release = false); #endif /** * Push a change event for an attribute with Tango::DevLong attribute data type. * The event is pushed to the notification daemon. * * The method needs the attribue name, a pointer to the data to be pushed, the time stamp * for the data and the attribute quality factor as input. * Depending on the attribute type the dimensions x and why need to be given. * The event is triggered with or without checking of the change event criteria depending * on the configuration choosen with set_change_event(). * * @param attr_name The name of the attribute * @param p_data Pointer to the data to be pushed * @param t The time stamp * @param qual The attribute quality factor * @param x The attribute x length. Default value is 1 * @param y The attribute y length. Default value is 0 * @param release The release flag. If true, memory pointed to by p_data will be * freed after being send to the client. Default value is false. * @exception DevFailed If the attribute data type is not coherent. * Click here to read * DevFailed exception specification */ #ifdef _TG_WINDOWS_ void push_change_event (string attr_name, Tango::DevLong *p_data, struct _timeb &t, Tango::AttrQuality qual, long x = 1,long y = 0,bool release = false); #else void push_change_event (string attr_name, Tango::DevLong *p_data, struct timeval &t, Tango::AttrQuality qual, long x = 1,long y = 0,bool release = false); #endif /** * Push a change event for an attribute with Tango::DevLong64 attribute data type. * The event is pushed to the notification daemon. * * The method needs the attribue name, a pointer to the data to be pushed, the time stamp * for the data and the attribute quality factor as input. * Depending on the attribute type the dimensions x and why need to be given. * The event is triggered with or without checking of the change event criteria depending * on the configuration choosen with set_change_event(). * * @param attr_name The name of the attribute * @param p_data Pointer to the data to be pushed * @param t The time stamp * @param qual The attribute quality factor * @param x The attribute x length. Default value is 1 * @param y The attribute y length. Default value is 0 * @param release The release flag. If true, memory pointed to by p_data will be * freed after being send to the client. Default value is false. * @exception DevFailed If the attribute data type is not coherent. * Click here to read * DevFailed exception specification */ #ifdef _TG_WINDOWS_ void push_change_event (string attr_name, Tango::DevLong64 *p_data, struct _timeb &t, Tango::AttrQuality qual, long x = 1,long y = 0,bool release = false); #else void push_change_event (string attr_name, Tango::DevLong64 *p_data, struct timeval &t, Tango::AttrQuality qual, long x = 1,long y = 0,bool release = false); #endif /** * Push a change event for an attribute with Tango::DevFloat attribute data type. * The event is pushed to the notification daemon. * * The method needs the attribue name, a pointer to the data to be pushed, the time stamp * for the data and the attribute quality factor as input. * Depending on the attribute type the dimensions x and why need to be given. * The event is triggered with or without checking of the change event criteria depending * on the configuration choosen with set_change_event(). * * @param attr_name The name of the attribute * @param p_data Pointer to the data to be pushed * @param t The time stamp * @param qual The attribute quality factor * @param x The attribute x length. Default value is 1 * @param y The attribute y length. Default value is 0 * @param release The release flag. If true, memory pointed to by p_data will be * freed after being send to the client. Default value is false. * @exception DevFailed If the attribute data type is not coherent. * Click here to read * DevFailed exception specification */ #ifdef _TG_WINDOWS_ void push_change_event (string attr_name, Tango::DevFloat *p_data, struct _timeb &t, Tango::AttrQuality qual, long x = 1,long y = 0,bool release = false); #else void push_change_event (string attr_name, Tango::DevFloat *p_data, struct timeval &t, Tango::AttrQuality qual, long x = 1,long y = 0,bool release = false); #endif /** * Push a change event for an attribute with Tango::DevDouble attribute data type. * The event is pushed to the notification daemon. * * The method needs the attribue name, a pointer to the data to be pushed, the time stamp * for the data and the attribute quality factor as input. * Depending on the attribute type the dimensions x and why need to be given. * The event is triggered with or without checking of the change event criteria depending * on the configuration choosen with set_change_event(). * * @param attr_name The name of the attribute * @param p_data Pointer to the data to be pushed * @param t The time stamp * @param qual The attribute quality factor * @param x The attribute x length. Default value is 1 * @param y The attribute y length. Default value is 0 * @param release The release flag. If true, memory pointed to by p_data will be * freed after being send to the client. Default value is false. * @exception DevFailed If the attribute data type is not coherent. * Click here to read * DevFailed exception specification */ #ifdef _TG_WINDOWS_ void push_change_event (string attr_name, Tango::DevDouble *p_data, struct _timeb &t, Tango::AttrQuality qual, long x = 1,long y = 0,bool release = false); #else void push_change_event (string attr_name, Tango::DevDouble *p_data, struct timeval &t, Tango::AttrQuality qual, long x = 1,long y = 0,bool release = false); #endif /** * Push a change event for an attribute with Tango::DevString attribute data type. * The event is pushed to the notification daemon. * * The method needs the attribue name, a pointer to the data to be pushed, the time stamp * for the data and the attribute quality factor as input. * Depending on the attribute type the dimensions x and why need to be given. * The event is triggered with or without checking of the change event criteria depending * on the configuration choosen with set_change_event(). * * @param attr_name The name of the attribute * @param p_data Pointer to the data to be pushed * @param t The time stamp * @param qual The attribute quality factor * @param x The attribute x length. Default value is 1 * @param y The attribute y length. Default value is 0 * @param release The release flag. If true, memory pointed to by p_data will be * freed after being send to the client. Default value is false. * @exception DevFailed If the attribute data type is not coherent. * Click here to read * DevFailed exception specification */ #ifdef _TG_WINDOWS_ void push_change_event (string attr_name, Tango::DevString *p_data, struct _timeb &t, Tango::AttrQuality qual, long x = 1,long y = 0,bool release = false); #else void push_change_event (string attr_name, Tango::DevString *p_data, struct timeval &t, Tango::AttrQuality qual, long x = 1,long y = 0,bool release = false); #endif /** * Push a change event for an attribute with Tango::DevBoolean attribute data type. * The event is pushed to the notification daemon. * * The method needs the attribue name, a pointer to the data to be pushed, the time stamp * for the data and the attribute quality factor as input. * Depending on the attribute type the dimensions x and why need to be given. * The event is triggered with or without checking of the change event criteria depending * on the configuration choosen with set_change_event(). * * @param attr_name The name of the attribute * @param p_data Pointer to the data to be pushed * @param t The time stamp * @param qual The attribute quality factor * @param x The attribute x length. Default value is 1 * @param y The attribute y length. Default value is 0 * @param release The release flag. If true, memory pointed to by p_data will be * freed after being send to the client. Default value is false. * @exception DevFailed If the attribute data type is not coherent. * Click here to read * DevFailed exception specification */ #ifdef _TG_WINDOWS_ void push_change_event (string attr_name, Tango::DevBoolean *p_data, struct _timeb &t, Tango::AttrQuality qual, long x = 1,long y = 0,bool release = false); #else void push_change_event (string attr_name, Tango::DevBoolean *p_data, struct timeval &t, Tango::AttrQuality qual, long x = 1,long y = 0,bool release = false); #endif /** * Push a change event for an attribute with Tango::DevUShort attribute data type. * The event is pushed to the notification daemon. * * The method needs the attribue name, a pointer to the data to be pushed, the time stamp * for the data and the attribute quality factor as input. * Depending on the attribute type the dimensions x and why need to be given. * The event is triggered with or without checking of the change event criteria depending * on the configuration choosen with set_change_event(). * * @param attr_name The name of the attribute * @param p_data Pointer to the data to be pushed * @param t The time stamp * @param qual The attribute quality factor * @param x The attribute x length. Default value is 1 * @param y The attribute y length. Default value is 0 * @param release The release flag. If true, memory pointed to by p_data will be * freed after being send to the client. Default value is false. * @exception DevFailed If the attribute data type is not coherent. * Click here to read * DevFailed exception specification */ #ifdef _TG_WINDOWS_ void push_change_event (string attr_name, Tango::DevUShort *p_data, struct _timeb &t, Tango::AttrQuality qual, long x = 1,long y = 0,bool release = false); #else void push_change_event (string attr_name, Tango::DevUShort *p_data, struct timeval &t, Tango::AttrQuality qual, long x = 1,long y = 0,bool release = false); #endif /** * Push a change event for an attribute with Tango::DevUChar attribute data type. * The event is pushed to the notification daemon. * * The method needs the attribue name, a pointer to the data to be pushed, the time stamp * for the data and the attribute quality factor as input. * Depending on the attribute type the dimensions x and why need to be given. * The event is triggered with or without checking of the change event criteria depending * on the configuration choosen with set_change_event(). * * @param attr_name The name of the attribute * @param p_data Pointer to the data to be pushed * @param t The time stamp * @param qual The attribute quality factor * @param x The attribute x length. Default value is 1 * @param y The attribute y length. Default value is 0 * @param release The release flag. If true, memory pointed to by p_data will be * freed after being send to the client. Default value is false. * @exception DevFailed If the attribute data type is not coherent. * Click here to read * DevFailed exception specification */ #ifdef _TG_WINDOWS_ void push_change_event (string attr_name, Tango::DevUChar *p_data, struct _timeb &t, Tango::AttrQuality qual, long x = 1,long y = 0,bool release = false); #else void push_change_event (string attr_name, Tango::DevUChar *p_data, struct timeval &t, Tango::AttrQuality qual, long x = 1,long y = 0,bool release = false); #endif /** * Push a change event for an attribute with Tango::DevULong attribute data type. * The event is pushed to the notification daemon. * * The method needs the attribue name, a pointer to the data to be pushed, the time stamp * for the data and the attribute quality factor as input. * Depending on the attribute type the dimensions x and why need to be given. * The event is triggered with or without checking of the change event criteria depending * on the configuration choosen with set_change_event(). * * @param attr_name The name of the attribute * @param p_data Pointer to the data to be pushed * @param t The time stamp * @param qual The attribute quality factor * @param x The attribute x length. Default value is 1 * @param y The attribute y length. Default value is 0 * @param release The release flag. If true, memory pointed to by p_data will be * freed after being send to the client. Default value is false. * @exception DevFailed If the attribute data type is not coherent. * Click here to read * DevFailed exception specification */ #ifdef _TG_WINDOWS_ void push_change_event (string attr_name, Tango::DevULong *p_data, struct _timeb &t, Tango::AttrQuality qual, long x = 1,long y = 0,bool release = false); #else void push_change_event (string attr_name, Tango::DevULong *p_data, struct timeval &t, Tango::AttrQuality qual, long x = 1,long y = 0,bool release = false); #endif /** * Push a change event for an attribute with Tango::DevULong64 attribute data type. * The event is pushed to the notification daemon. * * The method needs the attribue name, a pointer to the data to be pushed, the time stamp * for the data and the attribute quality factor as input. * Depending on the attribute type the dimensions x and why need to be given. * The event is triggered with or without checking of the change event criteria depending * on the configuration choosen with set_change_event(). * * @param attr_name The name of the attribute * @param p_data Pointer to the data to be pushed * @param t The time stamp * @param qual The attribute quality factor * @param x The attribute x length. Default value is 1 * @param y The attribute y length. Default value is 0 * @param release The release flag. If true, memory pointed to by p_data will be * freed after being send to the client. Default value is false. * @exception DevFailed If the attribute data type is not coherent. * Click here to read * DevFailed exception specification */ #ifdef _TG_WINDOWS_ void push_change_event (string attr_name, Tango::DevULong64 *p_data, struct _timeb &t, Tango::AttrQuality qual, long x = 1,long y = 0,bool release = false); #else void push_change_event (string attr_name, Tango::DevULong64 *p_data, struct timeval &t, Tango::AttrQuality qual, long x = 1,long y = 0,bool release = false); #endif /** * Push a change event for an attribute with Tango::DevState attribute data type. * The event is pushed to the notification daemon. * * The method needs the attribue name, a pointer to the data to be pushed, the time stamp * for the data and the attribute quality factor as input. * Depending on the attribute type the dimensions x and why need to be given. * The event is triggered with or without checking of the change event criteria depending * on the configuration choosen with set_change_event(). * * @param attr_name The name of the attribute * @param p_data Pointer to the data to be pushed * @param t The time stamp * @param qual The attribute quality factor * @param x The attribute x length. Default value is 1 * @param y The attribute y length. Default value is 0 * @param release The release flag. If true, memory pointed to by p_data will be * freed after being send to the client. Default value is false. * @exception DevFailed If the attribute data type is not coherent. * Click here to read * DevFailed exception specification */ #ifdef _TG_WINDOWS_ void push_change_event (string attr_name, Tango::DevState *p_data, struct _timeb &t, Tango::AttrQuality qual, long x = 1,long y = 0,bool release = false); #else void push_change_event (string attr_name, Tango::DevState *p_data, struct timeval &t, Tango::AttrQuality qual, long x = 1,long y = 0,bool release = false); #endif /** * Push a change event for an attribute with Tango::DevEncoded attribute data type. * The event is pushed to the notification daemon. * * The method needs the attribue name, a pointer to the data to be pushed, the time stamp * for the data and the attribute quality factor as input. * Depending on the attribute type the dimensions x and why need to be given. * The event is triggered with or without checking of the change event criteria depending * on the configuration choosen with set_change_event(). * * @param attr_name The name of the attribute * @param p_data Pointer to the data to be pushed * @param t The time stamp * @param qual The attribute quality factor * @param x The attribute x length. Default value is 1 * @param y The attribute y length. Default value is 0 * @param release The release flag. If true, memory pointed to by p_data will be * freed after being send to the client. Default value is false. * @exception DevFailed If the attribute data type is not coherent. * Click here to read * DevFailed exception specification */ #ifdef _TG_WINDOWS_ void push_change_event (string attr_name, Tango::DevEncoded *p_data, struct _timeb &t, Tango::AttrQuality qual, long x = 1,long y = 0,bool release = false); #else void push_change_event (string attr_name, Tango::DevEncoded *p_data, struct timeval &t, Tango::AttrQuality qual, long x = 1,long y = 0,bool release = false); #endif /** * Push a change event for an attribute with Tango::DevEncoded attribute data type * when the data rea specified with two pointers. * The event is pushed to the notification daemon. * * The method needs the attribue name, a pointer to the data to be pushed, the time stamp * for the data and the attribute quality factor as input. * Depending on the attribute type the dimensions x and why need to be given. * The event is triggered with or without checking of the change event criteria depending * on the configuration choosen with set_change_event(). * * @param attr_name The name of the attribute * @param p_str_data Pointer to the data string part to be pushed * @param p_data Pointer to the data to be pushed * @param size Size of the data to be ushed (pointed to be p_data * @param t The time stamp * @param qual The attribute quality factor * @param release The release flag. If true, memory pointed to by p_data will be * freed after being send to the client. Default value is false. * @exception DevFailed If the attribute data type is not coherent. * Click here to read * DevFailed exception specification */ #ifdef _TG_WINDOWS_ void push_change_event (string attr_name, Tango::DevString *p_str_data, Tango::DevUChar *p_data, long size, struct _timeb &t, Tango::AttrQuality qual, bool release = false); #else void push_change_event (string attr_name, Tango::DevString *p_str_data, Tango::DevUChar *p_data, long size, struct timeval &t, Tango::AttrQuality qual, bool release = false); #endif //@} /**@name Push archive event methods. * These methods allow to fire archive events for attributes manually, * without the polling to be started. */ //@{ /** * Set an implemented flag for the attribute to indicate that the server fires archive events manually, * without the polling to be started. * If the detect parameter is set to true, the criteria specified for the archive * event are verified and the event is only pushed if they are fullfilled. * If detect is set to false the event is fired without any value checking! * * @param attr_name The name of the attribute * @param implemented True when the server fires archive events manually. * @param detect Triggers the verification of the archive event properties when set to true. Default value is true. */ void set_archive_event (string attr_name, bool implemented, bool detect = true); /** * Push an archive event for a state or status attribute or return an exception as archive * event for any attribute. * The event is pushed to the notification daemon. * * The method needs the attribue name as input. * For the state and status attributes the actual state and status values are pushed. * In case of an exception, the exception is pushed as an archive event for the attribute. * * @param attr_name The name of the attribute * @param except Pointer to a Tango::DevFailed exception. Default value is NULL. */ void push_archive_event (string attr_name, DevFailed *except = NULL); /** * Push an archive event for an attribute with Tango::DevShort attribute data type. * The event is pushed to the notification daemon. * * The method needs the attribue name and a pointer to the data to be pushed as input. * Depending on the attribute type the dimensions x and why need to be given. * The time stamp of the event is set to the actual time and the attribute quality * is set to valid. * The event is triggered with or without checking of the archive event criteria depending * on the configuration choosen with set_archive_event(). * * @param attr_name The name of the attribute * @param p_data Pointer to the data to be pushed * @param x The attribute x length. Default value is 1 * @param y The attribute y length. Default value is 0 * @param release The release flag. If true, memory pointed to by p_data will be * freed after being send to the client. Default value is false. * @exception DevFailed If the attribute data type is not coherent. * Click here to read * DevFailed exception specification */ void push_archive_event (string attr_name, Tango::DevShort *p_data, long x = 1,long y = 0,bool release = false); /** * Push an archive event for an attribute with Tango::DevLong attribute data type. * The event is pushed to the notification daemon. * * The method needs the attribue name and a pointer to the data to be pushed as input. * Depending on the attribute type the dimensions x and why need to be given. * The time stamp of the event is set to the actual time and the attribute quality * is set to valid. * The event is triggered with or without checking of the archive event criteria depending * on the configuration choosen with set_archive_event(). * * @param attr_name The name of the attribute * @param p_data Pointer to the data to be pushed * @param x The attribute x length. Default value is 1 * @param y The attribute y length. Default value is 0 * @param release The release flag. If true, memory pointed to by p_data will be * freed after being send to the client. Default value is false. * @exception DevFailed If the attribute data type is not coherent. * Click here to read * DevFailed exception specification */ void push_archive_event (string attr_name, Tango::DevLong *p_data, long x = 1,long y = 0,bool release = false); /** * Push an archive event for an attribute with Tango::DevLong64 attribute data type. * The event is pushed to the notification daemon. * * The method needs the attribue name and a pointer to the data to be pushed as input. * Depending on the attribute type the dimensions x and why need to be given. * The time stamp of the event is set to the actual time and the attribute quality * is set to valid. * The event is triggered with or without checking of the archive event criteria depending * on the configuration choosen with set_archive_event(). * * @param attr_name The name of the attribute * @param p_data Pointer to the data to be pushed * @param x The attribute x length. Default value is 1 * @param y The attribute y length. Default value is 0 * @param release The release flag. If true, memory pointed to by p_data will be * freed after being send to the client. Default value is false. * @exception DevFailed If the attribute data type is not coherent. * Click here to read * DevFailed exception specification */ void push_archive_event (string attr_name, Tango::DevLong64 *p_data, long x = 1,long y = 0,bool release = false); /** * Push an archive event for an attribute with Tango::DevFloat attribute data type. * The event is pushed to the notification daemon. * * The method needs the attribue name and a pointer to the data to be pushed as input. * Depending on the attribute type the dimensions x and why need to be given. * The time stamp of the event is set to the actual time and the attribute quality * is set to valid. * The event is triggered with or without checking of the archive event criteria depending * on the configuration choosen with set_archive_event(). * * @param attr_name The name of the attribute * @param p_data Pointer to the data to be pushed * @param x The attribute x length. Default value is 1 * @param y The attribute y length. Default value is 0 * @param release The release flag. If true, memory pointed to by p_data will be * freed after being send to the client. Default value is false. * @exception DevFailed If the attribute data type is not coherent. * Click here to read * DevFailed exception specification */ void push_archive_event (string attr_name, Tango::DevFloat *p_data, long x = 1,long y = 0,bool release = false); /** * Push an archive event for an attribute with Tango::DevDouble attribute data type. * The event is pushed to the notification daemon. * * The method needs the attribue name and a pointer to the data to be pushed as input. * Depending on the attribute type the dimensions x and why need to be given. * The time stamp of the event is set to the actual time and the attribute quality * is set to valid. * The event is triggered with or without checking of the archive event criteria depending * on the configuration choosen with set_archive_event(). * * @param attr_name The name of the attribute * @param p_data Pointer to the data to be pushed * @param x The attribute x length. Default value is 1 * @param y The attribute y length. Default value is 0 * @param release The release flag. If true, memory pointed to by p_data will be * freed after being send to the client. Default value is false. * @exception DevFailed If the attribute data type is not coherent. * Click here to read * DevFailed exception specification */ void push_archive_event (string attr_name, Tango::DevDouble *p_data, long x = 1,long y = 0,bool release = false); /** * Push an archive event for an attribute with Tango::DevString attribute data type. * The event is pushed to the notification daemon. * * The method needs the attribue name and a pointer to the data to be pushed as input. * Depending on the attribute type the dimensions x and why need to be given. * The time stamp of the event is set to the actual time and the attribute quality * is set to valid. * The event is triggered with or without checking of the archive event criteria depending * on the configuration choosen with set_archive_event(). * * @param attr_name The name of the attribute * @param p_data Pointer to the data to be pushed * @param x The attribute x length. Default value is 1 * @param y The attribute y length. Default value is 0 * @param release The release flag. If true, memory pointed to by p_data will be * freed after being send to the client. Default value is false. * @exception DevFailed If the attribute data type is not coherent. * Click here to read * DevFailed exception specification */ void push_archive_event (string attr_name, Tango::DevString *p_data, long x = 1,long y = 0,bool release = false); /** * Push an archive event for an attribute with Tango::DevBoolean attribute data type. * The event is pushed to the notification daemon. * * The method needs the attribue name and a pointer to the data to be pushed as input. * Depending on the attribute type the dimensions x and why need to be given. * The time stamp of the event is set to the actual time and the attribute quality * is set to valid. * The event is triggered with or without checking of the archive event criteria depending * on the configuration choosen with set_archive_event(). * * @param attr_name The name of the attribute * @param p_data Pointer to the data to be pushed * @param x The attribute x length. Default value is 1 * @param y The attribute y length. Default value is 0 * @param release The release flag. If true, memory pointed to by p_data will be * freed after being send to the client. Default value is false. * @exception DevFailed If the attribute data type is not coherent. * Click here to read * DevFailed exception specification */ void push_archive_event (string attr_name, Tango::DevBoolean *p_data, long x = 1,long y = 0,bool release = false); /** * Push an archive event for an attribute with Tango::DevUShort attribute data type. * The event is pushed to the notification daemon. * * The method needs the attribue name and a pointer to the data to be pushed as input. * Depending on the attribute type the dimensions x and why need to be given. * The time stamp of the event is set to the actual time and the attribute quality * is set to valid. * The event is triggered with or without checking of the archive event criteria depending * on the configuration choosen with set_archive_event(). * * @param attr_name The name of the attribute * @param p_data Pointer to the data to be pushed * @param x The attribute x length. Default value is 1 * @param y The attribute y length. Default value is 0 * @param release The release flag. If true, memory pointed to by p_data will be * freed after being send to the client. Default value is false. * @exception DevFailed If the attribute data type is not coherent. * Click here to read * DevFailed exception specification */ void push_archive_event (string attr_name, Tango::DevUShort *p_data, long x = 1,long y = 0,bool release = false); /** * Push an archive event for an attribute with Tango::DevUChar attribute data type. * The event is pushed to the notification daemon. * * The method needs the attribue name and a pointer to the data to be pushed as input. * Depending on the attribute type the dimensions x and why need to be given. * The time stamp of the event is set to the actual time and the attribute quality * is set to valid. * The event is triggered with or without checking of the archive event criteria depending * on the configuration choosen with set_archive_event(). * * @param attr_name The name of the attribute * @param p_data Pointer to the data to be pushed * @param x The attribute x length. Default value is 1 * @param y The attribute y length. Default value is 0 * @param release The release flag. If true, memory pointed to by p_data will be * freed after being send to the client. Default value is false. * @exception DevFailed If the attribute data type is not coherent. * Click here to read * DevFailed exception specification */ void push_archive_event (string attr_name, Tango::DevUChar *p_data, long x = 1,long y = 0,bool release = false); /** * Push an archive event for an attribute with Tango::DevULong attribute data type. * The event is pushed to the notification daemon. * * The method needs the attribue name and a pointer to the data to be pushed as input. * Depending on the attribute type the dimensions x and why need to be given. * The time stamp of the event is set to the actual time and the attribute quality * is set to valid. * The event is triggered with or without checking of the archive event criteria depending * on the configuration choosen with set_archive_event(). * * @param attr_name The name of the attribute * @param p_data Pointer to the data to be pushed * @param x The attribute x length. Default value is 1 * @param y The attribute y length. Default value is 0 * @param release The release flag. If true, memory pointed to by p_data will be * freed after being send to the client. Default value is false. * @exception DevFailed If the attribute data type is not coherent. * Click here to read * DevFailed exception specification */ void push_archive_event (string attr_name, Tango::DevULong *p_data, long x = 1,long y = 0,bool release = false); /** * Push an archive event for an attribute with Tango::DevLong64 attribute data type. * The event is pushed to the notification daemon. * * The method needs the attribue name and a pointer to the data to be pushed as input. * Depending on the attribute type the dimensions x and why need to be given. * The time stamp of the event is set to the actual time and the attribute quality * is set to valid. * The event is triggered with or without checking of the archive event criteria depending * on the configuration choosen with set_archive_event(). * * @param attr_name The name of the attribute * @param p_data Pointer to the data to be pushed * @param x The attribute x length. Default value is 1 * @param y The attribute y length. Default value is 0 * @param release The release flag. If true, memory pointed to by p_data will be * freed after being send to the client. Default value is false. * @exception DevFailed If the attribute data type is not coherent. * Click here to read * DevFailed exception specification */ void push_archive_event (string attr_name, Tango::DevULong64 *p_data, long x = 1,long y = 0,bool release = false); /** * Push an archive event for an attribute with Tango::DevState attribute data type. * The event is pushed to the notification daemon. * * The method needs the attribue name and a pointer to the data to be pushed as input. * Depending on the attribute type the dimensions x and why need to be given. * The time stamp of the event is set to the actual time and the attribute quality * is set to valid. * The event is triggered with or without checking of the archive event criteria depending * on the configuration choosen with set_archive_event(). * * @param attr_name The name of the attribute * @param p_data Pointer to the data to be pushed * @param x The attribute x length. Default value is 1 * @param y The attribute y length. Default value is 0 * @param release The release flag. If true, memory pointed to by p_data will be * freed after being send to the client. Default value is false. * @exception DevFailed If the attribute data type is not coherent. * Click here to read * DevFailed exception specification */ void push_archive_event (string attr_name, Tango::DevState *p_data, long x = 1,long y = 0,bool release = false); /** * Push an archive event for an attribute with Tango::DevEncoded attribute data type. * The event is pushed to the notification daemon. * * The method needs the attribue name and a pointer to the data to be pushed as input. * Depending on the attribute type the dimensions x and why need to be given. * The time stamp of the event is set to the actual time and the attribute quality * is set to valid. * The event is triggered with or without checking of the archive event criteria depending * on the configuration choosen with set_archive_event(). * * @param attr_name The name of the attribute * @param p_data Pointer to the data to be pushed * @param x The attribute x length. Default value is 1 * @param y The attribute y length. Default value is 0 * @param release The release flag. If true, memory pointed to by p_data will be * freed after being send to the client. Default value is false. * @exception DevFailed If the attribute data type is not coherent. * Click here to read * DevFailed exception specification */ void push_archive_event (string attr_name, Tango::DevEncoded *p_data, long x = 1,long y = 0,bool release = false); /** * Push an archive event for an attribute with Tango::DevEncoded attribute data type * when the data are specified using two pointers. * The event is pushed to the notification daemon. * * The method needs the attribue name and a pointer to the data to be pushed as input. * Depending on the attribute type the dimensions x and why need to be given. * The time stamp of the event is set to the actual time and the attribute quality * is set to valid. * The event is triggered with or without checking of the archive event criteria depending * on the configuration choosen with set_archive_event(). * * @param attr_name The name of the attribute * @param p_str_data Pointer to the data string part to be pushed * @param p_data Pointer to the data part to be pushed * @param size Size of the data to be pushed (Pointed to by p_data) * @param release The release flag. If true, memory pointed to by p_data will be * freed after being send to the client. Default value is false. * @exception DevFailed If the attribute data type is not coherent. * Click here to read * DevFailed exception specification */ void push_archive_event (string attr_name, Tango::DevString *p_str_data, Tango::DevUChar *p_data, long size, bool release = false); /** * Push an archive event for an attribute with Tango::DevShort attribute data type. * The event is pushed to the notification daemon. * * The method needs the attribue name, a pointer to the data to be pushed, the time stamp * for the data and the attribute quality factor as input. * Depending on the attribute type the dimensions x and why need to be given. * The event is triggered with or without checking of the archive event criteria depending * on the configuration choosen with set_archive_event(). * * @param attr_name The name of the attribute * @param p_data Pointer to the data to be pushed * @param t The time stamp * @param qual The attribute quality factor * @param x The attribute x length. Default value is 1 * @param y The attribute y length. Default value is 0 * @param release The release flag. If true, memory pointed to by p_data will be * freed after being send to the client. Default value is false. * @exception DevFailed If the attribute data type is not coherent. * Click here to read * DevFailed exception specification */ #ifdef _TG_WINDOWS_ void push_archive_event (string attr_name, Tango::DevShort *p_data, struct _timeb &t, Tango::AttrQuality qual, long x = 1,long y = 0,bool release = false); #else void push_archive_event (string attr_name, Tango::DevShort *p_data, struct timeval &t, Tango::AttrQuality qual, long x = 1,long y = 0,bool release = false); #endif /** * Push an archive event for an attribute with Tango::DevLong attribute data type. * The event is pushed to the notification daemon. * * The method needs the attribue name, a pointer to the data to be pushed, the time stamp * for the data and the attribute quality factor as input. * Depending on the attribute type the dimensions x and why need to be given. * The event is triggered with or without checking of the archive event criteria depending * on the configuration choosen with set_archive_event(). * * @param attr_name The name of the attribute * @param p_data Pointer to the data to be pushed * @param t The time stamp * @param qual The attribute quality factor * @param x The attribute x length. Default value is 1 * @param y The attribute y length. Default value is 0 * @param release The release flag. If true, memory pointed to by p_data will be * freed after being send to the client. Default value is false. * @exception DevFailed If the attribute data type is not coherent. * Click here to read * DevFailed exception specification */ #ifdef _TG_WINDOWS_ void push_archive_event (string attr_name, Tango::DevLong *p_data, struct _timeb &t, Tango::AttrQuality qual, long x = 1,long y = 0,bool release = false); #else void push_archive_event (string attr_name, Tango::DevLong *p_data, struct timeval &t, Tango::AttrQuality qual, long x = 1,long y = 0,bool release = false); #endif /** * Push an archive event for an attribute with Tango::DevLong64 attribute data type. * The event is pushed to the notification daemon. * * The method needs the attribue name, a pointer to the data to be pushed, the time stamp * for the data and the attribute quality factor as input. * Depending on the attribute type the dimensions x and why need to be given. * The event is triggered with or without checking of the archive event criteria depending * on the configuration choosen with set_archive_event(). * * @param attr_name The name of the attribute * @param p_data Pointer to the data to be pushed * @param t The time stamp * @param qual The attribute quality factor * @param x The attribute x length. Default value is 1 * @param y The attribute y length. Default value is 0 * @param release The release flag. If true, memory pointed to by p_data will be * freed after being send to the client. Default value is false. * @exception DevFailed If the attribute data type is not coherent. * Click here to read * DevFailed exception specification */ #ifdef _TG_WINDOWS_ void push_archive_event (string attr_name, Tango::DevLong64 *p_data, struct _timeb &t, Tango::AttrQuality qual, long x = 1,long y = 0,bool release = false); #else void push_archive_event (string attr_name, Tango::DevLong64 *p_data, struct timeval &t, Tango::AttrQuality qual, long x = 1,long y = 0,bool release = false); #endif /** * Push an archive event for an attribute with Tango::DevFloat attribute data type. * The event is pushed to the notification daemon. * * The method needs the attribue name, a pointer to the data to be pushed, the time stamp * for the data and the attribute quality factor as input. * Depending on the attribute type the dimensions x and why need to be given. * The event is triggered with or without checking of the archive event criteria depending * on the configuration choosen with set_archive_event(). * * @param attr_name The name of the attribute * @param p_data Pointer to the data to be pushed * @param t The time stamp * @param qual The attribute quality factor * @param x The attribute x length. Default value is 1 * @param y The attribute y length. Default value is 0 * @param release The release flag. If true, memory pointed to by p_data will be * freed after being send to the client. Default value is false. * @exception DevFailed If the attribute data type is not coherent. * Click here to read * DevFailed exception specification */ #ifdef _TG_WINDOWS_ void push_archive_event (string attr_name, Tango::DevFloat *p_data, struct _timeb &t, Tango::AttrQuality qual, long x = 1,long y = 0,bool release = false); #else void push_archive_event (string attr_name, Tango::DevFloat *p_data, struct timeval &t, Tango::AttrQuality qual, long x = 1,long y = 0,bool release = false); #endif /** * Push an archive event for an attribute with Tango::DevDouble attribute data type. * The event is pushed to the notification daemon. * * The method needs the attribue name, a pointer to the data to be pushed, the time stamp * for the data and the attribute quality factor as input. * Depending on the attribute type the dimensions x and why need to be given. * The event is triggered with or without checking of the archive event criteria depending * on the configuration choosen with set_archive_event(). * * @param attr_name The name of the attribute * @param p_data Pointer to the data to be pushed * @param t The time stamp * @param qual The attribute quality factor * @param x The attribute x length. Default value is 1 * @param y The attribute y length. Default value is 0 * @param release The release flag. If true, memory pointed to by p_data will be * freed after being send to the client. Default value is false. * @exception DevFailed If the attribute data type is not coherent. * Click here to read * DevFailed exception specification */ #ifdef _TG_WINDOWS_ void push_archive_event (string attr_name, Tango::DevDouble *p_data, struct _timeb &t, Tango::AttrQuality qual, long x = 1,long y = 0,bool release = false); #else void push_archive_event (string attr_name, Tango::DevDouble *p_data, struct timeval &t, Tango::AttrQuality qual, long x = 1,long y = 0,bool release = false); #endif /** * Push an archive event for an attribute with Tango::DevString attribute data type. * The event is pushed to the notification daemon. * * The method needs the attribue name, a pointer to the data to be pushed, the time stamp * for the data and the attribute quality factor as input. * Depending on the attribute type the dimensions x and why need to be given. * The event is triggered with or without checking of the archive event criteria depending * on the configuration choosen with set_archive_event(). * * @param attr_name The name of the attribute * @param p_data Pointer to the data to be pushed * @param t The time stamp * @param qual The attribute quality factor * @param x The attribute x length. Default value is 1 * @param y The attribute y length. Default value is 0 * @param release The release flag. If true, memory pointed to by p_data will be * freed after being send to the client. Default value is false. * @exception DevFailed If the attribute data type is not coherent. * Click here to read * DevFailed exception specification */ #ifdef _TG_WINDOWS_ void push_archive_event (string attr_name, Tango::DevString *p_data, struct _timeb &t, Tango::AttrQuality qual, long x = 1,long y = 0,bool release = false); #else void push_archive_event (string attr_name, Tango::DevString *p_data, struct timeval &t, Tango::AttrQuality qual, long x = 1,long y = 0,bool release = false); #endif /** * Push an archive event for an attribute with Tango::DevBoolean attribute data type. * The event is pushed to the notification daemon. * * The method needs the attribue name, a pointer to the data to be pushed, the time stamp * for the data and the attribute quality factor as input. * Depending on the attribute type the dimensions x and why need to be given. * The event is triggered with or without checking of the archive event criteria depending * on the configuration choosen with set_archive_event(). * * @param attr_name The name of the attribute * @param p_data Pointer to the data to be pushed * @param t The time stamp * @param qual The attribute quality factor * @param x The attribute x length. Default value is 1 * @param y The attribute y length. Default value is 0 * @param release The release flag. If true, memory pointed to by p_data will be * freed after being send to the client. Default value is false. * @exception DevFailed If the attribute data type is not coherent. * Click here to read * DevFailed exception specification */ #ifdef _TG_WINDOWS_ void push_archive_event (string attr_name, Tango::DevBoolean *p_data, struct _timeb &t, Tango::AttrQuality qual, long x = 1,long y = 0,bool release = false); #else void push_archive_event (string attr_name, Tango::DevBoolean *p_data, struct timeval &t, Tango::AttrQuality qual, long x = 1,long y = 0,bool release = false); #endif /** * Push an archive event for an attribute with Tango::DevUShort attribute data type. * The event is pushed to the notification daemon. * * The method needs the attribue name, a pointer to the data to be pushed, the time stamp * for the data and the attribute quality factor as input. * Depending on the attribute type the dimensions x and why need to be given. * The event is triggered with or without checking of the archive event criteria depending * on the configuration choosen with set_archive_event(). * * @param attr_name The name of the attribute * @param p_data Pointer to the data to be pushed * @param t The time stamp * @param qual The attribute quality factor * @param x The attribute x length. Default value is 1 * @param y The attribute y length. Default value is 0 * @param release The release flag. If true, memory pointed to by p_data will be * freed after being send to the client. Default value is false. * @exception DevFailed If the attribute data type is not coherent. * Click here to read * DevFailed exception specification */ #ifdef _TG_WINDOWS_ void push_archive_event (string attr_name, Tango::DevUShort *p_data, struct _timeb &t, Tango::AttrQuality qual, long x = 1,long y = 0,bool release = false); #else void push_archive_event (string attr_name, Tango::DevUShort *p_data, struct timeval &t, Tango::AttrQuality qual, long x = 1,long y = 0,bool release = false); #endif /** * Push an archive event for an attribute with Tango::DevUChar attribute data type. * The event is pushed to the notification daemon. * * The method needs the attribue name, a pointer to the data to be pushed, the time stamp * for the data and the attribute quality factor as input. * Depending on the attribute type the dimensions x and why need to be given. * The event is triggered with or without checking of the archive event criteria depending * on the configuration choosen with set_archive_event(). * * @param attr_name The name of the attribute * @param p_data Pointer to the data to be pushed * @param t The time stamp * @param qual The attribute quality factor * @param x The attribute x length. Default value is 1 * @param y The attribute y length. Default value is 0 * @param release The release flag. If true, memory pointed to by p_data will be * freed after being send to the client. Default value is false. * @exception DevFailed If the attribute data type is not coherent. * Click here to read * DevFailed exception specification */ #ifdef _TG_WINDOWS_ void push_archive_event (string attr_name, Tango::DevUChar *p_data, struct _timeb &t, Tango::AttrQuality qual, long x = 1,long y = 0,bool release = false); #else void push_archive_event (string attr_name, Tango::DevUChar *p_data, struct timeval &t, Tango::AttrQuality qual, long x = 1,long y = 0,bool release = false); #endif /** * Push an archive event for an attribute with Tango::DevULong attribute data type. * The event is pushed to the notification daemon. * * The method needs the attribue name, a pointer to the data to be pushed, the time stamp * for the data and the attribute quality factor as input. * Depending on the attribute type the dimensions x and why need to be given. * The event is triggered with or without checking of the archive event criteria depending * on the configuration choosen with set_archive_event(). * * @param attr_name The name of the attribute * @param p_data Pointer to the data to be pushed * @param t The time stamp * @param qual The attribute quality factor * @param x The attribute x length. Default value is 1 * @param y The attribute y length. Default value is 0 * @param release The release flag. If true, memory pointed to by p_data will be * freed after being send to the client. Default value is false. * @exception DevFailed If the attribute data type is not coherent. * Click here to read * DevFailed exception specification */ #ifdef _TG_WINDOWS_ void push_archive_event (string attr_name, Tango::DevULong *p_data, struct _timeb &t, Tango::AttrQuality qual, long x = 1,long y = 0,bool release = false); #else void push_archive_event (string attr_name, Tango::DevULong *p_data, struct timeval &t, Tango::AttrQuality qual, long x = 1,long y = 0,bool release = false); #endif /** * Push an archive event for an attribute with Tango::DevULong64 attribute data type. * The event is pushed to the notification daemon. * * The method needs the attribue name, a pointer to the data to be pushed, the time stamp * for the data and the attribute quality factor as input. * Depending on the attribute type the dimensions x and why need to be given. * The event is triggered with or without checking of the archive event criteria depending * on the configuration choosen with set_archive_event(). * * @param attr_name The name of the attribute * @param p_data Pointer to the data to be pushed * @param t The time stamp * @param qual The attribute quality factor * @param x The attribute x length. Default value is 1 * @param y The attribute y length. Default value is 0 * @param release The release flag. If true, memory pointed to by p_data will be * freed after being send to the client. Default value is false. * @exception DevFailed If the attribute data type is not coherent. * Click here to read * DevFailed exception specification */ #ifdef _TG_WINDOWS_ void push_archive_event (string attr_name, Tango::DevULong64 *p_data, struct _timeb &t, Tango::AttrQuality qual, long x = 1,long y = 0,bool release = false); #else void push_archive_event (string attr_name, Tango::DevULong64 *p_data, struct timeval &t, Tango::AttrQuality qual, long x = 1,long y = 0,bool release = false); #endif /** * Push an archive event for an attribute with Tango::DevState attribute data type. * The event is pushed to the notification daemon. * * The method needs the attribue name, a pointer to the data to be pushed, the time stamp * for the data and the attribute quality factor as input. * Depending on the attribute type the dimensions x and why need to be given. * The event is triggered with or without checking of the archive event criteria depending * on the configuration choosen with set_archive_event(). * * @param attr_name The name of the attribute * @param p_data Pointer to the data to be pushed * @param t The time stamp * @param qual The attribute quality factor * @param x The attribute x length. Default value is 1 * @param y The attribute y length. Default value is 0 * @param release The release flag. If true, memory pointed to by p_data will be * freed after being send to the client. Default value is false. * @exception DevFailed If the attribute data type is not coherent. * Click here to read * DevFailed exception specification */ #ifdef _TG_WINDOWS_ void push_archive_event (string attr_name, Tango::DevState *p_data, struct _timeb &t, Tango::AttrQuality qual, long x = 1,long y = 0,bool release = false); #else void push_archive_event (string attr_name, Tango::DevState *p_data, struct timeval &t, Tango::AttrQuality qual, long x = 1,long y = 0,bool release = false); #endif /** * Push an archive event for an attribute with Tango::DevEncoded attribute data type. * The event is pushed to the notification daemon. * * The method needs the attribue name, a pointer to the data to be pushed, the time stamp * for the data and the attribute quality factor as input. * Depending on the attribute type the dimensions x and why need to be given. * The event is triggered with or without checking of the archive event criteria depending * on the configuration choosen with set_archive_event(). * * @param attr_name The name of the attribute * @param p_data Pointer to the data to be pushed * @param t The time stamp * @param qual The attribute quality factor * @param x The attribute x length. Default value is 1 * @param y The attribute y length. Default value is 0 * @param release The release flag. If true, memory pointed to by p_data will be * freed after being send to the client. Default value is false. * @exception DevFailed If the attribute data type is not coherent. * Click here to read * DevFailed exception specification */ #ifdef _TG_WINDOWS_ void push_archive_event (string attr_name, Tango::DevEncoded *p_data, struct _timeb &t, Tango::AttrQuality qual, long x = 1,long y = 0,bool release = false); #else void push_archive_event (string attr_name, Tango::DevEncoded *p_data, struct timeval &t, Tango::AttrQuality qual, long x = 1,long y = 0,bool release = false); #endif /** * Push an archive event for an attribute with Tango::DevEncoded attribute data type * when it is specified using two pointers. * The event is pushed to the notification daemon. * * The method needs the attribue name, a pointer to the data to be pushed, the time stamp * for the data and the attribute quality factor as input. * Depending on the attribute type the dimensions x and why need to be given. * The event is triggered with or without checking of the archive event criteria depending * on the configuration choosen with set_archive_event(). * * @param attr_name The name of the attribute * @param p_str_data Pointer to the data string part to be pushed * @param p_data Pointer to the data to be pushed * @param size Size of the data to be pushed (Pointed to by p_data) * @param t The time stamp * @param qual The attribute quality factor * @param release The release flag. If true, memory pointed to by p_data will be * freed after being send to the client. Default value is false. * @exception DevFailed If the attribute data type is not coherent. * Click here to read * DevFailed exception specification */ #ifdef _TG_WINDOWS_ void push_archive_event (string attr_name, Tango::DevString *p_str_data, Tango::DevUChar *p_data, long size, struct _timeb &t, Tango::AttrQuality qual, bool release = false); #else void push_archive_event (string attr_name, Tango::DevString *p_str_data, Tango::DevUChar *p_data, long size, struct timeval &t, Tango::AttrQuality qual, bool release = false); #endif //@} /**@name Push user event methods. * These methods allow to fire user events for attributes manually, * without the polling to be started. */ //@{ /** * Push a user event for a state or status attribute or return an exception as user * event for any attribute. * The event is pushed to the notification daemon. * * The method needs the attribue name as input. * For the state and status attributes the actual state and status values are pushed. * In case of an exception, the exception is pushed as a user event for the attribute. * * @param attr_name The name of the attribute * @param filt_names The filterable fields name * @param filt_vals The filterable fields value (as double) * @param except Pointer to a Tango::DevFailed exception. Default value is NULL. */ void push_event (string attr_name,vector &filt_names,vector &filt_vals,DevFailed *except = NULL); /** * Push a user event for an attribute with Tango::DevShort attribute data type. * The event is pushed to the notification daemon. * * The method needs the attribue name and a pointer to the data to be pushed as input. * Depending on the attribute type the dimensions x and why need to be given. * The time stamp of the event is set to the actual time and the attribute quality * is set to valid. * * @param attr_name The name of the attribute * @param filt_names The filterable fields name * @param filt_vals The filterable fields value (as double) * @param p_data Pointer to the data to be pushed * @param x The attribute x length. Default value is 1 * @param y The attribute y length. Default value is 0 * @param release The release flag. If true, memory pointed to by p_data will be * freed after being send to the client. Default value is false. * @exception DevFailed If the attribute data type is not coherent. * Click here to read * DevFailed exception specification */ void push_event (string attr_name,vector &filt_names,vector &filt_vals,Tango::DevShort *p_data, long x = 1,long y = 0,bool release = false); /** * Push a user event for an attribute with Tango::DevLong attribute data type. * The event is pushed to the notification daemon. * * The method needs the attribue name and a pointer to the data to be pushed as input. * Depending on the attribute type the dimensions x and why need to be given. * The time stamp of the event is set to the actual time and the attribute quality * is set to valid. * * @param attr_name The name of the attribute * @param filt_names The filterable fields name * @param filt_vals The filterable fields value (as double) * @param p_data Pointer to the data to be pushed * @param x The attribute x length. Default value is 1 * @param y The attribute y length. Default value is 0 * @param release The release flag. If true, memory pointed to by p_data will be * freed after being send to the client. Default value is false. * @exception DevFailed If the attribute data type is not coherent. * Click here to read * DevFailed exception specification */ void push_event (string attr_name,vector &filt_names,vector &filt_vals,Tango::DevLong *p_data, long x = 1,long y = 0,bool release = false); /** * Push a user event for an attribute with Tango::DevLong64 attribute data type. * The event is pushed to the notification daemon. * * The method needs the attribue name and a pointer to the data to be pushed as input. * Depending on the attribute type the dimensions x and why need to be given. * The time stamp of the event is set to the actual time and the attribute quality * is set to valid. * * @param attr_name The name of the attribute * @param filt_names The filterable fields name * @param filt_vals The filterable fields value (as double) * @param p_data Pointer to the data to be pushed * @param x The attribute x length. Default value is 1 * @param y The attribute y length. Default value is 0 * @param release The release flag. If true, memory pointed to by p_data will be * freed after being send to the client. Default value is false. * @exception DevFailed If the attribute data type is not coherent. * Click here to read * DevFailed exception specification */ void push_event (string attr_name,vector &filt_names,vector &filt_vals,Tango::DevLong64 *p_data, long x = 1,long y = 0,bool release = false); /** * Push a user event for an attribute with Tango::DevFloat attribute data type. * The event is pushed to the notification daemon. * * The method needs the attribue name and a pointer to the data to be pushed as input. * Depending on the attribute type the dimensions x and why need to be given. * The time stamp of the event is set to the actual time and the attribute quality * is set to valid. * * @param attr_name The name of the attribute * @param filt_names The filterable fields name * @param filt_vals The filterable fields value (as double) * @param p_data Pointer to the data to be pushed * @param x The attribute x length. Default value is 1 * @param y The attribute y length. Default value is 0 * @param release The release flag. If true, memory pointed to by p_data will be * freed after being send to the client. Default value is false. * @exception DevFailed If the attribute data type is not coherent. * Click here to read * DevFailed exception specification */ void push_event (string attr_name,vector &filt_names,vector &filt_vals,Tango::DevFloat *p_data, long x = 1,long y = 0,bool release = false); /** * Push a user event for an attribute with Tango::DevDouble attribute data type. * The event is pushed to the notification daemon. * * The method needs the attribue name and a pointer to the data to be pushed as input. * Depending on the attribute type the dimensions x and why need to be given. * The time stamp of the event is set to the actual time and the attribute quality * is set to valid. * * @param attr_name The name of the attribute * @param filt_names The filterable fields name * @param filt_vals The filterable fields value (as double) * @param p_data Pointer to the data to be pushed * @param x The attribute x length. Default value is 1 * @param y The attribute y length. Default value is 0 * @param release The release flag. If true, memory pointed to by p_data will be * freed after being send to the client. Default value is false. * @exception DevFailed If the attribute data type is not coherent. * Click here to read * DevFailed exception specification */ void push_event (string attr_name,vector &filt_names,vector &filt_vals,Tango::DevDouble *p_data, long x = 1,long y = 0,bool release = false); /** * Push a user event for an attribute with Tango::DevString attribute data type. * The event is pushed to the notification daemon. * * The method needs the attribue name and a pointer to the data to be pushed as input. * Depending on the attribute type the dimensions x and why need to be given. * The time stamp of the event is set to the actual time and the attribute quality * is set to valid. * * @param attr_name The name of the attribute * @param filt_names The filterable fields name * @param filt_vals The filterable fields value (as double) * @param p_data Pointer to the data to be pushed * @param x The attribute x length. Default value is 1 * @param y The attribute y length. Default value is 0 * @param release The release flag. If true, memory pointed to by p_data will be * freed after being send to the client. Default value is false. * @exception DevFailed If the attribute data type is not coherent. * Click here to read * DevFailed exception specification */ void push_event (string attr_name,vector &filt_names,vector &filt_vals,Tango::DevString *p_data, long x = 1,long y = 0,bool release = false); /** * Push a user event for an attribute with Tango::DevBoolean attribute data type. * The event is pushed to the notification daemon. * * The method needs the attribue name and a pointer to the data to be pushed as input. * Depending on the attribute type the dimensions x and why need to be given. * The time stamp of the event is set to the actual time and the attribute quality * is set to valid. * * @param attr_name The name of the attribute * @param filt_names The filterable fields name * @param filt_vals The filterable fields value (as double) * @param p_data Pointer to the data to be pushed * @param x The attribute x length. Default value is 1 * @param y The attribute y length. Default value is 0 * @param release The release flag. If true, memory pointed to by p_data will be * freed after being send to the client. Default value is false. * @exception DevFailed If the attribute data type is not coherent. * Click here to read * DevFailed exception specification */ void push_event (string attr_name,vector &filt_names,vector &filt_vals,Tango::DevBoolean *p_data, long x = 1,long y = 0,bool release = false); /** * Push a user event for an attribute with Tango::DevUShort attribute data type. * The event is pushed to the notification daemon. * * The method needs the attribue name and a pointer to the data to be pushed as input. * Depending on the attribute type the dimensions x and why need to be given. * The time stamp of the event is set to the actual time and the attribute quality * is set to valid. * * @param attr_name The name of the attribute * @param filt_names The filterable fields name * @param filt_vals The filterable fields value (as double) * @param p_data Pointer to the data to be pushed * @param x The attribute x length. Default value is 1 * @param y The attribute y length. Default value is 0 * @param release The release flag. If true, memory pointed to by p_data will be * freed after being send to the client. Default value is false. * @exception DevFailed If the attribute data type is not coherent. * Click here to read * DevFailed exception specification */ void push_event (string attr_name,vector &filt_names,vector &filt_vals,Tango::DevUShort *p_data, long x = 1,long y = 0,bool release = false); /** * Push a user event for an attribute with Tango::DevUChar attribute data type. * The event is pushed to the notification daemon. * * The method needs the attribue name and a pointer to the data to be pushed as input. * Depending on the attribute type the dimensions x and why need to be given. * The time stamp of the event is set to the actual time and the attribute quality * is set to valid. * * @param attr_name The name of the attribute * @param filt_names The filterable fields name * @param filt_vals The filterable fields value (as double) * @param p_data Pointer to the data to be pushed * @param x The attribute x length. Default value is 1 * @param y The attribute y length. Default value is 0 * @param release The release flag. If true, memory pointed to by p_data will be * freed after being send to the client. Default value is false. * @exception DevFailed If the attribute data type is not coherent. * Click here to read * DevFailed exception specification */ void push_event (string attr_name,vector &filt_names,vector &filt_vals,Tango::DevUChar *p_data, long x = 1,long y = 0,bool release = false); /** * Push a user event for an attribute with Tango::DevULong attribute data type. * The event is pushed to the notification daemon. * * The method needs the attribue name and a pointer to the data to be pushed as input. * Depending on the attribute type the dimensions x and why need to be given. * The time stamp of the event is set to the actual time and the attribute quality * is set to valid. * * @param attr_name The name of the attribute * @param filt_names The filterable fields name * @param filt_vals The filterable fields value (as double) * @param p_data Pointer to the data to be pushed * @param x The attribute x length. Default value is 1 * @param y The attribute y length. Default value is 0 * @param release The release flag. If true, memory pointed to by p_data will be * freed after being send to the client. Default value is false. * @exception DevFailed If the attribute data type is not coherent. * Click here to read * DevFailed exception specification */ void push_event (string attr_name,vector &filt_names,vector &filt_vals,Tango::DevULong *p_data, long x = 1,long y = 0,bool release = false); /** * Push a user event for an attribute with Tango::DevULong64 attribute data type. * The event is pushed to the notification daemon. * * The method needs the attribue name and a pointer to the data to be pushed as input. * Depending on the attribute type the dimensions x and why need to be given. * The time stamp of the event is set to the actual time and the attribute quality * is set to valid. * * @param attr_name The name of the attribute * @param filt_names The filterable fields name * @param filt_vals The filterable fields value (as double) * @param p_data Pointer to the data to be pushed * @param x The attribute x length. Default value is 1 * @param y The attribute y length. Default value is 0 * @param release The release flag. If true, memory pointed to by p_data will be * freed after being send to the client. Default value is false. * @exception DevFailed If the attribute data type is not coherent. * Click here to read * DevFailed exception specification */ void push_event (string attr_name,vector &filt_names,vector &filt_vals,Tango::DevULong64 *p_data, long x = 1,long y = 0,bool release = false); /** * Push a user event for an attribute with Tango::DevState attribute data type. * The event is pushed to the notification daemon. * * The method needs the attribue name and a pointer to the data to be pushed as input. * Depending on the attribute type the dimensions x and why need to be given. * The time stamp of the event is set to the actual time and the attribute quality * is set to valid. * * @param attr_name The name of the attribute * @param filt_names The filterable fields name * @param filt_vals The filterable fields value (as double) * @param p_data Pointer to the data to be pushed * @param x The attribute x length. Default value is 1 * @param y The attribute y length. Default value is 0 * @param release The release flag. If true, memory pointed to by p_data will be * freed after being send to the client. Default value is false. * @exception DevFailed If the attribute data type is not coherent. * Click here to read * DevFailed exception specification */ void push_event (string attr_name,vector &filt_names,vector &filt_vals,Tango::DevState *p_data, long x = 1,long y = 0,bool release = false); /** * Push a user event for an attribute with Tango::DevEncoded attribute data type. * The event is pushed to the notification daemon. * * The method needs the attribue name and a pointer to the data to be pushed as input. * Depending on the attribute type the dimensions x and why need to be given. * The time stamp of the event is set to the actual time and the attribute quality * is set to valid. * * @param attr_name The name of the attribute * @param filt_names The filterable fields name * @param filt_vals The filterable fields value (as double) * @param p_data Pointer to the data to be pushed * @param x The attribute x length. Default value is 1 * @param y The attribute y length. Default value is 0 * @param release The release flag. If true, memory pointed to by p_data will be * freed after being send to the client. Default value is false. * @exception DevFailed If the attribute data type is not coherent. * Click here to read * DevFailed exception specification */ void push_event (string attr_name,vector &filt_names,vector &filt_vals,Tango::DevEncoded *p_data, long x = 1,long y = 0,bool release = false); /** * Push a user event for an attribute with Tango::DevEncoded attribute data type * when the attribute data are specified with 2 pointers. * The event is pushed to the notification daemon. * * The method needs the attribue name and a pointer to the data to be pushed as input. * Depending on the attribute type the dimensions x and why need to be given. * The time stamp of the event is set to the actual time and the attribute quality * is set to valid. * * @param attr_name The name of the attribute * @param filt_names The filterable fields name * @param filt_vals The filterable fields value (as double) * @param p_str_data Pointer to the string sent with the data * @param p_data Pointer to the data to be pushed * @param size The data number (pointed to by p_data) * @param release The release flag. If true, memory pointed to by p_data will be * freed after being send to the client. Default value is false. * @exception DevFailed If the attribute data type is not coherent. * Click here to read * DevFailed exception specification */ void push_event (string attr_name,vector &filt_names,vector &filt_vals,Tango::DevString *p_str_data, Tango::DevUChar *p_data, long size, bool release = false); /** * Push a user event for an attribute with Tango::DevShort attribute data type. * The event is pushed to the notification daemon. * * The method needs the attribue name, a pointer to the data to be pushed, the time stamp * for the data and the attribute quality factor as input. * Depending on the attribute type the dimensions x and why need to be given. * * @param attr_name The name of the attribute * @param filt_names The filterable fields name * @param filt_vals The filterable fields value (as double) * @param p_data Pointer to the data to be pushed * @param t The time stamp * @param qual The attribute quality factor * @param x The attribute x length. Default value is 1 * @param y The attribute y length. Default value is 0 * @param release The release flag. If true, memory pointed to by p_data will be * freed after being send to the client. Default value is false. * @exception DevFailed If the attribute data type is not coherent. * Click here to read * DevFailed exception specification */ #ifdef _TG_WINDOWS_ void push_event (string attr_name,vector &filt_names,vector &filt_vals,Tango::DevShort *p_data, struct _timeb &t, Tango::AttrQuality qual, long x = 1,long y = 0,bool release = false); #else void push_event (string attr_name,vector &filt_names,vector &filt_vals,Tango::DevShort *p_data, struct timeval &t, Tango::AttrQuality qual, long x = 1,long y = 0,bool release = false); #endif /** * Push a user event for an attribute with Tango::DevLong attribute data type. * The event is pushed to the notification daemon. * * The method needs the attribue name, a pointer to the data to be pushed, the time stamp * for the data and the attribute quality factor as input. * Depending on the attribute type the dimensions x and why need to be given. * * @param attr_name The name of the attribute * @param filt_names The filterable fields name * @param filt_vals The filterable fields value (as double) * @param p_data Pointer to the data to be pushed * @param t The time stamp * @param qual The attribute quality factor * @param x The attribute x length. Default value is 1 * @param y The attribute y length. Default value is 0 * @param release The release flag. If true, memory pointed to by p_data will be * freed after being send to the client. Default value is false. * @exception DevFailed If the attribute data type is not coherent. * Click here to read * DevFailed exception specification */ #ifdef _TG_WINDOWS_ void push_event (string attr_name,vector &filt_names,vector &filt_vals,Tango::DevLong *p_data, struct _timeb &t, Tango::AttrQuality qual, long x = 1,long y = 0,bool release = false); #else void push_event (string attr_name,vector &filt_names,vector &filt_vals,Tango::DevLong *p_data, struct timeval &t, Tango::AttrQuality qual, long x = 1,long y = 0,bool release = false); #endif /** * Push a user event for an attribute with Tango::DevLong64 attribute data type. * The event is pushed to the notification daemon. * * The method needs the attribue name, a pointer to the data to be pushed, the time stamp * for the data and the attribute quality factor as input. * Depending on the attribute type the dimensions x and why need to be given. * * @param attr_name The name of the attribute * @param filt_names The filterable fields name * @param filt_vals The filterable fields value (as double) * @param p_data Pointer to the data to be pushed * @param t The time stamp * @param qual The attribute quality factor * @param x The attribute x length. Default value is 1 * @param y The attribute y length. Default value is 0 * @param release The release flag. If true, memory pointed to by p_data will be * freed after being send to the client. Default value is false. * @exception DevFailed If the attribute data type is not coherent. * Click here to read * DevFailed exception specification */ #ifdef _TG_WINDOWS_ void push_event (string attr_name,vector &filt_names,vector &filt_vals,Tango::DevLong64 *p_data, struct _timeb &t, Tango::AttrQuality qual, long x = 1,long y = 0,bool release = false); #else void push_event (string attr_name,vector &filt_names,vector &filt_vals,Tango::DevLong64 *p_data, struct timeval &t, Tango::AttrQuality qual, long x = 1,long y = 0,bool release = false); #endif /** * Push a user event for an attribute with Tango::DevFloat attribute data type. * The event is pushed to the notification daemon. * * The method needs the attribue name, a pointer to the data to be pushed, the time stamp * for the data and the attribute quality factor as input. * Depending on the attribute type the dimensions x and why need to be given. * * @param attr_name The name of the attribute * @param filt_names The filterable fields name * @param filt_vals The filterable fields value (as double) * @param p_data Pointer to the data to be pushed * @param t The time stamp * @param qual The attribute quality factor * @param x The attribute x length. Default value is 1 * @param y The attribute y length. Default value is 0 * @param release The release flag. If true, memory pointed to by p_data will be * freed after being send to the client. Default value is false. * @exception DevFailed If the attribute data type is not coherent. * Click here to read * DevFailed exception specification */ #ifdef _TG_WINDOWS_ void push_event (string attr_name,vector &filt_names,vector &filt_vals,Tango::DevFloat *p_data, struct _timeb &t, Tango::AttrQuality qual, long x = 1,long y = 0,bool release = false); #else void push_event (string attr_name,vector &filt_names,vector &filt_vals,Tango::DevFloat *p_data, struct timeval &t, Tango::AttrQuality qual, long x = 1,long y = 0,bool release = false); #endif /** * Push a user event for an attribute with Tango::DevDouble attribute data type. * The event is pushed to the notification daemon. * * The method needs the attribue name, a pointer to the data to be pushed, the time stamp * for the data and the attribute quality factor as input. * Depending on the attribute type the dimensions x and why need to be given. * * @param attr_name The name of the attribute * @param filt_names The filterable fields name * @param filt_vals The filterable fields value (as double) * @param p_data Pointer to the data to be pushed * @param t The time stamp * @param qual The attribute quality factor * @param x The attribute x length. Default value is 1 * @param y The attribute y length. Default value is 0 * @param release The release flag. If true, memory pointed to by p_data will be * freed after being send to the client. Default value is false. * @exception DevFailed If the attribute data type is not coherent. * Click here to read * DevFailed exception specification */ #ifdef _TG_WINDOWS_ void push_event (string attr_name,vector &filt_names,vector &filt_vals,Tango::DevDouble *p_data, struct _timeb &t, Tango::AttrQuality qual, long x = 1,long y = 0,bool release = false); #else void push_event (string attr_name,vector &filt_names,vector &filt_vals,Tango::DevDouble *p_data, struct timeval &t, Tango::AttrQuality qual, long x = 1,long y = 0,bool release = false); #endif /** * Push a user event for an attribute with Tango::DevString attribute data type. * The event is pushed to the notification daemon. * * The method needs the attribue name, a pointer to the data to be pushed, the time stamp * for the data and the attribute quality factor as input. * Depending on the attribute type the dimensions x and why need to be given. * * @param attr_name The name of the attribute * @param filt_names The filterable fields name * @param filt_vals The filterable fields value (as double) * @param p_data Pointer to the data to be pushed * @param t The time stamp * @param qual The attribute quality factor * @param x The attribute x length. Default value is 1 * @param y The attribute y length. Default value is 0 * @param release The release flag. If true, memory pointed to by p_data will be * freed after being send to the client. Default value is false. * @exception DevFailed If the attribute data type is not coherent. * Click here to read * DevFailed exception specification */ #ifdef _TG_WINDOWS_ void push_event (string attr_name,vector &filt_names,vector &filt_vals,Tango::DevString *p_data, struct _timeb &t, Tango::AttrQuality qual, long x = 1,long y = 0,bool release = false); #else void push_event (string attr_name,vector &filt_names,vector &filt_vals,Tango::DevString *p_data, struct timeval &t, Tango::AttrQuality qual, long x = 1,long y = 0,bool release = false); #endif /** * Push a user event for an attribute with Tango::DevBoolean attribute data type. * The event is pushed to the notification daemon. * * The method needs the attribue name, a pointer to the data to be pushed, the time stamp * for the data and the attribute quality factor as input. * Depending on the attribute type the dimensions x and why need to be given. * * @param attr_name The name of the attribute * @param filt_names The filterable fields name * @param filt_vals The filterable fields value (as double) * @param p_data Pointer to the data to be pushed * @param t The time stamp * @param qual The attribute quality factor * @param x The attribute x length. Default value is 1 * @param y The attribute y length. Default value is 0 * @param release The release flag. If true, memory pointed to by p_data will be * freed after being send to the client. Default value is false. * @exception DevFailed If the attribute data type is not coherent. * Click here to read * DevFailed exception specification */ #ifdef _TG_WINDOWS_ void push_event (string attr_name,vector &filt_names,vector &filt_vals,Tango::DevBoolean *p_data, struct _timeb &t, Tango::AttrQuality qual, long x = 1,long y = 0,bool release = false); #else void push_event (string attr_name,vector &filt_names,vector &filt_vals,Tango::DevBoolean *p_data, struct timeval &t, Tango::AttrQuality qual, long x = 1,long y = 0,bool release = false); #endif /** * Push a user event for an attribute with Tango::DevUShort attribute data type. * The event is pushed to the notification daemon. * * The method needs the attribue name, a pointer to the data to be pushed, the time stamp * for the data and the attribute quality factor as input. * Depending on the attribute type the dimensions x and why need to be given. * * @param attr_name The name of the attribute * @param filt_names The filterable fields name * @param filt_vals The filterable fields value (as double) * @param p_data Pointer to the data to be pushed * @param t The time stamp * @param qual The attribute quality factor * @param x The attribute x length. Default value is 1 * @param y The attribute y length. Default value is 0 * @param release The release flag. If true, memory pointed to by p_data will be * freed after being send to the client. Default value is false. * @exception DevFailed If the attribute data type is not coherent. * Click here to read * DevFailed exception specification */ #ifdef _TG_WINDOWS_ void push_event (string attr_name,vector &filt_names,vector &filt_vals,Tango::DevUShort *p_data, struct _timeb &t, Tango::AttrQuality qual, long x = 1,long y = 0,bool release = false); #else void push_event (string attr_name,vector &filt_names,vector &filt_vals,Tango::DevUShort *p_data, struct timeval &t, Tango::AttrQuality qual, long x = 1,long y = 0,bool release = false); #endif /** * Push a user event for an attribute with Tango::DevUChar attribute data type. * The event is pushed to the notification daemon. * * The method needs the attribue name, a pointer to the data to be pushed, the time stamp * for the data and the attribute quality factor as input. * Depending on the attribute type the dimensions x and why need to be given. * * @param attr_name The name of the attribute * @param filt_names The filterable fields name * @param filt_vals The filterable fields value (as double) * @param p_data Pointer to the data to be pushed * @param t The time stamp * @param qual The attribute quality factor * @param x The attribute x length. Default value is 1 * @param y The attribute y length. Default value is 0 * @param release The release flag. If true, memory pointed to by p_data will be * freed after being send to the client. Default value is false. * @exception DevFailed If the attribute data type is not coherent. * Click here to read * DevFailed exception specification */ #ifdef _TG_WINDOWS_ void push_event (string attr_name,vector &filt_names,vector &filt_vals,Tango::DevUChar *p_data, struct _timeb &t, Tango::AttrQuality qual, long x = 1,long y = 0,bool release = false); #else void push_event (string attr_name,vector &filt_names,vector &filt_vals,Tango::DevUChar *p_data, struct timeval &t, Tango::AttrQuality qual, long x = 1,long y = 0,bool release = false); #endif /** * Push a user event for an attribute with Tango::DevULong attribute data type. * The event is pushed to the notification daemon. * * The method needs the attribue name, a pointer to the data to be pushed, the time stamp * for the data and the attribute quality factor as input. * Depending on the attribute type the dimensions x and why need to be given. * * @param attr_name The name of the attribute * @param filt_names The filterable fields name * @param filt_vals The filterable fields value (as double) * @param p_data Pointer to the data to be pushed * @param t The time stamp * @param qual The attribute quality factor * @param x The attribute x length. Default value is 1 * @param y The attribute y length. Default value is 0 * @param release The release flag. If true, memory pointed to by p_data will be * freed after being send to the client. Default value is false. * @exception DevFailed If the attribute data type is not coherent. * Click here to read * DevFailed exception specification */ #ifdef _TG_WINDOWS_ void push_event (string attr_name,vector &filt_names,vector &filt_vals,Tango::DevULong *p_data, struct _timeb &t, Tango::AttrQuality qual, long x = 1,long y = 0,bool release = false); #else void push_event (string attr_name,vector &filt_names,vector &filt_vals,Tango::DevULong *p_data, struct timeval &t, Tango::AttrQuality qual, long x = 1,long y = 0,bool release = false); #endif /** * Push a user event for an attribute with Tango::DevULong64 attribute data type. * The event is pushed to the notification daemon. * * The method needs the attribue name, a pointer to the data to be pushed, the time stamp * for the data and the attribute quality factor as input. * Depending on the attribute type the dimensions x and why need to be given. * * @param attr_name The name of the attribute * @param filt_names The filterable fields name * @param filt_vals The filterable fields value (as double) * @param p_data Pointer to the data to be pushed * @param t The time stamp * @param qual The attribute quality factor * @param x The attribute x length. Default value is 1 * @param y The attribute y length. Default value is 0 * @param release The release flag. If true, memory pointed to by p_data will be * freed after being send to the client. Default value is false. * @exception DevFailed If the attribute data type is not coherent. * Click here to read * DevFailed exception specification */ #ifdef _TG_WINDOWS_ void push_event (string attr_name,vector &filt_names,vector &filt_vals,Tango::DevULong64 *p_data, struct _timeb &t, Tango::AttrQuality qual, long x = 1,long y = 0,bool release = false); #else void push_event (string attr_name,vector &filt_names,vector &filt_vals,Tango::DevULong64 *p_data, struct timeval &t, Tango::AttrQuality qual, long x = 1,long y = 0,bool release = false); #endif /** * Push a user event for an attribute with Tango::DevState attribute data type. * The event is pushed to the notification daemon. * * The method needs the attribue name, a pointer to the data to be pushed, the time stamp * for the data and the attribute quality factor as input. * Depending on the attribute type the dimensions x and why need to be given. * * @param attr_name The name of the attribute * @param filt_names The filterable fields name * @param filt_vals The filterable fields value (as double) * @param p_data Pointer to the data to be pushed * @param t The time stamp * @param qual The attribute quality factor * @param x The attribute x length. Default value is 1 * @param y The attribute y length. Default value is 0 * @param release The release flag. If true, memory pointed to by p_data will be * freed after being send to the client. Default value is false. * @exception DevFailed If the attribute data type is not coherent. * Click here to read * DevFailed exception specification */ #ifdef _TG_WINDOWS_ void push_event (string attr_name,vector &filt_names,vector &filt_vals,Tango::DevState *p_data, struct _timeb &t, Tango::AttrQuality qual, long x = 1,long y = 0,bool release = false); #else void push_event (string attr_name,vector &filt_names,vector &filt_vals,Tango::DevState *p_data, struct timeval &t, Tango::AttrQuality qual, long x = 1,long y = 0,bool release = false); #endif /** * Push a user event for an attribute with Tango::DevEncoded attribute data type. * The event is pushed to the notification daemon. * * The method needs the attribue name, a pointer to the data to be pushed, the time stamp * for the data and the attribute quality factor as input. * Depending on the attribute type the dimensions x and why need to be given. * * @param attr_name The name of the attribute * @param filt_names The filterable fields name * @param filt_vals The filterable fields value (as double) * @param p_data Pointer to the data to be pushed * @param t The time stamp * @param qual The attribute quality factor * @param x The attribute x length. Default value is 1 * @param y The attribute y length. Default value is 0 * @param release The release flag. If true, memory pointed to by p_data will be * freed after being send to the client. Default value is false. * @exception DevFailed If the attribute data type is not coherent. * Click here to read * DevFailed exception specification */ #ifdef _TG_WINDOWS_ void push_event (string attr_name,vector &filt_names,vector &filt_vals,Tango::DevEncoded *p_data, struct _timeb &t, Tango::AttrQuality qual, long x = 1,long y = 0,bool release = false); #else void push_event (string attr_name,vector &filt_names,vector &filt_vals,Tango::DevEncoded *p_data, struct timeval &t, Tango::AttrQuality qual, long x = 1,long y = 0,bool release = false); #endif /** * Push a user event for an attribute with Tango::DevEncoded attribute data type * when the string part and the data part of the DevEncoded data are specified * separately. * The event is pushed to the notification daemon. * * The method needs the attribue name, a pointer to the data to be pushed, the time stamp * for the data and the attribute quality factor as input. * Depending on the attribute type the dimensions x and why need to be given. * * @param attr_name The name of the attribute * @param filt_names The filterable fields name * @param filt_vals The filterable fields value (as double) * @param p_str_data Pointer to the data string part * @param p_data Pointer to the data to be pushed * @param size The data number (pointed to by p_data) * @param t The time stamp * @param qual The attribute quality factor * @param release The release flag. If true, memory pointed to by p_data will be * freed after being send to the client. Default value is false. * @exception DevFailed If the attribute data type is not coherent. * Click here to read * DevFailed exception specification */ #ifdef _TG_WINDOWS_ void push_event (string attr_name,vector &filt_names,vector &filt_vals,Tango::DevString *p_str_data,Tango::DevUChar *p_data, long size, struct _timeb &t, Tango::AttrQuality qual,bool release = false); #else void push_event (string attr_name,vector &filt_names,vector &filt_vals,Tango::DevString *p_str_data,Tango::DevUChar *p_data, long size, struct timeval &t, Tango::AttrQuality qual,bool release = false); #endif //@} /**@name Push data ready event methods * This method allows the user to push a data ready event */ //@{ /** * Push a data ready event for the attribute with name specified as the first * parameter. * The event is pushed to the notification daemon. * * The method needs only the attribue name and an optional "counter" which * will be passed unchanged within the event * * @param attr_name The name of the attribute * @param ctr The user counter * * @exception DevFailed If the attribute name is unknown. * Click here to read * DevFailed exception specification */ void push_data_ready_event (const string &attr_name,Tango::DevLong ctr = 0); //@} /**@name Signal related methods * These methods allow a signal management at device level */ //@{ #ifndef _TG_WINDOWS_ /** * Register a signal to be executed in a signal handler. * * Register this device as device to be informed when signal signo is sent to * to the device server process. This method is available only under Linux. * * @param signo The signal number * @param own_handler A boolean set to true if you want the device signal handler * to be executed in its own handler instead of being executed by the signal * thread. If this parameter is set to true, care should be taken on how the * handler is written. A default false value is provided * @exception DevFailed Thrown if the signal number is out of range or if the * operating system failed to register a signal for the process. * Click here to read * DevFailed exception specification */ void register_signal(long signo,bool own_handler = false); #else /** * Register a signal. * * Register this device as device to be informed when signal signo is sent to * to the device server process * * @param signo The signal number * @exception DevFailed Thrown if the signal number is out of range or if the * operating system failed to register a signal for the process. * Click here to read * DevFailed exception specification */ void register_signal(long signo); #endif /** * Unregister a signal. * * Unregister this device as device to be informed when signal signo is sent to * to the device server process * * @param signo The signal number * @exception DevFailed Thrown if the signal number is out of range or if the * operating system failed to unregister a signal for the process. Unregister * a device for a signal number for a device not previously registered is not * an error. This simply will do nothing. * Click here to read * DevFailed exception specification */ void unregister_signal(long signo); /** * Signal handler. * * The method executed when the signal arrived in the device server process. * This method is defined as virtual and then, can be redefined following * device needs. * * @param signo The signal number */ virtual void signal_handler(long signo); //@} // // Device class data members // protected: /**@name Class data members */ //@{ /** * The device black box pointer */ BlackBox *blackbox_ptr; /** * The device black box depth */ long blackbox_depth; /** * The device name */ string device_name; /** * The device description */ string desc; /** * The device status */ string device_status; /** * The device state */ Tango::DevState device_state; /** * The device version */ long version; /** * Pointer to the device-class object associated with the device */ DeviceClass *device_class; /** * Pointer to the multi attribute object */ MultiAttribute *dev_attr; /** * Pointer to the associated DbDevice object */ DbDevice *db_dev; /** * The administration device name */ string adm_device_name; //@} public: /// @privatesection void set_exported_flag(bool exp) {ext->exported = exp;} bool get_exported_flag() {return ext->exported;} void set_poll_ring_depth(long depth) {ext->poll_ring_depth = depth;} long get_poll_ring_depth() {return ext->poll_ring_depth;} void set_poll_old_factor(long fact) {ext->poll_old_factor = fact;} long get_poll_old_factor() {return ext->poll_old_factor;} void is_polled(bool poll) {ext->polled = poll;} bool is_polled() {return ext->polled;} vector &get_polled_cmd() {return ext->polled_cmd;} vector &get_polled_attr() {return ext->polled_attr;} vector &get_non_auto_polled_cmd() {return ext->non_auto_polled_cmd;} vector &get_non_auto_polled_attr() {return ext->non_auto_polled_attr;} vector &get_poll_obj_list() {return ext->poll_obj_list;} void stop_polling(bool); void stop_polling() {stop_polling(true);} void check_command_exists(const string &); Command *get_command(const string &); string &get_name_lower() {return ext->device_name_lower;} TangoMonitor &get_dev_monitor() {return ext->only_one;} TangoMonitor &get_poll_monitor() {return ext->poll_mon;} TangoMonitor &get_att_conf_monitor() {return ext->att_conf_mon;} long get_dev_idl_version() {return ext->idl_version;} long get_cmd_poll_ring_depth(string &); long get_attr_poll_ring_depth(string &); vector &get_alarmed_not_read() {return ext->alarmed_not_read;} void poll_lists_2_v5(); bool is_py_device() {return ext->py_device;} void set_py_device(bool py) {ext->py_device=py;} Tango::client_addr *get_client_ident(); void lock(client_addr *,int); void relock(client_addr *); Tango::DevLong unlock(bool); void basic_unlock(bool forced = false); bool valid_lock(); Tango::DevVarLongStringArray *lock_status(); bool is_device_locked() {return ext->device_locked;} client_addr *get_locker() {return ext->locker_client;} client_addr *get_old_locker() {return ext->old_locker_client;} time_t get_locking_date() {return ext->locking_date;} Tango::DevLong get_locking_ctr() {return ext->lock_ctr;} Tango::DevLong get_lock_validity() {return ext->lock_validity;} void clean_locker_ptrs() {ext->locker_client=NULL;ext->old_locker_client=NULL;} void set_locking_param(client_addr *,client_addr *,time_t,DevLong,DevLong); void set_alias_name_lower(string &al) {ext->alias_name_lower = al;} string &get_alias_name_lower() {return ext->alias_name_lower;} void push_att_conf_event(Attribute *); void data_into_net_object(Attribute &,AttributeValueList_3 *,AttributeValueList_4 *,long,AttrWriteType,bool); void polled_data_into_net_object(AttributeValueList_3 *,AttributeValueList_4 *,long,long,long,PollObj *,const DevVarStringArray &); int get_min_poll_period() {return ext->min_poll_period;} vector &get_cmd_min_poll_period() {return ext->cmd_min_poll_period;} vector &get_attr_min_poll_period() {return ext->attr_min_poll_period;} void init_cmd_poll_ext_trig (string cmd_name); void init_attr_poll_ext_trig (string cmd_name); void set_run_att_conf_loop(bool val) {ext->run_att_conf_loop=val;} vector &get_att_wrong_db_conf() {return ext->att_wrong_db_conf;} void check_att_conf(); bool is_alarm_state_forced() {return ext->force_alarm_state;} vector &get_att_mem_failed() {return ext->att_mem_failed;} #ifdef TANGO_HAS_LOG4TANGO inline log4tango::Logger *get_logger(void) {return ext->logger ? ext->logger : get_logger_i();} void init_logger(void); void start_logging(void); void stop_logging(void); #endif // TANGO_HAS_LOG4TANGO private: // // The extension class // class DeviceImplExt { public: #ifdef TANGO_HAS_LOG4TANGO DeviceImplExt(const char *d_name): exported(false),polled(false), poll_ring_depth(0),poll_old_factor(0),only_one(d_name), logger(NULL),saved_log_level(log4tango::Level::WARN), rft(Tango::kDefaultRollingThreshold),idl_version(1), store_in_bb(true),poll_mon("cache"), att_conf_mon("att_config"),state_from_read(false), py_device(false), device_locked(false),locker_client(NULL),old_locker_client(NULL), lock_ctr(0),min_poll_period(0),run_att_conf_loop(true),force_alarm_state(false) {}; #else DeviceImplExt(const char *d_name):exported(false),polled(false),poll_ring_depth(0) only_one(d_name),store_in_bb(true),poll_mon("cache"), att_conf_mon("att_config"),state_from_read(false), py_device(false),device_locked(false),locker_client(NULL), old_locker_client(NULL),lock_ctr(0),min_poll_period(0), run_att_conf_loop(true),force_alarm_state(false) {}; #endif ~DeviceImplExt(); bool exported; bool polled; long poll_ring_depth; long poll_old_factor; vector polled_cmd; vector polled_attr; vector non_auto_polled_cmd; vector non_auto_polled_attr; vector poll_obj_list; TangoMonitor only_one; // Device monitor Tango::DevState device_prev_state; // Device previous state #ifdef TANGO_HAS_LOG4TANGO log4tango::Logger* logger; log4tango::Level::Value saved_log_level; size_t rft; #endif string device_name_lower; long idl_version; vector cmd_poll_ring_depth; vector attr_poll_ring_depth; bool store_in_bb; TangoMonitor poll_mon; // Polling list monitor TangoMonitor att_conf_mon; // Attribute config monitor bool state_from_read; vector alarmed_not_read; bool py_device; string alias_name_lower; // Alias name (if any) bool device_locked; client_addr *locker_client; client_addr *old_locker_client; DevLong lock_validity; time_t locking_date; string lock_status; DevLong lock_ctr; long min_poll_period; vector cmd_min_poll_period; vector attr_min_poll_period; bool run_att_conf_loop; bool force_alarm_state; vector att_wrong_db_conf; vector att_mem_failed; }; protected: /// @privatesection void check_lock(const char *,const char *cmd = NULL); void throw_locked_exception(const char *meth); void init_cmd_poll_period(); void init_attr_poll_period(); void init_poll_no_db(); #ifdef HAS_UNIQUE_PTR unique_ptr ext; // Class extension #else DeviceImplExt *ext; #endif DevVarShortArray dummy_short_att_value; DevVarLongArray dummy_long_att_value; DevVarLong64Array dummy_long64_att_value; DevVarFloatArray dummy_float_att_value; DevVarDoubleArray dummy_double_att_value; DevVarStringArray dummy_string_att_value; DevVarBooleanArray dummy_boolean_att_value; DevVarUShortArray dummy_ushort_att_value; DevVarCharArray dummy_uchar_att_value; DevVarULongArray dummy_ulong_att_value; DevVarULong64Array dummy_ulong64_att_value; DevVarStateArray dummy_state_att_value; DevVarEncodedArray dummy_encoded_att_value; private: // // Private enum // typedef enum _AttErrorType { CONF = 0, MEM }AttErrorType; // // Some private methods and variables // void get_dev_system_resource(); void black_box_create(); void real_ctor(); void poll_object(const string &,int,PollObjType); void stop_poll_object(const string &,PollObjType); void att_conf_loop(); void build_att_list_in_status_mess(size_t,AttErrorType); #ifdef TANGO_HAS_LOG4TANGO log4tango::Logger *get_logger_i (void); #endif string alarm_status; Tango::Device_var d_var; PortableServer::ObjectId_var obj_id; protected: }; } // End of Tango namespace #endif // _DEVICE_H tango-8.1.2c+dfsg.orig/lib/cpp/server/multiattribute.cpp0000644000175000017500000010760212205375142022222 0ustar piccapiccastatic const char *RcsId = "$Id: multiattribute.cpp 22213 2013-03-07 14:32:56Z taurel $\n$Name$"; //+============================================================================ // // file : MultiAttribute.cpp // // description : C++ source code for the MultiAttribute class. This class // is used to manage attribute. // A Tango Device object instance has one // MultiAttribute object which is an aggregate of // Attribute or WAttribute objects // // project : TANGO // // author(s) : E.Taurel // // Copyright (C) : 2004,2005,2006,2007,2008,2009,2010,2011,2012,2013 // European Synchrotron Radiation Facility // BP 220, Grenoble 38043 // FRANCE // // This file is part of Tango. // // Tango 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. // // Tango 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 Tango. If not, see . // // $Revision: 22213 $ // //-============================================================================ #if HAVE_CONFIG_H #include #endif #include #include #include #include #include namespace Tango { // // Define the optional attribute name and default value // static OptAttrProp Tango_OptAttrProp[] = { {"label",LabelNotSpec}, {"description",DescNotSpec}, {"unit",UnitNotSpec}, {"standard_unit",StdUnitNotSpec}, {"display_unit",DispUnitNotSpec}, {"format",FormatNotSpec_FL}, {"min_value",AlrmValueNotSpec}, {"max_value",AlrmValueNotSpec}, {"min_alarm",AlrmValueNotSpec}, {"max_alarm",AlrmValueNotSpec}, {"writable_attr_name",AssocWritNotSpec}, {"min_warning",AlrmValueNotSpec}, {"max_warning",AlrmValueNotSpec}, {"delta_t","0"}, {"delta_val",AlrmValueNotSpec} }; //+------------------------------------------------------------------------- // // method : MultiAttribute::MultiAttribute // // description : constructor for the MultiAttribute class from the // device device name and a pointer to the DeviceClass // object // // argument : in : - dev_name : The device name // - dev_class_ptr : Pointer to the DeviceClass object // //-------------------------------------------------------------------------- MultiAttribute::MultiAttribute(string &dev_name,DeviceClass *dev_class_ptr) :ext(Tango_NullPtr) { long i; cout4 << "Entering MultiAttribute class constructor for device " << dev_name << endl; // // Retrieve attr name list // vector &tmp_attr_list = dev_class_ptr->get_class_attr()->get_attr_list(); long nb_attr = tmp_attr_list.size(); // // Get device attribute properties // No need to implement // a retry here (in case of db server restart) because the db reconnection // is forced by the get_property call executed during xxxClass construction // before we reach this code. // cout4 << nb_attr << " attribute(s)" << endl; if (nb_attr != 0) { Tango::Util *tg = Tango::Util::instance(); Tango::DbData db_list; if (tg->_UseDb == true) { for (i = 0;i < nb_attr;i++) db_list.push_back(DbDatum(tmp_attr_list[i]->get_name())); // // On some small and old computers, this request could take time if at the same time // some other processes also access the device attribute properties table. // This has been experimented at ESRF. Increase timeout to cover this case // int old_db_timeout = 0; if (Util::_FileDb == false) old_db_timeout = tg->get_database()->get_timeout_millis(); try { if (old_db_timeout != 0) tg->get_database()->set_timeout_millis(6000); tg->get_database()->get_device_attribute_property(dev_name,db_list,tg->get_db_cache()); if (old_db_timeout != 0) tg->get_database()->set_timeout_millis(old_db_timeout); } catch (Tango::DevFailed &) { cout4 << "Exception while accessing database" << endl; tg->get_database()->set_timeout_millis(old_db_timeout); TangoSys_OMemStream o; o << "Can't get device attribute properties for device " << dev_name << ends; Except::throw_exception((const char *)API_DatabaseAccess, o.str(), (const char *)"MultiAttribute::MultiAttribute"); } } // // Build property list for each attribute // long ind = 0; for (i = 0;i < nb_attr;i++) { // // Get attribute class properties // Attr &attr = dev_class_ptr->get_class_attr()->get_attr(tmp_attr_list[i]->get_name()); vector &class_prop = attr.get_class_properties(); vector &def_user_prop = attr.get_user_default_properties(); // // If the attribute has some properties defined at device level, build a vector // of these properties // vector dev_prop; if (tg->_UseDb == true) { long nb_prop = 0; db_list[ind] >> nb_prop; ind++; for (long j = 0;j < nb_prop;j++) { if (db_list[ind].size() > 1) { string tmp(db_list[ind].value_string[0]); long nb = db_list[ind].size(); for (int k = 1;k < nb;k++) { tmp = tmp + ","; tmp = tmp + db_list[ind].value_string[k]; } dev_prop.push_back(AttrProperty(db_list[ind].name,tmp)); } else dev_prop.push_back(AttrProperty(db_list[ind].name, db_list[ind].value_string[0])); ind++; } } // // Concatenate these two attribute properties levels // vector prop_list; concat(dev_prop,class_prop,prop_list); add_user_default(prop_list,def_user_prop); add_default(prop_list,dev_name,attr.get_name(),attr.get_type()); // // Create an Attribute instance // if ((attr.get_writable() == Tango::WRITE) || (attr.get_writable() == Tango::READ_WRITE)) attr_list.push_back(new WAttribute(prop_list,attr,dev_name,i)); else attr_list.push_back(new Attribute(prop_list,attr,dev_name,i)); // // If it is writable, add it to the writable attribute list // Tango::AttrWriteType w_type = attr_list[i]->get_writable(); if ((w_type == Tango::WRITE) || (w_type == Tango::READ_WRITE)) { writable_attr_list.push_back(i); } // // If one of the alarm properties is defined, add it to the alarmed attribute // list // if (attr_list[i]->is_alarmed().any() == true) { if (w_type != Tango::WRITE) alarm_attr_list.push_back(i); } cout4 << *(attr_list[i]) << endl; } } // // For each attribute, check if the writable_attr_name is set and in this // case, check if the associated attribute exists and is writable // for (i = 0;i < nb_attr;i++) { check_associated(i,dev_name); } cout4 << "Leaving MultiAttribute class constructor" << endl; } //+------------------------------------------------------------------------- // // method : MultiAttribute::~MultiAttribute // // description : destructor for the MultiAttribute class. It simply // delete all the Attribute object stored in its // attr_list data member // //-------------------------------------------------------------------------- MultiAttribute::~MultiAttribute() { for(unsigned long i = 0;i < attr_list.size();i++) delete attr_list[i]; } //+------------------------------------------------------------------------- // // method : MultiAttribute::concat // // description : Concatenate porperties defined at the class level and // at the device level. Prperties defined at the device // level have the highest level // // in : dev_prop : The device properties // class_prop : The class properties // // out : result : The resulting vector // //-------------------------------------------------------------------------- void MultiAttribute::concat(vector &dev_prop, vector &class_prop, vector &result) { // // Copy all device properties // unsigned long i; for (i = 0;i < dev_prop.size();i++) result.push_back(dev_prop[i]); // // Add class properties if they have not been redefined at the device level // vector tmp_result = result; unsigned long nb_class_check = class_prop.size(); for (i = 0;i < nb_class_check;i++) { vector::iterator pos; pos = find_if(tmp_result.begin(),tmp_result.end(), bind2nd(WantedProp(),class_prop[i].get_name())); if (pos != tmp_result.end()) continue; else result.push_back(class_prop[i]); } } //+------------------------------------------------------------------------- // // method : MultiAttribute::add_default // // description : Add default value for optional property if they // are not defined // // in : prop_list : The already defined property vector // dev_name : The device name // att_name : The attribute name // att_data_type : The attribute data type // //-------------------------------------------------------------------------- void MultiAttribute::add_default(vector &prop_list, TANGO_UNUSED(string &dev_name), string &att_name,long att_data_type) { // // Overwrite the label attribute property in order to be set to the // attribute name // Tango_OptAttrProp[0].default_value = att_name.c_str(); // // Also overwrite the format attribute property according to attribute data type // switch (att_data_type) { case DEV_SHORT: case DEV_LONG: case DEV_LONG64: case DEV_UCHAR: case DEV_USHORT: case DEV_ULONG: case DEV_ULONG64: Tango_OptAttrProp[5].default_value = FormatNotSpec_INT; break; case DEV_STRING: Tango_OptAttrProp[5].default_value = FormatNotSpec_STR; break; case DEV_FLOAT: case DEV_DOUBLE: Tango_OptAttrProp[5].default_value = FormatNotSpec_FL; break; case DEV_STATE: case DEV_ENCODED: case DEV_BOOLEAN: Tango_OptAttrProp[5].default_value = AlrmValueNotSpec; break; default: break; } long nb_opt_prop = sizeof(Tango_OptAttrProp)/sizeof(OptAttrProp); // // For all the optional attribute properties, search in the already built // vector of attributes if they are defined. If yes, continue. Otherwise, // add a new property with the default value // for (long i = 0;i < nb_opt_prop;i++) { vector::iterator pos; string opt_prop_name(Tango_OptAttrProp[i].name); pos = find_if(prop_list.begin(),prop_list.end(), bind2nd(WantedProp(),opt_prop_name)); if (pos == prop_list.end()) prop_list.push_back(AttrProperty(Tango_OptAttrProp[i].name,Tango_OptAttrProp[i].default_value)); } } //+------------------------------------------------------------------------- // // method : MultiAttribute::add_user_default // // description : Add default value for optional property if they // are not defined // // in : prop_list : The already defined property vector // user_default : The user defined default property values // //-------------------------------------------------------------------------- void MultiAttribute::add_user_default(vector &prop_list, vector &user_default) { // // Add default user properties if they have not been defined in the database // long nb_user = user_default.size(); for (int i = 0;i < nb_user;i++) { vector::iterator pos; pos = find_if(prop_list.begin(),prop_list.end(), bind2nd(WantedProp(),user_default[i].get_name())); if (pos != prop_list.end()) continue; else prop_list.push_back(user_default[i]); } } //+------------------------------------------------------------------------- // // method : MultiAttribute::check_associated // // description : Check if the writable_attr_name property is set and // in this case, check if the associated attribute exists // and is writable. This is necessary only for attribute // of the READ_WITH_WRITE or READ_WRITE types // // argument : in : - index : The index of the attribute to checked in the // attr vector // - dev_name : The device name // //-------------------------------------------------------------------------- void MultiAttribute::check_associated(long index,string &dev_name) { if ((attr_list[index]->get_writable() == Tango::READ_WITH_WRITE) || (attr_list[index]->get_writable() == Tango::READ_WRITE)) { /* if (attr_list[index]->get_data_format() != Tango::SCALAR) { TangoSys_OMemStream o; o << "Device --> " << dev_name; o << "\nProperty writable_attr_name for attribute " << attr_list[index]->get_name(); o << " is defined but this attribute data format is not SCALAR" << ends; Except::throw_exception((const char *)API_AttrOptProp, o.str(), (const char *)"MultiAttribute::MultiAttribute"); }*/ unsigned long j; string &assoc_name = attr_list[index]->get_assoc_name(); transform(assoc_name.begin(),assoc_name.end(),assoc_name.begin(),::tolower); for (j = 0;j < writable_attr_list.size();j++) { if (attr_list[writable_attr_list[j]]->get_name_lower() == assoc_name) break; } if (j == writable_attr_list.size()) { TangoSys_OMemStream o; o << "Device --> " << dev_name; o << "\nProperty writable_attr_name for attribute " << attr_list[index]->get_name(); o << " is set to " << assoc_name; o << ", but this attribute does not exists or is not writable" << ends; Except::throw_exception((const char *)API_AttrOptProp, o.str(), (const char *)"MultiAttribute::MultiAttribute"); } // // Also check if the associated write attribute is a scalar one // /* if (attr_list[writable_attr_list[j]]->get_data_format() != Tango::SCALAR) { TangoSys_OMemStream o; o << "Device --> " << dev_name; o << "\nProperty writable_attr_name for attribute " << attr_list[index]->get_name(); o << " is set to " << assoc_name; o << ", but this attribute is not of the SCALAR data format" << ends; Except::throw_exception((const char *)API_AttrOptProp, o.str(), (const char *)"MultiAttribute::MultiAttribute"); }*/ // // Check that the two associated attributes have the same data type // if (attr_list[writable_attr_list[j]]->get_data_type() != attr_list[index]->get_data_type()) { TangoSys_OMemStream o; o << "Device --> " << dev_name; o << "\nProperty writable_attr_name for attribute " << attr_list[index]->get_name(); o << " is set to " << assoc_name; o << ", but these two attributes do not support the same data type" << ends; Except::throw_exception((const char *)API_AttrOptProp, o.str(), (const char *)"MultiAttribute::MultiAttribute"); } attr_list[index]->set_assoc_ind(writable_attr_list[j]); } } //+------------------------------------------------------------------------- // // method : MultiAttribute::add_attribute // // description : Construct a new attribute object and add it to the // device attribute list // // argument : in : - dev_name : The device name // - dev_class_ptr : Pointer to the DeviceClass object // - index : Index in class attribute list of the new // device attribute // //-------------------------------------------------------------------------- void MultiAttribute::add_attribute(string &dev_name, DeviceClass *dev_class_ptr, long index) { cout4 << "Entering MultiAttribute::add_attribute" << endl; // // Retrieve device class attribute list // vector &tmp_attr_list = dev_class_ptr->get_class_attr()->get_attr_list(); // // Get device attribute properties // No need to implement // a retry here (in case of db server restart) because the db reconnection // is forced by the get_property call executed during xxxClass construction // before we reach this code. // Tango::Util *tg = Tango::Util::instance(); Tango::DbData db_list; if (tg->_UseDb == true) { db_list.push_back(DbDatum(tmp_attr_list[index]->get_name())); try { tg->get_database()->get_device_attribute_property(dev_name,db_list,tg->get_db_cache()); } catch (Tango::DevFailed &e) { TangoSys_OMemStream o; o << "Can't get device attribute properties for device " << dev_name << ends; Except::re_throw_exception(e,(const char *)API_DatabaseAccess, o.str(), (const char *)"MultiAttribute::add_attribute"); } } // // Get attribute class properties // Attr &attr = dev_class_ptr->get_class_attr()->get_attr(tmp_attr_list[index]->get_name()); vector &class_prop = attr.get_class_properties(); vector &def_user_prop = attr.get_user_default_properties(); // // If the attribute has some properties defined at device level, build a vector // of these properties // vector dev_prop; if (tg->_UseDb == true) { long ind = 0; long nb_prop = 0; db_list[ind] >> nb_prop; ind++; for (long j = 0;j < nb_prop;j++) { if (db_list[ind].size() > 1) { string tmp(db_list[ind].value_string[0]); long nb = db_list[ind].size(); for (int k = 1;k < nb;k++) { tmp = tmp + ","; tmp = tmp + db_list[ind].value_string[k]; } dev_prop.push_back(AttrProperty(db_list[ind].name,tmp)); } else dev_prop.push_back(AttrProperty(db_list[ind].name, db_list[ind].value_string[0])); ind++; } } // // Concatenate these two attribute properties levels // vector prop_list; concat(dev_prop,class_prop,prop_list); add_user_default(prop_list,def_user_prop); add_default(prop_list,dev_name,attr.get_name(),attr.get_type()); // // Create an Attribute instance and insert it in the attribute list // If the device implement IDL 3 (with state and status as attributes), // add it at the end of the list but before state and status. // bool idl_3 = false; vector::iterator ite; if ((attr_list.back())->get_name() == "Status") { idl_3 = true; ite = attr_list.end(); ite = ite - 2; } if ((attr.get_writable() == Tango::WRITE) || (attr.get_writable() == Tango::READ_WRITE)) { if (idl_3 == false) { attr_list.push_back(new WAttribute(prop_list,attr,dev_name,index)); index = attr_list.size() - 1; } else { attr_list.insert(ite,new WAttribute(prop_list,attr,dev_name,index)); index = attr_list.size() - 3; } } else { if (idl_3 == false) { attr_list.push_back(new Attribute(prop_list,attr,dev_name,index)); index = attr_list.size() - 1; } else { attr_list.insert(ite,new Attribute(prop_list,attr,dev_name,index)); index = attr_list.size() - 3; } } // // If it is writable, add it to the writable attribute list // Tango::AttrWriteType w_type = attr_list[index]->get_writable(); if ((w_type == Tango::WRITE) || (w_type == Tango::READ_WRITE)) { writable_attr_list.push_back(index); } // // If one of the alarm properties is defined, add it to the alarmed attribute // list // if (attr_list[index]->is_alarmed().any() == true) { if (w_type != Tango::WRITE) alarm_attr_list.push_back(index); } // // Check if the writable_attr_name property is set and in this // case, check if the associated attribute exists and is writable // check_associated(index,dev_name); cout4 << "Leaving MultiAttribute::add_attribute" << endl; } //+------------------------------------------------------------------------- // // method : MultiAttribute::remove_attribute // // description : Remove one attribute object from the // device attribute list // // argument : in : - attr_name : The attribute name // - update_idx : Flag set to true if the attributes object index // used to retrieve the corresponding Attr object // has to be updated (because one Attr object // has been removed) // //-------------------------------------------------------------------------- void MultiAttribute::remove_attribute(string &attr_name,bool update_idx) { cout4 << "Entering MultiAttribute::remove_attribute" << endl; // // Get attribute index in vector // long att_index = get_attr_ind_by_name(attr_name.c_str()); // // Remove the attribute from the main vector // Attribute *att = attr_list[att_index]; int old_idx = att->get_attr_idx(); DeviceImpl *the_dev = att->get_att_device(); string &dev_class_name = the_dev->get_device_class()->get_name(); delete att; vector::iterator pos = attr_list.begin(); advance(pos,att_index); pos = attr_list.erase(pos); // // Update all the index for attribute following the one which has been deleted // This is a 2 steps process: // 1 - Update index in local device // 2 - Update indexes in remaining device(s) belonging to the same class // if (update_idx == true) { for (;pos != attr_list.end();++pos) (*pos)->set_attr_idx((*pos)->get_attr_idx() - 1); Tango::Util *tg = Tango::Util::instance(); vector &dev_list = tg->get_device_list_by_class(dev_class_name); vector::iterator dev_ite; for (dev_ite = dev_list.begin();dev_ite != dev_list.end();++dev_ite) { if (*dev_ite == the_dev) continue; vector &dev_att_list = (*dev_ite)->get_device_attr()->get_attribute_list(); for (unsigned int loop = 0;loop < dev_att_list.size();++loop) { int idx = dev_att_list[loop]->get_attr_idx(); if (idx > old_idx) dev_att_list[loop]->set_attr_idx(idx - 1); } } } // // Clear the writable attribute index vector and rebuild it // This is necessary because this vector containd index in // the main attribute list which has been modified // writable_attr_list.clear(); for (unsigned long i = 0;i < attr_list.size();i++) { Tango::AttrWriteType w_type = attr_list[i]->get_writable(); if ((w_type == Tango::WRITE) || (w_type == Tango::READ_WRITE)) { writable_attr_list.push_back(i); } } // // Do the same for the alarmed attribute for the same reason // alarm_attr_list.clear(); for (unsigned long i = 0;i < attr_list.size();i++) { if (attr_list[i]->is_alarmed().any() == true) { Tango::AttrWriteType w_type = attr_list[i]->get_writable(); if (w_type != Tango::WRITE) alarm_attr_list.push_back(i); } } // // Check the associated attributes // string default_dev_name("a/b/c"); for (unsigned long i = 0;i < attr_list.size();i++) { check_associated(i,default_dev_name); } cout4 << "Leaving MultiAttribute::remove_attribute" << endl; } //+------------------------------------------------------------------------- // // method : MultiAttribute::get_attr_by_name // // description : Return a reference to the the Attribute object for // the wanted attribue // // in : attr_name : The attribute name // // This method returns a reference to the wanted attribute or throws an // exception id the attribute is not found // //-------------------------------------------------------------------------- Attribute &MultiAttribute::get_attr_by_name(const char *attr_name) { vector::iterator pos; pos = find_if(attr_list.begin(),attr_list.end(), bind2nd(WantedAttr(),attr_name)); if (pos == attr_list.end()) { cout3 << "MultiAttribute::get_attr_by_name throwing exception" << endl; TangoSys_OMemStream o; o << attr_name << " attribute not found" << ends; Except::throw_exception((const char *)API_AttrNotFound, o.str(), (const char *)"MultiAttribute::get_attr_by_name"); } return *(*pos); } //+------------------------------------------------------------------------- // // method : MultiAttribute::get_w_attr_by_name // // description : Return a reference to the the Attribute object for // the wanted attribue // // in : attr_name : The attribute name // // This method returns a reference to the wanted attribute or throws an // exception id the attribute is not found // //-------------------------------------------------------------------------- WAttribute &MultiAttribute::get_w_attr_by_name(const char *attr_name) { vector::iterator pos; pos = find_if(attr_list.begin(),attr_list.end(), bind2nd(WantedAttr(),attr_name)); if ( ( pos == attr_list.end() ) || ( ((*pos)->get_writable() != Tango::WRITE) && ((*pos)->get_writable() != Tango::READ_WRITE) ) ) { cout3 << "MultiAttribute::get_w_attr_by_name throwing exception" << endl; TangoSys_OMemStream o; o << attr_name << " writable attribute not found" << ends; Except::throw_exception((const char *)API_AttrNotFound, o.str(), (const char *)"MultiAttribute::get_w_attr_by_name"); } return static_cast(*(*pos)); } //+------------------------------------------------------------------------- // // method : MultiAttribute::get_attr_ind_by_name // // description : Return the index in the Attribute object vector of // a specified attribute // // in : attr_name : The attribute name // // This method returns the index of the wanted attribute or throws an // exception id the attribute is not found // //-------------------------------------------------------------------------- long MultiAttribute::get_attr_ind_by_name(const char *attr_name) { long i; long nb_attr = attr_list.size(); string st(attr_name); transform(st.begin(),st.end(),st.begin(),::tolower); for (i = 0;i < nb_attr;i++) { if (attr_list[i]->get_name_size() != st.size()) continue; if (attr_list[i]->get_name_lower() == st) break; } if (i == nb_attr) { cout3 << "MultiAttribute::get_attr_ind_by_name throwing exception" << endl; TangoSys_OMemStream o; o << attr_name << " attribute not found" << ends; Except::throw_exception((const char *)API_AttrNotFound, o.str(), (const char *)"MultiAttribute::get_attr_ind_by_name"); } return i; } //+------------------------------------------------------------------------- // // method : MultiAttribute::check_alarm // // description : check alarm on all the attribute where one alarm is // defined // // This method returns a boolen set to true if one of the attribute with // an alarm defined is in alarm state // //-------------------------------------------------------------------------- bool MultiAttribute::check_alarm() { unsigned long i; bool ret,tmp_ret; tmp_ret = false; ret = false; for (i = 0;i < alarm_attr_list.size();i++) { Tango::AttrQuality qua = (get_attr_by_ind(alarm_attr_list[i])).get_quality(); if (ret == false) { if (qua == Tango::ATTR_ALARM) ret = true; } if (qua != Tango::ATTR_INVALID) { // // If the attribute is polled, the check_alarm method has already been called when // the polling thread has read the attribute. // Attribute &att = get_attr_by_ind(alarm_attr_list[i]); if (att.is_polled() == false) { tmp_ret = check_alarm(alarm_attr_list[i]); if (tmp_ret == true) ret = true; } } } return ret; } //+------------------------------------------------------------------------- // // method : MultiAttribute::read_alarm // // description : Add a message in the device status string if one of // the device attribute is in the alarm state // // in : status : The device status // //-------------------------------------------------------------------------- void MultiAttribute::read_alarm(string &status) { unsigned long i; for (i = 0;i < alarm_attr_list.size();i++) { Attribute &att = get_attr_by_ind(alarm_attr_list[i]); // // Add a message for low level alarm // if (att.is_min_alarm() == true) { string &attr_label = att.get_label(); string str; if (attr_label == LabelNotSpec) { str = "\nAlarm : Value too low for attribute "; str = str + att.get_name(); } else { str = "\nAlarm : Value too low for "; str = str + attr_label; } status = status + str; } // // Add a message for high level alarm // else if (att.is_max_alarm() == true) { string &attr_label = att.get_label(); string str; if (attr_label == LabelNotSpec) { str = "\nAlarm : Value too high for attribute "; str = str + att.get_name(); } else { str = "\nAlarm : Value too high for "; str = str + attr_label; } status = status + str; } // // Add a message for rds alarm // if (att.is_rds_alarm() == true) { string &attr_label = att.get_label(); string str; if (attr_label == LabelNotSpec) { str = "\nAlarm : Read too Different than Set (RDS) for attribute "; str = str + att.get_name(); } else { str = "\nAlarm : Read too Different than Set (RDS) for "; str = str + attr_label; } status = status + str; } // // Add a message for min warning // if (att.is_min_warning() == true) { string &attr_label = att.get_label(); string str; if (attr_label == LabelNotSpec) { str = "\nWarning : Value too low for attribute "; str = str + att.get_name(); } else { str = "\nWarning : Value too low for "; str = str + attr_label; } status = status + str; } // // Add a message for max warning // else if (att.is_max_warning() == true) { string &attr_label = att.get_label(); string str; if (attr_label == LabelNotSpec) { str = "\nWarning : Value too high for attribute "; str = str + att.get_name(); } else { str = "\nWarning : Value too high for "; str = str + attr_label; } status = status + str; } } } //+------------------------------------------------------------------------- // // method : MultiAttribute::get_event_param // // description : Return event info for each attribute with events // subscribed // // in : eve : One structure in this vector for each attribute // with events subscribed // //-------------------------------------------------------------------------- void MultiAttribute::get_event_param(vector &eve) { unsigned int i; for (i = 0;i < attr_list.size();i++) { bool once_more = false; bool ch = false; bool ar = false; bool qu = false; bool pe = false; bool us = false; if (attr_list[i]->change_event_subscribed() == true) { once_more = true; ch = true; } if (attr_list[i]->quality_event_subscribed() == true) { once_more = true; qu = true; } if (attr_list[i]->periodic_event_subscribed() == true) { once_more = true; pe = true; } if (attr_list[i]->archive_event_subscribed() == true) { once_more = true; ar = true; } if (attr_list[i]->user_event_subscribed() == true) { once_more = true; us = true; } if (once_more == true) { EventPar ep; if (attr_list[i]->use_notifd_event() == true) ep.notifd = true; else ep.notifd = false; if (attr_list[i]->use_zmq_event() == true) ep.zmq = true; else ep.zmq = false; ep.attr_id = i; ep.change = ch; ep.quality = qu; ep.archive = ar; ep.periodic = pe; ep.user = us; eve.push_back(ep); } } } //+------------------------------------------------------------------------- // // method : MultiAttribute::add_write_value // // description : For scalar attribute with an associated write // attribute, the read_attributes CORBA operation also // returns the write value. This method gets the associated // write attribute value and adds it to the read // attribute // // in : att : Reference to the attribute which must be read // //-------------------------------------------------------------------------- void MultiAttribute::add_write_value(Attribute &att) { WAttribute &assoc_att = get_w_attr_by_ind(att.get_assoc_ind()); Tango::DevVarShortArray *sh_write_val; Tango::DevVarLongArray *lg_write_val; Tango::DevVarLong64Array *lg64_write_val; Tango::DevVarDoubleArray *db_write_val; Tango::DevVarStringArray *str_write_val; Tango::DevVarFloatArray *fl_write_val; Tango::DevVarBooleanArray *boo_write_val; Tango::DevVarUShortArray *ush_write_val; Tango::DevVarCharArray *uch_write_val; Tango::DevVarULongArray *ulg_write_val; Tango::DevVarULong64Array *ulg64_write_val; Tango::DevVarStateArray *state_write_val; switch (att.get_data_type()) { case Tango::DEV_SHORT : sh_write_val = assoc_att.get_last_written_sh(); att.add_write_value(sh_write_val); break; case Tango::DEV_LONG : lg_write_val = assoc_att.get_last_written_lg(); att.add_write_value(lg_write_val); break; case Tango::DEV_LONG64 : lg64_write_val = assoc_att.get_last_written_lg64(); att.add_write_value(lg64_write_val); break; case Tango::DEV_DOUBLE : db_write_val = assoc_att.get_last_written_db(); att.add_write_value(db_write_val); break; case Tango::DEV_STRING : str_write_val = assoc_att.get_last_written_str(); att.add_write_value(str_write_val); break; case Tango::DEV_FLOAT : fl_write_val = assoc_att.get_last_written_fl(); att.add_write_value(fl_write_val); break; case Tango::DEV_BOOLEAN : boo_write_val = assoc_att.get_last_written_boo(); att.add_write_value(boo_write_val); break; case Tango::DEV_USHORT : ush_write_val = assoc_att.get_last_written_ush(); att.add_write_value(ush_write_val); break; case Tango::DEV_UCHAR : uch_write_val = assoc_att.get_last_written_uch(); att.add_write_value(uch_write_val); break; case Tango::DEV_ULONG : ulg_write_val = assoc_att.get_last_written_ulg(); att.add_write_value(ulg_write_val); break; case Tango::DEV_ULONG64 : ulg64_write_val = assoc_att.get_last_written_ulg64(); att.add_write_value(ulg64_write_val); break; case Tango::DEV_STATE : state_write_val = assoc_att.get_last_written_state(); att.add_write_value(state_write_val); break; case Tango::DEV_ENCODED : { DevEncoded &enc_write_val = assoc_att.get_last_written_encoded(); att.add_write_value(enc_write_val); break; } } } //+------------------------------------------------------------------------- // // method : MultiAttribute::is_att_quality_alarmed() // // description : Check for all attribute if one of them has its // quality factor set to ALARM. // Returns true in this case. Otherwise, returns false // // in : all_att : Flag set to false if the search must exclude // all attributes with alarm levels set // //-------------------------------------------------------------------------- bool MultiAttribute::is_att_quality_alarmed(bool all_att) { unsigned long i,j; bool ret; ret = false; for (i = 0;i < attr_list.size();i++) { if (all_att == false) { bool found = false; for (j = 0;j < alarm_attr_list.size();j++) { if (alarm_attr_list[j] == (long)i) { found = true; break; } } if (found == true) continue; } if ((attr_list[i]->get_quality() == Tango::ATTR_ALARM) || (attr_list[i]->get_quality() == Tango::ATTR_WARNING)) { ret = true; break; } } return ret; } //+------------------------------------------------------------------------- // // method : MultiAttribute::add_alarmed_quality_factor() // // description : Add to the status string name of attributes with // a quality factor set to alarm // //-------------------------------------------------------------------------- void MultiAttribute::add_alarmed_quality_factor(string &status) { unsigned long i,j; for (i = 0;i < attr_list.size();i++) { bool found = false; for (j = 0;j < alarm_attr_list.size();j++) { if (alarm_attr_list[j] == (long)i) { found = true; break; } } if (found == true) continue; if (attr_list[i]->get_quality() == Tango::ATTR_ALARM) { string &attr_label = attr_list[i]->get_label(); string str("\nAlarm : Quality factor set to ALARM for attribute "); if (attr_label == LabelNotSpec) { str = str + attr_list[i]->get_name(); } else { str = str + attr_label; } status = status + str; } else if (attr_list[i]->get_quality() == Tango::ATTR_WARNING) { string &attr_label = attr_list[i]->get_label(); string str("\nWarning : Quality factor set to WARNING for attribute "); if (attr_label == LabelNotSpec) { str = str + attr_list[i]->get_name(); } else { str = str + attr_label; } status = status + str; } } } } // End of Tango namespace tango-8.1.2c+dfsg.orig/lib/cpp/server/readers_writers_lock.h0000644000175000017500000001064512205375142023025 0ustar piccapicca// -*- Mode: C++; -*- // // ReadersWritersLock.h Author : Tristan Richardson (tjr) // Jens Meyer // Emmanuel Taurel // // Copyright (C) : 1997-1999 AT&T Laboratories Cambridge // 2004,2005,2006,2007,2008,2009,2010,2011,2012,2013 // European Synchrotron Radiation Facility // BP 220, Grenoble 38043 // FRANCE // // This file is part of Tango. // // Tango 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. // // Tango 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 Tango. If not, see . #ifndef _ReadersWritersLock_h_ #define _ReadersWritersLock_h_ #include class ReadersWritersLock { public: omni_mutex mut; omni_condition cond; int n; // 0 means no-one active, > 0 means n readers, < 0 means writer // (-n times). int writerId; ReadersWritersLock(void) : cond(&mut), n(0), writerId(0), auto_self(NULL) {} void readerIn(void) { mut.lock(); // In the case of usage with another threading library, omni_thread::self() might // return a NULL pointer! int threadId = 0; omni_thread *th = omni_thread::self(); if ( th != NULL ) { threadId = th->id(); } if ((n < 0) && (writerId == threadId)) { // this thread already has lock as writer, simply decrement n n--; mut.unlock(); return; } while (n < 0) cond.wait(); n++; mut.unlock(); } void readerOut(void) { mut.lock(); if (n < 0) { // this thread already had lock as writer, simply increment n n++; mut.unlock(); return; } n--; if (n == 0) cond.signal(); mut.unlock(); } void writerIn(void) { mut.lock(); // In the case of usage with another threading library, omni_thread::self() might // return a NULL pointer! int threadId = 0; omni_thread *th = omni_thread::self(); if ( th != NULL ) { threadId = th->id(); } if ((n < 0) && (writerId == threadId)) { // this thread already has lock as writer, simply decrement n n--; mut.unlock(); return; } while (n != 0) cond.wait(); n--; // Now the writer lock was taken. // Make sure we get a correct thread ID // With the class ensure_self it should return always a thread ID. // Create the ensure_self object only for the thread which takes the writer lock! if (th == NULL) auto_self = new omni_thread::ensure_self(); writerId = omni_thread::self()->id(); mut.unlock(); } void writerOut(void) { mut.lock(); n++; if (n == 0) { // delete the dummy thread when it was created. if (auto_self != NULL) { delete auto_self; auto_self = NULL; } cond.broadcast(); // might as well wake up all readers } mut.unlock(); } private: // in the case of usage with another threading library, omni_thread::self() might // return a NULL pointer! // To avoid this problem we use the class ensure_self to get a dummy thread ID! // // The class ensure_self should be created on the stack. If created in // a thread without an associated omni_thread, it creates a dummy // thread which is released when the ensure_self object is deleted. omni_thread::ensure_self *auto_self; }; // // As an alternative to: // { // lock.readerIn(); // ..... // lock.readerOut(); // } // // you can use a single instance of the ReaderLock class: // // { // ReaderLock r(lock); // .... // } // // This has the advantage that lock.readerOut() will be called automatically // when an exception is thrown. // class ReaderLock { ReadersWritersLock& rwl; public: ReaderLock(ReadersWritersLock& l) : rwl(l) { rwl.readerIn(); } ~ReaderLock(void) { rwl.readerOut(); } }; // // Similarly the WriterLock class can be used instead of lock.writerIn() and // lock.writerOut(). // class WriterLock { ReadersWritersLock& rwl; public: WriterLock(ReadersWritersLock& l) : rwl(l) { rwl.writerIn(); } ~WriterLock(void) { rwl.writerOut(); } }; #endif tango-8.1.2c+dfsg.orig/lib/cpp/server/command.h0000644000175000017500000035611512205375142020234 0ustar piccapicca//============================================================================= // // file : Command.h // // description : Include for the Device root classes. // One class is declared in this file : // The Command class // // project : TANGO // // author(s) : A.Gotz + E.Taurel // // Copyright (C) : 2004,2005,2006,2007,2008,2009,2010,2011,2012,2013 // European Synchrotron Radiation Facility // BP 220, Grenoble 38043 // FRANCE // // This file is part of Tango. // // Tango 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. // // Tango 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 Tango. If not, see . // // $Revision: 22213 $ // //============================================================================= #ifndef _COMMAND_H #define _COMMAND_H #include namespace Tango { #ifndef HAS_LAMBDA_FUNC // // Binary function objects to be used by the find_if algorithm. // The find_if algo. want to have a predicate, this means that the return value // must be a boolean (R is its name). // The find_if algo. needs a unary predicate. This function object is a binary // function object. It must be used with the bind2nd function adapter // template struct WantedCmd : public binary_function { R operator() (A1 cmd_ptr, A2 name) const { if (::strlen(name) != cmd_ptr->get_lower_name().size()) return false; string tmp_name(name); transform(tmp_name.begin(),tmp_name.end(),tmp_name.begin(),::tolower); return cmd_ptr->get_lower_name() == tmp_name; } }; #endif typedef bool (DeviceImpl::*ALLO_PTR)(const CORBA::Any &); /** * This class is a class representing a command in the TANGO device server * pattern. it is an abstract class. It is the root class for all command * related classes for command implemented with the inheritance model or * with the template command model * * $Author: taurel $ * $Revision: 22213 $ * * @headerfile tango.h * @ingroup Server */ class Command { public: /**@name Constructors * Miscellaneous constructors */ //@{ /** * Constructs a newly allocated Command object. * * The default constructor */ Command():ext(new CommandExt) {} /** * Constructs a newly allocated Command object for a command from its * name and its input and output parameter types. * The input and output parameter description are set to the default String * "Uninitialised". * The command display level is set to OPERATOR. * * @param s The command name * @param in The command input parameter type * @param out The command output parameter type * */ Command(const char *s,Tango::CmdArgType in,Tango::CmdArgType out); /** * Constructs a newly allocated Command object for a command from its * name and its input and output parameter types. * The input and output parameter description are set to the default String * "Uninitialised". * The command display level is set to OPERATOR. * * @param s The command name * @param in The command input parameter type * @param out The command output parameter type * */ Command(string &s,Tango::CmdArgType in,Tango::CmdArgType out); /** * Constructs a newly allocated Command object for a command from its * name, its input and output parameter types plus parameters description * The command display level is set to OPERATOR. * * @param s The command name * @param in The command input parameter type * @param out The command output parameter type * @param in_desc The input parameter description * @param out_desc The output parameter description * */ Command(const char *s,Tango::CmdArgType in,Tango::CmdArgType out, const char *in_desc,const char *out_desc); /** * Constructs a newly allocated Command object for a command from its * name, its input and output parameter types plus parameters description * The command display level is set to OPERATOR. * * @param s The command name * @param in The command input parameter type * @param out The command output parameter type * @param in_desc The input parameter description * @param out_desc The output parameter description * */ Command(string &s,Tango::CmdArgType in,Tango::CmdArgType out, string &in_desc,string &out_desc); /** * Constructs a newly allocated Command object for a command from its * name and its input and output parameter types. * The input and output parameter description are set to the default String * "Uninitialised". * * @param s The command name * @param in The command input parameter type * @param out The command output parameter type * @param level The command display level * */ Command(const char *s,Tango::CmdArgType in,Tango::CmdArgType out, Tango::DispLevel level); /** * Constructs a newly allocated Command object for a command from its * name and its input and output parameter types. * The input and output parameter description are set to the default String * "Uninitialised". * * @param s The command name * @param in The command input parameter type * @param out The command output parameter type * @param level The command display level * */ Command(string &s,Tango::CmdArgType in,Tango::CmdArgType out, Tango::DispLevel level); /** * Constructs a newly allocated Command object for a command from its * name, its input and output parameter types plus parameters description * * @param s The command name * @param in The command input parameter type * @param out The command output parameter type * @param in_desc The input parameter description * @param out_desc The output parameter description * @param level The command display level * */ Command(const char *s,Tango::CmdArgType in,Tango::CmdArgType out, const char *in_desc,const char *out_desc, Tango::DispLevel level); /** * Constructs a newly allocated Command object for a command from its * name, its input and output parameter types plus parameters description * * @param s The command name * @param in The command input parameter type * @param out The command output parameter type * @param in_desc The input parameter description * @param out_desc The output parameter description * @param level The command display level * */ Command(string &s,Tango::CmdArgType in,Tango::CmdArgType out, string &in_desc,string &out_desc, Tango::DispLevel level); //@} /**@name Destructor * Only one desctructor is defined for this class */ //@{ /** * The object desctructor. */ #ifdef HAS_UNIQUE_PTR virtual ~Command() {} #else virtual ~Command() {delete ext;} #endif //@} /**@name Miscellaneous methods */ //@{ /** * Execute the command. * * This method is automtically called by the TANGO core classes when the * associated command is requested by a client. This method is abstract and must be redefined * in each sub-class * * @param dev The device on which the command must be executed * @param in_any The incoming data still packed in a CORBA Any object. * @return The CORBA Any object returned to the client. * @exception DevFailed If the execution method failed. * Click here to read * DevFailed exception specification */ virtual CORBA::Any *execute (DeviceImpl *dev, const CORBA::Any &in_any) = 0; /** * Check if the command is allowed in the actual device state. * * This method is automtically called by the TANGO core classes when the * associated command is requested by a client to check if the command is allowed * in the actual device state. This method is the default is_allowed method which * always allows the command to be executed. It is possible to re-define it * if this default behaviour does not fullfill the device needs. * * @param dev The device on which the command must be executed * @param in_any The incoming data still packed in a CORBA Any object. This * data is passed to this method in case it is necessary to take the command * allowed decision * @return A boolean set to true is the command is allowed. Otherwise, the * return value is false. */ virtual bool is_allowed (DeviceImpl *dev, const CORBA::Any &in_any) {(void)dev;(void)in_any;return true;} /** * Init command parameters type. * * This method is used only for command implemented using the Tango template * command model. In this base class, it does nothing and is re-define in * sub-classes. * */ virtual void init_types() {}; //@} /**@name Get/Set object members. * These methods allows the external world to get/set DeviceImpl instance * data members */ //@{ /** * Return the command name. * * @return The command name */ string &get_name() {return name;} /** * Set the command name. * * @param new_name The new command name */ void set_name(string &new_name) {name=new_name;} /** * Return the command name in lower case letters. * * @return The command name */ string &get_lower_name() {return lower_name;} /** * Return the input parameter type. * * @return The input parameter type */ Tango::CmdArgType get_in_type() {return in_type;} /** * Return the output parameter type. * * @return The output parameter type */ Tango::CmdArgType get_out_type() {return out_type;} /** * Return the input parameter description. * * @return The input parameter description */ string &get_in_type_desc() {return in_type_desc;} /** * Return the output parameter description. * * @return The output parameter description */ string &get_out_type_desc() {return out_type_desc;} /** * Return the command display level. * * @return The command display level */ Tango::DispLevel get_disp_level() {return ext->cmd_disp_level;} /** * Set the input parameter description field. * * @param desc The input parameter description */ void set_in_type_desc(const char *desc) {in_type_desc = desc;} /** * Set the input parameter description field. * * @param desc The input parameter description */ void set_in_type_desc(string &desc) {in_type_desc = desc;} /** * Set the output parameter description field. * * @param desc The output parameter description */ void set_out_type_desc(const char *desc) {out_type_desc = desc;} /** * Set the output parameter description field. * * @param desc The output parameter description */ void set_out_type_desc(string &desc) {out_type_desc = desc;} /** * Set the command display level. * * @param level The command display level */ void set_disp_level(Tango::DispLevel level) {ext->cmd_disp_level = level;} /** * Set the command polling period. * * @param per The command polling period (in mS) */ void set_polling_period(long per) {ext->poll_period = per;} /** * Get the command polling period. * * @return The command polling period (in mS) */ long get_polling_period() {return ext->poll_period;} //@} /**@name Extract methods. * All these methods extract data from the CORBA Any object received as * command input data */ //@{ /** * Extract a boolean data from a CORBA Any object. * * @param in The CORBA Any object * @param data Reference to the extracted boolean data * @exception DevFailed If the Any object does not contains a data of the * waited type. * Click here to read * DevFailed exception specification */ void extract(const CORBA::Any &in,Tango::DevBoolean &data); /** * Extract a short data from a CORBA Any object. * * @param in The CORBA Any object * @param data Reference to the extracted short data * @exception DevFailed If the Any object does not contains a data of the * waited type. * Click here to read * DevFailed exception specification */ void extract(const CORBA::Any &in,Tango::DevShort &data); /** * Extract a long data from a CORBA Any object. * * @param in The CORBA Any object * @param data Reference to the extracted long data * @exception DevFailed If the Any object does not contains a data of the * waited type. * Click here to read * DevFailed exception specification */ void extract(const CORBA::Any &in,Tango::DevLong &data); /** * Extract a 64 bits long data from a CORBA Any object. * * @param in The CORBA Any object * @param data Reference to the extracted 64 bits long data * @exception DevFailed If the Any object does not contains a data of the * waited type. * Click here to read * DevFailed exception specification */ void extract(const CORBA::Any &in,Tango::DevLong64 &data); /** * Extract a float data from a CORBA Any object. * * @param in The CORBA Any object * @param data Reference to the extracted float data * @exception DevFailed If the Any object does not contains a data of the * waited type. * Click here to read * DevFailed exception specification */ void extract(const CORBA::Any &in,Tango::DevFloat &data); /** * Extract a double data from a CORBA Any object. * * @param in The CORBA Any object * @param data Reference to the extracted double data * @exception DevFailed If the Any object does not contains a data of the * waited type. * Click here to read * DevFailed exception specification */ void extract(const CORBA::Any &in,Tango::DevDouble &data); /** * Extract an unsigned short data from a CORBA Any object. * * @param in The CORBA Any object * @param data Reference to the extracted unsigned short data * @exception DevFailed If the Any object does not contanis a data of the * waited type. * Click here to read * DevFailed exception specification */ void extract(const CORBA::Any &in,Tango::DevUShort &data); /** * Extract an unsigned long data from a CORBA Any object. * * @param in The CORBA Any object * @param data Reference to the extracted unsigned long data * @exception DevFailed If the Any object does not contanis a data of the * waited type. * Click here to read * DevFailed exception specification */ void extract(const CORBA::Any &in,Tango::DevULong &data); /** * Extract an unsigned 64 bits long data from a CORBA Any object. * * @param in The CORBA Any object * @param data Reference to the extracted unsigned 64 bits long data * @exception DevFailed If the Any object does not contanis a data of the * waited type. * Click here to read * DevFailed exception specification */ void extract(const CORBA::Any &in,Tango::DevULong64 &data); /** * Extract a string from a CORBA Any object. * * @param in The CORBA Any object * @param data Reference to the extracted string data * @exception DevFailed If the Any object does not contains a data of the * waited type. * Click here to read * DevFailed exception specification */ void extract(const CORBA::Any &in,Tango::DevString &data); /** * Extract a const string from a CORBA Any object. * * @param in The CORBA Any object * @param data Reference to the extracted string data * @exception DevFailed If the Any object does not contains a data of the * waited type. * Click here to read * DevFailed exception specification */ void extract(const CORBA::Any &in,const char *&data); /** * Extract a char array from a CORBA Any object. * * @param in The CORBA Any object * @param data Reference to the extracted char array * @exception DevFailed If the Any object does not contains a data of the * waited type. * Click here to read * DevFailed exception specification */ void extract(const CORBA::Any &in,const Tango::DevVarCharArray *&data); /** * Extract a short array from a CORBA Any object. * * @param in The CORBA Any object * @param data Reference to the extracted short array * @exception DevFailed If the Any object does not contains a data of the * waited type. * Click here to read * DevFailed exception specification */ void extract(const CORBA::Any &in,const Tango::DevVarShortArray *&data); /** * Extract a long array from a CORBA Any object. * * @param in The CORBA Any object * @param data Reference to the extracted long array * @exception DevFailed If the Any object does not contains a data of the * waited type. * Click here to read * DevFailed exception specification */ void extract(const CORBA::Any &in,const Tango::DevVarLongArray *&data); /** * Extract a 64 bits long array from a CORBA Any object. * * @param in The CORBA Any object * @param data Reference to the extracted 64 bits long array * @exception DevFailed If the Any object does not contains a data of the * waited type. * Click here to read * DevFailed exception specification */ void extract(const CORBA::Any &in,const Tango::DevVarLong64Array *&data); /** * Extract a float array from a CORBA Any object. * * @param in The CORBA Any object * @param data Reference to the extracted float array * @exception DevFailed If the Any object does not contains a data of the * waited type. * Click here to read * DevFailed exception specification */ void extract(const CORBA::Any &in,const Tango::DevVarFloatArray *&data); /** * Extract a double array from a CORBA Any object. * * @param in The CORBA Any object * @param data Reference to the extracted double array * @exception DevFailed If the Any object does not contains a data of the * waited type. * Click here to read * DevFailed exception specification */ void extract(const CORBA::Any &in,const Tango::DevVarDoubleArray *&data); /** * Extract a unsigned short array from a CORBA Any object. * * @param in The CORBA Any object * @param data Reference to the extracted unsigned char array * @exception DevFailed If the Any object does not contains a data of the * waited type. * Click here to read * DevFailed exception specification */ void extract(const CORBA::Any &in,const Tango::DevVarUShortArray *&data); /** * Extract a unsigned long array from a CORBA Any object. * * @param in The CORBA Any object * @param data Reference to the extracted unsigned long array * @exception DevFailed If the Any object does not contains a data of the * waited type. * Click here to read * DevFailed exception specification */ void extract(const CORBA::Any &in,const Tango::DevVarULongArray *&data); /** * Extract a unsigned 64 bits long array from a CORBA Any object. * * @param in The CORBA Any object * @param data Reference to the extracted unsigned 64 bits long array * @exception DevFailed If the Any object does not contains a data of the * waited type. * Click here to read * DevFailed exception specification */ void extract(const CORBA::Any &in,const Tango::DevVarULong64Array *&data); /** * Extract a string array from a CORBA Any object. * * @param in The CORBA Any object * @param data Reference to the extracted string array * @exception DevFailed If the Any object does not contains a data of the * waited type. * Click here to read * DevFailed exception specification */ void extract(const CORBA::Any &in,const Tango::DevVarStringArray *&data); /** * Extract a DevVarLongStringArray data from a CORBA Any object. * * @param in The CORBA Any object * @param data Reference to the extracted DevVarLongStringArray data * @exception DevFailed If the Any object does not contains a data of the * waited type. * Click here to read * DevFailed exception specification */ void extract(const CORBA::Any &in,const Tango::DevVarLongStringArray *&data); /** * Extract a DevVarDoubleStringArray data from a CORBA Any object. * * @param in The CORBA Any object * @param data Reference to the extracted DevVarDoubleStringArray data * @exception DevFailed If the Any object does not contains a data of the * waited type. * Click here to read * DevFailed exception specification */ void extract(const CORBA::Any &in,const Tango::DevVarDoubleStringArray *&data); /** * Extract a Tango device state data from a CORBA Any object. * * @param in The CORBA Any object * @param data Reference to the extracted device state data * @exception DevFailed If the Any object does not contains a data of the * waited type. * Click here to read * DevFailed exception specification */ void extract(const CORBA::Any &in,Tango::DevState &data); /** * Extract a Tango DevEncoded data from a CORBA Any object. * * @param in The CORBA Any object * @param data Reference to the extracted DevEncoded data * @exception DevFailed If the Any object does not contains a data of the * waited type. * Click here to read * DevFailed exception specification */ void extract(const CORBA::Any &in,const Tango::DevEncoded *&data); //@} /**@name Insert methods. * All these methods create a CORBA Any object and insert data into this object */ //@{ /** * Create an empty CORBA Any object. * * @exception DevFailed If the Any object creation failed. * Click here to read * DevFailed exception specification */ CORBA::Any *insert(); /** * Create a CORBA Any object and insert a Tango::DevBoolean data in it. * * @param data The data to be inserted into the Any object * @exception DevFailed If the Any object creation failed. * Click here to read * DevFailed exception specification */ CORBA::Any *insert(Tango::DevBoolean data); /** * Create a CORBA Any object and insert a Tango::DevShort data in it. * * @param data The data to be inserted into the Any object * @exception DevFailed If the Any object creation failed. * Click here to read * DevFailed exception specification */ CORBA::Any *insert(Tango::DevShort data); /** * Create a CORBA Any object and insert a Tango::DevLong data in it. * * @param data The data to be inserted into the Any object * @exception DevFailed If the Any object creation failed. * Click here to read * DevFailed exception specification */ CORBA::Any *insert(Tango::DevLong data); /** * Create a CORBA Any object and insert a Tango::DevLong64 data in it. * * @param data The data to be inserted into the Any object * @exception DevFailed If the Any object creation failed. * Click here to read * DevFailed exception specification */ CORBA::Any *insert(Tango::DevLong64 data); /** * Create a CORBA Any object and insert a Tango::DevFloat data in it. * * @param data The data to be inserted into the Any object * @exception DevFailed If the Any object creation failed. * Click here to read * DevFailed exception specification */ CORBA::Any *insert(Tango::DevFloat data); /** * Create a CORBA Any object and insert a Tango::DevDouble data in it. * * @param data The data to be inserted into the Any object * @exception DevFailed If the Any object creation failed. * Click here to read * DevFailed exception specification */ CORBA::Any *insert(Tango::DevDouble data); /** * Create a CORBA Any object and insert a Tango::DevUShort data in it. * * @param data The data to be inserted into the Any object * @exception DevFailed If the Any object creation failed. * Click here to read * DevFailed exception specification */ CORBA::Any *insert(Tango::DevUShort data); /** * Create a CORBA Any object and insert a Tango::DevULong data in it. * * @param data The data to be inserted into the Any object * @exception DevFailed If the Any object creation failed. * Click here to read * DevFailed exception specification */ CORBA::Any *insert(Tango::DevULong data); /** * Create a CORBA Any object and insert a Tango::DevULong64 data in it. * * @param data The data to be inserted into the Any object * @exception DevFailed If the Any object creation failed. * Click here to read * DevFailed exception specification */ CORBA::Any *insert(Tango::DevULong64 data); /** * Create a CORBA Any object and insert a Tango::DevString data in it. * * This method will also de-allocate the string passed as parameter. * * @param data The string to be inserted into the Any object * @exception DevFailed If the Any object creation failed. * Click here to read * DevFailed exception specification */ CORBA::Any *insert(Tango::DevString data); /** * Create a CORBA Any object and insert a Tango::DevString data in it. * Te parameter type is char * and not Tango::DevString because the const * C++ modifier applied to a Tango::DevString make the pointer constant and * not the pointed to characters to be constant. * * @param data The string to be inserted into the Any object * @exception DevFailed If the Any object creation failed. * Click here to read * DevFailed exception specification */ CORBA::Any *insert(const char *data); /** * Create a CORBA Any object and insert a Tango::DevVarCharArray data in it. * * This method will do a deep copy of the array into the Any object. * * @param data The array to be inserted into the Any object * @exception DevFailed If the Any object creation failed. * Click here to read * DevFailed exception specification */ CORBA::Any *insert(Tango::DevVarCharArray &data); /** * Create a CORBA Any object and insert a Tango::DevVarCharArray data in it. * * This method consumes the memory used by the array. * When the CORBA layer will destroy the Any object, the memory alloacted * for the array will also be freed. This is the recommended method to * insert Tango::DevVarCharArray data type into a CORBA Any object. * * @param data The array to be inserted into the Any object * @exception DevFailed If the Any object creation failed. * Click here to read * DevFailed exception specification */ CORBA::Any *insert(Tango::DevVarCharArray *data); /** * Create a CORBA Any object and insert a Tango::DevVarShortArray data in it. * * This method will do a deep copy of the array into the Any object. * * @param data The array to be inserted into the Any object * @exception DevFailed If the Any object creation failed. * Click here to read * DevFailed exception specification */ CORBA::Any *insert(Tango::DevVarShortArray &data); /** * Create a CORBA Any object and insert a Tango::DevVarShortArray data in it. * * This method consumes the memory used by the array. * When the CORBA layer will destroy the Any object, the memory alloacted * for the array will also be freed. This is the recommended method to * insert Tango::DevVarShortArray data type into a CORBA Any object. * * @param data The array to be inserted into the Any object * @exception DevFailed If the Any object creation failed. * Click here to read * DevFailed exception specification */ CORBA::Any *insert(Tango::DevVarShortArray *data); /** * Create a CORBA Any object and insert a Tango::DevVarLongArray data in it. * * This method will do a deep copy of the array into the Any object. * * @param data The array to be inserted into the Any object * @exception DevFailed If the Any object creation failed. * Click here to read * DevFailed exception specification */ CORBA::Any *insert(Tango::DevVarLongArray &data); /** * Create a CORBA Any object and insert a Tango::DevVarLongArray data in it. * * This method consumes the memory used by the array. * When the CORBA layer will destroy the Any object, the memory alloacted * for the array will also be freed. This is the recommended method to * insert Tango::DevVarLongArray data type into a CORBA Any object. * * @param data The array to be inserted into the Any object * @exception DevFailed If the Any object creation failed. * Click here to read * DevFailed exception specification */ CORBA::Any *insert(Tango::DevVarLongArray *data); /** * Create a CORBA Any object and insert a Tango::DevVarLong64Array data in it. * * This method will do a deep copy of the array into the Any object. * * @param data The array to be inserted into the Any object * @exception DevFailed If the Any object creation failed. * Click here to read * DevFailed exception specification */ CORBA::Any *insert(Tango::DevVarLong64Array &data); /** * Create a CORBA Any object and insert a Tango::DevVarLong64Array data in it. * * This method consumes the memory used by the array. * When the CORBA layer will destroy the Any object, the memory alloacted * for the array will also be freed. This is the recommended method to * insert Tango::DevVarLongArray data type into a CORBA Any object. * * @param data The array to be inserted into the Any object * @exception DevFailed If the Any object creation failed. * Click here to read * DevFailed exception specification */ CORBA::Any *insert(Tango::DevVarLong64Array *data); /** * Create a CORBA Any object and insert a Tango::DevVarFloatArray data in it. * * This method will do a deep copy of the array into the Any object. * * @param data The array to be inserted into the Any object * @exception DevFailed If the Any object creation failed. * Click here to read * DevFailed exception specification */ CORBA::Any *insert(Tango::DevVarFloatArray &data); /** * Create a CORBA Any object and insert a Tango::DevVarFloatArray data in it. * * This method consumes the memory used by the array. * When the CORBA layer will destroy the Any object, the memory alloacted * for the array will also be freed. This is the recommended method to * insert Tango::DevVarFloatArray data type into a CORBA Any object. * * @param data The array to be inserted into the Any object * @exception DevFailed If the Any object creation failed. * Click here to read * DevFailed exception specification */ CORBA::Any *insert(Tango::DevVarFloatArray *data); /** * Create a CORBA Any object and insert a Tango::DevVarDoubleArray data in it. * * This method will do a deep copy of the array into the Any object. * * @param data The array to be inserted into the Any object * @exception DevFailed If the Any object creation failed. * Click here to read * DevFailed exception specification */ CORBA::Any *insert(Tango::DevVarDoubleArray &data); /** * Create a CORBA CORBA::Any object and insert a Tango::DevVarDoubleArray data in it. * * This method consumes the memory used by the array. * When the CORBA layer will destroy the Any object, the memory alloacted * for the array will also be freed. This is the recommended method to * insert Tango::DevVarDoubleArray data type into a CORBA Any object. * * @param data The array to be inserted into the Any object * @exception DevFailed If the Any object creation failed. * Click here to read * DevFailed exception specification */ CORBA::Any *insert(Tango::DevVarDoubleArray *data); /** * Create a CORBA Any object and insert a Tango::DevVarUShortArray data in it. * * This method will do a deep copy of the array into the Any object. * * @param data The array to be inserted into the Any object * @exception DevFailed If the Any object creation failed. * Click here to read * DevFailed exception specification */ CORBA::Any *insert(Tango::DevVarUShortArray &data); /** * Create a CORBA Any object and insert a Tango::DevVarUShortArray data in it. * * This method consumes the memory used by the array. * When the CORBA layer will destroy the Any object, the memory alloacted * for the array will also be freed. This is the recommended method to * insert Tango::DevVarUShortArray data type into a CORBA Any object. * * @param data The array to be inserted into the Any object * @exception DevFailed If the Any object creation failed. * Click here to read * DevFailed exception specification */ CORBA::Any *insert(Tango::DevVarUShortArray *data); /** * Create a CORBA Any object and insert a Tango::DevVarULongArray data in it. * * This method will do a deep copy of the array into the Any object. * * @param data The array to be inserted into the Any object * @exception DevFailed If the Any object creation failed. * Click here to read * DevFailed exception specification */ CORBA::Any *insert(Tango::DevVarULongArray &data); /** * Create a CORBA Any object and insert a Tango::DevVarULongArray data in it. * * This method consumes the memory used by the array. * When the CORBA layer will destroy the Any object, the memory alloacted * for the array will also be freed. This is the recommended method to * insert Tango::DevVarULongArray data type into a CORBA Any object. * * @param data The array to be inserted into the Any object * @exception DevFailed If the Any object creation failed. * Click here to read * DevFailed exception specification */ CORBA::Any *insert(Tango::DevVarULongArray *data); /** * Create a CORBA Any object and insert a Tango::DevVarULong64Array data in it. * * This method will do a deep copy of the array into the Any object. * * @param data The array to be inserted into the Any object * @exception DevFailed If the Any object creation failed. * Click here to read * DevFailed exception specification */ CORBA::Any *insert(Tango::DevVarULong64Array &data); /** * Create a CORBA Any object and insert a Tango::DevVarULong64Array data in it. * * This method consumes the memory used by the array. * When the CORBA layer will destroy the Any object, the memory alloacted * for the array will also be freed. This is the recommended method to * insert Tango::DevVarULongArray data type into a CORBA Any object. * * @param data The array to be inserted into the Any object * @exception DevFailed If the Any object creation failed. * Click here to read * DevFailed exception specification */ CORBA::Any *insert(Tango::DevVarULong64Array *data); /** * Create a CORBA Any object and insert a Tango::DevVarStringArray data in it. * * This method will do a deep copy of the array into the Any object. * * @param data The array to be inserted into the Any object * @exception DevFailed If the Any object creation failed. * Click here to read * DevFailed exception specification */ CORBA::Any *insert(Tango::DevVarStringArray &data); /** * Create a CORBA Any object and insert a Tango::DevVarStringArray data in it. * * This method consumes the memory used by the array. * When the CORBA layer will destroy the Any object, the memory alloacted * for the array will also be freed. This is the recommended method to * insert Tango::DevVarStringArray data type into a CORBA Any object. * * @param data The array to be inserted into the Any object * @exception DevFailed If the Any object creation failed. * Click here to read * DevFailed exception specification */ CORBA::Any *insert(Tango::DevVarStringArray *data); /** * Create a CORBA Any object and insert a Tango::DevVarLongStringArray data in it. * * This method will do a deep copy of the array into the Any object. * * @param data The array to be inserted into the Any object * @exception DevFailed If the Any object creation failed. * Click here to read * DevFailed exception specification */ CORBA::Any *insert(Tango::DevVarLongStringArray &data); /** * Create a CORBA Any object and insert a Tango::DevVarLongStringArray data in it. * * This method consumes the memory used by the array. * When the CORBA layer will destroy the Any object, the memory alloacted * for the array will also be freed. This is the recommended method to * insert Tango::DevVarLongStringArray data type into a CORBA Any object. * * @param data The array to be inserted into the Any object * @exception DevFailed If the Any object creation failed. * Click here to read * DevFailed exception specification */ CORBA::Any *insert(Tango::DevVarLongStringArray *data); /** * Create a CORBA Any object and insert a Tango::DevVarDoubleStringArray data in it. * * This method will do a deep copy of the array into the Any object. * * @param data The array to be inserted into the Any object * @exception DevFailed If the Any object creation failed. * Click here to read * DevFailed exception specification */ CORBA::Any *insert(Tango::DevVarDoubleStringArray &data); /** * Create a CORBA Any object and insert a Tango::DevVarDoubleStringArray data in it. * * This method consumes the memory used by the array. * When the CORBA layer will destroy the Any object, the memory alloacted * for the array will also be freed. This is the recommended method to * insert Tango::DevVarDoubleStringArray data type into a CORBA Any object. * * @param data The array to be inserted into the Any object * @exception DevFailed If the Any object creation failed. * Click here to read * DevFailed exception specification */ CORBA::Any *insert(Tango::DevVarDoubleStringArray *data); /** * Create a CORBA Any object and insert a Tango::DevState data in it. * * @param data The data to be inserted into the Any object * @exception DevFailed If the Any object creation failed. * Click here to read * DevFailed exception specification */ CORBA::Any *insert(Tango::DevState data); /** * Create a CORBA Any object and insert a Tango::DevEncoded data in it. * * This method consumes the memory used by the array. * When the CORBA layer will destroy the Any object, the memory alloacted * for the array will also be freed. This is the recommended method to * insert Tango::DevVarDoubleStringArray data type into a CORBA Any object. * * @param data The array to be inserted into the Any object * @exception DevFailed If the Any object creation failed. * Click here to read * DevFailed exception specification */ CORBA::Any *insert(Tango::DevEncoded *data); //@} protected: /**@name Class data members */ //@{ /** * The command name */ string name; /** * The command name in lower case */ string lower_name; /** * The command input parameter type */ Tango::CmdArgType in_type; /** * The command output parameter type */ Tango::CmdArgType out_type; /** * The command input parameter description */ string in_type_desc; /** * The command output parameter type */ string out_type_desc; //@} private: class CommandExt { public: CommandExt():poll_period(0) {cmd_disp_level = Tango::OPERATOR;} CommandExt(Tango::DispLevel level):poll_period(0) {cmd_disp_level = level;} Tango::DispLevel cmd_disp_level; // Display level long poll_period; // Polling period }; void alloc_any(CORBA::Any *&); void throw_bad_type(const char *); #ifdef HAS_UNIQUE_PTR unique_ptr ext; // Class extension #else CommandExt *ext; #endif }; //============================================================================= // // The TemplCommand class // // // description : This class is a derived class of the Command class. // It is used to create a command from a pointer to a // object method which will execute the command. // This class is for command without inout nor output // paremeters. // This class is also a base class for the template Command // class // //============================================================================= /** * This class is a class representing a command in the template command model * without input or output parameter * * $Author: taurel $ * $Revision: 22213 $ * * @headerfile tango.h * @ingroup Server */ class TemplCommand:public Command { public: /**@name Constructors * Miscellaneous constructors */ //@{ /** * Constructs a newly allocated Command object. * * The default constructor */ TemplCommand():ext(Tango_NullPtr) {} /** * Constructs a newly allocated TemplCommand object for a command with a * name and an execution method. * This constructor set the command input and output type to Tango::DEV_VOID. * The input and output parameter description are set to the default String * "Uninitialised". * The command display level is set to OPERATOR. * * @param cmd_name The command name * @param exe_method Pointer to the command execution method * */ TemplCommand(const char *cmd_name,void (DeviceImpl::*exe_method)()); /** * Constructs a newly allocated TemplCommand object for a command with a * name and an execution method. * This constructor set the command input and output type to Tango::DEV_VOID. * The input and output parameter description are set to the default String * "Uninitialised". * The command display level is set to OPERATOR. * * @param cmd_name The command name * @param exe_method Pointer to the command execution method * */ TemplCommand(string &cmd_name,void (DeviceImpl::*exe_method)()); /** * Constructs a newly allocated TemplCommand object for a command with a * name, an execution method and a command allowed method. * This constructor set the command input and output type to Tango::DEV_VOID * The input and output parameter description are set to the default String * "Uninitialised". * The command display level is set to OPERATOR. * * @param cmd_name The command name * @param exe_method Pointer to the command execution method * @param state_method Pointer to the command allowed method * */ TemplCommand(const char *cmd_name,void (DeviceImpl::*exe_method)(), bool (DeviceImpl::*state_method)(const CORBA::Any &)); /** * Constructs a newly allocated TemplCommand object for a command with a * name, an execution method and a command allowed method. * This constructor set the command input and output type to Tango::DEV_VOID * The input and output parameter description are set to the default String * "Uninitialised". * The command display level is set to OPERATOR. * * @param cmd_name The command name * @param exe_method Pointer to the command execution method * @param state_method Pointer to the command allowed method * */ TemplCommand(string &cmd_name,void (DeviceImpl::*exe_method)(), bool (DeviceImpl::*state_method)(const CORBA::Any &)); /** * Constructs a newly allocated TemplCommand object for a command with a * name, an execution method and a description for the * input and output command parameters. * The command display level is set to OPERATOR. * * @param cmd_name The command name * @param exe_method Pointer to the command execution method * @param in_desc The command input parameter description * @param out_desc The command output parameter description * */ TemplCommand(const char *cmd_name,void (DeviceImpl::*exe_method)(), const char *in_desc,const char *out_desc); /** * Constructs a newly allocated TemplCommand object for a command with a * name, an execution method and a description for the * input and output command parameters. * The command display level is set to OPERATOR. * * @param cmd_name The command name * @param exe_method Pointer to the command execution method * @param in_desc The command input parameter description * @param out_desc The command output parameter description * */ TemplCommand(string &cmd_name,void (DeviceImpl::*exe_method)(), string &in_desc,string &out_desc); /** * Constructs a newly allocated TemplCommand object for a command with a * name, an execution method, a command allowed method and a description for the * input and output command parameters. * This constructor set the command input and output type to Tango::DEV_VOID. * The command display level is set to OPERATOR. * * @param cmd_name The command name * @param exe_method Pointer to the command execution method * @param state_method Pointer to the command allowed method * @param in_desc The command input parameter description * @param out_desc The command output parameter description * */ TemplCommand(const char *cmd_name,void (DeviceImpl::*exe_method)(), bool (DeviceImpl::*state_method)(const CORBA::Any &), const char *in_desc,const char *out_desc); /** * Constructs a newly allocated TemplCommand object for a command with a * name, an execution method, a command allowed method and a description for the * input and output command parameters. * This constructor set the command input and output type to Tango::DEV_VOID. * The command display level is set to OPERATOR. * * @param cmd_name The command name * @param exe_method Pointer to the command execution method * @param state_method Pointer to the command allowed method * @param in_desc The command input parameter description * @param out_desc The command output parameter description * */ TemplCommand(string &cmd_name,void (DeviceImpl::*exe_method)(), bool (DeviceImpl::*state_method)(const CORBA::Any &), string &in_desc,string &out_desc); /** * Constructs a newly allocated TemplCommand object for a command with a * name and an execution method. * This constructor set the command input and output type to Tango::DEV_VOID. * The input and output parameter description are set to the default String * "Uninitialised". * * @param cmd_name The command name * @param exe_method Pointer to the command execution method * @param level The command display level * */ TemplCommand(const char *cmd_name,void (DeviceImpl::*exe_method)(), Tango::DispLevel level); /** * Constructs a newly allocated TemplCommand object for a command with a * name and an execution method. * This constructor set the command input and output type to Tango::DEV_VOID. * The input and output parameter description are set to the default String * "Uninitialised". * * @param cmd_name The command name * @param exe_method Pointer to the command execution method * @param level The command display level * */ TemplCommand(string &cmd_name,void (DeviceImpl::*exe_method)(), Tango::DispLevel level); /** * Constructs a newly allocated TemplCommand object for a command with a * name, an execution method and a command allowed method. * This constructor set the command input and output type to Tango::DEV_VOID * The input and output parameter description are set to the default String * "Uninitialised". * * @param cmd_name The command name * @param exe_method Pointer to the command execution method * @param state_method Pointer to the command allowed method * @param level The command display level * */ TemplCommand(const char *cmd_name,void (DeviceImpl::*exe_method)(), bool (DeviceImpl::*state_method)(const CORBA::Any &), Tango::DispLevel level); /** * Constructs a newly allocated TemplCommand object for a command with a * name, an execution method and a command allowed method. * This constructor set the command input and output type to Tango::DEV_VOID * The input and output parameter description are set to the default String * "Uninitialised". * * @param cmd_name The command name * @param exe_method Pointer to the command execution method * @param state_method Pointer to the command allowed method * @param level The command display level * */ TemplCommand(string &cmd_name,void (DeviceImpl::*exe_method)(), bool (DeviceImpl::*state_method)(const CORBA::Any &), Tango::DispLevel level); /** * Constructs a newly allocated TemplCommand object for a command with a * name, an execution method and a description for the * input and output command parameters. * * @param cmd_name The command name * @param exe_method Pointer to the command execution method * @param in_desc The command input parameter description * @param out_desc The command output parameter description * @param level The command display level * */ TemplCommand(const char *cmd_name,void (DeviceImpl::*exe_method)(), const char *in_desc,const char *out_desc, Tango::DispLevel level); /** * Constructs a newly allocated TemplCommand object for a command with a * name, an execution method and a description for the * input and output command parameters. * * @param cmd_name The command name * @param exe_method Pointer to the command execution method * @param in_desc The command input parameter description * @param out_desc The command output parameter description * @param level The command display level * */ TemplCommand(string &cmd_name,void (DeviceImpl::*exe_method)(), string &in_desc,string &out_desc, Tango::DispLevel level); /** * Constructs a newly allocated TemplCommand object for a command with a * name, an execution method, a command allowed method and a description for the * input and output command parameters. * This constructor set the command input and output type to Tango::DEV_VOID. * * @param cmd_name The command name * @param exe_method Pointer to the command execution method * @param state_method Pointer to the command allowed method * @param in_desc The command input parameter description * @param out_desc The command output parameter description * @param level The command display level * */ TemplCommand(const char *cmd_name,void (DeviceImpl::*exe_method)(), bool (DeviceImpl::*state_method)(const CORBA::Any &), const char *in_desc,const char *out_desc, Tango::DispLevel level); /** * Constructs a newly allocated TemplCommand object for a command with a * name, an execution method, a command allowed method and a description for the * input and output command parameters. * This constructor set the command input and output type to Tango::DEV_VOID. * * @param cmd_name The command name * @param exe_method Pointer to the command execution method * @param state_method Pointer to the command allowed method * @param in_desc The command input parameter description * @param out_desc The command output parameter description * @param level The command display level * */ TemplCommand(string &cmd_name,void (DeviceImpl::*exe_method)(), bool (DeviceImpl::*state_method)(const CORBA::Any &), string &in_desc,string &out_desc, Tango::DispLevel level); //@} /**@name Miscellaneous methods */ //@{ /** * Choose the correct TANGO data type constant according to data type * * The TANGO constant is determined using the type_info object passed * as first argument of the method. This data is compared to each defined * Tango type. * * @param data_type The type to be analysed * @param type A reference where Tango data type constant must be stored * @exception DevFailed If the type is not a Tango data type * Click here to read * DevFailed exception specification */ void set_type(const type_info &data_type,Tango::CmdArgType &type); /** * Invoke the command execution method given at object creation time. * * This method is automatically called by the TANGO core classes when the * associated command is requested by a client. * * @param dev The device on which the command must be executed * @param in_any The incoming data still packed in a CORBA Any object. For * command created with this TemplCommand class, this Any object does not * contain usefull data * @return The CORBA Any object returned to the client. For command created with * this TemplCommand class, this any object does not contain data. * @exception DevFailed If the execution method failed * Click here to read * DevFailed exception specification */ CORBA::Any *execute (DeviceImpl *dev, const CORBA::Any &in_any); /** * Invoke the command allowed method given at object creation time. * * This method is automtically called by the TANGO core classes when the * associated command is requested by a client to check if the command is allowed * in the actual device state. If the user give a command allowed method * at object creation time, this method will be invoked. * * @param dev The device on which the command must be executed * @param in_any The incoming data still packed in a CORBA Any object. For * command created with this TemplCommand class, this Any object does not * contain data * @return A boolean set to true is the command is allowed. Otherwise, the * return value is false. This return value is always set to true if the user * does not supply a method to be excuted. If a method has been supplied, the * return value is the value returned by the user supplied mehod. */ bool is_allowed (DeviceImpl *dev, const CORBA::Any &in_any); //@} private: class TemplCommandExt { }; void (DeviceImpl::*exe_ptr)(); #ifdef HAS_UNIQUE_PTR unique_ptr ext; // Class extension #else TemplCommandExt *ext; #endif protected: /**@name Class data members */ //@{ /** * The command allowed method object reference */ bool (DeviceImpl::*allowed_ptr)(const CORBA::Any &); //@} }; //============================================================================= // // The TemplCommandInOut class // // // description : This class is a derived class of the Command class. // It is used to create a command from a pointer to a // object method which will execute the command. // This class is for command without inout nor output // paremeters. // This class is also a base class for the template Command // class // //============================================================================= /** * This class is a class representing a command in the template command model * with output and input parameters. The class template * parameters (called INARG and OUTARG) are the command input parameter type * and the command output parameter type. *

Synopsis : template class TemplCommandInOut:public TemplCommand;

*

Usage : new TemplCommandInOut(...);

* * $Author: taurel $ * $Revision: 22213 $ * * @headerfile tango.h * @ingroup Server */ template class TemplCommandInOut:public TemplCommand { public: /**@name Constructors * Miscellaneous constructors */ //@{ /** * Constructs a newly allocated TemplCommandInOut object for a command with a * name and an execution method. * The input and output command data type are automatically determined. * The input and output parameter description are set to the default String * "Uninitialised". * The command display level is set to OPERATOR. * * @param cmd_name The command name * @param exe_method Pointer to the command execution method * */ TemplCommandInOut(const char *cmd_name, OUTARG (DeviceImpl::*exe_method)(INARG)); /** * Constructs a newly allocated TemplCommandInOut object for a command with a * name and an execution method. * The input and output command data type are automatically determined. * The input and output parameter description are set to the default String * "Uninitialised". * The command display level is set to OPERATOR. * * @param cmd_name The command name * @param exe_method Pointer to the command execution method * */ TemplCommandInOut(string &cmd_name, OUTARG (DeviceImpl::*exe_method)(INARG)); /** * Constructs a newly allocated TemplCommandInout object for a command with a * name, an execution method and a command allowed method. * The input and output command data type are automatically determined. * The input and output parameter description are set to the default String * "Uninitialised". * The command display level is set to OPERATOR. * * @param cmd_name The command name * @param exe_method Pointer to the command execution method * @param state_method Pointer to the command allowed method * */ TemplCommandInOut(const char *cmd_name, OUTARG (DeviceImpl::*exe_method)(INARG), bool (DeviceImpl::*state_method)(const CORBA::Any &)); /** * Constructs a newly allocated TemplCommandInOut object for a command with a * name, an execution method and a command allowed method. * The input and output command data type are automatically determined. * The input and output parameter description are set to the default String * "Uninitialised". * The command display level is set to OPERATOR. * * @param cmd_name The command name * @param exe_method Pointer to the command execution method * @param state_method Pointer to the command allowed method * */ TemplCommandInOut(string &cmd_name, OUTARG (DeviceImpl::*exe_method)(INARG), bool (DeviceImpl::*state_method)(const CORBA::Any &)); /** * Constructs a newly allocated TemplCommandInOut object for a command with a * name, an execution method and a description for the * input and output command parameters. * The input and output command data type are automatically determined. * The command display level is set to OPERATOR. * * @param cmd_name The command name * @param exe_method Pointer to the command execution method * @param in_desc The command input parameter description * @param out_desc The command output parameter description * */ TemplCommandInOut(const char *cmd_name, OUTARG (DeviceImpl::*exe_method)(INARG), const char *in_desc,const char *out_desc); /** * Constructs a newly allocated TemplCommandInOut object for a command with a * name, an execution method and a description for the * input and output command parameters. * The input and output command data type are automatically determined. * The command display level is set to OPERATOR. * * @param cmd_name The command name * @param exe_method Pointer to the command execution method * @param in_desc The command input parameter description * @param out_desc The command output parameter description * */ TemplCommandInOut(string &cmd_name, OUTARG (DeviceImpl::*exe_method)(INARG), string &in_desc,string &out_desc); /** * Constructs a newly allocated TemplCommandInOut object for a command with a * name, an execution method, a command allowed method and a description for the * input and output command parameters. * The input and output command data type are automatically determined. * The command display level is set to OPERATOR. * * @param cmd_name The command name * @param exe_method Pointer to the command execution method * @param state_method Pointer to the command allowed method * @param in_desc The command input parameter description * @param out_desc The command output parameter description * */ TemplCommandInOut(const char *cmd_name, OUTARG (DeviceImpl::*exe_method)(INARG), bool (DeviceImpl::*state_method)(const CORBA::Any &), const char *in_desc,const char *out_desc); /** * Constructs a newly allocated TemplCommandInOut object for a command with a * name, an execution method, a command allowed method and a description for the * input and output command parameters. * The input and output command data type are automatically determined. * The command display level is set to OPERATOR. * * @param cmd_name The command name * @param exe_method Pointer to the command execution method * @param state_method Pointer to the command allowed method * @param in_desc The command input parameter description * @param out_desc The command output parameter description * */ TemplCommandInOut(string &cmd_name, OUTARG (DeviceImpl::*exe_method)(INARG), bool (DeviceImpl::*state_method)(const CORBA::Any &), string &in_desc,string &out_desc); /** * Constructs a newly allocated TemplCommandInOut object for a command with a * name and an execution method. * The input and output command data type are automatically determined. * The input and output parameter description are set to the default String * "Uninitialised". * * @param cmd_name The command name * @param exe_method Pointer to the command execution method * @param level The command display level * */ TemplCommandInOut(const char *cmd_name, OUTARG (DeviceImpl::*exe_method)(INARG), Tango::DispLevel level); /** * Constructs a newly allocated TemplCommandInOut object for a command with a * name and an execution method. * The input and output command data type are automatically determined. * The input and output parameter description are set to the default String * "Uninitialised". * * @param cmd_name The command name * @param exe_method Pointer to the command execution method * @param level The command display level * */ TemplCommandInOut(string &cmd_name, OUTARG (DeviceImpl::*exe_method)(INARG), Tango::DispLevel level); /** * Constructs a newly allocated TemplCommandInout object for a command with a * name, an execution method and a command allowed method. * The input and output command data type are automatically determined. * The input and output parameter description are set to the default String * "Uninitialised". * * @param cmd_name The command name * @param exe_method Pointer to the command execution method * @param state_method Pointer to the command allowed method * @param level The command display level * */ TemplCommandInOut(const char *cmd_name, OUTARG (DeviceImpl::*exe_method)(INARG), bool (DeviceImpl::*state_method)(const CORBA::Any &), Tango::DispLevel level); /** * Constructs a newly allocated TemplCommandInOut object for a command with a * name, an execution method and a command allowed method. * The input and output command data type are automatically determined. * The input and output parameter description are set to the default String * "Uninitialised". * * @param cmd_name The command name * @param exe_method Pointer to the command execution method * @param state_method Pointer to the command allowed method * @param level The command display level * */ TemplCommandInOut(string &cmd_name, OUTARG (DeviceImpl::*exe_method)(INARG), bool (DeviceImpl::*state_method)(const CORBA::Any &), Tango::DispLevel level); /** * Constructs a newly allocated TemplCommandInOut object for a command with a * name, an execution method and a description for the * input and output command parameters. * The input and output command data type are automatically determined. * * @param cmd_name The command name * @param exe_method Pointer to the command execution method * @param in_desc The command input parameter description * @param out_desc The command output parameter description * @param level The command display level * */ TemplCommandInOut(const char *cmd_name, OUTARG (DeviceImpl::*exe_method)(INARG), const char *in_desc,const char *out_desc, Tango::DispLevel level); /** * Constructs a newly allocated TemplCommandInOut object for a command with a * name, an execution method and a description for the * input and output command parameters. * The input and output command data type are automatically determined. * * @param cmd_name The command name * @param exe_method Pointer to the command execution method * @param in_desc The command input parameter description * @param out_desc The command output parameter description * @param level The command display level * */ TemplCommandInOut(string &cmd_name, OUTARG (DeviceImpl::*exe_method)(INARG), string &in_desc,string &out_desc, Tango::DispLevel level); /** * Constructs a newly allocated TemplCommandInOut object for a command with a * name, an execution method, a command allowed method and a description for the * input and output command parameters. * The input and output command data type are automatically determined. * * @param cmd_name The command name * @param exe_method Pointer to the command execution method * @param state_method Pointer to the command allowed method * @param in_desc The command input parameter description * @param out_desc The command output parameter description * @param level The command display level * */ TemplCommandInOut(const char *cmd_name, OUTARG (DeviceImpl::*exe_method)(INARG), bool (DeviceImpl::*state_method)(const CORBA::Any &), const char *in_desc,const char *out_desc, Tango::DispLevel level); /** * Constructs a newly allocated TemplCommandInOut object for a command with a * name, an execution method, a command allowed method and a description for the * input and output command parameters. * The input and output command data type are automatically determined. * * @param cmd_name The command name * @param exe_method Pointer to the command execution method * @param state_method Pointer to the command allowed method * @param in_desc The command input parameter description * @param out_desc The command output parameter description * @param level The command display level * */ TemplCommandInOut(string &cmd_name, OUTARG (DeviceImpl::*exe_method)(INARG), bool (DeviceImpl::*state_method)(const CORBA::Any &), string &in_desc,string &out_desc, Tango::DispLevel level); //@} ~TemplCommandInOut() {} /**@name Miscellaneous methods */ //@{ /** * Initialise command input and output types. * * Set the command output type to Tango::DEV_VOID. The command input type is * automatically determined from the class template specialisation * */ void init_types(); /** * Invoke the command execution method given at object creation time. * * This method is automtically called by the TANGO core classes when the * associated command is requested by a client. It first unpacks the incoming * data. Then, it invokes the user supplied * command execution method and packs the returned data into the outgoing * CORBA Any object * * @param dev The device on which the command must be executed * @param in_any The incoming data still packed in a CORBA Any object. * @return The CORBA Any object returned to the client. * @exception DevFailed If the execution method failed * Click here to read * DevFailed exception specification */ CORBA::Any *execute (DeviceImpl *dev, const CORBA::Any &in_any); //@} private: class TemplCommandInOutExt { }; OUTARG (DeviceImpl::*exe_ptr_inout)(INARG); #ifdef HAS_UNIQUE_PTR unique_ptr ext; // Class extension #else TemplCommandInOutExt *ext; #endif }; //+------------------------------------------------------------------------- // // method : TempCommandInOut class constructors // // description : instance constructor // //-------------------------------------------------------------------------- template TemplCommandInOut::TemplCommandInOut(const char *s, OUTARG (DeviceImpl::*f)(INARG)) :exe_ptr_inout(f),ext(Tango_NullPtr) { name = s; allowed_ptr = NULL; init_types(); lower_name = name; transform(lower_name.begin(),lower_name.end(),lower_name.begin(),::tolower); } template TemplCommandInOut::TemplCommandInOut(const char *s, OUTARG (DeviceImpl::*f)(INARG), bool (DeviceImpl::*a)(const CORBA::Any &)) :exe_ptr_inout(f),ext(Tango_NullPtr) { name = s; allowed_ptr = a; init_types(); lower_name = name; transform(lower_name.begin(),lower_name.end(),lower_name.begin(),::tolower); } template TemplCommandInOut::TemplCommandInOut(string &s, OUTARG (DeviceImpl::*f)(INARG)) :exe_ptr_inout(f),ext(Tango_NullPtr) { name = s; allowed_ptr = NULL; init_types(); lower_name = name; transform(lower_name.begin(),lower_name.end(),lower_name.begin(),::tolower); } template TemplCommandInOut::TemplCommandInOut(string &s, OUTARG (DeviceImpl::*f)(INARG), bool (DeviceImpl::*a)(const CORBA::Any &)) :exe_ptr_inout(f),ext(Tango_NullPtr) { name = s; allowed_ptr = a; init_types(); lower_name = name; transform(lower_name.begin(),lower_name.end(),lower_name.begin(),::tolower); } template TemplCommandInOut::TemplCommandInOut(const char *s, OUTARG (DeviceImpl::*f)(INARG), const char *in_desc,const char *out_desc) :exe_ptr_inout(f),ext(Tango_NullPtr) { name = s; if (in_desc != NULL) in_type_desc = in_desc; if (out_desc != NULL) out_type_desc = out_desc; allowed_ptr = NULL; init_types(); lower_name = name; transform(lower_name.begin(),lower_name.end(),lower_name.begin(),::tolower); } template TemplCommandInOut::TemplCommandInOut(const char *s, OUTARG (DeviceImpl::*f)(INARG), bool (DeviceImpl::*a)(const CORBA::Any &), const char *in_desc,const char *out_desc) :exe_ptr_inout(f),ext(Tango_NullPtr) { name = s; allowed_ptr = a; if (in_desc != NULL) in_type_desc = in_desc; if (out_desc != NULL) out_type_desc = out_desc; lower_name = name; transform(lower_name.begin(),lower_name.end(),lower_name.begin(),::tolower); } template TemplCommandInOut::TemplCommandInOut(string &s, OUTARG (DeviceImpl::*f)(INARG), string &in_desc,string &out_desc) :exe_ptr_inout(f),ext(Tango_NullPtr) { name = s; in_type_desc = in_desc; out_type_desc = out_desc; allowed_ptr = NULL; lower_name = name; transform(lower_name.begin(),lower_name.end(),lower_name.begin(),::tolower); } template TemplCommandInOut::TemplCommandInOut(string &s, OUTARG (DeviceImpl::*f)(INARG), bool (DeviceImpl::*a)(const CORBA::Any &), string &in_desc,string &out_desc) :exe_ptr_inout(f),ext(Tango_NullPtr) { name = s; allowed_ptr = a; in_type_desc = in_desc; out_type_desc = out_desc; lower_name = name; transform(lower_name.begin(),lower_name.end(),lower_name.begin(),::tolower); } template TemplCommandInOut::TemplCommandInOut(const char *s, OUTARG (DeviceImpl::*f)(INARG), Tango::DispLevel level) :exe_ptr_inout(f),ext(Tango_NullPtr) { name = s; allowed_ptr = NULL; init_types(); set_disp_level(level); lower_name = name; transform(lower_name.begin(),lower_name.end(),lower_name.begin(),::tolower); } template TemplCommandInOut::TemplCommandInOut(const char *s, OUTARG (DeviceImpl::*f)(INARG), bool (DeviceImpl::*a)(const CORBA::Any &), Tango::DispLevel level) :exe_ptr_inout(f),ext(Tango_NullPtr) { name = s; allowed_ptr = a; init_types(); set_disp_level(level); lower_name = name; transform(lower_name.begin(),lower_name.end(),lower_name.begin(),::tolower); } template TemplCommandInOut::TemplCommandInOut(string &s, OUTARG (DeviceImpl::*f)(INARG), Tango::DispLevel level) :exe_ptr_inout(f),ext(Tango_NullPtr) { name = s; allowed_ptr = NULL; init_types(); set_disp_level(level); lower_name = name; transform(lower_name.begin(),lower_name.end(),lower_name.begin(),::tolower); } template TemplCommandInOut::TemplCommandInOut(string &s, OUTARG (DeviceImpl::*f)(INARG), bool (DeviceImpl::*a)(const CORBA::Any &), Tango::DispLevel level) :exe_ptr_inout(f),ext(Tango_NullPtr) { name = s; allowed_ptr = a; init_types(); set_disp_level(level); lower_name = name; transform(lower_name.begin(),lower_name.end(),lower_name.begin(),::tolower); } template TemplCommandInOut::TemplCommandInOut(const char *s, OUTARG (DeviceImpl::*f)(INARG), const char *in_desc,const char *out_desc, Tango::DispLevel level) :exe_ptr_inout(f),ext(Tango_NullPtr) { name = s; if (in_desc != NULL) in_type_desc = in_desc; if (out_desc != NULL) out_type_desc = out_desc; allowed_ptr = NULL; init_types(); set_disp_level(level); lower_name = name; transform(lower_name.begin(),lower_name.end(),lower_name.begin(),::tolower); } template TemplCommandInOut::TemplCommandInOut(const char *s, OUTARG (DeviceImpl::*f)(INARG), bool (DeviceImpl::*a)(const CORBA::Any &), const char *in_desc,const char *out_desc, Tango::DispLevel level) :exe_ptr_inout(f),ext(Tango_NullPtr) { name = s; allowed_ptr = a; if (in_desc != NULL) in_type_desc = in_desc; if (out_desc != NULL) out_type_desc = out_desc; set_disp_level(level); lower_name = name; transform(lower_name.begin(),lower_name.end(),lower_name.begin(),::tolower); } template TemplCommandInOut::TemplCommandInOut(string &s, OUTARG (DeviceImpl::*f)(INARG), string &in_desc,string &out_desc, Tango::DispLevel level) :exe_ptr_inout(f),ext(Tango_NullPtr) { name = s; in_type_desc = in_desc; out_type_desc = out_desc; allowed_ptr = NULL; set_disp_level(level); lower_name = name; transform(lower_name.begin(),lower_name.end(),lower_name.begin(),::tolower); } template TemplCommandInOut::TemplCommandInOut(string &s, OUTARG (DeviceImpl::*f)(INARG), bool (DeviceImpl::*a)(const CORBA::Any &), string &in_desc,string &out_desc, Tango::DispLevel level) :exe_ptr_inout(f),ext(Tango_NullPtr) { name = s; allowed_ptr = a; in_type_desc = in_desc; out_type_desc = out_desc; set_disp_level(level); lower_name = name; transform(lower_name.begin(),lower_name.end(),lower_name.begin(),::tolower); } //+------------------------------------------------------------------------- // // method : init_types // // description : Initialise input and output type from the template // class specialisation parameters. // //-------------------------------------------------------------------------- template void TemplCommandInOut::init_types() { // // Set intput type // set_type(typeid(INARG),in_type); // // Set output type // set_type(typeid(OUTARG),out_type); } //+------------------------------------------------------------------------- // // method : execute // // description : Execute the method associated with the command // (stored in the exe_ptr data) // // input : - dev_ptr : pointer to the device on which the command must be // executed // - in_any : Incoming command data // // This method returns a pointer to an Any object with the command outing // data. // //-------------------------------------------------------------------------- template CORBA::Any *TemplCommandInOut::execute(DeviceImpl *dev_ptr,const CORBA::Any &in_any) { // // Execute the command associated method // INARG in_data; extract(in_any,in_data); OUTARG out_data = (dev_ptr->*exe_ptr_inout)(in_data); return insert(out_data); } //============================================================================= // // The TemplCommandIn class // // // description : This class is a derived class of the Command class. // It is used to create a command from a pointer to a // object method which will execute the command. // This class is for command without inout nor output // paremeters. // This class is also a base class for the template Command // class // //============================================================================= /** * This class is a class representing a command in the template command model * with input parameter but without output parameter. The class template * parameter (called INARG) is the command input parameter type. *

Synopsis : template class TemplCommandIn:public TemplCommand;

*

Usage : new TemplCommandIn(...);

* * $Author: taurel $ * $Revision: 22213 $ * * @headerfile tango.h * @ingroup Server */ template class TemplCommandIn:public TemplCommand { public: /**@name Constructors * Miscellaneous constructors */ //@{ /** * Constructs a newly allocated TemplCommandIn object for a command with a * name and an execution method. * The input and output command data type are automatically determined. * The input and output parameter description are set to the default String * "Uninitialised". * The command display level is set to OPERATOR. * * @param cmd_name The command name * @param exe_method Pointer to the command execution method * */ TemplCommandIn(const char *cmd_name, void (DeviceImpl::*exe_method)(INARG)); /** * Constructs a newly allocated TemplCommandIn object for a command with a * name and an execution method. * The input and output command data type are automatically determined. * The input and output parameter description are set to the default String * "Uninitialised". * The command display level is set to OPERATOR. * * @param cmd_name The command name * @param exe_method Pointer to the command execution method * */ TemplCommandIn(string &cmd_name, void (DeviceImpl::*exe_method)(INARG)); /** * Constructs a newly allocated TemplCommandIn object for a command with a * name, an execution method and a command allowed method. * The input and output command data type are automatically determined. * The input and output parameter description are set to the default String * "Uninitialised". * The command display level is set to OPERATOR. * * @param cmd_name The command name * @param exe_method Pointer to the command execution method * @param state_method Pointer to the command allowed method * */ TemplCommandIn(const char *cmd_name, void (DeviceImpl::*exe_method)(INARG), bool (DeviceImpl::*state_method)(const CORBA::Any &)); /** * Constructs a newly allocated TemplCommandIn object for a command with a * name, an execution method and a command allowed method. * The input and output command data type are automatically determined. * The input and output parameter description are set to the default String * "Uninitialised". * The command display level is set to OPERATOR. * * @param cmd_name The command name * @param exe_method Pointer to the command execution method * @param state_method Pointer to the command allowed method * */ TemplCommandIn(string &cmd_name, void (DeviceImpl::*exe_method)(INARG), bool (DeviceImpl::*state_method)(const CORBA::Any &)); /** * Constructs a newly allocated TemplCommandIn object for a command with a * name, an execution method and a description for the * input and output command parameters. * The input and output command data type are automatically determined. * The command display level is set to OPERATOR. * * @param cmd_name The command name * @param exe_method Pointer to the command execution method * @param in_desc The command input parameter description * @param out_desc The command output parameter description * */ TemplCommandIn(const char *cmd_name, void (DeviceImpl::*exe_method)(INARG), const char *in_desc,const char *out_desc); /** * Constructs a newly allocated TemplCommandIn object for a command with a * name, an execution method and a description for the * input and output command parameters. * The input and output command data type are automatically determined. * The command display level is set to OPERATOR. * * @param cmd_name The command name * @param exe_method Pointer to the command execution method * @param in_desc The command input parameter description * @param out_desc The command output parameter description * */ TemplCommandIn(string &cmd_name, void (DeviceImpl::*exe_method)(INARG), string &in_desc,string &out_desc); /** * Constructs a newly allocated TemplCommandIn object for a command with a * name, an execution method, a command allowed method and a description for the * input and output command parameters. * The input and output command data type are automatically determined. * The command display level is set to OPERATOR. * * @param cmd_name The command name * @param exe_method Pointer to the command execution method * @param state_method Pointer to the command allowed method * @param in_desc The command input parameter description * @param out_desc The command output parameter description * */ TemplCommandIn(const char *cmd_name, void (DeviceImpl::*exe_method)(INARG), bool (DeviceImpl::*state_method)(const CORBA::Any &), const char *in_desc,const char *out_desc); /** * Constructs a newly allocated TemplCommandIn object for a command with a * name, an execution method, a command allowed method and a description for the * input and output command parameters. * The input and output command data type are automatically determined. * The command display level is set to OPERATOR. * * @param cmd_name The command name * @param exe_method Pointer to the command execution method * @param state_method Pointer to the command allowed method * @param in_desc The command input parameter description * @param out_desc The command output parameter description * */ TemplCommandIn(string &cmd_name, void (DeviceImpl::*exe_method)(INARG), bool (DeviceImpl::*state_method)(const CORBA::Any &), string &in_desc,string &out_desc); /** * Constructs a newly allocated TemplCommandIn object for a command with a * name and an execution method. * The input and output command data type are automatically determined. * The input and output parameter description are set to the default String * "Uninitialised". * * @param cmd_name The command name * @param exe_method Pointer to the command execution method * @param level The command display level * */ TemplCommandIn(const char *cmd_name, void (DeviceImpl::*exe_method)(INARG), Tango::DispLevel level); /** * Constructs a newly allocated TemplCommandIn object for a command with a * name and an execution method. * The input and output command data type are automatically determined. * The input and output parameter description are set to the default String * "Uninitialised". * * @param cmd_name The command name * @param exe_method Pointer to the command execution method * @param level The command display level * */ TemplCommandIn(string &cmd_name, void (DeviceImpl::*exe_method)(INARG), Tango::DispLevel level); /** * Constructs a newly allocated TemplCommandIn object for a command with a * name, an execution method and a command allowed method. * The input and output command data type are automatically determined. * The input and output parameter description are set to the default String * "Uninitialised". * * @param cmd_name The command name * @param exe_method Pointer to the command execution method * @param state_method Pointer to the command allowed method * @param level The command display level * */ TemplCommandIn(const char *cmd_name, void (DeviceImpl::*exe_method)(INARG), bool (DeviceImpl::*state_method)(const CORBA::Any &), Tango::DispLevel level); /** * Constructs a newly allocated TemplCommandIn object for a command with a * name, an execution method and a command allowed method. * The input and output command data type are automatically determined. * The input and output parameter description are set to the default String * "Uninitialised". * * @param cmd_name The command name * @param exe_method Pointer to the command execution method * @param state_method Pointer to the command allowed method * @param level The command display level * */ TemplCommandIn(string &cmd_name, void (DeviceImpl::*exe_method)(INARG), bool (DeviceImpl::*state_method)(const CORBA::Any &), Tango::DispLevel level); /** * Constructs a newly allocated TemplCommandIn object for a command with a * name, an execution method and a description for the * input and output command parameters. * The input and output command data type are automatically determined. * * @param cmd_name The command name * @param exe_method Pointer to the command execution method * @param in_desc The command input parameter description * @param out_desc The command output parameter description * @param level The command display level * */ TemplCommandIn(const char *cmd_name, void (DeviceImpl::*exe_method)(INARG), const char *in_desc,const char *out_desc, Tango::DispLevel level); /** * Constructs a newly allocated TemplCommandIn object for a command with a * name, an execution method and a description for the * input and output command parameters. * The input and output command data type are automatically determined. * * @param cmd_name The command name * @param exe_method Pointer to the command execution method * @param in_desc The command input parameter description * @param out_desc The command output parameter description * @param level The command display level * */ TemplCommandIn(string &cmd_name, void (DeviceImpl::*exe_method)(INARG), string &in_desc,string &out_desc, Tango::DispLevel level); /** * Constructs a newly allocated TemplCommandIn object for a command with a * name, an execution method, a command allowed method and a description for the * input and output command parameters. * The input and output command data type are automatically determined. * * @param cmd_name The command name * @param exe_method Pointer to the command execution method * @param state_method Pointer to the command allowed method * @param in_desc The command input parameter description * @param out_desc The command output parameter description * @param level The command display level * */ TemplCommandIn(const char *cmd_name, void (DeviceImpl::*exe_method)(INARG), bool (DeviceImpl::*state_method)(const CORBA::Any &), const char *in_desc,const char *out_desc, Tango::DispLevel level); /** * Constructs a newly allocated TemplCommandIn object for a command with a * name, an execution method, a command allowed method and a description for the * input and output command parameters. * The input and output command data type are automatically determined. * * @param cmd_name The command name * @param exe_method Pointer to the command execution method * @param state_method Pointer to the command allowed method * @param in_desc The command input parameter description * @param out_desc The command output parameter description * @param level The command display level * */ TemplCommandIn(string &cmd_name, void (DeviceImpl::*exe_method)(INARG), bool (DeviceImpl::*state_method)(const CORBA::Any &), string &in_desc,string &out_desc, Tango::DispLevel level); //@} ~TemplCommandIn() {} /**@name Miscellaneous methods */ //@{ /** * Initialise command input and output types. * * Set the command output type to Tango::DEV_VOID. The command input type is * automatically determined from the class template specialisation * */ void init_types(); /** * Invoke the command execution method given at object creation time. * * This method is automtically called by the TANGO core classes when the * associated command is requested by a client. It unpacks the data stored in * the CORBA Any object and invoke the user supplied command execution * method * * @param dev The device on which the command must be executed * @param in_any The incoming data still packed in a CORBA Any object. * @return The CORBA Any object returned to the client. For command created with * this TemplCommandIn class, this any object does not contain data. * @exception DevFailed If the execution method failed * Click here to read * DevFailed exception specification */ CORBA::Any *execute (DeviceImpl *dev, const CORBA::Any &in_any); //@} private: class TemplCommandInExt { }; void (DeviceImpl::*exe_ptr_in)(INARG); #ifdef HAS_UNIQUE_PTR unique_ptr ext; // Class extension #else TemplCommandInExt *ext; #endif }; //+------------------------------------------------------------------------- // // method : TempCommandIn class constructors // // description : instance constructor // //-------------------------------------------------------------------------- template TemplCommandIn::TemplCommandIn(const char *s, void (DeviceImpl::*f)(INARG)) :exe_ptr_in(f),ext(Tango_NullPtr) { name = s; allowed_ptr = NULL; init_types(); lower_name = name; transform(lower_name.begin(),lower_name.end(),lower_name.begin(),::tolower); } template TemplCommandIn::TemplCommandIn(const char *s, void (DeviceImpl::*f)(INARG), bool (DeviceImpl::*a)(const CORBA::Any &)) :exe_ptr_in(f),ext(Tango_NullPtr) { name = s; allowed_ptr = a; init_types(); lower_name = name; transform(lower_name.begin(),lower_name.end(),lower_name.begin(),::tolower); } template TemplCommandIn::TemplCommandIn(string &s, void (DeviceImpl::*f)(INARG)) :exe_ptr_in(f),ext(Tango_NullPtr) { name = s; allowed_ptr = NULL; init_types(); lower_name = name; transform(lower_name.begin(),lower_name.end(),lower_name.begin(),::tolower); } template TemplCommandIn::TemplCommandIn(string &s, void (DeviceImpl::*f)(INARG), bool (DeviceImpl::*a)(const CORBA::Any &)) :exe_ptr_in(f),ext(Tango_NullPtr) { name = s; allowed_ptr = a; init_types(); lower_name = name; transform(lower_name.begin(),lower_name.end(),lower_name.begin(),::tolower); } template TemplCommandIn::TemplCommandIn(const char *s, void (DeviceImpl::*f)(INARG), const char *in_desc,const char *out_desc) :exe_ptr_in(f),ext(Tango_NullPtr) { name = s; if (in_desc != NULL) in_type_desc = in_desc; if (out_desc != NULL) out_type_desc = out_desc; allowed_ptr = NULL; init_types(); lower_name = name; transform(lower_name.begin(),lower_name.end(),lower_name.begin(),::tolower); } template TemplCommandIn::TemplCommandIn(const char *s, void (DeviceImpl::*f)(INARG), bool (DeviceImpl::*a)(const CORBA::Any &), const char *in_desc,const char *out_desc) :exe_ptr_in(f),ext(Tango_NullPtr) { name = s; allowed_ptr = a; if (in_desc != NULL) in_type_desc = in_desc; if (out_desc != NULL) out_type_desc = out_desc; lower_name = name; transform(lower_name.begin(),lower_name.end(),lower_name.begin(),::tolower); } template TemplCommandIn::TemplCommandIn(string &s, void (DeviceImpl::*f)(INARG), string &in_desc,string &out_desc) :exe_ptr_in(f),ext(Tango_NullPtr) { name = s; in_type_desc = in_desc; out_type_desc = out_desc; allowed_ptr = NULL; lower_name = name; transform(lower_name.begin(),lower_name.end(),lower_name.begin(),::tolower); } template TemplCommandIn::TemplCommandIn(string &s, void (DeviceImpl::*f)(INARG), bool (DeviceImpl::*a)(const CORBA::Any &), string &in_desc,string &out_desc) :exe_ptr_in(f),ext(Tango_NullPtr) { name = s; allowed_ptr = a; in_type_desc = in_desc; out_type_desc = out_desc; lower_name = name; transform(lower_name.begin(),lower_name.end(),lower_name.begin(),::tolower); } template TemplCommandIn::TemplCommandIn(const char *s, void (DeviceImpl::*f)(INARG), Tango::DispLevel level) :exe_ptr_in(f),ext(Tango_NullPtr) { name = s; allowed_ptr = NULL; init_types(); set_disp_level(level); lower_name = name; transform(lower_name.begin(),lower_name.end(),lower_name.begin(),::tolower); } template TemplCommandIn::TemplCommandIn(const char *s, void (DeviceImpl::*f)(INARG), bool (DeviceImpl::*a)(const CORBA::Any &), Tango::DispLevel level) :exe_ptr_in(f),ext(Tango_NullPtr) { name = s; allowed_ptr = a; init_types(); set_disp_level(level); lower_name = name; transform(lower_name.begin(),lower_name.end(),lower_name.begin(),::tolower); } template TemplCommandIn::TemplCommandIn(string &s, void (DeviceImpl::*f)(INARG), Tango::DispLevel level) :exe_ptr_in(f),ext(Tango_NullPtr) { name = s; allowed_ptr = NULL; init_types(); set_disp_level(level); lower_name = name; transform(lower_name.begin(),lower_name.end(),lower_name.begin(),::tolower); } template TemplCommandIn::TemplCommandIn(string &s, void (DeviceImpl::*f)(INARG), bool (DeviceImpl::*a)(const CORBA::Any &), Tango::DispLevel level) :exe_ptr_in(f),ext(Tango_NullPtr) { name = s; allowed_ptr = a; init_types(); set_disp_level(level); lower_name = name; transform(lower_name.begin(),lower_name.end(),lower_name.begin(),::tolower); } template TemplCommandIn::TemplCommandIn(const char *s, void (DeviceImpl::*f)(INARG), const char *in_desc,const char *out_desc, Tango::DispLevel level) :exe_ptr_in(f),ext(Tango_NullPtr) { name = s; if (in_desc != NULL) in_type_desc = in_desc; if (out_desc != NULL) out_type_desc = out_desc; allowed_ptr = NULL; init_types(); set_disp_level(level); lower_name = name; transform(lower_name.begin(),lower_name.end(),lower_name.begin(),::tolower); } template TemplCommandIn::TemplCommandIn(const char *s, void (DeviceImpl::*f)(INARG), bool (DeviceImpl::*a)(const CORBA::Any &), const char *in_desc,const char *out_desc, Tango::DispLevel level) :exe_ptr_in(f),ext(Tango_NullPtr) { name = s; allowed_ptr = a; if (in_desc != NULL) in_type_desc = in_desc; if (out_desc != NULL) out_type_desc = out_desc; set_disp_level(level); lower_name = name; transform(lower_name.begin(),lower_name.end(),lower_name.begin(),::tolower); } template TemplCommandIn::TemplCommandIn(string &s, void (DeviceImpl::*f)(INARG), string &in_desc,string &out_desc, Tango::DispLevel level) :exe_ptr_in(f),ext(Tango_NullPtr) { name = s; in_type_desc = in_desc; out_type_desc = out_desc; allowed_ptr = NULL; set_disp_level(level); lower_name = name; transform(lower_name.begin(),lower_name.end(),lower_name.begin(),::tolower); } template TemplCommandIn::TemplCommandIn(string &s, void (DeviceImpl::*f)(INARG), bool (DeviceImpl::*a)(const CORBA::Any &), string &in_desc,string &out_desc, Tango::DispLevel level) :exe_ptr_in(f),ext(Tango_NullPtr) { name = s; allowed_ptr = a; in_type_desc = in_desc; out_type_desc = out_desc; set_disp_level(level); lower_name = name; transform(lower_name.begin(),lower_name.end(),lower_name.begin(),::tolower); } //+------------------------------------------------------------------------- // // method : init_types // // description : Initialise input and output type from the template // class specialisation parameters. // //-------------------------------------------------------------------------- template void TemplCommandIn::init_types() { out_type = Tango::DEV_VOID; // // Set intput type // set_type(typeid(INARG),in_type); } //+------------------------------------------------------------------------- // // method : execute // // description : Execute the method associated with the command // (stored in the exe_ptr data) // // input : - dev_ptr : pointer to the device on which the command must be // executed // - in_any : Incoming command data // // This method returns a pointer to an Any object with the command outing // data. // //-------------------------------------------------------------------------- template CORBA::Any *TemplCommandIn::execute(DeviceImpl *dev_ptr,const CORBA::Any &in_any) { // // Execute the command associated method // INARG in_data; extract(in_any,in_data); (dev_ptr->*exe_ptr_in)(in_data); return insert(); } //============================================================================= // // The TemplCommandOut class // // // description : This class is a derived class of the Command class. // It is used to create a command from a pointer to a // object method which will execute the command. // This class is for command without inout nor output // paremeters. // This class is also a base class for the template Command // class // //============================================================================= /** * This class is a class representing a command in the template command model * with output parameter but without input parameter. The class template * parameter (called OUTARG) is the command output parameter type. *

Synopsis : template class TemplCommandOut:public TemplCommand;

*

Usage : new TemplCommandOut(...);

* * $Author: taurel $ * $Revision: 22213 $ * * @headerfile tango.h * @ingroup Server */ template class TemplCommandOut:public TemplCommand { public: /**@name Constructors * Miscellaneous constructors */ //@{ /** * Constructs a newly allocated TemplCommandOut object for a command with a * name and an execution method. * The input and output command data type are automatically determined. * The input and output parameter description are set to the default String * "Uninitialised". * The command display level is set to OPERATOR. * * @param cmd_name The command name * @param exe_method Pointer to the command execution method * */ TemplCommandOut(const char *cmd_name,OUTARG (DeviceImpl::*exe_method)()); /** * Constructs a newly allocated TemplCommandOut object for a command with a * name and an execution method. * The input and output command data type are automatically determined. * The input and output parameter description are set to the default String * "Uninitialised". * The command display level is set to OPERATOR. * * @param cmd_name The command name * @param exe_method Pointer to the command execution method * */ TemplCommandOut(string &cmd_name,OUTARG (DeviceImpl::*exe_method)()); /** * Constructs a newly allocated TemplCommandOut object for a command with a * name, an execution method and a command allowed method. * The input and output command data type are automatically determined. * The input and output parameter description are set to the default String * "Uninitialised". * The command display level is set to OPERATOR. * * @param cmd_name The command name * @param exe_method Pointer to the command execution method * @param state_method Pointer to the command allowed method * */ TemplCommandOut(const char *cmd_name,OUTARG (DeviceImpl::*exe_method)(), bool (DeviceImpl::*state_method)(const CORBA::Any &)); /** * Constructs a newly allocated TemplCommandOut object for a command with a * name, an execution method and a command allowed method. * The input and output command data type are automatically determined. * The input and output parameter description are set to the default String * "Uninitialised". * The command display level is set to OPERATOR. * * @param cmd_name The command name * @param exe_method Pointer to the command execution method * @param state_method Pointer to the command allowed method * */ TemplCommandOut(string &cmd_name,OUTARG (DeviceImpl::*exe_method)(), bool (DeviceImpl::*state_method)(const CORBA::Any &)); /** * Constructs a newly allocated TemplCommandOut object for a command with a * name, an execution method and a description for the * input and output command parameters. * The input and output command data type are automatically determined. * The command display level is set to OPERATOR. * * @param cmd_name The command name * @param exe_method Pointer to the command execution method * @param in_desc The command input parameter description * @param out_desc The command output parameter description * */ TemplCommandOut(const char *cmd_name,OUTARG (DeviceImpl::*exe_method)(), const char *in_desc,const char *out_desc); /** * Constructs a newly allocated TemplCommandOut object for a command with a * name, an execution method and a description for the * input and output command parameters. * The input and output command data type are automatically determined. * The command display level is set to OPERATOR. * * @param cmd_name The command name * @param exe_method Pointer to the command execution method * @param in_desc The command input parameter description * @param out_desc The command output parameter description * */ TemplCommandOut(string &cmd_name,OUTARG (DeviceImpl::*exe_method)(), string &in_desc,string &out_desc); /** * Constructs a newly allocated TemplCommandOut object for a command with a * name, an execution method, a command allowed method and a description for the * input and output command parameters. * The input and output command data type are automatically determined. * The command display level is set to OPERATOR. * * @param cmd_name The command name * @param exe_method Pointer to the command execution method * @param state_method Pointer to the command allowed method * @param in_desc The command input parameter description * @param out_desc The command output parameter description * */ TemplCommandOut(const char *cmd_name,OUTARG (DeviceImpl::*exe_method)(), bool (DeviceImpl::*state_method)(const CORBA::Any &), const char *in_desc,const char *out_desc); /** * Constructs a newly allocated TemplCommandIn object for a command with a * name, an execution method, a command allowed method and a description for the * input and output command parameters. * The input and output command data type are automatically determined. * The command display level is set to OPERATOR. * * @param cmd_name The command name * @param exe_method Pointer to the command execution method * @param state_method Pointer to the command allowed method * @param in_desc The command input parameter description * @param out_desc The command output parameter description * */ TemplCommandOut(string &cmd_name,OUTARG (DeviceImpl::*exe_method)(), bool (DeviceImpl::*state_method)(const CORBA::Any &), string &in_desc,string &out_desc); /** * Constructs a newly allocated TemplCommandOut object for a command with a * name and an execution method. * The input and output command data type are automatically determined. * The input and output parameter description are set to the default String * "Uninitialised". * * @param cmd_name The command name * @param exe_method Pointer to the command execution method * @param level The command display level * */ TemplCommandOut(const char *cmd_name,OUTARG (DeviceImpl::*exe_method)(), Tango::DispLevel level); /** * Constructs a newly allocated TemplCommandOut object for a command with a * name and an execution method. * The input and output command data type are automatically determined. * The input and output parameter description are set to the default String * "Uninitialised". * * @param cmd_name The command name * @param exe_method Pointer to the command execution method * @param level The command display level * */ TemplCommandOut(string &cmd_name,OUTARG (DeviceImpl::*exe_method)(), Tango::DispLevel level); /** * Constructs a newly allocated TemplCommandOut object for a command with a * name, an execution method and a command allowed method. * The input and output command data type are automatically determined. * The input and output parameter description are set to the default String * "Uninitialised". * * @param cmd_name The command name * @param exe_method Pointer to the command execution method * @param state_method Pointer to the command allowed method * @param level The command display level * */ TemplCommandOut(const char *cmd_name,OUTARG (DeviceImpl::*exe_method)(), bool (DeviceImpl::*state_method)(const CORBA::Any &), Tango::DispLevel level); /** * Constructs a newly allocated TemplCommandOut object for a command with a * name, an execution method and a command allowed method. * The input and output command data type are automatically determined. * The input and output parameter description are set to the default String * "Uninitialised". * * @param cmd_name The command name * @param exe_method Pointer to the command execution method * @param state_method Pointer to the command allowed method * @param level The command display level * */ TemplCommandOut(string &cmd_name,OUTARG (DeviceImpl::*exe_method)(), bool (DeviceImpl::*state_method)(const CORBA::Any &), Tango::DispLevel level); /** * Constructs a newly allocated TemplCommandOut object for a command with a * name, an execution method and a description for the * input and output command parameters. * The input and output command data type are automatically determined. * * @param cmd_name The command name * @param exe_method Pointer to the command execution method * @param in_desc The command input parameter description * @param out_desc The command output parameter description * @param level The command display level * */ TemplCommandOut(const char *cmd_name,OUTARG (DeviceImpl::*exe_method)(), const char *in_desc,const char *out_desc, Tango::DispLevel level); /** * Constructs a newly allocated TemplCommandOut object for a command with a * name, an execution method and a description for the * input and output command parameters. * The input and output command data type are automatically determined. * * @param cmd_name The command name * @param exe_method Pointer to the command execution method * @param in_desc The command input parameter description * @param out_desc The command output parameter description * @param level The command display level * */ TemplCommandOut(string &cmd_name,OUTARG (DeviceImpl::*exe_method)(), string &in_desc,string &out_desc, Tango::DispLevel level); /** * Constructs a newly allocated TemplCommandOut object for a command with a * name, an execution method, a command allowed method and a description for the * input and output command parameters. * The input and output command data type are automatically determined. * * @param cmd_name The command name * @param exe_method Pointer to the command execution method * @param state_method Pointer to the command allowed method * @param in_desc The command input parameter description * @param out_desc The command output parameter description * @param level The command display level * */ TemplCommandOut(const char *cmd_name,OUTARG (DeviceImpl::*exe_method)(), bool (DeviceImpl::*state_method)(const CORBA::Any &), const char *in_desc,const char *out_desc, Tango::DispLevel level); /** * Constructs a newly allocated TemplCommandIn object for a command with a * name, an execution method, a command allowed method and a description for the * input and output command parameters. * The input and output command data type are automatically determined. * * @param cmd_name The command name * @param exe_method Pointer to the command execution method * @param state_method Pointer to the command allowed method * @param in_desc The command input parameter description * @param out_desc The command output parameter description * @param level The command display level * */ TemplCommandOut(string &cmd_name,OUTARG (DeviceImpl::*exe_method)(), bool (DeviceImpl::*state_method)(const CORBA::Any &), string &in_desc,string &out_desc, Tango::DispLevel level); //@} ~TemplCommandOut() {} /**@name Miscellaneous methods */ //@{ /** * Initialise command input and output types. * * Set the command output type to Tango::DEV_VOID. The command input type is * automatically determined from the class template specialisation * */ void init_types(); /** * Invoke the command execution method given at object creation time. * * This method is automtically called by the TANGO core classes when the * associated command is requested by a client. It invokes the user supplied * command execution method and packs the returned data into the outgoing * CORBA Any object * * @param dev The device on which the command must be executed * @param in_any The incoming data still packed in a CORBA Any object. For * command created with this TemplCommandOut class, this Any object does not * contain usefull data * @return The CORBA Any object returned to the client. * @exception DevFailed If the execution method failed * Click here to read * DevFailed exception specification */ CORBA::Any *execute (DeviceImpl *dev, const CORBA::Any &in_any); //@} private: class TemplCommandOutExt { }; OUTARG (DeviceImpl::*exe_ptr_out)(); #ifdef HAS_UNIQUE_PTR unique_ptr ext; // Class extension #else TemplCommandOutExt *ext; #endif }; //+------------------------------------------------------------------------- // // method : TempCommandOut class constructors // // description : instance constructor // //-------------------------------------------------------------------------- template TemplCommandOut::TemplCommandOut(const char *s, OUTARG (DeviceImpl::*f)()) :exe_ptr_out(f),ext(Tango_NullPtr) { name = s; allowed_ptr = NULL; init_types(); lower_name = name; transform(lower_name.begin(),lower_name.end(),lower_name.begin(),::tolower); } template TemplCommandOut::TemplCommandOut(const char *s, OUTARG (DeviceImpl::*f)(), bool (DeviceImpl::*a)(const CORBA::Any &)) :exe_ptr_out(f),ext(Tango_NullPtr) { name = s; allowed_ptr = a; init_types(); lower_name = name; transform(lower_name.begin(),lower_name.end(),lower_name.begin(),::tolower); } template TemplCommandOut::TemplCommandOut(string &s, OUTARG (DeviceImpl::*f)()) :exe_ptr_out(f),ext(Tango_NullPtr) { name = s; allowed_ptr = NULL; init_types(); lower_name = name; transform(lower_name.begin(),lower_name.end(),lower_name.begin(),::tolower); } template TemplCommandOut::TemplCommandOut(string &s, OUTARG (DeviceImpl::*f)(), bool (DeviceImpl::*a)(const CORBA::Any &)) :exe_ptr_out(f),ext(Tango_NullPtr) { name = s; allowed_ptr = a; init_types(); lower_name = name; transform(lower_name.begin(),lower_name.end(),lower_name.begin(),::tolower); } template TemplCommandOut::TemplCommandOut(const char *s, OUTARG (DeviceImpl::*f)(), const char *in_desc,const char *out_desc) :exe_ptr_out(f),ext(Tango_NullPtr) { name = s; if (in_desc != NULL) in_type_desc = in_desc; if (out_desc != NULL) out_type_desc = out_desc; allowed_ptr = NULL; init_types(); lower_name = name; transform(lower_name.begin(),lower_name.end(),lower_name.begin(),::tolower); } template TemplCommandOut::TemplCommandOut(const char *s, OUTARG (DeviceImpl::*f)(), bool (DeviceImpl::*a)(const CORBA::Any &), const char *in_desc,const char *out_desc) :exe_ptr_out(f),ext(Tango_NullPtr) { name = s; allowed_ptr = a; if (in_desc != NULL) in_type_desc = in_desc; if (out_desc != NULL) out_type_desc = out_desc; lower_name = name; transform(lower_name.begin(),lower_name.end(),lower_name.begin(),::tolower); } template TemplCommandOut::TemplCommandOut(string &s, OUTARG (DeviceImpl::*f)(), string &in_desc,string &out_desc) :exe_ptr_out(f),ext(Tango_NullPtr) { name = s; in_type_desc = in_desc; out_type_desc = out_desc; allowed_ptr = NULL; lower_name = name; transform(lower_name.begin(),lower_name.end(),lower_name.begin(),::tolower); } template TemplCommandOut::TemplCommandOut(string &s, OUTARG (DeviceImpl::*f)(), bool (DeviceImpl::*a)(const CORBA::Any &), string &in_desc,string &out_desc) :exe_ptr_out(f),ext(Tango_NullPtr) { name = s; allowed_ptr = a; in_type_desc = in_desc; out_type_desc = out_desc; lower_name = name; transform(lower_name.begin(),lower_name.end(),lower_name.begin(),::tolower); } template TemplCommandOut::TemplCommandOut(const char *s, OUTARG (DeviceImpl::*f)(), Tango::DispLevel level) :exe_ptr_out(f),ext(Tango_NullPtr) { name = s; allowed_ptr = NULL; init_types(); set_disp_level(level); lower_name = name; transform(lower_name.begin(),lower_name.end(),lower_name.begin(),::tolower); } template TemplCommandOut::TemplCommandOut(const char *s, OUTARG (DeviceImpl::*f)(), bool (DeviceImpl::*a)(const CORBA::Any &), Tango::DispLevel level) :exe_ptr_out(f),ext(Tango_NullPtr) { name = s; allowed_ptr = a; init_types(); set_disp_level(level); lower_name = name; transform(lower_name.begin(),lower_name.end(),lower_name.begin(),::tolower); } template TemplCommandOut::TemplCommandOut(string &s, OUTARG (DeviceImpl::*f)(), Tango::DispLevel level) :exe_ptr_out(f),ext(Tango_NullPtr) { name = s; allowed_ptr = NULL; init_types(); set_disp_level(level); lower_name = name; transform(lower_name.begin(),lower_name.end(),lower_name.begin(),::tolower); } template TemplCommandOut::TemplCommandOut(string &s, OUTARG (DeviceImpl::*f)(), bool (DeviceImpl::*a)(const CORBA::Any &), Tango::DispLevel level) :exe_ptr_out(f),ext(Tango_NullPtr) { name = s; allowed_ptr = a; init_types(); set_disp_level(level); lower_name = name; transform(lower_name.begin(),lower_name.end(),lower_name.begin(),::tolower); } template TemplCommandOut::TemplCommandOut(const char *s, OUTARG (DeviceImpl::*f)(), const char *in_desc,const char *out_desc, Tango::DispLevel level) :exe_ptr_out(f),ext(Tango_NullPtr) { name = s; if (in_desc != NULL) in_type_desc = in_desc; if (out_desc != NULL) out_type_desc = out_desc; allowed_ptr = NULL; init_types(); set_disp_level(level); lower_name = name; transform(lower_name.begin(),lower_name.end(),lower_name.begin(),::tolower); } template TemplCommandOut::TemplCommandOut(const char *s, OUTARG (DeviceImpl::*f)(), bool (DeviceImpl::*a)(const CORBA::Any &), const char *in_desc,const char *out_desc, Tango::DispLevel level) :exe_ptr_out(f),ext(Tango_NullPtr) { name = s; allowed_ptr = a; if (in_desc != NULL) in_type_desc = in_desc; if (out_desc != NULL) out_type_desc = out_desc; set_disp_level(level); lower_name = name; transform(lower_name.begin(),lower_name.end(),lower_name.begin(),::tolower); } template TemplCommandOut::TemplCommandOut(string &s, OUTARG (DeviceImpl::*f)(), string &in_desc,string &out_desc, Tango::DispLevel level) :exe_ptr_out(f),ext(Tango_NullPtr) { name = s; in_type_desc = in_desc; out_type_desc = out_desc; allowed_ptr = NULL; set_disp_level(level); lower_name = name; transform(lower_name.begin(),lower_name.end(),lower_name.begin(),::tolower); } template TemplCommandOut::TemplCommandOut(string &s, OUTARG (DeviceImpl::*f)(), bool (DeviceImpl::*a)(const CORBA::Any &), string &in_desc,string &out_desc, Tango::DispLevel level) :exe_ptr_out(f),ext(Tango_NullPtr) { name = s; allowed_ptr = a; in_type_desc = in_desc; out_type_desc = out_desc; set_disp_level(level); lower_name = name; transform(lower_name.begin(),lower_name.end(),lower_name.begin(),::tolower); } //+------------------------------------------------------------------------- // // method : init_types // // description : Initialise input and output type from the template // class specialisation parameters. // //-------------------------------------------------------------------------- template void TemplCommandOut::init_types() { in_type = Tango::DEV_VOID; // // Set output type // set_type(typeid(OUTARG),out_type); } //+------------------------------------------------------------------------- // // method : execute // // description : Execute the method associated with the command // (stored in the exe_ptr data) // // input : - dev_ptr : pointer to the device on which the command must be // executed // - in_any : Incoming command data // // This method returns a pointer to an Any object with the command outing // data. // //-------------------------------------------------------------------------- template CORBA::Any *TemplCommandOut::execute(DeviceImpl *dev_ptr,const CORBA::Any &in_any) { // // Execute the command associated method // return insert((dev_ptr->*exe_ptr_out)()); } } // End of Tango namespace #endif // _COMMAND_H tango-8.1.2c+dfsg.orig/lib/cpp/server/auto_tango_monitor.h0000644000175000017500000000762412205375142022523 0ustar piccapicca//===================================================================================================================== // // file : auto_tango_monitor.h // // description : Include file for two utility classes related to monitor // // project : TANGO // // author(s) : E.Taurel // // Copyright (C) : 2004,2005,2006,2007,2008,2009,2010,2011,2012,2013 // European Synchrotron Radiation Facility // BP 220, Grenoble 38043 // FRANCE // // This file is part of Tango. // // Tango 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. // // Tango 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 Tango. // If not, see . // // $Revision: 22213 $ // //==================================================================================================================== #ifndef _AUTO_TANGO_MONITOR_H #define _AUTO_TANGO_MONITOR_H namespace Tango { //------------------------------------------------------------------------------------------------------------------- // // class : // AutoTangoMonitor // // description : // This class is only a helper class used to get a TangoMonitor object during its construction and to // it during its destruction. It makes developer life easier. // //------------------------------------------------------------------------------------------------------------------- class AutoTangoMonitor { public: AutoTangoMonitor(Tango::DeviceImpl *dev, bool force = false) { SerialModel ser = Util::instance()->get_serial_model(); switch(ser) { case NO_SYNC: if (force == true) { mon = &(dev->ext->only_one); } else mon = NULL; break; case BY_DEVICE: mon = &(dev->ext->only_one); break; case BY_CLASS: mon = &(dev->device_class->ext->only_one); break; case BY_PROCESS: mon = &(Util::instance()->ext->only_one); break; } if (mon) mon->get_monitor(); } AutoTangoMonitor(Tango::DeviceClass *dev_cl) { SerialModel ser = Util::instance()->get_serial_model(); switch(ser) { case NO_SYNC: case BY_DEVICE: mon = NULL; break; case BY_CLASS: mon = &(dev_cl->ext->only_one); mon->get_monitor(); break; case BY_PROCESS: mon = &(Util::instance()->ext->only_one); mon->get_monitor(); break; } } AutoTangoMonitor(Tango::TangoMonitor *m):mon(m) { if (mon) mon->get_monitor(); } ~AutoTangoMonitor() {if (mon)mon->rel_monitor();} private: TangoMonitor *mon; omni_thread::ensure_self auto_self; }; //--------------------------------------------------------------------------------------------------------------------- // // class : // NoSyncModelTangoMonitor // // description : // This class is only a helper class used to get a TangoMonitor object during its construction and to // it during its destruction only if the device server process is in NO_SYNC synchronisation model // //-------------------------------------------------------------------------------------------------------------------- class NoSyncModelTangoMonitor { public: NoSyncModelTangoMonitor(Tango::DeviceImpl *dev) { SerialModel ser = Util::instance()->get_serial_model(); if (ser == NO_SYNC) { mon = &(dev->ext->only_one); mon->get_monitor(); } else mon = NULL; } ~NoSyncModelTangoMonitor() {if (mon)mon->rel_monitor();} private: TangoMonitor *mon; omni_thread::ensure_self auto_self; }; } // End of Tango namespace #endif /* AUTO_TANGO_MONITOR */ tango-8.1.2c+dfsg.orig/lib/cpp/server/dev_poll.cpp0000644000175000017500000004407612205375142020755 0ustar piccapiccastatic const char *RcsId = "$Id$"; //+============================================================================ // // file : dev_poll.cpp // // description : C++ source code for the DeviceImpl // class. This class // is the root class for all derived Device classes. // It is an abstract class. The DeviceImpl class is the // CORBA servant which is "exported" onto the network and // accessed by the client. // // project : TANGO // // author(s) : E.Taurel // // Copyright (C) : 2011,2012 // European Synchrotron Radiation Facility // BP 220, Grenoble 38043 // FRANCE // // This file is part of Tango. // // Tango 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. // // Tango 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 Tango. If not, see . // // $Revision$ // //-============================================================================ #if HAVE_CONFIG_H #include #endif #include namespace Tango { //+------------------------------------------------------------------------- // // method : DeviceImpl::init_poll_no_db // // description : Init polling info for device running without DB // In such a case, polling is available only for // object with polling defined in code. // Fill in string vectors which are in case of DS using // database initialised from the db. // //-------------------------------------------------------------------------- void DeviceImpl::init_poll_no_db() { bool old_set = false; // // A loop for all device attribute // vector &att_list = dev_attr->get_attribute_list(); vector::iterator ite; for (ite = att_list.begin();ite != att_list.end();++ite) { long poll_period = (*ite)->get_polling_period(); if (poll_period != 0) { vector &polled_attr_list = get_polled_attr(); polled_attr_list.push_back((*ite)->get_name()); stringstream ss; ss << poll_period; polled_attr_list.push_back(ss.str()); if (old_set == false) { set_poll_old_factor(DEFAULT_POLL_OLD_FACTOR); old_set = true; } } } // // A loop for all device commands // vector &cmd_list = device_class->get_command_list(); vector::iterator ite_cmd; for (ite_cmd = cmd_list.begin();ite_cmd != cmd_list.end();++ite_cmd) { long poll_period = (*ite_cmd)->get_polling_period(); if (poll_period != 0) { vector &polled_cmd_list = get_polled_cmd(); polled_cmd_list.push_back((*ite_cmd)->get_name()); stringstream ss; ss << poll_period; polled_cmd_list.push_back(ss.str()); if (old_set == false) { set_poll_old_factor(DEFAULT_POLL_OLD_FACTOR); old_set = true; } } } } //+------------------------------------------------------------------------- // // method : DeviceImpl::is_attribute_polled // // description : Returns true if the attribute is polled // // argument: att_name : The attribute name // //-------------------------------------------------------------------------- bool DeviceImpl::is_attribute_polled(const string &att_name) { string att = att_name; transform(att.begin(),att.end(),att.begin(),::tolower); vector &att_list = get_polled_attr(); for (unsigned int i = 0;i < att_list.size();i = i+2) { // // Convert to lower case before comparison // string name_lowercase(att_list[i]); transform(name_lowercase.begin(),name_lowercase.end(),name_lowercase.begin(),::tolower); if ( att == name_lowercase ) { // // when the polling buffer is externally filled (polling period == 0) // mark the attribute as not polled! No events can be send by the polling thread! // if ( att_list[i+1] == "0" ) { return false; } else return true; } } // // now check wether a polling period is set (for example by pogo) // Tango::Attribute &the_att = dev_attr->get_attr_by_name(att_name.c_str()); if ( the_att.get_polling_period() > 0 ) { // // check the list of non_auto_polled attributes to verify wether // the polling was disabled // vector &napa = get_non_auto_polled_attr(); for (unsigned int j = 0;j < napa.size();j++) { #ifdef _TG_WINDOWS_ if (_stricmp(napa[j].c_str(), att_name.c_str()) == 0) #else if (strcasecmp(napa[j].c_str(), att_name.c_str()) == 0) #endif { return false; } } return true; } return false; } //+------------------------------------------------------------------------- // // method : DeviceImpl::is_command_polled // // description : Returns true if the command is polled // // argument: cmd_name : The command name // //-------------------------------------------------------------------------- bool DeviceImpl::is_command_polled(const string &cmd_name) { string cmd = cmd_name; transform(cmd.begin(),cmd.end(),cmd.begin(),::tolower); vector &cmd_list = get_polled_cmd(); for (unsigned int i = 0;i < cmd_list.size();i = i+2) { // // Convert to lower case before comparison // string name_lowercase(cmd_list[i]); transform(name_lowercase.begin(),name_lowercase.end(),name_lowercase.begin(),::tolower); if ( cmd == name_lowercase ) { // // when the polling buffer is externally filled (polling period == 0) // mark the attribute as not polled! No events can be send by the polling thread! // if ( cmd_list[i+1] == "0" ) { return false; } else return true; } } // // now check wether a polling period is set (for example by pogo) // Tango::Command &the_cmd = device_class->get_cmd_by_name(cmd_name); if ( the_cmd.get_polling_period() > 0 ) { // // check the list of non_auto_polled attributes to verify wether // the polling was disabled // vector &napa = get_non_auto_polled_cmd(); for (unsigned int j = 0;j < napa.size();j++) { #ifdef _TG_WINDOWS_ if (_stricmp(napa[j].c_str(), cmd_name.c_str()) == 0) #else if (strcasecmp(napa[j].c_str(), cmd_name.c_str()) == 0) #endif { return false; } } return true; } return false; } //+------------------------------------------------------------------------- // // method : DeviceImpl::get_attribute_poll_period // // description : Get the attribute polling period in mS (O if not polled) // // argument: att_name : The attribute name // //-------------------------------------------------------------------------- int DeviceImpl::get_attribute_poll_period(const string &att_name) { int per = 0; string att = att_name; transform(att.begin(),att.end(),att.begin(),::tolower); bool found = false; vector &att_list = get_polled_attr(); for (unsigned int i = 0;i < att_list.size();i = i+2) { // // Convert to lower case before comparison // string name_lowercase(att_list[i]); transform(name_lowercase.begin(),name_lowercase.end(),name_lowercase.begin(),::tolower); if ( att == name_lowercase ) { stringstream ss; ss << att_list[i + 1]; ss >> per; found = true; break; } } // // now check wether a polling period is set (for example by pogo) // if (found == false) { Tango::Attribute &the_att = dev_attr->get_attr_by_name(att_name.c_str()); per = the_att.get_polling_period(); } return per; } //+------------------------------------------------------------------------- // // method : DeviceImpl::get_command_poll_period // // description : Get the command polling period in mS (0 if not polled) // // argument: cmd_name : The command name // //-------------------------------------------------------------------------- int DeviceImpl::get_command_poll_period(const string &cmd_name) { int per = 0; string cmd = cmd_name; transform(cmd.begin(),cmd.end(),cmd.begin(),::tolower); bool found = false; vector &cmd_list = get_polled_cmd(); for (unsigned int i = 0;i < cmd_list.size();i = i+2) { // // Convert to lower case before comparison // string name_lowercase(cmd_list[i]); transform(name_lowercase.begin(),name_lowercase.end(),name_lowercase.begin(),::tolower); if ( cmd == name_lowercase ) { stringstream ss; ss << cmd_list[i + 1]; ss >> per; found = true; break; } } // // now check wether a polling period is set (for example by pogo) // if (found == false) { Tango::Command &the_cmd = device_class->get_cmd_by_name(cmd_name); per = the_cmd.get_polling_period(); } return per; } //+------------------------------------------------------------------------- // // method : DeviceImpl::poll_attribute // // description : Poll one attribute. If the attribute is already polled, // update its polling period to the new value // // argument: att_name : The attribute name // period : The polling period // //-------------------------------------------------------------------------- void DeviceImpl::poll_attribute(const string &att_name,int period) { poll_object(att_name,period,POLL_ATTR); } //+------------------------------------------------------------------------- // // method : DeviceImpl::poll_command // // description : Poll one command. If the command is already polled, // update its polling period to the new value // // argument: cmd_name : The command name // period : The polling period // //-------------------------------------------------------------------------- void DeviceImpl::poll_command(const string &cmd_name,int period) { poll_object(cmd_name,period,POLL_CMD); } //+------------------------------------------------------------------------- // // method : DeviceImpl::poll_object // // description : Poll one object. If the object is already polled, // update its polling period to the new value // // argument: cmd_name : The object name // period : The polling period // type : Command or attribute // //-------------------------------------------------------------------------- void DeviceImpl::poll_object(const string &obj_name,int period,PollObjType type) { Tango::Util *tg = Tango::Util::instance(); if (tg->is_svr_shutting_down() == true) { Except::throw_exception((const char *)API_NotSupported, (const char *)"It's not supported to start polling on any device cmd/attr while the device is shutting down", (const char *)"DeviceImpl::poll_object"); } if (tg->is_svr_starting() == true) { // // If server is starting, we rely on the Util::polling_configure method to effectively // start the polling // Nevertheless, some tests are coded before doing the job // if (period < MIN_POLL_PERIOD) { TangoSys_OMemStream o; o << period << " is below the min authorized period (" << MIN_POLL_PERIOD << " mS)" << ends; Except::throw_exception((const char *)API_NotSupported,o.str(), (const char *)"DeviceImpl::poll_object"); } // // Just to be sure that the command/attribute exist // Also init ptr to the command/attribute polled list // vector *poll_obj; if (type == POLL_CMD) { device_class->get_cmd_by_name(obj_name); vector &po = get_polled_cmd(); poll_obj = &po; } else { dev_attr->get_attr_by_name(obj_name.c_str()); vector &po = get_polled_attr(); poll_obj = &po; } // // Check if the command is not already in the polled command // If yes, only update polling period in vector // Otherwise, add cmd name and polling period in vector // // Util::polling_configure will ask dserver polling command // to store info in db only if polling period is negative. // bool found = false; string obj_name_lower(obj_name); transform(obj_name_lower.begin(),obj_name_lower.end(),obj_name_lower.begin(),::tolower); for (unsigned int i = 0;i < poll_obj->size();i = i + 2) { string tmp_name((*poll_obj)[i]); transform(tmp_name.begin(),tmp_name.end(),tmp_name.begin(),::tolower); if (tmp_name == obj_name_lower) { found = true; stringstream ss; string period_str; ss << period; ss >> period_str; if (ss) (*poll_obj)[i + 1] = period_str; } } if (found == false) { stringstream ss; ss << -period; if (ss) { poll_obj->push_back(obj_name); poll_obj->push_back(ss.str()); } } } else { // // Ask the admin device to do the work (simulating the classical // way to tune polling) // If the attribute is already polled, it's an update polling period // Otherwise, it's a add object polling command // DServer *ds = tg->get_dserver_device(); CORBA::Any the_any; DevVarLongStringArray *send = new DevVarLongStringArray(); send->lvalue.length(1); send->svalue.length(3); send->svalue[0] = CORBA::string_dup(get_name().c_str()); if (type == POLL_ATTR) send->svalue[1] = CORBA::string_dup("attribute"); else send->svalue[1] = CORBA::string_dup("command"); send->svalue[2] = CORBA::string_dup(obj_name.c_str()); send->lvalue[0] = period; the_any <<= send; CORBA::Any *received_any = NULL; if (type == POLL_CMD) { if (is_command_polled(obj_name) == true) { if (get_command_poll_period(obj_name) != period) received_any = ds->command_inout("UpdObjPollingPeriod",the_any); } else received_any = ds->command_inout("AddObjPolling",the_any); } else { if (is_attribute_polled(obj_name) == true) { if (get_attribute_poll_period(obj_name) != period) received_any = ds->command_inout("UpdObjPollingPeriod",the_any); } else received_any = ds->command_inout("AddObjPolling",the_any); } delete received_any; } } //+------------------------------------------------------------------------- // // method : DeviceImpl::stop_poll_attribute // // description : Stop polling one attribute // Does nothing if the attribute is not polled // // argument: att_name : The attribute name // //-------------------------------------------------------------------------- void DeviceImpl::stop_poll_attribute(const string &att_name) { stop_poll_object(att_name,POLL_ATTR); } //+------------------------------------------------------------------------- // // method : DeviceImpl::stop_poll_command // // description : Stop polling one command // Does nothing if the command is not polled // // argument: cmd_name : The command name // //-------------------------------------------------------------------------- void DeviceImpl::stop_poll_command(const string &cmd_name) { stop_poll_object(cmd_name,POLL_CMD); } //+------------------------------------------------------------------------- // // method : DeviceImpl::stop_poll_object // // description : Stop polling one object // Does nothing if the object is not polled // // argument: obj_name : The object name // //-------------------------------------------------------------------------- void DeviceImpl::stop_poll_object(const string &obj_name,PollObjType type) { Tango::Util *tg = Tango::Util::instance(); if (tg->is_svr_starting() == true) { // // Just to be sure that the attribute/command exist // vector *poll_obj; if (type == POLL_CMD) { device_class->get_cmd_by_name(obj_name); vector &po = get_polled_cmd(); poll_obj = &po; } else { dev_attr->get_attr_by_name(obj_name.c_str()); vector &po = get_polled_attr(); poll_obj = &po; } // // Remove object info in vector of polled attributes/commands // string obj_name_lower(obj_name); transform(obj_name_lower.begin(),obj_name_lower.end(),obj_name_lower.begin(),::tolower); vector::iterator ite; for (ite = poll_obj->begin();ite != poll_obj->end();ite = ite + 2) { string tmp_name(*ite); transform(tmp_name.begin(),tmp_name.end(),tmp_name.begin(),::tolower); if (tmp_name == obj_name_lower) { ite = poll_obj->erase(ite,ite+2); if (ite == poll_obj->end()) break; else ite = ite - 2; } } } else { if (tg->is_device_restarting(device_name) == false) { // // Ask the admin device to do the work (simulating the classical // way to tune polling) // DServer *ds = tg->get_dserver_device(); CORBA::Any the_any; DevVarStringArray *send = new DevVarStringArray(); send->length(3); (*send)[0] = CORBA::string_dup(get_name().c_str()); if (type == POLL_CMD) (*send)[1] = CORBA::string_dup("command"); else (*send)[1] = CORBA::string_dup("attribute"); (*send)[2] = CORBA::string_dup(obj_name.c_str()); the_any <<= send; CORBA::Any *received_any; received_any = ds->command_inout("RemObjPolling",the_any); delete received_any; } } } } // End of Tango namespace tango-8.1.2c+dfsg.orig/lib/cpp/server/deviceclass.h0000644000175000017500000003314712205375142021100 0ustar piccapicca//============================================================================= // // file : Deviceclass.h // // description : Include file for the DeviceClass root class. // // project : TANGO // // author(s) : E.Taurel // // Copyright (C) : 2004,2005,2006,2007,2008,2009,2010,2011,2012,2013 // European Synchrotron Radiation Facility // BP 220, Grenoble 38043 // FRANCE // // This file is part of Tango. // // Tango 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. // // Tango 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 Tango. If not, see . // // $Revision: 22502 $ // // //============================================================================= #ifndef _DEVICECLASS_H #define _DEVICECLASS_H namespace Tango { class Command; class DeviceClass; class AutoTangoMonitor; class NoSyncModelTangoMonitor; class EventSupplier; class Util; class DServer; //============================================================================= // // The DeviceClass class // // // description : This class will act as root class for all other // DeviceClass classes. Its job is to define all Device // class related properties and methods which exist only // once e.g. the command list. // //============================================================================= /** * Base class for all TANGO device-class class. A TANGO device-class class is * a class where is stored all data/method common to all devices of a TANGO * device class * * $Author: taurel $ * $Revision: 22502 $ * * @headerfile tango.h * @ingroup Server */ class #ifdef _TG_WINDOWS_ #ifndef _TANGO_LIB __declspec(dllexport) #endif #endif DeviceClass { friend class Tango::AutoTangoMonitor; public: /**@name Destructor * Only one desctructor is defined for this class */ //@{ /** * The device destructor. */ virtual ~DeviceClass(); //@} /**@name Miscellaneous methods */ //@{ /** * Execute a command. * * It looks for the correct command object in the command object vector. * If the command is found, it invoke the always_executed_hook method. * Check if the command is allowed by invoking the is_allowed method * If the command is allowed, invokes the execute method. * * @param device The device on which the command must be executed * @param command The command name * @param in_any The command input data still packed in a CORBA Any object * @return A CORBA Any object with the output data packed in * @exception DevFailed If the command is not found, if the command is not allowed * in the actual device state and re-throws of all the exception thrown by the * always_executed_hook, is_alloed and execute methods. * Click here to read * DevFailed exception specification * */ CORBA::Any *command_handler(DeviceImpl *device, string &command,const CORBA::Any &in_any); /** * Create command objects for all command supported by this class of device. * * In the DeviceClass class, this method is pure abstract and must be defined * in sub-class. Its rule is to create the command object and to store them * in a vector of command objects * */ virtual void command_factory() = 0; /** * Create all the attributes name supported by this class of device. * * In the DeviceClass class, this method does nothing and must be re-defined * in sub-class if the sub-class supports attributes. Its rule is to * store the supported attributes in a vector. * */ virtual void attribute_factory(vector &) {}; /** * Create device(s). * * In the DeviceClass class, this method is pure abstract and must be defined * in sub-class. Its rule is to create all the class devices and to store them * in a vector of device * * @param dev_list The device name list * @exception DevFailed This method does not throw exception but a * redefined method can. * Click here to read * DevFailed exception specification */ virtual void device_factory(const Tango::DevVarStringArray *dev_list) = 0; /** * Create device(s) name list (for no database device server). * * This method can be re-defined in DeviceClass sub-class for device server * started without database. Its rule is to initialise class device name. * The default method does nothing. * * @param list Reference to the device name list */ virtual void device_name_factory(vector &list) {(void)list;}; /** * Delete device. * * The rule of this method is to delete a device from the running * server belonging to the Tango class. It does change anything in the * database * * @param dev_name Reference to the device name */ void device_destroyer(const string &dev_name); /** * Delete device. * * The rule of this method is to delete a device from the running * device belonging to the Tango class. It does change anything in the * database * * @param dev_name Reference to the device name */ void device_destroyer(const char *dev_name); //@} /**@name Get/Set object members. * These methods allows the external world to get/set DeviceImpl instance * data members */ //@{ /** * Get the TANGO device class name. * * @return The TANGO device class name */ string &get_name() {return name;} /** * Get the TANGO device class documentation URL. * * @return The TANGO device class documentation */ string &get_doc_url() {return doc_url;} /** * Get the TANGO device type name. * * @return The TANGO device type name */ string &get_type() {return type;} /** * Get the device object vector. * * @return A reference to the device vector */ vector &get_device_list() {return device_list;} /** * Get the command object vector. * * @return A reference to the command vector */ vector &get_command_list() {return command_list;} /** * Get a reference to a command object. * * @return A reference to the command object */ Command &get_cmd_by_name(const string &); /** * Get a pointer to the associated DbClass object. * * @return Pointer to the DbClas object */ DbClass *get_db_class() {return db_class;} /** * Get a pointer to the class attributes object * * @return A pointer to the instance of the MultiClassAttribute */ MultiClassAttribute *get_class_attr() {return class_attr;} /** * Set the TANGO device type name. * * @param dev_type The new TANGO device type name */ void set_type(string &dev_type) {type = dev_type;} /** * Set the TANGO device type name. * * @param dev_type The new TANGO device type name */ void set_type(const char *dev_type) {type = dev_type;} //@} /**@name Signal related methods * These methods allow a signal management at device level */ //@{ #if defined _TG_WINDOWS_ /** * Register a signal. * * Register this class as class to be informed when signal signo is sent to * to the device server process * * @param signo The signal number * @exception DevFailed Thrown if the signal number is out of range or if the * operating system failed to register a signal for the process. * Click here to read * DevFailed exception specification */ void register_signal(long signo); #else /** * Register a signal. * * Register this class as class to be informed when signal signo is sent to * to the device server process. This method is available only under Linux. * * @param signo The signal number * @param own_handler A boolean set to true if you want the device signal handler * to be executed in its own handler instead of being executed by the signal * thread. If this parameter is set to true, care should be taken on how the * handler is written. A default false value is provided * @exception DevFailed Thrown if the signal number is out of range or if the * operating system failed to register a signal for the process. * Click here to read * DevFailed exception specification */ void register_signal(long signo,bool own_handler = false); #endif /** * Unregister a signal. * * Unregister this class as class to be informed when signal signo is sent to * to the device server process * * @param signo The signal number * @exception DevFailed Thrown if the signal number is out of range or if the * operating system failed to unregister a signal for the process. Unregister * a device for a signal number for a device not previously registered is not * an error. This simply will do nothing. * Click here to read * DevFailed exception specification */ void unregister_signal(long signo); /** * Signal handler. * * The method executed when the signal arrived in the device server process. * This method is defined as virtual and then, can be redefined following * device class needs. * * @param signo The signal number */ virtual void signal_handler(long signo); //@} protected: /**@name Constructor Only one constructot for this class which is a singleton */ //@{ /** * Construct a newly allocated DeviceClass object. * * @param s The Tango device class name * */ DeviceClass(string &s); //@} /**@name Miscellaneous protected methods */ //@{ /** * Export a device. * * Associate the servant to a CORBA object and send device network parameter * to TANGO database. The main parameter sent to database is the CORBA * object stringified device IOR. * * @param dev The device to be exported (CORBA servant) * @param corba_dev_name The name to be used in the CORBA object key. This * parameter does not need to be set in most of cases and has a default value. * It is used for special device server like the database device server. * @exception DevFailed If the command sent to the database failed. * Click here to read * DevFailed exception specification */ void export_device(DeviceImpl *dev,const char* corba_dev_name = "Unused"); /** * Set a Tango classs default command * * Define one command to be the Tango class default command * The default command is the command which will be exceuted when * an unknown command is sent to one of the Tango class device * By default, there is no default class * * @param cmd The command object */ void set_default_command(Command *cmd) {ext->default_cmd = cmd;} //@} /**@name Class data members */ //@{ /** * The TANGO device class name */ string name; /** * The TANGO device class documentation URL */ string doc_url; /** * The TANGO device type name */ string type; /** * The command(s) list */ vector command_list; /** * The device(s) list */ vector device_list; /** * The associated DbClass object */ DbClass *db_class; /** * Pointer to the class multi attribute object */ MultiClassAttribute *class_attr; //@} public: /// @privatesection vector &get_nodb_name_list() {return ext->nodb_name_list;} void set_memorized_values(bool flag, long idx = 0,bool from_init = false); void add_wiz_dev_prop(string &name,string &desc,string &def); void add_wiz_dev_prop(string &name,string &desc); void add_wiz_class_prop(string &name,string &desc,string &def); void add_wiz_class_prop(string &name,string &desc); vector &get_wiz_class_prop() {return wiz_class_prop;} vector &get_wiz_dev_prop() {return wiz_dev_prop;} string &get_cvs_tag() {return ext->cvs_tag;} string &get_cvs_location() {return ext->cvs_location;} string &get_svn_tag() {return ext->svn_tag;} string &get_svn_location() {return ext->svn_location;} void set_cvs_tag(string &str) {ext->cvs_tag=str;} void set_cvs_location(string &str) {ext->cvs_location=str;} void add_device(DeviceImpl *dev) {device_list.push_back(dev);} void delete_dev(long idx,Tango::Util *tg,PortableServer::POA_ptr r_poa); bool is_py_class() {return ext->py_class;} void set_py_class(bool py) {ext->py_class=py;} virtual void delete_class() {} void get_mcast_event(DServer *); bool is_command_allowed(const char *); bool get_device_factory_done() {return ext->device_factory_done;} void set_device_factory_done(bool val) {ext->device_factory_done = val;} void check_att_conf(); void release_devices_mon(); protected: /// @privatesection Command *get_default_command() {return ext->default_cmd;} private: class DeviceClassExt { public: DeviceClassExt():only_one("class"),default_cmd(NULL),py_class(false),device_factory_done(false) {}; vector nodb_name_list; TangoMonitor only_one; string cvs_tag; string cvs_location; Command * default_cmd; bool py_class; string svn_tag; string svn_location; bool device_factory_done; }; void get_class_system_resource(); void throw_mem_value(DeviceImpl *,Attribute &); vector wiz_class_prop; vector wiz_dev_prop; vector allowed_cmds; #ifdef HAS_UNIQUE_PTR unique_ptr ext; // Class extension #else DeviceClassExt *ext; #endif }; } // End of Tango namespace #endif // _DEVICECLASS_H tango-8.1.2c+dfsg.orig/lib/cpp/server/log4tango.h0000644000175000017500000000626012205375142020505 0ustar piccapicca/* * * Copyright (C) : 2004,2005,2006,2007,2008,2009,2010,2011,2012,2013 * European Synchrotron Radiation Facility * BP 220, Grenoble 38043 * FRANCE * * This file is part of Tango. * * Tango 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. * * Tango 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 Tango. If not, see . * * log4tango.h * * NL - SOLEIL. * */ #ifndef _LOG4TANGO_H_ #define _LOG4TANGO_H_ #ifdef TANGO_HAS_LOG4TANGO //------------------------------------------------------------- // REQUIRED LOG4TANGO STUFFS //------------------------------------------------------------- #include #include #include #include #include //------------------------------------------------------------- // REQUIRED TANGO LOGGING STUFFS //------------------------------------------------------------- #include #include //------------------------------------------------------------- // LOGGING MACROS (FOR DEVICE DEVELOPERS) //------------------------------------------------------------- #define LOG_FATAL(X) \ get_logger()->fatal X #define LOG_ERROR(X) \ get_logger()->error X #define LOG_WARN(X) \ get_logger()->warn X #define LOG_INFO(X) \ get_logger()->info X #define LOG_DEBUG(X) \ get_logger()->debug X #define FATAL_STREAM \ if (get_logger()->is_fatal_enabled()) \ get_logger()->fatal_stream() \ << log4tango::LogInitiator::_begin_log #define ERROR_STREAM \ if (get_logger()->is_error_enabled()) \ get_logger()->error_stream() \ << log4tango::LogInitiator::_begin_log #define WARN_STREAM \ if (get_logger()->is_warn_enabled()) \ get_logger()->warn_stream() \ << log4tango::LogInitiator::_begin_log #define INFO_STREAM \ if (get_logger()->is_info_enabled()) \ get_logger()->info_stream() \ << log4tango::LogInitiator::_begin_log #define DEBUG_STREAM \ if (get_logger()->is_debug_enabled()) \ get_logger()->debug_stream() \ << log4tango::LogInitiator::_begin_log #define ENDLOG \ log4tango::LogSeparator::_end_log //------------------------------------------------------------- // A CLASS TO LOG IN THE NAME OF DEVICE (USING DEV'S LOGGER) //------------------------------------------------------------- namespace Tango { class LogAdapter { public: LogAdapter(Tango::DeviceImpl *dev); virtual ~LogAdapter(); inline log4tango::Logger* get_logger (void) { return logger_; } private: log4tango::Logger* logger_; }; } // namespace Tango #endif // TANGO_HAS_LOG4TANGO #endif // _LOG4TANGO_H_ tango-8.1.2c+dfsg.orig/lib/cpp/server/pollobj.h0000644000175000017500000001243512205375142020251 0ustar piccapicca//============================================================================= // // file : PollObj.h // // description : Include for the PollObj object. This class implements // the polling ring buffer. Command result or attribute // values are stored in this buffer manages as a ring // buffer. // // project : TANGO // // author(s) : E.Taurel // // Copyright (C) : 2004,2005,2006,2007,2008,2009,2010,2011,2012,2013 // European Synchrotron Radiation Facility // BP 220, Grenoble 38043 // FRANCE // // This file is part of Tango. // // Tango 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. // // Tango 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 Tango. If not, see . // // $Revision: 22213 $ // //============================================================================= #ifndef _POLLOBJ_H #define _POLLOBJ_H #include #include namespace Tango { //============================================================================= // // The PollObj class // // description : Class to store all the necessary information which will // be stored and returned to client on request // // This class is protected against concurrent access by a // omni_mutex. We use the Thread-Safe interface pattern // to avoid "self-deadlock". This is why several methods // are splitted in two: One method called "meth" and // another one called "meth_i" (which is also sometimes // public !!) // //============================================================================= class PollObj: public omni_mutex { public: PollObj(DeviceImpl *,PollObjType,const string &,int); PollObj(DeviceImpl *,PollObjType,const string &,int,long); void insert_data(CORBA::Any *,struct timeval &,struct timeval &); void insert_data(Tango::AttributeValueList *,struct timeval &,struct timeval &); void insert_data(Tango::AttributeValueList_3 *,struct timeval &,struct timeval &); void insert_data(Tango::AttributeValueList_4 *,struct timeval &,struct timeval &); void insert_except(Tango::DevFailed *,struct timeval &,struct timeval &); double get_authorized_delta() {return max_delta_t;} void update_upd(int); CORBA::Any *get_last_cmd_result(); Tango::AttributeValue &get_last_attr_value(bool); Tango::AttributeValue_3 &get_last_attr_value_3(bool); Tango::AttributeValue_4 &get_last_attr_value_4(bool); bool is_ring_empty() {omni_mutex_lock(*this);return is_ring_empty_i();} bool is_ring_empty_i() {return ring.is_empty();} long get_upd() {omni_mutex_lock(*this);return get_upd_i();} long get_upd_i() {return ((upd.tv_sec * 1000) + (upd.tv_usec / 1000));} string &get_name() {omni_mutex_lock(*this);return get_name_i();} string &get_name_i() {return name;} inline double get_needed_time() {omni_mutex_lock(*this);return get_needed_time_i();} inline double get_needed_time_i() { return ((needed_time.tv_sec * 1000) + (needed_time.tv_usec / 1000.0)); } inline PollObjType get_type() {omni_mutex_lock(*this);return get_type_i();} inline PollObjType get_type_i() {return type;} double get_last_insert_date() {omni_mutex_lock(*this);return get_last_insert_date_i();} double get_last_insert_date_i(); bool is_last_an_error() {omni_mutex_lock(*this);return is_last_an_error_i();} bool is_last_an_error_i() {return ring.is_last_an_error();} bool is_last_an_error_i_3() {if (type==POLL_CMD)return ring.is_last_cmd_an_error();else return ring.is_last_attr_an_error();} Tango::DevFailed *get_last_except() {omni_mutex_lock(*this);return get_last_except_i();} Tango::DevFailed *get_last_except_i() {return ring.get_last_except();} Tango::DevErrorList &get_last_attr_error_i() {return ring.get_last_attr_error();} void get_delta_t(vector &vd, long nb) {omni_mutex_lock(*this);get_delta_t_i(vd,nb);} void get_delta_t_i(vector &vd,long nb) {ring.get_delta_t(vd,nb);} long get_elt_nb_in_buffer() {omni_mutex_lock(*this);return get_elt_nb_in_buffer_i();} long get_elt_nb_in_buffer_i() {return ring.get_nb_elt();} void get_cmd_history(long,Tango::DevCmdHistoryList *); void get_cmd_history(long,Tango::DevCmdHistory_4 *,Tango::CmdArgType &); void get_attr_history(long n,Tango::DevAttrHistoryList *ptr,long type); void get_attr_history(long n,Tango::DevAttrHistoryList_3 *ptr,long type); void get_attr_history(long n,Tango::DevAttrHistory_4 *ptr,long type); void get_attr_history_43(long n,Tango::DevAttrHistoryList_3 *ptr,long type); protected: DeviceImpl *dev; PollObjType type; string name; struct timeval upd; struct timeval needed_time; double max_delta_t; PollRing ring; }; inline bool operator<(const PollObj &,const PollObj &) { return true; } inline bool operator==(const PollObj &,const PollObj &) { return true; } } // End of Tango namespace #endif /* _POLLOBJ_ */ tango-8.1.2c+dfsg.orig/lib/cpp/server/dserverlog.cpp0000644000175000017500000001554112205375142021320 0ustar piccapiccastatic const char *RcsId = "$Id: dserverlog.cpp 22213 2013-03-07 14:32:56Z taurel $\n$Name$"; //+============================================================================= // // file : DServerLog.cpp // // description : Implementation of the DServer logging oriented commands // // project : TANGO // // author(s) : N.Leclercq - SOLEIL // // Copyright (C) : 2004,2005,2006,2007,2008,2009,2010,2011,2012,2013 // European Synchrotron Radiation Facility // BP 220, Grenoble 38043 // FRANCE // // This file is part of Tango. // // Tango 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. // // Tango 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 Tango. If not, see . // // $Revision: 22213 $ // // $Log$ // Revision 3.7 2010/09/09 13:45:22 taurel // - Add year 2010 in Copyright notice // // Revision 3.6 2010/06/18 07:45:47 taurel // - In case of locked device, polling and logging related commands are // allowed only for the locker process // // Revision 3.5 2009/01/21 12:49:04 taurel // - Change CopyRights for 2009 // // Revision 3.4 2008/10/06 15:01:09 taurel // - Changed the licensing info from GPL to LGPL // // Revision 3.3 2008/10/03 06:52:31 taurel // - Add some licensing info in each files // // Revision 3.2 2003/05/28 14:55:09 taurel // Add the include (conditionally) of the include files generated by autoconf // // Revision 3.1 2003/05/16 08:46:16 taurel // Many changes for release 3.0.1. The most important ones are : // - Timeout are backs // - Multiple db servers (change in TANGO_HOST syntax) // - Added methods to print DeviceData, DeviceDataHistory, DeviceAttribute and DeviceAttributeHistory instances // - Attributes name stored in blackbox // - Remove check if a class is created without any device // - It's now possible to create a DeviceProxy from its alias name // - Command, attribute names are case insensitive // - Change parameters of some DeviceProxy logging methods // - Change parameters of DeviceProxy asynchronous replies calls // - New serialization model in device server (no serialization model) // - Win32 (2000) device server service does not exit at loggoff anymore // - Miscellaneous bug fixes // // Revision 3.0 2003/03/25 16:43:20 taurel // Many changes for Tango release 3.0 including // - Added full logging features // - Added asynchronous calls // - Host name of clients now stored in black-box // - Three serialization model in DS // - Fix miscellaneous bugs // - Ported to gcc 3.2 // - Added ApiUtil::cleanup() and destructor methods // - Some internal cleanups // - Change the way how TangoMonitor class is implemented. It's a recursive // mutex // // Revision 2.2 2003/03/11 17:55:53 nleclercq // Switch from log4cpp to log4tango // // Revision 2.1 2003/02/17 14:57:41 taurel // Added the new Tango logging stuff (Thanks Nicolas from Soleil) // //-============================================================================= #if HAVE_CONFIG_H #include #endif #include #ifdef TANGO_HAS_LOG4TANGO namespace Tango { //+---------------------------------------------------------------------------- // // method : DServer::add_logging_target // //----------------------------------------------------------------------------- void DServer::add_logging_target (const Tango::DevVarStringArray *argin) { NoSyncModelTangoMonitor mon(this); cout4 << "Entering DServer::add_logging_target" << endl; Logging::add_logging_target(argin); cout4 << "Leaving DServer::add_logging_target" << endl; } //+---------------------------------------------------------------------------- // // method : DServer::remove_logging_target // //----------------------------------------------------------------------------- void DServer::remove_logging_target (const Tango::DevVarStringArray *argin) { NoSyncModelTangoMonitor mon(this); cout4 << "Entering DServer::remove_logging_target" << endl; Logging::remove_logging_target(argin); cout4 << "Leaving DServer::remove_logging_target" << endl; } //+---------------------------------------------------------------------------- // // method : DServer::get_logging_target // //----------------------------------------------------------------------------- Tango::DevVarStringArray* DServer::get_logging_target (const std::string& dev_name) { NoSyncModelTangoMonitor mon(this); cout4 << "Entering DServer::get_logging_target" << endl; DevVarStringArray* res = Logging::get_logging_target(dev_name); cout4 << "Leaving DServer::get_logging_target" << endl; return res; } //+---------------------------------------------------------------------------- // // method : DServer::set_logging_level // //----------------------------------------------------------------------------- void DServer::set_logging_level (const Tango::DevVarLongStringArray *argin) { NoSyncModelTangoMonitor mon(this); cout4 << "Entering DServer::set_logging_level" << endl; Logging::set_logging_level(argin); cout4 << "Leaving DServer::set_logging_level" << endl; } //+---------------------------------------------------------------------------- // // method : DServer::get_logging_level // //----------------------------------------------------------------------------- DevVarLongStringArray* DServer::get_logging_level (const DevVarStringArray *argin) { NoSyncModelTangoMonitor mon(this); cout4 << "Entering DServer::get_logging_level" << endl; DevVarLongStringArray* res = Logging::get_logging_level(argin); cout4 << "Leaving DServer::get_logging_level" << endl; return res; } //+---------------------------------------------------------------------------- // // method : DServer::stop_logging // //----------------------------------------------------------------------------- void DServer::stop_logging (void) { NoSyncModelTangoMonitor mon(this); cout4 << "Entering DServer::stop_logging" << endl; Logging::stop_logging(); cout4 << "Leaving DServer::stop_logging" << endl; } //+---------------------------------------------------------------------------- // // method : DServer::start_logging // //----------------------------------------------------------------------------- void DServer::start_logging (void) { NoSyncModelTangoMonitor mon(this); cout4 << "Entering DServer::start_logging" << endl; Logging::start_logging(); cout4 << "Leaving DServer::start_logging" << endl; } } // End of Tango namespace #endif // TANGO_HAS_LOG4TANGO tango-8.1.2c+dfsg.orig/lib/cpp/server/logging.cpp0000644000175000017500000013106012205375142020565 0ustar piccapiccastatic const char *RcsId = "$Id: logging.cpp 22213 2013-03-07 14:32:56Z taurel $\n$Name$"; //+============================================================================= // // file : Logging.cpp // // description : TLS helper class // // project : TANGO // // author(s) : N.Leclercq - SOLEIL // // Copyright (C) : 2004,2005,2006,2007,2008,2009,2010,2011,2012,2013 // European Synchrotron Radiation Facility // BP 220, Grenoble 38043 // FRANCE // // This file is part of Tango. // // Tango 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. // // Tango 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 Tango. If not, see . // // $Revision: 22213 $ // //-============================================================================= #if HAVE_CONFIG_H #include #endif #include #ifdef TANGO_HAS_LOG4TANGO //----------------------------------------------------------------------------- // HEADERS //----------------------------------------------------------------------------- #ifdef _TG_WINDOWS_ # include #else # include # include # include # include # include #endif #include #include #include namespace Tango { //----------------------------------------------------------------------------- // TANGO KERNEL CMD LINE DEBUGGING LEVEL //----------------------------------------------------------------------------- #define kTANGO_CORE_CMD_LINE_LEVEL 5 //----------------------------------------------------------------------------- // LOCAL LOG MACRO (CAN'T USE LOGGING STUFFS DURING LOGGING STUFFS INIT STAGE!) //----------------------------------------------------------------------------- #define _VERBOSE(_MSG_) \ if (Logging::_cmd_line_level >= kTANGO_CORE_CMD_LINE_LEVEL) \ ::printf _MSG_; //----------------------------------------------------------------------------- // LOCAL CONSTs (should be a Logging static const member) //----------------------------------------------------------------------------- static const char* kDefaultTargetName = "default"; static const char* kDefaultConsoleName = "cout"; //----------------------------------------------------------------------------- // STATIC MEMBERS //----------------------------------------------------------------------------- // the DServer logger (use to output TANGO low level messages) log4tango::Logger* _core_logger = 0; // the logging path (use to store file logging targets) std::string Logging::_log_path(""); // the threshold for RollingFileAppender size_t Logging::_rft = 0; // the cmd line verbose level int Logging::_cmd_line_level = 0; //+---------------------------------------------------------------------------- // method : Logging::init() //----------------------------------------------------------------------------- void Logging::init (const std::string& ds_name, // dserver name int cmd_line_level, // cmd. line verbose level bool use_db, // true if using the TANGO-db Database &db, // Db object or null Util *tg) // Tango::Util object { // logging path env. var. name const char* kTangoLogPathVar = "TANGO_LOG_PATH"; // default logging path #ifdef _TG_WINDOWS_ const char* kDefaultTangoLogPath = "c:/tango"; #else const char* kDefaultTangoLogPath = "/tmp/tango"; #endif try { // store cmd line verbose level (set by user) Logging::_cmd_line_level = cmd_line_level; _VERBOSE(("Entering Logging::init\n")); // set default threshold for RollingFileAppender Logging::_rft = kDefaultRollingThreshold; // try to get logging path from kTangoLogPathVar env. var. char *ftg_path = ::getenv(kTangoLogPathVar); if (ftg_path == 0 || ::strlen(ftg_path) == 0) { // log path not set or empty, use default path Logging::_log_path = kDefaultTangoLogPath; #ifndef _TG_WINDOWS_ struct passwd* pw = getpwuid(getuid()); if (pw) { Logging::_log_path = Logging::_log_path + '-' + pw->pw_name; } #else BOOL ret; TCHAR buffer[128]; DWORD nb = 128; ret = GetUserName(buffer,&nb); if (ret == 0){ Logging::_log_path = Logging::_log_path + '-' + buffer; } #endif } else { Logging::_log_path = ftg_path; } _VERBOSE(("\tTANGO_LOG_PATH is %s\n", Logging::_log_path.c_str())); // build logger name from dserver name std::string dserver_dev_name("dserver/" + ds_name); // instanciate the logger log4tango::Logger* logger = new log4tango::Logger(dserver_dev_name); // is logging level set from cmd line? bool level_set_from_cmd_line = (cmd_line_level >= kTANGO_CORE_CMD_LINE_LEVEL) ? true : false; _VERBOSE(("\tcmd line logging level is %d\n", cmd_line_level)); // set logger's effective level if (level_set_from_cmd_line) { logger->set_level(log4tango::Level::DEBUG); } else { logger->set_level(log4tango::Level::ERROR); } // core-logger's targets std::vector targets; if (use_db == true) { // get logging properties from database try { DbData db_data; // the logging path property (overwrites env.var.) db_data.push_back(DbDatum("logging_path")); // the core-logger's rolling file threshold db_data.push_back(DbDatum("logging_rft")); // the core-logger's logging level db_data.push_back(DbDatum("logging_level")); // the core-logger's logging target list db_data.push_back(DbDatum("logging_target")); // get properties from TANGO-db db.get_device_property(dserver_dev_name, db_data,tg->get_db_cache()); // set logging path string level_str("WARN"); if (db_data[0].is_empty() == false) { db_data[0] >> Logging::_log_path; _VERBOSE(("\tLogging::_log_path is %s (set from db)\n", Logging::_log_path.c_str())); } Logging::_rft = kDefaultRollingThreshold; // set rolling file threshold if (db_data[1].is_empty() == false) { unsigned long rtf = 0; db_data[1] >> rtf; Logging::_rft = static_cast(rtf); if (rtf < kMinRollingThreshold) { Logging::_rft = kMinRollingThreshold; } else if (rtf > kMaxRollingThreshold) { Logging::_rft = kMaxRollingThreshold; } #ifdef TANGO_LONG64 _VERBOSE(("\tRolling file threshold is %lu Kb\n", Logging::_rft)); #else _VERBOSE(("\tRolling file threshold is %d Kb\n", Logging::_rft)); #endif } // set logging level (if not set from cmd line) if (! level_set_from_cmd_line) { string level_str("WARN"); if (db_data[2].is_empty() == false) db_data[2] >> level_str; _VERBOSE(("\tproperty::level is %s\n", level_str.c_str())); log4tango::Level::Value level = Logging::tango_to_log4tango_level(level_str, false); _VERBOSE(("\teffective property::level is %s\n", log4tango::Level::get_name(level).c_str())); logger->set_level(level); } // get logging targets if (db_data[3].is_empty() == false) db_data[3] >> targets; } catch (...) { _VERBOSE(("\texception caught while handling logging properties\n")); // ignore any exception } } // create this logging dir Logging::_log_path += "/" + ds_name; int res = Logging::create_log_dir(Logging::_log_path); _VERBOSE(("\tLogging::create_log_dir(%s) returned %d\n", Logging::_log_path.c_str(), res)); // be sure there is a console target if level set from cmd line if (level_set_from_cmd_line) { Logging::add_logging_target(logger, kLogTargetConsole, 0); _VERBOSE(("\tadded console target (logging level set from cmd line)\n")); } for (unsigned int i = 0; i < targets.size(); i++) { _VERBOSE(("\tadding property::targets[%d]=%s\n", i, targets[i].c_str())); Logging::add_logging_target(logger, targets[i], 0); } Tango::_core_logger = logger; _VERBOSE(("Leaving Logging::init\n")); } catch (...) { _VERBOSE(("\tUnknown exception caught\n")); // ignore exception } } //+---------------------------------------------------------------------------- // method : Logging::cleanup //----------------------------------------------------------------------------- void Logging::cleanup (void) { delete Tango::_core_logger; Tango::_core_logger = 0; } //+---------------------------------------------------------------------------- // method : Logging::add_logging_target //----------------------------------------------------------------------------- void Logging::add_logging_target (const Tango::DevVarStringArray *argin) { try { // fight against the "zombie appender" syndrom Logging::kill_zombie_appenders(); // trace cout4 << "Entering Logging::add_logging_target" << endl; // log input unsigned int i; for (i = 0; i < argin->length(); i++) { cout4 << "input string = " << (*argin)[i].in() << endl; } // N x [device-name, target-type::target-name] expected // The length of the input sequence must be a multiple of 2 if ((argin->length() % 2) != 0) { Except::throw_exception((const char *)API_MethodArgument, (const char *)"Incorrect number of inout arguments", (const char *)"Logging::add_logging_target"); } // device name pattern std::string pattern; // the device list (devices which name matches pattern) std::vector dl; // for each tuple{dev_name, target_type, target_name} in argin for (i = 0; i < argin->length(); i += 2) { // get device name pattern; pattern = (*argin)[i]; // convert to lower case std::transform(pattern.begin(), pattern.end(), pattern.begin(), ::tolower); // get devices which name matches the pattern pattern dl = Util::instance()->get_device_list(pattern); // throw an exception if the list is empty if (dl.empty()) { TangoSys_OMemStream o; o << "No device name matching pattern <" << pattern << ">" << ends; Except::throw_exception((const char *)API_DeviceNotFound,o.str(), (const char *)"Logging::add_logging_target"); } // Check that none of the concerned device(s) is locked by another client DServer *adm_dev = Util::instance()->get_dserver_device(); for (unsigned int j = 0; j < dl.size(); j++) { adm_dev->check_lock_owner(dl[j],"add_logging_target",(dl[j]->get_name()).c_str()); } // for each device matching pattern... for (unsigned int j = 0; j < dl.size(); j++) { // ...add logging target Logging::add_logging_target(dl[j]->get_logger(), std::string((*argin)[i + 1])); } } // for each tuple // trace cout4 << "Leaving Logging::add_logging_target" << endl; } catch (std::exception& e) { TangoSys_OMemStream o; o << "std::exception caught [" << e.what() << "]" << ends; Except::throw_exception((const char *)API_InternalError, o.str(), (const char *)"Logging::add_logging_target"); } } //+------------------------------------------------------------------------- // method : Logging::add_logging_target //-------------------------------------------------------------------------- void Logging::add_logging_target(log4tango::Logger* logger, const std::string& tg_type, const std::string& tg_name, int throw_exception) { std::string tg_type_name(tg_type); tg_type_name += kLogTargetSep + tg_name; Logging::add_logging_target(logger, tg_type_name, throw_exception); } //+------------------------------------------------------------------------- // method : Logging::add_logging_target //-------------------------------------------------------------------------- void Logging::add_logging_target(log4tango::Logger* logger, const std::string& in_type_name, int throw_exception) { try { // trace cout4 << "Entering Logging::add_logging_target (internal impl)" << endl; // check input if (!logger) { //--TODO::better error handler needed? cout4 << "internal error (logger is null)" << endl; return; } // target type (as string) std::string ltg_type_str; // target name std::string ltg_name_str; // avoid case sensitive troubles std::string type_name(in_type_name); std::transform(type_name.begin(), type_name.end(), type_name.begin(), ::tolower); // split into and Logging::get_target_type_and_name(type_name, ltg_type_str, ltg_name_str); // target type (as int) int ltg_type; if (ltg_type_str == kLogTargetConsole) { ltg_type = LOG_CONSOLE; // force ltg_name_str to kDefaultConsoleName ltg_name_str = kDefaultConsoleName; } else if (ltg_type_str == kLogTargetFile) { ltg_type = LOG_FILE; } else if (ltg_type_str == kLogTargetDevice) { ltg_type = LOG_DEVICE; } else { if (throw_exception) { TangoSys_OMemStream o; o << "Invalid logging target type specified (" << ltg_type_str << ")" << ends; Except::throw_exception((const char *)API_MethodArgument, o.str(), (const char *)"DeviceImpl::add_logging_target"); } return; } // build full path name (for file targets) std::string full_file_name; // build internal target name (i.e. appender name) std::string appender_name(ltg_type_str + kLogTargetSep); switch (ltg_type) { case LOG_CONSOLE: { appender_name += kDefaultConsoleName; } break; case LOG_FILE: { if (ltg_name_str == kDefaultTargetName) { // use default path and file name full_file_name = Logging::_log_path + "/"; full_file_name += Logging::dev_to_file_name(logger->get_name()) + ".log"; } else if (ltg_name_str.find('/') != std::string::npos) { // user specified a "custom" path and file name full_file_name = ltg_name_str; } else { // user specified a "custom" file name full_file_name = Logging::_log_path + "/" + ltg_name_str; } ltg_name_str = full_file_name; appender_name += ltg_name_str; } break; case LOG_DEVICE: { if (ltg_name_str == kDefaultTargetName) { if (throw_exception) { TangoSys_OMemStream o; o << "Device target name must be specified (no default value)" << ends; Except::throw_exception((const char *)API_MethodArgument, o.str(), (const char *)"DeviceImpl::add_logging_target"); } return; } appender_name += ltg_name_str; } break; } // switch (ltg_type) // attach the appender to the logger if not already attached log4tango::Appender* appender = logger->get_appender(appender_name); if (!appender) { cout4 << "Adding logging target " << appender_name << " to " << logger->get_name() << endl; // instanciate the appender (i.e. the target) and the layout (if needed) switch (ltg_type) { case LOG_CONSOLE: { appender = new CoutAppender(appender_name); if (appender == 0) { cout4 << "Internal error (Appender instanciation failed)" << endl; if (throw_exception) { TangoSys_OMemStream o; o << "Out of memory error" << ends; Except::throw_exception((const char *)API_MemoryAllocation, o.str(), (const char *)"DeviceImpl::add_logging_target"); } break; } } break; // case LOG_CONSOLE case LOG_FILE: { appender = new TangoRollingFileAppender(appender_name, full_file_name, Logging::_rft); if (appender == 0) { if (throw_exception) { TangoSys_OMemStream o; o << "Out of memory error" << ends; Except::throw_exception((const char *)API_MemoryAllocation, o.str(), (const char *)"DeviceImpl::add_logging_target"); } break; } if (appender->is_valid() == false) { delete appender; appender = 0; if (throw_exception) { TangoSys_OMemStream o; o << "Could not open logging file " << full_file_name << ends; Except::throw_exception((const char *)API_CannotOpenFile, o.str(), (const char *)"DeviceImpl::add_logging_target"); } break; } log4tango::XMLLayout *layout = new log4tango::XMLLayout(); if (layout == 0) { delete appender; appender = 0; if (throw_exception) { TangoSys_OMemStream o; o << "Out of memory error" << ends; Except::throw_exception((const char *)API_MemoryAllocation, o.str(), (const char *)"DeviceImpl::add_logging_target"); } break; } appender->set_layout(layout); } break; // case LOG_FILE case LOG_DEVICE: { appender = new TangoAppender(logger->get_name(), appender_name, ltg_name_str); if (appender == 0) { if (throw_exception) { TangoSys_OMemStream o; o << "Out of memory error" << ends; Except::throw_exception((const char *)API_MemoryAllocation, o.str(), (const char *)"DeviceImpl::add_logging_target"); } break; } if (appender->is_valid() == false) { delete appender; appender = 0; if (throw_exception) { TangoSys_OMemStream o; o << "Could not connect to log consumer " << ltg_name_str << ends; Except::throw_exception((const char *)API_ConnectionFailed, o.str(), (const char *)"DeviceImpl::add_logging_target"); } break; } } break; // case LOG_DEVICE } // attach the appender to the logger if (appender) { logger->add_appender(appender); } } else { cout4 << "Target " << appender_name << " is already attached to " << logger->get_name() << endl; } cout4 << "Leaving Logging::add_logging_target (internal impl)" << endl; } catch (std::exception& e) { if (throw_exception) { TangoSys_OMemStream o; o << "std::exception caught [" << e.what() << "]" << ends; Except::throw_exception((const char *)API_StdException, o.str(), (const char *)"Logging::add_logging_target"); } } } //+---------------------------------------------------------------------------- // method : Logging::remove_logging_target //----------------------------------------------------------------------------- void Logging::remove_logging_target (const Tango::DevVarStringArray *argin) { try { // fight against the "zombie appender" syndrom Logging::kill_zombie_appenders(); // trace cout4 << "Entering Logging::remove_logging_target" << endl; // log input unsigned int i; for (i = 0; i < argin->length(); i++) { cout4 << "Input string = " << (*argin)[i].in() << endl; } // N x [device-name, target-type, target-name] expected // The length of the input sequence must a multiple of 3 if ((argin->length() % 2) != 0) { Except::throw_exception((const char *)API_WrongNumberOfArgs, (const char *)"Incorrect number of inout arguments", (const char *)"Logging::remove_logging_target"); } // a logger log4tango::Logger* logger; // input arg target_type::target::name as std::string std::string type_name; // dev_name pattern std::string pattern; // target type (as int and string) int tg_type = 0; std::string tg_type_str; // target name or pattern std::string tg_name; // the "remove all targets of type " flag int remove_all_targets; // the device list std::vector dl(0); // for each tuple{dev_name, target_type::target_name} for (i = 0; i < argin->length();) { // get device name wildcard; pattern = (*argin)[i++]; // convert to lower case std::transform(pattern.begin(), pattern.end(), pattern.begin(), ::tolower); // get devices which name matches the pattern pattern dl = Util::instance()->get_device_list(pattern); // throw an exception if the list is empty if (dl.empty()) { TangoSys_OMemStream o; o << "No device name matching pattern <" << pattern << ">" << ends; Except::throw_exception((const char *)API_DeviceNotFound,o.str(), (const char *)"Logging::remove_logging_target"); } // Check that none of the concerned device(s) is locked by another client DServer *adm_dev = Util::instance()->get_dserver_device(); for (unsigned int j = 0; j < dl.size(); j++) { adm_dev->check_lock_owner(dl[j],"remove_logging_target",(dl[j]->get_name()).c_str()); } // get target type and name from argin (syntax type::name) type_name = (*argin)[i++]; std::transform(type_name.begin(), type_name.end(), type_name.begin(), ::tolower); Logging::get_target_type_and_name(type_name, tg_type_str, tg_name); std::transform(tg_type_str.begin(), tg_type_str.end(), tg_type_str.begin(), ::tolower); // check target type if (tg_type_str == kLogTargetConsole) { tg_type = Tango::LOG_CONSOLE; // force target name to kDefaultConsoleName tg_name = kDefaultConsoleName; } else if (tg_type_str == kLogTargetFile) { tg_type = Tango::LOG_FILE; } else if (tg_type_str == kLogTargetDevice) { tg_type = Tango::LOG_DEVICE; } else { TangoSys_OMemStream o; o << "Logging target type <" << tg_type_str << "> not supported" << ends; Except::throw_exception((const char *)API_MethodArgument, o.str(), (const char *)"Logging::remove_logging_target"); } // do we have to remove all targets? remove_all_targets = (tg_name == "*") ? 1 : 0; // for each device matching pattern for (unsigned int j = 0; j < dl.size(); j++) { // get device's logger logger = dl[j]->get_logger(); if (logger == 0) { TangoSys_OMemStream o; o << "Internal error (got a NULL logger)" << ends; Except::throw_exception((const char *)API_InternalError, o.str(), (const char *)"Logging::remove_logging_target"); } // CASE I: remove ONE target of type if (remove_all_targets == 0) { // build full appender name (target_type+sep+target_name) std::string full_tg_name = tg_type_str + kLogTargetSep; // a special case : target is the a file if (tg_type == Tango::LOG_FILE) { if (tg_name == kDefaultTargetName) { // use both default path and file name full_tg_name += Logging::_log_path + "/"; full_tg_name += Logging::dev_to_file_name(logger->get_name()) + ".log"; } else if (tg_name.find('/') != std::string::npos) { // user specified a "custom" path and file name full_tg_name += tg_name; } else { // user specified a "custom" file name full_tg_name += Logging::_log_path + "/" + tg_name; } } else { full_tg_name += tg_name; } cout4 << "removing target " << full_tg_name << " from " << dl[j]->get_name() << endl; // remove appender from device's logger logger->remove_appender(full_tg_name); } // CASE II: remove ALL targets of type else { cout4 << "removing ALL <" << tg_type_str << "> targets from " << dl[j]->get_name() << endl; // get logger's appender list log4tango::AppenderList al = logger->get_all_appenders(); // find appenders of type in std::string::size_type idx; const std::string substr(tg_type_str + kLogTargetSep); // for each appender in for (unsigned int a = 0; a < al.size(); a++) { idx = al[a]->get_name().find(substr); if (idx != std::string::npos) { cout4 << "\tremoving " << al[a]->get_name() << endl; logger->remove_appender(al[a]->get_name()); } } // for each appender in } // else (if remove_all_targets) } // for each device in
} // for each tuple // trace cout4 << "Leaving Logging::remove_logging_target" << endl; } catch (std::exception& e) { TangoSys_OMemStream o; o << "std::exception caught [" << e.what() << "]" << ends; Except::throw_exception((const char *)API_StdException, o.str(), (const char *)"Logging::remove_logging_target"); } } //+---------------------------------------------------------------------------- // method : Logging::get_logging_target //----------------------------------------------------------------------------- Tango::DevVarStringArray* Logging::get_logging_target (const std::string& dev_name) { Tango::DevVarStringArray* ret = 0; try { // fight against the "zombie appender" syndrom Logging::kill_zombie_appenders(); // trace cout4 << "Entering Logging::get_logging_target " << endl; // first check device name (does it exist?) DeviceImpl* dev = 0; try { dev = Tango::Util::instance()->get_device_by_name(dev_name); } catch (Tango::DevFailed &e) { TangoSys_OMemStream o; o << "Device " << dev_name << " not found" << ends; Except::re_throw_exception(e, (const char *)API_DeviceNotFound, o.str(), (const char *)"Logging::get_logging_target"); } // get device's logger log4tango::Logger *logger = dev->get_logger(); if (logger == 0) { TangoSys_OMemStream o; o << "Could not instanciate logger (out of memory error)" << ends; Except::throw_exception((const char *)API_MemoryAllocation, o.str(), (const char *)"Logging::get_logging_target"); } // get logger's appender list log4tango::AppenderList al = logger->get_all_appenders(); // instanciate the returned value ret = new Tango::DevVarStringArray(al.size()); if (ret == 0) { TangoSys_OMemStream o; Except::throw_exception((const char *)API_MemoryAllocation, "Out of memory error (DevVarStringArray allocation failed)", (const char *)"Logging::get_logging_target"); } // set CORBA::sequence size to its max size ret->length(al.size()); // populate the CORBA::sequence for (unsigned int i = 0; i != al.size(); i++) { cout4 << "\tadding " << al[i]->get_name() << " to the returned target list" << endl; (*ret)[i] = CORBA::string_dup(al[i]->get_name().c_str()); } // for i // trace cout4 << "Leaving Logging::get_logging_target " << endl; } catch (std::exception& e) { TangoSys_OMemStream o; o << "std::exception caught [" << e.what() << "]" << ends; Except::throw_exception((const char *)API_StdException, o.str(),(const char *)"Logging::get_logging_target"); } return ret; } //+---------------------------------------------------------------------------- // method : Logging::set_logging_level //----------------------------------------------------------------------------- void Logging::set_logging_level (const DevVarLongStringArray *argin) { try { // trace cout4 << "Entering Logging::set_logging_level" << endl; // log input unsigned int i; for (i = 0; i < argin->svalue.length(); i++) cout4 << "Input string = " << argin->svalue[i].in() << endl; for (i = 0; i < argin->lvalue.length(); i++) cout4 << "Input long = " << argin->lvalue[i] << endl; // check input if (argin->svalue.length() != argin->lvalue.length()) { Except::throw_exception((const char *)API_IncompatibleCmdArgumentType, (const char *)"Imcompatible command argument type,\ long and string arrays must have the same length", (const char *)"Logging::set_logging_level"); } // the device name wildcard std::string pattern; // a device list std::vector dl(0); // a logger log4tango::Logger *logger = 0; // for each entry in argin->svalue for (i = 0; i < argin->svalue.length(); i++) { // check logging level if (argin->lvalue[i] < Tango::LOG_OFF || argin->lvalue[i] > Tango::LOG_DEBUG) { Except::throw_exception((const char *)API_MethodArgument, (const char *)"Invalid argument for command,\ logging level out of range", (const char *)"Logging::set_logging_level"); } // get ith wilcard pattern = argin->svalue[i]; // convert to lower case std::transform(pattern.begin(), pattern.end(), pattern.begin(), ::tolower); // get devices which name matches the pattern pattern dl = Util::instance()->get_device_list(pattern); // Check that none of the concerned device(s) is locked by another client DServer *adm_dev = Util::instance()->get_dserver_device(); for (unsigned int j = 0; j < dl.size(); j++) { adm_dev->check_lock_owner(dl[j],"set_logging_level",(dl[j]->get_name()).c_str()); } // for each device in dl for (unsigned int j = 0; j < dl.size(); j++) { // get device's logger (created if does not already exist) logger = dl[j]->get_logger(); if (logger == 0) { //--TODO::change the following message Except::throw_exception((const char *)API_MemoryAllocation, "out of memory error", (const char *)"Logging::set_logging_level"); } // map TANGO level to log4tango level log4tango::Level::Value log4tango_level = Logging::tango_to_log4tango_level(static_cast(argin->lvalue[i])); // set logger's level logger->set_level(log4tango_level); } // for j } // for i // trace cout4 << "Leaving Logging::set_logging_level" << endl; } catch (std::exception& e) { TangoSys_OMemStream o; o << "std::exception caught [" << e.what() << "]" << ends; Except::throw_exception((const char *)API_StdException, o.str(), (const char *)"Logging::set_logging_level"); } } //+---------------------------------------------------------------------------- // method : Logging::get_logging_level //----------------------------------------------------------------------------- DevVarLongStringArray* Logging::get_logging_level (const DevVarStringArray *argin) { Tango::DevVarLongStringArray *ret = 0; try { // trace cout4 << "Entering Logging::get_logging_level" << endl; unsigned int i, j; for (i = 0; i < argin->length(); i++) { cout4 << "Input string = " << (*argin)[i].in() << endl; } // instance the returned CORBA::seq ret = new Tango::DevVarLongStringArray; if (ret == 0) { TangoSys_OMemStream o; Except::throw_exception((const char *)API_MemoryAllocation, "out of memory error", (const char *)"Logging::get_logging_level"); } // a TANGO logging level Tango::LogLevel tango_level; // the device name wildcard std::string pattern; // a device list std::vector dl(0); // a logger log4tango::Logger *logger = 0; for (i = 0; i < argin->length(); i++) { // get ith wilcard pattern = (*argin)[i]; // convert to lower case std::transform(pattern.begin(), pattern.end(), pattern.begin(), ::tolower); // get devices which name matches the pattern pattern dl = Util::instance()->get_device_list(pattern); // for each device in dl for (j = 0; j < dl.size(); j++) { // get device's logger (created if does not already exist) logger = dl[j]->get_logger(); if (logger == 0) { TangoSys_OMemStream o; //--TODO: change the following message o << "out of memory error" << ends; Except::throw_exception((const char *)API_MemoryAllocation, "out of memory error", (const char *)"Logging::get_logging_level"); } // map log4tango level to TANGO log level tango_level = Logging::log4tango_to_tango_level(logger->get_level()); // set max size and size of each array in the struct ret->lvalue.length(ret->lvalue.length() + 1); ret->svalue.length(ret->svalue.length() + 1); // populate ret ret->svalue[ret->svalue.length() - 1] = CORBA::string_dup(dl[j]->get_name().c_str()); ret->lvalue[ret->lvalue.length() - 1] = tango_level; } // for j } // for i // trace cout4 << "Leaving Logging::get_logging_level" << endl; } catch (std::exception& e) { TangoSys_OMemStream o; o << "std::exception caught [" << e.what() << "]" << ends; Except::throw_exception((const char *)API_StdException, o.str(),(const char *)"Logging::get_logging_level"); } return ret; } //+---------------------------------------------------------------------------- // method : Logging::stop_logging //----------------------------------------------------------------------------- void Logging::stop_logging (void) { cout4 << "Entering Logging::stop_logging" << endl; // get all devices std::vector dl = Util::instance()->get_device_list(std::string("*")); for (unsigned int i = 0; i < dl.size(); i++) { dl[i]->stop_logging(); } cout4 << "Leaving Logging::stop_logging" << endl; } //+---------------------------------------------------------------------------- // method : Logging::start_logging //----------------------------------------------------------------------------- void Logging::start_logging (void) { cout4 << "Entering Logging::start_logging" << endl; // get all devices std::vector dl = Util::instance()->get_device_list(std::string("*")); for (unsigned int i = 0; i < dl.size(); i++) { dl[i]->start_logging(); } cout4 << "Leaving Logging::start_logging" << endl; } //+---------------------------------------------------------------------------- // method : Logging::kill_zombie_appenders //----------------------------------------------------------------------------- void Logging::kill_zombie_appenders (void) { cout4 << "Entering kill_zombie_appenders" << endl; // get all devices std::vector dl(0); dl = Util::instance()->get_device_list("*"); // for each device in
log4tango::AppenderList al; log4tango::Logger *logger = 0; unsigned int i, j; for (i = 0; i < dl.size(); i++) { // get device's logger logger = dl[i]->get_logger(); if (logger) { // get logger's appender list al = logger->get_all_appenders(); // for each appender in for (j = 0; j < al.size(); j++) { if (al[j]->is_valid() == false) { cout4 << "Removing zombie appender " << dl[i]->get_name() << "::" << al[j]->get_name() << endl; logger->remove_appender(al[j]); } } // for each appender in } // if logger } // for each device in
cout4 << "Leaving kill_zombie_appenders" << endl; } //+---------------------------------------------------------------------------- // method : Logging::set_rolling_file_threshold //----------------------------------------------------------------------------- void Logging::set_rolling_file_threshold(log4tango::Logger* logger, size_t rtf) { // check input: logger if (!logger) return; // check input: rtf if (rtf < kMinRollingThreshold) { rtf = kMinRollingThreshold; } else if (rtf > kMaxRollingThreshold) { rtf = kMaxRollingThreshold; } // misc. var to find file targets in appender list std::string::size_type idx; TangoRollingFileAppender *rfa; std::string prefix = std::string(kLogTargetFile) + kLogTargetSep; // get logger's appender list log4tango::AppenderList al = logger->get_all_appenders(); // for each appender in for (unsigned int i = 0; i < al.size(); i++) { // is it a file target? idx = al[i]->get_name().find(prefix); if (idx != std::string::npos) { rfa = reinterpret_cast(al[i]); // change its rtf rfa->set_maximum_file_size(rtf * 1024); } } } //+---------------------------------------------------------------------------- // method : Logging::tango_to_log4tango_level //----------------------------------------------------------------------------- log4tango::Level::Value Logging::tango_to_log4tango_level (Tango::LogLevel tango_level, bool throw_exception) { log4tango::Level::Value log4tango_level; switch (tango_level) { case Tango::LOG_OFF: log4tango_level = log4tango::Level::OFF; break; case Tango::LOG_FATAL: log4tango_level = log4tango::Level::FATAL; break; case Tango::LOG_ERROR: log4tango_level = log4tango::Level::ERROR; break; case Tango::LOG_WARN: log4tango_level = log4tango::Level::WARN; break; case Tango::LOG_INFO: log4tango_level = log4tango::Level::INFO; break; case Tango::LOG_DEBUG: log4tango_level = log4tango::Level::DEBUG; break; default: if (throw_exception == true) { TangoSys_OMemStream o; o << "Invalid logging level specified" << ends; Except::throw_exception((const char *)API_MethodArgument, o.str(),(const char *)"Logging::tango_to_log4tango_level"); } log4tango_level = log4tango::Level::WARN; break; } // switch return log4tango_level; } //+---------------------------------------------------------------------------- // method : Logging::tango_to_log4tango_level (string version) //----------------------------------------------------------------------------- log4tango::Level::Value Logging::tango_to_log4tango_level (const std::string& tango_level, bool throw_exception) { log4tango::Level::Value log4tango_level; if (tango_level == "OFF") { log4tango_level = log4tango::Level::OFF; } else if (tango_level == "FATAL") { log4tango_level = log4tango::Level::FATAL; } else if (tango_level == "ERROR") { log4tango_level = log4tango::Level::ERROR; } else if (tango_level == "WARN") { log4tango_level = log4tango::Level::WARN; } else if (tango_level == "INFO") { log4tango_level = log4tango::Level::INFO; } else if (tango_level == "DEBUG") { log4tango_level = log4tango::Level::DEBUG; } else { if (throw_exception == true) { TangoSys_OMemStream o; o << "Invalid logging level specified" << ends; Except::throw_exception((const char *)API_MethodArgument, o.str(),(const char *)"Logging::tango_to_log4tango_level"); } log4tango_level = log4tango::Level::WARN; } return log4tango_level; } //+---------------------------------------------------------------------------- // method : Logging::log4tango_to_tango_level //----------------------------------------------------------------------------- Tango::LogLevel Logging::log4tango_to_tango_level (log4tango::Level::Value log4tango_level) { Tango::LogLevel tango_level; switch (log4tango_level) { case log4tango::Level::FATAL: tango_level = Tango::LOG_FATAL; break; case log4tango::Level::ERROR: tango_level = Tango::LOG_ERROR; break; case log4tango::Level::WARN: tango_level = Tango::LOG_WARN; break; case log4tango::Level::INFO: tango_level = Tango::LOG_INFO; break; case log4tango::Level::DEBUG: tango_level = Tango::LOG_DEBUG; break; case log4tango::Level::OFF: default: tango_level = Tango::LOG_OFF; break; } // switch return tango_level; } //+---------------------------------------------------------------------------- // method : Logging::dev_to_file_name //----------------------------------------------------------------------------- std::string Logging::dev_to_file_name (const std::string& _dev_name) { cout4 << "Entering Logging::dev_to_file_name (input " << _dev_name << ")" << endl; string file_name(_dev_name); std::transform(file_name.begin(), file_name.end(), file_name.begin(), ::tolower); std::string::size_type pos = 0; do { pos = file_name.find('/', pos); if (pos == std::string::npos) { break; } file_name.replace(pos, 1, "_", 1); pos++; } while (1); cout4 << "Leaving Logging::dev_to_file_name (output " << file_name << ")" << endl; return file_name; } //+---------------------------------------------------------------------------- // method : Logging::get_target_type_and_name //----------------------------------------------------------------------------- int Logging::get_target_type_and_name (const std::string& input, std::string& type, std::string& name) { cout4 << "Logging::get_target_type_and_name (input " << input << ")" << endl; std::string::size_type pos = input.find(kLogTargetSep, 0); if (pos == std::string::npos) { type = input; name = kDefaultTargetName; } else { type.assign(input.begin(), input.begin() + pos); name.assign(input.begin() + pos + ::strlen(kLogTargetSep), input.end()); if (name.size() == 0) { name = kDefaultTargetName; } } cout4 << "Logging::get_target_type_and_name (output " << type << " " << name << ")" << endl; return 0; } //+---------------------------------------------------------------------------- // method : Logging::create_log_dir (called @ startup by Logging::init) //----------------------------------------------------------------------------- int Logging::create_log_dir (const std::string& full_path) { //-_VERBOSE(("\tEntering Logging::create_log_dir (input %s)\n", full_path.c_str())); std::string::size_type pos = full_path.rfind('/'); if (pos != std::string::npos) { std::string sub_path; sub_path.assign(full_path.begin(), full_path.begin() + pos); if (sub_path.size()) { Logging::create_log_dir(sub_path); } } #ifdef _TG_WINDOWS_ int res = ::mkdir(full_path.c_str()); #else int res = ::mkdir(full_path.c_str(), S_IRWXU | S_IRWXG | S_IRWXO); #endif //-_VERBOSE(("\tLeaving Logging::create_log_dir (::mkdir returned %d)\n", res)); return res; } //+---------------------------------------------------------------------------- // method : LogAdapter::LogAdapter //----------------------------------------------------------------------------- LogAdapter::LogAdapter (Tango::DeviceImpl *dev) { if (dev) { logger_ = dev->get_logger(); } else { logger_ = API_LOGGER; } } //+---------------------------------------------------------------------------- // method : LogAdapter::~LogAdapter //----------------------------------------------------------------------------- LogAdapter::~LogAdapter ( ) { //no-op dtor } } // namespace Tango #endif // TANGO_HAS_LOG4TANGO tango-8.1.2c+dfsg.orig/lib/cpp/server/seqvec.h0000644000175000017500000004446012205375142020101 0ustar piccapicca//============================================================================= // // file : SeqVec.h // // description : Include for the utilities function to ease CORBA // sequences from standard C++ vector or in the // oposite way. // // project : TANGO // // author(s) : E.Taurel // // Copyright (C) : 2004,2005,2006,2007,2008,2009,2010,2011,2012,2013 // European Synchrotron Radiation Facility // BP 220, Grenoble 38043 // FRANCE // // This file is part of Tango. // // Tango 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. // // Tango 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 Tango. If not, see . // // $Revision: 22213 $ // // //============================================================================= #ifndef _SECVEC_H #define _SECVEC_H #include namespace Tango { // // These functions are not defined within the tango namespace because the VC++ // is not able to understand that the operator overloading functions is defined // within a namespace x from the operand namespace (c++ or aCC is able to // do it) // //============================================================================= // // Operator for the unsigned char array types // // description : These two operators allow simple insertion between // Tango sequence (DevVarCharArray) and C++ vectors // //============================================================================= //#define NOSPACEINDOC_SEQVEC /** @defgroup Ope Operator overloading functions * Overloading of the << operator between C++ vector and Tango types */ //@{ /** * * Init a DevVarCharArray from a C++ vector of char(s). * * @param lval The DevVarCharArray to be initialised * @param rval The C++ vector */ inline void operator<<(DevVarCharArray &lval,const vector &rval) { size_t nb_elt = rval.size(); lval.length((CORBA::ULong)nb_elt); for (unsigned long i = 0;i < nb_elt;i++) lval[i] = rval[i]; } /** * Init a C++ vector of char from a DevVarCharArray. * * @param lval The C++ vector to be initialised * @param rval The DevVarCharArray */ inline void operator<<(vector &lval,const DevVarCharArray &rval) { long nb_elt = rval.length(); if (lval.empty() == false) lval.clear(); for (long i = 0;i < nb_elt;i++) lval.push_back(rval[i]); } //============================================================================= // // Operator for the Short array types // // description : These two operators allow simple insertion between // Tango sequence (DevVarShortArray) and C++ vectors // //============================================================================= /** * Init a DevVarShortArray from a C++ vector of short(s). * * @param lval The DevVarShortArray to be initialised * @param rval The C++ vector */ inline void operator<<(DevVarShortArray &lval,const vector &rval) { size_t nb_elt = rval.size(); lval.length((CORBA::ULong)nb_elt); for (unsigned long i = 0;i < nb_elt;i++) lval[i] = rval[i]; } /** * Init a C++ vector of short from a DevVarShortArray. * * @param lval The C++ vector to be initialised * @param rval The DevVarShortArray */ inline void operator<<(vector &lval,const DevVarShortArray &rval) { long nb_elt = rval.length(); if (lval.empty() == false) lval.clear(); for (long i = 0;i < nb_elt;i++) lval.push_back(rval[i]); } //============================================================================= // // Operator for the Long array types // // description : These two operators allow simple insertion between // Tango sequence (DevVarLongArray) and C++ vectors // //============================================================================= /** * Init a DevVarLongArray from a C++ vector of DevLong(s). * * @param lval The DevVarLongArray to be initialised * @param rval The C++ vector */ inline void operator<<(DevVarLongArray &lval,const vector &rval) { size_t nb_elt = rval.size(); lval.length((CORBA::ULong)nb_elt); for (unsigned long i = 0;i < nb_elt;i++) lval[i] = rval[i]; } /** * Init a C++ vector of DevLong from a DevVarLongArray. * * @param lval The C++ vector to be initialised * @param rval The DevVarLongArray */ inline void operator<<(vector &lval,const DevVarLongArray &rval) { long nb_elt = rval.length(); if (lval.empty() == false) lval.clear(); for (long i = 0;i < nb_elt;i++) lval.push_back(rval[i]); } //============================================================================= // // Operator for the Long Long array types // // description : These two operators allow simple insertion between // Tango sequence (DevVarLong64Array) and C++ vectors // //============================================================================= /** * Init a DevVarLongArray from a C++ vector of DevLong64(s). * * @param lval The DevVarLong64Array to be initialised * @param rval The C++ vector */ inline void operator<<(DevVarLong64Array &lval,const vector &rval) { size_t nb_elt = rval.size(); lval.length((CORBA::ULong)nb_elt); for (unsigned long i = 0;i < nb_elt;i++) lval[i] = rval[i]; } /** * Init a C++ vector of long from a DevVarLong64Array. * * @param lval The C++ vector to be initialised * @param rval The DevVarLong64Array */ inline void operator<<(vector &lval,const DevVarLong64Array &rval) { long nb_elt = rval.length(); if (lval.empty() == false) lval.clear(); for (long i = 0;i < nb_elt;i++) lval.push_back(rval[i]); } //============================================================================= // // Operator for the Float array types // // description : These two operators allow simple insertion between // Tango sequence (DevVarLongArray) and C++ vectors // //============================================================================= /** * Init a DevVarFloatArray from a C++ vector of float(s). * * @param lval The DevVarFloatArray to be initialised * @param rval The C++ vector */ inline void operator<<(DevVarFloatArray &lval,const vector &rval) { size_t nb_elt = rval.size(); lval.length((CORBA::ULong)nb_elt); for (unsigned long i = 0;i < nb_elt;i++) lval[i] = rval[i]; } /** * Init a C++ vector of long from a DevVarFloatArray. * * @param lval The C++ vector to be initialised * @param rval The DevVarFloatArray */ inline void operator<<(vector &lval,const DevVarFloatArray &rval) { long nb_elt = rval.length(); if (lval.empty() == false) lval.clear(); for (long i = 0;i < nb_elt;i++) lval.push_back(rval[i]); } //============================================================================= // // Operator for the Double array types // // description : These two operators allow simple insertion between // Tango sequence (DevVarDoubleArray) and C++ vectors // //============================================================================= /** * Init a DevVarDoubleArray from a C++ vector of double(s). * * @param lval The DevVarDoubleArray to be initialised * @param rval The C++ vector */ inline void operator<<(DevVarDoubleArray &lval,const vector &rval) { size_t nb_elt = rval.size(); lval.length((CORBA::ULong)nb_elt); for (unsigned long i = 0;i < nb_elt;i++) lval[i] = rval[i]; } /** * Init a C++ vector of long from a DevVarDoubleArray. * * @param lval The C++ vector to be initialised * @param rval The DevVarDoubleArray */ inline void operator<<(vector &lval,const DevVarDoubleArray &rval) { long nb_elt = rval.length(); if (lval.empty() == false) lval.clear(); for (long i = 0;i < nb_elt;i++) lval.push_back(rval[i]); } //============================================================================= // // Operator for the Boolean array types // // description : These two operators allow simple insertion between // Tango sequence (DevVarBooleanArray) and C++ vectors // //============================================================================= /** * Init a DevVarBooleanArray from a C++ vector of bool(s). * * @param lval The DevVarBooleanArray to be initialised * @param rval The C++ vector */ inline void operator<<(DevVarBooleanArray &lval,const vector &rval) { size_t nb_elt = rval.size(); lval.length((CORBA::ULong)nb_elt); for (unsigned long i = 0;i < nb_elt;i++) lval[i] = rval[i]; } /** * Init a C++ vector of long from a DevVarBooleanArray. * * @param lval The C++ vector to be initialised * @param rval The DevVarBooleanArray */ inline void operator<<(vector &lval,const DevVarBooleanArray &rval) { long nb_elt = rval.length(); if (lval.empty() == false) lval.clear(); for (long i = 0;i < nb_elt;i++) lval.push_back(rval[i]); } //============================================================================= // // Operator for the Unsigned short array types // // description : These two operators allow simple insertion between // Tango sequence (DevVarUShortArray) and C++ vectors // //============================================================================= /** * Init a DevVarUShortArray from a C++ vector of unsigned short(s). * * @param lval The DevVarUShortArray to be initialised * @param rval The C++ vector */ inline void operator<<(DevVarUShortArray &lval,const vector &rval) { size_t nb_elt = rval.size(); lval.length((CORBA::ULong)nb_elt); for (unsigned long i = 0;i < nb_elt;i++) lval[i] = rval[i]; } /** * Init a C++ vector of long from a DevVarUShortArray. * * @param lval The C++ vector to be initialised * @param rval The DevVarUShortArray */ inline void operator<<(vector &lval,const DevVarUShortArray &rval) { long nb_elt = rval.length(); if (lval.empty() == false) lval.clear(); for (long i = 0;i < nb_elt;i++) lval.push_back(rval[i]); } //============================================================================= // // Operator for the Unsigned long array types // // description : These two operators allow simple insertion between // Tango sequence (DevVarUShortArray) and C++ vectors // //============================================================================= /** * Init a DevVarULongArray from a C++ vector of DevULong(s). * * @param lval The DevVarULongArray to be initialised * @param rval The C++ vector */ inline void operator<<(DevVarULongArray &lval,const vector &rval) { size_t nb_elt = rval.size(); lval.length((CORBA::ULong)nb_elt); for (unsigned long i = 0;i < nb_elt;i++) lval[i] = rval[i]; } /** * Init a C++ vector of long from a DevVarULongArray. * * @param lval The C++ vector to be initialised * @param rval The DevVarULongArray */ inline void operator<<(vector &lval,const DevVarULongArray &rval) { long nb_elt = rval.length(); if (lval.empty() == false) lval.clear(); for (long i = 0;i < nb_elt;i++) lval.push_back(rval[i]); } //============================================================================= // // Operator for the Unsigned long long array types // // description : These two operators allow simple insertion between // Tango sequence (DevVarULong64Array) and C++ vectors // //============================================================================= /** * Init a DevVarULong64Array from a C++ vector of DevULong64(s). * * @param lval The DevVarULong64Array to be initialised * @param rval The C++ vector */ inline void operator<<(DevVarULong64Array &lval,const vector &rval) { size_t nb_elt = rval.size(); lval.length((CORBA::ULong)nb_elt); for (unsigned long i = 0;i < nb_elt;i++) lval[i] = rval[i]; } /** * Init a C++ vector of long from a DevVarULong64Array. * * @param lval The C++ vector to be initialised * @param rval The DevVarULong64Array */ inline void operator<<(vector &lval,const DevVarULong64Array &rval) { long nb_elt = rval.length(); if (lval.empty() == false) lval.clear(); for (long i = 0;i < nb_elt;i++) lval.push_back(rval[i]); } //============================================================================= // // Operator for the string array types // // description : These two operators allow simple insertion between // Tango sequence (DevVarStringArray) and C++ vectors // //============================================================================= /** * Init a DevVarStringArray from a C++ vector of string(s). * * @param lval The DevVarStringArray to be initialised * @param rval The C++ vector */ inline void operator<<(DevVarStringArray &lval,const vector &rval) { size_t nb_elt = rval.size(); lval.length((CORBA::ULong)nb_elt); for (unsigned long i = 0;i < nb_elt;i++) lval[i] = CORBA::string_dup(rval[i].c_str()); } /** * Init a C++ vector of long from a DevVarStringArray. * * @param lval The C++ vector to be initialised * @param rval The DevVarStringArray */ inline void operator<<(vector &lval,const DevVarStringArray &rval) { long nb_elt = rval.length(); if (lval.empty() == false) lval.clear(); string str; for (long i = 0;i < nb_elt;i++) { str = rval[i]; lval.push_back(str); } } //============================================================================= // // Operator for the DevState array types // // description : These two operators allow simple insertion between // Tango sequence (DevVarStateArray) and C++ vectors // //============================================================================= /** * Init a DevVarStateArray from a C++ vector of state(s). * * @param lval The DevVarStateArray to be initialised * @param rval The C++ vector */ inline void operator<<(DevVarStateArray &lval,const vector &rval) { size_t nb_elt = rval.size(); lval.length((CORBA::ULong)nb_elt); for (unsigned long i = 0;i < nb_elt;i++) lval[i] = rval[i]; } /** * Init a C++ vector of long from a DevVarStateArray. * * @param lval The C++ vector to be initialised * @param rval The DevVarStateArray */ inline void operator<<(vector &lval,const DevVarStateArray &rval) { long nb_elt = rval.length(); if (lval.empty() == false) lval.clear(); for (long i = 0;i < nb_elt;i++) lval.push_back(rval[i]); } //@} //============================================================================= // // Print operator for sequence types // // description : These operators allow simple printing of sequences // //============================================================================= //#ifndef TANGO_HAS_LOG4TANGO /** @defgroup Eas Easy printing operator overloading functions * Overloading of the << operator between C++ ostream and some Tango types */ //@{ /** * Print a DevVarCharArray. * * One line is printed for each sequence element. * * @param lval The C++ stream used for printing * @param rval The DevVarCharArray sequence to be printed */ ostream &operator<<(ostream &lval,const DevVarCharArray &rval); /** * Print a DevVarShortArray. * * One line is printed for each sequence element. * * @param lval The C++ stream used for printing * @param rval The DevVarShortArray sequence to be printed */ ostream &operator<<(ostream &lval,const DevVarShortArray &rval); /** * Print a DevVarLongArray. * * One line is printed for each sequence element. * * @param lval The C++ stream used for printing * @param rval The DevVarLongArray sequence to be printed */ ostream &operator<<(ostream &lval,const DevVarLongArray &rval); /** * Print a DevVarLong64Array. * * One line is printed for each sequence element. * * @param lval The C++ stream used for printing * @param rval The DevVarLong64Array sequence to be printed */ ostream &operator<<(ostream &lval,const DevVarLong64Array &rval); /** * Print a DevVarFloatArray. * * One line is printed for each sequence element. * * @param lval The C++ stream used for printing * @param rval The DevVarFloatArray sequence to be printed */ ostream &operator<<(ostream &lval,const DevVarFloatArray &rval); /** * Print a DevVarDoubleArray. * * One line is printed for each sequence element. * * @param lval The C++ stream used for printing * @param rval The DevVarDoubleArray sequence to be printed */ ostream &operator<<(ostream &lval,const DevVarDoubleArray &rval); /** * Print a DevVarBooleanArray. * * One line is printed for each sequence element. * * @param lval The C++ stream used for printing * @param rval The DevVarBooleanArray sequence to be printed */ ostream &operator<<(ostream &lval,const DevVarBooleanArray &rval); /** * Print a DevVarUShortArray. * * One line is printed for each sequence element. * * @param lval The C++ stream used for printing * @param rval The DevVarUShortArray sequence to be printed */ ostream &operator<<(ostream &lval,const DevVarUShortArray &rval); /** * Print a DevVarULongArray. * * One line is printed for each sequence element. * * @param lval The C++ stream used for printing * @param rval The DevVarULongArray sequence to be printed */ ostream &operator<<(ostream &lval,const DevVarULongArray &rval); /** * Print a DevVarULong64Array. * * One line is printed for each sequence element. * * @param lval The C++ stream used for printing * @param rval The DevVarULong64Array sequence to be printed */ ostream &operator<<(ostream &lval,const DevVarULong64Array &rval); /** * Print a DevVarStringArray. * * One line is printed for each sequence element. * * @param lval The C++ stream used for printing * @param rval The DevVarStringArray sequence to be printed */ ostream &operator<<(ostream &lval,const DevVarStringArray &rval); /** * Print a DevVarStateArray. * * One line is printed for each sequence element. * * @param lval The C++ stream used for printing * @param rval The DevVarStateArray sequence to be printed */ ostream &operator<<(ostream &lval,const DevVarStateArray &rval); /** * Print a DevVarEncodedArray. * * One line is printed for each sequence element. * * @param lval The C++ stream used for printing * @param rval The DevVarEncodedArray sequence to be printed */ ostream &operator<<(ostream &lval,const DevVarEncodedArray &rval); //@} //#endif // TANGO_HAS_LOG4TANGO } // End of Tango namespace #endif /* _SECVEC_ */ tango-8.1.2c+dfsg.orig/lib/cpp/server/logging.h0000644000175000017500000001410112205375142020226 0ustar piccapicca//+============================================================================= // // file : Logging.h // // description : TLS helper class (pseudo-singleton) // // project : TANGO // // author(s) : N.Leclercq - SOLEIL // // Copyright (C) : 2004,2005,2006,2007,2008,2009,2010,2011,2012,2013 // European Synchrotron Radiation Facility // BP 220, Grenoble 38043 // FRANCE // // This file is part of Tango. // // Tango 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. // // Tango 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 Tango. If not, see . // // $Revision: 22213 $ // //-============================================================================= #ifndef _LOGGING_H_ #define _LOGGING_H_ #ifdef TANGO_HAS_LOG4TANGO // A shortcut to the core logger ------------------------------ #define API_LOGGER Tango::Logging::get_core_logger() #ifdef _TANGO_LIB //== compiling TANGO lib ==================== //-- Overwrite std::cout ------------------------------------- #define cout \ if (API_LOGGER) \ API_LOGGER->get_stream(log4tango::Level::INFO, false) \ << log4tango::LogInitiator::_begin_log #endif //== compiling TANGO lib =============================== // Map. cout1..2 to INFO level -------------------------------- #define cout1 \ if (API_LOGGER && API_LOGGER->is_info_enabled()) \ API_LOGGER->info_stream() \ << log4tango::LogInitiator::_begin_log #define cout2 cout1 // Map. cout3..5 to DEBUG level ------------------------------- #define cout3 \ if (API_LOGGER && API_LOGGER->is_debug_enabled()) \ API_LOGGER->debug_stream() \ << log4tango::LogInitiator::_begin_log #define cout4 cout3 #define cout5 cout4 namespace Tango { class Util; #if defined (_TG_WINDOWS_) && !defined(_TANGO_LIB) && defined(TANGO_HAS_DLL) extern __declspec(dllimport) log4tango::Logger* _core_logger; #else extern log4tango::Logger* _core_logger; #endif class Logging { public: /** * Initializes the Tango Logging service (TLS) **/ static void init (const std::string& ds_name, int cmd_line_level, bool use_tango_db, Database &db, Util *tg); /** * Shutdown the Tango Logging service **/ static void cleanup (void); /** * Returns the core logger substitute **/ inline static log4tango::Logger* get_core_logger (void) { return _core_logger; } /** * Implementation of the DServer AddLoggingTarget Tango command **/ static void add_logging_target (const DevVarStringArray *argin); /** * Implementation of the DServer AddLoggingTarget Tango command **/ static void add_logging_target (log4tango::Logger* logger, const std::string& tg_type, const std::string& tg_name, int throw_exception = 1); /** * Implementation of the DServer AddLoggingTarget Tango command **/ static void add_logging_target (log4tango::Logger* logger, const std::string& tg_type_name, int throw_exception = 1); /** * Implementation of the DServer RemoveLoggingTarget Tango command **/ static void remove_logging_target (const DevVarStringArray *argin); /** * Implementation of the DServer GetLoggingTarget Tango command **/ static DevVarStringArray* get_logging_target (const std::string& dev_name); /** * Implementation of the DServer SetLoggingLevel Tango command **/ static void set_logging_level (const DevVarLongStringArray *argin); /** * Implementation of the DServer GetLoggingLevel Tango command **/ static DevVarLongStringArray* get_logging_level (const DevVarStringArray *argin); /** * Implementation of the DServer StartLogging Tango command **/ static void start_logging (void); /** * Implementation of the DServer StopLogging Tango command **/ static void stop_logging (void); /** * Converts a Tango logging level into a log4tango level **/ static log4tango::Level::Value tango_to_log4tango_level (Tango::LogLevel tango_level, bool throw_exception = true); /** * Converts a Tango logging level into a log4tango level **/ static log4tango::Level::Value tango_to_log4tango_level (const std::string& tango_level, bool throw_exception = true); /** * Converts a log4tango level into a Tango logging level **/ static Tango::LogLevel log4tango_to_tango_level (log4tango::Level::Value log4tango_level); /** * Modify the rolling file threshold of the given Logger **/ static void set_rolling_file_threshold(log4tango::Logger* logger, size_t rtf); private: /** * **/ static void kill_zombie_appenders (void); /** * **/ static std::string dev_to_file_name (const std::string& _dev_name); /** * **/ static int get_target_type_and_name (const std::string& input, std::string& type, std::string& name); /** * **/ static int create_log_dir (const std::string& full_path); /** * Protect the Logging class against instanciation and copy **/ Logging (const Logging&); ~Logging(); const Logging& operator= (const Logging&); /** * **/ static std::string _log_path; /** * **/ static size_t _rft; /** * **/ static int _cmd_line_level; }; } // namespace tango #endif // TANGO_HAS_LOG4TANGO #endif // _LOGGING_H_ tango-8.1.2c+dfsg.orig/lib/cpp/server/tangorollingfileappender.h0000644000175000017500000000316212205375142023663 0ustar piccapicca/* * tango_rolling_file_appender.h * * by NL - SOLEIL - 09/2002. * * Copyright (C) : 2004,2005,2006,2007,2008,2009,2010,2011,2012,2013 * European Synchrotron Radiation Facility * BP 220, Grenoble 38043 * FRANCE * * This file is part of Tango. * * Tango 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. * * Tango 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 Tango. If not, see . * * $Revision: 22213 $ * * */ #ifndef _LOG4TANGO_TANGO_ROLLING_FILE_APPENDER_H_ #define _LOG4TANGO_TANGO_ROLLING_FILE_APPENDER_H_ #ifdef TANGO_HAS_LOG4TANGO namespace Tango { class TangoRollingFileAppender : public log4tango::RollingFileAppender { public: /** * **/ TangoRollingFileAppender (const std::string& name, const std::string& fileName, size_t maxFileSize); /** * **/ virtual ~TangoRollingFileAppender (); /** * **/ virtual bool isValid (void) const; }; } // namespace tango #endif // _LOG4TANGO_TANGO_ROLLING_FILE_APPENDER_H_ #endif // TANGO_HAS_LOG4TANGO tango-8.1.2c+dfsg.orig/lib/cpp/server/attribute.tpp0000644000175000017500000015256312205375142021176 0ustar piccapicca//+============================================================================ // // file : Attribute.tpp // // description : C++ source code for the Attribute class template // methods // // project : TANGO // // author(s) : E.Taurel // // Copyright (C) : 2011,2012 // European Synchrotron Radiation Facility // BP 220, Grenoble 38043 // FRANCE // // This file is part of Tango. // // Tango 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. // // Tango 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 Tango. If not, see . // // $Revision: 17240 $ // //-============================================================================ #ifndef _ATTRIBUTE_TPP #define _ATTRIBUTE_TPP namespace Tango { //+------------------------------------------------------------------------- // // method : Attribute::check_hard_coded_properties() // // description : Check if the user tries to change attribute // properties considered as hard coded // Throw exception in case of // // in : user_conf : The attribute configuration sent by the user // //-------------------------------------------------------------------------- template void Attribute::check_hard_coded_properties(const T &user_conf) { // // Check attribute name // string user_att_name(user_conf.name.in()); transform(user_att_name.begin(),user_att_name.end(),user_att_name.begin(),::tolower); if (user_att_name != get_name_lower()) { throw_hard_coded_prop("name"); } // // Check data type // if (user_conf.data_type != data_type) { throw_hard_coded_prop("data_type"); } // // Check data format // if (user_conf.data_format != data_format) { throw_hard_coded_prop("data_format"); } // // Check writable // if (user_conf.writable != writable) { throw_hard_coded_prop("writable"); } // // Check max_dim_x // if (user_conf.max_dim_x != max_x) { throw_hard_coded_prop("max_dim_x"); } // // Check max_dim_y // if (user_conf.max_dim_y != max_y) { throw_hard_coded_prop("max_dim_y"); } // // Check writable_attr_name // string local_w_name(writable_attr_name); transform(local_w_name.begin(),local_w_name.end(),local_w_name.begin(),::tolower); string user_w_name(user_conf.writable_attr_name.in()); transform(user_w_name.begin(),user_w_name.end(),user_w_name.begin(),::tolower); if (user_w_name != local_w_name) { throw_hard_coded_prop("writable_attr_name"); } } //+------------------------------------------------------------------------- // // method : Attribute::set_min_alarm() // // description : Sets minimum alarm attribute property // Throws exception in case the data type of provided // property does not match the attribute data type // // in : new_min_alarm : The minimum alarm property to be set // //-------------------------------------------------------------------------- template void Attribute::set_min_alarm(const T &new_min_alarm) { // // Check type validity // if((data_type == Tango::DEV_STRING) || (data_type == Tango::DEV_BOOLEAN) || (data_type == Tango::DEV_STATE)) throw_err_data_type("min_alarm",ext->d_name,"Attribute::set_min_alarm()"); else if (!(data_type == DEV_ENCODED && ranges_type2const::enu == DEV_UCHAR) && (data_type != ranges_type2const::enu)) { string err_msg = "Attribute (" + name + ") data type does not match the type provided : " + ranges_type2const::str; Except::throw_exception((const char *)API_IncompatibleAttrDataType, (const char *)err_msg.c_str(), (const char *)"Attribute::set_min_alarm()"); } // // Check coherence with max_alarm // if(alarm_conf.test(max_level)) { T max_alarm_tmp; memcpy((void *) &max_alarm_tmp, (const void *) &max_alarm, sizeof(T)); if(new_min_alarm >= max_alarm_tmp) throw_incoherent_val_err("min_alarm","max_alarm",ext->d_name,"Attribute::set_min_alarm()"); } // // Store new min alarm as a string // TangoSys_MemStream str; str.precision(TANGO_FLOAT_PRECISION); if(ranges_type2const::enu == Tango::DEV_UCHAR) str << (short)new_min_alarm; // to represent the numeric value else str << new_min_alarm; string min_alarm_tmp_str; min_alarm_tmp_str = str.str(); // // Get the monitor protecting device att config // If the server is in its starting phase, give a NULL ptr // to the AutoLock object // Tango::Util *tg = Tango::Util::instance(); Tango::TangoMonitor *mon_ptr = NULL; if (tg->is_svr_starting() == false && tg->is_device_restarting(ext->d_name) == false) mon_ptr = &(get_att_device()->get_att_conf_monitor()); AutoTangoMonitor sync1(mon_ptr); // // Store the new alarm locally // Attr_CheckVal old_min_alarm; memcpy((void *)&old_min_alarm, (void *)&min_alarm, sizeof(T)); memcpy((void *)&min_alarm, (void *)&new_min_alarm, sizeof(T)); // // Then, update database // Tango::DeviceClass *dev_class = get_att_device_class(ext->d_name); Tango::MultiClassAttribute *mca = dev_class->get_class_attr(); Tango::Attr &att = mca->get_attr(name); vector &def_user_prop = att.get_user_default_properties(); size_t nb_user = def_user_prop.size(); string usr_def_val; bool user_defaults = false; if (nb_user != 0) { size_t i; for (i = 0;i < nb_user;i++) { if (def_user_prop[i].get_name() == "min_alarm") break; } if (i != nb_user) // user defaults defined { user_defaults = true; usr_def_val = def_user_prop[i].get_value(); } } if (Tango::Util::_UseDb == true) { if(user_defaults && min_alarm_tmp_str == usr_def_val) { DbDatum attr_dd(name), prop_dd("min_alarm"); DbData db_data; db_data.push_back(attr_dd); db_data.push_back(prop_dd); bool retry = true; while (retry == true) { try { tg->get_database()->delete_device_attribute_property(ext->d_name,db_data); retry = false; } catch (CORBA::COMM_FAILURE) { tg->get_database()->reconnect(true); } } } else { try { upd_att_prop_db(min_alarm,"min_alarm"); } catch (Tango::DevFailed &) { memcpy((void *)&min_alarm, (void *)&old_min_alarm, sizeof(T)); throw; } } } // // Set the min_alarm flag // alarm_conf.set(min_level); // // Store new alarm as a string // min_alarm_str = min_alarm_tmp_str; // // Push a att conf event // if (tg->is_svr_starting() == false && tg->is_device_restarting(ext->d_name) == false) get_att_device()->push_att_conf_event(this); // // Delete device startup exception related to min_alarm if there is any // delete_startup_exception("min_alarm"); } template <> inline void Attribute::set_min_alarm(const Tango::DevEncoded &) { string err_msg = "Attribute properties cannot be set with Tango::DevEncoded data type"; Except::throw_exception((const char *)API_MethodArgument, (const char *)err_msg.c_str(), (const char *)"Attribute::set_min_alarm()"); } template <> inline void Attribute::set_min_alarm(const string &new_min_alarm_str) { if((data_type == Tango::DEV_STRING) || (data_type == Tango::DEV_BOOLEAN) || (data_type == Tango::DEV_STATE)) throw_err_data_type("min_alarm",ext->d_name,"Attribute::set_min_alarm()"); string min_alarm_str_tmp = new_min_alarm_str; string dev_name = ext->d_name; Tango::DeviceClass *dev_class = get_att_device_class(ext->d_name); Tango::MultiClassAttribute *mca = dev_class->get_class_attr(); Tango::Attr &att = mca->get_attr(name); vector &def_user_prop = att.get_user_default_properties(); vector &def_class_prop = att.get_class_properties(); size_t nb_class = def_class_prop.size(); size_t nb_user = def_user_prop.size(); string usr_def_val; string class_def_val; bool user_defaults = false; bool class_defaults = false; user_defaults = prop_in_list("min_alarm",usr_def_val,nb_user,def_user_prop); class_defaults = prop_in_list("min_alarm",class_def_val,nb_class,def_class_prop); bool set_value = true; if (class_defaults) { if(TG_strcasecmp(new_min_alarm_str.c_str(),AlrmValueNotSpec) == 0) { set_value = false; avns_in_db("min_alarm",dev_name); avns_in_att(MIN_ALARM); } else if ((TG_strcasecmp(new_min_alarm_str.c_str(),NotANumber) == 0) || (TG_strcasecmp(new_min_alarm_str.c_str(),class_def_val.c_str()) == 0)) { min_alarm_str_tmp = class_def_val; } else if (strlen(new_min_alarm_str.c_str()) == 0) { if (user_defaults) { min_alarm_str_tmp = usr_def_val; } else { set_value = false; avns_in_db("min_alarm",dev_name); avns_in_att(MIN_ALARM); } } } else if(user_defaults) { if(TG_strcasecmp(new_min_alarm_str.c_str(),AlrmValueNotSpec) == 0) { set_value = false; avns_in_db("min_alarm",dev_name); avns_in_att(MIN_ALARM); } else if ((TG_strcasecmp(new_min_alarm_str.c_str(),NotANumber) == 0) || (TG_strcasecmp(new_min_alarm_str.c_str(),usr_def_val.c_str()) == 0) || (strlen(new_min_alarm_str.c_str()) == 0)) min_alarm_str_tmp = usr_def_val; } else { if ((TG_strcasecmp(new_min_alarm_str.c_str(),AlrmValueNotSpec) == 0) || (TG_strcasecmp(new_min_alarm_str.c_str(),NotANumber) == 0) || (strlen(new_min_alarm_str.c_str()) == 0)) { set_value = false; avns_in_db("min_alarm",dev_name); avns_in_att(MIN_ALARM); } } if(set_value) { if ((data_type != Tango::DEV_STRING) && (data_type != Tango::DEV_BOOLEAN) && (data_type != Tango::DEV_STATE)) { double db; float fl; TangoSys_MemStream str; str.precision(TANGO_FLOAT_PRECISION); str << min_alarm_str_tmp; switch (data_type) { case Tango::DEV_SHORT: if (!(str >> db && str.eof())) throw_err_format("min_alarm",dev_name,"Attribute::set_min_alarm()"); set_min_alarm((DevShort)db); break; case Tango::DEV_LONG: if (!(str >> db && str.eof())) throw_err_format("min_alarm",dev_name,"Attribute::set_min_alarm()"); set_min_alarm((DevLong)db); break; case Tango::DEV_LONG64: if (!(str >> db && str.eof())) throw_err_format("min_alarm",dev_name,"Attribute::set_min_alarm()"); set_min_alarm((DevLong64)db); break; case Tango::DEV_DOUBLE: if (!(str >> db && str.eof())) throw_err_format("min_alarm",dev_name,"Attribute::set_min_alarm()"); set_min_alarm(db); break; case Tango::DEV_FLOAT: if (!(str >> fl && str.eof())) throw_err_format("min_alarm",dev_name,"Attribute::set_min_alarm()"); set_min_alarm(fl); break; case Tango::DEV_USHORT: if (!(str >> db && str.eof())) throw_err_format("min_alarm",dev_name,"Attribute::set_min_alarm()"); (db < 0.0) ? set_min_alarm((DevUShort)(-db)) : set_min_alarm((DevUShort)db); break; case Tango::DEV_UCHAR: if (!(str >> db && str.eof())) throw_err_format("min_alarm",dev_name,"Attribute::set_min_alarm()"); (db < 0.0) ? set_min_alarm((DevUChar)(-db)) : set_min_alarm((DevUChar)db); break; case Tango::DEV_ULONG: if (!(str >> db && str.eof())) throw_err_format("min_alarm",dev_name,"Attribute::set_min_alarm()"); (db < 0.0) ? set_min_alarm((DevULong)(-db)) : set_min_alarm((DevULong)db); break; case Tango::DEV_ULONG64: if (!(str >> db && str.eof())) throw_err_format("min_alarm",dev_name,"Attribute::set_min_alarm()"); (db < 0.0) ? set_min_alarm((DevULong64)(-db)) : set_min_alarm((DevULong64)db); break; case Tango::DEV_ENCODED: if (!(str >> db && str.eof())) throw_err_format("min_alarm",dev_name,"Attribute::set_min_alarm()"); (db < 0.0) ? set_min_alarm((DevUChar)(-db)) : set_min_alarm((DevUChar)db); break; } } else throw_err_data_type("min_alarm",dev_name,"Attribute::set_min_alarm()"); } } //+------------------------------------------------------------------------- // // method : Attribute::get_min_alarm() // // description : Gets attribute's minimum alarm value and assigns it // to the variable provided as a parameter // Throws exception in case the data type of provided // parameter does not match the attribute data type // or if minimum alarm is not defined // // in : min_al : The variable to be assigned the attribute's // minimum alarm value // //-------------------------------------------------------------------------- template void Attribute::get_min_alarm(T &min_al) { if (!(data_type == DEV_ENCODED && ranges_type2const::enu == DEV_UCHAR) && (data_type != ranges_type2const::enu)) { string err_msg = "Attribute (" + name + ") data type does not match the type provided : " + ranges_type2const::str; Except::throw_exception((const char *)API_IncompatibleAttrDataType, (const char *)err_msg.c_str(), (const char *)"Attribute::get_min_alarm()"); } else if((data_type == Tango::DEV_STRING) || (data_type == Tango::DEV_BOOLEAN) || (data_type == Tango::DEV_STATE)) { string err_msg = "Minimum alarm has no meaning for the attribute's (" + name + ") data type : " + ranges_type2const::str; Except::throw_exception((const char *)API_AttrOptProp, err_msg.c_str(), (const char *)"Attribute::get_min_alarm()"); } if (!alarm_conf[min_level]) { Except::throw_exception((const char *)API_AttrNotAllowed, (const char *)"Minimum alarm not defined for this attribute", (const char *)"Attribute::get_min_alarm()"); } memcpy((void *)&min_al,(void *)&min_alarm,sizeof(T)); } //+------------------------------------------------------------------------- // // method : Attribute::set_max_alarm() // // description : Sets maximum alarm attribute property // Throws exception in case the data type of provided // property does not match the attribute data type // // in : new_max_alarm : The maximum alarm property to be set // //-------------------------------------------------------------------------- template void Attribute::set_max_alarm(const T &new_max_alarm) { // // Check type validity // if((data_type == Tango::DEV_STRING) || (data_type == Tango::DEV_BOOLEAN) || (data_type == Tango::DEV_STATE)) throw_err_data_type("max_alarm",ext->d_name,"Attribute::set_max_alarm()"); else if (!(data_type == DEV_ENCODED && ranges_type2const::enu == DEV_UCHAR) && (data_type != ranges_type2const::enu)) { string err_msg = "Attribute (" + name + ") data type does not match the type provided : " + ranges_type2const::str; Except::throw_exception((const char *)API_IncompatibleAttrDataType, (const char *)err_msg.c_str(), (const char *)"Attribute::set_max_alarm()"); } // // Check coherence with min_alarm // if(alarm_conf.test(min_level)) { T min_alarm_tmp; memcpy((void *) &min_alarm_tmp, (const void *) &min_alarm, sizeof(T)); if(new_max_alarm <= min_alarm_tmp) throw_incoherent_val_err("min_alarm","max_alarm",ext->d_name,"Attribute::set_max_alarm()"); } // // Store new max alarm as a string // TangoSys_MemStream str; str.precision(TANGO_FLOAT_PRECISION); if(ranges_type2const::enu == Tango::DEV_UCHAR) str << (short)new_max_alarm; // to represent the numeric value else str << new_max_alarm; string max_alarm_tmp_str; max_alarm_tmp_str = str.str(); // // Get the monitor protecting device att config // If the server is in its starting phase, give a NULL ptr // to the AutoLock object // Tango::Util *tg = Tango::Util::instance(); Tango::TangoMonitor *mon_ptr = NULL; if (tg->is_svr_starting() == false && tg->is_device_restarting(ext->d_name) == false) mon_ptr = &(get_att_device()->get_att_conf_monitor()); AutoTangoMonitor sync1(mon_ptr); // // Store the new alarm locally // Attr_CheckVal old_max_alarm; memcpy((void *)&old_max_alarm, (void *)&max_alarm, sizeof(T)); memcpy((void *)&max_alarm, (void *)&new_max_alarm, sizeof(T)); // // Then, update database // Tango::DeviceClass *dev_class = get_att_device_class(ext->d_name); Tango::MultiClassAttribute *mca = dev_class->get_class_attr(); Tango::Attr &att = mca->get_attr(name); vector &def_user_prop = att.get_user_default_properties(); size_t nb_user = def_user_prop.size(); string usr_def_val; bool user_defaults = false; if (nb_user != 0) { size_t i; for (i = 0;i < nb_user;i++) { if (def_user_prop[i].get_name() == "max_alarm") break; } if (i != nb_user) // user defaults defined { user_defaults = true; usr_def_val = def_user_prop[i].get_value(); } } if (Tango::Util::_UseDb == true) { if(user_defaults && max_alarm_tmp_str == usr_def_val) { DbDatum attr_dd(name), prop_dd("max_alarm"); DbData db_data; db_data.push_back(attr_dd); db_data.push_back(prop_dd); bool retry = true; while (retry == true) { try { tg->get_database()->delete_device_attribute_property(ext->d_name,db_data); retry = false; } catch (CORBA::COMM_FAILURE) { tg->get_database()->reconnect(true); } } } else { try { upd_att_prop_db(max_alarm,"max_alarm"); } catch (Tango::DevFailed &) { memcpy((void *)&max_alarm, (void *)&old_max_alarm, sizeof(T)); throw; } } } // // Set the max_alarm flag // alarm_conf.set(max_level); // // Store new alarm as a string // max_alarm_str = max_alarm_tmp_str; // // Push a att conf event // if (tg->is_svr_starting() == false && tg->is_device_restarting(ext->d_name) == false) get_att_device()->push_att_conf_event(this); // // Delete device startup exception related to max_alarm if there is any // delete_startup_exception("max_alarm"); } template <> inline void Attribute::set_max_alarm(const Tango::DevEncoded &) { string err_msg = "Attribute properties cannot be set with Tango::DevEncoded data type"; Except::throw_exception((const char *)API_MethodArgument, (const char *)err_msg.c_str(), (const char *)"Attribute::set_max_alarm()"); } template <> inline void Attribute::set_max_alarm(const string &new_max_alarm_str) { if((data_type == Tango::DEV_STRING) || (data_type == Tango::DEV_BOOLEAN) || (data_type == Tango::DEV_STATE)) throw_err_data_type("max_alarm",ext->d_name,"Attribute::set_max_alarm()"); string max_alarm_str_tmp = new_max_alarm_str; string dev_name = ext->d_name; Tango::DeviceClass *dev_class = get_att_device_class(ext->d_name); Tango::MultiClassAttribute *mca = dev_class->get_class_attr(); Tango::Attr &att = mca->get_attr(name); vector &def_user_prop = att.get_user_default_properties(); vector &def_class_prop = att.get_class_properties(); size_t nb_class = def_class_prop.size(); size_t nb_user = def_user_prop.size(); string usr_def_val; string class_def_val; bool user_defaults = false; bool class_defaults = false; user_defaults = prop_in_list("max_alarm",usr_def_val,nb_user,def_user_prop); class_defaults = prop_in_list("max_alarm",class_def_val,nb_class,def_class_prop); bool set_value = true; if (class_defaults) { if(TG_strcasecmp(new_max_alarm_str.c_str(),AlrmValueNotSpec) == 0) { set_value = false; avns_in_db("max_alarm",dev_name); avns_in_att(MAX_ALARM); } else if ((TG_strcasecmp(new_max_alarm_str.c_str(),NotANumber) == 0) || (TG_strcasecmp(new_max_alarm_str.c_str(),class_def_val.c_str()) == 0)) { max_alarm_str_tmp = class_def_val; } else if (strlen(new_max_alarm_str.c_str()) == 0) { if (user_defaults) { max_alarm_str_tmp = usr_def_val; } else { set_value = false; avns_in_db("max_alarm",dev_name); avns_in_att(MAX_ALARM); } } } else if(user_defaults) { if(TG_strcasecmp(new_max_alarm_str.c_str(),AlrmValueNotSpec) == 0) { set_value = false; avns_in_db("max_alarm",dev_name); avns_in_att(MAX_ALARM); } else if ((TG_strcasecmp(new_max_alarm_str.c_str(),NotANumber) == 0) || (TG_strcasecmp(new_max_alarm_str.c_str(),usr_def_val.c_str()) == 0) || (strlen(new_max_alarm_str.c_str()) == 0)) max_alarm_str_tmp = usr_def_val; } else { if ((TG_strcasecmp(new_max_alarm_str.c_str(),AlrmValueNotSpec) == 0) || (TG_strcasecmp(new_max_alarm_str.c_str(),NotANumber) == 0) || (strlen(new_max_alarm_str.c_str()) == 0)) { set_value = false; avns_in_db("max_alarm",dev_name); avns_in_att(MAX_ALARM); } } if(set_value) { if ((data_type != Tango::DEV_STRING) && (data_type != Tango::DEV_BOOLEAN) && (data_type != Tango::DEV_STATE)) { double db; float fl; TangoSys_MemStream str; str.precision(TANGO_FLOAT_PRECISION); str << max_alarm_str_tmp; switch (data_type) { case Tango::DEV_SHORT: if (!(str >> db && str.eof())) throw_err_format("max_alarm",dev_name,"Attribute::set_max_alarm()"); set_max_alarm((DevShort)db); break; case Tango::DEV_LONG: if (!(str >> db && str.eof())) throw_err_format("max_alarm",dev_name,"Attribute::set_max_alarm()"); set_max_alarm((DevLong)db); break; case Tango::DEV_LONG64: if (!(str >> db && str.eof())) throw_err_format("max_alarm",dev_name,"Attribute::set_max_alarm()"); set_max_alarm((DevLong64)db); break; case Tango::DEV_DOUBLE: if (!(str >> db && str.eof())) throw_err_format("max_alarm",dev_name,"Attribute::set_max_alarm()"); set_max_alarm(db); break; case Tango::DEV_FLOAT: if (!(str >> fl && str.eof())) throw_err_format("max_alarm",dev_name,"Attribute::set_max_alarm()"); set_max_alarm(fl); break; case Tango::DEV_USHORT: if (!(str >> db && str.eof())) throw_err_format("max_alarm",dev_name,"Attribute::set_max_alarm()"); (db < 0.0) ? set_max_alarm((DevUShort)(-db)) : set_max_alarm((DevUShort)db); break; case Tango::DEV_UCHAR: if (!(str >> db && str.eof())) throw_err_format("max_alarm",dev_name,"Attribute::set_max_alarm()"); (db < 0.0) ? set_max_alarm((DevUChar)(-db)) : set_max_alarm((DevUChar)db); break; case Tango::DEV_ULONG: if (!(str >> db && str.eof())) throw_err_format("max_alarm",dev_name,"Attribute::set_max_alarm()"); (db < 0.0) ? set_max_alarm((DevULong)(-db)) : set_max_alarm((DevULong)db); break; case Tango::DEV_ULONG64: if (!(str >> db && str.eof())) throw_err_format("max_alarm",dev_name,"Attribute::set_max_alarm()"); (db < 0.0) ? set_max_alarm((DevULong64)(-db)) : set_max_alarm((DevULong64)db); break; case Tango::DEV_ENCODED: if (!(str >> db && str.eof())) throw_err_format("max_alarm",dev_name,"Attribute::set_max_alarm()"); (db < 0.0) ? set_max_alarm((DevUChar)(-db)) : set_max_alarm((DevUChar)db); break; } } else throw_err_data_type("max_alarm",dev_name,"Attribute::set_max_alarm()"); } } //+------------------------------------------------------------------------- // // method : Attribute::get_max_alarm() // // description : Gets attribute's maximum alarm value and assigns it // to the variable provided as a parameter // Throws exception in case the data type of provided // parameter does not match the attribute data type // or if maximum alarm is not defined // // in : max_al : The variable to be assigned the attribute's // maximum alarm value // //-------------------------------------------------------------------------- template void Attribute::get_max_alarm(T &max_al) { if (!(data_type == DEV_ENCODED && ranges_type2const::enu == DEV_UCHAR) && (data_type != ranges_type2const::enu)) { string err_msg = "Attribute (" + name + ") data type does not match the type provided : " + ranges_type2const::str; Except::throw_exception((const char *)API_IncompatibleAttrDataType, (const char *)err_msg.c_str(), (const char *)"Attribute::get_max_alarm()"); } else if((data_type == Tango::DEV_STRING) || (data_type == Tango::DEV_BOOLEAN) || (data_type == Tango::DEV_STATE)) { string err_msg = "Maximum alarm has no meaning for the attribute's (" + name + ") data type : " + ranges_type2const::str; Except::throw_exception((const char *)API_AttrOptProp, err_msg.c_str(), (const char *)"Attribute::get_max_alarm()"); } if (!alarm_conf[max_level]) { Except::throw_exception((const char *)API_AttrNotAllowed, (const char *)"Maximum alarm not defined for this attribute", (const char *)"Attribute::get_max_alarm()"); } memcpy((void *)&max_al,(void *)&max_alarm,sizeof(T)); } //+------------------------------------------------------------------------- // // method : Attribute::set_min_warning() // // description : Sets minimum warning attribute property // Throws exception in case the data type of provided // property does not match the attribute data type // // in : new_min_warning : The minimum warning property to be set // //-------------------------------------------------------------------------- template void Attribute::set_min_warning(const T &new_min_warning) { // // Check type validity // if((data_type == Tango::DEV_STRING) || (data_type == Tango::DEV_BOOLEAN) || (data_type == Tango::DEV_STATE)) throw_err_data_type("min_warning",ext->d_name,"Attribute::set_min_warning()"); else if (!(data_type == DEV_ENCODED && ranges_type2const::enu == DEV_UCHAR) && (data_type != ranges_type2const::enu)) { string err_msg = "Attribute (" + name + ") data type does not match the type provided : " + ranges_type2const::str; Except::throw_exception((const char *)API_IncompatibleAttrDataType, (const char *)err_msg.c_str(), (const char *)"Attribute::set_min_warning()"); } // // Check coherence with max_warning // if(alarm_conf.test(max_warn)) { T max_warning_tmp; memcpy((void *) &max_warning_tmp, (const void *) &max_warning, sizeof(T)); if(new_min_warning >= max_warning_tmp) throw_incoherent_val_err("min_warning","max_warning",ext->d_name,"Attribute::set_min_warning()"); } // // Store new min warning as a string // TangoSys_MemStream str; str.precision(TANGO_FLOAT_PRECISION); if(ranges_type2const::enu == Tango::DEV_UCHAR) str << (short)new_min_warning; // to represent the numeric value else str << new_min_warning; string min_warning_tmp_str; min_warning_tmp_str = str.str(); // // Get the monitor protecting device att config // If the server is in its starting phase, give a NULL ptr // to the AutoLock object // Tango::Util *tg = Tango::Util::instance(); Tango::TangoMonitor *mon_ptr = NULL; if (tg->is_svr_starting() == false && tg->is_device_restarting(ext->d_name) == false) mon_ptr = &(get_att_device()->get_att_conf_monitor()); AutoTangoMonitor sync1(mon_ptr); // // Store the new warning locally // Attr_CheckVal old_min_warning; memcpy((void *)&old_min_warning, (void *)&min_warning, sizeof(T)); memcpy((void *)&min_warning, (void *)&new_min_warning, sizeof(T)); // // Then, update database // Tango::DeviceClass *dev_class = get_att_device_class(ext->d_name); Tango::MultiClassAttribute *mca = dev_class->get_class_attr(); Tango::Attr &att = mca->get_attr(name); vector &def_user_prop = att.get_user_default_properties(); size_t nb_user = def_user_prop.size(); string usr_def_val; bool user_defaults = false; if (nb_user != 0) { size_t i; for (i = 0;i < nb_user;i++) { if (def_user_prop[i].get_name() == "min_warning") break; } if (i != nb_user) // user defaults defined { user_defaults = true; usr_def_val = def_user_prop[i].get_value(); } } if (Tango::Util::_UseDb == true) { if(user_defaults && min_warning_tmp_str == usr_def_val) { DbDatum attr_dd(name), prop_dd("min_warning"); DbData db_data; db_data.push_back(attr_dd); db_data.push_back(prop_dd); bool retry = true; while (retry == true) { try { tg->get_database()->delete_device_attribute_property(ext->d_name,db_data); retry = false; } catch (CORBA::COMM_FAILURE) { tg->get_database()->reconnect(true); } } } else { try { upd_att_prop_db(min_warning,"min_warning"); } catch (Tango::DevFailed &) { memcpy((void *)&min_warning, (void *)&old_min_warning, sizeof(T)); throw; } } } // // Set the min_warn flag // alarm_conf.set(min_warn); // // Store new warning as a string // min_warning_str = min_warning_tmp_str; // // Push a att conf event // if (tg->is_svr_starting() == false && tg->is_device_restarting(ext->d_name) == false) get_att_device()->push_att_conf_event(this); // // Delete device startup exception related to min_warning if there is any // delete_startup_exception("min_warning"); } template <> inline void Attribute::set_min_warning(const Tango::DevEncoded &) { string err_msg = "Attribute properties cannot be set with Tango::DevEncoded data type"; Except::throw_exception((const char *)API_MethodArgument, (const char *)err_msg.c_str(), (const char *)"Attribute::set_min_warning()"); } template <> inline void Attribute::set_min_warning(const string &new_min_warning_str) { if((data_type == Tango::DEV_STRING) || (data_type == Tango::DEV_BOOLEAN) || (data_type == Tango::DEV_STATE)) throw_err_data_type("min_warning",ext->d_name,"Attribute::set_min_warning()"); string min_warning_str_tmp = new_min_warning_str; string dev_name = ext->d_name; Tango::DeviceClass *dev_class = get_att_device_class(ext->d_name); Tango::MultiClassAttribute *mca = dev_class->get_class_attr(); Tango::Attr &att = mca->get_attr(name); vector &def_user_prop = att.get_user_default_properties(); vector &def_class_prop = att.get_class_properties(); size_t nb_class = def_class_prop.size(); size_t nb_user = def_user_prop.size(); string usr_def_val; string class_def_val; bool user_defaults = false; bool class_defaults = false; user_defaults = prop_in_list("min_warning",usr_def_val,nb_user,def_user_prop); class_defaults = prop_in_list("min_warning",class_def_val,nb_class,def_class_prop); bool set_value = true; if (class_defaults) { if(TG_strcasecmp(new_min_warning_str.c_str(),AlrmValueNotSpec) == 0) { set_value = false; avns_in_db("min_warning",dev_name); avns_in_att(MIN_WARNING); } else if ((TG_strcasecmp(new_min_warning_str.c_str(),NotANumber) == 0) || (TG_strcasecmp(new_min_warning_str.c_str(),class_def_val.c_str()) == 0)) { min_warning_str_tmp = class_def_val; } else if (strlen(new_min_warning_str.c_str()) == 0) { if (user_defaults) { min_warning_str_tmp = usr_def_val; } else { set_value = false; avns_in_db("min_warning",dev_name); avns_in_att(MIN_WARNING); } } } else if(user_defaults) { if(TG_strcasecmp(new_min_warning_str.c_str(),AlrmValueNotSpec) == 0) { set_value = false; avns_in_db("min_warning",dev_name); avns_in_att(MIN_WARNING); } else if ((TG_strcasecmp(new_min_warning_str.c_str(),NotANumber) == 0) || (TG_strcasecmp(new_min_warning_str.c_str(),usr_def_val.c_str()) == 0) || (strlen(new_min_warning_str.c_str()) == 0)) min_warning_str_tmp = usr_def_val; } else { if ((TG_strcasecmp(new_min_warning_str.c_str(),AlrmValueNotSpec) == 0) || (TG_strcasecmp(new_min_warning_str.c_str(),NotANumber) == 0) || (strlen(new_min_warning_str.c_str()) == 0)) { set_value = false; avns_in_db("min_warning",dev_name); avns_in_att(MIN_WARNING); } } if(set_value) { if ((data_type != Tango::DEV_STRING) && (data_type != Tango::DEV_BOOLEAN) && (data_type != Tango::DEV_STATE)) { double db; float fl; TangoSys_MemStream str; str.precision(TANGO_FLOAT_PRECISION); str << min_warning_str_tmp; switch (data_type) { case Tango::DEV_SHORT: if (!(str >> db && str.eof())) throw_err_format("min_warning",dev_name,"Attribute::set_min_warning()"); set_min_warning((DevShort)db); break; case Tango::DEV_LONG: if (!(str >> db && str.eof())) throw_err_format("min_warning",dev_name,"Attribute::set_min_warning()"); set_min_warning((DevLong)db); break; case Tango::DEV_LONG64: if (!(str >> db && str.eof())) throw_err_format("min_warning",dev_name,"Attribute::set_min_warning()"); set_min_warning((DevLong64)db); break; case Tango::DEV_DOUBLE: if (!(str >> db && str.eof())) throw_err_format("min_warning",dev_name,"Attribute::set_min_warning()"); set_min_warning(db); break; case Tango::DEV_FLOAT: if (!(str >> fl && str.eof())) throw_err_format("min_warning",dev_name,"Attribute::set_min_warning()"); set_min_warning(fl); break; case Tango::DEV_USHORT: if (!(str >> db && str.eof())) throw_err_format("min_warning",dev_name,"Attribute::set_min_warning()"); (db < 0.0) ? set_min_warning((DevUShort)(-db)) : set_min_warning((DevUShort)db); break; case Tango::DEV_UCHAR: if (!(str >> db && str.eof())) throw_err_format("min_warning",dev_name,"Attribute::set_min_warning()"); (db < 0.0) ? set_min_warning((DevUChar)(-db)) : set_min_warning((DevUChar)db); break; case Tango::DEV_ULONG: if (!(str >> db && str.eof())) throw_err_format("min_warning",dev_name,"Attribute::set_min_warning()"); (db < 0.0) ? set_min_warning((DevULong)(-db)) : set_min_warning((DevULong)db); break; case Tango::DEV_ULONG64: if (!(str >> db && str.eof())) throw_err_format("min_warning",dev_name,"Attribute::set_min_warning()"); (db < 0.0) ? set_min_warning((DevULong64)(-db)) : set_min_warning((DevULong64)db); break; case Tango::DEV_ENCODED: if (!(str >> db && str.eof())) throw_err_format("min_warning",dev_name,"Attribute::set_min_warning()"); (db < 0.0) ? set_min_warning((DevUChar)(-db)) : set_min_warning((DevUChar)db); break; } } else throw_err_data_type("min_warning",dev_name,"Attribute::set_min_warning()"); } } //+------------------------------------------------------------------------- // // method : Attribute::get_min_warning() // // description : Gets attribute's minimum warning value and assigns it // to the variable provided as a parameter // Throws exception in case the data type of provided // parameter does not match the attribute data type // or if minimum warning is not defined // // in : min_war : The variable to be assigned the attribute's // minimum warning value // //-------------------------------------------------------------------------- template void Attribute::get_min_warning(T &min_war) { if (!(data_type == DEV_ENCODED && ranges_type2const::enu == DEV_UCHAR) && (data_type != ranges_type2const::enu)) { string err_msg = "Attribute (" + name + ") data type does not match the type provided : " + ranges_type2const::str; Except::throw_exception((const char *)API_IncompatibleAttrDataType, (const char *)err_msg.c_str(), (const char *)"Attribute::get_min_warning()"); } else if((data_type == Tango::DEV_STRING) || (data_type == Tango::DEV_BOOLEAN) || (data_type == Tango::DEV_STATE)) { string err_msg = "Minimum warning has no meaning for the attribute's (" + name + ") data type : " + ranges_type2const::str; Except::throw_exception((const char *)API_AttrOptProp, err_msg.c_str(), (const char *)"Attribute::get_min_warning()"); } if (!alarm_conf[min_warn]) { Except::throw_exception((const char *)API_AttrNotAllowed, (const char *)"Minimum warning not defined for this attribute", (const char *)"Attribute::get_min_warning()"); } memcpy((void *)&min_war,(void *)&min_warning,sizeof(T)); } //+------------------------------------------------------------------------- // // method : Attribute::set_max_warning() // // description : Sets maximum warning attribute property // Throws exception in case the data type of provided // property does not match the attribute data type // // in : new_maximum_warning : The maximum warning property to be set // //-------------------------------------------------------------------------- template void Attribute::set_max_warning(const T &new_max_warning) { // // Check type validity // if((data_type == Tango::DEV_STRING) || (data_type == Tango::DEV_BOOLEAN) || (data_type == Tango::DEV_STATE)) throw_err_data_type("max_warning",ext->d_name,"Attribute::set_max_warning()"); else if (!(data_type == DEV_ENCODED && ranges_type2const::enu == DEV_UCHAR) && (data_type != ranges_type2const::enu)) { string err_msg = "Attribute (" + name + ") data type does not match the type provided : " + ranges_type2const::str; Except::throw_exception((const char *)API_IncompatibleAttrDataType, (const char *)err_msg.c_str(), (const char *)"Attribute::set_max_warning()"); } // // Check coherence with min_warning // if(alarm_conf.test(min_warn)) { T min_warning_tmp; memcpy((void *) &min_warning_tmp, (const void *) &min_warning, sizeof(T)); if(new_max_warning <= min_warning_tmp) throw_incoherent_val_err("min_warning","max_warning",ext->d_name,"Attribute::set_max_warning()"); } // // Store new max warning as a string // TangoSys_MemStream str; str.precision(TANGO_FLOAT_PRECISION); if(ranges_type2const::enu == Tango::DEV_UCHAR) str << (short)new_max_warning; // to represent the numeric value else str << new_max_warning; string max_warning_tmp_str; max_warning_tmp_str = str.str(); // // Get the monitor protecting device att config // If the server is in its starting phase, give a NULL ptr // to the AutoLock object // Tango::Util *tg = Tango::Util::instance(); Tango::TangoMonitor *mon_ptr = NULL; if (tg->is_svr_starting() == false && tg->is_device_restarting(ext->d_name) == false) mon_ptr = &(get_att_device()->get_att_conf_monitor()); AutoTangoMonitor sync1(mon_ptr); // // Store the new warning locally // Attr_CheckVal old_max_warning; memcpy((void *)&old_max_warning, (void *)&max_warning, sizeof(T)); memcpy((void *)&max_warning, (void *)&new_max_warning, sizeof(T)); // // Then, update database // Tango::DeviceClass *dev_class = get_att_device_class(ext->d_name); Tango::MultiClassAttribute *mca = dev_class->get_class_attr(); Tango::Attr &att = mca->get_attr(name); vector &def_user_prop = att.get_user_default_properties(); size_t nb_user = def_user_prop.size(); string usr_def_val; bool user_defaults = false; if (nb_user != 0) { size_t i; for (i = 0;i < nb_user;i++) { if (def_user_prop[i].get_name() == "max_warning") break; } if (i != nb_user) // user defaults defined { user_defaults = true; usr_def_val = def_user_prop[i].get_value(); } } if (Tango::Util::_UseDb == true) { if(user_defaults && max_warning_tmp_str == usr_def_val) { DbDatum attr_dd(name), prop_dd("max_warning"); DbData db_data; db_data.push_back(attr_dd); db_data.push_back(prop_dd); bool retry = true; while (retry == true) { try { tg->get_database()->delete_device_attribute_property(ext->d_name,db_data); retry = false; } catch (CORBA::COMM_FAILURE) { tg->get_database()->reconnect(true); } } } else { try { upd_att_prop_db(max_warning,"max_warning"); } catch (Tango::DevFailed &) { memcpy((void *)&max_warning, (void *)&old_max_warning, sizeof(T)); throw; } } } // // Set the max_warn flag // alarm_conf.set(max_warn); // // Store new warning as a string // max_warning_str = max_warning_tmp_str; // // Push a att conf event // if (tg->is_svr_starting() == false && tg->is_device_restarting(ext->d_name) == false) get_att_device()->push_att_conf_event(this); // // Delete device startup exception related to max_warning if there is any // delete_startup_exception("max_warning"); } template <> inline void Attribute::set_max_warning(const Tango::DevEncoded &) { string err_msg = "Attribute properties cannot be set with Tango::DevEncoded data type"; Except::throw_exception((const char *)API_MethodArgument, (const char *)err_msg.c_str(), (const char *)"Attribute::set_max_warning()"); } template <> inline void Attribute::set_max_warning(const string &new_max_warning_str) { if((data_type == Tango::DEV_STRING) || (data_type == Tango::DEV_BOOLEAN) || (data_type == Tango::DEV_STATE)) throw_err_data_type("max_warning",ext->d_name,"Attribute::set_max_warning()"); string max_warning_str_tmp = new_max_warning_str; string dev_name = ext->d_name; Tango::DeviceClass *dev_class = get_att_device_class(ext->d_name); Tango::MultiClassAttribute *mca = dev_class->get_class_attr(); Tango::Attr &att = mca->get_attr(name); vector &def_user_prop = att.get_user_default_properties(); vector &def_class_prop = att.get_class_properties(); size_t nb_class = def_class_prop.size(); size_t nb_user = def_user_prop.size(); string usr_def_val; string class_def_val; bool user_defaults = false; bool class_defaults = false; user_defaults = prop_in_list("max_warning",usr_def_val,nb_user,def_user_prop); class_defaults = prop_in_list("max_warning",class_def_val,nb_class,def_class_prop); bool set_value = true; if (class_defaults) { if(TG_strcasecmp(new_max_warning_str.c_str(),AlrmValueNotSpec) == 0) { set_value = false; avns_in_db("max_warning",dev_name); avns_in_att(MAX_WARNING); } else if ((TG_strcasecmp(new_max_warning_str.c_str(),NotANumber) == 0) || (TG_strcasecmp(new_max_warning_str.c_str(),class_def_val.c_str()) == 0)) { max_warning_str_tmp = class_def_val; } else if (strlen(new_max_warning_str.c_str()) == 0) { if (user_defaults) { max_warning_str_tmp = usr_def_val; } else { set_value = false; avns_in_db("max_warning",dev_name); avns_in_att(MAX_WARNING); } } } else if(user_defaults) { if(TG_strcasecmp(new_max_warning_str.c_str(),AlrmValueNotSpec) == 0) { set_value = false; avns_in_db("max_warning",dev_name); avns_in_att(MAX_WARNING); } else if ((TG_strcasecmp(new_max_warning_str.c_str(),NotANumber) == 0) || (TG_strcasecmp(new_max_warning_str.c_str(),usr_def_val.c_str()) == 0) || (strlen(new_max_warning_str.c_str()) == 0)) max_warning_str_tmp = usr_def_val; } else { if ((TG_strcasecmp(new_max_warning_str.c_str(),AlrmValueNotSpec) == 0) || (TG_strcasecmp(new_max_warning_str.c_str(),NotANumber) == 0) || (strlen(new_max_warning_str.c_str()) == 0)) { set_value = false; avns_in_db("max_warning",dev_name); avns_in_att(MAX_WARNING); } } if(set_value) { if ((data_type != Tango::DEV_STRING) && (data_type != Tango::DEV_BOOLEAN) && (data_type != Tango::DEV_STATE)) { double db; float fl; TangoSys_MemStream str; str.precision(TANGO_FLOAT_PRECISION); str << max_warning_str_tmp; switch (data_type) { case Tango::DEV_SHORT: if (!(str >> db && str.eof())) throw_err_format("max_warning",dev_name,"Attribute::set_max_warning()"); set_max_warning((DevShort)db); break; case Tango::DEV_LONG: if (!(str >> db && str.eof())) throw_err_format("max_warning",dev_name,"Attribute::set_max_warning()"); set_max_warning((DevLong)db); break; case Tango::DEV_LONG64: if (!(str >> db && str.eof())) throw_err_format("max_warning",dev_name,"Attribute::set_max_warning()"); set_max_warning((DevLong64)db); break; case Tango::DEV_DOUBLE: if (!(str >> db && str.eof())) throw_err_format("max_warning",dev_name,"Attribute::set_max_warning()"); set_max_warning(db); break; case Tango::DEV_FLOAT: if (!(str >> fl && str.eof())) throw_err_format("max_warning",dev_name,"Attribute::set_max_warning()"); set_max_warning(fl); break; case Tango::DEV_USHORT: if (!(str >> db && str.eof())) throw_err_format("max_warning",dev_name,"Attribute::set_max_warning()"); (db < 0.0) ? set_max_warning((DevUShort)(-db)) : set_max_warning((DevUShort)db); break; case Tango::DEV_UCHAR: if (!(str >> db && str.eof())) throw_err_format("max_warning",dev_name,"Attribute::set_max_warning()"); (db < 0.0) ? set_max_warning((DevUChar)(-db)) : set_max_warning((DevUChar)db); break; case Tango::DEV_ULONG: if (!(str >> db && str.eof())) throw_err_format("max_warning",dev_name,"Attribute::set_max_warning()"); (db < 0.0) ? set_max_warning((DevULong)(-db)) : set_max_warning((DevULong)db); break; case Tango::DEV_ULONG64: if (!(str >> db && str.eof())) throw_err_format("max_warning",dev_name,"Attribute::set_max_warning()"); (db < 0.0) ? set_max_warning((DevULong64)(-db)) : set_max_warning((DevULong64)db); break; case Tango::DEV_ENCODED: if (!(str >> db && str.eof())) throw_err_format("max_warning",dev_name,"Attribute::set_max_warning()"); (db < 0.0) ? set_max_warning((DevUChar)(-db)) : set_max_warning((DevUChar)db); break; } } else throw_err_data_type("max_warning",dev_name,"Attribute::set_max_warning()"); } } //+------------------------------------------------------------------------- // // method : Attribute::get_max_warning() // // description : Gets attribute's maximum warning value and assigns it // to the variable provided as a parameter // Throws exception in case the data type of provided // parameter does not match the attribute data type // or if maximum warning is not defined // // in : max_war : The variable to be assigned the attribute's // maximum warning value // //-------------------------------------------------------------------------- template void Attribute::get_max_warning(T &max_war) { if (!(data_type == DEV_ENCODED && ranges_type2const::enu == DEV_UCHAR) && (data_type != ranges_type2const::enu)) { string err_msg = "Attribute (" + name + ") data type does not match the type provided : " + ranges_type2const::str; Except::throw_exception((const char *)API_IncompatibleAttrDataType, (const char *)err_msg.c_str(), (const char *)"Attribute::get_max_warning()"); } else if((data_type == Tango::DEV_STRING) || (data_type == Tango::DEV_BOOLEAN) || (data_type == Tango::DEV_STATE)) { string err_msg = "Maximum warning has no meaning for the attribute's (" + name + ") data type : " + ranges_type2const::str; Except::throw_exception((const char *)API_AttrOptProp, err_msg.c_str(), (const char *)"Attribute::get_max_warning()"); } if (!alarm_conf[max_warn]) { Except::throw_exception((const char *)API_AttrNotAllowed, (const char *)"Maximum warning not defined for this attribute", (const char *)"Attribute::get_max_warning()"); } memcpy((void *)&max_war,(void *)&max_warning,sizeof(T)); } template void Attribute::get_properties(Tango::MultiAttrProp &props) { // // Check data type // if (!(data_type == DEV_ENCODED && ranges_type2const::enu == DEV_UCHAR) && (data_type != ranges_type2const::enu)) { string err_msg = "Attribute (" + name + ") data type does not match the type provided : " + ranges_type2const::str; Except::throw_exception((const char *)API_IncompatibleAttrDataType, (const char *)err_msg.c_str(), (const char *)"Attribute::get_properties()"); } // // Get the monitor protecting device att config // If the server is in its starting phase, gives a NULL ptr // to the AutoLock object // Tango::Util *tg = Tango::Util::instance(); Tango::TangoMonitor *mon_ptr = NULL; if (tg->is_svr_starting() == false && tg->is_device_restarting(ext->d_name) == false) mon_ptr = &(get_att_device()->get_att_conf_monitor()); AutoTangoMonitor sync1(mon_ptr); AttributeConfig_3 conf; get_properties_3(conf); props.label = conf.label; props.description = conf.description; props.unit = conf.unit; props.standard_unit = conf.standard_unit; props.display_unit = conf.display_unit; props.format = conf.format; props.min_alarm = conf.att_alarm.min_alarm; props.max_alarm = conf.att_alarm.max_alarm; props.min_value = conf.min_value; props.max_value = conf.max_value; props.min_warning = conf.att_alarm.min_warning; props.max_warning = conf.att_alarm.max_warning; props.delta_t = conf.att_alarm.delta_t; props.delta_val = conf.att_alarm.delta_val; props.event_period = conf.event_prop.per_event.period; props.archive_period = conf.event_prop.arch_event.period; props.rel_change = conf.event_prop.ch_event.rel_change; props.abs_change = conf.event_prop.ch_event.abs_change; props.archive_rel_change = conf.event_prop.arch_event.rel_change; props.archive_abs_change = conf.event_prop.arch_event.abs_change; } template void Attribute::set_properties(Tango::MultiAttrProp &props) { // // Check data type // if (!(data_type == DEV_ENCODED && ranges_type2const::enu == DEV_UCHAR) && (data_type != ranges_type2const::enu)) { string err_msg = "Attribute (" + name + ") data type does not match the type provided : " + ranges_type2const::str; Except::throw_exception((const char *)API_IncompatibleAttrDataType, (const char *)err_msg.c_str(), (const char *)"Attribute::set_properties()"); } // // Check if the user set values of properties which do not have any meaning // for particular attribute data types // if((data_type == Tango::DEV_STRING) || (data_type == Tango::DEV_BOOLEAN) || (data_type == Tango::DEV_STATE)) { if(TG_strcasecmp(props.min_alarm,AlrmValueNotSpec) != 0) throw_err_data_type("min_alarm",ext->d_name,"Attribute::set_properties()"); if(TG_strcasecmp(props.max_alarm,AlrmValueNotSpec) != 0) throw_err_data_type("max_alarm",ext->d_name,"Attribute::set_properties()"); if(TG_strcasecmp(props.min_value,AlrmValueNotSpec) != 0) throw_err_data_type("min_value",ext->d_name,"Attribute::set_properties()"); if(TG_strcasecmp(props.max_value,AlrmValueNotSpec) != 0) throw_err_data_type("max_value",ext->d_name,"Attribute::set_properties()"); if(TG_strcasecmp(props.min_warning,AlrmValueNotSpec) != 0) throw_err_data_type("min_warning",ext->d_name,"Attribute::set_properties()"); if(TG_strcasecmp(props.max_warning,AlrmValueNotSpec) != 0) throw_err_data_type("max_warning",ext->d_name,"Attribute::set_properties()"); if(TG_strcasecmp(props.delta_t,AlrmValueNotSpec) != 0) throw_err_data_type("delta_t",ext->d_name,"Attribute::set_properties()"); if(TG_strcasecmp(props.delta_val,AlrmValueNotSpec) != 0) throw_err_data_type("delta_val",ext->d_name,"Attribute::set_properties()"); if(TG_strcasecmp(props.rel_change,AlrmValueNotSpec) != 0) throw_err_data_type("rel_change",ext->d_name,"Attribute::set_properties()"); if(TG_strcasecmp(props.abs_change,AlrmValueNotSpec) != 0) throw_err_data_type("abs_change",ext->d_name,"Attribute::set_properties()"); if(TG_strcasecmp(props.archive_rel_change,AlrmValueNotSpec) != 0) throw_err_data_type("archive_rel_change",ext->d_name,"Attribute::set_properties()"); if(TG_strcasecmp(props.archive_abs_change,AlrmValueNotSpec) != 0) throw_err_data_type("archive_abs_change",ext->d_name,"Attribute::set_properties()"); } // // Get the monitor protecting device att config // If the server is in its starting phase, give a NULL ptr // to the AutoLock object // Tango::Util *tg = Tango::Util::instance(); Tango::TangoMonitor *mon_ptr = NULL; if (tg->is_svr_starting() == false && tg->is_device_restarting(ext->d_name) == false) mon_ptr = &(get_att_device()->get_att_conf_monitor()); AutoTangoMonitor sync1(mon_ptr); // // Get current attribute configuration and update properties with provided values // AttributeConfig_3 conf; get_properties_3(conf); conf.label = CORBA::string_dup(props.label.c_str()); conf.description = CORBA::string_dup(props.description.c_str()); conf.unit = CORBA::string_dup(props.unit.c_str()); conf.standard_unit = CORBA::string_dup(props.standard_unit.c_str()); conf.display_unit = CORBA::string_dup(props.display_unit.c_str()); conf.format = CORBA::string_dup(props.format.c_str()); conf.att_alarm.min_alarm = CORBA::string_dup(props.min_alarm); conf.att_alarm.max_alarm = CORBA::string_dup(props.max_alarm); conf.min_value = CORBA::string_dup(props.min_value); conf.max_value = CORBA::string_dup(props.max_value); conf.att_alarm.min_warning = CORBA::string_dup(props.min_warning); conf.att_alarm.max_warning = CORBA::string_dup(props.max_warning); conf.att_alarm.delta_t = CORBA::string_dup(props.delta_t); conf.att_alarm.delta_val = CORBA::string_dup(props.delta_val); conf.event_prop.per_event.period = CORBA::string_dup(props.event_period); conf.event_prop.arch_event.period = CORBA::string_dup(props.archive_period); conf.event_prop.ch_event.rel_change = CORBA::string_dup(props.rel_change); conf.event_prop.ch_event.abs_change = CORBA::string_dup(props.abs_change); conf.event_prop.arch_event.rel_change = CORBA::string_dup(props.archive_rel_change); conf.event_prop.arch_event.abs_change = CORBA::string_dup(props.archive_abs_change); // // Set properties and update database // set_upd_properties(conf,ext->d_name); // // Push a att conf event // if (tg->is_svr_starting() == false && tg->is_device_restarting(ext->d_name) == false) get_att_device()->push_att_conf_event(this); } } // End of Tango namespace #endif // _ATTRIBUTE_TPP tango-8.1.2c+dfsg.orig/lib/cpp/server/ntservice.h0000644000175000017500000000607012205375142020610 0ustar piccapicca// Copyright (C) : 2004,2005,2006,2007,2008,2009,2010,2011,2012,2013 // European Synchrotron Radiation Facility // BP 220, Grenoble 38043 // FRANCE // // This file is part of Tango. // // Tango 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. // // Tango 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 Tango. If not, see . #ifndef _NTSERVICE_H #define _NTSERVICE_H #include using namespace std; namespace Tango { // // This is a custom message logger that is used to dump messages to // the NT system log -- the user must ensure that this logger is // used for NT native services // //class NTEventLogger : public OB::Logger, // public OBCORBA::RefCountLocalObject class NTEventLogger { private: HANDLE eventSource_; // The event source string service_; // Service name DWORD eventId_; // The event ID void emitMessage(int, const char*); bool installValues(HKEY); public: NTEventLogger(const char*, DWORD); virtual ~NTEventLogger(); bool install(); bool uninstall(); virtual void info(const char*); virtual void error(const char*); virtual void warning(const char*); virtual void trace(const char*, const char*); }; // // This class represents an NT service. // class NTService { private: static NTService* instance_; // The one and only instance string full_exec_name_; // Full executable name string exec_name_; // Executable name string name_; // The name string title_; // The title bool debug_; // Are we debugging? DWORD checkPoint_; // Check point value SERVICE_STATUS status_; // Status of the service SERVICE_STATUS_HANDLE statusHandle_; // Status handle virtual void start(int, char**, Tango::NTEventLogger *ptr) = 0; void control(DWORD); void main(int argc, char** argv); friend void WINAPI _OB_serviceCtrl(DWORD); friend void WINAPI _OB_serviceMain(DWORD, LPTSTR*); friend class Util; protected: void statusUpdate(DWORD, DWORD = NO_ERROR, DWORD = 0); bool stopped_; public: Tango::NTEventLogger *logger_; // The service logger bool is_installed(); NTService(const char *name); virtual ~NTService(); static NTService* instance(); bool install(char *,bool = false); bool uninstall(char *); void run(int, char**); virtual void stop(); int options(int,char **); void usage(const char *); void setDebug() { debug_ = true; } bool getDebug() const { return debug_; } }; } // End of Tango namespace #endif tango-8.1.2c+dfsg.orig/lib/cpp/server/attrdesc.cpp0000644000175000017500000006220012205375142020747 0ustar piccapiccastatic const char *RcsId = "$Id: attrdesc.cpp 22213 2013-03-07 14:32:56Z taurel $\n$Name$"; //+============================================================================ // // file : attrdesc.cpp // // description : C++ source code for the BlackBoxElt and BlackBox // classes. These classes are used to implement the // tango device server black box. There is one // black box for each Tango device. This black box // keeps info. on all the activities on a device. // A client is able to retrieve these data via a Device // attribute // // project : TANGO // // author(s) : A.Gotz + E.Taurel // // Copyright (C) : 2004,2005,2006,2007,2008,2009,2010,2011,2012,2013 // European Synchrotron Radiation Facility // BP 220, Grenoble 38043 // FRANCE // // This file is part of Tango. // // Tango 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. // // Tango 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 Tango. If not, see . // // $Revision: 22213 $ // //-============================================================================ #if HAVE_CONFIG_H #include #endif #include #include namespace Tango { //+------------------------------------------------------------------------- // // method : Attr::Attr // // description : Constructor for the Attr class. // This constructor simply set the internal values // //-------------------------------------------------------------------------- Attr::Attr(const char *att_name,long att_type,AttrWriteType att_writable, const char *assoc) :name(att_name),writable(att_writable),type(att_type),assoc_name(assoc), mem(false),mem_init(true),ext(new AttrExt) { format = Tango::SCALAR; ext->fire_change_event = false; ext->check_change_event = true; ext->fire_archive_event = false; ext->check_archive_event = true; ext->fire_dr_event = false; if (name != "State") check_type(); if ((writable == Tango::WRITE) && (assoc_name != AssocWritNotSpec)) { cout3 << "Attr::Attr throwing exception" << endl; TangoSys_OMemStream o; o << "Attribute : " << name << ": "; o << " Associated attribute is not supported" << ends; Except::throw_exception((const char *)API_AttrWrongDefined, o.str(), (const char *)"Attr::Attr"); } if ((writable == Tango::READ_WITH_WRITE) && (assoc_name == AssocWritNotSpec)) { cout3 << "Attr::Attr throwing exception" << endl; TangoSys_OMemStream o; o << "Attribute : " << name << ": "; o << " Associated attribute not defined" << ends; Except::throw_exception((const char *)API_AttrWrongDefined, o.str(), (const char *)"Attr::Attr"); } if (writable == READ_WRITE) assoc_name = name; } Attr::Attr(const char *att_name,long att_type,DispLevel level, AttrWriteType att_writable, const char *assoc) :name(att_name),writable(att_writable),type(att_type),assoc_name(assoc),mem(false), ext(new AttrExt(level)) { format = Tango::SCALAR; if (name != "State") check_type(); if ((writable == Tango::WRITE) && (assoc_name != AssocWritNotSpec)) { cout3 << "Attr::Attr throwing exception" << endl; TangoSys_OMemStream o; o << "Attribute : " << name << ": "; o << " Associated attribute is not supported" << ends; Except::throw_exception((const char *)API_AttrWrongDefined, o.str(), (const char *)"Attr::Attr"); } if ((writable == Tango::READ_WITH_WRITE) && (assoc_name == AssocWritNotSpec)) { cout3 << "Attr::Attr throwing exception" << endl; TangoSys_OMemStream o; o << "Attribute : " << name << ": "; o << " Associated attribute not defined" << ends; Except::throw_exception((const char *)API_AttrWrongDefined, o.str(), (const char *)"Attr::Attr"); } if (writable == READ_WRITE) assoc_name = name; } Attr::~Attr() { #ifndef HAS_UNIQUE_PTR delete ext; #endif } //+------------------------------------------------------------------------- // // method : Attr::check_type // // description : This method checks data type and throws an exception // in case of unsupported data type // //-------------------------------------------------------------------------- void Attr::check_type() { bool unsuported = true; if (type == Tango::DEV_SHORT) unsuported = false; else if (type == Tango::DEV_LONG) unsuported = false; else if (type == Tango::DEV_LONG64) unsuported = false; else if (type == Tango::DEV_DOUBLE) unsuported = false; else if (type == Tango::DEV_STRING) unsuported = false; else if (type == Tango::DEV_FLOAT) unsuported = false; else if (type == Tango::DEV_BOOLEAN) unsuported = false; else if (type == Tango::DEV_USHORT) unsuported = false; else if (type == Tango::DEV_UCHAR) unsuported = false; else if (type == Tango::DEV_ULONG) unsuported = false; else if (type == Tango::DEV_ULONG64) unsuported = false; else if (type == Tango::DEV_STATE) unsuported = false; else if (type == Tango::DEV_ENCODED) unsuported = false; if (unsuported == true) { cout3 << "Attr::check_type throwing exception" << endl; TangoSys_OMemStream o; o << "Attribute : " << name << ": "; o << " Data type is not supported" << ends; Except::throw_exception((const char *)API_AttrWrongDefined, o.str(), (const char *)"Attr::check_type"); } } //+------------------------------------------------------------------------- // // method : Attr::set_default_properties // // description : This method set the default user properties in the // Attr object. At this level, each attribute property // is represented by one instance of the Attrproperty // class. // //-------------------------------------------------------------------------- void Attr::set_default_properties(UserDefaultAttrProp &prop_list) { enum ranges_names { min_value, max_value, min_alarm, max_alarm, min_warning, max_warning, delta_val, delta_t, num_ranges }; bitset ranges; if ((prop_list.label.empty() == false) && (TG_strcasecmp(prop_list.label.c_str(),AlrmValueNotSpec) != 0) && (TG_strcasecmp(prop_list.label.c_str(),NotANumber) != 0)) user_default_properties.push_back(AttrProperty("label",prop_list.label)); if (prop_list.description.empty() == false && (TG_strcasecmp(prop_list.description.c_str(),AlrmValueNotSpec) != 0) && (TG_strcasecmp(prop_list.description.c_str(),NotANumber) != 0)) user_default_properties.push_back(AttrProperty("description",prop_list.description)); if (prop_list.unit.empty() == false && (TG_strcasecmp(prop_list.unit.c_str(),AlrmValueNotSpec) != 0) && (TG_strcasecmp(prop_list.unit.c_str(),NotANumber) != 0)) user_default_properties.push_back(AttrProperty("unit",prop_list.unit)); if (prop_list.standard_unit.empty() == false && (TG_strcasecmp(prop_list.standard_unit.c_str(),AlrmValueNotSpec) != 0) && (TG_strcasecmp(prop_list.standard_unit.c_str(),NotANumber) != 0)) user_default_properties.push_back(AttrProperty("standard_unit",prop_list.standard_unit)); if (prop_list.display_unit.empty() == false && (TG_strcasecmp(prop_list.display_unit.c_str(),AlrmValueNotSpec) != 0) && (TG_strcasecmp(prop_list.display_unit.c_str(),NotANumber) != 0)) user_default_properties.push_back(AttrProperty("display_unit",prop_list.display_unit)); if (prop_list.format.empty() == false && (TG_strcasecmp(prop_list.format.c_str(),AlrmValueNotSpec) != 0) && (TG_strcasecmp(prop_list.format.c_str(),NotANumber) != 0)) user_default_properties.push_back(AttrProperty("format",prop_list.format)); if (prop_list.min_value.empty() == false && (TG_strcasecmp(prop_list.min_value.c_str(),AlrmValueNotSpec) != 0) && (TG_strcasecmp(prop_list.min_value.c_str(),NotANumber) != 0)) { validate_def_prop(prop_list.min_value, "min_value"); user_default_properties.push_back(AttrProperty("min_value",prop_list.min_value)); ranges.set(min_value); } if (prop_list.max_value.empty() == false && (TG_strcasecmp(prop_list.max_value.c_str(),AlrmValueNotSpec) != 0) && (TG_strcasecmp(prop_list.max_value.c_str(),NotANumber) != 0)) { validate_def_prop(prop_list.max_value, "max_value"); user_default_properties.push_back(AttrProperty("max_value",prop_list.max_value)); ranges.set(max_value); } if (prop_list.min_alarm.empty() == false && (TG_strcasecmp(prop_list.min_alarm.c_str(),AlrmValueNotSpec) != 0) && (TG_strcasecmp(prop_list.min_alarm.c_str(),NotANumber) != 0)) { validate_def_prop(prop_list.min_alarm, "min_alarm"); user_default_properties.push_back(AttrProperty("min_alarm",prop_list.min_alarm)); ranges.set(min_alarm); } if (prop_list.max_alarm.empty() == false && (TG_strcasecmp(prop_list.max_alarm.c_str(),AlrmValueNotSpec) != 0) && (TG_strcasecmp(prop_list.max_alarm.c_str(),NotANumber) != 0)) { validate_def_prop(prop_list.max_alarm, "max_alarm"); user_default_properties.push_back(AttrProperty("max_alarm",prop_list.max_alarm)); ranges.set(max_alarm); } if (prop_list.min_warning.empty() == false && (TG_strcasecmp(prop_list.min_warning.c_str(),AlrmValueNotSpec) != 0) && (TG_strcasecmp(prop_list.min_warning.c_str(),NotANumber) != 0)) { validate_def_prop(prop_list.min_warning, "min_warning"); user_default_properties.push_back(AttrProperty("min_warning",prop_list.min_warning)); ranges.set(min_warning); } if (prop_list.max_warning.empty() == false && (TG_strcasecmp(prop_list.max_warning.c_str(),AlrmValueNotSpec) != 0) && (TG_strcasecmp(prop_list.max_warning.c_str(),NotANumber) != 0)) { validate_def_prop(prop_list.max_warning, "max_warning"); user_default_properties.push_back(AttrProperty("max_warning",prop_list.max_warning)); ranges.set(max_warning); } if (prop_list.delta_val.empty() == false && (TG_strcasecmp(prop_list.delta_val.c_str(),AlrmValueNotSpec) != 0) && (TG_strcasecmp(prop_list.delta_val.c_str(),NotANumber) != 0)) { validate_def_prop(prop_list.delta_val, "delta_val"); user_default_properties.push_back(AttrProperty("delta_val",prop_list.delta_val)); ranges.set(delta_val); } if (prop_list.delta_t.empty() == false && (TG_strcasecmp(prop_list.delta_t.c_str(),AlrmValueNotSpec) != 0) && (TG_strcasecmp(prop_list.delta_t.c_str(),"0") != 0) && (TG_strcasecmp(prop_list.delta_t.c_str(),NotANumber) != 0)) { TangoSys_MemStream str; str.precision(TANGO_FLOAT_PRECISION); long lg; str << prop_list.delta_t; if(!(str >> lg && str.eof())) throw_invalid_def_prop("delta_t","DevLong"); user_default_properties.push_back(AttrProperty("delta_t",prop_list.delta_t)); ranges.set(delta_t); } if (prop_list.abs_change.empty() == false && (TG_strcasecmp(prop_list.abs_change.c_str(),AlrmValueNotSpec) != 0) && (TG_strcasecmp(prop_list.abs_change.c_str(),NotANumber) != 0)) { validate_def_change_prop(prop_list.abs_change,"abs_change"); user_default_properties.push_back(AttrProperty("abs_change",prop_list.abs_change)); } if (prop_list.rel_change.empty() == false && (TG_strcasecmp(prop_list.rel_change.c_str(),AlrmValueNotSpec) != 0) && (TG_strcasecmp(prop_list.rel_change.c_str(),NotANumber) != 0)) { validate_def_change_prop(prop_list.rel_change,"rel_change"); user_default_properties.push_back(AttrProperty("rel_change",prop_list.rel_change)); } TangoSys_MemStream def_event_period; def_event_period << (int)(DEFAULT_EVENT_PERIOD); if (prop_list.period.empty() == false && (TG_strcasecmp(prop_list.period.c_str(),AlrmValueNotSpec) != 0) && (prop_list.period != def_event_period.str()) && (TG_strcasecmp(prop_list.period.c_str(),NotANumber) != 0)) { TangoSys_MemStream str; str.precision(TANGO_FLOAT_PRECISION); int i; str << prop_list.period; if(!(str >> i && str.eof())) throw_invalid_def_prop("event_period","DevLong"); user_default_properties.push_back(AttrProperty("event_period",prop_list.period)); } if (prop_list.archive_abs_change.empty() == false && (TG_strcasecmp(prop_list.archive_abs_change.c_str(),AlrmValueNotSpec) != 0) && (TG_strcasecmp(prop_list.archive_abs_change.c_str(),NotANumber) != 0)) { validate_def_change_prop(prop_list.archive_abs_change,"archive_abs_change"); user_default_properties.push_back(AttrProperty("archive_abs_change",prop_list.archive_abs_change)); } if (prop_list.archive_rel_change.empty() == false && (TG_strcasecmp(prop_list.archive_rel_change.c_str(),AlrmValueNotSpec) != 0) && (TG_strcasecmp(prop_list.archive_rel_change.c_str(),NotANumber) != 0)) { validate_def_change_prop(prop_list.archive_rel_change,"archive_rel_change"); user_default_properties.push_back(AttrProperty("archive_rel_change",prop_list.archive_rel_change)); } TangoSys_MemStream def_archive_period; def_archive_period << (int)(INT_MAX); if (prop_list.archive_period.empty() == false && (TG_strcasecmp(prop_list.archive_period.c_str(),AlrmValueNotSpec) != 0) && (prop_list.archive_period != def_archive_period.str()) && (TG_strcasecmp(prop_list.archive_period.c_str(),NotANumber) != 0)) { TangoSys_MemStream str; str.precision(TANGO_FLOAT_PRECISION); int i; str << prop_list.archive_period; if(!(str >> i && str.eof())) throw_invalid_def_prop("archive_period","DevLong"); user_default_properties.push_back(AttrProperty("archive_period",prop_list.archive_period)); } if(ranges.test(min_value) && ranges.test(max_value)) { double min = 0.0, max = 0.0; convert_def_prop(prop_list.min_value, min); convert_def_prop(prop_list.max_value, max); if(min >= max) throw_incoherent_def_prop("min_value","max_value"); } if(ranges.test(min_alarm) && ranges.test(max_alarm)) { double min = 0.0, max = 0.0; convert_def_prop(prop_list.min_alarm, min); convert_def_prop(prop_list.max_alarm, max); if(min >= max) throw_incoherent_def_prop("min_alarm","max_alarm"); } if(ranges.test(min_warning) && ranges.test(max_warning)) { double min = 0.0, max = 0.0; convert_def_prop(prop_list.min_warning, min); convert_def_prop(prop_list.max_warning, max); if(min >= max) throw_incoherent_def_prop("min_warning","max_warning"); } if(ranges.test(delta_val) ^ ranges.test(delta_t)) { string err_msg = "Just one of the user default properties : delta_val or delta_t is set. Both or none of the values have to be set"; Except::throw_exception(API_IncoherentValues,err_msg,"Attr::set_default_properties()"); } } void Attr::convert_def_prop(const string &val, double &db) { TangoSys_MemStream str; str.precision(TANGO_FLOAT_PRECISION); str.str(""); str.clear(); str << val; str >> db; } void Attr::validate_def_prop(const string &val, const char* prop) { TangoSys_MemStream str; str.precision(TANGO_FLOAT_PRECISION); str.str(""); str.clear(); str << val; DevShort sh; DevLong lg; DevLong64 lg64; DevDouble db; DevFloat fl; DevUShort ush; DevULong ulg; DevULong64 ulg64; switch (type) { case Tango::DEV_SHORT: if (!(str >> sh && str.eof())) throw_invalid_def_prop(prop,"DevShort"); break; case Tango::DEV_LONG: if (!(str >> lg && str.eof())) throw_invalid_def_prop(prop,"DevLong"); break; case Tango::DEV_LONG64: if (!(str >> lg64 && str.eof())) throw_invalid_def_prop(prop,"DevLong64"); break; case Tango::DEV_DOUBLE: if (!(str >> db && str.eof())) throw_invalid_def_prop(prop,"DevDouble"); break; case Tango::DEV_FLOAT: if (!(str >> fl && str.eof())) throw_invalid_def_prop(prop,"DevFloat"); break; case Tango::DEV_USHORT: if (!(str >> ush && str.eof())) throw_invalid_def_prop(prop,"DevUShort"); break; case Tango::DEV_UCHAR: if (!(str >> sh && str.eof())) throw_invalid_def_prop(prop,"DevUChar"); break; case Tango::DEV_ULONG: if (!(str >> ulg && str.eof())) throw_invalid_def_prop(prop,"DevULong"); break; case Tango::DEV_ULONG64: if (!(str >> ulg64 && str.eof())) throw_invalid_def_prop(prop,"DevULong64"); break; case Tango::DEV_ENCODED: if (!(str >> sh && str.eof())) throw_invalid_def_prop(prop,"DevUChar"); break; } } void Attr::validate_def_change_prop(const string &val, const char * prop) { TangoSys_MemStream str; str.precision(TANGO_FLOAT_PRECISION); string change_prop_str = val; double db; size_t pos = change_prop_str.find(','); if(pos != string::npos) { string prop_min = change_prop_str.substr(0,pos); string prop_max = change_prop_str.erase(0,pos+1); str << prop_min; if (!(str >> db && str.eof())) throw_invalid_def_prop(prop,"DevDouble or \"DevDouble,DevDouble\""); str.str(""); str.clear(); str << prop_max; if (!(str >> db && str.eof())) throw_invalid_def_prop(prop,"DevDouble or \"DevDouble,DevDouble\""); } else { str.str(""); str.clear(); str << change_prop_str; if (!(str >> db && str.eof())) throw_invalid_def_prop(prop,"DevDouble or \"DevDouble,DevDouble\""); } } void Attr::throw_incoherent_def_prop(const char* min, const char* max) { string err_msg = "User default property " + string(min) + " for attribute : " + get_name() + " is grater then or equal " + string(max); Except::throw_exception(API_IncoherentValues,err_msg,"Attr::set_default_properties()"); } void Attr::throw_invalid_def_prop(const char* prop, const char* type) { string err_msg = "User default property " + string(prop) + " for attribute : " + get_name() + " is defined in unsupported format. Expected " + string(type); Except::throw_exception(API_IncompatibleAttrDataType,err_msg,"Attr::set_default_properties()"); } //+------------------------------------------------------------------------- // // method : Attr::set_memorized // // description : This method set the attribute as memorized in database // This is allowed only for scalar attribute and for // writable one // //-------------------------------------------------------------------------- void Attr::set_memorized() { if (format != Tango::SCALAR) { cout3 << "Attr::set_memorized() throwing exception" << endl; TangoSys_OMemStream o; o << "Attribute : " << name; o << " is not scalar and can not be memorized" << ends; Except::throw_exception((const char *)API_AttrWrongDefined, o.str(), (const char *)"Attr::set_memorized"); } if ((type == DEV_STATE) || (type == DEV_ENCODED)) { cout3 << "Attr::set_memorized() throwing exception" << endl; TangoSys_OMemStream o; o << "Attribute : " << name; o << " can not be memorized" << ends; Except::throw_exception((const char *)API_AttrWrongDefined, o.str(), (const char *)"Attr::set_memorized"); } if ((writable == READ) || (writable == READ_WITH_WRITE)) { cout3 << "Attr::set_memorized() throwing exception" << endl; TangoSys_OMemStream o; o << "Attribute : " << name; o << " is not writable and therefore can not be memorized" << ends; Except::throw_exception((const char *)API_AttrWrongDefined, o.str(), (const char *)"Attr::set_memorized"); } mem = true; } //+------------------------------------------------------------------------- // // method : SpectrumAttr::SpectrumAttr // // description : Constructor for the SpectrumAttr class. // This constructor simply set the internal values // //-------------------------------------------------------------------------- SpectrumAttr::SpectrumAttr(const char *att_name,long att_type,long x) :Attr(att_name,att_type),ext(Tango_NullPtr) { format = Tango::SPECTRUM; if (x <= 0) { cout3 << "SpectrumAttr::SpectrumAttr throwing exception" << endl; TangoSys_OMemStream o; o << "Attribute : " << name << ": "; o << " Maximum x dim. wrongly defined" << ends; Except::throw_exception((const char *)API_AttrWrongDefined, o.str(), (const char *)"SpectrumAttr::SpectrumAttr"); } if (type == DEV_ENCODED) { cout3 << "SpectrumAttr::SpectrumAttr throwing exception" << endl; TangoSys_OMemStream o; o << "Attribute: " << name << ": "; o << "DevEncode data type allowed only for SCALAR attribute" << ends; Except::throw_exception((const char *)API_AttrWrongDefined,o.str(), (const char *)"SpectrumAttr::SpectrumAttr"); } max_x = x; } SpectrumAttr::SpectrumAttr(const char *att_name,long att_type,Tango::AttrWriteType w_type,long x) :Attr(att_name,att_type,w_type),ext(Tango_NullPtr) { format = Tango::SPECTRUM; if (x <= 0) { cout3 << "SpectrumAttr::SpectrumAttr throwing exception" << endl; TangoSys_OMemStream o; o << "Attribute : " << name << ": "; o << " Maximum x dim. wrongly defined" << ends; Except::throw_exception((const char *)API_AttrWrongDefined, o.str(), (const char *)"SpectrumAttr::SpectrumAttr"); } if (type == DEV_ENCODED) { cout3 << "SpectrumAttr::SpectrumAttr throwing exception" << endl; TangoSys_OMemStream o; o << "Attribute: " << name << ": "; o << "DevEncode data type allowed only for SCALAR attribute" << ends; Except::throw_exception((const char *)API_AttrWrongDefined,o.str(), (const char *)"SpectrumAttr::SpectrumAttr"); } max_x = x; } SpectrumAttr::SpectrumAttr(const char *att_name,long att_type,long x,DispLevel level) :Attr(att_name,att_type,level),ext(Tango_NullPtr) { format = Tango::SPECTRUM; if (x <= 0) { cout3 << "SpectrumAttr::SpectrumAttr throwing exception" << endl; TangoSys_OMemStream o; o << "Attribute : " << name << ": "; o << " Maximum x dim. wrongly defined" << ends; Except::throw_exception((const char *)API_AttrWrongDefined, o.str(), (const char *)"SpectrumAttr::SpectrumAttr"); } if (type == DEV_ENCODED) { cout3 << "SpectrumAttr::SpectrumAttr throwing exception" << endl; TangoSys_OMemStream o; o << "Attribute: " << name << ": "; o << "DevEncode data type allowed only for SCALAR attribute" << ends; Except::throw_exception((const char *)API_AttrWrongDefined,o.str(), (const char *)"SpectrumAttr::SpectrumAttr"); } max_x = x; } SpectrumAttr::SpectrumAttr(const char *att_name,long att_type,Tango::AttrWriteType w_type,long x,DispLevel level) :Attr(att_name,att_type,level,w_type),ext(Tango_NullPtr) { format = Tango::SPECTRUM; if (x <= 0) { cout3 << "SpectrumAttr::SpectrumAttr throwing exception" << endl; TangoSys_OMemStream o; o << "Attribute : " << name << ": "; o << " Maximum x dim. wrongly defined" << ends; Except::throw_exception((const char *)API_AttrWrongDefined, o.str(), (const char *)"SpectrumAttr::SpectrumAttr"); } if (type == DEV_ENCODED) { cout3 << "SpectrumAttr::SpectrumAttr throwing exception" << endl; TangoSys_OMemStream o; o << "Attribute: " << name << ": "; o << "DevEncode data type allowed only for SCALAR attribute" << ends; Except::throw_exception((const char *)API_AttrWrongDefined,o.str(), (const char *)"SpectrumAttr::SpectrumAttr"); } max_x = x; } //+------------------------------------------------------------------------- // // method : ImageAttr::ImageAttr // // description : Constructor for the ImageAttr class. // This constructor simply set the internal values // //-------------------------------------------------------------------------- ImageAttr::ImageAttr(const char *att_name,long att_type,long x,long y) :SpectrumAttr(att_name,att_type,x),ext(Tango_NullPtr) { format = Tango::IMAGE; if (y <= 0) { cout3 << "ImageAttr::ImageAttr throwing exception" << endl; TangoSys_OMemStream o; o << "Attribute : " << name << ": "; o << " Maximum y dim. wrongly defined" << ends; Except::throw_exception((const char *)API_AttrWrongDefined, o.str(), (const char *)"ImageAttr::ImageAttr"); } max_y = y; } ImageAttr::ImageAttr(const char *att_name,long att_type,Tango::AttrWriteType w_type, long x,long y) :SpectrumAttr(att_name,att_type,w_type,x),ext(Tango_NullPtr) { format = Tango::IMAGE; if (y <= 0) { cout3 << "ImageAttr::ImageAttr throwing exception" << endl; TangoSys_OMemStream o; o << "Attribute : " << name << ": "; o << " Maximum y dim. wrongly defined" << ends; Except::throw_exception((const char *)API_AttrWrongDefined, o.str(), (const char *)"ImageAttr::ImageAttr"); } max_y = y; } ImageAttr::ImageAttr(const char *att_name,long att_type,long x, long y,DispLevel level) :SpectrumAttr(att_name,att_type,x,level),ext(Tango_NullPtr) { format = Tango::IMAGE; if (y <= 0) { cout3 << "ImageAttr::ImageAttr throwing exception" << endl; TangoSys_OMemStream o; o << "Attribute : " << name << ": "; o << " Maximum y dim. wrongly defined" << ends; Except::throw_exception((const char *)API_AttrWrongDefined, o.str(), (const char *)"ImageAttr::ImageAttr"); } max_y = y; } ImageAttr::ImageAttr(const char *att_name,long att_type,Tango::AttrWriteType w_type, long x, long y,DispLevel level) :SpectrumAttr(att_name,att_type,w_type,x,level),ext(Tango_NullPtr) { format = Tango::IMAGE; if (y <= 0) { cout3 << "ImageAttr::ImageAttr throwing exception" << endl; TangoSys_OMemStream o; o << "Attribute : " << name << ": "; o << " Maximum y dim. wrongly defined" << ends; Except::throw_exception((const char *)API_AttrWrongDefined, o.str(), (const char *)"ImageAttr::ImageAttr"); } max_y = y; } } // End of Tango namespace tango-8.1.2c+dfsg.orig/lib/cpp/server/attrmanip.cpp0000644000175000017500000000563412205375142021145 0ustar piccapiccastatic const char *RcsId = "$Id: attrmanip.cpp 22213 2013-03-07 14:32:56Z taurel $\n$Name$"; //+============================================================================ // // file : attrmanip.cpp // // description : C++ source code for the tango attribute manipulator // // project : TANGO // // author(s) : E.Taurel // // Copyright (C) : 2004,2005,2006,2007,2008,2009,2010,2011,2012,2013 // European Synchrotron Radiation Facility // BP 220, Grenoble 38043 // FRANCE // // This file is part of Tango. // // Tango 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. // // Tango 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 Tango. If not, see . // // $Revision: 22213 $ // //-============================================================================ #if HAVE_CONFIG_H #include #endif #include #include namespace Tango { void execute_manip(ostream &o_str, string &manip) { // // Set the ostream according to the manipulator // if (manip == "fixed") { o_str.setf(ios::fixed,ios::floatfield); return; } else if (manip == "scientific") { o_str.setf(ios::scientific,ios::floatfield); return; } else if (manip == "uppercase") { o_str.setf(ios::uppercase); return; } else if (manip == "showpoint") { o_str.setf(ios::showpoint); return; } else if (manip == "showpos") { o_str.setf(ios::showpos); return; } else if (manip.substr(0,13) == "setprecision(") { string num_str = manip.substr(13,manip.size() - 14); TangoSys_MemStream o; long num; o << num_str; o >> num; o_str.precision(num); } else if (manip.substr(0,5) == "setw(") { string num_str = manip.substr(5,manip.size() - 6); TangoSys_MemStream o; long num; o << num_str; o >> num; o_str.width(num); } } //#ifndef TANGO_HAS_LOG4TANGO ostream &operator<<(ostream &o_str,const AttrManip &manip) { // // Extract each manipulator (; separated) and call the execute_manip // for each one // string::size_type start = 0; string str; string::size_type pos; while ((pos = manip.format.find(';',start)) != string::npos) { str = manip.format.substr(start,pos - start); start = pos + 1; execute_manip(o_str,str); } if (start != manip.format.size()) { str = manip.format.substr(start); execute_manip(o_str,str); } return o_str; } //#endif // TANGO_HAS_LOG4TANGO } // End of tango namespace tango-8.1.2c+dfsg.orig/lib/cpp/server/logstream.h0000644000175000017500000000636212205375142020607 0ustar piccapicca//+============================================================================= // // file : logstream.h // // description : A TLS helper class // // project : TANGO // // author(s) : N.Leclercq - SOLEIL // // Copyright (C) : 2004,2005,2006,2007,2008,2009,2010,2011,2012,2013 // European Synchrotron Radiation Facility // BP 220, Grenoble 38043 // FRANCE // // This file is part of Tango. // // Tango 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. // // Tango 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 Tango. If not, see . // // //-============================================================================= #ifndef _LOG_STREAM_H #define _LOG_STREAM_H #ifdef TANGO_HAS_LOG4TANGO //----------------------------------------------------------------------------- // FORWARD DECLARATIONS //----------------------------------------------------------------------------- namespace log4tango { class LoggerStream; } // namespace log4tango namespace Tango { class Attr; class DevFailed; class Attribute; class AttrManip; class AttrProperty; class DevVarCharArray; class DevVarShortArray; class DevVarLongArray; class DevVarFloatArray; class DevVarDoubleArray; class DevVarUShortArray; class DevVarULongArray; class DevVarStringArray; } // namespace Tango //----------------------------------------------------------------------------- // MISC. OPERATORS TO PUSH TANGO TYPES INTO LOG4TANGO STREAMS //----------------------------------------------------------------------------- namespace Tango { log4tango::LoggerStream& operator<< (log4tango::LoggerStream&, const DevFailed&); log4tango::LoggerStream& operator<< (log4tango::LoggerStream&, const DevVarCharArray&); log4tango::LoggerStream& operator<< (log4tango::LoggerStream&, const DevVarShortArray&); log4tango::LoggerStream& operator<< (log4tango::LoggerStream&, const DevVarLongArray&); log4tango::LoggerStream& operator<< (log4tango::LoggerStream&, const DevVarFloatArray&); log4tango::LoggerStream& operator<< (log4tango::LoggerStream&, const DevVarDoubleArray&); log4tango::LoggerStream& operator<< (log4tango::LoggerStream&, const DevVarUShortArray&); log4tango::LoggerStream& operator<< (log4tango::LoggerStream&, const DevVarULongArray&); log4tango::LoggerStream& operator<< (log4tango::LoggerStream&, const DevVarStringArray&); log4tango::LoggerStream& operator<< (log4tango::LoggerStream&, const Attribute&); log4tango::LoggerStream& operator<< (log4tango::LoggerStream&, const Attr&); log4tango::LoggerStream& operator<< (log4tango::LoggerStream&, const AttrManip&); log4tango::LoggerStream& operator<< (log4tango::LoggerStream&, const AttrProperty&); } // Tango namespace #endif // TANGO_HAS_LOG4TANGO #endif // _LOG_STREAM_H tango-8.1.2c+dfsg.orig/lib/cpp/server/jpeg_mmx/0000755000175000017500000000000012205375306020242 5ustar piccapiccatango-8.1.2c+dfsg.orig/lib/cpp/server/jpeg_mmx/jpeg_dct_mmx.cpp0000644000175000017500000016360112205375141023412 0ustar piccapicca///============================================================================= // // file : jpeg_dct_mmx.cpp // // description : Simple jpeg coding/decoding library // Discrete Cosine Transform (8x8) MMX code // // project : TANGO // // author(s) : JL Pons // // Copyright (C) : 2004,2005,2006,2007,2008,2009,2010,2011,2012,2013 // European Synchrotron Radiation Facility // BP 220, Grenoble 38043 // FRANCE // // This file is part of Tango. // // Tango 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. // // Tango 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 Tango. If not, see . // // $Revision: 22213 $ // // $Log$ // Revision 1.9 2009/09/02 08:01:43 taurel // - Fix linker problem when used with gcc release < 4 // // Revision 1.8 2009/09/01 14:02:07 taurel // - Fix a problem for old gcc release in the asm code. // // Revision 1.7 2009/08/27 07:24:30 taurel // - Commit after another merge with Release_7_0_2-bugfixes branch // // Revision 1.6.2.1 2009/08/25 14:03:10 taurel // - First attempt to clarify the gcc PIC problem // // Revision 1.6 2009/04/20 14:55:58 jlpons // Added GPL header, changed memory allocation to C++ fashion. // //============================================================================= // MMX implementation has been provided by Intel at AP-922 #include "jpeg_lib.h" #ifdef JPG_USE_ASM #ifdef _WINDOWS // Visual C++ align directive #define ALIGN8 __declspec(align(8)) #else // gcc align directive #define ALIGN8 __attribute__ ((aligned (8))) #endif #define BITS_FRW_ACC 3 //// 2 or 3 for accuracy #define SHIFT_FRW_COL BITS_FRW_ACC #define SHIFT_FRW_ROW (BITS_FRW_ACC + 14) #define RND_FRW_ROW (1 << (SHIFT_FRW_ROW-1)) // MMX constants ALIGN8 short __jpmm_one_corr[] = {1,1,1,1}; ALIGN8 long __jpmm_round_frw_row[] = {RND_FRW_ROW,RND_FRW_ROW}; ALIGN8 short __jpmm_tg_1_16[] = { 13036, 13036, 13036, 13036 }; //tg * (2<<16) + 0.5 ALIGN8 short __jpmm_tg_2_16[] = { 27146, 27146, 27146, 27146 }; //tg * (2<<16) + 0.5 ALIGN8 short __jpmm_tg_3_16[] = { -21746, -21746, -21746, -21746 }; //tg * (2<<16) + 0.5 ALIGN8 short __jpmm_cos_4_16[] = { -19195, -19195, -19195, -19195 }; //cos * (2<<16) + 0.5 ALIGN8 short __jpmm_ocos_4_16[] = { 23170, 23170, 23170, 23170 }; //cos * (2<<15) + 0.5 ALIGN8 short __jpmm_row_tab_frw[] = { // forward_dct coeff table //row0 16384, 16384, 21407, -8867, // w09 w01 w08 w00 16384, 16384, 8867, -21407, // w13 w05 w12 w04 16384, -16384, 8867, 21407, // w11 w03 w10 w02 -16384, 16384, -21407, -8867, // w15 w07 w14 w06 22725, 12873, 19266, -22725, // w22 w20 w18 w16 19266, 4520, -4520, -12873, // w23 w21 w19 w17 12873, 4520, 4520, 19266, // w30 w28 w26 w24 -22725, 19266, -12873, -22725, // w31 w29 w27 w25 //row1 22725, 22725, 29692, -12299, // w09 w01 w08 w00 22725, 22725, 12299, -29692, // w13 w05 w12 w04 22725, -22725, 12299, 29692, // w11 w03 w10 w02 -22725, 22725, -29692, -12299, // w15 w07 w14 w06 31521, 17855, 26722, -31521, // w22 w20 w18 w16 26722, 6270, -6270, -17855, // w23 w21 w19 w17 17855, 6270, 6270, 26722, // w30 w28 w26 w24 -31521, 26722, -17855, -31521, // w31 w29 w27 w25 //row2 21407, 21407, 27969, -11585, // w09 w01 w08 w00 21407, 21407, 11585, -27969, // w13 w05 w12 w04 21407, -21407, 11585, 27969, // w11 w03 w10 w02 -21407, 21407, -27969, -11585, // w15 w07 w14 w06 29692, 16819, 25172, -29692, // w22 w20 w18 w16 25172, 5906, -5906, -16819, // w23 w21 w19 w17 16819, 5906, 5906, 25172, // w30 w28 w26 w24 -29692, 25172, -16819, -29692, // w31 w29 w27 w25 //row3 19266, 19266, 25172, -10426, // w09 w01 w08 w00 19266, 19266, 10426, -25172, // w13 w05 w12 w04 19266, -19266, 10426, 25172, // w11 w03 w10 w02 -19266, 19266, -25172, -10426, // w15 w07 w14 w06, 26722, 15137, 22654, -26722, // w22 w20 w18 w16 22654, 5315, -5315, -15137, // w23 w21 w19 w17 15137, 5315, 5315, 22654, // w30 w28 w26 w24 -26722, 22654, -15137, -26722, // w31 w29 w27 w25, //row4 16384, 16384, 21407, -8867, // w09 w01 w08 w00 16384, 16384, 8867, -21407, // w13 w05 w12 w04 16384, -16384, 8867, 21407, // w11 w03 w10 w02 -16384, 16384, -21407, -8867, // w15 w07 w14 w06 22725, 12873, 19266, -22725, // w22 w20 w18 w16 19266, 4520, -4520, -12873, // w23 w21 w19 w17 12873, 4520, 4520, 19266, // w30 w28 w26 w24 -22725, 19266, -12873, -22725, // w31 w29 w27 w25 //row5 19266, 19266, 25172, -10426, // w09 w01 w08 w00 19266, 19266, 10426, -25172, // w13 w05 w12 w04 19266, -19266, 10426, 25172, // w11 w03 w10 w02 -19266, 19266, -25172, -10426, // w15 w07 w14 w06 26722, 15137, 22654, -26722, // w22 w20 w18 w16 22654, 5315, -5315, -15137, // w23 w21 w19 w17 15137, 5315, 5315, 22654, // w30 w28 w26 w24 -26722, 22654, -15137, -26722, // w31 w29 w27 w25 //row6 21407, 21407, 27969, -11585, // w09 w01 w08 w00 21407, 21407, 11585, -27969, // w13 w05 w12 w04 21407, -21407, 11585, 27969, // w11 w03 w10 w02 -21407, 21407, -27969, -11585, // w15 w07 w14 w06, 29692, 16819, 25172, -29692, // w22 w20 w18 w16 25172, 5906, -5906, -16819, // w23 w21 w19 w17 16819, 5906, 5906, 25172, // w30 w28 w26 w24 -29692, 25172, -16819, -29692, // w31 w29 w27 w25, //row7 22725, 22725, 29692, -12299, // w09 w01 w08 w00 22725, 22725, 12299, -29692, // w13 w05 w12 w04 22725, -22725, 12299, 29692, // w11 w03 w10 w02 -22725, 22725, -29692, -12299, // w15 w07 w14 w06, 31521, 17855, 26722, -31521, // w22 w20 w18 w16 26722, 6270, -6270, -17855, // w23 w21 w19 w17 17855, 6270, 6270, 26722, // w30 w28 w26 w24 -31521, 26722, -17855, -31521 // w31 w29 w27 w25 }; // // Unfortunately with gcc, code like "psubw mm2,_128mm" is considered like non PIC // and the scanelf utility complains about this. This is also a problem for distribution like // Debian. Why, I don't know !! // This is a known problem and some WEB page have been written relatedto this issue. // I have used the page http://www.gentoo.org/proj/en/hardened/pic-fix-guide.xml // Within this page, they give 3 pssobilities to remove this kind of code. // I have use case number 1. Case number 2 and 3 are not really usable because // all the registers are already used (Not in all functions but in most of them) // Therefore, every variable defined previously are "manually" loaded into the MMX registers // using the stack as temporary storage // // 13036 -> 0x32ec // 27146 -> 0x6a0a // -21746 -> 0xab0e // -19195 -> 0xb505 // 23170 -> 0x5a82 // // This problem is the reason of all the following macros. // It's not a nice way to solve it> When we will have time, we will // try to find a cleaner solution // #ifndef _WINDOWS #ifdef __PIC__ #define por_one_mmx_reg(REG1) \ "push 0x00010001 \n" \ "push 0x00010001 \n" \ "por "#REG1", QWORD PTR [esp] \n" \ "add esp,8 \n" #define add_round_mmx_reg(REG1) \ "push 0x00010000 \n" \ "push 0x00010000 \n" \ "paddd "#REG1", QWORD PTR [esp] \n" \ "add esp,8 \n" #define mov_tg_1_16_mmx_reg(REG1) \ "push 0x32ec32ec \n" \ "push 0x32ec32ec \n" \ "movq "#REG1", QWORD PTR [esp] \n" \ "add esp,8 \n" #define mov_tg_2_16_mmx_reg(REG1) \ "push 0x6a0a6a0a \n" \ "push 0x6a0a6a0a \n" \ "movq "#REG1", QWORD PTR [esp] \n" \ "add esp,8 \n" #define mov_tg_3_16_mmx_reg(REG1) \ "push 0xab0eab0e \n" \ "push 0xab0eab0e \n" \ "movq "#REG1", QWORD PTR [esp] \n" \ "add esp,8 \n" #define mov_ocos_4_16_mmx_reg(REG1) \ "push 0x5a825a82 \n" \ "push 0x5a825a82 \n" \ "movq "#REG1", QWORD PTR [esp] \n" \ "add esp,8 \n" #define mul_tg_1_16_mmx_reg(REG1) \ "push 0x32ec32ec \n" \ "push 0x32ec32ec \n" \ "pmulhw "#REG1", QWORD PTR [esp] \n" \ "add esp,8 \n" #define mul_tg_2_16_mmx_reg(REG1) \ "push 0x6a0a6a0a \n" \ "push 0x6a0a6a0a \n" \ "pmulhw "#REG1", QWORD PTR [esp] \n" \ "add esp,8 \n" #define mul_tg_3_16_mmx_reg(REG1) \ "push 0xab0eab0e \n" \ "push 0xab0eab0e \n" \ "pmulhw "#REG1", QWORD PTR [esp] \n" \ "add esp,8 \n" #define mul_ocos_4_16_mmx_reg(REG1) \ "push 0x5a825a82 \n" \ "push 0x5a825a82 \n" \ "pmulhw "#REG1", QWORD PTR [esp] \n" \ "add esp,8 \n" #if __GNUC__ > 3 #define lea_addr_in_reg(REG1) \ "call __i686.get_pc_thunk.bx \n" \ "add ebx,_GLOBAL_OFFSET_TABLE_ \n" \ "lea "#REG1",__jpmm_row_tab_frw@GOTOFF \n" #else #define lea_addr_in_reg(REG1) \ "call __tg_get_pc \n" \ "add ebx,_GLOBAL_OFFSET_TABLE_ \n" \ "lea "#REG1",__jpmm_row_tab_frw@GOTOFF \n" #endif #else /* __PIC__ */ #define por_one_mmx_reg(REG1) \ "por "#REG1", __jpmm_one_corr \n" #define add_round_mmx_reg(REG1) \ "paddd "#REG1", __jpmm_round_frw_row \n" #define mov_tg_1_16_mmx_reg(REG1) \ "movq "#REG1", __jpmm_tg_1_16 \n" #define mov_tg_2_16_mmx_reg(REG1) \ "movq "#REG1", __jpmm_tg_2_16 \n" #define mov_tg_3_16_mmx_reg(REG1) \ "movq "#REG1", __jpmm_tg_3_16 \n" #define mov_ocos_4_16_mmx_reg(REG1) \ "movq "#REG1", __jpmm_ocos_4_16 \n" #define mul_tg_1_16_mmx_reg(REG1) \ "pmulhw "#REG1", __jpmm_tg_1_16 \n" #define mul_tg_2_16_mmx_reg(REG1) \ "pmulhw "#REG1", __jpmm_tg_2_16 \n" #define mul_tg_3_16_mmx_reg(REG1) \ "pmulhw "#REG1", __jpmm_tg_3_16 \n" #define mul_ocos_4_16_mmx_reg(REG1) \ "pmulhw "#REG1", __jpmm_ocos_4_16 \n" #define lea_addr_in_reg(REG1) \ "lea "#REG1",__jpmm_row_tab_frw \n" #endif /* __PIC__ */ #endif /* _WINDOWS */ void jpeg_fdct_mmx( short *block ) { #ifdef _WINDOWS // Visual C++ inline assembly code __asm { // Columns mov eax, block lea ebx, __jpmm_row_tab_frw mov ecx, eax movq mm0, [eax + 1*16] //; 0 ; x1 movq mm1, [eax + 6*16] //; 1 ; x6 movq mm2, mm0 //; 2 ; x1 movq mm3, [eax + 2*16] //; 3 ; x2 paddsw mm0, mm1 //; t1 = x[1] + x[6] movq mm4, [eax + 5*16] //; 4 ; x5 psllw mm0, SHIFT_FRW_COL //; t1 movq mm5, [eax + 0*16] //; 5 ; x0 paddsw mm4, mm3 //; t2 = x[2] + x[5] paddsw mm5, [eax + 7*16] // t0 = x[0] + x[7] psllw mm4, SHIFT_FRW_COL // t2 movq mm6, mm0 // 6 ; t1 psubsw mm2, mm1 // 1 ; t6 = x[1] - x[6] movq mm1, __jpmm_tg_2_16 // 1 ; tg_2_16 psubsw mm0, mm4 // tm12 = t1 - t2 movq mm7, [eax + 3*16] // 7 ; x3 pmulhw mm1, mm0 // tm12*tg_2_16 paddsw mm7, [eax + 4*16] // t3 = x[3] + x[4] psllw mm5, SHIFT_FRW_COL // t0 paddsw mm6, mm4 // 4 ; tp12 = t1 + t2 psllw mm7, SHIFT_FRW_COL // t3 movq mm4, mm5 // 4 ; t0 psubsw mm5, mm7 // tm03 = t0 - t3 paddsw mm1, mm5 // y2 = tm03 + tm12*tg_2_16 paddsw mm4, mm7 // 7 ; tp03 = t0 + t3 por mm1, __jpmm_one_corr // correction y2 +0.5 psllw mm2, SHIFT_FRW_COL+1 // t6 pmulhw mm5, __jpmm_tg_2_16 // tm03*tg_2_16 movq mm7, mm4 // 7 // tp03 psubsw mm3, [eax + 5*16] // t5 = x[2] - x[5] psubsw mm4, mm6 // y4 = tp03 - tp12 movq [ecx + 2*16], mm1 // 1 // save y2 paddsw mm7, mm6 // 6 // y0 = tp03 + tp12 movq mm1, [eax + 3*16] // 1 // x3 psllw mm3, SHIFT_FRW_COL+1 // t5 psubsw mm1, [eax + 4*16] // t4 = x[3] - x[4] movq mm6, mm2 // 6 // t6 movq [ecx + 4*16], mm4 // 4 // save y4 paddsw mm2, mm3 // t6 + t5 pmulhw mm2, __jpmm_ocos_4_16 // tp65 = (t6 + t5)*cos_4_16 psubsw mm6, mm3 // 3 // t6 - t5 pmulhw mm6, __jpmm_ocos_4_16 // tm65 = (t6 - t5)*cos_4_16 psubsw mm5, mm0 // 0 // y6 = tm03*tg_2_16 - tm12 por mm5, __jpmm_one_corr // correction y6 +0.5 psllw mm1, SHIFT_FRW_COL // t4 por mm2, __jpmm_one_corr // correction tp65 +0.5 movq mm4, mm1 // 4 // t4 movq mm3, [eax + 0*16] // 3 // x0 paddsw mm1, mm6 // tp465 = t4 + tm65 psubsw mm3, [eax + 7*16] // t7 = x[0] - x[7] psubsw mm4, mm6 // 6 // tm465 = t4 - tm65 movq mm0, __jpmm_tg_1_16 // 0 // tg_1_16 psllw mm3, SHIFT_FRW_COL // t7 movq mm6, __jpmm_tg_3_16 // 6 // tg_3_16 pmulhw mm0, mm1 // tp465*tg_1_16 movq [ecx + 0*16], mm7 // 7 // save y0 pmulhw mm6, mm4 // tm465*tg_3_16 movq [ecx + 6*16], mm5 // 5 // save y6 movq mm7, mm3 // 7 // t7 movq mm5, __jpmm_tg_3_16 // 5 // tg_3_16 psubsw mm7, mm2 // tm765 = t7 - tp65 paddsw mm3, mm2 // 2 // tp765 = t7 + tp65 pmulhw mm5, mm7 // tm765*tg_3_16 paddsw mm0, mm3 // y1 = tp765 + tp465*tg_1_16 paddsw mm6, mm4 // tm465*tg_3_16 pmulhw mm3, __jpmm_tg_1_16 // tp765*tg_1_16 por mm0, __jpmm_one_corr // correction y1 +0.5 paddsw mm5, mm7 // tm765*tg_3_16 psubsw mm7, mm6 // 6 // y3 = tm765 - tm465*tg_3_16 add eax, 0x08 // // increment pointer movq [ecx + 1*16], mm0 // 0 // save y1 paddsw mm5, mm4 // 4 // y5 = tm765*tg_3_16 + tm465 movq [ecx + 3*16], mm7 // 7 // save y3 psubsw mm3, mm1 // 1 // y7 = tp765*tg_1_16 - tp465 movq [ecx + 5*16], mm5 // 5 // save y5 movq mm0, [eax + 1*16] // 0 // x1 movq [ecx + 7*16], mm3 // 3 // save y7 (columns 0-4) movq mm1, [eax + 6*16] // 1 // x6 movq mm2, mm0 // 2 // x1 movq mm3, [eax + 2*16] // 3 // x2 paddsw mm0, mm1 // t1 = x[1] + x[6] movq mm4, [eax + 5*16] // 4 // x5 psllw mm0, SHIFT_FRW_COL // t1 movq mm5, [eax + 0*16] // 5 // x0 paddsw mm4, mm3 // t2 = x[2] + x[5] paddsw mm5, [eax + 7*16] // t0 = x[0] + x[7] psllw mm4, SHIFT_FRW_COL // t2 movq mm6, mm0 // 6 // t1 psubsw mm2, mm1 // 1 // t6 = x[1] - x[6] movq mm1, __jpmm_tg_2_16 // 1 // tg_2_16 psubsw mm0, mm4 // tm12 = t1 - t2 movq mm7, [eax + 3*16] // 7 // x3 pmulhw mm1, mm0 // tm12*tg_2_16 paddsw mm7, [eax + 4*16] // t3 = x[3] + x[4] psllw mm5, SHIFT_FRW_COL // t0 paddsw mm6, mm4 // 4 // tp12 = t1 + t2 psllw mm7, SHIFT_FRW_COL // t3 movq mm4, mm5 // 4 // t0 psubsw mm5, mm7 // tm03 = t0 - t3 paddsw mm1, mm5 // y2 = tm03 + tm12*tg_2_16 paddsw mm4, mm7 // 7 // tp03 = t0 + t3 por mm1, __jpmm_one_corr // correction y2 +0.5 psllw mm2, SHIFT_FRW_COL+1 // t6 pmulhw mm5, __jpmm_tg_2_16 // tm03*tg_2_16 movq mm7, mm4 // 7 // tp03 psubsw mm3, [eax + 5*16] // t5 = x[2] - x[5] psubsw mm4, mm6 // y4 = tp03 - tp12 movq [ecx + 2*16+8], mm1 // 1 // save y2 paddsw mm7, mm6 // 6 // y0 = tp03 + tp12 movq mm1, [eax + 3*16] // 1 // x3 psllw mm3, SHIFT_FRW_COL+1 // t5 psubsw mm1, [eax + 4*16] // t4 = x[3] - x[4] movq mm6, mm2 // 6 // t6 movq [ecx + 4*16+8], mm4 // 4 // save y4 paddsw mm2, mm3 // t6 + t5 pmulhw mm2, __jpmm_ocos_4_16 // tp65 = (t6 + t5)*cos_4_16 psubsw mm6, mm3 // 3 // t6 - t5 pmulhw mm6, __jpmm_ocos_4_16 // tm65 = (t6 - t5)*cos_4_16 psubsw mm5, mm0 // 0 // y6 = tm03*tg_2_16 - tm12 por mm5, __jpmm_one_corr // correction y6 +0.5 psllw mm1, SHIFT_FRW_COL // t4 por mm2, __jpmm_one_corr // correction tp65 +0.5 movq mm4, mm1 // 4 // t4 movq mm3, [eax + 0*16] // 3 // x0 paddsw mm1, mm6 // tp465 = t4 + tm65 psubsw mm3, [eax + 7*16] // t7 = x[0] - x[7] psubsw mm4, mm6 // 6 // tm465 = t4 - tm65 movq mm0, __jpmm_tg_1_16 // 0 // tg_1_16 psllw mm3, SHIFT_FRW_COL // t7 movq mm6, __jpmm_tg_3_16 // 6 // tg_3_16 pmulhw mm0, mm1 // tp465*tg_1_16 movq [ecx +8], mm7 // 7 // save y0 pmulhw mm6, mm4 // tm465*tg_3_16 movq [ecx + 6*16+8], mm5 // 5 // save y6 movq mm7, mm3 // 7 // t7 movq mm5, __jpmm_tg_3_16 // 5 // tg_3_16 psubsw mm7, mm2 // tm765 = t7 - tp65 paddsw mm3, mm2 // 2 // tp765 = t7 + tp65 pmulhw mm5, mm7 // tm765*tg_3_16 paddsw mm0, mm3 // y1 = tp765 + tp465*tg_1_16 paddsw mm6, mm4 // tm465*tg_3_16 pmulhw mm3, __jpmm_tg_1_16 // tp765*tg_1_16 por mm0, __jpmm_one_corr // correction y1 +0.5 paddsw mm5, mm7 // tm765*tg_3_16 psubsw mm7, mm6 // 6 // y3 = tm765 - tm465*tg_3_16 movq [ecx + 1*16+8], mm0 // 0 // save y1 paddsw mm5, mm4 // 4 // y5 = tm765*tg_3_16 + tm465 movq [ecx + 3*16+8], mm7 // 7 // save y3 psubsw mm3, mm1 // 1 // y7 = tp765*tg_1_16 - tp465 movq [ecx + 5*16+8], mm5 // 5 // save y5 movq [ecx + 7*16+8], mm3 // 3 // save y7 // Rows ----------------------------------------------------------------- mov eax, block mov edi, 0x08 lp_mmx_fdct_row1: movd mm5, dword ptr [eax+12]// // mm5 = 7 6 punpcklwd mm5, qword ptr [eax+8] // mm5 = 5 7 4 6 movq mm2, mm5// // mm2 = 5 7 4 6 psrlq mm5, 32// // mm5 = _ _ 5 7 movq mm0, qword ptr [eax]// // mm0 = 3 2 1 0 punpcklwd mm5, mm2//// mm5 = 4 5 6 7 movq mm1, mm0// // mm1 = 3 2 1 0 paddsw mm0, mm5// // mm0 = [3+4, 2+5, 1+6, 0+7] (xt3, xt2, xt1, xt0) psubsw mm1, mm5// // mm1 = [3-4, 2-5, 1-6, 0-7] (xt7, xt6, xt5, xt4) movq mm2, mm0// // mm2 = [ xt3 xt2 xt1 xt0 ] punpcklwd mm0, mm1//// mm0 = [ xt5 xt1 xt4 xt0 ] punpckhwd mm2, mm1//// mm2 = [ xt7 xt3 xt6 xt2 ] movq mm1, mm2// // mm1 //// shuffle bytes around movq mm2, mm0 // 2 // x3 x2 x1 x0 movq mm3, qword ptr [ebx] // 3 // w06 w04 w02 w00 punpcklwd mm0, mm1 // x5 x1 x4 x0 movq mm5, mm0 // 5 // x5 x1 x4 x0 punpckldq mm0, mm0 // x4 x0 x4 x0 [ xt2 xt0 xt2 xt0 ] movq mm4, qword ptr [ebx+8] // 4 // w07 w05 w03 w01 punpckhwd mm2, mm1 // 1 // x7 x3 x6 x2 pmaddwd mm3, mm0 // x4*w06+x0*w04 x4*w02+x0*w00 movq mm6, mm2 // 6 // x7 x3 x6 x2 movq mm1, qword ptr [ebx+32] // 1 // w22 w20 w18 w16 punpckldq mm2, mm2 // x6 x2 x6 x2 [ xt3 xt1 xt3 xt1 ] pmaddwd mm4, mm2 // x6*w07+x2*w05 x6*w03+x2*w01 punpckhdq mm5, mm5 // x5 x1 x5 x1 [ xt6 xt4 xt6 xt4 ] pmaddwd mm0, qword ptr [ebx+16] // x4*w14+x0*w12 x4*w10+x0*w08 punpckhdq mm6, mm6 // x7 x3 x7 x3 [ xt7 xt5 xt7 xt5 ] movq mm7, qword ptr [ebx+40] // 7 // w23 w21 w19 w17 pmaddwd mm1, mm5 // x5*w22+x1*w20 x5*w18+x1*w16 paddd mm3, __jpmm_round_frw_row // +rounder (y2,y0) pmaddwd mm7, mm6 // x7*w23+x3*w21 x7*w19+x3*w17 pmaddwd mm2, qword ptr [ebx+24] // x6*w15+x2*w13 x6*w11+x2*w09 paddd mm3, mm4 // 4 // a1=sum(even1) a0=sum(even0) // now ( y2, y0) pmaddwd mm5, qword ptr [ebx+48] // x5*w30+x1*w28 x5*w26+x1*w24 pmaddwd mm6, qword ptr [ebx+56] // x7*w31+x3*w29 x7*w27+x3*w25 paddd mm1, mm7 // 7 // b1=sum(odd1) b0=sum(odd0) // now ( y3, y1) paddd mm0, __jpmm_round_frw_row // +rounder (y6,y4) psrad mm3, SHIFT_FRW_ROW // (y2, y0) paddd mm1, __jpmm_round_frw_row // +rounder (y3,y1) paddd mm0, mm2 // 2 // a3=sum(even3) a2=sum(even2) // now (y6, y4) paddd mm5, __jpmm_round_frw_row // +rounder (y7,y5) psrad mm1, SHIFT_FRW_ROW // y1=a1+b1 y0=a0+b0 paddd mm5, mm6 // 6 // b3=sum(odd3) b2=sum(odd2) // now ( y7, y5) psrad mm0, SHIFT_FRW_ROW //y3=a3+b3 y2=a2+b2 add ecx, 16// // increment row-output address by 1 row psrad mm5, SHIFT_FRW_ROW // y4=a3-b3 y5=a2-b2 add eax, 16// // increment row-address by 1 row packssdw mm3, mm0 // 0 // y6 y4 y2 y0 packssdw mm1, mm5 // 3 // y7 y5 y3 y1 movq mm6, mm3// // mm0 = y6 y4 y2 y0 punpcklwd mm3, mm1// // y3 y2 y1 y0 sub edi, 0x01// // i = i - 1 punpckhwd mm6, mm1// // y7 y6 y5 y4 add ebx,64// // increment to next table movq qword ptr [ecx-16], mm3 // 1 // save y3 y2 y1 y0 movq qword ptr [ecx-8], mm6 // 7 // save y7 y6 y5 y4 cmp edi, 0x00// jg lp_mmx_fdct_row1// // begin fdct processing on next row emms// } #else #ifdef _64BITS // gcc inline assembly code (64bits) // Columns __asm__ ( ".intel_syntax noprefix \n" "mov rcx, rax \n" "movq mm0, [rax + 1*16] \n" "movq mm1, [rax + 6*16] \n" "movq mm2, mm0 \n" "movq mm3, [rax + 2*16] \n" "paddsw mm0, mm1 \n" "movq mm4, [rax + 5*16] \n" "psllw mm0, 3 \n" "movq mm5, [rax + 0*16] \n" "paddsw mm4, mm3 \n" "paddsw mm5, [rax + 7*16] \n" "psllw mm4, 3 \n" "movq mm6, mm0 \n" "psubsw mm2, mm1 \n" mov_tg_2_16_mmx_reg(mm1) "psubsw mm0, mm4 \n" "movq mm7, [rax + 3*16] \n" "pmulhw mm1, mm0 \n" "paddsw mm7, [rax + 4*16] \n" "psllw mm5, 3 \n" "paddsw mm6, mm4 \n" "psllw mm7, 3 \n" "movq mm4, mm5 \n" "psubsw mm5, mm7 \n" "paddsw mm1, mm5 \n" "paddsw mm4, mm7 \n" por_one_mmx_reg(mm1) "psllw mm2, 4 \n" mul_tg_2_16_mmx_reg(mm5) "movq mm7, mm4 \n" "psubsw mm3, [rax + 5*16] \n" "psubsw mm4, mm6 \n" "movq [rcx + 2*16], mm1 \n" "paddsw mm7, mm6 \n" "movq mm1, [rax + 3*16] \n" "psllw mm3, 4 \n" "psubsw mm1, [rax + 4*16] \n" "movq mm6, mm2 \n" "movq [rcx + 4*16], mm4 \n" "paddsw mm2, mm3 \n" mul_ocos_4_16_mmx_reg(mm2) "psubsw mm6, mm3 \n" mul_ocos_4_16_mmx_reg(mm6) "psubsw mm5, mm0 \n" por_one_mmx_reg(mm5) "psllw mm1, 3 \n" por_one_mmx_reg(mm2) "movq mm4, mm1 \n" "movq mm3, [rax + 0*16] \n" "paddsw mm1, mm6 \n" "psubsw mm3, [rax + 7*16] \n" "psubsw mm4, mm6 \n" mov_tg_1_16_mmx_reg(mm0) "psllw mm3, 3 \n" mov_tg_3_16_mmx_reg(mm6) "pmulhw mm0, mm1 \n" "movq [rcx + 0*16], mm7 \n" "pmulhw mm6, mm4 \n" "movq [rcx + 6*16], mm5 \n" "movq mm7, mm3 \n" mov_tg_3_16_mmx_reg(mm5) "psubsw mm7, mm2 \n" "paddsw mm3, mm2 \n" "pmulhw mm5, mm7 \n" "paddsw mm0, mm3 \n" "paddsw mm6, mm4 \n" mul_tg_1_16_mmx_reg(mm3) por_one_mmx_reg(mm0) "paddsw mm5, mm7 \n" "psubsw mm7, mm6 \n" "add rax, 0x08 \n" "movq [rcx + 1*16], mm0 \n" "paddsw mm5, mm4 \n" "movq [rcx + 3*16], mm7 \n" "psubsw mm3, mm1 \n" "movq [rcx + 5*16], mm5 \n" "movq mm0, [rax + 1*16] \n" "movq [rcx + 7*16], mm3 \n" "movq mm1, [rax + 6*16] \n" "movq mm2, mm0 \n" "movq mm3, [rax + 2*16] \n" "paddsw mm0, mm1 \n" "movq mm4, [rax + 5*16] \n" "psllw mm0, 3 \n" "movq mm5, [rax + 0*16] \n" "paddsw mm4, mm3 \n" "paddsw mm5, [rax + 7*16] \n" "psllw mm4, 3 \n" "movq mm6, mm0 \n" "psubsw mm2, mm1 \n" mov_tg_2_16_mmx_reg(mm1) "psubsw mm0, mm4 \n" "movq mm7, [rax + 3*16] \n" "pmulhw mm1, mm0 \n" "paddsw mm7, [rax + 4*16] \n" "psllw mm5, 3 \n" "paddsw mm6, mm4 \n" "psllw mm7, 3 \n" "movq mm4, mm5 \n" "psubsw mm5, mm7 \n" "paddsw mm1, mm5 \n" "paddsw mm4, mm7 \n" por_one_mmx_reg(mm1) "psllw mm2, 4 \n" mul_tg_2_16_mmx_reg(mm5) "movq mm7, mm4 \n" "psubsw mm3, [rax + 5*16] \n" "psubsw mm4, mm6 \n" "movq [rcx + 2*16+8], mm1 \n" "paddsw mm7, mm6 \n" "movq mm1, [rax + 3*16] \n" "psllw mm3, 3+1 \n" "psubsw mm1, [rax + 4*16] \n" "movq mm6, mm2 \n" "movq [rcx + 4*16+8], mm4 \n" "paddsw mm2, mm3 \n" mul_ocos_4_16_mmx_reg(mm2) "psubsw mm6, mm3 \n" mul_ocos_4_16_mmx_reg(mm6) "psubsw mm5, mm0 \n" por_one_mmx_reg(mm5) "psllw mm1, 3 \n" por_one_mmx_reg(mm2) "movq mm4, mm1 \n" "movq mm3, [rax + 0*16] \n" "paddsw mm1, mm6 \n" "psubsw mm3, [rax + 7*16] \n" "psubsw mm4, mm6 \n" mov_tg_1_16_mmx_reg(mm0) "psllw mm3, 3 \n" mov_tg_3_16_mmx_reg(mm6) "pmulhw mm0, mm1 \n" "movq [rcx +8], mm7 \n" "pmulhw mm6, mm4 \n" "movq [rcx + 6*16+8], mm5 \n" "movq mm7, mm3 \n" mov_tg_3_16_mmx_reg(mm5) "psubsw mm7, mm2 \n" "paddsw mm3, mm2 \n" "pmulhw mm5, mm7 \n" "paddsw mm0, mm3 \n" "paddsw mm6, mm4 \n" mul_tg_1_16_mmx_reg(mm3) por_one_mmx_reg(mm0) "paddsw mm5, mm7 \n" "psubsw mm7, mm6 \n" "movq [rcx + 1*16+8], mm0 \n" "paddsw mm5, mm4 \n" "movq [rcx + 3*16+8], mm7 \n" "psubsw mm3, mm1 \n" "movq [rcx + 5*16+8], mm5 \n" "movq [rcx + 7*16+8], mm3 \n" ".att_syntax \n" : /* no output */ : "a"(block) : "memory","rcx","mm0","mm1","mm2","mm3","mm4","mm5","mm6","mm7" ); // Rows __asm__ ( ".intel_syntax noprefix \n" "push rbx \n" lea_addr_in_reg(rbx) "mov rcx, rax \n" "mov rdi, 0x08 \n" "lp_mmx_fdct_row1: \n" "movd mm5, [rax+12] \n" "punpcklwd mm5, [rax+8] \n" "movq mm2, mm5 \n" "psrlq mm5, 32 \n" "movq mm0, [rax] \n" "punpcklwd mm5, mm2 \n" "movq mm1, mm0 \n" "paddsw mm0, mm5 \n" "psubsw mm1, mm5 \n" "movq mm2, mm0 \n" "punpcklwd mm0, mm1 \n" "punpckhwd mm2, mm1 \n" "movq mm1, mm2 \n" "movq mm2, mm0 \n" "movq mm3, [rbx] \n" "punpcklwd mm0, mm1 \n" "movq mm5, mm0 \n" "punpckldq mm0, mm0 \n" "movq mm4, [rbx+8] \n" "punpckhwd mm2, mm1 \n" "pmaddwd mm3, mm0 \n" "movq mm6, mm2 \n" "movq mm1, [rbx+32] \n" "punpckldq mm2, mm2 \n" "pmaddwd mm4, mm2 \n" "punpckhdq mm5, mm5 \n" "pmaddwd mm0, [rbx+16] \n" "punpckhdq mm6, mm6 \n" "movq mm7, [rbx+40] \n" "pmaddwd mm1, mm5 \n" add_round_mmx_reg(mm3) "pmaddwd mm7, mm6 \n" "pmaddwd mm2, [rbx+24] \n" "paddd mm3, mm4 \n" "pmaddwd mm5, [rbx+48] \n" "pmaddwd mm6, [rbx+56] \n" "paddd mm1, mm7 \n" add_round_mmx_reg(mm0) "psrad mm3, 17 \n" add_round_mmx_reg(mm1) "paddd mm0, mm2 \n" add_round_mmx_reg(mm5) "psrad mm1, 17 \n" "paddd mm5, mm6 \n" "psrad mm0, 17 \n" "add rcx, 16 \n" "psrad mm5, 17 \n" "add rax, 16 \n" "packssdw mm3, mm0 \n" "packssdw mm1, mm5 \n" "movq mm6, mm3 \n" "punpcklwd mm3, mm1 \n" "sub rdi, 0x01 \n" "punpckhwd mm6, mm1 \n" "add rbx,64 \n" "movq [rcx-16], mm3 \n" "movq [rcx-8], mm6 \n" "cmp rdi, 0x00 \n" "jg lp_mmx_fdct_row1 \n" "pop rbx \n" "emms \n" ".att_syntax \n" : /* no output */ : "a"(block) : "memory","rcx","rdi","mm0","mm1","mm2","mm3","mm4","mm5","mm6","mm7" ); #else // gcc inline assembly code (32bits) // Columns __asm__ ( ".intel_syntax noprefix \n" "mov ecx, eax \n" "movq mm0, [eax + 1*16] \n" "movq mm1, [eax + 6*16] \n" "movq mm2, mm0 \n" "movq mm3, [eax + 2*16] \n" "paddsw mm0, mm1 \n" "movq mm4, [eax + 5*16] \n" "psllw mm0, 3 \n" "movq mm5, [eax + 0*16] \n" "paddsw mm4, mm3 \n" "paddsw mm5, [eax + 7*16] \n" "psllw mm4, 3 \n" "movq mm6, mm0 \n" "psubsw mm2, mm1 \n" mov_tg_2_16_mmx_reg(mm1) "psubsw mm0, mm4 \n" "movq mm7, [eax + 3*16] \n" "pmulhw mm1, mm0 \n" "paddsw mm7, [eax + 4*16] \n" "psllw mm5, 3 \n" "paddsw mm6, mm4 \n" "psllw mm7, 3 \n" "movq mm4, mm5 \n" "psubsw mm5, mm7 \n" "paddsw mm1, mm5 \n" "paddsw mm4, mm7 \n" por_one_mmx_reg(mm1) "psllw mm2, 4 \n" mul_tg_2_16_mmx_reg(mm5) "movq mm7, mm4 \n" "psubsw mm3, [eax + 5*16] \n" "psubsw mm4, mm6 \n" "movq [ecx + 2*16], mm1 \n" "paddsw mm7, mm6 \n" "movq mm1, [eax + 3*16] \n" "psllw mm3, 3+1 \n" "psubsw mm1, [eax + 4*16] \n" "movq mm6, mm2 \n" "movq [ecx + 4*16], mm4 \n" "paddsw mm2, mm3 \n" mul_ocos_4_16_mmx_reg(mm2) "psubsw mm6, mm3 \n" mul_ocos_4_16_mmx_reg(mm6) "psubsw mm5, mm0 \n" por_one_mmx_reg(mm5) "psllw mm1, 3 \n" por_one_mmx_reg(mm2) "movq mm4, mm1 \n" "movq mm3, [eax + 0*16] \n" "paddsw mm1, mm6 \n" "psubsw mm3, [eax + 7*16] \n" "psubsw mm4, mm6 \n" mov_tg_1_16_mmx_reg(mm0) "psllw mm3, 3 \n" mov_tg_3_16_mmx_reg(mm6) "pmulhw mm0, mm1 \n" "movq [ecx + 0*16], mm7 \n" "pmulhw mm6, mm4 \n" "movq [ecx + 6*16], mm5 \n" "movq mm7, mm3 \n" mov_tg_3_16_mmx_reg(mm5) "psubsw mm7, mm2 \n" "paddsw mm3, mm2 \n" "pmulhw mm5, mm7 \n" "paddsw mm0, mm3 \n" "paddsw mm6, mm4 \n" mul_tg_1_16_mmx_reg(mm3) por_one_mmx_reg(mm0) "paddsw mm5, mm7 \n" "psubsw mm7, mm6 \n" "add eax, 0x08 \n" "movq [ecx + 1*16], mm0 \n" "paddsw mm5, mm4 \n" "movq [ecx + 3*16], mm7 \n" "psubsw mm3, mm1 \n" "movq [ecx + 5*16], mm5 \n" "movq mm0, [eax + 1*16] \n" "movq [ecx + 7*16], mm3 \n" "movq mm1, [eax + 6*16] \n" "movq mm2, mm0 \n" "movq mm3, [eax + 2*16] \n" "paddsw mm0, mm1 \n" "movq mm4, [eax + 5*16] \n" "psllw mm0, 3 \n" "movq mm5, [eax + 0*16] \n" "paddsw mm4, mm3 \n" "paddsw mm5, [eax + 7*16] \n" "psllw mm4, 3 \n" "movq mm6, mm0 \n" "psubsw mm2, mm1 \n" mov_tg_2_16_mmx_reg(mm1) "psubsw mm0, mm4 \n" "movq mm7, [eax + 3*16] \n" "pmulhw mm1, mm0 \n" "paddsw mm7, [eax + 4*16] \n" "psllw mm5, 3 \n" "paddsw mm6, mm4 \n" "psllw mm7, 3 \n" "movq mm4, mm5 \n" "psubsw mm5, mm7 \n" "paddsw mm1, mm5 \n" "paddsw mm4, mm7 \n" por_one_mmx_reg(mm1) "psllw mm2, 4 \n" mul_tg_2_16_mmx_reg(mm5) "movq mm7, mm4 \n" "psubsw mm3, [eax + 5*16] \n" "psubsw mm4, mm6 \n" "movq [ecx + 2*16+8], mm1 \n" "paddsw mm7, mm6 \n" "movq mm1, [eax + 3*16] \n" "psllw mm3, 3+1 \n" "psubsw mm1, [eax + 4*16] \n" "movq mm6, mm2 \n" "movq [ecx + 4*16+8], mm4 \n" "paddsw mm2, mm3 \n" mul_ocos_4_16_mmx_reg(mm2) "psubsw mm6, mm3 \n" mul_ocos_4_16_mmx_reg(mm6) "psubsw mm5, mm0 \n" por_one_mmx_reg(mm5) "psllw mm1, 3 \n" por_one_mmx_reg(mm5) "movq mm4, mm1 \n" "movq mm3, [eax + 0*16] \n" "paddsw mm1, mm6 \n" "psubsw mm3, [eax + 7*16] \n" "psubsw mm4, mm6 \n" mov_tg_1_16_mmx_reg(mm0) "psllw mm3, 3 \n" mov_tg_3_16_mmx_reg(mm6) "pmulhw mm0, mm1 \n" "movq [ecx +8], mm7 \n" "pmulhw mm6, mm4 \n" "movq [ecx + 6*16+8], mm5 \n" "movq mm7, mm3 \n" mov_tg_3_16_mmx_reg(mm5) "psubsw mm7, mm2 \n" "paddsw mm3, mm2 \n" "pmulhw mm5, mm7 \n" "paddsw mm0, mm3 \n" "paddsw mm6, mm4 \n" mul_tg_1_16_mmx_reg(mm3) por_one_mmx_reg(mm0) "paddsw mm5, mm7 \n" "psubsw mm7, mm6 \n" "movq [ecx + 1*16+8], mm0 \n" "paddsw mm5, mm4 \n" "movq [ecx + 3*16+8], mm7 \n" "psubsw mm3, mm1 \n" "movq [ecx + 5*16+8], mm5 \n" "movq [ecx + 7*16+8], mm3 \n" ".att_syntax \n" : /* no output */ : "a"(block) : "memory","ecx","mm0","mm1","mm2","mm3","mm4","mm5","mm6","mm7" ); #ifdef __PIC__ #if __GNUC__ > 3 __asm__( "push %ebx \n" "call __i686.get_pc_thunk.bx \n" "add $_GLOBAL_OFFSET_TABLE_, %ebx \n" "lea __jpmm_row_tab_frw@GOTOFF(%ebx),%ebx \n" ); #else __asm__( "push %ebx \n" "call __tg_get_pc \n" "add $_GLOBAL_OFFSET_TABLE_, %ebx \n" "lea __jpmm_row_tab_frw@GOTOFF(%ebx),%ebx \n" ); #endif #endif /* __PIC__ */ // Rows __asm__ ( ".intel_syntax noprefix \n" #ifndef __PIC__ "push ebx \n" "lea ebx,__jpmm_row_tab_frw \n" #endif "mov edi, 0x08 \n" "mov ecx, eax \n" "lp_mmx_fdct_row1: \n" "movd mm5, [eax+12] \n" "punpcklwd mm5, [eax+8] \n" "movq mm2, mm5 \n" "psrlq mm5, 32 \n" "movq mm0, [eax] \n" "punpcklwd mm5, mm2 \n" "movq mm1, mm0 \n" "paddsw mm0, mm5 \n" "psubsw mm1, mm5 \n" "movq mm2, mm0 \n" "punpcklwd mm0, mm1 \n" "punpckhwd mm2, mm1 \n" "movq mm1, mm2 \n" "movq mm2, mm0 \n" "movq mm3, [ebx] \n" "punpcklwd mm0, mm1 \n" "movq mm5, mm0 \n" "punpckldq mm0, mm0 \n" "movq mm4, [ebx+8] \n" "punpckhwd mm2, mm1 \n" "pmaddwd mm3, mm0 \n" "movq mm6, mm2 \n" "movq mm1, [ebx+32] \n" "punpckldq mm2, mm2 \n" "pmaddwd mm4, mm2 \n" "punpckhdq mm5, mm5 \n" "pmaddwd mm0, [ebx+16] \n" "punpckhdq mm6, mm6 \n" "movq mm7, [ebx+40] \n" "pmaddwd mm1, mm5 \n" add_round_mmx_reg(mm3) "pmaddwd mm7, mm6 \n" "pmaddwd mm2, [ebx+24] \n" "paddd mm3, mm4 \n" "pmaddwd mm5, [ebx+48] \n" "pmaddwd mm6, [ebx+56] \n" "paddd mm1, mm7 \n" add_round_mmx_reg(mm0) "psrad mm3, 17 \n" add_round_mmx_reg(mm1) "paddd mm0, mm2 \n" add_round_mmx_reg(mm5) "psrad mm1, 17 \n" "paddd mm5, mm6 \n" "psrad mm0, 17 \n" "add ecx, 16 \n" "psrad mm5, 17 \n" "add eax, 16 \n" "packssdw mm3, mm0 \n" "packssdw mm1, mm5 \n" "movq mm6, mm3 \n" "punpcklwd mm3, mm1 \n" "sub edi, 0x01 \n" "punpckhwd mm6, mm1 \n" "add ebx,64 \n" "movq [ecx-16], mm3 \n" "movq [ecx-8], mm6 \n" "cmp edi, 0x00 \n" "jg lp_mmx_fdct_row1 \n" "pop ebx \n" "emms \n" ".att_syntax \n" : /* no output */ : "a"(block) : "memory","ecx","edi","mm0","mm1","mm2","mm3","mm4","mm5","mm6","mm7" ); #endif /* _64BITS */ #endif /* _WINDOWS */ } #define SHIFT_INV_ROW 11 #define SHIFT_INV_COL 6 ALIGN8 short __jpmm_row_tabs[] = { // Table for rows 0 - constants are multiplied by cos_4_16 16384, 16384, 16384, -16384, 21407, 8867, 8867, -21407, 16384, -16384, 16384, 16384, -8867, 21407, -21407, -8867, 22725, 12873, 19266, -22725, 19266, 4520, -4520, -12873, 12873, 4520, 4520, 19266, -22725, 19266, -12873, -22725, // Table for rows 1 - constants are multiplied by cos_1_16 22725, 22725, 22725, -22725, 29692, 12299, 12299, -29692, 22725, -22725, 22725, 22725, -12299, 29692, -29692, -12299, 31521, 17855, 26722, -31521, 26722, 6270, -6270, -17855, 17855, 6270, 6270, 26722, -31521, 26722, -17855, -31521, // Table for rows 2 - constants are multiplied by cos_2_16 21407, 21407, 21407, -21407, 27969, 11585, 11585, -27969, 21407, -21407, 21407, 21407, -11585, 27969, -27969, -11585, 29692, 16819, 25172, -29692, 25172, 5906, -5906, -16819, 16819, 5906, 5906, 25172, -29692, 25172, -16819, -29692, // Table for rows 3 - constants are multiplied by cos_3_16 19266, 19266, 19266, -19266, 25172, 10426, 10426, -25172, 19266, -19266, 19266, 19266, -10426, 25172, -25172, -10426, 26722, 15137, 22654, -26722, 22654, 5315, -5315, -15137, 15137, 5315, 5315, 22654, -26722, 22654, -15137, -26722, // Table for rows 4 - constants are multiplied by cos_4_16 16384, 16384, 16384, -16384, 21407, 8867, 8867, -21407, 16384, -16384, 16384, 16384, -8867, 21407, -21407, -8867, 22725, 12873, 19266, -22725, 19266, 4520, -4520, -12873, 12873, 4520, 4520, 19266, -22725, 19266, -12873, -22725, // Table for rows 5 - constants are multiplied by cos_3_16 19266, 19266, 19266, -19266, 25172, 10426, 10426, -25172, 19266, -19266, 19266, 19266, -10426, 25172, -25172, -10426, 26722, 15137, 22654, -26722, 22654, 5315, -5315, -15137, 15137, 5315, 5315, 22654, -26722, 22654, -15137, -26722, // Table for rows 6 - constants are multiplied by cos_2_16 21407, 21407, 21407, -21407, 27969, 11585, 11585, -27969, 21407, -21407, 21407, 21407, -11585, 27969, -27969, -11585, 29692, 16819, 25172, -29692, 25172, 5906, -5906, -16819, 16819, 5906, 5906, 25172, -29692, 25172, -16819, -29692, // Table for rows 7 - constants are multiplied by cos_1_16 22725, 22725, 22725, -22725, 29692, 12299, 12299, -29692, 22725, -22725, 22725, 22725, -12299, 29692, -29692, -12299, 31521, 17855, 26722, -31521, 26722, 6270, -6270, -17855, 17855, 6270, 6270, 26722, -31521, 26722, -17855, -31521 }; // Rounding ALIGN8 long __jpmm_rounder[] = { 65536, 65536 , 3597, 3597 , 2260, 2260 , 1203, 1203 , 0, 0 , 120, 120 , 512, 512 , 512, 512 }; // Offset ALIGN8 short __jpmm_offset128[] = { 128,128,128,128 }; #ifndef _WINDOWS #ifdef __PIC__ #define add_off128_mmx_reg(REG1) \ "push 0x00800080 \n" \ "push 0x00800080 \n" \ "paddw "#REG1", QWORD PTR [esp] \n" \ "add esp,8 \n" #if __GNUC__ > 3 #define lea_addr_in_regs(REG1,REG2) \ "push ebx \n" \ "call __i686.get_pc_thunk.bx \n" \ "add ebx,_GLOBAL_OFFSET_TABLE_ \n" \ "lea "#REG1",__jpmm_row_tabs@GOTOFF \n" \ "lea "#REG2",__jpmm_rounder@GOTOFF \n" \ "pop ebx \n" #else #define lea_addr_in_regs(REG1,REG2) \ "push ebx \n" \ "call __tg_get_pc \n" \ "add ebx,_GLOBAL_OFFSET_TABLE_ \n" \ "lea "#REG1",__jpmm_row_tabs@GOTOFF \n" \ "lea "#REG2",__jpmm_rounder@GOTOFF \n" \ "pop ebx \n" #endif #else /* __PIC__ */ #define add_off128_mmx_reg(REG1) \ "paddw "#REG1", __jpmm_offset128 \n" #define lea_addr_in_regs(REG1,REG2) \ "lea "#REG1",__jpmm_row_tabs \n" \ "lea "#REG2",__jpmm_rounder \n" \ #endif /* __PIC__ */ #endif /* _WINDOWS */ void jpeg_idct_mmx(short *block, unsigned char *dest) { short innerBuff[64]; long scratch[4]; #ifdef _WINDOWS // Visual C++ inline assembly code __asm { // Rows ------------------- mov esi, block lea edi, innerBuff lea eax, __jpmm_row_tabs lea ebx, __jpmm_rounder mov ecx, 8 __mmx_idct_rows: movq mm0, [esi] ; 0 ; x3 x2 x1 x0 movq mm1, [esi+8] ; 1 ; x7 x6 x5 x4 movq mm2, mm0 ; 2 ; x3 x2 x1 x0 movq mm3, [eax] ; 3 ; w06 w04 w02 w00 punpcklwd mm0, mm1 ; x5 x1 x4 x0 movq mm5, mm0 ; 5 ; x5 x1 x4 x0 punpckldq mm0, mm0 ; x4 x0 x4 x0 movq mm4, [eax+8] ; 4 ; w07 w05 w03 w01 punpckhwd mm2, mm1 ; 1 ; x7 x3 x6 x2 pmaddwd mm3, mm0 ; x4*w06+x0*w04 x4*w02+x0*w00 movq mm6, mm2 ; 6 ; x7 x3 x6 x2 movq mm1, [eax+32] ; 1 ; w22 w20 w18 w16 punpckldq mm2, mm2 ; x6 x2 x6 x2 pmaddwd mm4, mm2 ; x6*w07+x2*w05 x6*w03+x2*w01 punpckhdq mm5, mm5 ; x5 x1 x5 x1 pmaddwd mm0, [eax+16] ; x4*w14+x0*w12 x4*w10+x0*w08 punpckhdq mm6, mm6 ; x7 x3 x7 x3 movq mm7, [eax+40] ; 7 ; w23 w21 w19 w17 pmaddwd mm1, mm5 ; x5*w22+x1*w20 x5*w18+x1*w16 paddd mm3, [ebx] ; +rounder pmaddwd mm7, mm6 ; x7*w23+x3*w21 x7*w19+x3*w17 pmaddwd mm2, [eax+24] ; x6*w15+x2*w13 x6*w11+x2*w09 paddd mm3, mm4 ; 4 ; a1=sum(even1) a0=sum(even0) pmaddwd mm5, [eax+48] ; x5*w30+x1*w28 x5*w26+x1*w24 movq mm4, mm3 ; 4 ; a1 a0 pmaddwd mm6, [eax+56] ; x7*w31+x3*w29 x7*w27+x3*w25 paddd mm1, mm7 ; 7 ; b1=sum(odd1) b0=sum(odd0) paddd mm0, [ebx] ; +rounder psubd mm3, mm1 ; a1-b1 a0-b0 psrad mm3, SHIFT_INV_ROW ; y6=a1-b1 y7=a0-b0 paddd mm1, mm4 ; 4 ; a1+b1 a0+b0 paddd mm0, mm2 ; 2 ; a3=sum(even3) a2=sum(even2) psrad mm1, SHIFT_INV_ROW ; y1=a1+b1 y0=a0+b0 paddd mm5, mm6 ; 6 ; b3=sum(odd3) b2=sum(odd2) movq mm4, mm0 ; 4 ; a3 a2 paddd mm0, mm5 ; a3+b3 a2+b2 psubd mm4, mm5 ; 5 ; a3-b3 a2-b2 psrad mm0, SHIFT_INV_ROW ; y3=a3+b3 y2=a2+b2 psrad mm4, SHIFT_INV_ROW ; y4=a3-b3 y5=a2-b2 packssdw mm1, mm0 ; 0 ; y3 y2 y1 y0 packssdw mm4, mm3 ; 3 ; y6 y7 y4 y5 movq mm7, mm4 ; 7 ; y6 y7 y4 y5 psrld mm4, 16 ; 0 y6 0 y4 pslld mm7, 16 ; y7 0 y5 0 movq [edi], mm1 ; 1 ; save y3 y2 y1 y0 por mm7, mm4 ; 4 ; y7 y6 y5 y4 movq [edi+8], mm7 ; 7 ; save y7 y6 y5 y4 add esi, 16 add edi, 16 add eax, 64 add ebx, 8 dec ecx jnz __mmx_idct_rows // Columns ------------------- lea esi, innerBuff mov edi, dest lea eax, scratch mov ecx, 2 __mmx_idct_cols: movq mm0, __jpmm_tg_3_16 movq mm3, [esi+16*3] movq mm1, mm0 ; tg_3_16 movq mm5, [esi+16*5] pmulhw mm0, mm3 ; x3*(tg_3_16-1) movq mm4, __jpmm_tg_1_16 pmulhw mm1, mm5 ; x5*(tg_3_16-1) movq mm7, [esi+16*7] movq mm2, mm4 ; tg_1_16 movq mm6, [esi+16*1] pmulhw mm4, mm7 ; x7*tg_1_16 paddsw mm0, mm3 ; x3*tg_3_16 pmulhw mm2, mm6 ; x1*tg_1_16 paddsw mm1, mm3 ; x3+x5*(tg_3_16-1) psubsw mm0, mm5 ; x3*tg_3_16-x5 = tm35 movq mm3, __jpmm_ocos_4_16 paddsw mm1, mm5 ; x3+x5*tg_3_16 = tp35 paddsw mm4, mm6 ; x1+tg_1_16*x7 = tp17 psubsw mm2, mm7 ; x1*tg_1_16-x7 = tm17 movq mm5, mm4 ; tp17 movq mm6, mm2 ; tm17 paddsw mm5, mm1 ; tp17+tp35 = b0 psubsw mm6, mm0 ; tm17-tm35 = b3 psubsw mm4, mm1 ; tp17-tp35 = t1 paddsw mm2, mm0 ; tm17+tm35 = t2 movq mm7, __jpmm_tg_2_16 movq mm1, mm4 ; t1 movq [eax+0], mm5 ; save b0 paddsw mm1, mm2 ; t1+t2 movq [eax+8], mm6 ; save b3 psubsw mm4, mm2 ; t1-t2 movq mm5, [esi+2*16] movq mm0, mm7 ; tg_2_16 movq mm6, [esi+6*16] pmulhw mm0, mm5 ; x2*tg_2_16 pmulhw mm7, mm6 ; x6*tg_2_16 pmulhw mm1, mm3 ; ocos_4_16*(t1+t2) = b1/2 movq mm2, [esi+0*16] pmulhw mm4, mm3 ; ocos_4_16*(t1-t2) = b2/2 psubsw mm0, mm6 ; t2*tg_2_16-x6 = tm26 movq mm3, mm2 ; x0 movq mm6, [esi+4*16] paddsw mm7, mm5 ; x2+x6*tg_2_16 = tp26 paddsw mm2, mm6 ; x0+x4 = tp04 psubsw mm3, mm6 ; x0-x4 = tm04 movq mm5, mm2 ; tp04 movq mm6, mm3 ; tm04 psubsw mm2, mm7 ; tp04-tp26 = a3 paddsw mm3, mm0 ; tm04+tm26 = a1 paddsw mm1, mm1 ; b1 paddsw mm4, mm4 ; b2 paddsw mm5, mm7 ; tp04+tp26 = a0 psubsw mm6, mm0 ; tm04-tm26 = a2 movq mm7, mm3 ; a1 movq mm0, mm6 ; a2 paddsw mm3, mm1 ; a1+b1 paddsw mm6, mm4 ; a2+b2 psraw mm3, SHIFT_INV_COL ; dst1 psubsw mm7, mm1 ; a1-b1 psraw mm6, SHIFT_INV_COL ; dst2 psubsw mm0, mm4 ; a2-b2 movq mm1, [eax+0] ; load b0 psraw mm7, SHIFT_INV_COL ; dst6 movq mm4, mm5 ; a0 psraw mm0, SHIFT_INV_COL ; dst5 paddw mm3,__jpmm_offset128 packuswb mm3,mm0 movd [edi+1*8], mm3 // R1 paddsw mm5, mm1 ; a0+b0 paddw mm6,__jpmm_offset128 packuswb mm6,mm0 movd [edi+2*8], mm6 // R2 psubsw mm4, mm1 ; a0-b0 movq mm3, [eax+8] ; load b3 psraw mm5, SHIFT_INV_COL ; dst0 movq mm6, mm2 ; a3 psraw mm4, SHIFT_INV_COL ; dst7 paddw mm0,__jpmm_offset128 packuswb mm0,mm1 movd [edi+5*8], mm0 // R5 paddsw mm2, mm3 ; a3+b3 paddw mm7,__jpmm_offset128 packuswb mm7,mm0 movd [edi+6*8], mm7 // R6 psubsw mm6, mm3 ; a3-b3 paddw mm5,__jpmm_offset128 packuswb mm5,mm0 movd [edi+0*8], mm5 // R0 psraw mm2, SHIFT_INV_COL ; dst3 paddw mm4,__jpmm_offset128 packuswb mm4,mm0 movd [edi+7*8], mm4 // R7 psraw mm6, SHIFT_INV_COL ; dst4 paddw mm2,__jpmm_offset128 packuswb mm2,mm0 movd [edi+3*8], mm2 // R3 paddw mm6,__jpmm_offset128 packuswb mm6,mm0 movd [edi+4*8], mm6 // R4 add edi,4 add esi,8 dec ecx jnz __mmx_idct_cols emms } #else #ifdef _64BITS // gcc inline assembly code (64bits) // Rows __asm__ ( ".intel_syntax noprefix \n" "push rbx \n" "mov rcx, 8 \n" lea_addr_in_regs(rax,rbx) "__mmx_idct_rows: \n" "movq mm0, [rsi] \n" "movq mm1, [rsi+8] \n" "movq mm2, mm0 \n" "movq mm3, [rax] \n" "punpcklwd mm0, mm1 \n" "movq mm5, mm0 \n" "punpckldq mm0, mm0 \n" "movq mm4, [rax+8] \n" "punpckhwd mm2, mm1 \n" "pmaddwd mm3, mm0 \n" "movq mm6, mm2 \n" "movq mm1, [rax+32] \n" "punpckldq mm2, mm2 \n" "pmaddwd mm4, mm2 \n" "punpckhdq mm5, mm5 \n" "pmaddwd mm0, [rax+16] \n" "punpckhdq mm6, mm6 \n" "movq mm7, [rax+40] \n" "pmaddwd mm1, mm5 \n" "paddd mm3, [rbx] \n" "pmaddwd mm7, mm6 \n" "pmaddwd mm2, [rax+24] \n" "paddd mm3, mm4 \n" "pmaddwd mm5, [rax+48] \n" "movq mm4, mm3 \n" "pmaddwd mm6, [rax+56] \n" "paddd mm1, mm7 \n" "paddd mm0, [rbx] \n" "psubd mm3, mm1 \n" "psrad mm3, 11 \n" "paddd mm1, mm4 \n" "paddd mm0, mm2 \n" "psrad mm1, 11 \n" "paddd mm5, mm6 \n" "movq mm4, mm0 \n" "paddd mm0, mm5 \n" "psubd mm4, mm5 \n" "psrad mm0, 11 \n" "psrad mm4, 11 \n" "packssdw mm1, mm0 \n" "packssdw mm4, mm3 \n" "movq mm7, mm4 \n" "psrld mm4, 16 \n" "pslld mm7, 16 \n" "movq [rdi], mm1 \n" "por mm7, mm4 \n" "movq [rdi+8], mm7 \n" "add rsi, 16 \n" "add rdi, 16 \n" "add rax, 64 \n" "add rbx, 8 \n" "dec rcx \n" "jnz __mmx_idct_rows \n" "pop rbx \n" ".att_syntax \n" : /* no output */ : "D"(innerBuff),"S"(block) : "memory","rax","rcx","mm0","mm1","mm2","mm3","mm4","mm5","mm6","mm7" ); // Columns __asm__ ( ".intel_syntax noprefix \n" "mov rcx, 2 \n" "__mmx_idct_cols: \n" mov_tg_3_16_mmx_reg(mm0) "movq mm3, [rsi+16*3] \n" "movq mm1, mm0 \n" "movq mm5, [rsi+16*5] \n" "pmulhw mm0, mm3 \n" mov_tg_1_16_mmx_reg(mm4) "pmulhw mm1, mm5 \n" "movq mm7, [rsi+16*7] \n" "movq mm2, mm4 \n" "movq mm6, [rsi+16*1] \n" "pmulhw mm4, mm7 \n" "paddsw mm0, mm3 \n" "pmulhw mm2, mm6 \n" "paddsw mm1, mm3 \n" "psubsw mm0, mm5 \n" mov_ocos_4_16_mmx_reg(mm3) "paddsw mm1, mm5 \n" "paddsw mm4, mm6 \n" "psubsw mm2, mm7 \n" "movq mm5, mm4 \n" "movq mm6, mm2 \n" "paddsw mm5, mm1 \n" "psubsw mm6, mm0 \n" "psubsw mm4, mm1 \n" "paddsw mm2, mm0 \n" mov_tg_2_16_mmx_reg(mm7) "movq mm1, mm4 \n" "movq [rax+0], mm5 \n" "paddsw mm1, mm2 \n" "movq [rax+8], mm6 \n" "psubsw mm4, mm2 \n" "movq mm5, [rsi+2*16] \n" "movq mm0, mm7 \n" "movq mm6, [rsi+6*16] \n" "pmulhw mm0, mm5 \n" "pmulhw mm7, mm6 \n" "pmulhw mm1, mm3 \n" "movq mm2, [rsi+0*16] \n" "pmulhw mm4, mm3 \n" "psubsw mm0, mm6 \n" "movq mm3, mm2 \n" "movq mm6, [rsi+4*16] \n" "paddsw mm7, mm5 \n" "paddsw mm2, mm6 \n" "psubsw mm3, mm6 \n" "movq mm5, mm2 \n" "movq mm6, mm3 \n" "psubsw mm2, mm7 \n" "paddsw mm3, mm0 \n" "paddsw mm1, mm1 \n" "paddsw mm4, mm4 \n" "paddsw mm5, mm7 \n" "psubsw mm6, mm0 \n" "movq mm7, mm3 \n" "movq mm0, mm6 \n" "paddsw mm3, mm1 \n" "paddsw mm6, mm4 \n" "psraw mm3, 6 \n" "psubsw mm7, mm1 \n" "psraw mm6, 6 \n" "psubsw mm0, mm4 \n" "movq mm1, [rax+0] \n" "psraw mm7, 6 \n" "movq mm4, mm5 \n" "psraw mm0, 6 \n" add_off128_mmx_reg(mm3) "packuswb mm3,mm0 \n" "movd [rdi+1*8], mm3 \n" "paddsw mm5, mm1 \n" add_off128_mmx_reg(mm6) "packuswb mm6,mm0 \n" "movd [rdi+2*8], mm6 \n" "psubsw mm4, mm1 \n" "movq mm3, [rax+8] \n" "psraw mm5, 6 \n" "movq mm6, mm2 \n" "psraw mm4, 6 \n" add_off128_mmx_reg(mm0) "packuswb mm0,mm1 \n" "movd [rdi+5*8], mm0 \n" "paddsw mm2, mm3 \n" add_off128_mmx_reg(mm7) "packuswb mm7,mm0 \n" "movd [rdi+6*8], mm7 \n" "psubsw mm6, mm3 \n" add_off128_mmx_reg(mm5) "packuswb mm5,mm0 \n" "movd [rdi+0*8], mm5 \n" "psraw mm2, 6 \n" add_off128_mmx_reg(mm4) "packuswb mm4,mm0 \n" "movd [rdi+7*8], mm4 \n" "psraw mm6, 6 \n" add_off128_mmx_reg(mm2) "packuswb mm2,mm0 \n" "movd [rdi+3*8], mm2 \n" add_off128_mmx_reg(mm6) "packuswb mm6,mm0 \n" "movd [rdi+4*8], mm6 \n" "add rdi,4 \n" "add rsi,8 \n" "dec rcx \n" "jnz __mmx_idct_cols \n" "emms \n" ".att_syntax \n" : /* no output */ : "S"(innerBuff),"D"(dest),"a"(scratch) : "memory","rcx","mm0","mm1","mm2","mm3","mm4","mm5","mm6","mm7" ); #else #ifdef __PIC__ #if __GNUC__ > 3 __asm__( "push %ebx \n" "push %ecx \n" "call __i686.get_pc_thunk.bx \n" "add $_GLOBAL_OFFSET_TABLE_, %ebx \n" "lea __jpmm_row_tabs@GOTOFF(%ebx),%eax \n" "lea __jpmm_rounder@GOTOFF(%ebx),%ecx \n" "mov %ecx,%ebx \n" "pop %ecx \n" ); #else __asm__( "push %ebx \n" "push %ecx \n" "call __tg_get_pc \n" "add $_GLOBAL_OFFSET_TABLE_, %ebx \n" "lea __jpmm_row_tabs@GOTOFF(%ebx),%eax \n" "lea __jpmm_rounder@GOTOFF(%ebx),%ecx \n" "mov %ecx,%ebx \n" "pop %ecx \n" ); #endif #endif /* __PIC__ */ // gcc inline assembly code (32bits) // Rows __asm__ ( ".intel_syntax noprefix \n" "mov ecx, 8 \n" #ifndef __PIC__ "push ebx \n" "lea eax,__jpmm_row_tabs \n" "lea ebx,__jpmm_rounder \n" #endif "__mmx_idct_rows: \n" "movq mm0, [esi] \n" "movq mm1, [esi+8] \n" "movq mm2, mm0 \n" "movq mm3, [eax] \n" "punpcklwd mm0, mm1 \n" "movq mm5, mm0 \n" "punpckldq mm0, mm0 \n" "movq mm4, [eax+8] \n" "punpckhwd mm2, mm1 \n" "pmaddwd mm3, mm0 \n" "movq mm6, mm2 \n" "movq mm1, [eax+32] \n" "punpckldq mm2, mm2 \n" "pmaddwd mm4, mm2 \n" "punpckhdq mm5, mm5 \n" "pmaddwd mm0, [eax+16] \n" "punpckhdq mm6, mm6 \n" "movq mm7, [eax+40] \n" "pmaddwd mm1, mm5 \n" "paddd mm3, [ebx] \n" "pmaddwd mm7, mm6 \n" "pmaddwd mm2, [eax+24] \n" "paddd mm3, mm4 \n" "pmaddwd mm5, [eax+48] \n" "movq mm4, mm3 \n" "pmaddwd mm6, [eax+56] \n" "paddd mm1, mm7 \n" "paddd mm0, [ebx] \n" "psubd mm3, mm1 \n" "psrad mm3, 11 \n" "paddd mm1, mm4 \n" "paddd mm0, mm2 \n" "psrad mm1, 11 \n" "paddd mm5, mm6 \n" "movq mm4, mm0 \n" "paddd mm0, mm5 \n" "psubd mm4, mm5 \n" "psrad mm0, 11 \n" "psrad mm4, 11 \n" "packssdw mm1, mm0 \n" "packssdw mm4, mm3 \n" "movq mm7, mm4 \n" "psrld mm4, 16 \n" "pslld mm7, 16 \n" "movq [edi], mm1 \n" "por mm7, mm4 \n" "movq [edi+8], mm7 \n" "add esi, 16 \n" "add edi, 16 \n" "add eax, 64 \n" "add ebx, 8 \n" "dec ecx \n" "jnz __mmx_idct_rows \n" "pop ebx \n" ".att_syntax \n" : /* no output */ : "D"(innerBuff),"S"(block) : "memory","eax","ecx","mm0","mm1","mm2","mm3","mm4","mm5","mm6","mm7" ); // Columns __asm__ ( ".intel_syntax noprefix \n" "mov ecx, 2 \n" "__mmx_idct_cols: \n" mov_tg_3_16_mmx_reg(mm0) "movq mm3, [esi+16*3] \n" "movq mm1, mm0 \n" "movq mm5, [esi+16*5] \n" "pmulhw mm0, mm3 \n" mov_tg_1_16_mmx_reg(mm4) "pmulhw mm1, mm5 \n" "movq mm7, [esi+16*7] \n" "movq mm2, mm4 \n" "movq mm6, [esi+16*1] \n" "pmulhw mm4, mm7 \n" "paddsw mm0, mm3 \n" "pmulhw mm2, mm6 \n" "paddsw mm1, mm3 \n" "psubsw mm0, mm5 \n" mov_ocos_4_16_mmx_reg(mm3) "paddsw mm1, mm5 \n" "paddsw mm4, mm6 \n" "psubsw mm2, mm7 \n" "movq mm5, mm4 \n" "movq mm6, mm2 \n" "paddsw mm5, mm1 \n" "psubsw mm6, mm0 \n" "psubsw mm4, mm1 \n" "paddsw mm2, mm0 \n" mov_tg_2_16_mmx_reg(mm7) "movq mm1, mm4 \n" "movq [eax+0], mm5 \n" "paddsw mm1, mm2 \n" "movq [eax+8], mm6 \n" "psubsw mm4, mm2 \n" "movq mm5, [esi+2*16] \n" "movq mm0, mm7 \n" "movq mm6, [esi+6*16] \n" "pmulhw mm0, mm5 \n" "pmulhw mm7, mm6 \n" "pmulhw mm1, mm3 \n" "movq mm2, [esi+0*16] \n" "pmulhw mm4, mm3 \n" "psubsw mm0, mm6 \n" "movq mm3, mm2 \n" "movq mm6, [esi+4*16] \n" "paddsw mm7, mm5 \n" "paddsw mm2, mm6 \n" "psubsw mm3, mm6 \n" "movq mm5, mm2 \n" "movq mm6, mm3 \n" "psubsw mm2, mm7 \n" "paddsw mm3, mm0 \n" "paddsw mm1, mm1 \n" "paddsw mm4, mm4 \n" "paddsw mm5, mm7 \n" "psubsw mm6, mm0 \n" "movq mm7, mm3 \n" "movq mm0, mm6 \n" "paddsw mm3, mm1 \n" "paddsw mm6, mm4 \n" "psraw mm3, 6 \n" "psubsw mm7, mm1 \n" "psraw mm6, 6 \n" "psubsw mm0, mm4 \n" "movq mm1, [eax+0] \n" "psraw mm7, 6 \n" "movq mm4, mm5 \n" "psraw mm0, 6 \n" add_off128_mmx_reg(mm3) "packuswb mm3,mm0 \n" "movd [edi+1*8], mm3 \n" "paddsw mm5, mm1 \n" add_off128_mmx_reg(mm6) "packuswb mm6,mm0 \n" "movd [edi+2*8], mm6 \n" "psubsw mm4, mm1 \n" "movq mm3, [eax+8] \n" "psraw mm5, 6 \n" "movq mm6, mm2 \n" "psraw mm4, 6 \n" add_off128_mmx_reg(mm0) "packuswb mm0,mm1 \n" "movd [edi+5*8], mm0 \n" "paddsw mm2, mm3 \n" add_off128_mmx_reg(mm7) "packuswb mm7,mm0 \n" "movd [edi+6*8], mm7 \n" "psubsw mm6, mm3 \n" add_off128_mmx_reg(mm5) "packuswb mm5,mm0 \n" "movd [edi+0*8], mm5 \n" "psraw mm2, 6 \n" add_off128_mmx_reg(mm4) "packuswb mm4,mm0 \n" "movd [edi+7*8], mm4 \n" "psraw mm6, 6 \n" add_off128_mmx_reg(mm2) "packuswb mm2,mm0 \n" "movd [edi+3*8], mm2 \n" add_off128_mmx_reg(mm6) "packuswb mm6,mm0 \n" "movd [edi+4*8], mm6 \n" "add edi,4 \n" "add esi,8 \n" "dec ecx \n" "jnz __mmx_idct_cols \n" "emms \n" ".att_syntax \n" : /* no output */ : "S"(innerBuff),"D"(dest),"a"(scratch) : "memory","ecx","mm0","mm1","mm2","mm3","mm4","mm5","mm6","mm7" ); #endif /* _64BITS */ #endif /* _WINDOWS */ } #ifndef _WINDOWS #ifdef __PIC__ __asm__( "__tg_get_pc: \n" "movl (%esp),%ebx \n" "ret \n" ); #endif /* __PIC__ */ #endif /* WINDOWS */ #endif /* JPG_USE_ASM */ tango-8.1.2c+dfsg.orig/lib/cpp/server/jpeg_mmx/jpeg_color_mmx.cpp0000644000175000017500000013001112205375141023743 0ustar piccapicca///============================================================================= // // file : jpeg_color_mmx.cpp // // description : Simple jpeg coding/decoding library // Color space conversion (MMX routines) // // project : TANGO // // author(s) : JL Pons // // Copyright (C) : 2004,2005,2006,2007,2008,2009,2010,2011,2012,2013 // European Synchrotron Radiation Facility // BP 220, Grenoble 38043 // FRANCE // // This file is part of Tango. // // Tango 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. // // Tango 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 Tango. If not, see . // // $Revision: 22213 $ // // $Log$ // Revision 1.7 2009/08/27 07:24:30 taurel // - Commit after another merge with Release_7_0_2-bugfixes branch // // Revision 1.6.2.2 2009/08/26 07:16:52 taurel // - Fix bugs in previous change related to PIC code // // Revision 1.6.2.1 2009/08/25 14:03:10 taurel // - First attempt to clarify the gcc PIC problem // // Revision 1.6 2009/04/20 14:55:58 jlpons // Added GPL header, changed memory allocation to C++ fashion. // //============================================================================= //------------------------------------------------------------------------------ // // (YCbCr to RGB) Y,Cb and Cr range in [0,255] // R = Y + 1.402 * (Cr-128) // G = Y - 0.34414 * (Cb-128) - 0.71414*(Cr-128) // B = Y + 1.772 * (Cb-128) // // (RGB to YCbCr) R,G,B range in [0,255] // Y = 0.299 * R + 0.587 * G + 0.114 * B // Cb = -0.16874 * R - 0.33126 * G + 0.5 * B + 128 // Cr = 0.5 * R - 0.41869 * G - 0.08131 * B + 128 // //------------------------------------------------------------------------------ #include "jpeg_memory.h" #include "jpeg_lib.h" #include #ifdef JPG_USE_ASM #ifdef _WINDOWS // Disable "has no EMMS instruction" warning #pragma warning( disable : 4799 ) #endif #define FIX14(x) ((short) ((x) * (1L<<14) + 0.5)) #define FIX15(x) ((short) ((x) * (1L<<15) + 0.5)) #define FIX16(x) ((short) ((x) * (1L<<16) + 0.5)) #ifdef _WINDOWS // Visual C++ align directive #define ALIGN8 __declspec(align(8)) #else // gcc align directive #define ALIGN8 __attribute__ ((aligned (8))) #endif // MMX constant (YCbCr to RGB) ALIGN8 short _cbgmm[] = { -FIX14(0.34414),-FIX14(0.34414),-FIX14(0.34414),-FIX14(0.34414) }; ALIGN8 short _cbbmm[] = { FIX14(1.772) , FIX14(1.772) , FIX14(1.772) , FIX14(1.772) }; ALIGN8 short _crgmm[] = { -FIX14(0.71414),-FIX14(0.71414),-FIX14(0.71414),-FIX14(0.71414) }; ALIGN8 short _crrmm[] = { FIX14(1.402) , FIX14(1.402) , FIX14(1.402) , FIX14(1.402) }; ALIGN8 short _128mm[] = { 128,128,128,128 }; // RGB to YCbCr ALIGN8 short _rymm[] = { FIX15(0.299), FIX15(0.299), FIX15(0.299), FIX15(0.299) }; ALIGN8 short _gymm[] = { FIX15(0.587), FIX15(0.587), FIX15(0.587), FIX15(0.587) }; ALIGN8 short _bymm[] = { FIX15(0.114), FIX15(0.114), FIX15(0.114), FIX15(0.114) }; ALIGN8 short _offymm[] = { -127,-127,-127,-127 }; // +1 for rounding ALIGN8 short _rcbcrmm[] = {-FIX15(0.16874),-FIX15(0.16874), FIX15(0.5) , FIX15(0.5) }; ALIGN8 short _gcbcrmm[] = {-FIX15(0.33126),-FIX15(0.33126),-FIX15(0.41869),-FIX15(0.41869)}; ALIGN8 short _bcbcrmm[] = { FIX15(0.5) , FIX15(0.5) ,-FIX15(0.08131),-FIX15(0.08131)}; ALIGN8 short _rcmm[] = { 1,1,1,1 }; // // Unfortunately with gcc, code like "psubw mm2,_128mm" is considered like non PIC // and the scanelf utility complains about this. This is also a problem for distribution like // Debian. Why, I don't know !! // This is a known problem and some WEB page have been written relatedto this issue. // I have used the page http://www.gentoo.org/proj/en/hardened/pic-fix-guide.xml // Within this page, they give 3 pssobilities to remove this kind of code. // I have use case number 1. Case number 2 and 3 are not really usable because // all the registers are already used (Not in all functions but in most of them) // Therefore, every variable defined previously are "manually" loaded into the MMX registers // using the stack as temporary storage // // -FIX14(0.34414) --> 0xe9fa // FIX14(1.772) --> 0x7168 // -FIX14(0.71414) --> 0xd24c // FIX14(1.402) --> 0x59ba // 128 --> 0x0080 // FIX15(0.299) --> 0x2646 // FIX15(0.587) --> 0x4b23 // FIX15(0.114) --> 0x0e98 // -127 --> 0xff81 // -FIX15(0.16874) --> 0xea67 // FIX15(0.5) --> 0x4000 // -FIX15(0.33126) --> 0xd599 // -FIX15(0.41869) --> 0xca68 // -FIX15(0.08131) --> 0xf598 // 1 --> 0x0001 // // This problem is the reason of all the following macros. // It's not a nice way to solve it> When we will have time, we will // try to find a cleaner solution // #ifndef _WINDOWS #ifdef __PIC__ #define sub_128_mmx_reg(REG1,REG2) \ "push 0x00800080 \n" \ "push 0x00800080 \n" \ "psubw "#REG1", QWORD PTR [esp] \n" \ "psubw "#REG2", QWORD PTR [esp] \n" \ "add esp,8 \n" #define add_127_mmx_reg(REG1) \ "push 0xff81ff81 \n" \ "push 0xff81ff81 \n" \ "paddw "#REG1", QWORD PTR [esp] \n" \ "add esp,8 \n" #define add_1_mmx_reg(REG1) \ "push 0x00010001 \n" \ "push 0x00010001 \n" \ "paddw "#REG1", QWORD PTR [esp] \n" \ "add esp,8 \n" #define mul_cxx_mmx_reg(REG1,REG2,REG3,REG4) \ "push 0xe9fae9fa \n" \ "push 0xe9fae9fa \n" \ "pmulhw "#REG1", QWORD PTR [esp] \n" \ "push 0x71687168 \n" \ "push 0x71687168 \n" \ "pmulhw "#REG2", QWORD PTR [esp] \n" \ "push 0xd24cd24c \n" \ "push 0xd24cd24c \n" \ "pmulhw "#REG3", QWORD PTR [esp] \n" \ "push 0x59ba59ba \n" \ "push 0x59ba59ba \n" \ "pmulhw "#REG4", QWORD PTR [esp] \n" \ "add esp,32 \n" #define mul_rgb_mmx_reg(REG1,REG2,REG3) \ "push 0x26462646 \n" \ "push 0x26462646 \n" \ "pmulhw "#REG1", QWORD PTR [esp] \n" \ "push 0x4b234b23 \n" \ "push 0x4b234b23 \n" \ "pmulhw "#REG2", QWORD PTR [esp] \n" \ "push 0x0e980e98 \n" \ "push 0x0e980e98 \n" \ "pmulhw "#REG3", QWORD PTR [esp] \n" \ "add esp,24 \n" #define mul_rgbc_mmx_reg(REG1,REG2,REG3) \ "push 0x40004000 \n" \ "push 0xea67ea67 \n" \ "pmulhw "#REG1", QWORD PTR [esp] \n" \ "push 0xca68ca68 \n" \ "push 0xd599d599 \n" \ "pmulhw "#REG2", QWORD PTR [esp] \n" \ "push 0xf598f598 \n" \ "push 0x40004000 \n" \ "pmulhw "#REG3", QWORD PTR [esp] \n" \ "add esp,24 \n" #else /* __PIC__ */ #define sub_128_mmx_reg(REG1,REG2) \ "psubw "#REG1",_128mm \n" \ "psubw "#REG2",_128mm \n" #define add_127_mmx_reg(REG1) \ "paddw "#REG1",_offymm \n" #define add_1_mmx_reg(REG1) \ "paddw "#REG1",_rcmm \n" #define mul_cxx_mmx_reg(REG1,REG2,REG3,REG4) \ "pmulhw "#REG1",_cbgmm \n" \ "pmulhw "#REG2",_cbbmm \n" \ "pmulhw "#REG3",_crgmm \n" \ "pmulhw "#REG4",_crrmm \n" #define mul_rgb_mmx_reg(REG1,REG2,REG3) \ "pmulhw "#REG1",_rymm \n" \ "pmulhw "#REG2",_gymm \n" \ "pmulhw "#REG3",_bymm \n" #define mul_rgbc_mmx_reg(REG1,REG2,REG3) \ "pmulhw "#REG1",_rcbcrmm \n" \ "pmulhw "#REG2",_gcbcrmm \n" \ "pmulhw "#REG3",_bcbcrmm \n" #endif /* __PIC__ */ #endif /* _WINDOWS */ //------------------------------------------------------------------------------ // MCU16x16 YCbCr H2V2 (2x2:1:1, 6 blocks per MCU) to 32-bit RGB //------------------------------------------------------------------------------ void jpeg_yh2v2_to_rgb32_mmx(unsigned char *block,long width,unsigned char *rgb) { unsigned char *y = block; unsigned char *cb = block+64*4; long j,y0; // ! Due to wrong gcc stack code (does not detect push), y0 is cleared during asm ! for(j=0;j<8;j++) { y0 = ((j&4)<<5) + ((j&3)<<4); #ifdef _WINDOWS // Visual C++ inline assembly _asm { mov edi,rgb mov esi,y mov eax,width mov ebx,cb mov edx,y0 xor ecx,ecx shl eax,2 __blrow_h2v2: // Y block offset add edx,ecx // -- 00 -- movd mm1,[esi+edx] // [0000][y11][y10][y01][y00] movd mm2,[ebx] // [0000][cb3][cb2][cb1][cb0] movd mm3,[ebx+64] // [0000][cr3][cr2][cr1][cr0] pxor mm0,mm0 punpcklbw mm1,mm0 // [y11][y10][y01][y00] punpcklbw mm2,mm0 // [cb3][cb2][cb1][cb0] punpcklbw mm3,mm0 // [cr3][cr2][cr1][cr0] psubw mm2,_128mm psubw mm3,_128mm psllw mm2,2 psllw mm3,2 movq mm4,mm2 movq mm5,mm3 pmulhw mm2,_cbgmm pmulhw mm4,_cbbmm pmulhw mm3,_crgmm pmulhw mm5,_crrmm movq mm6,mm5 punpcklwd mm6,mm6 // [cr1*crr][cr1*crr][cr0*crr][cr0*crr] paddw mm6,mm1 // R3R2R1R0 movq mm0,mm2 movq mm7,mm3 punpcklwd mm0,mm0 // [cb1*cbg][cb1*cbg][cb0*cbg][cb0*cbg] punpcklwd mm7,mm7 // [cr1*crg][cr1*crg][cr0*crg][cr0*crg] paddw mm0,mm1 paddw mm0,mm7 // G3G2G1G0 movq mm7,mm4 punpcklwd mm7,mm7 // [cb1*cbb][cb1*cbb][cb0*cbb][cb0*cbb] paddw mm7,mm1 // B3B2B1B0 pxor mm1,mm1 packuswb mm6,mm1 // [0000]R3R2R1R0 packuswb mm0,mm1 // [0000]G3G2G1G0 packuswb mm7,mm1 // [0000]B3B2B1B0 punpcklbw mm6,mm0 // G3R3G2R2G1R1G0R0 punpcklbw mm7,mm1 // 00B300B200B100B0 movq mm1,mm6 punpcklwd mm1,mm7 // 00B1G1R100B0G0R0 punpckhwd mm6,mm7 // 00B3G3R300B2G2R2 movq [edi] ,mm1 movq [edi+8],mm6 // -- 01 -- movd mm1,[esi+edx+4] // [0000][y31][y30][y21][y20] pxor mm0,mm0 punpcklbw mm1,mm0 movq mm6,mm5 punpckhwd mm6,mm6 // [cr3*crr][cr3*crr][cr2*crr][cr2*crr] paddw mm6,mm1 // R3R2R1R0 movq mm0,mm2 movq mm7,mm3 punpckhwd mm0,mm0 // [cb3*cbg][cb3*cbg][cb2*cbg][cb2*cbg] punpckhwd mm7,mm7 // [cr3*crg][cr3*crg][cr2*crg][cr2*crg] paddw mm0,mm1 paddw mm0,mm7 // G3G2G1G0 movq mm7,mm4 punpckhwd mm7,mm7 // [cb3*cbb][cb3*cbb][cb2*cbb][cb2*cbb] paddw mm7,mm1 // B3B2B1B0 pxor mm1,mm1 packuswb mm6,mm1 // [0000]R3R2R1R0 packuswb mm0,mm1 // [0000]G3G2G1G0 packuswb mm7,mm1 // [0000]B3B2B1B0 punpcklbw mm6,mm0 // G3R3G2R2G1R1G0R0 punpcklbw mm7,mm1 // 00B300B200B100B0 movq mm1,mm6 punpcklwd mm1,mm7 // 00B1G1R100B0G0R0 punpckhwd mm6,mm7 // 00B3G3R300B2G2R2 movq [edi+16],mm1 movq [edi+24],mm6 // -- 10 -- movd mm1,[esi+edx+8] // [0000][y11][y10][y01][y00] pxor mm0,mm0 punpcklbw mm1,mm0 movq mm6,mm5 punpcklwd mm6,mm6 // [cr1*crr][cr1*crr][cr0*crr][cr0*crr] paddw mm6,mm1 // R3R2R1R0 movq mm0,mm2 movq mm7,mm3 punpcklwd mm0,mm0 // [cb1*cbg][cb1*cbg][cb0*cbg][cb0*cbg] punpcklwd mm7,mm7 // [cr1*crg][cr1*crg][cr0*crg][cr0*crg] paddw mm0,mm1 paddw mm0,mm7 // G3G2G1G0 movq mm7,mm4 punpcklwd mm7,mm7 // [cb1*cbb][cb1*cbb][cb0*cbb][cb0*cbb] paddw mm7,mm1 // B3B2B1B0 pxor mm1,mm1 packuswb mm6,mm1 // [0000]R3R2R1R0 packuswb mm0,mm1 // [0000]G3G2G1G0 packuswb mm7,mm1 // [0000]B3B2B1B0 punpcklbw mm6,mm0 // G3R3G2R2G1R1G0R0 punpcklbw mm7,mm1 // 00B300B200B100B0 movq mm1,mm6 punpcklwd mm1,mm7 // 00B1G1R100B0G0R0 punpckhwd mm6,mm7 // 00B3G3R300B2G2R2 movq [edi+eax] ,mm1 movq [edi+eax+8],mm6 // -- 11 -- movd mm1,[esi+edx+12] // [0000][y31][y30][y21][y20] pxor mm0,mm0 punpcklbw mm1,mm0 movq mm6,mm5 punpckhwd mm6,mm6 // [cr3*crr][cr3*crr][cr2*crr][cr2*crr] paddw mm6,mm1 // R3R2R1R0 movq mm0,mm2 movq mm7,mm3 punpckhwd mm0,mm0 // [cb3*cbg][cb3*cbg][cb2*cbg][cb2*cbg] punpckhwd mm7,mm7 // [cr3*crg][cr3*crg][cr2*crg][cr2*crg] paddw mm0,mm1 paddw mm0,mm7 // G3G2G1G0 movq mm7,mm4 punpckhwd mm7,mm7 // [cb3*cbb][cb3*cbb][cb2*cbb][cb2*cbb] paddw mm7,mm1 // B3B2B1B0 pxor mm1,mm1 packuswb mm6,mm1 // [0000]R3R2R1R0 packuswb mm0,mm1 // [0000]G3G2G1G0 packuswb mm7,mm1 // [0000]B3B2B1B0 punpcklbw mm6,mm0 // G3R3G2R2G1R1G0R0 punpcklbw mm7,mm1 // 00B300B200B100B0 movq mm1,mm6 punpcklwd mm1,mm7 // 00B1G1R100B0G0R0 punpckhwd mm6,mm7 // 00B3G3R300B2G2R2 movq [edi+eax+16],mm1 movq [edi+eax+24],mm6 sub edx,ecx // Restore edx add edi,32 add ebx,4 add ecx,64 cmp ecx,128 jl __blrow_h2v2 } #else // GCC inline assembly code __asm__ ( ".intel_syntax noprefix \n" #ifdef _64BITS "push rbx \n" "mov rbx,rcx \n" "xor rcx,rcx \n" "shl rax,2 \n" "__blrow_h2v2: \n" "add rdx,rcx \n" "movd mm1,[rsi+rdx] \n" "movd mm2,[rbx] \n" "movd mm3,[rbx+64] \n" #else "push ebx \n" "mov ebx,ecx \n" "xor ecx,ecx \n" "shl eax,2 \n" "__blrow_h2v2: \n" "add edx,ecx \n" "movd mm1,[esi+edx] \n" "movd mm2,[ebx] \n" "movd mm3,[ebx+64] \n" #endif "pxor mm0,mm0 \n" "punpcklbw mm1,mm0 \n" "punpcklbw mm2,mm0 \n" "punpcklbw mm3,mm0 \n" sub_128_mmx_reg(mm2,mm3) "psllw mm2,2 \n" "psllw mm3,2 \n" "movq mm4,mm2 \n" "movq mm5,mm3 \n" mul_cxx_mmx_reg(mm2,mm4,mm3,mm5) "movq mm6,mm5 \n" "punpcklwd mm6,mm6 \n" "paddw mm6,mm1 \n" "movq mm0,mm2 \n" "movq mm7,mm3 \n" "punpcklwd mm0,mm0 \n" "punpcklwd mm7,mm7 \n" "paddw mm0,mm1 \n" "paddw mm0,mm7 \n" "movq mm7,mm4 \n" "punpcklwd mm7,mm7 \n" "paddw mm7,mm1 \n" "pxor mm1,mm1 \n" "packuswb mm6,mm1 \n" "packuswb mm0,mm1 \n" "packuswb mm7,mm1 \n" "punpcklbw mm6,mm0 \n" "punpcklbw mm7,mm1 \n" "movq mm1,mm6 \n" "punpcklwd mm1,mm7 \n" "punpckhwd mm6,mm7 \n" #ifdef _64BITS "movq [rdi] ,mm1 \n" "movq [rdi+8],mm6 \n" "movd mm1,[rsi+rdx+4] \n" #else "movq [edi] ,mm1 \n" "movq [edi+8],mm6 \n" "movd mm1,[esi+edx+4] \n" #endif "pxor mm0,mm0 \n" "punpcklbw mm1,mm0 \n" "movq mm6,mm5 \n" "punpckhwd mm6,mm6 \n" "paddw mm6,mm1 \n" "movq mm0,mm2 \n" "movq mm7,mm3 \n" "punpckhwd mm0,mm0 \n" "punpckhwd mm7,mm7 \n" "paddw mm0,mm1 \n" "paddw mm0,mm7 \n" "movq mm7,mm4 \n" "punpckhwd mm7,mm7 \n" "paddw mm7,mm1 \n" "pxor mm1,mm1 \n" "packuswb mm6,mm1 \n" "packuswb mm0,mm1 \n" "packuswb mm7,mm1 \n" "punpcklbw mm6,mm0 \n" "punpcklbw mm7,mm1 \n" "movq mm1,mm6 \n" "punpcklwd mm1,mm7 \n" "punpckhwd mm6,mm7 \n" #ifdef _64BITS "movq [rdi+16],mm1 \n" "movq [rdi+24],mm6 \n" "movd mm1,[rsi+rdx+8] \n" #else "movq [edi+16],mm1 \n" "movq [edi+24],mm6 \n" "movd mm1,[esi+edx+8] \n" #endif "pxor mm0,mm0 \n" "punpcklbw mm1,mm0 \n" "movq mm6,mm5 \n" "punpcklwd mm6,mm6 \n" "paddw mm6,mm1 \n" "movq mm0,mm2 \n" "movq mm7,mm3 \n" "punpcklwd mm0,mm0 \n" "punpcklwd mm7,mm7 \n" "paddw mm0,mm1 \n" "paddw mm0,mm7 \n" "movq mm7,mm4 \n" "punpcklwd mm7,mm7 \n" "paddw mm7,mm1 \n" "pxor mm1,mm1 \n" "packuswb mm6,mm1 \n" "packuswb mm0,mm1 \n" "packuswb mm7,mm1 \n" "punpcklbw mm6,mm0 \n" "punpcklbw mm7,mm1 \n" "movq mm1,mm6 \n" "punpcklwd mm1,mm7 \n" "punpckhwd mm6,mm7 \n" #ifdef _64BITS "movq [rdi+rax] ,mm1 \n" "movq [rdi+rax+8],mm6 \n" "movd mm1,[rsi+rdx+12] \n" #else "movq [edi+eax] ,mm1 \n" "movq [edi+eax+8],mm6 \n" "movd mm1,[esi+edx+12] \n" #endif "pxor mm0,mm0 \n" "punpcklbw mm1,mm0 \n" "movq mm6,mm5 \n" "punpckhwd mm6,mm6 \n" "paddw mm6,mm1 \n" "movq mm0,mm2 \n" "movq mm7,mm3 \n" "punpckhwd mm0,mm0 \n" "punpckhwd mm7,mm7 \n" "paddw mm0,mm1 \n" "paddw mm0,mm7 \n" "movq mm7,mm4 \n" "punpckhwd mm7,mm7 \n" "paddw mm7,mm1 \n" "pxor mm1,mm1 \n" "packuswb mm6,mm1 \n" "packuswb mm0,mm1 \n" "packuswb mm7,mm1 \n" "punpcklbw mm6,mm0 \n" "punpcklbw mm7,mm1 \n" "movq mm1,mm6 \n" "punpcklwd mm1,mm7 \n" "punpckhwd mm6,mm7 \n" #ifdef _64BITS "movq [rdi+rax+16],mm1 \n" "movq [rdi+rax+24],mm6 \n" "sub rdx,rcx \n" "add rdi,32 \n" "add rbx,4 \n" "add rcx,64 \n" "cmp rcx,128 \n" "jl __blrow_h2v2 \n" "pop rbx \n" #else "movq [edi+eax+16],mm1 \n" "movq [edi+eax+24],mm6 \n" "sub edx,ecx \n" "add edi,32 \n" "add ebx,4 \n" "add ecx,64 \n" "cmp ecx,128 \n" "jl __blrow_h2v2 \n" "pop ebx \n" #endif ".att_syntax \n" : /* no output */ : "D"(rgb),"S"(y),"a"(width),"c"(cb),"d"(y0) : "memory","mm0","mm1","mm2","mm3","mm4","mm5","mm6","mm7" ); #endif cb += 8; rgb += 8*width; } } //------------------------------------------------------------------------------ // MCU8x8 YCbCr H1V1 (1x1:1:1, 3 blocks per MCU) to 32-bit RGB //------------------------------------------------------------------------------ void jpeg_yh1v1_to_rgb32_mmx(unsigned char *block,long width,unsigned char *rgb) { #ifdef _WINDOWS // Visual C++ inline assembly _asm { mov edi,rgb mov esi,block mov eax,width shl eax,2 mov ecx,8 pxor mm0,mm0 __blcol_h1v1: // ----- movd mm1,[esi] // [0000][y03][y02][y01][y00] movd mm2,[esi+64] // [0000][cb3][cb2][cb1][cb0] movd mm3,[esi+128] // [0000][cr3][cr2][cr1][cr0] punpcklbw mm1,mm0 // [y03][y02][y01][y00] punpcklbw mm2,mm0 // [cb3][cb2][cb1][cb0] punpcklbw mm3,mm0 // [cr3][cr2][cr1][cr0] psubw mm2,_128mm psubw mm3,_128mm psllw mm2,2 psllw mm3,2 movq mm4,mm2 movq mm5,mm3 pmulhw mm2,_cbgmm // [cb3*cbg][cb2*cbg][cb1*cbg][cb0*cbg] pmulhw mm4,_cbbmm // [cb3*cbb][cb2*cbb][cb1*cbb][cb0*cbb] pmulhw mm3,_crgmm // [cb3*crg][cb2*crg][cb1*crg][cb0*crg] pmulhw mm5,_crrmm // [cb3*crr][cb2*crr][cb1*crr][cb0*crr] paddw mm5,mm1 // R3R2R1R0 paddw mm2,mm1 paddw mm2,mm3 // G3G2G1G0 paddw mm4,mm1 // B3B2B1B0 packuswb mm5,mm0 // [0000]R3R2R1R0 packuswb mm2,mm0 // [0000]G3G2G1G0 packuswb mm4,mm0 // [0000]B3B2B1B0 punpcklbw mm5,mm2 // G3R3G2R2G1R1G0R0 punpcklbw mm4,mm0 // 00B300B200B100B0 movq mm1,mm5 punpcklwd mm1,mm4 // 00B1G1R100B0G0R0 punpckhwd mm5,mm4 // 00B3G3R300B2G2R2 movq [edi],mm1 movq [edi+8],mm5 // ----- movd mm1,[esi+4] // [0000][y03][y02][y01][y00] movd mm2,[esi+68] // [0000][cb3][cb2][cb1][cb0] movd mm3,[esi+132] // [0000][cr3][cr2][cr1][cr0] punpcklbw mm1,mm0 // [y03][y02][y01][y00] punpcklbw mm2,mm0 // [cb3][cb2][cb1][cb0] punpcklbw mm3,mm0 // [cr3][cr2][cr1][cr0] psubw mm2,_128mm psubw mm3,_128mm psllw mm2,2 psllw mm3,2 movq mm4,mm2 movq mm5,mm3 pmulhw mm2,_cbgmm // [cb3*cbg][cb2*cbg][cb1*cbg][cb0*cbg] pmulhw mm4,_cbbmm // [cb3*cbb][cb2*cbb][cb1*cbb][cb0*cbb] pmulhw mm3,_crgmm // [cb3*crg][cb2*crg][cb1*crg][cb0*crg] pmulhw mm5,_crrmm // [cb3*crr][cb2*crr][cb1*crr][cb0*crr] paddw mm5,mm1 // R3R2R1R0 paddw mm2,mm1 paddw mm2,mm3 // G3G2G1G0 paddw mm4,mm1 // B3B2B1B0 packuswb mm5,mm0 // [0000]R3R2R1R0 packuswb mm2,mm0 // [0000]G3G2G1G0 packuswb mm4,mm0 // [0000]B3B2B1B0 punpcklbw mm5,mm2 // G3R3G2R2G1R1G0R0 punpcklbw mm4,mm0 // 00B300B200B100B0 movq mm1,mm5 punpcklwd mm1,mm4 // 00B1G1R100B0G0R0 punpckhwd mm5,mm4 // 00B3G3R300B2G2R2 movq [edi+16],mm1 movq [edi+24],mm5 add esi,8 add edi,eax dec ecx jnz __blcol_h1v1 } #else // GCC inline assembly code __asm__ ( ".intel_syntax noprefix \n" #ifdef _64BITS "shl rax,2 \n" "mov rcx,8 \n" "pxor mm0,mm0 \n" "__blcol_h1v1: \n" "movd mm1,[rsi] \n" "movd mm2,[rsi+64] \n" "movd mm3,[rsi+128] \n" #else "shl eax,2 \n" "mov ecx,8 \n" "pxor mm0,mm0 \n" "__blcol_h1v1: \n" "movd mm1,[esi] \n" "movd mm2,[esi+64] \n" "movd mm3,[esi+128] \n" #endif "punpcklbw mm1,mm0 \n" "punpcklbw mm2,mm0 \n" "punpcklbw mm3,mm0 \n" sub_128_mmx_reg(mm2,mm3) "psllw mm2,2 \n" "psllw mm3,2 \n" "movq mm4,mm2 \n" "movq mm5,mm3 \n" mul_cxx_mmx_reg(mm2,mm4,mm3,mm5) "paddw mm5,mm1 \n" "paddw mm2,mm1 \n" "paddw mm2,mm3 \n" "paddw mm4,mm1 \n" "packuswb mm5,mm0 \n" "packuswb mm2,mm0 \n" "packuswb mm4,mm0 \n" "punpcklbw mm5,mm2 \n" "punpcklbw mm4,mm0 \n" "movq mm1,mm5 \n" "punpcklwd mm1,mm4 \n" "punpckhwd mm5,mm4 \n" #ifdef _64BITS "movq [rdi],mm1 \n" "movq [rdi+8],mm5 \n" "movd mm1,[rsi+4] \n" "movd mm2,[rsi+68] \n" "movd mm3,[rsi+132] \n" #else "movq [edi],mm1 \n" "movq [edi+8],mm5 \n" "movd mm1,[esi+4] \n" "movd mm2,[esi+68] \n" "movd mm3,[esi+132] \n" #endif "punpcklbw mm1,mm0 \n" "punpcklbw mm2,mm0 \n" "punpcklbw mm3,mm0 \n" sub_128_mmx_reg(mm2,mm3) "psllw mm2,2 \n" "psllw mm3,2 \n" "movq mm4,mm2 \n" "movq mm5,mm3 \n" mul_cxx_mmx_reg(mm2,mm4,mm3,mm5) "paddw mm5,mm1 \n" "paddw mm2,mm1 \n" "paddw mm2,mm3 \n" "paddw mm4,mm1 \n" "packuswb mm5,mm0 \n" "packuswb mm2,mm0 \n" "packuswb mm4,mm0 \n" "punpcklbw mm5,mm2 \n" "punpcklbw mm4,mm0 \n" "movq mm1,mm5 \n" "punpcklwd mm1,mm4 \n" "punpckhwd mm5,mm4 \n" #ifdef _64BITS "movq [rdi+16],mm1 \n" "movq [rdi+24],mm5 \n" "add rsi,8 \n" "add rdi,rax \n" "dec rcx \n" "jnz __blcol_h1v1 \n" #else "movq [edi+16],mm1 \n" "movq [edi+24],mm5 \n" "add esi,8 \n" "add edi,eax \n" "dec ecx \n" "jnz __blcol_h1v1 \n" #endif ".att_syntax \n" : /* no output */ : "D"(rgb),"S"(block),"a"(width) #ifdef _64BITS : "memory","rcx","mm0","mm1","mm2","mm3","mm4","mm5" #else : "memory","ecx","mm0","mm1","mm2","mm3","mm4","mm5" #endif ); #endif } // Convert 8x8 GRAY8 pixel map to (1xY) block void conv_block_GRAY8Y_mmx(long width,unsigned char *g,short *y) { #ifdef _WINDOWS // Visual C++ inline assembly _asm { mov esi,g mov edi,y mov eax,width mov ecx,8 pxor mm0,mm0 __blrow_gray8: movd mm1,[esi] movd mm2,[esi+4] punpcklbw mm1,mm0 punpcklbw mm2,mm0 psubw mm1,_128mm psubw mm2,_128mm movq [edi] ,mm1 movq [edi+8],mm2 add esi,eax add edi,16 dec ecx jnz __blrow_gray8 } #else // GCC inline assembly code __asm__ ( ".intel_syntax noprefix \n" #ifdef _64BITS "mov rcx,8 \n" "pxor mm0,mm0 \n" "__blrow_gray8: \n" "movd mm1,[rsi] \n" "movd mm2,[rsi+4] \n" "punpcklbw mm1,mm0 \n" "punpcklbw mm2,mm0 \n" sub_128_mmx_reg(mm1,mm2) "movq [rdi] ,mm1 \n" "movq [rdi+8],mm2 \n" "add rsi,rax \n" "add rdi,16 \n" "dec rcx \n" "jnz __blrow_gray8 \n" ".att_syntax \n" : /* no output */ : "D"(y),"S"(g),"a"(width) : "memory","rcx","mm0","mm1","mm2" #else "mov ecx,8 \n" "pxor mm0,mm0 \n" "__blrow_gray8: \n" "movd mm1,[esi] \n" "movd mm2,[esi+4] \n" "punpcklbw mm1,mm0 \n" "punpcklbw mm2,mm0 \n" sub_128_mmx_reg(mm1,mm2) "movq [edi] ,mm1 \n" "movq [edi+8],mm2 \n" "add esi,eax \n" "add edi,16 \n" "dec ecx \n" "jnz __blrow_gray8 \n" ".att_syntax \n" : /* no output */ : "D"(y),"S"(g),"a"(width) : "memory","ecx","mm0","mm1","mm2" #endif ); #endif } // Convert 16x16 RGB24 pixel map to (4xY 1xCb 1xCr) block void conv_block_RGB24H2V2_mmx(long width,unsigned char *rgb,short *y,short *cb,short *cr) { long i,j,y0,pitch; short *yB; // ! Due to wrong gcc stack code (does not detect push), yB is cleared during asm ! pitch = 6*width-48; for(j=0;j<8;j++) { y0 = (((j&4)<<5) + ((j&3)<<4)); for(i=0;i<4;i++) { yB = y + (y0 + (((i&2)<<5) + ((i&1)<<2))); #ifdef _WINDOWS // Visual C++ inline assembly _asm { mov esi,rgb mov edi,yB mov eax,width mov ebx,cb mov edx,cr mov ecx,eax shl eax,1 add eax,ecx pxor mm0,mm0 // Y 1st row movd mm1,[esi] // [0000]xxB0G0R0 movd mm3,[esi+6] // [0000]xxB2G2R2 movd mm2,[esi+3] // [0000]xxB1G1R1 movd mm4,[esi+8] // [0000]B3G3R3xx psrlq mm4,8 // [0000]xxB3G3R3 punpcklbw mm1,mm0 // xxB0G0R0 punpcklbw mm2,mm0 // xxB1G1R1 punpcklbw mm3,mm0 // xxB2G2R2 punpcklbw mm4,mm0 // xxB3G3R3 movq mm6,mm3 movq mm7,mm1 punpcklwd mm1,mm2 // G1G0R1R0 punpcklwd mm3,mm4 // G3G2R3R2 movq mm5,mm1 punpckldq mm1,mm3 // R3R2R1R0 punpckhdq mm5,mm3 // G3G2G1G0 punpckhwd mm7,mm2 // xxxxB1B0 punpckhwd mm6,mm4 // xxxxB3B2 punpckldq mm7,mm6 // B3B2B1B0 psllw mm1,1 psllw mm5,1 psllw mm7,1 pmulhw mm1,_rymm pmulhw mm5,_gymm pmulhw mm7,_bymm paddw mm1,mm5 paddw mm1,mm7 // Y3Y2Y1Y0 paddw mm1,_offymm movq [edi],mm1 // 2nd row movd mm1,[esi+eax] // [0000]xxB0G0R0 movd mm3,[esi+eax+6] // [0000]xxB2G2R2 movd mm2,[esi+eax+3] // [0000]xxB1G1R1 movd mm4,[esi+eax+8] // [0000]B3G3R3xx psrlq mm4,8 // [0000]xxB3G3R3 punpcklbw mm1,mm0 // xxB0G0R0 punpcklbw mm2,mm0 // xxB1G1R1 punpcklbw mm3,mm0 // xxB2G2R2 punpcklbw mm4,mm0 // xxB3G3R3 movq mm6,mm3 movq mm7,mm1 punpcklwd mm1,mm2 // G1G0R1R0 punpcklwd mm3,mm4 // G3G2R3R2 movq mm5,mm1 punpckldq mm1,mm3 // R3R2R1R0 punpckhdq mm5,mm3 // G3G2G1G0 punpckhwd mm7,mm2 // xxxxB1B0 punpckhwd mm6,mm4 // xxxxB3B2 punpckldq mm7,mm6 // B3B2B1B0 psllw mm1,1 psllw mm5,1 psllw mm7,1 pmulhw mm1,_rymm pmulhw mm5,_gymm pmulhw mm7,_bymm paddw mm1,mm5 paddw mm1,mm7 // Y3Y2Y1Y0 paddw mm1,_offymm movq [edi+16],mm1 // CbCr (2x downsampling) movd mm1,[esi] // [0000]xxB00G00R00 movd mm3,[esi+eax] // [0000]xxB01G01R01 movd mm2,[esi+3] // [0000]xxB10G10R10 movd mm4,[esi+eax+3] // [0000]xxB11G11R11 punpcklbw mm1,mm0 punpcklbw mm2,mm0 punpcklbw mm3,mm0 punpcklbw mm4,mm0 paddw mm1,mm2 // xx[B00+B10][G00+G10][R00+R10] paddw mm3,mm4 // xx[B01+B11][G01+G11][R01+R11] paddw mm1,mm3 psrlw mm1,1 // xx[B0][G0][R0] movd mm2,[esi+6] // [0000]xxB00G00R00 movd mm4,[esi+eax+6] // [0000]B01G01R01xx movd mm3,[esi+8] // [0000]xxB10G10R10 movd mm5,[esi+eax+8] // [0000]B11G11R11xx psrlq mm3,8 // [0000]xxB01G01R01 psrlq mm5,8 // [0000]xxB11G11R11 punpcklbw mm2,mm0 punpcklbw mm3,mm0 punpcklbw mm4,mm0 punpcklbw mm5,mm0 paddw mm2,mm3 // xx[B00+B10][G00+G10][R00+R10] paddw mm4,mm5 // xx[B01+B11][G01+G11][R01+R11] paddw mm2,mm4 psrlw mm2,1 // xx[B1][G1][R1] movq mm7,mm1 punpcklwd mm1,mm2 // G1G0R1R0 movq mm5,mm1 punpckldq mm1,mm1 // R1R0R1R0 punpckhdq mm5,mm5 // G1G0G1G0 punpckhwd mm7,mm2 // xxxxB1B0 punpckldq mm7,mm7 // B1B0B1B0 pmulhw mm1,_rcbcrmm pmulhw mm5,_gcbcrmm pmulhw mm7,_bcbcrmm paddw mm1,mm5 paddw mm1,mm7 // cb1cb0cr1cr0 paddw mm1,_rcmm movd [ebx],mm1 psrlq mm1,32 movd [edx],mm1 } // end asm #else // GCC inline assembly code __asm__ ( ".intel_syntax noprefix \n" #ifdef _64BITS "push rbx \n" "mov rbx,rcx \n" "mov rcx,rax \n" "shl rax,1 \n" "add rax,rcx \n" "pxor mm0,mm0 \n" "movd mm1,[rsi] \n" "movd mm3,[rsi+6] \n" "movd mm2,[rsi+3] \n" "movd mm4,[rsi+8] \n" #else "push ebx \n" "mov ebx,ecx \n" "mov ecx,eax \n" "shl eax,1 \n" "add eax,ecx \n" "pxor mm0,mm0 \n" "movd mm1,[esi] \n" "movd mm3,[esi+6] \n" "movd mm2,[esi+3] \n" "movd mm4,[esi+8] \n" #endif "psrlq mm4,8 \n" "punpcklbw mm1,mm0 \n" "punpcklbw mm2,mm0 \n" "punpcklbw mm3,mm0 \n" "punpcklbw mm4,mm0 \n" "movq mm6,mm3 \n" "movq mm7,mm1 \n" "punpcklwd mm1,mm2 \n" "punpcklwd mm3,mm4 \n" "movq mm5,mm1 \n" "punpckldq mm1,mm3 \n" "punpckhdq mm5,mm3 \n" "punpckhwd mm7,mm2 \n" "punpckhwd mm6,mm4 \n" "punpckldq mm7,mm6 \n" "psllw mm1,1 \n" "psllw mm5,1 \n" "psllw mm7,1 \n" mul_rgb_mmx_reg(mm1,mm5,mm7) "paddw mm1,mm5 \n" "paddw mm1,mm7 \n" add_127_mmx_reg(mm1) #ifdef _64BITS "movq [rdi],mm1 \n" "movd mm1,[rsi+rax] \n" "movd mm3,[rsi+rax+6] \n" "movd mm2,[rsi+rax+3] \n" "movd mm4,[rsi+rax+8] \n" #else "movq [edi],mm1 \n" "movd mm1,[esi+eax] \n" "movd mm3,[esi+eax+6] \n" "movd mm2,[esi+eax+3] \n" "movd mm4,[esi+eax+8] \n" #endif "psrlq mm4,8 \n" "punpcklbw mm1,mm0 \n" "punpcklbw mm2,mm0 \n" "punpcklbw mm3,mm0 \n" "punpcklbw mm4,mm0 \n" "movq mm6,mm3 \n" "movq mm7,mm1 \n" "punpcklwd mm1,mm2 \n" "punpcklwd mm3,mm4 \n" "movq mm5,mm1 \n" "punpckldq mm1,mm3 \n" "punpckhdq mm5,mm3 \n" "punpckhwd mm7,mm2 \n" "punpckhwd mm6,mm4 \n" "punpckldq mm7,mm6 \n" "psllw mm1,1 \n" "psllw mm5,1 \n" "psllw mm7,1 \n" mul_rgb_mmx_reg(mm1,mm5,mm7) "paddw mm1,mm5 \n" "paddw mm1,mm7 \n" add_127_mmx_reg(mm1) #ifdef _64BITS "movq [rdi+16],mm1 \n" "movd mm1,[rsi] \n" "movd mm3,[rsi+rax] \n" "movd mm2,[rsi+3] \n" "movd mm4,[rsi+rax+3] \n" #else "movq [edi+16],mm1 \n" "movd mm1,[esi] \n" "movd mm3,[esi+eax] \n" "movd mm2,[esi+3] \n" "movd mm4,[esi+eax+3] \n" #endif "punpcklbw mm1,mm0 \n" "punpcklbw mm2,mm0 \n" "punpcklbw mm3,mm0 \n" "punpcklbw mm4,mm0 \n" "paddw mm1,mm2 \n" "paddw mm3,mm4 \n" "paddw mm1,mm3 \n" "psrlw mm1,1 \n" #ifdef _64BITS "movd mm2,[rsi+6] \n" "movd mm4,[rsi+rax+6] \n" "movd mm3,[rsi+8] \n" "movd mm5,[rsi+rax+8] \n" #else "movd mm2,[esi+6] \n" "movd mm4,[esi+eax+6] \n" "movd mm3,[esi+8] \n" "movd mm5,[esi+eax+8] \n" #endif "psrlq mm3,8 \n" "psrlq mm5,8 \n" "punpcklbw mm2,mm0 \n" "punpcklbw mm3,mm0 \n" "punpcklbw mm4,mm0 \n" "punpcklbw mm5,mm0 \n" "paddw mm2,mm3 \n" "paddw mm4,mm5 \n" "paddw mm2,mm4 \n" "psrlw mm2,1 \n" "movq mm7,mm1 \n" "punpcklwd mm1,mm2 \n" "movq mm5,mm1 \n" "punpckldq mm1,mm1 \n" "punpckhdq mm5,mm5 \n" "punpckhwd mm7,mm2 \n" "punpckldq mm7,mm7 \n" mul_rgbc_mmx_reg(mm1,mm5,mm7) "paddw mm1,mm5 \n" "paddw mm1,mm7 \n" add_1_mmx_reg(mm1) #ifdef _64BITS "movd [rbx],mm1 \n" "psrlq mm1,32 \n" "movd [rdx],mm1 \n" "pop rbx \n" #else "movd [ebx],mm1 \n" "psrlq mm1,32 \n" "movd [edx],mm1 \n" "pop ebx \n" #endif ".att_syntax \n" : /* no output */ : "D"(yB),"S"(rgb),"a"(width),"c"(cb),"d"(cr) : "memory","mm0","mm1","mm2","mm3","mm4","mm5","mm6","mm7" ); #endif cb+=2; cr+=2; rgb+=12; } rgb+=pitch; } } // Convert 16x16 RGB32 pixel map to (4xY 1xCb 1xCr) block void conv_block_RGB32H2V2_mmx(long width,unsigned char *rgb,short *y,short *cb,short *cr) { long i,j,y0,pitch; short *yB; // ! Due to wrong gcc stack code (does not detect push), yB is cleared during asm ! pitch = 8*width-64; for(j=0;j<8;j++) { y0 = (((j&4)<<5) + ((j&3)<<4)); for(i=0;i<4;i++) { yB = y + (y0 + (((i&2)<<5) + ((i&1)<<2))); #ifdef _WINDOWS // Visual C++ inline assembly _asm { mov esi,rgb mov edi,yB mov eax,width mov ebx,cb mov edx,cr pxor mm0,mm0 shl eax,2 // Y 1st row movd mm1,[esi] // [0000]xxB0G0R0 movd mm3,[esi+8] // [0000]xxB2G2R2 movd mm2,[esi+4] // [0000]xxB1G1R1 movd mm4,[esi+12] // [0000]xxB3G3R3 punpcklbw mm1,mm0 // xxB0G0R0 punpcklbw mm2,mm0 // xxB1G1R1 punpcklbw mm3,mm0 // xxB2G2R2 punpcklbw mm4,mm0 // xxB3G3R3 movq mm6,mm3 movq mm7,mm1 punpcklwd mm1,mm2 // G1G0R1R0 punpcklwd mm3,mm4 // G3G2R3R2 movq mm5,mm1 punpckldq mm1,mm3 // R3R2R1R0 punpckhdq mm5,mm3 // G3G2G1G0 punpckhwd mm7,mm2 // xxxxB1B0 punpckhwd mm6,mm4 // xxxxB3B2 punpckldq mm7,mm6 // B3B2B1B0 psllw mm1,1 psllw mm5,1 psllw mm7,1 pmulhw mm1,_rymm pmulhw mm5,_gymm pmulhw mm7,_bymm paddw mm1,mm5 paddw mm1,mm7 // Y3Y2Y1Y0 paddw mm1,_offymm movq [edi],mm1 // 2nd row movd mm1,[esi+eax] // [0000]xxB0G0R0 movd mm3,[esi+eax+8] // [0000]xxB2G2R2 movd mm2,[esi+eax+4] // [0000]xxB1G1R1 movd mm4,[esi+eax+12] // [0000]xxB3G3R3 punpcklbw mm1,mm0 // xxB0G0R0 punpcklbw mm2,mm0 // xxB1G1R1 punpcklbw mm3,mm0 // xxB2G2R2 punpcklbw mm4,mm0 // xxB3G3R3 movq mm6,mm3 movq mm7,mm1 punpcklwd mm1,mm2 // G1G0R1R0 punpcklwd mm3,mm4 // G3G2R3R2 movq mm5,mm1 punpckldq mm1,mm3 // R3R2R1R0 punpckhdq mm5,mm3 // G3G2G1G0 punpckhwd mm7,mm2 // xxxxB1B0 punpckhwd mm6,mm4 // xxxxB3B2 punpckldq mm7,mm6 // B3B2B1B0 psllw mm1,1 psllw mm5,1 psllw mm7,1 pmulhw mm1,_rymm pmulhw mm5,_gymm pmulhw mm7,_bymm paddw mm1,mm5 paddw mm1,mm7 // Y3Y2Y1Y0 paddw mm1,_offymm movq [edi+16],mm1 // CbCr (2x downsampling) movd mm1,[esi] // [0000]xxB00G00R00 movd mm3,[esi+eax] // [0000]xxB01G01R01 movd mm2,[esi+4] // [0000]xxB10G10R10 movd mm4,[esi+eax+4] // [0000]xxB11G11R11 punpcklbw mm1,mm0 punpcklbw mm2,mm0 punpcklbw mm3,mm0 punpcklbw mm4,mm0 paddw mm1,mm2 // xx[B00+B10][G00+G10][R00+R10] paddw mm3,mm4 // xx[B01+B11][G01+G11][R01+R11] paddw mm1,mm3 psrlw mm1,1 // xx[B0][G0][R0] movd mm2,[esi+8] // [0000]xxB00G00R00 movd mm4,[esi+eax+8] // [0000]B01G01R01xx movd mm3,[esi+12] // [0000]xxB10G10R10 movd mm5,[esi+eax+12] // [0000]xxB11G11R11 punpcklbw mm2,mm0 punpcklbw mm3,mm0 punpcklbw mm4,mm0 punpcklbw mm5,mm0 paddw mm2,mm3 // xx[B00+B10][G00+G10][R00+R10] paddw mm4,mm5 // xx[B01+B11][G01+G11][R01+R11] paddw mm2,mm4 psrlw mm2,1 // xx[B1][G1][R1] movq mm7,mm1 punpcklwd mm1,mm2 // G1G0R1R0 movq mm5,mm1 punpckldq mm1,mm1 // R1R0R1R0 punpckhdq mm5,mm5 // G1G0G1G0 punpckhwd mm7,mm2 // xxxxB1B0 punpckldq mm7,mm7 // B1B0B1B0 pmulhw mm1,_rcbcrmm pmulhw mm5,_gcbcrmm pmulhw mm7,_bcbcrmm paddw mm1,mm5 paddw mm1,mm7 // cb1cb0cr1cr0 paddw mm1,_rcmm movd [ebx],mm1 psrlq mm1,32 movd [edx],mm1 } // end asm #else // GCC inline assembly code __asm__ ( ".intel_syntax noprefix \n" #ifdef _64BITS "push rbx \n" "mov rbx,rcx \n" "pxor mm0,mm0 \n" "shl rax,2 \n" "movd mm1,[rsi] \n" "movd mm3,[rsi+8] \n" "movd mm2,[rsi+4] \n" "movd mm4,[rsi+12] \n" #else "push ebx \n" "mov ebx,ecx \n" "pxor mm0,mm0 \n" "shl eax,2 \n" "movd mm1,[esi] \n" "movd mm3,[esi+8] \n" "movd mm2,[esi+4] \n" "movd mm4,[esi+12] \n" #endif "punpcklbw mm1,mm0 \n" "punpcklbw mm2,mm0 \n" "punpcklbw mm3,mm0 \n" "punpcklbw mm4,mm0 \n" "movq mm6,mm3 \n" "movq mm7,mm1 \n" "punpcklwd mm1,mm2 \n" "punpcklwd mm3,mm4 \n" "movq mm5,mm1 \n" "punpckldq mm1,mm3 \n" "punpckhdq mm5,mm3 \n" "punpckhwd mm7,mm2 \n" "punpckhwd mm6,mm4 \n" "punpckldq mm7,mm6 \n" "psllw mm1,1 \n" "psllw mm5,1 \n" "psllw mm7,1 \n" mul_rgb_mmx_reg(mm1,mm5,mm7) "paddw mm1,mm5 \n" "paddw mm1,mm7 \n" add_127_mmx_reg(mm1) #ifdef _64BITS "movq [rdi],mm1 \n" "movd mm1,[rsi+rax] \n" "movd mm3,[rsi+rax+8] \n" "movd mm2,[rsi+rax+4] \n" "movd mm4,[rsi+rax+12] \n" #else "movq [edi],mm1 \n" "movd mm1,[esi+eax] \n" "movd mm3,[esi+eax+8] \n" "movd mm2,[esi+eax+4] \n" "movd mm4,[esi+eax+12] \n" #endif "punpcklbw mm1,mm0 \n" "punpcklbw mm2,mm0 \n" "punpcklbw mm3,mm0 \n" "punpcklbw mm4,mm0 \n" "movq mm6,mm3 \n" "movq mm7,mm1 \n" "punpcklwd mm1,mm2 \n" "punpcklwd mm3,mm4 \n" "movq mm5,mm1 \n" "punpckldq mm1,mm3 \n" "punpckhdq mm5,mm3 \n" "punpckhwd mm7,mm2 \n" "punpckhwd mm6,mm4 \n" "punpckldq mm7,mm6 \n" "psllw mm1,1 \n" "psllw mm5,1 \n" "psllw mm7,1 \n" mul_rgb_mmx_reg(mm1,mm5,mm7) "paddw mm1,mm5 \n" "paddw mm1,mm7 \n" add_127_mmx_reg(mm1) #ifdef _64BITS "movq [rdi+16],mm1 \n" "movd mm1,[rsi] \n" "movd mm3,[rsi+rax] \n" "movd mm2,[rsi+4] \n" "movd mm4,[rsi+rax+4] \n" #else "movq [edi+16],mm1 \n" "movd mm1,[esi] \n" "movd mm3,[esi+eax] \n" "movd mm2,[esi+4] \n" "movd mm4,[esi+eax+4] \n" #endif "punpcklbw mm1,mm0 \n" "punpcklbw mm2,mm0 \n" "punpcklbw mm3,mm0 \n" "punpcklbw mm4,mm0 \n" "paddw mm1,mm2 \n" "paddw mm3,mm4 \n" "paddw mm1,mm3 \n" "psrlw mm1,1 \n" #ifdef _64BITS "movd mm2,[rsi+8] \n" "movd mm4,[rsi+rax+8] \n" "movd mm3,[rsi+12] \n" "movd mm5,[rsi+rax+12] \n" #else "movd mm2,[esi+8] \n" "movd mm4,[esi+eax+8] \n" "movd mm3,[esi+12] \n" "movd mm5,[esi+eax+12] \n" #endif "punpcklbw mm2,mm0 \n" "punpcklbw mm3,mm0 \n" "punpcklbw mm4,mm0 \n" "punpcklbw mm5,mm0 \n" "paddw mm2,mm3 \n" "paddw mm4,mm5 \n" "paddw mm2,mm4 \n" "psrlw mm2,1 \n" "movq mm7,mm1 \n" "punpcklwd mm1,mm2 \n" "movq mm5,mm1 \n" "punpckldq mm1,mm1 \n" "punpckhdq mm5,mm5 \n" "punpckhwd mm7,mm2 \n" "punpckldq mm7,mm7 \n" mul_rgbc_mmx_reg(mm1,mm5,mm7) "paddw mm1,mm5 \n" "paddw mm1,mm7 \n" add_1_mmx_reg(mm1) #ifdef _64BITS "movd [rbx],mm1 \n" "psrlq mm1,32 \n" "movd [rdx],mm1 \n" "pop rbx \n" #else "movd [ebx],mm1 \n" "psrlq mm1,32 \n" "movd [edx],mm1 \n" "pop ebx \n" #endif ".att_syntax \n" : /* no output */ : "D"(yB),"S"(rgb),"a"(width),"c"(cb),"d"(cr) : "memory","mm0","mm1","mm2","mm3","mm4","mm5","mm6","mm7" ); #endif cb+=2; cr+=2; rgb+=16; } rgb+=pitch; } } #endif /* JPG_USE_ASM */ tango-8.1.2c+dfsg.orig/lib/cpp/server/jpeg_mmx/Makefile.in0000644000175000017500000004775012205375243022324 0ustar piccapicca# Makefile.in generated by automake 1.11.3 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 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. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ subdir = lib/cpp/server/jpeg_mmx DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/RSSH_CHECK_OMNIORB.m4 \ $(top_srcdir)/m4/RSSH_CHECK_PTHREADS.m4 \ $(top_srcdir)/m4/RSSH_CHECK_SUNPRO_CC.m4 \ $(top_srcdir)/m4/RSSH_ENABLE_PTHREADS.m4 \ $(top_srcdir)/m4/ac_cxx_have_class_strstream.m4 \ $(top_srcdir)/m4/ac_cxx_have_sstream.m4 \ $(top_srcdir)/m4/ac_cxx_namespaces.m4 \ $(top_srcdir)/m4/ac_path_mysqlclient.m4 \ $(top_srcdir)/m4/ac_prog_mysql.m4 \ $(top_srcdir)/m4/ax_cxx_compile_stdcxx_11.m4 \ $(top_srcdir)/m4/ax_jni_include_dir.m4 \ $(top_srcdir)/m4/check_zlib.m4 $(top_srcdir)/m4/gcc_release.m4 \ $(top_srcdir)/m4/java_release.m4 $(top_srcdir)/m4/libtool.m4 \ $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ $(top_srcdir)/m4/mysql_release.m4 $(top_srcdir)/configure.in am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/ac_config.h.tmp CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = LTLIBRARIES = $(noinst_LTLIBRARIES) libjpeg_mmx_la_LIBADD = am_libjpeg_mmx_la_OBJECTS = libjpeg_mmx_la-jpeg_color_mmx.lo \ libjpeg_mmx_la-jpeg_dct_mmx.lo libjpeg_mmx_la_OBJECTS = $(am_libjpeg_mmx_la_OBJECTS) libjpeg_mmx_la_LINK = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CXXLD) \ $(libjpeg_mmx_la_CXXFLAGS) $(CXXFLAGS) $(AM_LDFLAGS) \ $(LDFLAGS) -o $@ DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) depcomp = $(SHELL) $(top_srcdir)/config/depcomp am__depfiles_maybe = depfiles am__mv = mv -f CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) LTCXXCOMPILE = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) CXXLD = $(CXX) CXXLINK = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=link $(CXXLD) $(AM_CXXFLAGS) $(CXXFLAGS) $(AM_LDFLAGS) \ $(LDFLAGS) -o $@ SOURCES = $(libjpeg_mmx_la_SOURCES) DIST_SOURCES = $(libjpeg_mmx_la_SOURCES) ETAGS = etags CTAGS = ctags DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ ALLOCA = @ALLOCA@ AMTAR = @AMTAR@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CORBA_INCLUDES = @CORBA_INCLUDES@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CPP_ELEVEN = @CPP_ELEVEN@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DATADIR = @DATADIR@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DOXYGEN = @DOXYGEN@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ GREP = @GREP@ HAVE_CXX11 = @HAVE_CXX11@ HAVE_ORB_IDL = @HAVE_ORB_IDL@ IDL = @IDL@ IDLCXX = @IDLCXX@ IDLCXXFLAGS = @IDLCXXFLAGS@ IDLFLAGS = @IDLFLAGS@ IDL_CLN_CPP = @IDL_CLN_CPP@ IDL_CLN_CPP_SUFFIX = @IDL_CLN_CPP_SUFFIX@ IDL_CLN_H = @IDL_CLN_H@ IDL_CLN_H1_SUFFIX = @IDL_CLN_H1_SUFFIX@ IDL_CLN_H_SUFFIX = @IDL_CLN_H_SUFFIX@ IDL_CLN_O = @IDL_CLN_O@ IDL_CLN_OBJ_SUFFIX = @IDL_CLN_OBJ_SUFFIX@ IDL_H1_SUFFIX = @IDL_H1_SUFFIX@ IDL_H_SUFFIX = @IDL_H_SUFFIX@ IDL_SRV_CPP = @IDL_SRV_CPP@ IDL_SRV_CPP_SUFFIX = @IDL_SRV_CPP_SUFFIX@ IDL_SRV_H = @IDL_SRV_H@ IDL_SRV_H1_SUFFIX = @IDL_SRV_H1_SUFFIX@ IDL_SRV_H_SUFFIX = @IDL_SRV_H_SUFFIX@ IDL_SRV_O = @IDL_SRV_O@ IDL_SRV_OBJ_SUFFIX = @IDL_SRV_OBJ_SUFFIX@ IDL_TIE_CPP_SUFFIX = @IDL_TIE_CPP_SUFFIX@ IDL_TIE_H1_SUFFIX = @IDL_TIE_H1_SUFFIX@ IDL_TIE_H_SUFFIX = @IDL_TIE_H_SUFFIX@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ JAVA = @JAVA@ JAVAC = @JAVAC@ JAVAH = @JAVAH@ JNI_INCL_DIRS = @JNI_INCL_DIRS@ JPEG_LIB_CXXFLAGS = @JPEG_LIB_CXXFLAGS@ JPEG_MMX_LIB_CXXFLAGS = @JPEG_MMX_LIB_CXXFLAGS@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIBZMQ_CFLAGS = @LIBZMQ_CFLAGS@ LIBZMQ_LIBS = @LIBZMQ_LIBS@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ LYX = @LYX@ MAINT = @MAINT@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ MYSQL = @MYSQL@ MYSQLCLIENT_CFLAGS = @MYSQLCLIENT_CFLAGS@ MYSQLCLIENT_LDFLAGS = @MYSQLCLIENT_LDFLAGS@ MYSQLCLIENT_LIBS = @MYSQLCLIENT_LIBS@ MYSQL_ADMIN = @MYSQL_ADMIN@ MYSQL_ADMIN_PASSWD = @MYSQL_ADMIN_PASSWD@ MYSQL_HOST = @MYSQL_HOST@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ ORB = @ORB@ ORB_COSNAMING_LIB = @ORB_COSNAMING_LIB@ ORB_INCLUDE_PREFIX = @ORB_INCLUDE_PREFIX@ ORB_PREFIX = @ORB_PREFIX@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ TANGO_DB_NAME = @TANGO_DB_NAME@ TANGO_RC_FILE = @TANGO_RC_FILE@ VERSION = @VERSION@ VERSION_INFO = @VERSION_INFO@ ZLIB_CPPFLAGS = @ZLIB_CPPFLAGS@ ZLIB_LDFLAGS = @ZLIB_LDFLAGS@ ZLIB_LIBS = @ZLIB_LIBS@ ZMQ_PREFIX = @ZMQ_PREFIX@ _ACJNI_JAVAC = @_ACJNI_JAVAC@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_aux_dir = @ac_aux_dir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ omniCOS4_CFLAGS = @omniCOS4_CFLAGS@ omniCOS4_LIBS = @omniCOS4_LIBS@ omniORB4_CFLAGS = @omniORB4_CFLAGS@ omniORB4_LIBS = @omniORB4_LIBS@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ subdirs = @subdirs@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ # We need the ORB to compile and the tango header files to compile INCLUDES = -I$(top_srcdir)/lib/cpp/server \ -I$(top_srcdir)/lib/cpp/log4tango/include \ -I$(top_builddir)/lib/cpp/log4tango/include \ -I$(top_srcdir)/lib/cpp/server/jpeg \ $(ORB_INCLUDE_PREFIX) $(LIBZMQ_CFLAGS) # We're making a libtool convenience library which is not to be installed, # therefore the automake noinst variable noinst_LTLIBRARIES = libjpeg_mmx.la libjpeg_mmx_la_CXXFLAGS = @JPEG_MMX_LIB_CXXFLAGS@ -O0 # These are the sources for the library. libjpeg_mmx_la_SOURCES = jpeg_color_mmx.cpp \ jpeg_dct_mmx.cpp all: all-am .SUFFIXES: .SUFFIXES: .cpp .lo .o .obj $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu lib/cpp/server/jpeg_mmx/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu lib/cpp/server/jpeg_mmx/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): 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 libjpeg_mmx.la: $(libjpeg_mmx_la_OBJECTS) $(libjpeg_mmx_la_DEPENDENCIES) $(EXTRA_libjpeg_mmx_la_DEPENDENCIES) $(libjpeg_mmx_la_LINK) $(libjpeg_mmx_la_OBJECTS) $(libjpeg_mmx_la_LIBADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libjpeg_mmx_la-jpeg_color_mmx.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libjpeg_mmx_la-jpeg_dct_mmx.Plo@am__quote@ .cpp.o: @am__fastdepCXX_TRUE@ $(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(CXXCOMPILE) -c -o $@ $< .cpp.obj: @am__fastdepCXX_TRUE@ $(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` @am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'` .cpp.lo: @am__fastdepCXX_TRUE@ $(LTCXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(LTCXXCOMPILE) -c -o $@ $< libjpeg_mmx_la-jpeg_color_mmx.lo: jpeg_color_mmx.cpp @am__fastdepCXX_TRUE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libjpeg_mmx_la_CXXFLAGS) $(CXXFLAGS) -MT libjpeg_mmx_la-jpeg_color_mmx.lo -MD -MP -MF $(DEPDIR)/libjpeg_mmx_la-jpeg_color_mmx.Tpo -c -o libjpeg_mmx_la-jpeg_color_mmx.lo `test -f 'jpeg_color_mmx.cpp' || echo '$(srcdir)/'`jpeg_color_mmx.cpp @am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/libjpeg_mmx_la-jpeg_color_mmx.Tpo $(DEPDIR)/libjpeg_mmx_la-jpeg_color_mmx.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='jpeg_color_mmx.cpp' object='libjpeg_mmx_la-jpeg_color_mmx.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) $(AM_CPPFLAGS) $(CPPFLAGS) $(libjpeg_mmx_la_CXXFLAGS) $(CXXFLAGS) -c -o libjpeg_mmx_la-jpeg_color_mmx.lo `test -f 'jpeg_color_mmx.cpp' || echo '$(srcdir)/'`jpeg_color_mmx.cpp libjpeg_mmx_la-jpeg_dct_mmx.lo: jpeg_dct_mmx.cpp @am__fastdepCXX_TRUE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libjpeg_mmx_la_CXXFLAGS) $(CXXFLAGS) -MT libjpeg_mmx_la-jpeg_dct_mmx.lo -MD -MP -MF $(DEPDIR)/libjpeg_mmx_la-jpeg_dct_mmx.Tpo -c -o libjpeg_mmx_la-jpeg_dct_mmx.lo `test -f 'jpeg_dct_mmx.cpp' || echo '$(srcdir)/'`jpeg_dct_mmx.cpp @am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/libjpeg_mmx_la-jpeg_dct_mmx.Tpo $(DEPDIR)/libjpeg_mmx_la-jpeg_dct_mmx.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='jpeg_dct_mmx.cpp' object='libjpeg_mmx_la-jpeg_dct_mmx.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) $(AM_CPPFLAGS) $(CPPFLAGS) $(libjpeg_mmx_la_CXXFLAGS) $(CXXFLAGS) -c -o libjpeg_mmx_la-jpeg_dct_mmx.lo `test -f 'jpeg_dct_mmx.cpp' || echo '$(srcdir)/'`jpeg_dct_mmx.cpp mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ mkid -fID $$unique tags: TAGS TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) set x; \ here=`pwd`; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: CTAGS CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(LTLIBRARIES) installdirs: install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: 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: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-generic clean-libtool clean-noinstLTLIBRARIES \ mostlyclean-am distclean: distclean-am -rm -rf ./$(DEPDIR) -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -rf ./$(DEPDIR) -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: .MAKE: install-am install-strip .PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \ clean-libtool clean-noinstLTLIBRARIES ctags 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 \ maintainer-clean maintainer-clean-generic mostlyclean \ mostlyclean-compile mostlyclean-generic mostlyclean-libtool \ pdf pdf-am ps ps-am tags uninstall uninstall-am # 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: tango-8.1.2c+dfsg.orig/lib/cpp/server/jpeg_mmx/Makefile.am0000644000175000017500000000121312205375141022270 0ustar piccapicca # We need the ORB to compile and the tango header files to compile INCLUDES = -I$(top_srcdir)/lib/cpp/server \ -I$(top_srcdir)/lib/cpp/log4tango/include \ -I$(top_builddir)/lib/cpp/log4tango/include \ -I$(top_srcdir)/lib/cpp/server/jpeg \ $(ORB_INCLUDE_PREFIX) $(LIBZMQ_CFLAGS) # We're making a libtool convenience library which is not to be installed, # therefore the automake noinst variable noinst_LTLIBRARIES = libjpeg_mmx.la libjpeg_mmx_la_CXXFLAGS=@JPEG_MMX_LIB_CXXFLAGS@ -O0 # These are the sources for the library. libjpeg_mmx_la_SOURCES = jpeg_color_mmx.cpp \ jpeg_dct_mmx.cpp tango-8.1.2c+dfsg.orig/lib/cpp/server/device_3.cpp0000644000175000017500000024373712205375142020637 0ustar piccapiccastatic const char *RcsId = "$Id: device_3.cpp 22491 2013-04-19 11:30:51Z taurel $\n$Name$"; //==================================================================================================================== // // file : Device_3.cpp // // description : C++ source code for the DeviceImpl and DeviceClass classes. These classes are the root class // for all derived Device classes. They are abstract classes. The DeviceImpl class is the // CORBA servant which is "exported" onto the network and accessed by the client. // // project : TANGO // // author(s) : E.Taurel // // Copyright (C) : 2004,2005,2006,2007,2008,2009,2010,2011,2012,2013 // European Synchrotron Radiation Facility // BP 220, Grenoble 38043 // FRANCE // // This file is part of Tango. // // Tango 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. // // Tango 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 Tango. // If not, see . // // $Revision: 22491 $ // //==================================================================================================================== #if HAVE_CONFIG_H #include #endif #include #include #include #include #ifdef _TG_WINDOWS_ #include #else #include #endif /* _TG_WINDOWS_ */ namespace Tango { //+------------------------------------------------------------------------------------------------------------------- // // method : // Device_3Impl::Device_3Impl // // description : // Constructors for the device_impl class from the class object pointer, the device name, the description field, // the state and the status. Device_3Impl inherits from DeviceImpl. These constructors simply call the correct // DeviceImpl class constructor // //-------------------------------------------------------------------------------------------------------------------- Device_3Impl::Device_3Impl(DeviceClass *device_class,string &dev_name): Device_2Impl(device_class,dev_name),ext_3(new Device_3ImplExt) { real_ctor(); } Device_3Impl::Device_3Impl(DeviceClass *device_class, string &dev_name, string &desc): Device_2Impl(device_class,dev_name,desc),ext_3(new Device_3ImplExt) { real_ctor(); } Device_3Impl::Device_3Impl(DeviceClass *device_class, string &dev_name,string &desc, Tango::DevState dev_state,string &dev_status): Device_2Impl(device_class,dev_name,desc,dev_state,dev_status),ext_3(new Device_3ImplExt) { real_ctor(); } Device_3Impl::Device_3Impl(DeviceClass *device_class, const char *dev_name, const char *desc, Tango::DevState dev_state, const char *dev_status): Device_2Impl(device_class,dev_name,desc,dev_state,dev_status),ext_3(new Device_3ImplExt) { real_ctor(); } void Device_3Impl::real_ctor() { ext->idl_version = 3; add_state_status_attrs(); init_cmd_poll_period(); init_attr_poll_period(); Tango::Util *tg = Tango::Util::instance(); if (tg->_UseDb == false) { init_poll_no_db(); } } //+------------------------------------------------------------------------------------------------------------------- // // method : // Device_3Impl::read_attributes_3 // // description : // Method called for each read_attributes operation executed from any client on a Tango device version 3. // //-------------------------------------------------------------------------------------------------------------------- Tango::AttributeValueList_3* Device_3Impl::read_attributes_3(const Tango::DevVarStringArray& names, Tango::DevSource source) { cout4 << "Device_3Impl::read_attributes_3 arrived for dev " << get_name() << ", att[0] = " << names[0] << endl; // // Record operation request in black box // if (ext->store_in_bb == true) blackbox_ptr->insert_attr(names,3,source); ext->store_in_bb = true; // // Build a sequence with the names of the attribute to be read. This is necessary in case of the "AllAttr" shortcut is // used. If all attributes are wanted, build this list // unsigned long nb_names = names.length(); unsigned long nb_dev_attr = dev_attr->get_attr_nb(); Tango::DevVarStringArray real_names(nb_names); unsigned long i; if (nb_names == 1) { string att_name(names[0]); if (att_name == AllAttr) { real_names.length(nb_dev_attr); for (i = 0;i < nb_dev_attr;i++) { real_names[i] = dev_attr->get_attr_by_ind(i).get_name().c_str(); } } else { real_names = names; } } else { real_names = names; } nb_names = real_names.length(); // // Allocate memory for the AttributeValue structures // Tango::AttributeValueList_3 *back; Tango::AttributeValueList_4 *back4 = NULL; try { back = new Tango::AttributeValueList_3(nb_names); back->length(nb_names); } catch (bad_alloc) { Except::throw_exception((const char *)API_MemoryAllocation, (const char *)"Can't allocate memory in server", (const char *)"Device_3Impl::read_attributes_3"); } // // If the source parameter specifies device, call the read_attributes method which does not throw exception except for // major fault (cannot allocate memory,....) // vector idx_in_back; if (source == Tango::DEV) { try { AutoTangoMonitor sync(this); read_attributes_no_except(real_names,back,back4,false,idx_in_back); } catch (...) { delete back; throw; } } else if (source == Tango::CACHE) { try { TangoMonitor &mon = get_poll_monitor(); AutoTangoMonitor sync(&mon); read_attributes_from_cache(real_names,back,back4); } catch (...) { delete back; throw; } } else { // // It must be now CACHE_DEVICE (no other choice), first try to get values from cache // try { TangoMonitor &mon = get_poll_monitor(); AutoTangoMonitor sync(&mon); read_attributes_from_cache(real_names,back,back4); } catch (...) { delete back; throw; } // // Now, build the list of attributes which it was not possible to get their value from cache // Tango::DevVarStringArray names_from_device(nb_names); long nb_attr = 0; for (i = 0;i < nb_names;i++) { long nb_err = (*back)[i].err_list.length(); if (nb_err != 0) { nb_err--; if ((strcmp((*back)[i].err_list[nb_err].reason,API_AttrNotPolled) == 0) || (strcmp((*back)[i].err_list[nb_err].reason,API_NoDataYet) == 0) || (strcmp((*back)[i].err_list[nb_err].reason,API_NotUpdatedAnyMore) == 0) || (strcmp((*back)[i].err_list[nb_err].origin,"DServer::add_obj_polling") == 0)) { nb_attr++; names_from_device.length(nb_attr); names_from_device[nb_attr - 1] = real_names[i]; idx_in_back.push_back(i); (*back)[i].err_list.length(0); } } } if (nb_attr != 0) { // // Try to get their values from device // try { AutoTangoMonitor sync(this); read_attributes_no_except(names_from_device,back,back4,true,idx_in_back); } catch (...) { delete back; throw; } } } return back; } //+------------------------------------------------------------------------------------------------------------------ // // method : // Device_3Impl::read_attributes_no_except // // description : // Read attributes from device but do not throw exception if it fails. This method is mainly a copy of the // original DeviceImpl::read_attributes method. // // arguments: // in : // - names: The names of the attribute to read // - back : Pointer to the sequence returned to the client. // - back4 : Pointer to the sequence returned to the client if the request arrives through IDL version 4 // Memory has already been allocated for this pointer // - second_try : Flag set to true when this method is called due to a client request with source set to // CACHE_DEVICE and the reading the value from the cache failed for one reason or another // //------------------------------------------------------------------------------------------------------------------- void Device_3Impl::read_attributes_no_except(const Tango::DevVarStringArray& names, Tango::AttributeValueList_3 *&back, Tango::AttributeValueList_4 *&back4, bool second_try, vector &idx) { // // Write the device name into the per thread data for sub device diagnostics. // Keep the old name, to put it back at the end! // During device access inside the same server, the thread stays the same! // SubDevDiag &sub = (Tango::Util::instance())->get_sub_dev_diag(); string last_associated_device = sub.get_associated_device(); sub.set_associated_device(get_name()); // // Catch all exceptions to set back the associated device after execution // try { // // Retrieve index of wanted attributes in the device attribute list and clear their value set flag // long nb_names = names.length(); vector wanted_attr; vector wanted_w_attr; bool state_wanted = false; bool status_wanted = false; long state_idx,status_idx; long i; state_idx = status_idx = -1; for (i = 0;i < nb_names;i++) { AttIdx x; x.idx_in_names = i; string att_name(names[i]); transform(att_name.begin(),att_name.end(),att_name.begin(),::tolower); if (att_name == "state") { x.idx_in_multi_attr = -1; x.failed = false; wanted_attr.push_back(x); state_wanted = true; state_idx = i; } else if (att_name == "status") { x.idx_in_multi_attr = -1; x.failed = false; wanted_attr.push_back(x); status_wanted = true; status_idx = i; } else { try { long j; j = dev_attr->get_attr_ind_by_name(names[i]); if ((dev_attr->get_attr_by_ind(j).get_writable() == Tango::READ_WRITE) || (dev_attr->get_attr_by_ind(j).get_writable() == Tango::READ_WITH_WRITE)) { x.idx_in_multi_attr = j; x.failed = false; Attribute &att = dev_attr->get_attr_by_ind(x.idx_in_multi_attr); if(att.is_startup_exception()) att.throw_startup_exception("Device_3Impl::read_attributes_no_except()"); wanted_w_attr.push_back(x); wanted_attr.push_back(x); att.set_value_flag(false); att.get_when().tv_sec = 0; att.save_alarm_quality(); } else { if (dev_attr->get_attr_by_ind(j).get_writable() == Tango::WRITE) { x.idx_in_multi_attr = j ; x.failed = false; Attribute &att = dev_attr->get_attr_by_ind(x.idx_in_multi_attr); if(att.is_startup_exception()) att.throw_startup_exception("Device_3Impl::read_attributes_no_except()"); wanted_w_attr.push_back(x); } else { x.idx_in_multi_attr = j; x.failed = false; Attribute &att = dev_attr->get_attr_by_ind(x.idx_in_multi_attr); if(att.is_startup_exception()) att.throw_startup_exception("Device_3Impl::read_attributes_no_except()"); wanted_attr.push_back(x); att.set_value_flag(false); att.get_when().tv_sec = 0; att.save_alarm_quality(); } } } catch (Tango::DevFailed &e) { long index; if (second_try == false) index = i; else index = idx[i]; if (back != NULL) { (*back)[index].err_list = e.errors; (*back)[index].quality = Tango::ATTR_INVALID; (*back)[index].name = CORBA::string_dup(names[i]); clear_att_dim((*back)[index]); } else { (*back4)[index].err_list = e.errors; (*back4)[index].quality = Tango::ATTR_INVALID; (*back4)[index].name = CORBA::string_dup(names[i]); clear_att_dim((*back4)[index]); } } } } long nb_wanted_attr = wanted_attr.size(); long nb_wanted_w_attr = wanted_w_attr.size(); // // Call the always_executed_hook // always_executed_hook(); // // Read the hardware for readable attribute but not for state/status // Warning: If the state is one of the wanted attribute, check and eventually add all the alarmed attributes index // if (nb_wanted_attr != 0) { vector tmp_idx; for (i = 0;i < nb_wanted_attr;i++) { long ii = wanted_attr[i].idx_in_multi_attr; if (ii != -1) tmp_idx.push_back(ii); } if (state_wanted == true) { if ((device_state == Tango::ON) || (device_state == Tango::ALARM)) add_alarmed(tmp_idx); } if (tmp_idx.empty() == false) read_attr_hardware(tmp_idx); } // // Set attr value (for readable attribute) but not for state/status // for (i = 0;i < nb_wanted_attr;i++) { if (wanted_attr[i].idx_in_multi_attr != -1) { Attribute &att = dev_attr->get_attr_by_ind(wanted_attr[i].idx_in_multi_attr); bool is_allowed_failed = false; try { vector &attr_vect = device_class->get_class_attr()->get_attr_list(); if (attr_vect[att.get_attr_idx()]->is_allowed(this,Tango::READ_REQ) == false) { is_allowed_failed = true; TangoSys_OMemStream o; o << "It is currently not allowed to read attribute "; o << att.get_name() << ends; Except::throw_exception((const char *)API_AttrNotAllowed, o.str(), (const char *)"Device_3Impl::read_attributes_no_except"); } // // Take the attribute mutex before calling the user read method // if ((att.get_attr_serial_model() == ATTR_BY_KERNEL) && (back4 != NULL)) { cout4 << "Locking attribute mutex for attribute " << att.get_name() << endl; omni_mutex *attr_mut = att.get_attr_mutex(); if (attr_mut->trylock() == 0) { cout4 << "Mutex for attribute " << att.get_name() << " is already taken.........." << endl; attr_mut->lock(); } } // // Call the user read method except if the attribute is writable and memorized and if the write failed during the // device startup sequence // if (att.is_mem_exception() == false) attr_vect[att.get_attr_idx()]->read(this,att); else { Tango::WAttribute &w_att = static_cast(att); Tango::DevFailed df(w_att.get_mem_exception()); TangoSys_OMemStream o; o << "Attribute " << w_att.get_name() << " is a memorized attribute."; o << " It failed during the write call of the device startup sequence"; Tango::Except::re_throw_exception(df,API_MemAttFailedDuringInit,o.str(), "Device_3::read_attributes_no_except"); } } catch (Tango::DevFailed &e) { long index; if (second_try == false) index = wanted_attr[i].idx_in_names; else index = idx[wanted_attr[i].idx_in_names]; wanted_attr[i].failed = true; if (back != NULL) { (*back)[index].err_list = e.errors; (*back)[index].quality = Tango::ATTR_INVALID; (*back)[index].name = CORBA::string_dup(names[wanted_attr[i].idx_in_names]); clear_att_dim((*back)[index]); } else { if ((att.get_attr_serial_model() == ATTR_BY_KERNEL) && (is_allowed_failed == false)) { cout4 << "Releasing attribute mutex for attribute " << att.get_name() << " due to error" << endl; omni_mutex *attr_mut = att.get_attr_mutex(); attr_mut->unlock(); } (*back4)[index].err_list = e.errors; (*back4)[index].quality = Tango::ATTR_INVALID; (*back4)[index].name = CORBA::string_dup(names[wanted_attr[i].idx_in_names]); clear_att_dim((*back4)[index]); } } catch (...) { long index; if (second_try == false) index = wanted_attr[i].idx_in_names; else index = idx[wanted_attr[i].idx_in_names]; wanted_attr[i].failed = true; Tango::DevErrorList del; del.length(1); del[0].severity = Tango::ERR; del[0].origin = CORBA::string_dup("Device_3Impl::read_attributes_no_except"); del[0].reason = CORBA::string_dup("API_CorbaSysException "); del[0].desc = CORBA::string_dup("Unforseen exception when trying to read attribute. It was even not a Tango DevFailed exception"); if (back != NULL) { (*back)[index].err_list = del; (*back)[index].quality = Tango::ATTR_INVALID; (*back)[index].name = CORBA::string_dup(names[wanted_attr[i].idx_in_names]); clear_att_dim((*back)[index]); } else { if ((att.get_attr_serial_model() == ATTR_BY_KERNEL) && (is_allowed_failed == false)) { cout4 << "Releasing attribute mutex for attribute " << att.get_name() << " due to a severe error which is not a DevFailed" << endl; omni_mutex *attr_mut = att.get_attr_mutex(); attr_mut->unlock(); } (*back4)[index].err_list = del; (*back4)[index].quality = Tango::ATTR_INVALID; (*back4)[index].name = CORBA::string_dup(names[wanted_attr[i].idx_in_names]); clear_att_dim((*back4)[index]); } } } } // // Set attr value for writable attribute // for (i = 0;i < nb_wanted_w_attr;i++) { Attribute &att = dev_attr->get_attr_by_ind(wanted_w_attr[i].idx_in_multi_attr); Tango::AttrWriteType w_type = att.get_writable(); try { if (att.is_mem_exception() == true) { Tango::WAttribute &w_att = static_cast(att); Tango::DevFailed df(w_att.get_mem_exception()); TangoSys_OMemStream o; o << "Attribute " << w_att.get_name() << " is a memorized attribute."; o << " It failed during the write call of the device startup sequence"; Tango::Except::re_throw_exception(df,API_MemAttFailedDuringInit,o.str(), "Device_3::read_attributes_no_except"); } else { if ((w_type == Tango::READ_WITH_WRITE) || (w_type == Tango::WRITE)) att.set_rvalue(); } } catch (Tango::DevFailed &e) { long index; if (second_try == false) index = wanted_w_attr[i].idx_in_names; else index = idx[wanted_w_attr[i].idx_in_names]; wanted_w_attr[i].failed = true; if (back != NULL) { (*back)[index].err_list = e.errors; (*back)[index].quality = Tango::ATTR_INVALID; (*back)[index].name = CORBA::string_dup(names[wanted_w_attr[i].idx_in_names]); clear_att_dim((*back)[index]); } else { AttrSerialModel atsm = att.get_attr_serial_model(); if ((atsm != ATTR_NO_SYNC) && (w_type == Tango::READ_WITH_WRITE)) { cout4 << "Releasing attribute mutex for attribute " << att.get_name() << " due to error" << endl; omni_mutex *attr_mut = (atsm == ATTR_BY_KERNEL) ? att.get_attr_mutex() : att.get_user_attr_mutex(); attr_mut->unlock(); } (*back4)[index].err_list = e.errors; (*back4)[index].quality = Tango::ATTR_INVALID; (*back4)[index].name = CORBA::string_dup(names[wanted_w_attr[i].idx_in_names]); clear_att_dim((*back4)[index]); } } } // // If necessary, read state and/or status // If the device has some alarmed attributes and some of them have already been read and failed, it is not necessary // to read state, simply copy faulty alarmed attribute error message to the state attribute error messages // Tango::DevState d_state = Tango::UNKNOWN; Tango::ConstDevString d_status = Tango_NullPtr; if (state_wanted == true) { if ((device_state == Tango::ON) || (device_state == Tango::ALARM)) { long id = reading_state_necessary(wanted_attr); if (id == -1) { try { alarmed_not_read(wanted_attr); ext->state_from_read = true; if (is_alarm_state_forced() == true) d_state = DeviceImpl::dev_state(); else d_state = dev_state(); ext->state_from_read = false; } catch (Tango::DevFailed &e) { ext->state_from_read = false; if (back != NULL) { (*back)[state_idx].err_list = e.errors; (*back)[state_idx].quality = Tango::ATTR_INVALID; (*back)[state_idx].name = CORBA::string_dup(names[state_idx]); clear_att_dim((*back)[state_idx]); } else { (*back4)[state_idx].err_list = e.errors; (*back4)[state_idx].quality = Tango::ATTR_INVALID; (*back4)[state_idx].name = CORBA::string_dup(names[state_idx]); clear_att_dim((*back4)[state_idx]); } } } else { if (back != NULL) { (*back)[state_idx].err_list = (*back)[wanted_attr[id].idx_in_names].err_list; (*back)[state_idx].quality = Tango::ATTR_INVALID; (*back)[state_idx].name = CORBA::string_dup(names[state_idx]); clear_att_dim((*back)[state_idx]); } else { (*back4)[state_idx].err_list = (*back4)[wanted_attr[id].idx_in_names].err_list; (*back4)[state_idx].quality = Tango::ATTR_INVALID; (*back4)[state_idx].name = CORBA::string_dup(names[state_idx]); clear_att_dim((*back4)[state_idx]); } } } else d_state = dev_state(); } if (status_wanted == true) { try { if (is_alarm_state_forced() == true) d_status = DeviceImpl::dev_status(); else d_status = dev_status(); } catch (Tango::DevFailed &e) { if (back != NULL) { (*back)[status_idx].err_list = e.errors; (*back)[status_idx].quality = Tango::ATTR_INVALID; (*back)[status_idx].name = CORBA::string_dup(names[status_idx]); clear_att_dim((*back)[status_idx]); } else { (*back4)[status_idx].err_list = e.errors; (*back4)[status_idx].quality = Tango::ATTR_INVALID; (*back4)[status_idx].name = CORBA::string_dup(names[status_idx]); clear_att_dim((*back4)[status_idx]); } } } // // Build the sequence returned to caller for readable attributes and check that all the wanted attributes set value // have been updated // for (i = 0;i < nb_names;i++) { long index; if (second_try == false) index = i; else index = idx[i]; unsigned long nb_err; if (back != NULL) nb_err = (*back)[index].err_list.length(); else nb_err = (*back4)[index].err_list.length(); if ((state_wanted == true) && (state_idx == i)) { if (back != NULL) { if (nb_err == 0) state2attr(d_state,(*back)[index]); } else { if (nb_err == 0) state2attr(d_state,(*back4)[index]); } continue; } if ((status_wanted == true) && (status_idx == i)) { if (back != NULL) { if (nb_err == 0) status2attr(d_status,(*back)[index]); } else { if (nb_err == 0) status2attr(d_status,(*back4)[index]); } continue; } if (nb_err == 0) { Attribute &att = dev_attr->get_attr_by_name(names[i]); Tango::AttrQuality qual = att.get_quality(); if (qual != Tango::ATTR_INVALID) { if (att.get_value_flag() == false) { TangoSys_OMemStream o; try { string att_name(names[i]); transform(att_name.begin(),att_name.end(),att_name.begin(),::tolower); vector::iterator ite = get_polled_obj_by_type_name(Tango::POLL_ATTR,att_name); long upd = (*ite)->get_upd(); if (upd == 0) { o << "Attribute "; o << att.get_name(); o << " value is available only by CACHE.\n"; o << "Attribute values are set by external polling buffer filling" << ends; } else { o << "Read value for attribute "; o << att.get_name(); o << " has not been updated" << ends; } } catch (Tango::DevFailed &) { o << "Read value for attribute "; o << att.get_name(); o << " has not been updated" << ends; } if (back != NULL) { (*back)[index].err_list.length(1); (*back)[index].err_list[0].severity = Tango::ERR; (*back)[index].err_list[0].reason = CORBA::string_dup(API_AttrValueNotSet); (*back)[index].err_list[0].origin = CORBA::string_dup("Device_3Impl::read_attributes_no_except"); string s = o.str(); (*back)[index].err_list[0].desc = CORBA::string_dup(s.c_str()); (*back)[index].quality = Tango::ATTR_INVALID; (*back)[index].name = CORBA::string_dup(att.get_name().c_str()); clear_att_dim((*back)[index]); } else { AttrSerialModel atsm = att.get_attr_serial_model(); if ((i != state_idx) && (i != status_idx) && (atsm != ATTR_NO_SYNC) && (att.get_writable() != Tango::WRITE)) { cout4 << "Releasing attribute mutex for attribute " << att.get_name() << " due to error" << endl; omni_mutex *attr_mut = (atsm == ATTR_BY_KERNEL) ? att.get_attr_mutex() : att.get_user_attr_mutex(); attr_mut->unlock(); } (*back4)[index].err_list.length(1); (*back4)[index].err_list[0].severity = Tango::ERR; (*back4)[index].err_list[0].reason = CORBA::string_dup(API_AttrValueNotSet); (*back4)[index].err_list[0].origin = CORBA::string_dup("Device_3Impl::read_attributes_no_except"); string s = o.str(); (*back4)[index].err_list[0].desc = CORBA::string_dup(s.c_str()); (*back4)[index].quality = Tango::ATTR_INVALID; (*back4)[index].name = CORBA::string_dup(att.get_name().c_str()); clear_att_dim((*back4)[index]); } } else { try { Tango::AttrWriteType w_type = att.get_writable(); if ((w_type == Tango::READ) || (w_type == Tango::READ_WRITE) || (w_type == Tango::READ_WITH_WRITE)) { if ((w_type == Tango::READ_WRITE) || (w_type == Tango::READ_WITH_WRITE)) dev_attr->add_write_value(att); // // Check attribute alarm // if ((att.is_alarmed().any() == true) && (qual != Tango::ATTR_INVALID)) att.check_alarm(); } // // Data into the network object // data_into_net_object(att,back,back4,index,w_type,true); // // Init remaining elements // if (att.get_when().tv_sec == 0) att.set_time(); if (back != NULL) { (*back)[index].time = att.get_when(); (*back)[index].quality = att.get_quality(); (*back)[index].name = CORBA::string_dup(att.get_name().c_str()); (*back)[index].r_dim.dim_x = att.get_x(); (*back)[index].r_dim.dim_y = att.get_y(); if ((w_type == Tango::READ_WRITE) || (w_type == Tango::READ_WITH_WRITE)) { WAttribute &assoc_att = dev_attr->get_w_attr_by_ind(att.get_assoc_ind()); (*back)[index].w_dim.dim_x = assoc_att.get_w_dim_x(); (*back)[index].w_dim.dim_y = assoc_att.get_w_dim_y(); } else { if ( w_type == Tango::WRITE) { // for write only attributes read and set value are the same! (*back)[index].w_dim.dim_x = att.get_x(); (*back)[index].w_dim.dim_y = att.get_y(); } else { // Tango::Read : read only attributes (*back)[index].w_dim.dim_x = 0; (*back)[index].w_dim.dim_y = 0; } } } else { AttrSerialModel atsm = att.get_attr_serial_model(); if ((atsm != ATTR_NO_SYNC) && (w_type != Tango::WRITE)) { cout4 << "Giving attribute mutex to CORBA structure for attribute " << att.get_name() << endl; if (atsm == ATTR_BY_KERNEL) GIVE_ATT_MUTEX(back4,index,att); else GIVE_USER_ATT_MUTEX(back4,index,att); } (*back4)[index].time = att.get_when(); (*back4)[index].quality = att.get_quality(); (*back4)[index].data_format = att.get_data_format(); (*back4)[index].name = CORBA::string_dup(att.get_name().c_str()); (*back4)[index].r_dim.dim_x = att.get_x(); (*back4)[index].r_dim.dim_y = att.get_y(); if ((w_type == Tango::READ_WRITE) || (w_type == Tango::READ_WITH_WRITE)) { WAttribute &assoc_att = dev_attr->get_w_attr_by_ind(att.get_assoc_ind()); (*back4)[index].w_dim.dim_x = assoc_att.get_w_dim_x(); (*back4)[index].w_dim.dim_y = assoc_att.get_w_dim_y(); } else { if ( w_type == Tango::WRITE) { // for write only attributes read and set value are the same! (*back4)[index].w_dim.dim_x = att.get_x(); (*back4)[index].w_dim.dim_y = att.get_y(); } else { // Tango::Read : read only attributes (*back4)[index].w_dim.dim_x = 0; (*back4)[index].w_dim.dim_y = 0; } } } } catch (Tango::DevFailed &e) { if (back != NULL) { (*back)[index].err_list = e.errors; (*back)[index].quality = Tango::ATTR_INVALID; (*back)[index].name = CORBA::string_dup(att.get_name().c_str()); clear_att_dim((*back)[index]); } else { cout4 << "Asking CORBA structure to release attribute mutex for attribute " << att.get_name() << endl; if (att.get_writable() != Tango::WRITE) { REL_ATT_MUTEX(back4,index,att); } (*back4)[index].err_list = e.errors; (*back4)[index].quality = Tango::ATTR_INVALID; (*back4)[index].name = CORBA::string_dup(att.get_name().c_str()); clear_att_dim((*back4)[index]); } } } } else { if (qual != Tango::ATTR_INVALID) qual = Tango::ATTR_INVALID; if (att.get_when().tv_sec == 0) att.set_time(); if (back != NULL) { (*back)[index].time = att.get_when(); (*back)[index].quality = qual; (*back)[index].name = CORBA::string_dup(att.get_name().c_str()); (*back)[index].r_dim.dim_x = 0; (*back)[index].r_dim.dim_y = 0; (*back)[index].w_dim.dim_x = 0; (*back)[index].w_dim.dim_y = 0; } else { AttrSerialModel atsm = att.get_attr_serial_model(); if ((atsm != ATTR_NO_SYNC) && (att.get_writable() != Tango::WRITE)) { cout4 << "Releasing attribute mutex for attribute " << att.get_name() << " due to error" << endl; omni_mutex *attr_mut = (atsm == ATTR_BY_KERNEL) ? att.get_attr_mutex() : att.get_user_attr_mutex(); attr_mut->unlock(); } (*back4)[index].time = att.get_when(); (*back4)[index].quality = qual; (*back4)[index].data_format = att.get_data_format(); (*back4)[index].name = CORBA::string_dup(att.get_name().c_str()); (*back4)[index].r_dim.dim_x = 0; (*back4)[index].r_dim.dim_y = 0; (*back4)[index].w_dim.dim_x = 0; (*back4)[index].w_dim.dim_y = 0; } } } } } catch (...) { // // Set back the device attribution for the thread and rethrow the exception. // sub.set_associated_device(last_associated_device); throw; } // // Set back the device attribution for the thread // sub.set_associated_device(last_associated_device); cout4 << "Leaving Device_3Impl::read_attributes_no_except" << endl; } //+------------------------------------------------------------------------------------------------------------------- // // method : // Device_3Impl::read_attributes_from_cache // // description : // Read attributes from cache but do not throw exception if it fails. This method is mainly a copy of the original // DeviceImpl::read_attributes method. // // argument: // in : // - names: The names of the attribute to read // - back : Pointer to the sequence returned to the client. Memory has already been allocated for // this pointer // - back4 : Pointer to the equence returned to the client when called throught the Device_4 IDL interface // //-------------------------------------------------------------------------------------------------------------------- void Device_3Impl::read_attributes_from_cache(const Tango::DevVarStringArray& names, Tango::AttributeValueList_3 *&back,Tango::AttributeValueList_4 *&back4) { unsigned long nb_names = names.length(); cout4 << "Reading " << nb_names << " attr in read_attributes_from_cache()" << endl; // // Check that device supports the wanted attribute and that the attribute is polled. If some are non polled, store // their index in the real_names sequence in a vector // unsigned long i; vector &poll_list = get_poll_obj_list(); vector non_polled; unsigned long nb_poll = poll_list.size(); unsigned long j; for (i = 0;i < nb_names;i++) { try { dev_attr->get_attr_ind_by_name(names[i]); for (j = 0;j < nb_poll;j++) { #ifdef _TG_WINDOWS_ if (_stricmp(poll_list[j]->get_name().c_str(),names[i]) == 0) #else if (strcasecmp(poll_list[j]->get_name().c_str(),names[i]) == 0) #endif break; } if (j == nb_poll) { non_polled.push_back(i); } } catch (Tango::DevFailed &e) { if (back4 == NULL) { (*back)[i].err_list = e.errors; (*back)[i].quality = Tango::ATTR_INVALID; (*back)[i].name = CORBA::string_dup(names[i]); clear_att_dim((*back)[i]); } else { (*back4)[i].err_list = e.errors; (*back4)[i].quality = Tango::ATTR_INVALID; (*back4)[i].name = CORBA::string_dup(names[i]); clear_att_dim((*back4)[i]); } } } // // If some attributes are not polled but their polling update period is defined, and the attribute is not in the device // list of attr which should not be polled, start to poll them // vector poll_period; unsigned long not_polled_attr = 0; if (non_polled.empty() == false) { // // Check that it is possible to start polling for the non polled attribute // for (i = 0;i < non_polled.size();i++) { Attribute &att = dev_attr->get_attr_by_name(names[non_polled[i]]); poll_period.push_back(att.get_polling_period()); if (poll_period.back() == 0) { TangoSys_OMemStream o; o << "Attribute " << att.get_name() << " not polled" << ends; if (back != NULL) { (*back)[non_polled[i]].err_list.length(1); (*back)[non_polled[i]].err_list[0].severity = Tango::ERR; (*back)[non_polled[i]].err_list[0].reason = CORBA::string_dup(API_AttrNotPolled); (*back)[non_polled[i]].err_list[0].origin = CORBA::string_dup("Device_3Impl::read_attributes_from_cache"); string s = o.str(); (*back)[non_polled[i]].err_list[0].desc = CORBA::string_dup(s.c_str()); (*back)[non_polled[i]].quality = Tango::ATTR_INVALID; (*back)[non_polled[i]].name = CORBA::string_dup(att.get_name().c_str()); clear_att_dim((*back)[non_polled[i]]); } else { (*back4)[non_polled[i]].err_list.length(1); (*back4)[non_polled[i]].err_list[0].severity = Tango::ERR; (*back4)[non_polled[i]].err_list[0].reason = CORBA::string_dup(API_AttrNotPolled); (*back4)[non_polled[i]].err_list[0].origin = CORBA::string_dup("Device_3Impl::read_attributes_from_cache"); string s = o.str(); (*back4)[non_polled[i]].err_list[0].desc = CORBA::string_dup(s.c_str()); (*back4)[non_polled[i]].quality = Tango::ATTR_INVALID; (*back4)[non_polled[i]].name = CORBA::string_dup(att.get_name().c_str()); clear_att_dim((*back4)[non_polled[i]]); } not_polled_attr++; continue; } } // // Leave method if number of attributes which should not be polled is equal to the requested attribute number // if (not_polled_attr == nb_names) return; } // // For each attribute, check that some data are available in cache and that they are not too old // for (i = 0;i < nb_names;i++) { if (back != NULL) { if ((*back)[i].err_list.length() != 0) continue; } else { if ((*back4)[i].err_list.length() != 0) continue; } PollObj *polled_attr = NULL; unsigned long j; for (j = 0;j < poll_list.size();j++) { #ifdef _TG_WINDOWS_ if ((poll_list[j]->get_type() == Tango::POLL_ATTR) && (_stricmp(poll_list[j]->get_name().c_str(),names[i]) == 0)) #else if ((poll_list[j]->get_type() == Tango::POLL_ATTR) && (strcasecmp(poll_list[j]->get_name().c_str(),names[i]) == 0)) #endif { polled_attr = poll_list[j]; break; } } // // In some cases where data from polling are required by a DS for devices marked as polled but for which the polling // is not sarted yet, polled_attr could be NULL at the end of this loop. Return "No data yet" in this case // if (polled_attr == NULL) { TangoSys_OMemStream o; o << "No data available in cache for attribute " << names[i] << ends; if (back != NULL) { (*back)[i].err_list.length(1); (*back)[i].err_list[0].severity = Tango::ERR; (*back)[i].err_list[0].reason = CORBA::string_dup(API_NoDataYet); (*back)[i].err_list[0].origin = CORBA::string_dup("Device_3Impl::read_attributes_from_cache"); string s = o.str(); (*back)[i].err_list[0].desc = CORBA::string_dup(s.c_str()); (*back)[i].quality = Tango::ATTR_INVALID; (*back)[i].name = CORBA::string_dup(names[i]); clear_att_dim((*back)[i]); } else { (*back4)[i].err_list.length(1); (*back4)[i].err_list[0].severity = Tango::ERR; (*back4)[i].err_list[0].reason = CORBA::string_dup(API_NoDataYet); (*back4)[i].err_list[0].origin = CORBA::string_dup("Device_3Impl::read_attributes_from_cache"); string s = o.str(); (*back4)[i].err_list[0].desc = CORBA::string_dup(s.c_str()); (*back4)[i].quality = Tango::ATTR_INVALID; (*back4)[i].name = CORBA::string_dup(names[i]); (*back4)[i].data_format = Tango::FMT_UNKNOWN; clear_att_dim((*back4)[i]); } continue; } // // Check that some data is available in cache // if (polled_attr->is_ring_empty() == true) { TangoSys_OMemStream o; o << "No data available in cache for attribute " << names[i] << ends; if (back != NULL) { (*back)[i].err_list.length(1); (*back)[i].err_list[0].severity = Tango::ERR; (*back)[i].err_list[0].reason = CORBA::string_dup(API_NoDataYet); (*back)[i].err_list[0].origin = CORBA::string_dup("Device_3Impl::read_attributes_from_cache"); string s = o.str(); (*back)[i].err_list[0].desc = CORBA::string_dup(s.c_str()); (*back)[i].quality = Tango::ATTR_INVALID; (*back)[i].name = CORBA::string_dup(names[i]); clear_att_dim((*back)[i]); } else { (*back4)[i].err_list.length(1); (*back4)[i].err_list[0].severity = Tango::ERR; (*back4)[i].err_list[0].reason = CORBA::string_dup(API_NoDataYet); (*back4)[i].err_list[0].origin = CORBA::string_dup("Device_3Impl::read_attributes_from_cache"); string s = o.str(); (*back4)[i].err_list[0].desc = CORBA::string_dup(s.c_str()); (*back4)[i].quality = Tango::ATTR_INVALID; (*back4)[i].name = CORBA::string_dup(names[i]); clear_att_dim((*back4)[i]); } continue; } // // Check that data are still refreshed by the polling thread // Skip this test for object with external polling triggering (upd = 0) // long tmp_upd = polled_attr->get_upd(); if (tmp_upd != 0) { double last = polled_attr->get_last_insert_date(); struct timeval now; #ifdef _TG_WINDOWS_ struct _timeb now_win; _ftime(&now_win); now.tv_sec = (unsigned long)now_win.time; now.tv_usec = (long)now_win.millitm * 1000; #else gettimeofday(&now,NULL); #endif now.tv_sec = now.tv_sec - DELTA_T; double now_d = (double)now.tv_sec + ((double)now.tv_usec / 1000000); double diff_d = now_d - last; if (diff_d > polled_attr->get_authorized_delta()) { TangoSys_OMemStream o; o << "Data in cache for attribute " << names[i]; o << " not updated any more" << ends; if (back != NULL) { (*back)[i].err_list.length(1); (*back)[i].err_list[0].severity = Tango::ERR; (*back)[i].err_list[0].reason = CORBA::string_dup(API_NotUpdatedAnyMore); (*back)[i].err_list[0].origin = CORBA::string_dup("Device_3Impl::read_attributes_from_cache"); string s = o.str(); (*back)[i].err_list[0].desc = CORBA::string_dup(s.c_str()); (*back)[i].quality = Tango::ATTR_INVALID; (*back)[i].name = CORBA::string_dup(names[i]); clear_att_dim((*back)[i]); } else { (*back4)[i].err_list.length(1); (*back4)[i].err_list[0].severity = Tango::ERR; (*back4)[i].err_list[0].reason = CORBA::string_dup(API_NotUpdatedAnyMore); (*back4)[i].err_list[0].origin = CORBA::string_dup("Device_3Impl::read_attributes_from_cache"); string s = o.str(); (*back4)[i].err_list[0].desc = CORBA::string_dup(s.c_str()); (*back4)[i].quality = Tango::ATTR_INVALID; (*back4)[i].name = CORBA::string_dup(names[i]); clear_att_dim((*back4)[i]); } continue; } } // // Get attribute data type // Attribute &att = dev_attr->get_attr_by_name(names[i]); long type = att.get_data_type(); // // Finally, after all these checks, get value and store it in the sequence sent back to user // In order to avoid unnecessary copy, don't use the assignement operator of the AttributeValue structure which copy // each element and therefore also copy the Any object. The Any assignement operator is a deep copy! // Create a new sequence using the attribute buffer and insert it into the Any. The sequence inside the source Any has // been created using the attribute data buffer. // try { long vers = get_dev_idl_version(); { omni_mutex_lock sync(*polled_attr); Tango::AttrQuality qual; if (back != NULL) { // // Get device IDL release. Since release 4, devices are polled using read_attribute_4 // if (vers >= 4) { AttributeValue_4 &att_val = polled_attr->get_last_attr_value_4(false); qual = att_val.quality; } else { AttributeValue_3 &att_val = polled_attr->get_last_attr_value_3(false); qual = att_val.quality; } } else { AttributeValue_4 &att_val = polled_attr->get_last_attr_value_4(false); qual = att_val.quality; } // // Copy the polled data into the Any or the union // if (qual != Tango::ATTR_INVALID) { polled_data_into_net_object(back,back4,i,type,vers,polled_attr,names); } // // Init remaining structure members // if (back != NULL) { long vers = get_dev_idl_version(); if (vers >= 4) { AttributeValue_4 &att_val = polled_attr->get_last_attr_value_4(false); (*back)[i].quality= att_val.quality; (*back)[i].time = att_val.time; (*back)[i].r_dim = att_val.r_dim; (*back)[i].w_dim = att_val.w_dim; (*back)[i].name = CORBA::string_dup(att_val.name); } else { AttributeValue_3 &att_val = polled_attr->get_last_attr_value_3(false); (*back)[i].quality= att_val.quality; (*back)[i].time = att_val.time; (*back)[i].r_dim = att_val.r_dim; (*back)[i].w_dim = att_val.w_dim; (*back)[i].name = CORBA::string_dup(att_val.name); } } else { AttributeValue_4 &att_val = polled_attr->get_last_attr_value_4(false); (*back4)[i].quality= att_val.quality; (*back4)[i].data_format = att_val.data_format; (*back4)[i].time = att_val.time; (*back4)[i].r_dim = att_val.r_dim; (*back4)[i].w_dim = att_val.w_dim; (*back4)[i].name = CORBA::string_dup(att_val.name); } } } catch (Tango::DevFailed &e) { if (back != NULL) { (*back)[i].err_list = e.errors; (*back)[i].quality = Tango::ATTR_INVALID; (*back)[i].name = CORBA::string_dup(names[i]); clear_att_dim((*back)[i]); } else { (*back4)[i].err_list = e.errors; (*back4)[i].quality = Tango::ATTR_INVALID; (*back4)[i].name = CORBA::string_dup(names[i]); clear_att_dim((*back4)[i]); } } } } //+-------------------------------------------------------------------------------------------------------------------- // // method : // DeviceImpl::write_attributes_3 // // description : // CORBA operation to write attribute(s) value // // argument: // in : // - values: The new attribute(s) value to be set. // //-------------------------------------------------------------------------------------------------------------------- void Device_3Impl::write_attributes_3(const Tango::AttributeValueList& values) { AutoTangoMonitor sync(this,true); cout4 << "Device_3Impl::write_attributes_3 arrived" << endl; // // Record operation request in black box. If this method is executed with the request to store info in // blackbox (store_in_bb == true), this means that the request arrives through a Device_2 CORBA interface. // Check locking feature in this case. Otherwise the request has arrived through Device_4 and the check // is already done // if (ext->store_in_bb == true) { blackbox_ptr->insert_attr(values,3); check_lock("write_attributes_3"); } ext->store_in_bb = true; // // Call the method really doing the job // write_attributes_34(&values,NULL); } //+----------------------------------------------------------------------------------------------------------------- // // method : // DeviceImpl::write_attributes_34 // // description : // Method to write the attribute. This method is common to the IDL interface 3 and 4. // // argument: // in : // - values_3: The new attribute(s) value to be set in IDL V3 // - values_4: The new attribute(s) value to be set in IDL V4 // //------------------------------------------------------------------------------------------------------------------ void Device_3Impl::write_attributes_34(const Tango::AttributeValueList *values_3,const Tango::AttributeValueList_4 *values_4) { // // Return exception if the device does not have any attribute // unsigned long nb_dev_attr = dev_attr->get_attr_nb(); if (nb_dev_attr == 0) { Except::throw_exception((const char *)API_AttrNotFound, (const char *)"The device does not have any attribute", (const char *)"DeviceImpl::write_attributes"); } unsigned long nb_failed = 0; Tango::NamedDevErrorList errs; // // Write the device name into the per thread data for sub device diagnostics. // Keep the old name, to put it back at the end! // During device access inside the same server, the thread stays the same! // SubDevDiag &sub = (Tango::Util::instance())->get_sub_dev_diag(); string last_associated_device = sub.get_associated_device(); sub.set_associated_device(get_name()); // // Catch all exceptions to set back the associated device after execution // try { // // Retrieve index of wanted attributes in the device attribute list // vector updated_attr; unsigned long nb_updated_attr; if (values_3 != NULL) nb_updated_attr = values_3->length(); else nb_updated_attr = values_4->length(); unsigned long i; for (i = 0;i < nb_updated_attr;i++) { const char *single_att_name; long single_att_dimx,single_att_dimy; if (values_3 != NULL) { single_att_name = (*values_3)[i].name; single_att_dimx = (*values_3)[i].dim_x; single_att_dimy = (*values_3)[i].dim_y; } else { single_att_name = (*values_4)[i].name; single_att_dimx = (*values_4)[i].w_dim.dim_x; single_att_dimy = (*values_4)[i].w_dim.dim_y; } try { AttIdx idxs; idxs.idx_in_names = i; idxs.idx_in_multi_attr = dev_attr->get_attr_ind_by_name(single_att_name); updated_attr.push_back(idxs); // // Check that these attributes are writable. // For attributes which are not scalar, also check that their dimensions are correct // Attribute &att = dev_attr->get_attr_by_ind(updated_attr.back().idx_in_multi_attr); if ((att.get_writable() == Tango::READ) || (att.get_writable() == Tango::READ_WITH_WRITE)) { TangoSys_OMemStream o; o << "Attribute "; o << att.get_name(); o << " is not writable" << ends; updated_attr.pop_back(); Except::throw_exception((const char *)API_AttrNotWritable, o.str(), (const char *)"DeviceImpl::write_attributes"); } if (att.get_data_format() != Tango::SCALAR) { TangoSys_OMemStream o; bool err = false; if (att.get_max_dim_x() < single_att_dimx) { err = true; o << "X "; } if (err == false) { if (att.get_max_dim_y() < single_att_dimy) { err = true; o << "Y "; } } if (err == true) { o << "dimesion is greater than the max defined for attribute "; o << att.get_name(); o << ends; updated_attr.pop_back(); Except::throw_exception((const char *)API_WAttrOutsideLimit, o.str(), (const char *)"DeviceImpl::write_attributes"); } } // // Check if there are some startup exceptions for the attribute (due to invalid attribute properties configuration). // If so, do not allow to write the attribute. // if(att.is_startup_exception() == true) { updated_attr.pop_back(); att.throw_startup_exception("DeviceImpl::write_attributes()"); } } catch (Tango::DevFailed &e) { nb_failed++; errs.length(nb_failed); errs[nb_failed - 1].name = CORBA::string_dup(single_att_name); errs[nb_failed - 1].index_in_call = i; errs[nb_failed - 1].err_list = e.errors; } } // // Call the always_executed_hook // if (nb_failed != nb_updated_attr) always_executed_hook(); // // Set attribute internal value // vector::iterator ctr; for (ctr = updated_attr.begin();ctr < updated_attr.end();++ctr) { const char *single_att_name; long single_att_dimx,single_att_dimy; if (values_3 != NULL) { single_att_name = (*values_3)[ctr->idx_in_names].name; single_att_dimx = (*values_3)[ctr->idx_in_names].dim_x; single_att_dimy = (*values_3)[ctr->idx_in_names].dim_y; } else { single_att_name = (*values_4)[ctr->idx_in_names].name; single_att_dimx = (*values_4)[ctr->idx_in_names].w_dim.dim_x; single_att_dimy = (*values_4)[ctr->idx_in_names].w_dim.dim_y; } try { if (values_3 == NULL) dev_attr->get_w_attr_by_ind(ctr->idx_in_multi_attr).check_written_value((*values_4)[ctr->idx_in_names].value, (unsigned long)single_att_dimx, (unsigned long)single_att_dimy); else dev_attr->get_w_attr_by_ind(ctr->idx_in_multi_attr).check_written_value((*values_3)[ctr->idx_in_names].value, (unsigned long)single_att_dimx, (unsigned long)single_att_dimy); } catch (Tango::DevFailed &e) { nb_failed++; errs.length(nb_failed); errs[nb_failed - 1].name = CORBA::string_dup(single_att_name); errs[nb_failed - 1].index_in_call = ctr->idx_in_names; errs[nb_failed - 1].err_list = e.errors; ctr = updated_attr.erase(ctr); if (ctr >= updated_attr.end()) break; else { if (ctr == updated_attr.begin()) break; else --ctr; } } } // // Write the hardware. Call this method one attribute at a time in order to correctly initialized the MultiDevFailed // exception in case one of the attribute failed. // if (nb_failed != nb_updated_attr) { vector::iterator ite; vector att_idx; for(ite = updated_attr.begin();ite != updated_attr.end();) { WAttribute &att = dev_attr->get_w_attr_by_ind((*ite).idx_in_multi_attr); att_idx.push_back(ite->idx_in_multi_attr); try { att.set_value_flag(false); att.set_user_set_write_value(false); vector &attr_vect = device_class->get_class_attr()->get_attr_list(); if (attr_vect[att.get_attr_idx()]->is_allowed(this,Tango::WRITE_REQ) == false) { TangoSys_OMemStream o; o << "It is currently not allowed to write attribute "; o << att.get_name(); o << ". The device state is " << Tango::DevStateName[get_state()] << ends; Except::throw_exception((const char *)API_AttrNotAllowed, o.str(), (const char *)"Device_3Impl::write_attributes"); } attr_vect[att.get_attr_idx()]->write(this,att); // // If the write call succeed and if the attribute was memorized but with an exception thrown during the device // startup sequence, clear the memorized exception // if (att.get_mem_write_failed() == true) { att.clear_mem_exception(); set_run_att_conf_loop(true); } ++ite; } catch (Tango::MultiDevFailed &e) { nb_failed++; if (att.get_data_format() == SCALAR) att.rollback(); errs.length(nb_failed); if (values_3 != NULL) errs[nb_failed - 1].name = CORBA::string_dup((*values_3)[(*ite).idx_in_names].name); else errs[nb_failed - 1].name = CORBA::string_dup((*values_4)[(*ite).idx_in_names].name); errs[nb_failed - 1].index_in_call = (*ite).idx_in_names; errs[nb_failed - 1].err_list = e.errors[0].err_list; ite = updated_attr.erase(ite); att_idx.pop_back(); } catch (Tango::DevFailed &e) { nb_failed++; if (att.get_data_format() == SCALAR) att.rollback(); errs.length(nb_failed); if (values_3 != NULL) errs[nb_failed - 1].name = CORBA::string_dup((*values_3)[(*ite).idx_in_names].name); else errs[nb_failed - 1].name = CORBA::string_dup((*values_4)[(*ite).idx_in_names].name); errs[nb_failed - 1].index_in_call = (*ite).idx_in_names; errs[nb_failed - 1].err_list = e.errors; ite = updated_attr.erase(ite); att_idx.pop_back(); } } // // Call the write_attr_hardware method // If it throws DevFailed exception, mark all attributes has failure // If it throws NamedDevFailedList exception, mark only referenced attributes as faulty // long vers = get_dev_idl_version(); if (vers >= 4) { try { write_attr_hardware(att_idx); } catch (Tango::MultiDevFailed &e) { for (unsigned long loop = 0;loop < e.errors.length();loop++) { nb_failed++; errs.length(nb_failed); vector::iterator ite_att; for(ite_att = updated_attr.begin();ite_att != updated_attr.end();++ite_att) { if (TG_strcasecmp(dev_attr->get_w_attr_by_ind(ite_att->idx_in_multi_attr).get_name().c_str(),e.errors[loop].name) == 0) { errs[nb_failed - 1].index_in_call = ite_att->idx_in_names; errs[nb_failed - 1].name = CORBA::string_dup(e.errors[loop].name); errs[nb_failed - 1].err_list = e.errors[loop].err_list; WAttribute &att = dev_attr->get_w_attr_by_ind(ite_att->idx_in_multi_attr); if (att.get_data_format() == SCALAR) att.rollback(); break; } } updated_attr.erase(ite_att); } } catch (Tango::DevFailed &e) { vector::iterator ite; for(ite = att_idx.begin();ite != att_idx.end();++ite) { WAttribute &att = dev_attr->get_w_attr_by_ind(*ite); nb_failed++; if (att.get_data_format() == SCALAR) att.rollback(); errs.length(nb_failed); errs[nb_failed - 1].name = CORBA::string_dup(att.get_name().c_str()); vector::iterator ite_att; for(ite_att = updated_attr.begin();ite_att != updated_attr.end();++ite_att) { if (ite_att->idx_in_multi_attr == *ite) { errs[nb_failed - 1].index_in_call = ite_att->idx_in_names; break; } } errs[nb_failed - 1].err_list = e.errors; } updated_attr.clear(); } } } // // Copy data into Attribute object, store the memorized one in db and if the attribute has a RDS alarm, set the write // date // // Warning: Do not copy caller value if the user has manually set the attribute written value in its write method // // WARNING: --> The DevEncoded data type is supported only as SCALAR and is not memorizable. // Therefore, no need to call copy_data // vector att_in_db; for (i = 0;i < updated_attr.size();i++) { WAttribute &att = dev_attr->get_w_attr_by_ind(updated_attr[i].idx_in_multi_attr); if (values_3 != NULL) { if (att.get_user_set_write_value() == false) att.copy_data((*values_3)[updated_attr[i].idx_in_names].value); } else { if (att.get_user_set_write_value() == false) att.copy_data((*values_4)[updated_attr[i].idx_in_names].value); } if (att.is_memorized() == true) { att_in_db.push_back(i); if (att.get_mem_value() == MemNotUsed) att.set_mem_value("Set"); } if (att.is_alarmed().test(Attribute::rds) == true) att.set_written_date(); } if ((Tango::Util::_UseDb == true) && (att_in_db.empty() == false)) { try { write_attributes_in_db(att_in_db,updated_attr); } catch (Tango::DevFailed &e) { errs.length(nb_failed + att_in_db.size()); for (i = 0;i < att_in_db.size();i++) { const char *single_att_name; if (values_3 != NULL) single_att_name = (*values_3)[updated_attr[att_in_db[i]].idx_in_names].name; else single_att_name = (*values_4)[updated_attr[att_in_db[i]].idx_in_names].name; errs[nb_failed + i].name = CORBA::string_dup(single_att_name); errs[nb_failed + i].index_in_call = updated_attr[att_in_db[i]].idx_in_names; errs[nb_failed + i].err_list = e.errors; } nb_failed = nb_failed + att_in_db.size(); } } } catch (...) { // // Set back the device attribution for the thread and rethrow the exception. // sub.set_associated_device(last_associated_device); throw; } // // Set back the device attribution for the thread // sub.set_associated_device(last_associated_device); // // Return to caller. // cout4 << "Leaving Device_3Impl::write_attributes_34" << endl; if (nb_failed != 0) { throw Tango::MultiDevFailed(errs); } } //+------------------------------------------------------------------------------------------------------------------- // // method : // Device_3Impl::read_attribute_history_3 // // description : // CORBA operation to read attribute value history from the polling buffer. // // argument: // in : // - name : attribute name // - n : history depth (in record number) // // return : // This method returns a pointer to a DevAttrHistoryList with one DevAttrHistory structure for each // attribute record // //-------------------------------------------------------------------------------------------------------------------- Tango::DevAttrHistoryList_3 *Device_3Impl::read_attribute_history_3(const char* name, CORBA::Long n) { TangoMonitor &mon = get_poll_monitor(); AutoTangoMonitor sync(&mon); cout4 << "Device_3Impl::read_attribute_history_3 arrived" << endl; // // Record operation request in black box // blackbox_ptr->insert_op(Op_Read_Attr_history_3); Tango::DevAttrHistoryList_3 *back = NULL; vector &poll_list = get_poll_obj_list(); long nb_poll = poll_list.size(); // // Check that the device supports this attribute. This method returns an exception in case of unsupported attribute // Attribute &att = dev_attr->get_attr_by_name(name); string attr_str(name); transform(attr_str.begin(),attr_str.end(),attr_str.begin(),::tolower); // // Check that the wanted attribute is polled. // long j; PollObj *polled_attr = NULL; for (j = 0;j < nb_poll;j++) { if ((poll_list[j]->get_type() == Tango::POLL_ATTR) && (poll_list[j]->get_name() == attr_str)) { polled_attr = poll_list[j]; break; } } if (polled_attr == NULL) { TangoSys_OMemStream o; o << "Attribute " << attr_str << " not polled" << ends; Except::throw_exception((const char *)API_AttrNotPolled, o.str(), (const char *)"Device_3Impl::read_attribute_history_3"); } // // Check that some data is available in cache // if (polled_attr->is_ring_empty() == true) { TangoSys_OMemStream o; o << "No data available in cache for attribute " << attr_str << ends; Except::throw_exception((const char *)API_NoDataYet, o.str(), (const char *)"Device_3Impl::read_attribute_history_3"); } // // Set the number of returned records // long in_buf = polled_attr->get_elt_nb_in_buffer(); if (n > in_buf) n = in_buf; // // Allocate memory for the returned value // try { back = new Tango::DevAttrHistoryList_3(n); back->length(n); } catch (bad_alloc) { Except::throw_exception((const char *)API_MemoryAllocation, (const char *)"Can't allocate memory in server", (const char *)"Device_3Impl::read_attribute_history_3"); } // // Get attribute value history // long vers = get_dev_idl_version(); if (vers < 4) polled_attr->get_attr_history(n,back,att.get_data_type()); else polled_attr->get_attr_history_43(n,back,att.get_data_type()); cout4 << "Leaving Device_3Impl::command_inout_history_3 method" << endl; return back; } //+-------------------------------------------------------------------------------------------------------------------- // // method : // Device_3Impl::info_3 // // description : // CORBA operation to get device info // //-------------------------------------------------------------------------------------------------------------------- Tango::DevInfo_3 *Device_3Impl::info_3() { cout4 << "Device_3Impl::info_3 arrived" << endl; Tango::DevInfo_3 *back = NULL; // // Allocate memory for the stucture sent back to caller. The ORB will free it // try { back = new Tango::DevInfo_3(); } catch (bad_alloc) { Except::throw_exception((const char *)API_MemoryAllocation, (const char *)"Can't allocate memory in server", (const char *)"Device_3Impl::info_3"); } // // Retrieve server host // Tango::Util *tango_ptr = Tango::Util::instance(); back->server_host = CORBA::string_dup(tango_ptr->get_host_name().c_str()); // // Fill-in remaining structure fields // back->dev_class = CORBA::string_dup(device_class->get_name().c_str()); back->server_id = CORBA::string_dup(tango_ptr->get_ds_name().c_str()); back->server_version = DevVersion; // // Build the complete info sent in the doc_url string // string doc_url("Doc URL = "); doc_url = doc_url + device_class->get_doc_url(); string &cvs_tag = device_class->get_cvs_tag(); if (cvs_tag.size() != 0) { doc_url = doc_url + "\nCVS Tag = "; doc_url = doc_url + cvs_tag; } string &cvs_location = device_class->get_cvs_location(); if (cvs_location.size() != 0) { doc_url = doc_url + "\nCVS Location = "; doc_url = doc_url + cvs_location; } back->doc_url = CORBA::string_dup(doc_url.c_str()); // // Set the device type // back->dev_type = CORBA::string_dup(device_class->get_type().c_str()); // // Record operation request in black box // blackbox_ptr->insert_op(Op_Info_3); // // Return to caller // cout4 << "Leaving Device_3Impl::info_3" << endl; return back; } //+------------------------------------------------------------------------------------------------------------------ // // method : // Device_3Impl::get_attribute_config_3 // // description : // CORBA operation to get attribute configuration. // // WARNING !!!!!!!!!!!!!!!!!! // // This is the release 3 of this CORBA operation which returns much more parameter than in release 2 // The code has been duplicated in order to keep it clean (avoid many "if" on version number in a common method) // // argument: // in : // - names: name of attribute(s) // // return : // This method returns a pointer to a AttributeConfigList_3 with one AttributeConfig_3 structure for each atribute // //-------------------------------------------------------------------------------------------------------------------- Tango::AttributeConfigList_3 *Device_3Impl::get_attribute_config_3(const Tango::DevVarStringArray& names) { TangoMonitor &mon = get_att_conf_monitor(); AutoTangoMonitor sync(&mon); cout4 << "Device_3Impl::get_attribute_config_3 arrived" << endl; long nb_attr = names.length(); Tango::AttributeConfigList_3 *back = NULL; bool all_attr = false; // // Record operation request in black box // blackbox_ptr->insert_op(Op_Get_Attr_Config_3); // // Get attribute number and device version // long nb_dev_attr = dev_attr->get_attr_nb(); // // Check if the caller want to get config for all attribute. // If the device implements IDL 3 (State and status as attributes) and the client is an old one (not able to read // state/status as attribute), decrement attribute number // string in_name(names[0]); if (nb_attr == 1) { if (in_name == AllAttr_3) { all_attr = true; nb_attr = nb_dev_attr; } } // // Allocate memory for the AttributeConfig structures // try { back = new Tango::AttributeConfigList_3(nb_attr); back->length(nb_attr); } catch (bad_alloc) { Except::throw_exception((const char *)API_MemoryAllocation, (const char *)"Can't allocate memory in server", (const char *)"Device_3Impl::get_attribute_config_3"); } // // Fill in these structures // for (long i = 0;i < nb_attr;i++) { try { if (all_attr == true) { Attribute &attr = dev_attr->get_attr_by_ind(i); attr.get_properties_3((*back)[i]); } else { Attribute &attr = dev_attr->get_attr_by_name(names[i]); attr.get_properties_3((*back)[i]); } } catch (Tango::DevFailed &) { delete back; throw; } } // // Return to caller // cout4 << "Leaving Device_3Impl::get_attribute_config_3" << endl; return back; } //+------------------------------------------------------------------------------------------------------------------- // // method : // Device_3Impl::set_attribute_config_3 // // description : // CORBA operation to set attribute configuration locally and in the Tango database // // argument: // in : // - new_conf: The new attribute(s) configuration. One AttributeConfig structure is needed for each // attribute to update // //-------------------------------------------------------------------------------------------------------------------- void Device_3Impl::set_attribute_config_3(const Tango::AttributeConfigList_3& new_conf) { AutoTangoMonitor sync(this,true); cout4 << "DeviceImpl::set_attribute_config_3 arrived" << endl; // // The attribute conf. is protected by two monitors. One protects access between get and set attribute conf. // The second one protects access between set and usage. This is the classical device monitor // TangoMonitor &mon1 = get_att_conf_monitor(); AutoTangoMonitor sync1(&mon1); // // Record operation request in black box // If this method is executed with the request to store info in blackbox (store_in_bb == true), this means that the // request arrives through a Device_2 CORBA interface. Check locking feature in this case. Otherwise the request has // arrived through Device_4 and the check is already done // if (ext->store_in_bb == true) { blackbox_ptr->insert_op(Op_Set_Attr_Config_3); check_lock("set_attribute_config_3"); } ext->store_in_bb = true; // // Return exception if the device does not have any attribute // long nb_dev_attr = dev_attr->get_attr_nb(); if (nb_dev_attr == 0) { Except::throw_exception((const char *)API_AttrNotFound, (const char *)"The device does not have any attribute", (const char *)"Device_3Impl::set_attribute_config_3"); } // // Get some event related data // EventSupplier *event_supplier_nd = NULL; EventSupplier *event_supplier_zmq = NULL; Tango::Util *tg = Tango::Util::instance(); // // Update attribute config first locally then in database // long nb_attr = new_conf.length(); long i; EventSupplier::AttributeData ad; ::memset(&ad,0,sizeof(ad)); try { for (i = 0;i < nb_attr;i++) { Attribute &attr = dev_attr->get_attr_by_name(new_conf[i].name); bool old_alarm = attr.is_alarmed().any(); attr.set_upd_properties(new_conf[i],device_name); // // In case the attribute quality factor was set to ALARM, reset it to VALID // if ((attr.get_quality() == Tango::ATTR_ALARM) && (old_alarm == true) && (attr.is_alarmed().any() == false)) attr.set_quality(Tango::ATTR_VALID); // // Send the event // if (attr.use_notifd_event() == true) event_supplier_nd = tg->get_notifd_event_supplier(); else event_supplier_nd = NULL; if (attr.use_zmq_event() == true) event_supplier_zmq = tg->get_zmq_event_supplier(); else event_supplier_zmq = NULL; if ((event_supplier_nd != NULL) || (event_supplier_zmq != NULL)) { string tmp_name(new_conf[i].name); ad.attr_conf_3 = &(new_conf[i]); if (event_supplier_nd != NULL) event_supplier_nd->push_att_conf_events(this,ad,(Tango::DevFailed *)NULL,tmp_name); if (event_supplier_zmq != NULL) event_supplier_zmq->push_att_conf_events(this,ad,(Tango::DevFailed *)NULL,tmp_name); } } } catch (Tango::DevFailed &e) { // // Re build the list of "alarmable" attribute // dev_attr->get_alarm_list().clear(); for (long j = 0;j < nb_dev_attr;j++) { Attribute &att = dev_attr->get_attr_by_ind(j); if (att.is_alarmed().any() == true) { if (att.get_writable() != Tango::WRITE) dev_attr->get_alarm_list().push_back(j); } } // // Change the exception reason flag // TangoSys_OMemStream o; o << e.errors[0].reason; if (i != 0) o << "\nAll previous attribute(s) have been successfully updated"; if (i != (nb_attr - 1)) o << "\nAll remaining attribute(s) have not been updated"; o << ends; string s = o.str(); e.errors[0].reason = CORBA::string_dup(s.c_str()); throw; } // // Re build the list of "alarmable" attribute // dev_attr->get_alarm_list().clear(); for (i = 0;i < nb_dev_attr;i++) { Tango::Attribute &attr = dev_attr->get_attr_by_ind(i); Tango::AttrWriteType w_type = attr.get_writable(); if (attr.is_alarmed().any() == true) { if (w_type != Tango::WRITE) dev_attr->get_alarm_list().push_back(i); } } // // Return to caller // cout4 << "Leaving Device_3Impl::set_attribute_config_3" << endl; } //+------------------------------------------------------------------------------------------------------------------- // // method : // Device_3Impl::write_attributes_in_db // // description : // Method to write memorized attributes in database // // argument: // in : // - name : attribute name // - n : history depth (in record number) // // return: // This method returns a pointer to a DevAttrHistoryList with one DevAttrHistory structure for each attribute // record // //-------------------------------------------------------------------------------------------------------------------- void Device_3Impl::write_attributes_in_db(vector &att_in_db,vector &updated_attr) { // // Store memorized attribute in db // Tango::Util *tg = Tango::Util::instance(); Tango::Database *db = tg->get_database(); Tango::DbData db_data; for (unsigned long i = 0;i < att_in_db.size();i++) { Tango::DbDatum tmp_db; // // Update one property // long idx = att_in_db[i]; WAttribute &att = dev_attr->get_w_attr_by_ind(updated_attr[idx].idx_in_multi_attr); tmp_db.name = att.get_name(); tmp_db << (short)1; db_data.push_back(tmp_db); // // Init property value // tmp_db.name = MemAttrPropName; const char *ptr; switch (att.get_data_type()) { case Tango::DEV_SHORT : tmp_db << (*att.get_last_written_sh())[0]; break; case Tango::DEV_LONG : tmp_db << (*att.get_last_written_lg())[0]; break; case Tango::DEV_LONG64 : tmp_db << (*att.get_last_written_lg64())[0]; break; case Tango::DEV_DOUBLE : tmp_db << (*att.get_last_written_db())[0]; break; case Tango::DEV_STRING : ptr = (*att.get_last_written_str())[0].in(); tmp_db << ptr; break; case Tango::DEV_FLOAT : tmp_db << (*att.get_last_written_fl())[0]; break; case Tango::DEV_BOOLEAN : tmp_db << (*att.get_last_written_boo())[0]; break; case Tango::DEV_USHORT : tmp_db << (*att.get_last_written_ush())[0]; break; case Tango::DEV_UCHAR : tmp_db << (*att.get_last_written_uch())[0]; break; case Tango::DEV_ULONG : tmp_db << (*att.get_last_written_ulg())[0]; break; case Tango::DEV_ULONG64 : tmp_db << (*att.get_last_written_ulg64())[0]; break; case Tango::DEV_STATE : { Tango::DevState tmp_state = (*att.get_last_written_state())[0]; tmp_db << (short)tmp_state; } break; } db_data.push_back(tmp_db); } db->put_device_attribute_property(device_name,db_data); } void Device_3Impl::write_attributes_in_db(vector &att_in_db,vector &updated_attr) { vector v; for (unsigned int i = 0;i < updated_attr.size();i++) { AttIdx ai; ai.idx_in_multi_attr = updated_attr[i]; v.push_back(ai); } write_attributes_in_db(att_in_db,v); } //+------------------------------------------------------------------------------------------------------------------- // // method : // Device_3Impl::add_state_status_attrs // // description : // Add state and status in the device attribute list // //-------------------------------------------------------------------------------------------------------------------- void Device_3Impl::add_state_status_attrs() { // // First, create the State attribute with default properties // Tango::Attr att_state("State",Tango::DEV_STATE); vector prop_list_state; string att_name("State"); get_attr_props("State",prop_list_state); dev_attr->add_default(prop_list_state,device_name,att_name,Tango::DEV_STATE); dev_attr->add_attr(new Attribute(prop_list_state,att_state,device_name,-1)); // // Now, create the status attribute also with default properties // Tango::Attr att_status("Status",Tango::DEV_STRING); vector prop_list_status; att_name = "Status"; get_attr_props("Status",prop_list_status); dev_attr->add_default(prop_list_status,device_name,att_name,Tango::DEV_STRING); dev_attr->add_attr(new Attribute(prop_list_status,att_status,device_name,-1)); } //+------------------------------------------------------------------------------------------------------------------- // // method : // Device_3Impl::get_attr_props // // description : // Get attribute properties. This method is used to retrieve properties for state and status. // // argument: // in : // - attr_name : The attribute name // inout : // - prop_list : The attribute property vector // //-------------------------------------------------------------------------------------------------------------------- void Device_3Impl::get_attr_props(const char *attr_name,vector &prop_list) { Tango::Util *tg = Tango::Util::instance(); if (tg->_UseDb == true) { Tango::DbData db_list; db_list.push_back(DbDatum(attr_name)); // // Get attr prop from db cache // try { tg->get_database()->get_device_attribute_property(device_name,db_list,tg->get_db_cache()); } catch (Tango::DevFailed &) { cout4 << "Exception while accessing database" << endl; TangoSys_OMemStream o; o << "Can't get device attribute properties for device " << device_name << ", attribute " << attr_name << ends; Except::throw_exception((const char *)API_DatabaseAccess, o.str(), (const char *)"Device_3Impl::get_attr_props"); } // // Insert AttrProperty element in suplied vector for att. properties found in DB // long ind = 0; long nb_prop = 0; db_list[ind] >> nb_prop; ind++; for (long j = 0;j < nb_prop;j++) { if (db_list[ind].size() > 1) { string tmp(db_list[ind].value_string[0]); long nb = db_list[ind].size(); for (int k = 1;k < nb;k++) { tmp = tmp + ","; tmp = tmp + db_list[ind].value_string[k]; } prop_list.push_back(AttrProperty(db_list[ind].name,tmp)); } else prop_list.push_back(AttrProperty(db_list[ind].name, db_list[ind].value_string[0])); ind++; } } } //+------------------------------------------------------------------------------------------------------------------- // // method : // Device_3Impl::add_alarmed // // description : // Method to add alarmed attributes (if not already there) in the attribute list passed as argument // // argument: // in : // - att_list : The attribute index in the multi attribute instance // //-------------------------------------------------------------------------------------------------------------------- void Device_3Impl::add_alarmed(vector &att_list) { vector &alarmed_list = dev_attr->get_alarm_list(); long nb_wanted_attr = alarmed_list.size(); if (nb_wanted_attr != 0) { for (int i = 0;i < nb_wanted_attr;i++) { long nb_attr = att_list.size(); bool found = false; for (int j = 0;j < nb_attr;j++) { if (att_list[j] == alarmed_list[i]) { found = true; break; } } // // If not found, add it // if (found == false) { att_list.push_back(alarmed_list[i]); } } } } //+-------------------------------------------------------------------------------------------------------------------- // // method : // Device_3Impl::reading_state_necessary // // description : // Method to check ifi t is necessary to read state. If the device has some alarmed attribute and one of these // attributes has already been read and failed, it is not necessary to read state. It will also fail. // // argument: // in : // - wanted_attr : The list of attribute to be read by this call // // return: // This method returns -1 if reading state is possible. Otherwise, it returns the index in the wanted_attr list // of the alarmed attribute which failed // //-------------------------------------------------------------------------------------------------------------------- long Device_3Impl::reading_state_necessary(vector &wanted_attr) { vector &alarmed_list = dev_attr->get_alarm_list(); long nb_alarmed_attr = alarmed_list.size(); long ret = -1; if (nb_alarmed_attr == 0) ret = -1; else { long nb_attr = wanted_attr.size(); for (int j = 0;j < nb_alarmed_attr;j++) { for (int i = 0;i < nb_attr;i++) { if (alarmed_list[j] == wanted_attr[i].idx_in_multi_attr) { if (wanted_attr[i].failed == true) return i; } } } } return ret; } //+------------------------------------------------------------------------------------------------------------------- // // method : // Device_3Impl::alarmed_not_read // // description : // This method find all the attributes which will be read by the state (because alarmed) and which have been // already read. It builds a vector with the list of attribute not read // // argument: // in : // - wanted_attr : The list of attribute to be read by this call // //--------------------------------------------------------------------------------------------------------------------- void Device_3Impl::alarmed_not_read(vector &wanted_attr) { vector &alarmed_list = dev_attr->get_alarm_list(); long nb_alarmed_attr = alarmed_list.size(); long nb_attr = wanted_attr.size(); ext->alarmed_not_read.clear(); for (int i = 0;i < nb_alarmed_attr;i++) { bool found = false; for (int j = 0;j < nb_attr;j++) { if (alarmed_list[i] == wanted_attr[j].idx_in_multi_attr) { found = true; break; } } if (found == false) { ext->alarmed_not_read.push_back(alarmed_list[i]); } } } //+-------------------------------------------------------------------------------------------------------------------- // // method : // Device_3Impl::state2attr // // description : // Method to send a device state as an attribute object // // argument: // in : // - state : The device state // - back : The AttributeValue structure // //--------------------------------------------------------------------------------------------------------------------- void Device_3Impl::state2attr(Tango::DevState state,Tango::AttributeValue_3 &back) { back.value <<= state; #ifdef _TG_WINDOWS_ struct _timeb after_win; _ftime(&after_win); back.time.tv_sec = (long)after_win.time; back.time.tv_usec = (long)after_win.millitm * 1000; back.time.tv_nsec = 0; #else struct timeval after; gettimeofday(&after,NULL); back.time.tv_sec = after.tv_sec; back.time.tv_usec = after.tv_usec; back.time.tv_nsec = 0; #endif back.quality = Tango::ATTR_VALID; back.name = CORBA::string_dup("State"); back.r_dim.dim_x = 1; back.r_dim.dim_y = 0; back.w_dim.dim_x = 0; back.w_dim.dim_y = 0; } void Device_3Impl::state2attr(Tango::DevState state,Tango::AttributeValue_4 &back) { back.value.dev_state_att(state); #ifdef _TG_WINDOWS_ struct _timeb after_win; _ftime(&after_win); back.time.tv_sec = (long)after_win.time; back.time.tv_usec = (long)after_win.millitm * 1000; back.time.tv_nsec = 0; #else struct timeval after; gettimeofday(&after,NULL); back.time.tv_sec = after.tv_sec; back.time.tv_usec = after.tv_usec; back.time.tv_nsec = 0; #endif back.quality = Tango::ATTR_VALID; back.data_format = Tango::SCALAR; back.name = CORBA::string_dup("State"); back.r_dim.dim_x = 1; back.r_dim.dim_y = 0; back.w_dim.dim_x = 0; back.w_dim.dim_y = 0; } //+------------------------------------------------------------------------------------------------------------------- // // method : // Device_3Impl::status2attr // // description : // Method to send a device status string as an attribute object // // argument: // in : // - status : The device status // - back : The AttributeValue structure // //-------------------------------------------------------------------------------------------------------------------- void Device_3Impl::status2attr(Tango::ConstDevString status,Tango::AttributeValue_3 &back) { Tango::DevVarStringArray str_seq(1); str_seq.length(1); str_seq[0] = CORBA::string_dup(status); back.value <<= str_seq; #ifdef _TG_WINDOWS_ struct _timeb after_win; _ftime(&after_win); back.time.tv_sec = (long)after_win.time; back.time.tv_usec = (long)after_win.millitm * 1000; back.time.tv_nsec = 0; #else struct timeval after; gettimeofday(&after,NULL); back.time.tv_sec = after.tv_sec; back.time.tv_usec = after.tv_usec; back.time.tv_nsec = 0; #endif back.quality = Tango::ATTR_VALID; back.name = CORBA::string_dup("Status"); back.r_dim.dim_x = 1; back.r_dim.dim_y = 0; back.w_dim.dim_x = 0; back.w_dim.dim_y = 0; } void Device_3Impl::status2attr(Tango::ConstDevString status,Tango::AttributeValue_4 &back) { Tango::DevVarStringArray str_seq(1); str_seq.length(1); str_seq[0] = CORBA::string_dup(status); back.value.string_att_value(str_seq); #ifdef _TG_WINDOWS_ struct _timeb after_win; _ftime(&after_win); back.time.tv_sec = (long)after_win.time; back.time.tv_usec = (long)after_win.millitm * 1000; back.time.tv_nsec = 0; #else struct timeval after; gettimeofday(&after,NULL); back.time.tv_sec = after.tv_sec; back.time.tv_usec = after.tv_usec; back.time.tv_nsec = 0; #endif back.quality = Tango::ATTR_VALID; back.data_format = Tango::SCALAR; back.name = CORBA::string_dup("Status"); back.r_dim.dim_x = 1; back.r_dim.dim_y = 0; back.w_dim.dim_x = 0; back.w_dim.dim_y = 0; } } // End of Tango namespace tango-8.1.2c+dfsg.orig/lib/cpp/server/thsig.cpp0000644000175000017500000001174712205375142020266 0ustar piccapiccastatic const char *RcsId = "$Id: thsig.cpp 22213 2013-03-07 14:32:56Z taurel $\n$Name$"; //+============================================================================= // // file : thsig.cpp // // description : C++ source for the DServer class and its commands. // The class is derived from Device. It represents the // CORBA servant object which will be accessed from the // network. All commands which can be executed on a // DServer object are implemented in this file. // // project : TANGO // // author(s) : A.Gotz + E.Taurel // // Copyright (C) : 2004,2005,2006,2007,2008,2009,2010,2011,2012,2013 // European Synchrotron Radiation Facility // BP 220, Grenoble 38043 // FRANCE // // This file is part of Tango. // // Tango 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. // // Tango 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 Tango. If not, see . // // $Revision: 22213 $ // //-============================================================================= #if HAVE_CONFIG_H #include #endif #include #include extern omni_thread::key_t key_py_data; namespace Tango { void *DServerSignal::ThSig::run_undetached(TANGO_UNUSED(void *ptr)) { #ifndef _TG_WINDOWS_ sigset_t sigs_to_catch; // // Catch main signals // sigemptyset(&sigs_to_catch); sigaddset(&sigs_to_catch,SIGINT); sigaddset(&sigs_to_catch,SIGTERM); sigaddset(&sigs_to_catch,SIGHUP); sigaddset(&sigs_to_catch,SIGQUIT); // // Init thread id and pid (for linux !!) // my_thread = pthread_self(); { omni_mutex_lock syn(*ds); my_pid = getpid(); ds->signal(); } #endif int signo = 0; // // The infinite loop // while(1) { #ifndef _TG_WINDOWS_ int ret = sigwait(&sigs_to_catch,&signo); // sigwait() under linux might return an errno number without initialising the // signo variable. Do a ckeck here to avoid problems!!! if ( ret != 0 ) { cout4 << "Signal thread awaken on error " << ret << endl; continue; } cout4 << "Signal thread awaken for signal " << signo << endl; if (signo == SIGHUP) continue; #else WaitForSingleObject(ds->win_ev,INFINITE); signo = ds->win_signo; cout4 << "Signal thread awaken for signal " << signo << endl; #endif // // Create the per thread data if not already done // if (th_data_created == false) { omni_thread::self()->set_value(key_py_data,new PyData()); th_data_created = true; } #ifndef _TG_WINDOWS_ // // Add a new signal to catch in the mask // { omni_mutex_lock sy(*ds); if (signo == SIGINT) { bool job_done = false; if (ds->sig_to_install == true) { ds->sig_to_install = false; sigaddset(&sigs_to_catch,ds->inst_sig); cout4 << "signal " << ds->inst_sig << " installed" << endl; job_done = true; } // // Remove a signal from the catched one // if (ds->sig_to_remove == true) { ds->sig_to_remove = false; sigdelset(&sigs_to_catch,ds->rem_sig); cout4 << "signal " << ds->rem_sig << " removed" << endl; job_done = true; } if (job_done == true) { ds->signal(); continue; } } } #endif DevSigAction *act_ptr = &(DServerSignal::reg_sig[signo]); // // First, execute all the handlers installed at the class level // if (act_ptr->registered_classes.empty() == false) { long nb_class = act_ptr->registered_classes.size(); for (long j = 0;j < nb_class;j++) { act_ptr->registered_classes[j]->signal_handler((long)signo); } } // // Then, execute all the handlers installed at the device level // if (act_ptr->registered_devices.empty() == false) { long nb_dev = act_ptr->registered_devices.size(); for (long j = 0;j < nb_dev;j++) { act_ptr->registered_devices[j]->signal_handler((long)signo); } } // // For the automatically installed signal, unregister servers from database, // destroy the ORB and exit // if (auto_signal(signo) == true) { Tango::Util *tg = Tango::Util::instance(); if (tg != NULL) { try { tg->shutdown_server(); } catch(...) { #ifndef _TG_WINDOWS_ raise(SIGKILL); #endif } } } } return NULL; } } // End of Tango namespace tango-8.1.2c+dfsg.orig/lib/cpp/server/multiattribute.h0000644000175000017500000002234112205375142021663 0ustar piccapicca//============================================================================= // // file : MultiAttribute.h // // description : Include file for the MultiAttribute class. // Each device has one object of this class. All device // attribute objects are stored in this class // // project : TANGO // // author(s) : A.Gotz + E.Taurel // // Copyright (C) : 2004,2005,2006,2007,2008,2009,2010,2011,2012,2013 // European Synchrotron Radiation Facility // BP 220, Grenoble 38043 // FRANCE // // This file is part of Tango. // // Tango 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. // // Tango 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 Tango. If not, see . // // $Revision: 22213 $ // // //============================================================================= #ifndef _MULTIATTRIBUTE_H #define _MULTIATTRIBUTE_H #include namespace Tango { class AttrProperty; class DeviceClass; struct EventPar { long attr_id; bool change; bool archive; bool quality; bool periodic; bool user; bool notifd; bool zmq; }; //============================================================================= // // The MultiAttribute class // // // description : There is one instance of this class for each device. // This is mainly a helper class. It maintains a vector // of all the attribute for the device // //============================================================================= /** * There is one instance of this class for each device. This class is mainly * an aggregate of Attribute or WAttribute objects. It eases management of * multiple attributes * * $Author: taurel $ * $Revision: 22213 $ * * @headerfile tango.h * @ingroup Server */ class MultiAttribute { public: /**@name Constructor * Only one constructor is defined for this class */ //@{ /** * Create a new MultiAttribute object. * * This constructor will in-turn call the constructor of the Attribute or * WAttribute class of all the device class attributes. * * @param dev_name The device name * @param dev_class Reference to the device DeviceClass object * @exception DevFailed If the command sent to the database failed. * Click here to read * DevFailed exception specification */ MultiAttribute(string &dev_name,DeviceClass *dev_class); //@} /**@name Destructor * Only one desctructor is defined for this class */ //@{ /** * The MultiAttribute desctructor. */ ~MultiAttribute(); //@} /**@name Miscellaneous methods */ //@{ /** * Get Attribute object from its name. * * This method returns a reference to the Attribute object with a name passed * as parameter. The equality on attribute name is case independant. * * @param attr_name The attribute name * @return A reference to the Attribute object * @exception DevFailed If the attribute is not defined. * Click here to read * DevFailed exception specification */ Attribute &get_attr_by_name(const char *attr_name); /** * Get Attribute object from its index. * * This method returns a reference to the Attribute object from the index in the * main attribute vector * * @param ind The attribute index * @return A reference to the Attribute object */ Attribute &get_attr_by_ind(const long ind) {return *(attr_list[ind]);} /** * Get Writable Attribute object from its name. * * This method returns a reference to the WAttribute object with a name passed * as parameter. The equality on attribute name is case independant. * * @param attr_name The attribute name * @return A reference to the writable attribute object * @exception DevFailed If the attribute is not defined. * Click here to read * DevFailed exception specification */ WAttribute &get_w_attr_by_name(const char *attr_name); /** * Get Writable Attribute object from its index. * * This method returns a reference to the Writable Attribute object from the * index in the main attribute vector * * @param ind The attribute index * @return A reference to the WAttribute object */ WAttribute &get_w_attr_by_ind(const long ind) {return static_cast(*(attr_list[ind]));} /** * Get Attribute index into the main attribute vector from its name. * * This method returns the index in the Attribute vector (stored in the * MultiAttribute object) of an attribute with a given name. The name equality * is case independant * * @param attr_name The attribute name * @return The index in the main attributes vector * @exception DevFailed If the attribute is not found in the vector. * Click here to read * DevFailed exception specification */ long get_attr_ind_by_name(const char *attr_name); /** * Get list of attribute with an alarm level defined. * * @return A vector of long data. Each object is the index in the main * attribute vector of attribute with alarm level defined */ vector &get_alarm_list() {return alarm_attr_list;} /** * Get attribute number. * * @return The attribute number */ unsigned long get_attr_nb() {return (unsigned long)attr_list.size();} /** * Check alarm for one attribute with a given name. * * This method returns a boolean set to true if the attribute with the given * name is in alarm condition * * @param attr_name The attribute name * @return A boolean set to true if the attribute is in alarm * @exception DevFailed If the attribute does not have any alarm level defined. * Click here to read * DevFailed exception specification * */ bool check_alarm(const char *attr_name) {return get_attr_by_name(attr_name).check_alarm();} /** * Check alarm for one attribute from its index in the main attributes vector. * * This method returns a boolean set to true if the attribute with the given * index in the attrobite object vector is in alarm condition * * @param ind The attribute index * @return A boolean set to true if the attribute is in alarm * @exception DevFailed If the attribute does not have any alarm level defined. * Click here to read * DevFailed exception specification * */ bool check_alarm(const long ind) {return get_attr_by_ind(ind).check_alarm();} /** * Check alarm on all attribute(s) with an alarm defined. * * This method returns a boolean set to true if one of the attribute with an * alarm level defined is in alarm condition. * * @return A boolean set to true if one attribute is in alarm * @exception DevFailed If the alarm level are not defined for one of the * attribute in the list of alarmable one * Click here to read * DevFailed exception specification * */ bool check_alarm(); /** * Add alarm message to device status. * * This method add alarm mesage to the string passed as parameter. A message * is added for each attribute which is in alarm condition * * @param status The string (should be the device status) */ void read_alarm(string &status); /** * Get the vector of attribute objects. * * Returns the vector of attribute objects. * */ vector &get_attribute_list(){return attr_list;} //@} protected: /**@name Class data members */ //@{ /** * The Attribute objects vector. * * This vector is often referred as the main attributes vector */ vector attr_list; /** * The list of writable attribute. * * It is a vector of index in the main attribute vector */ vector writable_attr_list; /** * The list of attribute with an alarm level defined. * * It is a vector of index in the main attribute vector */ vector alarm_attr_list; //@} public: /// @privatesection void add_write_value(Attribute &); void add_attribute(string &,DeviceClass *,long); void remove_attribute(string &,bool); vector &get_w_attr_list() {return writable_attr_list;} bool is_att_quality_alarmed(bool); void get_event_param(vector &); void add_alarmed_quality_factor(string &); void add_default(vector &,string &,string &,long); void add_attr(Attribute *att) {attr_list.push_back(att);} private: class MultiAttributeExt { }; void concat(vector &,vector &,vector &); void add_user_default(vector &,vector &); void check_associated(long,string &); #ifdef HAS_UNIQUE_PTR unique_ptr ext; // Class extension #else MultiAttributeExt *ext; #endif }; } // End of Tango namespace #endif // _MULTIATTRIBUTE_H tango-8.1.2c+dfsg.orig/lib/cpp/server/utils.cpp0000644000175000017500000016303712205375142020310 0ustar piccapiccastatic const char *RcsId = "$Id: utils.cpp 22718 2013-05-28 15:22:40Z taurel $\n$Name$"; //+============================================================================= // // file : Tango_utils.cpp // // description : C++ source for all the utilities used by Tango device // server and mainly for the Tango class // // project : TANGO // // author(s) : A.Gotz + E.Taurel // // Copyright (C) : 2004,2005,2006,2007,2008,2009,2010,2011,2012,2013 // European Synchrotron Radiation Facility // BP 220, Grenoble 38043 // FRANCE // // This file is part of Tango. // // Tango 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. // // Tango 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 Tango. If not, see . // // $Revision: 22718 $ // //-============================================================================= #if HAVE_CONFIG_H #include #endif #include #include #include #include #include #ifndef _TG_WINDOWS_ #include #include #include #include #include #else #include #include #include #include #include #endif /* _TG_WINDOWS_ */ #include omni_thread::key_t key_py_data; namespace Tango { Util *Util::_instance = NULL; int Util::_tracelevel = 0; bool Util::_UseDb = true; bool Util::_FileDb = false; bool Util::_daemon = false; long Util::_sleep_between_connect = 60; bool Util::_constructed = false; #ifdef _TG_WINDOWS_ bool Util::_win = false; bool Util::_service = false; #endif // // A global key used for per thread specific storage. This is used to retrieve // client host and stores it in the device blackbox. This global is referenced // in blackbox.cpp // omni_thread::key_t key; //+---------------------------------------------------------------------------- // // method : Util::init() // // description : static method to create/retrieve the Tango object. // This method is the only one which enables a user to // create the object // // in : - argc : The command line argument number // - argv : The command line argument // //----------------------------------------------------------------------------- Util *Util::init(int argc,char *argv[]) { if (_instance == NULL) { _instance = new Util(argc,argv); } return _instance; } #ifdef _TG_WINDOWS_ Util *Util::init(HINSTANCE hi,int nCmd) { if (_instance == NULL) { _instance = new Util(hi,nCmd); } return _instance; } #endif //+---------------------------------------------------------------------------- // // method : Util::instance() // // description : static method to retrieve the Tango object once it has // been initialised // //----------------------------------------------------------------------------- Util *Util::instance(bool exit) { if (_instance == NULL) { if (exit == true) Util::print_err_message("Tango is not initialised !!!\nExiting"); else { Except::throw_exception((const char*)"API_UtilSingletonNotCreated", (const char*)"Util singleton not created", (const char*)"Util::instance"); } } return _instance; } //+---------------------------------------------------------------------------- // // method : Util::Util() // // description : Constructor of the Tango class. // // in : - argc : The command line argument number // - argv : The command line argument // //----------------------------------------------------------------------------- #ifdef _TG_WINDOWS Util::Util(int argc,char *argv[]):cl_list_ptr(NULL),mon("Windows startup"),ext(new UtilExt) # ifndef TANGO_HAS_LOG4TANGO ,cout_tmp(cout.rdbuf()) # endif #else Util::Util(int argc,char *argv[]):cl_list_ptr(NULL),ext(new UtilExt) # ifndef TANGO_HAS_LOG4TANGO ,cout_tmp(cout.rdbuf()) # endif #endif { // // Do the job // effective_job(argc,argv); _constructed = true; // // For Windows, install a console handler to ignore LOGOFF event // #ifdef _TG_WINDOWS_ install_cons_handler(); #endif } void Util::effective_job(int argc,char *argv[]) { try { // // Check server option // if (argc < 2) { print_usage(argv[0]); } // // Manage command line option (personal name and -v option) // check_args(argc,argv); // // Create the signal object // It is necessary to create this object before the ORB is initialised. // Otherwise, threads created by thread started by the ORB_init will not have // the correct signal mask (set by the DServerSignal object) and the device // server signal feature will not work // DServerSignal::instance(); // // Check if the user specified a endPoint on the command line or using one // env. variable // If true, extract the IP address from the end point and store it // for future use in the ZMQ publiher(s) // for (int i = 2;i < argc;i++) { if (::strcmp("-ORBendPoint",argv[i]) == 0) { set_endpoint_specified(true); string endPoint(argv[i + 1]); string::size_type start,stop; start = endPoint.find(':'); ++start; start = endPoint.find(':',start); stop = endPoint.find(':',start + 1); ++start; string ip = endPoint.substr(start,stop - start); set_specified_ip(ip); break; } } if (get_endpoint_specified() == false) { DummyDeviceProxy d; string env_var; if (d.get_env_var("ORBendPoint",env_var) == 0) { set_endpoint_specified(true); string::size_type start,stop; start = env_var.find(':'); ++start; start = env_var.find(':',start); stop = env_var.find(':',start + 1); ++start; string ip = env_var.substr(start,stop - start); set_specified_ip(ip); } } // // Destroy the ORB created as a client (in case there is one) // ApiUtil *au = Tango::ApiUtil::instance(); CORBA::ORB_ptr orb_clnt = au->get_orb(); if (CORBA::is_nil(orb_clnt) == false) { orb_clnt->destroy(); CORBA::release(orb_clnt); au->set_orb(CORBA::ORB::_nil()); } // // Initialise CORBA ORB // #ifdef _TG_WINDOWS_ WORD rel = 0x0202; WSADATA dat; WSAStartup(rel,&dat); #endif if (get_endpoint_specified() == true) { const char *options[][2] = { {"clientCallTimeOutPeriod",CLNT_TIMEOUT_STR}, {"serverCallTimeOutPeriod","5000"}, {"maxServerThreadPoolSize","100"}, {"threadPerConnectionUpperLimit","55"}, {"threadPerConnectionLowerLimit","50"}, {"supportCurrent","0"}, {"verifyObjectExistsAndType","0"}, {"giopMaxMsgSize",MAX_TRANSFER_SIZE}, #ifndef _TG_WINDOWS_ {"endPoint","giop:unix:"}, #endif {0,0} }; orb = CORBA::ORB_init(argc,argv,"omniORB4",options); } else { const char *options[][2] = { {"endPointPublish","all(addr)"}, {"clientCallTimeOutPeriod",CLNT_TIMEOUT_STR}, {"serverCallTimeOutPeriod","5000"}, {"maxServerThreadPoolSize","100"}, {"threadPerConnectionUpperLimit","55"}, {"threadPerConnectionLowerLimit","50"}, {"supportCurrent","0"}, {"verifyObjectExistsAndType","0"}, {"giopMaxMsgSize",MAX_TRANSFER_SIZE}, #ifndef _TG_WINDOWS_ {"endPoint","giop:tcp::"}, {"endPoint","giop:unix:"}, #endif {0,0} }; orb = CORBA::ORB_init(argc,argv,"omniORB4",options); } #ifndef TANGO_HAS_LOG4TANGO // // Initialize trace output (For Windows, the stdc++ lib also implements the // new iostreams where the xx_with_assign classes are not defined. Therefore, // to copy streams, I have used the advices in the C++ report of June 1997 // trace_output = InitialOutput; file_stream = NULL; cout_tmp.copyfmt(cout); cout_tmp.clear(cout.rdstate()); #endif // TANGO_HAS_LOG4TANGO // // Init host name // init_host_name(); // // Connect to the database // if (_UseDb == true) { connect_db(); // // Display help message if requested by user. This is done after the process is // connected to the database becaue a call to the database server is done in the // display_help_message() method // if (display_help == true) { display_help_message(); } } else db = NULL; // // Create the server CORBA objects // create_CORBA_objects(); #ifdef TANGO_HAS_LOG4TANGO // // Initialize logging stuffs // Logging::init(ds_name, (int)_tracelevel, ((!_FileDb) && _UseDb), *db, this); #endif cout4 << "Connected to database" << endl; if (get_db_cache() == NULL) cout4 << "DbServerCache unavailable, will call db..." << endl; // // Check if the server is not already running somewhere else // if ((_UseDb == true) && (_FileDb == false)) server_already_running(); // // Get process PID and Tango version // misc_init(); // // Automatically create the EventSupplier objects // // In the future this could be created only when the // first event is fired ... // create_notifd_event_supplier(); create_zmq_event_supplier(); // // Create the heartbeat thread and start it // ext->heartbeat_th = new PollThread(ext->shared_data,ext->poll_mon,true); ext->heartbeat_th->start(); ext->heartbeat_th_id = ext->heartbeat_th->id(); cout4 << "Heartbeat thread Id = " << ext->heartbeat_th_id; cout4 << "Tango object singleton constructed" << endl; } catch (CORBA::Exception &) { throw; } } //+---------------------------------------------------------------------------- // // method : Util::create_CORBA_objects() // // description : Create some CORBA objects needed later-on // //----------------------------------------------------------------------------- void Util::create_CORBA_objects() { // // Install an omniORB interceptors to store client name in blackbox // and allocate a key for per thread specific storage // omni::omniInterceptors *intercep = omniORB::getInterceptors(); intercep->serverReceiveRequest.add(get_client_addr); intercep->createThread.add(create_PyPerThData); key = omni_thread::allocate_key(); key_py_data = omni_thread::allocate_key(); // // Get some CORBA object references // CORBA::Object_var poaObj = orb->resolve_initial_references("RootPOA"); PortableServer::POA_var root_poa = PortableServer::POA::_narrow(poaObj); // // If the database is not used, we must used the omniINSPOA poa // in both cases of database on file or nodb // remember that when you have database on file you have // _UseDb == true and _FileDb == true // PortableServer::POA_var nodb_poa; if ((_UseDb == false) || (_FileDb == true)) { CORBA::Object_var poaInsObj = orb->resolve_initial_references("omniINSPOA"); nodb_poa = PortableServer::POA::_narrow(poaInsObj); } // // Store POA // this is the same test but inverted // if ((_UseDb == true) && (_FileDb == false)) _poa = PortableServer::POA::_duplicate(root_poa); else if ((_UseDb == false) || (_FileDb == true)) _poa = PortableServer::POA::_duplicate(nodb_poa); } #ifdef _TG_WINDOWS_ //+---------------------------------------------------------------------------- // // method : Util::Util() // // description : Constructor of the Tango class when used in a non-console // Windows device server. On top of the UNIX way of building // a Util singleton, for Windows non-console mode, it is // necessary to : // - Build a UNIX like argc,argv from the command line // - Initialise the OB reactor // - Create a debug output window if verbose mode is requested // and change cout so that it prints into this window // // in : - hInst : The application instance // - nCmdShow : The display window flag // //----------------------------------------------------------------------------- Util::Util(HINSTANCE hInst,int nCmdShow):cl_list_ptr(NULL),mon("Windows startup"),ext(new UtilExt) #ifndef TANGO_HAS_LOG4TANGO ,cout_tmp(cout.rdbuf()) #endif { // // This method should be called from a Windows graphic program // _win = true; // // Build UNIX like command argument(s) // build_argc_argv(); // // Really do the job now // effective_job(argc,argv); // // Store the nCmdShow parameter an mark the object has being completely // constructed. Usefull, in case one of the method previously called // failed, the orb variable (type ORB_var) is alaready destroyed therefore // releasing the orb pointer. // nCmd = nCmdShow; _constructed = true; } #endif //+---------------------------------------------------------------------------- // // method : Util::ckeck_args() // // description : Check the command line arguments. The first one is // mandatory and is the server personal name. A -v option // is authorized with an optional argument. The other // option should be ORBacus option // // in : - argc : The command line argument number // - argv : The command line argument // //----------------------------------------------------------------------------- void Util::check_args(int argc,char *argv[]) { // // Check command line argument // string first_arg(argv[1]); display_help = false; if ((argc == 2) && (_UseDb == true)) { if ((first_arg == "-?") || (first_arg == "-help") || (first_arg == "-h")) { display_help = true; } } if ((display_help == false) && (argv[1][0] == '-')) { print_usage(argv[0]); } ds_instance_name = argv[1]; char *tmp; #ifdef _TG_WINDOWS_ if ((tmp = strrchr(argv[0],'\\')) == 0) { if ((tmp = strrchr(argv[0],'/')) == 0) { ds_exec_name = argv[0]; } else { tmp++; ds_exec_name = tmp; } } else { tmp++; ds_exec_name = tmp; } #else if ((tmp = strrchr(argv[0],'/')) == 0) ds_exec_name = argv[0]; else { tmp++; ds_exec_name = tmp; } #endif // // For Windows only. Remove the .exe after the executable name // #ifdef _TG_WINDOWS_ string::size_type pos; if ((pos = ds_exec_name.find('.')) != string::npos) { ds_exec_name.erase(pos,ds_exec_name.size()); } #endif /* _TG_WINDOWS_ */ if (argc > 2) { long ind = 2; string dlist; while (ind < argc) { if (argv[ind][0] == '-') { switch (argv[ind][1]) { // // The verbose option // case 'v': if (strlen(argv[ind]) == 2) { if ((argc - 1)> ind) { if (argv[ind + 1][0] == '-') set_trace_level(4); else { cerr << "Unknown option " << argv[ind] << endl; print_usage(argv[0]); } } else set_trace_level(4); ind++; } else { long level = atol(&(argv[ind][2])); if (level == 0) { cerr << "Unknown option " << argv[ind] << endl; print_usage(argv[0]); } else { set_trace_level(level); ind++; } } break; // // Device server without database // case 'n': if (strcmp(argv[ind],"-nodb") != 0) { cerr << "Unknown option " << argv[ind] << endl; print_usage(argv[0]); } else { if ( _FileDb ) print_usage(argv[0]); _UseDb = false; ind++; check_orb_endpoint(argc,argv); } break; case 'f': if (strncmp(argv[ind],"-file=",6) != 0) { cerr << "Unknown option " << argv[ind] << endl; print_usage(argv[0]); } else { if ( !_UseDb ) print_usage(argv[0]); Tango::Util::_FileDb = true; database_file_name = argv[ind]; database_file_name.erase(0,6); #ifdef _TG_WINDOWS_ replace(database_file_name.begin(), database_file_name.end(), '\\','/'); #endif cout4 << "File name = <" << database_file_name << ">" << endl; ind++; // // Try to find the ORB endPoint option // check_orb_endpoint(argc,argv); } break; // // Device list (for device server without database) // case 'd': if (strcmp(argv[ind],"-dbg")==0) { ind++; break; } if (strcmp(argv[ind],"-dlist") != 0) { cerr << "Unknown option " << argv[ind] << endl; print_usage(argv[0]); } else { if (_UseDb == true) print_usage(argv[0]); ind++; if (ind == argc) print_usage(argv[0]); else { dlist = argv[ind]; // // Extract each device name // string::size_type start = 0; string str; string::size_type pos; vector &list = get_cmd_line_name_list(); while ((pos = dlist.find(',',start)) != string::npos) { str = dlist.substr(start,pos - start); start = pos + 1; list.push_back(str); } if (start != dlist.size()) { str = dlist.substr(start); list.push_back(str); } // // Check that the same device name is not used twice // unsigned long i,j; for (i = 0;i < list.size();i++) { for (j = 0;j < list.size();j++) { if (i == j) continue; else { if (list[i] == list[j]) { print_err_message("Each device must have different name",Tango::INFO); } } } } } } default: ind++; break; } } else { if (strncmp(argv[ind - 1],"-v",2) == 0) { print_usage(argv[0]); } ind++; } } } // // Build server name // // long ctr; // for (ctr = 0;ctr < ds_exec_name.size();ctr++) // ds_exec_name[ctr] = tolower(ds_exec_name[ctr]); // for (ctr = 0;ctr < ds_instance_name.size();ctr++) // ds_instance_name[ctr] = tolower(ds_instance_name[ctr]); ds_name = ds_exec_name; ds_name.append("/"); ds_name.append(ds_instance_name); // // Check that the server name is not too long // if (ds_name.size() > MaxServerNameLength) { TangoSys_OMemStream o; o << "The device server name is too long! Max length is " << MaxServerNameLength << " characters" << ends; print_err_message(o.str(),Tango::INFO); } } //+---------------------------------------------------------------------------- // // method : Util::display_help_message() // // description : Check the command line arguments. The first one is // mandatory and is the server personal name. A -v option // is authorized with an optional argument. The other // option should be ORBacus option // // in : - argc : The command line argument number // - argv : The command line argument // //----------------------------------------------------------------------------- void Util::display_help_message() { // // Display device server usage string // TangoSys_OMemStream o; o << "usage : " << ds_exec_name << " instance_name [-v[trace level]]"; o << " [-nodb [-dlist ]]"; // // Try to get instance name from db // string str("dserver/"); str.append(ds_exec_name); str.append("/*"); vector db_inst; try { DbDatum received = db->get_device_member(str); received >> db_inst; } catch (Tango::DevFailed &e) { string reason(e.errors[0].reason.in()); if (reason == API_ReadOnlyMode) o << "\n\nWarning: Control System configured with AccessControl but can't communicate with AccessControl server"; o << ends; print_err_message(o.str(),Tango::INFO); } // // Add instance name list to message // o << "\nInstance name defined in database for server " << ds_exec_name << " :"; for (unsigned long i = 0;i < db_inst.size();i++) { o << "\n\t" << db_inst[i]; } o << ends; // // Display message // print_err_message(o.str(),Tango::INFO); } //+---------------------------------------------------------------------------- // // method : Util::print_usage() // // description : Print device server command line syntax // // in : - serv_name : The server name // //----------------------------------------------------------------------------- void Util::print_usage(char *serv_name) { TangoSys_OMemStream o; o << "usage : " << serv_name << " instance_name [-v[trace level]]"; o << " [-file= | -nodb [-dlist ] ]" << ends; print_err_message(o.str(),Tango::INFO); } //+---------------------------------------------------------------------------- // // method : Util::connect_db() // // description : This method builds a connection to the Tango database // servant. It uses the db_host and db_port object // variables. The Tango database server implements its // CORBA object as named servant. // //----------------------------------------------------------------------------- void Util::connect_db() { // // Try to create the Database object // if (_daemon == true) { int connected = false; while (connected == false) { try { #ifdef _TG_WINDOWS_ if (_service == true) db = new Database(orb.in(), ds_exec_name, ds_instance_name); else { if (_FileDb == false) db = new Database(orb.in()); else db = new Database(database_file_name); } #else if (_FileDb == false) db = new Database(orb.in()); else db = new Database(database_file_name); #endif db->set_tango_utils(this); connected = true; } catch (Tango::DevFailed &e) { if (strcmp(e.errors[0].reason.in(),API_TangoHostNotSet) == 0) { print_err_message(e.errors[0].desc.in()); } else { cout4 << "Can't contact db server, will try later" << endl; Tango_sleep(_sleep_between_connect); } } catch (CORBA::Exception &) { cout4 << "Can't contact db server, will try later" << endl; Tango_sleep(_sleep_between_connect); } } } else { try { #ifdef _TG_WINDOWS_ if (_service == true) db = new Database(orb.in(), ds_exec_name, ds_instance_name); else { if (_FileDb == false) db = new Database(orb.in()); else db = new Database(database_file_name); } #else if (_FileDb == false) db = new Database(orb.in()); else db = new Database(database_file_name); #endif db->set_tango_utils(this); } catch (Tango::DevFailed &e) { if (e.errors.length() == 2) { if (strcmp(e.errors[1].reason.in(),"API_CantConnectToDatabase") == 0) { TangoSys_OMemStream o; o << "Can't build connection to TANGO database server, exiting"; print_err_message(o.str()); } else print_err_message(e.errors[1].desc.in()); } else print_err_message(e.errors[0].desc.in()); } catch (CORBA::Exception &) { TangoSys_OMemStream o; o << "Can't build connection to TANGO database server, exiting"; print_err_message(o.str()); } } if (CORBA::is_nil(db->get_dbase()) && _FileDb != true) { TangoSys_OMemStream o; o << "Can't build connection to TANGO database server, exiting" << ends; print_err_message(o.str()); } // // Set a timeout on the database device // if (_FileDb == false) db->set_timeout_millis(DB_TIMEOUT); // // Also copy this database object ptr into the ApiUtil object. Therefore, // the same database connection will be used also for DeviceProxy // object created within the server // ApiUtil *au = ApiUtil::instance(); au->get_db_vect().push_back(db); au->in_server(true); // // Try to create the db cache which will be used during the process // startup sequence // For servers with many devices and properties, this could take time // specially during a massive DS startup (after power cut for instance) // Filling the DS cache is a relatively heavy command for the DB server // Trying to minimize retry in this case could be a good idea. // Therefore, change DB device timeout to execute this command // if (_FileDb == false) { string &inst_name = get_ds_inst_name(); if (inst_name != "-?") { db->set_timeout_millis(DB_TIMEOUT * 4); set_svr_starting(false); try { ext->db_cache = new DbServerCache(db,get_ds_name(),get_host_name()); } catch (Tango::DevFailed &e) { string base_desc(e.errors[0].desc.in()); if (base_desc.find("TRANSIENT_CallTimedout") != string::npos) cerr << "DB timeout while trying to fill the DB server cache. Will use traditional way" << endl; } catch (...) { cerr << "Unknown exception while trying to fill database cache..." << endl; } db->set_timeout_millis(DB_TIMEOUT); set_svr_starting(true); } } } void Util::reset_filedatabase() { delete db; db = new Database(database_file_name); } //+---------------------------------------------------------------------------- // // method : Util::misc_init() // // description : This method initialises miscellaneous variable which // are needed later in the device server startup // sequence. These variables are : // The process ID // The Tango version // //----------------------------------------------------------------------------- void Util::misc_init() { // // Get PID // TangoSys_OMemStream o; #ifdef _TG_WINDOWS_ pid = _getpid(); #else pid = DServerSignal::instance()->get_sig_thread_pid(); #endif o << pid << ends; pid_str = o.str(); // // Convert Tango version number to string (for device export) // o.seekp(0,ios_base::beg); o.clear(); o << DevVersion << ends; version_str = o.str(); // // Init server version to a default value // server_version = "x.y"; // // Init text to be displayed on main window with a default value // #ifdef _TG_WINDOWS_ main_win_text = "TANGO collaboration\n"; main_win_text = main_win_text + "(ALBA / DESY / ELETTRA / ESRF / FRMII / MAX-LAB / SOLEIL )\n"; main_win_text = main_win_text + "Developped by Tango team"; #endif // // Check if the user has defined his own publisher hwm (for zmq event tuning) // string var; if (ApiUtil::get_env_var("TANGO_DS_EVENT_BUFFER_HWM",var) == 0) { int pub_hwm = -1; istringstream iss(var); iss >> pub_hwm; if (iss) ext->user_pub_hwm = pub_hwm; } } //+---------------------------------------------------------------------------- // // method : Util::init_host_name() // // description : This method initialises the process hst name which // is needed later in the device server startup // sequence. // //----------------------------------------------------------------------------- void Util::init_host_name() { // // Get the FQDN host name (Fully qualified domain name) // If it is not returned by the system call "gethostname", // try with the getnameinfo/getaddrinfo system calls providing // IP address obtained by calling ApiUtil::get_ip_from_if() // // All supported OS have the getaddrinfo() call // char buffer[80]; if (gethostname(buffer,80) == 0) { hostname = buffer; transform(hostname.begin(), hostname.end(), hostname.begin(), ::tolower); // to retain consistency with getnameinfo() which always returns lowercase string::size_type pos = hostname.find('.'); if (pos == string::npos) { struct addrinfo hints; memset(&hints,0,sizeof(struct addrinfo)); hints.ai_family = AF_UNSPEC; // supports both IPv4 and IPv6 hints.ai_socktype = SOCK_STREAM; hints.ai_flags = AI_NUMERICHOST; // inhibits resolution of node parameter if it is not a numeric network address hints.ai_flags |= AI_ADDRCONFIG; struct addrinfo *info, *ptr; char tmp_host[NI_MAXHOST]; bool host_found = false; ApiUtil *au = ApiUtil::instance(); vector ip_list; au->get_ip_from_if(ip_list); // returns a list of numeric network addresses for(size_t i = 0; i < ip_list.size() && !host_found; i++) { if(getaddrinfo(ip_list[i].c_str(),NULL,&hints,&info) == 0) { ptr = info; while(ptr != NULL) { if(getnameinfo(ptr->ai_addr,ptr->ai_addrlen,tmp_host,NI_MAXHOST,NULL,0,0) == 0) { string myhost(tmp_host); #ifdef _TG_WINDOWS_ // // On windows, getnameinfo may return name in uppercase letters // transform(myhost.begin(),myhost.end(),myhost.begin(),::tolower); #endif string::size_type pos = myhost.find('.'); if (pos != string::npos) { string canon = myhost.substr(0,pos); if (hostname == canon) { hostname = myhost; host_found = true; break; } } } ptr = ptr->ai_next; } freeaddrinfo(info); } } } } else { print_err_message("Cant retrieve server host name"); } } //+---------------------------------------------------------------------------- // // method : Util::create_notifd_event_supplier() // // description : This method create the notifd event_supplier if possible // //----------------------------------------------------------------------------- void Util::create_notifd_event_supplier() { if (_UseDb == true) { try { ext->nd_event_supplier = NotifdEventSupplier::create(orb,ds_name,this); ext->nd_event_supplier->connect(); } catch (...) { ext->nd_event_supplier = NULL; if (_FileDb == true) cerr << "Can't create notifd event supplier. Notifd event not available" << endl; } } else { ext->nd_event_supplier = NULL; } } //+---------------------------------------------------------------------------- // // method : Util::create_zmq_event_supplier() // // description : This method create the zmq event_supplier if possible // //----------------------------------------------------------------------------- void Util::create_zmq_event_supplier() { try { ext->zmq_event_supplier = ZmqEventSupplier::create(this); } catch (...) { ext->zmq_event_supplier = NULL; if (_FileDb == true) cerr << "Can't create zmq event supplier. Zmq event not available" << endl; } } //+---------------------------------------------------------------------------- // // method : Util::~Util() // // description : Tango singleton object destructor. // This destructor shutdown everything before the process // dies. This means // - Send kill command to the polling thread // - Join with this polling thread // - Unregister server in database // - Delete devices (except the admin one) // - Shutdown the ORB // - Cleanup Logging // // // //----------------------------------------------------------------------------- Util::~Util() { #ifdef _TG_WINDOWS_ if (ds_window != NULL) { stop_all_polling_threads(); stop_heartbeat_thread(); clr_heartbeat_th_ptr(); unregister_server(); get_dserver_device()->delete_devices(); if (_FileDb == true) delete db; orb->shutdown(true); //JM : 9.8.2005 : destroy() should be called at the exit of run()! //orb->destroy(); #ifdef TANGO_HAS_LOG4TANGO Logging::cleanup(); #endif } #endif #ifndef HAS_UNIQUE_PTR delete ext; #endif } //+---------------------------------------------------------------------------- // // method : Util::server_already_running() // // description : Check if the same device server is not already running // somewhere else and refuse to start in this case // //----------------------------------------------------------------------------- void Util::server_already_running() { cout4 << "Entering Util::server_already_running method" << endl; // // Build device name and try to import it from database or from cache if available // string dev_name(DSDeviceDomain); dev_name.append(1,'/'); dev_name.append(ds_name); Tango::Device_var dev; try { const Tango::DevVarLongStringArray *db_dev; CORBA::Any_var received; if (ext->db_cache != NULL) { db_dev = ext->db_cache->import_adm_dev(); } else { CORBA::Any send; send <<= dev_name.c_str(); received = db->get_dbase()->command_inout("DbImportDevice",send); if ((received.inout() >>= db_dev) == false) { TangoSys_OMemStream o; o << "Database error while trying to import " << dev_name << ends; Except::throw_exception((const char *)API_DatabaseAccess, o.str(), (const char *)"Util::server_already_running"); } } // // If the device is not imported, leave function // if ((db_dev->lvalue)[0] == 0) { cout4 << "Leaving Util::server_already_running method" << endl; return; } CORBA::Object_var obj = orb->string_to_object((db_dev->svalue)[1]); // // Try to narrow the reference to a Tango::Device object // dev = Tango::Device::_narrow(obj); } catch (Tango::DevFailed &) { TangoSys_OMemStream o; o << "The device server " << ds_name << " is not defined in database. Exiting!" << ends; print_err_message(o.str()); } catch (CORBA::TRANSIENT &) { cout4 << "Leaving Util::server_already_running method" << endl; return; } catch (CORBA::OBJECT_NOT_EXIST &) { cout4 << "Leaving Util::server_already_running method" << endl; return; } catch (CORBA::NO_RESPONSE &) { print_err_message("This server is already running but is blocked!"); } catch (CORBA::COMM_FAILURE &) { cout4 << "Leaving Util::server_already_running method" << endl; return; } if (CORBA::is_nil(dev)) { cout4 << "Leaving Util::server_already_running method" << endl; return; } // // Now, get the device name from the server // try { CORBA::String_var n = dev->name(); unsigned long ctr; char *tmp_ptr = n.inout(); for (ctr = 0;ctr < strlen(tmp_ptr);ctr++) tmp_ptr[ctr] = tolower(tmp_ptr[ctr]); for (ctr = 0;ctr < dev_name.length();ctr++) dev_name[ctr] = tolower(dev_name[ctr]); if (n.in() == dev_name) { print_err_message("This server is already running, exiting!"); } } catch (Tango::DevFailed &) { // // It is necessary to catch this exception because it is thrown by the // print_err_message method under windows // throw; } catch (CORBA::NO_RESPONSE &) { try { print_err_message("This server is already running but is blocked!"); } catch (Tango::DevFailed &) { throw; } } catch (CORBA::SystemException &) {} catch (CORBA::Exception &) {} cout4 << "Leaving Util::server_already_running method" << endl; } //+---------------------------------------------------------------------------- // // method : Util::server_init() // // description : To initialise all classes in the device server process // //----------------------------------------------------------------------------- void Util::server_init(TANGO_UNUSED(bool with_window)) { // // Even if we are not in a Python DS, we have to create the per-thread // PyData object. For Python DS, this is done in the Python_init method // defined in the binding // #ifdef _TG_WINDOWS_ if (Util::_service == true) { omni_thread::create_dummy(); ext->_dummy_thread = true; } omni_thread *th = omni_thread::self(); if (th == NULL) { th = omni_thread::create_dummy(); ext->_dummy_thread = true; } #else omni_thread *th = omni_thread::self(); if (th == NULL) { th = omni_thread::create_dummy(); ext->_dummy_thread = true; } #endif if (is_py_ds() == false) { th->set_value(key_py_data,new Tango::PyData()); } #ifdef _TG_WINDOWS_ if (with_window == true) { // // Create device server windows // ds_window = new W32Win(this,nCmd); // // Change cout that it uses the graphical console window // #ifndef TANGO_HAS_LOG4TANGO cout.rdbuf(ds_window->get_output_buffer()); cout_tmp.rdbuf(ds_window->get_output_buffer()); #endif } #ifdef TANGO_HAS_LOG4TANGO //MODIF-NL else { ds_window = 0; } #endif if (_win == true) { go = false; loop_th = new ORBWin32Loop(this); loop_th->start(); } else { #endif /* WIN 32 */ // // Initialise main class // DServerClass::init(); // // Configure polling from the polling properties // In case of python DS, we need to release the Python GIL // because the polling_configure method will send cmd to the // pollinh thread which will try to get the Python GIL // int th_id = th->id(); PyLock *lock_ptr; bool py_ds_main_th = false; if ((th_id == 0) && (is_py_ds() == true)) { py_ds_main_th = true; omni_thread::value_t *tmp_py_data = th->get_value(key_py_data); lock_ptr = (static_cast(tmp_py_data))->PerTh_py_lock; lock_ptr->Release(); } polling_configure(); if (py_ds_main_th == true) { lock_ptr->Get(); } // // Delete the db cache if it has been used // if (ext->db_cache != NULL) { // extract sub device information before deleting cache! get_sub_dev_diag().get_sub_devices_from_cache(); delete ext->db_cache; ext->db_cache = NULL; } #ifdef _TG_WINDOWS_ } #endif /* _TG_WINDOWS_ */ } //+---------------------------------------------------------------------------- // // method : Util::server_run() // // description : To start the CORBA event loop // //----------------------------------------------------------------------------- void Util::server_run() { omni_thread *th = omni_thread::self(); int th_id = th->id(); // // For Windows in a non-MSDOS window, start the ORB in its own thread. The main // thread is used for windows management. // #ifdef _TG_WINDOWS_ if (_win == true) { omni_mutex_lock syc(mon); // // Start the ORB thread (and loop) // go = true; mon.signal(); } else { if (_service == true) { NTService *serv = NTService::instance(); serv->statusUpdate(SERVICE_RUNNING); if (serv->stopped_ == false) { //JM : 9.8.2005 : destroy() should be called at the exit of run()! try { orb->run(); server_cleanup(); } catch (CORBA::Exception &) { server_cleanup(); throw; } } } else { cout << "Ready to accept request" << endl; if (th_id == 0) { omni_thread::value_t *tmp_py_data = th->get_value(key_py_data); PyLock *lock_ptr = (static_cast(tmp_py_data))->PerTh_py_lock; lock_ptr->Release(); } //JM : 9.8.2005 : destroy() should be called at the exit of run()! try { orb->run(); server_cleanup(); if (th_id == 0) { omni_thread::value_t *tmp_py_data = th->get_value(key_py_data); PyLock *lock_ptr = (static_cast(tmp_py_data))->PerTh_py_lock; lock_ptr->Get(); } } catch (CORBA::Exception &) { server_cleanup(); throw; } } } #else cout << "Ready to accept request" << endl; if (th_id == 0) { omni_thread::value_t *tmp_py_data = th->get_value(key_py_data); PyLock *lock_ptr = (static_cast(tmp_py_data))->PerTh_py_lock; lock_ptr->Release(); } //JM : 9.8.2005 : destroy() should be called at the exit of run()! try { if (ext->ev_loop_func != NULL) { // // If the user has installed its own event management function, call it in a loop // struct timespec sleep_time; sleep_time.tv_sec = 0; sleep_time.tv_nsec = 20000000; bool user_shutdown_server; while(ext->shutdown_server == false) { if (is_svr_shutting_down() == false) { if (orb->work_pending()) orb->perform_work(); user_shutdown_server = (*ext->ev_loop_func)(); if (user_shutdown_server == true) { shutdown_server(); ext->shutdown_server = true; } } else { nanosleep(&sleep_time,NULL); } } } else { orb->run(); } server_cleanup(); if (th_id == 0) { omni_thread::value_t *tmp_py_data = th->get_value(key_py_data); PyLock *lock_ptr = (static_cast(tmp_py_data))->PerTh_py_lock; lock_ptr->Get(); } } catch (CORBA::Exception &e) { server_cleanup(); throw; } #endif } //+---------------------------------------------------------------------------- // // method : Util::server_cleanup() // // description : To relinquish computer resource before process exit // //----------------------------------------------------------------------------- void Util::server_cleanup() { #ifndef _TG_WINDOWS_ // // Destroy the ORB // if (_constructed == true) { orb->destroy(); // JM : 8.9.2005 : mark as already destroyed _constructed = false; } #else if (ds_window == NULL) { if (_constructed == true) { orb->destroy(); // JM : 8.9.2005 : mark as already destroyed _constructed = false; } } #endif if (ext->_dummy_thread == true) omni_thread::release_dummy(); } //+---------------------------------------------------------------------------- // // method : Util::get_device_list_by_class() // // description : To return a reference to the vector of device for a // specific class // // in : - class_name : The class name // //----------------------------------------------------------------------------- vector &Util::get_device_list_by_class(const string &class_name) { if (cl_list_ptr == NULL) { Except::throw_exception((const char *)API_DeviceNotFound, (const char *)"It's too early to call this method. Devices are not created yet!", (const char *)"Util::get_device_list_by_class()"); } // // Retrieve class list. Don't use the get_dserver_device() method followed by // the get_class_list(). In case of several classes embedded within // the same server and the use of this method in the object creation, it // will fail because the end of the dserver object creation is after the // end of the last server device creation. // const vector &tmp_cl_list = *cl_list_ptr; // // Check if the wanted class really exists // int nb_class = tmp_cl_list.size(); int i; for (i = 0;i < nb_class;i++) { if (tmp_cl_list[i]->get_name() == class_name) break; } // // Also check if it it the DServer class // if (class_name == "DServer") { return DServerClass::instance()->get_device_list(); } // // Throw exception if the class is not found // if (i == nb_class) { TangoSys_OMemStream o; o << "Class " << class_name << " not found" << ends; Except::throw_exception((const char *)API_ClassNotFound, o.str(), (const char *)"Util::get_device_list_by_class()"); } return tmp_cl_list[i]->get_device_list(); } vector &Util::get_device_list_by_class(const char *class_name) { string class_str(class_name); return get_device_list_by_class(class_str); } //+---------------------------------------------------------------------------- // // method : Util::get_device_by_name() // // description : To return a reference to the device object from its // name // // in : - dev_name : The device name // //----------------------------------------------------------------------------- DeviceImpl *Util::get_device_by_name(const string &dev_name) { string dev_name_lower(dev_name); transform(dev_name_lower.begin(),dev_name_lower.end(),dev_name_lower.begin(),::tolower); DeviceImpl *ret_ptr = find_device_name_core(dev_name_lower); // // If the device is not found, may be the name we have received is an alias ? // if (ret_ptr == NULL) { string d_name; if (_UseDb == true) { try { db->get_device_alias(dev_name_lower,d_name); } catch (Tango::DevFailed &) {} } if (d_name.size() != 0) { transform(d_name.begin(),d_name.end(),d_name.begin(),::tolower); ret_ptr = find_device_name_core(d_name); // // If the name given to this method is a valid alias name, // store the alias name in device object for possible // future call to this method (save some db calls) // if (ret_ptr != NULL) { ret_ptr->set_alias_name_lower(dev_name_lower); } } } // // Throw exception if the device is not found // if (ret_ptr == NULL) { TangoSys_OMemStream o; o << "Device " << dev_name << " not found" << ends; Except::throw_exception((const char *)API_DeviceNotFound, o.str(), (const char *)"Util::get_device_by_name()"); } return ret_ptr; } DeviceImpl *Util::find_device_name_core(string &dev_name) { // // Retrieve class list. Don't use the get_dserver_device() method followed by // the get_class_list(). In case of several classes embedded within // the same server and the use of this method in the object creation, it // will fail because the end of the dserver object creation is after the // end of the last server device creation. // const vector &tmp_cl_list = *cl_list_ptr; DeviceImpl *ret_ptr = NULL; // // Check if the wanted device exists in each class // int nb_class = tmp_cl_list.size(); int i,j,nb_dev; bool found = false; for (i = 0;i < nb_class;i++) { vector &dev_list = get_device_list_by_class(tmp_cl_list[i]->get_name()); nb_dev = dev_list.size(); for (j = 0;j < nb_dev;j++) { string name(dev_list[j]->get_name()); transform(name.begin(),name.end(),name.begin(),::tolower); if (name == dev_name) { found = true; ret_ptr = dev_list[j]; break; } string &alias_name = dev_list[j]->get_alias_name_lower(); if (alias_name.size() != 0) { if (alias_name == dev_name) { found = true; ret_ptr = dev_list[j]; break; } } } if (found == true) break; } // // Check also the dserver device // if (found == false) { DServerClass *ds_class = DServerClass::instance(); vector &devlist = ds_class->get_device_list(); string name(devlist[0]->get_name()); transform(name.begin(),name.end(),name.begin(),::tolower); if (name == dev_name) { ret_ptr = devlist[0]; j--; } } // // Return to caller. The returned value is NULL if the device is not found // return ret_ptr; } DeviceImpl *Util::get_device_by_name(const char *dev_name) { string name_str(dev_name); return get_device_by_name(name_str); } //+---------------------------------------------------------------------------- // // method : Util::get_dserver_device() // // description : To return a pointer to the dserver device automatically // attached to each device server process // //----------------------------------------------------------------------------- DServer *Util::get_dserver_device() { return (DServer *)((DServerClass::instance()->get_device_list())[0]); } //+---------------------------------------------------------------------------- // // method : Util::get_device_list // // description : helper method to get device list from a wild card // If no device is found, does not throw exception, just return // an empty vector // // in : The wildcard (e.g. "*", "/tango/tangotest/*", ...) // // out : The list of devices which name matches the wildcard // //----------------------------------------------------------------------------- std::vector Util::get_device_list (const std::string& pattern) { cout4 << "In Util::get_device_list" << endl; // the returned list std::vector dl(0); // // ------------------------------------------------------------------ // CASE I: pattern does not contain any '*' char - it's a device name // if (pattern.find('*') == std::string::npos) { DeviceImpl* dev = 0; try { dev = get_device_by_name(pattern); } catch (Tango::DevFailed&) {} // // add dev to the list // if (dev) dl.push_back(dev); return dl; } // // for the two remaining cases, we need the list of all DeviceClasses. // const std::vector dcl(*(get_class_list())); // a vector to store a given class' devices std::vector temp_dl; // // ------------------------------------------------------------------ // CASE II: pattern == "*" - return a list containing all devices // if (pattern == "*") { for (unsigned int i = 0; i < dcl.size(); i++) { temp_dl = dcl[i]->get_device_list(); dl.insert(dl.end(), temp_dl.begin(), temp_dl.end()); } return dl; } // // ------------------------------------------------------------------ // CASE III: pattern contains at least one '*' char // std::string::size_type pos; std::string::size_type last_pos = 0; std::string token; std::vector tokens(0); // // build the token list // int done = 0; do { pos = pattern.find('*', last_pos); if (pos != 0) { if (pos == std::string::npos) { if (last_pos >= pattern.size()) break; pos = pattern.size(); done = 1; } token.assign(pattern.begin() + last_pos, pattern.begin() + pos); cout4 << "Found pattern " << token << endl; tokens.push_back(token); } last_pos = pos + 1; } while (!done); // look for token(s) in device names unsigned int i, j, k; std::string dev_name; // for each DeviceClass... for (i = 0; i < dcl.size(); i++) { // ...get device list temp_dl = dcl[i]->get_device_list(); // for each device in in list... for (j = 0; j < temp_dl.size(); j++) { // get device name dev_name = temp_dl[j]->get_name(); // make sure each char is lower case std::transform(dev_name.begin(), dev_name.end(), dev_name.begin(), ::tolower); // then look for token(s) in device name // to be added to the list, device_name must contains // every token in the right order. for (k = 0, pos = 0; k < tokens.size(); k++) { pos = dev_name.find(tokens[k], pos); if (pos == std::string::npos) break; } // if dev_name matches the pattern, add the device to the list if (k == tokens.size()) { cout4 << "Device " << temp_dl[j]->get_name() << " match pattern" << endl; dl.push_back(temp_dl[j]); } } } cout4 << "Returning a device list containing " << dl.size() << " items" << endl; return dl; } //+---------------------------------------------------------------------------- // // method : Util::unregister_server() // // description : Unregister the server from the database // //----------------------------------------------------------------------------- void Util::unregister_server() { cout4 << "Entering Util::unregister_server method" << endl; // // Mark all the devices belonging to this server as unexported // if ((_UseDb == true) && (_FileDb == false)) { try { db->unexport_server(ds_name); } catch (Tango::DevFailed &e) { Except::print_exception(e); throw; } catch (CORBA::Exception &e) { Except::print_exception(e); throw; } } cout4 << "Leaving Util::unregister_server method" << endl; } //+---------------------------------------------------------------------------- // // method : Util::print_err_message() // // description : Print error message in the classical console or with // a message box // For Unix like OS, this method exits. if it is called // under NT in a graphical environment, it throws // exception // // in : - err_mess : The error message // //----------------------------------------------------------------------------- void Util::print_err_message(const char *err_mess,TANGO_UNUSED(Tango::MessBoxType type)) { #ifdef _TG_WINDOWS_ if (_win == true) { switch (type) { case Tango::STOP: MessageBox((HWND)NULL,err_mess,MessBoxTitle,MB_ICONSTOP); break; case Tango::INFO: MessageBox((HWND)NULL,err_mess,MessBoxTitle,MB_ICONINFORMATION); break; } Except::throw_exception((const char *)API_StartupSequence, (const char *)"Error in device server startup sequence", (const char *)"Util::print_err_mess"); } else { cerr << err_mess << endl; exit(-1); } #else cerr << err_mess << endl; _exit(-1); #endif } //+---------------------------------------------------------------------------- // // method : Util::get_tango_lib_vers() // // description : Return a number set to the Tango release number // coded with 3 digits (550, 551,552,600) // //----------------------------------------------------------------------------- long Util::get_tango_lib_release() { return _convert_tango_lib_release(); } //+---------------------------------------------------------------------------- // // method : Util::clean_dyn_attr_prop() // // description : Clean in database the dynamic attribute property(ies) // //----------------------------------------------------------------------------- void Util::clean_dyn_attr_prop() { if (Tango::Util::_UseDb == true) { DbData send_data; for (unsigned long loop = 0;loop < ext->all_dyn_attr.size();loop++) { DbDatum db_dat(ext->all_dyn_attr[loop]); send_data.push_back(db_dat); } db->delete_all_device_attribute_property(ext->dyn_att_dev_name,send_data); } } //+---------------------------------------------------------------------------- // // method : Util::delete_restarting_device() // // description : Delete a device from the vector of restarting device // // args: - d_name : - The device name // //----------------------------------------------------------------------------- void Util::delete_restarting_device(string &d_name) { vector::iterator pos; pos = remove(ext->restarting_devices.begin(),ext->restarting_devices.end(),d_name); ext->restarting_devices.erase(pos,ext->restarting_devices.end()); } #ifdef _TG_WINDOWS_ //+---------------------------------------------------------------------------- // // method : Util::build_argc_argv() // // description : Build argc, argv UNIX like parameters from the Windows // command line // // in : // //----------------------------------------------------------------------------- void Util::build_argc_argv() { // // Get command line // char *cmd_line = GetCommandLine(); int cnt=0; char *tmp; // // First, count how many args we have. If the user type two spaces between args, // we will have too many pointers allocates but it is not a problem // int cmd_line_size = strlen(cmd_line); for (int i = 0;i < cmd_line_size;i++) { if (cmd_line[i] == ' ') cnt++; } // // Allocate memory for argv // argv = new char *[cnt + 1]; // // If only one args, no parsing is necessary // if (cnt == 0) { argv[0] = new char [cmd_line_size + 1]; strcpy(argv[0],cmd_line); argc = 1; } else { // // Get program name // tmp = strtok(cmd_line," "); argv[0] = new char [strlen(tmp) + 1]; strcpy(argv[0],tmp); // // Get remaining args // int i = 1; while ((tmp = strtok(NULL," ")) != NULL) { argv[i] = new char [strlen(tmp) + 1]; strcpy(argv[i],tmp); i++; } argc = i; } } HWND Util::get_console_window() { return ds_window->get_output_buffer()->get_debug_window(); } HWND Util::get_ds_main_window() { return ds_window->get_win(); } CoutBuf *Util::get_debug_object() { return ds_window ? ds_window->get_output_buffer() : 0; } BOOL CtrlHandler(DWORD fdwCtrlType) { switch( fdwCtrlType ) { // Ignore logoff event! case CTRL_LOGOFF_EVENT: return TRUE; // Pass all other signals to the next signal handler default: return FALSE; } } void Util::install_cons_handler() { if (!SetConsoleCtrlHandler((PHANDLER_ROUTINE)CtrlHandler,TRUE)) print_err_message("WARNING: Can't install the console handler"); } //+---------------------------------------------------------------------------- // // method : Util::ORBWin32Loop::run() // // description : Start the ORB loop. This method is in a inner class // because it is started using the a separate thread. // One thread is for the Windows event loop and the // second thread is for the ORB loop. // // in : // //----------------------------------------------------------------------------- void *Util::ORBWin32Loop::run_undetached(void *ptr) { // // Create the per thread data for the main thread // omni_thread::self()->set_value(key_py_data,new Tango::PyData()); // // Create the DServer object // try { DServerClass::init(); } catch (bad_alloc) { MessageBox((HWND)NULL,"Memory error","Device creation failed",MB_ICONSTOP); ::exit(-1); } catch (Tango::DevFailed &e) { string str(e.errors[0].desc.in()); str = str + '\n'; str = str + e.errors[0].origin.in(); MessageBox((HWND)NULL,str.c_str(),"Device creation failed",MB_ICONSTOP); ::exit(-1); } catch (CORBA::Exception &) { MessageBox((HWND)NULL,"CORBA exception","Device creation failed",MB_ICONSTOP); ::exit(-1); } // // Configure polling from polling properties // util->polling_configure(); // // Delete DB cache (if there is one) // if (util->ext->db_cache != NULL) { // extract sub device information before deleting cache! util->get_sub_dev_diag().get_sub_devices_from_cache(); delete util->ext->db_cache; util->ext->db_cache = NULL; } // // Start the ORB // wait_for_go(); util->get_orb()->run(); return NULL; } void Util::ORBWin32Loop::wait_for_go() { omni_mutex_lock sync(util->mon); while(util->go == false) { util->mon.wait(); } } #endif /* _TG_WINDOWS_ */ int TangoMonitor::wait(long nb_millis) { unsigned long s,n; unsigned long nb_sec,nb_nanos; nb_sec = nb_millis / 1000 ; nb_nanos = (nb_millis - (nb_sec * 1000)) * 1000000; omni_thread::get_time(&s,&n,nb_sec,nb_nanos); return cond.timedwait(s,n); } void clear_att_dim(Tango::AttributeValue_3 &att_val) { att_val.r_dim.dim_x = 0; att_val.r_dim.dim_y = 0; att_val.w_dim.dim_x = 0; att_val.w_dim.dim_y = 0; } void clear_att_dim(Tango::AttributeValue_4 &att_val) { att_val.r_dim.dim_x = 0; att_val.r_dim.dim_y = 0; att_val.w_dim.dim_x = 0; att_val.w_dim.dim_y = 0; att_val.data_format = Tango::FMT_UNKNOWN; } // // The function called by the interceptor on thread creation // void create_PyPerThData(omni::omniInterceptors::createThread_T::info_T &info) { PyData *py_dat_ptr = new PyData(); #ifdef _TG_WINDOWS_ omni_thread::ensure_self es; #endif omni_thread::self()->set_value(key_py_data,py_dat_ptr); Util *tg = NULL; Interceptors *Inter = NULL; try { tg = Util::instance(false); Inter = tg->get_interceptors(); } catch(Tango::DevFailed &) {} if (Inter != NULL) Inter->create_thread(); info.run(); omni_thread::self()->remove_value(key_py_data); delete py_dat_ptr; if (Inter != NULL) Inter->delete_thread(); return; } AutoPyLock::AutoPyLock() { omni_thread::value_t *tmp_py_data = omni_thread::self()->get_value(key_py_data); PyLock *lock_ptr = (static_cast(tmp_py_data))->PerTh_py_lock; lock_ptr->Get(); } AutoPyLock::~AutoPyLock() { omni_thread::value_t *tmp_py_data = omni_thread::self()->get_value(key_py_data); PyLock *lock_ptr = (static_cast(tmp_py_data))->PerTh_py_lock; lock_ptr->Release(); } // // A small function to convert Tango lib release string to a number // // It is defined as a function to be used within the Utils and ApiUtil // classes (both client and server part) // long _convert_tango_lib_release() { long ret; ret = (TANGO_VERSION_MAJOR * 100) + (TANGO_VERSION_MINOR * 10) + TANGO_VERSION_PATCH; return ret; } } // End of Tango namespace tango-8.1.2c+dfsg.orig/lib/cpp/server/Makefile.in0000644000175000017500000010246312205375243020507 0ustar piccapicca# Makefile.in generated by automake 1.11.3 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 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. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ subdir = lib/cpp/server DIST_COMMON = README $(srcdir)/Makefile.am $(srcdir)/Makefile.in \ $(tangoinclude_HEADERS) ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/RSSH_CHECK_OMNIORB.m4 \ $(top_srcdir)/m4/RSSH_CHECK_PTHREADS.m4 \ $(top_srcdir)/m4/RSSH_CHECK_SUNPRO_CC.m4 \ $(top_srcdir)/m4/RSSH_ENABLE_PTHREADS.m4 \ $(top_srcdir)/m4/ac_cxx_have_class_strstream.m4 \ $(top_srcdir)/m4/ac_cxx_have_sstream.m4 \ $(top_srcdir)/m4/ac_cxx_namespaces.m4 \ $(top_srcdir)/m4/ac_path_mysqlclient.m4 \ $(top_srcdir)/m4/ac_prog_mysql.m4 \ $(top_srcdir)/m4/ax_cxx_compile_stdcxx_11.m4 \ $(top_srcdir)/m4/ax_jni_include_dir.m4 \ $(top_srcdir)/m4/check_zlib.m4 $(top_srcdir)/m4/gcc_release.m4 \ $(top_srcdir)/m4/java_release.m4 $(top_srcdir)/m4/libtool.m4 \ $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ $(top_srcdir)/m4/mysql_release.m4 $(top_srcdir)/configure.in am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/ac_config.h.tmp CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = 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)$(tangoincludedir)" LTLIBRARIES = $(lib_LTLIBRARIES) am__DEPENDENCIES_1 = libtango_la_DEPENDENCIES = ../client/libclient.la \ ../log4tango/src/liblog4tango.la jpeg/libjpeg.la \ jpeg_mmx/libjpeg_mmx.la $(am__DEPENDENCIES_1) am_libtango_la_OBJECTS = tangoSK.lo tangoDynSK.lo attrdesc.lo \ attribute.lo attrmanip.lo basiccommand.lo blackbox.lo \ class_factory.lo classattribute.lo command.lo coutappender.lo \ dev_event.lo dev_poll.lo device.lo device_2.lo device_3.lo \ device_4.lo deviceclass.lo devicelog.lo dserver.lo \ dserverclass.lo dserverlock.lo dserverlog.lo dserverpoll.lo \ dserversignal.lo encoded_attribute.lo eventcmds.lo \ eventsupplier.lo except.lo logcmds.lo logging.lo logstream.lo \ multiattribute.lo notifdeventsupplier.lo pollcmds.lo \ pollobj.lo pollring.lo pollthread.lo seqvec.lo subdev_diag.lo \ tangoappender.lo tangorollingfileappender.lo thsig.lo utils.lo \ utils_polling.lo utils_shut.lo w_attribute.lo \ zmqeventsupplier.lo libtango_la_OBJECTS = $(am_libtango_la_OBJECTS) libtango_la_LINK = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CXXLD) $(AM_CXXFLAGS) \ $(CXXFLAGS) $(libtango_la_LDFLAGS) $(LDFLAGS) -o $@ DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) depcomp = $(SHELL) $(top_srcdir)/config/depcomp am__depfiles_maybe = depfiles am__mv = mv -f CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) LTCXXCOMPILE = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) CXXLD = $(CXX) CXXLINK = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=link $(CXXLD) $(AM_CXXFLAGS) $(CXXFLAGS) $(AM_LDFLAGS) \ $(LDFLAGS) -o $@ SOURCES = $(libtango_la_SOURCES) DIST_SOURCES = $(libtango_la_SOURCES) RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \ html-recursive info-recursive install-data-recursive \ install-dvi-recursive install-exec-recursive \ install-html-recursive install-info-recursive \ install-pdf-recursive install-ps-recursive install-recursive \ installcheck-recursive installdirs-recursive pdf-recursive \ ps-recursive uninstall-recursive HEADERS = $(tangoinclude_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 ETAGS = etags CTAGS = ctags DIST_SUBDIRS = $(SUBDIRS) DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) am__relativize = \ dir0=`pwd`; \ sed_first='s,^\([^/]*\)/.*$$,\1,'; \ sed_rest='s,^[^/]*/*,,'; \ sed_last='s,^.*/\([^/]*\)$$,\1,'; \ sed_butlast='s,/*[^/]*$$,,'; \ while test -n "$$dir1"; do \ first=`echo "$$dir1" | sed -e "$$sed_first"`; \ if test "$$first" != "."; then \ if test "$$first" = ".."; then \ dir2=`echo "$$dir0" | sed -e "$$sed_last"`/"$$dir2"; \ dir0=`echo "$$dir0" | sed -e "$$sed_butlast"`; \ else \ first2=`echo "$$dir2" | sed -e "$$sed_first"`; \ if test "$$first2" = "$$first"; then \ dir2=`echo "$$dir2" | sed -e "$$sed_rest"`; \ else \ dir2="../$$dir2"; \ fi; \ dir0="$$dir0"/"$$first"; \ fi; \ fi; \ dir1=`echo "$$dir1" | sed -e "$$sed_rest"`; \ done; \ reldir="$$dir2" ACLOCAL = @ACLOCAL@ ALLOCA = @ALLOCA@ AMTAR = @AMTAR@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CORBA_INCLUDES = @CORBA_INCLUDES@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CPP_ELEVEN = @CPP_ELEVEN@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DATADIR = @DATADIR@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DOXYGEN = @DOXYGEN@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ GREP = @GREP@ HAVE_CXX11 = @HAVE_CXX11@ HAVE_ORB_IDL = @HAVE_ORB_IDL@ IDL = @IDL@ IDLCXX = @IDLCXX@ IDLCXXFLAGS = @IDLCXXFLAGS@ IDLFLAGS = @IDLFLAGS@ IDL_CLN_CPP = @IDL_CLN_CPP@ IDL_CLN_CPP_SUFFIX = @IDL_CLN_CPP_SUFFIX@ IDL_CLN_H = @IDL_CLN_H@ IDL_CLN_H1_SUFFIX = @IDL_CLN_H1_SUFFIX@ IDL_CLN_H_SUFFIX = @IDL_CLN_H_SUFFIX@ IDL_CLN_O = @IDL_CLN_O@ IDL_CLN_OBJ_SUFFIX = @IDL_CLN_OBJ_SUFFIX@ IDL_H1_SUFFIX = @IDL_H1_SUFFIX@ IDL_H_SUFFIX = @IDL_H_SUFFIX@ IDL_SRV_CPP = @IDL_SRV_CPP@ IDL_SRV_CPP_SUFFIX = @IDL_SRV_CPP_SUFFIX@ IDL_SRV_H = @IDL_SRV_H@ IDL_SRV_H1_SUFFIX = @IDL_SRV_H1_SUFFIX@ IDL_SRV_H_SUFFIX = @IDL_SRV_H_SUFFIX@ IDL_SRV_O = @IDL_SRV_O@ IDL_SRV_OBJ_SUFFIX = @IDL_SRV_OBJ_SUFFIX@ IDL_TIE_CPP_SUFFIX = @IDL_TIE_CPP_SUFFIX@ IDL_TIE_H1_SUFFIX = @IDL_TIE_H1_SUFFIX@ IDL_TIE_H_SUFFIX = @IDL_TIE_H_SUFFIX@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ JAVA = @JAVA@ JAVAC = @JAVAC@ JAVAH = @JAVAH@ JNI_INCL_DIRS = @JNI_INCL_DIRS@ JPEG_LIB_CXXFLAGS = @JPEG_LIB_CXXFLAGS@ JPEG_MMX_LIB_CXXFLAGS = @JPEG_MMX_LIB_CXXFLAGS@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIBZMQ_CFLAGS = @LIBZMQ_CFLAGS@ LIBZMQ_LIBS = @LIBZMQ_LIBS@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ LYX = @LYX@ MAINT = @MAINT@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ MYSQL = @MYSQL@ MYSQLCLIENT_CFLAGS = @MYSQLCLIENT_CFLAGS@ MYSQLCLIENT_LDFLAGS = @MYSQLCLIENT_LDFLAGS@ MYSQLCLIENT_LIBS = @MYSQLCLIENT_LIBS@ MYSQL_ADMIN = @MYSQL_ADMIN@ MYSQL_ADMIN_PASSWD = @MYSQL_ADMIN_PASSWD@ MYSQL_HOST = @MYSQL_HOST@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ ORB = @ORB@ ORB_COSNAMING_LIB = @ORB_COSNAMING_LIB@ ORB_INCLUDE_PREFIX = @ORB_INCLUDE_PREFIX@ ORB_PREFIX = @ORB_PREFIX@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ TANGO_DB_NAME = @TANGO_DB_NAME@ TANGO_RC_FILE = @TANGO_RC_FILE@ VERSION = @VERSION@ VERSION_INFO = @VERSION_INFO@ ZLIB_CPPFLAGS = @ZLIB_CPPFLAGS@ ZLIB_LDFLAGS = @ZLIB_LDFLAGS@ ZLIB_LIBS = @ZLIB_LIBS@ ZMQ_PREFIX = @ZMQ_PREFIX@ _ACJNI_JAVAC = @_ACJNI_JAVAC@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_aux_dir = @ac_aux_dir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ omniCOS4_CFLAGS = @omniCOS4_CFLAGS@ omniCOS4_LIBS = @omniCOS4_LIBS@ omniORB4_CFLAGS = @omniORB4_CFLAGS@ omniORB4_LIBS = @omniORB4_LIBS@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ subdirs = @subdirs@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ SUBDIRS = idl jpeg jpeg_mmx . # We need the ORB to compile and the tango header files to compile INCLUDES = -I$(top_srcdir)/lib/cpp/client \ -I$(top_srcdir)/lib/cpp/log4tango/include \ -I$(top_builddir)/lib/cpp/log4tango/include \ $(ORB_INCLUDE_PREFIX) $(LIBZMQ_CFLAGS) # We're making a shared library with libtool (that's why we use LTLIBRARIES) lib_LTLIBRARIES = libtango.la # We need the libclient to link libtango_la_LIBADD = ../client/libclient.la \ ../log4tango/src/liblog4tango.la \ jpeg/libjpeg.la \ jpeg_mmx/libjpeg_mmx.la \ $(LIBZMQ_LIBS) # We need to set the -version-info for libtool so that libtool will # generate the correct .so version libtango_la_LDFLAGS = -version-info $(VERSION_INFO) AM_CXXFLAGS = -D_TANGO_LIB @DARWIN_ENABLED_TRUE@AM_LDFLAGS = -flat_namespace --disable-dependency-tracking # The sources libtango_la_SOURCES = tangoSK.cpp \ tangoDynSK.cpp \ attrdesc.cpp \ attribute.cpp \ attrmanip.cpp \ basiccommand.cpp \ blackbox.cpp \ class_factory.cpp \ classattribute.cpp \ command.cpp \ coutappender.cpp \ dev_event.cpp \ dev_poll.cpp \ device.cpp \ device_2.cpp \ device_3.cpp \ device_4.cpp \ deviceclass.cpp \ devicelog.cpp \ dserver.cpp \ dserverclass.cpp \ dserverlock.cpp \ dserverlog.cpp \ dserverpoll.cpp \ dserversignal.cpp \ encoded_attribute.cpp \ eventcmds.cpp \ eventsupplier.cpp \ except.cpp \ logcmds.cpp \ logging.cpp \ logstream.cpp \ multiattribute.cpp \ notifdeventsupplier.cpp \ pollcmds.cpp \ pollobj.cpp \ pollring.cpp \ pollthread.cpp \ seqvec.cpp \ subdev_diag.cpp \ tangoappender.cpp \ tangorollingfileappender.cpp \ thsig.cpp \ utils.cpp \ utils_polling.cpp \ utils_shut.cpp \ w_attribute.cpp \ zmqeventsupplier.cpp tangoincludedir = $(includedir)/tango tangoinclude_HEADERS = attrdesc.h \ attribute.h \ attrmanip.h \ attrprop.h \ auto_tango_monitor.h \ basiccommand.h \ blackbox.h \ classattribute.h \ command.h \ coutappender.h \ coutbuf.h \ device.h \ device_2.h \ device_3.h \ device_4.h \ deviceclass.h \ dserver.h \ dserverclass.h \ dserversignal.h \ encoded_attribute.h \ encoded_format.h \ eventsupplier.h \ except.h \ log4tango.h \ logcmds.h \ logging.h \ logstream.h \ multiattribute.h \ ntservice.h \ pollcmds.h \ pollext.h \ pollobj.h \ pollring.h \ pollthread.h \ readers_writers_lock.h \ seqvec.h \ subdev_diag.h \ tango.h \ tango_config.h \ tango_const.h \ tango_monitor.h \ tangoappender.h \ tangorollingfileappender.h \ utils.h \ w_attribute.h \ attribute.tpp \ utils.tpp \ w_attribute.tpp \ attrprop.tpp all: all-recursive .SUFFIXES: .SUFFIXES: .cpp .lo .o .obj $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu lib/cpp/server/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu lib/cpp/server/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): 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 \ list2="$$list2 $$p"; \ else :; fi; \ done; \ test -z "$$list2" || { \ 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)"; \ } uninstall-libLTLIBRARIES: @$(NORMAL_UNINSTALL) @list='$(lib_LTLIBRARIES)'; test -n "$(libdir)" || list=; \ for p in $$list; do \ $(am__strip_dir) \ echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(libdir)/$$f'"; \ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(libdir)/$$f"; \ done 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 libtango.la: $(libtango_la_OBJECTS) $(libtango_la_DEPENDENCIES) $(EXTRA_libtango_la_DEPENDENCIES) $(libtango_la_LINK) -rpath $(libdir) $(libtango_la_OBJECTS) $(libtango_la_LIBADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/attrdesc.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/attribute.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/attrmanip.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/basiccommand.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/blackbox.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/class_factory.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/classattribute.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/command.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/coutappender.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dev_event.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dev_poll.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/device.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/device_2.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/device_3.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/device_4.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/deviceclass.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/devicelog.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dserver.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dserverclass.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dserverlock.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dserverlog.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dserverpoll.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dserversignal.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/encoded_attribute.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/eventcmds.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/eventsupplier.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/except.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/logcmds.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/logging.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/logstream.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/multiattribute.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/notifdeventsupplier.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pollcmds.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pollobj.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pollring.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pollthread.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/seqvec.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/subdev_diag.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tangoDynSK.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tangoSK.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tangoappender.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tangorollingfileappender.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/thsig.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/utils.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/utils_polling.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/utils_shut.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/w_attribute.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/zmqeventsupplier.Plo@am__quote@ .cpp.o: @am__fastdepCXX_TRUE@ $(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(CXXCOMPILE) -c -o $@ $< .cpp.obj: @am__fastdepCXX_TRUE@ $(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` @am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'` .cpp.lo: @am__fastdepCXX_TRUE@ $(LTCXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(LTCXXCOMPILE) -c -o $@ $< mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs install-tangoincludeHEADERS: $(tangoinclude_HEADERS) @$(NORMAL_INSTALL) test -z "$(tangoincludedir)" || $(MKDIR_P) "$(DESTDIR)$(tangoincludedir)" @list='$(tangoinclude_HEADERS)'; test -n "$(tangoincludedir)" || list=; \ 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)$(tangoincludedir)'"; \ $(INSTALL_HEADER) $$files "$(DESTDIR)$(tangoincludedir)" || exit $$?; \ done uninstall-tangoincludeHEADERS: @$(NORMAL_UNINSTALL) @list='$(tangoinclude_HEADERS)'; test -n "$(tangoincludedir)" || list=; \ files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ dir='$(DESTDIR)$(tangoincludedir)'; $(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. $(RECURSIVE_TARGETS): @fail= failcom='exit 1'; \ for f in x $$MAKEFLAGS; do \ case $$f in \ *=* | --[!k]*);; \ *k*) failcom='fail=yes';; \ esac; \ done; \ dot_seen=no; \ target=`echo $@ | sed s/-recursive//`; \ list='$(SUBDIRS)'; for subdir in $$list; do \ echo "Making $$target in $$subdir"; \ if test "$$subdir" = "."; then \ dot_seen=yes; \ local_target="$$target-am"; \ else \ local_target="$$target"; \ fi; \ ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ || eval $$failcom; \ done; \ if test "$$dot_seen" = "no"; then \ $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \ fi; test -z "$$fail" $(RECURSIVE_CLEAN_TARGETS): @fail= failcom='exit 1'; \ for f in x $$MAKEFLAGS; do \ case $$f in \ *=* | --[!k]*);; \ *k*) failcom='fail=yes';; \ esac; \ done; \ dot_seen=no; \ case "$@" in \ distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \ *) list='$(SUBDIRS)' ;; \ esac; \ rev=''; for subdir in $$list; do \ if test "$$subdir" = "."; then :; else \ rev="$$subdir $$rev"; \ fi; \ done; \ rev="$$rev ."; \ target=`echo $@ | sed s/-recursive//`; \ for subdir in $$rev; do \ echo "Making $$target in $$subdir"; \ if test "$$subdir" = "."; then \ local_target="$$target-am"; \ else \ local_target="$$target"; \ fi; \ ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ || eval $$failcom; \ done && test -z "$$fail" tags-recursive: list='$(SUBDIRS)'; for subdir in $$list; do \ test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \ done ctags-recursive: list='$(SUBDIRS)'; for subdir in $$list; do \ test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \ done ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ mkid -fID $$unique tags: TAGS TAGS: tags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) set x; \ here=`pwd`; \ if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \ include_option=--etags-include; \ empty_fix=.; \ else \ include_option=--include; \ empty_fix=; \ fi; \ list='$(SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ test ! -f $$subdir/TAGS || \ set "$$@" "$$include_option=$$here/$$subdir/TAGS"; \ fi; \ done; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: CTAGS CTAGS: ctags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ 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 \ dir1=$$subdir; dir2="$(distdir)/$$subdir"; \ $(am__relativize); \ new_distdir=$$reldir; \ dir1=$$subdir; dir2="$(top_distdir)"; \ $(am__relativize); \ new_top_distdir=$$reldir; \ echo " (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir="$$new_top_distdir" distdir="$$new_distdir" \\"; \ echo " am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)"; \ ($(am__cd) $$subdir && \ $(MAKE) $(AM_MAKEFLAGS) \ top_distdir="$$new_top_distdir" \ distdir="$$new_distdir" \ am__remove_distdir=: \ am__skip_length_check=: \ am__skip_mode_fix=: \ distdir) \ || exit 1; \ fi; \ done check-am: all-am check: check-recursive all-am: Makefile $(LTLIBRARIES) $(HEADERS) installdirs: installdirs-recursive installdirs-am: for dir in "$(DESTDIR)$(libdir)" "$(DESTDIR)$(tangoincludedir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done install: install-recursive install-exec: install-exec-recursive install-data: install-data-recursive uninstall: uninstall-recursive install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-recursive install-strip: 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: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-recursive clean-am: clean-generic clean-libLTLIBRARIES clean-libtool \ mostlyclean-am distclean: distclean-recursive -rm -rf ./$(DEPDIR) -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags dvi: dvi-recursive dvi-am: html: html-recursive html-am: info: info-recursive info-am: install-data-am: install-tangoincludeHEADERS install-dvi: install-dvi-recursive install-dvi-am: install-exec-am: install-libLTLIBRARIES install-html: install-html-recursive install-html-am: install-info: install-info-recursive install-info-am: install-man: install-pdf: install-pdf-recursive install-pdf-am: install-ps: install-ps-recursive install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-recursive -rm -rf ./$(DEPDIR) -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-recursive mostlyclean-am: mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf: pdf-recursive pdf-am: ps: ps-recursive ps-am: uninstall-am: uninstall-libLTLIBRARIES uninstall-tangoincludeHEADERS .MAKE: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) ctags-recursive \ install-am install-strip tags-recursive .PHONY: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) CTAGS GTAGS \ all all-am check check-am clean clean-generic \ clean-libLTLIBRARIES 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-libLTLIBRARIES install-man install-pdf \ install-pdf-am install-ps install-ps-am install-strip \ install-tangoincludeHEADERS 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 \ uninstall-libLTLIBRARIES uninstall-tangoincludeHEADERS # 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: tango-8.1.2c+dfsg.orig/lib/cpp/server/eventsupplier.cpp0000644000175000017500000021340012205375142022043 0ustar piccapiccastatic const char *RcsId = "$Id: eventsupplier.cpp 22249 2013-03-11 11:59:52Z taurel $"; //==================================================================================================================== // // file : eventsupplier.cpp // // description : C++ classes for implementing the event server and client singleton classes - EventSupplier // This class is used to send events from the server // // author(s) : E.Taurel (taurel@esrf.fr) // // original : 29 June 2004 // // Copyright (C) : 2004,2005,2006,2007,2008,2009,2010,2011,2012,2013 // European Synchrotron Radiation Facility // BP 220, Grenoble 38043 // FRANCE // // This file is part of Tango. // // Tango 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. // // Tango 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 Tango. // If not, see . // // $Revision: 22249 $ // // //==================================================================================================================== #include #include namespace Tango { omni_mutex EventSupplier::event_mutex; omni_mutex EventSupplier::push_mutex; omni_mutex EventSupplier::detect_mutex; string EventSupplier::fqdn_prefix; //--------------------------------------------------------------------------------------------------------------------- // // method : // EventSupplier::EventSupplier() // // description : // EventSupplier class ctor // // argument : // in : // - tg : ptr to the Util class singleton // //-------------------------------------------------------------------------------------------------------------------- EventSupplier::EventSupplier(Util *tg):one_subscription_cmd(false) { if (fqdn_prefix.empty() == true) { fqdn_prefix = "tango://"; if (Util::_UseDb == false || Util::_FileDb == true) fqdn_prefix = fqdn_prefix + tg->get_host_name() + ':' + tg->get_svr_port_num() + '/'; else { Database *db = tg->get_database(); fqdn_prefix = fqdn_prefix + db->get_db_host() + ':' + db->get_db_port() + '/'; } transform(fqdn_prefix.begin(),fqdn_prefix.end(),fqdn_prefix.begin(),::tolower); } } //--------------------------------------------------------------------------------------------------------------------- // // method : // EventSupplier::detect_and_push_events() // // description : // Method to detect if it is necessary to push an event // // argument : // in : // - device_impl : The device // - attr_value : The attribute value // - except : The exception thrown during the last attribute reading. NULL if no exception // - attr_name : The attribute name // - time_bef_attr : Exact date when the attribute has been read // //-------------------------------------------------------------------------------------------------------------------- SendEventType EventSupplier::detect_and_push_events(DeviceImpl *device_impl,struct AttributeData &attr_value,DevFailed *except, string &attr_name,struct timeval *time_bef_attr) { string event, domain_name; time_t now, change_subscription, periodic_subscription, archive_subscription; SendEventType ret; cout3 << "EventSupplier::detect_and_push_events(): called for attribute " << attr_name << endl; Attribute &attr = device_impl->dev_attr->get_attr_by_name(attr_name.c_str()); now = time(NULL); { omni_mutex_lock oml(event_mutex); change_subscription = now - attr.ext->event_change_subscription; periodic_subscription = now - attr.ext->event_periodic_subscription; archive_subscription = now - attr.ext->event_archive_subscription; } cout3 << "EventSupplier::detect_and_push_events(): last subscription for change " << change_subscription << " periodic " << periodic_subscription << " archive " << archive_subscription << endl; // // For change event // ret.change = false; if (change_subscription < EVENT_RESUBSCRIBE_PERIOD) { if (detect_and_push_change_event(device_impl,attr_value,attr,attr_name,except) == true) ret.change = true; } else attr.ext->event_change_client_3 = false; // // For periodic event // ret.periodic = false; if (periodic_subscription < EVENT_RESUBSCRIBE_PERIOD) { if (detect_and_push_periodic_event(device_impl,attr_value,attr,attr_name,except,time_bef_attr) == true) ret.periodic = true; } else attr.ext->event_periodic_client_3 = false; // // For archive event // ret.archive = false; if (archive_subscription < EVENT_RESUBSCRIBE_PERIOD) { if (detect_and_push_archive_event(device_impl,attr_value,attr,attr_name,except,time_bef_attr) == true) ret.archive = true; } else attr.ext->event_archive_client_3 = false; return ret; } //--------------------------------------------------------------------------------------------------------------------- // // method : // EventSupplier::detect_and_push_change_event() // // description : // Method to detect if there it is necessary to push a change event // // argument : // in : // - device_impl : The device // - attr_value : The attribute value // - attr : The attribute object // - attr_name : The attribute name // - except : The exception thrown during the last attribute reading. NULL if no exception // - user_push : Flag set to true if it is a user push // //-------------------------------------------------------------------------------------------------------------------- bool EventSupplier::detect_and_push_change_event(DeviceImpl *device_impl,struct AttributeData &attr_value, Attribute &attr,string &attr_name,DevFailed *except,bool user_push) { string event, domain_name; double delta_change_rel = 0.0; double delta_change_abs = 0.0; bool is_change = false; bool force_change = false; bool quality_change = false; bool ret = false; cout3 << "EventSupplier::detect_and_push_change_event(): called for attribute " << attr_name << endl; Tango::AttrQuality the_quality; if (attr_value.attr_val_4 != NULL) the_quality = attr_value.attr_val_4->quality; else if (attr_value.attr_val_3 != NULL) the_quality = attr_value.attr_val_3->quality; else the_quality = attr_value.attr_val->quality; // // get the mutex to synchronize the sending of events // omni_mutex_lock l(event_mutex); // // if no attribute of this name is registered with change then // insert the current value // if (!attr.ext->prev_change_event.inited) { if (except != NULL) { attr.ext->prev_change_event.err = true; attr.ext->prev_change_event.except = *except; } else { if (attr_value.attr_val_4 != NULL) attr.ext->prev_change_event.value_4 = attr_value.attr_val_4->value; else if (attr_value.attr_val_3 != NULL) attr.ext->prev_change_event.value = attr_value.attr_val_3->value; else attr.ext->prev_change_event.value = attr_value.attr_val->value; attr.ext->prev_change_event.quality = the_quality; attr.ext->prev_change_event.err = false; } attr.ext->prev_change_event.inited = true; if (user_push == true) is_change = true; } else { // // determine delta_change in percent compared with previous event sent // is_change = detect_change(attr,attr_value,false,delta_change_rel,delta_change_abs,except,force_change,device_impl); cout3 << "EventSupplier::detect_and_push_change_event(): rel_change " << delta_change_rel << " abs_change " << delta_change_abs << " is change = " << is_change << endl; } // // check whether the data quality has changed. // Fire event on a quality change. // if ((except == NULL) && (attr.ext->prev_change_event.quality != the_quality )) { is_change = true; quality_change = true; } if (is_change) { vector filterable_names; vector filterable_data; vector filterable_names_lg; vector filterable_data_lg; if (except != NULL) { attr.ext->prev_change_event.err = true; attr.ext->prev_change_event.except = *except; } else { if (attr_value.attr_val_4 != NULL) { attr.ext->prev_change_event.value_4 = attr_value.attr_val_4->value; } else if (attr_value.attr_val_3 != NULL) attr.ext->prev_change_event.value = attr_value.attr_val_3->value; else attr.ext->prev_change_event.value = attr_value.attr_val->value; attr.ext->prev_change_event.quality = the_quality; attr.ext->prev_change_event.err = false; } // // If one of the subscribed client is still using IDL 3, the attribute value has to be sent // using an AttributeValue_3 data type // bool need_free = false; if ((attr.ext->event_change_client_3 == true) && (attr_value.attr_val_3 == NULL)) { AttributeValue_3 *tmp_attr_val_3 = new AttributeValue_3(); attr.AttributeValue_4_2_AttributeValue_3(attr_value.attr_val_4,tmp_attr_val_3); attr_value.attr_val_3 = tmp_attr_val_3; attr_value.attr_val_4 = NULL; need_free = true; } domain_name = device_impl->get_name() + "/" + attr_name; filterable_names.push_back("delta_change_rel"); filterable_data.push_back(delta_change_rel); filterable_names.push_back("delta_change_abs"); filterable_data.push_back(delta_change_abs); filterable_names.push_back("forced_event"); if (force_change == true) filterable_data.push_back((double)1.0); else filterable_data.push_back((double)0.0); filterable_names.push_back("quality"); if (quality_change == true) filterable_data.push_back((double)1.0); else filterable_data.push_back((double)0.0); push_event(device_impl, "change", filterable_names, filterable_data, filterable_names_lg, filterable_data_lg, attr_value, attr_name, except); ret = true; if (need_free == true) { if (attr_value.attr_val_4 != NULL) delete attr_value.attr_val_4; else if (attr_value.attr_val_3 != NULL) delete attr_value.attr_val_3; else delete attr_value.attr_val; } } cout3 << "EventSupplier::detect_and_push_change_event(): leaving for attribute " << attr_name << endl; return ret; } //+---------------------------------------------------------------------------- // // method : EventSupplier::detect_and_push_archive_event() // // description : Method to detect if there it is necessary // to push an archive event // // argument : in : device_impl : The device // attr_value : The attribute value // attr : The attribute object // attr_name : The attribute name // except : The exception thrown during the last // attribute reading. NULL if no exception // //----------------------------------------------------------------------------- bool EventSupplier::detect_and_push_archive_event(DeviceImpl *device_impl,AttributeData &attr_value, Attribute &attr,string &attr_name,DevFailed *except,struct timeval *time_bef_attr, bool user_push) { string event, domain_name; double delta_change_rel = 0.0; double delta_change_abs = 0.0; bool is_change = false; bool force_change = false; bool period_change = false; bool quality_change = false; bool ret = false; cout3 << "EventSupplier::detect_and_push_archive_event(): called for attribute " << attr_name << endl; double now_ms, ms_since_last_periodic; Tango::AttrQuality the_quality; if (attr_value.attr_val_4 != NULL) the_quality = attr_value.attr_val_4->quality; else if (attr_value.attr_val_3 != NULL) the_quality = attr_value.attr_val_3->quality; else the_quality = attr_value.attr_val->quality; struct timeval now; if (time_bef_attr == NULL) { #ifdef _TG_WINDOWS_ struct _timeb now_win; _ftime(&now_win); now.tv_sec = (unsigned long)now_win.time; now.tv_usec = (long)now_win.millitm * 1000; #else gettimeofday(&now,NULL); #endif now.tv_sec = now.tv_sec - DELTA_T; } // // get the mutex to synchronize the sending of events // omni_mutex_lock l(event_mutex); // // Do not get time now. This method is executed after the attribute has been read. // For some device, reading one attribute could be long and even worse could have an // unstable reading time. If we takes time now, it will also be unstable. // Use the time taken in the polling thread before the attribute was read. This one is much // more stable // if (time_bef_attr != NULL) now_ms = (double)time_bef_attr->tv_sec * 1000. + (double)time_bef_attr->tv_usec / 1000.; else now_ms = (double)now.tv_sec * 1000. + (double)now.tv_usec / 1000.; ms_since_last_periodic = now_ms - attr.ext->archive_last_periodic; int arch_period; TangoMonitor &mon1 = device_impl->get_att_conf_monitor(); mon1.get_monitor(); arch_period = attr.ext->archive_period; mon1.rel_monitor(); // // Specify the precision interval for the archive period testing // 2% are used for periods < 5000 ms and // 100ms are used for periods > 5000 ms. // If the attribute archive period is INT_MAX, this means that the user does not want the periodic part of the // archive event // if (arch_period != INT_MAX) { if ( arch_period >= 5000 ) { arch_period = arch_period - DELTA_PERIODIC_LONG; } else { #ifdef _TG_WINDOWS_ double tmp = (double)arch_period * DELTA_PERIODIC; double int_part,eve_round; double frac = modf(tmp,&int_part); if (frac >= 0.5) eve_round = ceil(tmp); else eve_round = floor(tmp); #else double eve_round = round((double)arch_period * DELTA_PERIODIC); #endif arch_period = (int)eve_round; } if ((ms_since_last_periodic > arch_period) && (attr.ext->prev_archive_event.inited == true)) { is_change = true; period_change = true; } } // // if no attribute of this name is registered with change then // insert the current value // if (!attr.ext->prev_archive_event.inited) { if (except != NULL) { attr.ext->prev_archive_event.err = true; attr.ext->prev_archive_event.except = *except; } else { if (attr_value.attr_val_4 != NULL) attr.ext->prev_archive_event.value_4 = attr_value.attr_val_4->value; else if (attr_value.attr_val_3 != NULL) attr.ext->prev_archive_event.value = attr_value.attr_val_3->value; else attr.ext->prev_archive_event.value = attr_value.attr_val->value; attr.ext->prev_archive_event.quality = the_quality; attr.ext->prev_archive_event.err = false; } attr.ext->archive_last_periodic = now_ms; attr.ext->archive_last_event = now_ms; attr.ext->prev_archive_event.inited = true; if (user_push == true) is_change = true; } else { // // determine delta_change in percent compared with previous event sent // if (is_change == false) { is_change = detect_change(attr,attr_value,true,delta_change_rel,delta_change_abs,except,force_change,device_impl); } } // // check whether the data quality has changed. // Fire event on a quality change. // if ( except == NULL && attr.ext->prev_archive_event.quality != the_quality ) { is_change = true; quality_change = true; } if (is_change) { vector filterable_names; vector filterable_data; vector filterable_names_lg; vector filterable_data_lg; domain_name = device_impl->get_name() + "/" + attr_name; if (except != NULL) { attr.ext->prev_archive_event.err = true; attr.ext->prev_archive_event.except = *except; } else { if (attr_value.attr_val_4 != NULL) attr.ext->prev_archive_event.value_4 = attr_value.attr_val_4->value; else if (attr_value.attr_val_3 != NULL) attr.ext->prev_archive_event.value = attr_value.attr_val_3->value; else attr.ext->prev_archive_event.value = attr_value.attr_val->value; attr.ext->prev_archive_event.quality = the_quality; attr.ext->prev_archive_event.err = false; } // // If one of the subscribed client is still using IDL 3, the attribute value has to be sent // using an AttributeValue_3 data type // bool need_free = false; if ((attr.ext->event_archive_client_3 == true) && (attr_value.attr_val_3 == NULL)) { AttributeValue_3 *tmp_attr_val_3 = new AttributeValue_3(); attr.AttributeValue_4_2_AttributeValue_3(attr_value.attr_val_4,tmp_attr_val_3); attr_value.attr_val_3 = tmp_attr_val_3; attr_value.attr_val_4 = NULL; need_free = true; } filterable_names_lg.push_back("counter"); if (period_change == true) { attr.ext->archive_periodic_counter++; attr.ext->archive_last_periodic = now_ms; filterable_data_lg.push_back(attr.ext->archive_periodic_counter); } else { filterable_data_lg.push_back(-1); } filterable_names.push_back("delta_change_rel"); filterable_data.push_back(delta_change_rel); filterable_names.push_back("delta_change_abs"); filterable_data.push_back(delta_change_abs); filterable_names.push_back("forced_event"); if (force_change == true) filterable_data.push_back((double)1.0); else filterable_data.push_back((double)0.0); filterable_names.push_back("quality"); if (quality_change == true) filterable_data.push_back((double)1.0); else filterable_data.push_back((double)0.0); filterable_names.push_back("delta_event"); filterable_data.push_back(now_ms - attr.ext->archive_last_event); attr.ext->archive_last_event = now_ms; push_event(device_impl, "archive", filterable_names, filterable_data, filterable_names_lg, filterable_data_lg, attr_value, attr_name, except); ret = true; if (need_free == true) { if (attr_value.attr_val_4 != NULL) delete attr_value.attr_val_4; else if (attr_value.attr_val_3 != NULL) delete attr_value.attr_val_3; else delete attr_value.attr_val; } } return ret; } //+---------------------------------------------------------------------------- // // method : EventSupplier::detect_and_push_periodic_event() // // description : Method to detect if there it is necessary // to push a periodic event // // argument : in : device_impl : The device // attr_value : The attribute value // attr : The attribute object // attr_name : The attribute name // except : The exception thrown during the last // attribute reading. NULL if no exception // //----------------------------------------------------------------------------- bool EventSupplier::detect_and_push_periodic_event(DeviceImpl *device_impl,struct AttributeData &attr_value, Attribute &attr,string &attr_name,DevFailed *except,struct timeval *time_bef_attr) { string event, domain_name; double now_ms, ms_since_last_periodic; bool ret = false; struct timeval now; if (time_bef_attr == NULL) { #ifdef _TG_WINDOWS_ struct _timeb now_win; _ftime(&now_win); now.tv_sec = (unsigned long)now_win.time; now.tv_usec = (long)now_win.millitm * 1000; #else gettimeofday(&now,NULL); #endif now.tv_sec = now.tv_sec - DELTA_T; } // // Do not get time now. This metthod is executed after the attribute has been read. // For some device, reading one attribute could be long and even worse could have an // unstabe reading time. If we takes time now, it will also be unstable. // Use the time taken inthe polling thread befor the attribute was read. This one is much // more stable // if (time_bef_attr != NULL) now_ms = (double)time_bef_attr->tv_sec * 1000. + (double)time_bef_attr->tv_usec / 1000.; else now_ms = (double)now.tv_sec * 1000. + (double)now.tv_usec / 1000.; // // get the mutex to synchronize the sending of events // omni_mutex_lock l(event_mutex); // // get the event period // int eve_period; TangoMonitor &mon1 = device_impl->get_att_conf_monitor(); mon1.get_monitor(); eve_period = attr.ext->event_period; mon1.rel_monitor(); // // Specify the precision interval for the event period testing // 2% are used for periods < 5000 ms and // 100ms are used for periods > 5000 ms. // if ( eve_period >= 5000 ) { eve_period = eve_period - DELTA_PERIODIC_LONG; } else { #ifdef _TG_WINDOWS_ double tmp = (double)eve_period * DELTA_PERIODIC; double int_part,eve_round; double frac = modf(tmp,&int_part); if (frac >= 0.5) eve_round = ceil(tmp); else eve_round = floor(tmp); #else double eve_round = round((double)eve_period * DELTA_PERIODIC); #endif eve_period = (int)eve_round; } // // calculate the time // ms_since_last_periodic = now_ms - attr.ext->last_periodic; cout3 << "EventSupplier::detect_and_push_is_periodic_event(): delta since last periodic " << ms_since_last_periodic << " event_period " << eve_period << " for " << device_impl->get_name()+"/"+attr_name << endl; if ( ms_since_last_periodic > eve_period ) { bool need_free = false; // // If one of the subscribed client is still using IDL 3, the attribute value has to be sent // using an AttributeValue_3 data type // if ((attr.ext->event_periodic_client_3 == true) && (attr_value.attr_val_3 == NULL)) { AttributeValue_3 *tmp_attr_val_3 = new AttributeValue_3(); attr.AttributeValue_4_2_AttributeValue_3(attr_value.attr_val_4,tmp_attr_val_3); attr_value.attr_val_3 = tmp_attr_val_3; attr_value.attr_val_4 = NULL; need_free = true; } vector filterable_names; vector filterable_data; vector filterable_names_lg; vector filterable_data_lg; attr.ext->periodic_counter++; attr.ext->last_periodic = now_ms; filterable_names_lg.push_back("counter"); filterable_data_lg.push_back(attr.ext->periodic_counter); cout3 << "EventSupplier::detect_and_push_is_periodic_event(): detected periodic event for " << device_impl->get_name()+"/"+attr_name << endl; push_event(device_impl, "periodic", filterable_names, filterable_data, filterable_names_lg, filterable_data_lg, attr_value, attr_name, except); ret = true; if (need_free == true) { if (attr_value.attr_val_4 != NULL) delete attr_value.attr_val_4; else if (attr_value.attr_val_3 != NULL) delete attr_value.attr_val_3; else delete attr_value.attr_val; } } return ret; } //+---------------------------------------------------------------------------- // // method : EventSupplier::detect_change() // // description : Method to detect if there is a change according to the // criterions and return a boolean set to true if a change // is detected // // argument : in : attr : The attribute object // attr_value : The current attribute value // archive : // delta_change_rel : // delta_change_abs : // except : The exception thrown during the last // attribute reading. NULL if no exception // force_change : A flag set to true if the change // is due to a non mathematical reason // ( array size change, from exception to // classic...) // dev : Pointer to the device // //----------------------------------------------------------------------------- bool EventSupplier::detect_change(Attribute &attr,struct AttributeData &attr_value,bool archive, double &delta_change_rel,double &delta_change_abs,DevFailed *except, bool &force_change,DeviceImpl *dev) { bool is_change = false; cout3 << "EventSupplier::detect_change(): called for attribute " << attr.get_name() << endl; Tango::AttrQuality the_new_quality; const CORBA::Any *the_new_any = NULL; if (attr_value.attr_val_4 != NULL) the_new_quality = attr_value.attr_val_4->quality; else if (attr_value.attr_val_3 != NULL) { the_new_quality = attr_value.attr_val_3->quality; the_new_any = &(attr_value.attr_val_3->value); } else { the_new_quality = attr_value.attr_val->quality; the_new_any = &(attr_value.attr_val->value); } // // get the mutex to synchronize the sending of events // omni_mutex_lock l(detect_mutex); // // Send event, if the read_attribute failed or if it is the first time // that the read_attribute succeed after a failure. // Same thing if the attribute quality factor changes to INVALID // if (archive == true) { // // force an event only when the last reading was not returning an exception or // not returning the same exception // if (except != NULL) { if ( attr.ext->prev_archive_event.err == true ) { if ( Except::compare_exception (*except, attr.ext->prev_archive_event.except) == true ) { force_change = false; return false; } } force_change = true; return true; } // // force an archive event when the last reading was still returning an exception // if ((except == NULL) && (attr.ext->prev_archive_event.err == true)) { force_change = true; return true; } // // check wether the quality is invalid // Force an event only if the last reading was valid // if (the_new_quality == Tango::ATTR_INVALID) { if ( attr.ext->prev_archive_event.quality == Tango::ATTR_INVALID ) { force_change = false; return false; } force_change = true; return true; } // // force an archive event when the last reding was still marked as invalid data // if ((the_new_quality != Tango::ATTR_INVALID) && (attr.ext->prev_archive_event.quality == Tango::ATTR_INVALID)) { force_change = true; return true; } } else { // // force an event only when the last reading was not returning an exception or // not returning the same exception // if (except != NULL) { if ( attr.ext->prev_change_event.err == true ) { if ( Except::compare_exception (*except, attr.ext->prev_change_event.except) == true ) { force_change = false; return false; } } force_change = true; return true; } // // force an change event when the last reding was still returning an exception // if ((except == NULL) && (attr.ext->prev_change_event.err == true)) { force_change = true; return true; } // // check wether the quality is invalid // Force an event only if the last reading was valid // if (the_new_quality == Tango::ATTR_INVALID) { if ( attr.ext->prev_change_event.quality == Tango::ATTR_INVALID ) { force_change = false; return false; } force_change = true; return true; } // // force an change event when the last reding was still marked as invalid data // if ((the_new_quality != Tango::ATTR_INVALID) && (attr.ext->prev_change_event.quality == Tango::ATTR_INVALID)) { force_change = true; return true; } } const DevVarLong64Array *curr_seq_64, *prev_seq_64; const DevVarLongArray *curr_seq_lo, *prev_seq_lo; const DevVarShortArray *curr_seq_sh, *prev_seq_sh; const DevVarDoubleArray *curr_seq_db, *prev_seq_db; const DevVarStringArray *curr_seq_str, *prev_seq_str; const DevVarFloatArray *curr_seq_fl, *prev_seq_fl; const DevVarBooleanArray *curr_seq_bo, *prev_seq_bo; const DevVarUShortArray *curr_seq_ush, *prev_seq_ush; const DevVarCharArray *curr_seq_uch, *prev_seq_uch; const DevVarULongArray *curr_seq_ulo, *prev_seq_ulo; const DevVarULong64Array *curr_seq_u64, *prev_seq_u64; const DevVarStateArray *curr_seq_state, *prev_seq_state; double rel_change[2], abs_change[2]; bool inited; CORBA::TypeCode_var ty; delta_change_rel = delta_change_abs = 0; bool enable_check = false; TangoMonitor &mon1 = dev->get_att_conf_monitor(); mon1.get_monitor(); if (!archive) { rel_change[0] = attr.ext->rel_change[0]; rel_change[1] = attr.ext->rel_change[1]; abs_change[0] = attr.ext->abs_change[0]; abs_change[1] = attr.ext->abs_change[1]; inited = attr.ext->prev_change_event.inited; if ((attr.ext->prev_change_event.quality != Tango::ATTR_INVALID) && (the_new_quality != Tango::ATTR_INVALID)) enable_check = true; } else { rel_change[0] = attr.ext->archive_rel_change[0]; rel_change[1] = attr.ext->archive_rel_change[1]; abs_change[0] = attr.ext->archive_abs_change[0]; abs_change[1] = attr.ext->archive_abs_change[1]; inited = attr.ext->prev_archive_event.inited; if ((attr.ext->prev_archive_event.quality != Tango::ATTR_INVALID) && (the_new_quality != Tango::ATTR_INVALID)) enable_check = true; } mon1.rel_monitor(); if (inited) { if (enable_check == true) { unsigned int curr_seq_nb,prev_seq_nb; unsigned int i; if (the_new_any != NULL) ty = the_new_any->type(); // // First, analyse the DevEncoded data type // if ((attr_value.attr_val_4 != NULL) && (attr_value.attr_val_4->value._d() == ATT_ENCODED)) { unsigned int curr_seq_str_nb,prev_seq_str_nb; const char *curr_encoded_format,*prev_encoded_format; const Tango::DevVarUCharArray *curr_data_ptr,*prev_data_ptr; const Tango::DevVarEncodedArray &un_seq = attr_value.attr_val_4->value.encoded_att_value(); curr_seq_str_nb = strlen(un_seq[0].encoded_format.in()); curr_seq_nb = un_seq[0].encoded_data.length(); curr_encoded_format = un_seq[0].encoded_format.in(); curr_data_ptr = &un_seq[0].encoded_data; if (archive == true) { DevVarEncodedArray &union_seq = attr.ext->prev_archive_event.value_4.encoded_att_value(); prev_seq_nb = union_seq[0].encoded_data.length(); prev_seq_str_nb = strlen(union_seq[0].encoded_format.in()); prev_encoded_format = union_seq[0].encoded_format.in(); prev_data_ptr = &union_seq[0].encoded_data; } else { DevVarEncodedArray &union_seq = attr.ext->prev_change_event.value_4.encoded_att_value(); prev_seq_nb = union_seq[0].encoded_data.length(); prev_seq_str_nb = strlen(union_seq[0].encoded_format.in()); prev_encoded_format = union_seq[0].encoded_format.in(); prev_data_ptr = &union_seq[0].encoded_data; } if ((curr_seq_nb != prev_seq_nb) || (curr_seq_str_nb != prev_seq_str_nb)) { force_change = true; return true; } if (strcmp(curr_encoded_format,prev_encoded_format) != 0) { delta_change_rel = delta_change_abs = 100.; is_change = true; return(is_change); } if ((rel_change[0] != INT_MAX) || (rel_change[1] != INT_MAX) || (abs_change[0] != INT_MAX) || (abs_change[1] != INT_MAX)) { for (i=0; i< curr_seq_nb; i++) { if (rel_change[0] != INT_MAX) { if ((*prev_data_ptr)[i] != 0) { delta_change_rel = ((*curr_data_ptr)[i] - (*prev_data_ptr)[i])*100/(*prev_data_ptr)[i]; } else { delta_change_rel = 100; if ((*curr_data_ptr)[i] == (*prev_data_ptr)[i]) delta_change_rel = 0; } if (delta_change_rel <= rel_change[0] || delta_change_rel >= rel_change[1]) { is_change = true; return(is_change); } } if (abs_change[0] != INT_MAX) { delta_change_abs = (*curr_data_ptr)[i] - (*prev_data_ptr)[i]; if (delta_change_abs <= abs_change[0] || delta_change_abs >= abs_change[1]) { is_change = true; return(is_change); } } } } } // // Now, the DevState data type // else { DevState curr_sta, prev_sta; bool dev_state_type = false; if ((attr_value.attr_val_4 != NULL) && (attr_value.attr_val_4->value._d() == DEVICE_STATE)) { dev_state_type = true; curr_sta = attr_value.attr_val_4->value.dev_state_att(); if (archive == true) prev_sta = attr.ext->prev_archive_event.value_4.dev_state_att(); else prev_sta = attr.ext->prev_change_event.value_4.dev_state_att(); } else if ((the_new_any != NULL) && (ty->kind() == CORBA::tk_enum)) { dev_state_type = true; *the_new_any >>= curr_sta; if (archive == true) attr.ext->prev_archive_event.value >>= prev_sta; else attr.ext->prev_change_event.value >>= prev_sta; } if (dev_state_type == true) { if (curr_sta != prev_sta) { delta_change_rel = delta_change_abs = 100.; is_change = true; } return is_change; } CORBA::TypeCode_var ty_alias; CORBA::TypeCode_var ty_seq; if (the_new_any != NULL) { ty_alias = ty->content_type(); ty_seq = ty_alias->content_type(); } // // Now, the long data type // bool long_type = false; if ((attr_value.attr_val_4 != NULL) && (attr_value.attr_val_4->value._d() == ATT_LONG)) { long_type = true; curr_seq_lo = &attr_value.attr_val_4->value.long_att_value(); if (archive == true) prev_seq_lo = &(attr.ext->prev_archive_event.value_4.long_att_value()); else prev_seq_lo = &(attr.ext->prev_change_event.value_4.long_att_value()); } else if ((the_new_any != NULL) && (ty_seq->kind() == CORBA::tk_long)) { long_type = true; *the_new_any >>= curr_seq_lo; if (archive == true) attr.ext->prev_archive_event.value >>= prev_seq_lo; else attr.ext->prev_change_event.value >>= prev_seq_lo; } if (long_type == true) { curr_seq_nb = curr_seq_lo->length(); prev_seq_nb = prev_seq_lo->length(); if (curr_seq_nb != prev_seq_nb) { force_change = true; return true; } for (i=0; ilength(); i++) { if (rel_change[0] != INT_MAX) { if ((*prev_seq_lo)[i] != 0) { delta_change_rel = ((*curr_seq_lo)[i] - (*prev_seq_lo)[i])*100/(*prev_seq_lo)[i]; } else { delta_change_rel = 100; if ((*curr_seq_lo)[i] == (*prev_seq_lo)[i]) delta_change_rel = 0; } if (delta_change_rel <= rel_change[0] || delta_change_rel >= rel_change[1]) { is_change = true; return(is_change); } } if (abs_change[0] != INT_MAX) { delta_change_abs = (*curr_seq_lo)[i] - (*prev_seq_lo)[i]; if (delta_change_abs <= abs_change[0] || delta_change_abs >= abs_change[1]) { is_change = true; return(is_change); } } } return false; } // // Now, the long 64 bits data type // bool long_long_type = false; if ((attr_value.attr_val_4 != NULL) && (attr_value.attr_val_4->value._d() == ATT_LONG64)) { long_long_type = true; curr_seq_64 = &attr_value.attr_val_4->value.long64_att_value(); if (archive == true) prev_seq_64 = &attr.ext->prev_archive_event.value_4.long64_att_value(); else prev_seq_64 = &attr.ext->prev_change_event.value_4.long64_att_value(); } else if ((the_new_any != NULL) && (ty_seq->kind() == CORBA::tk_longlong)) { long_long_type = true; *the_new_any >>= curr_seq_64; if (archive == true) attr.ext->prev_archive_event.value >>= prev_seq_64; else attr.ext->prev_change_event.value >>= prev_seq_64; } if (long_long_type == true) { curr_seq_nb = curr_seq_64->length(); prev_seq_nb = prev_seq_64->length(); if (curr_seq_nb != prev_seq_nb) { force_change = true; return true; } for (i=0; ilength(); i++) { if (rel_change[0] != INT_MAX) { if ((*prev_seq_64)[i] != 0) { delta_change_rel = (double)(((*curr_seq_64)[i] - (*prev_seq_64)[i])*100/(*prev_seq_64)[i]); } else { delta_change_rel = 100; if ((*curr_seq_64)[i] == (*prev_seq_64)[i]) delta_change_rel = 0; } if (delta_change_rel <= rel_change[0] || delta_change_rel >= rel_change[1]) { is_change = true; return(is_change); } } if (abs_change[0] != INT_MAX) { delta_change_abs = (double)((*curr_seq_64)[i] - (*prev_seq_64)[i]); if (delta_change_abs <= abs_change[0] || delta_change_abs >= abs_change[1]) { is_change = true; return(is_change); } } } return false; } // // Now, the short data type // bool short_type = false; if ((attr_value.attr_val_4 != NULL) && (attr_value.attr_val_4->value._d() == ATT_SHORT)) { short_type = true; curr_seq_sh = &attr_value.attr_val_4->value.short_att_value(); if (archive == true) prev_seq_sh = &attr.ext->prev_archive_event.value_4.short_att_value(); else prev_seq_sh = &attr.ext->prev_change_event.value_4.short_att_value(); } else if ((the_new_any != NULL) && (ty_seq->kind() == CORBA::tk_short)) { short_type = true; *the_new_any >>= curr_seq_sh; if (archive == true) attr.ext->prev_archive_event.value >>= prev_seq_sh; else attr.ext->prev_change_event.value >>= prev_seq_sh; } if (short_type == true) { curr_seq_nb = curr_seq_sh->length(); prev_seq_nb = prev_seq_sh->length(); if (curr_seq_nb != prev_seq_nb) { force_change = true; return true; } for (i=0; ilength(); i++) { if (rel_change[0] != INT_MAX) { if ((*prev_seq_sh)[i] != 0) { delta_change_rel = ((*curr_seq_sh)[i] - (*prev_seq_sh)[i])*100/(*prev_seq_sh)[i]; } else { delta_change_rel = 100; if ((*curr_seq_sh)[i] == (*prev_seq_sh)[i]) delta_change_rel = 0; } if (delta_change_rel <= rel_change[0] || delta_change_rel >= rel_change[1]) { is_change = true; return(is_change); } } if (abs_change[0] != INT_MAX) { delta_change_abs = (*curr_seq_sh)[i] - (*prev_seq_sh)[i]; if (delta_change_abs <= abs_change[0] || delta_change_abs >= abs_change[1]) { is_change = true; return(is_change); } } } return false; } // // Now, the double data type // bool double_type = false; if ((attr_value.attr_val_4 != NULL) && (attr_value.attr_val_4->value._d() == ATT_DOUBLE)) { double_type = true; curr_seq_db = &attr_value.attr_val_4->value.double_att_value(); if (archive == true) prev_seq_db = &attr.ext->prev_archive_event.value_4.double_att_value(); else prev_seq_db = &attr.ext->prev_change_event.value_4.double_att_value(); } else if ((the_new_any != NULL) && (ty_seq->kind() == CORBA::tk_double)) { double_type = true; *the_new_any >>= curr_seq_db; if (archive == true) attr.ext->prev_archive_event.value >>= prev_seq_db; else attr.ext->prev_change_event.value >>= prev_seq_db; } if (double_type == true) { curr_seq_nb = curr_seq_db->length(); prev_seq_nb = prev_seq_db->length(); if (curr_seq_nb != prev_seq_nb) { force_change = true; return true; } for (i=0; ilength(); i++) { if (rel_change[0] != INT_MAX) { if ((*prev_seq_db)[i] != 0) { delta_change_rel = ((*curr_seq_db)[i] - (*prev_seq_db)[i])*100/(*prev_seq_db)[i]; } else { delta_change_rel = 100; if ((*curr_seq_db)[i] == (*prev_seq_db)[i]) delta_change_rel = 0; } if (delta_change_rel <= rel_change[0] || delta_change_rel >= rel_change[1]) { is_change = true; return(is_change); } } if (abs_change[0] != INT_MAX) { delta_change_abs = (*curr_seq_db)[i] - (*prev_seq_db)[i]; // Correct for rounding errors ! double max_change = delta_change_abs + (abs_change[1] * 1e-10); double min_change = delta_change_abs + (abs_change[0] * 1e-10); //if (delta_change_abs <= abs_change[0] || delta_change_abs >= abs_change[1]) if (min_change <= abs_change[0] || max_change >= abs_change[1]) { is_change = true; return(is_change); } } } return false; } // // Now, the string data type // bool string_type = false; if ((attr_value.attr_val_4 != NULL) && (attr_value.attr_val_4->value._d() == ATT_STRING)) { string_type = true; curr_seq_str = &attr_value.attr_val_4->value.string_att_value(); if (archive == true) prev_seq_str = &attr.ext->prev_archive_event.value_4.string_att_value(); else prev_seq_str = &attr.ext->prev_change_event.value_4.string_att_value(); } else if ((the_new_any != NULL) && (ty_seq->kind() == CORBA::tk_string)) { string_type = true; *the_new_any >>= curr_seq_str; if (archive == true) attr.ext->prev_archive_event.value >>= prev_seq_str; else attr.ext->prev_change_event.value >>= prev_seq_str; } if (string_type == true) { curr_seq_nb = curr_seq_str->length(); prev_seq_nb = prev_seq_str->length(); if (curr_seq_nb != prev_seq_nb) { force_change = true; return true; } for (i=0; ilength(); i++) { if (strcmp((*curr_seq_str)[i],(*prev_seq_str)[i]) != 0) { delta_change_rel = delta_change_abs = 100.; is_change = true; return(is_change); } } return false; } // // Now, the float data type // bool float_type = false; if ((attr_value.attr_val_4 != NULL) && (attr_value.attr_val_4->value._d() == ATT_FLOAT)) { float_type = true; curr_seq_fl = &attr_value.attr_val_4->value.float_att_value(); if (archive == true) prev_seq_fl = &attr.ext->prev_archive_event.value_4.float_att_value(); else prev_seq_fl = &attr.ext->prev_change_event.value_4.float_att_value(); } else if ((the_new_any != NULL) && (ty_seq->kind() == CORBA::tk_float)) { float_type = true; *the_new_any >>= curr_seq_fl; if (archive == true) attr.ext->prev_archive_event.value >>= prev_seq_fl; else attr.ext->prev_change_event.value >>= prev_seq_fl; } if (float_type == true) { curr_seq_nb = curr_seq_fl->length(); prev_seq_nb = prev_seq_fl->length(); if (curr_seq_nb != prev_seq_nb) { force_change = true; return true; } for (i=0; ilength(); i++) { if (rel_change[0] != INT_MAX) { if ((*prev_seq_fl)[i] != 0) { delta_change_rel = ((*curr_seq_fl)[i] - (*prev_seq_fl)[i])*100/(*prev_seq_fl)[i]; } else { delta_change_rel = 100; if ((*curr_seq_fl)[i] == (*prev_seq_fl)[i]) delta_change_rel = 0; } if (delta_change_rel <= rel_change[0] || delta_change_rel >= rel_change[1]) { is_change = true; return(is_change); } } if (abs_change[0] != INT_MAX) { delta_change_abs = (*curr_seq_fl)[i] - (*prev_seq_fl)[i]; // Correct for rounding errors ! double max_change = delta_change_abs + (abs_change[1] * 1e-10); double min_change = delta_change_abs + (abs_change[0] * 1e-10); //if (delta_change_abs <= abs_change[0] || delta_change_abs >= abs_change[1]) if (min_change <= abs_change[0] || max_change >= abs_change[1]) { is_change = true; return(is_change); } } } return false; } // // Now, the unsigned short data type // bool unsigned_short_type = false; if ((attr_value.attr_val_4 != NULL) && (attr_value.attr_val_4->value._d() == ATT_USHORT)) { unsigned_short_type = true; curr_seq_ush = &attr_value.attr_val_4->value.ushort_att_value(); if (archive == true) prev_seq_ush = &attr.ext->prev_archive_event.value_4.ushort_att_value(); else prev_seq_ush = &attr.ext->prev_change_event.value_4.ushort_att_value(); } else if ((the_new_any != NULL) && (ty_seq->kind() == CORBA::tk_ushort)) { unsigned_short_type = true; *the_new_any >>= curr_seq_ush; if (archive == true) attr.ext->prev_archive_event.value >>= prev_seq_ush; else attr.ext->prev_change_event.value >>= prev_seq_ush; } if (unsigned_short_type == true) { curr_seq_nb = curr_seq_ush->length(); prev_seq_nb = prev_seq_ush->length(); if (curr_seq_nb != prev_seq_nb) { force_change = true; return true; } for (i=0; ilength(); i++) { if (rel_change[0] != INT_MAX) { if ((*prev_seq_ush)[i] != 0) { delta_change_rel = ((*curr_seq_ush)[i] - (*prev_seq_ush)[i])*100/(*prev_seq_ush)[i]; } else { delta_change_rel = 100; if ((*curr_seq_ush)[i] == (*prev_seq_ush)[i]) delta_change_rel = 0; } if (delta_change_rel <= rel_change[0] || delta_change_rel >= rel_change[1]) { is_change = true; return(is_change); } } if (abs_change[0] != INT_MAX) { delta_change_abs = (*curr_seq_ush)[i] - (*prev_seq_ush)[i]; if (delta_change_abs <= abs_change[0] || delta_change_abs >= abs_change[1]) { is_change = true; return(is_change); } } } return false; } // // Now, the boolean data type // bool boolean_type = false; if ((attr_value.attr_val_4 != NULL) && (attr_value.attr_val_4->value._d() == ATT_BOOL)) { boolean_type = true; curr_seq_bo = &attr_value.attr_val_4->value.bool_att_value(); if (archive == true) prev_seq_bo = &attr.ext->prev_archive_event.value_4.bool_att_value(); else prev_seq_bo = &attr.ext->prev_change_event.value_4.bool_att_value(); } else if ((the_new_any != NULL) && (ty_seq->kind() == CORBA::tk_boolean)) { boolean_type = true; *the_new_any >>= curr_seq_bo; if (archive == true) attr.ext->prev_archive_event.value >>= prev_seq_bo; else attr.ext->prev_change_event.value >>= prev_seq_bo; } if (boolean_type == true) { curr_seq_nb = curr_seq_bo->length(); prev_seq_nb = prev_seq_bo->length(); if (curr_seq_nb != prev_seq_nb) { force_change = true; return true; } for (i=0; ilength(); i++) { if ((*curr_seq_bo)[i] != (*prev_seq_bo)[i]) { delta_change_rel = delta_change_abs = 100.; is_change = true; return(is_change); } } return false; } // // Now, the char data type // bool char_type = false; if ((attr_value.attr_val_4 != NULL) && (attr_value.attr_val_4->value._d() == ATT_UCHAR)) { char_type = true; curr_seq_uch = &attr_value.attr_val_4->value.uchar_att_value(); if (archive == true) prev_seq_uch = &attr.ext->prev_archive_event.value_4.uchar_att_value(); else prev_seq_uch = &attr.ext->prev_change_event.value_4.uchar_att_value(); } else if ((the_new_any != NULL) && (ty_seq->kind() == CORBA::tk_octet)) { char_type = true; *the_new_any >>= curr_seq_uch; if (archive == true) attr.ext->prev_archive_event.value >>= prev_seq_uch; else attr.ext->prev_change_event.value >>= prev_seq_uch; } if (char_type == true) { curr_seq_nb = curr_seq_uch->length(); prev_seq_nb = prev_seq_uch->length(); if (curr_seq_nb != prev_seq_nb) { force_change = true; return true; } for (i=0; ilength(); i++) { if (rel_change[0] != INT_MAX) { if ((*prev_seq_uch)[i] != 0) { delta_change_rel = ((*curr_seq_uch)[i] - (*prev_seq_uch)[i])*100/(*prev_seq_uch)[i]; } else { delta_change_rel = 100; if ((*curr_seq_uch)[i] == (*prev_seq_uch)[i]) delta_change_rel = 0; } if (delta_change_rel <= rel_change[0] || delta_change_rel >= rel_change[1]) { is_change = true; return(is_change); } } if (abs_change[0] != INT_MAX) { delta_change_abs = (*curr_seq_uch)[i] - (*prev_seq_uch)[i]; if (delta_change_abs <= abs_change[0] || delta_change_abs >= abs_change[1]) { is_change = true; return(is_change); } } } return false; } // // Now, the unsigned long data type // bool unsigned_long_type = false; if ((attr_value.attr_val_4 != NULL) && (attr_value.attr_val_4->value._d() == ATT_ULONG)) { unsigned_long_type = true; curr_seq_ulo = &attr_value.attr_val_4->value.ulong_att_value(); if (archive == true) prev_seq_ulo = &attr.ext->prev_archive_event.value_4.ulong_att_value(); else prev_seq_ulo = &attr.ext->prev_change_event.value_4.ulong_att_value(); } else if ((the_new_any != NULL) && (ty_seq->kind() == CORBA::tk_ulong)) { unsigned_long_type = true; *the_new_any >>= curr_seq_ulo; if (archive == true) attr.ext->prev_archive_event.value >>= prev_seq_ulo; else attr.ext->prev_change_event.value >>= prev_seq_ulo; } if (unsigned_long_type == true) { curr_seq_nb = curr_seq_ulo->length(); prev_seq_nb = prev_seq_ulo->length(); if (curr_seq_nb != prev_seq_nb) { force_change = true; return true; } for (i=0; ilength(); i++) { if (rel_change[0] != INT_MAX) { if ((*prev_seq_ulo)[i] != 0) { delta_change_rel = ((*curr_seq_ulo)[i] - (*prev_seq_ulo)[i])*100/(*prev_seq_ulo)[i]; } else { delta_change_rel = 100; if ((*curr_seq_ulo)[i] == (*prev_seq_ulo)[i]) delta_change_rel = 0; } if (delta_change_rel <= rel_change[0] || delta_change_rel >= rel_change[1]) { is_change = true; return(is_change); } } if (abs_change[0] != INT_MAX) { delta_change_abs = (*curr_seq_ulo)[i] - (*prev_seq_ulo)[i]; if (delta_change_abs <= abs_change[0] || delta_change_abs >= abs_change[1]) { is_change = true; return(is_change); } } } return false; } // // Now, the unsigned 64 bits data type // bool unsigned_64_type = false; if ((attr_value.attr_val_4 != NULL) && (attr_value.attr_val_4->value._d() == ATT_ULONG64)) { unsigned_64_type = true; curr_seq_u64 = &attr_value.attr_val_4->value.ulong64_att_value(); if (archive == true) prev_seq_u64 = &attr.ext->prev_archive_event.value_4.ulong64_att_value(); else prev_seq_u64 = &attr.ext->prev_change_event.value_4.ulong64_att_value(); } else if ((the_new_any != NULL) && (ty_seq->kind() == CORBA::tk_ulonglong)) { unsigned_64_type = true; *the_new_any >>= curr_seq_u64; if (archive == true) attr.ext->prev_archive_event.value >>= prev_seq_u64; else attr.ext->prev_change_event.value >>= prev_seq_u64; } if (unsigned_64_type == true) { curr_seq_nb = curr_seq_u64->length(); prev_seq_nb = prev_seq_u64->length(); if (curr_seq_nb != prev_seq_nb) { force_change = true; return true; } for (i=0; ilength(); i++) { if (rel_change[0] != INT_MAX) { if ((*prev_seq_u64)[i] != 0) { delta_change_rel = (double)(((*curr_seq_u64)[i] - (*prev_seq_u64)[i])*100/(*prev_seq_u64)[i]); } else { delta_change_rel = 100; if ((*curr_seq_u64)[i] == (*prev_seq_u64)[i]) delta_change_rel = 0; } if (delta_change_rel <= rel_change[0] || delta_change_rel >= rel_change[1]) { is_change = true; return(is_change); } } if (abs_change[0] != INT_MAX) { delta_change_abs = (double)((*curr_seq_u64)[i] - (*prev_seq_u64)[i]); if (delta_change_abs <= abs_change[0] || delta_change_abs >= abs_change[1]) { is_change = true; return(is_change); } } } return false; } // // Now, the state data type // bool state_type = false; if ((attr_value.attr_val_4 != NULL) && (attr_value.attr_val_4->value._d() == ATT_STATE)) { state_type = true; curr_seq_state = &attr_value.attr_val_4->value.state_att_value(); if (archive == true) prev_seq_state = &attr.ext->prev_archive_event.value_4.state_att_value(); else prev_seq_state = &attr.ext->prev_change_event.value_4.state_att_value(); } else if ((the_new_any != NULL) && (ty_seq->kind() == CORBA::tk_enum)) { state_type = true; *the_new_any >>= curr_seq_state; if (archive == true) attr.ext->prev_archive_event.value >>= prev_seq_state; else attr.ext->prev_change_event.value >>= prev_seq_state; } if (state_type == true) { curr_seq_nb = curr_seq_state->length(); prev_seq_nb = prev_seq_state->length(); if (curr_seq_nb != prev_seq_nb) { force_change = true; return true; } for (i=0; ilength(); i++) { if ((*curr_seq_state)[i] != (*prev_seq_state)[i]) { delta_change_rel = delta_change_abs = 100.; is_change = true; return(is_change); } } } } } } cout3 << "EventSupplier::detect_change(): leaving for attribute " << attr.get_name() << endl; return(is_change); } //+---------------------------------------------------------------------------- // // method : EventSupplier::push_att_data_ready_event() // // description : Push a data ready event // //----------------------------------------------------------------------------- void EventSupplier::push_att_data_ready_event(DeviceImpl *device_impl,const string &attr_name,long data_type,DevLong ctr) { cout3 << "EventSupplier::push_att_data_ready_event(): called for attribute " << attr_name << endl; vector filterable_names; vector filterable_data; vector filterable_names_lg; vector filterable_data_lg; string ev_type(DATA_READY_TYPE_EVENT); AttDataReady dat_ready; dat_ready.name = attr_name.c_str(); dat_ready.data_type = (int)data_type; dat_ready.ctr = ctr; AttributeData ad; ::memset(&ad,0,sizeof(ad)); ad.attr_dat_ready = &dat_ready; push_event(device_impl, ev_type, filterable_names, filterable_data, filterable_names_lg, filterable_data_lg, ad, const_cast(attr_name), NULL); } //+---------------------------------------------------------------------------- // // method : EventSupplier::push_att_conf_event() // // description : Method to push attribute configration event // // argument : in : device_impl : The device // attr_conf : The attribute configuration // except : The exception thrown during the last // attribute reading. NULL if no exception // attr_name : The attribute name // //----------------------------------------------------------------------------- void EventSupplier::push_att_conf_events(DeviceImpl *device_impl,AttributeData &attr_conf,DevFailed *except,string &attr_name) { string event, domain_name; time_t now, att_conf_subscription; cout3 << "EventSupplier::push_att_conf_events(): called for attribute " << attr_name << endl; Attribute &attr = device_impl->dev_attr->get_attr_by_name(attr_name.c_str()); // // Return if there is no client // if (attr.ext->event_attr_conf_subscription == 0) return; now = time(NULL); att_conf_subscription = now - attr.ext->event_attr_conf_subscription; cout3 << "EventSupplier::push_att_conf_events(): last subscription " << att_conf_subscription << endl; vector filterable_names; vector filterable_data; vector filterable_names_lg; vector filterable_data_lg; string ev_type(CONF_TYPE_EVENT); push_event(device_impl, ev_type, filterable_names, filterable_data, filterable_names_lg, filterable_data_lg, attr_conf, attr_name, except); } } /* End of Tango namespace */ tango-8.1.2c+dfsg.orig/lib/cpp/server/tango.h0000644000175000017500000000577512205375142017731 0ustar piccapicca//============================================================================= // // file : Tango.h // // description : Main include for Tango device server // // project : TANGO // // author(s) : A.Gotz + E.Taurel // // Copyright (C) : 2004,2005,2006,2007,2008,2009,2010,2011,2012,2013 // European Synchrotron Radiation Facility // BP 220, Grenoble 38043 // FRANCE // // This file is part of Tango. // // Tango 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. // // Tango 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 Tango. If not, see . // // $Revision: 22213 $ // //============================================================================= #ifndef _TANGO_H #define _TANGO_H // // Insert typeinfo file as the first include file // #ifndef TANGO_CLIENT // #include #endif // // Include the Tango config file // #include // // Include IDL generated files which includes CORBA include files // #include // // Some Windows specific include (necessary when used with MFC) // #ifdef _TG_WINDOWS_ #if (_WIN32_WINNT >= 0x0400) #include #include #else #include #endif #endif // // Include stream header files // #include #include #include #include // // Include some stdc++ library headers // #include #include // // Include API files (device and database) // #include #include #include #include #include #include // // Include Tango utility files // #include #include #include #include #if !defined(TANGO_CLIENT) && defined TANGO_HAS_LOG4TANGO #include #endif // // Include Tango files in order to simplfy device server developer include // file list // #ifndef TANGO_CLIENT #include #include #include #include #include #include #include #include #include #include #include #include #include #endif #include // // minor is also defined (Linux) in sysmacros.h. We want the compiler to // use the SystemException::minor() method !! // #ifdef minor # undef minor #endif // // Default std namespace // using namespace std; #endif /* TANGO_H */ tango-8.1.2c+dfsg.orig/lib/cpp/server/seqvec.cpp0000644000175000017500000001222712205375142020430 0ustar piccapicca//============================================================================= // // file : SeqVec.cpp // // description : Dource file for CORBA sequence printing functions. // // project : TANGO // // author(s) : E.Taurel // // Copyright (C) : 2004,2005,2006,2007,2008,2009,2010,2011,2012,2013 // European Synchrotron Radiation Facility // BP 220, Grenoble 38043 // FRANCE // // This file is part of Tango. // // Tango 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. // // Tango 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 Tango. If not, see . // // $Revision: 22213 $ // //============================================================================= #if HAVE_CONFIG_H #include #endif #include namespace Tango { // // These functions are not defined within the tango namespace because the VC++ // is not able to understand that the operator overloading functions is defined // within a namespace x from th eoerand namespace (c++ or aCC is able to // do it) // //============================================================================= // // The sequence print facilities functions // // description : These methods allow an easy way to print all sequence // element using the following syntax // cout << seq << endl; // //============================================================================= ostream &operator<<(ostream &o,const DevVarCharArray &v) { long nb_elt = v.length(); for (long i = 0;i < nb_elt;i++) { o << "Element number [" << i << "] = " << (short)v[i] << dec; if (i < (nb_elt - 1)) o << '\n'; } return o; } ostream &operator<<(ostream &o,const DevVarShortArray &v) { long nb_elt = v.length(); for (long i = 0;i < nb_elt;i++) { o << "Element number [" << i << "] = " << v[i]; if (i < (nb_elt - 1)) o << '\n'; } return o; } ostream &operator<<(ostream &o,const DevVarLongArray &v) { long nb_elt = v.length(); for (long i = 0;i < nb_elt;i++) { o << "Element number [" << i << "] = " << v[i]; if (i < (nb_elt - 1)) o << '\n'; } return o; } ostream &operator<<(ostream &o,const DevVarLong64Array &v) { long nb_elt = v.length(); for (long i = 0;i < nb_elt;i++) { o << "Element number [" << i << "] = " << v[i]; if (i < (nb_elt - 1)) o << '\n'; } return o; } ostream &operator<<(ostream &o,const DevVarFloatArray &v) { long nb_elt = v.length(); for (long i = 0;i < nb_elt;i++) { o << "Element number [" << i << "] = " << v[i]; if (i < (nb_elt - 1)) o << '\n'; } return o; } ostream &operator<<(ostream &o,const DevVarDoubleArray &v) { long nb_elt = v.length(); for (long i = 0;i < nb_elt;i++) { o << "Element number [" << i << "] = " << v[i]; if (i < (nb_elt - 1)) o << '\n'; } return o; } ostream &operator<<(ostream &o,const DevVarBooleanArray &v) { long nb_elt = v.length(); for (long i = 0;i < nb_elt;i++) { o << "Element number [" << i << "] = "; if (v[i] == true) o << "true"; else o << "false"; if (i < (nb_elt - 1)) o << '\n'; } return o; } ostream &operator<<(ostream &o,const DevVarUShortArray &v) { long nb_elt = v.length(); for (long i = 0;i < nb_elt;i++) { o << "Element number [" << i << "] = " << v[i]; if (i < (nb_elt - 1)) o << '\n'; } return o; } ostream &operator<<(ostream &o,const DevVarULongArray &v) { long nb_elt = v.length(); for (long i = 0;i < nb_elt;i++) { o << "Element number [" << i << "] = " << v[i]; if (i < (nb_elt - 1)) o << '\n'; } return o; } ostream &operator<<(ostream &o,const DevVarULong64Array &v) { long nb_elt = v.length(); for (long i = 0;i < nb_elt;i++) { o << "Element number [" << i << "] = " << v[i]; if (i < (nb_elt - 1)) o << '\n'; } return o; } ostream &operator<<(ostream &o,const DevVarStringArray &v) { long nb_elt = v.length(); for (long i = 0;i < nb_elt;i++) { o << "Element number [" << i << "] = " << v[i].in(); if (i < (nb_elt - 1)) o << '\n'; } return o; } ostream &operator<<(ostream &o,const DevVarStateArray &v) { long nb_elt = v.length(); for (long i = 0;i < nb_elt;i++) { o << "Element number [" << i << "] = " << v[i]; if (i < (nb_elt - 1)) o << '\n'; } return o; } ostream &operator<<(ostream &o,const DevVarEncodedArray &v) { long nb_elt = v.length(); for (long loop = 0;loop < nb_elt;loop++) { o << "Encoding string: " << v[loop].encoded_format << endl; long nb_data_elt = v[loop].encoded_data.length(); for (long i = 0;i < nb_data_elt;i++) { o << "Data element number [" << i << "] = " << (int)v[loop].encoded_data[i]; if (i < (nb_data_elt - 1)) o << '\n'; } if (loop < (nb_elt - 1)) o << '\n'; } return o; } } // End of Tango namespace tango-8.1.2c+dfsg.orig/lib/cpp/server/dserver.cpp0000644000175000017500000012731312205375142020617 0ustar piccapiccastatic const char *RcsId = "$Id: dserver.cpp 22732 2013-05-29 14:31:35Z taurel $\n$Name$"; //+============================================================================= // // file : DServer.cpp // // description : C++ source for the DServer class and its commands. // The class is derived from Device. It represents the // CORBA servant object which will be accessed from the // network. All commands which can be executed on a // DServer object are implemented in this file. // // project : TANGO // // author(s) : A.Gotz + E.Taurel // // Copyright (C) : 2004,2005,2006,2007,2008,2009,2010,2011,2012,2013 // European Synchrotron Radiation Facility // BP 220, Grenoble 38043 // FRANCE // // This file is part of Tango. // // Tango 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. // // Tango 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 Tango. If not, see . // // $Revision: 22732 $ // //-============================================================================= #if HAVE_CONFIG_H #include #endif #include #include #include #include #include #include #include #ifndef _TG_WINDOWS_ #include #include #include #endif /* _TG_WINDOWS_ */ #include extern omni_thread::key_t key_py_data; namespace Tango { ClassFactoryFuncPtr DServer::class_factory_func_ptr = NULL; //+---------------------------------------------------------------------------- // // method : DServer::DServer(string &s) // // description : constructor for DServer object // // in : - cp_ptr : The class object pointer // - n : The device name // - d : The device description (default to "not initialised") // - s : The device state (default to UNKNOWN) // - st : The device status (default to "Not initialised") // //----------------------------------------------------------------------------- DServer::DServer(DeviceClass *cl_ptr,const char *n,const char *d,Tango::DevState s,const char *st) :TANGO_BASE_CLASS(cl_ptr,n,d,s,st) { process_name = Tango::Util::instance()->get_ds_exec_name(); instance_name = Tango::Util::instance()->get_ds_inst_name(); full_name = process_name; full_name.append(1,'/'); full_name.append(instance_name); fqdn = "tango://"; Tango::Util *tg = Tango::Util::instance(); Database *db = tg->get_database(); if (db != NULL) fqdn = fqdn + db->get_db_host() + ':' + db->get_db_port() + "/dserver/" + full_name; else fqdn = "dserver/" + full_name; last_heartbeat = time(NULL); last_heartbeat_zmq = last_heartbeat; heartbeat_started = false; polling_th_pool_size = DEFAULT_POLLING_THREADS_POOL_SIZE; optimize_pool_usage = true; from_constructor = true; init_device(); from_constructor = false; } bool less_than (Command *a,Command *b) { if (a->get_name() < b->get_name()) return true; else return false; } void DServer::init_device() { // // In case of database in file // Tango::Util *tg = Tango::Util::instance(); if (tg->_FileDb) { tg->reset_filedatabase(); db_dev->set_dbase(tg->get_database()); } // // Get device properties // get_dev_prop(tg); // // Destroy already registered classes // if (class_list.empty() == false) { delete_devices(); } cout3 << "DServer::DSserver() create dserver " << device_name << endl; bool class_factory_done = false; unsigned long i = 0; try { // // Activate the POA manager // PortableServer::POA_var poa = Util::instance()->get_poa(); PortableServer::POAManager_var manager = poa->the_POAManager(); PortableServer::POAManager::State man_state = manager->get_state(); if ((man_state == PortableServer::POAManager::HOLDING) || (man_state == PortableServer::POAManager::DISCARDING)) manager->activate(); // // Create user TDSOM implementation // if (class_factory_func_ptr == NULL) class_factory(); else class_factory_func_ptr(this); class_factory_done = true; if (class_list.empty() == false) { // // Set the class list pointer in the Util class and add the DServer object class // tg->set_class_list(&class_list); tg->add_class_to_list(this->get_device_class()); // // Retrieve event related properties (multicast and other) // get_event_misc_prop(tg); // // A loop for each class // for (i = 0;i < class_list.size();i++) { // // Build class commands // class_list[i]->command_factory(); // // Sort the Command list array // sort(class_list[i]->get_command_list().begin(),class_list[i]->get_command_list().end(),less_than); // // Build class attributes // MultiClassAttribute *c_attr = class_list[i]->get_class_attr(); class_list[i]->attribute_factory(c_attr->get_attr_list()); c_attr->init_class_attribute(class_list[i]->get_name()); // // Retrieve device(s) name list from the database. No need to implement // a retry here (in case of db server restart) because the db reconnection // is forced by the get_property call executed during xxxClass construction // before we reach this code. // if (tg->_UseDb == true) { Tango::Database *db = tg->get_database(); Tango::DbDatum na; try { na = db->get_device_name(tg->get_ds_name(),class_list[i]->get_name(),tg->get_db_cache()); } catch (Tango::DevFailed &) { TangoSys_OMemStream o; o << "Database error while trying to retrieve device list for class " << class_list[i]->get_name().c_str() << ends; Except::throw_exception((const char *)API_DatabaseAccess, o.str(), (const char *)"Dserver::init_device"); } long nb_dev = na.size(); Tango::DevVarStringArray dev_list(nb_dev); dev_list.length(nb_dev); for (int l = 0;l < nb_dev;l++) dev_list[l] = na.value_string[l].c_str(); cout4 << dev_list.length() << " device(s) defined" << endl; // // Create all device(s) // class_list[i]->set_device_factory_done(false); { AutoTangoMonitor sync(class_list[i]); class_list[i]->device_factory(&dev_list); } class_list[i]->set_device_factory_done(true); // // Set value for each device with memorized writable attr // This is necessary only if db is used // For Python device server, writing the attribute will tak the Python lock. // If we already have it --> dead lock. // Release the python lock if we already have it before calling the set_memorized_values // method // PyLock *lock_ptr = NULL; omni_thread *th; if (tg->is_py_ds() == true) { th = omni_thread::self(); omni_thread::value_t *tmp_py_data = th->get_value(key_py_data); lock_ptr = (static_cast(tmp_py_data))->PerTh_py_lock; lock_ptr->Release(); } class_list[i]->set_memorized_values(true); if (tg->is_py_ds() == true) { lock_ptr->Get(); } // // Check attribute configuration // class_list[i]->check_att_conf(); // // Get mcast event parameters (in case of) // class_list[i]->get_mcast_event(this); // // Release device(s) monitor // class_list[i]->release_devices_mon(); } else { vector &list = class_list[i]->get_nodb_name_list(); Tango::DevVarStringArray *dev_list_nodb = new Tango::DevVarStringArray(); if (i != class_list.size() - 1) class_list[i]->device_name_factory(list); else { if (tg->get_cmd_line_name_list().size() == 0) class_list[i]->device_name_factory(list); else list = tg->get_cmd_line_name_list(); } if (list.empty() == true) { dev_list_nodb->length(1); (*dev_list_nodb)[0] = CORBA::string_dup("NoName"); } else { (*dev_list_nodb) << list; } // // Create all device(s) // class_list[i]->set_device_factory_done(false); { AutoTangoMonitor sync(class_list[i]); class_list[i]->device_factory(dev_list_nodb); } class_list[i]->set_device_factory_done(true); delete dev_list_nodb; } } } man_state = manager->get_state(); if (man_state == PortableServer::POAManager::DISCARDING) manager->activate(); } catch (bad_alloc) { // // If the class_factory method have not been successfully executed, erase // all classes already built. If the error occurs during the command or device // factories, erase only the following classes // TangoSys_OMemStream o; if (class_factory_done == false) { long class_err = class_list.size() + 1; o << "Can't allocate memory in server while creating class number " << class_err << ends; if (class_list.empty() == false) { for (unsigned long j = 0;j < class_list.size();j++) { class_list[j]->release_devices_mon(); if (class_list[j]->is_py_class() == false) delete class_list[j]; else class_list[j]->delete_class(); } class_list.clear(); } } else { o << "Can't allocate memory in server while building command(s) or device(s) for class number " << i + 1 << ends; for (unsigned long j = i;j < class_list.size();j++) { class_list[j]->release_devices_mon(); if (class_list[j]->is_py_class() == false) delete class_list[j]; else class_list[j]->delete_class(); } class_list.erase(class_list.begin() + i,class_list.end()); } Except::throw_exception((const char *)API_MemoryAllocation, o.str(), (const char *)"DServer::init_device"); } catch (Tango::NamedDevFailedList &) { // // If the class_factory method have not been successfully executed, erase // all classes already built. If the error occurs during the command or device // factories, erase only the following classes // if (class_factory_done == false) { if (class_list.empty() == false) { for (unsigned long j = 0;j < class_list.size();j++) { class_list[j]->release_devices_mon(); if (class_list[j]->is_py_class() == false) delete class_list[j]; else class_list[j]->delete_class(); } class_list.clear(); } } else { for (unsigned long j = i;j < class_list.size();j++) { class_list[j]->release_devices_mon(); if (class_list[j]->is_py_class() == false) delete class_list[j]; else class_list[j]->delete_class(); } class_list.erase(class_list.begin() + i,class_list.end()); } throw; } catch (Tango::DevFailed) { // // If the class_factory method have not been successfully executed, erase // all classes already built. If the error occurs during the command or device // factories, erase only the following classes // if (class_factory_done == false) { if (class_list.empty() == false) { for (unsigned long j = 0;j < class_list.size();j++) { if (class_list[j]->is_py_class() == false) delete class_list[j]; else { class_list[j]->delete_class(); break; } } class_list.clear(); } } else { for (unsigned long j = i;j < class_list.size();j++) { if (class_list[j]->is_py_class() == false) delete class_list[j]; } class_list.erase(class_list.begin() + i,class_list.end()); } throw; } } //+---------------------------------------------------------------------------- // // method : DServer::~DServer // // description : destructor for DServer object // //----------------------------------------------------------------------------- DServer::~DServer() { // // Destroy already registered classes // if (class_list.empty() == false) { for (long i = class_list.size() - 1;i >= 0;i--) { if (class_list[i]->is_py_class() == false) delete class_list[i]; else { class_list[i]->delete_class(); break; } } class_list.clear(); } } //+---------------------------------------------------------------------------- // // method : DServer::delete_devices // // description : Call destructor for all objects registered in the server // //----------------------------------------------------------------------------- void DServer::delete_devices() { if (class_list.empty() == false) { for (long i = class_list.size() - 1;i >= 0;i--) { if (class_list[i]->is_py_class() == false) { Tango::Util *tg = Tango::Util::instance(); PortableServer::POA_ptr r_poa = tg->get_poa(); unsigned long loop; vector &devs = class_list[i]->get_device_list(); unsigned long nb_dev = devs.size(); for (loop = 0;loop < nb_dev;loop++) { // // Clear vectors used to memorize info used to clean db // in case of devices with dyn attr removed during device // destruction // tg->get_polled_dyn_attr_names().clear(); tg->get_full_polled_att_list().clear(); tg->get_all_dyn_attr_names().clear(); tg->get_dyn_att_dev_name().clear(); // // Delete device // class_list[i]->delete_dev(0,tg,r_poa); // // Clean-up db (dyn attribute) // if (tg->get_polled_dyn_attr_names().size() != 0) tg->clean_attr_polled_prop(); if (tg->get_all_dyn_attr_names().size() != 0) tg->clean_dyn_attr_prop(); // // Wait for POA to destroy the object before going to the next one // Limit this waiting time to 200 mS // vector::iterator it = devs.begin(); devs.erase(it); } devs.clear(); CORBA::release(r_poa); delete class_list[i]; class_list.pop_back(); } else { class_list[i]->delete_class(); break; } } class_list.clear(); } } //+---------------------------------------------------------------------------- // // method : DServer::add_class() // // description : To add a new class to the class list vector // // out : class_ptr : pointer to DeviceClass object // //----------------------------------------------------------------------------- void DServer::add_class(DeviceClass *class_ptr) { class_list.push_back(class_ptr); } //+---------------------------------------------------------------------------- // // method : DServer::query_class() // // description : command to read all the classes used in a device server // process //// // out : The class name list in a strings sequence // //----------------------------------------------------------------------------- Tango::DevVarStringArray *DServer::query_class() { NoSyncModelTangoMonitor sync(this); cout4 << "In query_class command" << endl; long nb_class = class_list.size(); Tango::DevVarStringArray *ret = NULL; try { ret = new Tango::DevVarStringArray(nb_class); ret->length(nb_class); for (int i = 0;i < nb_class;i++) { (*ret)[i] = class_list[i]->get_name().c_str(); } } catch (bad_alloc) { Except::throw_exception((const char *)API_MemoryAllocation, (const char *)"Can't allocate memory in server", (const char *)"DServer::query_class"); } return(ret); } //+---------------------------------------------------------------------------- // // method : DServer::query_device() // // description : command to read all the devices implemented by a device // server process //// // out : The device name list in a strings sequence // //----------------------------------------------------------------------------- Tango::DevVarStringArray *DServer::query_device() { NoSyncModelTangoMonitor mon(this); cout4 << "In query_device command" << endl; long nb_class = class_list.size(); Tango::DevVarStringArray *ret = NULL; vector vs; try { ret = new Tango::DevVarStringArray(DefaultMaxSeq); for (int i = 0;i < nb_class;i++) { long nb_dev = class_list[i]->get_device_list().size(); string &class_name = class_list[i]->get_name(); for (long j = 0;j < nb_dev;j++) { vs.push_back(class_name + "::" + (class_list[i]->get_device_list())[j]->get_name()); } } } catch (bad_alloc) { Except::throw_exception((const char *)API_MemoryAllocation, (const char *)"Can't allocate memory in server", (const char *)"DServer::query_device"); } int nb_dev = vs.size(); ret->length(nb_dev); for (int k = 0;k < nb_dev;k++) (*ret)[k] = CORBA::string_dup(vs[k].c_str()); return(ret); } //+---------------------------------------------------------------------------- // // method : DServer::query_sub_device() // // description : command to read all the sub devices used by a device // server process //// // out : The sub device name list in a sequence of strings // //----------------------------------------------------------------------------- Tango::DevVarStringArray *DServer::query_sub_device() { NoSyncModelTangoMonitor mon(this); cout4 << "In query_sub_device command" << endl; Tango::DevVarStringArray *ret; Tango::Util *tg = Tango::Util::instance(); ret = tg->get_sub_dev_diag().get_sub_devices(); return(ret); } //+---------------------------------------------------------------------------- // // method : DServer::restart() // // description : command to restart a device //// // out : The device name to be re-started // //----------------------------------------------------------------------------- void DServer::restart(string &d_name) { NoSyncModelTangoMonitor mon(this); cout4 << "In restart method" << endl; // // Change device name to lower case letters // and remove extra field in name in case of // (#dbase=xxx or protocol specif) // // Check if the wanted device exists in each class // bool found = false; unsigned int nb_class = class_list.size(); unsigned long i; string lower_d_name(d_name); transform(lower_d_name.begin(),lower_d_name.end(),lower_d_name.begin(),::tolower); string::size_type pos; if ((pos = lower_d_name.find('#')) != string::npos) lower_d_name.erase(pos); if ((pos = lower_d_name.find("://")) != string::npos) { pos = pos + 3; if ((pos = lower_d_name.find('/',pos)) != string::npos) lower_d_name.erase(0,pos + 1); } vector::iterator ite,ite_end; for (i = 0;i < nb_class;i++) { vector &dev_list = class_list[i]->get_device_list(); ite_end = dev_list.end(); for (ite = dev_list.begin();ite != dev_list.end();++ite) { if ((*ite)->get_name_lower() == lower_d_name) { found = true; break; } } if (found == true) break; } // // Throw exception if the device is not found // if ((i == nb_class) && (ite == ite_end)) { cout3 << "Device " << d_name << " not found in server !" << endl; TangoSys_OMemStream o; o << "Device " << d_name << " not found" << ends; Except::throw_exception((const char *)API_DeviceNotFound, o.str(), (const char *)"Dserver::restart()"); } DeviceImpl *dev_to_del = *ite; // // If the device is locked and if the client is not the lock owner, // refuse to do the job // check_lock_owner(dev_to_del,"restart",d_name.c_str()); // // clean the sub-device list for this device // Tango::Util *tg = Tango::Util::instance(); tg->get_sub_dev_diag().remove_sub_devices (dev_to_del->get_name()); tg->get_sub_dev_diag().set_associated_device(dev_to_del->get_name()); // // Remove ourself from device list // class_list[i]->get_device_list().erase(ite); // // Get device name, class pointer, polled object list and event parameter // DeviceClass *dev_cl = dev_to_del->get_device_class(); Tango::DevVarStringArray name(1); name.length(1); name[0] = lower_d_name.c_str(); vector &p_obj = dev_to_del->get_poll_obj_list(); vector dev_pol; vector eve; for (i = 0;i < p_obj.size();i++) { Pol tmp; tmp.type = p_obj[i]->get_type(); tmp.upd = p_obj[i]->get_upd(); tmp.name = p_obj[i]->get_name(); dev_pol.push_back(tmp); } dev_to_del->get_device_attr()->get_event_param(eve); // // Also get device locker parameters if device locked // client_addr *cl_addr = NULL; client_addr *old_cl_addr = NULL; time_t l_date = 0; DevLong l_ctr = 0,l_valid = 0; if (dev_to_del->is_device_locked() == true) { cl_addr = dev_to_del->get_locker(); old_cl_addr = dev_to_del->get_old_locker(); l_date = dev_to_del->get_locking_date(); l_ctr = dev_to_del->get_locking_ctr(); l_valid = dev_to_del->get_lock_validity(); dev_to_del->clean_locker_ptrs(); } // // If the device was polled, stop polling // if (dev_pol.empty() == false) { dev_to_del->stop_polling(false); } // // Delete the device (deactivate it and remove it) // try { tg->add_restarting_device(lower_d_name); PortableServer::POA_ptr r_poa = tg->get_poa(); bool py_device = dev_to_del->is_py_device(); if (py_device == true) { AutoPyLock PyLo; Device_3Impl *dev_to_del_3 = static_cast(dev_to_del); dev_to_del_3->delete_dev(); } if (dev_to_del->get_exported_flag() == true) r_poa->deactivate_object(dev_to_del->get_obj_id().in()); CORBA::release(r_poa); // // Re-create device. Take the monitor in case of class or process serialisation // model // dev_cl->set_device_factory_done(false); { AutoTangoMonitor sync(dev_cl); AutoPyLock PyLo; dev_cl->device_factory(&name); } dev_cl->set_device_factory_done(true); tg->delete_restarting_device(lower_d_name); } catch (Tango::DevFailed &e) { tg->delete_restarting_device(lower_d_name); stringstream ss; ss << "init_device() method for device " << d_name << " throws DevFailed exception."; ss << "\nDevice not available any more. Please fix exception reason"; Tango::Except::re_throw_exception(e,API_InitThrowsException,ss.str(),"Dserver::restart()"); } catch (...) { tg->delete_restarting_device(lower_d_name); stringstream ss; ss << "init_device() method for device " << d_name << " throws an unknown exception."; ss << "\nDevice not available any more. Please fix exception reason"; Tango::Except::throw_exception(API_InitThrowsException,ss.str(),"Dserver::restart()"); } // // Apply memorized values for memorized attributes (if any) // dev_cl->set_memorized_values(false,dev_cl->get_device_list().size() - 1); // // Unlock the device (locked by export_device for memorized attribute) // vector &dev_list = dev_cl->get_device_list(); DeviceImpl *last_dev = dev_list.back(); last_dev->get_dev_monitor().rel_monitor(); // // Re-start device polling (if any) // DevVarLongStringArray *send = new DevVarLongStringArray(); send->lvalue.length(1); send->svalue.length(3); for (i = 0;i < dev_pol.size();i++) { // // Send command to the polling thread // send->lvalue[0] = dev_pol[i].upd; send->svalue[0] = CORBA::string_dup(name[0]); if (dev_pol[i].type == Tango::POLL_CMD) send->svalue[1] = CORBA::string_dup("command"); else send->svalue[1] = CORBA::string_dup("attribute"); send->svalue[2] = CORBA::string_dup(dev_pol[i].name.c_str()); try { add_obj_polling(send,false); } catch (Tango::DevFailed &e) { if (Tango::Util::_tracelevel >= 4) Except::print_exception(e); } } delete send; // // Find the new device // DeviceImpl *new_dev = NULL; vector &d_list = dev_cl->get_device_list(); for (i = 0;i < d_list.size();i++) { if (d_list[i]->get_name() == lower_d_name) { new_dev = d_list[i]; break; } } if (i == d_list.size()) { cout3 << "Not able to find the new device" << endl; TangoSys_OMemStream o; o << "Not able to find the new device" << ends; Except::throw_exception((const char *)API_DeviceNotFound, o.str(), (const char *)"Dserver::restart()"); } // // Re-set classical event parameters (if needed) // for (i = 0;i < eve.size();i++) { Tango::MultiAttribute *m_attr = new_dev->get_device_attr(); Tango::Attribute &att = m_attr->get_attr_by_ind(eve[i].attr_id); if (eve[i].change == true) att.set_change_event_sub(); if (eve[i].periodic == true) att.set_periodic_event_sub(); if (eve[i].quality == true) att.set_quality_event_sub(); if (eve[i].archive == true) att.set_archive_event_sub(); if (eve[i].user == true) att.set_user_event_sub(); if (eve[i].notifd == true) att.set_use_notifd_event(); if (eve[i].zmq == true) att.set_use_zmq_event(); } // // Re-set multicast event parameters // vector m_cast; vector &att_list = new_dev->get_device_attr()->get_attribute_list(); for (unsigned int j = 0;j < att_list.size();++j) { mcast_event_for_att(new_dev->get_name_lower(),att_list[j]->get_name_lower(),m_cast); if (m_cast.empty() == false) att_list[j]->set_mcast_event(m_cast); } // // Re-lock device if necessary // if (cl_addr != NULL) new_dev->set_locking_param(cl_addr,old_cl_addr,l_date,l_ctr,l_valid); } //+---------------------------------------------------------------------------- // // method : DServer::restart_server() // // description : command to restart a server (all devices embedded // within the server) // //----------------------------------------------------------------------------- void DServer::restart_server() { NoSyncModelTangoMonitor mon(this); // // Create the thread and start it // ServRestartThread *t = new ServRestartThread(this); t->start(); } void ServRestartThread::run(void *ptr) { PyData *py_data_ptr = new PyData(); omni_thread::self()->set_value(key_py_data,py_data_ptr); // // The arg. passed to this method is a pointer to the DServer device // DServer *dev = (DServer *)ptr; // // clean the sub-device list for the server // Tango::Util *tg = Tango::Util::instance(); tg->get_sub_dev_diag().remove_sub_devices(); // // Change the POA manager to discarding state. This is necessary to discard all // request arriving while the server restart. // PortableServer::POA_var poa = Util::instance()->get_poa(); PortableServer::POAManager_var manager = poa->the_POAManager(); manager->discard_requests(true); // // Setup logging // #ifdef TANGO_HAS_LOG4TANGO dev->init_logger(); #endif // // Reset initial state and status // dev->set_state(Tango::ON); dev->set_status("The device is ON"); // // Destroy and recreate the multi attribute object // MultiAttribute *tmp_ptr; try { tmp_ptr = new MultiAttribute(dev->get_name(),dev->get_device_class()); } catch (Tango::DevFailed) { throw; } delete dev->get_device_attr(); dev->set_device_attr(tmp_ptr); dev->add_state_status_attrs(); // // Restart device(s) // Before set 2 values to retrieve correct polling threads pool size // tg->set_polling_threads_pool_size(ULONG_MAX); dev->set_poll_th_pool_size(DEFAULT_POLLING_THREADS_POOL_SIZE); tg->set_svr_starting(true); { AutoPyLock PyLo; dev->init_device(); } tg->set_svr_starting(false); // // Restart polling (if any) // tg->polling_configure(); // // Exit thread // omni_thread::self()->remove_value(key_py_data); delete py_data_ptr; omni_thread::exit(); } //+---------------------------------------------------------------------------- // // method : DServer::query_class_prop() // // description : command to return the list of property device at class // level for the specified class // //----------------------------------------------------------------------------- Tango::DevVarStringArray *DServer::query_class_prop(string &class_name) { NoSyncModelTangoMonitor sync(this); cout4 << "In query_class_prop command" << endl; long nb_class = class_list.size(); Tango::DevVarStringArray *ret = NULL; // // Find the wanted class in server and throw exception if not found // transform(class_name.begin(),class_name.end(),class_name.begin(),::tolower); int k; for (k = 0;k < nb_class;k++) { string tmp_name(class_list[k]->get_name()); transform(tmp_name.begin(),tmp_name.end(),tmp_name.begin(),::tolower); if (tmp_name == class_name) break; } if (k == nb_class) { TangoSys_OMemStream o; o << "Class " << class_name << " not found in device server" << ends; Except::throw_exception((const char *)API_ClassNotFound,o.str(), (const char *)"DServer::query_class_prop"); } // // Retrieve class prop vector and returns its content in a DevVarStringArray // vector &wiz = class_list[k]->get_wiz_class_prop(); long nb_prop = wiz.size(); try { ret = new Tango::DevVarStringArray(nb_prop); ret->length(nb_prop); for (int i = 0;i < nb_prop;i++) { (*ret)[i] = CORBA::string_dup(wiz[i].c_str()); } } catch (bad_alloc) { Except::throw_exception((const char *)API_MemoryAllocation, (const char *)"Can't allocate memory in server", (const char *)"DServer::query_class_prop"); } return(ret); } //+---------------------------------------------------------------------------- // // method : DServer::query_dev_prop() // // description : command to return the list of property device at device // level for the specified class // //----------------------------------------------------------------------------- Tango::DevVarStringArray *DServer::query_dev_prop(string &class_name) { NoSyncModelTangoMonitor sync(this); cout4 << "In query_dev_prop command" << endl; long nb_class = class_list.size(); Tango::DevVarStringArray *ret = NULL; // // Find the wanted class in server and throw exception if not found // transform(class_name.begin(),class_name.end(),class_name.begin(),::tolower); int k; for (k = 0;k < nb_class;k++) { string tmp_name(class_list[k]->get_name()); transform(tmp_name.begin(),tmp_name.end(),tmp_name.begin(),::tolower); if (tmp_name == class_name) break; } if (k == nb_class) { TangoSys_OMemStream o; o << "Class " << class_name << " not found in device server" << ends; Except::throw_exception((const char *)API_ClassNotFound,o.str(), (const char *)"DServer::query_dev_prop"); } // // Retrieve device prop vector and returns its content in a DevVarStringArray // vector &wiz = class_list[k]->get_wiz_dev_prop(); long nb_prop = wiz.size(); try { ret = new Tango::DevVarStringArray(nb_prop); ret->length(nb_prop); for (int i = 0;i < nb_prop;i++) { (*ret)[i] = CORBA::string_dup(wiz[i].c_str()); } } catch (bad_alloc) { Except::throw_exception((const char *)API_MemoryAllocation, (const char *)"Can't allocate memory in server", (const char *)"DServer::query_dev_prop"); } return(ret); } //+---------------------------------------------------------------------------- // // method : DServer::kill() // // description : command to kill the device server process. This is done // by starting a thread which will kill the process. // Starting a thread allows the client to receive // something from the server before it is killed // //----------------------------------------------------------------------------- void DServer::kill() { NoSyncModelTangoMonitor mon(this); cout4 << "In kill command" << endl; // // Create the thread and start it // KillThread *t = new KillThread; t->start(); } void *KillThread::run_undetached(TANGO_UNUSED(void *ptr)) { cout4 << "In the killer thread !!!" << endl; omni_thread::self()->set_value(key_py_data,new PyData()); // // Shutdown the server // Tango::Util *tg = Tango::Util::instance(); tg->shutdown_server(); return NULL; } //+---------------------------------------------------------------------------- // // method : DServer::create_cpp_class() // // description : Create a Cpp Tango class from its name // //----------------------------------------------------------------------------- void DServer::create_cpp_class(const char *cl_name,const char *par_name) { cout4 << "In DServer::create_cpp_class for " << cl_name << ", " << par_name << endl; string class_name(cl_name); string lib_name = class_name; #ifdef _TG_WINDOWS_ HMODULE mod; if ((mod = LoadLibrary(lib_name.c_str())) == NULL) { char *str = 0; DWORD l_err = GetLastError(); ::FormatMessage(FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_SYSTEM,NULL, l_err,MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT),(char *)&str,0,NULL); cerr << "Error: " << str << endl; TangoSys_OMemStream o; o << "Trying to load shared library " << lib_name << " failed. It returns error: " << str << ends; ::LocalFree((HLOCAL)str); Except::throw_exception((const char *)API_ClassNotFound,o.str(), (const char *)"DServer::create_cpp_class"); } cout4 << "GetModuleHandle is a success" << endl; string sym_name("_create_"); sym_name = sym_name + class_name; sym_name = sym_name + "_class"; cout4 << "Symbol name = " << sym_name << endl; FARPROC proc; if ((proc = GetProcAddress(mod,sym_name.c_str())) == NULL) { TangoSys_OMemStream o; o << "Class " << cl_name << " does not have the C creator function (_create__class)" << ends; Except::throw_exception((const char *)API_ClassNotFound,o.str(), (const char *)"DServer::create_cpp_class"); } cout4 << "GetProcAddress is a success" << endl; Cpp_creator_ptr mt = (Cpp_creator_ptr)proc; #else void *lib_ptr; lib_name = lib_name + ".so"; lib_ptr = dlopen(lib_name.c_str(),RTLD_NOW); if (lib_ptr == NULL) { TangoSys_OMemStream o; o << "Trying to load shared library " << lib_name << " failed. It returns error: " << dlerror() << ends; Except::throw_exception((const char *)API_ClassNotFound,o.str(), (const char *)"DServer::create_cpp_class"); } cout4 << "dlopen is a success" << endl; void *sym; string sym_name("_create_"); sym_name = sym_name + class_name; sym_name = sym_name + "_class"; cout4 << "Symbol name = " << sym_name << endl; sym = dlsym(lib_ptr,sym_name.c_str()); if (sym == NULL) { TangoSys_OMemStream o; o << "Class " << cl_name << " does not have the C creator function (_create__class)" << ends; Except::throw_exception((const char *)API_ClassNotFound,o.str(), (const char *)"DServer::create_cpp_class"); } cout4 << "dlsym is a success" << endl; Cpp_creator_ptr mt = (Cpp_creator_ptr)sym; #endif /* _TG_WINDOWS_ */ Tango::DeviceClass *dc = (*mt)(par_name); add_class(dc); } //+---------------------------------------------------------------------------- // // method : DServer::get_dev_prop() // // description : Retrieve device properties // // argin: tg : Tango Util object ptr // //----------------------------------------------------------------------------- void DServer::get_dev_prop(Tango::Util *tg) { // // Try to retrieve device properties (Polling threads pool conf.) // if (tg->_UseDb == true) { DbData db_data; db_data.push_back(DbDatum("polling_threads_pool_size")); db_data.push_back(DbDatum("polling_threads_pool_conf")); try { db_dev->get_property(db_data); } catch (Tango::DevFailed &) { TangoSys_OMemStream o; o << "Database error while trying to retrieve device properties for device " << device_name.c_str() << ends; Except::throw_exception((const char *)API_DatabaseAccess, o.str(), (const char *)"DServer::get_dev_prop"); } // // If the prop is not defined in db and if the user has defined it in the Util class, // takes the user definition // if (db_data[0].is_empty() == false) db_data[0] >> polling_th_pool_size; else { unsigned long p_size = tg->get_polling_threads_pool_size(); if (p_size != ULONG_MAX) polling_th_pool_size = p_size; } if (db_data[1].is_empty() == false) { vector tmp_vect; db_data[1] >> tmp_vect; // // If the polling threads pool conf. has been splitted due to the // max device property length of 255 chars, rebuilt a real pool conf // string rebuilt_str; bool ended = true; vector::iterator iter; polling_th_pool_conf.clear(); for (iter = tmp_vect.begin();iter != tmp_vect.end();++iter) { string tmp_str = (*iter); if (tmp_str[tmp_str.size() - 1] == '\\') { tmp_str.resize(tmp_str.size() - 1); ended = false; } else ended = true; rebuilt_str = rebuilt_str + tmp_str; if (ended == true) { polling_th_pool_conf.push_back(rebuilt_str); rebuilt_str.clear(); } } } else polling_th_pool_conf.clear(); } } //+---------------------------------------------------------------------------- // // method : DServer::check_lock_owner() // // description : Check in case the device is locked if the client is the // lock owner // // argin: dev : The device // cmd_name : The DServer device command name // dev_name : The device name // //----------------------------------------------------------------------------- void DServer::check_lock_owner(DeviceImpl *dev,const char *cmd_name,const char *dev_name) { if (dev->is_device_locked() == true) { if (dev->valid_lock() == true) { client_addr *cl = get_client_ident(); if (cl->client_ident == true) { if (*cl != *(dev->get_locker())) { TangoSys_OMemStream o,v; o << "Device " << dev_name << " is locked by another client."; o << " Your request is not allowed while a device is locked." << ends; v << "DServer::" << cmd_name << ends; Except::throw_exception((const char *)API_DeviceLocked,o.str(),v.str()); } } else { TangoSys_OMemStream o,v; o << "Device " << dev_name << " is locked by another client."; o << " Your request is not allowed while a device is locked." << ends; v << "DServer::" << cmd_name << ends; Except::throw_exception((const char *)API_DeviceLocked,o.str(),v.str()); } } } } //+---------------------------------------------------------------------------- // // method : DServer::get_event_misc_prop() // // description : Get the properties defining which event has to be transported // using multicast protocol // Also retrieve property for Nan allowed in writing attribute // // argin: tg : Tango Util instance pointer // //----------------------------------------------------------------------------- void DServer::get_event_misc_prop(Tango::Util *tg) { if (tg->_UseDb == true) { // // Get property // DbData db_data; db_data.push_back(DbDatum("MulticastEvent")); db_data.push_back(DbDatum("MulticastHops")); db_data.push_back(DbDatum("MulticastRate")); db_data.push_back(DbDatum("MulticastIvl")); db_data.push_back(DbDatum("DSEventBufferHwm")); db_data.push_back(DbDatum("EventBufferHwm")); db_data.push_back(DbDatum("WAttrNaNAllowed")); try { tg->get_database()->get_property(CONTROL_SYSTEM,db_data,tg->get_db_cache()); mcast_event_prop.clear(); db_data[0] >> mcast_event_prop; // // Check property coherency // vector::size_type nb_elt = mcast_event_prop.size(); bool uncoherent = false; for (unsigned int i = 0;i < nb_elt;++i) { if (is_ip_address(mcast_event_prop[i]) == true) { // // Check multicast address validity // string start_ip_mcast = mcast_event_prop[i].substr(0,mcast_event_prop[i].find('.')); istringstream ss(start_ip_mcast); int ip_start; ss >> ip_start; if ((ip_start < 224) || (ip_start > 239)) uncoherent = true; else { // // Check property definition // if (nb_elt < i + 3) uncoherent = true; else { if (nb_elt > i + 4) { if ((is_event_name(mcast_event_prop[i + 2]) == false) && (is_event_name(mcast_event_prop[i + 3]) == false) && (is_event_name(mcast_event_prop[i + 4]) == false)) uncoherent = true; } else if (nb_elt > i + 3) { if ((is_event_name(mcast_event_prop[i + 2]) == false) && (is_event_name(mcast_event_prop[i + 3]) == false)) uncoherent = true; } else { if (is_event_name(mcast_event_prop[i + 2]) == false) uncoherent = true; } } } // // If the property is uncoherent, clear it but inform user // No event will use multicasting in this case // if (uncoherent == true) { cerr << "Database CtrlSystem/MulticastEvent property is uncoherent" << endl; cerr << "Prop syntax = mcast ip adr (must be between 224.x.y.z and 239.x.y.z) - port - [rate] - [ivl] - event name" << endl; cerr << "All events will use unicast communication" << endl; mcast_event_prop.clear(); break; } else i = i + 1; } } // // All values in lower case letters // for (unsigned int i = 0;i < nb_elt;i++) { transform(mcast_event_prop[i].begin(),mcast_event_prop[i].end(),mcast_event_prop[i].begin(),::tolower); } // // Multicast Hops // mcast_hops = MCAST_HOPS; if (db_data[1].is_empty() == false) db_data[1] >> mcast_hops; // // Multicast PGM rate // mcast_rate = PGM_RATE; if (db_data[2].is_empty() == false) { db_data[2] >> mcast_rate; mcast_rate = mcast_rate * 1024; } // // Multicast IVL // mcast_ivl = PGM_IVL; if (db_data[3].is_empty() == false) { db_data[3] >> mcast_ivl; mcast_ivl = mcast_ivl * 1000; } // // Publisher Hwm // zmq_pub_event_hwm = PUB_HWM; if (db_data[4].is_empty() == false) db_data[4] >> zmq_pub_event_hwm; // // Subscriber Hwm // zmq_sub_event_hwm = SUB_HWM; if (db_data[5].is_empty() == false) db_data[5] >> zmq_sub_event_hwm; // // Nan allowed in writing attribute // if (db_data[6].is_empty() == false) { bool new_val; db_data[6] >> new_val; tg->set_wattr_nan_allowed(new_val); } } catch (Tango::DevFailed &) { cerr << "Database error while trying to retrieve multicast event property" << endl; cerr << "All events will use unicast communication" << endl; } } else mcast_event_prop.clear(); } //+---------------------------------------------------------------------------- // // method : DServer::mcast_event_for_att() // // description : Return in m_event vector, list of mcast event for the // specified device/attribute. // For each event, the returned string in the vector // follow the syntax // event_name:ip_adr:port:rate:ivl // The last two are optionals // Please note that the same dev/att may have several event // using multicasting // // argin: dev_name : The device name // att_name : The attribute name // argout: m_event : The multicast event definition // //----------------------------------------------------------------------------- void DServer::mcast_event_for_att(string &dev_name,string &att_name,vector &m_event) { m_event.clear(); string full_att_name = dev_name + '/' + att_name; vector::size_type nb_elt = mcast_event_prop.size(); unsigned int ip_adr_ind = 0; for (unsigned int i = 0;i < nb_elt;++i) { if (is_ip_address(mcast_event_prop[i]) == true) { ip_adr_ind = i; continue; } if (is_event_name(mcast_event_prop[i]) == true) { if (mcast_event_prop[i].find(full_att_name) == 0) { string::size_type pos = mcast_event_prop[i].rfind('.'); string tmp = mcast_event_prop[i].substr(pos + 1); tmp = tmp + ':' + mcast_event_prop[ip_adr_ind] + ':' + mcast_event_prop[ip_adr_ind + 1]; if (is_event_name(mcast_event_prop[ip_adr_ind + 2]) == false) { tmp = tmp + ':' + mcast_event_prop[ip_adr_ind + 2]; if (is_event_name(mcast_event_prop[ip_adr_ind + 3]) == false) tmp = tmp + ':' + mcast_event_prop[ip_adr_ind + 3]; } m_event.push_back(tmp); } } } } } // End of Tango namespace tango-8.1.2c+dfsg.orig/lib/cpp/server/dserversignal.h0000644000175000017500000001050212205375142021451 0ustar piccapicca//============================================================================= // // file : DServerSignal.h // // description : Include for the DServer class. This class implements // all the commands which are available for device // of the DServer class. There is one device of the // DServer class for each device server process // // project : TANGO // // author(s) : A.Gotz + E.Taurel // // Copyright (C) : 2004,2005,2006,2007,2008,2009,2010,2011,2012,2013 // European Synchrotron Radiation Facility // BP 220, Grenoble 38043 // FRANCE // // This file is part of Tango. // // Tango 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. // // Tango 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 Tango. If not, see . // // $Revision: 22718 $ // //============================================================================= #ifndef _DSERVERSIGNAL_H #define _DSERVERSIGNAL_H #include #include namespace Tango { //============================================================================= // // The DServerSignal class // // description : Class to implement all data members and commands for // signal management in a TANGO device server. // //============================================================================= #if (defined (_TG_WINDOWS_) || (defined __darwin__) || (defined __freebsd__)) #define _NSIG NSIG #endif typedef struct { vector registered_classes; vector registered_devices; bool own_handler; } DevSigAction; class DServerSignal:public TangoMonitor { public : TANGO_IMP_EXP static DServerSignal *instance(); ~DServerSignal() {}; #ifndef _TG_WINDOWS_ void register_class_signal(long, bool, DeviceClass *); void register_dev_signal(long, bool, DeviceImpl *); void register_handler(long,bool); pid_t get_sig_thread_pid(); #else void register_class_signal(long, DeviceClass *); void register_dev_signal(long, DeviceImpl *); void register_handler(long); #endif void unregister_class_signal(long, DeviceClass *); void unregister_class_signal(DeviceClass *); void unregister_dev_signal(long, DeviceImpl *); void unregister_dev_signal(DeviceImpl *); void unregister_handler(long); static void main_sig_handler(int); class ThSig: public omni_thread { DServerSignal *ds; public: ThSig(DServerSignal *d):ds(d),my_pid(0),th_data_created(false) {} virtual ~ThSig() {} TangoSys_Pid my_pid; bool th_data_created; #ifndef _TG_WINDOWS_ pthread_t my_thread; #endif void *run_undetached(void *); void start() {start_undetached();} }; friend class ThSig; ThSig *sig_th; protected : DServerSignal(); static DevSigAction reg_sig[_NSIG]; bool sig_to_install; bool sig_to_remove; int inst_sig; int rem_sig; #ifdef _TG_WINDOWS_ static HANDLE win_ev; static int win_signo; #endif private: static DServerSignal *_instance; vector::iterator find_device(long, DeviceImpl *); vector::iterator find_delayed_device(long, DeviceImpl *); vector::iterator find_class(long, DeviceClass *); vector::iterator find_delayed_class(long, DeviceClass *); #ifdef _TG_WINDOWS_ static inline bool auto_signal(long s) { if ((s==SIGINT) || (s==SIGTERM) || (s==SIGABRT) || (s==SIGBREAK)) return true; else return false; } #else static inline bool auto_signal(long s) { if ((s==SIGQUIT) || (s==SIGINT) || (s==SIGHUP) || (s==SIGTERM)) return true; else return false; } #endif #if (defined __GLIBC__ || defined __darwin__ || defined __freebsd__) static inline bool auth_signal(TANGO_UNUSED(long s)) {return true;} #endif #ifdef _TG_WINDOWS_ static inline bool auth_signal(long s) {return true;} #endif static string sig_name[_NSIG]; }; } // End of namespace Tango #endif tango-8.1.2c+dfsg.orig/lib/cpp/server/w_attribute.tpp0000644000175000017500000005432012205375142021514 0ustar piccapicca//+============================================================================ // // file : WAttribute.tpp // // description : C++ source code for the WAttribute class template // methods // // project : TANGO // // author(s) : E.Taurel // // Copyright (C) : 2011,2012 // European Synchrotron Radiation Facility // BP 220, Grenoble 38043 // FRANCE // // This file is part of Tango. // // Tango 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. // // Tango 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 Tango. If not, see . // // $Revision: 17240 $ // //-============================================================================ #ifndef _WATTRIBUTE_TPP #define _WATTRIBUTE_TPP namespace Tango { //+------------------------------------------------------------------------- // // method : WAttribute::set_min_value() // // description : Sets minimum value attribute property // Throws exception in case the data type of provided // property does not match the attribute data type // // in : new_min_value : The minimum value property to be set // //-------------------------------------------------------------------------- template void WAttribute::set_min_value(const T &new_min_value) { // // Check type validity // if((data_type == Tango::DEV_STRING) || (data_type == Tango::DEV_BOOLEAN) || (data_type == Tango::DEV_STATE)) throw_err_data_type("min_value",ext->d_name,"WAttribute::set_min_value()"); if (!(data_type == DEV_ENCODED && ranges_type2const::enu == DEV_UCHAR) && (data_type != ranges_type2const::enu)) { string err_msg = "Attribute (" + name + ") data type does not match the type provided : " + ranges_type2const::str; Except::throw_exception((const char *)API_IncompatibleAttrDataType, (const char *)err_msg.c_str(), (const char *)"WAttribute::set_min_value()"); } // // Check coherence with max_value // if(check_max_value) { T max_value_tmp; memcpy((void *) &max_value_tmp, (const void *) &max_value, sizeof(T)); if(new_min_value >= max_value_tmp) throw_incoherent_val_err("min_value","max_value",ext->d_name,"WAttribute::set_min_value()"); } // // Store new min value as a string // TangoSys_MemStream str; str.precision(TANGO_FLOAT_PRECISION); if(ranges_type2const::enu == Tango::DEV_UCHAR) str << (short)new_min_value; // to represent the numeric value else str << new_min_value; string min_value_tmp_str = str.str(); // // Get the monitor protecting device att config // If the server is in its starting phase, give a NULL ptr // to the AutoLock object // Tango::Util *tg = Tango::Util::instance(); Tango::TangoMonitor *mon_ptr = NULL; if (tg->is_svr_starting() == false && tg->is_device_restarting(ext->d_name) == false) mon_ptr = &(get_att_device()->get_att_conf_monitor()); AutoTangoMonitor sync1(mon_ptr); // // Store the new value locally // Attr_CheckVal old_min_value; memcpy((void *)&old_min_value, (void *)&min_value, sizeof(T)); memcpy((void *)&min_value, (void *)&new_min_value, sizeof(T)); // // Then, update database // Tango::DeviceClass *dev_class = get_att_device_class(ext->d_name); Tango::MultiClassAttribute *mca = dev_class->get_class_attr(); Tango::Attr &att = mca->get_attr(name); vector &def_user_prop = att.get_user_default_properties(); size_t nb_user = def_user_prop.size(); string usr_def_val; bool user_defaults = false; if (nb_user != 0) { size_t i; for (i = 0;i < nb_user;i++) { if (def_user_prop[i].get_name() == "min_value") break; } if (i != nb_user) // user defaults defined { user_defaults = true; usr_def_val = def_user_prop[i].get_value(); } } if (Tango::Util::_UseDb == true) { if(user_defaults && min_value_tmp_str == usr_def_val) { DbDatum attr_dd(name), prop_dd("min_value"); DbData db_data; db_data.push_back(attr_dd); db_data.push_back(prop_dd); bool retry = true; while (retry == true) { try { tg->get_database()->delete_device_attribute_property(ext->d_name,db_data); retry = false; } catch (CORBA::COMM_FAILURE) { tg->get_database()->reconnect(true); } } } else { try { upd_att_prop_db(min_value,"min_value"); } catch (Tango::DevFailed &) { memcpy((void *)&min_value, (void *)&old_min_value, sizeof(T)); throw; } } } // // Set the min_value flag // check_min_value = true; // // Store new value as a string // min_value_str = min_value_tmp_str; // // Push a att conf event // if (tg->is_svr_starting() == false && tg->is_device_restarting(ext->d_name) == false) get_att_device()->push_att_conf_event(this); // // Delete device startup exception related to min_value if there is any // delete_startup_exception("min_value"); } template <> inline void WAttribute::set_min_value(const Tango::DevEncoded &) { string err_msg = "Attribute properties cannot be set with Tango::DevEncoded data type"; Except::throw_exception((const char *)API_MethodArgument, (const char *)err_msg.c_str(), (const char *)"WAttribute::set_min_value()"); } template <> inline void WAttribute::set_min_value(const string &new_min_value_str) { if((data_type == Tango::DEV_STRING) || (data_type == Tango::DEV_BOOLEAN) || (data_type == Tango::DEV_STATE)) throw_err_data_type("min_value",ext->d_name,"WAttribute::set_min_value()"); string min_value_str_tmp = new_min_value_str; string dev_name = ext->d_name; Tango::DeviceClass *dev_class = get_att_device_class(ext->d_name); Tango::MultiClassAttribute *mca = dev_class->get_class_attr(); Tango::Attr &att = mca->get_attr(name); vector &def_user_prop = att.get_user_default_properties(); vector &def_class_prop = att.get_class_properties(); size_t nb_class = def_class_prop.size(); size_t nb_user = def_user_prop.size(); string usr_def_val; string class_def_val; bool user_defaults = false; bool class_defaults = false; user_defaults = prop_in_list("min_value",usr_def_val,nb_user,def_user_prop); class_defaults = prop_in_list("min_value",class_def_val,nb_class,def_class_prop); bool set_value = true; if (class_defaults) { if(TG_strcasecmp(new_min_value_str.c_str(),AlrmValueNotSpec) == 0) { set_value = false; avns_in_db("min_value",dev_name); avns_in_att(MIN_VALUE); } else if ((TG_strcasecmp(new_min_value_str.c_str(),NotANumber) == 0) || (TG_strcasecmp(new_min_value_str.c_str(),class_def_val.c_str()) == 0)) { min_value_str_tmp = class_def_val; } else if (strlen(new_min_value_str.c_str()) == 0) { if (user_defaults) { min_value_str_tmp = usr_def_val; } else { set_value = false; avns_in_db("min_value",dev_name); avns_in_att(MIN_VALUE); } } } else if(user_defaults) { if(TG_strcasecmp(new_min_value_str.c_str(),AlrmValueNotSpec) == 0) { set_value = false; avns_in_db("min_value",dev_name); avns_in_att(MIN_VALUE); } else if ((TG_strcasecmp(new_min_value_str.c_str(),NotANumber) == 0) || (TG_strcasecmp(new_min_value_str.c_str(),usr_def_val.c_str()) == 0) || (strlen(new_min_value_str.c_str()) == 0)) min_value_str_tmp = usr_def_val; } else { if ((TG_strcasecmp(new_min_value_str.c_str(),AlrmValueNotSpec) == 0) || (TG_strcasecmp(new_min_value_str.c_str(),NotANumber) == 0) || (strlen(new_min_value_str.c_str()) == 0)) { set_value = false; avns_in_db("min_value",dev_name); avns_in_att(MIN_VALUE); } } if(set_value) { if ((data_type != Tango::DEV_STRING) && (data_type != Tango::DEV_BOOLEAN) && (data_type != Tango::DEV_STATE)) { double db; float fl; TangoSys_MemStream str; str.precision(TANGO_FLOAT_PRECISION); str << min_value_str_tmp; switch (data_type) { case Tango::DEV_SHORT: if (!(str >> db && str.eof())) throw_err_format("min_value",dev_name,"WAttribute::set_min_value()"); set_min_value((DevShort)db); break; case Tango::DEV_LONG: if (!(str >> db && str.eof())) throw_err_format("min_value",dev_name,"WAttribute::set_min_value()"); set_min_value((DevLong)db); break; case Tango::DEV_LONG64: if (!(str >> db && str.eof())) throw_err_format("min_value",dev_name,"WAttribute::set_min_value()"); set_min_value((DevLong64)db); break; case Tango::DEV_DOUBLE: if (!(str >> db && str.eof())) throw_err_format("min_value",dev_name,"WAttribute::set_min_value()"); set_min_value(db); break; case Tango::DEV_FLOAT: if (!(str >> fl && str.eof())) throw_err_format("min_value",dev_name,"WAttribute::set_min_value()"); set_min_value(fl); break; case Tango::DEV_USHORT: if (!(str >> db && str.eof())) throw_err_format("min_value",dev_name,"WAttribute::set_min_value()"); (db < 0.0) ? set_min_value((DevUShort)(-db)) : set_min_value((DevUShort)db); break; case Tango::DEV_UCHAR: if (!(str >> db && str.eof())) throw_err_format("min_value",dev_name,"WAttribute::set_min_value()"); (db < 0.0) ? set_min_value((DevUChar)(-db)) : set_min_value((DevUChar)db); break; case Tango::DEV_ULONG: if (!(str >> db && str.eof())) throw_err_format("min_value",dev_name,"WAttribute::set_min_value()"); (db < 0.0) ? set_min_value((DevULong)(-db)) : set_min_value((DevULong)db); break; case Tango::DEV_ULONG64: if (!(str >> db && str.eof())) throw_err_format("min_value",dev_name,"WAttribute::set_min_value()"); (db < 0.0) ? set_min_value((DevULong64)(-db)) : set_min_value((DevULong64)db); break; case Tango::DEV_ENCODED: if (!(str >> db && str.eof())) throw_err_format("min_value",dev_name,"WAttribute::set_min_value()"); (db < 0.0) ? set_min_value((DevUChar)(-db)) : set_min_value((DevUChar)db); break; } } else throw_err_data_type("min_value",dev_name,"WAttribute::set_min_value()"); } } //+------------------------------------------------------------------------- // // method : WAttribute::get_min_value() // // description : Gets attribute's minimum value and assigns it // to the variable provided as a parameter // Throws exception in case the data type of provided // parameter does not match the attribute data type // or if minimum value is not defined // // in : min_val : The variable to be assigned the attribute's // minimum value // //-------------------------------------------------------------------------- template void WAttribute::get_min_value(T &min_val) { if (!(data_type == DEV_ENCODED && ranges_type2const::enu == DEV_UCHAR) && (data_type != ranges_type2const::enu)) { string err_msg = "Attribute (" + name + ") data type does not match the type provided : " + ranges_type2const::str; Except::throw_exception((const char *)API_IncompatibleAttrDataType, (const char *)err_msg.c_str(), (const char *)"WAttribute::get_min_value()"); } if (check_min_value == false) { Except::throw_exception((const char *)API_AttrNotAllowed, (const char *)"Minimum value not defined for this attribute", (const char *)"WAttribute::get_min_value()"); } memcpy((void *)&min_val,(void *)&min_value,sizeof(T)); } //+------------------------------------------------------------------------- // // method : WAttribute::set_max_value() // // description : Sets maximum value attribute property // Throws exception in case the data type of provided // property does not match the attribute data type // // in : new_max_value : The maximum value property to be set // //-------------------------------------------------------------------------- template void WAttribute::set_max_value(const T &new_max_value) { // // Check type validity // if((data_type == Tango::DEV_STRING) || (data_type == Tango::DEV_BOOLEAN) || (data_type == Tango::DEV_STATE)) throw_err_data_type("max_value",ext->d_name,"WAttribute::set_max_value()"); if (!(data_type == DEV_ENCODED && ranges_type2const::enu == DEV_UCHAR) && (data_type != ranges_type2const::enu)) { string err_msg = "Attribute (" + name + ") data type does not match the type provided : " + ranges_type2const::str; Except::throw_exception((const char *)API_IncompatibleAttrDataType, (const char *)err_msg.c_str(), (const char *)"WAttribute::set_max_value()"); } // // Check coherence with max_value // if(check_min_value) { T min_value_tmp; memcpy((void *) &min_value_tmp, (const void *) &min_value, sizeof(T)); if(new_max_value <= min_value_tmp) throw_incoherent_val_err("min_value","max_value",ext->d_name,"WAttribute::set_max_value()"); } // // Store new max value as a string // TangoSys_MemStream str; str.precision(TANGO_FLOAT_PRECISION); if(ranges_type2const::enu == Tango::DEV_UCHAR) str << (short)new_max_value; // to represent the numeric value else str << new_max_value; string max_value_tmp_str = str.str(); // // Get the monitor protecting device att config // If the server is in its starting phase, give a NULL ptr // to the AutoLock object // Tango::Util *tg = Tango::Util::instance(); Tango::TangoMonitor *mon_ptr = NULL; if (tg->is_svr_starting() == false && tg->is_device_restarting(ext->d_name) == false) mon_ptr = &(get_att_device()->get_att_conf_monitor()); AutoTangoMonitor sync1(mon_ptr); // // Store the new value locally // Attr_CheckVal old_max_value; memcpy((void *)&old_max_value, (void *)&max_value, sizeof(T)); memcpy((void *)&max_value, (void *)&new_max_value, sizeof(T)); // // Then, update database // Tango::DeviceClass *dev_class = get_att_device_class(ext->d_name); Tango::MultiClassAttribute *mca = dev_class->get_class_attr(); Tango::Attr &att = mca->get_attr(name); vector &def_user_prop = att.get_user_default_properties(); size_t nb_user = def_user_prop.size(); string usr_def_val; bool user_defaults = false; if (nb_user != 0) { size_t i; for (i = 0;i < nb_user;i++) { if (def_user_prop[i].get_name() == "max_value") break; } if (i != nb_user) // user defaults defined { user_defaults = true; usr_def_val = def_user_prop[i].get_value(); } } if (Tango::Util::_UseDb == true) { if(user_defaults && max_value_tmp_str == usr_def_val) { DbDatum attr_dd(name), prop_dd("max_value"); DbData db_data; db_data.push_back(attr_dd); db_data.push_back(prop_dd); bool retry = true; while (retry == true) { try { tg->get_database()->delete_device_attribute_property(ext->d_name,db_data); retry = false; } catch (CORBA::COMM_FAILURE) { tg->get_database()->reconnect(true); } } } else { try { upd_att_prop_db(max_value,"max_value"); } catch (Tango::DevFailed &) { memcpy((void *)&max_value, (void *)&old_max_value, sizeof(T)); throw; } } } // // Set the max_value flag // check_max_value = true; // // Store new value as a string // max_value_str = max_value_tmp_str; // // Push a att conf event // if (tg->is_svr_starting() == false && tg->is_device_restarting(ext->d_name) == false) get_att_device()->push_att_conf_event(this); // // Delete device startup exception related to max_value if there is any // delete_startup_exception("max_value"); } template <> inline void WAttribute::set_max_value(const Tango::DevEncoded &) { string err_msg = "Attribute properties cannot be set with Tango::DevEncoded data type"; Except::throw_exception((const char *)API_MethodArgument, (const char *)err_msg.c_str(), (const char *)"WAttribute::set_max_value()"); } template <> inline void WAttribute::set_max_value(const string &new_max_value_str) { if((data_type == Tango::DEV_STRING) || (data_type == Tango::DEV_BOOLEAN) || (data_type == Tango::DEV_STATE)) throw_err_data_type("max_value",ext->d_name,"WAttribute::set_max_value()"); string max_value_str_tmp = new_max_value_str; string dev_name = ext->d_name; Tango::DeviceClass *dev_class = get_att_device_class(ext->d_name); Tango::MultiClassAttribute *mca = dev_class->get_class_attr(); Tango::Attr &att = mca->get_attr(name); vector &def_user_prop = att.get_user_default_properties(); vector &def_class_prop = att.get_class_properties(); size_t nb_class = def_class_prop.size(); size_t nb_user = def_user_prop.size(); string usr_def_val; string class_def_val; bool user_defaults = false; bool class_defaults = false; user_defaults = prop_in_list("max_value",usr_def_val,nb_user,def_user_prop); class_defaults = prop_in_list("max_value",class_def_val,nb_class,def_class_prop); bool set_value = true; if (class_defaults) { if(TG_strcasecmp(new_max_value_str.c_str(),AlrmValueNotSpec) == 0) { set_value = false; avns_in_db("max_value",dev_name); avns_in_att(MAX_VALUE); } else if ((TG_strcasecmp(new_max_value_str.c_str(),NotANumber) == 0) || (TG_strcasecmp(new_max_value_str.c_str(),class_def_val.c_str()) == 0)) { max_value_str_tmp = class_def_val; } else if (strlen(new_max_value_str.c_str()) == 0) { if (user_defaults) { max_value_str_tmp = usr_def_val; } else { set_value = false; avns_in_db("max_value",dev_name); avns_in_att(MAX_VALUE); } } } else if(user_defaults) { if(TG_strcasecmp(new_max_value_str.c_str(),AlrmValueNotSpec) == 0) { set_value = false; avns_in_db("max_value",dev_name); avns_in_att(MAX_VALUE); } else if ((TG_strcasecmp(new_max_value_str.c_str(),NotANumber) == 0) || (TG_strcasecmp(new_max_value_str.c_str(),usr_def_val.c_str()) == 0) || (strlen(new_max_value_str.c_str()) == 0)) max_value_str_tmp = usr_def_val; } else { if ((TG_strcasecmp(new_max_value_str.c_str(),AlrmValueNotSpec) == 0) || (TG_strcasecmp(new_max_value_str.c_str(),NotANumber) == 0) || (strlen(new_max_value_str.c_str()) == 0)) { set_value = false; avns_in_db("max_value",dev_name); avns_in_att(MAX_VALUE); } } if(set_value) { if ((data_type != Tango::DEV_STRING) && (data_type != Tango::DEV_BOOLEAN) && (data_type != Tango::DEV_STATE)) { double db; float fl; TangoSys_MemStream str; str.precision(TANGO_FLOAT_PRECISION); str << max_value_str_tmp; switch (data_type) { case Tango::DEV_SHORT: if (!(str >> db && str.eof())) throw_err_format("max_value",dev_name,"WAttribute::set_max_value()"); set_max_value((DevShort)db); break; case Tango::DEV_LONG: if (!(str >> db && str.eof())) throw_err_format("max_value",dev_name,"WAttribute::set_max_value()"); set_max_value((DevLong)db); break; case Tango::DEV_LONG64: if (!(str >> db && str.eof())) throw_err_format("max_value",dev_name,"WAttribute::set_max_value()"); set_max_value((DevLong64)db); break; case Tango::DEV_DOUBLE: if (!(str >> db && str.eof())) throw_err_format("max_value",dev_name,"WAttribute::set_max_value()"); set_max_value(db); break; case Tango::DEV_FLOAT: if (!(str >> fl && str.eof())) throw_err_format("max_value",dev_name,"WAttribute::set_max_value()"); set_max_value(fl); break; case Tango::DEV_USHORT: if (!(str >> db && str.eof())) throw_err_format("max_value",dev_name,"WAttribute::set_max_value()"); (db < 0.0) ? set_max_value((DevUShort)(-db)) : set_max_value((DevUShort)db); break; case Tango::DEV_UCHAR: if (!(str >> db && str.eof())) throw_err_format("max_value",dev_name,"WAttribute::set_max_value()"); (db < 0.0) ? set_max_value((DevUChar)(-db)) : set_max_value((DevUChar)db); break; case Tango::DEV_ULONG: if (!(str >> db && str.eof())) throw_err_format("max_value",dev_name,"WAttribute::set_max_value()"); (db < 0.0) ? set_max_value((DevULong)(-db)) : set_max_value((DevULong)db); break; case Tango::DEV_ULONG64: if (!(str >> db && str.eof())) throw_err_format("max_value",dev_name,"WAttribute::set_max_value()"); (db < 0.0) ? set_max_value((DevULong64)(-db)) : set_max_value((DevULong64)db); break; case Tango::DEV_ENCODED: if (!(str >> db && str.eof())) throw_err_format("max_value",dev_name,"WAttribute::set_max_value()"); (db < 0.0) ? set_max_value((DevUChar)(-db)) : set_max_value((DevUChar)db); break; } } else throw_err_data_type("max_value",dev_name,"WAttribute::set_max_value()"); } } //+------------------------------------------------------------------------- // // method : WAttribute::get_max_value() // // description : Gets attribute's maximum value and assigns it // to the variable provided as a parameter // Throws exception in case the data type of provided // parameter does not match the attribute data type // or if maximum value is not defined // // in : max_val : The variable to be assigned the attribute's // maximum value // //-------------------------------------------------------------------------- template void WAttribute::get_max_value(T &max_val) { if (!(data_type == DEV_ENCODED && ranges_type2const::enu == DEV_UCHAR) && (data_type != ranges_type2const::enu)) { string err_msg = "Attribute (" + name + ") data type does not match the type provided : " + ranges_type2const::str; Except::throw_exception((const char *)API_IncompatibleAttrDataType, (const char *)err_msg.c_str(), (const char *)"WAttribute::get_max_value()"); } if (check_max_value == false) { Except::throw_exception((const char *)API_AttrNotAllowed, (const char *)"Minimum value not defined for this attribute", (const char *)"WAttribute::get_max_value()"); } memcpy((void *)&max_val,(void *)&max_value,sizeof(T)); } } // End of Tango namespace #endif // _WATTRIBUTE_TPP tango-8.1.2c+dfsg.orig/lib/cpp/server/pollthread.cpp0000644000175000017500000013012212205375142021273 0ustar piccapiccastatic const char *RcsId = "$Id: pollthread.cpp 22718 2013-05-28 15:22:40Z taurel $\n$Name$"; //+============================================================================ // // file : PollThread.cpp // // description : C++ source code for the PollThread class. // This class is used for the polling thread. The rule of // this thread is to regulary exceute command on device or // read attribute and store result in a ring buffer. // // project : TANGO // // author(s) : E.Taurel // // Copyright (C) : 2004,2005,2006,2007,2008,2009,2010,2011,2012,2013 // European Synchrotron Radiation Facility // BP 220, Grenoble 38043 // FRANCE // // This file is part of Tango. // // Tango 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. // // Tango 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 Tango. If not, see . // // $Revision: 22718 $ // //-============================================================================ #if HAVE_CONFIG_H #include #endif #include #include #include #ifdef _TG_WINDOWS_ #include #else #include #endif #include extern omni_thread::key_t key_py_data; namespace Tango { DeviceImpl *PollThread::dev_to_del = NULL; string PollThread::name_to_del = ""; PollObjType PollThread::type_to_del = Tango::POLL_CMD; //+------------------------------------------------------------------------- // // method : PollThread::Pollthread // // description : The polling thread constructor. // //-------------------------------------------------------------------------- PollThread::PollThread(PollThCmd &cmd,TangoMonitor &m,bool heartbeat): shared_cmd(cmd),p_mon(m), sleep(1),polling_stop(true), attr_names(1),tune_ctr(1), need_two_tuning(false),auto_upd(-1),send_heartbeat(heartbeat) { local_cmd.cmd_pending = false; attr_names.length(1); cci = 0; dummy_cl_id.cpp_clnt(cci); if (heartbeat == true) polling_stop = false; #ifdef _TG_WINDOWS_ LARGE_INTEGER f; BOOL is_ctr; is_ctr = QueryPerformanceFrequency(&f); if (is_ctr != 0) ctr_frequency = 1000000.0 / (double)f.QuadPart; else ctr_frequency = 0.0; #endif } //+------------------------------------------------------------------------- // // method : PollThread::run_undetached // // description : The polling thread main code // //-------------------------------------------------------------------------- void *PollThread::run_undetached(TANGO_UNUSED(void *ptr)) { PollCmdType received; bool per_thread_data_created = false; // // If the thread is the event heartbeat thread, // use it also for the storage of sub device properties. // Declare a work item to check the for new sub devices // regularly. // if ( send_heartbeat == true ) { WorkItem wo; wo.dev = NULL; wo.poll_list = NULL; wo.type = STORE_SUBDEV; wo.update = 30*60*1000; // check ervery 30 minutes wo.name = "Sub device property storage"; wo.needed_time.tv_sec = 0; wo.needed_time.tv_usec = 0; #ifdef _TG_WINDOWS_ _ftime(&now_win); now.tv_sec = (unsigned long)now_win.time; now.tv_usec = (long)now_win.millitm * 1000; #else gettimeofday(&now,NULL); #endif now.tv_sec = now.tv_sec - DELTA_T; wo.wake_up_date = now; insert_in_list(wo); } // // The infinite loop // while(1) { try { if (sleep != 0) received = get_command(sleep); else received = POLL_TIME_OUT; // // Create the per thread data if it is not already done (For Python DS) // if (per_thread_data_created == false) { omni_thread::self()->set_value(key_py_data,new PyData()); per_thread_data_created = true; } #ifdef _TG_WINDOWS_ _ftime(&now_win); now.tv_sec = (unsigned long)now_win.time; now.tv_usec = (long)now_win.millitm * 1000; #else gettimeofday(&now,NULL); #endif now.tv_sec = now.tv_sec - DELTA_T; switch (received) { case POLL_COMMAND: execute_cmd(); break; case POLL_TIME_OUT: one_more_poll(); break; case POLL_TRIGGER: one_more_trigg(); break; } #ifdef _TG_WINDOWS_ _ftime(&after_win); after.tv_sec = (unsigned long)after_win.time; after.tv_usec = (long)after_win.millitm * 1000; #else gettimeofday(&after,NULL); #endif after.tv_sec = after.tv_sec - DELTA_T; if (tune_ctr <= 0) { tune_list(true,0); if (need_two_tuning == true) { unsigned long nb_works = works.size(); tune_ctr = (nb_works << 2); need_two_tuning = false; } else tune_ctr = POLL_LOOP_NB; } compute_sleep_time(); } catch (omni_thread_fatal &) { cerr << "OUPS !! A omni thread fatal exception received by a polling thread !!!!!!!!" << endl; #ifndef _TG_WINDOWS_ time_t t = time(NULL); cerr << ctime(&t); #endif cerr << "Trying to re-enter the main loop" << endl; } catch (const std::exception &ex) { cerr << "OUPS !! An unforeseen standard exception has been received by a polling thread !!!!!!" << endl; cerr << ex.what() << endl; #ifndef _TG_WINDOWS_ time_t t = time(NULL); cerr << ctime(&t); #endif cerr << "Trying to re-enter the main loop" << endl; } } return NULL; } //+------------------------------------------------------------------------- // // method : PollThread::get_command // // description : This method wait on the shared monitor for a new // command to be sent to the polling thread. The // thread waits with a timeout. If the thread is // awaken due to the timeout, false is returned. // If the work list is empty, the thread waits for ever. // // argument : in : tout : The timeout in mS // // The method returns true if the thread has been awaken due to a new // command sent by the main thread // //-------------------------------------------------------------------------- PollCmdType PollThread::get_command(long tout) { omni_mutex_lock sync(p_mon); PollCmdType ret; // // Wait on monitor // if ((shared_cmd.cmd_pending == false) && (shared_cmd.trigger == false)) { if (works.empty() == true) p_mon.wait(); else { if (tout != -1) p_mon.wait(tout); } } // // Test if it is a new command. If yes, copy its data locally // if (shared_cmd.cmd_pending == true) { local_cmd = shared_cmd; ret = POLL_COMMAND; } else if (shared_cmd.trigger == true) { local_cmd = shared_cmd; ret = POLL_TRIGGER; } else ret = POLL_TIME_OUT; return ret; } //+------------------------------------------------------------------------- // // method : PollThread::execute_cmd and two unary predicates // // description : This method is called when a command has been received // It exceute the command! // //-------------------------------------------------------------------------- bool pred(const WorkItem &w) { if (w.dev == PollThread::dev_to_del) { if (w.type == PollThread::type_to_del) return w.name == PollThread::name_to_del; else return false; } else return false; } bool pred_dev(const WorkItem &w) { return w.dev == PollThread::dev_to_del; } void PollThread::execute_cmd() { WorkItem wo; list::iterator ite; vector::iterator et_ite; switch (local_cmd.cmd_code) { // // Add a new object // case Tango::POLL_ADD_OBJ : cout5 << "Received a Add object command" << endl; wo.dev = local_cmd.dev; wo.poll_list = &(wo.dev->get_poll_obj_list()); wo.type = (*wo.poll_list)[local_cmd.index]->get_type(); wo.update = (*wo.poll_list)[local_cmd.index]->get_upd(); wo.name = (*wo.poll_list)[local_cmd.index]->get_name().c_str(); wo.needed_time.tv_sec = 0; wo.needed_time.tv_usec = 0; if (wo.update != 0) { wo.wake_up_date = now; if (local_cmd.new_upd != 0) { cout5 << "Received a delta from now of " << local_cmd.new_upd << endl; T_ADD(wo.wake_up_date,local_cmd.new_upd * 1000); } // add_random_delay(wo.wake_up_date); insert_in_list(wo); unsigned long nb_works = works.size(); tune_ctr = (nb_works << 2); need_two_tuning = true; } else { wo.wake_up_date.tv_sec = 0; wo.wake_up_date.tv_usec = 0; ext_trig_works.push_back(wo); } break; // // Remove an already polled object // case Tango::POLL_REM_OBJ : cout5 << "Received a Rem object command" << endl; dev_to_del = local_cmd.dev; name_to_del = local_cmd.name; type_to_del = local_cmd.type; #ifdef _TG_WINDOWS_ unsigned int i,nb_elt; nb_elt = works.size(); ite = works.begin(); for (i = 0;i < nb_elt;i++) { if (ite->dev == PollThread::dev_to_del) { if (ite->type == PollThread::type_to_del) { if (ite->name == PollThread::name_to_del) { works.erase(ite); break; } } } ++ite; } #else works.remove_if(pred); #endif break; // // Remove an already externally triggered polled object // case Tango::POLL_REM_EXT_TRIG_OBJ : cout5 << "Received a Ext Trig Rem object command" << endl; for (et_ite = ext_trig_works.begin(); et_ite != ext_trig_works.end();++et_ite) { if (et_ite->dev == local_cmd.dev) { if (et_ite->type == local_cmd.type) { if (et_ite->name == local_cmd.name) { ext_trig_works.erase(et_ite); break; } } } } break; // // Remove all objects belonging to a device. // Take care, the same device could have several objects --> No break after // the successfull if in loop // case Tango::POLL_REM_DEV : cout5 << "Received a Rem device command" << endl; dev_to_del = local_cmd.dev; #ifdef _TG_WINDOWS_ nb_elt = works.size(); ite = works.begin(); for (i = 0;i < nb_elt;i++) { if (ite->dev == PollThread::dev_to_del) { ite = works.erase(ite); } else ++ite; } nb_elt = ext_trig_works.size(); et_ite = ext_trig_works.begin(); for (i = 0;i < nb_elt;i++) { if (et_ite->dev == PollThread::dev_to_del) { et_ite = ext_trig_works.erase(et_ite); } else ++et_ite; } #else works.remove_if(pred_dev); ext_trig_works.erase(remove_if(ext_trig_works.begin(), ext_trig_works.end(), pred_dev), ext_trig_works.end()); #endif break; // // Update polling period // Several cases has to be implemented here. // 1 - A classical command from the external world. In this case updating // polling period means removing the already inserted object from the work list, // compute its new polling time and insert it in the work list with its new // polling time and polling period // 2 - This is executed by the polling thread itself // 2-1 - The command updates polling period for another object: idem than previous // 2-2 - The commands updates polling period for the object it is actually polled. // In this case, the object is not in the work list. It has been removed from the // work list at the beginning of the "one_more_poll" method and is memorized there // Therefore, simply stores new polling period in a data member. The "one_more_poll" // method will get its new polling period before re-inserting the object in the work // list with the new update period. // We detect this case because the object is not in any work list (either the work // list or the trigger list) // case Tango::POLL_UPD_PERIOD : cout5 << "Received a update polling period command" << endl; dev_to_del = local_cmd.dev; name_to_del = local_cmd.name; type_to_del = local_cmd.type; ite = find_if(works.begin(),works.end(),pred); if (ite != works.end()) { if (local_cmd.new_upd != 0) { WorkItem tmp_work = *ite; #ifdef _TG_WINDOWS_ unsigned int i,nb_elt; nb_elt = works.size(); ite = works.begin(); for (i = 0;i < nb_elt;i++) { if (ite->dev == PollThread::dev_to_del) { if (ite->type == PollThread::type_to_del) { if (ite->name == PollThread::name_to_del) { works.erase(ite); break; } } } ++ite; } #else works.remove_if(pred); #endif tmp_work.update = local_cmd.new_upd; compute_new_date(now,local_cmd.new_upd); tmp_work.wake_up_date = now; insert_in_list(tmp_work); tune_ctr = 0; } else { // // First, remove object from polling list and insert it in externally // triggered list // #ifdef _TG_WINDOWS_ unsigned int i,nb_elt; nb_elt = works.size(); ite = works.begin(); for (i = 0;i < nb_elt;i++) { if (ite->dev == PollThread::dev_to_del) { if (ite->type == PollThread::type_to_del) { if (ite->name == PollThread::name_to_del) { works.erase(ite); break; } } } ++ite; } #else works.remove_if(pred); #endif wo.dev = local_cmd.dev; wo.poll_list = &(wo.dev->get_poll_obj_list()); wo.type = (*wo.poll_list)[local_cmd.index]->get_type(); wo.update = (*wo.poll_list)[local_cmd.index]->get_upd(); wo.name = (*wo.poll_list)[local_cmd.index]->get_name().c_str(); wo.wake_up_date.tv_sec = 0; wo.wake_up_date.tv_usec = 0; ext_trig_works.push_back(wo); } } else { // // If not found in work list, it should be in the externally // triggered object. Therefore, remove it from externally // triggered list and insert it in work list // If not found in work list and in trig list, we are in case // 2-2 as desribed above (polling thread updateing itself polling // period of the object it actually polls) // bool found = false; for (et_ite = ext_trig_works.begin(); et_ite != ext_trig_works.end();++et_ite) { if (et_ite->dev == local_cmd.dev) { if (et_ite->type == local_cmd.type) { if (et_ite->name == local_cmd.name) { ext_trig_works.erase(et_ite); found = true; break; } } } } if (found == true) { wo.dev = local_cmd.dev; wo.poll_list = &(wo.dev->get_poll_obj_list()); wo.type = type_to_del; wo.update = local_cmd.new_upd; wo.name = name_to_del; wo.wake_up_date = now; insert_in_list(wo); } else auto_upd = local_cmd.new_upd; } break; // // Add the event heartbeat every 9 seconds // case Tango::POLL_ADD_HEARTBEAT: cout5 << "Received a add heartbeat command" << endl; wo.dev = NULL; wo.poll_list = NULL; wo.type = EVENT_HEARTBEAT; wo.update = 9000; wo.name = "Event heartbeat"; wo.needed_time.tv_sec = 0; wo.needed_time.tv_usec = TIME_HEARTBEAT; wo.wake_up_date = now; insert_in_list(wo); break; // // Remove the event heartbeat // case Tango::POLL_REM_HEARTBEAT: cout5 << "Received a remove heartbeat command" << endl; unsigned int ii,nb_elem; nb_elem = works.size(); ite = works.begin(); for (ii = 0;ii < nb_elem;ii++) { if (ite->type == EVENT_HEARTBEAT) { works.erase(ite); break; } ++ite; } break; // // Start polling // case Tango::POLL_START : cout5 << "Received a Start polling command" << endl; polling_stop = false; break; // // Stop polling // case Tango::POLL_STOP : cout5 << "Received a Stop polling command" << endl; polling_stop = true; break; // // Ask polling thread to exit // case Tango::POLL_EXIT : cout5 << "Received an exit command" << endl; omni_thread::exit(); break; } // // Inform requesting thread that the work is done // { omni_mutex_lock sync(p_mon); shared_cmd.cmd_pending = false; p_mon.signal(); } if (Tango::Util::_tracelevel >= 4) print_list(); } //+------------------------------------------------------------------------- // // method : PollThread::add_random_delay // // description : Add a random number of microsecond (between 0 and // 500000) in order to spread the date where polling // should happens. This is necessary especially at device // process startup when each command in send to the // polling thread in a loop // // argument : in : t : The timeval structure reference // //-------------------------------------------------------------------------- void PollThread::add_random_delay(struct timeval &t) { long add_usec; add_usec = (long)(500000. * (float)rand() / (float)RAND_MAX); t.tv_usec = t.tv_usec + add_usec; if (t.tv_usec >= 1000000) { t.tv_sec++; t.tv_usec = t.tv_usec - 1000000; } } //+------------------------------------------------------------------------- // // method : PollThread::one_more_poll // // description : // // argument : in : // //-------------------------------------------------------------------------- void PollThread::one_more_poll() { WorkItem tmp = works.front(); works.pop_front(); if (polling_stop == false) { switch (tmp.type) { case Tango::POLL_CMD: poll_cmd(tmp); break; case Tango::POLL_ATTR: poll_attr(tmp); break; case Tango::EVENT_HEARTBEAT: eve_heartbeat(); break; case Tango::STORE_SUBDEV: store_subdev(); break; } } // // For case where the polling thread itself modify the polling // period of the object it already polls // if (auto_upd != -1) { tmp.update = auto_upd; auto_upd = -1; } // // Compute new polling date and insert work in list // compute_new_date(tmp.wake_up_date,tmp.update); insert_in_list(tmp); tune_ctr--; } //+------------------------------------------------------------------------- // // method : PollThread::one_more_trigg // // description : This method is called when a trigger command has been // received // //-------------------------------------------------------------------------- void PollThread::one_more_trigg() { cout5 << "Polling thread has received a trigger" << endl; // // Check that the object is registered // dev_to_del = local_cmd.dev; name_to_del = local_cmd.name; type_to_del = local_cmd.type; vector::iterator et_ite; et_ite = find_if(ext_trig_works.begin(),ext_trig_works.end(),pred); // // Check that the object to poll has been installed. // If not, simply returns. This case should never happens because it is // tested in the Util::trigger_polling() method before the trigger is // effectively sent to this thread. // if (et_ite == ext_trig_works.end()) { cout5 << "Object externally triggered not found !!!" << endl; { omni_mutex_lock sync(p_mon); shared_cmd.trigger = false; p_mon.signal(); } return; } // // Do the job // WorkItem tmp = *et_ite; if (polling_stop == false) { if (tmp.type == Tango::POLL_CMD) poll_cmd(tmp); else poll_attr(tmp); } // // Inform requesting thread that the work is done // { omni_mutex_lock sync(p_mon); shared_cmd.trigger = false; p_mon.signal(); } } //+------------------------------------------------------------------------- // // method : PollThread::print_list // // description : To print work list // //-------------------------------------------------------------------------- void PollThread::print_list() { list::iterator ite; long nb_elt,i; nb_elt = works.size(); ite = works.begin(); for (i = 0;i < nb_elt;i++) { if (ite->type != EVENT_HEARTBEAT ) { if ( ite->type != STORE_SUBDEV) { cout4 << "Dev name = " << ite->dev->get_name() << ", obj name = " << ite->name << ", next wake_up at " << + ite->wake_up_date.tv_sec << "," << setw(6) << setfill('0') << ite->wake_up_date.tv_usec << endl; } else { cout4 << ite->name << ", next wake_up at " << + ite->wake_up_date.tv_sec << "," << setw(6) << setfill('0') << ite->wake_up_date.tv_usec << endl; } } else { cout4 << "Event heartbeat, next wake_up at " << + ite->wake_up_date.tv_sec << "," << setw(6) << setfill('0') << ite->wake_up_date.tv_usec << endl; } ++ite; } } //+------------------------------------------------------------------------- // // method : PollThread::insert_in_list // // description : To insert (at the correct place) a new Work Item in // the work list // // argument: In : - new_work : The new work item // //-------------------------------------------------------------------------- void PollThread::insert_in_list(WorkItem &new_work) { list::iterator ite; for (ite = works.begin();ite != works.end();++ite) { if (ite->wake_up_date.tv_sec < new_work.wake_up_date.tv_sec) continue; else if (ite->wake_up_date.tv_sec == new_work.wake_up_date.tv_sec) { if (ite->wake_up_date.tv_usec < new_work.wake_up_date.tv_usec) continue; else { works.insert(ite,new_work); return; } } else { works.insert(ite,new_work); return; } } if (ite == works.end()) works.push_back(new_work); } //+------------------------------------------------------------------------- // // method : PollThread::tune_list // // description : This method tunes the work list. // // argument: In : - from_needed : Set to true if the delta between // work should be at least equal to the // time needed to execute the previous work // - min_delta : Min. delta between polling works // when from_needed is false // //-------------------------------------------------------------------------- void PollThread::tune_list(bool from_needed, long min_delta) { list::iterator ite,ite_next,ite_prev; unsigned long nb_works = works.size(); cout4 << "Entering tuning list. The list has " << nb_works << " item(s)" << endl; // // Nothing to do if only one let in list // if (nb_works < 2) return; // // If we try to tune the list with respect to works needed // time, compute works needed time sum and find minimun update // period // if (from_needed == true) { unsigned long needed_sum = 0; unsigned long min_upd = 0; long max_delta_needed; for (ite = works.begin();ite != works.end();++ite) { long needed_time_usec = (ite->needed_time.tv_sec * 1000000) + ite->needed_time.tv_usec; needed_sum = needed_sum + (unsigned long)needed_time_usec; unsigned long update_usec = (unsigned long)ite->update * 1000; if (ite == works.begin()) { min_upd = update_usec; } else { if (min_upd > update_usec) min_upd = update_usec; } } // // In some cases, it is impossible to tune // if (needed_sum > min_upd) return; else { long sleeping = min_upd - needed_sum; max_delta_needed = sleeping / (nb_works); } // // Now build a new tuned list // Warning: On Windows 64 bits, long are 32 bits data. Convert everything to DevULong64 to be sure // that we will have computation on unsigned 64 bits data // // To tune the list // - Take obj j and compute when it should be polled (next_work) // - Compute when object j-1 should be polled (prev_obj_work) // - Compute the number of poll between these two dates (n) // - Compute date of previous object polling just before "next_work" // - Assign next_work to this date and add // the time needed to execute previous object polling // the delta computed from the smallest upd and the obj number // Tango::DevULong64 now_us = ((Tango::DevULong64)now.tv_sec * 1000000LL) + (Tango::DevULong64)now.tv_usec; Tango::DevULong64 next_tuning = now_us + (POLL_LOOP_NB * (Tango::DevULong64)min_upd); list new_works; new_works.push_front(works.front()); ite = works.begin(); ite_prev = new_works.begin(); for (++ite;ite != works.end();++ite,++ite_prev) { Tango::DevULong64 needed_time_usec = ((Tango::DevULong64)ite_prev->needed_time.tv_sec * 1000000) + (Tango::DevULong64)ite_prev->needed_time.tv_usec; WorkItem wo = *ite; Tango::DevULong64 next_work = ((Tango::DevULong64)wo.wake_up_date.tv_sec * 1000000LL) + (Tango::DevULong64)wo.wake_up_date.tv_usec; if (next_work < next_tuning) { Tango::DevULong64 prev_obj_work = ((Tango::DevULong64)ite_prev->wake_up_date.tv_sec * 1000000LL) + (Tango::DevULong64)ite_prev->wake_up_date.tv_usec; Tango::DevULong64 n = (next_work - prev_obj_work) / ((Tango::DevULong64)ite_prev->update * 1000LL); Tango::DevULong64 next_prev = prev_obj_work + (n * (ite_prev->update * 1000LL)); wo.wake_up_date.tv_sec = (long)(next_prev / 1000000LL); wo.wake_up_date.tv_usec = (long)(next_prev % 1000000LL); T_ADD(wo.wake_up_date,needed_time_usec + max_delta_needed); } new_works.push_back(wo); } // // Replace work list // works = new_works; } else { ite_next = works.begin(); ite = ite_next; ++ite_next; for (unsigned int i = 1;i < nb_works;i++) { long diff; T_DIFF(ite->wake_up_date,ite_next->wake_up_date,diff); // // If delta time between works is less than min, // shift following work // if (diff < min_delta) T_ADD(ite_next->wake_up_date,min_delta - diff); ++ite; ++ite_next; } } cout4 << "Tuning list done" << endl; print_list(); } //+------------------------------------------------------------------------- // // method : PollThread::compute_new_date // // description : This method computes the new poll date. // // argument: In : - time : The actual date // - upd : The polling update period (mS) // //-------------------------------------------------------------------------- void PollThread::compute_new_date(struct timeval &time,int upd) { double ori_d = (double)time.tv_sec + ((double)time.tv_usec / 1000000); double new_d = ori_d + ((double)(upd) / 1000); time.tv_sec = (long)new_d; time.tv_usec = (long)((new_d - time.tv_sec) * 1000000); } void PollThread::time_diff(struct timeval &before, struct timeval &after_t, struct timeval &result) { double bef_d = (double)before.tv_sec + ((double)before.tv_usec / 1000000); double aft_d = (double)after_t.tv_sec + ((double)after_t.tv_usec / 1000000); double diff_d = aft_d - bef_d; result.tv_sec = (long)diff_d; result.tv_usec = (long)((diff_d - result.tv_sec) * 1000000); } //+------------------------------------------------------------------------- // // method : PollThread::compute_sleep_time // // description : This method computes how many mS the thread should // sleep before the next poll time. If this time is // negative and greater than a pre-defined threshold, // the polling is discarded. // //-------------------------------------------------------------------------- void PollThread::compute_sleep_time() { print_list(); if (works.empty() == false) { double next,after_d,diff; next = (double)works.front().wake_up_date.tv_sec + ((double)works.front().wake_up_date.tv_usec / 1000000); after_d = (double)after.tv_sec + ((double)after.tv_usec / 1000000); diff = next - after_d; if (diff < 0) { if (fabs(diff) < DISCARD_THRESHOLD) sleep = -1; else { while((diff < 0) && (fabs(diff) > DISCARD_THRESHOLD)) { cout5 << "Discard one elt !!!!!!!!!!!!!" << endl; WorkItem tmp = works.front(); if (tmp.type == POLL_ATTR) err_out_of_sync(tmp); compute_new_date(tmp.wake_up_date,tmp.update); insert_in_list(tmp); works.pop_front(); tune_ctr--; next = (double)works.front().wake_up_date.tv_sec + ((double)works.front().wake_up_date.tv_usec / 1000000); diff = next - after_d; } if (fabs(diff) < DISCARD_THRESHOLD) sleep = -1; else sleep = (long)(diff * 1000); } } else sleep = (long)(diff * 1000); cout5 << "Sleep for : " << sleep << endl; } } //+------------------------------------------------------------------------- // // method : PollThread::err_out_of_sync // // description : To force one event if the polling thread has // discarded one work item because it is late // // argument : in : - to_do : The work item // //-------------------------------------------------------------------------- void PollThread::err_out_of_sync(WorkItem &to_do) { EventSupplier *event_supplier_nd = NULL; EventSupplier *event_supplier_zmq = NULL; // // Retrieve the event supplier(s) for this attribute // Attribute &att = to_do.dev->get_device_attr()->get_attr_by_name(to_do.name.c_str()); if (att.use_notifd_event() == true) event_supplier_nd = Util::instance()->get_notifd_event_supplier(); if (att.use_zmq_event() == true) event_supplier_zmq = Util::instance()->get_zmq_event_supplier(); if ((event_supplier_nd != NULL) || (event_supplier_zmq != NULL)) { Tango::DevErrorList errs; errs.length(1); errs[0].severity = Tango::ERR; errs[0].reason = CORBA::string_dup("API_PollThreadOutOfSync"); errs[0].origin = CORBA::string_dup("PollThread::err_out_of_sync"); errs[0].desc = CORBA::string_dup("The polling thread is late and discard this object polling.\nAdvice: Tune device server polling"); Tango::DevFailed except(errs); long idl_vers = to_do.dev->get_dev_idl_version(); struct EventSupplier::AttributeData ad; ::memset(&ad,0,sizeof(ad)); if (idl_vers > 3) ad.attr_val_4 = &dummy_att4; else if (idl_vers == 3) ad.attr_val_3 = &dummy_att3; else ad.attr_val = &dummy_att; // // Fire event // SendEventType send_event; if (event_supplier_nd != NULL) send_event = event_supplier_nd->detect_and_push_events(to_do.dev,ad,&except,to_do.name,(struct timeval *)NULL); if (event_supplier_zmq != NULL) { if (event_supplier_nd != NULL) { vector f_names; vector f_data; vector f_names_lg; vector f_data_lg; if (send_event.change == true) event_supplier_zmq->push_event(to_do.dev,"change",f_names,f_data,f_names_lg,f_data_lg,ad,to_do.name,&except); if (send_event.archive == true) event_supplier_zmq->push_event(to_do.dev,"archive",f_names,f_data,f_names_lg,f_data_lg,ad,to_do.name,&except); if (send_event.periodic == true) event_supplier_zmq->push_event(to_do.dev,"periodic",f_names,f_data,f_names_lg,f_data_lg,ad,to_do.name,&except); } else event_supplier_zmq->detect_and_push_events(to_do.dev,ad,&except,to_do.name,(struct timeval *)NULL); } } } //+------------------------------------------------------------------------- // // method : PollThread::poll_cmd // // description : Execute a command and store the result in the device // ring buffer // // argument : in : - to_do : The work item // //-------------------------------------------------------------------------- void PollThread::poll_cmd(WorkItem &to_do) { cout5 << "----------> Time = " << now.tv_sec << "," << setw(6) << setfill('0') << now.tv_usec << " Dev name = " << to_do.dev->get_name() << ", Cmd name = " << to_do.name << endl; CORBA::Any *argout = NULL; Tango::DevFailed *save_except = NULL; struct timeval before_cmd,after_cmd,needed_time; #ifdef _TG_WINDOWS_ struct _timeb before_win,after_win; LARGE_INTEGER before,after; #endif vector::iterator ite; bool cmd_failed = false; try { #ifdef _TG_WINDOWS_ if (ctr_frequency != 0) QueryPerformanceCounter(&before); _ftime(&before_win); before_cmd.tv_sec = (unsigned long)before_win.time; before_cmd.tv_usec = (long)before_win.millitm * 1000; #else gettimeofday(&before_cmd,NULL); #endif before_cmd.tv_sec = before_cmd.tv_sec - DELTA_T; // // Execute the command // argout = to_do.dev->command_inout(to_do.name.c_str(),in_any); #ifdef _TG_WINDOWS_ if (ctr_frequency != 0) { QueryPerformanceCounter(&after); needed_time.tv_sec = 0; needed_time.tv_usec = (long)((double)(after.QuadPart - before.QuadPart) * ctr_frequency); to_do.needed_time = needed_time; } else { _ftime(&after_win); after_cmd.tv_sec = (unsigned long)after_win.time; after_cmd.tv_usec = (long)after_win.millitm * 1000; after_cmd.tv_sec = after_cmd.tv_sec - DELTA_T; time_diff(before_cmd,after_cmd,needed_time); to_do.needed_time = needed_time; } #else gettimeofday(&after_cmd,NULL); after_cmd.tv_sec = after_cmd.tv_sec - DELTA_T; time_diff(before_cmd,after_cmd,needed_time); to_do.needed_time = needed_time; #endif } catch (Tango::DevFailed &e) { cmd_failed = true; #ifdef _TG_WINDOWS_ if (ctr_frequency != 0) { QueryPerformanceCounter(&after); needed_time.tv_sec = 0; needed_time.tv_usec = (long)((double)(after.QuadPart - before.QuadPart) * ctr_frequency); to_do.needed_time = needed_time; } else { _ftime(&after_win); after_cmd.tv_sec = (unsigned long)after_win.time; after_cmd.tv_usec = (long)after_win.millitm * 1000; after_cmd.tv_sec = after_cmd.tv_sec - DELTA_T; time_diff(before_cmd,after_cmd,needed_time); to_do.needed_time = needed_time; } #else gettimeofday(&after_cmd,NULL); after_cmd.tv_sec = after_cmd.tv_sec - DELTA_T; time_diff(before_cmd,after_cmd,needed_time); to_do.needed_time = needed_time; #endif save_except = new Tango::DevFailed(e); } // // Insert result in polling buffer and simply forget this command if it is // not possible to insert the result in polling buffer // try { to_do.dev->get_poll_monitor().get_monitor(); ite = to_do.dev->get_polled_obj_by_type_name(to_do.type,to_do.name); if (cmd_failed == false) (*ite)->insert_data(argout,before_cmd,needed_time); else (*ite)->insert_except(save_except,before_cmd,needed_time); to_do.dev->get_poll_monitor().rel_monitor(); } catch (Tango::DevFailed &) { if (cmd_failed == false) delete argout; else delete save_except; to_do.dev->get_poll_monitor().rel_monitor(); } } //+------------------------------------------------------------------------- // // method : PollThread::poll_attr // // description : Read attribute and store the result in the device // ring buffer // // argument : in : - to_do : The work item // //-------------------------------------------------------------------------- void PollThread::poll_attr(WorkItem &to_do) { cout5 << "----------> Time = " << now.tv_sec << "," << setw(6) << setfill('0') << now.tv_usec << " Dev name = " << to_do.dev->get_name() << ", Attr name = " << to_do.name << endl; struct timeval before_cmd,after_cmd,needed_time; #ifdef _TG_WINDOWS_ struct _timeb before_win,after_win; LARGE_INTEGER before,after; #endif Tango::AttributeValueList *argout = NULL; Tango::AttributeValueList_3 *argout_3 = NULL; Tango::AttributeValueList_4 *argout_4 = NULL; Tango::DevFailed *save_except = NULL; bool attr_failed = false; vector::iterator ite; long idl_vers = to_do.dev->get_dev_idl_version(); try { #ifdef _TG_WINDOWS_ if (ctr_frequency != 0) QueryPerformanceCounter(&before); _ftime(&before_win); before_cmd.tv_sec = (unsigned long)before_win.time; before_cmd.tv_usec = (long)before_win.millitm * 1000; #else gettimeofday(&before_cmd,NULL); #endif before_cmd.tv_sec = before_cmd.tv_sec - DELTA_T; // // Read the attributes // attr_names[0] = to_do.name.c_str(); if (idl_vers >= 4) argout_4 = (static_cast(to_do.dev))->read_attributes_4(attr_names,Tango::DEV,dummy_cl_id); else if (idl_vers == 3) argout_3 = (static_cast(to_do.dev))->read_attributes_3(attr_names,Tango::DEV); else argout = to_do.dev->read_attributes(attr_names); #ifdef _TG_WINDOWS_ if (ctr_frequency != 0) { QueryPerformanceCounter(&after); needed_time.tv_sec = 0; needed_time.tv_usec = (long)((double)(after.QuadPart - before.QuadPart) * ctr_frequency); to_do.needed_time = needed_time; } else { _ftime(&after_win); after_cmd.tv_sec = (unsigned long)after_win.time; after_cmd.tv_usec = (long)after_win.millitm * 1000; after_cmd.tv_sec = after_cmd.tv_sec - DELTA_T; time_diff(before_cmd,after_cmd,needed_time); to_do.needed_time = needed_time; } #else gettimeofday(&after_cmd,NULL); after_cmd.tv_sec = after_cmd.tv_sec - DELTA_T; time_diff(before_cmd,after_cmd,needed_time); to_do.needed_time = needed_time; #endif } catch (Tango::DevFailed &e) { attr_failed = true; #ifdef _TG_WINDOWS_ if (ctr_frequency != 0) { QueryPerformanceCounter(&after); needed_time.tv_sec = 0; needed_time.tv_usec = (long)((double)(after.QuadPart - before.QuadPart) * ctr_frequency); to_do.needed_time = needed_time; } else { _ftime(&after_win); after_cmd.tv_sec = (unsigned long)after_win.time; after_cmd.tv_usec = (long)after_win.millitm * 1000; after_cmd.tv_sec = after_cmd.tv_sec - DELTA_T; time_diff(before_cmd,after_cmd,needed_time); to_do.needed_time = needed_time; } #else gettimeofday(&after_cmd,NULL); after_cmd.tv_sec = after_cmd.tv_sec - DELTA_T; time_diff(before_cmd,after_cmd,needed_time); to_do.needed_time = needed_time; #endif save_except = new Tango::DevFailed(e); } // // Starting with IDl release 3, an attribute in error is not an exception // any more. Re-create one. // Don't forget that it is still possible to receive classical exception // (in case of Monitor timeout for instance) // if (idl_vers >= 3) { if (idl_vers == 4) { if ((attr_failed == false) && ((*argout_4)[0].err_list.length() != 0)) { attr_failed = true; save_except = new Tango::DevFailed((*argout_4)[0].err_list); delete argout_4; } } else { if ((attr_failed == false) && ((*argout_3)[0].err_list.length() != 0)) { attr_failed = true; save_except = new Tango::DevFailed((*argout_3)[0].err_list); delete argout_3; } } } // // Events - for each event call the detect_and_push() method // this method will fire events if there are clients registered // and if there is an event (on_change, on_alarm or periodic) // We also have to retrieve which kind of clients made the // subscription (zmq or notifd) and send the event accordingly // EventSupplier *event_supplier_nd = NULL; EventSupplier *event_supplier_zmq = NULL; Attribute &att = to_do.dev->get_device_attr()->get_attr_by_name(to_do.name.c_str()); if (att.use_notifd_event() == true) event_supplier_nd = Util::instance()->get_notifd_event_supplier(); if (att.use_zmq_event() == true) event_supplier_zmq = Util::instance()->get_zmq_event_supplier(); if ((event_supplier_nd != NULL) || (event_supplier_zmq != NULL)) { if (attr_failed == true) { struct EventSupplier::AttributeData ad; ::memset(&ad,0,sizeof(ad)); if (idl_vers > 3) ad.attr_val_4 = &dummy_att4; else if (idl_vers == 3) ad.attr_val_3 = &dummy_att3; else ad.attr_val = &dummy_att; // // Eventually push the event (if detected) // When we have both notifd and zmq event supplier, do not detect the event // two times. The detect_and_push_events() method returns true if the event // is detected. // SendEventType send_event; if (event_supplier_nd != NULL) send_event = event_supplier_nd->detect_and_push_events(to_do.dev,ad,save_except,to_do.name,&before_cmd); if (event_supplier_zmq != NULL) { if (event_supplier_nd != NULL) { vector f_names; vector f_data; vector f_names_lg; vector f_data_lg; if (send_event.change == true) event_supplier_zmq->push_event(to_do.dev,"change",f_names,f_data,f_names_lg,f_data_lg,ad,to_do.name,save_except); if (send_event.archive == true) event_supplier_zmq->push_event(to_do.dev,"archive",f_names,f_data,f_names_lg,f_data_lg,ad,to_do.name,save_except); if (send_event.periodic == true) event_supplier_zmq->push_event(to_do.dev,"periodic",f_names,f_data,f_names_lg,f_data_lg,ad,to_do.name,save_except); } else event_supplier_zmq->detect_and_push_events(to_do.dev,ad,save_except,to_do.name,&before_cmd); } } else { struct EventSupplier::AttributeData ad; ::memset(&ad,0,sizeof(ad)); if (idl_vers > 3) ad.attr_val_4 = &((*argout_4)[0]); else if (idl_vers == 3) ad.attr_val_3 = &((*argout_3)[0]); else ad.attr_val = &((*argout)[0]); // // Eventually push the event (if detected) // When we have both notifd and zmq event supplier, do not detect the event // two times. The detect_and_push_events() method returns true if the event // is detected. // SendEventType send_event; if (event_supplier_nd != NULL) send_event = event_supplier_nd->detect_and_push_events(to_do.dev,ad,save_except,to_do.name,&before_cmd); if (event_supplier_zmq != NULL) { if (event_supplier_nd != NULL) { vector f_names; vector f_data; vector f_names_lg; vector f_data_lg; if (send_event.change == true) event_supplier_zmq->push_event(to_do.dev,"change",f_names,f_data,f_names_lg,f_data_lg,ad,to_do.name,save_except); if (send_event.periodic == true) event_supplier_zmq->push_event(to_do.dev,"periodic",f_names,f_data,f_names_lg,f_data_lg,ad,to_do.name,save_except); if (send_event.archive == true) event_supplier_zmq->push_event(to_do.dev,"archive",f_names,f_data,f_names_lg,f_data_lg,ad,to_do.name,save_except); } else event_supplier_zmq->detect_and_push_events(to_do.dev,ad,save_except,to_do.name,&before_cmd); } } // // Heartbeat - check to see if it is time to send a heartbeat event // if (send_heartbeat == true) { if (event_supplier_nd != NULL) event_supplier_nd->push_heartbeat_event(); if (event_supplier_zmq != NULL) event_supplier_zmq->push_heartbeat_event(); } } // // Insert result in polling buffer and simply forget this attribute if it is // not possible to insert the result in polling buffer // try { to_do.dev->get_poll_monitor().get_monitor(); ite = to_do.dev->get_polled_obj_by_type_name(to_do.type,to_do.name); if (attr_failed == false) { if (idl_vers >= 4) (*ite)->insert_data(argout_4,before_cmd,needed_time); else if (idl_vers == 3) (*ite)->insert_data(argout_3,before_cmd,needed_time); else (*ite)->insert_data(argout,before_cmd,needed_time); } else (*ite)->insert_except(save_except,before_cmd,needed_time); to_do.dev->get_poll_monitor().rel_monitor(); } catch (Tango::DevFailed &) { if (attr_failed == false) { if (idl_vers >= 4) delete argout_4; else if (idl_vers == 3) delete argout_3; else delete argout; } else delete save_except; to_do.dev->get_poll_monitor().rel_monitor(); } } //+------------------------------------------------------------------------- // // method : PollThread::eve_heartbeat // // description : Send the event heartbeat // // argument : in : - to_do : The work item // //-------------------------------------------------------------------------- void PollThread::eve_heartbeat() { cout5 << "----------> Time = " << now.tv_sec << "," << setw(6) << setfill('0') << now.tv_usec << " Sending event heartbeat" << endl; EventSupplier *event_supplier; event_supplier = Util::instance()->get_zmq_event_supplier(); if ((event_supplier != NULL) && (send_heartbeat == true) && (event_supplier->get_one_subscription_cmd() == true)) { event_supplier->push_heartbeat_event(); } event_supplier = Util::instance()->get_notifd_event_supplier(); if ((event_supplier != NULL) && (send_heartbeat == true) && (event_supplier->get_one_subscription_cmd() == true)) { event_supplier->push_heartbeat_event(); } } //+------------------------------------------------------------------------- // // method : PollThread::store_subdev // // description : Store the sub device properties when // needed. // // argument : in : - to_do : The work item // //-------------------------------------------------------------------------- void PollThread::store_subdev() { static bool ignore_call = true; cout5 << "----------> Time = " << now.tv_sec << "," << setw(6) << setfill('0') << now.tv_usec << " Store sub device property data if needed!" << endl; if ( !ignore_call ) { Tango::Util *tg = Tango::Util::instance(); tg->get_sub_dev_diag().store_sub_devices(); } else { // ignore the first call to avoid storage during // device server start-up. ignore_call = false; } } } // End of Tango namespace tango-8.1.2c+dfsg.orig/lib/cpp/server/tangoappender.h0000644000175000017500000000372512205375142021441 0ustar piccapicca/* * tangoappender.h * * by NL - SOLEIL - 09/2002. * * Copyright (C) : 2004,2005,2006,2007,2008,2009,2010,2011,2012,2013 * European Synchrotron Radiation Facility * BP 220, Grenoble 38043 * FRANCE * * This file is part of Tango. * * Tango 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. * * Tango 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 Tango. If not, see . * * $Revision: 22213 $ * */ #ifndef _TANGO_APPENDER_H_ #define _TANGO_APPENDER_H_ #ifdef TANGO_HAS_LOG4TANGO namespace Tango { class TangoAppender : public log4tango::Appender { public: /** * **/ TangoAppender (const std::string& src_name, const std::string& name, const std::string& dev_name, bool open_connection = true); /** * **/ virtual ~TangoAppender (); /** * **/ virtual bool requires_layout (void) const; /** * **/ virtual void set_layout(log4tango::Layout* layout); /** * **/ virtual void close (void); /** * **/ virtual bool reopen (void); /** * **/ virtual bool is_valid (void) const; protected: /** * **/ virtual int _append (const log4tango::LoggingEvent& event); private: /** * **/ const std::string _dev_name; /** * **/ const std::string _src_name; /** * **/ DeviceProxy *_dev_proxy; }; } // namespace tango #endif // _TANGO_APPENDER_H_ #endif // TANGO_HAS_LOG4TANGO tango-8.1.2c+dfsg.orig/lib/cpp/server/tango_config.h0000644000175000017500000001603212205375142021242 0ustar piccapicca//============================================================================= // // file : Tango_config.h // // description : Include file where all the system dependant types // are defined. // // project : TANGO // // author(s) : A.Gotz + E.Taurel // // Copyright (C) : 2004,2005,2006,2007,2008,2009,2010,2011,2012,2013 // European Synchrotron Radiation Facility // BP 220, Grenoble 38043 // FRANCE // // This file is part of Tango. // // Tango 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. // // Tango 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 Tango. If not, see . // // $Revision: 22213 $ // //============================================================================= #ifndef _TANGO_CONFIG_H #define _TANGO_CONFIG_H // // Add some define for Win32 and omniORB // !!!!!!!!!! In some cases, VC++ wizard generates Stdafx.h file which include // windows.h file as their first include. Stdafx.h file is the first // file which should be in included by the include files list. Therefore, in // this case, it is not possible to define anything before windows.h file is // included (except by modying stdafx.h file by hand...). In order to include // Windows socket release 2 software, _WIN32_WINNT must be defined and set // to something >= 0x0400. Therefore, in this case, define it in the project // setting in the preprocessor definitions.... // // Windows: // The Windows VC compilers family defined _WIN32 (always) and _WIN64 // (when compiled as 64 bits) // The Windows windef.h include file defines the preprocessor WIN32 on top of the // _WIN32 one defined by the compiler itself. // // This means that on Windows 64 bits, we will have BOTH // _WIN32 // WIN32 // _WIN64 // // Within Tango, Windows include files are included by the "idl/tango.h" include file // included by tango.h after this file // #ifdef _WIN32 #define __WIN32__ #define __x86__ #ifndef _WIN32_WINNT #define _WIN32_WINNT 0x0500 #endif #define __NT__ #define __OSVERSION 4 #endif // // Check Win32 VC release // #ifdef _WIN32 #ifdef _MSC_VER #if ((_MSC_VER >= 1400) && (_MSC_VER < 1500)) // VC8+ #define WIN32_VC8 #elif ((_MSC_VER >= 1500) && (_MSC_VER < 1600)) #define WIN32_VC9 #elif (_MSC_VER >= 1600) #define WIN32_VC10 #endif // VC8+/VC9/VC10 #endif #endif // // Define a common preprocessor macros for all Windows (32 or 64 bits) // #ifdef _WIN32 #define _TG_WINDOWS_ #endif // // For Windows DLL (import and export nightmare) // #ifdef _TG_WINDOWS_ #if ((defined _USRDLL) || (defined TANGO_HAS_DLL)) #if (defined _TANGO_LIB) #define TANGO_IMP_EXP __declspec(dllexport) #define TANGO_IMP #else #define TANGO_IMP_EXP __declspec(dllimport) #define TANGO_IMP __declspec(dllimport) #endif #else #define TANGO_IMP_EXP #define TANGO_IMP #endif #else #define TANGO_IMP_EXP #define TANGO_IMP #endif /* _WINDOWS_ */ // // Check GCC release // #ifndef _TG_WINDOWS_ #if __GNUC__ < 3 #error "Gcc too old to use Tango!" #endif #endif // // Some C++11 feature // Unique_ptr -> gcc 4.3 // rvalues -> gcc 4.3 // Lambda function -> gcc 4.5 // nullptr -> gcc 4.6 // #ifndef _TG_WINDOWS_ #if defined(__GNUC__) #if __GNUC__ == 4 #if __GNUC_MINOR__ > 3 #define HAS_UNIQUE_PTR #define HAS_RVALUE #endif #if __GNUC_MINOR__ > 4 #define HAS_LAMBDA_FUNC #define HAS_ISNAN_IN_STD #endif #if __GNUC_MINOR__ > 5 #define HAS_NULLPTR #define HAS_RANGE_BASE_FOR #endif #elif __GNUC__ > 4 #define HAS_UNIQUE_PTR #define HAS_RVALUE #define HAS_LAMBDA_FUNC #define HAS_ISNAN_IN_STD #define HAS_NULLPTR #define HAS_RANGE_BASE_FOR #endif #endif #else #ifdef WIN32_VC10 #define HAS_UNIQUE_PTR #define HAS_LAMBDA_FUNC #define HAS_NULLPTR #define HAS_RVALUE #endif #endif // // Some helper define // #define TangoSys_OMemStream ostringstream #define TangoSys_MemStream stringstream #define TangoSys_Pid int #define TangoSys_Cout ostream // // For Microsoft compilers // #ifdef _TG_WINDOWS_ #pragma warning(disable : 4355) #pragma warning(disable : 4715) #pragma warning(disable : 4786) #if (_MSC_VER >= 1400) // VC8+ #pragma warning(disable : 4996) // disable all deprecation warnings #endif // VC8+ #endif // // Define a common isnan call // #ifndef _TG_WINDOWS_ #ifdef HAS_ISNAN_IN_STD #define Tango_isnan(A) std::isnan(A) #else #define Tango_isnan(A) isnan(A) #endif #else #define Tango_isnan(A) _isnan(A) #endif // // Define a common NULL constant // #ifdef HAS_NULLPTR #define Tango_NullPtr nullptr #else #define Tango_NullPtr NULL #endif // // Define a common sleep call // #ifndef _TG_WINDOWS_ #define Tango_sleep(A) sleep(A) #else #define Tango_sleep(A) Sleep(A * 1000) #endif // // Define a time_t to long casting // #ifndef _TG_WINDOWS_ #define time_t_2_long(A) A #else #define time_t_2_long(A) (long)A #endif // // Define a common strcasecmp function // #ifndef _TG_WINDOWS_ #define TG_strcasecmp ::strcasecmp #define TG_strncasecmp ::strncasecmp #else #define TG_strcasecmp ::stricmp #define TG_strncasecmp ::strnicmp #endif // // ACTIVATE (or DEACTIVATE) THE TANGO LOGGING MECHANISM // #define TANGO_HAS_LOG4TANGO // // USE DSERVER'S LOGGER TO LOG TANGO CORE MESSAGES (cout1..4) // #define TANGO_HAS_CORE_LOGGER // // Define a macro for unused parameter warning // #ifdef _TG_WINDOWS_ #define TANGO_UNUSED(var) var #else #if __GNUC__ == 3 && __GNUC_MINOR__ >= 4 #define TANGO_UNUSED(var) var __attribute__ ((unused)) #elif __GNUC__ > 3 #define TANGO_UNUSED(var) var __attribute__ ((unused)) #else #define TANGO_UNUSED(var) var #endif #endif // // Is it a 32 or 64 bits computer // #ifndef _TG_WINDOWS_ #include #ifdef PACKAGE_BUGREPORT #undef PACKAGE_BUGREPORT #endif #ifdef PACKAGE_NAME #undef PACKAGE_NAME #endif #ifdef PACKAGE_STRING #undef PACKAGE_STRING #endif #ifdef PACKAGE_TARNAME #undef PACKAGE_TARNAME #endif #ifdef PACKAGE_VERSION #undef PACKAGE_VERSION #endif #if SIZEOF_LONG == 8 #define TANGO_LONG64 #else #define TANGO_LONG32 #endif #else #define TANGO_LONG32 #endif #endif /* _TANGO_CONFIG_H */ tango-8.1.2c+dfsg.orig/lib/cpp/server/attrdesc.h0000644000175000017500000005116112205375142020420 0ustar piccapicca//============================================================================= // // file : attrdesc.h // // description : Include file for the Attr classes hierarchy. // Three classes are declared in this file : // The Attr class // The SpectrumAttr class // The ImageAttr class // // project : TANGO // // author(s) : A.Gotz + E.Taurel // // Copyright (C) : 2004,2005,2006,2007,2008,2009,2010,2011,2012,2013 // European Synchrotron Radiation Facility // BP 220, Grenoble 38043 // FRANCE // // This file is part of Tango. // // Tango 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. // // Tango 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 Tango. If not, see . // // $Revision: 22213 $ // //============================================================================= #ifndef _ATTRDESC_H #define _ATTRDESC_H #include namespace Tango { class AttrProperty; class WAttribute; /** * User class to set attribute default properties. * * This class is used to set attribute default properties. Three levels of * attributes properties setting are implemented within Tango. The highest * property setting level is the database. Then the user default (set using * this UserDefaultAttrProp class) and finally a Tango library default * value * * $Author: taurel $ * $Revision: 22213 $ * * @headerfile tango.h * @ingroup Server */ class UserDefaultAttrProp { public: /**@name Constructor * Only one constructor is defined for this class */ //@{ /** * Constructs a newly allocated UserDefaultAttrProp object. */ UserDefaultAttrProp():ext(Tango_NullPtr) {} //@} /**@name Set default property methods */ //@{ /** * Set default label property * * @param def_label The user default label property */ void set_label(const char *def_label) { label = def_label; } /** * Set default description property * * @param def_desc The user default description property */ void set_description(const char *def_desc) { description = def_desc; } /** * Set default unit property * * @param def_unit The user default unit property */ void set_unit(const char *def_unit) { unit = def_unit; } /** * Set default standard unit property * * @param def_std_unit The user default standard unit property */ void set_standard_unit(const char *def_std_unit) { standard_unit = def_std_unit; } /** * Set default display unit property * * @param def_disp_unit The user default display unit property */ void set_display_unit(const char *def_disp_unit) { display_unit = def_disp_unit; } /** * Set default format property * * @param def_format The user default format property */ void set_format(const char *def_format) { format = def_format; } /** * Set default min_value property * * @param def_min_value The user default min_value property */ void set_min_value(const char *def_min_value) { min_value = def_min_value; } /** * Set default max_value property * * @param def_max_value The user default max_value property */ void set_max_value(const char *def_max_value) { max_value = def_max_value; } /** * Set default min_alarm property * * @param def_min_alarm The user default min_alarm property */ void set_min_alarm(const char *def_min_alarm) { min_alarm = def_min_alarm; } /** * Set default max_alarm property * * @param def_max_alarm The user default max_alarm property */ void set_max_alarm(const char *def_max_alarm) { max_alarm = def_max_alarm; } /** * Set default min_warning property * * @param def_min_warning The user default min_warning property */ void set_min_warning(const char *def_min_warning) { min_warning = def_min_warning; } /** * Set default max_warning property * * @param def_max_warning The user default max_warning property */ void set_max_warning(const char *def_max_warning) { max_warning = def_max_warning; } /** * Set default RDS alarm delta_t property * * @param def_delta_t The user default RDS alarm delta_t property */ void set_delta_t(const char *def_delta_t) { delta_t = def_delta_t; } /** * Set default RDS alarm delta_val property * * @param def_delta_val The user default RDS alarm delta_val property */ void set_delta_val(const char *def_delta_val) { delta_val = def_delta_val; } /** * Set default change event abs_change property * * @param def_abs_change The user default change event abs_change property */ void set_event_abs_change(const char *def_abs_change) { abs_change = def_abs_change; } /** * Set default change event rel_change property * * @param def_rel_change The user default change event rel_change property */ void set_event_rel_change(const char *def_rel_change) { rel_change = def_rel_change; } /** * Set default periodic event period property * * @param def_period The user default periodic event period property */ void set_event_period(const char *def_period) { period = def_period; } /** * Set default archive event abs_change property * * @param def_archive_abs_change The user default archive event abs_change property */ void set_archive_event_abs_change(const char *def_archive_abs_change) { archive_abs_change = def_archive_abs_change; } /** * Set default archive event rel_change property * * @param def_archive_rel_change The user default archive event rel_change property */ void set_archive_event_rel_change(const char *def_archive_rel_change) { archive_rel_change = def_archive_rel_change; } /** * Set default archive event period property * * @param def_archive_period The user default archive event period property */ void set_archive_event_period(const char *def_archive_period) { archive_period = def_archive_period; } //@} /// @privatesection ~UserDefaultAttrProp() {} void set_abs_change(const char *def_abs_change) { set_event_abs_change(def_abs_change); } void set_rel_change(const char *def_rel_change) { set_event_rel_change(def_rel_change); } void set_period(const char *def_period) { set_event_period(def_period); } void set_archive_abs_change(const char *def_archive_abs_change) { set_archive_event_abs_change(def_archive_abs_change); } void set_archive_rel_change(const char *def_archive_rel_change) { set_archive_event_rel_change(def_archive_rel_change); } void set_archive_period(const char *def_archive_period) { set_archive_event_period(def_archive_period); } string label; string description; string unit; string standard_unit; string display_unit; string format; string min_value; string max_value; string min_alarm; string max_alarm; string min_warning; string max_warning; string delta_val; string delta_t; string abs_change; string rel_change; string period; string archive_abs_change; string archive_rel_change; string archive_period; private: class UserDefaultAttrPropExt { }; #ifdef HAS_UNIQUE_PTR unique_ptr ext; // Class extension #else UserDefaultAttrPropExt *ext; #endif }; /** * User class to create a no dimension attribute object. * * Information from this class and information fetched out from the Tango * database allows the Tango core software to create the Attribute object * for the attribute created by the user. * * $Author: taurel $ * $Revision: 22213 $ * * @headerfile tango.h * @ingroup Server */ class Attr { public: /**@name Constructors * Two constructor are defined for this class */ //@{ /** * Constructs a newly allocated Attr object. * The attribute display level is set to OPERATOR. * * @param name The attribute name * @param data_type The attribute data type * @param w_type The attribute type (read, write, read with write ...) * @param assoc Name of the associated writable attribute. This is used * only the read with write attribute * */ Attr(const char *name,long data_type, Tango::AttrWriteType w_type = Tango::READ, const char *assoc = AssocWritNotSpec); /** * Constructs a newly allocated Attr object. * * @param name The attribute name * @param data_type The attribute data type * @param disp The attribute display level * @param w_type The attribute type (read, write, read with write ...) * @param assoc Name of the associated writable attribute. This is used * only the read with write attribute * */ Attr(const char *name,long data_type,Tango::DispLevel disp, Tango::AttrWriteType w_type = Tango::READ, const char *assoc = AssocWritNotSpec); //@} /**@name Destructor * Only one desctructor is defined for this class */ //@{ /** * The object desctructor. */ virtual ~Attr(); //@} /**@name Miscellaneous methods*/ //@{ /** * Set default attribute properties * * @param prop The user default property class */ void set_default_properties(UserDefaultAttrProp &prop); /** * Set the attribute display level * * @param level The attribute display level */ void set_disp_level(Tango::DispLevel level) {ext->disp_level = level;} /** * Set the attribute polling update period * * @param update The attribute polling period (in mS) */ void set_polling_period(long update) {ext->poll_period = update;} /** * Set the attribute as memorized in database (only for scalar and writable * attribute) * With no argument the setpoint will be written to the attribute during initialisation! */ void set_memorized(); /** * Set the initialisation flag for memorized attributes * true = the setpoint value will be written to the attribute on initialisation * false = only the attribute setpoint is initialised. No action is taken on the attribute * * @param write_on_init If true the setpoint value will be written to the attribute on initialisation */ void set_memorized_init(bool write_on_init) {mem_init = write_on_init;} /** * Set a flag to indicate that the server fires change events manually without * the polling to be started for the attribute. * If the detect parameter is set to true, the criteria specified for the change * event are verified and the event is only pushed if they are fullfilled. * If detect is set to false the event is fired without checking! * * @param implemented True when the server fires change events manually. * @param detect Triggers the verification of the change event properties when set to true. */ void set_change_event(bool implemented, bool detect) { ext->fire_change_event = implemented; ext->check_change_event = detect; } /** * Check if the change event is fired manually for this attribute. * * @return A boolean set to true if a manual fire change event is implemented. */ bool is_change_event() {return ext->fire_change_event;} /** * Check if the change event criteria should be checked when firing * the event manually. * * @return A boolean set to true if a change event criteria will be checked. */ bool is_check_change_criteria() {return ext->check_change_event;} /** * Set a flag to indicate that the server fires archive events manually without * the polling to be started for the attribute * If the detect parameter is set to true, the criteria specified for the archive * event are verified and the event is only pushed if they are fullfilled. * If detect is set to false the event is fired without checking! * * @param implemented True when the server fires archive events manually. * @param detect Triggers the verification of the archive event properties when set to true. */ void set_archive_event(bool implemented, bool detect) {ext->fire_archive_event = implemented; ext->check_archive_event = detect;} /** * Check if the archive event is fired manually for this attribute. * * @return A boolean set to true if a manual fire archive event is implemented. */ bool is_archive_event() {return ext->fire_archive_event;} /** * Check if the archive event criteria should be checked when firing * the event manually. * * @return A boolean set to true if a archive event criteria will be checked. */ bool is_check_archive_criteria() {return ext->check_archive_event;} /** * Set a flag to indicate that the server fires data ready events * * @param implemented True when the server fires data ready events */ void set_data_ready_event(bool implemented) { ext->fire_dr_event = implemented;} /** * Check if the data ready event is fired for this attribute. * * @return A boolean set to true if firing data ready event is implemented. */ bool is_data_ready_event() {return ext->fire_dr_event;} //@} /// @privatesection string &get_name() {return name;} Tango::AttrDataFormat get_format() {return format;} Tango::AttrWriteType get_writable() {return writable;} long get_type() {return type;} Tango::DispLevel get_disp_level() {return ext->disp_level;} long get_polling_period() {return ext->poll_period;} bool get_memorized() {return mem;} bool get_memorized_init() {return mem_init;} string &get_assoc() {return assoc_name;} const string &get_cl_name() {return ext->cl_name;} void set_cl_name(const string &cl) {ext->cl_name = cl;} bool is_assoc() {if (assoc_name != AssocWritNotSpec)return true;else return false;} vector &get_class_properties() {return class_properties;} vector &get_user_default_properties() {return user_default_properties;} void set_class_properties(vector &in_prop) {class_properties=in_prop;} void check_type(); virtual void read(DeviceImpl *,Attribute &) {}; virtual void write(DeviceImpl *,WAttribute &) {}; virtual bool is_allowed(DeviceImpl *,AttReqType) {return true;} #ifndef TANGO_HAS_LOG4TANGO friend ostream &operator<<(ostream &,const Attr &); #endif protected: /// @privatesection string name; Tango::AttrDataFormat format; Tango::AttrWriteType writable; long type; string assoc_name; bool mem; bool mem_init; vector class_properties; vector user_default_properties; void convert_def_prop(const string &, double &); void validate_def_prop(const string &, const char *); void validate_def_change_prop(const string &, const char *); void throw_incoherent_def_prop(const char *, const char *); void throw_invalid_def_prop(const char *, const char *); private: class AttrExt { public: AttrExt():poll_period(0),fire_change_event(false),fire_archive_event(false), check_change_event(false),check_archive_event(false), fire_dr_event(false),cl_name("Attr") {disp_level = Tango::OPERATOR;} AttrExt(DispLevel level):poll_period(0),fire_change_event(false),fire_archive_event(false), check_change_event(false),check_archive_event(false), fire_dr_event(false),cl_name("Attr") {disp_level = level;} Tango::DispLevel disp_level; // Display level long poll_period; // Polling period bool fire_change_event; bool fire_archive_event; bool check_change_event; bool check_archive_event; bool fire_dr_event; string cl_name; }; #ifdef HAS_UNIQUE_PTR unique_ptr ext; // Class extension #else AttrExt *ext; #endif }; /** * User class to create a one dimension attribute object. * * Information from this class and information fetched out from the Tango * database allows the Tango core software to create the Attribute object * for the attribute created by the user. * * $Author: taurel $ * $Revision: 22213 $ * * @headerfile tango.h * @ingroup Server */ class SpectrumAttr: public Attr { public: /**@name Constructors * Two constructors are defined for this class */ //@{ /** * Constructs a newly allocated SpectrumAttr object. * The attribute display level is set to OPERATOR. * The attribute write type is set to READ * * @param name The attribute name * @param data_type The attribute data type * @param max_x The attribute maximum x dimension * */ SpectrumAttr(const char *name,long data_type,long max_x); /** * Constructs a newly allocated SpectrumAttr object. * The attribute display level is set to OPERATOR. * * @param name The attribute name * @param data_type The attribute data type * @param w_type The attribute write type (READ, WRITE, READ_WRITE) * @param max_x The attribute maximum x dimension * */ SpectrumAttr(const char *name,long data_type,Tango::AttrWriteType w_type,long max_x); /** * Constructs a newly allocated SpectrumAttr object. * The attribute write type is set to READ * * @param name The attribute name * @param data_type The attribute data type * @param max_x The attribute maximum x dimension * @param level The attribute display type * */ SpectrumAttr(const char *name,long data_type,long max_x,DispLevel level); /** * Constructs a newly allocated SpectrumAttr object. * * @param name The attribute name * @param data_type The attribute data type * @param w_type The attribute write type (READ, WRITE, READ_WRITE) * @param max_x The attribute maximum x dimension * @param level The attribute display type * */ SpectrumAttr(const char *name,long data_type,Tango::AttrWriteType w_type,long max_x,DispLevel level); //@} /**@name Destructor * Only one desctructor is defined for this class */ //@{ /** * The object desctructor. */ ~SpectrumAttr() {} //@} /// @privatesection long get_max_x() {return max_x;} protected: long max_x; private: class SpectrumAttrExt { }; #ifdef HAS_UNIQUE_PTR unique_ptr ext; // Class extension #else SpectrumAttrExt *ext; #endif }; /** * User class to create a two dimensions attribute object. * * Information from this class and information fetched out from the Tango * database allows the Tango core software to create the Attribute object * for the attribute created by the user. * * $Author: taurel $ * $Revision: 22213 $ * * @headerfile tango.h * @ingroup Server */ class ImageAttr: public SpectrumAttr { public: /**@name Constructors * Two constructors are defined for this class */ //@{ /** * Constructs a newly allocated ImageAttr object. * The attribute display level is set to OPERATOR. * The attribute write type is set to READ * * @param name The attribute name * @param data_type The attribute data type * @param max_x The attribute maximum x dimension * @param max_y The attribute maximum y dimension * */ ImageAttr(const char *name,long data_type,long max_x, long max_y); /** * Constructs a newly allocated ImageAttr object. * The attribute display level is set to OPERATOR. * The attribute write type is set to READ * * @param name The attribute name * @param data_type The attribute data type * @param w_type The attribute write type (READ, WRITE, READ_WRITE) * @param max_x The attribute maximum x dimension * @param max_y The attribute maximum y dimension * */ ImageAttr(const char *name,long data_type,Tango::AttrWriteType w_type,long max_x, long max_y); /** * Constructs a newly allocated ImageAttr object. * The attribute write type is set to READ * * @param name The attribute name * @param data_type The attribute data type * @param max_x The attribute maximum x dimension * @param max_y The attribute maximum y dimension * @param level The attribute display type * */ ImageAttr(const char *name,long data_type,long max_x, long max_y, Tango::DispLevel level); /** * Constructs a newly allocated ImageAttr object. * The attribute write type is set to READ * * @param name The attribute name * @param data_type The attribute data type * @param w_type The attribute write type (READ, WRITE, READ_WRITE) * @param max_x The attribute maximum x dimension * @param max_y The attribute maximum y dimension * @param level The attribute display type * */ ImageAttr(const char *name,long data_type,Tango::AttrWriteType w_type, long max_x, long max_y, Tango::DispLevel level); //@} /**@name Destructor * Only one desctructor is defined for this class */ //@{ /** * The object desctructor. */ ~ImageAttr() {} //@} /// @privatesection long get_max_y() {return max_y;} protected: /// @privatesection long max_y; private: class ImageAttrExt { }; #ifdef HAS_UNIQUE_PTR unique_ptr ext; // Class extension #else ImageAttrExt *ext; #endif }; } // End of Tango namespace #endif /* _ATTRDESC_H */ tango-8.1.2c+dfsg.orig/lib/cpp/server/README0000644000175000017500000000314012205375142017310 0ustar piccapicca Full TANGO C++ API README ========================== taurel@esrf.fr (25/3/2003) This directory contains the files necessary to implement the server C++ TANGO API. It contains the include files and source files. The client part of this API is in the ../client directory. UNIX like library build ----------------------- The Makefile in this directory build the complete library from this directory and from source files in the ../client directory. To tailor it to your needs, edit the Make.rules file and update Makefile macros defined in this file to reflect your file system organization. Makefile targets are: all : Build libtango.a and libtango.so.x.y.z libtango.a : obvious libtango.so : obvious doc : To generate tango reference page using "doxygen" clean : To remove all object files Win32 library build ------------------- A workspace called "winnt_lib" is in the winnt_lib directory. This workspace contains two projects called "tango_dll" and "tango_static". Obviously, tango_static builds static tango libs (debug and release) and tango_dll builds dll tango libs (debug and release). Nowdays, to build dll libraries, you need "perl" on your windows computer which is available in the Windows NT or XP resource kit. It is in our TODO list to remove this "perl" usage. To correctly build libraries, two environment variables called "OMNI_BASE" and "LOG4TANGO_BASE" are needed. The environment variable OMNI_BASE should be set to the directory where omniORB has been installed. The environment variable LOG4TANGO_BASE should be set to the directory where log4tango has been installed. tango-8.1.2c+dfsg.orig/lib/cpp/server/dserverclass.h0000644000175000017500000004004012205375142021301 0ustar piccapicca//============================================================================= // // file : DServerClass.h // // description : Include for the DServerClass class. This class is a // singleton class i.e only one object of this class // can be created. // It contains all properties and methods // which the DServer requires only once e.g. the // commands. // This file also includes class declaration for all the // commands available on device of the DServer class // // project : TANGO // // author(s) : A.Gotz + E.Taurel // // Copyright (C) : 2004,2005,2006,2007,2008,2009,2010,2011,2012,2013 // European Synchrotron Radiation Facility // BP 220, Grenoble 38043 // FRANCE // // This file is part of Tango. // // Tango 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. // // Tango 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 Tango. If not, see . // // $Revision: 22213 $ // //============================================================================= #ifndef _DSERVERCLASS_H #define _DSERVERCLASS_H #include namespace Tango { //============================================================================= // // The DevRestart class // // description : Class to implement the DevRestart command. This command // needs one input argument and no outout argument. // The input argument is the name of the device to be // re-started. // This class delete and re-create a device // //============================================================================= class DevRestartCmd : public Command { public: DevRestartCmd(const char *cmd_name, Tango::CmdArgType in, Tango::CmdArgType out, const char *desc); ~DevRestartCmd() {}; virtual CORBA::Any *execute(DeviceImpl *device, const CORBA::Any &in_any); }; //============================================================================= // // The DevRestartServerCmd class // // description : Class to implement the DevKill command. This // command does not take any input argument. It simply // kills the device server. // //============================================================================= class DevRestartServerCmd : public Command { public: DevRestartServerCmd(const char *cmd_name, Tango::CmdArgType in,Tango::CmdArgType out); ~DevRestartServerCmd() {}; virtual CORBA::Any *execute (DeviceImpl *, const CORBA::Any &); }; //============================================================================= // // The DevQueryClassCmd class // // description : Class to implement the DevQueryClass command. This // command does not take any input argument and return a // list of all the classes created inside the device // server process // //============================================================================= class DevQueryClassCmd : public Command { public: DevQueryClassCmd(const char *cmd_name, Tango::CmdArgType in, Tango::CmdArgType out, const char *desc); ~DevQueryClassCmd() {}; virtual CORBA::Any *execute(DeviceImpl *device, const CORBA::Any &in_any); }; //============================================================================= // // The DevQueryDeviceCmd class // // description : Class to implement the DevQueryDevice command. This // command does not take any input argument and return a // list of all the devices created inside the device // server process // //============================================================================= class DevQueryDeviceCmd : public Command { public: DevQueryDeviceCmd(const char *cmd_name, Tango::CmdArgType in,Tango::CmdArgType out, const char *desc); ~DevQueryDeviceCmd() {}; virtual CORBA::Any *execute(DeviceImpl *device, const CORBA::Any &in_any); }; //============================================================================= // // The DevQuerySubDeviceCmd class // // description : Class to implement the DevQuerySubDevice command. This // command does not take any input argument and returns a // list of all the sub devices connections opened inside the device // server process // //============================================================================= class DevQuerySubDeviceCmd : public Command { public: DevQuerySubDeviceCmd(const char *cmd_name, Tango::CmdArgType in,Tango::CmdArgType out, const char *desc); ~DevQuerySubDeviceCmd() {}; virtual CORBA::Any *execute(DeviceImpl *device, const CORBA::Any &in_any); }; //============================================================================= // // The DevKillCmd class // // description : Class to implement the DevKill command. This // command does not take any input argument. It simply // kills the device server. // //============================================================================= class DevKillCmd : public Command { public: DevKillCmd(const char *cmd_name, Tango::CmdArgType in,Tango::CmdArgType out); ~DevKillCmd() {}; virtual CORBA::Any *execute (DeviceImpl *, const CORBA::Any &); }; //============================================================================= // // The DevSetTraceLevelCmd class // // description : Class to implement the DevSetTracelevel command. // It updates device server trace level with the input // argument // //============================================================================= class DevSetTraceLevelCmd : public Command { public: DevSetTraceLevelCmd(const char *cmd_name, Tango::CmdArgType in, Tango::CmdArgType out, const char *desc); ~DevSetTraceLevelCmd() {}; virtual CORBA::Any *execute(DeviceImpl *device, const CORBA::Any &in_any); }; //============================================================================= // // The DevGetTraceLevel class // // description : Class to implement the DevGetTracelevel command. // It simply returns the device server trace level // //============================================================================= class DevGetTraceLevelCmd : public Command { public: DevGetTraceLevelCmd(const char *cmd_name, Tango::CmdArgType in, Tango::CmdArgType out, const char *desc); ~DevGetTraceLevelCmd() {}; virtual CORBA::Any *execute (DeviceImpl *device, const CORBA::Any &in_any); }; //============================================================================= // // The DevSetTraceOutputCmd class // // description : Class to implement the DevSetTraceOutput command. // It set the server output to the input parameter // //============================================================================= class DevSetTraceOutputCmd : public Command { public: DevSetTraceOutputCmd(const char *cmd_name, Tango::CmdArgType in, Tango::CmdArgType out, const char *desc); ~DevSetTraceOutputCmd() {}; virtual CORBA::Any *execute (DeviceImpl *device, const CORBA::Any &in_any); }; //============================================================================= // // The DevGetTraceOutputCmd class // // description : Class to implement the DevGetTracelevel command. // It simply returns the device server trace level // //============================================================================= class DevGetTraceOutputCmd : public Command { public: DevGetTraceOutputCmd(const char *cmd_name, Tango::CmdArgType in, Tango::CmdArgType out, const char *desc); ~DevGetTraceOutputCmd() {}; virtual CORBA::Any *execute (DeviceImpl *device, const CORBA::Any &in_any); }; //============================================================================= // // The QueryWizardClassPropertyCmd class // // description : Class to implement the QueryWizardClassProperty command. // This command takes one input argument which is // the class name and return a // list of all the class properties definition registered // in the wizard for the specified class. // //============================================================================= class QueryWizardClassPropertyCmd : public Command { public: QueryWizardClassPropertyCmd(const char *cmd_name, Tango::CmdArgType in,Tango::CmdArgType out, const char *in_desc,const char *out_desc); ~QueryWizardClassPropertyCmd() {}; virtual CORBA::Any *execute(DeviceImpl *device, const CORBA::Any &in_any); }; //============================================================================= // // The QueryWizardDevPropertyCmd class // // description : Class to implement the QueryWizardDevProperty command. // This command takes one input argument which is // the class name and return a // list of all the device properties definition registered // in the wizard for the specified class. // //============================================================================= class QueryWizardDevPropertyCmd : public Command { public: QueryWizardDevPropertyCmd(const char *cmd_name, Tango::CmdArgType in,Tango::CmdArgType out, const char *in_desc,const char *out_desc); ~QueryWizardDevPropertyCmd() {}; virtual CORBA::Any *execute(DeviceImpl *device, const CORBA::Any &in_any); }; //============================================================================= // // The QueryEventChannelIOR class // // description : Class to implement the QueryEventChannelIOR command. // This command does not take any input argument and return // the event channel IOR. This command only exits foe DS // started with the -file option // //============================================================================= class QueryEventChannelIORCmd : public Command { public: QueryEventChannelIORCmd(const char *cmd_name, Tango::CmdArgType in, Tango::CmdArgType out, const char *desc); ~QueryEventChannelIORCmd() {}; virtual CORBA::Any *execute(DeviceImpl *device, const CORBA::Any &in_any); }; //============================================================================= // // The LockDeviceCmd class // // description : Class to implement the LockDevice command. // This command takes one input argument which is // the device names and return an // integer which is the client locking thread period // //============================================================================= class LockDeviceCmd : public Command { public: LockDeviceCmd(const char *cmd_name, Tango::CmdArgType in,Tango::CmdArgType out, const char *in_desc); ~LockDeviceCmd() {}; virtual CORBA::Any *execute(DeviceImpl *device, const CORBA::Any &in_any); }; //============================================================================= // // The ReLockDevicesCmd class // // description : Class to implement the ReLockDevices command. // This command takes one input argument which is // the vector with device names to be re-locked // //============================================================================= class ReLockDevicesCmd : public Command { public: ReLockDevicesCmd(const char *cmd_name, Tango::CmdArgType in,Tango::CmdArgType out, const char *in_desc); ~ReLockDevicesCmd() {}; virtual CORBA::Any *execute(DeviceImpl *device, const CORBA::Any &in_any); }; //============================================================================= // // The UnLockDeviceCmd class // // description : Class to implement the UnLockDevice command. // This command takes one input argument which is // the device name to be unlocked // //============================================================================= class UnLockDeviceCmd : public Command { public: UnLockDeviceCmd(const char *cmd_name, Tango::CmdArgType in,Tango::CmdArgType out, const char *in_desc,const char *out_desc); ~UnLockDeviceCmd() {}; virtual CORBA::Any *execute(DeviceImpl *device, const CORBA::Any &in_any); }; //============================================================================= // // The DevLockStatusCmd class // // description : Class to implement the DevLockStatus command. // This command takes one input argument which is // the device name for which you want to retrieve locking status // //============================================================================= class DevLockStatusCmd : public Command { public: DevLockStatusCmd(const char *cmd_name, Tango::CmdArgType in,Tango::CmdArgType out, const char *in_desc,const char *out_desc); ~DevLockStatusCmd() {}; virtual CORBA::Any *execute(DeviceImpl *device, const CORBA::Any &in_any); }; //============================================================================= // // The EventSubscriptionChangeCmd class // // description : Class to implement the EventSubscriptionChange command. // This command takes one arguments which are // the event for which the user subscribe to // //============================================================================= class EventSubscriptionChangeCmd : public Tango::Command { public: EventSubscriptionChangeCmd(const char *,Tango::CmdArgType, Tango::CmdArgType,const char *,const char *); EventSubscriptionChangeCmd(const char *,Tango::CmdArgType, Tango::CmdArgType); ~EventSubscriptionChangeCmd() {}; virtual bool is_allowed (Tango::DeviceImpl *, const CORBA::Any &); virtual CORBA::Any *execute (Tango::DeviceImpl *, const CORBA::Any &); }; //============================================================================= // // The ZmqEventSubscriptionChangeCmd class // // description : Class to implement the ZmqEventSubscriptionChange command. // This command takes one arguments which are // the event for which the user subscribe to // //============================================================================= class ZmqEventSubscriptionChangeCmd : public Tango::Command { public: ZmqEventSubscriptionChangeCmd(const char *,Tango::CmdArgType, Tango::CmdArgType,const char *,const char *); ZmqEventSubscriptionChangeCmd(const char *,Tango::CmdArgType, Tango::CmdArgType); ~ZmqEventSubscriptionChangeCmd() {}; virtual bool is_allowed (Tango::DeviceImpl *, const CORBA::Any &); virtual CORBA::Any *execute (Tango::DeviceImpl *, const CORBA::Any &); }; //============================================================================= // // The EventConfirmSubscriptionCmd class // // description : Class to implement the EventConfirmSubscription command. // This command takes a list of event for which the client confirm // the subscription. This command returns nothing // //============================================================================= class EventConfirmSubscriptionCmd : public Tango::Command { public: EventConfirmSubscriptionCmd(const char *,Tango::CmdArgType, Tango::CmdArgType,const char *); EventConfirmSubscriptionCmd(const char *,Tango::CmdArgType, Tango::CmdArgType); ~EventConfirmSubscriptionCmd() {}; virtual bool is_allowed (Tango::DeviceImpl *, const CORBA::Any &); virtual CORBA::Any *execute (Tango::DeviceImpl *, const CORBA::Any &); }; //============================================================================= // // The DServerClass class // // description : This class is a singleton ( The constructor is // protected and the _instance data member is static) // It contains all properties and methods // which the DServer objects requires only once e.g. the // commands. // //============================================================================= class DServerClass : public DeviceClass { public: TANGO_IMP_EXP static DServerClass *instance(); TANGO_IMP_EXP static DServerClass *init(); ~DServerClass() {}; void command_factory(); void device_factory(const Tango::DevVarStringArray *devlist); protected: DServerClass(string &); TANGO_IMP static DServerClass *_instance; }; } // End of Tango namespace #endif // _DSERVERCLASS_H tango-8.1.2c+dfsg.orig/lib/cpp/server/pollobj.cpp0000644000175000017500000002300512205375142020577 0ustar piccapiccastatic const char *RcsId = "$Id: pollobj.cpp 22213 2013-03-07 14:32:56Z taurel $\n$Name$"; //+============================================================================ // // file : PollObj.cpp // // description : C++ source code for the PollObj class. // This class is used to store all data specific to one // polled object and which does not need to be stored // in the ring buffer // // project : TANGO // // author(s) : E.Taurel // // Copyright (C) : 2004,2005,2006,2007,2008,2009,2010,2011,2012,2013 // European Synchrotron Radiation Facility // BP 220, Grenoble 38043 // FRANCE // // This file is part of Tango. // // Tango 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. // // Tango 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 Tango. If not, see . // // $Revision: 22213 $ // //-============================================================================ #if HAVE_CONFIG_H #include #endif #include #include #include #ifdef _TG_WINDOWS_ #include #include #else #include #endif /* _TG_WINDOWS_ */ namespace Tango { //+------------------------------------------------------------------------- // // method : PollObj::PollObj // // description : Two constructors for the PollObj class. The first one // constructs a PollObj instance with the default polling // ring depth // The second one create a PollObj instance with a // specified polling ring depth // // argument : in : - d : The device pointer // - ty : The polled object type // - na : The polled object name // - user_upd : The polling update period (in mS) // - r_depth : The polling ring depth // //-------------------------------------------------------------------------- PollObj::PollObj(DeviceImpl *d,PollObjType ty,const string &na,int user_upd) :dev(d),type(ty),name(na),ring() { needed_time.tv_sec = 0; needed_time.tv_usec = 0; if (user_upd < 1000) { upd.tv_usec = user_upd * 1000; upd.tv_sec = 0; } else { upd.tv_sec = user_upd / 1000; upd.tv_usec = (user_upd - (upd.tv_sec * 1000)) * 1000; } max_delta_t = (double)(user_upd / 1000.0) * dev->get_poll_old_factor(); } PollObj::PollObj(DeviceImpl *d,PollObjType ty,const string &na, int user_upd,long r_depth) :dev(d),type(ty),name(na),ring(r_depth) { needed_time.tv_sec = 0; needed_time.tv_usec = 0; if (user_upd < 1000) { upd.tv_usec = user_upd * 1000; upd.tv_sec = 0; } else { upd.tv_sec = user_upd / 1000; upd.tv_usec = (user_upd - (upd.tv_sec * 1000)) * 1000; } max_delta_t = (double)(user_upd / 1000.0) * dev->get_poll_old_factor(); } //+------------------------------------------------------------------------- // // method : PollObj::insert_data // // description : These methods insert a new element in the object ring // buffer when its real data // // argument : in : - res : The Any returned by the command // - when : The date when data was read // - needed : The time needed to execute command/attribute // reading // //-------------------------------------------------------------------------- void PollObj::insert_data(CORBA::Any *res, struct timeval &when, struct timeval &needed) { omni_mutex_lock(*this); ring.insert_data(res,when); needed_time = needed; } void PollObj::insert_data(Tango::AttributeValueList *res, struct timeval &when, struct timeval &needed) { omni_mutex_lock(*this); ring.insert_data(res,when); needed_time = needed; } void PollObj::insert_data(Tango::AttributeValueList_3 *res, struct timeval &when, struct timeval &needed) { omni_mutex_lock(*this); ring.insert_data(res,when); needed_time = needed; } void PollObj::insert_data(Tango::AttributeValueList_4 *res, struct timeval &when, struct timeval &needed) { omni_mutex_lock(*this); ring.insert_data(res,when,true); needed_time = needed; } //------------------------------------------------------------------------- // // method : PollObj::insert_except // // description : This method insert a new element in the ring buffer // when this element is an exception // // argument : in : - res : The DevFailed exception // - when : The date when the exception was thrown // - needed : The time needed for the command/attribute // reading // //-------------------------------------------------------------------------- void PollObj::insert_except(Tango::DevFailed *res, struct timeval &when, struct timeval &needed) { omni_mutex_lock(*this); ring.insert_except(res,when); needed_time = needed; } //------------------------------------------------------------------------- // // method : PollObj::get_last_insert_date // // description : This method returns the date stored with the most // recent record in the ring buffer (as a double in Sec) // //-------------------------------------------------------------------------- double PollObj::get_last_insert_date_i() { struct timeval last = ring.get_last_insert_date(); double last_d = (double)last.tv_sec + ((double)last.tv_usec / 1000000); return last_d; } //------------------------------------------------------------------------- // // method : PollObj::get_last_cmd_result // // description : This method returns the last data stored in ring // for a polled command or throw an exception if the // command failed when it was executed // //-------------------------------------------------------------------------- CORBA::Any *PollObj::get_last_cmd_result() { omni_mutex_lock(*this); return ring.get_last_cmd_result(); } //------------------------------------------------------------------------- // // method : PollObj::get_last_attr_value // // description : This method returns the last data stored in ring // for a polled attribute or throw an exception if the // read attribuite operation failed when it was executed // //-------------------------------------------------------------------------- Tango::AttributeValue &PollObj::get_last_attr_value(bool lock) { if (lock == true) omni_mutex_lock(*this); return ring.get_last_attr_value(); } Tango::AttributeValue_3 &PollObj::get_last_attr_value_3(bool lock) { if (lock == true) omni_mutex_lock(*this); return ring.get_last_attr_value_3(); } Tango::AttributeValue_4 &PollObj::get_last_attr_value_4(bool lock) { if (lock == true) omni_mutex_lock(*this); return ring.get_last_attr_value_4(); } //------------------------------------------------------------------------- // // method : PollObj::update_upd // // description : This method update the polling update period // // argument : in : - new_upd : The new update period (in mS) // //-------------------------------------------------------------------------- void PollObj::update_upd(int new_upd) { if (new_upd < 1000) { upd.tv_usec = new_upd * 1000; upd.tv_sec = 0; } else { upd.tv_sec = new_upd / 1000; upd.tv_usec = (new_upd - (upd.tv_sec * 1000)) * 1000; } max_delta_t = (double)(new_upd / 1000.0) * dev->get_poll_old_factor(); } //------------------------------------------------------------------------- // // method : PollObj::get_cmd_history // // description : This method get command history from the ring buffer // // argument : in : - n : recodr number // - ptr : Pointer to the sequence where command result // should be stored // //-------------------------------------------------------------------------- void PollObj::get_cmd_history(long n,Tango::DevCmdHistoryList *ptr) { omni_mutex_lock(*this); ring.get_cmd_history(n,ptr); } void PollObj::get_cmd_history(long n,Tango::DevCmdHistory_4 *ptr,Tango::CmdArgType &loc_type) { omni_mutex_lock(*this); ring.get_cmd_history(n,ptr,loc_type); } //------------------------------------------------------------------------- // // method : PollObj::get_attr_history // // description : This method get command history from the ring buffer // // argument : in : - n : record number // - ptr : Pointer to the sequence where command result // should be stored // - type : The attribute type // //-------------------------------------------------------------------------- void PollObj::get_attr_history(long n,Tango::DevAttrHistoryList *ptr,long attr_type) { omni_mutex_lock(*this); ring.get_attr_history(n,ptr,attr_type); } void PollObj::get_attr_history(long n,Tango::DevAttrHistoryList_3 *ptr,long attr_type) { omni_mutex_lock(*this); ring.get_attr_history(n,ptr,attr_type); // // Add attribute name in case of the attribute failed when it was read. // (This info is not stored in ring in case of attribute reading failure) // for (long i = 0;i < n;i++) { if ((*ptr)[i].attr_failed == true) { (*ptr)[i].value.name = CORBA::string_dup(name.c_str()); } } } void PollObj::get_attr_history(long n,Tango::DevAttrHistory_4 *ptr,long attr_type) { omni_mutex_lock(*this); ring.get_attr_history(n,ptr,attr_type); } void PollObj::get_attr_history_43(long n,Tango::DevAttrHistoryList_3 *ptr,long attr_type) { omni_mutex_lock(*this); ring.get_attr_history_43(n,ptr,attr_type); } } // End of Tango namespace tango-8.1.2c+dfsg.orig/lib/cpp/server/tangoSK.cpp0000644000175000017500000042667512205375142020530 0ustar piccapicca// This file is generated by omniidl (C++ backend)- omniORB_4_1. Do not edit. // // Copyright (C) : 2004,2005,2006,2007,2008,2009,2010,2011,2012,2013 // European Synchrotron Radiation Facility // BP 220, Grenoble 38043 // FRANCE // // This file is part of Tango. // // Tango 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. // // Tango 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 Tango. If not, see . // #include "tango.h" #include #include #include #include #include OMNI_USING_NAMESPACE(omni) static const char* _0RL_library_version = omniORB_4_1; void Tango::DevVarLongStringArray::operator>>= (cdrStream &_n) const { (const DevVarLongArray&) lvalue >>= _n; (const DevVarStringArray&) svalue >>= _n; } void Tango::DevVarLongStringArray::operator<<= (cdrStream &_n) { (DevVarLongArray&)lvalue <<= _n; (DevVarStringArray&)svalue <<= _n; } void Tango::DevVarDoubleStringArray::operator>>= (cdrStream &_n) const { (const DevVarDoubleArray&) dvalue >>= _n; (const DevVarStringArray&) svalue >>= _n; } void Tango::DevVarDoubleStringArray::operator<<= (cdrStream &_n) { (DevVarDoubleArray&)dvalue <<= _n; (DevVarStringArray&)svalue <<= _n; } void Tango::DevEncoded::operator>>= (cdrStream &_n) const { _n.marshalString(encoded_format,0); (const DevVarCharArray&) encoded_data >>= _n; } void Tango::DevEncoded::operator<<= (cdrStream &_n) { encoded_format = _n.unmarshalString(0); (DevVarCharArray&)encoded_data <<= _n; } void Tango::JavaClntIdent::operator>>= (cdrStream &_n) const { _n.marshalString(MainClass,0); if (! _n.marshal_byte_swap()) { _n.put_octet_array((_CORBA_Octet*)(uuid),16,omni::ALIGN_8); } else { _n.declareArrayLength(omni::ALIGN_8, 16); for (_CORBA_ULong _0i0 = 0; _0i0 < 2; _0i0++){ uuid[_0i0] >>= _n; } } } void Tango::JavaClntIdent::operator<<= (cdrStream &_n) { MainClass = _n.unmarshalString(0); _n.unmarshalArrayULongLong((_CORBA_ULongLong*)(uuid), 2); } void Tango::ClntIdent::operator>>= (cdrStream& _n) const { _pd__d >>= _n; switch(_pd__d) { case CPP: _pd_cpp_clnt >>= _n; break; case JAVA: (const JavaClntIdent&) _pd_java_clnt >>= _n; break; default: break; } } void Tango::ClntIdent::operator<<= (cdrStream& _n) { (LockerLanguage&)_pd__d <<= _n; switch(_pd__d) { case CPP: _pd__default = 0; (CppClntIdent&)_pd_cpp_clnt <<= _n; break; case JAVA: _pd__default = 0; (JavaClntIdent&)_pd_java_clnt <<= _n; break; } _pd__initialised = 1; } void Tango::TimeVal::operator>>= (cdrStream &_n) const { tv_sec >>= _n; tv_usec >>= _n; tv_nsec >>= _n; } void Tango::TimeVal::operator<<= (cdrStream &_n) { (::CORBA::Long&)tv_sec <<= _n; (::CORBA::Long&)tv_usec <<= _n; (::CORBA::Long&)tv_nsec <<= _n; } void Tango::DevCmdInfo::operator>>= (cdrStream &_n) const { _n.marshalString(cmd_name,0); cmd_tag >>= _n; in_type >>= _n; out_type >>= _n; _n.marshalString(in_type_desc,0); _n.marshalString(out_type_desc,0); } void Tango::DevCmdInfo::operator<<= (cdrStream &_n) { cmd_name = _n.unmarshalString(0); (::CORBA::Long&)cmd_tag <<= _n; (::CORBA::Long&)in_type <<= _n; (::CORBA::Long&)out_type <<= _n; in_type_desc = _n.unmarshalString(0); out_type_desc = _n.unmarshalString(0); } void Tango::DevCmdInfo_2::operator>>= (cdrStream &_n) const { _n.marshalString(cmd_name,0); level >>= _n; cmd_tag >>= _n; in_type >>= _n; out_type >>= _n; _n.marshalString(in_type_desc,0); _n.marshalString(out_type_desc,0); } void Tango::DevCmdInfo_2::operator<<= (cdrStream &_n) { cmd_name = _n.unmarshalString(0); (DispLevel&)level <<= _n; (::CORBA::Long&)cmd_tag <<= _n; (::CORBA::Long&)in_type <<= _n; (::CORBA::Long&)out_type <<= _n; in_type_desc = _n.unmarshalString(0); out_type_desc = _n.unmarshalString(0); } void Tango::DevError::operator>>= (cdrStream &_n) const { _n.marshalString(reason,0); severity >>= _n; _n.marshalString(desc,0); _n.marshalString(origin,0); } void Tango::DevError::operator<<= (cdrStream &_n) { reason = _n.unmarshalString(0); (ErrSeverity&)severity <<= _n; desc = _n.unmarshalString(0); origin = _n.unmarshalString(0); } void Tango::NamedDevError::operator>>= (cdrStream &_n) const { _n.marshalString(name,0); index_in_call >>= _n; (const DevErrorList&) err_list >>= _n; } void Tango::NamedDevError::operator<<= (cdrStream &_n) { name = _n.unmarshalString(0); (::CORBA::Long&)index_in_call <<= _n; (DevErrorList&)err_list <<= _n; } ::CORBA::Exception::insertExceptionToAny Tango::DevFailed::insertToAnyFn = 0; ::CORBA::Exception::insertExceptionToAnyNCP Tango::DevFailed::insertToAnyFnNCP = 0; Tango::DevFailed::DevFailed(const Tango::DevFailed& _s) : ::CORBA::UserException(_s) { errors = _s.errors; } Tango::DevFailed::DevFailed(const DevErrorList _errors) { pd_insertToAnyFn = Tango::DevFailed::insertToAnyFn; pd_insertToAnyFnNCP = Tango::DevFailed::insertToAnyFnNCP; errors = _errors; } Tango::DevFailed& Tango::DevFailed::operator=(const Tango::DevFailed& _s) { ((::CORBA::UserException*) this)->operator=(_s); errors = _s.errors; return *this; } Tango::DevFailed::~DevFailed() {} void Tango::DevFailed::_raise() const { throw *this; } const char* Tango::DevFailed::_PD_repoId = "IDL:Tango/DevFailed:1.0"; const char* Tango::DevFailed::_PD_typeId = "Exception/UserException/Tango::DevFailed"; Tango::DevFailed* Tango::DevFailed::_downcast(::CORBA::Exception* _e) { return (DevFailed*) _NP_is_a(_e, _PD_typeId); } const Tango::DevFailed* Tango::DevFailed::_downcast(const ::CORBA::Exception* _e) { return (const DevFailed*) _NP_is_a(_e, _PD_typeId); } ::CORBA::Exception* Tango::DevFailed::_NP_duplicate() const { return new DevFailed(*this); } const char* Tango::DevFailed::_NP_typeId() const { return _PD_typeId; } const char* Tango::DevFailed::_NP_repoId(int* _size) const { *_size = sizeof("IDL:Tango/DevFailed:1.0"); return _PD_repoId; } void Tango::DevFailed::_NP_marshal(cdrStream& _s) const { *this >>= _s; } void Tango::DevFailed::operator>>= (cdrStream& _n) const { (const DevErrorList&) errors >>= _n; } void Tango::DevFailed::operator<<= (cdrStream& _n) { (DevErrorList&)errors <<= _n; } ::CORBA::Exception::insertExceptionToAny Tango::MultiDevFailed::insertToAnyFn = 0; ::CORBA::Exception::insertExceptionToAnyNCP Tango::MultiDevFailed::insertToAnyFnNCP = 0; Tango::MultiDevFailed::MultiDevFailed(const Tango::MultiDevFailed& _s) : ::CORBA::UserException(_s) { errors = _s.errors; } Tango::MultiDevFailed::MultiDevFailed(const NamedDevErrorList _errors) { pd_insertToAnyFn = Tango::MultiDevFailed::insertToAnyFn; pd_insertToAnyFnNCP = Tango::MultiDevFailed::insertToAnyFnNCP; errors = _errors; } Tango::MultiDevFailed& Tango::MultiDevFailed::operator=(const Tango::MultiDevFailed& _s) { ((::CORBA::UserException*) this)->operator=(_s); errors = _s.errors; return *this; } Tango::MultiDevFailed::~MultiDevFailed() {} void Tango::MultiDevFailed::_raise() const { throw *this; } const char* Tango::MultiDevFailed::_PD_repoId = "IDL:Tango/MultiDevFailed:1.0"; const char* Tango::MultiDevFailed::_PD_typeId = "Exception/UserException/Tango::MultiDevFailed"; Tango::MultiDevFailed* Tango::MultiDevFailed::_downcast(::CORBA::Exception* _e) { return (MultiDevFailed*) _NP_is_a(_e, _PD_typeId); } const Tango::MultiDevFailed* Tango::MultiDevFailed::_downcast(const ::CORBA::Exception* _e) { return (const MultiDevFailed*) _NP_is_a(_e, _PD_typeId); } ::CORBA::Exception* Tango::MultiDevFailed::_NP_duplicate() const { return new MultiDevFailed(*this); } const char* Tango::MultiDevFailed::_NP_typeId() const { return _PD_typeId; } const char* Tango::MultiDevFailed::_NP_repoId(int* _size) const { *_size = sizeof("IDL:Tango/MultiDevFailed:1.0"); return _PD_repoId; } void Tango::MultiDevFailed::_NP_marshal(cdrStream& _s) const { *this >>= _s; } void Tango::MultiDevFailed::operator>>= (cdrStream& _n) const { (const NamedDevErrorList&) errors >>= _n; } void Tango::MultiDevFailed::operator<<= (cdrStream& _n) { (NamedDevErrorList&)errors <<= _n; } void Tango::AttributeConfig::operator>>= (cdrStream &_n) const { _n.marshalString(name,0); writable >>= _n; data_format >>= _n; data_type >>= _n; max_dim_x >>= _n; max_dim_y >>= _n; _n.marshalString(description,0); _n.marshalString(label,0); _n.marshalString(unit,0); _n.marshalString(standard_unit,0); _n.marshalString(display_unit,0); _n.marshalString(format,0); _n.marshalString(min_value,0); _n.marshalString(max_value,0); _n.marshalString(min_alarm,0); _n.marshalString(max_alarm,0); _n.marshalString(writable_attr_name,0); (const DevVarStringArray&) extensions >>= _n; } void Tango::AttributeConfig::operator<<= (cdrStream &_n) { name = _n.unmarshalString(0); (AttrWriteType&)writable <<= _n; (AttrDataFormat&)data_format <<= _n; (::CORBA::Long&)data_type <<= _n; (::CORBA::Long&)max_dim_x <<= _n; (::CORBA::Long&)max_dim_y <<= _n; description = _n.unmarshalString(0); label = _n.unmarshalString(0); unit = _n.unmarshalString(0); standard_unit = _n.unmarshalString(0); display_unit = _n.unmarshalString(0); format = _n.unmarshalString(0); min_value = _n.unmarshalString(0); max_value = _n.unmarshalString(0); min_alarm = _n.unmarshalString(0); max_alarm = _n.unmarshalString(0); writable_attr_name = _n.unmarshalString(0); (DevVarStringArray&)extensions <<= _n; } void Tango::AttributeConfig_2::operator>>= (cdrStream &_n) const { _n.marshalString(name,0); writable >>= _n; data_format >>= _n; data_type >>= _n; max_dim_x >>= _n; max_dim_y >>= _n; _n.marshalString(description,0); _n.marshalString(label,0); _n.marshalString(unit,0); _n.marshalString(standard_unit,0); _n.marshalString(display_unit,0); _n.marshalString(format,0); _n.marshalString(min_value,0); _n.marshalString(max_value,0); _n.marshalString(min_alarm,0); _n.marshalString(max_alarm,0); _n.marshalString(writable_attr_name,0); level >>= _n; (const DevVarStringArray&) extensions >>= _n; } void Tango::AttributeConfig_2::operator<<= (cdrStream &_n) { name = _n.unmarshalString(0); (AttrWriteType&)writable <<= _n; (AttrDataFormat&)data_format <<= _n; (::CORBA::Long&)data_type <<= _n; (::CORBA::Long&)max_dim_x <<= _n; (::CORBA::Long&)max_dim_y <<= _n; description = _n.unmarshalString(0); label = _n.unmarshalString(0); unit = _n.unmarshalString(0); standard_unit = _n.unmarshalString(0); display_unit = _n.unmarshalString(0); format = _n.unmarshalString(0); min_value = _n.unmarshalString(0); max_value = _n.unmarshalString(0); min_alarm = _n.unmarshalString(0); max_alarm = _n.unmarshalString(0); writable_attr_name = _n.unmarshalString(0); (DispLevel&)level <<= _n; (DevVarStringArray&)extensions <<= _n; } void Tango::AttributeValue::operator>>= (cdrStream &_n) const { (const ::CORBA::Any&) value >>= _n; quality >>= _n; (const TimeVal&) time >>= _n; _n.marshalString(name,0); dim_x >>= _n; dim_y >>= _n; } void Tango::AttributeValue::operator<<= (cdrStream &_n) { (::CORBA::Any&)value <<= _n; (AttrQuality&)quality <<= _n; (TimeVal&)time <<= _n; name = _n.unmarshalString(0); (::CORBA::Long&)dim_x <<= _n; (::CORBA::Long&)dim_y <<= _n; } void Tango::AttributeDim::operator>>= (cdrStream &_n) const { dim_x >>= _n; dim_y >>= _n; } void Tango::AttributeDim::operator<<= (cdrStream &_n) { (::CORBA::Long&)dim_x <<= _n; (::CORBA::Long&)dim_y <<= _n; } void Tango::AttributeValue_3::operator>>= (cdrStream &_n) const { (const ::CORBA::Any&) value >>= _n; quality >>= _n; (const TimeVal&) time >>= _n; _n.marshalString(name,0); (const AttributeDim&) r_dim >>= _n; (const AttributeDim&) w_dim >>= _n; (const DevErrorList&) err_list >>= _n; } void Tango::AttributeValue_3::operator<<= (cdrStream &_n) { (::CORBA::Any&)value <<= _n; (AttrQuality&)quality <<= _n; (TimeVal&)time <<= _n; name = _n.unmarshalString(0); (AttributeDim&)r_dim <<= _n; (AttributeDim&)w_dim <<= _n; (DevErrorList&)err_list <<= _n; } void Tango::AttrValUnion::operator>>= (cdrStream& _n) const { _pd__d >>= _n; switch(_pd__d) { case ATT_BOOL: (const DevVarBooleanArray&) _pd_bool_att_value >>= _n; break; case ATT_SHORT: (const DevVarShortArray&) _pd_short_att_value >>= _n; break; case ATT_LONG: (const DevVarLongArray&) _pd_long_att_value >>= _n; break; case ATT_LONG64: (const DevVarLong64Array&) _pd_long64_att_value >>= _n; break; case ATT_FLOAT: (const DevVarFloatArray&) _pd_float_att_value >>= _n; break; case ATT_DOUBLE: (const DevVarDoubleArray&) _pd_double_att_value >>= _n; break; case ATT_UCHAR: (const DevVarCharArray&) _pd_uchar_att_value >>= _n; break; case ATT_USHORT: (const DevVarUShortArray&) _pd_ushort_att_value >>= _n; break; case ATT_ULONG: (const DevVarULongArray&) _pd_ulong_att_value >>= _n; break; case ATT_ULONG64: (const DevVarULong64Array&) _pd_ulong64_att_value >>= _n; break; case ATT_STRING: (const DevVarStringArray&) _pd_string_att_value >>= _n; break; case ATT_STATE: (const DevVarStateArray&) _pd_state_att_value >>= _n; break; case DEVICE_STATE: _pd_dev_state_att >>= _n; break; case ATT_ENCODED: (const DevVarEncodedArray&) _pd_encoded_att_value >>= _n; break; case NO_DATA: _n.marshalBoolean(_pd_union_no_data); break; default: break; } } void Tango::AttrValUnion::operator<<= (cdrStream& _n) { (AttributeDataType&)_pd__d <<= _n; switch(_pd__d) { case ATT_BOOL: _pd__default = 0; (DevVarBooleanArray&)_pd_bool_att_value <<= _n; break; case ATT_SHORT: _pd__default = 0; (DevVarShortArray&)_pd_short_att_value <<= _n; break; case ATT_LONG: _pd__default = 0; (DevVarLongArray&)_pd_long_att_value <<= _n; break; case ATT_LONG64: _pd__default = 0; (DevVarLong64Array&)_pd_long64_att_value <<= _n; break; case ATT_FLOAT: _pd__default = 0; (DevVarFloatArray&)_pd_float_att_value <<= _n; break; case ATT_DOUBLE: _pd__default = 0; (DevVarDoubleArray&)_pd_double_att_value <<= _n; break; case ATT_UCHAR: _pd__default = 0; (DevVarCharArray&)_pd_uchar_att_value <<= _n; break; case ATT_USHORT: _pd__default = 0; (DevVarUShortArray&)_pd_ushort_att_value <<= _n; break; case ATT_ULONG: _pd__default = 0; (DevVarULongArray&)_pd_ulong_att_value <<= _n; break; case ATT_ULONG64: _pd__default = 0; (DevVarULong64Array&)_pd_ulong64_att_value <<= _n; break; case ATT_STRING: _pd__default = 0; (DevVarStringArray&)_pd_string_att_value <<= _n; break; case ATT_STATE: _pd__default = 0; (DevVarStateArray&)_pd_state_att_value <<= _n; break; case DEVICE_STATE: _pd__default = 0; (DevState&)_pd_dev_state_att <<= _n; break; case ATT_ENCODED: _pd__default = 0; (DevVarEncodedArray&)_pd_encoded_att_value <<= _n; break; case NO_DATA: _pd__default = 0; _pd_union_no_data = _n.unmarshalBoolean(); break; } _pd__initialised = 1; } void Tango::AttributeValue_4::operator>>= (cdrStream &_n) const { (const AttrValUnion&) value >>= _n; quality >>= _n; data_format >>= _n; (const TimeVal&) time >>= _n; _n.marshalString(name,0); (const AttributeDim&) r_dim >>= _n; (const AttributeDim&) w_dim >>= _n; (const DevErrorList&) err_list >>= _n; } void Tango::AttributeValue_4::operator<<= (cdrStream &_n) { (AttrValUnion&)value <<= _n; (AttrQuality&)quality <<= _n; (AttrDataFormat&)data_format <<= _n; (TimeVal&)time <<= _n; name = _n.unmarshalString(0); (AttributeDim&)r_dim <<= _n; (AttributeDim&)w_dim <<= _n; (DevErrorList&)err_list <<= _n; } void Tango::ChangeEventProp::operator>>= (cdrStream &_n) const { _n.marshalString(rel_change,0); _n.marshalString(abs_change,0); (const DevVarStringArray&) extensions >>= _n; } void Tango::ChangeEventProp::operator<<= (cdrStream &_n) { rel_change = _n.unmarshalString(0); abs_change = _n.unmarshalString(0); (DevVarStringArray&)extensions <<= _n; } void Tango::PeriodicEventProp::operator>>= (cdrStream &_n) const { _n.marshalString(period,0); (const DevVarStringArray&) extensions >>= _n; } void Tango::PeriodicEventProp::operator<<= (cdrStream &_n) { period = _n.unmarshalString(0); (DevVarStringArray&)extensions <<= _n; } void Tango::ArchiveEventProp::operator>>= (cdrStream &_n) const { _n.marshalString(rel_change,0); _n.marshalString(abs_change,0); _n.marshalString(period,0); (const DevVarStringArray&) extensions >>= _n; } void Tango::ArchiveEventProp::operator<<= (cdrStream &_n) { rel_change = _n.unmarshalString(0); abs_change = _n.unmarshalString(0); period = _n.unmarshalString(0); (DevVarStringArray&)extensions <<= _n; } void Tango::EventProperties::operator>>= (cdrStream &_n) const { (const ChangeEventProp&) ch_event >>= _n; (const PeriodicEventProp&) per_event >>= _n; (const ArchiveEventProp&) arch_event >>= _n; } void Tango::EventProperties::operator<<= (cdrStream &_n) { (ChangeEventProp&)ch_event <<= _n; (PeriodicEventProp&)per_event <<= _n; (ArchiveEventProp&)arch_event <<= _n; } void Tango::AttributeAlarm::operator>>= (cdrStream &_n) const { _n.marshalString(min_alarm,0); _n.marshalString(max_alarm,0); _n.marshalString(min_warning,0); _n.marshalString(max_warning,0); _n.marshalString(delta_t,0); _n.marshalString(delta_val,0); (const DevVarStringArray&) extensions >>= _n; } void Tango::AttributeAlarm::operator<<= (cdrStream &_n) { min_alarm = _n.unmarshalString(0); max_alarm = _n.unmarshalString(0); min_warning = _n.unmarshalString(0); max_warning = _n.unmarshalString(0); delta_t = _n.unmarshalString(0); delta_val = _n.unmarshalString(0); (DevVarStringArray&)extensions <<= _n; } void Tango::AttributeConfig_3::operator>>= (cdrStream &_n) const { _n.marshalString(name,0); writable >>= _n; data_format >>= _n; data_type >>= _n; max_dim_x >>= _n; max_dim_y >>= _n; _n.marshalString(description,0); _n.marshalString(label,0); _n.marshalString(unit,0); _n.marshalString(standard_unit,0); _n.marshalString(display_unit,0); _n.marshalString(format,0); _n.marshalString(min_value,0); _n.marshalString(max_value,0); _n.marshalString(writable_attr_name,0); level >>= _n; (const AttributeAlarm&) att_alarm >>= _n; (const EventProperties&) event_prop >>= _n; (const DevVarStringArray&) extensions >>= _n; (const DevVarStringArray&) sys_extensions >>= _n; } void Tango::AttributeConfig_3::operator<<= (cdrStream &_n) { name = _n.unmarshalString(0); (AttrWriteType&)writable <<= _n; (AttrDataFormat&)data_format <<= _n; (::CORBA::Long&)data_type <<= _n; (::CORBA::Long&)max_dim_x <<= _n; (::CORBA::Long&)max_dim_y <<= _n; description = _n.unmarshalString(0); label = _n.unmarshalString(0); unit = _n.unmarshalString(0); standard_unit = _n.unmarshalString(0); display_unit = _n.unmarshalString(0); format = _n.unmarshalString(0); min_value = _n.unmarshalString(0); max_value = _n.unmarshalString(0); writable_attr_name = _n.unmarshalString(0); (DispLevel&)level <<= _n; (AttributeAlarm&)att_alarm <<= _n; (EventProperties&)event_prop <<= _n; (DevVarStringArray&)extensions <<= _n; (DevVarStringArray&)sys_extensions <<= _n; } void Tango::AttDataReady::operator>>= (cdrStream &_n) const { _n.marshalString(name,0); data_type >>= _n; ctr >>= _n; } void Tango::AttDataReady::operator<<= (cdrStream &_n) { name = _n.unmarshalString(0); (::CORBA::Long&)data_type <<= _n; (::CORBA::Long&)ctr <<= _n; } void Tango::DevInfo::operator>>= (cdrStream &_n) const { _n.marshalString(dev_class,0); _n.marshalString(server_id,0); _n.marshalString(server_host,0); server_version >>= _n; _n.marshalString(doc_url,0); } void Tango::DevInfo::operator<<= (cdrStream &_n) { dev_class = _n.unmarshalString(0); server_id = _n.unmarshalString(0); server_host = _n.unmarshalString(0); (::CORBA::Long&)server_version <<= _n; doc_url = _n.unmarshalString(0); } void Tango::DevInfo_3::operator>>= (cdrStream &_n) const { _n.marshalString(dev_class,0); _n.marshalString(server_id,0); _n.marshalString(server_host,0); server_version >>= _n; _n.marshalString(doc_url,0); _n.marshalString(dev_type,0); } void Tango::DevInfo_3::operator<<= (cdrStream &_n) { dev_class = _n.unmarshalString(0); server_id = _n.unmarshalString(0); server_host = _n.unmarshalString(0); (::CORBA::Long&)server_version <<= _n; doc_url = _n.unmarshalString(0); dev_type = _n.unmarshalString(0); } void Tango::DevCmdHistory::operator>>= (cdrStream &_n) const { (const TimeVal&) time >>= _n; _n.marshalBoolean(cmd_failed); (const ::CORBA::Any&) value >>= _n; (const DevErrorList&) errors >>= _n; } void Tango::DevCmdHistory::operator<<= (cdrStream &_n) { (TimeVal&)time <<= _n; cmd_failed = _n.unmarshalBoolean(); (::CORBA::Any&)value <<= _n; (DevErrorList&)errors <<= _n; } void Tango::DevAttrHistory::operator>>= (cdrStream &_n) const { _n.marshalBoolean(attr_failed); (const AttributeValue&) value >>= _n; (const DevErrorList&) errors >>= _n; } void Tango::DevAttrHistory::operator<<= (cdrStream &_n) { attr_failed = _n.unmarshalBoolean(); (AttributeValue&)value <<= _n; (DevErrorList&)errors <<= _n; } void Tango::DevAttrHistory_3::operator>>= (cdrStream &_n) const { _n.marshalBoolean(attr_failed); (const AttributeValue_3&) value >>= _n; } void Tango::DevAttrHistory_3::operator<<= (cdrStream &_n) { attr_failed = _n.unmarshalBoolean(); (AttributeValue_3&)value <<= _n; } void Tango::EltInArray::operator>>= (cdrStream &_n) const { start >>= _n; nb_elt >>= _n; } void Tango::EltInArray::operator<<= (cdrStream &_n) { (::CORBA::Long&)start <<= _n; (::CORBA::Long&)nb_elt <<= _n; } void Tango::DevAttrHistory_4::operator>>= (cdrStream &_n) const { _n.marshalString(name,0); (const TimeValList&) dates >>= _n; (const ::CORBA::Any&) value >>= _n; (const AttrQualityList&) quals >>= _n; (const EltInArrayList&) quals_array >>= _n; (const AttributeDimList&) r_dims >>= _n; (const EltInArrayList&) r_dims_array >>= _n; (const AttributeDimList&) w_dims >>= _n; (const EltInArrayList&) w_dims_array >>= _n; (const DevErrorListList&) errors >>= _n; (const EltInArrayList&) errors_array >>= _n; } void Tango::DevAttrHistory_4::operator<<= (cdrStream &_n) { name = _n.unmarshalString(0); (TimeValList&)dates <<= _n; (::CORBA::Any&)value <<= _n; (AttrQualityList&)quals <<= _n; (EltInArrayList&)quals_array <<= _n; (AttributeDimList&)r_dims <<= _n; (EltInArrayList&)r_dims_array <<= _n; (AttributeDimList&)w_dims <<= _n; (EltInArrayList&)w_dims_array <<= _n; (DevErrorListList&)errors <<= _n; (EltInArrayList&)errors_array <<= _n; } void Tango::DevCmdHistory_4::operator>>= (cdrStream &_n) const { (const TimeValList&) dates >>= _n; (const ::CORBA::Any&) value >>= _n; (const AttributeDimList&) dims >>= _n; (const EltInArrayList&) dims_array >>= _n; (const DevErrorListList&) errors >>= _n; (const EltInArrayList&) errors_array >>= _n; cmd_type >>= _n; } void Tango::DevCmdHistory_4::operator<<= (cdrStream &_n) { (TimeValList&)dates <<= _n; (::CORBA::Any&)value <<= _n; (AttributeDimList&)dims <<= _n; (EltInArrayList&)dims_array <<= _n; (DevErrorListList&)errors <<= _n; (EltInArrayList&)errors_array <<= _n; (::CORBA::Long&)cmd_type <<= _n; } void Tango::ZmqCallInfo::operator>>= (cdrStream &_n) const { version >>= _n; ctr >>= _n; _n.marshalString(method_name,0); (const DevVarCharArray&) oid >>= _n; _n.marshalBoolean(call_is_except); } void Tango::ZmqCallInfo::operator<<= (cdrStream &_n) { (::CORBA::Long&)version <<= _n; (::CORBA::ULong&)ctr <<= _n; method_name = _n.unmarshalString(0); (DevVarCharArray&)oid <<= _n; call_is_except = _n.unmarshalBoolean(); } Tango::Device_ptr Tango::Device_Helper::_nil() { return ::Tango::Device::_nil(); } ::CORBA::Boolean Tango::Device_Helper::is_nil(::Tango::Device_ptr p) { return ::CORBA::is_nil(p); } void Tango::Device_Helper::release(::Tango::Device_ptr p) { ::CORBA::release(p); } void Tango::Device_Helper::marshalObjRef(::Tango::Device_ptr obj, cdrStream& s) { ::Tango::Device::_marshalObjRef(obj, s); } Tango::Device_ptr Tango::Device_Helper::unmarshalObjRef(cdrStream& s) { return ::Tango::Device::_unmarshalObjRef(s); } void Tango::Device_Helper::duplicate(::Tango::Device_ptr obj) { if( obj && !obj->_NP_is_nil() ) omni::duplicateObjRef(obj); } Tango::Device_ptr Tango::Device::_duplicate(::Tango::Device_ptr obj) { if( obj && !obj->_NP_is_nil() ) omni::duplicateObjRef(obj); return obj; } Tango::Device_ptr Tango::Device::_narrow(::CORBA::Object_ptr obj) { if( !obj || obj->_NP_is_nil() || obj->_NP_is_pseudo() ) return _nil(); _ptr_type e = (_ptr_type) obj->_PR_getobj()->_realNarrow(_PD_repoId); return e ? e : _nil(); } Tango::Device_ptr Tango::Device::_unchecked_narrow(::CORBA::Object_ptr obj) { if( !obj || obj->_NP_is_nil() || obj->_NP_is_pseudo() ) return _nil(); _ptr_type e = (_ptr_type) obj->_PR_getobj()->_uncheckedNarrow(_PD_repoId); return e ? e : _nil(); } Tango::Device_ptr Tango::Device::_nil() { #ifdef OMNI_UNLOADABLE_STUBS static _objref_Device _the_nil_obj; return &_the_nil_obj; #else static _objref_Device* _the_nil_ptr = 0; if( !_the_nil_ptr ) { omni::nilRefLock().lock(); if( !_the_nil_ptr ) { _the_nil_ptr = new _objref_Device; registerNilCorbaObject(_the_nil_ptr); } omni::nilRefLock().unlock(); } return _the_nil_ptr; #endif } const char* Tango::Device::_PD_repoId = "IDL:Tango/Device:1.0"; Tango::_objref_Device::~_objref_Device() { } Tango::_objref_Device::_objref_Device(omniIOR* ior, omniIdentity* id) : omniObjRef(::Tango::Device::_PD_repoId, ior, id, 1) { _PR_setobj(this); } void* Tango::_objref_Device::_ptrToObjRef(const char* id) { if( id == ::Tango::Device::_PD_repoId ) return (::Tango::Device_ptr) this; if( id == ::CORBA::Object::_PD_repoId ) return (::CORBA::Object_ptr) this; if( omni::strMatch(id, ::Tango::Device::_PD_repoId) ) return (::Tango::Device_ptr) this; if( omni::strMatch(id, ::CORBA::Object::_PD_repoId) ) return (::CORBA::Object_ptr) this; return 0; } // Proxy call descriptor class. Mangled signature: // _cany_i_cstring_i_cany_e_cTango_mDevFailed class _0RL_cd_6fe2f94a21a10053_00000000 : public omniCallDescriptor { public: inline _0RL_cd_6fe2f94a21a10053_00000000(LocalCallFn lcfn,const char* op_,size_t oplen,_CORBA_Boolean upcall=0): omniCallDescriptor(lcfn, op_, oplen, 0, _user_exns, 1, upcall) { } void marshalArguments(cdrStream&); void unmarshalArguments(cdrStream&); void unmarshalReturnedValues(cdrStream&); void marshalReturnedValues(cdrStream&); void userException(cdrStream&,_OMNI_NS(IOP_C)*,const char*); static const char* const _user_exns[]; ::CORBA::String_var arg_0_; const char* arg_0; ::CORBA::Any_var arg_1_; const ::CORBA::Any* arg_1; ::CORBA::Any_var result; }; void _0RL_cd_6fe2f94a21a10053_00000000::marshalArguments(cdrStream& _n) { _n.marshalString(arg_0,0); (const ::CORBA::Any&) *arg_1 >>= _n; } void _0RL_cd_6fe2f94a21a10053_00000000::unmarshalArguments(cdrStream& _n) { arg_0_ = _n.unmarshalString(0); arg_0 = arg_0_.in(); arg_1_ = new ::CORBA::Any; (::CORBA::Any&)arg_1_ <<= _n; arg_1 = &arg_1_.in(); } void _0RL_cd_6fe2f94a21a10053_00000000::marshalReturnedValues(cdrStream& _n) { (const ::CORBA::Any&) result >>= _n; } void _0RL_cd_6fe2f94a21a10053_00000000::unmarshalReturnedValues(cdrStream& _n) { result = new ::CORBA::Any; (::CORBA::Any&)result <<= _n; } const char* const _0RL_cd_6fe2f94a21a10053_00000000::_user_exns[] = { Tango::DevFailed::_PD_repoId }; void _0RL_cd_6fe2f94a21a10053_00000000::userException(cdrStream& s, _OMNI_NS(IOP_C)* iop_client, const char* repoId) { if ( omni::strMatch(repoId, Tango::DevFailed::_PD_repoId) ) { Tango::DevFailed _ex; _ex <<= s; if (iop_client) iop_client->RequestCompleted(); throw _ex; } else { if (iop_client) iop_client->RequestCompleted(1); OMNIORB_THROW(UNKNOWN,UNKNOWN_UserException, (::CORBA::CompletionStatus)s.completion()); } } // Local call call-back function. static void _0RL_lcfn_6fe2f94a21a10053_10000000(omniCallDescriptor* cd, omniServant* svnt) { _0RL_cd_6fe2f94a21a10053_00000000* tcd = (_0RL_cd_6fe2f94a21a10053_00000000*)cd; Tango::_impl_Device* impl = (Tango::_impl_Device*) svnt->_ptrToInterface(Tango::Device::_PD_repoId); #ifdef HAS_Cplusplus_catch_exception_by_base tcd->result = impl->command_inout(tcd->arg_0, *tcd->arg_1); #else if (!cd->is_upcall()) tcd->result = impl->command_inout(tcd->arg_0, *tcd->arg_1); else { try { tcd->result = impl->command_inout(tcd->arg_0, *tcd->arg_1); } catch(Tango::DevFailed& ex) { throw omniORB::StubUserException(ex._NP_duplicate()); } } #endif } ::CORBA::Any* Tango::_objref_Device::command_inout(const char* command, const ::CORBA::Any& argin) { _0RL_cd_6fe2f94a21a10053_00000000 _call_desc(_0RL_lcfn_6fe2f94a21a10053_10000000, "command_inout", 14); _call_desc.arg_0 = command; _call_desc.arg_1 = &(::CORBA::Any&) argin; _invoke(_call_desc); return _call_desc.result._retn(); } // Proxy call descriptor class. Mangled signature: // _cTango_mAttributeConfigList_i_cTango_mDevVarStringArray_e_cTango_mDevFailed class _0RL_cd_6fe2f94a21a10053_20000000 : public omniCallDescriptor { public: inline _0RL_cd_6fe2f94a21a10053_20000000(LocalCallFn lcfn,const char* op_,size_t oplen,_CORBA_Boolean upcall=0): omniCallDescriptor(lcfn, op_, oplen, 0, _user_exns, 1, upcall) { } void marshalArguments(cdrStream&); void unmarshalArguments(cdrStream&); void unmarshalReturnedValues(cdrStream&); void marshalReturnedValues(cdrStream&); void userException(cdrStream&,_OMNI_NS(IOP_C)*,const char*); static const char* const _user_exns[]; Tango::DevVarStringArray_var arg_0_; const Tango::DevVarStringArray* arg_0; Tango::AttributeConfigList_var result; }; void _0RL_cd_6fe2f94a21a10053_20000000::marshalArguments(cdrStream& _n) { (const Tango::DevVarStringArray&) *arg_0 >>= _n; } void _0RL_cd_6fe2f94a21a10053_20000000::unmarshalArguments(cdrStream& _n) { arg_0_ = new Tango::DevVarStringArray; (Tango::DevVarStringArray&)arg_0_ <<= _n; arg_0 = &arg_0_.in(); } void _0RL_cd_6fe2f94a21a10053_20000000::marshalReturnedValues(cdrStream& _n) { (const Tango::AttributeConfigList&) result >>= _n; } void _0RL_cd_6fe2f94a21a10053_20000000::unmarshalReturnedValues(cdrStream& _n) { result = new Tango::AttributeConfigList; (Tango::AttributeConfigList&)result <<= _n; } const char* const _0RL_cd_6fe2f94a21a10053_20000000::_user_exns[] = { Tango::DevFailed::_PD_repoId }; void _0RL_cd_6fe2f94a21a10053_20000000::userException(cdrStream& s, _OMNI_NS(IOP_C)* iop_client, const char* repoId) { if ( omni::strMatch(repoId, Tango::DevFailed::_PD_repoId) ) { Tango::DevFailed _ex; _ex <<= s; if (iop_client) iop_client->RequestCompleted(); throw _ex; } else { if (iop_client) iop_client->RequestCompleted(1); OMNIORB_THROW(UNKNOWN,UNKNOWN_UserException, (::CORBA::CompletionStatus)s.completion()); } } // Local call call-back function. static void _0RL_lcfn_6fe2f94a21a10053_30000000(omniCallDescriptor* cd, omniServant* svnt) { _0RL_cd_6fe2f94a21a10053_20000000* tcd = (_0RL_cd_6fe2f94a21a10053_20000000*)cd; Tango::_impl_Device* impl = (Tango::_impl_Device*) svnt->_ptrToInterface(Tango::Device::_PD_repoId); #ifdef HAS_Cplusplus_catch_exception_by_base tcd->result = impl->get_attribute_config(*tcd->arg_0); #else if (!cd->is_upcall()) tcd->result = impl->get_attribute_config(*tcd->arg_0); else { try { tcd->result = impl->get_attribute_config(*tcd->arg_0); } catch(Tango::DevFailed& ex) { throw omniORB::StubUserException(ex._NP_duplicate()); } } #endif } Tango::AttributeConfigList* Tango::_objref_Device::get_attribute_config(const ::Tango::DevVarStringArray& names) { _0RL_cd_6fe2f94a21a10053_20000000 _call_desc(_0RL_lcfn_6fe2f94a21a10053_30000000, "get_attribute_config", 21); _call_desc.arg_0 = &(::Tango::DevVarStringArray&) names; _invoke(_call_desc); return _call_desc.result._retn(); } // Proxy call descriptor class. Mangled signature: // void_i_cTango_mAttributeConfigList_e_cTango_mDevFailed class _0RL_cd_6fe2f94a21a10053_40000000 : public omniCallDescriptor { public: inline _0RL_cd_6fe2f94a21a10053_40000000(LocalCallFn lcfn,const char* op_,size_t oplen,_CORBA_Boolean upcall=0): omniCallDescriptor(lcfn, op_, oplen, 0, _user_exns, 1, upcall) { } void marshalArguments(cdrStream&); void unmarshalArguments(cdrStream&); void userException(cdrStream&,_OMNI_NS(IOP_C)*,const char*); static const char* const _user_exns[]; Tango::AttributeConfigList_var arg_0_; const Tango::AttributeConfigList* arg_0; }; void _0RL_cd_6fe2f94a21a10053_40000000::marshalArguments(cdrStream& _n) { (const Tango::AttributeConfigList&) *arg_0 >>= _n; } void _0RL_cd_6fe2f94a21a10053_40000000::unmarshalArguments(cdrStream& _n) { arg_0_ = new Tango::AttributeConfigList; (Tango::AttributeConfigList&)arg_0_ <<= _n; arg_0 = &arg_0_.in(); } const char* const _0RL_cd_6fe2f94a21a10053_40000000::_user_exns[] = { Tango::DevFailed::_PD_repoId }; void _0RL_cd_6fe2f94a21a10053_40000000::userException(cdrStream& s, _OMNI_NS(IOP_C)* iop_client, const char* repoId) { if ( omni::strMatch(repoId, Tango::DevFailed::_PD_repoId) ) { Tango::DevFailed _ex; _ex <<= s; if (iop_client) iop_client->RequestCompleted(); throw _ex; } else { if (iop_client) iop_client->RequestCompleted(1); OMNIORB_THROW(UNKNOWN,UNKNOWN_UserException, (::CORBA::CompletionStatus)s.completion()); } } // Local call call-back function. static void _0RL_lcfn_6fe2f94a21a10053_50000000(omniCallDescriptor* cd, omniServant* svnt) { _0RL_cd_6fe2f94a21a10053_40000000* tcd = (_0RL_cd_6fe2f94a21a10053_40000000*)cd; Tango::_impl_Device* impl = (Tango::_impl_Device*) svnt->_ptrToInterface(Tango::Device::_PD_repoId); #ifdef HAS_Cplusplus_catch_exception_by_base impl->set_attribute_config(*tcd->arg_0); #else if (!cd->is_upcall()) impl->set_attribute_config(*tcd->arg_0); else { try { impl->set_attribute_config(*tcd->arg_0); } catch(Tango::DevFailed& ex) { throw omniORB::StubUserException(ex._NP_duplicate()); } } #endif } void Tango::_objref_Device::set_attribute_config(const ::Tango::AttributeConfigList& new_conf) { _0RL_cd_6fe2f94a21a10053_40000000 _call_desc(_0RL_lcfn_6fe2f94a21a10053_50000000, "set_attribute_config", 21); _call_desc.arg_0 = &(::Tango::AttributeConfigList&) new_conf; _invoke(_call_desc); } // Proxy call descriptor class. Mangled signature: // _cTango_mAttributeValueList_i_cTango_mDevVarStringArray_e_cTango_mDevFailed class _0RL_cd_6fe2f94a21a10053_60000000 : public omniCallDescriptor { public: inline _0RL_cd_6fe2f94a21a10053_60000000(LocalCallFn lcfn,const char* op_,size_t oplen,_CORBA_Boolean upcall=0): omniCallDescriptor(lcfn, op_, oplen, 0, _user_exns, 1, upcall) { } void marshalArguments(cdrStream&); void unmarshalArguments(cdrStream&); void unmarshalReturnedValues(cdrStream&); void marshalReturnedValues(cdrStream&); void userException(cdrStream&,_OMNI_NS(IOP_C)*,const char*); static const char* const _user_exns[]; Tango::DevVarStringArray_var arg_0_; const Tango::DevVarStringArray* arg_0; Tango::AttributeValueList_var result; }; void _0RL_cd_6fe2f94a21a10053_60000000::marshalArguments(cdrStream& _n) { (const Tango::DevVarStringArray&) *arg_0 >>= _n; } void _0RL_cd_6fe2f94a21a10053_60000000::unmarshalArguments(cdrStream& _n) { arg_0_ = new Tango::DevVarStringArray; (Tango::DevVarStringArray&)arg_0_ <<= _n; arg_0 = &arg_0_.in(); } void _0RL_cd_6fe2f94a21a10053_60000000::marshalReturnedValues(cdrStream& _n) { (const Tango::AttributeValueList&) result >>= _n; } void _0RL_cd_6fe2f94a21a10053_60000000::unmarshalReturnedValues(cdrStream& _n) { result = new Tango::AttributeValueList; (Tango::AttributeValueList&)result <<= _n; } const char* const _0RL_cd_6fe2f94a21a10053_60000000::_user_exns[] = { Tango::DevFailed::_PD_repoId }; void _0RL_cd_6fe2f94a21a10053_60000000::userException(cdrStream& s, _OMNI_NS(IOP_C)* iop_client, const char* repoId) { if ( omni::strMatch(repoId, Tango::DevFailed::_PD_repoId) ) { Tango::DevFailed _ex; _ex <<= s; if (iop_client) iop_client->RequestCompleted(); throw _ex; } else { if (iop_client) iop_client->RequestCompleted(1); OMNIORB_THROW(UNKNOWN,UNKNOWN_UserException, (::CORBA::CompletionStatus)s.completion()); } } // Local call call-back function. static void _0RL_lcfn_6fe2f94a21a10053_70000000(omniCallDescriptor* cd, omniServant* svnt) { _0RL_cd_6fe2f94a21a10053_60000000* tcd = (_0RL_cd_6fe2f94a21a10053_60000000*)cd; Tango::_impl_Device* impl = (Tango::_impl_Device*) svnt->_ptrToInterface(Tango::Device::_PD_repoId); #ifdef HAS_Cplusplus_catch_exception_by_base tcd->result = impl->read_attributes(*tcd->arg_0); #else if (!cd->is_upcall()) tcd->result = impl->read_attributes(*tcd->arg_0); else { try { tcd->result = impl->read_attributes(*tcd->arg_0); } catch(Tango::DevFailed& ex) { throw omniORB::StubUserException(ex._NP_duplicate()); } } #endif } Tango::AttributeValueList* Tango::_objref_Device::read_attributes(const ::Tango::DevVarStringArray& names) { _0RL_cd_6fe2f94a21a10053_60000000 _call_desc(_0RL_lcfn_6fe2f94a21a10053_70000000, "read_attributes", 16); _call_desc.arg_0 = &(::Tango::DevVarStringArray&) names; _invoke(_call_desc); return _call_desc.result._retn(); } // Proxy call descriptor class. Mangled signature: // void_i_cTango_mAttributeValueList_e_cTango_mDevFailed class _0RL_cd_6fe2f94a21a10053_80000000 : public omniCallDescriptor { public: inline _0RL_cd_6fe2f94a21a10053_80000000(LocalCallFn lcfn,const char* op_,size_t oplen,_CORBA_Boolean upcall=0): omniCallDescriptor(lcfn, op_, oplen, 0, _user_exns, 1, upcall) { } void marshalArguments(cdrStream&); void unmarshalArguments(cdrStream&); void userException(cdrStream&,_OMNI_NS(IOP_C)*,const char*); static const char* const _user_exns[]; Tango::AttributeValueList_var arg_0_; const Tango::AttributeValueList* arg_0; }; void _0RL_cd_6fe2f94a21a10053_80000000::marshalArguments(cdrStream& _n) { (const Tango::AttributeValueList&) *arg_0 >>= _n; } void _0RL_cd_6fe2f94a21a10053_80000000::unmarshalArguments(cdrStream& _n) { arg_0_ = new Tango::AttributeValueList; (Tango::AttributeValueList&)arg_0_ <<= _n; arg_0 = &arg_0_.in(); } const char* const _0RL_cd_6fe2f94a21a10053_80000000::_user_exns[] = { Tango::DevFailed::_PD_repoId }; void _0RL_cd_6fe2f94a21a10053_80000000::userException(cdrStream& s, _OMNI_NS(IOP_C)* iop_client, const char* repoId) { if ( omni::strMatch(repoId, Tango::DevFailed::_PD_repoId) ) { Tango::DevFailed _ex; _ex <<= s; if (iop_client) iop_client->RequestCompleted(); throw _ex; } else { if (iop_client) iop_client->RequestCompleted(1); OMNIORB_THROW(UNKNOWN,UNKNOWN_UserException, (::CORBA::CompletionStatus)s.completion()); } } // Local call call-back function. static void _0RL_lcfn_6fe2f94a21a10053_90000000(omniCallDescriptor* cd, omniServant* svnt) { _0RL_cd_6fe2f94a21a10053_80000000* tcd = (_0RL_cd_6fe2f94a21a10053_80000000*)cd; Tango::_impl_Device* impl = (Tango::_impl_Device*) svnt->_ptrToInterface(Tango::Device::_PD_repoId); #ifdef HAS_Cplusplus_catch_exception_by_base impl->write_attributes(*tcd->arg_0); #else if (!cd->is_upcall()) impl->write_attributes(*tcd->arg_0); else { try { impl->write_attributes(*tcd->arg_0); } catch(Tango::DevFailed& ex) { throw omniORB::StubUserException(ex._NP_duplicate()); } } #endif } void Tango::_objref_Device::write_attributes(const ::Tango::AttributeValueList& values) { _0RL_cd_6fe2f94a21a10053_80000000 _call_desc(_0RL_lcfn_6fe2f94a21a10053_90000000, "write_attributes", 17); _call_desc.arg_0 = &(::Tango::AttributeValueList&) values; _invoke(_call_desc); } // Proxy call descriptor class. Mangled signature: // void_e_cTango_mDevFailed class _0RL_cd_6fe2f94a21a10053_a0000000 : public omniCallDescriptor { public: inline _0RL_cd_6fe2f94a21a10053_a0000000(LocalCallFn lcfn,const char* op_,size_t oplen,_CORBA_Boolean upcall=0): omniCallDescriptor(lcfn, op_, oplen, 0, _user_exns, 1, upcall) { } void userException(cdrStream&,_OMNI_NS(IOP_C)*,const char*); static const char* const _user_exns[]; }; const char* const _0RL_cd_6fe2f94a21a10053_a0000000::_user_exns[] = { Tango::DevFailed::_PD_repoId }; void _0RL_cd_6fe2f94a21a10053_a0000000::userException(cdrStream& s, _OMNI_NS(IOP_C)* iop_client, const char* repoId) { if ( omni::strMatch(repoId, Tango::DevFailed::_PD_repoId) ) { Tango::DevFailed _ex; _ex <<= s; if (iop_client) iop_client->RequestCompleted(); throw _ex; } else { if (iop_client) iop_client->RequestCompleted(1); OMNIORB_THROW(UNKNOWN,UNKNOWN_UserException, (::CORBA::CompletionStatus)s.completion()); } } // Local call call-back function. static void _0RL_lcfn_6fe2f94a21a10053_b0000000(omniCallDescriptor* cd, omniServant* svnt) { Tango::_impl_Device* impl = (Tango::_impl_Device*) svnt->_ptrToInterface(Tango::Device::_PD_repoId); #ifdef HAS_Cplusplus_catch_exception_by_base impl->ping(); #else if (!cd->is_upcall()) impl->ping(); else { try { impl->ping(); } catch(Tango::DevFailed& ex) { throw omniORB::StubUserException(ex._NP_duplicate()); } } #endif } void Tango::_objref_Device::ping() { _0RL_cd_6fe2f94a21a10053_a0000000 _call_desc(_0RL_lcfn_6fe2f94a21a10053_b0000000, "ping", 5); _invoke(_call_desc); } // Proxy call descriptor class. Mangled signature: // _cTango_mDevVarStringArray_i_clong_e_cTango_mDevFailed class _0RL_cd_6fe2f94a21a10053_c0000000 : public omniCallDescriptor { public: inline _0RL_cd_6fe2f94a21a10053_c0000000(LocalCallFn lcfn,const char* op_,size_t oplen,_CORBA_Boolean upcall=0): omniCallDescriptor(lcfn, op_, oplen, 0, _user_exns, 1, upcall) { } void marshalArguments(cdrStream&); void unmarshalArguments(cdrStream&); void unmarshalReturnedValues(cdrStream&); void marshalReturnedValues(cdrStream&); void userException(cdrStream&,_OMNI_NS(IOP_C)*,const char*); static const char* const _user_exns[]; ::CORBA::Long arg_0; Tango::DevVarStringArray_var result; }; void _0RL_cd_6fe2f94a21a10053_c0000000::marshalArguments(cdrStream& _n) { arg_0 >>= _n; } void _0RL_cd_6fe2f94a21a10053_c0000000::unmarshalArguments(cdrStream& _n) { (::CORBA::Long&)arg_0 <<= _n; } void _0RL_cd_6fe2f94a21a10053_c0000000::marshalReturnedValues(cdrStream& _n) { (const Tango::DevVarStringArray&) result >>= _n; } void _0RL_cd_6fe2f94a21a10053_c0000000::unmarshalReturnedValues(cdrStream& _n) { result = new Tango::DevVarStringArray; (Tango::DevVarStringArray&)result <<= _n; } const char* const _0RL_cd_6fe2f94a21a10053_c0000000::_user_exns[] = { Tango::DevFailed::_PD_repoId }; void _0RL_cd_6fe2f94a21a10053_c0000000::userException(cdrStream& s, _OMNI_NS(IOP_C)* iop_client, const char* repoId) { if ( omni::strMatch(repoId, Tango::DevFailed::_PD_repoId) ) { Tango::DevFailed _ex; _ex <<= s; if (iop_client) iop_client->RequestCompleted(); throw _ex; } else { if (iop_client) iop_client->RequestCompleted(1); OMNIORB_THROW(UNKNOWN,UNKNOWN_UserException, (::CORBA::CompletionStatus)s.completion()); } } // Local call call-back function. static void _0RL_lcfn_6fe2f94a21a10053_d0000000(omniCallDescriptor* cd, omniServant* svnt) { _0RL_cd_6fe2f94a21a10053_c0000000* tcd = (_0RL_cd_6fe2f94a21a10053_c0000000*)cd; Tango::_impl_Device* impl = (Tango::_impl_Device*) svnt->_ptrToInterface(Tango::Device::_PD_repoId); #ifdef HAS_Cplusplus_catch_exception_by_base tcd->result = impl->black_box(tcd->arg_0); #else if (!cd->is_upcall()) tcd->result = impl->black_box(tcd->arg_0); else { try { tcd->result = impl->black_box(tcd->arg_0); } catch(Tango::DevFailed& ex) { throw omniORB::StubUserException(ex._NP_duplicate()); } } #endif } Tango::DevVarStringArray* Tango::_objref_Device::black_box(::CORBA::Long n) { _0RL_cd_6fe2f94a21a10053_c0000000 _call_desc(_0RL_lcfn_6fe2f94a21a10053_d0000000, "black_box", 10); _call_desc.arg_0 = n; _invoke(_call_desc); return _call_desc.result._retn(); } // Proxy call descriptor class. Mangled signature: // _cTango_mDevInfo_e_cTango_mDevFailed class _0RL_cd_6fe2f94a21a10053_e0000000 : public omniCallDescriptor { public: inline _0RL_cd_6fe2f94a21a10053_e0000000(LocalCallFn lcfn,const char* op_,size_t oplen,_CORBA_Boolean upcall=0): omniCallDescriptor(lcfn, op_, oplen, 0, _user_exns, 1, upcall) { } void unmarshalReturnedValues(cdrStream&); void marshalReturnedValues(cdrStream&); void userException(cdrStream&,_OMNI_NS(IOP_C)*,const char*); static const char* const _user_exns[]; Tango::DevInfo_var result; }; void _0RL_cd_6fe2f94a21a10053_e0000000::marshalReturnedValues(cdrStream& _n) { (const Tango::DevInfo&) result >>= _n; } void _0RL_cd_6fe2f94a21a10053_e0000000::unmarshalReturnedValues(cdrStream& _n) { result = new Tango::DevInfo; (Tango::DevInfo&)result <<= _n; } const char* const _0RL_cd_6fe2f94a21a10053_e0000000::_user_exns[] = { Tango::DevFailed::_PD_repoId }; void _0RL_cd_6fe2f94a21a10053_e0000000::userException(cdrStream& s, _OMNI_NS(IOP_C)* iop_client, const char* repoId) { if ( omni::strMatch(repoId, Tango::DevFailed::_PD_repoId) ) { Tango::DevFailed _ex; _ex <<= s; if (iop_client) iop_client->RequestCompleted(); throw _ex; } else { if (iop_client) iop_client->RequestCompleted(1); OMNIORB_THROW(UNKNOWN,UNKNOWN_UserException, (::CORBA::CompletionStatus)s.completion()); } } // Local call call-back function. static void _0RL_lcfn_6fe2f94a21a10053_f0000000(omniCallDescriptor* cd, omniServant* svnt) { _0RL_cd_6fe2f94a21a10053_e0000000* tcd = (_0RL_cd_6fe2f94a21a10053_e0000000*)cd; Tango::_impl_Device* impl = (Tango::_impl_Device*) svnt->_ptrToInterface(Tango::Device::_PD_repoId); #ifdef HAS_Cplusplus_catch_exception_by_base tcd->result = impl->info(); #else if (!cd->is_upcall()) tcd->result = impl->info(); else { try { tcd->result = impl->info(); } catch(Tango::DevFailed& ex) { throw omniORB::StubUserException(ex._NP_duplicate()); } } #endif } Tango::DevInfo* Tango::_objref_Device::info() { _0RL_cd_6fe2f94a21a10053_e0000000 _call_desc(_0RL_lcfn_6fe2f94a21a10053_f0000000, "info", 5); _invoke(_call_desc); return _call_desc.result._retn(); } // Proxy call descriptor class. Mangled signature: // _cTango_mDevCmdInfoList_e_cTango_mDevFailed class _0RL_cd_6fe2f94a21a10053_01000000 : public omniCallDescriptor { public: inline _0RL_cd_6fe2f94a21a10053_01000000(LocalCallFn lcfn,const char* op_,size_t oplen,_CORBA_Boolean upcall=0): omniCallDescriptor(lcfn, op_, oplen, 0, _user_exns, 1, upcall) { } void unmarshalReturnedValues(cdrStream&); void marshalReturnedValues(cdrStream&); void userException(cdrStream&,_OMNI_NS(IOP_C)*,const char*); static const char* const _user_exns[]; Tango::DevCmdInfoList_var result; }; void _0RL_cd_6fe2f94a21a10053_01000000::marshalReturnedValues(cdrStream& _n) { (const Tango::DevCmdInfoList&) result >>= _n; } void _0RL_cd_6fe2f94a21a10053_01000000::unmarshalReturnedValues(cdrStream& _n) { result = new Tango::DevCmdInfoList; (Tango::DevCmdInfoList&)result <<= _n; } const char* const _0RL_cd_6fe2f94a21a10053_01000000::_user_exns[] = { Tango::DevFailed::_PD_repoId }; void _0RL_cd_6fe2f94a21a10053_01000000::userException(cdrStream& s, _OMNI_NS(IOP_C)* iop_client, const char* repoId) { if ( omni::strMatch(repoId, Tango::DevFailed::_PD_repoId) ) { Tango::DevFailed _ex; _ex <<= s; if (iop_client) iop_client->RequestCompleted(); throw _ex; } else { if (iop_client) iop_client->RequestCompleted(1); OMNIORB_THROW(UNKNOWN,UNKNOWN_UserException, (::CORBA::CompletionStatus)s.completion()); } } // Local call call-back function. static void _0RL_lcfn_6fe2f94a21a10053_11000000(omniCallDescriptor* cd, omniServant* svnt) { _0RL_cd_6fe2f94a21a10053_01000000* tcd = (_0RL_cd_6fe2f94a21a10053_01000000*)cd; Tango::_impl_Device* impl = (Tango::_impl_Device*) svnt->_ptrToInterface(Tango::Device::_PD_repoId); #ifdef HAS_Cplusplus_catch_exception_by_base tcd->result = impl->command_list_query(); #else if (!cd->is_upcall()) tcd->result = impl->command_list_query(); else { try { tcd->result = impl->command_list_query(); } catch(Tango::DevFailed& ex) { throw omniORB::StubUserException(ex._NP_duplicate()); } } #endif } Tango::DevCmdInfoList* Tango::_objref_Device::command_list_query() { _0RL_cd_6fe2f94a21a10053_01000000 _call_desc(_0RL_lcfn_6fe2f94a21a10053_11000000, "command_list_query", 19); _invoke(_call_desc); return _call_desc.result._retn(); } // Proxy call descriptor class. Mangled signature: // _cTango_mDevCmdInfo_i_cstring_e_cTango_mDevFailed class _0RL_cd_6fe2f94a21a10053_21000000 : public omniCallDescriptor { public: inline _0RL_cd_6fe2f94a21a10053_21000000(LocalCallFn lcfn,const char* op_,size_t oplen,_CORBA_Boolean upcall=0): omniCallDescriptor(lcfn, op_, oplen, 0, _user_exns, 1, upcall) { } void marshalArguments(cdrStream&); void unmarshalArguments(cdrStream&); void unmarshalReturnedValues(cdrStream&); void marshalReturnedValues(cdrStream&); void userException(cdrStream&,_OMNI_NS(IOP_C)*,const char*); static const char* const _user_exns[]; ::CORBA::String_var arg_0_; const char* arg_0; Tango::DevCmdInfo_var result; }; void _0RL_cd_6fe2f94a21a10053_21000000::marshalArguments(cdrStream& _n) { _n.marshalString(arg_0,0); } void _0RL_cd_6fe2f94a21a10053_21000000::unmarshalArguments(cdrStream& _n) { arg_0_ = _n.unmarshalString(0); arg_0 = arg_0_.in(); } void _0RL_cd_6fe2f94a21a10053_21000000::marshalReturnedValues(cdrStream& _n) { (const Tango::DevCmdInfo&) result >>= _n; } void _0RL_cd_6fe2f94a21a10053_21000000::unmarshalReturnedValues(cdrStream& _n) { result = new Tango::DevCmdInfo; (Tango::DevCmdInfo&)result <<= _n; } const char* const _0RL_cd_6fe2f94a21a10053_21000000::_user_exns[] = { Tango::DevFailed::_PD_repoId }; void _0RL_cd_6fe2f94a21a10053_21000000::userException(cdrStream& s, _OMNI_NS(IOP_C)* iop_client, const char* repoId) { if ( omni::strMatch(repoId, Tango::DevFailed::_PD_repoId) ) { Tango::DevFailed _ex; _ex <<= s; if (iop_client) iop_client->RequestCompleted(); throw _ex; } else { if (iop_client) iop_client->RequestCompleted(1); OMNIORB_THROW(UNKNOWN,UNKNOWN_UserException, (::CORBA::CompletionStatus)s.completion()); } } // Local call call-back function. static void _0RL_lcfn_6fe2f94a21a10053_31000000(omniCallDescriptor* cd, omniServant* svnt) { _0RL_cd_6fe2f94a21a10053_21000000* tcd = (_0RL_cd_6fe2f94a21a10053_21000000*)cd; Tango::_impl_Device* impl = (Tango::_impl_Device*) svnt->_ptrToInterface(Tango::Device::_PD_repoId); #ifdef HAS_Cplusplus_catch_exception_by_base tcd->result = impl->command_query(tcd->arg_0); #else if (!cd->is_upcall()) tcd->result = impl->command_query(tcd->arg_0); else { try { tcd->result = impl->command_query(tcd->arg_0); } catch(Tango::DevFailed& ex) { throw omniORB::StubUserException(ex._NP_duplicate()); } } #endif } Tango::DevCmdInfo* Tango::_objref_Device::command_query(const char* command) { _0RL_cd_6fe2f94a21a10053_21000000 _call_desc(_0RL_lcfn_6fe2f94a21a10053_31000000, "command_query", 14); _call_desc.arg_0 = command; _invoke(_call_desc); return _call_desc.result._retn(); } // Proxy call descriptor class. Mangled signature: // _cstring class _0RL_cd_6fe2f94a21a10053_41000000 : public omniCallDescriptor { public: inline _0RL_cd_6fe2f94a21a10053_41000000(LocalCallFn lcfn,const char* op_,size_t oplen,_CORBA_Boolean upcall=0): omniCallDescriptor(lcfn, op_, oplen, 0, _user_exns, 0, upcall) { } void unmarshalReturnedValues(cdrStream&); void marshalReturnedValues(cdrStream&); static const char* const _user_exns[]; ::CORBA::String_var result; }; void _0RL_cd_6fe2f94a21a10053_41000000::marshalReturnedValues(cdrStream& _n) { _n.marshalString(result,0); } void _0RL_cd_6fe2f94a21a10053_41000000::unmarshalReturnedValues(cdrStream& _n) { result = _n.unmarshalString(0); } const char* const _0RL_cd_6fe2f94a21a10053_41000000::_user_exns[] = { 0 }; // Local call call-back function. static void _0RL_lcfn_6fe2f94a21a10053_51000000(omniCallDescriptor* cd, omniServant* svnt) { _0RL_cd_6fe2f94a21a10053_41000000* tcd = (_0RL_cd_6fe2f94a21a10053_41000000*)cd; Tango::_impl_Device* impl = (Tango::_impl_Device*) svnt->_ptrToInterface(Tango::Device::_PD_repoId); tcd->result = impl->name(); } char* Tango::_objref_Device::name() { _0RL_cd_6fe2f94a21a10053_41000000 _call_desc(_0RL_lcfn_6fe2f94a21a10053_51000000, "_get_name", 10); _invoke(_call_desc); return _call_desc.result._retn(); } // Local call call-back function. static void _0RL_lcfn_6fe2f94a21a10053_61000000(omniCallDescriptor* cd, omniServant* svnt) { _0RL_cd_6fe2f94a21a10053_41000000* tcd = (_0RL_cd_6fe2f94a21a10053_41000000*)cd; Tango::_impl_Device* impl = (Tango::_impl_Device*) svnt->_ptrToInterface(Tango::Device::_PD_repoId); tcd->result = impl->description(); } char* Tango::_objref_Device::description() { _0RL_cd_6fe2f94a21a10053_41000000 _call_desc(_0RL_lcfn_6fe2f94a21a10053_61000000, "_get_description", 17); _invoke(_call_desc); return _call_desc.result._retn(); } // Proxy call descriptor class. Mangled signature: // _cTango_mDevState class _0RL_cd_6fe2f94a21a10053_71000000 : public omniCallDescriptor { public: inline _0RL_cd_6fe2f94a21a10053_71000000(LocalCallFn lcfn,const char* op_,size_t oplen,_CORBA_Boolean upcall=0): omniCallDescriptor(lcfn, op_, oplen, 0, _user_exns, 0, upcall) { } void unmarshalReturnedValues(cdrStream&); void marshalReturnedValues(cdrStream&); static const char* const _user_exns[]; Tango::DevState result; }; void _0RL_cd_6fe2f94a21a10053_71000000::marshalReturnedValues(cdrStream& _n) { result >>= _n; } void _0RL_cd_6fe2f94a21a10053_71000000::unmarshalReturnedValues(cdrStream& _n) { (Tango::DevState&)result <<= _n; } const char* const _0RL_cd_6fe2f94a21a10053_71000000::_user_exns[] = { 0 }; // Local call call-back function. static void _0RL_lcfn_6fe2f94a21a10053_81000000(omniCallDescriptor* cd, omniServant* svnt) { _0RL_cd_6fe2f94a21a10053_71000000* tcd = (_0RL_cd_6fe2f94a21a10053_71000000*)cd; Tango::_impl_Device* impl = (Tango::_impl_Device*) svnt->_ptrToInterface(Tango::Device::_PD_repoId); tcd->result = impl->state(); } Tango::DevState Tango::_objref_Device::state() { _0RL_cd_6fe2f94a21a10053_71000000 _call_desc(_0RL_lcfn_6fe2f94a21a10053_81000000, "_get_state", 11); _invoke(_call_desc); return _call_desc.result; } // Local call call-back function. static void _0RL_lcfn_6fe2f94a21a10053_91000000(omniCallDescriptor* cd, omniServant* svnt) { _0RL_cd_6fe2f94a21a10053_41000000* tcd = (_0RL_cd_6fe2f94a21a10053_41000000*)cd; Tango::_impl_Device* impl = (Tango::_impl_Device*) svnt->_ptrToInterface(Tango::Device::_PD_repoId); tcd->result = impl->status(); } char* Tango::_objref_Device::status() { _0RL_cd_6fe2f94a21a10053_41000000 _call_desc(_0RL_lcfn_6fe2f94a21a10053_91000000, "_get_status", 12); _invoke(_call_desc); return _call_desc.result._retn(); } // Local call call-back function. static void _0RL_lcfn_6fe2f94a21a10053_a1000000(omniCallDescriptor* cd, omniServant* svnt) { _0RL_cd_6fe2f94a21a10053_41000000* tcd = (_0RL_cd_6fe2f94a21a10053_41000000*)cd; Tango::_impl_Device* impl = (Tango::_impl_Device*) svnt->_ptrToInterface(Tango::Device::_PD_repoId); tcd->result = impl->adm_name(); } char* Tango::_objref_Device::adm_name() { _0RL_cd_6fe2f94a21a10053_41000000 _call_desc(_0RL_lcfn_6fe2f94a21a10053_a1000000, "_get_adm_name", 14); _invoke(_call_desc); return _call_desc.result._retn(); } Tango::_pof_Device::~_pof_Device() {} omniObjRef* Tango::_pof_Device::newObjRef(omniIOR* ior, omniIdentity* id) { return new ::Tango::_objref_Device(ior, id); } ::CORBA::Boolean Tango::_pof_Device::is_a(const char* id) const { if( omni::ptrStrMatch(id, ::Tango::Device::_PD_repoId) ) return 1; return 0; } const Tango::_pof_Device _the_pof_Tango_mDevice; Tango::_impl_Device::~_impl_Device() {} ::CORBA::Boolean Tango::_impl_Device::_dispatch(omniCallHandle& _handle) { const char* op = _handle.operation_name(); if( omni::strMatch(op, "command_inout") ) { _0RL_cd_6fe2f94a21a10053_00000000 _call_desc(_0RL_lcfn_6fe2f94a21a10053_10000000, "command_inout", 14, 1); _handle.upcall(this,_call_desc); return 1; } if( omni::strMatch(op, "get_attribute_config") ) { _0RL_cd_6fe2f94a21a10053_20000000 _call_desc(_0RL_lcfn_6fe2f94a21a10053_30000000, "get_attribute_config", 21, 1); _handle.upcall(this,_call_desc); return 1; } if( omni::strMatch(op, "set_attribute_config") ) { _0RL_cd_6fe2f94a21a10053_40000000 _call_desc(_0RL_lcfn_6fe2f94a21a10053_50000000, "set_attribute_config", 21, 1); _handle.upcall(this,_call_desc); return 1; } if( omni::strMatch(op, "read_attributes") ) { _0RL_cd_6fe2f94a21a10053_60000000 _call_desc(_0RL_lcfn_6fe2f94a21a10053_70000000, "read_attributes", 16, 1); _handle.upcall(this,_call_desc); return 1; } if( omni::strMatch(op, "write_attributes") ) { _0RL_cd_6fe2f94a21a10053_80000000 _call_desc(_0RL_lcfn_6fe2f94a21a10053_90000000, "write_attributes", 17, 1); _handle.upcall(this,_call_desc); return 1; } if( omni::strMatch(op, "ping") ) { _0RL_cd_6fe2f94a21a10053_a0000000 _call_desc(_0RL_lcfn_6fe2f94a21a10053_b0000000, "ping", 5, 1); _handle.upcall(this,_call_desc); return 1; } if( omni::strMatch(op, "black_box") ) { _0RL_cd_6fe2f94a21a10053_c0000000 _call_desc(_0RL_lcfn_6fe2f94a21a10053_d0000000, "black_box", 10, 1); _handle.upcall(this,_call_desc); return 1; } if( omni::strMatch(op, "info") ) { _0RL_cd_6fe2f94a21a10053_e0000000 _call_desc(_0RL_lcfn_6fe2f94a21a10053_f0000000, "info", 5, 1); _handle.upcall(this,_call_desc); return 1; } if( omni::strMatch(op, "command_list_query") ) { _0RL_cd_6fe2f94a21a10053_01000000 _call_desc(_0RL_lcfn_6fe2f94a21a10053_11000000, "command_list_query", 19, 1); _handle.upcall(this,_call_desc); return 1; } if( omni::strMatch(op, "command_query") ) { _0RL_cd_6fe2f94a21a10053_21000000 _call_desc(_0RL_lcfn_6fe2f94a21a10053_31000000, "command_query", 14, 1); _handle.upcall(this,_call_desc); return 1; } if( omni::strMatch(op, "_get_name") ) { _0RL_cd_6fe2f94a21a10053_41000000 _call_desc(_0RL_lcfn_6fe2f94a21a10053_51000000, "_get_name", 10, 1); _handle.upcall(this,_call_desc); return 1; } if( omni::strMatch(op, "_get_description") ) { _0RL_cd_6fe2f94a21a10053_41000000 _call_desc(_0RL_lcfn_6fe2f94a21a10053_61000000, "_get_description", 17, 1); _handle.upcall(this,_call_desc); return 1; } if( omni::strMatch(op, "_get_state") ) { _0RL_cd_6fe2f94a21a10053_71000000 _call_desc(_0RL_lcfn_6fe2f94a21a10053_81000000, "_get_state", 11, 1); _handle.upcall(this,_call_desc); return 1; } if( omni::strMatch(op, "_get_status") ) { _0RL_cd_6fe2f94a21a10053_41000000 _call_desc(_0RL_lcfn_6fe2f94a21a10053_91000000, "_get_status", 12, 1); _handle.upcall(this,_call_desc); return 1; } if( omni::strMatch(op, "_get_adm_name") ) { _0RL_cd_6fe2f94a21a10053_41000000 _call_desc(_0RL_lcfn_6fe2f94a21a10053_a1000000, "_get_adm_name", 14, 1); _handle.upcall(this,_call_desc); return 1; } return 0; } void* Tango::_impl_Device::_ptrToInterface(const char* id) { if( id == ::Tango::Device::_PD_repoId ) return (::Tango::_impl_Device*) this; if( id == ::CORBA::Object::_PD_repoId ) return (void*) 1; if( omni::strMatch(id, ::Tango::Device::_PD_repoId) ) return (::Tango::_impl_Device*) this; if( omni::strMatch(id, ::CORBA::Object::_PD_repoId) ) return (void*) 1; return 0; } const char* Tango::_impl_Device::_mostDerivedRepoId() { return ::Tango::Device::_PD_repoId; } Tango::Device_2_ptr Tango::Device_2_Helper::_nil() { return ::Tango::Device_2::_nil(); } ::CORBA::Boolean Tango::Device_2_Helper::is_nil(::Tango::Device_2_ptr p) { return ::CORBA::is_nil(p); } void Tango::Device_2_Helper::release(::Tango::Device_2_ptr p) { ::CORBA::release(p); } void Tango::Device_2_Helper::marshalObjRef(::Tango::Device_2_ptr obj, cdrStream& s) { ::Tango::Device_2::_marshalObjRef(obj, s); } Tango::Device_2_ptr Tango::Device_2_Helper::unmarshalObjRef(cdrStream& s) { return ::Tango::Device_2::_unmarshalObjRef(s); } void Tango::Device_2_Helper::duplicate(::Tango::Device_2_ptr obj) { if( obj && !obj->_NP_is_nil() ) omni::duplicateObjRef(obj); } Tango::Device_2_ptr Tango::Device_2::_duplicate(::Tango::Device_2_ptr obj) { if( obj && !obj->_NP_is_nil() ) omni::duplicateObjRef(obj); return obj; } Tango::Device_2_ptr Tango::Device_2::_narrow(::CORBA::Object_ptr obj) { if( !obj || obj->_NP_is_nil() || obj->_NP_is_pseudo() ) return _nil(); _ptr_type e = (_ptr_type) obj->_PR_getobj()->_realNarrow(_PD_repoId); return e ? e : _nil(); } Tango::Device_2_ptr Tango::Device_2::_unchecked_narrow(::CORBA::Object_ptr obj) { if( !obj || obj->_NP_is_nil() || obj->_NP_is_pseudo() ) return _nil(); _ptr_type e = (_ptr_type) obj->_PR_getobj()->_uncheckedNarrow(_PD_repoId); return e ? e : _nil(); } Tango::Device_2_ptr Tango::Device_2::_nil() { #ifdef OMNI_UNLOADABLE_STUBS static _objref_Device_2 _the_nil_obj; return &_the_nil_obj; #else static _objref_Device_2* _the_nil_ptr = 0; if( !_the_nil_ptr ) { omni::nilRefLock().lock(); if( !_the_nil_ptr ) { _the_nil_ptr = new _objref_Device_2; registerNilCorbaObject(_the_nil_ptr); } omni::nilRefLock().unlock(); } return _the_nil_ptr; #endif } const char* Tango::Device_2::_PD_repoId = "IDL:Tango/Device_2:1.0"; Tango::_objref_Device_2::~_objref_Device_2() { } Tango::_objref_Device_2::_objref_Device_2(omniIOR* ior, omniIdentity* id) : omniObjRef(::Tango::Device_2::_PD_repoId, ior, id, 1), _objref_Device(ior, id) { _PR_setobj(this); } void* Tango::_objref_Device_2::_ptrToObjRef(const char* id) { if( id == ::Tango::Device_2::_PD_repoId ) return (::Tango::Device_2_ptr) this; if( id == ::Tango::Device::_PD_repoId ) return (::Tango::Device_ptr) this; if( id == ::CORBA::Object::_PD_repoId ) return (::CORBA::Object_ptr) this; if( omni::strMatch(id, ::Tango::Device_2::_PD_repoId) ) return (::Tango::Device_2_ptr) this; if( omni::strMatch(id, ::Tango::Device::_PD_repoId) ) return (::Tango::Device_ptr) this; if( omni::strMatch(id, ::CORBA::Object::_PD_repoId) ) return (::CORBA::Object_ptr) this; return 0; } // Proxy call descriptor class. Mangled signature: // _cany_i_cstring_i_cany_i_cTango_mDevSource_e_cTango_mDevFailed class _0RL_cd_6fe2f94a21a10053_b1000000 : public omniCallDescriptor { public: inline _0RL_cd_6fe2f94a21a10053_b1000000(LocalCallFn lcfn,const char* op_,size_t oplen,_CORBA_Boolean upcall=0): omniCallDescriptor(lcfn, op_, oplen, 0, _user_exns, 1, upcall) { } void marshalArguments(cdrStream&); void unmarshalArguments(cdrStream&); void unmarshalReturnedValues(cdrStream&); void marshalReturnedValues(cdrStream&); void userException(cdrStream&,_OMNI_NS(IOP_C)*,const char*); static const char* const _user_exns[]; ::CORBA::String_var arg_0_; const char* arg_0; ::CORBA::Any_var arg_1_; const ::CORBA::Any* arg_1; Tango::DevSource arg_2; ::CORBA::Any_var result; }; void _0RL_cd_6fe2f94a21a10053_b1000000::marshalArguments(cdrStream& _n) { _n.marshalString(arg_0,0); (const ::CORBA::Any&) *arg_1 >>= _n; arg_2 >>= _n; } void _0RL_cd_6fe2f94a21a10053_b1000000::unmarshalArguments(cdrStream& _n) { arg_0_ = _n.unmarshalString(0); arg_0 = arg_0_.in(); arg_1_ = new ::CORBA::Any; (::CORBA::Any&)arg_1_ <<= _n; arg_1 = &arg_1_.in(); (Tango::DevSource&)arg_2 <<= _n; } void _0RL_cd_6fe2f94a21a10053_b1000000::marshalReturnedValues(cdrStream& _n) { (const ::CORBA::Any&) result >>= _n; } void _0RL_cd_6fe2f94a21a10053_b1000000::unmarshalReturnedValues(cdrStream& _n) { result = new ::CORBA::Any; (::CORBA::Any&)result <<= _n; } const char* const _0RL_cd_6fe2f94a21a10053_b1000000::_user_exns[] = { Tango::DevFailed::_PD_repoId }; void _0RL_cd_6fe2f94a21a10053_b1000000::userException(cdrStream& s, _OMNI_NS(IOP_C)* iop_client, const char* repoId) { if ( omni::strMatch(repoId, Tango::DevFailed::_PD_repoId) ) { Tango::DevFailed _ex; _ex <<= s; if (iop_client) iop_client->RequestCompleted(); throw _ex; } else { if (iop_client) iop_client->RequestCompleted(1); OMNIORB_THROW(UNKNOWN,UNKNOWN_UserException, (::CORBA::CompletionStatus)s.completion()); } } // Local call call-back function. static void _0RL_lcfn_6fe2f94a21a10053_c1000000(omniCallDescriptor* cd, omniServant* svnt) { _0RL_cd_6fe2f94a21a10053_b1000000* tcd = (_0RL_cd_6fe2f94a21a10053_b1000000*)cd; Tango::_impl_Device_2* impl = (Tango::_impl_Device_2*) svnt->_ptrToInterface(Tango::Device_2::_PD_repoId); #ifdef HAS_Cplusplus_catch_exception_by_base tcd->result = impl->command_inout_2(tcd->arg_0, *tcd->arg_1, tcd->arg_2); #else if (!cd->is_upcall()) tcd->result = impl->command_inout_2(tcd->arg_0, *tcd->arg_1, tcd->arg_2); else { try { tcd->result = impl->command_inout_2(tcd->arg_0, *tcd->arg_1, tcd->arg_2); } catch(Tango::DevFailed& ex) { throw omniORB::StubUserException(ex._NP_duplicate()); } } #endif } ::CORBA::Any* Tango::_objref_Device_2::command_inout_2(const char* command, const ::CORBA::Any& argin, ::Tango::DevSource source) { _0RL_cd_6fe2f94a21a10053_b1000000 _call_desc(_0RL_lcfn_6fe2f94a21a10053_c1000000, "command_inout_2", 16); _call_desc.arg_0 = command; _call_desc.arg_1 = &(::CORBA::Any&) argin; _call_desc.arg_2 = source; _invoke(_call_desc); return _call_desc.result._retn(); } // Proxy call descriptor class. Mangled signature: // _cTango_mAttributeValueList_i_cTango_mDevVarStringArray_i_cTango_mDevSource_e_cTango_mDevFailed class _0RL_cd_6fe2f94a21a10053_d1000000 : public omniCallDescriptor { public: inline _0RL_cd_6fe2f94a21a10053_d1000000(LocalCallFn lcfn,const char* op_,size_t oplen,_CORBA_Boolean upcall=0): omniCallDescriptor(lcfn, op_, oplen, 0, _user_exns, 1, upcall) { } void marshalArguments(cdrStream&); void unmarshalArguments(cdrStream&); void unmarshalReturnedValues(cdrStream&); void marshalReturnedValues(cdrStream&); void userException(cdrStream&,_OMNI_NS(IOP_C)*,const char*); static const char* const _user_exns[]; Tango::DevVarStringArray_var arg_0_; const Tango::DevVarStringArray* arg_0; Tango::DevSource arg_1; Tango::AttributeValueList_var result; }; void _0RL_cd_6fe2f94a21a10053_d1000000::marshalArguments(cdrStream& _n) { (const Tango::DevVarStringArray&) *arg_0 >>= _n; arg_1 >>= _n; } void _0RL_cd_6fe2f94a21a10053_d1000000::unmarshalArguments(cdrStream& _n) { arg_0_ = new Tango::DevVarStringArray; (Tango::DevVarStringArray&)arg_0_ <<= _n; arg_0 = &arg_0_.in(); (Tango::DevSource&)arg_1 <<= _n; } void _0RL_cd_6fe2f94a21a10053_d1000000::marshalReturnedValues(cdrStream& _n) { (const Tango::AttributeValueList&) result >>= _n; } void _0RL_cd_6fe2f94a21a10053_d1000000::unmarshalReturnedValues(cdrStream& _n) { result = new Tango::AttributeValueList; (Tango::AttributeValueList&)result <<= _n; } const char* const _0RL_cd_6fe2f94a21a10053_d1000000::_user_exns[] = { Tango::DevFailed::_PD_repoId }; void _0RL_cd_6fe2f94a21a10053_d1000000::userException(cdrStream& s, _OMNI_NS(IOP_C)* iop_client, const char* repoId) { if ( omni::strMatch(repoId, Tango::DevFailed::_PD_repoId) ) { Tango::DevFailed _ex; _ex <<= s; if (iop_client) iop_client->RequestCompleted(); throw _ex; } else { if (iop_client) iop_client->RequestCompleted(1); OMNIORB_THROW(UNKNOWN,UNKNOWN_UserException, (::CORBA::CompletionStatus)s.completion()); } } // Local call call-back function. static void _0RL_lcfn_6fe2f94a21a10053_e1000000(omniCallDescriptor* cd, omniServant* svnt) { _0RL_cd_6fe2f94a21a10053_d1000000* tcd = (_0RL_cd_6fe2f94a21a10053_d1000000*)cd; Tango::_impl_Device_2* impl = (Tango::_impl_Device_2*) svnt->_ptrToInterface(Tango::Device_2::_PD_repoId); #ifdef HAS_Cplusplus_catch_exception_by_base tcd->result = impl->read_attributes_2(*tcd->arg_0, tcd->arg_1); #else if (!cd->is_upcall()) tcd->result = impl->read_attributes_2(*tcd->arg_0, tcd->arg_1); else { try { tcd->result = impl->read_attributes_2(*tcd->arg_0, tcd->arg_1); } catch(Tango::DevFailed& ex) { throw omniORB::StubUserException(ex._NP_duplicate()); } } #endif } Tango::AttributeValueList* Tango::_objref_Device_2::read_attributes_2(const ::Tango::DevVarStringArray& names, ::Tango::DevSource source) { _0RL_cd_6fe2f94a21a10053_d1000000 _call_desc(_0RL_lcfn_6fe2f94a21a10053_e1000000, "read_attributes_2", 18); _call_desc.arg_0 = &(::Tango::DevVarStringArray&) names; _call_desc.arg_1 = source; _invoke(_call_desc); return _call_desc.result._retn(); } // Proxy call descriptor class. Mangled signature: // _cTango_mAttributeConfigList__2_i_cTango_mDevVarStringArray_e_cTango_mDevFailed class _0RL_cd_6fe2f94a21a10053_f1000000 : public omniCallDescriptor { public: inline _0RL_cd_6fe2f94a21a10053_f1000000(LocalCallFn lcfn,const char* op_,size_t oplen,_CORBA_Boolean upcall=0): omniCallDescriptor(lcfn, op_, oplen, 0, _user_exns, 1, upcall) { } void marshalArguments(cdrStream&); void unmarshalArguments(cdrStream&); void unmarshalReturnedValues(cdrStream&); void marshalReturnedValues(cdrStream&); void userException(cdrStream&,_OMNI_NS(IOP_C)*,const char*); static const char* const _user_exns[]; Tango::DevVarStringArray_var arg_0_; const Tango::DevVarStringArray* arg_0; Tango::AttributeConfigList_2_var result; }; void _0RL_cd_6fe2f94a21a10053_f1000000::marshalArguments(cdrStream& _n) { (const Tango::DevVarStringArray&) *arg_0 >>= _n; } void _0RL_cd_6fe2f94a21a10053_f1000000::unmarshalArguments(cdrStream& _n) { arg_0_ = new Tango::DevVarStringArray; (Tango::DevVarStringArray&)arg_0_ <<= _n; arg_0 = &arg_0_.in(); } void _0RL_cd_6fe2f94a21a10053_f1000000::marshalReturnedValues(cdrStream& _n) { (const Tango::AttributeConfigList_2&) result >>= _n; } void _0RL_cd_6fe2f94a21a10053_f1000000::unmarshalReturnedValues(cdrStream& _n) { result = new Tango::AttributeConfigList_2; (Tango::AttributeConfigList_2&)result <<= _n; } const char* const _0RL_cd_6fe2f94a21a10053_f1000000::_user_exns[] = { Tango::DevFailed::_PD_repoId }; void _0RL_cd_6fe2f94a21a10053_f1000000::userException(cdrStream& s, _OMNI_NS(IOP_C)* iop_client, const char* repoId) { if ( omni::strMatch(repoId, Tango::DevFailed::_PD_repoId) ) { Tango::DevFailed _ex; _ex <<= s; if (iop_client) iop_client->RequestCompleted(); throw _ex; } else { if (iop_client) iop_client->RequestCompleted(1); OMNIORB_THROW(UNKNOWN,UNKNOWN_UserException, (::CORBA::CompletionStatus)s.completion()); } } // Local call call-back function. static void _0RL_lcfn_6fe2f94a21a10053_02000000(omniCallDescriptor* cd, omniServant* svnt) { _0RL_cd_6fe2f94a21a10053_f1000000* tcd = (_0RL_cd_6fe2f94a21a10053_f1000000*)cd; Tango::_impl_Device_2* impl = (Tango::_impl_Device_2*) svnt->_ptrToInterface(Tango::Device_2::_PD_repoId); #ifdef HAS_Cplusplus_catch_exception_by_base tcd->result = impl->get_attribute_config_2(*tcd->arg_0); #else if (!cd->is_upcall()) tcd->result = impl->get_attribute_config_2(*tcd->arg_0); else { try { tcd->result = impl->get_attribute_config_2(*tcd->arg_0); } catch(Tango::DevFailed& ex) { throw omniORB::StubUserException(ex._NP_duplicate()); } } #endif } Tango::AttributeConfigList_2* Tango::_objref_Device_2::get_attribute_config_2(const ::Tango::DevVarStringArray& names) { _0RL_cd_6fe2f94a21a10053_f1000000 _call_desc(_0RL_lcfn_6fe2f94a21a10053_02000000, "get_attribute_config_2", 23); _call_desc.arg_0 = &(::Tango::DevVarStringArray&) names; _invoke(_call_desc); return _call_desc.result._retn(); } // Proxy call descriptor class. Mangled signature: // _cTango_mDevCmdInfoList__2_e_cTango_mDevFailed class _0RL_cd_6fe2f94a21a10053_12000000 : public omniCallDescriptor { public: inline _0RL_cd_6fe2f94a21a10053_12000000(LocalCallFn lcfn,const char* op_,size_t oplen,_CORBA_Boolean upcall=0): omniCallDescriptor(lcfn, op_, oplen, 0, _user_exns, 1, upcall) { } void unmarshalReturnedValues(cdrStream&); void marshalReturnedValues(cdrStream&); void userException(cdrStream&,_OMNI_NS(IOP_C)*,const char*); static const char* const _user_exns[]; Tango::DevCmdInfoList_2_var result; }; void _0RL_cd_6fe2f94a21a10053_12000000::marshalReturnedValues(cdrStream& _n) { (const Tango::DevCmdInfoList_2&) result >>= _n; } void _0RL_cd_6fe2f94a21a10053_12000000::unmarshalReturnedValues(cdrStream& _n) { result = new Tango::DevCmdInfoList_2; (Tango::DevCmdInfoList_2&)result <<= _n; } const char* const _0RL_cd_6fe2f94a21a10053_12000000::_user_exns[] = { Tango::DevFailed::_PD_repoId }; void _0RL_cd_6fe2f94a21a10053_12000000::userException(cdrStream& s, _OMNI_NS(IOP_C)* iop_client, const char* repoId) { if ( omni::strMatch(repoId, Tango::DevFailed::_PD_repoId) ) { Tango::DevFailed _ex; _ex <<= s; if (iop_client) iop_client->RequestCompleted(); throw _ex; } else { if (iop_client) iop_client->RequestCompleted(1); OMNIORB_THROW(UNKNOWN,UNKNOWN_UserException, (::CORBA::CompletionStatus)s.completion()); } } // Local call call-back function. static void _0RL_lcfn_6fe2f94a21a10053_22000000(omniCallDescriptor* cd, omniServant* svnt) { _0RL_cd_6fe2f94a21a10053_12000000* tcd = (_0RL_cd_6fe2f94a21a10053_12000000*)cd; Tango::_impl_Device_2* impl = (Tango::_impl_Device_2*) svnt->_ptrToInterface(Tango::Device_2::_PD_repoId); #ifdef HAS_Cplusplus_catch_exception_by_base tcd->result = impl->command_list_query_2(); #else if (!cd->is_upcall()) tcd->result = impl->command_list_query_2(); else { try { tcd->result = impl->command_list_query_2(); } catch(Tango::DevFailed& ex) { throw omniORB::StubUserException(ex._NP_duplicate()); } } #endif } Tango::DevCmdInfoList_2* Tango::_objref_Device_2::command_list_query_2() { _0RL_cd_6fe2f94a21a10053_12000000 _call_desc(_0RL_lcfn_6fe2f94a21a10053_22000000, "command_list_query_2", 21); _invoke(_call_desc); return _call_desc.result._retn(); } // Proxy call descriptor class. Mangled signature: // _cTango_mDevCmdInfo__2_i_cstring_e_cTango_mDevFailed class _0RL_cd_6fe2f94a21a10053_32000000 : public omniCallDescriptor { public: inline _0RL_cd_6fe2f94a21a10053_32000000(LocalCallFn lcfn,const char* op_,size_t oplen,_CORBA_Boolean upcall=0): omniCallDescriptor(lcfn, op_, oplen, 0, _user_exns, 1, upcall) { } void marshalArguments(cdrStream&); void unmarshalArguments(cdrStream&); void unmarshalReturnedValues(cdrStream&); void marshalReturnedValues(cdrStream&); void userException(cdrStream&,_OMNI_NS(IOP_C)*,const char*); static const char* const _user_exns[]; ::CORBA::String_var arg_0_; const char* arg_0; Tango::DevCmdInfo_2_var result; }; void _0RL_cd_6fe2f94a21a10053_32000000::marshalArguments(cdrStream& _n) { _n.marshalString(arg_0,0); } void _0RL_cd_6fe2f94a21a10053_32000000::unmarshalArguments(cdrStream& _n) { arg_0_ = _n.unmarshalString(0); arg_0 = arg_0_.in(); } void _0RL_cd_6fe2f94a21a10053_32000000::marshalReturnedValues(cdrStream& _n) { (const Tango::DevCmdInfo_2&) result >>= _n; } void _0RL_cd_6fe2f94a21a10053_32000000::unmarshalReturnedValues(cdrStream& _n) { result = new Tango::DevCmdInfo_2; (Tango::DevCmdInfo_2&)result <<= _n; } const char* const _0RL_cd_6fe2f94a21a10053_32000000::_user_exns[] = { Tango::DevFailed::_PD_repoId }; void _0RL_cd_6fe2f94a21a10053_32000000::userException(cdrStream& s, _OMNI_NS(IOP_C)* iop_client, const char* repoId) { if ( omni::strMatch(repoId, Tango::DevFailed::_PD_repoId) ) { Tango::DevFailed _ex; _ex <<= s; if (iop_client) iop_client->RequestCompleted(); throw _ex; } else { if (iop_client) iop_client->RequestCompleted(1); OMNIORB_THROW(UNKNOWN,UNKNOWN_UserException, (::CORBA::CompletionStatus)s.completion()); } } // Local call call-back function. static void _0RL_lcfn_6fe2f94a21a10053_42000000(omniCallDescriptor* cd, omniServant* svnt) { _0RL_cd_6fe2f94a21a10053_32000000* tcd = (_0RL_cd_6fe2f94a21a10053_32000000*)cd; Tango::_impl_Device_2* impl = (Tango::_impl_Device_2*) svnt->_ptrToInterface(Tango::Device_2::_PD_repoId); #ifdef HAS_Cplusplus_catch_exception_by_base tcd->result = impl->command_query_2(tcd->arg_0); #else if (!cd->is_upcall()) tcd->result = impl->command_query_2(tcd->arg_0); else { try { tcd->result = impl->command_query_2(tcd->arg_0); } catch(Tango::DevFailed& ex) { throw omniORB::StubUserException(ex._NP_duplicate()); } } #endif } Tango::DevCmdInfo_2* Tango::_objref_Device_2::command_query_2(const char* command) { _0RL_cd_6fe2f94a21a10053_32000000 _call_desc(_0RL_lcfn_6fe2f94a21a10053_42000000, "command_query_2", 16); _call_desc.arg_0 = command; _invoke(_call_desc); return _call_desc.result._retn(); } // Proxy call descriptor class. Mangled signature: // _cTango_mDevCmdHistoryList_i_cstring_i_clong_e_cTango_mDevFailed class _0RL_cd_6fe2f94a21a10053_52000000 : public omniCallDescriptor { public: inline _0RL_cd_6fe2f94a21a10053_52000000(LocalCallFn lcfn,const char* op_,size_t oplen,_CORBA_Boolean upcall=0): omniCallDescriptor(lcfn, op_, oplen, 0, _user_exns, 1, upcall) { } void marshalArguments(cdrStream&); void unmarshalArguments(cdrStream&); void unmarshalReturnedValues(cdrStream&); void marshalReturnedValues(cdrStream&); void userException(cdrStream&,_OMNI_NS(IOP_C)*,const char*); static const char* const _user_exns[]; ::CORBA::String_var arg_0_; const char* arg_0; ::CORBA::Long arg_1; Tango::DevCmdHistoryList_var result; }; void _0RL_cd_6fe2f94a21a10053_52000000::marshalArguments(cdrStream& _n) { _n.marshalString(arg_0,0); arg_1 >>= _n; } void _0RL_cd_6fe2f94a21a10053_52000000::unmarshalArguments(cdrStream& _n) { arg_0_ = _n.unmarshalString(0); arg_0 = arg_0_.in(); (::CORBA::Long&)arg_1 <<= _n; } void _0RL_cd_6fe2f94a21a10053_52000000::marshalReturnedValues(cdrStream& _n) { (const Tango::DevCmdHistoryList&) result >>= _n; } void _0RL_cd_6fe2f94a21a10053_52000000::unmarshalReturnedValues(cdrStream& _n) { result = new Tango::DevCmdHistoryList; (Tango::DevCmdHistoryList&)result <<= _n; } const char* const _0RL_cd_6fe2f94a21a10053_52000000::_user_exns[] = { Tango::DevFailed::_PD_repoId }; void _0RL_cd_6fe2f94a21a10053_52000000::userException(cdrStream& s, _OMNI_NS(IOP_C)* iop_client, const char* repoId) { if ( omni::strMatch(repoId, Tango::DevFailed::_PD_repoId) ) { Tango::DevFailed _ex; _ex <<= s; if (iop_client) iop_client->RequestCompleted(); throw _ex; } else { if (iop_client) iop_client->RequestCompleted(1); OMNIORB_THROW(UNKNOWN,UNKNOWN_UserException, (::CORBA::CompletionStatus)s.completion()); } } // Local call call-back function. static void _0RL_lcfn_6fe2f94a21a10053_62000000(omniCallDescriptor* cd, omniServant* svnt) { _0RL_cd_6fe2f94a21a10053_52000000* tcd = (_0RL_cd_6fe2f94a21a10053_52000000*)cd; Tango::_impl_Device_2* impl = (Tango::_impl_Device_2*) svnt->_ptrToInterface(Tango::Device_2::_PD_repoId); #ifdef HAS_Cplusplus_catch_exception_by_base tcd->result = impl->command_inout_history_2(tcd->arg_0, tcd->arg_1); #else if (!cd->is_upcall()) tcd->result = impl->command_inout_history_2(tcd->arg_0, tcd->arg_1); else { try { tcd->result = impl->command_inout_history_2(tcd->arg_0, tcd->arg_1); } catch(Tango::DevFailed& ex) { throw omniORB::StubUserException(ex._NP_duplicate()); } } #endif } Tango::DevCmdHistoryList* Tango::_objref_Device_2::command_inout_history_2(const char* command, ::CORBA::Long n) { _0RL_cd_6fe2f94a21a10053_52000000 _call_desc(_0RL_lcfn_6fe2f94a21a10053_62000000, "command_inout_history_2", 24); _call_desc.arg_0 = command; _call_desc.arg_1 = n; _invoke(_call_desc); return _call_desc.result._retn(); } // Proxy call descriptor class. Mangled signature: // _cTango_mDevAttrHistoryList_i_cstring_i_clong_e_cTango_mDevFailed class _0RL_cd_6fe2f94a21a10053_72000000 : public omniCallDescriptor { public: inline _0RL_cd_6fe2f94a21a10053_72000000(LocalCallFn lcfn,const char* op_,size_t oplen,_CORBA_Boolean upcall=0): omniCallDescriptor(lcfn, op_, oplen, 0, _user_exns, 1, upcall) { } void marshalArguments(cdrStream&); void unmarshalArguments(cdrStream&); void unmarshalReturnedValues(cdrStream&); void marshalReturnedValues(cdrStream&); void userException(cdrStream&,_OMNI_NS(IOP_C)*,const char*); static const char* const _user_exns[]; ::CORBA::String_var arg_0_; const char* arg_0; ::CORBA::Long arg_1; Tango::DevAttrHistoryList_var result; }; void _0RL_cd_6fe2f94a21a10053_72000000::marshalArguments(cdrStream& _n) { _n.marshalString(arg_0,0); arg_1 >>= _n; } void _0RL_cd_6fe2f94a21a10053_72000000::unmarshalArguments(cdrStream& _n) { arg_0_ = _n.unmarshalString(0); arg_0 = arg_0_.in(); (::CORBA::Long&)arg_1 <<= _n; } void _0RL_cd_6fe2f94a21a10053_72000000::marshalReturnedValues(cdrStream& _n) { (const Tango::DevAttrHistoryList&) result >>= _n; } void _0RL_cd_6fe2f94a21a10053_72000000::unmarshalReturnedValues(cdrStream& _n) { result = new Tango::DevAttrHistoryList; (Tango::DevAttrHistoryList&)result <<= _n; } const char* const _0RL_cd_6fe2f94a21a10053_72000000::_user_exns[] = { Tango::DevFailed::_PD_repoId }; void _0RL_cd_6fe2f94a21a10053_72000000::userException(cdrStream& s, _OMNI_NS(IOP_C)* iop_client, const char* repoId) { if ( omni::strMatch(repoId, Tango::DevFailed::_PD_repoId) ) { Tango::DevFailed _ex; _ex <<= s; if (iop_client) iop_client->RequestCompleted(); throw _ex; } else { if (iop_client) iop_client->RequestCompleted(1); OMNIORB_THROW(UNKNOWN,UNKNOWN_UserException, (::CORBA::CompletionStatus)s.completion()); } } // Local call call-back function. static void _0RL_lcfn_6fe2f94a21a10053_82000000(omniCallDescriptor* cd, omniServant* svnt) { _0RL_cd_6fe2f94a21a10053_72000000* tcd = (_0RL_cd_6fe2f94a21a10053_72000000*)cd; Tango::_impl_Device_2* impl = (Tango::_impl_Device_2*) svnt->_ptrToInterface(Tango::Device_2::_PD_repoId); #ifdef HAS_Cplusplus_catch_exception_by_base tcd->result = impl->read_attribute_history_2(tcd->arg_0, tcd->arg_1); #else if (!cd->is_upcall()) tcd->result = impl->read_attribute_history_2(tcd->arg_0, tcd->arg_1); else { try { tcd->result = impl->read_attribute_history_2(tcd->arg_0, tcd->arg_1); } catch(Tango::DevFailed& ex) { throw omniORB::StubUserException(ex._NP_duplicate()); } } #endif } Tango::DevAttrHistoryList* Tango::_objref_Device_2::read_attribute_history_2(const char* name, ::CORBA::Long n) { _0RL_cd_6fe2f94a21a10053_72000000 _call_desc(_0RL_lcfn_6fe2f94a21a10053_82000000, "read_attribute_history_2", 25); _call_desc.arg_0 = name; _call_desc.arg_1 = n; _invoke(_call_desc); return _call_desc.result._retn(); } Tango::_pof_Device_2::~_pof_Device_2() {} omniObjRef* Tango::_pof_Device_2::newObjRef(omniIOR* ior, omniIdentity* id) { return new ::Tango::_objref_Device_2(ior, id); } ::CORBA::Boolean Tango::_pof_Device_2::is_a(const char* id) const { if( omni::ptrStrMatch(id, ::Tango::Device_2::_PD_repoId) ) return 1; if( omni::ptrStrMatch(id, Tango::Device::_PD_repoId) ) return 1; return 0; } const Tango::_pof_Device_2 _the_pof_Tango_mDevice__2; Tango::_impl_Device_2::~_impl_Device_2() {} ::CORBA::Boolean Tango::_impl_Device_2::_dispatch(omniCallHandle& _handle) { const char* op = _handle.operation_name(); if( omni::strMatch(op, "command_inout_2") ) { _0RL_cd_6fe2f94a21a10053_b1000000 _call_desc(_0RL_lcfn_6fe2f94a21a10053_c1000000, "command_inout_2", 16, 1); _handle.upcall(this,_call_desc); return 1; } if( omni::strMatch(op, "read_attributes_2") ) { _0RL_cd_6fe2f94a21a10053_d1000000 _call_desc(_0RL_lcfn_6fe2f94a21a10053_e1000000, "read_attributes_2", 18, 1); _handle.upcall(this,_call_desc); return 1; } if( omni::strMatch(op, "get_attribute_config_2") ) { _0RL_cd_6fe2f94a21a10053_f1000000 _call_desc(_0RL_lcfn_6fe2f94a21a10053_02000000, "get_attribute_config_2", 23, 1); _handle.upcall(this,_call_desc); return 1; } if( omni::strMatch(op, "command_list_query_2") ) { _0RL_cd_6fe2f94a21a10053_12000000 _call_desc(_0RL_lcfn_6fe2f94a21a10053_22000000, "command_list_query_2", 21, 1); _handle.upcall(this,_call_desc); return 1; } if( omni::strMatch(op, "command_query_2") ) { _0RL_cd_6fe2f94a21a10053_32000000 _call_desc(_0RL_lcfn_6fe2f94a21a10053_42000000, "command_query_2", 16, 1); _handle.upcall(this,_call_desc); return 1; } if( omni::strMatch(op, "command_inout_history_2") ) { _0RL_cd_6fe2f94a21a10053_52000000 _call_desc(_0RL_lcfn_6fe2f94a21a10053_62000000, "command_inout_history_2", 24, 1); _handle.upcall(this,_call_desc); return 1; } if( omni::strMatch(op, "read_attribute_history_2") ) { _0RL_cd_6fe2f94a21a10053_72000000 _call_desc(_0RL_lcfn_6fe2f94a21a10053_82000000, "read_attribute_history_2", 25, 1); _handle.upcall(this,_call_desc); return 1; } #ifndef _MSC_VER if( _impl_Device::_dispatch(_handle) ) { return 1; } #else // Work-around for incorrect MSVC code generation. if( ((_impl_Device*)this)-> _impl_Device::_dispatch(_handle) ) { return 1; } #endif return 0; } void* Tango::_impl_Device_2::_ptrToInterface(const char* id) { if( id == ::Tango::Device_2::_PD_repoId ) return (::Tango::_impl_Device_2*) this; if( id == ::Tango::Device::_PD_repoId ) return (::Tango::_impl_Device*) this; if( id == ::CORBA::Object::_PD_repoId ) return (void*) 1; if( omni::strMatch(id, ::Tango::Device_2::_PD_repoId) ) return (::Tango::_impl_Device_2*) this; if( omni::strMatch(id, ::Tango::Device::_PD_repoId) ) return (::Tango::_impl_Device*) this; if( omni::strMatch(id, ::CORBA::Object::_PD_repoId) ) return (void*) 1; return 0; } const char* Tango::_impl_Device_2::_mostDerivedRepoId() { return ::Tango::Device_2::_PD_repoId; } Tango::Device_3_ptr Tango::Device_3_Helper::_nil() { return ::Tango::Device_3::_nil(); } ::CORBA::Boolean Tango::Device_3_Helper::is_nil(::Tango::Device_3_ptr p) { return ::CORBA::is_nil(p); } void Tango::Device_3_Helper::release(::Tango::Device_3_ptr p) { ::CORBA::release(p); } void Tango::Device_3_Helper::marshalObjRef(::Tango::Device_3_ptr obj, cdrStream& s) { ::Tango::Device_3::_marshalObjRef(obj, s); } Tango::Device_3_ptr Tango::Device_3_Helper::unmarshalObjRef(cdrStream& s) { return ::Tango::Device_3::_unmarshalObjRef(s); } void Tango::Device_3_Helper::duplicate(::Tango::Device_3_ptr obj) { if( obj && !obj->_NP_is_nil() ) omni::duplicateObjRef(obj); } Tango::Device_3_ptr Tango::Device_3::_duplicate(::Tango::Device_3_ptr obj) { if( obj && !obj->_NP_is_nil() ) omni::duplicateObjRef(obj); return obj; } Tango::Device_3_ptr Tango::Device_3::_narrow(::CORBA::Object_ptr obj) { if( !obj || obj->_NP_is_nil() || obj->_NP_is_pseudo() ) return _nil(); _ptr_type e = (_ptr_type) obj->_PR_getobj()->_realNarrow(_PD_repoId); return e ? e : _nil(); } Tango::Device_3_ptr Tango::Device_3::_unchecked_narrow(::CORBA::Object_ptr obj) { if( !obj || obj->_NP_is_nil() || obj->_NP_is_pseudo() ) return _nil(); _ptr_type e = (_ptr_type) obj->_PR_getobj()->_uncheckedNarrow(_PD_repoId); return e ? e : _nil(); } Tango::Device_3_ptr Tango::Device_3::_nil() { #ifdef OMNI_UNLOADABLE_STUBS static _objref_Device_3 _the_nil_obj; return &_the_nil_obj; #else static _objref_Device_3* _the_nil_ptr = 0; if( !_the_nil_ptr ) { omni::nilRefLock().lock(); if( !_the_nil_ptr ) { _the_nil_ptr = new _objref_Device_3; registerNilCorbaObject(_the_nil_ptr); } omni::nilRefLock().unlock(); } return _the_nil_ptr; #endif } const char* Tango::Device_3::_PD_repoId = "IDL:Tango/Device_3:1.0"; Tango::_objref_Device_3::~_objref_Device_3() { } Tango::_objref_Device_3::_objref_Device_3(omniIOR* ior, omniIdentity* id) : omniObjRef(::Tango::Device_3::_PD_repoId, ior, id, 1), _objref_Device_2(ior, id) { _PR_setobj(this); } void* Tango::_objref_Device_3::_ptrToObjRef(const char* id) { if( id == ::Tango::Device_3::_PD_repoId ) return (::Tango::Device_3_ptr) this; if( id == ::Tango::Device_2::_PD_repoId ) return (::Tango::Device_2_ptr) this; if( id == ::Tango::Device::_PD_repoId ) return (::Tango::Device_ptr) this; if( id == ::CORBA::Object::_PD_repoId ) return (::CORBA::Object_ptr) this; if( omni::strMatch(id, ::Tango::Device_3::_PD_repoId) ) return (::Tango::Device_3_ptr) this; if( omni::strMatch(id, ::Tango::Device_2::_PD_repoId) ) return (::Tango::Device_2_ptr) this; if( omni::strMatch(id, ::Tango::Device::_PD_repoId) ) return (::Tango::Device_ptr) this; if( omni::strMatch(id, ::CORBA::Object::_PD_repoId) ) return (::CORBA::Object_ptr) this; return 0; } // Proxy call descriptor class. Mangled signature: // _cTango_mAttributeValueList__3_i_cTango_mDevVarStringArray_i_cTango_mDevSource_e_cTango_mDevFailed class _0RL_cd_6fe2f94a21a10053_92000000 : public omniCallDescriptor { public: inline _0RL_cd_6fe2f94a21a10053_92000000(LocalCallFn lcfn,const char* op_,size_t oplen,_CORBA_Boolean upcall=0): omniCallDescriptor(lcfn, op_, oplen, 0, _user_exns, 1, upcall) { } void marshalArguments(cdrStream&); void unmarshalArguments(cdrStream&); void unmarshalReturnedValues(cdrStream&); void marshalReturnedValues(cdrStream&); void userException(cdrStream&,_OMNI_NS(IOP_C)*,const char*); static const char* const _user_exns[]; Tango::DevVarStringArray_var arg_0_; const Tango::DevVarStringArray* arg_0; Tango::DevSource arg_1; Tango::AttributeValueList_3_var result; }; void _0RL_cd_6fe2f94a21a10053_92000000::marshalArguments(cdrStream& _n) { (const Tango::DevVarStringArray&) *arg_0 >>= _n; arg_1 >>= _n; } void _0RL_cd_6fe2f94a21a10053_92000000::unmarshalArguments(cdrStream& _n) { arg_0_ = new Tango::DevVarStringArray; (Tango::DevVarStringArray&)arg_0_ <<= _n; arg_0 = &arg_0_.in(); (Tango::DevSource&)arg_1 <<= _n; } void _0RL_cd_6fe2f94a21a10053_92000000::marshalReturnedValues(cdrStream& _n) { (const Tango::AttributeValueList_3&) result >>= _n; } void _0RL_cd_6fe2f94a21a10053_92000000::unmarshalReturnedValues(cdrStream& _n) { result = new Tango::AttributeValueList_3; (Tango::AttributeValueList_3&)result <<= _n; } const char* const _0RL_cd_6fe2f94a21a10053_92000000::_user_exns[] = { Tango::DevFailed::_PD_repoId }; void _0RL_cd_6fe2f94a21a10053_92000000::userException(cdrStream& s, _OMNI_NS(IOP_C)* iop_client, const char* repoId) { if ( omni::strMatch(repoId, Tango::DevFailed::_PD_repoId) ) { Tango::DevFailed _ex; _ex <<= s; if (iop_client) iop_client->RequestCompleted(); throw _ex; } else { if (iop_client) iop_client->RequestCompleted(1); OMNIORB_THROW(UNKNOWN,UNKNOWN_UserException, (::CORBA::CompletionStatus)s.completion()); } } // Local call call-back function. static void _0RL_lcfn_6fe2f94a21a10053_a2000000(omniCallDescriptor* cd, omniServant* svnt) { _0RL_cd_6fe2f94a21a10053_92000000* tcd = (_0RL_cd_6fe2f94a21a10053_92000000*)cd; Tango::_impl_Device_3* impl = (Tango::_impl_Device_3*) svnt->_ptrToInterface(Tango::Device_3::_PD_repoId); #ifdef HAS_Cplusplus_catch_exception_by_base tcd->result = impl->read_attributes_3(*tcd->arg_0, tcd->arg_1); #else if (!cd->is_upcall()) tcd->result = impl->read_attributes_3(*tcd->arg_0, tcd->arg_1); else { try { tcd->result = impl->read_attributes_3(*tcd->arg_0, tcd->arg_1); } catch(Tango::DevFailed& ex) { throw omniORB::StubUserException(ex._NP_duplicate()); } } #endif } Tango::AttributeValueList_3* Tango::_objref_Device_3::read_attributes_3(const ::Tango::DevVarStringArray& names, ::Tango::DevSource source) { _0RL_cd_6fe2f94a21a10053_92000000 _call_desc(_0RL_lcfn_6fe2f94a21a10053_a2000000, "read_attributes_3", 18); _call_desc.arg_0 = &(::Tango::DevVarStringArray&) names; _call_desc.arg_1 = source; _invoke(_call_desc); return _call_desc.result._retn(); } // Proxy call descriptor class. Mangled signature: // void_i_cTango_mAttributeValueList_e_cTango_mDevFailed_e_cTango_mMultiDevFailed class _0RL_cd_6fe2f94a21a10053_b2000000 : public omniCallDescriptor { public: inline _0RL_cd_6fe2f94a21a10053_b2000000(LocalCallFn lcfn,const char* op_,size_t oplen,_CORBA_Boolean upcall=0): omniCallDescriptor(lcfn, op_, oplen, 0, _user_exns, 2, upcall) { } void marshalArguments(cdrStream&); void unmarshalArguments(cdrStream&); void userException(cdrStream&,_OMNI_NS(IOP_C)*,const char*); static const char* const _user_exns[]; Tango::AttributeValueList_var arg_0_; const Tango::AttributeValueList* arg_0; }; void _0RL_cd_6fe2f94a21a10053_b2000000::marshalArguments(cdrStream& _n) { (const Tango::AttributeValueList&) *arg_0 >>= _n; } void _0RL_cd_6fe2f94a21a10053_b2000000::unmarshalArguments(cdrStream& _n) { arg_0_ = new Tango::AttributeValueList; (Tango::AttributeValueList&)arg_0_ <<= _n; arg_0 = &arg_0_.in(); } const char* const _0RL_cd_6fe2f94a21a10053_b2000000::_user_exns[] = { Tango::DevFailed::_PD_repoId, Tango::MultiDevFailed::_PD_repoId }; void _0RL_cd_6fe2f94a21a10053_b2000000::userException(cdrStream& s, _OMNI_NS(IOP_C)* iop_client, const char* repoId) { if ( omni::strMatch(repoId, Tango::DevFailed::_PD_repoId) ) { Tango::DevFailed _ex; _ex <<= s; if (iop_client) iop_client->RequestCompleted(); throw _ex; } if ( omni::strMatch(repoId, Tango::MultiDevFailed::_PD_repoId) ) { Tango::MultiDevFailed _ex; _ex <<= s; if (iop_client) iop_client->RequestCompleted(); throw _ex; } else { if (iop_client) iop_client->RequestCompleted(1); OMNIORB_THROW(UNKNOWN,UNKNOWN_UserException, (::CORBA::CompletionStatus)s.completion()); } } // Local call call-back function. static void _0RL_lcfn_6fe2f94a21a10053_c2000000(omniCallDescriptor* cd, omniServant* svnt) { _0RL_cd_6fe2f94a21a10053_b2000000* tcd = (_0RL_cd_6fe2f94a21a10053_b2000000*)cd; Tango::_impl_Device_3* impl = (Tango::_impl_Device_3*) svnt->_ptrToInterface(Tango::Device_3::_PD_repoId); #ifdef HAS_Cplusplus_catch_exception_by_base impl->write_attributes_3(*tcd->arg_0); #else if (!cd->is_upcall()) impl->write_attributes_3(*tcd->arg_0); else { try { impl->write_attributes_3(*tcd->arg_0); } catch(Tango::DevFailed& ex) { throw omniORB::StubUserException(ex._NP_duplicate()); } catch(Tango::MultiDevFailed& ex) { throw omniORB::StubUserException(ex._NP_duplicate()); } } #endif } void Tango::_objref_Device_3::write_attributes_3(const ::Tango::AttributeValueList& values) { _0RL_cd_6fe2f94a21a10053_b2000000 _call_desc(_0RL_lcfn_6fe2f94a21a10053_c2000000, "write_attributes_3", 19); _call_desc.arg_0 = &(::Tango::AttributeValueList&) values; _invoke(_call_desc); } // Proxy call descriptor class. Mangled signature: // _cTango_mDevAttrHistoryList__3_i_cstring_i_clong_e_cTango_mDevFailed class _0RL_cd_6fe2f94a21a10053_d2000000 : public omniCallDescriptor { public: inline _0RL_cd_6fe2f94a21a10053_d2000000(LocalCallFn lcfn,const char* op_,size_t oplen,_CORBA_Boolean upcall=0): omniCallDescriptor(lcfn, op_, oplen, 0, _user_exns, 1, upcall) { } void marshalArguments(cdrStream&); void unmarshalArguments(cdrStream&); void unmarshalReturnedValues(cdrStream&); void marshalReturnedValues(cdrStream&); void userException(cdrStream&,_OMNI_NS(IOP_C)*,const char*); static const char* const _user_exns[]; ::CORBA::String_var arg_0_; const char* arg_0; ::CORBA::Long arg_1; Tango::DevAttrHistoryList_3_var result; }; void _0RL_cd_6fe2f94a21a10053_d2000000::marshalArguments(cdrStream& _n) { _n.marshalString(arg_0,0); arg_1 >>= _n; } void _0RL_cd_6fe2f94a21a10053_d2000000::unmarshalArguments(cdrStream& _n) { arg_0_ = _n.unmarshalString(0); arg_0 = arg_0_.in(); (::CORBA::Long&)arg_1 <<= _n; } void _0RL_cd_6fe2f94a21a10053_d2000000::marshalReturnedValues(cdrStream& _n) { (const Tango::DevAttrHistoryList_3&) result >>= _n; } void _0RL_cd_6fe2f94a21a10053_d2000000::unmarshalReturnedValues(cdrStream& _n) { result = new Tango::DevAttrHistoryList_3; (Tango::DevAttrHistoryList_3&)result <<= _n; } const char* const _0RL_cd_6fe2f94a21a10053_d2000000::_user_exns[] = { Tango::DevFailed::_PD_repoId }; void _0RL_cd_6fe2f94a21a10053_d2000000::userException(cdrStream& s, _OMNI_NS(IOP_C)* iop_client, const char* repoId) { if ( omni::strMatch(repoId, Tango::DevFailed::_PD_repoId) ) { Tango::DevFailed _ex; _ex <<= s; if (iop_client) iop_client->RequestCompleted(); throw _ex; } else { if (iop_client) iop_client->RequestCompleted(1); OMNIORB_THROW(UNKNOWN,UNKNOWN_UserException, (::CORBA::CompletionStatus)s.completion()); } } // Local call call-back function. static void _0RL_lcfn_6fe2f94a21a10053_e2000000(omniCallDescriptor* cd, omniServant* svnt) { _0RL_cd_6fe2f94a21a10053_d2000000* tcd = (_0RL_cd_6fe2f94a21a10053_d2000000*)cd; Tango::_impl_Device_3* impl = (Tango::_impl_Device_3*) svnt->_ptrToInterface(Tango::Device_3::_PD_repoId); #ifdef HAS_Cplusplus_catch_exception_by_base tcd->result = impl->read_attribute_history_3(tcd->arg_0, tcd->arg_1); #else if (!cd->is_upcall()) tcd->result = impl->read_attribute_history_3(tcd->arg_0, tcd->arg_1); else { try { tcd->result = impl->read_attribute_history_3(tcd->arg_0, tcd->arg_1); } catch(Tango::DevFailed& ex) { throw omniORB::StubUserException(ex._NP_duplicate()); } } #endif } Tango::DevAttrHistoryList_3* Tango::_objref_Device_3::read_attribute_history_3(const char* name, ::CORBA::Long n) { _0RL_cd_6fe2f94a21a10053_d2000000 _call_desc(_0RL_lcfn_6fe2f94a21a10053_e2000000, "read_attribute_history_3", 25); _call_desc.arg_0 = name; _call_desc.arg_1 = n; _invoke(_call_desc); return _call_desc.result._retn(); } // Proxy call descriptor class. Mangled signature: // _cTango_mDevInfo__3_e_cTango_mDevFailed class _0RL_cd_6fe2f94a21a10053_f2000000 : public omniCallDescriptor { public: inline _0RL_cd_6fe2f94a21a10053_f2000000(LocalCallFn lcfn,const char* op_,size_t oplen,_CORBA_Boolean upcall=0): omniCallDescriptor(lcfn, op_, oplen, 0, _user_exns, 1, upcall) { } void unmarshalReturnedValues(cdrStream&); void marshalReturnedValues(cdrStream&); void userException(cdrStream&,_OMNI_NS(IOP_C)*,const char*); static const char* const _user_exns[]; Tango::DevInfo_3_var result; }; void _0RL_cd_6fe2f94a21a10053_f2000000::marshalReturnedValues(cdrStream& _n) { (const Tango::DevInfo_3&) result >>= _n; } void _0RL_cd_6fe2f94a21a10053_f2000000::unmarshalReturnedValues(cdrStream& _n) { result = new Tango::DevInfo_3; (Tango::DevInfo_3&)result <<= _n; } const char* const _0RL_cd_6fe2f94a21a10053_f2000000::_user_exns[] = { Tango::DevFailed::_PD_repoId }; void _0RL_cd_6fe2f94a21a10053_f2000000::userException(cdrStream& s, _OMNI_NS(IOP_C)* iop_client, const char* repoId) { if ( omni::strMatch(repoId, Tango::DevFailed::_PD_repoId) ) { Tango::DevFailed _ex; _ex <<= s; if (iop_client) iop_client->RequestCompleted(); throw _ex; } else { if (iop_client) iop_client->RequestCompleted(1); OMNIORB_THROW(UNKNOWN,UNKNOWN_UserException, (::CORBA::CompletionStatus)s.completion()); } } // Local call call-back function. static void _0RL_lcfn_6fe2f94a21a10053_03000000(omniCallDescriptor* cd, omniServant* svnt) { _0RL_cd_6fe2f94a21a10053_f2000000* tcd = (_0RL_cd_6fe2f94a21a10053_f2000000*)cd; Tango::_impl_Device_3* impl = (Tango::_impl_Device_3*) svnt->_ptrToInterface(Tango::Device_3::_PD_repoId); #ifdef HAS_Cplusplus_catch_exception_by_base tcd->result = impl->info_3(); #else if (!cd->is_upcall()) tcd->result = impl->info_3(); else { try { tcd->result = impl->info_3(); } catch(Tango::DevFailed& ex) { throw omniORB::StubUserException(ex._NP_duplicate()); } } #endif } Tango::DevInfo_3* Tango::_objref_Device_3::info_3() { _0RL_cd_6fe2f94a21a10053_f2000000 _call_desc(_0RL_lcfn_6fe2f94a21a10053_03000000, "info_3", 7); _invoke(_call_desc); return _call_desc.result._retn(); } // Proxy call descriptor class. Mangled signature: // _cTango_mAttributeConfigList__3_i_cTango_mDevVarStringArray_e_cTango_mDevFailed class _0RL_cd_6fe2f94a21a10053_13000000 : public omniCallDescriptor { public: inline _0RL_cd_6fe2f94a21a10053_13000000(LocalCallFn lcfn,const char* op_,size_t oplen,_CORBA_Boolean upcall=0): omniCallDescriptor(lcfn, op_, oplen, 0, _user_exns, 1, upcall) { } void marshalArguments(cdrStream&); void unmarshalArguments(cdrStream&); void unmarshalReturnedValues(cdrStream&); void marshalReturnedValues(cdrStream&); void userException(cdrStream&,_OMNI_NS(IOP_C)*,const char*); static const char* const _user_exns[]; Tango::DevVarStringArray_var arg_0_; const Tango::DevVarStringArray* arg_0; Tango::AttributeConfigList_3_var result; }; void _0RL_cd_6fe2f94a21a10053_13000000::marshalArguments(cdrStream& _n) { (const Tango::DevVarStringArray&) *arg_0 >>= _n; } void _0RL_cd_6fe2f94a21a10053_13000000::unmarshalArguments(cdrStream& _n) { arg_0_ = new Tango::DevVarStringArray; (Tango::DevVarStringArray&)arg_0_ <<= _n; arg_0 = &arg_0_.in(); } void _0RL_cd_6fe2f94a21a10053_13000000::marshalReturnedValues(cdrStream& _n) { (const Tango::AttributeConfigList_3&) result >>= _n; } void _0RL_cd_6fe2f94a21a10053_13000000::unmarshalReturnedValues(cdrStream& _n) { result = new Tango::AttributeConfigList_3; (Tango::AttributeConfigList_3&)result <<= _n; } const char* const _0RL_cd_6fe2f94a21a10053_13000000::_user_exns[] = { Tango::DevFailed::_PD_repoId }; void _0RL_cd_6fe2f94a21a10053_13000000::userException(cdrStream& s, _OMNI_NS(IOP_C)* iop_client, const char* repoId) { if ( omni::strMatch(repoId, Tango::DevFailed::_PD_repoId) ) { Tango::DevFailed _ex; _ex <<= s; if (iop_client) iop_client->RequestCompleted(); throw _ex; } else { if (iop_client) iop_client->RequestCompleted(1); OMNIORB_THROW(UNKNOWN,UNKNOWN_UserException, (::CORBA::CompletionStatus)s.completion()); } } // Local call call-back function. static void _0RL_lcfn_6fe2f94a21a10053_23000000(omniCallDescriptor* cd, omniServant* svnt) { _0RL_cd_6fe2f94a21a10053_13000000* tcd = (_0RL_cd_6fe2f94a21a10053_13000000*)cd; Tango::_impl_Device_3* impl = (Tango::_impl_Device_3*) svnt->_ptrToInterface(Tango::Device_3::_PD_repoId); #ifdef HAS_Cplusplus_catch_exception_by_base tcd->result = impl->get_attribute_config_3(*tcd->arg_0); #else if (!cd->is_upcall()) tcd->result = impl->get_attribute_config_3(*tcd->arg_0); else { try { tcd->result = impl->get_attribute_config_3(*tcd->arg_0); } catch(Tango::DevFailed& ex) { throw omniORB::StubUserException(ex._NP_duplicate()); } } #endif } Tango::AttributeConfigList_3* Tango::_objref_Device_3::get_attribute_config_3(const ::Tango::DevVarStringArray& names) { _0RL_cd_6fe2f94a21a10053_13000000 _call_desc(_0RL_lcfn_6fe2f94a21a10053_23000000, "get_attribute_config_3", 23); _call_desc.arg_0 = &(::Tango::DevVarStringArray&) names; _invoke(_call_desc); return _call_desc.result._retn(); } // Proxy call descriptor class. Mangled signature: // void_i_cTango_mAttributeConfigList__3_e_cTango_mDevFailed class _0RL_cd_6fe2f94a21a10053_33000000 : public omniCallDescriptor { public: inline _0RL_cd_6fe2f94a21a10053_33000000(LocalCallFn lcfn,const char* op_,size_t oplen,_CORBA_Boolean upcall=0): omniCallDescriptor(lcfn, op_, oplen, 0, _user_exns, 1, upcall) { } void marshalArguments(cdrStream&); void unmarshalArguments(cdrStream&); void userException(cdrStream&,_OMNI_NS(IOP_C)*,const char*); static const char* const _user_exns[]; Tango::AttributeConfigList_3_var arg_0_; const Tango::AttributeConfigList_3* arg_0; }; void _0RL_cd_6fe2f94a21a10053_33000000::marshalArguments(cdrStream& _n) { (const Tango::AttributeConfigList_3&) *arg_0 >>= _n; } void _0RL_cd_6fe2f94a21a10053_33000000::unmarshalArguments(cdrStream& _n) { arg_0_ = new Tango::AttributeConfigList_3; (Tango::AttributeConfigList_3&)arg_0_ <<= _n; arg_0 = &arg_0_.in(); } const char* const _0RL_cd_6fe2f94a21a10053_33000000::_user_exns[] = { Tango::DevFailed::_PD_repoId }; void _0RL_cd_6fe2f94a21a10053_33000000::userException(cdrStream& s, _OMNI_NS(IOP_C)* iop_client, const char* repoId) { if ( omni::strMatch(repoId, Tango::DevFailed::_PD_repoId) ) { Tango::DevFailed _ex; _ex <<= s; if (iop_client) iop_client->RequestCompleted(); throw _ex; } else { if (iop_client) iop_client->RequestCompleted(1); OMNIORB_THROW(UNKNOWN,UNKNOWN_UserException, (::CORBA::CompletionStatus)s.completion()); } } // Local call call-back function. static void _0RL_lcfn_6fe2f94a21a10053_43000000(omniCallDescriptor* cd, omniServant* svnt) { _0RL_cd_6fe2f94a21a10053_33000000* tcd = (_0RL_cd_6fe2f94a21a10053_33000000*)cd; Tango::_impl_Device_3* impl = (Tango::_impl_Device_3*) svnt->_ptrToInterface(Tango::Device_3::_PD_repoId); #ifdef HAS_Cplusplus_catch_exception_by_base impl->set_attribute_config_3(*tcd->arg_0); #else if (!cd->is_upcall()) impl->set_attribute_config_3(*tcd->arg_0); else { try { impl->set_attribute_config_3(*tcd->arg_0); } catch(Tango::DevFailed& ex) { throw omniORB::StubUserException(ex._NP_duplicate()); } } #endif } void Tango::_objref_Device_3::set_attribute_config_3(const ::Tango::AttributeConfigList_3& new_conf) { _0RL_cd_6fe2f94a21a10053_33000000 _call_desc(_0RL_lcfn_6fe2f94a21a10053_43000000, "set_attribute_config_3", 23); _call_desc.arg_0 = &(::Tango::AttributeConfigList_3&) new_conf; _invoke(_call_desc); } Tango::_pof_Device_3::~_pof_Device_3() {} omniObjRef* Tango::_pof_Device_3::newObjRef(omniIOR* ior, omniIdentity* id) { return new ::Tango::_objref_Device_3(ior, id); } ::CORBA::Boolean Tango::_pof_Device_3::is_a(const char* id) const { if( omni::ptrStrMatch(id, ::Tango::Device_3::_PD_repoId) ) return 1; if( omni::ptrStrMatch(id, Tango::Device_2::_PD_repoId) ) return 1; if( omni::ptrStrMatch(id, Tango::Device::_PD_repoId) ) return 1; return 0; } const Tango::_pof_Device_3 _the_pof_Tango_mDevice__3; Tango::_impl_Device_3::~_impl_Device_3() {} ::CORBA::Boolean Tango::_impl_Device_3::_dispatch(omniCallHandle& _handle) { const char* op = _handle.operation_name(); if( omni::strMatch(op, "read_attributes_3") ) { _0RL_cd_6fe2f94a21a10053_92000000 _call_desc(_0RL_lcfn_6fe2f94a21a10053_a2000000, "read_attributes_3", 18, 1); _handle.upcall(this,_call_desc); return 1; } if( omni::strMatch(op, "write_attributes_3") ) { _0RL_cd_6fe2f94a21a10053_b2000000 _call_desc(_0RL_lcfn_6fe2f94a21a10053_c2000000, "write_attributes_3", 19, 1); _handle.upcall(this,_call_desc); return 1; } if( omni::strMatch(op, "read_attribute_history_3") ) { _0RL_cd_6fe2f94a21a10053_d2000000 _call_desc(_0RL_lcfn_6fe2f94a21a10053_e2000000, "read_attribute_history_3", 25, 1); _handle.upcall(this,_call_desc); return 1; } if( omni::strMatch(op, "info_3") ) { _0RL_cd_6fe2f94a21a10053_f2000000 _call_desc(_0RL_lcfn_6fe2f94a21a10053_03000000, "info_3", 7, 1); _handle.upcall(this,_call_desc); return 1; } if( omni::strMatch(op, "get_attribute_config_3") ) { _0RL_cd_6fe2f94a21a10053_13000000 _call_desc(_0RL_lcfn_6fe2f94a21a10053_23000000, "get_attribute_config_3", 23, 1); _handle.upcall(this,_call_desc); return 1; } if( omni::strMatch(op, "set_attribute_config_3") ) { _0RL_cd_6fe2f94a21a10053_33000000 _call_desc(_0RL_lcfn_6fe2f94a21a10053_43000000, "set_attribute_config_3", 23, 1); _handle.upcall(this,_call_desc); return 1; } #ifndef _MSC_VER if( _impl_Device_2::_dispatch(_handle) ) { return 1; } #else // Work-around for incorrect MSVC code generation. if( ((_impl_Device_2*)this)-> _impl_Device_2::_dispatch(_handle) ) { return 1; } #endif return 0; } void* Tango::_impl_Device_3::_ptrToInterface(const char* id) { if( id == ::Tango::Device_3::_PD_repoId ) return (::Tango::_impl_Device_3*) this; if( id == ::Tango::Device_2::_PD_repoId ) return (::Tango::_impl_Device_2*) this; if( id == ::Tango::Device::_PD_repoId ) return (::Tango::_impl_Device*) this; if( id == ::CORBA::Object::_PD_repoId ) return (void*) 1; if( omni::strMatch(id, ::Tango::Device_3::_PD_repoId) ) return (::Tango::_impl_Device_3*) this; if( omni::strMatch(id, ::Tango::Device_2::_PD_repoId) ) return (::Tango::_impl_Device_2*) this; if( omni::strMatch(id, ::Tango::Device::_PD_repoId) ) return (::Tango::_impl_Device*) this; if( omni::strMatch(id, ::CORBA::Object::_PD_repoId) ) return (void*) 1; return 0; } const char* Tango::_impl_Device_3::_mostDerivedRepoId() { return ::Tango::Device_3::_PD_repoId; } Tango::Device_4_ptr Tango::Device_4_Helper::_nil() { return ::Tango::Device_4::_nil(); } ::CORBA::Boolean Tango::Device_4_Helper::is_nil(::Tango::Device_4_ptr p) { return ::CORBA::is_nil(p); } void Tango::Device_4_Helper::release(::Tango::Device_4_ptr p) { ::CORBA::release(p); } void Tango::Device_4_Helper::marshalObjRef(::Tango::Device_4_ptr obj, cdrStream& s) { ::Tango::Device_4::_marshalObjRef(obj, s); } Tango::Device_4_ptr Tango::Device_4_Helper::unmarshalObjRef(cdrStream& s) { return ::Tango::Device_4::_unmarshalObjRef(s); } void Tango::Device_4_Helper::duplicate(::Tango::Device_4_ptr obj) { if( obj && !obj->_NP_is_nil() ) omni::duplicateObjRef(obj); } Tango::Device_4_ptr Tango::Device_4::_duplicate(::Tango::Device_4_ptr obj) { if( obj && !obj->_NP_is_nil() ) omni::duplicateObjRef(obj); return obj; } Tango::Device_4_ptr Tango::Device_4::_narrow(::CORBA::Object_ptr obj) { if( !obj || obj->_NP_is_nil() || obj->_NP_is_pseudo() ) return _nil(); _ptr_type e = (_ptr_type) obj->_PR_getobj()->_realNarrow(_PD_repoId); return e ? e : _nil(); } Tango::Device_4_ptr Tango::Device_4::_unchecked_narrow(::CORBA::Object_ptr obj) { if( !obj || obj->_NP_is_nil() || obj->_NP_is_pseudo() ) return _nil(); _ptr_type e = (_ptr_type) obj->_PR_getobj()->_uncheckedNarrow(_PD_repoId); return e ? e : _nil(); } Tango::Device_4_ptr Tango::Device_4::_nil() { #ifdef OMNI_UNLOADABLE_STUBS static _objref_Device_4 _the_nil_obj; return &_the_nil_obj; #else static _objref_Device_4* _the_nil_ptr = 0; if( !_the_nil_ptr ) { omni::nilRefLock().lock(); if( !_the_nil_ptr ) { _the_nil_ptr = new _objref_Device_4; registerNilCorbaObject(_the_nil_ptr); } omni::nilRefLock().unlock(); } return _the_nil_ptr; #endif } const char* Tango::Device_4::_PD_repoId = "IDL:Tango/Device_4:1.0"; Tango::_objref_Device_4::~_objref_Device_4() { } Tango::_objref_Device_4::_objref_Device_4(omniIOR* ior, omniIdentity* id) : omniObjRef(::Tango::Device_4::_PD_repoId, ior, id, 1), _objref_Device_3(ior, id) { _PR_setobj(this); } void* Tango::_objref_Device_4::_ptrToObjRef(const char* id) { if( id == ::Tango::Device_4::_PD_repoId ) return (::Tango::Device_4_ptr) this; if( id == ::Tango::Device_3::_PD_repoId ) return (::Tango::Device_3_ptr) this; if( id == ::Tango::Device_2::_PD_repoId ) return (::Tango::Device_2_ptr) this; if( id == ::Tango::Device::_PD_repoId ) return (::Tango::Device_ptr) this; if( id == ::CORBA::Object::_PD_repoId ) return (::CORBA::Object_ptr) this; if( omni::strMatch(id, ::Tango::Device_4::_PD_repoId) ) return (::Tango::Device_4_ptr) this; if( omni::strMatch(id, ::Tango::Device_3::_PD_repoId) ) return (::Tango::Device_3_ptr) this; if( omni::strMatch(id, ::Tango::Device_2::_PD_repoId) ) return (::Tango::Device_2_ptr) this; if( omni::strMatch(id, ::Tango::Device::_PD_repoId) ) return (::Tango::Device_ptr) this; if( omni::strMatch(id, ::CORBA::Object::_PD_repoId) ) return (::CORBA::Object_ptr) this; return 0; } // Proxy call descriptor class. Mangled signature: // _cTango_mDevAttrHistory__4_i_cstring_i_clong_e_cTango_mDevFailed class _0RL_cd_6fe2f94a21a10053_53000000 : public omniCallDescriptor { public: inline _0RL_cd_6fe2f94a21a10053_53000000(LocalCallFn lcfn,const char* op_,size_t oplen,_CORBA_Boolean upcall=0): omniCallDescriptor(lcfn, op_, oplen, 0, _user_exns, 1, upcall) { } void marshalArguments(cdrStream&); void unmarshalArguments(cdrStream&); void unmarshalReturnedValues(cdrStream&); void marshalReturnedValues(cdrStream&); void userException(cdrStream&,_OMNI_NS(IOP_C)*,const char*); static const char* const _user_exns[]; ::CORBA::String_var arg_0_; const char* arg_0; ::CORBA::Long arg_1; Tango::DevAttrHistory_4_var result; }; void _0RL_cd_6fe2f94a21a10053_53000000::marshalArguments(cdrStream& _n) { _n.marshalString(arg_0,0); arg_1 >>= _n; } void _0RL_cd_6fe2f94a21a10053_53000000::unmarshalArguments(cdrStream& _n) { arg_0_ = _n.unmarshalString(0); arg_0 = arg_0_.in(); (::CORBA::Long&)arg_1 <<= _n; } void _0RL_cd_6fe2f94a21a10053_53000000::marshalReturnedValues(cdrStream& _n) { (const Tango::DevAttrHistory_4&) result >>= _n; } void _0RL_cd_6fe2f94a21a10053_53000000::unmarshalReturnedValues(cdrStream& _n) { result = new Tango::DevAttrHistory_4; (Tango::DevAttrHistory_4&)result <<= _n; } const char* const _0RL_cd_6fe2f94a21a10053_53000000::_user_exns[] = { Tango::DevFailed::_PD_repoId }; void _0RL_cd_6fe2f94a21a10053_53000000::userException(cdrStream& s, _OMNI_NS(IOP_C)* iop_client, const char* repoId) { if ( omni::strMatch(repoId, Tango::DevFailed::_PD_repoId) ) { Tango::DevFailed _ex; _ex <<= s; if (iop_client) iop_client->RequestCompleted(); throw _ex; } else { if (iop_client) iop_client->RequestCompleted(1); OMNIORB_THROW(UNKNOWN,UNKNOWN_UserException, (::CORBA::CompletionStatus)s.completion()); } } // Local call call-back function. static void _0RL_lcfn_6fe2f94a21a10053_63000000(omniCallDescriptor* cd, omniServant* svnt) { _0RL_cd_6fe2f94a21a10053_53000000* tcd = (_0RL_cd_6fe2f94a21a10053_53000000*)cd; Tango::_impl_Device_4* impl = (Tango::_impl_Device_4*) svnt->_ptrToInterface(Tango::Device_4::_PD_repoId); #ifdef HAS_Cplusplus_catch_exception_by_base tcd->result = impl->read_attribute_history_4(tcd->arg_0, tcd->arg_1); #else if (!cd->is_upcall()) tcd->result = impl->read_attribute_history_4(tcd->arg_0, tcd->arg_1); else { try { tcd->result = impl->read_attribute_history_4(tcd->arg_0, tcd->arg_1); } catch(Tango::DevFailed& ex) { throw omniORB::StubUserException(ex._NP_duplicate()); } } #endif } Tango::DevAttrHistory_4* Tango::_objref_Device_4::read_attribute_history_4(const char* name, ::CORBA::Long n) { _0RL_cd_6fe2f94a21a10053_53000000 _call_desc(_0RL_lcfn_6fe2f94a21a10053_63000000, "read_attribute_history_4", 25); _call_desc.arg_0 = name; _call_desc.arg_1 = n; _invoke(_call_desc); return _call_desc.result._retn(); } // Proxy call descriptor class. Mangled signature: // _cTango_mDevCmdHistory__4_i_cstring_i_clong_e_cTango_mDevFailed class _0RL_cd_6fe2f94a21a10053_73000000 : public omniCallDescriptor { public: inline _0RL_cd_6fe2f94a21a10053_73000000(LocalCallFn lcfn,const char* op_,size_t oplen,_CORBA_Boolean upcall=0): omniCallDescriptor(lcfn, op_, oplen, 0, _user_exns, 1, upcall) { } void marshalArguments(cdrStream&); void unmarshalArguments(cdrStream&); void unmarshalReturnedValues(cdrStream&); void marshalReturnedValues(cdrStream&); void userException(cdrStream&,_OMNI_NS(IOP_C)*,const char*); static const char* const _user_exns[]; ::CORBA::String_var arg_0_; const char* arg_0; ::CORBA::Long arg_1; Tango::DevCmdHistory_4_var result; }; void _0RL_cd_6fe2f94a21a10053_73000000::marshalArguments(cdrStream& _n) { _n.marshalString(arg_0,0); arg_1 >>= _n; } void _0RL_cd_6fe2f94a21a10053_73000000::unmarshalArguments(cdrStream& _n) { arg_0_ = _n.unmarshalString(0); arg_0 = arg_0_.in(); (::CORBA::Long&)arg_1 <<= _n; } void _0RL_cd_6fe2f94a21a10053_73000000::marshalReturnedValues(cdrStream& _n) { (const Tango::DevCmdHistory_4&) result >>= _n; } void _0RL_cd_6fe2f94a21a10053_73000000::unmarshalReturnedValues(cdrStream& _n) { result = new Tango::DevCmdHistory_4; (Tango::DevCmdHistory_4&)result <<= _n; } const char* const _0RL_cd_6fe2f94a21a10053_73000000::_user_exns[] = { Tango::DevFailed::_PD_repoId }; void _0RL_cd_6fe2f94a21a10053_73000000::userException(cdrStream& s, _OMNI_NS(IOP_C)* iop_client, const char* repoId) { if ( omni::strMatch(repoId, Tango::DevFailed::_PD_repoId) ) { Tango::DevFailed _ex; _ex <<= s; if (iop_client) iop_client->RequestCompleted(); throw _ex; } else { if (iop_client) iop_client->RequestCompleted(1); OMNIORB_THROW(UNKNOWN,UNKNOWN_UserException, (::CORBA::CompletionStatus)s.completion()); } } // Local call call-back function. static void _0RL_lcfn_6fe2f94a21a10053_83000000(omniCallDescriptor* cd, omniServant* svnt) { _0RL_cd_6fe2f94a21a10053_73000000* tcd = (_0RL_cd_6fe2f94a21a10053_73000000*)cd; Tango::_impl_Device_4* impl = (Tango::_impl_Device_4*) svnt->_ptrToInterface(Tango::Device_4::_PD_repoId); #ifdef HAS_Cplusplus_catch_exception_by_base tcd->result = impl->command_inout_history_4(tcd->arg_0, tcd->arg_1); #else if (!cd->is_upcall()) tcd->result = impl->command_inout_history_4(tcd->arg_0, tcd->arg_1); else { try { tcd->result = impl->command_inout_history_4(tcd->arg_0, tcd->arg_1); } catch(Tango::DevFailed& ex) { throw omniORB::StubUserException(ex._NP_duplicate()); } } #endif } Tango::DevCmdHistory_4* Tango::_objref_Device_4::command_inout_history_4(const char* command, ::CORBA::Long n) { _0RL_cd_6fe2f94a21a10053_73000000 _call_desc(_0RL_lcfn_6fe2f94a21a10053_83000000, "command_inout_history_4", 24); _call_desc.arg_0 = command; _call_desc.arg_1 = n; _invoke(_call_desc); return _call_desc.result._retn(); } // Proxy call descriptor class. Mangled signature: // _cany_i_cstring_i_cany_i_cTango_mDevSource_i_cTango_mClntIdent_e_cTango_mDevFailed class _0RL_cd_6fe2f94a21a10053_93000000 : public omniCallDescriptor { public: inline _0RL_cd_6fe2f94a21a10053_93000000(LocalCallFn lcfn,const char* op_,size_t oplen,_CORBA_Boolean upcall=0): omniCallDescriptor(lcfn, op_, oplen, 0, _user_exns, 1, upcall) { } void marshalArguments(cdrStream&); void unmarshalArguments(cdrStream&); void unmarshalReturnedValues(cdrStream&); void marshalReturnedValues(cdrStream&); void userException(cdrStream&,_OMNI_NS(IOP_C)*,const char*); static const char* const _user_exns[]; ::CORBA::String_var arg_0_; const char* arg_0; ::CORBA::Any_var arg_1_; const ::CORBA::Any* arg_1; Tango::DevSource arg_2; Tango::ClntIdent_var arg_3_; const Tango::ClntIdent* arg_3; ::CORBA::Any_var result; }; void _0RL_cd_6fe2f94a21a10053_93000000::marshalArguments(cdrStream& _n) { _n.marshalString(arg_0,0); (const ::CORBA::Any&) *arg_1 >>= _n; arg_2 >>= _n; (const Tango::ClntIdent&) *arg_3 >>= _n; } void _0RL_cd_6fe2f94a21a10053_93000000::unmarshalArguments(cdrStream& _n) { arg_0_ = _n.unmarshalString(0); arg_0 = arg_0_.in(); arg_1_ = new ::CORBA::Any; (::CORBA::Any&)arg_1_ <<= _n; arg_1 = &arg_1_.in(); (Tango::DevSource&)arg_2 <<= _n; arg_3_ = new Tango::ClntIdent; (Tango::ClntIdent&)arg_3_ <<= _n; arg_3 = &arg_3_.in(); } void _0RL_cd_6fe2f94a21a10053_93000000::marshalReturnedValues(cdrStream& _n) { (const ::CORBA::Any&) result >>= _n; } void _0RL_cd_6fe2f94a21a10053_93000000::unmarshalReturnedValues(cdrStream& _n) { result = new ::CORBA::Any; (::CORBA::Any&)result <<= _n; } const char* const _0RL_cd_6fe2f94a21a10053_93000000::_user_exns[] = { Tango::DevFailed::_PD_repoId }; void _0RL_cd_6fe2f94a21a10053_93000000::userException(cdrStream& s, _OMNI_NS(IOP_C)* iop_client, const char* repoId) { if ( omni::strMatch(repoId, Tango::DevFailed::_PD_repoId) ) { Tango::DevFailed _ex; _ex <<= s; if (iop_client) iop_client->RequestCompleted(); throw _ex; } else { if (iop_client) iop_client->RequestCompleted(1); OMNIORB_THROW(UNKNOWN,UNKNOWN_UserException, (::CORBA::CompletionStatus)s.completion()); } } // Local call call-back function. static void _0RL_lcfn_6fe2f94a21a10053_a3000000(omniCallDescriptor* cd, omniServant* svnt) { _0RL_cd_6fe2f94a21a10053_93000000* tcd = (_0RL_cd_6fe2f94a21a10053_93000000*)cd; Tango::_impl_Device_4* impl = (Tango::_impl_Device_4*) svnt->_ptrToInterface(Tango::Device_4::_PD_repoId); #ifdef HAS_Cplusplus_catch_exception_by_base tcd->result = impl->command_inout_4(tcd->arg_0, *tcd->arg_1, tcd->arg_2, *tcd->arg_3); #else if (!cd->is_upcall()) tcd->result = impl->command_inout_4(tcd->arg_0, *tcd->arg_1, tcd->arg_2, *tcd->arg_3); else { try { tcd->result = impl->command_inout_4(tcd->arg_0, *tcd->arg_1, tcd->arg_2, *tcd->arg_3); } catch(Tango::DevFailed& ex) { throw omniORB::StubUserException(ex._NP_duplicate()); } } #endif } ::CORBA::Any* Tango::_objref_Device_4::command_inout_4(const char* command, const ::CORBA::Any& argin, ::Tango::DevSource source, const ::Tango::ClntIdent& cl_ident) { _0RL_cd_6fe2f94a21a10053_93000000 _call_desc(_0RL_lcfn_6fe2f94a21a10053_a3000000, "command_inout_4", 16); _call_desc.arg_0 = command; _call_desc.arg_1 = &(::CORBA::Any&) argin; _call_desc.arg_2 = source; _call_desc.arg_3 = &(::Tango::ClntIdent&) cl_ident; _invoke(_call_desc); return _call_desc.result._retn(); } // Proxy call descriptor class. Mangled signature: // _cTango_mAttributeValueList__4_i_cTango_mDevVarStringArray_i_cTango_mDevSource_i_cTango_mClntIdent_e_cTango_mDevFailed class _0RL_cd_6fe2f94a21a10053_b3000000 : public omniCallDescriptor { public: inline _0RL_cd_6fe2f94a21a10053_b3000000(LocalCallFn lcfn,const char* op_,size_t oplen,_CORBA_Boolean upcall=0): omniCallDescriptor(lcfn, op_, oplen, 0, _user_exns, 1, upcall) { } void marshalArguments(cdrStream&); void unmarshalArguments(cdrStream&); void unmarshalReturnedValues(cdrStream&); void marshalReturnedValues(cdrStream&); void userException(cdrStream&,_OMNI_NS(IOP_C)*,const char*); static const char* const _user_exns[]; Tango::DevVarStringArray_var arg_0_; const Tango::DevVarStringArray* arg_0; Tango::DevSource arg_1; Tango::ClntIdent_var arg_2_; const Tango::ClntIdent* arg_2; Tango::AttributeValueList_4_var result; }; void _0RL_cd_6fe2f94a21a10053_b3000000::marshalArguments(cdrStream& _n) { (const Tango::DevVarStringArray&) *arg_0 >>= _n; arg_1 >>= _n; (const Tango::ClntIdent&) *arg_2 >>= _n; } void _0RL_cd_6fe2f94a21a10053_b3000000::unmarshalArguments(cdrStream& _n) { arg_0_ = new Tango::DevVarStringArray; (Tango::DevVarStringArray&)arg_0_ <<= _n; arg_0 = &arg_0_.in(); (Tango::DevSource&)arg_1 <<= _n; arg_2_ = new Tango::ClntIdent; (Tango::ClntIdent&)arg_2_ <<= _n; arg_2 = &arg_2_.in(); } void _0RL_cd_6fe2f94a21a10053_b3000000::marshalReturnedValues(cdrStream& _n) { (const Tango::AttributeValueList_4&) result >>= _n; } void _0RL_cd_6fe2f94a21a10053_b3000000::unmarshalReturnedValues(cdrStream& _n) { result = new Tango::AttributeValueList_4; (Tango::AttributeValueList_4&)result <<= _n; } const char* const _0RL_cd_6fe2f94a21a10053_b3000000::_user_exns[] = { Tango::DevFailed::_PD_repoId }; void _0RL_cd_6fe2f94a21a10053_b3000000::userException(cdrStream& s, _OMNI_NS(IOP_C)* iop_client, const char* repoId) { if ( omni::strMatch(repoId, Tango::DevFailed::_PD_repoId) ) { Tango::DevFailed _ex; _ex <<= s; if (iop_client) iop_client->RequestCompleted(); throw _ex; } else { if (iop_client) iop_client->RequestCompleted(1); OMNIORB_THROW(UNKNOWN,UNKNOWN_UserException, (::CORBA::CompletionStatus)s.completion()); } } // Local call call-back function. static void _0RL_lcfn_6fe2f94a21a10053_c3000000(omniCallDescriptor* cd, omniServant* svnt) { _0RL_cd_6fe2f94a21a10053_b3000000* tcd = (_0RL_cd_6fe2f94a21a10053_b3000000*)cd; Tango::_impl_Device_4* impl = (Tango::_impl_Device_4*) svnt->_ptrToInterface(Tango::Device_4::_PD_repoId); #ifdef HAS_Cplusplus_catch_exception_by_base tcd->result = impl->read_attributes_4(*tcd->arg_0, tcd->arg_1, *tcd->arg_2); #else if (!cd->is_upcall()) tcd->result = impl->read_attributes_4(*tcd->arg_0, tcd->arg_1, *tcd->arg_2); else { try { tcd->result = impl->read_attributes_4(*tcd->arg_0, tcd->arg_1, *tcd->arg_2); } catch(Tango::DevFailed& ex) { throw omniORB::StubUserException(ex._NP_duplicate()); } } #endif } Tango::AttributeValueList_4* Tango::_objref_Device_4::read_attributes_4(const ::Tango::DevVarStringArray& names, ::Tango::DevSource source, const ::Tango::ClntIdent& cl_ident) { _0RL_cd_6fe2f94a21a10053_b3000000 _call_desc(_0RL_lcfn_6fe2f94a21a10053_c3000000, "read_attributes_4", 18); _call_desc.arg_0 = &(::Tango::DevVarStringArray&) names; _call_desc.arg_1 = source; _call_desc.arg_2 = &(::Tango::ClntIdent&) cl_ident; _invoke(_call_desc); return _call_desc.result._retn(); } // Proxy call descriptor class. Mangled signature: // void_i_cTango_mAttributeValueList__4_i_cTango_mClntIdent_e_cTango_mDevFailed_e_cTango_mMultiDevFailed class _0RL_cd_6fe2f94a21a10053_d3000000 : public omniCallDescriptor { public: inline _0RL_cd_6fe2f94a21a10053_d3000000(LocalCallFn lcfn,const char* op_,size_t oplen,_CORBA_Boolean upcall=0): omniCallDescriptor(lcfn, op_, oplen, 0, _user_exns, 2, upcall) { } void marshalArguments(cdrStream&); void unmarshalArguments(cdrStream&); void userException(cdrStream&,_OMNI_NS(IOP_C)*,const char*); static const char* const _user_exns[]; Tango::AttributeValueList_4_var arg_0_; const Tango::AttributeValueList_4* arg_0; Tango::ClntIdent_var arg_1_; const Tango::ClntIdent* arg_1; }; void _0RL_cd_6fe2f94a21a10053_d3000000::marshalArguments(cdrStream& _n) { (const Tango::AttributeValueList_4&) *arg_0 >>= _n; (const Tango::ClntIdent&) *arg_1 >>= _n; } void _0RL_cd_6fe2f94a21a10053_d3000000::unmarshalArguments(cdrStream& _n) { arg_0_ = new Tango::AttributeValueList_4; (Tango::AttributeValueList_4&)arg_0_ <<= _n; arg_0 = &arg_0_.in(); arg_1_ = new Tango::ClntIdent; (Tango::ClntIdent&)arg_1_ <<= _n; arg_1 = &arg_1_.in(); } const char* const _0RL_cd_6fe2f94a21a10053_d3000000::_user_exns[] = { Tango::DevFailed::_PD_repoId, Tango::MultiDevFailed::_PD_repoId }; void _0RL_cd_6fe2f94a21a10053_d3000000::userException(cdrStream& s, _OMNI_NS(IOP_C)* iop_client, const char* repoId) { if ( omni::strMatch(repoId, Tango::DevFailed::_PD_repoId) ) { Tango::DevFailed _ex; _ex <<= s; if (iop_client) iop_client->RequestCompleted(); throw _ex; } if ( omni::strMatch(repoId, Tango::MultiDevFailed::_PD_repoId) ) { Tango::MultiDevFailed _ex; _ex <<= s; if (iop_client) iop_client->RequestCompleted(); throw _ex; } else { if (iop_client) iop_client->RequestCompleted(1); OMNIORB_THROW(UNKNOWN,UNKNOWN_UserException, (::CORBA::CompletionStatus)s.completion()); } } // Local call call-back function. static void _0RL_lcfn_6fe2f94a21a10053_e3000000(omniCallDescriptor* cd, omniServant* svnt) { _0RL_cd_6fe2f94a21a10053_d3000000* tcd = (_0RL_cd_6fe2f94a21a10053_d3000000*)cd; Tango::_impl_Device_4* impl = (Tango::_impl_Device_4*) svnt->_ptrToInterface(Tango::Device_4::_PD_repoId); #ifdef HAS_Cplusplus_catch_exception_by_base impl->write_attributes_4(*tcd->arg_0, *tcd->arg_1); #else if (!cd->is_upcall()) impl->write_attributes_4(*tcd->arg_0, *tcd->arg_1); else { try { impl->write_attributes_4(*tcd->arg_0, *tcd->arg_1); } catch(Tango::DevFailed& ex) { throw omniORB::StubUserException(ex._NP_duplicate()); } catch(Tango::MultiDevFailed& ex) { throw omniORB::StubUserException(ex._NP_duplicate()); } } #endif } void Tango::_objref_Device_4::write_attributes_4(const ::Tango::AttributeValueList_4& values, const ::Tango::ClntIdent& cl_ident) { _0RL_cd_6fe2f94a21a10053_d3000000 _call_desc(_0RL_lcfn_6fe2f94a21a10053_e3000000, "write_attributes_4", 19); _call_desc.arg_0 = &(::Tango::AttributeValueList_4&) values; _call_desc.arg_1 = &(::Tango::ClntIdent&) cl_ident; _invoke(_call_desc); } // Proxy call descriptor class. Mangled signature: // void_i_cTango_mAttributeConfigList__3_i_cTango_mClntIdent_e_cTango_mDevFailed class _0RL_cd_6fe2f94a21a10053_f3000000 : public omniCallDescriptor { public: inline _0RL_cd_6fe2f94a21a10053_f3000000(LocalCallFn lcfn,const char* op_,size_t oplen,_CORBA_Boolean upcall=0): omniCallDescriptor(lcfn, op_, oplen, 0, _user_exns, 1, upcall) { } void marshalArguments(cdrStream&); void unmarshalArguments(cdrStream&); void userException(cdrStream&,_OMNI_NS(IOP_C)*,const char*); static const char* const _user_exns[]; Tango::AttributeConfigList_3_var arg_0_; const Tango::AttributeConfigList_3* arg_0; Tango::ClntIdent_var arg_1_; const Tango::ClntIdent* arg_1; }; void _0RL_cd_6fe2f94a21a10053_f3000000::marshalArguments(cdrStream& _n) { (const Tango::AttributeConfigList_3&) *arg_0 >>= _n; (const Tango::ClntIdent&) *arg_1 >>= _n; } void _0RL_cd_6fe2f94a21a10053_f3000000::unmarshalArguments(cdrStream& _n) { arg_0_ = new Tango::AttributeConfigList_3; (Tango::AttributeConfigList_3&)arg_0_ <<= _n; arg_0 = &arg_0_.in(); arg_1_ = new Tango::ClntIdent; (Tango::ClntIdent&)arg_1_ <<= _n; arg_1 = &arg_1_.in(); } const char* const _0RL_cd_6fe2f94a21a10053_f3000000::_user_exns[] = { Tango::DevFailed::_PD_repoId }; void _0RL_cd_6fe2f94a21a10053_f3000000::userException(cdrStream& s, _OMNI_NS(IOP_C)* iop_client, const char* repoId) { if ( omni::strMatch(repoId, Tango::DevFailed::_PD_repoId) ) { Tango::DevFailed _ex; _ex <<= s; if (iop_client) iop_client->RequestCompleted(); throw _ex; } else { if (iop_client) iop_client->RequestCompleted(1); OMNIORB_THROW(UNKNOWN,UNKNOWN_UserException, (::CORBA::CompletionStatus)s.completion()); } } // Local call call-back function. static void _0RL_lcfn_6fe2f94a21a10053_04000000(omniCallDescriptor* cd, omniServant* svnt) { _0RL_cd_6fe2f94a21a10053_f3000000* tcd = (_0RL_cd_6fe2f94a21a10053_f3000000*)cd; Tango::_impl_Device_4* impl = (Tango::_impl_Device_4*) svnt->_ptrToInterface(Tango::Device_4::_PD_repoId); #ifdef HAS_Cplusplus_catch_exception_by_base impl->set_attribute_config_4(*tcd->arg_0, *tcd->arg_1); #else if (!cd->is_upcall()) impl->set_attribute_config_4(*tcd->arg_0, *tcd->arg_1); else { try { impl->set_attribute_config_4(*tcd->arg_0, *tcd->arg_1); } catch(Tango::DevFailed& ex) { throw omniORB::StubUserException(ex._NP_duplicate()); } } #endif } void Tango::_objref_Device_4::set_attribute_config_4(const ::Tango::AttributeConfigList_3& new_conf, const ::Tango::ClntIdent& cl_ident) { _0RL_cd_6fe2f94a21a10053_f3000000 _call_desc(_0RL_lcfn_6fe2f94a21a10053_04000000, "set_attribute_config_4", 23); _call_desc.arg_0 = &(::Tango::AttributeConfigList_3&) new_conf; _call_desc.arg_1 = &(::Tango::ClntIdent&) cl_ident; _invoke(_call_desc); } // Proxy call descriptor class. Mangled signature: // _cTango_mAttributeValueList__4_i_cTango_mAttributeValueList__4_i_cTango_mClntIdent_e_cTango_mDevFailed_e_cTango_mMultiDevFailed class _0RL_cd_6fe2f94a21a10053_14000000 : public omniCallDescriptor { public: inline _0RL_cd_6fe2f94a21a10053_14000000(LocalCallFn lcfn,const char* op_,size_t oplen,_CORBA_Boolean upcall=0): omniCallDescriptor(lcfn, op_, oplen, 0, _user_exns, 2, upcall) { } void marshalArguments(cdrStream&); void unmarshalArguments(cdrStream&); void unmarshalReturnedValues(cdrStream&); void marshalReturnedValues(cdrStream&); void userException(cdrStream&,_OMNI_NS(IOP_C)*,const char*); static const char* const _user_exns[]; Tango::AttributeValueList_4_var arg_0_; const Tango::AttributeValueList_4* arg_0; Tango::ClntIdent_var arg_1_; const Tango::ClntIdent* arg_1; Tango::AttributeValueList_4_var result; }; void _0RL_cd_6fe2f94a21a10053_14000000::marshalArguments(cdrStream& _n) { (const Tango::AttributeValueList_4&) *arg_0 >>= _n; (const Tango::ClntIdent&) *arg_1 >>= _n; } void _0RL_cd_6fe2f94a21a10053_14000000::unmarshalArguments(cdrStream& _n) { arg_0_ = new Tango::AttributeValueList_4; (Tango::AttributeValueList_4&)arg_0_ <<= _n; arg_0 = &arg_0_.in(); arg_1_ = new Tango::ClntIdent; (Tango::ClntIdent&)arg_1_ <<= _n; arg_1 = &arg_1_.in(); } void _0RL_cd_6fe2f94a21a10053_14000000::marshalReturnedValues(cdrStream& _n) { (const Tango::AttributeValueList_4&) result >>= _n; } void _0RL_cd_6fe2f94a21a10053_14000000::unmarshalReturnedValues(cdrStream& _n) { result = new Tango::AttributeValueList_4; (Tango::AttributeValueList_4&)result <<= _n; } const char* const _0RL_cd_6fe2f94a21a10053_14000000::_user_exns[] = { Tango::DevFailed::_PD_repoId, Tango::MultiDevFailed::_PD_repoId }; void _0RL_cd_6fe2f94a21a10053_14000000::userException(cdrStream& s, _OMNI_NS(IOP_C)* iop_client, const char* repoId) { if ( omni::strMatch(repoId, Tango::DevFailed::_PD_repoId) ) { Tango::DevFailed _ex; _ex <<= s; if (iop_client) iop_client->RequestCompleted(); throw _ex; } if ( omni::strMatch(repoId, Tango::MultiDevFailed::_PD_repoId) ) { Tango::MultiDevFailed _ex; _ex <<= s; if (iop_client) iop_client->RequestCompleted(); throw _ex; } else { if (iop_client) iop_client->RequestCompleted(1); OMNIORB_THROW(UNKNOWN,UNKNOWN_UserException, (::CORBA::CompletionStatus)s.completion()); } } // Local call call-back function. static void _0RL_lcfn_6fe2f94a21a10053_24000000(omniCallDescriptor* cd, omniServant* svnt) { _0RL_cd_6fe2f94a21a10053_14000000* tcd = (_0RL_cd_6fe2f94a21a10053_14000000*)cd; Tango::_impl_Device_4* impl = (Tango::_impl_Device_4*) svnt->_ptrToInterface(Tango::Device_4::_PD_repoId); #ifdef HAS_Cplusplus_catch_exception_by_base tcd->result = impl->write_read_attributes_4(*tcd->arg_0, *tcd->arg_1); #else if (!cd->is_upcall()) tcd->result = impl->write_read_attributes_4(*tcd->arg_0, *tcd->arg_1); else { try { tcd->result = impl->write_read_attributes_4(*tcd->arg_0, *tcd->arg_1); } catch(Tango::DevFailed& ex) { throw omniORB::StubUserException(ex._NP_duplicate()); } catch(Tango::MultiDevFailed& ex) { throw omniORB::StubUserException(ex._NP_duplicate()); } } #endif } Tango::AttributeValueList_4* Tango::_objref_Device_4::write_read_attributes_4(const ::Tango::AttributeValueList_4& values, const ::Tango::ClntIdent& cl_ident) { _0RL_cd_6fe2f94a21a10053_14000000 _call_desc(_0RL_lcfn_6fe2f94a21a10053_24000000, "write_read_attributes_4", 24); _call_desc.arg_0 = &(::Tango::AttributeValueList_4&) values; _call_desc.arg_1 = &(::Tango::ClntIdent&) cl_ident; _invoke(_call_desc); return _call_desc.result._retn(); } Tango::_pof_Device_4::~_pof_Device_4() {} omniObjRef* Tango::_pof_Device_4::newObjRef(omniIOR* ior, omniIdentity* id) { return new ::Tango::_objref_Device_4(ior, id); } ::CORBA::Boolean Tango::_pof_Device_4::is_a(const char* id) const { if( omni::ptrStrMatch(id, ::Tango::Device_4::_PD_repoId) ) return 1; if( omni::ptrStrMatch(id, Tango::Device_3::_PD_repoId) ) return 1; if( omni::ptrStrMatch(id, Tango::Device_2::_PD_repoId) ) return 1; if( omni::ptrStrMatch(id, Tango::Device::_PD_repoId) ) return 1; return 0; } const Tango::_pof_Device_4 _the_pof_Tango_mDevice__4; Tango::_impl_Device_4::~_impl_Device_4() {} ::CORBA::Boolean Tango::_impl_Device_4::_dispatch(omniCallHandle& _handle) { const char* op = _handle.operation_name(); if( omni::strMatch(op, "read_attribute_history_4") ) { _0RL_cd_6fe2f94a21a10053_53000000 _call_desc(_0RL_lcfn_6fe2f94a21a10053_63000000, "read_attribute_history_4", 25, 1); _handle.upcall(this,_call_desc); return 1; } if( omni::strMatch(op, "command_inout_history_4") ) { _0RL_cd_6fe2f94a21a10053_73000000 _call_desc(_0RL_lcfn_6fe2f94a21a10053_83000000, "command_inout_history_4", 24, 1); _handle.upcall(this,_call_desc); return 1; } if( omni::strMatch(op, "command_inout_4") ) { _0RL_cd_6fe2f94a21a10053_93000000 _call_desc(_0RL_lcfn_6fe2f94a21a10053_a3000000, "command_inout_4", 16, 1); _handle.upcall(this,_call_desc); return 1; } if( omni::strMatch(op, "read_attributes_4") ) { _0RL_cd_6fe2f94a21a10053_b3000000 _call_desc(_0RL_lcfn_6fe2f94a21a10053_c3000000, "read_attributes_4", 18, 1); _handle.upcall(this,_call_desc); return 1; } if( omni::strMatch(op, "write_attributes_4") ) { _0RL_cd_6fe2f94a21a10053_d3000000 _call_desc(_0RL_lcfn_6fe2f94a21a10053_e3000000, "write_attributes_4", 19, 1); _handle.upcall(this,_call_desc); return 1; } if( omni::strMatch(op, "set_attribute_config_4") ) { _0RL_cd_6fe2f94a21a10053_f3000000 _call_desc(_0RL_lcfn_6fe2f94a21a10053_04000000, "set_attribute_config_4", 23, 1); _handle.upcall(this,_call_desc); return 1; } if( omni::strMatch(op, "write_read_attributes_4") ) { _0RL_cd_6fe2f94a21a10053_14000000 _call_desc(_0RL_lcfn_6fe2f94a21a10053_24000000, "write_read_attributes_4", 24, 1); _handle.upcall(this,_call_desc); return 1; } #ifndef _MSC_VER if( _impl_Device_3::_dispatch(_handle) ) { return 1; } #else // Work-around for incorrect MSVC code generation. if( ((_impl_Device_3*)this)-> _impl_Device_3::_dispatch(_handle) ) { return 1; } #endif return 0; } void* Tango::_impl_Device_4::_ptrToInterface(const char* id) { if( id == ::Tango::Device_4::_PD_repoId ) return (::Tango::_impl_Device_4*) this; if( id == ::Tango::Device_3::_PD_repoId ) return (::Tango::_impl_Device_3*) this; if( id == ::Tango::Device_2::_PD_repoId ) return (::Tango::_impl_Device_2*) this; if( id == ::Tango::Device::_PD_repoId ) return (::Tango::_impl_Device*) this; if( id == ::CORBA::Object::_PD_repoId ) return (void*) 1; if( omni::strMatch(id, ::Tango::Device_4::_PD_repoId) ) return (::Tango::_impl_Device_4*) this; if( omni::strMatch(id, ::Tango::Device_3::_PD_repoId) ) return (::Tango::_impl_Device_3*) this; if( omni::strMatch(id, ::Tango::Device_2::_PD_repoId) ) return (::Tango::_impl_Device_2*) this; if( omni::strMatch(id, ::Tango::Device::_PD_repoId) ) return (::Tango::_impl_Device*) this; if( omni::strMatch(id, ::CORBA::Object::_PD_repoId) ) return (void*) 1; return 0; } const char* Tango::_impl_Device_4::_mostDerivedRepoId() { return ::Tango::Device_4::_PD_repoId; } POA_Tango::Device::~Device() {} POA_Tango::Device_2::~Device_2() {} POA_Tango::Device_3::~Device_3() {} POA_Tango::Device_4::~Device_4() {} tango-8.1.2c+dfsg.orig/lib/cpp/server/except.h0000644000175000017500000020372212205375142020101 0ustar piccapicca//============================================================================= // // file : except.h // // description : Include for exception related utilities // // project : TANGO // // author(s) : A.Gotz + E.Taurel // // Copyright (C) : 2004,2005,2006,2007,2008,2009,2010,2011,2012,2013 // European Synchrotron Radiation Facility // BP 220, Grenoble 38043 // FRANCE // // This file is part of Tango. // // Tango 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. // // Tango 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 Tango. If not, see . // // $Revision: 22612 $ // //============================================================================= #ifndef _EXCEPT_H #define _EXCEPT_H #include #include using namespace std; namespace Tango { class DeviceImpl; //============================================================================= // // The Except class // // description : This class is a container for all exceptions related // methods to be used in aa Tango device server/client. // Most of these methods are static. // //============================================================================= #define NOSPACEINDOC_EXCEPT /** * Container class for all exception related methods. Most of these methods are * static methods * * $Author: taurel $ * $Revision: 22612 $ * * @headerfile tango.h * @ingroup Server * @ingroup Client */ class Except { public: /**@name Exception related method */ //@{ /** * Print a TANGO exception. * * Print all the details of a TANGO exception. * * @param ex The exception object reference */ static void print_exception(const CORBA::Exception &ex); //@} /**@name Error stack related method */ //@{ /** * Print a TANGO error stack. * * Print all the details of a TANGO error stack. * * @param ex The error stack reference */ static void print_error_stack(const Tango::DevErrorList &ex); //@} /**@name Throw exception inline methods (static) */ //@{ /** * Generate and throw a TANGO DevFailed exception. * * The exception is created with a single DevError * object. A default value "Tango::ERR" is defined for the DevError * severity field. * Click here to read * DevFailed exception specification * * @param reason The exception DevError object reason field * @param desc The exception DevError object desc field * @param origin The exception DevError object origin field * @param sever The exception DevError object severity field * @exception DevFailed The thrown exception. * Click here to read * DevFailed exception specification */ static inline void throw_exception(const char *reason, const char *desc, const char *origin, Tango::ErrSeverity sever = Tango::ERR) { Tango::DevErrorList errors(1); errors.length(1); errors[0].desc = CORBA::string_dup(desc); errors[0].severity = sever; errors[0].reason = CORBA::string_dup(reason); errors[0].origin = CORBA::string_dup(origin); throw Tango::DevFailed(errors); } /** * Generate and throw a TANGO DevFailed exception. * * The exception is created with a single DevError * object. A default value "Tango::ERR" is defined for the DevError * severity field. * The memory used by the origin parameter will be freed by this method * Click here to read * DevFailed exception specification * * @param reason The exception DevError object reason field * @param desc The exception DevError object desc field * @param origin The exception DevError object origin field * @param sever The exception DevError object severity field * @exception DevFailed The thrown exception. * Click here to read * DevFailed exception specification */ static inline void throw_exception(const char *reason, const char *desc, char *origin, Tango::ErrSeverity sever = Tango::ERR) { Tango::DevErrorList errors(1); errors.length(1); errors[0].desc = CORBA::string_dup(desc); errors[0].severity = sever; errors[0].reason = CORBA::string_dup(reason); errors[0].origin = CORBA::string_dup(origin); delete[] origin; throw Tango::DevFailed(errors); } /** * Generate and throw a TANGO DevFailed exception. * * The exception is created with a single DevError * object. A default value "Tango::ERR" is defined for the DevError * severity field. * The memory used by the desc parameter will be freed by this method * Click here to read * DevFailed exception specification * * @param reason The exception DevError object reason field * @param desc The exception DevError object desc field * @param origin The exception DevError object origin field * @param sever The exception DevError object severity field * @exception DevFailed The thrown exception. * Click here to read * DevFailed exception specification */ static inline void throw_exception(const char *reason, char *desc, const char *origin, Tango::ErrSeverity sever = Tango::ERR) { Tango::DevErrorList errors(1); errors.length(1); errors[0].severity = sever; errors[0].desc = CORBA::string_dup(desc); delete[] desc; errors[0].origin = CORBA::string_dup(origin); errors[0].reason = CORBA::string_dup(reason); throw Tango::DevFailed(errors); } /** * Generate and throw a TANGO DevFailed exception. * * The exception is created with a single DevError * object. A default value "Tango::ERR" is defined for the DevError * severity field. * The memory used by the origin and desc parameters will be freed by this method * Click here to read * DevFailed exception specification * * @param reason The exception DevError object reason field * @param desc The exception DevError object desc field * @param origin The exception DevError object origin field * @param sever The exception DevError object severity field * @exception DevFailed The thrown exception. * Click here to read * DevFailed exception specification */ static inline void throw_exception(const char *reason, char *desc, char *origin, Tango::ErrSeverity sever = Tango::ERR) { Tango::DevErrorList errors(1); errors.length(1); errors[0].severity = sever; errors[0].reason = CORBA::string_dup(reason); errors[0].origin = CORBA::string_dup(origin); delete[] origin; errors[0].desc = CORBA::string_dup(desc); delete[] desc; throw Tango::DevFailed(errors); } /** * Generate and throw a TANGO DevFailed exception. * * The exception is created with a single DevError * object. A default value "Tango::ERR" is defined for the DevError * severity field. * The memory used by the reason parameter will be freed by this method * Click here to read * DevFailed exception specification * * @param reason The exception DevError object reason field * @param desc The exception DevError object desc field * @param origin The exception DevError object origin field * @param sever The exception DevError object severity field * @exception DevFailed The thrown exception. * Click here to read * DevFailed exception specification */ static inline void throw_exception(char *reason, const char *desc, const char *origin, Tango::ErrSeverity sever = Tango::ERR) { Tango::DevErrorList errors(1); errors.length(1); errors[0].severity = sever; errors[0].reason = CORBA::string_dup(reason); delete[] reason; errors[0].origin = CORBA::string_dup(origin); errors[0].desc = CORBA::string_dup(desc); throw Tango::DevFailed(errors); } /** * Generate and throw a TANGO DevFailed exception. * * The exception is created with a single DevError * object. A default value "Tango::ERR" is defined for the DevError * severity field. * The memory used by the reason and origin parameters will be freed by this method * Click here to read * DevFailed exception specification * * @param reason The exception DevError object reason field * @param desc The exception DevError object desc field * @param origin The exception DevError object origin field * @param sever The exception DevError object severity field * @exception DevFailed The thrown exception. * Click here to read * DevFailed exception specification */ static inline void throw_exception(char *reason, const char *desc, char *origin, Tango::ErrSeverity sever = Tango::ERR) { Tango::DevErrorList errors(1); errors.length(1); errors[0].severity = sever; errors[0].reason = CORBA::string_dup(reason); delete[] reason; errors[0].origin = CORBA::string_dup(origin); delete[] origin; errors[0].desc = CORBA::string_dup(desc); throw Tango::DevFailed(errors); } /** * Generate and throw a TANGO DevFailed exception. * * The exception is created with a single DevError * object. A default value "Tango::ERR" is defined for the DevError * severity field. * The memory used by the reason and desc parameters will be freed by this method * Click here to read * DevFailed exception specification * * @param reason The exception DevError object reason field * @param desc The exception DevError object desc field * @param origin The exception DevError object origin field * @param sever The exception DevError object severity field * @exception DevFailed The thrown exception. * Click here to read * DevFailed exception specification */ static inline void throw_exception(char *reason, char *desc, const char *origin, Tango::ErrSeverity sever = Tango::ERR) { Tango::DevErrorList errors(1); errors.length(1); errors[0].severity = sever; errors[0].reason = CORBA::string_dup(reason); delete[] reason; errors[0].origin = CORBA::string_dup(origin); errors[0].desc = CORBA::string_dup(desc); delete[] desc; throw Tango::DevFailed(errors); } /** * Generate and throw a TANGO DevFailed exception. * * The exception is created with a single DevError * object. A default value "Tango::ERR" is defined for the DevError * severity field. * The memory used by the origin, reason and desc parameters will be freed by this method * Click here to read * DevFailed exception specification * * @param reason The exception DevError object reason field * @param desc The exception DevError object desc field * @param origin The exception DevError object origin field * @param sever The exception DevError object severity field * @exception DevFailed The thrown exception. * Click here to read * DevFailed exception specification */ static inline void throw_exception(char *reason, char *desc, char *origin, Tango::ErrSeverity sever = Tango::ERR) { Tango::DevErrorList errors(1); errors.length(1); errors[0].severity = sever; errors[0].reason = CORBA::string_dup(reason); delete[] reason; errors[0].origin = CORBA::string_dup(origin); delete[] origin; errors[0].desc = CORBA::string_dup(desc); delete[] desc; throw Tango::DevFailed(errors); } /** * Generate and throw a TANGO DevFailed exception. * * The exception is created with a single DevError * object. A default value "Tango::ERR" is defined for the DevError * severity field. * Click here to read * DevFailed exception specification * * @param reason The exception DevError object reason field * @param desc The exception DevError object desc field * @param origin The exception DevError object origin field * @param sever The exception DevError object severity field * @exception DevFailed The thrown exception. * Click here to read * DevFailed exception specification */ static inline void throw_exception(const string &reason, const string &desc, const string &origin, Tango::ErrSeverity sever = Tango::ERR) { Tango::DevErrorList errors(1); errors.length(1); errors[0].severity = sever; errors[0].reason = CORBA::string_dup(reason.c_str()); errors[0].origin = CORBA::string_dup(origin.c_str()); errors[0].desc = CORBA::string_dup(desc.c_str()); throw Tango::DevFailed(errors); } /** * Generate and throw a TANGO DevFailed exception. * * The exception is created with a single DevError * object. A default value "Tango::ERR" is defined for the DevError * severity field. * Click here to read * DevFailed exception specification * * @param reason The exception DevError object reason field * @param desc The exception DevError object desc field * @param origin The exception DevError object origin field * @param sever The exception DevError object severity field * @exception DevFailed The thrown exception. * Click here to read * DevFailed exception specification */ static inline void throw_exception(const string &reason, const string &desc, const char *origin, Tango::ErrSeverity sever = Tango::ERR) { Tango::DevErrorList errors(1); errors.length(1); errors[0].severity = sever; errors[0].reason = CORBA::string_dup(reason.c_str()); errors[0].origin = CORBA::string_dup(origin); errors[0].desc = CORBA::string_dup(desc.c_str()); throw Tango::DevFailed(errors); } /** * Generate and throw a TANGO DevFailed exception. * * The exception is created with a single DevError * object. A default value "Tango::ERR" is defined for the DevError * severity field. * Click here to read * DevFailed exception specification * * @param reason The exception DevError object reason field * @param desc The exception DevError object desc field * @param origin The exception DevError object origin field * @param sever The exception DevError object severity field * @exception DevFailed The thrown exception. * Click here to read * DevFailed exception specification */ static inline void throw_exception(const string &reason, const char *desc, const string &origin, Tango::ErrSeverity sever = Tango::ERR) { Tango::DevErrorList errors(1); errors.length(1); errors[0].severity = sever; errors[0].reason = CORBA::string_dup(reason.c_str()); errors[0].origin = CORBA::string_dup(desc); errors[0].desc = CORBA::string_dup(origin.c_str()); throw Tango::DevFailed(errors); } /** * Generate and throw a TANGO DevFailed exception. * * The exception is created with a single DevError * object. A default value "Tango::ERR" is defined for the DevError * severity field. * Click here to read * DevFailed exception specification * * @param reason The exception DevError object reason field * @param desc The exception DevError object desc field * @param origin The exception DevError object origin field * @param sever The exception DevError object severity field * @exception DevFailed The thrown exception. * Click here to read * DevFailed exception specification */ static inline void throw_exception(const string &reason, const char *desc, const char *origin, Tango::ErrSeverity sever = Tango::ERR) { Tango::DevErrorList errors(1); errors.length(1); errors[0].severity = sever; errors[0].reason = CORBA::string_dup(reason.c_str()); errors[0].origin = CORBA::string_dup(origin); errors[0].desc = CORBA::string_dup(desc); throw Tango::DevFailed(errors); } /** * Generate and throw a TANGO DevFailed exception. * * The exception is created with a single DevError * object. A default value "Tango::ERR" is defined for the DevError * severity field. * Click here to read * DevFailed exception specification * * @param reason The exception DevError object reason field * @param desc The exception DevError object desc field * @param origin The exception DevError object origin field * @param sever The exception DevError object severity field * @exception DevFailed The thrown exception. * Click here to read * DevFailed exception specification */ static inline void throw_exception(const char *reason, const string &desc, const string &origin, Tango::ErrSeverity sever = Tango::ERR) { Tango::DevErrorList errors(1); errors.length(1); errors[0].severity = sever; errors[0].reason = CORBA::string_dup(reason); errors[0].origin = CORBA::string_dup(origin.c_str()); errors[0].desc = CORBA::string_dup(desc.c_str()); throw Tango::DevFailed(errors); } /** * Generate and throw a TANGO DevFailed exception. * * The exception is created with a single DevError * object. A default value "Tango::ERR" is defined for the DevError * severity field. * Click here to read * DevFailed exception specification * * @param reason The exception DevError object reason field * @param desc The exception DevError object desc field * @param origin The exception DevError object origin field * @param sever The exception DevError object severity field * @exception DevFailed The thrown exception. * Click here to read * DevFailed exception specification */ static inline void throw_exception(const char *reason, const string &desc, const char *origin, Tango::ErrSeverity sever = Tango::ERR) { Tango::DevErrorList errors(1); errors.length(1); errors[0].severity = sever; errors[0].reason = CORBA::string_dup(reason); errors[0].origin = CORBA::string_dup(origin); errors[0].desc = CORBA::string_dup(desc.c_str()); throw Tango::DevFailed(errors); } /** * Generate and throw a TANGO DevFailed exception. * * The exception is created with a single DevError * object. A default value "Tango::ERR" is defined for the DevError * severity field. * Click here to read * DevFailed exception specification * * @param reason The exception DevError object reason field * @param desc The exception DevError object desc field * @param origin The exception DevError object origin field * @param sever The exception DevError object severity field * @exception DevFailed The thrown exception. * Click here to read * DevFailed exception specification */ static inline void throw_exception(const char *reason, const char *desc, const string &origin, Tango::ErrSeverity sever = Tango::ERR) { Tango::DevErrorList errors(1); errors.length(1); errors[0].severity = sever; errors[0].reason = CORBA::string_dup(reason); errors[0].origin = CORBA::string_dup(origin.c_str()); errors[0].desc = CORBA::string_dup(desc); throw Tango::DevFailed(errors); } /** * Generate and throw a TANGO DevFailed exception. * * The exception is created with a single DevError * object. A default value "Tango::ERR" is defined for the DevError * severity field. * The memory used by the origin parameter will be freed by this method * Click here to read * DevFailed exception specification * * @param reason The exception DevError object reason field * @param desc The exception DevError object desc field * @param origin The exception DevError object origin field * @param sever The exception DevError object severity field * @exception DevFailed The thrown exception. * Click here to read * DevFailed exception specification */ static inline void throw_exception(const string &reason, const string &desc, char *origin, Tango::ErrSeverity sever = Tango::ERR) { Tango::DevErrorList errors(1); errors.length(1); errors[0].severity = sever; errors[0].reason = CORBA::string_dup(reason.c_str()); errors[0].origin = CORBA::string_dup(origin); delete[] origin; errors[0].desc = CORBA::string_dup(desc.c_str()); throw Tango::DevFailed(errors); } /** * Generate and throw a TANGO DevFailed exception. * * The exception is created with a single DevError * object. A default value "Tango::ERR" is defined for the DevError * severity field. * The memory used by the desc parameter will be freed by this method * Click here to read * DevFailed exception specification * * @param reason The exception DevError object reason field * @param desc The exception DevError object desc field * @param origin The exception DevError object origin field * @param sever The exception DevError object severity field * @exception DevFailed The thrown exception. * Click here to read * DevFailed exception specification */ static inline void throw_exception(const string &reason, char *desc, const string &origin, Tango::ErrSeverity sever = Tango::ERR) { Tango::DevErrorList errors(1); errors.length(1); errors[0].severity = sever; errors[0].reason = CORBA::string_dup(reason.c_str()); errors[0].origin = CORBA::string_dup(desc); delete[] desc; errors[0].desc = CORBA::string_dup(origin.c_str()); throw Tango::DevFailed(errors); } /** * Generate and throw a TANGO DevFailed exception. * * The exception is created with a single DevError * object. A default value "Tango::ERR" is defined for the DevError * severity field. * The memory used by the origin and desc parameters will be freed by this method * Click here to read * DevFailed exception specification * * @param reason The exception DevError object reason field * @param desc The exception DevError object desc field * @param origin The exception DevError object origin field * @param sever The exception DevError object severity field * @exception DevFailed The thrown exception. * Click here to read * DevFailed exception specification */ static inline void throw_exception(const string &reason, char *desc, char *origin, Tango::ErrSeverity sever = Tango::ERR) { Tango::DevErrorList errors(1); errors.length(1); errors[0].severity = sever; errors[0].reason = CORBA::string_dup(reason.c_str()); errors[0].origin = CORBA::string_dup(origin); delete[] origin; errors[0].desc = CORBA::string_dup(desc); delete desc; throw Tango::DevFailed(errors); } /** * Generate and throw a TANGO DevFailed exception. * * The exception is created with a single DevError * object. A default value "Tango::ERR" is defined for the DevError * severity field. * The memory used by the reason parameter will be freed by this method * Click here to read * DevFailed exception specification * * @param reason The exception DevError object reason field * @param desc The exception DevError object desc field * @param origin The exception DevError object origin field * @param sever The exception DevError object severity field * @exception DevFailed The thrown exception. * Click here to read * DevFailed exception specification */ static inline void throw_exception(char *reason, const string &desc, const string &origin, Tango::ErrSeverity sever = Tango::ERR) { Tango::DevErrorList errors(1); errors.length(1); errors[0].severity = sever; errors[0].reason = CORBA::string_dup(reason); delete[] reason; errors[0].origin = CORBA::string_dup(origin.c_str()); errors[0].desc = CORBA::string_dup(desc.c_str()); throw Tango::DevFailed(errors); } /** * Generate and throw a TANGO DevFailed exception. * * The exception is created with a single DevError * object. A default value "Tango::ERR" is defined for the DevError * severity field. * The memory used by the reason and origin parameters will be freed by this method * Click here to read * DevFailed exception specification * * @param reason The exception DevError object reason field * @param desc The exception DevError object desc field * @param origin The exception DevError object origin field * @param sever The exception DevError object severity field * @exception DevFailed The thrown exception. * Click here to read * DevFailed exception specification */ static inline void throw_exception(char *reason, const string &desc, char *origin, Tango::ErrSeverity sever = Tango::ERR) { Tango::DevErrorList errors(1); errors.length(1); errors[0].severity = sever; errors[0].reason = CORBA::string_dup(reason); delete[] reason; errors[0].origin = CORBA::string_dup(origin); delete[] origin; errors[0].desc = CORBA::string_dup(desc.c_str()); throw Tango::DevFailed(errors); } /** * Generate and throw a TANGO DevFailed exception. * * The exception is created with a single DevError * object. A default value "Tango::ERR" is defined for the DevError * severity field. * The memory used by the reason and desc parameter will be freed by this method * Click here to read * DevFailed exception specification * * @param reason The exception DevError object reason field * @param desc The exception DevError object desc field * @param origin The exception DevError object origin field * @param sever The exception DevError object severity field * @exception DevFailed The thrown exception. * Click here to read * DevFailed exception specification */ static inline void throw_exception(char *reason, char *desc, const string &origin, Tango::ErrSeverity sever = Tango::ERR) { Tango::DevErrorList errors(1); errors.length(1); errors[0].severity = sever; errors[0].reason = CORBA::string_dup(reason); delete[] reason; errors[0].origin = CORBA::string_dup(desc); delete[] desc; errors[0].desc = CORBA::string_dup(origin.c_str()); throw Tango::DevFailed(errors); } //@} /**@name Re-throw exception inline methods (static) */ //@{ /** * Re-throw a TANGO DevFailed exception with one more error. * * The exception is re-thrown with one more DevError * object. A default value "Tango::ERR" is defined for the new DevError * severity field. * Click here to read * DevFailed exception specification * * @param ex The DevFailed exception * @param reason The exception DevError object reason field * @param desc The exception DevError object desc field * @param origin The exception DevError object origin field * @param sever The exception DevError object severity field * @exception DevFailed The thrown exception. * Click here to read * DevFailed exception specification */ static inline void re_throw_exception(Tango::DevFailed &ex, const char *reason, const char *desc, const char *origin, Tango::ErrSeverity sever = Tango::ERR) { long nb_err = ex.errors.length(); ex.errors.length(nb_err + 1); ex.errors[nb_err].desc = CORBA::string_dup(desc); ex.errors[nb_err].severity = sever; ex.errors[nb_err].reason = CORBA::string_dup(reason); ex.errors[nb_err].origin = CORBA::string_dup(origin); throw ex; } /** * Re-throw a TANGO DevFailed exception with one more error. * * The exception is re-thrown with one more DevError * object. A default value "Tango::ERR" is defined for the new DevError * severity field. * The memory used by the origin parameter will be freed by this method * Click here to read * DevFailed exception specification * * @param ex The DevFailed exception * @param reason The exception DevError object reason field * @param desc The exception DevError object desc field * @param origin The exception DevError object origin field * @param sever The exception DevError object severity field * @exception DevFailed The thrown exception. * Click here to read * DevFailed exception specification */ static inline void re_throw_exception(Tango::DevFailed &ex, const char *reason, const char *desc, char *origin, Tango::ErrSeverity sever = Tango::ERR) { long nb_err = ex.errors.length(); ex.errors.length(nb_err + 1); ex.errors[nb_err].desc = CORBA::string_dup(desc); ex.errors[nb_err].severity = sever; ex.errors[nb_err].reason = CORBA::string_dup(reason); ex.errors[nb_err].origin = CORBA::string_dup(origin); delete[] origin; throw ex; } /** * Re-throw a TANGO DevFailed exception with one more error. * * The exception is re-thrown with one more DevError * object. A default value "Tango::ERR" is defined for the new DevError * severity field. * The memory used by the desc parameter will be freed by this method * Click here to read * DevFailed exception specification * * @param ex The DevFailed exception * @param reason The exception DevError object reason field * @param desc The exception DevError object desc field * @param origin The exception DevError object origin field * @param sever The exception DevError object severity field * @exception DevFailed The thrown exception. * Click here to read * DevFailed exception specification */ static inline void re_throw_exception(Tango::DevFailed &ex, const char *reason, char *desc, const char *origin, Tango::ErrSeverity sever = Tango::ERR) { long nb_err = ex.errors.length(); ex.errors.length(nb_err + 1); ex.errors[nb_err].severity = sever; ex.errors[nb_err].desc = CORBA::string_dup(desc); delete[] desc; ex.errors[nb_err].origin = CORBA::string_dup(origin); ex.errors[nb_err].reason = CORBA::string_dup(reason); throw ex; } /** * Re-throw a TANGO DevFailed exception with one more error. * * The exception is re-thrown with one more DevError * object. A default value "Tango::ERR" is defined for the new DevError * severity field. * The memory used by the origin and desc parameters will be freed by this method * Click here to read * DevFailed exception specification * * @param ex The DevFailed exception * @param reason The exception DevError object reason field * @param desc The exception DevError object desc field * @param origin The exception DevError object origin field * @param sever The exception DevError object severity field * @exception DevFailed The thrown exception. * Click here to read * DevFailed exception specification */ static inline void re_throw_exception(Tango::DevFailed &ex, const char *reason, char *desc, char *origin, Tango::ErrSeverity sever = Tango::ERR) { long nb_err = ex.errors.length(); ex.errors.length(nb_err + 1); ex.errors[nb_err].severity = sever; ex.errors[nb_err].reason = CORBA::string_dup(reason); ex.errors[nb_err].origin = CORBA::string_dup(origin); delete[] origin; ex.errors[nb_err].desc = CORBA::string_dup(desc); delete[] desc; throw ex; } /** * Re-throw a TANGO DevFailed exception with one more error. * * The exception is re-thrown with one more DevError * object. A default value "Tango::ERR" is defined for the new DevError * severity field. * The memory used by the reason parameter will be freed by this method * Click here to read * DevFailed exception specification * * @param ex The DevFailed exception * @param reason The exception DevError object reason field * @param desc The exception DevError object desc field * @param origin The exception DevError object origin field * @param sever The exception DevError object severity field * @exception DevFailed The thrown exception. * Click here to read * DevFailed exception specification */ static inline void re_throw_exception(Tango::DevFailed &ex, char *reason, const char *desc, const char *origin, Tango::ErrSeverity sever = Tango::ERR) { long nb_err = ex.errors.length(); ex.errors.length(nb_err + 1); ex.errors[nb_err].severity = sever; ex.errors[nb_err].reason = CORBA::string_dup(reason); delete[] reason; ex.errors[nb_err].origin = CORBA::string_dup(origin); ex.errors[nb_err].desc = CORBA::string_dup(desc); throw ex; } /** * Re-throw a TANGO DevFailed exception with one more error. * * The exception is re-thrown with one more DevError * object. A default value "Tango::ERR" is defined for the new DevError * severity field. * The memory used by the reason and origin parameters will be freed by this method * Click here to read * DevFailed exception specification * * @param ex The DevFailed exception * @param reason The exception DevError object reason field * @param desc The exception DevError object desc field * @param origin The exception DevError object origin field * @param sever The exception DevError object severity field * @exception DevFailed The thrown exception. * Click here to read * DevFailed exception specification */ static inline void re_throw_exception(Tango::DevFailed &ex, char *reason, const char *desc, char *origin, Tango::ErrSeverity sever = Tango::ERR) { long nb_err = ex.errors.length(); ex.errors.length(nb_err + 1); ex.errors[nb_err].severity = sever; ex.errors[nb_err].reason = CORBA::string_dup(reason); delete[] reason; ex.errors[nb_err].origin = CORBA::string_dup(origin); delete[] origin; ex.errors[nb_err].desc = CORBA::string_dup(desc); throw ex; } /** * Re-throw a TANGO DevFailed exception with one more error. * * The exception is re-thrown with one more DevError * object. A default value "Tango::ERR" is defined for the new DevError * severity field. * The memory used by the reason and desc parameters will be freed by this method * Click here to read * DevFailed exception specification * * @param ex The DevFailed exception * @param reason The exception DevError object reason field * @param desc The exception DevError object desc field * @param origin The exception DevError object origin field * @param sever The exception DevError object severity field * @exception DevFailed The thrown exception. * Click here to read * DevFailed exception specification */ static inline void re_throw_exception(Tango::DevFailed &ex, char *reason, char *desc, const char *origin, Tango::ErrSeverity sever = Tango::ERR) { long nb_err = ex.errors.length(); ex.errors.length(nb_err + 1); ex.errors[nb_err].severity = sever; ex.errors[nb_err].reason = CORBA::string_dup(reason); delete[] reason; ex.errors[nb_err].origin = CORBA::string_dup(origin); ex.errors[nb_err].desc = CORBA::string_dup(desc); delete[] desc; throw ex; } /** * Re-throw a TANGO DevFailed exception with one more error. * * The exception is re-thrown with one more DevError * object. A default value "Tango::ERR" is defined for the new DevError * severity field. * The memory used by the origin, reason and desc parameters will be freed by this method * Click here to read * DevFailed exception specification * * @param ex The DevFailed exception * @param reason The exception DevError object reason field * @param desc The exception DevError object desc field * @param origin The exception DevError object origin field * @param sever The exception DevError object severity field * @exception DevFailed The thrown exception. * Click here to read * DevFailed exception specification */ static inline void re_throw_exception(Tango::DevFailed &ex, char *reason, char *desc, char *origin, Tango::ErrSeverity sever = Tango::ERR) { long nb_err = ex.errors.length(); ex.errors.length(nb_err + 1); ex.errors[nb_err].severity = sever; ex.errors[nb_err].reason = CORBA::string_dup(reason); delete[] reason; ex.errors[nb_err].origin = CORBA::string_dup(origin); delete[] origin; ex.errors[nb_err].desc = CORBA::string_dup(desc); delete[] desc; throw ex; } /** * Re-throw a TANGO DevFailed exception with one more error. * * The exception is re-thrown with one more DevError * object. A default value "Tango::ERR" is defined for the new DevError * severity field. * Click here to read * DevFailed exception specification * * @param ex The DevFailed exception * @param reason The exception DevError object reason field * @param desc The exception DevError object desc field * @param origin The exception DevError object origin field * @param sever The exception DevError object severity field * @exception DevFailed The thrown exception. * Click here to read * DevFailed exception specification */ static inline void re_throw_exception(Tango::DevFailed &ex, const string &reason, const string &desc, const string &origin, Tango::ErrSeverity sever = Tango::ERR) { long nb_err = ex.errors.length(); ex.errors.length(nb_err + 1); ex.errors[nb_err].severity = sever; ex.errors[nb_err].reason = CORBA::string_dup(reason.c_str()); ex.errors[nb_err].origin = CORBA::string_dup(origin.c_str()); ex.errors[nb_err].desc = CORBA::string_dup(desc.c_str()); throw ex; } /** * Re-throw a TANGO DevFailed exception with one more error. * * The exception is re-thrown with one more DevError * object. A default value "Tango::ERR" is defined for the new DevError * severity field. * Click here to read * DevFailed exception specification * * @param ex The DevFailed exception * @param reason The exception DevError object reason field * @param desc The exception DevError object desc field * @param origin The exception DevError object origin field * @param sever The exception DevError object severity field * @exception DevFailed The thrown exception. * Click here to read * DevFailed exception specification */ static inline void re_throw_exception(Tango::DevFailed &ex, const string &reason, const string &desc, const char *origin, Tango::ErrSeverity sever = Tango::ERR) { long nb_err = ex.errors.length(); ex.errors.length(nb_err + 1); ex.errors[nb_err].severity = sever; ex.errors[nb_err].reason = CORBA::string_dup(reason.c_str()); ex.errors[nb_err].origin = CORBA::string_dup(origin); ex.errors[nb_err].desc = CORBA::string_dup(desc.c_str()); throw ex; } /** * Re-throw a TANGO DevFailed exception with one more error. * * The exception is re-thrown with one more DevError * object. A default value "Tango::ERR" is defined for the new DevError * severity field. * Click here to read * DevFailed exception specification * * @param ex The DevFailed exception * @param reason The exception DevError object reason field * @param desc The exception DevError object desc field * @param origin The exception DevError object origin field * @param sever The exception DevError object severity field * @exception DevFailed The thrown exception. * Click here to read * DevFailed exception specification */ static inline void re_throw_exception(Tango::DevFailed &ex, const string &reason, const char *desc, const string &origin, Tango::ErrSeverity sever = Tango::ERR) { long nb_err = ex.errors.length(); ex.errors.length(nb_err + 1); ex.errors[nb_err].severity = sever; ex.errors[nb_err].reason = CORBA::string_dup(reason.c_str()); ex.errors[nb_err].origin = CORBA::string_dup(desc); ex.errors[nb_err].desc = CORBA::string_dup(origin.c_str()); throw ex; } /** * Re-throw a TANGO DevFailed exception with one more error. * * The exception is re-thrown with one more DevError * object. A default value "Tango::ERR" is defined for the new DevError * severity field. * Click here to read * DevFailed exception specification * * @param ex The DevFailed exception * @param reason The exception DevError object reason field * @param desc The exception DevError object desc field * @param origin The exception DevError object origin field * @param sever The exception DevError object severity field * @exception DevFailed The thrown exception. * Click here to read * DevFailed exception specification */ static inline void re_throw_exception(Tango::DevFailed &ex, const string &reason, const char *desc, const char *origin, Tango::ErrSeverity sever = Tango::ERR) { long nb_err = ex.errors.length(); ex.errors.length(nb_err + 1); ex.errors[nb_err].severity = sever; ex.errors[nb_err].reason = CORBA::string_dup(reason.c_str()); ex.errors[nb_err].origin = CORBA::string_dup(origin); ex.errors[nb_err].desc = CORBA::string_dup(desc); throw ex; } /** * Re-throw a TANGO DevFailed exception with one more error. * * The exception is re-thrown with one more DevError * object. A default value "Tango::ERR" is defined for the new DevError * severity field. * Click here to read * DevFailed exception specification * * @param ex The DevFailed exception * @param reason The exception DevError object reason field * @param desc The exception DevError object desc field * @param origin The exception DevError object origin field * @param sever The exception DevError object severity field * @exception DevFailed The thrown exception. * Click here to read * DevFailed exception specification */ static inline void re_throw_exception(Tango::DevFailed &ex, const char *reason, const string &desc, const string &origin, Tango::ErrSeverity sever = Tango::ERR) { long nb_err = ex.errors.length(); ex.errors.length(nb_err + 1); ex.errors[nb_err].severity = sever; ex.errors[nb_err].reason = CORBA::string_dup(reason); ex.errors[nb_err].origin = CORBA::string_dup(origin.c_str()); ex.errors[nb_err].desc = CORBA::string_dup(desc.c_str()); throw ex; } /** * Re-throw a TANGO DevFailed exception with one more error. * * The exception is re-thrown with one more DevError * object. A default value "Tango::ERR" is defined for the new DevError * severity field. * Click here to read * DevFailed exception specification * * @param ex The DevFailed exception * @param reason The exception DevError object reason field * @param desc The exception DevError object desc field * @param origin The exception DevError object origin field * @param sever The exception DevError object severity field * @exception DevFailed The thrown exception. * Click here to read * DevFailed exception specification */ static inline void re_throw_exception(Tango::DevFailed &ex, const char *reason, const string &desc, const char *origin, Tango::ErrSeverity sever = Tango::ERR) { long nb_err = ex.errors.length(); ex.errors.length(nb_err + 1); ex.errors[nb_err].severity = sever; ex.errors[nb_err].reason = CORBA::string_dup(reason); ex.errors[nb_err].origin = CORBA::string_dup(origin); ex.errors[nb_err].desc = CORBA::string_dup(desc.c_str()); throw ex; } /** * Re-throw a TANGO DevFailed exception with one more error. * * The exception is re-thrown with one more DevError * object. A default value "Tango::ERR" is defined for the new DevError * severity field. * Click here to read * DevFailed exception specification * * @param ex The DevFailed exception * @param reason The exception DevError object reason field * @param desc The exception DevError object desc field * @param origin The exception DevError object origin field * @param sever The exception DevError object severity field * @exception DevFailed The thrown exception. * Click here to read * DevFailed exception specification */ static inline void re_throw_exception(Tango::DevFailed &ex, const char *reason, const char *desc, const string &origin, Tango::ErrSeverity sever = Tango::ERR) { long nb_err = ex.errors.length(); ex.errors.length(nb_err + 1); ex.errors[nb_err].severity = sever; ex.errors[nb_err].reason = CORBA::string_dup(reason); ex.errors[nb_err].origin = CORBA::string_dup(desc); ex.errors[nb_err].desc = CORBA::string_dup(origin.c_str()); throw ex; } /** * Re-throw a TANGO DevFailed exception with one more error. * * The exception is re-thrown with one more DevError * object. A default value "Tango::ERR" is defined for the new DevError * severity field. * The memory used by the origin parameter will be freed by this method * Click here to read * DevFailed exception specification * * @param ex The DevFailed exception * @param reason The exception DevError object reason field * @param desc The exception DevError object desc field * @param origin The exception DevError object origin field * @param sever The exception DevError object severity field * @exception DevFailed The thrown exception. * Click here to read * DevFailed exception specification */ static inline void re_throw_exception(Tango::DevFailed &ex, const string &reason, const string &desc, char *origin, Tango::ErrSeverity sever = Tango::ERR) { long nb_err = ex.errors.length(); ex.errors.length(nb_err + 1); ex.errors[nb_err].severity = sever; ex.errors[nb_err].reason = CORBA::string_dup(reason.c_str()); ex.errors[nb_err].origin = CORBA::string_dup(origin); delete[] origin; ex.errors[nb_err].desc = CORBA::string_dup(desc.c_str()); throw ex; } /** * Re-throw a TANGO DevFailed exception with one more error. * * The exception is re-thrown with one more DevError * object. A default value "Tango::ERR" is defined for the new DevError * severity field. * The memory used by the desc parameter will be freed by this method * Click here to read * DevFailed exception specification * * @param ex The DevFailed exception * @param reason The exception DevError object reason field * @param desc The exception DevError object desc field * @param origin The exception DevError object origin field * @param sever The exception DevError object severity field * @exception DevFailed The thrown exception. * Click here to read * DevFailed exception specification */ static inline void re_throw_exception(Tango::DevFailed &ex, const string &reason, char *desc, const string &origin, Tango::ErrSeverity sever = Tango::ERR) { long nb_err = ex.errors.length(); ex.errors.length(nb_err + 1); ex.errors[nb_err].severity = sever; ex.errors[nb_err].reason = CORBA::string_dup(reason.c_str()); ex.errors[nb_err].origin = CORBA::string_dup(desc); delete[] desc; ex.errors[nb_err].desc = CORBA::string_dup(origin.c_str()); throw ex; } /** * Re-throw a TANGO DevFailed exception with one more error. * * The exception is re-thrown with one more DevError * object. A default value "Tango::ERR" is defined for the new DevError * severity field. * The memory used by the origin and desc parameters will be freed by this method * Click here to read * DevFailed exception specification * * @param ex The DevFailed exception * @param reason The exception DevError object reason field * @param desc The exception DevError object desc field * @param origin The exception DevError object origin field * @param sever The exception DevError object severity field * @exception DevFailed The thrown exception. * Click here to read * DevFailed exception specification */ static inline void re_throw_exception(Tango::DevFailed &ex, const string &reason, char *desc, char *origin, Tango::ErrSeverity sever = Tango::ERR) { long nb_err = ex.errors.length(); ex.errors.length(nb_err + 1); ex.errors[nb_err].severity = sever; ex.errors[nb_err].reason = CORBA::string_dup(reason.c_str()); ex.errors[nb_err].origin = CORBA::string_dup(origin); delete[] origin; ex.errors[nb_err].desc = CORBA::string_dup(desc); delete desc; throw ex; } /** * Re-throw a TANGO DevFailed exception with one more error. * * The exception is re-thrown with one more DevError * object. A default value "Tango::ERR" is defined for the new DevError * severity field. * The memory used by the reason parameter will be freed by this method * Click here to read * DevFailed exception specification * * @param ex The DevFailed exception * @param reason The exception DevError object reason field * @param desc The exception DevError object desc field * @param origin The exception DevError object origin field * @param sever The exception DevError object severity field * @exception DevFailed The thrown exception. * Click here to read * DevFailed exception specification */ static inline void re_throw_exception(Tango::DevFailed &ex, char *reason, const string &desc, const string &origin, Tango::ErrSeverity sever = Tango::ERR) { long nb_err = ex.errors.length(); ex.errors.length(nb_err + 1); ex.errors[nb_err].severity = sever; ex.errors[nb_err].reason = CORBA::string_dup(reason); delete[] reason; ex.errors[nb_err].origin = CORBA::string_dup(origin.c_str()); ex.errors[nb_err].desc = CORBA::string_dup(desc.c_str()); throw ex; } /** * Re-throw a TANGO DevFailed exception with one more error. * * The exception is re-thrown with one more DevError * object. A default value "Tango::ERR" is defined for the new DevError * severity field. * The memory used by the reason and origin parameters will be freed by this method * Click here to read * DevFailed exception specification * * @param ex The DevFailed exception * @param reason The exception DevError object reason field * @param desc The exception DevError object desc field * @param origin The exception DevError object origin field * @param sever The exception DevError object severity field * @exception DevFailed The thrown exception. * Click here to read * DevFailed exception specification */ static inline void re_throw_exception(Tango::DevFailed &ex, char *reason, const string &desc, char *origin, Tango::ErrSeverity sever = Tango::ERR) { long nb_err = ex.errors.length(); ex.errors.length(nb_err + 1); ex.errors[nb_err].severity = sever; ex.errors[nb_err].reason = CORBA::string_dup(reason); delete[] reason; ex.errors[nb_err].origin = CORBA::string_dup(origin); delete[] origin; ex.errors[nb_err].desc = CORBA::string_dup(desc.c_str()); throw ex; } /** * Re-throw a TANGO DevFailed exception with one more error. * * The exception is re-thrown with one more DevError * object. A default value "Tango::ERR" is defined for the new DevError * severity field. * The memory used by the reason and desc parameter will be freed by this method * Click here to read * DevFailed exception specification * * @param ex The DevFailed exception * @param reason The exception DevError object reason field * @param desc The exception DevError object desc field * @param origin The exception DevError object origin field * @param sever The exception DevError object severity field * @exception DevFailed The thrown exception. * Click here to read * DevFailed exception specification */ static inline void re_throw_exception(Tango::DevFailed &ex, char *reason, char *desc, const string &origin, Tango::ErrSeverity sever = Tango::ERR) { long nb_err = ex.errors.length(); ex.errors.length(nb_err + 1); ex.errors[nb_err].severity = sever; ex.errors[nb_err].reason = CORBA::string_dup(reason); delete[] reason; ex.errors[nb_err].origin = CORBA::string_dup(desc); delete[] desc; ex.errors[nb_err].desc = CORBA::string_dup(origin.c_str()); throw ex; } //@} /**@name Other throw exception methods */ //@{ /** * Generate and throw a TANGO DevFailed exception. * * The exception is created with a single DevError * object. A value "Tango::ERR" is defined for the DevError * severity field. * Click here to read * DevFailed exception specification * * @param ex A CORBA System Exception. The reason and desc fields of the * DevError object will be set according to the data in this exception. * The desc field is always set to API_CorbaSysException and the reason flag is * different depending on the exact type of the CORBA system exception. * @param origin The exception DevError object origin field * @exception DevFailed The thrown exception. * Click here to read * DevFailed exception specification */ static void throw_exception(const CORBA::SystemException &ex,const char *origin); /** * Generate and throw a TANGO DevFailed exception. * * The exception is created with a single DevError * object. A value "Tango::ERR" is defined for the DevError * severity field. * Click here to read * DevFailed exception specification * * @param ex A CORBA System Exception. The reason and desc fields of the * DevError object will be set according to the data in this exception. * The desc field is always set to API_CorbaSysException and the reason flag is * different depending on the exact type of the CORBA system exception. * @param origin The exception DevError object origin field. The memory * allocated for this parameter will be freed by this method. * @exception DevFailed The thrown exception. * Click here to read * DevFailed exception specification */ static void throw_exception(const CORBA::SystemException &ex,char *origin); /** * Generate and throw a TANGO DevFailed exception. * * The exception is created with a single DevError * object. A value "Tango::ERR" is defined for the DevError * severity field. * Click here to read * DevFailed exception specification * * @param ex A CORBA System Exception. The reason and desc fields of the * DevError object will be set according to the data in this exception. * The desc field is always set to API_CorbaSysException and the reason flag is * different depending on the exact type of the CORBA system exception. * @param origin The exception DevError object origin field. The memory * allocated for this parameter will be freed by this method. * @exception DevFailed The thrown exception. * Click here to read * DevFailed exception specification */ static void throw_exception(const CORBA::SystemException &ex,const string &origin); /** * Throw a TANGO MultiDevFailed exception. * * Throw a MultiDevFailed exception with one more DevError * object for the attribute with name given as first parameter. * A default value "Tango::ERR" is defined for the new DevError * severity field. * Note that throwing MultiDevFailed exception is allowed only in attribute writing methods. * The memory used by the origin and desc parameters will be freed by this method * Click here to read * DevFailed exception specification * * @param att_name The attribute name * @param reason The exception DevError object reason field * @param desc The exception DevError object desc field * @param origin The exception DevError object origin field * @param sever The exception DevError object severity field * @exception MultiDevFailed The thrown exception. * Click here to read * MultiDevFailed exception specification */ static inline void throw_named_exception(const char *att_name,const char *reason, const char *desc,const char *origin,Tango::ErrSeverity sever = Tango::ERR) { Tango::NamedDevErrorList errors(1); errors.length(1); errors[0].name = CORBA::string_dup(att_name); errors[0].index_in_call = 999; errors[0].err_list.length(1); errors[0].err_list[0].desc = CORBA::string_dup(desc); errors[0].err_list[0].severity = sever; errors[0].err_list[0].reason = CORBA::string_dup(reason); errors[0].err_list[0].origin = CORBA::string_dup(origin); throw Tango::MultiDevFailed(errors); } /** * Throw a TANGO MultiDevFailed exception. * * Throw a MultiDevFailed exception with one more DevError * object for the attribute list with names given as first parameter. * A default value "Tango::ERR" is defined for the new DevError * severity field. * Note that throwing MultiDevFailed exception is allowed only in attribute writing methods. * The memory used by the origin and desc parameters will be freed by this method * Click here to read * DevFailed exception specification * * @param atts The attributes name vector * @param reason The exception DevError object reason field * @param desc The exception DevError object desc field * @param origin The exception DevError object origin field * @param sever The exception DevError object severity field * @exception MultiDevFailed The thrown exception. * Click here to read * MultiDevFailed exception specification */ static inline void throw_named_exception(vector &atts,const char *reason, const char *desc,const char *origin,Tango::ErrSeverity sever = Tango::ERR) { unsigned int a_size = (unsigned int)atts.size(); Tango::NamedDevErrorList errors(a_size); errors.length(a_size); for (unsigned int loop = 0;loop < a_size;loop++) { errors[loop].name = CORBA::string_dup(atts[loop].c_str()); errors[loop].index_in_call = 999; errors[loop].err_list.length(1); errors[loop].err_list[0].desc = CORBA::string_dup(desc); errors[loop].err_list[0].severity = sever; errors[loop].err_list[0].reason = CORBA::string_dup(reason); errors[loop].err_list[0].origin = CORBA::string_dup(origin); } throw Tango::MultiDevFailed(errors); } /** * Throw a TANGO MultiDevFailed exception. * * Throw a MultiDevFailed exception with one more DevError * object for one attribute with index given as second parameter. * The attributes index is the index received by the write_attr_hardware() method. * A default value "Tango::ERR" is defined for the new DevError * severity field. * Note that throwing MultiDevFailed exception is allowed only in attribute writing methods. * * The memory used by the origin and desc parameters will be freed by this method * Click here to read * DevFailed exception specification * * @param d The device pointer * @param att_idx The attributes index * @param reason The exception DevError object reason field * @param desc The exception DevError object desc field * @param origin The exception DevError object origin field * @param sever The exception DevError object severity field * @exception MultiDevFailed The thrown exception. * Click here to read * MultiDevFailed exception specification */ static void throw_named_exception(Tango::DeviceImpl *d,long att_idx,const char *reason, const char *desc,const char *origin,Tango::ErrSeverity sever = Tango::ERR); /** * Throw a TANGO MultiDevFailed exception. * * Throw a MultiDevFailed exception with one more DevError * object for the attribute list with indexes given as second parameter. * The attributes indexes are the index received by the write_attr_hardware() method. * A default value "Tango::ERR" is defined for the new DevError * severity field. * Note that throwing MultiDevFailed exception is allowed only in attribute writing methods. * * The memory used by the origin and desc parameters will be freed by this method * Click here to read * DevFailed exception specification * * @param d The device pointer * @param atts The attributes indexes vector * @param reason The exception DevError object reason field * @param desc The exception DevError object desc field * @param origin The exception DevError object origin field * @param sever The exception DevError object severity field * @exception MultiDevFailed The thrown exception. * Click here to read * MultiDevFailed exception specification */ static void throw_named_exception(Tango::DeviceImpl *d,vector &atts,const char *reason, const char *desc,const char *origin,Tango::ErrSeverity sever = Tango::ERR); /** * Compare two Tango DevFailed exceptions for equality * * The two DevFailed exceptions are verified by comparing the * reason, origin, description and severity of all exceptions in the error stack. * The strings reason, origin and description are compared literally. * Click here to read * DevFailed exception specification * * @param ex1 The first DevFailed exception * @param ex2 The second DevFailed exception * @return A boolean set to true if the two exceptions are equal */ static bool compare_exception(Tango::DevFailed &ex1, Tango::DevFailed &ex2); //@} /// @privatesection static char *print_CORBA_SystemException(const CORBA::SystemException *); static omni_mutex the_mutex; protected: /// @privatesection static char mess[256]; }; } // End of Tango namespace #endif /* EXCEPT */ tango-8.1.2c+dfsg.orig/lib/cpp/server/tangoappender.cpp0000644000175000017500000001203712205375142021770 0ustar piccapiccastatic const char *RcsId = "$Id: tangoappender.cpp 22213 2013-03-07 14:32:56Z taurel $\n$Name$"; //+============================================================================= // // file : tangoappender.cpp // // description : // // project : TANGO // // author(s) : N.Leclercq - SOLEIL // // Copyright (C) : 2004,2005,2006,2007,2008,2009,2010,2011,2012,2013 // European Synchrotron Radiation Facility // BP 220, Grenoble 38043 // FRANCE // // This file is part of Tango. // // Tango 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. // // Tango 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 Tango. If not, see . // // // $Revision: 22213 $ // //-============================================================================= #if HAVE_CONFIG_H #include #endif #include #include #ifdef TANGO_HAS_LOG4TANGO #include #define USE_ASYNC_CALL namespace Tango { TangoAppender::TangoAppender (const std::string& src_name, const std::string& name, const std::string& dev_name, bool open_connection) : log4tango::Appender(name), _dev_name(dev_name), _src_name(src_name), _dev_proxy(0) { if (open_connection == true) reopen(); } TangoAppender::~TangoAppender () { close(); } bool TangoAppender::requires_layout (void) const { return false; } void TangoAppender::set_layout (log4tango::Layout*) { // no-op } bool TangoAppender::is_valid (void) const { if (!_dev_proxy) { return false; } try { _dev_proxy->ping(); } catch (...) { return false; } return true; } int TangoAppender::_append (const log4tango::LoggingEvent& event) { //------------------------------------------------------------ //- DO NOT LOG FROM THIS METHOD !!! //------------------------------------------------------------ if (!_dev_proxy) { //--DO NOT RETURN -1 (ERROR ALREADY HANDLED) return 0; } try { Tango::DevVarStringArray *dvsa = new Tango::DevVarStringArray(6); if (dvsa) { dvsa->length(6); double ts_ms = 1000. * event.timestamp.get_seconds(); ts_ms += event.timestamp.get_milliseconds(); TangoSys_OMemStream ts_ms_str; ts_ms_str << std::fixed << std::noshowpoint << std::setprecision(0) << ts_ms << ends; string st = ts_ms_str.str(); (*dvsa)[0] = CORBA::string_dup(st.c_str()); (*dvsa)[1] = CORBA::string_dup(log4tango::Level::get_name(event.level).c_str()); (*dvsa)[2] = CORBA::string_dup(event.logger_name.c_str()); (*dvsa)[3] = CORBA::string_dup(event.message.c_str()); (*dvsa)[4] = CORBA::string_dup(""); omni_thread* ct = omni_thread::self(); if (ct) { TangoSys_OMemStream ctstr; ctstr << "@" << hex << event.thread_id << " [" << ct->id() << "]"<< ends; string st = ctstr.str(); (*dvsa)[5] = CORBA::string_dup(st.c_str()); } else { (*dvsa)[5] = CORBA::string_dup("unknown"); } DeviceData argin; argin << dvsa; #ifdef USE_ASYNC_CALL _dev_proxy->command_inout_asynch("Log", argin, true); #else _dev_proxy->command_inout("Log", argin); #endif } } catch (...) { close(); return -1; } return 0; } bool TangoAppender::reopen (void) { bool result = true; try { close(); _dev_proxy = new DeviceProxy(const_cast(_dev_name)); try { DeviceData argin; argin << const_cast(_src_name); #ifdef USE_ASYNC_CALL _dev_proxy->command_inout_asynch("Register", argin, true); #else _dev_proxy->command_inout("Register", argin); #endif } catch (...) { } } catch (...) { close(); result = false; } return result; } void TangoAppender::close (void) { if (_dev_proxy) { try { DeviceData argin; argin << const_cast(_src_name); #ifdef USE_ASYNC_CALL _dev_proxy->command_inout_asynch("UnRegister", argin, true); #else _dev_proxy->command_inout("UnRegister", argin); #endif } catch (...) { // Ignore error: some old logviewer may not support UnRegister } delete _dev_proxy; _dev_proxy = 0; } } } // namespace tango #endif // TANGO_HAS_LOG4TANGO tango-8.1.2c+dfsg.orig/lib/cpp/server/basiccommand.cpp0000644000175000017500000001673012205375142021565 0ustar piccapiccastatic const char *RcsId = "$Id: basiccommand.cpp 22213 2013-03-07 14:32:56Z taurel $\n$Name$"; //+============================================================================ // // file : BasicCommand.cpp // // description : C++ source code for commands which are automatically // installed for every devices // Three commands are : // DevState, DevStatus, DevRestart // // project : TANGO // // author(s) : A.Gotz + E.Taurel // // Copyright (C) : 2004,2005,2006,2007,2008,2009,2010,2011,2012,2013 // European Synchrotron Radiation Facility // BP 220, Grenoble 38043 // FRANCE // // This file is part of Tango. // // Tango 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. // // Tango 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 Tango. If not, see . // // $Revision: 22213 $ // //-============================================================================ #if HAVE_CONFIG_H #include #endif #include #include extern omni_thread::key_t key_py_data; namespace Tango { //+------------------------------------------------------------------------- // // method : DevStatusCmd::DevStatusCmd // // description : constructor for Command class Status // //-------------------------------------------------------------------------- DevStatusCmd::DevStatusCmd(const char *name,Tango::CmdArgType in,Tango::CmdArgType out) :Command(name,in,out) { } //+------------------------------------------------------------------------- // // method : DevStatusCmd::execute // // description : return status as string // //-------------------------------------------------------------------------- CORBA::Any *DevStatusCmd::execute(DeviceImpl *device, TANGO_UNUSED(const CORBA::Any &in_any)) { cout4 << "DevStatus::execute(): arrived " << endl; // // return status string as Any // CORBA::Any *out_any = NULL; try { out_any = new CORBA::Any(); } catch (bad_alloc) { Except::throw_exception((const char *)API_MemoryAllocation, (const char *)"Can't allocate memory in server", (const char *)"DevStatus::execute"); } try { if (device->is_alarm_state_forced() == true) (*out_any) <<= device->DeviceImpl::dev_status(); else (*out_any) <<= device->dev_status(); } catch(...) { delete out_any; throw; } cout4 << "Leaving DevStatus::execute()" << endl; return out_any; } //+------------------------------------------------------------------------- // // method : DevStateCmd::DevStateCmd // // description : constructor for Command class State // //-------------------------------------------------------------------------- DevStateCmd::DevStateCmd(const char *name,Tango::CmdArgType in, Tango::CmdArgType out) :Command(name,in,out) { } //+------------------------------------------------------------------------- // // method : StateCmd::execute // // description : return state as enumerated type // //-------------------------------------------------------------------------- CORBA::Any *DevStateCmd::execute(DeviceImpl *device, TANGO_UNUSED(const CORBA::Any &in_any)) { cout4 << "DevState::execute(): arrived" << endl; // // return state as Any // CORBA::Any *out_any = NULL; try { out_any = new CORBA::Any(); } catch (bad_alloc) { Except::throw_exception((const char *)API_MemoryAllocation, (const char *)"Can't allocate memory in server", (const char *)"DevStatus::execute"); } try { if (device->is_alarm_state_forced() == true) (*out_any) <<= device->DeviceImpl::dev_state(); else (*out_any) <<= device->dev_state(); } catch(...) { delete out_any; throw; } cout4 << "Leaving DevState::execute()" << endl; return out_any; } //+------------------------------------------------------------------------- // // method : DevStateCmd::DevInitCmd // // description : constructor for Command class Init // //-------------------------------------------------------------------------- DevInitCmd::DevInitCmd(const char *name,Tango::CmdArgType in, Tango::CmdArgType out) :Command(name,in,out) { } //-------------------------------------------------------------------------------------------------------------------- // // method : // InitCmd::execute // // description : // Initialize a device // // argument : // in : // - device : Pointer to the device on which the command must be eexcuted // - in_any : Input data packed in a CORBA Any object // //-------------------------------------------------------------------------------------------------------------------- CORBA::Any *DevInitCmd::execute(DeviceImpl *device, TANGO_UNUSED(const CORBA::Any &in_any)) { cout4 << "Init::execute(): arrived" << endl; // // Init device // Tango::Util *tg = Tango::Util::instance(); omni_thread *th; PyLock *lock_ptr = NULL; try { NoSyncModelTangoMonitor mon(device); if (tg->is_py_ds()) { th = omni_thread::self(); omni_thread::value_t *tmp_py_data = th->get_value(key_py_data); lock_ptr = (static_cast(tmp_py_data))->PerTh_py_lock; lock_ptr->Get(); } // clean the sub-device list for this device tg->get_sub_dev_diag().remove_sub_devices (device->get_name()); tg->get_sub_dev_diag().set_associated_device(device->get_name()); device->delete_device(); device->init_device(); // // Re-configure polling in device on which the Init cmd been done is the admin device but only if the Init is not // called during the DS startup sequence // DeviceImpl *admin_dev = NULL; try { admin_dev = tg->get_dserver_device(); } catch (Tango::DevFailed &) {} if (admin_dev == device) tg->polling_configure(); if (tg->is_py_ds()) lock_ptr->Release(); // // Apply memorized values for memorized attributes (if any). For Py DS, if some attributes are memorized, // the write_attributes call will take the Python lock // Tango::DeviceClass *dc = device->get_device_class(); vector dev_v = dc->get_device_list(); unsigned int loop; for (loop = 0;loop < dev_v.size();loop++) { if (dev_v[loop] == device) break; } if (loop != dev_v.size()) dc->set_memorized_values(false,loop,true); else { Tango::Except::throw_exception((const char *)API_DeviceNotFound, (const char *)"Can't find new device in device list", (const char *)"DevInitCmd::execute()"); } } catch (Tango::DevFailed &e) { if ((tg->is_py_ds() == true) && (lock_ptr != NULL)) { lock_ptr->Release(); } TangoSys_OMemStream o; o << "Init command failed!!"; o << "\nHINT: RESTART device with the Restart command of the device server adm. device"; o << "\nDevice server adm. device name = dserver/"; o << tg->get_ds_name().c_str() << ends; Except::re_throw_exception(e,(const char *)API_InitThrowsException,o.str(), (const char *)"DevInitCmd::execute()"); } // // return to the caller // CORBA::Any *ret = return_empty_any("InitCmd"); return ret; } } // End of Tango namespace tango-8.1.2c+dfsg.orig/lib/cpp/server/device_2.cpp0000644000175000017500000014260412205375142020625 0ustar piccapiccastatic const char *RcsId = "$Id: device_2.cpp 22213 2013-03-07 14:32:56Z taurel $\n$Name$"; //+============================================================================ // // file : Device_2.cpp // // description : C++ source code for the DeviceImpl and DeviceClass // classes. These classes // are the root class for all derived Device classes. // They are abstract classes. The DeviceImpl class is the // CORBA servant which is "exported" onto the network and // accessed by the client. // // project : TANGO // // author(s) : E.Taurel // // Copyright (C) : 2004,2005,2006,2007,2008,2009,2010,2011,2012,2013 // European Synchrotron Radiation Facility // BP 220, Grenoble 38043 // FRANCE // // This file is part of Tango. // // Tango 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. // // Tango 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 Tango. If not, see . // // $Revision: 22213 $ // //-============================================================================ #if HAVE_CONFIG_H #include #endif #include #include #include #ifdef _TG_WINDOWS_ #include #else #include #endif /* _TG_WINDOWS_ */ namespace Tango { //+------------------------------------------------------------------------- // // method : Device_2Impl::Device_2Impl // // description : constructors for the device_impl class from the // class object pointer, the device name, // the description field, the state and the status. // Device_2Impl inherits from DeviceImpl. These constructors // simply call the correct DeviceImpl class // constructor // //-------------------------------------------------------------------------- Device_2Impl::Device_2Impl(DeviceClass *device_class,string &dev_name): DeviceImpl(device_class,dev_name),ext_2(Tango_NullPtr) { ext->idl_version = 2; } Device_2Impl::Device_2Impl(DeviceClass *device_class, string &dev_name, string &desc): DeviceImpl(device_class,dev_name,desc),ext_2(Tango_NullPtr) { ext->idl_version = 2; } Device_2Impl::Device_2Impl(DeviceClass *device_class, string &dev_name,string &desc, Tango::DevState dev_state,string &dev_status): DeviceImpl(device_class,dev_name,desc,dev_state,dev_status),ext_2(Tango_NullPtr) { ext->idl_version = 2; } Device_2Impl::Device_2Impl(DeviceClass *device_class, const char *dev_name, const char *desc, Tango::DevState dev_state, const char *dev_status): DeviceImpl(device_class,dev_name,desc,dev_state,dev_status),ext_2(Tango_NullPtr) { ext->idl_version = 2; } //+------------------------------------------------------------------------- // // method : Device_2Impl::command_inout_2 // // description : Method called for each command_inout operation executed // from any client on a Tango device version 2. // //-------------------------------------------------------------------------- CORBA::Any *Device_2Impl::command_inout_2(const char *in_cmd, const CORBA::Any &in_data, Tango::DevSource source) { cout4 << "Device_2Impl::command_inout_2 arrived, source = " << source << ", command = " << in_cmd << endl; PollObj *polled_cmd = NULL; bool polling_failed = false; CORBA::Any *ret = NULL; // // Record operation request in black box // If this method is executed with the request to store info in // blackbox (store_in_bb == true), this means that the request arrives // through a Device_2 CORBA interface. Check locking feature in this // case. Otherwise the request has arrived through Device_4 and the check // is already done // if (ext->store_in_bb == true) { blackbox_ptr->insert_cmd(in_cmd,2,source); // // Do not check lock validity if State or Status is requested using command // bool state_status_cmd = false; if ((TG_strcasecmp(in_cmd,"state") == 0) || (TG_strcasecmp(in_cmd,"status") == 0)) state_status_cmd = true; // // Check if the device is locked and if it is valid // If the lock is not valid any more, clear it // if (state_status_cmd == false) { check_lock("command_inout2",in_cmd); } } ext->store_in_bb = true; // // If the source parameter specifies device, call the command_inout method // implemented by the DeviceImpl class // if (source == Tango::DEV) { AutoTangoMonitor sync(this); ext->store_in_bb = false; return command_inout(in_cmd,in_data); } else { bool status_cmd = false; bool state_cmd = false; TangoMonitor &p_mon = get_poll_monitor(); AutoTangoMonitor sync(&p_mon); try { string cmd_str(in_cmd); transform(cmd_str.begin(),cmd_str.end(),cmd_str.begin(),::tolower); // // Check that device supports this command and also check // if it is state or status // check_command_exists(cmd_str); long vers = get_dev_idl_version(); if (vers >= 3) { if (cmd_str == "state") state_cmd = true; else if (cmd_str == "status") status_cmd = true; } // // Check that the command is polled. // Warning : Since IDL 3 (Tango V5), state and status are polled as attributes // bool found = false; vector &poll_list = get_poll_obj_list(); unsigned long i; for (i = 0;i < poll_list.size();i++) { if (poll_list[i]->get_name() == cmd_str) { if ((state_cmd == true) || (status_cmd == true)) { if (poll_list[i]->get_type() == Tango::POLL_ATTR) { polled_cmd = poll_list[i]; found = true; } } else { if (poll_list[i]->get_type() == Tango::POLL_CMD) { polled_cmd = poll_list[i]; found = true; } } } } // // Throw exception if the command is not polled // if (found == false) { TangoSys_OMemStream o; o << "Command " << in_cmd << " not polled" << ends; Except::throw_exception((const char *)API_CmdNotPolled, o.str(), (const char *)"Device_2Impl::command_inout"); } /* // // If the command is not polled but its polling update period is defined, // and the command is not in the device list of command which should not be // polled, start to poll it // else { found = false; vector &napc = get_non_auto_polled_cmd(); for (i = 0;i < napc.size();i++) { if (napc[i] == cmd_str) found = true; } if (found == true) { TangoSys_OMemStream o; o << "Command " << in_cmd << " not polled" << ends; Except::throw_exception((const char *)API_CmdNotPolled, o.str(), (const char *)"Device_2Impl::command_inout"); } else { Tango::Util *tg = Tango::Util::instance(); DServer *adm_dev = tg->get_dserver_device(); DevVarLongStringArray *send = new DevVarLongStringArray(); send->lvalue.length(1); send->svalue.length(3); send->lvalue[0] = poll_period; send->svalue[0] = device_name.c_str(); send->svalue[1] = CORBA::string_dup("command"); send->svalue[2] = in_cmd; get_poll_monitor().rel_monitor(); adm_dev->add_obj_polling(send,false); delete send; // // Wait for first polling. Release monitor during this sleep in order // to give it to the polling thread // #ifdef _TG_WINDOWS_ Sleep((DWORD)600); get_poll_monitor().get_monitor(); #else struct timespec to_wait,inter; to_wait.tv_sec = 0; to_wait.tv_nsec = 600000000; nanosleep(&to_wait,&inter); get_poll_monitor().get_monitor(); #endif // // Update the polled-cmd pointer to the new polled object // for (i = 0;i < poll_list.size();i++) { if (poll_list[i]->get_name() == cmd_str) { polled_cmd = poll_list[i]; break; } } } } }*/ // // Check that some data is available in cache // if (polled_cmd->is_ring_empty() == true) { TangoSys_OMemStream o; o << "No data available in cache for command " << in_cmd << ends; Except::throw_exception((const char *)API_NoDataYet, o.str(), (const char *)"Device_2Impl::command_inout"); } // // Check that data are still refreshed by the polling thread // Skip this test for object with external polling triggering (upd = 0) // long tmp_upd = polled_cmd->get_upd(); if (tmp_upd != 0) { double last = polled_cmd->get_last_insert_date(); struct timeval now; #ifdef _TG_WINDOWS_ struct _timeb now_win; _ftime(&now_win); now.tv_sec = (unsigned long)now_win.time; now.tv_usec = (long)now_win.millitm * 1000; #else gettimeofday(&now,NULL); #endif now.tv_sec = now.tv_sec - DELTA_T; double now_d = (double)now.tv_sec + ((double)now.tv_usec / 1000000); double diff_d = now_d - last; if (diff_d > polled_cmd->get_authorized_delta()) { TangoSys_OMemStream o; o << "Data in cache for command " << in_cmd; o << " not updated any more" << ends; Except::throw_exception((const char *)API_NotUpdatedAnyMore, o.str(), (const char *)"Device_2Impl::command_inout"); } } } catch (Tango::DevFailed &) { if (source == Tango::CACHE) { throw; } polling_failed = true; } // // Get cmd result (or exception) // if (source == Tango::CACHE) { cout4 << "Device_2Impl: Returning data from polling buffer" << endl; if ((state_cmd == true) || (status_cmd == true)) { omni_mutex_lock sync(*polled_cmd); if (get_dev_idl_version() < 4) { Tango::AttributeValue_3 &att_val = polled_cmd->get_last_attr_value_3(false); ret = attr2cmd(att_val,state_cmd,status_cmd); } else { Tango::AttributeValue_4 &att_val = polled_cmd->get_last_attr_value_4(false); ret = attr2cmd(att_val,state_cmd,status_cmd); } } else ret = polled_cmd->get_last_cmd_result(); } else { if (polling_failed == false) { cout4 << "Device_2Impl: Returning data from polling buffer" << endl; if ((state_cmd == true) || (status_cmd == true)) { omni_mutex_lock sync(*polled_cmd); if (get_dev_idl_version() < 4) { Tango::AttributeValue_3 &att_val = polled_cmd->get_last_attr_value_3(false); ret = attr2cmd(att_val,state_cmd,status_cmd); } else { Tango::AttributeValue_4 &att_val = polled_cmd->get_last_attr_value_4(false); ret = attr2cmd(att_val,state_cmd,status_cmd); } } else ret = polled_cmd->get_last_cmd_result(); } } } if ((source != Tango::CACHE) && (polling_failed == true)) { AutoTangoMonitor sync(this); ext->store_in_bb = false; ret = command_inout(in_cmd,in_data); } return ret; } //+------------------------------------------------------------------------- // // method : Device_2Impl::read_attributes_2 // // description : Method called for each read_attributes operation executed // from any client on a Tango device version 2. // //-------------------------------------------------------------------------- Tango::AttributeValueList* Device_2Impl::read_attributes_2(const Tango::DevVarStringArray& names, Tango::DevSource source) { // AutoTangoMonitor sync(this); cout4 << "Device_2Impl::read_attributes_2 arrived" << endl; bool att_in_fault = false; bool polling_failed = false; Tango::AttributeValueList *back = NULL; // // Write the device name into the per thread data for // sub device diagnostics. // Keep the old name, to put it back at the end! // During device access inside the same server, // the thread stays the same! // SubDevDiag &sub = (Tango::Util::instance())->get_sub_dev_diag(); string last_associated_device = sub.get_associated_device(); sub.set_associated_device(get_name()); // Catch all execeptions to set back the associated device after // execution try { // // Record operation request in black box // blackbox_ptr->insert_attr(names,2,source); // // If the source parameter specifies device, call the read_attributes method // implemented by the DeviceImpl class // if (source == Tango::DEV) { AutoTangoMonitor sync(this,true); ext->store_in_bb = false; return read_attributes(names); } else { TangoMonitor &p_mon = get_poll_monitor(); AutoTangoMonitor sync(&p_mon); try { // // Build a sequence with the names of the attribute to be read. // This is necessary in case of the "AllAttr" shortcut is used // If all attributes are wanted, build this list // unsigned long i,j; bool all_attr = false; vector &poll_list = get_poll_obj_list(); unsigned long nb_poll = poll_list.size(); unsigned long nb_names = names.length(); Tango::DevVarStringArray real_names(nb_names); if (nb_names == 1) { string att_name(names[0]); if (att_name == AllAttr) { all_attr = true; for (i = 0;i < nb_poll;i++) { if (poll_list[i]->get_type() == Tango::POLL_ATTR) { long nb_in_seq = real_names.length(); real_names.length(nb_in_seq + 1); real_names[nb_in_seq] = poll_list[i]->get_name().c_str(); } } } else { real_names = names; } } else { real_names = names; } // // Check that device supports the wanted attribute // if (all_attr == false) { for (i = 0;i < real_names.length();i++) dev_attr->get_attr_ind_by_name(real_names[i]); } // // Check that all wanted attributes are polled. If some are non polled, store // their index in the real_names sequence in a vector // vector non_polled; if (all_attr == false) { for (i = 0;i < real_names.length();i++) { for (j = 0;j < nb_poll;j++) { #ifdef _TG_WINDOWS_ if (_stricmp(poll_list[j]->get_name().c_str(),real_names[i]) == 0) #else if (strcasecmp(poll_list[j]->get_name().c_str(),real_names[i]) == 0) #endif break; } if (j == nb_poll) { non_polled.push_back(i); } } } // // If some attributes are not polled but their polling update period is defined, // and the attribute is not in the device list of attr which should not be // polled, start to poll them // bool found; vector poll_period; if (non_polled.empty() == false) { // // Check that it is possible to start polling for the non polled attribute // for (i = 0;i < non_polled.size();i++) { Attribute &att = dev_attr->get_attr_by_name(real_names[non_polled[i]]); poll_period.push_back(att.get_polling_period()); if (poll_period.back() == 0) { TangoSys_OMemStream o; o << "Attribute " << real_names[non_polled[i]] << " not polled" << ends; Except::throw_exception((const char *)API_AttrNotPolled, o.str(), (const char *)"Device_2Impl::read_attributes"); } else { found = false; vector &napa = get_non_auto_polled_attr(); for (j = 0;j < napa.size();j++) { #ifdef _TG_WINDOWS_ if (_stricmp(napa[j].c_str(),real_names[non_polled[i]]) == 0) #else if (strcasecmp(napa[j].c_str(),real_names[non_polled[i]]) == 0) #endif found = true; } if (found == true) { TangoSys_OMemStream o; o << "Attribute " << real_names[non_polled[i]] << " not polled" << ends; Except::throw_exception((const char *)API_AttrNotPolled, o.str(), (const char *)"Device_2Impl::read_attributes"); } } } // // Start polling // Tango::Util *tg = Tango::Util::instance(); DServer *adm_dev = tg->get_dserver_device(); DevVarLongStringArray *send = new DevVarLongStringArray(); send->lvalue.length(1); send->svalue.length(3); send->svalue[0] = device_name.c_str(); send->svalue[1] = CORBA::string_dup("attribute"); for (i = 0;i < non_polled.size();i++) { send->lvalue[0] = poll_period[i]; send->svalue[2] = real_names[non_polled[i]]; adm_dev->add_obj_polling(send,false); } delete send; // // Wait for first polling // #ifdef _TG_WINDOWS_ get_poll_monitor().rel_monitor(); Sleep((DWORD)600); get_poll_monitor().get_monitor(); #else struct timespec to_wait,inter; to_wait.tv_sec = 0; to_wait.tv_nsec = 600000000; get_poll_monitor().rel_monitor(); nanosleep(&to_wait,&inter); get_poll_monitor().get_monitor(); #endif } // // Allocate memory for the AttributeValue structures // unsigned long nb_attr = real_names.length(); try { back = new Tango::AttributeValueList(nb_attr); back->length(nb_attr); } catch (bad_alloc) { back = NULL; Except::throw_exception((const char *)API_MemoryAllocation, (const char *)"Can't allocate memory in server", (const char *)"DeviceImpl_2::read_attributes"); } // // For each attribute, check that some data are available in cache and that they // are not too old // for (i = 0;i < nb_attr;i++) { vector &poll_list = get_poll_obj_list(); PollObj *polled_attr = NULL; unsigned long j; for (j = 0;j < poll_list.size();j++) { #ifdef _TG_WINDOWS_ if ((poll_list[j]->get_type() == Tango::POLL_ATTR) && (_stricmp(poll_list[j]->get_name().c_str(),real_names[i]) == 0)) #else if ((poll_list[j]->get_type() == Tango::POLL_ATTR) && (strcasecmp(poll_list[j]->get_name().c_str(),real_names[i]) == 0)) #endif { polled_attr = poll_list[j]; break; } } // // Check that some data is available in cache // if (polled_attr->is_ring_empty() == true) { delete back; back = NULL; TangoSys_OMemStream o; o << "No data available in cache for attribute " << real_names[i] << ends; Except::throw_exception((const char *)API_NoDataYet, o.str(), (const char *)"Device_2Impl::read_attributes"); } // // Check that data are still refreshed by the polling thread // Skip this test for object with external polling triggering (upd = 0) // long tmp_upd = polled_attr->get_upd(); if (tmp_upd != 0) { double last = polled_attr->get_last_insert_date(); struct timeval now; #ifdef _TG_WINDOWS_ struct _timeb now_win; _ftime(&now_win); now.tv_sec = (unsigned long)now_win.time; now.tv_usec = (long)now_win.millitm; #else gettimeofday(&now,NULL); #endif now.tv_sec = now.tv_sec - DELTA_T; double now_d = (double)now.tv_sec + ((double)now.tv_usec / 1000000); double diff_d = now_d - last; if (diff_d > polled_attr->get_authorized_delta()) { delete back; back = NULL; TangoSys_OMemStream o; o << "Data in cache for attribute " << real_names[i]; o << " not updated any more" << ends; Except::throw_exception((const char *)API_NotUpdatedAnyMore, o.str(), (const char *)"Device_2Impl::read_attributes"); } } // // Get attribute data type // Attribute &att = dev_attr->get_attr_by_name(real_names[i]); long type = att.get_data_type(); // // In IDL release 3, possibility to write spectrum and // images attributes have been added. This implies some // changes in the struture returned for a read_attributes // For server recompiled with this new release, the polling // thread uses this new structure type to store attribute // value. For some cases, it is possible to pass data from the // new type to the old one, but for other cases, it is not // possible. Throw exception in these cases // Tango::AttrWriteType w_type = att.get_writable(); Tango::AttrDataFormat format_type = att.get_data_format(); if ((format_type == Tango::SPECTRUM) || (format_type == Tango::IMAGE)) { if (w_type != Tango::READ) { delete back; back = NULL; TangoSys_OMemStream o; o << "Client too old to get data for attribute " << real_names[i].in(); o << ".\nPlease, use a client linked with Tango V5"; o << " and a device inheriting from Device_3Impl" << ends; Except::throw_exception((const char *)API_NotSupportedFeature, o.str(), (const char *)"Device_2Impl::read_attributes"); } } // // Finally, after all these checks, get value and store it in the sequence // sent back to user // In order to avoid unnecessary copy, don't use the assignement operator of the // AttributeValue structure which copy each element and therefore also copy // the Any object. The Any assignement operator is a deep copy! // Create a new sequence using the attribute buffer and insert it into the // Any. The sequence inside the source Any has been created using the attribute // data buffer. // try { { omni_mutex_lock sync(*polled_attr); long vers = get_dev_idl_version(); if (vers >= 4) { AttributeValue_4 &att_val_4 = polled_attr->get_last_attr_value_4(false); if (att_val_4.quality != Tango::ATTR_INVALID) { if (type == Tango::DEV_ENCODED) { delete back; back = NULL; TangoSys_OMemStream o; o << "Data type for attribute " << real_names[i] << " is DEV_ENCODED."; o << " It's not possible to retrieve this data type through the interface you are using (IDL V2)" << ends; Except::throw_exception((const char *)API_NotSupportedFeature, o.str(), (const char *)"Device_2Impl::read_attributes"); } Polled_2_Live(type,att_val_4.value,(*back)[i].value); (*back)[i].quality= att_val_4.quality; (*back)[i].time = att_val_4.time; (*back)[i].dim_x = att_val_4.r_dim.dim_x; (*back)[i].dim_y = att_val_4.r_dim.dim_y; (*back)[i].name = CORBA::string_dup(att_val_4.name); } } else if (vers == 3) { AttributeValue_3 &att_val_3 = polled_attr->get_last_attr_value_3(false); if (att_val_3.quality != Tango::ATTR_INVALID) { if (type == Tango::DEV_ENCODED) { delete back; back = NULL; TangoSys_OMemStream o; o << "Data type for attribute " << real_names[i] << " is DEV_ENCODED."; o << " It's not possible to retrieve this data type through the interface you are using (IDL V2)" << ends; Except::throw_exception((const char *)API_NotSupportedFeature, o.str(), (const char *)"Device_2Impl::read_attributes"); } Polled_2_Live(type,att_val_3.value,(*back)[i].value); (*back)[i].quality= att_val_3.quality; (*back)[i].time = att_val_3.time; (*back)[i].dim_x = att_val_3.r_dim.dim_x; (*back)[i].dim_y = att_val_3.r_dim.dim_y; (*back)[i].name = CORBA::string_dup(att_val_3.name); } } else { AttributeValue &att_val = polled_attr->get_last_attr_value(false); if (att_val.quality != Tango::ATTR_INVALID) { if (type == Tango::DEV_ENCODED) { delete back; back = NULL; TangoSys_OMemStream o; o << "Data type for attribute " << real_names[i] << " is DEV_ENCODED."; o << " It's not possible to retrieve this data type through the interface you are using (IDL V2)" << ends; Except::throw_exception((const char *)API_NotSupportedFeature, o.str(), (const char *)"Device_2Impl::read_attributes"); } Polled_2_Live(type,att_val.value,(*back)[i].value); (*back)[i].quality= att_val.quality; (*back)[i].time = att_val.time; (*back)[i].dim_x = att_val.dim_x; (*back)[i].dim_y = att_val.dim_y; (*back)[i].name = CORBA::string_dup(att_val.name); } } } } catch (Tango::DevFailed &) { delete back; att_in_fault = true; throw; } } } catch (Tango::DevFailed &) { // // Re-throw exception if the source parameter is CACHE or if the source param. // is CACHE_DEV but one of the attribute is really in fault (not the polling) // if (source == Tango::CACHE) throw; if (att_in_fault == true) throw; polling_failed = true; } } // // If the source parameter is CACHE, returned data, else called method reading // attribute from device // if ((source == Tango::CACHE_DEV) && (polling_failed == true)) { delete back; AutoTangoMonitor sync(this,true); ext->store_in_bb = false; //return read_attributes(names); back = read_attributes(names); } else { cout4 << "Device_2Impl: Returning attribute(s) value from polling buffer" << endl; //return back; } } catch (...) { // set back the device attribution for the thread // and rethrow the exception. sub.set_associated_device(last_associated_device); throw; } // set back the device attribution for the thread sub.set_associated_device(last_associated_device); return back; } //+------------------------------------------------------------------------- // // method : Device_2Impl::command_list_query // // description : CORBA operation to read the device command list. // This method returns command info in a sequence of // DevCmdInfo_2 // // WARNING !!!!!!!!!!!!!!!!!! // // This is the release 2 of this CORBA operation which // returns one more parameter than in release 1 // The code has been duplicated in order to keep it clean // (avoid many "if" on version number in a common method) // //-------------------------------------------------------------------------- Tango::DevCmdInfoList_2 *Device_2Impl::command_list_query_2() { cout4 << "Device_2Impl::command_list_query_2 arrived" << endl; // // Retrieve number of command and allocate memory to send back info // long nb_cmd = device_class->get_command_list().size(); cout4 << nb_cmd << " command(s) for device" << endl; Tango::DevCmdInfoList_2 *back = NULL; try { back = new Tango::DevCmdInfoList_2(nb_cmd); back->length(nb_cmd); // // Populate the vector // for (long i = 0;i < nb_cmd;i++) { Tango::DevCmdInfo_2 tmp; tmp.cmd_name = CORBA::string_dup(((device_class->get_command_list())[i]->get_name()).c_str()); tmp.cmd_tag = 0; tmp.level = (device_class->get_command_list())[i]->get_disp_level(); tmp.in_type = (long)((device_class->get_command_list())[i]->get_in_type()); tmp.out_type = (long)((device_class->get_command_list())[i]->get_out_type()); string &str_in = (device_class->get_command_list())[i]->get_in_type_desc(); if (str_in.size() != 0) tmp.in_type_desc = CORBA::string_dup(str_in.c_str()); else tmp.in_type_desc = CORBA::string_dup(NotSet); string &str_out = (device_class->get_command_list())[i]->get_out_type_desc(); if (str_out.size() != 0) tmp.out_type_desc = CORBA::string_dup(str_out.c_str()); else tmp.out_type_desc = CORBA::string_dup(NotSet); (*back)[i] = tmp; } } catch (bad_alloc) { Except::throw_exception((const char *)API_MemoryAllocation, (const char *)"Can't allocate memory in server", (const char *)"Device_2Impl::command_list_query_2"); } // // Record operation request in black box // blackbox_ptr->insert_op(Op_Command_list_2); // // Return to caller // cout4 << "Leaving Device_2Impl::command_list_query_2" << endl; return back; } //+------------------------------------------------------------------------- // // method : Device_2Impl::command_query_2 // // description : CORBA operation to read a device command info. // This method returns command info for a specific // command. // // WARNING !!!!!!!!!!!!!!!!!! // // This is the release 2 of this CORBA operation which // returns one more parameter than in release 1 // The code has been duplicated in order to keep it clean // (avoid many "if" on version number in a common method) // //-------------------------------------------------------------------------- Tango::DevCmdInfo_2 *Device_2Impl::command_query_2(const char *command) { cout4 << "DeviceImpl::command_query_2 arrived" << endl; Tango::DevCmdInfo_2 *back = NULL; string cmd(command); transform(cmd.begin(),cmd.end(),cmd.begin(),::tolower); // // Allocate memory for the stucture sent back to caller. The ORB will free it // try { back = new Tango::DevCmdInfo_2(); } catch (bad_alloc) { Except::throw_exception((const char *)API_MemoryAllocation, (const char *)"Can't allocate memory in server", (const char *)"Device_2Impl::command_query_2"); } // // Try to retrieve the command in the command list // long i; long nb_cmd = device_class->get_command_list().size(); for (i = 0;i < nb_cmd;i++) { if (device_class->get_command_list()[i]->get_lower_name() == cmd) { back->cmd_name = CORBA::string_dup(((device_class->get_command_list())[i]->get_name()).c_str()); back->cmd_tag = 0; back->level = (device_class->get_command_list())[i]->get_disp_level(); back->in_type = (long)((device_class->get_command_list())[i]->get_in_type()); back->out_type = (long)((device_class->get_command_list())[i]->get_out_type()); string &str_in = (device_class->get_command_list())[i]->get_in_type_desc(); if (str_in.size() != 0) back->in_type_desc = CORBA::string_dup(str_in.c_str()); else back->in_type_desc = CORBA::string_dup(NotSet); string &str_out = (device_class->get_command_list())[i]->get_out_type_desc(); if (str_out.size() != 0) back->out_type_desc = CORBA::string_dup(str_out.c_str()); else back->out_type_desc = CORBA::string_dup(NotSet); break; } } if (i == nb_cmd) { delete back; cout3 << "Device_2Impl::command_query_2(): operation " << command << " not found" << endl; // // throw an exception to client // TangoSys_OMemStream o; o << "Command " << command << " not found" << ends; Except::throw_exception((const char *)API_CommandNotFound, o.str(), (const char *)"Device_2Impl::command_query_2"); } // // Record operation request in black box // blackbox_ptr->insert_op(Op_Command_2); // // Return to caller // cout4 << "Leaving Device_2Impl::command_query_2" << endl; return back; } //+------------------------------------------------------------------------- // // method : Device_2Impl::get_attribute_config_2 // // description : CORBA operation to get attribute configuration. // // argument: in : - names: name of attribute(s) // // This method returns a pointer to a AttributeConfigList_2 with one // AttributeConfig_2 structure for each atribute // // // WARNING !!!!!!!!!!!!!!!!!! // // This is the release 2 of this CORBA operation which // returns one more parameter than in release 1 // The code has been duplicated in order to keep it clean // (avoid many "if" on version number in a common method) // //-------------------------------------------------------------------------- Tango::AttributeConfigList_2 *Device_2Impl::get_attribute_config_2(const Tango::DevVarStringArray& names) throw(Tango::DevFailed, CORBA::SystemException) { TangoMonitor &mon = get_att_conf_monitor(); AutoTangoMonitor sync(&mon); cout4 << "Device_2Impl::get_attribute_config_2 arrived" << endl; long nb_attr = names.length(); Tango::AttributeConfigList_2 *back = NULL; bool all_attr = false; // // Record operation request in black box // blackbox_ptr->insert_op(Op_Get_Attr_Config_2); // // Get attribute number and device version // long nb_dev_attr = dev_attr->get_attr_nb(); long vers = get_dev_idl_version(); // // Check if the caller want to get config for all attribute // If the device implements IDL 3 (State and status as attributes) // and the client is an old one (not able to read state/status as // attribute), decrement attribute number // string in_name(names[0]); if (nb_attr == 1) { if (in_name == AllAttr) { all_attr = true; if (vers < 3) nb_attr = nb_dev_attr; else nb_attr = nb_dev_attr - 2; } else if (in_name == AllAttr_3) { all_attr = true; nb_attr = nb_dev_attr; } } // // Allocate memory for the AttributeConfig structures // try { back = new Tango::AttributeConfigList_2(nb_attr); back->length(nb_attr); } catch (bad_alloc) { Except::throw_exception((const char *)API_MemoryAllocation, (const char *)"Can't allocate memory in server", (const char *)"Device_2Impl::get_attribute_config_2"); } // // Fill in these structures // for (long i = 0;i < nb_attr;i++) { try { if (all_attr == true) { Attribute &attr = dev_attr->get_attr_by_ind(i); attr.get_properties_2((*back)[i]); } else { Attribute &attr = dev_attr->get_attr_by_name(names[i]); attr.get_properties_2((*back)[i]); } } catch (Tango::DevFailed &) { delete back; throw; } } // // Return to caller // cout4 << "Leaving Device_2Impl::get_attribute_config_2" << endl; return back; } //+------------------------------------------------------------------------- // // method : Device_2Impl::command_inout_history_2 // // description : CORBA operation to read command result history from // the polling buffer. // // argument: in : - command : command name // - n : history depth (in record number) // // This method returns a pointer to a DevCmdHistoryList with one // DevCmdHistory structure for each command record // //-------------------------------------------------------------------------- Tango::DevCmdHistoryList *Device_2Impl::command_inout_history_2(const char* command, CORBA::Long n) throw(Tango::DevFailed, CORBA::SystemException) { TangoMonitor &mon = get_poll_monitor(); AutoTangoMonitor sync(&mon); cout4 << "Device_2Impl::command_inout_history_2 arrived" << endl; Tango::DevCmdHistoryList *back = NULL; string cmd_str(command); // // Record operation request in black box // blackbox_ptr->insert_op(Op_Command_inout_history_2); // // Check that device supports this command. Also checks if the device // implements IDL 3 (Tango V5) and state or status history is requested // transform(cmd_str.begin(),cmd_str.end(),cmd_str.begin(),::tolower); check_command_exists(cmd_str); bool status_cmd = false; bool state_cmd = false; long vers = get_dev_idl_version(); if (vers >= 3) { if (cmd_str == "state") state_cmd = true; else if (cmd_str == "status") status_cmd = true; } // // Check that the command is polled // PollObj *polled_cmd = NULL; vector &poll_list = get_poll_obj_list(); unsigned long i; for (i = 0;i < poll_list.size();i++) { if (poll_list[i]->get_name() == cmd_str) { if ((state_cmd == true) || (status_cmd == true)) { if (poll_list[i]->get_type() == Tango::POLL_ATTR) { polled_cmd = poll_list[i]; } } else { if (poll_list[i]->get_type() == Tango::POLL_CMD) { polled_cmd = poll_list[i]; } } } } if (polled_cmd == NULL) { TangoSys_OMemStream o; o << "Command " << cmd_str << " not polled" << ends; Except::throw_exception((const char *)API_CmdNotPolled, o.str(), (const char *)"Device_2Impl::command_inout_history_2"); } // // Check that some data is available in cache // if (polled_cmd->is_ring_empty() == true) { TangoSys_OMemStream o; o << "No data available in cache for command " << cmd_str << ends; Except::throw_exception((const char *)API_NoDataYet, o.str(), (const char *)"Device_2Impl::command_inout_history_2"); } // // Set the number of returned records // long in_buf = polled_cmd->get_elt_nb_in_buffer(); if (n > in_buf) n = in_buf; // // Allocate memory for the returned value // try { back = new Tango::DevCmdHistoryList(n); back->length(n); } catch (bad_alloc) { Except::throw_exception((const char *)API_MemoryAllocation, (const char *)"Can't allocate memory in server", (const char *)"Device_2Impl::command_inout_history_2"); } // // Get command result history // Warning : Starting with Tango V5 (IDL 3), state and status are polled // as attributes but could also be retrieved as commands. In this case, // retrieved the history as attributes and transfer this as command // if ((state_cmd == true) || (status_cmd == true)) { Tango::DevAttrHistoryList_3 *back_attr = NULL; try { back_attr = new Tango::DevAttrHistoryList_3(n); back_attr->length(n); } catch (bad_alloc) { Except::throw_exception((const char *)API_MemoryAllocation, (const char *)"Can't allocate memory in server", (const char *)"Device_2Impl::command_inout_history_2"); } if (status_cmd == true) { if (vers >= 4) polled_cmd->get_attr_history_43(n,back_attr,Tango::DEV_STRING); else polled_cmd->get_attr_history(n,back_attr,Tango::DEV_STRING); for (int k = 0;k < n;k++) { (*back)[k].time = (*back_attr)[k].value.time; (*back)[k].cmd_failed = (*back_attr)[k].attr_failed; Tango::DevVarStringArray *dvsa; (*back_attr)[k].value.value >>= dvsa; (*back)[k].value <<= (*dvsa)[0]; (*back)[k].errors = (*back_attr)[k].value.err_list; } } else { if (vers >= 4) polled_cmd->get_attr_history_43(n,back_attr,Tango::DEV_STATE); else polled_cmd->get_attr_history(n,back_attr,Tango::DEV_STATE); for (int k = 0;k < n;k++) { (*back)[k].time = (*back_attr)[k].value.time; (*back)[k].cmd_failed = (*back_attr)[k].attr_failed; (*back)[k].errors = (*back_attr)[k].value.err_list; if ((*back)[k].cmd_failed == false) { Tango::DevState sta; (*back_attr)[k].value.value >>= sta; (*back)[k].value <<= sta; } } } delete back_attr; } else polled_cmd->get_cmd_history(n,back); cout4 << "Leaving Device_2Impl::command_inout_history_2 method" << endl; return back; } //+------------------------------------------------------------------------- // // method : Device_2Impl::read_attribute_history_2 // // description : CORBA operation to read attribute alue history from // the polling buffer. // // argument: in : - name : attribute name // - n : history depth (in record number) // // This method returns a pointer to a DevAttrHistoryList with one // DevAttrHistory structure for each attribute record // //-------------------------------------------------------------------------- Tango::DevAttrHistoryList *Device_2Impl::read_attribute_history_2(const char* name, CORBA::Long n) throw(Tango::DevFailed, CORBA::SystemException) { TangoMonitor &mon = get_poll_monitor(); AutoTangoMonitor sync(&mon); cout4 << "Device_2Impl::read_attribute_history_2 arrived" << endl; // // Record operation request in black box // blackbox_ptr->insert_op(Op_Read_Attr_history_2); long vers = get_dev_idl_version(); Tango::DevAttrHistoryList *back = NULL; Tango::DevAttrHistoryList_3 *back_3 = NULL; vector &poll_list = get_poll_obj_list(); long nb_poll = poll_list.size(); // // Check that the device supports this attribute. This method returns an // exception in case of unsupported attribute // Attribute &att = dev_attr->get_attr_by_name(name); string attr_str(name); transform(attr_str.begin(),attr_str.end(),attr_str.begin(),::tolower); // // Check that the wanted attribute is polled. // long j; PollObj *polled_attr = NULL; for (j = 0;j < nb_poll;j++) { if ((poll_list[j]->get_type() == Tango::POLL_ATTR) && (poll_list[j]->get_name() == attr_str)) { polled_attr = poll_list[j]; break; } } if (polled_attr == NULL) { TangoSys_OMemStream o; o << "Attribute " << attr_str << " not polled" << ends; Except::throw_exception((const char *)API_AttrNotPolled, o.str(), (const char *)"Device_2Impl::read_attribute_history_2"); } // // Check that some data is available in cache // if (polled_attr->is_ring_empty() == true) { TangoSys_OMemStream o; o << "No data available in cache for attribute " << attr_str << ends; Except::throw_exception((const char *)API_NoDataYet, o.str(), (const char *)"Device_2Impl::read_attribute_history_2"); } // // Set the number of returned records // long in_buf = polled_attr->get_elt_nb_in_buffer(); if (n > in_buf) n = in_buf; // // Allocate memory for the returned value // try { back = new Tango::DevAttrHistoryList(n); back->length(n); if (vers >= 3) { back_3 = new Tango::DevAttrHistoryList_3(n); back_3->length(n); } } catch (bad_alloc) { Except::throw_exception((const char *)API_MemoryAllocation, (const char *)"Can't allocate memory in server", (const char *)"Device_2Impl::read_attribute_history_2"); } // // Get attribute value history // if (vers < 3) polled_attr->get_attr_history(n,back,att.get_data_type()); else { polled_attr->get_attr_history(n,back_3,att.get_data_type()); Hist_32Hist(back_3,back); delete back_3; } cout4 << "Leaving Device_2Impl::command_inout_history_2 method" << endl; return back; } //+------------------------------------------------------------------------- // // method : Device_2Impl::attr2cmd // // description : Method to transfer attribute value into the same // kind of data used to transprt command result on // the network (A CORBA Any) // // Args (in) : att_val : A reference to the complete attribute // value // state : Boolean set to true if this method is called // for the state command // status : Boolean set to true if this method is called // for the status command // //-------------------------------------------------------------------------- CORBA::Any *Device_2Impl::attr2cmd(AttributeValue_3 &att_val,bool state,bool status) { CORBA::Any *any = new CORBA::Any(); if (state == true) { Tango::DevState sta; att_val.value >>= sta; (*any) <<= sta; } else if (status == true) { Tango::DevVarStringArray *dvsa; att_val.value >>= dvsa; (*any) <<= (*dvsa)[0]; } return any; } CORBA::Any *Device_2Impl::attr2cmd(AttributeValue_4 &att_val,bool state,bool status) { CORBA::Any *any = new CORBA::Any(); if (state == true) { const Tango::DevState &sta = att_val.value.dev_state_att(); (*any) <<= sta; } else if (status == true) { Tango::DevVarStringArray &dvsa = att_val.value.string_att_value(); (*any) <<= dvsa[0]; } return any; } //+------------------------------------------------------------------------- // // method : Device_2Impl::Hist_32Hist // // description : Move data from a AttrHistory_3 sequence to an // AttrHistory sequence. Usefull for client linked // with V4 requested history from attribute belonging // to device linked with V5 and inheriting from // Device_3Impl // // Args (in) : back_3 : Pointer to the Attr History 3 sequence // back : Pointer to the Attr History sequence // //-------------------------------------------------------------------------- void Device_2Impl::Hist_32Hist(DevAttrHistoryList_3 *back_3,DevAttrHistoryList *back) { unsigned long nb = back_3->length(); for (unsigned long i = 0;i < nb;i++) { (*back)[i].attr_failed = (*back_3)[i].attr_failed; (*back)[i].value.value = (*back_3)[i].value.value; (*back)[i].value.quality = (*back_3)[i].value.quality; (*back)[i].value.time = (*back_3)[i].value.time; (*back)[i].value.name = (*back_3)[i].value.name; (*back)[i].value.dim_x = (*back_3)[i].value.r_dim.dim_x; (*back)[i].value.dim_y = (*back_3)[i].value.r_dim.dim_y; (*back)[i].errors = (*back_3)[i].value.err_list; } } //+------------------------------------------------------------------------- // // method : Device_2Impl::Polled_2_Live // // description : Move data from a polled V4 device attribute to the Any // used in a V2 or V1 read_attribute request // // Args (in) : data_type : Atrtribute data type // hist_union : Reference to the Union object within the history buffer // live_any : Reference to the Any object returned to the caller // //-------------------------------------------------------------------------- void Device_2Impl::Polled_2_Live(TANGO_UNUSED(long data_type),Tango::AttrValUnion &hist_union,CORBA::Any &live_any) { switch (hist_union._d()) { case ATT_BOOL: { DevVarBooleanArray &union_seq = hist_union.bool_att_value(); live_any <<= union_seq; } break; case ATT_SHORT: { DevVarShortArray &union_seq = hist_union.short_att_value(); live_any <<= union_seq; } break; case ATT_LONG: { DevVarLongArray &union_seq = hist_union.long_att_value(); live_any <<= union_seq; } break; case ATT_LONG64: { DevVarLong64Array &union_seq = hist_union.long64_att_value(); live_any <<= union_seq; } break; case ATT_FLOAT: { DevVarFloatArray &union_seq = hist_union.float_att_value(); live_any <<= union_seq; } break; case ATT_DOUBLE: { DevVarDoubleArray &union_seq = hist_union.double_att_value(); live_any <<= union_seq; } break; case ATT_UCHAR: { DevVarCharArray &union_seq = hist_union.uchar_att_value(); live_any <<= union_seq; } break; case ATT_USHORT: { DevVarUShortArray &union_seq = hist_union.ushort_att_value(); live_any <<= union_seq; } break; case ATT_ULONG: { DevVarULongArray &union_seq = hist_union.ulong_att_value(); live_any <<= union_seq; } break; case ATT_ULONG64: { DevVarULong64Array &union_seq = hist_union.ulong64_att_value(); live_any <<= union_seq; } break; case ATT_STRING: { const DevVarStringArray &union_seq = hist_union.string_att_value(); live_any <<= union_seq; } break; case ATT_STATE: { DevVarStateArray &union_seq = hist_union.state_att_value(); live_any <<= union_seq; } break; case DEVICE_STATE: { DevState union_sta = hist_union.dev_state_att(); live_any <<= union_sta; } break; case ATT_ENCODED: case NO_DATA: break; } } void Device_2Impl::Polled_2_Live(long data_type,CORBA::Any &hist_any,CORBA::Any &live_any) { const Tango::DevVarDoubleArray *tmp_db; Tango::DevVarDoubleArray *new_tmp_db; const Tango::DevVarShortArray *tmp_sh; Tango::DevVarShortArray *new_tmp_sh; const Tango::DevVarLongArray *tmp_lg; Tango::DevVarLongArray *new_tmp_lg; const Tango::DevVarLong64Array *tmp_lg64; Tango::DevVarLong64Array *new_tmp_lg64; const Tango::DevVarStringArray *tmp_str; Tango::DevVarStringArray *new_tmp_str; const Tango::DevVarFloatArray *tmp_fl; Tango::DevVarFloatArray *new_tmp_fl; const Tango::DevVarBooleanArray *tmp_boo; Tango::DevVarBooleanArray *new_tmp_boo; const Tango::DevVarUShortArray *tmp_ush; Tango::DevVarUShortArray *new_tmp_ush; const Tango::DevVarCharArray *tmp_uch; Tango::DevVarCharArray *new_tmp_uch; const Tango::DevVarULongArray *tmp_ulg; Tango::DevVarULongArray *new_tmp_ulg; const Tango::DevVarULong64Array *tmp_ulg64; Tango::DevVarULong64Array *new_tmp_ulg64; const Tango::DevVarStateArray *tmp_state; Tango::DevVarStateArray *new_tmp_state; switch (data_type) { case Tango::DEV_SHORT : hist_any >>= tmp_sh; new_tmp_sh = new DevVarShortArray( tmp_sh->length(), tmp_sh->length(), const_cast(tmp_sh->get_buffer()), false); live_any <<= new_tmp_sh; break; case Tango::DEV_DOUBLE : hist_any >>= tmp_db; new_tmp_db = new DevVarDoubleArray( tmp_db->length(), tmp_db->length(), const_cast(tmp_db->get_buffer()), false); live_any <<= new_tmp_db; break; case Tango::DEV_LONG : hist_any >>= tmp_lg; new_tmp_lg = new DevVarLongArray(tmp_lg->length(),tmp_lg->length(), const_cast(tmp_lg->get_buffer()),false); live_any <<= new_tmp_lg; break; case Tango::DEV_LONG64 : hist_any >>= tmp_lg64; new_tmp_lg64 = new DevVarLong64Array(tmp_lg64->length(),tmp_lg64->length(), const_cast(tmp_lg64->get_buffer()),false); live_any <<= new_tmp_lg64; break; case Tango::DEV_STRING : hist_any >>= tmp_str; new_tmp_str = new DevVarStringArray( tmp_str->length(), tmp_str->length(), const_cast(tmp_str->get_buffer()), false); live_any <<= new_tmp_str; break; case Tango::DEV_FLOAT : hist_any >>= tmp_fl; new_tmp_fl = new DevVarFloatArray( tmp_fl->length(), tmp_fl->length(), const_cast(tmp_fl->get_buffer()), false); live_any <<= new_tmp_fl; break; case Tango::DEV_BOOLEAN : hist_any >>= tmp_boo; new_tmp_boo = new DevVarBooleanArray( tmp_boo->length(), tmp_boo->length(), const_cast(tmp_boo->get_buffer()), false); live_any <<= new_tmp_boo; break; case Tango::DEV_USHORT : hist_any >>= tmp_ush; new_tmp_ush = new DevVarUShortArray( tmp_ush->length(), tmp_ush->length(), const_cast(tmp_ush->get_buffer()), false); live_any <<= new_tmp_ush; break; case Tango::DEV_UCHAR : hist_any >>= tmp_uch; new_tmp_uch = new DevVarCharArray( tmp_uch->length(), tmp_uch->length(), const_cast(tmp_uch->get_buffer()), false); live_any <<= new_tmp_uch; break; case Tango::DEV_ULONG : hist_any >>= tmp_ulg; new_tmp_ulg = new DevVarULongArray(tmp_ulg->length(),tmp_ulg->length(), const_cast(tmp_ulg->get_buffer()),false); live_any <<= new_tmp_ulg; break; case Tango::DEV_ULONG64 : hist_any >>= tmp_ulg64; new_tmp_ulg64 = new DevVarULong64Array(tmp_ulg64->length(),tmp_ulg64->length(), const_cast(tmp_ulg64->get_buffer()),false); live_any <<= new_tmp_ulg64; break; case Tango::DEV_STATE : hist_any >>= tmp_state; new_tmp_state = new DevVarStateArray(tmp_state->length(),tmp_state->length(), const_cast(tmp_state->get_buffer()),false); live_any <<= new_tmp_state; break; } } } // End of Tango namespace tango-8.1.2c+dfsg.orig/lib/cpp/server/class_factory.cpp0000644000175000017500000001253712205375142022002 0ustar piccapiccastatic const char *RcsId = "$Id: class_factory.cpp 22213 2013-03-07 14:32:56Z taurel $\n$Name$"; //+=========================================================================== // // file : class_factory.cpp // // description : C++ source file for a dummy DServer::class_factory() // method. For server, this method is redefined by the // DS programmer in its own file and the linker will not // use this file. For client where ther is no // class_factory() method, this one will be used by the // linker // This works only if class_factory() is in its own file // // project : TANGO // // author(s) : A.Gotz + E.Taurel // // Copyright (C) : 2004,2005,2006,2007,2008,2009,2010,2011,2012,2013 // European Synchrotron Radiation Facility // BP 220, Grenoble 38043 // FRANCE // // This file is part of Tango. // // Tango 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. // // Tango 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 Tango. If not, see . // // $Revision: 22213 $ // //-=========================================================================== #if HAVE_CONFIG_H #include #endif #include namespace Tango { // // There is a trick to build Windows DLL and to use it in a server. // To build a DLL, you have to pass your code into the linker. The linker // try to resolve all symbols. Therefore, it resolves the DServer::class_factory // with this default class_factory. For a server, it's annoying because we // want the user DServer::class_factory to be called !! // For all other kinds of lib (Unix type or Windows static), the linker is used // only when the application is built and symbols are resolved first from the // supplied object files and only if not found in object files with symbols // defined in libraries. // Therefore, the trick for DLL, is inside the default DServer::class_factory // to force calling the user DServer::class_factory // To do this, we use the GetProcAddress and we defines in dserver.h file // the class_factory has "export". // There is another trick to cast the pointer returned by GetProcAddress // which is a pointer to function into a pointer to method. // This is done using an union and initializing the pointeur to method // with a local method and then modifying it // #ifdef _TG_WINDOWS_ typedef void (DServer::*PTR)(void); typedef union _convertor { PTR d; FARPROC s; }convertor; #endif #ifdef __darwin__ #include typedef void (DServer::*PTR)(void); typedef union _convertor { PTR d; void *s; }convertor; #endif void DServer::class_factory() { #ifdef _TG_WINDOWS_ Tango::Util *tg = Tango::Util::instance(); string exe_name = tg->get_ds_exec_name(); exe_name = exe_name + ".exe"; HMODULE mod; FARPROC proc; convertor conv; PTR tmp; if (tg->is_py_ds() == false) { if ((mod = GetModuleHandle(exe_name.c_str())) == NULL) { cerr << "Oups, no class defined in this server. Exiting ..." << endl; exit(-1); } } else { if ((mod = GetModuleHandle(TANGO_PY_MOD_NAME)) == NULL) { cerr << "Oups, no class defined in this server. Exiting ..." << endl; exit(-1); } } // // Use the mangled name to find the user DServer::class_factory method // // Due to the fact that on Windows 64 bits we have both _WIN32 and _WIN64 // defined, start by testing _WIN64 (See tango_config.h) // #ifdef _WIN64 if ((proc = GetProcAddress(mod,"?class_factory@DServer@Tango@@AEAAXXZ")) == NULL) #elif _WIN32 /* WIN32 */ if ((proc = GetProcAddress(mod,"?class_factory@DServer@Tango@@AAEXXZ")) == NULL) #endif { cerr << "Oups, no class defined in this server. Exiting ..." << endl; exit(-1); } else { conv.d = &DServer::stop_polling; conv.s = proc; tmp = conv.d; (this->*tmp)(); } #elif __darwin__ Tango::Util *tg = Tango::Util::instance(); string exe_name = tg->get_ds_exec_name(); exe_name = exe_name; void *mod; void *proc; convertor conv; PTR tmp; if (tg->is_py_ds() == false) { if ((mod = dlopen (exe_name.c_str(), RTLD_LAZY )) == NULL) { cerr << "Oups, no class defined in this server. Exiting ..." << endl; exit(-1); } } else { /* if ((mod = GetModuleHandle(TANGO_PY_MOD_NAME)) == NULL) { cerr << "Oups, no class defined in this server. Exiting ..." << endl; exit(-1); } */ } // // Use the mangled name to find the user DServer::class_factory method // // Due to the fact that on Windows 64 bits we have both WIN32 and WIN64 // defined, start by testing WIN64 (See tango_config.h) // if ((proc = dlsym (mod,"_ZN5Tango7DServer13class_factoryEv")) == NULL) { cerr << "error : " << dlerror() << endl; cerr << "Oups, no class defined in this server. Exiting ..." << endl; exit(-1); } else { conv.d = &DServer::stop_polling; conv.s = proc; tmp = conv.d; (this->*tmp)(); } #else cerr << "Oups, no class defined in this server. Exiting ..." << endl; exit(-1); #endif } } // End of Tango namespace tango-8.1.2c+dfsg.orig/lib/cpp/server/utils_polling.cpp0000644000175000017500000013712712205375142022035 0ustar piccapiccastatic const char *RcsId = "$Id: utils_polling.cpp 22618 2013-05-05 15:12:30Z taurel $"; //+============================================================================= // // file : utils_polling.cpp // // description : C++ source for all the methods of the Util class related // to polling // // project : TANGO // // author(s) : E.Taurel // // Copyright (C) : 2004,2005,2006,2007,2008,2009,2010,2011,2012,2013 // European Synchrotron Radiation Facility // BP 220, Grenoble 38043 // FRANCE // // This file is part of Tango. // // Tango 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. // // Tango 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 Tango. If not, see . // // $Revision: 22618 $ // //-============================================================================= #if HAVE_CONFIG_H #include #endif #include #include #include namespace Tango { //+---------------------------------------------------------------------------- // // method : Util::polling_configure() // // description : This method sends command to the polling thread for // all cmd/attr with polling configuration stored in db. // This is done in separate thread in order to equally // spread all the polled objects polling time on the // smallest polling period. // //----------------------------------------------------------------------------- void Util::polling_configure() { cout4 << "Entering polling_configure()" << endl; // // Get the polling threads pool conf from the DServer device // DServer *admin_dev = get_dserver_device(); set_polling_threads_pool_size(admin_dev->get_poll_th_pool_size()); ext->poll_pool_conf = admin_dev->get_poll_th_conf(); // // Check the coherency of the polling thread pool configuration // check_pool_conf(admin_dev,ext->poll_pool_size); // // Send a stop polling command to thread in order not to poll devices // admin_dev->stop_polling(); vector &tmp_cl_list = admin_dev->get_class_list(); unsigned long i,j,k; int upd; TangoSys_MemStream s; // // Create the structure used to send data to the polling thread // and store them in a vector // vector v_poll_cmd; vector dev_db_upd; // // A loop on each class and each device in class // int smallest_upd = 0; bool first_loop = true; for (i = 0;i < tmp_cl_list.size();i++) { vector &dev_list = tmp_cl_list[i]->get_device_list(); for (j = 0;j < dev_list.size();j++) { v_poll_cmd.clear(); vector &poll_cmd_list = dev_list[j]->get_polled_cmd(); vector &poll_attr_list = dev_list[j]->get_polled_attr(); // // Check that cmd_list and attr_list have a correct syntax // if ((poll_cmd_list.size() % 2) == 1) { TangoSys_OMemStream o; o << "System property polled_cmd for device " << dev_list[j]->get_name() << " has wrong syntax" << ends; Except::throw_exception((const char *)API_BadConfigurationProperty, o.str(), (const char *)"Util::polling_configure"); } if ((poll_attr_list.size() % 2) == 1) { TangoSys_OMemStream o; o << "System property polled_attr for device " << dev_list[j]->get_name() << " has wrong syntax" << ends; Except::throw_exception((const char *)API_BadConfigurationProperty, o.str(), (const char *)"Util::polling_configure"); } // // Check the device polling definition (existing polled cmd/attr ?) // If the polling needs to be modified, memorize the index in class and // device loop to re-find it later. // int ret; if ((ret = check_dev_poll(poll_cmd_list,poll_attr_list,dev_list[j])) != 0) { DevDbUpd tmp; tmp.class_ind = i; tmp.dev_ind = j; tmp.mod_prop = ret; dev_db_upd.push_back(tmp); } // // A loop on each command // for (k = 0;k < poll_cmd_list.size();k++) { DevVarLongStringArray *send = new DevVarLongStringArray(); send->lvalue.length(1); send->svalue.length(3); send->svalue[0] = CORBA::string_dup(dev_list[j]->get_name().c_str()); send->svalue[1] = CORBA::string_dup("command"); send->svalue[2] = CORBA::string_dup(poll_cmd_list[k].c_str()); // // Convert polling period to a number and store polling thread command params // s << poll_cmd_list[k + 1]; s >> upd; s.clear(); s.str(""); send->lvalue[0] = upd; if (upd < 0) upd = -upd; if (first_loop == true) { smallest_upd = upd; first_loop = false; } else { if (upd < smallest_upd) smallest_upd = upd; } v_poll_cmd.push_back(send); k++; } // // A loop on each attribute // for (k = 0;k < poll_attr_list.size();k++) { DevVarLongStringArray *send = new DevVarLongStringArray(); send->lvalue.length(1); send->svalue.length(3); send->svalue[0] = CORBA::string_dup(dev_list[j]->get_name().c_str()); send->svalue[1] = CORBA::string_dup("attribute"); send->svalue[2] = CORBA::string_dup(poll_attr_list[k].c_str()); // // Convert polling period to a number and store polling thread command params // s << poll_attr_list[k + 1]; s >> upd; s.clear(); s.str(""); send->lvalue[0] = upd; if (upd < 0) upd = -upd; if (first_loop == true) { smallest_upd = upd; first_loop = false; } else { if (upd < smallest_upd) smallest_upd = upd; } v_poll_cmd.push_back(send); k++; } // // Make sure we have a thread in the pool to poll this device // unsigned long nb_cmd = v_poll_cmd.size(); if (nb_cmd != 0) { create_poll_thread(v_poll_cmd[0]->svalue[0],true,smallest_upd); first_loop = true; // // Copy the list of commands to send to the threads in its structure // PollingThreadInfo *th_info = get_polling_thread_info_by_id(get_polling_thread_id_by_name(v_poll_cmd[0]->svalue[0])); for (unsigned long loop = 0;loop < nb_cmd;++loop) th_info->v_poll_cmd.push_back(v_poll_cmd[loop]); } } } // // Send command to polling thread one by one for each threads // In the following computation , I try to take into account the // non real time aspect of our OS. I remove 15 mS from each // sleeping time due to thread wake-up time // unsigned long nb_thread = ext->poll_ths.size(); cout4 << "POLLING: " << nb_thread << " thread(s) needed for polling from a pool of " << get_polling_threads_pool_size() << endl; for (unsigned long loop = 0;loop < nb_thread;++loop) { unsigned long nb_cmd = ext->poll_ths[loop]->v_poll_cmd.size(); int sleeping_time = ext->poll_ths[loop]->smallest_upd / nb_cmd; int delta_time = 0; long delta_os = 5; if (delta_os < sleeping_time) sleeping_time = sleeping_time - delta_os; cout4 << "PollConfigureThread: smallest_upd = " << ext->poll_ths[loop]->smallest_upd; cout4 << ", delta_time = " << sleeping_time; cout4 << ", nb_poll_objects = " << nb_cmd << endl; for (unsigned long cmd_loop = 0;cmd_loop < nb_cmd;++cmd_loop) { try { bool upd_db = false; int upd = ext->poll_ths[loop]->v_poll_cmd[cmd_loop]->lvalue[0]; if (upd < 0) { ext->poll_ths[loop]->v_poll_cmd[cmd_loop]->lvalue[0] = -upd; upd_db = true; } admin_dev->add_obj_polling(ext->poll_ths[loop]->v_poll_cmd[cmd_loop],upd_db,delta_time); } catch (Tango::DevFailed &e) { bool throw_ex = true; if (::strcmp(e.errors[0].reason.in(),API_AlreadyPolled) == 0) { try { admin_dev->upd_obj_polling_period(ext->poll_ths[loop]->v_poll_cmd[cmd_loop],false); throw_ex = false; } catch (Tango::DevFailed &) {} } if (throw_ex == true) { TangoSys_OMemStream o; o << "Error when configuring polling for device " << ext->poll_ths[loop]->v_poll_cmd[cmd_loop]->svalue[0].in(); if (::strcmp(ext->poll_ths[loop]->v_poll_cmd[cmd_loop]->svalue[1].in(),"command") == 0) o << ", cmd = "; else o << ", attr = "; o << ext->poll_ths[loop]->v_poll_cmd[cmd_loop]->svalue[2].in() << ends; Except::re_throw_exception(e,(const char *)API_BadConfigurationProperty, o.str(), (const char *)"Util::polling_configure"); } } if (nb_cmd > 1) { delta_time = delta_time + sleeping_time; } } // // Delete allocated memory // for (unsigned long l = 0;l < nb_cmd;l++) delete ext->poll_ths[loop]->v_poll_cmd[l]; } // // Now, start the real polling // admin_dev->start_polling(); // // If some polling related prop. (polling conf or dev conf) has to be // updated in db, do it now // Add a check to verify that it is possible to store polling pool // conf in database. Property length cannot be longer than 256 characters // if (ext->poll_pool_conf.empty() == true) { build_first_pool_conf(ext->poll_pool_conf); ext->conf_needs_db_upd = true; } else { vector tmp_pool_conf; build_first_pool_conf(tmp_pool_conf); if (tmp_pool_conf != ext->poll_pool_conf) { ext->poll_pool_conf = tmp_pool_conf; ext->conf_needs_db_upd = true; } } if (((dev_db_upd.empty() == false) || (ext->conf_needs_db_upd == true)) && (_UseDb == true)) upd_polling_prop(dev_db_upd,admin_dev); cout4 << "Leaving polling_configure()" << endl; } //+---------------------------------------------------------------------------- // // method : Util::trigger_attr_polling() // // description : Trigger the polling thread for polled attributes // registered with a polling update period set as // "externally triggered" (0 mS) // //----------------------------------------------------------------------------- void Util::trigger_attr_polling(Tango::DeviceImpl *dev,const string &name) { cout4 << "Sending trigger to polling thread" << endl; // // Check that the device is polled // if (dev->is_polled() == false) { TangoSys_OMemStream o; o << "Device " << dev->get_name() << " is not polled" << ends; Except::throw_exception((const char *)API_DeviceNotPolled,o.str(), (const char *)"Util::trigger_attr_polling"); } // // Find the wanted object in the list of device polled object // string obj_name(name); transform(obj_name.begin(),obj_name.end(),obj_name.begin(),::tolower); vector::iterator ite = dev->get_polled_obj_by_type_name(Tango::POLL_ATTR,obj_name); // // Check that it is an externally triggered polling object. If it is not the // case, throw exception // long tmp_upd = (*ite)->get_upd(); if (tmp_upd != 0) { TangoSys_OMemStream o; o << "Polling for attribute "; o << name; o << " (device " << dev->get_name() << ") "; o << " is not externally triggered."; o << ends; Except::throw_exception((const char *)API_NotSupported,o.str(), (const char *)"Util::trigger_attr_polling"); } // // Find out which thread is in charge of the device. // PollingThreadInfo *th_info; int poll_th_id = get_polling_thread_id_by_name(dev->get_name_lower().c_str()); if (poll_th_id == 0) { TangoSys_OMemStream o; o << "Can't find a polling thread for device " << dev->get_name() << ends; Except::throw_exception((const char *)API_NotSupported,o.str(), (const char *)"Util::trigger_cmd_polling"); } th_info = get_polling_thread_info_by_id(poll_th_id); // // Send command to the polling thread but wait in case of previous cmd // still not executed // TangoMonitor &mon = th_info->poll_mon; PollThCmd &shared_cmd = th_info->shared_data; { omni_mutex_lock sync(mon); if (shared_cmd.trigger == true) { mon.wait(); } shared_cmd.trigger = true; shared_cmd.dev = dev; shared_cmd.name = obj_name; shared_cmd.type = Tango::POLL_ATTR; mon.signal(); cout4 << "Trigger sent to polling thread" << endl; // // Wait for thread to execute command // TangoMonitor &dev_mon = dev->get_dev_monitor(); omni_thread *th = omni_thread::self(); while (shared_cmd.trigger == true) { // // Warning: It's possible to have a deadlock here (experienced under // Windows) in case of this method being called from a command (or attribute // methods) which are rapidly sent by the client. // Client request cmd1 which send trigger to the polling thread // The polling thread wake up clear shared_cmd.trigger and try to // execute the command. But cmd 1 thread still owns the device monitor and // polling thread wait. cmd 1 finished and client immediately send the // command a new time. On Windows, it may happens that the polling // thread is not activated just after the cmd thread has released the // device monitor. As the client sent a new command, the device monitor // is immediately re-taken by the thread executing the new command sent by // the client. An order is sent to the polling thread and the cmd // thread reach this code. It will wait for polling thread to clear // shared_cmd.trigger. But, the polling thread is already waiting for // the device monitor and ..... deadlock.... // bool deadlock = false; long lock_ctr = 0; if (th->id() == dev_mon.get_locking_thread_id()) { cout4 << "Possible deadlock detected!" << endl; deadlock = true; lock_ctr = dev_mon.get_locking_ctr(); for (long loop = 0;loop < lock_ctr;loop++) dev_mon.rel_monitor(); } int interupted = mon.wait(DEFAULT_TIMEOUT); if (deadlock == true) { for (long loop = 0;loop < lock_ctr;loop++) dev_mon.get_monitor(); } if ((shared_cmd.trigger == true) && (interupted == 0)) { cout4 << "TIME OUT" << endl; Except::throw_exception((const char *)API_CommandTimedOut, (const char *)"Polling thread blocked !!!", (const char *)"Util::trigger_attr_polling"); } } } cout4 << "Thread cmd normally executed" << endl; } //+---------------------------------------------------------------------------- // // method : Util::trigger_cmd_polling() // // description : Trigger the polling thread for polled command // registered with a polling update period set as // "externally triggered" (0 mS) // //----------------------------------------------------------------------------- void Util::trigger_cmd_polling(Tango::DeviceImpl *dev,const string &name) { cout4 << "Sending trigger to polling thread" << endl; // // Check that the device is polled // if (dev->is_polled() == false) { TangoSys_OMemStream o; o << "Device " << dev->get_name() << " is not polled" << ends; Except::throw_exception((const char *)API_DeviceNotPolled,o.str(), (const char *)"Util::trigger_cmd_polling"); } // // Find the wanted object in the list of device polled object // string obj_name(name); transform(obj_name.begin(),obj_name.end(),obj_name.begin(),::tolower); vector::iterator ite = dev->get_polled_obj_by_type_name(Tango::POLL_CMD,obj_name); // // Check that it is an externally triggered polling object. If it is not the // case, throw exception // long tmp_upd = (*ite)->get_upd(); if (tmp_upd != 0) { TangoSys_OMemStream o; o << "Polling for command "; o << name; o << " (device " << dev->get_name() << ") "; o << " is not externally triggered."; o << ends; Except::throw_exception((const char *)API_NotSupported,o.str(), (const char *)"Util::trigger_cmd_polling"); } // // Find out which thread is in charge of the device. // PollingThreadInfo *th_info; int poll_th_id = get_polling_thread_id_by_name(dev->get_name_lower().c_str()); if (poll_th_id == 0) { TangoSys_OMemStream o; o << "Can't find a polling thread for device " << dev->get_name() << ends; Except::throw_exception((const char *)API_NotSupported,o.str(), (const char *)"Util::trigger_cmd_polling"); } th_info = get_polling_thread_info_by_id(poll_th_id); // // Send command to the polling thread but wait in case of previous cmd // still not executed // TangoMonitor &mon = th_info->poll_mon; PollThCmd &shared_cmd = th_info->shared_data; { omni_mutex_lock sync(mon); if (shared_cmd.trigger == true) { mon.wait(); } shared_cmd.trigger = true; shared_cmd.dev = dev; shared_cmd.name = obj_name; shared_cmd.type = Tango::POLL_CMD; mon.signal(); cout4 << "Trigger sent to polling thread" << endl; // // Wait for thread to execute command // TangoMonitor &dev_mon = dev->get_dev_monitor(); omni_thread *th = omni_thread::self(); while (shared_cmd.trigger == true) { // // Warning: It's possible to have a deadlock here (experienced under // Windows) in case of this method being called from a command (or attribute // methods) which are rapidly sent by the client. // Client request cmd1 which send trigger to the polling thread // The polling thread wake up clear shared_cmd.trigger and try to // execute the command. But cmd 1 thread still owns the device monitor and // polling thread wait. cmd 1 finished and client immediately send the // command a new time. On Windows, it may happens that the polling // thread is not activated just after the cmd thread has released the // device monitor. As the client sent a new command, the device monitor // is immediately re-taken by the thread executing the new command sent by // the client. An order is sent to the polling thread and the cmd // thread reach this code. It will wait for polling thread to clear // shared_cmd.trigger. But, the polling thread is already waiting for // the device monitor and ..... deadlock.... // bool deadlock = false; long lock_ctr = 0; if (th->id() == dev_mon.get_locking_thread_id()) { cout4 << "Possible deadlock detected!" << endl; deadlock = true; lock_ctr = dev_mon.get_locking_ctr(); for (long loop = 0;loop < lock_ctr;loop++) dev_mon.rel_monitor(); } int interupted = mon.wait(DEFAULT_TIMEOUT); if (deadlock == true) { for (long loop = 0;loop < lock_ctr;loop++) dev_mon.get_monitor(); } if ((shared_cmd.trigger == true) && (interupted == 0)) { cout4 << "TIME OUT" << endl; Except::throw_exception((const char *)API_CommandTimedOut, (const char *)"Polling thread blocked !!!", (const char *)"Util::trigger_cmd_polling"); } } } cout4 << "Thread cmd normally executed" << endl; } //+---------------------------------------------------------------------------- // // method : Util::clean_attr_polled_prop() // // description : Clean in database the prop used to memorized which attribute // are polled // //----------------------------------------------------------------------------- void Util::clean_attr_polled_prop() { if (Tango::Util::_UseDb == true) { DbData send_data; DbDatum db_info("polled_attr"); for (unsigned int loop = 0;loop < ext->polled_dyn_attr_names.size();loop++) { vector::iterator ite_attr = find(ext->polled_att_list.begin(),ext->polled_att_list.end(), ext->polled_dyn_attr_names[loop]); if (ite_attr != ext->polled_att_list.end()) { ite_attr = ext->polled_att_list.erase(ite_attr); if (ite_attr != ext->polled_att_list.end()) ext->polled_att_list.erase(ite_attr); } else { TangoSys_OMemStream o; o << "Polling properties for attribute " << ext->polled_dyn_attr_names[loop] << " on device " << ext->dyn_att_dev_name; o << " not found device in polled attribute list!" << ends; Except::throw_exception((const char *)API_MethodArgument,o.str(), (const char *)"Util::clean_attr_polling_prop"); } } db_info << ext->polled_att_list; send_data.push_back(db_info); if (db_info.size() == 0) db->delete_device_property(ext->dyn_att_dev_name,send_data); else db->put_device_property(ext->dyn_att_dev_name,send_data); } } //+---------------------------------------------------------------------------- // // method : Util::create_poll_thread() // // description : Create a polling thread for the device specified as parameter // If the thread already exist, do nothing // If the pool is full, associate this device to an already existing // thread // // argin : - dev_name : The device name // - startup : True if this method is called during DS startup. // In such a case, some exception should not be thrown // - smallest_upd : The smallest upd ! // // This method returns -2 if the pool conf. does not need any update // It returns -1 if a new thread has been created // It returns the index in the pool conf of the entry which has to be modified // when the device is associated to an already existing thread // //----------------------------------------------------------------------------- int Util::create_poll_thread(const char *dev_name,bool startup,int smallest_upd) { int ret = -2; string local_dev_name(dev_name); transform(local_dev_name.begin(),local_dev_name.end(),local_dev_name.begin(),::tolower); // // If there is already a polling thread for this device, simply returns // map::iterator ite; ite = ext->dev_poll_th_map.find(local_dev_name); if (ite != ext->dev_poll_th_map.end()) { if (smallest_upd != -1) { PollingThreadInfo *th_info = get_polling_thread_info_by_id(ite->second); if (smallest_upd < th_info->smallest_upd) th_info->smallest_upd = smallest_upd; } return ret; } // // Check if the pool is full // if (ext->poll_ths.size() != ext->poll_pool_size) { // // Get from the pool conf which device(s) have the same thread than this one // vector asso_devs; int ind; ind = get_th_polled_devs(local_dev_name,asso_devs); if (asso_devs.empty() != true) { vector::iterator it; // // If we find a thread for one of the associated device, no need to create a new one // simply add the device entry in the map // for (it = asso_devs.begin();it != asso_devs.end();++it) { if (*it == local_dev_name) continue; if ((ite = ext->dev_poll_th_map.find(*it)) != ext->dev_poll_th_map.end()) { ext->dev_poll_th_map.insert(make_pair(local_dev_name,ite->second)); PollingThreadInfo *th_info = get_polling_thread_info_by_id(ite->second); th_info->polled_devices.push_back(local_dev_name); th_info->nb_polled_objects++; if (smallest_upd != -1) { if (smallest_upd < th_info->smallest_upd) th_info->smallest_upd = smallest_upd; } ret = ind; return ret; } } } // // Create a new polling thread and start it // PollingThreadInfo *pti_ptr = new PollingThreadInfo(); if (smallest_upd != -1) pti_ptr->smallest_upd = smallest_upd; pti_ptr->poll_th = new PollThread(pti_ptr->shared_data,pti_ptr->poll_mon,false); pti_ptr->poll_th->start(); int poll_th_id = pti_ptr->poll_th->id(); pti_ptr->thread_id = poll_th_id; pti_ptr->polled_devices.push_back(local_dev_name); pti_ptr->nb_polled_objects++; ext->poll_ths.push_back(pti_ptr); ext->dev_poll_th_map.insert(make_pair(local_dev_name,poll_th_id)); ret = -1; } else { // // Get from the pool conf which device(s) have the same thread than this one // vector asso_devs; int ind; ind = get_th_polled_devs(local_dev_name,asso_devs); if (asso_devs.empty() != true) { vector::iterator it; // // If we find a thread for one of the associated device, // simply add the device entry in the map // for (it = asso_devs.begin();it != asso_devs.end();++it) { if (*it == local_dev_name) continue; if ((ite = ext->dev_poll_th_map.find(*it)) != ext->dev_poll_th_map.end()) { ext->dev_poll_th_map.insert(make_pair(local_dev_name,ite->second)); if (smallest_upd != -1) { PollingThreadInfo *th_info = get_polling_thread_info_by_id(ite->second); th_info->polled_devices.push_back(local_dev_name); th_info->nb_polled_objects++; if (smallest_upd < th_info->smallest_upd) th_info->smallest_upd = smallest_upd; } ret = ind; return ret; } } } // // Find the thread with the lowest polled object number // vector::iterator iter,lower_iter; int lower_polled_objects = ext->poll_ths[0]->nb_polled_objects; lower_iter = ext->poll_ths.begin(); for (iter = ext->poll_ths.begin();iter != ext->poll_ths.end();++iter) { if ((*iter)->nb_polled_objects <= lower_polled_objects) { lower_polled_objects = (*iter)->nb_polled_objects; lower_iter = iter; } } // // Find a device already assigned to this thread and then get the device entry in // the thread pool // string d_name; for (ite = ext->dev_poll_th_map.begin();ite != ext->dev_poll_th_map.end();++ite) { if (ite->second == (*lower_iter)->thread_id) { d_name = ite->first; break; } } if (ite == ext->dev_poll_th_map.end()) { TangoSys_OMemStream o; o << "The polling threads pool is full.\n"; o << "Device " << dev_name << " should be polled by the thread already polling " << d_name; o << " but this device is not defined in the polled device map!!" << ends; Except::throw_exception((const char *)API_PolledDeviceNotInPoolMap,o.str(), (const char *)"Util::create_poll_thread"); } ind = get_dev_entry_in_pool_conf(d_name); if ((ind == -1) && (startup == false)) { TangoSys_OMemStream o; o << "The polling threads pool is full.\n"; o << "Device " << dev_name << " should be polled by the thread already polling " << d_name; o << " but this device is not defined in the pool configuration!!" << ends; Except::throw_exception((const char *)API_PolledDeviceNotInPoolConf,o.str(), (const char *)"Util::create_poll_thread"); } // // Assign this device to the thread which "seems" to have the less work // (*lower_iter)->polled_devices.push_back(local_dev_name); (*lower_iter)->nb_polled_objects++; ext->dev_poll_th_map.insert(make_pair(local_dev_name,(*lower_iter)->thread_id)); if (smallest_upd != -1) { if (smallest_upd < (*lower_iter)->smallest_upd) (*lower_iter)->smallest_upd = smallest_upd; } ret = ind; } return ret; } //+---------------------------------------------------------------------------- // // method : Util::stop_all_polling_threads() // // description : Stop all polling threads used in the polling thread pool // //----------------------------------------------------------------------------- void Util::stop_all_polling_threads() { vector::iterator iter; for (iter = ext->poll_ths.begin();iter != ext->poll_ths.end();++iter) { TangoMonitor &mon = (*iter)->poll_mon; PollThCmd &shared_cmd = (*iter)->shared_data; { omni_mutex_lock sync(mon); shared_cmd.cmd_pending = true; shared_cmd.cmd_code = POLL_EXIT; mon.signal(); } // // join with the polling thread // void *dummy_ptr; (*iter)->poll_th->join(&dummy_ptr); } for (iter = ext->poll_ths.begin();iter != ext->poll_ths.end();++iter) delete (*iter); ext->poll_ths.clear(); } //+---------------------------------------------------------------------------- // // method : Util::stop_heartbeat_thread() // // description : Stop the heartbeat thread // //----------------------------------------------------------------------------- void Util::stop_heartbeat_thread() { TangoMonitor &mon = ext->poll_mon; PollThCmd &shared_cmd = ext->shared_data; { omni_mutex_lock sync(mon); shared_cmd.cmd_pending = true; shared_cmd.cmd_code = POLL_EXIT; mon.signal(); } // // join with the polling thread // void *dummy_ptr; ext->heartbeat_th->join(&dummy_ptr); } //+---------------------------------------------------------------------------- // // method : Util::get_poll_th_id_by_name() // // description : Get the ID of the thread in charge of the device polling // // argin() : dev_name : The device name // // If there is no thread dedicated to the device, the return value is 0 // //----------------------------------------------------------------------------- int Util::get_polling_thread_id_by_name(const char *dev_name) { int ret = 0; string local_dev_name(dev_name); transform(local_dev_name.begin(),local_dev_name.end(),local_dev_name.begin(),::tolower); map::iterator iter; iter = ext->dev_poll_th_map.find(local_dev_name); if (iter != ext->dev_poll_th_map.end()) ret = iter->second; return ret; } //+---------------------------------------------------------------------------- // // method : Util::get_polling_thread_info_by_id() // // description : Return the PollingThreadInfo for the thread with the ID // specified as the input argument // // argin() : id : The polling thread identifier // // If there is no polling thread with this ID, throws an exception // //----------------------------------------------------------------------------- PollingThreadInfo *Util::get_polling_thread_info_by_id(int th_id) { PollingThreadInfo *ret_ptr = NULL; vector::iterator iter; for (iter = ext->poll_ths.begin();iter != ext->poll_ths.end();++iter) { if ((*iter)->thread_id == th_id) { ret_ptr = (*iter); break; } } if (iter == ext->poll_ths.end()) { TangoSys_OMemStream o; o << "There is no polling thread with ID = " << th_id << " in the polling threads pool"<< ends; Except::throw_exception((const char *)API_PollingThreadNotFound,o.str(), (const char *)"Util::get_polling_thread_info_by_id"); } return ret_ptr; } //+---------------------------------------------------------------------------- // // method : Util::check_poll_conf() // // description : Check the pool configuration coherency. // This means: // - All devices defined in the pool conf has to be created // in the DS // - All objects to be polled has to be coherent // - The pool size must be coherent with the conf // // argin() : - admin_dev : The DS admin device // - pool_size : The pool size (max number of thread) // //----------------------------------------------------------------------------- void Util::check_pool_conf(DServer *admin_dev,unsigned long pool_size) { // // Simply returns if the conf. is empty // if (ext->poll_pool_conf.empty() == true) return; vector mod_conf = ext->poll_pool_conf; // // First, get the list of devices instanciated in this server and check if the polled // devices are defined within the server // Tango::DevVarStringArray *dev_list = admin_dev->query_device(); unsigned int nb_dev = dev_list->length(); unsigned int loop; int stop = 0; vector splitted; vector::iterator iter,iter_entry; for (iter = mod_conf.begin();iter != mod_conf.end();++iter) { split_string(*iter,',',splitted); stop++; string mod_entry; for (iter_entry = splitted.begin(); iter_entry != splitted.end();++iter_entry) { // // Check that this device is not already defined // string::size_type po; if ((po = mod_entry.find(*iter_entry)) != string::npos) continue; else if (is_dev_already_in_pool_conf(*iter_entry,mod_conf,stop - 1) == true) continue; // // Check if the device is instanciated in this server // string entry_lower(*iter_entry); transform(entry_lower.begin(),entry_lower.end(),entry_lower.begin(),::tolower); for (loop = 0;loop < nb_dev;++loop) { string real_dev_name((*dev_list)[loop]); string::size_type pos; pos = real_dev_name.find(':'); pos = pos + 2; real_dev_name = real_dev_name.substr(pos); transform(real_dev_name.begin(),real_dev_name.end(),real_dev_name.begin(),::tolower); if (entry_lower == real_dev_name) break; } // // The device is not defined in the DS, remove it from the conf. // (Do not copy it in the new conf built by this method) // if (loop == nb_dev) { cout << "WARNING: Device " << *iter_entry << " is used in polling threads pool configuration"; cout << " but it is not defined in DS"<< endl; cout << "The pool configuration will be automatically updated" << endl; } else { // // Now, we know that the device exists in the server, but is it really polled ? // DeviceImpl *dev = get_device_by_name(*iter_entry); vector &poll_cmd_list = dev->get_polled_cmd(); vector &poll_attr_list = dev->get_polled_attr(); if ((poll_cmd_list.empty() == true) && (poll_attr_list.empty() == true)) { cout << "WARNING: Device " << *iter_entry << " is used in polling threads pool configuration"; cout << " but it does not have any cmd/attr polled"<< endl; cout << "The pool configuration will be automatically updated" << endl; } else { if (mod_entry.empty() == true) mod_entry = *iter_entry; else mod_entry = mod_entry + ',' + *iter_entry; } } } // // Modify the conf. if some incoherencies have been found // if (mod_entry.empty() == true) { iter = mod_conf.erase(iter); if (iter == mod_conf.end()) break; else { if (iter == mod_conf.begin()) --stop; --iter; } } else if (mod_entry != *iter) *iter = mod_entry; } delete dev_list; // // Now, check that the thread defined by the conf. is <= than the pool size // if (mod_conf.size() > pool_size) { cout << "WARNING: More threads defined in the polling threads pool configuration"; cout << " than in its size ("<< mod_conf.size() << " > " << pool_size << ")" << endl; cout << "The pool configuration will be automatically updated" << endl; // // If we have more threads in the conf than in the pool, distribute the extra thread // devices to the still existing threads // long nb_extra_th = mod_conf.size() - pool_size; for (long i = 0;i < nb_extra_th;i++) { vector polled_dev_th; get_th_polled_devs(i + pool_size,polled_dev_th); unsigned long loop = 0; vector::iterator it; for (it = polled_dev_th.begin();it != polled_dev_th.end();++it) { mod_conf[loop] = mod_conf[loop] + ',' + *it; loop++; if (loop == pool_size) loop = 0; } } vector::iterator it = mod_conf.begin(); it = it + pool_size; mod_conf.erase(it,mod_conf.end()); } // // If necessary, update the conf in db // if (mod_conf != ext->poll_pool_conf) { ext->conf_needs_db_upd = true; ext->poll_pool_conf = mod_conf; } } //+---------------------------------------------------------------------------- // // method : Util::check_dev_poll() // // description : Check if all the cmd/attr to be polled for a device are // really supported by the device // // argin() : - poll_cmd_list : The polled command(s) // - poll_attr_list : The polled attr(s) // - dev : The device pointer // // This method returns 0 if no polling conf has been modified. // Otherwise, it returns -1 if only the command list has been modified, // -2 if the only the attribute list has been modified and -3 if both // of them have been modified //----------------------------------------------------------------------------- int Util::check_dev_poll(vector &poll_cmd_list,vector &poll_attr_list,DeviceImpl *dev) { int ret = 0; // // First, get device commands list // vector &cmd_list = dev->get_device_class()->get_command_list(); // // Check polled cmds // vector::iterator iter; for (iter = poll_cmd_list.begin();iter != poll_cmd_list.end();iter = iter + 2) { string polled_cmd = *iter; transform(polled_cmd.begin(),polled_cmd.end(),polled_cmd.begin(),::tolower); vector::iterator i_cmd; for (i_cmd = cmd_list.begin();i_cmd < cmd_list.end();++i_cmd) { if ((*i_cmd)->get_lower_name() == polled_cmd) break; } if (i_cmd == cmd_list.end()) { cout << "WARNING: Device " << dev->get_name() << " is configured to be polled with"; cout << " a command which does not exist anymore"<< endl; cout << "The device polling configuration will be automatically updated" << endl; ret = -1; iter = poll_cmd_list.erase(iter,iter + 2); if (iter == poll_cmd_list.end()) break; } } // // Now, get device attribute list // vector &att_list = dev->get_device_attr()->get_attribute_list(); // // Check polled attributes // for (iter = poll_attr_list.begin();iter != poll_attr_list.end();iter = iter + 2) { string polled_attr = *iter; transform(polled_attr.begin(),polled_attr.end(),polled_attr.begin(),::tolower); vector::iterator i_attr; for (i_attr = att_list.begin();i_attr < att_list.end();++i_attr) { if ((*i_attr)->get_name_lower() == polled_attr) break; } if (i_attr == att_list.end()) { cout << "WARNING: Device " << dev->get_name() << " is configured to be polled with"; cout << " an attribute which does not exist anymore (" << polled_attr << ")" << endl; cout << "The device polling configuration will be automatically updated" << endl; if (ret == -1) ret = -3; else ret = -2; iter = poll_attr_list.erase(iter,iter + 2); if (iter == poll_attr_list.end()) break; } } return ret; } //+---------------------------------------------------------------------------- // // method : Util::split_string() // // description : Split a string according to a delimiter // // argin() : - the_str : ref to the string to be plitted // - delim : The delimiter character // - plited_str : The splitted string returned in a vector of individual elt // //----------------------------------------------------------------------------- void Util::split_string(string &the_str,char delim,vector &splitted_str) { string::size_type pos,start; splitted_str.clear(); start = 0; while ((pos = the_str.find(delim,start)) != string::npos) { splitted_str.push_back(the_str.substr(start,pos - start)); start = pos + 1; } // // The last element // splitted_str.push_back(the_str.substr(start)); } //+---------------------------------------------------------------------------- // // method : Util::upd_polling_prop() // // description : Update polling related properties in Db // // argin() : - upd_devs : ref to a vector with one elt for each dev with polling // prop. to be updated // - admin_dev : The DS admin device // //----------------------------------------------------------------------------- void Util::upd_polling_prop(vector &upd_devs,DServer *admin_dev) { vector &tmp_cl_list = admin_dev->get_class_list(); unsigned long i; // // A loop on each device with prop. to be updated // for (i = 0;i < upd_devs.size();i++) { vector &dev_list = tmp_cl_list[upd_devs[i].class_ind]->get_device_list(); vector &poll_cmd_list = dev_list[upd_devs[i].dev_ind]->get_polled_cmd(); vector &poll_attr_list = dev_list[upd_devs[i].dev_ind]->get_polled_attr(); DbData del_prop; DbData upd_prop; // // Is it necessary to update or to delete the property? // if ((upd_devs[i].mod_prop == -1) || (upd_devs[i].mod_prop == -3)) { if (poll_cmd_list.empty() == true) del_prop.push_back(DbDatum("polled_cmd")); else { upd_prop.push_back(DbDatum("polled_cmd")); upd_prop[0] << poll_cmd_list; } } if ((upd_devs[i].mod_prop == -2) || (upd_devs[i].mod_prop == -3)) { if (poll_attr_list.empty() == true) del_prop.push_back(DbDatum("polled_attr")); else { upd_prop.push_back(DbDatum("polled_attr")); upd_prop[0] << poll_attr_list; } } // // Update the database // bool retry = true; long db_retries = DB_START_PHASE_RETRIES; while (retry == true) { try { if (del_prop.empty() == false) get_database()->delete_device_property(dev_list[upd_devs[i].dev_ind]->get_name(),del_prop); if (upd_prop.empty() == false) get_database()->put_device_property(dev_list[upd_devs[i].dev_ind]->get_name(),upd_prop); retry = false; } catch (Tango::CommunicationFailed &) { if (is_svr_starting() == true) { db_retries--; if (db_retries == 0) throw; } else throw; } } // // If now the device does not have any objects polled (no cmd, no attr), it must // be removed from the pool conf. // if ((poll_attr_list.empty() == true) && (poll_cmd_list.empty() == true)) { vector::iterator iter; for (iter = ext->poll_pool_conf.begin();iter != ext->poll_pool_conf.end();++iter) { string tmp = *iter; string &d_name = dev_list[upd_devs[i].dev_ind]->get_name(); if (tmp.find(d_name) != string::npos) { string::size_type pos; if ((pos = tmp.find(',')) == string::npos) { iter = ext->poll_pool_conf.erase(iter); } else { tmp.erase(pos,d_name.size()); } ext->conf_needs_db_upd = true; break; } } } } // // Update the polling pool conf if needed // if (ext->conf_needs_db_upd == true) { DbData upd_conf; upd_conf.push_back(DbDatum("polling_threads_pool_conf")); bool retry = true; long db_retries = DB_START_PHASE_RETRIES; while (retry == true) { try { if (ext->poll_pool_conf.empty() == true) { get_database()->delete_device_property(admin_dev->get_name(),upd_conf); } else { // // The max device property size in db is limited to 255. // If we have only one thread, it is easy to catch this threshold. // In case this threshold is reached, split entry in several sub-entries // using the \ characters at the end of each sub-entries // vector::iterator iter; vector new_vect; for (iter = ext->poll_pool_conf.begin();iter != ext->poll_pool_conf.end();++iter) { string v_entry = *iter; unsigned int length = v_entry.size(); int nb_lines = (length / MaxDevPropLength) + 1; if (nb_lines > 1) { string::size_type start; start = 0; for (int i = 0;i < nb_lines;i++) { string sub = v_entry.substr(start,MaxDevPropLength); if (i < (nb_lines - 1)) sub = sub + '\\'; cout << "Sub string = " << sub << endl; start = start + MaxDevPropLength; new_vect.push_back(sub); } } else new_vect.push_back(v_entry); } upd_conf[0] << new_vect; get_database()->put_device_property(admin_dev->get_name(),upd_conf); } retry = false; } catch (Tango::CommunicationFailed &) { if (is_svr_starting() == true) { db_retries--; if (db_retries == 0) throw; } else throw; } } } } //+---------------------------------------------------------------------------- // // method : Util::get_th_polled_devs() // // description : Get from the polling pool configuration which devices should // be polled by the thread which is in charge of device dev // // argin() : - dev : The device name // - th_polled_devs : List of devices also polled by the thread in // charge of dev // //----------------------------------------------------------------------------- int Util::get_th_polled_devs(string &dev,vector &th_polled_devs) { th_polled_devs.clear(); vector::iterator iter; unsigned int dev_nb_char = dev.size(); unsigned int pool_dev_nb_char; for (iter = ext->poll_pool_conf.begin();iter != ext->poll_pool_conf.end();++iter) { string tmp = *iter; string::size_type pos,end_pos; pos = tmp.find(dev); if (pos != string::npos) { end_pos = tmp.find(',',pos); if (end_pos != string::npos) pool_dev_nb_char = end_pos - pos; else pool_dev_nb_char = tmp.size() - pos; if (dev_nb_char == pool_dev_nb_char) { split_string(tmp,',',th_polled_devs); break; } } } return iter - ext->poll_pool_conf.begin(); } void Util::get_th_polled_devs(long i,vector &th_polled_devs) { th_polled_devs.clear(); string tmp = ext->poll_pool_conf[i]; split_string(tmp,',',th_polled_devs); } //+---------------------------------------------------------------------------- // // method : Util::build_first_pool_conf() // // description : Create a polling tread pool configuration when this data is // not defined // //----------------------------------------------------------------------------- void Util::build_first_pool_conf(vector &pool_conf) { vector::iterator iter; for (iter = ext->poll_ths.begin();iter != ext->poll_ths.end();++iter) { string tmp; vector::iterator it; for (it = (*iter)->polled_devices.begin();it != (*iter)->polled_devices.end();++it) { if (it != (*iter)->polled_devices.begin()) tmp = tmp + ',' + *it; else tmp = *it; } pool_conf.push_back(tmp); } } //+---------------------------------------------------------------------------- // // method : Util::is_dev_already_in_pool_conf() // // description : Check if a device is already defined in the pool conf // // args() : - dev_name : The device name // - pool : The polling threads pool configuration // - stop : The index in poll conf where the search should be stopped // // This method returns true if the device is already defined in the pool. // Otherwise, returns false (amazing no!) // //----------------------------------------------------------------------------- bool Util::is_dev_already_in_pool_conf(string &dev_name,vector& pool,int stop) { vector::iterator iter; for (iter = pool.begin();iter != pool.begin() + stop;++iter) { vector dev_list; vector::iterator it; split_string(*iter,',',dev_list); for (it = dev_list.begin();it != dev_list.end();++it) { if (*it == dev_name) return true; } } return false; } //+---------------------------------------------------------------------------- // // method : Util::get_dev_entry_in_pool_conf() // // description : Get in which entry a device is used in the pool conf // // args() : - dev_name : The device name // // This method returns the index in the pool conf if the device has been // found. Otherwise, it returns -1 // //----------------------------------------------------------------------------- int Util::get_dev_entry_in_pool_conf(string &dev_name) { vector::iterator iter; unsigned int dev_nb_char = dev_name.size(); unsigned int pool_dev_nb_char; for (iter = ext->poll_pool_conf.begin();iter != ext->poll_pool_conf.end();++iter) { string tmp = *iter; string::size_type pos,end_pos; pos = tmp.find(dev_name); if (pos != string::npos) { end_pos = tmp.find(',',pos); if (end_pos != string::npos) pool_dev_nb_char = end_pos - pos; else pool_dev_nb_char = tmp.size() - pos; if (dev_nb_char == pool_dev_nb_char) { break; } } } if (iter != ext->poll_pool_conf.end()) return iter - ext->poll_pool_conf.begin(); else return -1; } //+---------------------------------------------------------------------------- // // method : Util::remove_dev_from_polling_map() // // description : Remove the device from the polled device map // //----------------------------------------------------------------------------- void Util::remove_dev_from_polling_map(string &dev_name) { map::iterator iter; iter = ext->dev_poll_th_map.find(dev_name); if (iter != ext->dev_poll_th_map.end()) ext->dev_poll_th_map.erase(iter); } //+---------------------------------------------------------------------------- // // method : Util::remove_polling_thread_info_by_id() // // description : Remove all the polling thread info from the vector of // polling thread info for a specific thread // // argin(s) : - id : The polling thread id // //----------------------------------------------------------------------------- void Util::remove_polling_thread_info_by_id(int th_id) { vector::iterator iter; for (iter = ext->poll_ths.begin();iter != ext->poll_ths.end();++iter) { if ((*iter)->thread_id == th_id) { delete (*iter); ext->poll_ths.erase(iter); return; } } if (iter == ext->poll_ths.end()) { TangoSys_OMemStream o; o << "There is no polling thread with ID = " << th_id << " in the polling threads pool"<< ends; Except::throw_exception((const char *)API_PollingThreadNotFound,o.str(), (const char *)"Util::remove_polling_thread_info_by_id"); } return; } } // End of Tango namespace tango-8.1.2c+dfsg.orig/lib/cpp/server/eventcmds.cpp0000644000175000017500000006322712205375142021140 0ustar piccapiccastatic const char *RcsId = "$Id: eventcmds.cpp 22213 2013-03-07 14:32:56Z taurel $"; //+============================================================================= // // file : eventcmds.cpp // // description : C++ source for the event commands which are part of // the DServer class. // // project : TANGO events // // $Author: taurel $ // // Copyright (C) : 2004,2005,2006,2007,2008,2009,2010,2011,2012,2013 // European Synchrotron Radiation Facility // BP 220, Grenoble 38043 // FRANCE // // This file is part of Tango. // // Tango 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. // // Tango 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 Tango. If not, see . // // $Revision: 22213 $ // //-============================================================================= #include #include namespace Tango { //+---------------------------------------------------------------------------- // // method : DServer::event_subscription_change() // // description : method to execute the command EventSubscriptionChange command. // // in : - argin : The command input argument // // returns : The command output data (Tango lib release number) // //----------------------------------------------------------------------------- DevLong DServer::event_subscription_change(const Tango::DevVarStringArray *argin) { if (argin->length() < 4) { TangoSys_OMemStream o; o << "Not enough input arguments, needs 4 i.e. device name, attribute name, action, event name" << ends; Except::throw_exception((const char *)API_WrongNumberOfArgs, o.str(), (const char *)"DServer::event_subscription_change"); } string dev_name, attr_name, action, event, attr_name_lower; dev_name = (*argin)[0]; attr_name = (*argin)[1]; action = (*argin)[2]; event = (*argin)[3]; attr_name_lower = attr_name; transform(attr_name_lower.begin(),attr_name_lower.end(),attr_name_lower.begin(),::tolower); cout4 << "EventSubscriptionChangeCmd: subscription for device " << dev_name << " attribute " << attr_name << " action " << action << " event " << event << endl; Tango::Util *tg = Tango::Util::instance(); // // If we receive this command while the DS is in its // shuting down sequence, do nothing // if (tg->get_heartbeat_thread_object() == NULL) { TangoSys_OMemStream o; o << "The device server is shutting down! You can no longer subscribe for events" << ends; Except::throw_exception((const char *)API_ShutdownInProgress, o.str(), (const char *)"DServer::event_subscription_change"); } // // If the EventSupplier object is not created, create it right now // NotifdEventSupplier *ev; if ((ev = tg->get_notifd_event_supplier()) == NULL) { tg->create_notifd_event_supplier(); ev = tg->get_notifd_event_supplier(); } // // If we are using a file as database, gives port number to event supplier // if (Util::_FileDb == true && ev != NULL) { ev->file_db_svr(); } string mcast; int rate,ivl; event_subscription(dev_name,attr_name,action,event,attr_name_lower,NOTIFD,mcast,rate,ivl,NULL); // // Init one subscription command flag in Eventsupplier // if (ev != NULL && ev->get_one_subscription_cmd() == false) ev->set_one_subscription_cmd(true); // // Return to caller // Tango::DevLong ret_val = (Tango::DevLong)tg->get_tango_lib_release(); return ret_val; } //+---------------------------------------------------------------------------- // // method : DServer::event_subscription() // // description : method to do all the necessary checks on attribute config // to generate events // // in : - dev_name : The device name // - attr_name : The attribute name // - action : What the user want to do // - event : The event type // - attr_name_lower : The attribute name in lower case letters // - ct : The channel type (notifd or zmq) // - mcast_data : The multicast transport data // - rate : PGM rate parameter // - ivl : PGM ivl paramteter // - dev : The device pointer // //----------------------------------------------------------------------------- void DServer::event_subscription(string &dev_name,string &attr_name,string &action,string &event,string &attr_name_lower,ChannelType ct,string &mcast_data,int &rate,int &ivl,DeviceImpl *dev) { Tango::Util *tg = Tango::Util::instance(); // // Get device reference // DeviceImpl *dev_impl = dev; if (dev_impl == NULL) { try { dev_impl = tg->get_device_by_name(dev_name); } catch (Tango::DevFailed &e) { TangoSys_OMemStream o; o << "Device " << dev_name << " not found" << ends; Except::re_throw_exception(e,(const char *)API_DeviceNotFound,o.str(), (const char *)"DServer::event_subscription"); } } MultiAttribute *m_attr = dev_impl->get_device_attr(); int attr_ind = m_attr->get_attr_ind_by_name(attr_name.c_str()); Attribute &attribute = m_attr->get_attr_by_ind(attr_ind); // // Check if the request comes from a Tango 6 client (without client identification) // If true, the event has to be sent using AttributeValue_3 data structure // If cl is NULL, this means that the call is local (Two tango classes within the // same process and with events between device from class 1 and device from classs 2) // client_addr *cl = get_client_ident(); int cl_release; if (cl == NULL) cl_release = 4; else { if (cl->client_ident == true) cl_release = 4; else cl_release = 3; } if (action == "subscribe") { if (event == "user_event") { cout4 << "DServer::event_subscription(): update user_event subscription\n"; omni_mutex_lock oml(EventSupplier::get_event_mutex()); attribute.ext->event_user_subscription = time(NULL); if (cl_release == 3) attribute.ext->event_user_client_3 = true; } else if (event == "attr_conf") { cout4 << "DServer::event_subscription(): update attr_conf subscription\n"; omni_mutex_lock oml(EventSupplier::get_event_mutex()); attribute.ext->event_attr_conf_subscription = time(NULL); } else if (event == "data_ready") { if (attribute.is_data_ready_event() == false) { TangoSys_OMemStream o; o << "The attribute "; o << attr_name; o << " is not data ready event enabled" << ends; Except::throw_exception((const char*)"API_AttributeNotDataReadyEnabled", o.str(), (const char *)"DServer::event_subscription"); } cout4 << "DServer::event_subscription(): update data_ready subscription\n"; omni_mutex_lock oml(EventSupplier::get_event_mutex()); attribute.ext->event_data_ready_subscription = time(NULL); } else { // // If the polling is necessary to send events, check whether the polling is // started for the requested attribute. // if (attribute.is_polled() == false ) { TangoSys_OMemStream o; o << "The polling (necessary to send events) for the attribute "; o << attr_name; o << " is not started" << ends; if ( event == "change") { if (attribute.is_change_event() == false) { Except::throw_exception((const char *)API_AttributePollingNotStarted, o.str(), (const char *)"DServer::event_subscription"); } } else { if ( event == "archive") { if (attribute.is_archive_event() == false) { Except::throw_exception((const char *)API_AttributePollingNotStarted, o.str(), (const char *)"DServer::event_subscription"); } } else { Except::throw_exception((const char *)API_AttributePollingNotStarted, o.str(), (const char *)"DServer::event_subscription"); } } } if (event == "change") { cout4 << "DServer::event_subscription(): update change subscription\n"; // // Check if the attribute has some of the change properties defined // if (attr_name_lower != "state") { if ((attribute.get_data_type() != Tango::DEV_STRING) && (attribute.get_data_type() != Tango::DEV_BOOLEAN) && (attribute.get_data_type() != Tango::DEV_ENCODED) && (attribute.get_data_type() != Tango::DEV_STATE)) { if ( attribute.is_check_change_criteria() == true ) { if ((attribute.ext->rel_change[0] == INT_MAX) && (attribute.ext->rel_change[1] == INT_MAX) && (attribute.ext->abs_change[0] == INT_MAX) && (attribute.ext->abs_change[1] == INT_MAX)) { TangoSys_OMemStream o; o << "Event properties (abs_change or rel_change) for attribute "; o << attr_name; o << " are not set" << ends; Except::throw_exception((const char *)API_EventPropertiesNotSet, o.str(), (const char *)"DServer::event_subscription"); } } } } omni_mutex_lock oml(EventSupplier::get_event_mutex()); attribute.ext->event_change_subscription = time(NULL); if (cl_release == 3) attribute.ext->event_change_client_3 = true; } else if (event == "quality") { cout4 << "DServer::event_subscription(): update quality_change subscription\n"; attribute.ext->event_quality_subscription = time(NULL); } else if (event == "periodic") { cout4 << "DServer::event_subscription(): update periodic subscription\n"; omni_mutex_lock oml(EventSupplier::get_event_mutex()); attribute.ext->event_periodic_subscription = time(NULL); if (cl_release == 3) attribute.ext->event_periodic_client_3 = true; } else if (event == "archive") { // // Check if the attribute has some of the archive properties defined // if (attr_name_lower != "state") { if ((attribute.get_data_type() != Tango::DEV_STRING) && (attribute.get_data_type() != Tango::DEV_BOOLEAN) && (attribute.get_data_type() != Tango::DEV_ENCODED) && (attribute.get_data_type() != Tango::DEV_STATE)) { if ( attribute.is_check_archive_criteria() == true ) { if ((attribute.ext->archive_abs_change[0] == INT_MAX) && (attribute.ext->archive_abs_change[1] == INT_MAX) && (attribute.ext->archive_rel_change[0] == INT_MAX) && (attribute.ext->archive_rel_change[1] == INT_MAX) && (attribute.ext->archive_period == INT_MAX)) { TangoSys_OMemStream o; o << "Archive event properties (archive_abs_change or archive_rel_change or archive_period) for attribute "; o << attr_name; o << " are not set" << ends; Except::throw_exception((const char *)API_EventPropertiesNotSet, o.str(), (const char *)"DServer::event_subscription"); } } } } cout4 << "DServer::event_subscription(): update archive subscription\n"; omni_mutex_lock oml(EventSupplier::get_event_mutex()); attribute.ext->event_archive_subscription = time(NULL); if (cl_release == 3) attribute.ext->event_archive_client_3 = true; } } // // Set channel type in attribute object // if (ct == ZMQ) attribute.set_use_zmq_event(); else attribute.set_use_notifd_event(); // // Check if multicast has to be used for event transport // (only for ZMQ event) // Don't forget syntax in attribute mcast_event string: // event_name:ip_address:port:rate:ivl // The last two are not optionals // if (ct == ZMQ) { bool found = false; ZmqEventSupplier *ev; ev = tg->get_zmq_event_supplier(); int zmq_release = ev->get_zmq_release(); for(unsigned int i = 0;i != attribute.ext->mcast_event.size();++i) { if (attribute.ext->mcast_event[i].find(event) == 0) { if (zmq_release < 320) { int zmq_major,zmq_minor,zmq_patch; zmq_version(&zmq_major,&zmq_minor,&zmq_patch); TangoSys_OMemStream o; o << "Device server process is using zmq release "; o << zmq_major << "." << zmq_minor << "." << zmq_patch; o << "\nMulticast event(s) not available with this ZMQ release" << ends; Except::throw_exception((const char *)API_UnsupportedFeature, o.str(), (const char *)"DServer::event_subscription"); } string::size_type start,end; start = attribute.ext->mcast_event[i].find(':'); start++; end = attribute.ext->mcast_event[i].find(':',start); if ((end = attribute.ext->mcast_event[i].find(':',end + 1)) == string::npos) { mcast_data = attribute.ext->mcast_event[i].substr(start); rate = 0; ivl = 0; found = true; break; } else { mcast_data = attribute.ext->mcast_event[i].substr(start,end - start); // // Get rate because one is defined // string::size_type start_rate = end + 1; if ((end = attribute.ext->mcast_event[i].find(':',start_rate)) == string::npos) { istringstream iss(attribute.ext->mcast_event[i].substr(start_rate)); iss >> rate; rate = rate * 1024; ivl = 0; found = true; break; } else { istringstream iss(attribute.ext->mcast_event[i].substr(start_rate,end - start_rate)); iss >> rate; rate = rate * 1024; // // Get ivl because one is defined // istringstream iss_ivl(attribute.ext->mcast_event[i].substr(end + 1)); iss_ivl >> ivl; ivl = ivl * 1000; found = true; break; } } } } if (found == false) { rate = 0; ivl = 0; } // // If one of the 2 parameters are not defined, get the default value // if (rate == 0) rate = mcast_rate; if (ivl == 0) ivl = mcast_ivl; } else { rate = 0; ivl = 0; } // // Ask polling thread in charge of heartbeat to send them // (if not already done) // try { if (get_heartbeat_started() == false) { add_event_heartbeat(); set_heartbeat_started(true); } } catch (...) { } } } //+---------------------------------------------------------------------------- // // method : DServer::zmq_event_subscription_change() // // description : method to execute the command ZmqEventSubscriptionChange command. // // in : - argin : The command input argument // // returns : The command output data (Tango lib release number) // //----------------------------------------------------------------------------- DevVarLongStringArray *DServer::zmq_event_subscription_change(const Tango::DevVarStringArray *argin) { if (argin->length() > 1 && argin->length() < 4) { TangoSys_OMemStream o; o << "Not enough input arguments, needs 4 i.e. device name, attribute name, action, event name" << ends; Except::throw_exception((const char *)API_WrongNumberOfArgs, o.str(), (const char *)"DServer::zmq_event_subscription_change"); } Tango::DevVarLongStringArray *ret_data = new Tango::DevVarLongStringArray(); Tango::Util *tg = Tango::Util::instance(); if (argin->length() == 1) { string arg((*argin)[0]); transform(arg.begin(),arg.end(),arg.begin(),::tolower); if (arg != "info") { TangoSys_OMemStream o; o << "Not enough input arguments, needs 4 i.e. device name, attribute name, action, event name" << ends; Except::throw_exception((const char *)API_WrongNumberOfArgs, o.str(), (const char *)"DServer::zmq_event_subscription_change"); } // // It's just the call to help debugging. Returns event configuration // ret_data->svalue.length(2); ZmqEventSupplier *ev; if ((ev = tg->get_zmq_event_supplier()) != NULL) { string tmp_str("Heartbeat: "); tmp_str = tmp_str + ev->get_heartbeat_endpoint(); ret_data->svalue[0] = CORBA::string_dup(tmp_str.c_str()); tmp_str = "Event: "; string ev_end = ev->get_event_endpoint(); if (ev_end.size() != 0) tmp_str = "Event: " + ev_end; size_t nb_mcast = ev->get_mcast_event_nb(); if (nb_mcast != 0) { if (ev_end.size() != 0) tmp_str = tmp_str + "\n"; tmp_str = tmp_str + "Some event(s) sent using multicast protocol"; } ret_data->svalue[1] = CORBA::string_dup(tmp_str.c_str()); } else { ret_data->svalue[0] = CORBA::string_dup("No ZMQ event yet!"); } } else { string dev_name, attr_name, action, event, attr_name_lower; dev_name = (*argin)[0]; attr_name = (*argin)[1]; action = (*argin)[2]; event = (*argin)[3]; attr_name_lower = attr_name; transform(attr_name_lower.begin(),attr_name_lower.end(),attr_name_lower.begin(),::tolower); cout4 << "ZmqEventSubscriptionChangeCmd: subscription for device " << dev_name << " attribute " << attr_name << " action " << action << " event " << event << endl; // // If we receive this command while the DS is in its // shuting down sequence, do nothing // if (tg->get_heartbeat_thread_object() == NULL) { TangoSys_OMemStream o; o << "The device server is shutting down! You can no longer subscribe for events" << ends; Except::throw_exception((const char *)API_ShutdownInProgress, o.str(), (const char *)"DServer::zmq_event_subscription_change"); } // // If the EventSupplier object is not created, create it right now // ZmqEventSupplier *ev; if ((ev = tg->get_zmq_event_supplier()) == NULL) { tg->create_zmq_event_supplier(); ev = tg->get_zmq_event_supplier(); } // // Get device pointer and check which IDL release it implements // If it is less than IDL 4, refuse to use ZMQ event. To do so, // simulate a Tango 7 DS (throw command not exist exception) // DeviceImpl *dev = NULL; try { dev = tg->get_device_by_name(dev_name); } catch (Tango::DevFailed &e) { TangoSys_OMemStream o; o << "Device " << dev_name << " not found" << ends; Except::re_throw_exception(e,(const char *)API_DeviceNotFound,o.str(), (const char *)"DServer::event_subscription"); } if (dev->get_dev_idl_version() < 4) { TangoSys_OMemStream o; o << "Device " << dev_name << " too old to use ZMQ event (it does not implement IDL 4)"; o << "\nSimulate a CommandNotFound exception to move to notifd event system" << ends; Except::throw_exception((const char *)API_CommandNotFound, o.str(), (const char *)"DServer::zmq_event_subscription_change"); } // // Call common method (common between old and new command) // string mcast; int rate,ivl; event_subscription(dev_name,attr_name,action,event,attr_name_lower,ZMQ,mcast,rate,ivl,dev); // // Check if the client is a new one // bool new_client = ev->update_connected_client(get_client_ident()); if (new_client == true) ev->set_double_send(); // // Create the event publisher socket (if not already done) // Take care for case where the device is running with db in a file // string ev_name = ev->get_fqdn_prefix(); if (Util::_FileDb == true) { int size = ev_name.size(); if (ev_name[size - 1] == '#') ev_name.erase(size - 1); } ev_name = ev_name + dev->get_name_lower() + '/' + attr_name_lower; if (Util::_FileDb == true && ev != NULL) ev_name = ev_name + MODIFIER_DBASE_NO; ev_name = ev_name + '.' + event; // // If the event is defined as using mcast transport, get caller host // bool local_call = false; if (mcast.empty() == false) { client_addr *c_addr = get_client_ident(); if ((c_addr->client_ip[5] == 'u') || ((c_addr->client_ip[9] == '1') && (c_addr->client_ip[10] == '2') && (c_addr->client_ip[11] == '7'))) { local_call = true; } } // // Create ZMQ event socket // if (mcast.empty() == false) ev->create_mcast_event_socket(mcast,ev_name,rate,local_call); else ev->create_event_socket(); // // Init event counter in Event Supplier // ev->init_event_cptr(ev_name); // // Init one subscription command flag in Eventsupplier // if (ev->get_one_subscription_cmd() == false) ev->set_one_subscription_cmd(true); // // Init data returned by command // ret_data->lvalue.length(6); ret_data->svalue.length(2); ret_data->lvalue[0] = (Tango::DevLong)tg->get_tango_lib_release(); ret_data->lvalue[1] = dev->get_dev_idl_version(); ret_data->lvalue[2] = zmq_sub_event_hwm; ret_data->lvalue[3] = rate; ret_data->lvalue[4] = ivl; ret_data->lvalue[5] = ev->get_zmq_release(); string &heartbeat_endpoint = ev->get_heartbeat_endpoint(); ret_data->svalue[0] = CORBA::string_dup(heartbeat_endpoint.c_str()); if (mcast.empty() == true) { string &event_endpoint = ev->get_event_endpoint(); ret_data->svalue[1] = CORBA::string_dup(event_endpoint.c_str()); } else { if (local_call == true) { string &event_endpoint = ev->get_event_endpoint(); ret_data->svalue[1] = CORBA::string_dup(event_endpoint.c_str()); } else { string &event_endpoint = ev->get_mcast_event_endpoint(ev_name); ret_data->svalue[1] = CORBA::string_dup(event_endpoint.c_str()); } } } return ret_data; } //+---------------------------------------------------------------------------- // // method : DServer::event_confirm_subscription() // // description : method to execute the command EventConfirmSubscription command. // // in : - argin : The command input argument // //----------------------------------------------------------------------------- void DServer::event_confirm_subscription(const Tango::DevVarStringArray *argin) { // // Some check on argument // if ((argin->length() == 0) || (argin->length() % 3) != 0) { TangoSys_OMemStream o; o << "Wrong number of input arguments: 3 needed per event: device name, attribute name and event name" << endl; Except::throw_exception((const char *)API_WrongNumberOfArgs,o.str(), (const char *)"DServer::event_confirm_subscription"); } // // If we receive this command while the DS is in its // shuting down sequence, do nothing // Tango::Util *tg = Tango::Util::instance(); if (tg->get_heartbeat_thread_object() == NULL) { TangoSys_OMemStream o; o << "The device server is shutting down! You can no longer subscribe for events" << ends; Except::throw_exception((const char *)API_ShutdownInProgress, o.str(), (const char *)"DServer::event_confirm_subscription"); } // // A loop for each event // unsigned int nb_event = argin->length() / 3; string old_dev; DeviceImpl *dev = NULL; for (unsigned int loop = 0;loop < nb_event;loop++) { string dev_name, attr_name, event, attr_name_lower; int base = loop * 3; dev_name = (*argin)[base]; attr_name = (*argin)[base + 1]; event = (*argin)[base + 2]; attr_name_lower = attr_name; transform(attr_name_lower.begin(),attr_name_lower.end(),attr_name_lower.begin(),::tolower); cout4 << "EventConfirmSubscriptionCmd: confirm subscription for device " << dev_name << " attribute " << attr_name << " event " << event << endl; // // Find device // if (old_dev != dev_name) { try { dev = tg->get_device_by_name(dev_name); } catch (Tango::DevFailed &e) { TangoSys_OMemStream o; o << "Device " << dev_name << " not found" << ends; Except::re_throw_exception(e,(const char *)API_DeviceNotFound,o.str(), (const char *)"DServer::event_confirm_subscription"); } old_dev = dev_name; } // // Call common method (common between old and new command) // string mcast; int rate,ivl; string action("subscribe"); event_subscription(dev_name,attr_name,action,event,attr_name_lower,ZMQ,mcast,rate,ivl,dev); } } } // namespace tango-8.1.2c+dfsg.orig/lib/cpp/server/blackbox.cpp0000644000175000017500000012036712205375142020734 0ustar piccapiccastatic const char *RcsId = "$Id: blackbox.cpp 22616 2013-05-05 08:56:58Z taurel $\n$Name$"; //+============================================================================ // // file : BlackBox.cpp // // description : C++ source code for the BlackBoxElt and BlackBox // classes. These classes are used to implement the // tango device server black box. There is one // black box for each Tango device. This black box // keeps info. on all the activities on a device. // A client is able to retrieve these data via a Device // attribute // // project : TANGO // // author(s) : A.Gotz + E.Taurel // // Copyright (C) : 2004,2005,2006,2007,2008,2009,2010,2011,2012,2013 // European Synchrotron Radiation Facility // BP 220, Grenoble 38043 // FRANCE // // This file is part of Tango. // // Tango 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. // // Tango 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 Tango. If not, see . // // $Revision: 22616 $ // //-============================================================================ #if HAVE_CONFIG_H #include #endif #include #include #include #ifdef _TG_WINDOWS_ #include #include #include #else #include #include #include #include #include #endif /* _TG_WINDOWS_ */ #include #include #include #include namespace Tango { // // The per thread data storage key (The client IP is stored in thread specific storage) // defined in utils.cpp // extern omni_thread::key_t key; // // The function called by the interceptor // CORBA::Boolean get_client_addr(omni::omniInterceptors::serverReceiveRequest_T::info_T &info) { omni_thread::self()->set_value(key,new client_addr(((omni::giopStrand &)info.giop_s).connection->peeraddress())); return true; } //+------------------------------------------------------------------------- // // method : BlackBoxElt::BlackBoxElt // // description : Constructor for the BlackBoxElt class. // This constructor simply set the internal value to their // default // //-------------------------------------------------------------------------- BlackBoxElt::BlackBoxElt() { req_type = Req_Unknown; attr_type = Attr_Unknown; op_type = Op_Unknown; when.tv_sec = when.tv_usec = 0; host_ip_str[0] = '\0'; client_ident = false; attr_names.reserve(DEFAULT_ATTR_NB); } BlackBoxElt::~BlackBoxElt() { } //+------------------------------------------------------------------------- // // method : BlackBox::BlackBox // // description : Two constructors for the BlackBox class. The first one // does not take any argument and construct a black box // with the default depth. // The second one create a black box with a depth defined // by the argument. // // argument : in : - max_size : The black box depth // //-------------------------------------------------------------------------- BlackBox::BlackBox():box(DefaultBlackBoxDepth) { insert_elt = 0; nb_elt = 0; max_elt = DefaultBlackBoxDepth; } BlackBox::BlackBox(long max_size):box(max_size) { insert_elt = 0; nb_elt = 0; max_elt = max_size; } //+------------------------------------------------------------------------- // // method : BlackBox::insert_corba_attr // // description : This method insert a new element in the black box when // this element is a attribute // // argument : in : - attr : The attribute type // //-------------------------------------------------------------------------- void BlackBox::insert_corba_attr(BlackBoxElt_AttrType attr) { // // Take mutex // sync.lock(); // // Insert elt in the box // box[insert_elt].req_type = Req_Attribute; box[insert_elt].attr_type = attr; box[insert_elt].op_type = Op_Unknown; box[insert_elt].client_ident = false; #ifdef _TG_WINDOWS_ // // Note that the exact conversion between milli-sec and u-sec will be done // only when data is send back to user. This save some times in unnecessary // computation // struct _timeb t; _ftime(&t); box[insert_elt].when.tv_usec = (long)t.millitm; box[insert_elt].when.tv_sec = (unsigned long)t.time; #else struct timezone tz; gettimeofday(&box[insert_elt].when,&tz); #endif // // get client address // get_client_host(); // // manage insert and read indexes // inc_indexes(); // // Release mutex // sync.unlock(); } //+------------------------------------------------------------------------- // // method : BlackBox::insert_cmd // // description : This method insert a new element in the black box when // this element is a call to the operation command_inout // // argument : in : - cmd : The command name // - vers : The IDL device version // - sour : The source parameter (DEV, CACHE...) // //-------------------------------------------------------------------------- void BlackBox::insert_cmd(const char *cmd,long vers,DevSource sour) { sync.lock(); insert_cmd_nl(cmd,vers,sour); sync.unlock(); } void BlackBox::insert_cmd_nl(const char *cmd,long vers,DevSource sour) { // // Insert elt in the box // box[insert_elt].req_type = Req_Operation; box[insert_elt].attr_type = Attr_Unknown; if (vers == 1) box[insert_elt].op_type = Op_Command_inout; else if (vers <= 3) box[insert_elt].op_type = Op_Command_inout_2; else box[insert_elt].op_type = Op_Command_inout_4; box[insert_elt].cmd_name = cmd; box[insert_elt].source = sour; box[insert_elt].client_ident = false; #ifdef _TG_WINDOWS_ // // Note that the exact conversion between milli-sec and u-sec will be done // only when data is send back to user. This save some times in unnecessary // computation // struct _timeb t; _ftime(&t); box[insert_elt].when.tv_usec = (long)t.millitm; box[insert_elt].when.tv_sec = (unsigned long)t.time; #else struct timezone tz; gettimeofday(&box[insert_elt].when,&tz); #endif // // get client address // get_client_host(); // // manage insert and read indexes // inc_indexes(); } //+------------------------------------------------------------------------- // // method : BlackBox::insert_cmd_cl_ident // // description : This method insert a new element in the black box when // this element is a call to the operation command_inout // // argument : in : - cmd : The command name // - cl_id : The client identification data // - sour : The source parameter (DEV, CACHE...) // //-------------------------------------------------------------------------- void BlackBox::insert_cmd_cl_ident(const char *cmd,const ClntIdent &cl_id,long vers,DevSource sour) { sync.lock(); // // Add basic info in the box // insert_cmd_nl(cmd,vers,sour); // // Check if the command is executed due to polling // If true, simply return // omni_thread::value_t *ip = omni_thread::self()->get_value(key); if (ip == NULL) { sync.unlock(); return; } // // Add client ident info into the client_addr instance // and into the box // add_cl_ident(cl_id,static_cast(ip)); update_client_host(static_cast(ip)); sync.unlock(); } //+------------------------------------------------------------------------- // // method : BlackBox::add_cl_ident // // description : Add client identification data to the client address // instance // // argument : in : - cl_ident : The client identificator // - cl_addr : The client address instance // //-------------------------------------------------------------------------- void BlackBox::add_cl_ident(const ClntIdent &cl_ident,client_addr *cl_addr) { cl_addr->client_ident = true; Tango::LockerLanguage cl_lang = cl_ident._d(); cl_addr->client_lang = cl_lang; if (cl_lang == Tango::CPP) { cl_addr->client_pid = cl_ident.cpp_clnt(); string str(cl_addr->client_ip); if (str.find(":unix:") != string::npos) { string::size_type pos = str.find(' '); if (pos != string::npos) cl_addr->client_ip[pos] = '\0'; } } else { Tango::JavaClntIdent jci = cl_ident.java_clnt(); cl_addr->java_main_class = jci.MainClass; cl_addr->java_ident[0] = jci.uuid[0]; cl_addr->java_ident[1] = jci.uuid[1]; } } //+------------------------------------------------------------------------- // // method : BlackBox::update_client_host // // description : Add client identification data to one of the BlackBox // element // // argument : in : - ip : The client address instance // //-------------------------------------------------------------------------- void BlackBox::update_client_host(client_addr *ip) { long local_insert_elt = insert_elt; if (local_insert_elt == 0) local_insert_elt = max_elt - 1; else local_insert_elt--; box[local_insert_elt].client_ident = true; box[local_insert_elt].client_lang = ip->client_lang; box[local_insert_elt].client_pid = ip->client_pid; box[local_insert_elt].java_main_class = ip->java_main_class; } //+------------------------------------------------------------------------- // // method : BlackBox::insert_op // // description : This method insert a new element in the black box when // this element is a call to an operation which is not // the command_inout operation // // argument : in : - cmd : The operation type // //-------------------------------------------------------------------------- void BlackBox::insert_op(BlackBoxElt_OpType op) { sync.lock(); insert_op_nl(op); sync.unlock(); } void BlackBox::insert_op(BlackBoxElt_OpType op,const ClntIdent &cl_id) { sync.lock(); insert_op_nl(op); // // Check if the command is executed due to polling // If true, simply return // omni_thread::value_t *ip = omni_thread::self()->get_value(key); if (ip == NULL) { sync.unlock(); return; } // // Add client ident info into the client_addr instance // and into the box // add_cl_ident(cl_id,static_cast(ip)); update_client_host(static_cast(ip)); sync.unlock(); } void BlackBox::insert_op_nl(BlackBoxElt_OpType op) { // // Insert elt in the box // box[insert_elt].req_type = Req_Operation; box[insert_elt].attr_type = Attr_Unknown; box[insert_elt].op_type = op; box[insert_elt].client_ident = false; #ifdef _TG_WINDOWS_ // // Note that the exact conversion between milli-sec and u-sec will be done // only when data is send back to user. This save some times in unnecessary // computation // struct _timeb t; _ftime(&t); box[insert_elt].when.tv_usec = (long)t.millitm; box[insert_elt].when.tv_sec = (unsigned long)t.time; #else struct timezone tz; gettimeofday(&box[insert_elt].when,&tz); #endif // // get client address // get_client_host(); // // manage insert and read indexes // inc_indexes(); } //+------------------------------------------------------------------------- // // method : BlackBox::insert_attr // // description : This method insert a new element in the black box when // this element is a call to the CORBA operation // read_attributes // // argument : in : - names : The attribute(s) name // - vers : The device IDl version // - sour : The device source parameter (CACHE, DEV,...) // //-------------------------------------------------------------------------- void BlackBox::insert_attr(const Tango::DevVarStringArray &names,long vers,DevSource sour) { // // Take mutex // sync.lock(); // // Insert elt in the box // box[insert_elt].req_type = Req_Operation; box[insert_elt].attr_type = Attr_Unknown; switch (vers) { case 1 : box[insert_elt].op_type = Op_Read_Attr; break; case 2 : box[insert_elt].op_type = Op_Read_Attr_2; break; case 3 : box[insert_elt].op_type = Op_Read_Attr_3; break; case 4 : box[insert_elt].op_type = Op_Read_Attr_4; break; } box[insert_elt].source = sour; box[insert_elt].client_ident = false; box[insert_elt].attr_names.clear(); for (unsigned long i = 0;i < names.length();i++) { string tmp_str(names[i]); box[insert_elt].attr_names.push_back(tmp_str); } #ifdef _TG_WINDOWS_ // // Note that the exact conversion between milli-sec and u-sec will be done // only when data is send back to user. This save some times in unnecessary // computation // struct _timeb t; _ftime(&t); box[insert_elt].when.tv_usec = (long)t.millitm; box[insert_elt].when.tv_sec = (unsigned long)t.time; #else struct timezone tz; gettimeofday(&box[insert_elt].when,&tz); #endif // // get client address // get_client_host(); // // manage insert and read indexes // inc_indexes(); // // Release mutex // sync.unlock(); } void BlackBox::insert_attr(const Tango::DevVarStringArray &names,const ClntIdent &cl_id,TANGO_UNUSED(long vers),DevSource sour) { // // Take mutex // sync.lock(); // // Insert elt in the box // box[insert_elt].req_type = Req_Operation; box[insert_elt].attr_type = Attr_Unknown; box[insert_elt].op_type = Op_Read_Attr_4; box[insert_elt].source = sour; box[insert_elt].client_ident = false; box[insert_elt].attr_names.clear(); for (unsigned long i = 0;i < names.length();i++) { string tmp_str(names[i]); box[insert_elt].attr_names.push_back(tmp_str); } #ifdef _TG_WINDOWS_ // // Note that the exact conversion between milli-sec and u-sec will be done // only when data is send back to user. This save some times in unnecessary // computation // struct _timeb t; _ftime(&t); box[insert_elt].when.tv_usec = (long)t.millitm; box[insert_elt].when.tv_sec = (unsigned long)t.time; #else struct timezone tz; gettimeofday(&box[insert_elt].when,&tz); #endif // // get client address // get_client_host(); // // manage insert and read indexes // inc_indexes(); // // Check if the command is executed due to polling // If true, simply return // omni_thread::value_t *ip = omni_thread::self()->get_value(key); if (ip == NULL) { sync.unlock(); return; } // // Add client ident info into the client_addr instance // and into the box // add_cl_ident(cl_id,static_cast(ip)); update_client_host(static_cast(ip)); // // Release mutex // sync.unlock(); } void BlackBox::insert_attr(const Tango::AttributeValueList &att_list, long vers) { sync.lock(); insert_attr_nl(att_list,vers); sync.unlock(); } void BlackBox::insert_attr(const Tango::AttributeValueList_4 &att_list, const ClntIdent &cl_id,TANGO_UNUSED(long vers)) { sync.lock(); insert_attr_nl_4(att_list); // // Check if the command is executed due to polling // If true, simply return // omni_thread::value_t *ip = omni_thread::self()->get_value(key); if (ip == NULL) { sync.unlock(); return; } // // Add client ident info into the client_addr instance // and into the box // add_cl_ident(cl_id,static_cast(ip)); update_client_host(static_cast(ip)); sync.unlock(); } void BlackBox::insert_attr_nl(const Tango::AttributeValueList &att_list, long vers) { // // Insert elt in the box // box[insert_elt].req_type = Req_Operation; box[insert_elt].attr_type = Attr_Unknown; if (vers == 1) box[insert_elt].op_type = Op_Write_Attr; else if (vers < 4) box[insert_elt].op_type = Op_Write_Attr_3; else box[insert_elt].op_type = Op_Write_Attr_4; box[insert_elt].attr_names.clear(); for (unsigned long i = 0;i < att_list.length();i++) { string tmp_str(att_list[i].name); box[insert_elt].attr_names.push_back(tmp_str); } box[insert_elt].client_ident = false; #ifdef _TG_WINDOWS_ // // Note that the exact conversion between milli-sec and u-sec will be done // only when data is send back to user. This save some times in unnecessary // computation // struct _timeb t; _ftime(&t); box[insert_elt].when.tv_usec = (long)t.millitm; box[insert_elt].when.tv_sec = (unsigned long)t.time; #else struct timezone tz; gettimeofday(&box[insert_elt].when,&tz); #endif // // get client address // get_client_host(); // // manage insert and read indexes // inc_indexes(); } void BlackBox::insert_attr_nl_4(const Tango::AttributeValueList_4 &att_list) { // // Insert elt in the box // box[insert_elt].req_type = Req_Operation; box[insert_elt].attr_type = Attr_Unknown; box[insert_elt].op_type = Op_Write_Attr_4; box[insert_elt].attr_names.clear(); for (unsigned long i = 0;i < att_list.length();i++) { string tmp_str(att_list[i].name); box[insert_elt].attr_names.push_back(tmp_str); } #ifdef _TG_WINDOWS_ // // Note that the exact conversion between milli-sec and u-sec will be done // only when data is send back to user. This save some times in unnecessary // computation // struct _timeb t; _ftime(&t); box[insert_elt].when.tv_usec = (long)t.millitm; box[insert_elt].when.tv_sec = (unsigned long)t.time; #else struct timezone tz; gettimeofday(&box[insert_elt].when,&tz); #endif // // get client address // get_client_host(); // // manage insert and read indexes // inc_indexes(); } //+------------------------------------------------------------------------- // // method : BlackBox::insert_wr_attr // // description : This method insert a new element in the black box when // this element is a call to the CORBA operation // write_read_attributes // // argument : in : - names : The attribute(s) name // //-------------------------------------------------------------------------- void BlackBox::insert_wr_attr(const Tango::AttributeValueList_4 &att_list, const ClntIdent &cl_id,long vers) { sync.lock(); insert_attr_wr_nl(att_list,vers); omni_thread::value_t *ip = omni_thread::self()->get_value(key); if (ip == NULL) { sync.unlock(); return; } // // Add client ident info into the client_addr instance // and into the box // add_cl_ident(cl_id,static_cast(ip)); update_client_host(static_cast(ip)); sync.unlock(); } void BlackBox::insert_attr_wr_nl(const Tango::AttributeValueList_4 &att_list, long vers) { // // Insert elt in the box // box[insert_elt].req_type = Req_Operation; box[insert_elt].attr_type = Attr_Unknown; if (vers >= 4) box[insert_elt].op_type = Op_Write_Read_Attributes_4; box[insert_elt].attr_names.clear(); for (unsigned long i = 0;i < att_list.length();i++) { string tmp_str(att_list[i].name); box[insert_elt].attr_names.push_back(tmp_str); } #ifdef _TG_WINDOWS_ // // Note that the exact conversion between milli-sec and u-sec will be done // only when data is send back to user. This save some times in unnecessary // computation // struct _timeb t; _ftime(&t); box[insert_elt].when.tv_usec = (long)t.millitm; box[insert_elt].when.tv_sec = (unsigned long)t.time; #else struct timezone tz; gettimeofday(&box[insert_elt].when,&tz); #endif // // get client address // get_client_host(); // // manage insert and read indexes // inc_indexes(); } //+------------------------------------------------------------------------- // // method : BlackBox::inc_indexes // // description : This private method increment the indexes used to acces // the box itself. This is necessary because the box must // be managed as a circular buffer // //-------------------------------------------------------------------------- void BlackBox::inc_indexes() { insert_elt++; if (insert_elt == max_elt) insert_elt = 0; if (nb_elt != max_elt) nb_elt++; } //+------------------------------------------------------------------------- // // method : get_client_host // // description : This private method retrieves the client host IP // address (the number). IT USES OMNIORB SPECIFIC // INTERCEPTOR // //-------------------------------------------------------------------------- void BlackBox::get_client_host() { omni_thread *th_id = omni_thread::self(); if (th_id == NULL) th_id = omni_thread::create_dummy(); omni_thread::value_t *ip = th_id->get_value(key); if (ip == NULL) { Tango::Util *tg = Tango::Util::instance(); if (tg->is_svr_starting() == true) strcpy(box[insert_elt].host_ip_str,"init"); else strcpy(box[insert_elt].host_ip_str,"polling"); } else strcpy(box[insert_elt].host_ip_str,(static_cast(ip))->client_ip); } //+------------------------------------------------------------------------- // // method : BlackBox::build_info_as_str // // description : Translate all the info stored in a black box element // into a readable string. // // argument : in : - index : The black box element index // //-------------------------------------------------------------------------- void BlackBox::build_info_as_str(long index) { char date_str[25]; // // Convert time to a string // date_ux_to_str(box[index].when,date_str); elt_str = date_str; // // Add request type and command name in case of // elt_str = elt_str + " : "; if (box[index].req_type == Req_Operation) { elt_str = elt_str + "Operation "; unsigned long i; unsigned long nb_in_vect; switch (box[index].op_type) { case Op_Command_inout : elt_str = elt_str + "command_inout (cmd = " + box[index].cmd_name + ") from "; add_source(index); break; case Op_Ping : elt_str = elt_str + "ping "; break; case Op_Info : elt_str = elt_str + "info "; break; case Op_BlackBox : elt_str = elt_str + "blackbox "; break; case Op_Command_list : elt_str = elt_str + "command_list_query "; break; case Op_Command : elt_str = elt_str + "command_query "; break; case Op_Get_Attr_Config : elt_str = elt_str + "get_attribute_config "; break; case Op_Set_Attr_Config : elt_str = elt_str + "set_attribute_config "; break; case Op_Read_Attr : elt_str = elt_str + "read_attributes ("; nb_in_vect = box[index].attr_names.size(); for (i = 0;i < nb_in_vect;i++) { elt_str = elt_str + box[index].attr_names[i]; if (i != nb_in_vect - 1) elt_str = elt_str + ", "; } elt_str = elt_str + ") from "; add_source(index); break; case Op_Write_Attr : elt_str = elt_str + "write_attributes ("; nb_in_vect = box[index].attr_names.size(); for (i = 0;i < nb_in_vect;i++) { elt_str = elt_str + box[index].attr_names[i]; if (i != nb_in_vect - 1) elt_str = elt_str + ", "; } elt_str = elt_str + ") "; break; case Op_Write_Attr_3 : elt_str = elt_str + "write_attributes_3 ("; nb_in_vect = box[index].attr_names.size(); for (i = 0;i < nb_in_vect;i++) { elt_str = elt_str + box[index].attr_names[i]; if (i != nb_in_vect - 1) elt_str = elt_str + ", "; } elt_str = elt_str + ") "; break; case Op_Command_inout_2 : elt_str = elt_str + "command_inout_2 (cmd = " + box[index].cmd_name + ") from "; add_source(index); break; case Op_Command_list_2 : elt_str = elt_str + "command_list_query_2 "; break; case Op_Command_2 : elt_str = elt_str + "command_query_2 "; break; case Op_Get_Attr_Config_2 : elt_str = elt_str + "get_attribute_config_2 "; break; case Op_Read_Attr_2 : elt_str = elt_str + "read_attributes_2 ("; nb_in_vect = box[index].attr_names.size(); for (i = 0;i < nb_in_vect;i++) { elt_str = elt_str + box[index].attr_names[i]; if (i != nb_in_vect - 1) elt_str = elt_str + ", "; } elt_str = elt_str + ") from "; add_source(index); break; case Op_Read_Attr_3 : elt_str = elt_str + "read_attributes_3 ("; nb_in_vect = box[index].attr_names.size(); for (i = 0;i < nb_in_vect;i++) { elt_str = elt_str + box[index].attr_names[i]; if (i != nb_in_vect - 1) elt_str = elt_str + ", "; } elt_str = elt_str + ") from "; add_source(index); break; case Op_Command_inout_history_2 : elt_str = elt_str + "command_inout_history_2 "; break; case Op_Read_Attr_history_2 : elt_str = elt_str + "read_attribute_history_2 "; break; case Op_Read_Attr_history_3 : elt_str = elt_str + "read_attribute_history_3 "; break; case Op_Info_3 : elt_str = elt_str + "info_3 "; break; case Op_Get_Attr_Config_3 : elt_str = elt_str + "get_attribute_config_3 "; break; case Op_Set_Attr_Config_3 : elt_str = elt_str + "set_attribute_config_3 "; break; case Op_Read_Attr_history_4 : elt_str = elt_str + "read_attribute_history_4 "; break; case Op_Command_inout_history_4 : elt_str = elt_str + "command_inout_history_4 "; break; case Op_Command_inout_4 : elt_str = elt_str + "command_inout_4 (cmd = " + box[index].cmd_name + ") from "; add_source(index); break; case Op_Read_Attr_4 : elt_str = elt_str + "read_attributes_4 ("; nb_in_vect = box[index].attr_names.size(); for (i = 0;i < nb_in_vect;i++) { elt_str = elt_str + box[index].attr_names[i]; if (i != nb_in_vect - 1) elt_str = elt_str + ", "; } elt_str = elt_str + ") from "; add_source(index); break; case Op_Write_Attr_4 : elt_str = elt_str + "write_attributes_4 ("; nb_in_vect = box[index].attr_names.size(); for (i = 0;i < nb_in_vect;i++) { elt_str = elt_str + box[index].attr_names[i]; if (i != nb_in_vect - 1) elt_str = elt_str + ", "; } elt_str = elt_str + ") "; break; case Op_Set_Attr_Config_4 : elt_str = elt_str + "set_attribute_config_4 "; break; case Op_Write_Read_Attributes_4 : elt_str = elt_str + "write_read_attributes_4 ("; nb_in_vect = box[index].attr_names.size(); for (i = 0;i < nb_in_vect;i++) { elt_str = elt_str + box[index].attr_names[i]; if (i != nb_in_vect - 1) elt_str = elt_str + ", "; } elt_str = elt_str + ") "; break; case Op_Unknown : elt_str = elt_str + "unknown operation !!!!!"; return; } } else if (box[index].req_type == Req_Attribute) { elt_str = elt_str + "Attribute "; switch (box[index].attr_type) { case Attr_Name : elt_str = elt_str + "name "; break; case Attr_Description : elt_str = elt_str + "description "; break; case Attr_Status : elt_str = elt_str + "status "; break; case Attr_State : elt_str = elt_str + "state "; break; case Attr_AdmName : elt_str = elt_str + "adm_name "; break; case Attr_Unknown : elt_str = elt_str + "unknown attribute !!!!!"; return; } } else { elt_str = elt_str + "Unknown CORBA request type !!!!!"; return; } // // Add client host name. // Extract only IP numbers from the omni address format (giop:tcp:xx.yy.zz.kk:port) // Return in case of badly formed address // if ((box[index].host_ip_str[0] != '\0') && (box[index].host_ip_str[0] != 'p') && (box[index].host_ip_str[5] != 'u') && (box[index].host_ip_str[0] != 'i')) { bool ipv6=false; string omni_addr = box[index].host_ip_str; string::size_type pos; if ((pos = omni_addr.find(':')) == string::npos) return; pos++; if ((pos = omni_addr.find(':',pos)) == string::npos) return; pos++; string ip_str = omni_addr.substr(pos); if (ip_str[0] == '[') ipv6 = true; string full_ip_str; if (ipv6 == false) { if ((pos = ip_str.find(':')) == string::npos) return; full_ip_str = ip_str.substr(0,pos); } else { if ((pos = ip_str.find(':')) == string::npos) return; pos++; if ((pos = ip_str.find(':',pos)) == string::npos) return; pos++; if ((pos = ip_str.find(':',pos)) == string::npos) return; pos++; string tmp_ip = ip_str.substr(pos); if ((pos = tmp_ip.find(']')) == string::npos) return; full_ip_str = tmp_ip.substr(0,pos); } if ((pos = full_ip_str.find('.')) == string::npos) return; string ip1_str = full_ip_str.substr(0,pos); string::size_type old_pos; pos++; old_pos = pos; if ((pos = full_ip_str.find('.',pos)) == string::npos) return; string ip2_str = full_ip_str.substr(old_pos,pos - old_pos); pos++; old_pos = pos; if ((pos = full_ip_str.find('.',pos)) == string::npos) return; string ip3_str = full_ip_str.substr(old_pos,pos - old_pos); pos++; string ip4_str = full_ip_str.substr(pos); // // Finally, get host name // struct sockaddr_in si; si.sin_family = AF_INET; si.sin_port = 0; #ifdef _TG_WINDOWS_ int slen = sizeof(si); WSAStringToAddress((char *)full_ip_str.c_str(),AF_INET,NULL,(SOCKADDR *)&si,&slen); #else inet_pton(AF_INET,full_ip_str.c_str(),&si.sin_addr); #endif char host[512]; int res = getnameinfo((const sockaddr *)&si,sizeof(si),host,512,0,0,0); #ifdef _TG_WINDOWS_ for (int i = 0;i < ::strlen(host);i++) host[i] = ::tolower(host[i]); #endif if (res == 0) { elt_str = elt_str + "requested from "; elt_str = elt_str + host; } else { elt_str = elt_str + "requested from "; elt_str = elt_str + full_ip_str; } // // Add client identification if available // if (box[index].client_ident == true) { if (box[index].client_lang == Tango::CPP) { elt_str = elt_str + " (CPP/Python client with PID "; TangoSys_MemStream o; o << box[index].client_pid; elt_str = elt_str + o.str() + ")"; } else { elt_str = elt_str + " (Java client with main class "; elt_str = elt_str + box[index].java_main_class + ")"; } } } else if (box[index].host_ip_str[5] == 'u') { Tango::Util *tg = Tango::Util::instance(); elt_str = elt_str + "requested from " + tg->get_host_name(); // // Add client identification if available // if (box[index].client_ident == true) { if (box[index].client_lang == Tango::CPP) { elt_str = elt_str + " (CPP/Python client with PID "; TangoSys_MemStream o; o << box[index].client_pid; elt_str = elt_str + o.str() + ")"; } else { elt_str = elt_str + " (Java client with main class "; elt_str = elt_str + box[index].java_main_class + ")"; } } } else if (box[index].host_ip_str[0] == 'p') { elt_str = elt_str + "requested from polling"; } else if (box[index].host_ip_str[0] == 'i') { elt_str = elt_str + "requested during device server process init sequence"; } return; } //+------------------------------------------------------------------------- // // method : BlackBox::add_source // // description : Read black box element as strings. The newest element // is return in the first position // // argument : in : - index : The number of element to read // //-------------------------------------------------------------------------- void BlackBox::add_source(long index) { switch (box[index].source) { case DEV : elt_str = elt_str + "device "; break; case CACHE : elt_str = elt_str + "cache "; break; case CACHE_DEV : elt_str = elt_str + "cache_device "; break; default : elt_str = elt_str + "unknown source (!) "; break; } } //+------------------------------------------------------------------------- // // method : BlackBox::read // // description : Read black box element as strings. The newest element // is return in the first position // // argument : in : - index : The number of element to read // //-------------------------------------------------------------------------- Tango::DevVarStringArray *BlackBox::read(long wanted_elt) { // // Take mutex // sync.lock(); // // Throw exeception if the wanted element is stupid and if there is no element // stored in the black box // if (wanted_elt <= 0) { sync.unlock(); Except::throw_exception((const char *)API_BlackBoxArgument, (const char *)"Argument to read black box out of range", (const char *)"BlackBox::read"); } if (nb_elt == 0) { sync.unlock(); Except::throw_exception((const char *)API_BlackBoxEmpty, (const char *)"Nothing stored yet in black-box", (const char *)"BlackBox::read"); } // // Limit wanted element to a reasonable value // if (wanted_elt > max_elt) wanted_elt = max_elt; if (wanted_elt > nb_elt) wanted_elt = nb_elt; // // Read black box elements // Tango::DevVarStringArray *ret = NULL; try { ret = new Tango::DevVarStringArray(wanted_elt); ret->length(wanted_elt); long read_index; if (insert_elt == 0) read_index = max_elt - 1; else read_index = insert_elt - 1; for (long i = 0;i < wanted_elt;i++) { build_info_as_str(read_index); (*ret)[i] = elt_str.c_str(); read_index--; if (read_index < 0) read_index = max_elt - 1; } } catch (bad_alloc) { sync.unlock(); Except::throw_exception((const char *)API_MemoryAllocation, (const char *)"Can't allocate memory in server", (const char *)"BlackBox::read"); } // // Release mutex // sync.unlock(); return(ret); } //+------------------------------------------------------------------------- // // method : BlackBox::date_ux_to_str // // description : Convert a UNIX date (number of seconds since EPOCH) // to a string of the following format : // dd/mm/yyyy hh24:mi:ss:xx // // argument : in : - ux_date : The UNIX date in a timeval structure // - str_date : Pointer to char array where the date will // be stored (must be allocated) // //-------------------------------------------------------------------------- void BlackBox::date_ux_to_str(timeval &ux_date,char *str_date) { long i; char month[5]; char unix_date[40]; /* Convert UNIX date to a string in UNIX format */ time_t tmp_val = ux_date.tv_sec; #ifdef _TG_WINDOWS_ ctime_s(unix_date,40,&tmp_val); #else ctime_r(&tmp_val,unix_date); #endif unix_date[strlen(unix_date) - 1] = '\0'; /* Copy day */ for (i = 0;i < 2;i++) str_date[i] = unix_date[i + 8]; str_date[2] = '/'; str_date[3] = '\0'; if (str_date[0] == ' ') str_date[0] = '0'; /* Copy month */ for (i = 0;i < 3;i++) month[i] = unix_date[i + 4]; month[3] = '\0'; switch(month[0]) { case 'J' : if (month[1] == 'u') { if (month[2] == 'n') strcat(str_date,"06/"); else strcat(str_date,"07/"); } else strcat(str_date,"01/"); break; case 'F' : strcat(str_date,"02/"); break; case 'M' : if (month[2] == 'r') strcat(str_date,"03/"); else strcat(str_date,"05/"); break; case 'A' : if (month[1] == 'p') strcat(str_date,"04/"); else strcat(str_date,"08/"); break; case 'S' : strcat(str_date,"09/"); break; case 'O' : strcat(str_date,"10/"); break; case 'N' : strcat(str_date,"11/"); break; case 'D' : strcat(str_date,"12/"); break; } str_date[6] = '\0'; /* Copy year */ strcat(str_date,&(unix_date[20])); str_date[10] = '\0'; /* Copy date remaining */ strcat(str_date," "); for (i = 0;i < 8;i++) str_date[i + 11] = unix_date[i + 11]; str_date[19] = '\0'; /* Add milliseconds */ #ifdef _TG_WINDOWS_ sprintf(&(str_date[19]),":%.2d",(int)(ux_date.tv_usec/10)); #else sprintf(&(str_date[19]),":%.2d",(int)(ux_date.tv_usec/10000)); #endif } //+------------------------------------------------------------------------- // // method : client_addr::client_addr // // description : Copy ctor of the client_addr class // //-------------------------------------------------------------------------- client_addr::client_addr(const client_addr &rhs) { client_ident = rhs.client_ident; client_lang = rhs.client_lang; client_pid = rhs.client_pid; java_main_class = rhs.java_main_class; java_ident[0] = rhs.java_ident[0]; java_ident[1] = rhs.java_ident[1]; memcpy(client_ip,rhs.client_ip,IP_ADDR_BUFFER_SIZE); } //+------------------------------------------------------------------------- // // method : client_addr::operator=() // // description : Assignement operator of the client_addr class // //-------------------------------------------------------------------------- client_addr & client_addr::operator=(const client_addr &rhs) { client_ident = rhs.client_ident; client_lang = rhs.client_lang; client_pid = rhs.client_pid; java_main_class = rhs.java_main_class; java_ident[0] = rhs.java_ident[0]; java_ident[1] = rhs.java_ident[1]; memcpy(client_ip,rhs.client_ip,IP_ADDR_BUFFER_SIZE); return *this; } //+------------------------------------------------------------------------- // // method : client_addr::operator==() // // description : Equality operator of the client_addr class // //-------------------------------------------------------------------------- bool client_addr::operator==(const client_addr &rhs) { if (client_ident != rhs.client_ident) return false; if (client_lang != rhs.client_lang) return false; else { if (client_lang == Tango::CPP) { if (client_pid != rhs.client_pid) return false; char *tmp = client_ip; const char *rhs_tmp = rhs.client_ip; if (strlen(tmp) != strlen(rhs_tmp)) return false; if (strcmp(tmp,rhs_tmp) != 0) return false; } else { if (java_ident[0] != rhs.java_ident[0]) return false; if (java_ident[1] != rhs.java_ident[1]) return false; } } return true; } //+------------------------------------------------------------------------- // // method : client_addr::operator!=() // // description : Operator of the client_addr class // //-------------------------------------------------------------------------- bool client_addr::operator!=(const client_addr &rhs) { if (client_ident != rhs.client_ident) return true; if (client_lang != rhs.client_lang) return true; else { if (client_lang == Tango::CPP) { if (client_pid != rhs.client_pid) return true; char *tmp = client_ip; const char *rhs_tmp = rhs.client_ip; if (strlen(tmp) != strlen(rhs_tmp)) return true; if (strcmp(tmp,rhs_tmp) != 0) return true; } else { if (java_ident[0] != rhs.java_ident[0]) return true; if (java_ident[1] != rhs.java_ident[1]) return true; } } return false; } //+------------------------------------------------------------------------- // // method : client_addr::client_ip_2_client_name() // // description : Convert client host IP address to client host name // //-------------------------------------------------------------------------- int client_addr::client_ip_2_client_name(string &cl_host_name) const { int ret = 0; string client_ip_str(client_ip); string::size_type pos; if ((pos = client_ip_str.find(':')) == string::npos) ret = -1; else { pos++; if ((pos = client_ip_str.find(':',pos)) == string::npos) ret = -1; else { pos++; string ip_str = client_ip_str.substr(pos); if ((pos = ip_str.find(':')) == string::npos) ret = -1; else { string full_ip_str = ip_str.substr(0,pos); if ((pos = full_ip_str.find('.')) == string::npos) ret = -1; else { string ip1_str = full_ip_str.substr(0,pos); string::size_type old_pos; pos++; old_pos = pos; if ((pos = full_ip_str.find('.',pos)) == string::npos) ret = -1; else { string ip2_str = full_ip_str.substr(old_pos,pos - old_pos); pos++; old_pos = pos; if ((pos = full_ip_str.find('.',pos)) == string::npos) ret = -1 ; else { string ip3_str = full_ip_str.substr(old_pos,pos - old_pos); pos++; string ip4_str = full_ip_str.substr(pos); struct sockaddr_in si; si.sin_family = AF_INET; si.sin_port = 0; #ifdef _TG_WINDOWS_ int slen = sizeof(si); WSAStringToAddress((char *)full_ip_str.c_str(),AF_INET,NULL,(SOCKADDR *)&si,&slen); #else inet_pton(AF_INET,full_ip_str.c_str(),&si.sin_addr); #endif char host[512]; int res = getnameinfo((const sockaddr *)&si,sizeof(si),host,512,0,0,0); if (res == 0) { cl_host_name = host; ret = 0; } else ret = -1; } } } } } } return ret; } //+------------------------------------------------------------------------- // // operator overloading : << // // description : Friend function to ease printing instance of the // client_addr class // //-------------------------------------------------------------------------- ostream &operator<<(ostream &o_str,const client_addr &ca) { if (ca.client_ident == false) o_str << "Client identification not available"; else { if (ca.client_lang == Tango::CPP) { string cl_name; o_str << "CPP or Python client with PID " << ca.client_pid << " from host "; if (ca.client_ip_2_client_name(cl_name) == 0) o_str << cl_name; else o_str << ca.client_ip; } else { o_str << "JAVA client class " << ca.java_main_class << " from host "; string cl_name; if (ca.client_ip_2_client_name(cl_name) == 0) o_str << cl_name; else o_str << ca.client_ip; } } return o_str; } } // End of Tango namespace tango-8.1.2c+dfsg.orig/lib/cpp/server/device_4.cpp0000644000175000017500000005113712205375142020627 0ustar piccapiccastatic const char *RcsId = "$Id: device_4.cpp 22604 2013-05-02 16:12:09Z taurel $"; //+============================================================================ // // file : Device_4.cpp // // description : C++ source code for the DeviceImpl and DeviceClass // classes. These classes // are the root class for all derived Device classes. // They are abstract classes. The DeviceImpl class is the // CORBA servant which is "exported" onto the network and // accessed by the client. // // project : TANGO // // author(s) : E.Taurel // // Copyright (C) : 2004,2005,2006,2007,2008,2009,2010,2011,2012,2013 // European Synchrotron Radiation Facility // BP 220, Grenoble 38043 // FRANCE // // This file is part of Tango. // // Tango 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. // // Tango 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 Tango. If not, see . // // $Revision: 22604 $ // //-============================================================================ #if HAVE_CONFIG_H #include #endif #include #include namespace Tango { //+------------------------------------------------------------------------- // // method : Device_4Impl::Device_4Impl // // description : constructors for the device_impl class from the // class object pointer, the device name, // the description field, the state and the status. // Device_4Impl inherits from DeviceImpl. These constructors // simply call the correct DeviceImpl class // constructor // //-------------------------------------------------------------------------- Device_4Impl::Device_4Impl(DeviceClass *device_class,string &dev_name): Device_3Impl(device_class,dev_name),ext_4(Tango_NullPtr) { ext->idl_version = 4; } Device_4Impl::Device_4Impl(DeviceClass *device_class, string &dev_name, string &desc): Device_3Impl(device_class,dev_name,desc),ext_4(Tango_NullPtr) { ext->idl_version = 4; } Device_4Impl::Device_4Impl(DeviceClass *device_class, string &dev_name,string &desc, Tango::DevState dev_state,string &dev_status): Device_3Impl(device_class,dev_name,desc,dev_state,dev_status),ext_4(Tango_NullPtr) { ext->idl_version = 4; } Device_4Impl::Device_4Impl(DeviceClass *device_class, const char *dev_name, const char *desc, Tango::DevState dev_state, const char *dev_status): Device_3Impl(device_class,dev_name,desc,dev_state,dev_status),ext_4(Tango_NullPtr) { ext->idl_version = 4; } //+------------------------------------------------------------------------- // // method : Device_4Impl::read_attribute_history_4 // // description : CORBA operation to read attribute value history from // the polling buffer. // // argument: in : - name : attribute name // - n : history depth (in record number) // // This method returns a pointer to a DevAttrHistory_4 structure // //-------------------------------------------------------------------------- Tango::DevAttrHistory_4 *Device_4Impl::read_attribute_history_4(const char* name,CORBA::Long n) { TangoMonitor &mon = get_poll_monitor(); AutoTangoMonitor sync(&mon); cout4 << "Device_4Impl::read_attribute_history_4 arrived, requested history depth = " << n << endl; // // Record operation request in black box // blackbox_ptr->insert_op(Op_Read_Attr_history_4); Tango::DevAttrHistory_4 *back = NULL; vector &poll_list = get_poll_obj_list(); long nb_poll = poll_list.size(); // // Check that the device supports this attribute. This method returns an // exception in case of unsupported attribute // Attribute &att = dev_attr->get_attr_by_name(name); string attr_str(name); transform(attr_str.begin(),attr_str.end(),attr_str.begin(),::tolower); // // Check that the wanted attribute is polled. // long j; PollObj *polled_attr = NULL; for (j = 0;j < nb_poll;j++) { if ((poll_list[j]->get_type() == Tango::POLL_ATTR) && (poll_list[j]->get_name() == attr_str)) { polled_attr = poll_list[j]; break; } } if (polled_attr == NULL) { TangoSys_OMemStream o; o << "Attribute " << attr_str << " not polled" << ends; Except::throw_exception((const char *)API_AttrNotPolled, o.str(), (const char *)"Device_4Impl::read_attribute_history_4"); } // // Check that some data is available in cache // if (polled_attr->is_ring_empty() == true) { TangoSys_OMemStream o; o << "No data available in cache for attribute " << attr_str << ends; Except::throw_exception((const char *)API_NoDataYet, o.str(), (const char *)"Device_4Impl::read_attribute_history_4"); } // // Set the number of returned records // long in_buf = polled_attr->get_elt_nb_in_buffer(); if (n > in_buf) n = in_buf; // // Allocate memory for the returned value // try { back = new Tango::DevAttrHistory_4; back->dates.length(n); } catch (bad_alloc) { Except::throw_exception((const char *)API_MemoryAllocation, (const char *)"Can't allocate memory in server", (const char *)"Device_4Impl::read_attribute_history_4"); } // // Init attribute name in the returned structure // back->name = CORBA::string_dup(name); // // Get attribute value history // Trick: To identify the state used as an attribute from a classical attribute with type // DEV_STATE, use DEV_VOID for state as data type. // if (att.get_name_lower() == "state") polled_attr->get_attr_history(n,back,Tango::DEV_VOID); else polled_attr->get_attr_history(n,back,att.get_data_type()); cout4 << "Leaving Device_4Impl::read_attribute_history_4 method" << endl; return back; } //+------------------------------------------------------------------------- // // method : Device_2Impl::command_inout_history_4 // // description : CORBA operation to read command result history from // the polling buffer. // // argument: in : - command : command name // - n : history depth (in record number) // // This method returns a pointer to a DevCmdHistoryList with one // DevCmdHistory structure for each command record // //-------------------------------------------------------------------------- Tango::DevCmdHistory_4 *Device_4Impl::command_inout_history_4(const char* command,CORBA::Long n) { TangoMonitor &mon = get_poll_monitor(); AutoTangoMonitor sync(&mon); cout4 << "Device_4Impl::command_inout_history_4 arrived" << endl; Tango::DevCmdHistory_4 *back = NULL; string cmd_str(command); // // Record operation request in black box // blackbox_ptr->insert_op(Op_Command_inout_history_4); // // Check that device supports this command. Also checks if the device // implements IDL >=3 when state or status history is requested // transform(cmd_str.begin(),cmd_str.end(),cmd_str.begin(),::tolower); check_command_exists(cmd_str); bool status_cmd = false; bool state_cmd = false; long vers = get_dev_idl_version(); if (vers >= 3) { if (cmd_str == "state") state_cmd = true; else if (cmd_str == "status") status_cmd = true; } // // Check that the command is polled // PollObj *polled_cmd = NULL; vector &poll_list = get_poll_obj_list(); unsigned long i; for (i = 0;i < poll_list.size();i++) { if (poll_list[i]->get_name() == cmd_str) { if ((state_cmd == true) || (status_cmd == true)) { if (poll_list[i]->get_type() == Tango::POLL_ATTR) { polled_cmd = poll_list[i]; } } else { if (poll_list[i]->get_type() == Tango::POLL_CMD) { polled_cmd = poll_list[i]; } } } } if (polled_cmd == NULL) { TangoSys_OMemStream o; o << "Command " << cmd_str << " not polled" << ends; Except::throw_exception((const char *)API_CmdNotPolled, o.str(), (const char *)"Device_4Impl::command_inout_history_4"); } // // Check that some data is available in cache // if (polled_cmd->is_ring_empty() == true) { TangoSys_OMemStream o; o << "No data available in cache for command " << cmd_str << ends; Except::throw_exception((const char *)API_NoDataYet, o.str(), (const char *)"Device_4Impl::command_inout_history_4"); } // // Set the number of returned records // long in_buf = polled_cmd->get_elt_nb_in_buffer(); if (n > in_buf) n = in_buf; // // Allocate memory for the returned value // try { back = new Tango::DevCmdHistory_4; back->dates.length(n); } catch (bad_alloc) { Except::throw_exception((const char *)API_MemoryAllocation, (const char *)"Can't allocate memory in server", (const char *)"Device_4Impl::command_inout_history_4"); } // // Get command result history // Warning : Starting with Tango V5 (IDL 3), state and status are polled // as attributes but could also be retrieved as commands. In this case, // retrieved the history as attributes and transfer this as command // if ((state_cmd == true) || (status_cmd == true)) { Tango::DevAttrHistory_4 *back_attr = NULL; try { back_attr = new Tango::DevAttrHistory_4; back_attr->dates.length(n); } catch (bad_alloc) { Except::throw_exception((const char *)API_MemoryAllocation, (const char *)"Can't allocate memory in server", (const char *)"Device_4Impl::command_inout_history_4"); } if (status_cmd == true) { polled_cmd->get_attr_history(n,back_attr,Tango::DEV_STRING); back->dates = back_attr->dates; back->errors = back_attr->errors; back->errors_array = back_attr->errors_array; back->dims = back_attr->r_dims; back->dims_array = back_attr->r_dims_array; back->cmd_type = Tango::DEV_STRING; back->value = back_attr->value; } else { // // Trick: To identify the state used as an attribute from a classical attribute with type // DEV_STATE, use DEV_VOID for state as data type. // polled_cmd->get_attr_history(n,back_attr,Tango::DEV_VOID); back->dates = back_attr->dates; back->errors = back_attr->errors; back->errors_array = back_attr->errors_array; back->dims = back_attr->r_dims; back->dims_array = back_attr->r_dims_array; back->cmd_type = Tango::DEV_STATE; back->value = back_attr->value; } delete back_attr; } else { // // Get command output data type and fill returned structure // string cmd(command); transform(cmd.begin(),cmd.end(),cmd.begin(),::tolower); Tango::CmdArgType cmd_type; vector &cmd_list = device_class->get_command_list(); for (unsigned int loop = 0;loop < cmd_list.size();loop++) { string cmd_name(cmd_list[loop]->get_name()); transform(cmd_name.begin(),cmd_name.end(),cmd_name.begin(),::tolower); if (cmd_name == cmd) { cmd_type = cmd_list[loop]->get_out_type(); break; } } polled_cmd->get_cmd_history(n,back,cmd_type); } cout4 << "Leaving Device_4Impl::command_inout_history_4 method" << endl; return back; } //+------------------------------------------------------------------------- // // method : Device_4Impl::command_inout_4 // // description : Method called for each command_inout operation executed // from any client on a Tango device version 4. // //-------------------------------------------------------------------------- CORBA::Any *Device_4Impl::command_inout_4(const char *in_cmd, const CORBA::Any &in_data, Tango::DevSource source, const Tango::ClntIdent &cl_id) { cout4 << "Device_4Impl::command_inout_4 arrived, source = " << source << ", command = " << in_cmd << endl; // // Record operation request in black box // blackbox_ptr->insert_cmd_cl_ident(in_cmd,cl_id,4,source); // // Do not check lock validity if State or Status is requested using command // bool state_status_cmd = false; if ((TG_strcasecmp(in_cmd,"state") == 0) || (TG_strcasecmp(in_cmd,"status") == 0)) state_status_cmd = true; // // Check if the device is locked and if it is valid // If the lock is not valid any more, clear it // if (state_status_cmd == false) { check_lock("command_inout4",in_cmd); } // // Call the Device_2Impl command_inout // ext->store_in_bb = false; return (command_inout_2(in_cmd,in_data,source)); } //+------------------------------------------------------------------------- // // method : Device_4Impl::read_attributes_4 // // description : Method called for each read_attributes operation executed // from any client on a Tango device version 4. // //-------------------------------------------------------------------------- Tango::AttributeValueList_4* Device_4Impl::read_attributes_4(const Tango::DevVarStringArray& names, Tango::DevSource source,const Tango::ClntIdent &cl_id) { cout4 << "Device_4Impl::read_attributes_4 arrived for dev " << get_name() << ", att[0] = " << names[0] << endl; // // Record operation request in black box // if (ext->store_in_bb == true) blackbox_ptr->insert_attr(names,cl_id,4,source); ext->store_in_bb = true; // // Build a sequence with the names of the attribute to be read. // This is necessary in case of the "AllAttr" shortcut is used // If all attributes are wanted, build this list // unsigned long nb_names = names.length(); unsigned long nb_dev_attr = dev_attr->get_attr_nb(); Tango::DevVarStringArray real_names(nb_names); unsigned long i; if (nb_names == 1) { string att_name(names[0]); if (att_name == AllAttr) { real_names.length(nb_dev_attr); for (i = 0;i < nb_dev_attr;i++) { real_names[i] = dev_attr->get_attr_by_ind(i).get_name().c_str(); } } else { real_names = names; } } else { real_names = names; } nb_names = real_names.length(); // // Allocate memory for the AttributeValue structures // Tango::AttributeValueList_4 *back; Tango::AttributeValueList_3 *back3 = NULL; try { Tango::AttributeValue_4 *l_back = new Tango::AttributeValue_4 [nb_names]; back = new Tango::AttributeValueList_4(nb_names,nb_names,l_back,true); for (unsigned long loop = 0;loop < nb_names;loop++) (*back)[loop].value.union_no_data(true); } catch (bad_alloc) { Except::throw_exception((const char *)API_MemoryAllocation, (const char *)"Can't allocate memory in server", (const char *)"Device_4Impl::read_attributes_4"); } // // If the source parameter specifies device, call the read_attributes method // which does not throw exception except for major fault (cant allocate // memory,....) // vector idx_in_back; if (source == Tango::DEV) { try { AutoTangoMonitor sync(this); read_attributes_no_except(real_names,back3,back,false,idx_in_back); } catch (...) { delete back; throw; } } else if (source == Tango::CACHE) { try { TangoMonitor &mon = get_poll_monitor(); AutoTangoMonitor sync(&mon); read_attributes_from_cache(real_names,back3,back); } catch (...) { delete back; throw; } } else { // // It must be now CACHE_DEVICE (no other choice), first try to get // values from cache // try { TangoMonitor &mon = get_poll_monitor(); AutoTangoMonitor sync(&mon); read_attributes_from_cache(real_names,back3,back); } catch (...) { delete back; throw; } // // Now, build the list of attributes which it was not possible // to get their value from cache // Tango::DevVarStringArray names_from_device(nb_names); long nb_attr = 0; for (i = 0;i < nb_names;i++) { long nb_err = (*back)[i].err_list.length(); if (nb_err != 0) { nb_err--; if ((strcmp((*back)[i].err_list[nb_err].reason,API_AttrNotPolled) == 0) || (strcmp((*back)[i].err_list[nb_err].reason,API_NoDataYet) == 0) || (strcmp((*back)[i].err_list[nb_err].reason,API_NotUpdatedAnyMore) == 0) || (strcmp((*back)[i].err_list[nb_err].origin,"DServer::add_obj_polling") == 0)) { nb_attr++; names_from_device.length(nb_attr); names_from_device[nb_attr - 1] = real_names[i]; idx_in_back.push_back(i); (*back)[i].err_list.length(0); } } } if (nb_attr != 0) { // // Try to get their values from device // try { AutoTangoMonitor sync(this); read_attributes_no_except(names_from_device,back3,back,true,idx_in_back); } catch (...) { delete back; throw; } } } return back; } //+------------------------------------------------------------------------- // // method : Device_4Impl::write_attributes_4 // // description : CORBA operation to write attribute(s) value // // argument: in : - values: The new attribute(s) value to be set. // //-------------------------------------------------------------------------- void Device_4Impl::write_attributes_4(const Tango::AttributeValueList_4 & values, const Tango::ClntIdent &cl_id) { AutoTangoMonitor sync(this,true); cout4 << "Device_4Impl::write_attributes_4 arrived" << endl; // // Record operation request in black box // if (ext->store_in_bb == true) blackbox_ptr->insert_attr(values,cl_id,4); ext->store_in_bb = true; // // Check if the device is locked and by who // check_lock("write_attributes_4"); // // Call the Device_3Impl write_attributes // return write_attributes_34(NULL,&values); } //+------------------------------------------------------------------------- // // method : Device_4Impl::set_attribute_config_4 // // description : CORBA operation to set attribute configuration locally // and in the Tango database // // argument: in : - new_conf: The new attribute(s) configuration. One // AttributeConfig structure is needed for each // attribute to update // //-------------------------------------------------------------------------- void Device_4Impl::set_attribute_config_4(const Tango::AttributeConfigList_3& new_conf, const Tango::ClntIdent &cl_id) { AutoTangoMonitor sync(this,true); cout4 << "Device_4Impl::set_attribute_config_4 arrived" << endl; // // The attribute conf. is protected by two monitors. One protects access between // get and set attribute conf. The second one protects access between set and // usage. This is the classical device monitor // TangoMonitor &mon1 = get_att_conf_monitor(); AutoTangoMonitor sync1(&mon1); // // Record operation request in black box // blackbox_ptr->insert_op(Op_Set_Attr_Config_4,cl_id); // // Check if the device is locked and by who // check_lock("set_attribute_config_4"); // // Call the Device_3Impl set_attribute_config // ext->store_in_bb = false; return set_attribute_config_3(new_conf); } //+------------------------------------------------------------------------- // // method : Device_4Impl::write_read_attributes_4 // // description : CORBA operation to write then read attribute(s) value // Nowadays, it is possible to write then read attribute for // only 1 attribute at a time even if the IDL is written for // several attribute // // argument: in : - values: The new attributes value to be set. // //-------------------------------------------------------------------------- Tango::AttributeValueList_4* Device_4Impl::write_read_attributes_4(const Tango::AttributeValueList_4& values, const Tango::ClntIdent &cl_id) { AutoTangoMonitor sync(this,true); cout4 << "Device_4Impl::write_read_attributes_4 arrived" << endl; // // Record operation request in black box // blackbox_ptr->insert_wr_attr(values,cl_id,4); // // Check if the device is locked and by who // check_lock("write_read_attributes_4"); // // Check the attribute write type (only READ_WRITE or READ_WITH_WRITE allowed) // Tango::Attribute &att = dev_attr->get_attr_by_name(values[0].name); Tango::AttrWriteType awt = att.get_writable(); if ((awt == Tango::READ) || (awt == Tango::WRITE)) { TangoSys_OMemStream o; o << "Attribute " << values[0].name << " is not a READ_WRITE or READ_WITH_WRITE attribute" << ends; Except::throw_exception((const char *)API_AttrNotWritable,o.str(), (const char *)"Device_4Impl::write_read_attribute_4"); } // // First, write the attribute // ext->store_in_bb = false; write_attributes_4(values,cl_id); // // Now, read the attribute // Tango::DevVarStringArray att_name(1); att_name.length(1); att_name[0] = CORBA::string_dup(values[0].name); Tango::ClntIdent dummy_cl_id; Tango::CppClntIdent cci = 0; dummy_cl_id.cpp_clnt(cci); ext->store_in_bb = false; Tango::AttributeValueList_4 *read_val_ptr = read_attributes_4(att_name,Tango::DEV,dummy_cl_id); return read_val_ptr; } } // End of Tango namespace tango-8.1.2c+dfsg.orig/lib/cpp/server/pollring.h0000644000175000017500000001414212205375142020433 0ustar piccapicca//============================================================================= // // file : PollRing.h // // description : Include for the PollRing object. This class implements // the polling ring buffer. Command result or attribute // values are stored in this buffer manages as a ring // buffer. // // project : TANGO // // author(s) : E.Taurel // // Copyright (C) : 2004,2005,2006,2007,2008,2009,2010,2011,2012,2013 // European Synchrotron Radiation Facility // BP 220, Grenoble 38043 // FRANCE // // This file is part of Tango. // // Tango 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. // // Tango 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 Tango. If not, see . // // $Revision: 22213 $ // //============================================================================= #ifndef _POLLRING_H #define _POLLRING_H #include namespace Tango { //============================================================================= // // The RingElt class // // description : Class to store all the necessary information which will // be stored and returned to client on request // //============================================================================= class RingElt { public: RingElt(); CORBA::Any *cmd_result; Tango::AttributeValueList *attr_value; Tango::AttributeValueList_3 *attr_value_3; Tango::AttributeValueList_4 *attr_value_4; Tango::DevFailed *except; struct timeval when; }; inline bool operator<(const RingElt &,const RingElt &) { return true; } inline bool operator==(const RingElt &,const RingElt &) { return true; } //============================================================================= // // The PollRing class // // description : Class to implement the ring buffer itself. This is mainly // a vector of RingElt managed as a circular buffer // //============================================================================= class PollRing { public: PollRing(); PollRing(long); ~PollRing(); void insert_data(CORBA::Any *,struct timeval &); void insert_data(Tango::AttributeValueList *,struct timeval &); void insert_data(Tango::AttributeValueList_3 *,struct timeval &); void insert_data(Tango::AttributeValueList_4 *,struct timeval &,bool); void insert_except(Tango::DevFailed *,struct timeval &); void force_copy_data(Tango::AttributeValueList_4 *); void get_delta_t(vector &,long nb); struct timeval get_last_insert_date(); bool is_empty() {if (nb_elt == 0) return true;else return false;} bool is_last_an_error(); bool is_last_cmd_an_error(); bool is_last_attr_an_error(); Tango::DevFailed *get_last_except(); Tango::DevErrorList &get_last_attr_error(); CORBA::Any *get_last_cmd_result(); Tango::AttributeValue &get_last_attr_value(); Tango::AttributeValue_3 &get_last_attr_value_3(); Tango::AttributeValue_4 &get_last_attr_value_4(); long get_nb_elt() {return nb_elt;} void get_cmd_history(long,Tango::DevCmdHistoryList *); void get_cmd_history(long,Tango::DevCmdHistory_4 *,Tango::CmdArgType &); void get_attr_history(long,Tango::DevAttrHistoryList *,long); void get_attr_history(long,Tango::DevAttrHistoryList_3 *,long); void get_attr_history(long,Tango::DevAttrHistory_4 *,long); void get_attr_history_43(long,Tango::DevAttrHistoryList_3 *,long); private: void inc_indexes(); vector ring; long insert_elt; long nb_elt; long max_elt; }; #define ADD_ELT_DATA_TO_GLOBAL_SEQ(GLOB,ELT,IND) \ {\ unsigned int elt_data_length = ELT->length(); \ for (unsigned int k = 0;k < elt_data_length;k++) \ (*GLOB)[IND + k] = (*ELT)[k]; \ IND = IND + elt_data_length; \ } #define ADD_ELT_DATA_TO_GLOBAL_SEQ_BY_REF(GLOB,ELT,IND) \ {\ unsigned int elt_data_length = ELT.length(); \ for (unsigned int k = 0;k < elt_data_length;k++) \ GLOB[IND + k] = ELT[k]; \ IND = IND + elt_data_length; \ } #define ADD_ELT_DATA_TO_GLOBAL_SEQ_BY_PTR_REF(GLOB,ELT,IND) \ {\ unsigned int elt_data_length = ELT.length(); \ for (unsigned int k = 0;k < elt_data_length;k++) \ (*GLOB)[IND + k] = ELT[k]; \ IND = IND + elt_data_length; \ } #define MANAGE_DIM_ARRAY(LENGTH) \ if (last_dim.dim_x == LENGTH) \ { \ ptr->dims_array[dims_length - 2].nb_elt++; \ } \ else \ { \ last_dim.dim_x = LENGTH; \ last_dim.dim_y = 0; \ ptr->dims.length(dims_length); \ ptr->dims[dims_length - 1] = last_dim; \ ptr->dims_array.length(dims_length); \ ptr->dims_array[dims_length - 1].start = n - (i + 1); \ ptr->dims_array[dims_length - 1].nb_elt = 1; \ dims_length++; \ } #define ADD_SIMPLE_DATA_TO_GLOBAL_SEQ(GLOB,ELT,IND) \ (*GLOB)[IND] = ELT; \ IND = IND + 1; #define MANAGE_DIM_SIMPLE() \ if (last_dim.dim_x == 1) \ { \ ptr->dims_array[dims_length - 2].nb_elt++; \ } \ else \ { \ last_dim.dim_x = 1; \ last_dim.dim_y = 0; \ ptr->dims.length(dims_length); \ ptr->dims[dims_length - 1] = last_dim; \ ptr->dims_array.length(dims_length); \ ptr->dims_array[dims_length - 1].start = n - (i + 1); \ ptr->dims_array[dims_length - 1].nb_elt = 1; \ dims_length++; \ } #define MANAGE_DIM_ARRAY_SEQ(LENGTH_STR,LENGTH_NUM) \ if ((last_dim.dim_x == LENGTH_STR) && (last_dim.dim_y == LENGTH_NUM))\ { \ ptr->dims_array[dims_length - 2].nb_elt++; \ } \ else \ { \ last_dim.dim_x = LENGTH_STR; \ last_dim.dim_y = LENGTH_NUM; \ ptr->dims.length(dims_length); \ ptr->dims[dims_length - 1] = last_dim; \ ptr->dims_array.length(dims_length); \ ptr->dims_array[dims_length - 1].start = n - (i + 1); \ ptr->dims_array[dims_length - 1].nb_elt = 1; \ dims_length++; \ } } // End of Tango namespace #endif /* _POLLRING_ */ tango-8.1.2c+dfsg.orig/lib/cpp/server/command.cpp0000644000175000017500000007102612205375142020562 0ustar piccapiccastatic const char *RcsId = "$Id: command.cpp 22213 2013-03-07 14:32:56Z taurel $\n$Name$"; //+============================================================================ // // file : Command.cpp // // description : C++ source code for the Command and templCommand classes. // The Command class is the root class for all derived // Command classes. The TemplCommand class is a template // command class use for command which does take input // nor outout parameters. // // project : TANGO // // author(s) : A.Gotz + E.Taurel // // Copyright (C) : 2004,2005,2006,2007,2008,2009,2010,2011,2012,2013 // European Synchrotron Radiation Facility // BP 220, Grenoble 38043 // FRANCE // // This file is part of Tango. // // Tango 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. // // Tango 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 Tango. If not, see . // // $Revision: 22213 $ // //-============================================================================ #if HAVE_CONFIG_H #include #endif #include #include namespace Tango { //+------------------------------------------------------------------------- // // method : Command::Command // // description : constructors for abstract class Command // //-------------------------------------------------------------------------- Command::Command(const char *s, Tango::CmdArgType in, Tango::CmdArgType out) :name(s),in_type(in),out_type(out),ext(new CommandExt) { lower_name = name; transform(lower_name.begin(),lower_name.end(),lower_name.begin(),::tolower); } Command::Command(string &s, Tango::CmdArgType in, Tango::CmdArgType out) :name(s),in_type(in),out_type(out),ext(new CommandExt) { lower_name = name; transform(lower_name.begin(),lower_name.end(),lower_name.begin(),::tolower); } Command::Command(const char *s, Tango::CmdArgType in, Tango::CmdArgType out, const char *in_desc, const char *out_desc) :name(s),in_type(in),out_type(out),ext(new CommandExt) { if (in_desc != NULL) in_type_desc = in_desc; if (out_desc != NULL) out_type_desc = out_desc; lower_name = name; transform(lower_name.begin(),lower_name.end(),lower_name.begin(),::tolower); } Command::Command(string &s, Tango::CmdArgType in, Tango::CmdArgType out, string &in_desc, string &out_desc) :name(s),in_type(in),out_type(out), in_type_desc(in_desc),out_type_desc(out_desc),ext(new CommandExt) { lower_name = name; transform(lower_name.begin(),lower_name.end(),lower_name.begin(),::tolower); } Command::Command(const char *s, Tango::CmdArgType in, Tango::CmdArgType out, Tango::DispLevel level) :name(s),in_type(in),out_type(out),ext(new CommandExt(level)) { lower_name = name; transform(lower_name.begin(),lower_name.end(),lower_name.begin(),::tolower); } Command::Command(string &s, Tango::CmdArgType in, Tango::CmdArgType out, Tango::DispLevel level) :name(s),in_type(in),out_type(out),ext(new CommandExt(level)) { lower_name = name; transform(lower_name.begin(),lower_name.end(),lower_name.begin(),::tolower); } Command::Command(const char *s, Tango::CmdArgType in, Tango::CmdArgType out, const char *in_desc, const char *out_desc, Tango::DispLevel level) :name(s),in_type(in),out_type(out),ext(new CommandExt(level)) { if (in_desc != NULL) in_type_desc = in_desc; if (out_desc != NULL) out_type_desc = out_desc; lower_name = name; transform(lower_name.begin(),lower_name.end(),lower_name.begin(),::tolower); } Command::Command(string &s, Tango::CmdArgType in, Tango::CmdArgType out, string &in_desc, string &out_desc, Tango::DispLevel level) :name(s),in_type(in),out_type(out), in_type_desc(in_desc),out_type_desc(out_desc),ext(new CommandExt(level)) { lower_name = name; transform(lower_name.begin(),lower_name.end(),lower_name.begin(),::tolower); } //+---------------------------------------------------------------------------- // // method : Command::extract() // // description : Command extract methods. These are very simple methods // but overloaded many times for all Tango types. // //----------------------------------------------------------------------------- void Command::throw_bad_type(const char *type) { TangoSys_OMemStream o; o << "Incompatible command argument type, expected type is : Tango::" << type << ends; Except::throw_exception((const char *)API_IncompatibleCmdArgumentType, o.str(), (const char *)"Command::extract()"); } void Command::extract(const CORBA::Any &in,Tango::DevBoolean &data) { if ((in >>= CORBA::Any::to_boolean(data)) == false) throw_bad_type("DevBoolean"); } void Command::extract(const CORBA::Any &in,Tango::DevShort &data) { if ((in >>= data) == false) throw_bad_type("DevShort"); } void Command::extract(const CORBA::Any &in,Tango::DevLong &data) { if ((in >>= data) == false) throw_bad_type("DevLong"); } void Command::extract(const CORBA::Any &in,Tango::DevLong64 &data) { if ((in >>= data) == false) throw_bad_type("DevLong64"); } void Command::extract(const CORBA::Any &in,Tango::DevFloat &data) { if ((in >>= data) == false) throw_bad_type("DevFloat"); } void Command::extract(const CORBA::Any &in,Tango::DevDouble &data) { if ((in >>= data) == false) throw_bad_type("DevDouble"); } void Command::extract(const CORBA::Any &in,Tango::DevUShort &data) { if ((in >>= data) == false) throw_bad_type("DevUShort"); } void Command::extract(const CORBA::Any &in,Tango::DevULong &data) { if ((in >>= data) == false) throw_bad_type("DevULong"); } void Command::extract(const CORBA::Any &in,Tango::DevULong64 &data) { if ((in >>= data) == false) throw_bad_type("DevULong64"); } void Command::extract(const CORBA::Any &in,Tango::DevString &data) { if ((in >>= const_cast(data)) == false) throw_bad_type("DevString"); } void Command::extract(const CORBA::Any &in,const char *&data) { if ((in >>= data) == false) throw_bad_type("ConstDevString"); } void Command::extract(const CORBA::Any &in,const Tango::DevVarCharArray *&data) { if ((in >>= data) == false) throw_bad_type("DevVarCharArray"); } void Command::extract(const CORBA::Any &in,const Tango::DevVarShortArray *&data) { if ((in >>= data) == false) throw_bad_type("DevVarShortArray"); } void Command::extract(const CORBA::Any &in,const Tango::DevVarLongArray *&data) { if ((in >>= data) == false) throw_bad_type("DevVarLongArray"); } void Command::extract(const CORBA::Any &in,const Tango::DevVarLong64Array *&data) { if ((in >>= data) == false) throw_bad_type("DevVarLong64Array"); } void Command::extract(const CORBA::Any &in,const Tango::DevVarFloatArray *&data) { if ((in >>= data) == false) throw_bad_type("DevVarFloatArray"); } void Command::extract(const CORBA::Any &in,const Tango::DevVarDoubleArray *&data) { if ((in >>= data) == false) throw_bad_type("DevVarDoubleArray"); } void Command::extract(const CORBA::Any &in,const Tango::DevVarUShortArray *&data) { if ((in >>= data) == false) throw_bad_type("DevVarUShortArray"); } void Command::extract(const CORBA::Any &in,const Tango::DevVarULongArray *&data) { if ((in >>= data) == false) throw_bad_type("DevVarULongArray"); } void Command::extract(const CORBA::Any &in,const Tango::DevVarULong64Array *&data) { if ((in >>= data) == false) throw_bad_type("DevVarULong64Array"); } void Command::extract(const CORBA::Any &in,const Tango::DevVarStringArray *&data) { if ((in >>= data) == false) throw_bad_type("DevVarStringArray"); } void Command::extract(const CORBA::Any &in,const Tango::DevVarLongStringArray *&data) { if ((in >>= data) == false) throw_bad_type("DevVarLongStringArray"); } void Command::extract(const CORBA::Any &in,const Tango::DevVarDoubleStringArray *&data) { if ((in >>= data) == false) throw_bad_type("DevVarDoubleStringArray"); } void Command::extract(const CORBA::Any &in,Tango::DevState &data) { if ((in >>= data) == false) throw_bad_type("DevState"); } void Command::extract(const CORBA::Any &in,const Tango::DevEncoded *&data) { if ((in >>= data) == false) throw_bad_type("DevEncoded"); } //+---------------------------------------------------------------------------- // // method : Command::insert() // // description : Command insert methods. These are very simple methods // but overloaded many times for all Tango types. // //----------------------------------------------------------------------------- void Command::alloc_any(CORBA::Any *&any_ptr) { try { any_ptr = new CORBA::Any(); } catch (bad_alloc) { Except::throw_exception((const char *)API_MemoryAllocation, (const char *)"Can't allocate memory in server", (const char *)"Command::alloc_any()"); } } CORBA::Any *Command::insert() { CORBA::Any *out_any; alloc_any(out_any); return out_any; } CORBA::Any *Command::insert(Tango::DevBoolean data) { CORBA::Any *out_any; alloc_any(out_any); CORBA::Any::from_boolean tmp(data); (*out_any) <<= tmp; return out_any; } CORBA::Any *Command::insert(Tango::DevShort data) { CORBA::Any *out_any; alloc_any(out_any); (*out_any) <<= data; return out_any; } CORBA::Any *Command::insert(Tango::DevLong data) { CORBA::Any *out_any; alloc_any(out_any); (*out_any) <<= data; return out_any; } CORBA::Any *Command::insert(Tango::DevLong64 data) { CORBA::Any *out_any; alloc_any(out_any); (*out_any) <<= data; return out_any; } CORBA::Any *Command::insert(Tango::DevFloat data) { CORBA::Any *out_any; alloc_any(out_any); (*out_any) <<= data; return out_any; } CORBA::Any *Command::insert(Tango::DevDouble data) { CORBA::Any *out_any; alloc_any(out_any); (*out_any) <<= data; return out_any; } CORBA::Any *Command::insert(Tango::DevUShort data) { CORBA::Any *out_any; alloc_any(out_any); (*out_any) <<= data; return out_any; } CORBA::Any *Command::insert(Tango::DevULong data) { CORBA::Any *out_any; alloc_any(out_any); (*out_any) <<= data; return out_any; } CORBA::Any *Command::insert(Tango::DevULong64 data) { CORBA::Any *out_any; alloc_any(out_any); (*out_any) <<= data; return out_any; } CORBA::Any *Command::insert(Tango::DevString data) { CORBA::Any *out_any; alloc_any(out_any); (*out_any) <<= data; delete [] data; return out_any; } CORBA::Any *Command::insert(const char *data) { CORBA::Any *out_any; alloc_any(out_any); (*out_any) <<= data; return out_any; } CORBA::Any *Command::insert(Tango::DevVarCharArray &data) { CORBA::Any *out_any; alloc_any(out_any); (*out_any) <<= data; return out_any; } CORBA::Any *Command::insert(Tango::DevVarCharArray *data) { CORBA::Any *out_any; alloc_any(out_any); (*out_any) <<= (*data); delete data; return out_any; } CORBA::Any *Command::insert(Tango::DevVarShortArray &data) { CORBA::Any *out_any; alloc_any(out_any); (*out_any) <<= data; return out_any; } CORBA::Any *Command::insert(Tango::DevVarShortArray *data) { CORBA::Any *out_any; alloc_any(out_any); (*out_any) <<= (*data); delete data; return out_any; } CORBA::Any *Command::insert(Tango::DevVarLongArray &data) { CORBA::Any *out_any; alloc_any(out_any); (*out_any) <<= data; return out_any; } CORBA::Any *Command::insert(Tango::DevVarLongArray *data) { CORBA::Any *out_any; alloc_any(out_any); (*out_any) <<= (*data); delete data; return out_any; } CORBA::Any *Command::insert(Tango::DevVarLong64Array &data) { CORBA::Any *out_any; alloc_any(out_any); (*out_any) <<= data; return out_any; } CORBA::Any *Command::insert(Tango::DevVarLong64Array *data) { CORBA::Any *out_any; alloc_any(out_any); (*out_any) <<= (*data); delete data; return out_any; } CORBA::Any *Command::insert(Tango::DevVarFloatArray &data) { CORBA::Any *out_any; alloc_any(out_any); (*out_any) <<= data; return out_any; } CORBA::Any *Command::insert(Tango::DevVarFloatArray *data) { CORBA::Any *out_any; alloc_any(out_any); (*out_any) <<= (*data); delete data; return out_any; } CORBA::Any *Command::insert(Tango::DevVarDoubleArray &data) { CORBA::Any *out_any; alloc_any(out_any); (*out_any) <<= data; return out_any; } CORBA::Any *Command::insert(Tango::DevVarDoubleArray *data) { CORBA::Any *out_any; alloc_any(out_any); (*out_any) <<= (*data); delete data; return out_any; } CORBA::Any *Command::insert(Tango::DevVarUShortArray &data) { CORBA::Any *out_any; alloc_any(out_any); (*out_any) <<= data; return out_any; } CORBA::Any *Command::insert(Tango::DevVarUShortArray *data) { CORBA::Any *out_any; alloc_any(out_any); (*out_any) <<= (*data); delete data; return out_any; } CORBA::Any *Command::insert(Tango::DevVarULongArray &data) { CORBA::Any *out_any; alloc_any(out_any); (*out_any) <<= data; return out_any; } CORBA::Any *Command::insert(Tango::DevVarULongArray *data) { CORBA::Any *out_any; alloc_any(out_any); (*out_any) <<= (*data); delete data; return out_any; } CORBA::Any *Command::insert(Tango::DevVarULong64Array &data) { CORBA::Any *out_any; alloc_any(out_any); (*out_any) <<= data; return out_any; } CORBA::Any *Command::insert(Tango::DevVarULong64Array *data) { CORBA::Any *out_any; alloc_any(out_any); (*out_any) <<= (*data); delete data; return out_any; } CORBA::Any *Command::insert(Tango::DevVarStringArray &data) { CORBA::Any *out_any; alloc_any(out_any); (*out_any) <<= data; return out_any; } CORBA::Any *Command::insert(Tango::DevVarStringArray *data) { CORBA::Any *out_any; alloc_any(out_any); (*out_any) <<= (*data); delete data; return out_any; } CORBA::Any *Command::insert(Tango::DevVarLongStringArray &data) { CORBA::Any *out_any; alloc_any(out_any); (*out_any) <<= data; return out_any; } CORBA::Any *Command::insert(Tango::DevVarLongStringArray *data) { CORBA::Any *out_any; alloc_any(out_any); (*out_any) <<= (*data); delete data; return out_any; } CORBA::Any *Command::insert(Tango::DevVarDoubleStringArray *data) { CORBA::Any *out_any; alloc_any(out_any); (*out_any) <<= (*data); delete data; return out_any; } CORBA::Any *Command::insert(Tango::DevVarDoubleStringArray &data) { CORBA::Any *out_any; alloc_any(out_any); (*out_any) <<= data; return out_any; } CORBA::Any *Command::insert(Tango::DevState data) { CORBA::Any *out_any; alloc_any(out_any); (*out_any) <<= data; return out_any; } CORBA::Any *Command::insert(Tango::DevEncoded *data) { CORBA::Any *out_any; alloc_any(out_any); (*out_any) <<= (*data); delete data; return out_any; } //+------------------------------------------------------------------------- // // method : TempCommand class constructors // // description : instance constructor // //-------------------------------------------------------------------------- TemplCommand::TemplCommand(const char *s, void (DeviceImpl::*f)()) :exe_ptr(f),ext(Tango_NullPtr) { name = s; allowed_ptr = NULL; in_type = out_type = Tango::DEV_VOID; lower_name = name; transform(lower_name.begin(),lower_name.end(),lower_name.begin(),::tolower); } TemplCommand::TemplCommand(const char *s, void (DeviceImpl::*f)(), bool (DeviceImpl::*a)(const CORBA::Any &)) :exe_ptr(f),ext(Tango_NullPtr),allowed_ptr(a) { name = s; in_type = out_type = Tango::DEV_VOID; lower_name = name; transform(lower_name.begin(),lower_name.end(),lower_name.begin(),::tolower); } TemplCommand::TemplCommand(string &s, void (DeviceImpl::*f)()) :exe_ptr(f),ext(Tango_NullPtr) { name = s; in_type = out_type = Tango::DEV_VOID; allowed_ptr = NULL; lower_name = name; transform(lower_name.begin(),lower_name.end(),lower_name.begin(),::tolower); } TemplCommand::TemplCommand(string &s, void (DeviceImpl::*f)(), bool (DeviceImpl::*a)(const CORBA::Any &)) :exe_ptr(f),ext(Tango_NullPtr),allowed_ptr(a) { name = s; in_type = out_type = Tango::DEV_VOID; lower_name = name; transform(lower_name.begin(),lower_name.end(),lower_name.begin(),::tolower); } TemplCommand::TemplCommand(const char *s, void (DeviceImpl::*f)(), const char *in_desc,const char *out_desc) :exe_ptr(f),ext(Tango_NullPtr) { name = s; if (in_desc != NULL) in_type_desc = in_desc; if (out_desc != NULL) out_type_desc = out_desc; allowed_ptr = NULL; in_type = out_type = Tango::DEV_VOID; lower_name = name; transform(lower_name.begin(),lower_name.end(),lower_name.begin(),::tolower); } TemplCommand::TemplCommand(const char *s, void (DeviceImpl::*f)(), bool (DeviceImpl::*a)(const CORBA::Any &), const char *in_desc,const char *out_desc) :exe_ptr(f),ext(Tango_NullPtr),allowed_ptr(a) { name = s; if (in_desc != NULL) in_type_desc = in_desc; if (out_desc != NULL) out_type_desc = out_desc; in_type = out_type = Tango::DEV_VOID; lower_name = name; transform(lower_name.begin(),lower_name.end(),lower_name.begin(),::tolower); } TemplCommand::TemplCommand(string &s, void (DeviceImpl::*f)(), bool (DeviceImpl::*a)(const CORBA::Any &), string &in_desc,string &out_desc) :exe_ptr(f),ext(Tango_NullPtr),allowed_ptr(a) { name = s; in_type_desc = in_desc; out_type_desc = out_desc; in_type = out_type = Tango::DEV_VOID; lower_name = name; transform(lower_name.begin(),lower_name.end(),lower_name.begin(),::tolower); } TemplCommand::TemplCommand(string &s, void (DeviceImpl::*f)(), string &in_desc,string &out_desc) :exe_ptr(f),ext(Tango_NullPtr) { name = s; in_type_desc = in_desc; out_type_desc = out_desc; in_type = out_type = Tango::DEV_VOID; allowed_ptr = NULL; lower_name = name; transform(lower_name.begin(),lower_name.end(),lower_name.begin(),::tolower); } TemplCommand::TemplCommand(const char *s, void (DeviceImpl::*f)(), Tango::DispLevel level) :exe_ptr(f),ext(Tango_NullPtr) { name = s; allowed_ptr = NULL; in_type = out_type = Tango::DEV_VOID; set_disp_level(level); lower_name = name; transform(lower_name.begin(),lower_name.end(),lower_name.begin(),::tolower); } TemplCommand::TemplCommand(const char *s, void (DeviceImpl::*f)(), bool (DeviceImpl::*a)(const CORBA::Any &), Tango::DispLevel level) :exe_ptr(f),ext(Tango_NullPtr),allowed_ptr(a) { name = s; in_type = out_type = Tango::DEV_VOID; set_disp_level(level); lower_name = name; transform(lower_name.begin(),lower_name.end(),lower_name.begin(),::tolower); } TemplCommand::TemplCommand(string &s, void (DeviceImpl::*f)(), Tango::DispLevel level) :exe_ptr(f),ext(Tango_NullPtr) { name = s; in_type = out_type = Tango::DEV_VOID; allowed_ptr = NULL; set_disp_level(level); lower_name = name; transform(lower_name.begin(),lower_name.end(),lower_name.begin(),::tolower); } TemplCommand::TemplCommand(string &s, void (DeviceImpl::*f)(), bool (DeviceImpl::*a)(const CORBA::Any &), Tango::DispLevel level) :exe_ptr(f),ext(Tango_NullPtr),allowed_ptr(a) { name = s; in_type = out_type = Tango::DEV_VOID; set_disp_level(level); lower_name = name; transform(lower_name.begin(),lower_name.end(),lower_name.begin(),::tolower); } TemplCommand::TemplCommand(const char *s, void (DeviceImpl::*f)(), const char *in_desc,const char *out_desc, Tango::DispLevel level) :exe_ptr(f),ext(Tango_NullPtr) { name = s; if (in_desc != NULL) in_type_desc = in_desc; if (out_desc != NULL) out_type_desc = out_desc; allowed_ptr = NULL; in_type = out_type = Tango::DEV_VOID; set_disp_level(level); lower_name = name; transform(lower_name.begin(),lower_name.end(),lower_name.begin(),::tolower); } TemplCommand::TemplCommand(const char *s, void (DeviceImpl::*f)(), bool (DeviceImpl::*a)(const CORBA::Any &), const char *in_desc,const char *out_desc, Tango::DispLevel level) :exe_ptr(f),ext(Tango_NullPtr),allowed_ptr(a) { name = s; if (in_desc != NULL) in_type_desc = in_desc; if (out_desc != NULL) out_type_desc = out_desc; in_type = out_type = Tango::DEV_VOID; set_disp_level(level); lower_name = name; transform(lower_name.begin(),lower_name.end(),lower_name.begin(),::tolower); } TemplCommand::TemplCommand(string &s, void (DeviceImpl::*f)(), bool (DeviceImpl::*a)(const CORBA::Any &), string &in_desc,string &out_desc, Tango::DispLevel level) :exe_ptr(f),ext(Tango_NullPtr),allowed_ptr(a) { name = s; in_type_desc = in_desc; out_type_desc = out_desc; in_type = out_type = Tango::DEV_VOID; set_disp_level(level); lower_name = name; transform(lower_name.begin(),lower_name.end(),lower_name.begin(),::tolower); } TemplCommand::TemplCommand(string &s, void (DeviceImpl::*f)(), string &in_desc,string &out_desc, Tango::DispLevel level) :exe_ptr(f),ext(Tango_NullPtr) { name = s; in_type_desc = in_desc; out_type_desc = out_desc; in_type = out_type = Tango::DEV_VOID; allowed_ptr = NULL; set_disp_level(level); lower_name = name; transform(lower_name.begin(),lower_name.end(),lower_name.begin(),::tolower); } //+------------------------------------------------------------------------- // // method : set_type // // description : Set the Command class type data according to the type // of the object passed as parameters // // input : - data_type : reference to the type_info object of the parameter // - type : reference to the Command class type data // //-------------------------------------------------------------------------- void TemplCommand::set_type(const type_info &data_type,Tango::CmdArgType &type) { if (data_type == typeid(void)) { cout4 << "Command : " << name << ", Type is void" << endl; type = Tango::DEV_VOID; } else if (data_type == typeid(Tango::DevBoolean)) { cout4 << "Command : " << name << ", Type is a boolean" << endl; type = Tango::DEV_BOOLEAN; } else if (data_type == typeid(Tango::DevShort)) { cout4 << "Command : " << name << ", Type is a short" << endl; type = Tango::DEV_SHORT; } else if (data_type == typeid(Tango::DevLong)) { cout4 << "Command : " << name << ", Type is a long" << endl; type = Tango::DEV_LONG; } else if (data_type == typeid(Tango::DevLong64)) { cout4 << "Command : " << name << ", Type is a long64" << endl; type = Tango::DEV_LONG64; } else if (data_type == typeid(Tango::DevFloat)) { cout4 << "Command : " << name << ", Type is a float" << endl; type = Tango::DEV_FLOAT; } else if (data_type == typeid(Tango::DevDouble)) { cout4 << "Command : " << name << ", Type is a double" << endl; type = Tango::DEV_DOUBLE; } else if (data_type == typeid(Tango::DevUShort)) { cout4 << "Command : " << name << ", Type is an unsigned short" << endl; type = Tango::DEV_USHORT; } else if (data_type == typeid(Tango::DevULong)) { cout4 << "Command : " << name << ", Type is an unsigned long" << endl; type = Tango::DEV_ULONG; } else if (data_type == typeid(Tango::DevULong64)) { cout4 << "Command : " << name << ", Type is an unsigned long64" << endl; type = Tango::DEV_ULONG64; } else if (data_type == typeid(Tango::DevString)) { cout4 << "Command : " << name << ", Type is a string" << endl; type = Tango::DEV_STRING; } else if ((data_type == typeid(Tango::DevVarCharArray)) || (data_type == typeid(const Tango::DevVarCharArray *)) || (data_type == typeid(Tango::DevVarCharArray *))) { cout4 << "Command : " << name << ", Type is a char array" << endl; type = Tango::DEVVAR_CHARARRAY; } else if ((data_type == typeid(Tango::DevVarShortArray)) || (data_type == typeid(const Tango::DevVarShortArray *)) || (data_type == typeid(Tango::DevVarShortArray *))) { cout4 << "Command : " << name << ", Type is a short array" << endl; type = Tango::DEVVAR_SHORTARRAY; } else if ((data_type == typeid(Tango::DevVarLongArray)) || (data_type == typeid(const Tango::DevVarLongArray *)) || (data_type == typeid(Tango::DevVarLongArray *))) { cout4 << "Command : " << name << ", Type is a long array" << endl; type = Tango::DEVVAR_LONGARRAY; } else if ((data_type == typeid(Tango::DevVarLong64Array)) || (data_type == typeid(const Tango::DevVarLong64Array *)) || (data_type == typeid(Tango::DevVarLong64Array *))) { cout4 << "Command : " << name << ", Type is a long64 array" << endl; type = Tango::DEVVAR_LONG64ARRAY; } else if ((data_type == typeid(Tango::DevVarFloatArray)) || (data_type == typeid(const Tango::DevVarFloatArray *)) || (data_type == typeid(Tango::DevVarFloatArray *))) { cout4 << "Command : " << name << ", Type is a float array" << endl; type = Tango::DEVVAR_FLOATARRAY; } else if ((data_type == typeid(Tango::DevVarDoubleArray)) || (data_type == typeid(const Tango::DevVarDoubleArray *)) || (data_type == typeid(Tango::DevVarDoubleArray *))) { cout4 << "Command : " << name << ", Type is a double array" << endl; type = Tango::DEVVAR_DOUBLEARRAY; } else if ((data_type == typeid(Tango::DevVarUShortArray)) || (data_type == typeid(const Tango::DevVarUShortArray *)) || (data_type == typeid(Tango::DevVarUShortArray *))) { cout4 << "Command : " << name << ", Type is a unsigned short array" << endl; type = Tango::DEVVAR_USHORTARRAY; } else if ((data_type == typeid(Tango::DevVarULongArray)) || (data_type == typeid(const Tango::DevVarULongArray *)) || (data_type == typeid(Tango::DevVarULongArray *))) { cout4 << "Command : " << name << ", Type is a unsigned long array" << endl; type = Tango::DEVVAR_ULONGARRAY; } else if ((data_type == typeid(Tango::DevVarULong64Array)) || (data_type == typeid(const Tango::DevVarULong64Array *)) || (data_type == typeid(Tango::DevVarULong64Array *))) { cout4 << "Command : " << name << ", Type is a unsigned long64 array" << endl; type = Tango::DEVVAR_ULONG64ARRAY; } else if ((data_type == typeid(Tango::DevVarStringArray)) || (data_type == typeid(const Tango::DevVarStringArray *)) || (data_type == typeid(Tango::DevVarStringArray *))) { cout4 << "Command : " << name << ", Type is a string array" << endl; type = Tango::DEVVAR_STRINGARRAY; } else if ((data_type == typeid(Tango::DevVarLongStringArray)) || (data_type == typeid(const Tango::DevVarLongStringArray *)) || (data_type == typeid(Tango::DevVarLongStringArray *))) { cout4 << "Command : " << name << ", Type is a long + string array" << endl; type = Tango::DEVVAR_LONGSTRINGARRAY; } else if ((data_type == typeid(Tango::DevVarDoubleStringArray)) || (data_type == typeid(const Tango::DevVarDoubleStringArray *)) || (data_type == typeid(Tango::DevVarDoubleStringArray *))) { cout4 << "Command : " << name << ", Type is a double + string array" << endl; type = Tango::DEVVAR_DOUBLESTRINGARRAY; } else if (data_type == typeid(Tango::DevState)) { cout4 << "Command : " << name << ", Type is a DevState" << endl; type = Tango::DEV_STATE; } else { cout4 << "Command : " << name << ", Unknown type" << endl; TangoSys_OMemStream o; o << "Command " << name << " defined with an unsupported type" << ends; Except::throw_exception((const char *)API_CmdArgumentTypeNotSupported, o.str(),(const char *)"TemplCommand::set_type"); } } //+------------------------------------------------------------------------- // // method : is_allowed // // description : Check if the command is allowed. If the pointer to // DeviceImpl class method "allowed_ptr" is null, the // default mode id used (command always executed). // Otherwise, the method is executed // // input : - dev_ptr : pointer to the device on which the command must be // executed // - in_any : Incoming command data // // This method returns a boolean set to true if the command is allowed // //-------------------------------------------------------------------------- bool TemplCommand::is_allowed(DeviceImpl *dev_ptr,const CORBA::Any &in_any) { if (allowed_ptr == NULL) return true; else return ((dev_ptr->*allowed_ptr)(in_any)); } //+------------------------------------------------------------------------- // // method : execute // // description : Execute the method associated with the command // (stored in the exe_ptr data) // // input : - dev_ptr : pointer to the device on which the command must be // executed // - in_any : Incoming command data // // This method returns a pointer to an CORBA::Any object with the command outing // data. // //-------------------------------------------------------------------------- CORBA::Any *TemplCommand::execute(DeviceImpl *dev_ptr,TANGO_UNUSED(const CORBA::Any &in_any)) { // // Execute the command associated method // (dev_ptr->*exe_ptr)(); return insert(); } } // End of Tango namespace tango-8.1.2c+dfsg.orig/lib/cpp/server/coutappender.cpp0000644000175000017500000000640112205375142021630 0ustar piccapiccastatic const char *RcsId = "$Id: coutappender.cpp 22213 2013-03-07 14:32:56Z taurel $\n$Name$"; //+============================================================================= // // file : coutappender.cpp // // description : // // project : TANGO // // author(s) : N.Leclercq - SOLEIL // // Copyright (C) : 2004,2005,2006,2007,2008,2009,2010,2011,2012,2013 // European Synchrotron Radiation Facility // BP 220, Grenoble 38043 // FRANCE // // This file is part of Tango. // // Tango 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. // // Tango 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 Tango. If not, see . // // $Revision: 22213 $ // // $Log$ // Revision 3.6 2010/09/09 13:44:46 taurel // - Add year 2010 in Copyright notice // // Revision 3.5 2009/01/21 12:49:04 taurel // - Change CopyRights for 2009 // // Revision 3.4 2008/10/06 15:00:36 taurel // - Changed the licensing info from GPL to LGPL // // Revision 3.3 2008/10/03 06:51:36 taurel // - Add some licensing info in each files // // Revision 3.2 2007/04/20 14:40:28 taurel // - Ported to Windows 64 bits x64 architecture // // Revision 3.1 2003/05/28 14:55:08 taurel // Add the include (conditionally) of the include files generated by autoconf // // Revision 3.0 2003/03/25 16:41:57 taurel // Many changes for Tango release 3.0 including // - Added full logging features // - Added asynchronous calls // - Host name of clients now stored in black-box // - Three serialization model in DS // - Fix miscellaneous bugs // - Ported to gcc 3.2 // - Added ApiUtil::cleanup() and destructor methods // - Some internal cleanups // - Change the way how TangoMonitor class is implemented. It's a recursive // mutex // // Revision 2.2 2003/03/11 17:55:48 nleclercq // Switch from log4cpp to log4tango // // Revision 2.1 2003/02/17 14:57:39 taurel // Added the new Tango logging stuff (Thanks Nicolas from Soleil) // //-============================================================================= #if HAVE_CONFIG_H #include #endif #include #if defined(TANGO_HAS_LOG4TANGO) #include namespace Tango { CoutAppender::CoutAppender (const std::string& name) : log4tango::LayoutAppender(name) { //no-op ctor } CoutAppender::~CoutAppender () { //no-op dtor } int CoutAppender::_append (const log4tango::LoggingEvent& event) { #ifdef _TG_WINDOWS_ CoutBuf *dbg_win; try { dbg_win = Util::instance(false)->get_debug_object(); } catch (...) { dbg_win = 0; } if (dbg_win) dbg_win->dbg_out(get_layout().format(event).c_str()); else #endif ::printf("%s\n", get_layout().format(event).c_str()); return 0; } } // namespace tango #endif // TANGO_HAS_LOG4TANGO tango-8.1.2c+dfsg.orig/lib/cpp/server/basiccommand.h0000644000175000017500000000651612205375142021233 0ustar piccapicca//============================================================================= // // file : BasicCommand.h // // description : Include for commands which are implemented in all // classes. Classes for 2 commands are defined here: // DevStatus for the DevStatus command // DevState for the DevState command // All these classes inherits from the Command class // // project : TANGO // // author(s) : A.Gotz + E.Taurel // // Copyright (C) : 2004,2005,2006,2007,2008,2009,2010,2011,2012,2013 // European Synchrotron Radiation Facility // BP 220, Grenoble 38043 // FRANCE // // This file is part of Tango. // // Tango 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. // // Tango 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 Tango. If not, see . // // $Revision: 22213 $ // //============================================================================= #ifndef _BASICCOMMAND_H #define _BASICCOMMAND_H #include namespace Tango { //============================================================================= // // The DevStatusCmd class // // description : Class to implement the DevStatus command. This command // does not take any input argument and return the device // state as a string // //============================================================================= class DevStatusCmd : public Command { public: DevStatusCmd(const char *cmd_name, Tango::CmdArgType in, Tango::CmdArgType out); ~DevStatusCmd() {}; virtual CORBA::Any * execute(DeviceImpl *device,const CORBA::Any &in_any); }; //============================================================================= // // The DevState class // // description : Class to implement the DevState command. This command // does not take any input argument and return the device // state as an enumerated type // //============================================================================= class DevStateCmd : public Command { public: DevStateCmd(const char *cmd_name, Tango::CmdArgType in, Tango::CmdArgType out); ~DevStateCmd() {}; virtual CORBA::Any * execute(DeviceImpl *device,const CORBA::Any &in_any); }; //============================================================================= // // The DevInit class // // description : Class to implement the Init command. This command // does not take any input argument and output argument. // It will call the device delete_device method and its // init_device method. // //============================================================================= class DevInitCmd : public Command { public: DevInitCmd(const char *cmd_name, Tango::CmdArgType in, Tango::CmdArgType out); ~DevInitCmd() {}; virtual CORBA::Any * execute(DeviceImpl *device,const CORBA::Any &in_any); }; } // End of Tango namespace #endif // _BASICCOMMAND_H tango-8.1.2c+dfsg.orig/lib/cpp/server/Makefile.am0000644000175000017500000000660712205375142020477 0ustar piccapiccaSUBDIRS=idl jpeg jpeg_mmx . # We need the ORB to compile and the tango header files to compile INCLUDES = -I$(top_srcdir)/lib/cpp/client \ -I$(top_srcdir)/lib/cpp/log4tango/include \ -I$(top_builddir)/lib/cpp/log4tango/include \ $(ORB_INCLUDE_PREFIX) $(LIBZMQ_CFLAGS) # We're making a shared library with libtool (that's why we use LTLIBRARIES) lib_LTLIBRARIES=libtango.la # We need the libclient to link libtango_la_LIBADD = ../client/libclient.la \ ../log4tango/src/liblog4tango.la \ jpeg/libjpeg.la \ jpeg_mmx/libjpeg_mmx.la \ $(LIBZMQ_LIBS) # We need to set the -version-info for libtool so that libtool will # generate the correct .so version libtango_la_LDFLAGS=-version-info $(VERSION_INFO) AM_CXXFLAGS=-D_TANGO_LIB if DARWIN_ENABLED AM_LDFLAGS=-flat_namespace --disable-dependency-tracking endif # The sources libtango_la_SOURCES = tangoSK.cpp \ tangoDynSK.cpp \ attrdesc.cpp \ attribute.cpp \ attrmanip.cpp \ basiccommand.cpp \ blackbox.cpp \ class_factory.cpp \ classattribute.cpp \ command.cpp \ coutappender.cpp \ dev_event.cpp \ dev_poll.cpp \ device.cpp \ device_2.cpp \ device_3.cpp \ device_4.cpp \ deviceclass.cpp \ devicelog.cpp \ dserver.cpp \ dserverclass.cpp \ dserverlock.cpp \ dserverlog.cpp \ dserverpoll.cpp \ dserversignal.cpp \ encoded_attribute.cpp \ eventcmds.cpp \ eventsupplier.cpp \ except.cpp \ logcmds.cpp \ logging.cpp \ logstream.cpp \ multiattribute.cpp \ notifdeventsupplier.cpp \ pollcmds.cpp \ pollobj.cpp \ pollring.cpp \ pollthread.cpp \ seqvec.cpp \ subdev_diag.cpp \ tangoappender.cpp \ tangorollingfileappender.cpp \ thsig.cpp \ utils.cpp \ utils_polling.cpp \ utils_shut.cpp \ w_attribute.cpp \ zmqeventsupplier.cpp tangoincludedir = $(includedir)/tango tangoinclude_HEADERS = attrdesc.h \ attribute.h \ attrmanip.h \ attrprop.h \ auto_tango_monitor.h \ basiccommand.h \ blackbox.h \ classattribute.h \ command.h \ coutappender.h \ coutbuf.h \ device.h \ device_2.h \ device_3.h \ device_4.h \ deviceclass.h \ dserver.h \ dserverclass.h \ dserversignal.h \ encoded_attribute.h \ encoded_format.h \ eventsupplier.h \ except.h \ log4tango.h \ logcmds.h \ logging.h \ logstream.h \ multiattribute.h \ ntservice.h \ pollcmds.h \ pollext.h \ pollobj.h \ pollring.h \ pollthread.h \ readers_writers_lock.h \ seqvec.h \ subdev_diag.h \ tango.h \ tango_config.h \ tango_const.h \ tango_monitor.h \ tangoappender.h \ tangorollingfileappender.h \ utils.h \ w_attribute.h \ attribute.tpp \ utils.tpp \ w_attribute.tpp \ attrprop.tpp tango-8.1.2c+dfsg.orig/lib/cpp/server/deviceclass.cpp0000644000175000017500000011256612205375142021436 0ustar piccapiccastatic const char *RcsId = "$Id: deviceclass.cpp 22616 2013-05-05 08:56:58Z taurel $\n$Name$"; //+============================================================================ // // file : Deviceclass.cpp // // description : C++ source code for the DeviceClass // class. This class // is one the root class for all derived Device classes. // It is an abstract class. // // project : TANGO // // author(s) : E.Taurel // // Copyright (C) : 2004,2005,2006,2007,2008,2009,2010,2011,2012,2013 // European Synchrotron Radiation Facility // BP 220, Grenoble 38043 // FRANCE // // This file is part of Tango. // // Tango 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. // // Tango 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 Tango. If not, see . // // $Revision: 22616 $ // //-============================================================================ #if HAVE_CONFIG_H #include #endif #include #include #include #include #include #include #include #include #include #ifdef TANGO_HAS_LOG4TANGO #include #endif extern omni_thread::key_t key_py_data; namespace Tango { static void lower_cmd_name(string &cmd) { transform(cmd.begin(),cmd.end(),cmd.begin(),::tolower); } //+---------------------------------------------------------------------------- // // method : DeviceClass::DeviceClass(string &s) // // description : DeviceClass constructor. Protected method which will // be called automatically by the compiler. // //----------------------------------------------------------------------------- DeviceClass::DeviceClass(string &s):name(s),ext(new DeviceClassExt) { // // Create the associated DbClass object // db_class = new DbClass(name,Tango::Util::instance()->get_database()); // // initialise command_list with State, Status and Init // try { command_list.push_back(new DevStatusCmd("Status",Tango::DEV_VOID,Tango::DEV_STRING)); command_list[0]->set_out_type_desc("Device status"); command_list.push_back(new DevStateCmd("State",Tango::DEV_VOID,Tango::DEV_STATE)); command_list[1]->set_out_type_desc("Device state"); command_list.push_back(new DevInitCmd("Init",Tango::DEV_VOID,Tango::DEV_VOID)); } catch (bad_alloc) { if (command_list.empty() == false) { for(unsigned long i = 0;i < command_list.size();i++) delete command_list[i]; command_list.clear(); } throw; } // // Retrieve basic class resource // get_class_system_resource(); // // Create the multi class attribute object // class_attr = new MultiClassAttribute(); // // Give a default value for device type // type = NotSet; } //+---------------------------------------------------------------------------- // // method : DeviceClass::get_class_system_resource(string &s) // // description : Method to retrieve some basic class resource(s) // The resource to be retrived are : // - The class doc URL // //----------------------------------------------------------------------------- void DeviceClass::get_class_system_resource() { // // Try to retrieve the class resource doc_url // Tango::Util *tg = Tango::Util::instance(); if (tg->_UseDb == true) { Database *db = tg->get_database(); DbData db_data; db_data.push_back(DbDatum("doc_url")); db_data.push_back(DbDatum("cvs_tag")); db_data.push_back(DbDatum("cvs_location")); db_data.push_back(DbDatum("AllowedAccessCmd")); db_data.push_back(DbDatum("svn_tag")); db_data.push_back(DbDatum("svn_location")); try { db->get_class_property(name,db_data,tg->get_db_cache()); } catch (Tango::DevFailed &) { TangoSys_OMemStream o; o << "Database error while trying to retrieve properties for class " << name.c_str() << ends; Except::throw_exception((const char *)API_DatabaseAccess, o.str(), (const char *)"DeviceClass::get_class_system_resource"); } if (db_data[1].is_empty() == false) db_data[1] >> ext->cvs_tag; if (db_data[2].is_empty() == false) db_data[2] >> ext->cvs_location; // // Init allowed commands vector (in lowercase letters) // if (db_data[3].is_empty() == false) { db_data[3] >> allowed_cmds; for_each(allowed_cmds.begin(),allowed_cmds.end(),lower_cmd_name); } if (db_data[0].is_empty() == true) { cout4 << "doc_url property for class " << name << " is not defined in database" << endl; try { db->get_class_property("Default",db_data,tg->get_db_cache()); } catch (Tango::DevFailed &) { TangoSys_OMemStream o; o << "Database error while trying to retrieve properties for class " << name.c_str() << ends; Except::throw_exception((const char *)API_DatabaseAccess, o.str(), (const char *)"DeviceClass::get_class_system_resource"); } if (db_data[0].is_empty() == true) { doc_url = DefaultDocUrl; } else db_data[0] >> doc_url; } else db_data[0] >> doc_url; if (db_data[4].is_empty() == false) db_data[4] >> ext->svn_tag; if (db_data[5].is_empty() == false) db_data[5] >> ext->svn_location; } else { doc_url = DefaultDocUrl; } } //--------------------------------------------------------------------------------------------------------------------- // // method : // DeviceClass::set_memorized_values() // // description : // Write the memorized attribute with the value stored in database // // argument : // in : // - all : Flag set to true if memorized values must be applied to all class devices // - idx : Index of the device in the device_list vector of the device for which memorized values must // be applied. Used if "all" is set to false // - from_init : Flag set to true if the method is called due to a device Init command execution // //-------------------------------------------------------------------------------------------------------------------- void DeviceClass::set_memorized_values(bool all,long idx,bool from_init) { cout4 << "Entering DeviceClass::set_memorized_values() method" << endl; short sh; Tango::DevVarShortArray sh_seq(1); sh_seq.length(1); Tango::DevLong lg; Tango::DevVarLongArray lg_seq(1); lg_seq.length(1); double db; Tango::DevVarDoubleArray db_seq(1); db_seq.length(1); Tango::DevString tmp_str; Tango::DevVarStringArray str_seq(1); str_seq.length(1); float fl; Tango::DevVarFloatArray fl_seq(1); fl_seq.length(1); Tango::DevBoolean boo; Tango::DevVarBooleanArray boo_seq(1); boo_seq.length(1); Tango::DevUShort ush; Tango::DevVarUShortArray ush_seq(1); ush_seq.length(1); Tango::DevUChar uch; Tango::DevVarCharArray uch_seq(1); uch_seq.length(1); Tango::DevULong ulg; Tango::DevVarULongArray ulg_seq(1); ulg_seq.length(1); Tango::DevLong64 lg64; Tango::DevVarLong64Array lg64_seq(1); lg64_seq.length(1); Tango::DevULong64 ulg64; Tango::DevVarULong64Array ulg64_seq(1); ulg64_seq.length(1); // // Set loop start and stop limits // unsigned long start,stop; if (all == true) { start = 0; stop = device_list.size(); } else { start = idx; stop = idx + 1; } for (unsigned long i = start;i < stop;i++) { // // This feature is available only for devices implementing IDL release 3 and above // if (device_list[i]->get_dev_idl_version() < 3) continue; // // Get list of device writable attributes // AttributeValueList att_val(10); vector &att_list = device_list[i]->get_device_attr()->get_w_attr_list(); long nb_wr = 0; for (unsigned long j = 0;j < att_list.size();j++) { WAttribute &att = device_list[i]->get_device_attr()->get_w_attr_by_ind(att_list[j]); if (att.is_memorized() == true) { string &mem_value = att.get_mem_value(); if (mem_value != MemNotUsed) { nb_wr++; att_val.length(nb_wr); // // In order to not send a new time the already memorized value into db, mark it as not memorized before writing // the value // att.set_memorized(false); // // The memorized value gotten from db is a string, we need to convert this string to its real type before inserting // it into an Any // TangoSys_MemStream str; if (from_init == false) str << mem_value << ends; try { switch (att.get_data_type()) { case Tango::DEV_SHORT: if (from_init == false) { if (!(str >> sh)) throw_mem_value(device_list[i],att); att.set_write_value(sh); } else att.get_write_value(sh); sh_seq[0] = sh; att_val[nb_wr - 1].value <<= sh_seq; break; case Tango::DEV_LONG: if (from_init == false) { if (!(str >> lg)) throw_mem_value(device_list[i],att); att.set_write_value(lg); } else att.get_write_value(lg); lg_seq[0] = lg; att_val[nb_wr - 1].value <<= lg_seq; break; case Tango::DEV_DOUBLE: if (from_init == false) { if (!(str >> db)) throw_mem_value(device_list[i],att); att.set_write_value(db); } else att.get_write_value(db); db_seq[0] = db; att_val[nb_wr - 1].value <<= db_seq; break; case Tango::DEV_STRING: if (from_init == false) { att.set_write_value(mem_value); str_seq[0] = CORBA::string_dup(mem_value.c_str()); } else { att.get_write_value(tmp_str); str_seq[0] = CORBA::string_dup(tmp_str); } att_val[nb_wr - 1].value <<= str_seq; break; case Tango::DEV_FLOAT: if (from_init == false) { if (!(str >> fl)) throw_mem_value(device_list[i],att); att.set_write_value(fl); } else att.get_write_value(fl); fl_seq[0] = fl; att_val[nb_wr - 1].value <<= fl_seq; break; case Tango::DEV_BOOLEAN: if (from_init == false) { if (!(str >> boolalpha >> boo)) throw_mem_value(device_list[i],att); att.set_write_value(boo); } else att.get_write_value(boo); boo_seq[0] = boo; att_val[nb_wr - 1].value <<= boo_seq; break; case Tango::DEV_USHORT: if (from_init == false) { if (!(str >> ush)) throw_mem_value(device_list[i],att); att.set_write_value(ush); } else att.get_write_value(ush); ush_seq[0] = ush; att_val[nb_wr - 1].value <<= ush_seq; break; case Tango::DEV_UCHAR: if (from_init == false) { short tmp_sh; if (!(str >> tmp_sh)) throw_mem_value(device_list[i],att); uch = (DevUChar)tmp_sh; att.set_write_value(uch); } else att.get_write_value(uch); uch_seq[0] = uch; att_val[nb_wr - 1].value <<= uch_seq; break; case Tango::DEV_ULONG: if (from_init == false) { if (!(str >> ulg)) throw_mem_value(device_list[i],att); att.set_write_value(ulg); } else att.get_write_value(ulg); ulg_seq[0] = ulg; att_val[nb_wr - 1].value <<= ulg_seq; break; case Tango::DEV_LONG64: if (from_init == false) { if (!(str >> lg64)) throw_mem_value(device_list[i],att); att.set_write_value(lg64); } else att.get_write_value(lg64); lg64_seq[0] = lg64; att_val[nb_wr - 1].value <<= lg64_seq; break; case Tango::DEV_ULONG64: if (from_init == false) { if (!(str >> ulg64)) throw_mem_value(device_list[i],att); att.set_write_value(ulg64); } else att.get_write_value(ulg64); ulg64_seq[0] = ulg64; att_val[nb_wr - 1].value <<= ulg64_seq; break; } // // Check the initialisation flag for memorized attributes. If the flag is false, do not add the element to the att_val // vector. This avoids a call to write the memorized value to the attribute. // if ( att.is_memorized_init() == false ) { nb_wr--; att_val.length(nb_wr); // reset memorized flag att.set_memorized(true); } else { // // Init the AttributeValue structure // att_val[nb_wr - 1].name = CORBA::string_dup(att.get_name().c_str()); att_val[nb_wr - 1].dim_x = 1; att_val[nb_wr - 1].dim_y = 0; att_val[nb_wr - 1].quality = Tango::ATTR_VALID; } } catch (Tango::DevFailed &e) { cout3 << "Cannot configure setpoint value for memorized attribute " << att.get_name() << endl; Tango::Except::print_exception(e); nb_wr--; att_val.length(nb_wr); // reset memorized flag att.set_memorized(true); } } } } if (nb_wr != 0) { // // Write attribute values. Print exception if any. // try { cout4 << "Writing data for " << att_val.length() << " attribute(s) for device " << device_list[i]->get_name() << endl; (static_cast(device_list[i]))->write_attributes_3(att_val); } catch (Tango::DevFailed &e) { cout3 << "Cannot write setpoint(s) value for any memorized attribute(s) on device " << device_list[i]->get_name() << endl; Tango::Except::print_exception(e); } catch (Tango::MultiDevFailed &e) { cout3 << "Cannot write setpoint(s) value for memorized attribute(s) of device " << device_list[i]->get_name() << endl; for (unsigned long k = 0;k < e.errors.length();k++) { WAttribute &att = device_list[i]->get_device_attr()->get_w_attr_by_name(att_val[e.errors[k].index_in_call].name.in()); att.set_mem_exception(e.errors[k].err_list); log4tango::Logger *log = device_list[i]->get_logger(); if (log->is_warn_enabled()) { log->warn_stream() << log4tango::LogInitiator::_begin_log << "Writing set_point for attribute " << att.get_name() << " failed" << endl; log->warn_stream() << log4tango::LogInitiator::_begin_log << "\tException desc = " << e.errors[k].err_list[0].desc.in() << endl; log->warn_stream() << log4tango::LogInitiator::_begin_log << "\tException reason = " << e.errors[k].err_list[0].reason.in() << endl; } } device_list[i]->set_run_att_conf_loop(true); Tango::NamedDevFailedList e_list (e, device_list[i]->get_name(), (const char *)"DeviceClass::set_memorized_values()", (const char *)"API_AttributeFailed"); Tango::Except::print_exception(e_list); } // // Reset memorized flags // for (unsigned long k = 0;k < att_val.length();k++) { WAttribute &att = device_list[i]->get_device_attr()->get_w_attr_by_name(att_val[k].name.in()); att.set_memorized(true); } } } cout4 << "Leaving DeviceClass::set_memorized_values() method" << endl; } //------------------------------------------------------------------------------------------------------------------- // // method : // DeviceClass::throw_mem_value() // // description : // Throw API_AttrWrongMemValue exception // // argument : // in : // - dev: Pointer to the device // - att: The attribute object // //-------------------------------------------------------------------------------------------------------------------- void DeviceClass::throw_mem_value(DeviceImpl *dev,Attribute &att) { TangoSys_OMemStream o; o << "Memorized value for attribute "; o << att.get_name(); o << " (device "; o << dev->get_name(); o << ") is in an incorrect format !" << ends; Except::throw_exception((const char *)API_AttrWrongMemValue, o.str(), (const char *)"DeviceClass::set_memorized_values"); } //-------------------------------------------------------------------------------------------------------------------- // // method : // DeviceClass::~DeviceClass(string &s) // // description : // DeviceClass class destructor. // //-------------------------------------------------------------------------------------------------------------------- DeviceClass::~DeviceClass() { cout4 << "Entering DeviceClass destructor for class " << name << endl; // // Destroy the DbClass object // delete db_class; // // Destroy the device list // unsigned long i; if (device_list.size() != 0) { Tango::Util *tg = Tango::Util::instance(); PortableServer::POA_ptr r_poa = tg->get_poa(); unsigned long nb_dev = device_list.size(); for (i = 0;i < nb_dev;i++) { // // Clear vectors used to memorize info used to clean db in case of devices with dyn attr removed during device // destruction // tg->get_polled_dyn_attr_names().clear(); tg->get_full_polled_att_list().clear(); tg->get_all_dyn_attr_names().clear(); tg->get_dyn_att_dev_name().clear(); // // Delete device // delete_dev(0,tg,r_poa); // // Clean-up db (dyn attribute) // if (tg->get_polled_dyn_attr_names().size() != 0) tg->clean_attr_polled_prop(); if (tg->get_all_dyn_attr_names().size() != 0) tg->clean_dyn_attr_prop(); vector::iterator it = device_list.begin(); device_list.erase(it); } device_list.clear(); CORBA::release(r_poa); } // // Destroy the command list // for (i = 0;i < command_list.size();i++) delete command_list[i]; command_list.clear(); // // Destroy the MultiClassAttribute object // delete class_attr; // // Unregister the class from signal handler // DServerSignal::instance()->unregister_class_signal(this); // // Delete the class extension object // #ifndef HAS_UNIQUE_PTR delete ext; #endif cout4 << "Leaving DeviceClass destructor for class " << name << endl; } //-------------------------------------------------------------------------------------------------------------------- // // method : // DeviceClass::delete_dev() // // description : // Delete a device from the class device list // // argument : // in : // - idx : // - tg : Pointer to the Tango Util singleton // - r_poa : Pointer to the CORBA POA // //----------------------------------------------------------------------------- void DeviceClass::delete_dev(long idx,Tango::Util *tg,PortableServer::POA_ptr r_poa) { cout4 << "Entering DeviceClas::delete_dev method for device with index " << idx << endl; // // If the polling thread is alive and if device is polled, ask polling thread to stop polling // if ((tg->get_polling_threads_info().empty() == false) && (device_list[idx]->is_polled() == true)) { device_list[idx]->stop_polling(false); } // // Deactivate the CORBA object // bool py_dev = device_list[idx]->is_py_device(); bool exported_device = device_list[idx]->get_exported_flag(); if (exported_device == true) r_poa->deactivate_object(device_list[idx]->get_obj_id().in()); // // Remove the servant. // For C++ device, this will be automatically done by the POA when the last executing call will be over even if the // device is not exported // if (py_dev == true) { Device_3Impl *dev_3 = static_cast(device_list[idx]); dev_3->delete_dev(); } // // Wait for CORBA to call the device dtor // if (device_list[idx] != NULL && exported_device == true) { #ifdef _TG_WINDOWS_ while (device_list[idx] != NULL) { Sleep(10); } #else struct timespec ts; ts.tv_sec = 0; ts.tv_nsec = 10000000; while (device_list[idx] != NULL) { nanosleep(&ts,NULL); } #endif } cout4 << "Leaving DeviceClass delete_dev" << endl; } //+------------------------------------------------------------------------- // // method : DeviceClass::register_signal // // description : Method to register a class on a signal. When the // signal is sent to the process, the signal_handler // method of this class will be executed // // in : signo : The signal number // delayed : The boolean delayed flag // //-------------------------------------------------------------------------- #if defined _TG_WINDOWS_ void DeviceClass::register_signal(long signo) { cout4 << "DeviceClass::register_signal() arrived for signal " << signo << endl; DServerSignal::instance()->register_class_signal(signo,this); cout4 << "Leaving DeviceClass::register_signal method()" << endl; } #else void DeviceClass::register_signal(long signo,bool handler) { cout4 << "DeviceClass::register_signal() arrived for signal " << signo << endl; DServerSignal::instance()->register_class_signal(signo,handler,this); cout4 << "Leaving DeviceClass::register_signal method()" << endl; } #endif //+------------------------------------------------------------------------- // // method : DeviceClass::unregister_signal // // description : Method to unregister a class on a signal. // // in : signo : The signal number // delayed : The boolean delayed flag // //-------------------------------------------------------------------------- void DeviceClass::unregister_signal(long signo) { cout4 << "DeviceClass::unregister_signal() arrived for signal " << signo << endl; DServerSignal::instance()->unregister_class_signal(signo,this); cout4 << "Leaving DeviceClass::unregister_signal method()" << endl; } //+------------------------------------------------------------------------- // // method : DeviceClass::signal_handler // // description : This is the signal handler for the class. This method // is defined as virtual and therefore, can be redefined // by DS programmers in their own classes derived from // DeviceClass class // // in : signo : The signal number // //-------------------------------------------------------------------------- void DeviceClass::signal_handler(long signo) { cout4 << "DeviceClass::signal_handler() arrived for signal " << signo << endl; cout4 << "Leaving DeviceClass::signal_handler method()" << endl; } //+------------------------------------------------------------------------- // // method : DeviceClass::export_device() // // description : This method exports a device to the outside world. // This is done by sending its CORBA network parameter // (mainly the IOR) to the Tango database // // in : dev : The device to be exported // corba_obj_name : The CORBA object name associated // with the device. A default value // is provided. This field is mainly // use for specific device server // like the database device server. // //-------------------------------------------------------------------------- void DeviceClass::export_device(DeviceImpl *dev,const char *corba_obj_name) { cout4 << "DeviceClass::export_device() arrived" << endl; Device_var d; if ((Tango::Util::_UseDb == true) && (Tango::Util::_FileDb == false)) { // // Take the Tango monitor in order to protect the device against external world access // until memorized attribute (if any) are set but forget the admin device // (which does not have any memorized attribute) // But don't do this for dynamic devices which are not created in the DServer::init_device method class loop // string &dev_name = dev->get_name_lower(); if ((get_device_factory_done() == false) && (dev_name.find("dserver") != 0)) dev->get_dev_monitor().get_monitor(); // // Activate the CORBA object incarnated by the dev C++ object // Also call _remove_ref to give POA the full ownership of servant // d = dev->_this(); dev->set_d_var(Tango::Device::_duplicate(d)); if (is_py_class() == false) dev->_remove_ref(); // // Store the ObjectId (The ObjectId_var type is a typedef of a string_var // type) // PortableServer::ObjectId_var oid; try { PortableServer::POA_ptr r_poa = Util::instance()->get_poa(); oid = r_poa->reference_to_id(d); CORBA::release(r_poa); } catch (...) { TangoSys_OMemStream o; o << "Cant get CORBA reference Id for device " << dev->get_name() << ends; Except::throw_exception((const char *)API_CantGetDevObjectId, o.str(), (const char *)"DeviceClass::export_device"); } dev->set_obj_id(oid); } else { // // For server started without db usage (Mostly the database server). In this case, // it is necessary to create our own CORBA object id and to bind it into the // OOC Boot Manager for access through a stringified object reference // constructed using the corbaloc style // The API will try to connect to device using lower case letters. // Register device in POA with lower case letters // string corba_obj_name_lower(corba_obj_name); transform(corba_obj_name_lower.begin(),corba_obj_name_lower.end(),corba_obj_name_lower.begin(),::tolower); PortableServer::ObjectId_var id = PortableServer::string_to_ObjectId(corba_obj_name_lower.c_str()); try { PortableServer::POA_ptr r_poa = Util::instance()->get_poa(); r_poa->activate_object_with_id(id.in(),dev); CORBA::release(r_poa); } catch (...) { TangoSys_OMemStream o; o << "Can't get CORBA reference Id for device " << dev->get_name() << ends; Except::throw_exception((const char *)API_CantGetDevObjectId, o.str(), (const char *)"DeviceClass::export_device"); } d = dev->_this(); dev->set_obj_id(id); dev->set_d_var(Tango::Device::_duplicate(d)); dev->_remove_ref(); } // // Prepare sent parameters and allocate mem for them // if ((Tango::Util::_UseDb == true) && (Tango::Util::_FileDb == false)) { Tango::Util *tg = Tango::Util::instance(); CORBA::ORB_ptr orb_ptr = tg->get_orb(); char *s = orb_ptr->object_to_string(d); string ior_string(s); Tango::DbDevExportInfo exp; exp.name = dev->get_name(); exp.ior = ior_string; exp.host = tg->get_host_name(); exp.pid = tg->get_pid(); exp.version = tg->get_version_str(); // // Call db server // We are still in the server starting phase. Therefore, the db timeout is still high (13 sec the 07/01/2011) // with 3 retries in case of timeout // try { tg->get_database()->export_device(exp); } catch (Tango::CommunicationFailed &) { cerr << "CommunicationFailed while exporting device " << dev->get_name() << endl; CORBA::release(orb_ptr); CORBA::string_free(s); throw; } CORBA::release(orb_ptr); CORBA::string_free(s); } // // Set the DeviceImpl exported flag to true // dev->set_exported_flag(true); cout4 << "Leaving DeviceClass::export_device method()" << endl; } //+---------------------------------------------------------------------------- // // method : DeviceClass::command_handler(string &s) // // description : Command handler which is called by Device // when a command is received. It will check // to see if the command is implemented. If // so it will test to see if it is allowed // in this state. Finally it will execute the // command by calling its execute method. // If an error occurs it will throw a DevFailed // exception. // //----------------------------------------------------------------------------- CORBA::Any *DeviceClass::command_handler(DeviceImpl *device,string &command,const CORBA::Any &in_any) { CORBA::Any *ret = NULL; vector::iterator i_cmd; string command_lower(command); cout4 << "Entering DeviceClass::command_handler() method" << endl; transform(command_lower.begin(),command_lower.end(),command_lower.begin(),::tolower); for (i_cmd = command_list.begin();i_cmd < command_list.end();++i_cmd) { if ((*i_cmd)->get_lower_name() == command_lower) { // // Call the always executed method // device->always_executed_hook(); // // Check if command is allowed // if ((*i_cmd)->is_allowed(device,in_any) == false) { TangoSys_OMemStream o; o << "Command " << command << " not allowed when the device is in " << Tango::DevStateName[device->get_state()] << " state" << ends; Except::throw_exception((const char *)API_CommandNotAllowed, o.str(), (const char *)"DeviceClass::command_handler"); } // // Execute command // ret = (*i_cmd)->execute(device,in_any); break; } } if (i_cmd == command_list.end()) { cout3 << "DeviceClass::command_handler(): command " << command << " not found" << endl; Command *def_cmd = get_default_command(); if (def_cmd != NULL) { // // Set name in default command object // def_cmd->set_name(command); // // Call the always executed method // device->always_executed_hook(); // // Check if command is allowed // if (def_cmd->is_allowed(device,in_any) == false) { TangoSys_OMemStream o; o << "Command " << command << " not allowed when the device is in " << Tango::DevStateName[device->get_state()] << " state" << ends; Except::throw_exception((const char *)API_CommandNotAllowed, o.str(), (const char *)"DeviceClass::command_handler"); } // // Execute command // ret = def_cmd->execute(device,in_any); } else { // // Throw an exception to client // TangoSys_OMemStream o; o << "Command " << command << " not found" << ends; Except::throw_exception((const char *)API_CommandNotFound, o.str(), (const char *)"DeviceClass::command_handler"); } } cout4 << "Leaving DeviceClass::command_handler() method" << endl; return ret; } //+---------------------------------------------------------------------------- // // method : DeviceClass::add_wiz_dev_prop() // // description : Method to add a device property definition for the // device wizard // // in : name : The device property name // desc : The device property description // def : The device property default value // //----------------------------------------------------------------------------- void DeviceClass::add_wiz_dev_prop(string &p_name,string &desc,string &def) { // // Name in lowercase letters // string name_low = p_name; transform(name_low.begin(),name_low.end(),name_low.begin(),::tolower); // // Check that this property is not already in the vector // vector::iterator ite; for (ite = wiz_dev_prop.begin();ite < wiz_dev_prop.end();++ite) { string tmp_name(*ite); transform(tmp_name.begin(),tmp_name.end(),tmp_name.begin(),::tolower); if (tmp_name == name_low) break; } if (ite != wiz_dev_prop.end()) { TangoSys_OMemStream o; o << "Device property " << p_name; o << " for class " << name << " is already defined in the wizard" << ends; Except::throw_exception((const char *)API_WizardConfError, o.str(), (const char *)"DeviceClass::add_wiz_dev_prop"); } // // Insert data in vector // wiz_dev_prop.push_back(p_name); wiz_dev_prop.push_back(desc); wiz_dev_prop.push_back(def); } void DeviceClass::add_wiz_dev_prop(string &p_name,string &desc) { string def(AlrmValueNotSpec); add_wiz_dev_prop(p_name,desc,def); } //+---------------------------------------------------------------------------- // // method : DeviceClass::add_wiz_class_prop() // // description : Method to add a class property definition for the // device wizard // // in : name : The class property name // desc : The class property description // def : The class property default value // //----------------------------------------------------------------------------- void DeviceClass::add_wiz_class_prop(string &p_name,string &desc,string &def) { // // Name in lowercase letters // string name_low = p_name; transform(name_low.begin(),name_low.end(),name_low.begin(),::tolower); // // Check that this property is not already in the vector // vector::iterator ite; for (ite = wiz_class_prop.begin();ite < wiz_class_prop.end();++ite) { string tmp_name(*ite); transform(tmp_name.begin(),tmp_name.end(),tmp_name.begin(),::tolower); if (tmp_name == name_low) break; } if (ite != wiz_class_prop.end()) { TangoSys_OMemStream o; o << "Class property " << p_name; o << " for class " << name << " is already defined in the wizard" << ends; Except::throw_exception((const char *)API_WizardConfError, o.str(), (const char *)"DeviceClass::add_wiz_dev_prop"); } // // Insert data in vector // wiz_class_prop.push_back(p_name); wiz_class_prop.push_back(desc); wiz_class_prop.push_back(def); } void DeviceClass::add_wiz_class_prop(string &p_name,string &desc) { string def(AlrmValueNotSpec); add_wiz_class_prop(p_name,desc,def); } //+---------------------------------------------------------------------------- // // method : DeviceClass::device_destroyer // // description : Method to remove and delete a device from the running devices // belonging to the Tango class // // in : dev_name : The device name // //----------------------------------------------------------------------------- void DeviceClass::device_destroyer(const string &dev_name) { // // Check that the class know this device // unsigned long k; for (k = 0;k < device_list.size();k++) { if (device_list[k]->get_name() == dev_name) break; } if (k == device_list.size()) { TangoSys_OMemStream o; o << "Device " << dev_name << " not in Tango class device list!" << ends; Tango::Except::throw_exception((const char *)API_CantDestroyDevice,o.str(), (const char *)"DeviceClass::device_destroyer"); } // // Check if the device is polled // If yes, ask polling thread to stop polling it // if (device_list[k]->is_polled() == true) { device_list[k]->stop_polling(); } // // Delete the device // Tango::Util *tg = Tango::Util::instance(); PortableServer::POA_ptr r_poa = tg->get_poa(); delete_dev(k,tg,r_poa); vector::iterator it = device_list.begin(); it += k; device_list.erase(it); CORBA::release(r_poa); } void DeviceClass::device_destroyer(const char *dev_name) { string name_str(dev_name); return device_destroyer(name_str); } //+---------------------------------------------------------------------------- // // method : DeviceClass::is_command_allowed // // description : Method to check if a command is allowed even if the device // is locked by another client. It follows the definition // of the Tango control access system to define what is an // allowed command // // in : cmd : The command name // //----------------------------------------------------------------------------- bool DeviceClass::is_command_allowed(const char *cmd) { bool ret = true; string tmp_cmd(cmd); transform(tmp_cmd.begin(),tmp_cmd.end(),tmp_cmd.begin(),::tolower); vector::iterator pos = find(allowed_cmds.begin(),allowed_cmds.end(),tmp_cmd); if (pos == allowed_cmds.end()) ret = false; return ret; } //+---------------------------------------------------------------------------- // // method : DeviceClass::get_mcast_event() // // description : Get for all class devices and for all attributes multicast // event parameters (if any) // // in : dserv : Pointer to the DServer device // //----------------------------------------------------------------------------- void DeviceClass::get_mcast_event(DServer *dserv) { cout4 << "Entering DeviceClass::get_mcast_event() method" << endl; vector m_cast; for (unsigned int i = 0;i < device_list.size();++i) { vector &att_list = device_list[i]->get_device_attr()->get_attribute_list(); for (unsigned int j = 0;j < att_list.size();++j) { dserv->mcast_event_for_att(device_list[i]->get_name_lower(),att_list[j]->get_name_lower(),m_cast); if (m_cast.empty() == false) att_list[j]->set_mcast_event(m_cast); } } } //+---------------------------------------------------------------------------- // // method : DeviceClass::get_cmd_by_name // // description : Get a reference to the Command object // // in : cmd_name : The command name // //----------------------------------------------------------------------------- Command &DeviceClass::get_cmd_by_name(const string &cmd_name) { vector::iterator pos; #ifdef HAS_LAMBDA_FUNC pos = find_if(command_list.begin(),command_list.end(), [&] (Command *cmd) -> bool { if (cmd_name.size() != cmd->get_lower_name().size()) return false; string tmp_name(cmd_name); transform(tmp_name.begin(),tmp_name.end(),tmp_name.begin(),::tolower); return cmd->get_lower_name() == tmp_name; }); #else pos = find_if(command_list.begin(),command_list.end(), bind2nd(WantedCmd(),cmd_name.c_str())); #endif if (pos == command_list.end()) { cout3 << "DeviceClass::get_cmd_by_name throwing exception" << endl; TangoSys_OMemStream o; o << cmd_name << " command not found" << ends; Except::throw_exception((const char *)API_CommandNotFound, o.str(), (const char *)"DeviceClass::get_cmd_by_name"); } return *(*pos); } //+---------------------------------------------------------------------------- // // method : DeviceClass::check_att_conf // // description : Check attribute configuration (for wrong conf. in db // exception) for all devices in the class // //----------------------------------------------------------------------------- void DeviceClass::check_att_conf() { vector::iterator ite; for (ite = device_list.begin();ite != device_list.end();++ite) (*ite)->check_att_conf(); } //+---------------------------------------------------------------------------- // // method : DeviceClass::release_devices_mon // // description : Release all device(s) class monitor. This is needed in DS // startup sequence. Each device monitor is taken before the // device is known to CORBA and released after the memorized // attributes (if any) are set // //----------------------------------------------------------------------------- void DeviceClass::release_devices_mon() { vector::iterator ite; // // Release monitor for all devices belonging to this class // for (ite = device_list.begin();ite != device_list.end();++ite) (*ite)->get_dev_monitor().rel_monitor(); } } // End of Tango namespace tango-8.1.2c+dfsg.orig/lib/cpp/server/encoded_format.h0000644000175000017500000000306012205375142021553 0ustar piccapicca///============================================================================= // // file : encoded_format.h // // description : Include file for the defined Tango::DevEncoded format // string // // project : TANGO // // author(s) : E. Taurel // // Copyright (C) : 2011,2012 // European Synchrotron Radiation Facility // BP 220, Grenoble 38043 // FRANCE // // This file is part of Tango. // // Tango 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. // // Tango 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 Tango. If not, see . // // $Revision: 21911 $ // // $Log$ // // //============================================================================= #ifndef _ENCODED_FORMAT_H #define _ENCODED_FORMAT_H namespace Tango { // // Jpeg encoding // #define JPEG_GRAY_8 "JPEG_GRAY8" #define JPEG_RGB "JPEG_RGB" // // Gray encoding // #define GRAY_8 "GRAY8" #define GRAY_16 "GRAY16" // // RGB // #define RGB_24 "RGB24" } // End of Tango namespace #endif // _ENCODED_FORMAT_H tango-8.1.2c+dfsg.orig/lib/cpp/server/tango_monitor.h0000644000175000017500000001335212205375142021466 0ustar piccapicca//=================================================================================================================== // // file : tango_monitor.h // // description : Include file for the Tango_monitor class // // project : TANGO // // author(s) : E.Taurel // // Copyright (C) : 2004,2005,2006,2007,2008,2009,2010,2011,2012,2013 // European Synchrotron Radiation Facility // BP 220, Grenoble 38043 // FRANCE // // This file is part of Tango. // // Tango 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. // // Tango 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 Tango. // If not, see . // // $Revision: 22213 $ // //=================================================================================================================== #ifndef _TANGO_MONITOR_H #define _TANGO_MONITOR_H namespace Tango { //-------------------------------------------------------------------------------------------------------------------- // // class : // TangoMonitor // // description : // This class is used to synchronise device access between polling thread and CORBA request. It is used only for // the command_inout and read_attribute calls // //-------------------------------------------------------------------------------------------------------------------- class TangoMonitor: public omni_mutex { public : TangoMonitor(const char *na):_timeout(DEFAULT_TIMEOUT),cond(this), locking_thread(NULL),locked_ctr(0),name(na) {}; TangoMonitor():_timeout(DEFAULT_TIMEOUT),cond(this),locking_thread(NULL), locked_ctr(0),name("unknown") {}; ~TangoMonitor() {}; void get_monitor(); void rel_monitor(); void timeout(long new_to) {_timeout = new_to;} long timeout() {return _timeout;} void wait() {cond.wait();} int wait(long); void signal() {cond.signal();} int get_locking_thread_id(); long get_locking_ctr(); string &get_name() {return name;} private : long _timeout; omni_condition cond; omni_thread *locking_thread; long locked_ctr; string name; }; //-------------------------------------------------------------------------------------------------------------------- // // methods : // TangoMonitor::get_locking_thread_id // TangoMonitor::get_locking_ctr // //------------------------------------------------------------------------------------------------------------------- inline int TangoMonitor::get_locking_thread_id() { if (locking_thread != NULL) return locking_thread->id(); else return 0; } inline long TangoMonitor::get_locking_ctr() { omni_mutex_lock guard(*this); return locked_ctr; } //-------------------------------------------------------------------------------------------------------------------- // // method : // TangoMonitor::get_monitor // // description : // Get a monitor. The thread will wait (with timeout) if the monitor is already locked. If the thread is already // the monitor owner thread, simply increment the locking counter // //-------------------------------------------------------------------------------------------------------------------- inline void TangoMonitor::get_monitor() { omni_thread *th = omni_thread::self(); omni_mutex_lock synchronized(*this); #if !defined(_TG_WINDOWS_) || (defined(_MSC_VER) && _MSC_VER >= 1300) cout4 << "In get_monitor() " << name << ", thread = " << th->id() << ", ctr = " << locked_ctr << endl; #endif if (locked_ctr == 0) { locking_thread = th; } else if (th != locking_thread) { while(locked_ctr > 0) { #if !defined(_TG_WINDOWS_) || (defined(_MSC_VER) && _MSC_VER >= 1300) cout4 << "Thread " << th->id() << ": waiting !!" << endl; #endif int interupted; interupted = wait(_timeout); if (interupted == false) { #if !defined(_TG_WINDOWS_) || (defined(_MSC_VER) && _MSC_VER >= 1300) cout4 << "TIME OUT for thread " << th->id() << endl; #endif Except::throw_exception((const char *)API_CommandTimedOut, (const char *)"Not able to acquire serialization (dev, class or process) monitor", (const char *)"TangoMonitor::get_monitor"); } } locking_thread = th; } else { #if !defined(_TG_WINDOWS_) || (defined(_MSC_VER) && _MSC_VER >= 1300) cout4 << "owner_thread !!" << endl; #endif } locked_ctr++; } //-------------------------------------------------------------------------------------------------------------------- // // method : // TangoMonitor::rel_monitor // // description : // Release a monitor if the caller thread is the locking thread. Signal other threads if the locking counter // goes down to zero // //-------------------------------------------------------------------------------------------------------------------- inline void TangoMonitor::rel_monitor() { omni_thread *th = omni_thread::self(); omni_mutex_lock synchronized(*this); #if !defined(_TG_WINDOWS_) || (defined(_MSC_VER) && _MSC_VER >= 1300) cout4 << "In rel_monitor() " << name << ", ctr = " << locked_ctr << ", thread = " << th->id() << endl; #endif if ((locked_ctr == 0) || (th != locking_thread)) return; locked_ctr--; if (locked_ctr == 0) { #if !defined(_TG_WINDOWS_) || (defined(_MSC_VER) && _MSC_VER >= 1300) cout4 << "Signalling !" << endl; #endif locking_thread = NULL; cond.signal(); } } } // End of Tango namespace #endif /* TANGO_MONITOR */ tango-8.1.2c+dfsg.orig/lib/cpp/server/logcmds.cpp0000644000175000017500000003031512205375142020570 0ustar piccapiccastatic const char *RcsId = "$Id: logcmds.cpp 22213 2013-03-07 14:32:56Z taurel $\n$Name$"; //+============================================================================= // // file : LogCmds.cpp // // description : Logging oriented commands of the DServerClass. // // project : TANGO // // author(s) : N.Leclercq // // Copyright (C) : 2004,2005,2006,2007,2008,2009,2010,2011,2012,2013 // European Synchrotron Radiation Facility // BP 220, Grenoble 38043 // FRANCE // // This file is part of Tango. // // Tango 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. // // Tango 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 Tango. If not, see . // // $Revision: 22213 $ // // $Log$ // Revision 3.5 2010/09/09 13:46:00 taurel // - Add year 2010 in Copyright notice // // Revision 3.4 2009/01/21 12:47:15 taurel // - Change CopyRights for 2009 // // Revision 3.3 2008/10/06 15:01:36 taurel // - Changed the licensing info from GPL to LGPL // // Revision 3.2 2008/10/03 06:52:31 taurel // - Add some licensing info in each files // // Revision 3.1 2003/05/28 14:55:09 taurel // Add the include (conditionally) of the include files generated by autoconf // // Revision 3.0 2003/03/25 16:44:09 taurel // Many changes for Tango release 3.0 including // - Added full logging features // - Added asynchronous calls // - Host name of clients now stored in black-box // - Three serialization model in DS // - Fix miscellaneous bugs // - Ported to gcc 3.2 // - Added ApiUtil::cleanup() and destructor methods // - Some internal cleanups // - Change the way how TangoMonitor class is implemented. It's a recursive // mutex // // Revision 2.3 2003/03/19 10:41:32 nleclercq // *** empty log message *** // // Revision 2.2 2003/03/11 17:55:54 nleclercq // Switch from log4cpp to log4tango // // Revision 2.1 2003/02/17 14:57:42 taurel // Added the new Tango logging stuff (Thanks Nicolas from Soleil) // // //-============================================================================= #if HAVE_CONFIG_H #include #endif #include #ifdef TANGO_HAS_LOG4TANGO #include namespace Tango { //+------------------------------------------------------------------------- // // method : AddLoggingTarget::AddLoggingTarget // // description : Constructor for Command class AddLoggingTarget // //-------------------------------------------------------------------------- AddLoggingTarget::AddLoggingTarget (const char *name, Tango::CmdArgType in, Tango::CmdArgType out, const std::string &in_desc) : Command(name, in, out) { set_in_type_desc(const_cast(in_desc)); } //+------------------------------------------------------------------------- // // method : AddLoggingTarget::execute // // description : Trigger the execution of the method implementing // the AddLoggingTarget command of the DServerClass // //-------------------------------------------------------------------------- CORBA::Any *AddLoggingTarget::execute (DeviceImpl *device, const CORBA::Any &in_any) { cout4 << "AddLoggingTarget::execute(): arrived " << endl; // // Extract the input data // const DevVarStringArray *targets; if ((in_any >>= targets) == false) { Except::throw_exception((const char *)API_IncompatibleCmdArgumentType, (const char *)"Imcompatible command argument type, expected type is : DevVarStringArray", (const char *)"AddLoggingTarget::execute"); } // // Call the concrete device method // (static_cast(device))->add_logging_target(targets); // // Return to caller // CORBA::Any *ret = return_empty_any("AddLoggingTarget"); return ret; } //+------------------------------------------------------------------------- // // method : RemoveLoggingTarget::RemoveLoggingTarget // // description : Constructor for Command class RemoveLoggingTarget // //-------------------------------------------------------------------------- RemoveLoggingTarget::RemoveLoggingTarget (const char *name, Tango::CmdArgType in, Tango::CmdArgType out, const std::string &in_desc) : Command(name, in, out) { set_in_type_desc(const_cast(in_desc)); } //+------------------------------------------------------------------------- // // method : RemoveLoggingTarget::execute // // description : Trigger the execution of the method implementing // the RemoveLoggingTarget command of the DServerClass // //-------------------------------------------------------------------------- CORBA::Any *RemoveLoggingTarget::execute (DeviceImpl *device, const CORBA::Any &in_any) { cout4 << "RemoveLoggingTarget::execute(): arrived " << endl; // // Extract the input data // const DevVarStringArray *targets; if ((in_any >>= targets) == false) { Except::throw_exception((const char *)API_IncompatibleCmdArgumentType, (const char *)"Imcompatible command argument type, expected type is : DevVarStringArray", (const char *)"RemoveLoggingTarget::execute"); } // // Call the concrete device method // (static_cast(device))->remove_logging_target(targets); // // Return to caller // CORBA::Any *ret = return_empty_any("RemoveLoggingTarget"); return ret; } //+------------------------------------------------------------------------- // // method : GetLoggingTarget::GetLoggingTarget // // description : Constructor for Command class GetLoggingTarget // //-------------------------------------------------------------------------- GetLoggingTarget::GetLoggingTarget (const char *name, Tango::CmdArgType in, Tango::CmdArgType out, const std::string &in_desc, const std::string &out_desc) : Command(name, in, out) { set_in_type_desc(const_cast(in_desc)); set_out_type_desc(const_cast(out_desc)); } //+------------------------------------------------------------------------- // // method : GetLoggingTarget::execute // // description : Trigger the execution of the method implementing // the GetLoggingTarget command of the DServerClass // //-------------------------------------------------------------------------- CORBA::Any *GetLoggingTarget::execute (DeviceImpl *device, const CORBA::Any &in_any) { cout4 << "GetLoggingTarget::execute(): arrived " << endl; // // Extract the input data // const char* tmp_str; if ((in_any >>= tmp_str) == false) { Except::throw_exception((const char *)API_IncompatibleCmdArgumentType, (const char *)"Imcompatible command argument type, expected type is : DevString", (const char *)"GetLoggingTarget::execute"); } // // Return to caller // return insert((static_cast(device))->get_logging_target(std::string(tmp_str))); } //+------------------------------------------------------------------------- // // method : SetLoggingLevel::SetLoggingLevel // // description : Constructor for Command class SetLoggingLevel // //-------------------------------------------------------------------------- SetLoggingLevel::SetLoggingLevel (const char *name, Tango::CmdArgType in, Tango::CmdArgType out, const std::string &in_desc) : Command(name, in, out) { set_in_type_desc(const_cast(in_desc)); } //+------------------------------------------------------------------------- // // method : SetLoggingLevel::execute // // description : Trigger the execution of the method implementing // the SetLoggingLevel command of the DServerClass // //-------------------------------------------------------------------------- CORBA::Any *SetLoggingLevel::execute (DeviceImpl *device, const CORBA::Any &in_any) { cout4 << "SetLoggingLevel::execute(): arrived " << endl; // // Extract the input data // const DevVarLongStringArray *argin; if ((in_any >>= argin) == false) { Except::throw_exception((const char *)API_IncompatibleCmdArgumentType, (const char *)"Imcompatible command argument type, expected type is : DevVarLongStringArray", (const char *)"SetLoggingLevel::execute"); } // // Call the concrete device method // (static_cast(device))->set_logging_level(argin); // // Return to caller // CORBA::Any *ret = return_empty_any("StartLogging"); return ret; } //+------------------------------------------------------------------------- // // method : GetLoggingLevel::GetLoggingLevel // // description : Constructor for Command class GetLoggingLevel // //-------------------------------------------------------------------------- GetLoggingLevel::GetLoggingLevel (const char *name, Tango::CmdArgType in, Tango::CmdArgType out, const std::string &in_desc, const std::string &out_desc) : Command(name, in, out) { set_in_type_desc(const_cast(in_desc)); set_out_type_desc(const_cast(out_desc)); } //+------------------------------------------------------------------------- // // method : GetLoggingLevel::execute // // description : Trigger the execution of the method implementing // the GetLoggingLevel command of the DServerClass // //-------------------------------------------------------------------------- CORBA::Any *GetLoggingLevel::execute (DeviceImpl *device, const CORBA::Any &in_any) { cout4 << "GetLoggingLevel::execute(): arrived " << endl; // // Extract the input data // const DevVarStringArray *argin; if ((in_any >>= argin) == false) { Except::throw_exception((const char *)API_IncompatibleCmdArgumentType, (const char *)"Imcompatible command argument type, expected type is : DevVarStringArray", (const char *)"GetLoggingLevel::execute"); } // // Return to caller // return insert((static_cast(device))->get_logging_level(argin)); } //+------------------------------------------------------------------------- // // method : StopLogging::StopLogging // // description : Constructor for Command class StopLogging // //-------------------------------------------------------------------------- StopLogging::StopLogging(const char *name, Tango::CmdArgType in, Tango::CmdArgType out) : Command(name, in, out) { } //+------------------------------------------------------------------------- // // method : StopLoggingLevel::execute // // description : Trigger the execution of the method implementing // the StopLogging command of the DServerClass // //-------------------------------------------------------------------------- CORBA::Any *StopLogging::execute (DeviceImpl *device, TANGO_UNUSED(const CORBA::Any &in_any)) { cout4 << "StopLogging::execute(): arrived " << endl; // // Call the concrete device method // (static_cast(device))->stop_logging(); // // Return to caller // CORBA::Any *ret = return_empty_any("StopLogging"); return ret; } //+------------------------------------------------------------------------- // // method : StartLogging::StartLogging // // description : Constructor for Command class StartLogging // //-------------------------------------------------------------------------- StartLogging::StartLogging (const char *name, Tango::CmdArgType in, Tango::CmdArgType out) : Command(name, in, out) { } //+------------------------------------------------------------------------- // // method : StartLogging::execute // // description : Trigger the execution of the method implementing // the StartLogging command of the DServerClass // //-------------------------------------------------------------------------- CORBA::Any *StartLogging::execute (DeviceImpl *device, TANGO_UNUSED(const CORBA::Any &in_any)) { cout4 << "StartLogging::execute(): arrived " << endl; // // Call the concrete device method // (static_cast(device))->start_logging(); // // Return to caller // CORBA::Any *ret = return_empty_any("StartLogging"); return ret; } } // namespace Tango #endif // TANGO_HAS_LOG4TANGO tango-8.1.2c+dfsg.orig/lib/cpp/server/pollext.h0000644000175000017500000010547212205375142020303 0ustar piccapicca//============================================================================= // // file : PollExt.h // // description : Include for classes used by the method dedicated // to fill the polling buffer for command or // attributes. // // project : TANGO // // author(s) : E.Taurel // // Copyright (C) : 2004,2005,2006,2007,2008,2009,2010,2011,2012,2013 // European Synchrotron Radiation Facility // BP 220, Grenoble 38043 // FRANCE // // This file is part of Tango. // // Tango 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. // // Tango 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 Tango. If not, see . // // $Revision: 15556 // //============================================================================= #ifndef _POLLEXT_H #define _POLLEXT_H #include namespace Tango { //============================================================================= // // Attribute related class // // description : These classes are used when the user want to fill // attribute polling buffer // //============================================================================= //============================================================================= // // The AttrData class // // // description : This class is used to store all the data needed to build // an attribute value. // //============================================================================= #define __CHECK_DIM() \ if ((x == 0) || (y == 0)) \ { \ Except::throw_exception((const char *)API_AttrOptProp, \ (const char *)"X or Y dimension cannot be 0 for image attribute", \ (const char *)"AttrData::AttrData"); \ } \ else \ (void)0 #define __CHECK_DIM_X() \ if (x == 0) \ { \ Except::throw_exception((const char *)API_AttrOptProp, \ (const char *)"X dimension cannot be 0 for spectrum or image attribute", \ (const char *)"AttrData::AttrData"); \ } \ else \ (void)0 template class AttrData { public: const T *ptr; Tango::AttrQuality qual; long x; long y; bool release; DevErrorList err; long wr_x; long wr_y; const T *wr_ptr; AttrData(const T *p): ptr(p),wr_x(0),wr_y(0),wr_ptr(NULL) {qual=Tango::ATTR_VALID;x=1;y=0;release=false;} AttrData(const T *p,Tango::AttrQuality q): ptr(p),qual(q),wr_x(0),wr_y(0),wr_ptr(NULL) {x=1;y=0;release=false;} AttrData(const T *p,Tango::AttrQuality q,bool rel): ptr(p),qual(q),release(rel),wr_x(0),wr_y(0),wr_ptr(NULL) {x=1;y=0;} AttrData(const T *p,const T *wr_p): ptr(p),wr_y(0),wr_ptr(wr_p) {qual=Tango::ATTR_VALID;x=1;y=0;wr_x=1;release=false;} AttrData(const T *p,const T *wr_p,Tango::AttrQuality q): ptr(p),qual(q),wr_y(0),wr_ptr(wr_p) {x=1;y=0;wr_x=1;release=false;} AttrData(const T *p,const T *wr_p,Tango::AttrQuality q,bool rel): ptr(p),qual(q),release(rel),wr_y(0),wr_ptr(wr_p) {x=1;y=0;wr_x=1;} // For spectrum AttrData(const T *p,long nb): ptr(p),x(nb),wr_x(0),wr_y(0),wr_ptr(NULL) {__CHECK_DIM_X();qual=Tango::ATTR_VALID;y=0;release=false;} AttrData(const T *p,long nb,Tango::AttrQuality q): ptr(p),qual(q),x(nb),wr_x(0),wr_y(0),wr_ptr(NULL) {__CHECK_DIM_X();y=0;release=false;} AttrData(const T *p,long nb,Tango::AttrQuality q,bool rel): ptr(p),qual(q),x(nb),release(rel),wr_x(0),wr_y(0),wr_ptr(NULL) {__CHECK_DIM_X();y=0;} AttrData(const T *p,long nb,const T *wr_p,long wr_nb): ptr(p),x(nb),wr_x(wr_nb),wr_y(0),wr_ptr(wr_p) {__CHECK_DIM_X();qual=Tango::ATTR_VALID;y=0;release=false;} AttrData(const T *p,long nb,const T *wr_p,long wr_nb,Tango::AttrQuality q): ptr(p),qual(q),x(nb),wr_x(wr_nb),wr_y(0),wr_ptr(wr_p) {__CHECK_DIM_X();y=0;release=false;} AttrData(const T *p,long nb,const T *wr_p,long wr_nb,Tango::AttrQuality q,bool rel): ptr(p),qual(q),x(nb),release(rel),wr_x(wr_nb),wr_y(0),wr_ptr(wr_p) {__CHECK_DIM_X();y=0;} // For image AttrData(const T *p,long nb,long nb2): ptr(p),x(nb),y(nb2),wr_x(0),wr_y(0),wr_ptr(NULL) {__CHECK_DIM();qual=Tango::ATTR_VALID;release=false;} AttrData(const T *p,long nb,long nb2,Tango::AttrQuality q): ptr(p),qual(q),x(nb),y(nb2),wr_x(0),wr_y(0),wr_ptr(NULL) {__CHECK_DIM();release=false;} AttrData(const T *p,long nb,long nb2,Tango::AttrQuality q,bool rel): ptr(p),qual(q), x(nb),y(nb2),release(rel),wr_x(0),wr_y(0),wr_ptr(NULL) {__CHECK_DIM();} AttrData(const T *p,long nb,long nb2,const T *wr_p,long wr_nb,long wr_nb2): ptr(p),x(nb),y(nb2),wr_x(wr_nb),wr_y(wr_nb2),wr_ptr(wr_p) {__CHECK_DIM();qual=Tango::ATTR_VALID;release=false;} AttrData(const T *p,long nb,long nb2,const T *wr_p,long wr_nb,long wr_nb2,Tango::AttrQuality q): ptr(p),qual(q),x(nb),y(nb2),wr_x(wr_nb),wr_y(wr_nb2),wr_ptr(wr_p) {__CHECK_DIM();release=false;} AttrData(const T *p,long nb,long nb2,const T *wr_p,long wr_nb,long wr_nb2,Tango::AttrQuality q,bool rel): ptr(p),qual(q), x(nb),y(nb2),release(rel),wr_x(wr_nb),wr_y(wr_nb2),wr_ptr(wr_p) {__CHECK_DIM();} // For error AttrData(DevErrorList &e): ptr(NULL),x(0),y(0),release(false),err(e), wr_x(0),wr_y(0),wr_ptr(NULL) {} }; //============================================================================= // // The TimedAttrData class // // // description : This class inherits from the AttrData class and adds // a date to all the data contains in the AttrData // class // //============================================================================= /** * This class is used to store one element of an attribute history stack. * * $Author: taurel $ * $Revision: 22213 $ * * @headerfile tango.h * @ingroup Server */ template class TimedAttrData:public Tango::AttrData { public: /**@name Miscellaneous constructors for scalar attribute */ //@{ /** * Create a new TimedAttrData object. * * The memory pointed to by the p_data parameter will not be freed * The attribute quality factor will be set to ATTR_VALID * * @param p_data Pointer to the attribute value * @param when The date */ TimedAttrData(const T *p_data,time_t when): AttrData(p_data) {t_val.tv_sec = time_t_2_long(when);t_val.tv_usec = 0;} /** * Create a new TimedAttrData object for a R/W attribute. * * The memory pointed to by the p_data and p_wr_data parameters will not be freed * The attribute quality factor will be set to ATTR_VALID * * @param p_data Pointer to the attribute value * @param p_wr_data Pointer to the written part of the attribute value * @param when The date */ TimedAttrData(const T *p_data,const T *p_wr_data,time_t when): AttrData(p_data,p_wr_data) {t_val.tv_sec = time_t_2_long(when);t_val.tv_usec = 0;} /** * Create a new TimedAttrData object. * * The memory pointed to by the p_data parameter will not be freed * * @param p_data Pointer to the attribute value * @param qual The attribute quality factor * @param when The date */ TimedAttrData(const T *p_data,Tango::AttrQuality qual,time_t when): AttrData(p_data,qual) {t_val.tv_sec = time_t_2_long(when);t_val.tv_usec = 0;} /** * Create a new TimedAttrData object for a R/W attribute. * * The memory pointed to by the p_data and p_wr_data parameters will not be freed * * @param p_data Pointer to the attribute value * @param p_wr_data Pointer to the written part of the attribute value * @param qual The attribute quality factor * @param when The date */ TimedAttrData(const T *p_data,const T *p_wr_data,Tango::AttrQuality qual,time_t when): AttrData(p_data,p_wr_data,qual) {t_val.tv_sec = time_t_2_long(when);t_val.tv_usec = 0;} /** * Create a new TimedAttrData object. * * @param p_data Pointer to the attribute value * @param qual The attribute quality factor * @param rel Set to true if the memory pointed to by the p_data parameter must be freed * @param when The date */ TimedAttrData(const T *p_data,Tango::AttrQuality qual,bool rel,time_t when): AttrData(p_data,qual,rel) {t_val.tv_sec = time_t_2_long(when);t_val.tv_usec = 0;} /** * Create a new TimedAttrData object for a R/W attribute. * * @param p_data Pointer to the attribute value * @param p_wr_data Pointer to the written part of the attribute value * @param qual The attribute quality factor * @param rel Set to true if the memory pointed to by the p_data and p_wr_data parameters must be freed * @param when The date */ TimedAttrData(const T *p_data,const T *p_wr_data,Tango::AttrQuality qual,bool rel,time_t when): AttrData(p_data,p_wr_data,qual,rel) {t_val.tv_sec = time_t_2_long(when);t_val.tv_usec = 0;} /** * Create a new TimedAttrData object. * * The memory pointed to by the p_data parameter will not be freed * The attribute quality factor will be set to ATTR_VALID * * @param p_data Pointer to the attribute value * @param when The date */ TimedAttrData(const T *p_data,struct timeval when): AttrData(p_data),t_val(when) {} /** * Create a new TimedAttrData object for a R/W attribute. * * The memory pointed to by the p_data and p_wr_data parameters will not be freed * The attribute quality factor will be set to ATTR_VALID * * @param p_data Pointer to the attribute value * @param p_wr_data Pointer to the written part of the attribute value * @param when The date */ TimedAttrData(const T *p_data,const T *p_wr_data,struct timeval when): AttrData(p_data,p_wr_data),t_val(when) {} /** * Create a new TimedAttrData object. * * The memory pointed to by the p_data parameter will not be freed * * @param p_data Pointer to the attribute value * @param qual The attribute quality factor * @param when The date */ TimedAttrData(const T *p_data,Tango::AttrQuality qual,struct timeval when): AttrData(p_data,qual),t_val(when) {} /** * Create a new TimedAttrData object for a R/W attribute. * * The memory pointed to by the p_data and p_wr_data parameters will not be freed * * @param p_data Pointer to the attribute value * @param p_wr_data Pointer to the written part of the attribute value * @param qual The attribute quality factor * @param when The date */ TimedAttrData(const T *p_data,const T *p_wr_data,Tango::AttrQuality qual,struct timeval when): AttrData(p_data,qual),t_val(when) {} /** * Create a new TimedAttrData object. * * @param p_data Pointer to the attribute value * @param qual The attribute quality factor * @param rel Set to true if the memory pointed to by the p_data parameter must be freed * @param when The date */ TimedAttrData(const T *p_data,Tango::AttrQuality qual,bool rel,struct timeval when): AttrData(p_data,qual,rel),t_val(when) {} /** * Create a new TimedAttrData object for a R/W attribute. * * @param p_data Pointer to the attribute value * @param p_wr_data Pointer to the written part of the attribute value * @param qual The attribute quality factor * @param rel Set to true if the memory pointed to by the p_data and p_wr_data parameters must be freed * @param when The date */ TimedAttrData(const T *p_data,const T *p_wr_data,Tango::AttrQuality qual,bool rel,struct timeval when): AttrData(p_data,p_wr_data,qual,rel),t_val(when) {} //@} // For spectrum /**@name Miscellaneous constructors for spectrum attribute */ //@{ /** * Create a new TimedAttrData object. * * The memory pointed to by the p_data parameter will not be freed * The attribute quality factor will be set to ATTR_VALID * * @param p_data Pointer to the attribute value * @param x The attribute x length * @param when The date */ TimedAttrData(const T *p_data,long x,time_t when): AttrData(p_data,x) {t_val.tv_sec = time_t_2_long(when);t_val.tv_usec = 0;} /** * Create a new TimedAttrData object for a R/W attribute. * * The memory pointed to by the p_data and p_wr_data parameters will not be freed * The attribute quality factor will be set to ATTR_VALID * * @param p_data Pointer to the attribute value * @param x The attribute x length * @param p_wr_data Pointer to the written part of the attribute value * @param x_wr The attribute written part x length * @param when The date */ TimedAttrData(const T *p_data,long x,const T *p_wr_data,long x_wr,time_t when): AttrData(p_data,x,p_wr_data,x_wr) {t_val.tv_sec = time_t_2_long(when);t_val.tv_usec = 0;} /** * Create a new TimedAttrData object. * * The memory pointed to by the p_data parameter will not be freed * * @param p_data Pointer to the attribute value * @param x The attribute x length * @param qual The attribute quality factor * @param when The date */ TimedAttrData(const T *p_data,long x,Tango::AttrQuality qual,time_t when): AttrData(p_data,x,qual) {t_val.tv_sec = time_t_2_long(when);t_val.tv_usec = 0;} /** * Create a new TimedAttrData object for a R/W attribute. * * The memory pointed to by the p_data and p_wr_data parameters will not be freed * * @param p_data Pointer to the attribute value * @param x The attribute x length * @param p_wr_data Pointer to the written part of the attribute value * @param x_wr The attribute written part x length * @param qual The attribute quality factor * @param when The date */ TimedAttrData(const T *p_data,long x,const T *p_wr_data,long x_wr,Tango::AttrQuality qual,time_t when): AttrData(p_data,x,p_wr_data,x_wr,qual) {t_val.tv_sec = time_t_2_long(when);t_val.tv_usec = 0;} /** * Create a new TimedAttrData object. * * @param p_data Pointer to the attribute value * @param x The attribute x length * @param qual The attribute quality factor * @param rel Set to true if the memory pointed to by the p_data parameter must be freed * @param when The date */ TimedAttrData(const T *p_data,long x,Tango::AttrQuality qual,bool rel,time_t when): AttrData(p_data,x,qual,rel) {t_val.tv_sec = time_t_2_long(when);t_val.tv_usec = 0;} /** * Create a new TimedAttrData object for a R/W attribute. * * @param p_data Pointer to the attribute value * @param x The attribute x length * @param p_wr_data Pointer to the written part of the attribute value * @param x_wr The attribute written part x length * @param qual The attribute quality factor * @param rel Set to true if the memory pointed to by the p_data and p_wr_data parameters must be freed * @param when The date */ TimedAttrData(const T *p_data,long x,const T *p_wr_data,long x_wr,Tango::AttrQuality qual,bool rel,time_t when): AttrData(p_data,x,p_wr_data,x_wr,qual,rel) {t_val.tv_sec = time_t_2_long(when);t_val.tv_usec = 0;} /** * Create a new TimedAttrData object. * * The memory pointed to by the p_data parameter will not be freed * The attribute quality factor will be set to ATTR_VALID * * @param p_data Pointer to the attribute value * @param x The attribute x length * @param when The date */ TimedAttrData(const T *p_data,long x,struct timeval when): AttrData(p_data,x),t_val(when) {} /** * Create a new TimedAttrData object for a R/W attribute. * * The memory pointed to by the p_data and p_wr_data parameters will not be freed * The attribute quality factor will be set to ATTR_VALID * * @param p_data Pointer to the attribute value * @param x The attribute x length * @param p_wr_data Pointer to the written part of the attribute value * @param x_wr The attribute written part x length * @param when The date */ TimedAttrData(const T *p_data,long x,const T *p_wr_data,long x_wr,struct timeval when): AttrData(p_data,x,p_wr_data,x_wr),t_val(when) {} /** * Create a new TimedAttrData object. * * The memory pointed to by the p_data parameter will not be freed * * @param p_data Pointer to the attribute value * @param x The attribute x length * @param qual The attribute quality factor * @param when The date */ TimedAttrData(const T *p_data,long x,Tango::AttrQuality qual,struct timeval when): AttrData(p_data,x,qual),t_val(when) {} /** * Create a new TimedAttrData object for a R/W attribute. * * The memory pointed to by the p_data and p_wr_data parameters will not be freed * * @param p_data Pointer to the attribute value * @param x The attribute x length * @param p_wr_data Pointer to the written part of the attribute value * @param x_wr The attribute written part x length * @param qual The attribute quality factor * @param when The date */ TimedAttrData(const T *p_data,long x,const T *p_wr_data,long x_wr,Tango::AttrQuality qual,struct timeval when): AttrData(p_data,x,p_wr_data,x_wr,qual),t_val(when) {} /** * Create a new TimedAttrData object. * * @param p_data Pointer to the attribute value * @param x The attribute x length * @param qual The attribute quality factor * @param rel Set to true if the memory pointed to by the p_data parameter must be freed * @param when The date */ TimedAttrData(const T *p_data,long x,Tango::AttrQuality qual,bool rel,struct timeval when): AttrData(p_data,x,qual,rel),t_val(when) {} /** * Create a new TimedAttrData object for a R/W attribute. * * @param p_data Pointer to the attribute value * @param x The attribute x length * @param p_wr_data Pointer to the written part of the attribute value * @param x_wr The attribute written part x length * @param qual The attribute quality factor * @param rel Set to true if the memory pointed to by the p_data and p_wr_data parameters must be freed * @param when The date */ TimedAttrData(const T *p_data,long x,const T *p_wr_data,long x_wr,Tango::AttrQuality qual,bool rel,struct timeval when): AttrData(p_data,x,p_wr_data,x_wr,qual,rel),t_val(when) {} //@} // For image /**@name Miscellaneous constructors for image attribute */ //@{ /** * Create a new TimedAttrData object. * * The memory pointed to by the p_data parameter will not be freed * The attribute quality factor will be set to ATTR_VALID * * @param p_data Pointer to the attribute value * @param x The attribute x length * @param y The attribute y length * @param when The date */ TimedAttrData(const T *p_data,long x,long y,time_t when): AttrData(p_data,x,y) {t_val.tv_sec = time_t_2_long(when);t_val.tv_usec = 0;} /** * Create a new TimedAttrData object for a R/W attribute. * * The memory pointed to by the p_data and p_wr_data parameters will not be freed * The attribute quality factor will be set to ATTR_VALID * * @param p_data Pointer to the attribute value * @param x The attribute x length * @param y The attribute y length * @param p_wr_data Pointer to the written part of the attribute value * @param x_wr The attribute written part x length * @param y_wr The attribute written part y length * @param when The date */ TimedAttrData(const T *p_data,long x,long y,const T *p_wr_data,long x_wr,long y_wr,time_t when): AttrData(p_data,x,y,p_wr_data,x_wr,y_wr) {t_val.tv_sec = time_t_2_long(when);t_val.tv_usec = 0;} /** * Create a new TimedAttrData object. * * The memory pointed to by the p_data parameter will not be freed * * @param p_data Pointer to the attribute value * @param x The attribute x length * @param y The attribute y length * @param qual The attribute quality factor * @param when The date */ TimedAttrData(const T *p_data,long x,long y,Tango::AttrQuality qual,time_t when): AttrData(p_data,x,y,qual) {t_val.tv_sec = time_t_2_long(when);t_val.tv_usec = 0;} /** * Create a new TimedAttrData object for a R/W attribute. * * The memory pointed to by the p_data and p_wr_data parameters will not be freed * * @param p_data Pointer to the attribute value * @param x The attribute x length * @param y The attribute y length * @param p_wr_data Pointer to the written part of the attribute value * @param x_wr The attribute written part x length * @param y_wr The attribute written part y length * @param qual The attribute quality factor * @param when The date */ TimedAttrData(const T *p_data,long x,long y,const T *p_wr_data,long x_wr,long y_wr,Tango::AttrQuality qual,time_t when): AttrData(p_data,x,y,p_wr_data,x_wr,y_wr,qual) {t_val.tv_sec = time_t_2_long(when);t_val.tv_usec = 0;} /** * Create a new TimedAttrData object. * * @param p_data Pointer to the attribute value * @param x The attribute x length * @param y The attribute y length * @param qual The attribute quality factor * @param rel Set to true if the memory pointed to by the p_data parameter must be freed * @param when The date */ TimedAttrData(const T *p_data,long x,long y,Tango::AttrQuality qual,bool rel,time_t when): AttrData(p_data,x,y,qual,rel) {t_val.tv_sec = time_t_2_long(when);t_val.tv_usec = 0;} /** * Create a new TimedAttrData object for a R/W attribute. * * @param p_data Pointer to the attribute value * @param x The attribute x length * @param y The attribute y length * @param p_wr_data Pointer to the written part of the attribute value * @param x_wr The attribute written part x length * @param y_wr The attribute written part y length * @param qual The attribute quality factor * @param rel Set to true if the memory pointed to by the p_data and p_wr_data parameters must be freed * @param when The date */ TimedAttrData(const T *p_data,long x,long y,const T *p_wr_data,long x_wr,long y_wr,Tango::AttrQuality qual,bool rel,time_t when): AttrData(p_data,x,y,p_wr_data,x_wr,y_wr,qual,rel) {t_val.tv_sec = time_t_2_long(when);t_val.tv_usec = 0;} /** * Create a new TimedAttrData object. * * The memory pointed to by the p_data parameter will not be freed * The attribute quality factor will be set to ATTR_VALID * * @param p_data Pointer to the attribute value * @param x The attribute x length * @param y The attribute y length * @param when The date */ TimedAttrData(const T *p_data,long x,long y,struct timeval when): AttrData(p_data,x,y),t_val(when) {} /** * Create a new TimedAttrData object for a R/W attribute. * * The memory pointed to by the p_data and p_wr_data parameters will not be freed * The attribute quality factor will be set to ATTR_VALID * * @param p_data Pointer to the attribute value * @param x The attribute x length * @param y The attribute y length * @param p_wr_data Pointer to the written part of the attribute value * @param x_wr The attribute written part x length * @param y_wr The attribute written part y length * @param when The date */ TimedAttrData(const T *p_data,long x,long y,const T *p_wr_data,long x_wr,long y_wr,struct timeval when): AttrData(p_data,x,y,p_wr_data,x_wr,y_wr),t_val(when) {} /** * Create a new TimedAttrData object. * * The memory pointed to by the p_data parameter will not be freed * * @param p_data Pointer to the attribute value * @param x The attribute x length * @param y The attribute y length * @param qual The attribute quality factor * @param when The date */ TimedAttrData(const T *p_data,long x,long y,Tango::AttrQuality qual,struct timeval when): AttrData(p_data,x,y,qual),t_val(when) {} /** * Create a new TimedAttrData object for a R/W attribute. * * The memory pointed to by the p_data and p_wr_data parameters will not be freed * * @param p_data Pointer to the attribute value * @param x The attribute x length * @param y The attribute y length * @param p_wr_data Pointer to the written part of the attribute value * @param x_wr The attribute written part x length * @param y_wr The attribute written part y length * @param qual The attribute quality factor * @param when The date */ TimedAttrData(const T *p_data,long x,long y,const T *p_wr_data,long x_wr,long y_wr,Tango::AttrQuality qual,struct timeval when): AttrData(p_data,x,y,p_wr_data,x_wr,y_wr,qual),t_val(when) {} /** * Create a new TimedAttrData object. * * @param p_data Pointer to the attribute value * @param x The attribute x length * @param y The attribute y length * @param qual The attribute quality factor * @param rel Set to true if the memory pointed to by the p_data parameter must be freed * @param when The date */ TimedAttrData(const T *p_data,long x,long y,Tango::AttrQuality qual,bool rel,struct timeval when): AttrData(p_data,x,y,qual,rel),t_val(when) {} /** * Create a new TimedAttrData object for a R/W attribute. * * @param p_data Pointer to the attribute value * @param x The attribute x length * @param y The attribute y length * @param p_wr_data Pointer to the written part of the attribute value * @param x_wr The attribute written part x length * @param y_wr The attribute written part y length * @param qual The attribute quality factor * @param rel Set to true if the memory pointed to by the p_data abd p_wr_data parameters must be freed * @param when The date */ TimedAttrData(const T *p_data,long x,long y,const T *p_wr_data,long x_wr,long y_wr,Tango::AttrQuality qual,bool rel,struct timeval when): AttrData(p_data,x,y,p_wr_data,x_wr,y_wr,qual,rel),t_val(when) {} //@} // For error /**@name Miscellaneous constructors for errors */ //@{ /** * Create a new TimedAttrData object for errors. * * The created TimedAttrData is used to store attribute errors * in the attribute history stack * * @param errs The error stack * @param when The date */ TimedAttrData(DevErrorList &errs,time_t when): AttrData(errs) {t_val.tv_sec = time_t_2_long(when);t_val.tv_usec = 0;} /** * Create a new TimedAttrData object for errors. * * The created TimedAttrData is used to store attribute errors * in the attribute history stack * * @param errs The error stack * @param when The date */ TimedAttrData(DevErrorList &errs,timeval when): AttrData(errs),t_val(when) {} //@} /// @privatesection struct timeval t_val; #ifdef _TG_WINDOWS_ TimedAttrData(const T *p,struct _timeb t): AttrData(p) {t_val.tv_sec = t.time;t_val.tv_usec = t.millitm*1000;} TimedAttrData(const T *p,Tango::AttrQuality q,struct _timeb t): AttrData(p,q) {t_val.tv_sec = t.time;t_val.tv_usec = t.millitm*1000;} TimedAttrData(const T *p,Tango::AttrQuality q,bool rel,struct _timeb t): AttrData(p,q,rel) {t_val.tv_sec = t.time;t_val.tv_usec = t.millitm*1000;} TimedAttrData(const T *p,const T *p_wr_data,struct _timeb t): AttrData(p,p_wr_data) {t_val.tv_sec = t.time;t_val.tv_usec = t.millitm*1000;} TimedAttrData(const T *p,const T *p_wr_data,Tango::AttrQuality q,struct _timeb t): AttrData(p,p_wr_data,q) {t_val.tv_sec = t.time;t_val.tv_usec = t.millitm*1000;} TimedAttrData(const T *p,const T *p_wr_data,Tango::AttrQuality q,bool rel,struct _timeb t): AttrData(p,p_wr_data,q,rel) {t_val.tv_sec = t.time;t_val.tv_usec = t.millitm*1000;} TimedAttrData(const T *p,long nb,struct _timeb t): AttrData(p,nb) {t_val.tv_sec = t.time;t_val.tv_usec = t.millitm*1000;} TimedAttrData(const T *p,long nb,Tango::AttrQuality q,struct _timeb t): AttrData(p,nb,q) {t_val.tv_sec = t.time;t_val.tv_usec = t.millitm*1000;} TimedAttrData(const T *p,long nb,Tango::AttrQuality q,bool rel,struct _timeb t): AttrData(p,nb,q,rel) {t_val.tv_sec = t.time;t_val.tv_usec = t.millitm*1000;} TimedAttrData(const T *p,long nb,const T *p_wr_data,long nb_wr,struct _timeb t): AttrData(p,nb,p_wr_data,nb_wr) {t_val.tv_sec = t.time;t_val.tv_usec = t.millitm*1000;} TimedAttrData(const T *p,long nb,const T *p_wr_data,long nb_wr,Tango::AttrQuality q,struct _timeb t): AttrData(p,nb,p_wr_data,nb_wr,q) {t_val.tv_sec = t.time;t_val.tv_usec = t.millitm*1000;} TimedAttrData(const T *p,long nb,const T *p_wr_data,long nb_wr,Tango::AttrQuality q,bool rel,struct _timeb t): AttrData(p,nb,p_wr_data,nb_wr,q,rel) {t_val.tv_sec = t.time;t_val.tv_usec = t.millitm*1000;} TimedAttrData(const T *p,long nb,long nb2,struct _timeb t): AttrData(p,nb,nb2) {t_val.tv_sec = t.time;t_val.tv_usec = t.millitm*1000;} TimedAttrData(const T *p,long nb,long nb2,Tango::AttrQuality q,struct _timeb t): AttrData(p,nb,nb2,q) {t_val.tv_sec = t.time;t_val.tv_usec = t.millitm*1000;} TimedAttrData(const T *p,long nb,long nb2,Tango::AttrQuality q,bool rel,struct _timeb t): AttrData(p,nb,nb2,q,rel) {t_val.tv_sec = t.time;t_val.tv_usec = t.millitm*1000;} TimedAttrData(const T *p,long nb,long nb2,const T *p_wr_data,long nb_wr,long nb2_wr,struct _timeb t): AttrData(p,nb,nb2,p_wr_data,nb_wr,nb2_wr) {t_val.tv_sec = t.time;t_val.tv_usec = t.millitm*1000;} TimedAttrData(const T *p,long nb,long nb2,const T *p_wr_data,long nb_wr,long nb2_wr,Tango::AttrQuality q,struct _timeb t): AttrData(p,nb,nb2,p_wr_data,nb_wr,nb2_wr,q) {t_val.tv_sec = t.time;t_val.tv_usec = t.millitm*1000;} TimedAttrData(const T *p,long nb,long nb2,const T *p_wr_data,long nb_wr,long nb2_wr,Tango::AttrQuality q,bool rel,struct _timeb t): AttrData(p,nb,nb2,p_wr_data,nb_wr,nb2_wr,q,rel) {t_val.tv_sec = t.time;t_val.tv_usec = t.millitm*1000;} #endif }; //============================================================================= // // The AttrHistoryStack class // // // description : This class is simply a wrapper above a vector of // TimedAttrData class. It is used to pass an attribute // value history which will be stored in the polling // buffer // //============================================================================= /** * This class is a used to pass an attribute value history when the user * directly fills the attribute polling buffer. Each element in this stack * will be used to store one element of the attribute polling buffer * * $Author: taurel $ * $Revision: 22213 $ * * @headerfile tango.h * @ingroup Server */ template class AttrHistoryStack { public: /** * Store a new element in the stack * * This method stores a new element in the stack * * @param elt The new element */ void push(TimedAttrData const &elt) {hist.push_back(elt);} /** * Get stack depth * * @return The stack depth */ size_t length() {return hist.size();} /** * Reserve memory for stack elements * * @param nb The stack element number */ void length(long nb) {hist.reserve(nb);} /** * Clear the stack */ void clear() {hist.clear();} /** * Get stack data * * @return The stack itself */ vector > &get_data() {return hist;} /// @privatesection AttrHistoryStack() {}; vector > hist; }; //============================================================================= // // Command related class // // description : These classes are used when the user want to fill // command polling buffer // //============================================================================= //============================================================================= // // The TimedCmdData class // // // description : This class is used to store all the data needed to build // a command value plus a date. // //============================================================================= /** * This class is used to store one element of a command history stack. * * $Author: taurel $ * $Revision: 22213 $ * * @headerfile tango.h * @ingroup Server */ template class TimedCmdData { public: /**@name Constructors * Miscellaneous constructors */ //@{ /** * Create a new TimedCmdData object. * * The memory pointed to by the p_data parameter will not be freed * * @param p_data Pointer to the command result data * @param when The date */ TimedCmdData(T *p_data,time_t when): ptr(p_data),release(false) {t_val.tv_sec = time_t_2_long(when);t_val.tv_usec = 0;} /** * Create a new TimedCmdData object with memory management. * * @param p_data Pointer to the command result data * @param rel Set to true if the memory pointed to by the p_data parameter must be freed * @param when The date */ TimedCmdData(T *p_data,bool rel,time_t when): ptr(p_data),release(rel) {t_val.tv_sec = time_t_2_long(when);t_val.tv_usec = 0;} /** * Create a new TimedCmdData object. * * The memory pointed to by the p_data parameter will not be freed * * @param p_data Pointer to the command result data * @param when The date */ TimedCmdData(T *p_data,struct timeval when): ptr(p_data),t_val(when),release(false) {} /** * Create a new TimedCmdData object with memory management. * * @param p_data Pointer to the command result data * @param rel Set to true if the memory pointed to by the p_data parameter must be freed * @param when The date */ TimedCmdData(T *p_data,bool rel,struct timeval when): ptr(p_data),t_val(when),release(rel) {} /** * Create a new TimedCmdData object for errors. * * The created TimedCmdData is used to store command errors * in the command history stack * * @param errs The error stack * @param when The date */ TimedCmdData(DevErrorList errs,time_t when): ptr(NULL),err(errs),release(false) {t_val.tv_sec = when;t_val.tv_usec = 0;} /** * Create a new TimedCmdData object for errors. * * The created TimedCmdData is used to store command errors * in the command history stack * * @param errs The error stack * @param when The date */ TimedCmdData(DevErrorList errs,timeval when): ptr(NULL),err(errs),t_val(when),release(false) {} //@} /// @privatesection T *ptr; DevErrorList err; struct timeval t_val; bool release; #ifdef _TG_WINDOWS_ TimedCmdData(T *p,struct _timeb t): ptr(p),release(false) {t_val.tv_sec = t.time;t_val.tv_usec = t.millitm*1000;} TimedCmdData(T *p,bool rel,struct _timeb t): ptr(p),release(rel) {t_val.tv_sec = t.time;t_val.tv_usec = t.millitm*1000;} #endif }; //============================================================================= // // The CmdHistoryStack class // // // description : This class is simply a wrapper above a vector of // TimedCmdData class. It is used to pass a command // value history which will be stored in the polling // buffer // //============================================================================= /** * This class is a used to pass a command result history when the user * directly fills the command polling buffer. Each element in this stack * will be used to store one element of the command polling buffer * * $Author: taurel $ * $Revision: 22213 $ * * @headerfile tango.h * @ingroup Server */ template class CmdHistoryStack { public: /** * Store a new element in the stack * * This method stores a new element in the stack * * @param elt The new element */ void push(Tango::TimedCmdData const &elt) {hist.push_back(elt);} /** * Get stack depth * * @return The stack depth */ size_t length() {return hist.size();} /** * Reserve memory for stack elements * * @param nb The stack element number */ void length(long nb) {hist.reserve(nb);} /** * Clear the stack */ void clear() {hist.clear();} /** * Get stack data * * @return The stack itself */ vector > &get_data() {return hist;} /// @privatesection CmdHistoryStack() {}; vector > hist; }; } // End of Tango namespace #endif /* _POLLOBJ_ */ tango-8.1.2c+dfsg.orig/lib/cpp/server/attribute.cpp0000644000175000017500000124403512205375142021152 0ustar piccapiccastatic const char *RcsId = "$Id: attribute.cpp 22617 2013-05-05 12:53:58Z taurel $\n$Name$"; //==================================================================================================================== // // file : Attribute.cpp // // description : C++ source code for the Attribute and WAttribute classes. These classes are used to manage // attribute. A Tango Device object instance has one MultiAttribute object which is an aggregate of // Attribute or WAttribute objects // // project : TANGO // // author(s) : E.Taurel // // Copyright (C) : 2004,2005,2006,2007,2008,2009,2010,2011,2012,2013 // European Synchrotron Radiation Facility // BP 220, Grenoble 38043 // FRANCE // // This file is part of Tango. // // Tango 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. // // Tango 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 Tango. // If not, see . // // $Revision: 22617 $ // //===================================================================================================================== #if HAVE_CONFIG_H #include #endif #include #include #include #include #include #include #ifdef _TG_WINDOWS_ #include #include #else #include #endif /* _TG_WINDOWS_ */ #include namespace Tango { RANGES_TYPE2CONST(Tango::DevDouble,DEV_DOUBLE) RANGES_TYPE2CONST(Tango::DevFloat,DEV_FLOAT) RANGES_TYPE2CONST(Tango::DevLong,DEV_LONG) RANGES_TYPE2CONST(Tango::DevLong64,DEV_LONG64) RANGES_TYPE2CONST(Tango::DevShort,DEV_SHORT) RANGES_TYPE2CONST(Tango::DevUChar,DEV_UCHAR) RANGES_TYPE2CONST(Tango::DevULong,DEV_ULONG) RANGES_TYPE2CONST(Tango::DevULong64,DEV_ULONG64) RANGES_TYPE2CONST(Tango::DevUShort,DEV_USHORT) RANGES_TYPE2CONST(Tango::DevEncoded,DEV_ENCODED) RANGES_TYPE2CONST(Tango::DevBoolean,DEV_BOOLEAN) RANGES_TYPE2CONST(Tango::DevString,DEV_STRING) RANGES_TYPE2CONST(Tango::DevState,DEV_STATE) // // A classical function which will be used as unary predicate for the find_if // algo. It must be used with the bind2nd adapter to be transform as unary and // with the ptr_fun adapter to be transform as a function object // static bool WantedProp_f(AttrProperty a,const char *n) { return (a.get_name() == n); } //+-------------------------------------------------------------------------------------------------------------------- // // method : // Attribute::Attribute // // description : // constructor for the Attribute class from the attribute property vector, its type and the device name // // argument : // in : // - prop_list : The attribute property list // - type : The attribute data type // - dev_name : The device name // //--------------------------------------------------------------------------------------------------------------------- Attribute::Attribute(vector &prop_list, Attr &tmp_attr,string &dev_name,long idx) :date(true),quality(Tango::ATTR_VALID),check_min_value(false),check_max_value(false) { // // Create the extension class and init some of its members // ext = new Attribute::AttributeExt(); ext->idx_in_attr = idx; ext->d_name = dev_name; ext->attr_serial_model = ATTR_BY_KERNEL; ext->scalar_str_attr_release = false; // // Init the attribute name // name = tmp_attr.get_name(); name_size = name.size(); name_lower = name; transform(name_lower.begin(),name_lower.end(),name_lower.begin(),::tolower); // // Clear alarm data // alarm_conf.reset(); alarm.reset(); // // Init the remaining attribute main characteristic // data_type = tmp_attr.get_type(); writable = tmp_attr.get_writable(); data_format = tmp_attr.get_format(); ext->disp_level = tmp_attr.get_disp_level(); ext->poll_period = tmp_attr.get_polling_period(); writable_attr_name = tmp_attr.get_assoc(); // // Init the event characteristics // ext->change_event_implmented = tmp_attr.is_change_event(); ext->check_change_event_criteria = tmp_attr.is_check_change_criteria(); ext->archive_event_implmented = tmp_attr.is_archive_event(); ext->check_archive_event_criteria = tmp_attr.is_check_archive_criteria(); ext->dr_event_implmented = tmp_attr.is_data_ready_event(); switch(data_format) { case Tango::SPECTRUM: max_x = static_cast(tmp_attr).get_max_x(); max_y = 0; dim_y = 0; break; case Tango::IMAGE: max_x = static_cast(tmp_attr).get_max_x(); max_y = static_cast(tmp_attr).get_max_y(); break; default : max_x = 1; max_y = 0; dim_x = 1; dim_y = 0; } // // Initialise optional properties // init_opt_prop(prop_list,dev_name); // // Initialise event related fields // init_event_prop(prop_list,dev_name,tmp_attr); } //+-------------------------------------------------------------------------------------------------------------------- // // method : // Attribute::init_event_prop // // description : // Init the event related properties // // argument: // in : // - prop_list : The property vector // - dev_name : The device name // - att : The user attribute object // //--------------------------------------------------------------------------------------------------------------------- void Attribute::init_event_prop(vector &prop_list,const string &dev_name,Attr &att) { ext->rel_change[0] = INT_MAX; // default for relative change is none ext->rel_change[1] = INT_MAX; // default for relative change is none ext->abs_change[0] = INT_MAX; // default for absolute change is none ext->abs_change[1] = INT_MAX; // default for absolute change is none ext->archive_rel_change[0] = INT_MAX; // default for archive change is none ext->archive_rel_change[1] = INT_MAX; // default for archive change is none ext->archive_abs_change[0] = INT_MAX; // default for archive change is none ext->archive_abs_change[1] = INT_MAX; // default for archive change is none ext->notifd_event = false; ext->zmq_event = false; vector &def_user_prop = att.get_user_default_properties(); size_t nb_user = def_user_prop.size(); // // Init min and max relative change for change event // try { string rel_change_str; bool rel_change_defined = false; try { rel_change_str = get_attr_value(prop_list,"rel_change"); rel_change_defined = true; } catch (...) {} if(rel_change_defined) { if((data_type != Tango::DEV_STRING) && (data_type != Tango::DEV_BOOLEAN) && (data_type != Tango::DEV_STATE)) { vector rel_change; vector rel_change_set_usr_def; vector unused; validate_change_properties(dev_name,"rel_change",rel_change_str,rel_change,rel_change_set_usr_def,unused); ext->rel_change[0] = rel_change[0]; ext->rel_change[1] = rel_change[1]; if(rel_change_set_usr_def[0] || rel_change_set_usr_def[1]) { if (nb_user != 0) { size_t i; for (i = 0;i < nb_user;i++) { if (def_user_prop[i].get_name() == "rel_change") break; } if (i != nb_user) { vector rel_change_usr_def; validate_change_properties(dev_name,"rel_change",def_user_prop[i].get_value(),rel_change_usr_def); if(rel_change_set_usr_def[0]) ext->rel_change[0] = rel_change_usr_def[0]; if(rel_change_set_usr_def[1]) ext->rel_change[1] = rel_change_usr_def[1]; } } } cout1 << "Attribute::Attribute(): rel_change = " << ext->rel_change[0] << " " << ext->rel_change[1] << endl; } else throw_err_data_type("rel_change",dev_name,"Attribute::init_event_prop()"); } } catch(DevFailed &e) { add_startup_exception("rel_change",e); } // // Init min and max absolute change for change event // try { string abs_change_str; bool abs_change_defined = false; try { abs_change_str = get_attr_value(prop_list,"abs_change"); abs_change_defined = true; } catch (...) {} if(abs_change_defined) { if((data_type != Tango::DEV_STRING) && (data_type != Tango::DEV_BOOLEAN) && (data_type != Tango::DEV_STATE)) { vector abs_change; vector abs_change_set_usr_def; vector unused; validate_change_properties(dev_name,"abs_change",abs_change_str,abs_change,abs_change_set_usr_def,unused); ext->abs_change[0] = abs_change[0]; ext->abs_change[1] = abs_change[1]; if(abs_change_set_usr_def[0] || abs_change_set_usr_def[1]) { if (nb_user != 0) { size_t i; for (i = 0;i < nb_user;i++) { if (def_user_prop[i].get_name() == "abs_change") break; } if (i != nb_user) { vector abs_change_usr_def; validate_change_properties(dev_name,"abs_change",def_user_prop[i].get_value(),abs_change_usr_def); if(abs_change_set_usr_def[0]) ext->abs_change[0] = abs_change_usr_def[0]; if(abs_change_set_usr_def[1]) ext->abs_change[1] = abs_change_usr_def[1]; } } } cout1 << "Attribute::Attribute(): abs_change = " << ext->abs_change[0] << " " << ext->abs_change[1] << endl; } else throw_err_data_type("abs_change",dev_name,"Attribute::init_event_prop()"); } } catch(DevFailed &e) { add_startup_exception("abs_change",e); } // // Init min and max relative change for archive event // try { string archive_rel_change_str; bool archive_rel_change_defined = false; try { archive_rel_change_str = get_attr_value(prop_list,"archive_rel_change"); archive_rel_change_defined = true; } catch (...) {} if(archive_rel_change_defined) { if((data_type != Tango::DEV_STRING) && (data_type != Tango::DEV_BOOLEAN) && (data_type != Tango::DEV_STATE)) { vector archive_rel_change; vector archive_rel_change_set_usr_def; vector unused; validate_change_properties(dev_name,"archive_rel_change",archive_rel_change_str,archive_rel_change,archive_rel_change_set_usr_def,unused); ext->archive_rel_change[0] = archive_rel_change[0]; ext->archive_rel_change[1] = archive_rel_change[1]; if(archive_rel_change_set_usr_def[0] || archive_rel_change_set_usr_def[1]) { if (nb_user != 0) { size_t i; for (i = 0;i < nb_user;i++) { if (def_user_prop[i].get_name() == "archive_rel_change") break; } if (i != nb_user) { vector archive_rel_change_usr_def; validate_change_properties(dev_name,"archive_rel_change",def_user_prop[i].get_value(),archive_rel_change_usr_def); if(archive_rel_change_set_usr_def[0]) ext->archive_rel_change[0] = archive_rel_change_usr_def[0]; if(archive_rel_change_set_usr_def[1]) ext->archive_rel_change[1] = archive_rel_change_usr_def[1]; } } } cout1 << "Attribute::Attribute(): archive_rel_change = " << ext->archive_rel_change[0] << " " << ext->archive_rel_change[1] << endl; } else throw_err_data_type("archive_rel_change",dev_name,"Attribute::init_event_prop()"); } } catch(DevFailed &e) { add_startup_exception("archive_rel_change",e); } // // Init min and max absolute change for archive event // try { string archive_abs_change_str; bool archive_abs_change_defined = false; try { archive_abs_change_str = get_attr_value(prop_list,"archive_abs_change"); archive_abs_change_defined = true; } catch (...) {} if(archive_abs_change_defined) { if((data_type != Tango::DEV_STRING) && (data_type != Tango::DEV_BOOLEAN) && (data_type != Tango::DEV_STATE)) { vector archive_abs_change; vector archive_abs_change_set_usr_def; vector unused; validate_change_properties(dev_name,"archive_abs_change",archive_abs_change_str,archive_abs_change,archive_abs_change_set_usr_def,unused); ext->archive_abs_change[0] = archive_abs_change[0]; ext->archive_abs_change[1] = archive_abs_change[1]; if(archive_abs_change_set_usr_def[0] || archive_abs_change_set_usr_def[1]) { if (nb_user != 0) { size_t i; for (i = 0;i < nb_user;i++) { if (def_user_prop[i].get_name() == "archive_abs_change") break; } if (i != nb_user) { vector archive_abs_change_usr_def; validate_change_properties(dev_name,"archive_abs_change",def_user_prop[i].get_value(),archive_abs_change_usr_def); if(archive_abs_change_set_usr_def[0]) ext->archive_abs_change[0] = archive_abs_change_usr_def[0]; if(archive_abs_change_set_usr_def[1]) ext->archive_abs_change[1] = archive_abs_change_usr_def[1]; } } } cout1 << "Attribute::Attribute(): archive_abs_change = " << ext->archive_abs_change[0] << " " << ext->archive_abs_change[1] << endl; } else throw_err_data_type("archive_abs_change",dev_name,"Attribute::init_event_prop()"); } } catch(DevFailed &e) { add_startup_exception("archive_abs_change",e); } // // Init period for periodic event // try { ext->event_period = (int)(DEFAULT_EVENT_PERIOD); // default for event period is 1 second string event_period_str; bool event_period_defined = false; try { event_period_str = get_attr_value(prop_list,"event_period"); event_period_defined = true; } catch (...) { } if(event_period_defined) { TangoSys_MemStream str; int event_period = 0; str << event_period_str; if(str >> event_period && str.eof()) { if (event_period > 0) ext->event_period = event_period; cout1 << "Attribute::Attribute(): event_period_str " << event_period_str << " event_period = " << ext->event_period << endl; } else throw_err_format("event_period",dev_name,"Attribute::init_event_prop()"); } } catch(DevFailed &e) { add_startup_exception("event_period",e); } // // Init period for archive event // try { ext->archive_period = (int)(INT_MAX); string archive_period_str; bool archive_period_defined = false; try { archive_period_str = get_attr_value(prop_list,"archive_period"); archive_period_defined = true; } catch (...) { } if(archive_period_defined) { TangoSys_MemStream str; int archive_period = 0; str << archive_period_str; if(str >> archive_period && str.eof()) { if (archive_period > 0) { ext->archive_period = archive_period; } cout1 << "Attribute::Attribute(): archive_period_str " << archive_period_str << " archive_period = " << ext->archive_period << endl; } else throw_err_format("archive_period",dev_name,"Attribute::init_event_prop()"); } } catch(DevFailed &e) { add_startup_exception("archive_period",e); } // // Init remaining parameters // ext->periodic_counter = 0; ext->archive_periodic_counter = 0; ext->last_periodic = 0.; ext->archive_last_periodic = 0.; ext->prev_change_event.inited = false; ext->prev_quality_event.inited = false; ext->prev_archive_event.inited = false; // // do not start sending events automatically, wait for the first client to subscribe. Sending events automatically // will put an unnecessary load on the server because all attributes will be polled // ext->event_change_subscription = 0; ext->event_archive_subscription = 0; ext->event_quality_subscription = 0; ext->event_periodic_subscription = 0; ext->event_user_subscription = 0; ext->event_attr_conf_subscription = 0; ext->event_data_ready_subscription = 0; } //+-------------------------------------------------------------------------------------------------------------------- // // method : // Attribute::init_opt_prop // // description : // Init the optional properties // // argument : // in : // - prop_list : The property vector // - dev_name : The device name (usefull for error) // //--------------------------------------------------------------------------------------------------------------------- void Attribute::init_opt_prop(vector &prop_list,string &dev_name) { // // Init the label property // try { label = get_attr_value(prop_list,"label"); } catch(DevFailed &e) { add_startup_exception("label",e); } // // Init the description property // try { description = get_attr_value(prop_list,"description"); } catch(DevFailed &e) { add_startup_exception("description",e); } // // Init the unit property // try { unit = get_attr_value(prop_list,"unit"); } catch(DevFailed &e) { add_startup_exception("unit",e); } // // Init the standard unit property // try { standard_unit = get_attr_value(prop_list,"standard_unit"); } catch(DevFailed &e) { add_startup_exception("standard_unit",e); } // // Init the display unit property // try { display_unit = get_attr_value(prop_list,"display_unit"); } catch(DevFailed &e) { add_startup_exception("display_unit",e); } // // Init the format property // try { format = get_attr_value(prop_list,"format"); } catch(DevFailed &e) { add_startup_exception("format",e); } TangoSys_MemStream str; bool empty = true; // // Init the min alarm property // try { min_alarm_str = get_attr_value(prop_list,"min_alarm"); if (min_alarm_str != AlrmValueNotSpec) { if((data_type != Tango::DEV_STRING) && (data_type != Tango::DEV_BOOLEAN) && (data_type != Tango::DEV_STATE)) { str << min_alarm_str; empty = false; switch (data_type) { case Tango::DEV_SHORT: if (!(str >> min_alarm.sh && str.eof())) throw_err_format("min_alarm",dev_name,"Attribute::init_opt_prop()"); if(alarm_conf.test(max_level) && min_alarm.sh >= max_alarm.sh) throw_incoherent_val_err("min_alarm","max_alarm",dev_name,"Attribute::init_opt_prop()"); break; case Tango::DEV_LONG: if (!(str >> min_alarm.db && str.eof())) throw_err_format("min_alarm",dev_name,"Attribute::init_opt_prop()"); min_alarm.lg = (DevLong)min_alarm.db; if(alarm_conf.test(max_level) && min_alarm.lg >= max_alarm.lg) throw_incoherent_val_err("min_alarm","max_alarm",dev_name,"Attribute::init_opt_prop()"); break; case Tango::DEV_LONG64: if (!(str >> min_alarm.db && str.eof())) throw_err_format("min_alarm",dev_name,"Attribute::init_opt_prop()"); min_alarm.lg64 = (DevLong64)min_alarm.db; if(alarm_conf.test(max_level) && min_alarm.lg64 >= max_alarm.lg64) throw_incoherent_val_err("min_alarm","max_alarm",dev_name,"Attribute::init_opt_prop()"); break; case Tango::DEV_DOUBLE: if (!(str >> min_alarm.db && str.eof())) throw_err_format("min_alarm",dev_name,"Attribute::init_opt_prop()"); if(alarm_conf.test(max_level) && min_alarm.db >= max_alarm.db) throw_incoherent_val_err("min_alarm","max_alarm",dev_name,"Attribute::init_opt_prop()"); break; case Tango::DEV_FLOAT: if (!(str >> min_alarm.fl && str.eof())) throw_err_format("min_alarm",dev_name,"Attribute::init_opt_prop()"); if(alarm_conf.test(max_level) && min_alarm.fl >= max_alarm.fl) throw_incoherent_val_err("min_alarm","max_alarm",dev_name,"Attribute::init_opt_prop()"); break; case Tango::DEV_USHORT: if (!(str >> min_alarm.ush && str.eof())) throw_err_format("min_alarm",dev_name,"Attribute::init_opt_prop()"); if(alarm_conf.test(max_level) && min_alarm.ush >= max_alarm.ush) throw_incoherent_val_err("min_alarm","max_alarm",dev_name,"Attribute::init_opt_prop()"); break; case Tango::DEV_UCHAR: if (!(str >> min_alarm.sh && str.eof())) throw_err_format("min_alarm",dev_name,"Attribute::init_opt_prop()"); min_alarm.uch = (DevUChar)min_alarm.sh; if(alarm_conf.test(max_level) && min_alarm.uch >= max_alarm.uch) throw_incoherent_val_err("min_alarm","max_alarm",dev_name,"Attribute::init_opt_prop()"); break; case Tango::DEV_ULONG: if (!(str >> min_alarm.db && str.eof())) throw_err_format("min_alarm",dev_name,"Attribute::init_opt_prop()"); min_alarm.ulg = (DevULong)min_alarm.db; if(alarm_conf.test(max_level) && min_alarm.ulg >= max_alarm.ulg) throw_incoherent_val_err("min_alarm","max_alarm",dev_name,"Attribute::init_opt_prop()"); break; case Tango::DEV_ULONG64: if (!(str >> min_alarm.db && str.eof())) throw_err_format("min_alarm",dev_name,"Attribute::init_opt_prop()"); min_alarm.ulg64 = (DevULong64)min_alarm.db; if(alarm_conf.test(max_level) && min_alarm.ulg64 >= max_alarm.ulg64) throw_incoherent_val_err("min_alarm","max_alarm",dev_name,"Attribute::init_opt_prop()"); break; case Tango::DEV_ENCODED: if (!(str >> min_alarm.sh && str.eof())) throw_err_format("min_alarm",dev_name,"Attribute::init_opt_prop()"); min_alarm.uch = (DevUChar)min_alarm.sh; if(alarm_conf.test(max_level) && min_alarm.uch >= max_alarm.uch) throw_incoherent_val_err("min_alarm","max_alarm",dev_name,"Attribute::init_opt_prop()"); break; } alarm_conf.set(min_level); } else throw_err_data_type("min_alarm",dev_name,"Attribute::init_opt_prop()"); } } catch(DevFailed &e) { add_startup_exception("min_alarm",e); } // // Init the max alarm property // try { max_alarm_str = get_attr_value(prop_list,"max_alarm"); if (max_alarm_str != AlrmValueNotSpec) { if((data_type != Tango::DEV_STRING) && (data_type != Tango::DEV_BOOLEAN) && (data_type != Tango::DEV_STATE)) { if (empty == false) { str.str(""); str.clear(); } str << max_alarm_str; empty = false; switch (data_type) { case Tango::DEV_SHORT: if (!(str >> max_alarm.sh && str.eof())) throw_err_format("max_alarm",dev_name,"Attribute::init_opt_prop()"); if(alarm_conf.test(min_level) && min_alarm.sh >= max_alarm.sh) throw_incoherent_val_err("min_alarm","max_alarm",dev_name,"Attribute::init_opt_prop()"); break; case Tango::DEV_LONG: if (!(str >> max_alarm.db && str.eof())) throw_err_format("max_alarm",dev_name,"Attribute::init_opt_prop()"); max_alarm.lg = (DevLong)max_alarm.db; if(alarm_conf.test(min_level) && min_alarm.lg >= max_alarm.lg) throw_incoherent_val_err("min_alarm","max_alarm",dev_name,"Attribute::init_opt_prop()"); break; case Tango::DEV_LONG64: if (!(str >> max_alarm.db && str.eof())) throw_err_format("max_alarm",dev_name,"Attribute::init_opt_prop()"); max_alarm.lg64 = (DevLong64)max_alarm.db; if(alarm_conf.test(min_level) && min_alarm.lg64 >= max_alarm.lg64) throw_incoherent_val_err("min_alarm","max_alarm",dev_name,"Attribute::init_opt_prop()"); break; case Tango::DEV_DOUBLE: if (!(str >> max_alarm.db && str.eof())) throw_err_format("max_alarm",dev_name,"Attribute::init_opt_prop()"); if(alarm_conf.test(min_level) && min_alarm.db >= max_alarm.db) throw_incoherent_val_err("min_alarm","max_alarm",dev_name,"Attribute::init_opt_prop()"); break; case Tango::DEV_FLOAT: if (!(str >> max_alarm.fl && str.eof())) throw_err_format("max_alarm",dev_name,"Attribute::init_opt_prop()"); if(alarm_conf.test(min_level) && min_alarm.fl >= max_alarm.fl) throw_incoherent_val_err("min_alarm","max_alarm",dev_name,"Attribute::init_opt_prop()"); break; case Tango::DEV_USHORT: if (!(str >> max_alarm.ush && str.eof())) throw_err_format("max_alarm",dev_name,"Attribute::init_opt_prop()"); if(alarm_conf.test(min_level) && min_alarm.ush >= max_alarm.ush) throw_incoherent_val_err("min_alarm","max_alarm",dev_name,"Attribute::init_opt_prop()"); break; case Tango::DEV_UCHAR: if (!(str >> max_alarm.sh && str.eof())) throw_err_format("max_alarm",dev_name,"Attribute::init_opt_prop()"); max_alarm.uch = (DevUChar)max_alarm.sh; if(alarm_conf.test(min_level) && min_alarm.uch >= max_alarm.uch) throw_incoherent_val_err("min_alarm","max_alarm",dev_name,"Attribute::init_opt_prop()"); break; case Tango::DEV_ULONG: if (!(str >> max_alarm.db && str.eof())) throw_err_format("max_alarm",dev_name,"Attribute::init_opt_prop()"); max_alarm.ulg = (DevULong)max_alarm.db; if(alarm_conf.test(min_level) && min_alarm.ulg >= max_alarm.ulg) throw_incoherent_val_err("min_alarm","max_alarm",dev_name,"Attribute::init_opt_prop()"); break; case Tango::DEV_ULONG64: if (!(str >> max_alarm.db && str.eof())) throw_err_format("max_alarm",dev_name,"Attribute::init_opt_prop()"); max_alarm.ulg64 = (DevULong64)max_alarm.db; if(alarm_conf.test(min_level) && min_alarm.ulg64 >= max_alarm.ulg64) throw_incoherent_val_err("min_alarm","max_alarm",dev_name,"Attribute::init_opt_prop()"); break; case Tango::DEV_ENCODED: if (!(str >> max_alarm.sh && str.eof())) throw_err_format("max_alarm",dev_name,"Attribute::init_opt_prop()"); max_alarm.uch = (DevUChar)max_alarm.sh; if(alarm_conf.test(min_level) && min_alarm.uch >= max_alarm.uch) throw_incoherent_val_err("min_alarm","max_alarm",dev_name,"Attribute::init_opt_prop()"); break; } alarm_conf.set(max_level); } else throw_err_data_type("max_alarm",dev_name,"Attribute::init_opt_prop"); } } catch(DevFailed &e) { add_startup_exception("max_alarm",e); } // // Init the min value property // try { min_value_str = get_attr_value(prop_list,"min_value"); if (min_value_str != AlrmValueNotSpec) { if((data_type != Tango::DEV_STRING) && (data_type != Tango::DEV_BOOLEAN) && (data_type != Tango::DEV_STATE)) { if (empty == false) { str.str(""); str.clear(); } str << min_value_str; empty = false; switch (data_type) { case Tango::DEV_SHORT: if (!(str >> min_value.sh && str.eof())) throw_err_format("min_value",dev_name,"Attribute::init_opt_prop()"); if(check_max_value && min_value.sh >= max_value.sh) throw_incoherent_val_err("min_value","max_value",dev_name,"Attribute::init_opt_prop()"); break; case Tango::DEV_LONG: if (!(str >> min_value.db && str.eof())) throw_err_format("min_value",dev_name,"Attribute::init_opt_prop()"); min_value.lg = (DevLong)min_value.db; if(check_max_value && min_value.lg >= max_value.lg) throw_incoherent_val_err("min_value","max_value",dev_name,"Attribute::init_opt_prop()"); break; case Tango::DEV_LONG64: if (!(str >> min_value.db && str.eof())) throw_err_format("min_value",dev_name,"Attribute::init_opt_prop()"); min_value.lg64 = (DevLong64)min_value.db; if(check_max_value && min_value.lg64 >= max_value.lg64) throw_incoherent_val_err("min_value","max_value",dev_name,"Attribute::init_opt_prop()"); break; case Tango::DEV_DOUBLE: if (!(str >> min_value.db && str.eof())) throw_err_format("min_value",dev_name,"Attribute::init_opt_prop()"); if(check_max_value && min_value.db >= max_value.db) throw_incoherent_val_err("min_value","max_value",dev_name,"Attribute::init_opt_prop()"); break; case Tango::DEV_FLOAT: if (!(str >> min_value.fl && str.eof())) throw_err_format("min_value",dev_name,"Attribute::init_opt_prop()"); if(check_max_value && min_value.fl >= max_value.fl) throw_incoherent_val_err("min_value","max_value",dev_name,"Attribute::init_opt_prop()"); break; case Tango::DEV_USHORT: if (!(str >> min_value.ush && str.eof())) throw_err_format("min_value",dev_name,"Attribute::init_opt_prop()"); if(check_max_value && min_value.ush >= max_value.ush) throw_incoherent_val_err("min_value","max_value",dev_name,"Attribute::init_opt_prop()"); break; case Tango::DEV_UCHAR: if (!(str >> min_value.sh && str.eof())) throw_err_format("min_value",dev_name,"Attribute::init_opt_prop()"); min_value.uch = (DevUChar)min_value.sh; if(check_max_value && min_value.uch >= max_value.uch) throw_incoherent_val_err("min_value","max_value",dev_name,"Attribute::init_opt_prop()"); break; case Tango::DEV_ULONG: if (!(str >> min_value.db && str.eof())) throw_err_format("min_value",dev_name,"Attribute::init_opt_prop()"); min_value.ulg = (DevULong)min_value.db; if(check_max_value && min_value.ulg >= max_value.ulg) throw_incoherent_val_err("min_value","max_value",dev_name,"Attribute::init_opt_prop()"); break; case Tango::DEV_ULONG64: if (!(str >> min_value.db && str.eof())) throw_err_format("min_value",dev_name,"Attribute::init_opt_prop()"); min_value.ulg64 = (DevULong64)min_value.db; if(check_max_value && min_value.ulg64 >= max_value.ulg64) throw_incoherent_val_err("min_value","max_value",dev_name,"Attribute::init_opt_prop()"); break; case Tango::DEV_ENCODED: if (!(str >> min_value.sh && str.eof())) throw_err_format("min_value",dev_name,"Attribute::init_opt_prop()"); min_value.uch = (DevUChar)min_value.sh; if(check_max_value && min_value.uch >= max_value.uch) throw_incoherent_val_err("min_value","max_value",dev_name,"Attribute::init_opt_prop()"); break; } check_min_value = true; } else throw_err_data_type("min_value",dev_name,"Attribute::init_opt_prop()"); } } catch(DevFailed &e) { add_startup_exception("min_value",e); } // // Init the max value property // try { max_value_str = get_attr_value(prop_list,"max_value"); if (max_value_str != AlrmValueNotSpec) { if((data_type != Tango::DEV_STRING) && (data_type != Tango::DEV_BOOLEAN) && (data_type != Tango::DEV_STATE)) { if (empty == false) { str.str(""); str.clear(); } str << max_value_str; empty = false; switch (data_type) { case Tango::DEV_SHORT: if (!(str >> max_value.sh && str.eof())) throw_err_format("max_value",dev_name,"Attribute::init_opt_prop()"); if(check_min_value && min_value.sh >= max_value.sh) throw_incoherent_val_err("min_value","max_value",dev_name,"Attribute::init_opt_prop()"); break; case Tango::DEV_LONG: if (!(str >> max_value.db && str.eof())) throw_err_format("max_value",dev_name,"Attribute::init_opt_prop()"); max_value.lg = (DevLong)max_value.db; if(check_min_value && min_value.lg >= max_value.lg) throw_incoherent_val_err("min_value","max_value",dev_name,"Attribute::init_opt_prop()"); break; case Tango::DEV_LONG64: if (!(str >> max_value.db && str.eof())) throw_err_format("max_value",dev_name,"Attribute::init_opt_prop()"); max_value.lg64 = (DevLong64)max_value.db; if(check_min_value && min_value.lg64 >= max_value.lg64) throw_incoherent_val_err("min_value","max_value",dev_name,"Attribute::init_opt_prop()"); break; case Tango::DEV_DOUBLE: if (!(str >> max_value.db && str.eof())) throw_err_format("max_value",dev_name,"Attribute::init_opt_prop()"); if(check_min_value && min_value.db >= max_value.db) throw_incoherent_val_err("min_value","max_value",dev_name,"Attribute::init_opt_prop()"); break; case Tango::DEV_FLOAT: if (!(str >> max_value.fl && str.eof())) throw_err_format("max_value",dev_name,"Attribute::init_opt_prop()"); if(check_min_value && min_value.fl >= max_value.fl) throw_incoherent_val_err("min_value","max_value",dev_name,"Attribute::init_opt_prop()"); break; case Tango::DEV_USHORT: if (!(str >> max_value.ush && str.eof())) throw_err_format("max_value",dev_name,"Attribute::init_opt_prop()"); if(check_min_value && min_value.ush >= max_value.ush) throw_incoherent_val_err("min_value","max_value",dev_name,"Attribute::init_opt_prop()"); break; case Tango::DEV_UCHAR: if (!(str >> max_value.sh && str.eof())) throw_err_format("max_value",dev_name,"Attribute::init_opt_prop()"); max_value.uch = (DevUChar)max_value.sh; if(check_min_value && min_value.uch >= max_value.uch) throw_incoherent_val_err("min_value","max_value",dev_name,"Attribute::init_opt_prop()"); break; case Tango::DEV_ULONG: if (!(str >> max_value.db && str.eof())) throw_err_format("max_value",dev_name,"Attribute::init_opt_prop()"); max_value.ulg = (DevULong)max_value.db; if(check_min_value && min_value.ulg >= max_value.ulg) throw_incoherent_val_err("min_value","max_value",dev_name,"Attribute::init_opt_prop()"); break; case Tango::DEV_ULONG64: if (!(str >> max_value.db && str.eof())) throw_err_format("max_value",dev_name,"Attribute::init_opt_prop()"); max_value.ulg64 = (DevULong64)max_value.db; if(check_min_value && min_value.ulg64 >= max_value.ulg64) throw_incoherent_val_err("min_value","max_value",dev_name,"Attribute::init_opt_prop()"); break; case Tango::DEV_ENCODED: if (!(str >> max_value.sh && str.eof())) throw_err_format("max_value",dev_name,"Attribute::init_opt_prop()"); max_value.uch = (DevUChar)max_value.sh; if(check_min_value && min_value.uch >= max_value.uch) throw_incoherent_val_err("min_value","max_value",dev_name,"Attribute::init_opt_prop()"); break; } check_max_value = true; } else throw_err_data_type("max_value",dev_name,"Attribute::init_opt_prop"); } } catch(DevFailed &e) { add_startup_exception("max_value",e); } // // Init the min warning property // try { min_warning_str = get_attr_value(prop_list,"min_warning"); if (min_warning_str != AlrmValueNotSpec) { if((data_type != Tango::DEV_STRING) && (data_type != Tango::DEV_BOOLEAN) && (data_type != Tango::DEV_STATE)) { if (empty == false) { str.str(""); str.clear(); } str << min_warning_str; empty = false; switch (data_type) { case Tango::DEV_SHORT: if (!(str >> min_warning.sh && str.eof())) throw_err_format("min_warning",dev_name,"Attribute::init_opt_prop()"); if(alarm_conf.test(max_warn) && min_warning.sh >= max_warning.sh) throw_incoherent_val_err("min_warning","max_warning",dev_name,"Attribute::init_opt_prop()"); break; case Tango::DEV_LONG: if (!(str >> min_warning.db && str.eof())) throw_err_format("min_warning",dev_name,"Attribute::init_opt_prop()"); min_warning.lg = (DevLong)min_warning.db; if(alarm_conf.test(max_warn) && min_warning.lg >= max_warning.lg) throw_incoherent_val_err("min_warning","max_warning",dev_name,"Attribute::init_opt_prop()"); break; case Tango::DEV_LONG64: if (!(str >> min_warning.db && str.eof())) throw_err_format("min_warning",dev_name,"Attribute::init_opt_prop()"); min_warning.lg64 = (DevLong64)min_warning.db; if(alarm_conf.test(max_warn) && min_warning.lg64 >= max_warning.lg64) throw_incoherent_val_err("min_warning","max_warning",dev_name,"Attribute::init_opt_prop()"); break; case Tango::DEV_DOUBLE: if (!(str >> min_warning.db && str.eof())) throw_err_format("min_warning",dev_name,"Attribute::init_opt_prop()"); if(alarm_conf.test(max_warn) && min_warning.db >= max_warning.db) throw_incoherent_val_err("min_warning","max_warning",dev_name,"Attribute::init_opt_prop()"); break; case Tango::DEV_FLOAT: if (!(str >> min_warning.fl && str.eof())) throw_err_format("min_warning",dev_name,"Attribute::init_opt_prop()"); if(alarm_conf.test(max_warn) && min_warning.fl >= max_warning.fl) throw_incoherent_val_err("min_warning","max_warning",dev_name,"Attribute::init_opt_prop()"); break; case Tango::DEV_USHORT: if (!(str >> min_warning.ush && str.eof())) throw_err_format("min_warning",dev_name,"Attribute::init_opt_prop()"); if(alarm_conf.test(max_warn) && min_warning.ush >= max_warning.ush) throw_incoherent_val_err("min_warning","max_warning",dev_name,"Attribute::init_opt_prop()"); break; case Tango::DEV_UCHAR: if (!(str >> min_warning.sh && str.eof())) throw_err_format("min_warning",dev_name,"Attribute::init_opt_prop()"); min_warning.uch = (DevUChar)min_warning.sh; if(alarm_conf.test(max_warn) && min_warning.uch >= max_warning.uch) throw_incoherent_val_err("min_warning","max_warning",dev_name,"Attribute::init_opt_prop()"); break; case Tango::DEV_ULONG: if (!(str >> min_warning.db && str.eof())) throw_err_format("min_warning",dev_name,"Attribute::init_opt_prop()"); min_warning.ulg = (DevULong)min_warning.db; if(alarm_conf.test(max_warn) && min_warning.ulg >= max_warning.ulg) throw_incoherent_val_err("min_warning","max_warning",dev_name,"Attribute::init_opt_prop()"); break; case Tango::DEV_ULONG64: if (!(str >> min_warning.db && str.eof())) throw_err_format("min_warning",dev_name,"Attribute::init_opt_prop()"); min_warning.ulg64 = (DevULong64)min_warning.db; if(alarm_conf.test(max_warn) && min_warning.ulg64 >= max_warning.ulg64) throw_incoherent_val_err("min_warning","max_warning",dev_name,"Attribute::init_opt_prop()"); break; case Tango::DEV_ENCODED: if (!(str >> min_warning.sh && str.eof())) throw_err_format("min_warning",dev_name,"Attribute::init_opt_prop()"); min_warning.uch = (DevUChar)min_warning.sh; if(alarm_conf.test(max_warn) && min_warning.uch >= max_warning.uch) throw_incoherent_val_err("min_warning","max_warning",dev_name,"Attribute::init_opt_prop()"); break; } alarm_conf.set(min_warn); } else throw_err_data_type("min_warning",dev_name,"Attribute::init_opt_prop()"); } } catch(DevFailed &e) { add_startup_exception("min_warning",e); } // // Init the max warning property // try { max_warning_str = get_attr_value(prop_list,"max_warning"); if (max_warning_str != AlrmValueNotSpec) { if((data_type != Tango::DEV_STRING) && (data_type != Tango::DEV_BOOLEAN) && (data_type != Tango::DEV_STATE)) { if (empty == false) { str.str(""); str.clear(); } str << max_warning_str; empty = false; switch (data_type) { case Tango::DEV_SHORT: if (!(str >> max_warning.sh && str.eof())) throw_err_format("max_warning",dev_name,"Attribute::init_opt_prop()"); if(alarm_conf.test(min_warn) && min_warning.sh >= max_warning.sh) throw_incoherent_val_err("min_warning","max_warning",dev_name,"Attribute::init_opt_prop()"); break; case Tango::DEV_LONG: if (!(str >> max_warning.db && str.eof())) throw_err_format("max_warning",dev_name,"Attribute::init_opt_prop()"); max_warning.lg = (DevLong)max_warning.db; if(alarm_conf.test(min_warn) && min_warning.lg >= max_warning.lg) throw_incoherent_val_err("min_warning","max_warning",dev_name,"Attribute::init_opt_prop()"); break; case Tango::DEV_LONG64: if (!(str >> max_warning.db && str.eof())) throw_err_format("max_warning",dev_name,"Attribute::init_opt_prop()"); max_warning.lg64 = (DevLong64)max_warning.db; if(alarm_conf.test(min_warn) && min_warning.lg64 >= max_warning.lg64) throw_incoherent_val_err("min_warning","max_warning",dev_name,"Attribute::init_opt_prop()"); break; case Tango::DEV_DOUBLE: if (!(str >> max_warning.db && str.eof())) throw_err_format("max_warning",dev_name,"Attribute::init_opt_prop()"); if(alarm_conf.test(min_warn) && min_warning.db >= max_warning.db) throw_incoherent_val_err("min_warning","max_warning",dev_name,"Attribute::init_opt_prop()"); break; case Tango::DEV_FLOAT: if (!(str >> max_warning.fl && str.eof())) throw_err_format("max_warning",dev_name,"Attribute::init_opt_prop()"); if(alarm_conf.test(min_warn) && min_warning.fl >= max_warning.fl) throw_incoherent_val_err("min_warning","max_warning",dev_name,"Attribute::init_opt_prop()"); break; case Tango::DEV_USHORT: if (!(str >> max_warning.ush && str.eof())) throw_err_format("max_warning",dev_name,"Attribute::init_opt_prop()"); if(alarm_conf.test(min_warn) && min_warning.ush >= max_warning.ush) throw_incoherent_val_err("min_warning","max_warning",dev_name,"Attribute::init_opt_prop()"); break; case Tango::DEV_UCHAR: if (!(str >> max_warning.sh && str.eof())) throw_err_format("max_warning",dev_name,"Attribute::init_opt_prop()"); max_warning.uch = (DevUChar)max_warning.sh; if(alarm_conf.test(min_warn) && min_warning.uch >= max_warning.uch) throw_incoherent_val_err("min_warning","max_warning",dev_name,"Attribute::init_opt_prop()"); break; case Tango::DEV_ULONG: if (!(str >> max_warning.db && str.eof())) throw_err_format("max_warning",dev_name,"Attribute::init_opt_prop()"); max_warning.ulg = (DevULong)max_warning.db; if(alarm_conf.test(min_warn) && min_warning.ulg >= max_warning.ulg) throw_incoherent_val_err("min_warning","max_warning",dev_name,"Attribute::init_opt_prop()"); break; case Tango::DEV_ULONG64: if (!(str >> max_warning.db && str.eof())) throw_err_format("max_warning",dev_name,"Attribute::init_opt_prop()"); max_warning.ulg64 = (DevULong64)max_warning.db; if(alarm_conf.test(min_warn) && min_warning.ulg64 >= max_warning.ulg64) throw_incoherent_val_err("min_warning","max_warning",dev_name,"Attribute::init_opt_prop()"); break; case Tango::DEV_ENCODED: if (!(str >> max_warning.sh && str.eof())) throw_err_format("max_warning",dev_name,"Attribute::init_opt_prop()"); max_warning.uch = (DevUChar)max_warning.sh; if(alarm_conf.test(min_warn) && min_warning.uch >= max_warning.uch) throw_incoherent_val_err("min_warning","max_warning",dev_name,"Attribute::init_opt_prop()"); break; } alarm_conf.set(max_warn); } else throw_err_data_type("max_warning",dev_name,"Attribute::init_opt_prop()"); } } catch(DevFailed &e) { add_startup_exception("max_warning",e); } // // Get delta_t property // bool delta_t_defined = false; try { delta_t_str = get_attr_value(prop_list,"delta_t"); if (delta_t_str != "0") { if((data_type != Tango::DEV_STRING) && (data_type != Tango::DEV_BOOLEAN) && (data_type != Tango::DEV_STATE)) { delta_t = get_lg_attr_value(prop_list,"delta_t"); if (delta_t != 0) delta_t_defined = true; } else throw_err_data_type("delta_t",dev_name,"Attribute::init_opt_prop()"); } else delta_t = 0; } catch(DevFailed &e) { add_startup_exception("delta_t",e); } // // Get delta_val property // bool delta_val_defined = false; try { delta_val_str = get_attr_value(prop_list,"delta_val"); if (delta_val_str != AlrmValueNotSpec) { if((data_type != Tango::DEV_STRING) && (data_type != Tango::DEV_BOOLEAN) && (data_type != Tango::DEV_STATE)) { if (empty == false) { str.str(""); str.clear(); } str << delta_val_str; switch (data_type) { case Tango::DEV_SHORT: if (!(str >> delta_val.sh && str.eof())) throw_err_format("delta_val",dev_name,"Attribute::init_opt_prop()"); break; case Tango::DEV_LONG: if (!(str >> delta_val.db && str.eof())) throw_err_format("delta_val",dev_name,"Attribute::init_opt_prop()"); delta_val.lg = (DevLong)delta_val.db; break; case Tango::DEV_LONG64: if (!(str >> delta_val.db && str.eof())) throw_err_format("delta_val",dev_name,"Attribute::init_opt_prop()"); delta_val.lg64 = (DevLong64)delta_val.db; break; case Tango::DEV_DOUBLE: if (!(str >> delta_val.db && str.eof())) throw_err_format("delta_val",dev_name,"Attribute::init_opt_prop()"); break; case Tango::DEV_FLOAT: if (!(str >> delta_val.fl && str.eof())) throw_err_format("delta_val",dev_name,"Attribute::init_opt_prop()"); break; case Tango::DEV_USHORT: if (!(str >> delta_val.ush && str.eof())) throw_err_format("delta_val",dev_name,"Attribute::init_opt_prop()"); break; case Tango::DEV_UCHAR: if (!(str >> delta_val.sh && str.eof())) throw_err_format("delta_val",dev_name,"Attribute::init_opt_prop()"); delta_val.uch = (DevUChar)delta_val.sh; break; case Tango::DEV_ULONG: if (!(str >> delta_val.db && str.eof())) throw_err_format("delta_val",dev_name,"Attribute::init_opt_prop()"); delta_val.ulg = (DevULong)delta_val.db; break; case Tango::DEV_ULONG64: if (!(str >> delta_val.db && str.eof())) throw_err_format("delta_val",dev_name,"Attribute::init_opt_prop()"); delta_val.ulg64 = (DevULong64)delta_val.db; break; case Tango::DEV_ENCODED: if (!(str >> delta_val.sh && str.eof())) throw_err_format("delta_val",dev_name,"Attribute::init_opt_prop()"); delta_val.uch = (DevUChar)delta_val.sh; break; } if(delta_t_defined) alarm_conf.set(rds); // set RDS flag only if both delta_t and delta_val are set delta_val_defined = true; } else throw_err_data_type("delta_val",dev_name,"Attribute::init_opt_prop()"); } } catch(DevFailed &e) { add_startup_exception("delta_val",e); } // // Throw exception if only one RDS property is defined // try { if (((delta_t_defined == true) && (delta_val_defined == false)) || ((delta_t_defined == false) && (delta_val_defined == true))) { TangoSys_OMemStream o; o << "RDS alarm properties (delta_t and delta_val) are not correctly defined for attribute " << name; o << " in device " << dev_name << ends; Except::throw_exception((const char *)API_AttrOptProp, o.str(), (const char *)"Attribute::init_opt_prop()"); } } catch(DevFailed &e) { add_startup_exception("rds_alarm",e); } } //+------------------------------------------------------------------------------------------------------------------- // // method : // Attribute::add_startup_exception // // description : // Stores an exception raised during the device startup sequence in a map // // argument : // in : // - prop_name : The property name for which the exception was raised // - except : The raised exceptoin // //--------------------------------------------------------------------------------------------------------------------- void Attribute::add_startup_exception(string prop_name,const DevFailed &except) { ext->startup_exceptions.insert(pair(prop_name,except)); ext->check_startup_exceptions = true; } //+------------------------------------------------------------------------------------------------------------------ // // method : // Attribute::delete_startup_exception // // description : // Deletes the exception related to the property name from startup_exceptoins map // // argument : // in : // - prop_name : The property name as a key for which the exception is to be deleted from startup_exceptions // map // //--------------------------------------------------------------------------------------------------------------------- void Attribute::delete_startup_exception(string prop_name) { if(ext->check_startup_exceptions == true) { map::iterator it = ext->startup_exceptions.find(prop_name); if(it != ext->startup_exceptions.end()) ext->startup_exceptions.erase(it); if(ext->startup_exceptions.empty() == true) ext->check_startup_exceptions = false; DeviceImpl *dev = get_att_device(); dev->set_run_att_conf_loop(true); } } //+------------------------------------------------------------------------------------------------------------------ // // method : // Attribute::throw_err_format // // description : // Throw a Tango DevFailed exception when an error format is detected in the string which should be converted // to a number // // argument : // in : // - prop_name : The property name // - dev_name : The device name // - origin : The origin of the exception // //-------------------------------------------------------------------------------------------------------------------- void Attribute::throw_err_format(const char *prop_name,const string &dev_name,const char *origin) { TangoSys_OMemStream o; o << "Device " << dev_name << "-> Attribute : " << name; o << "\nThe property " << prop_name << " is defined in an unsupported format" << ends; Except::throw_exception((const char *)API_AttrOptProp, o.str(), (const char *)origin); } //------------------------------------------------------------------------------------------------------------------- // // method : // Attribute::throw_incoherent_val_err // // description : // Throw a Tango DevFailed exception when the min or max property is incoherent with its counterpart // // argument : // in : // - min_prop : The min property name // - max_prop : The max property name // - dev_name : The device name // - origin : The origin of the exception // //-------------------------------------------------------------------------------------------------------------------- void Attribute::throw_incoherent_val_err(const char *min_prop,const char *max_prop,const string &dev_name,const char *origin) { TangoSys_OMemStream o; o << "Device " << dev_name << "-> Attribute : " << name; o << "\nValue of " << min_prop << " is grater than or equal to " << max_prop << ends; Except::throw_exception((const char *)API_IncoherentValues, o.str(), (const char *)origin); } //--------------------------------------------------------------------------------------------------------------------- // // method : // Attribute::throw_err_data_type // // description : // Throw a Tango DevFailed exception when an error on data type is detected // // argument : // in : // - prop_name : The property name // - dev_name : The device name // - origin : The origin of the exception // //--------------------------------------------------------------------------------------------------------------------- void Attribute::throw_err_data_type(const char *prop_name,const string &dev_name,const char *origin) { TangoSys_OMemStream o; o << "Device " << dev_name << "-> Attribute : " << name; o << "\nThe property " << prop_name << " is not settable for the attribute data type" << ends; Except::throw_exception((const char *)API_AttrOptProp, o.str(), (const char *)origin); } //--------------------------------------------------------------------------------------------------------------------- // // method : // Attribute::throw_min_max_value // // description : // Throw a Tango DevFailed exception when an error on min/max value is detected // // argument : // in : // - dev_name : The device name // - memorized_value : The attribute memorized value // - check_type : The type of check which was done (min_value or max_value) // //--------------------------------------------------------------------------------------------------------------------- void Attribute::throw_min_max_value(string &dev_name,string &memorized_value,MinMaxValueCheck check_type) { TangoSys_OMemStream o; o << "Device " << dev_name << "-> Attribute : " << name; o << "\nThis attribute is memorized and the memorized value (" << memorized_value << ") is "; if (check_type == MIN) o << "below"; else o << "above"; o << " the new limit!!" << ends; Except::throw_exception((const char *)API_AttrOptProp, o.str(), (const char *)"Attribute::throw_min_max_value()"); } //-------------------------------------------------------------------------------------------------------------------- // // method : // Attribute::is_polled // // description : // Check if the attribute polled // // return: // This method returns a boolean set to true if the attribute is polled // //-------------------------------------------------------------------------------------------------------------------- bool Attribute::is_polled() { Tango::Util *tg = Util::instance(); if ( ext->dev == NULL ) { ext->dev = tg->get_device_by_name(ext->d_name); } string &att_name = get_name_lower(); vector &attr_list = ext->dev->get_polled_attr(); for (unsigned int i = 0;i < attr_list.size();i = i+2) { // // Convert to lower case before comparison // string name_lowercase(attr_list[i]); transform(name_lowercase.begin(),name_lowercase.end(),name_lowercase.begin(),::tolower); if ( att_name == name_lowercase ) { // // When the polling buffer is externally filled (polling period == 0), mark the attribute as not polled! // No events can be send by the polling thread! // if ( attr_list[i+1] == "0" ) { return false; } else return true; } } // // Now check wether a polling period is set ( for example by pogo) // if ( get_polling_period() > 0 ) { // // Check the list of non_auto_polled attributes to verify wether the polling was disabled // vector &napa = ext->dev->get_non_auto_polled_attr(); for (unsigned int j = 0;j < napa.size();j++) { #ifdef _TG_WINDOWS_ if (_stricmp(napa[j].c_str(), att_name.c_str()) == 0) #else if (strcasecmp(napa[j].c_str(), att_name.c_str()) == 0) #endif { return false; } } return true; } return false; } bool Attribute::is_polled(DeviceImpl *the_dev) { if ((the_dev != NULL) && (ext->dev == NULL)) { ext->dev = the_dev; } return is_polled(); } //-------------------------------------------------------------------------------------------------------------------- // // method : // Attribute::is_writ_associated // // description : // Check if the attribute has an associated writable attribute // // return : // This method returns a boolean set to true if the atribute has an associatied writable attribute // //-------------------------------------------------------------------------------------------------------------------- bool Attribute::is_writ_associated() { if (writable_attr_name != AssocWritNotSpec) return true; else return false; } //--------------------------------------------------------------------------------------------------------------------- // // method : // Attribute::get_attr_value // // description : // Retrieve a property value as a string from the vector of properties // // argument : // in : // - prop_list : The property vector // - prop_name : the property name // //-------------------------------------------------------------------------------------------------------------------- string &Attribute::get_attr_value(vector &prop_list,const char *prop_name) { vector::iterator pos; // // Get the property value // pos = find_if(prop_list.begin(),prop_list.end(),bind2nd(ptr_fun(WantedProp_f),prop_name)); if (pos == prop_list.end()) { TangoSys_OMemStream o; o << "Property " << prop_name << " is missing for attribute " << name << ends; Except::throw_exception((const char *)API_AttrOptProp, o.str(), (const char *)"Attribute::get_attr_value()"); } return pos->get_value(); } //-------------------------------------------------------------------------------------------------------------------- // // method : // Attribute::get_lg_attr_value // // description : // Retrieve a property value as a long from the vector of properties // // argument : // in : // - prop_list : The property vector // - prop_name : the property name // //--------------------------------------------------------------------------------------------------------------------- long Attribute::get_lg_attr_value(vector &prop_list,const char *prop_name) { vector::iterator pos; // // Get the property value // pos = find_if(prop_list.begin(),prop_list.end(),bind2nd(ptr_fun(WantedProp_f),prop_name)); if (pos == prop_list.end()) { TangoSys_OMemStream o; o << "Property " << prop_name << " is missing for attribute " << name << ends; Except::throw_exception((const char *)API_AttrOptProp, o.str(), (const char *)"Attribute::get_attr_value()"); } pos->convert(); return pos->get_lg_value(); } //-------------------------------------------------------------------------------------------------------------------- // // method : // Attribute::get_properties // // description : // Init the Tango::AttributeConfig with all the attribute properties value // // argument : // in : // - conf // //--------------------------------------------------------------------------------------------------------------------- void Attribute::get_properties(Tango::AttributeConfig &conf) { // // Copy mandatory properties // conf.writable = writable; conf.data_format = data_format; conf.max_dim_x = max_x; conf.max_dim_y = max_y; conf.data_type = data_type; conf.name = CORBA::string_dup(name.c_str()); // // Copy optional properties // conf.label = CORBA::string_dup(label.c_str()); conf.description = CORBA::string_dup(description.c_str()); conf.unit = CORBA::string_dup(unit.c_str()); conf.standard_unit = CORBA::string_dup(standard_unit.c_str()); conf.display_unit = CORBA::string_dup(display_unit.c_str()); conf.format = CORBA::string_dup(format.c_str()); conf.writable_attr_name = CORBA::string_dup(writable_attr_name.c_str()); conf.min_alarm = CORBA::string_dup(min_alarm_str.c_str()); conf.max_alarm = CORBA::string_dup(max_alarm_str.c_str()); conf.min_value = CORBA::string_dup(min_value_str.c_str()); conf.max_value = CORBA::string_dup(max_value_str.c_str()); } void Attribute::get_properties_2(Tango::AttributeConfig_2 &conf) { // // Copy mandatory properties // conf.writable = writable; conf.data_format = data_format; conf.max_dim_x = max_x; conf.max_dim_y = max_y; conf.data_type = data_type; conf.name = CORBA::string_dup(name.c_str()); // // Copy optional properties // conf.label = CORBA::string_dup(label.c_str()); conf.description = CORBA::string_dup(description.c_str()); conf.unit = CORBA::string_dup(unit.c_str()); conf.standard_unit = CORBA::string_dup(standard_unit.c_str()); conf.display_unit = CORBA::string_dup(display_unit.c_str()); conf.format = CORBA::string_dup(format.c_str()); conf.writable_attr_name = CORBA::string_dup(writable_attr_name.c_str()); conf.min_alarm = CORBA::string_dup(min_alarm_str.c_str()); conf.max_alarm = CORBA::string_dup(max_alarm_str.c_str()); conf.min_value = CORBA::string_dup(min_value_str.c_str()); conf.max_value = CORBA::string_dup(max_value_str.c_str()); conf.level = ext->disp_level; } void Attribute::get_properties_3(Tango::AttributeConfig_3 &conf) { // // Copy mandatory properties // conf.writable = writable; conf.data_format = data_format; conf.max_dim_x = max_x; conf.max_dim_y = max_y; conf.data_type = data_type; conf.name = CORBA::string_dup(name.c_str()); // // Copy optional properties // conf.label = CORBA::string_dup(label.c_str()); conf.description = CORBA::string_dup(description.c_str()); conf.unit = CORBA::string_dup(unit.c_str()); conf.standard_unit = CORBA::string_dup(standard_unit.c_str()); conf.display_unit = CORBA::string_dup(display_unit.c_str()); conf.format = CORBA::string_dup(format.c_str()); conf.writable_attr_name = CORBA::string_dup(writable_attr_name.c_str()); conf.min_value = CORBA::string_dup(min_value_str.c_str()); conf.max_value = CORBA::string_dup(max_value_str.c_str()); conf.level = ext->disp_level; // // Copy alarm properties // conf.att_alarm.min_alarm = CORBA::string_dup(min_alarm_str.c_str()); conf.att_alarm.max_alarm = CORBA::string_dup(max_alarm_str.c_str()); conf.att_alarm.min_warning = CORBA::string_dup(min_warning_str.c_str()); conf.att_alarm.max_warning = CORBA::string_dup(max_warning_str.c_str()); if (delta_t == 0) conf.att_alarm.delta_t = CORBA::string_dup(AlrmValueNotSpec); else conf.att_alarm.delta_t = CORBA::string_dup(delta_t_str.c_str()); conf.att_alarm.delta_val = CORBA::string_dup(delta_val_str.c_str()); // // Copy periodic event property // TangoSys_OMemStream str; str.precision(TANGO_FLOAT_PRECISION); if (ext->event_period == INT_MAX) conf.event_prop.per_event.period = CORBA::string_dup((const char *)(DEFAULT_EVENT_PERIOD)); else { int per = (int)((double)ext->event_period); str << per; MEM_STREAM_2_CORBA(conf.event_prop.per_event.period,str); } // // Copy change event properties // if (fabs(ext->rel_change[0]) == fabs(ext->rel_change[1])) { if (ext->rel_change[0] == INT_MAX) conf.event_prop.ch_event.rel_change = CORBA::string_dup(AlrmValueNotSpec); else { str << fabs(ext->rel_change[1]); MEM_STREAM_2_CORBA(conf.event_prop.ch_event.rel_change,str); } } else { if (ext->rel_change[0] == INT_MAX) str << AlrmValueNotSpec << ","; else str << fabs(ext->rel_change[0]) << ","; if (ext->rel_change[1] == INT_MAX) str << AlrmValueNotSpec; else str << fabs(ext->rel_change[1]); MEM_STREAM_2_CORBA(conf.event_prop.ch_event.rel_change,str); } if (fabs(ext->abs_change[0]) == fabs(ext->abs_change[1])) { if (ext->abs_change[0] == INT_MAX) conf.event_prop.ch_event.abs_change = CORBA::string_dup(AlrmValueNotSpec); else { str << fabs(ext->abs_change[1]); MEM_STREAM_2_CORBA(conf.event_prop.ch_event.abs_change,str); } } else { if (ext->abs_change[0] == INT_MAX) str << AlrmValueNotSpec << ","; else str << fabs(ext->abs_change[0]) << ","; if (ext->abs_change[1] == INT_MAX) str << AlrmValueNotSpec; else str << fabs(ext->abs_change[1]); MEM_STREAM_2_CORBA(conf.event_prop.ch_event.abs_change,str); } // // Copy archive event properties // if (ext->archive_period == INT_MAX) conf.event_prop.arch_event.period = CORBA::string_dup(AlrmValueNotSpec); else { int per = (int)((double)ext->archive_period); str << per; MEM_STREAM_2_CORBA(conf.event_prop.arch_event.period,str); } if (fabs(ext->archive_rel_change[0]) == fabs(ext->archive_rel_change[1])) { if (ext->archive_rel_change[0] == INT_MAX) conf.event_prop.arch_event.rel_change = CORBA::string_dup(AlrmValueNotSpec); else { str << fabs(ext->archive_rel_change[1]); MEM_STREAM_2_CORBA(conf.event_prop.arch_event.rel_change,str); } } else { if (ext->archive_rel_change[0] == INT_MAX) str << AlrmValueNotSpec << ","; else str << fabs(ext->archive_rel_change[0]) << ","; if (ext->archive_rel_change[1] == INT_MAX) str << AlrmValueNotSpec; else str << fabs(ext->archive_rel_change[1]); MEM_STREAM_2_CORBA(conf.event_prop.arch_event.rel_change,str); } if (fabs(ext->archive_abs_change[0]) == fabs(ext->archive_abs_change[1])) { if (ext->archive_abs_change[0] == INT_MAX) conf.event_prop.arch_event.abs_change = CORBA::string_dup(AlrmValueNotSpec); else { str << fabs(ext->archive_abs_change[1]); MEM_STREAM_2_CORBA(conf.event_prop.arch_event.abs_change,str); } } else { if (ext->archive_abs_change[0] == INT_MAX) str << AlrmValueNotSpec << ","; else str << fabs(ext->archive_abs_change[0]) << ","; if (ext->archive_abs_change[1] == INT_MAX) str << AlrmValueNotSpec; else str << fabs(ext->archive_abs_change[1]); MEM_STREAM_2_CORBA(conf.event_prop.arch_event.abs_change,str); } } //--------------------------------------------------------------------------------------------------------------------- // // method : // Attribute::set_properties // // description : // Set the attribute properties value // // argument : // in : // - conf : The new properties sent by client // - d : Pointer to the device object //-------------------------------------------------------------------------------------------------------------------- void Attribute::set_properties(const Tango::AttributeConfig &conf,Tango::DeviceImpl *d) { if (ext->dev == NULL) ext->dev = d; set_properties(conf,d->get_name()); } void Attribute::set_properties(const Tango::AttributeConfig &conf,string &dev_name) { if (name_lower == "state" || name_lower == "status") return; // // Check if the caller try to change "hard coded" properties. Throw exception in case of // check_hard_coded_properties(conf); // // Copy only a sub-set of the new properties. For each "string" property, an empty string means returns to its // default value which could be the library default value or the user defined default value // Tango::DeviceClass *dev_class = get_att_device_class(dev_name); Tango::MultiClassAttribute *mca = dev_class->get_class_attr(); Tango::Attr &att = mca->get_attr(name); vector &def_user_prop = att.get_user_default_properties(); size_t nb_user = def_user_prop.size(); // TODO : Add one call to refresh from DB the class properties vector &def_class_prop = att.get_class_properties(); size_t nb_class = def_class_prop.size(); // // First the description // if(TG_strcasecmp(conf.description,AlrmValueNotSpec) == 0 || (TG_strcasecmp(conf.description,DescNotSpec) == 0)) { // force library defaults (even if user defaults defined) description = DescNotSpec; } else if (TG_strcasecmp(conf.description,NotANumber) == 0) { // set class default value if defined, otherwise use the user default or library defaults bool found = prop_in_list("description",description,nb_class,def_class_prop); if (found == false) { found = prop_in_list("description",description,nb_user,def_user_prop); if (found == false) description = DescNotSpec; } } else if (strlen(conf.description) == 0) { // set user default value if defined, otherwise use the library defaults bool found = prop_in_list("description",description,nb_user,def_user_prop); if (found == false) description = DescNotSpec; } else { // set property description = conf.description; } delete_startup_exception("description"); // // The label // if(TG_strcasecmp(conf.label,AlrmValueNotSpec) == 0 || (TG_strcasecmp(conf.label,LabelNotSpec) == 0) || (TG_strcasecmp(conf.label,name.c_str()) == 0)) { // force library defaults (even if user defaults defined) label = name.c_str(); } else if (TG_strcasecmp(conf.label,NotANumber) == 0) { // set class default value if defined, otherwise use the user default or library defaults bool found = prop_in_list("label",label,nb_class,def_class_prop); if (found == false) { found = prop_in_list("label",label,nb_user,def_user_prop); if (found == false) label = name.c_str(); } } else if (strlen(conf.label) == 0) { // set user default value if defined, otherwise use the library defaults bool found = prop_in_list("label",label,nb_user,def_user_prop); if (found == false) label = name.c_str(); } else { // set property label = conf.label; } delete_startup_exception("label"); // // The unit // if(TG_strcasecmp(conf.unit,AlrmValueNotSpec) == 0 || (TG_strcasecmp(conf.unit,UnitNotSpec) == 0)) { // force library defaults (even if user defaults defined) unit = UnitNotSpec; } else if(TG_strcasecmp(conf.unit,NotANumber) == 0) { // set class default value if defines, user default value if defined, otherwise use the library defaults bool found = prop_in_list("unit",unit,nb_class,def_class_prop); if (found == false) { found = prop_in_list("unit",unit,nb_user,def_user_prop); if (found == false) unit = UnitNotSpec; } } else if (strlen(conf.unit) == 0) { // set user default value if defined, otherwise use the library defaults bool found = prop_in_list("unit",unit,nb_user,def_user_prop); if (found == false) unit = UnitNotSpec; } else { // set property unit = conf.unit; } delete_startup_exception("unit"); // // The standard unit // if(TG_strcasecmp(conf.standard_unit,AlrmValueNotSpec) == 0 || (TG_strcasecmp(conf.standard_unit,StdUnitNotSpec) == 0)) { // force library defaults (even if user defaults defined) standard_unit = StdUnitNotSpec; } else if(TG_strcasecmp(conf.standard_unit,NotANumber) == 0) { // set class default if defined, user default value if defined, otherwise use the library defaults bool found = prop_in_list("standard_unit",standard_unit,nb_class,def_class_prop); if (found == false) { found = prop_in_list("standard_unit",standard_unit,nb_user,def_user_prop); if (found == false) standard_unit = StdUnitNotSpec; } } else if (strlen(conf.standard_unit) == 0) { // set user default value if defined, otherwise use the library defaults bool found = prop_in_list("standard_unit",standard_unit,nb_user,def_user_prop); if (found == false) standard_unit = StdUnitNotSpec; } else { // set property standard_unit = conf.standard_unit; } delete_startup_exception("standard_unit"); // // The display unit // if(TG_strcasecmp(conf.display_unit,AlrmValueNotSpec) == 0 || (TG_strcasecmp(conf.display_unit,DispUnitNotSpec) == 0)) { // force library defaults (even if user defaults defined) display_unit = DispUnitNotSpec; } else if(TG_strcasecmp(conf.display_unit,NotANumber) == 0) { // set class default if defined, user default value if defined, otherwise use the library defaults bool found = prop_in_list("display_unit",display_unit,nb_class,def_class_prop); if (found == false) { found = prop_in_list("display_unit",display_unit,nb_user,def_user_prop); if (found == false) display_unit = DispUnitNotSpec; } } else if (strlen(conf.display_unit) == 0) { // set user default value if defined, otherwise use the library defaults bool found = prop_in_list("display_unit",display_unit,nb_user,def_user_prop); if (found == false) display_unit = DispUnitNotSpec; } else { // set property display_unit = conf.display_unit; } delete_startup_exception("display_unit"); // // The format // bool format_not_spec = is_format_notspec(conf.format); if(TG_strcasecmp(conf.format,AlrmValueNotSpec) == 0 || (format_not_spec == true)) { // force library defaults (even if user defaults defined) set_format_notspec(); } else if(TG_strcasecmp(conf.format,NotANumber) == 0) { // set class default if defined, user default value if defined, otherwise use the library defaults bool found = prop_in_list("format",format,nb_class,def_class_prop); if (found == false) { found = prop_in_list("format",format,nb_user,def_user_prop); if (found == false) set_format_notspec(); } } else if (strlen(conf.format) == 0) { // set user default value if defined, otherwise use the library defaults bool found = prop_in_list("format",format,nb_user,def_user_prop); if (found == false) set_format_notspec(); } else { // set property format = conf.format; } delete_startup_exception("format"); // // For the last four properties, convert their value to the right type // First min_value // TangoSys_MemStream str; str.precision(TANGO_FLOAT_PRECISION); string min_value_usr_def; double min_value_usr_def_db; string min_value_class_def; double min_value_class_def_db; bool usr_defaults = false; bool class_defaults = false; if(TG_strcasecmp(conf.min_value,AlrmValueNotSpec) == 0) { // force library defaults (even if user defaults defined) min_value_str = AlrmValueNotSpec; } else if(TG_strcasecmp(conf.min_value,NotANumber) == 0) { // set class default if defined, user default value if defined, otherwise use the library defaults class_defaults = prop_in_list("min_value",min_value_class_def,nb_class,def_class_prop); if (class_defaults == false) { usr_defaults = prop_in_list("min_value",min_value_usr_def,nb_user,def_user_prop); if (usr_defaults == false) min_value_str = AlrmValueNotSpec; else { str.str(""); str.clear(); str << min_value_usr_def; str >> min_value_usr_def_db; min_value_str = min_value_usr_def; } } else { str.str(""); str.clear(); str << min_value_class_def; str >> min_value_class_def_db; min_value_str = min_value_class_def; } } else if (strlen(conf.min_value) == 0) { // set user default value if defined, otherwise use the library defaults usr_defaults = prop_in_list("min_value",min_value_usr_def,nb_user,def_user_prop); if (usr_defaults == false) min_value_str = AlrmValueNotSpec; else { str.str(""); str.clear(); str << min_value_usr_def; str >> min_value_usr_def_db; min_value_str = min_value_usr_def; } } else { // set property min_value_str = conf.min_value; } if (min_value_str == AlrmValueNotSpec) check_min_value = false; else { if ((data_type != Tango::DEV_STRING) && (data_type != Tango::DEV_BOOLEAN) && (data_type != Tango::DEV_STATE)) { str.str(""); str.clear(); str << min_value_str; if (!(str >> min_value.db && str.eof())) throw_err_format("min_value",dev_name,"Attribute::set_properties()"); switch (data_type) { case Tango::DEV_SHORT: min_value.sh = (DevShort)min_value.db; str.str(""); str.clear(); str << min_value.sh; break; case Tango::DEV_LONG: min_value.lg = (DevLong)min_value.db; str.str(""); str.clear(); str << min_value.lg; break; case Tango::DEV_LONG64: min_value.lg64 = (DevLong64)min_value.db; str.str(""); str.clear(); str << min_value.lg64; break; case Tango::DEV_DOUBLE: break; case Tango::DEV_FLOAT: min_value.fl = (DevFloat)min_value.db; break; case Tango::DEV_USHORT: (min_value.db < 0.0) ? min_value.ush = (DevUShort)(-min_value.db) : min_value.ush = (DevUShort)min_value.db; str.str(""); str.clear(); str << min_value.ush; break; case Tango::DEV_UCHAR: (min_value.db < 0.0) ? min_value.uch = (DevUChar)(-min_value.db) : min_value.uch = (DevUChar)min_value.db; str.str(""); str.clear(); str << (short)min_value.uch; break; case Tango::DEV_ULONG: (min_value.db < 0.0) ? min_value.ulg = (DevULong)(-min_value.db) : min_value.ulg = (DevULong)min_value.db; str.str(""); str.clear(); str << min_value.ulg; break; case Tango::DEV_ULONG64: (min_value.db < 0.0) ? min_value.ulg64 = (DevULong64)(-min_value.db) : min_value.ulg64 = (DevULong64)min_value.db; str.str(""); str.clear(); str << min_value.ulg64; break; case Tango::DEV_ENCODED: (min_value.db < 0.0) ? min_value.uch = (DevUChar)(-min_value.db) : min_value.uch = (DevUChar)min_value.db; str.str(""); str.clear(); str << (short)min_value.uch; break; } if (data_type != Tango::DEV_FLOAT && data_type != Tango::DEV_DOUBLE) min_value_str = str.str(); check_min_value = true; // // If the attribute is READ_WRITE or WRITE and memorized, check that the new // min_value is not above the already memorized value // Tango::AttrWriteType w_type = att.get_writable(); if ((w_type == Tango::READ_WRITE) || (w_type == Tango::WRITE)) { WAttribute *w_att = static_cast(this); string mem_value; if ((w_att->is_memorized() == true) && (w_att->mem_value_below_above(MIN,mem_value) == true)) throw_min_max_value(dev_name,mem_value,MIN); } } else throw_err_data_type("min_value",dev_name,"Attribute::set_properties()"); } // // For string representation: If there is a default (class or user) and if the user // entered a value equal to the default but with a different precision (3.2 and 3.20), take the // default one instead of the user one // if(class_defaults && min_value_str != AlrmValueNotSpec) { double db; str.str(""); str.clear(); str << min_value_str; if(str >> db && str.eof() && db == min_value_class_def_db) min_value_str = min_value_class_def; } else if(usr_defaults && min_value_str != AlrmValueNotSpec) { double db; str.str(""); str.clear(); str << min_value_str; if(str >> db && str.eof() && db == min_value_usr_def_db) min_value_str = min_value_usr_def; } delete_startup_exception("min_value"); // // Max value case // string max_value_usr_def; double max_value_usr_def_db; string max_value_class_def; double max_value_class_def_db; usr_defaults = false; class_defaults = false; if(TG_strcasecmp(conf.max_value,AlrmValueNotSpec) == 0) { // force library defaults (even if user defaults defined) max_value_str = AlrmValueNotSpec; } else if(TG_strcasecmp(conf.max_value,NotANumber) == 0) { // set class default if defined, user default value if defined, otherwise use the library defaults class_defaults = prop_in_list("max_value",max_value_class_def,nb_class,def_class_prop); if (class_defaults == false) { usr_defaults = prop_in_list("max_value",max_value_usr_def,nb_user,def_user_prop); if (usr_defaults == false) max_value_str = AlrmValueNotSpec; else { str.str(""); str.clear(); str << max_value_usr_def; str >> max_value_usr_def_db; max_value_str = max_value_usr_def; } } else { str.str(""); str.clear(); str << max_value_class_def; str >> max_value_class_def_db; max_value_str = max_value_class_def; } } else if (strlen(conf.max_value) == 0) { // set user default value if defined, otherwise use the library defaults usr_defaults = prop_in_list("max_value",max_value_usr_def,nb_user,def_user_prop); if (usr_defaults == false) max_value_str = AlrmValueNotSpec; else { str.str(""); str.clear(); str << max_value_usr_def; str >> max_value_usr_def_db; max_value_str = max_value_usr_def; } } else { // set property max_value_str = conf.max_value; } if (max_value_str == AlrmValueNotSpec) check_max_value = false; else { if ((data_type != Tango::DEV_STRING) && (data_type != Tango::DEV_BOOLEAN) && (data_type != Tango::DEV_STATE)) { str.str(""); str.clear(); str << max_value_str; if (!(str >> max_value.db && str.eof())) throw_err_format("max_value",dev_name,"Attribute::set_properties()"); switch (data_type) { case Tango::DEV_SHORT: max_value.sh = (DevShort)max_value.db; str.str(""); str.clear(); str << max_value.sh; break; case Tango::DEV_LONG: max_value.lg = (DevLong)max_value.db; str.str(""); str.clear(); str << max_value.lg; break; case Tango::DEV_LONG64: max_value.lg64 = (DevLong64)max_value.db; str.str(""); str.clear(); str << max_value.lg64; break; case Tango::DEV_DOUBLE: break; case Tango::DEV_FLOAT: max_value.fl = (DevFloat)max_value.db; break; case Tango::DEV_USHORT: (max_value.db < 0.0) ? max_value.ush = (DevUShort)(-max_value.db) : max_value.ush = (DevUShort)max_value.db; str.str(""); str.clear(); str << max_value.ush; break; case Tango::DEV_UCHAR: (max_value.db < 0.0) ? max_value.uch = (DevUChar)(-max_value.db) : max_value.uch = (DevUChar)max_value.db; str.str(""); str.clear(); str << (short)max_value.uch; break; case Tango::DEV_ULONG: (max_value.db < 0.0) ? max_value.ulg = (DevULong)(-max_value.db) : max_value.ulg = (DevULong)max_value.db; str.str(""); str.clear(); str << max_value.ulg; break; case Tango::DEV_ULONG64: (max_value.db < 0.0) ? max_value.ulg64 = (DevULong64)(-max_value.db) : max_value.ulg64 = (DevULong64)max_value.db; str.str(""); str.clear(); str << max_value.ulg64; break; case Tango::DEV_ENCODED: (max_value.db < 0.0) ? max_value.uch = (DevUChar)(-max_value.db) : max_value.uch = (DevUChar)max_value.db; str.str(""); str.clear(); str << (short)max_value.uch; break; } if (data_type != Tango::DEV_FLOAT && data_type != Tango::DEV_DOUBLE) max_value_str = str.str(); check_max_value = true; // // If the attribute is READ_WRITE or WRITE and memorized, check that the new // max_value is not above the already memorized value // Tango::AttrWriteType w_type = att.get_writable(); if ((w_type == Tango::READ_WRITE) || (w_type == Tango::WRITE)) { WAttribute *w_att = static_cast(this); string mem_value; if ((w_att->is_memorized() == true) && (w_att->mem_value_below_above(MAX,mem_value) == true)) throw_min_max_value(dev_name,mem_value,MAX); } } else throw_err_data_type("max_value",dev_name,"Attribute::set_properties()"); } // // For string representation: If there is a default (class or user) and if the user // entered a value equal to the default but with a different precision (3.2 and 3.20), take the // default one instead of the user one // if(class_defaults && max_value_str != AlrmValueNotSpec) { double db; str.str(""); str.clear(); str << max_value_str; if(str >> db && str.eof() && db == max_value_class_def_db) max_value_str = max_value_class_def; } else if(usr_defaults && max_value_str != AlrmValueNotSpec) { double db; str.str(""); str.clear(); str << max_value_str; if(str >> db && str.eof() && db == max_value_usr_def_db) max_value_str = max_value_usr_def; } delete_startup_exception("max_value"); // // Min alarm case // string min_alarm_usr_def; double min_alarm_usr_def_db; string min_alarm_class_def; double min_alarm_class_def_db; usr_defaults = false; class_defaults = false; if(TG_strcasecmp(conf.min_alarm,AlrmValueNotSpec) == 0) { // force library defaults (even if user defaults defined) min_alarm_str = AlrmValueNotSpec; } else if(TG_strcasecmp(conf.min_alarm,NotANumber) == 0) { // set class default if defined, user default value if defined, otherwise use the library defaults class_defaults = prop_in_list("min_alarm",min_alarm_class_def,nb_class,def_class_prop); if (class_defaults == false) { usr_defaults = prop_in_list("min_alarm",min_alarm_usr_def,nb_user,def_user_prop); if (usr_defaults == false) min_alarm_str = AlrmValueNotSpec; else { str.str(""); str.clear(); str << min_alarm_usr_def; str >> min_alarm_usr_def_db; min_alarm_str = min_alarm_usr_def; } } else { str.str(""); str.clear(); str << min_alarm_class_def; str >> min_alarm_class_def_db; min_alarm_str = min_alarm_class_def; } } else if (strlen(conf.min_alarm) == 0) { // set user default value if defined, otherwise use the library defaults usr_defaults = prop_in_list("min_alarm",min_alarm_usr_def,nb_user,def_user_prop); if (usr_defaults == false) min_alarm_str = AlrmValueNotSpec; else { str.str(""); str.clear(); str << min_alarm_usr_def; str >> min_alarm_usr_def_db; min_alarm_str = min_alarm_usr_def; } } else { // set property min_alarm_str = conf.min_alarm; } if (min_alarm_str == AlrmValueNotSpec) alarm_conf.reset(min_level); else { if ((data_type != Tango::DEV_STRING) && (data_type != Tango::DEV_BOOLEAN) && (data_type != Tango::DEV_STATE)) { str.str(""); str.clear(); str << min_alarm_str; if (!(str >> min_alarm.db && str.eof())) throw_err_format("min_alarm",dev_name,"Attribute::set_properties()"); switch (data_type) { case Tango::DEV_SHORT: min_alarm.sh = (DevShort)min_alarm.db; str.str(""); str.clear(); str << min_alarm.sh; break; case Tango::DEV_LONG: min_alarm.lg = (DevLong)min_alarm.db; str.str(""); str.clear(); str << min_alarm.lg; break; case Tango::DEV_LONG64: min_alarm.lg64 = (DevLong64)min_alarm.db; str.str(""); str.clear(); str << min_alarm.lg64; break; case Tango::DEV_DOUBLE: break; case Tango::DEV_FLOAT: min_alarm.fl = (DevFloat)min_alarm.db; break; case Tango::DEV_USHORT: (min_alarm.db < 0.0) ? min_alarm.ush = (DevUShort)(-min_alarm.db) : min_alarm.ush = (DevUShort)min_alarm.db; str.str(""); str.clear(); str << min_alarm.ush; break; case Tango::DEV_UCHAR: (min_alarm.db < 0.0) ? min_alarm.uch = (DevUChar)(-min_alarm.db) : min_alarm.uch = (DevUChar)min_alarm.db; str.str(""); str.clear(); str << (short)min_alarm.uch; break; case Tango::DEV_ULONG: (min_alarm.db < 0.0) ? min_alarm.ulg = (DevULong)(-min_alarm.db) : min_alarm.ulg = (DevULong)min_alarm.db; str.str(""); str.clear(); str << min_alarm.ulg; break; case Tango::DEV_ULONG64: (min_alarm.db < 0.0) ? min_alarm.ulg64 = (DevULong64)(-min_alarm.db) : min_alarm.ulg64 = (DevULong64)min_alarm.db; str.str(""); str.clear(); str << min_alarm.ulg64; break; case Tango::DEV_ENCODED: (min_alarm.db < 0.0) ? min_alarm.uch = (DevUChar)(-min_alarm.db) : min_alarm.uch = (DevUChar)min_alarm.db; str.str(""); str.clear(); str << (short)min_alarm.uch; break; } if (data_type != Tango::DEV_FLOAT && data_type != Tango::DEV_DOUBLE) min_alarm_str = str.str(); alarm_conf.set(min_level); // // If the attribute is READ_WRITE or WRITE and memorized, check that the new // min_alarm is not above the already memorized value // Tango::AttrWriteType w_type = att.get_writable(); if ((w_type == Tango::READ_WRITE) || (w_type == Tango::WRITE)) { WAttribute *w_att = static_cast(this); string mem_value; if ((w_att->is_memorized() == true) && (w_att->mem_value_below_above(MIN,mem_value) == true)) throw_min_max_value(dev_name,mem_value,MIN); } } else throw_err_data_type("min_alarm",dev_name,"Attribute::set_properties()"); } // // For string representation: If there is a default (class or user) and if the user // entered a value equal to the default but with a different precision (3.2 and 3.20), take the // default one instead of the user one // if(class_defaults && min_alarm_str != AlrmValueNotSpec) { double db; str.str(""); str.clear(); str << min_alarm_str; if(str >> db && str.eof() && db == min_alarm_class_def_db) min_alarm_str = min_alarm_class_def; } else if(usr_defaults && min_alarm_str != AlrmValueNotSpec) { double db; str.str(""); str.clear(); str << min_alarm_str; if(str >> db && str.eof() && db == min_alarm_usr_def_db) min_alarm_str = min_alarm_usr_def; } delete_startup_exception("min_alarm"); // // Max alarm case // string max_alarm_usr_def; double max_alarm_usr_def_db; string max_alarm_class_def; double max_alarm_class_def_db; usr_defaults = false; class_defaults = false; if(TG_strcasecmp(conf.max_alarm,AlrmValueNotSpec) == 0) { // force library defaults (even if user defaults defined) max_alarm_str = AlrmValueNotSpec; } else if(TG_strcasecmp(conf.max_alarm,NotANumber) == 0) { // set class default if defined, user default value if defined, otherwise use the library defaults class_defaults = prop_in_list("max_alarm",max_alarm_class_def,nb_class,def_class_prop); if (class_defaults == false) { usr_defaults = prop_in_list("max_alarm",max_alarm_usr_def,nb_user,def_user_prop); if (usr_defaults == false) max_alarm_str = AlrmValueNotSpec; else { str.str(""); str.clear(); str << max_alarm_usr_def; str >> max_alarm_usr_def_db; max_alarm_str = max_alarm_usr_def; } } else { str.str(""); str.clear(); str << max_alarm_class_def; str >> max_alarm_class_def_db; max_alarm_str = max_alarm_class_def; } } else if (strlen(conf.max_alarm) == 0) { // set user default value if defined, otherwise use the library defaults usr_defaults = prop_in_list("max_alarm",max_alarm_usr_def,nb_user,def_user_prop); if (usr_defaults == false) max_alarm_str = AlrmValueNotSpec; else { str.str(""); str.clear(); str << max_alarm_usr_def; str >> max_alarm_usr_def_db; max_alarm_str = max_alarm_usr_def; } } else { // set property max_alarm_str = conf.max_alarm; } if (max_alarm_str == AlrmValueNotSpec) alarm_conf.reset(max_level); else { if ((data_type != Tango::DEV_STRING) && (data_type != Tango::DEV_BOOLEAN) && (data_type != Tango::DEV_STATE)) { str.str(""); str.clear(); str << max_alarm_str; if (!(str >> max_alarm.db && str.eof())) throw_err_format("max_alarm",dev_name,"Attribute::set_properties()"); switch (data_type) { case Tango::DEV_SHORT: max_alarm.sh = (DevShort)max_alarm.db; str.str(""); str.clear(); str << max_alarm.sh; break; case Tango::DEV_LONG: max_alarm.lg = (DevLong)max_alarm.db; str.str(""); str.clear(); str << max_alarm.lg; break; case Tango::DEV_LONG64: max_alarm.lg64 = (DevLong64)max_alarm.db; str.str(""); str.clear(); str << max_alarm.lg64; break; case Tango::DEV_DOUBLE: break; case Tango::DEV_FLOAT: max_alarm.fl = (DevFloat)max_alarm.db; break; case Tango::DEV_USHORT: (max_alarm.db < 0.0) ? max_alarm.ush = (DevUShort)(-max_alarm.db) : max_alarm.ush = (DevUShort)max_alarm.db; str.str(""); str.clear(); str << max_alarm.ush; break; case Tango::DEV_UCHAR: (max_alarm.db < 0.0) ? max_alarm.uch = (DevUChar)(-max_alarm.db) : max_alarm.uch = (DevUChar)max_alarm.db; str.str(""); str.clear(); str << (short)max_alarm.uch; break; case Tango::DEV_ULONG: (max_alarm.db < 0.0) ? max_alarm.ulg = (DevULong)(-max_alarm.db) : max_alarm.ulg = (DevULong)max_alarm.db; str.str(""); str.clear(); str << max_alarm.ulg; break; case Tango::DEV_ULONG64: (max_alarm.db < 0.0) ? max_alarm.ulg64 = (DevULong64)(-max_alarm.db) : max_alarm.ulg64 = (DevULong64)max_alarm.db; str.str(""); str.clear(); str << max_alarm.ulg64; break; case Tango::DEV_ENCODED: (max_alarm.db < 0.0) ? max_alarm.uch = (DevUChar)(-max_alarm.db) : max_alarm.uch = (DevUChar)max_alarm.db; str.str(""); str.clear(); str << (short)max_alarm.uch; break; } if (data_type != Tango::DEV_FLOAT && data_type != Tango::DEV_DOUBLE) max_alarm_str = str.str(); alarm_conf.set(max_level); // // If the attribute is READ_WRITE or WRITE and memorized, check that the new // max_alarm is not above the already memorized value // Tango::AttrWriteType w_type = att.get_writable(); if ((w_type == Tango::READ_WRITE) || (w_type == Tango::WRITE)) { WAttribute *w_att = static_cast(this); string mem_value; if ((w_att->is_memorized() == true) && (w_att->mem_value_below_above(MIN,mem_value) == true)) throw_min_max_value(dev_name,mem_value,MIN); } } else throw_err_data_type("max_alarm",dev_name,"Attribute::set_properties()"); } // // For string representation: If there is a default (class or user) and if the user // entered a value equal to the default but with a different precision (3.2 and 3.20), take the // default one instead of the user one // if(class_defaults && max_alarm_str != AlrmValueNotSpec) { double db; str.str(""); str.clear(); str << max_alarm_str; if(str >> db && str.eof() && db == max_alarm_class_def_db) max_alarm_str = max_alarm_class_def; } else if(usr_defaults && max_alarm_str != AlrmValueNotSpec) { double db; str.str(""); str.clear(); str << max_alarm_str; if(str >> db && str.eof() && db == max_alarm_usr_def_db) max_alarm_str = max_alarm_usr_def; } delete_startup_exception("max_alarm"); } void Attribute::set_properties(const Tango::AttributeConfig_3 &conf) { set_properties(conf,ext->d_name); } void Attribute::set_properties(const Tango::AttributeConfig_3 &conf,Tango::DeviceImpl *d) { if (ext->dev == NULL) ext->dev = d; set_properties(conf,d->get_name()); } void Attribute::set_properties(const Tango::AttributeConfig_3 &conf,string &dev_name) { // // First, do all the job done by old set_property(ies) // AttributeConfig tmp_conf; tmp_conf.name = conf.name; tmp_conf.data_type = conf.data_type; tmp_conf.data_format = conf.data_format; tmp_conf.writable = conf.writable; tmp_conf.writable_attr_name = conf.writable_attr_name; tmp_conf.max_dim_x = conf.max_dim_x; tmp_conf.max_dim_y = conf.max_dim_y; tmp_conf.description = conf.description; tmp_conf.label = conf.label; tmp_conf.unit = conf.unit; tmp_conf.standard_unit = conf.standard_unit; tmp_conf.display_unit = conf.display_unit; tmp_conf.format = conf.format; tmp_conf.min_value = conf.min_value; tmp_conf.max_value = conf.max_value; tmp_conf.min_alarm = conf.att_alarm.min_alarm; tmp_conf.max_alarm = conf.att_alarm.max_alarm; set_properties(tmp_conf,dev_name); // // Add a check of the display level property because it is not checked by the check_hard_coded_properties() template // method called by the set_properties() method. Display level is available only in AttributeConfig_3 // check_hard_coded_properties(conf); if (conf.level != get_disp_level()) { throw_hard_coded_prop("level"); } // // Copy only a sub-set of the new properties // For each "string" property, an empty string or NotANumber mean return to its // default value which could be the library default value or the // user defined default value if present. AlrmValueNotSpec brings the library // default values regardless of the user defined defaults. // vector fake_attr_prop; Tango::DeviceClass *dev_class = get_att_device_class(dev_name); Tango::Attr *att_ptr; bool state_or_status = false; if (name_lower == "state" || name_lower == "status") state_or_status = true; if (state_or_status == false) { Tango::MultiClassAttribute *mca = dev_class->get_class_attr(); att_ptr = &(mca->get_attr(name)); } vector &def_user_prop = state_or_status == false ? att_ptr->get_user_default_properties() : fake_attr_prop; size_t nb_user = def_user_prop.size(); vector &def_class_prop = state_or_status == false ? att_ptr->get_class_properties() : fake_attr_prop; size_t nb_class = def_class_prop.size(); TangoSys_MemStream str; str.precision(TANGO_FLOAT_PRECISION); if (state_or_status == false) { // // The min_warning case // string min_warning_usr_def; double min_warning_usr_def_db; string min_warning_class_def; double min_warning_class_def_db; bool usr_defaults = false; bool class_defaults = false; if(TG_strcasecmp(conf.att_alarm.min_warning,AlrmValueNotSpec) == 0) { // force library defaults (even if user defaults defined) min_warning_str = AlrmValueNotSpec; } else if(TG_strcasecmp(conf.att_alarm.min_warning,NotANumber) == 0) { // set class default if defined, user default value if defined, otherwise use the library defaults class_defaults = prop_in_list("min_warning",min_warning_class_def,nb_class,def_class_prop); if (class_defaults == false) { usr_defaults = prop_in_list("min_warning",min_warning_usr_def,nb_user,def_user_prop); if (usr_defaults == false) min_warning_str = AlrmValueNotSpec; else { str.str(""); str.clear(); str << min_warning_usr_def; str >> min_warning_usr_def_db; min_warning_str = min_warning_usr_def; } } else { str.str(""); str.clear(); str << min_warning_class_def; str >> min_warning_class_def_db; min_warning_str = min_warning_class_def; } } else if (strlen(conf.att_alarm.min_warning) == 0) { // set user default value if defined, otherwise use the library defaults usr_defaults = prop_in_list("min_warning",min_warning_usr_def,nb_user,def_user_prop); if (usr_defaults == false) min_warning_str = AlrmValueNotSpec; else { str.str(""); str.clear(); str << min_warning_usr_def; str >> min_warning_usr_def_db; min_warning_str = min_warning_usr_def; } } else { // set property min_warning_str = conf.att_alarm.min_warning; } if (min_warning_str == AlrmValueNotSpec) alarm_conf.reset(min_warn); else { if ((data_type != Tango::DEV_STRING) && (data_type != Tango::DEV_BOOLEAN) && (data_type != Tango::DEV_STATE)) { str.str(""); str.clear(); str << min_warning_str; if (!(str >> min_warning.db && str.eof())) throw_err_format("min_warning",dev_name,"Attribute::set_properties()"); switch (data_type) { case Tango::DEV_SHORT: min_warning.sh = (DevShort)min_warning.db; str.str(""); str.clear(); str << min_warning.sh; break; case Tango::DEV_LONG: min_warning.lg = (DevLong)min_warning.db; str.str(""); str.clear(); str << min_warning.lg; break; case Tango::DEV_LONG64: min_warning.lg64 = (DevLong64)min_warning.db; str.str(""); str.clear(); str << min_warning.lg64; break; case Tango::DEV_DOUBLE: break; case Tango::DEV_FLOAT: min_warning.fl = (DevFloat)min_warning.db; break; case Tango::DEV_USHORT: (min_warning.db < 0.0) ? min_warning.ush = (DevUShort)(-min_warning.db) : min_warning.ush = (DevUShort)min_warning.db; str.str(""); str.clear(); str << min_warning.ush; break; case Tango::DEV_UCHAR: (min_warning.db < 0.0) ? min_warning.uch = (DevUChar)(-min_warning.db) : min_warning.uch = (DevUChar)min_warning.db; str.str(""); str.clear(); str << (short)min_warning.uch; break; case Tango::DEV_ULONG: (min_warning.db < 0.0) ? min_warning.ulg = (DevULong)(-min_warning.db) : min_warning.ulg = (DevULong)min_warning.db; str.str(""); str.clear(); str << min_warning.ulg; break; case Tango::DEV_ULONG64: (min_warning.db < 0.0) ? min_warning.ulg64 = (DevULong64)(-min_warning.db) : min_warning.ulg64 = (DevULong64)min_warning.db; str.str(""); str.clear(); str << min_warning.ulg64; break; case Tango::DEV_ENCODED: (min_warning.db < 0.0) ? min_warning.uch = (DevUChar)(-min_warning.db) : min_warning.uch = (DevUChar)min_warning.db; str.str(""); str.clear(); str << (short)min_warning.uch; break; } if (data_type != Tango::DEV_FLOAT && data_type != Tango::DEV_DOUBLE) min_warning_str = str.str(); alarm_conf.set(min_warn); } else throw_err_data_type("min_warning",dev_name,"Attribute::set_properties()"); } // // For string representation: If there is a default (class or user) and if the user // entered a value equal to the default but with a different precision (3.2 and 3.20), take the // default one instead of the user one // if(class_defaults && min_warning_str != AlrmValueNotSpec) { double db; str.str(""); str.clear(); str << min_warning_str; if(str >> db && str.eof() && db == min_warning_class_def_db) min_warning_str = min_warning_class_def; } else if(usr_defaults && min_warning_str != AlrmValueNotSpec) { double db; str.str(""); str.clear(); str << min_warning_str; if(str >> db && str.eof() && db == min_warning_usr_def_db) min_warning_str = min_warning_usr_def; } delete_startup_exception("min_warning"); // // Now, ladies and gentleman, the max warning case // string max_warning_usr_def; double max_warning_usr_def_db; string max_warning_class_def; double max_warning_class_def_db; usr_defaults = false; class_defaults = false; if(TG_strcasecmp(conf.att_alarm.max_warning,AlrmValueNotSpec) == 0) { // force library defaults (even if user defaults defined) max_warning_str = AlrmValueNotSpec; } else if(TG_strcasecmp(conf.att_alarm.max_warning,NotANumber) == 0) { // set class default if defined, user default value if defined, otherwise use the library defaults class_defaults = prop_in_list("max_warning",max_warning_class_def,nb_class,def_class_prop); if (class_defaults == false) { usr_defaults = prop_in_list("max_warning",max_warning_usr_def,nb_user,def_user_prop); if (usr_defaults == false) max_warning_str = AlrmValueNotSpec; else { str.str(""); str.clear(); str << max_warning_usr_def; str >> max_warning_usr_def_db; max_warning_str = max_warning_usr_def; } } else { str.str(""); str.clear(); str << max_warning_class_def; str >> max_warning_class_def_db; max_warning_str = max_warning_class_def; } } else if (strlen(conf.att_alarm.max_warning) == 0) { // set user default value if defined, otherwise use the library defaults usr_defaults = prop_in_list("max_warning",max_warning_usr_def,nb_user,def_user_prop); if (usr_defaults == false) max_warning_str = AlrmValueNotSpec; else { str.str(""); str.clear(); str << max_warning_usr_def; str >> max_warning_usr_def_db; max_warning_str = max_warning_usr_def; } } else { // set property max_warning_str = conf.att_alarm.max_warning; } if (max_warning_str == AlrmValueNotSpec) alarm_conf.reset(max_warn); else { if ((data_type != Tango::DEV_STRING) && (data_type != Tango::DEV_BOOLEAN) && (data_type != Tango::DEV_STATE)) { str.str(""); str.clear(); str << max_warning_str; if (!(str >> max_warning.db && str.eof())) throw_err_format("max_warning",dev_name,"Attribute::set_properties()"); switch (data_type) { case Tango::DEV_SHORT: max_warning.sh = (DevShort)max_warning.db; str.str(""); str.clear(); str << max_warning.sh; break; case Tango::DEV_LONG: max_warning.lg = (DevLong)max_warning.db; str.str(""); str.clear(); str << max_warning.lg; break; case Tango::DEV_LONG64: max_warning.lg64 = (DevLong64)max_warning.db; str.str(""); str.clear(); str << max_warning.lg64; break; case Tango::DEV_DOUBLE: break; case Tango::DEV_FLOAT: max_warning.fl = (DevFloat)max_warning.db; break; case Tango::DEV_USHORT: (max_warning.db < 0.0) ? max_warning.ush = (DevUShort)(-max_warning.db) : max_warning.ush = (DevUShort)max_warning.db; str.str(""); str.clear(); str << max_warning.ush; break; case Tango::DEV_UCHAR: (max_warning.db < 0.0) ? max_warning.uch = (DevUChar)(-max_warning.db) : max_warning.uch = (DevUChar)max_warning.db; str.str(""); str.clear(); str << (short)max_warning.uch; break; case Tango::DEV_ULONG: (max_warning.db < 0.0) ? max_warning.ulg = (DevULong)(-max_warning.db) : max_warning.ulg = (DevULong)max_warning.db; str.str(""); str.clear(); str << max_warning.ulg; break; case Tango::DEV_ULONG64: (max_warning.db < 0.0) ? max_warning.ulg64 = (DevULong64)(-max_warning.db) : max_warning.ulg64 = (DevULong64)max_warning.db; str.str(""); str.clear(); str << max_warning.ulg64; break; case Tango::DEV_ENCODED: (max_warning.db < 0.0) ? max_warning.uch = (DevUChar)(-max_warning.db) : max_warning.uch = (DevUChar)max_warning.db; str.str(""); str.clear(); str << (short)max_warning.uch; break; } if (data_type != Tango::DEV_FLOAT && data_type != Tango::DEV_DOUBLE) max_warning_str = str.str(); alarm_conf.set(max_warn); } else throw_err_data_type("max_warning",dev_name,"Attribute::set_properties()"); } // // For string representation: If there is a default (class or user) and if the user // entered a value equal to the default but with a different precision (3.2 and 3.20), take the // default one instead of the user one // if(class_defaults && max_warning_str != AlrmValueNotSpec) { double db; str.str(""); str.clear(); str << max_warning_str; if(str >> db && str.eof() && db == max_warning_class_def_db) max_warning_str = max_warning_class_def; } else if(usr_defaults && max_warning_str != AlrmValueNotSpec) { double db; str.str(""); str.clear(); str << max_warning_str; if(str >> db && str.eof() && db == max_warning_usr_def_db) max_warning_str = max_warning_usr_def; } delete_startup_exception("max_warning"); // // Then, the delta_val // bool delta_val_defined = false; string delta_val_usr_def; double delta_val_usr_def_db; string delta_val_class_def; double delta_val_class_def_db; usr_defaults = false; class_defaults = false; if(TG_strcasecmp(conf.att_alarm.delta_val,AlrmValueNotSpec) == 0) { // force library defaults (even if user defaults defined) delta_val_str = AlrmValueNotSpec; } else if(TG_strcasecmp(conf.att_alarm.delta_val,NotANumber) == 0) { // set class default if defined, user default value if defined, otherwise use the library defaults class_defaults = prop_in_list("delta_val",delta_val_class_def,nb_class,def_class_prop); if (class_defaults == false) { usr_defaults = prop_in_list("delta_val",delta_val_usr_def,nb_user,def_user_prop); if (usr_defaults == false) delta_val_str = AlrmValueNotSpec; else { str.str(""); str.clear(); str << delta_val_usr_def; str >> delta_val_usr_def_db; delta_val_str = delta_val_usr_def; } } else { str.str(""); str.clear(); str << delta_val_class_def; str >> delta_val_class_def_db; delta_val_str = delta_val_class_def; } } else if (strlen(conf.att_alarm.delta_val) == 0) { // set user default value if defined, otherwise use the library defaults usr_defaults = prop_in_list("delta_val",delta_val_usr_def,nb_user,def_user_prop); if (usr_defaults == false) delta_val_str = AlrmValueNotSpec; else { str.str(""); str.clear(); str << delta_val_usr_def; str >> delta_val_usr_def_db; delta_val_str = delta_val_usr_def; } } else { // set property delta_val_str = conf.att_alarm.delta_val; } if (delta_val_str != AlrmValueNotSpec) { if ((data_type != Tango::DEV_STRING) && (data_type != Tango::DEV_BOOLEAN) && (data_type != Tango::DEV_STATE)) { str.str(""); str.clear(); str << delta_val_str; if (!(str >> delta_val.db && str.eof())) throw_err_format("delta_val",dev_name,"Attribute::set_properties()"); switch (data_type) { case Tango::DEV_SHORT: delta_val.sh = (DevShort)delta_val.db; str.str(""); str.clear(); str << delta_val.sh; break; case Tango::DEV_LONG: delta_val.lg = (DevLong)delta_val.db; str.str(""); str.clear(); str << delta_val.lg; break; case Tango::DEV_LONG64: delta_val.lg64 = (DevLong64)delta_val.db; str.str(""); str.clear(); str << delta_val.lg64; break; case Tango::DEV_DOUBLE: break; case Tango::DEV_FLOAT: delta_val.fl = (DevFloat)delta_val.db; break; case Tango::DEV_USHORT: (delta_val.db < 0.0) ? delta_val.ush = (DevUShort)(-delta_val.db) : delta_val.ush = (DevUShort)delta_val.db; str.str(""); str.clear(); str << delta_val.ush; break; case Tango::DEV_UCHAR: (delta_val.db < 0.0) ? delta_val.uch = (DevUChar)(-delta_val.db) : delta_val.uch = (DevUChar)delta_val.db; str.str(""); str.clear(); str << (short)delta_val.uch; break; case Tango::DEV_ULONG: (delta_val.db < 0.0) ? delta_val.ulg = (DevULong)(-delta_val.db) : delta_val.ulg = (DevULong)delta_val.db; str.str(""); str.clear(); str << delta_val.ulg; break; case Tango::DEV_ULONG64: (delta_val.db < 0.0) ? delta_val.ulg64 = (DevULong64)(-delta_val.db) : delta_val.ulg64 = (DevULong64)delta_val.db; str.str(""); str.clear(); str << delta_val.ulg64; break; case Tango::DEV_ENCODED: (delta_val.db < 0.0) ? delta_val.uch = (DevUChar)(-delta_val.db) : delta_val.uch = (DevUChar)delta_val.db; str.str(""); str.clear(); str << (short)delta_val.uch; break; } if (data_type != Tango::DEV_FLOAT && data_type != Tango::DEV_DOUBLE) delta_val_str = str.str(); delta_val_defined = true; } else throw_err_data_type("delta_val",dev_name,"Attribute::set_properties()"); } // // For string representation: If there is a default (class or user) and if the user // entered a value equal to the default but with a different precision (3.2 and 3.20), take the // default one instead of the user one // if(class_defaults && delta_val_str != AlrmValueNotSpec) { double db; str.str(""); str.clear(); str << delta_val_str; if(str >> db && str.eof() && db == delta_val_class_def_db) delta_val_str = delta_val_class_def; } else if(usr_defaults && delta_val_str != AlrmValueNotSpec) { double db; str.str(""); str.clear(); str << delta_val_str; if(str >> db && str.eof() && db == delta_val_usr_def_db) delta_val_str = delta_val_usr_def; } delete_startup_exception("delta_val"); // // And the delta_t // bool delta_t_defined = false; string delta_t_usr_def; double delta_t_usr_def_db = 0.0; string delta_t_class_def; double delta_t_class_def_db = 0.0; usr_defaults = false; class_defaults = false; if(TG_strcasecmp(conf.att_alarm.delta_t,AlrmValueNotSpec) == 0 || TG_strcasecmp(conf.att_alarm.delta_t,"0") == 0 || TG_strcasecmp(conf.att_alarm.delta_t,"0.0") == 0) { // force library defaults (even if user defaults defined) delta_t_str = "0"; } else if (TG_strcasecmp(conf.att_alarm.delta_t,NotANumber) == 0) { // set class default if defined, user default value if defined, otherwise use the library defaults class_defaults = prop_in_list("delta_t",delta_t_class_def,nb_class,def_class_prop); if (class_defaults == false) { usr_defaults = prop_in_list("delta_t",delta_t_usr_def,nb_user,def_user_prop); if (usr_defaults == false) delta_t_str = "0"; else { str.str(""); str.clear(); str << delta_t_usr_def; str >> delta_t_usr_def_db; delta_t_str = delta_t_usr_def; } } else { str.str(""); str.clear(); str << delta_t_class_def; str >> delta_t_class_def_db; delta_t_str = delta_t_class_def; } } else if (strlen(conf.att_alarm.delta_t) == 0) { // set user default value if defined, otherwise use the library defaults usr_defaults = prop_in_list("delta_t",delta_t_usr_def,nb_user,def_user_prop); if (usr_defaults == false) delta_t_str = "0"; else { str.str(""); str.clear(); str << delta_t_usr_def; str >> delta_t_usr_def_db; delta_t_str = delta_t_usr_def; } } else { // set property delta_t_str = conf.att_alarm.delta_t; } if(delta_t_str != "0") { if ((data_type != Tango::DEV_STRING) && (data_type != Tango::DEV_BOOLEAN) && (data_type != Tango::DEV_STATE)) { str.str(""); str.clear(); str << delta_t_str; double db; if (!(str >> db && str.eof())) throw_err_format("delta_t",dev_name,"Attribute::set_properties"); delta_t = (long)db; str.str(""); str.clear(); str << delta_t; delta_t_str = str.str(); delta_t_defined = true; } else throw_err_data_type("delta_t",dev_name,"Attribute::set_properties"); } else delta_t = 0; if(class_defaults && delta_t_str != AlrmValueNotSpec) { double db; str.str(""); str.clear(); str << delta_t_str; if(str >> db && str.eof() && db == delta_t_class_def_db) delta_t_str = delta_t_class_def; } else if(usr_defaults && delta_t_str != AlrmValueNotSpec) { double db; str.str(""); str.clear(); str << delta_t_str; if(str >> db && str.eof() && db == delta_t_usr_def_db) delta_t_str = delta_t_usr_def; } delete_startup_exception("delta_t"); // // Set RDS alarm flag only if both delta_t and delta_val are defined // if(delta_t_defined && delta_val_defined) { alarm_conf.set(rds); delete_startup_exception("rds_alarm"); } else if(delta_t_defined || delta_val_defined) { alarm_conf.reset(rds); // // Set device if not already done // try { if (ext->dev == NULL) { // TODO: check how to make cerr quiet cerr.setstate(ios::failbit); Tango::Util *tg = Tango::Util::instance(); ext->dev = tg->get_device_by_name(ext->d_name); cerr.clear(); } if (ext->dev->get_logger()->is_warn_enabled()) ext->dev->get_logger()->warn_stream() << log4tango::LogInitiator::_begin_log << "RDS (Read Different Set) incoherent in attribute " << name << " (only " << (delta_t_defined ? "delta_t" : "delta_val") << " is set) " << endl; } catch(...) { cerr.clear(); } } else { alarm_conf.reset(rds); delete_startup_exception("rds_alarm"); } // // Now, the 4 changes parameters (for change and archive events) // // // Relative change // string rel_change_str(conf.event_prop.ch_event.rel_change); // provided, comma separated min and/or max values for the property string rel_change_usr_str; // user default, comma separated min and/or max values for the property, if defined string rel_change_class_str; // class default, comma separated min and/or max values for the property, if defined vector rel_change; // vector containing min and max values of the property vector rel_change_usr; // vector containing user default min and max values of the property vector rel_change_class; // vector containing class default min and max values of the property bool rel_change_usr_def; // true if there are user defaults defined for the property bool rel_change_class_def; // true if there are class defaults defined for the property vector rel_change_set_usr_def; // vector indicating if to use provided values for the property or the user defaults if defined vector rel_change_set_class_def; // vector indicating if to use provided values for the property or the class defaults if defined rel_change_usr_def = prop_in_list("rel_change",rel_change_usr_str,nb_user,def_user_prop); rel_change_class_def = prop_in_list("rel_change",rel_change_class_str,nb_class,def_class_prop); // // Validate user or class default properties // if(rel_change_usr_def) validate_change_properties(dev_name,"rel_change",rel_change_usr_str,rel_change_usr); if(rel_change_class_def) validate_change_properties(dev_name,"rel_change",rel_change_class_str,rel_change_class); // // Validate user provided values // validate_change_properties(dev_name,"rel_change",rel_change_str,rel_change,rel_change_set_usr_def,rel_change_set_class_def); // // Set values // if (rel_change_class_def) { if (rel_change_set_class_def[0] == true) ext->rel_change[0] = rel_change_class[0]; else if (rel_change_usr_def) { if (rel_change_set_usr_def[0] == true) ext->rel_change[0] = rel_change_usr[0]; else ext->rel_change[0] = rel_change[0]; } else ext->rel_change[0] = rel_change[0]; if (rel_change_set_class_def[1] == true) ext->rel_change[1] = rel_change_class[1]; else if (rel_change_usr_def) { if (rel_change_set_usr_def[1] == true) ext->rel_change[1] = rel_change_usr[1]; else ext->rel_change[1] = rel_change[1]; } else ext->rel_change[1] = rel_change[1]; } else if(rel_change_usr_def) { ext->rel_change[0] = (rel_change_set_class_def[0]) ? rel_change_usr[0] : ((rel_change_set_usr_def[0]) ? rel_change_usr[0] : rel_change[0]); ext->rel_change[1] = (rel_change_set_class_def[1]) ? rel_change_usr[1] : ((rel_change_set_usr_def[1]) ? rel_change_usr[1] : rel_change[1]); } else { ext->rel_change[0] = rel_change[0]; ext->rel_change[1] = rel_change[1]; } delete_startup_exception("rel_change"); // // Absolute change // string abs_change_str(conf.event_prop.ch_event.abs_change); // provided, comma separated min and/or max values for the property string abs_change_usr_str; // user default, comma separated min and/or max values for the property, if defined string abs_change_class_str; // class default, comma separated min and/or max values for the property, if defined vector abs_change; // vector containing min and max values of the property vector abs_change_usr; // vector containing user default min and max values of the property vector abs_change_class; // vector containing class default min and max values of the property bool abs_change_usr_def; // true if there are user defaults defined for the property bool abs_change_class_def; // true if there are class defaults defined for the property vector abs_change_set_usr_def; // vector indicating if to use provided values for the property or the user defaults if defined vector abs_change_set_class_def; // vector indicating if to use provided values for the property or the user defaults if defined abs_change_usr_def = prop_in_list("abs_change",abs_change_usr_str,nb_user,def_user_prop); abs_change_class_def = prop_in_list("abs_change",abs_change_class_str,nb_class,def_class_prop); // // Validate user or classs default properties // if(abs_change_usr_def) validate_change_properties(dev_name,"abs_change",abs_change_usr_str,abs_change_usr); if(abs_change_class_def) validate_change_properties(dev_name,"abs_change",abs_change_class_str,abs_change_class); // // Validate user provided values // validate_change_properties(dev_name,"abs_change",abs_change_str,abs_change,abs_change_set_usr_def,abs_change_set_class_def); // // Set values // if (abs_change_class_def) { if (abs_change_set_class_def[0] == true) ext->abs_change[0] = abs_change_class[0]; else if (abs_change_usr_def) { if (abs_change_set_usr_def[0] == true) ext->abs_change[0] = abs_change_usr[0]; else ext->abs_change[0] = abs_change[0]; } else ext->abs_change[0] = abs_change[0]; if (abs_change_set_class_def[1] == true) ext->abs_change[1] = abs_change_class[1]; else if (abs_change_usr_def) { if (abs_change_set_usr_def[1] == true) ext->abs_change[1] = abs_change_usr[1]; else ext->abs_change[1] = abs_change[1]; } else ext->abs_change[1] = abs_change[1]; } else if(abs_change_usr_def) { ext->abs_change[0] = (abs_change_set_class_def[0]) ? abs_change_usr[0] : ((abs_change_set_usr_def[0]) ? abs_change_usr[0] : abs_change[0]); ext->abs_change[1] = (abs_change_set_class_def[1]) ? abs_change_usr[1] : ((abs_change_set_usr_def[1]) ? abs_change_usr[1] : abs_change[1]); } else { ext->abs_change[0] = abs_change[0]; ext->abs_change[1] = abs_change[1]; } delete_startup_exception("abs_change"); // // Archive relative change // string archive_rel_change_str(conf.event_prop.arch_event.rel_change); // provided, comma separated min and/or max values for the property string archive_rel_change_usr_str; // user default, comma separated min and/or max values for the property, if defined string archive_rel_change_class_str; // class default, comma separated min and/or max values for the property, if defined vector archive_rel_change; // vector containing min and max values of the property vector archive_rel_change_usr; // vector containing user default min and max values of the property vector archive_rel_change_class; // vector containing class default min and max values of the property bool archive_rel_change_usr_def; // true if there are user defaults defined for the property bool archive_rel_change_class_def; // true if there are class defaults defined for the property vector archive_rel_change_set_usr_def; // vector indicating if to use provided values for the property or the user defaults if defined vector archive_rel_change_set_class_def; // vector indicating if to use provided values for the property or the class defaults if defined archive_rel_change_usr_def = prop_in_list("archive_rel_change",archive_rel_change_usr_str,nb_user,def_user_prop); archive_rel_change_class_def = prop_in_list("archive_rel_change",archive_rel_change_class_str,nb_class,def_class_prop); // // Validate user or classs default properties // if(archive_rel_change_usr_def) validate_change_properties(dev_name,"archive_rel_change",archive_rel_change_usr_str,archive_rel_change_usr); if(abs_change_class_def) validate_change_properties(dev_name,"archive_rel_change",archive_rel_change_class_str,archive_rel_change_class); // // Validate user provided values // validate_change_properties(dev_name,"archive_rel_change",archive_rel_change_str,archive_rel_change,archive_rel_change_set_usr_def,archive_rel_change_set_class_def); // // Set values // if (archive_rel_change_class_def) { if (archive_rel_change_set_class_def[0] == true) ext->archive_rel_change[0] = archive_rel_change_class[0]; else if (archive_rel_change_usr_def) { if (archive_rel_change_set_usr_def[0] == true) ext->archive_rel_change[0] = archive_rel_change_usr[0]; else ext->archive_rel_change[0] = archive_rel_change[0]; } else ext->archive_rel_change[0] = archive_rel_change[0]; if (archive_rel_change_set_class_def[1] == true) ext->archive_rel_change[1] = archive_rel_change_class[1]; else if (archive_rel_change_usr_def) { if (archive_rel_change_set_usr_def[1] == true) ext->archive_rel_change[1] = archive_rel_change_usr[1]; else ext->archive_rel_change[1] = archive_rel_change[1]; } else ext->archive_rel_change[1] = archive_rel_change[1]; } else if(archive_rel_change_usr_def) { ext->archive_rel_change[0] = (archive_rel_change_set_class_def[0]) ? archive_rel_change_usr[0] : ((archive_rel_change_set_usr_def[0]) ? archive_rel_change_usr[0] : archive_rel_change[0]); ext->archive_rel_change[1] = (archive_rel_change_set_class_def[1]) ? archive_rel_change_usr[1] : ((archive_rel_change_set_usr_def[1]) ? archive_rel_change_usr[1] : archive_rel_change[1]); } else { ext->archive_rel_change[0] = archive_rel_change[0]; ext->archive_rel_change[1] = archive_rel_change[1]; } delete_startup_exception("archive_rel_change"); // // Archive absolute change // string archive_abs_change_str(conf.event_prop.arch_event.abs_change); // provided, comma separated min and/or max values for the property string archive_abs_change_usr_str; // user default, comma separated min and/or max values for the property, if defined string archive_abs_change_class_str; // class default, comma separated min and/or max values for the property, if defined vector archive_abs_change; // vector containing min and max values of the property vector archive_abs_change_usr; // vector containing user default min and max values of the property vector archive_abs_change_class; // vector containing class default min and max values of the property bool archive_abs_change_usr_def; // true if there are user defaults defined for the property bool archive_abs_change_class_def; // true if there are class defaults defined for the property vector archive_abs_change_set_usr_def; // vector indicating if to use provided values for the property or the user defaults if defined vector archive_abs_change_set_class_def; // vector indicating if to use provided values for the property or the class defaults if defined archive_abs_change_usr_def = prop_in_list("archive_abs_change",archive_abs_change_usr_str,nb_user,def_user_prop); archive_abs_change_class_def = prop_in_list("archive_abs_change",archive_abs_change_class_str,nb_class,def_class_prop); // // Validate user or classs default properties // if(archive_abs_change_usr_def) validate_change_properties(dev_name,"archive_abs_change",archive_abs_change_usr_str,archive_abs_change_usr); if(abs_change_class_def) validate_change_properties(dev_name,"archive_abs_change",archive_abs_change_class_str,archive_abs_change_class); // // Validate user provided values // validate_change_properties(dev_name,"archive_abs_change",archive_abs_change_str,archive_abs_change,archive_abs_change_set_usr_def,archive_abs_change_set_class_def); // // Set values // if (archive_abs_change_class_def) { if (archive_abs_change_set_class_def[0] == true) ext->archive_abs_change[0] = archive_abs_change_class[0]; else if (archive_abs_change_usr_def) { if (archive_abs_change_set_usr_def[0] == true) ext->archive_abs_change[0] = archive_abs_change_usr[0]; else ext->archive_abs_change[0] = archive_abs_change[0]; } else ext->archive_abs_change[0] = archive_abs_change[0]; if (archive_abs_change_set_class_def[1] == true) ext->archive_abs_change[1] = archive_abs_change_class[1]; else if (archive_abs_change_usr_def) { if (archive_abs_change_set_usr_def[1] == true) ext->archive_abs_change[1] = archive_abs_change_usr[1]; else ext->archive_abs_change[1] = archive_abs_change[1]; } else ext->archive_abs_change[1] = archive_abs_change[1]; } else if(archive_abs_change_usr_def) { ext->archive_abs_change[0] = (archive_abs_change_set_class_def[0]) ? archive_abs_change_usr[0] : ((archive_abs_change_set_usr_def[0]) ? archive_abs_change_usr[0] : archive_abs_change[0]); ext->archive_abs_change[1] = (archive_abs_change_set_class_def[1]) ? archive_abs_change_usr[1] : ((archive_abs_change_set_usr_def[1]) ? archive_abs_change_usr[1] : archive_abs_change[1]); } else { ext->archive_abs_change[0] = archive_abs_change[0]; ext->archive_abs_change[1] = archive_abs_change[1]; } delete_startup_exception("archive_abs_change"); } // // And finally, the last two event periods // // // Event period // TangoSys_MemStream def_event_period; string tmp_event_period; def_event_period << (int)(DEFAULT_EVENT_PERIOD); if(TG_strcasecmp(conf.event_prop.per_event.period,AlrmValueNotSpec) == 0 || TG_strcasecmp(conf.event_prop.per_event.period,def_event_period.str().c_str()) == 0) { // force library defaults (even if user defaults defined) ext->event_period = DEFAULT_EVENT_PERIOD; } else if (TG_strcasecmp(conf.event_prop.per_event.period,NotANumber) == 0) { bool found = prop_in_list("event_period",tmp_event_period,nb_class,def_class_prop); if (found == false) { found = prop_in_list("event_period",tmp_event_period,nb_user,def_user_prop); if (found == false) ext->event_period = DEFAULT_EVENT_PERIOD; else { str.str(""); str.clear(); str << tmp_event_period; double db; if (!(str >> db && str.eof())) throw_err_format("event_period",dev_name,"Attribute::set_properties()"); ext->event_period = (int)db; } } else { str.str(""); str.clear(); str << tmp_event_period; double db; if (!(str >> db && str.eof())) throw_err_format("event_period",dev_name,"Attribute::set_properties()"); ext->event_period = (int)db; } } else if (strlen(conf.event_prop.per_event.period) == 0) { // set user default value if defined, otherwise use the library defaults bool found = prop_in_list("event_period",tmp_event_period,nb_user,def_user_prop); if (found == false) ext->event_period = DEFAULT_EVENT_PERIOD; else { str.str(""); str.clear(); str << tmp_event_period; double db; if (!(str >> db && str.eof())) throw_err_format("event_period",dev_name,"Attribute::set_properties()"); ext->event_period = (int)db; } } else { // set property str.str(""); str.clear(); str << conf.event_prop.per_event.period; double db; if (!(str >> db && str.eof())) throw_err_format("event_period",dev_name,"Attribute::set_properties()"); ext->event_period = (int)db; } delete_startup_exception("event_period"); // // Archive event period // TangoSys_MemStream def_archive_period; def_archive_period << (int)(INT_MAX); string tmp_archive_period; if(TG_strcasecmp(conf.event_prop.arch_event.period,AlrmValueNotSpec) == 0 || TG_strcasecmp(conf.event_prop.arch_event.period,def_archive_period.str().c_str()) == 0) { // force library defaults (even if user defaults defined) ext->archive_period = INT_MAX; } else if (TG_strcasecmp(conf.event_prop.arch_event.period,NotANumber) == 0) { bool found = prop_in_list("archive_period",tmp_archive_period,nb_class,def_class_prop); if (found == false) { found = prop_in_list("archive_period",tmp_archive_period,nb_user,def_user_prop); if (found == false) ext->archive_period = DEFAULT_EVENT_PERIOD; else { str.str(""); str.clear(); str << tmp_archive_period; double db; if (!(str >> db && str.eof())) throw_err_format("archive_period",dev_name,"Attribute::set_properties()"); ext->archive_period = (int)db; } } else { str.str(""); str.clear(); str << tmp_archive_period; double db; if (!(str >> db && str.eof())) throw_err_format("archive_period",dev_name,"Attribute::set_properties()"); ext->archive_period = (int)db; } } else if (strlen(conf.event_prop.arch_event.period) == 0) { // set user default value if defined, otherwise use the library defaults bool found = prop_in_list("archive_period",tmp_archive_period,nb_user,def_user_prop); if (found == false) ext->event_period = DEFAULT_EVENT_PERIOD; else { str.str(""); str.clear(); str << tmp_archive_period; double db; if (!(str >> db && str.eof())) throw_err_format("archive_period",dev_name,"Attribute::set_properties()"); ext->archive_period = (int)db; } } else { // set property str.str(""); str.clear(); str << conf.event_prop.arch_event.period; double db; if (!(str >> db && str.eof())) throw_err_format("archive_period",dev_name,"Attribute::set_properties()"); ext->archive_period = (int)db; } delete_startup_exception("archive_period"); } void Attribute::set_upd_properties(const AttributeConfig_3 &conf) { set_upd_properties(conf,ext->d_name); } void Attribute::set_upd_properties(const AttributeConfig_3 &conf,string &dev_name) { // // Backup current configuration // AttributeConfig_3 old_conf; get_properties_3(old_conf); // // Set flags which disable attribute configuration roll back in case there are // some device startup exceptions // bool is_startup_exception = ext->check_startup_exceptions; if(is_startup_exception == true) ext->startup_exceptions_clear = false; try { // // Set properties locally. In case of exception bring the backed-up values // set_properties(conf,dev_name); // // Check ranges coherence for min and max value // if(check_min_value && check_max_value) { if ((data_type != Tango::DEV_STRING) && (data_type != Tango::DEV_BOOLEAN) && (data_type != Tango::DEV_STATE)) { switch (data_type) { case Tango::DEV_SHORT: if(min_value.sh >= max_value.sh) throw_incoherent_val_err("min_value","max_value",dev_name,"Attribute::set_upd_properties()"); break; case Tango::DEV_LONG: if(min_value.lg >= max_value.lg) throw_incoherent_val_err("min_value","max_value",dev_name,"Attribute::set_upd_properties()"); break; case Tango::DEV_LONG64: if(min_value.lg64 >= max_value.lg64) throw_incoherent_val_err("min_value","max_value",dev_name,"Attribute::set_upd_properties()"); break; case Tango::DEV_DOUBLE: if(min_value.db >= max_value.db) throw_incoherent_val_err("min_value","max_value",dev_name,"Attribute::set_upd_properties()"); break; case Tango::DEV_FLOAT: if(min_value.fl >= max_value.fl) throw_incoherent_val_err("min_value","max_value",dev_name,"Attribute::set_upd_properties()"); break; case Tango::DEV_USHORT: if(min_value.ush >= max_value.ush) throw_incoherent_val_err("min_value","max_value",dev_name,"Attribute::set_upd_properties()"); break; case Tango::DEV_UCHAR: if(min_value.uch >= max_value.uch) throw_incoherent_val_err("min_value","max_value",dev_name,"Attribute::set_upd_properties()"); break; case Tango::DEV_ULONG: if(min_value.ulg >= max_value.ulg) throw_incoherent_val_err("min_value","max_value",dev_name,"Attribute::set_upd_properties()"); break; case Tango::DEV_ULONG64: if(min_value.ulg64 >= max_value.ulg64) throw_incoherent_val_err("min_value","max_value",dev_name,"Attribute::set_upd_properties()"); break; case Tango::DEV_ENCODED: if(min_value.uch >= max_value.uch) throw_incoherent_val_err("min_value","max_value",dev_name,"Attribute::set_upd_properties()"); break; } } else throw_err_data_type("min_value",dev_name,"Attribute::set_upd_properties()"); } // // Check ranges coherence for min and max alarm // if(alarm_conf.test(min_level) && alarm_conf.test(max_level)) { if ((data_type != Tango::DEV_STRING) && (data_type != Tango::DEV_BOOLEAN) && (data_type != Tango::DEV_STATE)) { switch (data_type) { case Tango::DEV_SHORT: if(min_alarm.sh >= max_alarm.sh) throw_incoherent_val_err("min_alarm","max_alarm",dev_name,"Attribute::set_upd_properties()"); break; case Tango::DEV_LONG: if(min_alarm.lg >= max_alarm.lg) throw_incoherent_val_err("min_alarm","max_alarm",dev_name,"Attribute::set_upd_properties()"); break; case Tango::DEV_LONG64: if(min_alarm.lg64 >= max_alarm.lg64) throw_incoherent_val_err("min_alarm","max_alarm",dev_name,"Attribute::set_upd_properties()"); break; case Tango::DEV_DOUBLE: if(min_alarm.db >= max_alarm.db) throw_incoherent_val_err("min_alarm","max_alarm",dev_name,"Attribute::set_upd_properties()"); break; case Tango::DEV_FLOAT: if(min_alarm.fl >= max_alarm.fl) throw_incoherent_val_err("min_alarm","max_alarm",dev_name,"Attribute::set_upd_properties()"); break; case Tango::DEV_USHORT: if(min_alarm.ush >= max_alarm.ush) throw_incoherent_val_err("min_alarm","max_alarm",dev_name,"Attribute::set_upd_properties()"); break; case Tango::DEV_UCHAR: if(min_alarm.uch >= max_alarm.uch) throw_incoherent_val_err("min_alarm","max_alarm",dev_name,"Attribute::set_upd_properties()"); break; case Tango::DEV_ULONG: if(min_alarm.ulg >= max_alarm.ulg) throw_incoherent_val_err("min_alarm","max_alarm",dev_name,"Attribute::set_upd_properties()"); break; case Tango::DEV_ULONG64: if(min_alarm.ulg64 >= max_alarm.ulg64) throw_incoherent_val_err("min_alarm","max_alarm",dev_name,"Attribute::set_upd_properties()"); break; case Tango::DEV_ENCODED: if(min_alarm.uch >= max_alarm.uch) throw_incoherent_val_err("min_alarm","max_alarm",dev_name,"Attribute::set_upd_properties()"); break; } } else throw_err_data_type("min_alarm",dev_name,"Attribute::set_upd_properties()"); } // // Check ranges coherence for min and max warning // if(alarm_conf.test(min_warn) && alarm_conf.test(max_warn)) { if ((data_type != Tango::DEV_STRING) && (data_type != Tango::DEV_BOOLEAN) && (data_type != Tango::DEV_STATE)) { switch (data_type) { case Tango::DEV_SHORT: if(min_warning.sh >= max_warning.sh) throw_incoherent_val_err("min_warning","max_warning",dev_name,"Attribute::set_upd_properties()"); break; case Tango::DEV_LONG: if(min_warning.lg >= max_warning.lg) throw_incoherent_val_err("min_warning","max_warning",dev_name,"Attribute::set_upd_properties()"); break; case Tango::DEV_LONG64: if(min_warning.lg64 >= max_warning.lg64) throw_incoherent_val_err("min_warning","max_warning",dev_name,"Attribute::set_upd_properties()"); break; case Tango::DEV_DOUBLE: if(min_warning.db >= max_warning.db) throw_incoherent_val_err("min_warning","max_warning",dev_name,"Attribute::set_upd_properties()"); break; case Tango::DEV_FLOAT: if(min_warning.fl >= max_warning.fl) throw_incoherent_val_err("min_warning","max_warning",dev_name,"Attribute::set_upd_properties()"); break; case Tango::DEV_USHORT: if(min_warning.ush >= max_warning.ush) throw_incoherent_val_err("min_warning","max_warning",dev_name,"Attribute::set_upd_properties()"); break; case Tango::DEV_UCHAR: if(min_warning.uch >= max_warning.uch) throw_incoherent_val_err("min_warning","max_warning",dev_name,"Attribute::set_upd_properties()"); break; case Tango::DEV_ULONG: if(min_warning.ulg >= max_warning.ulg) throw_incoherent_val_err("min_warning","max_warning",dev_name,"Attribute::set_upd_properties()"); break; case Tango::DEV_ULONG64: if(min_warning.ulg64 >= max_warning.ulg64) throw_incoherent_val_err("min_warning","max_warning",dev_name,"Attribute::set_upd_properties()"); break; case Tango::DEV_ENCODED: if(min_warning.uch >= max_warning.uch) throw_incoherent_val_err("min_warning","max_warning",dev_name,"Attribute::set_upd_properties()"); break; } } else throw_err_data_type("min_warning",dev_name,"Attribute::set_upd_properties()"); } // // At this point the attribute configuration is correct. Clear the device startup exceptions flag // ext->startup_exceptions_clear = true; // // Update database // try { upd_database(conf,dev_name); } catch(DevFailed &) { // // In case of exception, try to store old properties in the database and inform the user about the error // try { upd_database(old_conf,dev_name); } catch(DevFailed &) { // // If the old values could not be restored, notify the user about possible database corruption // TangoSys_OMemStream o; o << "Device " << dev_name << "-> Attribute : " << name; o << "\nDatabase error occurred whilst setting attribute properties. The database may be corrupted." << ends; Except::throw_exception((const char *)API_CorruptedDatabase, o.str(), (const char *)"Attribute::set_upd_properties()"); } throw; } } catch(DevFailed &) { // // If there are any device startup exceptions, do not roll back the attribute configuration unless the new // configuration is correct // if(is_startup_exception == false && ext->startup_exceptions_clear == true) set_properties(old_conf,dev_name); throw; } } void Attribute::set_min_alarm(char *new_min_alarm_str) { set_min_alarm(string(new_min_alarm_str)); } void Attribute::set_min_alarm(const char *new_min_alarm_str) { set_min_alarm(string(new_min_alarm_str)); } void Attribute::set_max_alarm(char *new_max_alarm_str) { set_max_alarm(string(new_max_alarm_str)); } void Attribute::set_max_alarm(const char *new_max_alarm_str) { set_max_alarm(string(new_max_alarm_str)); } void Attribute::set_min_warning(char *new_min_warning_str) { set_min_warning(string(new_min_warning_str)); } void Attribute::set_min_warning(const char *new_min_warning_str) { set_min_warning(string(new_min_warning_str)); } void Attribute::set_max_warning(char *new_max_warning_str) { set_max_warning(string(new_max_warning_str)); } void Attribute::set_max_warning(const char *new_max_warning_str) { set_max_warning(string(new_max_warning_str)); } //-------------------------------------------------------------------------------------------------------------------- // // method : // Attribute::upd_database // // description : // Update the tango database with the new attribute values // // argument: // in : // - conf : // -dev_name : // //-------------------------------------------------------------------------------------------------------------------- void Attribute::upd_database(const Tango::AttributeConfig &conf,string &dev_name) { cout4 << "Entering upd_database method for attribute " << name << endl; // // Build the data sent to database // Tango::DbData db_d; Tango::DbData db_del; db_d.push_back(DbDatum(name)); db_del.push_back(DbDatum(name)); long prop_to_update = 0; long prop_to_delete = 0; // // Get the vector of user default properties to store the library defaults in the database in case there are user // defaults declared for the property // Tango::DeviceClass *dev_class = get_att_device_class(dev_name); Tango::MultiClassAttribute *mca = dev_class->get_class_attr(); Tango::Attr &att = mca->get_attr(name); vector &def_user_prop = att.get_user_default_properties(); vector unused; // // Check if "string" properties must be updated in db and if needed insert a corresponding DbDatum object in the DbData // vector // check_str_prop(conf,db_d,prop_to_update,db_del,prop_to_delete,def_user_prop,unused); // // For the last four, if the data type is not string, checks that the input strings are really number // TangoSys_MemStream str; str.precision(TANGO_FLOAT_PRECISION); CHECK_PROP(conf.min_value,str,dev_name,db_d,db_del, prop_to_update,prop_to_delete,"min_value",def_user_prop,unused); CHECK_PROP(conf.max_value,str,dev_name,db_d,db_del, prop_to_update,prop_to_delete,"max_value",def_user_prop,unused); CHECK_PROP(conf.min_alarm,str,dev_name,db_d,db_del, prop_to_update,prop_to_delete,"min_alarm",def_user_prop,unused); CHECK_PROP(conf.max_alarm,str,dev_name,db_d,db_del, prop_to_update,prop_to_delete,"max_alarm",def_user_prop,unused); // // Update db only if needed // if (prop_to_update != 0) { cout4 << prop_to_update << " properties to update in db" << endl; db_d[0] << prop_to_update; Tango::Util *tg = Tango::Util::instance(); // // Implement a reconnection schema. The first exception received if the db server is down is a COMM_FAILURE exception. // Following exception received from following calls are TRANSIENT exception // bool retry = true; while (retry == true) { try { tg->get_database()->put_device_attribute_property(dev_name,db_d); retry = false; } catch (CORBA::COMM_FAILURE) { tg->get_database()->reconnect(true); } } } if (prop_to_delete != 0) { cout4 << prop_to_delete << " properties to delete in db" << endl; Tango::Util *tg = Tango::Util::instance(); // // Implement a reconnection schema. The first exception received if the db server is down is a COMM_FAILURE exception. // Following exception received from following calls are TRANSIENT exception // bool retry = true; while (retry == true) { try { tg->get_database()->delete_device_attribute_property(dev_name,db_del); retry = false; } catch (CORBA::COMM_FAILURE) { tg->get_database()->reconnect(true); } } } cout4 << "Leaving upd_database method" << endl; } // // TODO: merge under control until this point // void Attribute::upd_database(const Tango::AttributeConfig_3 &conf,string &dev_name) { cout4 << "Entering upd_database method for attribute " << name << endl; // // Build the data sent to database // Tango::DbData db_d; Tango::DbData db_del; db_d.push_back(DbDatum(name)); db_del.push_back(DbDatum(name)); long prop_to_update = 0; long prop_to_delete = 0; // // Get the vector of user default properties to store the library defaults in the database in case there are user // defaults declared for the property // vector fake_attr_prop; Tango::DeviceClass *dev_class = get_att_device_class(dev_name); Tango::Attr *att_ptr; bool state_or_status = false; if (name_lower == "state" || name_lower == "status") state_or_status = true; if (state_or_status == false) { Tango::MultiClassAttribute *mca = dev_class->get_class_attr(); att_ptr = &(mca->get_attr(name)); } vector &def_user_prop = state_or_status == false ? att_ptr->get_user_default_properties() : fake_attr_prop; vector &def_class_prop = state_or_status == false ? att_ptr->get_class_properties() : fake_attr_prop; size_t nb_user = def_user_prop.size(); size_t nb_class = def_class_prop.size(); string usr_def_val; TangoSys_MemStream str; str.precision(TANGO_FLOAT_PRECISION); if (state_or_status == false) { // // Check if "string" properties must be updated in db and if needed insert a corresponding DbDatum object in the DbData // vector // AttributeConfig tmp_conf; tmp_conf.description = conf.description; tmp_conf.label = conf.label; tmp_conf.unit = conf.unit; tmp_conf.standard_unit = conf.standard_unit; tmp_conf.display_unit = conf.display_unit; tmp_conf.format = conf.format; check_str_prop(tmp_conf,db_d,prop_to_update,db_del,prop_to_delete,def_user_prop,def_class_prop); // // For the last two, if the data type is not string, checks that the input strings are really number // CHECK_PROP(conf.min_value,str,dev_name,db_d,db_del, prop_to_update,prop_to_delete,"min_value",def_user_prop,def_class_prop); CHECK_PROP(conf.max_value,str,dev_name,db_d,db_del, prop_to_update,prop_to_delete,"max_value",def_user_prop,def_class_prop); // // Check for alarm related data // CHECK_PROP(conf.att_alarm.min_alarm,str,dev_name,db_d,db_del, prop_to_update,prop_to_delete,"min_alarm",def_user_prop,def_class_prop); CHECK_PROP(conf.att_alarm.max_alarm,str,dev_name,db_d,db_del, prop_to_update,prop_to_delete,"max_alarm",def_user_prop,def_class_prop); CHECK_PROP(conf.att_alarm.min_warning,str,dev_name,db_d,db_del, prop_to_update,prop_to_delete,"min_warning",def_user_prop,def_class_prop); CHECK_PROP(conf.att_alarm.max_warning,str,dev_name,db_d,db_del, prop_to_update,prop_to_delete,"max_warning",def_user_prop,def_class_prop); // // RDS alarm values (delta_val and delta_t) are stored in or deleted from the database only if both are set or both not // specified. // // // delta_val // string delta_val_tmp_str = conf.att_alarm.delta_val.in(); string delta_val_usr_def_val; string delta_val_class_def_val; bool delta_val_is_number = true; bool delta_val_user_defaults; bool delta_val_class_defaults; delta_val_user_defaults = prop_in_list("delta_val",delta_val_usr_def_val,nb_user,def_user_prop); delta_val_class_defaults = prop_in_list("delta_val",delta_val_class_def_val,nb_class,def_class_prop); if (delta_val_class_defaults) { if ((TG_strcasecmp(conf.att_alarm.delta_val,NotANumber) == 0) || (strcmp(conf.att_alarm.delta_val,delta_val_class_def_val.c_str()) == 0)) { delta_val_tmp_str = delta_val_class_def_val; delta_val_is_number = false; } else if (strlen(conf.att_alarm.delta_val) == 0) { if (delta_val_user_defaults) { delta_val_tmp_str = delta_val_usr_def_val; delta_val_is_number = false; } else { delta_val_tmp_str = AlrmValueNotSpec; delta_val_is_number = false; } } else if(TG_strcasecmp(conf.att_alarm.delta_val,AlrmValueNotSpec) == 0) { delta_val_tmp_str = AlrmValueNotSpec; delta_val_is_number = false; } } else if(delta_val_user_defaults) { if ((TG_strcasecmp(conf.att_alarm.delta_val,NotANumber) == 0) || (strcmp(conf.att_alarm.delta_val,delta_val_usr_def_val.c_str()) == 0) || (strlen(conf.att_alarm.delta_val) == 0)) { delta_val_tmp_str = delta_val_usr_def_val; delta_val_is_number = false; } else if(TG_strcasecmp(conf.att_alarm.delta_val,AlrmValueNotSpec) == 0) { delta_val_tmp_str = AlrmValueNotSpec; delta_val_is_number = false; } } else if ((TG_strcasecmp(conf.att_alarm.delta_val,AlrmValueNotSpec) == 0) || (TG_strcasecmp(conf.att_alarm.delta_val,NotANumber) == 0) || (strlen(conf.att_alarm.delta_val) == 0)) { delta_val_tmp_str = AlrmValueNotSpec; delta_val_is_number = false; } if(delta_val_is_number) { if ((data_type != Tango::DEV_STRING) && (data_type != Tango::DEV_BOOLEAN) && (data_type != Tango::DEV_STATE)) { double db; str.str(""); str.clear(); str << conf.att_alarm.delta_val; if (!(str >> db && str.eof())) throw_err_format("delta_val",dev_name,"Attribute::upd_database()"); switch (data_type) { case Tango::DEV_SHORT: str.str(""); str.clear(); str << (DevShort)db; break; case Tango::DEV_LONG: str.str(""); str.clear(); str << (DevLong)db; break; case Tango::DEV_LONG64: str.str(""); str.clear(); str << (DevLong64)db; break; case Tango::DEV_DOUBLE: break; case Tango::DEV_FLOAT: break; case Tango::DEV_USHORT: str.str(""); str.clear(); (db < 0.0) ? str << (DevUShort)(-db) : str << (DevUShort)db; break; case Tango::DEV_UCHAR: str.str(""); str.clear(); (db < 0.0) ? str << (short)((DevUChar)(-db)) : str << (short)((DevUChar)db); break; case Tango::DEV_ULONG: str.str(""); str.clear(); (db < 0.0) ? str << (DevULong)(-db) : str << (DevULong)db; break; case Tango::DEV_ULONG64: str.str(""); str.clear(); (db < 0.0) ? str << (DevULong64)(-db) : str << (DevULong64)db; break; case Tango::DEV_ENCODED: str.str(""); str.clear(); (db < 0.0) ? str << (short)(DevUChar)(-db) : str << (short)(DevUChar)db; break; } if (data_type != Tango::DEV_FLOAT && data_type != Tango::DEV_DOUBLE) delta_val_tmp_str = str.str(); } else throw_err_data_type("delta_val",dev_name,"Attribute::upd_database()"); } // // delta_t // string delta_t_tmp_str = conf.att_alarm.delta_t.in(); string delta_t_usr_def_val; string delta_t_class_def_val; bool delta_t_user_defaults; bool delta_t_class_defaults; bool delta_t_is_number = true; delta_t_user_defaults = prop_in_list("delta_t",delta_t_usr_def_val,nb_user,def_user_prop); delta_t_class_defaults = prop_in_list("delta_t",delta_t_class_def_val,nb_class,def_class_prop); if (delta_t_class_defaults) { if ((TG_strcasecmp(conf.att_alarm.delta_t,NotANumber) == 0) || (strcmp(conf.att_alarm.delta_t,delta_val_class_def_val.c_str()) == 0)) { delta_t_tmp_str = delta_t_class_def_val; delta_t_is_number = false; } else if (strlen(conf.att_alarm.delta_t) == 0) { if (delta_t_user_defaults) { delta_t_tmp_str = delta_t_usr_def_val; delta_t_is_number = false; } else { delta_t_tmp_str = "0"; delta_t_is_number = false; } } else if(TG_strcasecmp(conf.att_alarm.delta_t,AlrmValueNotSpec) == 0) { delta_t_tmp_str = "0"; delta_t_is_number = false; } } else if(delta_t_user_defaults) { if ((TG_strcasecmp(conf.att_alarm.delta_t,NotANumber) == 0) || (strcmp(conf.att_alarm.delta_t,delta_t_usr_def_val.c_str()) == 0) || (strlen(conf.att_alarm.delta_t) == 0)) { delta_t_tmp_str = delta_t_usr_def_val; delta_t_is_number = false; } else if((TG_strcasecmp(conf.att_alarm.delta_t,AlrmValueNotSpec) == 0) || (TG_strcasecmp(conf.att_alarm.delta_t,"0") == 0) || (TG_strcasecmp(conf.att_alarm.delta_t,"0.0") == 0)) { delta_t_tmp_str = "0"; delta_t_is_number = false; } } else if ((TG_strcasecmp(conf.att_alarm.delta_t,AlrmValueNotSpec) == 0) || (TG_strcasecmp(conf.att_alarm.delta_t,"0") == 0) || (TG_strcasecmp(conf.att_alarm.delta_t,"0.0") == 0) || (TG_strcasecmp(conf.att_alarm.delta_t,NotANumber) == 0) || (strlen(conf.att_alarm.delta_t) == 0)) { delta_t_tmp_str = "0"; delta_t_is_number = false; } if(delta_t_is_number) { if ((data_type != Tango::DEV_STRING) && (data_type != Tango::DEV_BOOLEAN) && (data_type != Tango::DEV_STATE)) { str.str(""); str.clear(); str << conf.att_alarm.delta_t; double db; if (!(str >> db && str.eof())) throw_err_format("delta_t",dev_name,"Attribute::upd_database()"); str.str(""); str.clear(); str << (long)db; delta_t_tmp_str = str.str(); } else throw_err_data_type("delta_t",dev_name,"Attribute::upd_database()"); } // // Check if to store both delta_val and delta_t in database, delete or do nothing // bool rds_store_both = false; bool rds_delete_both = false; if(delta_val_class_defaults || delta_t_class_defaults) { if((TG_strcasecmp(delta_val_tmp_str.c_str(),delta_val_class_def_val.c_str()) == 0) && (TG_strcasecmp(delta_t_tmp_str.c_str(),delta_t_class_def_val.c_str()) == 0)) rds_delete_both = true; else if(((TG_strcasecmp(delta_val_tmp_str.c_str(),AlrmValueNotSpec) == 0) && (TG_strcasecmp(delta_t_tmp_str.c_str(),"0") == 0)) || ((TG_strcasecmp(delta_val_tmp_str.c_str(),AlrmValueNotSpec) != 0) && (TG_strcasecmp(delta_t_tmp_str.c_str(),"0") != 0))) rds_store_both = true; } else if(delta_val_user_defaults || delta_t_user_defaults) { if((TG_strcasecmp(delta_val_tmp_str.c_str(),delta_val_usr_def_val.c_str()) == 0) && (TG_strcasecmp(delta_t_tmp_str.c_str(),delta_t_usr_def_val.c_str()) == 0)) rds_delete_both = true; else if(((TG_strcasecmp(delta_val_tmp_str.c_str(),AlrmValueNotSpec) == 0) && (TG_strcasecmp(delta_t_tmp_str.c_str(),"0") == 0)) || ((TG_strcasecmp(delta_val_tmp_str.c_str(),AlrmValueNotSpec) != 0) && (TG_strcasecmp(delta_t_tmp_str.c_str(),"0") != 0))) rds_store_both = true; } else if((TG_strcasecmp(delta_val_tmp_str.c_str(),AlrmValueNotSpec) != 0) && (TG_strcasecmp(delta_t_tmp_str.c_str(),"0") != 0)) rds_store_both = true; else if((TG_strcasecmp(delta_val_tmp_str.c_str(),AlrmValueNotSpec) == 0) && (TG_strcasecmp(delta_t_tmp_str.c_str(),"0") == 0)) rds_delete_both = true; if(rds_store_both) { DbDatum dd("delta_val"); dd << delta_val_tmp_str.c_str(); db_d.push_back(dd); prop_to_update++; DbDatum deltat("delta_t"); deltat << delta_t_tmp_str.c_str(); db_d.push_back(deltat); prop_to_update++; } if(rds_delete_both) { DbDatum del_dd("delta_val"); db_del.push_back(del_dd); prop_to_delete++; DbDatum del_deltat("delta_t"); db_del.push_back(del_deltat); prop_to_delete++; } // // Check for event related data // // // Relative change // string rel_change_str(conf.event_prop.ch_event.rel_change); // provided, comma separated min and/or max values for the property string rel_change_usr_str; // user default, comma separated min and/or max values for the property, if defined string rel_change_class_str; // user default, comma separated min and/or max values for the property, if defined vector rel_change; // vector containing min and max values of the property vector rel_change_usr; // vector containing user default min and max values of the property vector rel_change_class; // vector containing class default min and max values of the property bool rel_change_usr_def; // true if there are user defaults defined for the property bool rel_change_class_def; // true if there are class defaults defined for the property vector rel_change_set_usr_def; // vector indicating if to use provided values for the property or the user defaults if defined vector rel_change_set_class_def; // vector indicating if to use provided values for the property or the class defaults if defined rel_change_usr_def = prop_in_list("rel_change",rel_change_usr_str,nb_user,def_user_prop); rel_change_class_def = prop_in_list("rel_change",rel_change_class_str,nb_class,def_class_prop); // // Validate user or classs default properties // if(rel_change_usr_def) validate_change_properties(dev_name,"rel_change",rel_change_usr_str,rel_change_usr); if(rel_change_class_def) validate_change_properties(dev_name,"rel_change",rel_change_class_str,rel_change_class); // // Validate user provided values // validate_change_properties(dev_name,"rel_change",rel_change_str,rel_change,rel_change_set_usr_def,rel_change_set_class_def); // // Overwrite rel_change values according to user request to return to class/user defaults // if (rel_change_class_def) { if (rel_change_set_class_def[0] == true) rel_change[0] = rel_change_class[0]; else if (rel_change_usr_def) { if (rel_change_set_usr_def[0] == true) rel_change[0] = rel_change_usr[0]; } if (rel_change_set_class_def[1] == true) rel_change[1] = rel_change_class[1]; else if (rel_change_usr_def) { if (rel_change_set_usr_def[1] == true) rel_change[1] = rel_change_usr[1]; } } else if(rel_change_usr_def) { rel_change[0] = (rel_change_set_class_def[0]) ? rel_change_usr[0] : ((rel_change_set_usr_def[0]) ? rel_change_usr[0] : rel_change[0]); rel_change[1] = (rel_change_set_class_def[1]) ? rel_change_usr[1] : ((rel_change_set_usr_def[1]) ? rel_change_usr[1] : rel_change[1]); } rel_change[0] = fabs(rel_change[0]); rel_change[1] = fabs(rel_change[1]); // // Manage db // if (rel_change[0] == rel_change[1]) { if (rel_change[0] == INT_MAX) { if (rel_change_usr_def == true || rel_change_class_def == true) { DbDatum desc("rel_change"); desc << rel_change[0]; db_d.push_back(desc); prop_to_update++; } else { DbDatum del_desc("rel_change"); db_del.push_back(del_desc); prop_to_delete++; } } else if (rel_change_usr_def == true && rel_change[0] == fabs(rel_change_usr[0])) { if (rel_change_class_def == true) { DbDatum desc("rel_change"); desc << rel_change[0]; db_d.push_back(desc); prop_to_update++; } else { DbDatum del_desc("rel_change"); db_del.push_back(del_desc); prop_to_delete++; } } else if (rel_change_class_def == true && rel_change[0] == fabs(rel_change_class[0])) { DbDatum del_desc("rel_change"); db_del.push_back(del_desc); prop_to_delete++; } else { DbDatum desc("rel_change"); desc << rel_change[0]; db_d.push_back(desc); prop_to_update++; } } else { if (rel_change_class_def) { event_prop_db("rel_change",rel_change,rel_change_class,db_del,prop_to_delete,db_d,prop_to_update); } else if(rel_change_usr_def) { event_prop_db("rel_change",rel_change,rel_change_usr,db_del,prop_to_delete,db_d,prop_to_update); } else { DbDatum relchange("rel_change"); relchange << rel_change; db_d.push_back(relchange); prop_to_update++; } } // // Absolute change // string abs_change_str(conf.event_prop.ch_event.abs_change); // provided, comma separated min and/or max values for the property string abs_change_usr_str; // user default, comma separated min and/or max values for the property, if defined string abs_change_class_str; // class default, comma separated min and/or max values for the property, if defined vector abs_change; // vector containing min and max values of the property vector abs_change_usr; // vector containing user default min and max values of the property vector abs_change_class; // vector containing class default min and max values of the property bool abs_change_usr_def; // true if there are user defaults defined for the property bool abs_change_class_def; // true if there are user defaults defined for the property vector abs_change_set_usr_def; // vector indicating if to use provided values for the property or the user defaults if defined vector abs_change_set_class_def; // vector indicating if to use provided values for the property or the class defaults if defined abs_change_usr_def = prop_in_list("abs_change",abs_change_usr_str,nb_user,def_user_prop); abs_change_class_def = prop_in_list("abs_change",abs_change_class_str,nb_class,def_class_prop); // // Validate user or class default properties // if(abs_change_usr_def) validate_change_properties(dev_name,"abs_change",abs_change_usr_str,abs_change_usr); if(abs_change_class_def) validate_change_properties(dev_name,"abs_change",abs_change_class_str,abs_change_class); // // Validate user provided values // validate_change_properties(dev_name,"abs_change",abs_change_str,abs_change,abs_change_set_usr_def,abs_change_set_class_def); // // Overwrite rel_change values according to user request to return to class/user defaults // if (abs_change_class_def) { if (abs_change_set_class_def[0] == true) abs_change[0] = abs_change_class[0]; else if (abs_change_usr_def) { if (abs_change_set_usr_def[0] == true) abs_change[0] = abs_change_usr[0]; } if (abs_change_set_class_def[1] == true) abs_change[1] = abs_change_class[1]; else if (abs_change_usr_def) { if (abs_change_set_usr_def[1] == true) abs_change[1] = abs_change_usr[1]; } } else if(abs_change_usr_def) { abs_change[0] = (abs_change_set_class_def[0]) ? abs_change_usr[0] : ((abs_change_set_usr_def[0]) ? abs_change_usr[0] : abs_change[0]); abs_change[1] = (abs_change_set_class_def[1]) ? abs_change_usr[1] : ((abs_change_set_usr_def[1]) ? abs_change_usr[1] : abs_change[1]); } abs_change[0] = fabs(abs_change[0]); abs_change[1] = fabs(abs_change[1]); // // Manage db // if (abs_change[0] == abs_change[1]) { if (abs_change[0] == INT_MAX) { if (abs_change_usr_def == true || abs_change_class_def == true) { DbDatum desc("abs_change"); desc << abs_change[0]; db_d.push_back(desc); prop_to_update++; } else { DbDatum del_desc("abs_change"); db_del.push_back(del_desc); prop_to_delete++; } } else if (abs_change_usr_def == true && abs_change[0] == fabs(abs_change_usr[0])) { if (abs_change_class_def == true) { DbDatum desc("abs_change"); desc << abs_change[0]; db_d.push_back(desc); prop_to_update++; } else { DbDatum del_desc("abs_change"); db_del.push_back(del_desc); prop_to_delete++; } } else if (abs_change_class_def == true && abs_change[0] == fabs(abs_change_class[0])) { DbDatum del_desc("abs_change"); db_del.push_back(del_desc); prop_to_delete++; } else { DbDatum desc("abs_change"); desc << abs_change[0]; db_d.push_back(desc); prop_to_update++; } } else { if (abs_change_class_def) { event_prop_db("abs_change",abs_change,abs_change_class,db_del,prop_to_delete,db_d,prop_to_update); } else if(abs_change_usr_def) { event_prop_db("abs_change",abs_change,abs_change_usr,db_del,prop_to_delete,db_d,prop_to_update); } else { DbDatum abschange("abs_change"); abschange << abs_change; db_d.push_back(abschange); prop_to_update++; } } // // Archive relative change // string archive_rel_change_str(conf.event_prop.arch_event.rel_change); // provided, comma separated min and/or max values for the property string archive_rel_change_usr_str; // user default, comma separated min and/or max values for the property, if defined string archive_rel_change_class_str; // class default, comma separated min and/or max values for the property, if defined vector archive_rel_change; // vector containing min and max values of the property vector archive_rel_change_usr; // vector containing user default min and max values of the property vector archive_rel_change_class; // vector containing class default min and max values of the property bool archive_rel_change_usr_def; // true if there are user defaults defined for the property bool archive_rel_change_class_def; // true if there are class defaults defined for the property vector archive_rel_change_set_usr_def; // vector indicating if to use provided values for the property or the user defaults if defined vector archive_rel_change_set_class_def; // vector indicating if to use provided values for the property or the class defaults if defined archive_rel_change_usr_def = prop_in_list("archive_rel_change",archive_rel_change_usr_str,nb_user,def_user_prop); archive_rel_change_class_def = prop_in_list("archive_rel_change",archive_rel_change_class_str,nb_class,def_class_prop); // // Validate user or class default properties // if(archive_rel_change_usr_def) validate_change_properties(dev_name,"archive_rel_change",archive_rel_change_usr_str,archive_rel_change_usr); if(archive_rel_change_class_def) validate_change_properties(dev_name,"archive_rel_change",archive_rel_change_class_str,archive_rel_change_class); // // Validate user provided values // validate_change_properties(dev_name,"archive_rel_change",archive_rel_change_str,archive_rel_change,archive_rel_change_set_usr_def,archive_rel_change_set_class_def); // // Overwrite archive_rel_change values according to user request to return to class/user defaults // if (archive_rel_change_class_def) { if (archive_rel_change_set_class_def[0] == true) archive_rel_change[0] = archive_rel_change_class[0]; else if (archive_rel_change_usr_def) { if (archive_rel_change_set_usr_def[0] == true) archive_rel_change[0] = archive_rel_change_usr[0]; } if (archive_rel_change_set_class_def[1] == true) archive_rel_change[1] = archive_rel_change_class[1]; else if (archive_rel_change_usr_def) { if (archive_rel_change_set_usr_def[1] == true) archive_rel_change[1] = archive_rel_change_usr[1]; } } else if(archive_rel_change_usr_def) { archive_rel_change[0] = (archive_rel_change_set_class_def[0]) ? archive_rel_change_usr[0] : ((archive_rel_change_set_usr_def[0]) ? archive_rel_change_usr[0] : archive_rel_change[0]); archive_rel_change[1] = (archive_rel_change_set_class_def[1]) ? archive_rel_change_usr[1] : ((archive_rel_change_set_usr_def[1]) ? archive_rel_change_usr[1] : archive_rel_change[1]); } archive_rel_change[0] = fabs(archive_rel_change[0]); archive_rel_change[1] = fabs(archive_rel_change[1]); // // Manage db // if(archive_rel_change[0] == archive_rel_change[1]) { if (archive_rel_change[0] == INT_MAX) { if (archive_rel_change_usr_def == true || archive_rel_change_class_def == true) { DbDatum desc("archive_rel_change"); desc << archive_rel_change[0]; db_d.push_back(desc); prop_to_update++; } else { DbDatum del_desc("archive_rel_change"); db_del.push_back(del_desc); prop_to_delete++; } } else if (archive_rel_change_usr_def == true && archive_rel_change[0] == fabs(archive_rel_change_usr[0])) { if (archive_rel_change_class_def == true) { DbDatum desc("archive_rel_change"); desc << archive_rel_change[0]; db_d.push_back(desc); prop_to_update++; } else { DbDatum del_desc("archive_rel_change"); db_del.push_back(del_desc); prop_to_delete++; } } else if (archive_rel_change_class_def == true && archive_rel_change[0] == fabs(archive_rel_change_class[0])) { DbDatum del_desc("archive_rel_change"); db_del.push_back(del_desc); prop_to_delete++; } else { DbDatum desc("archive_rel_change"); desc << archive_rel_change[0]; db_d.push_back(desc); prop_to_update++; } } else { if (archive_rel_change_class_def) { event_prop_db("archive_rel_change",archive_rel_change,archive_rel_change_class,db_del,prop_to_delete,db_d,prop_to_update); } else if(archive_rel_change_usr_def) { event_prop_db("archive_rel_change",archive_rel_change,archive_rel_change_usr,db_del,prop_to_delete,db_d,prop_to_update); } else { DbDatum archiverelchange("archive_rel_change"); archiverelchange << archive_rel_change; db_d.push_back(archiverelchange); prop_to_update++; } } // // Archive absolute change // string archive_abs_change_str(conf.event_prop.arch_event.abs_change); // provided, comma separated min and/or max values for the property string archive_abs_change_usr_str; // user default, comma separated min and/or max values for the property, if defined string archive_abs_change_class_str; // class default, comma separated min and/or max values for the property, if defined vector archive_abs_change; // vector containing min and max values of the property vector archive_abs_change_usr; // vector containing user default min and max values of the property vector archive_abs_change_class; // vector containing class default min and max values of the property bool archive_abs_change_usr_def; // true if there are user defaults defined for the property bool archive_abs_change_class_def; // true if there are class defaults defined for the property vector archive_abs_change_set_usr_def; // vector indicating if to use provided values for the property or the user defaults if defined vector archive_abs_change_set_class_def; // vector indicating if to use provided values for the property or the class defaults if defined archive_abs_change_usr_def = prop_in_list("archive_abs_change",archive_abs_change_usr_str,nb_user,def_user_prop); archive_abs_change_class_def = prop_in_list("archive_abs_change",archive_abs_change_class_str,nb_class,def_class_prop); // // Validate user or class default properties // if(archive_abs_change_usr_def) validate_change_properties(dev_name,"archive_abs_change",archive_abs_change_usr_str,archive_abs_change_usr); if(archive_abs_change_class_def) validate_change_properties(dev_name,"archive_abs_change",archive_abs_change_class_str,archive_abs_change_class); // // Validate user provided values // validate_change_properties(dev_name,"archive_abs_change",archive_abs_change_str,archive_abs_change,archive_abs_change_set_usr_def,archive_abs_change_set_class_def); // // Overwrite archive_abs_change values according to user request to return to class/user defaults // if (archive_abs_change_class_def) { if (archive_abs_change_set_class_def[0] == true) archive_abs_change[0] = archive_abs_change_class[0]; else if (archive_abs_change_usr_def) { if (archive_abs_change_set_usr_def[0] == true) archive_abs_change[0] = archive_abs_change_usr[0]; } if (archive_abs_change_set_class_def[1] == true) archive_abs_change[1] = archive_abs_change_class[1]; else if (archive_abs_change_usr_def) { if (archive_abs_change_set_usr_def[1] == true) archive_abs_change[1] = archive_abs_change_usr[1]; } } else if(archive_abs_change_usr_def) { archive_abs_change[0] = (archive_abs_change_set_class_def[0]) ? archive_abs_change_usr[0] : ((archive_abs_change_set_usr_def[0]) ? archive_abs_change_usr[0] : archive_abs_change[0]); archive_abs_change[1] = (archive_abs_change_set_class_def[1]) ? archive_abs_change_usr[1] : ((archive_abs_change_set_usr_def[1]) ? archive_abs_change_usr[1] : archive_abs_change[1]); } archive_abs_change[0] = fabs(archive_abs_change[0]); archive_abs_change[1] = fabs(archive_abs_change[1]); // // Manage db // if(archive_abs_change[0] == archive_abs_change[1]) { if (archive_abs_change[0] == INT_MAX) { if (archive_abs_change_usr_def == true || archive_abs_change_class_def == true) { DbDatum desc("archive_abs_change"); desc << archive_abs_change[0]; db_d.push_back(desc); prop_to_update++; } else { DbDatum del_desc("archive_abs_change"); db_del.push_back(del_desc); prop_to_delete++; } } else if (archive_abs_change_usr_def == true && archive_abs_change[0] == fabs(archive_abs_change_usr[0])) { if (archive_abs_change_class_def == true) { DbDatum desc("archive_abs_change"); desc << archive_abs_change[0]; db_d.push_back(desc); prop_to_update++; } else { DbDatum del_desc("archive_abs_change"); db_del.push_back(del_desc); prop_to_delete++; } } else if (archive_abs_change_class_def == true && archive_abs_change[0] == fabs(archive_abs_change_class[0])) { DbDatum del_desc("archive_abs_change"); db_del.push_back(del_desc); prop_to_delete++; } else { DbDatum desc("archive_abs_change"); desc << archive_abs_change[0]; db_d.push_back(desc); prop_to_update++; } } else { if (archive_abs_change_class_def) { event_prop_db("archive_abs_change",archive_abs_change,archive_abs_change_class,db_del,prop_to_delete,db_d,prop_to_update); } else if(archive_abs_change_usr_def) { event_prop_db("archive_abs_change",archive_abs_change,archive_abs_change_usr,db_del,prop_to_delete,db_d,prop_to_update); } else { DbDatum archiveabschange("archive_abs_change"); archiveabschange << archive_abs_change; db_d.push_back(archiveabschange); prop_to_update++; } } } // // Event period // string class_def_val; TangoSys_MemStream def_event_period_str; string def_event_period; def_event_period_str << (int)(DEFAULT_EVENT_PERIOD); def_event_period_str >> def_event_period; bool user_defaults; bool class_defaults; bool store_in_db = true; user_defaults = prop_in_list("event_period",usr_def_val,nb_user,def_user_prop); class_defaults = prop_in_list("event_period",class_def_val,nb_class,def_class_prop); if (class_defaults) { if((TG_strcasecmp(class_def_val.c_str(),AlrmValueNotSpec) == 0) || (TG_strcasecmp(class_def_val.c_str(),NotANumber) == 0) || (strlen(class_def_val.c_str()) == 0)) { TangoSys_MemStream str; str << (int)(DEFAULT_EVENT_PERIOD); class_def_val = str.str(); } } if (class_defaults) { bool input_equal_def = false; str.str(""); str.clear(); str << conf.event_prop.per_event.period.in(); double db; if (str >> db && str.eof()) { str.str(""); str.clear(); str << class_def_val; int i; str >> i; if((int)db == i) input_equal_def = true; } if ((TG_strcasecmp(conf.event_prop.per_event.period,NotANumber) == 0) || (strcmp(conf.event_prop.per_event.period,class_def_val.c_str()) == 0) || (input_equal_def == true)) store_in_db = false; } else if(user_defaults) { bool input_equal_def = false; str.str(""); str.clear(); str << conf.event_prop.per_event.period.in(); double db; if (str >> db && str.eof()) { str.str(""); str.clear(); str << usr_def_val; int i; str >> i; if((int)db == i) input_equal_def = true; } if ((TG_strcasecmp(conf.event_prop.per_event.period,NotANumber) == 0) || (strcmp(conf.event_prop.per_event.period,usr_def_val.c_str()) == 0) || (strlen(conf.event_prop.per_event.period) == 0) || (input_equal_def == true)) store_in_db = false; } else { bool input_equal_def = false; str.str(""); str.clear(); str << conf.event_prop.per_event.period.in(); double db; if (str >> db && str.eof()) { if((int)db == (int)(DEFAULT_EVENT_PERIOD)) input_equal_def = true; } if ((TG_strcasecmp(conf.event_prop.per_event.period,AlrmValueNotSpec) == 0) || (TG_strcasecmp(conf.event_prop.per_event.period,def_event_period.c_str()) == 0) || (TG_strcasecmp(conf.event_prop.per_event.period,NotANumber) == 0) || (strlen(conf.event_prop.per_event.period) == 0) || (input_equal_def == true)) store_in_db = false; } if(store_in_db) { string tmp = conf.event_prop.per_event.period.in(); if (TG_strcasecmp(conf.event_prop.per_event.period,AlrmValueNotSpec) == 0) { tmp = def_event_period; } else if (strlen(conf.event_prop.per_event.period) == 0) { if (class_defaults && user_defaults) tmp = usr_def_val; else tmp = def_event_period; } else { str.str(""); str.clear(); str << conf.event_prop.per_event.period.in(); double db; if (!(str >> db && str.eof())) throw_err_format("event_period",dev_name,"Attribute::upd_database"); str.str(""); str.clear(); str << (int)db; tmp = str.str(); } DbDatum eventperiod("event_period"); eventperiod << tmp.c_str(); db_d.push_back(eventperiod); prop_to_update++; } else { DbDatum del_eventperiod("event_period"); db_del.push_back(del_eventperiod); prop_to_delete++; } // // Archive event period // TangoSys_MemStream def_arch_event_period_str; string def_arch_event_period; def_arch_event_period_str << (int)(INT_MAX); def_arch_event_period_str >> def_arch_event_period; store_in_db = true; user_defaults = prop_in_list("archive_period",usr_def_val,nb_user,def_user_prop); class_defaults = prop_in_list("archive_period",class_def_val,nb_class,def_class_prop); if (class_defaults) { if((TG_strcasecmp(class_def_val.c_str(),AlrmValueNotSpec) == 0) || (TG_strcasecmp(class_def_val.c_str(),NotANumber) == 0) || (strlen(class_def_val.c_str()) == 0)) { TangoSys_MemStream str; str << (int)(INT_MAX); class_def_val = str.str(); } } if (class_defaults) { bool input_equal_def = false; str.str(""); str.clear(); str << conf.event_prop.arch_event.period.in(); double db; if (str >> db && str.eof()) { str.str(""); str.clear(); str << class_def_val; int i; str >> i; if((int)db == i) input_equal_def = true; } if ((TG_strcasecmp(conf.event_prop.arch_event.period,NotANumber) == 0) || (strcmp(conf.event_prop.arch_event.period,class_def_val.c_str()) == 0) || (input_equal_def == true)) store_in_db = false; } else if(user_defaults) { bool input_equal_def = false; str.str(""); str.clear(); str << conf.event_prop.arch_event.period.in(); double db; if (str >> db && str.eof()) { str.str(""); str.clear(); str << usr_def_val; int i; str >> i; if((int)db == i) input_equal_def = true; } if ((TG_strcasecmp(conf.event_prop.arch_event.period,NotANumber) == 0) || (strcmp(conf.event_prop.arch_event.period,usr_def_val.c_str()) == 0) || (strlen(conf.event_prop.arch_event.period) == 0) || (input_equal_def == true)) store_in_db = false; } else { bool input_equal_def = false; str.str(""); str.clear(); str << conf.event_prop.arch_event.period.in(); double db; if (str >> db && str.eof()) { if((int)db == (int)(INT_MAX)) input_equal_def = true; } if ((TG_strcasecmp(conf.event_prop.arch_event.period,AlrmValueNotSpec) == 0) || (TG_strcasecmp(conf.event_prop.arch_event.period,def_arch_event_period.c_str()) == 0) || (TG_strcasecmp(conf.event_prop.arch_event.period,NotANumber) == 0) || (strlen(conf.event_prop.arch_event.period) == 0) || (input_equal_def == true)) store_in_db = false; } if(store_in_db) { string tmp = conf.event_prop.arch_event.period.in(); if (TG_strcasecmp(conf.event_prop.arch_event.period,AlrmValueNotSpec) == 0) { tmp = def_arch_event_period; } else if (strlen(conf.event_prop.arch_event.period) == 0) { if (class_defaults && user_defaults) tmp = usr_def_val; else tmp = def_arch_event_period; } else { str.str(""); str.clear(); str << conf.event_prop.arch_event.period; double db; if (!(str >> db && str.eof())) throw_err_format("archive_period",dev_name,"Attribute::upd_database()"); str.str(""); str.clear(); str << (int)db; tmp = str.str(); } DbDatum archeventperiod("archive_period"); archeventperiod << tmp.c_str(); db_d.push_back(archeventperiod); prop_to_update++; } else { DbDatum del_archeventperiod("archive_period"); db_del.push_back(del_archeventperiod); prop_to_delete++; } // // Update db only if needed // if (prop_to_update != 0) { cout4 << prop_to_update << " properties to update in db" << endl; db_d[0] << prop_to_update; Tango::Util *tg = Tango::Util::instance(); // // Implement a reconnection schema. The first exception received if the db server is down is a COMM_FAILURE exception. // Following exception received from following calls are TRANSIENT exception // bool retry = true; while (retry == true) { try { tg->get_database()->put_device_attribute_property(dev_name,db_d); retry = false; } catch (CORBA::COMM_FAILURE) { tg->get_database()->reconnect(true); } } } if (prop_to_delete != 0) { cout4 << prop_to_delete << " properties to delete in db" << endl; db_del[0] << prop_to_delete; Tango::Util *tg = Tango::Util::instance(); // // Implement a reconnection schema. The first exception received if the db server is down is a COMM_FAILURE exception. // Following exception received from following calls are TRANSIENT exception // bool retry = true; while (retry == true) { try { tg->get_database()->delete_device_attribute_property(dev_name,db_del); retry = false; } catch (CORBA::COMM_FAILURE) { tg->get_database()->reconnect(true); } } } cout4 << "Leaving upd_database method" << endl; } //--------------------------------------------------------------------------------------------------------------------- // // method : // Attribute::check_str_prop // // description : // Check if attribute properties which are real string needs to be updated in db // // argument : // in : // - conf : The attribute configuration structure // - db_d : The DbData which will be used to update database // - prop_to_update : The number of property(ies) to update in database // - db_del : The DbData which will be used to delete database // - prop_to_delete : The number of property(ies) to delete from database // - def_user_prop : // - def_class_prop : // //-------------------------------------------------------------------------------------------------------------------- void Attribute::check_str_prop(const Tango::AttributeConfig &conf, Tango::DbData &db_d,long &prop_to_update, Tango::DbData &db_del,long &prop_to_delete, vector &def_user_prop, vector &def_class_prop) { // // Check if the value of attribute property is to be stored in the database. There are 5 value alternatives // distinguished: value (Val), empty string (""), NotANumber (NaN), AlrmValueNotSpec (AVNS) and default library // value (Def). There are also 2 use cases, for which the above value alternatives imply different behaviour: // 1) No user default values defined // "", NaN, Def and AVNS - delete database entry for the property // Val - store value in database // 2) User defaul values defined // "", NaN - delete database entry for the property // AVNS, Def - store library default value (Def) in the database // value - store value in the database // bool user_defaults, class_defaults; string usr_def_val, class_def_val; size_t nb_user = def_user_prop.size(); size_t nb_class = def_class_prop.size(); // // Description // user_defaults = prop_in_list("description",usr_def_val,nb_user,def_user_prop); class_defaults = prop_in_list("description",class_def_val,nb_class,def_class_prop); if (TG_strcasecmp(conf.description,AlrmValueNotSpec) == 0) { if (user_defaults == true || class_defaults == true) { DbDatum desc("description"); desc << DescNotSpec; db_d.push_back(desc); prop_to_update++; } else { DbDatum del_desc("description"); db_del.push_back(del_desc); prop_to_delete++; } } else if (strlen(conf.description) == 0) { if (class_defaults == true) { DbDatum desc("description"); if (user_defaults) desc << usr_def_val.c_str(); else desc << DescNotSpec; db_d.push_back(desc); prop_to_update++; } else { DbDatum del_desc("description"); db_del.push_back(del_desc); prop_to_delete++; } } else if (TG_strcasecmp(conf.description,NotANumber) == 0) { DbDatum del_desc("description"); db_del.push_back(del_desc); prop_to_delete++; } else if (user_defaults == true && strcmp(conf.description,usr_def_val.c_str()) == 0) { if (class_defaults == true) { DbDatum desc("description"); desc << usr_def_val.c_str(); db_d.push_back(desc); prop_to_update++; } else { DbDatum del_desc("description"); db_del.push_back(del_desc); prop_to_delete++; } } else if (class_defaults == true && strcmp(conf.description,class_def_val.c_str()) == 0) { DbDatum del_desc("description"); db_del.push_back(del_desc); prop_to_delete++; } else if (class_defaults == false && TG_strcasecmp(conf.description,DescNotSpec) == 0) { DbDatum del_desc("description"); db_del.push_back(del_desc); prop_to_delete++; } else { DbDatum desc("description"); const char *tmp = conf.description.in(); desc << tmp; db_d.push_back(desc); prop_to_update++; } // // Label // user_defaults = prop_in_list("label",usr_def_val,nb_user,def_user_prop); class_defaults = prop_in_list("label",class_def_val,nb_class,def_class_prop); if (TG_strcasecmp(conf.label,AlrmValueNotSpec) == 0) { if (user_defaults == true || class_defaults == true) { DbDatum desc("label"); desc << LabelNotSpec; db_d.push_back(desc); prop_to_update++; } else { DbDatum del_desc("label"); db_del.push_back(del_desc); prop_to_delete++; } } else if (strlen(conf.label) == 0) { if (class_defaults == true) { DbDatum desc("label"); if (user_defaults) desc << usr_def_val.c_str(); else desc << LabelNotSpec; db_d.push_back(desc); prop_to_update++; } else { DbDatum del_desc("label"); db_del.push_back(del_desc); prop_to_delete++; } } else if (TG_strcasecmp(conf.label,NotANumber) == 0) { DbDatum del_desc("label"); db_del.push_back(del_desc); prop_to_delete++; } else if (user_defaults == true && strcmp(conf.label,usr_def_val.c_str()) == 0) { if (class_defaults == true) { DbDatum desc("label"); desc << usr_def_val.c_str(); db_d.push_back(desc); prop_to_update++; } else { DbDatum del_desc("label"); db_del.push_back(del_desc); prop_to_delete++; } } else if (class_defaults == true && strcmp(conf.label,class_def_val.c_str()) == 0) { DbDatum del_desc("label"); db_del.push_back(del_desc); prop_to_delete++; } else if (class_defaults == false && TG_strcasecmp(conf.label,name.c_str()) == 0) { DbDatum del_desc("label"); db_del.push_back(del_desc); prop_to_delete++; } else { DbDatum desc("label"); const char *tmp = conf.label.in(); desc << tmp; db_d.push_back(desc); prop_to_update++; } // // Unit // user_defaults = prop_in_list("unit",usr_def_val,nb_user,def_user_prop); class_defaults = prop_in_list("unit",class_def_val,nb_class,def_class_prop); if (TG_strcasecmp(conf.unit,AlrmValueNotSpec) == 0) { if (user_defaults == true || class_defaults == true) { DbDatum desc("unit"); desc << UnitNotSpec; db_d.push_back(desc); prop_to_update++; } else { DbDatum del_desc("unit"); db_del.push_back(del_desc); prop_to_delete++; } } else if (strlen(conf.unit) == 0) { if (class_defaults == true) { DbDatum desc("unit"); if (user_defaults) desc << usr_def_val.c_str(); else desc << UnitNotSpec; db_d.push_back(desc); prop_to_update++; } else { DbDatum del_desc("unit"); db_del.push_back(del_desc); prop_to_delete++; } } else if (TG_strcasecmp(conf.unit,NotANumber) == 0) { DbDatum del_desc("unit"); db_del.push_back(del_desc); prop_to_delete++; } else if (user_defaults == true && strcmp(conf.unit,usr_def_val.c_str()) == 0) { if (class_defaults == true) { DbDatum desc("unit"); desc << usr_def_val.c_str(); db_d.push_back(desc); prop_to_update++; } else { DbDatum del_desc("unit"); db_del.push_back(del_desc); prop_to_delete++; } } else if (class_defaults == true && strcmp(conf.unit,class_def_val.c_str()) == 0) { DbDatum del_desc("unit"); db_del.push_back(del_desc); prop_to_delete++; } else if (class_defaults == false && TG_strcasecmp(conf.unit,UnitNotSpec) == 0) { DbDatum del_desc("unit"); db_del.push_back(del_desc); prop_to_delete++; } else { DbDatum desc("unit"); const char *tmp = conf.unit.in(); desc << tmp; db_d.push_back(desc); prop_to_update++; } // // Standard unit // user_defaults = prop_in_list("standard_unit",usr_def_val,nb_user,def_user_prop); class_defaults = prop_in_list("standard_unit",class_def_val,nb_class,def_class_prop); if (TG_strcasecmp(conf.standard_unit,AlrmValueNotSpec) == 0) { if (user_defaults == true || class_defaults == true) { DbDatum desc("standard_unit"); desc << StdUnitNotSpec; db_d.push_back(desc); prop_to_update++; } else { DbDatum del_desc("standard_unit"); db_del.push_back(del_desc); prop_to_delete++; } } else if (strlen(conf.standard_unit) == 0) { if (class_defaults == true) { DbDatum desc("standard_unit"); if (user_defaults) desc << usr_def_val.c_str(); else desc << StdUnitNotSpec; db_d.push_back(desc); prop_to_update++; } else { DbDatum del_desc("standard_unit"); db_del.push_back(del_desc); prop_to_delete++; } } else if (TG_strcasecmp(conf.standard_unit,NotANumber) == 0) { DbDatum del_desc("standard_unit"); db_del.push_back(del_desc); prop_to_delete++; } else if (user_defaults == true && strcmp(conf.standard_unit,usr_def_val.c_str()) == 0) { if (class_defaults == true) { DbDatum desc("standard_unit"); desc << usr_def_val.c_str(); db_d.push_back(desc); prop_to_update++; } else { DbDatum del_desc("standard_unit"); db_del.push_back(del_desc); prop_to_delete++; } } else if (class_defaults == true && strcmp(conf.standard_unit,class_def_val.c_str()) == 0) { DbDatum del_desc("standard_unit"); db_del.push_back(del_desc); prop_to_delete++; } else if (class_defaults == false && TG_strcasecmp(conf.standard_unit,StdUnitNotSpec) == 0) { DbDatum del_desc("standard_unit"); db_del.push_back(del_desc); prop_to_delete++; } else { DbDatum desc("standard_unit"); const char *tmp = conf.standard_unit.in(); desc << tmp; db_d.push_back(desc); prop_to_update++; } // // Display unit // user_defaults = prop_in_list("display_unit",usr_def_val,nb_user,def_user_prop); class_defaults = prop_in_list("display_unit",class_def_val,nb_class,def_class_prop); if (TG_strcasecmp(conf.display_unit,AlrmValueNotSpec) == 0) { if (user_defaults == true || class_defaults == true) { DbDatum desc("display_unit"); desc << DispUnitNotSpec; db_d.push_back(desc); prop_to_update++; } else { DbDatum del_desc("display_unit"); db_del.push_back(del_desc); prop_to_delete++; } } else if (strlen(conf.display_unit) == 0) { if (class_defaults == true) { DbDatum desc("display_unit"); if (user_defaults) desc << usr_def_val.c_str(); else desc << DispUnitNotSpec; db_d.push_back(desc); prop_to_update++; } else { DbDatum del_desc("display_unit"); db_del.push_back(del_desc); prop_to_delete++; } } else if (TG_strcasecmp(conf.display_unit,NotANumber) == 0) { DbDatum del_desc("display_unit"); db_del.push_back(del_desc); prop_to_delete++; } else if (user_defaults == true && strcmp(conf.display_unit,usr_def_val.c_str()) == 0) { if (class_defaults == true) { DbDatum desc("display_unit"); desc << usr_def_val.c_str(); db_d.push_back(desc); prop_to_update++; } else { DbDatum del_desc("display_unit"); db_del.push_back(del_desc); prop_to_delete++; } } else if (class_defaults == true && strcmp(conf.display_unit,class_def_val.c_str()) == 0) { DbDatum del_desc("display_unit"); db_del.push_back(del_desc); prop_to_delete++; } else if (class_defaults == false && TG_strcasecmp(conf.display_unit,DispUnitNotSpec) == 0) { DbDatum del_desc("display_unit"); db_del.push_back(del_desc); prop_to_delete++; } else { DbDatum desc("display_unit"); const char *tmp = conf.display_unit.in(); desc << tmp; db_d.push_back(desc); prop_to_update++; } // // Format // user_defaults = prop_in_list("format",usr_def_val,nb_user,def_user_prop); class_defaults = prop_in_list("format",class_def_val,nb_class,def_class_prop); if (TG_strcasecmp(conf.format,AlrmValueNotSpec) == 0) { if (user_defaults == true || class_defaults == true) { DbDatum desc("format"); def_format_in_dbdatum(desc); db_d.push_back(desc); prop_to_update++; } else { DbDatum del_desc("format"); db_del.push_back(del_desc); prop_to_delete++; } } else if (strlen(conf.format) == 0) { if (class_defaults == true) { DbDatum desc("format"); if (user_defaults) desc << usr_def_val.c_str(); else def_format_in_dbdatum(desc); db_d.push_back(desc); prop_to_update++; } else { DbDatum del_desc("format"); db_del.push_back(del_desc); prop_to_delete++; } } else if (TG_strcasecmp(conf.format,NotANumber) == 0) { DbDatum del_desc("format"); db_del.push_back(del_desc); prop_to_delete++; } else if (user_defaults == true && strcmp(conf.format,usr_def_val.c_str()) == 0) { if (class_defaults == true) { DbDatum desc("format"); desc << usr_def_val.c_str(); db_d.push_back(desc); prop_to_update++; } else { DbDatum del_desc("format"); db_del.push_back(del_desc); prop_to_delete++; } } else if (class_defaults == true && strcmp(conf.format,class_def_val.c_str()) == 0) { DbDatum del_desc("format"); db_del.push_back(del_desc); prop_to_delete++; } else if (class_defaults == false && is_format_notspec(conf.format) == true) { DbDatum del_desc("format"); db_del.push_back(del_desc); prop_to_delete++; } else { DbDatum desc("format"); const char *tmp = conf.format.in(); desc << tmp; db_d.push_back(desc); prop_to_update++; } } //--------------------------------------------------------------------------------------------------------------------- // // method : // Attribute::validate_change_properties // // description : // Check if attribute change properties are properly defined // // argument : // in : // - dev_name : The name of the device // - prop_name : The name of the property // - change_prop_str : A string representing the change property (in the form of either "value" or // "value1,value2") // out : // - validated_prop : A vector of parsed change properties values in the form of numbers of type double // //--------------------------------------------------------------------------------------------------------------------- void Attribute::validate_change_properties(const string &dev_name, const char *prop_name, string &change_prop_str, vector &validated_prop) { vector bring_usr_def; vector bring_class_def; validate_change_properties(dev_name, prop_name, change_prop_str, validated_prop, bring_usr_def,bring_class_def); } //-------------------------------------------------------------------------------------------------------------------- // // method : // Attribute::validate_change_properties // // description : // Check if attribute change properties are properly defined // // argument : // in : // - dev_name : The name of the device // - prop_name : The name of the property // - change_prop_str : A string representing the change property // (in the form of either "value" or "value1,value2") // out : // - validated_prop : A vector of parsed change properties values in the form of numbers of type double // - bring_usr_def : A vector of boolean values indicating if for a corresponding value in validated_prop // vector there was a request to restore the user defined value // - bring_class_def : A vector of boolean values indicating if for a corresponding value in // validated_prop vector there was a request to restore the class defined value // //-------------------------------------------------------------------------------------------------------------------- void Attribute::validate_change_properties(const string &dev_name, const char *prop_name, string &change_prop_str, vector &validated_prop, vector &bring_usr_def,vector &bring_class_def) { // by default, values for event change properties are set to INT_MAX validated_prop.clear(); validated_prop.push_back(INT_MAX); validated_prop.push_back(INT_MAX); // by default, bring user and class defined properties flags are set to false bring_usr_def.clear(); bring_usr_def.push_back(false); bring_usr_def.push_back(false); bring_class_def.clear(); bring_class_def.push_back(false); bring_class_def.push_back(false); TangoSys_MemStream str; str.precision(TANGO_FLOAT_PRECISION); string prop_min; string prop_max; bool one_param = true; double prop_tmp; size_t pos = change_prop_str.find(','); if(pos != string::npos) { prop_min = change_prop_str.substr(0,pos); prop_max = change_prop_str.erase(0,pos+1); one_param = false; } else prop_min = change_prop_str; if(TG_strcasecmp(prop_min.c_str(),AlrmValueNotSpec) == 0) { validated_prop[0] = INT_MAX; validated_prop[1] = INT_MAX; } else if(TG_strcasecmp(prop_min.c_str(),NotANumber) == 0) { bring_class_def[0] = true; bring_class_def[1] = true; bring_usr_def[0] = true; bring_usr_def[1] = true; } else if(prop_min == "") { bring_usr_def[0] = true; bring_usr_def[1] = true; } else { str << prop_min; if(str >> prop_tmp && str.eof()) { if (fabs(prop_tmp) > 0 && prop_tmp != INT_MAX) { if ((data_type != Tango::DEV_STRING) && (data_type != Tango::DEV_BOOLEAN) && (data_type != Tango::DEV_STATE)) { validated_prop[0] = -fabs(prop_tmp); validated_prop[1] = fabs(prop_tmp); } else throw_err_data_type(prop_name,const_cast(dev_name),"Attribute::validate_change_properties()"); } } else throw_err_format(prop_name,dev_name,"Attribute::validate_change_properties()"); } if(!one_param) { validated_prop[1] = INT_MAX; bring_usr_def[1] = false; bring_class_def[1] = false; if(TG_strcasecmp(prop_max.c_str(),AlrmValueNotSpec) == 0) validated_prop[1] = INT_MAX; else if(TG_strcasecmp(prop_max.c_str(),NotANumber) == 0) bring_class_def[1] = true; else if(prop_max == "") bring_usr_def[1] = true; else { str.str(""); str.clear(); str << prop_max; if(str >> prop_tmp && str.eof()) { if (fabs(prop_tmp) > 0 && prop_tmp != INT_MAX) { if ((data_type != Tango::DEV_STRING) && (data_type != Tango::DEV_BOOLEAN) && (data_type != Tango::DEV_STATE)) { validated_prop[1] = fabs(prop_tmp); } else throw_err_data_type(prop_name,const_cast(dev_name),"Attribute::validate_change_properties()"); } } else throw_err_format(prop_name,dev_name,"Attribute::validate_change_properties()"); } } } //--------------------------------------------------------------------------------------------------------------------- // // method : // Attribute::event_prop_db // // description : // // argument : // in : // - prop_name : // - rel_change : // - rel_change_usr : // - db_del : // - prop_to_delete : // - db_d : // - prop_to_update : // //-------------------------------------------------------------------------- void Attribute::event_prop_db(const char *prop_name,vector &rel_change,vector &rel_change_usr, DbData &db_del,long &prop_to_delete,DbData &db_d,long &prop_to_update) { vector rel_change_str_tmp(2); vector rel_change_usr_def_tmp(2); rel_change_usr_def_tmp[0] = rel_change_usr_def_tmp[1] = false; if(rel_change[0] == fabs(rel_change_usr[0])) { rel_change_str_tmp[0] = NotANumber; rel_change_usr_def_tmp[0] = true; } if(rel_change[1] == fabs(rel_change_usr[1])) { rel_change_str_tmp[1] = NotANumber; rel_change_usr_def_tmp[1] = true; } if(rel_change_usr_def_tmp[0] && rel_change_usr_def_tmp[1]) { DbDatum del_relchange(prop_name); db_del.push_back(del_relchange); prop_to_delete++; } else if(!rel_change_usr_def_tmp[0] && !rel_change_usr_def_tmp[1]) { DbDatum relchange(prop_name); relchange << rel_change; db_d.push_back(relchange); prop_to_update++; } else { TangoSys_MemStream str; str.precision(TANGO_FLOAT_PRECISION); if(rel_change_usr_def_tmp[0] && !rel_change_usr_def_tmp[1]) { str << rel_change[1]; rel_change_str_tmp[1] = str.str(); } else { str << rel_change[0]; rel_change_str_tmp[0] = str.str(); } DbDatum relchange(prop_name); relchange << rel_change_str_tmp; db_d.push_back(relchange); prop_to_update++; } } //-------------------------------------------------------------------------------------------------------------------- // // method : // Attribute::set_value // // description : // Set the attribute read value and quality. This method automatically set the date when it has been called // This method is overloaded several times for all the supported attribute data type // // argument : // in : // - p_data : The attribute read value // - x : The attribute x dimension (default is 1) // - y : The atttribute y dimension (default is 0) // - release : A flag set to true if memory must be de-allocated (default is false) // //-------------------------------------------------------------------------------------------------------------------- void Attribute::set_value(Tango::DevShort *p_data,long x,long y,bool release) { // // Throw exception if pointer is null // CHECK_PTR(p_data,name); // // Throw exception if type is not correct // if (data_type != Tango::DEV_SHORT) { if (release == true) delete p_data; TangoSys_OMemStream o; o << "Invalid data type for attribute " << name << ends; Except::throw_exception((const char *)API_AttrOptProp, o.str(), (const char *)"Attribute::set_value()"); } // // Check that data size is less than the given max // if ((x > max_x) || (y > max_y)) { if (release == true) delete p_data; TangoSys_OMemStream o; o << "Data size for attribute " << name << " exceeds given limit" << ends; Except::throw_exception((const char *)API_AttrOptProp, o.str(), (const char *)"Attribute::set_value()"); } // // Compute data size and set default quality to valid. // dim_x = x; dim_y = y; set_data_size(); quality = Tango::ATTR_VALID; // // If the data is wanted from the DevState command, store it in a sequence. If the attribute has an associated // writable attribute, store data in a temporary buffer (the write value must be added before the data is sent // back to the caller) // if (date == false) { value.sh_seq = new Tango::DevVarShortArray(data_size,data_size,p_data,release); } else { if ((is_writ_associated() == true)) { if (data_format == Tango::SCALAR) { tmp_sh[0] = *p_data; if (release == true) delete p_data; } else { value.sh_seq = new Tango::DevVarShortArray(data_size); value.sh_seq->length(data_size); for (int k = 0;k < data_size;k++) (*value.sh_seq)[k] = p_data[k]; if (release == true) delete [] p_data; } } else { if ((data_format == Tango::SCALAR) && (release == true)) { Tango::DevShort *tmp_ptr = new Tango::DevShort[1]; *tmp_ptr = *p_data; value.sh_seq = new Tango::DevVarShortArray(data_size,data_size,tmp_ptr,release); delete p_data; } else value.sh_seq = new Tango::DevVarShortArray(data_size,data_size,p_data,release); } } value_flag = true; // // Reset alarm flags // alarm.reset(); // // Get time // set_time(); } void Attribute::set_value(Tango::DevLong *p_data,long x,long y,bool release) { // // Throw exception if pointer is null // CHECK_PTR(p_data,name); // // Throw exception if type is not correct // if (data_type != Tango::DEV_LONG) { if (release == true) delete p_data; TangoSys_OMemStream o; o << "Invalid data type for attribute " << name << ends; Except::throw_exception((const char *)API_AttrOptProp, o.str(), (const char *)"Attribute::set_value()"); } // // Check that data size is less than the given max // if ((x > max_x) || (y > max_y)) { if (release == true) delete p_data; TangoSys_OMemStream o; o << "Data size for attribute " << name << " exceeds given limit" << ends; Except::throw_exception((const char *)API_AttrOptProp,o.str(), (const char *)"Attribute::set_value()"); } // // Compute data size and set default quality to valid. // dim_x = x; dim_y = y; set_data_size(); quality = Tango::ATTR_VALID; // // If the data is wanted from the DevState command, store it in a sequence. If the attribute has an associated // writable attribute, store data in a temporary buffer (the write value must be added before the data is sent // back to the caller) // if (date == false) { value.lg_seq = new Tango::DevVarLongArray(data_size,data_size,p_data,release); } else { if ((is_writ_associated() == true)) { if (data_format == Tango::SCALAR) { tmp_lo[0] = *p_data; if (release == true) delete p_data; } else { value.lg_seq = new Tango::DevVarLongArray(data_size); value.lg_seq->length(data_size); for (int k = 0;k < data_size;k++) (*value.lg_seq)[k] = p_data[k]; if (release == true) delete [] p_data; } } else { if ((data_format == Tango::SCALAR) && (release == true)) { Tango::DevLong *tmp_ptr = new Tango::DevLong[1]; *tmp_ptr = *p_data; value.lg_seq = new Tango::DevVarLongArray(data_size,data_size,tmp_ptr,release); delete p_data; } else value.lg_seq = new Tango::DevVarLongArray(data_size,data_size,p_data,release); } } value_flag = true; // // Reset alarm flags // alarm.reset(); // // Get time // set_time(); } void Attribute::set_value(Tango::DevLong64 *p_data,long x,long y,bool release) { // // Throw exception if pointer is null // CHECK_PTR(p_data,name); // // Throw exception if type is not correct // if (data_type != Tango::DEV_LONG64) { if (release == true) delete p_data; TangoSys_OMemStream o; o << "Invalid data type for attribute " << name << ends; Except::throw_exception((const char *)API_AttrOptProp, o.str(), (const char *)"Attribute::set_value()"); } // // Check that data size is less than the given max // if ((x > max_x) || (y > max_y)) { if (release == true) delete p_data; TangoSys_OMemStream o; o << "Data size for attribute " << name << " exceeds given limit" << ends; Except::throw_exception((const char *)API_AttrOptProp,o.str(), (const char *)"Attribute::set_value()"); } // // Compute data size and set default quality to valid. // dim_x = x; dim_y = y; set_data_size(); quality = Tango::ATTR_VALID; // // If the data is wanted from the DevState command, store it in a sequence. If the attribute has an associated // writable attribute, store data in a temporary buffer (the write value must be added before the data is sent // back to the caller) // if (date == false) { value.lg64_seq = new Tango::DevVarLong64Array(data_size,data_size,p_data,release); } else { if ((is_writ_associated() == true)) { if (data_format == Tango::SCALAR) { ext->tmp_lo64[0] = *p_data; if (release == true) delete p_data; } else { value.lg64_seq = new Tango::DevVarLong64Array(data_size); value.lg64_seq->length(data_size); for (int k = 0;k < data_size;k++) (*value.lg64_seq)[k] = p_data[k]; if (release == true) delete [] p_data; } } else { if ((data_format == Tango::SCALAR) && (release == true)) { Tango::DevLong64 *tmp_ptr = new Tango::DevLong64[1]; *tmp_ptr = *p_data; value.lg64_seq = new Tango::DevVarLong64Array(data_size,data_size,tmp_ptr,release); delete p_data; } else value.lg64_seq = new Tango::DevVarLong64Array(data_size,data_size,p_data,release); } } value_flag = true; // // Reset alarm flags // alarm.reset(); // // Get time // set_time(); } void Attribute::set_value(Tango::DevFloat *p_data,long x, long y,bool release) { // // Throw exception if pointer is null // CHECK_PTR(p_data,name); // // Throw exception if type is not correct // if (data_type != Tango::DEV_FLOAT) { if (release == true) delete p_data; TangoSys_OMemStream o; o << "Invalid data type for attribute " << name << ends; Except::throw_exception((const char *)API_AttrOptProp,o.str(), (const char *)"Attribute::set_value()"); } // // Check that data size is less than the given max // if ((x > max_x) || (y > max_y)) { if (release == true) delete p_data; TangoSys_OMemStream o; o << "Data size for attribute " << name << " exceeds given limit" << ends; Except::throw_exception((const char *)API_AttrOptProp,o.str(), (const char *)"Attribute::set_value()"); } // // Compute data size and set default quality to valid. // dim_x = x; dim_y = y; set_data_size(); quality = Tango::ATTR_VALID; // // If the data is wanted from the DevState command, store it in a sequence. If the attribute has an associated // writable attribute, store data in a temporary buffer (the write value must be added before the data is sent // back to the caller) // if (date == false) { value.fl_seq = new Tango::DevVarFloatArray(data_size,data_size,p_data,release); } else { if ((is_writ_associated() == true)) { if (data_format == Tango::SCALAR) { tmp_fl[0] = *p_data; if (release == true) delete p_data; } else { value.fl_seq = new Tango::DevVarFloatArray(data_size); value.fl_seq->length(data_size); for (int k = 0;k < data_size;k++) (*value.fl_seq)[k] = p_data[k]; if (release == true) delete [] p_data; } } else { if ((data_format == Tango::SCALAR) && (release == true)) { Tango::DevFloat *tmp_ptr = new Tango::DevFloat[1]; *tmp_ptr = *p_data; value.fl_seq = new Tango::DevVarFloatArray(data_size,data_size,tmp_ptr,release); delete p_data; } else value.fl_seq = new Tango::DevVarFloatArray(data_size,data_size,p_data,release); } } value_flag = true; // // Reset alarm flags // alarm.reset(); // // Get time // set_time(); } void Attribute::set_value(Tango::DevDouble *p_data,long x, long y,bool release) { // // Throw exception if pointer is null // CHECK_PTR(p_data,name); // // Throw exception if type is not correct // if (data_type != Tango::DEV_DOUBLE) { if (release == true) delete p_data; TangoSys_OMemStream o; o << "Invalid data type for attribute " << name << ends; Except::throw_exception((const char *)API_AttrOptProp,o.str(), (const char *)"Attribute::set_value()"); } // // Check that data size is less than the given max // if ((x > max_x) || (y > max_y)) { if (release == true) delete p_data; TangoSys_OMemStream o; o << "Data size for attribute " << name << " exceeds given limit" << ends; Except::throw_exception((const char *)API_AttrOptProp,o.str(), (const char *)"Attribute::set_value()"); } // // Compute data size and set default quality to valid. // dim_x = x; dim_y = y; set_data_size(); quality = Tango::ATTR_VALID; // // If the data is wanted from the DevState command, store it in a sequence. If the attribute has an associated // writable attribute, store data in a temporary buffer (the write value must be added before the data is sent // back to the caller) // if (date == false) { value.db_seq = new Tango::DevVarDoubleArray(data_size,data_size,p_data,release); } else { if ((is_writ_associated() == true)) { if (data_format == Tango::SCALAR) { tmp_db[0] = *p_data; if (release == true) delete p_data; } else { value.db_seq = new Tango::DevVarDoubleArray(data_size); value.db_seq->length(data_size); for (int k = 0;k < data_size;k++) (*value.db_seq)[k] = p_data[k]; if (release == true) delete [] p_data; } } else { if ((data_format == Tango::SCALAR) && (release == true)) { Tango::DevDouble *tmp_ptr = new Tango::DevDouble[1]; *tmp_ptr = *p_data; value.db_seq = new Tango::DevVarDoubleArray(data_size,data_size,tmp_ptr,release); delete p_data; } else value.db_seq = new Tango::DevVarDoubleArray(data_size,data_size,p_data,release); } } value_flag = true; // // Reset alarm flags // alarm.reset(); // // Get time // set_time(); } void Attribute::set_value(Tango::DevString *p_data,long x, long y,bool release) { // // Throw exception if pointer is null // CHECK_PTR(p_data,name); // // Throw exception if type is not correct // if (data_type != Tango::DEV_STRING) { if (release == true) delete p_data; TangoSys_OMemStream o; o << "Invalid data type for attribute " << name << ends; Except::throw_exception((const char *)API_AttrOptProp,o.str(), (const char *)"Attribute::set_value()"); } // // Check that data size is less than the given max // if ((x > max_x) || (y > max_y)) { if (release == true) delete p_data; TangoSys_OMemStream o; o << "Data size for attribute " << name << " exceeds given limit" << ends; Except::throw_exception((const char *)API_AttrOptProp,o.str(), (const char *)"Attribute::set_value()"); } // // Compute data size and set default quality to valid. // dim_x = x; dim_y = y; set_data_size(); quality = Tango::ATTR_VALID; // // If the data is wanted from the DevState command, store it in a sequence. If the attribute has an associated // writable attribute, store data in a temporary buffer (the write value must be added before the data is sent // back to the caller) // if (date == false) { if (release == true) { char **strvec = Tango::DevVarStringArray::allocbuf(data_size); for (int i = 0;i < data_size;i++) strvec[i] = p_data[i]; value.str_seq = new Tango::DevVarStringArray(data_size,data_size,strvec,release); delete [] p_data; } else value.str_seq = new Tango::DevVarStringArray(data_size,data_size,p_data,release); } else { if ((is_writ_associated() == true)) { if (data_format == Tango::SCALAR) { tmp_str[0] = *p_data; if (release == true) delete p_data; ext->scalar_str_attr_release = release; } else { value.str_seq = new Tango::DevVarStringArray(data_size); value.str_seq->length(data_size); for (int k = 0;k < data_size;k++) (*value.str_seq)[k] = CORBA::string_dup(p_data[k]); if (release == true) delete [] p_data; } } else { if (release == true) { char **strvec = Tango::DevVarStringArray::allocbuf(data_size); for (int i = 0;i < data_size;i++) strvec[i] = p_data[i]; value.str_seq = new Tango::DevVarStringArray(data_size,data_size,strvec,release); if (data_format == Tango::SCALAR) delete p_data; else delete [] p_data; } else value.str_seq = new Tango::DevVarStringArray(data_size,data_size,p_data,release); } } value_flag = true; // // Get time // set_time(); } void Attribute::set_value(Tango::DevUShort *p_data,long x, long y,bool release) { // // Throw exception if pointer is null // CHECK_PTR(p_data,name); // // Throw exception if type is not correct // if (data_type != Tango::DEV_USHORT) { if (release == true) delete p_data; TangoSys_OMemStream o; o << "Invalid data type for attribute " << name << ends; Except::throw_exception((const char *)API_AttrOptProp,o.str(), (const char *)"Attribute::set_value()"); } // // Check that data size is less than the given max // if ((x > max_x) || (y > max_y)) { if (release == true) delete p_data; TangoSys_OMemStream o; o << "Data size for attribute " << name << " exceeds given limit" << ends; Except::throw_exception((const char *)API_AttrOptProp,o.str(), (const char *)"Attribute::set_value()"); } // // Compute data size and set default quality to valid. // dim_x = x; dim_y = y; set_data_size(); quality = Tango::ATTR_VALID; // // If the data is wanted from the DevState command, store it in a sequence. If the attribute has an associated // writable attribute, store data in a temporary buffer (the write value must be added before the data is sent // back to the caller) // if (date == false) { value.ush_seq = new Tango::DevVarUShortArray(data_size,data_size,p_data,release); } else { if ((is_writ_associated() == true)) { if (data_format == Tango::SCALAR) { tmp_ush[0] = *p_data; if (release == true) delete p_data; } else { value.ush_seq = new Tango::DevVarUShortArray(data_size); value.ush_seq->length(data_size); for (int k = 0;k < data_size;k++) (*value.ush_seq)[k] = p_data[k]; if (release == true) delete [] p_data; } } else { if ((data_format == Tango::SCALAR) && (release == true)) { Tango::DevUShort *tmp_ptr = new Tango::DevUShort[1]; *tmp_ptr = *p_data; value.ush_seq = new Tango::DevVarUShortArray(data_size,data_size,tmp_ptr,release); delete p_data; } else value.ush_seq = new Tango::DevVarUShortArray(data_size,data_size,p_data,release); } } value_flag = true; // // Reset alarm flags // alarm.reset(); // // Get time // set_time(); } void Attribute::set_value(Tango::DevBoolean *p_data,long x, long y,bool release) { // // Throw exception if pointer is null // CHECK_PTR(p_data,name); // // Throw exception if type is not correct // if (data_type != Tango::DEV_BOOLEAN) { if (release == true) delete p_data; TangoSys_OMemStream o; o << "Invalid data type for attribute " << name << ends; Except::throw_exception((const char *)API_AttrOptProp,o.str(), (const char *)"Attribute::set_value()"); } // // Check that data size is less than the given max // if ((x > max_x) || (y > max_y)) { if (release == true) delete p_data; TangoSys_OMemStream o; o << "Data size for attribute " << name << " exceeds given limit" << ends; Except::throw_exception((const char *)API_AttrOptProp,o.str(), (const char *)"Attribute::set_value()"); } // // Compute data size and set default quality to valid. // dim_x = x; dim_y = y; set_data_size(); quality = Tango::ATTR_VALID; // // If the data is wanted from the DevState command, store it in a sequence. If the attribute has an associated // writable attribute, store data in a temporary buffer (the write value must be added before the data is sent // back to the caller) // if (date == false) { value.boo_seq = new Tango::DevVarBooleanArray(data_size,data_size,p_data,release); } else { if ((is_writ_associated() == true)) { if (data_format == Tango::SCALAR) { tmp_boo[0] = *p_data; if (release == true) delete p_data; } else { value.boo_seq = new Tango::DevVarBooleanArray(data_size); value.boo_seq->length(data_size); for (int k = 0;k < data_size;k++) (*value.boo_seq)[k] = p_data[k]; if (release == true) delete [] p_data; } } else { if ((data_format == Tango::SCALAR) && (release == true)) { Tango::DevBoolean *tmp_ptr = new Tango::DevBoolean[1]; *tmp_ptr = *p_data; value.boo_seq = new Tango::DevVarBooleanArray(data_size,data_size,tmp_ptr,release); delete p_data; } else value.boo_seq = new Tango::DevVarBooleanArray(data_size,data_size,p_data,release); } } value_flag = true; // // Reset alarm flags // alarm.reset(); // // Get time // set_time(); } void Attribute::set_value(Tango::DevUChar *p_data,long x, long y,bool release) { // // Throw exception if pointer is null // CHECK_PTR(p_data,name); // // Throw exception if type is not correct // if (data_type != Tango::DEV_UCHAR) { if (release == true) delete p_data; TangoSys_OMemStream o; o << "Invalid data type for attribute " << name << ends; Except::throw_exception((const char *)API_AttrOptProp,o.str(), (const char *)"Attribute::set_value()"); } // // Check that data size is less than the given max // if ((x > max_x) || (y > max_y)) { if (release == true) delete p_data; TangoSys_OMemStream o; o << "Data size for attribute " << name << " exceeds given limit" << ends; Except::throw_exception((const char *)API_AttrOptProp,o.str(), (const char *)"Attribute::set_value()"); } // // Compute data size and set default quality to valid. // dim_x = x; dim_y = y; set_data_size(); quality = Tango::ATTR_VALID; // // If the data is wanted from the DevState command, store it in a sequence. If the attribute has an associated // writable attribute, store data in a temporary buffer (the write value must be added before the data is sent // back to the caller) // if (date == false) { value.cha_seq = new Tango::DevVarCharArray(data_size,data_size,p_data,release); } else { if ((is_writ_associated() == true)) { if (data_format == Tango::SCALAR) { tmp_cha[0] = *p_data; if (release == true) delete p_data; } else { value.cha_seq = new Tango::DevVarCharArray(data_size); value.cha_seq->length(data_size); for (int k = 0;k < data_size;k++) (*value.cha_seq)[k] = p_data[k]; if (release == true) delete [] p_data; } } else { if ((data_format == Tango::SCALAR) && (release == true)) { Tango::DevUChar *tmp_ptr = new Tango::DevUChar[1]; *tmp_ptr = *p_data; value.cha_seq = new Tango::DevVarCharArray(data_size,data_size,tmp_ptr,release); delete p_data; } else value.cha_seq = new Tango::DevVarCharArray(data_size,data_size,p_data,release); } } value_flag = true; // // Reset alarm flags // alarm.reset(); // // Get time // set_time(); } void Attribute::set_value(Tango::DevULong *p_data,long x,long y,bool release) { // // Throw exception if pointer is null // CHECK_PTR(p_data,name); // // Throw exception if type is not correct // if (data_type != Tango::DEV_ULONG) { if (release == true) delete p_data; TangoSys_OMemStream o; o << "Invalid data type for attribute " << name << ends; Except::throw_exception((const char *)API_AttrOptProp, o.str(), (const char *)"Attribute::set_value()"); } // // Check that data size is less than the given max // if ((x > max_x) || (y > max_y)) { if (release == true) delete p_data; TangoSys_OMemStream o; o << "Data size for attribute " << name << " exceeds given limit" << ends; Except::throw_exception((const char *)API_AttrOptProp,o.str(), (const char *)"Attribute::set_value()"); } // // Compute data size and set default quality to valid. // dim_x = x; dim_y = y; set_data_size(); quality = Tango::ATTR_VALID; // // If the data is wanted from the DevState command, store it in a sequence. If the attribute has an associated // writable attribute, store data in a temporary buffer (the write value must be added before the data is sent // back to the caller) // if (date == false) { value.ulg_seq = new Tango::DevVarULongArray(data_size,data_size,p_data,release); } else { if ((is_writ_associated() == true)) { if (data_format == Tango::SCALAR) { ext->tmp_ulo[0] = *p_data; if (release == true) delete p_data; } else { value.ulg_seq = new Tango::DevVarULongArray(data_size); value.ulg_seq->length(data_size); for (int k = 0;k < data_size;k++) (*value.ulg_seq)[k] = p_data[k]; if (release == true) delete [] p_data; } } else { if ((data_format == Tango::SCALAR) && (release == true)) { Tango::DevULong *tmp_ptr = new Tango::DevULong[1]; *tmp_ptr = *p_data; value.ulg_seq = new Tango::DevVarULongArray(data_size,data_size,tmp_ptr,release); delete p_data; } else value.ulg_seq = new Tango::DevVarULongArray(data_size,data_size,p_data,release); } } value_flag = true; // // Reset alarm flags // alarm.reset(); // // Get time // set_time(); } void Attribute::set_value(Tango::DevULong64 *p_data,long x,long y,bool release) { // // Throw exception if pointer is null // CHECK_PTR(p_data,name); // // Throw exception if type is not correct // if (data_type != Tango::DEV_ULONG64) { if (release == true) delete p_data; TangoSys_OMemStream o; o << "Invalid data type for attribute " << name << ends; Except::throw_exception((const char *)API_AttrOptProp, o.str(), (const char *)"Attribute::set_value()"); } // // Check that data size is less than the given max // if ((x > max_x) || (y > max_y)) { if (release == true) delete p_data; TangoSys_OMemStream o; o << "Data size for attribute " << name << " exceeds given limit" << ends; Except::throw_exception((const char *)API_AttrOptProp,o.str(), (const char *)"Attribute::set_value()"); } // // Compute data size and set default quality to valid. // dim_x = x; dim_y = y; set_data_size(); quality = Tango::ATTR_VALID; // // If the data is wanted from the DevState command, store it in a sequence. If the attribute has an associated // writable attribute, store data in a temporary buffer (the write value must be added before the data is sent // back to the caller) // if (date == false) { value.ulg64_seq = new Tango::DevVarULong64Array(data_size,data_size,p_data,release); } else { if ((is_writ_associated() == true)) { if (data_format == Tango::SCALAR) { ext->tmp_ulo64[0] = *p_data; if (release == true) delete p_data; } else { value.ulg64_seq = new Tango::DevVarULong64Array(data_size); value.ulg64_seq->length(data_size); for (int k = 0;k < data_size;k++) (*value.ulg64_seq)[k] = p_data[k]; if (release == true) delete [] p_data; } } else { if ((data_format == Tango::SCALAR) && (release == true)) { Tango::DevULong64 *tmp_ptr = new Tango::DevULong64[1]; *tmp_ptr = *p_data; value.ulg64_seq = new Tango::DevVarULong64Array(data_size,data_size,tmp_ptr,release); delete p_data; } else value.ulg64_seq = new Tango::DevVarULong64Array(data_size,data_size,p_data,release); } } value_flag = true; // // Reset alarm flags // alarm.reset(); // // Get time // set_time(); } void Attribute::set_value(Tango::DevState *p_data,long x,long y,bool release) { // // Throw exception if pointer is null // CHECK_PTR(p_data,name); // // Throw exception if type is not correct // if (data_type != Tango::DEV_STATE) { if (release == true) delete p_data; TangoSys_OMemStream o; o << "Invalid data type for attribute " << name << ends; Except::throw_exception((const char *)API_AttrOptProp, o.str(), (const char *)"Attribute::set_value()"); } // // Check that data size is less than the given max // if ((x > max_x) || (y > max_y)) { if (release == true) delete p_data; TangoSys_OMemStream o; o << "Data size for attribute " << name << " exceeds given limit" << ends; Except::throw_exception((const char *)API_AttrOptProp,o.str(), (const char *)"Attribute::set_value()"); } // // Compute data size and set default quality to valid. // dim_x = x; dim_y = y; set_data_size(); quality = Tango::ATTR_VALID; // // If the data is wanted from the DevState command, store it in a sequence. If the attribute has an associated // writable attribute, store data in a temporary buffer (the write value must be added before the data is sent // back to the caller) // if (date == false) { value.state_seq = new Tango::DevVarStateArray(data_size,data_size,p_data,release); } else { if ((is_writ_associated() == true)) { if (data_format == Tango::SCALAR) { ext->tmp_state[0] = *p_data; if (release == true) delete p_data; } else { value.state_seq = new Tango::DevVarStateArray(data_size); value.state_seq->length(data_size); for (int k = 0;k < data_size;k++) (*value.state_seq)[k] = p_data[k]; if (release == true) delete [] p_data; } } else { if ((data_format == Tango::SCALAR) && (release == true)) { Tango::DevState *tmp_ptr = new Tango::DevState[1]; *tmp_ptr = *p_data; value.state_seq = new Tango::DevVarStateArray(data_size,data_size,tmp_ptr,release); delete p_data; } else value.state_seq = new Tango::DevVarStateArray(data_size,data_size,p_data,release); } } value_flag = true; // // Reset alarm flags // alarm.reset(); // // Get time // set_time(); } void Attribute::set_value(Tango::DevEncoded *p_data,long x, long y,bool release) { // // Throw exception if pointer is null // CHECK_PTR(p_data,name); // // Throw exception if type is not correct // if (data_type != Tango::DEV_ENCODED) { if (release == true) delete p_data; TangoSys_OMemStream o; o << "Invalid data type for attribute " << name << ends; Except::throw_exception((const char *)API_AttrOptProp,o.str(), (const char *)"Attribute::set_value()"); } // // Check that data size is less than the given max // if ((x > max_x) || (y > max_y)) { if (release == true) delete p_data; TangoSys_OMemStream o; o << "Data size for attribute " << name << " exceeds given limit" << ends; Except::throw_exception((const char *)API_AttrOptProp,o.str(), (const char *)"Attribute::set_value()"); } // // Compute data size and set default quality to valid. // dim_x = x; dim_y = y; set_data_size(); quality = Tango::ATTR_VALID; // // If the data is wanted from the DevState command, store it in a sequence. If the attribute has an associated // writable attribute, store data in a temporary buffer (the write value must be added before the data is sent // back to the caller) // if (date == false) { value.enc_seq = new Tango::DevVarEncodedArray(data_size,data_size,p_data,release); } else { if ((is_writ_associated() == true)) { tmp_enc[0] = *p_data; if (release == true) delete p_data; } else { if (release == true) { DevEncoded *tmp_ptr = new DevEncoded[1]; tmp_ptr->encoded_format = p_data->encoded_format; unsigned long nb_data = p_data->encoded_data.length(); tmp_ptr->encoded_data.replace(nb_data,nb_data,p_data->encoded_data.get_buffer(true),true); p_data->encoded_data.replace(0,0,NULL,false); value.enc_seq = new Tango::DevVarEncodedArray(data_size,data_size,tmp_ptr,true); delete p_data; } else value.enc_seq = new Tango::DevVarEncodedArray(data_size,data_size,p_data,release); } } value_flag = true; // // Reset alarm flags // alarm.reset(); // // Get time // set_time(); } void Attribute::set_value(Tango::DevString *p_data_str,Tango::DevUChar *p_data,long size,bool release) { if (p_data_str == NULL || p_data == NULL) { TangoSys_OMemStream o; o << "Data pointer for attribute " << name << " is NULL!" << ends; Except::throw_exception((const char *)API_AttrOptProp,o.str(), (const char *)"Attribute::set_value()"); } if (release == false) { enc_help.encoded_format = CORBA::string_dup(*p_data_str); enc_help.encoded_data.replace(size,size,p_data,false); set_value(&enc_help); } else { DevEncoded *enc_ptr = new DevEncoded; enc_ptr->encoded_format = CORBA::string_dup(*p_data_str); delete [] *p_data_str; enc_ptr->encoded_data.replace(size,size,p_data,true); set_value(enc_ptr,1,0,true); } } void Attribute::set_value(Tango::EncodedAttribute *attr) { CHECK_PTR(attr,name); Tango::DevString *f = attr->get_format(); Tango::DevUChar *d = attr->get_data(); long size = attr->get_size(); if( *f==NULL ) { TangoSys_OMemStream o; o << "DevEncoded format for attribute " << name << " not specified" << ends; Except::throw_exception((const char *)API_AttrOptProp,o.str(), (const char *)"Attribute::set_value()"); } if( size==0 || !d ) { TangoSys_OMemStream o; o << "DevEncoded data for attribute " << name << " not specified" << ends; Except::throw_exception((const char *)API_AttrOptProp,o.str(), (const char *)"Attribute::set_value()"); } set_value(f,d,size,false); if (attr->get_exclusion() == true) { set_user_attr_mutex(attr->get_mutex()); } } //-------------------------------------------------------------------------------------------------------------------- // // method : // Attribute::set_value_date_quality // // description : // Set the attribute read value date and quality. This method is overloaded several times for all the // supported attribute data type // // argument : // in : // - p_data : The attribute read value // - t : The attribute date // - qual : The attribute quality // - x : The attribute x dimension (default is 1) // - y : The atttribute y dimension (default is 0) // - release : A flag set to true if memory must be de-allocated (default is false) // //-------------------------------------------------------------------------------------------------------------------- void Attribute::set_value_date_quality(Tango::DevShort *p_data,time_t t, Tango::AttrQuality qual, long x,long y,bool release) { set_value(p_data,x,y,release); set_quality(qual,false); set_date(t); if (qual == Tango::ATTR_INVALID) { if (!((is_writ_associated() == true) && (data_format == Tango::SCALAR))) delete_seq(); } } #ifdef _TG_WINDOWS_ void Attribute::set_value_date_quality(Tango::DevShort *p_data,struct _timeb &t, Tango::AttrQuality qual, long x,long y,bool release) { set_value(p_data,x,y,release); set_quality(qual,false); set_date(t); if (qual == Tango::ATTR_INVALID) { if (!((is_writ_associated() == true) && (data_format == Tango::SCALAR))) delete_seq(); } } #else void Attribute::set_value_date_quality(Tango::DevShort *p_data,struct timeval &t, Tango::AttrQuality qual, long x,long y,bool release) { set_value(p_data,x,y,release); set_quality(qual,false); set_date(t); if (qual == Tango::ATTR_INVALID) { if (!((is_writ_associated() == true) && (data_format == Tango::SCALAR))) delete_seq(); } } #endif //--------------------------------------------------------------------------- void Attribute::set_value_date_quality(Tango::DevLong *p_data,time_t t, Tango::AttrQuality qual, long x,long y,bool release) { set_value(p_data,x,y,release); set_quality(qual,false); set_date(t); if (qual == Tango::ATTR_INVALID) { if (!((is_writ_associated() == true) && (data_format == Tango::SCALAR))) delete_seq(); } } #ifdef _TG_WINDOWS_ void Attribute::set_value_date_quality(Tango::DevLong *p_data,struct _timeb &t, Tango::AttrQuality qual, long x,long y,bool release) { set_value(p_data,x,y,release); set_quality(qual,false); set_date(t); if (qual == Tango::ATTR_INVALID) { if (!((is_writ_associated() == true) && (data_format == Tango::SCALAR))) delete_seq(); } } #else void Attribute::set_value_date_quality(Tango::DevLong *p_data,struct timeval &t, Tango::AttrQuality qual, long x,long y,bool release) { set_value(p_data,x,y,release); set_quality(qual,false); set_date(t); if (qual == Tango::ATTR_INVALID) { if (!((is_writ_associated() == true) && (data_format == Tango::SCALAR))) delete_seq(); } } #endif //--------------------------------------------------------------------------- void Attribute::set_value_date_quality(Tango::DevLong64 *p_data,time_t t, Tango::AttrQuality qual, long x,long y,bool release) { set_value(p_data,x,y,release); set_quality(qual,false); set_date(t); if (qual == Tango::ATTR_INVALID) { if (!((is_writ_associated() == true) && (data_format == Tango::SCALAR))) delete_seq(); } } #ifdef _TG_WINDOWS_ void Attribute::set_value_date_quality(Tango::DevLong64 *p_data,struct _timeb &t, Tango::AttrQuality qual, long x,long y,bool release) { set_value(p_data,x,y,release); set_quality(qual,false); set_date(t); if (qual == Tango::ATTR_INVALID) { if (!((is_writ_associated() == true) && (data_format == Tango::SCALAR))) delete_seq(); } } #else void Attribute::set_value_date_quality(Tango::DevLong64 *p_data,struct timeval &t, Tango::AttrQuality qual, long x,long y,bool release) { set_value(p_data,x,y,release); set_quality(qual,false); set_date(t); if (qual == Tango::ATTR_INVALID) { if (!((is_writ_associated() == true) && (data_format == Tango::SCALAR))) delete_seq(); } } #endif //--------------------------------------------------------------------------- void Attribute::set_value_date_quality(Tango::DevFloat *p_data,time_t t, Tango::AttrQuality qual, long x,long y,bool release) { set_value(p_data,x,y,release); set_quality(qual,false); set_date(t); if (qual == Tango::ATTR_INVALID) { if (!((is_writ_associated() == true) && (data_format == Tango::SCALAR))) delete_seq(); } } #ifdef _TG_WINDOWS_ void Attribute::set_value_date_quality(Tango::DevFloat *p_data,struct _timeb &t, Tango::AttrQuality qual, long x,long y,bool release) { set_value(p_data,x,y,release); set_quality(qual,false); set_date(t); if (qual == Tango::ATTR_INVALID) { if (!((is_writ_associated() == true) && (data_format == Tango::SCALAR))) delete_seq(); } } #else void Attribute::set_value_date_quality(Tango::DevFloat *p_data,struct timeval &t, Tango::AttrQuality qual, long x,long y,bool release) { set_value(p_data,x,y,release); set_quality(qual,false); set_date(t); if (qual == Tango::ATTR_INVALID) { if (!((is_writ_associated() == true) && (data_format == Tango::SCALAR))) delete_seq(); } } #endif //--------------------------------------------------------------------------- void Attribute::set_value_date_quality(Tango::DevDouble *p_data,time_t t, Tango::AttrQuality qual, long x,long y,bool release) { set_value(p_data,x,y,release); set_quality(qual,false); set_date(t); if (qual == Tango::ATTR_INVALID) { if (!((is_writ_associated() == true) && (data_format == Tango::SCALAR))) delete_seq(); } } #ifdef _TG_WINDOWS_ void Attribute::set_value_date_quality(Tango::DevDouble *p_data,struct _timeb &t, Tango::AttrQuality qual, long x,long y,bool release) { set_value(p_data,x,y,release); set_quality(qual,false); set_date(t); if (qual == Tango::ATTR_INVALID) { if (!((is_writ_associated() == true) && (data_format == Tango::SCALAR))) delete_seq(); } } #else void Attribute::set_value_date_quality(Tango::DevDouble *p_data,struct timeval &t, Tango::AttrQuality qual, long x,long y,bool release) { set_value(p_data,x,y,release); set_quality(qual,false); set_date(t); if (qual == Tango::ATTR_INVALID) { if (!((is_writ_associated() == true) && (data_format == Tango::SCALAR))) delete_seq(); } } #endif //--------------------------------------------------------------------------- void Attribute::set_value_date_quality(Tango::DevString *p_data,time_t t, Tango::AttrQuality qual, long x,long y,bool release) { set_value(p_data,x,y,release); set_quality(qual,false); set_date(t); if (qual == Tango::ATTR_INVALID) { if (!((is_writ_associated() == true) && (data_format == Tango::SCALAR))) delete_seq(); } } #ifdef _TG_WINDOWS_ void Attribute::set_value_date_quality(Tango::DevString *p_data,struct _timeb &t, Tango::AttrQuality qual, long x,long y,bool release) { set_value(p_data,x,y,release); set_quality(qual,false); set_date(t); if (qual == Tango::ATTR_INVALID) { if (!((is_writ_associated() == true) && (data_format == Tango::SCALAR))) delete_seq(); } } #else void Attribute::set_value_date_quality(Tango::DevString *p_data,struct timeval &t, Tango::AttrQuality qual, long x,long y,bool release) { set_value(p_data,x,y,release); set_quality(qual,false); set_date(t); if (qual == Tango::ATTR_INVALID) { if (!((is_writ_associated() == true) && (data_format == Tango::SCALAR))) delete_seq(); } } #endif //--------------------------------------------------------------------------- void Attribute::set_value_date_quality(Tango::DevBoolean *p_data,time_t t, Tango::AttrQuality qual, long x,long y,bool release) { set_value(p_data,x,y,release); set_quality(qual,false); set_date(t); if (qual == Tango::ATTR_INVALID) { if (!((is_writ_associated() == true) && (data_format == Tango::SCALAR))) delete_seq(); } } #ifdef _TG_WINDOWS_ void Attribute::set_value_date_quality(Tango::DevBoolean *p_data,struct _timeb &t, Tango::AttrQuality qual, long x,long y,bool release) { set_value(p_data,x,y,release); set_quality(qual,false); set_date(t); if (qual == Tango::ATTR_INVALID) { if (!((is_writ_associated() == true) && (data_format == Tango::SCALAR))) delete_seq(); } } #else void Attribute::set_value_date_quality(Tango::DevBoolean *p_data,struct timeval &t, Tango::AttrQuality qual, long x,long y,bool release) { set_value(p_data,x,y,release); set_quality(qual,false); set_date(t); if (qual == Tango::ATTR_INVALID) { if (!((is_writ_associated() == true) && (data_format == Tango::SCALAR))) delete_seq(); } } #endif //--------------------------------------------------------------------------- void Attribute::set_value_date_quality(Tango::DevUShort *p_data,time_t t, Tango::AttrQuality qual, long x,long y,bool release) { set_value(p_data,x,y,release); set_quality(qual,false); set_date(t); if (qual == Tango::ATTR_INVALID) { if (!((is_writ_associated() == true) && (data_format == Tango::SCALAR))) delete_seq(); } } #ifdef _TG_WINDOWS_ void Attribute::set_value_date_quality(Tango::DevUShort *p_data,struct _timeb &t, Tango::AttrQuality qual, long x,long y,bool release) { set_value(p_data,x,y,release); set_quality(qual,false); set_date(t); if (qual == Tango::ATTR_INVALID) { if (!((is_writ_associated() == true) && (data_format == Tango::SCALAR))) delete_seq(); } } #else void Attribute::set_value_date_quality(Tango::DevUShort *p_data,struct timeval &t, Tango::AttrQuality qual, long x,long y,bool release) { set_value(p_data,x,y,release); set_quality(qual,false); set_date(t); if (qual == Tango::ATTR_INVALID) { if (!((is_writ_associated() == true) && (data_format == Tango::SCALAR))) delete_seq(); } } #endif //--------------------------------------------------------------------------- void Attribute::set_value_date_quality(Tango::DevUChar *p_data,time_t t, Tango::AttrQuality qual, long x,long y,bool release) { set_value(p_data,x,y,release); set_quality(qual,false); set_date(t); if (qual == Tango::ATTR_INVALID) { if (!((is_writ_associated() == true) && (data_format == Tango::SCALAR))) delete_seq(); } } #ifdef _TG_WINDOWS_ void Attribute::set_value_date_quality(Tango::DevUChar *p_data,struct _timeb &t, Tango::AttrQuality qual, long x,long y,bool release) { set_value(p_data,x,y,release); set_quality(qual,false); set_date(t); if (qual == Tango::ATTR_INVALID) { if (!((is_writ_associated() == true) && (data_format == Tango::SCALAR))) delete_seq(); } } #else void Attribute::set_value_date_quality(Tango::DevUChar *p_data,struct timeval &t, Tango::AttrQuality qual, long x,long y,bool release) { set_value(p_data,x,y,release); set_quality(qual,false); set_date(t); if (qual == Tango::ATTR_INVALID) { if (!((is_writ_associated() == true) && (data_format == Tango::SCALAR))) delete_seq(); } } #endif //--------------------------------------------------------------------------- void Attribute::set_value_date_quality(Tango::DevULong *p_data,time_t t, Tango::AttrQuality qual, long x,long y,bool release) { set_value(p_data,x,y,release); set_quality(qual,false); set_date(t); if (qual == Tango::ATTR_INVALID) { if (!((is_writ_associated() == true) && (data_format == Tango::SCALAR))) delete_seq(); } } #ifdef _TG_WINDOWS_ void Attribute::set_value_date_quality(Tango::DevULong *p_data,struct _timeb &t, Tango::AttrQuality qual, long x,long y,bool release) { set_value(p_data,x,y,release); set_quality(qual,false); set_date(t); if (qual == Tango::ATTR_INVALID) { if (!((is_writ_associated() == true) && (data_format == Tango::SCALAR))) delete_seq(); } } #else void Attribute::set_value_date_quality(Tango::DevULong *p_data,struct timeval &t, Tango::AttrQuality qual, long x,long y,bool release) { set_value(p_data,x,y,release); set_quality(qual,false); set_date(t); if (qual == Tango::ATTR_INVALID) { if (!((is_writ_associated() == true) && (data_format == Tango::SCALAR))) delete_seq(); } } #endif //--------------------------------------------------------------------------- void Attribute::set_value_date_quality(Tango::DevULong64 *p_data,time_t t, Tango::AttrQuality qual, long x,long y,bool release) { set_value(p_data,x,y,release); set_quality(qual,false); set_date(t); if (qual == Tango::ATTR_INVALID) { if (!((is_writ_associated() == true) && (data_format == Tango::SCALAR))) delete_seq(); } } #ifdef _TG_WINDOWS_ void Attribute::set_value_date_quality(Tango::DevULong64 *p_data,struct _timeb &t, Tango::AttrQuality qual, long x,long y,bool release) { set_value(p_data,x,y,release); set_quality(qual,false); set_date(t); if (qual == Tango::ATTR_INVALID) { if (!((is_writ_associated() == true) && (data_format == Tango::SCALAR))) delete_seq(); } } #else void Attribute::set_value_date_quality(Tango::DevULong64 *p_data,struct timeval &t, Tango::AttrQuality qual, long x,long y,bool release) { set_value(p_data,x,y,release); set_quality(qual,false); set_date(t); if (qual == Tango::ATTR_INVALID) { if (!((is_writ_associated() == true) && (data_format == Tango::SCALAR))) delete_seq(); } } #endif //--------------------------------------------------------------------------- void Attribute::set_value_date_quality(Tango::DevState *p_data,time_t t, Tango::AttrQuality qual, long x,long y,bool release) { set_value(p_data,x,y,release); set_quality(qual,false); set_date(t); if (qual == Tango::ATTR_INVALID) { if (!((is_writ_associated() == true) && (data_format == Tango::SCALAR))) delete_seq(); } } #ifdef _TG_WINDOWS_ void Attribute::set_value_date_quality(Tango::DevState *p_data,struct _timeb &t, Tango::AttrQuality qual, long x,long y,bool release) { set_value(p_data,x,y,release); set_quality(qual,false); set_date(t); if (qual == Tango::ATTR_INVALID) { if (!((is_writ_associated() == true) && (data_format == Tango::SCALAR))) delete_seq(); } } #else void Attribute::set_value_date_quality(Tango::DevState *p_data,struct timeval &t, Tango::AttrQuality qual, long x,long y,bool release) { set_value(p_data,x,y,release); set_quality(qual,false); set_date(t); if (qual == Tango::ATTR_INVALID) { if (!((is_writ_associated() == true) && (data_format == Tango::SCALAR))) delete_seq(); } } #endif //--------------------------------------------------------------------------- void Attribute::set_value_date_quality(Tango::DevEncoded *p_data,time_t t, Tango::AttrQuality qual, long x,long y,bool release) { set_value(p_data,x,y,release); set_quality(qual,false); set_date(t); } void Attribute::set_value_date_quality(Tango::DevString *p_data_str,Tango::DevUChar *p_data,long size,time_t t, Tango::AttrQuality qual, bool release) { set_value(p_data_str,p_data,size,release); set_quality(qual,false); set_date(t); } #ifdef _TG_WINDOWS_ void Attribute::set_value_date_quality(Tango::DevEncoded *p_data,struct _timeb &t, Tango::AttrQuality qual, long x,long y,bool release) { set_value(p_data,x,y,release); set_quality(qual,false); set_date(t); } void Attribute::set_value_date_quality(Tango::DevString *p_data_str,Tango::DevUChar *p_data,long size,struct _timeb &t, Tango::AttrQuality qual, bool release) { set_value(p_data_str,p_data,size,release); set_quality(qual,false); set_date(t); } #else void Attribute::set_value_date_quality(Tango::DevEncoded *p_data,struct timeval &t, Tango::AttrQuality qual, long x,long y,bool release) { set_value(p_data,x,y,release); set_quality(qual,false); set_date(t); } void Attribute::set_value_date_quality(Tango::DevString *p_data_str,Tango::DevUChar *p_data,long size,struct timeval &t, Tango::AttrQuality qual, bool release) { set_value(p_data_str,p_data,size,release); set_quality(qual,false); set_date(t); } #endif //-------------------------------------------------------------------------------------------------------------------- // // method : // Attribute::set_data_size // // description : // Compute the attribute amount of data // //-------------------------------------------------------------------------------------------------------------------- void Attribute::set_data_size() { switch(data_format) { case Tango::SCALAR : data_size = 1; break; case Tango::SPECTRUM : data_size = dim_x; break; case Tango::IMAGE : data_size = dim_x * dim_y; break; case FMT_UNKNOWN : data_size = 0; break; } } //-------------------------------------------------------------------------------------------------------------------- // // method : // Attribute::set_time // // description : // Set the date if the date flag is true // //-------------------------------------------------------------------------------------------------------------------- void Attribute::set_time() { if (date == true) { #ifdef _TG_WINDOWS_ struct _timeb t; _ftime(&t); when.tv_sec = (CORBA::Long)t.time; when.tv_usec = (CORBA::Long)(t.millitm * 1000); when.tv_nsec = 0; #else struct timezone tz; struct timeval tv; gettimeofday(&tv,&tz); when.tv_sec = (CORBA::Long)tv.tv_sec; when.tv_usec = (CORBA::Long)tv.tv_usec; when.tv_nsec = 0; #endif } } //-------------------------------------------------------------------------------------------------------------------- // // method : // Attribute::check_alarm // // description : // Check if the attribute is in alarm // // retrun : // This method returns a boolean set to true if the atribute is in alarm. In this case, it also set the attribute // quality factor to ALARM // //--------------------------------------------------------------------------------------------------------------------- bool Attribute::check_alarm() { bool returned = false; // // Throw exception if no alarm is defined for this attribute // if (is_alarmed().none() == true) { TangoSys_OMemStream o; o << "No alarm defined for attribute " << name << ends; Except::throw_exception((const char *)API_AttrNoAlarm,o.str(), (const char *)"Attribute::check_alarm()"); } // // If the attribute quality is different than VALID don`t do any checking to avoid to override a user positioned // quality value. If no alarms levels are specified, just return without alarm. // if ( quality != Tango::ATTR_VALID ) { log_quality(); return returned; } // // Get the monitor protecting device att config // TangoMonitor &mon1 = get_att_device()->get_att_conf_monitor(); AutoTangoMonitor sync1(&mon1); // // If some alarm are defined on level, check attribute level // bitset &bs = is_alarmed(); if ((bs.test(Attribute::min_level) == true) || (bs.test(Attribute::max_level) == true)) { if (check_level_alarm() == true) returned = true; } if (returned == false) { if ((bs.test(Attribute::min_warn) == true) || (bs.test(Attribute::max_warn) == true)) { if (check_warn_alarm() == true) returned = true; } } // // If the RDS alarm is set, check attribute level // if ((bs.test(Attribute::rds) == true)) { if (check_rds_alarm() == true) returned = true; } log_quality(); return returned; } //--------------------------------------------------------------------------------------------------------------------- // // method : // Attribute::check_level_alarm // // description : // Check if the attribute is in alarm level // // return : // This method returns a boolean set to true if the atribute is in alarm. In this case, it also set the attribute // quality factor to ALARM // //--------------------------------------------------------------------------------------------------------------------- bool Attribute::check_level_alarm() { bool returned = false; bool real_returned = false; // // Check the min alarm if defined // long i; if (alarm_conf.test(min_level) == true) { switch (data_type) { case Tango::DEV_SHORT: if (check_scalar_wattribute() == true) { short tmp_val; if (date == false) tmp_val = (*value.sh_seq)[0]; else tmp_val = tmp_sh[0]; if (tmp_val <= min_alarm.sh) returned = true; } else { for (i = 0;i < data_size;i++) { if ((*value.sh_seq)[i] <= min_alarm.sh) { returned = true; break; } } } break; case Tango::DEV_LONG: if (check_scalar_wattribute() == true) { Tango::DevLong tmp_val; if (date == false) tmp_val = (*value.lg_seq)[0]; else tmp_val = tmp_lo[0]; if (tmp_val <= min_alarm.lg) returned = true; } else { for (i = 0;i < data_size;i++) { if ((*value.lg_seq)[i] <= min_alarm.lg) { returned = true; break; } } } break; case Tango::DEV_LONG64: if (check_scalar_wattribute() == true) { Tango::DevLong64 tmp_val; if (date == false) tmp_val = (*value.lg64_seq)[0]; else tmp_val = ext->tmp_lo64[0]; if (tmp_val <= min_alarm.lg64) returned = true; } else { for (i = 0;i < data_size;i++) { if ((*value.lg64_seq)[i] <= min_alarm.lg64) { returned = true; break; } } } break; case Tango::DEV_DOUBLE: if (check_scalar_wattribute() == true) { Tango::DevDouble tmp_val; if (date == false) tmp_val = (*value.db_seq)[0]; else tmp_val = tmp_db[0]; if (tmp_val <= min_alarm.db) returned = true; } else { for (i = 0;i < data_size;i++) { if ((*value.db_seq)[i] <= min_alarm.db) { returned = true; break; } } } break; case Tango::DEV_FLOAT: if (check_scalar_wattribute() == true) { Tango::DevFloat tmp_val; if (date == false) tmp_val = (*value.fl_seq)[0]; else tmp_val = tmp_fl[0]; if (tmp_val <= min_alarm.fl) returned = true; } else { for (i = 0;i < data_size;i++) { if ((*value.fl_seq)[i] <= min_alarm.fl) { returned = true; break; } } } break; case Tango::DEV_USHORT: if (check_scalar_wattribute() == true) { Tango::DevUShort tmp_val; if (date == false) tmp_val = (*value.ush_seq)[0]; else tmp_val = tmp_ush[0]; if (tmp_val <= min_alarm.ush) returned = true; } else { for (i = 0;i < data_size;i++) { if ((*value.ush_seq)[i] <= min_alarm.ush) { returned = true; break; } } } break; case Tango::DEV_UCHAR: if (check_scalar_wattribute() == true) { Tango::DevUChar tmp_val; if (date == false) tmp_val = (*value.cha_seq)[0]; else tmp_val = tmp_cha[0]; if (tmp_val <= min_alarm.uch) returned = true; } else { for (i = 0;i < data_size;i++) { if ((*value.cha_seq)[i] <= min_alarm.uch) { returned = true; break; } } } break; case Tango::DEV_ULONG64: if (check_scalar_wattribute() == true) { Tango::DevULong64 tmp_val; if (date == false) tmp_val = (*value.ulg64_seq)[0]; else tmp_val = ext->tmp_ulo64[0]; if (tmp_val <= min_alarm.ulg64) returned = true; } else { for (i = 0;i < data_size;i++) { if ((*value.ulg64_seq)[i] <= min_alarm.ulg64) { returned = true; break; } } } break; case Tango::DEV_ULONG: if (check_scalar_wattribute() == true) { Tango::DevULong tmp_val; if (date == false) tmp_val = (*value.ulg_seq)[0]; else tmp_val = ext->tmp_ulo[0]; if (tmp_val <= min_alarm.ulg) returned = true; } else { for (i = 0;i < data_size;i++) { if ((*value.ulg_seq)[i] <= min_alarm.ulg) { returned = true; break; } } } break; case Tango::DEV_ENCODED: if (check_scalar_wattribute() == true) { for (unsigned int i = 0;i < tmp_enc[0].encoded_data.length();i++) { if (tmp_enc[0].encoded_data[i] <= min_alarm.uch) { returned = true; break; } } } else { for (unsigned int i = 0;i < (*value.enc_seq)[0].encoded_data.length();i++) { if ((*value.enc_seq)[0].encoded_data[i] <= min_alarm.uch) { returned = true; break; } } } break; } if (returned == true) { quality = Tango::ATTR_ALARM; alarm.set(min_level); real_returned = true; } } // // Check the max alarm if defined // returned = false; if (alarm_conf.test(max_level) == true) { switch (data_type) { case Tango::DEV_SHORT: if (check_scalar_wattribute() == true) { Tango::DevShort tmp_val; if (date == false) tmp_val = (*value.sh_seq)[0]; else tmp_val = tmp_sh[0]; if (tmp_val >= max_alarm.sh) returned = true; } else { for (i = 0;i < data_size;i++) { if ((*value.sh_seq)[i] >= max_alarm.sh) { returned = true; break; } } } break; case Tango::DEV_LONG: if (check_scalar_wattribute() == true) { Tango::DevLong tmp_val; if (date == false) tmp_val = (*value.lg_seq)[0]; else tmp_val = tmp_lo[0]; if (tmp_val >= max_alarm.lg) returned = true; } else { for (i = 0;i < data_size;i++) { if ((*value.lg_seq)[i] >= max_alarm.lg) { returned = true; break; } } } break; case Tango::DEV_LONG64: if (check_scalar_wattribute() == true) { Tango::DevLong64 tmp_val; if (date == false) tmp_val = (*value.lg64_seq)[0]; else tmp_val = ext->tmp_lo64[0]; if (tmp_val >= max_alarm.lg64) returned = true; } else { for (i = 0;i < data_size;i++) { if ((*value.lg64_seq)[i] >= max_alarm.lg64) { returned = true; break; } } } break; case Tango::DEV_DOUBLE: if (check_scalar_wattribute() == true) { Tango::DevDouble tmp_val; if (date == false) tmp_val = (*value.db_seq)[0]; else tmp_val = tmp_db[0]; if (tmp_val >= max_alarm.db) returned = true; } else { for (i = 0;i < data_size;i++) { if ((*value.db_seq)[i] >= max_alarm.db) { returned = true; break; } } } break; case Tango::DEV_FLOAT: if (check_scalar_wattribute() == true) { Tango::DevFloat tmp_val; if (date == false) tmp_val = (*value.fl_seq)[0]; else tmp_val = tmp_fl[0]; if (tmp_val >= max_alarm.fl) returned = true; } else { for (i = 0;i < data_size;i++) { if ((*value.fl_seq)[i] >= max_alarm.fl) { returned = true; break; } } } break; case Tango::DEV_USHORT: if (check_scalar_wattribute() == true) { Tango::DevUShort tmp_val; if (date == false) tmp_val = (*value.ush_seq)[0]; else tmp_val = tmp_ush[0]; if (tmp_val >= max_alarm.ush) returned = true; } else { for (i = 0;i < data_size;i++) { if ((*value.ush_seq)[i] >= max_alarm.ush) { returned = true; break; } } } break; case Tango::DEV_UCHAR: if (check_scalar_wattribute() == true) { Tango::DevUChar tmp_val; if (date == false) tmp_val = (*value.cha_seq)[0]; else tmp_val = tmp_cha[0]; if (tmp_val >= max_alarm.uch) returned = true; } else { for (i = 0;i < data_size;i++) { if ((*value.cha_seq)[i] >= max_alarm.uch) { returned = true; break; } } } break; case Tango::DEV_ULONG: if (check_scalar_wattribute() == true) { Tango::DevULong tmp_val; if (date == false) tmp_val = (*value.ulg_seq)[0]; else tmp_val = ext->tmp_ulo[0]; if (tmp_val >= max_alarm.ulg) returned = true; } else { for (i = 0;i < data_size;i++) { if ((*value.ulg_seq)[i] >= max_alarm.ulg) { returned = true; break; } } } break; case Tango::DEV_ULONG64: if (check_scalar_wattribute() == true) { Tango::DevULong64 tmp_val; if (date == false) tmp_val = (*value.ulg64_seq)[0]; else tmp_val = ext->tmp_ulo64[0]; if (tmp_val >= max_alarm.ulg64) returned = true; } else { for (i = 0;i < data_size;i++) { if ((*value.ulg64_seq)[i] >= max_alarm.ulg64) { returned = true; break; } } } break; case Tango::DEV_ENCODED: if (check_scalar_wattribute() == true) { for (unsigned int i = 0;i < tmp_enc[0].encoded_data.length();i++) { if (tmp_enc[0].encoded_data[i] >= max_alarm.uch) { returned = true; break; } } } else { for (unsigned int i = 0;i < (*value.enc_seq)[0].encoded_data.length();i++) { if ((*value.enc_seq)[0].encoded_data[i] >= max_alarm.uch) { returned = true; break; } } } break; } if (returned == true) { quality = Tango::ATTR_ALARM; alarm.set(max_level); real_returned = true; } } return real_returned; } //--------------------------------------------------------------------------------------------------------------------- // // method : // Attribute::check_warn_alarm // // description : // Check if the attribute is in warning alarm // // return : // This method returns a boolean set to true if the atribute is in alarm. In this case, it also set the attribute // quality factor to ALARM // //--------------------------------------------------------------------------------------------------------------------- bool Attribute::check_warn_alarm() { bool returned = false; bool real_returned = false; // // Check the min warning if defined // long i; if (alarm_conf.test(min_warn) == true) { switch (data_type) { case Tango::DEV_SHORT: if (check_scalar_wattribute() == true) { Tango::DevShort tmp_val; tmp_val = date == false ? (*value.sh_seq)[0] : tmp_sh[0]; if (tmp_val <= min_warning.sh) { returned = true; } } else { for (i = 0;i < data_size;i++) { if ((*value.sh_seq)[i] <= min_warning.sh) { returned = true; break; } } } break; case Tango::DEV_LONG: if (check_scalar_wattribute() == true) { Tango::DevLong tmp_val; tmp_val = date == false ? (*value.lg_seq)[0] : tmp_lo[0]; if (tmp_val <= min_warning.lg) { returned = true; } } else { for (i = 0;i < data_size;i++) { if ((*value.lg_seq)[i] <= min_warning.lg) { returned = true; break; } } } break; case Tango::DEV_LONG64: if (check_scalar_wattribute() == true) { Tango::DevLong64 tmp_val; tmp_val = date == false ? (*value.lg64_seq)[0] : ext->tmp_lo64[0]; if (tmp_val <= min_warning.lg64) { returned = true; } } else { for (i = 0;i < data_size;i++) { if ((*value.lg64_seq)[i] <= min_warning.lg64) { returned = true; break; } } } break; case Tango::DEV_DOUBLE: if (check_scalar_wattribute() == true) { Tango::DevDouble tmp_val; tmp_val = date == false ? (*value.db_seq)[0] : tmp_db[0]; if (tmp_val <= min_warning.db) { returned = true; } } else { for (i = 0;i < data_size;i++) { if ((*value.db_seq)[i] <= min_warning.db) { returned = true; break; } } } break; case Tango::DEV_FLOAT: if (check_scalar_wattribute() == true) { Tango::DevFloat tmp_val; tmp_val = date == false ? (*value.fl_seq)[0] : tmp_fl[0]; if (tmp_val <= min_warning.fl) { returned = true; } } else { for (i = 0;i < data_size;i++) { if ((*value.fl_seq)[i] <= min_warning.fl) { returned = true; break; } } } break; case Tango::DEV_USHORT: if (check_scalar_wattribute() == true) { Tango::DevUShort tmp_val; tmp_val = date == false ? (*value.ush_seq)[0] : tmp_ush[0]; if (tmp_val <= min_warning.ush) { returned = true; } } else { for (i = 0;i < data_size;i++) { if ((*value.ush_seq)[i] <= min_warning.ush) { returned = true; break; } } } break; case Tango::DEV_UCHAR: if (check_scalar_wattribute() == true) { Tango::DevUChar tmp_val; tmp_val = date == false ? (*value.cha_seq)[0] : tmp_cha[0]; if (tmp_val <= min_warning.uch) { returned = true; } } else { for (i = 0;i < data_size;i++) { if ((*value.cha_seq)[i] <= min_warning.uch) { returned = true; break; } } } break; case Tango::DEV_ULONG: if (check_scalar_wattribute() == true) { Tango::DevULong tmp_val; tmp_val = date == false ? (*value.ulg_seq)[0] : ext->tmp_ulo[0]; if (tmp_val <= min_warning.ulg) { returned = true; } } else { for (i = 0;i < data_size;i++) { if ((*value.ulg_seq)[i] <= min_warning.ulg) { returned = true; break; } } } break; case Tango::DEV_ULONG64: if (check_scalar_wattribute() == true) { Tango::DevULong64 tmp_val; tmp_val = date == false ? (*value.ulg64_seq)[0] : ext->tmp_ulo64[0]; if (tmp_val <= min_warning.ulg64) { returned = true; } } else { for (i = 0;i < data_size;i++) { if ((*value.ulg64_seq)[i] <= min_warning.ulg64) { returned = true; break; } } } break; case Tango::DEV_ENCODED: if (check_scalar_wattribute() == true) { for (unsigned int i = 0;i < tmp_enc[0].encoded_data.length();i++) { Tango::DevUChar tmp_val; tmp_val = date == false ? (*value.enc_seq)[0].encoded_data[i] : tmp_enc[0].encoded_data[i]; if (tmp_val <= min_warning.uch) { returned = true; break; } } } else { for (unsigned int i = 0;i < (*value.enc_seq)[0].encoded_data.length();i++) { if ((*value.enc_seq)[0].encoded_data[i] <= min_warning.uch) { returned = true; break; } } } break; } if (returned == true) { quality = Tango::ATTR_WARNING; alarm.set(min_warn); real_returned = true; } } // // Check the max warning if defined // returned = false; if (alarm_conf.test(max_warn) == true) { switch (data_type) { case Tango::DEV_SHORT: if (check_scalar_wattribute() == true) { Tango::DevShort tmp_val; tmp_val = date == false ? (*value.sh_seq)[0] : tmp_sh[0]; if (tmp_val >= max_warning.sh) { returned = true; } } else { for (i = 0;i < data_size;i++) { if ((*value.sh_seq)[i] >= max_warning.sh) { returned = true; break; } } } break; case Tango::DEV_LONG: if (check_scalar_wattribute() == true) { Tango::DevLong tmp_val; tmp_val = date == false ? (*value.lg_seq)[0] : tmp_lo[0]; if (tmp_val >= max_warning.lg) { returned = true; } } else { for (i = 0;i < data_size;i++) { if ((*value.lg_seq)[i] >= max_warning.lg) { returned = true; break; } } } break; case Tango::DEV_LONG64: if (check_scalar_wattribute() == true) { Tango::DevLong64 tmp_val; tmp_val = date == false ? (*value.lg64_seq)[0] : ext->tmp_lo64[0]; if (tmp_val >= max_warning.lg64) { returned = true; } } else { for (i = 0;i < data_size;i++) { if ((*value.lg64_seq)[i] >= max_warning.lg64) { returned = true; break; } } } break; case Tango::DEV_DOUBLE: if (check_scalar_wattribute() == true) { Tango::DevDouble tmp_val; tmp_val = date == false ? (*value.db_seq)[0] : tmp_db[0]; if (tmp_val >= max_warning.db) { returned = true; } } else { for (i = 0;i < data_size;i++) { if ((*value.db_seq)[i] >= max_warning.db) { returned = true; break; } } } break; case Tango::DEV_FLOAT: if (check_scalar_wattribute() == true) { Tango::DevFloat tmp_val; tmp_val = date == false ? (*value.fl_seq)[0] : tmp_fl[0]; if (tmp_val >= max_warning.fl) { returned = true; } } else { for (i = 0;i < data_size;i++) { if ((*value.fl_seq)[i] >= max_warning.fl) { returned = true; break; } } } break; case Tango::DEV_USHORT: if (check_scalar_wattribute() == true) { Tango::DevUShort tmp_val; tmp_val = date == false ? (*value.ush_seq)[0] : tmp_ush[0]; if (tmp_val >= max_warning.ush) { returned = true; } } else { for (i = 0;i < data_size;i++) { if ((*value.ush_seq)[i] >= max_warning.ush) { returned = true; break; } } } break; case Tango::DEV_UCHAR: if (check_scalar_wattribute() == true) { Tango::DevUChar tmp_val; tmp_val = date == false ? (*value.cha_seq)[0] : tmp_cha[0]; if (tmp_val >= max_warning.uch) { returned = true; } } else { for (i = 0;i < data_size;i++) { if ((*value.cha_seq)[i] >= max_warning.uch) { returned = true; break; } } } break; case Tango::DEV_ULONG: if (check_scalar_wattribute() == true) { Tango::DevULong tmp_val; tmp_val = date == false ? (*value.ulg_seq)[0] : ext->tmp_ulo[0]; if (tmp_val >= max_warning.ulg) { returned = true; } } else { for (i = 0;i < data_size;i++) { if ((*value.ulg_seq)[i] >= max_warning.ulg) { returned = true; break; } } } break; case Tango::DEV_ULONG64: if (check_scalar_wattribute() == true) { Tango::DevULong64 tmp_val; tmp_val = date == false ? (*value.ulg64_seq)[0] : ext->tmp_ulo64[0]; if (tmp_val >= max_warning.ulg64) { returned = true; } } else { for (i = 0;i < data_size;i++) { if ((*value.ulg64_seq)[i] >= max_warning.ulg64) { returned = true; break; } } } break; case Tango::DEV_ENCODED: if (check_scalar_wattribute() == true) { for (unsigned int i = 0;i < tmp_enc[0].encoded_data.length();i++) { Tango::DevUChar tmp_val; tmp_val = date == false ? (*value.enc_seq)[0].encoded_data[i] : tmp_enc[0].encoded_data[i]; if (tmp_val >= max_warning.uch) { returned = true; break; } } } else { for (unsigned int i = 0;i < (*value.enc_seq)[0].encoded_data.length();i++) { if ((*value.enc_seq)[0].encoded_data[i] >= max_warning.uch) { returned = true; break; } } } break; } if (returned == true) { quality = Tango::ATTR_WARNING; alarm.set(max_warn); real_returned = true; } } return real_returned; } //--------------------------------------------------------------------------------------------------------------------- // // method : // Attribute::check_scalar_wattribute // // description : // Check whether the attribute is a READ_WRITE or READ_WITH_WRITE scalar attribute. // //-------------------------------------------------------------------------------------------------------------------- bool Attribute::check_scalar_wattribute() { if ((writable == Tango::READ_WRITE) || (writable == Tango::READ_WITH_WRITE)) { if (data_format == Tango::SCALAR) return true; } return false; } //-------------------------------------------------------------------------------------------------------------------- // // method : // Attribute::delete_seq // // description : // Delete the sequence created to store attribute value. In case of a read_attributes CORBA operation, // this delete will be done automatically because the sequence is inserted in an CORBA::Any object which will // delete the sequence when it is destroyed. This method is usefull only to delete the sequence // created in case of the attribute is read during a DevState command to evaluate device state // //-------------------------------------------------------------------------------------------------------------------- void Attribute::delete_seq() { switch (data_type) { case Tango::DEV_SHORT: delete value.sh_seq; break; case Tango::DEV_LONG: delete value.lg_seq; break; case Tango::DEV_LONG64: delete value.lg64_seq; break; case Tango::DEV_DOUBLE: delete value.db_seq; break; case Tango::DEV_STRING: delete value.str_seq; break; case Tango::DEV_FLOAT: delete value.fl_seq; break; case Tango::DEV_USHORT: delete value.ush_seq; break; case Tango::DEV_UCHAR: delete value.cha_seq; break; case Tango::DEV_BOOLEAN: delete value.boo_seq; break; case Tango::DEV_ULONG: delete value.ulg_seq; break; case Tango::DEV_ULONG64: delete value.ulg64_seq; break; case Tango::DEV_STATE: delete value.state_seq; break; case Tango::DEV_ENCODED: delete value.enc_seq; break; } } //-------------------------------------------------------------------------------------------------------------------- // // method : // Attribute::add_write_value // // description : // These methods add the associated writable attribute value to the read attribute buffer and create a // sequence from the attribute internal buffer // // argument : // in : // - val_ptr : The associated write attribute value // //-------------------------------------------------------------------------------------------------------------------- void Attribute::add_write_value(Tango::DevVarShortArray *val_ptr) { if (data_format == Tango::SCALAR) { tmp_sh[1] = (*val_ptr)[0]; value.sh_seq = new Tango::DevVarShortArray(data_size + 1,data_size + 1,tmp_sh,false); } else { long nb_read = value.sh_seq->length(); value.sh_seq->length(nb_read + val_ptr->length()); for (unsigned int k = 0;k < val_ptr->length();k++) (*value.sh_seq)[nb_read + k] = (*val_ptr)[k]; } } void Attribute::add_write_value(Tango::DevVarLongArray *val_ptr) { if (data_format == Tango::SCALAR) { tmp_lo[1] = (*val_ptr)[0]; value.lg_seq = new Tango::DevVarLongArray(data_size + 1,data_size + 1,tmp_lo,false); } else { long nb_read = value.lg_seq->length(); value.lg_seq->length(nb_read + val_ptr->length()); for (unsigned int k = 0;k < val_ptr->length();k++) (*value.lg_seq)[nb_read + k] = (*val_ptr)[k]; } } void Attribute::add_write_value(Tango::DevVarLong64Array *val_ptr) { if (data_format == Tango::SCALAR) { ext->tmp_lo64[1] = (*val_ptr)[0]; value.lg64_seq = new Tango::DevVarLong64Array(data_size + 1,data_size + 1,ext->tmp_lo64,false); } else { long nb_read = value.lg64_seq->length(); value.lg64_seq->length(nb_read + val_ptr->length()); for (unsigned int k = 0;k < val_ptr->length();k++) (*value.lg64_seq)[nb_read + k] = (*val_ptr)[k]; } } void Attribute::add_write_value(Tango::DevVarDoubleArray *val_ptr) { if (data_format == Tango::SCALAR) { tmp_db[1] = (*val_ptr)[0]; value.db_seq = new Tango::DevVarDoubleArray(data_size + 1,data_size + 1,tmp_db,false); } else { long nb_read = value.db_seq->length(); value.db_seq->length(nb_read + val_ptr->length()); for (unsigned int k = 0;k < val_ptr->length();k++) (*value.db_seq)[nb_read + k] = (*val_ptr)[k]; } } void Attribute::add_write_value(Tango::DevVarStringArray *val_ptr) { if (data_format == Tango::SCALAR) { if (ext->scalar_str_attr_release == true) { char **strvec = Tango::DevVarStringArray::allocbuf(2); strvec[0] = tmp_str[0]; strvec[1] = CORBA::string_dup((*val_ptr)[0]); value.str_seq = new Tango::DevVarStringArray(2,2,strvec,true); } else { tmp_str[1] = (*val_ptr)[0]; value.str_seq = new Tango::DevVarStringArray(data_size + 1,data_size + 1,tmp_str,false); } } else { long nb_read = value.str_seq->length(); value.str_seq->length(nb_read + val_ptr->length()); for (unsigned int k = 0;k < val_ptr->length();k++) (*value.str_seq)[nb_read + k] = CORBA::string_dup((*val_ptr)[k]); } } void Attribute::add_write_value(Tango::DevVarFloatArray *val_ptr) { if (data_format == Tango::SCALAR) { tmp_fl[1] = (*val_ptr)[0]; value.fl_seq = new Tango::DevVarFloatArray(data_size + 1,data_size + 1,tmp_fl,false); } else { long nb_read = value.fl_seq->length(); value.fl_seq->length(nb_read + val_ptr->length()); for (unsigned int k = 0;k < val_ptr->length();k++) (*value.fl_seq)[nb_read + k] = (*val_ptr)[k]; } } void Attribute::add_write_value(Tango::DevVarBooleanArray *val_ptr) { if (data_format == Tango::SCALAR) { tmp_boo[1] = (*val_ptr)[0]; value.boo_seq = new Tango::DevVarBooleanArray(data_size + 1,data_size + 1,tmp_boo,false); } else { long nb_read = value.boo_seq->length(); value.boo_seq->length(nb_read + val_ptr->length()); for (unsigned int k = 0;k < val_ptr->length();k++) (*value.boo_seq)[nb_read + k] = (*val_ptr)[k]; } } void Attribute::add_write_value(Tango::DevVarUShortArray *val_ptr) { if (data_format == Tango::SCALAR) { tmp_ush[1] = (*val_ptr)[0]; value.ush_seq = new Tango::DevVarUShortArray(data_size + 1,data_size + 1,tmp_ush,false); } else { long nb_read = value.ush_seq->length(); value.ush_seq->length(nb_read + val_ptr->length()); for (unsigned int k = 0;k < val_ptr->length();k++) (*value.ush_seq)[nb_read + k] = (*val_ptr)[k]; } } void Attribute::add_write_value(Tango::DevVarCharArray *val_ptr) { if (data_format == Tango::SCALAR) { tmp_cha[1] = (*val_ptr)[0]; value.cha_seq = new Tango::DevVarCharArray(data_size + 1,data_size + 1,tmp_cha,false); } else { long nb_read = value.cha_seq->length(); value.cha_seq->length(nb_read + val_ptr->length()); for (unsigned int k = 0;k < val_ptr->length();k++) (*value.cha_seq)[nb_read + k] = (*val_ptr)[k]; } } void Attribute::add_write_value(Tango::DevVarULongArray *val_ptr) { if (data_format == Tango::SCALAR) { ext->tmp_ulo[1] = (*val_ptr)[0]; value.ulg_seq = new Tango::DevVarULongArray(data_size + 1,data_size + 1,ext->tmp_ulo,false); } else { long nb_read = value.ulg_seq->length(); value.ulg_seq->length(nb_read + val_ptr->length()); for (unsigned int k = 0;k < val_ptr->length();k++) (*value.ulg_seq)[nb_read + k] = (*val_ptr)[k]; } } void Attribute::add_write_value(Tango::DevVarULong64Array *val_ptr) { if (data_format == Tango::SCALAR) { ext->tmp_ulo64[1] = (*val_ptr)[0]; value.ulg64_seq = new Tango::DevVarULong64Array(data_size + 1,data_size + 1,ext->tmp_ulo64,false); } else { long nb_read = value.ulg64_seq->length(); value.ulg64_seq->length(nb_read + val_ptr->length()); for (unsigned int k = 0;k < val_ptr->length();k++) (*value.ulg64_seq)[nb_read + k] = (*val_ptr)[k]; } } void Attribute::add_write_value(Tango::DevVarStateArray *val_ptr) { if (data_format == Tango::SCALAR) { ext->tmp_state[1] = (*val_ptr)[0]; value.state_seq = new Tango::DevVarStateArray(data_size + 1,data_size + 1,ext->tmp_state,false); } else { long nb_read = value.state_seq->length(); value.state_seq->length(nb_read + val_ptr->length()); for (unsigned int k = 0;k < val_ptr->length();k++) (*value.state_seq)[nb_read + k] = (*val_ptr)[k]; } } void Attribute::add_write_value(Tango::DevEncoded &val_ref) { tmp_enc[1] = val_ref; value.enc_seq = new Tango::DevVarEncodedArray(data_size + 1,data_size + 1,tmp_enc,false); } //-------------------------------------------------------------------------------------------------------------------- // // method : // Attribute::Attribute_2_AttributeValue // // description : // Build an AttributeValue_3 object from the Attribute object content // // argument : // in : // - ptr : Pointer to the AttributeValue_3 object to be filled in. // - dev : The device to which the attribute belongs to // //--------------------------------------------------------------------------------------------------------------------- void Attribute::Attribute_2_AttributeValue(Tango::AttributeValue_3 *ptr,Tango::DeviceImpl *dev) { if ((name_lower == "state") || (name_lower == "status")) { ptr->quality = Tango::ATTR_VALID; CORBA::Any &a = ptr->value; if (name_lower == "state") { a <<= dev->get_state(); } else { Tango::DevVarStringArray str_seq(1); str_seq.length(1); str_seq[0] = CORBA::string_dup(dev->get_status().c_str()); a <<= str_seq; } #ifdef _TG_WINDOWS_ struct _timeb t; _ftime(&t); ptr->time.tv_sec = (long)t.time; ptr->time.tv_usec = (long)(t.millitm * 1000); ptr->time.tv_nsec = 0; #else struct timeval after; gettimeofday(&after,NULL); ptr->time.tv_sec = after.tv_sec; ptr->time.tv_usec = after.tv_usec; ptr->time.tv_nsec = 0; #endif ptr->r_dim.dim_x = 1; ptr->r_dim.dim_y = 0; ptr->w_dim.dim_x = 0; ptr->w_dim.dim_y = 0; ptr->name = CORBA::string_dup(name.c_str()); } else { if (quality != Tango::ATTR_INVALID) { MultiAttribute *m_attr = dev->get_device_attr(); // Add the attribute setpoint to the value sequence if ((writable == Tango::READ_WRITE) || (writable == Tango::READ_WITH_WRITE)) { m_attr->add_write_value(*this); } // check for alarms to position the data quality value. if ( is_alarmed().any() == true ) { check_alarm(); } Tango::DevVarShortArray *sh_seq; Tango::DevShort *sh_tmp_ptr; Tango::DevVarLongArray *lo_seq; Tango::DevLong *lo_tmp_ptr; Tango::DevVarDoubleArray *db_seq; Tango::DevDouble *db_tmp_ptr; Tango::DevVarStringArray *str_seq; Tango::DevString *str_tmp_ptr; Tango::DevVarFloatArray *fl_seq; Tango::DevFloat *fl_tmp_ptr; Tango::DevVarBooleanArray *bo_seq; Tango::DevBoolean *bo_tmp_ptr; Tango::DevVarUShortArray *ush_seq; Tango::DevUShort *ush_tmp_ptr; Tango::DevVarUCharArray *uch_seq; Tango::DevUChar *uch_tmp_ptr; Tango::DevVarLong64Array *lo64_seq; Tango::DevLong64 *lo64_tmp_ptr; Tango::DevVarULongArray *ulo_seq; Tango::DevULong *ulo_tmp_ptr; Tango::DevVarULong64Array *ulo64_seq; Tango::DevULong64 *ulo64_tmp_ptr; Tango::DevVarStateArray *state_seq; Tango::DevState *state_tmp_ptr; CORBA::Any &a = ptr->value; long seq_length = value.sh_seq->length(); switch (data_type) { case Tango::DEV_SHORT : sh_tmp_ptr = get_short_value()->get_buffer(); sh_seq = new Tango::DevVarShortArray(seq_length,seq_length,sh_tmp_ptr,false); a <<= *sh_seq; delete sh_seq; break; case Tango::DEV_LONG : lo_tmp_ptr = get_long_value()->get_buffer(); lo_seq = new Tango::DevVarLongArray(seq_length,seq_length,lo_tmp_ptr,false); a <<= *lo_seq; delete lo_seq; break; case Tango::DEV_LONG64 : lo64_tmp_ptr = get_long64_value()->get_buffer(); lo64_seq = new Tango::DevVarLong64Array(seq_length,seq_length,lo64_tmp_ptr,false); a <<= *lo64_seq; delete lo64_seq; break; case Tango::DEV_DOUBLE : db_tmp_ptr = get_double_value()->get_buffer(); db_seq = new Tango::DevVarDoubleArray(seq_length,seq_length,db_tmp_ptr,false); a <<= *db_seq; delete db_seq; break; case Tango::DEV_STRING : str_tmp_ptr = get_string_value()->get_buffer(); str_seq = new Tango::DevVarStringArray(seq_length,seq_length,str_tmp_ptr,false); a <<= *str_seq; delete str_seq; break; case Tango::DEV_FLOAT : fl_tmp_ptr = get_float_value()->get_buffer(); fl_seq = new Tango::DevVarFloatArray(seq_length,seq_length,fl_tmp_ptr,false); a <<= *fl_seq; delete fl_seq; break; case Tango::DEV_BOOLEAN : bo_tmp_ptr = get_boolean_value()->get_buffer(); bo_seq = new Tango::DevVarBooleanArray(seq_length,seq_length,bo_tmp_ptr,false); a <<= *bo_seq; delete bo_seq; break; case Tango::DEV_USHORT : ush_tmp_ptr = get_ushort_value()->get_buffer(); ush_seq = new Tango::DevVarUShortArray(seq_length,seq_length,ush_tmp_ptr,false); a <<= *ush_seq; delete ush_seq; break; case Tango::DEV_UCHAR : uch_tmp_ptr = get_uchar_value()->get_buffer(); uch_seq = new Tango::DevVarUCharArray(seq_length,seq_length,uch_tmp_ptr,false); a <<= *uch_seq; delete uch_seq; break; case Tango::DEV_ULONG : ulo_tmp_ptr = get_ulong_value()->get_buffer(); ulo_seq = new Tango::DevVarULongArray(seq_length,seq_length,ulo_tmp_ptr,false); a <<= *ulo_seq; delete ulo_seq; break; case Tango::DEV_ULONG64 : ulo64_tmp_ptr = get_ulong64_value()->get_buffer(); ulo64_seq = new Tango::DevVarULong64Array(seq_length,seq_length,ulo64_tmp_ptr,false); a <<= *ulo64_seq; delete ulo64_seq; break; case Tango::DEV_STATE : state_tmp_ptr = get_state_value()->get_buffer(); state_seq = new Tango::DevVarStateArray(seq_length,seq_length,state_tmp_ptr,false); a <<= *state_seq; delete state_seq; break; } ptr->r_dim.dim_x = dim_x; ptr->r_dim.dim_y = dim_y; if ((writable == Tango::READ_WRITE) || (writable == Tango::READ_WITH_WRITE)) { WAttribute &assoc_att = m_attr->get_w_attr_by_ind(get_assoc_ind()); ptr->w_dim.dim_x = assoc_att.get_w_dim_x(); ptr->w_dim.dim_y = assoc_att.get_w_dim_y(); } else { ptr->w_dim.dim_x = 0; ptr->w_dim.dim_y = 0; } } else { ptr->r_dim.dim_x = 0; ptr->r_dim.dim_y = 0; ptr->w_dim.dim_x = 0; ptr->w_dim.dim_y = 0; } ptr->time = when; ptr->quality = quality; ptr->name = CORBA::string_dup(name.c_str()); } } void Attribute::Attribute_2_AttributeValue(Tango::AttributeValue_4 *ptr_4,Tango::DeviceImpl *dev) { if ((name_lower == "state") || (name_lower == "status")) { ptr_4->quality = Tango::ATTR_VALID; if (name_lower == "state") { ptr_4->value.dev_state_att(dev->get_state()); } else { Tango::DevVarStringArray str_seq(1); str_seq.length(1); str_seq[0] = CORBA::string_dup(dev->get_status().c_str()); ptr_4->value.string_att_value(str_seq); } #ifdef _TG_WINDOWS_ struct _timeb t; _ftime(&t); ptr_4->time.tv_sec = (long)t.time; ptr_4->time.tv_usec = (long)(t.millitm * 1000); ptr_4->time.tv_nsec = 0; #else struct timeval after; gettimeofday(&after,NULL); ptr_4->time.tv_sec = after.tv_sec; ptr_4->time.tv_usec = after.tv_usec; ptr_4->time.tv_nsec = 0; #endif ptr_4->r_dim.dim_x = 1; ptr_4->r_dim.dim_y = 0; ptr_4->w_dim.dim_x = 0; ptr_4->w_dim.dim_y = 0; ptr_4->name = CORBA::string_dup(name.c_str()); ptr_4->data_format = data_format; } else { if (quality != Tango::ATTR_INVALID) { MultiAttribute *m_attr = dev->get_device_attr(); // Add the attribute setpoint to the value sequence if ((writable == Tango::READ_WRITE) || (writable == Tango::READ_WITH_WRITE)) { m_attr->add_write_value(*this); } // check for alarms to position the data quality value. if ( is_alarmed().any() == true ) { check_alarm(); } Tango::AttributeValueList_4 dummy_list(1,1,ptr_4,false); dev->data_into_net_object(*this,(Tango::AttributeValueList_3 *)NULL,&dummy_list,0,writable,false); ptr_4->r_dim.dim_x = dim_x; ptr_4->r_dim.dim_y = dim_y; if ((writable == Tango::READ_WRITE) || (writable == Tango::READ_WITH_WRITE)) { WAttribute &assoc_att = m_attr->get_w_attr_by_ind(get_assoc_ind()); ptr_4->w_dim.dim_x = assoc_att.get_w_dim_x(); ptr_4->w_dim.dim_y = assoc_att.get_w_dim_y(); } else { ptr_4->w_dim.dim_x = 0; ptr_4->w_dim.dim_y = 0; } } else { ptr_4->r_dim.dim_x = 0; ptr_4->r_dim.dim_y = 0; ptr_4->w_dim.dim_x = 0; ptr_4->w_dim.dim_y = 0; ptr_4->value.union_no_data(true); } ptr_4->time = when; ptr_4->quality = quality; ptr_4->data_format = data_format; ptr_4->name = CORBA::string_dup(name.c_str()); } } //--------------------------------------------------------------------------------------------------------------------- // // method : // Attribute::AttributeValue_4_2_AttributeValue_3 // // description : // Build an AttributeValue_3 object from the AttributeValue_4 object. This method is used in case an event is // requested by a client knowing only IDL release 3 // // argument : // in : // - ptr_4 : Pointer to the AttributeValue_4 object // - ptr_3 : Pointer to the AttributeValue_3 object to be filled in // //-------------------------------------------------------------------------------------------------------------------- void Attribute::AttributeValue_4_2_AttributeValue_3(const Tango::AttributeValue_4 *ptr_4,Tango::AttributeValue_3 *ptr_3) { // // First copy the data // if (ptr_4->quality != Tango::ATTR_INVALID) { switch (ptr_4->value._d()) { case ATT_BOOL: { const DevVarBooleanArray &tmp_seq = ptr_4->value.bool_att_value(); ptr_3->value <<= tmp_seq; } break; case ATT_SHORT: { const DevVarShortArray &tmp_seq = ptr_4->value.short_att_value(); ptr_3->value <<= tmp_seq; } break; case ATT_LONG: { const DevVarLongArray &tmp_seq = ptr_4->value.long_att_value(); ptr_3->value <<= tmp_seq; } break; case ATT_LONG64: { const DevVarLong64Array &tmp_seq = ptr_4->value.long64_att_value(); ptr_3->value <<= tmp_seq; } break; case ATT_FLOAT: { const DevVarFloatArray &tmp_seq = ptr_4->value.float_att_value(); ptr_3->value <<= tmp_seq; } break; case ATT_DOUBLE: { const DevVarDoubleArray &tmp_seq = ptr_4->value.double_att_value(); ptr_3->value <<= tmp_seq; } break; case ATT_UCHAR: { const DevVarCharArray &tmp_seq = ptr_4->value.uchar_att_value(); ptr_3->value <<= tmp_seq; } break; case ATT_USHORT: { const DevVarUShortArray &tmp_seq = ptr_4->value.ushort_att_value(); ptr_3->value <<= tmp_seq; } break; case ATT_ULONG: { const DevVarULongArray &tmp_seq = ptr_4->value.ulong_att_value(); ptr_3->value <<= tmp_seq; } break; case ATT_ULONG64: { const DevVarULong64Array &tmp_seq = ptr_4->value.ulong64_att_value(); ptr_3->value <<= tmp_seq; } break; case ATT_STRING: { const DevVarStringArray &tmp_seq = ptr_4->value.string_att_value(); ptr_3->value <<= tmp_seq; } break; case ATT_STATE: { const DevVarStateArray &tmp_seq = ptr_4->value.state_att_value(); ptr_3->value <<= tmp_seq; } break; case DEVICE_STATE: { const DevState &sta = ptr_4->value.dev_state_att(); ptr_3->value <<= sta; } break; case ATT_ENCODED: { const DevVarEncodedArray &tmp_seq = ptr_4->value.encoded_att_value(); ptr_3->value <<= tmp_seq; } break; case NO_DATA: break; } } // // The remaining fields // ptr_3->time = ptr_4->time; ptr_3->quality = ptr_4->quality; ptr_3->name = ptr_4->name; ptr_3->r_dim = ptr_4->r_dim; ptr_3->w_dim = ptr_4->w_dim; ptr_3->err_list = ptr_4->err_list; } //--------------------------------------------------------------------------------------------------------------------- // // method : // Attribute::fire_change_event // // description : // Fire a change change event for the attribute value. // // argument : // in : // - except : Pointer to a DevFailed exception to fire in case of an error to indicate. // //-------------------------------------------------------------------------------------------------------------------- void Attribute::fire_change_event(DevFailed *except) { cout4 << "Attribute::fire_change_event() entring ..." << endl; if ( except != NULL ) { set_value_flag(false); } // // Check if it is needed to send an event // Tango::AttributeValue_3 *send_attr = NULL; Tango::AttributeValue_4 *send_attr_4 = NULL; try { time_t now; int change_subscription; now = time(NULL); change_subscription = (int)now - ext->event_change_subscription; if (change_subscription > EVENT_RESUBSCRIBE_PERIOD) { if ( (name_lower != "state") && (name_lower != "status")) { // delete the data values allocated in the attribute bool data_flag = get_value_flag(); if ( data_flag == true ) { // For writable scalar attributes the sequence for the // attribute data is not yet allocated. This will happen // only when adding the set point! if ( !check_scalar_wattribute() ) { if (quality != Tango::ATTR_INVALID) delete_seq(); set_value_flag (false); } } } return; } // // Get the event supplier, and simply return if not created // EventSupplier *event_supplier_nd = NULL; EventSupplier *event_supplier_zmq = NULL; Tango::Util *tg = Util::instance(); if (use_notifd_event() == true) event_supplier_nd = tg->get_notifd_event_supplier(); if (use_zmq_event() == true) event_supplier_zmq = tg->get_zmq_event_supplier(); if ((event_supplier_nd == NULL) && (event_supplier_zmq == NULL)) { if ( name_lower != "state" ) { // delete the data values allocated in the attribute bool data_flag = get_value_flag(); if ( data_flag == true ) { // For writable scalar attributes the sequence for the // attribute data is not yet allcoated. This will happen // only when adding the set point! if ( !check_scalar_wattribute() ) { if (quality != Tango::ATTR_INVALID) delete_seq(); set_value_flag (false); } } } return; } // // Retrieve device object if not already done // if (ext->dev == NULL) ext->dev = tg->get_device_by_name(ext->d_name); if ( except == NULL ) { // // Check that the attribute value has been set // if ((name_lower != "state") && (name_lower != "status")) { if (quality != Tango::ATTR_INVALID) { if (value_flag == false) { TangoSys_OMemStream o; o << "Value for attribute "; o << name; o << " has not been updated. Can't send change event\n"; o << "Set the attribute value (using set_value(...) method) before!" << ends; Except::throw_exception((const char *)API_AttrValueNotSet,o.str(), (const char *)"Attribute::fire_change_event()"); } } } } // // Build one AttributeValue_3 or AttributeValue_4 object // try { if (ext->dev->get_dev_idl_version() >= 4) { if (ext->event_change_client_3 == true) send_attr = new Tango::AttributeValue_3; else send_attr_4 = new Tango::AttributeValue_4; } else send_attr = new Tango::AttributeValue_3; } catch (bad_alloc) { Except::throw_exception((const char *)API_MemoryAllocation, (const char *)"Can't allocate memory in server", (const char *)"Attribute::fire_change_event()"); } // // Don`t try to access the attribute data when an exception was indicated // if ( except == NULL ) { if (send_attr != NULL) Attribute_2_AttributeValue(send_attr,ext->dev); else Attribute_2_AttributeValue(send_attr_4,ext->dev); } // // Create the structure used to send data to event system // EventSupplier::AttributeData ad; ::memset(&ad,0,sizeof(ad)); // // Fire event // if ( is_check_change_criteria() == true ) { if (send_attr != NULL) ad.attr_val_3 = send_attr; else ad.attr_val_4 = send_attr_4; // // Eventually push the event (if detected) // When we have both notifd and zmq event supplier, do not detect the event two times. The detect_and_push_events() // method returns true if the event is detected. // bool send_event = false; if (event_supplier_nd != NULL) send_event = event_supplier_nd->detect_and_push_change_event(ext->dev,ad,*this,name,except,true); if (event_supplier_zmq != NULL) { if (event_supplier_nd != NULL) { if (send_event == true) { vector f_names; vector f_data; vector f_names_lg; vector f_data_lg; event_supplier_zmq->push_event(ext->dev,"change",f_names,f_data,f_names_lg,f_data_lg,ad,name,except); } } else event_supplier_zmq->detect_and_push_change_event(ext->dev,ad,*this,name,except,true); } } else { // // Send event, if the read_attribute failed or if it is the first time that the read_attribute succeed after a failure. // Same thing if the attribute quality factor changes to INVALID // // This is done only to be able to set-up the same filters with events comming with the standard mechanism or coming // from a manual fire event call. // bool force_change = false; bool quality_change = false; if ((except != NULL) || (quality == Tango::ATTR_INVALID) || ((except == NULL) && (ext->prev_change_event.err == true)) || ((quality != Tango::ATTR_INVALID) && (ext->prev_change_event.quality == Tango::ATTR_INVALID))) { force_change = true; } vector filterable_names; vector filterable_data; vector filterable_names_lg; vector filterable_data_lg; if (except != NULL) { ext->prev_change_event.err = true; ext->prev_change_event.except = *except; } else { Tango::AttrQuality the_quality; if (send_attr_4 != NULL) { the_quality = send_attr_4->quality; ext->prev_change_event.value_4 = send_attr_4->value; } else { the_quality = send_attr->quality; ext->prev_change_event.value = send_attr->value; } if (ext->prev_change_event.quality != the_quality) { quality_change = true; } ext->prev_change_event.quality = the_quality; ext->prev_change_event.err = false; } ext->prev_change_event.inited = true; filterable_names.push_back("forced_event"); if (force_change == true) filterable_data.push_back((double)1.0); else filterable_data.push_back((double)0.0); filterable_names.push_back("quality"); if (quality_change == true) filterable_data.push_back((double)1.0); else filterable_data.push_back((double)0.0); if (send_attr != NULL) ad.attr_val_3 = send_attr; else ad.attr_val_4 = send_attr_4; // // Finally push the event(s) // if (event_supplier_nd != NULL) event_supplier_nd->push_event(ext->dev, "change", filterable_names, filterable_data, filterable_names_lg, filterable_data_lg, ad, name, except); if (event_supplier_zmq != NULL) event_supplier_zmq->push_event(ext->dev, "change", filterable_names, filterable_data, filterable_names_lg, filterable_data_lg, ad, name, except); } // // Return allocated memory // if (send_attr != NULL) delete send_attr; else delete send_attr_4; // // Delete the data values allocated in the attribute // if ( (name_lower != "state") && (name_lower != "status") ) { bool data_flag = get_value_flag(); if ( data_flag == true ) { if (quality != Tango::ATTR_INVALID) delete_seq(); set_value_flag (false); } } } catch (...) { if (send_attr != NULL) delete send_attr; else delete send_attr_4; if ( (name_lower != "state") && (name_lower != "status")) { // delete the data values allocated in the attribute bool data_flag = get_value_flag(); if ( data_flag == true ) { if (quality != Tango::ATTR_INVALID) delete_seq(); set_value_flag (false); } } throw; } } //--------------------------------------------------------------------------------------------------------------------- // // method : // Attribute::fire_archive_event // // description : // Fire a archive change event for the attribute value. // // argument : // in : // - except : Pointer to a DevFailed exception to fire in case of an error to indicate. // //-------------------------------------------------------------------------------------------------------------------- void Attribute::fire_archive_event(DevFailed *except) { cout4 << "Attribute::fire_archive_event() entring ..." << endl; if ( except != NULL ) { set_value_flag (false); } // // Check if it is needed to send an event // Tango::AttributeValue_3 *send_attr = NULL; Tango::AttributeValue_4 *send_attr_4 = NULL; try { time_t now; int archive_subscription; now = time(NULL); archive_subscription = (int)now - ext->event_archive_subscription; if (archive_subscription > EVENT_RESUBSCRIBE_PERIOD) { if ( (name_lower != "state") && (name_lower != "status") ) { // // Delete the data values allocated in the attribute // bool data_flag = get_value_flag(); if ( data_flag == true ) { // // For writable scalar attributes the sequence for the attribute data is not yet allcoated. This will happen // only when adding the set point! // if ( !check_scalar_wattribute() ) { if (quality != Tango::ATTR_INVALID) delete_seq(); set_value_flag (false); } } } return; } // // Get the event supplier, and simply return if not created // EventSupplier *event_supplier_nd = NULL; EventSupplier *event_supplier_zmq = NULL; Tango::Util *tg = Util::instance(); if (use_notifd_event() == true) event_supplier_nd = tg->get_notifd_event_supplier(); if (use_zmq_event() == true) event_supplier_zmq = tg->get_zmq_event_supplier(); if ((event_supplier_nd == NULL) && (event_supplier_zmq == NULL)) { if ( name_lower != "state" ) { // // Delete the data values allocated in the attribute // bool data_flag = get_value_flag(); if ( data_flag == true ) { // // For writable scalar attributes the sequence for the attribute data is not yet allocated. This will happen // only when adding the set point! // if ( !check_scalar_wattribute() ) { if (quality != Tango::ATTR_INVALID) delete_seq(); set_value_flag (false); } } } return; } // // Retrieve device object if not already done // if (ext->dev == NULL) ext->dev = tg->get_device_by_name(ext->d_name); if ( except == NULL ) { // // Check that the attribute value has been set // if ((name_lower != "state") && (name_lower != "status")) { if (quality != Tango::ATTR_INVALID) { if (value_flag == false) { TangoSys_OMemStream o; o << "Value for attribute "; o << name; o << " has not been updated. Can't send archive event\n"; o << "Set the attribute value (using set_value(...) method) before!" << ends; Except::throw_exception((const char *)API_AttrValueNotSet,o.str(), (const char *)"Attribute::fire_archive_event()"); } } } } // // Build one AttributeValue_3 or AttributeValue_4 object // try { if (ext->dev->get_dev_idl_version() >= 4) { if (ext->event_archive_client_3 == true) send_attr = new Tango::AttributeValue_3; else send_attr_4 = new Tango::AttributeValue_4; } else send_attr = new Tango::AttributeValue_3; } catch (bad_alloc) { Except::throw_exception((const char *)API_MemoryAllocation, (const char *)"Can't allocate memory in server", (const char *)"Attribute::fire_archive_event()"); } // // Don`t try to access the attribute data when an exception was indicated // if ( except == NULL ) { if (send_attr != NULL) Attribute_2_AttributeValue(send_attr,ext->dev); else Attribute_2_AttributeValue(send_attr_4,ext->dev); } // // Create the structure used to send data to event system // EventSupplier::AttributeData ad; ::memset(&ad,0,sizeof(ad)); if (send_attr != NULL) ad.attr_val_3 = send_attr; else ad.attr_val_4 = send_attr_4; // // Fire event // if ( is_check_archive_criteria() == true ) { #ifdef _TG_WINDOWS_ struct _timeb now_win; #endif struct timeval now_timeval; #ifdef _TG_WINDOWS_ _ftime(&now_win); now_timeval.tv_sec = (unsigned long)now_win.time; now_timeval.tv_usec = (long)now_win.millitm * 1000; #else gettimeofday(&now_timeval,NULL); #endif // // Eventually push the event (if detected) // When we have both notifd and zmq event supplier, do not detect the event two times. The detect_and_push_events() // method returns true if the event is detected. // bool send_event = false; if (event_supplier_nd != NULL) send_event = event_supplier_nd->detect_and_push_archive_event(ext->dev,ad,*this,name,except,&now_timeval,true); if (event_supplier_zmq != NULL) { if (event_supplier_nd != NULL) { if (send_event == true) { vector f_names; vector f_data; vector f_names_lg; vector f_data_lg; event_supplier_zmq->push_event(ext->dev,"archive",f_names,f_data,f_names_lg,f_data_lg,ad,name,except); } } else event_supplier_zmq->detect_and_push_archive_event(ext->dev,ad,*this,name,except,&now_timeval,true); } } else { // // Execute detect_change only to calculate the delta_change_rel and delta_change_abs and force_change ! // bool force_change = false; bool quality_change = false; double delta_change_rel = 0.0; double delta_change_abs = 0.0; if (event_supplier_nd != NULL) event_supplier_nd->detect_change(*this, ad,true, delta_change_rel, delta_change_abs, except, force_change, ext->dev); else if (event_supplier_zmq != NULL) event_supplier_zmq->detect_change(*this, ad,true, delta_change_rel, delta_change_abs, except, force_change, ext->dev); vector filterable_names; vector filterable_data; vector filterable_names_lg; vector filterable_data_lg; if (except != NULL) { ext->prev_archive_event.err = true; ext->prev_archive_event.except = *except; } else { Tango::AttrQuality the_quality; if (send_attr_4 != NULL) { ext->prev_archive_event.value_4 = send_attr_4->value; the_quality = send_attr_4->quality; } else { ext->prev_archive_event.value = send_attr->value; the_quality = send_attr->quality; } if (ext->prev_archive_event.quality != the_quality) { quality_change = true; } ext->prev_archive_event.quality = the_quality; ext->prev_archive_event.err = false; } ext->prev_archive_event.inited = true; filterable_names.push_back("forced_event"); if (force_change == true) filterable_data.push_back((double)1.0); else filterable_data.push_back((double)0.0); filterable_names.push_back("quality"); if (quality_change == true) filterable_data.push_back((double)1.0); else filterable_data.push_back((double)0.0); filterable_names.push_back("counter"); filterable_data_lg.push_back(-1); filterable_names.push_back("delta_change_rel"); filterable_data.push_back(delta_change_rel); filterable_names.push_back("delta_change_abs"); filterable_data.push_back(delta_change_abs); if (event_supplier_nd != NULL) event_supplier_nd->push_event(ext->dev, "archive", filterable_names, filterable_data, filterable_names_lg, filterable_data_lg, ad, name, except); if (event_supplier_zmq != NULL) event_supplier_zmq->push_event(ext->dev, "archive", filterable_names, filterable_data, filterable_names_lg, filterable_data_lg, ad, name, except); } if (send_attr != NULL) delete send_attr; else delete send_attr_4; // // Delete the data values allocated in the attribute // if ((name_lower != "state") && (name_lower != "status")) { bool data_flag = get_value_flag(); if ( data_flag == true ) { if (quality != Tango::ATTR_INVALID) delete_seq(); set_value_flag (false); } } } catch (...) { if (send_attr != NULL) delete send_attr; else delete send_attr_4; // // Delete the data values allocated in the attribute // if ((name_lower != "state") && (name_lower != "status")) { bool data_flag = get_value_flag(); if ( data_flag == true ) { if (quality != Tango::ATTR_INVALID) delete_seq(); set_value_flag (false); } } throw; } } //--------------------------------------------------------------------------------------------------------------------- // // method : // Attribute::fire_event // // description : // Fire a user event for the attribute value. // // argument : // in : // - filt_names : The filterable fields name // - filt_vals : The filterable fields value (as double) // - except : Pointer to a DevFailed exception to fire in case of an error to indicate. // //-------------------------------------------------------------------------------------------------------------------- void Attribute::fire_event(vector &filt_names,vector &filt_vals,DevFailed *except) { cout4 << "Attribute::fire_event() entring ..." << endl; if (except != NULL) set_value_flag(false); Tango::AttributeValue_3 *send_attr = NULL; Tango::AttributeValue_4 *send_attr_4 = NULL; // // Check if it is needed to send an event // try { // // Get the event supplier, and simply return if not created // EventSupplier *event_supplier_nd = NULL; EventSupplier *event_supplier_zmq = NULL; Tango::Util *tg = Util::instance(); if (use_notifd_event() == true) event_supplier_nd = tg->get_notifd_event_supplier(); if (use_zmq_event() == true) event_supplier_zmq = tg->get_zmq_event_supplier(); if ((event_supplier_nd == NULL) && (event_supplier_zmq == NULL)) { if (name_lower != "state") { // // Delete the data values allocated in the attribute // bool data_flag = get_value_flag(); if ( data_flag == true ) { // // For writable scalar attributes the sequence for the attribute data is not yet allcoated. This will happen // only when adding the set point! // if ( !check_scalar_wattribute() ) { if (quality != Tango::ATTR_INVALID) delete_seq(); set_value_flag (false); } } } return; } // // Retrieve device object if not already done // if (ext->dev == NULL) ext->dev = tg->get_device_by_name(ext->d_name); if (except == NULL) { // // Check that the attribute value has been set // if ((name_lower != "state") && (name_lower != "status")) { if (quality != Tango::ATTR_INVALID) { if (value_flag == false) { TangoSys_OMemStream o; o << "Value for attribute "; o << name; o << " has not been updated. Can't send user event\n"; o << "Set the attribute value (using set_value(...) method) before!" << ends; Except::throw_exception((const char *)API_AttrValueNotSet,o.str(), (const char *)"Attribute::fire_event()"); } } } } // // Build one AttributeValue_3 or AttributeValue_4 object // try { if (ext->dev->get_dev_idl_version() >= 4) { if (ext->event_user_client_3 == true) send_attr = new Tango::AttributeValue_3; else send_attr_4 = new Tango::AttributeValue_4; } else send_attr = new Tango::AttributeValue_3; } catch (bad_alloc) { Except::throw_exception((const char *)API_MemoryAllocation, (const char *)"Can't allocate memory in server", (const char *)"Attribute::fire_event()"); } // // don`t try to access the attribute data when an exception was indicated // if ( except == NULL ) { if (send_attr != NULL) Attribute_2_AttributeValue(send_attr,ext->dev); else Attribute_2_AttributeValue(send_attr_4,ext->dev); } // // Create the structure used to send data to event system // EventSupplier::AttributeData ad; ::memset(&ad,0,sizeof(ad)); if (send_attr != NULL) ad.attr_val_3 = send_attr; else ad.attr_val_4 = send_attr_4; // // Fire event // vector filterable_names_lg; vector filterable_data_lg; if (event_supplier_nd != NULL) event_supplier_nd->push_event(ext->dev, "user_event", filt_names, filt_vals, filterable_names_lg, filterable_data_lg, ad, name, except); if (event_supplier_zmq != NULL) event_supplier_zmq->push_event(ext->dev, "user_event", filt_names, filt_vals, filterable_names_lg, filterable_data_lg, ad, name, except); if (send_attr != NULL) delete send_attr; else delete send_attr_4; // // delete the data values allocated in the attribute // if ((name_lower != "state") && (name_lower != "status")) { bool data_flag = get_value_flag(); if ( data_flag == true ) { if (quality != Tango::ATTR_INVALID) delete_seq(); set_value_flag (false); } } } catch (...) { if (send_attr != NULL) delete send_attr; else delete send_attr_4; // // delete the data values allocated in the attribute // if ((name_lower != "state") && (name_lower != "status")) { bool data_flag = get_value_flag(); if ( data_flag == true ) { if (quality != Tango::ATTR_INVALID) delete_seq(); set_value_flag (false); } } throw; } } //-------------------------------------------------------------------------------------------------------------------- // // method : // Attribute::set_quality // // description : // Set the attribute quality factor // //-------------------------------------------------------------------------------------------------------------------- void Attribute::set_quality(Tango::AttrQuality qua,bool send_event) { quality = qua; if (send_event == true) fire_change_event(); } //+----------------------------------------------------------------------------------------------------------------- // // method : // Attribute::upd_att_prop_db // // description : // Update the tango database with the new attribute values // //------------------------------------------------------------------------------------------------------------------- void Attribute::upd_att_prop_db(Tango::Attr_CheckVal &new_value, const char *prop_name) { cout4 << "Entering upd_att_prop_db method for attribute " << name <<", property = " << prop_name << endl; // // Build the data sent to database // Tango::DbData db_data; Tango::DbDatum att(name),prop(prop_name); att << (short)1; switch (data_type) { case Tango::DEV_SHORT: prop << new_value.sh; break; case Tango::DEV_LONG: prop << new_value.lg; break; case Tango::DEV_LONG64: prop << new_value.lg64; break; case Tango::DEV_DOUBLE: prop << new_value.db; break; case Tango::DEV_FLOAT: prop << new_value.fl; break; case Tango::DEV_USHORT: prop << new_value.ush; break; case Tango::DEV_UCHAR: prop << new_value.uch; break; case Tango::DEV_ULONG: prop << new_value.ulg; break; case Tango::DEV_ULONG64: prop << new_value.ulg64; break; case Tango::DEV_STATE: prop << (short)new_value.d_sta; break; } db_data.push_back(att); db_data.push_back(prop); // // Implement a reconnection schema. The first exception received if the db server is down is a COMM_FAILURE exception. // Following exception received from following calls are TRANSIENT exception // Tango::Util *tg = Tango::Util::instance(); bool retry = true; while (retry == true) { try { tg->get_database()->put_device_attribute_property(ext->d_name,db_data); retry = false; } catch (CORBA::COMM_FAILURE) { tg->get_database()->reconnect(true); } } } //-------------------------------------------------------------------------------------------------------------------- // // method : // Attribute::remove_configuration() // // description : // Remove the attribute configuration from the database. This method can be used to clean-up all the configuration // of an attribute to come back to its default values or the remove all configuration of a dynamic attribute // before deleting it. // // The method removes all configured attribute properties and removes the attribute from the list of polled // attributes. // //-------------------------------------------------------------------------------------------------------------------- void Attribute::remove_configuration() { cout4 << "Entering remove_configuration() method for attribute " << name << endl; Tango::Util *tg = Tango::Util::instance(); // // read all configured properties of the attribute from the database and delete them! // DbData db_read_data; DbData db_delete_data; db_read_data.push_back(DbDatum(name)); db_delete_data.push_back(DbDatum(name)); // // Implement a reconnection schema. The first exception received if the db server is down is a COMM_FAILURE exception. // Following exception received from following calls are TRANSIENT exception // bool retry = true; while (retry == true) { try { tg->get_database()->get_device_attribute_property(ext->d_name,db_read_data); retry = false; } catch (CORBA::COMM_FAILURE) { tg->get_database()->reconnect(true); } } long nb_prop = 0; db_read_data[0] >> nb_prop; for (int k=1; k<(nb_prop + 1); k++) { string &prop_name = db_read_data[k].name; db_delete_data.push_back(DbDatum(prop_name)); } // // Implement a reconnection schema. The first exception received if the db server is down is a COMM_FAILURE exception. // Following exception received from following calls are TRANSIENT exception // if ( nb_prop > 0 ) { retry = true; while (retry == true) { try { tg->get_database()->delete_device_attribute_property(ext->d_name,db_delete_data); retry = false; } catch (CORBA::COMM_FAILURE) { tg->get_database()->reconnect(true); } } } } //------------------------------------------------------------------------------------------------------------------- // // method : // Attribute::get_att_device // // description : // Return a pointer to the attribute device // //-------------------------------------------------------------------------------------------------------------------- DeviceImpl *Attribute::get_att_device() { if (ext->dev == NULL) { Tango::Util *tg = Tango::Util::instance(); ext->dev = tg->get_device_by_name(ext->d_name); } return ext->dev; } //-------------------------------------------------------------------------------------------------------------------- // // method : // Attribute::set_attr_serial_method // // description : // Set attribute serialization method // // argument : // in : // - ser_model : The serial model // //--------------------------------------------------------------------------------------------------------------------- void Attribute::set_attr_serial_model(AttrSerialModel ser_model) { if (ser_model == Tango::ATTR_BY_USER) { Tango::Util *tg = Tango::Util::instance(); if (tg->get_serial_model() != Tango::BY_DEVICE) { Except::throw_exception((const char *)API_AttrNotAllowed, (const char *)"Attribute serial model by user is not allowed when the process is not in BY_DEVICE serialization model", (const char *)"Attribute::set_attr_serial_model"); } } ext->attr_serial_model=ser_model; } //-------------------------------------------------------------------------------------------------------------------- // // method : // Attribute::get_att_device_class // // description : // Return a pointer to the attribute device class // // argument : // in : // - dev_name : // //-------------------------------------------------------------------------------------------------------------------- DeviceClass *Attribute::get_att_device_class(string &dev_name) { // // Get device class // When the server is started, it's an easy task . When the server is in its starting phase, it's more tricky // Get from the DeviceClass list the first one for which the device factory method has not yet been fully executed. // This is the DeviceClass with the device in its init_device() method has called Attribute::set_properties() // Tango::Util *tg = Tango::Util::instance(); Tango::DeviceClass *dev_class = NULL; if (tg->is_svr_starting() == false && tg->is_device_restarting(ext->d_name) == false) { Tango::DeviceImpl *dev = get_att_device(); dev_class = dev->get_device_class(); } else { const vector &tmp_cl_list = *tg->get_class_list(); size_t loop; for (loop = 0;loop < tmp_cl_list.size();++loop) { if (tmp_cl_list[loop]->get_device_factory_done() == false) break; } if (loop != tmp_cl_list.size()) { dev_class = tmp_cl_list[loop]; } else { TangoSys_OMemStream o; o << "Device " << dev_name << "-> Attribute : " << name; o << "\nCan't retrieve device class!" << ends; Except::throw_exception((const char *)API_CantRetrieveClass, o.str(), (const char *)"Attribute::set_properties()"); } } return dev_class; } //-------------------------------------------------------------------------------------------------------------------- // // method : // Attribute::log_quality // // description : // Send a logging message (on the device) when the attribute quality factor changes // //--------------------------------------------------------------------------------------------------------------------- void Attribute::log_quality() { // // Set device if not already done // if (ext->dev == NULL) { Tango::Util *tg = Tango::Util::instance(); ext->dev = tg->get_device_by_name(ext->d_name); } // // Log something if the new quality is different than the old one // if (quality != ext->old_quality) { if (alarm.any() == false) { // // No alarm detected // switch(quality) { case ATTR_INVALID: if (ext->dev->get_logger()->is_error_enabled()) ext->dev->get_logger()->error_stream() << log4tango::LogInitiator::_begin_log << "INVALID quality for attribute " << name << endl; break; case ATTR_CHANGING: if (ext->dev->get_logger()->is_info_enabled()) ext->dev->get_logger()->info_stream() << log4tango::LogInitiator::_begin_log << "CHANGING quality for attribute " << name << endl; break; case ATTR_VALID: if (ext->dev->get_logger()->is_info_enabled()) ext->dev->get_logger()->info_stream() << log4tango::LogInitiator::_begin_log << "VALID quality for attribute " << name << endl; break; default: break; } } else { // // Different log according to which alarm is set // if (alarm[min_level] == true) { if (ext->dev->get_logger()->is_error_enabled()) ext->dev->get_logger()->error_stream() << log4tango::LogInitiator::_begin_log << "MIN ALARM for attribute " << name << endl; } else if (alarm[max_level] == true) { if (ext->dev->get_logger()->is_error_enabled()) ext->dev->get_logger()->error_stream() << log4tango::LogInitiator::_begin_log << "MAX ALARM for attribute " << name << endl; } else if (alarm[rds] == true) { if (ext->dev->get_logger()->is_warn_enabled()) ext->dev->get_logger()->warn_stream() << log4tango::LogInitiator::_begin_log << "RDS (Read Different Set) ALARM for attribute " << name << endl; } else if (alarm[min_warn] == true) { if (ext->dev->get_logger()->is_warn_enabled()) ext->dev->get_logger()->warn_stream() << log4tango::LogInitiator::_begin_log << "MIN WARNING for attribute " << name << endl; } else if (alarm[max_warn] == true) { if (ext->dev->get_logger()->is_warn_enabled()) ext->dev->get_logger()->warn_stream() << log4tango::LogInitiator::_begin_log << "MAX WARNING for attribute " << name << endl; } } } else { // // The quality is the same but may be the alarm has changed // if (alarm != ext->old_alarm) { if (alarm[min_level] == true) { if (ext->dev->get_logger()->is_error_enabled()) ext->dev->get_logger()->error_stream() << log4tango::LogInitiator::_begin_log << "MIN ALARM for attribute " << name << endl; } else if (alarm[max_level] == true) { if (ext->dev->get_logger()->is_error_enabled()) ext->dev->get_logger()->error_stream() << log4tango::LogInitiator::_begin_log << "MAX ALARM for attribute " << name << endl; } else if (alarm[rds] == true) { if (ext->dev->get_logger()->is_warn_enabled()) ext->dev->get_logger()->warn_stream() << log4tango::LogInitiator::_begin_log << "RDS (Read Different Set) ALARM for attribute " << name << endl; } else if (alarm[min_warn] == true) { if (ext->dev->get_logger()->is_warn_enabled()) ext->dev->get_logger()->warn_stream() << log4tango::LogInitiator::_begin_log << "MIN WARNING for attribute " << name << endl; } else if (alarm[max_warn] == true) { if (ext->dev->get_logger()->is_warn_enabled()) ext->dev->get_logger()->warn_stream() << log4tango::LogInitiator::_begin_log << "MAX WARNING for attribute " << name << endl; } } } } //---------------------------------------------------------------------------------------------------------------------- // // method : // Attribute::avns_in_db() // // description : // Store in db the famous AVNS (AlrmValueNotSpec) for a specific attribute property // // argument : // in : // - prop_name : Property name // //-------------------------------------------------------------------------------------------------------------------- void Attribute::avns_in_db(const char *prop_name,string &dev_name) { Tango::Util *tg = Tango::Util::instance(); if (Tango::Util::_UseDb == true) { DbDatum attr_dd(name), prop_dd(prop_name); attr_dd << 1L; prop_dd << AlrmValueNotSpec; DbData db_data; db_data.push_back(attr_dd); db_data.push_back(prop_dd); bool retry = true; while (retry == true) { try { tg->get_database()->put_device_attribute_property(dev_name,db_data); retry = false; } catch (CORBA::COMM_FAILURE) { tg->get_database()->reconnect(true); } } } } //--------------------------------------------------------------------------------------------------------------------- // // method : // Attribute::avns_in_att() // // description : // Store in att the famous AVNS (AlrmValueNotSpec) for a specific attribute property // // argument : // in : // - pt : Property type // //--------------------------------------------------------------------------------------------------------------------- void Attribute::avns_in_att(prop_type pt) { Tango::Util *tg = Tango::Util::instance(); Tango::TangoMonitor *mon_ptr = NULL; if (tg->is_svr_starting() == false && tg->is_device_restarting(ext->d_name) == false) mon_ptr = &(get_att_device()->get_att_conf_monitor()); { AutoTangoMonitor sync1(mon_ptr); switch (pt) { case MIN_VALUE: check_min_value = false; min_value_str = AlrmValueNotSpec; break; case MAX_VALUE: check_max_value = false; max_value_str = AlrmValueNotSpec; break; case MIN_WARNING: min_warning_str = AlrmValueNotSpec; break; case MAX_WARNING: max_warning_str = AlrmValueNotSpec; break; case MIN_ALARM: min_alarm_str = AlrmValueNotSpec; break; case MAX_ALARM: max_alarm_str = AlrmValueNotSpec; break; default: break; } if (tg->is_svr_starting() == false && tg->is_device_restarting(ext->d_name) == false) get_att_device()->push_att_conf_event(this); } } //--------------------------------------------------------------------------------------------------------------------- // // method : // Attribute::set_format_notspec() // // description : // Set the attribute format property to the default value which depends on attribute data type // //-------------------------------------------------------------------------------------------------------------------- void Attribute::set_format_notspec() { switch (data_type) { case DEV_SHORT: case DEV_LONG: case DEV_LONG64: case DEV_UCHAR: case DEV_USHORT: case DEV_ULONG: case DEV_ULONG64: format = FormatNotSpec_INT; break; case DEV_STRING: format = FormatNotSpec_STR; break; case DEV_STATE: case DEV_ENCODED: case DEV_BOOLEAN: format = AlrmValueNotSpec; break; case DEV_FLOAT: case DEV_DOUBLE: format = FormatNotSpec_FL; break; default: break; } } //--------------------------------------------------------------------------------------------------------------------- // // method : // Attribute::is_format_notspec() // // description : // Set the attribute format property to the default value which depends on attribute data type // // argument : // in : // - format : The format property string // // return : // This method retruns true if the format string is the default value // //-------------------------------------------------------------------------------------------------------------------- bool Attribute::is_format_notspec(const char *format) { bool ret = false; switch (data_type) { case DEV_SHORT: case DEV_LONG: case DEV_LONG64: case DEV_UCHAR: case DEV_USHORT: case DEV_ULONG: case DEV_ULONG64: if (TG_strcasecmp(format,FormatNotSpec_INT) == 0) ret = true; break; case DEV_STRING: if (TG_strcasecmp(format,FormatNotSpec_STR) == 0) ret = true; break; case DEV_STATE: case DEV_ENCODED: case DEV_BOOLEAN: if (TG_strcasecmp(format,AlrmValueNotSpec) == 0) ret = true; break; case DEV_FLOAT: case DEV_DOUBLE: if (TG_strcasecmp(format,FormatNotSpec_FL) == 0) ret = true; break; default: break; } return ret; } //--------------------------------------------------------------------------------------------------------------------- // // method : // Attribute::def_format_in_dbdatum() // // description : // Insert the default format string in a DbDatum instance. This default value depends on the attribute // data type // // argument : // in : // - db : Reference to the DbDatum object // //-------------------------------------------------------------------------------------------------------------------- void Attribute::def_format_in_dbdatum(DbDatum &db) { switch (data_type) { case DEV_SHORT: case DEV_LONG: case DEV_LONG64: case DEV_UCHAR: case DEV_USHORT: case DEV_ULONG: case DEV_ULONG64: db << FormatNotSpec_INT; break; case DEV_STRING: db << FormatNotSpec_STR; break; case DEV_STATE: case DEV_ENCODED: case DEV_BOOLEAN: db << AlrmValueNotSpec; break; case DEV_FLOAT: case DEV_DOUBLE: db << FormatNotSpec_FL; break; default: break; } } //------------------------------------------------------------------------------------------------------------------- // // operator overloading : // << // // description : // Friend function to ease printing instance of the Attribute class // //-------------------------------------------------------------------------------------------------------------------- #ifndef TANGO_HAS_LOG4TANGO ostream &operator<<(ostream &o_str,Attribute &p) { Tango::AttributeConfig conf; // // Get attribute properties // p.get_properties(conf); // // Print all these properties // cout << "Attribute name = " << conf.name.in() << endl; cout << "Attribute data_type = "; switch (conf.data_type) { case Tango::DEV_SHORT : cout << "Tango::DevShort" << endl; break; case Tango::DEV_LONG : cout << "Tango::DevLong" << endl; break; case Tango::DEV_LONG64 : cout << "Tango::DevLong64" << endl; break; case Tango::DEV_DOUBLE : cout << "Tango::DevDouble" << endl; break; case Tango::DEV_STRING : cout << "Tango::DevString" << endl; break; case Tango::DEV_FLOAT : cout << "Tango::DevFloat" << endl; break; case Tango::DEV_USHORT : cout << "Tango::DevUShort" << endl; break; case Tango::DEV_UCHAR : cout << "Tango::DevUChar" << endl; break; case Tango::DEV_BOOLEAN : cout << "Tango::DevBoolean" << endl; break; case Tango::DEV_STATE : cout << "Tango::DevState" << endl; break; case Tango::DEV_ULONG : cout << "Tango::DevULong" << endl; break; case Tango::DEV_ULONG64 : cout << "Tango::DevULong64" << endl; break; case Tango::Dev_ENCODED : cout << "Tango::DevEncoded" << endl; break; } cout << "Attribute data_format = "; switch (conf.data_format) { case Tango::SCALAR : cout << "scalar" << endl; break; case Tango::SPECTRUM : cout << "spectrum, max_dim_x = " << conf.max_dim_x << endl; break; case Tango::IMAGE : cout << "image, max_dim_x = " << conf.max_dim_x << ", max_dim_y = " << conf.max_dim_y << endl; break; } if ((conf.writable == Tango::WRITE) || (conf.writable == Tango::READ_WRITE)) cout << "Attribute is writable" << endl; else cout << "Attribute is not writable" << endl; cout << "Attribute label = " << conf.label.in() << endl; cout << "Attribute description = " << conf.description.in() << endl; cout << "Attribute unit = " << conf.unit.in(); cout << ", standard unit = " << conf.standard_unit.in(); cout << ", display unit = " << conf.display_unit.in() << endl; cout << "Attribute format = " << conf.format.in() << endl; cout << "Attribute min value = " << conf.min_value.in() << endl; cout << "Attribute max value = " << conf.max_value.in() << endl; cout << "Attribute min alarm = " << conf.min_alarm.in() << endl; cout << "Attribute max alarm = " << conf.max_alarm.in() << endl; cout << "Attribute writable_attr_name = " << conf.writable_attr_name.in() << endl; return o_str; } #endif // TANGO_HAS_LOG4TANGO } // End of Tango namespace tango-8.1.2c+dfsg.orig/lib/cpp/server/w_attribute.cpp0000644000175000017500000033662012205375142021501 0ustar piccapiccastatic const char *RcsId = "$Id: w_attribute.cpp 22302 2013-03-22 08:28:27Z taurel $\n$Name$"; //+============================================================================ // // file : w_attribute.cpp // // description : C++ source code for the WAttribute class. // This class is used to manage attribute. // A Tango Device object instance has one // MultiAttribute object which is an aggregate of // Attribute or WAttribute objects // // project : TANGO // // author(s) : E.Taurel // // Copyright (C) : 2004,2005,2006,2007,2008,2009,2010,2011,2012,2013 // European Synchrotron Radiation Facility // BP 220, Grenoble 38043 // FRANCE // // This file is part of Tango. // // Tango 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. // // Tango 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 Tango. If not, see . // // $Revision: 22302 $ // //-============================================================================ #if HAVE_CONFIG_H #include #endif #include #include #include #include #include #include #ifdef _TG_WINDOWS_ #include #include #include #else #include #endif /* _TG_WINDOWS_ */ #include namespace Tango { //+------------------------------------------------------------------------- // // method : WAttribute::WAttribute // // description : constructor for the WAttribute class from the // attribute property vector, its type and the device // name // // argument : in : - prop_list : The attribute property list // - type : The attrubute data type // - dev_name : The device name // //-------------------------------------------------------------------------- WAttribute::WAttribute(vector &prop_list, Attr &tmp_attr,string &dev_name,long idx) :Attribute(prop_list,tmp_attr,dev_name,idx), long_ptr(NULL),double_ptr(NULL),str_ptr(NULL),float_ptr(NULL), boolean_ptr(NULL),ushort_ptr(NULL),uchar_ptr(NULL),encoded_ptr(NULL), string_allocated(false),memorized(false),memorized_init(true),w_ext(new WAttributeExt) { // // Init some data // short_val = old_short_val = 0; long_val = old_long_val = 0; double_val = old_double_val = 0.0; float_val = old_float_val = 0.0; boolean_val = old_boolean_val = true; ushort_val = old_ushort_val = 0; uchar_val = old_uchar_val = 0; w_ext->long64_val = w_ext->old_long64_val = 0; w_ext->ulong_val = w_ext->old_ulong_val = 0; w_ext->ulong64_val = w_ext->old_ulong64_val = 0; w_ext->dev_state_val = w_ext->old_dev_state_val = Tango::UNKNOWN; str_val = CORBA::string_dup("Not initialised"); old_str_val = CORBA::string_dup("Not initialised"); encoded_val.encoded_data.length(0); encoded_val.encoded_format = CORBA::string_dup("Not initialised"); old_encoded_val.encoded_data.length(0); old_encoded_val.encoded_format = CORBA::string_dup("Not initialised"); short_array_val.length(1); short_array_val[0] = 0; long_array_val.length(1); long_array_val[0] = 0; double_array_val.length(1); double_array_val[0] = 0.0; str_array_val.length(1); str_array_val[0] = CORBA::string_dup("Not initialised"); float_array_val.length(1); float_array_val[0] = 0.0; boolean_array_val.length(1); boolean_array_val[0] = true; ushort_array_val.length(1); ushort_array_val[0] = 0; uchar_array_val.length(1); uchar_array_val[0] = 0; w_ext->long64_array_val.length(1); w_ext->long64_array_val[0] = 0; w_ext->ulong_array_val.length(1); w_ext->ulong_array_val[0] = 0; w_ext->ulong64_array_val.length(1); w_ext->ulong64_array_val[0] = 0; w_ext->state_array_val.length(1); w_ext->state_array_val[0] = Tango::UNKNOWN; short_ptr = &short_val; w_dim_x = 1; w_dim_y = 0; write_date.tv_sec = write_date.tv_usec = 0; // // Init memorized field and eventually get the memorized value // set_memorized(tmp_attr.get_memorized()); set_memorized_init(tmp_attr.get_memorized_init()); if (is_memorized() == true) { try { mem_value = get_attr_value(prop_list,MemAttrPropName); } catch (Tango::DevFailed) { mem_value = MemNotUsed; } } } //+------------------------------------------------------------------------- // // method : WAttribute::~WAttribute // // description : destructor for the WAttribute class // //-------------------------------------------------------------------------- WAttribute::~WAttribute() { #ifndef HAS_UNIQUE_PTR delete w_ext; #endif CORBA::string_free(str_val); CORBA::string_free(old_str_val); // CORBA::string_free(encoded_val.encoded_format); // CORBA::string_free(old_encoded_val.encoded_format); } //+------------------------------------------------------------------------- // // method : WAttribute::set_rvalue // // description : This method is used when a Writable attribute is // set to set the value in the Attribute class. This // is necessary for the read_attribute CORBA operation // which takes its data from this internal Attribute // class data. // It is used in the read_attributes code in the // device class // //-------------------------------------------------------------------------- void WAttribute::set_rvalue() { switch(data_type) { case Tango::DEV_SHORT: if (data_format == Tango::SCALAR) set_value(&short_val,1,0,false); else set_value(const_cast(short_array_val.get_buffer()),w_dim_x,w_dim_y,false); break; case Tango::DEV_LONG: if (data_format == Tango::SCALAR) set_value(&long_val,1,0,false); else set_value(const_cast(long_array_val.get_buffer()),w_dim_x,w_dim_y,false); break; case Tango::DEV_LONG64: if (data_format == Tango::SCALAR) set_value(&w_ext->long64_val,1,0,false); else set_value(const_cast(w_ext->long64_array_val.get_buffer()),w_dim_x,w_dim_y,false); break; case Tango::DEV_DOUBLE: if (data_format == Tango::SCALAR) set_value(&double_val,1,0,false); else set_value(const_cast(double_array_val.get_buffer()),w_dim_x,w_dim_y,false); break; case Tango::DEV_STRING: if (data_format == Tango::SCALAR) set_value(&str_val,1,0,false); else set_value(const_cast(str_array_val.get_buffer()),w_dim_x,w_dim_y,false); break; case Tango::DEV_FLOAT: if (data_format == Tango::SCALAR) set_value(&float_val,1,0,false); else set_value(const_cast(float_array_val.get_buffer()),w_dim_x,w_dim_y,false); break; case Tango::DEV_BOOLEAN: if (data_format == Tango::SCALAR) set_value(&boolean_val,1,0,false); else set_value(const_cast(boolean_array_val.get_buffer()),w_dim_x,w_dim_y,false); break; case Tango::DEV_USHORT: if (data_format == Tango::SCALAR) set_value(&ushort_val,1,0,false); else set_value(const_cast(ushort_array_val.get_buffer()),w_dim_x,w_dim_y,false); break; case Tango::DEV_UCHAR: if (data_format == Tango::SCALAR) set_value(&uchar_val,1,0,false); else set_value(const_cast(uchar_array_val.get_buffer()),w_dim_x,w_dim_y,false); break; case Tango::DEV_ULONG: if (data_format == Tango::SCALAR) set_value(&w_ext->ulong_val,1,0,false); else set_value(const_cast(w_ext->ulong_array_val.get_buffer()),w_dim_x,w_dim_y,false); break; case Tango::DEV_ULONG64: if (data_format == Tango::SCALAR) set_value(&w_ext->ulong64_val,1,0,false); else set_value(const_cast(w_ext->ulong64_array_val.get_buffer()),w_dim_x,w_dim_y,false); break; case Tango::DEV_ENCODED: set_value(&encoded_val,1,0,false); break; } } //+------------------------------------------------------------------------- // // method : WAttribute::check_written_value // // description : Check the value sent by the caller and copy incoming data // for SCALAR attribute only // // in : any : Reference to the CORBA Any object // //-------------------------------------------------------------------------- void WAttribute::check_written_value(const CORBA::Any &any,unsigned long x,unsigned long y) { CORBA::ULong nb_data; unsigned long i; // // If the server is in its starting phase, gives a NULL ptr // to the AutoLock object // Tango::Util *tg = Tango::Util::instance(); Tango::TangoMonitor *mon_ptr = NULL; if (tg->is_svr_starting() == false && tg->is_device_restarting(ext->d_name) == false) mon_ptr = &(get_att_device()->get_att_conf_monitor()); switch (data_type) { case Tango::DEV_SHORT : { // // Check data type inside the any and data number // const Tango::DevVarShortArray *sh_ptr; if ((any >>= sh_ptr) == false) { TangoSys_OMemStream o; o << "Incompatible attribute type, expected type is : Tango::DevVarShortArray (even for single value)" << ends; Except::throw_exception((const char *)API_IncompatibleAttrDataType, o.str(), (const char *)"WAttribute::check_written_value()"); } nb_data = sh_ptr->length(); if (y == 0) { if (nb_data != x) { Except::throw_exception((const char *)API_AttrIncorrectDataNumber, (const char *)"Incorrect data number", (const char *)"WAttribute::check_written_value()"); } } else { if (nb_data != (x * y)) { Except::throw_exception((const char *)API_AttrIncorrectDataNumber, (const char *)"Incorrect data number", (const char *)"WAttribute::check_written_value()"); } } // // Check the incoming value against min or max_value if needed // { AutoTangoMonitor sync1(mon_ptr); if (check_min_value == true) { for (i = 0;i < nb_data;i++) { if ((*sh_ptr)[i] < min_value.sh) { TangoSys_OMemStream o; o << "Set value for attribute " << name; o << " is below the minimum authorized (at least element " << i << ")" << ends; Except::throw_exception((const char *)API_WAttrOutsideLimit, o.str(), (const char *)"WAttribute::check_written_value()"); } } } if (check_max_value == true) { for (i = 0;i < nb_data;i++) { if ((*sh_ptr)[i] > max_value.sh) { TangoSys_OMemStream o; o << "Set value for attribute " << name; o << " is above the maximum authorized (at least element " << i << ")" << ends; Except::throw_exception((const char *)API_WAttrOutsideLimit, o.str(), (const char *)"WAttribute::check_written_value()"); } } } } short_ptr = sh_ptr->get_buffer(); if (data_format == Tango::SCALAR) { old_short_val = short_val; short_val = (*sh_ptr)[0]; w_dim_x = 1; w_dim_y = 0; } else { w_dim_x = x; w_dim_y = y; } } break; case Tango::DEV_LONG : { // // Check data type inside the any // const Tango::DevVarLongArray *lg_ptr; if ((any >>= lg_ptr) == false) { TangoSys_OMemStream o; o << "Incompatible attribute type, expected type is : Tango::DevVarLongArray (even for single value)" << ends; Except::throw_exception((const char *)API_IncompatibleAttrDataType, o.str(), (const char *)"WAttribute::check_written_value()"); } nb_data = lg_ptr->length(); if (y == 0) { if (nb_data != x) { Except::throw_exception((const char *)API_AttrIncorrectDataNumber, (const char *)"Incorrect data number", (const char *)"WAttribute::check_written_value()"); } } else { if (nb_data != (x * y)) { Except::throw_exception((const char *)API_AttrIncorrectDataNumber, (const char *)"Incorrect data number", (const char *)"WAttribute::check_written_value()"); } } // // Check the incoming value // { AutoTangoMonitor sync1(mon_ptr); if (check_min_value == true) { for (i = 0;i < nb_data;i++) { if ((*lg_ptr)[i] < min_value.lg) { TangoSys_OMemStream o; o << "Set value for attribute " << name; o << " is below the minimum authorized (at least element " << i << ")" << ends; Except::throw_exception((const char *)API_WAttrOutsideLimit, o.str(), (const char *)"WAttribute::check_written_value()"); } } } if (check_max_value == true) { for (i = 0;i < nb_data;i++) { if ((*lg_ptr)[i] > max_value.lg) { TangoSys_OMemStream o; o << "Set value for attribute " << name; o << " is above the maximum authorized (at least element " << i << ")" << ends; Except::throw_exception((const char *)API_WAttrOutsideLimit, o.str(), (const char *)"WAttribute::check_written_value()"); } } } } long_ptr = lg_ptr->get_buffer(); if (data_format == Tango::SCALAR) { old_long_val = long_val; long_val = (*lg_ptr)[0]; w_dim_x = 1; w_dim_y = 0; } else { w_dim_x = x; w_dim_y = y; } } break; case Tango::DEV_LONG64 : { // // Check data type inside the any // const Tango::DevVarLong64Array *lg64_ptr; if ((any >>= lg64_ptr) == false) { TangoSys_OMemStream o; o << "Incompatible attribute type, expected type is : Tango::DevVarLong64Array (even for single value)" << ends; Except::throw_exception((const char *)API_IncompatibleAttrDataType, o.str(), (const char *)"WAttribute::check_written_value()"); } nb_data = lg64_ptr->length(); if (y == 0) { if (nb_data != x) { Except::throw_exception((const char *)API_AttrIncorrectDataNumber, (const char *)"Incorrect data number", (const char *)"WAttribute::check_written_value()"); } } else { if (nb_data != (x * y)) { Except::throw_exception((const char *)API_AttrIncorrectDataNumber, (const char *)"Incorrect data number", (const char *)"WAttribute::check_written_value()"); } } // // Check the incoming value // { AutoTangoMonitor sync1(mon_ptr); if (check_min_value == true) { for (i = 0;i < nb_data;i++) { if ((*lg64_ptr)[i] < min_value.lg64) { TangoSys_OMemStream o; o << "Set value for attribute " << name; o << " is below the minimum authorized (at least element " << i << ")" << ends; Except::throw_exception((const char *)API_WAttrOutsideLimit, o.str(), (const char *)"WAttribute::check_written_value()"); } } } if (check_max_value == true) { for (i = 0;i < nb_data;i++) { if ((*lg64_ptr)[i] > max_value.lg64) { TangoSys_OMemStream o; o << "Set value for attribute " << name; o << " is above the maximum authorized (at least element " << i << ")" << ends; Except::throw_exception((const char *)API_WAttrOutsideLimit, o.str(), (const char *)"WAttribute::check_written_value()"); } } } } w_ext->long64_ptr = lg64_ptr->get_buffer(); if (data_format == Tango::SCALAR) { w_ext->old_long64_val = w_ext->long64_val; w_ext->long64_val = (*lg64_ptr)[0]; w_dim_x = 1; w_dim_y = 0; } else { w_dim_x = x; w_dim_y = y; } } break; case Tango::DEV_DOUBLE : { // // Check data type inside the any // const Tango::DevVarDoubleArray *db_ptr; if ((any >>= db_ptr) == false) { TangoSys_OMemStream o; o << "Incompatible attribute type, expected type is : Tango::DevVarDoubleArray (even for single value)" << ends; Except::throw_exception((const char *)API_IncompatibleAttrDataType, o.str(), (const char *)"WAttribute::check_written_value()"); } nb_data = db_ptr->length(); if (y == 0) { if (nb_data != x) { Except::throw_exception((const char *)API_AttrIncorrectDataNumber, (const char *)"Incorrect data number", (const char *)"WAttribute::check_written_value()"); } } else { if (nb_data != (x * y)) { Except::throw_exception((const char *)API_AttrIncorrectDataNumber, (const char *)"Incorrect data number", (const char *)"WAttribute::check_written_value()"); } } // // Check the incoming value // First check for NaN, INF // { AutoTangoMonitor sync1(mon_ptr); for (i = 0;i < nb_data;i++) { if (tg->is_wattr_nan_allowed() == false) { #ifdef _TG_WINDOWS_ if (_finite((*db_ptr)[i]) == 0) #else if (isfinite((*db_ptr)[i]) == 0) #endif { TangoSys_OMemStream o; o << "Set value for attribute " << name; o << " is a NaN or INF value (at least element " << i << ")" << ends; Except::throw_exception((const char *)API_WAttrOutsideLimit, o.str(), (const char *)"WAttribute::check_written_value()"); } } if (check_min_value == true) { if ((*db_ptr)[i] < min_value.db) { TangoSys_OMemStream o; o << "Set value for attribute " << name; o << " is below the minimum authorized (at least element " << i << ")" << ends; Except::throw_exception((const char *)API_WAttrOutsideLimit, o.str(), (const char *)"WAttribute::check_written_value()"); } } if (check_max_value == true) { if ((*db_ptr)[i] > max_value.db) { TangoSys_OMemStream o; o << "Set value for attribute " << name; o << " is above the maximum authorized (at least element " << i << ")" << ends; Except::throw_exception((const char *)API_WAttrOutsideLimit, o.str(), (const char *)"WAttribute::check_written_value()"); } } } } double_ptr = db_ptr->get_buffer(); if (data_format == Tango::SCALAR) { old_double_val = double_val; double_val = (*db_ptr)[0]; w_dim_x = 1; w_dim_y = 0; } else { w_dim_x = x; w_dim_y = y; } } break; case Tango::DEV_STRING : // // Check data type inside the any // const Tango::DevVarStringArray *string_ptr; if ((any >>= string_ptr) == false) { TangoSys_OMemStream o; o << "Incompatible attribute type, expected type is : Tango::DevVarStringArray (even for single value)" << ends; Except::throw_exception((const char *)API_IncompatibleAttrDataType, o.str(), (const char *)"WAttribute::check_written_value()"); } nb_data = string_ptr->length(); if (y == 0) { if (nb_data != x) { Except::throw_exception((const char *)API_AttrIncorrectDataNumber, (const char *)"Incorrect data number", (const char *)"WAttribute::check_written_value()"); } } else { if (nb_data != (x * y)) { Except::throw_exception((const char *)API_AttrIncorrectDataNumber, (const char *)"Incorrect data number", (const char *)"WAttribute::check_written_value()"); } } str_ptr = string_ptr->get_buffer(); if (data_format == Tango::SCALAR) { CORBA::string_free(old_str_val); old_str_val = CORBA::string_dup(str_val); CORBA::string_free(str_val); str_val = CORBA::string_dup((*string_ptr)[0]); w_dim_x = 1; w_dim_y = 0; } else { w_dim_x = x; w_dim_y = y; } break; case Tango::DEV_FLOAT : { // // Check data type inside the any // const Tango::DevVarFloatArray *fl_ptr; if ((any >>= fl_ptr) == false) { TangoSys_OMemStream o; o << "Incompatible attribute type, expected type is : Tango::DevVarFloatArray (even for single value)" << ends; Except::throw_exception((const char *)API_IncompatibleAttrDataType, o.str(), (const char *)"WAttribute::check_written_value()"); } nb_data = fl_ptr->length(); if (y == 0) { if (nb_data != x) { Except::throw_exception((const char *)API_AttrIncorrectDataNumber, (const char *)"Incorrect data number", (const char *)"WAttribute::check_written_value()"); } } else { if (nb_data != (x * y)) { Except::throw_exception((const char *)API_AttrIncorrectDataNumber, (const char *)"Incorrect data number", (const char *)"WAttribute::check_written_value()"); } } // // Check the incoming value // First check for NaN, INF // { AutoTangoMonitor sync1(mon_ptr); for (i = 0;i < nb_data;i++) { if (tg->is_wattr_nan_allowed() == false) { #ifdef _TG_WINDOWS_ if (_finite((*fl_ptr)[i]) == 0) #else if (isfinite((*fl_ptr)[i]) == 0) #endif { TangoSys_OMemStream o; o << "Set value for attribute " << name; o << " is a NaN or INF value (at least element " << i << ")" << ends; Except::throw_exception((const char *)API_WAttrOutsideLimit, o.str(), (const char *)"WAttribute::check_written_value()"); } } if (check_min_value == true) { if ((*fl_ptr)[i] < min_value.fl) { TangoSys_OMemStream o; o << "Set value for attribute " << name; o << " is below the minimum authorized (at least element " << i << ")" << ends; Except::throw_exception((const char *)API_WAttrOutsideLimit, o.str(), (const char *)"WAttribute::check_written_value()"); } } if (check_max_value == true) { if ((*fl_ptr)[i] > max_value.fl) { TangoSys_OMemStream o; o << "Set value for attribute " << name; o << " is above the maximum authorized (at least element " << i << ")" << ends; Except::throw_exception((const char *)API_WAttrOutsideLimit, o.str(), (const char *)"WAttribute::check_written_value()"); } } } } float_ptr = fl_ptr->get_buffer(); if (data_format == Tango::SCALAR) { old_float_val = float_val; float_val = (*fl_ptr)[0]; w_dim_x = 1; w_dim_y = 0; } else { w_dim_x = x; w_dim_y = y; } } break; case Tango::DEV_USHORT : { // // Check data type inside the any // const Tango::DevVarUShortArray *ush_ptr; if ((any >>= ush_ptr) == false) { TangoSys_OMemStream o; o << "Incompatible attribute type, expected type is : Tango::DevVarUShortArray (even for single value)" << ends; Except::throw_exception((const char *)API_IncompatibleAttrDataType, o.str(), (const char *)"WAttribute::check_written_value()"); } nb_data = ush_ptr->length(); if (y == 0) { if (nb_data != x) { Except::throw_exception((const char *)API_AttrIncorrectDataNumber, (const char *)"Incorrect data number", (const char *)"WAttribute::check_written_value()"); } } else { if (nb_data != (x * y)) { Except::throw_exception((const char *)API_AttrIncorrectDataNumber, (const char *)"Incorrect data number", (const char *)"WAttribute::check_written_value()"); } } // // Check the incoming value // { AutoTangoMonitor sync1(mon_ptr); if (check_min_value == true) { for (i = 0;i < nb_data;i++) { if ((*ush_ptr)[i] < min_value.ush) { TangoSys_OMemStream o; o << "Set value for attribute " << name; o << " is below the minimum authorized (at least element " << i << ")" << ends; Except::throw_exception((const char *)API_WAttrOutsideLimit, o.str(), (const char *)"WAttribute::check_written_value()"); } } } if (check_max_value == true) { for (i = 0;i < nb_data;i++) { if ((*ush_ptr)[i] > max_value.ush) { TangoSys_OMemStream o; o << "Set value for attribute " << name; o << " is above the maximum authorized (at least element " << i << ")" << ends; Except::throw_exception((const char *)API_WAttrOutsideLimit, o.str(), (const char *)"WAttribute::check_written_value()"); } } } } ushort_ptr = ush_ptr->get_buffer(); if (data_format == Tango::SCALAR) { old_ushort_val = ushort_val; ushort_val = (*ush_ptr)[0]; w_dim_x = 1; w_dim_y = 0; } else { w_dim_x = x; w_dim_y = y; } } break; case Tango::DEV_UCHAR : { // // Check data type inside the any // const Tango::DevVarCharArray *uch_ptr; if ((any >>= uch_ptr) == false) { TangoSys_OMemStream o; o << "Incompatible attribute type, expected type is : Tango::DevVarCharArray (even for single value)" << ends; Except::throw_exception((const char *)API_IncompatibleAttrDataType, o.str(), (const char *)"WAttribute::check_written_value()"); } nb_data = uch_ptr->length(); if (y == 0) { if (nb_data != x) { Except::throw_exception((const char *)API_AttrIncorrectDataNumber, (const char *)"Incorrect data number", (const char *)"WAttribute::check_written_value()"); } } else { if (nb_data != (x * y)) { Except::throw_exception((const char *)API_AttrIncorrectDataNumber, (const char *)"Incorrect data number", (const char *)"WAttribute::check_written_value()"); } } // // Check the incoming value // { AutoTangoMonitor sync1(mon_ptr); if (check_min_value == true) { for (i = 0;i < nb_data;i++) { if ((*uch_ptr)[i] < min_value.uch) { TangoSys_OMemStream o; o << "Set value for attribute " << name; o << " is below the minimum authorized (at least element " << i << ")" << ends; Except::throw_exception((const char *)API_WAttrOutsideLimit, o.str(), (const char *)"WAttribute::check_written_value()"); } } } if (check_max_value == true) { for (i = 0;i < nb_data;i++) { if ((*uch_ptr)[i] > max_value.uch) { TangoSys_OMemStream o; o << "Set value for attribute " << name; o << " is above the maximum authorized (at least element " << i << ")" << ends; Except::throw_exception((const char *)API_WAttrOutsideLimit, o.str(), (const char *)"WAttribute::check_written_value()"); } } } } uchar_ptr = uch_ptr->get_buffer(); if (data_format == Tango::SCALAR) { old_uchar_val = uchar_val; uchar_val = (*uch_ptr)[0]; w_dim_x = 1; w_dim_y = 0; } else { w_dim_x = x; w_dim_y = y; } } break; case Tango::DEV_ULONG : { // // Check data type inside the any // const Tango::DevVarULongArray *ulo_ptr; if ((any >>= ulo_ptr) == false) { TangoSys_OMemStream o; o << "Incompatible attribute type, expected type is : Tango::DevVarULongArray (even for single value)" << ends; Except::throw_exception((const char *)API_IncompatibleAttrDataType, o.str(), (const char *)"WAttribute::check_written_value()"); } nb_data = ulo_ptr->length(); if (y == 0) { if (nb_data != x) { Except::throw_exception((const char *)API_AttrIncorrectDataNumber, (const char *)"Incorrect data number", (const char *)"WAttribute::check_written_value()"); } } else { if (nb_data != (x * y)) { Except::throw_exception((const char *)API_AttrIncorrectDataNumber, (const char *)"Incorrect data number", (const char *)"WAttribute::check_written_value()"); } } // // Check the incoming value // { AutoTangoMonitor sync1(mon_ptr); if (check_min_value == true) { for (i = 0;i < nb_data;i++) { if ((*ulo_ptr)[i] < min_value.ulg) { TangoSys_OMemStream o; o << "Set value for attribute " << name; o << " is below the minimum authorized (at least element " << i << ")" << ends; Except::throw_exception((const char *)API_WAttrOutsideLimit, o.str(), (const char *)"WAttribute::check_written_value()"); } } } if (check_max_value == true) { for (i = 0;i < nb_data;i++) { if ((*ulo_ptr)[i] > max_value.ulg) { TangoSys_OMemStream o; o << "Set value for attribute " << name; o << " is above the maximum authorized (at least element " << i << ")" << ends; Except::throw_exception((const char *)API_WAttrOutsideLimit, o.str(), (const char *)"WAttribute::check_written_value()"); } } } } w_ext->ulong_ptr = ulo_ptr->get_buffer(); if (data_format == Tango::SCALAR) { w_ext->old_ulong_val = w_ext->ulong_val; w_ext->ulong_val = (*ulo_ptr)[0]; w_dim_x = 1; w_dim_y = 0; } else { w_dim_x = x; w_dim_y = y; } } break; case Tango::DEV_ULONG64 : { // // Check data type inside the any // const Tango::DevVarULong64Array *ulg64_ptr; if ((any >>= ulg64_ptr) == false) { TangoSys_OMemStream o; o << "Incompatible attribute type, expected type is : Tango::DevVarULong64Array (even for single value)" << ends; Except::throw_exception((const char *)API_IncompatibleAttrDataType, o.str(), (const char *)"WAttribute::check_written_value()"); } nb_data = ulg64_ptr->length(); if (y == 0) { if (nb_data != x) { Except::throw_exception((const char *)API_AttrIncorrectDataNumber, (const char *)"Incorrect data number", (const char *)"WAttribute::check_written_value()"); } } else { if (nb_data != (x * y)) { Except::throw_exception((const char *)API_AttrIncorrectDataNumber, (const char *)"Incorrect data number", (const char *)"WAttribute::check_written_value()"); } } // // Check the incoming value // { AutoTangoMonitor sync1(mon_ptr); if (check_min_value == true) { for (i = 0;i < nb_data;i++) { if ((*ulg64_ptr)[i] < min_value.ulg64) { TangoSys_OMemStream o; o << "Set value for attribute " << name; o << " is below the minimum authorized (at least element " << i << ")" << ends; Except::throw_exception((const char *)API_WAttrOutsideLimit, o.str(), (const char *)"WAttribute::check_written_value()"); } } } if (check_max_value == true) { for (i = 0;i < nb_data;i++) { if ((*ulg64_ptr)[i] > max_value.ulg64) { TangoSys_OMemStream o; o << "Set value for attribute " << name; o << " is above the maximum authorized (at least element " << i << ")" << ends; Except::throw_exception((const char *)API_WAttrOutsideLimit, o.str(), (const char *)"WAttribute::check_written_value()"); } } } } w_ext->ulong64_ptr = ulg64_ptr->get_buffer(); if (data_format == Tango::SCALAR) { w_ext->old_ulong64_val = w_ext->ulong64_val; w_ext->ulong64_val = (*ulg64_ptr)[0]; w_dim_x = 1; w_dim_y = 0; } else { w_dim_x = x; w_dim_y = y; } } break; case Tango::DEV_BOOLEAN : // // Check data type inside the any // const Tango::DevVarBooleanArray *boo_ptr; if ((any >>= boo_ptr) == false) { TangoSys_OMemStream o; o << "Incompatible attribute type, expected type is : Tango::DevVarBooleanArray (even for single value)" << ends; Except::throw_exception((const char *)API_IncompatibleAttrDataType, o.str(), (const char *)"WAttribute::check_written_value()"); } nb_data = boo_ptr->length(); if (y == 0) { if (nb_data != x) { Except::throw_exception((const char *)API_AttrIncorrectDataNumber, (const char *)"Incorrect data number", (const char *)"WAttribute::check_written_value()"); } } else { if (nb_data != (x * y)) { Except::throw_exception((const char *)API_AttrIncorrectDataNumber, (const char *)"Incorrect data number", (const char *)"WAttribute::check_written_value()"); } } boolean_ptr = boo_ptr->get_buffer(); if (data_format == Tango::SCALAR) { old_boolean_val = boolean_val; boolean_val = (*boo_ptr)[0]; w_dim_x = 1; w_dim_y = 0; } else { w_dim_x = x; w_dim_y = y; } break; } } void WAttribute::check_written_value(const Tango::AttrValUnion &att_union,unsigned long x,unsigned long y) { unsigned int nb_data; unsigned int i; // // If the server is in its starting phase, gives a NULL ptr // to the AutoLock object // Tango::Util *tg = Tango::Util::instance(); Tango::TangoMonitor *mon_ptr = NULL; if (tg->is_svr_starting() == false && tg->is_device_restarting(ext->d_name) == false) mon_ptr = &(get_att_device()->get_att_conf_monitor()); switch (data_type) { case Tango::DEV_SHORT : { // // Check data type inside the union and data number // if (att_union._d() != ATT_SHORT) { TangoSys_OMemStream o; o << "Incompatible attribute type, expected type is : Tango::DevVarShortArray (even for single value)" << ends; Except::throw_exception((const char *)API_IncompatibleAttrDataType, o.str(), (const char *)"WAttribute::check_written_value()"); } const Tango::DevVarShortArray &sh_seq = att_union.short_att_value(); nb_data = sh_seq.length(); if (y == 0) { if (nb_data != x) { Except::throw_exception((const char *)API_AttrIncorrectDataNumber, (const char *)"Incorrect data number", (const char *)"WAttribute::check_written_value()"); } } else { if (nb_data != (x * y)) { Except::throw_exception((const char *)API_AttrIncorrectDataNumber, (const char *)"Incorrect data number", (const char *)"WAttribute::check_written_value()"); } } // // Check the incoming value against min or max_value if needed // { AutoTangoMonitor sync1(mon_ptr); if (check_min_value == true) { for (i = 0;i < nb_data;i++) { if (sh_seq[i] < min_value.sh) { TangoSys_OMemStream o; o << "Set value for attribute " << name; o << " is below the minimum authorized (at least element " << i << ")" << ends; Except::throw_exception((const char *)API_WAttrOutsideLimit, o.str(), (const char *)"WAttribute::check_written_value()"); } } } if (check_max_value == true) { for (i = 0;i < nb_data;i++) { if (sh_seq[i] > max_value.sh) { TangoSys_OMemStream o; o << "Set value for attribute " << name; o << " is above the maximum authorized (at least element " << i << ")" << ends; Except::throw_exception((const char *)API_WAttrOutsideLimit, o.str(), (const char *)"WAttribute::check_written_value()"); } } } } short_ptr = sh_seq.get_buffer(); if (data_format == Tango::SCALAR) { old_short_val = short_val; short_val = sh_seq[0]; w_dim_x = 1; w_dim_y = 0; } else { w_dim_x = x; w_dim_y = y; } } break; case Tango::DEV_LONG : { // // Check data type inside the union // if (att_union._d() != ATT_LONG) { TangoSys_OMemStream o; o << "Incompatible attribute type, expected type is : Tango::DevVarLongArray (even for single value)" << ends; Except::throw_exception((const char *)API_IncompatibleAttrDataType, o.str(), (const char *)"WAttribute::check_written_value()"); } const Tango::DevVarLongArray &lg_seq = att_union.long_att_value(); nb_data = lg_seq.length(); if (y == 0) { if (nb_data != x) { Except::throw_exception((const char *)API_AttrIncorrectDataNumber, (const char *)"Incorrect data number", (const char *)"WAttribute::check_written_value()"); } } else { if (nb_data != (x * y)) { Except::throw_exception((const char *)API_AttrIncorrectDataNumber, (const char *)"Incorrect data number", (const char *)"WAttribute::check_written_value()"); } } // // Check the incoming value // { AutoTangoMonitor sync1(mon_ptr); if (check_min_value == true) { for (i = 0;i < nb_data;i++) { if (lg_seq[i] < min_value.lg) { TangoSys_OMemStream o; o << "Set value for attribute " << name; o << " is below the minimum authorized (at least element " << i << ")" << ends; Except::throw_exception((const char *)API_WAttrOutsideLimit, o.str(), (const char *)"WAttribute::check_written_value()"); } } } if (check_max_value == true) { for (i = 0;i < nb_data;i++) { if (lg_seq[i] > max_value.lg) { TangoSys_OMemStream o; o << "Set value for attribute " << name; o << " is above the maximum authorized (at least element " << i << ")" << ends; Except::throw_exception((const char *)API_WAttrOutsideLimit, o.str(), (const char *)"WAttribute::check_written_value()"); } } } } long_ptr = lg_seq.get_buffer(); if (data_format == Tango::SCALAR) { old_long_val = long_val; long_val = lg_seq[0]; w_dim_x = 1; w_dim_y = 0; } else { w_dim_x = x; w_dim_y = y; } } break; case Tango::DEV_LONG64 : { // // Check data type inside the union // if (att_union._d() != ATT_LONG64) { TangoSys_OMemStream o; o << "Incompatible attribute type, expected type is : Tango::DevVarLong64Array (even for single value)" << ends; Except::throw_exception((const char *)API_IncompatibleAttrDataType, o.str(), (const char *)"WAttribute::check_written_value()"); } const Tango::DevVarLong64Array &lg64_seq = att_union.long64_att_value(); nb_data = lg64_seq.length(); if (y == 0) { if (nb_data != x) { Except::throw_exception((const char *)API_AttrIncorrectDataNumber, (const char *)"Incorrect data number", (const char *)"WAttribute::check_written_value()"); } } else { if (nb_data != (x * y)) { Except::throw_exception((const char *)API_AttrIncorrectDataNumber, (const char *)"Incorrect data number", (const char *)"WAttribute::check_written_value()"); } } // // Check the incoming value // { AutoTangoMonitor sync1(mon_ptr); if (check_min_value == true) { for (i = 0;i < nb_data;i++) { if (lg64_seq[i] < min_value.lg64) { TangoSys_OMemStream o; o << "Set value for attribute " << name; o << " is below the minimum authorized (at least element " << i << ")" << ends; Except::throw_exception((const char *)API_WAttrOutsideLimit, o.str(), (const char *)"WAttribute::check_written_value()"); } } } if (check_max_value == true) { for (i = 0;i < nb_data;i++) { if (lg64_seq[i] > max_value.lg64) { TangoSys_OMemStream o; o << "Set value for attribute " << name; o << " is above the maximum authorized (at least element " << i << ")" << ends; Except::throw_exception((const char *)API_WAttrOutsideLimit, o.str(), (const char *)"WAttribute::check_written_value()"); } } } } w_ext->long64_ptr = lg64_seq.get_buffer(); if (data_format == Tango::SCALAR) { w_ext->old_long64_val = w_ext->long64_val; w_ext->long64_val = lg64_seq[0]; w_dim_x = 1; w_dim_y = 0; } else { w_dim_x = x; w_dim_y = y; } } break; case Tango::DEV_DOUBLE : { // // Check data type inside the union // if (att_union._d() != ATT_DOUBLE) { TangoSys_OMemStream o; o << "Incompatible attribute type, expected type is : Tango::DevVarDoubleArray (even for single value)" << ends; Except::throw_exception((const char *)API_IncompatibleAttrDataType, o.str(), (const char *)"WAttribute::check_written_value()"); } const Tango::DevVarDoubleArray &db_seq = att_union.double_att_value(); nb_data = db_seq.length(); if (y == 0) { if (nb_data != x) { Except::throw_exception((const char *)API_AttrIncorrectDataNumber, (const char *)"Incorrect data number", (const char *)"WAttribute::check_written_value()"); } } else { if (nb_data != (x * y)) { Except::throw_exception((const char *)API_AttrIncorrectDataNumber, (const char *)"Incorrect data number", (const char *)"WAttribute::check_written_value()"); } } // // Check the incoming value // First check for NaN, INF // { AutoTangoMonitor sync1(mon_ptr); for (i = 0;i < nb_data;i++) { if (tg->is_wattr_nan_allowed() == false) { #ifdef _TG_WINDOWS_ if (_finite(db_seq[i]) == 0) #else if (isfinite(db_seq[i]) == 0) #endif { TangoSys_OMemStream o; o << "Set value for attribute " << name; o << " is a NaN or INF value (at least element " << i << ")" << ends; Except::throw_exception((const char *)API_WAttrOutsideLimit, o.str(), (const char *)"WAttribute::check_written_value()"); } } if (check_min_value == true) { if (db_seq[i] < min_value.db) { TangoSys_OMemStream o; o << "Set value for attribute " << name; o << " is below the minimum authorized (at least element " << i << ")" << ends; Except::throw_exception((const char *)API_WAttrOutsideLimit, o.str(), (const char *)"WAttribute::check_written_value()"); } } if (check_max_value == true) { if (db_seq[i] > max_value.db) { TangoSys_OMemStream o; o << "Set value for attribute " << name; o << " is above the maximum authorized (at least element " << i << ")" << ends; Except::throw_exception((const char *)API_WAttrOutsideLimit, o.str(), (const char *)"WAttribute::check_written_value()"); } } } } double_ptr = db_seq.get_buffer(); if (data_format == Tango::SCALAR) { old_double_val = double_val; double_val = db_seq[0]; w_dim_x = 1; w_dim_y = 0; } else { w_dim_x = x; w_dim_y = y; } } break; case Tango::DEV_STRING : { // // Check data type inside the union // if (att_union._d() != ATT_STRING) { TangoSys_OMemStream o; o << "Incompatible attribute type, expected type is : Tango::DevVarStringArray (even for single value)" << ends; Except::throw_exception((const char *)API_IncompatibleAttrDataType, o.str(), (const char *)"WAttribute::check_written_value()"); } const Tango::DevVarStringArray &string_seq = att_union.string_att_value(); nb_data = string_seq.length(); if (y == 0) { if (nb_data != x) { Except::throw_exception((const char *)API_AttrIncorrectDataNumber, (const char *)"Incorrect data number", (const char *)"WAttribute::check_written_value()"); } } else { if (nb_data != (x * y)) { Except::throw_exception((const char *)API_AttrIncorrectDataNumber, (const char *)"Incorrect data number", (const char *)"WAttribute::check_written_value()"); } } str_ptr = string_seq.get_buffer(); if (data_format == Tango::SCALAR) { CORBA::string_free(old_str_val); old_str_val = CORBA::string_dup(str_val); CORBA::string_free(str_val); str_val = CORBA::string_dup(string_seq[0]); w_dim_x = 1; w_dim_y = 0; } else { w_dim_x = x; w_dim_y = y; } } break; case Tango::DEV_FLOAT : { // // Check data type inside the union // if (att_union._d() != ATT_FLOAT) { TangoSys_OMemStream o; o << "Incompatible attribute type, expected type is : Tango::DevVarFloatArray (even for single value)" << ends; Except::throw_exception((const char *)API_IncompatibleAttrDataType, o.str(), (const char *)"WAttribute::check_written_value()"); } const Tango::DevVarFloatArray &fl_seq = att_union.float_att_value(); nb_data = fl_seq.length(); if (y == 0) { if (nb_data != x) { Except::throw_exception((const char *)API_AttrIncorrectDataNumber, (const char *)"Incorrect data number", (const char *)"WAttribute::check_written_value()"); } } else { if (nb_data != (x * y)) { Except::throw_exception((const char *)API_AttrIncorrectDataNumber, (const char *)"Incorrect data number", (const char *)"WAttribute::check_written_value()"); } } // // Check the incoming value // First check for NaN, INF // { AutoTangoMonitor sync1(mon_ptr); for (i = 0;i < nb_data;i++) { if (tg->is_wattr_nan_allowed() == false) { #ifdef _TG_WINDOWS_ if (_finite(fl_seq[i]) == 0) #else if (isfinite(fl_seq[i]) == 0) #endif { TangoSys_OMemStream o; o << "Set value for attribute " << name; o << " is a NaN or INF value (at least element " << i << ")" << ends; Except::throw_exception((const char *)API_WAttrOutsideLimit, o.str(), (const char *)"WAttribute::check_written_value()"); } } if (check_min_value == true) { if (fl_seq[i] < min_value.fl) { TangoSys_OMemStream o; o << "Set value for attribute " << name; o << " is below the minimum authorized (at least element " << i << ")" << ends; Except::throw_exception((const char *)API_WAttrOutsideLimit, o.str(), (const char *)"WAttribute::check_written_value()"); } } if (check_max_value == true) { if (fl_seq[i] > max_value.fl) { TangoSys_OMemStream o; o << "Set value for attribute " << name; o << " is above the maximum authorized (at least element " << i << ")" << ends; Except::throw_exception((const char *)API_WAttrOutsideLimit, o.str(), (const char *)"WAttribute::check_written_value()"); } } } } float_ptr = fl_seq.get_buffer(); if (data_format == Tango::SCALAR) { old_float_val = float_val; float_val = fl_seq[0]; w_dim_x = 1; w_dim_y = 0; } else { w_dim_x = x; w_dim_y = y; } } break; case Tango::DEV_USHORT : { // // Check data type inside the union // if (att_union._d() != ATT_USHORT) { TangoSys_OMemStream o; o << "Incompatible attribute type, expected type is : Tango::DevVarUShortArray (even for single value)" << ends; Except::throw_exception((const char *)API_IncompatibleAttrDataType, o.str(), (const char *)"WAttribute::check_written_value()"); } const Tango::DevVarUShortArray &ush_seq = att_union.ushort_att_value(); nb_data = ush_seq.length(); if (y == 0) { if (nb_data != x) { Except::throw_exception((const char *)API_AttrIncorrectDataNumber, (const char *)"Incorrect data number", (const char *)"WAttribute::check_written_value()"); } } else { if (nb_data != (x * y)) { Except::throw_exception((const char *)API_AttrIncorrectDataNumber, (const char *)"Incorrect data number", (const char *)"WAttribute::check_written_value()"); } } // // Check the incoming value // { AutoTangoMonitor sync1(mon_ptr); if (check_min_value == true) { for (i = 0;i < nb_data;i++) { if (ush_seq[i] < min_value.ush) { TangoSys_OMemStream o; o << "Set value for attribute " << name; o << " is below the minimum authorized (at least element " << i << ")" << ends; Except::throw_exception((const char *)API_WAttrOutsideLimit, o.str(), (const char *)"WAttribute::check_written_value()"); } } } if (check_max_value == true) { for (i = 0;i < nb_data;i++) { if (ush_seq[i] > max_value.ush) { TangoSys_OMemStream o; o << "Set value for attribute " << name; o << " is above the maximum authorized (at least element " << i << ")" << ends; Except::throw_exception((const char *)API_WAttrOutsideLimit, o.str(), (const char *)"WAttribute::check_written_value()"); } } } } ushort_ptr = ush_seq.get_buffer(); if (data_format == Tango::SCALAR) { old_ushort_val = ushort_val; ushort_val = ush_seq[0]; w_dim_x = 1; w_dim_y = 0; } else { w_dim_x = x; w_dim_y = y; } } break; case Tango::DEV_UCHAR : { // // Check data type inside the union // if (att_union._d() != ATT_UCHAR) { TangoSys_OMemStream o; o << "Incompatible attribute type, expected type is : Tango::DevVarCharArray (even for single value)" << ends; Except::throw_exception((const char *)API_IncompatibleAttrDataType, o.str(), (const char *)"WAttribute::check_written_value()"); } const Tango::DevVarCharArray &uch_seq = att_union.uchar_att_value(); nb_data = uch_seq.length(); if (y == 0) { if (nb_data != x) { Except::throw_exception((const char *)API_AttrIncorrectDataNumber, (const char *)"Incorrect data number", (const char *)"WAttribute::check_written_value()"); } } else { if (nb_data != (x * y)) { Except::throw_exception((const char *)API_AttrIncorrectDataNumber, (const char *)"Incorrect data number", (const char *)"WAttribute::check_written_value()"); } } // // Check the incoming value // { AutoTangoMonitor sync1(mon_ptr); if (check_min_value == true) { for (i = 0;i < nb_data;i++) { if (uch_seq[i] < min_value.uch) { TangoSys_OMemStream o; o << "Set value for attribute " << name; o << " is below the minimum authorized (at least element " << i << ")" << ends; Except::throw_exception((const char *)API_WAttrOutsideLimit, o.str(), (const char *)"WAttribute::check_written_value()"); } } } if (check_max_value == true) { for (i = 0;i < nb_data;i++) { if (uch_seq[i] > max_value.uch) { TangoSys_OMemStream o; o << "Set value for attribute " << name; o << " is above the maximum authorized (at least element " << i << ")" << ends; Except::throw_exception((const char *)API_WAttrOutsideLimit, o.str(), (const char *)"WAttribute::check_written_value()"); } } } } uchar_ptr = uch_seq.get_buffer(); if (data_format == Tango::SCALAR) { old_uchar_val = uchar_val; uchar_val = uch_seq[0]; w_dim_x = 1; w_dim_y = 0; } else { w_dim_x = x; w_dim_y = y; } } break; case Tango::DEV_ULONG : { // // Check data type inside the union // if (att_union._d() != ATT_ULONG) { TangoSys_OMemStream o; o << "Incompatible attribute type, expected type is : Tango::DevVarULongArray (even for single value)" << ends; Except::throw_exception((const char *)API_IncompatibleAttrDataType, o.str(), (const char *)"WAttribute::check_written_value()"); } const Tango::DevVarULongArray &ulo_seq = att_union.ulong_att_value(); nb_data = ulo_seq.length(); if (y == 0) { if (nb_data != x) { Except::throw_exception((const char *)API_AttrIncorrectDataNumber, (const char *)"Incorrect data number", (const char *)"WAttribute::check_written_value()"); } } else { if (nb_data != (x * y)) { Except::throw_exception((const char *)API_AttrIncorrectDataNumber, (const char *)"Incorrect data number", (const char *)"WAttribute::check_written_value()"); } } // // Check the incoming value // { AutoTangoMonitor sync1(mon_ptr); if (check_min_value == true) { for (i = 0;i < nb_data;i++) { if (ulo_seq[i] < min_value.ulg) { TangoSys_OMemStream o; o << "Set value for attribute " << name; o << " is below the minimum authorized (at least element " << i << ")" << ends; Except::throw_exception((const char *)API_WAttrOutsideLimit, o.str(), (const char *)"WAttribute::check_written_value()"); } } } if (check_max_value == true) { for (i = 0;i < nb_data;i++) { if (ulo_seq[i] > max_value.ulg) { TangoSys_OMemStream o; o << "Set value for attribute " << name; o << " is above the maximum authorized (at least element " << i << ")" << ends; Except::throw_exception((const char *)API_WAttrOutsideLimit, o.str(), (const char *)"WAttribute::check_written_value()"); } } } } w_ext->ulong_ptr = ulo_seq.get_buffer(); if (data_format == Tango::SCALAR) { w_ext->old_ulong_val = w_ext->ulong_val; w_ext->ulong_val = ulo_seq[0]; w_dim_x = 1; w_dim_y = 0; } else { w_dim_x = x; w_dim_y = y; } } break; case Tango::DEV_ULONG64 : { // // Check data type inside the union // if (att_union._d() != ATT_ULONG64) { TangoSys_OMemStream o; o << "Incompatible attribute type, expected type is : Tango::DevVarULong64Array (even for single value)" << ends; Except::throw_exception((const char *)API_IncompatibleAttrDataType, o.str(), (const char *)"WAttribute::check_written_value()"); } const Tango::DevVarULong64Array &ulo64_seq = att_union.ulong64_att_value(); nb_data = ulo64_seq.length(); if (y == 0) { if (nb_data != x) { Except::throw_exception((const char *)API_AttrIncorrectDataNumber, (const char *)"Incorrect data number", (const char *)"WAttribute::check_written_value()"); } } else { if (nb_data != (x * y)) { Except::throw_exception((const char *)API_AttrIncorrectDataNumber, (const char *)"Incorrect data number", (const char *)"WAttribute::check_written_value()"); } } // // Check the incoming value // { AutoTangoMonitor sync1(mon_ptr); if (check_min_value == true) { for (i = 0;i < nb_data;i++) { if (ulo64_seq[i] < min_value.ulg64) { TangoSys_OMemStream o; o << "Set value for attribute " << name; o << " is below the minimum authorized (at least element " << i << ")" << ends; Except::throw_exception((const char *)API_WAttrOutsideLimit, o.str(), (const char *)"WAttribute::check_written_value()"); } } } if (check_max_value == true) { for (i = 0;i < nb_data;i++) { if (ulo64_seq[i] > max_value.ulg64) { TangoSys_OMemStream o; o << "Set value for attribute " << name; o << " is above the maximum authorized (at least element " << i << ")" << ends; Except::throw_exception((const char *)API_WAttrOutsideLimit, o.str(), (const char *)"WAttribute::check_written_value()"); } } } } w_ext->ulong64_ptr = ulo64_seq.get_buffer(); if (data_format == Tango::SCALAR) { w_ext->old_ulong64_val = w_ext->ulong64_val; w_ext->ulong64_val = ulo64_seq[0]; w_dim_x = 1; w_dim_y = 0; } else { w_dim_x = x; w_dim_y = y; } } break; case Tango::DEV_STATE : { // // Check data type inside the union // if (att_union._d() != ATT_STATE) { TangoSys_OMemStream o; o << "Incompatible attribute type, expected type is : Tango::DevVarStateArray (even for single value)" << ends; Except::throw_exception((const char *)API_IncompatibleAttrDataType, o.str(), (const char *)"WAttribute::check_written_value()"); } const Tango::DevVarStateArray &sta_seq = att_union.state_att_value(); nb_data = sta_seq.length(); if (y == 0) { if (nb_data != x) { Except::throw_exception((const char *)API_AttrIncorrectDataNumber, (const char *)"Incorrect data number", (const char *)"WAttribute::check_written_value()"); } } else { if (nb_data != (x * y)) { Except::throw_exception((const char *)API_AttrIncorrectDataNumber, (const char *)"Incorrect data number", (const char *)"WAttribute::check_written_value()"); } } // // Check the incoming value // if (check_min_value == true) { for (i = 0;i < nb_data;i++) { if (sta_seq[i] < min_value.d_sta) { TangoSys_OMemStream o; o << "Set value for attribute " << name; o << " is below the minimum authorized (at least element " << i << ")" << ends; Except::throw_exception((const char *)API_WAttrOutsideLimit, o.str(), (const char *)"WAttribute::check_written_value()"); } } } if (check_max_value == true) { for (i = 0;i < nb_data;i++) { if (sta_seq[i] > max_value.d_sta) { TangoSys_OMemStream o; o << "Set value for attribute " << name; o << " is above the maximum authorized (at least element " << i << ")" << ends; Except::throw_exception((const char *)API_WAttrOutsideLimit, o.str(), (const char *)"WAttribute::check_written_value()"); } } } w_ext->state_ptr = sta_seq.get_buffer(); if (data_format == Tango::SCALAR) { w_ext->old_dev_state_val = w_ext->dev_state_val; w_ext->dev_state_val = sta_seq[0]; w_dim_x = 1; w_dim_y = 0; } else { w_dim_x = x; w_dim_y = y; } } break; case Tango::DEV_BOOLEAN : { // // Check data type inside the union // if (att_union._d() != ATT_BOOL) { TangoSys_OMemStream o; o << "Incompatible attribute type, expected type is : Tango::DevVarBooleanArray (even for single value)" << ends; Except::throw_exception((const char *)API_IncompatibleAttrDataType, o.str(), (const char *)"WAttribute::check_written_value()"); } const Tango::DevVarBooleanArray &boo_seq = att_union.bool_att_value(); nb_data = boo_seq.length(); if (y == 0) { if (nb_data != x) { Except::throw_exception((const char *)API_AttrIncorrectDataNumber, (const char *)"Incorrect data number", (const char *)"WAttribute::check_written_value()"); } } else { if (nb_data != (x * y)) { Except::throw_exception((const char *)API_AttrIncorrectDataNumber, (const char *)"Incorrect data number", (const char *)"WAttribute::check_written_value()"); } } boolean_ptr = boo_seq.get_buffer(); if (data_format == Tango::SCALAR) { old_boolean_val = boolean_val; boolean_val = boo_seq[0]; w_dim_x = 1; w_dim_y = 0; } else { w_dim_x = x; w_dim_y = y; } } break; case Tango::DEV_ENCODED : { if (att_union._d() != ATT_ENCODED) { TangoSys_OMemStream o; o << "Incompatible attribute type, expected type is : Tango::DevVarEncodedArray (even for single value)" << ends; Except::throw_exception((const char *)API_IncompatibleAttrDataType, o.str(), (const char *)"WAttribute::check_written_value()"); } const Tango::DevVarEncodedArray &enc_seq = att_union.encoded_att_value(); nb_data = enc_seq.length(); if (y == 0) { if (nb_data != x) { Except::throw_exception((const char *)API_AttrIncorrectDataNumber, (const char *)"Incorrect data number", (const char *)"WAttribute::check_written_value()"); } } else { if (nb_data != (x * y)) { Except::throw_exception((const char *)API_AttrIncorrectDataNumber, (const char *)"Incorrect data number", (const char *)"WAttribute::check_written_value()"); } } // // Check the incoming value against min or max_value if needed // { AutoTangoMonitor sync1(mon_ptr); unsigned int j; if (check_min_value == true) { for (i = 0;i < nb_data;i++) { CORBA::ULong nb_data_elt = enc_seq[i].encoded_data.length(); for (j = 0;j < nb_data_elt;j++) { if (enc_seq[i].encoded_data[j] < min_value.uch) { TangoSys_OMemStream o; o << "Set value for attribute " << name; o << " is below the minimum authorized (at least element " << i << ")" << ends; Except::throw_exception((const char *)API_WAttrOutsideLimit, o.str(), (const char *)"WAttribute::check_written_value()"); } } } } if (check_max_value == true) { for (i = 0;i < nb_data;i++) { CORBA::ULong nb_data_elt = enc_seq[i].encoded_data.length(); for (j = 0;j < nb_data_elt;j++) { if (enc_seq[i].encoded_data[j] > max_value.uch) { TangoSys_OMemStream o; o << "Set value for attribute " << name; o << " is above the maximum authorized (at least element " << i << ")" << ends; Except::throw_exception((const char *)API_WAttrOutsideLimit, o.str(), (const char *)"WAttribute::check_written_value()"); } } } } } encoded_ptr = enc_seq.get_buffer(); if (data_format == Tango::SCALAR) { old_encoded_val = encoded_val; encoded_val = enc_seq[0]; w_dim_x = 1; w_dim_y = 0; } else { w_dim_x = x; w_dim_y = y; } } break; } } //+------------------------------------------------------------------------- // // method : WAttribute::get_write_value_length // // description : Returm to the caller the length of the new value to // be written into the attribute // //-------------------------------------------------------------------------- long WAttribute::get_write_value_length() { long ret_val; if (data_format == Tango::SCALAR) ret_val = 1; else if (data_format == Tango::SPECTRUM) ret_val = w_dim_x; else ret_val = w_dim_x * w_dim_y; return ret_val; } //+------------------------------------------------------------------------- // // method : WAttribute::set_write_value() methods // // description : Set the attribute internal value. // There are different methods according to the // attribute data type and the attribute type (scalar, // spectrum or image) // //-------------------------------------------------------------------------- // DevShort: void WAttribute::set_write_value(Tango::DevShort val) { CORBA::Any tmp_any; Tango::DevVarShortArray tmp_seq(1); tmp_seq.length(1); tmp_seq[0] = val; tmp_any <<= tmp_seq; check_written_value(tmp_any,1,0); copy_data(tmp_any); set_user_set_write_value(true); } void WAttribute::set_write_value(Tango::DevShort *val, long x, long y) { long nb_data; if (y == 0) nb_data = x; else nb_data = x * y; Tango::DevVarShortArray tmp_seq(nb_data,nb_data,val,false); CORBA::Any tmp_any; tmp_any <<= tmp_seq; check_written_value(tmp_any, x, y); copy_data(tmp_any); set_user_set_write_value(true); } void WAttribute::set_write_value(vector &val, long x, long y) { Tango::DevVarShortArray tmp_seq(val.size(),val.size(),&val[0],false); CORBA::Any tmp_any; tmp_any <<= tmp_seq; check_written_value(tmp_any, x, y); copy_data(tmp_any); set_user_set_write_value(true); } // DevLong: void WAttribute::set_write_value(Tango::DevLong val) { Tango::DevVarLongArray tmp_seq(1); tmp_seq.length(1); tmp_seq[0] = val; CORBA::Any tmp_any; tmp_any <<= tmp_seq; check_written_value(tmp_any,1,0); copy_data(tmp_any); set_user_set_write_value(true); } void WAttribute::set_write_value(Tango::DevLong *val, long x, long y) { long nb_data; if (y == 0) nb_data = x; else nb_data = x * y; Tango::DevVarLongArray tmp_seq(nb_data,nb_data,val,false); CORBA::Any tmp_any; tmp_any <<= tmp_seq; check_written_value(tmp_any, x, y); copy_data(tmp_any); set_user_set_write_value(true); } void WAttribute::set_write_value(vector &val, long x, long y) { Tango::DevVarLongArray tmp_seq(val.size(),val.size(),&val[0],false); CORBA::Any tmp_any; tmp_any <<= tmp_seq; check_written_value(tmp_any, x, y); copy_data(tmp_any); set_user_set_write_value(true); } // DevLong64: void WAttribute::set_write_value(Tango::DevLong64 val) { Tango::DevVarLong64Array tmp_seq(1); tmp_seq.length(1); tmp_seq[0] = val; CORBA::Any tmp_any; tmp_any <<= tmp_seq; check_written_value(tmp_any,1,0); copy_data(tmp_any); set_user_set_write_value(true); } void WAttribute::set_write_value(Tango::DevLong64 *val, long x, long y) { long nb_data; if (y == 0) nb_data = x; else nb_data = x * y; Tango::DevVarLong64Array tmp_seq(nb_data, nb_data, val, false); CORBA::Any tmp_any; tmp_any <<= tmp_seq; check_written_value(tmp_any, x, y); copy_data(tmp_any); set_user_set_write_value(true); } void WAttribute::set_write_value(vector &val, long x, long y) { Tango::DevVarLong64Array tmp_seq(val.size(),val.size(),&val[0],false); CORBA::Any tmp_any; tmp_any <<= tmp_seq; check_written_value(tmp_any, x, y); copy_data(tmp_any); set_user_set_write_value(true); } // DevDouble: void WAttribute::set_write_value(Tango::DevDouble val) { Tango::DevVarDoubleArray tmp_seq(1); tmp_seq.length(1); tmp_seq[0] = val; CORBA::Any tmp_any; tmp_any <<= tmp_seq; check_written_value(tmp_any,1,0); copy_data(tmp_any); set_user_set_write_value(true); } void WAttribute::set_write_value(Tango::DevDouble *val, long x, long y) { long nb_data; if (y == 0) nb_data = x; else nb_data = x * y; Tango::DevVarDoubleArray tmp_seq(nb_data,nb_data,val,false); CORBA::Any tmp_any; tmp_any <<= tmp_seq; check_written_value(tmp_any, x, y); copy_data(tmp_any); set_user_set_write_value(true); } void WAttribute::set_write_value(vector &val, long x, long y) { CORBA::Any tmp_any; Tango::DevVarDoubleArray tmp_seq(val.size(),val.size(),&val[0],false); tmp_any <<= tmp_seq; check_written_value(tmp_any, x, y); copy_data(tmp_any); set_user_set_write_value(true); } // DevString: void WAttribute::set_write_value(Tango::DevString val) { Tango::DevVarStringArray tmp_seq(1); tmp_seq.length(1); tmp_seq[0] = CORBA::string_dup(val); CORBA::Any tmp_any; tmp_any <<= tmp_seq; check_written_value(tmp_any,1,0); copy_data(tmp_any); set_user_set_write_value(true); } void WAttribute::set_write_value(string &val) { Tango::DevVarStringArray tmp_seq(1); tmp_seq.length(1); tmp_seq[0] = val.c_str(); CORBA::Any tmp_any; tmp_any <<= tmp_seq; check_written_value(tmp_any,1,0); copy_data(tmp_any); set_user_set_write_value(true); } void WAttribute::set_write_value(Tango::DevString *val, long x, long y) { long nb_data; if (y == 0) nb_data = x; else nb_data = x * y; Tango::DevVarStringArray tmp_seq(nb_data,nb_data,val,false); CORBA::Any tmp_any; tmp_any <<= tmp_seq; check_written_value(tmp_any, x, y); copy_data(tmp_any); set_user_set_write_value(true); } void WAttribute::set_write_value(vector &val, long x, long y) { Tango::DevVarStringArray tmp_seq; tmp_seq << val; CORBA::Any tmp_any; tmp_any <<= tmp_seq; check_written_value(tmp_any, x, y); copy_data(tmp_any); set_user_set_write_value(true); } // DevFloat: void WAttribute::set_write_value(Tango::DevFloat val) { Tango::DevVarFloatArray tmp_seq(1); tmp_seq.length(1); tmp_seq[0] = val; CORBA::Any tmp_any; tmp_any <<= tmp_seq; check_written_value(tmp_any,1,0); copy_data(tmp_any); set_user_set_write_value(true); } void WAttribute::set_write_value(Tango::DevFloat *val, long x, long y) { long nb_data; if (y == 0) nb_data = x; else nb_data = x * y; Tango::DevVarFloatArray tmp_seq(nb_data,nb_data,val,false); CORBA::Any tmp_any; tmp_any <<= tmp_seq; check_written_value(tmp_any, x, y); copy_data(tmp_any); set_user_set_write_value(true); } void WAttribute::set_write_value(vector &val, long x, long y) { Tango::DevVarFloatArray tmp_seq(val.size(),val.size(),&val[0],false); CORBA::Any tmp_any; tmp_any <<= tmp_seq; check_written_value(tmp_any, x, y); copy_data(tmp_any); set_user_set_write_value(true); } // DevBoolean: void WAttribute::set_write_value(Tango::DevBoolean val) { Tango::DevVarBooleanArray tmp_seq(1); tmp_seq.length(1); tmp_seq[0] = val; CORBA::Any tmp_any; tmp_any <<= tmp_seq; check_written_value(tmp_any,1,0); copy_data(tmp_any); set_user_set_write_value(true); } void WAttribute::set_write_value(Tango::DevBoolean *val, long x, long y) { long nb_data; if (y == 0) nb_data = x; else nb_data = x * y; Tango::DevVarBooleanArray tmp_seq(nb_data,nb_data,val,false); CORBA::Any tmp_any; tmp_any <<= tmp_seq; check_written_value(tmp_any, x, y); copy_data(tmp_any); set_user_set_write_value(true); } void WAttribute::set_write_value(vector &val, long x, long y) { Tango::DevVarBooleanArray tmp_seq; tmp_seq << val; CORBA::Any tmp_any; tmp_any <<= tmp_seq; check_written_value(tmp_any, x, y); copy_data(tmp_any); set_user_set_write_value(true); } // DevUShort: void WAttribute::set_write_value(Tango::DevUShort val) { Tango::DevVarUShortArray tmp_seq(1); tmp_seq.length(1); tmp_seq[0] = val; CORBA::Any tmp_any; tmp_any <<= tmp_seq; check_written_value(tmp_any,1,0); copy_data(tmp_any); set_user_set_write_value(true); } void WAttribute::set_write_value(Tango::DevUShort *val, long x, long y) { long nb_data; if (y == 0) nb_data = x; else nb_data = x * y; Tango::DevVarUShortArray tmp_seq(nb_data,nb_data,val,false); CORBA::Any tmp_any; tmp_any <<= tmp_seq; check_written_value(tmp_any, x, y); copy_data(tmp_any); set_user_set_write_value(true); } void WAttribute::set_write_value(vector &val, long x, long y) { Tango::DevVarUShortArray tmp_seq(val.size(),val.size(),&val[0],false); CORBA::Any tmp_any; tmp_any <<= tmp_seq; check_written_value(tmp_any, x, y); copy_data(tmp_any); set_user_set_write_value(true); } // DevUChar: void WAttribute::set_write_value(Tango::DevUChar val) { Tango::DevVarCharArray tmp_seq(1); tmp_seq.length(1); tmp_seq[0] = val; CORBA::Any tmp_any; tmp_any <<= tmp_seq; check_written_value(tmp_any,1,0); copy_data(tmp_any); set_user_set_write_value(true); } void WAttribute::set_write_value(Tango::DevUChar *val, long x, long y) { long nb_data; if (y == 0) nb_data = x; else nb_data = x * y; Tango::DevVarUCharArray tmp_seq(nb_data,nb_data,val,false); CORBA::Any tmp_any; tmp_any <<= tmp_seq; check_written_value(tmp_any, x, y); copy_data(tmp_any); set_user_set_write_value(true); } void WAttribute::set_write_value(vector &val, long x, long y) { Tango::DevVarUCharArray tmp_seq(val.size(),val.size(),&val[0],false); CORBA::Any tmp_any; tmp_any <<= tmp_seq; check_written_value(tmp_any, x, y); copy_data(tmp_any); set_user_set_write_value(true); } // DevULong: void WAttribute::set_write_value(Tango::DevULong val) { Tango::DevVarULongArray tmp_seq(1); tmp_seq.length(1); tmp_seq[0] = val; CORBA::Any tmp_any; tmp_any <<= tmp_seq; check_written_value(tmp_any,1,0); copy_data(tmp_any); set_user_set_write_value(true); } void WAttribute::set_write_value(Tango::DevULong *val, long x, long y) { long nb_data; if (y == 0) nb_data = x; else nb_data = x * y; Tango::DevVarULongArray tmp_seq(nb_data,nb_data,val,false); CORBA::Any tmp_any; tmp_any <<= tmp_seq; check_written_value(tmp_any, x, y); copy_data(tmp_any); set_user_set_write_value(true); } void WAttribute::set_write_value(vector &val, long x, long y) { Tango::DevVarULongArray tmp_seq(val.size(),val.size(),&val[0],false); CORBA::Any tmp_any; tmp_any <<= tmp_seq; check_written_value(tmp_any, x, y); copy_data(tmp_any); set_user_set_write_value(true); } // DevULong64: void WAttribute::set_write_value(Tango::DevULong64 val) { Tango::DevVarULong64Array tmp_seq(1); tmp_seq.length(1); tmp_seq[0] = val; CORBA::Any tmp_any; tmp_any <<= tmp_seq; check_written_value(tmp_any,1,0); copy_data(tmp_any); set_user_set_write_value(true); } void WAttribute::set_write_value(Tango::DevULong64 *val, long x, long y) { long nb_data; if (y == 0) nb_data = x; else nb_data = x * y; Tango::DevVarULong64Array tmp_seq(nb_data,nb_data,val,false); CORBA::Any tmp_any; tmp_any <<= tmp_seq; check_written_value(tmp_any, x, y); copy_data(tmp_any); set_user_set_write_value(true); } void WAttribute::set_write_value(vector &val, long x, long y) { Tango::DevVarULong64Array tmp_seq(val.size(),val.size(),&val[0],false); CORBA::Any tmp_any; tmp_any <<= tmp_seq; check_written_value(tmp_any, x, y); copy_data(tmp_any); set_user_set_write_value(true); } // DevState: void WAttribute::set_write_value(Tango::DevState val) { Tango::DevVarStateArray tmp_seq(1); tmp_seq.length(1); tmp_seq[0] = val; CORBA::Any tmp_any; tmp_any <<= tmp_seq; check_written_value(tmp_any,1,0); copy_data(tmp_any); set_user_set_write_value(true); } void WAttribute::set_write_value(Tango::DevState *val, long x, long y) { long nb_data; if (y == 0) nb_data = x; else nb_data = x * y; Tango::DevVarStateArray tmp_seq(nb_data,nb_data,val,false); CORBA::Any tmp_any; tmp_any <<= tmp_seq; check_written_value(tmp_any, x, y); copy_data(tmp_any); set_user_set_write_value(true); } void WAttribute::set_write_value(vector &val, long x, long y) { Tango::DevVarStateArray tmp_seq(val.size(),val.size(),&val[0],false); CORBA::Any tmp_any; tmp_any <<= tmp_seq; check_written_value(tmp_any, x, y); copy_data(tmp_any); set_user_set_write_value(true); } void WAttribute::set_write_value(Tango::DevEncoded *, TANGO_UNUSED(long x),TANGO_UNUSED(long y)) { // // Dummy method just to make compiler happy when using fill_attr_polling_buffer for DevEncoded // attribute // Should never be called // Tango::Except::throw_exception((const char *)API_NotSupportedFeature, (const char *)"This is a not supported call in case of DevEncoded attribute", (const char *)"Wattribute::set_write_value()"); } //+------------------------------------------------------------------------- // // method : WAttribute::rollback // // description : Reset the internal data to its value before the // set_write_value method was applied (Useful in case of // error in the set_write_value method) // //-------------------------------------------------------------------------- void WAttribute::rollback() { switch (data_type) { case Tango::DEV_SHORT : short_val = old_short_val; break; case Tango::DEV_LONG : long_val = old_long_val; break; case Tango::DEV_LONG64 : w_ext->long64_val = w_ext->old_long64_val; break; case Tango::DEV_DOUBLE : double_val = old_double_val; break; case Tango::DEV_STRING : CORBA::string_free(str_val); str_val = CORBA::string_dup(old_str_val); break; case Tango::DEV_FLOAT : float_val = old_float_val; break; case Tango::DEV_BOOLEAN : boolean_val = old_boolean_val; break; case Tango::DEV_USHORT : double_val = old_double_val; break; case Tango::DEV_UCHAR : CORBA::string_free(str_val); break; case Tango::DEV_ULONG : w_ext->ulong_val = w_ext->old_ulong_val; break; case Tango::DEV_ULONG64 : w_ext->ulong64_val = w_ext->old_ulong64_val; break; case Tango::DEV_STATE : w_ext->dev_state_val = w_ext->old_dev_state_val; break; } } //+------------------------------------------------------------------------- // // method : WAttribute::copy_data // // description : Copy data into the attribute object in order to return // them in case of a read on this attribute // // in : any : Reference to the CORBA Any object // //-------------------------------------------------------------------------- void WAttribute::copy_data(const CORBA::Any &any) { switch (data_type) { case Tango::DEV_SHORT : const Tango::DevVarShortArray *sh_ptr; any >>= sh_ptr; short_array_val = *sh_ptr; break; case Tango::DEV_LONG : const Tango::DevVarLongArray *lo_ptr; any >>= lo_ptr; long_array_val = *lo_ptr; break; case Tango::DEV_LONG64 : const Tango::DevVarLong64Array *lo64_ptr; any >>= lo64_ptr; w_ext->long64_array_val = *lo64_ptr; break; case Tango::DEV_DOUBLE : const Tango::DevVarDoubleArray *db_ptr; any >>= db_ptr; double_array_val = *db_ptr; break; case Tango::DEV_STRING : const Tango::DevVarStringArray *tmp_str_ptr; any >>= tmp_str_ptr; str_array_val = *tmp_str_ptr; break; case Tango::DEV_FLOAT : const Tango::DevVarFloatArray *fl_ptr; any >>= fl_ptr; float_array_val = *fl_ptr; break; case Tango::DEV_BOOLEAN : const Tango::DevVarBooleanArray *boo_ptr; any >>= boo_ptr; boolean_array_val = *boo_ptr; break; case Tango::DEV_USHORT : const Tango::DevVarUShortArray *ush_ptr; any >>= ush_ptr; ushort_array_val = *ush_ptr; break; case Tango::DEV_UCHAR : const Tango::DevVarCharArray *uch_ptr; any >>= uch_ptr; uchar_array_val = *uch_ptr; break; case Tango::DEV_ULONG : const Tango::DevVarULongArray *ulo_ptr; any >>= ulo_ptr; w_ext->ulong_array_val = *ulo_ptr; break; case Tango::DEV_ULONG64 : const Tango::DevVarULong64Array *ulo64_ptr; any >>= ulo64_ptr; w_ext->ulong64_array_val = *ulo64_ptr; break; case Tango::DEV_STATE : const Tango::DevVarStateArray *sta_ptr; any >>= sta_ptr; w_ext->state_array_val = *sta_ptr; break; } } void WAttribute::copy_data(const Tango::AttrValUnion &the_union) { switch (data_type) { case Tango::DEV_SHORT : short_array_val = the_union.short_att_value(); break; case Tango::DEV_LONG : long_array_val = the_union.long_att_value(); break; case Tango::DEV_LONG64 : w_ext->long64_array_val = the_union.long64_att_value(); break; case Tango::DEV_DOUBLE : double_array_val = the_union.double_att_value(); break; case Tango::DEV_STRING : str_array_val = the_union.string_att_value(); break; case Tango::DEV_FLOAT : float_array_val = the_union.float_att_value(); break; case Tango::DEV_BOOLEAN : boolean_array_val = the_union.bool_att_value(); break; case Tango::DEV_USHORT : ushort_array_val = the_union.ushort_att_value(); break; case Tango::DEV_UCHAR : uchar_array_val = the_union.uchar_att_value(); break; case Tango::DEV_ULONG : w_ext->ulong_array_val = the_union.ulong_att_value(); break; case Tango::DEV_ULONG64 : w_ext->ulong64_array_val = the_union.ulong64_att_value(); break; case Tango::DEV_STATE : w_ext->state_array_val = the_union.state_att_value(); break; } } //+------------------------------------------------------------------------- // // method : WAttribute::set_written_date // // description : Memorized when the attribute is written // //-------------------------------------------------------------------------- void WAttribute::set_written_date() { #ifdef _TG_WINDOWS_ struct _timeb t; _ftime(&t); write_date.tv_sec = (CORBA::Long)t.time; write_date.tv_usec = (CORBA::Long)(t.millitm * 1000); #else struct timezone tz; struct timeval tv; gettimeofday(&tv,&tz); write_date.tv_sec = (CORBA::Long)tv.tv_sec; write_date.tv_usec = (CORBA::Long)tv.tv_usec; #endif } //+------------------------------------------------------------------------- // // method : WAttribute::check_rds_alarm // // description : Check if the attribute is in read different from set // alarm. // // This method returns true if the attribute has a read too different than the // the last set value. Otherwise, returns false. // //-------------------------------------------------------------------------- bool WAttribute::check_rds_alarm() { bool ret = false; // // Return immediately if the attribute has never been written // if (write_date.tv_sec == 0) return false; // // First, check if it is necessary to check attribute value // Give some time to the device to change its output // struct timeval tv; #ifdef _TG_WINDOWS_ struct _timeb t; _ftime(&t); tv.tv_sec = (CORBA::Long)t.time; tv.tv_usec = (CORBA::Long)(t.millitm * 1000); #else struct timezone tz; gettimeofday(&tv,&tz); #endif long time_diff; COMPUTE_TIME_DIFF(time_diff,write_date,tv); if (time_diff >= delta_t) { // // Now check attribute value with again a switch on attribute data type // long nb_written,nb_read,nb_data,i; switch (data_type) { case Tango::DEV_SHORT: nb_written = short_array_val.length(); nb_read = (data_format == Tango::SCALAR) ? 1 : value.sh_seq->length(); nb_data = (nb_written > nb_read) ? nb_read : nb_written; for (i = 0;i < nb_data;i++) { short delta = (data_format == Tango::SCALAR) ? short_array_val[0] - tmp_sh[0] : short_array_val[i] - (*value.sh_seq)[i]; if (abs(delta) >= delta_val.sh) { quality = Tango::ATTR_ALARM; alarm.set(rds); ret = true; break; } } break; case Tango::DEV_LONG: nb_written = long_array_val.length(); nb_read = (data_format == Tango::SCALAR) ? 1 : value.lg_seq->length(); nb_data = (nb_written > nb_read) ? nb_read : nb_written; for (i = 0;i < nb_data;i++) { DevLong delta = (data_format == Tango::SCALAR) ? long_array_val[0] - tmp_lo[0] : long_array_val[i] - (*value.lg_seq)[i]; if (abs(delta) >= delta_val.lg) { quality = Tango::ATTR_ALARM; alarm.set(rds); ret = true; break; } } break; case Tango::DEV_LONG64: nb_written = w_ext->long64_array_val.length(); nb_read = (data_format == Tango::SCALAR) ? 1 : value.lg64_seq->length(); nb_data = (nb_written > nb_read) ? nb_read : nb_written; for (i = 0;i < nb_data;i++) { DevLong64 delta = (data_format == Tango::SCALAR) ? w_ext->long64_array_val[0] - get_tmp_scalar_long64()[0] : w_ext->long64_array_val[i] - (*value.lg64_seq)[i]; DevLong64 abs_delta; if (delta < 0) abs_delta = -delta; else abs_delta = delta; if (abs_delta >= delta_val.lg64) { quality = Tango::ATTR_ALARM; alarm.set(rds); ret = true; break; } } break; case Tango::DEV_DOUBLE: nb_written = double_array_val.length(); nb_read = (data_format == Tango::SCALAR) ? 1 : value.db_seq->length(); nb_data = (nb_written > nb_read) ? nb_read : nb_written; for (i = 0;i < nb_data;i++) { // check for NAN values if ( data_format == Tango::SCALAR ) { if ( Tango_isnan(double_array_val[0]) || Tango_isnan(tmp_db[0]) ) { // send an alarm if only read or set value are NAN if ( !(Tango_isnan(double_array_val[0]) && Tango_isnan(tmp_db[0])) ) { quality = Tango::ATTR_ALARM; alarm.set(rds); ret = true; break; } } } else { if ( Tango_isnan(double_array_val[i]) || Tango_isnan((*value.db_seq)[i]) ) { // send an alarm if only read or set value are NAN if ( !(Tango_isnan(double_array_val[i]) && Tango_isnan((*value.db_seq)[i])) ) { quality = Tango::ATTR_ALARM; alarm.set(rds); ret = true; break; } } } double delta = (data_format == Tango::SCALAR) ? double_array_val[0] - tmp_db[0] : double_array_val[i] - (*value.db_seq)[i]; if (fabs(delta) >= delta_val.db) { quality = Tango::ATTR_ALARM; alarm.set(rds); ret = true; break; } } break; case Tango::DEV_FLOAT: nb_written = float_array_val.length(); nb_read = (data_format == Tango::SCALAR) ? 1 : value.fl_seq->length(); nb_data = (nb_written > nb_read) ? nb_read : nb_written; for (i = 0;i < nb_data;i++) { // check for NAN values if ( data_format == Tango::SCALAR ) { if ( Tango_isnan(float_array_val[0]) || Tango_isnan(tmp_fl[0]) ) { // send an alarm if only read or set value are NAN if ( !(Tango_isnan(float_array_val[0]) && Tango_isnan(tmp_fl[0])) ) { quality = Tango::ATTR_ALARM; alarm.set(rds); ret = true; break; } } } else { if ( Tango_isnan(float_array_val[i]) || Tango_isnan((*value.fl_seq)[i]) ) { // send an alarm if only read or set value are NAN if ( !(Tango_isnan(float_array_val[i]) && Tango_isnan((*value.fl_seq)[i])) ) { quality = Tango::ATTR_ALARM; alarm.set(rds); ret = true; break; } } } float delta = (data_format == Tango::SCALAR) ? float_array_val[0] - tmp_fl[0] : float_array_val[i] - (*value.fl_seq)[i]; double delta_d = (double)delta; if (((float)fabs(delta_d)) >= delta_val.fl) { quality = Tango::ATTR_ALARM; alarm.set(rds); ret = true; break; } } break; case Tango::DEV_USHORT: nb_written = ushort_array_val.length(); nb_read = (data_format == Tango::SCALAR) ? 1 : value.ush_seq->length(); nb_data = (nb_written > nb_read) ? nb_read : nb_written; for (i = 0;i < nb_data;i++) { unsigned short delta = (data_format == Tango::SCALAR) ? ushort_array_val[0] - tmp_ush[0] : ushort_array_val[i] - (*value.ush_seq)[i]; if (abs(delta) >= delta_val.ush) { quality = Tango::ATTR_ALARM; alarm.set(rds); ret = true; break; } } break; case Tango::DEV_UCHAR: nb_written = uchar_array_val.length(); nb_read = (data_format == Tango::SCALAR) ? 1 : value.cha_seq->length(); nb_data = (nb_written > nb_read) ? nb_read : nb_written; for (i = 0;i < nb_data;i++) { unsigned char delta = (data_format == Tango::SCALAR) ? uchar_array_val[0] - tmp_cha[0] : uchar_array_val[i] - (*value.cha_seq)[i]; if (abs(delta) >= delta_val.uch) { quality = Tango::ATTR_ALARM; alarm.set(rds); ret = true; break; } } break; case Tango::DEV_ULONG: nb_written = w_ext->ulong_array_val.length(); nb_read = (data_format == Tango::SCALAR) ? 1 : value.ulg_seq->length(); nb_data = (nb_written > nb_read) ? nb_read : nb_written; for (i = 0;i < nb_data;i++) { DevLong delta = (data_format == Tango::SCALAR) ? w_ext->ulong_array_val[0] - get_tmp_scalar_ulong()[0] : w_ext->ulong_array_val[i] - (*value.ulg_seq)[i]; if ((unsigned int)abs(delta) >= delta_val.ulg) { quality = Tango::ATTR_ALARM; alarm.set(rds); ret = true; break; } } break; case Tango::DEV_ULONG64: nb_written = w_ext->ulong64_array_val.length(); nb_read = (data_format == Tango::SCALAR) ? 1 : value.ulg64_seq->length(); nb_data = (nb_written > nb_read) ? nb_read : nb_written; for (i = 0;i < nb_data;i++) { DevLong64 delta = (data_format == Tango::SCALAR) ? w_ext->ulong64_array_val[0] - get_tmp_scalar_ulong64()[0] : w_ext->ulong64_array_val[i] - (*value.ulg64_seq)[i]; DevULong64 abs_delta; if (delta < 0) abs_delta = -delta; else abs_delta = delta; if (abs_delta >= delta_val.ulg64) { quality = Tango::ATTR_ALARM; alarm.set(rds); ret = true; break; } } break; case Tango::DEV_ENCODED: nb_written = ::strlen(encoded_val.encoded_format.in()); nb_read = ::strlen((*value.enc_seq)[0].encoded_format.in()); if (nb_written != nb_read) { quality = Tango::ATTR_ALARM; alarm.set(rds); ret = true; break; } if (::strcmp(encoded_val.encoded_format.in(),(*value.enc_seq)[0].encoded_format.in()) != 0) { quality = Tango::ATTR_ALARM; alarm.set(rds); ret = true; break; } nb_written = encoded_val.encoded_data.length(); nb_read = (*value.enc_seq)[0].encoded_data.length(); nb_data = (nb_written > nb_read) ? nb_read : nb_written; for (i = 0;i < nb_data;i++) { unsigned char delta = encoded_val.encoded_data[i] - (*value.enc_seq)[0].encoded_data[i]; if (abs(delta) >= delta_val.uch) { quality = Tango::ATTR_ALARM; alarm.set(rds); ret = true; break; } } break; } } return ret; } void WAttribute::set_min_value(char *new_min_value_str) { set_min_value(string(new_min_value_str)); } void WAttribute::set_min_value(const char *new_min_value_str) { set_min_value(string(new_min_value_str)); } void WAttribute::set_max_value(char *new_max_value_str) { set_max_value(string(new_max_value_str)); } void WAttribute::set_max_value(const char *new_max_value_str) { set_max_value(string(new_max_value_str)); } //+------------------------------------------------------------------------- // // method : WAttribute::mem_value_below_above() // // description : Check if the attribute last written value is below // (or above) the new threshold sent by the requester // // Arg in : check_type : Which check has to be done: Below or above // // This method returns true if the new threshold wanted by the user is not // coherent with the memorized value. Otherwise, returns false. // //-------------------------------------------------------------------------- bool WAttribute::mem_value_below_above(MinMaxValueCheck check_type,string &ret_mem_value) { bool ret = false; if (mem_value == MemNotUsed) return false; // // Check last written attribute value with the new threshold // long nb_written,i; stringstream ss; DevLong lg_val; DevShort sh_val; DevLong64 lg64_val; DevDouble db_val; DevFloat fl_val; DevUShort ush_val; DevUChar uch_val; DevULong ulg_val; DevULong64 ulg64_val; Tango::Util *tg = Tango::Util::instance(); bool svr_starting = tg->is_svr_starting(); switch (data_type) { case Tango::DEV_SHORT: if (svr_starting == true) { ss << mem_value; ss >> sh_val; if (check_type == MIN) { if (sh_val < min_value.sh) { ret_mem_value = mem_value; ret = true; } } else { if (sh_val > max_value.sh) { ret_mem_value = mem_value; ret = true; } } } else { nb_written = short_array_val.length(); for (i = 0;i < nb_written;i++) { if (check_type == MIN) { if (short_array_val[i] < min_value.sh) { ss << short_array_val[i]; ret_mem_value = ss.str(); ret = true; break; } } else { if (short_array_val[i] > max_value.sh) { ss << short_array_val[i]; ret_mem_value = ss.str(); ret = true; break; } } } } break; case Tango::DEV_LONG: if (svr_starting == true) { ss << mem_value; ss >> lg_val; if (check_type == MIN) { if (lg_val < min_value.lg) { ret_mem_value = mem_value; ret = true; } } else { if (lg_val > max_value.lg) { ret_mem_value = mem_value; ret = true; } } } else { nb_written = long_array_val.length(); for (i = 0;i < nb_written;i++) { if (check_type == MIN) { if (long_array_val[i] < min_value.lg) { ss << long_array_val[i]; ret_mem_value = ss.str(); ret = true; break; } } else { if (long_array_val[i] > max_value.lg) { ss << long_array_val[i]; ret_mem_value = ss.str(); ret = true; break; } } } } break; case Tango::DEV_LONG64: if (svr_starting == true) { ss << mem_value; ss >> lg64_val; if (check_type == MIN) { if (lg64_val < min_value.lg64) { ret_mem_value = mem_value; ret = true; } } else { if (lg64_val > max_value.lg64) { ret_mem_value = mem_value; ret = true; } } } else { nb_written = w_ext->long64_array_val.length(); for (i = 0;i < nb_written;i++) { if (check_type == MIN) { if (w_ext->long64_array_val[i] < min_value.lg64) { ss << w_ext->long64_array_val[i]; ret_mem_value = ss.str(); ret = true; break; } } else { if (w_ext->long64_array_val[i] > max_value.lg64) { ss << w_ext->long64_array_val[i]; ret_mem_value = ss.str(); ret = true; break; } } } } break; case Tango::DEV_DOUBLE: if (svr_starting == true) { ss << mem_value; ss >> db_val; if (check_type == MIN) { if (db_val < min_value.db) { ret_mem_value = mem_value; ret = true; } } else { if (db_val > max_value.db) { ret_mem_value = mem_value; ret = true; } } } else { nb_written = double_array_val.length(); for (i = 0;i < nb_written;i++) { if (check_type == MIN) { if (double_array_val[i] < min_value.db) { ss << double_array_val[i]; ret_mem_value = ss.str(); ret = true; break; } } else { if (double_array_val[i] > max_value.db) { ss << double_array_val[i]; ret_mem_value = ss.str(); ret = true; break; } } } } break; case Tango::DEV_FLOAT: if (svr_starting == true) { ss << mem_value; ss >> fl_val; if (check_type == MIN) { if (fl_val < min_value.fl) { ret_mem_value = mem_value; ret = true; } } else { if (fl_val > max_value.fl) { ret_mem_value = mem_value; ret = true; } } } else { nb_written = float_array_val.length(); for (i = 0;i < nb_written;i++) { if (check_type == MIN) { if (float_array_val[i] < min_value.fl) { ss << float_array_val[i]; ret_mem_value = ss.str(); ret = true; break; } } else { if (float_array_val[i] > max_value.fl) { ss << float_array_val[i]; ret_mem_value = ss.str(); ret = true; break; } } } } break; case Tango::DEV_USHORT: if (svr_starting == true) { ss << mem_value; ss >> ush_val; if (check_type == MIN) { if (ush_val < min_value.ush) { ret_mem_value = mem_value; ret = true; } } else { if (ush_val > max_value.ush) { ret_mem_value = mem_value; ret = true; } } } else { nb_written = ushort_array_val.length(); for (i = 0;i < nb_written;i++) { if (check_type == MIN) { if (ushort_array_val[i] < min_value.ush) { ss << ushort_array_val[i]; ret_mem_value = ss.str(); ret = true; break; } } else { if (ushort_array_val[i] > max_value.ush) { ss << ushort_array_val[i]; ret_mem_value = ss.str(); ret = true; break; } } } } break; case Tango::DEV_UCHAR: if (svr_starting == true) { ss << mem_value; ss >> uch_val; if (check_type == MIN) { if (uch_val < min_value.uch) { ret_mem_value = mem_value; ret = true; } } else { if (uch_val > max_value.uch) { ret_mem_value = mem_value; ret = true; } } } else { nb_written = uchar_array_val.length(); for (i = 0;i < nb_written;i++) { if (check_type == MIN) { if (uchar_array_val[i] < min_value.uch) { ss << uchar_array_val[i]; ret_mem_value = ss.str(); ret = true; break; } } else { if (uchar_array_val[i] > max_value.uch) { ss << uchar_array_val[i]; ret_mem_value = ss.str(); ret = true; break; } } } } break; case Tango::DEV_ULONG: if (svr_starting == true) { ss << mem_value; ss >> ulg_val; if (check_type == MIN) { if (ulg_val < min_value.ulg) { ret_mem_value = mem_value; ret = true; } } else { if (ulg_val > max_value.ulg) { ret_mem_value = mem_value; ret = true; } } } else { nb_written = w_ext->ulong_array_val.length(); for (i = 0;i < nb_written;i++) { if (check_type == MIN) { if (w_ext->ulong_array_val[i] < min_value.ulg) { ss << w_ext->ulong_array_val[i]; ret_mem_value = ss.str(); ret = true; break; } } else { if (w_ext->ulong_array_val[i] > max_value.ulg) { ss << w_ext->ulong_array_val[i]; ret_mem_value = ss.str(); ret = true; break; } } } } break; case Tango::DEV_ULONG64: if (svr_starting == true) { ss << mem_value; ss >> ulg64_val; if (check_type == MIN) { if (ulg64_val < min_value.ulg64) { ret_mem_value = mem_value; ret = true; } } else { if (ulg64_val > max_value.ulg64) { ret_mem_value = mem_value; ret = true; } } } else { nb_written = w_ext->ulong64_array_val.length(); for (i = 0;i < nb_written;i++) { if (check_type == MIN) { if (w_ext->ulong64_array_val[i] < min_value.ulg64) { ss << w_ext->ulong64_array_val[i]; ret_mem_value = ss.str(); ret = true; break; } } else { if (w_ext->ulong64_array_val[i] > max_value.ulg64) { ss << w_ext->ulong64_array_val[i]; ret_mem_value = ss.str(); ret = true; break; } } } } break; default: break; } return ret; } } // End of Tango namespace tango-8.1.2c+dfsg.orig/lib/cpp/server/dserversignal.cpp0000644000175000017500000005422212205375142022013 0ustar piccapiccastatic const char *RcsId = "$Id: dserversignal.cpp 22503 2013-04-23 07:42:21Z taurel $\n$Name$"; //+============================================================================= // // file : DServerSignal.cpp // // description : C++ source for the DServer class and its commands. // The class is derived from Device. It represents the // CORBA servant object which will be accessed from the // network. All commands which can be executed on a // DServer object are implemented in this file. // // project : TANGO // // author(s) : A.Gotz + E.Taurel // // Copyright (C) : 2004,2005,2006,2007,2008,2009,2010,2011,2012,2013 // European Synchrotron Radiation Facility // BP 220, Grenoble 38043 // FRANCE // // This file is part of Tango. // // Tango 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. // // Tango 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 Tango. If not, see . // // $Revision: 22503 $ // //-============================================================================= #if HAVE_CONFIG_H #include #endif #include #include #include #ifndef _TG_WINDOWS_ extern int errno; #endif namespace Tango { DServerSignal *DServerSignal::_instance = NULL; DevSigAction DServerSignal::reg_sig[_NSIG]; string DServerSignal::sig_name[_NSIG]; #ifdef _TG_WINDOWS_ HANDLE DServerSignal::win_ev = NULL; int DServerSignal::win_signo = 0; #endif //+---------------------------------------------------------------------------- // // method : DServerSignal::Instance() // // description : Instance method for DServerSignal object. This class is // a singleton and this method creates the object the // first time it is called or simply returns a pointer // to the already created object for all the other calls. // //----------------------------------------------------------------------------- DServerSignal *DServerSignal::instance() { if (_instance == NULL) { try { _instance = new DServerSignal(); } catch (bad_alloc) { throw; } } return _instance; } //+---------------------------------------------------------------------------- // // method : DServerSignal::DServerSignal() // // description : constructor for DServerSignal object. As this class is // a singleton, this method is protected // //----------------------------------------------------------------------------- DServerSignal::DServerSignal():TangoMonitor("signal") { cout4 << "Entering DServerSignal constructor" << endl; // // Set array of signal name // #ifdef _TG_WINDOWS_ sig_name[SIGINT] = "SIGINT"; sig_name[SIGILL] = "SIGILL"; sig_name[SIGFPE] = "SIGFPE"; sig_name[SIGSEGV] = "SIGSEGV"; sig_name[SIGTERM] = "SIGTERM"; sig_name[SIGBREAK] = "SIGBREAK"; sig_name[SIGABRT] = "SIGABRT"; #else sig_name[SIGHUP] = "SIGHUP"; sig_name[SIGINT] = "SIGINT"; sig_name[SIGQUIT] = "SIGQUIT"; sig_name[SIGILL] = "SIGILL"; sig_name[SIGTRAP] = "SIGTRAP"; sig_name[SIGABRT] = "SIGABRT"; sig_name[SIGFPE] = "SIGFPE"; sig_name[SIGKILL] = "SIGKILL"; sig_name[SIGBUS] = "SIGBUS"; sig_name[SIGSEGV] = "SIGSEGV"; sig_name[SIGPIPE] = "SIGPIPE"; sig_name[SIGALRM] = "SIGALRM"; sig_name[SIGTERM] = "SIGTERM"; sig_name[SIGUSR1] = "SIGUSR1"; sig_name[SIGUSR2] = "SIGUSR2"; sig_name[SIGCHLD] = "SIGCHLD"; sig_name[SIGVTALRM] = "SIGVTALRM"; sig_name[SIGPROF] = "SIGPROF"; sig_name[SIGIO] = "SIGIO"; sig_name[SIGWINCH] = "SIGWINCH"; sig_name[SIGSTOP] = "SIGSTOP"; sig_name[SIGTSTP] = "SIGTSTP"; sig_name[SIGCONT] = "SIGCONT"; sig_name[SIGTTIN] = "SIGTTIN"; sig_name[SIGTTOU] = "SIGTTOU"; sig_name[SIGURG] = "SIGURG"; sig_name[SIGSYS] = "SIGSYS"; #ifdef linux sig_name[SIGXCPU] = "SIGXCPU"; sig_name[SIGXFSZ] = "SIGXFSZ"; sig_name[SIGCLD] = "SIGCLD"; sig_name[SIGPWR] = "SIGPWR"; #else #ifdef __darwin__ sig_name[SIGEMT] = "SIGEMT"; sig_name[SIGINFO] = "SIGINFO"; #else #ifdef __freebsd__ sig_name[SIGXCPU] = "SIGXCPU"; sig_name[SIGXFSZ] = "SIGXFSZ"; #endif /* __freebsd__ */ #endif /* __darwin__ */ #endif /* linux */ #endif /* _TG_WINDOWS_ */ TangoSys_OMemStream o; for (long i = 0;i < _NSIG;i++) { if (sig_name[i].size() == 0) { o << i << ends; sig_name[i] = o.str(); o.seekp(0); o.clear(); } } sig_to_install = false; sig_to_remove = false; #ifndef _TG_WINDOWS_ // // With Solaris/Linux, the SIGINT and SIGQUIT default actions are set to SIG_IGN for // all processes started in the background (POSIX requirement). Signal SIGINT is used by // Tango in its signal management, reset the default action to default // struct sigaction sa; sa.sa_flags = 0; sa.sa_handler = SIG_DFL; sigemptyset(&sa.sa_mask); if (sigaction(SIGINT,&sa,NULL) == -1) cerr << "DServerSignal::DServerSignal --> Can't reset default action for SIGINT to SIG_DFL" << endl; if (sigaction(SIGQUIT,&sa,NULL) == -1) cerr << "DServerSignal::DServerSignal --> Can't reset default action for SIGQUIT to SIG_DFL" << endl; // // Block signals in thread other than the thread dedicated to signal // sigset_t sigs_to_block; sigemptyset(&sigs_to_block); sigfillset(&sigs_to_block); sigdelset(&sigs_to_block,SIGABRT); sigdelset(&sigs_to_block,SIGKILL); sigdelset(&sigs_to_block,SIGILL); sigdelset(&sigs_to_block,SIGTRAP); sigdelset(&sigs_to_block,SIGIOT); sigdelset(&sigs_to_block,SIGFPE); sigdelset(&sigs_to_block,SIGBUS); sigdelset(&sigs_to_block,SIGSEGV); sigdelset(&sigs_to_block,SIGSYS); sigdelset(&sigs_to_block,SIGPIPE); sigdelset(&sigs_to_block,SIGSTOP); sigdelset(&sigs_to_block,SIGTSTP); sigdelset(&sigs_to_block,SIGUSR1); sigdelset(&sigs_to_block,SIGUSR2); sigprocmask(SIG_BLOCK,&sigs_to_block,NULL); #else /* _TG_WINDOWS_ */ win_ev = CreateEvent(NULL,FALSE,FALSE,NULL); register_handler(SIGINT); register_handler(SIGTERM); register_handler(SIGABRT); if (Util::_service == false) register_handler(SIGBREAK); #endif /* _TG_WINDOWS_ */ // // Start the thread dedicated to signal // sig_th = new ThSig(this); sig_th->start(); cout4 << "leaving DServerSignal constructor" << endl; } //+---------------------------------------------------------------------------- // // method : DServerSignal::register_class_signal() // // description : method to register a signal handler at the class // level // // in : long signo - Signal number // DeviceClass *cl_ptr - Pointer to device class object // //----------------------------------------------------------------------------- #if defined _TG_WINDOWS_ void DServerSignal::register_class_signal(long signo,DeviceClass *cl_ptr) #else void DServerSignal::register_class_signal(long signo,bool handler,DeviceClass *cl_ptr) #endif { // // Check signal validity // if ((signo < 1) || (signo >= _NSIG)) { TangoSys_OMemStream o; o << "Signal number " << signo << " out of range" << ends; Except::throw_exception((const char *)API_SignalOutOfRange, o.str(), (const char *)"DServerSignal::register_class_signal"); } if (auth_signal(signo) == false) { TangoSys_OMemStream o; o << "Signal " << sig_name[signo] << "is not authorized with your OS" << ends; Except::throw_exception((const char *)API_SignalOutOfRange, o.str(), (const char *)"DServerSignal::register_class_signal"); } #ifndef _TG_WINDOWS_ if ((auto_signal(signo) == true) && (handler == true)) { TangoSys_OMemStream o; o << "Signal " << sig_name[signo] << "is not authorized using your own handler" << ends; Except::throw_exception((const char *)API_SignalOutOfRange, o.str(), (const char *)"DServerSignal::register_class_signal"); } #endif // // If nothing is registered for this signal, install the OS signal handler // if (auto_signal(signo) == false) { if ((reg_sig[signo].registered_devices.empty() == true) && (reg_sig[signo].registered_classes.empty() == true)) { #ifdef _TG_WINDOWS_ register_handler(signo); #else register_handler(signo,handler); #endif } } // // Check if class is already registered for this signal. If it is already done, // leave method. Otherwise, record class pointer // vector::iterator f = find_class(signo,cl_ptr); if (f == reg_sig[signo].registered_classes.end()) { reg_sig[signo].registered_classes.push_back(cl_ptr); #ifndef _TG_WINDOWS_ reg_sig[signo].own_handler = handler; #endif } } //+---------------------------------------------------------------------------- // // method : DServerSignal::find_class // // description : method to check if a class is already registered for a // signal. If it is true, this method returns in which // element of the vector the class is registered // // in : long signo - Signal number // DeviceClass *cl_ptr - Pointer to device class object // //----------------------------------------------------------------------------- vector::iterator DServerSignal::find_class(long signo,DeviceClass *cl_ptr) { vector::iterator p; for (p = reg_sig[signo].registered_classes.begin();p < reg_sig[signo].registered_classes.end();++p) { if ((*p) == cl_ptr) break; } return p; } //+---------------------------------------------------------------------------- // // method : DServerSignal::register_dev_signal() // // description : method to register a signal handler at the device // level // // in : long signo - Signal number // DeviceImpl *dev_ptr - Pointer to device object // //----------------------------------------------------------------------------- #ifdef _TG_WINDOWS_ void DServerSignal::register_dev_signal(long signo,DeviceImpl *dev_ptr) #else void DServerSignal::register_dev_signal(long signo,bool handler,DeviceImpl *dev_ptr) #endif { // // Check signal validity // if ((signo < 1) || (signo >= _NSIG)) { TangoSys_OMemStream o; o << "Signal number " << signo << " out of range" << ends; Except::throw_exception((const char *)API_SignalOutOfRange, o.str(), (const char *)"DServerSignal::register_dev_signal"); } if (auth_signal(signo) == false) { TangoSys_OMemStream o; o << "Signal " << sig_name[signo] << "is not authorized with your OS" << ends; Except::throw_exception((const char *)API_SignalOutOfRange, o.str(), (const char *)"DServerSignal::register_dev_signal"); } #ifndef _TG_WINDOWS_ if ((auto_signal(signo) == true) && (handler == true)) { TangoSys_OMemStream o; o << "Signal " << sig_name[signo] << "is not authorized using your own handler" << ends; Except::throw_exception((const char *)API_SignalOutOfRange, o.str(), (const char *)"DServerSignal::register_class_signal"); } #endif // // If nothing is registered for this signal, install the OS signal handler // if (auto_signal(signo) == false) { if ((reg_sig[signo].registered_devices.empty() == true) && (reg_sig[signo].registered_classes.empty() == true)) { #ifdef _TG_WINDOWS_ register_handler(signo); #else register_handler(signo,handler); #endif } } // // Check if devices is already registered for this signal. If it is already done, // leave method. Otherwise, record class pointer // vector::iterator f = find_device(signo,dev_ptr); if (f == reg_sig[signo].registered_devices.end()) { reg_sig[signo].registered_devices.push_back(dev_ptr); #ifndef _TG_WINDOWS_ reg_sig[signo].own_handler = handler; #endif } } //+---------------------------------------------------------------------------- // // method : DServerSignal::find_device // // description : method to check if a device is already registered for a // signal. If it is true, this method returns in which // element of the vector the device is registered // // in : long signo - Signal number // DeviceImpl *dev_ptr - Pointer to device object // //----------------------------------------------------------------------------- vector::iterator DServerSignal::find_device(long signo,DeviceImpl *dev_ptr) { vector::iterator p; for (p = reg_sig[signo].registered_devices.begin();p < reg_sig[signo].registered_devices.end();++p) { if ((*p) == dev_ptr) break; } return p; } //+---------------------------------------------------------------------------- // // method : DServerSignal::unregister_class_signal() // // description : method to unregister a signal handler at the class // level // // in : long signo - Signal number // DeviceClass *cl_ptr - Pointer to device class object // //----------------------------------------------------------------------------- void DServerSignal::unregister_class_signal(long signo,DeviceClass *cl_ptr) { // // Check signal validity // if ((signo < 1) || (signo >= _NSIG)) { TangoSys_OMemStream o; o << "Signal number " << signo << " out of range" << ends; Except::throw_exception((const char *)API_SignalOutOfRange, o.str(), (const char *)"DServerSignal::register_proc_signal"); } // // Check if class is already registered for this signal. If it is already done, // leave method. Otherwise, record class pointer // vector::iterator f = find_class(signo,cl_ptr); if (f == reg_sig[signo].registered_classes.end()) return; else reg_sig[signo].registered_classes.erase(f); // // If nothing is registered for this signal, unregister the OS signal handler // and (eventually) the event handler // if (auto_signal(signo) == false) { if ((reg_sig[signo].registered_classes.empty() == true) && (reg_sig[signo].registered_devices.empty() == true)) unregister_handler(signo); } } //+---------------------------------------------------------------------------- // // method : DServerSignal::unregister_dev_signal() // // description : method to unregister a signal handler at the class // level // // in : long signo - Signal number // DeviceImpl *dev_ptr - Pointer to device object // //----------------------------------------------------------------------------- void DServerSignal::unregister_dev_signal(long signo,DeviceImpl *dev_ptr) { // // Check signal validity // if ((signo < 1) || (signo >= _NSIG)) { TangoSys_OMemStream o; o << "Signal number " << signo << " out of range" << ends; Except::throw_exception((const char *)API_SignalOutOfRange, o.str(), (const char *)"DServerSignal::register_proc_signal"); } // // Check if device is already registered for this signal. If yes, remove it. // Otherwise, leave method // vector::iterator f = find_device(signo,dev_ptr); if (f == reg_sig[signo].registered_devices.end()) return; else reg_sig[signo].registered_devices.erase(f); // // If nothing is registered for this signal, unregister the OS signal handler // and eventually the event handler // if (auto_signal(signo) == false) { if ((reg_sig[signo].registered_classes.empty() == true) && (reg_sig[signo].registered_devices.empty() == true)) { unregister_handler(signo); } } } //+---------------------------------------------------------------------------- // // method : DServerSignal::unregister_dev_signal() // // description : method to unregister a signal handler at the device // level for all signals // // in : DeviceImpl *dev_ptr - Pointer to device object // //----------------------------------------------------------------------------- void DServerSignal::unregister_dev_signal(DeviceImpl *dev_ptr) { long i; for (i = 0;i < _NSIG;i++) { // // Check if device is registered for this signal. If yes, remove it. // Otherwise, go to next signal // vector::iterator f = find_device(i,dev_ptr); if (f == reg_sig[i].registered_devices.end()) continue; else reg_sig[i].registered_devices.erase(f); // // If nothing is registered for this signal, unregister the OS signal handler // if (auto_signal(i) == false) { if ((reg_sig[i].registered_classes.empty() == true) && (reg_sig[i].registered_devices.empty() == true)) unregister_handler(i); } } } //+---------------------------------------------------------------------------- // // method : DServerSignal::unregister_class_signal() // // description : method to unregister a signal handler at the class // level for all signals // // in : DeviceImpl *cl_ptr - Pointer to device class object // //----------------------------------------------------------------------------- void DServerSignal::unregister_class_signal(DeviceClass *cl_ptr) { long i; for (i = 0;i < _NSIG;i++) { // // Check if classes is registered for this signal. If yes, remove it. // Otherwise, go to next signal // vector::iterator f = find_class(i,cl_ptr); if (f == reg_sig[i].registered_classes.end()) continue; else reg_sig[i].registered_classes.erase(f); // // If nothing is registered for this signal, unregister the OS signal handler // if (auto_signal(i) == false) { if ((reg_sig[i].registered_classes.empty() == true) && (reg_sig[i].registered_devices.empty() == true)) unregister_handler(i); } } } //+---------------------------------------------------------------------------- // // method : DServerSignal::register_handler() // // description : method to register in the OS the main signal handler // for a given signal // // in : long signo - Signal number // //----------------------------------------------------------------------------- #ifdef _TG_WINDOWS_ void DServerSignal::register_handler(long signo) #else void DServerSignal::register_handler(long signo,bool handler) #endif { cout4 << "Installing OS signal handler for signal " << sig_name[signo] << endl; #ifdef _TG_WINDOWS_ if (::signal(signo, DServerSignal::main_sig_handler) == SIG_ERR) { TangoSys_OMemStream o; o << "Can't install signal " << signo << ". OS error = " << errno << ends; Except::throw_exception((const char *)API_CantInstallSignal, o.str(), (const char *)"DServerSignal::register_handler"); } #else if (handler == true) { sigset_t sigs_to_unblock; sigemptyset(&sigs_to_unblock); sigaddset(&sigs_to_unblock,signo); if (pthread_sigmask(SIG_UNBLOCK,&sigs_to_unblock,NULL) != 0) { TangoSys_OMemStream o; o << "Can't install signal " << signo << ". OS error = " << errno << ends; Except::throw_exception((const char *)API_CantInstallSignal, o.str(), (const char *)"DServerSignal::register_handler"); } struct sigaction sa; sa.sa_flags = SA_RESTART; sa.sa_handler = DServerSignal::main_sig_handler; sigemptyset(&sa.sa_mask); if (sigaction((int)signo,&sa,0) == -1) { TangoSys_OMemStream o; o << "Can't install signal " << signo << ". OS error = " << errno << ends; Except::throw_exception((const char *)API_CantInstallSignal, o.str(), (const char *)"DServerSignal::register_handler"); } } else { omni_mutex_lock sy(*this); while(sig_to_install == true) { wait(); } sig_to_install = true; inst_sig = signo; } pthread_kill(sig_th->my_thread,SIGINT); #endif } //+---------------------------------------------------------------------------- // // method : DServerSignal::unregister_handler() // // description : method to unregister from the OS the main signal handler // for a given signal // // in : long signo - Signal number // //----------------------------------------------------------------------------- void DServerSignal::unregister_handler(long signo) { cout4 << "Removing OS signal handler for signal " << sig_name[signo] << endl; #ifdef _TG_WINDOWS_ if (::signal(signo, SIG_DFL) == SIG_ERR) { TangoSys_OMemStream o; o << "Can't install signal " << signo << ". OS error = " << errno << ends; Except::throw_exception((const char *)API_CantInstallSignal, o.str(), (const char *)"DServerSignal::register_handler"); } #else if (reg_sig[signo].own_handler == true) { struct sigaction sa; sa.sa_flags = 0; sa.sa_handler = SIG_DFL; sigemptyset(&sa.sa_mask); if (sigaction((int)signo,&sa,0) == -1) { TangoSys_OMemStream o; o << "Can't install signal " << signo << ". OS error = " << errno << ends; Except::throw_exception((const char *)API_CantInstallSignal, o.str(), (const char *)"DServerSignal::register_handler"); } } else { omni_mutex_lock sy(*this); while(sig_to_remove == true) { wait(); } sig_to_remove = true; rem_sig = signo; } pthread_kill(sig_th->my_thread,SIGINT); #endif } #ifndef _TG_WINDOWS_ pid_t DServerSignal::get_sig_thread_pid() { omni_mutex_lock syn(*this); if (sig_th->my_pid == 0) { wait(1000); } return sig_th->my_pid; } #endif //+---------------------------------------------------------------------------- // // method : DServerSignal::main_sig_handler() // // description : This is a dummy signal handler used only with solaris // which needs one for signal with a default ignore // action to work correctly with the sigwait() // call. // // in : int signo - Signal number // //----------------------------------------------------------------------------- #ifndef _TG_WINDOWS_ void DServerSignal::main_sig_handler(int signo) { cout4 << "In main sig_handler !!!!" << endl; DevSigAction *act_ptr = &(DServerSignal::reg_sig[signo]); // // First, execute all the handlers installed at the class level // if (act_ptr->registered_classes.empty() == false) { long nb_class = act_ptr->registered_classes.size(); for (long j = 0;j < nb_class;j++) { act_ptr->registered_classes[j]->signal_handler((long)signo); } } // // Then, execute all the handlers installed at the device level // if (act_ptr->registered_devices.empty() == false) { long nb_dev = act_ptr->registered_devices.size(); for (long j = 0;j < nb_dev;j++) { act_ptr->registered_devices[j]->signal_handler((long)signo); } } } #else void DServerSignal::main_sig_handler(int signo) { cout4 << "In main sig_handler !!!!" << endl; win_signo = signo; SetEvent(win_ev); } #endif } // End of Tango namespace tango-8.1.2c+dfsg.orig/lib/cpp/server/dev_event.cpp0000644000175000017500000021076512205375142021130 0ustar piccapiccastatic const char *RcsId = "$Id: dev_event.cpp 22213 2013-03-07 14:32:56Z taurel $\n$Name$"; //+============================================================================ // // file : dev_event.cpp // // description : C++ source code for the DeviceImpl // class methods related to manually firing events. // // project : TANGO // // author(s) : J.Meyer + E.Taurel // // Copyright (C) : 2004,2005,2006,2007,2008,2009,2010,2011,2012,2013 // European Synchrotron Radiation Facility // BP 220, Grenoble 38043 // FRANCE // // This file is part of Tango. // // Tango 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. // // Tango 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 Tango. If not, see . // // $Revision: 22213 $ // //-============================================================================ #if HAVE_CONFIG_H #include #endif #include #include #ifdef _TG_WINDOWS_ #include #else #include #endif #ifdef TANGO_HAS_LOG4TANGO #include #endif namespace Tango { //////////////////// Push user event methods!!! ////////////////////////////////////// //+------------------------------------------------------------------------- // // method : DeviceImpl::push_event // // description : Push a user event to the Notification service // Should be used to push user events for the state and status // attributes as well as pushing an exception as change event. // // argument: in : attr_name : name of the attribute // filt_names : The filterable fields name // filt_vals : The filterable fields value (as double) // *except : Tango exception to be pushed as a user event for the attribute. // //-------------------------------------------------------------------------- void DeviceImpl::push_event(string attr_name, vector &filt_names,vector &filt_vals,DevFailed *except) { // get the tango synchroisation monitor Tango::AutoTangoMonitor synch(this); // search the attribute from the attribute list Tango::MultiAttribute *attr_list = get_device_attr(); Tango::Attribute &attr = attr_list->get_attr_by_name (attr_name.c_str()); // push the event attr.fire_event (filt_names,filt_vals,except); } //+------------------------------------------------------------------------- // // method : DeviceImpl::push_event // // description : Push an attribute change event with valid data to the notification service // // argument: in : attr_name : name of the attribute // filt_names : The filterable fields name // filt_vals : The filterable fields value (as double) // *p_data : pointer to attribute data // x : The attribute x length. Default value is 1 // y : The attribute y length. Default value is 0 // release : The release flag. If true, memory pointed to by p_data will be // freed after being send to the client. Default value is false. //-------------------------------------------------------------------------- void DeviceImpl::push_event (string attr_name,vector &filt_names,vector &filt_vals, Tango::DevShort *p_data, long x,long y ,bool release) { // get the tango synchroisation monitor Tango::AutoTangoMonitor synch(this); // search the attribute from the attribute list Tango::MultiAttribute *attr_list = get_device_attr(); Tango::Attribute &attr = attr_list->get_attr_by_name (attr_name.c_str()); // set the attribute value attr.set_value (p_data, x, y, release); // push the event attr.fire_event(filt_names,filt_vals); } void DeviceImpl::push_event (string attr_name,vector &filt_names,vector &filt_vals, Tango::DevLong *p_data, long x, long y , bool release) { // get the tango synchroisation monitor Tango::AutoTangoMonitor synch(this); // search the attribute from the attribute list Tango::MultiAttribute *attr_list = get_device_attr(); Tango::Attribute &attr = attr_list->get_attr_by_name (attr_name.c_str()); // set the attribute value attr.set_value (p_data, x, y, release); // push the event attr.fire_event(filt_names,filt_vals); } void DeviceImpl::push_event (string attr_name,vector &filt_names,vector &filt_vals, Tango::DevLong64 *p_data, long x, long y , bool release) { // get the tango synchroisation monitor Tango::AutoTangoMonitor synch(this); // search the attribute from the attribute list Tango::MultiAttribute *attr_list = get_device_attr(); Tango::Attribute &attr = attr_list->get_attr_by_name (attr_name.c_str()); // set the attribute value attr.set_value (p_data, x, y, release); // push the event attr.fire_event(filt_names,filt_vals); } void DeviceImpl::push_event(string attr_name,vector &filt_names,vector &filt_vals, Tango::DevFloat *p_data, long x, long y , bool release) { // get the tango synchroisation monitor Tango::AutoTangoMonitor synch(this); // search the attribute from the attribute list Tango::MultiAttribute *attr_list = get_device_attr(); Tango::Attribute &attr = attr_list->get_attr_by_name (attr_name.c_str()); // set the attribute value attr.set_value (p_data, x, y, release); // push the event attr.fire_event(filt_names,filt_vals); } void DeviceImpl::push_event(string attr_name,vector &filt_names,vector &filt_vals, Tango::DevDouble *p_data, long x, long y , bool release) { // get the tango synchroisation monitor Tango::AutoTangoMonitor synch(this); // search the attribute from the attribute list Tango::MultiAttribute *attr_list = get_device_attr(); Tango::Attribute &attr = attr_list->get_attr_by_name (attr_name.c_str()); // set the attribute value attr.set_value (p_data, x, y, release); // push the event attr.fire_event(filt_names,filt_vals); } void DeviceImpl::push_event(string attr_name,vector &filt_names,vector &filt_vals, Tango::DevString *p_data, long x, long y , bool release) { // get the tango synchroisation monitor Tango::AutoTangoMonitor synch(this); // search the attribute from the attribute list Tango::MultiAttribute *attr_list = get_device_attr(); Tango::Attribute &attr = attr_list->get_attr_by_name (attr_name.c_str()); // set the attribute value attr.set_value (p_data, x, y, release); // push the event attr.fire_event(filt_names,filt_vals); } void DeviceImpl::push_event(string attr_name,vector &filt_names,vector &filt_vals, Tango::DevBoolean *p_data, long x, long y , bool release) { // get the tango synchroisation monitor Tango::AutoTangoMonitor synch(this); // search the attribute from the attribute list Tango::MultiAttribute *attr_list = get_device_attr(); Tango::Attribute &attr = attr_list->get_attr_by_name (attr_name.c_str()); // set the attribute value attr.set_value (p_data, x, y, release); // push the event attr.fire_event(filt_names,filt_vals); } void DeviceImpl::push_event(string attr_name,vector &filt_names,vector &filt_vals, Tango::DevUShort *p_data, long x, long y , bool release) { // get the tango synchroisation monitor Tango::AutoTangoMonitor synch(this); // search the attribute from the attribute list Tango::MultiAttribute *attr_list = get_device_attr(); Tango::Attribute &attr = attr_list->get_attr_by_name (attr_name.c_str()); // set the attribute value attr.set_value (p_data, x, y, release); // push the event attr.fire_event(filt_names,filt_vals); } void DeviceImpl::push_event(string attr_name,vector &filt_names,vector &filt_vals, Tango::DevUChar *p_data, long x, long y , bool release) { // get the tango synchroisation monitor Tango::AutoTangoMonitor synch(this); // search the attribute from the attribute list Tango::MultiAttribute *attr_list = get_device_attr(); Tango::Attribute &attr = attr_list->get_attr_by_name (attr_name.c_str()); // set the attribute value attr.set_value (p_data, x, y, release); // push the event attr.fire_event(filt_names,filt_vals); } void DeviceImpl::push_event (string attr_name,vector &filt_names,vector &filt_vals, Tango::DevULong *p_data, long x, long y , bool release) { // get the tango synchroisation monitor Tango::AutoTangoMonitor synch(this); // search the attribute from the attribute list Tango::MultiAttribute *attr_list = get_device_attr(); Tango::Attribute &attr = attr_list->get_attr_by_name (attr_name.c_str()); // set the attribute value attr.set_value (p_data, x, y, release); // push the event attr.fire_event(filt_names,filt_vals); } void DeviceImpl::push_event (string attr_name,vector &filt_names,vector &filt_vals, Tango::DevULong64 *p_data, long x, long y , bool release) { // get the tango synchroisation monitor Tango::AutoTangoMonitor synch(this); // search the attribute from the attribute list Tango::MultiAttribute *attr_list = get_device_attr(); Tango::Attribute &attr = attr_list->get_attr_by_name (attr_name.c_str()); // set the attribute value attr.set_value (p_data, x, y, release); // push the event attr.fire_event(filt_names,filt_vals); } void DeviceImpl::push_event (string attr_name,vector &filt_names,vector &filt_vals, Tango::DevState *p_data, long x, long y , bool release) { // get the tango synchroisation monitor Tango::AutoTangoMonitor synch(this); // search the attribute from the attribute list Tango::MultiAttribute *attr_list = get_device_attr(); Tango::Attribute &attr = attr_list->get_attr_by_name (attr_name.c_str()); // set the attribute value attr.set_value (p_data, x, y, release); // push the event attr.fire_event(filt_names,filt_vals); } void DeviceImpl::push_event (string attr_name,vector &filt_names,vector &filt_vals, Tango::DevEncoded *p_data, long x, long y , bool release) { // get the tango synchroisation monitor Tango::AutoTangoMonitor synch(this); // search the attribute from the attribute list Tango::MultiAttribute *attr_list = get_device_attr(); Tango::Attribute &attr = attr_list->get_attr_by_name (attr_name.c_str()); // set the attribute value attr.set_value (p_data, x, y, release); // push the event attr.fire_event(filt_names,filt_vals); } void DeviceImpl::push_event (string attr_name,vector &filt_names,vector &filt_vals, Tango::DevString *p_str, Tango::DevUChar *p_data, long size , bool release) { // get the tango synchroisation monitor Tango::AutoTangoMonitor synch(this); // search the attribute from the attribute list Tango::MultiAttribute *attr_list = get_device_attr(); Tango::Attribute &attr = attr_list->get_attr_by_name (attr_name.c_str()); // set the attribute value attr.set_value (p_str,p_data, size, release); // push the event attr.fire_event(filt_names,filt_vals); } //+------------------------------------------------------------------------- // // method : DeviceImpl::push_event // // description : Push an attribute change event with data, time stamp and a quality // factor to the notification service. // // argument: in : attr_name : name of the attribute // filt_names : The filterable fields name // filt_vals : The filterable fields value (as double) // t : the time stamp // qual : the attribute quality factor // *p_data : pointer to attribute data // x : The attribute x length. Default value is 1 // y : The attribute y length. Default value is 0 // release : The release flag. If true, memory pointed to by p_data will be // freed after being send to the client. Default value is false. //-------------------------------------------------------------------------- #ifdef _TG_WINDOWS_ void DeviceImpl::push_event (string attr_name,vector &filt_names,vector &filt_vals, Tango::DevShort *p_data,struct _timeb &t, Tango::AttrQuality qual, long x,long y ,bool release) #else void DeviceImpl::push_event (string attr_name,vector &filt_names,vector &filt_vals, Tango::DevShort *p_data,struct timeval &t, Tango::AttrQuality qual, long x,long y ,bool release) #endif { // get the tango synchroisation monitor Tango::AutoTangoMonitor synch(this); // search the attribute from the attribute list Tango::MultiAttribute *attr_list = get_device_attr(); Tango::Attribute &attr = attr_list->get_attr_by_name (attr_name.c_str()); // set the attribute value attr.set_value_date_quality (p_data, t, qual, x, y, release); // push the event attr.fire_event(filt_names,filt_vals); } #ifdef _TG_WINDOWS_ void DeviceImpl::push_event (string attr_name,vector &filt_names,vector &filt_vals, Tango::DevLong *p_data,struct _timeb &t, Tango::AttrQuality qual, long x,long y ,bool release) #else void DeviceImpl::push_event (string attr_name,vector &filt_names,vector &filt_vals, Tango::DevLong *p_data,struct timeval &t, Tango::AttrQuality qual, long x,long y ,bool release) #endif { // get the tango synchroisation monitor Tango::AutoTangoMonitor synch(this); // search the attribute from the attribute list Tango::MultiAttribute *attr_list = get_device_attr(); Tango::Attribute &attr = attr_list->get_attr_by_name (attr_name.c_str()); // set the attribute value attr.set_value_date_quality (p_data, t, qual, x, y, release); // push the event attr.fire_event(filt_names,filt_vals); } #ifdef _TG_WINDOWS_ void DeviceImpl::push_event (string attr_name,vector &filt_names,vector &filt_vals, Tango::DevLong64 *p_data,struct _timeb &t, Tango::AttrQuality qual, long x,long y ,bool release) #else void DeviceImpl::push_event (string attr_name,vector &filt_names,vector &filt_vals, Tango::DevLong64 *p_data,struct timeval &t, Tango::AttrQuality qual, long x,long y ,bool release) #endif { // get the tango synchroisation monitor Tango::AutoTangoMonitor synch(this); // search the attribute from the attribute list Tango::MultiAttribute *attr_list = get_device_attr(); Tango::Attribute &attr = attr_list->get_attr_by_name (attr_name.c_str()); // set the attribute value attr.set_value_date_quality (p_data, t, qual, x, y, release); // push the event attr.fire_event(filt_names,filt_vals); } #ifdef _TG_WINDOWS_ void DeviceImpl::push_event (string attr_name,vector &filt_names,vector &filt_vals, Tango::DevFloat *p_data,struct _timeb &t, Tango::AttrQuality qual, long x,long y ,bool release) #else void DeviceImpl::push_event (string attr_name,vector &filt_names,vector &filt_vals, Tango::DevFloat *p_data,struct timeval &t, Tango::AttrQuality qual, long x,long y ,bool release) #endif { // get the tango synchroisation monitor Tango::AutoTangoMonitor synch(this); // search the attribute from the attribute list Tango::MultiAttribute *attr_list = get_device_attr(); Tango::Attribute &attr = attr_list->get_attr_by_name (attr_name.c_str()); // set the attribute value attr.set_value_date_quality (p_data, t, qual, x, y, release); // push the event attr.fire_event(filt_names,filt_vals); } #ifdef _TG_WINDOWS_ void DeviceImpl::push_event (string attr_name,vector &filt_names,vector &filt_vals, Tango::DevDouble *p_data,struct _timeb &t, Tango::AttrQuality qual, long x,long y ,bool release) #else void DeviceImpl::push_event (string attr_name,vector &filt_names,vector &filt_vals, Tango::DevDouble *p_data,struct timeval &t, Tango::AttrQuality qual, long x,long y ,bool release) #endif { // get the tango synchroisation monitor Tango::AutoTangoMonitor synch(this); // search the attribute from the attribute list Tango::MultiAttribute *attr_list = get_device_attr(); Tango::Attribute &attr = attr_list->get_attr_by_name (attr_name.c_str()); // set the attribute value attr.set_value_date_quality (p_data, t, qual, x, y, release); // push the event attr.fire_event(filt_names,filt_vals); } #ifdef _TG_WINDOWS_ void DeviceImpl::push_event (string attr_name,vector &filt_names,vector &filt_vals, Tango::DevString *p_data,struct _timeb &t, Tango::AttrQuality qual, long x,long y ,bool release) #else void DeviceImpl::push_event (string attr_name,vector &filt_names,vector &filt_vals, Tango::DevString *p_data,struct timeval &t, Tango::AttrQuality qual, long x,long y ,bool release) #endif { // get the tango synchroisation monitor Tango::AutoTangoMonitor synch(this); // search the attribute from the attribute list Tango::MultiAttribute *attr_list = get_device_attr(); Tango::Attribute &attr = attr_list->get_attr_by_name (attr_name.c_str()); // set the attribute value attr.set_value_date_quality (p_data, t, qual, x, y, release); // push the event attr.fire_event(filt_names,filt_vals); } #ifdef _TG_WINDOWS_ void DeviceImpl::push_event (string attr_name,vector &filt_names,vector &filt_vals, Tango::DevBoolean *p_data,struct _timeb &t, Tango::AttrQuality qual, long x,long y ,bool release) #else void DeviceImpl::push_event (string attr_name,vector &filt_names,vector &filt_vals, Tango::DevBoolean *p_data,struct timeval &t, Tango::AttrQuality qual, long x,long y ,bool release) #endif { // get the tango synchroisation monitor Tango::AutoTangoMonitor synch(this); // search the attribute from the attribute list Tango::MultiAttribute *attr_list = get_device_attr(); Tango::Attribute &attr = attr_list->get_attr_by_name (attr_name.c_str()); // set the attribute value attr.set_value_date_quality (p_data, t, qual, x, y, release); // push the event attr.fire_event(filt_names,filt_vals); } #ifdef _TG_WINDOWS_ void DeviceImpl::push_event (string attr_name,vector &filt_names,vector &filt_vals, Tango::DevUShort *p_data,struct _timeb &t, Tango::AttrQuality qual, long x,long y ,bool release) #else void DeviceImpl::push_event (string attr_name,vector &filt_names,vector &filt_vals, Tango::DevUShort *p_data,struct timeval &t, Tango::AttrQuality qual, long x,long y ,bool release) #endif { // get the tango synchroisation monitor Tango::AutoTangoMonitor synch(this); // search the attribute from the attribute list Tango::MultiAttribute *attr_list = get_device_attr(); Tango::Attribute &attr = attr_list->get_attr_by_name (attr_name.c_str()); // set the attribute value attr.set_value_date_quality (p_data, t, qual, x, y, release); // push the event attr.fire_event(filt_names,filt_vals); } #ifdef _TG_WINDOWS_ void DeviceImpl::push_event (string attr_name,vector &filt_names,vector &filt_vals, Tango::DevUChar *p_data,struct _timeb &t, Tango::AttrQuality qual, long x,long y ,bool release) #else void DeviceImpl::push_event (string attr_name,vector &filt_names,vector &filt_vals, Tango::DevUChar *p_data,struct timeval &t, Tango::AttrQuality qual, long x,long y ,bool release) #endif { // get the tango synchroisation monitor Tango::AutoTangoMonitor synch(this); // search the attribute from the attribute list Tango::MultiAttribute *attr_list = get_device_attr(); Tango::Attribute &attr = attr_list->get_attr_by_name (attr_name.c_str()); // set the attribute value attr.set_value_date_quality (p_data, t, qual, x, y, release); // push the event attr.fire_event(filt_names,filt_vals); } #ifdef _TG_WINDOWS_ void DeviceImpl::push_event (string attr_name,vector &filt_names,vector &filt_vals, Tango::DevULong *p_data,struct _timeb &t, Tango::AttrQuality qual, long x,long y ,bool release) #else void DeviceImpl::push_event (string attr_name,vector &filt_names,vector &filt_vals, Tango::DevULong *p_data,struct timeval &t, Tango::AttrQuality qual, long x,long y ,bool release) #endif { // get the tango synchroisation monitor Tango::AutoTangoMonitor synch(this); // search the attribute from the attribute list Tango::MultiAttribute *attr_list = get_device_attr(); Tango::Attribute &attr = attr_list->get_attr_by_name (attr_name.c_str()); // set the attribute value attr.set_value_date_quality (p_data, t, qual, x, y, release); // push the event attr.fire_event(filt_names,filt_vals); } #ifdef _TG_WINDOWS_ void DeviceImpl::push_event (string attr_name,vector &filt_names,vector &filt_vals, Tango::DevULong64 *p_data,struct _timeb &t, Tango::AttrQuality qual, long x,long y ,bool release) #else void DeviceImpl::push_event (string attr_name,vector &filt_names,vector &filt_vals, Tango::DevULong64 *p_data,struct timeval &t, Tango::AttrQuality qual, long x,long y ,bool release) #endif { // get the tango synchroisation monitor Tango::AutoTangoMonitor synch(this); // search the attribute from the attribute list Tango::MultiAttribute *attr_list = get_device_attr(); Tango::Attribute &attr = attr_list->get_attr_by_name (attr_name.c_str()); // set the attribute value attr.set_value_date_quality (p_data, t, qual, x, y, release); // push the event attr.fire_event(filt_names,filt_vals); } #ifdef _TG_WINDOWS_ void DeviceImpl::push_event (string attr_name,vector &filt_names,vector &filt_vals, Tango::DevState *p_data,struct _timeb &t, Tango::AttrQuality qual, long x,long y ,bool release) #else void DeviceImpl::push_event (string attr_name,vector &filt_names,vector &filt_vals, Tango::DevState *p_data,struct timeval &t, Tango::AttrQuality qual, long x,long y ,bool release) #endif { // get the tango synchroisation monitor Tango::AutoTangoMonitor synch(this); // search the attribute from the attribute list Tango::MultiAttribute *attr_list = get_device_attr(); Tango::Attribute &attr = attr_list->get_attr_by_name (attr_name.c_str()); // set the attribute value attr.set_value_date_quality (p_data, t, qual, x, y, release); // push the event attr.fire_event(filt_names,filt_vals); } #ifdef _TG_WINDOWS_ void DeviceImpl::push_event (string attr_name,vector &filt_names,vector &filt_vals, Tango::DevEncoded *p_data,struct _timeb &t, Tango::AttrQuality qual, long x,long y ,bool release) #else void DeviceImpl::push_event (string attr_name,vector &filt_names,vector &filt_vals, Tango::DevEncoded *p_data,struct timeval &t, Tango::AttrQuality qual, long x,long y ,bool release) #endif { // get the tango synchroisation monitor Tango::AutoTangoMonitor synch(this); // search the attribute from the attribute list Tango::MultiAttribute *attr_list = get_device_attr(); Tango::Attribute &attr = attr_list->get_attr_by_name (attr_name.c_str()); // set the attribute value attr.set_value_date_quality (p_data, t, qual, x, y, release); // push the event attr.fire_event(filt_names,filt_vals); } #ifdef _TG_WINDOWS_ void DeviceImpl::push_event (string attr_name,vector &filt_names,vector &filt_vals, Tango::DevString *p_str_data,Tango::DevUChar *p_data,long size, struct _timeb &t, Tango::AttrQuality qual, bool release) #else void DeviceImpl::push_event (string attr_name,vector &filt_names,vector &filt_vals, Tango::DevString *p_str_data,Tango::DevUChar *p_data,long size, struct timeval &t, Tango::AttrQuality qual, bool release) #endif { // get the tango synchroisation monitor Tango::AutoTangoMonitor synch(this); // search the attribute from the attribute list Tango::MultiAttribute *attr_list = get_device_attr(); Tango::Attribute &attr = attr_list->get_attr_by_name (attr_name.c_str()); // set the attribute value attr.set_value_date_quality (p_str_data,p_data, size,t, qual, release); // push the event attr.fire_event(filt_names,filt_vals); } //////////////////// Push change event methods!!! ////////////////////////////////////// //+------------------------------------------------------------------------- // method : DeviceImpl::set_change_event // // description : Set a flag to indicate that the server pushes change events manually, without // the polling to be started for the attribute. // If the detect parameter is set to true, the criteria specified for the change // event are verified and the event is only pushed if they are fullfilled. // If detect is set to false the event is fired without any value checking! // // argument: in : implemented : True when the server fires change events manually. // detect : Triggers the verification of the change event // properties when set to true. //-------------------------------------------------------------------------- void DeviceImpl::set_change_event (string attr_name, bool implemented, bool detect) { // search the attribute from the attribute list Tango::MultiAttribute *attr_list = get_device_attr(); Tango::Attribute &attr = attr_list->get_attr_by_name (attr_name.c_str()); attr.set_change_event (implemented, detect); } //+------------------------------------------------------------------------- // // method : DeviceImpl::push_change_event // // description : Push an attribute change event to the Notification service // Should be used to push change events for the state and status // attributes as well as pushing an exception as change event. // // argument: in : attr_name : name of the attribute // *except : Tango exception to be pushed as a change event for the attribute. // //-------------------------------------------------------------------------- void DeviceImpl::push_change_event(string attr_name, DevFailed *except) { // get the tango synchroisation monitor Tango::AutoTangoMonitor synch(this); // search the attribute from the attribute list Tango::MultiAttribute *attr_list = get_device_attr(); Tango::Attribute &attr = attr_list->get_attr_by_name (attr_name.c_str()); // push the event attr.fire_change_event (except); } //+------------------------------------------------------------------------- // // method : DeviceImpl::push_change_event // // description : Push an attribute change event with valid data to the notification service // // argument: in : attr_name : name of the attribute // *p_data : pointer to attribute data // x : The attribute x length. Default value is 1 // y : The attribute y length. Default value is 0 // release : The release flag. If true, memory pointed to by p_data will be // freed after being send to the client. Default value is false. //-------------------------------------------------------------------------- void DeviceImpl::push_change_event (string attr_name, Tango::DevShort *p_data, long x,long y ,bool release) { // get the tango synchroisation monitor Tango::AutoTangoMonitor synch(this); // search the attribute from the attribute list Tango::MultiAttribute *attr_list = get_device_attr(); Tango::Attribute &attr = attr_list->get_attr_by_name (attr_name.c_str()); // set the attribute value attr.set_value (p_data, x, y, release); // push the event attr.fire_change_event(); } void DeviceImpl::push_change_event (string attr_name, Tango::DevLong *p_data, long x, long y , bool release) { // get the tango synchroisation monitor Tango::AutoTangoMonitor synch(this); // search the attribute from the attribute list Tango::MultiAttribute *attr_list = get_device_attr(); Tango::Attribute &attr = attr_list->get_attr_by_name (attr_name.c_str()); // set the attribute value attr.set_value (p_data, x, y, release); // push the event attr.fire_change_event(); } void DeviceImpl::push_change_event (string attr_name, Tango::DevLong64 *p_data, long x, long y , bool release) { // get the tango synchroisation monitor Tango::AutoTangoMonitor synch(this); // search the attribute from the attribute list Tango::MultiAttribute *attr_list = get_device_attr(); Tango::Attribute &attr = attr_list->get_attr_by_name (attr_name.c_str()); // set the attribute value attr.set_value (p_data, x, y, release); // push the event attr.fire_change_event(); } void DeviceImpl::push_change_event(string attr_name, Tango::DevFloat *p_data, long x, long y , bool release) { // get the tango synchroisation monitor Tango::AutoTangoMonitor synch(this); // search the attribute from the attribute list Tango::MultiAttribute *attr_list = get_device_attr(); Tango::Attribute &attr = attr_list->get_attr_by_name (attr_name.c_str()); // set the attribute value attr.set_value (p_data, x, y, release); // push the event attr.fire_change_event(); } void DeviceImpl::push_change_event(string attr_name, Tango::DevDouble *p_data, long x, long y , bool release) { // get the tango synchroisation monitor Tango::AutoTangoMonitor synch(this); // search the attribute from the attribute list Tango::MultiAttribute *attr_list = get_device_attr(); Tango::Attribute &attr = attr_list->get_attr_by_name (attr_name.c_str()); // set the attribute value attr.set_value (p_data, x, y, release); // push the event attr.fire_change_event(); } void DeviceImpl::push_change_event(string attr_name, Tango::DevString *p_data, long x, long y , bool release) { // get the tango synchroisation monitor Tango::AutoTangoMonitor synch(this); // search the attribute from the attribute list Tango::MultiAttribute *attr_list = get_device_attr(); Tango::Attribute &attr = attr_list->get_attr_by_name (attr_name.c_str()); // set the attribute value attr.set_value (p_data, x, y, release); // push the event attr.fire_change_event(); } void DeviceImpl::push_change_event(string attr_name, Tango::DevBoolean *p_data, long x, long y , bool release) { // get the tango synchroisation monitor Tango::AutoTangoMonitor synch(this); // search the attribute from the attribute list Tango::MultiAttribute *attr_list = get_device_attr(); Tango::Attribute &attr = attr_list->get_attr_by_name (attr_name.c_str()); // set the attribute value attr.set_value (p_data, x, y, release); // push the event attr.fire_change_event(); } void DeviceImpl::push_change_event(string attr_name, Tango::DevUShort *p_data, long x, long y , bool release) { // get the tango synchroisation monitor Tango::AutoTangoMonitor synch(this); // search the attribute from the attribute list Tango::MultiAttribute *attr_list = get_device_attr(); Tango::Attribute &attr = attr_list->get_attr_by_name (attr_name.c_str()); // set the attribute value attr.set_value (p_data, x, y, release); // push the event attr.fire_change_event(); } void DeviceImpl::push_change_event(string attr_name, Tango::DevUChar *p_data, long x, long y , bool release) { // get the tango synchroisation monitor Tango::AutoTangoMonitor synch(this); // search the attribute from the attribute list Tango::MultiAttribute *attr_list = get_device_attr(); Tango::Attribute &attr = attr_list->get_attr_by_name (attr_name.c_str()); // set the attribute value attr.set_value (p_data, x, y, release); // push the event attr.fire_change_event(); } void DeviceImpl::push_change_event (string attr_name, Tango::DevULong *p_data, long x, long y , bool release) { // get the tango synchroisation monitor Tango::AutoTangoMonitor synch(this); // search the attribute from the attribute list Tango::MultiAttribute *attr_list = get_device_attr(); Tango::Attribute &attr = attr_list->get_attr_by_name (attr_name.c_str()); // set the attribute value attr.set_value (p_data, x, y, release); // push the event attr.fire_change_event(); } void DeviceImpl::push_change_event (string attr_name, Tango::DevULong64 *p_data, long x, long y , bool release) { // get the tango synchroisation monitor Tango::AutoTangoMonitor synch(this); // search the attribute from the attribute list Tango::MultiAttribute *attr_list = get_device_attr(); Tango::Attribute &attr = attr_list->get_attr_by_name (attr_name.c_str()); // set the attribute value attr.set_value (p_data, x, y, release); // push the event attr.fire_change_event(); } void DeviceImpl::push_change_event (string attr_name, Tango::DevState *p_data, long x, long y , bool release) { // get the tango synchroisation monitor Tango::AutoTangoMonitor synch(this); // search the attribute from the attribute list Tango::MultiAttribute *attr_list = get_device_attr(); Tango::Attribute &attr = attr_list->get_attr_by_name (attr_name.c_str()); // set the attribute value attr.set_value (p_data, x, y, release); // push the event attr.fire_change_event(); } void DeviceImpl::push_change_event (string attr_name, Tango::DevEncoded *p_data, long x, long y , bool release) { // get the tango synchroisation monitor Tango::AutoTangoMonitor synch(this); // search the attribute from the attribute list Tango::MultiAttribute *attr_list = get_device_attr(); Tango::Attribute &attr = attr_list->get_attr_by_name (attr_name.c_str()); // set the attribute value attr.set_value (p_data, x, y, release); // push the event attr.fire_change_event(); } void DeviceImpl::push_change_event (string attr_name, Tango::DevString *p_str_data, Tango::DevUChar *p_data, long size, bool release) { // get the tango synchroisation monitor Tango::AutoTangoMonitor synch(this); // search the attribute from the attribute list Tango::MultiAttribute *attr_list = get_device_attr(); Tango::Attribute &attr = attr_list->get_attr_by_name (attr_name.c_str()); // set the attribute value attr.set_value (p_str_data, p_data, size, release); // push the event attr.fire_change_event(); } //+------------------------------------------------------------------------- // // method : DeviceImpl::push_change_event // // description : Push an attribute change event with data, time stamp and a quality // factor to the notification service. // // argument: in : attr_name : name of the attribute // t : the time stamp // qual : the attribute quality factor // *p_data : pointer to attribute data // x : The attribute x length. Default value is 1 // y : The attribute y length. Default value is 0 // release : The release flag. If true, memory pointed to by p_data will be // freed after being send to the client. Default value is false. //-------------------------------------------------------------------------- #ifdef _TG_WINDOWS_ void DeviceImpl::push_change_event (string attr_name, Tango::DevShort *p_data, struct _timeb &t, Tango::AttrQuality qual, long x,long y ,bool release) #else void DeviceImpl::push_change_event (string attr_name, Tango::DevShort *p_data, struct timeval &t, Tango::AttrQuality qual, long x,long y ,bool release) #endif { // get the tango synchroisation monitor Tango::AutoTangoMonitor synch(this); // search the attribute from the attribute list Tango::MultiAttribute *attr_list = get_device_attr(); Tango::Attribute &attr = attr_list->get_attr_by_name (attr_name.c_str()); // set the attribute value attr.set_value_date_quality (p_data, t, qual, x, y, release); // push the event attr.fire_change_event(); } #ifdef _TG_WINDOWS_ void DeviceImpl::push_change_event (string attr_name, Tango::DevLong *p_data, struct _timeb &t, Tango::AttrQuality qual, long x,long y ,bool release) #else void DeviceImpl::push_change_event (string attr_name, Tango::DevLong *p_data, struct timeval &t, Tango::AttrQuality qual, long x,long y ,bool release) #endif { // get the tango synchroisation monitor Tango::AutoTangoMonitor synch(this); // search the attribute from the attribute list Tango::MultiAttribute *attr_list = get_device_attr(); Tango::Attribute &attr = attr_list->get_attr_by_name (attr_name.c_str()); // set the attribute value attr.set_value_date_quality (p_data, t, qual, x, y, release); // push the event attr.fire_change_event(); } #ifdef _TG_WINDOWS_ void DeviceImpl::push_change_event (string attr_name, Tango::DevLong64 *p_data, struct _timeb &t, Tango::AttrQuality qual, long x,long y ,bool release) #else void DeviceImpl::push_change_event (string attr_name, Tango::DevLong64 *p_data, struct timeval &t, Tango::AttrQuality qual, long x,long y ,bool release) #endif { // get the tango synchroisation monitor Tango::AutoTangoMonitor synch(this); // search the attribute from the attribute list Tango::MultiAttribute *attr_list = get_device_attr(); Tango::Attribute &attr = attr_list->get_attr_by_name (attr_name.c_str()); // set the attribute value attr.set_value_date_quality (p_data, t, qual, x, y, release); // push the event attr.fire_change_event(); } #ifdef _TG_WINDOWS_ void DeviceImpl::push_change_event (string attr_name, Tango::DevFloat *p_data, struct _timeb &t, Tango::AttrQuality qual, long x,long y ,bool release) #else void DeviceImpl::push_change_event (string attr_name, Tango::DevFloat *p_data, struct timeval &t, Tango::AttrQuality qual, long x,long y ,bool release) #endif { // get the tango synchroisation monitor Tango::AutoTangoMonitor synch(this); // search the attribute from the attribute list Tango::MultiAttribute *attr_list = get_device_attr(); Tango::Attribute &attr = attr_list->get_attr_by_name (attr_name.c_str()); // set the attribute value attr.set_value_date_quality (p_data, t, qual, x, y, release); // push the event attr.fire_change_event(); } #ifdef _TG_WINDOWS_ void DeviceImpl::push_change_event (string attr_name, Tango::DevDouble *p_data, struct _timeb &t, Tango::AttrQuality qual, long x,long y ,bool release) #else void DeviceImpl::push_change_event (string attr_name, Tango::DevDouble *p_data, struct timeval &t, Tango::AttrQuality qual, long x,long y ,bool release) #endif { // get the tango synchroisation monitor Tango::AutoTangoMonitor synch(this); // search the attribute from the attribute list Tango::MultiAttribute *attr_list = get_device_attr(); Tango::Attribute &attr = attr_list->get_attr_by_name (attr_name.c_str()); // set the attribute value attr.set_value_date_quality (p_data, t, qual, x, y, release); // push the event attr.fire_change_event(); } #ifdef _TG_WINDOWS_ void DeviceImpl::push_change_event (string attr_name, Tango::DevString *p_data, struct _timeb &t, Tango::AttrQuality qual, long x,long y ,bool release) #else void DeviceImpl::push_change_event (string attr_name, Tango::DevString *p_data, struct timeval &t, Tango::AttrQuality qual, long x,long y ,bool release) #endif { // get the tango synchroisation monitor Tango::AutoTangoMonitor synch(this); // search the attribute from the attribute list Tango::MultiAttribute *attr_list = get_device_attr(); Tango::Attribute &attr = attr_list->get_attr_by_name (attr_name.c_str()); // set the attribute value attr.set_value_date_quality (p_data, t, qual, x, y, release); // push the event attr.fire_change_event(); } #ifdef _TG_WINDOWS_ void DeviceImpl::push_change_event (string attr_name, Tango::DevBoolean *p_data, struct _timeb &t, Tango::AttrQuality qual, long x,long y ,bool release) #else void DeviceImpl::push_change_event (string attr_name, Tango::DevBoolean *p_data, struct timeval &t, Tango::AttrQuality qual, long x,long y ,bool release) #endif { // get the tango synchroisation monitor Tango::AutoTangoMonitor synch(this); // search the attribute from the attribute list Tango::MultiAttribute *attr_list = get_device_attr(); Tango::Attribute &attr = attr_list->get_attr_by_name (attr_name.c_str()); // set the attribute value attr.set_value_date_quality (p_data, t, qual, x, y, release); // push the event attr.fire_change_event(); } #ifdef _TG_WINDOWS_ void DeviceImpl::push_change_event (string attr_name, Tango::DevUShort *p_data, struct _timeb &t, Tango::AttrQuality qual, long x,long y ,bool release) #else void DeviceImpl::push_change_event (string attr_name, Tango::DevUShort *p_data, struct timeval &t, Tango::AttrQuality qual, long x,long y ,bool release) #endif { // get the tango synchroisation monitor Tango::AutoTangoMonitor synch(this); // search the attribute from the attribute list Tango::MultiAttribute *attr_list = get_device_attr(); Tango::Attribute &attr = attr_list->get_attr_by_name (attr_name.c_str()); // set the attribute value attr.set_value_date_quality (p_data, t, qual, x, y, release); // push the event attr.fire_change_event(); } #ifdef _TG_WINDOWS_ void DeviceImpl::push_change_event (string attr_name, Tango::DevUChar *p_data, struct _timeb &t, Tango::AttrQuality qual, long x,long y ,bool release) #else void DeviceImpl::push_change_event (string attr_name, Tango::DevUChar *p_data, struct timeval &t, Tango::AttrQuality qual, long x,long y ,bool release) #endif { // get the tango synchroisation monitor Tango::AutoTangoMonitor synch(this); // search the attribute from the attribute list Tango::MultiAttribute *attr_list = get_device_attr(); Tango::Attribute &attr = attr_list->get_attr_by_name (attr_name.c_str()); // set the attribute value attr.set_value_date_quality (p_data, t, qual, x, y, release); // push the event attr.fire_change_event(); } #ifdef _TG_WINDOWS_ void DeviceImpl::push_change_event (string attr_name, Tango::DevULong *p_data, struct _timeb &t, Tango::AttrQuality qual, long x,long y ,bool release) #else void DeviceImpl::push_change_event (string attr_name, Tango::DevULong *p_data, struct timeval &t, Tango::AttrQuality qual, long x,long y ,bool release) #endif { // get the tango synchroisation monitor Tango::AutoTangoMonitor synch(this); // search the attribute from the attribute list Tango::MultiAttribute *attr_list = get_device_attr(); Tango::Attribute &attr = attr_list->get_attr_by_name (attr_name.c_str()); // set the attribute value attr.set_value_date_quality (p_data, t, qual, x, y, release); // push the event attr.fire_change_event(); } #ifdef _TG_WINDOWS_ void DeviceImpl::push_change_event (string attr_name, Tango::DevULong64 *p_data, struct _timeb &t, Tango::AttrQuality qual, long x,long y ,bool release) #else void DeviceImpl::push_change_event (string attr_name, Tango::DevULong64 *p_data, struct timeval &t, Tango::AttrQuality qual, long x,long y ,bool release) #endif { // get the tango synchroisation monitor Tango::AutoTangoMonitor synch(this); // search the attribute from the attribute list Tango::MultiAttribute *attr_list = get_device_attr(); Tango::Attribute &attr = attr_list->get_attr_by_name (attr_name.c_str()); // set the attribute value attr.set_value_date_quality (p_data, t, qual, x, y, release); // push the event attr.fire_change_event(); } #ifdef _TG_WINDOWS_ void DeviceImpl::push_change_event (string attr_name, Tango::DevState *p_data, struct _timeb &t, Tango::AttrQuality qual, long x,long y ,bool release) #else void DeviceImpl::push_change_event (string attr_name, Tango::DevState *p_data, struct timeval &t, Tango::AttrQuality qual, long x,long y ,bool release) #endif { // get the tango synchroisation monitor Tango::AutoTangoMonitor synch(this); // search the attribute from the attribute list Tango::MultiAttribute *attr_list = get_device_attr(); Tango::Attribute &attr = attr_list->get_attr_by_name (attr_name.c_str()); // set the attribute value attr.set_value_date_quality (p_data, t, qual, x, y, release); // push the event attr.fire_change_event(); } #ifdef _TG_WINDOWS_ void DeviceImpl::push_change_event (string attr_name, Tango::DevEncoded *p_data, struct _timeb &t, Tango::AttrQuality qual, long x,long y ,bool release) #else void DeviceImpl::push_change_event (string attr_name, Tango::DevEncoded *p_data, struct timeval &t, Tango::AttrQuality qual, long x,long y ,bool release) #endif { // get the tango synchroisation monitor Tango::AutoTangoMonitor synch(this); // search the attribute from the attribute list Tango::MultiAttribute *attr_list = get_device_attr(); Tango::Attribute &attr = attr_list->get_attr_by_name (attr_name.c_str()); // set the attribute value attr.set_value_date_quality (p_data, t, qual, x, y, release); // push the event attr.fire_change_event(); } #ifdef _TG_WINDOWS_ void DeviceImpl::push_change_event (string attr_name, Tango::DevString *p_str_data,Tango::DevUChar *p_data,long size, struct _timeb &t, Tango::AttrQuality qual, bool release) #else void DeviceImpl::push_change_event (string attr_name, Tango::DevString *p_str_data,Tango::DevUChar *p_data,long size, struct timeval &t, Tango::AttrQuality qual, bool release) #endif { // get the tango synchroisation monitor Tango::AutoTangoMonitor synch(this); // search the attribute from the attribute list Tango::MultiAttribute *attr_list = get_device_attr(); Tango::Attribute &attr = attr_list->get_attr_by_name (attr_name.c_str()); // set the attribute value attr.set_value_date_quality (p_str_data,p_data, size, t, qual, release); // push the event attr.fire_change_event(); } //////////////////// Push change archive methods!!! ////////////////////////////////////// //+------------------------------------------------------------------------- // method : DeviceImpl::set_archive_event // // description : Set a flag to indicate that the server pushes archive events manually, without // the polling to be started for the attribute. // If the detect parameter is set to true, the criteria specified for the archive // event are verified and the event is only pushed if they are fullfilled. // If detect is set to false the event is fired without any value checking! // // argument: in : implemented : True when the server fires archive events manually. // detect : Triggers the verification of the archive event // properties when set to true. //-------------------------------------------------------------------------- void DeviceImpl::set_archive_event (string attr_name, bool implemented, bool detect) { // search the attribute from the attribute list Tango::MultiAttribute *attr_list = get_device_attr(); Tango::Attribute &attr = attr_list->get_attr_by_name (attr_name.c_str()); attr.set_archive_event (implemented, detect); } //+------------------------------------------------------------------------- // // method : DeviceImpl::push_archive_event // // description : Push an attribute archive event to the Notification service // Should be used to push archive events for the state and status // attributes as well as pushing an exception as archive event. // // argument: in : attr_name : name of the attribute // *except : Tango exception to be pushed as a archive event for the attribute. // //-------------------------------------------------------------------------- void DeviceImpl::push_archive_event(string attr_name, DevFailed *except) { // get the tango synchroisation monitor Tango::AutoTangoMonitor synch(this); // search the attribute from the attribute list Tango::MultiAttribute *attr_list = get_device_attr(); Tango::Attribute &attr = attr_list->get_attr_by_name (attr_name.c_str()); // push the event attr.fire_archive_event (except); } //+------------------------------------------------------------------------- // // method : DeviceImpl::push_archive_event // // description : Push an attribute archive event with valid data to the notification service // // argument: in : attr_name : name of the attribute // *p_data : pointer to attribute data // x : The attribute x length. Default value is 1 // y : The attribute y length. Default value is 0 // release : The release flag. If true, memory pointed to by p_data will be // freed after being send to the client. Default value is false. //-------------------------------------------------------------------------- void DeviceImpl::push_archive_event (string attr_name, Tango::DevShort *p_data, long x,long y ,bool release) { // get the tango synchroisation monitor Tango::AutoTangoMonitor synch(this); // search the attribute from the attribute list Tango::MultiAttribute *attr_list = get_device_attr(); Tango::Attribute &attr = attr_list->get_attr_by_name (attr_name.c_str()); // set the attribute value attr.set_value (p_data, x, y, release); // push the event attr.fire_archive_event(); } void DeviceImpl::push_archive_event (string attr_name, Tango::DevLong *p_data, long x, long y , bool release) { // get the tango synchroisation monitor Tango::AutoTangoMonitor synch(this); // search the attribute from the attribute list Tango::MultiAttribute *attr_list = get_device_attr(); Tango::Attribute &attr = attr_list->get_attr_by_name (attr_name.c_str()); // set the attribute value attr.set_value (p_data, x, y, release); // push the event attr.fire_archive_event(); } void DeviceImpl::push_archive_event (string attr_name, Tango::DevLong64 *p_data, long x, long y , bool release) { // get the tango synchroisation monitor Tango::AutoTangoMonitor synch(this); // search the attribute from the attribute list Tango::MultiAttribute *attr_list = get_device_attr(); Tango::Attribute &attr = attr_list->get_attr_by_name (attr_name.c_str()); // set the attribute value attr.set_value (p_data, x, y, release); // push the event attr.fire_archive_event(); } void DeviceImpl::push_archive_event(string attr_name, Tango::DevFloat *p_data, long x, long y , bool release) { // get the tango synchroisation monitor Tango::AutoTangoMonitor synch(this); // search the attribute from the attribute list Tango::MultiAttribute *attr_list = get_device_attr(); Tango::Attribute &attr = attr_list->get_attr_by_name (attr_name.c_str()); // set the attribute value attr.set_value (p_data, x, y, release); // push the event attr.fire_archive_event(); } void DeviceImpl::push_archive_event(string attr_name, Tango::DevDouble *p_data, long x, long y , bool release) { // get the tango synchroisation monitor Tango::AutoTangoMonitor synch(this); // search the attribute from the attribute list Tango::MultiAttribute *attr_list = get_device_attr(); Tango::Attribute &attr = attr_list->get_attr_by_name (attr_name.c_str()); // set the attribute value attr.set_value (p_data, x, y, release); // push the event attr.fire_archive_event(); } void DeviceImpl::push_archive_event(string attr_name, Tango::DevString *p_data, long x, long y , bool release) { // get the tango synchroisation monitor Tango::AutoTangoMonitor synch(this); // search the attribute from the attribute list Tango::MultiAttribute *attr_list = get_device_attr(); Tango::Attribute &attr = attr_list->get_attr_by_name (attr_name.c_str()); // set the attribute value attr.set_value (p_data, x, y, release); // push the event attr.fire_archive_event(); } void DeviceImpl::push_archive_event(string attr_name, Tango::DevBoolean *p_data, long x, long y , bool release) { // get the tango synchroisation monitor Tango::AutoTangoMonitor synch(this); // search the attribute from the attribute list Tango::MultiAttribute *attr_list = get_device_attr(); Tango::Attribute &attr = attr_list->get_attr_by_name (attr_name.c_str()); // set the attribute value attr.set_value (p_data, x, y, release); // push the event attr.fire_archive_event(); } void DeviceImpl::push_archive_event(string attr_name, Tango::DevUShort *p_data, long x, long y , bool release) { // get the tango synchroisation monitor Tango::AutoTangoMonitor synch(this); // search the attribute from the attribute list Tango::MultiAttribute *attr_list = get_device_attr(); Tango::Attribute &attr = attr_list->get_attr_by_name (attr_name.c_str()); // set the attribute value attr.set_value (p_data, x, y, release); // push the event attr.fire_archive_event(); } void DeviceImpl::push_archive_event(string attr_name, Tango::DevUChar *p_data, long x, long y , bool release) { // get the tango synchroisation monitor Tango::AutoTangoMonitor synch(this); // search the attribute from the attribute list Tango::MultiAttribute *attr_list = get_device_attr(); Tango::Attribute &attr = attr_list->get_attr_by_name (attr_name.c_str()); // set the attribute value attr.set_value (p_data, x, y, release); // push the event attr.fire_archive_event(); } void DeviceImpl::push_archive_event (string attr_name, Tango::DevULong *p_data, long x, long y , bool release) { // get the tango synchroisation monitor Tango::AutoTangoMonitor synch(this); // search the attribute from the attribute list Tango::MultiAttribute *attr_list = get_device_attr(); Tango::Attribute &attr = attr_list->get_attr_by_name (attr_name.c_str()); // set the attribute value attr.set_value (p_data, x, y, release); // push the event attr.fire_archive_event(); } void DeviceImpl::push_archive_event (string attr_name, Tango::DevULong64 *p_data, long x, long y , bool release) { // get the tango synchroisation monitor Tango::AutoTangoMonitor synch(this); // search the attribute from the attribute list Tango::MultiAttribute *attr_list = get_device_attr(); Tango::Attribute &attr = attr_list->get_attr_by_name (attr_name.c_str()); // set the attribute value attr.set_value (p_data, x, y, release); // push the event attr.fire_archive_event(); } void DeviceImpl::push_archive_event (string attr_name, Tango::DevState *p_data, long x, long y , bool release) { // get the tango synchroisation monitor Tango::AutoTangoMonitor synch(this); // search the attribute from the attribute list Tango::MultiAttribute *attr_list = get_device_attr(); Tango::Attribute &attr = attr_list->get_attr_by_name (attr_name.c_str()); // set the attribute value attr.set_value (p_data, x, y, release); // push the event attr.fire_archive_event(); } void DeviceImpl::push_archive_event (string attr_name, Tango::DevEncoded *p_data, long x, long y , bool release) { // get the tango synchroisation monitor Tango::AutoTangoMonitor synch(this); // search the attribute from the attribute list Tango::MultiAttribute *attr_list = get_device_attr(); Tango::Attribute &attr = attr_list->get_attr_by_name (attr_name.c_str()); // set the attribute value attr.set_value (p_data, x, y, release); // push the event attr.fire_archive_event(); } void DeviceImpl::push_archive_event (string attr_name, Tango::DevString *p_str_data, Tango::DevUChar *p_data, long size, bool release) { // get the tango synchroisation monitor Tango::AutoTangoMonitor synch(this); // search the attribute from the attribute list Tango::MultiAttribute *attr_list = get_device_attr(); Tango::Attribute &attr = attr_list->get_attr_by_name (attr_name.c_str()); // set the attribute value attr.set_value (p_str_data,p_data, size, release); // push the event attr.fire_archive_event(); } //+------------------------------------------------------------------------- // // method : DeviceImpl::push_archive_event // // description : Push an attribute archive event with data, time stamp and a quality // factor to the notification service. // // argument: in : attr_name : name of the attribute // t : the time stamp // qual : the attribute quality factor // *p_data : pointer to attribute data // x : The attribute x length. Default value is 1 // y : The attribute y length. Default value is 0 // release : The release flag. If true, memory pointed to by p_data will be // freed after being send to the client. Default value is false. //-------------------------------------------------------------------------- #ifdef _TG_WINDOWS_ void DeviceImpl::push_archive_event (string attr_name, Tango::DevShort *p_data, struct _timeb &t, Tango::AttrQuality qual, long x,long y ,bool release) #else void DeviceImpl::push_archive_event (string attr_name, Tango::DevShort *p_data, struct timeval &t, Tango::AttrQuality qual, long x,long y ,bool release) #endif { // get the tango synchroisation monitor Tango::AutoTangoMonitor synch(this); // search the attribute from the attribute list Tango::MultiAttribute *attr_list = get_device_attr(); Tango::Attribute &attr = attr_list->get_attr_by_name (attr_name.c_str()); // set the attribute value attr.set_value_date_quality (p_data, t, qual, x, y, release); // push the event attr.fire_archive_event(); } #ifdef _TG_WINDOWS_ void DeviceImpl::push_archive_event (string attr_name, Tango::DevLong *p_data, struct _timeb &t, Tango::AttrQuality qual, long x,long y ,bool release) #else void DeviceImpl::push_archive_event (string attr_name, Tango::DevLong *p_data, struct timeval &t, Tango::AttrQuality qual, long x,long y ,bool release) #endif { // get the tango synchroisation monitor Tango::AutoTangoMonitor synch(this); // search the attribute from the attribute list Tango::MultiAttribute *attr_list = get_device_attr(); Tango::Attribute &attr = attr_list->get_attr_by_name (attr_name.c_str()); // set the attribute value attr.set_value_date_quality (p_data, t, qual, x, y, release); // push the event attr.fire_archive_event(); } #ifdef _TG_WINDOWS_ void DeviceImpl::push_archive_event (string attr_name, Tango::DevLong64 *p_data, struct _timeb &t, Tango::AttrQuality qual, long x,long y ,bool release) #else void DeviceImpl::push_archive_event (string attr_name, Tango::DevLong64 *p_data, struct timeval &t, Tango::AttrQuality qual, long x,long y ,bool release) #endif { // get the tango synchroisation monitor Tango::AutoTangoMonitor synch(this); // search the attribute from the attribute list Tango::MultiAttribute *attr_list = get_device_attr(); Tango::Attribute &attr = attr_list->get_attr_by_name (attr_name.c_str()); // set the attribute value attr.set_value_date_quality (p_data, t, qual, x, y, release); // push the event attr.fire_archive_event(); } #ifdef _TG_WINDOWS_ void DeviceImpl::push_archive_event (string attr_name, Tango::DevFloat *p_data, struct _timeb &t, Tango::AttrQuality qual, long x,long y ,bool release) #else void DeviceImpl::push_archive_event (string attr_name, Tango::DevFloat *p_data, struct timeval &t, Tango::AttrQuality qual, long x,long y ,bool release) #endif { // get the tango synchroisation monitor Tango::AutoTangoMonitor synch(this); // search the attribute from the attribute list Tango::MultiAttribute *attr_list = get_device_attr(); Tango::Attribute &attr = attr_list->get_attr_by_name (attr_name.c_str()); // set the attribute value attr.set_value_date_quality (p_data, t, qual, x, y, release); // push the event attr.fire_archive_event(); } #ifdef _TG_WINDOWS_ void DeviceImpl::push_archive_event (string attr_name, Tango::DevDouble *p_data, struct _timeb &t, Tango::AttrQuality qual, long x,long y ,bool release) #else void DeviceImpl::push_archive_event (string attr_name, Tango::DevDouble *p_data, struct timeval &t, Tango::AttrQuality qual, long x,long y ,bool release) #endif { // get the tango synchroisation monitor Tango::AutoTangoMonitor synch(this); // search the attribute from the attribute list Tango::MultiAttribute *attr_list = get_device_attr(); Tango::Attribute &attr = attr_list->get_attr_by_name (attr_name.c_str()); // set the attribute value attr.set_value_date_quality (p_data, t, qual, x, y, release); // push the event attr.fire_archive_event(); } #ifdef _TG_WINDOWS_ void DeviceImpl::push_archive_event (string attr_name, Tango::DevString *p_data, struct _timeb &t, Tango::AttrQuality qual, long x,long y ,bool release) #else void DeviceImpl::push_archive_event (string attr_name, Tango::DevString *p_data, struct timeval &t, Tango::AttrQuality qual, long x,long y ,bool release) #endif { // get the tango synchroisation monitor Tango::AutoTangoMonitor synch(this); // search the attribute from the attribute list Tango::MultiAttribute *attr_list = get_device_attr(); Tango::Attribute &attr = attr_list->get_attr_by_name (attr_name.c_str()); // set the attribute value attr.set_value_date_quality (p_data, t, qual, x, y, release); // push the event attr.fire_archive_event(); } #ifdef _TG_WINDOWS_ void DeviceImpl::push_archive_event (string attr_name, Tango::DevBoolean *p_data, struct _timeb &t, Tango::AttrQuality qual, long x,long y ,bool release) #else void DeviceImpl::push_archive_event (string attr_name, Tango::DevBoolean *p_data, struct timeval &t, Tango::AttrQuality qual, long x,long y ,bool release) #endif { // get the tango synchroisation monitor Tango::AutoTangoMonitor synch(this); // search the attribute from the attribute list Tango::MultiAttribute *attr_list = get_device_attr(); Tango::Attribute &attr = attr_list->get_attr_by_name (attr_name.c_str()); // set the attribute value attr.set_value_date_quality (p_data, t, qual, x, y, release); // push the event attr.fire_archive_event(); } #ifdef _TG_WINDOWS_ void DeviceImpl::push_archive_event (string attr_name, Tango::DevUShort *p_data, struct _timeb &t, Tango::AttrQuality qual, long x,long y ,bool release) #else void DeviceImpl::push_archive_event (string attr_name, Tango::DevUShort *p_data, struct timeval &t, Tango::AttrQuality qual, long x,long y ,bool release) #endif { // get the tango synchroisation monitor Tango::AutoTangoMonitor synch(this); // search the attribute from the attribute list Tango::MultiAttribute *attr_list = get_device_attr(); Tango::Attribute &attr = attr_list->get_attr_by_name (attr_name.c_str()); // set the attribute value attr.set_value_date_quality (p_data, t, qual, x, y, release); // push the event attr.fire_archive_event(); } #ifdef _TG_WINDOWS_ void DeviceImpl::push_archive_event (string attr_name, Tango::DevUChar *p_data, struct _timeb &t, Tango::AttrQuality qual, long x,long y ,bool release) #else void DeviceImpl::push_archive_event (string attr_name, Tango::DevUChar *p_data, struct timeval &t, Tango::AttrQuality qual, long x,long y ,bool release) #endif { // get the tango synchroisation monitor Tango::AutoTangoMonitor synch(this); // search the attribute from the attribute list Tango::MultiAttribute *attr_list = get_device_attr(); Tango::Attribute &attr = attr_list->get_attr_by_name (attr_name.c_str()); // set the attribute value attr.set_value_date_quality (p_data, t, qual, x, y, release); // push the event attr.fire_archive_event(); } #ifdef _TG_WINDOWS_ void DeviceImpl::push_archive_event (string attr_name, Tango::DevULong *p_data, struct _timeb &t, Tango::AttrQuality qual, long x,long y ,bool release) #else void DeviceImpl::push_archive_event (string attr_name, Tango::DevULong *p_data, struct timeval &t, Tango::AttrQuality qual, long x,long y ,bool release) #endif { // get the tango synchroisation monitor Tango::AutoTangoMonitor synch(this); // search the attribute from the attribute list Tango::MultiAttribute *attr_list = get_device_attr(); Tango::Attribute &attr = attr_list->get_attr_by_name (attr_name.c_str()); // set the attribute value attr.set_value_date_quality (p_data, t, qual, x, y, release); // push the event attr.fire_archive_event(); } #ifdef _TG_WINDOWS_ void DeviceImpl::push_archive_event (string attr_name, Tango::DevULong64 *p_data, struct _timeb &t, Tango::AttrQuality qual, long x,long y ,bool release) #else void DeviceImpl::push_archive_event (string attr_name, Tango::DevULong64 *p_data, struct timeval &t, Tango::AttrQuality qual, long x,long y ,bool release) #endif { // get the tango synchroisation monitor Tango::AutoTangoMonitor synch(this); // search the attribute from the attribute list Tango::MultiAttribute *attr_list = get_device_attr(); Tango::Attribute &attr = attr_list->get_attr_by_name (attr_name.c_str()); // set the attribute value attr.set_value_date_quality (p_data, t, qual, x, y, release); // push the event attr.fire_archive_event(); } #ifdef _TG_WINDOWS_ void DeviceImpl::push_archive_event (string attr_name, Tango::DevState *p_data, struct _timeb &t, Tango::AttrQuality qual, long x,long y ,bool release) #else void DeviceImpl::push_archive_event (string attr_name, Tango::DevState *p_data, struct timeval &t, Tango::AttrQuality qual, long x,long y ,bool release) #endif { // get the tango synchroisation monitor Tango::AutoTangoMonitor synch(this); // search the attribute from the attribute list Tango::MultiAttribute *attr_list = get_device_attr(); Tango::Attribute &attr = attr_list->get_attr_by_name (attr_name.c_str()); // set the attribute value attr.set_value_date_quality (p_data, t, qual, x, y, release); // push the event attr.fire_archive_event(); } #ifdef _TG_WINDOWS_ void DeviceImpl::push_archive_event (string attr_name, Tango::DevEncoded *p_data, struct _timeb &t, Tango::AttrQuality qual, long x,long y ,bool release) #else void DeviceImpl::push_archive_event (string attr_name, Tango::DevEncoded *p_data, struct timeval &t, Tango::AttrQuality qual, long x,long y ,bool release) #endif { // get the tango synchroisation monitor Tango::AutoTangoMonitor synch(this); // search the attribute from the attribute list Tango::MultiAttribute *attr_list = get_device_attr(); Tango::Attribute &attr = attr_list->get_attr_by_name (attr_name.c_str()); // set the attribute value attr.set_value_date_quality (p_data, t, qual, x, y, release); // push the event attr.fire_archive_event(); } #ifdef _TG_WINDOWS_ void DeviceImpl::push_archive_event (string attr_name, Tango::DevString *p_str_data, Tango::DevUChar *p_data,long size, struct _timeb &t, Tango::AttrQuality qual, bool release) #else void DeviceImpl::push_archive_event (string attr_name, Tango::DevString *p_str_data, Tango::DevUChar *p_data,long size, struct timeval &t, Tango::AttrQuality qual, bool release) #endif { // get the tango synchroisation monitor Tango::AutoTangoMonitor synch(this); // search the attribute from the attribute list Tango::MultiAttribute *attr_list = get_device_attr(); Tango::Attribute &attr = attr_list->get_attr_by_name (attr_name.c_str()); // set the attribute value attr.set_value_date_quality (p_str_data, p_data, size, t, qual, release); // push the event attr.fire_archive_event(); } //+------------------------------------------------------------------------- // // method : DeviceImpl::push_data_ready_event // // description : Push an attribute data ready event // // argument: in : attr_name : name of the attribute // ctr : user counter (optional) // //-------------------------------------------------------------------------- void DeviceImpl::push_data_ready_event (const string &attr_name, Tango::DevLong ctr) { Tango::Util *tg = Tango::Util::instance(); // get the tango synchronisation monitor Tango::AutoTangoMonitor synch(this); // search the attribute from the attribute list to check that it exist Tango::MultiAttribute *attr_list = get_device_attr(); Tango::Attribute &attr = attr_list->get_attr_by_name (attr_name.c_str()); EventSupplier *event_supplier_nd = NULL; EventSupplier *event_supplier_zmq = NULL; // // Push the event // if (attr.use_notifd_event() == true) { event_supplier_nd = tg->get_notifd_event_supplier(); event_supplier_nd->push_att_data_ready_event(this,attr_name,attr.get_data_type(),ctr); } if (attr.use_zmq_event() == true) { event_supplier_zmq = tg->get_zmq_event_supplier(); event_supplier_zmq->push_att_data_ready_event(this,attr_name,attr.get_data_type(),ctr); } } } // End of Tango namespace tango-8.1.2c+dfsg.orig/lib/cpp/server/eventsupplier.h0000644000175000017500000002723712205375142021523 0ustar piccapicca//////////////////////////////////////////////////////////////////////////////// /// /// file eventsupplier.h /// /// C++ include file for implementing the TANGO event server and /// client singleton classes - EventSupplier and EventConsumer. /// These classes are used to send events from the server /// to the notification service and to receive events from /// the notification service. /// /// author(s) : A.Gotz (goetz@esrf.fr) /// /// original : 7 April 2003 // // Copyright (C) : 2003,2004,2005,2006,2007,2008,2009,2010,2011,2012,2013 // European Synchrotron Radiation Facility // BP 220, Grenoble 38043 // FRANCE // // This file is part of Tango. // // Tango 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. // // Tango 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 Tango. If not, see . /// /// $Revision: 22302 $ /// /// copyright : European Synchrotron Radiation Facility /// BP 220, Grenoble 38043 /// FRANCE /// //////////////////////////////////////////////////////////////////////////////// #ifndef _EVENT_SUPPLIER_API_H #define _EVENT_SUPPLIER_API_H #include #if defined (_TG_WINDOWS_) && defined (_USRDLL) && !defined(_TANGO_LIB) #define USE_stub_in_nt_dll #endif #include #include #include #include #if defined (_TG_WINDOWS_) && defined (_USRDLL) && !defined(_TANGO_LIB) #undef USE_stub_in_nt_dll #endif #include #include #ifndef _TG_WINDOWS_ #include #endif #include namespace Tango { typedef struct _NotifService { CosNotifyChannelAdmin::SupplierAdmin_var SupAdm; CosNotifyChannelAdmin::ProxyID pID; CosNotifyChannelAdmin::ProxyConsumer_var ProCon; CosNotifyChannelAdmin::StructuredProxyPushConsumer_var StrProPush; CosNotifyChannelAdmin::EventChannelFactory_var EveChaFac; CosNotifyChannelAdmin::EventChannel_var EveCha; string ec_ior; } NotifService; //--------------------------------------------------------------------- // // EventSupplier base class // //--------------------------------------------------------------------- class EventSupplier { public : EventSupplier(Util *); virtual ~EventSupplier() {} void push_att_data_ready_event(DeviceImpl *,const string &,long,DevLong); struct AttributeData { const AttributeValue *attr_val; const AttributeValue_3 *attr_val_3; const AttributeValue_4 *attr_val_4; const AttributeConfig_2 *attr_conf_2; const AttributeConfig_3 *attr_conf_3; const AttDataReady *attr_dat_ready; }; SendEventType detect_and_push_events(DeviceImpl *,struct AttributeData &,DevFailed *,string &,struct timeval *); //------------------ Change event --------------------------- bool detect_change(Attribute &,struct AttributeData &,bool,double &,double &,DevFailed *,bool &,DeviceImpl *); //------------------ Detect, push change event -------------- bool detect_and_push_change_event(DeviceImpl *,struct AttributeData &,Attribute &,string &,DevFailed *,bool user_push = false); //------------------ Detect, push archive event -------------- bool detect_and_push_archive_event(DeviceImpl *,struct AttributeData &,Attribute &,string &,DevFailed *,struct timeval *,bool user_push = false); //------------------ Detect, push periodic event ------------- bool detect_and_push_periodic_event(DeviceImpl *,struct AttributeData &,Attribute &,string &,DevFailed *,struct timeval *); //------------------ Push event ------------------------------- virtual void push_event(DeviceImpl *,string,vector &,vector &,vector &,vector &,struct AttributeData &,string &,DevFailed *) = 0; virtual void push_heartbeat_event() = 0; //------------------- Attribute conf change event --------------------- void push_att_conf_events(DeviceImpl *device_impl,AttributeData &,DevFailed *,string &); omni_mutex &get_push_mutex() {return push_mutex;} static omni_mutex &get_event_mutex() {return event_mutex;} string &get_fqdn_prefix() {return fqdn_prefix;} bool get_one_subscription_cmd() {return one_subscription_cmd;} void set_one_subscription_cmd(bool val) {one_subscription_cmd = val;} protected : inline int timeval_diff(TimeVal before, TimeVal after) { return ((after.tv_sec-before.tv_sec)*1000000 + after.tv_usec - before.tv_usec); } static string fqdn_prefix; // Added a mutex to synchronize the access to // detect_and_push_change_event and // detect_and_push_archive_event which are used // from different threads static omni_mutex event_mutex; // Added a mutex to synchronize the access to // push_event which is used // from different threads static omni_mutex push_mutex; // Added a mutex to synchronize the access to // detect_event which is used // from different threads static omni_mutex detect_mutex; private: bool one_subscription_cmd; }; //--------------------------------------------------------------------- // // NotifdEventSupplier class // //--------------------------------------------------------------------- class NotifdEventSupplier : public EventSupplier, public POA_CosNotifyComm::StructuredPushSupplier { public : TANGO_IMP_EXP static NotifdEventSupplier *create(CORBA::ORB_var,string,Util *); void connect(); void disconnect_structured_push_supplier(); void disconnect_from_notifd(); void subscription_change(const CosNotification::EventTypeSeq& added,const CosNotification::EventTypeSeq& deled); void push_heartbeat_event(); string &get_event_channel_ior() {return event_channel_ior;} void file_db_svr(); //------------------ Push event ------------------------------- virtual void push_event(DeviceImpl *,string,vector &,vector &,vector &,vector &,struct AttributeData &,string &,DevFailed *); protected : NotifdEventSupplier(CORBA::ORB_var, CosNotifyChannelAdmin::SupplierAdmin_var, CosNotifyChannelAdmin::ProxyID, CosNotifyChannelAdmin::ProxyConsumer_var, CosNotifyChannelAdmin::StructuredProxyPushConsumer_var, CosNotifyChannelAdmin::EventChannelFactory_var, CosNotifyChannelAdmin::EventChannel_var, string &, Util *); private : static NotifdEventSupplier *_instance; CosNotifyChannelAdmin::EventChannel_var eventChannel; CosNotifyChannelAdmin::SupplierAdmin_var supplierAdmin; CosNotifyChannelAdmin::ProxyID proxyId; CosNotifyChannelAdmin::ProxyConsumer_var proxyConsumer; CosNotifyChannelAdmin::StructuredProxyPushConsumer_var structuredProxyPushConsumer; CosNotifyChannelAdmin::EventChannelFactory_var eventChannelFactory; CORBA::ORB_var orb_; string event_channel_ior; void reconnect_notifd(); TANGO_IMP_EXP static void connect_to_notifd(NotifService &,CORBA::ORB_var &,string &,Util *); }; //--------------------------------------------------------------------- // // ZmqEventSupplier class // //--------------------------------------------------------------------- #define LARGE_DATA_THRESHOLD 2048 #define LARGE_DATA_THRESHOLD_ENCODED LARGE_DATA_THRESHOLD * 4 #ifndef HAS_LAMBDA_FUNC template struct WantedClient : public binary_function { R operator() (A1 conn_client, A2 client) const { return conn_client.clnt == client; } }; template struct OldClient : public binary_function { R operator() (A1 conn_client, A2 ti) const { if (ti > (conn_client.date + 500)) { return true; } else return false; } }; #endif class ZmqEventSupplier : public EventSupplier { public : TANGO_IMP_EXP static ZmqEventSupplier *create(Util *); virtual ~ZmqEventSupplier(); //------------------ Push event ------------------------------- void push_heartbeat_event(); virtual void push_event(DeviceImpl *,string,vector &,vector &,vector &,vector &,struct AttributeData &,string &,DevFailed *); string &get_heartbeat_endpoint() {return heartbeat_endpoint;} string &get_event_endpoint() {return event_endpoint;} void create_event_socket(); void create_mcast_event_socket(string &,string &,int,bool); bool is_event_mcast(string &); string &get_mcast_event_endpoint(string &); void init_event_cptr(string &event_name); size_t get_mcast_event_nb() {return event_mcast.size();} bool update_connected_client(client_addr *); void set_double_send() {double_send=true;double_send_heartbeat=true;} int get_zmq_release() {return zmq_release;} protected : ZmqEventSupplier(Util *); private : static ZmqEventSupplier *_instance; struct McastSocketPub { string endpoint; zmq::socket_t *pub_socket; bool local_client; bool double_send; }; struct ConnectedClient { client_addr clnt; time_t date; }; zmq::context_t zmq_context; // ZMQ context zmq::socket_t *heartbeat_pub_sock; // heartbeat publisher socket zmq::socket_t *event_pub_sock; // events publisher socket map event_mcast; // multicast socket(s) map // The key is the full event name // ie: tango://kidiboo.esrf.fr:1000/dev/test/10/att.change string heartbeat_endpoint; // heartbeat publisher endpoint string host_ip; // Host IP address string heartbeat_event_name; // The event name used for the heartbeat ZmqCallInfo heartbeat_call; // The heartbeat call info cdrMemoryStream heartbeat_call_cdr; // TangoCdrMemoryStream data_call_cdr; string event_name; zmq::message_t endian_mess; // Zmq messages zmq::message_t endian_mess_2; // zmq::message_t endian_mess_heartbeat; // zmq::message_t endian_mess_heartbeat_2;// zmq::message_t heartbeat_call_mess; // zmq::message_t heartbeat_call_mess_2; // unsigned char host_endian; // the host endianess bool heartbeat_name_init; bool ip_specified; // The user has specified an IP address string user_ip; // The specified IP address string event_endpoint; // event publisher endpoint map event_cptr; // event counter map list con_client; // Connected clients bool double_send; // Double send flag bool double_send_heartbeat; int zmq_release; // ZMQ lib release void tango_bind(zmq::socket_t *,string &); unsigned char test_endian(); void create_mcast_socket(string &,int,McastSocketPub &); }; } // End of namespace #endif // _EVENT_SUPPLIER_API_H tango-8.1.2c+dfsg.orig/lib/cpp/server/tangorollingfileappender.cpp0000644000175000017500000000405512205375142024220 0ustar piccapiccastatic const char *RcsId = "$Id: tangorollingfileappender.cpp 22213 2013-03-07 14:32:56Z taurel $\n$Name$"; //+============================================================================= // // file : tangorollingfileappender.cpp // // description : Implementation of the DServer logging oriented commands // // project : TANGO // // author(s) : N.Leclercq - SOLEIL // // Copyright (C) : 2004,2005,2006,2007,2008,2009,2010,2011,2012,2013 // European Synchrotron Radiation Facility // BP 220, Grenoble 38043 // FRANCE // // This file is part of Tango. // // Tango 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. // // Tango 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 Tango. If not, see . // // $Revision: 22213 $ // //-============================================================================= #if HAVE_CONFIG_H #include #endif #include #ifdef TANGO_HAS_LOG4TANGO #include namespace Tango { TangoRollingFileAppender::TangoRollingFileAppender(const std::string& name, const std::string& fileName, size_t maxFileSize) : log4tango::RollingFileAppender(name, fileName, maxFileSize * 1024) { // no-op } TangoRollingFileAppender::~TangoRollingFileAppender() { // no-op } bool TangoRollingFileAppender::isValid (void) const { return (_fd < 0) ? false : true; } } // namespace tango #endif // TANGO_HAS_LOG4TANGO tango-8.1.2c+dfsg.orig/lib/cpp/server/dserverpoll.cpp0000644000175000017500000013756312205375142021516 0ustar piccapiccastatic const char *RcsId = "$Id: dserverpoll.cpp 22597 2013-05-01 12:06:27Z taurel $\n$Name$"; //+============================================================================= // // file : DServer.cpp // // description : C++ source for the DServer class and its commands. // The class is derived from Device. It represents the // CORBA servant object which will be accessed from the // network. All commands which can be executed on a // DServer object are implemented in this file. // // project : TANGO // // author(s) : E.Taurel // // Copyright (C) : 2004,2005,2006,2007,2008,2009,2010,2011,2012,2013 // European Synchrotron Radiation Facility // BP 220, Grenoble 38043 // FRANCE // // This file is part of Tango. // // Tango 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. // // Tango 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 Tango. If not, see . // // $Revision: 22597 $ // //-============================================================================= #if HAVE_CONFIG_H #include #endif #include #include #ifdef _TG_WINDOWS_ #include #else #include #endif #include namespace Tango { //+---------------------------------------------------------------------------- // // method : DServer::polled_device() // // description : command to read all the devices actually polled by the // device server // // out : The device name list in a strings sequence // //----------------------------------------------------------------------------- Tango::DevVarStringArray *DServer::polled_device() { NoSyncModelTangoMonitor mon(this); cout4 << "In polled_device command" << endl; long nb_class = class_list.size(); vector dev_name; try { for (int i = 0;i < nb_class;i++) { long nb_dev = class_list[i]->get_device_list().size(); for (long j = 0;j < nb_dev;j++) { if ((class_list[i]->get_device_list())[j]->is_polled() == true) { dev_name.push_back((class_list[i]->get_device_list())[j]->get_name().c_str()); } } } } catch (bad_alloc) { Except::throw_exception((const char *)API_MemoryAllocation, (const char *)"Can't allocate memory in server", (const char *)"DServer::polled_device"); } // // Return an empty sequence if no devices are polled // if (dev_name.empty() == true) { Tango::DevVarStringArray *ret = new Tango::DevVarStringArray(); ret->length(0); return ret; } // // Returned device name list to caller (sorted) // sort(dev_name.begin(),dev_name.end()); long nb_dev = dev_name.size(); Tango::DevVarStringArray *ret = new Tango::DevVarStringArray(nb_dev); ret->length(nb_dev); for (long k = 0;k < nb_dev;k++) (*ret)[k] = dev_name[k].c_str(); return(ret); } //+---------------------------------------------------------------------------- // // method : DServer::dev_polled_status() // // description : command to read device polling status // // out : The device polling status as a string (multiple lines) // //----------------------------------------------------------------------------- Tango::DevVarStringArray *DServer::dev_poll_status(string &dev_name) { NoSyncModelTangoMonitor mon(this); cout4 << "In dev_poll_status method" << endl; // // Find the device // Tango::Util *tg = Tango::Util::instance(); DeviceImpl *dev; dev = tg->get_device_by_name(dev_name); vector &poll_list = dev->get_poll_obj_list(); long nb_poll_obj = poll_list.size(); // // Return an empty sequence if nothing is polled for this device // if (nb_poll_obj == 0) { Tango::DevVarStringArray *ret; ret = new DevVarStringArray(); ret->length(0); return ret; } long i,nb_cmd,nb_attr; // // Compute how many cmds and/or attributes are polled // Since IDL V3, state and status are polled as attributes // For compatibility, if one of these "attributes" is polled, // also returned the info as the command is polled // nb_cmd = nb_attr = 0; long nb_to_add = 0; for (i = 0;i < nb_poll_obj;i++) { if (poll_list[i]->get_type() == Tango::POLL_CMD) nb_cmd++; else { nb_attr++; if ((poll_list[i]->get_name() == "state") || (poll_list[i]->get_name() == "status")) { nb_cmd++; nb_to_add++; } } } // // Allocate memory for returned strings // Tango::DevVarStringArray *ret; ret = new DevVarStringArray(nb_poll_obj + nb_to_add); ret->length(nb_poll_obj + nb_to_add); // // Populate returned strings // long cmd_ind = 0; long attr_ind = nb_cmd; string returned_info; for(i = 0;i < nb_poll_obj;i++) { bool duplicate = false; // // First, the name // Tango::PollObjType type = poll_list[i]->get_type(); if (type == Tango::POLL_CMD) { returned_info = "Polled command name = "; long k; long nb_cmd = dev->get_device_class()->get_command_list().size(); for (k = 0;k < nb_cmd;k++) { if (dev->get_device_class()->get_command_list()[k]->get_lower_name() == poll_list[i]->get_name()) { returned_info = returned_info + dev->get_device_class()->get_command_list()[k]->get_name(); break; } } } else { returned_info = "Polled attribute name = "; if (poll_list[i]->get_name() == "state") { duplicate = true; returned_info = returned_info + "State"; } else if (poll_list[i]->get_name() == "status") { duplicate = true; returned_info = returned_info + "Status"; } else { Attribute &att = dev->get_device_attr()->get_attr_by_name(poll_list[i]->get_name().c_str()); returned_info = returned_info + att.get_name(); } } // // Add update period // // TangoSys_MemStream s; stringstream s; string tmp_str; long po = poll_list[i]->get_upd(); if (po == 0) { returned_info = returned_info + "\nPolling externally triggered"; } else { returned_info = returned_info + "\nPolling period (mS) = "; s << po; s >> tmp_str; returned_info = returned_info + tmp_str; s.clear(); // clear the stream eof flag } s.str(""); // clear the underlying string // // Add ring buffer depth // returned_info = returned_info + "\nPolling ring buffer depth = "; long depth; if (type == Tango::POLL_CMD) depth = dev->get_cmd_poll_ring_depth(poll_list[i]->get_name()); else depth = dev->get_attr_poll_ring_depth(poll_list[i]->get_name()); s << depth; returned_info = returned_info + s.str(); s.str(""); // Clear the underlying string // // Add a message if the data ring is empty // if (poll_list[i]->is_ring_empty() == true) { returned_info = returned_info + "\nNo data recorded yet"; } else { // // Take polled object ownership in order to have coherent info returned to caller // We don't want the polling thread to insert a new elt in polling ring while // we are getting these data. Therefore, use the xxx_i methods // { omni_mutex_lock sync(*(poll_list[i])); // // Add needed time to execute last command // double tmp_db = poll_list[i]->get_needed_time_i(); if (tmp_db == 0.0) { returned_info = returned_info + "\nThe polling buffer is externally filled in"; } else { if (po != 0) { returned_info = returned_info + "\nTime needed for the last "; if (type == Tango::POLL_CMD) returned_info = returned_info + "command execution (mS) = "; else returned_info = returned_info + "attribute reading (mS) = "; s.setf(ios::fixed); s << setprecision(3) << tmp_db; returned_info = returned_info + s.str(); s.str(""); // // Add not updated since... info // returned_info = returned_info + "\nData not updated since "; double since = poll_list[i]->get_last_insert_date_i(); struct timeval now; #ifdef _TG_WINDOWS_ struct _timeb now_win; _ftime(&now_win); now.tv_sec = (unsigned long)now_win.time; now.tv_usec = (long)now_win.millitm * 1000; #else gettimeofday(&now,NULL); #endif now.tv_sec = now.tv_sec - DELTA_T; double now_d = (double)now.tv_sec + ((double)now.tv_usec / 1000000); double diff_t = now_d - since; diff_t = diff_t - (tmp_db / 1000); if (diff_t < 1.0) { long nb_msec = (long)(diff_t * 1000); s << nb_msec; returned_info = returned_info + s.str() + " mS"; s.str(""); } else if (diff_t < 60.0) { long nb_sec = (long)diff_t; long nb_msec = (long)((diff_t - nb_sec) * 1000); s << nb_sec; returned_info = returned_info + s.str() + " S and "; s.str(""); s << nb_msec; returned_info = returned_info + s.str() + " mS"; s.str(""); } else { long nb_min = (long)(diff_t / 60); long nb_sec = (long)(diff_t - (60 * nb_min)); long nb_msec = (long)((diff_t - (long)diff_t) * 1000); s << nb_min; returned_info = returned_info + s.str() + " MN"; s.str(""); if (nb_sec != 0) { s << nb_sec ; returned_info = returned_info + " ," + s.str() + " S"; s.str(""); } if (nb_msec != 0) { s << nb_msec; returned_info = returned_info + " and " + s.str() + " mS"; s.str(""); } } } } // // Add delta_t between last record(s) // try { vector delta; poll_list[i]->get_delta_t_i(delta,4); returned_info = returned_info + "\nDelta between last records (in mS) = "; for (unsigned long j = 0;j < delta.size();j++) { long nb_msec = (long)(delta[j] * 1000); s << nb_msec; returned_info = returned_info + s.str(); s.str(""); if (j != (delta.size() - 1)) returned_info = returned_info + ", "; } } catch (Tango::DevFailed) { } // // Add last polling exception fields (if any) // long dev_vers; bool last_err; dev_vers = dev->get_dev_idl_version(); if (dev_vers < 3) last_err = poll_list[i]->is_last_an_error_i(); else last_err = poll_list[i]->is_last_an_error_i_3(); if (last_err == true) { if (type == Tango::POLL_CMD) returned_info = returned_info + "\nLast command execution FAILED :"; else returned_info = returned_info + "\nLast attribute read FAILED :"; Tango::DevFailed *exe_ptr = poll_list[i]->get_last_except_i(); returned_info = returned_info + "\n\tReason = " + exe_ptr->errors[0].reason.in(); returned_info = returned_info + "\n\tDesc = " + exe_ptr->errors[0].desc.in(); returned_info = returned_info + "\n\tOrigin = " + exe_ptr->errors[0].origin.in(); } // // Release polled object monitor (only a compiler block end) // } } // // Init. string in sequence // if (type == Tango::POLL_CMD) { (*ret)[cmd_ind] = CORBA::string_dup(returned_info.c_str()); cmd_ind++; } else { (*ret)[attr_ind] = CORBA::string_dup(returned_info.c_str()); attr_ind++; // // If the attribute is state or status, also add the string in command list // after replacing all occurences of "attributes" by "command" in the returned // string // if (duplicate == true) { string::size_type pos = returned_info.find("attribute"); while (pos != string::npos) { returned_info.replace(pos,9,"command"); string::size_type npos; npos = returned_info.find("attribute",pos); pos = npos; } (*ret)[cmd_ind] = CORBA::string_dup(returned_info.c_str()); cmd_ind++; } } } return(ret); } //+---------------------------------------------------------------------------- // // method : DServer::add_obj_polling() // // description : command to add one object to be polled // // in : The polling parameters : // device name // object type (command or attribute) // object name // update period in mS (in the long array) // //----------------------------------------------------------------------------- void DServer::add_obj_polling(const Tango::DevVarLongStringArray *argin, bool with_db_upd,int delta_ms) { NoSyncModelTangoMonitor nosyn_mon(this); cout4 << "In add_obj_polling method" << endl; unsigned long i; for (i = 0;i < argin->svalue.length();i++) cout4 << "Input string = " << (argin->svalue)[i].in() << endl; for (i = 0;i < argin->lvalue.length();i++) cout4 << "Input long = " << (argin->lvalue)[i] << endl; // // Check that parameters number is correct // if ((argin->svalue.length() != 3) || (argin->lvalue.length() != 1)) { Except::throw_exception((const char *)API_WrongNumberOfArgs, (const char *)"Incorrect number of inout arguments", (const char *)"DServer::add_obj_polling"); } // // Find the device // Tango::Util *tg = Tango::Util::instance(); DeviceImpl *dev = NULL; try { dev = tg->get_device_by_name((argin->svalue)[0]); } catch (Tango::DevFailed &e) { TangoSys_OMemStream o; o << "Device " << (argin->svalue)[0] << " not found" << ends; Except::re_throw_exception(e,(const char *)API_DeviceNotFound,o.str(), (const char *)"DServer::add_obj_polling"); } // // If the device is locked and if the client is not the lock owner, // refuse to do the job // check_lock_owner(dev,"add_obj_polling",(argin->svalue)[0]); // // Check that the command (or the attribute) exists. For command, also checks // that it does not need input value. // string obj_type((argin->svalue)[1]); transform(obj_type.begin(),obj_type.end(),obj_type.begin(),::tolower); string obj_name((argin->svalue)[2]); transform(obj_name.begin(),obj_name.end(),obj_name.begin(),::tolower); PollObjType type = Tango::POLL_CMD; if (obj_type == PollCommand) { dev->check_command_exists(obj_name); type = Tango::POLL_CMD; } else if (obj_type == PollAttribute) { dev->get_device_attr()->get_attr_by_name((argin->svalue)[2]); type = Tango::POLL_ATTR; } else { TangoSys_OMemStream o; o << "Object type " << obj_type << " not supported" << ends; Except::throw_exception((const char *)API_NotSupported,o.str(), (const char *)"DServer::add_obj_polling"); } // // If it's for the Init command, refuse to poll it // if (obj_type == PollCommand) { if (obj_name == "init") { TangoSys_OMemStream o; o << "It's not possible to poll the Init command!" << ends; Except::throw_exception((const char *)API_NotSupported,o.str(), (const char *)"DServer::add_obj_polling"); } // // Since IDl release 3, state and status command must be polled // as attributes to be able to generate event on state or // status. // else if ((dev->get_dev_idl_version() >= 3) && ((obj_name == "state") || (obj_name == "status"))) type = Tango::POLL_ATTR; } // // Check that the object is not already polled // vector &poll_list = dev->get_poll_obj_list(); for (i = 0;i < poll_list.size();i++) { if (poll_list[i]->get_type() == type) { string name_lower = poll_list[i]->get_name(); transform(name_lower.begin(),name_lower.end(),name_lower.begin(),::tolower); if (name_lower == obj_name) { TangoSys_OMemStream o; if (type == Tango::POLL_CMD) o << "Command "; else o << "Attribute "; o << obj_name << " already polled" << ends; Except::throw_exception((const char *)API_AlreadyPolled, o.str(), (const char *)"DServer::add_obj_polling"); } } } // // Check that the update period is not to small // int upd = (argin->lvalue)[0]; if ((upd != 0) && (upd < MIN_POLL_PERIOD)) { TangoSys_OMemStream o; o << (argin->lvalue)[0] << " is below the min authorized period (" << MIN_POLL_PERIOD << " mS)" << ends; Except::throw_exception((const char *)API_NotSupported,o.str(), (const char *)"DServer::add_obj_polling"); } // // Check that the requested polling period is not below the one authorized // (if defined) // 0 as polling period is always authorized for polling buffer externally filled // if (upd != 0) check_upd_authorized(dev,upd,type,obj_name); // // Create a new PollObj instance for this object // Protect this code by a monitor in case of the polling thread using one of // the vector element. // long depth; if (obj_type == PollCommand) depth = dev->get_cmd_poll_ring_depth(obj_name); else depth = dev->get_attr_poll_ring_depth(obj_name); dev->get_poll_monitor().get_monitor(); poll_list.push_back(new PollObj(dev,type,obj_name,upd,depth)); dev->get_poll_monitor().rel_monitor(); // // Find out which thread is in charge of the device. // If none exists already, create one // PollingThreadInfo *th_info; int thread_created = -2; int poll_th_id = tg->get_polling_thread_id_by_name((argin->svalue)[0]); if (poll_th_id == 0) { cout4 << "POLLING: Creating a thread to poll device " << (argin->svalue)[0] << endl; thread_created = tg->create_poll_thread((argin->svalue)[0],false); poll_th_id = tg->get_polling_thread_id_by_name((argin->svalue)[0]); } cout4 << "POLLING: Thread in charge of device " << (argin->svalue)[0] << " is thread " << poll_th_id << endl; th_info = tg->get_polling_thread_info_by_id(poll_th_id); // // Send command to the polling thread but wait in case of previous cmd // still not executed // cout4 << "Sending cmd to polling thread" << endl; TangoMonitor &mon = th_info->poll_mon; PollThCmd &shared_cmd = th_info->shared_data; int th_id = omni_thread::self()->id(); if (th_id != poll_th_id) { omni_mutex_lock sync(mon); if (shared_cmd.cmd_pending == true) { mon.wait(); } shared_cmd.cmd_pending = true; shared_cmd.cmd_code = POLL_ADD_OBJ; shared_cmd.dev = dev; shared_cmd.index = poll_list.size() - 1; shared_cmd.new_upd = delta_ms; mon.signal(); cout4 << "Cmd sent to polling thread" << endl; // // Wait for thread to execute command except if the command is // requested by the polling thread itself // omni_thread *th = omni_thread::self(); int th_id = th->id(); if (th_id != poll_th_id) { while (shared_cmd.cmd_pending == true) { int interupted = mon.wait(DEFAULT_TIMEOUT); if ((shared_cmd.cmd_pending == true) && (interupted == false)) { cout4 << "TIME OUT" << endl; delete poll_list.back(); poll_list.pop_back(); // // If the thread has been created by this request, try to kill it // if (thread_created == -1) { shared_cmd.cmd_pending = true; shared_cmd.cmd_code = POLL_EXIT; mon.signal(); } Except::throw_exception((const char *)API_CommandTimedOut, (const char *)"Polling thread blocked !!!", (const char *)"DServer::add_obj_polling"); } } } } else { shared_cmd.cmd_pending = true; shared_cmd.cmd_code = POLL_ADD_OBJ; shared_cmd.dev = dev; shared_cmd.index = poll_list.size() - 1; shared_cmd.new_upd = delta_ms; PollThread *poll_th = th_info->poll_th; poll_th->set_local_cmd(shared_cmd); poll_th->execute_cmd(); } cout4 << "Thread cmd normally executed" << endl; th_info->nb_polled_objects++; // // Update polling parameters in database (if wanted and possible) // If the property is already there (it should not but...), only update its // polling period // if ((with_db_upd == true) && (Tango::Util::_UseDb == true)) { TangoSys_MemStream s; string upd_str; s << upd; s >> upd_str; bool found = false; DbDatum db_info("polled_cmd"); if (type == Tango::POLL_CMD) { vector &non_auto_list = dev->get_non_auto_polled_cmd(); vector::iterator ite; for (ite = non_auto_list.begin();ite < non_auto_list.end();++ite) { if (TG_strcasecmp((*ite).c_str(),obj_name.c_str()) == 0) { non_auto_list.erase(ite); db_info.name = "non_auto_polled_cmd"; db_info << non_auto_list; found = true; break; } } if (found == false) { vector &cmd_list = dev->get_polled_cmd(); for (i = 0;i < cmd_list.size();i = i+2) { if (TG_strcasecmp(cmd_list[i].c_str(),obj_name.c_str()) == 0) { cmd_list[i + 1] = upd_str; break; } } if (i == cmd_list.size()) { cmd_list.push_back(obj_name); cmd_list.push_back(upd_str); } db_info << cmd_list; } } else { vector &non_auto_list = dev->get_non_auto_polled_attr(); vector::iterator ite; for (ite = non_auto_list.begin();ite < non_auto_list.end();++ite) { if (TG_strcasecmp((*ite).c_str(),obj_name.c_str()) == 0) { non_auto_list.erase(ite); db_info.name = "non_auto_polled_attr"; db_info << non_auto_list; found = true; break; } } if (found == false) { db_info.name = "polled_attr"; vector &attr_list = dev->get_polled_attr(); for (i = 0;i < attr_list.size();i = i+2) { if (TG_strcasecmp(attr_list[i].c_str(),obj_name.c_str()) == 0) { attr_list[i + 1] = upd_str; break; } } if (i == attr_list.size()) { attr_list.push_back(obj_name); attr_list.push_back(upd_str); } db_info << attr_list; } } DbData send_data; send_data.push_back(db_info); dev->get_db_device()->put_property(send_data); } // // If a polling thread has just been created, ask it to poll // if (thread_created == -1) { start_polling(th_info); } // // Also update the polling threads pool conf if one thread has been created by this call // if (thread_created != -2) { string dev_name((argin->svalue)[0]); transform(dev_name.begin(),dev_name.end(),dev_name.begin(),::tolower); cout4 << "thread_created = " << thread_created << endl; if (thread_created == -1) { tg->get_poll_pool_conf().push_back(dev_name); } else if (thread_created >= 0) { string &conf_entry = (tg->get_poll_pool_conf())[thread_created]; conf_entry = conf_entry + ',' + dev_name; } if ((with_db_upd == true) && (Tango::Util::_UseDb == true)) { DbData send_data; send_data.push_back(DbDatum("polling_threads_pool_conf")); send_data[0] << tg->get_poll_pool_conf(); tg->get_dserver_device()->get_db_device()->put_property(send_data); } } cout4 << "Polling properties updated" << endl; // // Mark the device as polled // dev->is_polled(true); } //+---------------------------------------------------------------------------- // // method : DServer::upd_obj_polling_period() // // description : command to upadte an already polled object update period // // in : The polling parameters : // device name // object type (command or attribute) // object name // update period in mS (in the long array) // //----------------------------------------------------------------------------- void DServer::upd_obj_polling_period(const Tango::DevVarLongStringArray *argin, bool with_db_upd) { NoSyncModelTangoMonitor nosync_mon(this); cout4 << "In upd_obj_polling_period method" << endl; unsigned long i; for (i = 0;i < argin->svalue.length();i++) cout4 << "Input string = " << (argin->svalue)[i].in() << endl; for (i = 0;i < argin->lvalue.length();i++) cout4 << "Input long = " << (argin->lvalue)[i] << endl; // // Check that parameters number is correct // if ((argin->svalue.length() != 3) || (argin->lvalue.length() != 1)) { Except::throw_exception((const char *)API_WrongNumberOfArgs, (const char *)"Incorrect number of inout arguments", (const char *)"DServer::upd_obj_polling_period"); } // // Find the device // Tango::Util *tg = Tango::Util::instance(); DeviceImpl *dev = NULL; try { dev = tg->get_device_by_name((argin->svalue)[0]); } catch (Tango::DevFailed &e) { TangoSys_OMemStream o; o << "Device " << (argin->svalue)[0] << " not found" << ends; Except::re_throw_exception(e,(const char *)API_DeviceNotFound,o.str(), (const char *)"DServer::upd_obj_polling_period"); } // // Check that the device is polled // if (dev->is_polled() == false) { TangoSys_OMemStream o; o << "Device " << (argin->svalue)[0] << " is not polled" << ends; Except::throw_exception((const char *)API_DeviceNotPolled,o.str(), (const char *)"DServer::upd_obj_polling_period"); } // // If the device is locked and if the client is not the lock owner, // refuse to do the job // check_lock_owner(dev,"upd_obj_polling_period",(argin->svalue)[0]); // // Find the wanted object in the list of device polled object // string obj_type((argin->svalue)[1]); transform(obj_type.begin(),obj_type.end(),obj_type.begin(),::tolower); string obj_name((argin->svalue)[2]); transform(obj_name.begin(),obj_name.end(),obj_name.begin(),::tolower); PollObjType type = Tango::POLL_CMD; if (obj_type == PollCommand) { type = Tango::POLL_CMD; // // Since IDl release 3, state and status command must be polled // as attributes to be able to generate event on state or // status. // if ((obj_name == "state") || (obj_name == "status")) type = Tango::POLL_ATTR; } else if (obj_type == PollAttribute) { type = Tango::POLL_ATTR; } else { TangoSys_OMemStream o; o << "Object type " << obj_type << " not supported" << ends; Except::throw_exception((const char *)API_NotSupported,o.str(), (const char *)"DServer::upd_obj_polling_period"); } vector::iterator ite = dev->get_polled_obj_by_type_name(type,obj_name); // // Check that the requested polling period is not below the one authorized // (if defined) // int upd = (argin->lvalue)[0]; check_upd_authorized(dev,upd,type,obj_name); // // Check that it is not an externally triggered polling object. In this // case, throw exception // /* long tmp_upd = (*ite)->get_upd(); if (tmp_upd == 0) { TangoSys_OMemStream o; o << "Polling for "; if (type == Tango::POLL_CMD) o << "command "; else o << "attribute "; o << (argin->svalue)[2]; o << " (device " << (argin->svalue)[0] << ") "; o << " is externally triggered. Remove and add object to change its polling period"; o << ends; Except::throw_exception((const char *)API_NotSupported,o.str(), (const char *)"DServer::upd_obj_polling_period"); }*/ // // Check that the update period is not to small // if ((upd != 0) && (upd < MIN_POLL_PERIOD)) { TangoSys_OMemStream o; o << (argin->lvalue)[0] << " is below the min authorized period (" << MIN_POLL_PERIOD << " mS)" << ends; Except::throw_exception((const char *)API_NotSupported,o.str(), (const char *)"DServer::upd_obj_polling"); } // // Find out which thread is in charge of the device. // If none exists already, create one // PollingThreadInfo *th_info; int poll_th_id = tg->get_polling_thread_id_by_name((argin->svalue)[0]); if (poll_th_id == 0) { TangoSys_OMemStream o; o << "Can't find a polling thread for device " << (argin->svalue)[0] << ends; Except::throw_exception((const char *)API_NotSupported,o.str(), (const char *)"DServer::upd_obj_polling"); } th_info = tg->get_polling_thread_info_by_id(poll_th_id); // // Update polling period // (*ite)->update_upd((argin->lvalue)[0]); // // Send command to the polling thread // TangoMonitor &mon = th_info->poll_mon; PollThCmd &shared_cmd = th_info->shared_data; int th_id = omni_thread::self()->id(); if (th_id != poll_th_id) { omni_mutex_lock sync(mon); if (shared_cmd.cmd_pending == true) { mon.wait(); } shared_cmd.cmd_pending = true; shared_cmd.cmd_code = POLL_UPD_PERIOD; shared_cmd.dev = dev; shared_cmd.name = obj_name; shared_cmd.type = type; shared_cmd.new_upd = (argin->lvalue)[0]; shared_cmd.index = distance(dev->get_poll_obj_list().begin(),ite); mon.signal(); } else { shared_cmd.cmd_pending = true; shared_cmd.cmd_code = POLL_UPD_PERIOD; shared_cmd.dev = dev; shared_cmd.name = obj_name; shared_cmd.type = type; shared_cmd.new_upd = (argin->lvalue)[0]; shared_cmd.index = distance(dev->get_poll_obj_list().begin(),ite); PollThread *poll_th = th_info->poll_th; poll_th->set_local_cmd(shared_cmd); poll_th->execute_cmd(); } // // Update database property --> Update polling period if this object is already // defined in the polling property. Add object name and update period if the // object is not known in the property // if ((with_db_upd == true) && (Tango::Util::_UseDb == true)) { TangoSys_MemStream s; string upd_str; s << (argin->lvalue)[0] << ends; s >> upd_str; DbDatum db_info("polled_attr"); if (type == Tango::POLL_CMD) { db_info.name = "polled_cmd"; vector &cmd_list = dev->get_polled_cmd(); for (i = 0;i < cmd_list.size();i = i+2) { if (TG_strcasecmp(cmd_list[i].c_str(),obj_name.c_str()) == 0) { cmd_list[i + 1] = upd_str; break; } } if (i == cmd_list.size()) { cmd_list.push_back(obj_name); cmd_list.push_back(upd_str); } db_info << cmd_list; } else { vector &attr_list = dev->get_polled_attr(); for (i = 0;i < attr_list.size();i = i+2) { if (TG_strcasecmp(attr_list[i].c_str(),obj_name.c_str()) == 0) { attr_list[i + 1] = upd_str; break; } } if (i == attr_list.size()) { attr_list.push_back(obj_name); attr_list.push_back(upd_str); } db_info << attr_list; } DbData send_data; send_data.push_back(db_info); dev->get_db_device()->put_property(send_data); } } //+---------------------------------------------------------------------------- // // method : DServer::rem_obj_polling() // // description : command to remove an already polled object from the device // polled object list // // in : - argin: The polling parameters : // device name // object type (command or attribute) // object name // - with_db_upd : Update db flag // //----------------------------------------------------------------------------- void DServer::rem_obj_polling(const Tango::DevVarStringArray *argin,bool with_db_upd) { NoSyncModelTangoMonitor nosync_mon(this); cout4 << "In rem_obj_polling method" << endl; unsigned long i; for (i = 0;i < argin->length();i++) cout4 << "Input string = " << (*argin)[i].in() << endl; // // Check that parameters number is correct // if (argin->length() != 3) { Except::throw_exception((const char *)API_WrongNumberOfArgs, (const char *)"Incorrect number of inout arguments", (const char *)"DServer::rem_obj_polling"); } // // Find the device // Tango::Util *tg = Tango::Util::instance(); DeviceImpl *dev = NULL; try { dev = tg->get_device_by_name((*argin)[0]); } catch (Tango::DevFailed &e) { TangoSys_OMemStream o; o << "Device " << (*argin)[0] << " not found" << ends; Except::re_throw_exception(e,(const char *)API_DeviceNotFound,o.str(), (const char *)"DServer::rem_obj_polling"); } // // Check that the device is polled // if (dev->is_polled() == false) { TangoSys_OMemStream o; o << "Device " << (*argin)[0] << " is not polled" << ends; Except::throw_exception((const char *)API_DeviceNotPolled,o.str(), (const char *)"DServer::rem_obj_polling"); } // // If the device is locked and if the client is not the lock owner, // refuse to do the job // check_lock_owner(dev,"rem_obj_polling",(*argin)[0]); // // Find the wanted object in the list of device polled object // string obj_type((*argin)[1]); transform(obj_type.begin(),obj_type.end(),obj_type.begin(),::tolower); string obj_name((*argin)[2]); transform(obj_name.begin(),obj_name.end(),obj_name.begin(),::tolower); PollObjType type = Tango::POLL_CMD; if (obj_type == PollCommand) { type = Tango::POLL_CMD; if ((obj_name == "state") || (obj_name == "status")) type = Tango::POLL_ATTR; } else if (obj_type == PollAttribute) { type = Tango::POLL_ATTR; } else { TangoSys_OMemStream o; o << "Object type " << obj_type << " not supported" << ends; Except::throw_exception((const char *)API_NotSupported,o.str(), (const char *)"DServer::rem_obj_polling"); } vector::iterator ite = dev->get_polled_obj_by_type_name(type,obj_name); long tmp_upd = (*ite)->get_upd(); // // Find out which thread is in charge of the device. // PollingThreadInfo *th_info; int poll_th_id; if (tg->is_svr_shutting_down() == false) { poll_th_id = tg->get_polling_thread_id_by_name((*argin)[0]); if (poll_th_id == 0) { TangoSys_OMemStream o; o << "Can't find a polling thread for device " << (*argin)[0] << ends; Except::throw_exception((const char *)API_NotSupported,o.str(), (const char *)"DServer::rem_obj_polling"); } cout4 << "Thread in charge of device " << (*argin)[0] << " is thread " << poll_th_id << endl; th_info = tg->get_polling_thread_info_by_id(poll_th_id); // // Test whether the polling thread is still running! // if ( th_info->poll_th != NULL ) { // // Send command to the polling thread // cout4 << "Sending cmd to polling thread" << endl; TangoMonitor &mon = th_info->poll_mon; PollThCmd &shared_cmd = th_info->shared_data; int th_id = omni_thread::self()->id(); if (th_id != poll_th_id) { omni_mutex_lock sync(mon); if (shared_cmd.cmd_pending == true) { mon.wait(); } shared_cmd.cmd_pending = true; if (tmp_upd == 0) shared_cmd.cmd_code = POLL_REM_EXT_TRIG_OBJ; else shared_cmd.cmd_code = POLL_REM_OBJ; shared_cmd.dev = dev; shared_cmd.name = obj_name; shared_cmd.type = type; mon.signal(); cout4 << "Cmd sent to polling thread" << endl; // // Wait for thread to execute command except if the command is // requested by the polling thread itself // int th_id = omni_thread::self()->id(); if (th_id != poll_th_id) { while (shared_cmd.cmd_pending == true) { int interupted = mon.wait(DEFAULT_TIMEOUT); if ((shared_cmd.cmd_pending == true) && (interupted == false)) { cout4 << "TIME OUT" << endl; Except::throw_exception((const char *)API_CommandTimedOut, (const char *)"Polling thread blocked !!!", (const char *)"DServer::rem_obj_polling"); } } } } else { shared_cmd.cmd_pending = true; if (tmp_upd == 0) shared_cmd.cmd_code = POLL_REM_EXT_TRIG_OBJ; else shared_cmd.cmd_code = POLL_REM_OBJ; shared_cmd.dev = dev; shared_cmd.name = obj_name; shared_cmd.type = type; shared_cmd.index = distance(dev->get_poll_obj_list().begin(),ite); PollThread *poll_th = th_info->poll_th; poll_th->set_local_cmd(shared_cmd); poll_th->execute_cmd(); } cout4 << "Thread cmd normally executed" << endl; } else { cout4 << "Polling thread is no longer running!!!!" << endl; } } // // Remove the object from the polled object list // vector &poll_list = dev->get_poll_obj_list(); dev->get_poll_monitor().get_monitor(); delete(*ite); poll_list.erase(ite); dev->get_poll_monitor().rel_monitor(); // // Mark the device as non polled if this was the last polled object // if (poll_list.empty() == true) dev->is_polled(false); // // Update database property. This means remove object entry in the polling // properties if they exist or add it to the list of device not polled // for automatic polling defined at command/attribute level. // Do this if possible and wanted. // if ((with_db_upd == true) && (Tango::Util::_UseDb == true)) { DbData send_data; DbDatum db_info("polled_attr"); bool update_needed = false; if (type == Tango::POLL_CMD) { db_info.name = "polled_cmd"; vector &cmd_list = dev->get_polled_cmd(); vector::iterator s_ite; for (s_ite = cmd_list.begin();s_ite < cmd_list.end();++s_ite) { if (TG_strcasecmp((*s_ite).c_str(),obj_name.c_str()) == 0) { s_ite = cmd_list.erase(s_ite); cmd_list.erase(s_ite); db_info << cmd_list; update_needed = true; break; } ++s_ite; } if (update_needed == false) { vector &non_auto_cmd = dev->get_non_auto_polled_cmd(); for (s_ite = non_auto_cmd.begin();s_ite < non_auto_cmd.end();++s_ite) { if (TG_strcasecmp((*s_ite).c_str(),obj_name.c_str()) == 0) break; } if (s_ite == non_auto_cmd.end()) { non_auto_cmd.push_back(obj_name); db_info.name = "non_auto_polled_cmd"; db_info << non_auto_cmd; update_needed = true; } } } else { vector &attr_list = dev->get_polled_attr(); vector::iterator s_ite; for (s_ite = attr_list.begin();s_ite < attr_list.end();++s_ite) { if (TG_strcasecmp((*s_ite).c_str(),obj_name.c_str()) == 0) { s_ite = attr_list.erase(s_ite); attr_list.erase(s_ite); db_info << attr_list; update_needed = true; break; } ++s_ite; } if (update_needed == false) { vector &non_auto_attr = dev->get_non_auto_polled_attr(); for (s_ite = non_auto_attr.begin();s_ite < non_auto_attr.end();++s_ite) { if (TG_strcasecmp((*s_ite).c_str(),obj_name.c_str()) == 0) break; } if (s_ite == non_auto_attr.end()) { non_auto_attr.push_back(obj_name); db_info.name = "non_auto_polled_attr"; db_info << non_auto_attr; update_needed = true; } } } if (update_needed == true) { DbData send_data; send_data.push_back(db_info); if (db_info.size() == 0) dev->get_db_device()->delete_property(send_data); else dev->get_db_device()->put_property(send_data); cout4 << "Database polling properties updated" << endl; } } // // If the device is not polled any more, update the pool conf first locally. // Also update the map // If this device was the only one for a polling thread, kill the thread // Then in Db if possible // bool kill_thread = false; if (poll_list.empty() == true) { int ind; string dev_name((*argin)[0]); transform(dev_name.begin(),dev_name.end(),dev_name.begin(),::tolower); if ((ind = tg->get_dev_entry_in_pool_conf(dev_name)) == -1) { TangoSys_OMemStream o; o << "Can't find entry for device " << (*argin)[0] << " in polling threads pool configuration !"<< ends; Except::throw_exception((const char *)API_NotSupported,o.str(), (const char *)"DServer::rem_obj_polling"); } vector &pool_conf = tg->get_poll_pool_conf(); string &conf_entry = pool_conf[ind]; string::size_type pos; if ((pos = conf_entry.find(',')) != string::npos) { pos = conf_entry.find(dev_name); if ((pos + dev_name.size()) != conf_entry.size()) conf_entry.erase(pos,dev_name.size() + 1); else conf_entry.erase(pos - 1); } else { vector::iterator iter = pool_conf.begin() + ind; pool_conf.erase(iter); kill_thread = true; } tg->remove_dev_from_polling_map(dev_name); // // Kill the thread if needed and join // if (kill_thread == true && tg->is_svr_shutting_down() == false) { TangoMonitor &mon = th_info->poll_mon; PollThCmd &shared_cmd = th_info->shared_data; { omni_mutex_lock sync(mon); shared_cmd.cmd_pending = true; shared_cmd.cmd_code = POLL_EXIT; mon.signal(); } void *dummy_ptr; cout4 << "POLLING: Joining with one polling thread" << endl; th_info->poll_th->join(&dummy_ptr); tg->remove_polling_thread_info_by_id(poll_th_id); } // // Update db // if ((with_db_upd == true) && (Tango::Util::_UseDb == true)) { DbData send_data; send_data.push_back(DbDatum("polling_threads_pool_conf")); send_data[0] << tg->get_poll_pool_conf(); tg->get_dserver_device()->get_db_device()->put_property(send_data); } } } //+---------------------------------------------------------------------------- // // method : DServer::stop_polling() // // description : command to stop the polling thread // //----------------------------------------------------------------------------- void DServer::stop_polling() { NoSyncModelTangoMonitor nosync_mon(this); cout4 << "In stop_polling method" << endl; // // Send command to the polling thread and wait for its execution // int interupted; Tango::Util *tg = Tango::Util::instance(); vector &th_info = tg->get_polling_threads_info(); vector:: iterator iter; for (iter = th_info.begin();iter != th_info.end();++iter) { TangoMonitor &mon = (*iter)->poll_mon; PollThCmd &shared_cmd = (*iter)->shared_data; { omni_mutex_lock sync(mon); if (shared_cmd.cmd_pending == true) { mon.wait(); } shared_cmd.cmd_pending = true; shared_cmd.cmd_code = POLL_STOP; mon.signal(); while (shared_cmd.cmd_pending == true) { interupted = mon.wait(DEFAULT_TIMEOUT); if ((shared_cmd.cmd_pending == true) && (interupted == false)) { cout4 << "TIME OUT" << endl; Except::throw_exception((const char *)API_CommandTimedOut, (const char *)"Polling thread blocked !!!", (const char *)"DServer::stop_polling"); } } } } // // Update polling status // tg->poll_status(false); string &str = get_status(); str = "The device is ON\nThe polling is OFF"; } //+---------------------------------------------------------------------------- // // method : DServer::start_polling() // // description : command to start the polling thread // //----------------------------------------------------------------------------- void DServer::start_polling() { NoSyncModelTangoMonitor nosync_mon(this); cout4 << "In start_polling method" << endl; // // Send command to the polling thread(s) and wait for its execution // Tango::Util *tg = Tango::Util::instance(); vector &th_info = tg->get_polling_threads_info(); vector:: iterator iter; for (iter = th_info.begin();iter != th_info.end();++iter) { TangoMonitor &mon = (*iter)->poll_mon; PollThCmd &shared_cmd = (*iter)->shared_data; { omni_mutex_lock sync(mon); if (shared_cmd.cmd_pending == true) { mon.wait(); } shared_cmd.cmd_pending = true; shared_cmd.cmd_code = POLL_START; mon.signal(); while (shared_cmd.cmd_pending == true) { int interupted = mon.wait(DEFAULT_TIMEOUT); if ((shared_cmd.cmd_pending == true) && (interupted == false)) { cout4 << "TIME OUT" << endl; Except::throw_exception((const char *)API_CommandTimedOut, (const char *)"Polling thread blocked !!!", (const char *)"DServer::start_polling"); } } } } // // Update polling status // tg->poll_status(true); string &str = get_status(); str = "The device is ON\nThe polling is ON"; } void DServer::start_polling(PollingThreadInfo *th_info) { TangoMonitor &mon = th_info->poll_mon; PollThCmd &shared_cmd = th_info->shared_data; { omni_mutex_lock sync(mon); if (shared_cmd.cmd_pending == true) { mon.wait(); } shared_cmd.cmd_pending = true; shared_cmd.cmd_code = POLL_START; mon.signal(); while (shared_cmd.cmd_pending == true) { int interupted = mon.wait(DEFAULT_TIMEOUT); if ((shared_cmd.cmd_pending == true) && (interupted == false)) { cout4 << "TIME OUT" << endl; Except::throw_exception((const char *)API_CommandTimedOut, (const char *)"Polling thread blocked while trying to start thread polling!!!", (const char *)"DServer::start_polling"); } } } } //+---------------------------------------------------------------------------- // // method : DServer::add_event_heartbeat() // // description : command to ask the heartbeat thread to send // the event heartbeat every 10 seconds // //----------------------------------------------------------------------------- void DServer::add_event_heartbeat() { NoSyncModelTangoMonitor nosyn_mon(this); cout4 << "In add_event_heartbeat method" << endl; // // Send command to the heartbeat thread but wait in case of previous cmd // still not executed // cout4 << "Sending cmd to polling thread" << endl; Tango::Util *tg = Tango::Util::instance(); TangoMonitor &mon = tg->get_heartbeat_monitor(); PollThCmd &shared_cmd = tg->get_heartbeat_shared_cmd(); { omni_mutex_lock sync(mon); if (shared_cmd.cmd_pending == true) { mon.wait(); } shared_cmd.cmd_pending = true; shared_cmd.cmd_code = POLL_ADD_HEARTBEAT; mon.signal(); cout4 << "Cmd sent to polling thread" << endl; // // Wait for thread to execute command except if the command is // requested by the polling thread itself // int th_id = omni_thread::self()->id(); if (th_id != tg->get_heartbeat_thread_id()) { while (shared_cmd.cmd_pending == true) { int interupted = mon.wait(DEFAULT_TIMEOUT); if ((shared_cmd.cmd_pending == true) && (interupted == false)) { cout4 << "TIME OUT" << endl; Except::throw_exception((const char *)API_CommandTimedOut, (const char *)"Polling thread blocked !!!", (const char *)"DServer::add_event_heartbeat"); } } } } cout4 << "Thread cmd normally executed" << endl; } //+---------------------------------------------------------------------------- // // method : DServer::rem_event_heartbeat() // // description : command to ask the heartbeat thread to stop sending // the event heartbeat // //----------------------------------------------------------------------------- void DServer::rem_event_heartbeat() { NoSyncModelTangoMonitor nosyn_mon(this); cout4 << "In rem_event_heartbeat method" << endl; // // Send command to the heartbeat thread but wait in case of previous cmd // still not executed // cout4 << "Sending cmd to polling thread" << endl; Tango::Util *tg = Tango::Util::instance(); TangoMonitor &mon = tg->get_heartbeat_monitor(); PollThCmd &shared_cmd = tg->get_heartbeat_shared_cmd(); { omni_mutex_lock sync(mon); if (shared_cmd.cmd_pending == true) { mon.wait(); } shared_cmd.cmd_pending = true; shared_cmd.cmd_code = POLL_REM_HEARTBEAT; mon.signal(); cout4 << "Cmd sent to polling thread" << endl; // // Wait for thread to execute command except if the command is // requested by the polling thread itself // int th_id = omni_thread::self()->id(); if (th_id != tg->get_heartbeat_thread_id()) { while (shared_cmd.cmd_pending == true) { int interupted = mon.wait(DEFAULT_TIMEOUT); if ((shared_cmd.cmd_pending == true) && (interupted == false)) { cout4 << "TIME OUT" << endl; Except::throw_exception((const char *)API_CommandTimedOut, (const char *)"Polling thread blocked !!!", (const char *)"DServer::rem_event_heartbeat"); } } } } cout4 << "Thread cmd normally executed" << endl; } //+---------------------------------------------------------------------------- // // method : DServer::check_upd_authorized() // // description : In case a minimun update polling period is defined (via the // min_poll_period, cmd_min_poll_period,attr_min_poll_period) // check if the requested period is not smaller // // argin: dev : The device // upd : The requested update period // type : The polled object type (cmd / attr) // obj_name : The polled object name // //----------------------------------------------------------------------------- void DServer::check_upd_authorized(DeviceImpl *dev,int upd,PollObjType obj_type,string &obj_name) { int min_upd = 0; // // Get first the xxx_min_poll_period then if not defined the min_poll_period // vector *v_ptr; if (obj_type == Tango::POLL_CMD) v_ptr = &(dev->get_cmd_min_poll_period()); else v_ptr = &(dev->get_attr_min_poll_period()); vector::iterator ite = find(v_ptr->begin(),v_ptr->end(),obj_name); if (ite != v_ptr->end()) { ++ite; TangoSys_MemStream s; s << *ite; if (!(s >> min_upd)) { TangoSys_OMemStream o; o << "System property "; if (obj_type == Tango::POLL_CMD) o << "cmd_min_poll_period"; else o << "attr_min_poll_period"; o << " for device " << dev->get_name() << " has wrong syntax" << ends; Except::throw_exception((const char *)API_BadConfigurationProperty, o.str(), (const char *)"DServer::check_upd_uthorized()"); } } else { min_upd = dev->get_min_poll_period(); } // // Check with user request // if ((min_upd != 0) && (upd < min_upd)) { TangoSys_OMemStream o; o << "Polling period for "; if (obj_type == Tango::POLL_CMD) o << "command "; else o << "attribute "; o << obj_name << " is below the min authorized (" << min_upd << ")" << ends; Except::throw_exception((const char *)API_MethodArgument,o.str(), (const char *)"DServer::check_upd_authorized"); } } } // End of Tango namespace tango-8.1.2c+dfsg.orig/lib/cpp/Makefile.in0000644000175000017500000005332012205375243017176 0ustar piccapicca# Makefile.in generated by automake 1.11.3 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 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. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ subdir = lib/cpp DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in \ $(srcdir)/tango.pc.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/RSSH_CHECK_OMNIORB.m4 \ $(top_srcdir)/m4/RSSH_CHECK_PTHREADS.m4 \ $(top_srcdir)/m4/RSSH_CHECK_SUNPRO_CC.m4 \ $(top_srcdir)/m4/RSSH_ENABLE_PTHREADS.m4 \ $(top_srcdir)/m4/ac_cxx_have_class_strstream.m4 \ $(top_srcdir)/m4/ac_cxx_have_sstream.m4 \ $(top_srcdir)/m4/ac_cxx_namespaces.m4 \ $(top_srcdir)/m4/ac_path_mysqlclient.m4 \ $(top_srcdir)/m4/ac_prog_mysql.m4 \ $(top_srcdir)/m4/ax_cxx_compile_stdcxx_11.m4 \ $(top_srcdir)/m4/ax_jni_include_dir.m4 \ $(top_srcdir)/m4/check_zlib.m4 $(top_srcdir)/m4/gcc_release.m4 \ $(top_srcdir)/m4/java_release.m4 $(top_srcdir)/m4/libtool.m4 \ $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ $(top_srcdir)/m4/mysql_release.m4 $(top_srcdir)/configure.in am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/ac_config.h.tmp CONFIG_CLEAN_FILES = tango.pc CONFIG_CLEAN_VPATH_FILES = SOURCES = DIST_SOURCES = RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \ html-recursive info-recursive install-data-recursive \ install-dvi-recursive install-exec-recursive \ install-html-recursive install-info-recursive \ install-pdf-recursive install-ps-recursive install-recursive \ installcheck-recursive installdirs-recursive pdf-recursive \ ps-recursive uninstall-recursive 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)$(pkgconfigdir)" DATA = $(pkgconfig_DATA) 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 ETAGS = etags CTAGS = ctags DIST_SUBDIRS = $(SUBDIRS) DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) am__relativize = \ dir0=`pwd`; \ sed_first='s,^\([^/]*\)/.*$$,\1,'; \ sed_rest='s,^[^/]*/*,,'; \ sed_last='s,^.*/\([^/]*\)$$,\1,'; \ sed_butlast='s,/*[^/]*$$,,'; \ while test -n "$$dir1"; do \ first=`echo "$$dir1" | sed -e "$$sed_first"`; \ if test "$$first" != "."; then \ if test "$$first" = ".."; then \ dir2=`echo "$$dir0" | sed -e "$$sed_last"`/"$$dir2"; \ dir0=`echo "$$dir0" | sed -e "$$sed_butlast"`; \ else \ first2=`echo "$$dir2" | sed -e "$$sed_first"`; \ if test "$$first2" = "$$first"; then \ dir2=`echo "$$dir2" | sed -e "$$sed_rest"`; \ else \ dir2="../$$dir2"; \ fi; \ dir0="$$dir0"/"$$first"; \ fi; \ fi; \ dir1=`echo "$$dir1" | sed -e "$$sed_rest"`; \ done; \ reldir="$$dir2" ACLOCAL = @ACLOCAL@ ALLOCA = @ALLOCA@ AMTAR = @AMTAR@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CORBA_INCLUDES = @CORBA_INCLUDES@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CPP_ELEVEN = @CPP_ELEVEN@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DATADIR = @DATADIR@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DOXYGEN = @DOXYGEN@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ GREP = @GREP@ HAVE_CXX11 = @HAVE_CXX11@ HAVE_ORB_IDL = @HAVE_ORB_IDL@ IDL = @IDL@ IDLCXX = @IDLCXX@ IDLCXXFLAGS = @IDLCXXFLAGS@ IDLFLAGS = @IDLFLAGS@ IDL_CLN_CPP = @IDL_CLN_CPP@ IDL_CLN_CPP_SUFFIX = @IDL_CLN_CPP_SUFFIX@ IDL_CLN_H = @IDL_CLN_H@ IDL_CLN_H1_SUFFIX = @IDL_CLN_H1_SUFFIX@ IDL_CLN_H_SUFFIX = @IDL_CLN_H_SUFFIX@ IDL_CLN_O = @IDL_CLN_O@ IDL_CLN_OBJ_SUFFIX = @IDL_CLN_OBJ_SUFFIX@ IDL_H1_SUFFIX = @IDL_H1_SUFFIX@ IDL_H_SUFFIX = @IDL_H_SUFFIX@ IDL_SRV_CPP = @IDL_SRV_CPP@ IDL_SRV_CPP_SUFFIX = @IDL_SRV_CPP_SUFFIX@ IDL_SRV_H = @IDL_SRV_H@ IDL_SRV_H1_SUFFIX = @IDL_SRV_H1_SUFFIX@ IDL_SRV_H_SUFFIX = @IDL_SRV_H_SUFFIX@ IDL_SRV_O = @IDL_SRV_O@ IDL_SRV_OBJ_SUFFIX = @IDL_SRV_OBJ_SUFFIX@ IDL_TIE_CPP_SUFFIX = @IDL_TIE_CPP_SUFFIX@ IDL_TIE_H1_SUFFIX = @IDL_TIE_H1_SUFFIX@ IDL_TIE_H_SUFFIX = @IDL_TIE_H_SUFFIX@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ JAVA = @JAVA@ JAVAC = @JAVAC@ JAVAH = @JAVAH@ JNI_INCL_DIRS = @JNI_INCL_DIRS@ JPEG_LIB_CXXFLAGS = @JPEG_LIB_CXXFLAGS@ JPEG_MMX_LIB_CXXFLAGS = @JPEG_MMX_LIB_CXXFLAGS@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIBZMQ_CFLAGS = @LIBZMQ_CFLAGS@ LIBZMQ_LIBS = @LIBZMQ_LIBS@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ LYX = @LYX@ MAINT = @MAINT@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ MYSQL = @MYSQL@ MYSQLCLIENT_CFLAGS = @MYSQLCLIENT_CFLAGS@ MYSQLCLIENT_LDFLAGS = @MYSQLCLIENT_LDFLAGS@ MYSQLCLIENT_LIBS = @MYSQLCLIENT_LIBS@ MYSQL_ADMIN = @MYSQL_ADMIN@ MYSQL_ADMIN_PASSWD = @MYSQL_ADMIN_PASSWD@ MYSQL_HOST = @MYSQL_HOST@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ ORB = @ORB@ ORB_COSNAMING_LIB = @ORB_COSNAMING_LIB@ ORB_INCLUDE_PREFIX = @ORB_INCLUDE_PREFIX@ ORB_PREFIX = @ORB_PREFIX@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ TANGO_DB_NAME = @TANGO_DB_NAME@ TANGO_RC_FILE = @TANGO_RC_FILE@ VERSION = @VERSION@ VERSION_INFO = @VERSION_INFO@ ZLIB_CPPFLAGS = @ZLIB_CPPFLAGS@ ZLIB_LDFLAGS = @ZLIB_LDFLAGS@ ZLIB_LIBS = @ZLIB_LIBS@ ZMQ_PREFIX = @ZMQ_PREFIX@ _ACJNI_JAVAC = @_ACJNI_JAVAC@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_aux_dir = @ac_aux_dir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ omniCOS4_CFLAGS = @omniCOS4_CFLAGS@ omniCOS4_LIBS = @omniCOS4_LIBS@ omniORB4_CFLAGS = @omniORB4_CFLAGS@ omniORB4_LIBS = @omniORB4_LIBS@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ subdirs = @subdirs@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ SUBDIRS = log4tango client server EXTRA_DIST = tango.pc.in pkgconfigdir = $(libdir)/pkgconfig pkgconfig_DATA = tango.pc all: all-recursive .SUFFIXES: $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu lib/cpp/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu lib/cpp/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): tango.pc: $(top_builddir)/config.status $(srcdir)/tango.pc.in cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs install-pkgconfigDATA: $(pkgconfig_DATA) @$(NORMAL_INSTALL) test -z "$(pkgconfigdir)" || $(MKDIR_P) "$(DESTDIR)$(pkgconfigdir)" @list='$(pkgconfig_DATA)'; test -n "$(pkgconfigdir)" || list=; \ 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_DATA) $$files '$(DESTDIR)$(pkgconfigdir)'"; \ $(INSTALL_DATA) $$files "$(DESTDIR)$(pkgconfigdir)" || exit $$?; \ done uninstall-pkgconfigDATA: @$(NORMAL_UNINSTALL) @list='$(pkgconfig_DATA)'; test -n "$(pkgconfigdir)" || list=; \ files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ dir='$(DESTDIR)$(pkgconfigdir)'; $(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. $(RECURSIVE_TARGETS): @fail= failcom='exit 1'; \ for f in x $$MAKEFLAGS; do \ case $$f in \ *=* | --[!k]*);; \ *k*) failcom='fail=yes';; \ esac; \ done; \ dot_seen=no; \ target=`echo $@ | sed s/-recursive//`; \ list='$(SUBDIRS)'; for subdir in $$list; do \ echo "Making $$target in $$subdir"; \ if test "$$subdir" = "."; then \ dot_seen=yes; \ local_target="$$target-am"; \ else \ local_target="$$target"; \ fi; \ ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ || eval $$failcom; \ done; \ if test "$$dot_seen" = "no"; then \ $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \ fi; test -z "$$fail" $(RECURSIVE_CLEAN_TARGETS): @fail= failcom='exit 1'; \ for f in x $$MAKEFLAGS; do \ case $$f in \ *=* | --[!k]*);; \ *k*) failcom='fail=yes';; \ esac; \ done; \ dot_seen=no; \ case "$@" in \ distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \ *) list='$(SUBDIRS)' ;; \ esac; \ rev=''; for subdir in $$list; do \ if test "$$subdir" = "."; then :; else \ rev="$$subdir $$rev"; \ fi; \ done; \ rev="$$rev ."; \ target=`echo $@ | sed s/-recursive//`; \ for subdir in $$rev; do \ echo "Making $$target in $$subdir"; \ if test "$$subdir" = "."; then \ local_target="$$target-am"; \ else \ local_target="$$target"; \ fi; \ ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ || eval $$failcom; \ done && test -z "$$fail" tags-recursive: list='$(SUBDIRS)'; for subdir in $$list; do \ test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \ done ctags-recursive: list='$(SUBDIRS)'; for subdir in $$list; do \ test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \ done ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ mkid -fID $$unique tags: TAGS TAGS: tags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) set x; \ here=`pwd`; \ if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \ include_option=--etags-include; \ empty_fix=.; \ else \ include_option=--include; \ empty_fix=; \ fi; \ list='$(SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ test ! -f $$subdir/TAGS || \ set "$$@" "$$include_option=$$here/$$subdir/TAGS"; \ fi; \ done; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: CTAGS CTAGS: ctags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ 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 \ dir1=$$subdir; dir2="$(distdir)/$$subdir"; \ $(am__relativize); \ new_distdir=$$reldir; \ dir1=$$subdir; dir2="$(top_distdir)"; \ $(am__relativize); \ new_top_distdir=$$reldir; \ echo " (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir="$$new_top_distdir" distdir="$$new_distdir" \\"; \ echo " am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)"; \ ($(am__cd) $$subdir && \ $(MAKE) $(AM_MAKEFLAGS) \ top_distdir="$$new_top_distdir" \ distdir="$$new_distdir" \ am__remove_distdir=: \ am__skip_length_check=: \ am__skip_mode_fix=: \ distdir) \ || exit 1; \ fi; \ done check-am: all-am check: check-recursive all-am: Makefile $(DATA) installdirs: installdirs-recursive installdirs-am: for dir in "$(DESTDIR)$(pkgconfigdir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done install: install-recursive install-exec: install-exec-recursive install-data: install-data-recursive uninstall: uninstall-recursive install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-recursive install-strip: 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: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-recursive clean-am: clean-generic clean-libtool mostlyclean-am distclean: distclean-recursive -rm -f Makefile distclean-am: clean-am distclean-generic distclean-tags dvi: dvi-recursive dvi-am: html: html-recursive html-am: info: info-recursive info-am: install-data-am: install-pkgconfigDATA install-dvi: install-dvi-recursive install-dvi-am: install-exec-am: install-html: install-html-recursive install-html-am: install-info: install-info-recursive install-info-am: install-man: install-pdf: install-pdf-recursive install-pdf-am: install-ps: install-ps-recursive install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-recursive -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-recursive mostlyclean-am: mostlyclean-generic mostlyclean-libtool pdf: pdf-recursive pdf-am: ps: ps-recursive ps-am: uninstall-am: uninstall-pkgconfigDATA .MAKE: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) ctags-recursive \ install-am install-strip tags-recursive .PHONY: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) CTAGS GTAGS \ all all-am check check-am clean clean-generic clean-libtool \ ctags ctags-recursive distclean 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-pkgconfigDATA install-ps install-ps-am install-strip \ installcheck installcheck-am installdirs installdirs-am \ maintainer-clean maintainer-clean-generic mostlyclean \ mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ tags tags-recursive uninstall uninstall-am \ uninstall-pkgconfigDATA # 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: tango-8.1.2c+dfsg.orig/lib/cpp/tango.pc.in0000644000175000017500000000044312205375106017166 0ustar piccapiccaprefix=@prefix@ exec_prefix=@exec_prefix@ libdir=@libdir@ includedir=@includedir@ Name: tango Description: The tango constrol system library Requires: omniDynamic4 >= 4.1.2, omniCOS4, log4tango, libzmq Version: @VERSION@ Libs: -L${libdir} -ltango Cflags: @CPP_ELEVEN@ -I${includedir}/tango tango-8.1.2c+dfsg.orig/lib/cpp/log4tango/0000755000175000017500000000000012205375305017023 5ustar piccapiccatango-8.1.2c+dfsg.orig/lib/cpp/log4tango/NEWS0000644000175000017500000000005712205375130017520 0ustar piccapiccaSee 'Releases' section of HTML documentation. tango-8.1.2c+dfsg.orig/lib/cpp/log4tango/ChangeLog0000644000175000017500000012417412205375130020602 0ustar piccapiccaThis file describes the changes to the Log for C++ library. See the CVS repository for more detailed descriptions. 2002-10-29 Bastiaan Bakker * Release as 0.3.4b * include/log4cp/config-win32.h, src/PortabilityImpl.hh: added workarounds for abs() and strftime() and localtime() not being defined in std:: on MSVC6. See bug report #630334. 2002-10-28 Bastiaan Bakker * Release as 0.3.4. * tests/testPattern.cpp: added missing 'std::'. * src/StringUtil.hh, src/StringUtil.cpp: fixed signed-vs-unsigned comparison warning. Let both trim() implementations return unsigned int. 2002-10-27 Bastiaan Bakker * include/log4tango/OstringStream.hh, src/OstringStream.cpp: removed * src/StringUtil.hh, src/StringUtil.cpp: added vform() method. * PortabilityImpl.cpp: added. * include/log4tango/Appender.hh, include/log4tango/HierachyMaintainer.hh, include/log4tango/Log4cppCleanup.hh, src/Appender.cpp, src/HierrachyMaintainer.cpp, src/log4tangoCleanup.cpp: removed Log4cppCleanup, it was kinda broken anyway. * msvc6/log4tango/log4tango.dsp, msvc6/log4tangoDLL/log4tangoDLL.dsp, bcb5/log4tango/log4tango.bpf, bcb5/log4tango/log4tango.bpr, bcb5/log4tango/log4tango.mak: added BasicConfigurator. * src/PatternLayout.cpp: define static constant strings in TimeStampComponent outside class declaration. 2002-10-26 Bastiaan Bakker * Release as 0.3.3. * include/log4tango/config-win32.h, src/PortabilityImpl.hh, src/Makefile.am: worked around header definition bug in MSVC by aliasing cstdlib/cstring functions in 'std::'. See #628211. * src/NDC.cpp: added parentheses to return statement in _get() as suggested by Derrick Hastings to fix #415160. * include/log4tango/PattenLayout.hh, src/PatternLayout.cpp: added default conversion patterns. * msvc6/log4tangoDLL/Makefile.in: removed. 2002-10-19 Bastiaan Bakker * include/log4tango/PatternLayout.hh, src/PatternLayout.cpp: replaced PatternLayout implementation: it now preparses the message format for quicker layouting and implements format specifiers, e.g. '%-5p'. * tests/testPattern.cpp: added tests for format specifiers and more. 2002-10-10 Bastiaan Bakker * include/log4tango/threading/MSThreads.hh: added #include 2002-10-05 Bastiaan Bakker * log4tango.spec.in: don't require log4tango for log4tango-doc. * doc/Makefile.am: fix install location. * Makefile.am: use 'rpmbuild' instead of 'rpm'. 2002-10-05 Bastiaan Bakker * release as 0.3.2 * doc/html/index.html: added notes for 0.3.2 and 0.3.2rc5 * configure.in, msvc6/Makefile.am, msvc6/testDLL/Makefile.am, msvc6/testMain/Makefile.am, msvc6/testNTEventLog/Makefile.am, msvc6/testPattern/Makefile.am: added missing makefiles. 2002-09-26 Bastiaan Bakker * src/StringUtil.hh: fix compilation problem on Sun CC 5.3 (bug #614903). 2002-09-18 Bastiaan Bakker * src/RemoteSyslogAppender.cpp: fixed log facility in _append(), as reported by Derek Atkins. * src/PropertyConfiguratorImpl.cpp, src/SimpleConfigurator.cpp: multiply syslog facility value by 8. 2002-09-17 Bastiaan Bakker * log4tango.spec.in: fix relocatability of log4tango-devel by patching lib/liblog4tango.la and bin/log4tango-config in %post. Unfortunately this results in 'rpm --verify' reporting these files as modified. 2002-09-15 Bastiaan Bakker * release as 0.3.25rc5 * include/threading/DummyThreads.hh, include/threading/MSThreads.hh, include/threading/OmniThreads.hh, include/threading/Pthreads.hh, src/DummyThreads.cpp, src/MSThreads.cpp, src/OmniThreads.cpp, src/Pthreads.cpp: moved bodies of getThreadId() to .cpp files. * src/Makefile.am, msvc6/log4tango/log4tango.dsp, msvc6/log4tangoDLL/log4tangoDLL.dsp, bcb5/log4tango/log4tango.mak, bcb5/log4tango/log4tango.bpr, bcb5/log4tango/log4tango.bpf: added *Threads.cpp files * configure.in, include/log4tango/Appender.hh, include/log4tango/AppenderSkeleton.hh, m4/BB_CHECK_PTHREADS.m4, m4/PETI_PEDANTIC_GCC.m4, src/FileAppender.cpp, src/Level.cpp, src/Properties.cpp, src/PropertyConfiguratorImpl.hh, src/RemoteSyslogAppender.cpp,src/StringUtil.hh, tests/Clock.cpp, tests/Clock.hh, tests/testConfig.cpp, tests/testPropertyConfig.cpp, tests/testbench.cpp: Merged patch #605143, contributed by Harald Wellman: support for compilation in QNX Neutrino. 2002-09-05 Bastiaan Bakker * src/PropertyConfiguratorImpl.cpp, tests/testConfig.log4tango.properties: Merged patch #604991, contributed by Richard Brodie: support for setting additivity via properties file using 'log4j.addivity.=[true|false]'. 2002-08-16 Bastiaan Bakker * include/log4tango/threading/Makefile.am: added MSThreads.hh 2002-08-16 Bastiaan Bakker * Release as 0.3.2rc3 * src/SimpleConfigurator.cpp, src/PropertyConfiguratorImpl.cpp: put #ifdef WIN32 around #include of NTEventLogAppender and Win32DebugAppender. * include/log4tango/threading/PThreads.hh: use reinterpret_cast<>. * tests/testProperties.cpp: add std::. 2002-08-14 Bastiaan Bakker * Release as 0.3.2rc2 * Makefile.am, include/log4tango/Makefile.am, tests/Makefile.am: added distclean-local targets. * doc/Doxyfile.in: predefine 'WIN32' as suggested by David Resnick. * include/log4tango/NTEventLogAppender.hh, include/log4tango/Win32DebugAppender.hh: added warnings about platform dependency. 2002-08-13 David Resnick * include/log4tango/PatternLayout.hh: documentation fixes. 2002-08-09 Bastiaan Bakker * msvc6/log4tangoDLL/log4tangoDLL.rc: update version and product info. * include/log4tango/Portability.hh: added comments. * src/Category.cpp: added lock to getAllAppenders(). * doc/html/index.html: more documentation updates. * tests/testCategory.cpp, tests/testConfig.cpp, tests/testDLL.cpp, tests/testFilter.cpp, tests/testPropConfig.cpp, tests/testbench.cpp: Replaced #include "log4tango/X" with #include * tests/testProperties.cpp, tests/testPropertyConfig.cpp: added. * configure.in, doc/Makefile.am, doc/html/Makefile.am: added doc/html to automake. 2002-08-09 Bastiaan Bakker * include/log4tango/RollingFileAppender.hh: correct constness of constructor parameters, as pointed out by James Emery. 2002-08-06 Bastiaan Bakker * configure.ac, configure.in: renamed configure.ac back to configure.in due to bug in libtoolize 1.4.2 * NEWS, README, INSTALL, doc/html/index.html: converted most documentation to HTML. * m4/CREATE_GENERIC_CONFIG.m4: fix log4tango-config creation (use PACKAGE_TARNAME instead of PACKAGE). 2002-08-06 David Resnick * msvc6/log4tangoDLL/log4tangoDLL.rc: Cleanup. * msvc6/log4tangoDLL/resource.h deleted: Unnecessary. 2002-08-05 David Resnick * msvc6/log4tangoDLL/log4tangoDLL.rc, msvc6/log4tangoDLL/resource.h: Version property sheet added to DLL. 2002-08-04 David Resnick * src/PropertyConfiguratorImpl.cpp: added RollingFileAppender, NTEventLogAppender. Threshold attrib added for appenders. Invalid level in configureCategory prints message of invalid_argument exception. * src/Level.cpp: surrounding quotes added around invalid level in thrown invalid_argument exception. * tests/testPropConfig.cpp, tests/log4tango.property, msvc6\testPropConfig\testPropConfig.dsp: test for PropertyConfigurator added. 2002-08-02 Bastiaan Bakker * doc/Makefile.am, doc/Doxyfile.in, doc/html/index.html, doc/html/default.css: added new index page and move Doxygen generated docs to api subdirectory. 2002-08-01 Bastiaan Bakker * include/log4tango/threading/PThreads.hh: added POSIX threads support file contributed by Emiliano Martin. * include/log4tango/threading/Makefile.am, include/log4tango/threading/Threading.hh: add PThreads.hh * configure.ac: added test for POSIX threads * m4/BB_CHECK_PTHREADS.m4: added. Crude initial pthreads check. Need to nick a good macro somewhere else :-) * m4/BB_CHECK_OMNITHREADS.m4: added 'thread safity' defines, needed at least for STL. * THANKS: added Emiliano. 2002-07-30 Bastiaan Bakker * include/log4tango/TimeStatemp.hh: added some doxygen comments * m4/AC_CREATE_PREFIX_CONFIG_H.m4: removed a debug print statement. * src/PropertyConfgiruratorImpl.cpp: added 'append' property for FileAppender. * src/LoggingEvent.cpp: fill in the thread Id. 2002-07-22 Bastiaan Bakker * configure.in, configure.ac: renamed configure.in to configure.ac. * configure.ac, log4tango.spec.in, doc/Doxyfile.in, doc/Makefile.am, m4/AC_CREATE_PREFIX_CONFIG_H.m4, m4/AC_CXX_HAVE_SSTREAM.m4, m4/AC_CXX_NAMESPACES.m4, m4/BB_CHECK_OMNITHREADS.m4: updated AC macros and variables to autoconf 2.50. * src/Level.cpp: put names[] in anonymous namespace instead of declaring it static. This should solve Solaris 8 dynamic library problem (see patch #583905). 2002-07-11 Bastiaan Bakker * src/PatternLayout.cpp: use std::string::size_type instead of int. * src/PropertyConfiguratorImpl.cpp: use map.lower_bound() to determine begin and end for appender and logger properties. 2002-07-10 David Resnick * src/PatternLayout.cpp, include/log4tango/PatternLayout.hh, tests/testPattern.cpp, msvc6/testPattern/testPattern.dsp: added support for formatting date and testing that new support. * tests/testDLL.cpp, msvc6/testDLL/testDLL.dsp: added project that tests log4tango DLL (on win32 platform), including export of container object. * msvc6/log4tango/log4tango.dsp, msvc6/log4tangoDLL/log4tangoDLL.dsp: fixed so that PropertyConfigurator and attendant files are compiled in MSVC6. 2002-07-09 Bastiaan Bakker * src/StringUtil.hh, src/StringUtil.cpp: added a more generic split() method taking an output_iterator instead of a vector to store the result. * src/PropertyConfiguratorImpl.hh, src/PropertyConfiguratorImpl.cpp: renamed addAppenders() to configureCategory(). fixed configureCategory(): had a nested loop for priorities and appenders. replaced find(property, '.') with StringUtil::split() in several places. * src/PropertyConfiguratorImpl.cpp: fixed configureCategory() fix. 2002-07-05 Bastiaan Bakker * src/StringUtil.hh, src/StringUtil.cpp: added split() method. * src/PropertyConfiguratorImpl.hh, src/PropertyConfiguratorImpl.hh: changed the way configuration is done: first instantatiate all Appenders defined in the config, then add them to Categories where necessary. Multiple Appenders per Category are now supported. Currently doConfigure() leaks all Appenders, as they will be not be owned by any Categories. This will be fixed in the future by having the LoggerRepository maintain ownership of all Categories, Appenders, etc. 2002-07-04 Bastiaan Bakker * include/log4tango/BasicConfigurator.hh, src/BasicConfigurator.cpp: added. * src/Properties.hh, src/Properties.cpp: added Log4j style variable substitution: ${NAME} will be substituted with environment variable NAME or if not found with property NAME. '${${}' denotes a literal '${' sequence. 2002-07-03 Bastiaan Bakker * src/SyslogAppender.cpp (SysLogAppender()): accept '-1' for facility and portNumber, implying the 'default value'. * src/ConfiguratorSkeleton.cpp: changed property names to JavaBeans/log4j style. Use the appender name as name (duh) instead of the 'name' property. Don't set a layout if none have been specified. Use std::string::size_type where applicable. Made some exception messages clearer. Compacted the code a bit. * src/Properties.hh, src/Properties.cpp: added, moved PropertyConfigurator::parseConfig() to load(). * src/PropertyConfiguratorImpl.hh, src/PropertyConfiguratorImpl.cpp: added. This class is a merge of PropertyConfigurator and ConfiguratorSkeleton. ConfiguratorSkeleton is not generic enough to be exposed in the API. * include/log4tango/PropertyConfigurator.hh, src/PropertyConfigurator.cpp: leave only 2 static configure() methods, like SimpleConfigurator. The actual implementation is now in PropertyConfiguratorImpl. * include/log4tango/ConfiguratorSkeleton.hh, src/ConfiguratorSkeleton.cpp: removed. * src/StringUtil.hh, src/StringUtil.cpp: added, contains ConfiguratorSkeleton::trim(). * src/RollingFileAppender.cpp: fix signed/unsigned comparison warning. * m4/PETI_PEDANTIC_GCC.m4: remove -pedantic flag for g++ 2.96 to get rid of those iritating warnings about std IOstreams code. * src/TimeStamp.cpp: replaced #include with . * src/PropertyConfiguratorImpl.cpp: use getString(), etc. to get properties. * include/log4tango/Category.hh, include/log4tango/FixedContextCategory.hh, include/log4tango/CategoryStream.hh: fixed documentation buglets. 2002-07-02 Bastiaan Bakker * include/log4tango/HierarchyMaintainer.hh, include/log4tango/Category.hh, src/HierarchyMaintainer.cpp, src/Category.cpp: Changed return type of getCurrentCategories() to std:vector. vector<> is more efficient than set<> and works around MSVC++ DLL export brain damage, see Microsoft Q168958. * include/log4tango/Configurator.hh, include/log4tango/ConfiguratorSkeleton.hh, include/log4tango/SimpleConfigurator.hh, include/log4tango/PropertyConfigurator.hh, src/Configurator.cpp, src/ConfiguratorSkeleton.cpp, src/SimpleConfigurator.cpp, src/PropertyConfigurator.cpp: integrated PropertyConfigurator contributed by Alan Anderson . * msvc6/log4tango/log4tango.dsp, bcb5/log4tango/log4tango.bpf, bcb5/log4tango/log4tango.bpr, bcb5/log4tango/log4tango.mak: added PropertyConfigurator files. 2002-06-19 Bastiaan Bakker * src/Makefile.am: added NTEventlog.cpp and DllMain.cpp to sources. * src/DllMan.cpp: enclosed in #ifdef LOG4TANGO_SUPPLY_DLLMAIN * include/log4tango/config-win32.h: #define LOG4TANGO_SUPPLY_DLLMAIN * include/log4tango/Makefile.am: added NTEventLog.hh * msvc6/Makefile.am: added NTEventLogCategories. 2002-06-18 Bastiaan Bakker * src/NDC.cpp: fix top level context falling off, if depth > 2. (reported by Hong Yang ) * tests/testNDC.cpp: push 3 contexts to test for bug above. 2002-06-17 Aaron Ingram * Fixed default port for syslog in SimpleConfigurator.cpp * Added a sample configuration file: log4tango.cfg 2002-06-17 David Resnick * Merge of MS Threads & DLL Build support patch by Aaron Ingram with these changes: * src/main.cpp renamed to src/DllMain.cpp * Run-time library used for log4tangoDLL changed to Multithreaded DLL (fixed need for #pragma warning(disable:4275)) * pragma directives moved from various headers to include/log4tango/Portability.hh. * include/log4tango/threading/MSThreads.hh: reset(): TlsSetValue uses parameter value instead of deleted one. * include/log4tango/NTEventLogAppender.hh, src/NTEventLogAppender.cpp, msvc/NTEventLogAppender.mc, tests/testNTEventLog.cpp: added NTEventLogAppender. * msvc/testMain/testMain.dsp, msvc/testNTEventLog/testNTEventLog.dsp added. 2002-06-03 Cedric Le Goater * Makefile.am: added log4tango.m4 installation * log4tango.m4: added aclocal support * tests/Clock.cpp: fixed rdtscl() support on linux 2002-05-22 Bastiaan Bakker * include/log4tango/config-win32.h: fix compilation in Visual .NET. 2002-05-12 Bastiaan Bakker * src/RollingFileAppender.cpp: explicitly remove oldest file in rollOver() because win98 cannot rename() to existing files. (Paulo Pizarro) * Makefile.am: convert *.bpg files to CRLF in dist.(Paulo Pizarro) * bcb5/log4tango/log4tango.bpf, bcb5/log4tango/log4tango.bpr, bcb5/log4tango/log4tango.mak, include/log4tango/Makefile.am, msvc6/log4tango/log4tango.dsp, src/Makefile.am, include/log4tango/Win32DebugAppender.hh, src/Win32DebugAppender.cpp: added Win32DebugAppender contributed by Alan Anderson. 2002-04-21 Bastiaan Bakker * include/log4tango/config-win32.h: added mode_t typedef. * m4/AC_C_INT64_T.m4: added #define of HAVE_STDINT_H. * src/PatternLaout.cpp: #include only if available. 2002-04-09 Bastiaan Bakker * tests/Clock.cpp: test for i386 architecture on linux (patch #541608) 2002-04-04 Bastiaan Bakker * Release as 0.3.1 * src/Category.cpp: fix previous fix for bug #527467. * m4/PETI_PEDANTIC_GCC.m4: add -Wno-unused to g++ options. * configure.in: increment version to 0.3.1. * msvc6/log4tango/log4tango.dsp: Added RollingFileAppender and threading files. * bcb5/log4tango/log4tango.bpf, bcb5/log4tango/log4tango.bpr, bcb5/log4tango/log4tango.mak: Added RollingFileAppender 2002-03-31 Bastiaan Bakker * include/log4tango/Portability.hh: Disable exception specifier warnings (issue #536668) 2002-03-27 Bastiaan Bakker * m4/AC_C_INT64_T.m4: #include and remove $GCC check. * src/PatternLayout.cpp: #include * configure.in, include/log4tango/Portability.hh: back out strcasecmp() stuff. 2002-03-22 Bastiaan Bakker * include/log4tango/FileAppender.hh, src/FileAppender.cpp: added 'append' and 'mode' options. * include/log4tango/RollingFileAppender.hh, include/log4tango/Makefile.am, src/RollingFileAppender.cpp, src/SimpleConfigurator.cpp, src/Makefile.am: added RollingFileAppender contributed by Paulo Pizarro 2002-03-20 Bastiaan Bakker * include/log4tango/SimpleConfigurator.hh, src/SimpleConfigurator.cpp: added configure(std::istream&) method. (feature request #527760) * src/Log4cppCleanup.cpp: set variable to NULL after delete. (feature request #527393) * include/log4cp/Category.hh, include/log4tango/FixedContextCategory.hh, src/Category.hh, src/Category.cpp: added getAllAppenders() method. (feature request #527381) * src/Category.cpp: removeAllAppenders(): fix invalidated iterator usage. (bug #527467) 2002-03-17 Bastiaan Bakker * tests/testbench.cpp: added missing 'std::' specifiers. (bug #530332) * src/SyslogAppender.cpp: fix format string bug. (bug #527475) 2002-02-18 Bastiaan Bakker * Release as 0.3.0 * INSTALL: added some platform specific build instructions. * tests/Clock.hh: replaced "long long" with int64_t. * src/OstringStream.cpp: fix typo. * src/Appender.cpp: added missing Mutex. * include/log4tango/threading/OmniThreads.hh: added Doxygen comments. * NEWS: release 0.3.0. * configure.in: upped release to 0.3.0 and LT version to 4.0.0 2002-02-11 Bastiaan Bakker * configure.in: integrated check of omnithreads. * m4/BB_CHECK_OMNITHREADS.m4: added * include/log4tango/threading/DummyThreads.hh: scoped lock is now an integer. * include/log4tango/Category.hh, include/log4tango/FixedContextCategory.hh, include/log4tango/HierarchyMaintainer.hh, include/log4tango/NDC.hh, src/Category.cpp, src/FixedContextCategory.cpp, src/HierarchyMaintainer.cpp, src/NDC.cpp: added threadsafety provisions. * include/log4tango/*.hh: replaced #include"" with #include<> * src/*.cpp: replaced #include"" with #include<> * include/log4tango/Appender.hh, src/Appender.cpp: added Mutex for _allAppender map. 2002-02-08 Bastiaan Bakker * include/log4tango/threading/Threading.hh, include/log4tango/threading/OmniThreads.hh, include/log4tango/threading/DummyThreads.hh, include/log4tango/threading/BoostThreads.hh, include/log4tango/threading/Makefile.am: added 2002-02-05 Bastiaan Bakker * src/AppenderSkeleton.cpp: doAppend(): correct comparison of _threshold against event level (bug #513481). * tests/Clock.cpp: add missing 'std::'. 2002-01-27 Bastiaan Bakker * Release as 0.2.7 * configure.in: upped version to 0.2.7. * testbench.cpp: added more measurements, using crude cut&paste of code. * NEWS: set release date for 0.2.7, added bug #506907 fixed. * bcb5/testPattern/Makefile.am: set EXTRA_DIST. 2002-01-25 Bastiaan Bakker * configure.in: added bcb5/testConfig/Makefile to AC_OUTPUT * include/log4tango/FixedContextCategory.hh: removed superfluous class qualification for ownsAppender(). 2002-01-25 Uwe Jäger * src/SimpleConfigurator.cpp: Replaced STDOUT_FILENO and STDERR_FILENO with fileno(stdout) and fileno(stderr) which seems to be more portable. * tests/testConfig.cpp: Replace ?-:-operator with if/else because of compiler problems; retabbed file. * bcb5/Makefile.am, bcb5/bcb5.bpg, bcb5/bcb5.mak: Added testConfig * bcb5/log4tango/log4tango.bpf, bcb5/log4tango/log4tango.bpr, bcb5/log4tango/log4tango.mak: Added new files. * bcb5/testConfig/Makefile.am, bcb5/testConfig/testConfig.bpf, bcb5/testConfig/testConfig.bpr, bcb5/testConfig/testConfig.mak: Added testConfig. * bcb5/testCategory/testCategory.bpr, bcb5/testFixedContextCategory/testFixedContextCategory.bpr, bcb5/testNDC/testNDC.bpr, bcb5/testPattern/testPattern.bpr bcb5/testPattern/testPattern.mak, bcb5/testmain/testmain.bpr: Adjusted makefiles/project files for BCB. 2002-01-23 Bastiaan Bakker * src/SimpleConfigurator.cpp: try to fix bug #506907 (MSVC++ compile failure) with ::dup(fileno(stdout)) * configure.in: upped version to 0.2.7rc2 2002-01-21 Bastiaan Bakker * src/Category.cpp: fix ownsAppender() methods. * tests/testCategory.cpp: rename appender 'default' to 'default2'. * configure.in: upped version to 0.2.7rc1 and LT_VERSION to 3:1:2 * src/SimpleConfigurator.cpp, tests/testFixedContextCategory.cpp, tests/testPattern.cpp, tests/testbench.cpp, tests/testmain.cpp: replaced setAppender() with addAppender(). * include/log4tango/Category.hh: update doxygen comments. * include/log4tango/FixedContextCategory.hh, src/FixedContextCategory.cpp: sync methods for multiple Appender support. * NEWS: added summary for 0.2.7 release 2002-01-20 Bastiaan Bakker * include/log4tango/Category.hh, src/Category.cpp, tests/testCategory.cpp: merged in support for multiple Appenders, contributed by Brendan B. Boerner. * THANKS: Added Brendan. 2002-01-17 Bastiaan Bakker * include/log4tango/HierarchyMaintainer.hh, src/HierarchyMaintainer.cpp: added getExistingInstance(std::string). * include/log4tango/Category.hh, src/Category.cpp: added exists(std::string). * include/log4tango/RollingFileAppender.hh, include/log4tango/Makefile.am, src/RollingFileAppender.cpp, src/MakeFile.am: removed RollingFileAppender, to be replaced with DailyRollingFileAppender. 2002-01-16 Bastiaan Bakker * include/log4tango/Category.hh, src/Category.cpp: fix bug #504314: added missing log methods for level 'fatal'. * src/SimpleConfigurator.cpp: added 'stdout' and 'stderr' appenders. 2002-01-10 Bastiaan Bakker * configure.in: added check for strcasecmp() and stricmp(). * include/log4tango/config-win32.h: have stricmp() but not strcasecmp(). * include/log4tango/Portability.hh: use stricmp() if strcasecmp() is not available. * include/log4tango/RemoteSyslogAppender.hh: added SyslogFacility type. 2002-01-09 Bastiaan Bakker * src/SimpleConfigurator.cpp: skip all whitespace before PatternLayout pattern, not just one. * include/log4tango/RollingFileAppender.cpp, include/log4tango/Makefile.am, src/RollingFileAppender.cpp, src/MakeFile.am: added RollingFileAppender contributed by Alex Tapaccos. 2002-01-08 Bastiaan Bakker * src/SimpleConfigurator.cpp: skip space before PatternLayout pattern (Bug #500766). * src/SimpleConfigurator.cpp: fix screwy fix for Bug #500766, now using Alex' method. (Obsoletes Patch #500832). 2002-01-04 Bastiaan Bakker * include/log4tango/config-openvms.h: #include for int64_t. * src/PatternLayout.cpp(doFormat): removed superfluous return statement. * include/log4tango/config-win32.h: fix int64_t for Borland compiler. * include/log4tango/SyslogAppender.hh, include/log4tango/RemoteSyslogAppender.hh, src/SyslogAppender.cpp, src/RemoteSyslogAppender.cpp: inherit from LayoutApppender instead of AppenderSkeleton (Bug #499524). 2002-01-03 Bastiaan Bakker * include/log4tango/Filter.hh: decide() is NOT abstract. * tests/testFilter.cpp: added * tests/Makefile.am: added testFilter.cpp to tests. 2001-12-21 Bastiaan Bakker * Release as 0.2.6b * configure.in: upped release to 0.2.6b * src/Level.cpp: getLevelValue(): fix bug in numerical input handling. * tests/Makefile.am: added very simple test for Level. * tests/testLevel.cpp: added. 2001-12-13 Bastiaan Bakker * src/OstringStream.cpp: use portable_vsnprintf(), not portable_snprintf(). 2001-12-11 Bastiaan Bakker * Release as 0.2.6 * TODO: Mark PatternLayout and SimpleConfigurator as done. * NEWS: release 0.2.6 * Makefile.am: exclude CVS subdir from doc-dist tar ball. * include/log4tango/config-win32.h: #define int64_t as __int64, #define LOG4TANGO_MISSING_INT64_OSTREAM_OP * src/PatternLatout.cpp: workaround missing << operator for int64_t on MSVC. * src/TimeStamp.cpp: fix ref typo for timeb struct. * include/log4tango/config-win32.h: #define LOG4TANGO_USE_CLEANUP. 2001-11-30 Bastiaan Bakker * tests/testbench.cpp: use TimeStamp instead of ::time() * include/log4tango/Makefile.am: added config-openvms.h to headers. * include/log4tango/Appender.hh, include/log4tango/HierarchyMaintainer.hh, include/log4tango/Log4cpCleanup.hh, src/Appender.cpp, src/HierarchyMaintainer.cpp, src/Log4cppCleanup.cpp: conditionally use Log4cppCleanup, depending on #define LOG4TANGO_USE_CLEANUP. The new default is NOT to use it, because it causes segfaults on some platforms (e.g. Solaris). 2001-11-29 Bastiaan Bakker * include/log4tango/Portability.hh: use config-openvms.h based on __OPENVMS__ flag. * src/snprintf.c: replaced static_cast with C-style cast: this file should remain C only. * configure.in, Makefile.am: added openvms subdirectory. * openvms/Makefile.am: added empty Makefile template. * THANKS: added Tony Cheung. * src/Makefile.am: added snprintf.c to noinst_HEADERS. * include/log4tango/TimeStamp.hh: moved class description to the correct location. 2001-11-28 Bastiaan Bakker * src/snprintf.c: added portable snprintf 2.2 from http://www.ijs.si/software/snprintf/ * src/OstringStream.cpp: replace alternative snprintf with one in snprintf.c. * src/snprintf.c: add static cast from void* to const char*. * include/log4tango/config-openvms.h: added. 2001-11-26 Bastiaan Bakker * include/log4tango/TimeStamp.hh, include/log4tango/Makefile.am, src/TimeStamp.cpp, src/Makefile.am: added micro second precise time stamp. * configure.in: added test for 'ftime()' function. * include/log4tango/LoggingEvent.hh, include/log4tango/PatternLayout.hh, src/LoggingEvent.cpp, src/BasicLayout.cpp, src/PatternLayout.cpp: Use new TimeStamp class. * tests/testPattern.cpp: included '%r' in test pattern. * src/SimpleConfigurator.cpp: added support for RemoteSyslogAppender. * bcb5/log4tango/log4tango.bpr, bcb5/log4tango/log4tango.bpf: Added TimeStamp class. * msvc6/log4tango/log4tango.dsp: Added TimeStamp, PatternLayout and SimpleConfigurator classes. * include/log4tango/RemoteSyslogAppender.hh: replaced #defines with enum. * include/log4tango/config-win32.h: sync with #defines in include/log4tango/config.h. * tests/Makefile.am: made log4tango.init check_DATA. * tests/testConfig.cpp: read $srcdir for location of log4tango.init in order to fix distcheck target. 2001-11-23 Bastiaan Bakker * tests/testConfig.cpp, tests/log4tango.init: added test for SimpleConfigurator. * include/log4tango/Makefile.am, src/Makefile.am, tests/Makefile.am: integrated SimpleConfigurator in autoconf. * src/SimpleConfigurator.cpp: added support for comments in config file (starting with a '#'). added support for SyslogAppender. use Level::getLevelValue() to convert priorities. 2001-11-09 Bastiaan Bakker * m4/CREATE_GENERIC_CONFIG.m4: escape $* * tests/testFixedContextCategory.cpp: Use contructor for FixedContextCategory instead of assignment. 2001-11-05 Bastiaan Bakker * m4/CREATE_GENERIC_CONFIG.m4: fix /bin/sh incompatibility on Solaris. * include/log4tango/Category.hh: Added private copy constructor and assignment operator (pointed out by Shane Baker). 2001-11-01 Bastiaan Bakker * src/Category.cpp: in setAppender(Appender*) allow NULL Appender. * include/log4tango/Category.hh: in setAppender(Appender*) document allowing NULL Appender parameter. 2001-10-24 Bastiaan Bakker * configure.in: Added bcb5/testPattern/Makefile to AC_OUTPUT. * include/log4tango/Level.hh, src/Level.cpp: Added getLevelValue() method. * src/PatternLatout.cpp: Added support for sstream predating c++ stream libraries. 2001-10-05 Uwe Jäger * bcb5/Makefile.am, bcb5/bcb5.bpg, bcb5/bcb5.mak: Added testPattern. * bcb5/log4tango/log4tango.bpf, bcb5/log4tango/log4tango.mak: Added PatternLayout and SimpleConfigurator. * bcb5/testPattern/testPattern.bpf, bcb5/testPattern/testPattern.bpr, bcb5/testPattern/testPattern.mak: Added project file and makefile for pattern test. * include/log4tango/config-win32.h: Added support for PatternLayout. * include/log4tango/SimpleConfigurator.hh, src/SimpleConfigurator.cpp: Make it compile with Borland C++. * src/PatternLayout.cpp, src/RemoteSyslogAppender.cpp, tests/testPattern.cpp: Port to Borland C++. 2001-10-04 Bastiaan Bakker * src/SimpleConfigurator.cpp, include/log4tango/SimpleConfigurator.hh: Added simple configurator class contributed by Glenn Scott. Not usable yet. * src/Level.cpp: fix conversion from LevelLevel to LevelName. * include/log4tango/Makefile.am, src/Makefile.am, tests/Makefile.am: Added PatternLayout files * configure.in, Makefile.am, m4/C_C_INT64_T: Added check for int64_t. * configure.in: Added check for gettimeofday. * src/PatternLayout.cpp: use LOG4TANGO_HAVE_TIMEOFDAY and LOG4TANGO_HAVE_INT64_T * include/log4tango/LoggingEvent.hh: made strings real member variables. 2001-09-18 Bastiaan Bakker * include/log4tango/PatternLayout.hh, src/PatternLayout.cpp, tests/testPattern.cpp: Added PatternLayout contributed by Glenn Scott. Is not in autoconf setup yet. 2001-09-17 Bastiaan Bakker * configure.in: Added checks for -lsocket and -lnsl * m4/AC_FUNC_SNPRINTF.m4: Relax snprintf() check: full C99 compliancy is not needed. * include/log4tango/Level.hh: Fix workaround for #define DEBUG * config/Makefile.am: Added newline to keep broken tar utilities happy * include/log4tango/FixedContextCategory.hh: Added default value for context parameter in constructor. * include/log4tango/LayoutAppender.hh: Made BasicLayout the DefaultLayoutType * configure.in: Set requirement for Autoconf 2.50 Bumped version to 0.2.6 Incremented LT_VERSION to 2:0:1 * Makefile.am: Fix EXTRA_DIST m4 inclusion. * bcb5/log4tango/log4tango.bpf, bcb5/log4tango/log4tango.bpr, bcb5/log4tango/log4tango.mak: Added RemoteSyslogAppender. 2001-08-23 Bastiaan Bakker * include/log4tango/Level.hh: Added workaround for #define DEBUG in EDK.h on Win32. 2001-07-17 Walter Stroebel * include/log4tango/RemoteSyslogAppender.hh, src/RemoteSyslogAppender: Added. 2001-07-16 Uwe Jäger * bcb5/log4tango.bpf, bcb5/log4tango.bpr: Adjusted project files to compile CategoryStream.cpp. * bcb5/bcb5.mak, bcb5/log4tango/log4tango.mak, bcb5/log4tango/testCategory/testCategory.mak, bcb5/log4tango/testFixedContextCategory/testFixedContextCategory.mak, bcb5/log4tango/testmain/testmain.mak, bcb5/log4tango/testNDC/testNDC.mak: Added makefiles for Borland make to build without IDE. 2001-06-17 Bastiaan Bakker * include/log4tango/Category.hh, include/log4tango/CategoryStream.hh, include/log4tango/Makefile.am, src/Category.cpp, src/CategoryStream.cpp, src/Makefile.am: Put CategoryStream class into its own files. 2001-06-11 Bastiaan Bakker * m4/AC_CREATE_PREFIX_CONFIG_H.m4: fix to overwrite include/log4tango/config.h instead of append to it. * include/log4tango/Makefile.am: remove config.h from dist. 2001-06-11 Bastiaan Bakker * Release as 0.2.5 * NEWS: inclusion of Borland C++ Builder support. * Makefile.am: only include *.m4 files in m4/ in dist. * Makefile.am: fix typos in debian and doc-dir targets. 2001-06-07 Bastiaan Bakker * include/log4tango/LayoutAppender.hh: set SimpleLayout as DefaultLayoutType. * src/LayoutAppender.cpp (LayoutAppender, setLayout): use DefaultLayoutType to construct new Layouts. * src/LayoutAppender.cpp (setLayout): check whether old Layout and new Layout are the same object. * src/Category.cpp (setAppender): check whether old and new Appender are the same object. * src/Filter.cpp (setChainedFilter): check whether old and new Filter are the same object. * include/log4tango/Config.hh, include/log4tango/Portability.hh, include/log4tango/OstringStream.hh, include/log4tango/Makefile.am, src/Appender.cpp, src/AppenderSkeleton.cpp, src/BasicLayout.cpp, src/Category.cpp, src/FileAppender.cpp, src/Filter.cpp, src/FixedContextCategory.cpp, src/HierarchyMaintainer.cpp, src/IdsaAppender.cpp, src/LayoutAppender.cpp, src/Log4cppCleanup.cpp, src/LoggingEvent.cpp, src/Log4cppCleanup.cpp, src/LoggingEvent.cpp, src/NDC.cpp, src/OstreamAppender.cpp, src/OstringStream.cpp, src/Level.cpp, src/SimpleLayout.cpp, src/StringQueueAppender.cpp, src/SyslogAppender.cpp, msvc6/log4tango/log4tango.dsp, tests/testmain.cpp: renamed Config.hh to Portability.hh * m4/AC_AS_DIRNAME.m4, m4/AC_AS_MKDIR_P.m4, m4/AC_ECHO_MKFILE.m4: removed * m4/AC_CREATE_PREFIX_CONFIG_H.m4: replaced AC_ECHO_MKFILE with AS_DIRNAME. This means autoconf >= 2.4 required. * configure.in, include/log4tango/config-win32.h: upped version number to 0.2.5. * configure.in: upped LT_VERSION to 1:0:0. 2001-06-06 Bastiaan Bakker * include/log4tango/AppenderSkeleton.hh, include/log4tango/BasicLayout.hh, include/log4tango/HierarchyMaintainer.hh, include/log4tango/IdsaAppender.hh, include/log4tango/Log4cppCleanup.hh, include/log4tango/LoggingEvent.hh, include/log4tango/OstreamAppender.hh, include/log4tango/OstringStream.hh, include/log4tango/Level.hh, include/log4tango/SimpleLayout.hh, include/log4tango/SyslogAppender.hh: Documentation updates. 2001-06-06 Uwe Jäger * include/log4tango/config-win32.h: LOG4TANGO_HAVE_SNPRINTF, WIN32, LOG4TANGO_FIX_ERROR_COLLISION are defined for win32 * tests/testmain.cpp: added #ifdef's to make it compile with Borland C++ Builder 2001-06-05 Bastiaan Bakker * include/log4tango/Config.hh, include/log4tango/config-win32.h: Added * include/log4tango/Makefile.am: added Export.hh and config-win32.h to liblog4tangoinclude_HEADERS. * include/log4tango/Config-win32.hh: removed 2001-06-04 Bastiaan Bakker * Makefile.am: removed config.h copy from dist-hook * m4/AC_CREATE_GENERIC_CONFIG.m4: added * log4tango-config.in: removed (obsoleted by AC_CREATE_GENERIC_CONFIG) * Configure.in: added AC_CREATE_GENERIC_CONFIG, removed log4tango-config from AC_OUTPUT 2001-06-03 Bastiaan Bakker * configure.in: added AC_CREATE_PREFIX_CONFIG_H for creation of include/log4tango/config.h (which has been removed from AM_CONFIG_HEADER) * Config.hh.in: removed * Config.hh: copied from Config.hh.in. include and remove LOG4TANGO_* defines. * include/log4tango/Makefile.am: added config.h, removed Config.hh.in * Appender.cpp, AppenderSkeleton.cpp, BasicLayout.cpp, Category.cpp, FileAppender.cpp, Filter.cpp, FixedContextCategory.cpp, HierarchyMaintainer.cpp, IdsaAppender.cpp, LayoutAppender.cpp, Log4cppCleanup.cpp, LoggingEvent.cpp, NDC.cpp, OstreamAppender.cpp, OstringStream.cpp, Level.cpp, SimpleLayout.cpp, StringQueueAppender.cpp,SyslogAppender.cpp: added inclusion of , prefixed autoconf #ifdefs with LOG4TANGO_ * AC_AS_DIRNAME.m4, AC_AS_MKDIR_P.m4, AC_CREATE_PREFIX_CONFIG_H.m4, AC_ECHO_MKFILE.m4: added 2001-06-01 Bastiaan Bakker * Level.hh: #define ERROR workaround try 3, put fix inside LOG4TANGO_FIX_ERROR_COLLISION switch. * tests/testErrorCollision.cpp, tests/Makefile.am: added test for #define ERROR workaround. 2001-05-29 Bastiaan Bakker * Level.hh: #define ERROR workaround try 2. * Merge of Borland support patch by Uwe Jäger . 2001-05-28 Bastiaan Bakker * Level.hh: included workaround for #define ERROR rudeness in windows.h on Win32. 2001-05-23 Bastiaan Bakker * log4tango.spec.in: run ldconfig after install or uninstall. Upped release# to 3. * Makefile.am: in rpm target corrected top_srcdir variable name. 2001-05-19 Bastiaan Bakker * Fixed distcheck target. * Fixed check target. It runs testNDC, testCategory and testFixedContextCategory as tests. * Added subdir m4 with (common) autoconf macros. * Started adding throw() specifiers to methods. 2001-04-21 Bastiaan Bakker Rereleased as 0.2.4b MSVC++: Stripped '\r' characters from .dsp and .dsw files. MSVC++: Added StringQueueAppender and FixedContextCategory to log4tango.dsp. 2001-04-20 Steve Ostlind MSVC++: build log4tango library with multithreaded DLL. 2001-04-19 Bastiaan Bakker Now also added the files in debian and msvc6 to EXTRA_DIST, so they finally get into the dist tar ball. Sigh. 2001-04-18 Bastiaan Bakker Released as 0.2.4 Added debian and msvc6 subdirs to autoconf configuration: they were missing from the dist target. 2001-04-17 Bastiaan Bakker Made Category subclassable. Added FixedContextCategory class. 2001-04-12 Bastiaan Bakker Merged Marcel Harkema's patch for Debian package support. 2001-04-11 Bastiaan Bakker Added StringQueueAppender class. Separated API docs from devel RPM, into a doc RPM. 2001-04-10 Bastiaan Bakker Rerelease as 0.2.3b Fixed bugs: #415056 Win32: log4tango project file broken #415059 Win32: problem with 'using namespace std' 2001-04-09 Bastiaan Bakker Release 0.2.3 Fixed and resolved Bugs: #411711 missing Clock.hh #411902 invalid AppenderMap iterator #412008 memory leak in OstringStream::str() #412232 _append problem #414958 printf style logging kaputt 2001-04-06 Bastiaan Bakker Added class Filter, with which Appenders can filter out LoggingEvents Added class AppenderSkeleton, base class for Appender implementations Modified the Layout interface: it now returns a std::string instead of a char*. 2001-03-?? Cedric Le Goater Cleanup of Hints and StreamUtil to OstringStream. 2001-03-11 Bastiaan Bakker Added LayoutAppender. Changed Layout ownership for Appenders: they now own their Appender. 2001-03-07 Bastiaan Bakker Moved to new iostreams. 2001-03-04 Bastiaan Bakker Release 0.2.2 Added doc-dist make target Added testCategory to tests 2001-02-25 Bastiaan Bakker Merged in Win32 / MSVC++6.0 support patches from Lynn Owen 2001-02-15 Bastiaan Bakker Release 0.2.1 Changed license to the GNU Lesser General Public License (LGPL). 2001-01-25 Cedric Le Goater Added EMER, ALERT, CRIT and NOTICE shortcuts methods to Category. 2000-12-22 Bastiaan Bakker Merged more patches from Cedric Le Goater, including an RPMS spec file and a testbench. 2000-12-18 Bastiaan Bakker Added IdsaAppender contributed by Marc Welz. Merged Tru64 support patches from Cedric Le Goater. 2000-12-10 Bastiaan Bakker Release 0.2.0 Integrated autoconf setup contributed by Cedric Le Goater. Fixed compilation problem in NDC on platforms with g++-2 library (instead of g++-3). (Reported by Louis Bayle .) Added CategoryStream. 2000-12-07 Bastiaan Bakker Release 0.1 Added Doxygen generated API documentation. Most of it has been copied verbatim from LOG4J. Added NDC (Nested Diagnostic Context) class. Added OstreamAppender. Added SyslogAppender. Fixed bug in HierarchyMaintainer: getInstance should NOT set the Appender of a newly instantiated Category. 2000-12-03 Bastiaan Bakker Release 0.0 First CVS import at SourceForge. tango-8.1.2c+dfsg.orig/lib/cpp/log4tango/AUTHORS0000644000175000017500000000005612205375130020070 0ustar piccapiccaBastiaan Bakker tango-8.1.2c+dfsg.orig/lib/cpp/log4tango/include/0000755000175000017500000000000012205375305020446 5ustar piccapiccatango-8.1.2c+dfsg.orig/lib/cpp/log4tango/include/config.h.in0000644000175000017500000000446412205375130022475 0ustar piccapicca/* include/config.h.in. Generated from configure.in by autoheader. */ /* Define to 1 if you have the header file. */ #undef HAVE_DLFCN_H /* Define to 1 if you have the `ftime' function. */ #undef HAVE_FTIME /* Define to 1 if you have the `gettimeofday' function. */ #undef HAVE_GETTIMEOFDAY /* define if the compiler has int64_t */ #undef HAVE_INT64_T /* Define to 1 if you have the header file. */ #undef HAVE_INTTYPES_H /* Define to 1 if you have the header file. */ #undef HAVE_IO_H /* Define to 1 if you have the header file. */ #undef HAVE_MEMORY_H /* define if the compiler implements namespaces */ #undef HAVE_NAMESPACES /* define if the C library has snprintf */ #undef HAVE_SNPRINTF /* define if the compiler has stringstream */ #undef HAVE_SSTREAM /* define if you have the header file. */ #undef HAVE_STDINT_H /* Define to 1 if you have the header file. */ #undef HAVE_STDLIB_H /* Define to 1 if you have the header file. */ #undef HAVE_STRINGS_H /* Define to 1 if you have the header file. */ #undef HAVE_STRING_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_STAT_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_TYPES_H /* define if threading is enabled */ #undef HAVE_THREADING /* Define to 1 if you have the header file. */ #undef HAVE_UNISTD_H /* Define to the sub-directory in which libtool stores uninstalled libraries. */ #undef LT_OBJDIR /* Name of package */ #undef PACKAGE /* Define to the address where bug reports for this package should be sent. */ #undef PACKAGE_BUGREPORT /* Define to the full name of this package. */ #undef PACKAGE_NAME /* Define to the full name and version of this package. */ #undef PACKAGE_STRING /* Define to the one symbol short name of this package. */ #undef PACKAGE_TARNAME /* Define to the home page for this package. */ #undef PACKAGE_URL /* Define to the version of this package. */ #undef PACKAGE_VERSION /* Define to 1 if you have the ANSI C header files. */ #undef STDC_HEADERS /* define if pthread library is available */ #undef USE_PTHREADS /* Version number of package */ #undef VERSION /* If we're running on darwin/MacOsX */ #undef __darwin__ /* If we're running on FreeBSD */ #undef __freebsd__ tango-8.1.2c+dfsg.orig/lib/cpp/log4tango/include/Makefile.in0000644000175000017500000004366112205375130022521 0ustar piccapicca# Makefile.in generated by automake 1.11.3 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 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. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ subdir = include DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in \ $(srcdir)/config.h.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/AC_CREATE_PREFIX_CONFIG_H.m4 \ $(top_srcdir)/m4/AC_CXX_HAVE_SSTREAM.m4 \ $(top_srcdir)/m4/AC_CXX_NAMESPACES.m4 \ $(top_srcdir)/m4/AC_C_INT64_T.m4 \ $(top_srcdir)/m4/AC_FUNC_SNPRINTF.m4 \ $(top_srcdir)/m4/BB_CHECK_PTHREADS.m4 \ $(top_srcdir)/m4/BB_ENABLE_DOXYGEN.m4 \ $(top_srcdir)/m4/CREATE_GENERIC_CONFIG.m4 \ $(top_srcdir)/m4/PETI_PEDANTIC_GCC.m4 \ $(top_srcdir)/m4/RSSH_CHECK_SUNPRO_CC.m4 \ $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/configure.in am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(SHELL) $(top_srcdir)/config/mkinstalldirs CONFIG_HEADER = config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = SOURCES = DIST_SOURCES = RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \ html-recursive info-recursive install-data-recursive \ install-dvi-recursive install-exec-recursive \ install-html-recursive install-info-recursive \ install-pdf-recursive install-ps-recursive install-recursive \ installcheck-recursive installdirs-recursive pdf-recursive \ ps-recursive uninstall-recursive 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 ETAGS = etags CTAGS = ctags DIST_SUBDIRS = $(SUBDIRS) DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) am__relativize = \ dir0=`pwd`; \ sed_first='s,^\([^/]*\)/.*$$,\1,'; \ sed_rest='s,^[^/]*/*,,'; \ sed_last='s,^.*/\([^/]*\)$$,\1,'; \ sed_butlast='s,/*[^/]*$$,,'; \ while test -n "$$dir1"; do \ first=`echo "$$dir1" | sed -e "$$sed_first"`; \ if test "$$first" != "."; then \ if test "$$first" = ".."; then \ dir2=`echo "$$dir0" | sed -e "$$sed_last"`/"$$dir2"; \ dir0=`echo "$$dir0" | sed -e "$$sed_butlast"`; \ else \ first2=`echo "$$dir2" | sed -e "$$sed_first"`; \ if test "$$first2" = "$$first"; then \ dir2=`echo "$$dir2" | sed -e "$$sed_rest"`; \ else \ dir2="../$$dir2"; \ fi; \ dir0="$$dir0"/"$$first"; \ fi; \ fi; \ dir1=`echo "$$dir1" | sed -e "$$sed_rest"`; \ done; \ reldir="$$dir2" ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DOT = @DOT@ DOXYGEN = @DOXYGEN@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ GENERIC_CONFIG = @GENERIC_CONFIG@ GREP = @GREP@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ LT_VERSION = @LT_VERSION@ MAINT = @MAINT@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ VERSION = @VERSION@ 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@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ enable_dot = @enable_dot@ enable_html_docs = @enable_html_docs@ enable_latex_docs = @enable_latex_docs@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ SUBDIRS = log4tango all: config.h $(MAKE) $(AM_MAKEFLAGS) all-recursive .SUFFIXES: $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu include/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu include/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): config.h: stamp-h1 @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 cd $(top_builddir) && $(SHELL) ./config.status include/config.h $(srcdir)/config.h.in: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) ($(am__cd) $(top_srcdir) && $(AUTOHEADER)) rm -f stamp-h1 touch $@ distclean-hdr: -rm -f config.h stamp-h1 mostlyclean-libtool: -rm -f *.lo clean-libtool: -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. $(RECURSIVE_TARGETS): @fail= failcom='exit 1'; \ for f in x $$MAKEFLAGS; do \ case $$f in \ *=* | --[!k]*);; \ *k*) failcom='fail=yes';; \ esac; \ done; \ dot_seen=no; \ target=`echo $@ | sed s/-recursive//`; \ list='$(SUBDIRS)'; for subdir in $$list; do \ echo "Making $$target in $$subdir"; \ if test "$$subdir" = "."; then \ dot_seen=yes; \ local_target="$$target-am"; \ else \ local_target="$$target"; \ fi; \ ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ || eval $$failcom; \ done; \ if test "$$dot_seen" = "no"; then \ $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \ fi; test -z "$$fail" $(RECURSIVE_CLEAN_TARGETS): @fail= failcom='exit 1'; \ for f in x $$MAKEFLAGS; do \ case $$f in \ *=* | --[!k]*);; \ *k*) failcom='fail=yes';; \ esac; \ done; \ dot_seen=no; \ case "$@" in \ distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \ *) list='$(SUBDIRS)' ;; \ esac; \ rev=''; for subdir in $$list; do \ if test "$$subdir" = "."; then :; else \ rev="$$subdir $$rev"; \ fi; \ done; \ rev="$$rev ."; \ target=`echo $@ | sed s/-recursive//`; \ for subdir in $$rev; do \ echo "Making $$target in $$subdir"; \ if test "$$subdir" = "."; then \ local_target="$$target-am"; \ else \ local_target="$$target"; \ fi; \ ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ || eval $$failcom; \ done && test -z "$$fail" tags-recursive: list='$(SUBDIRS)'; for subdir in $$list; do \ test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \ done ctags-recursive: list='$(SUBDIRS)'; for subdir in $$list; do \ test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \ done ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ mkid -fID $$unique tags: TAGS TAGS: tags-recursive $(HEADERS) $(SOURCES) config.h.in $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) set x; \ here=`pwd`; \ if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \ include_option=--etags-include; \ empty_fix=.; \ else \ include_option=--include; \ empty_fix=; \ fi; \ list='$(SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ test ! -f $$subdir/TAGS || \ set "$$@" "$$include_option=$$here/$$subdir/TAGS"; \ fi; \ done; \ list='$(SOURCES) $(HEADERS) config.h.in $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: CTAGS CTAGS: ctags-recursive $(HEADERS) $(SOURCES) config.h.in $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) list='$(SOURCES) $(HEADERS) config.h.in $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ 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 \ dir1=$$subdir; dir2="$(distdir)/$$subdir"; \ $(am__relativize); \ new_distdir=$$reldir; \ dir1=$$subdir; dir2="$(top_distdir)"; \ $(am__relativize); \ new_top_distdir=$$reldir; \ echo " (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir="$$new_top_distdir" distdir="$$new_distdir" \\"; \ echo " am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)"; \ ($(am__cd) $$subdir && \ $(MAKE) $(AM_MAKEFLAGS) \ top_distdir="$$new_top_distdir" \ distdir="$$new_distdir" \ am__remove_distdir=: \ am__skip_length_check=: \ am__skip_mode_fix=: \ distdir) \ || exit 1; \ fi; \ done check-am: all-am check: check-recursive all-am: Makefile config.h installdirs: installdirs-recursive installdirs-am: install: install-recursive install-exec: install-exec-recursive install-data: install-data-recursive uninstall: uninstall-recursive install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-recursive install-strip: 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: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-recursive clean-am: clean-generic clean-libtool mostlyclean-am distclean: distclean-recursive -rm -f Makefile distclean-am: clean-am distclean-generic distclean-hdr distclean-tags dvi: dvi-recursive dvi-am: html: html-recursive html-am: info: info-recursive info-am: install-data-am: install-dvi: install-dvi-recursive install-dvi-am: install-exec-am: install-html: install-html-recursive install-html-am: install-info: install-info-recursive install-info-am: install-man: install-pdf: install-pdf-recursive install-pdf-am: install-ps: install-ps-recursive install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-recursive -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-recursive mostlyclean-am: mostlyclean-generic mostlyclean-libtool pdf: pdf-recursive pdf-am: ps: ps-recursive ps-am: uninstall-am: .MAKE: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) all \ ctags-recursive install-am install-strip tags-recursive .PHONY: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) CTAGS GTAGS \ all all-am check check-am clean clean-generic clean-libtool \ ctags ctags-recursive distclean distclean-generic \ distclean-hdr 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-generic mostlyclean-libtool pdf pdf-am ps ps-am \ tags tags-recursive uninstall uninstall-am # 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: tango-8.1.2c+dfsg.orig/lib/cpp/log4tango/include/log4tango/0000755000175000017500000000000012205375305022344 5ustar piccapiccatango-8.1.2c+dfsg.orig/lib/cpp/log4tango/include/log4tango/XmlLayout.hh0000644000175000017500000000332112205375130024616 0ustar piccapicca// // XMLLayout.hh // // Copyright (C) : 2000 - 2002 // LifeLine Networks BV (www.lifeline.nl). All rights reserved. // Bastiaan Bakker. All rights reserved. // // 2004,2005,2006,2007,2008,2009,2010,2011,2012 // Synchrotron SOLEIL // L'Orme des Merisiers // Saint-Aubin - BP 48 - France // // This file is part of log4tango. // // Log4ango 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. // // Log4tango 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 Log4Tango. If not, see . #ifndef _LOG4TANGO_XML_LAYOUT_H #define _LOG4TANGO_XML_LAYOUT_H #include #include namespace log4tango { /** * XMLLayout is a simple fixed format Layout implementation. **/ class LOG4TANGO_EXPORT XMLLayout : public Layout { public: /** * Ctor. **/ XMLLayout (); /** * Dtor. **/ virtual ~XMLLayout (); /** * Formats the LoggingEvent in XML **/ virtual std::string format (const LoggingEvent& event); private: /** * Ensures that embeded CDEnd strings (]]>) are handled properly **/ void appendEscapingCDATA(std::string buf, std::string str); }; } // namespace log4tango #endif // _LOG4TANGO_XML_LAYOUT_H tango-8.1.2c+dfsg.orig/lib/cpp/log4tango/include/log4tango/LoggingEvent.hh0000644000175000017500000000647612205375130025266 0ustar piccapicca// // LoggingEvent.hh // // Copyright (C) : 2000 - 2002 // LifeLine Networks BV (www.lifeline.nl). All rights reserved. // Bastiaan Bakker. All rights reserved. // // 2004,2005,2006,2007,2008,2009,2010,2011,2012 // Synchrotron SOLEIL // L'Orme des Merisiers // Saint-Aubin - BP 48 - France // // This file is part of log4tango. // // Log4ango 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. // // Log4tango 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 Log4Tango. If not, see . #ifndef _LOG4TANGO_LOGGINGEVENT_H #define _LOG4TANGO_LOGGINGEVENT_H #include #include #include #include namespace log4tango { /** * The internal representation of logging events. When a affirmative * logging decision is made a LoggingEvent instance is * created. This instance is passed around the different log4tango * components. * *

This class is of concern to those wishing to extend log4tango. **/ //----------------------------------------------------------------------------- // struct : LoggingEvent //----------------------------------------------------------------------------- struct LOG4TANGO_EXPORT LoggingEvent { public: /** * Instantiate a LoggingEvent from the supplied parameters. * *

Except timeStamp all the other fields of * LoggingEvent are filled when actually needed. *

* @param logger The logger of this event. * @param message The message of this event. * @param level The level of this event. **/ #ifdef LOG4TANGO_HAS_NDC LoggingEvent(const std::string& logger, const std::string& message, const std::string& ndc, Level::Value level); #else LoggingEvent(const std::string& logger, const std::string& message, Level::Value level); #endif // LOG4TANGO_HAS_NDC /** Copy constructor */ LoggingEvent(const LoggingEvent& event); /** The logger name. */ const std::string logger_name; /** The application supplied message of logging event. */ const std::string message; #ifdef LOG4TANGO_HAS_NDC /** The nested diagnostic context (NDC) of logging event. */ const std::string ndc; #endif /** Level of logging event. */ Level::Value level; /** Name of thread in which this logging event was generated */ std::string thread_name; /** id of thread in which this logging event was generated */ long thread_id; /** The number of seconds elapsed since the epoch (1/1/1970 00:00:00 UTC) until logging event was created. */ TimeStamp timestamp; private: /** Prevent implicit copy */ const LoggingEvent& operator= (const LoggingEvent&); }; } // namespace log4tango #endif // _LOG4TANGO_LOGGINGEVENT_H tango-8.1.2c+dfsg.orig/lib/cpp/log4tango/include/log4tango/Logger.hh0000644000175000017500000002552412205375130024110 0ustar piccapicca// // Logger.hh // // Copyright (C) : 2000 - 2002 // LifeLine Networks BV (www.lifeline.nl). All rights reserved. // Bastiaan Bakker. All rights reserved. // // 2004,2005,2006,2007,2008,2009,2010,2011,2012 // Synchrotron SOLEIL // L'Orme des Merisiers // Saint-Aubin - BP 48 - France // // This file is part of log4tango. // // Log4ango 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. // // Log4tango 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 Log4Tango. If not, see . #ifndef _LOG4TANGO_LOGGER_H #define _LOG4TANGO_LOGGER_H //----------------------------------------------------------------------------- // IMPL. OPTION //----------------------------------------------------------------------------- //#define LOG4TANGO_LOGGERS_USE_LOGSTREAM #include #include #include #include #ifndef LOG4TANGO_LOGGERS_USE_LOGSTREAM # include #endif namespace log4tango { #ifdef LOG4TANGO_LOGGERS_USE_LOGSTREAM //----------------------------------------------------------------------------- // FORWARD DECL. //----------------------------------------------------------------------------- class LogStream; #endif //----------------------------------------------------------------------------- // class : Logger //----------------------------------------------------------------------------- class LOG4TANGO_EXPORT Logger : public AppenderAttachable { public: /** * Constructor * @param name the fully qualified name of this Logger * @param level the level for this Logger. Defaults to Level::OFF **/ Logger(const std::string& name, Level::Value level = Level::OFF); /** * Destructor **/ virtual ~Logger(); /** * Return the logger name. * @returns The logger name. */ inline const std::string& get_name() const { return _name; } /** * Set the level of this Logger (silently ignores invalid values) * @param level The level to set. **/ void set_level (Level::Value level); /** * Returns the assigned Level, if any, for this Logger. * @return Level - the assigned Level, can be Level::NOTSET **/ inline Level::Value get_level() const { return _level; } /** * Returns true if the level of the Logger is equal to * or higher than given level. * @param level The level to compare with. * @returns whether logging is enable for this level. **/ bool is_level_enabled (Level::Value level) const { return _level >= level; } /** * Log a message with the specified level. * @param level The level of this log message. * @param string_format Format specifier for the log . * @param ... The arguments for string_format **/ void log (Level::Value level, const char* string_format, ...); /** * Log a message with the specified level. * @param level The level of this log message. * @param message string to write in the log file **/ inline void log (Level::Value level, const std::string& message) { if (is_level_enabled(level)) { log_unconditionally(level, message); } } /** * Log a message with the specified level without level checking. * @param level The level of this log message. * @param string_format Format specifier for the log . * @param ... The arguments for string_format **/ void log_unconditionally (Level::Value level, const char* string_format, ...); /** * Log a message with the specified level without level checking. * @param level The level of this log message. * @param message string to write in the log file **/ void log_unconditionally (Level::Value level, const std::string& message); /** * Log a message with debug level. * @param string_format Format specifier for the log. * @param ... The arguments for string_format **/ void debug (const char* string_format, ...); /** * Log a message with debug level. * @param message string to write in the log file **/ inline void debug (const std::string& message) { if (is_level_enabled(Level::DEBUG)) { log_unconditionally(Level::DEBUG, message); } } /** * Return true if the Logger will log messages with level DEBUG. * @returns Whether the Logger will log. **/ inline bool is_debug_enabled (void) const { return is_level_enabled (Level::DEBUG); }; #ifndef LOG4TANGO_LOGGERS_USE_LOGSTREAM /** * Return a LoggerStream with level DEBUG. * @returns The LoggerStream. **/ inline LoggerStream debug_stream (void) { return LoggerStream(*this, Level::DEBUG, true); } #else /** * Return the DEBUG LogStream. * @returns The DEBUG LogStream. **/ inline LogStream& debug_stream (void) { return *_log_streams[_DEBUG_STREAM_ID]; } #endif /** * Log a message with info level. * @param string_format Format specifier for the log. * @param ... The arguments for string_format **/ void info (const char* string_format, ...); /** * Log a message with info level. * @param message string to write in the log file **/ inline void info (const std::string& message) { if (is_level_enabled(Level::INFO)) { log_unconditionally(Level::INFO, message); } } /** * Return true if the Logger will log messages with level INFO. * @returns Whether the Logger will log. **/ inline bool is_info_enabled (void) const { return is_level_enabled(Level::INFO); }; #ifndef LOG4TANGO_LOGGERS_USE_LOGSTREAM /** * Return a LoggerStream with level INFO. * @returns The LoggerStream. **/ inline LoggerStream info_stream (void) { return LoggerStream(*this, Level::INFO, true); } #else /** * Return the INFO LogStream. * @returns The INFO LogStream. **/ inline LogStream& info_stream (void) { return *_log_streams[_INFO_STREAM_ID]; } #endif /** * Log a message with warn level. * @param string_format Format specifier for the log. * @param ... The arguments for string_format **/ void warn (const char* string_format, ...); /** * Log a message with warn level. * @param message string to write in the log file **/ inline void warn (const std::string& message) { if (is_level_enabled(Level::WARN)) { log_unconditionally(Level::WARN, message); } } /** * Return true if the Logger will log messages with level WARN. * @returns Whether the Logger will log. **/ inline bool is_warn_enabled (void) const { return is_level_enabled(Level::WARN); }; #ifndef LOG4TANGO_LOGGERS_USE_LOGSTREAM /** * Return a LoggerStream with level WARN. * @returns The LoggerStream. **/ inline LoggerStream warn_stream (void) { return LoggerStream(*this, Level::WARN, true); }; #else /** * Return the WARN LogStream. * @returns The WARN LogStream. **/ inline LogStream& warn_stream (void) { return *_log_streams[_WARN_STREAM_ID]; } #endif /** * Log a message with error level. * @param string_format Format specifier for the log. * @param ... The arguments for string_format **/ void error (const char* string_format, ...); /** * Log a message with error level. * @param message string to write in the log file **/ inline void error (const std::string& message) { if (is_level_enabled(Level::ERROR)) { log_unconditionally(Level::ERROR, message); } } /** * Return true if the Logger will log messages with level ERROR. * @returns Whether the Logger will log. **/ inline bool is_error_enabled (void) const { return is_level_enabled(Level::ERROR); }; #ifndef LOG4TANGO_LOGGERS_USE_LOGSTREAM /** * Return a LoggerStream with level ERROR. * @returns The LoggerStream. **/ inline LoggerStream error_stream (void) { return LoggerStream(*this, Level::ERROR, true); }; #else /** * Return the ERROR LogStream. * @returns The ERROR LogStream. **/ inline LogStream& error_stream (void) { return *_log_streams[_ERROR_STREAM_ID]; } #endif /** * Log a message with fatal level. * @param string_format Format specifier for the log. * @param ... The arguments for string_format **/ void fatal(const char* string_format, ...); /** * Log a message with fatal level. * @param message string to write in the log file **/ inline void fatal (const std::string& message) { if (is_level_enabled(Level::FATAL)) { log_unconditionally(Level::FATAL, message); } } /** * Return true if the Logger will log messages with level FATAL. * @returns Whether the Logger will log. **/ inline bool is_fatal_enabled (void) const { return is_level_enabled(Level::FATAL); }; #ifndef LOG4TANGO_LOGGERS_USE_LOGSTREAM /** * Return a LoggerStream with level FATAL. * @returns The LoggerStream. **/ inline LoggerStream fatal_stream (void) { return LoggerStream(*this, Level::FATAL, true); }; #else /** * Return the FATAL LogStream. * @returns The FATAL LogStream. **/ inline LogStream& fatal_stream (void) { return *_log_streams[_FATAL_STREAM_ID]; } #endif #ifndef LOG4TANGO_LOGGERS_USE_LOGSTREAM /** * Return a LoggerStream with given Level. * @param level The Level of the LoggerStream. * @param filter The filter flag * @returns The requested LoggerStream. **/ inline LoggerStream get_stream (Level::Value level, bool filter = true) { return LoggerStream(*this, level, filter); } #endif protected: /** * Call the appenders. * * @param event the LogginEvent to log. **/ void call_appenders (const LoggingEvent& event); private: #ifdef LOG4TANGO_LOGGERS_USE_LOGSTREAM /** Stream ids. */ enum { _FATAL_STREAM_ID = 0, _ERROR_STREAM_ID = 1, _WARN_STREAM_ID = 2, _INFO_STREAM_ID = 3, _DEBUG_STREAM_ID = 4 }; #endif /** The name of this logger. */ const std::string _name; /** The assigned level of this logger. */ Level::Value _level; #ifdef LOG4TANGO_LOGGERS_USE_LOGSTREAM /** The thread-safe streams of this logger. */ LogStream *_log_streams[5]; #endif /* prevent copying and assignment */ Logger (const Logger&); Logger& operator= (const Logger&); }; } // namespace log4tango #endif // _LOG4TANGO_LOGGER_H tango-8.1.2c+dfsg.orig/lib/cpp/log4tango/include/log4tango/Appender.hh0000644000175000017500000001150212205375130024416 0ustar piccapicca// // Appender.hh // // Copyright (C) : 2000 - 2002 // LifeLine Networks BV (www.lifeline.nl). All rights reserved. // Bastiaan Bakker. All rights reserved. // // 2004,2005,2006,2007,2008,2009,2010,2011,2012 // Synchrotron SOLEIL // L'Orme des Merisiers // Saint-Aubin - BP 48 - France // // This file is part of log4tango. // // Log4ango 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. // // Log4tango 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 Log4Tango. If not, see . #include #include #include #include #include #include #include #include #ifndef _LOG4TANGO_APPENDER_H #define _LOG4TANGO_APPENDER_H namespace log4tango { //----------------------------------------------------------------------------- // class : Appender //----------------------------------------------------------------------------- class LOG4TANGO_EXPORT Appender { friend class Logger; protected: /** * Constructor for Appender. Will only be used in * getAppender() (and in derived classes of course). * @param name The name of this Appender. **/ Appender (const std::string& name); /** * Inform an appender that its Logger's logging level has changed. * The default implementation does nothing. * * @param new_level The new Logger's level. **/ virtual void level_changed (Level::Value new_level); public: /** * Destructor for Appender. **/ virtual ~Appender (); /** * Log in Appender specific way. Returns -1 on error, 0 otherwise. * @param event The LoggingEvent to log. **/ #if defined(APPENDERS_HAVE_LEVEL_THRESHOLD) || defined(APPENDERS_HAVE_FILTERS) int append (const LoggingEvent& event); #else inline int append (const LoggingEvent& event) { return _append(event); } #endif /** * Reopens the output destination of this Appender, e.g. the logfile * or TCP socket. * @returns false if an error occured during reopening, true otherwise. **/ virtual bool reopen (void); /** * Release any resources allocated within the appender such as file * handles, network connections, etc. **/ virtual void close (void) = 0; /** * Check if the appender uses a layout. * * @returns true if the appender implementation requires a layout. **/ virtual bool requires_layout (void) const = 0; /** * Change the layout. **/ virtual void set_layout (Layout* layout = 0) = 0; /** * Returns this appender name. **/ inline const std::string& get_name (void) const { return _name; } /** * Check if the appender is valid (for instance the underlying connection is ok) * This default implementation always return true. Overload to define your own * behaviour. * * @returns true if the appender is valid, false otherwise. **/ virtual bool is_valid (void) const; #ifdef APPENDERS_HAVE_LEVEL_THRESHOLD /** * Set the threshold level of this Appender. The Appender will not * appender LoggingEvents with a level lower than the threshold. * Use Level::NOTSET to disable level checking. * @param level The level to set. **/ void set_level (Level::Value level); /** * Get the threshold level of this Appender. * @returns the threshold **/ Level::Value get_level (void) const; #endif // APPENDERS_HAVE_LEVEL_THRESHOLD #ifdef APPENDERS_HAVE_FILTERS /** * Set a Filter for this appender. **/ virtual void set_filter (Filter* filter); /** * Get the Filter for this appender. * @returns the filter, or NULL if no filter has been set. **/ virtual Filter* get_filter (void); #endif // APPENDERS_HAVE_FILTERS protected: /** * Log in Appender specific way. Subclasses of Appender should * implement this method to perform actual logging. * @param event The LoggingEvent to log. **/ virtual int _append(const LoggingEvent& event) = 0; private: /** * The appender name **/ const std::string _name; #ifdef APPENDERS_HAVE_LEVEL_THRESHOLD /** * The appender logging level **/ Level::Value _level; #endif #ifdef APPENDERS_HAVE_FILTERS /** * The appender filter list **/ Filter* _filter; #endif }; } // namespace log4tango #endif // _LOG4TANGO_APPENDER_H tango-8.1.2c+dfsg.orig/lib/cpp/log4tango/include/log4tango/threading/0000755000175000017500000000000012205375305024311 5ustar piccapiccatango-8.1.2c+dfsg.orig/lib/cpp/log4tango/include/log4tango/threading/Threading.hh0000644000175000017500000000270712205375130026541 0ustar piccapicca// // Threading.hh // // Copyright (C) : 2000 - 2002 // LifeLine Networks BV (www.lifeline.nl). All rights reserved. // Bastiaan Bakker. All rights reserved. // // 2004,2005,2006,2007,2008,2009,2010,2011,2012 // Synchrotron SOLEIL // L'Orme des Merisiers // Saint-Aubin - BP 48 - France // // This file is part of log4tango. // // Log4ango 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. // // Log4tango 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 Log4Tango. If not, see . #ifndef _LOG4TANGO_THREADING_THREADING_H #define _LOG4TANGO_THREADING_THREADING_H #include #ifdef LOG4TANGO_HAVE_THREADING # ifdef LOG4TANGO_USE_MSTHREADS # include # endif # ifdef LOG4TANGO_USE_PTHREADS # include # endif #else # include #endif #endif // _LOG4TANGO_THREADING_THREADING_H tango-8.1.2c+dfsg.orig/lib/cpp/log4tango/include/log4tango/threading/DummyThreads.hh0000644000175000017500000000415212205375130027236 0ustar piccapicca// // DummyThreads.hh // // Copyright (C) : 2000 - 2002 // LifeLine Networks BV (www.lifeline.nl). All rights reserved. // Bastiaan Bakker. All rights reserved. // // 2004,2005,2006,2007,2008,2009,2010,2011,2012 // Synchrotron SOLEIL // L'Orme des Merisiers // Saint-Aubin - BP 48 - France // // This file is part of log4tango. // // Log4ango 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. // // Log4tango 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 Log4Tango. If not, see . #ifndef _LOG4TANGO_THREADING_DUMMY_THREADS_H #define _LOG4TANGO_THREADING_DUMMY_THREADS_H #include #include #include namespace log4tango { namespace threading { std::string get_thread_id (void); typedef int Mutex; typedef int ScopedLock; #ifdef LOG4TANGO_HAS_NDC template class ThreadLocalDataHolder { public: typedef T data_type; inline ThreadLocalDataHolder () : _data(0) { //no-op }; inline ~ThreadLocalDataHolder () { if (_data) { delete _data; } }; inline T* get (void) const { return _data; }; inline T* operator->() const { return get(); }; inline T& operator*() const { return *get(); }; inline T* release() { T* result = _data; _data = 0; return result; }; inline void reset (T* p = 0) { if (_data) { delete _data; } _data = p; }; private: T* _data; }; #endif // #ifdef LOG4TANGO_HAS_NDC } // namespace threading } // namespace log4tango #endif // _LOG4TANGO_THREADING_DUMMY_THREADS_H tango-8.1.2c+dfsg.orig/lib/cpp/log4tango/include/log4tango/threading/MSThreads.hh0000644000175000017500000001541312205375130026464 0ustar piccapicca// // MSThreads.hh // // Copyright (C) : 2000 - 2002 // LifeLine Networks BV (www.lifeline.nl). All rights reserved. // Bastiaan Bakker. All rights reserved. // // 2004,2005,2006,2007,2008,2009,2010,2011,2012 // Synchrotron SOLEIL // L'Orme des Merisiers // Saint-Aubin - BP 48 - France // // This file is part of log4tango. // // Log4ango 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. // // Log4tango 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 Log4Tango. If not, see . #ifndef _LOG4TANGO_THREADING_MSTHREADS_H #define _LOG4TANGO_THREADING_MSTHREADS_H #include // deal with ERROR #define // This #includes windows.h with NOGDI and WIN32_LEAN_AND_MEAN // #defined. If this is not what the user wants, #include // windows.h before this file. #ifndef _WINDOWS_ # ifndef NOGDI # define NOGDI // circumvent the ERROR #define in windows.h # define LOG4TANGO_UNDEFINE_NOGDI # endif # ifndef WIN32_LEAN_AND_MEAN # define WIN32_LEAN_AND_MEAN # define LOG4TANGO_UNDEFINE_WIN32_LEAN_AND_MEAN # endif # include # ifdef LOG4TANGO_UNDEFINE_NOGDI # undef NOGDI # endif # ifdef LOG4TANGO_UNDEFINE_WIN32_LEAN_AND_MEAN # undef WIN32_LEAN_AND_MEAN # endif #endif // done dealing with ERROR #define namespace log4tango { namespace threading { std::string get_thread_id (void); long thread_id (void); //----------------------------------------------------------------------------- // Class : MSMutex //----------------------------------------------------------------------------- class LOG4TANGO_EXPORT Mutex { public: Mutex() { InitializeCriticalSection(&_criticalSection); } ~Mutex() { DeleteCriticalSection(&_criticalSection); } inline LPCRITICAL_SECTION get_critical_section (void) { return &_criticalSection; } private: Mutex(const Mutex&); Mutex operator=(const Mutex&); CRITICAL_SECTION _criticalSection; }; //----------------------------------------------------------------------------- // Class : ScopedLock //----------------------------------------------------------------------------- class ScopedLock { public: ScopedLock (Mutex& mutex) { _criticalSection = mutex.get_critical_section(); EnterCriticalSection(_criticalSection); } ~ScopedLock() { LeaveCriticalSection(_criticalSection); } private: ScopedLock(const ScopedLock&); ScopedLock operator=(const ScopedLock&); LPCRITICAL_SECTION _criticalSection; }; //----------------------------------------------------------------------------- // Class : RecursiveMutex //----------------------------------------------------------------------------- class RecursiveMutex { public: // ctor RecursiveMutex (void) : recursion_level_(0) { ::InitializeCriticalSection(&guard_); } // dtor ~RecursiveMutex (void) { ::DeleteCriticalSection(&guard_); } // Locking an RecursiveMutex: // If is null (the default), blocks until // the mutex is acquired and returns 1 (true). Otherwise, // blocks until the mutex is acquired or times out // after milliseconds in which case 0 (false) is // returned. inline int lock (long timeout_ = 0) { ::EnterCriticalSection(&guard_); recursion_level_++; return 0; } // Releasing an RecursiveMutex: // Call unlock times (i.e. one call for // each previous call to lock) or call unlockn just once. // These two methods do nothing if the caller is not the // current owner of the mutex. inline void unlock (void) { //-should work if called by owner recursion_level_--; ::LeaveCriticalSection(&guard_); } inline void unlockn (void) { //-should work if called by owner while (recursion_level_ > 0) { recursion_level_--; ::LeaveCriticalSection(&guard_); } } protected: // guards the CRITICAL_SECTION guard_; private: // current level of the recursion unsigned long recursion_level_; // dummy copy constructor and operator= to prevent copying RecursiveMutex (const RecursiveMutex&); RecursiveMutex& operator= (const RecursiveMutex&); }; //----------------------------------------------------------------------------- // Class : ThreadLocalDataHolder //----------------------------------------------------------------------------- /** * This class holds Thread local data of type T, i.e. for each * thread a ThreadLocalDataHolder holds 0 or 1 instance of T. * The held object must be heap allocated and will be deleted * upon termination of the thread to which it belongs. **/ #ifdef LOG4TANGO_HAS_NDC template class ThreadLocalDataHolder { public: inline ThreadLocalDataHolder() : _key(TlsAlloc()) { }; inline ~ThreadLocalDataHolder() { TlsFree(_key); }; /** * Obtains the Object held for the current thread. * @return a pointer to the held Object or NULL if no * Object has been set for the current thread. **/ inline T* get (void) const { return (T*)TlsGetValue(_key); }; /** * Obtains the Object held for the current thread. * Initially each thread holds NULL. * @return a pointer to the held Object or NULL if no * Object has been set for the current thread. **/ inline T* operator->() const { return get(); }; /** * Obtains the Object held for the current thread. * @pre get() != NULL * @return a reference to the held Object. **/ inline T& operator*() const { return *get(); }; /** * Releases the Object held for the current thread. * @post get() == NULL * @return a pointer to the Object thas was held for * the current thread or NULL if no Object was held. **/ inline T* release() { T* result = (T*)TlsGetValue(_key); TlsSetValue(_key, NULL); return result; }; /** * Sets a new Object to be held for the current thread. A * previously set Object will be deleted. * @param p the new object to hold. * @post get() == p **/ inline void reset(T* p = NULL) { T* thing = (T*)TlsGetValue(_key); delete thing; TlsSetValue(_key, p); }; private: DWORD _key; }; #endif // LOG4TANGO_HAS_NDC } // namespace threading } // namespace log4tango #endif // _LOG4TANGO_THREADING_MSTHREADS_H tango-8.1.2c+dfsg.orig/lib/cpp/log4tango/include/log4tango/threading/Makefile.in0000644000175000017500000003520712205375130026361 0ustar piccapicca# Makefile.in generated by automake 1.11.3 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 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. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ subdir = include/log4tango/threading DIST_COMMON = $(liblog4tangoinclude_HEADERS) $(srcdir)/Makefile.am \ $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/AC_CREATE_PREFIX_CONFIG_H.m4 \ $(top_srcdir)/m4/AC_CXX_HAVE_SSTREAM.m4 \ $(top_srcdir)/m4/AC_CXX_NAMESPACES.m4 \ $(top_srcdir)/m4/AC_C_INT64_T.m4 \ $(top_srcdir)/m4/AC_FUNC_SNPRINTF.m4 \ $(top_srcdir)/m4/BB_CHECK_PTHREADS.m4 \ $(top_srcdir)/m4/BB_ENABLE_DOXYGEN.m4 \ $(top_srcdir)/m4/CREATE_GENERIC_CONFIG.m4 \ $(top_srcdir)/m4/PETI_PEDANTIC_GCC.m4 \ $(top_srcdir)/m4/RSSH_CHECK_SUNPRO_CC.m4 \ $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/configure.in am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(SHELL) $(top_srcdir)/config/mkinstalldirs CONFIG_HEADER = $(top_builddir)/include/config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = SOURCES = DIST_SOURCES = 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)$(liblog4tangoincludedir)" HEADERS = $(liblog4tangoinclude_HEADERS) ETAGS = etags CTAGS = ctags DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DOT = @DOT@ DOXYGEN = @DOXYGEN@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ GENERIC_CONFIG = @GENERIC_CONFIG@ GREP = @GREP@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ LT_VERSION = @LT_VERSION@ MAINT = @MAINT@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ VERSION = @VERSION@ 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@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ enable_dot = @enable_dot@ enable_html_docs = @enable_html_docs@ enable_latex_docs = @enable_latex_docs@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ liblog4tangoincludedir = $(includedir)/tango/log4tango/threading liblog4tangoinclude_HEADERS = \ DummyThreads.hh \ PThreads.hh \ MSThreads.hh \ Threading.hh all: all-am .SUFFIXES: $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu include/log4tango/threading/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu include/log4tango/threading/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs install-liblog4tangoincludeHEADERS: $(liblog4tangoinclude_HEADERS) @$(NORMAL_INSTALL) test -z "$(liblog4tangoincludedir)" || $(MKDIR_P) "$(DESTDIR)$(liblog4tangoincludedir)" @list='$(liblog4tangoinclude_HEADERS)'; test -n "$(liblog4tangoincludedir)" || list=; \ 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)$(liblog4tangoincludedir)'"; \ $(INSTALL_HEADER) $$files "$(DESTDIR)$(liblog4tangoincludedir)" || exit $$?; \ done uninstall-liblog4tangoincludeHEADERS: @$(NORMAL_UNINSTALL) @list='$(liblog4tangoinclude_HEADERS)'; test -n "$(liblog4tangoincludedir)" || list=; \ files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ dir='$(DESTDIR)$(liblog4tangoincludedir)'; $(am__uninstall_files_from_dir) ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ mkid -fID $$unique tags: TAGS TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) set x; \ here=`pwd`; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: CTAGS CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(HEADERS) installdirs: for dir in "$(DESTDIR)$(liblog4tangoincludedir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: 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: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-generic clean-libtool mostlyclean-am distclean: distclean-am -rm -f Makefile distclean-am: clean-am distclean-generic distclean-tags dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-liblog4tangoincludeHEADERS install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-generic mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-liblog4tangoincludeHEADERS .MAKE: install-am install-strip .PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \ clean-libtool ctags distclean 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-liblog4tangoincludeHEADERS 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-generic mostlyclean-libtool pdf pdf-am ps ps-am \ tags uninstall uninstall-am \ uninstall-liblog4tangoincludeHEADERS # 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: tango-8.1.2c+dfsg.orig/lib/cpp/log4tango/include/log4tango/threading/PThreads.hh0000644000175000017500000001140712205375130026343 0ustar piccapicca// // PThreads.hh // // Copyright (C) : 2000 - 2002 // LifeLine Networks BV (www.lifeline.nl). All rights reserved. // Bastiaan Bakker. All rights reserved. // // 2004,2005,2006,2007,2008,2009,2010,2011,2012 // Synchrotron SOLEIL // L'Orme des Merisiers // Saint-Aubin - BP 48 - France // // This file is part of log4tango. // // Log4ango 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. // // Log4tango 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 Log4Tango. If not, see . #ifndef _LOG4TANGO_THREADING_PTHREADS_H #define _LOG4TANGO_THREADING_PTHREADS_H #include #include #include #include #include namespace log4tango { namespace threading { std::string get_thread_id (void); long thread_id (void); //----------------------------------------------------------------------------- // Class : Mutex //----------------------------------------------------------------------------- class Mutex { private: pthread_mutex_t mutex; public: inline Mutex() { ::pthread_mutex_init(&mutex, NULL); } inline ~Mutex() { ::pthread_mutex_destroy(&mutex); } inline void lock() { ::pthread_mutex_lock(&mutex); } inline void unlock() { ::pthread_mutex_unlock(&mutex); } }; //----------------------------------------------------------------------------- // Class : ScopedLock //----------------------------------------------------------------------------- class ScopedLock { private: Mutex& _mutex; public: inline ScopedLock(Mutex &m) : _mutex(m) { _mutex.lock(); } inline ~ScopedLock() { _mutex.unlock(); } }; //----------------------------------------------------------------------------- // Class : RecursiveMutex //----------------------------------------------------------------------------- class RecursiveMutex { public: // ctor RecursiveMutex (void); // dtor ~RecursiveMutex (void); // Locking an RecursiveMutex: // If is null (the default), blocks until // the mutex is acquired and returns 1 (true). Otherwise, // blocks until the mutex is acquired or times out // after milliseconds in which case 0 (false) is // returned. int lock (long timeout_ = 0); // Releasing an RecursiveMutex: // Call unlock times (i.e. one call for // each previous call to lock) or call unlockn just once. // These two methods do nothing if the caller is not the // current owner of the mutex. void unlock (void); void unlockn (void); protected: // guards the and pthread_mutex_t guard_; // this condition variable suspends other waiting threads // until the mutex is available pthread_cond_t mutex_available_; private: // current level of the recursion long recursion_level_; // current owner of the lock. pthread_t owner_id_; // dummy copy constructor and operator= to prevent copying RecursiveMutex (const RecursiveMutex&); RecursiveMutex& operator= (const RecursiveMutex&); }; //----------------------------------------------------------------------------- // Class : ThreadLocalDataHolder //----------------------------------------------------------------------------- #ifdef LOG4TANGO_HAS_NDC template class ThreadLocalDataHolder { private: pthread_key_t _key; public: typedef T data_type; inline ThreadLocalDataHolder() { ::pthread_key_create(&_key, freeHolder); } inline static void freeHolder(void *p) { assert(p != NULL); delete reinterpret_cast(p); } inline ~ThreadLocalDataHolder() { T *data = get(); if (data != NULL) { delete data; } ::pthread_key_delete(_key); } inline T* get() const { return reinterpret_cast(::pthread_getspecific(_key)); } inline T* operator->() const { return get(); } inline T& operator*() const { return *get(); } inline T* release() { T* result = get(); ::pthread_setspecific(_key, NULL); return result; } inline void reset(T* p = NULL) { T *data = get(); if (data != NULL) { delete data; } ::pthread_setspecific(_key, p); } }; #endif //LOG4TANGO_HAS_NDC } // namespace threading } // namespace log4tango #endif // _LOG4TANGO_THREADING_PTHREADS_H tango-8.1.2c+dfsg.orig/lib/cpp/log4tango/include/log4tango/threading/Makefile.am0000644000175000017500000000024712205375130026344 0ustar piccapiccaliblog4tangoincludedir = $(includedir)/tango/log4tango/threading liblog4tangoinclude_HEADERS = \ DummyThreads.hh \ PThreads.hh \ MSThreads.hh \ Threading.hh tango-8.1.2c+dfsg.orig/lib/cpp/log4tango/include/log4tango/LogSeparator.hh0000644000175000017500000000336012205375130025265 0ustar piccapicca// // LogSeparator.hh // // Copyright (C) : 2000 - 2002 // LifeLine Networks BV (www.lifeline.nl). All rights reserved. // Bastiaan Bakker. All rights reserved. // // 2004,2005,2006,2007,2008,2009,2010,2011,2012 // Synchrotron SOLEIL // L'Orme des Merisiers // Saint-Aubin - BP 48 - France // // This file is part of log4tango. // // Log4ango 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. // // Log4tango 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 Log4Tango. If not, see . #ifndef _LOG4TANGO_LOG_SEPARATOR_H #define _LOG4TANGO_LOG_SEPARATOR_H #include namespace log4tango { //----------------------------------------------------------------------------- // Class : LogInitiator //----------------------------------------------------------------------------- class LOG4TANGO_EXPORT LogInitiator { public: static LogInitiator _begin_log; }; //----------------------------------------------------------------------------- // Class : LogSeparator //----------------------------------------------------------------------------- class LOG4TANGO_EXPORT LogSeparator { public: static LogSeparator _end_log; }; } // namespace log4tango #endif // _LOG4TANGO_LOG_SEPARATOR_H tango-8.1.2c+dfsg.orig/lib/cpp/log4tango/include/log4tango/AppenderAttachable.hh0000644000175000017500000000716012205375130026374 0ustar piccapicca// // AppenderAttachable.hh // // Copyright (C) : 2000 - 2002 // LifeLine Networks BV (www.lifeline.nl). All rights reserved. // Bastiaan Bakker. All rights reserved. // // 2004,2005,2006,2007,2008,2009,2010,2011,2012 // Synchrotron SOLEIL // L'Orme des Merisiers // Saint-Aubin - BP 48 - France // // This file is part of log4tango. // // Log4ango 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. // // Log4tango 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 Log4Tango. If not, see . #ifndef _LOG4TANGO_APPENDER_ATTACHABLE_H #define _LOG4TANGO_APPENDER_ATTACHABLE_H #include #include #include #include #include namespace log4tango { /** * A map of appenders **/ typedef std::map AppenderMap; /** * A map of appenders iterator **/ typedef AppenderMap::iterator AppenderMapIterator; /** * Define what is a list of appenders **/ typedef std::vector AppenderList; //----------------------------------------------------------------------------- // class : AppenderAttachable //----------------------------------------------------------------------------- class LOG4TANGO_EXPORT AppenderAttachable { public: /** * Constructor. **/ AppenderAttachable (); /** * Destructor. **/ virtual ~AppenderAttachable (); /** * Adds an Appender. Does nothing if the appender is NULL * or already attached. **/ void add_appender (Appender* appender); /** * Get all previously added appenders as a vector. * The caller must call "release" on each Appender in * the returned list when it is no longer needed (the * Appender class is ref-counted). **/ AppenderList get_all_appenders (void); /** * Get an appender by name. * The caller must call "release" on the returned Appender * when it is no longer needed (the Appender class is * ref-counted). Returns 0 if there is no Appender named * "name" currently attached. **/ Appender* get_appender (const std::string& name); /** * Returns true if the specified appender is in list of * attached appanders, false otherwise. **/ bool is_attached (Appender* appender); /** * Removes all appenders for this Logger. **/ void remove_all_appenders(); /** * Remove the appender passed as parameter from the list of appenders. **/ void remove_appender(Appender* appender); /** * Remove the appender with the name passed as parameter from the * list of appenders. **/ void remove_appender(const std::string& name); protected: /** * Appenders repository. **/ AppenderMap _appenders; /** * A mutex to protect the repository against race conditions. **/ threading::Mutex _appendersMutex; AppenderAttachable (const AppenderAttachable& other); AppenderAttachable& operator=(const AppenderAttachable& other); }; } // namespace log4tango #endif // _LOG4TANGO_APPENDER_ATTACHABLE_H tango-8.1.2c+dfsg.orig/lib/cpp/log4tango/include/log4tango/PatternLayout.hh0000644000175000017500000000767112205375130025507 0ustar piccapicca// // PatternLayout.hh // // Copyright (C) : 2000 - 2002 // LifeLine Networks BV (www.lifeline.nl). All rights reserved. // Bastiaan Bakker. All rights reserved. // // 2004,2005,2006,2007,2008,2009,2010,2011,2012 // Synchrotron SOLEIL // L'Orme des Merisiers // Saint-Aubin - BP 48 - France // // This file is part of log4tango. // // Log4ango 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. // // Log4tango 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 Log4Tango. If not, see . #ifndef _LOG4TANGO_PATTERNLAYOUT_H #define _LOG4TANGO_PATTERNLAYOUT_H #include #include #include #ifdef LOG4TANGO_HAVE_SSTREAM # include #endif namespace log4tango { //----------------------------------------------------------------------------- // class : PatternLayout (a simple fixed format Layout implementation) //----------------------------------------------------------------------------- class LOG4TANGO_EXPORT PatternLayout : public Layout { public: /** A conversion pattern equivalent to the BasicLayout. **/ static const char* BASIC_CONVERSION_PATTERN; PatternLayout(); virtual ~PatternLayout(); // NOTE: // All double percentage signs ('%%') followed by a character // in the following comments should actually be a single char. // The doubles are included so that doxygen will print them correctly. /** * Formats the LoggingEvent in the style set by * the set_conversion_pattern call. By default, set * to "%%m%%n" **/ virtual std::string format(const LoggingEvent& event); /** * Sets the format of log lines handled by this * PatternLayout. By default, set to "%%m%%n".
* Format characters are as follows:
*

    *
  • %%%% - a single percent sign
  • *
  • %%c - the logger
  • *
  • %%d - the date\n * Date format: The date format character may be followed by a date format * specifier enclosed between braces. For example, %%d{%%H:%%M:%%S,%%l} or %%d{%%d %%m %%Y %%H:%%M:%%S,%%l}. * If no date format specifier is given then the following format is used: * "Wed Jan 02 02:03:55 1980". The date format specifier admits the same syntax * as the ANSI C function strftime, with 1 addition. The addition is the specifier * %%l for milliseconds, padded with zeros to make 3 digits.
  • *
  • %%m - the message
  • *
  • %%n - the platform specific line separator
  • *
  • %%p - the level
  • *
  • %%r - milliseconds since this layout was created.
  • *
  • %%R - seconds since Jan 1, 1970
  • *
  • %%u - clock ticks since process start
  • *
  • %%x - the NDC
  • *
* @param conversionPattern the conversion pattern * @exception ConfigureFailure if the pattern is invalid **/ virtual int set_conversion_pattern (const std::string& conversionPattern); virtual std::string get_conversion_pattern() const; virtual void clear_conversion_pattern(); class LOG4TANGO_EXPORT PatternComponent { public: inline virtual ~PatternComponent() {}; virtual void append(std::ostringstream& out, const LoggingEvent& event) = 0; }; private: typedef std::vector ComponentVector; ComponentVector _components; std::string _conversionPattern; }; } // namespace log4tango #endif // _LOG4TANGO_PATTERNLAYOUT_H tango-8.1.2c+dfsg.orig/lib/cpp/log4tango/include/log4tango/OstreamAppender.hh0000644000175000017500000000351312205375130025754 0ustar piccapicca// // OstreamAppender.hh // // Copyright (C) : 2000 - 2002 // LifeLine Networks BV (www.lifeline.nl). All rights reserved. // Bastiaan Bakker. All rights reserved. // // 2004,2005,2006,2007,2008,2009,2010,2011,2012 // Synchrotron SOLEIL // L'Orme des Merisiers // Saint-Aubin - BP 48 - France // // This file is part of log4tango. // // Log4ango 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. // // Log4tango 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 Log4Tango. If not, see . #ifndef _LOG4TANGO_OSTREAMAPPENDER_H #define _LOG4TANGO_OSTREAMAPPENDER_H #include #include #include #include namespace log4tango { //----------------------------------------------------------------------------- // class : OstreamAppender (appends LoggingEvents to ostreams) //----------------------------------------------------------------------------- class LOG4TANGO_EXPORT OstreamAppender : public LayoutAppender { public: OstreamAppender(const std::string& name, std::ostream* stream); virtual ~OstreamAppender(); virtual bool reopen(); virtual void close(); protected: virtual int _append (const LoggingEvent& event); std::ostream* _stream; }; } // namespace log4tango #endif // _LOG4TANGO_OSTREAMAPPENDER_HH tango-8.1.2c+dfsg.orig/lib/cpp/log4tango/include/log4tango/LayoutAppender.hh0000644000175000017500000000356612205375130025627 0ustar piccapicca// // LayoutAppender.hh // // Copyright (C) : 2000 - 2002 // LifeLine Networks BV (www.lifeline.nl). All rights reserved. // Bastiaan Bakker. All rights reserved. // // 2004,2005,2006,2007,2008,2009,2010,2011,2012 // Synchrotron SOLEIL // L'Orme des Merisiers // Saint-Aubin - BP 48 - France // // This file is part of log4tango. // // Log4ango 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. // // Log4tango 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 Log4Tango. If not, see . #ifndef _LOG4TANGO_LAYOUTAPPENDER_H #define _LOG4TANGO_LAYOUTAPPENDER_H #include #include #include #include namespace log4tango { //----------------------------------------------------------------------------- // class : LayoutAppender (superclass for appenders that require a Layout) //----------------------------------------------------------------------------- class LOG4TANGO_EXPORT LayoutAppender : public Appender { public: typedef Layout DefaultLayoutType; LayoutAppender(const std::string& name); virtual ~LayoutAppender(); virtual bool requires_layout() const; virtual void set_layout (Layout* layout = 0); protected: Layout& get_layout(); private: Layout* _layout; }; } // namespace log4tango #endif // _LOG4TANGO_LAYOUTAPPENDER_H tango-8.1.2c+dfsg.orig/lib/cpp/log4tango/include/log4tango/Layout.hh0000644000175000017500000000365312205375130024145 0ustar piccapicca// // Layout.hh // // Copyright (C) : 2000 - 2002 // LifeLine Networks BV (www.lifeline.nl). All rights reserved. // Bastiaan Bakker. All rights reserved. // // 2004,2005,2006,2007,2008,2009,2010,2011,2012 // Synchrotron SOLEIL // L'Orme des Merisiers // Saint-Aubin - BP 48 - France // // This file is part of log4tango. // // Log4ango 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. // // Log4tango 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 Log4Tango. If not, see . #ifndef _LOG4TANGO_LAYOUT_H #define _LOG4TANGO_LAYOUT_H #include #include #include #include namespace log4tango { //----------------------------------------------------------------------------- // class : Appender (abstract class) //----------------------------------------------------------------------------- class LOG4TANGO_EXPORT Layout { public: /** * Constructor for Layout. **/ Layout() {}; /** * Destructor for Layout. **/ virtual ~Layout() {}; /** * Formats the LoggingEvent data to a string that appenders can log. * Overload this method to create your own layout format. * @param event The LoggingEvent. * @returns an appendable string. **/ virtual std::string format (const LoggingEvent& event); }; } // namespace log4tango #endif // _LOG4TANGO_LAYOUT_H tango-8.1.2c+dfsg.orig/lib/cpp/log4tango/include/log4tango/Makefile.in0000644000175000017500000005074212205375130024415 0ustar piccapicca# Makefile.in generated by automake 1.11.3 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 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. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ subdir = include/log4tango DIST_COMMON = $(liblog4tangoinclude_HEADERS) $(srcdir)/Makefile.am \ $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/AC_CREATE_PREFIX_CONFIG_H.m4 \ $(top_srcdir)/m4/AC_CXX_HAVE_SSTREAM.m4 \ $(top_srcdir)/m4/AC_CXX_NAMESPACES.m4 \ $(top_srcdir)/m4/AC_C_INT64_T.m4 \ $(top_srcdir)/m4/AC_FUNC_SNPRINTF.m4 \ $(top_srcdir)/m4/BB_CHECK_PTHREADS.m4 \ $(top_srcdir)/m4/BB_ENABLE_DOXYGEN.m4 \ $(top_srcdir)/m4/CREATE_GENERIC_CONFIG.m4 \ $(top_srcdir)/m4/PETI_PEDANTIC_GCC.m4 \ $(top_srcdir)/m4/RSSH_CHECK_SUNPRO_CC.m4 \ $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/configure.in am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(SHELL) $(top_srcdir)/config/mkinstalldirs CONFIG_HEADER = $(top_builddir)/include/config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = SOURCES = DIST_SOURCES = RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \ html-recursive info-recursive install-data-recursive \ install-dvi-recursive install-exec-recursive \ install-html-recursive install-info-recursive \ install-pdf-recursive install-ps-recursive install-recursive \ installcheck-recursive installdirs-recursive pdf-recursive \ ps-recursive uninstall-recursive 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)$(liblog4tangoincludedir)" HEADERS = $(liblog4tangoinclude_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 ETAGS = etags CTAGS = ctags DIST_SUBDIRS = $(SUBDIRS) DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) am__relativize = \ dir0=`pwd`; \ sed_first='s,^\([^/]*\)/.*$$,\1,'; \ sed_rest='s,^[^/]*/*,,'; \ sed_last='s,^.*/\([^/]*\)$$,\1,'; \ sed_butlast='s,/*[^/]*$$,,'; \ while test -n "$$dir1"; do \ first=`echo "$$dir1" | sed -e "$$sed_first"`; \ if test "$$first" != "."; then \ if test "$$first" = ".."; then \ dir2=`echo "$$dir0" | sed -e "$$sed_last"`/"$$dir2"; \ dir0=`echo "$$dir0" | sed -e "$$sed_butlast"`; \ else \ first2=`echo "$$dir2" | sed -e "$$sed_first"`; \ if test "$$first2" = "$$first"; then \ dir2=`echo "$$dir2" | sed -e "$$sed_rest"`; \ else \ dir2="../$$dir2"; \ fi; \ dir0="$$dir0"/"$$first"; \ fi; \ fi; \ dir1=`echo "$$dir1" | sed -e "$$sed_rest"`; \ done; \ reldir="$$dir2" ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DOT = @DOT@ DOXYGEN = @DOXYGEN@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ GENERIC_CONFIG = @GENERIC_CONFIG@ GREP = @GREP@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ LT_VERSION = @LT_VERSION@ MAINT = @MAINT@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ VERSION = @VERSION@ 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@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ enable_dot = @enable_dot@ enable_html_docs = @enable_html_docs@ enable_latex_docs = @enable_latex_docs@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ SUBDIRS = threading liblog4tangoincludedir = $(includedir)/tango/log4tango liblog4tangoinclude_HEADERS = \ Appender.hh \ AppenderAttachable.hh \ LayoutAppender.hh \ FileAppender.hh \ RollingFileAppender.hh \ OstreamAppender.hh \ Layout.hh \ PatternLayout.hh \ XmlLayout.hh \ Logger.hh \ LogSeparator.hh \ LoggerStream.hh \ LogStream.hh \ LogStreambuf.hh \ LoggingEvent.hh \ Level.hh \ NDC.hh \ TimeStamp.hh \ Filter.hh \ Export.hh \ Portability.hh \ config.h \ config-win32.h all: all-recursive .SUFFIXES: $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu include/log4tango/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu include/log4tango/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs install-liblog4tangoincludeHEADERS: $(liblog4tangoinclude_HEADERS) @$(NORMAL_INSTALL) test -z "$(liblog4tangoincludedir)" || $(MKDIR_P) "$(DESTDIR)$(liblog4tangoincludedir)" @list='$(liblog4tangoinclude_HEADERS)'; test -n "$(liblog4tangoincludedir)" || list=; \ 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)$(liblog4tangoincludedir)'"; \ $(INSTALL_HEADER) $$files "$(DESTDIR)$(liblog4tangoincludedir)" || exit $$?; \ done uninstall-liblog4tangoincludeHEADERS: @$(NORMAL_UNINSTALL) @list='$(liblog4tangoinclude_HEADERS)'; test -n "$(liblog4tangoincludedir)" || list=; \ files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ dir='$(DESTDIR)$(liblog4tangoincludedir)'; $(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. $(RECURSIVE_TARGETS): @fail= failcom='exit 1'; \ for f in x $$MAKEFLAGS; do \ case $$f in \ *=* | --[!k]*);; \ *k*) failcom='fail=yes';; \ esac; \ done; \ dot_seen=no; \ target=`echo $@ | sed s/-recursive//`; \ list='$(SUBDIRS)'; for subdir in $$list; do \ echo "Making $$target in $$subdir"; \ if test "$$subdir" = "."; then \ dot_seen=yes; \ local_target="$$target-am"; \ else \ local_target="$$target"; \ fi; \ ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ || eval $$failcom; \ done; \ if test "$$dot_seen" = "no"; then \ $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \ fi; test -z "$$fail" $(RECURSIVE_CLEAN_TARGETS): @fail= failcom='exit 1'; \ for f in x $$MAKEFLAGS; do \ case $$f in \ *=* | --[!k]*);; \ *k*) failcom='fail=yes';; \ esac; \ done; \ dot_seen=no; \ case "$@" in \ distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \ *) list='$(SUBDIRS)' ;; \ esac; \ rev=''; for subdir in $$list; do \ if test "$$subdir" = "."; then :; else \ rev="$$subdir $$rev"; \ fi; \ done; \ rev="$$rev ."; \ target=`echo $@ | sed s/-recursive//`; \ for subdir in $$rev; do \ echo "Making $$target in $$subdir"; \ if test "$$subdir" = "."; then \ local_target="$$target-am"; \ else \ local_target="$$target"; \ fi; \ ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ || eval $$failcom; \ done && test -z "$$fail" tags-recursive: list='$(SUBDIRS)'; for subdir in $$list; do \ test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \ done ctags-recursive: list='$(SUBDIRS)'; for subdir in $$list; do \ test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \ done ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ mkid -fID $$unique tags: TAGS TAGS: tags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) set x; \ here=`pwd`; \ if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \ include_option=--etags-include; \ empty_fix=.; \ else \ include_option=--include; \ empty_fix=; \ fi; \ list='$(SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ test ! -f $$subdir/TAGS || \ set "$$@" "$$include_option=$$here/$$subdir/TAGS"; \ fi; \ done; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: CTAGS CTAGS: ctags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ 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 \ dir1=$$subdir; dir2="$(distdir)/$$subdir"; \ $(am__relativize); \ new_distdir=$$reldir; \ dir1=$$subdir; dir2="$(top_distdir)"; \ $(am__relativize); \ new_top_distdir=$$reldir; \ echo " (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir="$$new_top_distdir" distdir="$$new_distdir" \\"; \ echo " am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)"; \ ($(am__cd) $$subdir && \ $(MAKE) $(AM_MAKEFLAGS) \ top_distdir="$$new_top_distdir" \ distdir="$$new_distdir" \ am__remove_distdir=: \ am__skip_length_check=: \ am__skip_mode_fix=: \ distdir) \ || exit 1; \ fi; \ done $(MAKE) $(AM_MAKEFLAGS) \ top_distdir="$(top_distdir)" distdir="$(distdir)" \ dist-hook check-am: all-am check: check-recursive all-am: Makefile $(HEADERS) installdirs: installdirs-recursive installdirs-am: for dir in "$(DESTDIR)$(liblog4tangoincludedir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done install: install-recursive install-exec: install-exec-recursive install-data: install-data-recursive uninstall: uninstall-recursive install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-recursive install-strip: 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: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-recursive clean-am: clean-generic clean-libtool mostlyclean-am distclean: distclean-recursive -rm -f Makefile distclean-am: clean-am distclean-generic distclean-local \ distclean-tags dvi: dvi-recursive dvi-am: html: html-recursive html-am: info: info-recursive info-am: install-data-am: install-liblog4tangoincludeHEADERS install-dvi: install-dvi-recursive install-dvi-am: install-exec-am: install-html: install-html-recursive install-html-am: install-info: install-info-recursive install-info-am: install-man: install-pdf: install-pdf-recursive install-pdf-am: install-ps: install-ps-recursive install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-recursive -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-recursive mostlyclean-am: mostlyclean-generic mostlyclean-libtool pdf: pdf-recursive pdf-am: ps: ps-recursive ps-am: uninstall-am: uninstall-liblog4tangoincludeHEADERS .MAKE: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) ctags-recursive \ install-am install-strip tags-recursive .PHONY: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) CTAGS GTAGS \ all all-am check check-am clean clean-generic clean-libtool \ ctags ctags-recursive dist-hook distclean 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-liblog4tangoincludeHEADERS 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-generic mostlyclean-libtool pdf pdf-am ps ps-am \ tags tags-recursive uninstall uninstall-am \ uninstall-liblog4tangoincludeHEADERS dist-hook: rm -f $(distdir)/config.h distclean-local: rm config.h # 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: tango-8.1.2c+dfsg.orig/lib/cpp/log4tango/include/log4tango/RollingFileAppender.hh0000644000175000017500000000435412205375130026554 0ustar piccapicca// // RollingFileAppender.hh // // Copyright (C) : 2000 - 2002 // LifeLine Networks BV (www.lifeline.nl). All rights reserved. // Bastiaan Bakker. All rights reserved. // // 2004,2005,2006,2007,2008,2009,2010,2011,2012 // Synchrotron SOLEIL // L'Orme des Merisiers // Saint-Aubin - BP 48 - France // // This file is part of log4tango. // // Log4ango 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. // // Log4tango 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 Log4Tango. If not, see . #ifndef _LOG4TANGO_ROLLINGFILEAPPENDER_H #define _LOG4TANGO_ROLLINGFILEAPPENDER_H #include #include namespace log4tango { //----------------------------------------------------------------------------- // class RollingFileAppender (olls over the logfile) //----------------------------------------------------------------------------- class LOG4TANGO_EXPORT RollingFileAppender : public FileAppender { public: RollingFileAppender(const std::string& name, const std::string& file_name, size_t max_fs = 10*1024*1024, unsigned int max_bi = 1, bool append = true, mode_t mode = 00644); virtual void set_max_backup_index(unsigned int maxBackups); virtual unsigned int get_max_backup_index() const; virtual void set_maximum_file_size (size_t max_fs); virtual size_t get_max_file_size() const; virtual void roll_over(); protected: virtual int _append (const LoggingEvent& event); unsigned int _max_backup_index; size_t _max_file_size; }; } // namespace log4tango #endif // _LOG4TANGO_ROLLINGFILEAPPENDER_H tango-8.1.2c+dfsg.orig/lib/cpp/log4tango/include/log4tango/LogStream.hh0000644000175000017500000000431512205375130024561 0ustar piccapicca// // LogStream.hh // // Copyright (C) : 2000 - 2002 // LifeLine Networks BV (www.lifeline.nl). All rights reserved. // Bastiaan Bakker. All rights reserved. // // 2004,2005,2006,2007,2008,2009,2010,2011,2012 // Synchrotron SOLEIL // L'Orme des Merisiers // Saint-Aubin - BP 48 - France // // This file is part of log4tango. // // Log4ango 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. // // Log4tango 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 Log4Tango. If not, see . #ifndef _LOG4TANGO_LOG_STREAM_H #define _LOG4TANGO_LOG_STREAM_H #include #ifdef LOG4TANGO_HAVE_SSTREAM # include #else # include #endif #include #include #include namespace log4tango { //----------------------------------------------------------------------------- // Class : LogStream //----------------------------------------------------------------------------- class LOG4TANGO_EXPORT LogStream { protected: threading::RecursiveMutex _rmutex; std::ostream _ostream; public: LogStream(LogStreamBuf* stream_buf); virtual ~LogStream(); inline LogStream& operator<< (const LogInitiator&) { return *this; } template LogStream& operator<< (const T& t) { _rmutex.lock(); _ostream << t; return *this; } inline LogStream& operator<< (LogSeparator&) { _rmutex.lock(); _ostream.flush(); _rmutex.unlockn(); return *this; } }; inline std::ostream& operator<< (std::ostream& o_str, LogSeparator&) { o_str.flush(); return o_str; } } // namespace log4tango #endif // _LOG4TANGO_LOG_STREAM_H tango-8.1.2c+dfsg.orig/lib/cpp/log4tango/include/log4tango/FileAppender.hh0000644000175000017500000000676312205375130025233 0ustar piccapicca// // FileAppender.hh // // Copyright (C) : 2000 - 2002 // LifeLine Networks BV (www.lifeline.nl). All rights reserved. // Bastiaan Bakker. All rights reserved. // // 2004,2005,2006,2007,2008,2009,2010,2011,2012 // Synchrotron SOLEIL // L'Orme des Merisiers // Saint-Aubin - BP 48 - France // // This file is part of log4tango. // // Log4ango 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. // // Log4tango 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 Log4Tango. If not, see . #ifndef _LOG4TANGO_FILEAPPENDER_H #define _LOG4TANGO_FILEAPPENDER_H #include #include namespace log4tango { //----------------------------------------------------------------------------- // class : FileAppender //----------------------------------------------------------------------------- class LOG4TANGO_EXPORT FileAppender : public LayoutAppender { public: /** Constructs a FileAppender. @param name the name of the Appender. @param fileName the name of the file to which the Appender has to log. @param append whether the Appender has to truncate the file or just append to it if it already exists. Defaults to 'true'. @param mode file mode to open the logfile with. Defaults to 00644. **/ FileAppender(const std::string& name, const std::string& fileName, bool append = true, mode_t mode = 00644); /** Constructs a FileAppender to an already open file descriptor. @param name the name of the Appender. @param fd the file descriptor to which the Appender has to log. **/ FileAppender(const std::string& name, int fd); /** Destructor **/ virtual ~FileAppender(); /** Reopens the logfile. This can be useful for logfiles that are rotated externally, e.g. by logrotate. This method is a NOOP for FileAppenders that have been constructed with a file descriptor. @returns true if the reopen succeeded. **/ virtual bool reopen (void); /** Closes the logfile. **/ virtual void close (void); /** * Check if the appender is valid. * * @returns true if the appender is valid, false otherwise. **/ virtual bool is_valid (void) const; /** Sets the append vs truncate flag. NB. currently the FileAppender opens the logfile in the constructor. Therefore this method is too late to influence the first file opening. We'll need something similar to log4j's activateOptions(). @param append false to truncate, true to append **/ virtual void set_append (bool append); /** Gets the value of the 'append' option. **/ virtual bool get_append (void) const; /** Sets the file open mode. **/ virtual void set_mode (mode_t mode); /** Gets the file open mode. **/ virtual mode_t get_mode() const; protected: virtual int _append (const LoggingEvent& event); const std::string _file_name; int _fd; int _flags; mode_t _mode; }; } // namespace log4tango #endif // _LOG4TANGO_FILEAPPENDER_H tango-8.1.2c+dfsg.orig/lib/cpp/log4tango/include/log4tango/Filter.hh0000644000175000017500000001060712205375130024112 0ustar piccapicca// // Filter.hh // // Copyright (C) : 2000 - 2002 // LifeLine Networks BV (www.lifeline.nl). All rights reserved. // Bastiaan Bakker. All rights reserved. // // 2004,2005,2006,2007,2008,2009,2010,2011,2012 // Synchrotron SOLEIL // L'Orme des Merisiers // Saint-Aubin - BP 48 - France // // This file is part of log4tango. // // Log4ango 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. // // Log4tango 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 Log4Tango. If not, see . #ifndef _LOG4TANGO_FILTER_HH #define _LOG4TANGO_FILTER_HH #ifdef APPENDERS_HAVE_FILTERS #include #include namespace log4tango { /** Users should extend this class to implement customized logging event filtering. Note that {@link log4tango::Logger} and {@link log4tango::Appender} have built-in filtering rules. It is suggested that you first use and understand the built-in rules before rushing to write your own custom filters.

This abstract class assumes and also imposes that filters be organized in a linear chain. The decide(LoggingEvent) method of each filter is called sequentially, in the order of their addition to the chain.

The decide(LoggingEvent) method must return a Decision value, either DENY, NEUTRAL or ACCCEPT.

If the value DENY is returned, then the log event is dropped immediately without consulting with the remaining filters.

If the value NEUTRAL is returned, then the next filter in the chain is consulted. If there are no more filters in the chain, then the log event is logged. Thus, in the presence of no filters, the default behaviour is to log all logging events.

If the value ACCEPT is returned, then the log event is logged without consulting the remaining filters.

The philosophy of log4tango filters is largely inspired from the Linux ipchains. **/ //----------------------------------------------------------------------------- // class : Filter //----------------------------------------------------------------------------- class LOG4TANGO_EXPORT Filter { public: typedef enum { DENY = -1, NEUTRAL = 0, ACCEPT = 1 } Decision; /** * Default Constructor for Filter **/ Filter (); /** * Destructor for Filter **/ virtual ~Filter (); /** * Set the next Filter in the Filter chain * @param filter The filter to chain **/ void set_chained_filter (Filter* filter); /** * Get the next Filter in the Filter chain * @return The next Filter or NULL if the current filter * is the last in the chain **/ inline Filter* Filter::get_chained_filter (void) { return _chain; } /** * Get the last Filter in the Filter chain * @return The last Filter in the Filter chain **/ virtual Filter* get_end_of_chain (void); /** * Add a Filter to the end of the Filter chain. Convience method for * getEndOfChain()->set_chained_filter(filter). * @param filter The filter to add to the end of the chain. **/ virtual void append_chained_filter (Filter* filter); /** * Decide whether to accept or deny a LoggingEvent. This method will * walk the entire chain until a non neutral decision has been made * or the end of the chain has been reached. * @param event The LoggingEvent to decide on. * @return The Decision **/ virtual Decision decide (const LoggingEvent& event); protected: /** * Decide whether this Filter accepts or denies the given * LoggingEvent. Actual implementation of Filter should override this * method and not decide(LoggingEvent&). * @param event The LoggingEvent to decide on. * @return The Decision **/ virtual Decision _decide (const LoggingEvent& event) = 0; private: Filter* _chain; }; } // namespace log4tango #endif // APPENDERS_HAVE_FILTERS #endif // _LOG4TANGO_FILTER_HH tango-8.1.2c+dfsg.orig/lib/cpp/log4tango/include/log4tango/config-win32.h0000644000175000017500000000774612205375130024734 0ustar piccapicca// // config-win32.hh // // Copyright (C) : 2000 - 2002 // LifeLine Networks BV (www.lifeline.nl). All rights reserved. // Bastiaan Bakker. All rights reserved. // // 2004,2005,2006,2007,2008,2009,2010,2011,2012 // Synchrotron SOLEIL // L'Orme des Merisiers // Saint-Aubin - BP 48 - France // // This file is part of log4tango. // // Log4ango 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. // // Log4tango 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 Log4Tango. If not, see . #ifndef _INCLUDE_LOG4TANGO_CONFIG_WIN32_H #define _INCLUDE_LOG4TANGO_CONFIG_WIN32_H 1 /* manually edited from include/log4tango/config.h */ /* Define if you have the syslog function. */ /* #undef LOG4TANGO_HAVE_SYSLOG */ /* Define if you have the `ftime' function. */ #ifndef LOG4TANGO_HAVE_FTIME # define LOG4TANGO_HAVE_FTIME 1 #endif /* Define if you have the `gettimeofday' function. */ /* #undef LOG4TANGO_HAVE_GETTIMEOFDAY */ /* define if the compiler has int64_t */ #ifndef LOG4TANGO_HAVE_INT64_T #define LOG4TANGO_HAVE_INT64_T //#define int64_t __int64 typedef __int64 int64_t; #if defined(_MSC_VER) && _MSC_VER < 1300 # define LOG4TANGO_MISSING_INT64_OSTREAM_OP #endif #endif /* Define if you have the header file. */ #ifndef LOG4TANGO_HAVE_IO_H # define LOG4TANGO_HAVE_IO_H 1 #endif /* Define if you have the header file. */ /* #undef LOG4TANGO_HAVE_UNISTD_H */ /* Define if you have the idsa library (-lidsa). */ /* #undef LOG4TANGO_HAVE_LIBIDSA */ /* Define if you have the `strcasecmp' function. */ /* #undef LOG4TANGO_HAVE_STRCASECMP */ /* Name of package */ #ifndef LOG4TANGO_PACKAGE # define LOG4TANGO_PACKAGE "log4tango" #endif /* Version number of package */ #ifndef LOG4TANGO_VERSION # define LOG4TANGO_VERSION "0.3.4" #endif /* define if the compiler implements namespaces */ #ifndef LOG4TANGO_HAVE_NAMESPACES # define LOG4TANGO_HAVE_NAMESPACES 1 #endif /* define if the compiler has stringstream */ #ifndef LOG4TANGO_HAVE_SSTREAM # define LOG4TANGO_HAVE_SSTREAM 1 #endif /* define if the C library has snprintf */ #ifndef LOG4TANGO_HAVE_SNPRINTF # define LOG4TANGO_HAVE_SNPRINTF 1 #endif /* define to get around problems with ERROR in windows.h */ #ifndef LOG4TANGO_FIX_ERROR_COLLISION # define LOG4TANGO_FIX_ERROR_COLLISION 1 #endif /* define WIN32 for Borland */ #ifndef WIN32 # define WIN32 #endif /* use threads */ #ifndef LOG4TANGO_HAVE_THREADING # define LOG4TANGO_HAVE_THREADING #endif /* use ms threads */ #ifndef LOG4TANGO_USE_MSTHREADS # define LOG4TANGO_USE_MSTHREADS #endif /* supply DLL main */ #ifndef LOG4TANGO_SUPPLY_DLLMAIN # define LOG4TANGO_SUPPLY_DLLMAIN #endif /* MSVCs and headers are broken in the sense that they put functions in the global namespace instead of std:: The #defines below enable a workaround for MSVC 6 and lower. If MSVC 7 is still broken please adjust the _MSC_VER version check and report it. See also bug report #628211. */ #if defined(_MSC_VER) && _MSC_VER < 1300 #ifndef LOG4TANGO_CSTDLIB_NOT_IN_STD # define LOG4TANGO_CSTDLIB_NOT_IN_STD #endif #ifndef LOG4TANGO_CSTRING_NOT_IN_STD # define LOG4TANGO_CSTRING_NOT_IN_STD #endif #ifndef LOG4TANGO_CTIME_NOT_IN_STD # define LOG4TANGO_CTIME_NOT_IN_STD #endif #ifndef LOG4TANGO_CMATH_NOT_IN_STD # define LOG4TANGO_CMATH_NOT_IN_STD #endif #endif /* define mode_t. Move to Portability.hh if more platforms need it */ namespace log4tango { typedef unsigned short mode_t; } /* _INCLUDE_LOG4TANGO_CONFIG_WIN32_H */ #endif tango-8.1.2c+dfsg.orig/lib/cpp/log4tango/include/log4tango/Level.hh0000644000175000017500000000654712205375130023744 0ustar piccapicca// // Level.hh // // Copyright (C) : 2000 - 2002 // LifeLine Networks BV (www.lifeline.nl). All rights reserved. // Bastiaan Bakker. All rights reserved. // // 2004,2005,2006,2007,2008,2009,2010,2011,2012 // Synchrotron SOLEIL // L'Orme des Merisiers // Saint-Aubin - BP 48 - France // // This file is part of log4tango. // // Log4ango 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. // // Log4tango 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 Log4Tango. If not, see . #ifndef _LOG4TANGO_LEVEL_H #define _LOG4TANGO_LEVEL_H #include #include #include /* * Optionally work around rudeness in windows.h on Win32. */ #ifdef ERROR #ifdef LOG4TANGO_FIX_ERROR_COLLISION namespace log4tango { static const int _tmpERRORValue = ERROR; } #undef ERROR static const int ERROR = log4tango::_tmpERRORValue; #define ERROR ERROR #else // LOG4TANGO_FIX_ERROR_COLLISION #error Naming collision for 'ERROR' detected. Please read the FAQ for a \ workaround. #endif // LOG4TANGO_FIX_ERROR_COLLISION #endif // ERROR /* * Other Win32 rudeness in EDK.h */ #ifdef DEBUG #ifdef LOG4TANGO_FIX_ERROR_COLLISION #undef DEBUG #define DEBUG DEBUG #else // LOG4TANGO_FIX_ERROR_COLLISION #error Naming collision for 'DEBUG' detected. Please read the FAQ for a \ workaround. #endif // LOG4TANGO_FIX_ERROR_COLLISION #endif // DEBUG namespace log4tango { //----------------------------------------------------------------------------- // class : Level //----------------------------------------------------------------------------- class LOG4TANGO_EXPORT Level { public: /** * Levels of Priorities. **/ typedef enum { OFF = 100, FATAL = 200, ERROR = 300, WARN = 400, INFO = 500, DEBUG = 600 } LevelLevel; /** * The type of Level Values **/ typedef int Value; /** * Returns the name of the given level value. * Currently, if the value is not one of the LevelLevel values, * the method returns the name of the largest level smaller * the given value. * @param level the numeric value of the level. * @returns a string representing the name of the level. **/ static const std::string& get_name (Value level); /** * Returns the value of the given level name. * This can be either one of "OFF", "ERRROR", ... or a * decimal string representation of the value, e.g. '500' for DEBUG. * @param level_name the string containing the the of the level * @return the value corresponding with the level name * @throw std::invalid_argument if the level_name does not * correspond with a known Level name or a number **/ static Value get_value (const std::string& level_name) throw(std::invalid_argument); }; } // namespace log4tango #endif // _LOG4TANGO_LEVEL_H tango-8.1.2c+dfsg.orig/lib/cpp/log4tango/include/log4tango/Portability.hh0000644000175000017500000000364112205375130025167 0ustar piccapicca// // Portability.hh // // Copyright (C) : 2000 - 2002 // LifeLine Networks BV (www.lifeline.nl). All rights reserved. // Bastiaan Bakker. All rights reserved. // // 2004,2005,2006,2007,2008,2009,2010,2011,2012 // Synchrotron SOLEIL // L'Orme des Merisiers // Saint-Aubin - BP 48 - France // // This file is part of log4tango. // // Log4ango 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. // // Log4tango 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 Log4Tango. If not, see . #ifndef _LOG4TANGO_PORTABILITY_H #define _LOG4TANGO_PORTABILITY_H #if defined (_MSC_VER) || defined(__BORLANDC__) # include #else # include #endif #include #if defined(_MSC_VER) # pragma warning( disable : 4786 ) // 255 char debug symbol limit # pragma warning( disable : 4290 ) // throw specifier not implemented # pragma warning( disable : 4251 ) // "class XXX should be exported" #define LOG4TANGO_UNUSED(var) var #else #ifdef __GNUC__ #define LOG4TANGO_UNUSED(var) var __attribute__ ((unused)) #else #define LOG4TANGO_UNUSED(var) var #endif #endif #ifndef LOG4TANGO_HAVE_SSTREAM #include namespace std { class LOG4TANGO_EXPORT ostringstream : public ostrstream { public: std::string str(); void str (const char*); }; } #endif // LOG4TANGO_HAVE_SSTREAM #endif // _LOG4TANGO_PORTABILITY_H tango-8.1.2c+dfsg.orig/lib/cpp/log4tango/include/log4tango/Makefile.am0000644000175000017500000000110112205375130024365 0ustar piccapiccaSUBDIRS = threading liblog4tangoincludedir = $(includedir)/tango/log4tango liblog4tangoinclude_HEADERS = \ Appender.hh \ AppenderAttachable.hh \ LayoutAppender.hh \ FileAppender.hh \ RollingFileAppender.hh \ OstreamAppender.hh \ Layout.hh \ PatternLayout.hh \ XmlLayout.hh \ Logger.hh \ LogSeparator.hh \ LoggerStream.hh \ LogStream.hh \ LogStreambuf.hh \ LoggingEvent.hh \ Level.hh \ NDC.hh \ TimeStamp.hh \ Filter.hh \ Export.hh \ Portability.hh \ config.h \ config-win32.h dist-hook: rm -f $(distdir)/config.h distclean-local: rm config.h tango-8.1.2c+dfsg.orig/lib/cpp/log4tango/include/log4tango/Export.hh0000644000175000017500000000247112205375130024146 0ustar piccapicca// // Export.hh // // Copyright (C) : 2000 - 2002 // LifeLine Networks BV (www.lifeline.nl). All rights reserved. // Bastiaan Bakker. All rights reserved. // // 2004,2005,2006,2007,2008,2009,2010,2011,2012 // Synchrotron SOLEIL // L'Orme des Merisiers // Saint-Aubin - BP 48 - France // // This file is part of log4tango. // // Log4ango 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. // // Log4tango 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 Log4Tango. If not, see . #ifndef _LOG4TANGO_EXPORT_H #define _LOG4TANGO_EXPORT_H #ifdef LOG4TANGO_HAS_DLL # ifdef LOG4TANGO_BUILD_DLL # define LOG4TANGO_EXPORT __declspec(dllexport) # else # define LOG4TANGO_EXPORT __declspec(dllimport) # endif #else # define LOG4TANGO_EXPORT #endif #endif // _LOG4TANGO_EXPORT_H tango-8.1.2c+dfsg.orig/lib/cpp/log4tango/include/log4tango/LoggerStream.hh0000644000175000017500000001222512205375130025256 0ustar piccapicca// // LoggerStream.hh // // Copyright (C) : 2000 - 2002 // LifeLine Networks BV (www.lifeline.nl). All rights reserved. // Bastiaan Bakker. All rights reserved. // // 2004,2005,2006,2007,2008,2009,2010,2011,2012 // Synchrotron SOLEIL // L'Orme des Merisiers // Saint-Aubin - BP 48 - France // // This file is part of log4tango. // // Log4ango 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. // // Log4tango 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 Log4Tango. If not, see . #ifndef _LOG4TANGO_LOGGER_STREAM_H #define _LOG4TANGO_LOGGER_STREAM_H #include #include #ifdef LOG4TANGO_HAVE_SSTREAM # include #endif #include namespace log4tango { //----------------------------------------------------------------------------- // FORWARD DECLARATION //----------------------------------------------------------------------------- class LOG4TANGO_EXPORT Logger; class LoggerStream; //----------------------------------------------------------------------------- // DEFINE WHAT IS A LS_TERMINATOR //----------------------------------------------------------------------------- typedef LoggerStream& (*ls_terminator) (LoggerStream&); typedef class std::ios_base&(*StdIosFlag)(class std::ios_base&); //----------------------------------------------------------------------------- // class : LoggerStream //----------------------------------------------------------------------------- class LoggerStream { public: /** * Construct a LoggerStream for given Logger with given level. * @param logger The logger this stream will send log messages to. * @param level The level the log messages will get or * Level::NOTSET to silently discard any streamed in messages. * @param filter The filter flag **/ LOG4TANGO_EXPORT LoggerStream(Logger& logger, Level::Value level, bool filter = true); /** * Destructor for LoggerStream&) **/ LOG4TANGO_EXPORT ~LoggerStream(); /** * Returns the destination Logger for this stream. * @returns The Logger. **/ inline LOG4TANGO_EXPORT Logger& get_logger (void) const { return _logger; }; /** * Returns the level for this stream. * @returns The level. **/ inline LOG4TANGO_EXPORT Level::Value get_level (void) const { return _level; }; /** * Streams in a Initiator. Just a trick to return a ref to self. * @param i The log initiator * @returns A reference to itself. **/ inline LOG4TANGO_EXPORT LoggerStream& operator<< (LOG4TANGO_UNUSED(LogInitiator& i)) { return *this; } /** * Streams in a Separator.Sends the contents of the stream buffer * to the Logger with set level and empties the buffer. * @param s The log separator * @returns A reference to itself. **/ inline LOG4TANGO_EXPORT LoggerStream& operator<< (LOG4TANGO_UNUSED(LogSeparator& s)) { flush(); return *this; } /** * Streams in a ls_manipulator. Sends the contents of the stream buffer * to the Logger with set level and empties the buffer. * @param endoflog The log terminator * @returns A reference to itself. **/ inline LOG4TANGO_EXPORT LoggerStream& operator<< (LOG4TANGO_UNUSED(ls_terminator endoflog)) { flush(); return *this; } /** * Flush the contents of the stream buffer to the Logger and * empties the buffer. **/ LOG4TANGO_EXPORT void flush (void); /** * Streams in a std stream manipulator. * @param _F the manipulator function * @returns a reference to self. **/ #ifdef WIN32 inline LOG4TANGO_EXPORT LoggerStream& operator<< (std::ios_base&(_cdecl *_F)(std::ios_base&)) { #else inline LOG4TANGO_EXPORT LoggerStream& operator<< (std::ios_base&(*_F)(std::ios_base&)) { #endif #ifndef LOG4TANGO_HAVE_SSTREAM if (!_buffer) _buffer = new std::ostringstream; #endif if (_buffer) (*_F)(*(std::ios_base *)(_buffer)); return *this; } /** * Stream in arbitrary types and objects. * @param t The value or object to stream in. * @returns A reference to itself. **/ template LoggerStream& operator<< (const T& t) { if (_level != Level::OFF) { #ifndef LOG4TANGO_HAVE_SSTREAM if (!_buffer) _buffer = new std::ostringstream; #endif if (_buffer) (*_buffer) << t; } return *this; } private: Logger& _logger; Level::Value _level; bool _filter; std::ostringstream* _buffer; }; } // namespace log4tango namespace std { //-- A dummy inline log4tango::LoggerStream& endl (log4tango::LoggerStream& ls) { return ls; } } // namespace std #endif // _LOG4TANGO_LOGGER_STREAM_H tango-8.1.2c+dfsg.orig/lib/cpp/log4tango/include/log4tango/NDC.hh0000644000175000017500000001436012205375130023271 0ustar piccapicca// // NDC.hh // // Copyright (C) : 2000 - 2002 // LifeLine Networks BV (www.lifeline.nl). All rights reserved. // Bastiaan Bakker. All rights reserved. // // 2004,2005,2006,2007,2008,2009,2010,2011,2012 // Synchrotron SOLEIL // L'Orme des Merisiers // Saint-Aubin - BP 48 - France // // This file is part of log4tango. // // Log4ango 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. // // Log4tango 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 Log4Tango. If not, see . #ifndef _LOG4TANGO_NDC_H #define _LOG4TANGO_NDC_H #ifdef LOG4TANGO_HAS_NDC #include #include #include namespace log4tango { /** The NDC class implements nested diagnostic contexts as defined by Neil Harrison in the article "Patterns for Logging Diagnostic Messages" part of the book "Pattern Languages of Program Design 3" edited by Martin et al.

A Nested Diagnostic Context, or NDC in short, is an instrument to distinguish interleaved log output from different sources. Log output is typically interleaved when a server handles multiple clients near-simulatanously.

Interleaved log output can still be meaningful if each log entry from different contexts had a distinctive stamp. This is where NDCs come into play.

Note that NDCs are managed on a per thread basis. NDC operations such as push, pop, clear, get_depth and set_max_depth affect the NDC of the current thread only. NDCs of other threads remain unaffected.

To build an NDC one uses the push operation. Simply put,

  • Contexts can be nested.

  • When entering a context, call NDC.push. As a side effect, if there is no nested diagnostic context for the current thread, this method will create it.

  • When leaving a context, call NDC.pop.

There is no penalty for forgetting to match each push operation with a corresponding pop, except the obvious mismatch between the real application context and the context set in the NDC.

Custom Layouts may include the nested diagnostic context for the current thread in log messages, without any user intervention. Hence, even if a server is serving multiple clients simultaneously, the logs emanating from the same code (belonging to the same logger) can still be distinguished because each client request will have a different NDC tag.

Unfortunately, unlike Java, C++ does not have platform independent multithreading support. Therefore, currently log4tango is not multithread aware, it implicitly assumes only one thread exists, the main process thread. **/ class LOG4TANGO_EXPORT NDC { public: struct DiagnosticContext { DiagnosticContext(const std::string& message); DiagnosticContext(const std::string& message, const DiagnosticContext& parent); std::string message; std::string full_msg; }; typedef std::vector ContextStack; /** Clear any nested disgnostic information if any. This method is useful in cases where the same thread can be potentially used over and over in different unrelated contexts.

This method is equivalent to calling the set_max_depth method with a zero max_depth argument. **/ static void clear (void); /** Clone the diagnostic context for the current thread.

Internally a diagnostic context is represented as a stack. A given thread can supply the stack (i.e. diagnostic context) to a child thread so that the child can inherit the parent thread's diagnostic context.

The child thread uses the inherit method to inherit the parent's diagnostic context. @return Stack A clone of the current thread's diagnostic context. **/ static ContextStack* clone_stack (void); /** Get the current diagnostic context string. @return the context string. **/ static const std::string& get (void); /** Get the current nesting depth of this diagnostic context. @return the nesting depth **/ static int get_depth (void); static void inherit (ContextStack* stack); /** Clients should call this method before leaving a diagnostic context.

The returned value is the value that was pushed last. If no context is available, then the empty string "" is returned. @return String The innermost diagnostic context. **/ static std::string pop (void); /** Push new diagnostic context information for the current thread.

The contents of the message parameter is determined solely by the client. @param message The new diagnostic context information. **/ static void push (const std::string& message); /** Set the maximum nesting depth for the current NDC. Curently NDCs do not enforce a maximum depth and consequentially this method has no effect. @param max_depth the maximum nesting depth **/ static void set_max_depth (int max_depth); /** Return the NDC for the current thread. @return the NDC for the current thread **/ static NDC& get_ndc(); NDC(); virtual ~NDC(); public: virtual void _clear (void); virtual ContextStack* _clone_stack (void); virtual const std::string& _get (void) const; virtual int _get_depth (void) const; virtual void _inherit (ContextStack* stack); virtual std::string _pop (void); virtual void _push (const std::string& message); virtual void _set_max_depth (int max_depth); ContextStack _stack; }; } // namespace log4tango #endif // LOG4TANGO_HAS_NDC #endif // _LOG4TANGO_NDC_HH tango-8.1.2c+dfsg.orig/lib/cpp/log4tango/include/log4tango/TimeStamp.hh0000644000175000017500000000577412205375130024601 0ustar piccapicca// // TimeStamp.hh // // Copyright (C) : 2000 - 2002 // LifeLine Networks BV (www.lifeline.nl). All rights reserved. // Bastiaan Bakker. All rights reserved. // // 2004,2005,2006,2007,2008,2009,2010,2011,2012 // Synchrotron SOLEIL // L'Orme des Merisiers // Saint-Aubin - BP 48 - France // // This file is part of log4tango. // // Log4ango 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. // // Log4tango 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 Log4Tango. If not, see . #ifndef _LOG4TANGO_TIMESTAMP_H #define _LOG4TANGO_TIMESTAMP_H #include namespace log4tango { //----------------------------------------------------------------------------- // Class : TimeStamp (timestamp abstraction) //----------------------------------------------------------------------------- class LOG4TANGO_EXPORT TimeStamp { public: /** Constructs a TimeStamp representing 'now'. **/ TimeStamp(); /** Copy Constructor. **/ inline TimeStamp (const TimeStamp& t) : _seconds(t._seconds), _micro_seconds(t._micro_seconds) { //--noop }; /** Constructs a TimeStamp representing the given offset since the epoch ( 00:00:00 1970/1/1 UTC). **/ inline TimeStamp(unsigned int seconds, unsigned int microseconds = 0) : _seconds(seconds), _micro_seconds(microseconds) { //--noop }; /** Returns the 'seconds' part of the TimeStamp. **/ inline int get_seconds (void) const { return _seconds; }; /** Returns the 'subseconds' part of the TimeStamp in milliseconds, get_milliseconds() == get_microseconds() / 1000. **/ inline int get_milliseconds (void) const { return _micro_seconds / 1000; }; /** Returns the subsecond part of the TimeStamp in microseconds. The actual precision of this value depends on the platform and may be in the order of milliseconds rather than microseconds. **/ inline int get_microseconds (void) const { return _micro_seconds; }; /** Returns a TimeStamp representing the time at which the application started. **/ static inline const TimeStamp& get_start_time (void) { return _start_stamp; }; /** Operator= **/ inline void operator= (const TimeStamp& t) { _seconds = t._seconds; _micro_seconds = t._micro_seconds; }; protected: static TimeStamp _start_stamp; int _seconds; int _micro_seconds; }; } // namespace log4tango #endif // _LOG4TANGO_TIMESTAMP_H tango-8.1.2c+dfsg.orig/lib/cpp/log4tango/include/log4tango/LogStreambuf.hh0000644000175000017500000000420512205375130025254 0ustar piccapicca// // LogStreambuf.hh // // Copyright (C) : 2000 - 2002 // LifeLine Networks BV (www.lifeline.nl). All rights reserved. // Bastiaan Bakker. All rights reserved. // // 2004,2005,2006,2007,2008,2009,2010,2011,2012 // Synchrotron SOLEIL // L'Orme des Merisiers // Saint-Aubin - BP 48 - France // // This file is part of log4tango. // // Log4ango 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. // // Log4tango 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 Log4Tango. If not, see . #ifndef _LOG4TANGO_STREAM_BUFFER_H #define _LOG4TANGO_STREAM_BUFFER_H #include #include //----------------------------------------------------------------------------- // #DEFINES //----------------------------------------------------------------------------- #define kDEFAULT_BUFFER_SIZE 512 namespace log4tango { //----------------------------------------------------------------------------- // Class : LogStreamBuf //----------------------------------------------------------------------------- class LOG4TANGO_EXPORT LogStreamBuf : public std::streambuf { friend class LogStream; public: LogStreamBuf (Logger* logger, Level::Value level, bool filter = true, size_t bsize = kDEFAULT_BUFFER_SIZE); virtual ~LogStreamBuf(); protected: virtual std::streamsize xsputn (const char*, std::streamsize); virtual int sync (void); private: int flush_buffer (void); char *_buffer; Logger* _logger; Level::Value _level; bool _filter; }; } // namespace log4tango #endif // _LOG4TANGO_STREAM_BUFFER_H tango-8.1.2c+dfsg.orig/lib/cpp/log4tango/include/Makefile.am0000644000175000017500000000002412205375130022472 0ustar piccapiccaSUBDIRS = log4tango tango-8.1.2c+dfsg.orig/lib/cpp/log4tango/config/0000755000175000017500000000000012205375305020270 5ustar piccapiccatango-8.1.2c+dfsg.orig/lib/cpp/log4tango/config/depcomp0000755000175000017500000003554512205375130021655 0ustar piccapicca#! /bin/sh # depcomp - compile a program generating dependencies as side-effects scriptversion=2004-05-31.23 # Copyright (C) 1999, 2000, 2003, 2004 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., 59 Temple Place - Suite 330, Boston, MA # 02111-1307, USA. # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that program. # Originally written by Alexandre Oliva . case $1 in '') echo "$0: No command. Try \`$0 --help' for more information." 1>&2 exit 1; ;; -h | --h*) cat <<\EOF Usage: depcomp [--help] [--version] PROGRAM [ARGS] Run PROGRAMS ARGS to compile a file, generating dependencies as side-effects. Environment variables: depmode Dependency tracking mode. 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. libtool Whether libtool is used (yes/no). Report bugs to . EOF exit 0 ;; -v | --v*) echo "depcomp $scriptversion" exit 0 ;; esac 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 fi # Dependencies for sub/bar.o or sub/bar.obj go into sub/.deps/bar.Po. depfile=${depfile-`echo "$object" | sed 's|[^\\/]*$|'${DEPDIR-.deps}'/&|;s|\.\([^.]*\)$|.P\1|;s|Pobj$|Po|'`} tmpdepfile=${tmpdepfile-`echo "$depfile" | sed 's/\.\([^.]*\)$/.T\1/'`} rm -f "$tmpdepfile" # Some modes work just like other modes, but use different flags. We # parameterize here, but still list the modes in the big case below, # to make depend.m4 easier to write. Note that we *cannot* use a case # here, because this file can only contain one case statement. if test "$depmode" = hp; then # HP compiler uses -M and no extra arg. gccflag=-M depmode=gcc fi if test "$depmode" = dashXmstdout; then # This is just like dashmstdout with a different argument. dashmflag=-xM depmode=dashmstdout fi case "$depmode" in gcc3) ## gcc 3 implements dependency tracking that does exactly what ## we want. Yay! Note: for some reason libtool 1.4 doesn't like ## it if -MD -MP comes after the -MF stuff. Hmm. "$@" -MT "$object" -MD -MP -MF "$tmpdepfile" stat=$? if test $stat -eq 0; then : else rm -f "$tmpdepfile" exit $stat fi mv "$tmpdepfile" "$depfile" ;; gcc) ## There are various ways to get dependency output from gcc. Here's ## why we pick this rather obscure method: ## - Don't want to use -MD because we'd like the dependencies to end ## up in a subdir. Having to rename by hand is ugly. ## (We might end up doing this anyway to support other compilers.) ## - The DEPENDENCIES_OUTPUT environment variable makes gcc act like ## -MM, not -M (despite what the docs say). ## - Using -M directly means running the compiler twice (even worse ## than renaming). if test -z "$gccflag"; then gccflag=-MD, fi "$@" -Wp,"$gccflag$tmpdepfile" stat=$? if test $stat -eq 0; then : else rm -f "$tmpdepfile" exit $stat fi rm -f "$depfile" echo "$object : \\" > "$depfile" alpha=ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz ## 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. ## 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 ## that the space means something, we add a space to the output as ## well. ## 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" rm -f "$tmpdepfile" ;; hp) # 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 ;; sgi) if test "$libtool" = yes; then "$@" "-Wp,-MDupdate,$tmpdepfile" else "$@" -MDupdate "$tmpdepfile" fi stat=$? if test $stat -eq 0; then : else rm -f "$tmpdepfile" exit $stat fi rm -f "$depfile" if test -f "$tmpdepfile"; then # yes, the sourcefile depend on other files echo "$object : \\" > "$depfile" # Clip off the initial element (the dependent). Don't try to be # 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 # dependency line. tr ' ' ' ' < "$tmpdepfile" \ | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' | \ tr ' ' ' ' >> $depfile echo >> $depfile # The second pass generates a dummy entry for each header file. tr ' ' ' ' < "$tmpdepfile" \ | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' -e 's/$/:/' \ >> $depfile else # The sourcefile does not contain any dependencies, so just # store a dummy comment line, to avoid errors with the Makefile # "include basename.Plo" scheme. echo "#dummy" > "$depfile" fi rm -f "$tmpdepfile" ;; 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 # start of each line; $object doesn't have directory information. # Version 6 uses the directory in both cases. stripped=`echo "$object" | sed 's/\(.*\)\..*$/\1/'` tmpdepfile="$stripped.u" if test "$libtool" = yes; then "$@" -Wc,-M else "$@" -M fi stat=$? if test -f "$tmpdepfile"; then : else stripped=`echo "$stripped" | sed 's,^.*/,,'` tmpdepfile="$stripped.u" fi if test $stat -eq 0; then : else rm -f "$tmpdepfile" exit $stat fi if test -f "$tmpdepfile"; then outname="$stripped.o" # 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:'. sed -e "s,^$outname:,$object :," < "$tmpdepfile" > "$depfile" sed -e "s,^$outname: \(.*\)$,\1:," < "$tmpdepfile" >> "$depfile" else # The sourcefile does not contain any dependencies, so just # store a dummy comment line, to avoid errors with the Makefile # "include basename.Plo" scheme. echo "#dummy" > "$depfile" fi rm -f "$tmpdepfile" ;; icc) # Intel's C compiler understands `-MD -MF file'. However on # icc -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: # 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 \ : # foo.o: sub/foo.c ... \ # sub/foo.h ... \ # ... "$@" -MD -MF "$tmpdepfile" stat=$? if test $stat -eq 0; then : else rm -f "$tmpdepfile" 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 \'. # 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" rm -f "$tmpdepfile" ;; 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'. # 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. # Subdirectories are respected. dir=`echo "$object" | sed -e 's|/[^/]*$|/|'` test "x$dir" = "x$object" && dir= base=`echo "$object" | sed -e 's|^.*/||' -e 's/\.o$//' -e 's/\.lo$//'` if test "$libtool" = yes; then # Dependencies are output in .lo.d with libtool 1.4. # With libtool 1.5 they are output both in $dir.libs/$base.o.d # and in $dir.libs/$base.o.d and $dir$base.o.d. We process the # latter, because the former will be cleaned when $dir.libs is # erased. tmpdepfile1="$dir.libs/$base.lo.d" tmpdepfile2="$dir$base.o.d" tmpdepfile3="$dir.libs/$base.d" "$@" -Wc,-MD else tmpdepfile1="$dir$base.o.d" tmpdepfile2="$dir$base.d" tmpdepfile3="$dir$base.d" "$@" -MD fi stat=$? if test $stat -eq 0; then : else rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" exit $stat fi if test -f "$tmpdepfile1"; then tmpdepfile="$tmpdepfile1" elif test -f "$tmpdepfile2"; then tmpdepfile="$tmpdepfile2" else tmpdepfile="$tmpdepfile3" fi 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" else echo "#dummy" > "$depfile" fi rm -f "$tmpdepfile" ;; #nosideeffect) # This comment above is used by automake to tell side-effect # dependency tracking mechanisms from slower ones. dashmstdout) # Important note: in order to support this mode, a compiler *must* # always write the preprocessed file to stdout, regardless of -o. "$@" || exit $? # Remove the call to Libtool. if test "$libtool" = yes; then while test $1 != '--mode=compile'; do shift done shift fi # Remove `-o $object'. IFS=" " for arg do case $arg in -o) shift ;; $object) shift ;; *) set fnord "$@" "$arg" shift # fnord shift # $arg ;; esac done test -z "$dashmflag" && dashmflag=-M # 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. "$@" $dashmflag | sed 's:^[ ]*[^: ][^:][^:]*\:[ ]*:'"$object"'\: :' > "$tmpdepfile" rm -f "$depfile" cat < "$tmpdepfile" > "$depfile" tr ' ' ' ' < "$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" rm -f "$tmpdepfile" ;; dashXmstdout) # This case only exists to satisfy depend.m4. It is never actually # run, as this mode is specially recognized in the preamble. exit 1 ;; makedepend) "$@" || exit $? # Remove any Libtool call if test "$libtool" = yes; then while test $1 != '--mode=compile'; do shift done shift fi # X makedepend shift cleared=no for arg in "$@"; do case $cleared in no) set ""; shift cleared=yes ;; esac case "$arg" in -D*|-I*) set fnord "$@" "$arg"; shift ;; # Strip any option that makedepend may not understand. Remove # the object too, otherwise makedepend will parse it as a source file. -*|$object) ;; *) set fnord "$@" "$arg"; shift ;; esac done obj_suffix="`echo $object | sed 's/^.*\././'`" touch "$tmpdepfile" ${MAKEDEPEND-makedepend} -o"$obj_suffix" -f"$tmpdepfile" "$@" rm -f "$depfile" cat < "$tmpdepfile" > "$depfile" sed '1,2d' "$tmpdepfile" | tr ' ' ' ' | \ ## 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" rm -f "$tmpdepfile" "$tmpdepfile".bak ;; cpp) # Important note: in order to support this mode, a compiler *must* # always write the preprocessed file to stdout. "$@" || exit $? # Remove the call to Libtool. if test "$libtool" = yes; then while test $1 != '--mode=compile'; do shift done shift fi # Remove `-o $object'. IFS=" " for arg do case $arg in -o) shift ;; $object) shift ;; *) set fnord "$@" "$arg" shift # fnord shift # $arg ;; esac done "$@" -E | sed -n '/^# [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' | sed '$ s: \\$::' > "$tmpdepfile" rm -f "$depfile" echo "$object : \\" > "$depfile" cat < "$tmpdepfile" >> "$depfile" sed < "$tmpdepfile" '/^$/d;s/^ //;s/ \\$//;s/$/ :/' >> "$depfile" rm -f "$tmpdepfile" ;; msvisualcpp) # Important note: in order to support this mode, a compiler *must* # always write the preprocessed file to stdout, regardless of -o, # because we must use -o when running libtool. "$@" || exit $? IFS=" " for arg do case "$arg" in "-Gm"|"/Gm"|"-Gi"|"/Gi"|"-ZI"|"/ZI") set fnord "$@" shift shift ;; *) set fnord "$@" "$arg" shift shift ;; esac done "$@" -E | sed -n '/^#line [0-9][0-9]* "\([^"]*\)"/ s::echo "`cygpath -u \\"\1\\"`":p' | sort | uniq > "$tmpdepfile" rm -f "$depfile" echo "$object : \\" > "$depfile" . "$tmpdepfile" | sed 's% %\\ %g' | sed -n '/^\(.*\)$/ s:: \1 \\:p' >> "$depfile" echo " " >> "$depfile" . "$tmpdepfile" | sed 's% %\\ %g' | sed -n '/^\(.*\)$/ s::\1\::p' >> "$depfile" rm -f "$tmpdepfile" ;; none) exec "$@" ;; *) echo "Unknown depmode $depmode" 1>&2 exit 1 ;; esac exit 0 # Local Variables: # mode: shell-script # sh-indentation: 2 # eval: (add-hook 'write-file-hooks 'time-stamp) # time-stamp-start: "scriptversion=" # time-stamp-format: "%:y-%02m-%02d.%02H" # time-stamp-end: "$" # End: tango-8.1.2c+dfsg.orig/lib/cpp/log4tango/config/install-sh0000755000175000017500000002176612205375130022304 0ustar piccapicca#!/bin/sh # install - install a program, script, or datafile scriptversion=2004-09-10.20 # This originates from X11R5 (mit/util/scripts/install.sh), which was # later released in X11R6 (xc/config/util/install.sh) with the # following copyright and license. # # Copyright (C) 1994 X Consortium # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to # deal in the Software without restriction, including without limitation the # rights to use, copy, modify, merge, publish, distribute, sublicense, and/or # sell copies of the Software, and to permit persons to whom the Software is # furnished to do so, subject to the following conditions: # # The above copyright notice and this permission notice shall be included in # all copies or substantial portions of the Software. # # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE # X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN # AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNEC- # TION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # # Except as contained in this notice, the name of the X Consortium shall not # be used in advertising or otherwise to promote the sale, use or other deal- # ings in this Software without prior written authorization from the X Consor- # tium. # # # 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 # when there is no Makefile. # # This script is compatible with the BSD install script, but was written # from scratch. It can only install one file at a time, a restriction # shared with many OS's install programs. # set DOITPROG to echo to test this script # Don't use :- since 4.3BSD and earlier shells don't like it. doit="${DOITPROG-}" # put in absolute paths if you don't have them in your path; or use env. vars. mvprog="${MVPROG-mv}" cpprog="${CPPROG-cp}" chmodprog="${CHMODPROG-chmod}" chownprog="${CHOWNPROG-chown}" chgrpprog="${CHGRPPROG-chgrp}" stripprog="${STRIPPROG-strip}" rmprog="${RMPROG-rm}" mkdirprog="${MKDIRPROG-mkdir}" chmodcmd="$chmodprog 0755" chowncmd= chgrpcmd= stripcmd= rmcmd="$rmprog -f" mvcmd="$mvprog" src= dst= dir_arg= dstarg= no_target_directory= usage="Usage: $0 [OPTION]... [-T] SRCFILE DSTFILE or: $0 [OPTION]... SRCFILES... DIRECTORY or: $0 [OPTION]... -t DIRECTORY SRCFILES... or: $0 [OPTION]... -d DIRECTORIES... In the 1st form, copy SRCFILE to DSTFILE. In the 2nd and 3rd, copy all SRCFILES to DIRECTORY. In the 4th, create DIRECTORIES. Options: -c (ignored) -d create directories instead of installing files. -g GROUP $chgrpprog installed files to GROUP. -m MODE $chmodprog installed files to MODE. -o USER $chownprog installed files to USER. -s $stripprog installed files. -t DIRECTORY install into DIRECTORY. -T report an error if DSTFILE is a directory. --help display this help and exit. --version display version info and exit. Environment variables override the default commands: CHGRPPROG CHMODPROG CHOWNPROG CPPROG MKDIRPROG MVPROG RMPROG STRIPPROG " while test -n "$1"; do case $1 in -c) shift continue;; -d) dir_arg=true shift continue;; -g) chgrpcmd="$chgrpprog $2" shift shift continue;; --help) echo "$usage"; exit 0;; -m) chmodcmd="$chmodprog $2" shift shift continue;; -o) chowncmd="$chownprog $2" shift shift continue;; -s) stripcmd=$stripprog shift continue;; -t) dstarg=$2 shift shift continue;; -T) no_target_directory=true shift continue;; --version) echo "$0 $scriptversion"; exit 0;; *) # When -d is used, all remaining arguments are directories to create. # When -t is used, the destination is already specified. test -n "$dir_arg$dstarg" && break # Otherwise, the last argument is the destination. Remove it from $@. for arg do if test -n "$dstarg"; then # $@ is not empty: it contains at least $arg. set fnord "$@" "$dstarg" shift # fnord fi shift # arg dstarg=$arg done break;; esac done if test -z "$1"; then if test -z "$dir_arg"; then echo "$0: no input file specified." >&2 exit 1 fi # It's OK to call `install-sh -d' without argument. # This can happen when creating conditional directories. exit 0 fi for src do # Protect names starting with `-'. case $src in -*) src=./$src ;; esac if test -n "$dir_arg"; then dst=$src src= if test -d "$dst"; then mkdircmd=: chmodcmd= else mkdircmd=$mkdirprog fi else # Waiting for this to be detected by the "$cpprog $src $dsttmp" command # might cause directories to be created, which would be especially bad # if $src (and thus $dsttmp) contains '*'. if test ! -f "$src" && test ! -d "$src"; then echo "$0: $src does not exist." >&2 exit 1 fi if test -z "$dstarg"; then echo "$0: no destination specified." >&2 exit 1 fi dst=$dstarg # 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. if test -d "$dst"; then if test -n "$no_target_directory"; then echo "$0: $dstarg: Is a directory" >&2 exit 1 fi dst=$dst/`basename "$src"` fi fi # This sed command emulates the dirname command. dstdir=`echo "$dst" | sed -e 's,[^/]*$,,;s,/$,,;s,^$,.,'` # Make sure that the destination directory exists. # Skip lots of stat calls in the usual case. if test ! -d "$dstdir"; then defaultIFS=' ' IFS="${IFS-$defaultIFS}" oIFS=$IFS # Some sh's can't handle IFS=/ for some reason. IFS='%' set - `echo "$dstdir" | sed -e 's@/@%@g' -e 's@^%@/@'` IFS=$oIFS pathcomp= while test $# -ne 0 ; do pathcomp=$pathcomp$1 shift if test ! -d "$pathcomp"; then $mkdirprog "$pathcomp" # mkdir can fail with a `File exist' error in case several # install-sh are creating the directory concurrently. This # is OK. test -d "$pathcomp" || exit fi pathcomp=$pathcomp/ done fi if test -n "$dir_arg"; then $doit $mkdircmd "$dst" \ && { test -z "$chowncmd" || $doit $chowncmd "$dst"; } \ && { test -z "$chgrpcmd" || $doit $chgrpcmd "$dst"; } \ && { test -z "$stripcmd" || $doit $stripcmd "$dst"; } \ && { test -z "$chmodcmd" || $doit $chmodcmd "$dst"; } else dstfile=`basename "$dst"` # Make a couple of temp file names in the proper directory. dsttmp=$dstdir/_inst.$$_ rmtmp=$dstdir/_rm.$$_ # Trap to clean up those temp files at exit. trap 'ret=$?; rm -f "$dsttmp" "$rmtmp" && exit $ret' 0 trap '(exit $?); exit' 1 2 13 15 # Copy the file name to the temp name. $doit $cpprog "$src" "$dsttmp" && # and set any options; do chmod last to preserve setuid bits. # # If any of these fail, we abort the whole thing. If we want to # ignore errors from any of these, just make sure not to ignore # errors from the above "$doit $cpprog $src $dsttmp" command. # { test -z "$chowncmd" || $doit $chowncmd "$dsttmp"; } \ && { test -z "$chgrpcmd" || $doit $chgrpcmd "$dsttmp"; } \ && { test -z "$stripcmd" || $doit $stripcmd "$dsttmp"; } \ && { test -z "$chmodcmd" || $doit $chmodcmd "$dsttmp"; } && # Now rename the file to the real destination. { $doit $mvcmd -f "$dsttmp" "$dstdir/$dstfile" 2>/dev/null \ || { # The rename failed, perhaps because mv can't rename something else # to itself, or perhaps because mv is so ancient that it does not # support -f. # Now remove or move aside any old file at destination location. # We try this two ways since rm can't unlink itself on some # systems and the destination file might be busy for other # reasons. In this case, the final cleanup might fail but the new # file should still install successfully. { if test -f "$dstdir/$dstfile"; then $doit $rmcmd -f "$dstdir/$dstfile" 2>/dev/null \ || $doit $mvcmd -f "$dstdir/$dstfile" "$rmtmp" 2>/dev/null \ || { echo "$0: cannot unlink or rename $dstdir/$dstfile" >&2 (exit 1); exit } else : fi } && # Now rename the file to the real destination. $doit $mvcmd "$dsttmp" "$dstdir/$dstfile" } } fi || { (exit 1); exit; } done # The final little trick to "correctly" pass the exit status to the exit trap. { (exit 0); exit } # Local variables: # eval: (add-hook 'write-file-hooks 'time-stamp) # time-stamp-start: "scriptversion=" # time-stamp-format: "%:y-%02m-%02d.%02H" # time-stamp-end: "$" # End: tango-8.1.2c+dfsg.orig/lib/cpp/log4tango/config/config.guess0000755000175000017500000012206512205375130022612 0ustar piccapicca#! /bin/sh # Attempt to guess a canonical system name. # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, # 2000, 2001, 2002, 2003 Free Software Foundation, Inc. timestamp='2003-06-17' # This file is free software; you can redistribute it and/or modify it # under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, but # WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. # # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that program. # Originally written by Per Bothner . # Please send patches to . Submit a context # diff and a properly formatted ChangeLog entry. # # This script attempts to guess a canonical system name similar to # config.sub. If it succeeds, it prints the system name on stdout, and # exits with 0. Otherwise, it exits with 1. # # The plan is that this can be called by configure scripts if you # don't specify an explicit build system type. me=`echo "$0" | sed -e 's,.*/,,'` usage="\ Usage: $0 [OPTION] Output the configuration name of the system \`$me' is run on. Operation modes: -h, --help print this help, then exit -t, --time-stamp print date of last modification, then exit -v, --version print version number, then exit Report bugs and patches to ." version="\ GNU config.guess ($timestamp) Originally written by Per Bothner. Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." help=" Try \`$me --help' for more information." # Parse command line while test $# -gt 0 ; do case $1 in --time-stamp | --time* | -t ) echo "$timestamp" ; exit 0 ;; --version | -v ) echo "$version" ; exit 0 ;; --help | --h* | -h ) echo "$usage"; exit 0 ;; -- ) # Stop option processing shift; break ;; - ) # Use stdin as input. break ;; -* ) echo "$me: invalid option $1$help" >&2 exit 1 ;; * ) break ;; esac done if test $# != 0; then echo "$me: too many arguments$help" >&2 exit 1 fi trap 'exit 1' 1 2 15 # CC_FOR_BUILD -- compiler used by this script. Note that the use of a # compiler to aid in system detection is discouraged as it requires # temporary files to be created and, as you can see below, it is a # headache to deal with in a portable fashion. # Historically, `CC_FOR_BUILD' used to be named `HOST_CC'. We still # use `HOST_CC' if defined, but it is deprecated. # Portable tmp directory creation inspired by the Autoconf team. set_cc_for_build=' trap "exitcode=\$?; (rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null) && exit \$exitcode" 0 ; trap "rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null; exit 1" 1 2 13 15 ; : ${TMPDIR=/tmp} ; { tmp=`(umask 077 && mktemp -d -q "$TMPDIR/cgXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" ; } || { test -n "$RANDOM" && tmp=$TMPDIR/cg$$-$RANDOM && (umask 077 && mkdir $tmp) ; } || { tmp=$TMPDIR/cg-$$ && (umask 077 && mkdir $tmp) && echo "Warning: creating insecure temp directory" >&2 ; } || { echo "$me: cannot create a temporary directory in $TMPDIR" >&2 ; exit 1 ; } ; dummy=$tmp/dummy ; tmpfiles="$dummy.c $dummy.o $dummy.rel $dummy" ; case $CC_FOR_BUILD,$HOST_CC,$CC in ,,) echo "int x;" > $dummy.c ; for c in cc gcc c89 c99 ; do if ($c -c -o $dummy.o $dummy.c) >/dev/null 2>&1 ; then CC_FOR_BUILD="$c"; break ; fi ; done ; if test x"$CC_FOR_BUILD" = x ; then CC_FOR_BUILD=no_compiler_found ; fi ;; ,,*) CC_FOR_BUILD=$CC ;; ,*,*) CC_FOR_BUILD=$HOST_CC ;; esac ;' # This is needed to find uname on a Pyramid OSx when run in the BSD universe. # (ghazi@noc.rutgers.edu 1994-08-24) if (test -f /.attbin/uname) >/dev/null 2>&1 ; then PATH=$PATH:/.attbin ; export PATH fi UNAME_MACHINE=`(uname -m) 2>/dev/null` || UNAME_MACHINE=unknown UNAME_RELEASE=`(uname -r) 2>/dev/null` || UNAME_RELEASE=unknown UNAME_SYSTEM=`(uname -s) 2>/dev/null` || UNAME_SYSTEM=unknown UNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown ## for Red Hat Linux if test -f /etc/redhat-release ; then VENDOR=redhat ; else VENDOR= ; fi # Note: order is significant - the case branches are not exclusive. case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in *:NetBSD:*:*) # NetBSD (nbsd) targets should (where applicable) match one or # more of the tupples: *-*-netbsdelf*, *-*-netbsdaout*, # *-*-netbsdecoff* and *-*-netbsd*. For targets that recently # switched to ELF, *-*-netbsd* would select the old # object file format. This provides both forward # compatibility and a consistent mechanism for selecting the # object file format. # # Note: NetBSD doesn't particularly care about the vendor # portion of the name. We always set it to "unknown". sysctl="sysctl -n hw.machine_arch" UNAME_MACHINE_ARCH=`(/sbin/$sysctl 2>/dev/null || \ /usr/sbin/$sysctl 2>/dev/null || echo unknown)` case "${UNAME_MACHINE_ARCH}" in armeb) machine=armeb-unknown ;; arm*) machine=arm-unknown ;; sh3el) machine=shl-unknown ;; sh3eb) machine=sh-unknown ;; *) machine=${UNAME_MACHINE_ARCH}-unknown ;; esac # The Operating System including object format, if it has switched # to ELF recently, or will in the future. case "${UNAME_MACHINE_ARCH}" in arm*|i386|m68k|ns32k|sh3*|sparc|vax) eval $set_cc_for_build if echo __ELF__ | $CC_FOR_BUILD -E - 2>/dev/null \ | grep __ELF__ >/dev/null then # Once all utilities can be ECOFF (netbsdecoff) or a.out (netbsdaout). # Return netbsd for either. FIX? os=netbsd else os=netbsdelf fi ;; *) os=netbsd ;; esac # The OS release # Debian GNU/NetBSD machines have a different userland, and # thus, need a distinct triplet. However, they do not need # kernel version information, so it can be replaced with a # suitable tag, in the style of linux-gnu. case "${UNAME_VERSION}" in Debian*) release='-gnu' ;; *) release=`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'` ;; esac # Since CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM: # contains redundant information, the shorter form: # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used. echo "${machine}-${os}${release}" exit 0 ;; amiga:OpenBSD:*:*) echo m68k-unknown-openbsd${UNAME_RELEASE} exit 0 ;; arc:OpenBSD:*:*) echo mipsel-unknown-openbsd${UNAME_RELEASE} exit 0 ;; hp300:OpenBSD:*:*) echo m68k-unknown-openbsd${UNAME_RELEASE} exit 0 ;; mac68k:OpenBSD:*:*) echo m68k-unknown-openbsd${UNAME_RELEASE} exit 0 ;; macppc:OpenBSD:*:*) echo powerpc-unknown-openbsd${UNAME_RELEASE} exit 0 ;; mvme68k:OpenBSD:*:*) echo m68k-unknown-openbsd${UNAME_RELEASE} exit 0 ;; mvme88k:OpenBSD:*:*) echo m88k-unknown-openbsd${UNAME_RELEASE} exit 0 ;; mvmeppc:OpenBSD:*:*) echo powerpc-unknown-openbsd${UNAME_RELEASE} exit 0 ;; pmax:OpenBSD:*:*) echo mipsel-unknown-openbsd${UNAME_RELEASE} exit 0 ;; sgi:OpenBSD:*:*) echo mipseb-unknown-openbsd${UNAME_RELEASE} exit 0 ;; sun3:OpenBSD:*:*) echo m68k-unknown-openbsd${UNAME_RELEASE} exit 0 ;; wgrisc:OpenBSD:*:*) echo mipsel-unknown-openbsd${UNAME_RELEASE} exit 0 ;; *:OpenBSD:*:*) echo ${UNAME_MACHINE}-unknown-openbsd${UNAME_RELEASE} exit 0 ;; alpha:OSF1:*:*) if test $UNAME_RELEASE = "V4.0"; then UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $3}'` fi # According to Compaq, /usr/sbin/psrinfo has been available on # OSF/1 and Tru64 systems produced since 1995. I hope that # covers most systems running today. This code pipes the CPU # types through head -n 1, so we only detect the type of CPU 0. ALPHA_CPU_TYPE=`/usr/sbin/psrinfo -v | sed -n -e 's/^ The alpha \(.*\) processor.*$/\1/p' | head -n 1` case "$ALPHA_CPU_TYPE" in "EV4 (21064)") UNAME_MACHINE="alpha" ;; "EV4.5 (21064)") UNAME_MACHINE="alpha" ;; "LCA4 (21066/21068)") UNAME_MACHINE="alpha" ;; "EV5 (21164)") UNAME_MACHINE="alphaev5" ;; "EV5.6 (21164A)") UNAME_MACHINE="alphaev56" ;; "EV5.6 (21164PC)") UNAME_MACHINE="alphapca56" ;; "EV5.7 (21164PC)") UNAME_MACHINE="alphapca57" ;; "EV6 (21264)") UNAME_MACHINE="alphaev6" ;; "EV6.7 (21264A)") UNAME_MACHINE="alphaev67" ;; "EV6.8CB (21264C)") UNAME_MACHINE="alphaev68" ;; "EV6.8AL (21264B)") UNAME_MACHINE="alphaev68" ;; "EV6.8CX (21264D)") UNAME_MACHINE="alphaev68" ;; "EV6.9A (21264/EV69A)") UNAME_MACHINE="alphaev69" ;; "EV7 (21364)") UNAME_MACHINE="alphaev7" ;; "EV7.9 (21364A)") UNAME_MACHINE="alphaev79" ;; esac # A Vn.n version is a released version. # A Tn.n version is a released field test version. # A Xn.n version is an unreleased experimental baselevel. # 1.2 uses "1.2" for uname -r. echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[VTX]//' | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` exit 0 ;; Alpha*:OpenVMS:*:*) echo alpha-hp-vms exit 0 ;; Alpha\ *:Windows_NT*:*) # How do we know it's Interix rather than the generic POSIX subsystem? # Should we change UNAME_MACHINE based on the output of uname instead # of the specific Alpha model? echo alpha-pc-interix exit 0 ;; 21064:Windows_NT:50:3) echo alpha-dec-winnt3.5 exit 0 ;; Amiga*:UNIX_System_V:4.0:*) echo m68k-unknown-sysv4 exit 0;; *:[Aa]miga[Oo][Ss]:*:*) echo ${UNAME_MACHINE}-unknown-amigaos exit 0 ;; *:[Mm]orph[Oo][Ss]:*:*) echo ${UNAME_MACHINE}-unknown-morphos exit 0 ;; *:OS/390:*:*) echo i370-ibm-openedition exit 0 ;; arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*) echo arm-acorn-riscix${UNAME_RELEASE} exit 0;; SR2?01:HI-UX/MPP:*:* | SR8000:HI-UX/MPP:*:*) echo hppa1.1-hitachi-hiuxmpp exit 0;; Pyramid*:OSx*:*:* | MIS*:OSx*:*:* | MIS*:SMP_DC-OSx*:*:*) # akee@wpdis03.wpafb.af.mil (Earle F. Ake) contributed MIS and NILE. if test "`(/bin/universe) 2>/dev/null`" = att ; then echo pyramid-pyramid-sysv3 else echo pyramid-pyramid-bsd fi exit 0 ;; NILE*:*:*:dcosx) echo pyramid-pyramid-svr4 exit 0 ;; DRS?6000:unix:4.0:6*) echo sparc-icl-nx6 exit 0 ;; DRS?6000:UNIX_SV:4.2*:7*) case `/usr/bin/uname -p` in sparc) echo sparc-icl-nx7 && exit 0 ;; esac ;; sun4H:SunOS:5.*:*) echo sparc-hal-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit 0 ;; sun4*:SunOS:5.*:* | tadpole*:SunOS:5.*:*) echo sparc-sun-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit 0 ;; i86pc:SunOS:5.*:*) echo i386-pc-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit 0 ;; sun4*:SunOS:6*:*) # According to config.sub, this is the proper way to canonicalize # SunOS6. Hard to guess exactly what SunOS6 will be like, but # it's likely to be more like Solaris than SunOS4. echo sparc-sun-solaris3`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit 0 ;; sun4*:SunOS:*:*) case "`/usr/bin/arch -k`" in Series*|S4*) UNAME_RELEASE=`uname -v` ;; esac # Japanese Language versions have a version number like `4.1.3-JL'. echo sparc-sun-sunos`echo ${UNAME_RELEASE}|sed -e 's/-/_/'` exit 0 ;; sun3*:SunOS:*:*) echo m68k-sun-sunos${UNAME_RELEASE} exit 0 ;; sun*:*:4.2BSD:*) UNAME_RELEASE=`(sed 1q /etc/motd | awk '{print substr($5,1,3)}') 2>/dev/null` test "x${UNAME_RELEASE}" = "x" && UNAME_RELEASE=3 case "`/bin/arch`" in sun3) echo m68k-sun-sunos${UNAME_RELEASE} ;; sun4) echo sparc-sun-sunos${UNAME_RELEASE} ;; esac exit 0 ;; aushp:SunOS:*:*) echo sparc-auspex-sunos${UNAME_RELEASE} exit 0 ;; # The situation for MiNT is a little confusing. The machine name # can be virtually everything (everything which is not # "atarist" or "atariste" at least should have a processor # > m68000). The system name ranges from "MiNT" over "FreeMiNT" # to the lowercase version "mint" (or "freemint"). Finally # the system name "TOS" denotes a system which is actually not # MiNT. But MiNT is downward compatible to TOS, so this should # be no problem. atarist[e]:*MiNT:*:* | atarist[e]:*mint:*:* | atarist[e]:*TOS:*:*) echo m68k-atari-mint${UNAME_RELEASE} exit 0 ;; atari*:*MiNT:*:* | atari*:*mint:*:* | atarist[e]:*TOS:*:*) echo m68k-atari-mint${UNAME_RELEASE} exit 0 ;; *falcon*:*MiNT:*:* | *falcon*:*mint:*:* | *falcon*:*TOS:*:*) echo m68k-atari-mint${UNAME_RELEASE} exit 0 ;; milan*:*MiNT:*:* | milan*:*mint:*:* | *milan*:*TOS:*:*) echo m68k-milan-mint${UNAME_RELEASE} exit 0 ;; hades*:*MiNT:*:* | hades*:*mint:*:* | *hades*:*TOS:*:*) echo m68k-hades-mint${UNAME_RELEASE} exit 0 ;; *:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*) echo m68k-unknown-mint${UNAME_RELEASE} exit 0 ;; powerpc:machten:*:*) echo powerpc-apple-machten${UNAME_RELEASE} exit 0 ;; RISC*:Mach:*:*) echo mips-dec-mach_bsd4.3 exit 0 ;; RISC*:ULTRIX:*:*) echo mips-dec-ultrix${UNAME_RELEASE} exit 0 ;; VAX*:ULTRIX*:*:*) echo vax-dec-ultrix${UNAME_RELEASE} exit 0 ;; 2020:CLIX:*:* | 2430:CLIX:*:*) echo clipper-intergraph-clix${UNAME_RELEASE} exit 0 ;; mips:*:*:UMIPS | mips:*:*:RISCos) eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #ifdef __cplusplus #include /* for printf() prototype */ int main (int argc, char *argv[]) { #else int main (argc, argv) int argc; char *argv[]; { #endif #if defined (host_mips) && defined (MIPSEB) #if defined (SYSTYPE_SYSV) printf ("mips-mips-riscos%ssysv\n", argv[1]); exit (0); #endif #if defined (SYSTYPE_SVR4) printf ("mips-mips-riscos%ssvr4\n", argv[1]); exit (0); #endif #if defined (SYSTYPE_BSD43) || defined(SYSTYPE_BSD) printf ("mips-mips-riscos%sbsd\n", argv[1]); exit (0); #endif #endif exit (-1); } EOF $CC_FOR_BUILD -o $dummy $dummy.c \ && $dummy `echo "${UNAME_RELEASE}" | sed -n 's/\([0-9]*\).*/\1/p'` \ && exit 0 echo mips-mips-riscos${UNAME_RELEASE} exit 0 ;; Motorola:PowerMAX_OS:*:*) echo powerpc-motorola-powermax exit 0 ;; Motorola:*:4.3:PL8-*) echo powerpc-harris-powermax exit 0 ;; Night_Hawk:*:*:PowerMAX_OS | Synergy:PowerMAX_OS:*:*) echo powerpc-harris-powermax exit 0 ;; Night_Hawk:Power_UNIX:*:*) echo powerpc-harris-powerunix exit 0 ;; m88k:CX/UX:7*:*) echo m88k-harris-cxux7 exit 0 ;; m88k:*:4*:R4*) echo m88k-motorola-sysv4 exit 0 ;; m88k:*:3*:R3*) echo m88k-motorola-sysv3 exit 0 ;; AViiON:dgux:*:*) # DG/UX returns AViiON for all architectures UNAME_PROCESSOR=`/usr/bin/uname -p` if [ $UNAME_PROCESSOR = mc88100 ] || [ $UNAME_PROCESSOR = mc88110 ] then if [ ${TARGET_BINARY_INTERFACE}x = m88kdguxelfx ] || \ [ ${TARGET_BINARY_INTERFACE}x = x ] then echo m88k-dg-dgux${UNAME_RELEASE} else echo m88k-dg-dguxbcs${UNAME_RELEASE} fi else echo i586-dg-dgux${UNAME_RELEASE} fi exit 0 ;; M88*:DolphinOS:*:*) # DolphinOS (SVR3) echo m88k-dolphin-sysv3 exit 0 ;; M88*:*:R3*:*) # Delta 88k system running SVR3 echo m88k-motorola-sysv3 exit 0 ;; XD88*:*:*:*) # Tektronix XD88 system running UTekV (SVR3) echo m88k-tektronix-sysv3 exit 0 ;; Tek43[0-9][0-9]:UTek:*:*) # Tektronix 4300 system running UTek (BSD) echo m68k-tektronix-bsd exit 0 ;; *:IRIX*:*:*) echo mips-sgi-irix`echo ${UNAME_RELEASE}|sed -e 's/-/_/g'` exit 0 ;; ????????:AIX?:[12].1:2) # AIX 2.2.1 or AIX 2.1.1 is RT/PC AIX. echo romp-ibm-aix # uname -m gives an 8 hex-code CPU id exit 0 ;; # Note that: echo "'`uname -s`'" gives 'AIX ' i*86:AIX:*:*) echo i386-ibm-aix exit 0 ;; ia64:AIX:*:*) if [ -x /usr/bin/oslevel ] ; then IBM_REV=`/usr/bin/oslevel` else IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE} fi echo ${UNAME_MACHINE}-ibm-aix${IBM_REV} exit 0 ;; *:AIX:2:3) if grep bos325 /usr/include/stdio.h >/dev/null 2>&1; then eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #include main() { if (!__power_pc()) exit(1); puts("powerpc-ibm-aix3.2.5"); exit(0); } EOF $CC_FOR_BUILD -o $dummy $dummy.c && $dummy && exit 0 echo rs6000-ibm-aix3.2.5 elif grep bos324 /usr/include/stdio.h >/dev/null 2>&1; then echo rs6000-ibm-aix3.2.4 else echo rs6000-ibm-aix3.2 fi exit 0 ;; *:AIX:*:[45]) IBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | sed 1q | awk '{ print $1 }'` if /usr/sbin/lsattr -El ${IBM_CPU_ID} | grep ' POWER' >/dev/null 2>&1; then IBM_ARCH=rs6000 else IBM_ARCH=powerpc fi if [ -x /usr/bin/oslevel ] ; then IBM_REV=`/usr/bin/oslevel` else IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE} fi echo ${IBM_ARCH}-ibm-aix${IBM_REV} exit 0 ;; *:AIX:*:*) echo rs6000-ibm-aix exit 0 ;; ibmrt:4.4BSD:*|romp-ibm:BSD:*) echo romp-ibm-bsd4.4 exit 0 ;; ibmrt:*BSD:*|romp-ibm:BSD:*) # covers RT/PC BSD and echo romp-ibm-bsd${UNAME_RELEASE} # 4.3 with uname added to exit 0 ;; # report: romp-ibm BSD 4.3 *:BOSX:*:*) echo rs6000-bull-bosx exit 0 ;; DPX/2?00:B.O.S.:*:*) echo m68k-bull-sysv3 exit 0 ;; 9000/[34]??:4.3bsd:1.*:*) echo m68k-hp-bsd exit 0 ;; hp300:4.4BSD:*:* | 9000/[34]??:4.3bsd:2.*:*) echo m68k-hp-bsd4.4 exit 0 ;; 9000/[34678]??:HP-UX:*:*) HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'` case "${UNAME_MACHINE}" in 9000/31? ) HP_ARCH=m68000 ;; 9000/[34]?? ) HP_ARCH=m68k ;; 9000/[678][0-9][0-9]) if [ -x /usr/bin/getconf ]; then sc_cpu_version=`/usr/bin/getconf SC_CPU_VERSION 2>/dev/null` sc_kernel_bits=`/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null` case "${sc_cpu_version}" in 523) HP_ARCH="hppa1.0" ;; # CPU_PA_RISC1_0 528) HP_ARCH="hppa1.1" ;; # CPU_PA_RISC1_1 532) # CPU_PA_RISC2_0 case "${sc_kernel_bits}" in 32) HP_ARCH="hppa2.0n" ;; 64) HP_ARCH="hppa2.0w" ;; '') HP_ARCH="hppa2.0" ;; # HP-UX 10.20 esac ;; esac fi if [ "${HP_ARCH}" = "" ]; then eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #define _HPUX_SOURCE #include #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 fi ;; esac if [ ${HP_ARCH} = "hppa2.0w" ] then # avoid double evaluation of $set_cc_for_build test -n "$CC_FOR_BUILD" || eval $set_cc_for_build if echo __LP64__ | (CCOPTS= $CC_FOR_BUILD -E -) | grep __LP64__ >/dev/null then HP_ARCH="hppa2.0w" else HP_ARCH="hppa64" fi fi echo ${HP_ARCH}-hp-hpux${HPUX_REV} exit 0 ;; ia64:HP-UX:*:*) HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'` echo ia64-hp-hpux${HPUX_REV} exit 0 ;; 3050*:HI-UX:*:*) eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #include int main () { long cpu = sysconf (_SC_CPU_VERSION); /* The order matters, because CPU_IS_HP_MC68K erroneously returns true for CPU_PA_RISC1_0. CPU_IS_PA_RISC returns correct results, however. */ if (CPU_IS_PA_RISC (cpu)) { switch (cpu) { case CPU_PA_RISC1_0: puts ("hppa1.0-hitachi-hiuxwe2"); break; case CPU_PA_RISC1_1: puts ("hppa1.1-hitachi-hiuxwe2"); break; case CPU_PA_RISC2_0: puts ("hppa2.0-hitachi-hiuxwe2"); break; default: puts ("hppa-hitachi-hiuxwe2"); break; } } else if (CPU_IS_HP_MC68K (cpu)) puts ("m68k-hitachi-hiuxwe2"); else puts ("unknown-hitachi-hiuxwe2"); exit (0); } EOF $CC_FOR_BUILD -o $dummy $dummy.c && $dummy && exit 0 echo unknown-hitachi-hiuxwe2 exit 0 ;; 9000/7??:4.3bsd:*:* | 9000/8?[79]:4.3bsd:*:* ) echo hppa1.1-hp-bsd exit 0 ;; 9000/8??:4.3bsd:*:*) echo hppa1.0-hp-bsd exit 0 ;; *9??*:MPE/iX:*:* | *3000*:MPE/iX:*:*) echo hppa1.0-hp-mpeix exit 0 ;; hp7??:OSF1:*:* | hp8?[79]:OSF1:*:* ) echo hppa1.1-hp-osf exit 0 ;; hp8??:OSF1:*:*) echo hppa1.0-hp-osf exit 0 ;; i*86:OSF1:*:*) if [ -x /usr/sbin/sysversion ] ; then echo ${UNAME_MACHINE}-unknown-osf1mk else echo ${UNAME_MACHINE}-unknown-osf1 fi exit 0 ;; parisc*:Lites*:*:*) echo hppa1.1-hp-lites exit 0 ;; C1*:ConvexOS:*:* | convex:ConvexOS:C1*:*) echo c1-convex-bsd exit 0 ;; C2*:ConvexOS:*:* | convex:ConvexOS:C2*:*) if getsysinfo -f scalar_acc then echo c32-convex-bsd else echo c2-convex-bsd fi exit 0 ;; C34*:ConvexOS:*:* | convex:ConvexOS:C34*:*) echo c34-convex-bsd exit 0 ;; C38*:ConvexOS:*:* | convex:ConvexOS:C38*:*) echo c38-convex-bsd exit 0 ;; C4*:ConvexOS:*:* | convex:ConvexOS:C4*:*) echo c4-convex-bsd exit 0 ;; CRAY*Y-MP:*:*:*) echo ymp-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit 0 ;; CRAY*[A-Z]90:*:*:*) echo ${UNAME_MACHINE}-cray-unicos${UNAME_RELEASE} \ | sed -e 's/CRAY.*\([A-Z]90\)/\1/' \ -e y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/ \ -e 's/\.[^.]*$/.X/' exit 0 ;; CRAY*TS:*:*:*) echo t90-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit 0 ;; CRAY*T3E:*:*:*) echo alphaev5-cray-unicosmk${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit 0 ;; CRAY*SV1:*:*:*) echo sv1-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit 0 ;; *:UNICOS/mp:*:*) echo nv1-cray-unicosmp${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit 0 ;; F30[01]:UNIX_System_V:*:* | F700:UNIX_System_V:*:*) FUJITSU_PROC=`uname -m | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'` FUJITSU_REL=`echo ${UNAME_RELEASE} | sed -e 's/ /_/'` echo "${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" exit 0 ;; i*86:BSD/386:*:* | i*86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*) echo ${UNAME_MACHINE}-pc-bsdi${UNAME_RELEASE} exit 0 ;; sparc*:BSD/OS:*:*) echo sparc-unknown-bsdi${UNAME_RELEASE} exit 0 ;; *:BSD/OS:*:*) echo ${UNAME_MACHINE}-unknown-bsdi${UNAME_RELEASE} exit 0 ;; *:FreeBSD:*:*|*:GNU/FreeBSD:*:*) # Determine whether the default compiler uses glibc. eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #include #if __GLIBC__ >= 2 LIBC=gnu #else LIBC= #endif EOF eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep ^LIBC=` echo ${UNAME_MACHINE}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`${LIBC:+-$LIBC} exit 0 ;; i*:CYGWIN*:*) echo ${UNAME_MACHINE}-pc-cygwin exit 0 ;; i*:MINGW*:*) echo ${UNAME_MACHINE}-pc-mingw32 exit 0 ;; i*:PW*:*) echo ${UNAME_MACHINE}-pc-pw32 exit 0 ;; x86:Interix*:[34]*) echo i586-pc-interix${UNAME_RELEASE}|sed -e 's/\..*//' exit 0 ;; [345]86:Windows_95:* | [345]86:Windows_98:* | [345]86:Windows_NT:*) echo i${UNAME_MACHINE}-pc-mks exit 0 ;; i*:Windows_NT*:* | Pentium*:Windows_NT*:*) # How do we know it's Interix rather than the generic POSIX subsystem? # It also conflicts with pre-2.0 versions of AT&T UWIN. Should we # UNAME_MACHINE based on the output of uname instead of i386? echo i586-pc-interix exit 0 ;; i*:UWIN*:*) echo ${UNAME_MACHINE}-pc-uwin exit 0 ;; p*:CYGWIN*:*) echo powerpcle-unknown-cygwin exit 0 ;; prep*:SunOS:5.*:*) echo powerpcle-unknown-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit 0 ;; *:GNU:*:*) echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-gnu`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'` exit 0 ;; i*86:Minix:*:*) echo ${UNAME_MACHINE}-pc-minix exit 0 ;; arm*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit 0 ;; cris:Linux:*:*) echo cris-axis-linux-gnu exit 0 ;; ia64:Linux:*:*) echo ${UNAME_MACHINE}-${VENDOR:-unknown}-linux-gnu exit 0 ;; m68*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit 0 ;; mips:Linux:*:*) eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #undef CPU #undef mips #undef mipsel #if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL) CPU=mipsel #else #if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB) CPU=mips #else CPU= #endif #endif EOF eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep ^CPU=` test x"${CPU}" != x && echo "${CPU}-unknown-linux-gnu" && exit 0 ;; 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 | grep ^CPU=` test x"${CPU}" != x && echo "${CPU}-unknown-linux-gnu" && exit 0 ;; ppc:Linux:*:*) echo powerpc-${VENDOR:-unknown}-linux-gnu exit 0 ;; ppc64:Linux:*:*) echo powerpc64-${VENDOR:-unknown}-linux-gnu exit 0 ;; alpha:Linux:*:*) case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in EV5) UNAME_MACHINE=alphaev5 ;; EV56) UNAME_MACHINE=alphaev56 ;; PCA56) UNAME_MACHINE=alphapca56 ;; PCA57) UNAME_MACHINE=alphapca56 ;; EV6) UNAME_MACHINE=alphaev6 ;; EV67) UNAME_MACHINE=alphaev67 ;; EV68*) UNAME_MACHINE=alphaev68 ;; esac objdump --private-headers /bin/sh | grep ld.so.1 >/dev/null if test "$?" = 0 ; then LIBC="libc1" ; else LIBC="" ; fi echo ${UNAME_MACHINE}-unknown-linux-gnu${LIBC} exit 0 ;; parisc:Linux:*:* | hppa:Linux:*:*) # Look for CPU level case `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in PA7*) echo hppa1.1-unknown-linux-gnu ;; PA8*) echo hppa2.0-unknown-linux-gnu ;; *) echo hppa-unknown-linux-gnu ;; esac exit 0 ;; parisc64:Linux:*:* | hppa64:Linux:*:*) echo hppa64-unknown-linux-gnu exit 0 ;; s390:Linux:*:* | s390x:Linux:*:*) echo ${UNAME_MACHINE}-${VENDOR:-ibm}-linux-gnu exit 0 ;; sh64*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit 0 ;; sh*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit 0 ;; sparc:Linux:*:* | sparc64:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit 0 ;; x86_64:Linux:*:*) echo x86_64-${VENDOR:-unknown}-linux-gnu exit 0 ;; i*86:Linux:*:*) # The BFD linker knows what the default object file format is, so # first see if it will tell us. cd to the root directory to prevent # problems with other programs or directories called `ld' in the path. # Set LC_ALL=C to ensure ld outputs messages in English. ld_supported_targets=`cd /; LC_ALL=C ld --help 2>&1 \ | sed -ne '/supported targets:/!d s/[ ][ ]*/ /g s/.*supported targets: *// s/ .*// p'` case "$ld_supported_targets" in elf32-i386) TENTATIVE="${UNAME_MACHINE}-pc-linux-gnu" ;; a.out-i386-linux) echo "${UNAME_MACHINE}-pc-linux-gnuaout" exit 0 ;; coff-i386) echo "${UNAME_MACHINE}-pc-linux-gnucoff" exit 0 ;; "") # Either a pre-BFD a.out linker (linux-gnuoldld) or # one that does not give us useful --help. echo "${UNAME_MACHINE}-pc-linux-gnuoldld" exit 0 ;; esac # Determine whether the default compiler is a.out or elf eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #include #ifdef __ELF__ # ifdef __GLIBC__ # if __GLIBC__ >= 2 LIBC=gnu # else LIBC=gnulibc1 # endif # else LIBC=gnulibc1 # endif #else #ifdef __INTEL_COMPILER LIBC=gnu #else LIBC=gnuaout #endif #endif EOF eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep ^LIBC=` test x"${LIBC}" != x && echo "${UNAME_MACHINE}-${VENDOR:-pc}-linux-${LIBC}" && exit 0 test x"${TENTATIVE}" != x && echo "${TENTATIVE}" && exit 0 ;; i*86:DYNIX/ptx:4*:*) # ptx 4.0 does uname -s correctly, with DYNIX/ptx in there. # earlier versions are messed up and put the nodename in both # sysname and nodename. echo i386-sequent-sysv4 exit 0 ;; i*86:UNIX_SV:4.2MP:2.*) # Unixware is an offshoot of SVR4, but it has its own version # number series starting with 2... # I am not positive that other SVR4 systems won't match this, # I just have to hope. -- rms. # Use sysv4.2uw... so that sysv4* matches it. echo ${UNAME_MACHINE}-pc-sysv4.2uw${UNAME_VERSION} exit 0 ;; i*86:OS/2:*:*) # If we were able to find `uname', then EMX Unix compatibility # is probably installed. echo ${UNAME_MACHINE}-pc-os2-emx exit 0 ;; i*86:XTS-300:*:STOP) echo ${UNAME_MACHINE}-unknown-stop exit 0 ;; i*86:atheos:*:*) echo ${UNAME_MACHINE}-unknown-atheos exit 0 ;; i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.0*:*) echo i386-unknown-lynxos${UNAME_RELEASE} exit 0 ;; i*86:*DOS:*:*) echo ${UNAME_MACHINE}-pc-msdosdjgpp exit 0 ;; i*86:*:4.*:* | i*86:SYSTEM_V:4.*:*) UNAME_REL=`echo ${UNAME_RELEASE} | sed 's/\/MP$//'` if grep Novell /usr/include/link.h >/dev/null 2>/dev/null; then echo ${UNAME_MACHINE}-univel-sysv${UNAME_REL} else echo ${UNAME_MACHINE}-pc-sysv${UNAME_REL} fi exit 0 ;; i*86:*:5:[78]*) case `/bin/uname -X | grep "^Machine"` in *486*) UNAME_MACHINE=i486 ;; *Pentium) UNAME_MACHINE=i586 ;; *Pent*|*Celeron) UNAME_MACHINE=i686 ;; esac echo ${UNAME_MACHINE}-unknown-sysv${UNAME_RELEASE}${UNAME_SYSTEM}${UNAME_VERSION} exit 0 ;; i*86:*:3.2:*) if test -f /usr/options/cb.name; then UNAME_REL=`sed -n 's/.*Version //p' /dev/null >/dev/null ; then UNAME_REL=`(/bin/uname -X|grep Release|sed -e 's/.*= //')` (/bin/uname -X|grep i80486 >/dev/null) && UNAME_MACHINE=i486 (/bin/uname -X|grep '^Machine.*Pentium' >/dev/null) \ && UNAME_MACHINE=i586 (/bin/uname -X|grep '^Machine.*Pent *II' >/dev/null) \ && UNAME_MACHINE=i686 (/bin/uname -X|grep '^Machine.*Pentium Pro' >/dev/null) \ && UNAME_MACHINE=i686 echo ${UNAME_MACHINE}-pc-sco$UNAME_REL else echo ${UNAME_MACHINE}-pc-sysv32 fi exit 0 ;; pc:*:*:*) # Left here for compatibility: # uname -m prints for DJGPP always 'pc', but it prints nothing about # the processor, so we play safe by assuming i386. echo i386-pc-msdosdjgpp exit 0 ;; Intel:Mach:3*:*) echo i386-pc-mach3 exit 0 ;; paragon:*:*:*) echo i860-intel-osf1 exit 0 ;; i860:*:4.*:*) # i860-SVR4 if grep Stardent /usr/include/sys/uadmin.h >/dev/null 2>&1 ; then echo i860-stardent-sysv${UNAME_RELEASE} # Stardent Vistra i860-SVR4 else # Add other i860-SVR4 vendors below as they are discovered. echo i860-unknown-sysv${UNAME_RELEASE} # Unknown i860-SVR4 fi exit 0 ;; mini*:CTIX:SYS*5:*) # "miniframe" echo m68010-convergent-sysv exit 0 ;; mc68k:UNIX:SYSTEM5:3.51m) echo m68k-convergent-sysv exit 0 ;; M680?0:D-NIX:5.3:*) echo m68k-diab-dnix exit 0 ;; M68*:*:R3V[567]*:*) test -r /sysV68 && echo 'm68k-motorola-sysv' && exit 0 ;; 3[34]??:*:4.0:3.0 | 3[34]??A:*:4.0:3.0 | 3[34]??,*:*:4.0:3.0 | 3[34]??/*:*:4.0:3.0 | 4400:*:4.0:3.0 | 4850:*:4.0:3.0 | SKA40:*:4.0:3.0 | SDS2:*:4.0:3.0 | SHG2:*:4.0:3.0) OS_REL='' test -r /etc/.relid \ && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid` /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ && echo i486-ncr-sysv4.3${OS_REL} && exit 0 /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \ && echo i586-ncr-sysv4.3${OS_REL} && exit 0 ;; 3[34]??:*:4.0:* | 3[34]??,*:*:4.0:*) /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ && echo i486-ncr-sysv4 && exit 0 ;; m68*:LynxOS:2.*:* | m68*:LynxOS:3.0*:*) echo m68k-unknown-lynxos${UNAME_RELEASE} exit 0 ;; mc68030:UNIX_System_V:4.*:*) echo m68k-atari-sysv4 exit 0 ;; TSUNAMI:LynxOS:2.*:*) echo sparc-unknown-lynxos${UNAME_RELEASE} exit 0 ;; rs6000:LynxOS:2.*:*) echo rs6000-unknown-lynxos${UNAME_RELEASE} exit 0 ;; PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:* | PowerPC:LynxOS:4.0*:*) echo powerpc-unknown-lynxos${UNAME_RELEASE} exit 0 ;; SM[BE]S:UNIX_SV:*:*) echo mips-dde-sysv${UNAME_RELEASE} exit 0 ;; RM*:ReliantUNIX-*:*:*) echo mips-sni-sysv4 exit 0 ;; RM*:SINIX-*:*:*) echo mips-sni-sysv4 exit 0 ;; *:SINIX-*:*:*) if uname -p 2>/dev/null >/dev/null ; then UNAME_MACHINE=`(uname -p) 2>/dev/null` echo ${UNAME_MACHINE}-sni-sysv4 else echo ns32k-sni-sysv fi exit 0 ;; PENTIUM:*:4.0*:*) # Unisys `ClearPath HMP IX 4000' SVR4/MP effort # says echo i586-unisys-sysv4 exit 0 ;; *:UNIX_System_V:4*:FTX*) # From Gerald Hewes . # How about differentiating between stratus architectures? -djm echo hppa1.1-stratus-sysv4 exit 0 ;; *:*:*:FTX*) # From seanf@swdc.stratus.com. echo i860-stratus-sysv4 exit 0 ;; *:VOS:*:*) # From Paul.Green@stratus.com. echo hppa1.1-stratus-vos exit 0 ;; mc68*:A/UX:*:*) echo m68k-apple-aux${UNAME_RELEASE} exit 0 ;; news*:NEWS-OS:6*:*) echo mips-sony-newsos6 exit 0 ;; R[34]000:*System_V*:*:* | R4000:UNIX_SYSV:*:* | R*000:UNIX_SV:*:*) if [ -d /usr/nec ]; then echo mips-nec-sysv${UNAME_RELEASE} else echo mips-unknown-sysv${UNAME_RELEASE} fi exit 0 ;; BeBox:BeOS:*:*) # BeOS running on hardware made by Be, PPC only. echo powerpc-be-beos exit 0 ;; BeMac:BeOS:*:*) # BeOS running on Mac or Mac clone, PPC only. echo powerpc-apple-beos exit 0 ;; BePC:BeOS:*:*) # BeOS running on Intel PC compatible. echo i586-pc-beos exit 0 ;; SX-4:SUPER-UX:*:*) echo sx4-nec-superux${UNAME_RELEASE} exit 0 ;; SX-5:SUPER-UX:*:*) echo sx5-nec-superux${UNAME_RELEASE} exit 0 ;; SX-6:SUPER-UX:*:*) echo sx6-nec-superux${UNAME_RELEASE} exit 0 ;; Power*:Rhapsody:*:*) echo powerpc-apple-rhapsody${UNAME_RELEASE} exit 0 ;; *:Rhapsody:*:*) echo ${UNAME_MACHINE}-apple-rhapsody${UNAME_RELEASE} exit 0 ;; *:Darwin:*:*) case `uname -p` in *86) UNAME_PROCESSOR=i686 ;; powerpc) UNAME_PROCESSOR=powerpc ;; esac echo ${UNAME_PROCESSOR}-apple-darwin${UNAME_RELEASE} exit 0 ;; *:procnto*:*:* | *:QNX:[0123456789]*:*) UNAME_PROCESSOR=`uname -p` if test "$UNAME_PROCESSOR" = "x86"; then UNAME_PROCESSOR=i386 UNAME_MACHINE=pc fi echo ${UNAME_PROCESSOR}-${UNAME_MACHINE}-nto-qnx${UNAME_RELEASE} exit 0 ;; *:QNX:*:4*) echo i386-pc-qnx exit 0 ;; NSR-[DGKLNPTVW]:NONSTOP_KERNEL:*:*) echo nsr-tandem-nsk${UNAME_RELEASE} exit 0 ;; *:NonStop-UX:*:*) echo mips-compaq-nonstopux exit 0 ;; BS2000:POSIX*:*:*) echo bs2000-siemens-sysv exit 0 ;; DS/*:UNIX_System_V:*:*) echo ${UNAME_MACHINE}-${UNAME_SYSTEM}-${UNAME_RELEASE} exit 0 ;; *:Plan9:*:*) # "uname -m" is not consistent, so use $cputype instead. 386 # is converted to i386 for consistency with other x86 # operating systems. if test "$cputype" = "386"; then UNAME_MACHINE=i386 else UNAME_MACHINE="$cputype" fi echo ${UNAME_MACHINE}-unknown-plan9 exit 0 ;; *:TOPS-10:*:*) echo pdp10-unknown-tops10 exit 0 ;; *:TENEX:*:*) echo pdp10-unknown-tenex exit 0 ;; KS10:TOPS-20:*:* | KL10:TOPS-20:*:* | TYPE4:TOPS-20:*:*) echo pdp10-dec-tops20 exit 0 ;; XKL-1:TOPS-20:*:* | TYPE5:TOPS-20:*:*) echo pdp10-xkl-tops20 exit 0 ;; *:TOPS-20:*:*) echo pdp10-unknown-tops20 exit 0 ;; *:ITS:*:*) echo pdp10-unknown-its exit 0 ;; SEI:*:*:SEIUX) echo mips-sei-seiux${UNAME_RELEASE} exit 0 ;; esac #echo '(No uname command or uname output not recognized.)' 1>&2 #echo "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" 1>&2 eval $set_cc_for_build cat >$dummy.c < # include #endif main () { #if defined (sony) #if defined (MIPSEB) /* BFD wants "bsd" instead of "newsos". Perhaps BFD should be changed, I don't know.... */ printf ("mips-sony-bsd\n"); exit (0); #else #include printf ("m68k-sony-newsos%s\n", #ifdef NEWSOS4 "4" #else "" #endif ); exit (0); #endif #endif #if defined (__arm) && defined (__acorn) && defined (__unix) printf ("arm-acorn-riscix"); exit (0); #endif #if defined (hp300) && !defined (hpux) printf ("m68k-hp-bsd\n"); exit (0); #endif #if defined (NeXT) #if !defined (__ARCHITECTURE__) #define __ARCHITECTURE__ "m68k" #endif int version; version=`(hostinfo | sed -n 's/.*NeXT Mach \([0-9]*\).*/\1/p') 2>/dev/null`; if (version < 4) printf ("%s-next-nextstep%d\n", __ARCHITECTURE__, version); else printf ("%s-next-openstep%d\n", __ARCHITECTURE__, version); exit (0); #endif #if defined (MULTIMAX) || defined (n16) #if defined (UMAXV) printf ("ns32k-encore-sysv\n"); exit (0); #else #if defined (CMU) printf ("ns32k-encore-mach\n"); exit (0); #else printf ("ns32k-encore-bsd\n"); exit (0); #endif #endif #endif #if defined (__386BSD__) printf ("i386-pc-bsd\n"); exit (0); #endif #if defined (sequent) #if defined (i386) printf ("i386-sequent-dynix\n"); exit (0); #endif #if defined (ns32000) printf ("ns32k-sequent-dynix\n"); exit (0); #endif #endif #if defined (_SEQUENT_) struct utsname un; uname(&un); if (strncmp(un.version, "V2", 2) == 0) { printf ("i386-sequent-ptx2\n"); exit (0); } if (strncmp(un.version, "V1", 2) == 0) { /* XXX is V1 correct? */ printf ("i386-sequent-ptx1\n"); exit (0); } printf ("i386-sequent-ptx\n"); exit (0); #endif #if defined (vax) # if !defined (ultrix) # include # if defined (BSD) # if BSD == 43 printf ("vax-dec-bsd4.3\n"); exit (0); # else # if BSD == 199006 printf ("vax-dec-bsd4.3reno\n"); exit (0); # else printf ("vax-dec-bsd\n"); exit (0); # endif # endif # else printf ("vax-dec-bsd\n"); exit (0); # endif # else printf ("vax-dec-ultrix\n"); exit (0); # endif #endif #if defined (alliant) && defined (i860) printf ("i860-alliant-bsd\n"); exit (0); #endif exit (1); } EOF $CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null && $dummy && exit 0 # Apollos put the system type in the environment. test -d /usr/apollo && { echo ${ISP}-apollo-${SYSTYPE}; exit 0; } # Convex versions that predate uname can use getsysinfo(1) if [ -x /usr/convex/getsysinfo ] then case `getsysinfo -f cpu_type` in c1*) echo c1-convex-bsd exit 0 ;; c2*) if getsysinfo -f scalar_acc then echo c32-convex-bsd else echo c2-convex-bsd fi exit 0 ;; c34*) echo c34-convex-bsd exit 0 ;; c38*) echo c38-convex-bsd exit 0 ;; c4*) echo c4-convex-bsd exit 0 ;; esac fi cat >&2 < in order to provide the needed information to handle your system. config.guess timestamp = $timestamp uname -m = `(uname -m) 2>/dev/null || echo unknown` uname -r = `(uname -r) 2>/dev/null || echo unknown` uname -s = `(uname -s) 2>/dev/null || echo unknown` uname -v = `(uname -v) 2>/dev/null || echo unknown` /usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null` /bin/uname -X = `(/bin/uname -X) 2>/dev/null` hostinfo = `(hostinfo) 2>/dev/null` /bin/universe = `(/bin/universe) 2>/dev/null` /usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null` /bin/arch = `(/bin/arch) 2>/dev/null` /usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null` /usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null` UNAME_MACHINE = ${UNAME_MACHINE} UNAME_RELEASE = ${UNAME_RELEASE} UNAME_SYSTEM = ${UNAME_SYSTEM} UNAME_VERSION = ${UNAME_VERSION} EOF exit 1 # Local variables: # eval: (add-hook 'write-file-hooks 'time-stamp) # time-stamp-start: "timestamp='" # time-stamp-format: "%:y-%02m-%02d" # time-stamp-end: "'" # End: tango-8.1.2c+dfsg.orig/lib/cpp/log4tango/config/Makefile.in0000644000175000017500000002452012205375130022334 0ustar piccapicca# Makefile.in generated by automake 1.11.3 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 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. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ subdir = config DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in config.guess \ config.sub depcomp install-sh ltmain.sh missing mkinstalldirs ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/AC_CREATE_PREFIX_CONFIG_H.m4 \ $(top_srcdir)/m4/AC_CXX_HAVE_SSTREAM.m4 \ $(top_srcdir)/m4/AC_CXX_NAMESPACES.m4 \ $(top_srcdir)/m4/AC_C_INT64_T.m4 \ $(top_srcdir)/m4/AC_FUNC_SNPRINTF.m4 \ $(top_srcdir)/m4/BB_CHECK_PTHREADS.m4 \ $(top_srcdir)/m4/BB_ENABLE_DOXYGEN.m4 \ $(top_srcdir)/m4/CREATE_GENERIC_CONFIG.m4 \ $(top_srcdir)/m4/PETI_PEDANTIC_GCC.m4 \ $(top_srcdir)/m4/RSSH_CHECK_SUNPRO_CC.m4 \ $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/configure.in am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(SHELL) $(top_srcdir)/config/mkinstalldirs CONFIG_HEADER = $(top_builddir)/include/config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = SOURCES = DIST_SOURCES = DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DOT = @DOT@ DOXYGEN = @DOXYGEN@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ GENERIC_CONFIG = @GENERIC_CONFIG@ GREP = @GREP@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ LT_VERSION = @LT_VERSION@ MAINT = @MAINT@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ VERSION = @VERSION@ 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@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ enable_dot = @enable_dot@ enable_html_docs = @enable_html_docs@ enable_latex_docs = @enable_latex_docs@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ all: all-am .SUFFIXES: $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu config/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu config/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs tags: TAGS TAGS: ctags: CTAGS CTAGS: distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile installdirs: install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: 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: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-generic clean-libtool mostlyclean-am distclean: distclean-am -rm -f Makefile distclean-am: clean-am distclean-generic dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-generic mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: .MAKE: install-am install-strip .PHONY: all all-am check check-am clean clean-generic clean-libtool \ distclean distclean-generic distclean-libtool 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-generic \ mostlyclean-libtool pdf pdf-am ps ps-am uninstall uninstall-am # 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: tango-8.1.2c+dfsg.orig/lib/cpp/log4tango/config/config.sub0000755000175000017500000007301512205375130022255 0ustar piccapicca#! /bin/sh # Configuration validation subroutine script. # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, # 2000, 2001, 2002, 2003 Free Software Foundation, Inc. timestamp='2003-06-18' # This file is (in principle) common to ALL GNU software. # The presence of a machine in this file suggests that SOME GNU software # can handle that machine. It does not imply ALL GNU software can. # # This file is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place - Suite 330, # Boston, MA 02111-1307, USA. # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that program. # Please send patches to . Submit a context # diff and a properly formatted ChangeLog entry. # # Configuration subroutine to validate and canonicalize a configuration type. # Supply the specified configuration type as an argument. # If it is invalid, we print an error message on stderr and exit with code 1. # Otherwise, we print the canonical config type on stdout and succeed. # This file is supposed to be the same for all GNU packages # and recognize all the CPU types, system types and aliases # that are meaningful with *any* GNU software. # Each package is responsible for reporting which valid configurations # it does not support. The user should be able to distinguish # a failure to support a valid configuration from a meaningless # configuration. # The goal of this file is to map all the various variations of a given # machine specification into a single specification in the form: # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM # or in some cases, the newer four-part form: # CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM # It is wrong to echo any other type of specification. me=`echo "$0" | sed -e 's,.*/,,'` usage="\ Usage: $0 [OPTION] CPU-MFR-OPSYS $0 [OPTION] ALIAS Canonicalize a configuration name. Operation modes: -h, --help print this help, then exit -t, --time-stamp print date of last modification, then exit -v, --version print version number, then exit Report bugs and patches to ." version="\ GNU config.sub ($timestamp) Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." help=" Try \`$me --help' for more information." # Parse command line while test $# -gt 0 ; do case $1 in --time-stamp | --time* | -t ) echo "$timestamp" ; exit 0 ;; --version | -v ) echo "$version" ; exit 0 ;; --help | --h* | -h ) echo "$usage"; exit 0 ;; -- ) # Stop option processing shift; break ;; - ) # Use stdin as input. break ;; -* ) echo "$me: invalid option $1$help" exit 1 ;; *local*) # First pass through any local machine types. echo $1 exit 0;; * ) break ;; esac done case $# in 0) echo "$me: missing argument$help" >&2 exit 1;; 1) ;; *) echo "$me: too many arguments$help" >&2 exit 1;; esac # Separate what the user gave into CPU-COMPANY and OS or KERNEL-OS (if any). # Here we must recognize all the valid KERNEL-OS combinations. maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'` case $maybe_os in nto-qnx* | linux-gnu* | freebsd*-gnu* | netbsd*-gnu* | storm-chaos* | os2-emx* | rtmk-nova*) os=-$maybe_os basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'` ;; *) basic_machine=`echo $1 | sed 's/-[^-]*$//'` if [ $basic_machine != $1 ] then os=`echo $1 | sed 's/.*-/-/'` else os=; fi ;; esac ### Let's recognize common machines as not being operating systems so ### that things like config.sub decstation-3100 work. We also ### recognize some manufacturers as not being operating systems, so we ### can provide default operating systems below. case $os in -sun*os*) # Prevent following clause from handling this invalid input. ;; -dec* | -mips* | -sequent* | -encore* | -pc532* | -sgi* | -sony* | \ -att* | -7300* | -3300* | -delta* | -motorola* | -sun[234]* | \ -unicom* | -ibm* | -next | -hp | -isi* | -apollo | -altos* | \ -convergent* | -ncr* | -news | -32* | -3600* | -3100* | -hitachi* |\ -c[123]* | -convex* | -sun | -crds | -omron* | -dg | -ultra | -tti* | \ -harris | -dolphin | -highlevel | -gould | -cbm | -ns | -masscomp | \ -apple | -axis) os= basic_machine=$1 ;; -sim | -cisco | -oki | -wec | -winbond) os= basic_machine=$1 ;; -scout) ;; -wrs) os=-vxworks basic_machine=$1 ;; -chorusos*) os=-chorusos basic_machine=$1 ;; -chorusrdb) os=-chorusrdb basic_machine=$1 ;; -hiux*) os=-hiuxwe2 ;; -sco5) os=-sco3.2v5 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -sco4) os=-sco3.2v4 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -sco3.2.[4-9]*) os=`echo $os | sed -e 's/sco3.2./sco3.2v/'` basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -sco3.2v[4-9]*) # Don't forget version if it is 3.2v4 or newer. basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -sco*) os=-sco3.2v2 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -udk*) basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -isc) os=-isc2.2 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -clix*) basic_machine=clipper-intergraph ;; -isc*) basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -lynx*) os=-lynxos ;; -ptx*) basic_machine=`echo $1 | sed -e 's/86-.*/86-sequent/'` ;; -windowsnt*) os=`echo $os | sed -e 's/windowsnt/winnt/'` ;; -psos*) os=-psos ;; -mint | -mint[0-9]*) basic_machine=m68k-atari os=-mint ;; esac # Decode aliases for certain CPU-COMPANY combinations. case $basic_machine in # Recognize the basic CPU types without company name. # Some are omitted here because they have special meanings below. 1750a | 580 \ | a29k \ | alpha | alphaev[4-8] | alphaev56 | alphaev6[78] | alphapca5[67] \ | alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] | alpha64pca5[67] \ | arc | arm | arm[bl]e | arme[lb] | armv[2345] | armv[345][lb] | avr \ | c4x | clipper \ | d10v | d30v | dlx | dsp16xx \ | fr30 | frv \ | h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \ | i370 | i860 | i960 | ia64 \ | ip2k \ | m32r | m68000 | m68k | m88k | mcore \ | mips | mipsbe | mipseb | mipsel | mipsle \ | mips16 \ | mips64 | mips64el \ | mips64vr | mips64vrel \ | mips64orion | mips64orionel \ | mips64vr4100 | mips64vr4100el \ | mips64vr4300 | mips64vr4300el \ | mips64vr5000 | mips64vr5000el \ | mipsisa32 | mipsisa32el \ | mipsisa32r2 | mipsisa32r2el \ | mipsisa64 | mipsisa64el \ | mipsisa64sb1 | mipsisa64sb1el \ | mipsisa64sr71k | mipsisa64sr71kel \ | mipstx39 | mipstx39el \ | mn10200 | mn10300 \ | msp430 \ | ns16k | ns32k \ | openrisc | or32 \ | pdp10 | pdp11 | pj | pjl \ | powerpc | powerpc64 | powerpc64le | powerpcle | ppcbe \ | pyramid \ | s390 | s390x \ | sh | sh[1234] | sh[23]e | sh[34]eb | shbe | shle | sh[1234]le | sh3ele \ | sh64 | sh64le \ | sparc | sparc64 | sparc86x | sparclet | sparclite | sparcv9 | sparcv9b \ | strongarm \ | tahoe | thumb | tic4x | tic80 | tron \ | v850 | v850e \ | we32k \ | x86 | xscale | xstormy16 | xtensa \ | z8k) basic_machine=$basic_machine-unknown ;; m6811 | m68hc11 | m6812 | m68hc12) # Motorola 68HC11/12. basic_machine=$basic_machine-unknown os=-none ;; m88110 | m680[12346]0 | m683?2 | m68360 | m5200 | v70 | w65 | z8k) ;; # We use `pc' rather than `unknown' # because (1) that's what they normally are, and # (2) the word "unknown" tends to confuse beginning users. i*86 | x86_64) basic_machine=$basic_machine-pc ;; # Object if more than one company name word. *-*-*) echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2 exit 1 ;; # Recognize the basic CPU types with company name. 580-* \ | a29k-* \ | alpha-* | alphaev[4-8]-* | alphaev56-* | alphaev6[78]-* \ | alpha64-* | alpha64ev[4-8]-* | alpha64ev56-* | alpha64ev6[78]-* \ | alphapca5[67]-* | alpha64pca5[67]-* | arc-* \ | arm-* | armbe-* | armle-* | armeb-* | armv*-* \ | avr-* \ | bs2000-* \ | c[123]* | c30-* | [cjt]90-* | c4x-* | c54x-* | c55x-* | c6x-* \ | clipper-* | cydra-* \ | d10v-* | d30v-* | dlx-* \ | elxsi-* \ | f30[01]-* | f700-* | fr30-* | frv-* | fx80-* \ | h8300-* | h8500-* \ | hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \ | i*86-* | i860-* | i960-* | ia64-* \ | ip2k-* \ | m32r-* \ | m68000-* | m680[012346]0-* | m68360-* | m683?2-* | m68k-* \ | m88110-* | m88k-* | mcore-* \ | mips-* | mipsbe-* | mipseb-* | mipsel-* | mipsle-* \ | mips16-* \ | mips64-* | mips64el-* \ | mips64vr-* | mips64vrel-* \ | mips64orion-* | mips64orionel-* \ | mips64vr4100-* | mips64vr4100el-* \ | mips64vr4300-* | mips64vr4300el-* \ | mips64vr5000-* | mips64vr5000el-* \ | mipsisa32-* | mipsisa32el-* \ | mipsisa32r2-* | mipsisa32r2el-* \ | mipsisa64-* | mipsisa64el-* \ | mipsisa64sb1-* | mipsisa64sb1el-* \ | mipsisa64sr71k-* | mipsisa64sr71kel-* \ | mipstx39-* | mipstx39el-* \ | msp430-* \ | none-* | np1-* | nv1-* | ns16k-* | ns32k-* \ | orion-* \ | pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \ | powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* | ppcbe-* \ | pyramid-* \ | romp-* | rs6000-* \ | s390-* | s390x-* \ | sh-* | sh[1234]-* | sh[23]e-* | sh[34]eb-* | shbe-* \ | shle-* | sh[1234]le-* | sh3ele-* | sh64-* | sh64le-* \ | sparc-* | sparc64-* | sparc86x-* | sparclet-* | sparclite-* \ | sparcv9-* | sparcv9b-* | strongarm-* | sv1-* | sx?-* \ | tahoe-* | thumb-* \ | tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* \ | tron-* \ | v850-* | v850e-* | vax-* \ | we32k-* \ | x86-* | x86_64-* | xps100-* | xscale-* | xstormy16-* \ | xtensa-* \ | ymp-* \ | z8k-*) ;; # Recognize the various machine names and aliases which stand # for a CPU type and a company and sometimes even an OS. 386bsd) basic_machine=i386-unknown os=-bsd ;; 3b1 | 7300 | 7300-att | att-7300 | pc7300 | safari | unixpc) basic_machine=m68000-att ;; 3b*) basic_machine=we32k-att ;; a29khif) basic_machine=a29k-amd os=-udi ;; adobe68k) basic_machine=m68010-adobe os=-scout ;; alliant | fx80) basic_machine=fx80-alliant ;; altos | altos3068) basic_machine=m68k-altos ;; am29k) basic_machine=a29k-none os=-bsd ;; amd64) basic_machine=x86_64-pc ;; amdahl) basic_machine=580-amdahl os=-sysv ;; amiga | amiga-*) basic_machine=m68k-unknown ;; amigaos | amigados) basic_machine=m68k-unknown os=-amigaos ;; amigaunix | amix) basic_machine=m68k-unknown os=-sysv4 ;; apollo68) basic_machine=m68k-apollo os=-sysv ;; apollo68bsd) basic_machine=m68k-apollo os=-bsd ;; aux) basic_machine=m68k-apple os=-aux ;; balance) basic_machine=ns32k-sequent os=-dynix ;; c90) basic_machine=c90-cray os=-unicos ;; convex-c1) basic_machine=c1-convex os=-bsd ;; convex-c2) basic_machine=c2-convex os=-bsd ;; convex-c32) basic_machine=c32-convex os=-bsd ;; convex-c34) basic_machine=c34-convex os=-bsd ;; convex-c38) basic_machine=c38-convex os=-bsd ;; cray | j90) basic_machine=j90-cray os=-unicos ;; crds | unos) basic_machine=m68k-crds ;; cris | cris-* | etrax*) basic_machine=cris-axis ;; da30 | da30-*) basic_machine=m68k-da30 ;; decstation | decstation-3100 | pmax | pmax-* | pmin | dec3100 | decstatn) basic_machine=mips-dec ;; decsystem10* | dec10*) basic_machine=pdp10-dec os=-tops10 ;; decsystem20* | dec20*) basic_machine=pdp10-dec os=-tops20 ;; delta | 3300 | motorola-3300 | motorola-delta \ | 3300-motorola | delta-motorola) basic_machine=m68k-motorola ;; delta88) basic_machine=m88k-motorola os=-sysv3 ;; dpx20 | dpx20-*) basic_machine=rs6000-bull os=-bosx ;; dpx2* | dpx2*-bull) basic_machine=m68k-bull os=-sysv3 ;; ebmon29k) basic_machine=a29k-amd os=-ebmon ;; elxsi) basic_machine=elxsi-elxsi os=-bsd ;; encore | umax | mmax) basic_machine=ns32k-encore ;; es1800 | OSE68k | ose68k | ose | OSE) basic_machine=m68k-ericsson os=-ose ;; fx2800) basic_machine=i860-alliant ;; genix) basic_machine=ns32k-ns ;; gmicro) basic_machine=tron-gmicro os=-sysv ;; go32) basic_machine=i386-pc os=-go32 ;; h3050r* | hiux*) basic_machine=hppa1.1-hitachi os=-hiuxwe2 ;; h8300hms) basic_machine=h8300-hitachi os=-hms ;; h8300xray) basic_machine=h8300-hitachi os=-xray ;; h8500hms) basic_machine=h8500-hitachi os=-hms ;; harris) basic_machine=m88k-harris os=-sysv3 ;; hp300-*) basic_machine=m68k-hp ;; hp300bsd) basic_machine=m68k-hp os=-bsd ;; hp300hpux) basic_machine=m68k-hp os=-hpux ;; hp3k9[0-9][0-9] | hp9[0-9][0-9]) basic_machine=hppa1.0-hp ;; hp9k2[0-9][0-9] | hp9k31[0-9]) basic_machine=m68000-hp ;; hp9k3[2-9][0-9]) basic_machine=m68k-hp ;; hp9k6[0-9][0-9] | hp6[0-9][0-9]) basic_machine=hppa1.0-hp ;; hp9k7[0-79][0-9] | hp7[0-79][0-9]) basic_machine=hppa1.1-hp ;; hp9k78[0-9] | hp78[0-9]) # FIXME: really hppa2.0-hp basic_machine=hppa1.1-hp ;; hp9k8[67]1 | hp8[67]1 | hp9k80[24] | hp80[24] | hp9k8[78]9 | hp8[78]9 | hp9k893 | hp893) # FIXME: really hppa2.0-hp basic_machine=hppa1.1-hp ;; hp9k8[0-9][13679] | hp8[0-9][13679]) basic_machine=hppa1.1-hp ;; hp9k8[0-9][0-9] | hp8[0-9][0-9]) basic_machine=hppa1.0-hp ;; hppa-next) os=-nextstep3 ;; hppaosf) basic_machine=hppa1.1-hp os=-osf ;; hppro) basic_machine=hppa1.1-hp os=-proelf ;; i370-ibm* | ibm*) basic_machine=i370-ibm ;; # I'm not sure what "Sysv32" means. Should this be sysv3.2? i*86v32) basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` os=-sysv32 ;; i*86v4*) basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` os=-sysv4 ;; i*86v) basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` os=-sysv ;; i*86sol2) basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` os=-solaris2 ;; i386mach) basic_machine=i386-mach os=-mach ;; i386-vsta | vsta) basic_machine=i386-unknown os=-vsta ;; iris | iris4d) basic_machine=mips-sgi case $os in -irix*) ;; *) os=-irix4 ;; esac ;; isi68 | isi) basic_machine=m68k-isi os=-sysv ;; m88k-omron*) basic_machine=m88k-omron ;; magnum | m3230) basic_machine=mips-mips os=-sysv ;; merlin) basic_machine=ns32k-utek os=-sysv ;; mingw32) basic_machine=i386-pc os=-mingw32 ;; miniframe) basic_machine=m68000-convergent ;; *mint | -mint[0-9]* | *MiNT | *MiNT[0-9]*) basic_machine=m68k-atari os=-mint ;; mips3*-*) basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'` ;; mips3*) basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`-unknown ;; mmix*) basic_machine=mmix-knuth os=-mmixware ;; monitor) basic_machine=m68k-rom68k os=-coff ;; morphos) basic_machine=powerpc-unknown os=-morphos ;; msdos) basic_machine=i386-pc os=-msdos ;; mvs) basic_machine=i370-ibm os=-mvs ;; ncr3000) basic_machine=i486-ncr os=-sysv4 ;; netbsd386) basic_machine=i386-unknown os=-netbsd ;; netwinder) basic_machine=armv4l-rebel os=-linux ;; news | news700 | news800 | news900) basic_machine=m68k-sony os=-newsos ;; news1000) basic_machine=m68030-sony os=-newsos ;; news-3600 | risc-news) basic_machine=mips-sony os=-newsos ;; necv70) basic_machine=v70-nec os=-sysv ;; next | m*-next ) basic_machine=m68k-next case $os in -nextstep* ) ;; -ns2*) os=-nextstep2 ;; *) os=-nextstep3 ;; esac ;; nh3000) basic_machine=m68k-harris os=-cxux ;; nh[45]000) basic_machine=m88k-harris os=-cxux ;; nindy960) basic_machine=i960-intel os=-nindy ;; mon960) basic_machine=i960-intel os=-mon960 ;; nonstopux) basic_machine=mips-compaq os=-nonstopux ;; np1) basic_machine=np1-gould ;; nv1) basic_machine=nv1-cray os=-unicosmp ;; nsr-tandem) basic_machine=nsr-tandem ;; op50n-* | op60c-*) basic_machine=hppa1.1-oki os=-proelf ;; or32 | or32-*) basic_machine=or32-unknown os=-coff ;; OSE68000 | ose68000) basic_machine=m68000-ericsson os=-ose ;; os68k) basic_machine=m68k-none os=-os68k ;; pa-hitachi) basic_machine=hppa1.1-hitachi os=-hiuxwe2 ;; paragon) basic_machine=i860-intel os=-osf ;; pbd) basic_machine=sparc-tti ;; pbb) basic_machine=m68k-tti ;; pc532 | pc532-*) basic_machine=ns32k-pc532 ;; pentium | p5 | k5 | k6 | nexgen | viac3) basic_machine=i586-pc ;; pentiumpro | p6 | 6x86 | athlon | athlon_*) basic_machine=i686-pc ;; pentiumii | pentium2 | pentiumiii | pentium3) basic_machine=i686-pc ;; pentium4) basic_machine=i786-pc ;; pentium-* | p5-* | k5-* | k6-* | nexgen-* | viac3-*) basic_machine=i586-`echo $basic_machine | sed 's/^[^-]*-//'` ;; pentiumpro-* | p6-* | 6x86-* | athlon-*) basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'` ;; pentiumii-* | pentium2-* | pentiumiii-* | pentium3-*) basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'` ;; pentium4-*) basic_machine=i786-`echo $basic_machine | sed 's/^[^-]*-//'` ;; pn) basic_machine=pn-gould ;; power) basic_machine=power-ibm ;; ppc) basic_machine=powerpc-unknown ;; ppc-*) basic_machine=powerpc-`echo $basic_machine | sed 's/^[^-]*-//'` ;; ppcle | powerpclittle | ppc-le | powerpc-little) basic_machine=powerpcle-unknown ;; ppcle-* | powerpclittle-*) basic_machine=powerpcle-`echo $basic_machine | sed 's/^[^-]*-//'` ;; ppc64) basic_machine=powerpc64-unknown ;; ppc64-*) basic_machine=powerpc64-`echo $basic_machine | sed 's/^[^-]*-//'` ;; ppc64le | powerpc64little | ppc64-le | powerpc64-little) basic_machine=powerpc64le-unknown ;; ppc64le-* | powerpc64little-*) basic_machine=powerpc64le-`echo $basic_machine | sed 's/^[^-]*-//'` ;; ps2) basic_machine=i386-ibm ;; pw32) basic_machine=i586-unknown os=-pw32 ;; rom68k) basic_machine=m68k-rom68k os=-coff ;; rm[46]00) basic_machine=mips-siemens ;; rtpc | rtpc-*) basic_machine=romp-ibm ;; sa29200) basic_machine=a29k-amd os=-udi ;; sb1) basic_machine=mipsisa64sb1-unknown ;; sb1el) basic_machine=mipsisa64sb1el-unknown ;; sei) basic_machine=mips-sei os=-seiux ;; sequent) basic_machine=i386-sequent ;; sh) basic_machine=sh-hitachi os=-hms ;; sh64) basic_machine=sh64-unknown ;; sparclite-wrs | simso-wrs) basic_machine=sparclite-wrs os=-vxworks ;; sps7) basic_machine=m68k-bull os=-sysv2 ;; spur) basic_machine=spur-unknown ;; st2000) basic_machine=m68k-tandem ;; stratus) basic_machine=i860-stratus os=-sysv4 ;; sun2) basic_machine=m68000-sun ;; sun2os3) basic_machine=m68000-sun os=-sunos3 ;; sun2os4) basic_machine=m68000-sun os=-sunos4 ;; sun3os3) basic_machine=m68k-sun os=-sunos3 ;; sun3os4) basic_machine=m68k-sun os=-sunos4 ;; sun4os3) basic_machine=sparc-sun os=-sunos3 ;; sun4os4) basic_machine=sparc-sun os=-sunos4 ;; sun4sol2) basic_machine=sparc-sun os=-solaris2 ;; sun3 | sun3-*) basic_machine=m68k-sun ;; sun4) basic_machine=sparc-sun ;; sun386 | sun386i | roadrunner) basic_machine=i386-sun ;; sv1) basic_machine=sv1-cray os=-unicos ;; symmetry) basic_machine=i386-sequent os=-dynix ;; t3e) basic_machine=alphaev5-cray os=-unicos ;; t90) 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 ;; tx39) basic_machine=mipstx39-unknown ;; tx39el) basic_machine=mipstx39el-unknown ;; toad1) basic_machine=pdp10-xkl os=-tops20 ;; tower | tower-32) basic_machine=m68k-ncr ;; udi29k) basic_machine=a29k-amd os=-udi ;; ultra3) basic_machine=a29k-nyu os=-sym1 ;; v810 | necv810) basic_machine=v810-nec os=-none ;; vaxv) basic_machine=vax-dec os=-sysv ;; vms) basic_machine=vax-dec os=-vms ;; vpp*|vx|vx-*) basic_machine=f301-fujitsu ;; vxworks960) basic_machine=i960-wrs os=-vxworks ;; vxworks68) basic_machine=m68k-wrs os=-vxworks ;; vxworks29k) basic_machine=a29k-wrs os=-vxworks ;; w65*) basic_machine=w65-wdc os=-none ;; w89k-*) basic_machine=hppa1.1-winbond os=-proelf ;; xps | xps100) basic_machine=xps100-honeywell ;; ymp) basic_machine=ymp-cray os=-unicos ;; z8k-*-coff) basic_machine=z8k-unknown os=-sim ;; none) basic_machine=none-none os=-none ;; # Here we handle the default manufacturer of certain CPU types. It is in # some cases the only manufacturer, in others, it is the most popular. w89k) basic_machine=hppa1.1-winbond ;; op50n) basic_machine=hppa1.1-oki ;; op60c) basic_machine=hppa1.1-oki ;; romp) basic_machine=romp-ibm ;; rs6000) basic_machine=rs6000-ibm ;; vax) basic_machine=vax-dec ;; pdp10) # there are many clones, so DEC is not a safe bet basic_machine=pdp10-unknown ;; pdp11) basic_machine=pdp11-dec ;; we32k) basic_machine=we32k-att ;; sh3 | sh4 | sh[34]eb | sh[1234]le | sh[23]ele) basic_machine=sh-unknown ;; sh64) basic_machine=sh64-unknown ;; sparc | sparcv9 | sparcv9b) basic_machine=sparc-sun ;; cydra) basic_machine=cydra-cydrome ;; orion) basic_machine=orion-highlevel ;; orion105) basic_machine=clipper-highlevel ;; mac | mpw | mac-mpw) basic_machine=m68k-apple ;; pmac | pmac-mpw) basic_machine=powerpc-apple ;; *-unknown) # Make sure to match an already-canonicalized machine name. ;; *) echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2 exit 1 ;; esac # Here we canonicalize certain aliases for manufacturers. case $basic_machine in *-digital*) basic_machine=`echo $basic_machine | sed 's/digital.*/dec/'` ;; *-commodore*) basic_machine=`echo $basic_machine | sed 's/commodore.*/cbm/'` ;; *) ;; esac # Decode manufacturer-specific aliases for certain operating systems. if [ x"$os" != x"" ] then case $os in # First match some system type aliases # that might get confused with valid system types. # -solaris* is a basic system type, with this one exception. -solaris1 | -solaris1.*) os=`echo $os | sed -e 's|solaris1|sunos4|'` ;; -solaris) os=-solaris2 ;; -svr4*) os=-sysv4 ;; -unixware*) os=-sysv4.2uw ;; -gnu/linux*) os=`echo $os | sed -e 's|gnu/linux|linux-gnu|'` ;; # First accept the basic system types. # The portable systems comes first. # Each alternative MUST END IN A *, to match a version number. # -sysv* is not here because it comes later, after sysvr4. -gnu* | -bsd* | -mach* | -minix* | -genix* | -ultrix* | -irix* \ | -*vms* | -sco* | -esix* | -isc* | -aix* | -sunos | -sunos[34]*\ | -hpux* | -unos* | -osf* | -luna* | -dgux* | -solaris* | -sym* \ | -amigaos* | -amigados* | -msdos* | -newsos* | -unicos* | -aof* \ | -aos* \ | -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \ | -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \ | -hiux* | -386bsd* | -netbsd* | -openbsd* | -freebsd* | -riscix* \ | -lynxos* | -bosx* | -nextstep* | -cxux* | -aout* | -elf* | -oabi* \ | -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \ | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \ | -chorusos* | -chorusrdb* \ | -cygwin* | -pe* | -psos* | -moss* | -proelf* | -rtems* \ | -mingw32* | -linux-gnu* | -uxpv* | -beos* | -mpeix* | -udk* \ | -interix* | -uwin* | -mks* | -rhapsody* | -darwin* | -opened* \ | -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \ | -storm-chaos* | -tops10* | -tenex* | -tops20* | -its* \ | -os2* | -vos* | -palmos* | -uclinux* | -nucleus* \ | -morphos* | -superux* | -rtmk* | -rtmk-nova* | -windiss* \ | -powermax* | -dnix* | -nx6 | -nx7 | -sei*) # Remember, each alternative MUST END IN *, to match a version number. ;; -qnx*) case $basic_machine in x86-* | i*86-*) ;; *) os=-nto$os ;; esac ;; -nto-qnx*) ;; -nto*) os=`echo $os | sed -e 's|nto|nto-qnx|'` ;; -sim | -es1800* | -hms* | -xray | -os68k* | -none* | -v88r* \ | -windows* | -osx | -abug | -netware* | -os9* | -beos* \ | -macos* | -mpw* | -magic* | -mmixware* | -mon960* | -lnews*) ;; -mac*) os=`echo $os | sed -e 's|mac|macos|'` ;; -linux*) os=`echo $os | sed -e 's|linux|linux-gnu|'` ;; -sunos5*) os=`echo $os | sed -e 's|sunos5|solaris2|'` ;; -sunos6*) os=`echo $os | sed -e 's|sunos6|solaris3|'` ;; -opened*) os=-openedition ;; -wince*) os=-wince ;; -osfrose*) os=-osfrose ;; -osf*) os=-osf ;; -utek*) os=-bsd ;; -dynix*) os=-bsd ;; -acis*) os=-aos ;; -atheos*) os=-atheos ;; -386bsd) os=-bsd ;; -ctix* | -uts*) os=-sysv ;; -nova*) os=-rtmk-nova ;; -ns2 ) os=-nextstep2 ;; -nsk*) os=-nsk ;; # Preserve the version number of sinix5. -sinix5.*) os=`echo $os | sed -e 's|sinix|sysv|'` ;; -sinix*) os=-sysv4 ;; -triton*) os=-sysv3 ;; -oss*) os=-sysv3 ;; -svr4) os=-sysv4 ;; -svr3) os=-sysv3 ;; -sysvr4) os=-sysv4 ;; # This must come after -sysvr4. -sysv*) ;; -ose*) os=-ose ;; -es1800*) os=-ose ;; -xenix) os=-xenix ;; -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*) os=-mint ;; -aros*) os=-aros ;; -kaos*) os=-kaos ;; -none) ;; *) # Get rid of the `-' at the beginning of $os. os=`echo $os | sed 's/[^-]*-//'` echo Invalid configuration \`$1\': system \`$os\' not recognized 1>&2 exit 1 ;; esac else # Here we handle the default operating systems that come with various machines. # The value should be what the vendor currently ships out the door with their # machine or put another way, the most popular os provided with the machine. # Note that if you're going to try to match "-MANUFACTURER" here (say, # "-sun"), then you have to tell the case statement up towards the top # that MANUFACTURER isn't an operating system. Otherwise, code above # will signal an error saying that MANUFACTURER isn't an operating # system, and we'll never get to this point. case $basic_machine in *-acorn) os=-riscix1.2 ;; arm*-rebel) os=-linux ;; arm*-semi) os=-aout ;; c4x-* | tic4x-*) os=-coff ;; # This must come before the *-dec entry. pdp10-*) os=-tops20 ;; pdp11-*) os=-none ;; *-dec | vax-*) os=-ultrix4.2 ;; m68*-apollo) os=-domain ;; i386-sun) os=-sunos4.0.2 ;; m68000-sun) os=-sunos3 # This also exists in the configure program, but was not the # default. # os=-sunos4 ;; m68*-cisco) os=-aout ;; mips*-cisco) os=-elf ;; mips*-*) os=-elf ;; or32-*) os=-coff ;; *-tti) # must be before sparc entry or we get the wrong os. os=-sysv3 ;; sparc-* | *-sun) os=-sunos4.1.1 ;; *-be) os=-beos ;; *-ibm) os=-aix ;; *-wec) os=-proelf ;; *-winbond) os=-proelf ;; *-oki) os=-proelf ;; *-hp) os=-hpux ;; *-hitachi) os=-hiux ;; i860-* | *-att | *-ncr | *-altos | *-motorola | *-convergent) os=-sysv ;; *-cbm) os=-amigaos ;; *-dg) os=-dgux ;; *-dolphin) os=-sysv3 ;; m68k-ccur) os=-rtu ;; m88k-omron*) os=-luna ;; *-next ) os=-nextstep ;; *-sequent) os=-ptx ;; *-crds) os=-unos ;; *-ns) os=-genix ;; i370-*) os=-mvs ;; *-next) os=-nextstep3 ;; *-gould) os=-sysv ;; *-highlevel) os=-bsd ;; *-encore) os=-bsd ;; *-sgi) os=-irix ;; *-siemens) os=-sysv4 ;; *-masscomp) os=-rtu ;; f30[01]-fujitsu | f700-fujitsu) os=-uxpv ;; *-rom68k) os=-coff ;; *-*bug) os=-coff ;; *-apple) os=-macos ;; *-atari*) os=-mint ;; *) os=-none ;; esac fi # Here we handle the case where we know the os, and the CPU type, but not the # manufacturer. We pick the logical manufacturer. vendor=unknown case $basic_machine in *-unknown) case $os in -riscix*) vendor=acorn ;; -sunos*) vendor=sun ;; -aix*) vendor=ibm ;; -beos*) vendor=be ;; -hpux*) vendor=hp ;; -mpeix*) vendor=hp ;; -hiux*) vendor=hitachi ;; -unos*) vendor=crds ;; -dgux*) vendor=dg ;; -luna*) vendor=omron ;; -genix*) vendor=ns ;; -mvs* | -opened*) vendor=ibm ;; -ptx*) vendor=sequent ;; -vxsim* | -vxworks* | -windiss*) vendor=wrs ;; -aux*) vendor=apple ;; -hms*) vendor=hitachi ;; -mpw* | -macos*) vendor=apple ;; -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*) vendor=atari ;; -vos*) vendor=stratus ;; esac basic_machine=`echo $basic_machine | sed "s/unknown/$vendor/"` ;; esac echo $basic_machine$os exit 0 # Local variables: # eval: (add-hook 'write-file-hooks 'time-stamp) # time-stamp-start: "timestamp='" # time-stamp-format: "%:y-%02m-%02d" # time-stamp-end: "'" # End: tango-8.1.2c+dfsg.orig/lib/cpp/log4tango/config/ltmain.sh0000755000175000017500000105204012205375130022111 0ustar piccapicca # 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, 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. # GNU Libtool 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. # # As a special exception to the GNU General Public License, # if you distribute this file as part of a program or library that # is built using GNU Libtool, you may include this file under the # same distribution terms that you use for the rest of that program. # # GNU Libtool 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 GNU Libtool; see the file COPYING. If not, a copy # can be downloaded from http://www.gnu.org/licenses/gpl.html, # or obtained by writing to the Free Software Foundation, Inc., # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. # Usage: $progname [OPTION]... [MODE-ARG]... # # 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 # --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 # # 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.4.2 Debian-2.4.2-1ubuntu1 # automake: $automake_version # autoconf: $autoconf_version # # Report bugs to . # GNU libtool home page: . # General help using GNU software: . PROGRAM=libtool PACKAGE=libtool VERSION="2.4.2 Debian-2.4.2-1ubuntu1" TIMESTAMP="" package_revision=1.3337 # Be Bourne compatible if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then emulate sh NULLCMD=: # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' setopt NO_GLOB_SUBST else case `(set -o) 2>/dev/null` in *posix*) set -o posix;; esac fi 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. lt_user_locale= lt_safe_locale= for lt_var in LANG LANGUAGE LC_ALL LC_CTYPE LC_COLLATE LC_MESSAGES do eval "if test \"\${$lt_var+set}\" = set; then save_$lt_var=\$$lt_var $lt_var=C export $lt_var lt_user_locale=\"$lt_var=\\\$save_\$lt_var; \$lt_user_locale\" 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"} test "${ECHO+set}" = set || ECHO=${as_echo-'printf %s\n'} : ${MAKE="make"} : ${MKDIR="mkdir"} : ${MV="mv -f"} : ${RM="rm -f"} : ${SHELL="${CONFIG_SHELL-/bin/sh}"} : ${Xsed="$SED -e 1s/^X//"} # Global variables: EXIT_SUCCESS=0 EXIT_FAILURE=1 EXIT_MISMATCH=63 # $? = 63 is used to indicate version mismatch to missing. EXIT_SKIP=77 # $? = 77 is used to indicate a skipped test to automake. exit_status=$EXIT_SUCCESS # Make sure IFS has a sensible default lt_nl=' ' IFS=" $lt_nl" 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: # 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 () { # 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 } # 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 # 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: func_dirname_and_basename "$progpath" progname=$func_basename_result # Make sure we have an absolute path for reexecution: case $progpath in [\\/]*|[A-Za-z]:\\*) ;; *[\\/]*) progdir=$func_dirname_result progdir=`cd "$progdir" && pwd` progpath="$progdir/$progname" ;; *) save_IFS="$IFS" IFS=${PATH_SEPARATOR-:} for progdir in $PATH; do IFS="$save_IFS" test -x "$progdir/$progname" && break done IFS="$save_IFS" test -n "$progdir" || progdir=`pwd` progpath="$progdir/$progname" ;; esac # 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='s/\([`"$\\]\)/\\\1/g' # 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. # Since each input `\' is now two `\'s, look for any number of runs of # four `\'s followed by two `\'s and then a '$'. `\' that '$'. bs='\\' bs2='\\\\' bs4='\\\\\\\\' dollar='\$' sed_double_backslash="\ s/$bs4/&\\ /g s/^$bs2$dollar/$bs&/ s/\\([^$bs]\\)$bs2$dollar/\\1$bs2$bs$dollar/g s/\n//g" # Standard options: opt_dry_run=false opt_help=false opt_quiet=false opt_verbose=false opt_warning=: # func_echo arg... # Echo program name prefixed message, along with the current mode # name if it has been set yet. func_echo () { $ECHO "$progname: ${opt_mode+$opt_mode: }$*" } # func_verbose arg... # Echo program name prefixed message in verbose mode only. func_verbose () { $opt_verbose && func_echo ${1+"$@"} # A bug in bash halts the script if the last line of a function # fails when set -e is in force, so we need another command to # work around that: : } # 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: ${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: ${opt_mode+$opt_mode: }warning: "${1+"$@"} 1>&2 # bash bug again: : } # func_fatal_error arg... # Echo program name prefixed message to standard error, and exit. func_fatal_error () { func_error ${1+"$@"} exit $EXIT_FAILURE } # func_fatal_help arg... # Echo program name prefixed message to standard error, followed by # a help hint, and exit. func_fatal_help () { func_error ${1+"$@"} func_fatal_error "$help" } help="Try \`$progname --help' for more information." ## default # func_grep expression filename # Check whether EXPRESSION matches any line of FILENAME, without output. func_grep () { $GREP "$1" "$2" >/dev/null 2>&1 } # func_mkdir_p directory-path # Make sure the entire path to DIRECTORY-PATH is available. func_mkdir_p () { my_directory_path="$1" my_dir_list= if test -n "$my_directory_path" && test "$opt_dry_run" != ":"; then # Protect directory names starting with `-' case $my_directory_path in -*) my_directory_path="./$my_directory_path" ;; esac # While some portion of DIR does not yet exist... while test ! -d "$my_directory_path"; do # ...make a list in topmost first order. Use a colon delimited # list incase some portion of path contains whitespace. my_dir_list="$my_directory_path:$my_dir_list" # If the last portion added has no slash in it, the list is done case $my_directory_path in */*) ;; *) break ;; esac # ...otherwise throw away the child directory and loop my_directory_path=`$ECHO "$my_directory_path" | $SED -e "$dirname"` done my_dir_list=`$ECHO "$my_dir_list" | $SED 's,:*$,,'` save_mkdir_p_IFS="$IFS"; IFS=':' for my_dir in $my_dir_list; do IFS="$save_mkdir_p_IFS" # mkdir can fail with a `File exist' error if two processes # try to create one of the directories concurrently. Don't # stop in that case! $MKDIR "$my_dir" 2>/dev/null || : done IFS="$save_mkdir_p_IFS" # Bail out if we (or some other process) failed to create a directory. test -d "$my_directory_path" || \ func_fatal_error "Failed to create \`$1'" fi } # func_mktempdir [string] # Make a temporary directory that won't clash with other running # libtool processes, and avoids race conditions if possible. If # given, STRING is the basename for that directory. func_mktempdir () { my_template="${TMPDIR-/tmp}/${1-$progname}" if test "$opt_dry_run" = ":"; then # Return a directory name, but don't create it in dry-run mode my_tmpdir="${my_template}-$$" else # If mktemp works, use that first and foremost my_tmpdir=`mktemp -d "${my_template}-XXXXXXXX" 2>/dev/null` if test ! -d "$my_tmpdir"; then # Failing that, at least try and use $RANDOM to avoid a race my_tmpdir="${my_template}-${RANDOM-0}$$" save_mktempdir_umask=`umask` umask 0077 $MKDIR "$my_tmpdir" umask $save_mktempdir_umask fi # If we're not in dry-run mode, bomb out on failure test -d "$my_tmpdir" || \ func_fatal_error "cannot create temporary directory \`$my_tmpdir'" fi $ECHO "$my_tmpdir" } # func_quote_for_eval arg # Aesthetically quote ARG to be evaled later. # This function returns two values: FUNC_QUOTE_FOR_EVAL_RESULT # is double-quoted, suitable for a subsequent eval, whereas # FUNC_QUOTE_FOR_EVAL_UNQUOTED_RESULT has merely all characters # which are still active within double quotes backslashified. func_quote_for_eval () { case $1 in *[\\\`\"\$]*) func_quote_for_eval_unquoted_result=`$ECHO "$1" | $SED "$sed_quote_subst"` ;; *) func_quote_for_eval_unquoted_result="$1" ;; esac case $func_quote_for_eval_unquoted_result in # Double-quote args containing shell metacharacters to delay # word splitting, command substitution and and variable # expansion for a subsequent eval. # Many Bourne shells cannot handle close brackets correctly # in scan sets, so we specify it separately. *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") func_quote_for_eval_result="\"$func_quote_for_eval_unquoted_result\"" ;; *) func_quote_for_eval_result="$func_quote_for_eval_unquoted_result" esac } # func_quote_for_expand arg # Aesthetically quote ARG to be evaled later; same as above, # but do not quote variable references. func_quote_for_expand () { case $1 in *[\\\`\"]*) my_arg=`$ECHO "$1" | $SED \ -e "$double_quote_subst" -e "$sed_double_backslash"` ;; *) my_arg="$1" ;; esac case $my_arg in # Double-quote args containing shell metacharacters to delay # word splitting and command substitution for a subsequent eval. # Many Bourne shells cannot handle close brackets correctly # in scan sets, so we specify it separately. *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") my_arg="\"$my_arg\"" ;; esac func_quote_for_expand_result="$my_arg" } # func_show_eval cmd [fail_exp] # Unless opt_silent is true, then output CMD. Then, if opt_dryrun is # not true, evaluate CMD. If the evaluation of CMD fails, and FAIL_EXP # is given, then evaluate it. func_show_eval () { my_cmd="$1" my_fail_exp="${2-:}" ${opt_silent-false} || { func_quote_for_expand "$my_cmd" eval "func_echo $func_quote_for_expand_result" } if ${opt_dry_run-false}; then :; else eval "$my_cmd" my_status=$? if test "$my_status" -eq 0; then :; else eval "(exit $my_status); $my_fail_exp" fi fi } # func_show_eval_locale cmd [fail_exp] # Unless opt_silent is true, then output CMD. Then, if opt_dryrun is # not true, evaluate CMD. If the evaluation of CMD fails, and FAIL_EXP # is given, then evaluate it. Use the saved locale for evaluation. func_show_eval_locale () { my_cmd="$1" my_fail_exp="${2-:}" ${opt_silent-false} || { func_quote_for_expand "$my_cmd" eval "func_echo $func_quote_for_expand_result" } if ${opt_dry_run-false}; then :; else eval "$lt_user_locale $my_cmd" my_status=$? eval "$lt_safe_locale" if test "$my_status" -eq 0; then :; else eval "(exit $my_status); $my_fail_exp" fi 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 () { $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/ p }' < "$progpath" exit $? } # func_usage # Echo short help message to standard output and exit. func_usage () { $opt_debug $SED -n '/^# Usage:/,/^# *.*--help/ { s/^# // s/^# *$// s/\$progname/'$progname'/ p }' < "$progpath" echo $ECHO "run \`$progname --help | more' for full usage" 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'* s*\$host*'"$host"'* s*\$SHELL*'"$SHELL"'* s*\$LTCC*'"$LTCC"'* s*\$LTCFLAGS*'"$LTCFLAGS"'* s*\$LD*'"$LD"'* s/\$with_gnu_ld/'"$with_gnu_ld"'/ s/\$automake_version/'"`(${AUTOMAKE-automake} --version) 2>/dev/null |$SED 1q`"'/ s/\$autoconf_version/'"`(${AUTOCONF-autoconf} --version) 2>/dev/null |$SED 1q`"'/ p d } /^# .* home page:/b print /^# General help using/b print ' < "$progpath" ret=$? if test -z "$1"; then exit $ret fi } # func_missing_arg argname # Echo program name prefixed message to standard error and set global # exit_cmd. func_missing_arg () { $opt_debug func_error "missing argument for $1." exit_cmd=exit } # 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=: magic="%%%MAGIC variable%%%" magic_exe="%%%MAGIC EXE variable%%%" # Global variables. nonopt= preserve_args= lo2o="s/\\.lo\$/.${objext}/" o2lo="s/\\.${objext}\$/.lo/" extracted_archives= extracted_serial=0 # If this variable is set in any of the actions, the command in it # will be execed at the end. This prevents here-documents from being # left over by shells. exec_cmd= # func_append var value # Append VALUE to the end of shell variable VAR. func_append () { eval "${1}=\$${1}\${2}" } # func_append may be replaced by extended shell implementation # func_append_quoted var value # Quote VALUE and append to the end of shell variable VAR, separated # by a space. func_append_quoted () { func_quote_for_eval "${2}" eval "${1}=\$${1}\\ \$func_quote_for_eval_result" } # func_append_quoted may be replaced by extended shell implementation # func_arith arithmetic-term... func_arith () { func_arith_result=`expr "${@}"` } # func_arith may be replaced by extended shell implementation # func_len string # STRING may not start with a hyphen. func_len () { func_len_result=`expr "${1}" : ".*" 2>/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. func_fatal_configuration () { func_error ${1+"$@"} func_error "See the $PACKAGE documentation for more information." func_fatal_error "Fatal configuration error." } # func_config # Display the configuration for all the tags in this script. func_config () { re_begincf='^# ### BEGIN LIBTOOL' re_endcf='^# ### END LIBTOOL' # Default configuration. $SED "1,/$re_begincf CONFIG/d;/$re_endcf CONFIG/,\$d" < "$progpath" # Now print the configurations for the tags. for tagname in $taglist; do $SED -n "/$re_begincf TAG CONFIG: $tagname\$/,/$re_endcf TAG CONFIG: $tagname\$/p" < "$progpath" done exit $? } # func_features # Display the features supported by this script. func_features () { echo "host: $host" if test "$build_libtool_libs" = yes; then echo "enable shared libraries" else echo "disable shared libraries" fi if test "$build_old_libs" = yes; then echo "enable static libraries" else echo "disable static libraries" fi exit $? } # func_enable_tag tagname # Verify that TAGNAME is valid, and either flag an error and exit, or # enable the TAGNAME tag. We also add TAGNAME to the global $taglist # variable here. func_enable_tag () { # Global variable: tagname="$1" re_begincf="^# ### BEGIN LIBTOOL TAG CONFIG: $tagname\$" re_endcf="^# ### END LIBTOOL TAG CONFIG: $tagname\$" sed_extractcf="/$re_begincf/,/$re_endcf/p" # Validate tagname. case $tagname in *[!-_A-Za-z0-9,/]*) func_fatal_error "invalid tag name: $tagname" ;; esac # Don't test for the "default" C tag, as we know it's # there but not specially marked. case $tagname in CC) ;; *) if $GREP "$re_begincf" "$progpath" >/dev/null 2>&1; then taglist="$taglist $tagname" # Evaluate the configuration. Be careful to quote the path # and the sed script, to avoid splitting on whitespace, but # also don't use non-portable quotes within backquotes within # quotes we have to do it in 2 steps: extractedcf=`$SED -n -e "$sed_extractcf" < "$progpath"` eval "$extractedcf" else func_error "ignoring unknown tag $tagname" fi ;; esac } # 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 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 # 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 --debug|-x) opt_debug='set -x' func_echo "enabling shell trace mode" $opt_debug ;; --dry-run|--dryrun|-n) opt_dry_run=: ;; --config) opt_config=: func_config ;; --dlopen|-dlopen) optarg="$1" opt_dlopen="${opt_dlopen+$opt_dlopen }$optarg" shift ;; --preserve-dup-deps) opt_preserve_dup_deps=: ;; --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" ;; --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: --*=*) func_split_long_opt "$opt" set dummy "$func_split_long_opt_name" "$func_split_long_opt_arg" ${1+"$@"} shift ;; # 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*) # don't eliminate duplications in $postdeps and $predeps opt_duplicate_compiler_generated_deps=: ;; *) opt_duplicate_compiler_generated_deps=$opt_preserve_dup_deps ;; esac $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 # Darwin sucks eval std_shrext=\"$shrext_cmds\" # 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 # Change the help message to a mode-specific one. generic_help="$help" help="Try \`$progname --help --mode=$opt_mode' for more information." } # Bail if the options were screwed $exit_cmd $EXIT_FAILURE } ## ----------- ## ## Main. ## ## ----------- ## # func_lalib_p file # True iff FILE is a libtool `.la' library or `.lo' object file. # This function is only a basic sanity check; it will hardly flush out # determined imposters. func_lalib_p () { test -f "$1" && $SED -e 4q "$1" 2>/dev/null \ | $GREP "^# Generated by .*$PACKAGE" > /dev/null 2>&1 } # func_lalib_unsafe_p file # True iff FILE is a libtool `.la' library or `.lo' object file. # This function implements the same check as func_lalib_p without # resorting to external programs. To this end, it redirects stdin and # closes it afterwards, without saving the original file descriptor. # As a safety measure, use it only where a negative result would be # fatal anyway. Works if `file' does not exist. func_lalib_unsafe_p () { lalib_p=no if test -f "$1" && test -r "$1" && exec 5<&0 <"$1"; then for lalib_p_l in 1 2 3 4 do read lalib_p_line case "$lalib_p_line" in \#\ Generated\ by\ *$PACKAGE* ) lalib_p=yes; break;; esac done exec 0<&5 5<&- fi test "$lalib_p" = yes } # func_ltwrapper_script_p file # True iff FILE is a libtool wrapper script # This function is only a basic sanity check; it will hardly flush out # determined imposters. func_ltwrapper_script_p () { func_lalib_p "$1" } # func_ltwrapper_executable_p file # True iff FILE is a libtool wrapper executable # This function is only a basic sanity check; it will hardly flush out # determined imposters. func_ltwrapper_executable_p () { func_ltwrapper_exec_suffix= case $1 in *.exe) ;; *) func_ltwrapper_exec_suffix=.exe ;; esac $GREP "$magic_exe" "$1$func_ltwrapper_exec_suffix" >/dev/null 2>&1 } # func_ltwrapper_scriptname file # Assumes file is an ltwrapper_executable # uses $file to determine the appropriate filename for a # temporary ltwrapper_script. func_ltwrapper_scriptname () { 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 # True iff FILE is a libtool wrapper script or wrapper executable # This function is only a basic sanity check; it will hardly flush out # determined imposters. func_ltwrapper_p () { func_ltwrapper_script_p "$1" || func_ltwrapper_executable_p "$1" } # func_execute_cmds commands fail_cmd # Execute tilde-delimited COMMANDS. # If FAIL_CMD is given, eval that upon failure. # FAIL_CMD may read-access the current command in variable CMD! func_execute_cmds () { $opt_debug save_ifs=$IFS; IFS='~' for cmd in $1; do IFS=$save_ifs eval cmd=\"$cmd\" func_show_eval "$cmd" "${2-:}" done IFS=$save_ifs } # func_source file # Source FILE, adding directory component if necessary. # Note that it is not necessary on cygwin/mingw to append a dot to # FILE even if both FILE and FILE.exe exist: automatic-append-.exe # behavior happens only for exec(3), not for open(2)! Also, sourcing # `FILE.' does not work on cygwin managed mounts. func_source () { $opt_debug case $1 in */* | *\\*) . "$1" ;; *) . "./$1" ;; esac } # 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. # Only attempt this if the compiler in the base compile # command doesn't match the default compiler. # arg is usually of the form 'gcc ...' func_infer_tag () { $opt_debug if test -n "$available_tags" && test -z "$tagname"; then CC_quoted= for arg in $CC; do 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 "* | " $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. *) for z in $available_tags; do if $GREP "^# ### BEGIN LIBTOOL TAG CONFIG: $z$" < "$progpath" > /dev/null; then # Evaluate the configuration. eval "`${SED} -n -e '/^# ### BEGIN LIBTOOL TAG CONFIG: '$z'$/,/^# ### END LIBTOOL TAG CONFIG: '$z'$/p' < $progpath`" CC_quoted= for arg in $CC; do # Double-quote args containing other shell metacharacters. 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 "* | " $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. tagname=$z break ;; esac fi done # If $tagname still isn't set, then no tagged configuration # was found and let the user know that the "--tag" command # line option must be used. if test -z "$tagname"; then func_echo "unable to infer tagged configuration" func_fatal_error "specify a tag with \`--tag'" # else # func_verbose "using $tagname tagged configuration" fi ;; esac fi } # func_write_libtool_object output_name pic_name nonpic_name # Create a libtool object file (analogous to a ".la" file), # but don't create it if we're doing a dry run. func_write_libtool_object () { write_libobj=${1} if test "$build_libtool_libs" = yes; then write_lobj=\'${2}\' else write_lobj=none fi if test "$build_old_libs" = yes; then write_oldobj=\'${3}\' else write_oldobj=none fi $opt_dry_run || { cat >${write_libobj}T </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 () { $opt_debug # Get the compilation command and the source file. base_compile= srcfile="$nonopt" # always keep a non-empty value in "srcfile" suppress_opt=yes suppress_output= arg_mode=normal libobj= later= pie_flag= for arg do case $arg_mode in arg ) # do not "continue". Instead, add this to base_compile lastarg="$arg" arg_mode=normal ;; target ) libobj="$arg" arg_mode=normal continue ;; normal ) # Accept any command-line options. case $arg in -o) test -n "$libobj" && \ func_fatal_error "you cannot specify \`-o' more than once" arg_mode=target continue ;; -pie | -fpie | -fPIE) func_append pie_flag " $arg" continue ;; -shared | -static | -prefer-pic | -prefer-non-pic) func_append later " $arg" continue ;; -no-suppress) suppress_opt=no continue ;; -Xcompiler) arg_mode=arg # the next one goes into the "base_compile" arg list continue # The current "srcfile" will either be retained or ;; # replaced later. I would guess that would be a bug. -Wc,*) func_stripname '-Wc,' '' "$arg" args=$func_stripname_result lastarg= save_ifs="$IFS"; IFS=',' for arg in $args; do IFS="$save_ifs" func_append_quoted lastarg "$arg" done IFS="$save_ifs" func_stripname ' ' '' "$lastarg" lastarg=$func_stripname_result # Add the arguments to base_compile. func_append base_compile " $lastarg" continue ;; *) # Accept the current argument as the source file. # The previous "srcfile" becomes the current argument. # lastarg="$srcfile" srcfile="$arg" ;; esac # case $arg ;; esac # case $arg_mode # Aesthetically quote the previous argument. func_append_quoted base_compile "$lastarg" done # for arg case $arg_mode in arg) func_fatal_error "you must specify an argument for -Xcompile" ;; target) func_fatal_error "you must specify a target with \`-o'" ;; *) # Get the name of the library object. test -z "$libobj" && { func_basename "$srcfile" libobj="$func_basename_result" } ;; esac # Recognize several different file suffixes. # If the user specifies -o file.o, it is replaced with file.lo case $libobj in *.[cCFSifmso] | \ *.ada | *.adb | *.ads | *.asm | \ *.c++ | *.cc | *.ii | *.class | *.cpp | *.cxx | \ *.[fF][09]? | *.for | *.java | *.go | *.obj | *.sx | *.cu | *.cup) func_xform "$libobj" libobj=$func_xform_result ;; esac case $libobj in *.lo) func_lo2o "$libobj"; obj=$func_lo2o_result ;; *) func_fatal_error "cannot determine name of library object from \`$libobj'" ;; esac func_infer_tag $base_compile for arg in $later; do case $arg in -shared) test "$build_libtool_libs" != yes && \ func_fatal_configuration "can not build a shared library" build_old_libs=no continue ;; -static) build_libtool_libs=no build_old_libs=yes continue ;; -prefer-pic) pic_mode=yes continue ;; -prefer-non-pic) pic_mode=no continue ;; esac done func_quote_for_eval "$libobj" test "X$libobj" != "X$func_quote_for_eval_result" \ && $ECHO "X$libobj" | $GREP '[]~#^*{};<>?"'"'"' &()|`$[]' \ && func_warning "libobj name \`$libobj' may not contain shell special characters." func_dirname_and_basename "$obj" "/" "" objname="$func_basename_result" xdir="$func_dirname_result" lobj=${xdir}$objdir/$objname test -z "$base_compile" && \ func_fatal_help "you must specify a compilation command" # Delete any leftover library objects. if test "$build_old_libs" = yes; then removelist="$obj $lobj $libobj ${libobj}T" else removelist="$lobj $libobj ${libobj}T" fi # On Cygwin there's no "real" PIC flag so we must build both object types case $host_os in cygwin* | mingw* | pw32* | os2* | cegcc*) pic_mode=default ;; esac if test "$pic_mode" = no && test "$deplibs_check_method" != pass_all; then # non-PIC code in shared libraries is not supported pic_mode=default fi # 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 "$srcfile" | $SED 's%^.*/%%; s%\.[^.]*$%%'`.${objext} lockfile="$output_obj.lock" else output_obj= need_locks=no lockfile= fi # Lock this critical section if it is needed # We use this script file to make the link, it avoids creating a new file if test "$need_locks" = yes; then until $opt_dry_run || ln "$progpath" "$lockfile" 2>/dev/null; do func_echo "Waiting for $lockfile to be removed" sleep 2 done elif test "$need_locks" = warn; then if test -f "$lockfile"; then $ECHO "\ *** ERROR, $lockfile exists and contains: `cat $lockfile 2>/dev/null` This indicates that another process is trying to use the same temporary object file, and libtool could not work around it because your compiler does not support \`-c' and \`-o' together. If you repeat this compilation, it may succeed, by chance, but you had better avoid parallel builds (make -j) in this platform, or get a better compiler." $opt_dry_run || $RM $removelist exit $EXIT_FAILURE fi func_append removelist " $output_obj" $ECHO "$srcfile" > "$lockfile" fi $opt_dry_run || $RM $removelist func_append removelist " $lockfile" trap '$opt_dry_run || $RM $removelist; exit $EXIT_FAILURE' 1 2 15 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 # Only build a PIC object if we are building libtool libraries. if test "$build_libtool_libs" = yes; then # Without this assignment, base_compile gets emptied. fbsd_hideous_sh_bug=$base_compile if test "$pic_mode" != no; then command="$base_compile $qsrcfile $pic_flag" else # Don't build PIC code command="$base_compile $qsrcfile" fi func_mkdir_p "$xdir$objdir" if test -z "$output_obj"; then # Place PIC objects in $objdir func_append command " -o $lobj" fi func_show_eval_locale "$command" \ 'test -n "$output_obj" && $RM $removelist; exit $EXIT_FAILURE' if test "$need_locks" = warn && test "X`cat $lockfile 2>/dev/null`" != "X$srcfile"; then $ECHO "\ *** ERROR, $lockfile contains: `cat $lockfile 2>/dev/null` but it should contain: $srcfile This indicates that another process is trying to use the same temporary object file, and libtool could not work around it because your compiler does not support \`-c' and \`-o' together. If you repeat this compilation, it may succeed, by chance, but you had better avoid parallel builds (make -j) in this platform, or get a better compiler." $opt_dry_run || $RM $removelist exit $EXIT_FAILURE fi # Just move the object if needed, then go on to compile the next one if test -n "$output_obj" && test "X$output_obj" != "X$lobj"; then func_show_eval '$MV "$output_obj" "$lobj"' \ 'error=$?; $opt_dry_run || $RM $removelist; exit $error' fi # Allow error messages only from the first compilation. if test "$suppress_opt" = yes; then suppress_output=' >/dev/null 2>&1' fi fi # Only build a position-dependent object if we build old libraries. if test "$build_old_libs" = yes; then if test "$pic_mode" != yes; then # Don't build PIC code command="$base_compile $qsrcfile$pie_flag" else command="$base_compile $qsrcfile $pic_flag" fi if test "$compiler_c_o" = yes; then func_append command " -o $obj" fi # Suppress compiler output if we already did a PIC compilation. func_append command "$suppress_output" func_show_eval_locale "$command" \ '$opt_dry_run || $RM $removelist; exit $EXIT_FAILURE' if test "$need_locks" = warn && test "X`cat $lockfile 2>/dev/null`" != "X$srcfile"; then $ECHO "\ *** ERROR, $lockfile contains: `cat $lockfile 2>/dev/null` but it should contain: $srcfile This indicates that another process is trying to use the same temporary object file, and libtool could not work around it because your compiler does not support \`-c' and \`-o' together. If you repeat this compilation, it may succeed, by chance, but you had better avoid parallel builds (make -j) in this platform, or get a better compiler." $opt_dry_run || $RM $removelist exit $EXIT_FAILURE fi # Just move the object if needed if test -n "$output_obj" && test "X$output_obj" != "X$obj"; then func_show_eval '$MV "$output_obj" "$obj"' \ 'error=$?; $opt_dry_run || $RM $removelist; exit $error' fi fi $opt_dry_run || { func_write_libtool_object "$libobj" "$objdir/$objname" "$objname" # Unlock the critical section if it was locked if test "$need_locks" != no; then removelist=$lockfile $RM "$lockfile" fi } exit $EXIT_SUCCESS } $opt_help || { test "$opt_mode" = compile && func_mode_compile ${1+"$@"} } func_mode_help () { # We need to display help for each of the modes. case $opt_mode in "") # Generic help is extracted from the usage comments # at the start of this file. func_help ;; clean) $ECHO \ "Usage: $progname [OPTION]... --mode=clean RM [RM-OPTION]... FILE... Remove files from the build directory. RM is the name of the program to use to delete files associated with each FILE (typically \`/bin/rm'). RM-OPTIONS are options (such as \`-f') to be passed to RM. If FILE is a libtool library, object or program, all the files associated with it are deleted. Otherwise, only FILE itself is deleted using RM." ;; compile) $ECHO \ "Usage: $progname [OPTION]... --mode=compile COMPILE-COMMAND... SOURCEFILE Compile a source file into a libtool library object. This mode accepts the following additional options: -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 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. The output file name is determined by removing the directory component from SOURCEFILE, then substituting the C source code suffix \`.c' with the library object suffix, \`.lo'." ;; execute) $ECHO \ "Usage: $progname [OPTION]... --mode=execute COMMAND [ARGS]... Automatically set library path, then run a program. This mode accepts the following additional options: -dlopen FILE add the directory containing FILE to the library path This mode sets the library path environment variable according to \`-dlopen' flags. If any of the ARGS are libtool executable wrappers, then they are translated into their corresponding uninstalled binary, and any of their required library directories are added to the library path. Then, COMMAND is executed, with ARGS as arguments." ;; finish) $ECHO \ "Usage: $progname [OPTION]... --mode=finish [LIBDIR]... Complete the installation of libtool libraries. Each LIBDIR is a directory that contains libtool libraries. The commands that this mode executes may require superuser privileges. Use the \`--dry-run' option if you just want to see what would be executed." ;; install) $ECHO \ "Usage: $progname [OPTION]... --mode=install INSTALL-COMMAND... Install executables or libraries. INSTALL-COMMAND is the installation command. The first component should be either the \`install' or \`cp' program. The following components of INSTALL-COMMAND are treated specially: -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)." ;; link) $ECHO \ "Usage: $progname [OPTION]... --mode=link LINK-COMMAND... Link object files or libraries together to form another library, or to create an executable program. LINK-COMMAND is a command using the C compiler that you would use to create a program from several object files. The following components of LINK-COMMAND are treated specially: -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) -export-symbols SYMFILE try to export only the symbols listed in SYMFILE -export-symbols-regex REGEX try to export only the symbols matching REGEX -LLIBDIR search LIBDIR for required installed libraries -lNAME OUTPUT-FILE requires the installed library libNAME -module build a library that can dlopened -no-fast-install disable the fast-install mode -no-install link a not-installable executable -no-undefined declare that a library does not refer to external symbols -o OUTPUT-FILE create OUTPUT-FILE from the specified objects -objectlist FILE Use a list of object files found in FILE to specify objects -precious-files-regex REGEX don't remove output files matching REGEX -release RELEASE specify package release information -rpath LIBDIR the created library will eventually be installed in LIBDIR -R[ ]LIBDIR add LIBDIR to the runtime path of programs and libraries -shared only do dynamic linking of libtool libraries -shrext SUFFIX override the standard shared library file extension -static do not do any dynamic linking of uninstalled libtool libraries -static-libtool-libs do not do any dynamic linking of libtool libraries -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. Every other argument is treated as a filename. Files ending in \`.la' are treated as uninstalled libtool libraries, other files are standard or library object files. If the OUTPUT-FILE ends in \`.la', then a libtool library is created, only library objects (\`.lo' files) may be specified, and \`-rpath' is required, except when creating a convenience library. If OUTPUT-FILE ends in \`.a' or \`.lib', then a standard library is created using \`ar' and \`ranlib', or on Windows using \`lib'. If OUTPUT-FILE ends in \`.lo' or \`.${objext}', then a reloadable object file is created, otherwise an executable program is created." ;; uninstall) $ECHO \ "Usage: $progname [OPTION]... --mode=uninstall RM [RM-OPTION]... FILE... Remove libraries from an installation directory. RM is the name of the program to use to delete files associated with each FILE (typically \`/bin/rm'). RM-OPTIONS are options (such as \`-f') to be passed to RM. If FILE is a libtool library, all the files associated with it are deleted. Otherwise, only FILE itself is deleted using RM." ;; *) func_fatal_help "invalid operation mode \`$opt_mode'" ;; esac echo $ECHO "Try \`$progname --help' for more information about other modes." } # 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... func_mode_execute () { $opt_debug # The first argument is the command name. cmd="$nonopt" test -z "$cmd" && \ func_fatal_help "you must specify a COMMAND" # Handle -dlopen flags immediately. 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" # Read the libtool library. dlname= library_names= func_source "$file" # Skip this library if it cannot be dlopened. if test -z "$dlname"; then # Warn if it was a shared library. test -n "$library_names" && \ func_warning "\`$file' was not linked with \`-export-dynamic'" continue fi func_dirname "$file" "" "." dir="$func_dirname_result" if test -f "$dir/$objdir/$dlname"; then func_append dir "/$objdir" else if test ! -f "$dir/$dlname"; then func_fatal_error "cannot find \`$dlname' in \`$dir' or \`$dir/$objdir'" fi fi ;; *.lo) # Just add the directory containing the .lo file. func_dirname "$file" "" "." dir="$func_dirname_result" ;; *) func_warning "\`-dlopen' is ignored for non-libtool libraries and objects" continue ;; esac # Get the absolute pathname. absdir=`cd "$dir" && pwd` test -n "$absdir" && dir="$absdir" # Now add the directory to shlibpath_var. if eval "test -z \"\$$shlibpath_var\""; then eval "$shlibpath_var=\"\$dir\"" else eval "$shlibpath_var=\"\$dir:\$$shlibpath_var\"" fi done # This variable tells wrapper scripts just to set shlibpath_var # rather than running their programs. libtool_execute_magic="$magic" # Check if any of the arguments is a wrapper script. args= 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 func_source "$file" # Transform arg to wrapped name. file="$progdir/$program" elif func_ltwrapper_executable_p "$file"; then func_ltwrapper_scriptname "$file" func_source "$func_ltwrapper_scriptname_result" # Transform arg to wrapped name. file="$progdir/$program" fi ;; esac # Quote arguments (to preserve shell metacharacters). func_append_quoted args "$file" done if test "X$opt_dry_run" = Xfalse; then if test -n "$shlibpath_var"; then # Export the shlibpath_var. eval "export $shlibpath_var" fi # Restore saved environment variables for lt_var in LANG LANGUAGE LC_ALL LC_CTYPE LC_COLLATE LC_MESSAGES do eval "if test \"\${save_$lt_var+set}\" = set; then $lt_var=\$save_$lt_var; export $lt_var else $lt_unset $lt_var fi" done # Now prepare to actually exec the command. exec_cmd="\$cmd$args" else # Display what would be done. if test -n "$shlibpath_var"; then eval "\$ECHO \"\$shlibpath_var=\$$shlibpath_var\"" echo "export $shlibpath_var" fi $ECHO "$cmd$args" exit $EXIT_SUCCESS fi } 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 # 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 libdir in $libdirs; do if test -n "$finish_cmds"; then # Do each command in the finish commands. func_execute_cmds "$finish_cmds" 'admincmds="$admincmds '"$cmd"'"' fi if test -n "$finish_eval"; then # Do the single finish_eval. eval cmds=\"$finish_eval\" $opt_dry_run || eval "$cmds" || func_append admincmds " $cmds" fi done fi # Exit here if they wanted silent mode. $opt_silent && exit $EXIT_SUCCESS 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 "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 "$opt_mode" = finish && func_mode_finish ${1+"$@"} # func_mode_install arg... func_mode_install () { $opt_debug # There may be an optional sh(1) argument at the beginning of # install_prog (especially on Windows NT). if test "$nonopt" = "$SHELL" || test "$nonopt" = /bin/sh || # Allow the use of GNU shtool's install command. case $nonopt in *shtool*) :;; *) false;; esac; then # Aesthetically quote it. func_quote_for_eval "$nonopt" install_prog="$func_quote_for_eval_result " arg=$1 shift else install_prog= arg=$nonopt fi # The real first argument should be the name of the installation program. # Aesthetically quote it. func_quote_for_eval "$arg" 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= files= opts= prev= install_type= isdir=no stripme= no_mode=: for arg do arg2= if test -n "$dest"; then func_append files " $dest" dest=$arg continue fi case $arg in -d) isdir=yes ;; -f) if $install_cp; then :; else prev=$arg fi ;; -g | -m | -o) prev=$arg ;; -s) stripme=" -s" continue ;; -*) ;; *) # 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 continue fi ;; esac # Aesthetically quote the argument. func_quote_for_eval "$arg" 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" && \ func_fatal_help "you must specify an install program" 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" else func_fatal_help "you must specify a destination" fi fi # Strip any trailing slash from the destination. func_stripname '' '/' "$dest" dest=$func_stripname_result # Check to see that the destination is a directory. test -d "$dest" && isdir=yes if test "$isdir" = yes; then destdir="$dest" destname= else func_dirname_and_basename "$dest" "" "." destdir="$func_dirname_result" destname="$func_basename_result" # Not a directory, so check to see that there is only one file specified. set dummy $files; shift test "$#" -gt 1 && \ func_fatal_help "\`$dest' is not a directory" fi case $destdir in [\\/]* | [A-Za-z]:[\\/]*) ;; *) for file in $files; do case $file in *.lo) ;; *) func_fatal_help "\`$destdir' must be an absolute directory name" ;; esac done ;; esac # This variable tells wrapper scripts just to set variables rather # than running their programs. libtool_install_magic="$magic" staticlibs= future_libdirs= current_libdirs= for file in $files; do # Do each installation. case $file in *.$libext) # Do the static libraries later. 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" library_names= old_library= relink_command= func_source "$file" # Add the libdir to current_libdirs if it is the destination. if test "X$destdir" = "X$libdir"; then case "$current_libdirs " in *" $libdir "*) ;; *) func_append current_libdirs " $libdir" ;; esac else # Note the libdir as a future libdir. case "$future_libdirs " in *" $libdir "*) ;; *) func_append future_libdirs " $libdir" ;; esac fi func_dirname "$file" "/" "" dir="$func_dirname_result" 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 "$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 # are installed to the same prefix. # At present, this check doesn't affect windows .dll's that # are installed into $libdir/../bin (currently, that works fine) # but it's something to keep an eye on. test "$inst_prefix_dir" = "$destdir" && \ func_fatal_error "error: cannot install \`$file' to a directory not ending in $libdir" if test -n "$inst_prefix_dir"; then # Stick the inst_prefix_dir data into the link command. relink_command=`$ECHO "$relink_command" | $SED "s%@inst_prefix_dir@%-inst-prefix-dir $inst_prefix_dir%"` else relink_command=`$ECHO "$relink_command" | $SED "s%@inst_prefix_dir@%%"` fi func_warning "relinking \`$file'" func_show_eval "$relink_command" \ 'func_fatal_error "error: relink \`$file'\'' with the above command before installing it"' fi # See the names of the shared library. set dummy $library_names; shift if test -n "$1"; then realname="$1" shift srcname="$realname" test -n "$relink_command" && srcname="$realname"T # Install the shared library and build the symlinks. func_show_eval "$install_shared_prog $dir/$srcname $destdir/$realname" \ 'exit $?' tstripme="$stripme" case $host_os in cygwin* | mingw* | pw32* | cegcc*) case $realname in *.dll.a) tstripme="" ;; esac ;; esac if test -n "$tstripme" && test -n "$striplib"; then func_show_eval "$striplib $destdir/$realname" 'exit $?' fi if test "$#" -gt 0; then # Delete the old symlinks, and create new ones. # Try `ln -sf' first, because the `ln' binary might depend on # the symlink we replace! Solaris /bin/ln does not understand -f, # so we also need to try rm && ln -s. for linkname do test "$linkname" != "$realname" \ && func_show_eval "(cd $destdir && { $LN_S -f $realname $linkname || { $RM $linkname && $LN_S $realname $linkname; }; })" done fi # Do each command in the postinstall commands. lib="$destdir/$realname" func_execute_cmds "$postinstall_cmds" 'exit $?' fi # Install the pseudo-library for information purposes. func_basename "$file" name="$func_basename_result" instname="$dir/$name"i func_show_eval "$install_prog $instname $destdir/$name" 'exit $?' # Maybe install the static library, too. test -n "$old_library" && func_append staticlibs " $dir/$old_library" ;; *.lo) # Install (i.e. copy) a libtool object. # Figure out destination file name, if it wasn't already specified. if test -n "$destname"; then destfile="$destdir/$destname" else func_basename "$file" destfile="$func_basename_result" destfile="$destdir/$destfile" fi # Deduce the name of the destination old-style object file. case $destfile in *.lo) func_lo2o "$destfile" staticdest=$func_lo2o_result ;; *.$objext) staticdest="$destfile" destfile= ;; *) func_fatal_help "cannot copy a libtool object to \`$destfile'" ;; esac # Install the libtool object if requested. test -n "$destfile" && \ func_show_eval "$install_prog $file $destfile" 'exit $?' # Install the old object if enabled. if test "$build_old_libs" = yes; then # Deduce the name of the old-style object file. func_lo2o "$file" staticobj=$func_lo2o_result func_show_eval "$install_prog \$staticobj \$staticdest" 'exit $?' fi exit $EXIT_SUCCESS ;; *) # Figure out destination file name, if it wasn't already specified. if test -n "$destname"; then destfile="$destdir/$destname" else func_basename "$file" destfile="$func_basename_result" destfile="$destdir/$destfile" fi # If the file is missing, and there is a .exe on the end, strip it # because it is most likely a libtool script we actually want to # install stripped_ext="" case $file in *.exe) if test ! -f "$file"; then func_stripname '' '.exe' "$file" file=$func_stripname_result stripped_ext=".exe" fi ;; esac # Do a test to see if this is really a libtool program. case $host in *cygwin* | *mingw*) if func_ltwrapper_executable_p "$file"; then func_ltwrapper_scriptname "$file" wrapper=$func_ltwrapper_scriptname_result else func_stripname '' '.exe' "$file" wrapper=$func_stripname_result fi ;; *) wrapper=$file ;; esac if func_ltwrapper_script_p "$wrapper"; then notinst_deplibs= relink_command= func_source "$wrapper" # Check the variables that should have been set. test -z "$generated_by_libtool_version" && \ func_fatal_error "invalid libtool wrapper script \`$wrapper'" finalize=yes for lib in $notinst_deplibs; do # Check to see that each library is installed. libdir= if test -f "$lib"; then func_source "$lib" fi 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 fi done relink_command= func_source "$wrapper" outputname= if test "$fast_install" = no && test -n "$relink_command"; then $opt_dry_run || { if test "$finalize" = yes; then tmpdir=`func_mktempdir` func_basename "$file$stripped_ext" file="$func_basename_result" outputname="$tmpdir/$file" # Replace the output file specification. relink_command=`$ECHO "$relink_command" | $SED 's%@OUTPUT@%'"$outputname"'%g'` $opt_silent || { func_quote_for_expand "$relink_command" eval "func_echo $func_quote_for_expand_result" } if eval "$relink_command"; then : else func_error "error: relink \`$file' with the above command before installing it" $opt_dry_run || ${RM}r "$tmpdir" continue fi file="$outputname" else func_warning "cannot relink \`$file'" fi } else # Install the binary that we compiled earlier. file=`$ECHO "$file$stripped_ext" | $SED "s%\([^/]*\)$%$objdir/\1%"` fi fi # remove .exe since cygwin /usr/bin/install will append another # one anyway case $install_prog,$host in */usr/bin/install*,*cygwin*) case $file:$destfile in *.exe:*.exe) # this is ok ;; *.exe:*) destfile=$destfile.exe ;; *:*.exe) func_stripname '' '.exe' "$destfile" destfile=$func_stripname_result ;; esac ;; esac func_show_eval "$install_prog\$stripme \$file \$destfile" 'exit $?' $opt_dry_run || if test -n "$outputname"; then ${RM}r "$tmpdir" fi ;; esac done for file in $staticlibs; do func_basename "$file" name="$func_basename_result" # 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 $tool_oldlib" 'exit $?' fi # Do each command in the postinstall commands. func_execute_cmds "$old_postinstall_cmds" 'exit $?' done test -n "$future_libdirs" && \ func_warning "remember to run \`$progname --finish$future_libdirs'" if test -n "$current_libdirs"; then # Maybe just do a dry run. $opt_dry_run && current_libdirs=" -n$current_libdirs" exec_cmd='$SHELL $progpath $preserve_args --finish$current_libdirs' else exit $EXIT_SUCCESS fi } test "$opt_mode" = install && func_mode_install ${1+"$@"} # func_generate_dlsyms outputname originator pic_p # Extract symbols from dlprefiles and create ${outputname}S.o with # a dlpreopen symbol table. func_generate_dlsyms () { $opt_debug my_outputname="$1" my_originator="$2" my_pic_p="${3-no}" my_prefix=`$ECHO "$my_originator" | sed 's%[^a-zA-Z0-9]%_%g'` my_dlsyms= if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then if test -n "$NM" && test -n "$global_symbol_pipe"; then my_dlsyms="${my_outputname}S.c" else func_error "not configured to extract global symbols from dlpreopened files" fi fi if test -n "$my_dlsyms"; then case $my_dlsyms in "") ;; *.c) # Discover the nlist of each of the dlfiles. nlist="$output_objdir/${my_outputname}.nm" func_show_eval "$RM $nlist ${nlist}S ${nlist}T" # Parse the name list into a source file. func_verbose "creating $output_objdir/$my_dlsyms" $opt_dry_run || $ECHO > "$output_objdir/$my_dlsyms" "\ /* $my_dlsyms - symbol resolution table for \`$my_outputname' dlsym emulation. */ /* Generated by $PROGRAM (GNU $PACKAGE$TIMESTAMP) $VERSION */ #ifdef __cplusplus 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. */\ " if test "$dlself" = yes; then func_verbose "generating symbol list for \`$output'" $opt_dry_run || echo ': @PROGRAM@ ' > "$nlist" # Add our own program objects to the symbol list. progfiles=`$ECHO "$objs$old_deplibs" | $SP2NL | $SED "$lo2o" | $NL2SP` for progfile in $progfiles; do 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 $opt_dry_run || { eval '$EGREP -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T' eval '$MV "$nlist"T "$nlist"' } fi if test -n "$export_symbols_regex"; then $opt_dry_run || { eval '$EGREP -e "$export_symbols_regex" "$nlist" > "$nlist"T' eval '$MV "$nlist"T "$nlist"' } fi # Prepare the list of exported symbols if test -z "$export_symbols"; then export_symbols="$output_objdir/$outputname.exp" $opt_dry_run || { $RM $export_symbols eval "${SED} -n -e '/^: @PROGRAM@ $/d' -e 's/^.* \(.*\)$/\1/p' "'< "$nlist" > "$export_symbols"' case $host in *cygwin* | *mingw* | *cegcc* ) eval "echo EXPORTS "'> "$output_objdir/$outputname.def"' eval 'cat "$export_symbols" >> "$output_objdir/$outputname.def"' ;; esac } else $opt_dry_run || { eval "${SED} -e 's/\([].[*^$]\)/\\\\\1/g' -e 's/^/ /' -e 's/$/$/'"' < "$export_symbols" > "$output_objdir/$outputname.exp"' eval '$GREP -f "$output_objdir/$outputname.exp" < "$nlist" > "$nlist"T' eval '$MV "$nlist"T "$nlist"' case $host in *cygwin* | *mingw* | *cegcc* ) eval "echo EXPORTS "'> "$output_objdir/$outputname.def"' eval 'cat "$nlist" >> "$output_objdir/$outputname.def"' ;; esac } fi fi for dlprefile in $dlprefiles; do func_verbose "extracting global C symbols from \`$dlprefile'" func_basename "$dlprefile" name="$func_basename_result" 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 || { # Make sure we have at least an empty file. test -f "$nlist" || : > "$nlist" if test -n "$exclude_expsyms"; then $EGREP -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T $MV "$nlist"T "$nlist" fi # Try sorting and uniquifying the output. if $GREP -v "^: " < "$nlist" | if sort -k 3 /dev/null 2>&1; then sort -k 3 else sort +2 fi | uniq > "$nlist"S; then : else $GREP -v "^: " < "$nlist" > "$nlist"S fi if test -f "$nlist"S; then eval "$global_symbol_to_cdecl"' < "$nlist"S >> "$output_objdir/$my_dlsyms"' else echo '/* NONE */' >> "$output_objdir/$my_dlsyms" fi echo >> "$output_objdir/$my_dlsyms" "\ /* The mapping between symbol names and symbols. */ typedef struct { const char *name; void *address; } lt_dlsymlist; extern LT_DLSYM_CONST lt_dlsymlist lt_${my_prefix}_LTX_preloaded_symbols[]; LT_DLSYM_CONST lt_dlsymlist lt_${my_prefix}_LTX_preloaded_symbols[] = {\ { \"$my_originator\", (void *) 0 }," case $need_lib_prefix in no) eval "$global_symbol_to_c_name_address" < "$nlist" >> "$output_objdir/$my_dlsyms" ;; *) eval "$global_symbol_to_c_name_address_lib_prefix" < "$nlist" >> "$output_objdir/$my_dlsyms" ;; esac echo >> "$output_objdir/$my_dlsyms" "\ {0, (void *) 0} }; /* This works around a problem in FreeBSD linker */ #ifdef FREEBSD_WORKAROUND static const void *lt_preloaded_setup() { return lt_${my_prefix}_LTX_preloaded_symbols; } #endif #ifdef __cplusplus } #endif\ " } # !$opt_dry_run pic_flag_for_symtable= case "$compile_command " in *" -static "*) ;; *) case $host in # compiling the symbol table file with pic_flag works around # a FreeBSD bug that causes programs to crash when -lm is # 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*) pic_flag_for_symtable=" $pic_flag -DFREEBSD_WORKAROUND" ;; *-*-hpux*) pic_flag_for_symtable=" $pic_flag" ;; *) if test "X$my_pic_p" != Xno; then pic_flag_for_symtable=" $pic_flag" fi ;; esac ;; esac symtab_cflags= for arg in $LTCFLAGS; do case $arg in -pie | -fpie | -fPIE) ;; *) func_append symtab_cflags " $arg" ;; esac done # Now compile the dynamic symbol file. func_show_eval '(cd $output_objdir && $LTCC$symtab_cflags -c$no_builtin_flag$pic_flag_for_symtable "$my_dlsyms")' 'exit $?' # Clean up the generated files. func_show_eval '$RM "$output_objdir/$my_dlsyms" "$nlist" "${nlist}S" "${nlist}T"' # Transform the symbol file into the correct name. symfileobj="$output_objdir/${my_outputname}S.$objext" case $host in *cygwin* | *mingw* | *cegcc* ) if test -f "$output_objdir/$my_outputname.def"; then 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 "$compile_command" | $SED "s%@SYMFILE@%$symfileobj%"` finalize_command=`$ECHO "$finalize_command" | $SED "s%@SYMFILE@%$symfileobj%"` fi ;; *) compile_command=`$ECHO "$compile_command" | $SED "s%@SYMFILE@%$symfileobj%"` finalize_command=`$ECHO "$finalize_command" | $SED "s%@SYMFILE@%$symfileobj%"` ;; esac ;; *) func_fatal_error "unknown suffix for \`$my_dlsyms'" ;; esac else # We keep going just in case the user didn't refer to # lt_preloaded_symbols. The linker will fail if global_symbol_pipe # really was required. # Nullify the symbol file. compile_command=`$ECHO "$compile_command" | $SED "s% @SYMFILE@%%"` finalize_command=`$ECHO "$finalize_command" | $SED "s% @SYMFILE@%%"` fi } # func_win32_libid arg # return the library type of file 'arg' # # 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 win32_libid_type="unknown" win32_fileres=`file -L $1 2>/dev/null` case $win32_fileres in *ar\ archive\ import\ library*) # definitely import 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 (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 /{ s,.*,import, p q } }'` case $win32_nmres in import*) win32_libid_type="x86 archive import";; *) win32_libid_type="x86 archive static";; esac fi ;; *DLL*) win32_libid_type="x86 DLL" ;; *executable*) # but shell scripts are "executable" too... case $win32_fileres in *MS\ Windows\ PE\ Intel*) win32_libid_type="x86 DLL" ;; esac ;; esac $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 func_extract_an_archive () { $opt_debug f_ex_an_ar_dir="$1"; shift f_ex_an_ar_oldlib="$1" 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 func_fatal_error "object name conflicts in archive: $f_ex_an_ar_dir/$f_ex_an_ar_oldlib" fi } # func_extract_archives gentop oldlib ... func_extract_archives () { $opt_debug my_gentop="$1"; shift my_oldlibs=${1+"$@"} my_oldobjs="" my_xlib="" my_xabs="" my_xdir="" for my_xlib in $my_oldlibs; do # Extract the objects. case $my_xlib in [\\/]* | [A-Za-z]:[\\/]*) my_xabs="$my_xlib" ;; *) my_xabs=`pwd`"/$my_xlib" ;; esac func_basename "$my_xlib" my_xlib="$func_basename_result" my_xlib_u=$my_xlib while :; do case " $extracted_archives " in *" $my_xlib_u "*) func_arith $extracted_serial + 1 extracted_serial=$func_arith_result my_xlib_u=lt$extracted_serial-$my_xlib ;; *) break ;; esac done extracted_archives="$extracted_archives $my_xlib_u" my_xdir="$my_gentop/$my_xlib_u" func_mkdir_p "$my_xdir" case $host in *-darwin*) func_verbose "Extracting $my_xabs" # Do not bother doing anything if just a dry run $opt_dry_run || { darwin_orig_dir=`pwd` cd $my_xdir || exit $? darwin_archive=$my_xabs darwin_curdir=`pwd` darwin_base_archive=`basename "$darwin_archive"` darwin_arches=`$LIPO -info "$darwin_archive" 2>/dev/null | $GREP Architectures 2>/dev/null || true` if test -n "$darwin_arches"; then darwin_arches=`$ECHO "$darwin_arches" | $SED -e 's/.*are://'` darwin_arch= func_verbose "$darwin_base_archive has multiple architectures $darwin_arches" for darwin_arch in $darwin_arches ; do func_mkdir_p "unfat-$$/${darwin_base_archive}-${darwin_arch}" $LIPO -thin $darwin_arch -output "unfat-$$/${darwin_base_archive}-${darwin_arch}/${darwin_base_archive}" "${darwin_archive}" cd "unfat-$$/${darwin_base_archive}-${darwin_arch}" func_extract_an_archive "`pwd`" "${darwin_base_archive}" cd "$darwin_curdir" $RM "unfat-$$/${darwin_base_archive}-${darwin_arch}/${darwin_base_archive}" done # $darwin_arches ## Okay now we've a bunch of thin objects, gotta fatten them up :) darwin_filelist=`find unfat-$$ -type f -name \*.o -print -o -name \*.lo -print | $SED -e "$basename" | sort -u` darwin_file= darwin_files= for darwin_file in $darwin_filelist; do darwin_files=`find unfat-$$ -name $darwin_file -print | sort | $NL2SP` $LIPO -create -output "$darwin_file" $darwin_files done # $darwin_filelist $RM -rf unfat-$$ cd "$darwin_orig_dir" else cd $darwin_orig_dir func_extract_an_archive "$my_xdir" "$my_xabs" fi # $darwin_arches } # !$opt_dry_run ;; *) func_extract_an_archive "$my_xdir" "$my_xabs" ;; esac 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 [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=${1-no} $ECHO "\ #! $SHELL # $output - temporary wrapper script for $objdir/$outputname # Generated by $PROGRAM (GNU $PACKAGE$TIMESTAMP) $VERSION # # The $output program cannot be directly executed until all the libtool # libraries that it depends on are installed. # # This wrapper script should never be moved out of the build directory. # If it is, it will not operate correctly. # Sed substitution that helps us do robust quoting. It backslashifies # metacharacters that are still active within double-quoted strings. sed_quote_subst='$sed_quote_subst' # Be Bourne compatible if test -n \"\${ZSH_VERSION+set}\" && (emulate sh) >/dev/null 2>&1; then emulate sh NULLCMD=: # Zsh 3.x and 4.x performs word splitting on \${1+\"\$@\"}, which # is contrary to our usage. Disable this feature. alias -g '\${1+\"\$@\"}'='\"\$@\"' setopt NO_GLOB_SUBST else case \`(set -o) 2>/dev/null\` in *posix*) set -o posix;; esac fi BIN_SH=xpg4; export BIN_SH # for Tru64 DUALCASE=1; export DUALCASE # for MKS sh # 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 relink_command=\"$relink_command\" # This environment variable determines our operation mode. if test \"\$libtool_install_magic\" = \"$magic\"; then # install mode needs the following variables: generated_by_libtool_version='$macro_version' notinst_deplibs='$notinst_deplibs' else # When we are sourced in execute mode, \$file and \$ECHO are already set. if test \"\$libtool_execute_magic\" != \"$magic\"; then 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 () { " 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 \"\$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'\` while test -n \"\$file\"; do destdir=\`\$ECHO \"\$file\" | $SED 's%/[^/]*\$%%'\` # If there was a directory component, then change thisdir. if test \"x\$destdir\" != \"x\$file\"; then case \"\$destdir\" in [\\\\/]* | [A-Za-z]:[\\\\/]*) thisdir=\"\$destdir\" ;; *) thisdir=\"\$thisdir/\$destdir\" ;; esac fi file=\`\$ECHO \"\$file\" | $SED 's%^.*/%%'\` file=\`ls -ld \"\$thisdir/\$file\" | $SED -n 's/.*-> //p'\` done # Usually 'no', except on cygwin/mingw when embedded into # the cwrapper. 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 thisdir=\`pwd\` fi # remove .libs from thisdir case \"\$thisdir\" in *[\\\\/]$objdir ) thisdir=\`\$ECHO \"\$thisdir\" | $SED 's%[\\\\/][^\\\\/]*$%%'\` ;; $objdir ) thisdir=. ;; esac fi # Try to get the absolute directory name. absdir=\`cd \"\$thisdir\" && pwd\` test -n \"\$absdir\" && thisdir=\"\$absdir\" " if test "$fast_install" = yes; then $ECHO "\ program=lt-'$outputname'$exeext progdir=\"\$thisdir/$objdir\" if test ! -f \"\$progdir/\$program\" || { file=\`ls -1dt \"\$progdir/\$program\" \"\$progdir/../\$program\" 2>/dev/null | ${SED} 1q\`; \\ test \"X\$file\" != \"X\$progdir/\$program\"; }; then file=\"\$\$-\$program\" if test ! -d \"\$progdir\"; then $MKDIR \"\$progdir\" else $RM \"\$progdir/\$file\" fi" $ECHO "\ # relink executable if necessary if test -n \"\$relink_command\"; then if relink_command_output=\`eval \$relink_command 2>&1\`; then : else $ECHO \"\$relink_command_output\" >&2 $RM \"\$progdir/\$file\" exit 1 fi fi $MV \"\$progdir/\$file\" \"\$progdir/\$program\" 2>/dev/null || { $RM \"\$progdir/\$program\"; $MV \"\$progdir/\$file\" \"\$progdir/\$program\"; } $RM \"\$progdir/\$file\" fi" else $ECHO "\ program='$outputname' progdir=\"\$thisdir/$objdir\" " fi $ECHO "\ 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 "\ # Add our own library path to $shlibpath_var $shlibpath_var=\"$temp_rpath\$$shlibpath_var\" # 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 \"\$$shlibpath_var\" | $SED 's/::*\$//'\` export $shlibpath_var " fi $ECHO "\ if test \"\$libtool_execute_magic\" != \"$magic\"; then # Run the actual program with our arguments. 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 exit 1 fi fi\ " } # func_emit_cwrapperexe_src # emit the source code for a wrapper executable on stdout # Must ONLY be called from within func_mode_link because # it depends on a number of variable set therein. func_emit_cwrapperexe_src () { cat < #include #ifdef _MSC_VER # include # include # include #else # include # include # ifdef __CYGWIN__ # include # endif #endif #include #include #include #include #include #include #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) # define LT_PATHMAX MAXPATHLEN #else # define LT_PATHMAX 1024 #endif #ifndef S_IXOTH # define S_IXOTH 0 #endif #ifndef S_IXGRP # define S_IXGRP 0 #endif /* path handling portability macros */ #ifndef DIR_SEPARATOR # define DIR_SEPARATOR '/' # define PATH_SEPARATOR ':' #endif #if defined (_WIN32) || defined (__MSDOS__) || defined (__DJGPP__) || \ defined (__OS2__) # define HAVE_DOS_BASED_FILE_SYSTEM # define FOPEN_WB "wb" # ifndef DIR_SEPARATOR_2 # define DIR_SEPARATOR_2 '\\' # endif # ifndef PATH_SEPARATOR_2 # define PATH_SEPARATOR_2 ';' # endif #endif #ifndef DIR_SEPARATOR_2 # define IS_DIR_SEPARATOR(ch) ((ch) == DIR_SEPARATOR) #else /* DIR_SEPARATOR_2 */ # define IS_DIR_SEPARATOR(ch) \ (((ch) == DIR_SEPARATOR) || ((ch) == DIR_SEPARATOR_2)) #endif /* DIR_SEPARATOR_2 */ #ifndef PATH_SEPARATOR_2 # define IS_PATH_SEPARATOR(ch) ((ch) == PATH_SEPARATOR) #else /* PATH_SEPARATOR_2 */ # define IS_PATH_SEPARATOR(ch) ((ch) == PATH_SEPARATOR_2) #endif /* PATH_SEPARATOR_2 */ #ifndef FOPEN_WB # define FOPEN_WB "w" #endif #ifndef _O_BINARY # define _O_BINARY 0 #endif #define XMALLOC(type, num) ((type *) xmalloc ((num) * sizeof(type))) #define XFREE(stale) do { \ if (stale) { free ((void *) stale); stale = 0; } \ } while (0) #if defined(LT_DEBUGWRAPPER) static int lt_debug = 1; #else static int lt_debug = 0; #endif const char *program_name = "libtool-wrapper"; /* in case xstrdup fails */ void *xmalloc (size_t num); char *xstrdup (const char *string); const char *base_name (const char *name); char *find_executable (const char *wrapper); char *chase_symlinks (const char *pathspec); int make_executable (const char *path); int check_executable (const char *path); char *strendzap (char *str, const char *pat); 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_update_exe_path (const char *name, const char *value); void lt_update_lib_path (const char *name, const char *value); char **prepare_spawn (char **argv); void lt_dump_script (FILE *f); EOF cat <= 0) && (st.st_mode & (S_IXUSR | S_IXGRP | S_IXOTH))) return 1; else return 0; } int make_executable (const char *path) { int rval = 0; struct stat st; lt_debugprintf (__FILE__, __LINE__, "(make_executable): %s\n", nonempty (path)); if ((!path) || (!*path)) return 0; if (stat (path, &st) >= 0) { rval = chmod (path, st.st_mode | S_IXOTH | S_IXGRP | S_IXUSR); } return rval; } /* Searches for the full path of the wrapper. Returns newly allocated full path name if found, NULL otherwise Does not chase symlinks, even on platforms that support them. */ char * find_executable (const char *wrapper) { int has_slash = 0; const char *p; const char *p_next; /* static buffer for getcwd */ char tmp[LT_PATHMAX + 1]; int tmp_len; char *concat_name; lt_debugprintf (__FILE__, __LINE__, "(find_executable): %s\n", nonempty (wrapper)); if ((wrapper == NULL) || (*wrapper == '\0')) return NULL; /* Absolute path? */ #if defined (HAVE_DOS_BASED_FILE_SYSTEM) if (isalpha ((unsigned char) wrapper[0]) && wrapper[1] == ':') { concat_name = xstrdup (wrapper); if (check_executable (concat_name)) return concat_name; XFREE (concat_name); } else { #endif if (IS_DIR_SEPARATOR (wrapper[0])) { concat_name = xstrdup (wrapper); if (check_executable (concat_name)) return concat_name; XFREE (concat_name); } #if defined (HAVE_DOS_BASED_FILE_SYSTEM) } #endif for (p = wrapper; *p; p++) if (*p == '/') { has_slash = 1; break; } if (!has_slash) { /* no slashes; search PATH */ const char *path = getenv ("PATH"); if (path != NULL) { for (p = path; *p; p = p_next) { const char *q; size_t p_len; for (q = p; *q; q++) if (IS_PATH_SEPARATOR (*q)) break; p_len = q - p; p_next = (*q == '\0' ? q : q + 1); if (p_len == 0) { /* empty path: current directory */ if (getcwd (tmp, LT_PATHMAX) == NULL) 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); concat_name[tmp_len] = '/'; strcpy (concat_name + tmp_len + 1, wrapper); } else { concat_name = XMALLOC (char, p_len + 1 + strlen (wrapper) + 1); memcpy (concat_name, p, p_len); concat_name[p_len] = '/'; strcpy (concat_name + p_len + 1, wrapper); } if (check_executable (concat_name)) return concat_name; XFREE (concat_name); } } /* not found in PATH; assume curdir */ } /* Relative path | not found in path: prepend cwd */ if (getcwd (tmp, LT_PATHMAX) == NULL) 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); concat_name[tmp_len] = '/'; strcpy (concat_name + tmp_len + 1, wrapper); if (check_executable (concat_name)) return concat_name; XFREE (concat_name); return NULL; } char * chase_symlinks (const char *pathspec) { #ifndef S_ISLNK return xstrdup (pathspec); #else char buf[LT_PATHMAX]; struct stat s; char *tmp_pathspec = xstrdup (pathspec); char *p; int has_symlinks = 0; while (strlen (tmp_pathspec) && !has_symlinks) { 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) { has_symlinks = 1; break; } /* search backwards for last DIR_SEPARATOR */ p = tmp_pathspec + strlen (tmp_pathspec) - 1; while ((p > tmp_pathspec) && (!IS_DIR_SEPARATOR (*p))) p--; if ((p == tmp_pathspec) && (!IS_DIR_SEPARATOR (*p))) { /* no more DIR_SEPARATORS left */ break; } *p = '\0'; } else { lt_fatal (__FILE__, __LINE__, "error accessing file \"%s\": %s", tmp_pathspec, nonnull (strerror (errno))); } } XFREE (tmp_pathspec); if (!has_symlinks) { return xstrdup (pathspec); } tmp_pathspec = realpath (pathspec, buf); if (tmp_pathspec == 0) { lt_fatal (__FILE__, __LINE__, "could not follow symlinks for %s", pathspec); } return xstrdup (tmp_pathspec); #endif } char * strendzap (char *str, const char *pat) { size_t len, patlen; assert (str != NULL); assert (pat != NULL); len = strlen (str); patlen = strlen (pat); if (patlen <= len) { str += len - patlen; if (strcmp (str, pat) == 0) *str = '\0'; } 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 *file, int line, const char *mode, const char *message, va_list ap) { fprintf (stderr, "%s:%s:%d: %s: ", program_name, file, line, mode); vfprintf (stderr, message, ap); fprintf (stderr, ".\n"); if (exit_status >= 0) exit (exit_status); } void lt_fatal (const char *file, int line, const char *message, ...) { va_list ap; va_start (ap, message); 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) { 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 */ char *str = xstrdup (value); setenv (name, str, 1); #else int len = strlen (name) + 1 + strlen (value) + 1; char *str = XMALLOC (char, len); sprintf (str, "%s=%s", name, value); if (putenv (str) != EXIT_SUCCESS) { XFREE (str); } #endif } } char * lt_extend_str (const char *orig_value, const char *add, int to_end) { char *new_value; if (orig_value && *orig_value) { int orig_value_len = strlen (orig_value); int add_len = strlen (add); new_value = XMALLOC (char, add_len + orig_value_len + 1); if (to_end) { strcpy (new_value, orig_value); strcpy (new_value + orig_value_len, add); } else { strcpy (new_value, add); strcpy (new_value + add_len, orig_value); } } else { new_value = xstrdup (add); } return new_value; } void lt_update_exe_path (const char *name, const char *value) { lt_debugprintf (__FILE__, __LINE__, "(lt_update_exe_path) modifying '%s' by prepending '%s'\n", nonnull (name), nonnull (value)); if (name && *name && value && *value) { char *new_value = lt_extend_str (getenv (name), value, 0); /* some systems can't cope with a ':'-terminated path #' */ int len = strlen (new_value); while (((len = strlen (new_value)) > 0) && IS_PATH_SEPARATOR (new_value[len-1])) { new_value[len-1] = '\0'; } lt_setenv (name, new_value); XFREE (new_value); } } void lt_update_lib_path (const char *name, const char *value) { lt_debugprintf (__FILE__, __LINE__, "(lt_update_lib_path) modifying '%s' by prepending '%s'\n", nonnull (name), nonnull (value)); if (name && *name && value && *value) { char *new_value = lt_extend_str (getenv (name), value, 0); lt_setenv (name, new_value); XFREE (new_value); } } 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 () { $opt_debug case $host in *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-cegcc*) # It is impossible to link a dll without this setting, and # we shouldn't force the makefile maintainer to figure out # which system we are compiling for in order to pass an extra # flag for every libtool invocation. # allow_undefined=no # FIXME: Unfortunately, there are problems with the above when trying # to make a dll which has undefined symbols, in which case not # even a static library is built. For now, we need to specify # -no-undefined on the libtool link line when we can be certain # that all symbols are satisfied, otherwise we get a static library. allow_undefined=yes ;; *) allow_undefined=yes ;; esac libtool_args=$nonopt base_compile="$nonopt $@" compile_command=$nonopt finalize_command=$nonopt compile_rpath= finalize_rpath= compile_shlibpath= finalize_shlibpath= convenience= old_convenience= deplibs= old_deplibs= compiler_flags= linker_flags= dllsearchpath= lib_search_path=`pwd` inst_prefix_dir= new_inherited_linker_flags= avoid_version=no bindir= dlfiles= dlprefiles= dlself=no export_dynamic=no export_symbols= export_symbols_regex= generated= libobjs= ltlibs= module=no no_install=no objs= non_pic_objects= precious_files_regex= prefer_static_libs=no preload=no prev= prevarg= release= rpath= xrpath= perm_rpath= temp_rpath= thread_safe=no vinfo= vinfo_number=no weak_libs= single_module="${wl}-single_module" func_infer_tag $base_compile # We need to know -static, to get the right output filenames. for arg do case $arg in -shared) test "$build_libtool_libs" != yes && \ func_fatal_configuration "can not build a shared library" build_old_libs=no break ;; -all-static | -static | -static-libtool-libs) case $arg in -all-static) if test "$build_libtool_libs" = yes && test -z "$link_static_flag"; then func_warning "complete static linking is impossible in this configuration" fi if test -n "$link_static_flag"; then dlopen_self=$dlopen_self_static fi prefer_static_libs=yes ;; -static) if test -z "$pic_flag" && test -n "$link_static_flag"; then dlopen_self=$dlopen_self_static fi prefer_static_libs=built ;; -static-libtool-libs) if test -z "$pic_flag" && test -n "$link_static_flag"; then dlopen_self=$dlopen_self_static fi prefer_static_libs=yes ;; esac build_libtool_libs=no build_old_libs=yes break ;; esac done # See if our shared archives depend on static archives. test -n "$old_archive_from_new_cmds" && build_old_libs=yes # Go through the arguments, transforming them on the way. while test "$#" -gt 0; do arg="$1" shift func_quote_for_eval "$arg" qarg=$func_quote_for_eval_unquoted_result func_append libtool_args " $func_quote_for_eval_result" # If the previous option needs an argument, assign it. if test -n "$prev"; then case $prev in output) func_append compile_command " @OUTPUT@" func_append finalize_command " @OUTPUT@" ;; esac case $prev in bindir) bindir="$arg" prev= continue ;; dlfiles|dlprefiles) if test "$preload" = no; then # Add the symbol object into the linking commands. func_append compile_command " @SYMFILE@" func_append finalize_command " @SYMFILE@" preload=yes fi case $arg in *.la | *.lo) ;; # We handle these cases below. force) if test "$dlself" = no; then dlself=needless export_dynamic=yes fi prev= continue ;; self) if test "$prev" = dlprefiles; then dlself=yes elif test "$prev" = dlfiles && test "$dlopen_self" != yes; then dlself=yes else dlself=needless export_dynamic=yes fi prev= continue ;; *) if test "$prev" = dlfiles; then func_append dlfiles " $arg" else func_append dlprefiles " $arg" fi prev= continue ;; esac ;; expsyms) export_symbols="$arg" test -f "$arg" \ || func_fatal_error "symbol file \`$arg' does not exist" prev= continue ;; expsyms_regex) export_symbols_regex="$arg" prev= continue ;; framework) case $host in *-*-darwin*) case "$deplibs " in *" $qarg.ltframework "*) ;; *) func_append deplibs " $qarg.ltframework" # this is fixed later ;; esac ;; esac prev= continue ;; inst_prefix) inst_prefix_dir="$arg" prev= continue ;; objectlist) if test -f "$arg"; then save_arg=$arg moreargs= for fil in `cat "$save_arg"` do # func_append moreargs " $fil" arg=$fil # A libtool-controlled object. # Check to see that this really is a libtool object. if func_lalib_unsafe_p "$arg"; then pic_object= non_pic_object= # Read the .lo file func_source "$arg" if test -z "$pic_object" || test -z "$non_pic_object" || test "$pic_object" = none && test "$non_pic_object" = none; then func_fatal_error "cannot find name of object for \`$arg'" fi # Extract subdirectory from the argument. func_dirname "$arg" "/" "" xdir="$func_dirname_result" if test "$pic_object" != none; then # Prepend the subdirectory the object is found in. pic_object="$xdir$pic_object" if test "$prev" = dlfiles; then if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then func_append dlfiles " $pic_object" prev= continue else # If libtool objects are unsupported, then we need to preload. prev=dlprefiles fi fi # CHECK ME: I think I busted this. -Ossama if test "$prev" = dlprefiles; then # Preload the old-style object. func_append dlprefiles " $pic_object" prev= fi # A PIC object. func_append libobjs " $pic_object" arg="$pic_object" fi # Non-PIC object. if test "$non_pic_object" != none; then # Prepend the subdirectory the object is found in. non_pic_object="$xdir$non_pic_object" # A standard non-PIC object func_append non_pic_objects " $non_pic_object" if test -z "$pic_object" || test "$pic_object" = none ; then arg="$non_pic_object" fi else # If the PIC object exists, use it instead. # $xdir was prepended to $pic_object above. non_pic_object="$pic_object" func_append non_pic_objects " $non_pic_object" fi else # Only an error if not doing a dry-run. if $opt_dry_run; then # Extract subdirectory from the argument. func_dirname "$arg" "/" "" xdir="$func_dirname_result" func_lo2o "$arg" pic_object=$xdir$objdir/$func_lo2o_result non_pic_object=$xdir$func_lo2o_result func_append libobjs " $pic_object" func_append non_pic_objects " $non_pic_object" else func_fatal_error "\`$arg' is not a valid libtool object" fi fi done else func_fatal_error "link input file \`$arg' does not exist" fi arg=$save_arg prev= continue ;; precious_regex) precious_files_regex="$arg" prev= continue ;; release) release="-$arg" prev= continue ;; rpath | xrpath) # We need an absolute path. case $arg in [\\/]* | [A-Za-z]:[\\/]*) ;; *) func_fatal_error "only absolute run-paths are allowed" ;; esac if test "$prev" = rpath; then case "$rpath " in *" $arg "*) ;; *) func_append rpath " $arg" ;; esac else case "$xrpath " in *" $arg "*) ;; *) func_append xrpath " $arg" ;; esac fi prev= continue ;; shrext) shrext_cmds="$arg" prev= continue ;; weak) func_append weak_libs " $arg" prev= continue ;; xcclinker) func_append linker_flags " $qarg" func_append compiler_flags " $qarg" prev= func_append compile_command " $qarg" func_append finalize_command " $qarg" continue ;; xcompiler) func_append compiler_flags " $qarg" prev= func_append compile_command " $qarg" func_append finalize_command " $qarg" continue ;; xlinker) func_append linker_flags " $qarg" func_append compiler_flags " $wl$qarg" prev= func_append compile_command " $wl$qarg" func_append finalize_command " $wl$qarg" continue ;; *) eval "$prev=\"\$arg\"" prev= continue ;; esac fi # test -n "$prev" prevarg="$arg" case $arg in -all-static) if test -n "$link_static_flag"; then # See comment for -static flag below, for more details. func_append compile_command " $link_static_flag" func_append finalize_command " $link_static_flag" fi continue ;; -allow-undefined) # FIXME: remove this flag sometime in the future. func_fatal_error "\`-allow-undefined' must not be used because it is the default" ;; -avoid-version) avoid_version=yes continue ;; -bindir) prev=bindir continue ;; -dlopen) prev=dlfiles continue ;; -dlpreopen) prev=dlprefiles continue ;; -export-dynamic) export_dynamic=yes continue ;; -export-symbols | -export-symbols-regex) if test -n "$export_symbols" || test -n "$export_symbols_regex"; then func_fatal_error "more than one -exported-symbols argument is not allowed" fi if test "X$arg" = "X-export-symbols"; then prev=expsyms else prev=expsyms_regex fi continue ;; -framework) prev=framework continue ;; -inst-prefix-dir) prev=inst_prefix continue ;; # The native IRIX linker understands -LANG:*, -LIST:* and -LNO:* # so, if we see these flags be careful not to treat them like -L -L[A-Z][A-Z]*:*) case $with_gcc/$host in no/*-*-irix* | /*-*-irix*) func_append compile_command " $arg" func_append finalize_command " $arg" ;; esac continue ;; -L*) 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]:[\\/]*) ;; *) absdir=`cd "$dir" && pwd` test -z "$absdir" && \ func_fatal_error "cannot determine absolute directory name of \`$dir'" dir="$absdir" ;; esac case "$deplibs " in *" -L$dir "* | *" $arg "*) # Will only happen for absolute or sysroot arguments ;; *) # 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 "$dir" | $SED 's*/lib$*/bin*'` case :$dllsearchpath: in *":$dir:"*) ;; ::) dllsearchpath=$dir;; *) func_append dllsearchpath ":$dir";; esac case :$dllsearchpath: in *":$testbindir:"*) ;; ::) dllsearchpath=$testbindir;; *) func_append dllsearchpath ":$testbindir";; esac ;; esac continue ;; -l*) if test "X$arg" = "X-lc" || test "X$arg" = "X-lm"; then case $host in *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-beos* | *-cegcc* | *-*-haiku*) # These systems don't actually have a C or math library (as such) continue ;; *-*-os2*) # These systems don't actually have a C library (as such) test "X$arg" = "X-lc" && continue ;; *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*) # Do not include libc due to us having libc/libc_r. test "X$arg" = "X-lc" && continue ;; *-*-rhapsody* | *-*-darwin1.[012]) # Rhapsody C and math libraries are in the System framework func_append deplibs " System.ltframework" continue ;; *-*-sco3.2v5* | *-*-sco5v6*) # Causes problems with __ctype test "X$arg" = "X-lc" && continue ;; *-*-sysv4.2uw2* | *-*-sysv5* | *-*-unixware* | *-*-OpenUNIX*) # Compiler inserts libc in the correct place for threads to work test "X$arg" = "X-lc" && continue ;; esac elif test "X$arg" = "X-lc_r"; then case $host in *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*) # Do not include libc_r directly, use -pthread flag. continue ;; esac fi func_append deplibs " $arg" continue ;; -module) module=yes continue ;; # 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|--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|-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 "*) ;; * ) func_append new_inherited_linker_flags " $arg" ;; esac continue ;; -multi_module) single_module="${wl}-multi_module" continue ;; -no-fast-install) fast_install=no continue ;; -no-install) case $host in *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-darwin* | *-cegcc*) # The PATH hackery in wrapper scripts is required on Windows # and Darwin in order for the loader to find any dlls it needs. func_warning "\`-no-install' is ignored for $host" func_warning "assuming \`-no-fast-install' instead" fast_install=no ;; *) no_install=yes ;; esac continue ;; -no-undefined) allow_undefined=no continue ;; -objectlist) prev=objectlist continue ;; -o) prev=output ;; -precious-files-regex) prev=precious_regex continue ;; -release) prev=release continue ;; -rpath) prev=rpath continue ;; -R) prev=xrpath continue ;; -R*) func_stripname '-R' '' "$arg" dir=$func_stripname_result # 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 "*) ;; *) func_append xrpath " $dir" ;; esac continue ;; -shared) # The effects of -shared are defined in a previous loop. continue ;; -shrext) prev=shrext continue ;; -static | -static-libtool-libs) # The effects of -static are defined in a previous loop. # We used to do the same as -all-static on platforms that # didn't have a PIC flag, but the assumption that the effects # would be equivalent was wrong. It would break on at least # Digital Unix and AIX. continue ;; -thread-safe) thread_safe=yes continue ;; -version-info) prev=vinfo continue ;; -version-number) prev=vinfo vinfo_number=yes continue ;; -weak) prev=weak continue ;; -Wc,*) func_stripname '-Wc,' '' "$arg" args=$func_stripname_result arg= save_ifs="$IFS"; IFS=',' for flag in $args; do IFS="$save_ifs" func_quote_for_eval "$flag" func_append arg " $func_quote_for_eval_result" func_append compiler_flags " $func_quote_for_eval_result" done IFS="$save_ifs" func_stripname ' ' '' "$arg" arg=$func_stripname_result ;; -Wl,*) func_stripname '-Wl,' '' "$arg" args=$func_stripname_result arg= save_ifs="$IFS"; IFS=',' for flag in $args; do IFS="$save_ifs" func_quote_for_eval "$flag" 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" arg=$func_stripname_result ;; -Xcompiler) prev=xcompiler continue ;; -Xlinker) prev=xlinker continue ;; -XCClinker) prev=xcclinker continue ;; # -msg_* for osf cc -msg_*) func_quote_for_eval "$arg" arg="$func_quote_for_eval_result" ;; # 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*|@*|-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" func_append compiler_flags " $arg" continue ;; # Some other compiler flag. -* | +*) func_quote_for_eval "$arg" arg="$func_quote_for_eval_result" ;; *.$objext) # A standard object. func_append objs " $arg" ;; *.lo) # A libtool-controlled object. # Check to see that this really is a libtool object. if func_lalib_unsafe_p "$arg"; then pic_object= non_pic_object= # Read the .lo file func_source "$arg" if test -z "$pic_object" || test -z "$non_pic_object" || test "$pic_object" = none && test "$non_pic_object" = none; then func_fatal_error "cannot find name of object for \`$arg'" fi # Extract subdirectory from the argument. func_dirname "$arg" "/" "" xdir="$func_dirname_result" if test "$pic_object" != none; then # Prepend the subdirectory the object is found in. pic_object="$xdir$pic_object" if test "$prev" = dlfiles; then if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then func_append dlfiles " $pic_object" prev= continue else # If libtool objects are unsupported, then we need to preload. prev=dlprefiles fi fi # CHECK ME: I think I busted this. -Ossama if test "$prev" = dlprefiles; then # Preload the old-style object. func_append dlprefiles " $pic_object" prev= fi # A PIC object. func_append libobjs " $pic_object" arg="$pic_object" fi # Non-PIC object. if test "$non_pic_object" != none; then # Prepend the subdirectory the object is found in. non_pic_object="$xdir$non_pic_object" # A standard non-PIC object func_append non_pic_objects " $non_pic_object" if test -z "$pic_object" || test "$pic_object" = none ; then arg="$non_pic_object" fi else # If the PIC object exists, use it instead. # $xdir was prepended to $pic_object above. non_pic_object="$pic_object" func_append non_pic_objects " $non_pic_object" fi else # Only an error if not doing a dry-run. if $opt_dry_run; then # Extract subdirectory from the argument. func_dirname "$arg" "/" "" xdir="$func_dirname_result" func_lo2o "$arg" pic_object=$xdir$objdir/$func_lo2o_result non_pic_object=$xdir$func_lo2o_result func_append libobjs " $pic_object" func_append non_pic_objects " $non_pic_object" else func_fatal_error "\`$arg' is not a valid libtool object" fi fi ;; *.$libext) # An archive. 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. func_append dlfiles " $func_resolve_sysroot_result" prev= elif test "$prev" = dlprefiles; then # The library was specified with -dlpreopen. func_append dlprefiles " $func_resolve_sysroot_result" prev= else func_append deplibs " $func_resolve_sysroot_result" fi continue ;; # Some other compiler argument. *) # Unknown arguments in both finalize_command and compile_command need # to be aesthetically quoted because they are evaled later. func_quote_for_eval "$arg" arg="$func_quote_for_eval_result" ;; esac # arg # Now actually substitute the argument into the commands. if test -n "$arg"; then func_append compile_command " $arg" func_append finalize_command " $arg" fi done # argument parsing loop test -n "$prev" && \ func_fatal_help "the \`$prevarg' option requires an argument" if test "$export_dynamic" = yes && test -n "$export_dynamic_flag_spec"; then eval arg=\"$export_dynamic_flag_spec\" func_append compile_command " $arg" func_append finalize_command " $arg" fi oldlibs= # calculate the name of the file, without its directory func_basename "$output" outputname="$func_basename_result" libobjs_save="$libobjs" if test -n "$shlibpath_var"; then # get the directories listed in $shlibpath_var eval shlib_search_path=\`\$ECHO \"\${$shlibpath_var}\" \| \$SED \'s/:/ /g\'\` else shlib_search_path= fi eval sys_lib_search_path=\"$sys_lib_search_path_spec\" eval sys_lib_dlsearch_path=\"$sys_lib_dlsearch_path_spec\" 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" # Determine the type of output case $output in "") func_fatal_help "you must specify an output file" ;; *.$libext) linkmode=oldlib ;; *.lo | *.$objext) linkmode=obj ;; *.la) linkmode=lib ;; *) linkmode=prog ;; # Anything else should be a program. esac specialdeplibs= libs= # 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_preserve_dup_deps ; then case "$libs " in *" $deplib "*) func_append specialdeplibs " $deplib" ;; esac fi func_append libs " $deplib" done if test "$linkmode" = lib; then libs="$predeps $libs $compiler_lib_search_path $postdeps" # Compute libraries that are listed more than once in $predeps # $postdeps and mark them as special (i.e., whose duplicates are # not to be eliminated). pre_post_deps= if $opt_duplicate_compiler_generated_deps; then for pre_post_dep in $predeps $postdeps; do case "$pre_post_deps " in *" $pre_post_dep "*) func_append specialdeplibs " $pre_post_deps" ;; esac func_append pre_post_deps " $pre_post_dep" done fi pre_post_deps= fi deplibs= newdependency_libs= newlib_search_path= need_relink=no # whether we're linking any uninstalled libtool libraries notinst_deplibs= # not-installed libtool libraries notinst_path= # paths that contain not-installed libtool libraries case $linkmode in lib) passes="conv dlpreopen link" for file in $dlfiles $dlprefiles; do case $file in *.la) ;; *) func_fatal_help "libraries can \`-dlopen' only libtool libraries: $file" ;; esac done ;; prog) compile_deplibs= finalize_deplibs= alldeplibs=no newdlfiles= newdlprefiles= passes="conv scan dlopen dlpreopen link" ;; *) passes="conv" ;; esac for pass in $passes; do # The preopen pass in lib mode reverses $deplibs; put it back here # so that -L comes before libs that need it for instance... if test "$linkmode,$pass" = "lib,link"; then ## FIXME: Find the place where the list is rebuilt in the wrong ## order, and fix it there properly tmp_deplibs= for deplib in $deplibs; do tmp_deplibs="$deplib $tmp_deplibs" done deplibs="$tmp_deplibs" fi if test "$linkmode,$pass" = "lib,link" || test "$linkmode,$pass" = "prog,scan"; then libs="$deplibs" deplibs= fi if test "$linkmode" = prog; then case $pass in dlopen) libs="$dlfiles" ;; dlpreopen) libs="$dlprefiles" ;; link) libs="$deplibs %DEPLIBS%" test "X$link_all_deplibs" != Xno && libs="$libs $dependency_libs" ;; esac fi if test "$linkmode,$pass" = "lib,dlpreopen"; then # Collect and forward deplibs of preopened libtool libs for lib in $dlprefiles; do # Ignore non-libtool-libs dependency_libs= func_resolve_sysroot "$lib" case $lib in *.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 func_basename "$deplib" deplib_base=$func_basename_result case " $weak_libs " in *" $deplib_base "*) ;; *) func_append deplibs " $deplib" ;; esac done done libs="$dlprefiles" fi if test "$pass" = dlopen; then # Collect dlpreopened libraries save_deplibs="$deplibs" deplibs= fi for deplib in $libs; do lib= found=no case $deplib in -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 func_append compiler_flags " $deplib" if test "$linkmode" = lib ; then case "$new_inherited_linker_flags " in *" $deplib "*) ;; * ) func_append new_inherited_linker_flags " $deplib" ;; esac fi fi continue ;; -l*) if test "$linkmode" != lib && test "$linkmode" != prog; then func_warning "\`-l' is ignored for archives/objects" continue fi func_stripname '-l' '' "$deplib" name=$func_stripname_result if test "$linkmode" = lib; then searchdirs="$newlib_search_path $lib_search_path $compiler_lib_search_dirs $sys_lib_search_path $shlib_search_path" else searchdirs="$newlib_search_path $lib_search_path $sys_lib_search_path $shlib_search_path" fi for searchdir in $searchdirs; do for search_ext in .la $std_shrext .so .a; do # Search the libtool library lib="$searchdir/lib${name}${search_ext}" if test -f "$lib"; then if test "$search_ext" = ".la"; then found=yes else found=no fi break 2 fi done done if test "$found" != yes; then # deplib doesn't seem to be a libtool library if test "$linkmode,$pass" = "prog,link"; then compile_deplibs="$deplib $compile_deplibs" finalize_deplibs="$deplib $finalize_deplibs" else deplibs="$deplib $deplibs" test "$linkmode" = lib && newdependency_libs="$deplib $newdependency_libs" fi continue else # deplib is a libtool library # If $allow_libtool_libs_with_static_runtimes && $deplib is a stdlib, # We need to do some special things here, and not later. if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then case " $predeps $postdeps " in *" $deplib "*) if func_lalib_p "$lib"; then library_names= old_library= func_source "$lib" for l in $old_library $library_names; do ll="$l" done if test "X$ll" = "X$old_library" ; then # only static version available found=no func_dirname "$lib" "" "." ladir="$func_dirname_result" lib=$ladir/$old_library if test "$linkmode,$pass" = "prog,link"; then compile_deplibs="$deplib $compile_deplibs" finalize_deplibs="$deplib $finalize_deplibs" else deplibs="$deplib $deplibs" test "$linkmode" = lib && newdependency_libs="$deplib $newdependency_libs" fi continue fi fi ;; *) ;; esac fi fi ;; # -l *.ltframework) if test "$linkmode,$pass" = "prog,link"; then compile_deplibs="$deplib $compile_deplibs" finalize_deplibs="$deplib $finalize_deplibs" else deplibs="$deplib $deplibs" if test "$linkmode" = lib ; then case "$new_inherited_linker_flags " in *" $deplib "*) ;; * ) func_append new_inherited_linker_flags " $deplib" ;; esac fi fi continue ;; -L*) case $linkmode in lib) deplibs="$deplib $deplibs" test "$pass" = conv && continue newdependency_libs="$deplib $newdependency_libs" func_stripname '-L' '' "$deplib" func_resolve_sysroot "$func_stripname_result" func_append newlib_search_path " $func_resolve_sysroot_result" ;; prog) if test "$pass" = conv; then deplibs="$deplib $deplibs" continue fi if test "$pass" = scan; then deplibs="$deplib $deplibs" else compile_deplibs="$deplib $compile_deplibs" finalize_deplibs="$deplib $finalize_deplibs" fi func_stripname '-L' '' "$deplib" func_resolve_sysroot "$func_stripname_result" func_append newlib_search_path " $func_resolve_sysroot_result" ;; *) func_warning "\`-L' is ignored for archives/objects" ;; esac # linkmode continue ;; # -L -R*) if test "$pass" = link; then func_stripname '-R' '' "$deplib" func_resolve_sysroot "$func_stripname_result" dir=$func_resolve_sysroot_result # Make sure the xrpath contains only unique directories. case "$xrpath " in *" $dir "*) ;; *) func_append xrpath " $dir" ;; esac fi deplibs="$deplib $deplibs" continue ;; *.la) func_resolve_sysroot "$deplib" lib=$func_resolve_sysroot_result ;; *.$libext) if test "$pass" = conv; then deplibs="$deplib $deplibs" continue fi case $linkmode in lib) # Linking convenience modules into shared libraries is allowed, # but linking other static libraries is non-portable. case " $dlpreconveniencelibs " in *" $deplib "*) ;; *) valid_a_lib=no case $deplibs_check_method in match_pattern*) set dummy $deplibs_check_method; shift match_pattern_regex=`expr "$deplibs_check_method" : "$1 \(.*\)"` if eval "\$ECHO \"$deplib\"" 2>/dev/null | $SED 10q \ | $EGREP "$match_pattern_regex" > /dev/null; then valid_a_lib=yes fi ;; pass_all) valid_a_lib=yes ;; esac if test "$valid_a_lib" != yes; then 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." else echo $ECHO "*** Warning: Linking the shared library $output against the" $ECHO "*** static library $deplib is not portable!" deplibs="$deplib $deplibs" fi ;; esac continue ;; prog) if test "$pass" != link; then deplibs="$deplib $deplibs" else compile_deplibs="$deplib $compile_deplibs" finalize_deplibs="$deplib $finalize_deplibs" fi continue ;; esac # linkmode ;; # *.$libext *.lo | *.$objext) if test "$pass" = conv; then deplibs="$deplib $deplibs" elif test "$linkmode" = prog; then 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. func_append newdlprefiles " $deplib" compile_deplibs="$deplib $compile_deplibs" finalize_deplibs="$deplib $finalize_deplibs" else func_append newdlfiles " $deplib" fi fi continue ;; %DEPLIBS%) alldeplibs=yes continue ;; esac # case $deplib if test "$found" = yes || test -f "$lib"; then : else func_fatal_error "cannot find the library \`$lib' or unhandled argument \`$deplib'" fi # Check to see that this really is a libtool archive. func_lalib_unsafe_p "$lib" \ || func_fatal_error "\`$lib' is not a valid libtool archive" func_dirname "$lib" "" "." ladir="$func_dirname_result" dlname= dlopen= dlpreopen= libdir= library_names= old_library= inherited_linker_flags= # If the library was installed with an old release of libtool, # it will not redefine variables installed, or shouldnotlink installed=yes shouldnotlink=no avoidtemprpath= # Read the .la file func_source "$lib" # Convert "-framework foo" to "foo.ltframework" if test -n "$inherited_linker_flags"; then 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 "*) ;; *) func_append new_inherited_linker_flags " $tmp_inherited_linker_flag";; esac done fi 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" && func_append dlfiles " $dlopen" test -n "$dlpreopen" && func_append dlprefiles " $dlpreopen" fi if test "$pass" = conv; then # Only check for convenience libraries deplibs="$lib $deplibs" if test -z "$libdir"; then if test -z "$old_library"; then func_fatal_error "cannot find name of link library for \`$lib'" fi # It is a libtool convenience library, so add in its objects. func_append convenience " $ladir/$objdir/$old_library" func_append old_convenience " $ladir/$objdir/$old_library" tmp_libs= for deplib in $dependency_libs; do deplibs="$deplib $deplibs" if $opt_preserve_dup_deps ; then case "$tmp_libs " in *" $deplib "*) func_append specialdeplibs " $deplib" ;; esac fi func_append tmp_libs " $deplib" done elif test "$linkmode" != prog && test "$linkmode" != lib; then func_fatal_error "\`$lib' is not a convenience library" fi continue fi # $pass = conv # Get the name of the library we link against. linklib= 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 # This library was specified with -dlopen. if test "$pass" = dlopen; then if test -z "$libdir"; then func_fatal_error "cannot -dlopen a convenience library: \`$lib'" fi if test -z "$dlname" || test "$dlopen_support" != yes || test "$build_libtool_libs" = no; then # If there is no dlname, no dlopen support or we're linking # 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. func_append dlprefiles " $lib $dependency_libs" else func_append newdlfiles " $lib" fi continue fi # $pass = dlopen # We need an absolute path. case $ladir in [\\/]* | [A-Za-z]:[\\/]*) abs_ladir="$ladir" ;; *) abs_ladir=`cd "$ladir" && pwd` if test -z "$abs_ladir"; then func_warning "cannot determine absolute directory name of \`$ladir'" func_warning "passing it literally to the linker, although it might fail" abs_ladir="$ladir" fi ;; esac func_basename "$lib" laname="$func_basename_result" # Find the relevant object directory and library name. if test "X$installed" = Xyes; 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="$lt_sysroot$libdir" absdir="$lt_sysroot$libdir" fi test "X$hardcode_automatic" = Xyes && avoidtemprpath=yes else if test ! -f "$ladir/$objdir/$linklib" && test -f "$abs_ladir/$linklib"; then dir="$ladir" absdir="$abs_ladir" # Remove this search path later func_append notinst_path " $abs_ladir" else dir="$ladir/$objdir" absdir="$abs_ladir/$objdir" # Remove this search path later func_append notinst_path " $abs_ladir" fi fi # $installed = yes func_stripname 'lib' '.la' "$laname" name=$func_stripname_result # This library was specified with -dlpreopen. if test "$pass" = dlpreopen; then if test -z "$libdir" && test "$linkmode" = prog; then func_fatal_error "only libraries may -dlpreopen a convenience library: \`$lib'" 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 # Link the convenience library if test "$linkmode" = lib; then deplibs="$dir/$old_library $deplibs" elif test "$linkmode,$pass" = "prog,link"; then compile_deplibs="$dir/$old_library $compile_deplibs" finalize_deplibs="$dir/$old_library $finalize_deplibs" else deplibs="$lib $deplibs" # used for prog,scan pass fi continue fi if test "$linkmode" = prog && test "$pass" != link; then func_append newlib_search_path " $ladir" deplibs="$lib $deplibs" linkalldeplibs=no if test "$link_all_deplibs" != no || test -z "$library_names" || test "$build_libtool_libs" = no; then linkalldeplibs=yes fi tmp_libs= for deplib in $dependency_libs; do case $deplib in -L*) func_stripname '-L' '' "$deplib" func_resolve_sysroot "$func_stripname_result" func_append newlib_search_path " $func_resolve_sysroot_result" ;; esac # Need to link against all dependency_libs? if test "$linkalldeplibs" = yes; then deplibs="$deplib $deplibs" else # Need to hardcode shared library paths # or/and link against static libraries newdependency_libs="$deplib $newdependency_libs" fi if $opt_preserve_dup_deps ; then case "$tmp_libs " in *" $deplib "*) func_append specialdeplibs " $deplib" ;; esac fi func_append tmp_libs " $deplib" done # for deplib continue fi # $linkmode = prog... if test "$linkmode,$pass" = "prog,link"; then if test -n "$library_names" && { { test "$prefer_static_libs" = no || test "$prefer_static_libs,$installed" = "built,yes"; } || test -z "$old_library"; }; then # We need to hardcode the library path if test -n "$shlibpath_var" && test -z "$avoidtemprpath" ; then # Make sure the rpath contains only unique directories. case "$temp_rpath:" in *"$absdir:"*) ;; *) func_append temp_rpath "$absdir:" ;; esac fi # Hardcode the library path. # Skip directories that are in the system default run-time # search path. case " $sys_lib_dlsearch_path " in *" $absdir "*) ;; *) case "$compile_rpath " in *" $absdir "*) ;; *) func_append compile_rpath " $absdir" ;; esac ;; esac case " $sys_lib_dlsearch_path " in *" $libdir "*) ;; *) case "$finalize_rpath " in *" $libdir "*) ;; *) func_append finalize_rpath " $libdir" ;; esac ;; esac fi # $linkmode,$pass = prog,link... if test "$alldeplibs" = yes && { test "$deplibs_check_method" = pass_all || { test "$build_libtool_libs" = yes && test -n "$library_names"; }; }; then # We only need to search for static libraries continue fi fi link_static=no # Whether the deplib will be linked statically use_static_libs=$prefer_static_libs if test "$use_static_libs" = built && test "$installed" = yes; then use_static_libs=no fi if test -n "$library_names" && { test "$use_static_libs" = no || test -z "$old_library"; }; then case $host in *cygwin* | *mingw* | *cegcc*) # No point in relinking DLLs because paths are not encoded func_append notinst_deplibs " $lib" need_relink=no ;; *) if test "$installed" = no; then func_append notinst_deplibs " $lib" need_relink=yes fi ;; esac # This is a shared library # Warn about portability, can't link against -module's on some # systems (darwin). Don't bleat about dlopened modules though! dlopenmodule="" for dlpremoduletest in $dlprefiles; do if test "X$dlpremoduletest" = "X$lib"; then dlopenmodule="$dlpremoduletest" break fi done if test -z "$dlopenmodule" && test "$shouldnotlink" = yes && test "$pass" = link; then echo if test "$linkmode" = prog; then $ECHO "*** Warning: Linking the executable $output against the loadable module" else $ECHO "*** Warning: Linking the shared library $output against the loadable module" fi $ECHO "*** $linklib is not portable!" fi if test "$linkmode" = lib && test "$hardcode_into_libs" = yes; then # Hardcode the library path. # Skip directories that are in the system default run-time # search path. case " $sys_lib_dlsearch_path " in *" $absdir "*) ;; *) case "$compile_rpath " in *" $absdir "*) ;; *) func_append compile_rpath " $absdir" ;; esac ;; esac case " $sys_lib_dlsearch_path " in *" $libdir "*) ;; *) case "$finalize_rpath " in *" $libdir "*) ;; *) func_append finalize_rpath " $libdir" ;; esac ;; esac fi if test -n "$old_archive_from_expsyms_cmds"; then # figure out the soname set dummy $library_names shift realname="$1" shift libname=`eval "\\$ECHO \"$libname_spec\""` # use dlname if we got it. it's perfectly good, no? if test -n "$dlname"; then soname="$dlname" elif test -n "$soname_spec"; then # bleh windows case $host in *cygwin* | mingw* | *cegcc*) func_arith $current - $age major=$func_arith_result versuffix="-$major" ;; esac eval soname=\"$soname_spec\" else soname="$realname" fi # Make a new name for the extract_expsyms_cmds to use soroot="$soname" func_basename "$soroot" soname="$func_basename_result" func_stripname 'lib' '.dll' "$soname" newlib=libimp-$func_stripname_result.a # If the library has no export list, then create one now if test -f "$output_objdir/$soname-def"; then : else func_verbose "extracting exported symbol list from \`$soname'" func_execute_cmds "$extract_expsyms_cmds" 'exit $?' fi # Create $newlib if test -f "$output_objdir/$newlib"; then :; else func_verbose "generating import library for \`$soname'" func_execute_cmds "$old_archive_from_expsyms_cmds" 'exit $?' fi # make sure the library variables are pointing to the new library dir=$output_objdir linklib=$newlib fi # test -n "$old_archive_from_expsyms_cmds" if test "$linkmode" = prog || test "$opt_mode" != relink; then add_shlibpath= add_dir= add= lib_linked=yes case $hardcode_action in immediate | unsupported) if test "$hardcode_direct" = no; then add="$dir/$linklib" case $host in *-*-sco3.2v5.0.[024]*) add_dir="-L$dir" ;; *-*-sysv4*uw2*) add_dir="-L$dir" ;; *-*-sysv5OpenUNIX* | *-*-sysv5UnixWare7.[01].[10]* | \ *-*-unixware7*) add_dir="-L$dir" ;; *-*-darwin* ) # if the lib is a (non-dlopened) module then we can not # link against it, someone is ignoring the earlier warnings if /usr/bin/file -L $add 2> /dev/null | $GREP ": [^:]* bundle" >/dev/null ; then 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" else add="$dir/$old_library" fi elif test -n "$old_library"; then add="$dir/$old_library" fi fi esac elif test "$hardcode_minus_L" = no; then case $host in *-*-sunos*) add_shlibpath="$dir" ;; esac add_dir="-L$dir" add="-l$name" elif test "$hardcode_shlibpath_var" = no; then add_shlibpath="$dir" add="-l$name" else lib_linked=no fi ;; relink) if test "$hardcode_direct" = yes && test "$hardcode_direct_absolute" = no; then add="$dir/$linklib" elif test "$hardcode_minus_L" = yes; then 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 [\\/]*) func_append add_dir " -L$inst_prefix_dir$libdir" ;; esac fi add="-l$name" elif test "$hardcode_shlibpath_var" = yes; then add_shlibpath="$dir" add="-l$name" else lib_linked=no fi ;; *) lib_linked=no ;; esac if test "$lib_linked" != yes; then func_fatal_configuration "unsupported hardcode properties" fi if test -n "$add_shlibpath"; then case :$compile_shlibpath: in *":$add_shlibpath:"*) ;; *) func_append compile_shlibpath "$add_shlibpath:" ;; esac fi if test "$linkmode" = prog; then test -n "$add_dir" && compile_deplibs="$add_dir $compile_deplibs" test -n "$add" && compile_deplibs="$add $compile_deplibs" else test -n "$add_dir" && deplibs="$add_dir $deplibs" test -n "$add" && deplibs="$add $deplibs" if test "$hardcode_direct" != yes && test "$hardcode_minus_L" != yes && test "$hardcode_shlibpath_var" = yes; then case :$finalize_shlibpath: in *":$libdir:"*) ;; *) func_append finalize_shlibpath "$libdir:" ;; esac fi fi fi if test "$linkmode" = prog || test "$opt_mode" = relink; then add_shlibpath= add_dir= add= # Finalize command for both is simple: just hardcode it. if test "$hardcode_direct" = yes && test "$hardcode_direct_absolute" = no; then add="$libdir/$linklib" elif test "$hardcode_minus_L" = yes; then add_dir="-L$libdir" add="-l$name" elif test "$hardcode_shlibpath_var" = yes; then case :$finalize_shlibpath: in *":$libdir:"*) ;; *) func_append finalize_shlibpath "$libdir:" ;; esac add="-l$name" elif test "$hardcode_automatic" = yes; then if test -n "$inst_prefix_dir" && test -f "$inst_prefix_dir$libdir/$linklib" ; then add="$inst_prefix_dir$libdir/$linklib" else add="$libdir/$linklib" fi else # We cannot seem to hardcode it, guess we'll fake it. add_dir="-L$libdir" # Try looking first in the location we're being installed to. if test -n "$inst_prefix_dir"; then case $libdir in [\\/]*) func_append add_dir " -L$inst_prefix_dir$libdir" ;; esac fi add="-l$name" fi if test "$linkmode" = prog; then test -n "$add_dir" && finalize_deplibs="$add_dir $finalize_deplibs" test -n "$add" && finalize_deplibs="$add $finalize_deplibs" else test -n "$add_dir" && deplibs="$add_dir $deplibs" test -n "$add" && deplibs="$add $deplibs" fi fi elif test "$linkmode" = prog; then # Here we assume that one of hardcode_direct or hardcode_minus_L # is not unsupported. This is valid on all known static and # shared platforms. if test "$hardcode_direct" != unsupported; then test -n "$old_library" && linklib="$old_library" compile_deplibs="$dir/$linklib $compile_deplibs" finalize_deplibs="$dir/$linklib $finalize_deplibs" else compile_deplibs="-l$name -L$dir $compile_deplibs" finalize_deplibs="-l$name -L$dir $finalize_deplibs" fi elif test "$build_libtool_libs" = yes; then # Not a shared library if test "$deplibs_check_method" != pass_all; then # We're trying link a shared library against a static one # but the system doesn't support it. # Just print a warning and add the library to dependency_libs so # that the program can be linked against the static library. 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." 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." 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." fi if test "$build_old_libs" = no; then build_libtool_libs=module build_old_libs=yes else build_libtool_libs=no fi fi else deplibs="$dir/$old_library $deplibs" link_static=yes fi fi # link shared/static library? if test "$linkmode" = lib; then if test -n "$dependency_libs" && { test "$hardcode_into_libs" != yes || test "$build_old_libs" = yes || test "$link_static" = yes; }; then # Extract -R from dependency_libs temp_deplibs= for libdir in $dependency_libs; do case $libdir in -R*) func_stripname '-R' '' "$libdir" temp_xrpath=$func_stripname_result case " $xrpath " in *" $temp_xrpath "*) ;; *) func_append xrpath " $temp_xrpath";; esac;; *) func_append temp_deplibs " $libdir";; esac done dependency_libs="$temp_deplibs" fi 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" 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 *" $func_resolve_sysroot_result "*) func_append specialdeplibs " $func_resolve_sysroot_result" ;; esac fi 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 # We need an absolute path. case $dir in [\\/]* | [A-Za-z]:[\\/]*) absdir="$dir" ;; *) absdir=`cd "$dir" && pwd` if test -z "$absdir"; then func_warning "cannot determine absolute directory name of \`$dir'" absdir="$dir" fi ;; esac if $GREP "^installed=no" $deplib > /dev/null; then case $host in *-*-darwin*) depdepl= eval deplibrary_names=`${SED} -n -e 's/^library_names=\(.*\)$/\1/p' $deplib` if test -n "$deplibrary_names" ; then for tmp in $deplibrary_names ; do depdepl=$tmp done if test -f "$absdir/$objdir/$depdepl" ; then depdepl="$absdir/$objdir/$depdepl" darwin_install_name=`${OTOOL} -L $depdepl | awk '{if (NR == 2) {print $1;exit}}'` if test -z "$darwin_install_name"; then darwin_install_name=`${OTOOL64} -L $depdepl | awk '{if (NR == 2) {print $1;exit}}'` fi 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 ;; *) path="-L$absdir/$objdir" ;; esac else eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $deplib` test -z "$libdir" && \ func_fatal_error "\`$deplib' is not a valid libtool archive" test "$absdir" != "$libdir" && \ func_warning "\`$deplib' seems to be moved" path="-L$absdir" fi ;; esac case " $deplibs " in *" $path "*) ;; *) deplibs="$path $deplibs" ;; esac done fi # link_all_deplibs != no fi # linkmode = lib done # for deplib in $libs if test "$pass" = link; then if test "$linkmode" = "prog"; then compile_deplibs="$new_inherited_linker_flags $compile_deplibs" finalize_deplibs="$new_inherited_linker_flags $finalize_deplibs" else compiler_flags="$compiler_flags "`$ECHO " $new_inherited_linker_flags" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` fi fi dependency_libs="$newdependency_libs" if test "$pass" = dlpreopen; then # Link the dlpreopened libraries before other libraries for deplib in $save_deplibs; do deplibs="$deplib $deplibs" done fi if test "$pass" != dlopen; then if test "$pass" != conv; then # Make sure lib_search_path contains only unique directories. lib_search_path= for dir in $newlib_search_path; do case "$lib_search_path " in *" $dir "*) ;; *) func_append lib_search_path " $dir" ;; esac done newlib_search_path= fi if test "$linkmode,$pass" != "prog,link"; then vars="deplibs" else vars="compile_deplibs finalize_deplibs" fi for var in $vars dependency_libs; do # Add libraries to $var in reverse order eval tmp_libs=\"\$$var\" new_libs= for deplib in $tmp_libs; do # FIXME: Pedantically, this is the right thing to do, so # that some nasty dependency loop isn't accidentally # broken: #new_libs="$deplib $new_libs" # Pragmatically, this seems to cause very few problems in # practice: case $deplib in -L*) new_libs="$deplib $new_libs" ;; -R*) ;; *) # And here is the reason: when a library appears more # than once as an explicit dependence of a library, or # is implicitly linked in more than once by the # compiler, it is considered special, and multiple # occurrences thereof are not removed. Compare this # with having the same library being listed as a # dependency of multiple other libraries: in this case, # we know (pedantically, we assume) the library does not # need to be listed more than once, so we keep only the # last copy. This is not always right, but it is rare # enough that we require users that really mean to play # such unportable linking tricks to link the library # using -Wl,-lname, so that libtool does not consider it # for duplicate removal. case " $specialdeplibs " in *" $deplib "*) new_libs="$deplib $new_libs" ;; *) case " $new_libs " in *" $deplib "*) ;; *) new_libs="$deplib $new_libs" ;; esac ;; esac ;; esac done tmp_libs= for deplib in $new_libs; do case $deplib in -L*) case " $tmp_libs " in *" $deplib "*) ;; *) func_append tmp_libs " $deplib" ;; esac ;; *) func_append tmp_libs " $deplib" ;; esac done eval $var=\"$tmp_libs\" done # for var fi # Last step: remove runtime libs from dependency_libs # (they stay in deplibs) tmp_libs= for i in $dependency_libs ; do case " $predeps $postdeps $compiler_lib_search_path " in *" $i "*) i="" ;; esac if test -n "$i" ; then func_append tmp_libs " $i" fi done dependency_libs=$tmp_libs done # for pass if test "$linkmode" = prog; then dlfiles="$newdlfiles" fi if test "$linkmode" = prog || test "$linkmode" = lib; then dlprefiles="$newdlprefiles" fi case $linkmode in oldlib) if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then func_warning "\`-dlopen' is ignored for archives" fi case " $deplibs" in *\ -l* | *\ -L*) func_warning "\`-l' and \`-L' are ignored for archives" ;; esac test -n "$rpath" && \ func_warning "\`-rpath' is ignored for archives" test -n "$xrpath" && \ func_warning "\`-R' is ignored for archives" test -n "$vinfo" && \ func_warning "\`-version-info/-version-number' is ignored for archives" test -n "$release" && \ func_warning "\`-release' is ignored for archives" test -n "$export_symbols$export_symbols_regex" && \ func_warning "\`-export-symbols' is ignored for archives" # Now set the variables for building old libraries. build_libtool_libs=no oldlibs="$output" func_append objs "$old_deplibs" ;; lib) # Make sure we only generate libraries of the form `libNAME.la'. case $outputname in lib*) func_stripname 'lib' '.la' "$outputname" name=$func_stripname_result eval shared_ext=\"$shrext_cmds\" eval libname=\"$libname_spec\" ;; *) test "$module" = no && \ func_fatal_help "libtool library \`$output' must begin with \`lib'" if test "$need_lib_prefix" != no; then # Add the "lib" prefix for modules if required func_stripname '' '.la' "$outputname" name=$func_stripname_result eval shared_ext=\"$shrext_cmds\" eval libname=\"$libname_spec\" else func_stripname '' '.la' "$outputname" libname=$func_stripname_result fi ;; esac if test -n "$objs"; then 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 "*** Warning: Linking the shared library $output against the non-libtool" $ECHO "*** objects $objs is not portable!" func_append libobjs " $objs" fi fi test "$dlself" != no && \ func_warning "\`-dlopen self' is ignored for libtool libraries" set dummy $rpath shift test "$#" -gt 1 && \ func_warning "ignoring multiple \`-rpath's for a libtool library" install_libdir="$1" oldlibs= if test -z "$rpath"; then if test "$build_libtool_libs" = yes; then # Building a libtool convenience library. # Some compilers have problems with a `.al' extension so # convenience libraries should have the same extension an # archive normally would. oldlibs="$output_objdir/$libname.$libext $oldlibs" build_libtool_libs=convenience build_old_libs=yes fi test -n "$vinfo" && \ func_warning "\`-version-info/-version-number' is ignored for convenience libraries" test -n "$release" && \ func_warning "\`-release' is ignored for convenience libraries" else # Parse the version information argument. save_ifs="$IFS"; IFS=':' set dummy $vinfo 0 0 0 shift IFS="$save_ifs" test -n "$7" && \ func_fatal_help "too many parameters to \`-version-info'" # convert absolute version numbers to libtool ages # this retains compatibility with .la files and attempts # to make the code below a bit more comprehensible case $vinfo_number in yes) number_major="$1" number_minor="$2" number_revision="$3" # # There are really only two kinds -- those that # use the current revision as the major version # and those that subtract age and use age as # a minor version. But, then there is irix # 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|qnx|sunos) current="$number_major" revision="$number_minor" age="0" ;; irix|nonstopux) func_arith $number_major + $number_minor current=$func_arith_result age="$number_minor" revision="$number_minor" lt_irix_increment=no ;; *) func_fatal_configuration "$modename: unknown library version type \`$version_type'" ;; esac ;; no) current="$1" revision="$2" age="$3" ;; esac # Check that each of the things are valid numbers. case $current in 0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;; *) func_error "CURRENT \`$current' must be a nonnegative integer" func_fatal_error "\`$vinfo' is not valid version information" ;; esac case $revision in 0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;; *) func_error "REVISION \`$revision' must be a nonnegative integer" func_fatal_error "\`$vinfo' is not valid version information" ;; esac case $age in 0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;; *) func_error "AGE \`$age' must be a nonnegative integer" func_fatal_error "\`$vinfo' is not valid version information" ;; esac if test "$age" -gt "$current"; then func_error "AGE \`$age' is greater than the current interface number \`$current'" func_fatal_error "\`$vinfo' is not valid version information" fi # Calculate the version variables. major= versuffix= verstring= case $version_type in none) ;; darwin) # Like Linux, but with the current version available in # verstring for coding it into the library header func_arith $current - $age major=.$func_arith_result versuffix="$major.$age.$revision" # Darwin ld doesn't like 0 for these options... func_arith $current + 1 minor_current=$func_arith_result xlcverstring="${wl}-compatibility_version ${wl}$minor_current ${wl}-current_version ${wl}$minor_current.$revision" verstring="-compatibility_version $minor_current -current_version $minor_current.$revision" ;; freebsd-aout) major=".$current" versuffix=".$current.$revision"; ;; freebsd-elf) major=".$current" versuffix=".$current" ;; irix | nonstopux) if test "X$lt_irix_increment" = "Xno"; then func_arith $current - $age else func_arith $current - $age + 1 fi major=$func_arith_result case $version_type in nonstopux) verstring_prefix=nonstopux ;; *) verstring_prefix=sgi ;; esac verstring="$verstring_prefix$major.$revision" # Add in all the interfaces that we are compatible with. loop=$revision while test "$loop" -ne 0; do func_arith $revision - $loop iface=$func_arith_result func_arith $loop - 1 loop=$func_arith_result verstring="$verstring_prefix$major.$iface:$verstring" done # Before this point, $major must not contain `.'. major=.$major versuffix="$major.$revision" ;; linux) # correct to gnu/linux during the next big refactor func_arith $current - $age major=.$func_arith_result versuffix="$major.$age.$revision" ;; osf) func_arith $current - $age major=.$func_arith_result versuffix=".$current.$age.$revision" verstring="$current.$age.$revision" # Add in all the interfaces that we are compatible with. loop=$age while test "$loop" -ne 0; do func_arith $current - $loop iface=$func_arith_result func_arith $loop - 1 loop=$func_arith_result verstring="$verstring:${iface}.0" done # Make executables depend on our current version. func_append verstring ":${current}.0" ;; qnx) major=".$current" versuffix=".$current" ;; sunos) major=".$current" versuffix=".$current.$revision" ;; windows) # Use '-' rather than '.', since we only want one # extension on DOS 8.3 filesystems. func_arith $current - $age major=$func_arith_result versuffix="-$major" ;; *) func_fatal_configuration "unknown library version type \`$version_type'" ;; esac # Clear the version info if we defaulted, and they specified a release. if test -z "$vinfo" && test -n "$release"; then major= case $version_type in darwin) # we can't check for "0.0" in archive_cmds due to quoting # problems, so we reset it completely verstring= ;; *) verstring="0.0" ;; esac if test "$need_version" = no; then versuffix= else versuffix=".0.0" fi fi # Remove version info from name if versioning should be avoided if test "$avoid_version" = yes && test "$need_version" = no; then major= versuffix= verstring="" fi # Check to see if the archive will have undefined symbols. if test "$allow_undefined" = yes; then if test "$allow_undefined_flag" = unsupported; then func_warning "undefined symbols not allowed in $host shared libraries" build_libtool_libs=no build_old_libs=yes fi else # Don't allow undefined symbols. allow_undefined_flag="$no_undefined_flag" fi fi func_generate_dlsyms "$libname" "$libname" "yes" func_append libobjs " $symfileobj" test "X$libobjs" = "X " && libobjs= 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= tempremovelist=`$ECHO "$output_objdir/*"` for p in $tempremovelist; do case $p in *.$objext | *.gcno) ;; $output_objdir/$outputname | $output_objdir/$libname.* | $output_objdir/${libname}${release}.*) if test "X$precious_files_regex" != "X"; then if $ECHO "$p" | $EGREP -e "$precious_files_regex" >/dev/null 2>&1 then continue fi fi func_append removelist " $p" ;; *) ;; esac done test -n "$removelist" && \ func_show_eval "${RM}r \$removelist" fi # Now set the variables for building old libraries. if test "$build_old_libs" = yes && test "$build_libtool_libs" != convenience ; then func_append oldlibs " $output_objdir/$libname.$libext" # Transform .lo files to .o files. 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 "$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 func_replace_sysroot "$libdir" func_append temp_xrpath " -R$func_replace_sysroot_result" case "$finalize_rpath " in *" $libdir "*) ;; *) func_append finalize_rpath " $libdir" ;; esac done if test "$hardcode_into_libs" != yes || test "$build_old_libs" = yes; then dependency_libs="$temp_xrpath $dependency_libs" fi fi # Make sure dlfiles contains only unique files that won't be dlpreopened old_dlfiles="$dlfiles" dlfiles= for lib in $old_dlfiles; do case " $dlprefiles $dlfiles " in *" $lib "*) ;; *) func_append dlfiles " $lib" ;; esac done # Make sure dlprefiles contains only unique files old_dlprefiles="$dlprefiles" dlprefiles= for lib in $old_dlprefiles; do case "$dlprefiles " in *" $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* | *-*-haiku*) # these systems don't actually have a c library (as such)! ;; *-*-rhapsody* | *-*-darwin1.[012]) # Rhapsody C library is in the System framework func_append deplibs " System.ltframework" ;; *-*-netbsd*) # Don't link with libc until the a.out ld.so is fixed. ;; *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*) # Do not include libc due to us having libc/libc_r. ;; *-*-sco3.2v5* | *-*-sco5v6*) # Causes problems with __ctype ;; *-*-sysv4.2uw2* | *-*-sysv5* | *-*-unixware* | *-*-OpenUNIX*) # Compiler inserts libc in the correct place for threads to work ;; *) # Add libc to deplibs on all other systems if necessary. if test "$build_libtool_need_lc" = "yes"; then func_append deplibs " -lc" fi ;; esac fi # Transform deplibs into only deplibs that can be linked in shared. name_save=$name libname_save=$libname release_save=$release versuffix_save=$versuffix major_save=$major # I'm not sure if I'm treating the release correctly. I think # release should show up in the -l (ie -lgmp5) so we don't want to # add it in twice. Is that correct? release="" versuffix="" major="" newdeplibs= droppeddeps=no case $deplibs_check_method in pass_all) # Don't check for shared/static. Everything works. # This might be a little naive. We might want to check # whether the library exists or not. But this is on # osf3 & osf4 and I'm not really sure... Just # implementing what was already the behavior. newdeplibs=$deplibs ;; test_compile) # This code stresses the "libraries are programs" paradigm to its # limits. Maybe even breaks it. We compile a program, linking it # against the deplibs as a proxy for the library. Then we can check # whether they linked in statically or dynamically with ldd. $opt_dry_run || $RM conftest.c cat > conftest.c </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 | $GREP " -> " >/dev/null; then continue fi # The statement above tries to avoid entering an # endless loop below, in case of cyclic links. # We might still enter an endless loop, since a link # loop can be closed while we follow links, # but so what? potlib="$potent_lib" while test -h "$potlib" 2>/dev/null; do potliblink=`ls -ld $potlib | ${SED} 's/.* -> //'` case $potliblink in [\\/]* | [A-Za-z]:[\\/]*) potlib="$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 func_append newdeplibs " $a_deplib" a_deplib="" break 2 fi done done fi if test -n "$a_deplib" ; then droppeddeps=yes 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" if test -z "$potlib" ; then $ECHO "*** with $libname but no candidates were found. (...for file magic test)" else $ECHO "*** with $libname and none of the candidates passed a file format test" $ECHO "*** using a file magic. Last file checked: $potlib" fi fi ;; *) # Add a -L argument. func_append newdeplibs " $a_deplib" ;; esac done # Gone through all deplibs. ;; match_pattern*) set dummy $deplibs_check_method; shift match_pattern_regex=`expr "$deplibs_check_method" : "$1 \(.*\)"` for a_deplib in $deplibs; do case $a_deplib in -l*) func_stripname -l '' "$a_deplib" name=$func_stripname_result if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then case " $predeps $postdeps " in *" $a_deplib "*) func_append newdeplibs " $a_deplib" a_deplib="" ;; esac fi if test -n "$a_deplib" ; then libname=`eval "\\$ECHO \"$libname_spec\""` for i in $lib_search_path $sys_lib_search_path $shlib_search_path; do 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 \"$potent_lib\"" 2>/dev/null | $SED 10q | \ $EGREP "$match_pattern_regex" > /dev/null; then func_append newdeplibs " $a_deplib" a_deplib="" break 2 fi done done fi if test -n "$a_deplib" ; then droppeddeps=yes 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" if test -z "$potlib" ; then $ECHO "*** with $libname but no candidates were found. (...for regex pattern test)" else $ECHO "*** with $libname and none of the candidates passed a file format test" $ECHO "*** using a regex pattern. Last file checked: $potlib" fi fi ;; *) # Add a -L argument. func_append newdeplibs " $a_deplib" ;; esac done # Gone through all deplibs. ;; none | unknown | *) newdeplibs="" 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 " $tmp_deplibs" | $SED "s,$i,,"` done fi case $tmp_deplibs in *[!\ \ ]*) echo if test "X$deplibs_check_method" = "Xnone"; then echo "*** Warning: inter-library dependencies are not supported in this platform." else echo "*** Warning: inter-library dependencies are not known to be supported." fi echo "*** All declared inter-library dependencies are being dropped." droppeddeps=yes ;; esac ;; esac versuffix=$versuffix_save major=$major_save release=$release_save libname=$libname_save name=$name_save case $host in *-*-rhapsody* | *-*-darwin1.[012]) # On Rhapsody replace the C library with the System framework 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 "*** 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." 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." fi if test "$build_old_libs" = no; then oldlibs="$output_objdir/$libname.$libext" build_libtool_libs=module build_old_libs=yes else 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." 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." if test "$build_old_libs" = no; then oldlibs="$output_objdir/$libname.$libext" build_libtool_libs=module build_old_libs=yes else build_libtool_libs=no fi fi fi fi # Done checking deplibs! deplibs=$newdeplibs fi # Time to change all our "foo.ltframework" stuff back to "-framework foo" case $host in *-*-darwin*) 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 # move library search paths that coincide with paths to not yet # installed libraries to the beginning of the library search list new_libs= for path in $notinst_path; do case " $new_libs " in *" -L$path/$objdir "*) ;; *) case " $deplibs " in *" -L$path/$objdir "*) func_append new_libs " -L$path/$objdir" ;; esac ;; esac done for deplib in $deplibs; do case $deplib in -L*) case " $new_libs " in *" $deplib "*) ;; *) func_append new_libs " $deplib" ;; esac ;; *) func_append new_libs " $deplib" ;; esac done deplibs="$new_libs" # All the library-specific variables (install_libdir is set above). library_names= old_library= dlname= # 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 "$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 # Just accumulate the unique libdirs. case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*) ;; *) func_append hardcode_libdirs "$hardcode_libdir_separator$libdir" ;; esac fi else eval flag=\"$hardcode_libdir_flag_spec\" func_append dep_rpath " $flag" fi elif test -n "$runpath_var"; then case "$perm_rpath " in *" $libdir "*) ;; *) func_append perm_rpath " $libdir" ;; esac fi done # Substitute the hardcoded libdirs into the rpath. if test -n "$hardcode_libdir_separator" && test -n "$hardcode_libdirs"; then libdir="$hardcode_libdirs" 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 func_append rpath "$dir:" done eval "$runpath_var='$rpath\$$runpath_var'; export $runpath_var" fi test -n "$dep_rpath" && deplibs="$dep_rpath $deplibs" fi shlibpath="$finalize_shlibpath" test "$opt_mode" != relink && shlibpath="$compile_shlibpath$shlibpath" if test -n "$shlibpath"; then eval "$shlibpath_var='$shlibpath\$$shlibpath_var'; export $shlibpath_var" fi # Get the real and link names of the library. eval shared_ext=\"$shrext_cmds\" eval library_names=\"$library_names_spec\" set dummy $library_names shift realname="$1" shift if test -n "$soname_spec"; then eval soname=\"$soname_spec\" else soname="$realname" fi if test -z "$dlname"; then dlname=$soname fi lib="$output_objdir/$realname" linknames= for link do func_append linknames " $link" done # Use standard objects if they are pic 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" func_append delfiles " $export_symbols" fi orig_export_symbols= case $host_os in cygwin* | mingw* | cegcc*) if test -n "$export_symbols" && test -z "$export_symbols_regex"; then # exporting using user supplied symfile if test "x`$SED 1q $export_symbols`" != xEXPORTS; then # and it's NOT already a .def file. Must figure out # which of the given symbols are data symbols and tag # them as such. So, trigger use of export_symbols_cmds. # export_symbols gets reassigned inside the "prepare # the list of exported symbols" if statement, so the # include_expsyms logic still works. orig_export_symbols="$export_symbols" export_symbols= always_export_symbols=yes fi fi ;; esac # Prepare the list of exported symbols if test -z "$export_symbols"; then if test "$always_export_symbols" = yes || test -n "$export_symbols_regex"; then func_verbose "generating symbol list for \`$libname.la'" export_symbols="$output_objdir/$libname.exp" $opt_dry_run || $RM $export_symbols cmds=$export_symbols_cmds save_ifs="$IFS"; IFS='~' for cmd1 in $cmds; do IFS="$save_ifs" # 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. func_verbose "using reloadable object file for export list..." skipped_export=: # Break out early, otherwise skipped_export may be # set to false by a later but shorter cmd. break fi done IFS="$save_ifs" if test -n "$export_symbols_regex" && test "X$skipped_export" != "X:"; then func_show_eval '$EGREP -e "$export_symbols_regex" "$export_symbols" > "${export_symbols}T"' func_show_eval '$MV "${export_symbols}T" "$export_symbols"' fi fi fi 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 "$include_expsyms" | $SP2NL >> "$tmp_export_symbols"' fi if test "X$skipped_export" != "X:" && test -n "$orig_export_symbols"; then # The given exports_symbols file has to be filtered, so filter it. func_verbose "filter symbol list for \`$libname.la' to tag DATA exports" # FIXME: $output_objdir/$libname.filter potentially contains lots of # 's' commands which not all seds can handle. GNU sed should be fine # though. Also, the filter scales superlinearly with the number of # 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 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 tmp_deplibs= for test_deplib in $deplibs; do case " $convenience " in *" $test_deplib "*) ;; *) func_append tmp_deplibs " $test_deplib" ;; esac done deplibs="$tmp_deplibs" if test -n "$convenience"; then if test -n "$whole_archive_flag_spec" && test "$compiler_needs_object" = yes && test -z "$libobjs"; then # extract the archives, so we have objects to list. # TODO: could optimize this to just extract one archive. whole_archive_flag_spec= fi if test -n "$whole_archive_flag_spec"; then save_libobjs=$libobjs eval libobjs=\"\$libobjs $whole_archive_flag_spec\" test "X$libobjs" = "X " && libobjs= else gentop="$output_objdir/${outputname}x" func_append generated " $gentop" func_extract_archives $gentop $convenience 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\" func_append linker_flags " $flag" fi # Make a backup of the uninstalled library when relinking if test "$opt_mode" = relink; then $opt_dry_run || eval '(cd $output_objdir && $RM ${realname}U && $MV $realname ${realname}U)' || exit $? fi # Do each of the archive commands. if test "$module" = yes && test -n "$module_cmds" ; then if test -n "$export_symbols" && test -n "$module_expsym_cmds"; then eval test_cmds=\"$module_expsym_cmds\" cmds=$module_expsym_cmds else eval test_cmds=\"$module_cmds\" cmds=$module_cmds fi else if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then eval test_cmds=\"$archive_expsym_cmds\" cmds=$archive_expsym_cmds else eval test_cmds=\"$archive_cmds\" cmds=$archive_cmds fi fi if test "X$skipped_export" != "X:" && func_len " $test_cmds" && len=$func_len_result && test "$len" -lt "$max_cmd_len" || test "$max_cmd_len" -le -1; then : else # The command line is too long to link in one step, link piecewise # or, if using GNU ld and skipped_export is not :, use a linker # script. # Save the value of $output and $libobjs because we want to # use them later. If we have whole_archive_flag_spec, we # want to use save_libobjs as it was before # whole_archive_flag_spec was expanded, because we can't # assume the linker understands whole_archive_flag_spec. # This may have to be revisited, in case too many # convenience libraries get linked in and end up exceeding # the spec. if test -z "$convenience" || test -z "$whole_archive_flag_spec"; then save_libobjs=$libobjs fi save_output=$output func_basename "$output" output_la=$func_basename_result # Clear the reloadable object creation command queue and # initialize k to one. test_cmds= concat_cmds= objlist= last_robj= k=1 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 for obj in $save_libobjs do func_to_tool_file "$obj" $ECHO "$func_to_tool_file_result" >> $output done 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" : > $output set x $save_libobjs shift firstobj= if test "$compiler_needs_object" = yes; then firstobj="$1 " shift fi for obj do func_to_tool_file "$obj" $ECHO "$func_to_tool_file_result" >> $output done 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..." output=$output_objdir/$output_la-${k}.$objext eval test_cmds=\"$reload_cmds\" func_len " $test_cmds" len0=$func_len_result len=$len0 # Loop over the list of objects to be linked. for obj in $save_libobjs do func_len " $obj" func_arith $len + $func_len_result len=$func_arith_result if test "X$objlist" = X || test "$len" -lt "$max_cmd_len"; then func_append objlist " $obj" else # The command $test_cmds is almost too long, add a # command to the queue. if test "$k" -eq 1 ; then # The first file doesn't have a previous command to add. reload_objs=$objlist eval concat_cmds=\"$reload_cmds\" else # All subsequent reloadable object files will link in # the last one created. 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" func_len " $last_robj" func_arith $len0 + $func_len_result len=$func_arith_result fi done # Handle the remaining objects by creating one last # reloadable object file. All subsequent reloadable object # files will link in the last one created. test -z "$concat_cmds" || concat_cmds=$concat_cmds~ 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 func_append delfiles " $output" else output= fi if ${skipped_export-false}; then func_verbose "generating symbol list for \`$libname.la'" export_symbols="$output_objdir/$libname.exp" $opt_dry_run || $RM $export_symbols libobjs=$output # Append the command to create the export file. test -z "$concat_cmds" || concat_cmds=$concat_cmds~ eval concat_cmds=\"\$concat_cmds$export_symbols_cmds\" if test -n "$last_robj"; then eval concat_cmds=\"\$concat_cmds~\$RM $last_robj\" fi fi test -n "$save_libobjs" && func_verbose "creating a temporary reloadable object file: $output" # Loop through the commands generated above and execute them. save_ifs="$IFS"; IFS='~' for cmd in $concat_cmds; do IFS="$save_ifs" $opt_silent || { func_quote_for_expand "$cmd" eval "func_echo $func_quote_for_expand_result" } $opt_dry_run || eval "$cmd" || { lt_exit=$? # Restore the uninstalled library and exit if test "$opt_mode" = relink; then ( cd "$output_objdir" && \ $RM "${realname}T" && \ $MV "${realname}U" "$realname" ) fi exit $lt_exit } done IFS="$save_ifs" if test -n "$export_symbols_regex" && ${skipped_export-false}; then func_show_eval '$EGREP -e "$export_symbols_regex" "$export_symbols" > "${export_symbols}T"' func_show_eval '$MV "${export_symbols}T" "$export_symbols"' fi fi if ${skipped_export-false}; then 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 "$include_expsyms" | $SP2NL >> "$tmp_export_symbols"' fi if test -n "$orig_export_symbols"; then # The given exports_symbols file has to be filtered, so filter it. func_verbose "filter symbol list for \`$libname.la' to tag DATA exports" # FIXME: $output_objdir/$libname.filter potentially contains lots of # 's' commands which not all seds can handle. GNU sed should be fine # though. Also, the filter scales superlinearly with the number of # 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 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 fi libobjs=$output # Restore the value of output. output=$save_output if test -n "$convenience" && test -n "$whole_archive_flag_spec"; then eval libobjs=\"\$libobjs $whole_archive_flag_spec\" test "X$libobjs" = "X " && libobjs= fi # Expand the library linking commands again to reset the # value of $libobjs for piecewise linking. # Do each of the archive commands. if test "$module" = yes && test -n "$module_cmds" ; then if test -n "$export_symbols" && test -n "$module_expsym_cmds"; then cmds=$module_expsym_cmds else cmds=$module_cmds fi else if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then cmds=$archive_expsym_cmds else cmds=$archive_cmds fi fi fi if test -n "$delfiles"; then # Append the command to remove temporary files to $cmds. eval cmds=\"\$cmds~\$RM $delfiles\" fi # Add any objects from preloaded convenience libraries if test -n "$dlprefiles"; then gentop="$output_objdir/${outputname}x" func_append generated " $gentop" func_extract_archives $gentop $dlprefiles func_append libobjs " $func_extract_archives_result" test "X$libobjs" = "X " && libobjs= fi save_ifs="$IFS"; IFS='~' for cmd in $cmds; do IFS="$save_ifs" eval cmd=\"$cmd\" $opt_silent || { func_quote_for_expand "$cmd" eval "func_echo $func_quote_for_expand_result" } $opt_dry_run || eval "$cmd" || { lt_exit=$? # Restore the uninstalled library and exit if test "$opt_mode" = relink; then ( cd "$output_objdir" && \ $RM "${realname}T" && \ $MV "${realname}U" "$realname" ) fi exit $lt_exit } done IFS="$save_ifs" # Restore the uninstalled library and exit 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 if test -z "$whole_archive_flag_spec"; then func_show_eval '${RM}r "$gentop"' fi fi exit $EXIT_SUCCESS fi # Create links to the real library. for linkname in $linknames; do if test "$realname" != "$linkname"; then func_show_eval '(cd "$output_objdir" && $RM "$linkname" && $LN_S "$realname" "$linkname")' 'exit $?' fi done # If -module or -export-dynamic was specified, set the dlname. if test "$module" = yes || test "$export_dynamic" = yes; then # On all known operating systems, these are identical. dlname="$soname" fi fi ;; obj) if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then func_warning "\`-dlopen' is ignored for objects" fi case " $deplibs" in *\ -l* | *\ -L*) func_warning "\`-l' and \`-L' are ignored for objects" ;; esac test -n "$rpath" && \ func_warning "\`-rpath' is ignored for objects" test -n "$xrpath" && \ func_warning "\`-R' is ignored for objects" test -n "$vinfo" && \ func_warning "\`-version-info' is ignored for objects" test -n "$release" && \ func_warning "\`-release' is ignored for objects" case $output in *.lo) test -n "$objs$old_deplibs" && \ func_fatal_error "cannot build library object \`$output' from non-libtool objects" libobj=$output func_lo2o "$libobj" obj=$func_lo2o_result ;; *) libobj= obj="$output" ;; esac # Delete the old objects. $opt_dry_run || $RM $obj $libobj # Objects from convenience libraries. This assumes # single-version convenience libraries. Whenever we create # different ones for PIC/non-PIC, this we'll have to duplicate # the extraction. reload_conv_objs= gentop= # reload_cmds runs $LD directly, so let us get rid of # -Wl from whole_archive_flag_spec and hope we can get by with # turning comma into space.. wl= 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 "$tmp_whole_archive_flags" | $SED 's|,| |g'` else gentop="$output_objdir/${obj}x" 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 "$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 $?' # Exit if we aren't doing a library object file. if test -z "$libobj"; then if test -n "$gentop"; then func_show_eval '${RM}r "$gentop"' fi exit $EXIT_SUCCESS fi if test "$build_libtool_libs" != yes; then if test -n "$gentop"; then func_show_eval '${RM}r "$gentop"' fi # Create an invalid libtool object if no PIC, so that we don't # accidentally link it into a program. # $show "echo timestamp > $libobj" # $opt_dry_run || eval "echo timestamp > $libobj" || exit $? exit $EXIT_SUCCESS fi if test -n "$pic_flag" || test "$pic_mode" != default; then # Only do commands if we really have different PIC objects. reload_objs="$libobjs $reload_conv_objs" output="$libobj" func_execute_cmds "$reload_cmds" 'exit $?' fi if test -n "$gentop"; then func_show_eval '${RM}r "$gentop"' fi exit $EXIT_SUCCESS ;; prog) case $host in *cygwin*) func_stripname '' '.exe' "$output" output=$func_stripname_result.exe;; esac test -n "$vinfo" && \ func_warning "\`-version-info' is ignored for programs" test -n "$release" && \ func_warning "\`-release' is ignored for programs" test "$preload" = yes \ && test "$dlopen_support" = unknown \ && test "$dlopen_self" = unknown \ && test "$dlopen_self_static" = unknown && \ func_warning "\`LT_INIT([dlopen])' not used. Assuming no dlopen support." case $host in *-*-rhapsody* | *-*-darwin1.[012]) # On Rhapsody replace the C library is the System framework compile_deplibs=`$ECHO " $compile_deplibs" | $SED 's/ -lc / System.ltframework /'` finalize_deplibs=`$ECHO " $finalize_deplibs" | $SED 's/ -lc / System.ltframework /'` ;; esac case $host in *-*-darwin*) # Don't allow lazy linking, it breaks C++ global constructors # But is supposedly fixed on 10.4 or later (yay!). if test "$tagname" = CXX ; then case ${MACOSX_DEPLOYMENT_TARGET-10.0} in 10.[0123]) 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 " $compile_deplibs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` finalize_deplibs=`$ECHO " $finalize_deplibs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` ;; esac # move library search paths that coincide with paths to not yet # installed libraries to the beginning of the library search list new_libs= for path in $notinst_path; do case " $new_libs " in *" -L$path/$objdir "*) ;; *) case " $compile_deplibs " in *" -L$path/$objdir "*) func_append new_libs " -L$path/$objdir" ;; esac ;; esac done for deplib in $compile_deplibs; do case $deplib in -L*) case " $new_libs " in *" $deplib "*) ;; *) func_append new_libs " $deplib" ;; esac ;; *) func_append new_libs " $deplib" ;; esac done compile_deplibs="$new_libs" 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. for libdir in $rpath $xrpath; do # This is the magic to use -rpath. case "$finalize_rpath " in *" $libdir "*) ;; *) func_append finalize_rpath " $libdir" ;; esac done fi # Now hardcode the library paths rpath= hardcode_libdirs= for libdir in $compile_rpath $finalize_rpath; do if test -n "$hardcode_libdir_flag_spec"; then if test -n "$hardcode_libdir_separator"; then if test -z "$hardcode_libdirs"; then hardcode_libdirs="$libdir" else # Just accumulate the unique libdirs. case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*) ;; *) func_append hardcode_libdirs "$hardcode_libdir_separator$libdir" ;; esac fi else eval flag=\"$hardcode_libdir_flag_spec\" func_append rpath " $flag" fi elif test -n "$runpath_var"; then case "$perm_rpath " in *" $libdir "*) ;; *) func_append perm_rpath " $libdir" ;; esac fi case $host in *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-cegcc*) testbindir=`${ECHO} "$libdir" | ${SED} -e 's*/lib$*/bin*'` case :$dllsearchpath: in *":$libdir:"*) ;; ::) dllsearchpath=$libdir;; *) func_append dllsearchpath ":$libdir";; esac case :$dllsearchpath: in *":$testbindir:"*) ;; ::) dllsearchpath=$testbindir;; *) func_append dllsearchpath ":$testbindir";; esac ;; esac done # Substitute the hardcoded libdirs into the rpath. if test -n "$hardcode_libdir_separator" && test -n "$hardcode_libdirs"; then libdir="$hardcode_libdirs" eval rpath=\" $hardcode_libdir_flag_spec\" fi compile_rpath="$rpath" rpath= hardcode_libdirs= for libdir in $finalize_rpath; do if test -n "$hardcode_libdir_flag_spec"; then if test -n "$hardcode_libdir_separator"; then if test -z "$hardcode_libdirs"; then hardcode_libdirs="$libdir" else # Just accumulate the unique libdirs. case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*) ;; *) func_append hardcode_libdirs "$hardcode_libdir_separator$libdir" ;; esac fi else eval flag=\"$hardcode_libdir_flag_spec\" func_append rpath " $flag" fi elif test -n "$runpath_var"; then case "$finalize_perm_rpath " in *" $libdir "*) ;; *) func_append finalize_perm_rpath " $libdir" ;; esac fi done # Substitute the hardcoded libdirs into the rpath. if test -n "$hardcode_libdir_separator" && test -n "$hardcode_libdirs"; then libdir="$hardcode_libdirs" eval rpath=\" $hardcode_libdir_flag_spec\" fi finalize_rpath="$rpath" if test -n "$libobjs" && test "$build_old_libs" = yes; then # Transform all the library objects into standard objects. 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" # template prelinking step if test -n "$prelink_cmds"; then func_execute_cmds "$prelink_cmds" 'exit $?' fi 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 ;; *) if test "$need_relink" = no || test "$build_libtool_libs" != yes; then wrappers_required=no fi ;; esac if test "$wrappers_required" = no; then # Replace the output file specification. 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}"' fi exit $exit_status fi if test -n "$compile_shlibpath$finalize_shlibpath"; then compile_command="$shlibpath_var=\"$compile_shlibpath$finalize_shlibpath\$$shlibpath_var\" $compile_command" fi if test -n "$finalize_shlibpath"; then finalize_command="$shlibpath_var=\"$finalize_shlibpath\$$shlibpath_var\" $finalize_command" fi compile_var= finalize_var= if test -n "$runpath_var"; then if test -n "$perm_rpath"; then # We should set the runpath_var. rpath= for dir in $perm_rpath; do func_append rpath "$dir:" done compile_var="$runpath_var=\"$rpath\$$runpath_var\" " fi if test -n "$finalize_perm_rpath"; then # We should set the runpath_var. rpath= for dir in $finalize_perm_rpath; do func_append rpath "$dir:" done finalize_var="$runpath_var=\"$rpath\$$runpath_var\" " fi fi if test "$no_install" = yes; then # 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 "$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 if test "$hardcode_action" = relink; then # Fast installation is not supported link_command="$compile_var$compile_command$compile_rpath" relink_command="$finalize_var$finalize_command$finalize_rpath" func_warning "this platform does not like uninstalled shared libraries" func_warning "\`$output' will be relinked during installation" else if test "$fast_install" != no; then link_command="$finalize_var$compile_command$finalize_rpath" if test "$fast_install" = yes; then relink_command=`$ECHO "$compile_var$compile_command$compile_rpath" | $SED 's%@OUTPUT@%\$progdir/\$file%g'` else # fast_install is set to needless relink_command= fi else link_command="$compile_var$compile_command$compile_rpath" relink_command="$finalize_var$finalize_command$finalize_rpath" fi fi # Replace the output file specification. 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" # Quote the relink command for shipping. if test -n "$relink_command"; then # Preserve any variables that may affect compiler behavior for var in $variables_saved_for_relink; do if eval test -z \"\${$var+set}\"; then relink_command="{ test -z \"\${$var+set}\" || $lt_unset $var || { $var=; export $var; }; }; $relink_command" elif eval var_value=\$$var; test -z "$var_value"; then relink_command="$var=; export $var; $relink_command" else func_quote_for_eval "$var_value" relink_command="$var=$func_quote_for_eval_result; export $var; $relink_command" fi done relink_command="(cd `pwd`; $relink_command)" relink_command=`$ECHO "$relink_command" | $SED "$sed_quote_subst"` fi # Only actually do things if not in dry run mode. $opt_dry_run || { # win32 will think the script is a binary if it has # a .exe suffix, so we strip it off here. case $output in *.exe) func_stripname '' '.exe' "$output" output=$func_stripname_result ;; esac # test for cygwin because mv fails w/o .exe extensions case $host in *cygwin*) exeext=.exe func_stripname '' '.exe' "$outputname" outputname=$func_stripname_result ;; *) exeext= ;; esac case $host in *cygwin* | *mingw* ) func_dirname_and_basename "$output" "" "." output_name=$func_basename_result output_path=$func_dirname_result cwrappersource="$output_path/$objdir/lt-$output_name.c" cwrapper="$output_path/$output_name.exe" $RM $cwrappersource $cwrapper trap "$RM $cwrappersource $cwrapper; exit $EXIT_FAILURE" 1 2 15 func_emit_cwrapperexe_src > $cwrappersource # The wrapper executable is built using the $host compiler, # because it contains $host paths and files. If cross- # compiling, it, like the target executable, must be # executed on the $host or under an emulation environment. $opt_dry_run || { $LTCC $LTCFLAGS -o $cwrapper $cwrappersource $STRIP $cwrapper } # Now, create the wrapper script for func_source use: func_ltwrapper_scriptname $cwrapper $RM $func_ltwrapper_scriptname_result trap "$RM $func_ltwrapper_scriptname_result; exit $EXIT_FAILURE" 1 2 15 $opt_dry_run || { # note: this script will not be executed, so do not chmod. if test "x$build" = "x$host" ; then $cwrapper --lt-dump-script > $func_ltwrapper_scriptname_result else func_emit_wrapper no > $func_ltwrapper_scriptname_result fi } ;; * ) $RM $output trap "$RM $output; exit $EXIT_FAILURE" 1 2 15 func_emit_wrapper no > $output chmod +x $output ;; esac } exit $EXIT_SUCCESS ;; esac # See if we need to build an old-fashioned archive. for oldlib in $oldlibs; do if test "$build_libtool_libs" = convenience; then oldobjs="$libobjs_save $symfileobj" addlibs="$convenience" build_libtool_libs=no else if test "$build_libtool_libs" = module; then oldobjs="$libobjs_save" build_libtool_libs=no else oldobjs="$old_deplibs $non_pic_objects" if test "$preload" = yes && test -f "$symfileobj"; then func_append oldobjs " $symfileobj" fi fi addlibs="$old_convenience" fi if test -n "$addlibs"; then gentop="$output_objdir/${outputname}x" func_append generated " $gentop" func_extract_archives $gentop $addlibs func_append oldobjs " $func_extract_archives_result" fi # Do each command in the archive commands. if test -n "$old_archive_from_new_cmds" && test "$build_libtool_libs" = yes; then cmds=$old_archive_from_new_cmds else # Add any objects from preloaded convenience libraries if test -n "$dlprefiles"; then gentop="$output_objdir/${outputname}x" func_append generated " $gentop" func_extract_archives $gentop $dlprefiles func_append oldobjs " $func_extract_archives_result" fi # POSIX demands no paths to be encoded in archives. We have # to avoid creating archives with duplicate basenames if we # might have to extract them afterwards, e.g., when creating a # static archive out of a convenience library, or when linking # the entirety of a libtool archive into another (currently # not supported by libtool). if (for obj in $oldobjs do func_basename "$obj" $ECHO "$func_basename_result" done | sort | sort -uc >/dev/null 2>&1); then : else echo "copying selected object files to avoid basename conflicts..." gentop="$output_objdir/${outputname}x" func_append generated " $gentop" func_mkdir_p "$gentop" save_oldobjs=$oldobjs oldobjs= counter=1 for obj in $save_oldobjs do func_basename "$obj" objbase="$func_basename_result" case " $oldobjs " in " ") oldobjs=$obj ;; *[\ /]"$objbase "*) while :; do # Make sure we don't pick an alternate name that also # overlaps. newobj=lt$counter-$objbase func_arith $counter + 1 counter=$func_arith_result case " $oldobjs " in *[\ /]"$newobj "*) ;; *) if test ! -f "$gentop/$newobj"; then break; fi ;; esac done func_show_eval "ln $obj $gentop/$newobj || cp $obj $gentop/$newobj" func_append oldobjs " $gentop/$newobj" ;; *) 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..." save_RANLIB=$RANLIB RANLIB=: objlist= concat_cmds= save_oldobjs=$oldobjs oldobjs= # Is there a better way of finding the last object in the list? for obj in $save_oldobjs do last_oldobj=$obj done eval test_cmds=\"$old_archive_cmds\" func_len " $test_cmds" len0=$func_len_result len=$len0 for obj in $save_oldobjs do func_len " $obj" func_arith $len + $func_len_result len=$func_arith_result func_append objlist " $obj" if test "$len" -lt "$max_cmd_len"; then : else # the above command should be used before it gets too long oldobjs=$objlist if test "$obj" = "$last_oldobj" ; then RANLIB=$save_RANLIB fi test -z "$concat_cmds" || concat_cmds=$concat_cmds~ eval concat_cmds=\"\${concat_cmds}$old_archive_cmds\" objlist= len=$len0 fi done RANLIB=$save_RANLIB oldobjs=$objlist if test "X$oldobjs" = "X" ; then eval cmds=\"\$concat_cmds\" else eval cmds=\"\$concat_cmds~\$old_archive_cmds\" fi fi fi func_execute_cmds "$cmds" 'exit $?' done test -n "$generated" && \ func_show_eval "${RM}r$generated" # Now create the libtool archive. case $output in *.la) old_library= test "$build_old_libs" = yes && old_library="$libname.$libext" func_verbose "creating $output" # Preserve any variables that may affect compiler behavior for var in $variables_saved_for_relink; do if eval test -z \"\${$var+set}\"; then relink_command="{ test -z \"\${$var+set}\" || $lt_unset $var || { $var=; export $var; }; }; $relink_command" elif eval var_value=\$$var; test -z "$var_value"; then relink_command="$var=; export $var; $relink_command" else func_quote_for_eval "$var_value" relink_command="$var=$func_quote_for_eval_result; export $var; $relink_command" fi 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 "$relink_command" | $SED "$sed_quote_subst"` if test "$hardcode_automatic" = yes ; then relink_command= fi # Only create the output if not a dry run. $opt_dry_run || { for installed in no yes; do if test "$installed" = yes; then if test -z "$install_libdir"; then break fi output="$output_objdir/$outputname"i # Replace all uninstalled libtool libraries with the installed ones newdependency_libs= for deplib in $dependency_libs; do case $deplib in *.la) func_basename "$deplib" name="$func_basename_result" 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" 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" ;; -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" newdlfiles= for lib in $dlfiles; do case $lib in *.la) func_basename "$lib" name="$func_basename_result" eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $lib` test -z "$libdir" && \ func_fatal_error "\`$lib' is not a valid libtool archive" func_append newdlfiles " ${lt_sysroot:+=}$libdir/$name" ;; *) func_append newdlfiles " $lib" ;; esac done dlfiles="$newdlfiles" newdlprefiles= for lib in $dlprefiles; do case $lib in *.la) # Only pass preopened files to the pseudo-archive (for # eventual linking with the app. that links it) if we # didn't already link the preopened objects directly into # the library: func_basename "$lib" name="$func_basename_result" eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $lib` test -z "$libdir" && \ func_fatal_error "\`$lib' is not a valid libtool archive" func_append newdlprefiles " ${lt_sysroot:+=}$libdir/$name" ;; esac done dlprefiles="$newdlprefiles" else newdlfiles= for lib in $dlfiles; do case $lib in [\\/]* | [A-Za-z]:[\\/]*) abs="$lib" ;; *) abs=`pwd`"/$lib" ;; esac func_append newdlfiles " $abs" done dlfiles="$newdlfiles" newdlprefiles= for lib in $dlprefiles; do case $lib in [\\/]* | [A-Za-z]:[\\/]*) abs="$lib" ;; *) abs=`pwd`"/$lib" ;; esac 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) # 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 # Generated by $PROGRAM (GNU $PACKAGE$TIMESTAMP) $VERSION # # Please DO NOT delete this file! # It is necessary for linking the library. # The name that we can dlopen(3). dlname='$tdlname' # Names of this library. library_names='$library_names' # The name of the static archive. old_library='$old_library' # Linker flags that can not go in dependency_libs. inherited_linker_flags='$new_inherited_linker_flags' # Libraries that this one depends upon. dependency_libs='$dependency_libs' # Names of additional weak libraries provided by this library weak_library_names='$weak_libs' # Version information for $libname. current=$current age=$age revision=$revision # Is this an already installed library? installed=$installed # Should we warn about portability when linking against -modules? shouldnotlink=$module # Files to dlopen/dlpreopen dlopen='$dlfiles' dlpreopen='$dlprefiles' # Directory that this library needs to be installed in: libdir='$install_libdir'" if test "$installed" = no && test "$need_relink" = yes; then $ECHO >> $output "\ relink_command=\"$relink_command\"" fi done } # Do a symbolic link so that the libtool archive can be found in # LD_LIBRARY_PATH before the program is installed. func_show_eval '( cd "$output_objdir" && $RM "$outputname" && $LN_S "../$outputname" "$outputname" )' 'exit $?' ;; esac exit $EXIT_SUCCESS } { test "$opt_mode" = link || test "$opt_mode" = relink; } && func_mode_link ${1+"$@"} # func_mode_uninstall arg... func_mode_uninstall () { $opt_debug RM="$nonopt" files= rmforce= exit_status=0 # This variable tells wrapper scripts just to set variables rather # than running their programs. libtool_install_magic="$magic" for arg do case $arg in -f) func_append RM " $arg"; rmforce=yes ;; -*) func_append RM " $arg" ;; *) func_append files " $arg" ;; esac done test -z "$RM" && \ func_fatal_help "you must specify an RM program" rmdirs= for file in $files; do func_dirname "$file" "" "." dir="$func_dirname_result" if test "X$dir" = X.; then odir="$objdir" else odir="$dir/$objdir" fi func_basename "$file" name="$func_basename_result" test "$opt_mode" = uninstall && odir="$dir" # Remember odir for removal later, being careful to avoid duplicates if test "$opt_mode" = clean; then case " $rmdirs " in *" $odir "*) ;; *) func_append rmdirs " $odir" ;; esac fi # Don't error if the file doesn't exist and rm -f was used. if { test -L "$file"; } >/dev/null 2>&1 || { test -h "$file"; } >/dev/null 2>&1 || test -f "$file"; then : elif test -d "$file"; then exit_status=1 continue elif test "$rmforce" = yes; then continue fi rmfiles="$file" case $name in *.la) # Possibly a libtool archive, so verify it. if func_lalib_p "$file"; then func_source $dir/$name # Delete the libtool libraries and symlinks. for n in $library_names; do func_append rmfiles " $odir/$n" done test -n "$old_library" && func_append rmfiles " $odir/$old_library" case "$opt_mode" in clean) case " $library_names " in *" $dlname "*) ;; *) test -n "$dlname" && func_append rmfiles " $odir/$dlname" ;; esac test -n "$libdir" && func_append rmfiles " $odir/$name $odir/${name}i" ;; uninstall) if test -n "$library_names"; then # Do each command in the postuninstall commands. func_execute_cmds "$postuninstall_cmds" 'test "$rmforce" = yes || exit_status=1' fi if test -n "$old_library"; then # Do each command in the old_postuninstall commands. func_execute_cmds "$old_postuninstall_cmds" 'test "$rmforce" = yes || exit_status=1' fi # FIXME: should reinstall the best remaining shared library. ;; esac fi ;; *.lo) # Possibly a libtool object, so verify it. if func_lalib_p "$file"; then # Read the .lo file func_source $dir/$name # Add PIC object to the list of files to remove. if test -n "$pic_object" && test "$pic_object" != none; then 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 func_append rmfiles " $dir/$non_pic_object" fi fi ;; *) if test "$opt_mode" = clean ; then noexename=$name case $file in *.exe) func_stripname '' '.exe' "$file" file=$func_stripname_result func_stripname '' '.exe' "$name" noexename=$func_stripname_result # $file with .exe has already been added to rmfiles, # add $file without .exe func_append rmfiles " $file" ;; esac # Do a test to see if this is a libtool program. if func_ltwrapper_p "$file"; then if func_ltwrapper_executable_p "$file"; then func_ltwrapper_scriptname "$file" relink_command= func_source $func_ltwrapper_scriptname_result func_append rmfiles " $func_ltwrapper_scriptname_result" else relink_command= func_source $dir/$noexename fi # note $name still contains .exe if it was in $file originally # as does the version of $file that was added into $rmfiles func_append rmfiles " $odir/$name $odir/${name}S.${objext}" if test "$fast_install" = yes && test -n "$relink_command"; then func_append rmfiles " $odir/lt-$name" fi if test "X$noexename" != "X$name" ; then func_append rmfiles " $odir/lt-${noexename}.c" fi fi fi ;; esac func_show_eval "$RM $rmfiles" 'exit_status=1' done # Try to remove the ${objdir}s in the directories where we deleted files for dir in $rmdirs; do if test -d "$dir"; then func_show_eval "rmdir $dir >/dev/null 2>&1" fi done exit $exit_status } { test "$opt_mode" = uninstall || test "$opt_mode" = clean; } && func_mode_uninstall ${1+"$@"} 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 \`$opt_mode'" if test -n "$exec_cmd"; then eval exec "$exec_cmd" exit $EXIT_FAILURE fi exit $exit_status # The TAGs below are defined such that we never get into a situation # in which we disable both kinds of libraries. Given conflicting # choices, we go for a static library, that is the most portable, # since we can't tell whether shared libraries were disabled because # the user asked for that or because the platform doesn't support # them. This is particularly important on AIX, because we don't # support having both static and shared libraries enabled at the same # time on that platform, so we default to a shared-only configuration. # If a disable-shared tag is given, we'll fallback to a static-only # configuration. But we'll never go from static-only to shared-only. # ### BEGIN LIBTOOL TAG CONFIG: disable-shared build_libtool_libs=no build_old_libs=yes # ### END LIBTOOL TAG CONFIG: disable-shared # ### BEGIN LIBTOOL TAG CONFIG: disable-static build_old_libs=`case $build_libtool_libs in yes) echo no;; *) echo yes;; esac` # ### END LIBTOOL TAG CONFIG: disable-static # Local Variables: # mode:shell-script # sh-indentation:2 # End: # vi:sw=2 tango-8.1.2c+dfsg.orig/lib/cpp/log4tango/config/mkinstalldirs0000755000175000017500000000653512205375130023103 0ustar piccapicca#! /bin/sh # mkinstalldirs --- make directory hierarchy scriptversion=2004-02-15.20 # Original author: Noah Friedman # Created: 1993-05-16 # Public domain. # # This file is maintained in Automake, please report # bugs to or send patches to # . errstatus=0 dirmode="" usage="\ Usage: mkinstalldirs [-h] [--help] [--version] [-m MODE] DIR ... Create each directory DIR (with mode MODE, if specified), including all leading file name components. Report bugs to ." # process command line arguments while test $# -gt 0 ; do case $1 in -h | --help | --h*) # -h for help echo "$usage" exit 0 ;; -m) # -m PERM arg shift test $# -eq 0 && { echo "$usage" 1>&2; exit 1; } dirmode=$1 shift ;; --version) echo "$0 $scriptversion" exit 0 ;; --) # stop option processing shift break ;; -*) # unknown option echo "$usage" 1>&2 exit 1 ;; *) # first non-opt arg break ;; esac done for file do if test -d "$file"; then shift else break fi done case $# in 0) exit 0 ;; esac # Solaris 8's mkdir -p isn't thread-safe. If you mkdir -p a/b and # mkdir -p a/c at the same time, both will detect that a is missing, # one will create a, then the other will try to create a and die with # a "File exists" error. This is a problem when calling mkinstalldirs # from a parallel make. We use --version in the probe to restrict # ourselves to GNU mkdir, which is thread-safe. case $dirmode in '') if mkdir -p --version . >/dev/null 2>&1 && test ! -d ./--version; then echo "mkdir -p -- $*" exec mkdir -p -- "$@" else # On NextStep and OpenStep, the `mkdir' command does not # recognize any option. It will interpret all options as # directories to create, and then abort because `.' already # exists. test -d ./-p && rmdir ./-p test -d ./--version && rmdir ./--version fi ;; *) if mkdir -m "$dirmode" -p --version . >/dev/null 2>&1 && test ! -d ./--version; then echo "mkdir -m $dirmode -p -- $*" exec mkdir -m "$dirmode" -p -- "$@" else # Clean up after NextStep and OpenStep mkdir. for d in ./-m ./-p ./--version "./$dirmode"; do test -d $d && rmdir $d done fi ;; esac for file do set fnord `echo ":$file" | sed -ne 's/^:\//#/;s/^://;s/\// /g;s/^#/\//;p'` shift pathcomp= for d do pathcomp="$pathcomp$d" case $pathcomp in -*) pathcomp=./$pathcomp ;; esac if test ! -d "$pathcomp"; then echo "mkdir $pathcomp" mkdir "$pathcomp" || lasterr=$? if test ! -d "$pathcomp"; then errstatus=$lasterr else if test ! -z "$dirmode"; then echo "chmod $dirmode $pathcomp" lasterr="" chmod "$dirmode" "$pathcomp" || lasterr=$? if test ! -z "$lasterr"; then errstatus=$lasterr fi fi fi fi pathcomp="$pathcomp/" done done exit $errstatus # Local Variables: # mode: shell-script # sh-indentation: 2 # eval: (add-hook 'write-file-hooks 'time-stamp) # time-stamp-start: "scriptversion=" # time-stamp-format: "%:y-%02m-%02d.%02H" # time-stamp-end: "$" # End: tango-8.1.2c+dfsg.orig/lib/cpp/log4tango/config/missing0000755000175000017500000002453312205375130021672 0ustar piccapicca#! /bin/sh # Common stub for a few missing GNU programs while installing. scriptversion=2004-09-07.08 # Copyright (C) 1996, 1997, 1999, 2000, 2002, 2003, 2004 # Free Software Foundation, Inc. # Originally by Fran,cois Pinard , 1996. # 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., 59 Temple Place - Suite 330, Boston, MA # 02111-1307, USA. # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that program. if test $# -eq 0; then echo 1>&2 "Try \`$0 --help' for more information" exit 1 fi run=: # In the cases where this matters, `missing' is being run in the # srcdir already. if test -f configure.ac; then configure_ac=configure.ac else configure_ac=configure.in fi msg="missing on your system" case "$1" in --run) # Try to run requested program, and just exit if it succeeds. run= shift "$@" && exit 0 # Exit code 63 means version mismatch. This often happens # when the user try to use an ancient version of a tool on # a file that requires a minimum version. In this case we # we should proceed has if the program had been absent, or # if --run hadn't been passed. if test $? = 63; then run=: msg="probably too old" fi ;; -h|--h|--he|--hel|--help) echo "\ $0 [OPTION]... PROGRAM [ARGUMENT]... Handle \`PROGRAM [ARGUMENT]...' for when PROGRAM is missing, or return an error status if there is no known handling for PROGRAM. Options: -h, --help display this help and exit -v, --version output version information and exit --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' 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 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] Send bug reports to ." exit 0 ;; -v|--v|--ve|--ver|--vers|--versi|--versio|--version) echo "missing $scriptversion (GNU Automake)" exit 0 ;; -*) echo 1>&2 "$0: Unknown \`$1' option" echo 1>&2 "Try \`$0 --help' for more information" exit 1 ;; esac # Now exit if we have it, but it failed. Also exit now if we # don't have it and --version was passed (most likely to detect # the program). case "$1" in lex|yacc) # 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 # $TOOL exists and not knowing $TOOL uses missing. exit 1 fi ;; esac # If it does not exist, or fails to run (possibly an outdated version), # try to emulate it. case "$1" 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 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 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 from any GNU archive site." files=`sed -n 's/^[ ]*A[CM]_CONFIG_HEADER(\([^)]*\)).*/\1/p' ${configure_ac}` test -z "$files" && files="config.h" touch_files= for f in $files; do case "$f" in *:*) touch_files="$touch_files "`echo "$f" | sed -e 's/^[^:]*://' -e 's/:.*//'`;; *) touch_files="$touch_files $f.in";; esac done touch $touch_files ;; 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. Grab them from any GNU archive site." find . -type f -name Makefile.am -print | sed 's/\.am$/.in/' | while read f; do touch "$f"; done ;; autom4te) echo 1>&2 "\ 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 archive site." file=`echo "$*" | sed -n 's/.*--output[ =]*\([^ ]*\).*/\1/p'` test -z "$file" && file=`echo "$*" | sed -n 's/.*-o[ ]*\([^ ]*\).*/\1/p'` if test -f "$file"; then touch $file else test -z "$file" || exec >$file echo "#! /bin/sh" echo "# Created by GNU Automake missing as a replacement of" echo "# $ $@" echo "exit 0" chmod +x $file exit 1 fi ;; 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 in order for those modifications to take effect. You can get \`Bison' from any GNU archive site." rm -f y.tab.c y.tab.h if [ $# -ne 1 ]; then eval LASTARG="\${$#}" case "$LASTARG" in *.y) SRCFILE=`echo "$LASTARG" | sed 's/y$/c/'` if [ -f "$SRCFILE" ]; then cp "$SRCFILE" y.tab.c fi SRCFILE=`echo "$LASTARG" | sed 's/y$/h/'` if [ -f "$SRCFILE" ]; then cp "$SRCFILE" y.tab.h fi ;; esac fi if [ ! -f y.tab.h ]; then echo >y.tab.h fi if [ ! -f y.tab.c ]; then echo 'main() { return 0; }' >y.tab.c fi ;; 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 in order for those modifications to take effect. You can get \`Flex' from any GNU archive site." rm -f lex.yy.c if [ $# -ne 1 ]; then eval LASTARG="\${$#}" case "$LASTARG" in *.l) SRCFILE=`echo "$LASTARG" | sed 's/l$/c/'` if [ -f "$SRCFILE" ]; then cp "$SRCFILE" lex.yy.c fi ;; esac fi if [ ! -f lex.yy.c ]; then echo 'main() { return 0; }' >lex.yy.c fi ;; help2man) echo 1>&2 "\ 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." file=`echo "$*" | sed -n 's/.*-o \([^ ]*\).*/\1/p'` if test -z "$file"; then file=`echo "$*" | sed -n 's/.*--output=\([^ ]*\).*/\1/p'` fi if [ -f "$file" ]; then touch $file else test -z "$file" || exec >$file echo ".ab help2man is required to generate this page" exit 1 fi ;; 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 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." file=`echo "$*" | sed -n 's/.*-o \([^ ]*\).*/\1/p'` if test -z "$file"; then file=`echo "$*" | sed 's/.* \([^ ]*\) *$/\1/'` file=`sed -n '/^@setfilename/ { s/.* \([^ ]*\) *$/\1/; p; q; }' $file` fi 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. You might have modified some files without having the 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." exit 1 ;; esac exit 0 # Local variables: # eval: (add-hook 'write-file-hooks 'time-stamp) # time-stamp-start: "scriptversion=" # time-stamp-format: "%:y-%02m-%02d.%02H" # time-stamp-end: "$" # End: tango-8.1.2c+dfsg.orig/lib/cpp/log4tango/config/Makefile.am0000755000175000017500000000000212205375130022313 0ustar piccapicca tango-8.1.2c+dfsg.orig/lib/cpp/log4tango/m4/0000755000175000017500000000000012205375305017343 5ustar piccapiccatango-8.1.2c+dfsg.orig/lib/cpp/log4tango/m4/CREATE_GENERIC_CONFIG.m40000755000175000017500000001543312205375127022744 0ustar piccapiccadnl @synopsis AC_CREATE_GENERIC_CONFIG [(PACKAGEnlibs [, VERSION])] dnl dnl Creates a generic PACKAGE-config file that has all the dnl things that you want, hmm, well, atleast it has dnl --cflags, --version, --libs. Ahhm, did you see ac_path_generic dnl in the autoconf-archive? ;-) dnl dnl this macros saves you all the typing for a pkg-config.in script, dnl you don't even need to distribute one along. Place this macro dnl in your configure.ac, et voila, you got one that you want to install. dnl dnl oh, btw, if the first arg looks like "mylib -lwhat' then it dnl will go to be added to the --libs, and mylib is extracted. dnl dnl the defaults: $1 = $PACKAGE_TARNAME $LIBS $2 = $VERSION dnl there is also an AC_SUBST(GENERIC_CONFIG) that will be set to dnl the name of the file that we did output in this macro. Use as: dnl dnl install-exec-local: install-generic-config dnl install-generic-config: dnl $(mkinstalldirs) $(DESTDIR)$(bindir) dnl $(INSTALL_SCRIPT) @GENERIC_CONFIG@ $(DESTDIR)$(bindir) dnl dnl @version $Id: CREATE_GENERIC_CONFIG.m4 9222 2003-03-11 17:21:15Z nleclercq $ dnl @author Guido Draheim AC_DEFUN([AC_CREATE_GENERIC_CONFIG],[# create a generic PACKAGE-config file L=`echo ifelse($1, , $PACKAGE_TARNAME $LIBS, $1)` P=`echo $L | sed -e 's/ -.*//'` P=`echo $P` V=`echo ifelse($1, , $VERSION, $1)` F=`echo $P-config` AC_MSG_RESULT(creating $F - generic $V of $L) test "x$prefix" = xNONE && prefix="$ac_default_prefix" test "x$exec_prefix" = xNONE && exec_prefix='${prefix}' echo '#! /bin/sh' >$F echo ' ' >>$F echo 'package="'$P'"' >>$F echo 'version="'$V'"' >>$F echo 'libs="'$L'"' >>$F echo ' ' >>$F # in the order of occurence a standard automake Makefile echo 'prefix="'$prefix'"' >>$F echo 'exec_prefix="'$exec_prefix'"' >>$F echo 'bindir="'$bindir'"' >>$F echo 'sbindir="'$sbindir'"' >>$F echo 'libexecdir="'$libexecdir'"' >>$F echo 'datadir="'$datadir'"' >>$F echo 'sysconfdir="'$sysconfdir'"' >>$F echo 'sharedstatedir="'$sharedstatedir'"' >>$F echo 'localstatedir="'$localstatedir'"' >>$F echo 'libdir="'$libdir'"' >>$F echo 'infodir="'$infodir'"' >>$F echo 'mandir="'$mandir'"' >>$F echo 'includedir="'$includedir'"' >>$F echo 'target="'$target'"' >>$F echo 'host="'$host'"' >>$F echo 'build="'$build'"' >>$F echo ' ' >>$F echo 'if test "'"\$""#"'" -eq 0; then' >>$F echo ' cat <>$F echo 'Usage: $package-config [OPTIONS]' >>$F echo 'Options:' >>$F echo ' --prefix[=DIR]) : \$prefix' >>$F echo ' --package) : \$package' >>$F echo ' --version) : \$version' >>$F echo ' --cflags) : -I\$includedir' >>$F echo ' --libs) : -L\$libdir -l\$package' >>$F echo ' --help) print all the options (not just these)' >>$F echo 'EOF' >>$F echo 'fi' >>$F echo ' ' >>$F echo 'o=""' >>$F echo 'h=""' >>$F echo 'for i in '"\$""*"' ; do' >>$F echo ' case $i in' >>$F echo ' --prefix=*) prefix=`echo $i | sed -e "s/--prefix=//"` ;;' >>$F echo ' --prefix) o="$o $prefix" ;;' >>$F echo ' --package) o="$o $package" ;;' >>$F echo ' --version) o="$o $version" ;;' >>$F echo ' --cflags) if test "_$includedir" != "_/usr/include"' >>$F echo ' then o="$o -I$includedir" ; fi' >>$F echo ' ;;' >>$F echo ' --libs) o="$o -L$libdir -l$libs" ;;' >>$F echo ' --exec_prefix|--eprefix) o="$o $exec_prefix" ;;' >>$F echo ' --bindir) o="$o $bindir" ;;' >>$F echo ' --sbindir) o="$o $sbindir" ;;' >>$F echo ' --libexecdir) o="$o $libexecdir" ;;' >>$F echo ' --datadir) o="$o $datadir" ;;' >>$F echo ' --datainc) o="$o -I$datadir" ;;' >>$F echo ' --datalib) o="$o -L$datadir" ;;' >>$F echo ' --sysconfdir) o="$o $sysconfdir" ;;' >>$F echo ' --sharedstatedir) o="$o $sharedstatedir" ;;' >>$F echo ' --localstatedir) o="$o $localstatedir" ;;' >>$F echo ' --libdir) o="$o $libdir" ;;' >>$F echo ' --libadd) o="$o -L$libdir" ;;' >>$F echo ' --infodir) o="$o $infodir" ;;' >>$F echo ' --mandir) o="$o $mandir" ;;' >>$F echo ' --target) o="$o $target" ;;' >>$F echo ' --host) o="$o $host" ;;' >>$F echo ' --build) o="$o $build" ;;' >>$F echo ' --data) o="$o -I$datadir/$package" ;;' >>$F echo ' --pkgdatadir) o="$o $datadir/$package" ;;' >>$F echo ' --pkgdatainc) o="$o -I$datadir/$package" ;;' >>$F echo ' --pkgdatalib) o="$o -L$datadir/$package" ;;' >>$F echo ' --pkglibdir) o="$o $libdir/$package" ;;' >>$F echo ' --pkglibinc) o="$o -I$libinc/$package" ;;' >>$F echo ' --pkglibadd) o="$o -L$libadd/$package" ;;' >>$F echo ' --pkgincludedir) o="$o $includedir/$package" ;;' >>$F echo ' --help) h="1" ;;' >>$F echo ' -?//*|-?/*//*|-?./*//*|//*|/*//*|./*//*) ' >>$F echo ' v=`echo $i | sed -e s://:\$:g`' >>$F echo ' v=`eval "echo $v"` ' >>$F echo ' o="$o $v" ;; ' >>$F echo ' esac' >>$F echo 'done' >>$F echo ' ' >>$F echo 'o=`eval "echo $o"`' >>$F echo 'o=`eval "echo $o"`' >>$F echo 'eval "echo $o"' >>$F echo ' ' >>$F echo 'if test ! -z "$h" ; then ' >>$F echo 'cat <>$F echo ' --prefix=xxx) (what is that for anyway?)' >>$F echo ' --prefix) \$prefix $prefix' >>$F echo ' --package) \$package $package' >>$F echo ' --version) \$version $version' >>$F echo ' --cflags) -I\$includedir unless it is /usr/include' >>$F echo ' --libs) -L\$libdir -l\$PACKAGE_TARNAME \$LIBS' >>$F echo ' --exec_prefix) or... ' >>$F echo ' --eprefix) \$exec_prefix $exec_prefix' >>$F echo ' --bindir) \$bindir $bindir' >>$F echo ' --sbindir) \$sbindir $sbindir' >>$F echo ' --libexecdir) \$libexecdir $libexecdir' >>$F echo ' --datadir) \$datadir $datadir' >>$F echo ' --sysconfdir) \$sysconfdir $sysconfdir' >>$F echo ' --sharedstatedir) \$sharedstatedir$sharedstatedir' >>$F echo ' --localstatedir) \$localstatedir $localstatedir' >>$F echo ' --libdir) \$libdir $libdir' >>$F echo ' --infodir) \$infodir $infodir' >>$F echo ' --mandir) \$mandir $mandir' >>$F echo ' --target) \$target $target' >>$F echo ' --host) \$host $host' >>$F echo ' --build) \$build $build' >>$F echo ' --data) -I\$datadir/\$package' >>$F echo ' --pkgdatadir) \$datadir/\$package' >>$F echo ' --pkglibdir) \$libdir/\$package' >>$F echo ' --pkgincludedir) \$includedir/\$package' >>$F echo ' --help) generated by ac_create_generic_config.m4' >>$F echo ' -I//varname and other inc-targets like --pkgdatainc supported' >>$F echo ' -L//varname and other lib-targets, e.g. --pkgdatalib or --libadd' >>$F echo 'EOF' >>$F echo 'fi' >>$F GENERIC_CONFIG="$F" AC_SUBST(GENERIC_CONFIG) ]) tango-8.1.2c+dfsg.orig/lib/cpp/log4tango/m4/AC_CXX_HAVE_SSTREAM.m40000755000175000017500000000132512205375127022621 0ustar piccapiccadnl @synopsis AC_CXX_HAVE_SSTREAM dnl dnl If the C++ library has a working stringstream, define HAVE_SSTREAM. dnl dnl @author Ben Stanley dnl @version $Id: AC_CXX_HAVE_SSTREAM.m4 9222 2003-03-11 17:21:15Z nleclercq $ dnl AC_DEFUN([AC_CXX_HAVE_SSTREAM], [AC_CACHE_CHECK(whether the compiler has stringstream, ac_cv_cxx_have_sstream, [AC_REQUIRE([AC_CXX_NAMESPACES]) AC_LANG_PUSH(C++) AC_TRY_COMPILE([#include #ifdef HAVE_NAMESPACES using namespace std; #endif],[stringstream message; message << "Hello"; return 0;], ac_cv_cxx_have_sstream=yes, ac_cv_cxx_have_sstream=no) AC_LANG_POP(C++) ]) if test "$ac_cv_cxx_have_sstream" = yes; then AC_DEFINE(HAVE_SSTREAM,,[define if the compiler has stringstream]) fi ]) tango-8.1.2c+dfsg.orig/lib/cpp/log4tango/m4/ltoptions.m40000644000175000017500000003007312205375127021645 0ustar piccapicca# Helper functions for option handling. -*- Autoconf -*- # # 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 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])]) # _LT_MANGLE_OPTION(MACRO-NAME, OPTION-NAME) # ------------------------------------------ m4_define([_LT_MANGLE_OPTION], [[_LT_OPTION_]m4_bpatsubst($1__$2, [[^a-zA-Z0-9_]], [_])]) # _LT_SET_OPTION(MACRO-NAME, OPTION-NAME) # --------------------------------------- # Set option OPTION-NAME for macro MACRO-NAME, and if there is a # matching handler defined, dispatch to it. Other OPTION-NAMEs are # saved as a flag. m4_define([_LT_SET_OPTION], [m4_define(_LT_MANGLE_OPTION([$1], [$2]))dnl m4_ifdef(_LT_MANGLE_DEFUN([$1], [$2]), _LT_MANGLE_DEFUN([$1], [$2]), [m4_warning([Unknown $1 option `$2'])])[]dnl ]) # _LT_IF_OPTION(MACRO-NAME, OPTION-NAME, IF-SET, [IF-NOT-SET]) # ------------------------------------------------------------ # Execute IF-SET if OPTION is set, IF-NOT-SET otherwise. m4_define([_LT_IF_OPTION], [m4_ifdef(_LT_MANGLE_OPTION([$1], [$2]), [$3], [$4])]) # _LT_UNLESS_OPTIONS(MACRO-NAME, OPTION-LIST, IF-NOT-SET) # ------------------------------------------------------- # Execute IF-NOT-SET unless all options in OPTION-LIST for MACRO-NAME # are set. m4_define([_LT_UNLESS_OPTIONS], [m4_foreach([_LT_Option], m4_split(m4_normalize([$2])), [m4_ifdef(_LT_MANGLE_OPTION([$1], _LT_Option), [m4_define([$0_found])])])[]dnl m4_ifdef([$0_found], [m4_undefine([$0_found])], [$3 ])[]dnl ]) # _LT_SET_OPTIONS(MACRO-NAME, OPTION-LIST) # ---------------------------------------- # OPTION-LIST is a space-separated list of Libtool options associated # with MACRO-NAME. If any OPTION has a matching handler declared with # LT_OPTION_DEFINE, dispatch to that macro; otherwise complain about # the unknown option and exit. m4_defun([_LT_SET_OPTIONS], [# Set options m4_foreach([_LT_Option], m4_split(m4_normalize([$2])), [_LT_SET_OPTION([$1], _LT_Option)]) m4_if([$1],[LT_INIT],[ dnl dnl Simply set some default values (i.e off) if boolean options were not dnl specified: _LT_UNLESS_OPTIONS([LT_INIT], [dlopen], [enable_dlopen=no ]) _LT_UNLESS_OPTIONS([LT_INIT], [win32-dll], [enable_win32_dll=no ]) dnl dnl If no reference was made to various pairs of opposing options, then dnl we run the default mode handler for the pair. For example, if neither dnl `shared' nor `disable-shared' was passed, we enable building of shared dnl archives by default: _LT_UNLESS_OPTIONS([LT_INIT], [shared disable-shared], [_LT_ENABLE_SHARED]) _LT_UNLESS_OPTIONS([LT_INIT], [static disable-static], [_LT_ENABLE_STATIC]) _LT_UNLESS_OPTIONS([LT_INIT], [pic-only no-pic], [_LT_WITH_PIC]) _LT_UNLESS_OPTIONS([LT_INIT], [fast-install disable-fast-install], [_LT_ENABLE_FAST_INSTALL]) ]) ])# _LT_SET_OPTIONS ## --------------------------------- ## ## Macros to handle LT_INIT options. ## ## --------------------------------- ## # _LT_MANGLE_DEFUN(MACRO-NAME, OPTION-NAME) # ----------------------------------------- m4_define([_LT_MANGLE_DEFUN], [[_LT_OPTION_DEFUN_]m4_bpatsubst(m4_toupper([$1__$2]), [[^A-Z0-9_]], [_])]) # LT_OPTION_DEFINE(MACRO-NAME, OPTION-NAME, CODE) # ----------------------------------------------- m4_define([LT_OPTION_DEFINE], [m4_define(_LT_MANGLE_DEFUN([$1], [$2]), [$3])[]dnl ])# LT_OPTION_DEFINE # dlopen # ------ LT_OPTION_DEFINE([LT_INIT], [dlopen], [enable_dlopen=yes ]) AU_DEFUN([AC_LIBTOOL_DLOPEN], [_LT_SET_OPTION([LT_INIT], [dlopen]) AC_DIAGNOSE([obsolete], [$0: Remove this warning and the call to _LT_SET_OPTION when you put the `dlopen' option into LT_INIT's first parameter.]) ]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_LIBTOOL_DLOPEN], []) # win32-dll # --------- # Declare package support for building win32 dll's. LT_OPTION_DEFINE([LT_INIT], [win32-dll], [enable_win32_dll=yes case $host in *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-cegcc*) AC_CHECK_TOOL(AS, as, false) AC_CHECK_TOOL(DLLTOOL, dlltool, false) AC_CHECK_TOOL(OBJDUMP, objdump, false) ;; esac test -z "$AS" && AS=as _LT_DECL([], [AS], [1], [Assembler program])dnl test -z "$DLLTOOL" && DLLTOOL=dlltool _LT_DECL([], [DLLTOOL], [1], [DLL creation program])dnl test -z "$OBJDUMP" && OBJDUMP=objdump _LT_DECL([], [OBJDUMP], [1], [Object dumper program])dnl ])# win32-dll AU_DEFUN([AC_LIBTOOL_WIN32_DLL], [AC_REQUIRE([AC_CANONICAL_HOST])dnl _LT_SET_OPTION([LT_INIT], [win32-dll]) AC_DIAGNOSE([obsolete], [$0: Remove this warning and the call to _LT_SET_OPTION when you put the `win32-dll' option into LT_INIT's first parameter.]) ]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_LIBTOOL_WIN32_DLL], []) # _LT_ENABLE_SHARED([DEFAULT]) # ---------------------------- # implement the --enable-shared flag, and supports the `shared' and # `disable-shared' LT_INIT options. # DEFAULT is either `yes' or `no'. If omitted, it defaults to `yes'. m4_define([_LT_ENABLE_SHARED], [m4_define([_LT_ENABLE_SHARED_DEFAULT], [m4_if($1, no, no, yes)])dnl AC_ARG_ENABLE([shared], [AS_HELP_STRING([--enable-shared@<:@=PKGS@:>@], [build shared libraries @<:@default=]_LT_ENABLE_SHARED_DEFAULT[@:>@])], [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], [enable_shared=]_LT_ENABLE_SHARED_DEFAULT) _LT_DECL([build_libtool_libs], [enable_shared], [0], [Whether or not to build shared libraries]) ])# _LT_ENABLE_SHARED LT_OPTION_DEFINE([LT_INIT], [shared], [_LT_ENABLE_SHARED([yes])]) LT_OPTION_DEFINE([LT_INIT], [disable-shared], [_LT_ENABLE_SHARED([no])]) # Old names: AC_DEFUN([AC_ENABLE_SHARED], [_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[shared]) ]) AC_DEFUN([AC_DISABLE_SHARED], [_LT_SET_OPTION([LT_INIT], [disable-shared]) ]) AU_DEFUN([AM_ENABLE_SHARED], [AC_ENABLE_SHARED($@)]) AU_DEFUN([AM_DISABLE_SHARED], [AC_DISABLE_SHARED($@)]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AM_ENABLE_SHARED], []) dnl AC_DEFUN([AM_DISABLE_SHARED], []) # _LT_ENABLE_STATIC([DEFAULT]) # ---------------------------- # implement the --enable-static flag, and support the `static' and # `disable-static' LT_INIT options. # DEFAULT is either `yes' or `no'. If omitted, it defaults to `yes'. m4_define([_LT_ENABLE_STATIC], [m4_define([_LT_ENABLE_STATIC_DEFAULT], [m4_if($1, no, no, yes)])dnl AC_ARG_ENABLE([static], [AS_HELP_STRING([--enable-static@<:@=PKGS@:>@], [build static libraries @<:@default=]_LT_ENABLE_STATIC_DEFAULT[@:>@])], [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], [enable_static=]_LT_ENABLE_STATIC_DEFAULT) _LT_DECL([build_old_libs], [enable_static], [0], [Whether or not to build static libraries]) ])# _LT_ENABLE_STATIC LT_OPTION_DEFINE([LT_INIT], [static], [_LT_ENABLE_STATIC([yes])]) LT_OPTION_DEFINE([LT_INIT], [disable-static], [_LT_ENABLE_STATIC([no])]) # Old names: AC_DEFUN([AC_ENABLE_STATIC], [_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[static]) ]) AC_DEFUN([AC_DISABLE_STATIC], [_LT_SET_OPTION([LT_INIT], [disable-static]) ]) AU_DEFUN([AM_ENABLE_STATIC], [AC_ENABLE_STATIC($@)]) AU_DEFUN([AM_DISABLE_STATIC], [AC_DISABLE_STATIC($@)]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AM_ENABLE_STATIC], []) dnl AC_DEFUN([AM_DISABLE_STATIC], []) # _LT_ENABLE_FAST_INSTALL([DEFAULT]) # ---------------------------------- # implement the --enable-fast-install flag, and support the `fast-install' # and `disable-fast-install' LT_INIT options. # DEFAULT is either `yes' or `no'. If omitted, it defaults to `yes'. m4_define([_LT_ENABLE_FAST_INSTALL], [m4_define([_LT_ENABLE_FAST_INSTALL_DEFAULT], [m4_if($1, no, no, yes)])dnl AC_ARG_ENABLE([fast-install], [AS_HELP_STRING([--enable-fast-install@<:@=PKGS@:>@], [optimize for fast installation @<:@default=]_LT_ENABLE_FAST_INSTALL_DEFAULT[@:>@])], [p=${PACKAGE-default} case $enableval in yes) enable_fast_install=yes ;; no) enable_fast_install=no ;; *) enable_fast_install=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_fast_install=yes fi done IFS="$lt_save_ifs" ;; esac], [enable_fast_install=]_LT_ENABLE_FAST_INSTALL_DEFAULT) _LT_DECL([fast_install], [enable_fast_install], [0], [Whether or not to optimize for fast installation])dnl ])# _LT_ENABLE_FAST_INSTALL LT_OPTION_DEFINE([LT_INIT], [fast-install], [_LT_ENABLE_FAST_INSTALL([yes])]) LT_OPTION_DEFINE([LT_INIT], [disable-fast-install], [_LT_ENABLE_FAST_INSTALL([no])]) # Old names: AU_DEFUN([AC_ENABLE_FAST_INSTALL], [_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[fast-install]) AC_DIAGNOSE([obsolete], [$0: Remove this warning and the call to _LT_SET_OPTION when you put the `fast-install' option into LT_INIT's first parameter.]) ]) AU_DEFUN([AC_DISABLE_FAST_INSTALL], [_LT_SET_OPTION([LT_INIT], [disable-fast-install]) AC_DIAGNOSE([obsolete], [$0: Remove this warning and the call to _LT_SET_OPTION when you put the `disable-fast-install' option into LT_INIT's first parameter.]) ]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_ENABLE_FAST_INSTALL], []) dnl AC_DEFUN([AM_DISABLE_FAST_INSTALL], []) # _LT_WITH_PIC([MODE]) # -------------------- # implement the --with-pic flag, and support the `pic-only' and `no-pic' # LT_INIT options. # 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@<:@=PKGS@:>@], [try to use only PIC/non-PIC objects @<:@default=use both@:>@])], [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]) _LT_DECL([], [pic_mode], [0], [What type of objects to build])dnl ])# _LT_WITH_PIC LT_OPTION_DEFINE([LT_INIT], [pic-only], [_LT_WITH_PIC([yes])]) LT_OPTION_DEFINE([LT_INIT], [no-pic], [_LT_WITH_PIC([no])]) # Old name: AU_DEFUN([AC_LIBTOOL_PICMODE], [_LT_SET_OPTION([LT_INIT], [pic-only]) AC_DIAGNOSE([obsolete], [$0: Remove this warning and the call to _LT_SET_OPTION when you put the `pic-only' option into LT_INIT's first parameter.]) ]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_LIBTOOL_PICMODE], []) ## ----------------- ## ## LTDL_INIT Options ## ## ----------------- ## m4_define([_LTDL_MODE], []) LT_OPTION_DEFINE([LTDL_INIT], [nonrecursive], [m4_define([_LTDL_MODE], [nonrecursive])]) LT_OPTION_DEFINE([LTDL_INIT], [recursive], [m4_define([_LTDL_MODE], [recursive])]) LT_OPTION_DEFINE([LTDL_INIT], [subproject], [m4_define([_LTDL_MODE], [subproject])]) m4_define([_LTDL_TYPE], []) LT_OPTION_DEFINE([LTDL_INIT], [installable], [m4_define([_LTDL_TYPE], [installable])]) LT_OPTION_DEFINE([LTDL_INIT], [convenience], [m4_define([_LTDL_TYPE], [convenience])]) tango-8.1.2c+dfsg.orig/lib/cpp/log4tango/m4/AC_CXX_NAMESPACES.m40000755000175000017500000000127212205375127022320 0ustar piccapiccadnl @synopsis AC_CXX_NAMESPACES dnl dnl If the compiler can prevent names clashes using namespaces, define dnl HAVE_NAMESPACES. dnl dnl @version $Id: AC_CXX_NAMESPACES.m4 9222 2003-03-11 17:21:15Z nleclercq $ dnl @author Luc Maisonobe dnl AC_DEFUN([AC_CXX_NAMESPACES], [AC_CACHE_CHECK(whether the compiler implements namespaces, ac_cv_cxx_namespaces, [AC_LANG_PUSH(C++) AC_TRY_COMPILE([namespace Outer { namespace Inner { int i = 0; }}], [using namespace Outer::Inner; return i;], ac_cv_cxx_namespaces=yes, ac_cv_cxx_namespaces=no) AC_LANG_POP(C++) ]) if test "$ac_cv_cxx_namespaces" = yes; then AC_DEFINE(HAVE_NAMESPACES,,[define if the compiler implements namespaces]) fi ]) tango-8.1.2c+dfsg.orig/lib/cpp/log4tango/m4/BB_CHECK_PTHREADS.m40000755000175000017500000000137512205375127022272 0ustar piccapiccaAC_DEFUN([BB_CHECK_PTHREADS], [AC_SEARCH_LIBS(pthread_key_create,pthread, [AC_DEFINE(HAVE_THREADING,,[define if threading is enabled]) AC_DEFINE(USE_PTHREADS,,[define if pthread library is available]) case $host_os in linux*) CFLAGS="$CFLAGS -D_REENTRANT" CXXFLAGS="$CXXFLAGS -D_REENTRANT" ;; solaris*) if test x$GCC = x ; then CFLAGS="$CFLAGS -mt -D_POSIX_PTHREAD_SEMANTICS" CXXFLAGS="$CXXFLAGS -mt -D_POSIX_PTHREAD_SEMANTICS" else CFLAGS="$CFLAGS -D_REENTRANT" CXXFLAGS="$CXXFLAGS -D_REENTRANT" fi ;; hpux*) CFLAGS="$CFLAGS -AA -mt +inst_close" CXXFLAGS="$CXXFLAGS -AA -mt +inst_close" ;; esac], AC_MSG_ERROR([pthreads not found])) ]) tango-8.1.2c+dfsg.orig/lib/cpp/log4tango/m4/RSSH_CHECK_SUNPRO_CC.m40000755000175000017500000000162212205375127022742 0ustar piccapicca# RSSH_CHECK_SUNPROC_CC([ACTION-IF-YES], [ACTION-IF-NOT]) # ------------------------------------------------------ # check : are we using SUN workshop C++ compiler. # Corresponding cache value: rssh_cv_check_sunpro_cc is set to yes or no # #@author Ruslan Shevchenko , 1998, 2000 #@version $Id: RSSH_CHECK_SUNPRO_CC.m4 9976 2005-01-14 15:06:09Z taurel $ # # RSSH_CHECK_SUNPRO_CC([ACTION-IF-YES],[ACTION-IF-NOT]) # AC_DEFUN([RSSH_CHECK_SUNPRO_CC], [AC_CACHE_CHECK([whether using Sun Worckshop C++ compiler], [rssh_cv_check_sunpro_cc], [AC_LANG_SAVE AC_LANG_CPLUSPLUS AC_TRY_COMPILE([], [#ifndef __SUNPRO_CC # include "error: this is not Sun Workshop." #endif ], rssh_cv_check_sunpro_cc=yes, rssh_cv_check_sunpro_cc=no) AC_LANG_RESTORE]) if test ${rssh_cv_check_sunpro_cc} = yes then $2 : else $3 : fi ])# RSSH_CHECK_SUNPROC_CC tango-8.1.2c+dfsg.orig/lib/cpp/log4tango/m4/AC_CREATE_PREFIX_CONFIG_H.m40000755000175000017500000001172112205375127023473 0ustar piccapiccadnl @synopsis AC_CREATE_PREFIX_CONFIG_H [(OUTPUT-HEADER [,PREFIX [,ORIG-HEADER]])] dnl dnl this is a new variant from ac_prefix_config_ dnl this one will use a lowercase-prefix if dnl the config-define was starting with a lowercase-char, e.g. dnl #define const or #define restrict or #define off_t dnl (and this one can live in another directory, e.g. testpkg/config.h dnl therefore I decided to move the output-header to be the first arg) dnl dnl takes the usual config.h generated header file; looks for each of dnl the generated "#define SOMEDEF" lines, and prefixes the defined name dnl (ie. makes it "#define PREFIX_SOMEDEF". The result is written to dnl the output config.header file. The PREFIX is converted to uppercase dnl for the conversions. dnl dnl default OUTPUT-HEADER = $PACKAGE-config.h dnl default PREFIX = $PACKAGE dnl default ORIG-HEADER, derived from OUTPUT-HEADER dnl if OUTPUT-HEADER has a "/", use the basename dnl if OUTPUT-HEADER has a "-", use the section after it. dnl otherwise, just config.h dnl dnl In most cases, the configure.in will contain a line saying dnl AC_CONFIG_HEADER(config.h) dnl somewhere *before* AC_OUTPUT and a simple line saying dnl AC_PREFIX_CONFIG_HEADER dnl somewhere *after* AC_OUTPUT. dnl dnl example: dnl AC_INIT(config.h.in) # config.h.in as created by "autoheader" dnl AM_INIT_AUTOMAKE(testpkg, 0.1.1) # "#undef VERSION" and "PACKAGE" dnl AM_CONFIG_HEADER(config.h) # in config.h.in dnl AC_MEMORY_H # "#undef NEED_MEMORY_H" dnl AC_C_CONST_H # "#undef const" dnl AC_OUTPUT(Makefile) # creates the "config.h" now dnl AC_CREATE_PREFIX_CONFIG_H # creates "testpkg-config.h" dnl and the resulting "testpkg-config.h" contains lines like dnl #ifndef TESTPKG_VERSION dnl #define TESTPKG_VERSION "0.1.1" dnl #endif dnl #ifndef TESTPKG_NEED_MEMORY_H dnl #define TESTPKG_NEED_MEMORY_H 1 dnl #endif dnl #ifndef _testpkg_const dnl #define _testpkg_const const dnl #endif dnl dnl and this "testpkg-config.h" can be installed along with other dnl header-files, which is most convenient when creating a shared dnl library (that has some headers) where some functionality is dnl dependent on the OS-features detected at compile-time. No dnl need to invent some "testpkg-confdefs.h.in" manually. :-) dnl dnl @version $Id: AC_CREATE_PREFIX_CONFIG_H.m4 9222 2003-03-11 17:21:15Z nleclercq $ dnl @author Guido Draheim AC_DEFUN([AC_CREATE_PREFIX_CONFIG_H], [changequote({, })dnl ac_prefix_conf_OUT=`echo ifelse($1, , ${PACKAGE_TARNAME}-config.h, $1)` ac_prefix_conf_DEF=`echo _$ac_prefix_conf_OUT | sed -e 'y:abcdefghijklmnopqrstuvwxyz./,-:ABCDEFGHIJKLMNOPQRSTUVWXYZ____:'` ac_prefix_conf_PKG=`echo ifelse($2, , ${PACKAGE_TARNAME}, $2)` ac_prefix_conf_LOW=`echo _$ac_prefix_conf_PKG | sed -e 'y:ABCDEFGHIJKLMNOPQRSTUVWXYZ-:abcdefghijklmnopqrstuvwxyz_:'` ac_prefix_conf_UPP=`echo $ac_prefix_conf_PKG | sed -e 'y:abcdefghijklmnopqrstuvwxyz-:ABCDEFGHIJKLMNOPQRSTUVWXYZ_:' -e '/^[0-9]/s/^/_/'` ac_prefix_conf_INP=`echo ifelse($3, , _, $3)` if test "$ac_prefix_conf_INP" = "_"; then case $ac_prefix_conf_OUT in */*) ac_prefix_conf_INP=`basename $ac_prefix_conf_OUT` ;; *-*) ac_prefix_conf_INP=`echo $ac_prefix_conf_OUT | sed -e 's/[a-zA-Z0-9_]*-//'` ;; *) ac_prefix_conf_INP=config.h ;; esac fi changequote([, ])dnl if test -z "$ac_prefix_conf_PKG" ; then AC_MSG_ERROR([no prefix for _PREFIX_PKG_CONFIG_H]) else AC_MSG_RESULT(creating $ac_prefix_conf_OUT - prefix $ac_prefix_conf_UPP for $ac_prefix_conf_INP defines) if test -f $ac_prefix_conf_INP ; then AS_DIRNAME([/* automatically generated */], $ac_prefix_conf_OUT) changequote({, })dnl echo '#ifndef '$ac_prefix_conf_DEF >$ac_prefix_conf_OUT echo '#define '$ac_prefix_conf_DEF' 1' >>$ac_prefix_conf_OUT echo ' ' >>$ac_prefix_conf_OUT echo /'*' $ac_prefix_conf_OUT. Generated automatically at end of configure. '*'/ >>$ac_prefix_conf_OUT echo 's/#undef *\([A-Z_]\)/#undef '$ac_prefix_conf_UPP'_\1/' >conftest.sed echo 's/#undef *\([a-z]\)/#undef '$ac_prefix_conf_LOW'_\1/' >>conftest.sed echo 's/#define *\([A-Z_][A-Za-z0-9_]*\)\(.*\)/#ifndef '$ac_prefix_conf_UPP"_\\1 \\" >>conftest.sed echo '#define '$ac_prefix_conf_UPP"_\\1 \\2 \\" >>conftest.sed echo '#endif/' >>conftest.sed echo 's/#define *\([a-z][A-Za-z0-9_]*\)\(.*\)/#ifndef '$ac_prefix_conf_LOW"_\\1 \\" >>conftest.sed echo '#define '$ac_prefix_conf_LOW"_\\1 \\2 \\" >>conftest.sed echo '#endif/' >>conftest.sed sed -f conftest.sed $ac_prefix_conf_INP >>$ac_prefix_conf_OUT echo ' ' >>$ac_prefix_conf_OUT echo '/*' $ac_prefix_conf_DEF '*/' >>$ac_prefix_conf_OUT echo '#endif' >>$ac_prefix_conf_OUT changequote([, ])dnl else AC_MSG_ERROR([input file $ac_prefix_conf_IN does not exist, dnl skip generating $ac_prefix_conf_OUT]) fi rm -f conftest.* fi]) tango-8.1.2c+dfsg.orig/lib/cpp/log4tango/m4/PETI_PEDANTIC_GCC.m40000755000175000017500000000255212205375127022302 0ustar piccapiccadnl @synopsis PETI_PEDANTIC_GCC dnl dnl For development purposes, it is desirable to have autoconf dnl automatically enable warnings when compiling C or C++ sources. In dnl case the underlying compiler is a gcc, the appropriate flags are dnl "-Wall -pedantic". This macro will add them to $CFLAGS and dnl $CXXFLAGS if $CC is found to be a gcc. dnl dnl @author Peter Simons dnl original version: peti_pedantic_gcc.m4,v 1.4 2000/12/31 10:18:09 simons dnl @version $Id: PETI_PEDANTIC_GCC.m4 9222 2003-03-11 17:21:15Z nleclercq $ AC_DEFUN([PETI_PEDANTIC_GCC], [ if test "$GCC" = yes; then if test "$host" = x86-pc-nto-qnx; then CFLAGS="$CXXFLAGS -Wno-unused -O0" CXXFLAGS="$CXXFLAGS -Wno-unused -DLOG4TANGO_MISSING_INT64_OSTREAM_OP -O0" else case `$CXX --version` in *2.97*) CFLAGS="$CFLAGS -Wall -Wno-unused -pedantic -D_ISOC99_SOURCE" CXXFLAGS="$CXXFLAGS -Wall -Wno-unused -pedantic -D_ISOC99_SOURCE" ;; *2.96*) CFLAGS="$CFLAGS -Wall -Wno-unused" CXXFLAGS="$CXXFLAGS -Wall -Wno-unused" ;; *) CFLAGS="$CFLAGS -Wall -Wno-unused -pedantic" CXXFLAGS="$CXXFLAGS -Wall -Wno-unused -pedantic" ;; esac fi fi ]) tango-8.1.2c+dfsg.orig/lib/cpp/log4tango/m4/BB_ENABLE_DOXYGEN.m40000755000175000017500000000237012205375127022302 0ustar piccapiccaAC_DEFUN([BB_ENABLE_DOXYGEN], [ AC_ARG_ENABLE(doxygen, [ --enable-doxygen enable documentation generation with doxygen (auto)]) AC_ARG_ENABLE(dot, [ --enable-dot use 'dot' to generate graphs in doxygen (auto)]) AC_ARG_ENABLE(html-docs, [ --enable-html-docs enable HTML generation with doxygen (yes)], [], [ enable_html_docs=yes]) AC_ARG_ENABLE(latex-docs, [ --enable-latex-docs enable LaTeX documentation generation with doxygen (no)], [], [ enable_latex_docs=no]) if test "x$enable_doxygen" = xno; then enable_doc=no else AC_PATH_PROG(DOXYGEN, doxygen, , $PATH) if test x$DOXYGEN = x; then if test "x$enable_doxygen" = xyes; then AC_MSG_ERROR([could not find doxygen]) fi enable_doc=no else enable_doc=yes AC_PATH_PROG(DOT, dot, , $PATH) fi fi AM_CONDITIONAL(DOC, test x$enable_doc = xyes) if test x$DOT = x; then if test "x$enable_dot" = xyes; then AC_MSG_ERROR([could not find dot]) fi enable_dot=no else enable_dot=yes fi AC_SUBST(enable_dot) AC_SUBST(enable_html_docs) AC_SUBST(enable_latex_docs) ]) tango-8.1.2c+dfsg.orig/lib/cpp/log4tango/m4/ltversion.m40000644000175000017500000000126212205375127021635 0ustar piccapicca# ltversion.m4 -- version numbers -*- Autoconf -*- # # Copyright (C) 2004 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. # @configure_input@ # serial 3337 ltversion.m4 # This file is part of GNU Libtool m4_define([LT_PACKAGE_VERSION], [2.4.2]) m4_define([LT_PACKAGE_REVISION], [1.3337]) AC_DEFUN([LTVERSION_VERSION], [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) ]) tango-8.1.2c+dfsg.orig/lib/cpp/log4tango/m4/lt~obsolete.m40000644000175000017500000001375612205375127022175 0ustar piccapicca# lt~obsolete.m4 -- aclocal satisfying obsolete definitions. -*-Autoconf-*- # # 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 5 lt~obsolete.m4 # These exist entirely to fool aclocal when bootstrapping libtool. # # In the past libtool.m4 has provided macros via AC_DEFUN (or AU_DEFUN) # which have later been changed to m4_define as they aren't part of the # exported API, or moved to Autoconf or Automake where they belong. # # The trouble is, aclocal is a bit thick. It'll see the old AC_DEFUN # in /usr/share/aclocal/libtool.m4 and remember it, then when it sees us # using a macro with the same name in our local m4/libtool.m4 it'll # pull the old libtool.m4 in (it doesn't see our shiny new m4_define # and doesn't know about Autoconf macros at all.) # # So we provide this file, which has a silly filename so it's always # included after everything else. This provides aclocal with the # AC_DEFUNs it wants, but when m4 processes it, it doesn't do anything # because those macros already exist, or will be overwritten later. # We use AC_DEFUN over AU_DEFUN for compatibility with aclocal-1.6. # # Anytime we withdraw an AC_DEFUN or AU_DEFUN, remember to add it here. # Yes, that means every name once taken will need to remain here until # we give up compatibility with versions before 1.7, at which point # we need to keep only those names which we still refer to. # This is to help aclocal find these macros, as it can't see m4_define. AC_DEFUN([LTOBSOLETE_VERSION], [m4_if([1])]) m4_ifndef([AC_LIBTOOL_LINKER_OPTION], [AC_DEFUN([AC_LIBTOOL_LINKER_OPTION])]) m4_ifndef([AC_PROG_EGREP], [AC_DEFUN([AC_PROG_EGREP])]) m4_ifndef([_LT_AC_PROG_ECHO_BACKSLASH], [AC_DEFUN([_LT_AC_PROG_ECHO_BACKSLASH])]) m4_ifndef([_LT_AC_SHELL_INIT], [AC_DEFUN([_LT_AC_SHELL_INIT])]) m4_ifndef([_LT_AC_SYS_LIBPATH_AIX], [AC_DEFUN([_LT_AC_SYS_LIBPATH_AIX])]) m4_ifndef([_LT_PROG_LTMAIN], [AC_DEFUN([_LT_PROG_LTMAIN])]) m4_ifndef([_LT_AC_TAGVAR], [AC_DEFUN([_LT_AC_TAGVAR])]) m4_ifndef([AC_LTDL_ENABLE_INSTALL], [AC_DEFUN([AC_LTDL_ENABLE_INSTALL])]) m4_ifndef([AC_LTDL_PREOPEN], [AC_DEFUN([AC_LTDL_PREOPEN])]) m4_ifndef([_LT_AC_SYS_COMPILER], [AC_DEFUN([_LT_AC_SYS_COMPILER])]) m4_ifndef([_LT_AC_LOCK], [AC_DEFUN([_LT_AC_LOCK])]) m4_ifndef([AC_LIBTOOL_SYS_OLD_ARCHIVE], [AC_DEFUN([AC_LIBTOOL_SYS_OLD_ARCHIVE])]) m4_ifndef([_LT_AC_TRY_DLOPEN_SELF], [AC_DEFUN([_LT_AC_TRY_DLOPEN_SELF])]) m4_ifndef([AC_LIBTOOL_PROG_CC_C_O], [AC_DEFUN([AC_LIBTOOL_PROG_CC_C_O])]) m4_ifndef([AC_LIBTOOL_SYS_HARD_LINK_LOCKS], [AC_DEFUN([AC_LIBTOOL_SYS_HARD_LINK_LOCKS])]) m4_ifndef([AC_LIBTOOL_OBJDIR], [AC_DEFUN([AC_LIBTOOL_OBJDIR])]) m4_ifndef([AC_LTDL_OBJDIR], [AC_DEFUN([AC_LTDL_OBJDIR])]) m4_ifndef([AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH], [AC_DEFUN([AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH])]) m4_ifndef([AC_LIBTOOL_SYS_LIB_STRIP], [AC_DEFUN([AC_LIBTOOL_SYS_LIB_STRIP])]) m4_ifndef([AC_PATH_MAGIC], [AC_DEFUN([AC_PATH_MAGIC])]) m4_ifndef([AC_PROG_LD_GNU], [AC_DEFUN([AC_PROG_LD_GNU])]) m4_ifndef([AC_PROG_LD_RELOAD_FLAG], [AC_DEFUN([AC_PROG_LD_RELOAD_FLAG])]) m4_ifndef([AC_DEPLIBS_CHECK_METHOD], [AC_DEFUN([AC_DEPLIBS_CHECK_METHOD])]) m4_ifndef([AC_LIBTOOL_PROG_COMPILER_NO_RTTI], [AC_DEFUN([AC_LIBTOOL_PROG_COMPILER_NO_RTTI])]) m4_ifndef([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE], [AC_DEFUN([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE])]) m4_ifndef([AC_LIBTOOL_PROG_COMPILER_PIC], [AC_DEFUN([AC_LIBTOOL_PROG_COMPILER_PIC])]) m4_ifndef([AC_LIBTOOL_PROG_LD_SHLIBS], [AC_DEFUN([AC_LIBTOOL_PROG_LD_SHLIBS])]) m4_ifndef([AC_LIBTOOL_POSTDEP_PREDEP], [AC_DEFUN([AC_LIBTOOL_POSTDEP_PREDEP])]) m4_ifndef([LT_AC_PROG_EGREP], [AC_DEFUN([LT_AC_PROG_EGREP])]) m4_ifndef([LT_AC_PROG_SED], [AC_DEFUN([LT_AC_PROG_SED])]) m4_ifndef([_LT_CC_BASENAME], [AC_DEFUN([_LT_CC_BASENAME])]) m4_ifndef([_LT_COMPILER_BOILERPLATE], [AC_DEFUN([_LT_COMPILER_BOILERPLATE])]) m4_ifndef([_LT_LINKER_BOILERPLATE], [AC_DEFUN([_LT_LINKER_BOILERPLATE])]) m4_ifndef([_AC_PROG_LIBTOOL], [AC_DEFUN([_AC_PROG_LIBTOOL])]) m4_ifndef([AC_LIBTOOL_SETUP], [AC_DEFUN([AC_LIBTOOL_SETUP])]) m4_ifndef([_LT_AC_CHECK_DLFCN], [AC_DEFUN([_LT_AC_CHECK_DLFCN])]) m4_ifndef([AC_LIBTOOL_SYS_DYNAMIC_LINKER], [AC_DEFUN([AC_LIBTOOL_SYS_DYNAMIC_LINKER])]) m4_ifndef([_LT_AC_TAGCONFIG], [AC_DEFUN([_LT_AC_TAGCONFIG])]) m4_ifndef([AC_DISABLE_FAST_INSTALL], [AC_DEFUN([AC_DISABLE_FAST_INSTALL])]) 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_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])]) m4_ifndef([_LT_AC_LANG_CXX_CONFIG], [AC_DEFUN([_LT_AC_LANG_CXX_CONFIG])]) m4_ifndef([AC_LIBTOOL_LANG_F77_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_F77_CONFIG])]) m4_ifndef([_LT_AC_LANG_F77_CONFIG], [AC_DEFUN([_LT_AC_LANG_F77_CONFIG])]) m4_ifndef([AC_LIBTOOL_LANG_GCJ_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_GCJ_CONFIG])]) m4_ifndef([_LT_AC_LANG_GCJ_CONFIG], [AC_DEFUN([_LT_AC_LANG_GCJ_CONFIG])]) m4_ifndef([AC_LIBTOOL_LANG_RC_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_RC_CONFIG])]) 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])]) tango-8.1.2c+dfsg.orig/lib/cpp/log4tango/m4/AC_FUNC_SNPRINTF.m40000755000175000017500000000163312205375127022236 0ustar piccapiccadnl @synopsis AC_FUNC_SNPRINTF dnl dnl Provides a test for a working snprintf function. dnl unlike the original AC_FUNC_SNPRINTF test this one will also dnl accept snprintf implementations which return -1 if the string does dnl not fit in the buffer, e.g. snprintf on Solaris and glibc <= 2.0.6. dnl defines HAVE_SNPRINTF if it is found, and dnl sets ac_cv_func_snprintf to yes, otherwise to no. dnl dnl @version $Id: AC_FUNC_SNPRINTF.m4 9222 2003-03-11 17:21:15Z nleclercq $ dnl @author Caolan McNamara dnl AC_DEFUN([AC_FUNC_SNPRINTF], [AC_CACHE_CHECK(for working snprintf, ac_cv_func_snprintf, [AC_TRY_RUN([#include int main () { int l = snprintf(NULL,0,"%d",100); exit (!((3 <= l) || (-1 == l))); } ], ac_cv_func_snprintf=yes, ac_cv_func_snprintf=no, ac_cv_func_snprintf=no)]) if test $ac_cv_func_snprintf = yes; then AC_DEFINE(HAVE_SNPRINTF,,[define if the C library has snprintf]) fi ]) tango-8.1.2c+dfsg.orig/lib/cpp/log4tango/m4/AC_C_INT64_T.m40000755000175000017500000000126712205375127021514 0ustar piccapiccadnl @synopsis AC_C_INT64_T dnl dnl Provides a test for the existance of the int64_t type and dnl defines HAVE_INT64_T if it is found. Adapted from AC_C_LONG_LONG by dnl Caolan McNamara dnl dnl @version $Id: AC_C_INT64_T.m4 9222 2003-03-11 17:21:15Z nleclercq $ dnl @author Bastiaan Bakker dnl AC_DEFUN([AC_C_INT64_T], [AC_CACHE_CHECK(for int64_t, ac_cv_c_int64_t, [AC_TRY_COMPILE([#include ],[int64_t i;], ac_cv_c_int64_t=yes, ac_cv_c_int64_t=no) ]) if test $ac_cv_c_int64_t = yes; then AC_DEFINE(HAVE_INT64_T,,[define if the compiler has int64_t]) AC_DEFINE(HAVE_STDINT_H,,[define if you have the header file.]) fi ]) tango-8.1.2c+dfsg.orig/lib/cpp/log4tango/m4/libtool.m40000644000175000017500000106043412205375127021263 0ustar piccapicca# libtool.m4 - Configure libtool for the host system. -*-Autoconf-*- # # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005, # 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 # unlimited permission to copy and/or distribute it, with or without # modifications, as long as this notice is preserved. m4_define([_LT_COPYING], [dnl # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005, # 2006, 2007, 2008, 2009, 2010, 2011 Free Software # Foundation, Inc. # Written by Gordon Matzigkeit, 1996 # # This file is part of GNU Libtool. # # GNU Libtool 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. # # As a special exception to the GNU General Public License, # if you distribute this file as part of a program or library that # is built using GNU Libtool, you may include this file under the # same distribution terms that you use for the rest of that program. # # GNU Libtool 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 GNU Libtool; see the file COPYING. If not, a copy # can be downloaded from http://www.gnu.org/licenses/gpl.html, or # obtained by writing to the Free Software Foundation, Inc., # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ]) # serial 57 LT_INIT # LT_PREREQ(VERSION) # ------------------ # Complain and exit if this libtool version is less that VERSION. m4_defun([LT_PREREQ], [m4_if(m4_version_compare(m4_defn([LT_PACKAGE_VERSION]), [$1]), -1, [m4_default([$3], [m4_fatal([Libtool version $1 or higher is required], 63)])], [$2])]) # _LT_CHECK_BUILDDIR # ------------------ # Complain if the absolute build directory name contains unusual characters m4_defun([_LT_CHECK_BUILDDIR], [case `pwd` in *\ * | *\ *) AC_MSG_WARN([Libtool does not cope well with whitespace in `pwd`]) ;; esac ]) # LT_INIT([OPTIONS]) # ------------------ 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 m4_require([_LT_CHECK_BUILDDIR])dnl dnl Autoconf doesn't catch unexpanded LT_ macros by default: m4_pattern_forbid([^_?LT_[A-Z_]+$])dnl m4_pattern_allow([^(_LT_EOF|LT_DLGLOBAL|LT_DLLAZY_OR_NOW|LT_MULTI_MODULE)$])dnl dnl aclocal doesn't pull ltoptions.m4, ltsugar.m4, or ltversion.m4 dnl unless we require an AC_DEFUNed macro: AC_REQUIRE([LTOPTIONS_VERSION])dnl AC_REQUIRE([LTSUGAR_VERSION])dnl AC_REQUIRE([LTVERSION_VERSION])dnl 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]) # This can be used to rebuild libtool when needed LIBTOOL_DEPS="$ltmain" # Always use our own libtool. LIBTOOL='$(SHELL) $(top_builddir)/libtool' AC_SUBST(LIBTOOL)dnl _LT_SETUP # Only expand once: m4_define([LT_INIT]) ])# LT_INIT # Old names: AU_ALIAS([AC_PROG_LIBTOOL], [LT_INIT]) AU_ALIAS([AM_PROG_LIBTOOL], [LT_INIT]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_PROG_LIBTOOL], []) dnl AC_DEFUN([AM_PROG_LIBTOOL], []) # _LT_CC_BASENAME(CC) # ------------------- # Calculate cc_basename. Skip known compiler wrappers and cross-prefix. m4_defun([_LT_CC_BASENAME], [for cc_temp in $1""; do case $cc_temp in compile | *[[\\/]]compile | ccache | *[[\\/]]ccache ) ;; distcc | *[[\\/]]distcc | purify | *[[\\/]]purify ) ;; \-*) ;; *) break;; esac done cc_basename=`$ECHO "$cc_temp" | $SED "s%.*/%%; s%^$host_alias-%%"` ]) # _LT_FILEUTILS_DEFAULTS # ---------------------- # It is okay to use these file commands and assume they have been set # sensibly after `m4_require([_LT_FILEUTILS_DEFAULTS])'. m4_defun([_LT_FILEUTILS_DEFAULTS], [: ${CP="cp -f"} : ${MV="mv -f"} : ${RM="rm -f"} ])# _LT_FILEUTILS_DEFAULTS # _LT_SETUP # --------- 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 dnl _LT_DECL([], [build_alias], [0], [The build system])dnl _LT_DECL([], [build], [0])dnl _LT_DECL([], [build_os], [0])dnl dnl AC_REQUIRE([AC_PROG_CC])dnl AC_REQUIRE([LT_PATH_LD])dnl AC_REQUIRE([LT_PATH_NM])dnl dnl AC_REQUIRE([AC_PROG_LN_S])dnl test -z "$LN_S" && LN_S="ln -s" _LT_DECL([], [LN_S], [1], [Whether we need soft or hard links])dnl dnl AC_REQUIRE([LT_CMD_MAX_LEN])dnl _LT_DECL([objext], [ac_objext], [0], [Object file suffix (normally "o")])dnl _LT_DECL([], [exeext], [0], [Executable file suffix (normally "")])dnl 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 # commands through without removal of \ escapes INIT. if test -n "\${ZSH_VERSION+set}" ; then setopt NO_GLOB_SUBST fi ]) if test -n "${ZSH_VERSION+set}" ; then setopt NO_GLOB_SUBST fi _LT_CHECK_OBJDIR m4_require([_LT_TAG_COMPILER])dnl case $host_os in aix3*) # AIX sometimes has problems with the GCC collect2 program. For some # reason, if we set the COLLECT_NAMES environment variable, the problems # vanish in a puff of smoke. if test "X${COLLECT_NAMES+set}" != Xset; then COLLECT_NAMES= export COLLECT_NAMES fi ;; esac # Global variables: ofile=libtool can_build_shared=yes # All known linkers require a `.a' archive for static linking (except MSVC, # which needs '.lib'). libext=a with_gnu_ld="$lt_cv_prog_gnu_ld" old_CC="$CC" old_CFLAGS="$CFLAGS" # Set sane defaults for various variables test -z "$CC" && CC=cc test -z "$LTCC" && LTCC=$CC test -z "$LTCFLAGS" && LTCFLAGS=$CFLAGS test -z "$LD" && LD=ld test -z "$ac_objext" && ac_objext=o _LT_CC_BASENAME([$compiler]) # Only perform the check for file, if the check method requires it test -z "$MAGIC_CMD" && MAGIC_CMD=file case $deplibs_check_method in file_magic*) if test "$file_magic_cmd" = '$MAGIC_CMD'; then _LT_PATH_MAGIC fi ;; esac # Use C for the default configuration in the libtool script LT_SUPPORTED_TAG([CC]) _LT_LANG_C_CONFIG _LT_LANG_DEFAULT_CONFIG _LT_CONFIG_COMMANDS ])# _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' # now that we use AC_CONFIG_COMMANDS to generate libtool. Notably, # `config.status' has no value for ac_aux_dir unless we are using Automake, # so we pass a copy along to make sure it has a sensible value anyway. m4_defun([_LT_PROG_LTMAIN], [m4_ifdef([AC_REQUIRE_AUX_FILE], [AC_REQUIRE_AUX_FILE([ltmain.sh])])dnl _LT_CONFIG_LIBTOOL_INIT([ac_aux_dir='$ac_aux_dir']) ltmain="$ac_aux_dir/ltmain.sh" ])# _LT_PROG_LTMAIN ## ------------------------------------- ## ## Accumulate code for creating libtool. ## ## ------------------------------------- ## # So that we can recreate a full libtool script including additional # tags, we accumulate the chunks of code to send to AC_CONFIG_COMMANDS # in macros and then make a single call at the end using the `libtool' # label. # _LT_CONFIG_LIBTOOL_INIT([INIT-COMMANDS]) # ---------------------------------------- # Register INIT-COMMANDS to be passed to AC_CONFIG_COMMANDS later. m4_define([_LT_CONFIG_LIBTOOL_INIT], [m4_ifval([$1], [m4_append([_LT_OUTPUT_LIBTOOL_INIT], [$1 ])])]) # Initialize. m4_define([_LT_OUTPUT_LIBTOOL_INIT]) # _LT_CONFIG_LIBTOOL([COMMANDS]) # ------------------------------ # Register COMMANDS to be passed to AC_CONFIG_COMMANDS later. m4_define([_LT_CONFIG_LIBTOOL], [m4_ifval([$1], [m4_append([_LT_OUTPUT_LIBTOOL_COMMANDS], [$1 ])])]) # Initialize. m4_define([_LT_OUTPUT_LIBTOOL_COMMANDS]) # _LT_CONFIG_SAVE_COMMANDS([COMMANDS], [INIT_COMMANDS]) # ----------------------------------------------------- m4_defun([_LT_CONFIG_SAVE_COMMANDS], [_LT_CONFIG_LIBTOOL([$1]) _LT_CONFIG_LIBTOOL_INIT([$2]) ]) # _LT_FORMAT_COMMENT([COMMENT]) # ----------------------------- # Add leading comment marks to the start of each line, and a trailing # full-stop to the whole comment if one is not present already. m4_define([_LT_FORMAT_COMMENT], [m4_ifval([$1], [ m4_bpatsubst([m4_bpatsubst([$1], [^ *], [# ])], [['`$\]], [\\\&])]m4_bmatch([$1], [[!?.]$], [], [.]) )]) ## ------------------------ ## ## FIXME: Eliminate VARNAME ## ## ------------------------ ## # _LT_DECL([CONFIGNAME], VARNAME, VALUE, [DESCRIPTION], [IS-TAGGED?]) # ------------------------------------------------------------------- # CONFIGNAME is the name given to the value in the libtool script. # VARNAME is the (base) name used in the configure script. # VALUE may be 0, 1 or 2 for a computed quote escaped value based on # VARNAME. Any other value will be used directly. m4_define([_LT_DECL], [lt_if_append_uniq([lt_decl_varnames], [$2], [, ], [lt_dict_add_subkey([lt_decl_dict], [$2], [libtool_name], [m4_ifval([$1], [$1], [$2])]) lt_dict_add_subkey([lt_decl_dict], [$2], [value], [$3]) m4_ifval([$4], [lt_dict_add_subkey([lt_decl_dict], [$2], [description], [$4])]) lt_dict_add_subkey([lt_decl_dict], [$2], [tagged?], [m4_ifval([$5], [yes], [no])])]) ]) # _LT_TAGDECL([CONFIGNAME], VARNAME, VALUE, [DESCRIPTION]) # -------------------------------------------------------- m4_define([_LT_TAGDECL], [_LT_DECL([$1], [$2], [$3], [$4], [yes])]) # lt_decl_tag_varnames([SEPARATOR], [VARNAME1...]) # ------------------------------------------------ m4_define([lt_decl_tag_varnames], [_lt_decl_filter([tagged?], [yes], $@)]) # _lt_decl_filter(SUBKEY, VALUE, [SEPARATOR], [VARNAME1..]) # --------------------------------------------------------- m4_define([_lt_decl_filter], [m4_case([$#], [0], [m4_fatal([$0: too few arguments: $#])], [1], [m4_fatal([$0: too few arguments: $#: $1])], [2], [lt_dict_filter([lt_decl_dict], [$1], [$2], [], lt_decl_varnames)], [3], [lt_dict_filter([lt_decl_dict], [$1], [$2], [$3], lt_decl_varnames)], [lt_dict_filter([lt_decl_dict], $@)])[]dnl ]) # lt_decl_quote_varnames([SEPARATOR], [VARNAME1...]) # -------------------------------------------------- m4_define([lt_decl_quote_varnames], [_lt_decl_filter([value], [1], $@)]) # lt_decl_dquote_varnames([SEPARATOR], [VARNAME1...]) # --------------------------------------------------- m4_define([lt_decl_dquote_varnames], [_lt_decl_filter([value], [2], $@)]) # lt_decl_varnames_tagged([SEPARATOR], [VARNAME1...]) # --------------------------------------------------- m4_define([lt_decl_varnames_tagged], [m4_assert([$# <= 2])dnl _$0(m4_quote(m4_default([$1], [[, ]])), m4_ifval([$2], [[$2]], [m4_dquote(lt_decl_tag_varnames)]), m4_split(m4_normalize(m4_quote(_LT_TAGS)), [ ]))]) m4_define([_lt_decl_varnames_tagged], [m4_ifval([$3], [lt_combine([$1], [$2], [_], $3)])]) # lt_decl_all_varnames([SEPARATOR], [VARNAME1...]) # ------------------------------------------------ m4_define([lt_decl_all_varnames], [_$0(m4_quote(m4_default([$1], [[, ]])), m4_if([$2], [], m4_quote(lt_decl_varnames), m4_quote(m4_shift($@))))[]dnl ]) m4_define([_lt_decl_all_varnames], [lt_join($@, lt_decl_varnames_tagged([$1], lt_decl_tag_varnames([[, ]], m4_shift($@))))dnl ]) # _LT_CONFIG_STATUS_DECLARE([VARNAME]) # ------------------------------------ # Quote a variable value, and forward it to `config.status' so that its # 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 "$][$1" | $SED "$delay_single_quote_subst"`']) # _LT_CONFIG_STATUS_DECLARATIONS # ------------------------------ # We delimit libtool config variables with single quotes, so when # we write them to config.status, we have to be sure to quote all # embedded single quotes properly. In configure, this macro expands # each variable declared with _LT_DECL (and _LT_TAGDECL) into: # # ='`$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)])])]) # _LT_LIBTOOL_TAGS # ---------------- # Output comment and list of tags supported by the script m4_defun([_LT_LIBTOOL_TAGS], [_LT_FORMAT_COMMENT([The names of the tagged configurations supported by this script])dnl available_tags="_LT_TAGS"dnl ]) # _LT_LIBTOOL_DECLARE(VARNAME, [TAG]) # ----------------------------------- # Extract the dictionary values for VARNAME (optionally with TAG) and # expand to a commented shell variable setting: # # # Some comment about what VAR is for. # visible_name=$lt_internal_name m4_define([_LT_LIBTOOL_DECLARE], [_LT_FORMAT_COMMENT(m4_quote(lt_dict_fetch([lt_decl_dict], [$1], [description])))[]dnl m4_pushdef([_libtool_name], m4_quote(lt_dict_fetch([lt_decl_dict], [$1], [libtool_name])))[]dnl m4_case(m4_quote(lt_dict_fetch([lt_decl_dict], [$1], [value])), [0], [_libtool_name=[$]$1], [1], [_libtool_name=$lt_[]$1], [2], [_libtool_name=$lt_[]$1], [_libtool_name=lt_dict_fetch([lt_decl_dict], [$1], [value])])[]dnl m4_ifval([$2], [_$2])[]m4_popdef([_libtool_name])[]dnl ]) # _LT_LIBTOOL_CONFIG_VARS # ----------------------- # Produce commented declarations of non-tagged libtool config variables # suitable for insertion in the LIBTOOL CONFIG section of the `libtool' # script. Tagged libtool config variables (even for the LIBTOOL CONFIG # section) are produced by _LT_LIBTOOL_TAG_VARS. m4_defun([_LT_LIBTOOL_CONFIG_VARS], [m4_foreach([_lt_var], m4_quote(_lt_decl_filter([tagged?], [no], [], lt_decl_varnames)), [m4_n([_LT_LIBTOOL_DECLARE(_lt_var)])])]) # _LT_LIBTOOL_TAG_VARS(TAG) # ------------------------- m4_define([_LT_LIBTOOL_TAG_VARS], [m4_foreach([_lt_var], m4_quote(lt_decl_tag_varnames), [m4_n([_LT_LIBTOOL_DECLARE(_lt_var, [$1])])])]) # _LT_TAGVAR(VARNAME, [TAGNAME]) # ------------------------------ m4_define([_LT_TAGVAR], [m4_ifval([$2], [$1_$2], [$1])]) # _LT_CONFIG_COMMANDS # ------------------- # Send accumulated output to $CONFIG_STATUS. Thanks to the lists of # variables for single and double quote escaping we saved from calls # to _LT_DECL, we can put quote escaped variables declarations # into `config.status', and then the shell code to quote escape them in # for loops in `config.status'. Finally, any additional code accumulated # from calls to _LT_CONFIG_LIBTOOL_INIT is expanded. m4_defun([_LT_CONFIG_COMMANDS], [AC_PROVIDE_IFELSE([LT_OUTPUT], dnl If the libtool generation code has been placed in $CONFIG_LT, dnl instead of duplicating it all over again into config.status, dnl then we will have config.status run $CONFIG_LT later, so it dnl needs to know what name is stored there: [AC_CONFIG_COMMANDS([libtool], [$SHELL $CONFIG_LT || AS_EXIT(1)], [CONFIG_LT='$CONFIG_LT'])], dnl If the libtool generation code is destined for config.status, dnl expand the accumulated commands and init code now: [AC_CONFIG_COMMANDS([libtool], [_LT_OUTPUT_LIBTOOL_COMMANDS], [_LT_OUTPUT_LIBTOOL_COMMANDS_INIT])]) ])#_LT_CONFIG_COMMANDS # Initialize. m4_define([_LT_OUTPUT_LIBTOOL_COMMANDS_INIT], [ # 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 sed_quote_subst='$sed_quote_subst' double_quote_subst='$double_quote_subst' delay_variable_subst='$delay_variable_subst' _LT_CONFIG_STATUS_DECLARATIONS 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 lt_decl_all_varnames([[ \ ]], lt_decl_quote_varnames); do case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in *[[\\\\\\\`\\"\\\$]]*) eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED \\"\\\$sed_quote_subst\\"\\\`\\\\\\"" ;; *) eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\"" ;; esac done # Double-quote double-evaled strings. for var in lt_decl_all_varnames([[ \ ]], lt_decl_dquote_varnames); do case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in *[[\\\\\\\`\\"\\\$]]*) eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED -e \\"\\\$double_quote_subst\\" -e \\"\\\$sed_quote_subst\\" -e \\"\\\$delay_variable_subst\\"\\\`\\\\\\"" ;; *) eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\"" ;; esac done _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 # --------- # This macro allows early generation of the libtool script (before # AC_OUTPUT is called), incase it is used in configure for compilation # tests. AC_DEFUN([LT_OUTPUT], [: ${CONFIG_LT=./config.lt} AC_MSG_NOTICE([creating $CONFIG_LT]) _LT_GENERATED_FILE_INIT(["$CONFIG_LT"], [# Run this file to recreate a libtool stub with the current configuration.]) cat >>"$CONFIG_LT" <<\_LTEOF lt_cl_silent=false exec AS_MESSAGE_LOG_FD>>config.log { echo AS_BOX([Running $as_me.]) } >&AS_MESSAGE_LOG_FD lt_cl_help="\ \`$as_me' creates a local libtool stub from the current configuration, for use in further configure time tests before the real libtool is generated. Usage: $[0] [[OPTIONS]] -h, --help print this help, then exit -V, --version print version number, then exit -q, --quiet do not print progress messages -d, --debug don't remove temporary files Report bugs to ." lt_cl_version="\ m4_ifset([AC_PACKAGE_NAME], [AC_PACKAGE_NAME ])config.lt[]dnl m4_ifset([AC_PACKAGE_VERSION], [ AC_PACKAGE_VERSION]) configured by $[0], generated by m4_PACKAGE_STRING. 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." while test $[#] != 0 do case $[1] in --version | --v* | -V ) echo "$lt_cl_version"; exit 0 ;; --help | --h* | -h ) echo "$lt_cl_help"; exit 0 ;; --debug | --d* | -d ) debug=: ;; --quiet | --q* | --silent | --s* | -q ) lt_cl_silent=: ;; -*) AC_MSG_ERROR([unrecognized option: $[1] Try \`$[0] --help' for more information.]) ;; *) AC_MSG_ERROR([unrecognized argument: $[1] Try \`$[0] --help' for more information.]) ;; esac shift done if $lt_cl_silent; then exec AS_MESSAGE_FD>/dev/null fi _LTEOF cat >>"$CONFIG_LT" <<_LTEOF _LT_OUTPUT_LIBTOOL_COMMANDS_INIT _LTEOF cat >>"$CONFIG_LT" <<\_LTEOF AC_MSG_NOTICE([creating $ofile]) _LT_OUTPUT_LIBTOOL_COMMANDS AS_EXIT(0) _LTEOF chmod +x "$CONFIG_LT" # configure is writing to config.log, but config.lt does its own redirection, # 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. 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 # _LT_CONFIG(TAG) # --------------- # If TAG is the built-in tag, create an initial libtool script with a # default configuration from the untagged config vars. Otherwise add code # to config.status for appending the configuration named by TAG from the # matching tagged config vars. m4_defun([_LT_CONFIG], [m4_require([_LT_FILEUTILS_DEFAULTS])dnl _LT_CONFIG_SAVE_COMMANDS([ m4_define([_LT_TAG], m4_if([$1], [], [C], [$1]))dnl m4_if(_LT_TAG, [C], [ # See if we are running on zsh, and set the options which allow our # commands through without removal of \ escapes. if test -n "${ZSH_VERSION+set}" ; then setopt NO_GLOB_SUBST fi cfgfile="${ofile}T" trap "$RM \"$cfgfile\"; exit 1" 1 2 15 $RM "$cfgfile" cat <<_LT_EOF >> "$cfgfile" #! $SHELL # `$ECHO "$ofile" | sed 's%^.*/%%'` - Provide generalized library-building support services. # Generated automatically by $as_me ($PACKAGE$TIMESTAMP) $VERSION # Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`: # NOTE: Changes made to this file will be lost: look at ltmain.sh. # _LT_COPYING _LT_LIBTOOL_TAGS # ### BEGIN LIBTOOL CONFIG _LT_LIBTOOL_CONFIG_VARS _LT_LIBTOOL_TAG_VARS # ### END LIBTOOL CONFIG _LT_EOF case $host_os in aix3*) cat <<\_LT_EOF >> "$cfgfile" # AIX sometimes has problems with the GCC collect2 program. For some # reason, if we set the COLLECT_NAMES environment variable, the problems # vanish in a puff of smoke. if test "X${COLLECT_NAMES+set}" != Xset; then COLLECT_NAMES= export COLLECT_NAMES fi _LT_EOF ;; esac _LT_PROG_LTMAIN # We use sed instead of cat because bash on DJGPP gets confused if # 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 '$q' "$ltmain" >> "$cfgfile" \ || (rm -f "$cfgfile"; exit 1) _LT_PROG_REPLACE_SHELLFNS mv -f "$cfgfile" "$ofile" || (rm -f "$ofile" && cp "$cfgfile" "$ofile" && rm -f "$cfgfile") chmod +x "$ofile" ], [cat <<_LT_EOF >> "$ofile" dnl Unfortunately we have to use $1 here, since _LT_TAG is not expanded dnl in a comment (ie after a #). # ### BEGIN LIBTOOL TAG CONFIG: $1 _LT_LIBTOOL_TAG_VARS(_LT_TAG) # ### END LIBTOOL TAG CONFIG: $1 _LT_EOF ])dnl /m4_if ], [m4_if([$1], [], [ PACKAGE='$PACKAGE' VERSION='$VERSION' TIMESTAMP='$TIMESTAMP' RM='$RM' ofile='$ofile'], []) ])dnl /_LT_CONFIG_SAVE_COMMANDS ])# _LT_CONFIG # LT_SUPPORTED_TAG(TAG) # --------------------- # Trace this macro to discover what tags are supported by the libtool # --tag option, using: # autoconf --trace 'LT_SUPPORTED_TAG:$1' AC_DEFUN([LT_SUPPORTED_TAG], []) # C support is built-in for now m4_define([_LT_LANG_C_enabled], []) m4_define([_LT_TAGS], []) # LT_LANG(LANG) # ------------- # Enable libtool support for the given language if not already enabled. AC_DEFUN([LT_LANG], [AC_BEFORE([$0], [LT_OUTPUT])dnl 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)], [Windows Resource], [_LT_LANG(RC)], [m4_ifdef([_LT_LANG_]$1[_CONFIG], [_LT_LANG($1)], [m4_fatal([$0: unsupported language: "$1"])])])dnl ])# LT_LANG # _LT_LANG(LANGNAME) # ------------------ m4_defun([_LT_LANG], [m4_ifdef([_LT_LANG_]$1[_enabled], [], [LT_SUPPORTED_TAG([$1])dnl m4_append([_LT_TAGS], [$1 ])dnl m4_define([_LT_LANG_]$1[_enabled], [])dnl _LT_LANG_$1_CONFIG($1)])dnl ])# _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], [AC_PROVIDE_IFELSE([AC_PROG_CXX], [LT_LANG(CXX)], [m4_define([AC_PROG_CXX], defn([AC_PROG_CXX])[LT_LANG(CXX)])]) AC_PROVIDE_IFELSE([AC_PROG_F77], [LT_LANG(F77)], [m4_define([AC_PROG_F77], defn([AC_PROG_F77])[LT_LANG(F77)])]) AC_PROVIDE_IFELSE([AC_PROG_FC], [LT_LANG(FC)], [m4_define([AC_PROG_FC], defn([AC_PROG_FC])[LT_LANG(FC)])]) dnl The call to [A][M_PROG_GCJ] is quoted like that to stop aclocal dnl pulling things in needlessly. AC_PROVIDE_IFELSE([AC_PROG_GCJ], [LT_LANG(GCJ)], [AC_PROVIDE_IFELSE([A][M_PROG_GCJ], [LT_LANG(GCJ)], [AC_PROVIDE_IFELSE([LT_PROG_GCJ], [LT_LANG(GCJ)], [m4_ifdef([AC_PROG_GCJ], [m4_define([AC_PROG_GCJ], defn([AC_PROG_GCJ])[LT_LANG(GCJ)])]) m4_ifdef([A][M_PROG_GCJ], [m4_define([A][M_PROG_GCJ], defn([A][M_PROG_GCJ])[LT_LANG(GCJ)])]) 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)])]) ])# _LT_LANG_DEFAULT_CONFIG # Obsolete macros: AU_DEFUN([AC_LIBTOOL_CXX], [LT_LANG(C++)]) 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 # ---------------- m4_defun([_LT_TAG_COMPILER], [AC_REQUIRE([AC_PROG_CC])dnl _LT_DECL([LTCC], [CC], [1], [A C compiler])dnl _LT_DECL([LTCFLAGS], [CFLAGS], [1], [LTCC compiler flags])dnl _LT_TAGDECL([CC], [compiler], [1], [A language specific compiler])dnl _LT_TAGDECL([with_gcc], [GCC], [0], [Is the compiler the GNU compiler?])dnl # If no C compiler was specified, use CC. LTCC=${LTCC-"$CC"} # If no C compiler flags were specified, use CFLAGS. LTCFLAGS=${LTCFLAGS-"$CFLAGS"} # Allow CC to be a program name with arguments. compiler=$CC ])# _LT_TAG_COMPILER # _LT_COMPILER_BOILERPLATE # ------------------------ # Check for compiler boilerplate output or warnings with # the simple compiler test code. m4_defun([_LT_COMPILER_BOILERPLATE], [m4_require([_LT_DECL_SED])dnl ac_outfile=conftest.$ac_objext echo "$lt_simple_compile_test_code" >conftest.$ac_ext eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err _lt_compiler_boilerplate=`cat conftest.err` $RM conftest* ])# _LT_COMPILER_BOILERPLATE # _LT_LINKER_BOILERPLATE # ---------------------- # Check for linker boilerplate output or warnings with # the simple link test code. m4_defun([_LT_LINKER_BOILERPLATE], [m4_require([_LT_DECL_SED])dnl ac_outfile=conftest.$ac_objext echo "$lt_simple_link_test_code" >conftest.$ac_ext eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err _lt_linker_boilerplate=`cat conftest.err` $RM -r conftest* ])# _LT_LINKER_BOILERPLATE # _LT_REQUIRED_DARWIN_CHECKS # ------------------------- m4_defun_once([_LT_REQUIRED_DARWIN_CHECKS],[ case $host_os in rhapsody* | darwin*) AC_CHECK_TOOL([DSYMUTIL], [dsymutil], [:]) AC_CHECK_TOOL([NMEDIT], [nmedit], [:]) AC_CHECK_TOOL([LIPO], [lipo], [:]) AC_CHECK_TOOL([OTOOL], [otool], [:]) AC_CHECK_TOOL([OTOOL64], [otool64], [:]) _LT_DECL([], [DSYMUTIL], [1], [Tool to manipulate archived DWARF debug symbol files on Mac OS X]) _LT_DECL([], [NMEDIT], [1], [Tool to change global to local symbols on Mac OS X]) _LT_DECL([], [LIPO], [1], [Tool to manipulate fat objects and archives on Mac OS X]) _LT_DECL([], [OTOOL], [1], [ldd/readelf like tool for Mach-O binaries on Mac OS X]) _LT_DECL([], [OTOOL64], [1], [ldd/readelf like tool for 64 bit Mach-O binaries on Mac OS X 10.4]) AC_CACHE_CHECK([for -single_module linker flag],[lt_cv_apple_cc_single_mod], [lt_cv_apple_cc_single_mod=no if test -z "${LT_MULTI_MODULE}"; then # By default we will add the -single_module flag. You can override # by either setting the environment variable LT_MULTI_MODULE # non-empty at configure time, or by adding -multi_module to the # link flags. rm -rf libconftest.dylib* echo "int foo(void){return 1;}" > conftest.c echo "$LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \ -dynamiclib -Wl,-single_module conftest.c" >&AS_MESSAGE_LOG_FD $LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \ -dynamiclib -Wl,-single_module conftest.c 2>conftest.err _lt_result=$? # 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 fi 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 save_LDFLAGS=$LDFLAGS echo "_main" > conftest.sym LDFLAGS="$LDFLAGS -Wl,-exported_symbols_list,conftest.sym" AC_LINK_IFELSE([AC_LANG_PROGRAM([],[])], [lt_cv_ld_exported_symbols_list=yes], [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' ;; darwin1.*) _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;; darwin*) # darwin 5.x on # if running on 10.5 or later, the deployment target defaults # to the OS version, if on x86, and 10.4, the deployment # target defaults to 10.4. Don't you love it? case ${MACOSX_DEPLOYMENT_TARGET-10.0},$host in 10.0,*86*-darwin8*|10.0,*-darwin[[91]]*) _lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;; 10.[[012]]*) _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;; 10.*) _lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;; esac ;; esac if test "$lt_cv_apple_cc_single_mod" = "yes"; then _lt_dar_single_mod='$single_module' fi if test "$lt_cv_ld_exported_symbols_list" = "yes"; then _lt_dar_export_syms=' ${wl}-exported_symbols_list,$output_objdir/${libname}-symbols.expsym' else _lt_dar_export_syms='~$NMEDIT -s $output_objdir/${libname}-symbols.expsym ${lib}' fi if test "$DSYMUTIL" != ":" && test "$lt_cv_ld_force_load" = "no"; then _lt_dsymutil='~$DSYMUTIL $lib || :' else _lt_dsymutil= fi ;; esac ]) # _LT_DARWIN_LINKER_FEATURES([TAG]) # --------------------------------- # Checks for linker and compiler features on darwin m4_defun([_LT_DARWIN_LINKER_FEATURES], [ m4_require([_LT_REQUIRED_DARWIN_CHECKS]) _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_automatic, $1)=yes _LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported 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 ifort*) _lt_dar_can_shared=yes ;; *) _lt_dar_can_shared=$GCC ;; esac if test "$_lt_dar_can_shared" = "yes"; then 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}" _LT_TAGVAR(module_expsym_cmds, $1)="sed -e 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dar_export_syms}${_lt_dsymutil}" m4_if([$1], [CXX], [ if test "$lt_cv_apple_cc_single_mod" != "yes"; then _LT_TAGVAR(archive_cmds, $1)="\$CC -r -keep_private_externs -nostdlib -o \${lib}-master.o \$libobjs~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \${lib}-master.o \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring${_lt_dsymutil}" _LT_TAGVAR(archive_expsym_cmds, $1)="sed 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC -r -keep_private_externs -nostdlib -o \${lib}-master.o \$libobjs~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \${lib}-master.o \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring${_lt_dar_export_syms}${_lt_dsymutil}" fi ],[]) else _LT_TAGVAR(ld_shlibs, $1)=no fi ]) # _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 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], [m4_divert_text([M4SH-INIT], [$1 ])])# _LT_SHELL_INIT # _LT_PROG_ECHO_BACKSLASH # ----------------------- # 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], [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 # 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*) AC_MSG_RESULT([printf]) ;; print*) AC_MSG_RESULT([print -r]) ;; *) AC_MSG_RESULT([cat]) ;; esac 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" )])]) _LT_DECL([], [SHELL], [1], [Shell to use when invoking shell scripts]) _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], [AC_ARG_ENABLE([libtool-lock], [AS_HELP_STRING([--disable-libtool-lock], [avoid locking (might break parallel builds)])]) test "x$enable_libtool_lock" != xno && enable_libtool_lock=yes # Some flags need to be propagated to the compiler or linker for good # libtool support. case $host in ia64-*-hpux*) # 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.$ac_objext` in *ELF-32*) HPUX_IA64_MODE="32" ;; *ELF-64*) HPUX_IA64_MODE="64" ;; esac fi rm -rf conftest* ;; *-*-irix6*) # Find out which ABI we are using. 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 *32-bit*) LD="${LD-ld} -melf32bsmip" ;; *N32*) LD="${LD-ld} -melf32bmipn32" ;; *64-bit*) LD="${LD-ld} -melf64bmip" ;; esac else case `/usr/bin/file conftest.$ac_objext` in *32-bit*) LD="${LD-ld} -32" ;; *N32*) LD="${LD-ld} -n32" ;; *64-bit*) LD="${LD-ld} -64" ;; esac fi fi rm -rf conftest* ;; x86_64-*kfreebsd*-gnu|x86_64-*linux*|ppc*-*linux*|powerpc*-*linux*| \ s390*-*linux*|s390*-*tpf*|sparc*-*linux*) # 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 *32-bit*) case $host in x86_64-*kfreebsd*-gnu) LD="${LD-ld} -m elf_i386_fbsd" ;; x86_64-*linux*) LD="${LD-ld} -m elf_i386" ;; ppc64-*linux*|powerpc64-*linux*) LD="${LD-ld} -m elf32ppclinux" ;; s390x-*linux*) LD="${LD-ld} -m elf_s390" ;; sparc64-*linux*) LD="${LD-ld} -m elf32_sparc" ;; esac ;; *64-bit*) case $host in x86_64-*kfreebsd*-gnu) LD="${LD-ld} -m elf_x86_64_fbsd" ;; x86_64-*linux*) LD="${LD-ld} -m elf_x86_64" ;; ppc*-*linux*|powerpc*-*linux*) LD="${LD-ld} -m elf64ppc" ;; s390*-*linux*|s390*-*tpf*) LD="${LD-ld} -m elf64_s390" ;; sparc*-*linux*) LD="${LD-ld} -m elf64_sparc" ;; esac ;; esac fi rm -rf conftest* ;; *-*-sco3.2v5*) # On SCO OpenServer 5, we need -belf to get full-featured binaries. SAVE_CFLAGS="$CFLAGS" CFLAGS="$CFLAGS -belf" AC_CACHE_CHECK([whether the C compiler needs -belf], lt_cv_cc_needs_belf, [AC_LANG_PUSH(C) AC_LINK_IFELSE([AC_LANG_PROGRAM([[]],[[]])],[lt_cv_cc_needs_belf=yes],[lt_cv_cc_needs_belf=no]) AC_LANG_POP]) if test x"$lt_cv_cc_needs_belf" != x"yes"; then # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf CFLAGS="$SAVE_CFLAGS" fi ;; *-*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*) 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" fi ;; esac ;; esac fi rm -rf conftest* ;; esac need_locks="$enable_libtool_lock" ])# _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], [_LT_PROG_AR AC_CHECK_TOOL(STRIP, strip, :) test -z "$STRIP" && STRIP=: _LT_DECL([], [STRIP], [1], [A symbol stripping program]) AC_CHECK_TOOL(RANLIB, ranlib, :) test -z "$RANLIB" && RANLIB=: _LT_DECL([], [RANLIB], [1], [Commands used to install an old-style archive]) # Determine commands to create old-style static archives. old_archive_cmds='$AR $AR_FLAGS $oldlib$oldobjs' old_postinstall_cmds='chmod 644 $oldlib' old_postuninstall_cmds= if test -n "$RANLIB"; then case $host_os in openbsd*) old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB -t \$tool_oldlib" ;; *) old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB \$tool_oldlib" ;; esac 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 # _LT_COMPILER_OPTION(MESSAGE, VARIABLE-NAME, FLAGS, # [OUTPUT-FILE], [ACTION-SUCCESS], [ACTION-FAILURE]) # ---------------------------------------------------------------- # Check whether the given compiler option works AC_DEFUN([_LT_COMPILER_OPTION], [m4_require([_LT_FILEUTILS_DEFAULTS])dnl m4_require([_LT_DECL_SED])dnl AC_CACHE_CHECK([$1], [$2], [$2=no m4_if([$4], , [ac_outfile=conftest.$ac_objext], [ac_outfile=$4]) echo "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="$3" # Insert the option either (1) after the last *FLAGS variable, or # (2) before a word containing "conftest.", or (3) at the end. # Note that $ac_compile itself does not contain backslashes and begins # with a dollar sign (not a hyphen), so the echo should work correctly. # The option is referenced via a variable to avoid confusing sed. lt_compile=`echo "$ac_compile" | $SED \ -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:$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:$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 "$_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 fi fi $RM conftest* ]) if test x"[$]$2" = xyes; then m4_if([$5], , :, [$5]) else m4_if([$6], , :, [$6]) fi ])# _LT_COMPILER_OPTION # Old name: AU_ALIAS([AC_LIBTOOL_COMPILER_OPTION], [_LT_COMPILER_OPTION]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_LIBTOOL_COMPILER_OPTION], []) # _LT_LINKER_OPTION(MESSAGE, VARIABLE-NAME, FLAGS, # [ACTION-SUCCESS], [ACTION-FAILURE]) # ---------------------------------------------------- # Check whether the given linker option works AC_DEFUN([_LT_LINKER_OPTION], [m4_require([_LT_FILEUTILS_DEFAULTS])dnl m4_require([_LT_DECL_SED])dnl AC_CACHE_CHECK([$1], [$2], [$2=no save_LDFLAGS="$LDFLAGS" LDFLAGS="$LDFLAGS $3" 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>&AS_MESSAGE_LOG_FD $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 fi else $2=yes fi fi $RM -r conftest* LDFLAGS="$save_LDFLAGS" ]) if test x"[$]$2" = xyes; then m4_if([$4], , :, [$4]) else m4_if([$5], , :, [$5]) fi ])# _LT_LINKER_OPTION # Old name: AU_ALIAS([AC_LIBTOOL_LINKER_OPTION], [_LT_LINKER_OPTION]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_LIBTOOL_LINKER_OPTION], []) # LT_CMD_MAX_LEN #--------------- AC_DEFUN([LT_CMD_MAX_LEN], [AC_REQUIRE([AC_CANONICAL_HOST])dnl # find the maximum length of command line arguments AC_MSG_CHECKING([the maximum length of command line arguments]) AC_CACHE_VAL([lt_cv_sys_max_cmd_len], [dnl i=0 teststring="ABCD" case $build_os in msdosdjgpp*) # On DJGPP, this test can blow up pretty badly due to problems in libc # (any single argument exceeding 2000 bytes causes a buffer overrun # during glob expansion). Even if it were fixed, the result of this # check would be larger than it should be. lt_cv_sys_max_cmd_len=12288; # 12K is about right ;; gnu*) # Under GNU Hurd, this test is not required because there is # no limit to the length of command line arguments. # Libtool will interpret -1 as no limit whatsoever lt_cv_sys_max_cmd_len=-1; ;; cygwin* | mingw* | cegcc*) # On Win9x/ME, this test blows up -- it succeeds, but takes # about 5 minutes as the teststring grows exponentially. # Worse, since 9x/ME are not pre-emptively multitasking, # you end up with a "frozen" computer, even though with patience # the test eventually succeeds (with a max line length of 256k). # Instead, let's just punt: use the minimum linelength reported by # all of the supported platforms: 8192 (on NT/2K/XP). 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. lt_cv_sys_max_cmd_len=8192; ;; netbsd* | freebsd* | openbsd* | darwin* | dragonfly*) # This has been around since 386BSD, at least. Likely further. if test -x /sbin/sysctl; then lt_cv_sys_max_cmd_len=`/sbin/sysctl -n kern.argmax` elif test -x /usr/sbin/sysctl; then lt_cv_sys_max_cmd_len=`/usr/sbin/sysctl -n kern.argmax` else lt_cv_sys_max_cmd_len=65536 # usable default for all BSDs fi # And add a safety zone lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4` lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3` ;; interix*) # We know the value 262144 and hardcode it with a safety zone (like BSD) 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 # nice to cause kernel panics so lets avoid the loop below. # First set a reasonable default. lt_cv_sys_max_cmd_len=16384 # if test -x /sbin/sysconfig; then case `/sbin/sysconfig -q proc exec_disable_arg_limit` in *1*) lt_cv_sys_max_cmd_len=-1 ;; esac fi ;; sco3.2v5*) lt_cv_sys_max_cmd_len=102400 ;; sysv5* | sco5v6* | sysv4.2uw2*) kargmax=`grep ARG_MAX /etc/conf/cf.d/stune 2>/dev/null` if test -n "$kargmax"; then lt_cv_sys_max_cmd_len=`echo $kargmax | sed 's/.*[[ ]]//'` else lt_cv_sys_max_cmd_len=32768 fi ;; *) lt_cv_sys_max_cmd_len=`(getconf ARG_MAX) 2> /dev/null` if test -n "$lt_cv_sys_max_cmd_len"; then lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4` lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3` else # Make teststring a little bigger before we do anything with it. # a 1K string should be a reasonable start. for i in 1 2 3 4 5 6 7 8 ; do teststring=$teststring$teststring done SHELL=${SHELL-${CONFIG_SHELL-/bin/sh}} # 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"`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` teststring=$teststring$teststring done # Only check the string length outside the loop. lt_cv_sys_max_cmd_len=`expr "X$teststring" : ".*" 2>&1` teststring= # Add a significant safety factor because C++ compilers can tack on # massive amounts of additional arguments before passing them to the # linker. It appears as though 1/2 is a usable value. lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 2` fi ;; esac ]) if test -n $lt_cv_sys_max_cmd_len ; then AC_MSG_RESULT($lt_cv_sys_max_cmd_len) else AC_MSG_RESULT(none) fi max_cmd_len=$lt_cv_sys_max_cmd_len _LT_DECL([], [max_cmd_len], [0], [What is the maximum length of a command?]) ])# LT_CMD_MAX_LEN # Old name: AU_ALIAS([AC_LIBTOOL_SYS_MAX_CMD_LEN], [LT_CMD_MAX_LEN]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_LIBTOOL_SYS_MAX_CMD_LEN], []) # _LT_HEADER_DLFCN # ---------------- m4_defun([_LT_HEADER_DLFCN], [AC_CHECK_HEADERS([dlfcn.h], [], [], [AC_INCLUDES_DEFAULT])dnl ])# _LT_HEADER_DLFCN # _LT_TRY_DLOPEN_SELF (ACTION-IF-TRUE, ACTION-IF-TRUE-W-USCORE, # ACTION-IF-FALSE, ACTION-IF-CROSS-COMPILING) # ---------------------------------------------------------------- m4_defun([_LT_TRY_DLOPEN_SELF], [m4_require([_LT_HEADER_DLFCN])dnl if test "$cross_compiling" = yes; then : [$4] else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<_LT_EOF [#line $LINENO "configure" #include "confdefs.h" #if HAVE_DLFCN_H #include #endif #include #ifdef RTLD_GLOBAL # define LT_DLGLOBAL RTLD_GLOBAL #else # ifdef DL_GLOBAL # define LT_DLGLOBAL DL_GLOBAL # else # define LT_DLGLOBAL 0 # endif #endif /* We may have to define LT_DLLAZY_OR_NOW in the command line if we find out it does not work in some platform. */ #ifndef LT_DLLAZY_OR_NOW # ifdef RTLD_LAZY # define LT_DLLAZY_OR_NOW RTLD_LAZY # else # ifdef DL_LAZY # define LT_DLLAZY_OR_NOW DL_LAZY # else # ifdef RTLD_NOW # define LT_DLLAZY_OR_NOW RTLD_NOW # else # ifdef DL_NOW # define LT_DLLAZY_OR_NOW DL_NOW # else # define LT_DLLAZY_OR_NOW 0 # endif # endif # endif # endif #endif /* 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); int status = $lt_dlunknown; if (self) { if (dlsym (self,"fnord")) status = $lt_dlno_uscore; else { if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore; else puts (dlerror ()); } /* dlclose (self); */ } else puts (dlerror ()); return status; }] _LT_EOF if AC_TRY_EVAL(ac_link) && test -s conftest${ac_exeext} 2>/dev/null; then (./conftest; exit; ) >&AS_MESSAGE_LOG_FD 2>/dev/null lt_status=$? case x$lt_status in x$lt_dlno_uscore) $1 ;; x$lt_dlneed_uscore) $2 ;; x$lt_dlunknown|x*) $3 ;; esac else : # compilation failed $3 fi fi rm -fr conftest* ])# _LT_TRY_DLOPEN_SELF # LT_SYS_DLOPEN_SELF # ------------------ AC_DEFUN([LT_SYS_DLOPEN_SELF], [m4_require([_LT_HEADER_DLFCN])dnl if test "x$enable_dlopen" != xyes; then enable_dlopen=unknown enable_dlopen_self=unknown enable_dlopen_self_static=unknown else lt_cv_dlopen=no lt_cv_dlopen_libs= case $host_os in beos*) lt_cv_dlopen="load_add_on" lt_cv_dlopen_libs= lt_cv_dlopen_self=yes ;; mingw* | pw32* | cegcc*) lt_cv_dlopen="LoadLibrary" lt_cv_dlopen_libs= ;; cygwin*) lt_cv_dlopen="dlopen" lt_cv_dlopen_libs= ;; darwin*) # if libdl is installed we need to link against it AC_CHECK_LIB([dl], [dlopen], [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"],[ lt_cv_dlopen="dyld" lt_cv_dlopen_libs= lt_cv_dlopen_self=yes ]) ;; *) AC_CHECK_FUNC([shl_load], [lt_cv_dlopen="shl_load"], [AC_CHECK_LIB([dld], [shl_load], [lt_cv_dlopen="shl_load" lt_cv_dlopen_libs="-ldld"], [AC_CHECK_FUNC([dlopen], [lt_cv_dlopen="dlopen"], [AC_CHECK_LIB([dl], [dlopen], [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"], [AC_CHECK_LIB([svld], [dlopen], [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-lsvld"], [AC_CHECK_LIB([dld], [dld_link], [lt_cv_dlopen="dld_link" lt_cv_dlopen_libs="-ldld"]) ]) ]) ]) ]) ]) ;; esac if test "x$lt_cv_dlopen" != xno; then enable_dlopen=yes else enable_dlopen=no fi case $lt_cv_dlopen in dlopen) save_CPPFLAGS="$CPPFLAGS" test "x$ac_cv_header_dlfcn_h" = xyes && CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H" save_LDFLAGS="$LDFLAGS" wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\" save_LIBS="$LIBS" LIBS="$lt_cv_dlopen_libs $LIBS" AC_CACHE_CHECK([whether a program can dlopen itself], lt_cv_dlopen_self, [dnl _LT_TRY_DLOPEN_SELF( lt_cv_dlopen_self=yes, lt_cv_dlopen_self=yes, lt_cv_dlopen_self=no, lt_cv_dlopen_self=cross) ]) if test "x$lt_cv_dlopen_self" = xyes; then wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $lt_prog_compiler_static\" AC_CACHE_CHECK([whether a statically linked program can dlopen itself], lt_cv_dlopen_self_static, [dnl _LT_TRY_DLOPEN_SELF( lt_cv_dlopen_self_static=yes, lt_cv_dlopen_self_static=yes, lt_cv_dlopen_self_static=no, lt_cv_dlopen_self_static=cross) ]) fi CPPFLAGS="$save_CPPFLAGS" LDFLAGS="$save_LDFLAGS" LIBS="$save_LIBS" ;; esac case $lt_cv_dlopen_self in yes|no) enable_dlopen_self=$lt_cv_dlopen_self ;; *) enable_dlopen_self=unknown ;; esac case $lt_cv_dlopen_self_static in yes|no) enable_dlopen_self_static=$lt_cv_dlopen_self_static ;; *) enable_dlopen_self_static=unknown ;; esac fi _LT_DECL([dlopen_support], [enable_dlopen], [0], [Whether dlopen is supported]) _LT_DECL([dlopen_self], [enable_dlopen_self], [0], [Whether dlopen of programs is supported]) _LT_DECL([dlopen_self_static], [enable_dlopen_self_static], [0], [Whether dlopen of statically linked programs is supported]) ])# LT_SYS_DLOPEN_SELF # Old name: AU_ALIAS([AC_LIBTOOL_DLOPEN_SELF], [LT_SYS_DLOPEN_SELF]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_LIBTOOL_DLOPEN_SELF], []) # _LT_COMPILER_C_O([TAGNAME]) # --------------------------- # Check to see if options -c and -o are simultaneously supported by compiler. # This macro does not hard code the compiler like AC_PROG_CC_C_O. m4_defun([_LT_COMPILER_C_O], [m4_require([_LT_DECL_SED])dnl m4_require([_LT_FILEUTILS_DEFAULTS])dnl m4_require([_LT_TAG_COMPILER])dnl AC_CACHE_CHECK([if $compiler supports -c -o file.$ac_objext], [_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)], [_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)=no $RM -r conftest 2>/dev/null mkdir conftest cd conftest mkdir out echo "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="-o out/conftest2.$ac_objext" # Insert the option either (1) after the last *FLAGS variable, or # (2) before a word containing "conftest.", or (3) at the end. # Note that $ac_compile itself does not contain backslashes and begins # with a dollar sign (not a hyphen), so the echo should work correctly. lt_compile=`echo "$ac_compile" | $SED \ -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:$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:$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 "$_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 fi fi chmod u+w . 2>&AS_MESSAGE_LOG_FD $RM conftest* # SGI C++ compiler will create directory out/ii_files/ for # template instantiation test -d out/ii_files && $RM out/ii_files/* && rmdir out/ii_files $RM out/* && rmdir out cd .. $RM -r conftest $RM conftest* ]) _LT_TAGDECL([compiler_c_o], [lt_cv_prog_compiler_c_o], [1], [Does compiler simultaneously support -c and -o options?]) ])# _LT_COMPILER_C_O # _LT_COMPILER_FILE_LOCKS([TAGNAME]) # ---------------------------------- # Check to see if we can do hard links to lock some files if needed m4_defun([_LT_COMPILER_FILE_LOCKS], [m4_require([_LT_ENABLE_LOCK])dnl m4_require([_LT_FILEUTILS_DEFAULTS])dnl _LT_COMPILER_C_O([$1]) hard_links="nottested" if test "$_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)" = no && test "$need_locks" != no; then # do not overwrite the value of need_locks provided by the user AC_MSG_CHECKING([if we can lock with hard links]) hard_links=yes $RM conftest* ln conftest.a conftest.b 2>/dev/null && hard_links=no touch conftest.a ln conftest.a conftest.b 2>&5 || hard_links=no ln conftest.a conftest.b 2>/dev/null && hard_links=no AC_MSG_RESULT([$hard_links]) if test "$hard_links" = no; then AC_MSG_WARN([`$CC' does not support `-c -o', so `make -j' may be unsafe]) need_locks=warn fi else need_locks=no fi _LT_DECL([], [need_locks], [1], [Must we lock files when doing compilation?]) ])# _LT_COMPILER_FILE_LOCKS # _LT_CHECK_OBJDIR # ---------------- m4_defun([_LT_CHECK_OBJDIR], [AC_CACHE_CHECK([for objdir], [lt_cv_objdir], [rm -f .libs 2>/dev/null mkdir .libs 2>/dev/null if test -d .libs; then lt_cv_objdir=.libs else # MS-DOS does not allow filenames that begin with a dot. lt_cv_objdir=_libs fi rmdir .libs 2>/dev/null]) objdir=$lt_cv_objdir _LT_DECL([], [objdir], [0], [The name of the directory that contains temporary libtool files])dnl m4_pattern_allow([LT_OBJDIR])dnl AC_DEFINE_UNQUOTED(LT_OBJDIR, "$lt_cv_objdir/", [Define to the sub-directory in which libtool stores uninstalled libraries.]) ])# _LT_CHECK_OBJDIR # _LT_LINKER_HARDCODE_LIBPATH([TAGNAME]) # -------------------------------------- # Check hardcoding attributes. m4_defun([_LT_LINKER_HARDCODE_LIBPATH], [AC_MSG_CHECKING([how to hardcode library paths into programs]) _LT_TAGVAR(hardcode_action, $1)= if test -n "$_LT_TAGVAR(hardcode_libdir_flag_spec, $1)" || test -n "$_LT_TAGVAR(runpath_var, $1)" || test "X$_LT_TAGVAR(hardcode_automatic, $1)" = "Xyes" ; then # We can hardcode non-existent directories. if test "$_LT_TAGVAR(hardcode_direct, $1)" != no && # If the only mechanism to avoid hardcoding is shlibpath_var, we # have to relink, otherwise we might link with an installed library # when we should be linking with a yet-to-be-installed one ## test "$_LT_TAGVAR(hardcode_shlibpath_var, $1)" != no && test "$_LT_TAGVAR(hardcode_minus_L, $1)" != no; then # Linking always hardcodes the temporary library directory. _LT_TAGVAR(hardcode_action, $1)=relink else # We can link without hardcoding, and we can hardcode nonexisting dirs. _LT_TAGVAR(hardcode_action, $1)=immediate fi else # We cannot hardcode anything, or else we can only hardcode existing # directories. _LT_TAGVAR(hardcode_action, $1)=unsupported fi AC_MSG_RESULT([$_LT_TAGVAR(hardcode_action, $1)]) if test "$_LT_TAGVAR(hardcode_action, $1)" = relink || test "$_LT_TAGVAR(inherit_rpath, $1)" = yes; then # Fast installation is not supported enable_fast_install=no elif test "$shlibpath_overrides_runpath" = yes || test "$enable_shared" = no; then # Fast installation is not necessary enable_fast_install=needless fi _LT_TAGDECL([], [hardcode_action], [0], [How to hardcode a shared library path into an executable]) ])# _LT_LINKER_HARDCODE_LIBPATH # _LT_CMD_STRIPLIB # ---------------- m4_defun([_LT_CMD_STRIPLIB], [m4_require([_LT_DECL_EGREP]) striplib= old_striplib= AC_MSG_CHECKING([whether stripping libraries is possible]) if test -n "$STRIP" && $STRIP -V 2>&1 | $GREP "GNU strip" >/dev/null; then test -z "$old_striplib" && old_striplib="$STRIP --strip-debug" test -z "$striplib" && striplib="$STRIP --strip-unneeded" AC_MSG_RESULT([yes]) else # FIXME - insert some real tests, host_os isn't really good enough case $host_os in darwin*) if test -n "$STRIP" ; then striplib="$STRIP -x" old_striplib="$STRIP -S" AC_MSG_RESULT([yes]) else AC_MSG_RESULT([no]) fi ;; *) AC_MSG_RESULT([no]) ;; esac fi _LT_DECL([], [old_striplib], [1], [Commands to strip libraries]) _LT_DECL([], [striplib], [1]) ])# _LT_CMD_STRIPLIB # _LT_SYS_DYNAMIC_LINKER([TAG]) # ----------------------------- # PORTME Fill in your ld.so characteristics m4_defun([_LT_SYS_DYNAMIC_LINKER], [AC_REQUIRE([AC_CANONICAL_HOST])dnl m4_require([_LT_DECL_EGREP])dnl 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], [], [ if test "$GCC" = yes; then case $host_os in darwin*) lt_awk_arg="/^libraries:/,/LR/" ;; *) lt_awk_arg="/^libraries:/" ;; esac 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 '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= lt_multi_os_dir=`$CC $CPPFLAGS $CFLAGS $LDFLAGS -print-multi-os-directory 2>/dev/null` for lt_sys_path in $lt_search_path_spec; do if test -d "$lt_sys_path/$lt_multi_os_dir"; then lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path/$lt_multi_os_dir" else test -d "$lt_sys_path" && \ 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 ' BEGIN {RS=" "; FS="/|\n";} { lt_foo=""; lt_count=0; for (lt_i = NF; lt_i > 0; lt_i--) { if ($lt_i != "" && $lt_i != ".") { if ($lt_i == "..") { lt_count++; } else { if (lt_count == 0) { lt_foo="/" $lt_i lt_foo; } else { lt_count--; } } } } if (lt_foo != "") { lt_freq[[lt_foo]]++; } if (lt_freq[[lt_foo]] == 1) { print lt_foo; } }'` # 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]) library_names_spec= libname_spec='lib$name' soname_spec= shrext_cmds=".so" postinstall_cmds= postuninstall_cmds= finish_cmds= finish_eval= shlibpath_var= shlibpath_overrides_runpath=unknown version_type=none dynamic_linker="$host_os ld.so" sys_lib_dlsearch_path_spec="/lib /usr/lib" need_lib_prefix=unknown hardcode_into_libs=no # when you set need_version to no, make sure it does not cause -set_version # flags to be left without arguments need_version=unknown case $host_os in aix3*) 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 # AIX 3 has no versioning support, so we append a major version to the name. soname_spec='${libname}${release}${shared_ext}$major' ;; aix[[4-9]]*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no hardcode_into_libs=yes if test "$host_cpu" = ia64; then # AIX 5 supports IA64 library_names_spec='${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext}$versuffix $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH else # With GCC up to 2.95.x, collect2 would create an import file # for dependence libraries. The import file would start with # the line `#! .'. This would cause the generated library to # depend on `.', always an invalid library. This was fixed in # development snapshots of GCC prior to 3.0. case $host_os in aix4 | aix4.[[01]] | aix4.[[01]].*) if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)' echo ' yes ' echo '#endif'; } | ${CC} -E - | $GREP yes > /dev/null; then : else can_build_shared=no fi ;; esac # AIX (on Power*) has no versioning support, so currently we can not hardcode correct # soname into executable. Probably we can add versioning support to # collect2, so additional links can be useful in future. if test "$aix_use_runtimelinking" = yes; then # If using run time linking (on AIX 4.2 or later) use lib.so # instead of lib.a to let people know that these are not # typical AIX shared libraries. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' else # We preserve .a as extension for shared libraries through AIX4.2 # and later when we are not doing run time linking. library_names_spec='${libname}${release}.a $libname.a' soname_spec='${libname}${release}${shared_ext}$major' fi shlibpath_var=LIBPATH fi ;; amigaos*) case $host_cpu in powerpc) # Since July 2007 AmigaOS4 officially supports .so libraries. # When compiling the executable, add -use-dynld -Lsobjs: to the compileline. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' ;; 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=`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 ;; beos*) library_names_spec='${libname}${shared_ext}' dynamic_linker="$host_os ld.so" shlibpath_var=LIBRARY_PATH ;; bsdi[[45]]*) 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' finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir' shlibpath_var=LD_LIBRARY_PATH sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib" sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib" # the default ld.so.conf also contains /usr/contrib/lib and # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow # libtool to hard-code these into programs ;; cygwin* | mingw* | pw32* | cegcc*) version_type=windows shrext_cmds=".dll" need_version=no need_lib_prefix=no 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}`~ 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~ chmod a+x \$dldir/$dlname~ if test -n '\''$stripme'\'' && test -n '\''$striplib'\''; then eval '\''$striplib \$dldir/$dlname'\'' || exit \$?; fi' postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ dlpath=$dir/\$dldll~ $RM \$dlpath' shlibpath_overrides_runpath=yes case $host_os in 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}' 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}' ;; 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 # FIXME: first we should search . and the directory the executable is in shlibpath_var=PATH ;; darwin* | rhapsody*) dynamic_linker="$host_os dyld" version_type=darwin need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${major}$shared_ext ${libname}$shared_ext' soname_spec='${libname}${release}${major}$shared_ext' shlibpath_overrides_runpath=yes shlibpath_var=DYLD_LIBRARY_PATH shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`' m4_if([$1], [],[ sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/local/lib"]) sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib' ;; dgux*) 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 ;; freebsd* | dragonfly*) # DragonFly does not have aout. When/if they implement a new # versioning mechanism, adjust this. if test -x /usr/bin/objformat; then objformat=`/usr/bin/objformat` else case $host_os in freebsd[[23]].*) objformat=aout ;; *) objformat=elf ;; esac fi version_type=freebsd-$objformat case $version_type in freebsd-elf*) library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}' need_version=no need_lib_prefix=no ;; freebsd-*) library_names_spec='${libname}${release}${shared_ext}$versuffix $libname${shared_ext}$versuffix' need_version=yes ;; esac shlibpath_var=LD_LIBRARY_PATH case $host_os in freebsd2.*) shlibpath_overrides_runpath=yes ;; freebsd3.[[01]]* | freebsdelf3.[[01]]*) shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; freebsd3.[[2-9]]* | freebsdelf3.[[2-9]]* | \ freebsd4.[[0-5]] | freebsdelf4.[[0-5]] | freebsd4.1.1 | freebsdelf4.1.1) shlibpath_overrides_runpath=no hardcode_into_libs=yes ;; *) # from 4.6 on, and DragonFly shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; esac ;; 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}' 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 ;; hpux9* | hpux10* | hpux11*) # Give a soname corresponding to the major version so that dld.sl refuses to # link against other versions. version_type=sunos need_lib_prefix=no need_version=no case $host_cpu in ia64*) shrext_cmds='.so' hardcode_into_libs=yes dynamic_linker="$host_os dld.so" shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' if test "X$HPUX_IA64_MODE" = X32; then sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib" else sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64" fi sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec ;; hppa*64*) shrext_cmds='.sl' hardcode_into_libs=yes dynamic_linker="$host_os dld.sl" shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64" sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec ;; *) shrext_cmds='.sl' dynamic_linker="$host_os dld.sl" shlibpath_var=SHLIB_PATH shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' ;; esac # 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 # 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' dynamic_linker='Interix 3.x ld.so.1 (PE, like ELF)' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes ;; irix5* | irix6* | nonstopux*) case $host_os in nonstopux*) version_type=nonstopux ;; *) if test "$lt_cv_prog_gnu_ld" = yes; then version_type=linux # correct to gnu/linux during the next big refactor else version_type=irix fi ;; esac need_lib_prefix=no need_version=no soname_spec='${libname}${release}${shared_ext}$major' library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext} $libname${shared_ext}' case $host_os in irix5* | nonstopux*) libsuff= shlibsuff= ;; *) case $LD in # libtool.m4 will add one of these switches to LD *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ") libsuff= shlibsuff= libmagic=32-bit;; *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ") libsuff=32 shlibsuff=N32 libmagic=N32;; *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ") libsuff=64 shlibsuff=64 libmagic=64-bit;; *) libsuff= shlibsuff= libmagic=never-match;; esac ;; esac shlibpath_var=LD_LIBRARY${shlibsuff}_PATH shlibpath_overrides_runpath=no sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}" sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}" hardcode_into_libs=yes ;; # No shared lib support for Linux oldld, aout, or coff. linux*oldld* | linux*aout* | linux*coff*) dynamic_linker=no ;; # 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}' soname_spec='${libname}${release}${shared_ext}$major' 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 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 # 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;s/"//g;/^$/d' | tr '\n' ' '` sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra" fi # We used to test for /lib/ld.so.1 and disable shared libraries on # powerpc, because MkLinux only supported shared libraries with the # GNU dynamic linker. Since this was broken with cross compilers, # most powerpc-linux boxes support dynamic linking these days and # people can always --disable-shared, the test was removed, and we # assume the GNU/Linux dynamic linker is in use. dynamic_linker='GNU/Linux ld.so' ;; netbsdelf*-gnu) version_type=linux 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 dynamic_linker='NetBSD ld.elf_so' ;; netbsd*) version_type=sunos need_lib_prefix=no need_version=no if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' dynamic_linker='NetBSD (a.out) ld.so' else library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' dynamic_linker='NetBSD ld.elf_so' fi shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; newsos6) 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 ;; *nto* | *qnx*) version_type=qnx 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 dynamic_linker='ldqnx.so' ;; openbsd*) version_type=sunos sys_lib_dlsearch_path_spec="/usr/lib" need_lib_prefix=no # Some older versions of OpenBSD (3.3 at least) *do* need versioned libs. case $host_os in openbsd3.3 | openbsd3.3.*) need_version=yes ;; *) need_version=no ;; esac library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' shlibpath_var=LD_LIBRARY_PATH if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then case $host_os in openbsd2.[[89]] | openbsd2.[[89]].*) shlibpath_overrides_runpath=no ;; *) shlibpath_overrides_runpath=yes ;; esac else shlibpath_overrides_runpath=yes fi ;; os2*) libname_spec='$name' shrext_cmds=".dll" need_lib_prefix=no library_names_spec='$libname${shared_ext} $libname.a' dynamic_linker='OS/2 ld.exe' shlibpath_var=LIBPATH ;; osf3* | osf4* | osf5*) version_type=osf need_lib_prefix=no need_version=no soname_spec='${libname}${release}${shared_ext}$major' library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib" sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec" ;; rdos*) dynamic_linker=no ;; solaris*) 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=yes hardcode_into_libs=yes # ldd complains unless libraries are executable postinstall_cmds='chmod +x $lib' ;; sunos4*) version_type=sunos library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes if test "$with_gnu_ld" = yes; then need_lib_prefix=no fi need_version=yes ;; sysv4 | sysv4.3*) 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 case $host_vendor in sni) shlibpath_overrides_runpath=no need_lib_prefix=no runpath_var=LD_RUN_PATH ;; siemens) need_lib_prefix=no ;; motorola) need_lib_prefix=no need_version=no shlibpath_overrides_runpath=no sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib' ;; esac ;; sysv4*MP*) if test -d /usr/nec ;then 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 fi ;; sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) version_type=freebsd-elf need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes hardcode_into_libs=yes if test "$with_gnu_ld" = yes; then sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib' else sys_lib_search_path_spec='/usr/ccs/lib /usr/lib' case $host_os in sco3.2v5*) sys_lib_search_path_spec="$sys_lib_search_path_spec /lib" ;; esac fi sys_lib_dlsearch_path_spec='/usr/lib' ;; tpf*) # TPF is a cross-target only. Preferred cross-host = GNU/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}' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes ;; uts4*) 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 ;; *) dynamic_linker=no ;; esac AC_MSG_RESULT([$dynamic_linker]) test "$dynamic_linker" = no && can_build_shared=no variables_saved_for_relink="PATH $shlibpath_var $runpath_var" if test "$GCC" = yes; then variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH" fi if test "${lt_cv_sys_lib_search_path_spec+set}" = set; then sys_lib_search_path_spec="$lt_cv_sys_lib_search_path_spec" fi if test "${lt_cv_sys_lib_dlsearch_path_spec+set}" = set; then sys_lib_dlsearch_path_spec="$lt_cv_sys_lib_dlsearch_path_spec" fi _LT_DECL([], [variables_saved_for_relink], [1], [Variables whose values should be saved in libtool wrapper scripts and restored at link time]) _LT_DECL([], [need_lib_prefix], [0], [Do we need the "lib" prefix for modules?]) _LT_DECL([], [need_version], [0], [Do we need a version for libraries?]) _LT_DECL([], [version_type], [0], [Library versioning type]) _LT_DECL([], [runpath_var], [0], [Shared library runtime path variable]) _LT_DECL([], [shlibpath_var], [0],[Shared library path variable]) _LT_DECL([], [shlibpath_overrides_runpath], [0], [Is shlibpath searched before the hard-coded library search path?]) _LT_DECL([], [libname_spec], [1], [Format of library name prefix]) _LT_DECL([], [library_names_spec], [1], [[List of archive names. First name is the real one, the rest are links. 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], [Command to use after uninstallation of a shared archive]) _LT_DECL([], [finish_cmds], [2], [Commands used to finish a libtool library installation in a directory]) _LT_DECL([], [finish_eval], [1], [[As "finish_cmds", except a single script fragment to be evaled but not shown]]) _LT_DECL([], [hardcode_into_libs], [0], [Whether we should hardcode library paths into libraries]) _LT_DECL([], [sys_lib_search_path_spec], [2], [Compile-time system search path for libraries]) _LT_DECL([], [sys_lib_dlsearch_path_spec], [2], [Run-time system search path for libraries]) ])# _LT_SYS_DYNAMIC_LINKER # _LT_PATH_TOOL_PREFIX(TOOL) # -------------------------- # find a file program which can recognize shared library AC_DEFUN([_LT_PATH_TOOL_PREFIX], [m4_require([_LT_DECL_EGREP])dnl AC_MSG_CHECKING([for $1]) AC_CACHE_VAL(lt_cv_path_MAGIC_CMD, [case $MAGIC_CMD in [[\\/*] | ?:[\\/]*]) lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path. ;; *) lt_save_MAGIC_CMD="$MAGIC_CMD" lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR dnl $ac_dummy forces splitting on constant user-supplied paths. dnl POSIX.2 word splitting is done only on the output of word expansions, dnl not every word. This closes a longstanding sh security hole. ac_dummy="m4_if([$2], , $PATH, [$2])" for ac_dir in $ac_dummy; do IFS="$lt_save_ifs" test -z "$ac_dir" && ac_dir=. if test -f $ac_dir/$1; then lt_cv_path_MAGIC_CMD="$ac_dir/$1" if test -n "$file_magic_test_file"; then case $deplibs_check_method in "file_magic "*) file_magic_regex=`expr "$deplibs_check_method" : "file_magic \(.*\)"` MAGIC_CMD="$lt_cv_path_MAGIC_CMD" if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null | $EGREP "$file_magic_regex" > /dev/null; then : else cat <<_LT_EOF 1>&2 *** Warning: the command libtool uses to detect shared libraries, *** $file_magic_cmd, produces output that libtool cannot recognize. *** The result is that libtool may fail to recognize shared libraries *** as such. This will affect the creation of libtool libraries that *** depend on shared libraries, but programs linked with such libtool *** libraries will work regardless of this problem. Nevertheless, you *** may want to report the problem to your system manager and/or to *** bug-libtool@gnu.org _LT_EOF fi ;; esac fi break fi done IFS="$lt_save_ifs" MAGIC_CMD="$lt_save_MAGIC_CMD" ;; esac]) MAGIC_CMD="$lt_cv_path_MAGIC_CMD" if test -n "$MAGIC_CMD"; then AC_MSG_RESULT($MAGIC_CMD) else AC_MSG_RESULT(no) fi _LT_DECL([], [MAGIC_CMD], [0], [Used to examine libraries when file_magic_cmd begins with "file"])dnl ])# _LT_PATH_TOOL_PREFIX # Old name: AU_ALIAS([AC_PATH_TOOL_PREFIX], [_LT_PATH_TOOL_PREFIX]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_PATH_TOOL_PREFIX], []) # _LT_PATH_MAGIC # -------------- # find a file program which can recognize a shared library m4_defun([_LT_PATH_MAGIC], [_LT_PATH_TOOL_PREFIX(${ac_tool_prefix}file, /usr/bin$PATH_SEPARATOR$PATH) if test -z "$lt_cv_path_MAGIC_CMD"; then if test -n "$ac_tool_prefix"; then _LT_PATH_TOOL_PREFIX(file, /usr/bin$PATH_SEPARATOR$PATH) else MAGIC_CMD=: fi fi ])# _LT_PATH_MAGIC # LT_PATH_LD # ---------- # find the pathname to the GNU or non-GNU linker AC_DEFUN([LT_PATH_LD], [AC_REQUIRE([AC_PROG_CC])dnl AC_REQUIRE([AC_CANONICAL_HOST])dnl 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], [assume the C compiler uses GNU ld @<:@default=no@:>@])], [test "$withval" = no || with_gnu_ld=yes], [with_gnu_ld=no])dnl ac_prog=ld if test "$GCC" = yes; then # Check if gcc -print-prog-name=ld gives a path. AC_MSG_CHECKING([for ld used by $CC]) case $host in *-*-mingw*) # gcc leaves a trailing carriage return which upsets mingw ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;; *) ac_prog=`($CC -print-prog-name=ld) 2>&5` ;; esac case $ac_prog in # Accept absolute paths. [[\\/]]* | ?:[[\\/]]*) re_direlt='/[[^/]][[^/]]*/\.\./' # Canonicalize the pathname of ld ac_prog=`$ECHO "$ac_prog"| $SED 's%\\\\%/%g'` while $ECHO "$ac_prog" | $GREP "$re_direlt" > /dev/null 2>&1; do ac_prog=`$ECHO $ac_prog| $SED "s%$re_direlt%/%"` done test -z "$LD" && LD="$ac_prog" ;; "") # If it fails, then pretend we aren't using GCC. ac_prog=ld ;; *) # If it is relative, then search for the first ld in PATH. with_gnu_ld=unknown ;; esac elif test "$with_gnu_ld" = yes; then AC_MSG_CHECKING([for GNU ld]) else AC_MSG_CHECKING([for non-GNU ld]) fi AC_CACHE_VAL(lt_cv_path_LD, [if test -z "$LD"; then lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR for ac_dir in $PATH; do IFS="$lt_save_ifs" test -z "$ac_dir" && ac_dir=. if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then lt_cv_path_LD="$ac_dir/$ac_prog" # Check to see if the program is GNU ld. I'd rather use --version, # but apparently some variants of GNU ld only accept -v. # Break only if it was the GNU/non-GNU ld that we prefer. case `"$lt_cv_path_LD" -v 2>&1 &1 /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 # 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*) # 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' ;; darwin* | rhapsody*) lt_cv_deplibs_check_method=pass_all ;; freebsd* | dragonfly*) if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then case $host_cpu in i*86 ) # Not sure whether the presence of OpenBSD here was a mistake. # Let's accept both of them until this is cleared up. lt_cv_deplibs_check_method='file_magic (FreeBSD|OpenBSD|DragonFly)/i[[3-9]]86 (compact )?demand paged shared library' lt_cv_file_magic_cmd=/usr/bin/file lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*` ;; esac else lt_cv_deplibs_check_method=pass_all fi ;; gnu*) 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 ia64*) lt_cv_deplibs_check_method='file_magic (s[[0-9]][[0-9]][[0-9]]|ELF-[[0-9]][[0-9]]) shared object file - IA64' 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])(-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_file_magic_test_file=/usr/lib/libc.sl ;; esac ;; interix[[3-9]]*) # PIC code is broken on Interix 3.x, that's why |\.a not |_pic\.a here lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so|\.a)$' ;; irix5* | irix6* | nonstopux*) case $LD in *-32|*"-32 ") libmagic=32-bit;; *-n32|*"-n32 ") libmagic=N32;; *-64|*"-64 ") libmagic=64-bit;; *) libmagic=never-match;; esac lt_cv_deplibs_check_method=pass_all ;; # This must be glibc/ELF. linux* | k*bsd*-gnu | kopensolaris*-gnu) lt_cv_deplibs_check_method=pass_all ;; netbsd* | netbsdelf*-gnu) if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|_pic\.a)$' else lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so|_pic\.a)$' fi ;; newos6*) lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (executable|dynamic lib)' lt_cv_file_magic_cmd=/usr/bin/file lt_cv_file_magic_test_file=/usr/lib/libnls.so ;; *nto* | *qnx*) lt_cv_deplibs_check_method=pass_all ;; openbsd*) if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|\.so|_pic\.a)$' else lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|_pic\.a)$' fi ;; osf3* | osf4* | osf5*) lt_cv_deplibs_check_method=pass_all ;; rdos*) lt_cv_deplibs_check_method=pass_all ;; solaris*) lt_cv_deplibs_check_method=pass_all ;; sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) lt_cv_deplibs_check_method=pass_all ;; sysv4 | sysv4.3*) case $host_vendor in motorola) lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (shared object|dynamic lib) M[[0-9]][[0-9]]* Version [[0-9]]' lt_cv_file_magic_test_file=`echo /usr/lib/libc.so*` ;; ncr) lt_cv_deplibs_check_method=pass_all ;; sequent) lt_cv_file_magic_cmd='/bin/file' lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB (shared object|dynamic lib )' ;; sni) lt_cv_file_magic_cmd='/bin/file' lt_cv_deplibs_check_method="file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB dynamic lib" lt_cv_file_magic_test_file=/lib/libc.so ;; siemens) lt_cv_deplibs_check_method=pass_all ;; pc) lt_cv_deplibs_check_method=pass_all ;; esac ;; tpf*) lt_cv_deplibs_check_method=pass_all ;; 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 _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"]) _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 # LT_PATH_NM # ---------- # find the pathname to a BSD- or MS-compatible name lister AC_DEFUN([LT_PATH_NM], [AC_REQUIRE([AC_PROG_CC])dnl AC_CACHE_CHECK([for BSD- or MS-compatible name lister (nm)], lt_cv_path_NM, [if test -n "$NM"; then # Let the user override the test. lt_cv_path_NM="$NM" else lt_nm_to_check="${ac_tool_prefix}nm" if test -n "$ac_tool_prefix" && test "$build" = "$host"; then lt_nm_to_check="$lt_nm_to_check nm" fi for lt_tmp_nm in $lt_nm_to_check; do lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR for ac_dir in $PATH /usr/ccs/bin/elf /usr/ccs/bin /usr/ucb /bin; do IFS="$lt_save_ifs" test -z "$ac_dir" && ac_dir=. tmp_nm="$ac_dir/$lt_tmp_nm" if test -f "$tmp_nm" || test -f "$tmp_nm$ac_exeext" ; then # Check to see if the nm accepts a BSD-compat flag. # Adding the `sed 1q' prevents false positives on HP-UX, which says: # nm: unknown option "B" ignored # Tru64's nm complains that /dev/null is an invalid object file case `"$tmp_nm" -B /dev/null 2>&1 | sed '1q'` in */dev/null* | *'Invalid file or object type'*) lt_cv_path_NM="$tmp_nm -B" break ;; *) case `"$tmp_nm" -p /dev/null 2>&1 | sed '1q'` in */dev/null*) lt_cv_path_NM="$tmp_nm -p" break ;; *) lt_cv_path_NM=${lt_cv_path_NM="$tmp_nm"} # keep the first match, but continue # so that we can try to find one that supports BSD flags ;; esac ;; esac fi done IFS="$lt_save_ifs" done : ${lt_cv_path_NM=no} fi]) if test "$lt_cv_path_NM" != "no"; then NM="$lt_cv_path_NM" else # Didn't find any BSD compatible name lister, look for dumpbin. 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" fi fi test -z "$NM" && NM=nm AC_SUBST([NM]) _LT_DECL([], [NM], [1], [A BSD- or MS-compatible name lister])dnl 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:$LINENO: $ac_compile\"" >&AS_MESSAGE_LOG_FD) (eval "$ac_compile" 2>conftest.err) cat conftest.err >&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:$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" fi rm -f conftest*]) ])# LT_PATH_NM # Old names: AU_ALIAS([AM_PROG_NM], [LT_PATH_NM]) AU_ALIAS([AC_PROG_NM], [LT_PATH_NM]) dnl aclocal-1.4 backwards compatibility: 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' 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* | *-*-cegcc* | *-*-cygwin* | *-*-haiku* | *-*-pw32* | *-*-darwin*) # These system don't have libm, or don't need it ;; *-ncr-sysv4.3*) AC_CHECK_LIB(mw, _mwvalidcheckl, LIBM="-lmw") AC_CHECK_LIB(m, cos, LIBM="$LIBM -lm") ;; *) AC_CHECK_LIB(m, cos, LIBM="-lm") ;; esac AC_SUBST([LIBM]) ])# LT_LIB_M # Old name: AU_ALIAS([AC_CHECK_LIBM], [LT_LIB_M]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_CHECK_LIBM], []) # _LT_COMPILER_NO_RTTI([TAGNAME]) # ------------------------------- m4_defun([_LT_COMPILER_NO_RTTI], [m4_require([_LT_TAG_COMPILER])dnl _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)= if test "$GCC" = yes; then 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, [-fno-rtti -fno-exceptions], [], [_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)="$_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1) -fno-rtti -fno-exceptions"]) fi _LT_TAGDECL([no_builtin_flag], [lt_prog_compiler_no_builtin_flag], [1], [Compiler flag to turn off builtin functions]) ])# _LT_COMPILER_NO_RTTI # _LT_CMD_GLOBAL_SYMBOLS # ---------------------- 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 m4_require([_LT_DECL_EGREP])dnl m4_require([_LT_TAG_COMPILER])dnl # Check for command to grab the raw symbol name followed by C symbol from nm. AC_MSG_CHECKING([command to parse $NM output from $compiler object]) AC_CACHE_VAL([lt_cv_sys_global_symbol_pipe], [ # These are sane defaults that work on at least a few old systems. # [They come from Ultrix. What could be older than Ultrix?!! ;)] # Character class describing NM global symbol codes. symcode='[[BCDEGRST]]' # Regexp to match symbols that can be accessed directly from C. sympat='\([[_A-Za-z]][[_A-Za-z0-9]]*\)' # Define system-specific variables. case $host_os in aix*) symcode='[[BCDT]]' ;; cygwin* | mingw* | pw32* | cegcc*) symcode='[[ABCDGISTW]]' ;; hpux*) if test "$host_cpu" = ia64; then symcode='[[ABCDEGRST]]' fi ;; irix* | nonstopux*) symcode='[[BCDEGRST]]' ;; osf*) symcode='[[BCDEGQRST]]' ;; solaris*) symcode='[[BDRT]]' ;; sco3.2v5*) symcode='[[DT]]' ;; sysv4.2uw2*) symcode='[[DT]]' ;; sysv5* | sco5v6* | unixware* | OpenUNIX*) symcode='[[ABDT]]' ;; sysv4) symcode='[[DFNSTU]]' ;; esac # If we're using GNU nm, then use its standard symbol codes. case `$NM -V 2>&1` in *GNU* | *'with BFD'*) symcode='[[ABCDGIRSTW]]' ;; esac # Transform an extracted symbol line into a proper C declaration. # Some systems (esp. on ia64) link data and code symbols differently, # so use this general approach. 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'" # Handle CRLF in mingw tool chain opt_cr= case $build_os in mingw*) opt_cr=`$ECHO 'x\{0,1\}' | tr x '\015'` # option cr in regexp ;; esac # Try without a prefix underscore, then with it. for ac_symprfx in "" "_"; do # Transform symcode, sympat, and symprfx into a raw symbol and a C symbol. symxfrm="\\1 $ac_symprfx\\2 \\2" # Write the raw and C identifiers. if test "$lt_cv_nm_interface" = "MS dumpbin"; then # Fake it for dumpbin and say T for any non-static function # and D for any global variable. # Also find C++ and __fastcall symbols from MSVC++, # 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};"\ " {if(hide[section]) next};"\ " {f=0}; \$ 0~/\(\).*\|/{f=1}; {printf f ? \"T \" : \"D \"};"\ " {split(\$ 0, a, /\||\r/); split(a[2], s)};"\ " s[1]~/^[@?]/{print s[1], s[1]; next};"\ " s[1]~prfx {split(s[1],t,\"@\"); print t[1], substr(t[1],length(prfx))}"\ " ' prfx=^$ac_symprfx]" 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 rm -f conftest* cat > conftest.$ac_ext <<_LT_EOF #ifdef __cplusplus extern "C" { #endif char nm_test_var; void nm_test_func(void); void nm_test_func(void){} #ifdef __cplusplus } #endif int main(){nm_test_var='a';nm_test_func();return(0);} _LT_EOF 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 # Try sorting and uniquifying the output. if sort "$nlist" | uniq > "$nlist"T; then mv -f "$nlist"T "$nlist" else rm -f "$nlist"T fi # Make sure that we snagged all the symbols we need. 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 _LT_EOF # Now generate the symbol file. eval "$lt_cv_sys_global_symbol_to_cdecl"' < "$nlist" | $GREP -v main >> conftest.$ac_ext' cat <<_LT_EOF >> conftest.$ac_ext /* The mapping between symbol names and symbols. */ LT@&t@_DLSYM_CONST struct { const char *name; void *address; } lt__PROGRAM__LTX_preloaded_symbols[[]] = { { "@PROGRAM@", (void *) 0 }, _LT_EOF $SED "s/^$symcode$symcode* \(.*\) \(.*\)$/ {\"\2\", (void *) \&\2},/" < "$nlist" | $GREP -v main >> conftest.$ac_ext cat <<\_LT_EOF >> conftest.$ac_ext {0, (void *) 0} }; /* This works around a problem in FreeBSD linker */ #ifdef FREEBSD_WORKAROUND static const void *lt_preloaded_setup() { return lt__PROGRAM__LTX_preloaded_symbols; } #endif #ifdef __cplusplus } #endif _LT_EOF # Now try linking the two files. mv conftest.$ac_objext conftstm.$ac_objext 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_globsym_save_LIBS CFLAGS=$lt_globsym_save_CFLAGS else echo "cannot find nm_test_func in $nlist" >&AS_MESSAGE_LOG_FD fi else echo "cannot find nm_test_var in $nlist" >&AS_MESSAGE_LOG_FD fi else echo "cannot run $lt_cv_sys_global_symbol_pipe" >&AS_MESSAGE_LOG_FD fi else echo "$progname: failed program was:" >&AS_MESSAGE_LOG_FD cat conftest.$ac_ext >&5 fi rm -rf conftest* conftst* # Do not use the global_symbol_pipe unless it works. if test "$pipe_works" = yes; then break else lt_cv_sys_global_symbol_pipe= fi done ]) if test -z "$lt_cv_sys_global_symbol_pipe"; then lt_cv_sys_global_symbol_to_cdecl= fi if test -z "$lt_cv_sys_global_symbol_pipe$lt_cv_sys_global_symbol_to_cdecl"; then AC_MSG_RESULT(failed) else 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], [Transform the output of nm in a proper C declaration]) _LT_DECL([global_symbol_to_c_name_address], [lt_cv_sys_global_symbol_to_c_name_address], [1], [Transform the output of nm in a C name address pair]) _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 # _LT_COMPILER_PIC([TAGNAME]) # --------------------------- m4_defun([_LT_COMPILER_PIC], [m4_require([_LT_TAG_COMPILER])dnl _LT_TAGVAR(lt_prog_compiler_wl, $1)= _LT_TAGVAR(lt_prog_compiler_pic, $1)= _LT_TAGVAR(lt_prog_compiler_static, $1)= m4_if([$1], [CXX], [ # C++ specific cases for pic, static, wl, etc. if test "$GXX" = yes; then _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' case $host_os in aix*) # All AIX code is PIC. if test "$host_cpu" = ia64; then # AIX 5 now supports IA64 processor _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' fi ;; amigaos*) case $host_cpu in powerpc) # see comment about AmigaOS4 .so support _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' ;; m68k) # FIXME: we need at least 68020 code to build shared libraries, but # adding the `-m68020' flag to GCC prevents building anything better, # like `-m68040'. _LT_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4' ;; esac ;; beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) # PIC is the default for these OSes. ;; 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). # Although the cygwin gcc ignores -fPIC, still need this for old-style # (--disable-auto-import) libraries m4_if([$1], [GCJ], [], [_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT']) ;; darwin* | rhapsody*) # PIC is the default on this platform # Common symbols not allowed in MH_DYLIB files _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common' ;; *djgpp*) # 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. ;; sysv4*MP*) if test -d /usr/nec; then _LT_TAGVAR(lt_prog_compiler_pic, $1)=-Kconform_pic fi ;; 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 # sets the default TLS model and affects inlining. case $host_cpu in hppa*64*) ;; *) _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' ;; esac ;; *qnx* | *nto*) # QNX uses GNU C++, but need to define -shared option too, otherwise # it will coredump. _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared' ;; *) _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' ;; esac else case $host_os in aix[[4-9]]*) # All AIX code is PIC. if test "$host_cpu" = ia64; then # AIX 5 now supports IA64 processor _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' else _LT_TAGVAR(lt_prog_compiler_static, $1)='-bnso -bI:/lib/syscalls.exp' fi ;; chorus*) case $cc_basename in cxch68*) # Green Hills C++ Compiler # _LT_TAGVAR(lt_prog_compiler_static, $1)="--no_auto_instantiation -u __main -u __premain -u _abort -r $COOL_DIR/lib/libOrb.a $MVME_DIR/lib/CC/libC.a $MVME_DIR/lib/classix/libcx.s.a" ;; 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++*) _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' ;; ghcx*) # Green Hills C++ Compiler _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic' ;; *) ;; esac ;; freebsd* | dragonfly*) # FreeBSD uses GNU C++ ;; hpux9* | hpux10* | hpux11*) case $cc_basename in CC*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive' if test "$host_cpu" != ia64; then _LT_TAGVAR(lt_prog_compiler_pic, $1)='+Z' fi ;; aCC*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive' case $host_cpu in hppa*64*|ia64*) # +Z the default ;; *) _LT_TAGVAR(lt_prog_compiler_pic, $1)='+Z' ;; esac ;; *) ;; esac ;; interix*) # This is c89, which is MS Visual C++ (no shared libs) # Anyone wants to do a port? ;; irix5* | irix6* | nonstopux*) case $cc_basename in CC*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' # CC pic flag -KPIC is the default. ;; *) ;; esac ;; linux* | k*bsd*-gnu | kopensolaris*-gnu) case $cc_basename in KCC*) # KAI C++ Compiler _LT_TAGVAR(lt_prog_compiler_wl, $1)='--backend -Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' ;; ecpc* ) # old Intel C++ for x86_64 which still supported -KPIC. _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' ;; icpc* ) # Intel C++, used to be incompatible with GCC. # ICC 10 doesn't accept -KPIC any more. _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' ;; pgCC* | pgcpp*) # Portland Group C++ compiler _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fpic' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; cxx*) # Compaq C++ # Make sure the PIC flag is empty. It appears that all Alpha # Linux and Compaq Tru64 Unix objects are PIC. _LT_TAGVAR(lt_prog_compiler_pic, $1)= _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' ;; 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' ;; *) case `$CC -V 2>&1 | sed 5q` in *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)='-Qoption ld ' ;; esac ;; esac ;; lynxos*) ;; m88k*) ;; mvs*) case $cc_basename in cxx*) _LT_TAGVAR(lt_prog_compiler_pic, $1)='-W c,exportall' ;; *) ;; esac ;; netbsd* | netbsdelf*-gnu) ;; *qnx* | *nto*) # QNX uses GNU C++, but need to define -shared option too, otherwise # it will coredump. _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared' ;; osf3* | osf4* | osf5*) case $cc_basename in KCC*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='--backend -Wl,' ;; RCC*) # Rational C++ 2.4.1 _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic' ;; cxx*) # Digital/Compaq C++ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' # Make sure the PIC flag is empty. It appears that all Alpha # Linux and Compaq Tru64 Unix objects are PIC. _LT_TAGVAR(lt_prog_compiler_pic, $1)= _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' ;; *) ;; esac ;; psos*) ;; solaris*) case $cc_basename in 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' _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ' ;; gcx*) # Green Hills C++ Compiler _LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC' ;; *) ;; esac ;; sunos4*) case $cc_basename in CC*) # Sun C++ 4.x _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; lcc*) # Lucid _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic' ;; *) ;; esac ;; sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*) case $cc_basename in CC*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; esac ;; tandem*) case $cc_basename in NCC*) # NonStop-UX NCC 3.20 _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' ;; *) ;; esac ;; vxworks*) ;; *) _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no ;; esac fi ], [ if test "$GCC" = yes; then _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' case $host_os in aix*) # All AIX code is PIC. if test "$host_cpu" = ia64; then # AIX 5 now supports IA64 processor _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' fi ;; amigaos*) case $host_cpu in powerpc) # see comment about AmigaOS4 .so support _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' ;; m68k) # FIXME: we need at least 68020 code to build shared libraries, but # adding the `-m68020' flag to GCC prevents building anything better, # like `-m68040'. _LT_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4' ;; esac ;; beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) # PIC is the default for these OSes. ;; mingw* | cygwin* | pw32* | os2* | 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). # Although the cygwin gcc ignores -fPIC, still need this for old-style # (--disable-auto-import) libraries m4_if([$1], [GCJ], [], [_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT']) ;; darwin* | rhapsody*) # PIC is the default on this platform # Common symbols not allowed in MH_DYLIB files _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 # sets the default TLS model and affects inlining. case $host_cpu in hppa*64*) # +Z the default ;; *) _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' ;; esac ;; interix[[3-9]]*) # Interix 3.x gcc -fpic/-fPIC options generate broken code. # Instead, we relocate shared libraries at runtime. ;; msdosdjgpp*) # Just because we use GCC doesn't mean we suddenly get shared libraries # on systems that don't support them. _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no enable_shared=no ;; *nto* | *qnx*) # QNX uses GNU C++, but need to define -shared option too, otherwise # it will coredump. _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared' ;; sysv4*MP*) if test -d /usr/nec; then _LT_TAGVAR(lt_prog_compiler_pic, $1)=-Kconform_pic fi ;; *) _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 aix*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' if test "$host_cpu" = ia64; then # AIX 5 now supports IA64 processor _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' else _LT_TAGVAR(lt_prog_compiler_static, $1)='-bnso -bI:/lib/syscalls.exp' fi ;; mingw* | cygwin* | pw32* | os2* | 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']) ;; hpux9* | hpux10* | hpux11*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but # not for PA HP-UX. case $host_cpu in hppa*64*|ia64*) # +Z the default ;; *) _LT_TAGVAR(lt_prog_compiler_pic, $1)='+Z' ;; esac # Is there a better lt_prog_compiler_static that works with the bundled CC? _LT_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive' ;; irix5* | irix6* | nonstopux*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' # PIC (with -KPIC) is the default. _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' ;; linux* | k*bsd*-gnu | kopensolaris*-gnu) case $cc_basename in # old Intel for x86_64 which still supported -KPIC. ecc*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' ;; # icc used to be incompatible with GCC. # ICC 10 doesn't accept -KPIC any more. icc* | ifort*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' ;; # Lahey Fortran 8.1. lf95*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='--shared' _LT_TAGVAR(lt_prog_compiler_static, $1)='--static' ;; 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,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fpic' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; ccc*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' # All Alpha code is PIC. _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' ;; 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,' ;; *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' ;; esac ;; esac ;; newsos6) _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; *nto* | *qnx*) # QNX uses GNU C++, but need to define -shared option too, otherwise # it will coredump. _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared' ;; osf3* | osf4* | osf5*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' # All OSF/1 code is PIC. _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' ;; rdos*) _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' ;; solaris*) _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' case $cc_basename in f77* | f90* | f95* | sunf77* | sunf90* | sunf95*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ';; *) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,';; esac ;; sunos4*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; sysv4 | sysv4.2uw2* | sysv4.3*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; sysv4*MP*) if test -d /usr/nec ;then _LT_TAGVAR(lt_prog_compiler_pic, $1)='-Kconform_pic' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' fi ;; sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; unicos*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no ;; uts4*) _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; *) _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no ;; esac fi ]) case $host_os in # For platforms which do not support PIC, -DPIC is meaningless: *djgpp*) _LT_TAGVAR(lt_prog_compiler_pic, $1)= ;; *) _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_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. # if test -n "$_LT_TAGVAR(lt_prog_compiler_pic, $1)"; then _LT_COMPILER_OPTION([if $compiler PIC flag $_LT_TAGVAR(lt_prog_compiler_pic, $1) works], [_LT_TAGVAR(lt_cv_prog_compiler_pic_works, $1)], [$_LT_TAGVAR(lt_prog_compiler_pic, $1)@&t@m4_if([$1],[],[ -DPIC],[m4_if([$1],[CXX],[ -DPIC],[])])], [], [case $_LT_TAGVAR(lt_prog_compiler_pic, $1) in "" | " "*) ;; *) _LT_TAGVAR(lt_prog_compiler_pic, $1)=" $_LT_TAGVAR(lt_prog_compiler_pic, $1)" ;; esac], [_LT_TAGVAR(lt_prog_compiler_pic, $1)= _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no]) fi _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. # wl=$_LT_TAGVAR(lt_prog_compiler_wl, $1) eval lt_tmp_static_flag=\"$_LT_TAGVAR(lt_prog_compiler_static, $1)\" _LT_LINKER_OPTION([if $compiler static flag $lt_tmp_static_flag works], _LT_TAGVAR(lt_cv_prog_compiler_static_works, $1), $lt_tmp_static_flag, [], [_LT_TAGVAR(lt_prog_compiler_static, $1)=]) _LT_TAGDECL([link_static_flag], [lt_prog_compiler_static], [1], [Compiler flag to prevent dynamic linking]) ])# _LT_COMPILER_PIC # _LT_LINKER_SHLIBS([TAGNAME]) # ---------------------------- # See if the linker supports building shared libraries. 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 m4_require([_LT_CMD_GLOBAL_SYMBOLS])dnl m4_require([_LT_TAG_COMPILER])dnl 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") || (\$ 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*) 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 ;; linux* | k*bsd*-gnu | gnu*) _LT_TAGVAR(link_all_deplibs, $1)=no ;; *) _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' ;; esac ], [ runpath_var= _LT_TAGVAR(allow_undefined_flag, $1)= _LT_TAGVAR(always_export_symbols, $1)=no _LT_TAGVAR(archive_cmds, $1)= _LT_TAGVAR(archive_expsym_cmds, $1)= _LT_TAGVAR(compiler_needs_object, $1)=no _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no _LT_TAGVAR(export_dynamic_flag_spec, $1)= _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' _LT_TAGVAR(hardcode_automatic, $1)=no _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_direct_absolute, $1)=no _LT_TAGVAR(hardcode_libdir_flag_spec, $1)= _LT_TAGVAR(hardcode_libdir_separator, $1)= _LT_TAGVAR(hardcode_minus_L, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported _LT_TAGVAR(inherit_rpath, $1)=no _LT_TAGVAR(link_all_deplibs, $1)=unknown _LT_TAGVAR(module_cmds, $1)= _LT_TAGVAR(module_expsym_cmds, $1)= _LT_TAGVAR(old_archive_from_new_cmds, $1)= _LT_TAGVAR(old_archive_from_expsyms_cmds, $1)= _LT_TAGVAR(thread_safe_flag_spec, $1)= _LT_TAGVAR(whole_archive_flag_spec, $1)= # include_expsyms should be a list of space-separated symbols to be *always* # included in the symbol list _LT_TAGVAR(include_expsyms, $1)= # exclude_expsyms can be an extended regexp of symbols to exclude # it will be wrapped by ` (' and `)$', so one must not match beginning or # end of line. Example: `a|bc|.*d.*' will exclude the symbols `a' and `bc', # as well as any symbol that contains `d'. _LT_TAGVAR(exclude_expsyms, $1)=['_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*'] # Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out # platforms (ab)use it in PIC code, but their linkers get confused if # the symbol is explicitly referenced. Since portable code cannot # rely on this symbol name, it's probably fine to never include it in # preloaded symbol tables. # Exclude shared library initialization/finalization symbols. dnl Note also adjust exclude_expsyms for C++ above. extract_expsyms_cmds= case $host_os in cygwin* | mingw* | pw32* | cegcc*) # FIXME: the MSVC++ port hasn't been tested in a loooong time # When not using gcc, we currently assume that we are using # Microsoft Visual C++. if test "$GCC" != yes; then with_gnu_ld=no fi ;; interix*) # we just hope/assume this is gcc and not c89 (= MSVC++) with_gnu_ld=yes ;; openbsd*) with_gnu_ld=no ;; linux* | k*bsd*-gnu | gnu*) _LT_TAGVAR(link_all_deplibs, $1)=no ;; 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}' # Set some defaults for GNU ld with shared library support. These # are reset later if shared libraries are not supported. Putting them # here allows them to be overridden if necessary. runpath_var=LD_RUN_PATH _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' # ancient GNU ld didn't support --whole-archive et. al. if $LD --help 2>&1 | $GREP 'no-whole-archive' > /dev/null; then _LT_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' else _LT_TAGVAR(whole_archive_flag_spec, $1)= 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 ... *\ 2.11.*) ;; # other 2.11 versions *) supports_anon_versioning=yes ;; esac # See if GNU ld supports shared libraries. case $host_os in aix[[3-9]]*) # On AIX/PPC, the GNU linker is very broken if test "$host_cpu" != ia64; then _LT_TAGVAR(ld_shlibs, $1)=no cat <<_LT_EOF 1>&2 *** 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 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 ;; amigaos*) case $host_cpu in powerpc) # see comment about AmigaOS4 .so support _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='' ;; m68k) _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/a2ixlibrary.data~$ECHO "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$ECHO "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$ECHO "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$ECHO "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(hardcode_minus_L, $1)=yes ;; esac ;; beos*) if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then _LT_TAGVAR(allow_undefined_flag, $1)=unsupported # Joseph Beckenbach says some releases of gcc # support --undefined. This deserves some investigation. FIXME _LT_TAGVAR(archive_cmds, $1)='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' else _LT_TAGVAR(ld_shlibs, $1)=no fi ;; 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(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/;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' # 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 $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' else _LT_TAGVAR(ld_shlibs, $1)=no 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 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc. # Instead, shared libraries are loaded at an image base (0x10000000 by # default) and relocated if they conflict, which is a slow very memory # consuming and fragmenting process. To avoid this, we pick a random, # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link # time. Moving up from 0x10000000 also allows more sbrk(2) space. _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' _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 | kopensolaris*-gnu) tmp_diet=no if test "$host_os" = linux-dietlibc; then case $cc_basename in diet\ *) tmp_diet=yes;; # linux-dietlibc with static linking (!diet-dyn) esac fi if $LD --help 2>&1 | $EGREP ': supported targets:.* elf' > /dev/null \ && test "$tmp_diet" = no then 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; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' tmp_addflag=' $pic_flag' ;; 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' ;; efc*,ia64* | ifort*,ia64*) # Intel Fortran compiler on ia64 tmp_addflag=' -i_dynamic -nofor_main' ;; ifc* | ifort*) # Intel Fortran compiler tmp_addflag=' -nofor_main' ;; lf95*) # Lahey Fortran 8.1 _LT_TAGVAR(whole_archive_flag_spec, $1)= tmp_sharedflag='--shared' ;; 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; 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 tmp_sharedflag='-G' ;; esac _LT_TAGVAR(archive_cmds, $1)='$CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$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~ $CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib' fi case $cc_basename in 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)='${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 $linker_flags -soname $soname -version-script $output_objdir/$libname.ver -o $lib' fi ;; esac else _LT_TAGVAR(ld_shlibs, $1)=no fi ;; netbsd* | netbsdelf*-gnu) if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib' wlarc= else _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 ;; solaris*) if $LD -v 2>&1 | $GREP 'BFD 2\.8' > /dev/null; then _LT_TAGVAR(ld_shlibs, $1)=no cat <<_LT_EOF 1>&2 *** Warning: The releases 2.8.* of the GNU linker cannot reliably *** create shared libraries on Solaris systems. Therefore, libtool *** is disabling shared libraries support. We urge you to upgrade GNU *** binutils to release 2.9.1 or newer. Another option is to modify *** your PATH or compiler configuration so that the native linker is *** used, and then restart. _LT_EOF elif $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then _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 ;; sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX*) case `$LD -v 2>&1` in *\ [[01]].* | *\ 2.[[0-9]].* | *\ 2.1[[0-5]].*) _LT_TAGVAR(ld_shlibs, $1)=no cat <<_LT_EOF 1>&2 *** Warning: Releases of the GNU linker prior to 2.16.91.0.3 can not *** reliably create shared libraries on SCO systems. Therefore, libtool *** is disabling shared libraries support. We urge you to upgrade GNU *** binutils to release 2.16.91.0.3 or newer. Another option is to modify *** your PATH or compiler configuration so that the native linker is *** used, and then restart. _LT_EOF ;; *) # For security reasons, it is highly recommended that you always # use absolute paths for naming shared libraries, and exclude the # DT_RUNPATH tag from executables and libraries. But doing so # requires that you compile everything twice, which is a pain. if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' _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' else _LT_TAGVAR(ld_shlibs, $1)=no fi ;; esac ;; sunos4*) _LT_TAGVAR(archive_cmds, $1)='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags' wlarc= _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; *) if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then _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 ;; esac if test "$_LT_TAGVAR(ld_shlibs, $1)" = no; then runpath_var= _LT_TAGVAR(hardcode_libdir_flag_spec, $1)= _LT_TAGVAR(export_dynamic_flag_spec, $1)= _LT_TAGVAR(whole_archive_flag_spec, $1)= fi else # PORTME fill in a description of your system's linker (not GNU ld) case $host_os in aix3*) _LT_TAGVAR(allow_undefined_flag, $1)=unsupported _LT_TAGVAR(always_export_symbols, $1)=yes _LT_TAGVAR(archive_expsym_cmds, $1)='$LD -o $output_objdir/$soname $libobjs $deplibs $linker_flags -bE:$export_symbols -T512 -H512 -bM:SRE~$AR $AR_FLAGS $lib $output_objdir/$soname' # Note: this linker hardcodes the directories in LIBPATH if there # are no directories specified by -L. _LT_TAGVAR(hardcode_minus_L, $1)=yes if test "$GCC" = yes && test -z "$lt_prog_compiler_static"; then # Neither direct hardcoding nor static linking is supported with a # broken collect2. _LT_TAGVAR(hardcode_direct, $1)=unsupported fi ;; aix[[4-9]]*) if test "$host_cpu" = ia64; then # On IA64, the linker does run time linking by default, so we don't # have to do anything special. aix_use_runtimelinking=no exp_sym_flag='-Bexport' no_entry_flag="" 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") || (\$ 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 aix_use_runtimelinking=no # Test if we are trying to use run time linking or normal # AIX style linking. If -brtl is somewhere in LDFLAGS, we # need to do runtime linking. case $host_os in aix4.[[23]]|aix4.[[23]].*|aix[[5-9]]*) for ld_flag in $LDFLAGS; do if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); then aix_use_runtimelinking=yes break fi done ;; esac exp_sym_flag='-bexport' no_entry_flag='-bnoentry' fi # When large executables or shared objects are built, AIX ld can # have problems creating the table of contents. If linking a library # or program results in "error TOC overflow" add -mminimal-toc to # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS. _LT_TAGVAR(archive_cmds, $1)='' _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_direct_absolute, $1)=yes _LT_TAGVAR(hardcode_libdir_separator, $1)=':' _LT_TAGVAR(link_all_deplibs, $1)=yes _LT_TAGVAR(file_list_spec, $1)='${wl}-f,' if test "$GCC" = yes; then case $host_os in aix4.[[012]]|aix4.[[012]].*) # We only want to do this on AIX 4.2 and lower, the check # below for broken collect2 doesn't work under 4.3+ collect2name=`${CC} -print-prog-name=collect2` if test -f "$collect2name" && strings "$collect2name" | $GREP resolve_lib_name >/dev/null then # We have reworked collect2 : else # We have old collect2 _LT_TAGVAR(hardcode_direct, $1)=unsupported # It fails to find uninstalled libraries when the uninstalled # path is not listed in the libpath. Setting hardcode_minus_L # to unsupported forces relinking _LT_TAGVAR(hardcode_minus_L, $1)=yes _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)= fi ;; esac shared_flag='-shared' if test "$aix_use_runtimelinking" = yes; then shared_flag="$shared_flag "'${wl}-G' fi _LT_TAGVAR(link_all_deplibs, $1)=no else # not using gcc if test "$host_cpu" = ia64; then # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release # chokes on -Wl,-G. The following line is correct: shared_flag='-G' else if test "$aix_use_runtimelinking" = yes; then shared_flag='${wl}-G' else shared_flag='${wl}-bM:SRE' fi fi fi _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-bexpall' # It seems that -bexpall does not export symbols beginning with # underscore (_), so it is better to generate a list of symbols to export. _LT_TAGVAR(always_export_symbols, $1)=yes if test "$aix_use_runtimelinking" = yes; then # Warning - without using the other runtime loading flags (-brtl), # -berok will link without error, but may produce a broken library. _LT_TAGVAR(allow_undefined_flag, $1)='-berok' # Determine the default libpath from the value encoded in an # empty executable. _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 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' _LT_TAGVAR(allow_undefined_flag, $1)="-z nodefs" _LT_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$exp_sym_flag:\$export_symbols" else # Determine the default libpath from the value encoded in an # empty executable. _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' 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' fi fi ;; amigaos*) case $host_cpu in powerpc) # see comment about AmigaOS4 .so support _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='' ;; m68k) _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/a2ixlibrary.data~$ECHO "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$ECHO "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$ECHO "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$ECHO "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(hardcode_minus_L, $1)=yes ;; esac ;; bsdi[[45]]*) _LT_TAGVAR(export_dynamic_flag_spec, $1)=-rdynamic ;; cygwin* | mingw* | pw32* | cegcc*) # When not using gcc, we currently assume that we are using # Microsoft Visual C++. # hardcode_libdir_flag_spec is actually meaningless, as there is # no search path for DLLs. 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*) _LT_DARWIN_LINKER_FEATURES($1) ;; dgux*) _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(hardcode_shlibpath_var, $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 # extra space). freebsd2.2*) _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; # Unfortunately, older versions of FreeBSD 2 do not have this feature. 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 _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; # FreeBSD 3 and greater uses gcc -shared to do shared libraries. freebsd* | dragonfly*) _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 ;; hpux9*) if test "$GCC" = yes; then _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 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: _LT_TAGVAR(hardcode_direct, $1)=yes # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. _LT_TAGVAR(hardcode_minus_L, $1)=yes _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' ;; hpux10*) 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_separator, $1)=: _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_direct_absolute, $1)=yes _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. _LT_TAGVAR(hardcode_minus_L, $1)=yes fi ;; hpux11*) 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 $pic_flag ${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}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' ;; esac else case $host_cpu in hppa*64*) _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' ;; ia64*) _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -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 if test "$with_gnu_ld" = no; then _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: case $host_cpu in hppa*64*|ia64*) _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; *) _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_direct_absolute, $1)=yes _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. _LT_TAGVAR(hardcode_minus_L, $1)=yes ;; esac fi ;; irix5* | irix6* | nonstopux*) if test "$GCC" = yes; then _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. # 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" && 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' _LT_TAGVAR(hardcode_libdir_separator, $1)=: _LT_TAGVAR(inherit_rpath, $1)=yes _LT_TAGVAR(link_all_deplibs, $1)=yes ;; netbsd* | netbsdelf*-gnu) if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' # a.out else _LT_TAGVAR(archive_cmds, $1)='$LD -shared -o $lib $libobjs $deplibs $linker_flags' # ELF fi _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; newsos6) _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; *nto* | *qnx*) ;; openbsd*) if test -f /usr/libexec/ld.so; then _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_shlibpath_var, $1)=no _LT_TAGVAR(hardcode_direct_absolute, $1)=yes if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-retain-symbols-file,$export_symbols' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' else case $host_os in openbsd[[01]].* | openbsd2.[[0-7]] | openbsd2.[[0-7]].*) _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' ;; *) _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' ;; esac fi else _LT_TAGVAR(ld_shlibs, $1)=no fi ;; os2*) _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(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" && 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" && 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' _LT_TAGVAR(hardcode_libdir_separator, $1)=: ;; 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} $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" && 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 "-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' fi _LT_TAGVAR(archive_cmds_need_lc, $1)='no' _LT_TAGVAR(hardcode_libdir_separator, $1)=: ;; solaris*) _LT_TAGVAR(no_undefined_flag, $1)=' -z defs' if test "$GCC" = yes; then wlarc='${wl}' _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 $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"*) wlarc='' _LT_TAGVAR(archive_cmds, $1)='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$RM $lib.exp' ;; *) wlarc='${wl}' _LT_TAGVAR(archive_cmds, $1)='$CC -G${allow_undefined_flag} -h $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 -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp' ;; esac fi _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' _LT_TAGVAR(hardcode_shlibpath_var, $1)=no case $host_os in solaris2.[[0-5]] | solaris2.[[0-5]].*) ;; *) # The compiler driver will combine and reorder linker options, # but understands `-z linker_flag'. GCC discards it without `$wl', # but is careful enough not to reorder. # Supported since Solaris 2.6 (maybe 2.5.1?) if test "$GCC" = yes; then _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract' else _LT_TAGVAR(whole_archive_flag_spec, $1)='-z allextract$convenience -z defaultextract' fi ;; esac _LT_TAGVAR(link_all_deplibs, $1)=yes ;; sunos4*) if test "x$host_vendor" = xsequent; then # Use $CC to link under sequent, because it throws in some extra .o # files that make .init and .fini sections work. _LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h $soname -o $lib $libobjs $deplibs $compiler_flags' else _LT_TAGVAR(archive_cmds, $1)='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags' fi _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_minus_L, $1)=yes _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; sysv4) case $host_vendor in sni) _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(hardcode_direct, $1)=yes # is this really true??? ;; siemens) ## LD is ld it makes a PLAMLIB ## CC just makes a GrossModule. _LT_TAGVAR(archive_cmds, $1)='$LD -G -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(reload_cmds, $1)='$CC -r -o $output$reload_objs' _LT_TAGVAR(hardcode_direct, $1)=no ;; motorola) _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(hardcode_direct, $1)=no #Motorola manual says yes, but my tests say they lie ;; esac runpath_var='LD_RUN_PATH' _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; sysv4.3*) _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(hardcode_shlibpath_var, $1)=no _LT_TAGVAR(export_dynamic_flag_spec, $1)='-Bexport' ;; sysv4*MP*) if test -d /usr/nec; then _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(hardcode_shlibpath_var, $1)=no runpath_var=LD_RUN_PATH hardcode_runpath_var=yes _LT_TAGVAR(ld_shlibs, $1)=yes fi ;; sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[[01]].[[10]]* | unixware7* | sco3.2v5.0.[[024]]*) _LT_TAGVAR(no_undefined_flag, $1)='${wl}-z,text' _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=no runpath_var='LD_RUN_PATH' if test "$GCC" = yes; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' else _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' fi ;; sysv5* | sco3.2v5* | sco5v6*) # Note: We can NOT use -z defs as we might desire, because we do not # link with -lc, and that would cause any symbols used from libc to # always be unresolved, which means just about no library would # ever link correctly. If we're not using GNU ld we use -z text # though, which does catch some bad symbols but isn't as heavy-handed # as -z defs. _LT_TAGVAR(no_undefined_flag, $1)='${wl}-z,text' _LT_TAGVAR(allow_undefined_flag, $1)='${wl}-z,nodefs' _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=no _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R,$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=':' _LT_TAGVAR(link_all_deplibs, $1)=yes _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Bexport' runpath_var='LD_RUN_PATH' if test "$GCC" = yes; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' else _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' fi ;; uts4*) _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; *) _LT_TAGVAR(ld_shlibs, $1)=no ;; esac if test x$host_vendor = xsni; then case $host in sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*) _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Blargedynsym' ;; esac fi fi ]) AC_MSG_RESULT([$_LT_TAGVAR(ld_shlibs, $1)]) test "$_LT_TAGVAR(ld_shlibs, $1)" = no && can_build_shared=no _LT_TAGVAR(with_gnu_ld, $1)=$with_gnu_ld _LT_DECL([], [libext], [0], [Old archive suffix (normally "a")])dnl _LT_DECL([], [shrext_cmds], [1], [Shared library suffix (normally ".so")])dnl _LT_DECL([], [extract_expsyms_cmds], [2], [The commands to extract the exported symbol list from a shared archive]) # # Do we need to explicitly link libc? # case "x$_LT_TAGVAR(archive_cmds_need_lc, $1)" in x|xyes) # Assume -lc should be added _LT_TAGVAR(archive_cmds_need_lc, $1)=yes if test "$enable_shared" = yes && test "$GCC" = yes; then case $_LT_TAGVAR(archive_cmds, $1) in *'~'*) # FIXME: we may have to deal with multi-command sequences. ;; '$CC '*) # 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_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 ;; esac _LT_TAGDECL([build_libtool_need_lc], [archive_cmds_need_lc], [0], [Whether or not to add -lc for building shared libraries]) _LT_TAGDECL([allow_libtool_libs_with_static_runtimes], [enable_shared_with_static_runtimes], [0], [Whether or not to disallow shared libs when runtime libs are static]) _LT_TAGDECL([], [export_dynamic_flag_spec], [1], [Compiler flag to allow reflexive dlopens]) _LT_TAGDECL([], [whole_archive_flag_spec], [1], [Compiler flag to generate shared objects directly from archives]) _LT_TAGDECL([], [compiler_needs_object], [1], [Whether the compiler copes with passing no objects directly]) _LT_TAGDECL([], [old_archive_from_new_cmds], [2], [Create an old-style archive from a shared archive]) _LT_TAGDECL([], [old_archive_from_expsyms_cmds], [2], [Create a temporary old-style archive to link instead of a shared archive]) _LT_TAGDECL([], [archive_cmds], [2], [Commands used to build a shared archive]) _LT_TAGDECL([], [archive_expsym_cmds], [2]) _LT_TAGDECL([], [module_cmds], [2], [Commands used to build a loadable module if different from building a shared archive.]) _LT_TAGDECL([], [module_expsym_cmds], [2]) _LT_TAGDECL([], [with_gnu_ld], [1], [Whether we are building with GNU ld or not]) _LT_TAGDECL([], [allow_undefined_flag], [1], [Flag that allows shared libraries with undefined symbols to be built]) _LT_TAGDECL([], [no_undefined_flag], [1], [Flag that enforces no undefined symbols]) _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_separator], [1], [Whether we need a single "-rpath" flag with a separated argument]) _LT_TAGDECL([], [hardcode_direct], [0], [Set to "yes" if using DIR/libNAME${shared_ext} during linking hardcodes DIR into the resulting binary]) _LT_TAGDECL([], [hardcode_direct_absolute], [0], [Set to "yes" if using DIR/libNAME${shared_ext} during linking hardcodes DIR into the resulting binary and the resulting library dependency is "absolute", i.e impossible to change by setting ${shlibpath_var} if the library is relocated]) _LT_TAGDECL([], [hardcode_minus_L], [0], [Set to "yes" if using the -LDIR flag during linking hardcodes DIR into the resulting binary]) _LT_TAGDECL([], [hardcode_shlibpath_var], [0], [Set to "yes" if using SHLIBPATH_VAR=DIR during linking hardcodes DIR into the resulting binary]) _LT_TAGDECL([], [hardcode_automatic], [0], [Set to "yes" if building a shared library automatically hardcodes DIR into the library and all subsequent libraries and executables linked against it]) _LT_TAGDECL([], [inherit_rpath], [0], [Set to yes if linker adds runtime paths of dependent libraries to runtime path list]) _LT_TAGDECL([], [link_all_deplibs], [0], [Whether libtool must link a program against all its dependency libraries]) _LT_TAGDECL([], [always_export_symbols], [0], [Set to "yes" if exported symbols are required]) _LT_TAGDECL([], [export_symbols_cmds], [2], [The commands to list exported symbols]) _LT_TAGDECL([], [exclude_expsyms], [1], [Symbols that should not be listed in the preloaded symbols]) _LT_TAGDECL([], [include_expsyms], [1], [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 dnl _LT_TAGDECL([], [thread_safe_flag_spec], [1], dnl [Compiler flag to generate thread safe objects]) ])# _LT_LINKER_SHLIBS # _LT_LANG_C_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_C_CONFIG], [m4_require([_LT_DECL_EGREP])dnl lt_save_CC="$CC" AC_LANG_PUSH(C) # Source file extension for C test sources. ac_ext=c # Object file extension for compiled C test sources. objext=o _LT_TAGVAR(objext, $1)=$objext # Code to be used in simple compile tests lt_simple_compile_test_code="int some_variable = 0;" # Code to be used in simple link tests lt_simple_link_test_code='int main(){return(0);}' _LT_TAG_COMPILER # Save the default compiler, since it gets overwritten when the other # tags are being tested, and _LT_TAGVAR(compiler, []) is a NOP. compiler_DEFAULT=$CC # save warnings/boilerplate of simple test code _LT_COMPILER_BOILERPLATE _LT_LINKER_BOILERPLATE ## 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_SYS_DYNAMIC_LINKER($1) _LT_LINKER_HARDCODE_LIBPATH($1) LT_SYS_DLOPEN_SELF _LT_CMD_STRIPLIB # Report which library types will actually be built AC_MSG_CHECKING([if libtool supports shared libraries]) AC_MSG_RESULT([$can_build_shared]) AC_MSG_CHECKING([whether to build shared libraries]) test "$can_build_shared" = "no" && enable_shared=no # On AIX, shared libraries and static libraries use the same namespace, and # are all built from PIC. case $host_os in aix3*) test "$enable_shared" = yes && enable_static=no if test -n "$RANLIB"; then archive_cmds="$archive_cmds~\$RANLIB \$lib" postinstall_cmds='$RANLIB $lib' fi ;; aix[[4-9]]*) if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then test "$enable_shared" = yes && enable_static=no fi ;; esac AC_MSG_RESULT([$enable_shared]) AC_MSG_CHECKING([whether to build static libraries]) # Make sure either enable_shared or enable_static is yes. test "$enable_shared" = yes || enable_static=yes AC_MSG_RESULT([$enable_static]) _LT_CONFIG($1) fi AC_LANG_POP CC="$lt_save_CC" ])# _LT_LANG_C_CONFIG # _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], [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 _LT_TAGVAR(allow_undefined_flag, $1)= _LT_TAGVAR(always_export_symbols, $1)=no _LT_TAGVAR(archive_expsym_cmds, $1)= _LT_TAGVAR(compiler_needs_object, $1)=no _LT_TAGVAR(export_dynamic_flag_spec, $1)= _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_direct_absolute, $1)=no _LT_TAGVAR(hardcode_libdir_flag_spec, $1)= _LT_TAGVAR(hardcode_libdir_separator, $1)= _LT_TAGVAR(hardcode_minus_L, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported _LT_TAGVAR(hardcode_automatic, $1)=no _LT_TAGVAR(inherit_rpath, $1)=no _LT_TAGVAR(module_cmds, $1)= _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 # Source file extension for C++ test sources. ac_ext=cpp # Object file extension for compiled C++ test sources. objext=o _LT_TAGVAR(objext, $1)=$objext # No sense in running all these tests if we already determined that # the CXX compiler isn't working. Some variables (like enable_shared) # are currently assumed to apply to all compilers on this platform, # and will be corrupted by setting them based on a non-working compiler. if test "$_lt_caught_CXX_error" != yes; then # Code to be used in simple compile tests lt_simple_compile_test_code="int some_variable = 0;" # Code to be used in simple link tests lt_simple_link_test_code='int main(int, char *[[]]) { return(0); }' # 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_LD=$LD lt_save_GCC=$GCC GCC=$GXX lt_save_with_gnu_ld=$with_gnu_ld lt_save_path_LD=$lt_cv_path_LD if test -n "${lt_cv_prog_gnu_ldcxx+set}"; then lt_cv_prog_gnu_ld=$lt_cv_prog_gnu_ldcxx else $as_unset lt_cv_prog_gnu_ld fi if test -n "${lt_cv_path_LDCXX+set}"; then lt_cv_path_LD=$lt_cv_path_LDCXX else $as_unset lt_cv_path_LD fi test -z "${LDCXX+set}" || LD=$LDCXX CC=${CXX-"c++"} CFLAGS=$CXXFLAGS compiler=$CC _LT_TAGVAR(compiler, $1)=$CC _LT_CC_BASENAME([$compiler]) if test -n "$compiler"; then # We don't want -fno-exception when compiling C++ code, so set the # no_builtin_flag separately if test "$GXX" = yes; then _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin' else _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)= fi if test "$GXX" = yes; then # Set up default GNU C++ configuration LT_PATH_LD # 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 $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' # If archive_cmds runs LD, not CC, wlarc should be empty # XXX I think wlarc can be eliminated in ltcf-cxx, but I need to # investigate it a little bit more. (MM) wlarc='${wl}' # ancient GNU ld didn't support --whole-archive et. al. if eval "`$CC -print-prog-name=ld` --help 2>&1" | $GREP 'no-whole-archive' > /dev/null; then _LT_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' else _LT_TAGVAR(whole_archive_flag_spec, $1)= fi else with_gnu_ld=no wlarc= # A generic and very simple default shared library creation # command for GNU C++ for the case where it uses the native # linker, instead of GNU ld. If possible, this setting should # overridden to take advantage of the native linker features on # the platform it is being used on. _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib' fi # 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 -v "^Configured with:" | $GREP "\-L"' else GXX=no with_gnu_ld=no wlarc= fi # PORTME: fill in a description of your system's C++ link characteristics AC_MSG_CHECKING([whether the $compiler linker ($LD) supports shared libraries]) _LT_TAGVAR(ld_shlibs, $1)=yes case $host_os in aix3*) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; aix[[4-9]]*) if test "$host_cpu" = ia64; then # On IA64, the linker does run time linking by default, so we don't # have to do anything special. aix_use_runtimelinking=no exp_sym_flag='-Bexport' no_entry_flag="" else aix_use_runtimelinking=no # Test if we are trying to use run time linking or normal # AIX style linking. If -brtl is somewhere in LDFLAGS, we # need to do runtime linking. case $host_os in aix4.[[23]]|aix4.[[23]].*|aix[[5-9]]*) for ld_flag in $LDFLAGS; do case $ld_flag in *-brtl*) aix_use_runtimelinking=yes break ;; esac done ;; esac exp_sym_flag='-bexport' no_entry_flag='-bnoentry' fi # When large executables or shared objects are built, AIX ld can # have problems creating the table of contents. If linking a library # or program results in "error TOC overflow" add -mminimal-toc to # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS. _LT_TAGVAR(archive_cmds, $1)='' _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_direct_absolute, $1)=yes _LT_TAGVAR(hardcode_libdir_separator, $1)=':' _LT_TAGVAR(link_all_deplibs, $1)=yes _LT_TAGVAR(file_list_spec, $1)='${wl}-f,' if test "$GXX" = yes; then case $host_os in aix4.[[012]]|aix4.[[012]].*) # We only want to do this on AIX 4.2 and lower, the check # below for broken collect2 doesn't work under 4.3+ collect2name=`${CC} -print-prog-name=collect2` if test -f "$collect2name" && strings "$collect2name" | $GREP resolve_lib_name >/dev/null then # We have reworked collect2 : else # We have old collect2 _LT_TAGVAR(hardcode_direct, $1)=unsupported # It fails to find uninstalled libraries when the uninstalled # path is not listed in the libpath. Setting hardcode_minus_L # to unsupported forces relinking _LT_TAGVAR(hardcode_minus_L, $1)=yes _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)= fi esac shared_flag='-shared' if test "$aix_use_runtimelinking" = yes; then shared_flag="$shared_flag "'${wl}-G' fi else # not using gcc if test "$host_cpu" = ia64; then # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release # chokes on -Wl,-G. The following line is correct: shared_flag='-G' else if test "$aix_use_runtimelinking" = yes; then shared_flag='${wl}-G' else shared_flag='${wl}-bM:SRE' fi fi fi _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-bexpall' # It seems that -bexpall does not export symbols beginning with # underscore (_), so it is better to generate a list of symbols to # export. _LT_TAGVAR(always_export_symbols, $1)=yes if test "$aix_use_runtimelinking" = yes; then # Warning - without using the other runtime loading flags (-brtl), # -berok will link without error, but may produce a broken library. _LT_TAGVAR(allow_undefined_flag, $1)='-berok' # Determine the default libpath from the value encoded in an empty # executable. _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 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' _LT_TAGVAR(allow_undefined_flag, $1)="-z nodefs" _LT_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$exp_sym_flag:\$export_symbols" else # Determine the default libpath from the value encoded in an # empty executable. _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' 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' fi fi ;; beos*) if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then _LT_TAGVAR(allow_undefined_flag, $1)=unsupported # Joseph Beckenbach says some releases of gcc # support --undefined. This deserves some investigation. FIXME _LT_TAGVAR(archive_cmds, $1)='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' else _LT_TAGVAR(ld_shlibs, $1)=no fi ;; chorus*) case $cc_basename in *) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; esac ;; cygwin* | mingw* | pw32* | cegcc*) 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) ;; dgux*) case $cc_basename in ec++*) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; ghcx*) # Green Hills C++ Compiler # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; *) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; esac ;; freebsd2.*) # C++ shared libraries reported to be fairly broken before # switch to ELF _LT_TAGVAR(ld_shlibs, $1)=no ;; freebsd-elf*) _LT_TAGVAR(archive_cmds_need_lc, $1)=no ;; freebsd* | dragonfly*) # FreeBSD 3 and later use GNU C++ and GNU ld with standard ELF # conventions _LT_TAGVAR(ld_shlibs, $1)=yes ;; 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)=: _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_minus_L, $1)=yes # Not in the search PATH, # but as the default # location of the library. case $cc_basename in CC*) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; aCC*) _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$CC -b ${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' # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. # # There doesn't appear to be a way to prevent this compiler from # 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; func_echo_all "$list"' ;; *) if test "$GXX" = yes; then _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 fi ;; esac ;; hpux10*|hpux11*) if test $with_gnu_ld = no; then _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: case $host_cpu in hppa*64*|ia64*) ;; *) _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' ;; esac fi case $host_cpu in hppa*64*|ia64*) _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; *) _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_direct_absolute, $1)=yes _LT_TAGVAR(hardcode_minus_L, $1)=yes # Not in the search PATH, # but as the default # location of the library. ;; esac case $cc_basename in CC*) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; aCC*) case $host_cpu in hppa*64*) _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; ia64*) _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; *) _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; esac # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. # # There doesn't appear to be a way to prevent this compiler from # 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; func_echo_all "$list"' ;; *) if test "$GXX" = yes; then if test $with_gnu_ld = no; then case $host_cpu in hppa*64*) _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 $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 $pic_flag ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; esac fi else # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no fi ;; esac ;; interix[[3-9]]*) _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=no _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc. # Instead, shared libraries are loaded at an image base (0x10000000 by # default) and relocated if they conflict, which is a slow very memory # consuming and fragmenting process. To avoid this, we pick a random, # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link # time. Moving up from 0x10000000 also allows more sbrk(2) space. _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' _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' ;; irix5* | irix6*) 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" && 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 # necessary to make sure instantiated templates are included # in the archive. _LT_TAGVAR(old_archive_cmds, $1)='$CC -ar -WR,-u -o $oldlib $oldobjs' ;; *) if test "$GXX" = yes; then if test "$with_gnu_ld" = no; then _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 $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 ;; esac _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: _LT_TAGVAR(inherit_rpath, $1)=yes ;; linux* | k*bsd*-gnu | kopensolaris*-gnu) case $cc_basename in KCC*) # Kuck and Associates, Inc. (KAI) C++ Compiler # KCC will only create a shared library if the output file # ends with ".so" (or ".sl" for HP-UX), so rename the library # to its proper name (with version) after linking. _LT_TAGVAR(archive_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib ${wl}-retain-symbols-file,$export_symbols; mv \$templib $lib' # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. # # There doesn't appear to be a way to prevent this compiler from # 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; func_echo_all "$list"' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' # Archives containing C++ object files must be created using # "CC -Bstatic", where "CC" is the KAI C++ compiler. _LT_TAGVAR(old_archive_cmds, $1)='$CC -Bstatic -o $oldlib $oldobjs' ;; icpc* | ecpc* ) # Intel C++ with_gnu_ld=yes # version 8.0 and above of icpc choke on multiply defined symbols # if we add $predep_objects and $postdep_objects, however 7.1 and # earlier do not add the objects themselves. case `$CC -V 2>&1` in *"Version 7."*) _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' ;; *) # Version 8.0 or newer tmp_idyn= case $host_cpu in ia64*) tmp_idyn=' -i_dynamic';; esac _LT_TAGVAR(archive_cmds, $1)='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' ;; esac _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive$convenience ${wl}--no-whole-archive' ;; pgCC* | pgcpp*) # Portland Group C++ compiler case `$CC -V` in *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 | 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 | 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 | 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 | sort | $NL2SP` $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname ${wl}-retain-symbols-file ${wl}$export_symbols -o $lib' ;; *) # 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' ;; esac _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; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' ;; cxx*) # Compaq C++ _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib ${wl}-retain-symbols-file $wl$export_symbols' runpath_var=LD_RUN_PATH _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. # # There doesn't appear to be a way to prevent this compiler from # 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=`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* | 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' _LT_TAGVAR(archive_cmds, $1)='$CC -qmkshrobj $libobjs $deplibs $compiler_flags ${wl}-soname $wl$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~ $CC -qmkshrobj $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib' fi ;; *) case `$CC -V 2>&1 | sed 5q` in *Sun\ C*) # Sun C++ 5.9 _LT_TAGVAR(no_undefined_flag, $1)=' -zdefs' _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; 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='func_echo_all' # Archives containing C++ object files must be created using # "CC -xar", where "CC" is the Sun C++ compiler. This is # necessary to make sure instantiated templates are included # in the archive. _LT_TAGVAR(old_archive_cmds, $1)='$CC -xar -o $oldlib $oldobjs' ;; esac ;; esac ;; lynxos*) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; m88k*) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; mvs*) case $cc_basename in cxx*) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; *) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; esac ;; netbsd*) if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $predep_objects $libobjs $deplibs $postdep_objects $linker_flags' wlarc= _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_shlibpath_var, $1)=no fi # Workaround some broken pre-1.5 toolchains output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP conftest.$objext | $SED -e "s:-lgcc -lc -lgcc::"' ;; *nto* | *qnx*) _LT_TAGVAR(ld_shlibs, $1)=yes ;; openbsd2*) # C++ shared libraries are fairly broken _LT_TAGVAR(ld_shlibs, $1)=no ;; openbsd*) if test -f /usr/libexec/ld.so; then _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_shlibpath_var, $1)=no _LT_TAGVAR(hardcode_direct_absolute, $1)=yes _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-retain-symbols-file,$export_symbols -o $lib' _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=func_echo_all else _LT_TAGVAR(ld_shlibs, $1)=no fi ;; osf3* | osf4* | osf5*) case $cc_basename in KCC*) # Kuck and Associates, Inc. (KAI) C++ Compiler # KCC will only create a shared library if the output file # ends with ".so" (or ".sl" for HP-UX), so rename the library # to its proper name (with version) after linking. _LT_TAGVAR(archive_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo "$lib" | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: # Archives containing C++ object files must be created using # the KAI C++ compiler. case $host in osf3*) _LT_TAGVAR(old_archive_cmds, $1)='$CC -Bstatic -o $oldlib $oldobjs' ;; *) _LT_TAGVAR(old_archive_cmds, $1)='$CC -o $oldlib $oldobjs' ;; esac ;; RCC*) # Rational C++ 2.4.1 # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; cxx*) 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" && 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" && 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 "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib~ $RM $lib.exp' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir' ;; esac _LT_TAGVAR(hardcode_libdir_separator, $1)=: # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. # # There doesn't appear to be a way to prevent this compiler from # 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=`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" && 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 $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 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: # 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 -v "^Configured with:" | $GREP "\-L"' else # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no fi ;; esac ;; psos*) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; sunos4*) case $cc_basename in CC*) # Sun C++ 4.x # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; lcc*) # Lucid # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; *) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; esac ;; solaris*) case $cc_basename in 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' _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)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ $CC -G${allow_undefined_flag} ${wl}-M ${wl}$lib.exp -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' _LT_TAGVAR(hardcode_shlibpath_var, $1)=no case $host_os in solaris2.[[0-5]] | solaris2.[[0-5]].*) ;; *) # The compiler driver will combine and reorder linker options, # but understands `-z linker_flag'. # Supported since Solaris 2.6 (maybe 2.5.1?) _LT_TAGVAR(whole_archive_flag_spec, $1)='-z allextract$convenience -z defaultextract' ;; esac _LT_TAGVAR(link_all_deplibs, $1)=yes 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 # necessary to make sure instantiated templates are included # in the archive. _LT_TAGVAR(old_archive_cmds, $1)='$CC -xar -o $oldlib $oldobjs' ;; gcx*) # Green Hills C++ Compiler _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib' # The C++ compiler must be used to create the archive. _LT_TAGVAR(old_archive_cmds, $1)='$CC $LDFLAGS -archive -o $oldlib $oldobjs' ;; *) # GNU C++ compiler with Solaris linker 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 $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 $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 -v "^Configured with:" | $GREP "\-L"' else # g++ 2.7 appears to require `-G' NOT `-shared' on this # platform. _LT_TAGVAR(archive_cmds, $1)='$CC -G -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 -G -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 -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' case $host_os in solaris2.[[0-5]] | solaris2.[[0-5]].*) ;; *) _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract' ;; esac fi ;; esac ;; sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[[01]].[[10]]* | unixware7* | sco3.2v5.0.[[024]]*) _LT_TAGVAR(no_undefined_flag, $1)='${wl}-z,text' _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=no runpath_var='LD_RUN_PATH' case $cc_basename in 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(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' ;; esac ;; sysv5* | sco3.2v5* | sco5v6*) # Note: We can NOT use -z defs as we might desire, because we do not # link with -lc, and that would cause any symbols used from libc to # always be unresolved, which means just about no library would # ever link correctly. If we're not using GNU ld we use -z text # though, which does catch some bad symbols but isn't as heavy-handed # as -z defs. _LT_TAGVAR(no_undefined_flag, $1)='${wl}-z,text' _LT_TAGVAR(allow_undefined_flag, $1)='${wl}-z,nodefs' _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=no _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R,$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=':' _LT_TAGVAR(link_all_deplibs, $1)=yes _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Bexport' runpath_var='LD_RUN_PATH' case $cc_basename in 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' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' ;; esac ;; tandem*) case $cc_basename in NCC*) # NonStop-UX NCC 3.20 # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; *) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; esac ;; vxworks*) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; *) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; esac AC_MSG_RESULT([$_LT_TAGVAR(ld_shlibs, $1)]) test "$_LT_TAGVAR(ld_shlibs, $1)" = no && can_build_shared=no _LT_TAGVAR(GCC, $1)="$GXX" _LT_TAGVAR(LD, $1)="$LD" ## 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... _LT_SYS_HIDDEN_LIBDEPS($1) _LT_COMPILER_PIC($1) _LT_COMPILER_C_O($1) _LT_COMPILER_FILE_LOCKS($1) _LT_LINKER_SHLIBS($1) _LT_SYS_DYNAMIC_LINKER($1) _LT_LINKER_HARDCODE_LIBPATH($1) _LT_CONFIG($1) fi # test -n "$compiler" CC=$lt_save_CC CFLAGS=$lt_save_CFLAGS LDCXX=$LD LD=$lt_save_LD GCC=$lt_save_GCC with_gnu_ld=$lt_save_with_gnu_ld lt_cv_path_LDCXX=$lt_cv_path_LD lt_cv_path_LD=$lt_save_path_LD lt_cv_prog_gnu_ldcxx=$lt_cv_prog_gnu_ld lt_cv_prog_gnu_ld=$lt_save_with_gnu_ld fi # test "$_lt_caught_CXX_error" != yes AC_LANG_POP ])# _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 # compiler output when linking a shared library. # Parse the compiler output and extract the necessary # 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)= _LT_TAGVAR(predeps, $1)= _LT_TAGVAR(postdeps, $1)= _LT_TAGVAR(compiler_lib_search_path, $1)= dnl we can't use the lt_simple_compile_test_code here, dnl because it contains code intended for an executable, dnl not a library. It's possible we should let each dnl tag define a new lt_????_link_test_code variable, dnl but it's only used here... m4_if([$1], [], [cat > conftest.$ac_ext <<_LT_EOF int a; void foo (void) { a = 0; } _LT_EOF ], [$1], [CXX], [cat > conftest.$ac_ext <<_LT_EOF class Foo { public: Foo (void) { a = 0; } private: int a; }; _LT_EOF ], [$1], [F77], [cat > conftest.$ac_ext <<_LT_EOF subroutine foo implicit none integer*4 a a=0 return end _LT_EOF ], [$1], [FC], [cat > conftest.$ac_ext <<_LT_EOF subroutine foo implicit none integer a a=0 return end _LT_EOF ], [$1], [GCJ], [cat > conftest.$ac_ext <<_LT_EOF public class foo { private int a; public void bar (void) { a = 0; } }; _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 # Parse the compiler output and extract the necessary # objects, libraries and library flags. # Sentinel used to keep track of whether or not we are before # the conftest object file. pre_test_object_deps_done=no for p in `eval "$output_verbose_link_cmd"`; do case ${prev}${p} in -L* | -R* | -l*) # Some compilers place space between "-{L,R}" and the path. # Remove the space. if test $p = "-L" || test $p = "-R"; then prev=$p continue 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 ${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. if test -z "$_LT_TAGVAR(compiler_lib_search_path, $1)"; then _LT_TAGVAR(compiler_lib_search_path, $1)="${prev}${p}" else _LT_TAGVAR(compiler_lib_search_path, $1)="${_LT_TAGVAR(compiler_lib_search_path, $1)} ${prev}${p}" fi ;; # The "-l" case would never come before the object being # linked, so don't bother handling this case. esac else if test -z "$_LT_TAGVAR(postdeps, $1)"; then _LT_TAGVAR(postdeps, $1)="${prev}${p}" else _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. if test "$p" = "conftest.$objext"; then pre_test_object_deps_done=yes continue fi if test "$pre_test_object_deps_done" = no; then if test -z "$_LT_TAGVAR(predep_objects, $1)"; then _LT_TAGVAR(predep_objects, $1)="$p" else _LT_TAGVAR(predep_objects, $1)="$_LT_TAGVAR(predep_objects, $1) $p" fi else if test -z "$_LT_TAGVAR(postdep_objects, $1)"; then _LT_TAGVAR(postdep_objects, $1)="$p" else _LT_TAGVAR(postdep_objects, $1)="$_LT_TAGVAR(postdep_objects, $1) $p" fi fi ;; *) ;; # Ignore the rest. esac done # Clean up. rm -f a.out a.exe else echo "libtool.m4: error: problem compiling $1 test program" fi $RM -f confest.$objext CFLAGS=$_lt_libdeps_save_CFLAGS # PORTME: override above test on systems where it is broken m4_if([$1], [CXX], [case $host_os in interix[[3-9]]*) # Interix 3.5 installs completely hosed .la files for C++, so rather than # hack all around it, let's just trust "g++" to DTRT. _LT_TAGVAR(predep_objects,$1)= _LT_TAGVAR(postdep_objects,$1)= _LT_TAGVAR(postdeps,$1)= ;; linux*) case `$CC -V 2>&1 | sed 5q` in *Sun\ C*) # Sun C++ 5.9 # The more standards-conforming stlport4 library is # incompatible with the Cstd library. Avoid specifying # it if it's in CXXFLAGS. Ignore libCrun as # -library=stlport4 depends on it. case " $CXX $CXXFLAGS " in *" -library=stlport4 "*) solaris_use_stlport4=yes ;; esac if test "$solaris_use_stlport4" != yes; then _LT_TAGVAR(postdeps,$1)='-library=Cstd -library=Crun' fi ;; esac ;; solaris*) case $cc_basename in 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 # -library=stlport4 depends on it. case " $CXX $CXXFLAGS " in *" -library=stlport4 "*) solaris_use_stlport4=yes ;; esac # Adding this requires a known-good setup of shared libraries for # Sun compiler versions before 5.6, else PIC objects from an old # archive will be linked into the output, leading to subtle bugs. if test "$solaris_use_stlport4" != yes; then _LT_TAGVAR(postdeps,$1)='-library=Cstd -library=Crun' fi ;; esac ;; esac ]) case " $_LT_TAGVAR(postdeps, $1) " in *" -lc "*) _LT_TAGVAR(archive_cmds_need_lc, $1)=no ;; esac _LT_TAGVAR(compiler_lib_search_dirs, $1)= if test -n "${_LT_TAGVAR(compiler_lib_search_path, $1)}"; then _LT_TAGVAR(compiler_lib_search_dirs, $1)=`echo " ${_LT_TAGVAR(compiler_lib_search_path, $1)}" | ${SED} -e 's! -L! !g' -e 's!^ !!'` fi _LT_TAGDECL([], [compiler_lib_search_dirs], [1], [The directories searched by this compiler when creating a shared library]) _LT_TAGDECL([], [predep_objects], [1], [Dependencies to place before and after the objects being linked to create a shared library]) _LT_TAGDECL([], [postdep_objects], [1]) _LT_TAGDECL([], [predeps], [1]) _LT_TAGDECL([], [postdeps], [1]) _LT_TAGDECL([], [compiler_lib_search_path], [1], [The library search path used internally by the compiler when linking a shared library]) ])# _LT_SYS_HIDDEN_LIBDEPS # _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_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)= _LT_TAGVAR(always_export_symbols, $1)=no _LT_TAGVAR(archive_expsym_cmds, $1)= _LT_TAGVAR(export_dynamic_flag_spec, $1)= _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_direct_absolute, $1)=no _LT_TAGVAR(hardcode_libdir_flag_spec, $1)= _LT_TAGVAR(hardcode_libdir_separator, $1)= _LT_TAGVAR(hardcode_minus_L, $1)=no _LT_TAGVAR(hardcode_automatic, $1)=no _LT_TAGVAR(inherit_rpath, $1)=no _LT_TAGVAR(module_cmds, $1)= _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 # Source file extension for f77 test sources. ac_ext=f # Object file extension for compiled f77 test sources. objext=o _LT_TAGVAR(objext, $1)=$objext # No sense in running all these tests if we already determined that # the F77 compiler isn't working. Some variables (like enable_shared) # are currently assumed to apply to all compilers on this platform, # and will be corrupted by setting them based on a non-working compiler. if test "$_lt_disable_F77" != yes; then # Code to be used in simple compile tests lt_simple_compile_test_code="\ subroutine t return end " # Code to be used in simple link tests lt_simple_link_test_code="\ program t end " # 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_GCC=$GCC lt_save_CFLAGS=$CFLAGS CC=${F77-"f77"} CFLAGS=$FFLAGS compiler=$CC _LT_TAGVAR(compiler, $1)=$CC _LT_CC_BASENAME([$compiler]) GCC=$G77 if test -n "$compiler"; then AC_MSG_CHECKING([if libtool supports shared libraries]) AC_MSG_RESULT([$can_build_shared]) AC_MSG_CHECKING([whether to build shared libraries]) test "$can_build_shared" = "no" && enable_shared=no # On AIX, shared libraries and static libraries use the same namespace, and # are all built from PIC. case $host_os in aix3*) test "$enable_shared" = yes && enable_static=no if test -n "$RANLIB"; then archive_cmds="$archive_cmds~\$RANLIB \$lib" postinstall_cmds='$RANLIB $lib' fi ;; aix[[4-9]]*) if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then test "$enable_shared" = yes && enable_static=no fi ;; esac AC_MSG_RESULT([$enable_shared]) AC_MSG_CHECKING([whether to build static libraries]) # Make sure either enable_shared or enable_static is yes. test "$enable_shared" = yes || enable_static=yes AC_MSG_RESULT([$enable_static]) _LT_TAGVAR(GCC, $1)="$G77" _LT_TAGVAR(LD, $1)="$LD" ## 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... _LT_COMPILER_PIC($1) _LT_COMPILER_C_O($1) _LT_COMPILER_FILE_LOCKS($1) _LT_LINKER_SHLIBS($1) _LT_SYS_DYNAMIC_LINKER($1) _LT_LINKER_HARDCODE_LIBPATH($1) _LT_CONFIG($1) fi # test -n "$compiler" 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_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_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)= _LT_TAGVAR(always_export_symbols, $1)=no _LT_TAGVAR(archive_expsym_cmds, $1)= _LT_TAGVAR(export_dynamic_flag_spec, $1)= _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_direct_absolute, $1)=no _LT_TAGVAR(hardcode_libdir_flag_spec, $1)= _LT_TAGVAR(hardcode_libdir_separator, $1)= _LT_TAGVAR(hardcode_minus_L, $1)=no _LT_TAGVAR(hardcode_automatic, $1)=no _LT_TAGVAR(inherit_rpath, $1)=no _LT_TAGVAR(module_cmds, $1)= _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 # Source file extension for fc test sources. ac_ext=${ac_fc_srcext-f} # Object file extension for compiled fc test sources. objext=o _LT_TAGVAR(objext, $1)=$objext # No sense in running all these tests if we already determined that # the FC compiler isn't working. Some variables (like enable_shared) # are currently assumed to apply to all compilers on this platform, # and will be corrupted by setting them based on a non-working compiler. if test "$_lt_disable_FC" != yes; then # Code to be used in simple compile tests lt_simple_compile_test_code="\ subroutine t return end " # Code to be used in simple link tests lt_simple_link_test_code="\ program t end " # 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_GCC=$GCC lt_save_CFLAGS=$CFLAGS CC=${FC-"f95"} CFLAGS=$FCFLAGS compiler=$CC GCC=$ac_cv_fc_compiler_gnu _LT_TAGVAR(compiler, $1)=$CC _LT_CC_BASENAME([$compiler]) if test -n "$compiler"; then AC_MSG_CHECKING([if libtool supports shared libraries]) AC_MSG_RESULT([$can_build_shared]) AC_MSG_CHECKING([whether to build shared libraries]) test "$can_build_shared" = "no" && enable_shared=no # On AIX, shared libraries and static libraries use the same namespace, and # are all built from PIC. case $host_os in aix3*) test "$enable_shared" = yes && enable_static=no if test -n "$RANLIB"; then archive_cmds="$archive_cmds~\$RANLIB \$lib" postinstall_cmds='$RANLIB $lib' fi ;; aix[[4-9]]*) if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then test "$enable_shared" = yes && enable_static=no fi ;; esac AC_MSG_RESULT([$enable_shared]) AC_MSG_CHECKING([whether to build static libraries]) # Make sure either enable_shared or enable_static is yes. test "$enable_shared" = yes || enable_static=yes AC_MSG_RESULT([$enable_static]) _LT_TAGVAR(GCC, $1)="$ac_cv_fc_compiler_gnu" _LT_TAGVAR(LD, $1)="$LD" ## 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... _LT_SYS_HIDDEN_LIBDEPS($1) _LT_COMPILER_PIC($1) _LT_COMPILER_C_O($1) _LT_COMPILER_FILE_LOCKS($1) _LT_LINKER_SHLIBS($1) _LT_SYS_DYNAMIC_LINKER($1) _LT_LINKER_HARDCODE_LIBPATH($1) _LT_CONFIG($1) fi # test -n "$compiler" GCC=$lt_save_GCC CC=$lt_save_CC CFLAGS=$lt_save_CFLAGS fi # test "$_lt_disable_FC" != yes AC_LANG_POP ])# _LT_LANG_FC_CONFIG # _LT_LANG_GCJ_CONFIG([TAG]) # -------------------------- # Ensure that the configuration variables for the GNU Java Compiler compiler # are suitably defined. These variables are subsequently used by _LT_CONFIG # to write the compiler configuration to `libtool'. m4_defun([_LT_LANG_GCJ_CONFIG], [AC_REQUIRE([LT_PROG_GCJ])dnl AC_LANG_SAVE # Source file extension for Java test sources. ac_ext=java # Object file extension for compiled Java test sources. objext=o _LT_TAGVAR(objext, $1)=$objext # Code to be used in simple compile tests lt_simple_compile_test_code="class foo {}" # Code to be used in simple link tests lt_simple_link_test_code='public class conftest { public static void main(String[[]] argv) {}; }' # 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=${GCJ-"gcj"} CFLAGS=$GCJFLAGS compiler=$CC _LT_TAGVAR(compiler, $1)=$CC _LT_TAGVAR(LD, $1)="$LD" _LT_CC_BASENAME([$compiler]) # GCJ 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_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 # are suitably defined. These variables are subsequently used by _LT_CONFIG # to write the compiler configuration to `libtool'. m4_defun([_LT_LANG_RC_CONFIG], [AC_REQUIRE([LT_PROG_RC])dnl AC_LANG_SAVE # Source file extension for RC test sources. ac_ext=rc # Object file extension for compiled RC test sources. objext=o _LT_TAGVAR(objext, $1)=$objext # Code to be used in simple compile tests lt_simple_compile_test_code='sample MENU { MENUITEM "&Soup", 100, CHECKED }' # Code to be used in simple link tests lt_simple_link_test_code="$lt_simple_compile_test_code" # 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= CC=${RC-"windres"} CFLAGS= compiler=$CC _LT_TAGVAR(compiler, $1)=$CC _LT_CC_BASENAME([$compiler]) _LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)=yes if test -n "$compiler"; then : _LT_CONFIG($1) fi GCC=$lt_save_GCC AC_LANG_RESTORE CC=$lt_save_CC CFLAGS=$lt_save_CFLAGS ])# _LT_LANG_RC_CONFIG # LT_PROG_GCJ # ----------- AC_DEFUN([LT_PROG_GCJ], [m4_ifdef([AC_PROG_GCJ], [AC_PROG_GCJ], [m4_ifdef([A][M_PROG_GCJ], [A][M_PROG_GCJ], [AC_CHECK_TOOL(GCJ, gcj,) test "x${GCJFLAGS+set}" = xset || GCJFLAGS="-g -O2" AC_SUBST(GCJFLAGS)])])[]dnl ]) # Old name: AU_ALIAS([LT_AC_PROG_GCJ], [LT_PROG_GCJ]) dnl aclocal-1.4 backwards compatibility: 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], [AC_CHECK_TOOL(RC, windres,) ]) # Old name: AU_ALIAS([LT_AC_PROG_RC], [LT_PROG_RC]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([LT_AC_PROG_RC], []) # _LT_DECL_EGREP # -------------- # If we don't have a new enough Autoconf to choose the best grep # available, choose the one first in the user's PATH. m4_defun([_LT_DECL_EGREP], [AC_REQUIRE([AC_PROG_EGREP])dnl AC_REQUIRE([AC_PROG_FGREP])dnl test -z "$GREP" && GREP=grep _LT_DECL([], [GREP], [1], [A grep program that handles long lines]) _LT_DECL([], [EGREP], [1], [An ERE matcher]) _LT_DECL([], [FGREP], [1], [A literal string matcher]) dnl Non-bleeding-edge autoconf doesn't subst GREP, so do it here too AC_SUBST([GREP]) ]) # _LT_DECL_OBJDUMP # -------------- # If we don't have a new enough Autoconf to choose the best objdump # available, choose the one first in the user's PATH. m4_defun([_LT_DECL_OBJDUMP], [AC_CHECK_TOOL(OBJDUMP, objdump, false) test -z "$OBJDUMP" && OBJDUMP=objdump _LT_DECL([], [OBJDUMP], [1], [An object symbol dumper]) 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 # ------------ # Check for a fully-functional sed program, that truncates # as few characters as possible. Prefer GNU sed if found. m4_defun([_LT_DECL_SED], [AC_PROG_SED test -z "$SED" && SED=sed Xsed="$SED -e 1s/^X//" _LT_DECL([], [SED], [1], [A sed program that does not truncate output]) _LT_DECL([], [Xsed], ["\$SED -e 1s/^X//"], [Sed that helps us avoid accidentally triggering echo(1) options like -n]) ])# _LT_DECL_SED m4_ifndef([AC_PROG_SED], [ ############################################################ # NOTE: This macro has been submitted for inclusion into # # GNU Autoconf as AC_PROG_SED. When it is available in # # a released version of Autoconf we should remove this # # macro and use it instead. # ############################################################ m4_defun([AC_PROG_SED], [AC_MSG_CHECKING([for a sed that does not truncate output]) AC_CACHE_VAL(lt_cv_path_SED, [# Loop through the user's path and test for sed and gsed. # Then use that list of sed's as ones to test for truncation. as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for lt_ac_prog in sed gsed; do for ac_exec_ext in '' $ac_executable_extensions; do if $as_executable_p "$as_dir/$lt_ac_prog$ac_exec_ext"; then lt_ac_sed_list="$lt_ac_sed_list $as_dir/$lt_ac_prog$ac_exec_ext" fi done done done IFS=$as_save_IFS lt_ac_max=0 lt_ac_count=0 # Add /usr/xpg4/bin/sed as it is typically found on Solaris # along with /bin/sed that truncates output. for lt_ac_sed in $lt_ac_sed_list /usr/xpg4/bin/sed; do test ! -f $lt_ac_sed && continue cat /dev/null > conftest.in lt_ac_count=0 echo $ECHO_N "0123456789$ECHO_C" >conftest.in # Check for GNU sed and select it if it is found. if "$lt_ac_sed" --version 2>&1 < /dev/null | grep 'GNU' > /dev/null; then lt_cv_path_SED=$lt_ac_sed break fi while true; do cat conftest.in conftest.in >conftest.tmp mv conftest.tmp conftest.in cp conftest.in conftest.nl echo >>conftest.nl $lt_ac_sed -e 's/a$//' < conftest.nl >conftest.out || break cmp -s conftest.out conftest.nl || break # 10000 chars as input seems more than enough test $lt_ac_count -gt 10 && break lt_ac_count=`expr $lt_ac_count + 1` if test $lt_ac_count -gt $lt_ac_max; then lt_ac_max=$lt_ac_count lt_cv_path_SED=$lt_ac_sed fi done done ]) SED=$lt_cv_path_SED AC_SUBST([SED]) AC_MSG_RESULT([$SED]) ])#AC_PROG_SED ])#m4_ifndef # Old name: AU_ALIAS([LT_AC_PROG_SED], [AC_PROG_SED]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([LT_AC_PROG_SED], []) # _LT_CHECK_SHELL_FEATURES # ------------------------ # Find out whether the shell is Bourne or XSI compatible, # or has some other useful features. m4_defun([_LT_CHECK_SHELL_FEATURES], [AC_MSG_CHECKING([whether the shell understands some XSI constructs]) # Try some XSI features xsi_shell=no ( _lt_dummy="a/b/c" 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 AC_MSG_RESULT([$xsi_shell]) _LT_CONFIG_LIBTOOL_INIT([xsi_shell='$xsi_shell']) AC_MSG_CHECKING([whether the shell understands "+="]) lt_shell_append=no ( foo=bar; set foo baz; eval "$[1]+=\$[2]" && test "$foo" = barbaz ) \ >/dev/null 2>&1 \ && lt_shell_append=yes AC_MSG_RESULT([$lt_shell_append]) _LT_CONFIG_LIBTOOL_INIT([lt_shell_append='$lt_shell_append']) if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then lt_unset=unset else lt_unset=false fi _LT_DECL([], [lt_unset], [0], [whether the shell understands "unset"])dnl # test EBCDIC or ASCII case `echo X|tr X '\101'` in A) # ASCII based system # \n is not interpreted correctly by Solaris 8 /usr/ucb/tr lt_SP2NL='tr \040 \012' lt_NL2SP='tr \015\012 \040\040' ;; *) # EBCDIC based system lt_SP2NL='tr \100 \n' lt_NL2SP='tr \r\n \100\100' ;; esac _LT_DECL([SP2NL], [lt_SP2NL], [1], [turn spaces into newlines])dnl _LT_DECL([NL2SP], [lt_NL2SP], [1], [turn newlines into spaces])dnl ])# _LT_CHECK_SHELL_FEATURES # _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=: ]) # _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_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}"}]) _LT_PROG_FUNCTION_REPLACE([func_split_long_opt], [dnl func_split_long_opt_name=${1%%=*} func_split_long_opt_arg=${1#*=}]) _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"}]) _LT_PROG_FUNCTION_REPLACE([func_lo2o], [dnl case ${1} in *.lo) func_lo2o_result=${1%.lo}.${objext} ;; *) func_lo2o_result=${1} ;; esac]) _LT_PROG_FUNCTION_REPLACE([func_xform], [ func_xform_result=${1%.*}.lo]) _LT_PROG_FUNCTION_REPLACE([func_arith], [ func_arith_result=$(( $[*] ))]) _LT_PROG_FUNCTION_REPLACE([func_len], [ func_len_result=${#1}]) fi if test x"$lt_shell_append" = xyes; then _LT_PROG_FUNCTION_REPLACE([func_append], [ eval "${1}+=\\${2}"]) _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"]) # 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 AC_MSG_WARN([Unable to substitute extended shell functions in $ofile]) fi ]) # _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 ;; *-*-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 ]) 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 tango-8.1.2c+dfsg.orig/lib/cpp/log4tango/m4/ltsugar.m40000644000175000017500000001042412205375127021271 0ustar piccapicca# ltsugar.m4 -- libtool m4 base layer. -*-Autoconf-*- # # Copyright (C) 2004, 2005, 2007, 2008 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 ltsugar.m4 # This is to help aclocal find these macros, as it can't see m4_define. AC_DEFUN([LTSUGAR_VERSION], [m4_if([0.1])]) # lt_join(SEP, ARG1, [ARG2...]) # ----------------------------- # Produce ARG1SEPARG2...SEPARGn, omitting [] arguments and their # associated separator. # Needed until we can rely on m4_join from Autoconf 2.62, since all earlier # versions in m4sugar had bugs. m4_define([lt_join], [m4_if([$#], [1], [], [$#], [2], [[$2]], [m4_if([$2], [], [], [[$2]_])$0([$1], m4_shift(m4_shift($@)))])]) m4_define([_lt_join], [m4_if([$#$2], [2], [], [m4_if([$2], [], [], [[$1$2]])$0([$1], m4_shift(m4_shift($@)))])]) # lt_car(LIST) # lt_cdr(LIST) # ------------ # Manipulate m4 lists. # These macros are necessary as long as will still need to support # Autoconf-2.59 which quotes differently. m4_define([lt_car], [[$1]]) m4_define([lt_cdr], [m4_if([$#], 0, [m4_fatal([$0: cannot be called without arguments])], [$#], 1, [], [m4_dquote(m4_shift($@))])]) m4_define([lt_unquote], $1) # lt_append(MACRO-NAME, STRING, [SEPARATOR]) # ------------------------------------------ # Redefine MACRO-NAME to hold its former content plus `SEPARATOR'`STRING'. # Note that neither SEPARATOR nor STRING are expanded; they are appended # to MACRO-NAME as is (leaving the expansion for when MACRO-NAME is invoked). # No SEPARATOR is output if MACRO-NAME was previously undefined (different # than defined and empty). # # This macro is needed until we can rely on Autoconf 2.62, since earlier # versions of m4sugar mistakenly expanded SEPARATOR but not STRING. m4_define([lt_append], [m4_define([$1], m4_ifdef([$1], [m4_defn([$1])[$3]])[$2])]) # lt_combine(SEP, PREFIX-LIST, INFIX, SUFFIX1, [SUFFIX2...]) # ---------------------------------------------------------- # Produce a SEP delimited list of all paired combinations of elements of # PREFIX-LIST with SUFFIX1 through SUFFIXn. Each element of the list # has the form PREFIXmINFIXSUFFIXn. # Needed until we can rely on m4_combine added in Autoconf 2.62. m4_define([lt_combine], [m4_if(m4_eval([$# > 3]), [1], [m4_pushdef([_Lt_sep], [m4_define([_Lt_sep], m4_defn([lt_car]))])]]dnl [[m4_foreach([_Lt_prefix], [$2], [m4_foreach([_Lt_suffix], ]m4_dquote(m4_dquote(m4_shift(m4_shift(m4_shift($@)))))[, [_Lt_sep([$1])[]m4_defn([_Lt_prefix])[$3]m4_defn([_Lt_suffix])])])])]) # lt_if_append_uniq(MACRO-NAME, VARNAME, [SEPARATOR], [UNIQ], [NOT-UNIQ]) # ----------------------------------------------------------------------- # Iff MACRO-NAME does not yet contain VARNAME, then append it (delimited # by SEPARATOR if supplied) and expand UNIQ, else NOT-UNIQ. m4_define([lt_if_append_uniq], [m4_ifdef([$1], [m4_if(m4_index([$3]m4_defn([$1])[$3], [$3$2$3]), [-1], [lt_append([$1], [$2], [$3])$4], [$5])], [lt_append([$1], [$2], [$3])$4])]) # lt_dict_add(DICT, KEY, VALUE) # ----------------------------- m4_define([lt_dict_add], [m4_define([$1($2)], [$3])]) # lt_dict_add_subkey(DICT, KEY, SUBKEY, VALUE) # -------------------------------------------- m4_define([lt_dict_add_subkey], [m4_define([$1($2:$3)], [$4])]) # lt_dict_fetch(DICT, KEY, [SUBKEY]) # ---------------------------------- m4_define([lt_dict_fetch], [m4_ifval([$3], m4_ifdef([$1($2:$3)], [m4_defn([$1($2:$3)])]), m4_ifdef([$1($2)], [m4_defn([$1($2)])]))]) # lt_if_dict_fetch(DICT, KEY, [SUBKEY], VALUE, IF-TRUE, [IF-FALSE]) # ----------------------------------------------------------------- m4_define([lt_if_dict_fetch], [m4_if(lt_dict_fetch([$1], [$2], [$3]), [$4], [$5], [$6])]) # lt_dict_filter(DICT, [SUBKEY], VALUE, [SEPARATOR], KEY, [...]) # -------------------------------------------------------------- m4_define([lt_dict_filter], [m4_if([$5], [], [], [lt_join(m4_quote(m4_default([$4], [[, ]])), lt_unquote(m4_split(m4_normalize(m4_foreach(_Lt_key, lt_car([m4_shiftn(4, $@)]), [lt_if_dict_fetch([$1], _Lt_key, [$2], [$3], [_Lt_key ])])))))])[]dnl ]) tango-8.1.2c+dfsg.orig/lib/cpp/log4tango/doc/0000755000175000017500000000000012205375306017571 5ustar piccapiccatango-8.1.2c+dfsg.orig/lib/cpp/log4tango/doc/Makefile.in0000644000175000017500000004507112205375130021640 0ustar piccapicca# Makefile.in generated by automake 1.11.3 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 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. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ subdir = doc DIST_COMMON = $(srcdir)/Doxyfile.in $(srcdir)/Makefile.am \ $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/AC_CREATE_PREFIX_CONFIG_H.m4 \ $(top_srcdir)/m4/AC_CXX_HAVE_SSTREAM.m4 \ $(top_srcdir)/m4/AC_CXX_NAMESPACES.m4 \ $(top_srcdir)/m4/AC_C_INT64_T.m4 \ $(top_srcdir)/m4/AC_FUNC_SNPRINTF.m4 \ $(top_srcdir)/m4/BB_CHECK_PTHREADS.m4 \ $(top_srcdir)/m4/BB_ENABLE_DOXYGEN.m4 \ $(top_srcdir)/m4/CREATE_GENERIC_CONFIG.m4 \ $(top_srcdir)/m4/PETI_PEDANTIC_GCC.m4 \ $(top_srcdir)/m4/RSSH_CHECK_SUNPRO_CC.m4 \ $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/configure.in am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(SHELL) $(top_srcdir)/config/mkinstalldirs CONFIG_HEADER = $(top_builddir)/include/config.h CONFIG_CLEAN_FILES = Doxyfile CONFIG_CLEAN_VPATH_FILES = SOURCES = DIST_SOURCES = RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \ html-recursive info-recursive install-data-recursive \ install-dvi-recursive install-exec-recursive \ install-html-recursive install-info-recursive \ install-pdf-recursive install-ps-recursive install-recursive \ installcheck-recursive installdirs-recursive pdf-recursive \ ps-recursive uninstall-recursive 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 ETAGS = etags CTAGS = ctags DIST_SUBDIRS = $(SUBDIRS) DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) am__relativize = \ dir0=`pwd`; \ sed_first='s,^\([^/]*\)/.*$$,\1,'; \ sed_rest='s,^[^/]*/*,,'; \ sed_last='s,^.*/\([^/]*\)$$,\1,'; \ sed_butlast='s,/*[^/]*$$,,'; \ while test -n "$$dir1"; do \ first=`echo "$$dir1" | sed -e "$$sed_first"`; \ if test "$$first" != "."; then \ if test "$$first" = ".."; then \ dir2=`echo "$$dir0" | sed -e "$$sed_last"`/"$$dir2"; \ dir0=`echo "$$dir0" | sed -e "$$sed_butlast"`; \ else \ first2=`echo "$$dir2" | sed -e "$$sed_first"`; \ if test "$$first2" = "$$first"; then \ dir2=`echo "$$dir2" | sed -e "$$sed_rest"`; \ else \ dir2="../$$dir2"; \ fi; \ dir0="$$dir0"/"$$first"; \ fi; \ fi; \ dir1=`echo "$$dir1" | sed -e "$$sed_rest"`; \ done; \ reldir="$$dir2" ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DOT = @DOT@ DOXYGEN = @DOXYGEN@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ GENERIC_CONFIG = @GENERIC_CONFIG@ GREP = @GREP@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ LT_VERSION = @LT_VERSION@ MAINT = @MAINT@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ VERSION = @VERSION@ 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@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ enable_dot = @enable_dot@ enable_html_docs = @enable_html_docs@ enable_latex_docs = @enable_latex_docs@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ SUBDIRS = html man3dir = $(mandir)/man3 docdir_log = $(docdir)/@PACKAGE_TARNAME@-@PACKAGE_VERSION@ EXTRA_DIST = \ mainPage.txt all: all-recursive .SUFFIXES: $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu doc/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu doc/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): Doxyfile: $(top_builddir)/config.status $(srcdir)/Doxyfile.in cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ mostlyclean-libtool: -rm -f *.lo clean-libtool: -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. $(RECURSIVE_TARGETS): @fail= failcom='exit 1'; \ for f in x $$MAKEFLAGS; do \ case $$f in \ *=* | --[!k]*);; \ *k*) failcom='fail=yes';; \ esac; \ done; \ dot_seen=no; \ target=`echo $@ | sed s/-recursive//`; \ list='$(SUBDIRS)'; for subdir in $$list; do \ echo "Making $$target in $$subdir"; \ if test "$$subdir" = "."; then \ dot_seen=yes; \ local_target="$$target-am"; \ else \ local_target="$$target"; \ fi; \ ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ || eval $$failcom; \ done; \ if test "$$dot_seen" = "no"; then \ $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \ fi; test -z "$$fail" $(RECURSIVE_CLEAN_TARGETS): @fail= failcom='exit 1'; \ for f in x $$MAKEFLAGS; do \ case $$f in \ *=* | --[!k]*);; \ *k*) failcom='fail=yes';; \ esac; \ done; \ dot_seen=no; \ case "$@" in \ distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \ *) list='$(SUBDIRS)' ;; \ esac; \ rev=''; for subdir in $$list; do \ if test "$$subdir" = "."; then :; else \ rev="$$subdir $$rev"; \ fi; \ done; \ rev="$$rev ."; \ target=`echo $@ | sed s/-recursive//`; \ for subdir in $$rev; do \ echo "Making $$target in $$subdir"; \ if test "$$subdir" = "."; then \ local_target="$$target-am"; \ else \ local_target="$$target"; \ fi; \ ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ || eval $$failcom; \ done && test -z "$$fail" tags-recursive: list='$(SUBDIRS)'; for subdir in $$list; do \ test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \ done ctags-recursive: list='$(SUBDIRS)'; for subdir in $$list; do \ test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \ done ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ mkid -fID $$unique tags: TAGS TAGS: tags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) set x; \ here=`pwd`; \ if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \ include_option=--etags-include; \ empty_fix=.; \ else \ include_option=--include; \ empty_fix=; \ fi; \ list='$(SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ test ! -f $$subdir/TAGS || \ set "$$@" "$$include_option=$$here/$$subdir/TAGS"; \ fi; \ done; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: CTAGS CTAGS: ctags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ 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 \ dir1=$$subdir; dir2="$(distdir)/$$subdir"; \ $(am__relativize); \ new_distdir=$$reldir; \ dir1=$$subdir; dir2="$(top_distdir)"; \ $(am__relativize); \ new_top_distdir=$$reldir; \ echo " (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir="$$new_top_distdir" distdir="$$new_distdir" \\"; \ echo " am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)"; \ ($(am__cd) $$subdir && \ $(MAKE) $(AM_MAKEFLAGS) \ top_distdir="$$new_top_distdir" \ distdir="$$new_distdir" \ am__remove_distdir=: \ am__skip_length_check=: \ am__skip_mode_fix=: \ distdir) \ || exit 1; \ fi; \ done check-am: all-am check: check-recursive all-am: Makefile all-local installdirs: installdirs-recursive installdirs-am: install: install-recursive install-exec: install-exec-recursive install-data: install-data-recursive uninstall: uninstall-recursive install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-recursive install-strip: 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: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-recursive clean-am: clean-generic clean-libtool clean-local mostlyclean-am distclean: distclean-recursive -rm -f Makefile distclean-am: clean-am distclean-generic distclean-tags dvi: dvi-recursive dvi-am: html: html-recursive html-am: info: info-recursive info-am: install-data-am: install-data-local install-dvi: install-dvi-recursive install-dvi-am: install-exec-am: install-html: install-html-recursive install-html-am: install-info: install-info-recursive install-info-am: install-man: install-pdf: install-pdf-recursive install-pdf-am: install-ps: install-ps-recursive install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-recursive -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-recursive mostlyclean-am: mostlyclean-generic mostlyclean-libtool pdf: pdf-recursive pdf-am: ps: ps-recursive ps-am: uninstall-am: uninstall-local .MAKE: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) ctags-recursive \ 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-local ctags ctags-recursive distclean \ 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-data-local 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-generic mostlyclean-libtool pdf pdf-am \ ps ps-am tags tags-recursive uninstall uninstall-am \ uninstall-local .PHONY: dox pdf all-local: dox dox: html html/api/index.html html/api/index.html: Doxyfile @DOXYGEN@ install-data-local: $(mkinstalldirs) $(DESTDIR)$(man3dir) @for i in ./man/man3/log4tango.3 ./man/man3/log4tango_*.3; do \ inst=`basename $$i | sed 's/_/::/g'`; \ echo "$(INSTALL_DATA) $$i $(DESTDIR)$(man3dir)/$$inst"; \ $(INSTALL_DATA) $$i $(DESTDIR)$(man3dir)/$$inst; \ done $(mkinstalldirs) $(DESTDIR)$(docdir_log) cp -r html/. $(DESTDIR)$(docdir_log) $(RM) -r -f $(DESTDIR)$(docdir_log)/CVS \ $(DESTDIR)$(docdir_log)/Makefile.am \ $(DESTDIR)$(docdir_log)/Makefile.in \ $(DESTDIR)$(docdir_log)/Makefile uninstall-local: $(RM) $(DESTDIR)$(man3dir)/log4tango.3 $(RM) $(DESTDIR)$(man3dir)/log4tango::*.3 $(RM) -r -f $(DESTDIR)$(docdir_log) clean-local: $(RM) -r latex $(RM) -r html/api man @PACKAGE_TARNAME@.ps @PACKAGE_TARNAME@.pdf # 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: tango-8.1.2c+dfsg.orig/lib/cpp/log4tango/doc/html/0000755000175000017500000000000012205375306020535 5ustar piccapiccatango-8.1.2c+dfsg.orig/lib/cpp/log4tango/doc/html/default.css0000644000175000017500000000030312205375130022662 0ustar piccapiccaBODY { BACKGROUND-COLOR: white } H2 { color: white; background-color: darkBlue; font-family: arial,helvetica,sanserif; } H3 { text-decoration: underline; } DT { font-weight: bold; } tango-8.1.2c+dfsg.orig/lib/cpp/log4tango/doc/html/Makefile.in0000644000175000017500000002450212205375130022600 0ustar piccapicca# Makefile.in generated by automake 1.11.3 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 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. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ subdir = doc/html DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/AC_CREATE_PREFIX_CONFIG_H.m4 \ $(top_srcdir)/m4/AC_CXX_HAVE_SSTREAM.m4 \ $(top_srcdir)/m4/AC_CXX_NAMESPACES.m4 \ $(top_srcdir)/m4/AC_C_INT64_T.m4 \ $(top_srcdir)/m4/AC_FUNC_SNPRINTF.m4 \ $(top_srcdir)/m4/BB_CHECK_PTHREADS.m4 \ $(top_srcdir)/m4/BB_ENABLE_DOXYGEN.m4 \ $(top_srcdir)/m4/CREATE_GENERIC_CONFIG.m4 \ $(top_srcdir)/m4/PETI_PEDANTIC_GCC.m4 \ $(top_srcdir)/m4/RSSH_CHECK_SUNPRO_CC.m4 \ $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/configure.in am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(SHELL) $(top_srcdir)/config/mkinstalldirs CONFIG_HEADER = $(top_builddir)/include/config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = SOURCES = DIST_SOURCES = DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DOT = @DOT@ DOXYGEN = @DOXYGEN@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ GENERIC_CONFIG = @GENERIC_CONFIG@ GREP = @GREP@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ LT_VERSION = @LT_VERSION@ MAINT = @MAINT@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ VERSION = @VERSION@ 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@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ enable_dot = @enable_dot@ enable_html_docs = @enable_html_docs@ enable_latex_docs = @enable_latex_docs@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ EXTRA_DIST = \ index.html \ default.css \ sflogo.png all: all-am .SUFFIXES: $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu doc/html/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu doc/html/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs tags: TAGS TAGS: ctags: CTAGS CTAGS: distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile installdirs: install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: 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: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-generic clean-libtool mostlyclean-am distclean: distclean-am -rm -f Makefile distclean-am: clean-am distclean-generic dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-generic mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: .MAKE: install-am install-strip .PHONY: all all-am check check-am clean clean-generic clean-libtool \ distclean distclean-generic distclean-libtool 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-generic \ mostlyclean-libtool pdf pdf-am ps ps-am uninstall uninstall-am # 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: tango-8.1.2c+dfsg.orig/lib/cpp/log4tango/doc/html/index.html0000644000175000017500000002754712205375130022544 0ustar piccapicca Log for Tango

Log4Tango

Introduction

"Log4Tango" is a light and custom version of Log4cpp for Tango. Log4cpp is library of C++ classes for flexible logging to miscelaneous destinations. It is modeled after the Log4j Java library.

Download

log4tango is part of the TANGO distribution. There is no way to obtain log4tango individually.

Building Log4Tango

The pthread (i.e. POSIX thread) library is required to compile log4tango.

log4tango can be build using autoconf on platforms that support it. Simply do:

./configure
make
make check
make install

This will install log4tango under /usr/local. To install in another localation specify --prefix=<location> when running configure.

Options for ./configure

Besides the usual ./configure options like --prefix a few others are available:
--enable-doxyen
Enables generation of API documentation by Dimitri van Heeschs Doxygen tool (http://www.doxygen.org/). Defaults to yes if doxygen can be found in the search path.
--enable-html-docs
If doxygen is enabled, have it generate HTML formatted documentation.
--enable-latex-docs
If doxygen is enabled, have it generate LaTeX formatted documentation.
--enable-dot
Let Doxygen use the 'dot' tool of GraphViz (http://www.graphviz.org) todraw its graphs.

Build notes for specific platforms

*nix (including Linux) - g++ compiler
Log4cpp should build whitout modification on any decent *nix system with g++ and GNU make. The primary development platform is RedHat Linux 7.3, which has g++ 2.96-rh, but the aim is to be compatible with from g++ 2.95 and up. When g++ 3.x has been widely adopted we may drop support for older g++ versions.
Solaris - Sun CC compiler
Compilation with Suns CC compiler requires setting some enviroment variables. Also static libraries appear not to work. In short do:
CC=CC CXX=CC LD="CC -KPIC" ./configure --disable-static
Win32 - MSVC++ 6
Use the workspace and project files in subdirectory msvc6. You may need to adjust include/log4cpp/config-win32.h and the project files to your particular needs.

Releases

2.2.0 - based on log4cpp-0.3.4b (24 February 2003)

Documentation

API Documentation generated by Doxygen can be found here.

FAQ

1. GENERAL

1.1. What is Log for C++?

Log for C++ is a library of C++ classes for flexible logging to misc. destinations. It is modeled after the Log for Java library (http://jakarta.apache.org/log4j/).

1.2. How is Log for C++ related to Log4j? Is it a straight port?

Log for C++ strives to supply a similar interface for logging in C++ as Log4j provides in Java. However the implementation is not a translation of the Java code. So in that sense it is not a 'port' of Log4j. Of course Log for C++ does owe many of its concepts to log4j.

1.3. What is the name of this project, 'Log for C++' or 'log4cpp'?

The 'official' long name of the project is 'Log for C++', but in practice, the short name, 'log4cpp' has proven more convinient.

1.4. Under which license is Log for C++ available?

As of version 0.2.1 Log for C++ is released under the GNU Lesser General Public License (LGPL). Versions before that have been released under the GPL. See the license discussion on the forum at SourceForge for the motivations behind switching from GPL to LGPL.

1.5. Our legal department doesn't like the LGPL, can you release Log for C++ under license XYZ?

No.
Long answer: Technically it may be possible if every contributor agrees, which due to their growing number has become increasingly difficult. But even if that could be overcome it will not happen.
Of course the LGPL does grant you the opportunity to choose the GPL instead of the LGPL, but I bet XYZ != GPL.

2. COMPILATION AND INSTALLATION

3. USAGE

3.1. I've succesfully compiled log4cpp, now how do I use this stuff?

For some small examples using log4cpp, see the 'tests' subdirectory. Also see the documentation section for a pointer for API documentation and more usage information.

3.2. Is log4cpp thread-safe?

4. PROBLEMS AND ERROR MESSAGES

4.1. I get 'Naming collision for 'ERROR' detected. Please read the FAQ for a workaround.'

This is caused by the rudeness of some platforms, which mutilate the namespace with some blunt #defines. To be more precise, the Win32 API includes #defines of 'ERROR' and 'DEBUG'. Since the preprocessor is unaware of C++ naming scopes this results in reserving the words ERROR and DEBUG litterally everywhere. In particular this conflicts with log4cpp::Prioritiy::ERROR and log4cpp::Priority::DEBUG. These latter two names come from log4j, so they are not something we made up ourselves.
They Win32 authors should not have rudelessly claimed these generic names through the preprocessor. There are much better alternatives:
  1. If they use it as an integer constant, declare it using a language construct. Either 'enum {ERROR=1};' or 'static const int ERROR=1;' would do fine.
  2. Use a less generic name like WIN32API_ERROR to make naming conflicts less likely
  3. In case they use it as a flag for conditional compilation, use '#define DEBUG DEBUG' and '#if defined(DEBUG)'. In that case the preprocessor would simply replace all occurrences of 'DEBUG' in the source code with 'DEBUG', in effect leaving everything intact.

Of course the proper solution would be if the offending party would use one of the above methods, but we could have to wait some time for this to actually happen. As an alternative log4cpp can workaround these #defines. The workaround code is enabled by doing #define LOG4CPP_FIX_ERROR_COLLISION 1 before #including any log4cpp header files and after #including all platform headers. For Win32 platforms this #define has already been included in log4cpp/config-win32.h.

Once log4cpp has been updated to the log4j 1.2 API we can get rid of this problem by adopting the new names for log levels.

4.2. I am trying to compile/link the log4cpp package using the SunWorkshop compiler (CC) on a Solaris 7 machine. The library builds, but the testmain code fails to link properly.

A proper solution for this problem has not been found yet (suggestions are welcome), but James Emery reported success with the following workaround:
  • Disable building of the static library
  • Change the linker from /usr/ucb/ld to CC and enable 'place independent code' (pic).
In short, configure with:
export LD="CC -Kpic" && ./configure --disable-static

4.3. ./configure fails to detect 'snprintf()' on platform XYZ.

./configure does not just check for the presence of a snprintf() function but for C99 compliancy as well. In particular, snprintf() should strictly honour the 'string size' parameter to avoid potential buffer overflow problems. log4cpp falls back to an alternative snprintf() implementation if the OS does not provide a correct one.

Status

As of version 0.3.0 log4cpp has a separate 'stable' and 'development' branches. Releases x.y.z where y is even are considered stable and those where y is odd are experimental (which means that some or all features may be broken).

The latest stable release 0.2.7. New releases of 0.2.x are for bug fixes only, new features will go into 0.3.x and eventually 0.4.x.

People

Coding on Log4cpp was initiated by me (Bastiaan Bakker) late 2000. Since then other people have joined the project or contributed code:
Cedric Le Goater <cedric(at)legoater.com>autoconf setup, various improvements
Marc Welz <marc(at)jade.cs.uct.ac.za>IdsaAppender
Lynn Owen <opl(at)agoby.com>MSVC++ support
Steve Ostlind <s.ostlind(at)pentasafe.com>MSVC++ support, various fixes
Marcel Harkema <marcel(at)debian.org>Debian packaging
Uwe J�er <jaeger(at)varial.de>Borland C++ Builder support
Walter Stroebel <walter.stroebel(at)lifeline.nl>RemoteSyslogAppender
Glen Scott <glen_s(at)yahoo.com>PatternLayout, SimpleConfigurator
Tony Cheung <dragonman(at)asiayeah.com>OpenVMS support
Alex Tapaccos <ATapaccos(at)redfig.com>DailyRollingFileAppender
Brendan B. Boerner <bboerner(at)texas.net>Multiple Appender support for Categories
Paulo Pizarro <paulo.pizarro(at)digitro.com.br>RollingFileAppender
David Resnick <dresnick(at)mobilespear.com>NTEventAppender, integration work
Aaron Ingram <ai8(at)yahoo.com>MSThreads support
Alan Anderson <alan(at)rushmore.com>Win32DebugAppender, PropertyConfigurator
Emiliano Martin <emilianomc(at)terra.es>PThreads support

Project Pages

SourceForge Logo Log4cpp is hosted on SourceForge at http://sourceforge.net/projects/log4cpp/.

Related Projects

Log4cpp is but one of many ports/implementations of the Log4j API. Here's an incomplete list:
log4cAn implementation in C by Cedric Legoater
log4cplusAn indepent C++ implementation by Tad Smith. Worth checking out if you don't like Log4cpp for some reason.

License

As of version 0.2.1 this library is licensed under the Lesser General Public License instead of the General Public License. No further license changes are planned :-).

Log for C++ (short name: log4cpp), a C++ library for flexible logging.
Copyright (C) 2000-2002 LifeLine Networks bv
Copyright (C) 2000-2002 Bastiaan Bakker
Portions Copyright others, see file THANKS and source code.

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
tango-8.1.2c+dfsg.orig/lib/cpp/log4tango/doc/html/Makefile.am0000644000175000017500000000007112205375130022562 0ustar piccapiccaEXTRA_DIST = \ index.html \ default.css \ sflogo.png tango-8.1.2c+dfsg.orig/lib/cpp/log4tango/doc/html/sflogo.png0000644000175000017500000000407712205375130022537 0ustar piccapicca‰PNG  IHDRX쪷gAMA¯È7ŠétEXtSoftwareAdobe ImageReadyqÉe<ÎIDATxÚbTSRf ÄÄ7ïÞá¡ ®¬@L£iˆeºëÖa†·×Xÿ3È[1°±1ð«£éٳ眜‚‚‚dX@gΞ۴eË÷ï?3ÒR”ÄÅO¨fSãfðÈcà‡úðÁõ•ë·?{ùÂzUZJÒØÈHG[ È4êêµk@qNÎwïßeâ@0hÐìuuq¾yõê©“'5µ´\\]ÌÌÍ!âÄ,,(”›ŸGÿ€’’½xéÝÝÑææâÌÉÁññÉ+‰‹X5ä˜c*ØyàŠyD5ÔÕÏœ;'/'WU^ÊÉɹÿÀA ^e%E ÏgÌž}óÖíàÀ 216216>|ô(cnV&0t>þô|fZ*Ð ˆi*ÊJ@rÛÖ­.®®Ò22@ö”I“ˆ9]õíxÿþ}|l $Ò€IJJE€ ®\½(ncmŒ   „ ô<à•”M€1Œ% i?~üàààªJÙÈñïçã LÆÈAôÀËšÿÞ}cKÎÅ 8A!!? “À*V®^dܽw(´]YI (Q 46#5uÕ`0!t0™Zô¢°\°x Ð& û \ MÀP $P|Ó–­@[þüþã;$A ‚€A´¥€ èç鳿= Œ%`À¥€ÚN|ÿþ0%ß½w¨ˆ\]œ0½ ôûÆ«l®ö¸‘6Ø^ €„,ØŸ ÑÖÒD3 —h X  DŠšô9ÐÑ@×] ´œ9 æº:;/\¼ÄÖÆ9Œ1‹% v Æ3gÏBØA ÝÏ´ž#Ç?Ä5@[ Ü]{öÉ{÷î{?|Ãf¤‰+ €Þ" bˆçŽ‘—T‰'Mê&IPÚIÄ ¹ÀTt0þïÞ;Žp„?!©³ìAÀ„t"ГW¯]G x áoÃÈûð E ÞçÏŸ,Y8À¡ IÀL‡©h>Ðp[æ~`²ZÇ ˆ 9Ó `¢hïêZ&€¡Ì–À€€ä”ïß¿cUt ÁÓ6<˜˜YäE~»Ž3 üf1`º‚q÷ž½ðä ‡t PêÈÑ£ÚZZð” ktÂe8@1!g  R`1‰y B.Û®\½ Z\Ë O€ö­\³¨ -øá>ZDá¡!X áN°þµû .+®‚ÝJ_ÖÖx–Ç Ïe—€2‹¤f\Ɇ˜ €QÌl@4ÈØ½¡çÈÑcÀä tÐJˆ¯€ÁL>À´ƒl\xh0DH>r À²9X!™p)ž\7&!®_s'c:ôý»w vÇïð2 R¯£ÈLç *‘Q+@g 9]Æ(Â0ÅÁ 9*^Ooà1Ü\=‹[« .‚>| ‚[i’¦m’ÿ“„¡ËY£ª@ú´KÁ úäÁø³ª9 ,ô¿Q؈P@żw",n’½$¶ã4“e† ò´_ ‚tíûÙV)ìþi¨Žuéú!ÄÍPY}€7æx„ðõ6T„ŠEYä!Æ?¨=FöŸ5n„ˆÁŸgxu õ Rº ŒÿˆlbSÒé ÁÚ×5!jƒÊ²òÀà x³Ðê}îÙ½{ÝÚµ¸dhèÄÓ'O€Âöp)J}úô ™ LxŒ –!Nö ÈÉu-Xñj|bbUM5D P¤½¥õäÉ“ÒÒÒ7®_×ÐÔ¬ª©¹~ý<b£¢!  !ÈÝ €b–ÿ‡¨(-:ØÄÀ0+=ãÉãÇ'Oœð÷ñЬ]³(ûñãG 7&2 ¢Â*ªrâ@•@-˜ÆÅhˆe )ii ,í¦Î˜ìAÔ±w÷P…:Áõk×áñÌÇÇ”¦‘… 4 €qÖ¸¹›áÞñÿŸÿüSñf6B)ç Îú’#€äúuë€ä䉓ಟ?ƒÄ¯_»FÐ6€¬q|Ã—Ë ‚ÂŒný[rú×½|ÎbÊQ L,Ð! РÌï_2\߯ gÌ Å .ÉÌÿ÷ÛÌuÄë–‘dØ @ƒ1 þ¿yÅðéÃóË w70¼}ýï ÓŸ'߸AP£&xxf¸¼ Ð` ˆÌ|?o°1œ¹Ìplÿ¿Ë¯¾Þâÿý„™EAœç?ãÑ)8ׯ] ,2á‚À⣭¥^šÀË xchÀoñEŽ ÀÇÅWÝüñëÛ—«¼ßϰ³iò¸E³fÎüüéÐK¢¢¢ÀZèá•Ë—_¿~@JÊ ‘È_¿~•mÛºõçÏŸŒŒ ÀEQAaDT¤’²2PX¹\¼pÈØ°nÝ©“§\\]!6N™4 €i§ë×…GJ–ÿ