Main Page | Modules | Namespace List | Class Hierarchy | Class List | File List | Class Members | File Members | Related Pages

infoserv.c File Reference

InfoServ Implementation. More...

#include "services.h"
#include "infoserv.h"
#include "nickserv.h"
#include "log.h"
#include "db.h"

Go to the source code of this file.

Functions

char * str_dup (const char *)
 Allocates and returns a copy of the supplied string.

void freeNews (SomeNews *theNews)
 Deallocate a news article.

void newsNag (UserList *nick)
 Nag users signing on/identifying about unread news.

void sendToInfoServ (UserList *nick, char **args, int numargs)
 Parse an InfoServ message.

cmd_return is_help (UserList *nick, char **args, int numargs)
 Help system entry point.

cmd_return is_save (UserList *nick, char **args, int numargs)
 Save all articles.

cmd_return is_sendinfo (UserList *nick, char **args, int numargs)
 /InfoServ READ

cmd_return is_listnews (UserList *nick, char **args, int numargs)
cmd_return is_postnews (UserList *nick, char **args, int numargs)
cmd_return is_delete (UserList *nick, char **args, int numargs)
 Delete an article.


Variables

time_t is_last_post_time = 0
 Last time_t of an InfoServ post.

interp::service_cmd_t infoserv_commands []
 InfoServ command dispatch data.

SomeNewsis_listhead = NULL
const char * priority_names []
 Levels of priority for InfoServ Articles.


Detailed Description

InfoServ Implementation.

Author:
Dafydd James

Greg Poma

James Hess

Date:
1997, 2000-2001
Id
infoserv.c,v 1.1.1.1 2003/07/04 02:54:05 Mysid Exp

Definition in file infoserv.c.


Function Documentation

cmd_return is_listnews UserList nick,
char **  args,
int  numargs
 

/IS listnews

Definition at line 293 of file infoserv.c.

References CTime, Newsitem::from, Newsitem::header, Newsitem::importance, InfoServ, is_listhead, isOper(), Newsitem::next, OOPER, PutReply, RET_OK, SomeNews, sSend(), and Newsitem::timestamp.

cmd_return is_postnews UserList nick,
char **  args,
int  numargs
 

is_postnews() - Sun Jan 4th, 1998 DuffJ args[0] = "post" args[1] = importance level (1 - 5) args[2] = one-word header. args[3] = content, up to max limit (NEWSCONTENTLEN)

Definition at line 341 of file infoserv.c.

References Newsitem::content, CTime, Newsitem::from, Newsitem::header, Newsitem::importance, InfoServ, is_last_post_time, is_listhead, Newsitem::next, oalloc(), OINFOPOST, opFlagged(), OROOT, OSERVOP, parse_str(), priority_names, PutHelpInfo, PutReply, RET_OK_DB, RET_SYNTAX, SomeNews, sSend(), strncpyzt, and Newsitem::timestamp.

void newsNag UserList nick  ) 
 

Nag users signing on/identifying about unread news.

Parameters:
Pointer to the online user to nag

Definition at line 116 of file infoserv.c.

References _userlist::caccess, Newsitem::content, CTime, Newsitem::header, Newsitem::importance, InfoServ, is_last_post_time, is_listhead, isOper(), Newsitem::next, _userlist::nick, OOPER, PutReply, _userlist::reg, SomeNews, sSend(), and Newsitem::timestamp.

Referenced by NickSeeUser().

void sendToInfoServ UserList nick,
char **  args,
int  numargs
 

Parse an InfoServ message.

Parameters:
nick Pointer to online user item sending message
args Array vector of parameters of which args[0] is the name of the command and args[numargs - 1] is the last parameter
numargs Number of accessible items in the args[] array
Precondition:
Nick points to a valid online user record. Args points to a string vector with numargs elements following PRIVMSG X :Y Z. args[0] is Y each space-separated token thereafter is an element.
Postcondition:
Command has been processed appropriately

Definition at line 183 of file infoserv.c.

References getOpFlags(), InfoServ, infoserv_commands, _userlist::nick, PutHelpInfo, PutReply, and RET_FAIL.

Referenced by parseLine().

char* str_dup const char *  input  ) 
 

Allocates and returns a copy of the supplied string.

Parameters:
input String to duplicate

Definition at line 597 of file stuff.c.


Variable Documentation

interp::service_cmd_t infoserv_commands[]
 

Initial value:

 {

  { "help", is_help,        0,      LOG_NO, 0,  5   },
  { "read", is_sendinfo,    0,      LOG_NO, 0,  5   },
  { "list", is_listnews,    0,      LOG_NO, 0,  9   },
  { "post", is_postnews,    OOPER,  LOG_NO, 0,  3   },
  { "del",  is_delete,      OOPER,  LOG_NO, 0,  3   },
  { "save", is_save,        OOPER,  LOG_NO, 0,  3   },
  { NULL,   NULL,           0,      LOG_NO, 0,  0   }
}
InfoServ command dispatch data.

Definition at line 67 of file infoserv.c.

Referenced by sendToInfoServ().

SomeNews* is_listhead = NULL
 

News article linked list head

Definition at line 81 of file infoserv.c.

Referenced by is_delete(), is_listnews(), is_postnews(), is_sendinfo(), newsNag(), readInfoData(), and saveInfoData().

const char* priority_names[]
 

Initial value:

{
    "IRCops Only",
    "Informational",
    "General announcement",
    "Important information",
    "URGENT Notice",
    "Critical message",
    "Unknown",
}
Levels of priority for InfoServ Articles.

Definition at line 84 of file infoserv.c.

Referenced by is_postnews(), and is_sendinfo().


Generated at Sat Oct 25 20:56:11 2003 for Services using Doxygen.
Services Copyr. 1996-2001 Chip Norkus, Max Byrd, Greg Poma, Michael Graff, James Hess, Dafydd James. All rights reserved See LICENSE for licensing information.