 |
 |
 |
 |
 |
Author |
Message |
marius2k4
Joined: 24 May 2008 Posts: 1
|
Posted: Sat May 24, 2008 1:35 am Post subject: Where precisely is send_to_char defined? |
|
|
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 |
|
 |
|
 |
 |
 |
 |
 |
 |
 |
 |
Author |
Message |
KaVir

Joined: 11 May 2005 Posts: 565 Location: Munich
|
Posted: Sat May 24, 2008 9:57 am Post subject: |
|
|
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 |
|
 |
|
 |
 |
 |
 |
 |
 |
 |
 |
Author |
Message |
#endgame
Joined: 29 Oct 2006 Posts: 6
|
|
Back to top |
|
 |
|
 |
 |
 |
 |
 |
 |
 |
 |
Author |
Message |
Deadsoul
Joined: 29 Dec 2007 Posts: 42 Location: Southern Hellinois
|
Posted: Thu Jun 26, 2008 10:23 pm Post subject: |
|
|
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 |
|
 |
|
 |
 |
 |
 |
 |
 |
 |
 |
|
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
|
|
 |
 |
 |
 |
|
 |