]> arthur.barton.de Git - ngircd-alex.git/commitdiff
- neue Funktionen Channel_Topic() und Channel_SetTopic().
authorAlexander Barton <alex@barton.de>
Wed, 27 Feb 2002 20:32:10 +0000 (20:32 +0000)
committerAlexander Barton <alex@barton.de>
Wed, 27 Feb 2002 20:32:10 +0000 (20:32 +0000)
src/ngircd/channel.c
src/ngircd/channel.h

index 4f0482d7ed68d2d0f901fcdf5f3df4c6ba0115b9..561d9aa0958a7c658c4f02cece2f9c138ba09451 100644 (file)
@@ -9,11 +9,14 @@
  * Naehere Informationen entnehmen Sie bitter der Datei COPYING. Eine Liste
  * der an ngIRCd beteiligten Autoren finden Sie in der Datei AUTHORS.
  *
- * $Id: channel.c,v 1.14 2002/02/27 15:21:21 alex Exp $
+ * $Id: channel.c,v 1.15 2002/02/27 20:32:10 alex Exp $
  *
  * channel.c: Management der Channels
  *
  * $Log: channel.c,v $
+ * Revision 1.15  2002/02/27 20:32:10  alex
+ * - neue Funktionen Channel_Topic() und Channel_SetTopic().
+ *
  * Revision 1.14  2002/02/27 15:21:21  alex
  * - neue Funktion Channel_IsMemberOf() implementiert.
  *
@@ -449,6 +452,23 @@ GLOBAL BOOLEAN Channel_IsMemberOf( CHANNEL *Chan, CLIENT *Client )
 } /* Channel_IsMemberOf */
 
 
+GLOBAL CHAR *Channel_Topic( CHANNEL *Chan )
+{
+       assert( Chan != NULL );
+       return Chan->topic;
+} /* Channel_Topic */
+
+
+GLOBAL VOID Channel_SetTopic( CHANNEL *Chan, CHAR *Topic )
+{
+       assert( Chan != NULL );
+       assert( Topic != NULL );
+       
+       strncpy( Chan->topic, Topic, CHANNEL_TOPIC_LEN );
+       Chan->topic[CHANNEL_TOPIC_LEN - 1] = '\0';
+} /* Channel_SetTopic */
+
+
 LOCAL CHANNEL *New_Chan( CHAR *Name )
 {
        /* Neue Channel-Struktur anlegen */
@@ -467,6 +487,7 @@ LOCAL CHANNEL *New_Chan( CHAR *Name )
        strncpy( c->name, Name, CHANNEL_NAME_LEN );
        c->name[CHANNEL_NAME_LEN - 1] = '\0';
        strcpy( c->modes, "" );
+       strcpy( c->topic, "" );
 
        Log( LOG_DEBUG, "Created new channel structure for \"%s\".", Name );
        
index 85695ee64d5b942e9ad3f0a3f02ddc95185b55f8..22189c43ab18fa282b4fd467340f38d1c68108ce 100644 (file)
@@ -9,11 +9,14 @@
  * Naehere Informationen entnehmen Sie bitter der Datei COPYING. Eine Liste
  * der an ngIRCd beteiligten Autoren finden Sie in der Datei AUTHORS.
  *
- * $Id: channel.h,v 1.12 2002/02/27 15:21:21 alex Exp $
+ * $Id: channel.h,v 1.13 2002/02/27 20:32:10 alex Exp $
  *
  * channel.h: Management der Channels (Header)
  *
  * $Log: channel.h,v $
+ * Revision 1.13  2002/02/27 20:32:10  alex
+ * - neue Funktionen Channel_Topic() und Channel_SetTopic().
+ *
  * Revision 1.12  2002/02/27 15:21:21  alex
  * - neue Funktion Channel_IsMemberOf() implementiert.
  *
@@ -70,6 +73,7 @@ typedef struct _CHANNEL
        struct _CHANNEL *next;
        CHAR name[CHANNEL_NAME_LEN];    /* Name des Channel */
        CHAR modes[CHANNEL_MODE_LEN];   /* Channel-Modes */
+       CHAR topic[CHANNEL_TOPIC_LEN];  /* Topic des Channels */
 } CHANNEL;
 
 typedef struct _CLIENT2CHAN
@@ -100,6 +104,9 @@ GLOBAL INT Channel_Count( VOID );
 
 GLOBAL CHAR *Channel_Name( CHANNEL *Chan );
 GLOBAL CHAR *Channel_Modes( CHANNEL *Chan );
+GLOBAL CHAR *Channel_Topic( CHANNEL *Chan );
+
+GLOBAL VOID Channel_SetTopic( CHANNEL *Chan, CHAR *Topic );
 
 GLOBAL CHANNEL *Channel_Search( CHAR *Name );