Changeset 1267

Show
Ignore:
Timestamp:
11/15/08 20:26:00 (2 months ago)
Author:
ahu
Message:

::arg()

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/pdns/pdns/dynloader.cc

    r1254 r1267  
    5555 
    5656  static char pietje[128]="!@@SYSCONFDIR@@:"; 
    57   arg().set("config-dir","Location of configuration directory (pdns.conf)")= 
     57  ::arg().set("config-dir","Location of configuration directory (pdns.conf)")= 
    5858    strcmp(pietje+1,"@@SYSCONFDIR@@:") ? pietje+strlen("@@SYSCONFDIR@@:")+1 : SYSCONFDIR; 
    5959   
    60   arg().set("socket-dir","Where the controlsocket will live")=LOCALSTATEDIR; 
    61   arg().set("remote-address","Remote address to query"); 
    62   arg().set("remote-port","Remote port to query")="53000"; 
    63   arg().set("secret","Secret needed to connect to remote PowerDNS"); 
     60  ::arg().set("socket-dir","Where the controlsocket will live")=LOCALSTATEDIR; 
     61  ::arg().set("remote-address","Remote address to query"); 
     62  ::arg().set("remote-port","Remote port to query")="53000"; 
     63  ::arg().set("secret","Secret needed to connect to remote PowerDNS"); 
    6464 
    65   arg().set("config-name","Name of this virtual configuration - will rename the binary image")=""; 
    66   arg().set("chroot","")=""; 
    67   arg().setCmd("help","Provide a helpful message"); 
    68   arg().laxParse(argc,argv); 
     65  ::arg().set("config-name","Name of this virtual configuration - will rename the binary image")=""; 
     66  ::arg().set("chroot","")=""; 
     67  ::arg().setCmd("help","Provide a helpful message"); 
     68  ::arg().laxParse(argc,argv); 
    6969 
    70   if(arg().mustDo("help")) { 
     70  if(::arg().mustDo("help")) { 
    7171    cerr<<"syntax:"<<endl<<endl; 
    72     cerr<<arg().helpstring(arg()["help"])<<endl; 
     72    cerr<<::arg().helpstring(::arg()["help"])<<endl; 
    7373    exit(99); 
    7474  } 
    7575 
    76   if(arg()["config-name"]!="")  
    77     s_programname+="-"+arg()["config-name"]; 
     76  if(::arg()["config-name"]!="")  
     77    s_programname+="-"+::arg()["config-name"]; 
    7878 
    79   string configname=arg()["config-dir"]+"/"+s_programname+".conf"; 
     79  string configname=::arg()["config-dir"]+"/"+s_programname+".conf"; 
    8080  cleanSlashes(configname); 
    8181   
    82   arg().laxFile(configname.c_str()); 
    83   string socketname=arg()["socket-dir"]+"/"+s_programname+".controlsocket"; 
    84   if(arg()["chroot"].empty()) 
     82  ::arg().laxFile(configname.c_str()); 
     83  string socketname=::arg()["socket-dir"]+"/"+s_programname+".controlsocket"; 
     84  if(::arg()["chroot"].empty()) 
    8585    localdir="/tmp"; 
    8686  else 
    8787    localdir=dirname(strdup(socketname.c_str())); 
    8888 
    89   const vector<string>&commands=arg().getCommands(); 
     89  const vector<string>&commands=::arg().getCommands(); 
    9090 
    9191  if(commands.empty()) { 
     
    9797    string command=commands[0]; 
    9898    shared_ptr<DynMessenger> D; 
    99     if(arg()["remote-address"].empty()) 
     99    if(::arg()["remote-address"].empty()) 
    100100      D=shared_ptr<DynMessenger>(new DynMessenger(localdir,socketname)); 
    101101    else { 
    102102      uint16_t port; 
    103103      try { 
    104         port  = lexical_cast<uint16_t>(arg()["remote-port"]); 
     104        port  = lexical_cast<uint16_t>(::arg()["remote-port"]); 
    105105      } 
    106106      catch(...) { 
    107         cerr<<"Unable to convert '"<<arg()["remote-port"]<<"' to a port number for connecting to remote PowerDNS\n"; 
     107        cerr<<"Unable to convert '"<<::arg()["remote-port"]<<"' to a port number for connecting to remote PowerDNS\n"; 
    108108        exit(99); 
    109109      } 
    110110       
    111       D=shared_ptr<DynMessenger>(new DynMessenger(ComboAddress(arg()["remote-address"], port), arg()["secret"])); 
     111      D=shared_ptr<DynMessenger>(new DynMessenger(ComboAddress(::arg()["remote-address"], port), ::arg()["secret"])); 
    112112    } 
    113113