Where precisely is send_to_char defined?

 
Post new topic   Reply to topic    mudlab.org Forum Index -> Coding
View previous topic :: View next topic  
Author Message
marius2k4



Joined: 24 May 2008
Posts: 1

PostPosted: Sat May 24, 2008 1:35 am    Post subject: Where precisely is send_to_char defined? Reply with quote

I've been looking, and I feel rather stupid, but I'm trying to refresh myself on C, and I can't find where, for the life of me, it is defined outside of merc.h:

Quote:
void send_to_char args( ( const char *txt, CHAR_DATA *ch ) );


I see how it's parameters are set up, but I can't tell why it acts in an I/O capacity, similar to say, a printf() sort of thing. Does anyone know? I know this sounds newbie, but it looks to me like this is just a definition, with no functionality.

Thanks!
Back to top
View user's profile Send private message
Author Message
KaVir



Joined: 11 May 2005
Posts: 565
Location: Munich

PostPosted: Sat May 24, 2008 9:57 am    Post subject: Reply with quote

What you're looking at in the header file is the declaration. The actual definition is in comm.c (at least in Merc) - if you're using a Merc derivative it may have been moved, so do a grep for "void send_to_char".
Back to top
View user's profile Send private message Visit poster's website
Author Message
#endgame



Joined: 29 Oct 2006
Posts: 6

PostPosted: Mon Jun 02, 2008 12:03 pm    Post subject: Reply with quote

I don't know what OS you're running on, but when I develop on Linux using EMACS, I find tags tables to be really useful for this sort of thing: http://www.gnu.org/software/emacs/emacs-lisp-intro/html_node/etags.html
Back to top
View user's profile Send private message
Author Message
Deadsoul



Joined: 29 Dec 2007
Posts: 42
Location: Southern Hellinois

PostPosted: Thu Jun 26, 2008 10:23 pm    Post subject: Reply with quote

In diku, send_to_char () will reference to comm.c and comm.h

As send_to_char is defined as what is being sent, so in comm.c it actually does the sending to the defined link (i.e: current connection).

So the current connection has to be in the desc_list as active and not null, it has to have something to send, as well as the target. It may even require a color if your using ascii variants.

Once it has all of this, then it structures the buf completely, then it will do a write_to_q to the &ch->desc->output.

After that, thus your message is sent.

Technically, what its doing is a cheap, and lamer version of actc, without the extra variables.
Back to top
View user's profile Send private message Visit poster's website Yahoo Messenger
Display posts from previous:   
Post new topic   Reply to topic    mudlab.org Forum Index -> Coding All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum

Powered by phpBB © 2001, 2002 phpBB Group
BBTech Template by © 2003-04 MDesign