lib/client.h File Reference

Client functions. More...

#include "line.h"
#include "transport.h"
#include <sys/time.h>
#include <glib.h>
#include <gmodule.h>

Go to the source code of this file.

Data Structures

struct  irc_client_callbacks
struct  irc_client
 Connection with a client. More...

Functions

G_MODULE_EXPORT void client_disconnect (struct irc_client *c, const char *reason)
 Disconnect a client.
G_MODULE_EXPORT
G_GNUC_NULL_TERMINATED
gboolean 
client_send_args (struct irc_client *c,...)
 Send a message to a client.
G_MODULE_EXPORT
G_GNUC_NULL_TERMINATED
gboolean 
client_send_args_ex (struct irc_client *c, const char *hm,...)
 Build a line and send it to a client.
G_MODULE_EXPORT
G_GNUC_NULL_TERMINATED
gboolean 
client_send_response (struct irc_client *c, int response,...)
 Send a response to a client.
G_MODULE_EXPORT gboolean client_send_line (struct irc_client *c, const struct irc_line *)
 Send a line to a client.
G_MODULE_EXPORT gboolean client_set_charset (struct irc_client *c, const char *name)
 Change the character set used to send data to a client.
G_MODULE_EXPORT const char * client_get_default_target (struct irc_client *c)
G_MODULE_EXPORT const char * client_get_own_hostmask (struct irc_client *c)
G_MODULE_EXPORT struct irc_clientclient_ref (struct irc_client *c)
G_MODULE_EXPORT void client_unref (struct irc_client *c)
G_MODULE_EXPORT struct irc_clientirc_client_new (struct irc_transport *transport, const char *default_origin, const char *desc, struct irc_client_callbacks *callbacks)
G_MODULE_EXPORT void clients_send_state (GList *clients, struct irc_network_state *s)
 Send stat to a list of clients.
G_MODULE_EXPORT void client_send_nameslist (struct irc_client *client, struct irc_channel_state *ch)
G_MODULE_EXPORT gboolean client_send_channel_state_diff (struct irc_client *client, struct irc_channel_state *old_state, struct irc_channel_state *new_state)
G_MODULE_EXPORT gboolean client_send_state_diff (struct irc_client *client, struct irc_network_state *old_state, struct irc_network_state *new_state)
 Send the diff between the current state to change it to some other state.
G_MODULE_EXPORT void client_send_channel_state (struct irc_client *c, struct irc_channel_state *ch)
G_MODULE_EXPORT void client_send_topic (struct irc_client *c, struct irc_channel_state *ch)
G_MODULE_EXPORT void client_send_banlist (struct irc_client *client, struct irc_channel_state *channel)
G_MODULE_EXPORT void client_send_channel_mode (struct irc_client *client, struct irc_channel_state *channel)
G_MODULE_EXPORT void client_send_luserchannels (struct irc_client *c, int num)
G_MODULE_EXPORT void client_send_motd (struct irc_client *c, char **lines)
 Send the Message of the Day to the client.
G_MODULE_EXPORT void client_parse_buffer (struct irc_client *client)
G_MODULE_EXPORT void client_log (enum log_level, const struct irc_client *c, const char *fmt,...)


Detailed Description

Client functions.


Function Documentation

G_MODULE_EXPORT void client_disconnect ( struct irc_client c,
const char *  reason 
)

Disconnect a client.

G_MODULE_EXPORT G_GNUC_NULL_TERMINATED gboolean client_send_args ( struct irc_client c,
  ... 
)

Send a message to a client.

Parameters:
c Client to send to
Returns:
whether the line was send correctly

G_MODULE_EXPORT G_GNUC_NULL_TERMINATED gboolean client_send_args_ex ( struct irc_client c,
const char *  hm,
  ... 
)

Build a line and send it to a client.

Parameters:
c Client to send to
hm Hostmask to use

G_MODULE_EXPORT gboolean client_send_line ( struct irc_client c,
const struct irc_line l 
)

Send a line to a client.

Parameters:
c Client to send to
l Line to send
Returns:
Whether the line was sent successfully

G_MODULE_EXPORT void client_send_motd ( struct irc_client c,
char **  lines 
)

Send the Message of the Day to the client.

Parameters:
c Client to send to.

G_MODULE_EXPORT G_GNUC_NULL_TERMINATED gboolean client_send_response ( struct irc_client c,
int  response,
  ... 
)

Send a response to a client.

Parameters:
c Client to send to
response Response number to send

G_MODULE_EXPORT gboolean client_send_state_diff ( struct irc_client client,
struct irc_network_state old_state,
struct irc_network_state new_state 
)

Send the diff between the current state to change it to some other state.

Parameters:
c Client to send to
state State to send
Returns:
Whether the state was sent correctly

G_MODULE_EXPORT gboolean client_set_charset ( struct irc_client c,
const char *  name 
)

Change the character set used to send data to a client.

Parameters:
c client to change the character set for
name name of the character set to change to
Returns:
whether changing the character set succeeded

G_MODULE_EXPORT void clients_send_state ( GList *  clients,
struct irc_network_state s 
)

Send stat to a list of clients.

Parameters:
clients List of clients
s State to send


Generated on Mon Apr 14 00:44:20 2008 for ctrlproxy by  doxygen 1.5.5