channel.c File Reference

Plugin that provides a Channel service. More...

#include <assert.h>
#include <stdarg.h>
#include <stddef.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "boris.h"

Include dependency graph for channel.c:

Go to the source code of this file.

Data Structures

struct  channel
struct  channel_public
struct  plugin_channel_class

Defines

#define CHANNEL_SEND_MAX   1024
#define DEBUG(msg,...)   fprintf(stderr, "%s():%d:" msg "\n", __func__, __LINE__, __VA_ARGS__)

Functions

static int channel_add_member (struct channel *ch, struct channel_member *cm)
 add member to a channel.
static int channel_broadcast (struct channel *ch, struct channel_member **exclude_list, unsigned exclude_list_len, const char *fmt,...)
 send a message to everyone except those on exclude_list.
static int channel_delete_member (struct channel *ch, struct channel_member *cm)
 remove a member from a channel.
static struct channel_member ** channel_find_member (struct channel *ch, struct channel_member *cm)
 test for membership in a channel.
static void channel_init (struct channel *ch)
static int channel_join (struct channel *ch, struct channel_member *cm)
 join a channel.
static void channel_part (struct channel *ch, struct channel_member *cm)
 leave a channel.
static struct channelchannel_public (const char *name)
 get a channel by numeric id.
static int channel_public_add (const char *name)
 define a new public channel.
static struct channel_publicchannel_public_find (const char *name)
static int initialize (void)
 Initialize the plugin.
static int is_on_list (const struct channel_member *cm, struct channel_member **exclude_list, unsigned exclude_list_len)
 exclude_list can only be NULL if exclude_list_len is 0.
 LIST_HEAD (struct channel_public_list, struct channel_public)
static int shutdown (void)
 Shutdown the plugin.

Variables

static struct channel_public_list channel_public_list
struct plugin_channel_class plugin_class
 Class for the plugin.


Detailed Description

Plugin that provides a Channel service.

Author:
Jon Mayo <jon.mayo@gmail.com>
Date:
2009 Dec 27
Copyright 2009 Jon Mayo Ms-RL : See COPYING.txt for complete license text.

Definition in file channel.c.


Define Documentation

#define CHANNEL_SEND_MAX   1024

Definition at line 24 of file channel.c.

#define DEBUG ( msg,
...   )     fprintf(stderr, "%s():%d:" msg "\n", __func__, __LINE__, __VA_ARGS__)

Definition at line 25 of file channel.c.


Function Documentation

static int channel_add_member ( struct channel ch,
struct channel_member cm 
) [static]

add member to a channel.

Definition at line 97 of file channel.c.

Here is the call graph for this function:

Here is the caller graph for this function:

static int channel_broadcast ( struct channel ch,
struct channel_member **  exclude_list,
unsigned  exclude_list_len,
const char *  fmt,
  ... 
) [static]

send a message to everyone except those on exclude_list.

Definition at line 262 of file channel.c.

Here is the call graph for this function:

static int channel_delete_member ( struct channel ch,
struct channel_member cm 
) [static]

remove a member from a channel.

Definition at line 120 of file channel.c.

Here is the call graph for this function:

Here is the caller graph for this function:

static struct channel_member** channel_find_member ( struct channel ch,
struct channel_member cm 
) [static, read]

test for membership in a channel.

Definition at line 78 of file channel.c.

Here is the caller graph for this function:

static void channel_init ( struct channel ch  )  [static]

Definition at line 70 of file channel.c.

Here is the caller graph for this function:

static int channel_join ( struct channel ch,
struct channel_member cm 
) [static]

join a channel.

Definition at line 233 of file channel.c.

Here is the call graph for this function:

static void channel_part ( struct channel ch,
struct channel_member cm 
) [static]

leave a channel.

Definition at line 241 of file channel.c.

Here is the call graph for this function:

static struct channel* channel_public ( const char *  name  )  [static, read]

get a channel by numeric id.

Definition at line 199 of file channel.c.

Here is the call graph for this function:

static int channel_public_add ( const char *  name  )  [static]

define a new public channel.

Definition at line 164 of file channel.c.

Here is the call graph for this function:

Here is the caller graph for this function:

static struct channel_public* channel_public_find ( const char *  name  )  [static, read]

Definition at line 147 of file channel.c.

Here is the caller graph for this function:

static int initialize ( void   )  [static]

Initialize the plugin.

Definition at line 211 of file channel.c.

Here is the call graph for this function:

static int is_on_list ( const struct channel_member cm,
struct channel_member **  exclude_list,
unsigned  exclude_list_len 
) [static]

exclude_list can only be NULL if exclude_list_len is 0.

Definition at line 251 of file channel.c.

Here is the caller graph for this function:

LIST_HEAD ( struct channel_public_list  ,
struct channel_public   
)

static int shutdown ( void   )  [static]

Shutdown the plugin.

Definition at line 223 of file channel.c.

Here is the call graph for this function:


Variable Documentation

Definition at line 65 of file channel.c.

Initial value:

 {
    .base_class = { PLUGIN_API, "channel", initialize, shutdown },
    .channel_interface = {
        channel_join, channel_part,
        channel_public,
        channel_broadcast,
    },
}
Class for the plugin.

the only external symbol.

Definition at line 288 of file channel.c.


Generated on Mon Dec 28 09:03:34 2009 for boris by  doxygen 1.5.8