tclAppInit.cc File Reference

#include "config.h"

Include dependency graph for tclAppInit.cc:

Go to the source code of this file.

Defines

#define NS_BEGIN_EXTERN_C   extern "C" {
#define NS_END_EXTERN_C   }

Functions

void abort ()
void init_misc (void)
NS_BEGIN_EXTERN_C int main (int argc, char **argv)
static void setup_floating_point_environment ()
int Tcl_AppInit (Tcl_Interp *interp)

Variables

EmbeddedTcl et_ns_lib
EmbeddedTcl et_ns_ptypes


Define Documentation

#define NS_BEGIN_EXTERN_C   extern "C" {
 

Definition at line 29 of file tclAppInit.cc.

#define NS_END_EXTERN_C   }
 

Definition at line 30 of file tclAppInit.cc.


Function Documentation

void abort  ) 
 

Definition at line 277 of file tclAppInit.cc.

Referenced by abort(), Packet::access(), ReassemblyQueue::add(), MediaSegmentList::add(), MClientPagePool::add_segment(), imepAgent::aggregateObjectBlock(), Packet::alloc(), Packet::allocdata(), MClientPagePool::cache_replace(), TimerHandler::cancel(), SplayScheduler::cancel(), ListScheduler::cancel(), CBQClass::CBQClass(), MediaSegmentList::check_integrity(), HitCountList::check_integrity(), HttpMInvalCache::check_sstate(), ClientPage::ClientPage(), TcpAgent::closecwnd(), CorresHost::closecwnd(), TfrcSinkAgent::command(), QueueMonitorCompat::command(), TracePagePool::command(), Process::command(), MediaPagePool::command(), Marker::command(), FQ::command(), Demarker::command(), MediaRequest::copy(), Demarker::deque(), Scheduler::dispatch(), WebTrafSession::donePage(), EmpWebTrafSession::donePage(), QueueMonitorCompat::drop(), ReassemblyQueue::dumplist(), QueueMonitor::edrop(), RedPDQueue::enque(), JoBS::enque(), FQ::enque(), CBQueue::enque(), TfrcSinkAgent::est_loss(), CBQueue::find_lender(), LmsReceiver::find_nak(), imepAgent::findObjectSequence(), QueueMonitorCompat::flowstats(), TcpApp::get_data(), Process::get_data(), HttpUInvalAgent::get_data(), HttpApp::get_data(), MediaServer::get_reginfo(), Propagation::getDist(), TimerHandler::handle(), GridHandler::handle(), LmsSender::handle_lms_pkt(), imepAgent::handlerTimer(), TfrcAgent::initial_rate(), TcpAgent::initial_window(), NRAttribute::isEQ(), NRAttribute::isGE(), NRAttribute::isGT(), lf_get_next_entry(), IvsReceiver::lossMeter(), main(), Marker::Marker(), MediaSegmentList::merge_seg(), Node::namdump(), TcpAgent::opencwnd(), RFC793eduTcpAgent::opencwnd(), CorresHost::opencwnd(), QueueMonitorCompat::out(), QA::panic(), WebTrafPool::picksink(), EmpWebTrafPool::picksink(), EmpFtpTrafPool::picksink(), WebTrafPool::picktcp(), EmpWebTrafPool::picktcp(), EmpFtpTrafPool::picktcp(), Propagation::Pr(), Process::process_data(), MediaCache::process_data(), HttpMInvalCache::process_inv(), DSDV_Agent::processUpdate(), random(), FullTcpAgent::reass(), TraceFile::recv(), TfrcSinkAgent::recv(), rtqueue::recv(), IPNetwork::recv(), IcmpAgent::recv(), God::recv(), FQ::recv(), CBQueue::recv(), ArpAgent::recv(), aodv_rqueue::recv(), AckReconsController::recv(), SSMSRMAgent::recv_rep_sess(), HttpMInvalCache::recv_upd(), EmpWebTrafPool::recycleSink(), EmpWebTrafPool::recycleTcp(), toraAgent::rtNotifyLinkStatus(), TimerHandler::sched(), Scheduler::schedule(), LmsAgent::send_downstream(), RBPVegasTcpAgent::send_much(), LmsAgent::send_upstream(), Agent::sendmsg(), TfrcSinkAgent::sendpkt(), Agent::sendto(), EnergyModel::set_node_state(), RNG::set_package_seed(), RNG::set_seed(), WRR_CBQueue::setM(), ClientPage::split_name(), TcpApp::start(), MediaApp::start(), TcpApp::stop(), tcplib_telnet_interarrival(), TBF::timeout(), imepAgent::toraCreateHeader(), imepAgent::toraExtractHeader(), imepAgent::toraHeaderLength(), TracePagePool::TracePagePool(), Mac802_11::txtime(), ClientPage::validate(), EmpFtpTrafSession::~EmpFtpTrafSession(), EmpWebTrafSession::~EmpWebTrafSession(), and WebTrafSession::~WebTrafSession().

00278 {
00279     Tcl& tcl = Tcl::instance();
00280     tcl.evalc("[Simulator instance] flush-trace");
00281 #ifdef abort
00282 #undef abort
00283     abort();
00284 #else
00285     exit(1);
00286 #endif /*abort*/
00287     /*NOTREACHED*/
00288 }

void init_misc void   ) 
 

Definition at line 228 of file misc.cc.

00229 {
00230     (void)new VersionCommand;
00231     (void)new RandomCommand;
00232     (void)new TimeAtofCommand;
00233     (void)new HasInt64Command;
00234     (void)new HasSTLCommand;
00235 #if defined(HAVE_INT64)
00236     (void)new Add64Command;
00237     (void)new Mult64Command;
00238     (void)new Int64ToDoubleCommand;
00239 #endif
00240 }

NS_BEGIN_EXTERN_C int main int  argc,
char **  argv
 

Definition at line 65 of file tclAppInit.cc.

References Tcl_AppInit().

00066 {
00067     Tcl_Main(argc, argv, Tcl_AppInit);
00068     return 0;           /* Needed only to prevent compiler warning. */
00069 }

Here is the call graph for this function:

static void setup_floating_point_environment  )  [inline, static]
 

Definition at line 175 of file tclAppInit.cc.

Referenced by Tcl_AppInit().

00176 {
00177 #ifdef HAVE_NS_SETUP_FPU
00178 
00179     ns_setup_fpu();
00180 
00181 #else /* !HAVE_NS_SETUP_FPU */
00182 
00183     // In general, try to use the C99 standards to set things up.
00184     // If we can't do that, do nothing and hope the default is right.
00185 #ifdef HAVE_FESETPRECISION
00186     fesetprecision(FE_DBLPREC);
00187 #endif
00188 
00189 #ifdef HAVE_FEENABLEEXCEPT
00190     /*
00191      * In general we'd like to catch some serious exceptions (div by zero)
00192      * and ignore the boring ones (overflow/underflow).
00193      * We set up that up here.
00194      * This depends on feenableexcept which is (currently) GNU
00195      * specific.
00196      */
00197     int trap_exceptions = 0;
00198 #ifdef FE_DIVBYZERO
00199     trap_exceptions |= FE_DIVBYZERO;
00200 #endif
00201 #ifdef FE_INVALID
00202     trap_exceptions |= FE_INVALID;
00203 #endif
00204 #ifdef FE_OVERFLOW
00205     trap_exceptions |= FE_OVERFLOW;
00206 #endif
00207 //#ifdef FE_UNDERFLOW
00208 //  trap_exceptions |= FE_UNDERFLOW;
00209 //#endif
00210     
00211     feenableexcept(trap_exceptions);
00212 #endif /* HAVE_FEENABLEEXCEPT */
00213 #endif /* !HAVE_NS_SETUP_FPU */
00214 }

int Tcl_AppInit Tcl_Interp *  interp  ) 
 

Definition at line 237 of file tclAppInit.cc.

References et_ns_lib, et_ns_ptypes, init(), init_misc(), and setup_floating_point_environment().

Referenced by main().

00238 {
00239 #ifdef MEMDEBUG_SIMULATIONS
00240         extern MemTrace *globalMemTrace;
00241         globalMemTrace = new MemTrace;
00242 #endif
00243 
00244     setup_floating_point_environment();
00245        
00246     if (Tcl_Init(interp) == TCL_ERROR ||
00247         Otcl_Init(interp) == TCL_ERROR)
00248         return TCL_ERROR;
00249 
00250 #ifdef HAVE_LIBTCLDBG
00251     extern int Tcldbg_Init(Tcl_Interp *);   // hackorama
00252     if (Tcldbg_Init(interp) == TCL_ERROR) {
00253         return TCL_ERROR;
00254     }
00255 #endif
00256 
00257     Tcl_SetVar(interp, "tcl_rcFileName", "~/.ns.tcl", TCL_GLOBAL_ONLY);
00258     Tcl::init(interp, "ns");
00259     init_misc();
00260         et_ns_ptypes.load();
00261     et_ns_lib.load();
00262 
00263 
00264 #ifdef TCL_TEST
00265     if (Tcltest_Init(interp) == TCL_ERROR) {
00266         return TCL_ERROR;
00267     }
00268     Tcl_StaticPackage(interp, "Tcltest", Tcltest_Init,
00269               (Tcl_PackageInitProc *) NULL);
00270 #endif /* TCL_TEST */
00271 
00272     return TCL_OK;
00273 }

Here is the call graph for this function:


Variable Documentation

EmbeddedTcl et_ns_lib
 

Referenced by Tcl_AppInit().

EmbeddedTcl et_ns_ptypes
 

Referenced by Tcl_AppInit().


Generated on Tue Mar 6 17:00:57 2007 for ns2 Network Simulator 2.29 by  doxygen 1.4.6