[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [ns] - NS main function



On Thu, 8 Mar 2001, Mark Butler wrote:


> Sorry, I probably should have been more specific;
>
> I would like to know which function in the C++ code is executed first when
> running ./ns <tclfile> from the command line. The first operation of NS, as
> far as I can gather, is to read in the tclfile or read in from the command
> line. Is this from the main function in tclAppInit.cc ? There are also main
> functions in dem.cc, ns_tclsh.cc, route.cc, tcplib-telnet.cc, tkAppInit.cc
> so is it one of these functions that is run first ?

It is the main function in tclAppInit which is called when running ns
from command line.
ns_tclsh.cc was retired long time back (see CHANGES.html) and was replaced
with tclAppInit.cc and tkAppInit.cc. I think tkAppInit.cc is used for running
Tk-based applications like wish while tclAppInit is for tcl-only applications.

All other files having main functions (dem.cc, tcplib-telnet.cc etc) are
mostly ifdef'ed/commented out and are not used.

Hope this helps,
--Padma.

>
> They are all compiled and linked within the Makefile and so I'm not sure
> which one is actually executed first. I'm used to programs only having one
> main function ;-)
>
> Cheers,
> Mark
>
>
> >From: Padmaparna Haldar <[email protected]>
> >To: Mark Butler <[email protected]>
> >CC: <[email protected]>
> >Subject: Re: [ns] - NS main function
> >Date: Wed, 7 Mar 2001 14:13:52 -0800 (PST)
> >
> >On Wed, 7 Mar 2001, Mark Butler wrote:
> >
> >
> > > Hi,
> > >
> > > Which function is the first to be called when executing the ns
> >executable ?
> > > I want to have another program (compiled into ns) starting up ns.
> >
> >
> >"$ns run" starts the actual simulation. Pl see example tclfiles under
> >~ns/tcl/ex/.
> >
> >--Padma.
> >
> > >
> > > Thanks,
> > >
> > > Mark
> > >
> > > _________________________________________________________________
> > > Get your FREE download of MSN Explorer at http://explorer.msn.com
> > >
> >
> >--
> >------------------------------------------------
> >Be true to your work, your word, and your friend.
> >--Thoreau
> >
> >Padmaparna Haldar
> >
>
> _________________________________________________________________
> Get your FREE download of MSN Explorer at http://explorer.msn.com
>

-- 
------------------------------------------------
Be true to your work, your word, and your friend.
--Thoreau

Padmaparna Haldar